OSDN Git Service

Remove more duplicated ieee80211 definitions
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 4 Dec 2013 12:33:08 +0000 (13:33 +0100)
committerLarry Finger <Larry.Finger@lwfinger.net>
Wed, 4 Dec 2013 13:57:34 +0000 (07:57 -0600)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
14 files changed:
core/rtw_ap.c
core/rtw_ieee80211.c
core/rtw_ioctl_set.c
core/rtw_mlme.c
core/rtw_mlme_ext.c
core/rtw_tdls.c
core/rtw_wlan_util.c
hal/usb_halinit.c
include/ieee80211.h
include/ieee80211_ext.h [deleted file]
include/rtw_ht.h
include/wifi.h
os_dep/ioctl_cfg80211.c
os_dep/ioctl_linux.c

index 793bf50..b6113d9 100644 (file)
@@ -568,7 +568,7 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
                        limit=8;/*   1R */
 
                for (i=0; i<limit; i++) {
-                       if (psta_ht->ht_cap.supp_mcs_set[i/8] & BIT(i%8))
+                       if (psta_ht->ht_cap.mcs.rx_mask[i/8] & BIT(i%8))
                                tx_ra_bitmap |= BIT(i+12);
                }
 
@@ -770,7 +770,7 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
                        phtpriv_sta->sgi = _TRUE;
 
                /*  bwmode */
-               if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) {
+               if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40)) {
                        /* phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_40; */
                        phtpriv_sta->bwmode = pmlmeext->cur_bwmode;
                        phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset;
@@ -1413,7 +1413,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf,  int len)
        {
                u8 rf_type;
 
-               struct rtw_ieee80211_ht_cap *pht_cap = (struct rtw_ieee80211_ht_cap *)(p+2);
+               struct ieee80211_ht_cap *pht_cap = (struct ieee80211_ht_cap *)(p+2);
 
                pHT_caps_ie=p;
 
@@ -1425,19 +1425,19 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf,  int len)
                if((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
                        (psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP))
                {
-                       pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2));
+                       pht_cap->ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_DENSITY&(0x07<<2));
                }
                else
                {
-                       pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
+                       pht_cap->ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_DENSITY&0x00);
                }
 
-               pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 0x03); /* set  Max Rx AMPDU size  to 64K */
+               pht_cap->ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_FACTOR & 0x03); /* set  Max Rx AMPDU size  to 64K */
 
                if(rf_type == RF_1T1R)
                {
-                       pht_cap->supp_mcs_set[0] = 0xff;
-                       pht_cap->supp_mcs_set[1] = 0x0;
+                       pht_cap->mcs.rx_mask[0] = 0xff;
+                       pht_cap->mcs.rx_mask[1] = 0x0;
                }
 
                memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len);
@@ -1938,7 +1938,7 @@ static int rtw_ht_operation_update(_adapter *padapter)
        if (pmlmepriv->num_sta_no_ht ||
            (pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT))
                new_op_mode = OP_MODE_MIXED;
-       else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH)
+       else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
                 && pmlmepriv->num_sta_ht_20mhz)
                new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED;
        else if (pmlmepriv->olbc_ht)
@@ -2156,7 +2156,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
                                   pmlmepriv->num_sta_ht_no_gf);
                }
 
