Commented out code is just noise. Remove them.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pBSSList = &(pMgmt->sBSSList[ii]);
if (pBSSList->bActive) {
if (!compare_ether_addr(pBSSList->abyBSSID, abyBSSID)) {
-// if (pSSID == NULL)
-// return pBSSList;
if (pSSID->len == ((PWLAN_IE_SSID)pBSSList->abySSID)->len) {
if (memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pBSSList->abySSID)->abySSID,
printk("Re-association timeout!!!\n");
pDevice->byReAssocCount = 0;
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
- // if (pDevice->bWPASuppWextEnabled == true)
{
union iwreq_data wrqu;
memset(&wrqu, 0, sizeof(wrqu));
(pMgmt->eCurrMode == WMAC_MODE_ESS_STA)) {
if (pMgmt->sNodeDBTable[0].bActive) { // Assoc with BSS
- // DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Callback inactive Count = [%d]\n", pMgmt->sNodeDBTable[0].uInActiveCount);
- //if (pDevice->bUpdateBBVGA) {
- // s_vCheckSensitivity((void *) pDevice);
- //}
-
if (pDevice->bUpdateBBVGA) {
// s_vCheckSensitivity((void *) pDevice);
s_vCheckPreEDThreshold((void *)pDevice);
pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
}
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
- // if (pDevice->bWPASuppWextEnabled == true)
{
union iwreq_data wrqu;
memset(&wrqu, 0, sizeof(wrqu));
// unsigned int txRetryTemp;
//PLICE_DEBUG->
//txRetryTemp = byTxRetry;
- //if (txRetryTemp== 8)
- //txRetryTemp -=3;
//PLICE_DEBUG <-
pTxBufHead = (PSTxBufHead) pbyBuffer;
if (pTxBufHead->wFIFOCtl & FIFOCTL_AUTO_FB_0) {
} else if (byFallBack == AUTO_FB_0) {
//PLICE_DEBUG
if (byTxRetry < 5)
- //if (txRetryTemp < 5)
wFallBackRate = awHWRetry0[wRate-RATE_18M][byTxRetry];
//wFallBackRate = awHWRetry0[wRate-RATE_12M][byTxRetry];
//wFallBackRate = awHWRetry0[wRate-RATE_18M][txRetryTemp] +1;
pDevice->byRxAntennaMode = ANT_B;
// chester for antenna
byValue1 = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ANTENNA);
- // if (pDevice->bDiversityRegCtlON)
if ((byValue1 & 0x08) == 0)
pDevice->bDiversityEnable = false;//SROMbyReadEmbedded(pDevice->PortOffset, 0x50);
else
- // if ((SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_RADIOCTL)&0x06)==0x04)
- // return -ENOMEM;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device_init_registers\n");
device_init_registers(pDevice, DEVICE_INIT_COLD);
MACvReadEtherAddress(pDevice->PortOffset, pDevice->abyCurrentNetAddr);
}
-#ifdef PLICE_DEBUG
- //if (skb->len == 98)
- //{
- // printk("ping:len is %d\n");
- //}
-#endif
vGenerateFIFOHeader(pDevice, byPktType, pDevice->pbyTmpBuff, bNeedEncryption,
cbFrameBodySize, TYPE_AC0DMA, pHeadTD,
&pDevice->sTxEthHeader, (unsigned char *)skb->data, pTransmitKey, uNodeIndex,
//2008-0409-07, <Add> by Einsn Liu
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
//send event to wpa_supplicant
- //if (pDevice->bWPADevEnable == true)
{
union iwreq_data wrqu;
struct iw_michaelmicfailure ev;
memset(pMgmt->abyDesireBSSID, 0xFF, 6);
PRINT_K("set essid to 'any' \n");
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
- //Unknown desired AP,so here need not associate??
- //if (pDevice->bWPASuppWextEnabled == true) {
return 0;
- // }
#endif
} else {
// Set the SSID
// do reset
MACbSoftwareReset(dwIoBase);
- // issue AUTOLD in EECSR to reload eeprom
- //MACvRegBitsOn(dwIoBase, MAC_REG_I2MCSR, I2MCSR_AUTOLD);
- // wait until EEPROM loading complete
- //while (true) {
- // u8 u8Data;
- // VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &u8Data);
- // if (!(u8Data & I2MCSR_AUTOLD))
- // break;
- //}
-
// reset TSF counter
VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
// enable TSF counter
if (dwIsr & ISR_RXDMA1) // ISR, bit12
pStatistic->ISRStat.dwIsrRx1OK++; // Rx1 successful
-// if (dwIsr & ISR_ATIMTX) // ISR, bit13
-// pStatistic->ISRStat.dwIsrATIMTxOK++; // ATIMTX successful
-
-// if (dwIsr & ISR_SYNCTX) // ISR, bit14
-// pStatistic->ISRStat.dwIsrSYNCTxOK++; // SYNCTX successful
-
-// if (dwIsr & ISR_CFPEND) // ISR, bit18
-// pStatistic->ISRStat.dwIsrCFPEnd++;
-
-// if (dwIsr & ISR_ATIMEND) // ISR, bit19
-// pStatistic->ISRStat.dwIsrATIMEnd++;
-
-// if (dwIsr & ISR_SYNCFLUSHOK) // ISR, bit20
-// pStatistic->ISRStat.dwIsrSYNCFlushOK++;
-
if (dwIsr & ISR_SOFTTIMER1) // ISR, bit21
pStatistic->ISRStat.dwIsrSTIMER1Int++;
break;
}
-// if (pDevice->byLocalID <= REV_ID_VT3253_B1) {
if (pDevice->byCurPwr == byPwr) {
return true;
}
+
bResult = RFbRawSetPower(pDevice, byPwr, uRATE);
-// }
if (bResult == true) {
pDevice->byCurPwr = byPwr;
}
//---------------------------
// S/W or H/W Encryption
//---------------------------
- //Fill MICHDR
- //if (pDevice->bAES) {
- // s_vFillMICHDR(pDevice, (unsigned char *)pMICHDR, pbyMacHdr, (unsigned short)cbFragPayloadSize);
- //}
- //cbReqCount += s_uDoEncryption(pDevice, psEthHeader, (void *)psTxBufHd, byKeySel,
- // pbyPayloadHead, (unsigned short)cbFragPayloadSize, uDMAIdx);
-
-
-
- //pbyBuffer = (unsigned char *)pDevice->aamTxBuf[uDMAIdx][uDescIdx].pbyVAddr;
pbyBuffer = (unsigned char *)pHeadTD->pTDInfo->buf;
uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen + cb802_1_H_len;
//---------------------------
// S/W or H/W Encryption
//---------------------------
- //Fill MICHDR
- //if (pDevice->bAES) {
- // s_vFillMICHDR(pDevice, (unsigned char *)pMICHDR, pbyMacHdr, (unsigned short)cbFragPayloadSize);
- //}
- //cbReqCount += s_uDoEncryption(pDevice, psEthHeader, (void *)psTxBufHd, byKeySel,
- // pbyPayloadHead, (unsigned short)cbFragPayloadSize, uDMAIdx);
-
pbyBuffer = (unsigned char *)pHeadTD->pTDInfo->buf;
- //pbyBuffer = (unsigned char *)pDevice->aamTxBuf[uDMAIdx][tmpDescIdx].pbyVAddr;
-
-
uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen;
//copy TxBufferHeader + MacHeader to desc
//---------------------------
// S/W or H/W Encryption
//---------------------------
- //Fill MICHDR
- //if (pDevice->bAES) {
- // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Fill MICHDR...\n");
- // s_vFillMICHDR(pDevice, (unsigned char *)pMICHDR, pbyMacHdr, (unsigned short)cbFrameBodySize);
- //}
-
pbyBuffer = (unsigned char *)pHeadTD->pTDInfo->buf;
- //pbyBuffer = (unsigned char *)pDevice->aamTxBuf[uDMAIdx][uDescIdx].pbyVAddr;
-
uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen + cb802_1_H_len;
//copy TxBufferHeader + MacHeader to desc
}
#ifdef PLICE_DEBUG
- //if (pDevice->wCurrentRate <= 3)
- //{
- // RFbRawSetPower(pDevice,36,pDevice->wCurrentRate);
- //}
- //else
-
RFbSetPower(pDevice, pDevice->wCurrentRate, pDevice->byCurrentCh);
#endif
- //if (pDevice->wCurrentRate == 3)
- //pDevice->byCurPwr = 46;
pTxBufHead->byTxPower = pDevice->byCurPwr;
(pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)) {
pTxBufHead->wFIFOCtl |= FIFOCTL_LRETRY;
- //Set Preamble type always long
- //pDevice->byPreambleType = PREAMBLE_LONG;
- // probe-response don't retry
- //if ((pPacket->p80211Header->sA4.wFrameCtl & TYPE_SUBTYPE_MASK) == TYPE_MGMT_PROBE_RSP) {
- // bNeedACK = false;
- // pTxBufHead->wFIFOCtl &= (~FIFOCTL_NEEDACK);
- //}
}
pTxBufHead->wFIFOCtl |= (FIFOCTL_GENINT | FIFOCTL_ISDMA0);
//---------------------------
// S/W or H/W Encryption
//---------------------------
- //Fill MICHDR
- //if (pDevice->bAES) {
- // s_vFillMICHDR(pDevice, (unsigned char *)pMICHDR, (unsigned char *)pMACHeader, (unsigned short)cbFrameBodySize);
- //}
do {
if ((pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) &&
(pDevice->bLinkPass == true)) {
(pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)) {
pTxBufHead->wFIFOCtl |= FIFOCTL_LRETRY;
- //Set Preamble type always long
- //pDevice->byPreambleType = PREAMBLE_LONG;
-
- // probe-response don't retry
- //if ((p80211Header->sA4.wFrameCtl & TYPE_SUBTYPE_MASK) == TYPE_MGMT_PROBE_RSP) {
- // bNeedACK = false;
- // pTxBufHead->wFIFOCtl &= (~FIFOCTL_NEEDACK);
- //}
}
pTxBufHead->wFIFOCtl |= (FIFOCTL_GENINT | FIFOCTL_ISDMA0);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disconnect SSID none\n");
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
- // if (pDevice->bWPASuppWextEnabled == true)
{
union iwreq_data wrqu;
memset(&wrqu, 0, sizeof(wrqu));
if (pDevice->bEncryptionEnable) {
pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_PRIVACY(1);
}
- // always allow receive short preamble
- //if (pDevice->byPreambleType == 1) {
- // pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1);
- //}
pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1);
if (pMgmt->wListenInterval == 0)
pMgmt->wListenInterval = 1; // at least one.
pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_PRIVACY(1);
}
- //if (pDevice->byPreambleType == 1) {
- // pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1);
- //}
pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1);
if (pMgmt->wListenInterval == 0)
//2008-0409-07, <Add> by Einsn Liu
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
- //if (pDevice->bWPADevEnable == true)
{
unsigned char buf[512];
size_t len;
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "AP disassociated me, reason=%d.\n", cpu_to_le16(*(sFrame.pwReason)));
//TODO: do something let upper layer know or
//try to send associate packet again because of inactivity timeout
- // if (pMgmt->eCurrState == WMAC_STATE_ASSOC) {
- // vMgrReAssocBeginSta((PSDevice)pDevice, pMgmt, &CmdStatus);
- // }
if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) {
wpahdr = (viawget_wpa_header *)pDevice->skb->data;
wpahdr->type = VIAWGET_DISASSOC_MSG;
}
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
- // if (pDevice->bWPASuppWextEnabled == true)
{
union iwreq_data wrqu;
memset(&wrqu, 0, sizeof(wrqu));
}
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
- // if (pDevice->bWPASuppWextEnabled == true)
{
union iwreq_data wrqu;
memset(&wrqu, 0, sizeof(wrqu));
pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble = WLAN_GET_CAP_INFO_SHORTPREAMBLE(*sFrame.pwCapInfo);
pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate = pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate;
#ifdef PLICE_DEBUG
- //if (uNodeIndex == 0)
{
printk("s_vMgrRxBeacon:TxDataRate is %d,Index is %d\n", pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate, uNodeIndex);
}
}
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
- //if (pDevice->bWPASuppWextEnabled == true)
Encyption_Rebuild(pDevice, pCurr);
#endif
// Infrastructure BSS
)
{
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
- // unsigned int ii , uSameBssidNum=0;
-
- // for (ii = 0; ii < MAX_BSS_NUM; ii++) {
- // if (pMgmt->sBSSList[ii].bActive &&
- // !compare_ether_addr(pMgmt->sBSSList[ii].abyBSSID, pCurr->abyBSSID)) {
- // uSameBssidNum++;
- // }
- // }
- // if (uSameBssidNum>=2) { //we only check AP in hidden sssid mode
+
if ((pMgmt->eAuthenMode == WMAC_AUTH_WPAPSK) || //networkmanager 0.7.0 does not give the pairwise-key selection,
(pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) { // so we need re-select it according to real pairwise-key info.
if (pCurr->bWPAValid == true) { //WPA-PSK
return false;
}
return true;
-// if (pBSSList->wAuthCount > 0)
-// for (ii=0; ii < pBSSList->wAuthCount; ii ++)
-// if (byAuth == pBSSList->abyAuthType[ii])
-// break;
break;
default: