2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 15:43:59 +08:00

staging: vt6656: code cleanup, removed HANDLE definition in ttype.h

Checkpatch warnings about using externs in .c files were not resolved,
neither some long lines on deeply nested code.

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Andres More 2010-05-06 20:34:29 -03:00 committed by Greg Kroah-Hartman
parent 3afc7cc38c
commit 0cbd8d9854
18 changed files with 492 additions and 767 deletions

View File

@ -1513,7 +1513,9 @@ BBvAntennaDiversity (PSDevice pDevice, BYTE byRxRate, BYTE bySQ3)
if ( pDevice->byTMax == 0 ) if ( pDevice->byTMax == 0 )
return; return;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL); bScheduleCommand((void *) pDevice,
WLAN_CMD_CHANGE_ANTENNA,
NULL);
pDevice->byAntennaState = 1; pDevice->byAntennaState = 1;
@ -1543,7 +1545,9 @@ BBvAntennaDiversity (PSDevice pDevice, BYTE byRxRate, BYTE bySQ3)
((pDevice->ulSQ3_State1 != 0) && (pDevice->ulSQ3_State0 != 0) && (pDevice->ulSQ3_State0 < pDevice->ulSQ3_State1)) ((pDevice->ulSQ3_State1 != 0) && (pDevice->ulSQ3_State0 != 0) && (pDevice->ulSQ3_State0 < pDevice->ulSQ3_State1))
) { ) {
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL); bScheduleCommand((void *) pDevice,
WLAN_CMD_CHANGE_ANTENNA,
NULL);
pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ); pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ); pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ);
@ -1576,17 +1580,14 @@ BBvAntennaDiversity (PSDevice pDevice, BYTE byRxRate, BYTE bySQ3)
* *
-*/ -*/
void void TimerSQ3CallBack(void *hDeviceContext)
TimerSQ3CallBack (
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TimerSQ3CallBack..."); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TimerSQ3CallBack...");
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL);
pDevice->byAntennaState = 0; pDevice->byAntennaState = 0;
s_vClearSQ3Value(pDevice); s_vClearSQ3Value(pDevice);
pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ); pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
@ -1618,10 +1619,7 @@ TimerSQ3CallBack (
* *
-*/ -*/
void void TimerSQ3Tmax3CallBack(void *hDeviceContext)
TimerSQ3Tmax3CallBack (
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
@ -1639,7 +1637,7 @@ TimerSQ3Tmax3CallBack (
return; return;
} }
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL);
pDevice->byAntennaState = 1; pDevice->byAntennaState = 1;
del_timer(&pDevice->TimerSQ3Tmax3); del_timer(&pDevice->TimerSQ3Tmax3);
del_timer(&pDevice->TimerSQ3Tmax2); del_timer(&pDevice->TimerSQ3Tmax2);

View File

