Commit bc5cf656 authored by Guido Martínez's avatar Guido Martínez Committed by Greg Kroah-Hartman

staging: vt6655: fix checkpatch bracing issues

This patchs fixes tons of warnings such as:

  WARNING: braces {} are not necessary for single statement blocks
  #354: FILE: drivers/staging/vt6655/wmgr.c:354:
  +       for (ii = 0; ii < WLAN_BSSID_LEN; ii++) {
  +               pMgmt->abyDesireBSSID[ii] = 0xFF;
  +       }

Please note: this patch only fixes bracing issues (and there is still a
lot to do); so if you run checkpatch it _will_ throw a lot of errors.
Use --test-only=braces
Signed-off-by: default avatarGuido Martínez <guido@vanguardiasur.com.ar>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4e8a7e5f
...@@ -1784,29 +1784,27 @@ BBuGetFrameTime( ...@@ -1784,29 +1784,27 @@ BBuGetFrameTime(
uRate = (unsigned int)awcFrameTime[uRateIdx]; uRate = (unsigned int)awcFrameTime[uRateIdx];
if (uRateIdx <= 3) { //CCK mode if (uRateIdx <= 3) { //CCK mode
if (byPreambleType == 1) //Short
if (byPreambleType == 1) {//Short
uPreamble = 96; uPreamble = 96;
} else { else
uPreamble = 192; uPreamble = 192;
}
uFrameTime = (cbFrameLength * 80) / uRate; //????? uFrameTime = (cbFrameLength * 80) / uRate; //?????
uTmp = (uFrameTime * uRate) / 80; uTmp = (uFrameTime * uRate) / 80;
if (cbFrameLength != uTmp) { if (cbFrameLength != uTmp)
uFrameTime++; uFrameTime++;
}
return uPreamble + uFrameTime; return uPreamble + uFrameTime;
} else { } else {
uFrameTime = (cbFrameLength * 8 + 22) / uRate; //???????? uFrameTime = (cbFrameLength * 8 + 22) / uRate; //????????
uTmp = ((uFrameTime * uRate) - 22) / 8; uTmp = ((uFrameTime * uRate) - 22) / 8;
if (cbFrameLength != uTmp) { if (cbFrameLength != uTmp)
uFrameTime++; uFrameTime++;
}
uFrameTime = uFrameTime * 4; //??????? uFrameTime = uFrameTime * 4; //???????
if (byPktType != PK_TYPE_11A) { if (byPktType != PK_TYPE_11A)
uFrameTime += 6; //?????? uFrameTime += 6; //??????
}
return 20 + uFrameTime; //?????? return 20 + uFrameTime; //??????
} }
} }
...@@ -2127,16 +2125,16 @@ bool BBbVT3253Init(PSDevice pDevice) ...@@ -2127,16 +2125,16 @@ bool BBbVT3253Init(PSDevice pDevice)
if (byRFType == RF_RFMD2959) { if (byRFType == RF_RFMD2959) {
if (byLocalID <= REV_ID_VT3253_A1) { if (byLocalID <= REV_ID_VT3253_A1) {
for (ii = 0; ii < CB_VT3253_INIT_FOR_RFMD; ii++) { for (ii = 0; ii < CB_VT3253_INIT_FOR_RFMD; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253InitTab_RFMD[ii][0], byVT3253InitTab_RFMD[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253InitTab_RFMD[ii][0], byVT3253InitTab_RFMD[ii][1]);
}
} else { } else {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_RFMD; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_RFMD; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_RFMD[ii][0], byVT3253B0_RFMD[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_RFMD[ii][0], byVT3253B0_RFMD[ii][1]);
}
for (ii = 0; ii < CB_VT3253B0_AGC_FOR_RFMD2959; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC_FOR_RFMD2959; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC4_RFMD2959[ii][0], byVT3253B0_AGC4_RFMD2959[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC4_RFMD2959[ii][0], byVT3253B0_AGC4_RFMD2959[ii][1]);
}
VNSvOutPortD(dwIoBase + MAC_REG_ITRTMSET, 0x23); VNSvOutPortD(dwIoBase + MAC_REG_ITRTMSET, 0x23);
MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0); MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0);
} }
...@@ -2149,12 +2147,12 @@ bool BBbVT3253Init(PSDevice pDevice) ...@@ -2149,12 +2147,12 @@ bool BBbVT3253Init(PSDevice pDevice)
pDevice->ldBmThreshold[2] = 0; pDevice->ldBmThreshold[2] = 0;
pDevice->ldBmThreshold[3] = 0; pDevice->ldBmThreshold[3] = 0;
} else if ((byRFType == RF_AIROHA) || (byRFType == RF_AL2230S)) { } else if ((byRFType == RF_AIROHA) || (byRFType == RF_AL2230S)) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]);
}
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
}
pDevice->abyBBVGA[0] = 0x1C; pDevice->abyBBVGA[0] = 0x1C;
pDevice->abyBBVGA[1] = 0x10; pDevice->abyBBVGA[1] = 0x10;
pDevice->abyBBVGA[2] = 0x0; pDevice->abyBBVGA[2] = 0x0;
...@@ -2164,12 +2162,12 @@ bool BBbVT3253Init(PSDevice pDevice) ...@@ -2164,12 +2162,12 @@ bool BBbVT3253Init(PSDevice pDevice)
pDevice->ldBmThreshold[2] = 0; pDevice->ldBmThreshold[2] = 0;
pDevice->ldBmThreshold[3] = 0; pDevice->ldBmThreshold[3] = 0;
} else if (byRFType == RF_UW2451) { } else if (byRFType == RF_UW2451) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_UW2451[ii][0], byVT3253B0_UW2451[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_UW2451[ii][0], byVT3253B0_UW2451[ii][1]);
}
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
}
VNSvOutPortB(dwIoBase + MAC_REG_ITRTMSET, 0x23); VNSvOutPortB(dwIoBase + MAC_REG_ITRTMSET, 0x23);
MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0); MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0);
...@@ -2182,9 +2180,9 @@ bool BBbVT3253Init(PSDevice pDevice) ...@@ -2182,9 +2180,9 @@ bool BBbVT3253Init(PSDevice pDevice)
pDevice->ldBmThreshold[2] = 0; pDevice->ldBmThreshold[2] = 0;
pDevice->ldBmThreshold[3] = 0; pDevice->ldBmThreshold[3] = 0;
} else if (byRFType == RF_UW2452) { } else if (byRFType == RF_UW2452) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_UW2451[ii][0], byVT3253B0_UW2451[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_UW2451[ii][0], byVT3253B0_UW2451[ii][1]);
}
// Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted) // Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
//bResult &= BBbWriteEmbedded(dwIoBase,0x09,0x41); //bResult &= BBbWriteEmbedded(dwIoBase,0x09,0x41);
// Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) // Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted)
...@@ -2203,9 +2201,8 @@ bool BBbVT3253Init(PSDevice pDevice) ...@@ -2203,9 +2201,8 @@ bool BBbVT3253Init(PSDevice pDevice)
//}} //}}
bResult &= BBbWriteEmbedded(dwIoBase, 0xb0, 0x58); bResult &= BBbWriteEmbedded(dwIoBase, 0xb0, 0x58);
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
}
pDevice->abyBBVGA[0] = 0x14; pDevice->abyBBVGA[0] = 0x14;
pDevice->abyBBVGA[1] = 0x0A; pDevice->abyBBVGA[1] = 0x0A;
...@@ -2218,12 +2215,12 @@ bool BBbVT3253Init(PSDevice pDevice) ...@@ -2218,12 +2215,12 @@ bool BBbVT3253Init(PSDevice pDevice)
//}} RobertYu //}} RobertYu
} else if (byRFType == RF_VT3226) { } else if (byRFType == RF_VT3226) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]);
}
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
}
pDevice->abyBBVGA[0] = 0x1C; pDevice->abyBBVGA[0] = 0x1C;
pDevice->abyBBVGA[1] = 0x10; pDevice->abyBBVGA[1] = 0x10;
pDevice->abyBBVGA[2] = 0x0; pDevice->abyBBVGA[2] = 0x0;
...@@ -2236,9 +2233,9 @@ bool BBbVT3253Init(PSDevice pDevice) ...@@ -2236,9 +2233,9 @@ bool BBbVT3253Init(PSDevice pDevice)
MACvSetRFLE_LatchBase(dwIoBase); MACvSetRFLE_LatchBase(dwIoBase);
//{{ RobertYu: 20050104 //{{ RobertYu: 20050104
} else if (byRFType == RF_AIROHA7230) { } else if (byRFType == RF_AIROHA7230) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]);
}
//{{ RobertYu:20050223, request by JerryChung //{{ RobertYu:20050223, request by JerryChung
// Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted) // Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
...@@ -2249,9 +2246,9 @@ bool BBbVT3253Init(PSDevice pDevice) ...@@ -2249,9 +2246,9 @@ bool BBbVT3253Init(PSDevice pDevice)
bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06); bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06);
//}} //}}
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
}
pDevice->abyBBVGA[0] = 0x1C; pDevice->abyBBVGA[0] = 0x1C;
pDevice->abyBBVGA[1] = 0x10; pDevice->abyBBVGA[1] = 0x10;
pDevice->abyBBVGA[2] = 0x0; pDevice->abyBBVGA[2] = 0x0;
...@@ -2407,17 +2404,15 @@ BBvSetShortSlotTime(PSDevice pDevice) ...@@ -2407,17 +2404,15 @@ BBvSetShortSlotTime(PSDevice pDevice)
BBbReadEmbedded(pDevice->PortOffset, 0x0A, &byBBRxConf);//CR10 BBbReadEmbedded(pDevice->PortOffset, 0x0A, &byBBRxConf);//CR10
if (pDevice->bShortSlotTime) { if (pDevice->bShortSlotTime)
byBBRxConf &= 0xDF;//1101 1111 byBBRxConf &= 0xDF;//1101 1111
} else { else
byBBRxConf |= 0x20;//0010 0000 byBBRxConf |= 0x20;//0010 0000
}
// patch for 3253B0 Baseband with Cardbus module // patch for 3253B0 Baseband with Cardbus module
BBbReadEmbedded(pDevice->PortOffset, 0xE7, &byBBVGA); BBbReadEmbedded(pDevice->PortOffset, 0xE7, &byBBVGA);
if (byBBVGA == pDevice->abyBBVGA[0]) { if (byBBVGA == pDevice->abyBBVGA[0])
byBBRxConf |= 0x20;//0010 0000 byBBRxConf |= 0x20;//0010 0000
}
BBbWriteEmbedded(pDevice->PortOffset, 0x0A, byBBRxConf);//CR10 BBbWriteEmbedded(pDevice->PortOffset, 0x0A, byBBRxConf);//CR10
} }
...@@ -2698,9 +2693,8 @@ BBvClearAntDivSQ3Value(PSDevice pDevice) ...@@ -2698,9 +2693,8 @@ BBvClearAntDivSQ3Value(PSDevice pDevice)
unsigned int ii; unsigned int ii;
pDevice->uDiversityCnt = 0; pDevice->uDiversityCnt = 0;
for (ii = 0; ii < MAX_RATE; ii++) { for (ii = 0; ii < MAX_RATE; ii++)
pDevice->uNumSQ3[ii] = 0; pDevice->uNumSQ3[ii] = 0;
}
} }
/* /*
...@@ -2721,9 +2715,9 @@ BBvClearAntDivSQ3Value(PSDevice pDevice) ...@@ -2721,9 +2715,9 @@ BBvClearAntDivSQ3Value(PSDevice pDevice)
void void
BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3) BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3)
{ {
if ((byRxRate >= MAX_RATE) || (pDevice->wAntDiversityMaxRate >= MAX_RATE)) { if ((byRxRate >= MAX_RATE) || (pDevice->wAntDiversityMaxRate >= MAX_RATE))
return; return;
}
pDevice->uDiversityCnt++; pDevice->uDiversityCnt++;
pDevice->uNumSQ3[byRxRate]++; pDevice->uNumSQ3[byRxRate]++;
......
...@@ -497,9 +497,8 @@ BSSbInsertToBSSList( ...@@ -497,9 +497,8 @@ BSSbInsertToBSSList(
} }
} }
if (bParsingQuiet && (pQuiet != NULL)) { if (bParsingQuiet && (pQuiet != NULL))
CARDbStartQuiet(pMgmt->pAdapter); CARDbStartQuiet(pMgmt->pAdapter);
}
pBSSList->uIELength = uIELength; pBSSList->uIELength = uIELength;
if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN) if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN)
...@@ -662,9 +661,8 @@ BSSbUpdateToBSSList( ...@@ -662,9 +661,8 @@ BSSbUpdateToBSSList(
} }
} }
if (bParsingQuiet && (pQuiet != NULL)) { if (bParsingQuiet && (pQuiet != NULL))
CARDbStartQuiet(pMgmt->pAdapter); CARDbStartQuiet(pMgmt->pAdapter);
}
pBSSList->uIELength = uIELength; pBSSList->uIELength = uIELength;
if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN) if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN)
......
This diff is collapsed.
...@@ -420,9 +420,8 @@ void init_channel_table(void *pDeviceHandler) ...@@ -420,9 +420,8 @@ void init_channel_table(void *pDeviceHandler)
bool bMultiBand = false; bool bMultiBand = false;
unsigned int ii; unsigned int ii;
for (ii = 1; ii <= CARD_MAX_CHANNEL_TBL; ii++) { for (ii = 1; ii <= CARD_MAX_CHANNEL_TBL; ii++)
sChannelTbl[ii].bValid = false; sChannelTbl[ii].bValid = false;
}
switch (pDevice->byRFType) { switch (pDevice->byRFType) {
case RF_RFMD2959: case RF_RFMD2959:
...@@ -525,13 +524,11 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel) ...@@ -525,13 +524,11 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
PSDevice pDevice = (PSDevice) pDeviceHandler; PSDevice pDevice = (PSDevice) pDeviceHandler;
bool bResult = true; bool bResult = true;
if (pDevice->byCurrentCh == uConnectionChannel) { if (pDevice->byCurrentCh == uConnectionChannel)
return bResult; return bResult;
}
if (!sChannelTbl[uConnectionChannel].bValid) { if (!sChannelTbl[uConnectionChannel].bValid)
return false; return false;
}
if ((uConnectionChannel > CB_MAX_CHANNEL_24G) && if ((uConnectionChannel > CB_MAX_CHANNEL_24G) &&
(pDevice->eCurrentPHYType != PHY_TYPE_11A)) { (pDevice->eCurrentPHYType != PHY_TYPE_11A)) {
...@@ -546,9 +543,8 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel) ...@@ -546,9 +543,8 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
//{{ RobertYu: 20041202 //{{ RobertYu: 20041202
//// TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX throughput //// TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX throughput
if (pDevice->byRFType == RF_AIROHA7230) { if (pDevice->byRFType == RF_AIROHA7230)
RFbAL7230SelectChannelPostProcess(pDevice->PortOffset, pDevice->byCurrentCh, (unsigned char)uConnectionChannel); RFbAL7230SelectChannelPostProcess(pDevice->PortOffset, pDevice->byCurrentCh, (unsigned char)uConnectionChannel);
}
//}} RobertYu //}} RobertYu
pDevice->byCurrentCh = (unsigned char)uConnectionChannel; pDevice->byCurrentCh = (unsigned char)uConnectionChannel;
...@@ -570,11 +566,10 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel) ...@@ -570,11 +566,10 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
MACvSelectPage0(pDevice->PortOffset); MACvSelectPage0(pDevice->PortOffset);
} }
if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { if (pDevice->eCurrentPHYType == PHY_TYPE_11B)
RFbSetPower(pDevice, RATE_1M, pDevice->byCurrentCh); RFbSetPower(pDevice, RATE_1M, pDevice->byCurrentCh);
} else { else
RFbSetPower(pDevice, RATE_6M, pDevice->byCurrentCh); RFbSetPower(pDevice, RATE_6M, pDevice->byCurrentCh);
}
return bResult; return bResult;
} }
...@@ -601,15 +596,15 @@ void set_country_info(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, void *pIE) ...@@ -601,15 +596,15 @@ void set_country_info(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, void *pIE)
if (ePHYType == PHY_TYPE_11A) { if (ePHYType == PHY_TYPE_11A) {
pDevice->bCountryInfo5G = true; pDevice->bCountryInfo5G = true;
for (ii = CB_MAX_CHANNEL_24G + 1; ii <= CARD_MAX_CHANNEL_TBL; ii++) { for (ii = CB_MAX_CHANNEL_24G + 1; ii <= CARD_MAX_CHANNEL_TBL; ii++)
sChannelTbl[ii].bValid = false; sChannelTbl[ii].bValid = false;
}
step = 4; step = 4;
} else { } else {
pDevice->bCountryInfo24G = true; pDevice->bCountryInfo24G = true;
for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) { for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++)
sChannelTbl[ii].bValid = false; sChannelTbl[ii].bValid = false;
}
step = 1; step = 1;
} }
pDevice->abyCountryCode[0] = pIE_Country->abyCountryString[0]; pDevice->abyCountryCode[0] = pIE_Country->abyCountryString[0];
...@@ -652,19 +647,19 @@ unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs) ...@@ -652,19 +647,19 @@ unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs)
byCount = 0; byCount = 0;
if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[28] == true) { if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[28] == true) {
for (ii = 28; ii < 36; ii += 2) { for (ii = 28; ii < 36; ii += 2) {
if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true)
byCount++; byCount++;
} }
}
*pbyChTupple++ = 34; *pbyChTupple++ = 34;
*pbyChTupple++ = byCount; *pbyChTupple++ = byCount;
byLen += 2; byLen += 2;
} else if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[29] == true) { } else if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[29] == true) {
for (ii = 29; ii < 36; ii += 2) { for (ii = 29; ii < 36; ii += 2) {
if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true)
byCount++; byCount++;
} }
}
*pbyChTupple++ = 36; *pbyChTupple++ = 36;
*pbyChTupple++ = byCount; *pbyChTupple++ = byCount;
byLen += 2; byLen += 2;
...@@ -673,10 +668,10 @@ unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs) ...@@ -673,10 +668,10 @@ unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs)
byCount = 0; byCount = 0;
if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[36] == true) { if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[36] == true) {
for (ii = 36; ii < 40; ii++) { for (ii = 36; ii < 40; ii++) {
if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true)
byCount++; byCount++;
} }
}
*pbyChTupple++ = 52; *pbyChTupple++ = 52;
*pbyChTupple++ = byCount; *pbyChTupple++ = byCount;
byLen += 2; byLen += 2;
...@@ -685,19 +680,19 @@ unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs) ...@@ -685,19 +680,19 @@ unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs)
byCount = 0; byCount = 0;
if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[40] == true) { if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[40] == true) {
for (ii = 40; ii < 51; ii++) { for (ii = 40; ii < 51; ii++) {
if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true)
byCount++; byCount++;
} }
}
*pbyChTupple++ = 100; *pbyChTupple++ = 100;
*pbyChTupple++ = byCount; *pbyChTupple++ = byCount;
byLen += 2; byLen += 2;
} else if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[51] == true) { } else if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[51] == true) {
for (ii = 51; ii < 56; ii++) { for (ii = 51; ii < 56; ii++) {
if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true)
byCount++; byCount++;
} }
}
*pbyChTupple++ = 149; *pbyChTupple++ = 149;
*pbyChTupple++ = byCount; *pbyChTupple++ = byCount;
byLen += 2; byLen += 2;
...@@ -764,16 +759,15 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType) ...@@ -764,16 +759,15 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
if (ePHYType == PHY_TYPE_11A) { if (ePHYType == PHY_TYPE_11A) {
for (ii = CB_MAX_CHANNEL_24G + 1; ii <= CB_MAX_CHANNEL; ii++) { for (ii = CB_MAX_CHANNEL_24G + 1; ii <= CB_MAX_CHANNEL; ii++) {
if (sChannelTbl[ii].bValid) { if (sChannelTbl[ii].bValid) {
if (byOptionChannel == 0) { if (byOptionChannel == 0)
byOptionChannel = (unsigned char) ii; byOptionChannel = (unsigned char) ii;
}
if (sChannelTbl[ii].byMAP == 0) { if (sChannelTbl[ii].byMAP == 0)
return (unsigned char) ii; return (unsigned char) ii;
} else if (!(sChannelTbl[ii].byMAP & 0x08)) { else if (!(sChannelTbl[ii].byMAP & 0x08))
byOptionChannel = (unsigned char) ii; byOptionChannel = (unsigned char) ii;
} }
} }
}
} else { } else {
byOptionChannel = 0; byOptionChannel = 0;
for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) { for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) {
...@@ -781,28 +775,27 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType) ...@@ -781,28 +775,27 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
if (sChannelTbl[ii].byMAP == 0) { if (sChannelTbl[ii].byMAP == 0) {
aiWeight[ii] += 100; aiWeight[ii] += 100;
} else if (sChannelTbl[ii].byMAP & 0x01) { } else if (sChannelTbl[ii].byMAP & 0x01) {
if (ii > 3) { if (ii > 3)
aiWeight[ii - 3] -= 10; aiWeight[ii - 3] -= 10;
}
if (ii > 2) { if (ii > 2)
aiWeight[ii - 2] -= 20; aiWeight[ii - 2] -= 20;
}
if (ii > 1) { if (ii > 1)
aiWeight[ii - 1] -= 40; aiWeight[ii - 1] -= 40;
}
aiWeight[ii] -= 80; aiWeight[ii] -= 80;
if (ii < CB_MAX_CHANNEL_24G) { if (ii < CB_MAX_CHANNEL_24G)
aiWeight[ii + 1] -= 40; aiWeight[ii + 1] -= 40;
}
if (ii < (CB_MAX_CHANNEL_24G - 1)) { if (ii < (CB_MAX_CHANNEL_24G - 1))
aiWeight[ii+2] -= 20; aiWeight[ii+2] -= 20;
}
if (ii < (CB_MAX_CHANNEL_24G - 2)) { if (ii < (CB_MAX_CHANNEL_24G - 2))
aiWeight[ii+3] -= 10; aiWeight[ii+3] -= 10;
} }
} }
} }
}
for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) { for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) {
if (sChannelTbl[ii].bValid && if (sChannelTbl[ii].bValid &&
(aiWeight[ii] > aiWeight[byOptionChannel])) { (aiWeight[ii] > aiWeight[byOptionChannel])) {
......
...@@ -253,9 +253,8 @@ RATEvParseMaxRate( ...@@ -253,9 +253,8 @@ RATEvParseMaxRate(
} }
} }
if ((pDevice->byPacketType == PK_TYPE_11GB) && CARDbIsOFDMinBasicRate((void *)pDevice)) { if ((pDevice->byPacketType == PK_TYPE_11GB) && CARDbIsOFDMinBasicRate((void *)pDevice))
pDevice->byPacketType = PK_TYPE_11GA; pDevice->byPacketType = PK_TYPE_11GA;
}
*pbyTopCCKRate = pDevice->byTopCCKBasicRate; *pbyTopCCKRate = pDevice->byTopCCKBasicRate;
*pbyTopOFDMRate = pDevice->byTopOFDMBasicRate; *pbyTopOFDMRate = pDevice->byTopOFDMBasicRate;
...@@ -319,15 +318,14 @@ RATEvTxRateFallBack( ...@@ -319,15 +318,14 @@ RATEvTxRateFallBack(
return; return;
} }
if (psNodeDBTable->uTimeCount >= AUTORATE_TIMEOUT) { if (psNodeDBTable->uTimeCount >= AUTORATE_TIMEOUT)
psNodeDBTable->uTimeCount = 0; psNodeDBTable->uTimeCount = 0;
}
for (ii = 0; ii < MAX_RATE; ii++) { for (ii = 0; ii < MAX_RATE; ii++) {
if (psNodeDBTable->wSuppRate & (0x0001<<ii)) { if (psNodeDBTable->wSuppRate & (0x0001<<ii)) {
if (bAutoRate[ii]) { if (bAutoRate[ii])
wIdxUpRate = (unsigned short) ii; wIdxUpRate = (unsigned short) ii;
}
} else { } else {
bAutoRate[ii] = false; bAutoRate[ii] = false;
} }
...@@ -337,9 +335,9 @@ RATEvTxRateFallBack( ...@@ -337,9 +335,9 @@ RATEvTxRateFallBack(
if ((psNodeDBTable->uTxOk[ii] != 0) || if ((psNodeDBTable->uTxOk[ii] != 0) ||
(psNodeDBTable->uTxFail[ii] != 0)) { (psNodeDBTable->uTxFail[ii] != 0)) {
dwThroughputTbl[ii] *= psNodeDBTable->uTxOk[ii]; dwThroughputTbl[ii] *= psNodeDBTable->uTxOk[ii];
if (ii < RATE_11M) { if (ii < RATE_11M)
psNodeDBTable->uTxFail[ii] *= 4; psNodeDBTable->uTxFail[ii] *= 4;
}
dwThroughputTbl[ii] /= (psNodeDBTable->uTxOk[ii] + psNodeDBTable->uTxFail[ii]); dwThroughputTbl[ii] /= (psNodeDBTable->uTxOk[ii] + psNodeDBTable->uTxFail[ii]);
} }
} }
......
This diff is collapsed.
...@@ -181,11 +181,11 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr, ...@@ -181,11 +181,11 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr,
cbHeaderSize -= 8; cbHeaderSize -= 8;
pwType = (unsigned short *)(pbyRxBufferAddr + cbHeaderSize); pwType = (unsigned short *)(pbyRxBufferAddr + cbHeaderSize);
if (bIsWEP) { if (bIsWEP) {
if (bExtIV) { if (bExtIV)
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 8); // 8 is IV&ExtIV *pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 8); // 8 is IV&ExtIV
} else { else
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 4); // 4 is IV *pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 4); // 4 is IV
}
} else { } else {
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN); *pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN);
} }
...@@ -194,11 +194,11 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr, ...@@ -194,11 +194,11 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr,
cbHeaderSize -= 2; cbHeaderSize -= 2;
pwType = (unsigned short *)(pbyRxBufferAddr + cbHeaderSize); pwType = (unsigned short *)(pbyRxBufferAddr + cbHeaderSize);
if (bIsWEP) { if (bIsWEP) {
if (bExtIV) { if (bExtIV)
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 8); // 8 is IV&ExtIV *pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 8); // 8 is IV&ExtIV
} else { else
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 4); // 4 is IV *pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 4); // 4 is IV
}
} else { } else {
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN); *pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN);
} }
...@@ -222,6 +222,7 @@ static unsigned char s_byGetRateIdx(unsigned char byRate) ...@@ -222,6 +222,7 @@ static unsigned char s_byGetRateIdx(unsigned char byRate)
if (acbyRxRate[byRateIdx % MAX_RATE] == byRate) if (acbyRxRate[byRateIdx % MAX_RATE] == byRate)
return byRateIdx; return byRateIdx;
} }
return 0; return 0;
} }
...@@ -372,9 +373,9 @@ device_receive_frame( ...@@ -372,9 +373,9 @@ device_receive_frame(
pMACHeader = (PS802_11Header)((unsigned char *)(skb->data) + 8); pMACHeader = (PS802_11Header)((unsigned char *)(skb->data) + 8);
//PLICE_DEBUG<- //PLICE_DEBUG<-
if (pDevice->bMeasureInProgress) { if (pDevice->bMeasureInProgress) {
if ((*pbyRsr & RSR_CRCOK) != 0) { if ((*pbyRsr & RSR_CRCOK) != 0)
pDevice->byBasicMap |= 0x01; pDevice->byBasicMap |= 0x01;
}
dwDuration = (FrameSize << 4); dwDuration = (FrameSize << 4);
dwDuration /= acbyRxRate[*pbyRxRate%MAX_RATE]; dwDuration /= acbyRxRate[*pbyRxRate%MAX_RATE];
if (*pbyRxRate <= RATE_11M) { if (*pbyRxRate <= RATE_11M) {
...@@ -391,9 +392,9 @@ device_receive_frame( ...@@ -391,9 +392,9 @@ device_receive_frame(
RFvRSSITodBm(pDevice, *pbyRSSI, &ldBm); RFvRSSITodBm(pDevice, *pbyRSSI, &ldBm);
ldBmThreshold = -57; ldBmThreshold = -57;
for (ii = 7; ii > 0;) { for (ii = 7; ii > 0;) {
if (ldBm > ldBmThreshold) { if (ldBm > ldBmThreshold)
break; break;
}
ldBmThreshold -= 5; ldBmThreshold -= 5;
ii--; ii--;
} }
...@@ -428,10 +429,9 @@ device_receive_frame( ...@@ -428,10 +429,9 @@ device_receive_frame(
} }
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
if (s_bAPModeRxCtl(pDevice, pbyFrame, iSANodeIndex)) { if (s_bAPModeRxCtl(pDevice, pbyFrame, iSANodeIndex))
return false; return false;
} }
}
if (IS_FC_WEP(pbyFrame)) { if (IS_FC_WEP(pbyFrame)) {
bool bRxDecryOK = false; bool bRxDecryOK = false;
...@@ -480,12 +480,11 @@ device_receive_frame( ...@@ -480,12 +480,11 @@ device_receive_frame(
(pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) || (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) ||
(pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPA2) ||
(pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) { (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) {
if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) { if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP))
pDevice->s802_11Counter.TKIPICVErrors++; pDevice->s802_11Counter.TKIPICVErrors++;
} else if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_CCMP)) { else if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_CCMP))
pDevice->s802_11Counter.CCMPDecryptErrors++; pDevice->s802_11Counter.CCMPDecryptErrors++;
} }
}
return false; return false;
} }
} else { } else {
...@@ -639,9 +638,9 @@ device_receive_frame( ...@@ -639,9 +638,9 @@ device_receive_frame(
BBvAntennaDiversity(pDevice, s_byGetRateIdx(*pbyRxRate), 0); BBvAntennaDiversity(pDevice, s_byGetRateIdx(*pbyRxRate), 0);
} }
if (pDevice->byLocalID != REV_ID_VT3253_B1) { if (pDevice->byLocalID != REV_ID_VT3253_B1)
pDevice->uCurrRSSI = *pbyRSSI; pDevice->uCurrRSSI = *pbyRSSI;
}
pDevice->byCurrSQ = *pbySQ; pDevice->byCurrSQ = *pbySQ;
if ((*pbyRSSI != 0) && if ((*pbyRSSI != 0) &&
...@@ -651,11 +650,10 @@ device_receive_frame( ...@@ -651,11 +650,10 @@ device_receive_frame(
pMgmt->pCurrBSS->byRSSIStatCnt++; pMgmt->pCurrBSS->byRSSIStatCnt++;
pMgmt->pCurrBSS->byRSSIStatCnt %= RSSI_STAT_COUNT; pMgmt->pCurrBSS->byRSSIStatCnt %= RSSI_STAT_COUNT;
pMgmt->pCurrBSS->ldBmAverage[pMgmt->pCurrBSS->byRSSIStatCnt] = ldBm; pMgmt->pCurrBSS->ldBmAverage[pMgmt->pCurrBSS->byRSSIStatCnt] = ldBm;
for (ii = 0; ii < RSSI_STAT_COUNT; ii++) { for (ii = 0; ii < RSSI_STAT_COUNT; ii++)
if (pMgmt->pCurrBSS->ldBmAverage[ii] != 0) { if (pMgmt->pCurrBSS->ldBmAverage[ii] != 0)
pMgmt->pCurrBSS->ldBmMAX = max(pMgmt->pCurrBSS->ldBmAverage[ii], ldBm); pMgmt->pCurrBSS->ldBmMAX = max(pMgmt->pCurrBSS->ldBmAverage[ii], ldBm);
}
}
} }
// ----------------------------------------------- // -----------------------------------------------
...@@ -698,10 +696,9 @@ device_receive_frame( ...@@ -698,10 +696,9 @@ device_receive_frame(
} }
if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) { if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) {
if (bIsWEP) { if (bIsWEP)
FrameSize -= 8; //MIC FrameSize -= 8; //MIC
} }
}
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
// Soft MIC // Soft MIC
...@@ -1093,9 +1090,9 @@ static bool s_bHandleRxEncryption( ...@@ -1093,9 +1090,9 @@ static bool s_bHandleRxEncryption(
rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3); rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3);
rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen); rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen);
if (ETHbIsBufferCrc32Ok(pbyIV+4, PayloadLen)) { if (ETHbIsBufferCrc32Ok(pbyIV+4, PayloadLen))
*pbyNewRsr |= NEWRSR_DECRYPTOK; *pbyNewRsr |= NEWRSR_DECRYPTOK;
}
} }
} else if ((byDecMode == KEY_CTL_TKIP) || } else if ((byDecMode == KEY_CTL_TKIP) ||
(byDecMode == KEY_CTL_CCMP)) { (byDecMode == KEY_CTL_CCMP)) {
...@@ -1104,11 +1101,11 @@ static bool s_bHandleRxEncryption( ...@@ -1104,11 +1101,11 @@ static bool s_bHandleRxEncryption(
PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc
*pdwRxTSC47_16 = cpu_to_le32(*(unsigned long *)(pbyIV + 4)); *pdwRxTSC47_16 = cpu_to_le32(*(unsigned long *)(pbyIV + 4));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ExtIV: %lx\n", *pdwRxTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ExtIV: %lx\n", *pdwRxTSC47_16);
if (byDecMode == KEY_CTL_TKIP) { if (byDecMode == KEY_CTL_TKIP)
*pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV + 2), *pbyIV)); *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV + 2), *pbyIV));
} else { else
*pwRxTSC15_0 = cpu_to_le16(*(unsigned short *)pbyIV); *pwRxTSC15_0 = cpu_to_le16(*(unsigned short *)pbyIV);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TSC0_15: %x\n", *pwRxTSC15_0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TSC0_15: %x\n", *pwRxTSC15_0);
if ((byDecMode == KEY_CTL_TKIP) && if ((byDecMode == KEY_CTL_TKIP) &&
...@@ -1193,9 +1190,9 @@ static bool s_bHostWepRxEncryption( ...@@ -1193,9 +1190,9 @@ static bool s_bHostWepRxEncryption(
rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3); rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3);
rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen); rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen);
if (ETHbIsBufferCrc32Ok(pbyIV+4, PayloadLen)) { if (ETHbIsBufferCrc32Ok(pbyIV+4, PayloadLen))
*pbyNewRsr |= NEWRSR_DECRYPTOK; *pbyNewRsr |= NEWRSR_DECRYPTOK;
}
} }
} else if ((byDecMode == KEY_CTL_TKIP) || } else if ((byDecMode == KEY_CTL_TKIP) ||
(byDecMode == KEY_CTL_CCMP)) { (byDecMode == KEY_CTL_CCMP)) {
...@@ -1205,11 +1202,11 @@ static bool s_bHostWepRxEncryption( ...@@ -1205,11 +1202,11 @@ static bool s_bHostWepRxEncryption(
*pdwRxTSC47_16 = cpu_to_le32(*(unsigned long *)(pbyIV + 4)); *pdwRxTSC47_16 = cpu_to_le32(*(unsigned long *)(pbyIV + 4));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ExtIV: %lx\n", *pdwRxTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ExtIV: %lx\n", *pdwRxTSC47_16);
if (byDecMode == KEY_CTL_TKIP) { if (byDecMode == KEY_CTL_TKIP)
*pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV)); *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV));
} else { else
*pwRxTSC15_0 = cpu_to_le16(*(unsigned short *)pbyIV); *pwRxTSC15_0 = cpu_to_le16(*(unsigned short *)pbyIV);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TSC0_15: %x\n", *pwRxTSC15_0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TSC0_15: %x\n", *pwRxTSC15_0);
if (byDecMode == KEY_CTL_TKIP) { if (byDecMode == KEY_CTL_TKIP) {
...@@ -1322,9 +1319,8 @@ static bool s_bAPModeRxData( ...@@ -1322,9 +1319,8 @@ static bool s_bAPModeRxData(
if (bRelayAndForward) if (bRelayAndForward)
iDANodeIndex = 0; iDANodeIndex = 0;
if ((pDevice->uAssocCount > 1) && (iDANodeIndex >= 0)) { if ((pDevice->uAssocCount > 1) && (iDANodeIndex >= 0))
ROUTEbRelay(pDevice, (unsigned char *)(skb->data + cbHeaderOffset), FrameSize, (unsigned int)iDANodeIndex); ROUTEbRelay(pDevice, (unsigned char *)(skb->data + cbHeaderOffset), FrameSize, (unsigned int)iDANodeIndex);
}
if (bRelayOnly) if (bRelayOnly)
return false; return false;
......
...@@ -206,11 +206,11 @@ static int hostap_remove_sta(PSDevice pDevice, ...@@ -206,11 +206,11 @@ static int hostap_remove_sta(PSDevice pDevice,
{ {
unsigned int uNodeIndex; unsigned int uNodeIndex;
if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, param->sta_addr, &uNodeIndex)) { if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, param->sta_addr, &uNodeIndex))
BSSvRemoveOneNode(pDevice, uNodeIndex); BSSvRemoveOneNode(pDevice, uNodeIndex);
} else { else
return -ENOENT; return -ENOENT;
}
return 0; return 0;
} }
...@@ -233,9 +233,9 @@ static int hostap_add_sta(PSDevice pDevice, ...@@ -233,9 +233,9 @@ static int hostap_add_sta(PSDevice pDevice,
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
unsigned int uNodeIndex; unsigned int uNodeIndex;
if (!BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) { if (!BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex))
BSSvCreateOneNode((PSDevice)pDevice, &uNodeIndex); BSSvCreateOneNode((PSDevice)pDevice, &uNodeIndex);
}
memcpy(pMgmt->sNodeDBTable[uNodeIndex].abyMACAddr, param->sta_addr, WLAN_ADDR_LEN); memcpy(pMgmt->sNodeDBTable[uNodeIndex].abyMACAddr, param->sta_addr, WLAN_ADDR_LEN);
pMgmt->sNodeDBTable[uNodeIndex].eNodeState = NODE_ASSOC; pMgmt->sNodeDBTable[uNodeIndex].eNodeState = NODE_ASSOC;
pMgmt->sNodeDBTable[uNodeIndex].wCapInfo = param->u.add_sta.capability; pMgmt->sNodeDBTable[uNodeIndex].wCapInfo = param->u.add_sta.capability;
...@@ -660,9 +660,8 @@ static int hostap_get_encryption(PSDevice pDevice, ...@@ -660,9 +660,8 @@ static int hostap_get_encryption(PSDevice pDevice,
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: %d\n", iNodeIndex); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: %d\n", iNodeIndex);
memset(param->u.crypt.seq, 0, 8); memset(param->u.crypt.seq, 0, 8);
for (ii = 0; ii < 8; ii++) { for (ii = 0; ii < 8; ii++)
param->u.crypt.seq[ii] = (unsigned char)pMgmt->sNodeDBTable[iNodeIndex].KeyRSC >> (ii * 8); param->u.crypt.seq[ii] = (unsigned char)pMgmt->sNodeDBTable[iNodeIndex].KeyRSC >> (ii * 8);
}
return ret; return ret;
} }
...@@ -767,10 +766,9 @@ int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p) ...@@ -767,10 +766,9 @@ int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p)
} }
if ((ret == 0) && ap_ioctl) { if ((ret == 0) && ap_ioctl) {
if (copy_to_user(p->pointer, param, p->length)) { if (copy_to_user(p->pointer, param, p->length))
ret = -EFAULT; ret = -EFAULT;
} }
}
out: out:
kfree(param); kfree(param);
......
...@@ -235,11 +235,11 @@ int iwctl_giwscan(struct net_device *dev, ...@@ -235,11 +235,11 @@ int iwctl_giwscan(struct net_device *dev,
//ADD mode //ADD mode
memset(&iwe, 0, sizeof(iwe)); memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWMODE; iwe.cmd = SIOCGIWMODE;
if (WLAN_GET_CAP_INFO_ESS(pBSS->wCapInfo)) { if (WLAN_GET_CAP_INFO_ESS(pBSS->wCapInfo))
iwe.u.mode = IW_MODE_INFRA; iwe.u.mode = IW_MODE_INFRA;
} else { else
iwe.u.mode = IW_MODE_ADHOC; iwe.u.mode = IW_MODE_ADHOC;
}
iwe.len = IW_EV_UINT_LEN; iwe.len = IW_EV_UINT_LEN;
current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe, IW_EV_UINT_LEN); current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
//ADD frequency //ADD frequency
...@@ -266,13 +266,13 @@ int iwctl_giwscan(struct net_device *dev, ...@@ -266,13 +266,13 @@ int iwctl_giwscan(struct net_device *dev,
iwe.u.qual.level = ldBm; iwe.u.qual.level = ldBm;
iwe.u.qual.noise = 0; iwe.u.qual.noise = 0;
//2008-0409-01, <Add> by Einsn Liu //2008-0409-01, <Add> by Einsn Liu
if (-ldBm < 50) { if (-ldBm < 50)
iwe.u.qual.qual = 100; iwe.u.qual.qual = 100;
} else if (-ldBm > 90) { else if (-ldBm > 90)
iwe.u.qual.qual = 0; iwe.u.qual.qual = 0;
} else { else
iwe.u.qual.qual = (40 - (-ldBm - 50)) * 100 / 40; iwe.u.qual.qual = (40 - (-ldBm - 50)) * 100 / 40;
}
iwe.u.qual.updated = 7; iwe.u.qual.updated = 7;
current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe, IW_EV_QUAL_LEN); current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
...@@ -280,11 +280,11 @@ int iwctl_giwscan(struct net_device *dev, ...@@ -280,11 +280,11 @@ int iwctl_giwscan(struct net_device *dev,
memset(&iwe, 0, sizeof(iwe)); memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWENCODE; iwe.cmd = SIOCGIWENCODE;
iwe.u.data.length = 0; iwe.u.data.length = 0;
if (WLAN_GET_CAP_INFO_PRIVACY(pBSS->wCapInfo)) { if (WLAN_GET_CAP_INFO_PRIVACY(pBSS->wCapInfo))
iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
} else { else
iwe.u.data.flags = IW_ENCODE_DISABLED; iwe.u.data.flags = IW_ENCODE_DISABLED;
}
current_ev = iwe_stream_add_point(info, current_ev, end_buf, &iwe, pItemSSID->abySSID); current_ev = iwe_stream_add_point(info, current_ev, end_buf, &iwe, pItemSSID->abySSID);
memset(&iwe, 0, sizeof(iwe)); memset(&iwe, 0, sizeof(iwe));
...@@ -437,9 +437,9 @@ int iwctl_siwmode(struct net_device *dev, ...@@ -437,9 +437,9 @@ int iwctl_siwmode(struct net_device *dev,
case IW_MODE_ADHOC: case IW_MODE_ADHOC:
if (pMgmt->eConfigMode != WMAC_CONFIG_IBSS_STA) { if (pMgmt->eConfigMode != WMAC_CONFIG_IBSS_STA) {
pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA; pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA;
if (pDevice->flags & DEVICE_FLAGS_OPENED) { if (pDevice->flags & DEVICE_FLAGS_OPENED)
pDevice->bCommit = true; pDevice->bCommit = true;
}
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to ad-hoc \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to ad-hoc \n");
break; break;
...@@ -447,9 +447,9 @@ int iwctl_siwmode(struct net_device *dev, ...@@ -447,9 +447,9 @@ int iwctl_siwmode(struct net_device *dev,
case IW_MODE_INFRA: case IW_MODE_INFRA:
if (pMgmt->eConfigMode != WMAC_CONFIG_ESS_STA) { if (pMgmt->eConfigMode != WMAC_CONFIG_ESS_STA) {
pMgmt->eConfigMode = WMAC_CONFIG_ESS_STA; pMgmt->eConfigMode = WMAC_CONFIG_ESS_STA;
if (pDevice->flags & DEVICE_FLAGS_OPENED) { if (pDevice->flags & DEVICE_FLAGS_OPENED)
pDevice->bCommit = true; pDevice->bCommit = true;
}
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to infrastructure \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to infrastructure \n");
break; break;
...@@ -461,9 +461,9 @@ int iwctl_siwmode(struct net_device *dev, ...@@ -461,9 +461,9 @@ int iwctl_siwmode(struct net_device *dev,
if (pMgmt->eConfigMode != WMAC_CONFIG_AP) { if (pMgmt->eConfigMode != WMAC_CONFIG_AP) {
pMgmt->eConfigMode = WMAC_CONFIG_AP; pMgmt->eConfigMode = WMAC_CONFIG_AP;
if (pDevice->flags & DEVICE_FLAGS_OPENED) { if (pDevice->flags & DEVICE_FLAGS_OPENED)
pDevice->bCommit = true; pDevice->bCommit = true;
}
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to Access Point \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to Access Point \n");
break; break;
...@@ -670,9 +670,9 @@ int iwctl_siwap(struct net_device *dev, ...@@ -670,9 +670,9 @@ int iwctl_siwap(struct net_device *dev,
} }
} }
if (pDevice->flags & DEVICE_FLAGS_OPENED) { if (pDevice->flags & DEVICE_FLAGS_OPENED)
pDevice->bCommit = true; pDevice->bCommit = true;
}
} }
return rc; return rc;
} }
...@@ -696,9 +696,8 @@ int iwctl_giwap(struct net_device *dev, ...@@ -696,9 +696,8 @@ int iwctl_giwap(struct net_device *dev,
if ((pDevice->bLinkPass == false) && (pMgmt->eCurrMode != WMAC_MODE_ESS_AP)) if ((pDevice->bLinkPass == false) && (pMgmt->eCurrMode != WMAC_MODE_ESS_AP))
memset(wrq->sa_data, 0, 6); memset(wrq->sa_data, 0, 6);
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)
memcpy(wrq->sa_data, pMgmt->abyCurrBSSID, 6); memcpy(wrq->sa_data, pMgmt->abyCurrBSSID, 6);
}
wrq->sa_family = ARPHRD_ETHER; wrq->sa_family = ARPHRD_ETHER;
...@@ -857,9 +856,8 @@ int iwctl_siwessid(struct net_device *dev, ...@@ -857,9 +856,8 @@ int iwctl_siwessid(struct net_device *dev,
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set essid = %s \n", pItemSSID->abySSID); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set essid = %s \n", pItemSSID->abySSID);
} }
if (pDevice->flags & DEVICE_FLAGS_OPENED) { if (pDevice->flags & DEVICE_FLAGS_OPENED)
pDevice->bCommit = true; pDevice->bCommit = true;
}
return 0; return 0;
} }
...@@ -1038,12 +1036,12 @@ int iwctl_siwrts(struct net_device *dev, ...@@ -1038,12 +1036,12 @@ int iwctl_siwrts(struct net_device *dev,
int rthr = wrq->value; int rthr = wrq->value;
if (wrq->disabled) if (wrq->disabled)
rthr = 2312; rthr = 2312;
if ((rthr < 0) || (rthr > 2312)) {
if ((rthr < 0) || (rthr > 2312))
rc = -EINVAL; rc = -EINVAL;
} else { else
pDevice->wRTSThreshold = rthr; pDevice->wRTSThreshold = rthr;
} }
}
return 0; return 0;
} }
...@@ -1142,9 +1140,8 @@ int iwctl_siwretry(struct net_device *dev, ...@@ -1142,9 +1140,8 @@ int iwctl_siwretry(struct net_device *dev,
pDevice->byLongRetryLimit = wrq->value; pDevice->byLongRetryLimit = wrq->value;
} }
} }
if (wrq->flags & IW_RETRY_LIFETIME) { if (wrq->flags & IW_RETRY_LIFETIME)
pDevice->wMaxTransmitMSDULifetime = wrq->value; pDevice->wMaxTransmitMSDULifetime = wrq->value;
}
return rc; return rc;
} }
...@@ -1214,10 +1211,13 @@ int iwctl_siwencode(struct net_device *dev, ...@@ -1214,10 +1211,13 @@ int iwctl_siwencode(struct net_device *dev,
} }
if (dwKeyIndex < 1 && ((wrq->flags & IW_ENCODE_NOKEY) == 0)) {//set default key if (dwKeyIndex < 1 && ((wrq->flags & IW_ENCODE_NOKEY) == 0)) {//set default key
if (pDevice->byKeyIndex < WLAN_WEP_NKEYS) { if (pDevice->byKeyIndex < WLAN_WEP_NKEYS)
dwKeyIndex = pDevice->byKeyIndex; dwKeyIndex = pDevice->byKeyIndex;
} else dwKeyIndex = 0; else
} else dwKeyIndex--; dwKeyIndex = 0;
} else {
dwKeyIndex--;
}
// Check the size of the key // Check the size of the key
if (wrq->length > WLAN_WEP232_KEYLEN) { if (wrq->length > WLAN_WEP232_KEYLEN) {
...@@ -1241,9 +1241,8 @@ int iwctl_siwencode(struct net_device *dev, ...@@ -1241,9 +1241,8 @@ int iwctl_siwencode(struct net_device *dev,
memcpy(pDevice->abyKey, extra, wrq->length); memcpy(pDevice->abyKey, extra, wrq->length);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "abyKey: "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "abyKey: ");
for (ii = 0; ii < wrq->length; ii++) { for (ii = 0; ii < wrq->length; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pDevice->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pDevice->abyKey[ii]);
}
if (pDevice->flags & DEVICE_FLAGS_OPENED) { if (pDevice->flags & DEVICE_FLAGS_OPENED) {
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
...@@ -1324,16 +1323,17 @@ int iwctl_giwencode(struct net_device *dev, ...@@ -1324,16 +1323,17 @@ int iwctl_giwencode(struct net_device *dev,
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWENCODE\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWENCODE\n");
if (index > WLAN_WEP_NKEYS) { if (index > WLAN_WEP_NKEYS)
return -EINVAL; return -EINVAL;
}
if (index < 1) {//get default key if (index < 1) {//get default key
if (pDevice->byKeyIndex < WLAN_WEP_NKEYS) { if (pDevice->byKeyIndex < WLAN_WEP_NKEYS)
index = pDevice->byKeyIndex; index = pDevice->byKeyIndex;
} else else
index = 0; index = 0;
} else } else {
index--; index--;
}
memset(abyKey, 0, WLAN_WEP232_KEYLEN); memset(abyKey, 0, WLAN_WEP232_KEYLEN);
// Check encryption mode // Check encryption mode
...@@ -1490,51 +1490,52 @@ int iwctl_siwauth(struct net_device *dev, ...@@ -1490,51 +1490,52 @@ int iwctl_siwauth(struct net_device *dev,
switch (wrq->flags & IW_AUTH_INDEX) { switch (wrq->flags & IW_AUTH_INDEX) {
case IW_AUTH_WPA_VERSION: case IW_AUTH_WPA_VERSION:
wpa_version = wrq->value; wpa_version = wrq->value;
if (wrq->value == IW_AUTH_WPA_VERSION_DISABLED) { if (wrq->value == IW_AUTH_WPA_VERSION_DISABLED)
PRINT_K("iwctl_siwauth:set WPADEV to disable at 1??????\n"); PRINT_K("iwctl_siwauth:set WPADEV to disable at 1??????\n");
} else if (wrq->value == IW_AUTH_WPA_VERSION_WPA) { else if (wrq->value == IW_AUTH_WPA_VERSION_WPA)
PRINT_K("iwctl_siwauth:set WPADEV to WPA1******\n"); PRINT_K("iwctl_siwauth:set WPADEV to WPA1******\n");
} else { else
PRINT_K("iwctl_siwauth:set WPADEV to WPA2******\n"); PRINT_K("iwctl_siwauth:set WPADEV to WPA2******\n");
}
break; break;
case IW_AUTH_CIPHER_PAIRWISE: case IW_AUTH_CIPHER_PAIRWISE:
pairwise = wrq->value; pairwise = wrq->value;
if (pairwise == IW_AUTH_CIPHER_CCMP) { if (pairwise == IW_AUTH_CIPHER_CCMP)
pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled; pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled;
} else if (pairwise == IW_AUTH_CIPHER_TKIP) { else if (pairwise == IW_AUTH_CIPHER_TKIP)
pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled; pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled;
} else if (pairwise == IW_AUTH_CIPHER_WEP40 || pairwise == IW_AUTH_CIPHER_WEP104) { else if (pairwise == IW_AUTH_CIPHER_WEP40 || pairwise == IW_AUTH_CIPHER_WEP104)
pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
} else if (pairwise == IW_AUTH_CIPHER_NONE) { else if (pairwise == IW_AUTH_CIPHER_NONE)
//do nothing,einsn liu ; /* do nothing,einsn liu */
} else pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; else
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
break; break;
case IW_AUTH_CIPHER_GROUP: case IW_AUTH_CIPHER_GROUP:
if (wpa_version == IW_AUTH_WPA_VERSION_DISABLED) if (wpa_version == IW_AUTH_WPA_VERSION_DISABLED)
break; break;
if (pairwise == IW_AUTH_CIPHER_NONE) { if (pairwise == IW_AUTH_CIPHER_NONE) {
if (wrq->value == IW_AUTH_CIPHER_CCMP) { if (wrq->value == IW_AUTH_CIPHER_CCMP)
pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled; pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled;
} else { else
pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled; pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled;
} }
}
break; break;
case IW_AUTH_KEY_MGMT: case IW_AUTH_KEY_MGMT:
if (wpa_version == IW_AUTH_WPA_VERSION_WPA2) { if (wpa_version == IW_AUTH_WPA_VERSION_WPA2) {
if (wrq->value == IW_AUTH_KEY_MGMT_PSK) if (wrq->value == IW_AUTH_KEY_MGMT_PSK)
pMgmt->eAuthenMode = WMAC_AUTH_WPA2PSK; pMgmt->eAuthenMode = WMAC_AUTH_WPA2PSK;
else pMgmt->eAuthenMode = WMAC_AUTH_WPA2; else
pMgmt->eAuthenMode = WMAC_AUTH_WPA2;
} else if (wpa_version == IW_AUTH_WPA_VERSION_WPA) { } else if (wpa_version == IW_AUTH_WPA_VERSION_WPA) {
if (wrq->value == 0) { if (wrq->value == 0)
pMgmt->eAuthenMode = WMAC_AUTH_WPANONE; pMgmt->eAuthenMode = WMAC_AUTH_WPANONE;
} else if (wrq->value == IW_AUTH_KEY_MGMT_PSK) else if (wrq->value == IW_AUTH_KEY_MGMT_PSK)
pMgmt->eAuthenMode = WMAC_AUTH_WPAPSK; pMgmt->eAuthenMode = WMAC_AUTH_WPAPSK;
else pMgmt->eAuthenMode = WMAC_AUTH_WPA; else
pMgmt->eAuthenMode = WMAC_AUTH_WPA;
} }
break; break;
...@@ -1543,11 +1544,11 @@ int iwctl_siwauth(struct net_device *dev, ...@@ -1543,11 +1544,11 @@ int iwctl_siwauth(struct net_device *dev,
case IW_AUTH_DROP_UNENCRYPTED: case IW_AUTH_DROP_UNENCRYPTED:
break; break;
case IW_AUTH_80211_AUTH_ALG: case IW_AUTH_80211_AUTH_ALG:
if (wrq->value == IW_AUTH_ALG_OPEN_SYSTEM) { if (wrq->value == IW_AUTH_ALG_OPEN_SYSTEM)
pMgmt->bShareKeyAlgorithm = false; pMgmt->bShareKeyAlgorithm = false;
} else if (wrq->value == IW_AUTH_ALG_SHARED_KEY) { else if (wrq->value == IW_AUTH_ALG_SHARED_KEY)
pMgmt->bShareKeyAlgorithm = true; pMgmt->bShareKeyAlgorithm = true;
}
break; break;
case IW_AUTH_WPA_ENABLED: case IW_AUTH_WPA_ENABLED:
break; break;
...@@ -1630,12 +1631,13 @@ int iwctl_giwgenie(struct net_device *dev, ...@@ -1630,12 +1631,13 @@ int iwctl_giwgenie(struct net_device *dev,
if (pMgmt->wWPAIELen > 0) { if (pMgmt->wWPAIELen > 0) {
wrq->length = pMgmt->wWPAIELen; wrq->length = pMgmt->wWPAIELen;
if (pMgmt->wWPAIELen <= space) { if (pMgmt->wWPAIELen <= space) {
if (copy_to_user(extra, pMgmt->abyWPAIE, pMgmt->wWPAIELen)) { if (copy_to_user(extra, pMgmt->abyWPAIE, pMgmt->wWPAIELen))
ret = -EFAULT; ret = -EFAULT;
}
} else } else {
ret = -E2BIG; ret = -E2BIG;
} }
}
return ret; return ret;
} }
...@@ -1725,18 +1727,18 @@ int iwctl_siwencodeext(struct net_device *dev, ...@@ -1725,18 +1727,18 @@ int iwctl_siwencodeext(struct net_device *dev,
//****set if current action is Network Manager count?? //****set if current action is Network Manager count??
//****this method is so foolish,but there is no other way??? //****this method is so foolish,but there is no other way???
if (param->u.wpa_key.alg_name == WPA_ALG_NONE) { if (param->u.wpa_key.alg_name == WPA_ALG_NONE) {
if (param->u.wpa_key.key_index == 0) { if (param->u.wpa_key.key_index == 0)
pDevice->bwextcount++; pDevice->bwextcount++;
}
if ((pDevice->bwextcount == 1) && (param->u.wpa_key.key_index == 1)) { if ((pDevice->bwextcount == 1) && (param->u.wpa_key.key_index == 1))
pDevice->bwextcount++; pDevice->bwextcount++;
}
if ((pDevice->bwextcount == 2) && (param->u.wpa_key.key_index == 2)) { if ((pDevice->bwextcount == 2) && (param->u.wpa_key.key_index == 2))
pDevice->bwextcount++; pDevice->bwextcount++;
}
if ((pDevice->bwextcount == 3) && (param->u.wpa_key.key_index == 3)) { if ((pDevice->bwextcount == 3) && (param->u.wpa_key.key_index == 3))
pDevice->bwextcount++; pDevice->bwextcount++;
}
} }
if (pDevice->bwextcount == 4) { if (pDevice->bwextcount == 4) {
printk("SIOCSIWENCODEEXT:Enable WPA WEXT SUPPORT!!!!!\n"); printk("SIOCSIWENCODEEXT:Enable WPA WEXT SUPPORT!!!!!\n");
......
...@@ -255,9 +255,9 @@ bool KeybSetKey( ...@@ -255,9 +255,9 @@ bool KeybSetKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(R): \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(R): \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: ");
for (ii = 0; ii < pKey->uKeyLength; ii++) { for (ii = 0; ii < pKey->uKeyLength; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16);
...@@ -319,9 +319,9 @@ bool KeybSetKey( ...@@ -319,9 +319,9 @@ bool KeybSetKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: ");
for (ii = 0; ii < pKey->uKeyLength; ii++) { for (ii = 0; ii < pKey->uKeyLength; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16);
...@@ -359,9 +359,9 @@ bool KeybRemoveKey( ...@@ -359,9 +359,9 @@ bool KeybRemoveKey(
if (is_broadcast_ether_addr(pbyBSSID)) { if (is_broadcast_ether_addr(pbyBSSID)) {
// delete all keys // delete all keys
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
for (i = 0; i < MAX_KEY_TABLE; i++) { for (i = 0; i < MAX_KEY_TABLE; i++)
pTable->KeyTable[i].PairwiseKey.bKeyValid = false; pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
}
s_vCheckKeyTableValid(pTable, dwIoBase); s_vCheckKeyTableValid(pTable, dwIoBase);
return true; return true;
} else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { } else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) {
...@@ -427,9 +427,9 @@ bool KeybRemoveAllKey( ...@@ -427,9 +427,9 @@ bool KeybRemoveAllKey(
if (pTable->KeyTable[i].bInUse && if (pTable->KeyTable[i].bInUse &&
ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
pTable->KeyTable[i].PairwiseKey.bKeyValid = false; pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
for (u = 0; u < MAX_GROUP_KEY; u++) { for (u = 0; u < MAX_GROUP_KEY; u++)
pTable->KeyTable[i].GroupKey[u].bKeyValid = false; pTable->KeyTable[i].GroupKey[u].bKeyValid = false;
}
pTable->KeyTable[i].dwGTKeyIndex = 0; pTable->KeyTable[i].dwGTKeyIndex = 0;
s_vCheckKeyTableValid(pTable, dwIoBase); s_vCheckKeyTableValid(pTable, dwIoBase);
return true; return true;
...@@ -478,9 +478,8 @@ void KeyvRemoveAllWEPKey( ...@@ -478,9 +478,8 @@ void KeyvRemoveAllWEPKey(
{ {
int i; int i;
for (i = 0; i < MAX_GROUP_KEY; i++) { for (i = 0; i < MAX_GROUP_KEY; i++)
KeyvRemoveWEPKey(pTable, i, dwIoBase); KeyvRemoveWEPKey(pTable, i, dwIoBase);
}
} }
/* /*
...@@ -515,9 +514,9 @@ bool KeybGetTransmitKey( ...@@ -515,9 +514,9 @@ bool KeybGetTransmitKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PAIRWISE_KEY: KeyTable.abyBSSID: "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PAIRWISE_KEY: KeyTable.abyBSSID: ");
for (ii = 0; ii < 6; ii++) { for (ii = 0; ii < 6; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x ", pTable->KeyTable[i].abyBSSID[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x ", pTable->KeyTable[i].abyBSSID[ii]);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
return true; return true;
...@@ -536,9 +535,9 @@ bool KeybGetTransmitKey( ...@@ -536,9 +535,9 @@ bool KeybGetTransmitKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP_KEY: KeyTable.abyBSSID\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP_KEY: KeyTable.abyBSSID\n");
for (ii = 0; ii < 6; ii++) { for (ii = 0; ii < 6; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x ", pTable->KeyTable[i].abyBSSID[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x ", pTable->KeyTable[i].abyBSSID[ii]);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex);
...@@ -551,9 +550,9 @@ bool KeybGetTransmitKey( ...@@ -551,9 +550,9 @@ bool KeybGetTransmitKey(
} // BSSID match } // BSSID match
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ERROR: NO Match BSSID !!! "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ERROR: NO Match BSSID !!! ");
for (ii = 0; ii < 6; ii++) { for (ii = 0; ii < 6; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", *(pbyBSSID+ii)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", *(pbyBSSID+ii));
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
return false; return false;
} }
...@@ -621,11 +620,10 @@ bool KeybSetDefaultKey( ...@@ -621,11 +620,10 @@ bool KeybSetDefaultKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetDefaultKey: %1x, %d \n", (int)dwKeyIndex, (int)uKeyLength); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetDefaultKey: %1x, %d \n", (int)dwKeyIndex, (int)uKeyLength);
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key if ((dwKeyIndex & PAIRWISE_KEY) != 0) // Pairwise key
return false; return false;
} else if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY) { else if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY)
return false; return false;
}
if (uKeyLength > MAX_KEY_LEN) if (uKeyLength > MAX_KEY_LEN)
return false; return false;
...@@ -683,9 +681,9 @@ bool KeybSetDefaultKey( ...@@ -683,9 +681,9 @@ bool KeybSetDefaultKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n", pKey->bKeyValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n", pKey->bKeyValid);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n", (int)pKey->uKeyLength); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n", (int)pKey->uKeyLength);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: \n");
for (ii = 0; ii < pKey->uKeyLength; ii++) { for (ii = 0; ii < pKey->uKeyLength; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x", pKey->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x", pKey->abyKey[ii]);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n", pKey->dwTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n", pKey->dwTSC47_16);
...@@ -729,11 +727,10 @@ bool KeybSetAllGroupKey( ...@@ -729,11 +727,10 @@ bool KeybSetAllGroupKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex);
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key if ((dwKeyIndex & PAIRWISE_KEY) != 0) // Pairwise key
return false; return false;
} else if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY) { else if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY)
return false; return false;
}
for (i = 0; i < MAX_KEY_TABLE - 1; i++) { for (i = 0; i < MAX_KEY_TABLE - 1; i++) {
if (pTable->KeyTable[i].bInUse) { if (pTable->KeyTable[i].bInUse) {
...@@ -779,9 +776,9 @@ bool KeybSetAllGroupKey( ...@@ -779,9 +776,9 @@ bool KeybSetAllGroupKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: ");
for (ii = 0; ii < pKey->uKeyLength; ii++) { for (ii = 0; ii < pKey->uKeyLength; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
} // (pTable->KeyTable[i].bInUse == true) } // (pTable->KeyTable[i].bInUse == true)
......
...@@ -641,16 +641,14 @@ void MACvSaveContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf) ...@@ -641,16 +641,14 @@ void MACvSaveContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf)
int ii; int ii;
// read page0 register // read page0 register
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE0; ii++) { for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE0; ii++)
VNSvInPortB((dwIoBase + ii), (pbyCxtBuf + ii)); VNSvInPortB((dwIoBase + ii), (pbyCxtBuf + ii));
}
MACvSelectPage1(dwIoBase); MACvSelectPage1(dwIoBase);
// read page1 register // read page1 register
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++) { for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++)
VNSvInPortB((dwIoBase + ii), (pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii)); VNSvInPortB((dwIoBase + ii), (pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
}
MACvSelectPage0(dwIoBase); MACvSelectPage0(dwIoBase);
} }
...@@ -675,25 +673,24 @@ void MACvRestoreContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf) ...@@ -675,25 +673,24 @@ void MACvRestoreContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf)
MACvSelectPage1(dwIoBase); MACvSelectPage1(dwIoBase);
// restore page1 // restore page1
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++) { for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++)
VNSvOutPortB((dwIoBase + ii), *(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii)); VNSvOutPortB((dwIoBase + ii), *(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
}
MACvSelectPage0(dwIoBase); MACvSelectPage0(dwIoBase);
// restore RCR,TCR,IMR... // restore RCR,TCR,IMR...
for (ii = MAC_REG_RCR; ii < MAC_REG_ISR; ii++) { for (ii = MAC_REG_RCR; ii < MAC_REG_ISR; ii++)
VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii)); VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii));
}
// restore MAC Config. // restore MAC Config.
for (ii = MAC_REG_LRT; ii < MAC_REG_PAGE1SEL; ii++) { for (ii = MAC_REG_LRT; ii < MAC_REG_PAGE1SEL; ii++)
VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii)); VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii));
}
VNSvOutPortB(dwIoBase + MAC_REG_CFG, *(pbyCxtBuf + MAC_REG_CFG)); VNSvOutPortB(dwIoBase + MAC_REG_CFG, *(pbyCxtBuf + MAC_REG_CFG));
// restore PS Config. // restore PS Config.
for (ii = MAC_REG_PSCFG; ii < MAC_REG_BBREGCTL; ii++) { for (ii = MAC_REG_PSCFG; ii < MAC_REG_BBREGCTL; ii++)
VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii)); VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii));
}
// restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR // restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR
VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, *(unsigned long *)(pbyCxtBuf + MAC_REG_TXDMAPTR0)); VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, *(unsigned long *)(pbyCxtBuf + MAC_REG_TXDMAPTR0));
...@@ -728,24 +725,20 @@ bool MACbCompareContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf) ...@@ -728,24 +725,20 @@ bool MACbCompareContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf)
// compare CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR // compare CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR
VNSvInPortD(dwIoBase + MAC_REG_TXDMAPTR0, &dwData); VNSvInPortD(dwIoBase + MAC_REG_TXDMAPTR0, &dwData);
if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_TXDMAPTR0)) { if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_TXDMAPTR0))
return false; return false;
}
VNSvInPortD(dwIoBase + MAC_REG_AC0DMAPTR, &dwData); VNSvInPortD(dwIoBase + MAC_REG_AC0DMAPTR, &dwData);
if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_AC0DMAPTR)) { if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_AC0DMAPTR))
return false; return false;
}
VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR0, &dwData); VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR0, &dwData);
if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR0)) { if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR0))
return false; return false;
}
VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR1, &dwData); VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR1, &dwData);
if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR1)) { if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR1))
return false; return false;
}
return true; return true;
} }
...@@ -1055,21 +1048,21 @@ void MACvSetCurrRx0DescAddr(unsigned long dwIoBase, unsigned long dwCurrDescAddr ...@@ -1055,21 +1048,21 @@ void MACvSetCurrRx0DescAddr(unsigned long dwIoBase, unsigned long dwCurrDescAddr
unsigned char byOrgDMACtl; unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byOrgDMACtl); VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) { if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL0+2, DMACTL_RUN); VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL0+2, DMACTL_RUN);
}
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byData); VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byData);
if (!(byData & DMACTL_RUN)) if (!(byData & DMACTL_RUN))
break; break;
} }
if (ww == W_MAX_TIMEOUT) {
if (ww == W_MAX_TIMEOUT)
DBG_PORT80(0x13); DBG_PORT80(0x13);
}
VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR0, dwCurrDescAddr); VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR0, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN) { if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_RUN); VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_RUN);
}
} }
/* /*
...@@ -1093,21 +1086,21 @@ void MACvSetCurrRx1DescAddr(unsigned long dwIoBase, unsigned long dwCurrDescAddr ...@@ -1093,21 +1086,21 @@ void MACvSetCurrRx1DescAddr(unsigned long dwIoBase, unsigned long dwCurrDescAddr
unsigned char byOrgDMACtl; unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byOrgDMACtl); VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) { if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL1+2, DMACTL_RUN); VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL1+2, DMACTL_RUN);
}
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byData); VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byData);
if (!(byData & DMACTL_RUN)) if (!(byData & DMACTL_RUN))
break; break;
} }
if (ww == W_MAX_TIMEOUT) { if (ww == W_MAX_TIMEOUT)
DBG_PORT80(0x14); DBG_PORT80(0x14);
}
VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1, dwCurrDescAddr); VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN) { if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_RUN); VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_RUN);
}
} }
/* /*
...@@ -1131,21 +1124,20 @@ void MACvSetCurrTx0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAd ...@@ -1131,21 +1124,20 @@ void MACvSetCurrTx0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAd
unsigned char byOrgDMACtl; unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byOrgDMACtl); VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) { if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0+2, DMACTL_RUN); VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0+2, DMACTL_RUN);
}
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byData); VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byData);
if (!(byData & DMACTL_RUN)) if (!(byData & DMACTL_RUN))
break; break;
} }
if (ww == W_MAX_TIMEOUT) { if (ww == W_MAX_TIMEOUT)
DBG_PORT80(0x25); DBG_PORT80(0x25);
}
VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, dwCurrDescAddr); VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN) { if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_RUN); VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_RUN);
}
} }
/* /*
...@@ -1170,9 +1162,9 @@ void MACvSetCurrAC0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAd ...@@ -1170,9 +1162,9 @@ void MACvSetCurrAC0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAd
unsigned char byOrgDMACtl; unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byOrgDMACtl); VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) { if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_AC0DMACTL+2, DMACTL_RUN); VNSvOutPortB(dwIoBase + MAC_REG_AC0DMACTL+2, DMACTL_RUN);
}
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byData); VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byData);
if (!(byData & DMACTL_RUN)) if (!(byData & DMACTL_RUN))
...@@ -1183,18 +1175,16 @@ void MACvSetCurrAC0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAd ...@@ -1183,18 +1175,16 @@ void MACvSetCurrAC0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAd
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x26)\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x26)\n");
} }
VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, dwCurrDescAddr); VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN) { if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_RUN); VNSvOutPortB(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_RUN);
}
} }
void MACvSetCurrTXDescAddr(int iTxType, unsigned long dwIoBase, unsigned long dwCurrDescAddr) void MACvSetCurrTXDescAddr(int iTxType, unsigned long dwIoBase, unsigned long dwCurrDescAddr)
{ {
if (iTxType == TYPE_AC0DMA) { if (iTxType == TYPE_AC0DMA)
MACvSetCurrAC0DescAddrEx(dwIoBase, dwCurrDescAddr); MACvSetCurrAC0DescAddrEx(dwIoBase, dwCurrDescAddr);
} else if (iTxType == TYPE_TXDMA0) { else if (iTxType == TYPE_TXDMA0)
MACvSetCurrTx0DescAddrEx(dwIoBase, dwCurrDescAddr); MACvSetCurrTx0DescAddrEx(dwIoBase, dwCurrDescAddr);
}
} }
/* /*
...@@ -1384,9 +1374,9 @@ bool MACbPSWakeup(unsigned long dwIoBase) ...@@ -1384,9 +1374,9 @@ bool MACbPSWakeup(unsigned long dwIoBase)
unsigned char byOrgValue; unsigned char byOrgValue;
unsigned int ww; unsigned int ww;
// Read PSCTL // Read PSCTL
if (MACbIsRegBitsOff(dwIoBase, MAC_REG_PSCTL, PSCTL_PS)) { if (MACbIsRegBitsOff(dwIoBase, MAC_REG_PSCTL, PSCTL_PS))
return true; return true;
}
// Disable PS // Disable PS
MACvRegBitsOff(dwIoBase, MAC_REG_PSCTL, PSCTL_PSEN); MACvRegBitsOff(dwIoBase, MAC_REG_PSCTL, PSCTL_PSEN);
...@@ -1535,9 +1525,9 @@ void MACvSetDefaultKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen, ...@@ -1535,9 +1525,9 @@ void MACvSetDefaultKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen,
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
} }
dwData = *pdwKey; dwData = *pdwKey;
if (uKeyLen == WLAN_WEP104_KEYLEN) { if (uKeyLen == WLAN_WEP104_KEYLEN)
dwData |= 0x80000000; dwData |= 0x80000000;
}
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset+3); VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset+3);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData); VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
......
...@@ -187,75 +187,75 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic, ...@@ -187,75 +187,75 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
if (byRxRate == 22) { if (byRxRate == 22) {
pStatistic->CustomStat.ullRsr11M++; pStatistic->CustomStat.ullRsr11M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr11MCRCOk++; pStatistic->CustomStat.ullRsr11MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "11M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr11M, (int)pStatistic->CustomStat.ullRsr11MCRCOk, byRSR); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "11M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr11M, (int)pStatistic->CustomStat.ullRsr11MCRCOk, byRSR);
} else if (byRxRate == 11) { } else if (byRxRate == 11) {
pStatistic->CustomStat.ullRsr5M++; pStatistic->CustomStat.ullRsr5M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr5MCRCOk++; pStatistic->CustomStat.ullRsr5MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 5M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr5M, (int)pStatistic->CustomStat.ullRsr5MCRCOk, byRSR); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 5M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr5M, (int)pStatistic->CustomStat.ullRsr5MCRCOk, byRSR);
} else if (byRxRate == 4) { } else if (byRxRate == 4) {
pStatistic->CustomStat.ullRsr2M++; pStatistic->CustomStat.ullRsr2M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr2MCRCOk++; pStatistic->CustomStat.ullRsr2MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 2M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr2M, (int)pStatistic->CustomStat.ullRsr2MCRCOk, byRSR); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 2M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr2M, (int)pStatistic->CustomStat.ullRsr2MCRCOk, byRSR);
} else if (byRxRate == 2) { } else if (byRxRate == 2) {
pStatistic->CustomStat.ullRsr1M++; pStatistic->CustomStat.ullRsr1M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr1MCRCOk++; pStatistic->CustomStat.ullRsr1MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 1M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr1M, (int)pStatistic->CustomStat.ullRsr1MCRCOk, byRSR); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 1M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr1M, (int)pStatistic->CustomStat.ullRsr1MCRCOk, byRSR);
} else if (byRxRate == 12) { } else if (byRxRate == 12) {
pStatistic->CustomStat.ullRsr6M++; pStatistic->CustomStat.ullRsr6M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr6MCRCOk++; pStatistic->CustomStat.ullRsr6MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 6M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr6M, (int)pStatistic->CustomStat.ullRsr6MCRCOk); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 6M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr6M, (int)pStatistic->CustomStat.ullRsr6MCRCOk);
} else if (byRxRate == 18) { } else if (byRxRate == 18) {
pStatistic->CustomStat.ullRsr9M++; pStatistic->CustomStat.ullRsr9M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr9MCRCOk++; pStatistic->CustomStat.ullRsr9MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 9M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr9M, (int)pStatistic->CustomStat.ullRsr9MCRCOk); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 9M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr9M, (int)pStatistic->CustomStat.ullRsr9MCRCOk);
} else if (byRxRate == 24) { } else if (byRxRate == 24) {
pStatistic->CustomStat.ullRsr12M++; pStatistic->CustomStat.ullRsr12M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr12MCRCOk++; pStatistic->CustomStat.ullRsr12MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "12M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr12M, (int)pStatistic->CustomStat.ullRsr12MCRCOk); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "12M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr12M, (int)pStatistic->CustomStat.ullRsr12MCRCOk);
} else if (byRxRate == 36) { } else if (byRxRate == 36) {
pStatistic->CustomStat.ullRsr18M++; pStatistic->CustomStat.ullRsr18M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr18MCRCOk++; pStatistic->CustomStat.ullRsr18MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "18M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr18M, (int)pStatistic->CustomStat.ullRsr18MCRCOk); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "18M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr18M, (int)pStatistic->CustomStat.ullRsr18MCRCOk);
} else if (byRxRate == 48) { } else if (byRxRate == 48) {
pStatistic->CustomStat.ullRsr24M++; pStatistic->CustomStat.ullRsr24M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr24MCRCOk++; pStatistic->CustomStat.ullRsr24MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "24M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr24M, (int)pStatistic->CustomStat.ullRsr24MCRCOk); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "24M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr24M, (int)pStatistic->CustomStat.ullRsr24MCRCOk);
} else if (byRxRate == 72) { } else if (byRxRate == 72) {
pStatistic->CustomStat.ullRsr36M++; pStatistic->CustomStat.ullRsr36M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr36MCRCOk++; pStatistic->CustomStat.ullRsr36MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "36M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr36M, (int)pStatistic->CustomStat.ullRsr36MCRCOk); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "36M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr36M, (int)pStatistic->CustomStat.ullRsr36MCRCOk);
} else if (byRxRate == 96) { } else if (byRxRate == 96) {
pStatistic->CustomStat.ullRsr48M++; pStatistic->CustomStat.ullRsr48M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr48MCRCOk++; pStatistic->CustomStat.ullRsr48MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "48M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr48M, (int)pStatistic->CustomStat.ullRsr48MCRCOk); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "48M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr48M, (int)pStatistic->CustomStat.ullRsr48MCRCOk);
} else if (byRxRate == 108) { } else if (byRxRate == 108) {
pStatistic->CustomStat.ullRsr54M++; pStatistic->CustomStat.ullRsr54M++;
if (byRSR & RSR_CRCOK) { if (byRSR & RSR_CRCOK)
pStatistic->CustomStat.ullRsr54MCRCOk++; pStatistic->CustomStat.ullRsr54MCRCOk++;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "54M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr54M, (int)pStatistic->CustomStat.ullRsr54MCRCOk); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "54M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr54M, (int)pStatistic->CustomStat.ullRsr54MCRCOk);
} else { } else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Unknown: Total[%d], CRCOK[%d]\n", (int)pStatistic->dwRsrRxPacket+1, (int)pStatistic->dwRsrCRCOk); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Unknown: Total[%d], CRCOK[%d]\n", (int)pStatistic->dwRsrRxPacket+1, (int)pStatistic->dwRsrCRCOk);
...@@ -288,13 +288,12 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic, ...@@ -288,13 +288,12 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
pStatistic->dwRsrRxPacket++; pStatistic->dwRsrRxPacket++;
pStatistic->dwRsrRxOctet += cbFrameLength; pStatistic->dwRsrRxOctet += cbFrameLength;
if (IS_TYPE_DATA(pbyBuffer)) { if (IS_TYPE_DATA(pbyBuffer))
pStatistic->dwRsrRxData++; pStatistic->dwRsrRxData++;
} else if (IS_TYPE_MGMT(pbyBuffer)) { else if (IS_TYPE_MGMT(pbyBuffer))
pStatistic->dwRsrRxManage++; pStatistic->dwRsrRxManage++;
} else if (IS_TYPE_CONTROL(pbyBuffer)) { else if (IS_TYPE_CONTROL(pbyBuffer))
pStatistic->dwRsrRxControl++; pStatistic->dwRsrRxControl++;
}
if (byRSR & RSR_ADDRBROAD) if (byRSR & RSR_ADDRBROAD)
pStatistic->dwRsrBroadcast++; pStatistic->dwRsrBroadcast++;
...@@ -306,23 +305,22 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic, ...@@ -306,23 +305,22 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
if (WLAN_GET_FC_MOREFRAG(pHeader->wFrameCtl)) if (WLAN_GET_FC_MOREFRAG(pHeader->wFrameCtl))
pStatistic->dwRsrRxFragment++; pStatistic->dwRsrRxFragment++;
if (cbFrameLength < ETH_ZLEN + 4) { if (cbFrameLength < ETH_ZLEN + 4)
pStatistic->dwRsrRunt++; pStatistic->dwRsrRunt++;
} else if (cbFrameLength == ETH_ZLEN + 4) { else if (cbFrameLength == ETH_ZLEN + 4)
pStatistic->dwRsrRxFrmLen64++; pStatistic->dwRsrRxFrmLen64++;
} else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) { else if ((65 <= cbFrameLength) && (cbFrameLength <= 127))
pStatistic->dwRsrRxFrmLen65_127++; pStatistic->dwRsrRxFrmLen65_127++;
} else if ((128 <= cbFrameLength) && (cbFrameLength <= 255)) { else if ((128 <= cbFrameLength) && (cbFrameLength <= 255))
pStatistic->dwRsrRxFrmLen128_255++; pStatistic->dwRsrRxFrmLen128_255++;
} else if ((256 <= cbFrameLength) && (cbFrameLength <= 511)) { else if ((256 <= cbFrameLength) && (cbFrameLength <= 511))
pStatistic->dwRsrRxFrmLen256_511++; pStatistic->dwRsrRxFrmLen256_511++;
} else if ((512 <= cbFrameLength) && (cbFrameLength <= 1023)) { else if ((512 <= cbFrameLength) && (cbFrameLength <= 1023))
pStatistic->dwRsrRxFrmLen512_1023++; pStatistic->dwRsrRxFrmLen512_1023++;
} else if ((1024 <= cbFrameLength) && (cbFrameLength <= ETH_FRAME_LEN + 4)) { else if ((1024 <= cbFrameLength) && (cbFrameLength <= ETH_FRAME_LEN + 4))
pStatistic->dwRsrRxFrmLen1024_1518++; pStatistic->dwRsrRxFrmLen1024_1518++;
} else if (cbFrameLength > ETH_FRAME_LEN + 4) { else if (cbFrameLength > ETH_FRAME_LEN + 4)
pStatistic->dwRsrLong++; pStatistic->dwRsrLong++;
}
} }
/* /*
...@@ -399,11 +397,11 @@ STAvUpdateTDStatCounter( ...@@ -399,11 +397,11 @@ STAvUpdateTDStatCounter(
unsigned char byTSR0_NCR = byTSR0 & TSR0_NCR; unsigned char byTSR0_NCR = byTSR0 & TSR0_NCR;
pHeader = (PWLAN_80211HDR_A4) pbyBuffer; pHeader = (PWLAN_80211HDR_A4) pbyBuffer;
if (WLAN_GET_FC_TODS(pHeader->wFrameCtl) == 0) { if (WLAN_GET_FC_TODS(pHeader->wFrameCtl) == 0)
pbyDestAddr = &(pHeader->abyAddr1[0]); pbyDestAddr = &(pHeader->abyAddr1[0]);
} else { else
pbyDestAddr = &(pHeader->abyAddr3[0]); pbyDestAddr = &(pHeader->abyAddr3[0]);
}
// increase tx packet count // increase tx packet count
pStatistic->dwTsrTxPacket[uIdx]++; pStatistic->dwTsrTxPacket[uIdx]++;
pStatistic->dwTsrTxOctet[uIdx] += cbFrameLength; pStatistic->dwTsrTxOctet[uIdx] += cbFrameLength;
......
...@@ -137,9 +137,9 @@ void MIC_vGetMIC(u32 *pdwL, u32 *pdwR) ...@@ -137,9 +137,9 @@ void MIC_vGetMIC(u32 *pdwL, u32 *pdwR)
s_vAppendByte(0); s_vAppendByte(0);
s_vAppendByte(0); s_vAppendByte(0);
// and then zeroes until the length is a multiple of 4 // and then zeroes until the length is a multiple of 4
while (nBytesInM != 0) { while (nBytesInM != 0)
s_vAppendByte(0); s_vAppendByte(0);
}
// The s_vAppendByte function has already computed the result. // The s_vAppendByte function has already computed the result.
*pdwL = L; *pdwL = L;
*pdwR = R; *pdwR = R;
......
...@@ -145,9 +145,9 @@ PSvDisablePowerSaving( ...@@ -145,9 +145,9 @@ PSvDisablePowerSaving(
pDevice->bEnablePSMode = false; pDevice->bEnablePSMode = false;
if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) { if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE)
PSbSendNullPacket(pDevice); PSbSendNullPacket(pDevice);
}
pDevice->bPWBitOn = false; pDevice->bPWBitOn = false;
return; return;
} }
...@@ -276,17 +276,15 @@ PSbSendNullPacket( ...@@ -276,17 +276,15 @@ PSbSendNullPacket(
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
unsigned int uIdx; unsigned int uIdx;
if (!pDevice->bLinkPass) { if (!pDevice->bLinkPass)
return false; return false;
}
#ifdef TxInSleep #ifdef TxInSleep
if (!pDevice->bEnablePSMode && !pDevice->fTxDataInSleep) { if (!pDevice->bEnablePSMode && !pDevice->fTxDataInSleep)
return false; return false;
}
#else #else
if (!pDevice->bEnablePSMode) { if (!pDevice->bEnablePSMode)
return false; return false;
}
#endif #endif
if (pDevice->bEnablePSMode) { if (pDevice->bEnablePSMode) {
for (uIdx = 0; uIdx < TYPE_MAXTD; uIdx++) { for (uIdx = 0; uIdx < TYPE_MAXTD; uIdx++) {
...@@ -315,9 +313,8 @@ PSbSendNullPacket( ...@@ -315,9 +313,8 @@ PSbSendNullPacket(
)); ));
} }
if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA) { if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA)
pTxPacket->p80211Header->sA3.wFrameCtl |= cpu_to_le16((unsigned short)WLAN_SET_FC_TODS(1)); pTxPacket->p80211Header->sA3.wFrameCtl |= cpu_to_le16((unsigned short)WLAN_SET_FC_TODS(1));
}
memcpy(pTxPacket->p80211Header->sA3.abyAddr1, pMgmt->abyCurrBSSID, WLAN_ADDR_LEN); memcpy(pTxPacket->p80211Header->sA3.abyAddr1, pMgmt->abyCurrBSSID, WLAN_ADDR_LEN);
memcpy(pTxPacket->p80211Header->sA3.abyAddr2, pMgmt->abyMACAddr, WLAN_ADDR_LEN); memcpy(pTxPacket->p80211Header->sA3.abyAddr2, pMgmt->abyMACAddr, WLAN_ADDR_LEN);
...@@ -353,9 +350,8 @@ PSbIsNextTBTTWakeUp( ...@@ -353,9 +350,8 @@ PSbIsNextTBTTWakeUp(
bool bWakeUp = false; bool bWakeUp = false;
if (pMgmt->wListenInterval >= 2) { if (pMgmt->wListenInterval >= 2) {
if (pMgmt->wCountToWakeUp == 0) { if (pMgmt->wCountToWakeUp == 0)
pMgmt->wCountToWakeUp = pMgmt->wListenInterval; pMgmt->wCountToWakeUp = pMgmt->wListenInterval;
}
pMgmt->wCountToWakeUp--; pMgmt->wCountToWakeUp--;
......
...@@ -834,13 +834,12 @@ bool RFvWriteWakeProgSyn(unsigned long dwIoBase, unsigned char byRFType, unsigne ...@@ -834,13 +834,12 @@ bool RFvWriteWakeProgSyn(unsigned long dwIoBase, unsigned char byRFType, unsigne
byInitCount = CB_AL2230_INIT_SEQ + 2; // Init Reg + Channel Reg (2) byInitCount = CB_AL2230_INIT_SEQ + 2; // Init Reg + Channel Reg (2)
bySleepCount = 0; bySleepCount = 0;
if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount)) { if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
return false; return false;
}
for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++) { for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++)
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230InitTable[ii]); MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230InitTable[ii]);
}
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable0[uChannel-1]); MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable0[uChannel-1]);
ii++; ii++;
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable1[uChannel-1]); MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable1[uChannel-1]);
...@@ -851,19 +850,16 @@ bool RFvWriteWakeProgSyn(unsigned long dwIoBase, unsigned char byRFType, unsigne ...@@ -851,19 +850,16 @@ bool RFvWriteWakeProgSyn(unsigned long dwIoBase, unsigned char byRFType, unsigne
case RF_AIROHA7230: case RF_AIROHA7230:
byInitCount = CB_AL7230_INIT_SEQ + 3; // Init Reg + Channel Reg (3) byInitCount = CB_AL7230_INIT_SEQ + 3; // Init Reg + Channel Reg (3)
bySleepCount = 0; bySleepCount = 0;
if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount)) { if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
return false; return false;
}
if (uChannel <= CB_MAX_CHANNEL_24G) { if (uChannel <= CB_MAX_CHANNEL_24G) {
for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++) { for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++)
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTable[ii]); MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTable[ii]);
}
} else { } else {
for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++) { for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++)
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTableAMode[ii]); MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTableAMode[ii]);
} }
}
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable0[uChannel-1]); MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable0[uChannel-1]);
ii++; ii++;
...@@ -911,12 +907,11 @@ bool RFbSetPower( ...@@ -911,12 +907,11 @@ bool RFbSetPower(
unsigned char byDec = 0; unsigned char byDec = 0;
unsigned char byPwrdBm = 0; unsigned char byPwrdBm = 0;
if (pDevice->dwDiagRefCount != 0) { if (pDevice->dwDiagRefCount != 0)
return true; return true;
}
if ((uCH < 1) || (uCH > CB_MAX_CHANNEL)) { if ((uCH < 1) || (uCH > CB_MAX_CHANNEL))
return false; return false;
}
switch (uRATE) { switch (uRATE) {
case RATE_1M: case RATE_1M:
...@@ -930,14 +925,14 @@ bool RFbSetPower( ...@@ -930,14 +925,14 @@ bool RFbSetPower(
case RATE_9M: case RATE_9M:
case RATE_18M: case RATE_18M:
byPwr = pDevice->abyOFDMPwrTbl[uCH]; byPwr = pDevice->abyOFDMPwrTbl[uCH];
if (pDevice->byRFType == RF_UW2452) { if (pDevice->byRFType == RF_UW2452)
byDec = byPwr + 14; byDec = byPwr + 14;
} else { else
byDec = byPwr + 10; byDec = byPwr + 10;
}
if (byDec >= pDevice->byMaxPwrLevel) { if (byDec >= pDevice->byMaxPwrLevel)
byDec = pDevice->byMaxPwrLevel-1; byDec = pDevice->byMaxPwrLevel-1;
}
if (pDevice->byRFType == RF_UW2452) { if (pDevice->byRFType == RF_UW2452) {
byPwrdBm = byDec - byPwr; byPwrdBm = byDec - byPwr;
byPwrdBm /= 3; byPwrdBm /= 3;
...@@ -945,6 +940,7 @@ bool RFbSetPower( ...@@ -945,6 +940,7 @@ bool RFbSetPower(
byPwrdBm = byDec - byPwr; byPwrdBm = byDec - byPwr;
byPwrdBm >>= 1; byPwrdBm >>= 1;
} }
byPwrdBm += pDevice->abyOFDMDefaultPwr[uCH]; byPwrdBm += pDevice->abyOFDMDefaultPwr[uCH];
byPwr = byDec; byPwr = byDec;
break; break;
...@@ -957,14 +953,13 @@ bool RFbSetPower( ...@@ -957,14 +953,13 @@ bool RFbSetPower(
break; break;
} }
if (pDevice->byCurPwr == byPwr) { if (pDevice->byCurPwr == byPwr)
return true; return true;
}
bResult = RFbRawSetPower(pDevice, byPwr, uRATE); bResult = RFbRawSetPower(pDevice, byPwr, uRATE);
if (bResult) { if (bResult)
pDevice->byCurPwr = byPwr; pDevice->byCurPwr = byPwr;
}
return bResult; return bResult;
} }
...@@ -991,17 +986,17 @@ bool RFbRawSetPower( ...@@ -991,17 +986,17 @@ bool RFbRawSetPower(
bool bResult = true; bool bResult = true;
unsigned long dwMax7230Pwr = 0; unsigned long dwMax7230Pwr = 0;
if (byPwr >= pDevice->byMaxPwrLevel) { if (byPwr >= pDevice->byMaxPwrLevel)
return false; return false;
}
switch (pDevice->byRFType) { switch (pDevice->byRFType) {
case RF_AIROHA: case RF_AIROHA:
bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]); bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]);
if (uRATE <= RATE_11M) { if (uRATE <= RATE_11M)
bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0001B400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW); bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0001B400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
} else { else
bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW); bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
}
break; break;
case RF_AL2230S: case RF_AL2230S:
......
This diff is collapsed.
...@@ -157,11 +157,11 @@ unsigned int rotr1(unsigned int a) ...@@ -157,11 +157,11 @@ unsigned int rotr1(unsigned int a)
{ {
unsigned int b; unsigned int b;
if ((a & 0x01) == 0x01) { if ((a & 0x01) == 0x01)
b = (a >> 1) | 0x8000; b = (a >> 1) | 0x8000;
} else { else
b = (a >> 1) & 0x7fff; b = (a >> 1) & 0x7fff;
}
b = b % 65536; b = b % 65536;
return b; return b;
} }
......
...@@ -151,9 +151,9 @@ VNTWIFIpGetCurrentChannel( ...@@ -151,9 +151,9 @@ VNTWIFIpGetCurrentChannel(
) )
{ {
PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle; PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle;
if (pMgmtHandle != NULL) { if (pMgmtHandle != NULL)
return pMgmt->uCurrChannel; return pMgmt->uCurrChannel;
}
return 0; return 0;
} }
...@@ -208,17 +208,17 @@ VNTWIFIbyGetMaxSupportRate( ...@@ -208,17 +208,17 @@ VNTWIFIbyGetMaxSupportRate(
if (pSupportRateIEs) { if (pSupportRateIEs) {
for (ii = 0; ii < pSupportRateIEs->len; ii++) { for (ii = 0; ii < pSupportRateIEs->len; ii++) {
bySupportRate = DATARATEbyGetRateIdx(pSupportRateIEs->abyRates[ii]); bySupportRate = DATARATEbyGetRateIdx(pSupportRateIEs->abyRates[ii]);
if (bySupportRate > byMaxSupportRate) { if (bySupportRate > byMaxSupportRate)
byMaxSupportRate = bySupportRate; byMaxSupportRate = bySupportRate;
}
} }
} }
if (pExtSupportRateIEs) { if (pExtSupportRateIEs) {
for (ii = 0; ii < pExtSupportRateIEs->len; ii++) { for (ii = 0; ii < pExtSupportRateIEs->len; ii++) {
bySupportRate = DATARATEbyGetRateIdx(pExtSupportRateIEs->abyRates[ii]); bySupportRate = DATARATEbyGetRateIdx(pExtSupportRateIEs->abyRates[ii]);
if (bySupportRate > byMaxSupportRate) { if (bySupportRate > byMaxSupportRate)
byMaxSupportRate = bySupportRate; byMaxSupportRate = bySupportRate;
}
} }
} }
...@@ -359,12 +359,11 @@ VNTWIFIbConfigPhyMode( ...@@ -359,12 +359,11 @@ VNTWIFIbConfigPhyMode(
if ((ePhyType != PHY_TYPE_AUTO) && if ((ePhyType != PHY_TYPE_AUTO) &&
(ePhyType != pMgmt->eCurrentPHYMode)) { (ePhyType != pMgmt->eCurrentPHYMode)) {
if (CARDbSetPhyParameter(pMgmt->pAdapter, ePhyType, 0, 0, NULL, NULL) == true) { if (CARDbSetPhyParameter(pMgmt->pAdapter, ePhyType, 0, 0, NULL, NULL) == true)
pMgmt->eCurrentPHYMode = ePhyType; pMgmt->eCurrentPHYMode = ePhyType;
} else { else
return false; return false;
} }
}
pMgmt->eConfigPHYMode = ePhyType; pMgmt->eConfigPHYMode = ePhyType;
return true; return true;
} }
...@@ -377,9 +376,8 @@ VNTWIFIbGetConfigPhyMode( ...@@ -377,9 +376,8 @@ VNTWIFIbGetConfigPhyMode(
{ {
PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle; PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle;
if ((pMgmt != NULL) && (pePhyType != NULL)) { if ((pMgmt != NULL) && (pePhyType != NULL))
*(PCARD_PHY_TYPE)pePhyType = pMgmt->eConfigPHYMode; *(PCARD_PHY_TYPE)pePhyType = pMgmt->eConfigPHYMode;
}
} }
/*+ /*+
...@@ -425,12 +423,12 @@ VNTWIFIvQueryBSSList(void *pMgmtHandle, unsigned int *puBSSCount, void **pvFirst ...@@ -425,12 +423,12 @@ VNTWIFIvQueryBSSList(void *pMgmtHandle, unsigned int *puBSSCount, void **pvFirst
for (ii = 0; ii < MAX_BSS_NUM; ii++) { for (ii = 0; ii < MAX_BSS_NUM; ii++) {
pBSS = &(pMgmt->sBSSList[ii]); pBSS = &(pMgmt->sBSSList[ii]);
if (!pBSS->bActive) { if (!pBSS->bActive)
continue; continue;
}
if (*pvFirstBSS == NULL) { if (*pvFirstBSS == NULL)
*pvFirstBSS = &(pMgmt->sBSSList[ii]); *pvFirstBSS = &(pMgmt->sBSSList[ii]);
}
uCount++; uCount++;
} }
*puBSSCount = uCount; *puBSSCount = uCount;
...@@ -450,9 +448,9 @@ VNTWIFIvGetNextBSS( ...@@ -450,9 +448,9 @@ VNTWIFIvGetNextBSS(
while (*pvNextBSS == NULL) { while (*pvNextBSS == NULL) {
pBSS++; pBSS++;
if (pBSS > &(pMgmt->sBSSList[MAX_BSS_NUM])) { if (pBSS > &(pMgmt->sBSSList[MAX_BSS_NUM]))
return; return;
}
if (pBSS->bActive == true) { if (pBSS->bActive == true) {
*pvNextBSS = pBSS; *pvNextBSS = pBSS;
return; return;
...@@ -487,10 +485,10 @@ VNTWIFIvUpdateNodeTxCounter( ...@@ -487,10 +485,10 @@ VNTWIFIvUpdateNodeTxCounter(
if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) || if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) ||
(pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) { (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) {
if (BSSDBbIsSTAInNodeDB(pMgmt, pbyDestAddress, &uNodeIndex) == false) { if (BSSDBbIsSTAInNodeDB(pMgmt, pbyDestAddress, &uNodeIndex) == false)
return; return;
} }
}
pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts++; pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts++;
if (bTxOk) { if (bTxOk) {
// transmit success, TxAttempts at least plus one // transmit success, TxAttempts at least plus one
...@@ -500,9 +498,9 @@ VNTWIFIvUpdateNodeTxCounter( ...@@ -500,9 +498,9 @@ VNTWIFIvUpdateNodeTxCounter(
pMgmt->sNodeDBTable[uNodeIndex].uTxFailures++; pMgmt->sNodeDBTable[uNodeIndex].uTxFailures++;
} }
pMgmt->sNodeDBTable[uNodeIndex].uTxRetry += pbyTxFailCount[MAX_RATE]; pMgmt->sNodeDBTable[uNodeIndex].uTxRetry += pbyTxFailCount[MAX_RATE];
for (ii = 0; ii < MAX_RATE; ii++) { for (ii = 0; ii < MAX_RATE; ii++)
pMgmt->sNodeDBTable[uNodeIndex].uTxFail[ii] += pbyTxFailCount[ii]; pMgmt->sNodeDBTable[uNodeIndex].uTxFail[ii] += pbyTxFailCount[ii];
}
return; return;
} }
...@@ -533,11 +531,11 @@ VNTWIFIvGetTxRate( ...@@ -533,11 +531,11 @@ VNTWIFIvGetTxRate(
pSupportRateIEs = (PWLAN_IE_SUPP_RATES) (pMgmt->sNodeDBTable[uNodeIndex].abyCurrSuppRates); pSupportRateIEs = (PWLAN_IE_SUPP_RATES) (pMgmt->sNodeDBTable[uNodeIndex].abyCurrSuppRates);
pExtSupportRateIEs = (PWLAN_IE_SUPP_RATES) (pMgmt->sNodeDBTable[uNodeIndex].abyCurrExtSuppRates); pExtSupportRateIEs = (PWLAN_IE_SUPP_RATES) (pMgmt->sNodeDBTable[uNodeIndex].abyCurrExtSuppRates);
} else { } else {
if (pMgmt->eCurrentPHYMode != PHY_TYPE_11A) { if (pMgmt->eCurrentPHYMode != PHY_TYPE_11A)
wTxDataRate = RATE_2M; wTxDataRate = RATE_2M;
} else { else
wTxDataRate = RATE_24M; wTxDataRate = RATE_24M;
}
pSupportRateIEs = (PWLAN_IE_SUPP_RATES) pMgmt->abyCurrSuppRates; pSupportRateIEs = (PWLAN_IE_SUPP_RATES) pMgmt->abyCurrSuppRates;
pExtSupportRateIEs = (PWLAN_IE_SUPP_RATES) pMgmt->abyCurrExtSuppRates; pExtSupportRateIEs = (PWLAN_IE_SUPP_RATES) pMgmt->abyCurrExtSuppRates;
} }
...@@ -556,9 +554,9 @@ VNTWIFIvGetTxRate( ...@@ -556,9 +554,9 @@ VNTWIFIvGetTxRate(
pSupportRateIEs, pSupportRateIEs,
pExtSupportRateIEs pExtSupportRateIEs
); );
if (byACKRate > (unsigned char) wTxDataRate) { if (byACKRate > (unsigned char) wTxDataRate)
byACKRate = (unsigned char) wTxDataRate; byACKRate = (unsigned char) wTxDataRate;
}
byCCKBasicRate = VNTWIFIbyGetACKTxRate(RATE_11M, byCCKBasicRate = VNTWIFIbyGetACKTxRate(RATE_11M,
pSupportRateIEs, pSupportRateIEs,
pExtSupportRateIEs pExtSupportRateIEs
...@@ -582,11 +580,10 @@ VNTWIFIbyGetKeyCypher( ...@@ -582,11 +580,10 @@ VNTWIFIbyGetKeyCypher(
{ {
PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle; PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle;
if (bGroupKey) { if (bGroupKey)
return pMgmt->byCSSGK; return pMgmt->byCSSGK;
} else { else
return pMgmt->byCSSPK; return pMgmt->byCSSPK;
}
} }
bool bool
...@@ -598,9 +595,9 @@ VNTWIFIbSetPMKIDCache( ...@@ -598,9 +595,9 @@ VNTWIFIbSetPMKIDCache(
{ {
PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject;
if (ulCount > MAX_PMKID_CACHE) { if (ulCount > MAX_PMKID_CACHE)
return false; return false;
}
pMgmt->gsPMKIDCache.BSSIDInfoCount = ulCount; pMgmt->gsPMKIDCache.BSSIDInfoCount = ulCount;
memcpy(pMgmt->gsPMKIDCache.BSSIDInfo, pPMKIDInfo, (ulCount*sizeof(PMKIDInfo))); memcpy(pMgmt->gsPMKIDCache.BSSIDInfo, pPMKIDInfo, (ulCount*sizeof(PMKIDInfo)));
return true; return true;
...@@ -615,15 +612,14 @@ VNTWIFIwGetMaxSupportRate( ...@@ -615,15 +612,14 @@ VNTWIFIwGetMaxSupportRate(
PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject;
for (wRate = RATE_54M; wRate > RATE_1M; wRate--) { for (wRate = RATE_54M; wRate > RATE_1M; wRate--) {
if (pMgmt->sNodeDBTable[0].wSuppRate & (1<<wRate)) { if (pMgmt->sNodeDBTable[0].wSuppRate & (1<<wRate))
return wRate; return wRate;
} }
}
if (pMgmt->eCurrentPHYMode == PHY_TYPE_11A) { if (pMgmt->eCurrentPHYMode == PHY_TYPE_11A)
return RATE_6M; return RATE_6M;
} else { else
return RATE_1M; return RATE_1M;
}
} }
void void
......
...@@ -127,14 +127,13 @@ vAdHocBeaconStop(PSDevice pDevice) ...@@ -127,14 +127,13 @@ vAdHocBeaconStop(PSDevice pDevice)
(pMgmt->uScanChannel > CB_MAX_CHANNEL_24G)) { (pMgmt->uScanChannel > CB_MAX_CHANNEL_24G)) {
bStop = true; bStop = true;
} }
if (pMgmt->uIBSSChannel > CB_MAX_CHANNEL_24G) { if (pMgmt->uIBSSChannel > CB_MAX_CHANNEL_24G)
bStop = true; bStop = true;
}
} }
if (bStop) { if (bStop)
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX); MACvRegBitsOff(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX);
}
} /* vAdHocBeaconStop */ } /* vAdHocBeaconStop */
/* /*
...@@ -196,13 +195,13 @@ s_vProbeChannel( ...@@ -196,13 +195,13 @@ s_vProbeChannel(
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
unsigned int ii; unsigned int ii;
if (pDevice->eCurrentPHYType == PHY_TYPE_11A) { if (pDevice->eCurrentPHYType == PHY_TYPE_11A)
pbyRate = &abyCurrSuppRatesA[0]; pbyRate = &abyCurrSuppRatesA[0];
} else if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { else if (pDevice->eCurrentPHYType == PHY_TYPE_11B)
pbyRate = &abyCurrSuppRatesB[0]; pbyRate = &abyCurrSuppRatesB[0];
} else { else
pbyRate = &abyCurrSuppRatesG[0]; pbyRate = &abyCurrSuppRatesG[0];
}
// build an assocreq frame and send it // build an assocreq frame and send it
pTxPacket = s_MgrMakeProbeRequest pTxPacket = s_MgrMakeProbeRequest
( (
...@@ -216,13 +215,12 @@ s_vProbeChannel( ...@@ -216,13 +215,12 @@ s_vProbeChannel(
if (pTxPacket != NULL) { if (pTxPacket != NULL) {
for (ii = 0; ii < 2; ii++) { for (ii = 0; ii < 2; ii++) {
if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) { if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request sending fail.. \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request sending fail.. \n");
} else { else
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request is sending.. \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request is sending.. \n");
} }
} }
}
} }
/*+ /*+
...@@ -359,11 +357,11 @@ vCommandTimer( ...@@ -359,11 +357,11 @@ vCommandTimer(
// Set channel back // Set channel back
set_channel(pMgmt->pAdapter, pMgmt->uCurrChannel); set_channel(pMgmt->pAdapter, pMgmt->uCurrChannel);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Scanning, set back to channel: [%d]\n", pMgmt->uCurrChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Scanning, set back to channel: [%d]\n", pMgmt->uCurrChannel);
if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)
CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_ADHOC); CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_ADHOC);
} else { else
CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_INFRASTRUCTURE); CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_INFRASTRUCTURE);
}
vAdHocBeaconRestart(pDevice); vAdHocBeaconRestart(pDevice);
s_bCommandComplete(pDevice); s_bCommandComplete(pDevice);
...@@ -389,11 +387,11 @@ vCommandTimer( ...@@ -389,11 +387,11 @@ vCommandTimer(
vAdHocBeaconStop(pDevice); vAdHocBeaconStop(pDevice);
if (set_channel(pMgmt->pAdapter, pMgmt->uScanChannel)) { if (set_channel(pMgmt->pAdapter, pMgmt->uScanChannel))
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SCAN Channel: %d\n", pMgmt->uScanChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SCAN Channel: %d\n", pMgmt->uScanChannel);
} else { else
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SET SCAN Channel Fail: %d\n", pMgmt->uScanChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SET SCAN Channel Fail: %d\n", pMgmt->uScanChannel);
}
CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_UNKNOWN); CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_UNKNOWN);
pMgmt->uScanChannel++; pMgmt->uScanChannel++;
//2008-8-4 <modify> by chester //2008-8-4 <modify> by chester
...@@ -426,11 +424,10 @@ vCommandTimer( ...@@ -426,11 +424,10 @@ vCommandTimer(
// Set channel back // Set channel back
set_channel(pMgmt->pAdapter, pMgmt->uCurrChannel); set_channel(pMgmt->pAdapter, pMgmt->uCurrChannel);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Scanning, set back to channel: [%d]\n", pMgmt->uCurrChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Scanning, set back to channel: [%d]\n", pMgmt->uCurrChannel);
if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)
CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_ADHOC); CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_ADHOC);
} else { else
CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_INFRASTRUCTURE); CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_INFRASTRUCTURE);
}
pMgmt->eScanState = WMAC_NO_SCANNING; pMgmt->eScanState = WMAC_NO_SCANNING;
vAdHocBeaconRestart(pDevice); vAdHocBeaconRestart(pDevice);
...@@ -534,9 +531,9 @@ vCommandTimer( ...@@ -534,9 +531,9 @@ vCommandTimer(
if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_JOINTED)) { if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_JOINTED)) {
// Call mgr to begin the deauthentication // Call mgr to begin the deauthentication
// reason = (3) because sta has left ESS // reason = (3) because sta has left ESS
if (pMgmt->eCurrState >= WMAC_STATE_AUTH) { if (pMgmt->eCurrState >= WMAC_STATE_AUTH)
vMgrDeAuthenBeginSta((void *)pDevice, pMgmt, pMgmt->abyCurrBSSID, (3), &Status); vMgrDeAuthenBeginSta((void *)pDevice, pMgmt, pMgmt->abyCurrBSSID, (3), &Status);
}
// Call mgr to begin the authentication // Call mgr to begin the authentication
vMgrAuthenBeginSta((void *)pDevice, pMgmt, &Status); vMgrAuthenBeginSta((void *)pDevice, pMgmt, &Status);
if (Status == CMD_STATUS_SUCCESS) { if (Status == CMD_STATUS_SUCCESS) {
...@@ -551,9 +548,9 @@ vCommandTimer( ...@@ -551,9 +548,9 @@ vCommandTimer(
// if Adhoc mode // if Adhoc mode
else if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { else if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
if (pMgmt->eCurrState == WMAC_STATE_JOINTED) { if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
if (netif_queue_stopped(pDevice->dev)) { if (netif_queue_stopped(pDevice->dev))
netif_wake_queue(pDevice->dev); netif_wake_queue(pDevice->dev);
}
pDevice->bLinkPass = true; pDevice->bLinkPass = true;
pMgmt->sNodeDBTable[0].bActive = true; pMgmt->sNodeDBTable[0].bActive = true;
...@@ -562,9 +559,9 @@ vCommandTimer( ...@@ -562,9 +559,9 @@ vCommandTimer(
} else { } else {
// start own IBSS // start own IBSS
vMgrCreateOwnIBSS((void *)pDevice, &Status); vMgrCreateOwnIBSS((void *)pDevice, &Status);
if (Status != CMD_STATUS_SUCCESS) { if (Status != CMD_STATUS_SUCCESS)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " WLAN_CMD_IBSS_CREATE fail ! \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " WLAN_CMD_IBSS_CREATE fail ! \n");
}
BSSvAddMulticastNode(pDevice); BSSvAddMulticastNode(pDevice);
} }
} }
...@@ -574,13 +571,13 @@ vCommandTimer( ...@@ -574,13 +571,13 @@ vCommandTimer(
pMgmt->eConfigMode == WMAC_CONFIG_AUTO) { pMgmt->eConfigMode == WMAC_CONFIG_AUTO) {
// start own IBSS // start own IBSS
vMgrCreateOwnIBSS((void *)pDevice, &Status); vMgrCreateOwnIBSS((void *)pDevice, &Status);
if (Status != CMD_STATUS_SUCCESS) { if (Status != CMD_STATUS_SUCCESS)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " WLAN_CMD_IBSS_CREATE fail ! \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " WLAN_CMD_IBSS_CREATE fail ! \n");
}
BSSvAddMulticastNode(pDevice); BSSvAddMulticastNode(pDevice);
if (netif_queue_stopped(pDevice->dev)) { if (netif_queue_stopped(pDevice->dev))
netif_wake_queue(pDevice->dev); netif_wake_queue(pDevice->dev);
}
pDevice->bLinkPass = true; pDevice->bLinkPass = true;
} else { } else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disconnect SSID none\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disconnect SSID none\n");
...@@ -632,12 +629,12 @@ vCommandTimer( ...@@ -632,12 +629,12 @@ vCommandTimer(
case WLAN_ASSOCIATE_WAIT: case WLAN_ASSOCIATE_WAIT:
if (pMgmt->eCurrState == WMAC_STATE_ASSOC) { if (pMgmt->eCurrState == WMAC_STATE_ASSOC) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "eCurrState == WMAC_STATE_ASSOC\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "eCurrState == WMAC_STATE_ASSOC\n");
if (pDevice->ePSMode != WMAC_POWER_CAM) { if (pDevice->ePSMode != WMAC_POWER_CAM)
PSvEnablePowerSaving((void *)pDevice, pMgmt->wListenInterval); PSvEnablePowerSaving((void *)pDevice, pMgmt->wListenInterval);
}
if (pMgmt->eAuthenMode >= WMAC_AUTH_WPA) { if (pMgmt->eAuthenMode >= WMAC_AUTH_WPA)
KeybRemoveAllKey(&(pDevice->sKey), pDevice->abyBSSID, pDevice->PortOffset); KeybRemoveAllKey(&(pDevice->sKey), pDevice->abyBSSID, pDevice->PortOffset);
}
pDevice->bLinkPass = true; pDevice->bLinkPass = true;
pDevice->byLinkWaitCount = 0; pDevice->byLinkWaitCount = 0;
pDevice->byReAssocCount = 0; pDevice->byReAssocCount = 0;
...@@ -646,9 +643,9 @@ vCommandTimer( ...@@ -646,9 +643,9 @@ vCommandTimer(
BBvSetFOE(pDevice->PortOffset); BBvSetFOE(pDevice->PortOffset);
PSbSendNullPacket(pDevice); PSbSendNullPacket(pDevice);
} }
if (netif_queue_stopped(pDevice->dev)) { if (netif_queue_stopped(pDevice->dev))
netif_wake_queue(pDevice->dev); netif_wake_queue(pDevice->dev);
}
#ifdef TxInSleep #ifdef TxInSleep
if (pDevice->IsTxDataTrigger) { //TxDataTimer is not triggered at the first time if (pDevice->IsTxDataTrigger) { //TxDataTimer is not triggered at the first time
del_timer(&pDevice->sTimerTxData); del_timer(&pDevice->sTimerTxData);
...@@ -658,8 +655,8 @@ vCommandTimer( ...@@ -658,8 +655,8 @@ vCommandTimer(
pDevice->sTimerTxData.expires = RUN_AT(10*HZ); //10s callback pDevice->sTimerTxData.expires = RUN_AT(10*HZ); //10s callback
pDevice->fTxDataInSleep = false; pDevice->fTxDataInSleep = false;
pDevice->nTxDataTimeCout = 0; pDevice->nTxDataTimeCout = 0;
} else {
} }
pDevice->IsTxDataTrigger = true; pDevice->IsTxDataTrigger = true;
add_timer(&pDevice->sTimerTxData); add_timer(&pDevice->sTimerTxData);
#endif #endif
...@@ -694,17 +691,17 @@ vCommandTimer( ...@@ -694,17 +691,17 @@ vCommandTimer(
pDevice->bFixRate = false; pDevice->bFixRate = false;
vMgrCreateOwnIBSS((void *)pDevice, &Status); vMgrCreateOwnIBSS((void *)pDevice, &Status);
if (Status != CMD_STATUS_SUCCESS) { if (Status != CMD_STATUS_SUCCESS)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " vMgrCreateOwnIBSS fail ! \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " vMgrCreateOwnIBSS fail ! \n");
}
// alway turn off unicast bit // alway turn off unicast bit
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_RCR, RCR_UNICAST); MACvRegBitsOff(pDevice->PortOffset, MAC_REG_RCR, RCR_UNICAST);
pDevice->byRxMode &= ~RCR_UNICAST; pDevice->byRxMode &= ~RCR_UNICAST;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode = %x\n", pDevice->byRxMode); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode = %x\n", pDevice->byRxMode);
BSSvAddMulticastNode(pDevice); BSSvAddMulticastNode(pDevice);
if (netif_queue_stopped(pDevice->dev)) { if (netif_queue_stopped(pDevice->dev))
netif_wake_queue(pDevice->dev); netif_wake_queue(pDevice->dev);
}
pDevice->bLinkPass = true; pDevice->bLinkPass = true;
add_timer(&pMgmt->sTimerSecondCallback); add_timer(&pMgmt->sTimerSecondCallback);
} }
...@@ -721,9 +718,9 @@ vCommandTimer( ...@@ -721,9 +718,9 @@ vCommandTimer(
} else { } else {
pDevice->bMoreData = true; pDevice->bMoreData = true;
} }
if (!device_dma0_xmit(pDevice, skb, 0)) { if (!device_dma0_xmit(pDevice, skb, 0))
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Multicast ps tx fail \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Multicast ps tx fail \n");
}
pMgmt->sNodeDBTable[0].wEnQueueCnt--; pMgmt->sNodeDBTable[0].wEnQueueCnt--;
} }
} }
...@@ -743,9 +740,9 @@ vCommandTimer( ...@@ -743,9 +740,9 @@ vCommandTimer(
} else { } else {
pDevice->bMoreData = true; pDevice->bMoreData = true;
} }
if (!device_dma0_xmit(pDevice, skb, ii)) { if (!device_dma0_xmit(pDevice, skb, ii))
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "sta ps tx fail \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "sta ps tx fail \n");
}
pMgmt->sNodeDBTable[ii].wEnQueueCnt--; pMgmt->sNodeDBTable[ii].wEnQueueCnt--;
// check if sta ps enabled, and wait next pspoll. // check if sta ps enabled, and wait next pspoll.
// if sta ps disable, then send all pending buffers. // if sta ps disable, then send all pending buffers.
...@@ -831,11 +828,11 @@ s_bCommandComplete( ...@@ -831,11 +828,11 @@ s_bCommandComplete(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "eCommandState= WLAN_CMD_BSSID_SCAN\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "eCommandState= WLAN_CMD_BSSID_SCAN\n");
pDevice->eCommandState = WLAN_CMD_SCAN_START; pDevice->eCommandState = WLAN_CMD_SCAN_START;
pMgmt->uScanChannel = 0; pMgmt->uScanChannel = 0;
if (pSSID->len != 0) { if (pSSID->len != 0)
memcpy(pMgmt->abyScanSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); memcpy(pMgmt->abyScanSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
} else { else
memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
}
break; break;
case WLAN_CMD_SSID: case WLAN_CMD_SSID:
pDevice->eCommandState = WLAN_CMD_SSID_START; pDevice->eCommandState = WLAN_CMD_SSID_START;
...@@ -881,9 +878,9 @@ bool bScheduleCommand( ...@@ -881,9 +878,9 @@ bool bScheduleCommand(
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
if (pDevice->cbFreeCmdQueue == 0) { if (pDevice->cbFreeCmdQueue == 0)
return false; return false;
}
pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].eCmd = eCommand; pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].eCmd = eCommand;
pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = true; pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = true;
memset(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, 0 , WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); memset(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, 0 , WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
......
...@@ -191,10 +191,9 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i ...@@ -191,10 +191,9 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i
pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wFragNum = (pMACHeader->wSeqCtl & 0x000F); pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wFragNum = (pMACHeader->wSeqCtl & 0x000F);
} else { } else {
pDevice->uCurrentDFCBIdx = WCTLuInsertDFCB(pDevice, pMACHeader); pDevice->uCurrentDFCBIdx = WCTLuInsertDFCB(pDevice, pMACHeader);
if (pDevice->uCurrentDFCBIdx == pDevice->cbDFCB) { if (pDevice->uCurrentDFCBIdx == pDevice->cbDFCB)
return false; return false;
} }
}
// reserve 4 byte to match MAC RX Buffer // reserve 4 byte to match MAC RX Buffer
pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer = (unsigned char *)(pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].skb->data + 4); pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer = (unsigned char *)(pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].skb->data + 4);
memcpy(pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer, pMACHeader, cbFrameLength); memcpy(pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer, pMACHeader, cbFrameLength);
......
This diff is collapsed.
...@@ -121,9 +121,9 @@ WPA2vParseRSN( ...@@ -121,9 +121,9 @@ WPA2vParseRSN(
WPA2_ClearRSN(pBSSNode); WPA2_ClearRSN(pBSSNode);
if (pRSN->len == 2) { // ver(2) if (pRSN->len == 2) { // ver(2)
if ((pRSN->byElementID == WLAN_EID_RSN) && (pRSN->wVersion == 1)) { if ((pRSN->byElementID == WLAN_EID_RSN) && (pRSN->wVersion == 1))
pBSSNode->bWPA2Valid = true; pBSSNode->bWPA2Valid = true;
}
return; return;
} }
...@@ -267,9 +267,9 @@ WPA2uSetIEs( ...@@ -267,9 +267,9 @@ WPA2uSetIEs(
unsigned int ii = 0; unsigned int ii = 0;
unsigned short *pwPMKID = NULL; unsigned short *pwPMKID = NULL;
if (pRSNIEs == NULL) { if (pRSNIEs == NULL)
return 0; return 0;
}
if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) ||
(pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) && (pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) &&
(pMgmt->pCurrBSS != NULL)) { (pMgmt->pCurrBSS != NULL)) {
...@@ -282,15 +282,14 @@ WPA2uSetIEs( ...@@ -282,15 +282,14 @@ WPA2uSetIEs(
pRSNIEs->abyRSN[0] = 0x00; pRSNIEs->abyRSN[0] = 0x00;
pRSNIEs->abyRSN[1] = 0x0F; pRSNIEs->abyRSN[1] = 0x0F;
pRSNIEs->abyRSN[2] = 0xAC; pRSNIEs->abyRSN[2] = 0xAC;
if (pMgmt->byCSSGK == KEY_CTL_WEP) { if (pMgmt->byCSSGK == KEY_CTL_WEP)
pRSNIEs->abyRSN[3] = pMgmt->pCurrBSS->byCSSGK; pRSNIEs->abyRSN[3] = pMgmt->pCurrBSS->byCSSGK;
} else if (pMgmt->byCSSGK == KEY_CTL_TKIP) { else if (pMgmt->byCSSGK == KEY_CTL_TKIP)
pRSNIEs->abyRSN[3] = WLAN_11i_CSS_TKIP; pRSNIEs->abyRSN[3] = WLAN_11i_CSS_TKIP;
} else if (pMgmt->byCSSGK == KEY_CTL_CCMP) { else if (pMgmt->byCSSGK == KEY_CTL_CCMP)
pRSNIEs->abyRSN[3] = WLAN_11i_CSS_CCMP; pRSNIEs->abyRSN[3] = WLAN_11i_CSS_CCMP;
} else { else
pRSNIEs->abyRSN[3] = WLAN_11i_CSS_UNKNOWN; pRSNIEs->abyRSN[3] = WLAN_11i_CSS_UNKNOWN;
}
// Pairwise Key Cipher Suite // Pairwise Key Cipher Suite
pRSNIEs->abyRSN[4] = 1; pRSNIEs->abyRSN[4] = 1;
...@@ -298,15 +297,15 @@ WPA2uSetIEs( ...@@ -298,15 +297,15 @@ WPA2uSetIEs(
pRSNIEs->abyRSN[6] = 0x00; pRSNIEs->abyRSN[6] = 0x00;
pRSNIEs->abyRSN[7] = 0x0F; pRSNIEs->abyRSN[7] = 0x0F;
pRSNIEs->abyRSN[8] = 0xAC; pRSNIEs->abyRSN[8] = 0xAC;
if (pMgmt->byCSSPK == KEY_CTL_TKIP) { if (pMgmt->byCSSPK == KEY_CTL_TKIP)
pRSNIEs->abyRSN[9] = WLAN_11i_CSS_TKIP; pRSNIEs->abyRSN[9] = WLAN_11i_CSS_TKIP;
} else if (pMgmt->byCSSPK == KEY_CTL_CCMP) { else if (pMgmt->byCSSPK == KEY_CTL_CCMP)
pRSNIEs->abyRSN[9] = WLAN_11i_CSS_CCMP; pRSNIEs->abyRSN[9] = WLAN_11i_CSS_CCMP;
} else if (pMgmt->byCSSPK == KEY_CTL_NONE) { else if (pMgmt->byCSSPK == KEY_CTL_NONE)
pRSNIEs->abyRSN[9] = WLAN_11i_CSS_USE_GROUP; pRSNIEs->abyRSN[9] = WLAN_11i_CSS_USE_GROUP;
} else { else
pRSNIEs->abyRSN[9] = WLAN_11i_CSS_UNKNOWN; pRSNIEs->abyRSN[9] = WLAN_11i_CSS_UNKNOWN;
}
pRSNIEs->len += 6; pRSNIEs->len += 6;
// Auth Key Management Suite // Auth Key Management Suite
...@@ -315,13 +314,13 @@ WPA2uSetIEs( ...@@ -315,13 +314,13 @@ WPA2uSetIEs(
pRSNIEs->abyRSN[12] = 0x00; pRSNIEs->abyRSN[12] = 0x00;
pRSNIEs->abyRSN[13] = 0x0F; pRSNIEs->abyRSN[13] = 0x0F;
pRSNIEs->abyRSN[14] = 0xAC; pRSNIEs->abyRSN[14] = 0xAC;
if (pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK) { if (pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)
pRSNIEs->abyRSN[15] = WLAN_11i_AKMSS_PSK; pRSNIEs->abyRSN[15] = WLAN_11i_AKMSS_PSK;
} else if (pMgmt->eAuthenMode == WMAC_AUTH_WPA2) { else if (pMgmt->eAuthenMode == WMAC_AUTH_WPA2)
pRSNIEs->abyRSN[15] = WLAN_11i_AKMSS_802_1X; pRSNIEs->abyRSN[15] = WLAN_11i_AKMSS_802_1X;
} else { else
pRSNIEs->abyRSN[15] = WLAN_11i_AKMSS_UNKNOWN; pRSNIEs->abyRSN[15] = WLAN_11i_AKMSS_UNKNOWN;
}
pRSNIEs->len += 6; pRSNIEs->len += 6;
// RSN Capabilities // RSN Capabilities
...@@ -347,12 +346,11 @@ WPA2uSetIEs( ...@@ -347,12 +346,11 @@ WPA2uSetIEs(
pbyBuffer += 16; pbyBuffer += 16;
} }
} }
if (*pwPMKID != 0) { if (*pwPMKID != 0)
pRSNIEs->len += (2 + (*pwPMKID)*16); pRSNIEs->len += (2 + (*pwPMKID)*16);
} else { else
pbyBuffer = &pRSNIEs->abyRSN[18]; pbyBuffer = &pRSNIEs->abyRSN[18];
} }
}
return pRSNIEs->len + WLAN_IEHDR_LEN; return pRSNIEs->len + WLAN_IEHDR_LEN;
} }
return 0; return 0;
......
...@@ -212,9 +212,9 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, ...@@ -212,9 +212,9 @@ int wpa_set_keys(PSDevice pDevice, void *ctx,
pDevice->byKeyIndex = 0; pDevice->byKeyIndex = 0;
pDevice->bTransmitKey = false; pDevice->bTransmitKey = false;
KeyvRemoveAllWEPKey(&(pDevice->sKey), pDevice->PortOffset); KeyvRemoveAllWEPKey(&(pDevice->sKey), pDevice->PortOffset);
for (uu = 0; uu < MAX_KEY_TABLE; uu++) { for (uu = 0; uu < MAX_KEY_TABLE; uu++)
MACvDisableKeyEntry(pDevice->PortOffset, uu); MACvDisableKeyEntry(pDevice->PortOffset, uu);
}
return ret; return ret;
} }
...@@ -283,13 +283,11 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, ...@@ -283,13 +283,11 @@ int wpa_set_keys(PSDevice pDevice, void *ctx,
return -EINVAL; return -EINVAL;
} }
if (param->u.wpa_key.alg_name == WPA_ALG_TKIP) { if (param->u.wpa_key.alg_name == WPA_ALG_TKIP)
pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled; pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled;
}
if (param->u.wpa_key.alg_name == WPA_ALG_CCMP) { if (param->u.wpa_key.alg_name == WPA_ALG_CCMP)
pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled; pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled;
}
if (param->u.wpa_key.set_tx) if (param->u.wpa_key.set_tx)
dwKeyIndex |= (1 << 31); dwKeyIndex |= (1 << 31);
...@@ -639,9 +637,9 @@ static int wpa_get_scan(PSDevice pDevice, ...@@ -639,9 +637,9 @@ static int wpa_get_scan(PSDevice pDevice,
if (jj < count) if (jj < count)
count = jj; count = jj;
if (copy_to_user(param->u.scan_results.buf, pBuf, sizeof(struct viawget_scan_result) * count)) { if (copy_to_user(param->u.scan_results.buf, pBuf, sizeof(struct viawget_scan_result) * count))
ret = -EFAULT; ret = -EFAULT;
}
param->u.scan_results.scan_count = count; param->u.scan_results.scan_count = count;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " param->u.scan_results.scan_count = %d\n", count); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " param->u.scan_results.scan_count = %d\n", count);
...@@ -703,9 +701,8 @@ static int wpa_set_associate(PSDevice pDevice, ...@@ -703,9 +701,8 @@ static int wpa_set_associate(PSDevice pDevice,
// set bssid // set bssid
if (memcmp(param->u.wpa_associate.bssid, &abyNullAddr[0], 6) != 0) if (memcmp(param->u.wpa_associate.bssid, &abyNullAddr[0], 6) != 0)
memcpy(pMgmt->abyDesireBSSID, param->u.wpa_associate.bssid, 6); memcpy(pMgmt->abyDesireBSSID, param->u.wpa_associate.bssid, 6);
else { else
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pItemSSID->abySSID); bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pItemSSID->abySSID);
}
if (param->u.wpa_associate.wpa_ie_len == 0) { if (param->u.wpa_associate.wpa_ie_len == 0) {
if (param->u.wpa_associate.auth_alg & AUTH_ALG_SHARED_KEY) if (param->u.wpa_associate.auth_alg & AUTH_ALG_SHARED_KEY)
......
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