wmi_unified_smart_ant_tlv.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. /*
  2. * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #include <osdep.h>
  19. #include "wmi.h"
  20. #include "wmi_unified_priv.h"
  21. #include "wmi_unified_smart_ant_param.h"
  22. #include "wmi_unified_smart_ant_api.h"
  23. /**
  24. * send_smart_ant_enable_cmd_tlv() - WMI smart ant enable function
  25. *
  26. * @param wmi_handle : handle to WMI.
  27. * @param param : pointer to antenna param
  28. *
  29. * This function sends smart antenna enable command to FW
  30. *
  31. * @return QDF_STATUS_SUCCESS on success and -ve on failure.
  32. */
  33. static QDF_STATUS send_smart_ant_enable_cmd_tlv(wmi_unified_t wmi_handle,
  34. struct smart_ant_enable_params *param)
  35. {
  36. /* Send WMI COMMAND to Enable */
  37. wmi_pdev_smart_ant_enable_cmd_fixed_param *cmd;
  38. wmi_pdev_smart_ant_gpio_handle *gpio_param;
  39. wmi_buf_t buf;
  40. uint8_t *buf_ptr;
  41. int len = 0;
  42. QDF_STATUS ret;
  43. int loop = 0;
  44. len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
  45. len += WMI_HAL_MAX_SANTENNA * sizeof(wmi_pdev_smart_ant_gpio_handle);
  46. buf = wmi_buf_alloc(wmi_handle, len);
  47. if (!buf) {
  48. WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
  49. return QDF_STATUS_E_NOMEM;
  50. }
  51. buf_ptr = wmi_buf_data(buf);
  52. qdf_mem_zero(buf_ptr, len);
  53. cmd = (wmi_pdev_smart_ant_enable_cmd_fixed_param *)buf_ptr;
  54. WMITLV_SET_HDR(&cmd->tlv_header,
  55. WMITLV_TAG_STRUC_wmi_pdev_smart_ant_enable_cmd_fixed_param,
  56. WMITLV_GET_STRUCT_TLVLEN(
  57. wmi_pdev_smart_ant_enable_cmd_fixed_param));
  58. cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(
  59. param->pdev_id);
  60. cmd->enable = param->enable;
  61. cmd->mode = param->mode;
  62. cmd->rx_antenna = param->rx_antenna;
  63. cmd->tx_default_antenna = param->rx_antenna;
  64. /* TLV indicating array of structures to follow */
  65. buf_ptr += sizeof(wmi_pdev_smart_ant_enable_cmd_fixed_param);
  66. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
  67. WMI_HAL_MAX_SANTENNA *
  68. sizeof(wmi_pdev_smart_ant_gpio_handle));
  69. buf_ptr += WMI_TLV_HDR_SIZE;
  70. gpio_param = (wmi_pdev_smart_ant_gpio_handle *)buf_ptr;
  71. for (loop = 0; loop < WMI_HAL_MAX_SANTENNA; loop++) {
  72. WMITLV_SET_HDR(&gpio_param->tlv_header,
  73. WMITLV_TAG_STRUC_wmi_pdev_smart_ant_gpio_handle,
  74. WMITLV_GET_STRUCT_TLVLEN(
  75. wmi_pdev_smart_ant_gpio_handle));
  76. if (param->mode == SMART_ANT_MODE_SERIAL) {
  77. if (loop < WMI_HOST_MAX_SERIAL_ANTENNA) {
  78. gpio_param->gpio_pin = param->gpio_pin[loop];
  79. gpio_param->gpio_func = param->gpio_func[loop];
  80. } else {
  81. gpio_param->gpio_pin = 0;
  82. gpio_param->gpio_func = 0;
  83. }
  84. } else if (param->mode == SMART_ANT_MODE_PARALLEL) {
  85. gpio_param->gpio_pin = param->gpio_pin[loop];
  86. gpio_param->gpio_func = param->gpio_func[loop];
  87. }
  88. /* Setting it to 0 for now */
  89. gpio_param->pdev_id =
  90. wmi_handle->ops->convert_pdev_id_host_to_target(
  91. param->pdev_id);
  92. gpio_param++;
  93. }
  94. wmi_mtrace(WMI_PDEV_SMART_ANT_ENABLE_CMDID, NO_SESSION, 0);
  95. ret = wmi_unified_cmd_send(wmi_handle,
  96. buf,
  97. len,
  98. WMI_PDEV_SMART_ANT_ENABLE_CMDID);
  99. if (ret != 0) {
  100. WMI_LOGE(" %s :WMI Failed\n", __func__);
  101. WMI_LOGE("enable:%d mode:%d rx_antenna: 0x%08x PINS: [%d %d %d %d] Func[%d %d %d %d] cmdstatus=%d\n",
  102. cmd->enable,
  103. cmd->mode,
  104. cmd->rx_antenna,
  105. param->gpio_pin[0], param->gpio_pin[1],
  106. param->gpio_pin[2], param->gpio_pin[3],
  107. param->gpio_func[0], param->gpio_func[1],
  108. param->gpio_func[2], param->gpio_func[3],
  109. ret);
  110. wmi_buf_free(buf);
  111. }
  112. return ret;
  113. }
  114. /**
  115. * send_smart_ant_set_rx_ant_cmd_tlv() - WMI set rx antenna function
  116. *
  117. * @param wmi_handle : handle to WMI.
  118. * @param param : pointer to rx antenna param
  119. * @return QDF_STATUS_SUCCESS on success and -ve on failure.
  120. */
  121. static QDF_STATUS send_smart_ant_set_rx_ant_cmd_tlv(wmi_unified_t wmi_handle,
  122. struct smart_ant_rx_ant_params *param)
  123. {
  124. wmi_pdev_smart_ant_set_rx_antenna_cmd_fixed_param *cmd;
  125. wmi_buf_t buf;
  126. uint8_t *buf_ptr;
  127. uint32_t len;
  128. QDF_STATUS ret;
  129. len = sizeof(*cmd);
  130. buf = wmi_buf_alloc(wmi_handle, len);
  131. WMI_LOGD("%s:\n", __func__);
  132. if (!buf) {
  133. WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
  134. return QDF_STATUS_E_NOMEM;
  135. }
  136. buf_ptr = wmi_buf_data(buf);
  137. cmd = (wmi_pdev_smart_ant_set_rx_antenna_cmd_fixed_param *)buf_ptr;
  138. WMITLV_SET_HDR(&cmd->tlv_header,
  139. WMITLV_TAG_STRUC_wmi_pdev_smart_ant_set_rx_antenna_cmd_fixed_param,
  140. WMITLV_GET_STRUCT_TLVLEN(
  141. wmi_pdev_smart_ant_set_rx_antenna_cmd_fixed_param));
  142. cmd->rx_antenna = param->antenna;
  143. cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(
  144. param->pdev_id);
  145. wmi_mtrace(WMI_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID, NO_SESSION, 0);
  146. ret = wmi_unified_cmd_send(wmi_handle,
  147. buf,
  148. len,
  149. WMI_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID);
  150. if (ret != 0) {
  151. WMI_LOGE(" %s :WMI Failed\n", __func__);
  152. WMI_LOGE("%s: rx_antenna: 0x%08x cmdstatus=%d\n",
  153. __func__,
  154. cmd->rx_antenna,
  155. ret);
  156. wmi_buf_free(buf);
  157. }
  158. return ret;
  159. }
  160. /**
  161. * send_smart_ant_set_tx_ant_cmd_tlv() - WMI set tx antenna function
  162. * @param wmi_handle : handle to WMI.
  163. * @param macaddr : vdev mac address
  164. * @param param : pointer to tx antenna param
  165. *
  166. * @return QDF_STATUS_SUCCESS on success and -ve on failure.
  167. */
  168. static QDF_STATUS send_smart_ant_set_tx_ant_cmd_tlv(wmi_unified_t wmi_handle,
  169. uint8_t macaddr[IEEE80211_ADDR_LEN],
  170. struct smart_ant_tx_ant_params *param)
  171. {
  172. wmi_peer_smart_ant_set_tx_antenna_cmd_fixed_param *cmd;
  173. wmi_peer_smart_ant_set_tx_antenna_series *ant_tx_series;
  174. wmi_buf_t buf;
  175. int32_t len = 0;
  176. int i;
  177. uint8_t *buf_ptr;
  178. QDF_STATUS ret;
  179. len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
  180. len += (WMI_SMART_ANT_MAX_RATE_SERIES) *
  181. sizeof(wmi_peer_smart_ant_set_tx_antenna_series);
  182. buf = wmi_buf_alloc(wmi_handle, len);
  183. if (!buf) {
  184. WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
  185. return QDF_STATUS_E_NOMEM;
  186. }
  187. buf_ptr = (uint8_t *)wmi_buf_data(buf);
  188. qdf_mem_zero(buf_ptr, len);
  189. cmd = (wmi_peer_smart_ant_set_tx_antenna_cmd_fixed_param *)buf_ptr;
  190. WMITLV_SET_HDR(&cmd->tlv_header,
  191. WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_tx_antenna_cmd_fixed_param,
  192. WMITLV_GET_STRUCT_TLVLEN(
  193. wmi_peer_smart_ant_set_tx_antenna_cmd_fixed_param));
  194. cmd->vdev_id = param->vdev_id;
  195. WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
  196. buf_ptr += sizeof(wmi_peer_smart_ant_set_tx_antenna_cmd_fixed_param);
  197. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
  198. sizeof(wmi_peer_smart_ant_set_tx_antenna_series));
  199. buf_ptr += WMI_TLV_HDR_SIZE;
  200. ant_tx_series = (wmi_peer_smart_ant_set_tx_antenna_series *)buf_ptr;
  201. for (i = 0; i < WMI_SMART_ANT_MAX_RATE_SERIES; i++) {
  202. WMITLV_SET_HDR(&ant_tx_series->tlv_header,
  203. WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_tx_antenna_series,
  204. WMITLV_GET_STRUCT_TLVLEN(
  205. wmi_peer_smart_ant_set_tx_antenna_series));
  206. ant_tx_series->antenna_series = param->antenna_array[i];
  207. ant_tx_series++;
  208. }
  209. wmi_mtrace(WMI_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID, cmd->vdev_id, 0);
  210. ret = wmi_unified_cmd_send(wmi_handle,
  211. buf,
  212. len,
  213. WMI_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID);
  214. if (ret != 0) {
  215. WMI_LOGE(" %s :WMI Failed\n", __func__);
  216. wmi_buf_free(buf);
  217. }
  218. return ret;
  219. }
  220. /**
  221. * send_set_ant_switch_tbl_cmd_tlv() - send ant switch tbl cmd to fw
  222. * @wmi_handle: wmi handle
  223. * @param: pointer to hold ant switch tbl param
  224. *
  225. * @return QDF_STATUS_SUCCESS on success and -ve on failure.
  226. */
  227. static QDF_STATUS
  228. send_set_ant_switch_tbl_cmd_tlv(wmi_unified_t wmi_handle,
  229. struct ant_switch_tbl_params *param)
  230. {
  231. uint8_t len;
  232. wmi_buf_t buf;
  233. wmi_pdev_set_ant_switch_tbl_cmd_fixed_param *cmd;
  234. wmi_pdev_set_ant_ctrl_chain *ctrl_chain;
  235. uint8_t *buf_ptr;
  236. len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
  237. len += sizeof(wmi_pdev_set_ant_ctrl_chain);
  238. buf = wmi_buf_alloc(wmi_handle, len);
  239. if (!buf) {
  240. WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
  241. return QDF_STATUS_E_NOMEM;
  242. }
  243. buf_ptr = (uint8_t *)wmi_buf_data(buf);
  244. qdf_mem_zero(buf_ptr, len);
  245. cmd = (wmi_pdev_set_ant_switch_tbl_cmd_fixed_param *)buf_ptr;
  246. WMITLV_SET_HDR(&cmd->tlv_header,
  247. WMITLV_TAG_STRUC_wmi_pdev_set_ant_switch_tbl_cmd_fixed_param,
  248. WMITLV_GET_STRUCT_TLVLEN(
  249. wmi_pdev_set_ant_switch_tbl_cmd_fixed_param));
  250. cmd->antCtrlCommon1 = param->ant_ctrl_common1;
  251. cmd->antCtrlCommon2 = param->ant_ctrl_common2;
  252. cmd->mac_id =
  253. wmi_handle->ops->convert_pdev_id_host_to_target(param->pdev_id);
  254. /* TLV indicating array of structures to follow */
  255. buf_ptr += sizeof(wmi_pdev_set_ant_switch_tbl_cmd_fixed_param);
  256. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
  257. sizeof(wmi_pdev_set_ant_ctrl_chain));
  258. buf_ptr += WMI_TLV_HDR_SIZE;
  259. ctrl_chain = (wmi_pdev_set_ant_ctrl_chain *)buf_ptr;
  260. ctrl_chain->pdev_id =
  261. wmi_handle->ops->convert_pdev_id_host_to_target(param->pdev_id);
  262. ctrl_chain->antCtrlChain = param->antCtrlChain;
  263. wmi_mtrace(WMI_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID, NO_SESSION, 0);
  264. if (wmi_unified_cmd_send(wmi_handle, buf, len,
  265. WMI_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID)) {
  266. wmi_buf_free(buf);
  267. return QDF_STATUS_E_FAILURE;
  268. }
  269. return QDF_STATUS_SUCCESS;
  270. }
  271. /**
  272. * send_smart_ant_set_training_info_cmd_tlv() - WMI set smart antenna
  273. * training information function
  274. * @param wmi_handle : handle to WMI.
  275. * @macaddr : vdev mac address
  276. * @param param : pointer to tx antenna param
  277. * @return QDF_STATUS_SUCCESS on success and -ve on failure.
  278. */
  279. static QDF_STATUS send_smart_ant_set_training_info_cmd_tlv(
  280. wmi_unified_t wmi_handle,
  281. uint8_t macaddr[IEEE80211_ADDR_LEN],
  282. struct smart_ant_training_info_params *param)
  283. {
  284. wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param *cmd;
  285. wmi_peer_smart_ant_set_train_antenna_param *train_param;
  286. wmi_buf_t buf;
  287. uint8_t *buf_ptr;
  288. int32_t len = 0;
  289. QDF_STATUS ret;
  290. int loop;
  291. len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
  292. len += (WMI_SMART_ANT_MAX_RATE_SERIES) *
  293. sizeof(wmi_peer_smart_ant_set_train_antenna_param);
  294. buf = wmi_buf_alloc(wmi_handle, len);
  295. if (!buf) {
  296. WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
  297. return QDF_STATUS_E_NOMEM;
  298. }
  299. buf_ptr = (uint8_t *)wmi_buf_data(buf);
  300. qdf_mem_zero(buf_ptr, len);
  301. cmd = (wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param *)buf_ptr;
  302. WMITLV_SET_HDR(&cmd->tlv_header,
  303. WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param,
  304. WMITLV_GET_STRUCT_TLVLEN(
  305. wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param));
  306. cmd->vdev_id = param->vdev_id;
  307. WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
  308. cmd->num_pkts = param->numpkts;
  309. buf_ptr += sizeof(wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param);
  310. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
  311. sizeof(wmi_peer_smart_ant_set_train_antenna_param) *
  312. WMI_SMART_ANT_MAX_RATE_SERIES);
  313. buf_ptr += WMI_TLV_HDR_SIZE;
  314. train_param = (wmi_peer_smart_ant_set_train_antenna_param *)buf_ptr;
  315. for (loop = 0; loop < WMI_SMART_ANT_MAX_RATE_SERIES; loop++) {
  316. WMITLV_SET_HDR(&train_param->tlv_header,
  317. WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_train_antenna_param,
  318. WMITLV_GET_STRUCT_TLVLEN(
  319. wmi_peer_smart_ant_set_train_antenna_param));
  320. train_param->train_rate_series = param->rate_array[loop];
  321. train_param->train_antenna_series = param->antenna_array[loop];
  322. train_param->rc_flags = 0;
  323. WMI_LOGI(FL("Series number:%d\n"), loop);
  324. WMI_LOGI(FL("Rate [0x%02x] Tx_Antenna [0x%08x]\n"),
  325. train_param->train_rate_series,
  326. train_param->train_antenna_series);
  327. train_param++;
  328. }
  329. wmi_mtrace(WMI_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID, cmd->vdev_id, 0);
  330. ret = wmi_unified_cmd_send(wmi_handle,
  331. buf,
  332. len,
  333. WMI_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID);
  334. if (ret != 0) {
  335. WMI_LOGE(" %s :WMI Failed\n", __func__);
  336. wmi_buf_free(buf);
  337. return QDF_STATUS_E_FAILURE;
  338. }
  339. return ret;
  340. }
  341. /**
  342. * send_smart_ant_set_node_config_cmd_tlv() - WMI set node
  343. * configuration function
  344. * @param wmi_handle : handle to WMI.
  345. * @macaddr : vdev mad address
  346. * @param param : pointer to tx antenna param
  347. *
  348. * @return QDF_STATUS_SUCCESS on success and -ve on failure.
  349. */
  350. static QDF_STATUS send_smart_ant_set_node_config_cmd_tlv(
  351. wmi_unified_t wmi_handle,
  352. uint8_t macaddr[IEEE80211_ADDR_LEN],
  353. struct smart_ant_node_config_params *param)
  354. {
  355. wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param *cmd;
  356. wmi_buf_t buf;
  357. uint8_t *buf_ptr;
  358. int32_t len = 0, args_tlv_len;
  359. int ret;
  360. int i = 0;
  361. uint32_t *node_config_args;
  362. args_tlv_len = WMI_TLV_HDR_SIZE + param->args_count * sizeof(uint32_t);
  363. len = sizeof(*cmd) + args_tlv_len;
  364. if (param->args_count == 0) {
  365. WMI_LOGE("%s: Can't send a command with %d arguments\n",
  366. __func__, param->args_count);
  367. return QDF_STATUS_E_FAILURE;
  368. }
  369. buf = wmi_buf_alloc(wmi_handle, len);
  370. if (!buf) {
  371. WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
  372. return QDF_STATUS_E_NOMEM;
  373. }
  374. cmd = (wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param *)
  375. wmi_buf_data(buf);
  376. buf_ptr = (uint8_t *)cmd;
  377. WMITLV_SET_HDR(&cmd->tlv_header,
  378. WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param,
  379. WMITLV_GET_STRUCT_TLVLEN(
  380. wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param));
  381. cmd->vdev_id = param->vdev_id;
  382. WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
  383. cmd->cmd_id = param->cmd_id;
  384. cmd->args_count = param->args_count;
  385. buf_ptr += sizeof(
  386. wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param);
  387. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
  388. (cmd->args_count * sizeof(uint32_t)));
  389. buf_ptr += WMI_TLV_HDR_SIZE;
  390. node_config_args = (uint32_t *)buf_ptr;
  391. for (i = 0; i < param->args_count; i++) {
  392. node_config_args[i] = param->args_arr[i];
  393. WMI_LOGI("%d", param->args_arr[i]);
  394. }
  395. wmi_mtrace(WMI_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
  396. cmd->vdev_id, 0);
  397. ret = wmi_unified_cmd_send(wmi_handle,
  398. buf,
  399. len,
  400. WMI_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID);
  401. if (ret != 0) {
  402. WMI_LOGE("%s: WMI FAILED:Sent cmd_id: 0x%x\n Node: %02x:%02x:%02x:%02x:%02x:%02x cmdstatus=%d\n",
  403. __func__, param->cmd_id, macaddr[0],
  404. macaddr[1], macaddr[2], macaddr[3],
  405. macaddr[4], macaddr[5], ret);
  406. wmi_buf_free(buf);
  407. }
  408. return ret;
  409. }
  410. void wmi_smart_ant_attach_tlv(wmi_unified_t wmi_handle)
  411. {
  412. struct wmi_ops *ops = wmi_handle->ops;
  413. ops->send_smart_ant_enable_cmd = send_smart_ant_enable_cmd_tlv;
  414. ops->send_smart_ant_set_rx_ant_cmd = send_smart_ant_set_rx_ant_cmd_tlv;
  415. ops->send_smart_ant_set_tx_ant_cmd = send_smart_ant_set_tx_ant_cmd_tlv;
  416. ops->send_smart_ant_set_training_info_cmd =
  417. send_smart_ant_set_training_info_cmd_tlv;
  418. ops->send_smart_ant_set_node_config_cmd =
  419. send_smart_ant_set_node_config_cmd_tlv;
  420. ops->send_set_ant_switch_tbl_cmd = send_set_ant_switch_tbl_cmd_tlv;
  421. }