staging: brcm80211: replaced struct ht_cap_ie by struct ieee80211_ht_cap

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>
This commit is contained in:
Roland Vossen 2010-12-24 15:17:49 +01:00 committed by Greg Kroah-Hartman
parent 0b8b430dda
commit 651bd3a9ff
4 changed files with 22 additions and 27 deletions

View 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

View 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);

View 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 */

View 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;