Staging: rt2860: remove WPA_SUPPLICANT_SUPPORT ifdefs
[pandora-kernel.git] / drivers / staging / rt2860 / sta / connect.c
index 247e0c1..7cede82 100644 (file)
@@ -178,13 +178,6 @@ VOID MlmeCntlMachinePerformAction(
                                        pAd->bLedOnScanning = FALSE;
                                        RTMPSetLED(pAd, pAd->LedStatus);
                                }
-#ifdef DOT11N_DRAFT3
-                               // AP sent a 2040Coexistence mgmt frame, then station perform a scan, and then send back the respone.
-                               if (pAd->CommonCfg.BSSCoexist2040.field.InfoReq == 1)
-                               {
-                                       Update2040CoexistFrameAndNotify(pAd, BSSID_WCID, TRUE);
-                               }
-#endif // DOT11N_DRAFT3 //
                        }
                        break;
 
@@ -237,9 +230,8 @@ VOID CntlIdleProc(
                        DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING);
                        MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ, sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
                        pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_DISASSOC;
-#ifdef WPA_SUPPLICANT_SUPPORT
+
             if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_ENABLE_WITH_WEB_UI)
-#endif // WPA_SUPPLICANT_SUPPORT //
             {
                        // Set the AutoReconnectSsid to prevent it reconnect to old SSID
                        // Since calling this indicate user don't want to connect to that SSID anymore.
@@ -397,7 +389,7 @@ VOID CntlOidSsidProc(
                        }
 
                        pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
+
             {
                 union iwreq_data    wrqu;
 
@@ -406,7 +398,6 @@ VOID CntlOidSsidProc(
                 wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
 
             }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
                }
        }
        else if (INFRA_ON(pAd))
