* [PATCH 2.5-bkcvs] capability flag for ATAPI MO drives
@ 2003-05-29 13:52 Pascal Schmidt
2003-06-02 10:45 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Pascal Schmidt @ 2003-05-29 13:52 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel
Hi!
Now that ide-cd in 2.5 deals with ATAPI MO drivers, I think there
should be a configuration/capability flag to identify the drive
as an MO drive. This will be needed for later write support so that
drivers/cdrom.c can tell that this drive is capable of writing.
Please apply and/or comment.
Jens, how will ide-cd.c/cdrom.c fly with sector sizes of 512 or
1024 bytes? There are MO disks with those sector sizes. I only have
640 MB disks with 2048 byte sector size, so I can't test.
Index: drivers/ide/ide-cd.c
===================================================================
RCS file: /home/bkcvs/linux-2.5/drivers/ide/ide-cd.c,v
retrieving revision 1.110
diff -u -3 -b -p -r1.110 ide-cd.c
--- drivers/ide/ide-cd.c 27 May 2003 14:42:16 -0000 1.110
+++ drivers/ide/ide-cd.c 29 May 2003 13:34:50 -0000
@@ -2794,7 +2794,7 @@ static struct cdrom_device_ops ide_cdrom
CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO | CDC_RESET |
CDC_IOCTLS | CDC_DRIVE_STATUS | CDC_CD_R |
CDC_CD_RW | CDC_DVD | CDC_DVD_R| CDC_DVD_RAM |
- CDC_GENERIC_PACKET,
+ CDC_GENERIC_PACKET | CDC_OPTICAL,
.generic_packet = ide_cdrom_packet,
};
@@ -2827,6 +2827,8 @@ static int ide_cdrom_register (ide_drive
devinfo->mask |= CDC_PLAY_AUDIO;
if (!CDROM_CONFIG_FLAGS(drive)->close_tray)
devinfo->mask |= CDC_CLOSE_TRAY;
+ if (!CDROM_CONFIG_FLAGS(drive)->optical)
+ devinfo->mask |= CDC_OPTICAL;
return register_cdrom(devinfo);
}
@@ -2873,6 +2875,7 @@ int ide_cdrom_probe_capabilities (ide_dr
int nslots = 1;
if (drive->media == ide_optical) {
+ CDROM_CONFIG_FLAGS(drive)->optical = 1;
printk("%s: ATAPI magneto-optical drive\n", drive->name);
return nslots;
}
Index: drivers/ide/ide-cd.h
===================================================================
RCS file: /home/bkcvs/linux-2.5/drivers/ide/ide-cd.h,v
retrieving revision 1.16
diff -u -3 -b -p -r1.16 ide-cd.h
--- drivers/ide/ide-cd.h 2 Nov 2002 21:12:01 -0000 1.16
+++ drivers/ide/ide-cd.h 8 May 2003 14:21:50 -0000
@@ -85,7 +85,8 @@ struct ide_cd_config_flags {
__u8 audio_play : 1; /* can do audio related commands */
__u8 close_tray : 1; /* can close the tray */
__u8 writing : 1; /* pseudo write in progress */
- __u8 reserved : 3;
+ __u8 optical : 1; /* drive is an MO device */
+ __u8 reserved : 2;
byte max_speed; /* Max speed of the drive */
};
#define CDROM_CONFIG_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->config_flags))
Index: include/linux/cdrom.h
===================================================================
RCS file: /home/bkcvs/linux-2.5/include/linux/cdrom.h,v
retrieving revision 1.14
diff -u -3 -b -p -r1.14 cdrom.h
--- include/linux/cdrom.h 24 Apr 2003 01:27:54 -0000 1.14
+++ include/linux/cdrom.h 8 May 2003 14:23:21 -0000
@@ -387,6 +387,7 @@ struct cdrom_generic_command
#define CDC_DVD 0x8000 /* drive is a DVD */
#define CDC_DVD_R 0x10000 /* drive can write DVD-R */
#define CDC_DVD_RAM 0x20000 /* drive can write DVD-RAM */
+#define CDC_OPTICAL 0x40000 /* drive is an MO device */
/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
#define CDS_NO_INFO 0 /* if not implemented */
--
Ciao,
Pascal
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 2.5-bkcvs] capability flag for ATAPI MO drives
2003-05-29 13:52 [PATCH 2.5-bkcvs] capability flag for ATAPI MO drives Pascal Schmidt
@ 2003-06-02 10:45 ` Jens Axboe
0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2003-06-02 10:45 UTC (permalink / raw)
To: Pascal Schmidt; +Cc: linux-kernel
On Thu, May 29 2003, Pascal Schmidt wrote:
>
> Hi!
>
> Now that ide-cd in 2.5 deals with ATAPI MO drivers, I think there
> should be a configuration/capability flag to identify the drive
> as an MO drive. This will be needed for later write support so that
> drivers/cdrom.c can tell that this drive is capable of writing.
>
> Please apply and/or comment.
>
> Jens, how will ide-cd.c/cdrom.c fly with sector sizes of 512 or
> 1024 bytes? There are MO disks with those sector sizes. I only have
> 640 MB disks with 2048 byte sector size, so I can't test.
It probably wont. I'd be reluctant to actually allow that without
someone doing the footwork of making sure it generally works. I'm not
sure it does.
Patch looks fine, btw.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20030529140013$347f@gated-at.bofh.it>]
end of thread, other threads:[~2003-06-02 13:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-29 13:52 [PATCH 2.5-bkcvs] capability flag for ATAPI MO drives Pascal Schmidt
2003-06-02 10:45 ` Jens Axboe
[not found] <20030529140013$347f@gated-at.bofh.it>
[not found] ` <20030602105009$4590@gated-at.bofh.it>
2003-06-02 13:24 ` Pascal Schmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox