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

View File

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

View File

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

View File

@ -226,134 +226,82 @@ typedef struct tagKnownNodeDB {
} KnownNodeDB, *PKnownNodeDB;
/*--------------------- Export Functions --------------------------*/
PKnownBSS BSSpSearchBSSList(void *hDeviceContext,
PBYTE pbyDesireBSSID,
PBYTE pbyDesireSSID,
CARD_PHY_TYPE ePhyType);
PKnownBSS BSSpAddrIsInBSSList(void *hDeviceContext,
PBYTE abyBSSID,
PWLAN_IE_SSID pSSID);
PKnownBSS
BSSpSearchBSSList(
HANDLE hDeviceContext,
PBYTE pbyDesireBSSID,
PBYTE pbyDesireSSID,
CARD_PHY_TYPE ePhyType
);
void BSSvClearBSSList(void *hDeviceContext, BOOL bKeepCurrBSSID);
PKnownBSS
BSSpAddrIsInBSSList(
HANDLE hDeviceContext,
PBYTE abyBSSID,
PWLAN_IE_SSID pSSID
);
BOOL BSSbInsertToBSSList(void *hDeviceContext,
PBYTE abyBSSIDAddr,
QWORD qwTimestamp,
WORD wBeaconInterval,
WORD wCapInfo,
BYTE byCurrChannel,
PWLAN_IE_SSID pSSID,
PWLAN_IE_SUPP_RATES pSuppRates,
PWLAN_IE_SUPP_RATES pExtSuppRates,
PERPObject psERP,
PWLAN_IE_RSN pRSN,
PWLAN_IE_RSN_EXT pRSNWPA,
PWLAN_IE_COUNTRY pIE_Country,
PWLAN_IE_QUIET pIE_Quiet,
UINT uIELength,
PBYTE pbyIEs,
void *pRxPacketContext);
void
BSSvClearBSSList(
HANDLE hDeviceContext,
BOOL bKeepCurrBSSID
);
BOOL BSSbUpdateToBSSList(void *hDeviceContext,
QWORD qwTimestamp,
WORD wBeaconInterval,
WORD wCapInfo,
BYTE byCurrChannel,
BOOL bChannelHit,
PWLAN_IE_SSID pSSID,
PWLAN_IE_SUPP_RATES pSuppRates,
PWLAN_IE_SUPP_RATES pExtSuppRates,
PERPObject psERP,
PWLAN_IE_RSN pRSN,
PWLAN_IE_RSN_EXT pRSNWPA,
PWLAN_IE_COUNTRY pIE_Country,
PWLAN_IE_QUIET pIE_Quiet,
PKnownBSS pBSSList,
UINT uIELength,
PBYTE pbyIEs,
void *pRxPacketContext);
BOOL
BSSbInsertToBSSList(
HANDLE hDeviceContext,
PBYTE abyBSSIDAddr,
QWORD qwTimestamp,
WORD wBeaconInterval,
WORD wCapInfo,
BYTE byCurrChannel,
PWLAN_IE_SSID pSSID,
PWLAN_IE_SUPP_RATES pSuppRates,
PWLAN_IE_SUPP_RATES pExtSuppRates,
PERPObject psERP,
PWLAN_IE_RSN pRSN,
PWLAN_IE_RSN_EXT pRSNWPA,
PWLAN_IE_COUNTRY pIE_Country,
PWLAN_IE_QUIET pIE_Quiet,
UINT uIELength,
PBYTE pbyIEs,
HANDLE pRxPacketContext
);
BOOL BSSbIsSTAInNodeDB(void *hDeviceContext,
PBYTE abyDstAddr,
PUINT puNodeIndex);
void BSSvCreateOneNode(void *hDeviceContext, PUINT puNodeIndex);
BOOL
BSSbUpdateToBSSList(
HANDLE hDeviceContext,
QWORD qwTimestamp,
WORD wBeaconInterval,
WORD wCapInfo,
BYTE byCurrChannel,
BOOL bChannelHit,
PWLAN_IE_SSID pSSID,
PWLAN_IE_SUPP_RATES pSuppRates,
PWLAN_IE_SUPP_RATES pExtSuppRates,
PERPObject psERP,
PWLAN_IE_RSN pRSN,
PWLAN_IE_RSN_EXT pRSNWPA,
PWLAN_IE_COUNTRY pIE_Country,
PWLAN_IE_QUIET pIE_Quiet,
PKnownBSS pBSSList,
UINT uIELength,
PBYTE pbyIEs,
HANDLE pRxPacketContext
);
void BSSvUpdateAPNode(void *hDeviceContext,
PWORD pwCapInfo,
PWLAN_IE_SUPP_RATES pItemRates,
PWLAN_IE_SUPP_RATES pExtSuppRates);
void BSSvSecondCallBack(void *hDeviceContext);
BOOL
BSSbIsSTAInNodeDB(
HANDLE hDeviceContext,
PBYTE abyDstAddr,
PUINT puNodeIndex
);
void BSSvUpdateNodeTxCounter(void *hDeviceContext,
PSStatCounter pStatistic,
BYTE byTSR,
BYTE byPktNO);
void
BSSvCreateOneNode(
HANDLE hDeviceContext,
PUINT puNodeIndex
);
void BSSvRemoveOneNode(void *hDeviceContext,
UINT uNodeIndex);
void
BSSvUpdateAPNode(
HANDLE hDeviceContext,
PWORD pwCapInfo,
PWLAN_IE_SUPP_RATES pItemRates,
PWLAN_IE_SUPP_RATES pExtSuppRates
);
void BSSvAddMulticastNode(void *hDeviceContext);
void BSSvClearNodeDBTable(void *hDeviceContext,
UINT uStartIndex);
void
BSSvSecondCallBack(
HANDLE hDeviceContext
);
void
BSSvUpdateNodeTxCounter(
HANDLE hDeviceContext,
PSStatCounter pStatistic,
BYTE byTSR,
BYTE byPktNO
);
void
BSSvRemoveOneNode(
HANDLE hDeviceContext,
UINT uNodeIndex
);
void
BSSvAddMulticastNode(
HANDLE hDeviceContext
);
void
BSSvClearNodeDBTable(
HANDLE hDeviceContext,
UINT uStartIndex
);
void
BSSvClearAnyBSSJoinRecord(
HANDLE hDeviceContext
);
void BSSvClearAnyBSSJoinRecord(void *hDeviceContext);
#endif /* __BSSDB_H__ */

