Staging: keucr: fix up some coding style issues in the .h files

This resolves a few of the coding style issues in the .h files
for this driver.  It doesn't get all of them by far, but it's a
good start.

Cc: Al Cho <acho@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2010-09-08 02:47:47 -07:00
parent 126bb03b46
commit 2d2f03b022
5 changed files with 2245 additions and 1228 deletions

View File

@ -1,23 +1,24 @@
#ifndef COMMON_INCD #ifndef COMMON_INCD
#define COMMON_INCD #define COMMON_INCD
typedef void VOID; typedef void VOID;
typedef u8 BOOLEAN; typedef u8 BOOLEAN;
typedef u8 BYTE; typedef u8 BYTE;
typedef u8 *PBYTE; typedef u8 *PBYTE;
typedef u16 WORD; typedef u16 WORD;
typedef u16 *PWORD; typedef u16 *PWORD;
typedef u32 DWORD; typedef u32 DWORD;
typedef u32 *PDWORD; typedef u32 *PDWORD;
#define swapWORD(w) ((((unsigned short)(w) << 8) & 0xff00) | (((unsigned short)(w) >> 8) & 0x00ff)) #define swapWORD(w) ((((unsigned short)(w) << 8) & 0xff00) | \
#define swapDWORD(dw) ((((unsigned long)(dw) << 24) & 0xff000000) | \ (((unsigned short)(w) >> 8) & 0x00ff))
(((unsigned long)(dw) << 8) & 0x00ff0000) | \ #define swapDWORD(dw) ((((unsigned long)(dw) << 24) & 0xff000000) | \
(((unsigned long)(dw) >> 8) & 0x0000ff00) | \ (((unsigned long)(dw) << 8) & 0x00ff0000) | \
(((unsigned long)(dw) >> 24) & 0x000000ff)) (((unsigned long)(dw) >> 8) & 0x0000ff00) | \
(((unsigned long)(dw) >> 24) & 0x000000ff))
#define LittleEndianWORD(w) (w) #define LittleEndianWORD(w) (w)
#define LittleEndianDWORD(dw) (dw) #define LittleEndianDWORD(dw) (dw)
#define BigEndianWORD(w) swapWORD(w) #define BigEndianWORD(w) swapWORD(w)
#define BigEndianDWORD(dw) swapDWORD(dw) #define BigEndianDWORD(dw) swapDWORD(dw)

File diff suppressed because it is too large Load Diff

View File