@ -117,15 +117,8 @@ BBvCaculateParameter (
// timer for antenna diversity // timer for antenna diversity
void void TimerSQ3CallBack(void *hDeviceContext);
TimerSQ3CallBack ( void TimerSQ3Tmax3CallBack(void *hDeviceContext);
HANDLE hDeviceContext
);
void
TimerSQ3Tmax3CallBack (
HANDLE hDeviceContext
);
void BBvAntennaDiversity(PSDevice pDevice, BYTE byRxRate, BYTE bySQ3); void BBvAntennaDiversity(PSDevice pDevice, BYTE byRxRate, BYTE bySQ3);
void BBvLoopbackOn(PSDevice pDevice); void BBvLoopbackOn(PSDevice pDevice);

View File

@ -91,19 +91,13 @@ const WORD awHWRetry1[5][5] = {
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
void s_vCheckSensitivity( void s_vCheckSensitivity(void *hDeviceContext);
HANDLE hDeviceContext void s_vCheckPreEDThreshold(void *hDeviceContext);
);
void s_vCheckPreEDThreshold(
HANDLE hDeviceContext
);
#ifdef Calcu_LinkQual #ifdef Calcu_LinkQual
void s_uCalculateLinkQual( void s_uCalculateLinkQual(void *hDeviceContext);
HANDLE hDeviceContext
);
#endif #endif
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
@ -123,13 +117,10 @@ void s_uCalculateLinkQual(
* *
-*/ -*/
PKnownBSS PKnownBSS BSSpSearchBSSList(void *hDeviceContext,
BSSpSearchBSSList(
HANDLE hDeviceContext,
PBYTE pbyDesireBSSID, PBYTE pbyDesireBSSID,
PBYTE pbyDesireSSID, PBYTE pbyDesireSSID,
CARD_PHY_TYPE ePhyType CARD_PHY_TYPE ePhyType)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -296,11 +287,7 @@ pDevice->bSameBSSMaxNum = jj;
-*/ -*/
void void BSSvClearBSSList(void *hDeviceContext, BOOL bKeepCurrBSSID)
BSSvClearBSSList(
HANDLE hDeviceContext,
BOOL bKeepCurrBSSID
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -342,12 +329,9 @@ BSSvClearBSSList(
* TRUE if found. * TRUE if found.
* *
-*/ -*/
PKnownBSS PKnownBSS BSSpAddrIsInBSSList(void *hDeviceContext,
BSSpAddrIsInBSSList(
HANDLE hDeviceContext,
PBYTE abyBSSID, PBYTE abyBSSID,
PWLAN_IE_SSID pSSID PWLAN_IE_SSID pSSID)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -383,9 +367,7 @@ BSSpAddrIsInBSSList(
* *
-*/ -*/
BOOL BOOL BSSbInsertToBSSList(void *hDeviceContext,
BSSbInsertToBSSList (
HANDLE hDeviceContext,
PBYTE abyBSSIDAddr, PBYTE abyBSSIDAddr,
QWORD qwTimestamp, QWORD qwTimestamp,
WORD wBeaconInterval, WORD wBeaconInterval,
@ -401,8 +383,7 @@ BSSbInsertToBSSList (
PWLAN_IE_QUIET pIE_Quiet, PWLAN_IE_QUIET pIE_Quiet,
UINT uIELength, UINT uIELength,
PBYTE pbyIEs, PBYTE pbyIEs,
HANDLE pRxPacketContext void *pRxPacketContext)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
@ -518,7 +499,9 @@ BSSbInsertToBSSList (
if ((bIs802_1x == TRUE) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) && if ((bIs802_1x == TRUE) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) &&
( !memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) { ( !memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) {
bAdd_PMKID_Candidate((HANDLE)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj); bAdd_PMKID_Candidate((void *) pDevice,
pBSSList->abyBSSID,
&pBSSList->sRSNCapObj);
if ((pDevice->bLinkPass == TRUE) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { if ((pDevice->bLinkPass == TRUE) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) {
if ((KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, PAIRWISE_KEY, &pTransmitKey) == TRUE) || if ((KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, PAIRWISE_KEY, &pTransmitKey) == TRUE) ||
@ -602,9 +585,7 @@ BSSbInsertToBSSList (
-*/ -*/
// TODO: input structure modify // TODO: input structure modify
BOOL BOOL BSSbUpdateToBSSList(void *hDeviceContext,
BSSbUpdateToBSSList (
HANDLE hDeviceContext,
QWORD qwTimestamp, QWORD qwTimestamp,
WORD wBeaconInterval, WORD wBeaconInterval,
WORD wCapInfo, WORD wCapInfo,
@ -621,8 +602,7 @@ BSSbUpdateToBSSList (
PKnownBSS pBSSList, PKnownBSS pBSSList,
UINT uIELength, UINT uIELength,
PBYTE pbyIEs, PBYTE pbyIEs,
HANDLE pRxPacketContext void *pRxPacketContext)
)
{ {
int ii, jj; int ii, jj;
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
@ -768,12 +748,9 @@ BSSbUpdateToBSSList (
* *
-*/ -*/
BOOL BOOL BSSbIsSTAInNodeDB(void *hDeviceContext,
BSSbIsSTAInNodeDB(
HANDLE hDeviceContext,
PBYTE abyDstAddr, PBYTE abyDstAddr,
PUINT puNodeIndex PUINT puNodeIndex)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -804,11 +781,7 @@ BSSbIsSTAInNodeDB(
* None * None
* *
-*/ -*/
void void BSSvCreateOneNode(void *hDeviceContext, PUINT puNodeIndex)
BSSvCreateOneNode(
HANDLE hDeviceContext,
PUINT puNodeIndex
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
@ -869,11 +842,8 @@ BSSvCreateOneNode(
* None * None
* *
-*/ -*/
void
BSSvRemoveOneNode( void BSSvRemoveOneNode(void *hDeviceContext, UINT uNodeIndex)
HANDLE hDeviceContext,
UINT uNodeIndex
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
@ -902,13 +872,10 @@ BSSvRemoveOneNode(
* *
-*/ -*/
void void BSSvUpdateAPNode(void *hDeviceContext,
BSSvUpdateAPNode(
HANDLE hDeviceContext,
PWORD pwCapInfo, PWORD pwCapInfo,
PWLAN_IE_SUPP_RATES pSuppRates, PWLAN_IE_SUPP_RATES pSuppRates,
PWLAN_IE_SUPP_RATES pExtSuppRates PWLAN_IE_SUPP_RATES pExtSuppRates)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -946,10 +913,6 @@ BSSvUpdateAPNode(
}; };
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -961,11 +924,7 @@ BSSvUpdateAPNode(
* *
-*/ -*/
void BSSvAddMulticastNode(void *hDeviceContext)
void
BSSvAddMulticastNode(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -991,10 +950,6 @@ BSSvAddMulticastNode(
}; };
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -1008,11 +963,7 @@ BSSvAddMulticastNode(
* *
-*/ -*/
void BSSvSecondCallBack(void *hDeviceContext)
void
BSSvSecondCallBack(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -1080,7 +1031,7 @@ if((pMgmt->eCurrState!=WMAC_STATE_ASSOC) &&
#endif #endif
#ifdef Calcu_LinkQual #ifdef Calcu_LinkQual
s_uCalculateLinkQual((HANDLE)pDevice); s_uCalculateLinkQual((void *)pDevice);
#endif #endif
for (ii = 0; ii < (MAX_NODE_NUM + 1); ii++) { for (ii = 0; ii < (MAX_NODE_NUM + 1); ii++) {
@ -1226,14 +1177,16 @@ if((pMgmt->eCurrState!=WMAC_STATE_ASSOC) &&
// DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Callback inactive Count = [%d]\n", pMgmt->sNodeDBTable[0].uInActiveCount); // DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Callback inactive Count = [%d]\n", pMgmt->sNodeDBTable[0].uInActiveCount);
if (pDevice->bUpdateBBVGA) { if (pDevice->bUpdateBBVGA) {
// s_vCheckSensitivity((HANDLE) pDevice); /* s_vCheckSensitivity((void *) pDevice); */
s_vCheckPreEDThreshold((HANDLE)pDevice); s_vCheckPreEDThreshold((void *) pDevice);
} }
if ((pMgmt->sNodeDBTable[0].uInActiveCount >= (LOST_BEACON_COUNT/2)) && if ((pMgmt->sNodeDBTable[0].uInActiveCount >= (LOST_BEACON_COUNT/2)) &&
(pDevice->byBBVGACurrent != pDevice->abyBBVGA[0]) ) { (pDevice->byBBVGACurrent != pDevice->abyBBVGA[0]) ) {
pDevice->byBBVGANew = pDevice->abyBBVGA[0]; pDevice->byBBVGANew = pDevice->abyBBVGA[0];
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_CHANGE_BBSENSITIVITY, NULL); bScheduleCommand((void *) pDevice,
WLAN_CMD_CHANGE_BBSENSITIVITY,
NULL);
} }
if (pMgmt->sNodeDBTable[0].uInActiveCount >= LOST_BEACON_COUNT) { if (pMgmt->sNodeDBTable[0].uInActiveCount >= LOST_BEACON_COUNT) {
@ -1281,9 +1234,13 @@ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "bRoaming %d, !\n", pDevice->bRoaming );
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "bIsRoaming %d, !\n", pDevice->bIsRoaming ); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "bIsRoaming %d, !\n", pDevice->bIsRoaming );
if ((pDevice->bRoaming == TRUE)&&(pDevice->bIsRoaming == TRUE)){ if ((pDevice->bRoaming == TRUE)&&(pDevice->bIsRoaming == TRUE)){
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Fast Roaming ...\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Fast Roaming ...\n");
BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass); BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *) pDevice,
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID); WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
WLAN_CMD_SSID,
pMgmt->abyDesireSSID);
pDevice->uAutoReConnectTime = 0; pDevice->uAutoReConnectTime = 0;
pDevice->uIsroamingTime = 0; pDevice->uIsroamingTime = 0;
pDevice->bRoaming = FALSE; pDevice->bRoaming = FALSE;
@ -1326,10 +1283,14 @@ else {
pDevice->eEncryptionStatus = pDevice->eOldEncryptionStatus; pDevice->eEncryptionStatus = pDevice->eOldEncryptionStatus;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Roaming ...\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Roaming ...\n");
BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass); BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
pMgmt->eScanType = WMAC_SCAN_ACTIVE; pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *) pDevice,
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID); WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
WLAN_CMD_SSID,
pMgmt->abyDesireSSID);
pDevice->uAutoReConnectTime = 0; pDevice->uAutoReConnectTime = 0;
} }
} }
@ -1345,16 +1306,16 @@ else {
else { else {
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Adhoc re-scaning ...\n"); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Adhoc re-scaning ...\n");
pMgmt->eScanType = WMAC_SCAN_ACTIVE; pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL);
pDevice->uAutoReConnectTime = 0; pDevice->uAutoReConnectTime = 0;
}; };
} }
if (pMgmt->eCurrState == WMAC_STATE_JOINTED) { if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
if (pDevice->bUpdateBBVGA) { if (pDevice->bUpdateBBVGA) {
//s_vCheckSensitivity((HANDLE) pDevice); /* s_vCheckSensitivity((void *) pDevice); */
s_vCheckPreEDThreshold((HANDLE)pDevice); s_vCheckPreEDThreshold((void *) pDevice);
} }
if (pMgmt->sNodeDBTable[0].uInActiveCount >=ADHOC_LOST_BEACON_COUNT) { if (pMgmt->sNodeDBTable[0].uInActiveCount >=ADHOC_LOST_BEACON_COUNT) {
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Lost other STA beacon [%d] sec, started !\n", pMgmt->sNodeDBTable[0].uInActiveCount); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Lost other STA beacon [%d] sec, started !\n", pMgmt->sNodeDBTable[0].uInActiveCount);
@ -1379,9 +1340,6 @@ else {
return; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -1395,15 +1353,10 @@ else {
* *
-*/ -*/
void BSSvUpdateNodeTxCounter(void *hDeviceContext,
void
BSSvUpdateNodeTxCounter(
HANDLE hDeviceContext,
PSStatCounter pStatistic, PSStatCounter pStatistic,
BYTE byTSR, BYTE byTSR,
BYTE byPktNO BYTE byPktNO)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -1417,8 +1370,6 @@ BSSvUpdateNodeTxCounter(
BYTE byPktNum; BYTE byPktNum;
WORD wFIFOCtl; WORD wFIFOCtl;
byPktNum = (byPktNO & 0x0F) >> 4; byPktNum = (byPktNO & 0x0F) >> 4;
byTxRetry = (byTSR & 0xF0) >> 4; byTxRetry = (byTSR & 0xF0) >> 4;
wRate = (WORD) (byPktNO & 0xF0) >> 4; wRate = (WORD) (byPktNO & 0xF0) >> 4;
@ -1488,7 +1439,9 @@ BSSvUpdateNodeTxCounter(
if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) || if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) ||
(pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) { (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) {
if (BSSbIsSTAInNodeDB((HANDLE)pDevice, pbyDestAddr, &uNodeIndex)){ if (BSSbIsSTAInNodeDB((void *) pDevice,
pbyDestAddr,
&uNodeIndex)) {
pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts += 1; pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts += 1;
if ( !(byTSR & (TSR_TMO | TSR_RETRYTMO))) { if ( !(byTSR & (TSR_TMO | TSR_RETRYTMO))) {
// transmit success, TxAttempts at least plus one // transmit success, TxAttempts at least plus one
@ -1544,9 +1497,6 @@ BSSvUpdateNodeTxCounter(
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -1565,13 +1515,8 @@ BSSvUpdateNodeTxCounter(
* *
-*/ -*/
void BSSvClearNodeDBTable(void *hDeviceContext,
void UINT uStartIndex)
BSSvClearNodeDBTable(
HANDLE hDeviceContext,
UINT uStartIndex
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -1594,10 +1539,7 @@ BSSvClearNodeDBTable(
return; return;
}; };
void s_vCheckSensitivity(void *hDeviceContext)
void s_vCheckSensitivity(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PKnownBSS pBSSList = NULL; PKnownBSS pBSSList = NULL;
@ -1629,7 +1571,9 @@ void s_vCheckSensitivity(
if (pDevice->byBBVGANew != pDevice->byBBVGACurrent) { if (pDevice->byBBVGANew != pDevice->byBBVGACurrent) {
pDevice->uBBVGADiffCount++; pDevice->uBBVGADiffCount++;
if (pDevice->uBBVGADiffCount >= BB_VGA_CHANGE_THRESHOLD) if (pDevice->uBBVGADiffCount >= BB_VGA_CHANGE_THRESHOLD)
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_CHANGE_BBSENSITIVITY, NULL); bScheduleCommand((void *) pDevice,
WLAN_CMD_CHANGE_BBSENSITIVITY,
NULL);
} else { } else {
pDevice->uBBVGADiffCount = 0; pDevice->uBBVGADiffCount = 0;
} }
@ -1639,9 +1583,7 @@ void s_vCheckSensitivity(
} }
#ifdef Calcu_LinkQual #ifdef Calcu_LinkQual
void s_uCalculateLinkQual( void s_uCalculateLinkQual(void *hDeviceContext)
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
ULONG TxOkRatio, TxCnt; ULONG TxOkRatio, TxCnt;
@ -1687,10 +1629,7 @@ else
} }
#endif #endif
void void BSSvClearAnyBSSJoinRecord(void *hDeviceContext)
BSSvClearAnyBSSJoinRecord (
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -1702,9 +1641,7 @@ BSSvClearAnyBSSJoinRecord (
return; return;
} }
void s_vCheckPreEDThreshold( void s_vCheckPreEDThreshold(void *hDeviceContext)
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PKnownBSS pBSSList = NULL; PKnownBSS pBSSList = NULL;

View File

@ -226,35 +226,20 @@ typedef struct tagKnownNodeDB {
} KnownNodeDB, *PKnownNodeDB; } KnownNodeDB, *PKnownNodeDB;
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
PKnownBSS BSSpSearchBSSList(void *hDeviceContext,
PKnownBSS
BSSpSearchBSSList(
HANDLE hDeviceContext,
PBYTE pbyDesireBSSID, PBYTE pbyDesireBSSID,
PBYTE pbyDesireSSID, PBYTE pbyDesireSSID,
CARD_PHY_TYPE ePhyType CARD_PHY_TYPE ePhyType);
);
PKnownBSS PKnownBSS BSSpAddrIsInBSSList(void *hDeviceContext,
BSSpAddrIsInBSSList(
HANDLE hDeviceContext,
PBYTE abyBSSID, PBYTE abyBSSID,
PWLAN_IE_SSID pSSID PWLAN_IE_SSID pSSID);
);
void void BSSvClearBSSList(void *hDeviceContext, BOOL bKeepCurrBSSID);
BSSvClearBSSList(
HANDLE hDeviceContext,
BOOL bKeepCurrBSSID
);
BOOL BOOL BSSbInsertToBSSList(void *hDeviceContext,
BSSbInsertToBSSList(
HANDLE hDeviceContext,
PBYTE abyBSSIDAddr, PBYTE abyBSSIDAddr,
QWORD qwTimestamp, QWORD qwTimestamp,
WORD wBeaconInterval, WORD wBeaconInterval,
@ -270,13 +255,9 @@ BSSbInsertToBSSList(
PWLAN_IE_QUIET pIE_Quiet, PWLAN_IE_QUIET pIE_Quiet,
UINT uIELength, UINT uIELength,
PBYTE pbyIEs, PBYTE pbyIEs,
HANDLE pRxPacketContext void *pRxPacketContext);
);
BOOL BSSbUpdateToBSSList(void *hDeviceContext,
BOOL
BSSbUpdateToBSSList(
HANDLE hDeviceContext,
QWORD qwTimestamp, QWORD qwTimestamp,
WORD wBeaconInterval, WORD wBeaconInterval,
WORD wCapInfo, WORD wCapInfo,
@ -293,67 +274,34 @@ BSSbUpdateToBSSList(
PKnownBSS pBSSList, PKnownBSS pBSSList,
UINT uIELength, UINT uIELength,
PBYTE pbyIEs, PBYTE pbyIEs,
HANDLE pRxPacketContext void *pRxPacketContext);
);
BOOL BSSbIsSTAInNodeDB(void *hDeviceContext,
BOOL
BSSbIsSTAInNodeDB(
HANDLE hDeviceContext,
PBYTE abyDstAddr, PBYTE abyDstAddr,
PUINT puNodeIndex PUINT puNodeIndex);
);
void void BSSvCreateOneNode(void *hDeviceContext, PUINT puNodeIndex);
BSSvCreateOneNode(
HANDLE hDeviceContext,
PUINT puNodeIndex
);
void void BSSvUpdateAPNode(void *hDeviceContext,
BSSvUpdateAPNode(
HANDLE hDeviceContext,
PWORD pwCapInfo, PWORD pwCapInfo,
PWLAN_IE_SUPP_RATES pItemRates, PWLAN_IE_SUPP_RATES pItemRates,
PWLAN_IE_SUPP_RATES pExtSuppRates PWLAN_IE_SUPP_RATES pExtSuppRates);
);
void BSSvSecondCallBack(void *hDeviceContext);
void void BSSvUpdateNodeTxCounter(void *hDeviceContext,
BSSvSecondCallBack(
HANDLE hDeviceContext
);
void
BSSvUpdateNodeTxCounter(
HANDLE hDeviceContext,
PSStatCounter pStatistic, PSStatCounter pStatistic,
BYTE byTSR, BYTE byTSR,
BYTE byPktNO BYTE byPktNO);
);
void void BSSvRemoveOneNode(void *hDeviceContext,
BSSvRemoveOneNode( UINT uNodeIndex);
HANDLE hDeviceContext,
UINT uNodeIndex
);
void void BSSvAddMulticastNode(void *hDeviceContext);
BSSvAddMulticastNode(
HANDLE hDeviceContext
);
void BSSvClearNodeDBTable(void *hDeviceContext,
UINT uStartIndex);
void void BSSvClearAnyBSSJoinRecord(void *hDeviceContext);
BSSvClearNodeDBTable(
HANDLE hDeviceContext,
UINT uStartIndex
);
void
BSSvClearAnyBSSJoinRecord(
HANDLE hDeviceContext
);
#endif /* __BSSDB_H__ */ #endif /* __BSSDB_H__ */

View File

@ -1069,7 +1069,9 @@ static BOOL s_bAPModeRxCtl (
// delcare received ps-poll event // delcare received ps-poll event
if (IS_CTL_PSPOLL(pbyFrame)) { if (IS_CTL_PSPOLL(pbyFrame)) {
pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = TRUE; pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = TRUE;
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_RX_PSPOLL, NULL); bScheduleCommand((void *) pDevice,
WLAN_CMD_RX_PSPOLL,
NULL);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 1\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 1\n");
} }
else { else {
@ -1078,7 +1080,9 @@ static BOOL s_bAPModeRxCtl (
if (!IS_FC_POWERMGT(pbyFrame)) { if (!IS_FC_POWERMGT(pbyFrame)) {
pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = FALSE; pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = FALSE;
pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = TRUE; pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = TRUE;
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_RX_PSPOLL, NULL); bScheduleCommand((void *) pDevice,
WLAN_CMD_RX_PSPOLL,
NULL);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 2\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 2\n");
} }
} }
@ -1094,7 +1098,9 @@ static BOOL s_bAPModeRxCtl (
if (pMgmt->sNodeDBTable[iSANodeIndex].wEnQueueCnt > 0) { if (pMgmt->sNodeDBTable[iSANodeIndex].wEnQueueCnt > 0) {
pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = FALSE; pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = FALSE;
pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = TRUE; pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = TRUE;
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_RX_PSPOLL, NULL); bScheduleCommand((void *) pDevice,
WLAN_CMD_RX_PSPOLL,
NULL);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 3\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 3\n");
} }
@ -1596,7 +1602,7 @@ void RXvMngWorkItem(void *Context)
} }
ASSERT(pRCB);// cannot be NULL ASSERT(pRCB);// cannot be NULL
pRxPacket = &(pRCB->sMngPacket); pRxPacket = &(pRCB->sMngPacket);
vMgrRxManagePacket((HANDLE)pDevice, &(pDevice->sMgmtObj), pRxPacket); vMgrRxManagePacket((void *) pDevice, &(pDevice->sMgmtObj), pRxPacket);
pRCB->Ref--; pRCB->Ref--;
if(pRCB->Ref == 0) { if(pRCB->Ref == 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RxvFreeMng %d %d\n",pDevice->NumRecvFreeList, pDevice->NumRecvMngList); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RxvFreeMng %d %d\n",pDevice->NumRecvFreeList, pDevice->NumRecvMngList);

View File

@ -160,11 +160,11 @@ INTnsProcessData(PSDevice pDevice)
pMgmt->byDTIMPeriod-1; pMgmt->byDTIMPeriod-1;
pMgmt->sNodeDBTable[0].bRxPSPoll = TRUE; pMgmt->sNodeDBTable[0].bRxPSPoll = TRUE;
if (pMgmt->sNodeDBTable[0].bPSEnable) if (pMgmt->sNodeDBTable[0].bPSEnable)
bScheduleCommand((HANDLE)pDevice, bScheduleCommand((void *) pDevice,
WLAN_CMD_RX_PSPOLL, WLAN_CMD_RX_PSPOLL,
NULL); NULL);
} }
bScheduleCommand((HANDLE)pDevice, bScheduleCommand((void *) pDevice,
WLAN_CMD_BECON_SEND, WLAN_CMD_BECON_SEND,
NULL); NULL);
} /* if (pDevice->eOPMode == OP_MODE_AP) */ } /* if (pDevice->eOPMode == OP_MODE_AP) */
@ -174,13 +174,13 @@ INTnsProcessData(PSDevice pDevice)
} }
if (pINTData->byISR0 & ISR_TBTT) { if (pINTData->byISR0 & ISR_TBTT) {
if (pDevice->bEnablePSMode) if (pDevice->bEnablePSMode)
bScheduleCommand((HANDLE) pDevice, bScheduleCommand((void *) pDevice,
WLAN_CMD_TBTT_WAKEUP, WLAN_CMD_TBTT_WAKEUP,
NULL); NULL);
if (pDevice->bChannelSwitch) { if (pDevice->bChannelSwitch) {
pDevice->byChannelSwitchCount--; pDevice->byChannelSwitchCount--;
if (pDevice->byChannelSwitchCount == 0) if (pDevice->byChannelSwitchCount == 0)
bScheduleCommand((HANDLE) pDevice, bScheduleCommand((void *) pDevice,
WLAN_CMD_11H_CHSW, WLAN_CMD_11H_CHSW,
NULL); NULL);
} }
@ -207,7 +207,7 @@ INTnsProcessData(PSDevice pDevice)
if (pINTData->byISR1 != 0) if (pINTData->byISR1 != 0)
if (pINTData->byISR1 & ISR_GPIO3) if (pINTData->byISR1 & ISR_GPIO3)
bScheduleCommand((HANDLE) pDevice, bScheduleCommand((void *) pDevice,
WLAN_CMD_RADIO, WLAN_CMD_RADIO,
NULL); NULL);
pDevice->intBuf.uDataLen = 0; pDevice->intBuf.uDataLen = 0;

View File

@ -100,16 +100,21 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
memcpy(abyScanSSID, pItemSSID, pItemSSID->len + WLAN_IEHDR_LEN); memcpy(abyScanSSID, pItemSSID, pItemSSID->len + WLAN_IEHDR_LEN);
} }
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
if (memcmp(pMgmt->abyCurrBSSID, &abyNullAddr[0], 6) == 0) if (memcmp(pMgmt->abyCurrBSSID, &abyNullAddr[0], 6) == 0)
BSSvClearBSSList((HANDLE)pDevice, FALSE); BSSvClearBSSList((void *) pDevice, FALSE);
else else
BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass); BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_BSS_SCAN..begin \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_BSS_SCAN..begin\n");
if (pItemSSID->len != 0) if (pItemSSID->len != 0)
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, abyScanSSID); bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
abyScanSSID);
else else
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
break; break;
@ -207,8 +212,10 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
netif_stop_queue(pDevice->dev); netif_stop_queue(pDevice->dev);
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *) pDevice,
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, NULL); WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
break; break;
@ -576,7 +583,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
netif_stop_queue(pDevice->dev); netif_stop_queue(pDevice->dev);
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_RUN_AP, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_RUN_AP, NULL);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
break; break;

View File

@ -209,9 +209,9 @@ if(pDevice->byReAssocCount > 0) { //reject scan when re-associating!
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
#ifdef update_BssList #ifdef update_BssList
BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass); BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
#endif #endif
//mike add: active scan OR passive scan OR desire_ssid scan //mike add: active scan OR passive scan OR desire_ssid scan
if(wrq->length == sizeof(struct iw_scan_req)) { if(wrq->length == sizeof(struct iw_scan_req)) {
@ -229,7 +229,7 @@ if(pDevice->byReAssocCount > 0) { //reject scan when re-associating!
pMgmt->eScanType = WMAC_SCAN_PASSIVE; pMgmt->eScanType = WMAC_SCAN_PASSIVE;
PRINT_K("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n",((PWLAN_IE_SSID)abyScanSSID)->abySSID, PRINT_K("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n",((PWLAN_IE_SSID)abyScanSSID)->abySSID,
((PWLAN_IE_SSID)abyScanSSID)->len); ((PWLAN_IE_SSID)abyScanSSID)->len);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, abyScanSSID); bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, abyScanSSID);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return 0; return 0;
@ -244,7 +244,7 @@ if(pDevice->byReAssocCount > 0) { //reject scan when re-associating!
pMgmt->eScanType = WMAC_SCAN_PASSIVE; pMgmt->eScanType = WMAC_SCAN_PASSIVE;
//printk("SIOCSIWSCAN:WLAN_CMD_BSSID_SCAN\n"); //printk("SIOCSIWSCAN:WLAN_CMD_BSSID_SCAN\n");
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return 0; return 0;
@ -944,10 +944,14 @@ int iwctl_siwessid(struct net_device *dev,
if (pCurr == NULL){ if (pCurr == NULL){
PRINT_K("SIOCSIWESSID:hidden ssid site survey before associate.......\n"); PRINT_K("SIOCSIWESSID:hidden ssid site survey before associate.......\n");
vResetCommandTimer((HANDLE) pDevice); vResetCommandTimer((void *) pDevice);
pMgmt->eScanType = WMAC_SCAN_ACTIVE; pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *) pDevice,
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID); 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 ? // by means of judging if there are two same BSSID exist in list ?
@ -959,10 +963,14 @@ int iwctl_siwessid(struct net_device *dev,
} }
if(uSameBssidNum >= 2) { //hit: desired AP is in hidden ssid mode!!! if(uSameBssidNum >= 2) { //hit: desired AP is in hidden ssid mode!!!
PRINT_K("SIOCSIWESSID:hidden ssid directly associate.......\n"); PRINT_K("SIOCSIWESSID:hidden ssid directly associate.......\n");
vResetCommandTimer((HANDLE) pDevice); vResetCommandTimer((void *) pDevice);
pMgmt->eScanType = WMAC_SCAN_PASSIVE; //this scan type,you'll submit scan result! pMgmt->eScanType = WMAC_SCAN_PASSIVE; //this scan type,you'll submit scan result!
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *) pDevice,
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID); WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
WLAN_CMD_SSID,
pMgmt->abyDesireSSID);
} }
} }
} }
@ -1554,11 +1562,11 @@ int iwctl_siwpower(struct net_device *dev,
} }
if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) {
pDevice->ePSMode = WMAC_POWER_FAST; pDevice->ePSMode = WMAC_POWER_FAST;
PSvEnablePowerSaving((HANDLE)pDevice, pMgmt->wListenInterval); PSvEnablePowerSaving((void *) pDevice, pMgmt->wListenInterval);
} else if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_PERIOD) { } else if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_PERIOD) {
pDevice->ePSMode = WMAC_POWER_FAST; pDevice->ePSMode = WMAC_POWER_FAST;
PSvEnablePowerSaving((HANDLE)pDevice, pMgmt->wListenInterval); PSvEnablePowerSaving((void *) pDevice, pMgmt->wListenInterval);
} }
switch (wrq->flags & IW_POWER_MODE) { switch (wrq->flags & IW_POWER_MODE) {
case IW_POWER_UNICAST_R: case IW_POWER_UNICAST_R:
@ -2007,12 +2015,16 @@ int iwctl_siwmlme(struct net_device *dev,
case IW_MLME_DEAUTH: case IW_MLME_DEAUTH:
//this command seems to be not complete,please test it --einsnliu //this command seems to be not complete,please test it --einsnliu
//printk("iwctl_siwmlme--->send DEAUTH\n"); //printk("iwctl_siwmlme--->send DEAUTH\n");
//bScheduleCommand((HANDLE) pDevice, WLAN_CMD_DEAUTH, (PBYTE)&reason); /* bScheduleCommand((void *) pDevice,
WLAN_CMD_DEAUTH,
(PBYTE)&reason); */
//break; //break;
case IW_MLME_DISASSOC: case IW_MLME_DISASSOC:
if(pDevice->bLinkPass == TRUE){ if(pDevice->bLinkPass == TRUE){
PRINT_K("iwctl_siwmlme--->send DISASSOCIATE\n"); PRINT_K("iwctl_siwmlme--->send DISASSOCIATE\n");
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_DISASSOCIATE, NULL); bScheduleCommand((void *) pDevice,
WLAN_CMD_DISASSOCIATE,
NULL);
} }
break; break;
default: default:

View File

@ -1158,12 +1158,12 @@ static int device_open(struct net_device *dev) {
} }
if (pDevice->sMgmtObj.eConfigMode == WMAC_CONFIG_AP) { if (pDevice->sMgmtObj.eConfigMode == WMAC_CONFIG_AP) {
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_RUN_AP, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_RUN_AP, NULL);
} }
else { else {
//mike:mark@2008-11-10 //mike:mark@2008-11-10
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_BSSID_SCAN, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
//bScheduleCommand((HANDLE)pDevice, WLAN_CMD_SSID, NULL); /* bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL); */
} }
@ -1220,7 +1220,7 @@ static int device_close(struct net_device *dev) {
//2007-1121-02<Add>by EinsnLiu //2007-1121-02<Add>by EinsnLiu
if (pDevice->bLinkPass) { if (pDevice->bLinkPass) {
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_DISASSOCIATE, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_DISASSOCIATE, NULL);
mdelay(30); mdelay(30);
} }
//End Add //End Add
@ -2101,16 +2101,16 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
if (pMgmt->eConfigMode == WMAC_CONFIG_AP) { if (pMgmt->eConfigMode == WMAC_CONFIG_AP) {
netif_stop_queue(pDevice->dev); netif_stop_queue(pDevice->dev);
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_RUN_AP, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_RUN_AP, NULL);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
} }
else { else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Commit the settings\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Commit the settings\n");
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
//2007-1121-01<Modify>by EinsnLiu //2007-1121-01<Modify>by EinsnLiu
if (pDevice->bLinkPass&& if (pDevice->bLinkPass &&
memcmp(pMgmt->abyCurrSSID,pMgmt->abyDesireSSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN)) { memcmp(pMgmt->abyCurrSSID,pMgmt->abyDesireSSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN)) {
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_DISASSOCIATE, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_DISASSOCIATE, NULL);
} else { } else {
pDevice->bLinkPass = FALSE; pDevice->bLinkPass = FALSE;
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
@ -2121,10 +2121,14 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
netif_stop_queue(pDevice->dev); netif_stop_queue(pDevice->dev);
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
pMgmt->eScanType = WMAC_SCAN_ACTIVE; pMgmt->eScanType = WMAC_SCAN_ACTIVE;
if(pDevice->bWPASuppWextEnabled !=TRUE) if (!pDevice->bWPASuppWextEnabled)
#endif #endif
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *) pDevice,
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, NULL); WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
WLAN_CMD_SSID,
NULL);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
} }
pDevice->bCommit = FALSE; pDevice->bCommit = FALSE;

View File

@ -50,19 +50,14 @@
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
/*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/ /*--------------------- Static Variables --------------------------*/
static int msglevel =MSG_LEVEL_INFO; static int msglevel =MSG_LEVEL_INFO;
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
/*+ /*+
@ -75,12 +70,8 @@ static int msglevel =MSG_LEVEL_INFO;
* *
-*/ -*/
void PSvEnablePowerSaving(void *hDeviceContext,
void WORD wListenInterval)
PSvEnablePowerSaving(
HANDLE hDeviceContext,
WORD wListenInterval
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -128,7 +119,7 @@ PSvEnablePowerSaving(
pDevice->bEnablePSMode = TRUE; pDevice->bEnablePSMode = TRUE;
if (pDevice->eOPMode == OP_MODE_ADHOC) { if (pDevice->eOPMode == OP_MODE_ADHOC) {
// bMgrPrepareBeaconToSend((HANDLE)pDevice, pMgmt); /* bMgrPrepareBeaconToSend((void *) pDevice, pMgmt); */
} }
// We don't send null pkt in ad hoc mode since beacon will handle this. // We don't send null pkt in ad hoc mode since beacon will handle this.
else if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) { else if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) {
@ -139,11 +130,6 @@ PSvEnablePowerSaving(
return; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -154,10 +140,7 @@ PSvEnablePowerSaving(
* *
-*/ -*/
void void PSvDisablePowerSaving(void *hDeviceContext)
PSvDisablePowerSaving(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
// PSMgmtObject pMgmt = &(pDevice->sMgmtObj); // PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -187,7 +170,6 @@ PSvDisablePowerSaving(
return; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -198,13 +180,9 @@ PSvDisablePowerSaving(
* FALSE, if fail * FALSE, if fail
-*/ -*/
BOOL PSbConsiderPowerDown(void *hDeviceContext,
BOOL
PSbConsiderPowerDown(
HANDLE hDeviceContext,
BOOL bCheckRxDMA, BOOL bCheckRxDMA,
BOOL bCheckCountToWakeUp BOOL bCheckCountToWakeUp)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -248,8 +226,6 @@ PSbConsiderPowerDown(
return TRUE; return TRUE;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -260,12 +236,7 @@ PSbConsiderPowerDown(
* *
-*/ -*/
void PSvSendPSPOLL(void *hDeviceContext)
void
PSvSendPSPOLL(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -297,8 +268,6 @@ PSvSendPSPOLL(
return; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -308,10 +277,8 @@ PSvSendPSPOLL(
* None. * None.
* *
-*/ -*/
BOOL
PSbSendNullPacket( BOOL PSbSendNullPacket(void *hDeviceContext)
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSTxMgmtPacket pTxPacket = NULL; PSTxMgmtPacket pTxPacket = NULL;
@ -388,10 +355,7 @@ PSbSendNullPacket(
* *
-*/ -*/
BOOL BOOL PSbIsNextTBTTWakeUp(void *hDeviceContext)
PSbIsNextTBTTWakeUp(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;

View File

@ -48,37 +48,14 @@
/* PSDevice pDevice */ /* PSDevice pDevice */
/* PSDevice hDeviceContext */ /* PSDevice hDeviceContext */
BOOL BOOL PSbConsiderPowerDown(void *hDeviceContext,
PSbConsiderPowerDown(
HANDLE hDeviceContext,
BOOL bCheckRxDMA, BOOL bCheckRxDMA,
BOOL bCheckCountToWakeUp BOOL bCheckCountToWakeUp);
);
void void PSvDisablePowerSaving(void *hDeviceContext);
PSvDisablePowerSaving( void PSvEnablePowerSaving(void *hDeviceContext, WORD wListenInterval);
HANDLE hDeviceContext void PSvSendPSPOLL(void *hDeviceContext);
); BOOL PSbSendNullPacket(void *hDeviceContext);
BOOL PSbIsNextTBTTWakeUp(void *hDeviceContext);
void
PSvEnablePowerSaving(
HANDLE hDeviceContext,
WORD wListenInterval
);
void
PSvSendPSPOLL(
HANDLE hDeviceContext
);
BOOL
PSbSendNullPacket(
HANDLE hDeviceContext
);
BOOL
PSbIsNextTBTTWakeUp(
HANDLE hDeviceContext
);
#endif /* __POWER_H__ */ #endif /* __POWER_H__ */

View File

@ -3032,10 +3032,12 @@ nsDMA_tx_packet(
} }
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dma_tx: pDevice->wCurrentRate = %d \n", pDevice->wCurrentRate); DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "dma_tx: pDevice->wCurrentRate = %d\n",
pDevice->wCurrentRate);
if (wKeepRate != pDevice->wCurrentRate) { if (wKeepRate != pDevice->wCurrentRate) {
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_SETPOWER, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_SETPOWER, NULL);
} }
if (pDevice->wCurrentRate <= RATE_11M) { if (pDevice->wCurrentRate <= RATE_11M) {
@ -3118,7 +3120,9 @@ nsDMA_tx_packet(
if ( pDevice->bEnablePSMode == TRUE ) { if ( pDevice->bEnablePSMode == TRUE ) {
if ( !pDevice->bPSModeTxBurst ) { if ( !pDevice->bPSModeTxBurst ) {
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_MAC_DISPOWERSAVING, NULL); bScheduleCommand((void *) pDevice,
WLAN_CMD_MAC_DISPOWERSAVING,
NULL);
pDevice->bPSModeTxBurst = TRUE; pDevice->bPSModeTxBurst = TRUE;
} }
} }
@ -3138,7 +3142,7 @@ nsDMA_tx_packet(
if (bNeedDeAuth == TRUE) { if (bNeedDeAuth == TRUE) {
WORD wReason = WLAN_MGMT_REASON_MIC_FAILURE; WORD wReason = WLAN_MGMT_REASON_MIC_FAILURE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_DEAUTH, (PBYTE)&wReason); bScheduleCommand((void *) pDevice, WLAN_CMD_DEAUTH, (PBYTE) &wReason);
} }
if(status!=STATUS_PENDING) { if(status!=STATUS_PENDING) {
@ -3258,9 +3262,8 @@ bRelayPacketSend (
pDevice->wCurrentRate = pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate; pDevice->wCurrentRate = pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate;
} }
if (wKeepRate != pDevice->wCurrentRate) { if (wKeepRate != pDevice->wCurrentRate) {
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SETPOWER, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_SETPOWER, NULL);
} }
if (pDevice->wCurrentRate <= RATE_11M) if (pDevice->wCurrentRate <= RATE_11M)

View File

@ -133,11 +133,4 @@ typedef DWORD * PDWORD;
typedef QWORD * PQWORD; typedef QWORD * PQWORD;
// handle declaration
#ifdef STRICT
typedef void *HANDLE;
#else
typedef void *HANDLE;
#endif
#endif /* __TTYPE_H__ */ #endif /* __TTYPE_H__ */

View File

@ -94,18 +94,12 @@ s_bCommandComplete (
); );
static static BOOL s_bClearBSSID_SCAN(void *hDeviceContext);
BOOL s_bClearBSSID_SCAN (
HANDLE hDeviceContext
);
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
/* /*
* Description: * Description:
* Stop AdHoc beacon during scan process * Stop AdHoc beacon during scan process
@ -119,6 +113,7 @@ BOOL s_bClearBSSID_SCAN (
* Return Value: none * Return Value: none
* *
*/ */
static static
void void
vAdHocBeaconStop(PSDevice pDevice) vAdHocBeaconStop(PSDevice pDevice)
@ -321,15 +316,7 @@ s_MgrMakeProbeRequest(
return pTxPacket; return pTxPacket;
} }
void vCommandTimerWait(void *hDeviceContext, UINT MSecond)
void
vCommandTimerWait(
HANDLE hDeviceContext,
UINT MSecond
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
@ -342,13 +329,7 @@ vCommandTimerWait(
return; return;
} }
void vRunCommand(void *hDeviceContext)
void
vRunCommand(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -435,7 +416,8 @@ vRunCommand(
pMgmt->abyScanBSSID[5] = 0xFF; pMgmt->abyScanBSSID[5] = 0xFF;
pItemSSID->byElementID = WLAN_EID_SSID; pItemSSID->byElementID = WLAN_EID_SSID;
// clear bssid list // clear bssid list
// BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass); /* BSSvClearBSSList((void *) pDevice,
pDevice->bLinkPass); */
pMgmt->eScanState = WMAC_IS_SCANNING; pMgmt->eScanState = WMAC_IS_SCANNING;
pDevice->byScanBBType = pDevice->byBBType; //lucas pDevice->byScanBBType = pDevice->byBBType; //lucas
pDevice->bStopDataPkt = TRUE; pDevice->bStopDataPkt = TRUE;
@ -480,11 +462,11 @@ vRunCommand(
(pMgmt->uScanChannel < CB_MAX_CHANNEL_24G)) { (pMgmt->uScanChannel < CB_MAX_CHANNEL_24G)) {
s_vProbeChannel(pDevice); s_vProbeChannel(pDevice);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
vCommandTimerWait((HANDLE)pDevice, 100); vCommandTimerWait((void *) pDevice, 100);
return; return;
} else { } else {
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
vCommandTimerWait((HANDLE)pDevice, WCMD_PASSIVE_SCAN_TIME); vCommandTimerWait((void *) pDevice, WCMD_PASSIVE_SCAN_TIME);
return; return;
} }
@ -552,7 +534,11 @@ vRunCommand(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Send Disassociation Packet..\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Send Disassociation Packet..\n");
// reason = 8 : disassoc because sta has left // reason = 8 : disassoc because sta has left
vMgrDisassocBeginSta((HANDLE)pDevice, pMgmt, pMgmt->abyCurrBSSID, (8), &Status); vMgrDisassocBeginSta((void *) pDevice,
pMgmt,
pMgmt->abyCurrBSSID,
(8),
&Status);
pDevice->bLinkPass = FALSE; pDevice->bLinkPass = FALSE;
ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW); ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW);
// unlock command busy // unlock command busy
@ -614,22 +600,26 @@ vRunCommand(
// set initial state // set initial state
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
pMgmt->eCurrMode = WMAC_MODE_STANDBY; pMgmt->eCurrMode = WMAC_MODE_STANDBY;
PSvDisablePowerSaving((HANDLE)pDevice); PSvDisablePowerSaving((void *) pDevice);
BSSvClearNodeDBTable(pDevice, 0); BSSvClearNodeDBTable(pDevice, 0);
vMgrJoinBSSBegin((HANDLE)pDevice, &Status); vMgrJoinBSSBegin((void *) pDevice, &Status);
// if Infra mode // if Infra mode
if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_JOINTED)) { if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_JOINTED)) {
// Call mgr to begin the deauthentication // Call mgr to begin the deauthentication
// reason = (3) beacuse sta has left ESS // reason = (3) beacuse sta has left ESS
if (pMgmt->eCurrState>= WMAC_STATE_AUTH) { if (pMgmt->eCurrState >= WMAC_STATE_AUTH) {
vMgrDeAuthenBeginSta((HANDLE)pDevice, pMgmt, pMgmt->abyCurrBSSID, (3), &Status); vMgrDeAuthenBeginSta((void *)pDevice,
pMgmt,
pMgmt->abyCurrBSSID,
(3),
&Status);
} }
// Call mgr to begin the authentication // Call mgr to begin the authentication
vMgrAuthenBeginSta((HANDLE)pDevice, pMgmt, &Status); vMgrAuthenBeginSta((void *) pDevice, pMgmt, &Status);
if (Status == CMD_STATUS_SUCCESS) { if (Status == CMD_STATUS_SUCCESS) {
pDevice->byLinkWaitCount = 0; pDevice->byLinkWaitCount = 0;
pDevice->eCommandState = WLAN_AUTHENTICATE_WAIT; pDevice->eCommandState = WLAN_AUTHENTICATE_WAIT;
vCommandTimerWait((HANDLE)pDevice, AUTHENTICATE_TIMEOUT); vCommandTimerWait((void *) pDevice, AUTHENTICATE_TIMEOUT);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Set eCommandState = WLAN_AUTHENTICATE_WAIT\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Set eCommandState = WLAN_AUTHENTICATE_WAIT\n");
return; return;
@ -648,10 +638,12 @@ vRunCommand(
} }
else { else {
// start own IBSS // start own IBSS
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "CreateOwn IBSS by CurrMode = IBSS_STA \n"); DBG_PRT(MSG_LEVEL_DEBUG,
vMgrCreateOwnIBSS((HANDLE)pDevice, &Status); KERN_INFO "CreateOwn IBSS by CurrMode = IBSS_STA\n");
vMgrCreateOwnIBSS((void *) pDevice, &Status);
if (Status != CMD_STATUS_SUCCESS){ if (Status != CMD_STATUS_SUCCESS){
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " WLAN_CMD_IBSS_CREATE fail ! \n"); DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "WLAN_CMD_IBSS_CREATE fail!\n");
}; };
BSSvAddMulticastNode(pDevice); BSSvAddMulticastNode(pDevice);
} }
@ -662,10 +654,12 @@ vRunCommand(
if (pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA || if (pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA ||
pMgmt->eConfigMode == WMAC_CONFIG_AUTO) { pMgmt->eConfigMode == WMAC_CONFIG_AUTO) {
// start own IBSS // start own IBSS
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "CreateOwn IBSS by CurrMode = STANDBY \n"); DBG_PRT(MSG_LEVEL_DEBUG,
vMgrCreateOwnIBSS((HANDLE)pDevice, &Status); KERN_INFO "CreateOwn IBSS by CurrMode = STANDBY\n");
vMgrCreateOwnIBSS((void *) pDevice, &Status);
if (Status != CMD_STATUS_SUCCESS){ if (Status != CMD_STATUS_SUCCESS){
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" WLAN_CMD_IBSS_CREATE fail ! \n"); DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "WLAN_CMD_IBSS_CREATE fail!\n");
}; };
BSSvAddMulticastNode(pDevice); BSSvAddMulticastNode(pDevice);
s_bClearBSSID_SCAN(pDevice); s_bClearBSSID_SCAN(pDevice);
@ -701,12 +695,12 @@ vRunCommand(
pDevice->byLinkWaitCount = 0; pDevice->byLinkWaitCount = 0;
// Call mgr to begin the association // Call mgr to begin the association
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCurrState == WMAC_STATE_AUTH\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCurrState == WMAC_STATE_AUTH\n");
vMgrAssocBeginSta((HANDLE)pDevice, pMgmt, &Status); vMgrAssocBeginSta((void *) pDevice, pMgmt, &Status);
if (Status == CMD_STATUS_SUCCESS) { if (Status == CMD_STATUS_SUCCESS) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState = WLAN_ASSOCIATE_WAIT\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState = WLAN_ASSOCIATE_WAIT\n");
pDevice->byLinkWaitCount = 0; pDevice->byLinkWaitCount = 0;
pDevice->eCommandState = WLAN_ASSOCIATE_WAIT; pDevice->eCommandState = WLAN_ASSOCIATE_WAIT;
vCommandTimerWait((HANDLE)pDevice, ASSOCIATE_TIMEOUT); vCommandTimerWait((void *) pDevice, ASSOCIATE_TIMEOUT);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return; return;
} }
@ -718,7 +712,7 @@ vRunCommand(
pDevice->byLinkWaitCount ++; pDevice->byLinkWaitCount ++;
printk("WLAN_AUTHENTICATE_WAIT:wait %d times!!\n",pDevice->byLinkWaitCount); printk("WLAN_AUTHENTICATE_WAIT:wait %d times!!\n",pDevice->byLinkWaitCount);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
vCommandTimerWait((HANDLE)pDevice, AUTHENTICATE_TIMEOUT/2); vCommandTimerWait((void *) pDevice, AUTHENTICATE_TIMEOUT/2);
return; return;
} }
pDevice->byLinkWaitCount = 0; pDevice->byLinkWaitCount = 0;
@ -742,7 +736,8 @@ vRunCommand(
if (pMgmt->eCurrState == WMAC_STATE_ASSOC) { if (pMgmt->eCurrState == WMAC_STATE_ASSOC) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCurrState == WMAC_STATE_ASSOC\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCurrState == WMAC_STATE_ASSOC\n");
if (pDevice->ePSMode != WMAC_POWER_CAM) { if (pDevice->ePSMode != WMAC_POWER_CAM) {
PSvEnablePowerSaving((HANDLE)pDevice, pMgmt->wListenInterval); PSvEnablePowerSaving((void *) pDevice,
pMgmt->wListenInterval);
} }
/* /*
if (pMgmt->eAuthenMode >= WMAC_AUTH_WPA) { if (pMgmt->eAuthenMode >= WMAC_AUTH_WPA) {
@ -786,7 +781,7 @@ vRunCommand(
pDevice->byLinkWaitCount ++; pDevice->byLinkWaitCount ++;
printk("WLAN_ASSOCIATE_WAIT:wait %d times!!\n",pDevice->byLinkWaitCount); printk("WLAN_ASSOCIATE_WAIT:wait %d times!!\n",pDevice->byLinkWaitCount);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
vCommandTimerWait((HANDLE)pDevice, ASSOCIATE_TIMEOUT/2); vCommandTimerWait((void *) pDevice, ASSOCIATE_TIMEOUT/2);
return; return;
} }
pDevice->byLinkWaitCount = 0; pDevice->byLinkWaitCount = 0;
@ -823,9 +818,10 @@ vRunCommand(
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
pDevice->bFixRate = FALSE; pDevice->bFixRate = FALSE;
vMgrCreateOwnIBSS((HANDLE)pDevice, &Status); vMgrCreateOwnIBSS((void *) pDevice, &Status);
if (Status != CMD_STATUS_SUCCESS){ if (Status != CMD_STATUS_SUCCESS) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " vMgrCreateOwnIBSS fail ! \n"); DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "vMgrCreateOwnIBSS fail!\n");
}; };
// alway turn off unicast bit // alway turn off unicast bit
MACvRegBitsOff(pDevice, MAC_REG_RCR, RCR_UNICAST); MACvRegBitsOff(pDevice, MAC_REG_RCR, RCR_UNICAST);
@ -948,7 +944,11 @@ vRunCommand(
if (pDevice->bLinkPass == TRUE) { if (pDevice->bLinkPass == TRUE) {
// reason = 8 : disassoc because sta has left // reason = 8 : disassoc because sta has left
vMgrDisassocBeginSta((HANDLE)pDevice, pMgmt, pMgmt->abyCurrBSSID, (8), &Status); vMgrDisassocBeginSta((void *) pDevice,
pMgmt,
pMgmt->abyCurrBSSID,
(8),
&Status);
pDevice->bLinkPass = FALSE; pDevice->bLinkPass = FALSE;
// unlock command busy // unlock command busy
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
@ -1185,18 +1185,15 @@ s_bCommandComplete (
break; break;
} }
vCommandTimerWait((void *) pDevice, 0);
vCommandTimerWait((HANDLE)pDevice, 0);
} }
return TRUE; return TRUE;
} }
BOOL bScheduleCommand ( BOOL bScheduleCommand(void *hDeviceContext,
HANDLE hDeviceContext,
CMD_CODE eCommand, CMD_CODE eCommand,
PBYTE pbyItem0 PBYTE pbyItem0)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
@ -1264,10 +1261,7 @@ BOOL bScheduleCommand (
* Return Value: TRUE if success; otherwise FALSE * Return Value: TRUE if success; otherwise FALSE
* *
*/ */
static static BOOL s_bClearBSSID_SCAN(void *hDeviceContext)
BOOL s_bClearBSSID_SCAN (
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
UINT uCmdDequeueIdx = pDevice->uCmdDequeueIdx; UINT uCmdDequeueIdx = pDevice->uCmdDequeueIdx;
@ -1287,10 +1281,7 @@ BOOL s_bClearBSSID_SCAN (
//mike add:reset command timer //mike add:reset command timer
void void vResetCommandTimer(void *hDeviceContext)
vResetCommandTimer(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
@ -1311,10 +1302,7 @@ vResetCommandTimer(
//2007-0115-08<Add>by MikeLiu //2007-0115-08<Add>by MikeLiu
#ifdef TxInSleep #ifdef TxInSleep
void void BSSvSecondTxData(void *hDeviceContext)
BSSvSecondTxData(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);

View File

@ -105,33 +105,22 @@ typedef enum tagCMD_STATE {
WLAN_CMD_IDLE WLAN_CMD_IDLE
} CMD_STATE, *PCMD_STATE; } CMD_STATE, *PCMD_STATE;
/*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
/*--------------------- Export Types ------------------------------*/ /*--------------------- Export Types ------------------------------*/
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
void
vResetCommandTimer(
HANDLE hDeviceContext
);
BOOL void vResetCommandTimer(void *hDeviceContext);
bScheduleCommand(
HANDLE hDeviceContext, BOOL bScheduleCommand(void *hDeviceContext,
CMD_CODE eCommand, CMD_CODE eCommand,
PBYTE pbyItem0 PBYTE pbyItem0);
);
void vRunCommand(void *hDeviceContext);
void
vRunCommand(
HANDLE hDeviceContext
);
/* /*
void void
WCMDvCommandThread( WCMDvCommandThread(
@ -141,10 +130,7 @@ WCMDvCommandThread(
//2007-0115-09<Add>by MikeLiu //2007-0115-09<Add>by MikeLiu
#ifdef TxInSleep #ifdef TxInSleep
void void BSSvSecondTxData(void *hDeviceContext);
BSSvSecondTxData(
HANDLE hDeviceContext
);
#endif #endif
#endif /* __WCMD_H__ */ #endif /* __WCMD_H__ */

View File

@ -329,14 +329,10 @@ s_bCipherMatch (
PKnownBSS pCurr PKnownBSS pCurr
); );
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -347,10 +343,7 @@ s_bCipherMatch (
* *
-*/ -*/
void void vMgrObjectInit(void *hDeviceContext)
vMgrObjectInit(
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -368,7 +361,7 @@ vMgrObjectInit(
pMgmt->byCSSPK = KEY_CTL_NONE; pMgmt->byCSSPK = KEY_CTL_NONE;
pMgmt->byCSSGK = KEY_CTL_NONE; pMgmt->byCSSGK = KEY_CTL_NONE;
pMgmt->wIBSSBeaconPeriod = DEFAULT_IBSS_BI; pMgmt->wIBSSBeaconPeriod = DEFAULT_IBSS_BI;
BSSvClearBSSList((HANDLE)pDevice, FALSE); BSSvClearBSSList((void *) pDevice, FALSE);
init_timer(&pMgmt->sTimerSecondCallback); init_timer(&pMgmt->sTimerSecondCallback);
pMgmt->sTimerSecondCallback.data = (ULONG)pDevice; pMgmt->sTimerSecondCallback.data = (ULONG)pDevice;
@ -401,8 +394,6 @@ vMgrObjectInit(
return; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -414,13 +405,9 @@ vMgrObjectInit(
* *
-*/ -*/
void vMgrAssocBeginSta(void *hDeviceContext,
void
vMgrAssocBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PCMD_STATUS pStatus PCMD_STATUS pStatus)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSTxMgmtPacket pTxPacket; PSTxMgmtPacket pTxPacket;
@ -491,12 +478,9 @@ vMgrAssocBeginSta(
* *
-*/ -*/
void void vMgrReAssocBeginSta(void *hDeviceContext,
vMgrReAssocBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PCMD_STATUS pStatus PCMD_STATUS pStatus)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSTxMgmtPacket pTxPacket; PSTxMgmtPacket pTxPacket;
@ -570,14 +554,11 @@ vMgrReAssocBeginSta(
* *
-*/ -*/
void void vMgrDisassocBeginSta(void *hDeviceContext,
vMgrDisassocBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PBYTE abyDestAddress, PBYTE abyDestAddress,
WORD wReason, WORD wReason,
PCMD_STATUS pStatus PCMD_STATUS pStatus)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSTxMgmtPacket pTxPacket = NULL; PSTxMgmtPacket pTxPacket = NULL;
@ -987,7 +968,10 @@ s_vMgrRxAssocResponse(
}; };
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Association Successful, AID=%d.\n", pMgmt->wCurrAID & ~(BIT14|BIT15)); DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Association Successful, AID=%d.\n", pMgmt->wCurrAID & ~(BIT14|BIT15));
pMgmt->eCurrState = WMAC_STATE_ASSOC; pMgmt->eCurrState = WMAC_STATE_ASSOC;
BSSvUpdateAPNode((HANDLE)pDevice, sFrame.pwCapInfo, sFrame.pSuppRates, sFrame.pExtSuppRates); BSSvUpdateAPNode((void *) pDevice,
sFrame.pwCapInfo,
sFrame.pSuppRates,
sFrame.pExtSuppRates);
pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID; pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID;
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Link with AP(SSID): %s\n", pItemSSID->abySSID); DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Link with AP(SSID): %s\n", pItemSSID->abySSID);
pDevice->bLinkPass = TRUE; pDevice->bLinkPass = TRUE;
@ -1089,8 +1073,6 @@ if(pMgmt->eCurrState == WMAC_STATE_ASSOC)
return; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -1102,12 +1084,9 @@ if(pMgmt->eCurrState == WMAC_STATE_ASSOC)
* *
-*/ -*/
void void vMgrAuthenBeginSta(void *hDeviceContext,
vMgrAuthenBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PCMD_STATUS pStatus PCMD_STATUS pStatus)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
WLAN_FR_AUTHEN sFrame; WLAN_FR_AUTHEN sFrame;
@ -1147,8 +1126,6 @@ vMgrAuthenBeginSta(
return ; return ;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -1160,14 +1137,11 @@ vMgrAuthenBeginSta(
* *
-*/ -*/
void void vMgrDeAuthenBeginSta(void *hDeviceContext,
vMgrDeAuthenBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PBYTE abyDestAddress, PBYTE abyDestAddress,
WORD wReason, WORD wReason,
PCMD_STATUS pStatus PCMD_STATUS pStatus)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
WLAN_FR_DEAUTHEN sFrame; WLAN_FR_DEAUTHEN sFrame;
@ -1405,12 +1379,11 @@ s_vMgrRxAuthenSequence_2(
s_vMgrLogStatus(pMgmt, cpu_to_le16((*(pFrame->pwStatus)))); s_vMgrLogStatus(pMgmt, cpu_to_le16((*(pFrame->pwStatus))));
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
} }
if (pDevice->eCommandState == WLAN_AUTHENTICATE_WAIT ) { if (pDevice->eCommandState == WLAN_AUTHENTICATE_WAIT) {
// spin_unlock_irq(&pDevice->lock); /* spin_unlock_irq(&pDevice->lock);
// vCommandTimerWait((HANDLE)pDevice, 0); vCommandTimerWait((void *) pDevice, 0);
// spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock); */
} }
break; break;
case WLAN_AUTH_ALG_SHAREDKEY: case WLAN_AUTH_ALG_SHAREDKEY:
@ -1453,9 +1426,9 @@ s_vMgrRxAuthenSequence_2(
else { else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:rx Auth_reply sequence_2 status error ...\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:rx Auth_reply sequence_2 status error ...\n");
if ( pDevice->eCommandState == WLAN_AUTHENTICATE_WAIT ) { if ( pDevice->eCommandState == WLAN_AUTHENTICATE_WAIT ) {
// spin_unlock_irq(&pDevice->lock); /* spin_unlock_irq(&pDevice->lock);
// vCommandTimerWait((HANDLE)pDevice, 0); vCommandTimerWait((void *) pDevice, 0);
// spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock); */
} }
s_vMgrLogStatus(pMgmt, cpu_to_le16((*(pFrame->pwStatus)))); s_vMgrLogStatus(pMgmt, cpu_to_le16((*(pFrame->pwStatus))));
} }
@ -1591,11 +1564,10 @@ s_vMgrRxAuthenSequence_4(
} }
if ( pDevice->eCommandState == WLAN_AUTHENTICATE_WAIT ) { if ( pDevice->eCommandState == WLAN_AUTHENTICATE_WAIT ) {
// spin_unlock_irq(&pDevice->lock); /* spin_unlock_irq(&pDevice->lock);
// vCommandTimerWait((HANDLE)pDevice, 0); vCommandTimerWait((void *) pDevice, 0);
// spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock); */
} }
} }
/*+ /*+
@ -1913,10 +1885,12 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE)
sERP.byERP = 0; sERP.byERP = 0;
} }
pBSSList = BSSpAddrIsInBSSList((HANDLE)pDevice, sFrame.pHdr->sA3.abyAddr3, sFrame.pSSID); pBSSList = BSSpAddrIsInBSSList((void *) pDevice,
sFrame.pHdr->sA3.abyAddr3,
sFrame.pSSID);
if (pBSSList == NULL) { if (pBSSList == NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Beacon/insert: RxChannel = : %d\n", byCurrChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Beacon/insert: RxChannel = : %d\n", byCurrChannel);
BSSbInsertToBSSList((HANDLE)pDevice, BSSbInsertToBSSList((void *) pDevice,
sFrame.pHdr->sA3.abyAddr3, sFrame.pHdr->sA3.abyAddr3,
*sFrame.pqwTimestamp, *sFrame.pqwTimestamp,
*sFrame.pwBeaconInterval, *sFrame.pwBeaconInterval,
@ -1932,12 +1906,11 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE)
sFrame.pIE_Quiet, sFrame.pIE_Quiet,
sFrame.len - WLAN_HDR_ADDR3_LEN, sFrame.len - WLAN_HDR_ADDR3_LEN,
sFrame.pHdr->sA4.abyAddr4, // payload of beacon sFrame.pHdr->sA4.abyAddr4, // payload of beacon
(HANDLE)pRxPacket (void *) pRxPacket);
);
} }
else { else {
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"update bcn: RxChannel = : %d\n", byCurrChannel); // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"update bcn: RxChannel = : %d\n", byCurrChannel);
BSSbUpdateToBSSList((HANDLE)pDevice, BSSbUpdateToBSSList((void *) pDevice,
*sFrame.pqwTimestamp, *sFrame.pqwTimestamp,
*sFrame.pwBeaconInterval, *sFrame.pwBeaconInterval,
*sFrame.pwCapInfo, *sFrame.pwCapInfo,
@ -1954,8 +1927,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE)
pBSSList, pBSSList,
sFrame.len - WLAN_HDR_ADDR3_LEN, sFrame.len - WLAN_HDR_ADDR3_LEN,
sFrame.pHdr->sA4.abyAddr4, // payload of probresponse sFrame.pHdr->sA4.abyAddr4, // payload of probresponse
(HANDLE)pRxPacket (void *) pRxPacket);
);
} }
@ -2324,7 +2296,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE)
// set highest basic rate // set highest basic rate
// s_vSetHighestBasicRate(pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates); // s_vSetHighestBasicRate(pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates);
// Prepare beacon frame // Prepare beacon frame
bMgrPrepareBeaconToSend((HANDLE)pDevice, pMgmt); bMgrPrepareBeaconToSend((void *) pDevice, pMgmt);
// } // }
}; };
} }
@ -2341,8 +2313,6 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE)
return; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -2355,11 +2325,9 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE)
* CMD_STATUS * CMD_STATUS
* *
-*/ -*/
void
vMgrCreateOwnIBSS( void vMgrCreateOwnIBSS(void *hDeviceContext,
HANDLE hDeviceContext, PCMD_STATUS pStatus)
PCMD_STATUS pStatus
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -2609,14 +2577,12 @@ vMgrCreateOwnIBSS(
pMgmt->eCurrState = WMAC_STATE_STARTED; pMgmt->eCurrState = WMAC_STATE_STARTED;
// Prepare beacon to send // Prepare beacon to send
if (bMgrPrepareBeaconToSend((HANDLE)pDevice, pMgmt)) { if (bMgrPrepareBeaconToSend((void *) pDevice, pMgmt))
*pStatus = CMD_STATUS_SUCCESS; *pStatus = CMD_STATUS_SUCCESS;
}
return ; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -2630,13 +2596,8 @@ vMgrCreateOwnIBSS(
* *
-*/ -*/
void void vMgrJoinBSSBegin(void *hDeviceContext, PCMD_STATUS pStatus)
vMgrJoinBSSBegin(
HANDLE hDeviceContext,
PCMD_STATUS pStatus
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
PKnownBSS pCurr = NULL; PKnownBSS pCurr = NULL;
@ -2782,12 +2743,17 @@ vMgrJoinBSSBegin(
// Add current BSS to Candidate list // Add current BSS to Candidate list
// This should only works for WPA2 BSS, and WPA2 BSS check must be done before. // This should only works for WPA2 BSS, and WPA2 BSS check must be done before.
if (pMgmt->eAuthenMode == WMAC_AUTH_WPA2) { if (pMgmt->eAuthenMode == WMAC_AUTH_WPA2) {
BOOL bResult = bAdd_PMKID_Candidate((HANDLE)pDevice, pMgmt->abyCurrBSSID, &pCurr->sRSNCapObj); BOOL bResult = bAdd_PMKID_Candidate((void *) pDevice,
pMgmt->abyCurrBSSID,
&pCurr->sRSNCapObj);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"bAdd_PMKID_Candidate: 1(%d)\n", bResult); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"bAdd_PMKID_Candidate: 1(%d)\n", bResult);
if (bResult == FALSE) { if (bResult == FALSE) {
vFlush_PMKID_Candidate((HANDLE)pDevice); vFlush_PMKID_Candidate((void *) pDevice);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFlush_PMKID_Candidate: 4\n"); DBG_PRT(MSG_LEVEL_DEBUG,
bAdd_PMKID_Candidate((HANDLE)pDevice, pMgmt->abyCurrBSSID, &pCurr->sRSNCapObj); KERN_INFO "vFlush_PMKID_Candidate: 4\n");
bAdd_PMKID_Candidate((void *) pDevice,
pMgmt->abyCurrBSSID,
&pCurr->sRSNCapObj);
} }
} }
@ -2940,7 +2906,7 @@ vMgrJoinBSSBegin(
CARDvSetRSPINF(pDevice, (BYTE)pDevice->byBBType); CARDvSetRSPINF(pDevice, (BYTE)pDevice->byBBType);
// Prepare beacon // Prepare beacon
bMgrPrepareBeaconToSend((HANDLE)pDevice, pMgmt); bMgrPrepareBeaconToSend((void *) pDevice, pMgmt);
} }
else { else {
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
@ -4299,9 +4265,11 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE)
// update or insert the bss // update or insert the bss
pBSSList = BSSpAddrIsInBSSList((HANDLE)pDevice, sFrame.pHdr->sA3.abyAddr3, sFrame.pSSID); pBSSList = BSSpAddrIsInBSSList((void *) pDevice,
sFrame.pHdr->sA3.abyAddr3,
sFrame.pSSID);
if (pBSSList) { if (pBSSList) {
BSSbUpdateToBSSList((HANDLE)pDevice, BSSbUpdateToBSSList((void *) pDevice,
*sFrame.pqwTimestamp, *sFrame.pqwTimestamp,
*sFrame.pwBeaconInterval, *sFrame.pwBeaconInterval,
*sFrame.pwCapInfo, *sFrame.pwCapInfo,
@ -4317,13 +4285,12 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE)
sFrame.pIE_Quiet, sFrame.pIE_Quiet,
pBSSList, pBSSList,
sFrame.len - WLAN_HDR_ADDR3_LEN, sFrame.len - WLAN_HDR_ADDR3_LEN,
sFrame.pHdr->sA4.abyAddr4, // payload of probresponse /* payload of probresponse */
(HANDLE)pRxPacket sFrame.pHdr->sA4.abyAddr4,
); (void *) pRxPacket);
} } else {
else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Probe resp/insert: RxChannel = : %d\n", byCurrChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Probe resp/insert: RxChannel = : %d\n", byCurrChannel);
BSSbInsertToBSSList((HANDLE)pDevice, BSSbInsertToBSSList((void *) pDevice,
sFrame.pHdr->sA3.abyAddr3, sFrame.pHdr->sA3.abyAddr3,
*sFrame.pqwTimestamp, *sFrame.pqwTimestamp,
*sFrame.pwBeaconInterval, *sFrame.pwBeaconInterval,
@ -4338,9 +4305,8 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE)
sFrame.pIE_Country, sFrame.pIE_Country,
sFrame.pIE_Quiet, sFrame.pIE_Quiet,
sFrame.len - WLAN_HDR_ADDR3_LEN, sFrame.len - WLAN_HDR_ADDR3_LEN,
sFrame.pHdr->sA4.abyAddr4, // payload of beacon sFrame.pHdr->sA4.abyAddr4, /* payload of beacon */
(HANDLE)pRxPacket (void *) pRxPacket);
);
} }
return; return;
@ -4436,10 +4402,6 @@ s_vMgrRxProbeRequest(
return; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -4454,13 +4416,9 @@ s_vMgrRxProbeRequest(
* *
-*/ -*/
void vMgrRxManagePacket(void *hDeviceContext,
void
vMgrRxManagePacket(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PSRxMgmtPacket pRxPacket PSRxMgmtPacket pRxPacket)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
BOOL bInScan = FALSE; BOOL bInScan = FALSE;
@ -4593,9 +4551,6 @@ vMgrRxManagePacket(
return; return;
} }
/*+ /*+
* *
* Routine Description: * Routine Description:
@ -4607,11 +4562,7 @@ vMgrRxManagePacket(
* TRUE if success; FALSE if failed. * TRUE if success; FALSE if failed.
* *
-*/ -*/
BOOL BOOL bMgrPrepareBeaconToSend(void *hDeviceContext, PSMgmtObject pMgmt)
bMgrPrepareBeaconToSend(
HANDLE hDeviceContext,
PSMgmtObject pMgmt
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSTxMgmtPacket pTxPacket; PSTxMgmtPacket pTxPacket;
@ -4715,7 +4666,6 @@ s_vMgrLogStatus(
} }
} }
/* /*
* *
* Description: * Description:
@ -4732,12 +4682,10 @@ s_vMgrLogStatus(
* Return Value: none. * Return Value: none.
* *
-*/ -*/
BOOL
bAdd_PMKID_Candidate ( BOOL bAdd_PMKID_Candidate(void *hDeviceContext,
HANDLE hDeviceContext,
PBYTE pbyBSSID, PBYTE pbyBSSID,
PSRSNCapObject psRSNCapObj PSRSNCapObject psRSNCapObj)
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PPMKID_CANDIDATE pCandidateList; PPMKID_CANDIDATE pCandidateList;
@ -4796,10 +4744,8 @@ bAdd_PMKID_Candidate (
* Return Value: none. * Return Value: none.
* *
-*/ -*/
void
vFlush_PMKID_Candidate ( void vFlush_PMKID_Candidate(void *hDeviceContext)
HANDLE hDeviceContext
)
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;

View File

@ -400,102 +400,61 @@ typedef struct tagSMgmtObject
} SMgmtObject, *PSMgmtObject; } SMgmtObject, *PSMgmtObject;
/*--------------------- Export Macros ------------------------------*/ /*--------------------- Export Macros ------------------------------*/
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
void vMgrObjectInit(void *hDeviceContext);
void void vMgrAssocBeginSta(void *hDeviceContext,
vMgrObjectInit(
HANDLE hDeviceContext
);
void
vMgrAssocBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PCMD_STATUS pStatus PCMD_STATUS pStatus);
);
void void vMgrReAssocBeginSta(void *hDeviceContext,
vMgrReAssocBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PCMD_STATUS pStatus PCMD_STATUS pStatus);
);
void void vMgrDisassocBeginSta(void *hDeviceContext,
vMgrDisassocBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PBYTE abyDestAddress, PBYTE abyDestAddress,
WORD wReason, WORD wReason,
PCMD_STATUS pStatus PCMD_STATUS pStatus);
);
void void vMgrAuthenBeginSta(void *hDeviceContext,
vMgrAuthenBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PCMD_STATUS pStatus PCMD_STATUS pStatus);
);
void void vMgrCreateOwnIBSS(void *hDeviceContext,
vMgrCreateOwnIBSS( PCMD_STATUS pStatus);
HANDLE hDeviceContext,
PCMD_STATUS pStatus
);
void void vMgrJoinBSSBegin(void *hDeviceContext,
vMgrJoinBSSBegin( PCMD_STATUS pStatus);
HANDLE hDeviceContext,
PCMD_STATUS pStatus
);
void void vMgrRxManagePacket(void *hDeviceContext,
vMgrRxManagePacket(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PSRxMgmtPacket pRxPacket PSRxMgmtPacket pRxPacket);
);
/* /*
void void
vMgrScanBegin( vMgrScanBegin(
HANDLE hDeviceContext, void *hDeviceContext,
PCMD_STATUS pStatus PCMD_STATUS pStatus
); );
*/ */
void void vMgrDeAuthenBeginSta(void *hDeviceContext,
vMgrDeAuthenBeginSta(
HANDLE hDeviceContext,
PSMgmtObject pMgmt, PSMgmtObject pMgmt,
PBYTE abyDestAddress, PBYTE abyDestAddress,
WORD wReason, WORD wReason,
PCMD_STATUS pStatus PCMD_STATUS pStatus);
);
BOOL BOOL bMgrPrepareBeaconToSend(void *hDeviceContext,
bMgrPrepareBeaconToSend( PSMgmtObject pMgmt);
HANDLE hDeviceContext,
PSMgmtObject pMgmt
);
BOOL bAdd_PMKID_Candidate(void *hDeviceContext,
BOOL
bAdd_PMKID_Candidate (
HANDLE hDeviceContext,
PBYTE pbyBSSID, PBYTE pbyBSSID,
PSRSNCapObject psRSNCapObj PSRSNCapObject psRSNCapObj);
);
void void vFlush_PMKID_Candidate(void *hDeviceContext);
vFlush_PMKID_Candidate (
HANDLE hDeviceContext
);
#endif /* __WMGR_H__ */ #endif /* __WMGR_H__ */

View File

@ -489,7 +489,7 @@ static int wpa_set_disassociate(PSDevice pDevice,
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
if (pDevice->bLinkPass) { if (pDevice->bLinkPass) {
if (!memcmp(param->addr, pMgmt->abyCurrBSSID, 6)) if (!memcmp(param->addr, pMgmt->abyCurrBSSID, 6))
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_DISASSOCIATE, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_DISASSOCIATE, NULL);
} }
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
@ -531,9 +531,11 @@ memcpy(pItemSSID->abySSID, param->u.scan_req.ssid, param->u.scan_req.ssid_len);
pItemSSID->len = param->u.scan_req.ssid_len; pItemSSID->len = param->u.scan_req.ssid_len;
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass); BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
// bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, NULL); /* bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL); */
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return ret; return ret;
@ -886,12 +888,14 @@ static int wpa_set_associate(PSDevice pDevice,
if (pCurr == NULL){ if (pCurr == NULL){
printk("wpa_set_associate---->hidden mode site survey before associate.......\n"); printk("wpa_set_associate---->hidden mode site survey before associate.......\n");
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
}; };
} }
/****************************************************************/ /****************************************************************/
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, NULL); bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return ret; return ret;