Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / linux / cdrom.h
index 8fcf9bc..3c9b0bc 100644 (file)
@@ -237,9 +237,9 @@ struct cdrom_read
 struct cdrom_read_audio
 {
        union cdrom_addr addr; /* frame address */
-       __u8 addr_format;    /* CDROM_LBA or CDROM_MSF */
+       __u8 addr_format;      /* CDROM_LBA or CDROM_MSF */
        int nframes;           /* number of 2352-byte-frames to read at once */
-       __u8 *buf;           /* frame buffer (size: nframes*2352 bytes) */
+       __u8 __user *buf;      /* frame buffer (size: nframes*2352 bytes) */
 };
 
 /* This struct is used with the CDROMMULTISESSION ioctl */
@@ -280,17 +280,16 @@ struct cdrom_blk
 struct cdrom_generic_command
 {
        unsigned char           cmd[CDROM_PACKET_SIZE];
-       unsigned char           *buffer;
+       unsigned char           __user *buffer;
        unsigned int            buflen;
        int                     stat;
-       struct request_sense    *sense;
+       struct request_sense    __user *sense;
        unsigned char           data_direction;
        int                     quiet;
        int                     timeout;
-       void                    *reserved[1];
+       void                    __user *reserved[1];    /* unused, actually */
 };
 
-
 /*
  * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336, 
  * 2340, or 2352 bytes long.  
@@ -379,7 +378,6 @@ struct cdrom_generic_command
 #define CDC_MEDIA_CHANGED      0x80    /* media changed */
 #define CDC_PLAY_AUDIO         0x100   /* audio functions */
 #define CDC_RESET               0x200   /* hard reset device */
-#define CDC_IOCTLS              0x400   /* driver has non-standard ioctls */
 #define CDC_DRIVE_STATUS        0x800   /* driver implements drive status */
 #define CDC_GENERIC_PACKET     0x1000  /* driver implements generic packets */
 #define CDC_CD_R               0x2000  /* drive is a CD-R */
@@ -453,6 +451,7 @@ struct cdrom_generic_command
 #define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL  0x1e
 #define GPCMD_READ_10                      0x28
 #define GPCMD_READ_12                      0xa8
+#define GPCMD_READ_BUFFER_CAPACITY         0x5c
 #define GPCMD_READ_CDVD_CAPACITY           0x25
 #define GPCMD_READ_CD                      0xbe
 #define GPCMD_READ_CD_MSF                  0xb9
@@ -467,9 +466,10 @@ struct cdrom_generic_command
 #define GPCMD_REPORT_KEY                   0xa4
 #define GPCMD_REQUEST_SENSE                0x03
 #define GPCMD_RESERVE_RZONE_TRACK          0x53
+#define GPCMD_SEND_CUE_SHEET               0x5d
 #define GPCMD_SCAN                         0xba
 #define GPCMD_SEEK                         0x2b
-#define GPCMD_SEND_DVD_STRUCTURE           0xad
+#define GPCMD_SEND_DVD_STRUCTURE           0xbf
 #define GPCMD_SEND_EVENT                   0xa2
 #define GPCMD_SEND_KEY                     0xa3
 #define GPCMD_SEND_OPC                     0x54
@@ -499,6 +499,7 @@ struct cdrom_generic_command
 #define GPMODE_VENDOR_PAGE             0x00
 #define GPMODE_R_W_ERROR_PAGE          0x01
 #define GPMODE_WRITE_PARMS_PAGE                0x05
+#define GPMODE_WCACHING_PAGE           0x08
 #define GPMODE_AUDIO_CTL_PAGE          0x0e
 #define GPMODE_POWER_PAGE              0x1a
 #define GPMODE_FAULT_FAIL_PAGE         0x1c
@@ -907,6 +908,19 @@ struct mode_page_header {
 #include <linux/fs.h>          /* not really needed, later.. */
 #include <linux/device.h>
 
+struct packet_command
+{
+       unsigned char           cmd[CDROM_PACKET_SIZE];
+       unsigned char           *buffer;
+       unsigned int            buflen;
+       int                     stat;
+       struct request_sense    *sense;
+       unsigned char           data_direction;
+       int                     quiet;
+       int                     timeout;
+       void                    *reserved[1];
+};
+
 /*
  * _OLD will use PIO transfer on atapi devices, _BPC_* will use DMA
  */
@@ -934,6 +948,8 @@ struct cdrom_device_info {
         __u8 reserved          : 6;    /* not used yet */
        int cdda_method;                /* see flags */
        __u8 last_sense;
+       __u8 media_written;             /* dirty flag, DVD+RW bookkeeping */
+       unsigned short mmc3_profile;    /* current MMC3 profile */
        int for_data;
        int (*exit)(struct cdrom_device_info *);
        int mrw_mode_page;
@@ -957,23 +973,21 @@ struct cdrom_device_ops {
        int (*reset) (struct cdrom_device_info *);
        /* play stuff */
        int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *);
-       /* dev-specific */
-       int (*dev_ioctl) (struct cdrom_device_info *,
-                         unsigned int, unsigned long);
+
 /* driver specifications */
        const int capability;   /* capability flags */
        int n_minors;           /* number of active minor devices */
        /* handle uniform packets for scsi type devices (scsi,atapi) */
        int (*generic_packet) (struct cdrom_device_info *,
-                              struct cdrom_generic_command *);
+                              struct packet_command *);
 };
 
 /* the general block_device operations structure: */
 extern int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip,
                        struct file *fp);
 extern int cdrom_release(struct cdrom_device_info *cdi, struct file *fp);
-extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct inode *ip,
-               unsigned int cmd, unsigned long arg);
+extern int cdrom_ioctl(struct file *file, struct cdrom_device_info *cdi,
+               struct inode *ip, unsigned int cmd, unsigned long arg);
 extern int cdrom_media_changed(struct cdrom_device_info *);
 
 extern int register_cdrom(struct cdrom_device_info *cdi);
@@ -990,11 +1004,11 @@ typedef struct {
 extern int cdrom_get_last_written(struct cdrom_device_info *cdi, long *last_written);
 extern int cdrom_number_of_slots(struct cdrom_device_info *cdi);
 extern int cdrom_mode_select(struct cdrom_device_info *cdi,
-                            struct cdrom_generic_command *cgc);
+                            struct packet_command *cgc);
 extern int cdrom_mode_sense(struct cdrom_device_info *cdi,
-                           struct cdrom_generic_command *cgc,
+                           struct packet_command *cgc,
                            int page_code, int page_control);
-extern void init_cdrom_command(struct cdrom_generic_command *cgc,
+extern void init_cdrom_command(struct packet_command *cgc,
                               void *buffer, int len, int type);
 
 /* The SCSI spec says there could be 256 slots. */
@@ -1169,8 +1183,6 @@ struct media_event_desc {
 };
 
 extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med);
-extern int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write);
-extern int cdrom_is_random_writable(struct cdrom_device_info *cdi, int *write);
 
 #endif  /* End of kernel only stuff */