View File

@ -1069,7 +1069,9 @@ static BOOL s_bAPModeRxCtl (
// delcare received ps-poll event
if (IS_CTL_PSPOLL(pbyFrame)) {
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");
}
else {
@ -1078,7 +1080,9 @@ static BOOL s_bAPModeRxCtl (
if (!IS_FC_POWERMGT(pbyFrame)) {
pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = FALSE;
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");
}
}
@ -1094,7 +1098,9 @@ static BOOL s_bAPModeRxCtl (
if (pMgmt->sNodeDBTable[iSANodeIndex].wEnQueueCnt > 0) {
pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = FALSE;
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");
}
@ -1596,7 +1602,7 @@ void RXvMngWorkItem(void *Context)
}
ASSERT(pRCB);// cannot be NULL
pRxPacket = &(pRCB->sMngPacket);
vMgrRxManagePacket((HANDLE)pDevice, &(pDevice->sMgmtObj), pRxPacket);
vMgrRxManagePacket((void *) pDevice, &(pDevice->sMgmtObj), pRxPacket);
pRCB->Ref--;
if(pRCB->Ref == 0) {
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->sNodeDBTable[0].bRxPSPoll = TRUE;
if (pMgmt->sNodeDBTable[0].bPSEnable)
bScheduleCommand((HANDLE)pDevice,
WLAN_CMD_RX_PSPOLL,
NULL);
bScheduleCommand((void *) pDevice,
WLAN_CMD_RX_PSPOLL,
NULL);
}
bScheduleCommand((HANDLE)pDevice,
bScheduleCommand((void *) pDevice,
WLAN_CMD_BECON_SEND,
NULL);
} /* if (pDevice->eOPMode == OP_MODE_AP) */
@ -174,13 +174,13 @@ INTnsProcessData(PSDevice pDevice)
}
if (pINTData->byISR0 & ISR_TBTT) {
if (pDevice->bEnablePSMode)
bScheduleCommand((HANDLE) pDevice,
bScheduleCommand((void *) pDevice,
WLAN_CMD_TBTT_WAKEUP,
NULL);
if (pDevice->bChannelSwitch) {
pDevice->byChannelSwitchCount--;
if (pDevice->byChannelSwitchCount == 0)
bScheduleCommand((HANDLE) pDevice,
bScheduleCommand((void *) pDevice,
WLAN_CMD_11H_CHSW,
NULL);
}
@ -207,7 +207,7 @@ INTnsProcessData(PSDevice pDevice)
if (pINTData->byISR1 != 0)
if (pINTData->byISR1 & ISR_GPIO3)
bScheduleCommand((HANDLE) pDevice,
bScheduleCommand((void *) pDevice,
WLAN_CMD_RADIO,
NULL);
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);
}
spin_lock_irq(&pDevice->lock);
if (memcmp(pMgmt->abyCurrBSSID, &abyNullAddr[0], 6) == 0)
BSSvClearBSSList((HANDLE)pDevice, FALSE);
else
BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_BSS_SCAN..begin \n");
if (pItemSSID->len != 0)
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, abyScanSSID);
else
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
if (memcmp(pMgmt->abyCurrBSSID, &abyNullAddr[0], 6) == 0)
BSSvClearBSSList((void *) pDevice, FALSE);
else
BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_BSS_SCAN..begin\n");
if (pItemSSID->len != 0)
bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
abyScanSSID);
else
bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
spin_unlock_irq(&pDevice->lock);
break;
@ -207,8 +212,10 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
netif_stop_queue(pDevice->dev);
spin_lock_irq(&pDevice->lock);
pMgmt->eCurrState = WMAC_STATE_IDLE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, NULL);
bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL);
spin_unlock_irq(&pDevice->lock);
break;
@ -576,7 +583,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
netif_stop_queue(pDevice->dev);
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);
break;

