- Update to 2.6.25-rc3.
[linux-flexiantxendom0-3.2.10.git] / include / linux / cdrom.h
index c6d3e22..a5cd204 100644 (file)
@@ -451,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                  0x3c
 #define GPCMD_READ_BUFFER_CAPACITY         0x5c
 #define GPCMD_READ_CDVD_CAPACITY           0x25
 #define GPCMD_READ_CD                      0xbe
@@ -480,7 +481,9 @@ struct cdrom_generic_command
 #define GPCMD_TEST_UNIT_READY              0x00
 #define GPCMD_VERIFY_10                            0x2f
 #define GPCMD_WRITE_10                     0x2a
+#define GPCMD_WRITE_12                     0xaa
 #define GPCMD_WRITE_AND_VERIFY_10          0x2e
+#define GPCMD_WRITE_BUFFER                 0x3b
 /* This is listed as optional in ATAPI 2.6, but is (curiously) 
  * missing from Mt. Fuji, Table 57.  It _is_ mentioned in Mt. Fuji
  * Table 377 as an MMC command for SCSi devices though...  Most ATAPI
@@ -1184,6 +1187,20 @@ struct media_event_desc {
 
 extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med);
 
+static inline void lba_to_msf(int lba, u8 *m, u8 *s, u8 *f)
+{
+       lba += CD_MSF_OFFSET;
+       lba &= 0xffffff;  /* negative lbas use only 24 bits */
+       *m = lba / (CD_SECS * CD_FRAMES);
+       lba %= (CD_SECS * CD_FRAMES);
+       *s = lba / CD_FRAMES;
+       *f = lba % CD_FRAMES;
+}
+
+static inline int msf_to_lba(u8 m, u8 s, u8 f)
+{
+       return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
+}
 #endif  /* End of kernel only stuff */ 
 
 #endif  /* _LINUX_CDROM_H */