-               if ((ht_capab & IEEE80211_HT_CAP_SUP_WIDTH) == 0) {
+               if ((ht_capab & IEEE80211_HT_CAP_SUP_WIDTH_20_40) == 0) {
                        if (!psta->ht_20mhz_set) {
                                psta->ht_20mhz_set = 1;
                                pmlmepriv->num_sta_ht_20mhz++;
index 9b4759d..1690df6 100644 (file)
@@ -1799,7 +1799,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
        /* u8 wpa_ie[255],rsn_ie[255]; */
        u16 wpa_len=0,rsn_len=0;
        struct HT_info_element *pht_info = NULL;
-       struct rtw_ieee80211_ht_cap *pht_cap = NULL;
+       struct ieee80211_ht_cap *pht_cap = NULL;
        unsigned int            len;
        unsigned char           *p;
 
@@ -1835,7 +1835,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
        /* parsing HT_CAP_IE */
        p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
        if(p && len>0) {
-                       pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
+                       pht_cap = (struct ieee80211_ht_cap *)(p + 2);
                        pnetwork->BcnInfo.ht_cap_info = pht_cap->cap_info;
        } else {
                        pnetwork->BcnInfo.ht_cap_info = 0;
index 78ee763..d8291ac 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <usb_osintf.h>
 #include <usb_ops.h>
+#include <linux/ieee80211.h>
 
 extern void indicate_wx_scan_complete_event(_adapter *padapter);
 
@@ -1163,7 +1164,7 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
        struct mlme_priv        *pmlmepriv = &adapter->mlmepriv;
        WLAN_BSSID_EX  *pcur_bss = &pmlmepriv->cur_network.network;
 #ifdef CONFIG_80211N_HT
-       struct rtw_ieee80211_ht_cap *pht_capie;
+       struct ieee80211_ht_cap *pht_capie;
        u8      rf_type = 0;
        u8      bw_40MHz=0, short_GI_20=0, short_GI_40=0;
        u16     mcs_rate=0;
@@ -1179,11 +1180,11 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
                p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12);
                if(p && ht_ielen>0)
                {
-                       pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
+                       pht_capie = (struct ieee80211_ht_cap *)(p+2);
 
-                       memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2);
+                       memcpy(&mcs_rate , &pht_capie->mcs, 2);
 
-                       /* bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) ? 1:0; */
+                       /* bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; */
                        /* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */
                        bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1:0;
 
index a9243aa..38f5595 100644 (file)
@@ -3080,9 +3080,9 @@ void rtw_joinbss_reset(_adapter *padapter)
 unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len)
 {
        u32 ielen, out_len;
-       HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor;
+       int max_rx_ampdu_factor;
        unsigned char *p, *pframe;
-       struct rtw_ieee80211_ht_cap ht_capie;
+       struct ieee80211_ht_cap ht_capie;
        unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
        struct mlme_priv        *pmlmepriv = &padapter->mlmepriv;
        struct qos_priv         *pqospriv= &pmlmepriv->qospriv;
@@ -3105,11 +3105,11 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
 
                out_len = *pout_len;
 
-               memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap));
+               memset(&ht_capie, 0, sizeof(struct ieee80211_ht_cap));
 
-               ht_capie.cap_info = IEEE80211_HT_CAP_SUP_WIDTH |IEEE80211_HT_CAP_SGI_20 |
-                                                       IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_TX_STBC |
-                                                       IEEE80211_HT_CAP_DSSSCCK40;
+               ht_capie.cap_info = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
+                       IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 |
+                       IEEE80211_HT_CAP_TX_STBC | IEEE80211_HT_CAP_DSSSCCK40;
 
                {
                        u32 rx_packet_offset, max_recvbuf_sz;
@@ -3124,12 +3124,12 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
                ht_capie.ampdu_params_info = (max_rx_ampdu_factor&0x03);
 
                if(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_ )
-                       ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2));
+                       ht_capie.ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_DENSITY&(0x07<<2));
                else
-                       ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
+                       ht_capie.ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_DENSITY&0x00);
 
                pframe = rtw_set_ie(out_ie+out_len, _HT_CAPABILITY_IE_,
-                                                       sizeof(struct rtw_ieee80211_ht_cap), (unsigned char*)&ht_capie, pout_len);
+                                                       sizeof(struct ieee80211_ht_cap), (unsigned char*)&ht_capie, pout_len);
 
                phtpriv->ht_option = _TRUE;
 
@@ -3151,7 +3151,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len)
        u8 *p, max_ampdu_sz;
        int len;
        /* struct sta_info *bmc_sta, *psta; */
-       struct rtw_ieee80211_ht_cap *pht_capie;
+       struct ieee80211_ht_cap *pht_capie;
        struct ieee80211_ht_addt_info *pht_addtinfo;
        /* struct recv_reorder_ctrl *preorder_ctrl; */
        struct mlme_priv        *pmlmepriv = &padapter->mlmepriv;
@@ -3192,8 +3192,8 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len)
        p = rtw_get_ie(pie+sizeof (NDIS_802_11_FIXED_IEs), _HT_CAPABILITY_IE_, &len, ie_len-sizeof (NDIS_802_11_FIXED_IEs));
        if(p && len>0)
        {
-               pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
-               max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR);
+               pht_capie = (struct ieee80211_ht_cap *)(p+2);
+               max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_AMPDU_PARM_FACTOR);
                max_ampdu_sz = 1 << (max_ampdu_sz+3); /*  max_ampdu_sz (kbytes); */
 
                /* DBG_8723A("rtw_update_ht_cap(): max_ampdu_sz=%d\n", max_ampdu_sz); */
