diff options
Diffstat (limited to 'drivers/staging/vt6656/wcmd.c')
-rw-r--r-- | drivers/staging/vt6656/wcmd.c | 323 |
1 files changed, 142 insertions, 181 deletions
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 22f6b41cfd19..4bb652bf7cf6 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -68,33 +68,17 @@ static int msglevel =MSG_LEVEL_INFO; //static int msglevel =MSG_LEVEL_DEBUG; /*--------------------- Static Functions --------------------------*/ -static -void -s_vProbeChannel( - PSDevice pDevice - ); +static void s_vProbeChannel(struct vnt_private *); +static struct vnt_tx_mgmt *s_MgrMakeProbeRequest(struct vnt_private *, + struct vnt_manager *pMgmt, u8 *pScanBSSID, PWLAN_IE_SSID pSSID, + PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates); -static -PSTxMgmtPacket -s_MgrMakeProbeRequest( - PSDevice pDevice, - PSMgmtObject pMgmt, - PBYTE pScanBSSID, - PWLAN_IE_SSID pSSID, - PWLAN_IE_SUPP_RATES pCurrRates, - PWLAN_IE_SUPP_RATES pCurrExtSuppRates - ); +static int s_bCommandComplete(struct vnt_private *); -static -BOOL -s_bCommandComplete ( - PSDevice pDevice - ); - -static BOOL s_bClearBSSID_SCAN(void *hDeviceContext); +static int s_bClearBSSID_SCAN(struct vnt_private *); /*--------------------- Export Variables --------------------------*/ @@ -114,13 +98,10 @@ static BOOL s_bClearBSSID_SCAN(void *hDeviceContext); * */ -static -void -vAdHocBeaconStop(PSDevice pDevice) +static void vAdHocBeaconStop(struct vnt_private *pDevice) { - - PSMgmtObject pMgmt = &(pDevice->sMgmtObj); - BOOL bStop; + struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; + int bStop; /* * temporarily stop Beacon packet for AdHoc Server @@ -133,18 +114,18 @@ vAdHocBeaconStop(PSDevice pDevice) * or * (3.2) AdHoc channel is in A mode */ - bStop = FALSE; + bStop = false; if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && (pMgmt->eCurrState >= WMAC_STATE_STARTED)) { if ((pMgmt->uIBSSChannel <= CB_MAX_CHANNEL_24G) && (pMgmt->uScanChannel > CB_MAX_CHANNEL_24G)) { - bStop = TRUE; + bStop = true; } if (pMgmt->uIBSSChannel > CB_MAX_CHANNEL_24G) { - bStop = TRUE; + bStop = true; } } @@ -171,11 +152,9 @@ vAdHocBeaconStop(PSDevice pDevice) * Return Value: none * */ -static -void -vAdHocBeaconRestart(PSDevice pDevice) +static void vAdHocBeaconRestart(struct vnt_private *pDevice) { - PSMgmtObject pMgmt = &(pDevice->sMgmtObj); + struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; /* * Restart Beacon packet for AdHoc Server @@ -204,22 +183,22 @@ vAdHocBeaconRestart(PSDevice pDevice) * -*/ -static -void -s_vProbeChannel( - PSDevice pDevice - ) +static void s_vProbeChannel(struct vnt_private *pDevice) { - //1M, 2M, 5M, 11M, 18M, 24M, 36M, 54M - BYTE abyCurrSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C}; - BYTE abyCurrExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 0x0C, 0x12, 0x18, 0x60}; - //6M, 9M, 12M, 48M - BYTE abyCurrSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; - BYTE abyCurrSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; - PBYTE pbyRate; - PSTxMgmtPacket pTxPacket; - PSMgmtObject pMgmt = &(pDevice->sMgmtObj); - unsigned int ii; + struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; + struct vnt_tx_mgmt *pTxPacket; + u8 abyCurrSuppRatesG[] = {WLAN_EID_SUPP_RATES, + 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C}; + /* 1M, 2M, 5M, 11M, 18M, 24M, 36M, 54M*/ + u8 abyCurrExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, + 4, 0x0C, 0x12, 0x18, 0x60}; + /* 6M, 9M, 12M, 48M*/ + u8 abyCurrSuppRatesA[] = {WLAN_EID_SUPP_RATES, + 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; + u8 abyCurrSuppRatesB[] = {WLAN_EID_SUPP_RATES, + 4, 0x02, 0x04, 0x0B, 0x16}; + u8 *pbyRate; + int ii; if (pDevice->byBBType == BB_TYPE_11A) { @@ -268,24 +247,19 @@ s_vProbeChannel( -*/ -PSTxMgmtPacket -s_MgrMakeProbeRequest( - PSDevice pDevice, - PSMgmtObject pMgmt, - PBYTE pScanBSSID, - PWLAN_IE_SSID pSSID, - PWLAN_IE_SUPP_RATES pCurrRates, - PWLAN_IE_SUPP_RATES pCurrExtSuppRates - - ) +struct vnt_tx_mgmt *s_MgrMakeProbeRequest(struct vnt_private *pDevice, + struct vnt_manager *pMgmt, u8 *pScanBSSID, PWLAN_IE_SSID pSSID, + PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates) { - PSTxMgmtPacket pTxPacket = NULL; - WLAN_FR_PROBEREQ sFrame; + struct vnt_tx_mgmt *pTxPacket = NULL; + WLAN_FR_PROBEREQ sFrame; - pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; - memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_PROBEREQ_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket = (struct vnt_tx_mgmt *)pMgmt->pbyMgmtPacketPool; + memset(pTxPacket, 0, sizeof(struct vnt_tx_mgmt) + + WLAN_PROBEREQ_FR_MAXLEN); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((u8 *)pTxPacket + + sizeof(struct vnt_tx_mgmt)); sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; sFrame.len = WLAN_PROBEREQ_FR_MAXLEN; vMgrEncodeProbeRequest(&sFrame); @@ -316,9 +290,8 @@ s_MgrMakeProbeRequest( return pTxPacket; } -void vCommandTimerWait(void *hDeviceContext, unsigned long MSecond) +void vCommandTimerWait(struct vnt_private *pDevice, unsigned long MSecond) { - PSDevice pDevice = (PSDevice)hDeviceContext; init_timer(&pDevice->sTimerCommand); @@ -331,23 +304,22 @@ void vCommandTimerWait(void *hDeviceContext, unsigned long MSecond) return; } -void vRunCommand(void *hDeviceContext) +void vRunCommand(struct vnt_private *pDevice) { - PSDevice pDevice = (PSDevice)hDeviceContext; - PSMgmtObject pMgmt = &(pDevice->sMgmtObj); - PWLAN_IE_SSID pItemSSID; - PWLAN_IE_SSID pItemSSIDCurr; - CMD_STATUS Status; - unsigned int ii; - BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; - struct sk_buff *skb; - BYTE byData; + struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; + PWLAN_IE_SSID pItemSSID; + PWLAN_IE_SSID pItemSSIDCurr; + CMD_STATUS Status; + struct sk_buff *skb; union iwreq_data wrqu; + int ii; + u8 byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; + u8 byData; if (pDevice->dwDiagRefCount != 0) return; - if (pDevice->bCmdRunning != TRUE) + if (pDevice->bCmdRunning != true) return; spin_lock_irq(&pDevice->lock); @@ -357,7 +329,7 @@ void vRunCommand(void *hDeviceContext) case WLAN_CMD_SCAN_START: pDevice->byReAssocCount = 0; - if (pDevice->bRadioOff == TRUE) { + if (pDevice->bRadioOff == true) { s_bCommandComplete(pDevice); spin_unlock_irq(&pDevice->lock); return; @@ -385,7 +357,7 @@ void vRunCommand(void *hDeviceContext) if (pDevice->bUpdateBBVGA) { BBvSetShortSlotTime(pDevice); BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent); - BBvUpdatePreEDThreshold(pDevice, FALSE); + BBvUpdatePreEDThreshold(pDevice, false); } // Set channel back vAdHocBeaconRestart(pDevice); @@ -397,7 +369,7 @@ void vRunCommand(void *hDeviceContext) pDevice->byRxMode |= RCR_BSSID; } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Scanning, set back to channel: [%d]\n", pMgmt->uCurrChannel); - pDevice->bStopDataPkt = FALSE; + pDevice->bStopDataPkt = false; s_bCommandComplete(pDevice); spin_unlock_irq(&pDevice->lock); return; @@ -423,7 +395,7 @@ void vRunCommand(void *hDeviceContext) pDevice->bLinkPass); */ pMgmt->eScanState = WMAC_IS_SCANNING; pDevice->byScanBBType = pDevice->byBBType; //lucas - pDevice->bStopDataPkt = TRUE; + pDevice->bStopDataPkt = true; // Turn off RCR_BSSID filter every time MACvRegBitsOff(pDevice, MAC_REG_RCR, RCR_BSSID); pDevice->byRxMode &= ~RCR_BSSID; @@ -447,7 +419,7 @@ void vRunCommand(void *hDeviceContext) if (pDevice->bUpdateBBVGA) { BBvSetShortSlotTime(pDevice); BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]); - BBvUpdatePreEDThreshold(pDevice, TRUE); + BBvUpdatePreEDThreshold(pDevice, true); } pMgmt->uScanChannel++; @@ -461,7 +433,7 @@ void vRunCommand(void *hDeviceContext) pDevice->eCommandState = WLAN_CMD_SCAN_END; } - if ((pMgmt->b11hEnable == FALSE) || + if ((pMgmt->b11hEnable == false) || (pMgmt->uScanChannel < CB_MAX_CHANNEL_24G)) { s_vProbeChannel(pDevice); spin_unlock_irq(&pDevice->lock); @@ -488,7 +460,7 @@ void vRunCommand(void *hDeviceContext) if (pDevice->bUpdateBBVGA) { BBvSetShortSlotTime(pDevice); BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent); - BBvUpdatePreEDThreshold(pDevice, FALSE); + BBvUpdatePreEDThreshold(pDevice, false); } // Set channel back @@ -502,7 +474,7 @@ void vRunCommand(void *hDeviceContext) } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Scanning, set back to channel: [%d]\n", pMgmt->uCurrChannel); pMgmt->eScanState = WMAC_NO_SCANNING; - pDevice->bStopDataPkt = FALSE; + pDevice->bStopDataPkt = false; /*send scan event to wpa_Supplicant*/ PRINT_K("wireless_send_event--->SIOCGIWSCAN(scan done)\n"); @@ -521,12 +493,12 @@ void vRunCommand(void *hDeviceContext) return; } else { - pDevice->bwextstep0 = FALSE; - pDevice->bwextstep1 = FALSE; - pDevice->bwextstep2 = FALSE; - pDevice->bwextstep3 = FALSE; - pDevice->bWPASuppWextEnabled = FALSE; - pDevice->fWPA_Authened = FALSE; + pDevice->bwextstep0 = false; + pDevice->bwextstep1 = false; + pDevice->bwextstep2 = false; + pDevice->bwextstep3 = false; + pDevice->bWPASuppWextEnabled = false; + pDevice->fWPA_Authened = false; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Send Disassociation Packet..\n"); // reason = 8 : disassoc because sta has left @@ -535,18 +507,18 @@ void vRunCommand(void *hDeviceContext) pMgmt->abyCurrBSSID, (8), &Status); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW); // unlock command busy pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID; pItemSSID->len = 0; memset(pItemSSID->abySSID, 0, WLAN_SSID_MAXLEN); pMgmt->eCurrState = WMAC_STATE_IDLE; - pMgmt->sNodeDBTable[0].bActive = FALSE; -// pDevice->bBeaconBufReady = FALSE; + pMgmt->sNodeDBTable[0].bActive = false; +// pDevice->bBeaconBufReady = false; } netif_stop_queue(pDevice->dev); - if (pDevice->bNeedRadioOFF == TRUE) + if (pDevice->bNeedRadioOFF == true) CARDbRadioPowerOff(pDevice); s_bCommandComplete(pDevice); break; @@ -555,7 +527,7 @@ void vRunCommand(void *hDeviceContext) case WLAN_CMD_SSID_START: pDevice->byReAssocCount = 0; - if (pDevice->bRadioOff == TRUE) { + if (pDevice->bRadioOff == true) { s_bCommandComplete(pDevice); spin_unlock_irq(&pDevice->lock); return; @@ -588,7 +560,7 @@ void vRunCommand(void *hDeviceContext) } } netif_stop_queue(pDevice->dev); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW); } // set initial state @@ -625,9 +597,9 @@ void vRunCommand(void *hDeviceContext) if (netif_queue_stopped(pDevice->dev)){ netif_wake_queue(pDevice->dev); } - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_INTER); - pMgmt->sNodeDBTable[0].bActive = TRUE; + pMgmt->sNodeDBTable[0].bActive = true; pMgmt->sNodeDBTable[0].uInActiveCount = 0; } else { @@ -658,7 +630,7 @@ void vRunCommand(void *hDeviceContext) BSSvAddMulticastNode(pDevice); s_bClearBSSID_SCAN(pDevice); /* - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_INTER); if (netif_queue_stopped(pDevice->dev)){ netif_wake_queue(pDevice->dev); @@ -668,7 +640,7 @@ void vRunCommand(void *hDeviceContext) } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disconnect SSID none\n"); - // if(pDevice->bWPASuppWextEnabled == TRUE) + // if(pDevice->bWPASuppWextEnabled == true) { union iwreq_data wrqu; memset(&wrqu, 0, sizeof (wrqu)); @@ -726,7 +698,7 @@ void vRunCommand(void *hDeviceContext) */ pDevice->byLinkWaitCount = 0; pDevice->byReAssocCount = 0; - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_INTER); s_bClearBSSID_SCAN(pDevice); @@ -734,20 +706,20 @@ void vRunCommand(void *hDeviceContext) netif_wake_queue(pDevice->dev); } - if(pDevice->IsTxDataTrigger != FALSE) { //TxDataTimer is not triggered at the first time + if(pDevice->IsTxDataTrigger != false) { //TxDataTimer is not triggered at the first time // printk("Re-initial TxDataTimer****\n"); del_timer(&pDevice->sTimerTxData); init_timer(&pDevice->sTimerTxData); pDevice->sTimerTxData.data = (unsigned long) pDevice; pDevice->sTimerTxData.function = (TimerFunction)BSSvSecondTxData; pDevice->sTimerTxData.expires = RUN_AT(10*HZ); //10s callback - pDevice->fTxDataInSleep = FALSE; + pDevice->fTxDataInSleep = false; pDevice->nTxDataTimeCout = 0; } else { // printk("mike:-->First time trigger TimerTxData InSleep\n"); } - pDevice->IsTxDataTrigger = TRUE; + pDevice->IsTxDataTrigger = true; add_timer(&pDevice->sTimerTxData); } @@ -773,15 +745,15 @@ void vRunCommand(void *hDeviceContext) del_timer(&pMgmt->sTimerSecondCallback); pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrMode = WMAC_MODE_STANDBY; - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW); - if (pDevice->bEnableHostWEP == TRUE) + if (pDevice->bEnableHostWEP == true) BSSvClearNodeDBTable(pDevice, 1); else BSSvClearNodeDBTable(pDevice, 0); pDevice->uAssocCount = 0; pMgmt->eCurrState = WMAC_STATE_IDLE; - pDevice->bFixRate = FALSE; + pDevice->bFixRate = false; vMgrCreateOwnIBSS((void *) pDevice, &Status); if (Status != CMD_STATUS_SUCCESS) { @@ -796,7 +768,7 @@ void vRunCommand(void *hDeviceContext) if (netif_queue_stopped(pDevice->dev)){ netif_wake_queue(pDevice->dev); } - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_INTER); add_timer(&pMgmt->sTimerSecondCallback); } @@ -809,10 +781,10 @@ void vRunCommand(void *hDeviceContext) while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[0].sTxPSQueue)) != NULL) { if (skb_queue_empty(&pMgmt->sNodeDBTable[0].sTxPSQueue)) { pMgmt->abyPSTxMap[0] &= ~byMask[0]; - pDevice->bMoreData = FALSE; + pDevice->bMoreData = false; } else { - pDevice->bMoreData = TRUE; + pDevice->bMoreData = true; } if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0) { @@ -834,10 +806,10 @@ void vRunCommand(void *hDeviceContext) // clear tx map pMgmt->abyPSTxMap[pMgmt->sNodeDBTable[ii].wAID >> 3] &= ~byMask[pMgmt->sNodeDBTable[ii].wAID & 7]; - pDevice->bMoreData = FALSE; + pDevice->bMoreData = false; } else { - pDevice->bMoreData = TRUE; + pDevice->bMoreData = true; } if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0) { @@ -856,7 +828,7 @@ void vRunCommand(void *hDeviceContext) ~byMask[pMgmt->sNodeDBTable[ii].wAID & 7]; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Index=%d PS queue clear \n", ii); } - pMgmt->sNodeDBTable[ii].bRxPSPoll = FALSE; + pMgmt->sNodeDBTable[ii].bRxPSPoll = false; } } @@ -866,7 +838,7 @@ void vRunCommand(void *hDeviceContext) case WLAN_CMD_RADIO_START: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState == WLAN_CMD_RADIO_START\n"); - // if (pDevice->bRadioCmd == TRUE) + // if (pDevice->bRadioCmd == true) // CARDbRadioPowerOn(pDevice); // else // CARDbRadioPowerOff(pDevice); @@ -894,31 +866,31 @@ void vRunCommand(void *hDeviceContext) pDevice->cbFreeCmdQueue = CMD_Q_SIZE; pDevice->uCmdDequeueIdx = 0; pDevice->uCmdEnqueueIdx = 0; - //0415pDevice->bCmdRunning = FALSE; - pDevice->bCmdClear = TRUE; - pDevice->bStopTx0Pkt = FALSE; - pDevice->bStopDataPkt = TRUE; + //0415pDevice->bCmdRunning = false; + pDevice->bCmdClear = true; + pDevice->bStopTx0Pkt = false; + pDevice->bStopDataPkt = true; pDevice->byKeyIndex = 0; - pDevice->bTransmitKey = FALSE; + pDevice->bTransmitKey = false; spin_unlock_irq(&pDevice->lock); KeyvInitTable(pDevice,&pDevice->sKey); spin_lock_irq(&pDevice->lock); pMgmt->byCSSPK = KEY_CTL_NONE; pMgmt->byCSSGK = KEY_CTL_NONE; - if (pDevice->bLinkPass == TRUE) { + if (pDevice->bLinkPass == true) { // reason = 8 : disassoc because sta has left vMgrDisassocBeginSta((void *) pDevice, pMgmt, pMgmt->abyCurrBSSID, (8), &Status); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; // unlock command busy pMgmt->eCurrState = WMAC_STATE_IDLE; - pMgmt->sNodeDBTable[0].bActive = FALSE; - // if(pDevice->bWPASuppWextEnabled == TRUE) + pMgmt->sNodeDBTable[0].bActive = false; + // if(pDevice->bWPASuppWextEnabled == true) { union iwreq_data wrqu; memset(&wrqu, 0, sizeof (wrqu)); @@ -927,11 +899,11 @@ void vRunCommand(void *hDeviceContext) wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL); } } - pDevice->bwextstep0 = FALSE; - pDevice->bwextstep1 = FALSE; - pDevice->bwextstep2 = FALSE; - pDevice->bwextstep3 = FALSE; - pDevice->bWPASuppWextEnabled = FALSE; + pDevice->bwextstep0 = false; + pDevice->bwextstep1 = false; + pDevice->bwextstep2 = false; + pDevice->bwextstep3 = false; + pDevice->bWPASuppWextEnabled = false; //clear current SSID pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID; pItemSSID->len = 0; @@ -945,10 +917,10 @@ void vRunCommand(void *hDeviceContext) CARDbRadioPowerOff(pDevice); MACvRegBitsOn(pDevice,MAC_REG_GPIOCTL1,GPIO3_INTMD); ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_OFF); - pDevice->bHWRadioOff = TRUE; + pDevice->bHWRadioOff = true; } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" WLAN_CMD_RADIO_START_ON........................\n"); - pDevice->bHWRadioOff = FALSE; + pDevice->bHWRadioOff = false; CARDbRadioPowerOn(pDevice); MACvRegBitsOff(pDevice,MAC_REG_GPIOCTL1,GPIO3_INTMD); ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_ON); @@ -961,11 +933,11 @@ void vRunCommand(void *hDeviceContext) case WLAN_CMD_CHANGE_BBSENSITIVITY_START: - pDevice->bStopDataPkt = TRUE; + pDevice->bStopDataPkt = true; pDevice->byBBVGACurrent = pDevice->byBBVGANew; BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Change sensitivity pDevice->byBBVGACurrent = %x\n", pDevice->byBBVGACurrent); - pDevice->bStopDataPkt = FALSE; + pDevice->bStopDataPkt = false; s_bCommandComplete(pDevice); break; @@ -990,13 +962,13 @@ void vRunCommand(void *hDeviceContext) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Change from Antenna%d to", (int)pDevice->dwRxAntennaSel); if ( pDevice->dwRxAntennaSel == 0) { pDevice->dwRxAntennaSel=1; - if (pDevice->bTxRxAntInv == TRUE) + if (pDevice->bTxRxAntInv == true) BBvSetAntennaMode(pDevice, ANT_RXA); else BBvSetAntennaMode(pDevice, ANT_RXB); } else { pDevice->dwRxAntennaSel=0; - if (pDevice->bTxRxAntInv == TRUE) + if (pDevice->bTxRxAntInv == true) BBvSetAntennaMode(pDevice, ANT_RXB); else BBvSetAntennaMode(pDevice, ANT_RXA); @@ -1027,9 +999,9 @@ void vRunCommand(void *hDeviceContext) case WLAN_CMD_11H_CHSW_START: CARDbSetMediaChannel(pDevice, pDevice->byNewChannel); - pDevice->bChannelSwitch = FALSE; + pDevice->bChannelSwitch = false; pMgmt->uCurrChannel = pDevice->byNewChannel; - pDevice->bStopDataPkt = FALSE; + pDevice->bStopDataPkt = false; s_bCommandComplete(pDevice); break; @@ -1043,24 +1015,19 @@ void vRunCommand(void *hDeviceContext) } -static -BOOL -s_bCommandComplete ( - PSDevice pDevice - ) +static int s_bCommandComplete(struct vnt_private *pDevice) { - PWLAN_IE_SSID pSSID; - BOOL bRadioCmd = FALSE; - //WORD wDeAuthenReason = 0; - BOOL bForceSCAN = TRUE; - PSMgmtObject pMgmt = &(pDevice->sMgmtObj); + struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; + PWLAN_IE_SSID pSSID; + int bRadioCmd = false; + int bForceSCAN = true; pDevice->eCommandState = WLAN_CMD_IDLE; if (pDevice->cbFreeCmdQueue == CMD_Q_SIZE) { //Command Queue Empty - pDevice->bCmdRunning = FALSE; - return TRUE; + pDevice->bCmdRunning = false; + return true; } else { pDevice->eCommand = pDevice->eCmdQueue[pDevice->uCmdDequeueIdx].eCmd; @@ -1069,7 +1036,7 @@ s_bCommandComplete ( bForceSCAN = pDevice->eCmdQueue[pDevice->uCmdDequeueIdx].bForceSCAN; ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdDequeueIdx, CMD_Q_SIZE); pDevice->cbFreeCmdQueue++; - pDevice->bCmdRunning = TRUE; + pDevice->bCmdRunning = true; switch ( pDevice->eCommand ) { case WLAN_CMD_BSSID_SCAN: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState= WLAN_CMD_BSSID_SCAN\n"); @@ -1081,7 +1048,7 @@ s_bCommandComplete ( memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); } /* - if ((bForceSCAN == FALSE) && (pDevice->bLinkPass == TRUE)) { + if ((bForceSCAN == false) && (pDevice->bLinkPass == true)) { if ((pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) && ( !memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->abySSID, pSSID->len))) { pDevice->eCommandState = WLAN_CMD_IDLE; @@ -1146,29 +1113,26 @@ s_bCommandComplete ( break; } - vCommandTimerWait((void *) pDevice, 0); + vCommandTimerWait(pDevice, 0); } - return TRUE; + return true; } -BOOL bScheduleCommand(void *hDeviceContext, - CMD_CODE eCommand, - PBYTE pbyItem0) +int bScheduleCommand(struct vnt_private *pDevice, + CMD_CODE eCommand, u8 *pbyItem0) { - PSDevice pDevice = (PSDevice)hDeviceContext; - if (pDevice->cbFreeCmdQueue == 0) { - return (FALSE); + return (false); } pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].eCmd = eCommand; - pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = TRUE; + pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = true; memset(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, 0 , WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); if (pbyItem0 != NULL) { switch (eCommand) { case WLAN_CMD_BSSID_SCAN: - pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = FALSE; + pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = false; memcpy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, pbyItem0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); break; @@ -1199,12 +1163,12 @@ BOOL bScheduleCommand(void *hDeviceContext, ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdEnqueueIdx, CMD_Q_SIZE); pDevice->cbFreeCmdQueue--; - if (pDevice->bCmdRunning == FALSE) { + if (pDevice->bCmdRunning == false) { s_bCommandComplete(pDevice); } else { } - return (TRUE); + return (true); } @@ -1219,14 +1183,13 @@ BOOL bScheduleCommand(void *hDeviceContext, * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -static BOOL s_bClearBSSID_SCAN(void *hDeviceContext) +static int s_bClearBSSID_SCAN(struct vnt_private *pDevice) { - PSDevice pDevice = (PSDevice)hDeviceContext; - unsigned int uCmdDequeueIdx = pDevice->uCmdDequeueIdx; - unsigned int ii; + unsigned int uCmdDequeueIdx = pDevice->uCmdDequeueIdx; + unsigned int ii; if ((pDevice->cbFreeCmdQueue < CMD_Q_SIZE) && (uCmdDequeueIdx != pDevice->uCmdEnqueueIdx)) { for (ii = 0; ii < (CMD_Q_SIZE - pDevice->cbFreeCmdQueue); ii ++) { @@ -1237,14 +1200,13 @@ static BOOL s_bClearBSSID_SCAN(void *hDeviceContext) break; } } - return TRUE; + return true; } //mike add:reset command timer -void vResetCommandTimer(void *hDeviceContext) +void vResetCommandTimer(struct vnt_private *pDevice) { - PSDevice pDevice = (PSDevice)hDeviceContext; //delete timer del_timer(&pDevice->sTimerCommand); @@ -1257,14 +1219,13 @@ void vResetCommandTimer(void *hDeviceContext) pDevice->uCmdDequeueIdx = 0; pDevice->uCmdEnqueueIdx = 0; pDevice->eCommandState = WLAN_CMD_IDLE; - pDevice->bCmdRunning = FALSE; - pDevice->bCmdClear = FALSE; + pDevice->bCmdRunning = false; + pDevice->bCmdClear = false; } -void BSSvSecondTxData(void *hDeviceContext) +void BSSvSecondTxData(struct vnt_private *pDevice) { - PSDevice pDevice = (PSDevice)hDeviceContext; - PSMgmtObject pMgmt = &(pDevice->sMgmtObj); + struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; pDevice->nTxDataTimeCout++; @@ -1278,13 +1239,13 @@ void BSSvSecondTxData(void *hDeviceContext) spin_lock_irq(&pDevice->lock); //is wap_supplicant running successful OR only open && sharekey mode! - if (((pDevice->bLinkPass == TRUE) && + if (((pDevice->bLinkPass == true) && (pMgmt->eAuthenMode < WMAC_AUTH_WPA)) || //open && sharekey linking - (pDevice->fWPA_Authened == TRUE)) { //wpa linking + (pDevice->fWPA_Authened == true)) { //wpa linking // printk("mike:%s-->InSleep Tx Data Procedure\n",__FUNCTION__); - pDevice->fTxDataInSleep = TRUE; + pDevice->fTxDataInSleep = true; PSbSendNullPacket(pDevice); //send null packet - pDevice->fTxDataInSleep = FALSE; + pDevice->fTxDataInSleep = false; } spin_unlock_irq(&pDevice->lock); |