Commit | Line | Data |
---|---|---|
5e6e3a92 BZ |
1 | /* |
2 | * Marvell Wireless LAN device driver: station command response handling | |
3 | * | |
4 | * Copyright (C) 2011, Marvell International Ltd. | |
5 | * | |
6 | * This software file (the "File") is distributed by Marvell International | |
7 | * Ltd. under the terms of the GNU General Public License Version 2, June 1991 | |
8 | * (the "License"). You may use, redistribute and/or modify this File in | |
9 | * accordance with the terms and conditions of the License, a copy of which | |
10 | * is available by writing to the Free Software Foundation, Inc., | |
11 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the | |
12 | * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | |
13 | * | |
14 | * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE | |
15 | * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE | |
16 | * ARE EXPRESSLY DISCLAIMED. The License provides additional details about | |
17 | * this warranty disclaimer. | |
18 | */ | |
19 | ||
20 | #include "decl.h" | |
21 | #include "ioctl.h" | |
22 | #include "util.h" | |
23 | #include "fw.h" | |
24 | #include "main.h" | |
25 | #include "wmm.h" | |
26 | #include "11n.h" | |
a5f39056 | 27 | #include "11ac.h" |
5e6e3a92 BZ |
28 | |
29 | ||
30 | /* | |
31 | * This function handles the command response error case. | |
32 | * | |
33 | * For scan response error, the function cancels all the pending | |
34 | * scan commands and generates an event to inform the applications | |
35 | * of the scan completion. | |
36 | * | |
37 | * For Power Save command failure, we do not retry enter PS | |
38 | * command in case of Ad-hoc mode. | |
39 | * | |
40 | * For all other response errors, the current command buffer is freed | |
41 | * and returned to the free command queue. | |
42 | */ | |
43 | static void | |
44 | mwifiex_process_cmdresp_error(struct mwifiex_private *priv, | |
600f5d90 | 45 | struct host_cmd_ds_command *resp) |
5e6e3a92 | 46 | { |
270e58e8 | 47 | struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; |
5e6e3a92 | 48 | struct mwifiex_adapter *adapter = priv->adapter; |
2b06bdbe | 49 | struct host_cmd_ds_802_11_ps_mode_enh *pm; |
5e6e3a92 BZ |
50 | unsigned long flags; |
51 | ||
52 | dev_err(adapter->dev, "CMD_RESP: cmd %#x error, result=%#x\n", | |
9c05fd72 | 53 | resp->command, resp->result); |
600f5d90 AK |
54 | |
55 | if (adapter->curr_cmd->wait_q_enabled) | |
56 | adapter->cmd_wait_q.status = -1; | |
5e6e3a92 BZ |
57 | |
58 | switch (le16_to_cpu(resp->command)) { | |
59 | case HostCmd_CMD_802_11_PS_MODE_ENH: | |
2b06bdbe | 60 | pm = &resp->params.psmode_enh; |
9c05fd72 YAP |
61 | dev_err(adapter->dev, |
62 | "PS_MODE_ENH cmd failed: result=0x%x action=0x%X\n", | |
63 | resp->result, le16_to_cpu(pm->action)); | |
2b06bdbe MY |
64 | /* We do not re-try enter-ps command in ad-hoc mode. */ |
65 | if (le16_to_cpu(pm->action) == EN_AUTO_PS && | |
9c05fd72 YAP |
66 | (le16_to_cpu(pm->params.ps_bitmap) & BITMAP_STA_PS) && |
67 | priv->bss_mode == NL80211_IFTYPE_ADHOC) | |
2b06bdbe MY |
68 | adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_CAM; |
69 | ||
5e6e3a92 BZ |
70 | break; |
71 | case HostCmd_CMD_802_11_SCAN: | |
72 | /* Cancel all pending scan command */ | |
73 | spin_lock_irqsave(&adapter->scan_pending_q_lock, flags); | |
74 | list_for_each_entry_safe(cmd_node, tmp_node, | |
75 | &adapter->scan_pending_q, list) { | |
76 | list_del(&cmd_node->list); | |
77 | spin_unlock_irqrestore(&adapter->scan_pending_q_lock, | |
78 | flags); | |
79 | mwifiex_insert_cmd_to_free_q(adapter, cmd_node); | |
80 | spin_lock_irqsave(&adapter->scan_pending_q_lock, flags); | |
81 | } | |
82 | spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags); | |
83 | ||
84 | spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); | |
85 | adapter->scan_processing = false; | |
86 | spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); | |
87 | if (priv->report_scan_result) | |
88 | priv->report_scan_result = false; | |
5e6e3a92 BZ |
89 | break; |
90 | ||
91 | case HostCmd_CMD_MAC_CONTROL: | |
92 | break; | |
93 | ||
94 | default: | |
95 | break; | |
96 | } | |
97 | /* Handling errors here */ | |
9908b074 | 98 | mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); |
5e6e3a92 BZ |
99 | |
100 | spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); | |
101 | adapter->curr_cmd = NULL; | |
102 | spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); | |
5e6e3a92 BZ |
103 | } |
104 | ||
105 | /* | |
106 | * This function handles the command response of get RSSI info. | |
107 | * | |
108 | * Handling includes changing the header fields into CPU format | |
109 | * and saving the following parameters in driver - | |
110 | * - Last data and beacon RSSI value | |
111 | * - Average data and beacon RSSI value | |
112 | * - Last data and beacon NF value | |
113 | * - Average data and beacon NF value | |
114 | * | |
115 | * The parameters are send to the application as well, along with | |
116 | * calculated SNR values. | |
117 | */ | |
118 | static int mwifiex_ret_802_11_rssi_info(struct mwifiex_private *priv, | |
958a4a86 | 119 | struct host_cmd_ds_command *resp) |
5e6e3a92 BZ |
120 | { |
121 | struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp = | |
9c05fd72 | 122 | &resp->params.rssi_info_rsp; |
908fe113 JD |
123 | struct mwifiex_ds_misc_subsc_evt *subsc_evt = |
124 | &priv->async_subsc_evt_storage; | |
5e6e3a92 BZ |
125 | |
126 | priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last); | |
127 | priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last); | |
128 | ||
129 | priv->data_rssi_avg = le16_to_cpu(rssi_info_rsp->data_rssi_avg); | |
130 | priv->data_nf_avg = le16_to_cpu(rssi_info_rsp->data_nf_avg); | |
131 | ||
132 | priv->bcn_rssi_last = le16_to_cpu(rssi_info_rsp->bcn_rssi_last); | |
133 | priv->bcn_nf_last = le16_to_cpu(rssi_info_rsp->bcn_nf_last); | |
134 | ||
135 | priv->bcn_rssi_avg = le16_to_cpu(rssi_info_rsp->bcn_rssi_avg); | |
136 | priv->bcn_nf_avg = le16_to_cpu(rssi_info_rsp->bcn_nf_avg); | |
137 | ||
fa444bf8 AK |
138 | if (priv->subsc_evt_rssi_state == EVENT_HANDLED) |
139 | return 0; | |
140 | ||
908fe113 JD |
141 | memset(subsc_evt, 0x00, sizeof(struct mwifiex_ds_misc_subsc_evt)); |
142 | ||
fa444bf8 | 143 | /* Resubscribe low and high rssi events with new thresholds */ |
908fe113 JD |
144 | subsc_evt->events = BITMASK_BCN_RSSI_LOW | BITMASK_BCN_RSSI_HIGH; |
145 | subsc_evt->action = HostCmd_ACT_BITWISE_SET; | |
fa444bf8 | 146 | if (priv->subsc_evt_rssi_state == RSSI_LOW_RECVD) { |
908fe113 | 147 | subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg - |
fa444bf8 | 148 | priv->cqm_rssi_hyst); |
908fe113 | 149 | subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); |
fa444bf8 | 150 | } else if (priv->subsc_evt_rssi_state == RSSI_HIGH_RECVD) { |
908fe113 JD |
151 | subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); |
152 | subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg + | |
fa444bf8 AK |
153 | priv->cqm_rssi_hyst); |
154 | } | |
908fe113 JD |
155 | subsc_evt->bcn_l_rssi_cfg.evt_freq = 1; |
156 | subsc_evt->bcn_h_rssi_cfg.evt_freq = 1; | |
fa444bf8 AK |
157 | |
158 | priv->subsc_evt_rssi_state = EVENT_HANDLED; | |
159 | ||
160 | mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11_SUBSCRIBE_EVENT, | |
908fe113 | 161 | 0, 0, subsc_evt); |
fa444bf8 | 162 | |
5e6e3a92 BZ |
163 | return 0; |
164 | } | |
165 | ||
166 | /* | |
167 | * This function handles the command response of set/get SNMP | |
168 | * MIB parameters. | |
169 | * | |
170 | * Handling includes changing the header fields into CPU format | |
171 | * and saving the parameter in driver. | |
172 | * | |
173 | * The following parameters are supported - | |
174 | * - Fragmentation threshold | |
175 | * - RTS threshold | |
176 | * - Short retry limit | |
177 | */ | |
178 | static int mwifiex_ret_802_11_snmp_mib(struct mwifiex_private *priv, | |
179 | struct host_cmd_ds_command *resp, | |
a5e5aa6c | 180 | u32 *data_buf) |
5e6e3a92 BZ |
181 | { |
182 | struct host_cmd_ds_802_11_snmp_mib *smib = &resp->params.smib; | |
183 | u16 oid = le16_to_cpu(smib->oid); | |
184 | u16 query_type = le16_to_cpu(smib->query_type); | |
a5e5aa6c | 185 | u32 ul_temp; |
5e6e3a92 BZ |
186 | |
187 | dev_dbg(priv->adapter->dev, "info: SNMP_RESP: oid value = %#x," | |
9c05fd72 YAP |
188 | " query_type = %#x, buf size = %#x\n", |
189 | oid, query_type, le16_to_cpu(smib->buf_size)); | |
5e6e3a92 | 190 | if (query_type == HostCmd_ACT_GEN_GET) { |
a5e5aa6c DC |
191 | ul_temp = le16_to_cpu(*((__le16 *) (smib->value))); |
192 | if (data_buf) | |
193 | *data_buf = ul_temp; | |
5e6e3a92 BZ |
194 | switch (oid) { |
195 | case FRAG_THRESH_I: | |
196 | dev_dbg(priv->adapter->dev, | |
a5e5aa6c | 197 | "info: SNMP_RESP: FragThsd =%u\n", ul_temp); |
5e6e3a92 BZ |
198 | break; |
199 | case RTS_THRESH_I: | |
200 | dev_dbg(priv->adapter->dev, | |
a5e5aa6c | 201 | "info: SNMP_RESP: RTSThsd =%u\n", ul_temp); |
5e6e3a92 BZ |
202 | break; |
203 | case SHORT_RETRY_LIM_I: | |
204 | dev_dbg(priv->adapter->dev, | |
a5e5aa6c | 205 | "info: SNMP_RESP: TxRetryCount=%u\n", ul_temp); |
5e6e3a92 | 206 | break; |
caf60a6c AK |
207 | case DTIM_PERIOD_I: |
208 | dev_dbg(priv->adapter->dev, | |
209 | "info: SNMP_RESP: DTIM period=%u\n", ul_temp); | |
5e6e3a92 BZ |
210 | default: |
211 | break; | |
212 | } | |
213 | } | |
214 | ||
215 | return 0; | |
216 | } | |
217 | ||
218 | /* | |
219 | * This function handles the command response of get log request | |
220 | * | |
221 | * Handling includes changing the header fields into CPU format | |
222 | * and sending the received parameters to application. | |
223 | */ | |
224 | static int mwifiex_ret_get_log(struct mwifiex_private *priv, | |
225 | struct host_cmd_ds_command *resp, | |
a5ffddb7 | 226 | struct mwifiex_ds_get_stats *stats) |
5e6e3a92 BZ |
227 | { |
228 | struct host_cmd_ds_802_11_get_log *get_log = | |
2c208890 | 229 | &resp->params.get_log; |
5e6e3a92 | 230 | |
a5ffddb7 | 231 | if (stats) { |
5e6e3a92 BZ |
232 | stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame); |
233 | stats->failed = le32_to_cpu(get_log->failed); | |
234 | stats->retry = le32_to_cpu(get_log->retry); | |
235 | stats->multi_retry = le32_to_cpu(get_log->multi_retry); | |
236 | stats->frame_dup = le32_to_cpu(get_log->frame_dup); | |
237 | stats->rts_success = le32_to_cpu(get_log->rts_success); | |
238 | stats->rts_failure = le32_to_cpu(get_log->rts_failure); | |
239 | stats->ack_failure = le32_to_cpu(get_log->ack_failure); | |
240 | stats->rx_frag = le32_to_cpu(get_log->rx_frag); | |
241 | stats->mcast_rx_frame = le32_to_cpu(get_log->mcast_rx_frame); | |
242 | stats->fcs_error = le32_to_cpu(get_log->fcs_error); | |
243 | stats->tx_frame = le32_to_cpu(get_log->tx_frame); | |
244 | stats->wep_icv_error[0] = | |
245 | le32_to_cpu(get_log->wep_icv_err_cnt[0]); | |
246 | stats->wep_icv_error[1] = | |
247 | le32_to_cpu(get_log->wep_icv_err_cnt[1]); | |
248 | stats->wep_icv_error[2] = | |
249 | le32_to_cpu(get_log->wep_icv_err_cnt[2]); | |
250 | stats->wep_icv_error[3] = | |
251 | le32_to_cpu(get_log->wep_icv_err_cnt[3]); | |
252 | } | |
253 | ||
254 | return 0; | |
255 | } | |
256 | ||
257 | /* | |
258 | * This function handles the command response of set/get Tx rate | |
259 | * configurations. | |
260 | * | |
261 | * Handling includes changing the header fields into CPU format | |
262 | * and saving the following parameters in driver - | |
263 | * - DSSS rate bitmap | |
264 | * - OFDM rate bitmap | |
265 | * - HT MCS rate bitmaps | |
266 | * | |
267 | * Based on the new rate bitmaps, the function re-evaluates if | |
268 | * auto data rate has been activated. If not, it sends another | |
006606c0 | 269 | * query to the firmware to get the current Tx data rate. |
5e6e3a92 BZ |
270 | */ |
271 | static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv, | |
006606c0 | 272 | struct host_cmd_ds_command *resp) |
5e6e3a92 | 273 | { |
5e6e3a92 BZ |
274 | struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg; |
275 | struct mwifiex_rate_scope *rate_scope; | |
270e58e8 | 276 | struct mwifiex_ie_types_header *head; |
2636c308 | 277 | u16 tlv, tlv_buf_len, tlv_buf_left; |
5e6e3a92 BZ |
278 | u8 *tlv_buf; |
279 | u32 i; | |
5e6e3a92 | 280 | |
2636c308 AK |
281 | tlv_buf = ((u8 *)rate_cfg) + sizeof(struct host_cmd_ds_tx_rate_cfg); |
282 | tlv_buf_left = le16_to_cpu(resp->size) - S_DS_GEN - sizeof(*rate_cfg); | |
5e6e3a92 | 283 | |
2636c308 AK |
284 | while (tlv_buf_left >= sizeof(*head)) { |
285 | head = (struct mwifiex_ie_types_header *)tlv_buf; | |
286 | tlv = le16_to_cpu(head->type); | |
287 | tlv_buf_len = le16_to_cpu(head->len); | |
288 | ||
289 | if (tlv_buf_left < (sizeof(*head) + tlv_buf_len)) | |
290 | break; | |
5e6e3a92 BZ |
291 | |
292 | switch (tlv) { | |
293 | case TLV_TYPE_RATE_SCOPE: | |
294 | rate_scope = (struct mwifiex_rate_scope *) tlv_buf; | |
295 | priv->bitmap_rates[0] = | |
296 | le16_to_cpu(rate_scope->hr_dsss_rate_bitmap); | |
297 | priv->bitmap_rates[1] = | |
298 | le16_to_cpu(rate_scope->ofdm_rate_bitmap); | |
299 | for (i = 0; | |
300 | i < | |
301 | sizeof(rate_scope->ht_mcs_rate_bitmap) / | |
302 | sizeof(u16); i++) | |
303 | priv->bitmap_rates[2 + i] = | |
304 | le16_to_cpu(rate_scope-> | |
305 | ht_mcs_rate_bitmap[i]); | |
306 | break; | |
307 | /* Add RATE_DROP tlv here */ | |
308 | } | |
309 | ||
2636c308 AK |
310 | tlv_buf += (sizeof(*head) + tlv_buf_len); |
311 | tlv_buf_left -= (sizeof(*head) + tlv_buf_len); | |
5e6e3a92 BZ |
312 | } |
313 | ||
314 | priv->is_data_rate_auto = mwifiex_is_rate_auto(priv); | |
315 | ||
316 | if (priv->is_data_rate_auto) | |
317 | priv->data_rate = 0; | |
318 | else | |
006606c0 AK |
319 | return mwifiex_send_cmd_async(priv, |
320 | HostCmd_CMD_802_11_TX_RATE_QUERY, | |
321 | HostCmd_ACT_GEN_GET, 0, NULL); | |
5e6e3a92 | 322 | |
006606c0 | 323 | return 0; |
5e6e3a92 BZ |
324 | } |
325 | ||
326 | /* | |
327 | * This function handles the command response of get Tx power level. | |
328 | * | |
329 | * Handling includes saving the maximum and minimum Tx power levels | |
330 | * in driver, as well as sending the values to user. | |
331 | */ | |
332 | static int mwifiex_get_power_level(struct mwifiex_private *priv, void *data_buf) | |
333 | { | |
270e58e8 YAP |
334 | int length, max_power = -1, min_power = -1; |
335 | struct mwifiex_types_power_group *pg_tlv_hdr; | |
336 | struct mwifiex_power_group *pg; | |
5e6e3a92 | 337 | |
bb7de2ba YAP |
338 | if (!data_buf) |
339 | return -1; | |
340 | ||
341 | pg_tlv_hdr = (struct mwifiex_types_power_group *) | |
342 | ((u8 *) data_buf + sizeof(struct host_cmd_ds_txpwr_cfg)); | |
343 | pg = (struct mwifiex_power_group *) | |
344 | ((u8 *) pg_tlv_hdr + sizeof(struct mwifiex_types_power_group)); | |
930fd35c | 345 | length = le16_to_cpu(pg_tlv_hdr->length); |
fe1c9a44 AK |
346 | |
347 | /* At least one structure required to update power */ | |
348 | if (length < sizeof(struct mwifiex_power_group)) | |
349 | return 0; | |
350 | ||
351 | max_power = pg->power_max; | |
352 | min_power = pg->power_min; | |
353 | length -= sizeof(struct mwifiex_power_group); | |
354 | ||
355 | while (length >= sizeof(struct mwifiex_power_group)) { | |
bb7de2ba YAP |
356 | pg++; |
357 | if (max_power < pg->power_max) | |
5e6e3a92 | 358 | max_power = pg->power_max; |
5e6e3a92 | 359 | |
bb7de2ba YAP |
360 | if (min_power > pg->power_min) |
361 | min_power = pg->power_min; | |
5e6e3a92 | 362 | |
bb7de2ba YAP |
363 | length -= sizeof(struct mwifiex_power_group); |
364 | } | |
fe1c9a44 AK |
365 | priv->min_tx_power_level = (u8) min_power; |
366 | priv->max_tx_power_level = (u8) max_power; | |
5e6e3a92 BZ |
367 | |
368 | return 0; | |
369 | } | |
370 | ||
371 | /* | |
372 | * This function handles the command response of set/get Tx power | |
373 | * configurations. | |
374 | * | |
375 | * Handling includes changing the header fields into CPU format | |
376 | * and saving the current Tx power level in driver. | |
377 | */ | |
378 | static int mwifiex_ret_tx_power_cfg(struct mwifiex_private *priv, | |
a5ffddb7 | 379 | struct host_cmd_ds_command *resp) |
5e6e3a92 BZ |
380 | { |
381 | struct mwifiex_adapter *adapter = priv->adapter; | |
382 | struct host_cmd_ds_txpwr_cfg *txp_cfg = &resp->params.txp_cfg; | |
270e58e8 YAP |
383 | struct mwifiex_types_power_group *pg_tlv_hdr; |
384 | struct mwifiex_power_group *pg; | |
5e6e3a92 BZ |
385 | u16 action = le16_to_cpu(txp_cfg->action); |
386 | ||
387 | switch (action) { | |
388 | case HostCmd_ACT_GEN_GET: | |
985d68a3 YAP |
389 | pg_tlv_hdr = (struct mwifiex_types_power_group *) |
390 | ((u8 *) txp_cfg + | |
391 | sizeof(struct host_cmd_ds_txpwr_cfg)); | |
392 | ||
393 | pg = (struct mwifiex_power_group *) | |
394 | ((u8 *) pg_tlv_hdr + | |
395 | sizeof(struct mwifiex_types_power_group)); | |
396 | ||
397 | if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) | |
398 | mwifiex_get_power_level(priv, txp_cfg); | |
399 | ||
400 | priv->tx_power_level = (u16) pg->power_min; | |
401 | break; | |
402 | ||
5e6e3a92 | 403 | case HostCmd_ACT_GEN_SET: |
985d68a3 YAP |
404 | if (!le32_to_cpu(txp_cfg->mode)) |
405 | break; | |
406 | ||
407 | pg_tlv_hdr = (struct mwifiex_types_power_group *) | |
408 | ((u8 *) txp_cfg + | |
409 | sizeof(struct host_cmd_ds_txpwr_cfg)); | |
410 | ||
411 | pg = (struct mwifiex_power_group *) | |
412 | ((u8 *) pg_tlv_hdr + | |
413 | sizeof(struct mwifiex_types_power_group)); | |
414 | ||
415 | if (pg->power_max == pg->power_min) | |
416 | priv->tx_power_level = (u16) pg->power_min; | |
5e6e3a92 BZ |
417 | break; |
418 | default: | |
419 | dev_err(adapter->dev, "CMD_RESP: unknown cmd action %d\n", | |
9c05fd72 | 420 | action); |
5e6e3a92 BZ |
421 | return 0; |
422 | } | |
423 | dev_dbg(adapter->dev, | |
424 | "info: Current TxPower Level = %d, Max Power=%d, Min Power=%d\n", | |
425 | priv->tx_power_level, priv->max_tx_power_level, | |
426 | priv->min_tx_power_level); | |
427 | ||
428 | return 0; | |
429 | } | |
430 | ||
caa8984f AK |
431 | /* |
432 | * This function handles the command response of get RF Tx power. | |
433 | */ | |
434 | static int mwifiex_ret_rf_tx_power(struct mwifiex_private *priv, | |
435 | struct host_cmd_ds_command *resp) | |
436 | { | |
437 | struct host_cmd_ds_rf_tx_pwr *txp = &resp->params.txp; | |
438 | u16 action = le16_to_cpu(txp->action); | |
439 | ||
440 | priv->tx_power_level = le16_to_cpu(txp->cur_level); | |
441 | ||
442 | if (action == HostCmd_ACT_GEN_GET) { | |
443 | priv->max_tx_power_level = txp->max_power; | |
444 | priv->min_tx_power_level = txp->min_power; | |
445 | } | |
446 | ||
447 | dev_dbg(priv->adapter->dev, | |
448 | "Current TxPower Level=%d, Max Power=%d, Min Power=%d\n", | |
449 | priv->tx_power_level, priv->max_tx_power_level, | |
450 | priv->min_tx_power_level); | |
451 | ||
452 | return 0; | |
453 | } | |
454 | ||
8a279d5b AK |
455 | /* |
456 | * This function handles the command response of set rf antenna | |
457 | */ | |
458 | static int mwifiex_ret_rf_antenna(struct mwifiex_private *priv, | |
459 | struct host_cmd_ds_command *resp) | |
460 | { | |
461 | struct host_cmd_ds_rf_ant_mimo *ant_mimo = &resp->params.ant_mimo; | |
462 | struct host_cmd_ds_rf_ant_siso *ant_siso = &resp->params.ant_siso; | |
463 | struct mwifiex_adapter *adapter = priv->adapter; | |
464 | ||
465 | if (adapter->hw_dev_mcs_support == HT_STREAM_2X2) | |
466 | dev_dbg(adapter->dev, | |
467 | "RF_ANT_RESP: Tx action = 0x%x, Tx Mode = 0x%04x" | |
468 | " Rx action = 0x%x, Rx Mode = 0x%04x\n", | |
469 | le16_to_cpu(ant_mimo->action_tx), | |
470 | le16_to_cpu(ant_mimo->tx_ant_mode), | |
471 | le16_to_cpu(ant_mimo->action_rx), | |
472 | le16_to_cpu(ant_mimo->rx_ant_mode)); | |
473 | else | |
474 | dev_dbg(adapter->dev, | |
475 | "RF_ANT_RESP: action = 0x%x, Mode = 0x%04x\n", | |
476 | le16_to_cpu(ant_siso->action), | |
477 | le16_to_cpu(ant_siso->ant_mode)); | |
478 | ||
479 | return 0; | |
480 | } | |
481 | ||
5e6e3a92 BZ |
482 | /* |
483 | * This function handles the command response of set/get MAC address. | |
484 | * | |
485 | * Handling includes saving the MAC address in driver. | |
486 | */ | |
487 | static int mwifiex_ret_802_11_mac_address(struct mwifiex_private *priv, | |
488 | struct host_cmd_ds_command *resp) | |
489 | { | |
490 | struct host_cmd_ds_802_11_mac_address *cmd_mac_addr = | |
9c05fd72 | 491 | &resp->params.mac_addr; |
5e6e3a92 BZ |
492 | |
493 | memcpy(priv->curr_addr, cmd_mac_addr->mac_addr, ETH_ALEN); | |
494 | ||
495 | dev_dbg(priv->adapter->dev, | |
496 | "info: set mac address: %pM\n", priv->curr_addr); | |
497 | ||
498 | return 0; | |
499 | } | |
500 | ||
501 | /* | |
502 | * This function handles the command response of set/get MAC multicast | |
503 | * address. | |
504 | */ | |
505 | static int mwifiex_ret_mac_multicast_adr(struct mwifiex_private *priv, | |
506 | struct host_cmd_ds_command *resp) | |
507 | { | |
508 | return 0; | |
509 | } | |
510 | ||
511 | /* | |
512 | * This function handles the command response of get Tx rate query. | |
513 | * | |
514 | * Handling includes changing the header fields into CPU format | |
515 | * and saving the Tx rate and HT information parameters in driver. | |
516 | * | |
517 | * Both rate configuration and current data rate can be retrieved | |
518 | * with this request. | |
519 | */ | |
520 | static int mwifiex_ret_802_11_tx_rate_query(struct mwifiex_private *priv, | |
521 | struct host_cmd_ds_command *resp) | |
522 | { | |
5e6e3a92 BZ |
523 | priv->tx_rate = resp->params.tx_rate.tx_rate; |
524 | priv->tx_htinfo = resp->params.tx_rate.ht_info; | |
525 | if (!priv->is_data_rate_auto) | |
526 | priv->data_rate = | |
e3bea1c8 | 527 | mwifiex_index_to_data_rate(priv, priv->tx_rate, |
5e6e3a92 BZ |
528 | priv->tx_htinfo); |
529 | ||
530 | return 0; | |
531 | } | |
532 | ||
533 | /* | |
534 | * This function handles the command response of a deauthenticate | |
535 | * command. | |
536 | * | |
537 | * If the deauthenticated MAC matches the current BSS MAC, the connection | |
538 | * state is reset. | |
539 | */ | |
540 | static int mwifiex_ret_802_11_deauthenticate(struct mwifiex_private *priv, | |
541 | struct host_cmd_ds_command *resp) | |
542 | { | |
543 | struct mwifiex_adapter *adapter = priv->adapter; | |
544 | ||
545 | adapter->dbg.num_cmd_deauth++; | |
546 | if (!memcmp(resp->params.deauth.mac_addr, | |
547 | &priv->curr_bss_params.bss_descriptor.mac_address, | |
548 | sizeof(resp->params.deauth.mac_addr))) | |
8cc1d523 | 549 | mwifiex_reset_connect_state(priv, WLAN_REASON_DEAUTH_LEAVING); |
5e6e3a92 BZ |
550 | |
551 | return 0; | |
552 | } | |
553 | ||
554 | /* | |
555 | * This function handles the command response of ad-hoc stop. | |
556 | * | |
557 | * The function resets the connection state in driver. | |
558 | */ | |
559 | static int mwifiex_ret_802_11_ad_hoc_stop(struct mwifiex_private *priv, | |
560 | struct host_cmd_ds_command *resp) | |
561 | { | |
8cc1d523 | 562 | mwifiex_reset_connect_state(priv, WLAN_REASON_DEAUTH_LEAVING); |
5e6e3a92 BZ |
563 | return 0; |
564 | } | |
565 | ||
566 | /* | |
567 | * This function handles the command response of set/get key material. | |
568 | * | |
569 | * Handling includes updating the driver parameters to reflect the | |
570 | * changes. | |
571 | */ | |
572 | static int mwifiex_ret_802_11_key_material(struct mwifiex_private *priv, | |
573 | struct host_cmd_ds_command *resp) | |
574 | { | |
575 | struct host_cmd_ds_802_11_key_material *key = | |
9c05fd72 | 576 | &resp->params.key_material; |
5e6e3a92 BZ |
577 | |
578 | if (le16_to_cpu(key->action) == HostCmd_ACT_GEN_SET) { | |
6a35a0ac | 579 | if ((le16_to_cpu(key->key_param_set.key_info) & KEY_MCAST)) { |
5e6e3a92 BZ |
580 | dev_dbg(priv->adapter->dev, "info: key: GTK is set\n"); |
581 | priv->wpa_is_gtk_set = true; | |
582 | priv->scan_block = false; | |
583 | } | |
584 | } | |
585 | ||
586 | memset(priv->aes_key.key_param_set.key, 0, | |
587 | sizeof(key->key_param_set.key)); | |
588 | priv->aes_key.key_param_set.key_len = key->key_param_set.key_len; | |
589 | memcpy(priv->aes_key.key_param_set.key, key->key_param_set.key, | |
590 | le16_to_cpu(priv->aes_key.key_param_set.key_len)); | |
591 | ||
592 | return 0; | |
593 | } | |
594 | ||
595 | /* | |
596 | * This function handles the command response of get 11d domain information. | |
597 | */ | |
598 | static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv, | |
599 | struct host_cmd_ds_command *resp) | |
600 | { | |
601 | struct host_cmd_ds_802_11d_domain_info_rsp *domain_info = | |
602 | &resp->params.domain_info_resp; | |
603 | struct mwifiex_ietypes_domain_param_set *domain = &domain_info->domain; | |
604 | u16 action = le16_to_cpu(domain_info->action); | |
270e58e8 | 605 | u8 no_of_triplet; |
5e6e3a92 | 606 | |
9c05fd72 YAP |
607 | no_of_triplet = (u8) ((le16_to_cpu(domain->header.len) |
608 | - IEEE80211_COUNTRY_STRING_LEN) | |
609 | / sizeof(struct ieee80211_country_ie_triplet)); | |
5e6e3a92 | 610 | |
9c05fd72 YAP |
611 | dev_dbg(priv->adapter->dev, |
612 | "info: 11D Domain Info Resp: no_of_triplet=%d\n", | |
613 | no_of_triplet); | |
5e6e3a92 BZ |
614 | |
615 | if (no_of_triplet > MWIFIEX_MAX_TRIPLET_802_11D) { | |
616 | dev_warn(priv->adapter->dev, | |
9c05fd72 YAP |
617 | "11D: invalid number of triplets %d returned\n", |
618 | no_of_triplet); | |
5e6e3a92 BZ |
619 | return -1; |
620 | } | |
621 | ||
622 | switch (action) { | |
623 | case HostCmd_ACT_GEN_SET: /* Proc Set Action */ | |
624 | break; | |
625 | case HostCmd_ACT_GEN_GET: | |
626 | break; | |
627 | default: | |
628 | dev_err(priv->adapter->dev, | |
629 | "11D: invalid action:%d\n", domain_info->action); | |
630 | return -1; | |
631 | } | |
632 | ||
633 | return 0; | |
634 | } | |
635 | ||
5e6e3a92 BZ |
636 | /* |
637 | * This function handles the command response of get extended version. | |
638 | * | |
639 | * Handling includes forming the extended version string and sending it | |
640 | * to application. | |
641 | */ | |
642 | static int mwifiex_ret_ver_ext(struct mwifiex_private *priv, | |
643 | struct host_cmd_ds_command *resp, | |
a5ffddb7 | 644 | struct host_cmd_ds_version_ext *version_ext) |
5e6e3a92 BZ |
645 | { |
646 | struct host_cmd_ds_version_ext *ver_ext = &resp->params.verext; | |
5e6e3a92 | 647 | |
a5ffddb7 | 648 | if (version_ext) { |
5e6e3a92 BZ |
649 | version_ext->version_str_sel = ver_ext->version_str_sel; |
650 | memcpy(version_ext->version_str, ver_ext->version_str, | |
651 | sizeof(char) * 128); | |
652 | memcpy(priv->version_str, ver_ext->version_str, 128); | |
653 | } | |
654 | return 0; | |
655 | } | |
656 | ||
7feb4c48 SP |
657 | /* |
658 | * This function handles the command response of remain on channel. | |
659 | */ | |
660 | static int | |
661 | mwifiex_ret_remain_on_chan(struct mwifiex_private *priv, | |
662 | struct host_cmd_ds_command *resp, | |
663 | struct host_cmd_ds_remain_on_chan *roc_cfg) | |
664 | { | |
665 | struct host_cmd_ds_remain_on_chan *resp_cfg = &resp->params.roc_cfg; | |
666 | ||
667 | if (roc_cfg) | |
668 | memcpy(roc_cfg, resp_cfg, sizeof(*roc_cfg)); | |
669 | ||
670 | return 0; | |
671 | } | |
672 | ||
e1a2b7a3 SP |
673 | /* |
674 | * This function handles the command response of P2P mode cfg. | |
675 | */ | |
676 | static int | |
677 | mwifiex_ret_p2p_mode_cfg(struct mwifiex_private *priv, | |
678 | struct host_cmd_ds_command *resp, | |
679 | void *data_buf) | |
680 | { | |
681 | struct host_cmd_ds_p2p_mode_cfg *mode_cfg = &resp->params.mode_cfg; | |
682 | ||
683 | if (data_buf) | |
684 | *((u16 *)data_buf) = le16_to_cpu(mode_cfg->mode); | |
685 | ||
686 | return 0; | |
687 | } | |
688 | ||
5e6e3a92 BZ |
689 | /* |
690 | * This function handles the command response of register access. | |
691 | * | |
692 | * The register value and offset are returned to the user. For EEPROM | |
693 | * access, the byte count is also returned. | |
694 | */ | |
695 | static int mwifiex_ret_reg_access(u16 type, struct host_cmd_ds_command *resp, | |
696 | void *data_buf) | |
697 | { | |
270e58e8 YAP |
698 | struct mwifiex_ds_reg_rw *reg_rw; |
699 | struct mwifiex_ds_read_eeprom *eeprom; | |
985d68a3 YAP |
700 | union reg { |
701 | struct host_cmd_ds_mac_reg_access *mac; | |
702 | struct host_cmd_ds_bbp_reg_access *bbp; | |
703 | struct host_cmd_ds_rf_reg_access *rf; | |
704 | struct host_cmd_ds_pmic_reg_access *pmic; | |
705 | struct host_cmd_ds_802_11_eeprom_access *eeprom; | |
706 | } r; | |
707 | ||
708 | if (!data_buf) | |
709 | return 0; | |
5e6e3a92 | 710 | |
985d68a3 YAP |
711 | reg_rw = data_buf; |
712 | eeprom = data_buf; | |
713 | switch (type) { | |
714 | case HostCmd_CMD_MAC_REG_ACCESS: | |
2c208890 | 715 | r.mac = &resp->params.mac_reg; |
985d68a3 YAP |
716 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.mac->offset)); |
717 | reg_rw->value = r.mac->value; | |
718 | break; | |
719 | case HostCmd_CMD_BBP_REG_ACCESS: | |
2c208890 | 720 | r.bbp = &resp->params.bbp_reg; |
985d68a3 YAP |
721 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.bbp->offset)); |
722 | reg_rw->value = cpu_to_le32((u32) r.bbp->value); | |
723 | break; | |
5e6e3a92 | 724 | |
985d68a3 | 725 | case HostCmd_CMD_RF_REG_ACCESS: |
2c208890 | 726 | r.rf = &resp->params.rf_reg; |
985d68a3 YAP |
727 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); |
728 | reg_rw->value = cpu_to_le32((u32) r.bbp->value); | |
729 | break; | |
730 | case HostCmd_CMD_PMIC_REG_ACCESS: | |
2c208890 | 731 | r.pmic = &resp->params.pmic_reg; |
985d68a3 YAP |
732 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.pmic->offset)); |
733 | reg_rw->value = cpu_to_le32((u32) r.pmic->value); | |
734 | break; | |
735 | case HostCmd_CMD_CAU_REG_ACCESS: | |
2c208890 | 736 | r.rf = &resp->params.rf_reg; |
985d68a3 YAP |
737 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); |
738 | reg_rw->value = cpu_to_le32((u32) r.rf->value); | |
739 | break; | |
740 | case HostCmd_CMD_802_11_EEPROM_ACCESS: | |
2c208890 | 741 | r.eeprom = &resp->params.eeprom; |
985d68a3 YAP |
742 | pr_debug("info: EEPROM read len=%x\n", r.eeprom->byte_count); |
743 | if (le16_to_cpu(eeprom->byte_count) < | |
744 | le16_to_cpu(r.eeprom->byte_count)) { | |
745 | eeprom->byte_count = cpu_to_le16(0); | |
746 | pr_debug("info: EEPROM read length is too big\n"); | |
5e6e3a92 BZ |
747 | return -1; |
748 | } | |
985d68a3 YAP |
749 | eeprom->offset = r.eeprom->offset; |
750 | eeprom->byte_count = r.eeprom->byte_count; | |
751 | if (le16_to_cpu(eeprom->byte_count) > 0) | |
752 | memcpy(&eeprom->value, &r.eeprom->value, | |
753 | le16_to_cpu(r.eeprom->byte_count)); | |
754 | ||
755 | break; | |
756 | default: | |
757 | return -1; | |
5e6e3a92 BZ |
758 | } |
759 | return 0; | |
760 | } | |
761 | ||
762 | /* | |
763 | * This function handles the command response of get IBSS coalescing status. | |
764 | * | |
765 | * If the received BSSID is different than the current one, the current BSSID, | |
766 | * beacon interval, ATIM window and ERP information are updated, along with | |
767 | * changing the ad-hoc state accordingly. | |
768 | */ | |
769 | static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv, | |
770 | struct host_cmd_ds_command *resp) | |
771 | { | |
772 | struct host_cmd_ds_802_11_ibss_status *ibss_coal_resp = | |
9c05fd72 | 773 | &(resp->params.ibss_coalescing); |
5e6e3a92 BZ |
774 | |
775 | if (le16_to_cpu(ibss_coal_resp->action) == HostCmd_ACT_GEN_SET) | |
776 | return 0; | |
777 | ||
778 | dev_dbg(priv->adapter->dev, | |
779 | "info: new BSSID %pM\n", ibss_coal_resp->bssid); | |
780 | ||
781 | /* If rsp has NULL BSSID, Just return..... No Action */ | |
626a43de | 782 | if (is_zero_ether_addr(ibss_coal_resp->bssid)) { |
5e6e3a92 BZ |
783 | dev_warn(priv->adapter->dev, "new BSSID is NULL\n"); |
784 | return 0; | |
785 | } | |
786 | ||
787 | /* If BSSID is diff, modify current BSS parameters */ | |
788 | if (memcmp(priv->curr_bss_params.bss_descriptor.mac_address, | |
789 | ibss_coal_resp->bssid, ETH_ALEN)) { | |
790 | /* BSSID */ | |
791 | memcpy(priv->curr_bss_params.bss_descriptor.mac_address, | |
792 | ibss_coal_resp->bssid, ETH_ALEN); | |
793 | ||
794 | /* Beacon Interval */ | |
795 | priv->curr_bss_params.bss_descriptor.beacon_period | |
796 | = le16_to_cpu(ibss_coal_resp->beacon_interval); | |
797 | ||
798 | /* ERP Information */ | |
799 | priv->curr_bss_params.bss_descriptor.erp_flags = | |
800 | (u8) le16_to_cpu(ibss_coal_resp->use_g_rate_protect); | |
801 | ||
802 | priv->adhoc_state = ADHOC_COALESCED; | |
803 | } | |
804 | ||
805 | return 0; | |
806 | } | |
807 | ||
fa444bf8 AK |
808 | /* |
809 | * This function handles the command response for subscribe event command. | |
810 | */ | |
811 | static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv, | |
e69d1ff1 | 812 | struct host_cmd_ds_command *resp) |
fa444bf8 AK |
813 | { |
814 | struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event = | |
2c208890 | 815 | &resp->params.subsc_evt; |
fa444bf8 AK |
816 | |
817 | /* For every subscribe event command (Get/Set/Clear), FW reports the | |
818 | * current set of subscribed events*/ | |
819 | dev_dbg(priv->adapter->dev, "Bitmap of currently subscribed events: %16x\n", | |
820 | le16_to_cpu(cmd_sub_event->events)); | |
821 | ||
fa444bf8 AK |
822 | return 0; |
823 | } | |
824 | ||
388ec385 AK |
825 | /* This function handles the command response of set_cfg_data */ |
826 | static int mwifiex_ret_cfg_data(struct mwifiex_private *priv, | |
827 | struct host_cmd_ds_command *resp) | |
828 | { | |
829 | if (resp->result != HostCmd_RESULT_OK) { | |
830 | dev_err(priv->adapter->dev, "Cal data cmd resp failed\n"); | |
831 | return -1; | |
832 | } | |
833 | ||
834 | return 0; | |
835 | } | |
836 | ||
5e6e3a92 BZ |
837 | /* |
838 | * This function handles the command responses. | |
839 | * | |
840 | * This is a generic function, which calls command specific | |
841 | * response handlers based on the command ID. | |
842 | */ | |
a5ffddb7 AK |
843 | int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no, |
844 | struct host_cmd_ds_command *resp) | |
5e6e3a92 BZ |
845 | { |
846 | int ret = 0; | |
847 | struct mwifiex_adapter *adapter = priv->adapter; | |
5e6e3a92 BZ |
848 | void *data_buf = adapter->curr_cmd->data_buf; |
849 | ||
850 | /* If the command is not successful, cleanup and return failure */ | |
851 | if (resp->result != HostCmd_RESULT_OK) { | |
600f5d90 | 852 | mwifiex_process_cmdresp_error(priv, resp); |
5e6e3a92 BZ |
853 | return -1; |
854 | } | |
855 | /* Command successful, handle response */ | |
856 | switch (cmdresp_no) { | |
857 | case HostCmd_CMD_GET_HW_SPEC: | |
858 | ret = mwifiex_ret_get_hw_spec(priv, resp); | |
859 | break; | |
388ec385 AK |
860 | case HostCmd_CMD_CFG_DATA: |
861 | ret = mwifiex_ret_cfg_data(priv, resp); | |
862 | break; | |
5e6e3a92 BZ |
863 | case HostCmd_CMD_MAC_CONTROL: |
864 | break; | |
865 | case HostCmd_CMD_802_11_MAC_ADDRESS: | |
866 | ret = mwifiex_ret_802_11_mac_address(priv, resp); | |
867 | break; | |
868 | case HostCmd_CMD_MAC_MULTICAST_ADR: | |
869 | ret = mwifiex_ret_mac_multicast_adr(priv, resp); | |
870 | break; | |
871 | case HostCmd_CMD_TX_RATE_CFG: | |
006606c0 | 872 | ret = mwifiex_ret_tx_rate_cfg(priv, resp); |
5e6e3a92 BZ |
873 | break; |
874 | case HostCmd_CMD_802_11_SCAN: | |
600f5d90 AK |
875 | ret = mwifiex_ret_802_11_scan(priv, resp); |
876 | adapter->curr_cmd->wait_q_enabled = false; | |
5e6e3a92 BZ |
877 | break; |
878 | case HostCmd_CMD_802_11_BG_SCAN_QUERY: | |
600f5d90 | 879 | ret = mwifiex_ret_802_11_scan(priv, resp); |
5e6e3a92 BZ |
880 | dev_dbg(adapter->dev, |
881 | "info: CMD_RESP: BG_SCAN result is ready!\n"); | |
882 | break; | |
883 | case HostCmd_CMD_TXPWR_CFG: | |
a5ffddb7 | 884 | ret = mwifiex_ret_tx_power_cfg(priv, resp); |
5e6e3a92 | 885 | break; |
caa8984f AK |
886 | case HostCmd_CMD_RF_TX_PWR: |
887 | ret = mwifiex_ret_rf_tx_power(priv, resp); | |
888 | break; | |
8a279d5b AK |
889 | case HostCmd_CMD_RF_ANTENNA: |
890 | ret = mwifiex_ret_rf_antenna(priv, resp); | |
891 | break; | |
5e6e3a92 BZ |
892 | case HostCmd_CMD_802_11_PS_MODE_ENH: |
893 | ret = mwifiex_ret_enh_power_mode(priv, resp, data_buf); | |
894 | break; | |
895 | case HostCmd_CMD_802_11_HS_CFG_ENH: | |
896 | ret = mwifiex_ret_802_11_hs_cfg(priv, resp); | |
897 | break; | |
898 | case HostCmd_CMD_802_11_ASSOCIATE: | |
600f5d90 | 899 | ret = mwifiex_ret_802_11_associate(priv, resp); |
5e6e3a92 BZ |
900 | break; |
901 | case HostCmd_CMD_802_11_DEAUTHENTICATE: | |
902 | ret = mwifiex_ret_802_11_deauthenticate(priv, resp); | |
903 | break; | |
904 | case HostCmd_CMD_802_11_AD_HOC_START: | |
905 | case HostCmd_CMD_802_11_AD_HOC_JOIN: | |
600f5d90 | 906 | ret = mwifiex_ret_802_11_ad_hoc(priv, resp); |
5e6e3a92 BZ |
907 | break; |
908 | case HostCmd_CMD_802_11_AD_HOC_STOP: | |
909 | ret = mwifiex_ret_802_11_ad_hoc_stop(priv, resp); | |
910 | break; | |
911 | case HostCmd_CMD_802_11_GET_LOG: | |
912 | ret = mwifiex_ret_get_log(priv, resp, data_buf); | |
913 | break; | |
914 | case HostCmd_CMD_RSSI_INFO: | |
958a4a86 | 915 | ret = mwifiex_ret_802_11_rssi_info(priv, resp); |
5e6e3a92 BZ |
916 | break; |
917 | case HostCmd_CMD_802_11_SNMP_MIB: | |
918 | ret = mwifiex_ret_802_11_snmp_mib(priv, resp, data_buf); | |
919 | break; | |
920 | case HostCmd_CMD_802_11_TX_RATE_QUERY: | |
921 | ret = mwifiex_ret_802_11_tx_rate_query(priv, resp); | |
922 | break; | |
5e6e3a92 BZ |
923 | case HostCmd_CMD_VERSION_EXT: |
924 | ret = mwifiex_ret_ver_ext(priv, resp, data_buf); | |
925 | break; | |
7feb4c48 SP |
926 | case HostCmd_CMD_REMAIN_ON_CHAN: |
927 | ret = mwifiex_ret_remain_on_chan(priv, resp, data_buf); | |
928 | break; | |
83c78da9 YAP |
929 | case HostCmd_CMD_11AC_CFG: |
930 | break; | |
e1a2b7a3 SP |
931 | case HostCmd_CMD_P2P_MODE_CFG: |
932 | ret = mwifiex_ret_p2p_mode_cfg(priv, resp, data_buf); | |
933 | break; | |
3cec6870 | 934 | case HostCmd_CMD_MGMT_FRAME_REG: |
5e6e3a92 BZ |
935 | case HostCmd_CMD_FUNC_INIT: |
936 | case HostCmd_CMD_FUNC_SHUTDOWN: | |
937 | break; | |
938 | case HostCmd_CMD_802_11_KEY_MATERIAL: | |
939 | ret = mwifiex_ret_802_11_key_material(priv, resp); | |
940 | break; | |
941 | case HostCmd_CMD_802_11D_DOMAIN_INFO: | |
942 | ret = mwifiex_ret_802_11d_domain_info(priv, resp); | |
943 | break; | |
944 | case HostCmd_CMD_11N_ADDBA_REQ: | |
945 | ret = mwifiex_ret_11n_addba_req(priv, resp); | |
946 | break; | |
947 | case HostCmd_CMD_11N_DELBA: | |
948 | ret = mwifiex_ret_11n_delba(priv, resp); | |
949 | break; | |
950 | case HostCmd_CMD_11N_ADDBA_RSP: | |
951 | ret = mwifiex_ret_11n_addba_resp(priv, resp); | |
952 | break; | |
953 | case HostCmd_CMD_RECONFIGURE_TX_BUFF: | |
954 | adapter->tx_buf_size = (u16) le16_to_cpu(resp->params. | |
955 | tx_buf.buff_size); | |
9c05fd72 YAP |
956 | adapter->tx_buf_size = (adapter->tx_buf_size |
957 | / MWIFIEX_SDIO_BLOCK_SIZE) | |
958 | * MWIFIEX_SDIO_BLOCK_SIZE; | |
5e6e3a92 | 959 | adapter->curr_tx_buf_size = adapter->tx_buf_size; |
5e3175fb BZ |
960 | dev_dbg(adapter->dev, "cmd: curr_tx_buf_size=%d\n", |
961 | adapter->curr_tx_buf_size); | |
5e6e3a92 BZ |
962 | |
963 | if (adapter->if_ops.update_mp_end_port) | |
964 | adapter->if_ops.update_mp_end_port(adapter, | |
9c05fd72 | 965 | le16_to_cpu(resp->params.tx_buf.mp_end_port)); |
5e6e3a92 BZ |
966 | break; |
967 | case HostCmd_CMD_AMSDU_AGGR_CTRL: | |
5e6e3a92 BZ |
968 | break; |
969 | case HostCmd_CMD_WMM_GET_STATUS: | |
970 | ret = mwifiex_ret_wmm_get_status(priv, resp); | |
971 | break; | |
972 | case HostCmd_CMD_802_11_IBSS_COALESCING_STATUS: | |
973 | ret = mwifiex_ret_ibss_coalescing_status(priv, resp); | |
974 | break; | |
975 | case HostCmd_CMD_MAC_REG_ACCESS: | |
976 | case HostCmd_CMD_BBP_REG_ACCESS: | |
977 | case HostCmd_CMD_RF_REG_ACCESS: | |
978 | case HostCmd_CMD_PMIC_REG_ACCESS: | |
979 | case HostCmd_CMD_CAU_REG_ACCESS: | |
980 | case HostCmd_CMD_802_11_EEPROM_ACCESS: | |
981 | ret = mwifiex_ret_reg_access(cmdresp_no, resp, data_buf); | |
982 | break; | |
983 | case HostCmd_CMD_SET_BSS_MODE: | |
984 | break; | |
985 | case HostCmd_CMD_11N_CFG: | |
5e6e3a92 | 986 | break; |
d930faee AK |
987 | case HostCmd_CMD_PCIE_DESC_DETAILS: |
988 | break; | |
fa444bf8 | 989 | case HostCmd_CMD_802_11_SUBSCRIBE_EVENT: |
e69d1ff1 | 990 | ret = mwifiex_ret_subsc_evt(priv, resp); |
fa444bf8 | 991 | break; |
40d07030 AP |
992 | case HostCmd_CMD_UAP_SYS_CONFIG: |
993 | break; | |
994 | case HostCmd_CMD_UAP_BSS_START: | |
995 | priv->bss_started = 1; | |
996 | break; | |
997 | case HostCmd_CMD_UAP_BSS_STOP: | |
998 | priv->bss_started = 0; | |
999 | break; | |
0f9e9b8b AP |
1000 | case HostCmd_CMD_UAP_STA_DEAUTH: |
1001 | break; | |
7da060c1 AK |
1002 | case HostCmd_CMD_MEF_CFG: |
1003 | break; | |
562fc5b3 AK |
1004 | case HostCmd_CMD_COALESCE_CFG: |
1005 | break; | |
5e6e3a92 BZ |
1006 | default: |
1007 | dev_err(adapter->dev, "CMD_RESP: unknown cmd response %#x\n", | |
9c05fd72 | 1008 | resp->command); |
5e6e3a92 BZ |
1009 | break; |
1010 | } | |
1011 | ||
1012 | return ret; | |
1013 | } |