diff options
Diffstat (limited to 'drivers/staging/keucr/usb.h')
| -rw-r--r-- | drivers/staging/keucr/usb.h | 170 |
1 files changed, 86 insertions, 84 deletions
diff --git a/drivers/staging/keucr/usb.h b/drivers/staging/keucr/usb.h index bbf578ad631..e894f840c70 100644 --- a/drivers/staging/keucr/usb.h +++ b/drivers/staging/keucr/usb.h @@ -1,4 +1,4 @@ -// Driver for USB Mass Storage compliant devices +/* Driver for USB Mass Storage compliant devices */ #ifndef _USB_H_ #define _USB_H_ @@ -10,7 +10,6 @@ #include <linux/mutex.h> #include <scsi/scsi_host.h> #include "common.h" -#include "ms.h" struct us_data; struct scsi_cmnd; @@ -20,26 +19,26 @@ struct scsi_cmnd; */ struct us_unusual_dev { - const char* vendorName; - const char* productName; + const char *vendorName; + const char *productName; __u8 useProtocol; __u8 useTransport; int (*initFunction)(struct us_data *); }; -//EnE HW Register +/* EnE HW Register */ #define REG_CARD_STATUS 0xFF83 #define REG_HW_TRAP1 0xFF89 -// SRB Status. Refers /usr/include/wine/wine/wnaspi32.h & SCSI sense key -#define SS_SUCCESS 0x00 // No Sense +/* SRB Status. Refers /usr/include/wine/wine/wnaspi32.h & SCSI sense key */ +#define SS_SUCCESS 0x00 /* No Sense */ #define SS_NOT_READY 0x02 #define SS_MEDIUM_ERR 0x03 #define SS_HW_ERR 0x04 #define SS_ILLEGAL_REQUEST 0x05 #define SS_UNIT_ATTENTION 0x06 -//ENE Load FW Pattern +/* ENE Load FW Pattern */ #define SD_INIT1_PATTERN 1 #define SD_INIT2_PATTERN 2 #define SD_RW_PATTERN 3 @@ -52,39 +51,40 @@ struct us_unusual_dev { #define FDIR_WRITE 0 #define FDIR_READ 1 -typedef struct _SD_STATUS { - BYTE Insert:1; - BYTE Ready:1; - BYTE MediaChange:1; - BYTE IsMMC:1; - BYTE HiCapacity:1; - BYTE HiSpeed:1; - BYTE WtP:1; - BYTE Reserved:1; -} SD_STATUS, *PSD_STATUS; - -typedef struct _MS_STATUS { - BYTE Insert:1; - BYTE Ready:1; - BYTE MediaChange:1; - BYTE IsMSPro:1; - BYTE IsMSPHG:1; - BYTE Reserved1:1; - BYTE WtP:1; - BYTE Reserved2:1; -} MS_STATUS, *PMS_STATUS; - -typedef struct _SM_STATUS { - BYTE Insert:1; - BYTE Ready:1; - BYTE MediaChange:1; - BYTE Reserved:3; - BYTE WtP:1; - BYTE IsMS:1; -} SM_STATUS, *PSM_STATUS; - -// SD Block Length -#define SD_BLOCK_LEN 9 // 2^9 = 512 Bytes, The HW maximum read/write data length +struct keucr_sd_status { + u8 Insert:1; + u8 Ready:1; + u8 MediaChange:1; + u8 IsMMC:1; + u8 HiCapacity:1; + u8 HiSpeed:1; + u8 WtP:1; + u8 Reserved:1; +}; + +struct keucr_ms_status { + u8 Insert:1; + u8 Ready:1; + u8 MediaChange:1; + u8 IsMSPro:1; + u8 IsMSPHG:1; + u8 Reserved1:1; + u8 WtP:1; + u8 Reserved2:1; +}; + +struct keucr_sm_status { + u8 Insert:1; + u8 Ready:1; + u8 MediaChange:1; + u8 Reserved:3; + u8 WtP:1; + u8 IsMS:1; +}; + +/* SD Block Length */ +#define SD_BLOCK_LEN 9 /* 2^9 = 512 Bytes, + The HW maximum read/write data length */ /* Dynamic bitflag definitions (us->dflags): used in set_bit() etc. */ #define US_FLIDX_URB_ACTIVE 0 /* current_urb is in use */ @@ -108,9 +108,9 @@ typedef struct _SM_STATUS { #define US_IOBUF_SIZE 64 /* Size of the DMA-mapped I/O buffer */ #define US_SENSE_SIZE 18 /* Size of the autosense data buffer */ -typedef int (*trans_cmnd)(struct scsi_cmnd *, struct us_data*); -typedef int (*trans_reset)(struct us_data*); -typedef void (*proto_cmnd)(struct scsi_cmnd*, struct us_data*); +typedef int (*trans_cmnd)(struct scsi_cmnd *, struct us_data *); +typedef int (*trans_reset)(struct us_data *); +typedef void (*proto_cmnd)(struct scsi_cmnd *, struct us_data *); typedef void (*extra_data_destructor)(void *); /* extra data destructor */ typedef void (*pm_hook)(struct us_data *, int); /* power management hook */ @@ -177,52 +177,54 @@ struct us_data { #ifdef CONFIG_PM pm_hook suspend_resume_hook; #endif - // for 6250 code - SD_STATUS SD_Status; - MS_STATUS MS_Status; - SM_STATUS SM_Status; - - //----- SD Control Data ---------------- - //SD_REGISTER SD_Regs; - WORD SD_Block_Mult; - BYTE SD_READ_BL_LEN; - WORD SD_C_SIZE; - BYTE SD_C_SIZE_MULT; - - // SD/MMC New spec. - BYTE SD_SPEC_VER; - BYTE SD_CSD_VER; - BYTE SD20_HIGH_CAPACITY; - DWORD HC_C_SIZE; - BYTE MMC_SPEC_VER; - BYTE MMC_BusWidth; - BYTE MMC_HIGH_CAPACITY; - - //----- MS Control Data ---------------- - BOOLEAN MS_SWWP; - DWORD MSP_TotalBlock; - MS_LibControl MS_Lib; - BOOLEAN MS_IsRWPage; - WORD MS_Model; - - //----- SM Control Data ---------------- - BYTE SM_DeviceID; - BYTE SM_CardID; - - PBYTE testbuf; - BYTE BIN_FLAG; - DWORD bl_num; + /* for 6250 code */ + struct keucr_sd_status SD_Status; + struct keucr_ms_status MS_Status; + struct keucr_sm_status SM_Status; + + /* ----- SD Control Data ---------------- */ + /* SD_REGISTER SD_Regs; */ + u16 SD_Block_Mult; + u8 SD_READ_BL_LEN; + u16 SD_C_SIZE; + u8 SD_C_SIZE_MULT; + + /* SD/MMC New spec. */ + u8 SD_SPEC_VER; + u8 SD_CSD_VER; + u8 SD20_HIGH_CAPACITY; + u32 HC_C_SIZE; + u8 MMC_SPEC_VER; + u8 MMC_BusWidth; + u8 MMC_HIGH_CAPACITY; + + /* ----- MS Control Data ---------------- */ + bool MS_SWWP; + u32 MSP_TotalBlock; + /* MS_LibControl MS_Lib; */ + bool MS_IsRWPage; + u16 MS_Model; + + /* ----- SM Control Data ---------------- */ + u8 SM_DeviceID; + u8 SM_CardID; + + u8 *testbuf; + u8 BIN_FLAG; + u32 bl_num; int SrbStatus; - - //------Power Managerment --------------- - BOOLEAN Power_IsResum; + + /* ------Power Managerment --------------- */ + bool Power_IsResum; }; /* Convert between us_data and the corresponding Scsi_Host */ -static inline struct Scsi_Host *us_to_host(struct us_data *us) { +static inline struct Scsi_Host *us_to_host(struct us_data *us) +{ return container_of((void *) us, struct Scsi_Host, hostdata); } -static inline struct us_data *host_to_us(struct Scsi_Host *host) { +static inline struct us_data *host_to_us(struct Scsi_Host *host) +{ return (struct us_data *) host->hostdata; } |
