Commit 5e0cc8a2 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging: vt6655: Convert to kernel brace style

Move braces around to be more kernel like.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f2046f93
......@@ -494,8 +494,7 @@ vMgrDecodeAssocResponse(
(pItem->byElementID == WLAN_EID_EXTSUPP_RATES)) {
pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pFrame->pExtSuppRates=[%p].\n", pItem);
}
else {
} else {
pFrame->pExtSuppRates = NULL;
}
return;
......
......@@ -154,8 +154,7 @@ void SubBytes(unsigned char *in, unsigned char *out)
{
int i;
for (i = 0; i < 16; i++)
{
for (i = 0; i < 16; i++) {
out[i] = sbox_table[in[i]];
}
}
......@@ -201,20 +200,15 @@ void AESv128(unsigned char *key, unsigned char *data, unsigned char *ciphertext)
for (i = 0; i < 16; i++)
abyRoundKey[i] = key[i];
for (round = 0; round < 11; round++)
{
if (round == 0)
{
for (round = 0; round < 11; round++) {
if (round == 0) {
xor_128(abyRoundKey, data, ciphertext);
AddRoundKey(abyRoundKey, round);
}
else if (round == 10)
{
} else if (round == 10) {
SubBytes(ciphertext, TmpdataA);
ShiftRows(TmpdataA, TmpdataB);
xor_128(TmpdataB, abyRoundKey, ciphertext);
}
else // round 1 ~ 9
} else // round 1 ~ 9
{
SubBytes(ciphertext, TmpdataA);
ShiftRows(TmpdataA, TmpdataB);
......
......@@ -1806,8 +1806,7 @@ BBuGetFrameTime(
}
return (uPreamble + uFrameTime);
}
else {
} else {
uFrameTime = (cbFrameLength * 8 + 22) / uRate; //????????
uTmp = ((uFrameTime * uRate) - 22) / 8;
if (cbFrameLength != uTmp) {
......@@ -1905,8 +1904,7 @@ BBvCalculateParameter(
case RATE_6M:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9B; //1001 1011
}
else {//11g, 2.4GHZ
} else {//11g, 2.4GHZ
*pbyPhySgn = 0x8B; //1000 1011
}
break;
......@@ -1914,8 +1912,7 @@ BBvCalculateParameter(
case RATE_9M:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9F; //1001 1111
}
else {//11g, 2.4GHZ
} else {//11g, 2.4GHZ
*pbyPhySgn = 0x8F; //1000 1111
}
break;
......@@ -1923,8 +1920,7 @@ BBvCalculateParameter(
case RATE_12M:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9A; //1001 1010
}
else {//11g, 2.4GHZ
} else {//11g, 2.4GHZ
*pbyPhySgn = 0x8A; //1000 1010
}
break;
......@@ -1932,8 +1928,7 @@ BBvCalculateParameter(
case RATE_18M:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9E; //1001 1110
}
else {//11g, 2.4GHZ
} else {//11g, 2.4GHZ
*pbyPhySgn = 0x8E; //1000 1110
}
break;
......@@ -1941,8 +1936,7 @@ BBvCalculateParameter(
case RATE_24M:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x99; //1001 1001
}
else {//11g, 2.4GHZ
} else {//11g, 2.4GHZ
*pbyPhySgn = 0x89; //1000 1001
}
break;
......@@ -1950,8 +1944,7 @@ BBvCalculateParameter(
case RATE_36M:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9D; //1001 1101
}
else {//11g, 2.4GHZ
} else {//11g, 2.4GHZ
*pbyPhySgn = 0x8D; //1000 1101
}
break;
......@@ -1959,8 +1952,7 @@ BBvCalculateParameter(
case RATE_48M:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x98; //1001 1000
}
else {//11g, 2.4GHZ
} else {//11g, 2.4GHZ
*pbyPhySgn = 0x88; //1000 1000
}
break;
......@@ -1968,8 +1960,7 @@ BBvCalculateParameter(
case RATE_54M:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9C; //1001 1100
}
else {//11g, 2.4GHZ
} else {//11g, 2.4GHZ
*pbyPhySgn = 0x8C; //1000 1100
}
break;
......@@ -1977,8 +1968,7 @@ BBvCalculateParameter(
default:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9C; //1001 1100
}
else {//11g, 2.4GHZ
} else {//11g, 2.4GHZ
*pbyPhySgn = 0x8C; //1000 1100
}
break;
......@@ -1989,8 +1979,7 @@ BBvCalculateParameter(
if (bExtBit)
*pbyPhySrv = *pbyPhySrv | 0x80;
*pwPhyLen = (unsigned short)cbUsCount;
}
else {
} else {
*pbyPhySrv = 0x00;
*pwPhyLen = (unsigned short)cbFrameLength;
}
......@@ -2362,8 +2351,7 @@ void BBvLoopbackOn(PSDevice pDevice)
BBbWriteEmbedded(dwIoBase, 0x9A, 0); //CR154
BBbWriteEmbedded(dwIoBase, 0x88, 0x02);//CR239
}
else { //OFDM
} else { //OFDM
// Enable internal digital loopback:CR154 |= 0000 0001
BBbReadEmbedded(dwIoBase, 0x9A, &byData);//CR154
BBbWriteEmbedded(dwIoBase, 0x9A, (unsigned char)(byData | 0x01));//CR154
......@@ -2408,8 +2396,7 @@ void BBvLoopbackOff(PSDevice pDevice)
// Set the CR33 Bit2 to disable internal Loopback.
BBbReadEmbedded(dwIoBase, 0x21, &byData);//CR33
BBbWriteEmbedded(dwIoBase, 0x21, (unsigned char)(byData & 0xFE));//CR33
}
else { // OFDM
} else { // OFDM
BBbReadEmbedded(dwIoBase, 0x9A, &byData);//CR154
BBbWriteEmbedded(dwIoBase, 0x9A, (unsigned char)(byData & 0xFE));//CR154
}
......
......@@ -810,8 +810,7 @@ BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex)
BigestCount = pMgmt->sNodeDBTable[ii].uInActiveCount;
SelectIndex = ii;
}
}
else {
} else {
break;
}
}
......@@ -825,8 +824,7 @@ BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex)
while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[*puNodeIndex].sTxPSQueue)) != NULL)
dev_kfree_skb(skb);
}
}
else {
} else {
*puNodeIndex = ii;
}
......@@ -1027,13 +1025,13 @@ BSSvSecondCallBack(
MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO);
if (((!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->bHWRadioOff == false)) || ((pDevice->byGPIO & GPIO0_DATA) && (pDevice->bHWRadioOff == true))) && (cc == false)) {
cc = true;
}
else if (cc == true) {
} else if (cc == true) {
if (pDevice->bHWRadioOff == true) {
if (!(pDevice->byGPIO & GPIO0_DATA))
//||(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{ if (status == 1) goto start;
{
if (status == 1) goto start;
status = 1;
CARDbRadioPowerOff(pDevice);
pMgmt->sNodeDBTable[0].bActive = false;
......@@ -1045,14 +1043,16 @@ BSSvSecondCallBack(
}
if (pDevice->byGPIO & GPIO0_DATA)
//||(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if (status == 2) goto start;
{
if (status == 2) goto start;
status = 2;
CARDbRadioPowerOn(pDevice);
} }
else{
}
} else {
if (pDevice->byGPIO & GPIO0_DATA)
//||(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if (status == 3) goto start;
{
if (status == 3) goto start;
status = 3;
CARDbRadioPowerOff(pDevice);
pMgmt->sNodeDBTable[0].bActive = false;
......@@ -1064,10 +1064,12 @@ BSSvSecondCallBack(
}
if (!(pDevice->byGPIO & GPIO0_DATA))
//||(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if (status == 4) goto start;
{
if (status == 4) goto start;
status = 4;
CARDbRadioPowerOn(pDevice);
} }
}
}
}
start:
#endif
......@@ -1075,8 +1077,7 @@ BSSvSecondCallBack(
if (pDevice->wUseProtectCntDown > 0) {
pDevice->wUseProtectCntDown--;
}
else {
} else {
// disable protect mode
pDevice->byERPFlag &= ~(WLAN_SET_ERP_USE_PROTECTION(1));
}
......@@ -1096,8 +1097,7 @@ BSSvSecondCallBack(
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
}
#endif
}
else if (pDevice->bLinkPass == true)
} else if (pDevice->bLinkPass == true)
pDevice->byReAssocCount = 0;
}
......@@ -1154,8 +1154,7 @@ BSSvSecondCallBack(
if (ii > 0) {
// ii = 0 for multicast node (AP & Adhoc)
RATEvTxRateFallBack((void *)pDevice, &(pMgmt->sNodeDBTable[ii]));
}
else {
} else {
// ii = 0 reserved for unicast AP node (Infra STA)
if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA)
#ifdef PLICE_DEBUG
......@@ -1193,8 +1192,7 @@ BSSvSecondCallBack(
MACvEnableProtectMD(pDevice->PortOffset);
pDevice->bProtectMode = true;
}
}
else {
} else {
if (pDevice->bProtectMode) {
MACvDisableProtectMD(pDevice->PortOffset);
pDevice->bProtectMode = false;
......@@ -1208,8 +1206,7 @@ BSSvSecondCallBack(
BBvSetShortSlotTime(pDevice);
vUpdateIFS((void *)pDevice);
}
}
else {
} else {
if (!pDevice->bShortSlotTime) {
pDevice->bShortSlotTime = true;
BBvSetShortSlotTime(pDevice);
......@@ -1224,8 +1221,7 @@ BSSvSecondCallBack(
MACvEnableBarkerPreambleMd(pDevice->PortOffset);
pDevice->bBarkerPreambleMd = true;
}
}
else {
} else {
if (pDevice->bBarkerPreambleMd) {
MACvDisableBarkerPreambleMd(pDevice->PortOffset);
pDevice->bBarkerPreambleMd = false;
......@@ -1299,8 +1295,7 @@ BSSvSecondCallBack(
}
#endif
}
}
else if (pItemSSID->len != 0) {
} else if (pItemSSID->len != 0) {
if (pDevice->uAutoReConnectTime < 10) {
pDevice->uAutoReConnectTime++;
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
......@@ -1308,8 +1303,7 @@ BSSvSecondCallBack(
if (pDevice->bWPASuppWextEnabled == true)
pDevice->uAutoReConnectTime = 0;
#endif
}
else {
} else {
//mike use old encryption status for wpa reauthen
if (pDevice->bWPADEVUp)
pDevice->eEncryptionStatus = pDevice->eOldEncryptionStatus;
......@@ -1329,8 +1323,7 @@ BSSvSecondCallBack(
if ((pMgmt->eCurrState == WMAC_STATE_STARTED) && (pCurrSSID->len == 0)) {
if (pDevice->uAutoReConnectTime < 10) {
pDevice->uAutoReConnectTime++;
}
else {
} else {
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Adhoc re-scanning ...\n");
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
......@@ -1456,15 +1449,12 @@ BSSvUpdateNodeTxCounter(
for (ii = 0; ii < byTxRetry; ii++)
//for (ii=0;ii<txRetryTemp;ii++)
{
if (ii < 5)
{
if (ii < 5) {
//PLICE_DEBUG
wFallBackRate = awHWRetry0[wRate-RATE_18M][ii];
//wFallBackRate = awHWRetry0[wRate-RATE_12M][ii];
}
else
{
} else {
wFallBackRate = awHWRetry0[wRate-RATE_18M][4];
//wFallBackRate = awHWRetry0[wRate-RATE_12M][4];
}
......@@ -1677,21 +1667,16 @@ void s_uCalculateLinkQual(
TxOkRatio = (TxCnt < 6) ? 4000 : ((pDevice->scStatistic.TxNoRetryOkCount * 4000) / TxCnt);
RxOkRatio = (RxCnt < 6) ? 2000 : ((pDevice->scStatistic.RxOkCnt * 2000) / RxCnt);
//decide link quality
if (pDevice->bLinkPass != true)
{
if (pDevice->bLinkPass != true) {
pDevice->scStatistic.LinkQuality = 0;
pDevice->scStatistic.SignalStren = 0;
}
else
{
} else {
RFvRSSITodBm(pDevice, (unsigned char)(pDevice->uCurrRSSI), &ldBm);
if (-ldBm < 50) {
RssiRatio = 4000;
}
else if (-ldBm > 90) {
} else if (-ldBm > 90) {
RssiRatio = 0;
}
else {
} else {
RssiRatio = (40-(-ldBm-50))*4000/40;
}
pDevice->scStatistic.SignalStren = RssiRatio/40;
......
......@@ -138,8 +138,7 @@ s_vCalculateOFDMRParameter(
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9B;
*pbyRsvTime = 44;
}
else {
} else {
*pbyTxRate = 0x8B;
*pbyRsvTime = 50;
}
......@@ -149,8 +148,7 @@ s_vCalculateOFDMRParameter(
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9F;
*pbyRsvTime = 36;
}
else {
} else {
*pbyTxRate = 0x8F;
*pbyRsvTime = 42;
}
......@@ -160,8 +158,7 @@ s_vCalculateOFDMRParameter(
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9A;
*pbyRsvTime = 32;
}
else {
} else {
*pbyTxRate = 0x8A;
*pbyRsvTime = 38;
}
......@@ -171,8 +168,7 @@ s_vCalculateOFDMRParameter(
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9E;
*pbyRsvTime = 28;
}
else {
} else {
*pbyTxRate = 0x8E;
*pbyRsvTime = 34;
}
......@@ -182,8 +178,7 @@ s_vCalculateOFDMRParameter(
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9D;
*pbyRsvTime = 24;
}
else {
} else {
*pbyTxRate = 0x8D;
*pbyRsvTime = 30;
}
......@@ -193,8 +188,7 @@ s_vCalculateOFDMRParameter(
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x98;
*pbyRsvTime = 24;
}
else {
} else {
*pbyTxRate = 0x88;
*pbyRsvTime = 30;
}
......@@ -204,8 +198,7 @@ s_vCalculateOFDMRParameter(
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9C;
*pbyRsvTime = 24;
}
else {
} else {
*pbyTxRate = 0x8C;
*pbyRsvTime = 30;
}
......@@ -216,8 +209,7 @@ s_vCalculateOFDMRParameter(
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x99;
*pbyRsvTime = 28;
}
else {
} else {
*pbyTxRate = 0x89;
*pbyRsvTime = 34;
}
......@@ -369,8 +361,7 @@ s_vSetRSPINF(PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs, v
*
*/
/*
bool CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, unsigned int uLength)
{
bool CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, unsigned int uLength) {
PSDevice pDevice = (PSDevice) pDeviceHandler;
if (ePktType == PKT_TYPE_802_11_MNG) {
return TXbTD0Send(pDevice, pPacket, uLength);
......@@ -1005,8 +996,7 @@ bool CARDbRadioPowerOn(void *pDeviceHandler)
if (pDevice->bRadioControlOff == true) printk("chester bRadioControlOff\n");
return false; }
if (pDevice->bRadioOff == false)
{
if (pDevice->bRadioOff == false) {
printk("chester pbRadioOff\n");
return true; }
......@@ -1865,15 +1855,13 @@ void vUpdateIFS(void *pDeviceHandler)
pDevice->uDIFS = C_SIFS_A + 2*C_SLOT_SHORT;
pDevice->uCwMin = C_CWMIN_A;
byMaxMin = 4;
}
else if (pDevice->byPacketType == PK_TYPE_11B) {//0000 0001 0000 0000,11b
} else if (pDevice->byPacketType == PK_TYPE_11B) {//0000 0001 0000 0000,11b
pDevice->uSlot = C_SLOT_LONG;
pDevice->uSIFS = C_SIFS_BG;
pDevice->uDIFS = C_SIFS_BG + 2*C_SLOT_LONG;
pDevice->uCwMin = C_CWMIN_B;
byMaxMin = 5;
}
else { // PK_TYPE_11GA & PK_TYPE_11GB
} else { // PK_TYPE_11GA & PK_TYPE_11GB
pDevice->uSIFS = C_SIFS_BG;
if (pDevice->bShortSlotTime) {
pDevice->uSlot = C_SLOT_SHORT;
......@@ -1884,8 +1872,7 @@ void vUpdateIFS(void *pDeviceHandler)
if (pDevice->wBasicRate & 0x0150) { //0000 0001 0101 0000,24M,12M,6M
pDevice->uCwMin = C_CWMIN_A;
byMaxMin = 4;
}
else {
} else {
pDevice->uCwMin = C_CWMIN_B;
byMaxMin = 5;
}
......@@ -1978,11 +1965,9 @@ unsigned char CARDbyGetPktType(void *pDeviceHandler)
if (pDevice->byBBType == BB_TYPE_11A || pDevice->byBBType == BB_TYPE_11B) {
return (unsigned char)pDevice->byBBType;
}
else if (CARDbIsOFDMinBasicRate((void *)pDevice)) {
} else if (CARDbIsOFDMinBasicRate((void *)pDevice)) {
return PK_TYPE_11GA;
}
else {
} else {
return PK_TYPE_11GB;
}
}
......@@ -2072,8 +2057,7 @@ QWORD CARDqGetTSFOffset(unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2)
if (LODWORD(qwTSF1) < LODWORD(qwTSF2)) {
// if borrow needed
HIDWORD(qwTSFOffset) = HIDWORD(qwTSF1) - HIDWORD(qwTSF2) - 1;
}
else {
} else {
HIDWORD(qwTSFOffset) = HIDWORD(qwTSF1) - HIDWORD(qwTSF2);
};
return (qwTSFOffset);
......
......@@ -382,8 +382,7 @@ bool is_channel_valid(unsigned int ChannelIndex)
* If Channel Index is invalid, return invalid
*/
if ((ChannelIndex > CB_MAX_CHANNEL) ||
(ChannelIndex == 0))
{
(ChannelIndex == 0)) {
bValid = false;
goto exit;
}
......@@ -551,8 +550,7 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
//{{ RobertYu: 20041202
//// 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);
}
//}} RobertYu
......
......@@ -815,12 +815,9 @@ typedef struct __device_info {
inline static void EnQueue(PSDevice pDevice, PSRxMgmtPacket pRxMgmtPacket)
{
if ((pDevice->rxManeQueue.tail+1) % NUM == pDevice->rxManeQueue.head)
{
if ((pDevice->rxManeQueue.tail+1) % NUM == pDevice->rxManeQueue.head) {
return;
}
else
{
} else {
pDevice->rxManeQueue.tail = (pDevice->rxManeQueue.tail + 1) % NUM;
pDevice->rxManeQueue.Q[pDevice->rxManeQueue.tail] = pRxMgmtPacket;
pDevice->rxManeQueue.packet_num++;
......@@ -833,13 +830,10 @@ inline static void EnQueue(PSDevice pDevice, PSRxMgmtPacket pRxMgmtPacket)
inline static PSRxMgmtPacket DeQueue(PSDevice pDevice)
{
PSRxMgmtPacket pRxMgmtPacket;
if (pDevice->rxManeQueue.tail == pDevice->rxManeQueue.head)
{
if (pDevice->rxManeQueue.tail == pDevice->rxManeQueue.head) {
printk("Queue is Empty\n");
return NULL;
}
else
{
} else {
int x;
//x=pDevice->rxManeQueue.head = (pDevice->rxManeQueue.head+1)%NUM;
pDevice->rxManeQueue.head = (pDevice->rxManeQueue.head+1)%NUM;
......
......@@ -631,28 +631,24 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0;
pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0B;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Init Zone Type :USA\n");
}
else if ((zonetype == 1) &&
} else if ((zonetype == 1) &&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] != 0x01)) { //for Japan
pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x01;
pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
}
else if ((zonetype == 2) &&
} else if ((zonetype == 2) &&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] != 0x02)) { //for Europe
pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x02;
pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Init Zone Type :Europe\n");
}
else
{
else {
if (zonetype != pDevice->abyEEPROM[EEP_OFS_ZONETYPE])
printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n", zonetype, pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
else
printk("Read Zonetype file success,use default zonetype setting[%02x]\n", zonetype);
}
}
else
} else
printk("Read Zonetype file fail,use default zonetype setting[%02x]\n", SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ZONETYPE));
// Get RFType
......@@ -779,8 +775,7 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
}
if ((pDevice->bRadioControlOff == true)) {
CARDbRadioPowerOff(pDevice);
}
else CARDbRadioPowerOn(pDevice);
} else CARDbRadioPowerOn(pDevice);
#else
if (((pDevice->byGPIO & GPIO0_DATA) && !(pDevice->byRadioCtl & EEP_RADIOCTL_INV)) ||
(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) {
......@@ -958,13 +953,11 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
PCI_BASE_ADDRESS_4,
PCI_BASE_ADDRESS_5,
0};
for (i = 0; address[i]; i++)
{
for (i = 0; address[i]; i++) {
//pci_write_config_dword(pcid,address[i], 0xFFFFFFFF);
pci_read_config_dword(pcid, address[i], &bar);
printk("bar %d is %x\n", i, bar);
if (!bar)
{
if (!bar) {
printk("bar %d not implemented\n", i);
continue;
}
......@@ -975,9 +968,7 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
len = len & ~(len - 1);
printk("IO space: len in IO %x, BAR %d\n", len, i);
}
else
{
} else {
len = bar & 0xFFFFFFF0;
len = ~len + 1;
......@@ -1056,8 +1047,7 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
dev->wireless_handlers = (struct iw_handler_def *)&iwctl_handler_def;
rc = register_netdev(dev);
if (rc)
{
if (rc) {
printk(KERN_ERR DEVICE_NAME " Failed to register netdev\n");
device_free_info(pDevice);
return -ENODEV;
......@@ -1094,8 +1084,7 @@ static void vt6655_init_info(struct pci_dev *pcid, PSDevice *ppDevice,
if (pDevice_Infos == NULL) {
pDevice_Infos = *ppDevice;
}
else {
} else {
for (p = pDevice_Infos; p->next != NULL; p = p->next)
do {} while (0);
p->next = *ppDevice;
......@@ -1154,20 +1143,15 @@ static bool device_get_pci_info(PSDevice pDevice, struct pci_dev *pcid) {
//pci_write_config_word(pcid,PCI_MAX_LAT,max_lat);
//pci_read_config_word(pcid,PCI_MAX_LAT,&max_lat);
for (ii = 0; ii < 0xFF; ii++)
{
for (ii = 0; ii < 0xFF; ii++) {
pci_read_config_byte(pcid, ii, &value);
pci_config[ii] = value;
}
for (ii = 0, j = 1; ii < 0x100; ii++, j++)
{
if (j % 16 == 0)
{
for (ii = 0, j = 1; ii < 0x100; ii++, j++) {
if (j % 16 == 0) {
printk("%x:", pci_config[ii]);
printk("\n");
}
else
{
} else {
printk("%x:", pci_config[ii]);
}
}
......@@ -1199,8 +1183,7 @@ static void device_free_info(PSDevice pDevice) {
pDevice_Infos = ptr->next;
else
ptr->prev->next = ptr->next;
}
else {
} else {
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "info struct not found\n");
return;
}
......@@ -1675,8 +1658,7 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) {
}
pStats->tx_packets++;
pStats->tx_bytes += pTD->pTDInfo->skb->len;
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Tx[%d] dropped & tsr1[%02X] tsr0[%02X].\n",
(int)uIdx, byTsr1, byTsr0);
pStats->tx_errors++;
......@@ -1812,15 +1794,13 @@ int MlmeThread(
//i = 0;
#if 1
while (1)
{
while (1) {
//down(&pDevice->mlme_semaphore);
// pRxMgmtPacket = DeQueue(pDevice);
#if 1
spin_lock_irq(&pDevice->lock);
while (pDevice->rxManeQueue.packet_num != 0)
{
while (pDevice->rxManeQueue.packet_num != 0) {
pRxMgmtPacket = DeQueue(pDevice);
//pDevice;
//DequeueManageObject(pDevice->FirstRecvMngList, pDevice->LastRecvMngList);
......@@ -1948,8 +1928,7 @@ static int device_open(struct net_device *dev) {
if (pDevice->pMgmt->eConfigMode == WMAC_CONFIG_AP) {
bScheduleCommand((void *)pDevice, WLAN_CMD_RUN_AP, NULL);
}
else {
} else {
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, NULL);
}
......@@ -2117,16 +2096,14 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI
else
pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate;
}
}
else {
} else {
pDevice->wCurrentRate = pDevice->pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate;
}
//preamble type
if (pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble) {
pDevice->byPreambleType = pDevice->byShortPreamble;
}
else {
} else {
pDevice->byPreambleType = PREAMBLE_LONG;
}
......@@ -2337,8 +2314,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
pTransmitKey = NULL;
if (pDevice->pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "IBSS and KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode);
}
else
} else
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "NOT IBSS and KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode);
} else {
bTKIP_UseGTK = true;
......@@ -2407,8 +2383,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
pDevice->byACKRate = (unsigned char) pDevice->wCurrentRate;
pDevice->byTopCCKBasicRate = RATE_1M;
pDevice->byTopOFDMBasicRate = RATE_6M;
}
else {
} else {
//auto rate
if (pDevice->sTxEthHeader.wType == TYPE_PKT_802_1x) {
if (pDevice->eCurrentPHYType != PHY_TYPE_11A) {
......@@ -2422,8 +2397,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
pDevice->byTopCCKBasicRate = RATE_1M;
pDevice->byTopOFDMBasicRate = RATE_6M;
}
}
else {
} else {
VNTWIFIvGetTxRate(pDevice->pMgmt,
pDevice->sTxEthHeader.abyDstAddr,
&(pDevice->wCurrentRate),
......@@ -2461,12 +2435,10 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
if ((pDevice->pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pDevice->pMgmt->eCurrState == WMAC_STATE_ASSOC)) {
if (pTransmitKey == NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Don't Find TX KEY\n");
}
else {
} else {
if (bTKIP_UseGTK == true) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "error: KEY is GTK!!~~\n");
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
bNeedEncryption = true;
}
......@@ -2485,8 +2457,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
bNeedEncryption = true;
}
}
}
else {
} else {
if (pTransmitKey == NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "return no tx key\n");
dev_kfree_skb_irq(skb);
......@@ -2541,12 +2512,9 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
pDevice->apCurrTD[TYPE_AC0DMA] = pHeadTD;
//#ifdef PLICE_DEBUG
if (pDevice->bFixRate)
{
if (pDevice->bFixRate) {
printk("FixRate:Rate is %d,TxPower is %d\n", pDevice->wCurrentRate, pDevice->byCurPwr);
}
else
{
} else {
}
//#endif
......@@ -2632,8 +2600,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
VNSvInPortB(pDevice->PortOffset + MAC_REG_PAGE1SEL, &byOrgPageSel);
if (byOrgPageSel == 1) {
MACvSelectPage0(pDevice->PortOffset);
}
else
} else
byOrgPageSel = 0;
MACvReadMIBCounter(pDevice->PortOffset, &dwMIBCounter);
......@@ -2807,8 +2774,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
if (pMgmt->byDTIMCount > 0) {
pMgmt->byDTIMCount--;
pMgmt->sNodeDBTable[0].bRxPSPoll = false;
}
else {
} else {
if (pMgmt->byDTIMCount == 0) {
// check if mutltcast tx bufferring
pMgmt->byDTIMCount = pMgmt->byDTIMPeriod - 1;
......@@ -2967,14 +2933,11 @@ int Config_FileOperation(PSDevice pDevice, bool fwrite, unsigned char *Parameter
if (memcmp(tmpbuffer, "USA", 3) == 0) {
result = ZoneType_USA;
}
else if (memcmp(tmpbuffer, "JAPAN", 5) == 0) {
} else if (memcmp(tmpbuffer, "JAPAN", 5) == 0) {
result = ZoneType_Japan;
}
else if (memcmp(tmpbuffer, "EUROPE", 5) == 0) {
} else if (memcmp(tmpbuffer, "EUROPE", 5) == 0) {
result = ZoneType_Europe;
}
else {
} else {
result = -1;
printk("Unknown Zonetype[%s]?\n", tmpbuffer);
}
......@@ -3012,16 +2975,14 @@ static void device_set_multi(struct net_device *dev) {
DBG_PRT(MSG_LEVEL_ERR, KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
/* Unconditionally log net taps. */
pDevice->byRxMode |= (RCR_MULTICAST|RCR_BROADCAST|RCR_UNICAST);
}
else if ((netdev_mc_count(dev) > pDevice->multicast_limit)
} else if ((netdev_mc_count(dev) > pDevice->multicast_limit)
|| (dev->flags & IFF_ALLMULTI)) {
MACvSelectPage1(pDevice->PortOffset);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_MAR0, 0xffffffff);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_MAR0 + 4, 0xffffffff);
MACvSelectPage0(pDevice->PortOffset);
pDevice->byRxMode |= (RCR_MULTICAST|RCR_BROADCAST);
}
else {
} else {
memset(mc_filter, 0, sizeof(mc_filter));
netdev_for_each_mc_addr(ha, dev) {
int bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
......@@ -3193,8 +3154,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
break;
// Set WEP keys and mode
case SIOCSIWENCODE:
{
case SIOCSIWENCODE: {
char abyKey[WLAN_WEP232_KEYLEN];
if (wrq->u.encoding.pointer) {
......@@ -3296,8 +3256,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
rc = -EOPNOTSUPP;
break;
case SIOCGIWAPLIST:
{
case SIOCGIWAPLIST: {
char buffer[IW_MAX_AP * (sizeof(struct sockaddr) + sizeof(struct iw_quality))];
if (wrq->u.data.pointer) {
......@@ -3369,8 +3328,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
rc = iwctl_giwgenie(dev, NULL, &(wrq->u.data), wrq->u.data.pointer);
break;
case SIOCSIWENCODEEXT:
{
case SIOCSIWENCODEEXT: {
char extra[sizeof(struct iw_encode_ext)+MAX_KEY_LEN+1];
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWENCODEEXT \n");
if (wrq->u.encoding.pointer) {
......@@ -3467,8 +3425,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
spin_lock_irq(&pDevice->lock);
bScheduleCommand((void *)pDevice, WLAN_CMD_RUN_AP, NULL);
spin_unlock_irq(&pDevice->lock);
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Commit the settings\n");
spin_lock_irq(&pDevice->lock);
pDevice->bLinkPass = false;
......@@ -3626,8 +3583,7 @@ viawget_resume(struct pci_dev *pcid)
if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
// In Adhoc, BSS state set back to started.
pMgmt->eCurrState = WMAC_STATE_STARTED;
}
else {
} else {
pMgmt->eCurrMode = WMAC_MODE_STANDBY;
pMgmt->eCurrState = WMAC_STATE_IDLE;
}
......
......@@ -175,21 +175,18 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr,
// strip IV , add 4 byte
cbHeaderSize += (WLAN_HDR_ADDR3_LEN + 4);
}
}
else {
} else {
cbHeaderSize += WLAN_HDR_ADDR3_LEN;
};
pbyRxBuffer = (unsigned char *)(pbyRxBufferAddr + cbHeaderSize);
if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_Bridgetunnel[0])) {
cbHeaderSize += 6;
}
else if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_RFC1042[0])) {
} else if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_RFC1042[0])) {
cbHeaderSize += 6;
pwType = (unsigned short *)(pbyRxBufferAddr + cbHeaderSize);
if ((*pwType != TYPE_PKT_IPX) && (*pwType != cpu_to_le16(0xF380))) {
}
else {
} else {
cbHeaderSize -= 8;
pwType = (unsigned short *)(pbyRxBufferAddr + cbHeaderSize);
if (bIsWEP) {
......@@ -198,13 +195,11 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr,
} else {
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 4); // 4 is IV
}
}
else {
} else {
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN);
}
}
}
else {
} else {
cbHeaderSize -= 2;
pwType = (unsigned short *)(pbyRxBufferAddr + cbHeaderSize);
if (bIsWEP) {
......@@ -213,8 +208,7 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr,
} else {
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 4); // 4 is IV
}
}
else {
} else {
*pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN);
}
}
......@@ -260,16 +254,14 @@ s_vGetDASA(unsigned char *pbyRxBufferAddr, unsigned int *pcbHeaderSize,
psEthHeader->abyDstAddr[ii] = pMACHeader->abyAddr1[ii];
psEthHeader->abySrcAddr[ii] = pMACHeader->abyAddr3[ii];
}
}
else {
} else {
// IBSS mode
for (ii = 0; ii < ETH_ALEN; ii++) {
psEthHeader->abyDstAddr[ii] = pMACHeader->abyAddr1[ii];
psEthHeader->abySrcAddr[ii] = pMACHeader->abyAddr2[ii];
}
}
}
else {
} else {
// Is AP mode..
if (pMACHeader->wFrameCtl & FC_FROMDS) {
for (ii = 0; ii < ETH_ALEN; ii++) {
......@@ -277,8 +269,7 @@ s_vGetDASA(unsigned char *pbyRxBufferAddr, unsigned int *pcbHeaderSize,
psEthHeader->abySrcAddr[ii] = pMACHeader->abyAddr4[ii];
cbHeaderSize += 6;
}
}
else {
} else {
for (ii = 0; ii < ETH_ALEN; ii++) {
psEthHeader->abyDstAddr[ii] = pMACHeader->abyAddr3[ii];
psEthHeader->abySrcAddr[ii] = pMACHeader->abyAddr2[ii];
......@@ -299,8 +290,7 @@ void MngWorkItem(void *Context)
PSDevice pDevice = (PSDevice) Context;
spin_lock_irq(&pDevice->lock);
while (pDevice->rxManeQueue.packet_num != 0)
{
while (pDevice->rxManeQueue.packet_num != 0) {
pRxMgmtPacket = DeQueue(pDevice);
vMgrRxManagePacket(pDevice, pDevice->pMgmt, pRxMgmtPacket);
}
......@@ -558,8 +548,7 @@ device_receive_frame(
skb = pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].skb;
FrameSize = pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].cbFrameLength;
}
else {
} else {
return false;
}
}
......@@ -625,13 +614,11 @@ device_receive_frame(
netif_rx(skb);
return true;
}
}
else {
} else {
// Control Frame
};
return false;
}
else {
} else {
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
//In AP mode, hw only check addr1(BSSID or RA) if equal to local MAC.
if (!(*pbyRsr & RSR_BSSIDOK)) {
......@@ -643,8 +630,7 @@ device_receive_frame(
}
return false;
}
}
else {
} else {
// discard DATA packet while not associate || BSSID error
if ((pDevice->bLinkPass == false) ||
!(*pbyRsr & RSR_BSSIDOK)) {
......@@ -688,8 +674,7 @@ device_receive_frame(
if (*pbyRsr & RSR_ADDROK) {
//PSbSendPSPOLL((PSDevice)pDevice);
}
}
else {
} else {
if (pDevice->pMgmt->bInTIMWake == true) {
pDevice->pMgmt->bInTIMWake = false;
}
......@@ -785,8 +770,7 @@ device_receive_frame(
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[24]));
dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[28]));
}
else {
} else {
if (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) {
dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[16]));
dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[20]));
......@@ -1055,8 +1039,7 @@ static bool s_bAPModeRxCtl(
pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = true;
bScheduleCommand((void *)pDevice, WLAN_CMD_RX_PSPOLL, NULL);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 1\n");
}
else {
} else {
// check Data PS state
// if PW bit off, send out all PS bufferring packets.
if (!IS_FC_POWERMGT(pbyFrame)) {
......@@ -1066,14 +1049,12 @@ static bool s_bAPModeRxCtl(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 2\n");
}
}
}
else {
} else {
if (IS_FC_POWERMGT(pbyFrame)) {
pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = true;
// Once if STA in PS state, enable multicast bufferring
pMgmt->sNodeDBTable[0].bPSEnable = true;
}
else {
} else {
// clear all pending PS frame.
if (pMgmt->sNodeDBTable[iSANodeIndex].wEnQueueCnt > 0) {
pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = false;
......@@ -1084,8 +1065,7 @@ static bool s_bAPModeRxCtl(
}
}
}
}
else {
} else {
vMgrDeAuthenBeginSta(pDevice,
pMgmt,
(unsigned char *)(p802_11Header->abyAddr2),
......@@ -1416,8 +1396,7 @@ static bool s_bAPModeRxData(
// if any node in PS mode, buffer packet until DTIM.
if (skbcpy == NULL) {
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "relay multicast no skb available \n");
}
else {
} else {
skbcpy->dev = pDevice->dev;
skbcpy->len = FrameSize;
memcpy(skbcpy->data, skb->data+cbHeaderOffset, FrameSize);
......@@ -1427,12 +1406,10 @@ static bool s_bAPModeRxData(
// set tx map
pMgmt->abyPSTxMap[0] |= byMask[0];
}
}
else {
} else {
bRelayAndForward = true;
}
}
else {
} else {
// check if relay
if (BSSDBbIsSTAInNodeDB(pMgmt, (unsigned char *)(skb->data+cbHeaderOffset), &iDANodeIndex)) {
if (pMgmt->sNodeDBTable[iDANodeIndex].eNodeState >= NODE_ASSOC) {
......@@ -1449,8 +1426,7 @@ static bool s_bAPModeRxData(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "relay: index= %d, pMgmt->abyPSTxMap[%d]= %d\n",
iDANodeIndex, (wAID >> 3), pMgmt->abyPSTxMap[wAID >> 3]);
return true;
}
else {
} else {
bRelayOnly = true;
}
}
......
......@@ -214,8 +214,7 @@ static int hostap_remove_sta(PSDevice pDevice,
if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, param->sta_addr, &uNodeIndex)) {
BSSvRemoveOneNode(pDevice, uNodeIndex);
}
else {
} else {
return -ENOENT;
}
return 0;
......@@ -305,8 +304,7 @@ static int hostap_get_info_sta(PSDevice pDevice,
(jiffies - pMgmt->sNodeDBTable[uNodeIndex].ulLastRxJiffer) / HZ;
//param->u.get_info_sta.txexc = pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts;
}
else {
} else {
return -ENOENT;
}
......@@ -336,8 +334,7 @@ static int hostap_get_info_sta(PSDevice pDevice,
if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) {
pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts = 0;
}
else {
} else {
return -ENOENT;
}
......@@ -369,8 +366,7 @@ static int hostap_set_flags_sta(PSDevice pDevice,
pMgmt->sNodeDBTable[uNodeIndex].dwFlags &= param->u.set_flags_sta.flags_and;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " dwFlags = %x \n",
(unsigned int)pMgmt->sNodeDBTable[uNodeIndex].dwFlags);
}
else {
} else {
return -ENOENT;
}
......
......@@ -172,8 +172,7 @@ int iwctl_siwscan(struct net_device *dev,
if (pItemSSID->abySSID[req->essid_len - 1] == '\0') {
if (req->essid_len > 0)
pItemSSID->len = req->essid_len - 1;
}
else
} else
pItemSSID->len = req->essid_len;
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
PRINT_K("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n", ((PWLAN_IE_SSID)abyScanSSID)->abySSID,
......@@ -182,12 +181,10 @@ int iwctl_siwscan(struct net_device *dev,
spin_unlock_irq(&pDevice->lock);
return 0;
}
else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { //passive scan
} else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { //passive scan
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
}
}
else { //active scan
} else { //active scan
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
}
......@@ -252,8 +249,7 @@ int iwctl_giwscan(struct net_device *dev,
iwe.cmd = SIOCGIWMODE;
if (WLAN_GET_CAP_INFO_ESS(pBSS->wCapInfo)) {
iwe.u.mode = IW_MODE_INFRA;
}
else {
} else {
iwe.u.mode = IW_MODE_ADHOC;
}
iwe.len = IW_EV_UINT_LEN;
......@@ -831,8 +827,7 @@ int iwctl_siwessid(struct net_device *dev,
if (pItemSSID->abySSID[wrq->length - 1] == '\0') {
if (wrq->length > 0)
pItemSSID->len = wrq->length - 1;
}
else
} else
pItemSSID->len = wrq->length;
printk("set essid to %s \n", pItemSSID->abySSID);
//2008-0409-05, <Add> by Einsn Liu
......@@ -870,8 +865,7 @@ int iwctl_siwessid(struct net_device *dev,
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID);
}
else { //mike:to find out if that desired SSID is a hidden-ssid AP ,
} else { //mike:to find out if that desired SSID is a hidden-ssid AP ,
// by means of judging if there are two same BSSID exist in list ?
for (ii = 0; ii < MAX_BSS_NUM; ii++) {
if (pMgmt->sBSSList[ii].bActive &&
......@@ -1005,14 +999,12 @@ int iwctl_siwrate(struct net_device *dev,
pDevice->bFixRate = true;
if ((pDevice->byBBType == BB_TYPE_11B) && (brate > 3)) {
pDevice->uConnectionRate = 3;
}
else {
} else {
pDevice->uConnectionRate = brate;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Fixed to Rate %d \n", pDevice->uConnectionRate);
}
}
else {
} else {
pDevice->bFixRate = false;
pDevice->uConnectionRate = 13;
printk("auto rate:connection_rate is 13\n");
......@@ -1052,14 +1044,11 @@ int iwctl_giwrate(struct net_device *dev,
if (pDevice->byBBType == BB_TYPE_11A)
brate = 0x6C;
}
}
else
{
} else {
brate = abySupportedRates[TxRate_iwconfig];
}
}
else brate = 0;
} else brate = 0;
//2007-0118-05,<Mark> by EinsnLiu
//Mark the unnecessary sentences.
/*
......@@ -1291,8 +1280,7 @@ int iwctl_siwencode(struct net_device *dev,
if (dwKeyIndex < 1 && ((wrq->flags & IW_ENCODE_NOKEY) == 0)) {//set default key
if (pDevice->byKeyIndex < WLAN_WEP_NKEYS) {
dwKeyIndex = pDevice->byKeyIndex;
}
else dwKeyIndex = 0;
} else dwKeyIndex = 0;
} else dwKeyIndex--;
......@@ -1306,11 +1294,9 @@ int iwctl_siwencode(struct net_device *dev,
if (wrq->length == WLAN_WEP232_KEYLEN) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 232 bit wep key\n");
}
else if (wrq->length == WLAN_WEP104_KEYLEN) {
} else if (wrq->length == WLAN_WEP104_KEYLEN) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 104 bit wep key\n");
}
else if (wrq->length == WLAN_WEP40_KEYLEN) {
} else if (wrq->length == WLAN_WEP40_KEYLEN) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 40 bit wep key, index= %d\n", (int)dwKeyIndex);
} else {//no support length
rc = -EINVAL;
......@@ -1346,8 +1332,7 @@ int iwctl_siwencode(struct net_device *dev,
} else if (index > 0) {
//when the length is 0 the request only changes the default transmit key index
//check the new key if it has a non zero length
if (pDevice->bEncryptionEnable == false)
{
if (pDevice->bEncryptionEnable == false) {
rc = -EINVAL;
return rc;
}
......@@ -1401,11 +1386,9 @@ int iwctl_siwencode(struct net_device *dev,
if (wrq->length == WLAN_WEP232_KEYLEN) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 232 bit wep key\n");
}
else if (wrq->length == WLAN_WEP104_KEYLEN) {
} else if (wrq->length == WLAN_WEP104_KEYLEN) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 104 bit wep key\n");
}
else if (wrq->length == WLAN_WEP40_KEYLEN) {
} else if (wrq->length == WLAN_WEP40_KEYLEN) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 40 bit wep key, index= %d\n", (int)dwKeyIndex);
}
memset(pDevice->abyKey, 0, WLAN_WEP232_KEYLEN);
......@@ -1438,8 +1421,7 @@ int iwctl_siwencode(struct net_device *dev,
// Do we want to just set the transmit key index ?
if (index < 4) {
pDevice->byKeyIndex = index;
}
else if (!(wrq->flags & IW_ENCODE_MODE)) {
} else if (!(wrq->flags & IW_ENCODE_MODE)) {
rc = -EINVAL;
return rc;
}
......@@ -1478,8 +1460,7 @@ int iwctl_siwencode(struct net_device *dev,
int iwctl_giwencode(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrq,
char *extra)
{
char *extra) {
PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
......@@ -1701,8 +1682,7 @@ int iwctl_giwsens(struct net_device *dev,
if (pDevice->bLinkPass == true) {
RFvRSSITodBm(pDevice, (unsigned char)(pDevice->uCurrRSSI), &ldBm);
wrq->value = ldBm;
}
else {
} else {
wrq->value = 0;
};
wrq->disabled = (wrq->value == 0);
......@@ -1733,11 +1713,9 @@ int iwctl_siwauth(struct net_device *dev,
if (wrq->value == IW_AUTH_WPA_VERSION_DISABLED) {
PRINT_K("iwctl_siwauth:set WPADEV to disable at 1??????\n");
//pDevice->bWPADevEnable = false;
}
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");
}
else {
} else {
PRINT_K("iwctl_siwauth:set WPADEV to WPA2******\n");
}
//pDevice->bWPASuppWextEnabled =true;
......
......@@ -150,20 +150,17 @@ bool KeybGetKey(
if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) {
*pKey = &(pTable->KeyTable[i].PairwiseKey);
return (true);
}
else {
} else {
return (false);
}
} else if (dwKeyIndex < MAX_GROUP_KEY) {
if (pTable->KeyTable[i].GroupKey[dwKeyIndex].bKeyValid == true) {
*pKey = &(pTable->KeyTable[i].GroupKey[dwKeyIndex]);
return (true);
}
else {
} else {
return (false);
}
}
else {
} else {
return (false);
}
}
......@@ -257,8 +254,7 @@ bool KeybSetKey(
if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
}
else {
} else {
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
......@@ -322,8 +318,7 @@ bool KeybSetKey(
if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
}
else {
} else {
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
......@@ -379,8 +374,7 @@ bool KeybRemoveKey(
}
s_vCheckKeyTableValid(pTable, dwIoBase);
return true;
}
else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) {
} else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) {
for (i = 0; i < MAX_KEY_TABLE; i++) {
pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = false;
if ((dwKeyIndex & 0x7FFFFFFF) == (pTable->KeyTable[i].dwGTKeyIndex & 0x7FFFFFFF)) {
......@@ -390,8 +384,7 @@ bool KeybRemoveKey(
}
s_vCheckKeyTableValid(pTable, dwIoBase);
return true;
}
else {
} else {
return false;
}
}
......@@ -403,8 +396,7 @@ bool KeybRemoveKey(
pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
s_vCheckKeyTableValid(pTable, dwIoBase);
return (true);
}
else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) {
} else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) {
pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = false;
if ((dwKeyIndex & 0x7FFFFFFF) == (pTable->KeyTable[i].dwGTKeyIndex & 0x7FFFFFFF)) {
// remove Group transmit key
......@@ -412,8 +404,7 @@ bool KeybRemoveKey(
}
s_vCheckKeyTableValid(pTable, dwIoBase);
return (true);
}
else {
} else {
return (false);
}
}
......@@ -545,8 +536,7 @@ bool KeybGetTransmitKey(
return (true);
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PairwiseKey.bKeyValid == false\n");
return (false);
}
......@@ -568,8 +558,7 @@ bool KeybGetTransmitKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex);
return (true);
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GroupKey.bKeyValid == false\n");
return (false);
}
......@@ -800,8 +789,7 @@ bool KeybSetAllGroupKey(
if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
}
else {
} else {
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
......
......@@ -195,12 +195,10 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
if (byRSR & RSR_ADDRBROAD) {
pStatistic->ullRxBroadcastFrames++;
pStatistic->ullRxBroadcastBytes += (unsigned long long) cbFrameLength;
}
else if (byRSR & RSR_ADDRMULTI) {
} else if (byRSR & RSR_ADDRMULTI) {
pStatistic->ullRxMulticastFrames++;
pStatistic->ullRxMulticastBytes += (unsigned long long) cbFrameLength;
}
else {
} else {
pStatistic->ullRxDirectedFrames++;
pStatistic->ullRxDirectedBytes += (unsigned long long) cbFrameLength;
}
......@@ -213,85 +211,73 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
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);
}
else if (byRxRate == 11) {
} else if (byRxRate == 11) {
pStatistic->CustomStat.ullRsr5M++;
if (byRSR & RSR_CRCOK) {
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);
}
else if (byRxRate == 4) {
} else if (byRxRate == 4) {
pStatistic->CustomStat.ullRsr2M++;
if (byRSR & RSR_CRCOK) {
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);
}
else if (byRxRate == 2) {
} else if (byRxRate == 2) {
pStatistic->CustomStat.ullRsr1M++;
if (byRSR & RSR_CRCOK) {
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);
}
else if (byRxRate == 12) {
} else if (byRxRate == 12) {
pStatistic->CustomStat.ullRsr6M++;
if (byRSR & RSR_CRCOK) {
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++;
if (byRSR & RSR_CRCOK) {
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++;
if (byRSR & RSR_CRCOK) {
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++;
if (byRSR & RSR_CRCOK) {
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++;
if (byRSR & RSR_CRCOK) {
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++;
if (byRSR & RSR_CRCOK) {
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++;
if (byRSR & RSR_CRCOK) {
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++;
if (byRSR & RSR_CRCOK) {
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);
}
......@@ -343,23 +329,17 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
if (cbFrameLength < ETH_ZLEN + 4) {
pStatistic->dwRsrRunt++;
}
else if (cbFrameLength == ETH_ZLEN + 4) {
} else if (cbFrameLength == ETH_ZLEN + 4) {
pStatistic->dwRsrRxFrmLen64++;
}
else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) {
} else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) {
pStatistic->dwRsrRxFrmLen65_127++;
}
else if ((128 <= cbFrameLength) && (cbFrameLength <= 255)) {
} else if ((128 <= cbFrameLength) && (cbFrameLength <= 255)) {
pStatistic->dwRsrRxFrmLen128_255++;
}
else if ((256 <= cbFrameLength) && (cbFrameLength <= 511)) {
} else if ((256 <= cbFrameLength) && (cbFrameLength <= 511)) {
pStatistic->dwRsrRxFrmLen256_511++;
}
else if ((512 <= cbFrameLength) && (cbFrameLength <= 1023)) {
} else if ((512 <= cbFrameLength) && (cbFrameLength <= 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++;
} else if (cbFrameLength > ETH_FRAME_LEN + 4) {
pStatistic->dwRsrLong++;
......@@ -448,8 +428,7 @@ STAvUpdateTDStatCounter(
pHeader = (PWLAN_80211HDR_A4) pbyBuffer;
if (WLAN_GET_FC_TODS(pHeader->wFrameCtl) == 0) {
pbyDestAddr = &(pHeader->abyAddr1[0]);
}
else {
} else {
pbyDestAddr = &(pHeader->abyAddr3[0]);
}
// increase tx packet count
......@@ -474,17 +453,14 @@ STAvUpdateTDStatCounter(
if (is_broadcast_ether_addr(pbyDestAddr)) {
pStatistic->ullTxBroadcastFrames[uIdx]++;
pStatistic->ullTxBroadcastBytes[uIdx] += (unsigned long long) cbFrameLength;
}
else if (is_multicast_ether_addr(pbyDestAddr)) {
} else if (is_multicast_ether_addr(pbyDestAddr)) {
pStatistic->ullTxMulticastFrames[uIdx]++;
pStatistic->ullTxMulticastBytes[uIdx] += (unsigned long long) cbFrameLength;
}
else {
} else {
pStatistic->ullTxDirectedFrames[uIdx]++;
pStatistic->ullTxDirectedBytes[uIdx] += (unsigned long long) cbFrameLength;
}
}
else {
} else {
if (byTSR1 & TSR1_TERR)
pStatistic->dwTsrErr[uIdx]++;
if (byTSR1 & TSR1_RETRYTMO)
......
......@@ -82,8 +82,7 @@ static void s_vPutUINT32 (unsigned char *p, unsigned long val)
// Convert from unsigned long to unsigned char [] in a portable way
{
unsigned int i;
for (i=0; i<4; i++)
{
for (i=0; i<4; i++) {
*p++ = (unsigned char) (val & 0xff);
val >>= 8;
}
......@@ -114,8 +113,7 @@ static void s_vAppendByte(unsigned char b)
M |= b << (8*nBytesInM);
nBytesInM++;
// Process the word if it is full.
if (nBytesInM >= 4)
{
if (nBytesInM >= 4) {
L ^= M;
R ^= ROL32(L, 17);
L += R;
......@@ -152,8 +150,7 @@ void MIC_vUnInit(void)
void MIC_vAppend(unsigned char *src, unsigned int nBytes)
{
// This is simple
while (nBytes > 0)
{
while (nBytes > 0) {
s_vAppendByte(*src++);
nBytes--;
}
......@@ -168,8 +165,7 @@ void MIC_vGetMIC(unsigned long *pdwL, unsigned long *pdwR)
s_vAppendByte(0);
s_vAppendByte(0);
// and then zeroes until the length is a multiple of 4
while (nBytesInM != 0)
{
while (nBytesInM != 0) {
s_vAppendByte(0);
}
// The s_vAppendByte function has already computed the result.
......
......@@ -105,8 +105,7 @@ PSvEnablePowerSaving(
// first time set listen next beacon
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_LNBCN);
pMgmt->wCountToWakeUp = wListenInterval;
}
else {
} else {
// always listen beacon
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_ALBCN);
//pDevice->wCFG |= CFG_ALB;
......@@ -277,8 +276,7 @@ PSvSendPSPOLL(
// send the frame
if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send PS-Poll packet failed..\n");
}
else {
} else {
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send PS-Poll packet success..\n");
};
......@@ -339,8 +337,7 @@ PSbSendNullPacket(
WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_NULL) |
WLAN_SET_FC_PWRMGT(1)
));
}
else {
} else {
pTxPacket->p80211Header->sA3.wFrameCtl = cpu_to_le16(
(
WLAN_SET_FC_FTYPE(WLAN_TYPE_DATA) |
......@@ -362,8 +359,7 @@ PSbSendNullPacket(
if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send Null Packet failed !\n");
return false;
}
else {
} else {
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send Null Packet success....\n");
}
......
......@@ -912,14 +912,11 @@ bool RFvWriteWakeProgSyn(unsigned long dwIoBase, unsigned char byRFType, unsigne
return false;
}
if (uChannel <= CB_MAX_CHANNEL_24G)
{
if (uChannel <= CB_MAX_CHANNEL_24G) {
for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++) {
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTable[ii]);
}
}
else
{
} else {
for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++) {
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTableAMode[ii]);
}
......@@ -1158,8 +1155,7 @@ bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byO
// if change between 11 b/g and 11a need to update the following register
// Channel Index 1~14
if ((byOldChannel <= CB_MAX_CHANNEL_24G) && (byNewChannel > CB_MAX_CHANNEL_24G))
{
if ((byOldChannel <= CB_MAX_CHANNEL_24G) && (byNewChannel > CB_MAX_CHANNEL_24G)) {
// Change from 2.4G to 5G
bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[2]); //Reg2
bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[3]); //Reg3
......@@ -1168,9 +1164,7 @@ bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byO
bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[10]);//Reg10
bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[12]);//Reg12
bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[15]);//Reg15
}
else if ((byOldChannel > CB_MAX_CHANNEL_24G) && (byNewChannel <= CB_MAX_CHANNEL_24G))
{
} else if ((byOldChannel > CB_MAX_CHANNEL_24G) && (byNewChannel <= CB_MAX_CHANNEL_24G)) {
// change from 5G to 2.4G
bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[2]); //Reg2
bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[3]); //Reg3
......
......@@ -386,8 +386,7 @@ s_uGetTxRsvTime(
if (bNeedAck) {
return (uDataTime + pDevice->uSIFS + uAckTime);
}
else {
} else {
return uDataTime;
}
}
......@@ -412,17 +411,14 @@ s_uGetRTSCTSRsvTime(
if (byRTSRsvType == 0) { //RTSTxRrvTime_bb
uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate);
uCTSTime = uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
}
else if (byRTSRsvType == 1) { //RTSTxRrvTime_ba, only in 2.4GHZ
} else if (byRTSRsvType == 1) { //RTSTxRrvTime_ba, only in 2.4GHZ
uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate);
uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
}
else if (byRTSRsvType == 2) { //RTSTxRrvTime_aa
} else if (byRTSRsvType == 2) { //RTSTxRrvTime_aa
uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopOFDMBasicRate);
uCTSTime = uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
}
else if (byRTSRsvType == 3) { //CTSTxRrvTime_ba, only in 2.4GHZ
} else if (byRTSRsvType == 3) { //CTSTxRrvTime_ba, only in 2.4GHZ
uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
uRrvTime = uCTSTime + uAckTime + uDataTime + 2*pDevice->uSIFS;
......@@ -470,8 +466,7 @@ s_uGetDataDuration(
} else {
return 0;
}
}
else {//First Frag or Mid Frag
} else {//First Frag or Mid Frag
if (uFragIdx == (uMACfragNum-2)) {
uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wRate, bNeedAck);
} else {
......@@ -494,8 +489,7 @@ s_uGetDataDuration(
} else {
return 0;
}
}
else {//First Frag or Mid Frag
} else {//First Frag or Mid Frag
if (uFragIdx == (uMACfragNum-2)) {
uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wRate, bNeedAck);
} else {
......@@ -518,8 +512,7 @@ s_uGetDataDuration(
} else {
return 0;
}
}
else { //First Frag or Mid Frag
} else { //First Frag or Mid Frag
if (byFBOption == AUTO_FB_0) {
if (wRate < RATE_18M)
wRate = RATE_18M;
......@@ -561,8 +554,7 @@ s_uGetDataDuration(
} else {
return 0;
}
}
else { //First Frag or Mid Frag
} else { //First Frag or Mid Frag
if (byFBOption == AUTO_FB_0) {
if (wRate < RATE_18M)
wRate = RATE_18M;
......@@ -779,8 +771,7 @@ s_uFillDataHead(
return (pBuf->wDuration_a);
} //if (byFBOption == AUTO_FB_NONE)
}
else if (byPktType == PK_TYPE_11A) {
} else if (byPktType == PK_TYPE_11A) {
if ((byFBOption != AUTO_FB_NONE)) {
// Auto Fallback
PSTxDataHead_a_FB pBuf = (PSTxDataHead_a_FB)pTxDataHead;
......@@ -816,8 +807,7 @@ s_uFillDataHead(
pBuf->wTimeStampOff = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE]);
return (pBuf->wDuration);
}
}
else {
} else {
PSTxDataHead_ab pBuf = (PSTxDataHead_ab)pTxDataHead;
//Get SignalField,ServiceField,Length
BBvCalculateParameter(pDevice, cbFrameLength, wCurrentRate, byPktType,
......@@ -887,18 +877,15 @@ s_vFillRTSHead(
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
if (pDevice->eOPMode == OP_MODE_AP) {
memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
}
}
else {
} else {
PSRTS_g_FB pBuf = (PSRTS_g_FB)pvRTS;
//Get SignalField,ServiceField,Length
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
......@@ -925,21 +912,18 @@ s_vFillRTSHead(
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
if (pDevice->eOPMode == OP_MODE_AP) {
memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
}
} // if (byFBOption == AUTO_FB_NONE)
}
else if (byPktType == PK_TYPE_11A) {
} else if (byPktType == PK_TYPE_11A) {
if (byFBOption == AUTO_FB_NONE) {
PSRTS_ab pBuf = (PSRTS_ab)pvRTS;
//Get SignalField,ServiceField,Length
......@@ -956,20 +940,17 @@ s_vFillRTSHead(
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
if (pDevice->eOPMode == OP_MODE_AP) {
memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
}
}
else {
} else {
PSRTS_a_FB pBuf = (PSRTS_a_FB)pvRTS;
//Get SignalField,ServiceField,Length
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType,
......@@ -987,19 +968,16 @@ s_vFillRTSHead(
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
if (pDevice->eOPMode == OP_MODE_AP) {
memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
}
}
}
else if (byPktType == PK_TYPE_11B) {
} else if (byPktType == PK_TYPE_11B) {
PSRTS_ab pBuf = (PSRTS_ab)pvRTS;
//Get SignalField,ServiceField,Length
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
......@@ -1016,15 +994,13 @@ s_vFillRTSHead(
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
if (pDevice->eOPMode == OP_MODE_AP) {
memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
}
}
......@@ -1168,8 +1144,7 @@ s_vGenerateTxParameter(
if (wFifoCtl & FIFOCTL_AUTO_FB_0) {
byFBOption = AUTO_FB_0;
}
else if (wFifoCtl & FIFOCTL_AUTO_FB_1) {
} else if (wFifoCtl & FIFOCTL_AUTO_FB_1) {
byFBOption = AUTO_FB_1;
}
......@@ -1190,8 +1165,7 @@ s_vGenerateTxParameter(
}
//Fill RTS
s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
}
else {//RTS_needless, PCF mode
} else {//RTS_needless, PCF mode
//Fill RsvTime
if (pvRrvTime) {
......@@ -1205,8 +1179,7 @@ s_vGenerateTxParameter(
//Fill CTS
s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, bDisCRC, wCurrentRate, byFBOption);
}
}
else if (byPktType == PK_TYPE_11A) {
} else if (byPktType == PK_TYPE_11A) {
if (pvRTS != NULL) {//RTS_need, non PCF mode
//Fill RsvTime
......@@ -1217,16 +1190,14 @@ s_vGenerateTxParameter(
}
//Fill RTS
s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
}
else if (pvRTS == NULL) {//RTS_needless, non PCF mode
} else if (pvRTS == NULL) {//RTS_needless, non PCF mode
//Fill RsvTime
if (pvRrvTime) {
PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
pBuf->wTxRrvTime = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK)); //0:OFDM
}
}
}
else if (byPktType == PK_TYPE_11B) {
} else if (byPktType == PK_TYPE_11B) {
if ((pvRTS != NULL)) {//RTS_need, non PCF mode
//Fill RsvTime
......@@ -1237,8 +1208,7 @@ s_vGenerateTxParameter(
}
//Fill RTS
s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
}
else { //RTS_needless, non PCF mode
} else { //RTS_needless, non PCF mode
//Fill RsvTime
if (pvRrvTime) {
PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
......@@ -1278,20 +1248,17 @@ s_vFillFragParameter(
ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((unsigned short)(cbReqCount));
if (wFragType == FRAGCTL_ENDFRAG) { //Last Fragmentation
ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP | EDMSDU);
}
else {
} else {
ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP);
}
}
else {
} else {
//PSTxDesc ptdCurr = (PSTxDesc)s_pvGetTxDescHead(pDevice, uTxType, uCurIdx);
PSTxDesc ptdCurr = (PSTxDesc)pvtdCurr;
//Set TSR1 & ReqCount in TxDescHead
ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((unsigned short)(cbReqCount));
if (wFragType == FRAGCTL_ENDFRAG) { //Last Fragmentation
ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP | EDMSDU);
}
else {
} else {
ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP);
}
}
......@@ -1374,8 +1341,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
else
bNeedACK = true;
bIsAdhoc = true;
}
else {
} else {
// MSDUs in Infra mode always need ACK
bNeedACK = true;
bIsAdhoc = false;
......@@ -1420,8 +1386,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
((cbFrameSize >= pDevice->wFragmentationThreshold) && (pDevice->wFragmentationThreshold <= pDevice->wRTSThreshold))
) {
bRTS = false;
}
else {
} else {
bRTS = true;
psTxBufHd->wFIFOCtl |= (FIFOCTL_RTS | FIFOCTL_LRETRY);
}
......@@ -1430,8 +1395,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
//
if (psTxBufHd->wFIFOCtl & FIFOCTL_AUTO_FB_0) {
byFBOption = AUTO_FB_0;
}
else if (psTxBufHd->wFIFOCtl & FIFOCTL_AUTO_FB_1) {
} else if (psTxBufHd->wFIFOCtl & FIFOCTL_AUTO_FB_1) {
byFBOption = AUTO_FB_1;
}
......@@ -1448,8 +1412,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
pvCTS = NULL;
pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR + sizeof(SRTS_g));
cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR + sizeof(SRTS_g) + sizeof(STxDataHead_g);
}
else { //RTS_needless
} else { //RTS_needless
pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
pvRTS = NULL;
......@@ -1466,8 +1429,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
pvCTS = NULL;
pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR + sizeof(SRTS_g_FB));
cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR + sizeof(SRTS_g_FB) + sizeof(STxDataHead_g_FB);
}
else { //RTS_needless
} else { //RTS_needless
pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
pvRTS = NULL;
......@@ -1476,8 +1438,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS_FB) + sizeof(STxDataHead_g_FB);
}
} // Auto Fall Back
}
else {//802.11a/b packet
} else {//802.11a/b packet
if (byFBOption == AUTO_FB_NONE) {
if (bRTS == true) {
......@@ -1487,8 +1448,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
pvCTS = NULL;
pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_ab));
cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_ab) + sizeof(STxDataHead_ab);
}
else { //RTS_needless, need MICHDR
} else { //RTS_needless, need MICHDR
pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
pvRTS = NULL;
......@@ -1505,8 +1465,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
pvCTS = NULL;
pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_a_FB));
cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_a_FB) + sizeof(STxDataHead_a_FB);
}
else { //RTS_needless
} else { //RTS_needless
pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
pvRTS = NULL;
......@@ -1523,12 +1482,10 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
if (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) {
dwMICKey0 = *(unsigned long *)(&pTransmitKey->abyKey[16]);
dwMICKey1 = *(unsigned long *)(&pTransmitKey->abyKey[20]);
}
else if ((pTransmitKey->dwKeyIndex & AUTHENTICATOR_KEY) != 0) {
} else if ((pTransmitKey->dwKeyIndex & AUTHENTICATOR_KEY) != 0) {
dwMICKey0 = *(unsigned long *)(&pTransmitKey->abyKey[16]);
dwMICKey1 = *(unsigned long *)(&pTransmitKey->abyKey[20]);
}
else {
} else {
dwMICKey0 = *(unsigned long *)(&pTransmitKey->abyKey[24]);
dwMICKey1 = *(unsigned long *)(&pTransmitKey->abyKey[28]);
}
......@@ -1598,8 +1555,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
if ((psEthHeader->wType == TYPE_PKT_IPX) ||
(psEthHeader->wType == cpu_to_le16(0xF380))) {
memcpy((unsigned char *)(pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6);
}
else {
} else {
memcpy((unsigned char *)(pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6);
}
pbyType = (unsigned char *)(pbyPayloadHead + 6);
......@@ -1665,8 +1621,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
ptdCurr->buff_addr = cpu_to_le32(ptdCurr->pTDInfo->skb_dma);
pDevice->iTDUsed[uDMAIdx]++;
pHeadTD = ptdCurr->next;
}
else if (uFragIdx == (uMACfragNum-1)) {
} else if (uFragIdx == (uMACfragNum-1)) {
//=========================
// Last Fragmentation
//=========================
......@@ -1795,8 +1750,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
pDevice->iTDUsed[uDMAIdx]++;
pHeadTD = ptdCurr->next;
}
else {
} else {
//=========================
// Middle Fragmentation
//=========================
......@@ -1923,8 +1877,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
pHeadTD = ptdCurr->next;
}
} // for (uMACfragNum)
}
else {
} else {
//=========================
// No Fragmentation
//=========================
......@@ -1962,8 +1915,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
if ((psEthHeader->wType == TYPE_PKT_IPX) ||
(psEthHeader->wType == cpu_to_le16(0xF380))) {
memcpy((unsigned char *)(pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6);
}
else {
} else {
memcpy((unsigned char *)(pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6);
}
pbyType = (unsigned char *)(pbyPayloadHead + 6);
......@@ -2088,14 +2040,12 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb
if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = false;
pTxBufHead->wFIFOCtl = pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK);
}
else {
} else {
bNeedACK = true;
pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK;
}
bIsAdhoc = true;
}
else {
} else {
// MSDUs in Infra mode always need ACK
bNeedACK = true;
pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK;
......@@ -2131,14 +2081,11 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb
//Set packet type
if (byPktType == PK_TYPE_11A) {//0000 0000 0000 0000
;
}
else if (byPktType == PK_TYPE_11B) {//0000 0001 0000 0000
} else if (byPktType == PK_TYPE_11B) {//0000 0001 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11B;
}
else if (byPktType == PK_TYPE_11GB) {//0000 0010 0000 0000
} else if (byPktType == PK_TYPE_11GB) {//0000 0010 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11GB;
}
else if (byPktType == PK_TYPE_11GA) {//0000 0011 0000 0000
} else if (byPktType == PK_TYPE_11GA) {//0000 0011 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11GA;
}
//Set FIFOCTL_GrpAckPolicy
......@@ -2163,12 +2110,10 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb
if ((bNeedEncrypt) && (pTransmitKey != NULL)) { //WEP enabled
if (pTransmitKey->byCipherSuite == KEY_CTL_TKIP) {
pTxBufHead->wFragCtl |= FRAGCTL_TKIP;
}
else if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) { //WEP40 or WEP104
} else if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) { //WEP40 or WEP104
if (pTransmitKey->uKeyLength != WLAN_WEP232_KEYLEN)
pTxBufHead->wFragCtl |= FRAGCTL_LEGACY;
}
else if (pTransmitKey->byCipherSuite == KEY_CTL_CCMP) { //CCMP
} else if (pTransmitKey->byCipherSuite == KEY_CTL_CCMP) { //CCMP
pTxBufHead->wFragCtl |= FRAGCTL_AES;
}
}
......@@ -2250,14 +2195,12 @@ vGenerateMACHeader(
memcpy(&(pMACHeader->abyAddr2[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr3[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
pMACHeader->wFrameCtl |= FC_FROMDS;
}
else {
} else {
if (pDevice->eOPMode == OP_MODE_ADHOC) {
memcpy(&(pMACHeader->abyAddr1[0]), &(psEthHeader->abyDstAddr[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr2[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr3[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
}
else {
} else {
memcpy(&(pMACHeader->abyAddr3[0]), &(psEthHeader->abyDstAddr[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr2[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr1[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
......@@ -2368,14 +2311,11 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
//Set packet type
if (byPktType == PK_TYPE_11A) {//0000 0000 0000 0000
pTxBufHead->wFIFOCtl = 0;
}
else if (byPktType == PK_TYPE_11B) {//0000 0001 0000 0000
} else if (byPktType == PK_TYPE_11B) {//0000 0001 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11B;
}
else if (byPktType == PK_TYPE_11GB) {//0000 0010 0000 0000
} else if (byPktType == PK_TYPE_11GB) {//0000 0010 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11GB;
}
else if (byPktType == PK_TYPE_11GA) {//0000 0011 0000 0000
} else if (byPktType == PK_TYPE_11GA) {//0000 0011 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11GA;
}
......@@ -2425,8 +2365,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
cbIVlen = 4;
cbICVlen = 4;
pTxBufHead->wFragCtl |= FRAGCTL_LEGACY;
}
else if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) {
} else if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) {
cbIVlen = 8;//IV+ExtIV
cbMIClen = 8;
cbICVlen = 4;
......@@ -2434,8 +2373,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
//We need to get seed here for filling TxKey entry.
//TKIPvMixKey(pTransmitKey->abyKey, pDevice->abyCurrentNetAddr,
// pTransmitKey->wTSC15_0, pTransmitKey->dwTSC47_16, pDevice->abyPRNG);
}
else if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) {
} else if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) {
cbIVlen = 8;//RSN Header
cbICVlen = 8;//MIC
pTxBufHead->wFragCtl |= FRAGCTL_AES;
......@@ -2463,8 +2401,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
pCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + sizeof(SCTS));
cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) + sizeof(SCTS) + sizeof(STxDataHead_g);
}
else { // 802.11a/b packet
} else { // 802.11a/b packet
pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
pMICHDR = NULL;
pvRTS = NULL;
......@@ -2549,8 +2486,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
memcpy(pMACHeader, pPacket->p80211Header, cbMacHdLen);
memcpy(pbyPayloadHead, ((unsigned char *)(pPacket->p80211Header) + cbMacHdLen),
cbFrameBodySize);
}
else {
} else {
// Copy the Packet into a tx Buffer
memcpy(pMACHeader, pPacket->p80211Header, pPacket->cbMPDULen);
}
......@@ -2649,8 +2585,7 @@ CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
if (byPktType == PK_TYPE_11A) {//0000 0000 0000 0000
pTxDataHead->wDuration = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameSize, byPktType,
wCurrentRate, false, 0, 0, 1, AUTO_FB_NONE));
}
else if (byPktType == PK_TYPE_11B) {//0000 0001 0000 0000
} else if (byPktType == PK_TYPE_11B) {//0000 0001 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11B;
pTxDataHead->wDuration = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameSize, byPktType,
wCurrentRate, false, 0, 0, 1, AUTO_FB_NONE));
......@@ -2718,8 +2653,7 @@ cbGetFragCount(
bNeedACK = false;
else
bNeedACK = true;
}
else {
} else {
// MSDUs in Infra mode always need ACK
bNeedACK = true;
}
......@@ -2829,8 +2763,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
if (cbMPDULen <= WLAN_HDR_ADDR3_LEN) {
cbFrameBodySize = 0;
}
else {
} else {
cbFrameBodySize = cbMPDULen - WLAN_HDR_ADDR3_LEN;
}
p80211Header = (PUWLAN_80211HDR)pbMPDU;
......@@ -2874,14 +2807,11 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
//Set packet type
if (byPktType == PK_TYPE_11A) {//0000 0000 0000 0000
pTxBufHead->wFIFOCtl = 0;
}
else if (byPktType == PK_TYPE_11B) {//0000 0001 0000 0000
} else if (byPktType == PK_TYPE_11B) {//0000 0001 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11B;
}
else if (byPktType == PK_TYPE_11GB) {//0000 0010 0000 0000
} else if (byPktType == PK_TYPE_11GB) {//0000 0010 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11GB;
}
else if (byPktType == PK_TYPE_11GA) {//0000 0011 0000 0000
} else if (byPktType == PK_TYPE_11GA) {//0000 0011 0000 0000
pTxBufHead->wFIFOCtl |= FIFOCTL_11GA;
}
......@@ -2895,8 +2825,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
uNodeIndex = 0;
bNodeExist = true;
}
}
else {
} else {
if (pDevice->bEnableHostWEP) {
if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, (unsigned char *)(p80211Header->sA3.abyAddr1), &uNodeIndex))
bNodeExist = true;
......@@ -2959,8 +2888,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
cbIVlen = 4;
cbICVlen = 4;
pTxBufHead->wFragCtl |= FRAGCTL_LEGACY;
}
else if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) {
} else if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) {
cbIVlen = 8;//IV+ExtIV
cbMIClen = 8;
cbICVlen = 4;
......@@ -2968,8 +2896,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
//We need to get seed here for filling TxKey entry.
//TKIPvMixKey(pTransmitKey->abyKey, pDevice->abyCurrentNetAddr,
// pTransmitKey->wTSC15_0, pTransmitKey->dwTSC47_16, pDevice->abyPRNG);
}
else if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) {
} else if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) {
cbIVlen = 8;//RSN Header
cbICVlen = 8;//MIC
cbMICHDR = sizeof(SMICHDRHead);
......@@ -2999,8 +2926,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS));
cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS) + sizeof(STxDataHead_g);
}
else {//802.11a/b packet
} else {//802.11a/b packet
pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
......
......@@ -614,8 +614,7 @@ VNTWIFIbyGetKeyCypher(
VNTWIFIbInit(
void *pAdapterHandler,
void **pMgmtHandler
)
{
) {
PSMgmtObject pMgmt = NULL;
unsigned int ii;
......@@ -785,8 +784,7 @@ VNTWIFIbChannelSwitch(
VNTWIFIbRadarPresent(
void *pMgmtObject,
unsigned char byChannel
)
{
) {
PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject;
if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) &&
(byChannel == (unsigned char) pMgmt->uCurrChannel) &&
......
......@@ -132,21 +132,17 @@ vAdHocBeaconStop(PSDevice pDevice)
*/
bStop = false;
if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) &&
(pMgmt->eCurrState >= WMAC_STATE_STARTED))
{
(pMgmt->eCurrState >= WMAC_STATE_STARTED)) {
if ((pMgmt->uIBSSChannel <= CB_MAX_CHANNEL_24G) &&
(pMgmt->uScanChannel > CB_MAX_CHANNEL_24G))
{
(pMgmt->uScanChannel > CB_MAX_CHANNEL_24G)) {
bStop = true;
}
if (pMgmt->uIBSSChannel > CB_MAX_CHANNEL_24G)
{
if (pMgmt->uIBSSChannel > CB_MAX_CHANNEL_24G) {
bStop = true;
}
}
if (bStop)
{
if (bStop) {
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX);
}
......@@ -179,8 +175,7 @@ vAdHocBeaconRestart(PSDevice pDevice)
* (2) VT3253 is programmed as automatic Beacon Transmitting
*/
if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) &&
(pMgmt->eCurrState >= WMAC_STATE_STARTED))
{
(pMgmt->eCurrState >= WMAC_STATE_STARTED)) {
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX);
}
......@@ -242,8 +237,7 @@ s_vProbeChannel(
for (ii = 0; ii < 2; ii++) {
if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
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");
}
}
......@@ -610,8 +604,7 @@ vCommandTimer(
pMgmt->sNodeDBTable[0].bActive = true;
pMgmt->sNodeDBTable[0].uInActiveCount = 0;
bClearBSSID_SCAN(pDevice);
}
else {
} else {
// start own IBSS
vMgrCreateOwnIBSS((void *)pDevice, &Status);
if (Status != CMD_STATUS_SUCCESS) {
......@@ -634,8 +627,7 @@ vCommandTimer(
netif_wake_queue(pDevice->dev);
}
pDevice->bLinkPass = true;
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disconnect SSID none\n");
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
// if (pDevice->bWPASuppWextEnabled == true)
......@@ -672,8 +664,7 @@ vCommandTimer(
else if (pMgmt->eCurrState < WMAC_STATE_AUTHPENDING) {
printk("WLAN_AUTHENTICATE_WAIT:Authen Fail???\n");
}
else if (pDevice->byLinkWaitCount <= 4) { //mike add:wait another 2 sec if authenticated_frame delay!
} else if (pDevice->byLinkWaitCount <= 4) { //mike add:wait another 2 sec if authenticated_frame delay!
pDevice->byLinkWaitCount++;
printk("WLAN_AUTHENTICATE_WAIT:wait %d times!!\n", pDevice->byLinkWaitCount);
spin_unlock_irq(&pDevice->lock);
......@@ -713,17 +704,14 @@ vCommandTimer(
pDevice->sTimerTxData.expires = RUN_AT(10*HZ); //10s callback
pDevice->fTxDataInSleep = false;
pDevice->nTxDataTimeCout = 0;
}
else {
} else {
}
pDevice->IsTxDataTrigger = true;
add_timer(&pDevice->sTimerTxData);
#endif
}
else if (pMgmt->eCurrState < WMAC_STATE_ASSOCPENDING) {
} else if (pMgmt->eCurrState < WMAC_STATE_ASSOCPENDING) {
printk("WLAN_ASSOCIATE_WAIT:Association Fail???\n");
}
else if (pDevice->byLinkWaitCount <= 4) { //mike add:wait another 2 sec if associated_frame delay!
} else if (pDevice->byLinkWaitCount <= 4) { //mike add:wait another 2 sec if associated_frame delay!
pDevice->byLinkWaitCount++;
printk("WLAN_ASSOCIATE_WAIT:wait %d times!!\n", pDevice->byLinkWaitCount);
spin_unlock_irq(&pDevice->lock);
......@@ -776,8 +764,7 @@ vCommandTimer(
if (skb_queue_empty(&pMgmt->sNodeDBTable[0].sTxPSQueue)) {
pMgmt->abyPSTxMap[0] &= ~byMask[0];
pDevice->bMoreData = false;
}
else {
} else {
pDevice->bMoreData = true;
}
if (!device_dma0_xmit(pDevice, skb, 0)) {
......@@ -799,8 +786,7 @@ vCommandTimer(
pMgmt->abyPSTxMap[pMgmt->sNodeDBTable[ii].wAID >> 3] &=
~byMask[pMgmt->sNodeDBTable[ii].wAID & 7];
pDevice->bMoreData = false;
}
else {
} else {
pDevice->bMoreData = true;
}
if (!device_dma0_xmit(pDevice, skb, ii)) {
......@@ -885,8 +871,7 @@ s_bCommandComplete(
//Command Queue Empty
pDevice->bCmdRunning = false;
return true;
}
else {
} else {
pDevice->eCommand = pDevice->eCmdQueue[pDevice->uCmdDequeueIdx].eCmd;
pSSID = (PWLAN_IE_SSID)pDevice->eCmdQueue[pDevice->uCmdDequeueIdx].abyCmdDesireSSID;
bRadioCmd = pDevice->eCmdQueue[pDevice->uCmdDequeueIdx].bRadioCmd;
......@@ -1011,8 +996,7 @@ bool bScheduleCommand(
if (pDevice->bCmdRunning == false) {
s_bCommandComplete(pDevice);
}
else {
} else {
}
return (true);
......
......@@ -185,8 +185,7 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i
if (bExtIV)
// ExtIV
uHeaderSize += 4;
}
else {
} else {
uHeaderSize = 24;
}
......@@ -197,8 +196,7 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i
pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].uLifetime = pDevice->dwMaxReceiveLifetime;
pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wSequence = (pMACHeader->wSeqCtl >> 4);
pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wFragNum = (pMACHeader->wSeqCtl & 0x000F);
}
else {
} else {
pDevice->uCurrentDFCBIdx = WCTLuInsertDFCB(pDevice, pMACHeader);
if (pDevice->uCurrentDFCBIdx == pDevice->cbDFCB) {
return(false);
......@@ -212,8 +210,7 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i
pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wFragNum++;
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "First pDevice->uCurrentDFCBIdx= %d\n", pDevice->uCurrentDFCBIdx);
return(false);
}
else {
} else {
pDevice->uCurrentDFCBIdx = WCTLuSearchDFCB(pDevice, pMACHeader);
if (pDevice->uCurrentDFCBIdx != pDevice->cbDFCB) {
if ((pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wSequence == (pMACHeader->wSeqCtl >> 4)) &&
......@@ -225,15 +222,13 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i
pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer += (cbFrameLength - uHeaderSize);
pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wFragNum++;
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Second pDevice->uCurrentDFCBIdx= %d\n", pDevice->uCurrentDFCBIdx);
}
else {
} else {
// seq error or frag # error flush DFCB
pDevice->cbFreeDFCB++;
pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].bInUse = false;
return(false);
}
}
else {
} else {
return(false);
}
if (IS_LAST_FRAGMENT_PKT(pMACHeader)) {
......
......@@ -519,8 +519,7 @@ vMgrAssocBeginSta(
pMgmt->eCurrState = WMAC_STATE_ASSOCPENDING;
*pStatus = CMD_STATUS_SUCCESS;
}
}
else
} else
*pStatus = CMD_STATUS_RESOURCES;
return;
......@@ -596,8 +595,7 @@ vMgrReAssocBeginSta(
*pStatus = csMgmt_xmit(pDevice, pTxPacket);
if (*pStatus != CMD_STATUS_PENDING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Reassociation tx failed.\n");
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Reassociation tx sending.\n");
}
}
......@@ -813,8 +811,7 @@ s_vMgrRxAssocRequest(
Status = csMgmt_xmit(pDevice, pTxPacket);
if (Status != CMD_STATUS_PENDING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Assoc response tx failed\n");
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Assoc response tx sending..\n");
}
......@@ -971,8 +968,7 @@ s_vMgrRxReAssocRequest(
Status = csMgmt_xmit(pDevice, pTxPacket);
if (Status != CMD_STATUS_PENDING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:ReAssoc response tx failed\n");
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:ReAssoc response tx sending..\n");
}
}
......@@ -1036,8 +1032,7 @@ s_vMgrRxAssocResponse(
if (cpu_to_le16((*(sFrame.pwStatus))) == WLAN_MGMT_STATUS_SUCCESS) {
// set AID
pMgmt->wCurrAID = cpu_to_le16((*(sFrame.pwAid)));
if ((pMgmt->wCurrAID >> 14) != (BIT0 | BIT1))
{
if ((pMgmt->wCurrAID >> 14) != (BIT0 | BIT1)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "AID from AP, has two msb clear.\n");
}
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Association Successful, AID=%d.\n", pMgmt->wCurrAID & ~(BIT14 | BIT15));
......@@ -1111,12 +1106,10 @@ s_vMgrRxAssocResponse(
}
#endif //#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
//End Add -- //2008-0409-07, <Add> by Einsn Liu
}
else {
} else {
if (bReAssocType) {
pMgmt->eCurrState = WMAC_STATE_IDLE;
}
else {
} else {
// jump back to the auth state and indicate the error
pMgmt->eCurrState = WMAC_STATE_AUTH;
}
......@@ -1346,8 +1339,7 @@ s_vMgrRxAuthenSequence_1(
if (pMgmt->bShareKeyAlgorithm) {
pMgmt->sNodeDBTable[uNodeIndex].eNodeState = NODE_KNOWN;
pMgmt->sNodeDBTable[uNodeIndex].byAuthSequence = 1;
}
else {
} else {
pMgmt->sNodeDBTable[uNodeIndex].eNodeState = NODE_AUTH;
}
......@@ -1377,8 +1369,7 @@ s_vMgrRxAuthenSequence_1(
*(sFrame.pwStatus) = cpu_to_le16(WLAN_MGMT_STATUS_SUCCESS);
else
*(sFrame.pwStatus) = cpu_to_le16(WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG);
}
else {
} else {
if (pMgmt->bShareKeyAlgorithm)
*(sFrame.pwStatus) = cpu_to_le16(WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG);
else
......@@ -1441,15 +1432,13 @@ s_vMgrRxAuthenSequence_2(
PSTxMgmtPacket pTxPacket = NULL;
switch (cpu_to_le16((*(pFrame->pwAuthAlgorithm))))
{
switch (cpu_to_le16((*(pFrame->pwAuthAlgorithm)))) {
case WLAN_AUTH_ALG_OPENSYSTEM:
if (cpu_to_le16((*(pFrame->pwStatus))) == WLAN_MGMT_STATUS_SUCCESS) {
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (OPEN) Successful.\n");
pMgmt->eCurrState = WMAC_STATE_AUTH;
timer_expire(pDevice->sTimerCommand, 0);
}
else {
} else {
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (OPEN) Failed.\n");
s_vMgrLogStatus(pMgmt, cpu_to_le16((*(pFrame->pwStatus))));
pMgmt->eCurrState = WMAC_STATE_IDLE;
......@@ -1498,8 +1487,7 @@ s_vMgrRxAuthenSequence_2(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Auth_reply sequence_2 tx failed.\n");
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Auth_reply sequence_2 tx ...\n");
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:rx Auth_reply sequence_2 status error ...\n");
if (pDevice->eCommandState == WLAN_AUTHENTICATE_WAIT) {
// spin_unlock_irq(&pDevice->lock);
......@@ -1557,8 +1545,7 @@ s_vMgrRxAuthenSequence_3(
uStatusCode = WLAN_MGMT_STATUS_CHALLENGE_FAIL;
goto reply;
}
}
else {
} else {
uStatusCode = WLAN_MGMT_STATUS_UNSPEC_FAILURE;
goto reply;
}
......@@ -1632,8 +1619,7 @@ s_vMgrRxAuthenSequence_4(
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (SHAREDKEY) Successful.\n");
pMgmt->eCurrState = WMAC_STATE_AUTH;
timer_expire(pDevice->sTimerCommand, 0);
}
else{
} else{
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (SHAREDKEY) Failed.\n");
s_vMgrLogStatus(pMgmt, cpu_to_le16((*(pFrame->pwStatus))));
pMgmt->eCurrState = WMAC_STATE_IDLE;
......@@ -1678,12 +1664,10 @@ s_vMgrRxDisassociation(
sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header;
if (BSSDBbIsSTAInNodeDB(pMgmt, pRxPacket->p80211Header->sA3.abyAddr2, &uNodeIndex)) {
BSSvRemoveOneNode(pDevice, uNodeIndex);
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Rx disassoc, sta not found\n");
}
}
else if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) {
} else if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) {
sFrame.len = pRxPacket->cbMPDULen;
sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header;
vMgrDecodeDisassociation(&sFrame);
......@@ -1758,12 +1742,10 @@ s_vMgrRxDeauthentication(
sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header;
if (BSSDBbIsSTAInNodeDB(pMgmt, pRxPacket->p80211Header->sA3.abyAddr2, &uNodeIndex)) {
BSSvRemoveOneNode(pDevice, uNodeIndex);
}
else {
} else {
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Rx deauth, sta not found\n");
}
}
else {
} else {
if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) {
sFrame.len = pRxPacket->cbMPDULen;
sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header;
......@@ -1965,8 +1947,7 @@ s_vMgrRxBeacon(
sFrame.pHdr->sA4.abyAddr4, // payload of beacon
(void *)pRxPacket
);
}
else {
} else {
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "update bcn: RxChannel = : %d\n", byCurrChannel);
BSSbUpdateToBSSList((void *)pDevice,
*sFrame.pqwTimestamp,
......@@ -2005,8 +1986,7 @@ s_vMgrRxBeacon(
pDevice->byERPFlag |= WLAN_SET_ERP_USE_PROTECTION(1);
pDevice->wUseProtectCntDown = USE_PROTECT_PERIOD;
}
}
else {
} else {
pDevice->byERPFlag |= WLAN_SET_ERP_USE_PROTECTION(1);
pDevice->wUseProtectCntDown = USE_PROTECT_PERIOD;
}
......@@ -2147,22 +2127,18 @@ s_vMgrRxBeacon(
if (HIDWORD(qwTimestamp) == HIDWORD(qwLocalTSF)) {
if (LODWORD(qwTimestamp) >= LODWORD(qwLocalTSF)) {
bTSFOffsetPostive = true;
}
else {
} else {
bTSFOffsetPostive = false;
}
}
else if (HIDWORD(qwTimestamp) > HIDWORD(qwLocalTSF)) {
} else if (HIDWORD(qwTimestamp) > HIDWORD(qwLocalTSF)) {
bTSFOffsetPostive = true;
}
else if (HIDWORD(qwTimestamp) < HIDWORD(qwLocalTSF)) {
} else if (HIDWORD(qwTimestamp) < HIDWORD(qwLocalTSF)) {
bTSFOffsetPostive = false;
}
if (bTSFOffsetPostive) {
qwTSFOffset = CARDqGetTSFOffset(pRxPacket->byRxRate, (qwTimestamp), (qwLocalTSF));
}
else {
} else {
qwTSFOffset = CARDqGetTSFOffset(pRxPacket->byRxRate, (qwLocalTSF), (qwTimestamp));
}
......@@ -2198,12 +2174,10 @@ s_vMgrRxBeacon(
if (sFrame.pTIM->len >= (uLocateByteIndex + 4)) {
byTIMBitOn = (0x01) << ((wAIDNumber) % 8);
pMgmt->bInTIM = sFrame.pTIM->byVirtBitMap[uLocateByteIndex] & byTIMBitOn ? true : false;
}
else {
} else {
pMgmt->bInTIM = false;
};
}
else {
} else {
pMgmt->bInTIM = false;
};
......@@ -2217,8 +2191,7 @@ s_vMgrRxBeacon(
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BCN:PS-POLL sent..\n");
}
}
else {
} else {
pMgmt->bInTIMWake = false;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BCN: Not In TIM..\n");
if (pDevice->bPWBitOn == false) {
......@@ -2267,8 +2240,7 @@ s_vMgrRxBeacon(
pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble = WLAN_GET_CAP_INFO_SHORTPREAMBLE(*sFrame.pwCapInfo);
pMgmt->sNodeDBTable[uNodeIndex].bShortSlotTime = WLAN_GET_CAP_INFO_SHORTSLOTTIME(*sFrame.pwCapInfo);
pMgmt->sNodeDBTable[uNodeIndex].uInActiveCount = 0;
}
else {
} else {
// Todo, initial Node content
BSSvCreateOneNode((PSDevice)pDevice, &uNodeIndex);
......@@ -2314,8 +2286,7 @@ s_vMgrRxBeacon(
pMgmt->sNodeDBTable[0].uInActiveCount = 0;
}
}
else if (bIsSSIDEqual) {
} else if (bIsSSIDEqual) {
// See other adhoc sta with the same SSID but BSSID is different.
// adpot this vars only when TSF larger then us.
......@@ -2358,7 +2329,7 @@ s_vMgrRxBeacon(
}
// endian issue ???
// Update TSF
if (bUpdateTSF) {
if (bUpdateTSF) {
CARDbGetCurrentTSF(pDevice->PortOffset, &qwCurrTSF);
CARDbUpdateTSF(pDevice, pRxPacket->byRxRate, qwTimestamp, pRxPacket->qwLocalTSF);
CARDbGetCurrentTSF(pDevice->PortOffset, &qwCurrTSF);
......@@ -2805,14 +2776,12 @@ vMgrJoinBSSBegin(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "End of Join AP -- A/B/G Action\n");
}
else {
} else {
pMgmt->eCurrState = WMAC_STATE_IDLE;
};
}
else {
} else {
// ad-hoc mode BSS
if (pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) {
......@@ -2879,8 +2848,7 @@ vMgrJoinBSSBegin(
// Prepare beacon
bMgrPrepareBeaconToSend((void *)pDevice, pMgmt);
}
else {
} else {
pMgmt->eCurrState = WMAC_STATE_IDLE;
};
};
......@@ -3085,19 +3053,16 @@ static void Encyption_Rebuild(
if (pCurr->abyPKType[0] == WPA_TKIP) {
pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled; //TKIP
PRINT_K("Encyption_Rebuild--->ssid reset config to [WPAPSK-TKIP]\n");
}
else if (pCurr->abyPKType[0] == WPA_AESCCMP) {
} else if (pCurr->abyPKType[0] == WPA_AESCCMP) {
pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled; //AES
PRINT_K("Encyption_Rebuild--->ssid reset config to [WPAPSK-AES]\n");
}
}
else if (pCurr->bWPA2Valid == true) { //WPA2-PSK
} else if (pCurr->bWPA2Valid == true) { //WPA2-PSK
pMgmt->eAuthenMode = WMAC_AUTH_WPA2PSK;
if (pCurr->abyCSSPK[0] == WLAN_11i_CSS_TKIP) {
pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled; //TKIP
PRINT_K("Encyption_Rebuild--->ssid reset config to [WPA2PSK-TKIP]\n");
}
else if (pCurr->abyCSSPK[0] == WLAN_11i_CSS_CCMP) {
} else if (pCurr->abyCSSPK[0] == WLAN_11i_CSS_CCMP) {
pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled; //AES
PRINT_K("Encyption_Rebuild--->ssid reset config to [WPA2PSK-AES]\n");
}
......@@ -3749,11 +3714,9 @@ s_MgrMakeAssocRequest(
*pbyRSN++ = 0xf2;
if (pMgmt->eAuthenMode == WMAC_AUTH_WPAPSK) {
*pbyRSN++ = WPA_AUTH_PSK;
}
else if (pMgmt->eAuthenMode == WMAC_AUTH_WPA) {
} else if (pMgmt->eAuthenMode == WMAC_AUTH_WPA) {
*pbyRSN++ = WPA_AUTH_IEEE802_1X;
}
else {
} else {
*pbyRSN++ = WPA_NONE;
}
......@@ -4374,8 +4337,7 @@ s_vMgrRxProbeResponse(
sFrame.pHdr->sA4.abyAddr4, // payload of probresponse
(void *)pRxPacket
);
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe resp/insert: RxChannel = : %d\n", byCurrChannel);
BSSbInsertToBSSList((void *)pDevice,
sFrame.pHdr->sA3.abyAddr3,
......@@ -4474,8 +4436,7 @@ s_vMgrRxProbeRequest(
Status = csMgmt_xmit(pDevice, pTxPacket);
if (Status != CMD_STATUS_PENDING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Probe response tx failed\n");
}
else {
} else {
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Probe response tx sending..\n");
}
}
......@@ -4537,8 +4498,7 @@ vMgrRxManagePacket(
&Status
);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wmgr: send vMgrDeAuthenBeginSta 1\n");
}
else {
} else {
s_vMgrRxAssocRequest(pDevice, pMgmt, pRxPacket, uNodeIndex);
}
break;
......@@ -4664,8 +4624,7 @@ bMgrPrepareBeaconToSend(
// pDevice->bBeaconBufReady = false;
if (pDevice->bEncryptionEnable || pDevice->bEnable8021x) {
pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_PRIVACY(1);
}
else {
} else {
pMgmt->wCurrCapInfo &= ~WLAN_SET_CAP_INFO_PRIVACY(1);
}
pTxPacket = s_MgrMakeBeacon
......
......@@ -161,8 +161,7 @@ WPA_ParseRSN(
else
// any vendor checks here
;
}
else
} else
break;
//DBG_PRN_GRP14(("abyPKType[%d]: %X\n", j-1, pBSSList->abyPKType[j-1]));
} //for
......@@ -189,8 +188,7 @@ WPA_ParseRSN(
else
// any vendor checks here
;
}
else
} else
break;
//DBG_PRN_GRP14(("abyAuthType[%d]: %X\n", j-1, pBSSList->abyAuthType[j-1]));
}
......@@ -309,8 +307,7 @@ WPAb_Is_RSN(
(pRSN->byElementID == WLAN_EID_RSN_WPA) && !memcmp(pRSN->abyOUI, abyOUI01, 4) &&
(pRSN->wVersion == 1)) {
return true;
}
else
} else
return false;
}
......@@ -234,8 +234,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
//spin_unlock_irq(&pDevice->lock);
if (param->u.wpa_key.key && fcpfkernel) {
memcpy(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len);
}
else {
} else {
spin_unlock_irq(&pDevice->lock);
if (param->u.wpa_key.key &&
copy_from_user(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len)) {
......@@ -250,8 +249,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
if (param->u.wpa_key.alg_name == WPA_ALG_WEP) {
if (dwKeyIndex > 3) {
return -EINVAL;
}
else {
} else {
if (param->u.wpa_key.set_tx) {
pDevice->byKeyIndex = (unsigned char)dwKeyIndex;
pDevice->bTransmitKey = true;
......@@ -275,8 +273,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
//spin_unlock_irq(&pDevice->lock);
if (param->u.wpa_key.seq && fcpfkernel) {
memcpy(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len);
}
else {
} else {
spin_unlock_irq(&pDevice->lock);
if (param->u.wpa_key.seq &&
copy_from_user(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len)) {
......@@ -781,8 +778,7 @@ static int wpa_set_associate(PSDevice pDevice,
// set bssid
if (memcmp(param->u.wpa_associate.bssid, &abyNullAddr[0], 6) != 0)
memcpy(pMgmt->abyDesireBSSID, param->u.wpa_associate.bssid, 6);
else
{
else {
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pItemSSID->abySSID);
}
......@@ -833,8 +829,7 @@ static int wpa_set_associate(PSDevice pDevice,
pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
//pMgmt->eAuthenMode = WMAC_AUTH_SHAREKEY;
pMgmt->bShareKeyAlgorithm = true;
}
else if (pMgmt->eAuthenMode == WMAC_AUTH_OPEN) {
} else if (pMgmt->eAuthenMode == WMAC_AUTH_OPEN) {
if (!bWepEnabled) pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
else pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
//pMgmt->eAuthenMode = WMAC_AUTH_OPEN;
......
......@@ -152,8 +152,7 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData
pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate;
}
}
}
else {
} else {
pDevice->wCurrentRate = pDevice->pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate;
}
......
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