aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorMarc Yang <yangyang@marvell.com>2011-03-25 22:47:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-04 16:20:01 -0400
commit6d2bd916afe6950b50f750cd82bbb9c6ff58611f (patch)
treeb8e53e3b6dfcd1dbed899cd3b6afd60110dec450 /drivers/net/wireless/mwifiex
parentb93f85f0fb019f527b68569aafb836c94b89a47e (diff)
mwifiex: use IEEE80211_HT_CAP_ macros for 11n cap_info
The hw_dot_11n_dev_cap reported by firmware hw_spec has different format than the 11n capabilities. Hence a lot of SET_ and RESET_ bit operation macros were used to convert the dev_cap format to 11n capability format. However the locally defined 11n ht_cap macros are not necessary as we can use IEEE80211_HT_CAP_ macros directly. The 32-bit dev_cap bitmap is added as comment to explain the mapping between firmware and 11n spec. Some unused macros and unnecessary adapter variables are also removed. Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/11n.c85
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c3
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c3
-rw-r--r--drivers/net/wireless/mwifiex/fw.h84
-rw-r--r--drivers/net/wireless/mwifiex/init.c2
-rw-r--r--drivers/net/wireless/mwifiex/join.c13
-rw-r--r--drivers/net/wireless/mwifiex/main.h2
7 files changed, 63 insertions, 129 deletions
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index 7b7b86d1ea3e..ce6421f3230b 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -61,59 +61,42 @@ mwifiex_fill_cap_info(struct mwifiex_private *priv,
61 uint16_t ht_cap_info = le16_to_cpu(ht_cap->ht_cap.cap_info); 61 uint16_t ht_cap_info = le16_to_cpu(ht_cap->ht_cap.cap_info);
62 uint16_t ht_ext_cap = le16_to_cpu(ht_cap->ht_cap.extended_ht_cap_info); 62 uint16_t ht_ext_cap = le16_to_cpu(ht_cap->ht_cap.extended_ht_cap_info);
63 63
64 if (ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap) && 64 /* Convert dev_cap to IEEE80211_HT_CAP */
65 ISSUPP_CHANWIDTH40(adapter->usr_dot_11n_dev_cap)) 65 if (ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap))
66 SETHT_SUPPCHANWIDTH(ht_cap_info); 66 ht_cap_info |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
67 else 67 else
68 RESETHT_SUPPCHANWIDTH(ht_cap_info); 68 ht_cap_info &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
69 69
70 if (ISSUPP_GREENFIELD(adapter->hw_dot_11n_dev_cap) && 70 if (ISSUPP_SHORTGI20(adapter->hw_dot_11n_dev_cap))
71 ISSUPP_GREENFIELD(adapter->usr_dot_11n_dev_cap)) 71 ht_cap_info |= IEEE80211_HT_CAP_SGI_20;
72 SETHT_GREENFIELD(ht_cap_info);
73 else 72 else
74 RESETHT_GREENFIELD(ht_cap_info); 73 ht_cap_info &= ~IEEE80211_HT_CAP_SGI_20;
75 74
76 if (ISSUPP_SHORTGI20(adapter->hw_dot_11n_dev_cap) && 75 if (ISSUPP_SHORTGI40(adapter->hw_dot_11n_dev_cap))
77 ISSUPP_SHORTGI20(adapter->usr_dot_11n_dev_cap)) 76 ht_cap_info |= IEEE80211_HT_CAP_SGI_40;
78 SETHT_SHORTGI20(ht_cap_info);
79 else 77 else
80 RESETHT_SHORTGI20(ht_cap_info); 78 ht_cap_info &= ~IEEE80211_HT_CAP_SGI_40;
81 79
82 if (ISSUPP_SHORTGI40(adapter->hw_dot_11n_dev_cap) &&
83 ISSUPP_SHORTGI40(adapter->usr_dot_11n_dev_cap))
84 SETHT_SHORTGI40(ht_cap_info);
85 else
86 RESETHT_SHORTGI40(ht_cap_info);
87
88 /* No user config for RX STBC yet */
89 if (ISSUPP_RXSTBC(adapter->hw_dot_11n_dev_cap)
90 && ISSUPP_RXSTBC(adapter->usr_dot_11n_dev_cap))
91 SETHT_RXSTBC(ht_cap_info, 1);
92 else
93 RESETHT_RXSTBC(ht_cap_info);
94
95 /* No user config for TX STBC yet */
96 if (ISSUPP_TXSTBC(adapter->hw_dot_11n_dev_cap)) 80 if (ISSUPP_TXSTBC(adapter->hw_dot_11n_dev_cap))
97 SETHT_TXSTBC(ht_cap_info); 81 ht_cap_info |= IEEE80211_HT_CAP_TX_STBC;
98 else 82 else
99 RESETHT_TXSTBC(ht_cap_info); 83 ht_cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
100 84
101 /* No user config for Delayed BACK yet */ 85 if (ISSUPP_RXSTBC(adapter->hw_dot_11n_dev_cap))
102 if (GET_DELAYEDBACK(adapter->hw_dot_11n_dev_cap)) 86 ht_cap_info |= 1 << IEEE80211_HT_CAP_RX_STBC_SHIFT;
103 SETHT_DELAYEDBACK(ht_cap_info);
104 else 87 else
105 RESETHT_DELAYEDBACK(ht_cap_info); 88 ht_cap_info &= ~(3 << IEEE80211_HT_CAP_RX_STBC_SHIFT);
106 89
107 if (ISENABLED_40MHZ_INTOLARENT(adapter->usr_dot_11n_dev_cap)) 90 if (ISSUPP_GREENFIELD(adapter->hw_dot_11n_dev_cap))
108 SETHT_40MHZ_INTOLARANT(ht_cap_info); 91 ht_cap_info |= IEEE80211_HT_CAP_GRN_FLD;
109 else 92 else
110 RESETHT_40MHZ_INTOLARANT(ht_cap_info); 93 ht_cap_info &= ~IEEE80211_HT_CAP_GRN_FLD;
111 94
112 SETAMPDU_SIZE(ht_cap->ht_cap.ampdu_params_info, AMPDU_FACTOR_64K); 95 ht_cap_info &= ~IEEE80211_HT_CAP_MAX_AMSDU;
113 SETAMPDU_SPACING(ht_cap->ht_cap.ampdu_params_info, 0); 96 ht_cap_info |= IEEE80211_HT_CAP_SM_PS;
114 97
115 /* Need change to support 8k AMSDU receive */ 98 ht_cap->ht_cap.ampdu_params_info |= IEEE80211_HT_AMPDU_PARM_FACTOR;
116 RESETHT_MAXAMSDU(ht_cap_info); 99 ht_cap->ht_cap.ampdu_params_info &= ~IEEE80211_HT_AMPDU_PARM_DENSITY;
117 100
118 rx_mcs_supp = GET_RXMCSSUPP(adapter->hw_dev_mcs_support); 101 rx_mcs_supp = GET_RXMCSSUPP(adapter->hw_dev_mcs_support);
119 102
@@ -127,8 +110,7 @@ mwifiex_fill_cap_info(struct mwifiex_private *priv,
127 sizeof(struct ieee80211_mcs_info) - rx_mcs_supp); 110 sizeof(struct ieee80211_mcs_info) - rx_mcs_supp);
128 111
129 if (priv->bss_mode == MWIFIEX_BSS_MODE_INFRA || 112 if (priv->bss_mode == MWIFIEX_BSS_MODE_INFRA ||
130 (ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap) && 113 (ht_cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40))
131 ISSUPP_CHANWIDTH40(adapter->usr_dot_11n_dev_cap)))
132 /* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */ 114 /* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */
133 SETHT_MCS32(ht_cap->ht_cap.mcs.rx_mask); 115 SETHT_MCS32(ht_cap->ht_cap.mcs.rx_mask);
134 116
@@ -452,10 +434,10 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
452 le16_to_cpu(ht_info->header.len)); 434 le16_to_cpu(ht_info->header.len));
453 435
454 if (!ISSUPP_CHANWIDTH40 436 if (!ISSUPP_CHANWIDTH40
455 (priv->adapter->hw_dot_11n_dev_cap) 437 (priv->adapter->hw_dot_11n_dev_cap))
456 || !ISSUPP_CHANWIDTH40(priv->adapter-> 438 ht_info->ht_info.ht_param &=
457 usr_dot_11n_dev_cap)) 439 ~(IEEE80211_HT_PARAM_CHAN_WIDTH_ANY |
458 RESET_CHANWIDTH40(ht_info->ht_info.ht_param); 440 IEEE80211_HT_PARAM_CHA_SEC_OFFSET);
459 441
460 *buffer += sizeof(struct mwifiex_ie_types_htinfo); 442 *buffer += sizeof(struct mwifiex_ie_types_htinfo);
461 ret_len += sizeof(struct mwifiex_ie_types_htinfo); 443 ret_len += sizeof(struct mwifiex_ie_types_htinfo);
@@ -474,13 +456,13 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
474 chan_list->chan_scan_param[0].radio_type = 456 chan_list->chan_scan_param[0].radio_type =
475 mwifiex_band_to_radio_type((u8) bss_desc->bss_band); 457 mwifiex_band_to_radio_type((u8) bss_desc->bss_band);
476 458
477 if ((ISSUPP_CHANWIDTH40(priv->adapter->hw_dot_11n_dev_cap) && 459 if (ISSUPP_CHANWIDTH40(priv->adapter->hw_dot_11n_dev_cap)
478 ISSUPP_CHANWIDTH40(priv->adapter->usr_dot_11n_dev_cap)) 460 && (bss_desc->bcn_ht_info->ht_param &
479 && ISALLOWED_CHANWIDTH40(bss_desc->bcn_ht_info->ht_param)) 461 IEEE80211_HT_PARAM_CHAN_WIDTH_ANY))
480 SET_SECONDARYCHAN(chan_list->chan_scan_param[0]. 462 SET_SECONDARYCHAN(chan_list->chan_scan_param[0].
481 radio_type, 463 radio_type,
482 GET_SECONDARYCHAN(bss_desc-> 464 (bss_desc->bcn_ht_info->ht_param &
483 bcn_ht_info->ht_param)); 465 IEEE80211_HT_PARAM_CHA_SEC_OFFSET));
484 466
485 *buffer += sizeof(struct mwifiex_ie_types_chan_list_param_set); 467 *buffer += sizeof(struct mwifiex_ie_types_chan_list_param_set);
486 ret_len += sizeof(struct mwifiex_ie_types_chan_list_param_set); 468 ret_len += sizeof(struct mwifiex_ie_types_chan_list_param_set);
@@ -540,7 +522,8 @@ mwifiex_cfg_tx_buf(struct mwifiex_private *priv,
540 u16 curr_tx_buf_size = 0; 522 u16 curr_tx_buf_size = 0;
541 523
542 if (bss_desc->bcn_ht_cap) { 524 if (bss_desc->bcn_ht_cap) {
543 if (GETHT_MAXAMSDU(le16_to_cpu(bss_desc->bcn_ht_cap->cap_info))) 525 if (le16_to_cpu(bss_desc->bcn_ht_cap->cap_info) &
526 IEEE80211_HT_CAP_MAX_AMSDU)
544 max_amsdu = MWIFIEX_TX_DATA_BUF_SIZE_8K; 527 max_amsdu = MWIFIEX_TX_DATA_BUF_SIZE_8K;
545 else 528 else
546 max_amsdu = MWIFIEX_TX_DATA_BUF_SIZE_4K; 529 max_amsdu = MWIFIEX_TX_DATA_BUF_SIZE_4K;
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 84e33f1f0ffe..de86ef879509 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1302,8 +1302,7 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
1302 memset(&mcs[rx_mcs_supp], 0, 1302 memset(&mcs[rx_mcs_supp], 0,
1303 sizeof(struct ieee80211_mcs_info) - rx_mcs_supp); 1303 sizeof(struct ieee80211_mcs_info) - rx_mcs_supp);
1304 if (priv->bss_mode == MWIFIEX_BSS_MODE_INFRA || 1304 if (priv->bss_mode == MWIFIEX_BSS_MODE_INFRA ||
1305 (ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap) && 1305 ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap))
1306 ISSUPP_CHANWIDTH40(adapter->usr_dot_11n_dev_cap)))
1307 /* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */ 1306 /* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */
1308 SETHT_MCS32(mcs_set.rx_mask); 1307 SETHT_MCS32(mcs_set.rx_mask);
1309 1308
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 24a3b6b69f64..3865dd19e4f8 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -1448,10 +1448,7 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
1448 } 1448 }
1449 1449
1450 adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap); 1450 adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap);
1451 adapter->usr_dot_11n_dev_cap = adapter->hw_dot_11n_dev_cap &
1452 DEFAULT_11N_CAP_MASK;
1453 adapter->hw_dev_mcs_support = hw_spec->dev_mcs_support; 1451 adapter->hw_dev_mcs_support = hw_spec->dev_mcs_support;
1454 adapter->usr_dev_mcs_support = adapter->hw_dev_mcs_support;
1455 1452
1456 if (adapter->if_ops.update_mp_end_port) 1453 if (adapter->if_ops.update_mp_end_port)
1457 adapter->if_ops.update_mp_end_port(adapter, 1454 adapter->if_ops.update_mp_end_port(adapter,
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 410be694e36b..6593e071dea8 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -182,76 +182,34 @@ enum MWIFIEX_802_11_WEP_STATUS {
182 182
183#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096 183#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
184#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192 184#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
185#define MAX_RX_AMPDU_SIZE_64K 0x03
186#define NON_GREENFIELD_STAS 0x04 185#define NON_GREENFIELD_STAS 0x04
187 186
188#define HWSPEC_GREENFIELD_SUPP BIT(29)
189#define HWSPEC_RXSTBC_SUPP BIT(26)
190#define HWSPEC_SHORTGI40_SUPP BIT(24)
191#define HWSPEC_SHORTGI20_SUPP BIT(23)
192#define HWSPEC_CHANBW40_SUPP BIT(17)
193
194#define DEFAULT_11N_CAP_MASK (HWSPEC_SHORTGI20_SUPP | HWSPEC_RXSTBC_SUPP)
195#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11)) 187#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
196#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29)) 188
197#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26)) 189/* dev_cap bitmap
198#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25)) 190 * BIT
199#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24)) 191 * 0-16 reserved
200#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23)) 192 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
201#define GET_DELAYEDBACK(Dot11nDevCap) (((Dot11nDevCap >> 20) & 0x03)) 193 * 18-22 reserved
194 * 23 IEEE80211_HT_CAP_SGI_20
195 * 24 IEEE80211_HT_CAP_SGI_40
196 * 25 IEEE80211_HT_CAP_TX_STBC
197 * 26 IEEE80211_HT_CAP_RX_STBC
198 * 27-28 reserved
199 * 29 IEEE80211_HT_CAP_GRN_FLD
200 * 30-31 reserved
201 */
202#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17)) 202#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
203#define ISENABLED_40MHZ_INTOLARENT(Dot11nDevCap) (Dot11nDevCap & BIT(8)) 203#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
204#define SETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap |= BIT(17)) 204#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
205#define RESETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap &= ~BIT(17)) 205#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
206#define GET_TXMCSSUPP(DevMCSSupported) (DevMCSSupported >> 4) 206#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
207#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
208
207#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f) 209#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
208#define GETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo & BIT(1))
209#define GETHT_GREENFIELD(HTCapInfo) (HTCapInfo & BIT(4))
210#define GETHT_SHORTGI20(HTCapInfo) (HTCapInfo & BIT(5))
211#define GETHT_SHORTGI40(HTCapInfo) (HTCapInfo & BIT(6))
212#define GETHT_TXSTBC(HTCapInfo) (HTCapInfo & BIT(7))
213#define GETHT_RXSTBC(HTCapInfo) ((HTCapInfo >> 8) & 0x03)
214#define GETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo & BIT(10))
215#define GETHT_MAXAMSDU(HTCapInfo) (HTCapInfo & BIT(11))
216#define SETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo |= BIT(1))
217#define SETHT_GREENFIELD(HTCapInfo) (HTCapInfo |= BIT(4))
218#define SETHT_SHORTGI20(HTCapInfo) (HTCapInfo |= BIT(5))
219#define SETHT_SHORTGI40(HTCapInfo) (HTCapInfo |= BIT(6))
220#define SETHT_TXSTBC(HTCapInfo) (HTCapInfo |= BIT(7))
221#define SETHT_RXSTBC(HTCapInfo, value) (HTCapInfo |= (value << 8))
222#define SETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo |= BIT(10))
223#define SETHT_MAXAMSDU(HTCapInfo) (HTCapInfo |= BIT(11))
224#define SETHT_DSSSCCK40(HTCapInfo) (HTCapInfo |= BIT(12))
225#define SETHT_40MHZ_INTOLARANT(HTCapInfo) (HTCapInfo |= BIT(14))
226#define RESETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo &= ~BIT(1))
227#define RESETHT_GREENFIELD(HTCapInfo) (HTCapInfo &= ~BIT(4))
228#define RESETHT_SHORTGI20(HTCapInfo) (HTCapInfo &= ~BIT(5))
229#define RESETHT_SHORTGI40(HTCapInfo) (HTCapInfo &= ~BIT(6))
230#define RESETHT_TXSTBC(HTCapInfo) (HTCapInfo &= ~BIT(7))
231#define RESETHT_RXSTBC(HTCapInfo) (HTCapInfo &= ~(0x03 << 8))
232#define RESETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo &= ~BIT(10))
233#define RESETHT_MAXAMSDU(HTCapInfo) (HTCapInfo &= ~BIT(11))
234#define RESETHT_40MHZ_INTOLARANT(HTCapInfo) (HTCapInfo &= ~BIT(14))
235#define RESETHT_EXTCAP_RDG(HTExtCap) (HTExtCap &= ~BIT(11)) 210#define RESETHT_EXTCAP_RDG(HTExtCap) (HTExtCap &= ~BIT(11))
236#define SETHT_MCS32(x) (x[4] |= 1) 211#define SETHT_MCS32(x) (x[4] |= 1)
237#define SETHT_MCS_SET_DEFINED(x) (x[12] |= 1) 212
238#define SETHT_RX_HIGHEST_DT_SUPP(x, y) ((*(u16 *) (x + 10)) = y)
239#define AMPDU_FACTOR_64K 0x03
240#define SETAMPDU_SIZE(x, y) do { \
241 x = x & ~0x03; \
242 x |= y & 0x03; \
243} while (0) \
244
245#define SETAMPDU_SPACING(x, y) do { \
246 x = x & ~0x1c; \
247 x |= (y & 0x07) << 2; \
248} while (0) \
249
250#define ISSUPP_BANDA(FwCapInfo) (FwCapInfo & BIT(10))
251#define ISALLOWED_CHANWIDTH40(Field2) (Field2 & BIT(2))
252#define SET_CHANWIDTH40(Field2) (Field2 |= BIT(2))
253#define RESET_CHANWIDTH40(Field2) (Field2 &= ~(BIT(0) | BIT(1) | BIT(2)))
254#define GET_SECONDARYCHAN(Field2) (Field2 & (BIT(0) | BIT(1)))
255#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4)) 213#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
256 214
257#define LLC_SNAP_LEN 8 215#define LLC_SNAP_LEN 8
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 07ebc97e19c0..1c9315d31d9c 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -267,8 +267,6 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
267 memset(adapter->event_body, 0, sizeof(adapter->event_body)); 267 memset(adapter->event_body, 0, sizeof(adapter->event_body));
268 adapter->hw_dot_11n_dev_cap = 0; 268 adapter->hw_dot_11n_dev_cap = 0;
269 adapter->hw_dev_mcs_support = 0; 269 adapter->hw_dev_mcs_support = 0;
270 adapter->usr_dot_11n_dev_cap = 0;
271 adapter->usr_dev_mcs_support = 0;
272 adapter->chan_offset = 0; 270 adapter->chan_offset = 0;
273 adapter->adhoc_11n_enabled = false; 271 adapter->adhoc_11n_enabled = false;
274 272
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 8ffb6a8d1036..08fa721580cb 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -970,16 +970,16 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
970 cpu_to_le16(sizeof(struct ieee80211_ht_cap)); 970 cpu_to_le16(sizeof(struct ieee80211_ht_cap));
971 ht_cap_info = le16_to_cpu(ht_cap->ht_cap.cap_info); 971 ht_cap_info = le16_to_cpu(ht_cap->ht_cap.cap_info);
972 972
973 SETHT_SHORTGI20(ht_cap_info); 973 ht_cap_info |= IEEE80211_HT_CAP_SGI_20;
974 if (adapter->chan_offset) { 974 if (adapter->chan_offset) {
975 SETHT_SHORTGI40(ht_cap_info); 975 ht_cap_info |= IEEE80211_HT_CAP_SGI_40;
976 SETHT_DSSSCCK40(ht_cap_info); 976 ht_cap_info |= IEEE80211_HT_CAP_DSSSCCK40;
977 SETHT_SUPPCHANWIDTH(ht_cap_info); 977 ht_cap_info |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
978 SETHT_MCS32(ht_cap->ht_cap.mcs.rx_mask); 978 SETHT_MCS32(ht_cap->ht_cap.mcs.rx_mask);
979 } 979 }
980 980
981 ht_cap->ht_cap.ampdu_params_info 981 ht_cap->ht_cap.ampdu_params_info
982 = MAX_RX_AMPDU_SIZE_64K; 982 = IEEE80211_HT_MAX_AMPDU_64K;
983 ht_cap->ht_cap.mcs.rx_mask[0] = 0xff; 983 ht_cap->ht_cap.mcs.rx_mask[0] = 0xff;
984 pos += sizeof(struct mwifiex_ie_types_htcap); 984 pos += sizeof(struct mwifiex_ie_types_htcap);
985 cmd_append_size += 985 cmd_append_size +=
@@ -999,7 +999,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
999 if (adapter->chan_offset) { 999 if (adapter->chan_offset) {
1000 ht_info->ht_info.ht_param = 1000 ht_info->ht_info.ht_param =
1001 adapter->chan_offset; 1001 adapter->chan_offset;
1002 SET_CHANWIDTH40(ht_info->ht_info.ht_param); 1002 ht_info->ht_info.ht_param |=
1003 IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
1003 } 1004 }
1004 ht_info->ht_info.operation_mode = 1005 ht_info->ht_info.operation_mode =
1005 cpu_to_le16(NON_GREENFIELD_STAS); 1006 cpu_to_le16(NON_GREENFIELD_STAS);
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index f6fe1054a65c..7bcb2e965aeb 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -687,8 +687,6 @@ struct mwifiex_adapter {
687 u8 event_body[MAX_EVENT_SIZE]; 687 u8 event_body[MAX_EVENT_SIZE];
688 u32 hw_dot_11n_dev_cap; 688 u32 hw_dot_11n_dev_cap;
689 u8 hw_dev_mcs_support; 689 u8 hw_dev_mcs_support;
690 u32 usr_dot_11n_dev_cap;
691 u8 usr_dev_mcs_support;
692 u8 adhoc_11n_enabled; 690 u8 adhoc_11n_enabled;
693 u8 chan_offset; 691 u8 chan_offset;
694 struct mwifiex_dbg dbg; 692 struct mwifiex_dbg dbg;