patch-2.3.99-pre6 linux/drivers/ide/ide-cd.h

Next file: linux/drivers/ide/ide-disk.c
Previous file: linux/drivers/ide/ide-cd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/drivers/ide/ide-cd.h linux/drivers/ide/ide-cd.h
@@ -10,6 +10,15 @@
 #include <linux/cdrom.h>
 #include <asm/byteorder.h>
 
+/*
+ * Apparently older drives have problems with filling out the entire
+ * mode_sense capability structure. Define this to 1 if your drive isn't
+ * probed correctly.
+ */
+#ifndef BROKEN_CAP_PAGE
+#define BROKEN_CAP_PAGE 0
+#endif
+
 /* Turn this on to have the driver print out the meanings of the
    ATAPI error codes.  This will use up additional kernel-space
    memory, though. */
@@ -43,6 +52,8 @@
 #define SECTOR_BUFFER_SIZE	(CD_FRAMESIZE * 32)
 #define SECTORS_BUFFER		(SECTOR_BUFFER_SIZE / SECTOR_SIZE)
 
+#define BLOCKS_PER_FRAME	(CD_FRAMESIZE / BLOCK_SIZE)
+
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 
 /* special command codes for strategy routine. */
@@ -103,7 +114,7 @@
 	char *buffer;
 	int buflen;
 	int stat;
-	struct request_sense *sense_data;
+	struct request_sense *sense;
 	unsigned char c[12];
 };
 
@@ -187,6 +198,7 @@
  * generic stuff now in the Mt. Fuji spec.
  */
 struct atapi_capabilities_page {
+	struct mode_page_header header;
 #if defined(__BIG_ENDIAN_BITFIELD)
 	__u8 parameters_saveable : 1;
 	__u8 reserved1           : 1;
@@ -398,9 +410,9 @@
 	unsigned short buffer_size;
 	/* Current speed (in kB/s). */
 	unsigned short curspeed;
-
-	/* Truncate the structure here, so we don't have headaches reading
-	   from older drives. */
+#if !BROKEN_CAP_PAGE
+	char pad[4];
+#endif
 };
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)