staging: brcm80211: replaced struct ht_cap_ie by struct ieee80211_ht_cap
authorRoland Vossen <rvossen@broadcom.com>
Fri, 24 Dec 2010 14:17:49 +0000 (15:17 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 Jan 2011 23:20:36 +0000 (15:20 -0800)
Code cleanup. Replaced broadcom specific type by Linux counterpart.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/include/proto/802.11.h
drivers/staging/brcm80211/sys/wlc_mac80211.c
drivers/staging/brcm80211/sys/wlc_mac80211.h
drivers/staging/brcm80211/sys/wlc_stf.c

index c5e044a82899148daa1da681827866cc7a565a70..8ca674e1a3d5caab4b96c040d14ddf3d2258310b 100644 (file)
@@ -189,16 +189,6 @@ typedef struct d11cnt {
 
 #define MCSSET_LEN     16
 
-struct ht_cap_ie {
-       u16 cap;
-       u8 params;
-       u8 supp_mcs[MCSSET_LEN];
-       u16 ext_htcap;
-       u32 txbf_cap;
-       u8 as_cap;
-} __attribute__((packed));
-typedef struct ht_cap_ie ht_cap_ie_t;
-
 #define HT_CAP_IE_LEN          26
 
 #define HT_CAP_MIMO_PS_MASK    0x000C
index a5fbfc0f3acad689415aaed9b690da967f5627ed..5eb41d64bc2363dc09cc9a1a7c247624212c9590 100644 (file)
@@ -1180,9 +1180,12 @@ void wlc_protection_upd(struct wlc_info *wlc, uint idx, int val)
 
 static void wlc_ht_update_sgi_rx(struct wlc_info *wlc, int val)
 {
-       wlc->ht_cap.cap &= ~(IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40);
-       wlc->ht_cap.cap |= (val & WLC_N_SGI_20) ? IEEE80211_HT_CAP_SGI_20 : 0;
-       wlc->ht_cap.cap |= (val & WLC_N_SGI_40) ? IEEE80211_HT_CAP_SGI_40 : 0;
+       wlc->ht_cap.cap_info &= ~(IEEE80211_HT_CAP_SGI_20 |
+                                       IEEE80211_HT_CAP_SGI_40);
+       wlc->ht_cap.cap_info |= (val & WLC_N_SGI_20) ?
+                                       IEEE80211_HT_CAP_SGI_20 : 0;
+       wlc->ht_cap.cap_info |= (val & WLC_N_SGI_40) ?
+                                       IEEE80211_HT_CAP_SGI_40 : 0;
 
        if (wlc->pub->up) {
                wlc_update_beacon(wlc);
@@ -1194,9 +1197,9 @@ static void wlc_ht_update_ldpc(struct wlc_info *wlc, s8 val)
 {
        wlc->stf->ldpc = val;
 
-       wlc->ht_cap.cap &= ~IEEE80211_HT_CAP_LDPC_CODING;
+       wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_LDPC_CODING;
        if (wlc->stf->ldpc != OFF)
-               wlc->ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
+               wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_LDPC_CODING;
 
        if (wlc->pub->up) {
                wlc_update_beacon(wlc);
@@ -1747,7 +1750,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
        ASSERT(sizeof(struct ieee80211_hdr) == DOT11_A4_HDR_LEN);
        ASSERT(sizeof(struct ieee80211_rts) == DOT11_RTS_LEN);
        ASSERT(sizeof(tx_status_t) == TXSTATUS_LEN);
-       ASSERT(sizeof(ht_cap_ie_t) == HT_CAP_IE_LEN);
+       ASSERT(sizeof(struct ieee80211_ht_cap) == HT_CAP_IE_LEN);
 #ifdef BRCM_FULLMAC
        ASSERT(offsetof(wl_scan_params_t, channel_list) ==
               WL_SCAN_PARAMS_FIXED_SIZE);
@@ -1951,7 +1954,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
        wlc_wme_initparams_sta(wlc, &wlc->wme_param_ie);
 
        wlc->mimoft = FT_HT;
-       wlc->ht_cap.cap = HT_CAP;
+       wlc->ht_cap.cap_info = HT_CAP;
        if (HT_ENAB(wlc->pub))
                wlc->stf->ldpc = AUTO;
 
@@ -1988,14 +1991,14 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
        if (n_disabled & WLFEATURE_DISABLE_11N_STBC_TX) {
                wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = OFF;
                wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = OFF;
-               wlc->ht_cap.cap &= ~IEEE80211_HT_CAP_TX_STBC;
+               wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
        }
        if (n_disabled & WLFEATURE_DISABLE_11N_STBC_RX)
                wlc_stf_stbc_rx_set(wlc, HT_CAP_RX_STBC_NO);
 
        /* apply the GF override from nvram conf */
        if (n_disabled & WLFEATURE_DISABLE_11N_GF)
-               wlc->ht_cap.cap &= ~IEEE80211_HT_CAP_GRN_FLD;
+               wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_GRN_FLD;
 
        /* initialize radio_mpc_disable according to wlc->mpc */
        wlc_radio_mpc_upd(wlc);
@@ -8282,8 +8285,8 @@ void wlc_reset_bmac_done(struct wlc_info *wlc)
 
 void wlc_ht_mimops_cap_update(struct wlc_info *wlc, u8 mimops_mode)
 {
-       wlc->ht_cap.cap &= ~HT_CAP_MIMO_PS_MASK;
-       wlc->ht_cap.cap |= (mimops_mode << IEEE80211_HT_CAP_SM_PS_SHIFT);
+       wlc->ht_cap.cap_info &= ~HT_CAP_MIMO_PS_MASK;
+       wlc->ht_cap.cap_info |= (mimops_mode << IEEE80211_HT_CAP_SM_PS_SHIFT);
 
        if (AP_ENAB(wlc->pub) && wlc->clk) {
                wlc_update_beacon(wlc);
index 72e52bf561a4291743d8b63fe4706310437d5331..f56b58141c0983dddcbe8de9900b7f7d78f843f4 100644 (file)
@@ -677,7 +677,8 @@ struct wlc_info {
        s8 cck_40txbw;  /* 11N, cck tx b/w override when in 40MHZ mode */
        s8 ofdm_40txbw; /* 11N, ofdm tx b/w override when in 40MHZ mode */
        s8 mimo_40txbw; /* 11N, mimo tx b/w override when in 40MHZ mode */
-       ht_cap_ie_t ht_cap;     /* HT CAP IE being advertised by this node */
+       /* HT CAP IE being advertised by this node: */
+       struct ieee80211_ht_cap ht_cap;
 
        uint seckeys;           /* 54 key table shm address */
        uint tkmickeys;         /* 12 TKIP MIC key table shm address */
index 42c7bd17d882a14e00942acd3080592c42ce52e8..10c9f447cdf0010c7f416308dbd0c486c44c0a0e 100644 (file)
@@ -76,8 +76,8 @@ static void wlc_stf_stbc_rx_ht_update(struct wlc_info *wlc, int val)
                        return;
        }
 
-       wlc->ht_cap.cap &= ~HT_CAP_RX_STBC_MASK;
-       wlc->ht_cap.cap |= (val << HT_CAP_RX_STBC_SHIFT);
+       wlc->ht_cap.cap_info &= ~HT_CAP_RX_STBC_MASK;
+       wlc->ht_cap.cap_info |= (val << HT_CAP_RX_STBC_SHIFT);
 
        if (wlc->pub->up) {
                wlc_update_beacon(wlc);
@@ -153,7 +153,8 @@ wlc_stf_ss_algo_channel_get(struct wlc_info *wlc, u16 *ss_algo_channel,
 
 static s8 wlc_stf_stbc_rx_get(struct wlc_info *wlc)
 {
-       return (wlc->ht_cap.cap & HT_CAP_RX_STBC_MASK) >> HT_CAP_RX_STBC_SHIFT;
+       return (wlc->ht_cap.cap_info & HT_CAP_RX_STBC_MASK)
+               >> HT_CAP_RX_STBC_SHIFT;
 }
 
 static bool wlc_stf_stbc_tx_set(struct wlc_info *wlc, s32 int_val)
@@ -167,9 +168,9 @@ static bool wlc_stf_stbc_tx_set(struct wlc_info *wlc, s32 int_val)
 
        if ((int_val == OFF) || (wlc->stf->txstreams == 1)
            || !WLC_STBC_CAP_PHY(wlc))
-               wlc->ht_cap.cap &= ~IEEE80211_HT_CAP_TX_STBC;
+               wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
        else
-               wlc->ht_cap.cap |= IEEE80211_HT_CAP_TX_STBC;
+               wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_TX_STBC;
 
        wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = (s8) int_val;
        wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = (s8) int_val;