bool                    bMatchWinStart = false, bPktInBuf = false;
        IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): Seq is %d,pTS->RxIndicateSeq is %d, WinSize is %d\n",__func__,SeqNum,pTS->RxIndicateSeq,WinSize);
        /* Rx Reorder initialize condition.*/
-       if(pTS->RxIndicateSeq == 0xffff) {
+       if (pTS->RxIndicateSeq == 0xffff) {
                pTS->RxIndicateSeq = SeqNum;
        }
 
        /* Drop out the packet which SeqNum is smaller than WinStart */
-       if(SN_LESS(SeqNum, pTS->RxIndicateSeq)) {
+       if (SN_LESS(SeqNum, pTS->RxIndicateSeq)) {
                IEEE80211_DEBUG(IEEE80211_DL_REORDER,"Packet Drop! IndicateSeq: %d, NewSeq: %d\n",
                                 pTS->RxIndicateSeq, SeqNum);
                pHTInfo->RxReorderDropCounter++;
                    SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq))
                {
                        /* This protect buffer from overflow. */
-                       if(index >= REORDER_WIN_SIZE) {
+                       if (index >= REORDER_WIN_SIZE) {
                                IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): Buffer overflow!! \n");
                                bPktInBuf = true;
                                break;
        }
 
        /* Handling pending timer. Set this timer to prevent from long time Rx buffering.*/
-       if(index>0) {
+       if (index>0) {
                // Cancel previous pending timer.
        //      del_timer_sync(&pTS->RxPktPendingTimer);
                pTS->RxTimeoutIndicateSeq = 0xffff;
                ieee80211_indicate_packets(ieee, prxbIndicateArray, index);
        }
 
-       if(bPktInBuf && pTS->RxTimeoutIndicateSeq==0xffff) {
+       if (bPktInBuf && pTS->RxTimeoutIndicateSeq==0xffff) {
                // Set new pending timer.
                IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): SET rx timeout timer\n", __func__);
                pTS->RxTimeoutIndicateSeq = pTS->RxIndicateSeq;
        /* just for debug purpose */
        SeqNum = WLAN_GET_SEQ_SEQ(le16_to_cpu(hdr->seq_ctl));
 
-       if((IEEE80211_QOS_HAS_SEQ(fc))&&\
+       if ((IEEE80211_QOS_HAS_SEQ(fc))&&\
                        (((frameqos *)(skb->data + IEEE80211_3ADDR_LEN))->field.reserved)) {
                bIsAggregateFrame = true;
        }
 
-       if(IEEE80211_QOS_HAS_SEQ(fc)) {
+       if (IEEE80211_QOS_HAS_SEQ(fc)) {
                LLCOffset += 2;
        }
 
-       if(rx_stats->bContainHTC) {
+       if (rx_stats->bContainHTC) {
                LLCOffset += sHTCLng;
        }
        //printk("ChkLength = %d\n", LLCOffset);
                        //==m==>change the length order
                        nSubframe_Length = (nSubframe_Length>>8) + (nSubframe_Length<<8);
 
-                       if(skb->len<(ETHERNET_HEADER_SIZE + nSubframe_Length)) {
+                       if (skb->len<(ETHERNET_HEADER_SIZE + nSubframe_Length)) {
                                printk("%s: A-MSDU parse error!! pRfd->nTotalSubframe : %d\n",\
                                                __func__, rxb->nr_subframes);
                                printk("%s: A-MSDU parse error!! Subframe Length: %d\n",__func__, nSubframe_Length);
                        memcpy(data_ptr, skb->data, nSubframe_Length);
 #endif
                        rxb->subframes[rxb->nr_subframes++] = sub_skb;
-                       if(rxb->nr_subframes >= MAX_SUBFRAME_COUNT) {
+                       if (rxb->nr_subframes >= MAX_SUBFRAME_COUNT) {
                                IEEE80211_DEBUG_RX("ParseSubframe(): Too many Subframes! Packets dropped!\n");
                                break;
                        }
                        skb_pull(skb, nSubframe_Length);
 
-                       if(skb->len != 0) {
+                       if (skb->len != 0) {
                                nPadding_Length = 4 - ((nSubframe_Length + ETHERNET_HEADER_SIZE) % 4);
-                               if(nPadding_Length == 4) {
+                               if (nPadding_Length == 4) {
                                        nPadding_Length = 0;
                                }
 
-                               if(skb->len < nPadding_Length) {
+                               if (skb->len < nPadding_Length) {
                                        return 0;
                                }
 
        frag = WLAN_GET_SEQ_FRAG(sc);
        hdrlen = ieee80211_get_hdrlen(fc);
 
-       if(HTCCheck(ieee, skb->data))
+       if (HTCCheck(ieee, skb->data))
        {
                if(net_ratelimit())
                printk("find HTCControl\n");
        }
 */
 //added by amy for reorder
-       if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
+       if (ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
                && !is_multicast_ether_addr(hdr->addr1))
        {
                TID = Frame_QoSTID(skb->data);
                SeqNum = WLAN_GET_SEQ_SEQ(sc);
                GetTs(ieee,(PTS_COMMON_INFO *) &pTS,hdr->addr2,TID,RX_DIR,true);
-               if(TID !=0 && TID !=3)
+               if (TID !=0 && TID !=3)
                {
                        ieee->bis_any_nonbepkts = true;
                }
        payload = skb->data + hdrlen;
        //ethertype = (payload[6] << 8) | payload[7];
        rxb = kmalloc(sizeof(struct ieee80211_rxb), GFP_ATOMIC);
-       if(rxb == NULL)
+       if (rxb == NULL)
        {
                IEEE80211_DEBUG(IEEE80211_DL_ERR,"%s(): kmalloc rxb error\n",__func__);
                goto rx_dropped;
 
                                stats->rx_packets++;
                                stats->rx_bytes += sub_skb->len;
-                               if(is_multicast_ether_addr(dst)) {
+                               if (is_multicast_ether_addr(dst)) {
                                        stats->multicast++;
                                }
 
        u8 *addr2
 )
 {
-       if(IS_DOT11D_ENABLE(ieee))
+       if (IS_DOT11D_ENABLE(ieee))
        {
-               if(info_element->len!= 0)
+               if (info_element->len!= 0)
                {
                        memcpy(network->CountryIeBuf, info_element->data, info_element->len);
                        network->CountryIeLen = info_element->len;
 
-                       if(!IS_COUNTRY_IE_VALID(ieee))
+                       if (!IS_COUNTRY_IE_VALID(ieee))
                        {
                                Dot11d_UpdateCountryIe(ieee, addr2, info_element->len, info_element->data);
                        }
                // some AP (e.g. Cisco 1242) don't include country IE in their
                // probe response frame.
                //
-               if(IS_EQUAL_CIE_SRC(ieee, addr2) )
+               if (IS_EQUAL_CIE_SRC(ieee, addr2) )
                {
                        UPDATE_CIE_WATCHDOG(ieee);
                }
 
                        //if(tmp_htcap_len !=0  ||  tmp_htinfo_len != 0)
                        {
-                               if((info_element->len >= 3 &&
+                               if ((info_element->len >= 3 &&
                                         info_element->data[0] == 0x00 &&
                                         info_element->data[1] == 0x05 &&
                                         info_element->data[2] == 0xb5) ||
                        else
                                network->cisco_cap_exist = false;
                        //added by amy for LEAP of cisco
-                       if(info_element->len > 4 &&
+                       if (info_element->len > 4 &&
                                info_element->data[0] == 0x00 &&
                                info_element->data[1] == 0x40 &&
                                info_element->data[2] == 0x96 &&
                                        network->bCcxRmEnable = false;
                                }
                        }
-                       if(info_element->len > 4  &&
+                       if (info_element->len > 4  &&
                                info_element->data[0] == 0x00 &&
                                info_element->data[1] == 0x40 &&
                                info_element->data[2] == 0x96 &&
        dst->rates_len = src->rates_len;
        memcpy(dst->rates_ex, src->rates_ex, src->rates_ex_len);
        dst->rates_ex_len = src->rates_ex_len;
-       if(src->ssid_len > 0)
+       if (src->ssid_len > 0)
        {
                memset(dst->ssid, 0, dst->ssid_len);
                dst->ssid_len = src->ssid_len;
                dst->qos_data.param_count = src->qos_data.param_count;
        }
 
-       if(dst->qos_data.supported == 1) {
+       if (dst->qos_data.supported == 1) {
                dst->QoS_Enable = 1;
                if(dst->ssid_len)
                        IEEE80211_DEBUG_QOS
 
        /* dst->last_associate is not overwritten */
        dst->wmm_info = src->wmm_info; //sure to exist in beacon or probe response frame.
-       if(src->wmm_param[0].ac_aci_acm_aifsn|| \
+       if (src->wmm_param[0].ac_aci_acm_aifsn|| \
           src->wmm_param[1].ac_aci_acm_aifsn|| \
           src->wmm_param[2].ac_aci_acm_aifsn|| \
           src->wmm_param[3].ac_aci_acm_aifsn) {
 
        if (!IsLegalChannel(ieee, network.channel))
                return;
-       if(ieee->bGlobalDomain)
+       if (ieee->bGlobalDomain)
        {
                if (WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == IEEE80211_STYPE_PROBE_RESP)
                {
                        else
                        {
                                // Filter over channel ch12~14
-                               if(network.channel > 11)
+                               if (network.channel > 11)
                                {
                                        printk("GetScanInfo(): For Global Domain, filter probe response at channel(%d).\n", network.channel);
                                        return;
                        else
                        {
                                // Filter over channel ch12~14
-                               if(network.channel > 14)
+                               if (network.channel > 14)
                                {
                                        printk("GetScanInfo(): For Global Domain, filter beacon at channel(%d).\n",network.channel);
                                        return;
 
        spin_lock_irqsave(&ieee->lock, flags);
 
-       if(is_same_network(&ieee->current_network, &network, ieee)) {
+       if (is_same_network(&ieee->current_network, &network, ieee)) {
                update_network(&ieee->current_network, &network);
-               if((ieee->current_network.mode == IEEE_N_24G || ieee->current_network.mode == IEEE_G)
+               if ((ieee->current_network.mode == IEEE_N_24G || ieee->current_network.mode == IEEE_G)
                && ieee->current_network.berp_info_valid){
                if(ieee->current_network.erp_value& ERP_UseProtection)
                        ieee->current_network.buseprotection = true;
        spin_unlock_irqrestore(&ieee->lock, flags);
        if (is_beacon(beacon->header.frame_ctl)&&is_same_network(&ieee->current_network, &network, ieee)&&\
                (ieee->state == IEEE80211_LINKED)) {
-               if(ieee->handle_beacon != NULL) {
+               if (ieee->handle_beacon != NULL) {
                        ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network);
                }
        }
 
 /* called with ieee->lock held */
 static void ieee80211_start_scan(struct ieee80211_device *ieee)
 {
-       if(IS_DOT11D_ENABLE(ieee) )
+       if (IS_DOT11D_ENABLE(ieee) )
        {
-               if(IS_COUNTRY_IE_VALID(ieee))
+               if (IS_COUNTRY_IE_VALID(ieee))
                {
                        RESET_CIE_WATCHDOG(ieee);
                }
 /* called with wx_sem held */
 void ieee80211_start_scan_syncro(struct ieee80211_device *ieee)
 {
-       if(IS_DOT11D_ENABLE(ieee) )
+       if (IS_DOT11D_ENABLE(ieee) )
        {
-               if(IS_COUNTRY_IE_VALID(ieee))
+               if (IS_COUNTRY_IE_VALID(ieee))
                {
                        RESET_CIE_WATCHDOG(ieee);
                }
        HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt);
 
 
-       if(pHTInfo->bRegRT2RTAggregation)
+       if (pHTInfo->bRegRT2RTAggregation)
        {
                tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer;
                tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer);
        encrypt = ieee->host_encrypt && crypt && crypt->ops && ((0 == strcmp(crypt->ops->name,"WEP") || wpa_ie_len));
 
        //Include High Throuput capability && Realtek proprietary
-       if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT)
+       if (ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT)
        {
                ht_cap_buf = (u8 *)&(ieee->pHTInfo->SelfHTCap);
                ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
                HTConstructCapabilityElement(ieee, ht_cap_buf, &ht_cap_len, encrypt);
-               if(ieee->pHTInfo->bCurrentRT2RTAggregation)
+               if (ieee->pHTInfo->bCurrentRT2RTAggregation)
                {
                        realtek_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer;
                        realtek_ie_len = sizeof( ieee->pHTInfo->szRT2RTAggBuffer);
        }
 
 
-       if(beacon->bCkipSupported)
+       if (beacon->bCkipSupported)
        {
                ckip_ie_len = 30+2;
        }
-       if(beacon->bCcxRmEnable)
+       if (beacon->bCcxRmEnable)
        {
                ccxrm_ie_len = 6+2;
        }
                tag += osCcxAironetIE.Length;
        }
 
-       if(beacon->bCcxRmEnable)
+       if (beacon->bCcxRmEnable)
        {
                static u8 CcxRmCapBuf[] = {0x00, 0x40, 0x96, 0x01, 0x01, 0x00};
                OCTET_STRING osCcxRmCap;
                tag += osCcxVerNum.Length;
        }
        //HT cap element
-       if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){
-               if(ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC)
+       if (ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){
+               if (ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC)
                {
                        tag = skb_put(skb, ht_cap_len);
                        *tag++ = MFIE_TYPE_HT_CAP;
        }
 
        tag = skb_put(skb, wmm_info_len);
-       if(wmm_info_len) {
+       if (wmm_info_len) {
          ieee80211_WMM_Info(ieee, &tag);
        }
 #ifdef THOMAS_TURBO
        tag = skb_put(skb, turbo_info_len);
-       if(turbo_info_len) {
+       if (turbo_info_len) {
                ieee80211_TURBO_Info(ieee, &tag);
        }
 #endif
        }
        ieee->LinkDetectInfo.SlotNum = 2 * (1 + ieee->current_network.beacon_interval/500);
        // To prevent the immediately calling watch_dog after association.
-       if(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0 )
+       if (ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0 )
        {
                ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
                ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
 
        spin_lock_irqsave(&ieee->lock, flags);
 
-       if((ieee->ps == IEEE80211_PS_DISABLED ||
+       if ((ieee->ps == IEEE80211_PS_DISABLED ||
                ieee->iw_mode != IW_MODE_INFRA ||
                ieee->state != IEEE80211_LINKED)){
 
                                ieee->softmac_stats.rx_ass_ok++;
                                /* station support qos */
                                /* Let the register setting defaultly with Legacy station */
-                               if(ieee->qos_support) {
+                               if (ieee->qos_support) {
                                        assoc_resp = (struct ieee80211_assoc_response_frame *)skb->data;
                                        memset(network, 0, sizeof(*network));
                                        if (ieee80211_parse_info_param(ieee,assoc_resp->info_element,\
        ieee->stats.tx_bytes += txb->payload_size;
        ieee->stats.tx_packets++;
        tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE);
-       if(tcb_desc->bMulticast) {
+       if (tcb_desc->bMulticast) {
                ieee->stats.multicast++;
        }
        /* if xmit available, just xmit it immediately, else just insert it to the wait queue */
        // Ref: 802.11d 11.1.3.3
        // STA shall not start a BSS unless properly formed Beacon frame including a Country IE.
        //
-       if(IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee))
+       if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee))
        {
-               if(! ieee->bGlobalDomain)
+               if (! ieee->bGlobalDomain)
                {
                        return;
                }
 
        u8                      bSendDELBA = false;
 
        // Delete pending BA
-       if(pPendingBa->bValid)
+       if (pPendingBa->bValid)
        {
                DeActivateBAEntry(ieee, pPendingBa);
                bSendDELBA = true;
        }
 
        // Delete admitted BA
-       if(pAdmittedBa->bValid)
+       if (pAdmittedBa->bValid)
        {
                DeActivateBAEntry(ieee, pAdmittedBa);
                bSendDELBA = true;
        PBA_RECORD              pBa = &pRxTs->RxAdmittedBARecord;
        u8                      bSendDELBA = false;
 
-       if(pBa->bValid)
+       if (pBa->bValid)
        {
                DeActivateBAEntry(ieee, pBa);
                bSendDELBA = true;
 
        printk("====================>rx ADDBAREQ from :%pM\n", dst);
 //some other capability is not ready now.
-       if(     (ieee->current_network.qos_data.active == 0) ||
+       if ((ieee->current_network.qos_data.active == 0) ||
                (ieee->pHTInfo->bCurrentHTSupport == false)) //||
        //      (ieee->pStaQos->bEnableRxImmBA == false)        )
        {
        }
        // Search for related traffic stream.
        // If there is no matched TS, reject the ADDBA request.
-       if(     !GetTs(
+       if (!GetTs(
                        ieee,
                        (PTS_COMMON_INFO *)(&pTS),
                        dst,
        // We can do much more check here, including BufferSize, AMSDU_Support, Policy, StartSeqCtrl...
        // I want to check StartSeqCtrl to make sure when we start aggregation!!!
        //
-       if(pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED)
+       if (pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED)
        {
                rc = ADDBA_STATUS_INVALID_PARAM;
                IEEE80211_DEBUG(IEEE80211_DL_ERR, "BA Policy is not correct in %s()\n", __func__);
                // We can compare the value of BA parameter set that Peer returned and Self sent.
                // If it is OK, then admitted. Or we can send DELBA to cancel BA mechanism.
                //
-               if(pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED)
+               if (pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED)
                {
                        // Since this is a kind of ADDBA failed, we delay next ADDBA process.
                        pTS->bAddBaReqDelayed = true;
                return -1;
        }
 
-       if(ieee->current_network.qos_data.active == 0 ||
+       if (ieee->current_network.qos_data.active == 0 ||
                ieee->pHTInfo->bCurrentHTSupport == false )
        {
                IEEE80211_DEBUG(IEEE80211_DL_ERR, "received DELBA while QOS or HT is not supported(%d, %d)\n",ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport);
        {
                PRX_TS_RECORD   pRxTs;
 
-               if( !GetTs(
+               if (!GetTs(
                                ieee,
                                (PTS_COMMON_INFO *)&pRxTs,
                                dst,
        {
                PTX_TS_RECORD   pTxTs;
 
-               if(!GetTs(
+               if (!GetTs(
                        ieee,
                        (PTS_COMMON_INFO *)&pTxTs,
                        dst,
 
        // 2008/01/25 MH Judeg if we need to use OFDM to sned MGNT frame for broadcom AP.
        // 2008/01/28 MH We must prevent that we select null bssid to link.
 
-       if(network->broadcom_cap_exist)
+       if (network->broadcom_cap_exist)
        {
                retValue = 1;
        }
 
        // 2008.06.12
        // For RTL819X, if pairwisekey = wep/tkip, ap is ralink, we support only MCS0~7.
-       if(ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
+       if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
        {
                int i;
                for(i = 1; i< 16; i++)
        *posRT2RTAgg++ = 0x01;
        *posRT2RTAgg = 0x10;//*posRT2RTAgg = 0x02;
 
-       if(ieee->bSupportRemoteWakeUp) {
+       if (ieee->bSupportRemoteWakeUp) {
                *posRT2RTAgg |= 0x08;//RT_HT_CAP_USE_WOW;
        }
 
 
        for(i = 0; i < 16; i++)
        {
-               if(availableMcsRate[i] != 0)
+               if (availableMcsRate[i] != 0)
                {
                        bitMap = availableMcsRate[i];
                        for(j = 0; j < 8; j++)
                        {
-                               if((bitMap%2) != 0)
+                               if ((bitMap%2) != 0)
                                {
                                        if(HTMcsToDataRate(ieee, (8*i+j)) > HTMcsToDataRate(ieee, mcsRate))
                                                mcsRate = (8*i+j);
 
        // Lanhsin: mark for tmp to avoid deauth by ap from  s3
        //if(memcmp(pMgntInfo->Bssid, NETGEAR834Bv2_BROADCOM, 3)==0)
-       if(0)
+       if (0)
                {
 
                        pHTInfo->bCurrentAMPDUEnable = false;
 //     PHT_CAPABILITY_ELE              pPeerHTCap = (PHT_CAPABILITY_ELE)pNetwork->bssht.bdHTCapBuf;
        PHT_INFORMATION_ELE             pPeerHTInfo = (PHT_INFORMATION_ELE)pNetwork->bssht.bdHTInfoBuf;
 
-       if(pHTInfo->bCurrentHTSupport)
+       if (pHTInfo->bCurrentHTSupport)
        {
                //
                // Config current operation mode.
 ********************************************************************************************************************/
 u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame)
 {
-       if(ieee->pHTInfo->bCurrentHTSupport)
+       if (ieee->pHTInfo->bCurrentHTSupport)
        {
                if ((IsQoSDataFrame(pFrame) && Frame_Order(pFrame)) == 1) {
                        IEEE80211_DEBUG(IEEE80211_DL_HT, "HT CONTROL FILED EXIST!!\n");
 //             return;
 
 //     spin_lock_irqsave(&(ieee->bw_spinlock), flags);
-       if(pHTInfo->bSwBwInProgress) {
+       if (pHTInfo->bSwBwInProgress) {
 //             spin_unlock_irqrestore(&(ieee->bw_spinlock), flags);
                return;
        }