Commit f4728c38 authored by Stanislav Fomichev's avatar Stanislav Fomichev Committed by Greg Kroah-Hartman

brcm80211: replace broadcom specific defines

AMPDU_RX_FACTOR_64K -> IEEE80211_HT_MAX_AMPDU_64K
AMPDU_RX_FACTOR_32K -> IEEE80211_HT_MAX_AMPDU_32K
DOT11_MAX_KEY_SIZE -> WLAN_MAX_KEY_LEN
HT_CAP_MIMO_PS_MASK -> IEEE80211_HT_CAP_SM_PS
HT_CAP_MAX_AMSDU -> IEEE80211_HT_CAP_MAX_AMSDU
HT_CAP_RX_STBC_MASK -> IEEE80211_HT_CAP_RX_STBC
HT_CAP_RX_STBC_SHIFT -> IEEE80211_HT_CAP_RX_STBC_SHIFT
HT_PARAMS_RX_FACTOR_MASK -> IEEE80211_HT_AMPDU_PARM_FACTOR
Signed-off-by: default avatarStanislav Fomichev <kernel@fomichev.me>
Acked-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fd4bd42e
......@@ -1766,7 +1766,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
key.index = key_idx;
swap_key_to_BE(&key);
memset(&params, 0, sizeof(params));
params.key_len = (u8) min_t(u8, DOT11_MAX_KEY_SIZE, key.len);
params.key_len = (u8) min_t(u8, WLAN_MAX_KEY_LEN, key.len);
memcpy(params.key, key.data, params.key_len);
err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec));
......
......@@ -2435,7 +2435,7 @@ wl_iw_get_encode(struct net_device *dev,
wsec = le32_to_cpu(wsec);
auth = le32_to_cpu(auth);
dwrq->length = min_t(u16, DOT11_MAX_KEY_SIZE, key.len);
dwrq->length = min_t(u16, WLAN_MAX_KEY_LEN, key.len);
dwrq->flags = key.index + 1;
if (!(wsec & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED)))
......
......@@ -595,7 +595,7 @@ wl_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
AMPDU_MAX_SCB_TID * PKTQ_LEN_DEFAULT);
sta->ht_cap.ht_supported = true;
sta->ht_cap.ampdu_factor = AMPDU_RX_FACTOR_64K;
sta->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
sta->ht_cap.ampdu_density = AMPDU_DEF_MPDU_DENSITY;
sta->ht_cap.cap = IEEE80211_HT_CAP_GRN_FLD |
IEEE80211_HT_CAP_SGI_20 |
......@@ -989,7 +989,7 @@ static struct ieee80211_supported_band wl_band_2GHz_nphy = {
IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_40MHZ_INTOLERANT,
.ht_supported = true,
.ampdu_factor = AMPDU_RX_FACTOR_64K,
.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K,
.ampdu_density = AMPDU_DEF_MPDU_DENSITY,
.mcs = {
/* placeholders for now */
......@@ -1009,7 +1009,7 @@ static struct ieee80211_supported_band wl_band_5GHz_nphy = {
/* use IEEE80211_HT_CAP_* from include/linux/ieee80211.h */
.cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_40MHZ_INTOLERANT, /* No 40 mhz yet */
.ht_supported = true,
.ampdu_factor = AMPDU_RX_FACTOR_64K,
.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K,
.ampdu_density = AMPDU_DEF_MPDU_DENSITY,
.mcs = {
/* placeholders for now */
......
......@@ -201,9 +201,9 @@ struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc)
ampdu->ffpld_rsvd = AMPDU_DEF_FFPLD_RSVD;
/* bump max ampdu rcv size to 64k for all 11n devices except 4321A0 and 4321A1 */
if (WLCISNPHY(wlc->band) && NREV_LT(wlc->band->phyrev, 2))
ampdu->rx_factor = AMPDU_RX_FACTOR_32K;
ampdu->rx_factor = IEEE80211_HT_MAX_AMPDU_32K;
else
ampdu->rx_factor = AMPDU_RX_FACTOR_64K;
ampdu->rx_factor = IEEE80211_HT_MAX_AMPDU_64K;
ampdu->retry_limit = AMPDU_DEF_RETRY_LIMIT;
ampdu->rr_retry_limit = AMPDU_DEF_RR_RETRY_LIMIT;
......@@ -1340,8 +1340,8 @@ void wlc_ampdu_shm_upd(struct ampdu_info *ampdu)
struct wlc_info *wlc = ampdu->wlc;
/* Extend ucode internal watchdog timer to match larger received frames */
if ((ampdu->rx_factor & HT_PARAMS_RX_FACTOR_MASK) ==
AMPDU_RX_FACTOR_64K) {
if ((ampdu->rx_factor & IEEE80211_HT_AMPDU_PARM_FACTOR) ==
IEEE80211_HT_MAX_AMPDU_64K) {
wlc_write_shm(wlc, M_MIMO_MAXSYM, MIMO_MAXSYM_MAX);
wlc_write_shm(wlc, M_WATCHDOG_8TU, WATCHDOG_8TU_MAX);
} else {
......
......@@ -98,7 +98,7 @@ typedef struct wsec_key {
s8 icv_len; /* ICV length */
u32 len; /* key length..don't move this var */
/* data is 4byte aligned */
u8 data[DOT11_MAX_KEY_SIZE]; /* key data */
u8 data[WLAN_MAX_KEY_LEN]; /* key data */
wsec_iv_t rxiv[WLC_NUMRXIVS]; /* Rx IV (one per TID) */
wsec_iv_t txiv; /* Tx IV */
......
......@@ -8304,7 +8304,7 @@ 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_info &= ~HT_CAP_MIMO_PS_MASK;
wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_SM_PS;
wlc->ht_cap.cap_info |= (mimops_mode << IEEE80211_HT_CAP_SM_PS_SHIFT);
if (AP_ENAB(wlc->pub) && wlc->clk) {
......
......@@ -142,9 +142,9 @@ struct rsn_parms {
#define AMPDU_DEF_MPDU_DENSITY 6 /* default mpdu density (110 ==> 4us) */
/* defaults for the HT (MIMO) bss */
#define HT_CAP ((HT_CAP_MIMO_PS_OFF << IEEE80211_HT_CAP_SM_PS_SHIFT) |\
#define HT_CAP (IEEE80211_HT_CAP_SM_PS |\
IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_GRN_FLD |\
HT_CAP_MAX_AMSDU | IEEE80211_HT_CAP_DSSSCCK40)
IEEE80211_HT_CAP_MAX_AMSDU | IEEE80211_HT_CAP_DSSSCCK40)
/* wlc internal bss_info, wl external one is in wlioctl.h */
typedef struct wlc_bss_info {
......
......@@ -80,8 +80,8 @@ static void wlc_stf_stbc_rx_ht_update(struct wlc_info *wlc, int val)
return;
}
wlc->ht_cap.cap_info &= ~HT_CAP_RX_STBC_MASK;
wlc->ht_cap.cap_info |= (val << HT_CAP_RX_STBC_SHIFT);
wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_RX_STBC;
wlc->ht_cap.cap_info |= (val << IEEE80211_HT_CAP_RX_STBC_SHIFT);
if (wlc->pub->up) {
wlc_update_beacon(wlc);
......
......@@ -186,22 +186,10 @@ typedef struct d11cnt {
#define HT_CAP_IE_LEN 26
#define HT_CAP_MIMO_PS_MASK 0x000C
#define HT_CAP_MIMO_PS_OFF 0x0003
#define HT_CAP_MIMO_PS_ON 0x0000
#define HT_CAP_RX_STBC_MASK 0x0300
#define HT_CAP_RX_STBC_SHIFT 8
#define HT_CAP_MAX_AMSDU 0x0800
#define HT_CAP_RX_STBC_NO 0x0
#define HT_CAP_RX_STBC_ONE_STREAM 0x1
#define HT_PARAMS_RX_FACTOR_MASK 0x03
#define AMPDU_MAX_MPDU_DENSITY 7
#define AMPDU_RX_FACTOR_16K 1
#define AMPDU_RX_FACTOR_32K 2
#define AMPDU_RX_FACTOR_64K 3
#define AMPDU_MAX_MPDU_DENSITY IEEE80211_HT_MPDU_DENSITY_16
#define AMPDU_DELIMITER_LEN 4
......@@ -220,7 +208,6 @@ typedef struct d11cnt {
#define RSN_AKM_PSK 2
#define DOT11_MAX_DEFAULT_KEYS 4
#define DOT11_MAX_KEY_SIZE 32
#define DOT11_WPA_KEY_RSC_LEN 8
#define BRCM_OUI "\x00\x10\x18"
......
......@@ -474,7 +474,7 @@ typedef struct wl_rm_rep {
typedef struct wl_wsec_key {
u32 index; /* key index */
u32 len; /* key length */
u8 data[DOT11_MAX_KEY_SIZE]; /* key data */
u8 data[WLAN_MAX_KEY_LEN]; /* key data */
u32 pad_1[18];
u32 algo; /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
u32 flags; /* misc flags */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment