Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93622
b: refs/heads/master
c: 5e657a9
h: refs/heads/master
v: v3
  • Loading branch information
Borislav Petkov authored and Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent 8181ab4 commit 28e4a48
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9aba468e4ae834dd0ee37004e5d07309684e14d2
refs/heads/master: 5e657a9e29baa0d8f5c0cf99372100d397340f00
71 changes: 35 additions & 36 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1695,15 +1695,6 @@ int ide_cdrom_probe_capabilities(ide_drive_t *drive)
return nslots;
}

#ifdef CONFIG_IDE_PROC_FS
static void ide_cdrom_add_settings(ide_drive_t *drive)
{
ide_add_setting(drive, "dsc_overlap", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->dsc_overlap, NULL);
}
#else
static inline void ide_cdrom_add_settings(ide_drive_t *drive) { ; }
#endif

/*
* standard prep_rq_fn that builds 10 byte cmds
*/
Expand Down Expand Up @@ -1789,6 +1780,41 @@ struct cd_list_entry {
unsigned int cd_flags;
};

#ifdef CONFIG_IDE_PROC_FS
static sector_t ide_cdrom_capacity(ide_drive_t *drive)
{
unsigned long capacity, sectors_per_frame;

if (cdrom_read_capacity(drive, &capacity, &sectors_per_frame, NULL))
return 0;

return capacity * sectors_per_frame;
}

static int proc_idecd_read_capacity
(char *page, char **start, off_t off, int count, int *eof, void *data)
{
ide_drive_t *drive = data;
int len;

len = sprintf(page, "%llu\n", (long long)ide_cdrom_capacity(drive));
PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
}

static ide_proc_entry_t idecd_proc[] = {
{ "capacity", S_IFREG|S_IRUGO, proc_idecd_read_capacity, NULL },
{ NULL, 0, NULL, NULL }
};

static void ide_cdrom_add_settings(ide_drive_t *drive)
{
ide_add_setting(drive, "dsc_overlap", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1,
&drive->dsc_overlap, NULL);
}
#else
static inline void ide_cdrom_add_settings(ide_drive_t *drive) { ; }
#endif

static const struct cd_list_entry ide_cd_quirks_list[] = {
/* Limit transfer size per interrupt. */
{ "SAMSUNG CD-ROM SCR-2430", NULL, IDE_CD_FLAG_LIMIT_NFRAMES },
Expand Down Expand Up @@ -1929,33 +1955,6 @@ static void ide_cd_release(struct kref *kref)

static int ide_cd_probe(ide_drive_t *);

#ifdef CONFIG_IDE_PROC_FS
static sector_t ide_cdrom_capacity(ide_drive_t *drive)
{
unsigned long capacity, sectors_per_frame;

if (cdrom_read_capacity(drive, &capacity, &sectors_per_frame, NULL))
return 0;

return capacity * sectors_per_frame;
}

static int proc_idecd_read_capacity
(char *page, char **start, off_t off, int count, int *eof, void *data)
{
ide_drive_t *drive = data;
int len;

len = sprintf(page, "%llu\n", (long long)ide_cdrom_capacity(drive));
PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
}

static ide_proc_entry_t idecd_proc[] = {
{ "capacity", S_IFREG|S_IRUGO, proc_idecd_read_capacity, NULL },
{ NULL, 0, NULL, NULL }
};
#endif

static ide_driver_t ide_cdrom_driver = {
.gen_driver = {
.owner = THIS_MODULE,
Expand Down

0 comments on commit 28e4a48

Please sign in to comment.