@@ -529,7 +520,7 @@ VOID CntlOidRTBssidProc(
                // already connected to the same BSSID, go back to idle state directly
                DBGPRINT(RT_DEBUG_TRACE, ("CNTL - already in this BSSID. ignore this SET_BSSID request\n"));
                pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
+
             {
                 union iwreq_data    wrqu;
 
@@ -538,7 +529,6 @@ VOID CntlOidRTBssidProc(
                 wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
 
             }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
        }
        else
        {
@@ -1443,15 +1433,11 @@ VOID LinkUp(
 
 
                // If WEP is enabled, add paiewise and shared key
-#ifdef WPA_SUPPLICANT_SUPPORT
         if (((pAd->StaCfg.WpaSupplicantUP)&&
              (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)&&
              (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)) ||
             ((pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)&&
               (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)))
-#else
-               if (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)
-#endif // WPA_SUPPLICANT_SUPPORT //
                {
                        PUCHAR  Key;
                        UCHAR   CipherAlg;
@@ -1718,16 +1704,6 @@ VOID LinkUp(
 
        RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
        RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW);
-
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
-       if ((pAd->CommonCfg.BACapability.field.b2040CoexistScanSup) && (pAd->CommonCfg.Channel <= 11))
-       {
-               OPSTATUS_SET_FLAG(pAd, fOP_STATUS_SCAN_2040);
-               BuildEffectedChannelList(pAd);
-       }
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
 }
 
 /*
@@ -1913,7 +1889,7 @@ VOID LinkDown(
        }
 
        // 802.1x port control
-#ifdef WPA_SUPPLICANT_SUPPORT
+
        // Prevent clear PortSecured here with static WEP
        // NetworkManger set security policy first then set SSID to connect AP.
        if (pAd->StaCfg.WpaSupplicantUP &&
@@ -1923,7 +1899,6 @@ VOID LinkDown(
                pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
        }
        else
-#endif // WPA_SUPPLICANT_SUPPORT //
        {
                pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
                pAd->StaCfg.PrivacyFilter = Ndis802_11PrivFilter8021xWEP;
@@ -2005,43 +1980,17 @@ VOID LinkDown(
        pAd->CommonCfg.IOTestParm.bCurrentAtheros = FALSE;
        pAd->CommonCfg.IOTestParm.bNowAtherosBurstOn = FALSE;
 
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
-       OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SCAN_2040);
-       pAd->CommonCfg.BSSCoexist2040.word = 0;
-       TriEventInit(pAd);
-       for (i = 0; i < (pAd->ChannelListNum - 1); i++)
-       {
-               pAd->ChannelList[i].bEffectedChannel = FALSE;
-       }
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
        RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x1fff);
        RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
 
        // Allow go to sleep after linkdown steps.
        RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
 
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
-       if (pAd->StaCfg.WpaSupplicantUP) {
-               union iwreq_data    wrqu;
-               //send disassociate event to wpa_supplicant
-               memset(&wrqu, 0, sizeof(wrqu));
-               wrqu.data.flags = RT_DISASSOC_EVENT_FLAG;
-               wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, NULL);
-       }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
        {
                union iwreq_data    wrqu;
                memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
                wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
        }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
 }
 
 /*
@@ -2418,16 +2367,10 @@ ULONG MakeIbssBeacon(
                ULONG TmpLen;
                UCHAR HtLen, HtLen1;
 
-#ifdef RT_BIG_ENDIAN
-               HT_CAPABILITY_IE HtCapabilityTmp;
-               ADD_HT_INFO_IE  addHTInfoTmp;
-               USHORT  b2lTmp, b2lTmp2;
-#endif
-
                // add HT Capability IE
                HtLen = sizeof(pAd->CommonCfg.HtCapability);
                HtLen1 = sizeof(pAd->CommonCfg.AddHTInfo);
-#ifndef RT_BIG_ENDIAN
+
                MakeOutgoingFrame(pBeaconFrame+FrameLen,        &TmpLen,
                                                  1,                                            &HtCapIe,
                                                  1,                                            &HtLen,
@@ -2436,24 +2379,7 @@ ULONG MakeIbssBeacon(
                                                  1,                                            &HtLen1,
                                                  HtLen1,                                       &pAd->CommonCfg.AddHTInfo,
                                                  END_OF_ARGS);
-#else
-               NdisMoveMemory(&HtCapabilityTmp, &pAd->CommonCfg.HtCapability, HtLen);
-               *(USHORT *)(&HtCapabilityTmp.HtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.HtCapInfo));
-               *(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo));
-
-               NdisMoveMemory(&addHTInfoTmp, &pAd->CommonCfg.AddHTInfo, HtLen1);
-               *(USHORT *)(&addHTInfoTmp.AddHtInfo2) = SWAP16(*(USHORT *)(&addHTInfoTmp.AddHtInfo2));
-               *(USHORT *)(&addHTInfoTmp.AddHtInfo3) = SWAP16(*(USHORT *)(&addHTInfoTmp.AddHtInfo3));
 
-               MakeOutgoingFrame(pBeaconFrame+FrameLen,        &TmpLen,
-                                                 1,                                            &HtCapIe,
-                                                 1,                                            &HtLen,
-                                                 HtLen,                                        &HtCapabilityTmp,
-                                                 1,                                            &AddHtInfoIe,
-                                                 1,                                            &HtLen1,
-                                                 HtLen1,                                       &addHTInfoTmp,
-                                                 END_OF_ARGS);
-#endif
                FrameLen += TmpLen;
        }
 #endif // DOT11_N_SUPPORT //
@@ -2473,11 +2399,6 @@ ULONG MakeIbssBeacon(
                PID_MGMT, PID_BEACON, RATE_1, IFS_HTTXOP, FALSE, &Transmit);
     }
 
-#ifdef RT_BIG_ENDIAN
-       RTMPFrameEndianChange(pAd, pBeaconFrame, DIR_WRITE, FALSE);
-       RTMPWIEndianChange((PUCHAR)pTxWI, TYPE_TXWI);
-#endif
-
     DBGPRINT(RT_DEBUG_TRACE, ("MakeIbssBeacon (len=%ld), SupRateLen=%d, ExtRateLen=%d, Channel=%d, PhyMode=%d\n",
                                        FrameLen, SupRateLen, ExtRateLen, pAd->CommonCfg.Channel, pAd->CommonCfg.PhyMode));
        return FrameLen;