@ -80,10 +80,10 @@
#define MS_REG_MNG_SYSFLG_USER MS_REG_MNG_SYSFLG // user block #define MS_REG_MNG_SYSFLG_USER MS_REG_MNG_SYSFLG // user block
#define MS_REG_MNG_SYSFLG_BOOT 0x00 // system block #define MS_REG_MNG_SYSFLG_BOOT 0x00 // system block
#define MS_REG_MNG_RESERVED 0xc3 #define MS_REG_MNG_RESERVED 0xc3
#define MS_REG_MNG_DEFAULT (MS_REG_MNG_SCMS_COPY_OK | \ #define MS_REG_MNG_DEFAULT (MS_REG_MNG_SCMS_COPY_OK | \
MS_REG_MNG_ATFLG_OTHER | \ MS_REG_MNG_ATFLG_OTHER | \
MS_REG_MNG_SYSFLG_USER | \ MS_REG_MNG_SYSFLG_USER | \
MS_REG_MNG_RESERVED) MS_REG_MNG_RESERVED)
// Error codes // Error codes
#define MS_STATUS_SUCCESS 0x0000 #define MS_STATUS_SUCCESS 0x0000
@ -183,201 +183,199 @@
//----- MemStickRegisters -------------------------------------------- //----- MemStickRegisters --------------------------------------------
// Status registers (16 bytes) // Status registers (16 bytes)
typedef struct { typedef struct {
BYTE Reserved0; // 00 BYTE Reserved0; // 00
BYTE INTRegister; // 01 BYTE INTRegister; // 01
BYTE StatusRegister0; // 02 BYTE StatusRegister0; // 02
BYTE StatusRegister1; // 03 BYTE StatusRegister1; // 03
BYTE Reserved1[12]; // 04-0F BYTE Reserved1[12]; // 04-0F
} MemStickStatusRegisters; } MemStickStatusRegisters;
// Parameter registers (6 bytes) // Parameter registers (6 bytes)
typedef struct { typedef struct {
BYTE SystemParameter; // 10 BYTE SystemParameter; // 10
BYTE BlockAddress2; // 11 BYTE BlockAddress2; // 11
BYTE BlockAddress1; // 12 BYTE BlockAddress1; // 12
BYTE BlockAddress0; // 13 BYTE BlockAddress0; // 13
BYTE CMDParameter; // 14 BYTE CMDParameter; // 14
BYTE PageAddress; // 15 BYTE PageAddress; // 15
} MemStickParameterRegisters; } MemStickParameterRegisters;
// Extra registers (9 bytes) // Extra registers (9 bytes)
typedef struct { typedef struct {
BYTE OverwriteFlag; // 16 BYTE OverwriteFlag; // 16
BYTE ManagementFlag; // 17 BYTE ManagementFlag; // 17
BYTE LogicalAddress1; // 18 BYTE LogicalAddress1; // 18
BYTE LogicalAddress0; // 19 BYTE LogicalAddress0; // 19
BYTE ReservedArea[5]; // 1A-1E BYTE ReservedArea[5]; // 1A-1E
} MemStickExtraDataRegisters; } MemStickExtraDataRegisters;
// All registers in Memory Stick (32 bytes, includes 1 byte padding) // All registers in Memory Stick (32 bytes, includes 1 byte padding)
typedef struct { typedef struct {
MemStickStatusRegisters status; MemStickStatusRegisters status;
MemStickParameterRegisters param; MemStickParameterRegisters param;
MemStickExtraDataRegisters extra; MemStickExtraDataRegisters extra;
BYTE padding; BYTE padding;
} MemStickRegisters, *PMemStickRegisters; } MemStickRegisters, *PMemStickRegisters;
//----- MemStickBootBlockPage0 --------------------------------------- //----- MemStickBootBlockPage0 ---------------------------------------
typedef struct { typedef struct {
WORD wBlockID; WORD wBlockID;
WORD wFormatVersion; WORD wFormatVersion;
BYTE bReserved1[184]; BYTE bReserved1[184];
BYTE bNumberOfDataEntry; BYTE bNumberOfDataEntry;
BYTE bReserved2[179]; BYTE bReserved2[179];
} MemStickBootBlockHeader; } MemStickBootBlockHeader;
typedef struct { typedef struct {
DWORD dwStart; DWORD dwStart;
DWORD dwSize; DWORD dwSize;
BYTE bType; BYTE bType;
BYTE bReserved[3]; BYTE bReserved[3];
} MemStickBootBlockSysEntRec; } MemStickBootBlockSysEntRec;
typedef struct { typedef struct {
MemStickBootBlockSysEntRec entry[MS_NUMBER_OF_SYSTEM_ENTRY]; MemStickBootBlockSysEntRec entry[MS_NUMBER_OF_SYSTEM_ENTRY];
} MemStickBootBlockSysEnt; } MemStickBootBlockSysEnt;
typedef struct { typedef struct {
BYTE bMsClass; // must be 1 BYTE bMsClass; // must be 1
BYTE bCardType; // see below BYTE bCardType; // see below
WORD wBlockSize; // n KB WORD wBlockSize; // n KB
WORD wBlockNumber; // number of physical block WORD wBlockNumber; // number of physical block
WORD wTotalBlockNumber; // number of logical block WORD wTotalBlockNumber; // number of logical block
WORD wPageSize; // must be 0x200 WORD wPageSize; // must be 0x200
BYTE bExtraSize; // 0x10 BYTE bExtraSize; // 0x10
BYTE bSecuritySupport; BYTE bSecuritySupport;
BYTE bAssemblyDate[8]; BYTE bAssemblyDate[8];
BYTE bFactoryArea[4]; BYTE bFactoryArea[4];
BYTE bAssemblyMakerCode; BYTE bAssemblyMakerCode;
BYTE bAssemblyMachineCode[3]; BYTE bAssemblyMachineCode[3];
WORD wMemoryMakerCode; WORD wMemoryMakerCode;
WORD wMemoryDeviceCode; WORD wMemoryDeviceCode;
WORD wMemorySize; WORD wMemorySize;
BYTE bReserved1; BYTE bReserved1;
BYTE bReserved2; BYTE bReserved2;
BYTE bVCC; BYTE bVCC;
BYTE bVPP; BYTE bVPP;
WORD wControllerChipNumber; WORD wControllerChipNumber;
WORD wControllerFunction; // New MS WORD wControllerFunction; // New MS
BYTE bReserved3[9]; // New MS BYTE bReserved3[9]; // New MS
BYTE bParallelSupport; // New MS BYTE bParallelSupport; // New MS
WORD wFormatValue; // New MS WORD wFormatValue; // New MS
BYTE bFormatType; BYTE bFormatType;
BYTE bUsage; BYTE bUsage;
BYTE bDeviceType; BYTE bDeviceType;
BYTE bReserved4[22]; BYTE bReserved4[22];
BYTE bFUValue3; BYTE bFUValue3;
BYTE bFUValue4; BYTE bFUValue4;
BYTE bReserved5[15]; BYTE bReserved5[15];
} MemStickBootBlockSysInf; } MemStickBootBlockSysInf;
typedef struct { typedef struct {
MemStickBootBlockHeader header; MemStickBootBlockHeader header;
MemStickBootBlockSysEnt sysent; MemStickBootBlockSysEnt sysent;
MemStickBootBlockSysInf sysinf; MemStickBootBlockSysInf sysinf;
} MemStickBootBlockPage0; } MemStickBootBlockPage0;
//----- MemStickBootBlockCIS_IDI ------------------------------------- //----- MemStickBootBlockCIS_IDI -------------------------------------
typedef struct { typedef struct {
BYTE bCistplDEVICE[6]; // 0 BYTE bCistplDEVICE[6]; // 0
BYTE bCistplDEVICE0C[6]; // 6 BYTE bCistplDEVICE0C[6]; // 6
BYTE bCistplJEDECC[4]; // 12 BYTE bCistplJEDECC[4]; // 12
BYTE bCistplMANFID[6]; // 16 BYTE bCistplMANFID[6]; // 16
BYTE bCistplVER1[32]; // 22 BYTE bCistplVER1[32]; // 22
BYTE bCistplFUNCID[4]; // 54 BYTE bCistplFUNCID[4]; // 54
BYTE bCistplFUNCE0[4]; // 58 BYTE bCistplFUNCE0[4]; // 58
BYTE bCistplFUNCE1[5]; // 62 BYTE bCistplFUNCE1[5]; // 62
BYTE bCistplCONF[7]; // 67 BYTE bCistplCONF[7]; // 67
BYTE bCistplCFTBLENT0[10]; // 74 BYTE bCistplCFTBLENT0[10]; // 74
BYTE bCistplCFTBLENT1[8]; // 84 BYTE bCistplCFTBLENT1[8]; // 84
BYTE bCistplCFTBLENT2[12]; // 92 BYTE bCistplCFTBLENT2[12]; // 92
BYTE bCistplCFTBLENT3[8]; // 104 BYTE bCistplCFTBLENT3[8]; // 104
BYTE bCistplCFTBLENT4[17]; // 112 BYTE bCistplCFTBLENT4[17]; // 112
BYTE bCistplCFTBLENT5[8]; // 129 BYTE bCistplCFTBLENT5[8]; // 129
BYTE bCistplCFTBLENT6[17]; // 137 BYTE bCistplCFTBLENT6[17]; // 137
BYTE bCistplCFTBLENT7[8]; // 154 BYTE bCistplCFTBLENT7[8]; // 154
BYTE bCistplNOLINK[3]; // 162 BYTE bCistplNOLINK[3]; // 162
} MemStickBootBlockCIS; } MemStickBootBlockCIS;
typedef struct { typedef struct {
#define MS_IDI_GENERAL_CONF 0x848A #define MS_IDI_GENERAL_CONF 0x848A
WORD wIDIgeneralConfiguration; // 0 WORD wIDIgeneralConfiguration; // 0
WORD wIDInumberOfCylinder; // 1 WORD wIDInumberOfCylinder; // 1
WORD wIDIreserved0; // 2 WORD wIDIreserved0; // 2
WORD wIDInumberOfHead; // 3 WORD wIDInumberOfHead; // 3
WORD wIDIbytesPerTrack; // 4 WORD wIDIbytesPerTrack; // 4
WORD wIDIbytesPerSector; // 5 WORD wIDIbytesPerSector; // 5
WORD wIDIsectorsPerTrack; // 6 WORD wIDIsectorsPerTrack; // 6
WORD wIDItotalSectors[2]; // 7-8 high,low WORD wIDItotalSectors[2]; // 7-8 high,low
WORD wIDIreserved1[11]; // 9-19 WORD wIDIreserved1[11]; // 9-19
WORD wIDIbufferType; // 20 WORD wIDIbufferType; // 20
WORD wIDIbufferSize; // 21 WORD wIDIbufferSize; // 21
WORD wIDIlongCmdECC; // 22 WORD wIDIlongCmdECC; // 22
WORD wIDIfirmVersion[4]; // 23-26 WORD wIDIfirmVersion[4]; // 23-26
WORD wIDImodelName[20]; // 27-46 WORD wIDImodelName[20]; // 27-46
WORD wIDIreserved2; // 47 WORD wIDIreserved2; // 47
WORD wIDIlongWordSupported; // 48 WORD wIDIlongWordSupported; // 48
WORD wIDIdmaSupported; // 49 WORD wIDIdmaSupported; // 49
WORD wIDIreserved3; // 50 WORD wIDIreserved3; // 50
WORD wIDIpioTiming; // 51 WORD wIDIpioTiming; // 51
WORD wIDIdmaTiming; // 52 WORD wIDIdmaTiming; // 52
WORD wIDItransferParameter; // 53 WORD wIDItransferParameter; // 53
WORD wIDIformattedCylinder; // 54 WORD wIDIformattedCylinder; // 54
WORD wIDIformattedHead; // 55 WORD wIDIformattedHead; // 55
WORD wIDIformattedSectorsPerTrack; // 56 WORD wIDIformattedSectorsPerTrack; // 56
WORD wIDIformattedTotalSectors[2]; // 57-58 WORD wIDIformattedTotalSectors[2]; // 57-58
WORD wIDImultiSector; // 59 WORD wIDImultiSector; // 59
WORD wIDIlbaSectors[2]; // 60-61 WORD wIDIlbaSectors[2]; // 60-61
WORD wIDIsingleWordDMA; // 62 WORD wIDIsingleWordDMA; // 62
WORD wIDImultiWordDMA; // 63 WORD wIDImultiWordDMA; // 63
WORD wIDIreserved4[192]; // 64-255 WORD wIDIreserved4[192]; // 64-255
} MemStickBootBlockIDI; } MemStickBootBlockIDI;
typedef struct { typedef struct {
union {
MemStickBootBlockCIS cis;
BYTE dmy[256];
} cis;
union union {
{ MemStickBootBlockIDI idi;
MemStickBootBlockCIS cis; BYTE dmy[256];
BYTE dmy[256]; } idi;
} cis;
union
{
MemStickBootBlockIDI idi;
BYTE dmy[256];
} idi;
} MemStickBootBlockCIS_IDI; } MemStickBootBlockCIS_IDI;
//----- MS_LibControl ------------------------------------------------ //----- MS_LibControl ------------------------------------------------
typedef struct { typedef struct {
BYTE reserved; BYTE reserved;
BYTE intr; BYTE intr;
BYTE status0; BYTE status0;
BYTE status1; BYTE status1;
BYTE ovrflg; BYTE ovrflg;
BYTE mngflg; BYTE mngflg;
WORD logadr; WORD logadr;
} MS_LibTypeExtdat; } MS_LibTypeExtdat;
typedef struct { typedef struct {
DWORD flags; DWORD flags;
DWORD BytesPerSector; DWORD BytesPerSector;
DWORD NumberOfCylinder; DWORD NumberOfCylinder;
DWORD SectorsPerCylinder; DWORD SectorsPerCylinder;
WORD cardType; // R/W, RO, Hybrid WORD cardType; // R/W, RO, Hybrid
WORD blockSize; WORD blockSize;
WORD PagesPerBlock; WORD PagesPerBlock;
WORD NumberOfPhyBlock; WORD NumberOfPhyBlock;
WORD NumberOfLogBlock; WORD NumberOfLogBlock;
WORD NumberOfSegment; WORD NumberOfSegment;
WORD *Phy2LogMap; //phy2log table WORD *Phy2LogMap; // phy2log table
WORD *Log2PhyMap; //log2phy table WORD *Log2PhyMap; // log2phy table
WORD wrtblk; WORD wrtblk;
BYTE pagemap[(MS_MAX_PAGES_PER_BLOCK+(MS_LIB_BITS_PER_BYTE-1))/MS_LIB_BITS_PER_BYTE]; BYTE pagemap[(MS_MAX_PAGES_PER_BLOCK + (MS_LIB_BITS_PER_BYTE-1)) /
BYTE *blkpag; MS_LIB_BITS_PER_BYTE];
MS_LibTypeExtdat *blkext; BYTE *blkpag;
BYTE copybuf[512]; MS_LibTypeExtdat *blkext;
BYTE copybuf[512];
} MS_LibControl; } MS_LibControl;
#endif #endif

