patch-2.4.0-test10 linux/drivers/usb/storage/sddr09.c
Next file: linux/drivers/usb/storage/transport.c
Previous file: linux/drivers/usb/storage/scsiglue.c
Back to the patch index
Back to the overall index
- Lines: 59
- Date:
Mon Oct 9 14:24:06 2000
- Orig file:
v2.4.0-test9/linux/drivers/usb/storage/sddr09.c
- Orig date:
Mon Aug 28 16:59:14 2000
diff -u --recursive --new-file v2.4.0-test9/linux/drivers/usb/storage/sddr09.c linux/drivers/usb/storage/sddr09.c
@@ -1,6 +1,6 @@
/* Driver for SanDisk SDDR-09 SmartMedia reader
*
- * $Id: sddr09.c,v 1.10 2000/08/25 00:13:51 mdharm Exp $
+ * $Id: sddr09.c,v 1.12 2000/10/03 01:06:07 mdharm Exp $
*
* SDDR09 driver v0.1:
*
@@ -40,12 +40,6 @@
#include <linux/errno.h>
#include <linux/malloc.h>
-extern int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
- u8 request, u8 requesttype, u16 value, u16 index,
- void *data, u16 size);
-extern int usb_stor_bulk_msg(struct us_data *us, void *data, int pipe,
- unsigned int len, unsigned int *act_len);
-
#define short_pack(lsb,msb) ( ((u16)(lsb)) | ( ((u16)(msb))<<8 ) )
#define LSB_of(s) ((s)&0xFF)
#define MSB_of(s) ((s)>>8)
@@ -418,7 +412,7 @@
MSB_of(blocks), LSB_of(blocks)
};
- US_DEBUGP("Read control address %08X blocks %04X\n",
+ US_DEBUGP("Read control address %08lX blocks %04X\n",
address, blocks);
result = sddr09_send_control(us,
@@ -814,8 +808,8 @@
unsigned char inquiry_response[36] = {
0x00, 0x80, 0x00, 0x02, 0x1F, 0x00, 0x00, 0x00
};
- unsigned char mode_page_01[12] = {
- 0x01, 0x0a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ unsigned char mode_page_01[4] = { // write-protected for now
+ 0x03, 0x00, 0x80, 0x00
};
unsigned char *ptr;
unsigned long capacity;
@@ -887,14 +881,14 @@
}
if (srb->cmnd[0] == MODE_SENSE) {
-
+
// Read-write error recovery page: there needs to
// be a check for write-protect here
if ( (srb->cmnd[2] & 0x3F) == 0x01 ) {
- if (ptr==NULL || srb->request_bufflen<12)
+ if (ptr==NULL || srb->request_bufflen<4)
return USB_STOR_TRANSPORT_ERROR;
- memcpy(ptr, mode_page_01, 12);
+ memcpy(ptr, mode_page_01, sizeof(mode_page_01));
return USB_STOR_TRANSPORT_GOOD;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)