Commit d0a6840a authored by Matthew Dharm's avatar Matthew Dharm Committed by Greg Kroah-Hartman

[PATCH] usb-storage: convert spaces to tabs

This is a minor cleanup to convert 8 spaces into tabs.  There is no
functional change here.
parent 196ef4e6
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
extern int datafab_transport(Scsi_Cmnd *srb, struct us_data *us); extern int datafab_transport(Scsi_Cmnd *srb, struct us_data *us);
struct datafab_info { struct datafab_info {
unsigned long sectors; // total sector count unsigned long sectors; // total sector count
unsigned long ssize; // sector size in bytes unsigned long ssize; // sector size in bytes
char lun; // used for dual-slot readers char lun; // used for dual-slot readers
// the following aren't used yet // the following aren't used yet
unsigned char sense_key; unsigned char sense_key;
unsigned long sense_asc; // additional sense code unsigned long sense_asc; // additional sense code
unsigned long sense_ascq; // additional sense code qualifier unsigned long sense_ascq; // additional sense code qualifier
}; };
#endif #endif
...@@ -45,42 +45,42 @@ static void pdump (void *, int); ...@@ -45,42 +45,42 @@ static void pdump (void *, int);
#define DRQ_STAT 0x08 #define DRQ_STAT 0x08
struct freecom_udata { struct freecom_udata {
u8 buffer[64]; /* Common command block. */ u8 buffer[64]; /* Common command block. */
}; };
typedef struct freecom_udata *freecom_udata_t; typedef struct freecom_udata *freecom_udata_t;
/* All of the outgoing packets are 64 bytes long. */ /* All of the outgoing packets are 64 bytes long. */
struct freecom_cb_wrap { struct freecom_cb_wrap {
u8 Type; /* Command type. */ u8 Type; /* Command type. */
u8 Timeout; /* Timeout in seconds. */ u8 Timeout; /* Timeout in seconds. */
u8 Atapi[12]; /* An ATAPI packet. */ u8 Atapi[12]; /* An ATAPI packet. */
u8 Filler[50]; /* Padding Data. */ u8 Filler[50]; /* Padding Data. */
}; };
struct freecom_xfer_wrap { struct freecom_xfer_wrap {
u8 Type; /* Command type. */ u8 Type; /* Command type. */
u8 Timeout; /* Timeout in seconds. */ u8 Timeout; /* Timeout in seconds. */
u32 Count; /* Number of bytes to transfer. */ u32 Count; /* Number of bytes to transfer. */
u8 Pad[58]; u8 Pad[58];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct freecom_ide_out { struct freecom_ide_out {
u8 Type; /* Type + IDE register. */ u8 Type; /* Type + IDE register. */
u8 Pad; u8 Pad;
u16 Value; /* Value to write. */ u16 Value; /* Value to write. */
u8 Pad2[60]; u8 Pad2[60];
}; };
struct freecom_ide_in { struct freecom_ide_in {
u8 Type; /* Type | IDE register. */ u8 Type; /* Type | IDE register. */
u8 Pad[63]; u8 Pad[63];
}; };
struct freecom_status { struct freecom_status {
u8 Status; u8 Status;
u8 Reason; u8 Reason;
u16 Count; u16 Count;
u8 Pad[60]; u8 Pad[60];
}; };
/* Freecom stuffs the interrupt status in the INDEX_STAT bit of the ide /* Freecom stuffs the interrupt status in the INDEX_STAT bit of the ide
...@@ -110,32 +110,32 @@ struct freecom_status { ...@@ -110,32 +110,32 @@ struct freecom_status {
static int static int
freecom_readdata (Scsi_Cmnd *srb, struct us_data *us, freecom_readdata (Scsi_Cmnd *srb, struct us_data *us,
unsigned int ipipe, unsigned int opipe, int count) unsigned int ipipe, unsigned int opipe, int count)
{ {
freecom_udata_t extra = (freecom_udata_t) us->extra; freecom_udata_t extra = (freecom_udata_t) us->extra;
struct freecom_xfer_wrap *fxfr = struct freecom_xfer_wrap *fxfr =
(struct freecom_xfer_wrap *) extra->buffer; (struct freecom_xfer_wrap *) extra->buffer;
int result; int result;
fxfr->Type = FCM_PACKET_INPUT | 0x00; fxfr->Type = FCM_PACKET_INPUT | 0x00;
fxfr->Timeout = 0; /* Short timeout for debugging. */ fxfr->Timeout = 0; /* Short timeout for debugging. */
fxfr->Count = cpu_to_le32 (count); fxfr->Count = cpu_to_le32 (count);
memset (fxfr->Pad, 0, sizeof (fxfr->Pad)); memset (fxfr->Pad, 0, sizeof (fxfr->Pad));
US_DEBUGP("Read data Freecom! (c=%d)\n", count); US_DEBUGP("Read data Freecom! (c=%d)\n", count);
/* Issue the transfer command. */ /* Issue the transfer command. */
result = usb_stor_bulk_transfer_buf (us, opipe, fxfr, result = usb_stor_bulk_transfer_buf (us, opipe, fxfr,
FCM_PACKET_LENGTH, NULL); FCM_PACKET_LENGTH, NULL);
if (result != USB_STOR_XFER_GOOD) { if (result != USB_STOR_XFER_GOOD) {
US_DEBUGP ("Freecom readdata transport error\n"); US_DEBUGP ("Freecom readdata transport error\n");
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
} }
/* Now transfer all of our blocks. */ /* Now transfer all of our blocks. */
US_DEBUGP("Start of read\n"); US_DEBUGP("Start of read\n");
result = usb_stor_bulk_transfer_srb(us, ipipe, srb, count); result = usb_stor_bulk_transfer_srb(us, ipipe, srb, count);
US_DEBUGP("freecom_readdata done!\n"); US_DEBUGP("freecom_readdata done!\n");
if (result > USB_STOR_XFER_SHORT) if (result > USB_STOR_XFER_SHORT)
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
...@@ -144,33 +144,33 @@ freecom_readdata (Scsi_Cmnd *srb, struct us_data *us, ...@@ -144,33 +144,33 @@ freecom_readdata (Scsi_Cmnd *srb, struct us_data *us,
static int static int
freecom_writedata (Scsi_Cmnd *srb, struct us_data *us, freecom_writedata (Scsi_Cmnd *srb, struct us_data *us,
int unsigned ipipe, unsigned int opipe, int count) int unsigned ipipe, unsigned int opipe, int count)
{ {
freecom_udata_t extra = (freecom_udata_t) us->extra; freecom_udata_t extra = (freecom_udata_t) us->extra;
struct freecom_xfer_wrap *fxfr = struct freecom_xfer_wrap *fxfr =
(struct freecom_xfer_wrap *) extra->buffer; (struct freecom_xfer_wrap *) extra->buffer;
int result; int result;
fxfr->Type = FCM_PACKET_OUTPUT | 0x00; fxfr->Type = FCM_PACKET_OUTPUT | 0x00;
fxfr->Timeout = 0; /* Short timeout for debugging. */ fxfr->Timeout = 0; /* Short timeout for debugging. */
fxfr->Count = cpu_to_le32 (count); fxfr->Count = cpu_to_le32 (count);
memset (fxfr->Pad, 0, sizeof (fxfr->Pad)); memset (fxfr->Pad, 0, sizeof (fxfr->Pad));
US_DEBUGP("Write data Freecom! (c=%d)\n", count); US_DEBUGP("Write data Freecom! (c=%d)\n", count);
/* Issue the transfer command. */ /* Issue the transfer command. */
result = usb_stor_bulk_transfer_buf (us, opipe, fxfr, result = usb_stor_bulk_transfer_buf (us, opipe, fxfr,
FCM_PACKET_LENGTH, NULL); FCM_PACKET_LENGTH, NULL);
if (result != USB_STOR_XFER_GOOD) { if (result != USB_STOR_XFER_GOOD) {
US_DEBUGP ("Freecom writedata transport error\n"); US_DEBUGP ("Freecom writedata transport error\n");
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
} }
/* Now transfer all of our blocks. */ /* Now transfer all of our blocks. */
US_DEBUGP("Start of write\n"); US_DEBUGP("Start of write\n");
result = usb_stor_bulk_transfer_srb(us, opipe, srb, count); result = usb_stor_bulk_transfer_srb(us, opipe, srb, count);
US_DEBUGP("freecom_writedata done!\n"); US_DEBUGP("freecom_writedata done!\n");
if (result > USB_STOR_XFER_SHORT) if (result > USB_STOR_XFER_SHORT)
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
return USB_STOR_TRANSPORT_GOOD; return USB_STOR_TRANSPORT_GOOD;
...@@ -182,54 +182,54 @@ freecom_writedata (Scsi_Cmnd *srb, struct us_data *us, ...@@ -182,54 +182,54 @@ freecom_writedata (Scsi_Cmnd *srb, struct us_data *us,
*/ */
int freecom_transport(Scsi_Cmnd *srb, struct us_data *us) int freecom_transport(Scsi_Cmnd *srb, struct us_data *us)
{ {
struct freecom_cb_wrap *fcb; struct freecom_cb_wrap *fcb;
struct freecom_status *fst; struct freecom_status *fst;
unsigned int ipipe, opipe; /* We need both pipes. */ unsigned int ipipe, opipe; /* We need both pipes. */
int result; int result;
unsigned int partial; unsigned int partial;
int length; int length;
freecom_udata_t extra; freecom_udata_t extra;
extra = (freecom_udata_t) us->extra; extra = (freecom_udata_t) us->extra;
fcb = (struct freecom_cb_wrap *) extra->buffer; fcb = (struct freecom_cb_wrap *) extra->buffer;
fst = (struct freecom_status *) extra->buffer; fst = (struct freecom_status *) extra->buffer;
US_DEBUGP("Freecom TRANSPORT STARTED\n"); US_DEBUGP("Freecom TRANSPORT STARTED\n");
/* Get handles for both transports. */ /* Get handles for both transports. */
opipe = us->send_bulk_pipe; opipe = us->send_bulk_pipe;
ipipe = us->recv_bulk_pipe; ipipe = us->recv_bulk_pipe;
/* The ATAPI Command always goes out first. */ /* The ATAPI Command always goes out first. */
fcb->Type = FCM_PACKET_ATAPI | 0x00; fcb->Type = FCM_PACKET_ATAPI | 0x00;
fcb->Timeout = 0; fcb->Timeout = 0;
memcpy (fcb->Atapi, srb->cmnd, 12); memcpy (fcb->Atapi, srb->cmnd, 12);
memset (fcb->Filler, 0, sizeof (fcb->Filler)); memset (fcb->Filler, 0, sizeof (fcb->Filler));
US_DEBUG(pdump (srb->cmnd, 12)); US_DEBUG(pdump (srb->cmnd, 12));
/* Send it out. */ /* Send it out. */
result = usb_stor_bulk_transfer_buf (us, opipe, fcb, result = usb_stor_bulk_transfer_buf (us, opipe, fcb,
FCM_PACKET_LENGTH, NULL); FCM_PACKET_LENGTH, NULL);
/* The Freecom device will only fail if there is something wrong in /* The Freecom device will only fail if there is something wrong in
* USB land. It returns the status in its own registers, which * USB land. It returns the status in its own registers, which
* come back in the bulk pipe. */ * come back in the bulk pipe. */
if (result != USB_STOR_XFER_GOOD) { if (result != USB_STOR_XFER_GOOD) {
US_DEBUGP ("freecom transport error\n"); US_DEBUGP ("freecom transport error\n");
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
} }
/* There are times we can optimize out this status read, but it /* There are times we can optimize out this status read, but it
* doesn't hurt us to always do it now. */ * doesn't hurt us to always do it now. */
result = usb_stor_bulk_transfer_buf (us, ipipe, fst, result = usb_stor_bulk_transfer_buf (us, ipipe, fst,
FCM_PACKET_LENGTH, &partial); FCM_PACKET_LENGTH, &partial);
US_DEBUGP("foo Status result %d %u\n", result, partial); US_DEBUGP("foo Status result %d %u\n", result, partial);
if (result != USB_STOR_XFER_GOOD) if (result != USB_STOR_XFER_GOOD)
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
US_DEBUG(pdump ((void *) fst, partial)); US_DEBUG(pdump ((void *) fst, partial));
/* The firmware will time-out commands after 20 seconds. Some commands /* The firmware will time-out commands after 20 seconds. Some commands
* can legitimately take longer than this, so we use a different * can legitimately take longer than this, so we use a different
...@@ -249,7 +249,7 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us) ...@@ -249,7 +249,7 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us)
memset (fcb->Atapi, 0, sizeof(fcb->Atapi)); memset (fcb->Atapi, 0, sizeof(fcb->Atapi));
memset (fcb->Filler, 0, sizeof (fcb->Filler)); memset (fcb->Filler, 0, sizeof (fcb->Filler));
/* Send it out. */ /* Send it out. */
result = usb_stor_bulk_transfer_buf (us, opipe, fcb, result = usb_stor_bulk_transfer_buf (us, opipe, fcb,
FCM_PACKET_LENGTH, NULL); FCM_PACKET_LENGTH, NULL);
...@@ -263,31 +263,31 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us) ...@@ -263,31 +263,31 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us)
} }
/* get the data */ /* get the data */
result = usb_stor_bulk_transfer_buf (us, ipipe, fst, result = usb_stor_bulk_transfer_buf (us, ipipe, fst,
FCM_PACKET_LENGTH, &partial); FCM_PACKET_LENGTH, &partial);
US_DEBUGP("bar Status result %d %u\n", result, partial); US_DEBUGP("bar Status result %d %u\n", result, partial);
if (result > USB_STOR_XFER_SHORT) if (result > USB_STOR_XFER_SHORT)
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
US_DEBUG(pdump ((void *) fst, partial)); US_DEBUG(pdump ((void *) fst, partial));
} }
if (partial != 4) if (partial != 4)
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
if ((fst->Status & 1) != 0) { if ((fst->Status & 1) != 0) {
US_DEBUGP("operation failed\n"); US_DEBUGP("operation failed\n");
return USB_STOR_TRANSPORT_FAILED; return USB_STOR_TRANSPORT_FAILED;
} }
/* The device might not have as much data available as we /* The device might not have as much data available as we
* requested. If you ask for more than the device has, this reads * requested. If you ask for more than the device has, this reads
* and such will hang. */ * and such will hang. */
US_DEBUGP("Device indicates that it has %d bytes available\n", US_DEBUGP("Device indicates that it has %d bytes available\n",
le16_to_cpu (fst->Count)); le16_to_cpu (fst->Count));
US_DEBUGP("SCSI requested %d\n", srb->request_bufflen); US_DEBUGP("SCSI requested %d\n", srb->request_bufflen);
/* Find the length we desire to read. */ /* Find the length we desire to read. */
switch (srb->cmnd[0]) { switch (srb->cmnd[0]) {
case INQUIRY: case INQUIRY:
case REQUEST_SENSE: /* 16 or 18 bytes? spec says 18, lots of devices only have 16 */ case REQUEST_SENSE: /* 16 or 18 bytes? spec says 18, lots of devices only have 16 */
...@@ -305,97 +305,97 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us) ...@@ -305,97 +305,97 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us)
US_DEBUGP("Truncating request to match buffer length: %d\n", length); US_DEBUGP("Truncating request to match buffer length: %d\n", length);
} }
/* What we do now depends on what direction the data is supposed to /* What we do now depends on what direction the data is supposed to
* move in. */ * move in. */
switch (us->srb->sc_data_direction) { switch (us->srb->sc_data_direction) {
case SCSI_DATA_READ: case SCSI_DATA_READ:
/* Make sure that the status indicates that the device /* Make sure that the status indicates that the device
* wants data as well. */ * wants data as well. */
if ((fst->Status & DRQ_STAT) == 0 || (fst->Reason & 3) != 2) { if ((fst->Status & DRQ_STAT) == 0 || (fst->Reason & 3) != 2) {
US_DEBUGP("SCSI wants data, drive doesn't have any\n"); US_DEBUGP("SCSI wants data, drive doesn't have any\n");
return USB_STOR_TRANSPORT_FAILED; return USB_STOR_TRANSPORT_FAILED;
} }
result = freecom_readdata (srb, us, ipipe, opipe, length); result = freecom_readdata (srb, us, ipipe, opipe, length);
if (result != USB_STOR_TRANSPORT_GOOD) if (result != USB_STOR_TRANSPORT_GOOD)
return result; return result;
US_DEBUGP("FCM: Waiting for status\n"); US_DEBUGP("FCM: Waiting for status\n");
result = usb_stor_bulk_transfer_buf (us, ipipe, fst, result = usb_stor_bulk_transfer_buf (us, ipipe, fst,
FCM_PACKET_LENGTH, &partial); FCM_PACKET_LENGTH, &partial);
US_DEBUG(pdump ((void *) fst, partial)); US_DEBUG(pdump ((void *) fst, partial));
if (partial != 4 || result > USB_STOR_XFER_SHORT) if (partial != 4 || result > USB_STOR_XFER_SHORT)
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
if ((fst->Status & ERR_STAT) != 0) { if ((fst->Status & ERR_STAT) != 0) {
US_DEBUGP("operation failed\n"); US_DEBUGP("operation failed\n");
return USB_STOR_TRANSPORT_FAILED; return USB_STOR_TRANSPORT_FAILED;
} }
if ((fst->Reason & 3) != 3) { if ((fst->Reason & 3) != 3) {
US_DEBUGP("Drive seems still hungry\n"); US_DEBUGP("Drive seems still hungry\n");
return USB_STOR_TRANSPORT_FAILED; return USB_STOR_TRANSPORT_FAILED;
} }
US_DEBUGP("Transfer happy\n"); US_DEBUGP("Transfer happy\n");
break; break;
case SCSI_DATA_WRITE: case SCSI_DATA_WRITE:
/* Make sure the status indicates that the device wants to /* Make sure the status indicates that the device wants to
* send us data. */ * send us data. */
/* !!IMPLEMENT!! */ /* !!IMPLEMENT!! */
result = freecom_writedata (srb, us, ipipe, opipe, length); result = freecom_writedata (srb, us, ipipe, opipe, length);
if (result != USB_STOR_TRANSPORT_GOOD) if (result != USB_STOR_TRANSPORT_GOOD)
return result; return result;
US_DEBUGP("FCM: Waiting for status\n"); US_DEBUGP("FCM: Waiting for status\n");
result = usb_stor_bulk_transfer_buf (us, ipipe, fst, result = usb_stor_bulk_transfer_buf (us, ipipe, fst,
FCM_PACKET_LENGTH, &partial); FCM_PACKET_LENGTH, &partial);
if (partial != 4 || result > USB_STOR_XFER_SHORT) if (partial != 4 || result > USB_STOR_XFER_SHORT)
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
if ((fst->Status & ERR_STAT) != 0) { if ((fst->Status & ERR_STAT) != 0) {
US_DEBUGP("operation failed\n"); US_DEBUGP("operation failed\n");
return USB_STOR_TRANSPORT_FAILED; return USB_STOR_TRANSPORT_FAILED;
} }
if ((fst->Reason & 3) != 3) { if ((fst->Reason & 3) != 3) {
US_DEBUGP("Drive seems still hungry\n"); US_DEBUGP("Drive seems still hungry\n");
return USB_STOR_TRANSPORT_FAILED; return USB_STOR_TRANSPORT_FAILED;
} }
US_DEBUGP("Transfer happy\n"); US_DEBUGP("Transfer happy\n");
break; break;
case SCSI_DATA_NONE: case SCSI_DATA_NONE:
/* Easy, do nothing. */ /* Easy, do nothing. */
break; break;
default: default:
US_DEBUGP ("freecom unimplemented direction: %d\n", US_DEBUGP ("freecom unimplemented direction: %d\n",
us->srb->sc_data_direction); us->srb->sc_data_direction);
// Return fail, SCSI seems to handle this better. // Return fail, SCSI seems to handle this better.
return USB_STOR_TRANSPORT_FAILED; return USB_STOR_TRANSPORT_FAILED;
break; break;
} }
return USB_STOR_TRANSPORT_GOOD; return USB_STOR_TRANSPORT_GOOD;
} }
int int
freecom_init (struct us_data *us) freecom_init (struct us_data *us)
{ {
int result; int result;
char buffer[33]; char buffer[33];
/* Allocate a buffer for us. The upper usb transport code will /* Allocate a buffer for us. The upper usb transport code will
* free this for us when cleaning up. */ * free this for us when cleaning up. */
if (us->extra == NULL) { if (us->extra == NULL) {
us->extra = kmalloc (sizeof (struct freecom_udata), us->extra = kmalloc (sizeof (struct freecom_udata),
GFP_KERNEL); GFP_KERNEL);
if (us->extra == NULL) { if (us->extra == NULL) {
US_DEBUGP("Out of memory\n"); US_DEBUGP("Out of memory\n");
return USB_STOR_TRANSPORT_ERROR; return USB_STOR_TRANSPORT_ERROR;
} }
} }
result = usb_control_msg(us->pusb_dev, us->recv_ctrl_pipe, result = usb_control_msg(us->pusb_dev, us->recv_ctrl_pipe,
0x4c, 0xc0, 0x4346, 0x0, buffer, 0x20, 3*HZ); 0x4c, 0xc0, 0x4346, 0x0, buffer, 0x20, 3*HZ);
...@@ -424,15 +424,15 @@ freecom_init (struct us_data *us) ...@@ -424,15 +424,15 @@ freecom_init (struct us_data *us)
/* wait 3 seconds */ /* wait 3 seconds */
mdelay(3 * 1000); mdelay(3 * 1000);
return USB_STOR_TRANSPORT_GOOD; return USB_STOR_TRANSPORT_GOOD;
} }
int usb_stor_freecom_reset(struct us_data *us) int usb_stor_freecom_reset(struct us_data *us)
{ {
printk (KERN_CRIT "freecom reset called\n"); printk (KERN_CRIT "freecom reset called\n");
/* We don't really have this feature. */ /* We don't really have this feature. */
return FAILED; return FAILED;
} }
#ifdef CONFIG_USB_STORAGE_DEBUG #ifdef CONFIG_USB_STORAGE_DEBUG
......
...@@ -34,11 +34,11 @@ ...@@ -34,11 +34,11 @@
* 2002-10-19: Removed the specialized transfer routines. * 2002-10-19: Removed the specialized transfer routines.
* (Alan Stern <stern@rowland.harvard.edu>) * (Alan Stern <stern@rowland.harvard.edu>)
* 2001-02-24: Removed lots of duplicate code and simplified the structure. * 2001-02-24: Removed lots of duplicate code and simplified the structure.
* (bjorn@haxx.se) * (bjorn@haxx.se)
* 2002-01-16: Fixed endianness bug so it works on the ppc arch. * 2002-01-16: Fixed endianness bug so it works on the ppc arch.
* (Luc Saillard <luc@saillard.org>) * (Luc Saillard <luc@saillard.org>)
* 2002-01-17: All bitfields removed. * 2002-01-17: All bitfields removed.
* (bjorn@haxx.se) * (bjorn@haxx.se)
*/ */
...@@ -59,14 +59,14 @@ ...@@ -59,14 +59,14 @@
/* Timeout defines (in Seconds) */ /* Timeout defines (in Seconds) */
#define ISD200_ENUM_BSY_TIMEOUT 35 #define ISD200_ENUM_BSY_TIMEOUT 35
#define ISD200_ENUM_DETECT_TIMEOUT 30 #define ISD200_ENUM_DETECT_TIMEOUT 30
#define ISD200_DEFAULT_TIMEOUT 30 #define ISD200_DEFAULT_TIMEOUT 30
/* device flags */ /* device flags */
#define DF_ATA_DEVICE 0x0001 #define DF_ATA_DEVICE 0x0001
#define DF_MEDIA_STATUS_ENABLED 0x0002 #define DF_MEDIA_STATUS_ENABLED 0x0002
#define DF_REMOVABLE_MEDIA 0x0004 #define DF_REMOVABLE_MEDIA 0x0004
/* capability bit definitions */ /* capability bit definitions */
#define CAPABILITY_DMA 0x01 #define CAPABILITY_DMA 0x01
...@@ -82,46 +82,46 @@ ...@@ -82,46 +82,46 @@
#define ATA_ADDRESS_DEVHEAD_SLAVE 0x10 #define ATA_ADDRESS_DEVHEAD_SLAVE 0x10
/* Action Select bits */ /* Action Select bits */
#define ACTION_SELECT_0 0x01 #define ACTION_SELECT_0 0x01
#define ACTION_SELECT_1 0x02 #define ACTION_SELECT_1 0x02
#define ACTION_SELECT_2 0x04 #define ACTION_SELECT_2 0x04
#define ACTION_SELECT_3 0x08 #define ACTION_SELECT_3 0x08
#define ACTION_SELECT_4 0x10 #define ACTION_SELECT_4 0x10
#define ACTION_SELECT_5 0x20 #define ACTION_SELECT_5 0x20
#define ACTION_SELECT_6 0x40 #define ACTION_SELECT_6 0x40
#define ACTION_SELECT_7 0x80 #define ACTION_SELECT_7 0x80
/* Register Select bits */ /* Register Select bits */
#define REG_ALTERNATE_STATUS 0x01 #define REG_ALTERNATE_STATUS 0x01
#define REG_DEVICE_CONTROL 0x01 #define REG_DEVICE_CONTROL 0x01
#define REG_ERROR 0x02 #define REG_ERROR 0x02
#define REG_FEATURES 0x02 #define REG_FEATURES 0x02
#define REG_SECTOR_COUNT 0x04 #define REG_SECTOR_COUNT 0x04
#define REG_SECTOR_NUMBER 0x08 #define REG_SECTOR_NUMBER 0x08
#define REG_CYLINDER_LOW 0x10 #define REG_CYLINDER_LOW 0x10
#define REG_CYLINDER_HIGH 0x20 #define REG_CYLINDER_HIGH 0x20
#define REG_DEVICE_HEAD 0x40 #define REG_DEVICE_HEAD 0x40
#define REG_STATUS 0x80 #define REG_STATUS 0x80
#define REG_COMMAND 0x80 #define REG_COMMAND 0x80
/* ATA error definitions not in <linux/hdreg.h> */ /* ATA error definitions not in <linux/hdreg.h> */
#define ATA_ERROR_MEDIA_CHANGE 0x20 #define ATA_ERROR_MEDIA_CHANGE 0x20
/* ATA command definitions not in <linux/hdreg.h> */ /* ATA command definitions not in <linux/hdreg.h> */
#define ATA_COMMAND_GET_MEDIA_STATUS 0xDA #define ATA_COMMAND_GET_MEDIA_STATUS 0xDA
#define ATA_COMMAND_MEDIA_EJECT 0xED #define ATA_COMMAND_MEDIA_EJECT 0xED
/* ATA drive control definitions */ /* ATA drive control definitions */
#define ATA_DC_DISABLE_INTERRUPTS 0x02 #define ATA_DC_DISABLE_INTERRUPTS 0x02
#define ATA_DC_RESET_CONTROLLER 0x04 #define ATA_DC_RESET_CONTROLLER 0x04
#define ATA_DC_REENABLE_CONTROLLER 0x00 #define ATA_DC_REENABLE_CONTROLLER 0x00
/* /*
* General purpose return codes * General purpose return codes
*/ */
#define ISD200_ERROR -1 #define ISD200_ERROR -1
#define ISD200_GOOD 0 #define ISD200_GOOD 0
/* /*
* Transport return codes * Transport return codes
...@@ -162,7 +162,7 @@ union ata_cdb { ...@@ -162,7 +162,7 @@ union ata_cdb {
unsigned char WriteData1F7; unsigned char WriteData1F7;
unsigned char Reserved[3]; unsigned char Reserved[3];
} generic; } generic;
struct { struct {
unsigned char SignatureByte0; unsigned char SignatureByte0;
unsigned char SignatureByte1; unsigned char SignatureByte1;
...@@ -180,7 +180,7 @@ union ata_cdb { ...@@ -180,7 +180,7 @@ union ata_cdb {
unsigned char Reserved[3]; unsigned char Reserved[3];
} read; } read;
struct { struct {
unsigned char SignatureByte0; unsigned char SignatureByte0;
unsigned char SignatureByte1; unsigned char SignatureByte1;
unsigned char ActionSelect; unsigned char ActionSelect;
...@@ -211,8 +211,8 @@ union ata_cdb { ...@@ -211,8 +211,8 @@ union ata_cdb {
/* /*
* DeviceType field * DeviceType field
*/ */
#define DIRECT_ACCESS_DEVICE 0x00 /* disks */ #define DIRECT_ACCESS_DEVICE 0x00 /* disks */
#define DEVICE_REMOVABLE 0x80 #define DEVICE_REMOVABLE 0x80
struct inquiry_data { struct inquiry_data {
unsigned char DeviceType; unsigned char DeviceType;
...@@ -240,9 +240,9 @@ struct inquiry_data { ...@@ -240,9 +240,9 @@ struct inquiry_data {
* ISD200 CONFIG data struct * ISD200 CONFIG data struct
*/ */
#define ATACFG_TIMING 0x0f #define ATACFG_TIMING 0x0f
#define ATACFG_ATAPI_RESET 0x10 #define ATACFG_ATAPI_RESET 0x10
#define ATACFG_MASTER 0x20 #define ATACFG_MASTER 0x20
#define ATACFG_BLOCKSIZE 0xa0 #define ATACFG_BLOCKSIZE 0xa0
#define ATACFGE_LAST_LUN 0x07 #define ATACFGE_LAST_LUN 0x07
...@@ -255,12 +255,12 @@ struct inquiry_data { ...@@ -255,12 +255,12 @@ struct inquiry_data {
#define CFG_CAPABILITY_SRST 0x01 #define CFG_CAPABILITY_SRST 0x01
struct isd200_config { struct isd200_config {
unsigned char EventNotification; unsigned char EventNotification;
unsigned char ExternalClock; unsigned char ExternalClock;
unsigned char ATAInitTimeout; unsigned char ATAInitTimeout;
unsigned char ATAConfig; unsigned char ATAConfig;
unsigned char ATAMajorCommand; unsigned char ATAMajorCommand;
unsigned char ATAMinorCommand; unsigned char ATAMinorCommand;
unsigned char ATAExtraConfig; unsigned char ATAExtraConfig;
unsigned char Capability; unsigned char Capability;
}__attribute__ ((packed)); }__attribute__ ((packed));
...@@ -309,7 +309,7 @@ struct read_block_limits { ...@@ -309,7 +309,7 @@ struct read_block_limits {
* Sense Data Format * Sense Data Format
*/ */
#define SENSE_ERRCODE 0x7f #define SENSE_ERRCODE 0x7f
#define SENSE_ERRCODE_VALID 0x80 #define SENSE_ERRCODE_VALID 0x80
#define SENSE_FLAG_SENSE_KEY 0x0f #define SENSE_FLAG_SENSE_KEY 0x0f
#define SENSE_FLAG_BAD_LENGTH 0x20 #define SENSE_FLAG_BAD_LENGTH 0x20
...@@ -319,13 +319,13 @@ struct sense_data { ...@@ -319,13 +319,13 @@ struct sense_data {
unsigned char ErrorCode; unsigned char ErrorCode;
unsigned char SegmentNumber; unsigned char SegmentNumber;
unsigned char Flags; unsigned char Flags;
unsigned char Information[4]; unsigned char Information[4];
unsigned char AdditionalSenseLength; unsigned char AdditionalSenseLength;
unsigned char CommandSpecificInformation[4]; unsigned char CommandSpecificInformation[4];
unsigned char AdditionalSenseCode; unsigned char AdditionalSenseCode;
unsigned char AdditionalSenseCodeQualifier; unsigned char AdditionalSenseCodeQualifier;
unsigned char FieldReplaceableUnitCode; unsigned char FieldReplaceableUnitCode;
unsigned char SenseKeySpecific[3]; unsigned char SenseKeySpecific[3];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
...@@ -340,18 +340,18 @@ struct sense_data { ...@@ -340,18 +340,18 @@ struct sense_data {
/************************************************************************** /**************************************************************************
* isd200_build_sense * isd200_build_sense
* *
* Builds an artificial sense buffer to report the results of a * Builds an artificial sense buffer to report the results of a
* failed command. * failed command.
* *
* RETURNS: * RETURNS:
* void * void
*/ */
void isd200_build_sense(struct us_data *us, Scsi_Cmnd *srb) void isd200_build_sense(struct us_data *us, Scsi_Cmnd *srb)
{ {
struct isd200_info *info = (struct isd200_info *)us->extra; struct isd200_info *info = (struct isd200_info *)us->extra;
struct sense_data *buf = (struct sense_data *) &srb->sense_buffer[0]; struct sense_data *buf = (struct sense_data *) &srb->sense_buffer[0];
unsigned char error = info->ATARegs[IDE_ERROR_OFFSET]; unsigned char error = info->ATARegs[IDE_ERROR_OFFSET];
if(error & ATA_ERROR_MEDIA_CHANGE) { if(error & ATA_ERROR_MEDIA_CHANGE) {
buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID;
...@@ -359,31 +359,31 @@ void isd200_build_sense(struct us_data *us, Scsi_Cmnd *srb) ...@@ -359,31 +359,31 @@ void isd200_build_sense(struct us_data *us, Scsi_Cmnd *srb)
buf->Flags = UNIT_ATTENTION; buf->Flags = UNIT_ATTENTION;
buf->AdditionalSenseCode = 0; buf->AdditionalSenseCode = 0;
buf->AdditionalSenseCodeQualifier = 0; buf->AdditionalSenseCodeQualifier = 0;
} else if(error & MCR_ERR) { } else if(error & MCR_ERR) {
buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID;
buf->AdditionalSenseLength = 0xb; buf->AdditionalSenseLength = 0xb;
buf->Flags = UNIT_ATTENTION; buf->Flags = UNIT_ATTENTION;
buf->AdditionalSenseCode = 0; buf->AdditionalSenseCode = 0;
buf->AdditionalSenseCodeQualifier = 0; buf->AdditionalSenseCodeQualifier = 0;
} else if(error & TRK0_ERR) { } else if(error & TRK0_ERR) {
buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID;
buf->AdditionalSenseLength = 0xb; buf->AdditionalSenseLength = 0xb;
buf->Flags = NOT_READY; buf->Flags = NOT_READY;
buf->AdditionalSenseCode = 0; buf->AdditionalSenseCode = 0;
buf->AdditionalSenseCodeQualifier = 0; buf->AdditionalSenseCodeQualifier = 0;
} else if(error & ECC_ERR) { } else if(error & ECC_ERR) {
buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID;
buf->AdditionalSenseLength = 0xb; buf->AdditionalSenseLength = 0xb;
buf->Flags = DATA_PROTECT; buf->Flags = DATA_PROTECT;
buf->AdditionalSenseCode = 0; buf->AdditionalSenseCode = 0;
buf->AdditionalSenseCodeQualifier = 0; buf->AdditionalSenseCodeQualifier = 0;
} else { } else {
buf->ErrorCode = 0; buf->ErrorCode = 0;
buf->AdditionalSenseLength = 0; buf->AdditionalSenseLength = 0;
buf->Flags = 0; buf->Flags = 0;
buf->AdditionalSenseCode = 0; buf->AdditionalSenseCode = 0;
buf->AdditionalSenseCodeQualifier = 0; buf->AdditionalSenseCodeQualifier = 0;
} }
} }
...@@ -430,8 +430,8 @@ static int isd200_action( struct us_data *us, int action, ...@@ -430,8 +430,8 @@ static int isd200_action( struct us_data *us, int action,
case ACTION_ENUM: case ACTION_ENUM:
US_DEBUGP(" isd200_action(ENUM,0x%02x)\n",value); US_DEBUGP(" isd200_action(ENUM,0x%02x)\n",value);
ata.generic.ActionSelect = ACTION_SELECT_1|ACTION_SELECT_2| ata.generic.ActionSelect = ACTION_SELECT_1|ACTION_SELECT_2|
ACTION_SELECT_3|ACTION_SELECT_4| ACTION_SELECT_3|ACTION_SELECT_4|
ACTION_SELECT_5; ACTION_SELECT_5;
ata.generic.RegisterSelect = REG_DEVICE_HEAD; ata.generic.RegisterSelect = REG_DEVICE_HEAD;
ata.write.DeviceHeadByte = value; ata.write.DeviceHeadByte = value;
srb.sc_data_direction = SCSI_DATA_NONE; srb.sc_data_direction = SCSI_DATA_NONE;
...@@ -440,7 +440,7 @@ static int isd200_action( struct us_data *us, int action, ...@@ -440,7 +440,7 @@ static int isd200_action( struct us_data *us, int action,
case ACTION_RESET: case ACTION_RESET:
US_DEBUGP(" isd200_action(RESET)\n"); US_DEBUGP(" isd200_action(RESET)\n");
ata.generic.ActionSelect = ACTION_SELECT_1|ACTION_SELECT_2| ata.generic.ActionSelect = ACTION_SELECT_1|ACTION_SELECT_2|
ACTION_SELECT_3|ACTION_SELECT_4; ACTION_SELECT_3|ACTION_SELECT_4;
ata.generic.RegisterSelect = REG_DEVICE_CONTROL; ata.generic.RegisterSelect = REG_DEVICE_CONTROL;
ata.write.DeviceControlByte = ATA_DC_RESET_CONTROLLER; ata.write.DeviceControlByte = ATA_DC_RESET_CONTROLLER;
srb.sc_data_direction = SCSI_DATA_NONE; srb.sc_data_direction = SCSI_DATA_NONE;
...@@ -449,7 +449,7 @@ static int isd200_action( struct us_data *us, int action, ...@@ -449,7 +449,7 @@ static int isd200_action( struct us_data *us, int action,
case ACTION_REENABLE: case ACTION_REENABLE:
US_DEBUGP(" isd200_action(REENABLE)\n"); US_DEBUGP(" isd200_action(REENABLE)\n");
ata.generic.ActionSelect = ACTION_SELECT_1|ACTION_SELECT_2| ata.generic.ActionSelect = ACTION_SELECT_1|ACTION_SELECT_2|
ACTION_SELECT_3|ACTION_SELECT_4; ACTION_SELECT_3|ACTION_SELECT_4;
ata.generic.RegisterSelect = REG_DEVICE_CONTROL; ata.generic.RegisterSelect = REG_DEVICE_CONTROL;
ata.write.DeviceControlByte = ATA_DC_REENABLE_CONTROLLER; ata.write.DeviceControlByte = ATA_DC_REENABLE_CONTROLLER;
srb.sc_data_direction = SCSI_DATA_NONE; srb.sc_data_direction = SCSI_DATA_NONE;
...@@ -493,12 +493,12 @@ static int isd200_action( struct us_data *us, int action, ...@@ -493,12 +493,12 @@ static int isd200_action( struct us_data *us, int action,
/************************************************************************** /**************************************************************************
* isd200_read_regs * isd200_read_regs
* *
* Read ATA Registers * Read ATA Registers
* *
* RETURNS: * RETURNS:
* ISD status code * ISD status code
*/ */
int isd200_read_regs( struct us_data *us ) int isd200_read_regs( struct us_data *us )
{ {
struct isd200_info *info = (struct isd200_info *)us->extra; struct isd200_info *info = (struct isd200_info *)us->extra;
...@@ -512,10 +512,10 @@ int isd200_read_regs( struct us_data *us ) ...@@ -512,10 +512,10 @@ int isd200_read_regs( struct us_data *us )
if (transferStatus != ISD200_TRANSPORT_GOOD) { if (transferStatus != ISD200_TRANSPORT_GOOD) {
US_DEBUGP(" Error reading ATA registers\n"); US_DEBUGP(" Error reading ATA registers\n");
retStatus = ISD200_ERROR; retStatus = ISD200_ERROR;
} else { } else {
US_DEBUGP(" Got ATA Register[IDE_ERROR_OFFSET] = 0x%x\n", US_DEBUGP(" Got ATA Register[IDE_ERROR_OFFSET] = 0x%x\n",
info->ATARegs[IDE_ERROR_OFFSET]); info->ATARegs[IDE_ERROR_OFFSET]);
} }
return retStatus; return retStatus;
} }
...@@ -649,12 +649,12 @@ static void isd200_log_config( struct isd200_info* info ) ...@@ -649,12 +649,12 @@ static void isd200_log_config( struct isd200_info* info )
/************************************************************************** /**************************************************************************
* isd200_write_config * isd200_write_config
* *
* Write the ISD200 Configuraton data * Write the ISD200 Configuraton data
* *
* RETURNS: * RETURNS:
* ISD status code * ISD status code
*/ */
int isd200_write_config( struct us_data *us ) int isd200_write_config( struct us_data *us )
{ {
struct isd200_info *info = (struct isd200_info *)us->extra; struct isd200_info *info = (struct isd200_info *)us->extra;
...@@ -669,21 +669,21 @@ int isd200_write_config( struct us_data *us ) ...@@ -669,21 +669,21 @@ int isd200_write_config( struct us_data *us )
/* let's send the command via the control pipe */ /* let's send the command via the control pipe */
result = usb_stor_ctrl_transfer( result = usb_stor_ctrl_transfer(
us, us,
us->send_ctrl_pipe, us->send_ctrl_pipe,
0x01, 0x01,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
0x0000, 0x0000,
0x0002, 0x0002,
(void *) &info->ConfigData, (void *) &info->ConfigData,
sizeof(info->ConfigData)); sizeof(info->ConfigData));
if (result >= 0) { if (result >= 0) {
US_DEBUGP(" ISD200 Config Data was written successfully\n"); US_DEBUGP(" ISD200 Config Data was written successfully\n");
} else { } else {
US_DEBUGP(" Request to write ISD200 Config Data failed!\n"); US_DEBUGP(" Request to write ISD200 Config Data failed!\n");
retStatus = ISD200_ERROR; retStatus = ISD200_ERROR;
} }
US_DEBUGP("Leaving isd200_write_config %08X\n", retStatus); US_DEBUGP("Leaving isd200_write_config %08X\n", retStatus);
return retStatus; return retStatus;
...@@ -692,12 +692,12 @@ int isd200_write_config( struct us_data *us ) ...@@ -692,12 +692,12 @@ int isd200_write_config( struct us_data *us )
/************************************************************************** /**************************************************************************
* isd200_read_config * isd200_read_config
* *
* Reads the ISD200 Configuraton data * Reads the ISD200 Configuraton data
* *
* RETURNS: * RETURNS:
* ISD status code * ISD status code
*/ */
int isd200_read_config( struct us_data *us ) int isd200_read_config( struct us_data *us )
{ {
struct isd200_info *info = (struct isd200_info *)us->extra; struct isd200_info *info = (struct isd200_info *)us->extra;
...@@ -707,17 +707,17 @@ int isd200_read_config( struct us_data *us ) ...@@ -707,17 +707,17 @@ int isd200_read_config( struct us_data *us )
US_DEBUGP("Entering isd200_read_config\n"); US_DEBUGP("Entering isd200_read_config\n");
/* read the configuration information from ISD200. Use this to */ /* read the configuration information from ISD200. Use this to */
/* determine what the special ATA CDB bytes are. */ /* determine what the special ATA CDB bytes are. */
result = usb_stor_ctrl_transfer( result = usb_stor_ctrl_transfer(
us, us,
us->recv_ctrl_pipe, us->recv_ctrl_pipe,
0x02, 0x02,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
0x0000, 0x0000,
0x0002, 0x0002,
(void *) &info->ConfigData, (void *) &info->ConfigData,
sizeof(info->ConfigData)); sizeof(info->ConfigData));
if (result >= 0) { if (result >= 0) {
...@@ -725,10 +725,10 @@ int isd200_read_config( struct us_data *us ) ...@@ -725,10 +725,10 @@ int isd200_read_config( struct us_data *us )
#ifdef CONFIG_USB_STORAGE_DEBUG #ifdef CONFIG_USB_STORAGE_DEBUG
isd200_log_config(info); isd200_log_config(info);
#endif #endif
} else { } else {
US_DEBUGP(" Request to get ISD200 Config Data failed!\n"); US_DEBUGP(" Request to get ISD200 Config Data failed!\n");
retStatus = ISD200_ERROR; retStatus = ISD200_ERROR;
} }
US_DEBUGP("Leaving isd200_read_config %08X\n", retStatus); US_DEBUGP("Leaving isd200_read_config %08X\n", retStatus);
return retStatus; return retStatus;
...@@ -737,12 +737,12 @@ int isd200_read_config( struct us_data *us ) ...@@ -737,12 +737,12 @@ int isd200_read_config( struct us_data *us )
/************************************************************************** /**************************************************************************
* isd200_atapi_soft_reset * isd200_atapi_soft_reset
* *
* Perform an Atapi Soft Reset on the device * Perform an Atapi Soft Reset on the device
* *
* RETURNS: * RETURNS:
* NT status code * NT status code
*/ */
int isd200_atapi_soft_reset( struct us_data *us ) int isd200_atapi_soft_reset( struct us_data *us )
{ {
int retStatus = ISD200_GOOD; int retStatus = ISD200_GOOD;
...@@ -754,7 +754,7 @@ int isd200_atapi_soft_reset( struct us_data *us ) ...@@ -754,7 +754,7 @@ int isd200_atapi_soft_reset( struct us_data *us )
if (transferStatus != ISD200_TRANSPORT_GOOD) { if (transferStatus != ISD200_TRANSPORT_GOOD) {
US_DEBUGP(" Error issuing Atapi Soft Reset\n"); US_DEBUGP(" Error issuing Atapi Soft Reset\n");
retStatus = ISD200_ERROR; retStatus = ISD200_ERROR;
} }
US_DEBUGP("Leaving isd200_atapi_soft_reset %08X\n", retStatus); US_DEBUGP("Leaving isd200_atapi_soft_reset %08X\n", retStatus);
return retStatus; return retStatus;
...@@ -763,12 +763,12 @@ int isd200_atapi_soft_reset( struct us_data *us ) ...@@ -763,12 +763,12 @@ int isd200_atapi_soft_reset( struct us_data *us )
/************************************************************************** /**************************************************************************
* isd200_srst * isd200_srst
* *
* Perform an SRST on the device * Perform an SRST on the device
* *
* RETURNS: * RETURNS:
* ISD status code * ISD status code
*/ */
int isd200_srst( struct us_data *us ) int isd200_srst( struct us_data *us )
{ {
int retStatus = ISD200_GOOD; int retStatus = ISD200_GOOD;
...@@ -782,7 +782,7 @@ int isd200_srst( struct us_data *us ) ...@@ -782,7 +782,7 @@ int isd200_srst( struct us_data *us )
if (transferStatus != ISD200_TRANSPORT_GOOD) { if (transferStatus != ISD200_TRANSPORT_GOOD) {
US_DEBUGP(" Error issuing SRST\n"); US_DEBUGP(" Error issuing SRST\n");
retStatus = ISD200_ERROR; retStatus = ISD200_ERROR;
} else { } else {
/* delay 10ms to give the drive a chance to see it */ /* delay 10ms to give the drive a chance to see it */
wait_ms(10); wait_ms(10);
...@@ -794,7 +794,7 @@ int isd200_srst( struct us_data *us ) ...@@ -794,7 +794,7 @@ int isd200_srst( struct us_data *us )
/* delay 50ms to give the drive a chance to recover after SRST */ /* delay 50ms to give the drive a chance to recover after SRST */
wait_ms(50); wait_ms(50);
} }
} }
US_DEBUGP("Leaving isd200_srst %08X\n", retStatus); US_DEBUGP("Leaving isd200_srst %08X\n", retStatus);
return retStatus; return retStatus;
...@@ -803,13 +803,13 @@ int isd200_srst( struct us_data *us ) ...@@ -803,13 +803,13 @@ int isd200_srst( struct us_data *us )
/************************************************************************** /**************************************************************************
* isd200_try_enum * isd200_try_enum
* *
* Helper function for isd200_manual_enum(). Does ENUM and READ_STATUS * Helper function for isd200_manual_enum(). Does ENUM and READ_STATUS
* and tries to analyze the status registers * and tries to analyze the status registers
* *
* RETURNS: * RETURNS:
* ISD status code * ISD status code
*/ */
static int isd200_try_enum(struct us_data *us, unsigned char master_slave, static int isd200_try_enum(struct us_data *us, unsigned char master_slave,
int detect ) int detect )
{ {
...@@ -908,13 +908,13 @@ static int isd200_try_enum(struct us_data *us, unsigned char master_slave, ...@@ -908,13 +908,13 @@ static int isd200_try_enum(struct us_data *us, unsigned char master_slave,
/************************************************************************** /**************************************************************************
* isd200_manual_enum * isd200_manual_enum
* *
* Determines if the drive attached is an ATA or ATAPI and if it is a * Determines if the drive attached is an ATA or ATAPI and if it is a
* master or slave. * master or slave.
* *
* RETURNS: * RETURNS:
* ISD status code * ISD status code
*/ */
int isd200_manual_enum(struct us_data *us) int isd200_manual_enum(struct us_data *us)
{ {
struct isd200_info *info = (struct isd200_info *)us->extra; struct isd200_info *info = (struct isd200_info *)us->extra;
...@@ -1078,15 +1078,15 @@ int isd200_get_inquiry_data( struct us_data *us ) ...@@ -1078,15 +1078,15 @@ int isd200_get_inquiry_data( struct us_data *us )
us->proto_handler = usb_stor_transparent_scsi_command; us->proto_handler = usb_stor_transparent_scsi_command;
US_DEBUGP("Protocol changed to: %s\n", us->protocol_name); US_DEBUGP("Protocol changed to: %s\n", us->protocol_name);
/* Free driver structure */ /* Free driver structure */
if (us->extra != NULL) { if (us->extra != NULL) {
kfree(us->extra); kfree(us->extra);
us->extra = NULL; us->extra = NULL;
us->extra_destructor = NULL; us->extra_destructor = NULL;
} }
} }
} }
US_DEBUGP("Leaving isd200_get_inquiry_data %08X\n", retStatus); US_DEBUGP("Leaving isd200_get_inquiry_data %08X\n", retStatus);
...@@ -1096,12 +1096,12 @@ int isd200_get_inquiry_data( struct us_data *us ) ...@@ -1096,12 +1096,12 @@ int isd200_get_inquiry_data( struct us_data *us )
/************************************************************************** /**************************************************************************
* isd200_data_copy * isd200_data_copy
* *
* Copy data into the srb request buffer. Use scatter gather if required. * Copy data into the srb request buffer. Use scatter gather if required.
* *
* RETURNS: * RETURNS:
* void * void
*/ */
void isd200_data_copy(Scsi_Cmnd *srb, char * src, int length) void isd200_data_copy(Scsi_Cmnd *srb, char * src, int length)
{ {
unsigned int len = length; unsigned int len = length;
...@@ -1150,13 +1150,13 @@ void isd200_data_copy(Scsi_Cmnd *srb, char * src, int length) ...@@ -1150,13 +1150,13 @@ void isd200_data_copy(Scsi_Cmnd *srb, char * src, int length)
/************************************************************************** /**************************************************************************
* isd200_scsi_to_ata * isd200_scsi_to_ata
* *
* Translate SCSI commands to ATA commands. * Translate SCSI commands to ATA commands.
* *
* RETURNS: * RETURNS:
* TRUE if the command needs to be sent to the transport layer * TRUE if the command needs to be sent to the transport layer
* FALSE otherwise * FALSE otherwise
*/ */
int isd200_scsi_to_ata(Scsi_Cmnd *srb, struct us_data *us, int isd200_scsi_to_ata(Scsi_Cmnd *srb, struct us_data *us,
union ata_cdb * ataCdb) union ata_cdb * ataCdb)
{ {
...@@ -1321,7 +1321,7 @@ int isd200_scsi_to_ata(Scsi_Cmnd *srb, struct us_data *us, ...@@ -1321,7 +1321,7 @@ int isd200_scsi_to_ata(Scsi_Cmnd *srb, struct us_data *us,
if (info->DeviceFlags & DF_REMOVABLE_MEDIA) { if (info->DeviceFlags & DF_REMOVABLE_MEDIA) {
US_DEBUGP(" srb->cmnd[4] = 0x%X\n", srb->cmnd[4]); US_DEBUGP(" srb->cmnd[4] = 0x%X\n", srb->cmnd[4]);
ataCdb->generic.SignatureByte0 = info->ConfigData.ATAMajorCommand; ataCdb->generic.SignatureByte0 = info->ConfigData.ATAMajorCommand;
ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand; ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand;
ataCdb->generic.TransferBlockSize = 1; ataCdb->generic.TransferBlockSize = 1;
...@@ -1378,12 +1378,12 @@ int isd200_scsi_to_ata(Scsi_Cmnd *srb, struct us_data *us, ...@@ -1378,12 +1378,12 @@ int isd200_scsi_to_ata(Scsi_Cmnd *srb, struct us_data *us,
/************************************************************************** /**************************************************************************
* isd200_init_info * isd200_init_info
* *
* Allocates (if necessary) and initializes the driver structure. * Allocates (if necessary) and initializes the driver structure.
* *
* RETURNS: * RETURNS:
* ISD status code * ISD status code
*/ */
int isd200_init_info(struct us_data *us) int isd200_init_info(struct us_data *us)
{ {
int retStatus = ISD200_GOOD; int retStatus = ISD200_GOOD;
...@@ -1394,11 +1394,11 @@ int isd200_init_info(struct us_data *us) ...@@ -1394,11 +1394,11 @@ int isd200_init_info(struct us_data *us)
US_DEBUGP("ERROR - kmalloc failure\n"); US_DEBUGP("ERROR - kmalloc failure\n");
retStatus = ISD200_ERROR; retStatus = ISD200_ERROR;
} }
} }
if (retStatus == ISD200_GOOD) { if (retStatus == ISD200_GOOD) {
memset(us->extra, 0, sizeof(struct isd200_info)); memset(us->extra, 0, sizeof(struct isd200_info));
} }
return(retStatus); return(retStatus);
} }
...@@ -1415,14 +1415,14 @@ int isd200_Initialization(struct us_data *us) ...@@ -1415,14 +1415,14 @@ int isd200_Initialization(struct us_data *us)
if (isd200_init_info(us) == ISD200_ERROR) { if (isd200_init_info(us) == ISD200_ERROR) {
US_DEBUGP("ERROR Initializing ISD200 Info struct\n"); US_DEBUGP("ERROR Initializing ISD200 Info struct\n");
} else { } else {
/* Get device specific data */ /* Get device specific data */
if (isd200_get_inquiry_data(us) != ISD200_GOOD) if (isd200_get_inquiry_data(us) != ISD200_GOOD)
US_DEBUGP("ISD200 Initialization Failure\n"); US_DEBUGP("ISD200 Initialization Failure\n");
else else
US_DEBUGP("ISD200 Initialization complete\n"); US_DEBUGP("ISD200 Initialization complete\n");
} }
return 0; return 0;
} }
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#define US_SC_UFI 0x04 /* Floppy */ #define US_SC_UFI 0x04 /* Floppy */
#define US_SC_8070 0x05 /* Removable media */ #define US_SC_8070 0x05 /* Removable media */
#define US_SC_SCSI 0x06 /* Transparent */ #define US_SC_SCSI 0x06 /* Transparent */
#define US_SC_ISD200 0x07 /* ISD200 ATA */ #define US_SC_ISD200 0x07 /* ISD200 ATA */
#define US_SC_MIN US_SC_RBC #define US_SC_MIN US_SC_RBC
#define US_SC_MAX US_SC_ISD200 #define US_SC_MAX US_SC_ISD200
......
...@@ -55,8 +55,7 @@ ...@@ -55,8 +55,7 @@
#define US_PR_SCM_ATAPI 0x80 /* SCM-ATAPI bridge */ #define US_PR_SCM_ATAPI 0x80 /* SCM-ATAPI bridge */
#endif #endif
#ifdef CONFIG_USB_STORAGE_SDDR09 #ifdef CONFIG_USB_STORAGE_SDDR09
#define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for #define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */
SDDR-09 */
#endif #endif
#ifdef CONFIG_USB_STORAGE_SDDR55 #ifdef CONFIG_USB_STORAGE_SDDR55
#define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */ #define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */
...@@ -64,15 +63,15 @@ ...@@ -64,15 +63,15 @@
#define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */ #define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */
#ifdef CONFIG_USB_STORAGE_FREECOM #ifdef CONFIG_USB_STORAGE_FREECOM
#define US_PR_FREECOM 0xf1 /* Freecom */ #define US_PR_FREECOM 0xf1 /* Freecom */
#endif #endif
#ifdef CONFIG_USB_STORAGE_DATAFAB #ifdef CONFIG_USB_STORAGE_DATAFAB
#define US_PR_DATAFAB 0xf2 /* Datafab chipsets */ #define US_PR_DATAFAB 0xf2 /* Datafab chipsets */
#endif #endif
#ifdef CONFIG_USB_STORAGE_JUMPSHOT #ifdef CONFIG_USB_STORAGE_JUMPSHOT
#define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */ #define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */
#endif #endif
/* /*
...@@ -118,10 +117,10 @@ struct bulk_cs_wrap { ...@@ -118,10 +117,10 @@ struct bulk_cs_wrap {
* usb_stor_bulk_transfer_xxx() return codes, in order of severity * usb_stor_bulk_transfer_xxx() return codes, in order of severity
*/ */
#define USB_STOR_XFER_GOOD 0 /* good transfer */ #define USB_STOR_XFER_GOOD 0 /* good transfer */
#define USB_STOR_XFER_SHORT 1 /* transfered less than expected */ #define USB_STOR_XFER_SHORT 1 /* transfered less than expected */
#define USB_STOR_XFER_STALLED 2 /* endpoint stalled */ #define USB_STOR_XFER_STALLED 2 /* endpoint stalled */
#define USB_STOR_XFER_ERROR 3 /* transfer died in the middle */ #define USB_STOR_XFER_ERROR 3 /* transfer died in the middle */
/* /*
* Transport return codes * Transport return codes
......
...@@ -264,7 +264,7 @@ UNUSUAL_DEV( 0x054c, 0x0032, 0x0000, 0x9999, ...@@ -264,7 +264,7 @@ UNUSUAL_DEV( 0x054c, 0x0032, 0x0000, 0x9999,
/* Submitted by Nathan Babb <nathan@lexi.com> */ /* Submitted by Nathan Babb <nathan@lexi.com> */
UNUSUAL_DEV( 0x054c, 0x006d, 0x0000, 0x9999, UNUSUAL_DEV( 0x054c, 0x006d, 0x0000, 0x9999,
"Sony", "Sony",
"PEG Mass Storage", "PEG Mass Storage",
US_SC_8070, US_PR_CBI, NULL, US_SC_8070, US_PR_CBI, NULL,
US_FL_FIX_INQUIRY ), US_FL_FIX_INQUIRY ),
...@@ -546,10 +546,10 @@ UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9009, ...@@ -546,10 +546,10 @@ UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9009,
/* aeb */ /* aeb */
UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff, UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff,
"Feiya", "Feiya",
"5-in-1 Card Reader", "5-in-1 Card Reader",
US_SC_SCSI, US_PR_BULK, NULL, US_SC_SCSI, US_PR_BULK, NULL,
US_FL_FIX_CAPACITY ), US_FL_FIX_CAPACITY ),
UNUSUAL_DEV( 0x097a, 0x0001, 0x0000, 0x0001, UNUSUAL_DEV( 0x097a, 0x0001, 0x0000, 0x0001,
"Minds@Work", "Minds@Work",
......
...@@ -943,7 +943,7 @@ static void storage_disconnect(struct usb_interface *intf) ...@@ -943,7 +943,7 @@ static void storage_disconnect(struct usb_interface *intf)
US_DEBUGP("storage_disconnect() called\n"); US_DEBUGP("storage_disconnect() called\n");
ss = usb_get_intfdata(intf); ss = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
/* serious error -- we're attempting to disconnect an interface but /* serious error -- we're attempting to disconnect an interface but
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment