Commit b7b1e655 authored by Daniel Drake's avatar Daniel Drake Committed by Greg Kroah-Hartman

[PATCH] usb-storage: Some minor shuttle_usbat cleanups

A while ago, Matthew Dharm wrote:
> Looks good.  Tho, I would like to see a future patch to do two things:
> 	1) Change comments from C++ style to C-style
> 	2) Make sure we're naming consistently everywhere SCM, USBAT,
> 	USBAT-02 (most noticably needing fixing is the string used at
> 	transport-selection time, but a sweep of all uses to be consistent
> 	would be in order).

Sorry for the long delay, here is a patch to address this. I also clarified
some ATA/ATAPI wording + function names.
Signed-off-by: default avatarDaniel Drake <dsd@gentoo.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>

 drivers/usb/storage/shuttle_usbat.c |  306 ++++++++++++++++++++----------------
 drivers/usb/storage/shuttle_usbat.h |   66 +++----
 drivers/usb/storage/transport.h     |    2
 drivers/usb/storage/unusual_devs.h  |   10 -
 drivers/usb/storage/usb.c           |    4
 5 files changed, 213 insertions(+), 175 deletions(-)
parent a8798533
This diff is collapsed.
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
#define USBAT_UIO_WRITE 0 #define USBAT_UIO_WRITE 0
/* Qualifier bits */ /* Qualifier bits */
#define USBAT_QUAL_FCQ 0x20 // full compare #define USBAT_QUAL_FCQ 0x20 /* full compare */
#define USBAT_QUAL_ALQ 0x10 // auto load subcount #define USBAT_QUAL_ALQ 0x10 /* auto load subcount */
/* USBAT Flash Media status types */ /* USBAT Flash Media status types */
#define USBAT_FLASH_MEDIA_NONE 0 #define USBAT_FLASH_MEDIA_NONE 0
...@@ -67,39 +67,39 @@ ...@@ -67,39 +67,39 @@
#define USBAT_FLASH_MEDIA_CHANGED 1 #define USBAT_FLASH_MEDIA_CHANGED 1
/* USBAT ATA registers */ /* USBAT ATA registers */
#define USBAT_ATA_DATA 0x10 // read/write data (R/W) #define USBAT_ATA_DATA 0x10 /* read/write data (R/W) */
#define USBAT_ATA_FEATURES 0x11 // set features (W) #define USBAT_ATA_FEATURES 0x11 /* set features (W) */
#define USBAT_ATA_ERROR 0x11 // error (R) #define USBAT_ATA_ERROR 0x11 /* error (R) */
#define USBAT_ATA_SECCNT 0x12 // sector count (R/W) #define USBAT_ATA_SECCNT 0x12 /* sector count (R/W) */
#define USBAT_ATA_SECNUM 0x13 // sector number (R/W) #define USBAT_ATA_SECNUM 0x13 /* sector number (R/W) */
#define USBAT_ATA_LBA_ME 0x14 // cylinder low (R/W) #define USBAT_ATA_LBA_ME 0x14 /* cylinder low (R/W) */
#define USBAT_ATA_LBA_HI 0x15 // cylinder high (R/W) #define USBAT_ATA_LBA_HI 0x15 /* cylinder high (R/W) */
#define USBAT_ATA_DEVICE 0x16 // head/device selection (R/W) #define USBAT_ATA_DEVICE 0x16 /* head/device selection (R/W) */
#define USBAT_ATA_STATUS 0x17 // device status (R) #define USBAT_ATA_STATUS 0x17 /* device status (R) */
#define USBAT_ATA_CMD 0x17 // device command (W) #define USBAT_ATA_CMD 0x17 /* device command (W) */
#define USBAT_ATA_ALTSTATUS 0x0E // status (no clear IRQ) (R) #define USBAT_ATA_ALTSTATUS 0x0E /* status (no clear IRQ) (R) */
/* USBAT User I/O Data registers */ /* USBAT User I/O Data registers */
#define USBAT_UIO_EPAD 0x80 // Enable Peripheral Control Signals #define USBAT_UIO_EPAD 0x80 /* Enable Peripheral Control Signals */
#define USBAT_UIO_CDT 0x40 // Card Detect (Read Only) #define USBAT_UIO_CDT 0x40 /* Card Detect (Read Only) */
// CDT = ACKD & !UI1 & !UI0 /* CDT = ACKD & !UI1 & !UI0 */
#define USBAT_UIO_1 0x20 // I/O 1 #define USBAT_UIO_1 0x20 /* I/O 1 */
#define USBAT_UIO_0 0x10 // I/O 0 #define USBAT_UIO_0 0x10 /* I/O 0 */
#define USBAT_UIO_EPP_ATA 0x08 // 1=EPP mode, 0=ATA mode #define USBAT_UIO_EPP_ATA 0x08 /* 1=EPP mode, 0=ATA mode */
#define USBAT_UIO_UI1 0x04 // Input 1 #define USBAT_UIO_UI1 0x04 /* Input 1 */
#define USBAT_UIO_UI0 0x02 // Input 0 #define USBAT_UIO_UI0 0x02 /* Input 0 */
#define USBAT_UIO_INTR_ACK 0x01 // Interrupt (ATA & ISA)/Acknowledge (EPP) #define USBAT_UIO_INTR_ACK 0x01 /* Interrupt (ATA/ISA)/Acknowledge (EPP) */
/* USBAT User I/O Enable registers */ /* USBAT User I/O Enable registers */
#define USBAT_UIO_DRVRST 0x80 // Reset Peripheral #define USBAT_UIO_DRVRST 0x80 /* Reset Peripheral */
#define USBAT_UIO_ACKD 0x40 // Enable Card Detect #define USBAT_UIO_ACKD 0x40 /* Enable Card Detect */
#define USBAT_UIO_OE1 0x20 // I/O 1 set=output/clr=input #define USBAT_UIO_OE1 0x20 /* I/O 1 set=output/clr=input */
// If ACKD=1, set OE1 to 1 also. /* If ACKD=1, set OE1 to 1 also. */
#define USBAT_UIO_OE0 0x10 // I/O 0 set=output/clr=input #define USBAT_UIO_OE0 0x10 /* I/O 0 set=output/clr=input */
#define USBAT_UIO_ADPRST 0x01 // Reset SCM chip #define USBAT_UIO_ADPRST 0x01 /* Reset SCM chip */
/* USBAT Features */ /* USBAT Features */
#define USBAT_FEAT_ETEN 0x80 // External trigger enable #define USBAT_FEAT_ETEN 0x80 /* External trigger enable */
#define USBAT_FEAT_U1 0x08 #define USBAT_FEAT_U1 0x08
#define USBAT_FEAT_U0 0x04 #define USBAT_FEAT_U0 0x04
#define USBAT_FEAT_ET1 0x02 #define USBAT_FEAT_ET1 0x02
...@@ -112,12 +112,12 @@ struct usbat_info { ...@@ -112,12 +112,12 @@ struct usbat_info {
int devicetype; int devicetype;
/* Used for Flash readers only */ /* Used for Flash readers only */
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 */
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
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */ #define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */
#define US_PR_BULK 0x50 /* bulk only */ #define US_PR_BULK 0x50 /* bulk only */
#ifdef CONFIG_USB_STORAGE_USBAT #ifdef CONFIG_USB_STORAGE_USBAT
#define US_PR_SCM_ATAPI 0x80 /* SCM-ATAPI bridge */ #define US_PR_USBAT 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 SDDR-09 */ #define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */
......
...@@ -71,12 +71,12 @@ UNUSUAL_DEV( 0x03f0, 0x0107, 0x0200, 0x0200, ...@@ -71,12 +71,12 @@ UNUSUAL_DEV( 0x03f0, 0x0107, 0x0200, 0x0200,
UNUSUAL_DEV( 0x03f0, 0x0207, 0x0001, 0x0001, UNUSUAL_DEV( 0x03f0, 0x0207, 0x0001, 0x0001,
"HP", "HP",
"CD-Writer+ 8200e", "CD-Writer+ 8200e",
US_SC_8070, US_PR_SCM_ATAPI, init_usbat, 0), US_SC_8070, US_PR_USBAT, init_usbat, 0),
UNUSUAL_DEV( 0x03f0, 0x0307, 0x0001, 0x0001, UNUSUAL_DEV( 0x03f0, 0x0307, 0x0001, 0x0001,
"HP", "HP",
"CD-Writer+ CD-4e", "CD-Writer+ CD-4e",
US_SC_8070, US_PR_SCM_ATAPI, init_usbat, 0), US_SC_8070, US_PR_USBAT, init_usbat, 0),
#endif #endif
/* Patch submitted by Mihnea-Costin Grigore <mihnea@zulu.ro> */ /* Patch submitted by Mihnea-Costin Grigore <mihnea@zulu.ro> */
...@@ -333,9 +333,9 @@ UNUSUAL_DEV( 0x04fc, 0x80c2, 0x0100, 0x0100, ...@@ -333,9 +333,9 @@ UNUSUAL_DEV( 0x04fc, 0x80c2, 0x0100, 0x0100,
#ifdef CONFIG_USB_STORAGE_USBAT #ifdef CONFIG_USB_STORAGE_USBAT
UNUSUAL_DEV( 0x04e6, 0x1010, 0x0000, 0x9999, UNUSUAL_DEV( 0x04e6, 0x1010, 0x0000, 0x9999,
"SCM", "Shuttle/SCM",
"SCM USBAT-02", "USBAT-02",
US_SC_SCSI, US_PR_SCM_ATAPI, init_usbat, US_SC_SCSI, US_PR_USBAT, init_usbat,
US_FL_SINGLE_LUN), US_FL_SINGLE_LUN),
#endif #endif
......
...@@ -555,8 +555,8 @@ static int get_transport(struct us_data *us) ...@@ -555,8 +555,8 @@ static int get_transport(struct us_data *us)
break; break;
#ifdef CONFIG_USB_STORAGE_USBAT #ifdef CONFIG_USB_STORAGE_USBAT
case US_PR_SCM_ATAPI: case US_PR_USBAT:
us->transport_name = "SCM/ATAPI"; us->transport_name = "Shuttle USBAT";
us->transport = usbat_transport; us->transport = usbat_transport;
us->transport_reset = usb_stor_CB_reset; us->transport_reset = usb_stor_CB_reset;
us->max_lun = 1; us->max_lun = 1;
......
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