提交 0c979148 编写于 作者: J Joe Perches 提交者: Greg Kroah-Hartman

staging:vt6655:srom: Whitespace cleanups

Neatening only.
git diff -w shows no differences.
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 547f1cff
...@@ -78,36 +78,36 @@ ...@@ -78,36 +78,36 @@
*/ */
unsigned char SROMbyReadEmbedded(unsigned long dwIoBase, unsigned char byContntOffset) unsigned char SROMbyReadEmbedded(unsigned long dwIoBase, unsigned char byContntOffset)
{ {
unsigned short wDelay, wNoACK; unsigned short wDelay, wNoACK;
unsigned char byWait; unsigned char byWait;
unsigned char byData; unsigned char byData;
unsigned char byOrg; unsigned char byOrg;
byData = 0xFF; byData = 0xFF;
VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg); VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg);
/* turn off hardware retry for getting NACK */ /* turn off hardware retry for getting NACK */
VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, (byOrg & (~I2MCFG_NORETRY))); VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, (byOrg & (~I2MCFG_NORETRY)));
for (wNoACK = 0; wNoACK < W_MAX_I2CRETRY; wNoACK++) { for (wNoACK = 0; wNoACK < W_MAX_I2CRETRY; wNoACK++) {
VNSvOutPortB(dwIoBase + MAC_REG_I2MTGID, EEP_I2C_DEV_ID); VNSvOutPortB(dwIoBase + MAC_REG_I2MTGID, EEP_I2C_DEV_ID);
VNSvOutPortB(dwIoBase + MAC_REG_I2MTGAD, byContntOffset); VNSvOutPortB(dwIoBase + MAC_REG_I2MTGAD, byContntOffset);
/* issue read command */ /* issue read command */
VNSvOutPortB(dwIoBase + MAC_REG_I2MCSR, I2MCSR_EEMR); VNSvOutPortB(dwIoBase + MAC_REG_I2MCSR, I2MCSR_EEMR);
/* wait DONE be set */ /* wait DONE be set */
for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) { for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) {
VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait); VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait);
if (byWait & (I2MCSR_DONE | I2MCSR_NACK)) if (byWait & (I2MCSR_DONE | I2MCSR_NACK))
break; break;
PCAvDelayByIO(CB_DELAY_LOOP_WAIT); PCAvDelayByIO(CB_DELAY_LOOP_WAIT);
} }
if ((wDelay < W_MAX_TIMEOUT) && if ((wDelay < W_MAX_TIMEOUT) &&
( !(byWait & I2MCSR_NACK))) { (!(byWait & I2MCSR_NACK))) {
break; break;
} }
} }
VNSvInPortB(dwIoBase + MAC_REG_I2MDIPT, &byData); VNSvInPortB(dwIoBase + MAC_REG_I2MDIPT, &byData);
VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg);
return byData; return byData;
} }
...@@ -127,40 +127,40 @@ unsigned char SROMbyReadEmbedded(unsigned long dwIoBase, unsigned char byContntO ...@@ -127,40 +127,40 @@ unsigned char SROMbyReadEmbedded(unsigned long dwIoBase, unsigned char byContntO
*/ */
bool SROMbWriteEmbedded(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byData) bool SROMbWriteEmbedded(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byData)
{ {
unsigned short wDelay, wNoACK; unsigned short wDelay, wNoACK;
unsigned char byWait; unsigned char byWait;
unsigned char byOrg; unsigned char byOrg;
VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg); VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg);
/* turn off hardware retry for getting NACK */ /* turn off hardware retry for getting NACK */
VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, (byOrg & (~I2MCFG_NORETRY))); VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, (byOrg & (~I2MCFG_NORETRY)));
for (wNoACK = 0; wNoACK < W_MAX_I2CRETRY; wNoACK++) { for (wNoACK = 0; wNoACK < W_MAX_I2CRETRY; wNoACK++) {
VNSvOutPortB(dwIoBase + MAC_REG_I2MTGID, EEP_I2C_DEV_ID); VNSvOutPortB(dwIoBase + MAC_REG_I2MTGID, EEP_I2C_DEV_ID);
VNSvOutPortB(dwIoBase + MAC_REG_I2MTGAD, byContntOffset); VNSvOutPortB(dwIoBase + MAC_REG_I2MTGAD, byContntOffset);
VNSvOutPortB(dwIoBase + MAC_REG_I2MDOPT, byData); VNSvOutPortB(dwIoBase + MAC_REG_I2MDOPT, byData);
/* issue write command */ /* issue write command */
VNSvOutPortB(dwIoBase + MAC_REG_I2MCSR, I2MCSR_EEMW); VNSvOutPortB(dwIoBase + MAC_REG_I2MCSR, I2MCSR_EEMW);
/* wait DONE be set */ /* wait DONE be set */
for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) { for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) {
VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait); VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait);
if (byWait & (I2MCSR_DONE | I2MCSR_NACK)) if (byWait & (I2MCSR_DONE | I2MCSR_NACK))
break; break;
PCAvDelayByIO(CB_DELAY_LOOP_WAIT); PCAvDelayByIO(CB_DELAY_LOOP_WAIT);
} }
if ((wDelay < W_MAX_TIMEOUT) && if ((wDelay < W_MAX_TIMEOUT) &&
( !(byWait & I2MCSR_NACK))) { (!(byWait & I2MCSR_NACK))) {
break; break;
} }
} }
if (wNoACK == W_MAX_I2CRETRY) { if (wNoACK == W_MAX_I2CRETRY) {
VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg);
return false; return false;
} }
VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg);
return true; return true;
} }
...@@ -180,10 +180,10 @@ bool SROMbWriteEmbedded(unsigned long dwIoBase, unsigned char byContntOffset, un ...@@ -180,10 +180,10 @@ bool SROMbWriteEmbedded(unsigned long dwIoBase, unsigned char byContntOffset, un
*/ */
void SROMvRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byBits) void SROMvRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byBits)
{ {
unsigned char byOrgData; unsigned char byOrgData;
byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset);
SROMbWriteEmbedded(dwIoBase, byContntOffset,(unsigned char)(byOrgData | byBits)); SROMbWriteEmbedded(dwIoBase, byContntOffset, (unsigned char)(byOrgData | byBits));
} }
...@@ -201,10 +201,10 @@ void SROMvRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsign ...@@ -201,10 +201,10 @@ void SROMvRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsign
*/ */
void SROMvRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byBits) void SROMvRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byBits)
{ {
unsigned char byOrgData; unsigned char byOrgData;
byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset);
SROMbWriteEmbedded(dwIoBase, byContntOffset,(unsigned char)(byOrgData & (~byBits))); SROMbWriteEmbedded(dwIoBase, byContntOffset, (unsigned char)(byOrgData & (~byBits)));
} }
...@@ -224,10 +224,10 @@ void SROMvRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsig ...@@ -224,10 +224,10 @@ void SROMvRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsig
*/ */
bool SROMbIsRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byTestBits) bool SROMbIsRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byTestBits)
{ {
unsigned char byOrgData; unsigned char byOrgData;
byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset);
return (byOrgData & byTestBits) == byTestBits; return (byOrgData & byTestBits) == byTestBits;
} }
...@@ -247,10 +247,10 @@ bool SROMbIsRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsi ...@@ -247,10 +247,10 @@ bool SROMbIsRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsi
*/ */
bool SROMbIsRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byTestBits) bool SROMbIsRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byTestBits)
{ {
unsigned char byOrgData; unsigned char byOrgData;
byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset);
return !(byOrgData & byTestBits); return !(byOrgData & byTestBits);
} }
...@@ -268,13 +268,13 @@ bool SROMbIsRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, uns ...@@ -268,13 +268,13 @@ bool SROMbIsRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, uns
*/ */
void SROMvReadAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs) void SROMvReadAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs)
{ {
int ii; int ii;
/* ii = Rom Address */ /* ii = Rom Address */
for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) { for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) {
*pbyEepromRegs = SROMbyReadEmbedded(dwIoBase,(unsigned char) ii); *pbyEepromRegs = SROMbyReadEmbedded(dwIoBase, (unsigned char)ii);
pbyEepromRegs++; pbyEepromRegs++;
} }
} }
...@@ -293,13 +293,13 @@ void SROMvReadAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs) ...@@ -293,13 +293,13 @@ void SROMvReadAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs)
*/ */
void SROMvWriteAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs) void SROMvWriteAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs)
{ {
int ii; int ii;
/* ii = Rom Address */ /* ii = Rom Address */
for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) { for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) {
SROMbWriteEmbedded(dwIoBase,(unsigned char) ii, *pbyEepromRegs); SROMbWriteEmbedded(dwIoBase, (unsigned char)ii, *pbyEepromRegs);
pbyEepromRegs++; pbyEepromRegs++;
} }
} }
...@@ -317,13 +317,13 @@ void SROMvWriteAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs) ...@@ -317,13 +317,13 @@ void SROMvWriteAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs)
*/ */
void SROMvReadEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddress) void SROMvReadEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddress)
{ {
unsigned char ii; unsigned char ii;
/* ii = Rom Address */ /* ii = Rom Address */
for (ii = 0; ii < ETH_ALEN; ii++) { for (ii = 0; ii < ETH_ALEN; ii++) {
*pbyEtherAddress = SROMbyReadEmbedded(dwIoBase, ii); *pbyEtherAddress = SROMbyReadEmbedded(dwIoBase, ii);
pbyEtherAddress++; pbyEtherAddress++;
} }
} }
...@@ -342,13 +342,13 @@ void SROMvReadEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddres ...@@ -342,13 +342,13 @@ void SROMvReadEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddres
*/ */
void SROMvWriteEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddress) void SROMvWriteEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddress)
{ {
unsigned char ii; unsigned char ii;
/* ii = Rom Address */ /* ii = Rom Address */
for (ii = 0; ii < ETH_ALEN; ii++) { for (ii = 0; ii < ETH_ALEN; ii++) {
SROMbWriteEmbedded(dwIoBase, ii, *pbyEtherAddress); SROMbWriteEmbedded(dwIoBase, ii, *pbyEtherAddress);
pbyEtherAddress++; pbyEtherAddress++;
} }
} }
...@@ -366,15 +366,15 @@ void SROMvWriteEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddre ...@@ -366,15 +366,15 @@ void SROMvWriteEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddre
*/ */
void SROMvReadSubSysVenId(unsigned long dwIoBase, unsigned long *pdwSubSysVenId) void SROMvReadSubSysVenId(unsigned long dwIoBase, unsigned long *pdwSubSysVenId)
{ {
unsigned char *pbyData; unsigned char *pbyData;
pbyData = (unsigned char *)pdwSubSysVenId; pbyData = (unsigned char *)pdwSubSysVenId;
/* sub vendor */ /* sub vendor */
*pbyData = SROMbyReadEmbedded(dwIoBase, 6); *pbyData = SROMbyReadEmbedded(dwIoBase, 6);
*(pbyData+1) = SROMbyReadEmbedded(dwIoBase, 7); *(pbyData+1) = SROMbyReadEmbedded(dwIoBase, 7);
/* sub system */ /* sub system */
*(pbyData+2) = SROMbyReadEmbedded(dwIoBase, 8); *(pbyData+2) = SROMbyReadEmbedded(dwIoBase, 8);
*(pbyData+3) = SROMbyReadEmbedded(dwIoBase, 9); *(pbyData+3) = SROMbyReadEmbedded(dwIoBase, 9);
} }
/* /*
...@@ -391,30 +391,30 @@ void SROMvReadSubSysVenId(unsigned long dwIoBase, unsigned long *pdwSubSysVenId) ...@@ -391,30 +391,30 @@ void SROMvReadSubSysVenId(unsigned long dwIoBase, unsigned long *pdwSubSysVenId)
*/ */
bool SROMbAutoLoad(unsigned long dwIoBase) bool SROMbAutoLoad(unsigned long dwIoBase)
{ {
unsigned char byWait; unsigned char byWait;
int ii; int ii;
unsigned char byOrg; unsigned char byOrg;
VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg); VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg);
/* turn on hardware retry */ /* turn on hardware retry */
VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, (byOrg | I2MCFG_NORETRY)); VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, (byOrg | I2MCFG_NORETRY));
MACvRegBitsOn(dwIoBase, MAC_REG_I2MCSR, I2MCSR_AUTOLD); MACvRegBitsOn(dwIoBase, MAC_REG_I2MCSR, I2MCSR_AUTOLD);
/* ii = Rom Address */ /* ii = Rom Address */
for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) { for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) {
MACvTimer0MicroSDelay(dwIoBase, CB_EEPROM_READBYTE_WAIT); MACvTimer0MicroSDelay(dwIoBase, CB_EEPROM_READBYTE_WAIT);
VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait); VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait);
if ( !(byWait & I2MCSR_AUTOLD)) if (!(byWait & I2MCSR_AUTOLD))
break; break;
} }
VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg);
if (ii == EEP_MAX_CONTEXT_SIZE) if (ii == EEP_MAX_CONTEXT_SIZE)
return false; return false;
return true; return true;
} }
...@@ -97,34 +97,34 @@ ...@@ -97,34 +97,34 @@
// 2048 bits = 256 bytes = 128 words // 2048 bits = 256 bytes = 128 words
// //
typedef struct tagSSromReg { typedef struct tagSSromReg {
unsigned char abyPAR[6]; // 0x00 (unsigned short) unsigned char abyPAR[6]; // 0x00 (unsigned short)
unsigned short wSUB_VID; // 0x03 (unsigned short) unsigned short wSUB_VID; // 0x03 (unsigned short)
unsigned short wSUB_SID; unsigned short wSUB_SID;
unsigned char byBCFG0; // 0x05 (unsigned short) unsigned char byBCFG0; // 0x05 (unsigned short)
unsigned char byBCFG1; unsigned char byBCFG1;
unsigned char byFCR0; // 0x06 (unsigned short) unsigned char byFCR0; // 0x06 (unsigned short)
unsigned char byFCR1; unsigned char byFCR1;
unsigned char byPMC0; // 0x07 (unsigned short) unsigned char byPMC0; // 0x07 (unsigned short)
unsigned char byPMC1; unsigned char byPMC1;
unsigned char byMAXLAT; // 0x08 (unsigned short) unsigned char byMAXLAT; // 0x08 (unsigned short)
unsigned char byMINGNT; unsigned char byMINGNT;
unsigned char byCFG0; // 0x09 (unsigned short) unsigned char byCFG0; // 0x09 (unsigned short)
unsigned char byCFG1; unsigned char byCFG1;
unsigned short wCISPTR; // 0x0A (unsigned short) unsigned short wCISPTR; // 0x0A (unsigned short)
unsigned short wRsv0; // 0x0B (unsigned short) unsigned short wRsv0; // 0x0B (unsigned short)
unsigned short wRsv1; // 0x0C (unsigned short) unsigned short wRsv1; // 0x0C (unsigned short)
unsigned char byBBPAIR; // 0x0D (unsigned short) unsigned char byBBPAIR; // 0x0D (unsigned short)
unsigned char byRFTYPE; unsigned char byRFTYPE;
unsigned char byMinChannel; // 0x0E (unsigned short) unsigned char byMinChannel; // 0x0E (unsigned short)
unsigned char byMaxChannel; unsigned char byMaxChannel;
unsigned char bySignature; // 0x0F (unsigned short) unsigned char bySignature; // 0x0F (unsigned short)
unsigned char byCheckSum; unsigned char byCheckSum;
unsigned char abyReserved0[96]; // 0x10 (unsigned short) unsigned char abyReserved0[96]; // 0x10 (unsigned short)
unsigned char abyCIS[128]; // 0x80 (unsigned short) unsigned char abyCIS[128]; // 0x80 (unsigned short)
} SSromReg, *PSSromReg; } SSromReg, *PSSromReg;
/*--------------------- Export Macros ------------------------------*/ /*--------------------- Export Macros ------------------------------*/
...@@ -152,6 +152,6 @@ void SROMvWriteEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddre ...@@ -152,6 +152,6 @@ void SROMvWriteEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddre
void SROMvReadSubSysVenId(unsigned long dwIoBase, unsigned long *pdwSubSysVenId); void SROMvReadSubSysVenId(unsigned long dwIoBase, unsigned long *pdwSubSysVenId);
bool SROMbAutoLoad (unsigned long dwIoBase); bool SROMbAutoLoad(unsigned long dwIoBase);
#endif // __EEPROM_H__ #endif // __EEPROM_H__
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册