sta_cmdresp.c 33 KB

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