aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/11ac.c
diff options
context:
space:
mode:
authorAvinash Patil <patila@marvell.com>2014-02-07 19:30:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-12 15:36:23 -0500
commit9ed230bcbab74a84b4f7d8eade107cd4c20630df (patch)
treebcfeeaee075f85016aaee4366662c5431c1a9d28 /drivers/net/wireless/mwifiex/11ac.c
parentdaeb5bb48256d7488246d48453b2315281ce9c75 (diff)
mwifiex: pass ieee80211_vht_cap to mwifiex_fill_vht_cap_tlv
This patch changes mwifiex_fill_vht_cap_tlv function to pass struct ieee80211_vht_cap instead of mwifiex_ie_types_vhtcap so that it can be used generically. Signed-off-by: Avinash Patil <patila@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/11ac.c')
-rw-r--r--drivers/net/wireless/mwifiex/11ac.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/wireless/mwifiex/11ac.c b/drivers/net/wireless/mwifiex/11ac.c
index 47383920eb12..5895bc8978a5 100644
--- a/drivers/net/wireless/mwifiex/11ac.c
+++ b/drivers/net/wireless/mwifiex/11ac.c
@@ -96,21 +96,21 @@ mwifiex_convert_mcsmap_to_maxrate(struct mwifiex_private *priv,
96 96
97static void 97static void
98mwifiex_fill_vht_cap_info(struct mwifiex_private *priv, 98mwifiex_fill_vht_cap_info(struct mwifiex_private *priv,
99 struct mwifiex_ie_types_vhtcap *vht_cap, u8 bands) 99 struct ieee80211_vht_cap *vht_cap, u8 bands)
100{ 100{
101 struct mwifiex_adapter *adapter = priv->adapter; 101 struct mwifiex_adapter *adapter = priv->adapter;
102 102
103 if (bands & BAND_A) 103 if (bands & BAND_A)
104 vht_cap->vht_cap.vht_cap_info = 104 vht_cap->vht_cap_info =
105 cpu_to_le32(adapter->usr_dot_11ac_dev_cap_a); 105 cpu_to_le32(adapter->usr_dot_11ac_dev_cap_a);
106 else 106 else
107 vht_cap->vht_cap.vht_cap_info = 107 vht_cap->vht_cap_info =
108 cpu_to_le32(adapter->usr_dot_11ac_dev_cap_bg); 108 cpu_to_le32(adapter->usr_dot_11ac_dev_cap_bg);
109} 109}
110 110
111static void 111static void
112mwifiex_fill_vht_cap_tlv(struct mwifiex_private *priv, 112mwifiex_fill_vht_cap_tlv(struct mwifiex_private *priv,
113 struct mwifiex_ie_types_vhtcap *vht_cap, u8 bands) 113 struct ieee80211_vht_cap *vht_cap, u8 bands)
114{ 114{
115 struct mwifiex_adapter *adapter = priv->adapter; 115 struct mwifiex_adapter *adapter = priv->adapter;
116 u16 mcs_map_user, mcs_map_resp, mcs_map_result; 116 u16 mcs_map_user, mcs_map_resp, mcs_map_result;
@@ -121,7 +121,7 @@ mwifiex_fill_vht_cap_tlv(struct mwifiex_private *priv,
121 121
122 /* rx MCS Set: find the minimum of the user rx mcs and ap rx mcs */ 122 /* rx MCS Set: find the minimum of the user rx mcs and ap rx mcs */
123 mcs_map_user = GET_DEVRXMCSMAP(adapter->usr_dot_11ac_mcs_support); 123 mcs_map_user = GET_DEVRXMCSMAP(adapter->usr_dot_11ac_mcs_support);
124 mcs_map_resp = le16_to_cpu(vht_cap->vht_cap.supp_mcs.rx_mcs_map); 124 mcs_map_resp = le16_to_cpu(vht_cap->supp_mcs.rx_mcs_map);
125 mcs_map_result = 0; 125 mcs_map_result = 0;
126 126
127 for (nss = 1; nss <= 8; nss++) { 127 for (nss = 1; nss <= 8; nss++) {
@@ -137,14 +137,14 @@ mwifiex_fill_vht_cap_tlv(struct mwifiex_private *priv,
137 min(mcs_user, mcs_resp)); 137 min(mcs_user, mcs_resp));
138 } 138 }
139 139
140 vht_cap->vht_cap.supp_mcs.rx_mcs_map = cpu_to_le16(mcs_map_result); 140 vht_cap->supp_mcs.rx_mcs_map = cpu_to_le16(mcs_map_result);
141 141
142 tmp = mwifiex_convert_mcsmap_to_maxrate(priv, bands, mcs_map_result); 142 tmp = mwifiex_convert_mcsmap_to_maxrate(priv, bands, mcs_map_result);
143 vht_cap->vht_cap.supp_mcs.rx_highest = cpu_to_le16(tmp); 143 vht_cap->supp_mcs.rx_highest = cpu_to_le16(tmp);
144 144
145 /* tx MCS Set: find the minimum of the user tx mcs and ap tx mcs */ 145 /* tx MCS Set: find the minimum of the user tx mcs and ap tx mcs */
146 mcs_map_user = GET_DEVTXMCSMAP(adapter->usr_dot_11ac_mcs_support); 146 mcs_map_user = GET_DEVTXMCSMAP(adapter->usr_dot_11ac_mcs_support);
147 mcs_map_resp = le16_to_cpu(vht_cap->vht_cap.supp_mcs.tx_mcs_map); 147 mcs_map_resp = le16_to_cpu(vht_cap->supp_mcs.tx_mcs_map);
148 mcs_map_result = 0; 148 mcs_map_result = 0;
149 149
150 for (nss = 1; nss <= 8; nss++) { 150 for (nss = 1; nss <= 8; nss++) {
@@ -159,10 +159,10 @@ mwifiex_fill_vht_cap_tlv(struct mwifiex_private *priv,
159 min(mcs_user, mcs_resp)); 159 min(mcs_user, mcs_resp));
160 } 160 }
161 161
162 vht_cap->vht_cap.supp_mcs.tx_mcs_map = cpu_to_le16(mcs_map_result); 162 vht_cap->supp_mcs.tx_mcs_map = cpu_to_le16(mcs_map_result);
163 163
164 tmp = mwifiex_convert_mcsmap_to_maxrate(priv, bands, mcs_map_result); 164 tmp = mwifiex_convert_mcsmap_to_maxrate(priv, bands, mcs_map_result);
165 vht_cap->vht_cap.supp_mcs.tx_highest = cpu_to_le16(tmp); 165 vht_cap->supp_mcs.tx_highest = cpu_to_le16(tmp);
166 166
167 return; 167 return;
168} 168}
@@ -197,7 +197,8 @@ int mwifiex_cmd_append_11ac_tlv(struct mwifiex_private *priv,
197 sizeof(struct ieee_types_header), 197 sizeof(struct ieee_types_header),
198 le16_to_cpu(vht_cap->header.len)); 198 le16_to_cpu(vht_cap->header.len));
199 199
200 mwifiex_fill_vht_cap_tlv(priv, vht_cap, bss_desc->bss_band); 200 mwifiex_fill_vht_cap_tlv(priv, &vht_cap->vht_cap,
201 bss_desc->bss_band);
201 *buffer += sizeof(*vht_cap); 202 *buffer += sizeof(*vht_cap);
202 ret_len += sizeof(*vht_cap); 203 ret_len += sizeof(*vht_cap);
203 } 204 }