wmi_unified_smart_ant_tlv.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  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[QDF_MAC_ADDR_SIZE],
  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. WMI_SMART_ANT_MAX_RATE_SERIES);
  200. buf_ptr += WMI_TLV_HDR_SIZE;
  201. ant_tx_series = (wmi_peer_smart_ant_set_tx_antenna_series *)buf_ptr;
  202. for (i = 0; i < WMI_SMART_ANT_MAX_RATE_SERIES; i++) {
  203. WMITLV_SET_HDR(&ant_tx_series->tlv_header,
  204. WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_tx_antenna_series,
  205. WMITLV_GET_STRUCT_TLVLEN(
  206. wmi_peer_smart_ant_set_tx_antenna_series));
  207. ant_tx_series->antenna_series = param->antenna_array[i];
  208. ant_tx_series++;
  209. }
  210. wmi_mtrace(WMI_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID, cmd->vdev_id, 0);
  211. ret = wmi_unified_cmd_send(wmi_handle,
  212. buf,
  213. len,
  214. WMI_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID);
  215. if (ret != 0) {
  216. WMI_LOGE(" %s :WMI Failed\n", __func__);
  217. wmi_buf_free(buf);
  218. }
  219. return ret;
  220. }
  221. /**
  222. * send_set_ant_switch_tbl_cmd_tlv() - send ant switch tbl cmd to fw
  223. * @wmi_handle: wmi handle
  224. * @param: pointer to hold ant switch tbl param
  225. *
  226. * @return QDF_STATUS_SUCCESS on success and -ve on failure.
  227. */
  228. static QDF_STATUS
  229. send_set_ant_switch_tbl_cmd_tlv(wmi_unified_t wmi_handle,
  230. struct ant_switch_tbl_params *param)
  231. {
  232. uint8_t len;
  233. wmi_buf_t buf;
  234. wmi_pdev_set_ant_switch_tbl_cmd_fixed_param *cmd;
  235. wmi_pdev_set_ant_ctrl_chain *ctrl_chain;
  236. uint8_t *buf_ptr;
  237. len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
  238. len += sizeof(wmi_pdev_set_ant_ctrl_chain);
  239. buf = wmi_buf_alloc(wmi_handle, len);
  240. if (!buf) {
  241. WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
  242. return QDF_STATUS_E_NOMEM;
  243. }
  244. buf_ptr = (uint8_t *)wmi_buf_data(buf);
  245. qdf_mem_zero(buf_ptr, len);
  246. cmd = (wmi_pdev_set_ant_switch_tbl_cmd_fixed_param *)buf_ptr;
  247. WMITLV_SET_HDR(&cmd->tlv_header,
  248. WMITLV_TAG_STRUC_wmi_pdev_set_ant_switch_tbl_cmd_fixed_param,
  249. WMITLV_GET_STRUCT_TLVLEN(
  250. wmi_pdev_set_ant_switch_tbl_cmd_fixed_param));
  251. cmd->antCtrlCommon1 = param->ant_ctrl_common1;
  252. cmd->antCtrlCommon2 = param->ant_ctrl_common2;
  253. cmd->mac_id =
  254. wmi_handle->ops->convert_pdev_id_host_to_target(param->pdev_id);
  255. /* TLV indicating array of structures to follow */
  256. buf_ptr += sizeof(wmi_pdev_set_ant_switch_tbl_cmd_fixed_param);
  257. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
  258. sizeof(wmi_pdev_set_ant_ctrl_chain));
  259. buf_ptr += WMI_TLV_HDR_SIZE;
  260. ctrl_chain = (wmi_pdev_set_ant_ctrl_chain *)buf_ptr;
  261. ctrl_chain->pdev_id =
  262. wmi_handle->ops->convert_pdev_id_host_to_target(param->pdev_id);
  263. ctrl_chain->antCtrlChain = param->antCtrlChain;
  264. wmi_mtrace(WMI_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID, NO_SESSION, 0);
  265. if (wmi_unified_cmd_send(wmi_handle, buf, len,
  266. WMI_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID)) {
  267. wmi_buf_free(buf);
  268. return QDF_STATUS_E_FAILURE;
  269. }
  270. return QDF_STATUS_SUCCESS;
  271. }
  272. /**
  273. * send_smart_ant_set_training_info_cmd_tlv() - WMI set smart antenna
  274. * training information function
  275. * @param wmi_handle : handle to WMI.
  276. * @macaddr : vdev mac address
  277. * @param param : pointer to tx antenna param
  278. * @return QDF_STATUS_SUCCESS on success and -ve on failure.
  279. */
  280. static QDF_STATUS send_smart_ant_set_training_info_cmd_tlv(
  281. wmi_unified_t wmi_handle,
  282. uint8_t macaddr[QDF_MAC_ADDR_SIZE],
  283. struct smart_ant_training_info_params *param)
  284. {
  285. wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param *cmd;
  286. wmi_peer_smart_ant_set_train_antenna_param *train_param;
  287. wmi_buf_t buf;
  288. uint8_t *buf_ptr;
  289. int32_t len = 0;
  290. QDF_STATUS ret;
  291. int loop;
  292. len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
  293. len += (WMI_SMART_ANT_MAX_RATE_SERIES) *
  294. sizeof(wmi_peer_smart_ant_set_train_antenna_param);
  295. buf = wmi_buf_alloc(wmi_handle, len);
  296. if (!buf) {
  297. WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
  298. return QDF_STATUS_E_NOMEM;
  299. }
  300. buf_ptr = (uint8_t *)wmi_buf_data(buf);
  301. qdf_mem_zero(buf_ptr, len);
  302. cmd = (wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param *)buf_ptr;
  303. WMITLV_SET_HDR(&cmd->tlv_header,
  304. WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param,
  305. WMITLV_GET_STRUCT_TLVLEN(
  306. wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param));
  307. cmd->vdev_id = param->vdev_id;
  308. WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
  309. cmd->num_pkts = param->numpkts;
  310. buf_ptr += sizeof(wmi_peer_smart_ant_set_train_antenna_cmd_fixed_param);
  311. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
  312. sizeof(wmi_peer_smart_ant_set_train_antenna_param) *
  313. WMI_SMART_ANT_MAX_RATE_SERIES);
  314. buf_ptr += WMI_TLV_HDR_SIZE;
  315. train_param = (wmi_peer_smart_ant_set_train_antenna_param *)buf_ptr;
  316. for (loop = 0; loop < WMI_SMART_ANT_MAX_RATE_SERIES; loop++) {
  317. WMITLV_SET_HDR(&train_param->tlv_header,
  318. WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_train_antenna_param,
  319. WMITLV_GET_STRUCT_TLVLEN(
  320. wmi_peer_smart_ant_set_train_antenna_param));
  321. train_param->train_rate_series = param->rate_array[loop];
  322. train_param->train_antenna_series = param->antenna_array[loop];
  323. train_param->rc_flags = 0;
  324. WMI_LOGI(FL("Series number:%d\n"), loop);
  325. WMI_LOGI(FL("Rate [0x%02x] Tx_Antenna [0x%08x]\n"),
  326. train_param->train_rate_series,
  327. train_param->train_antenna_series);
  328. train_param++;
  329. }
  330. wmi_mtrace(WMI_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID, cmd->vdev_id, 0);
  331. ret = wmi_unified_cmd_send(wmi_handle,
  332. buf,
  333. len,
  334. WMI_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID);
  335. if (ret != 0) {
  336. WMI_LOGE(" %s :WMI Failed\n", __func__);
  337. wmi_buf_free(buf);
  338. return QDF_STATUS_E_FAILURE;
  339. }
  340. return ret;
  341. }
  342. /**
  343. * send_smart_ant_set_node_config_cmd_tlv() - WMI set node
  344. * configuration function
  345. * @param wmi_handle : handle to WMI.
  346. * @macaddr : vdev mad address
  347. * @param param : pointer to tx antenna param
  348. *
  349. * @return QDF_STATUS_SUCCESS on success and -ve on failure.
  350. */
  351. static QDF_STATUS send_smart_ant_set_node_config_cmd_tlv(
  352. wmi_unified_t wmi_handle,
  353. uint8_t macaddr[QDF_MAC_ADDR_SIZE],
  354. struct smart_ant_node_config_params *param)
  355. {
  356. wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param *cmd;
  357. wmi_buf_t buf;
  358. uint8_t *buf_ptr;
  359. int32_t len = 0, args_tlv_len;
  360. int ret;
  361. int i = 0;
  362. uint32_t *node_config_args;
  363. args_tlv_len = WMI_TLV_HDR_SIZE + param->args_count * sizeof(uint32_t);
  364. len = sizeof(*cmd) + args_tlv_len;
  365. if (param->args_count == 0) {
  366. WMI_LOGE("%s: Can't send a command with %d arguments\n",
  367. __func__, param->args_count);
  368. return QDF_STATUS_E_FAILURE;
  369. }
  370. buf = wmi_buf_alloc(wmi_handle, len);
  371. if (!buf) {
  372. WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
  373. return QDF_STATUS_E_NOMEM;
  374. }
  375. cmd = (wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param *)
  376. wmi_buf_data(buf);
  377. buf_ptr = (uint8_t *)cmd;
  378. WMITLV_SET_HDR(&cmd->tlv_header,
  379. WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param,
  380. WMITLV_GET_STRUCT_TLVLEN(
  381. wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param));
  382. cmd->vdev_id = param->vdev_id;
  383. WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
  384. cmd->cmd_id = param->cmd_id;
  385. cmd->args_count = param->args_count;
  386. buf_ptr += sizeof(
  387. wmi_peer_smart_ant_set_node_config_ops_cmd_fixed_param);
  388. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
  389. (cmd->args_count * sizeof(uint32_t)));
  390. buf_ptr += WMI_TLV_HDR_SIZE;
  391. node_config_args = (uint32_t *)buf_ptr;
  392. for (i = 0; i < param->args_count; i++) {
  393. node_config_args[i] = param->args_arr[i];
  394. WMI_LOGI("%d", param->args_arr[i]);
  395. }
  396. wmi_mtrace(WMI_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
  397. cmd->vdev_id, 0);
  398. ret = wmi_unified_cmd_send(wmi_handle,
  399. buf,
  400. len,
  401. WMI_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID);
  402. if (ret != 0) {
  403. WMI_LOGE("%s: WMI FAILED:Sent cmd_id: 0x%x\n Node: %02x:%02x:%02x:%02x:%02x:%02x cmdstatus=%d\n",
  404. __func__, param->cmd_id, macaddr[0],
  405. macaddr[1], macaddr[2], macaddr[3],
  406. macaddr[4], macaddr[5], ret);
  407. wmi_buf_free(buf);
  408. }
  409. return ret;
  410. }
  411. void wmi_smart_ant_attach_tlv(wmi_unified_t wmi_handle)
  412. {
  413. struct wmi_ops *ops = wmi_handle->ops;
  414. ops->send_smart_ant_enable_cmd = send_smart_ant_enable_cmd_tlv;
  415. ops->send_smart_ant_set_rx_ant_cmd = send_smart_ant_set_rx_ant_cmd_tlv;
  416. ops->send_smart_ant_set_tx_ant_cmd = send_smart_ant_set_tx_ant_cmd_tlv;
  417. ops->send_smart_ant_set_training_info_cmd =
  418. send_smart_ant_set_training_info_cmd_tlv;
  419. ops->send_smart_ant_set_node_config_cmd =
  420. send_smart_ant_set_node_config_cmd_tlv;
  421. ops->send_set_ant_switch_tbl_cmd = send_set_ant_switch_tbl_cmd_tlv;
  422. }