index f73d046..cbe5916 100644 (file)
@@ -1778,14 +1778,14 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame)
 
 #ifdef CONFIG_80211N_HT
        /* save HT capabilities in the sta object */
-       memset(&pstat->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap));
-       if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap))
+       memset(&pstat->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap));
+       if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct ieee80211_ht_cap))
        {
                pstat->flags |= WLAN_STA_HT;
 
                pstat->flags |= WLAN_STA_WME;
 
-               memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct rtw_ieee80211_ht_cap));
+               memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct ieee80211_ht_cap));
 
        } else
                pstat->flags &= ~WLAN_STA_HT;
@@ -7178,7 +7178,7 @@ void issue_assocreq(_adapter *padapter)
                        if (BT_1Ant(padapter) == _TRUE)
                        {
                                /*  set to 8K */
-                               pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para &= (u8)~IEEE80211_HT_CAP_AMPDU_FACTOR;
+                               pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para &= (u8)~IEEE80211_HT_AMPDU_PARM_FACTOR;
 /*                             pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para |= MAX_AMPDU_FACTOR_8K */
                        }
 #endif
@@ -7875,7 +7875,7 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act
        u16     reason_code;
        u16     BA_timeout_value;
        u16     BA_starting_seqctrl;
-       HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor;
+       int     max_rx_ampdu_factor;
        struct xmit_frame               *pmgntframe;
        struct pkt_attrib               *pattrib;
        u8                                      *pframe;
@@ -7950,7 +7950,7 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act
                                        /*  TID */
                                        BA_para_set |= (status << 2) & IEEE80211_ADDBA_PARAM_TID_MASK;
                                        /*  max buffer size is 8 MSDU */
-                                       BA_para_set |= (8 << 6) & RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK;
+                                       BA_para_set |= (8 << 6) & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK;
                                }
                                else
 #endif
@@ -7984,13 +7984,13 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act
                                pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->ADDBA_req.dialog_token), &(pattrib->pktlen));
                                pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&status), &(pattrib->pktlen));
                                rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor);
-                               if(MAX_AMPDU_FACTOR_64K == max_rx_ampdu_factor)
+                               if (max_rx_ampdu_factor == IEEE80211_HT_MAX_AMPDU_64K)
                                        BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */
-                               else if(MAX_AMPDU_FACTOR_32K == max_rx_ampdu_factor)
+                               else if (max_rx_ampdu_factor == IEEE80211_HT_MAX_AMPDU_32K)
                                        BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0800); /* 32 buffer size */
-                               else if(MAX_AMPDU_FACTOR_16K == max_rx_ampdu_factor)
+                               else if (max_rx_ampdu_factor == IEEE80211_HT_MAX_AMPDU_16K)
                                        BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0400); /* 16 buffer size */
-                               else if(MAX_AMPDU_FACTOR_8K == max_rx_ampdu_factor)
+                               else if (max_rx_ampdu_factor == IEEE80211_HT_MAX_AMPDU_8K)
                                        BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0200); /* 8 buffer size */
                                else
                                        BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */
@@ -8001,8 +8001,8 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act
                                                memcmp(raddr, tendaAPMac, 3)))
                                {
                                        /*  max buffer size is 8 MSDU */
-                                       BA_para_set &= ~RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK;
-                                       BA_para_set |= (8 << 6) & RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK;
+                                       BA_para_set &= ~IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK;
+                                       BA_para_set |= (8 << 6) & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK;
                                }
 #endif
 
index 0b7eddf..a603380 100644 (file)
@@ -328,7 +328,8 @@ void rtw_tdls_process_ht_cap(_adapter *adapter, struct sta_info *ptdls_sta, u8 *
                }
 
                /*  bwmode would still followed AP's setting */
-               if(ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
+               if(ptdls_sta->htpriv.ht_cap.cap_info &
+                  cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40))
                {
                        ptdls_sta->htpriv.bwmode = adapter->mlmeextpriv.cur_bwmode;
                        ptdls_sta->htpriv.ch_offset = adapter->mlmeextpriv.cur_ch_offset;
@@ -344,8 +345,10 @@ u8 *rtw_tdls_set_ht_cap(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattr
        /* HT capabilities */
        memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap));
 
