if (pbyDesireBSSID != NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"BSSpSearchBSSList BSSID[%pM]\n", pbyDesireBSSID);
- if ((!is_broadcast_ether_addr(pbyDesireBSSID)) &&
- (memcmp(pbyDesireBSSID, ZeroBSSID, 6) != 0))
+ if (!is_broadcast_ether_addr(pbyDesireBSSID) &&
+ memcmp(pbyDesireBSSID, ZeroBSSID, 6) != 0)
pbyBSSID = pbyDesireBSSID;
}
- if ((pbyDesireSSID != NULL) &&
- (((PWLAN_IE_SSID) pbyDesireSSID)->len != 0))
+ if (pbyDesireSSID != NULL &&
+ ((PWLAN_IE_SSID) pbyDesireSSID)->len != 0)
pSSID = (PWLAN_IE_SSID) pbyDesireSSID;
- if ((pbyBSSID != NULL) && (pDevice->bRoaming == false)) {
+ if (pbyBSSID != NULL && pDevice->bRoaming == false) {
/* match BSSID first */
for (ii = 0; ii < MAX_BSS_NUM; ii++) {
pCurrBSS = &(pMgmt->sBSSList[ii]);
pCurrBSS->bSelected = false;
- if ((pCurrBSS->bActive) &&
- (pCurrBSS->bSelected == false) &&
- (ether_addr_equal(pCurrBSS->abyBSSID, pbyBSSID))) {
+ if (pCurrBSS->bActive &&
+ pCurrBSS->bSelected == false &&
+ ether_addr_equal(pCurrBSS->abyBSSID, pbyBSSID)) {
if (pSSID != NULL) {
/* compare ssid */
- if ((!memcmp(pSSID->abySSID,
+ if (!memcmp(pSSID->abySSID,
((PWLAN_IE_SSID) pCurrBSS->abySSID)->abySSID,
- pSSID->len)) &&
- ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
- ((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) &&
+ pSSID->len) &&
+ (pMgmt->eConfigMode == WMAC_CONFIG_AUTO ||
+ (pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA &&
WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) ||
- ((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) &&
+ (pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA &&
WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)))) {
pCurrBSS->bSelected = true;
return pCurrBSS;
}
- } else if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
- ((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) ||
- ((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo))) {
+ } else if (pMgmt->eConfigMode == WMAC_CONFIG_AUTO ||
+ (pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) ||
+ (pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo))) {
pCurrBSS->bSelected = true;
return pCurrBSS;
}
pCurrBSS->bSelected = false;
if (pCurrBSS->bActive) {
- if ((pSSID != NULL) &&
+ if (pSSID != NULL &&
/* matched SSID */
(memcmp(pSSID->abySSID,
((PWLAN_IE_SSID) pCurrBSS->abySSID)->abySSID,
pSSID->len) ||
- (pSSID->len !=
- ((PWLAN_IE_SSID) pCurrBSS->abySSID)->len))) {
+ pSSID->len !=
+ ((PWLAN_IE_SSID) pCurrBSS->abySSID)->len)) {
/* SSID not match skip this BSS */
continue;
}
- if (((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) ||
- ((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo))
+ if ((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) ||
+ (pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo))
) {
/* Type not match skip this BSS */
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BSS type mismatch.... Config[%d] BSS[0x%04x]\n", pMgmt->eConfigMode, pCurrBSS->wCapInfo);
continue;
}
- if ((ePhyType != PHY_TYPE_AUTO) &&
- (((ePhyType == PHY_TYPE_11A) &&
- (PHY_TYPE_11A != pCurrBSS->eNetworkTypeInUse)) ||
- ((ePhyType != PHY_TYPE_11A) &&
- (PHY_TYPE_11A == pCurrBSS->eNetworkTypeInUse)))) {
+ if (ePhyType != PHY_TYPE_AUTO &&
+ ((ePhyType == PHY_TYPE_11A &&
+ PHY_TYPE_11A != pCurrBSS->eNetworkTypeInUse) ||
+ (ePhyType != PHY_TYPE_11A &&
+ PHY_TYPE_11A == pCurrBSS->eNetworkTypeInUse))) {
/* PhyType not match skip this BSS */
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Physical type mismatch.... ePhyType[%d] BSS[%d]\n", ePhyType, pCurrBSS->eNetworkTypeInUse);
continue;
for (ii = 0; ii < MAX_BSS_NUM; ii++) {
pBSSList = &(pMgmt->sBSSList[ii]);
- if ((pBSSList->bActive) &&
- (ether_addr_equal(pBSSList->abyBSSID, abyBSSID)) &&
- (pSSID->len == ((PWLAN_IE_SSID) pBSSList->abySSID)->len) &&
- (memcmp(pSSID->abySSID,
+ if (pBSSList->bActive &&
+ ether_addr_equal(pBSSList->abyBSSID, abyBSSID) &&
+ pSSID->len == ((PWLAN_IE_SSID) pBSSList->abySSID)->len &&
+ memcmp(pSSID->abySSID,
((PWLAN_IE_SSID) pBSSList->abySSID)->abySSID,
- pSSID->len) == 0))
+ pSSID->len) == 0)
return pBSSList;
}
pBSSList->uRSSI = pRxPacket->uRSSI;
pBSSList->bySQ = pRxPacket->bySQ;
- if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) &&
- (pMgmt->eCurrState == WMAC_STATE_ASSOC) &&
+ if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA &&
+ pMgmt->eCurrState == WMAC_STATE_ASSOC &&
/* assoc with BSS */
- (pBSSList == pMgmt->pCurrBSS))
+ pBSSList == pMgmt->pCurrBSS)
bParsingQuiet = true;
WPA_ClearRSN(pBSSList);
}
}
- if ((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pBSSList->bWPA2Valid == true)) {
+ if (pMgmt->eAuthenMode == WMAC_AUTH_WPA2 || pBSSList->bWPA2Valid == true) {
PSKeyItem pTransmitKey = NULL;
bool bIs802_1x = false;
break;
}
}
- if ((bIs802_1x == true) && (pSSID->len == ((PWLAN_IE_SSID) pMgmt->abyDesireSSID)->len) &&
- (!memcmp(pSSID->abySSID, ((PWLAN_IE_SSID) pMgmt->abyDesireSSID)->abySSID, pSSID->len))) {
+ 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((void *) pDevice,
pBSSList->abyBSSID,
&pBSSList->sRSNCapObj);
- if ((pDevice->bLinkPass == true) &&
- (pMgmt->eCurrState == WMAC_STATE_ASSOC) &&
- ((KeybGetTransmitKey(&(pDevice->sKey),
+ if (pDevice->bLinkPass == true &&
+ pMgmt->eCurrState == WMAC_STATE_ASSOC &&
+ (KeybGetTransmitKey(&(pDevice->sKey),
pDevice->abyBSSID,
PAIRWISE_KEY,
- &pTransmitKey) == true) ||
- (KeybGetTransmitKey(&(pDevice->sKey),
+ &pTransmitKey) == true ||
+ KeybGetTransmitKey(&(pDevice->sKey),
pDevice->abyBSSID,
GROUP_KEY,
- &pTransmitKey) == true))) {
+ &pTransmitKey) == true)) {
pDevice->gsPMKIDCandidate.StatusType = Ndis802_11StatusType_PMKID_CandidateList;
pDevice->gsPMKIDCandidate.Version = 1;
if (pSSID->len > WLAN_SSID_MAXLEN)
pSSID->len = WLAN_SSID_MAXLEN;
- if ((pSSID->len != 0) && (pSSID->abySSID[0] != 0))
+ if (pSSID->len != 0 && pSSID->abySSID[0] != 0)
memcpy(pBSSList->abySSID, pSSID, pSSID->len + WLAN_IEHDR_LEN);
memcpy(pBSSList->abySuppRates, pSuppRates, pSuppRates->len + WLAN_IEHDR_LEN);
pBSSList->uRSSI = pRxPacket->uRSSI;
pBSSList->bySQ = pRxPacket->bySQ;
- if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) &&
- (pMgmt->eCurrState == WMAC_STATE_ASSOC) &&
+ if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA &&
+ pMgmt->eCurrState == WMAC_STATE_ASSOC &&
/* assoc with BSS */
- (pBSSList == pMgmt->pCurrBSS))
+ pBSSList == pMgmt->pCurrBSS)
bParsingQuiet = true;
WPA_ClearRSN(pBSSList); /* mike update */
/* Index = 0 reserved for AP Node */
for (ii = 1; ii < (MAX_NODE_NUM + 1); ii++) {
- if ((pMgmt->sNodeDBTable[ii].bActive) &&
- (ether_addr_equal(abyDstAddr,
- pMgmt->sNodeDBTable[ii].abyMACAddr))) {
+ if (pMgmt->sNodeDBTable[ii].bActive &&
+ ether_addr_equal(abyDstAddr,
+ pMgmt->sNodeDBTable[ii].abyMACAddr)) {
*puNodeIndex = ii;
return true;
}
if (pDevice->byReAssocCount > 0) {
pDevice->byReAssocCount++;
- if ((pDevice->byReAssocCount > 10) && (pDevice->bLinkPass != true)) { /* 10 sec timeout */
+ if (pDevice->byReAssocCount > 10 && pDevice->bLinkPass != true) { /* 10 sec timeout */
printk("Re-association timeout!!!\n");
pDevice->byReAssocCount = 0;
/* if (pDevice->bWPASuppWextEnabled == true) */
if (pMgmt->sNodeDBTable[ii].wEnQueueCnt != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Index= %d, Queue = %d pending\n",
ii, pMgmt->sNodeDBTable[ii].wEnQueueCnt);
- if ((ii > 0) && (pMgmt->sNodeDBTable[ii].wEnQueueCnt > 15)) {
+ if (ii > 0 && pMgmt->sNodeDBTable[ii].wEnQueueCnt > 15) {
BSSvRemoveOneNode(pDevice, ii);
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Pending many queues PS STA Index = %d remove\n", ii);
continue;
}
- if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->byBBType == BB_TYPE_11G)) {
+ if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP && pDevice->byBBType == BB_TYPE_11G) {
/* on/off protect mode */
if (WLAN_GET_ERP_USE_PROTECTION(pDevice->byERPFlag)) {
pItemSSID = (PWLAN_IE_SSID) pMgmt->abyDesireSSID;
pCurrSSID = (PWLAN_IE_SSID) pMgmt->abyCurrSSID;
- if ((pMgmt->eCurrMode == WMAC_MODE_STANDBY) ||
- (pMgmt->eCurrMode == WMAC_MODE_ESS_STA)) {
+ if (pMgmt->eCurrMode == WMAC_MODE_STANDBY ||
+ pMgmt->eCurrMode == WMAC_MODE_ESS_STA) {
if (pMgmt->sNodeDBTable[0].bActive) { /* Assoc with BSS */
s_vCheckPreEDThreshold(pDevice);
}
- if ((pMgmt->sNodeDBTable[0].uInActiveCount >= (LOST_BEACON_COUNT/2)) &&
- (pDevice->byBBVGACurrent != pDevice->abyBBVGA[0])) {
+ if (pMgmt->sNodeDBTable[0].uInActiveCount >= (LOST_BEACON_COUNT/2) &&
+ pDevice->byBBVGACurrent != pDevice->abyBBVGA[0]) {
pDevice->byBBVGANew = pDevice->abyBBVGA[0];
bScheduleCommand((void *) pDevice,
WLAN_CMD_CHANGE_BBSENSITIVITY,
pDevice->uAutoReConnectTime = 0;
pDevice->uIsroamingTime = 0;
pDevice->bRoaming = false;
- } else if ((pDevice->bRoaming == false) && (pDevice->bIsRoaming == true)) {
+ } else if (pDevice->bRoaming == false && pDevice->bIsRoaming == true) {
pDevice->uIsroamingTime++;
if (pDevice->uIsroamingTime >= 20)
pDevice->bIsRoaming = false;
if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
/* if adhoc started which essid is NULL string, rescanning. */
- if ((pMgmt->eCurrState == WMAC_STATE_STARTED) && (pCurrSSID->len == 0)) {
+ if (pMgmt->eCurrState == WMAC_STATE_STARTED && pCurrSSID->len == 0) {
if (pDevice->uAutoReConnectTime < 10) {
pDevice->uAutoReConnectTime++;
} else {
pMgmt->sNodeDBTable[0].uTxRetry += byTxRetry;
if (byTxRetry != 0) {
pMgmt->sNodeDBTable[0].uTxFail[MAX_RATE] += byTxRetry;
- if ((byFallBack == AUTO_FB_NONE) ||
- (wRate < RATE_18M)) {
+ if (byFallBack == AUTO_FB_NONE ||
+ wRate < RATE_18M) {
pMgmt->sNodeDBTable[0].uTxFail[wRate] += byTxRetry;
} else if (byFallBack == AUTO_FB_0) {
for (ii = 0; ii < byTxRetry; ii++) {
}
}
- if (((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) ||
- (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) &&
- (BSSbIsSTAInNodeDB((void *) pDevice,
+ if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA ||
+ pMgmt->eCurrMode == WMAC_MODE_ESS_AP) &&
+ BSSbIsSTAInNodeDB((void *) pDevice,
pbyDestAddr,
- &uNodeIndex))) {
+ &uNodeIndex)) {
pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts += 1;
if (!(byTSR & (TSR_TMO | TSR_RETRYTMO))) {
/* transmit success, TxAttempts at least plus one */
struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
int ii;
- if ((pMgmt->eCurrState == WMAC_STATE_ASSOC) ||
- ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && (pMgmt->eCurrState == WMAC_STATE_JOINTED))) {
+ if (pMgmt->eCurrState == WMAC_STATE_ASSOC ||
+ (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA && pMgmt->eCurrState == WMAC_STATE_JOINTED)) {
pBSSList = BSSpAddrIsInBSSList(pDevice, pMgmt->abyCurrBSSID, (PWLAN_IE_SSID) pMgmt->abyCurrSSID);
if (pBSSList != NULL) {
/* Update BB register if RSSI is too strong */
PKnownBSS pBSSList = NULL;
struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
- if ((pMgmt->eCurrState == WMAC_STATE_ASSOC) ||
- ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && (pMgmt->eCurrState == WMAC_STATE_JOINTED))) {
+ if (pMgmt->eCurrState == WMAC_STATE_ASSOC ||
+ (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA && pMgmt->eCurrState == WMAC_STATE_JOINTED)) {
pBSSList = BSSpAddrIsInBSSList(pDevice, pMgmt->abyCurrBSSID, (PWLAN_IE_SSID) pMgmt->abyCurrSSID);
if (pBSSList != NULL) {
pDevice->byBBPreEDRSSI = (u8) (~(pBSSList->ldBmAverRange) + 1);