View File

@ -209,9 +209,9 @@ if(pDevice->byReAssocCount > 0) { //reject scan when re-associating!
spin_lock_irq(&pDevice->lock);
#ifdef update_BssList
BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass);
#endif
#ifdef update_BssList
BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
#endif
//mike add: active scan OR passive scan OR desire_ssid scan
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;
PRINT_K("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n",((PWLAN_IE_SSID)abyScanSSID)->abySSID,
((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);
return 0;
@ -244,7 +244,7 @@ if(pDevice->byReAssocCount > 0) { //reject scan when re-associating!
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
//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);
return 0;
@ -944,10 +944,14 @@ int iwctl_siwessid(struct net_device *dev,
if (pCurr == NULL){
PRINT_K("SIOCSIWESSID:hidden ssid site survey before associate.......\n");
vResetCommandTimer((HANDLE) pDevice);
vResetCommandTimer((void *) pDevice);
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
WLAN_CMD_SSID,
pMgmt->abyDesireSSID);
}
else { //mike:to find out if that desired SSID is a hidden-ssid AP ,
// 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!!!
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!
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
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) {
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) {
pDevice->ePSMode = WMAC_POWER_FAST;
PSvEnablePowerSaving((HANDLE)pDevice, pMgmt->wListenInterval);
PSvEnablePowerSaving((void *) pDevice, pMgmt->wListenInterval);
}
switch (wrq->flags & IW_POWER_MODE) {
case IW_POWER_UNICAST_R:
@ -2007,12 +2015,16 @@ int iwctl_siwmlme(struct net_device *dev,
case IW_MLME_DEAUTH:
//this command seems to be not complete,please test it --einsnliu
//printk("iwctl_siwmlme--->send DEAUTH\n");
//bScheduleCommand((HANDLE) pDevice, WLAN_CMD_DEAUTH, (PBYTE)&reason);
/* bScheduleCommand((void *) pDevice,
WLAN_CMD_DEAUTH,
(PBYTE)&reason); */
//break;
case IW_MLME_DISASSOC:
if(pDevice->bLinkPass == TRUE){
PRINT_K("iwctl_siwmlme--->send DISASSOCIATE\n");
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_DISASSOCIATE, NULL);
bScheduleCommand((void *) pDevice,
WLAN_CMD_DISASSOCIATE,
NULL);
}
break;
default:

View File

@ -1158,12 +1158,12 @@ static int device_open(struct net_device *dev) {
}
if (pDevice->sMgmtObj.eConfigMode == WMAC_CONFIG_AP) {
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_RUN_AP, NULL);
bScheduleCommand((void *) pDevice, WLAN_CMD_RUN_AP, NULL);
}
else {
//mike:mark@2008-11-10
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
//bScheduleCommand((HANDLE)pDevice, WLAN_CMD_SSID, NULL);
bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, 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
if (pDevice->bLinkPass) {
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_DISASSOCIATE, NULL);
bScheduleCommand((void *) pDevice, WLAN_CMD_DISASSOCIATE, NULL);
mdelay(30);
}
//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) {
netif_stop_queue(pDevice->dev);
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);
}
else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Commit the settings\n");
spin_lock_irq(&pDevice->lock);
//2007-1121-01<Modify>by EinsnLiu
if (pDevice->bLinkPass&&
if (pDevice->bLinkPass &&
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 {
pDevice->bLinkPass = FALSE;
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);
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
if(pDevice->bWPASuppWextEnabled !=TRUE)
if (!pDevice->bWPASuppWextEnabled)
#endif
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, NULL);
bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
WLAN_CMD_SSID,
NULL);
spin_unlock_irq(&pDevice->lock);
}
pDevice->bCommit = FALSE;