View File

@ -1,4 +1,4 @@
//----- < SMCommon.h> -------------------------------------------------- /*----- < SMCommon.h> --------------------------------------------------*/
#ifndef SMCOMMON_INCD #ifndef SMCOMMON_INCD
#define SMCOMMON_INCD #define SMCOMMON_INCD
@ -24,17 +24,10 @@ Define Difinetion
#define ERR_IllegalFmt 0x0031 /* Medium Format Corrupted */ #define ERR_IllegalFmt 0x0031 /* Medium Format Corrupted */
#define ERR_NoSmartMedia 0x003A /* Medium Not Present */ #define ERR_NoSmartMedia 0x003A /* Medium Not Present */
/***************************************************************************/ /***************************************************************************/
//#define SUCCESS 0 /* SUCCESS */ char Bit_D_Count(BYTE);
//#define ERROR -1 /* ERROR */ char Bit_D_CountWord(WORD);
void StringCopy(char *, char *, int);
int StringCmp(char *, char *, int);
/***************************************************************************/ #endif
char Bit_D_Count (BYTE);
char Bit_D_CountWord (WORD);
void StringCopy (char *, char *, int);
int StringCmp (char *, char *, int);
#endif // already included

View File

@ -1,4 +1,4 @@
//----- < smil.h> ---------------------------------------------------- /*----- < smil.h> ----------------------------------------------------*/
#ifndef SMIL_INCD #ifndef SMIL_INCD
#define SMIL_INCD #define SMIL_INCD
@ -165,43 +165,44 @@ Struct Definition
***************************************************************************/ ***************************************************************************/
struct SSFDCTYPE struct SSFDCTYPE
{ {
BYTE Model; BYTE Model;
BYTE Attribute; BYTE Attribute;
BYTE MaxZones; BYTE MaxZones;
BYTE MaxSectors; BYTE MaxSectors;
WORD MaxBlocks; WORD MaxBlocks;
WORD MaxLogBlocks; WORD MaxLogBlocks;
}; };
typedef struct SSFDCTYPE_T typedef struct SSFDCTYPE_T
{ {
BYTE Model; BYTE Model;
BYTE Attribute; BYTE Attribute;
BYTE MaxZones; BYTE MaxZones;
BYTE MaxSectors; BYTE MaxSectors;
WORD MaxBlocks; WORD MaxBlocks;
WORD MaxLogBlocks; WORD MaxLogBlocks;
} *SSFDCTYPE_T; } *SSFDCTYPE_T;
struct ADDRESS struct ADDRESS
{ {
BYTE Zone; /* Zone Number */ BYTE Zone; /* Zone Number */
BYTE Sector; /* Sector(512byte) Number on Block */ BYTE Sector; /* Sector(512byte) Number on Block */
WORD PhyBlock; /* Physical Block Number on Zone */ WORD PhyBlock; /* Physical Block Number on Zone */
WORD LogBlock; /* Logical Block Number of Zone */ WORD LogBlock; /* Logical Block Number of Zone */
}; };
typedef struct ADDRESS_T typedef struct ADDRESS_T
{ {
BYTE Zone; /* Zone Number */ BYTE Zone; /* Zone Number */
BYTE Sector; /* Sector(512byte) Number on Block */ BYTE Sector; /* Sector(512byte) Number on Block */
WORD PhyBlock; /* Physical Block Number on Zone */ WORD PhyBlock; /* Physical Block Number on Zone */
WORD LogBlock; /* Logical Block Number of Zone */ WORD LogBlock; /* Logical Block Number of Zone */
}*ADDRESS_T; } *ADDRESS_T;
struct CIS_AREA struct CIS_AREA
{ {
BYTE Sector; /* Sector(512byte) Number on Block */ BYTE Sector; /* Sector(512byte) Number on Block */
WORD PhyBlock; /* Physical Block Number on Zone 0 */ WORD PhyBlock; /* Physical Block Number on Zone 0 */
}; };