]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ide-cd: capability flag for MO drives
authorJens Axboe <axboe@suse.de>
Tue, 1 Jul 2003 02:35:27 +0000 (19:35 -0700)
committerAnton Blanchard <anton@samba.org>
Tue, 1 Jul 2003 02:35:27 +0000 (19:35 -0700)
From: Pascal Schmidt <der.eremit@email.de>

Add capability flag for MO drives. Since ATAPI MOs are now recognized
by the ide-cd driver, it is useful to have a capability flag to be able
to tell MO drives from other drives (needed for later write support).

drivers/ide/ide-cd.c
drivers/ide/ide-cd.h
include/linux/cdrom.h

index 7dac5c708fabdde564220f47f4be4ac530672166..fede3d71bc515cdce39da1e25a59817ce7ed9d50 100644 (file)
@@ -2805,7 +2805,7 @@ static struct cdrom_device_ops ide_cdrom_dops = {
                                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_MO_DRIVE,
        .generic_packet         = ide_cdrom_packet,
 };
 
@@ -2838,6 +2838,8 @@ static int ide_cdrom_register (ide_drive_t *drive, int nslots)
                devinfo->mask |= CDC_PLAY_AUDIO;
        if (!CDROM_CONFIG_FLAGS(drive)->close_tray)
                devinfo->mask |= CDC_CLOSE_TRAY;
+       if (!CDROM_CONFIG_FLAGS(drive)->mo_drive)
+               devinfo->mask |= CDC_MO_DRIVE;
 
        return register_cdrom(devinfo);
 }
@@ -2884,6 +2886,7 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
        int nslots = 1;
 
        if (drive->media == ide_optical) {
+               CDROM_CONFIG_FLAGS(drive)->mo_drive = 1;
                printk("%s: ATAPI magneto-optical drive\n", drive->name);
                return nslots;
        }
index 6a08e3e210a9838c37c240dbbb2f22d51625e66d..5b25f2e37ac1caf2df983b71532178af4067b123 100644 (file)
@@ -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 mo_drive           : 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 3fb8581cde52a48e9a527845d37999075fb8aad0..97265afb867f99d7b439f290252ad47eebcca39b 100644 (file)
@@ -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_MO_DRIVE           0x40000 /* drive is an MO device */
 
 /* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
 #define CDS_NO_INFO            0       /* if not implemented */