View File

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

View File

@ -48,37 +48,14 @@
/* PSDevice pDevice */
/* PSDevice hDeviceContext */
BOOL
PSbConsiderPowerDown(
HANDLE hDeviceContext,
BOOL bCheckRxDMA,
BOOL bCheckCountToWakeUp
);
BOOL PSbConsiderPowerDown(void *hDeviceContext,
BOOL bCheckRxDMA,
BOOL bCheckCountToWakeUp);
void
PSvDisablePowerSaving(
HANDLE hDeviceContext
);
void
PSvEnablePowerSaving(
HANDLE hDeviceContext,
WORD wListenInterval
);
void
PSvSendPSPOLL(
HANDLE hDeviceContext
);
BOOL
PSbSendNullPacket(
HANDLE hDeviceContext
);
BOOL
PSbIsNextTBTTWakeUp(
HANDLE hDeviceContext
);
void PSvDisablePowerSaving(void *hDeviceContext);
void PSvEnablePowerSaving(void *hDeviceContext, WORD wListenInterval);
void PSvSendPSPOLL(void *hDeviceContext);
BOOL PSbSendNullPacket(void *hDeviceContext);
BOOL PSbIsNextTBTTWakeUp(void *hDeviceContext);
#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) {
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_SETPOWER, NULL);
bScheduleCommand((void *) pDevice, WLAN_CMD_SETPOWER, NULL);
}
if (pDevice->wCurrentRate <= RATE_11M) {
@ -3118,7 +3120,9 @@ nsDMA_tx_packet(
if ( pDevice->bEnablePSMode == TRUE ) {
if ( !pDevice->bPSModeTxBurst ) {
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_MAC_DISPOWERSAVING, NULL);
bScheduleCommand((void *) pDevice,
WLAN_CMD_MAC_DISPOWERSAVING,
NULL);
pDevice->bPSModeTxBurst = TRUE;
}
}
@ -3138,7 +3142,7 @@ nsDMA_tx_packet(
if (bNeedDeAuth == TRUE) {
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) {
@ -3258,9 +3262,8 @@ bRelayPacketSend (
pDevice->wCurrentRate = pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate;
}
if (wKeepRate != pDevice->wCurrentRate) {
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SETPOWER, NULL);
bScheduleCommand((void *) pDevice, WLAN_CMD_SETPOWER, NULL);
}
if (pDevice->wCurrentRate <= RATE_11M)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -489,7 +489,7 @@ static int wpa_set_disassociate(PSDevice pDevice,
spin_lock_irq(&pDevice->lock);
if (pDevice->bLinkPass) {
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);
@ -513,7 +513,7 @@ static int wpa_set_disassociate(PSDevice pDevice,
*/
static int wpa_set_scan(PSDevice pDevice,
struct viawget_wpa_param *param)
struct viawget_wpa_param *param)
{
int ret = 0;
@ -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;
spin_lock_irq(&pDevice->lock);
BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass);
// bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
/* bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL); */
bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
spin_unlock_irq(&pDevice->lock);
return ret;
@ -886,12 +888,14 @@ static int wpa_set_associate(PSDevice pDevice,
if (pCurr == NULL){
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);
return ret;