-       ht_capie.cap_info = IEEE80211_HT_CAP_SUP_WIDTH |IEEE80211_HT_CAP_SGI_20 |IEEE80211_HT_CAP_SM_PS |
-                                               IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_TX_STBC |IEEE80211_HT_CAP_DSSSCCK40;
+       ht_capie.cap_info = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
+               IEEE80211_HT_CAP_SGI_20 |IEEE80211_HT_CAP_SM_PS |
+               IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_TX_STBC |
+               IEEE80211_HT_CAP_DSSSCCK40;
 
        {
                u32 rx_packet_offset, max_recvbuf_sz;
index 6f30360..7e59e13 100644 (file)
@@ -1293,7 +1293,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
        u32 hidden_ssid = 0;
        u8 cur_network_type, network_type=0;
        struct HT_info_element *pht_info = NULL;
-       struct rtw_ieee80211_ht_cap *pht_cap = NULL;
+       struct ieee80211_ht_cap *pht_cap = NULL;
        u32 bcn_channel;
        unsigned short  ht_cap_info;
        unsigned char   ht_info_infos_0;
@@ -1331,7 +1331,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
        /* parsing HT_CAP_IE */
        p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
        if(p && len>0) {
-                       pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
+                       pht_cap = (struct ieee80211_ht_cap *)(p + 2);
                        ht_cap_info = pht_cap->cap_info;
        } else {
                        ht_cap_info = 0;
index 8b03aef..29911d6 100644 (file)
@@ -29,6 +29,7 @@
 #include <Hal8723PwrSeq.h>
 #include <rtl8723a_hal.h>
 #include <rtl8723a_led.h>
+#include <linux/ieee80211.h>
 
 #ifdef CONFIG_IOL
 #include <rtw_iol.h>
@@ -3555,7 +3556,7 @@ GetHalDefVar8192CUsb(
                        *(( u32*)pValue) =pHalData->odmpriv.SupportAbility;
                        break;
                case HW_VAR_MAX_RX_AMPDU_FACTOR:
-                       *(( u32*)pValue) = MAX_AMPDU_FACTOR_64K;
+                       *(( u32*)pValue) = IEEE80211_HT_MAX_AMPDU_64K;
                        break;
                case HW_DEF_ODM_DBG_FLAG:
                        {
index 93a0ec2..8e3efde 100644 (file)
@@ -26,6 +26,7 @@
 #include <drv_conf.h>
 #include <osdep_service.h>
 #include <drv_types.h>
+#include "linux/ieee80211.h"
 #include "wifi.h"
 
 #include <linux/wireless.h>
@@ -238,7 +239,7 @@ typedef struct ieee_param {
                        u16 capability;
                        int flags;
                        u8 tx_supp_rates[16];
-                       struct rtw_ieee80211_ht_cap ht_cap;
+                       struct ieee80211_ht_cap ht_cap;
                } add_sta;
                struct {
                        u8      reserved[2];//for set max_num_sta
@@ -263,7 +264,7 @@ struct sta_data{
        u32 sta_set;
        u8 tx_supp_rates[16];
        u32 tx_supp_rates_len;
-       struct rtw_ieee80211_ht_cap ht_cap;
+       struct ieee80211_ht_cap ht_cap;
        u64     rx_pkts;
        u64     rx_bytes;
        u64     rx_drops;
diff --git a/include/ieee80211_ext.h b/include/ieee80211_ext.h
deleted file mode 100644 (file)
index a524391..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-/******************************************************************************
- *
- * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- *
- ******************************************************************************/
-#ifndef __IEEE80211_EXT_H
-#define __IEEE80211_EXT_H
-
-#include <drv_conf.h>
-#include <osdep_service.h>
-#include <drv_types.h>
-
-#define WMM_OUI_TYPE 2
-#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
-#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
-#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
-#define WMM_VERSION 1
-
-#define WPA_PROTO_WPA BIT(0)
-#define WPA_PROTO_RSN BIT(1)
-
-#define WPA_KEY_MGMT_IEEE8021X BIT(0)
-#define WPA_KEY_MGMT_PSK BIT(1)
-#define WPA_KEY_MGMT_NONE BIT(2)
-#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
-#define WPA_KEY_MGMT_WPA_NONE BIT(4)
-
-
-#define WPA_CAPABILITY_PREAUTH BIT(0)
-#define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6)
-#define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9)
-
-
-#define PMKID_LEN 16
-
-
-struct wpa_ie_hdr {
-       u8 elem_id;
-       u8 len;
-       u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
-       u8 version[2]; /* little endian */
-}__attribute__ ((packed));
-
-struct rsn_ie_hdr {
-       u8 elem_id; /* WLAN_EID_RSN */
-       u8 len;
-       u8 version[2]; /* little endian */
-}__attribute__ ((packed));
-
-struct wme_ac_parameter {
-#if defined(__LITTLE_ENDIAN)
-       /* byte 1 */
-       u8      aifsn:4,
-               acm:1,
-               aci:2,
-               reserved:1;
-
-       /* byte 2 */
-       u8      eCWmin:4,
-               eCWmax:4;
-#elif defined(__BIG_ENDIAN)
-       /* byte 1 */
-       u8      reserved:1,
-               aci:2,
-               acm:1,
-               aifsn:4;
-
-       /* byte 2 */
-       u8      eCWmax:4,
-               eCWmin:4;
-#else
-#error "Please fix <endian.h>"
-#endif
-
-       /* bytes 3 & 4 */
-       u16 txopLimit;
-} __attribute__ ((packed));
-
-struct wme_parameter_element {
-       /* required fields for WME version 1 */
-       u8 oui[3];
-       u8 oui_type;
-       u8 oui_subtype;
-       u8 version;
-       u8 acInfo;
-       u8 reserved;
-       struct wme_ac_parameter ac[4];
-
-} __attribute__ ((packed));
-
-
-#define WPA_PUT_LE16(a, val)                   \
-       do {                                    \
-               (a)[1] = ((u16) (val)) >> 8;    \
-               (a)[0] = ((u16) (val)) & 0xff;  \
-       } while (0)
-
-#define WPA_PUT_BE32(a, val)                                   \
-       do {                                                    \
-               (a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff);   \
-               (a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff);   \
-               (a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff);    \
-               (a)[3] = (u8) (((u32) (val)) & 0xff);           \
-       } while (0)
-
-#define WPA_PUT_LE32(a, val)                                   \
-       do {                                                    \
-               (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff);   \
-               (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff);   \
-               (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff);    \
-               (a)[0] = (u8) (((u32) (val)) & 0xff);           \
-       } while (0)
-
-#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val))
-//#define RSN_SELECTOR_PUT(a, val) WPA_PUT_LE32((u8 *) (a), (val))
-
-
-
-/* Action category code */
-enum ieee80211_category {
-       WLAN_CATEGORY_SPECTRUM_MGMT = 0,
-       WLAN_CATEGORY_QOS = 1,
-       WLAN_CATEGORY_DLS = 2,
-       WLAN_CATEGORY_BACK = 3,
-       WLAN_CATEGORY_HT = 7,
-       WLAN_CATEGORY_WMM = 17,
-};
-
-/* SPECTRUM_MGMT action code */
-enum ieee80211_spectrum_mgmt_actioncode {
-       WLAN_ACTION_SPCT_MSR_REQ = 0,
-       WLAN_ACTION_SPCT_MSR_RPRT = 1,
-       WLAN_ACTION_SPCT_TPC_REQ = 2,
-       WLAN_ACTION_SPCT_TPC_RPRT = 3,
-       WLAN_ACTION_SPCT_CHL_SWITCH = 4,
-       WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5,
-};
-
-/* BACK action code */
-enum ieee80211_back_actioncode {
-       WLAN_ACTION_ADDBA_REQ = 0,
-       WLAN_ACTION_ADDBA_RESP = 1,
-       WLAN_ACTION_DELBA = 2,
-};
-
-/* HT features action code */
-enum ieee80211_ht_actioncode {
-       WLAN_ACTION_NOTIFY_CH_WIDTH = 0,
-       WLAN_ACTION_SM_PS = 1,
-       WLAN_ACTION_PSPM = 2,
-       WLAN_ACTION_PCO_PHASE = 3,
-       WLAN_ACTION_MIMO_CSI_MX = 4,
-       WLAN_ACTION_MIMO_NONCP_BF = 5,
-       WLAN_ACTION_MIMP_CP_BF = 6,
-       WLAN_ACTION_ASEL_INDICATES_FB = 7,
-       WLAN_ACTION_HI_INFO_EXCHG = 8,
-};
-
-/* BACK (block-ack) parties */
-enum ieee80211_back_parties {
-       WLAN_BACK_RECIPIENT = 0,
-       WLAN_BACK_INITIATOR = 1,
-       WLAN_BACK_TIMER = 2,
-};
-
-
-struct ieee80211_mgmt {
-       u16 frame_control;
-       u16 duration;
-       u8 da[6];
-       u8 sa[6];
-       u8 bssid[6];
-       u16 seq_ctrl;
-       union {
-               struct {
-                       u16 auth_alg;
-                       u16 auth_transaction;
-                       u16 status_code;
-                       /* possibly followed by Challenge text */
-                       u8 variable[0];
-               }  __attribute__ ((packed)) auth;
-               struct {
-                       u16 reason_code;
-               }  __attribute__ ((packed)) deauth;
-               struct {
-                       u16 capab_info;
-                       u16 listen_interval;
-                       /* followed by SSID and Supported rates */
-                       u8 variable[0];
-               }  __attribute__ ((packed)) assoc_req;
-               struct {
-                       u16 capab_info;
-                       u16 status_code;
-                       u16 aid;
-                       /* followed by Supported rates */
-                       u8 variable[0];
-               }  __attribute__ ((packed)) assoc_resp, reassoc_resp;
-               struct {
-                       u16 capab_info;
-                       u16 listen_interval;
-                       u8 current_ap[6];
-                       /* followed by SSID and Supported rates */
-                       u8 variable[0];
-               }  __attribute__ ((packed)) reassoc_req;
-               struct {
-                       u16 reason_code;
-               }  __attribute__ ((packed)) disassoc;
-               struct {
-                       __le64 timestamp;
-                       u16 beacon_int;
-                       u16 capab_info;
-                       /* followed by some of SSID, Supported rates,
-                        * FH Params, DS Params, CF Params, IBSS Params, TIM */
-                       u8 variable[0];
-               }  __attribute__ ((packed)) beacon;
-               struct {
-                       /* only variable items: SSID, Supported rates */
-                       u8 variable[0];
-               }  __attribute__ ((packed)) probe_req;
-               struct {
-                       __le64 timestamp;
-                       u16 beacon_int;
-                       u16 capab_info;
-                       /* followed by some of SSID, Supported rates,
-                        * FH Params, DS Params, CF Params, IBSS Params */
-                       u8 variable[0];
-               }  __attribute__ ((packed)) probe_resp;
-               struct {
-                       u8 category;
-                       union {
-                               struct {
-                                       u8 action_code;
-                                       u8 dialog_token;
-                                       u8 status_code;
-                                       u8 variable[0];
-                               }  __attribute__ ((packed)) wme_action;
-#if 0
-                               struct{
-                                       u8 action_code;
-                                       u8 element_id;
-                                       u8 length;
-                                       struct ieee80211_channel_sw_ie sw_elem;
-                               }  __attribute__ ((packed)) chan_switch;
-                               struct{
-                                       u8 action_code;
-                                       u8 dialog_token;
-                                       u8 element_id;
-                                       u8 length;
-                                       struct ieee80211_msrment_ie msr_elem;
-                               }  __attribute__ ((packed)) measurement;
-#endif
-                               struct{
-                                       u8 action_code;
-                                       u8 dialog_token;
-                                       u16 capab;
-                                       u16 timeout;
-                                       u16 start_seq_num;
-                               }  __attribute__ ((packed)) addba_req;
-                               struct{
-                                       u8 action_code;
-                                       u8 dialog_token;
-                                       u16 status;
-                                       u16 capab;
-                                       u16 timeout;
-                               }  __attribute__ ((packed)) addba_resp;
-                               struct{
-                                       u8 action_code;
-                                       u16 params;
-                                       u16 reason_code;
-                               }  __attribute__ ((packed)) delba;
-                               struct{
-                                       u8 action_code;
-                                       /* capab_info for open and confirm,
-                                        * reason for close
-                                        */
-                                       u16 aux;
-                                       /* Followed in plink_confirm by status
-                                        * code, AID and supported rates,
-                                        * and directly by supported rates in
-                                        * plink_open and plink_close
-                                        */
-                                       u8 variable[0];
-                               }  __attribute__ ((packed)) plink_action;
-                               struct{
-                                       u8 action_code;
-                                       u8 variable[0];
-                               }  __attribute__ ((packed)) mesh_action;
-                       } __attribute__ ((packed)) u;
-               }  __attribute__ ((packed)) action;
-       } __attribute__ ((packed)) u;
-}__attribute__ ((packed));
-
-/* mgmt header + 1 byte category code */
-#define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u)
-
-
-
-#endif
index 74e416d..dfe5dd4 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <drv_conf.h>
 #include <osdep_service.h>
+#include "linux/ieee80211.h"
 #include "wifi.h"
 
 struct ht_priv
@@ -42,8 +43,7 @@ struct ht_priv
        //u8    ADDBA_retry_count;
        u8      candidate_tid_bitmap;
 
-       struct rtw_ieee80211_ht_cap ht_cap;
-
+       struct ieee80211_ht_cap ht_cap;
 };
 
 #endif //_RTL871X_HT_H_
index f6c43f6..9de6f36 100644 (file)
@@ -567,22 +567,6 @@ __inline static int IsFrameTypeCtrl(unsigned char *pframe)
 #define GetOrderBit(pbuf)      (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)
 
 
- /**
- * struct rtw_ieee80211_ht_cap - HT capabilities
- *
- * This structure refers to "HT capabilities element" as
- * described in 802.11n draft section 7.3.2.52
- */
-
-struct rtw_ieee80211_ht_cap {
-       unsigned short  cap_info;
-       unsigned char   ampdu_params_info;
-       unsigned char   supp_mcs_set[16];
-       unsigned short  extended_ht_cap_info;
-       unsigned int            tx_BF_cap_info;
-       unsigned char          antenna_selection_info;
-} __attribute__ ((packed));
-
 /**
  * struct rtw_ieee80211_ht_cap - HT additional information
  *
@@ -645,68 +629,6 @@ struct ADDBA_request
 }  __attribute__ ((packed));
 
 
-typedef enum _HT_CAP_AMPDU_FACTOR {
-       MAX_AMPDU_FACTOR_8K             = 0,
-       MAX_AMPDU_FACTOR_16K    = 1,
-       MAX_AMPDU_FACTOR_32K    = 2,
-       MAX_AMPDU_FACTOR_64K    = 3,
-}HT_CAP_AMPDU_FACTOR;
-
-/* 802.11n HT capabilities masks */
-#define IEEE80211_HT_CAP_SUP_WIDTH             0x0002
-#define IEEE80211_HT_CAP_SM_PS                 0x000C
-#define IEEE80211_HT_CAP_GRN_FLD               0x0010
-#define IEEE80211_HT_CAP_SGI_20                        0x0020
-#define IEEE80211_HT_CAP_SGI_40                        0x0040
-#define IEEE80211_HT_CAP_TX_STBC                       0x0080
-#define IEEE80211_HT_CAP_RX_STBC               0x0300
-#define IEEE80211_HT_CAP_DELAY_BA              0x0400
-#define IEEE80211_HT_CAP_MAX_AMSDU             0x0800
-#define IEEE80211_HT_CAP_DSSSCCK40             0x1000
-/* 802.11n HT capability AMPDU settings */
-#define IEEE80211_HT_CAP_AMPDU_FACTOR          0x03
-#define IEEE80211_HT_CAP_AMPDU_DENSITY         0x1C
-/* 802.11n HT capability MSC set */
-#define IEEE80211_SUPP_MCS_SET_UEQM            4
-#define IEEE80211_HT_CAP_MAX_STREAMS           4
-#define IEEE80211_SUPP_MCS_SET_LEN             10
-/* maximum streams the spec allows */
-#define IEEE80211_HT_CAP_MCS_TX_DEFINED                0x01
-#define IEEE80211_HT_CAP_MCS_TX_RX_DIFF                0x02
-#define IEEE80211_HT_CAP_MCS_TX_STREAMS                0x0C
-#define IEEE80211_HT_CAP_MCS_TX_UEQM           0x10
-/* 802.11n HT IE masks */
-#define IEEE80211_HT_IE_CHA_SEC_OFFSET         0x03
-#define IEEE80211_HT_IE_CHA_SEC_NONE           0x00
-#define IEEE80211_HT_IE_CHA_SEC_ABOVE          0x01
-#define IEEE80211_HT_IE_CHA_SEC_BELOW          0x03
-#define IEEE80211_HT_IE_CHA_WIDTH              0x04
-#define IEEE80211_HT_IE_HT_PROTECTION          0x0003
-#define IEEE80211_HT_IE_NON_GF_STA_PRSNT       0x0004
-#define IEEE80211_HT_IE_NON_HT_STA_PRSNT       0x0010
-
-/* block-ack parameters */
-#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002
-#define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C
-#define RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0
-#define IEEE80211_DELBA_PARAM_TID_MASK 0xF000
-#define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800
-
-/*
- * A-PMDU buffer sizes
- * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
- */
-#define IEEE80211_MIN_AMPDU_BUF 0x8
-#define IEEE80211_MAX_AMPDU_BUF 0x40
-
-
-/* Spatial Multiplexing Power Save Modes */
-#define WLAN_HT_CAP_SM_PS_STATIC               0
-#define WLAN_HT_CAP_SM_PS_DYNAMIC      1
-#define WLAN_HT_CAP_SM_PS_INVALID      2
-#define WLAN_HT_CAP_SM_PS_DISABLED     3
-
-
 #define OP_MODE_PURE                    0
 #define OP_MODE_MAY_BE_LEGACY_STAS      1
 #define OP_MODE_20MHZ_HT_STA_ASSOCED    2
index 6ab8cac..148b1e7 100644 (file)
@@ -5167,8 +5167,8 @@ static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap, enum
        ht_cap->ht_supported = _TRUE;
 
        ht_cap->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
-                                       IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20 |
-                                       IEEE80211_HT_CAP_DSSSCCK40 | IEEE80211_HT_CAP_MAX_AMSDU;
+               IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20 |
+               IEEE80211_HT_CAP_DSSSCCK40 | IEEE80211_HT_CAP_MAX_AMSDU;
 
        /*
         *Maximum length of AMPDU that the STA can receive.
index 3a8e34c..0ea317f 100644 (file)
@@ -416,11 +416,11 @@ static char *translate_scan(_adapter *padapter,
 
        if(p && ht_ielen>0)
        {
-               struct rtw_ieee80211_ht_cap *pht_capie;
+               struct ieee80211_ht_cap *pht_capie;
                ht_cap = _TRUE;
-               pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
-               memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2);
-               bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) ? 1:0;
+               pht_capie = (struct ieee80211_ht_cap *)(p+2);
+               memcpy(&mcs_rate , &pht_capie->mcs, 2);
+               bw_40MHz = (pht_capie->cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0;
                short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1:0;
        }
 
@@ -7620,7 +7620,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param)
                {
                        psta->htpriv.ht_option = _TRUE;
                        psta->qos_option = 1;
-                       memcpy((void*)&psta->htpriv.ht_cap, (void*)&param->u.add_sta.ht_cap, sizeof(struct rtw_ieee80211_ht_cap));
+                       memcpy((void*)&psta->htpriv.ht_cap, (void*)&param->u.add_sta.ht_cap, sizeof(struct ieee80211_ht_cap));
                }
                else
                {
@@ -7737,7 +7737,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par
                        u32 sta_set;
                        u8 tx_supp_rates[16];
                        u32 tx_supp_rates_len;
-                       struct rtw_ieee80211_ht_cap ht_cap;
+                       struct ieee80211_ht_cap ht_cap;
                        u64     rx_pkts;
                        u64     rx_bytes;
                        u64     rx_drops;
@@ -7769,7 +7769,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par
                psta_data->tx_supp_rates_len =  psta->bssratelen;
                memcpy(psta_data->tx_supp_rates, psta->bssrateset, psta->bssratelen);
 #ifdef CONFIG_80211N_HT
-               memcpy(&psta_data->ht_cap, &psta->htpriv.ht_cap, sizeof(struct rtw_ieee80211_ht_cap));
+               memcpy(&psta_data->ht_cap, &psta->htpriv.ht_cap, sizeof(struct ieee80211_ht_cap));
 #endif //CONFIG_80211N_HT
                psta_data->rx_pkts = psta->sta_stats.rx_data_pkts;
                psta_data->rx_bytes = psta->sta_stats.rx_bytes;