cdp_txrx_ops.h 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231
  1. /*
  2. * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  3. *
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * @file cdp_txrx_ops.h
  21. * @brief Define the host data path converged API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_CMN_OPS_H_
  25. #define _CDP_TXRX_CMN_OPS_H_
  26. #include <cdp_txrx_cmn_struct.h>
  27. #include <cdp_txrx_stats_struct.h>
  28. #include "cdp_txrx_handle.h"
  29. #include <cdp_txrx_mon_struct.h>
  30. #include "wlan_objmgr_psoc_obj.h"
  31. #ifdef IPA_OFFLOAD
  32. #ifdef CONFIG_IPA_WDI_UNIFIED_API
  33. #include <qdf_ipa_wdi3.h>
  34. #else
  35. #include <qdf_ipa.h>
  36. #endif
  37. #endif
  38. /**
  39. * bitmap values to indicate special handling of peer_delete
  40. */
  41. #define CDP_PEER_DELETE_NO_SPECIAL 0
  42. #define CDP_PEER_DO_NOT_START_UNMAP_TIMER 1
  43. /* same as ieee80211_nac_param */
  44. enum cdp_nac_param_cmd {
  45. /* IEEE80211_NAC_PARAM_ADD */
  46. CDP_NAC_PARAM_ADD = 1,
  47. /* IEEE80211_NAC_PARAM_DEL */
  48. CDP_NAC_PARAM_DEL,
  49. /* IEEE80211_NAC_PARAM_LIST */
  50. CDP_NAC_PARAM_LIST,
  51. };
  52. /******************************************************************************
  53. *
  54. * Control Interface (A Interface)
  55. *
  56. *****************************************************************************/
  57. struct cdp_cmn_ops {
  58. int (*txrx_soc_attach_target)(ol_txrx_soc_handle soc);
  59. int (*txrx_pdev_attach_target)(struct cdp_pdev *pdev);
  60. struct cdp_vdev *(*txrx_vdev_attach)
  61. (struct cdp_pdev *pdev, uint8_t *vdev_mac_addr,
  62. uint8_t vdev_id, enum wlan_op_mode op_mode);
  63. void (*txrx_vdev_detach)
  64. (struct cdp_vdev *vdev, ol_txrx_vdev_delete_cb callback,
  65. void *cb_context);
  66. struct cdp_pdev *(*txrx_pdev_attach)
  67. (ol_txrx_soc_handle soc, struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
  68. HTC_HANDLE htc_pdev, qdf_device_t osdev, uint8_t pdev_id);
  69. int (*txrx_pdev_post_attach)(struct cdp_pdev *pdev);
  70. void (*txrx_pdev_pre_detach)(struct cdp_pdev *pdev, int force);
  71. void (*txrx_pdev_detach)(struct cdp_pdev *pdev, int force);
  72. void *(*txrx_peer_create)
  73. (struct cdp_vdev *vdev, uint8_t *peer_mac_addr,
  74. struct cdp_ctrl_objmgr_peer *ctrl_peer);
  75. void (*txrx_peer_setup)
  76. (struct cdp_vdev *vdev_hdl, void *peer_hdl);
  77. void (*txrx_peer_teardown)
  78. (struct cdp_vdev *vdev_hdl, void *peer_hdl);
  79. int (*txrx_peer_add_ast)
  80. (ol_txrx_soc_handle soc, struct cdp_peer *peer_hdl,
  81. uint8_t *mac_addr, enum cdp_txrx_ast_entry_type type,
  82. uint32_t flags);
  83. void (*txrx_peer_del_ast)
  84. (ol_txrx_soc_handle soc, void *ast_hdl);
  85. int (*txrx_peer_update_ast)
  86. (ol_txrx_soc_handle soc, struct cdp_peer *peer_hdl,
  87. uint8_t *mac_addr, uint32_t flags);
  88. void *(*txrx_peer_ast_hash_find)
  89. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr);
  90. uint8_t (*txrx_peer_ast_get_pdev_id)
  91. (ol_txrx_soc_handle soc, void *ast_hdl);
  92. uint8_t (*txrx_peer_ast_get_next_hop)
  93. (ol_txrx_soc_handle soc, void *ast_hdl);
  94. void (*txrx_peer_ast_set_type)
  95. (ol_txrx_soc_handle soc, void *ast_hdl,
  96. enum cdp_txrx_ast_entry_type type);
  97. enum cdp_txrx_ast_entry_type (*txrx_peer_ast_get_type)
  98. (ol_txrx_soc_handle soc, void *ast_hdl);
  99. void (*txrx_peer_delete)(void *peer, uint32_t bitmap);
  100. int (*txrx_set_monitor_mode)(struct cdp_vdev *vdev,
  101. uint8_t smart_monitor);
  102. uint8_t (*txrx_get_pdev_id_frm_pdev)(struct cdp_pdev *pdev);
  103. void (*txrx_pdev_set_chan_noise_floor)(struct cdp_pdev *pdev,
  104. int16_t chan_noise_floor);
  105. void (*txrx_set_nac)(struct cdp_peer *peer);
  106. void (*txrx_set_pdev_tx_capture)(struct cdp_pdev *pdev, int val);
  107. void (*txrx_get_peer_mac_from_peer_id)
  108. (struct cdp_pdev *pdev_handle,
  109. uint32_t peer_id, uint8_t *peer_mac);
  110. void (*txrx_vdev_tx_lock)(struct cdp_vdev *vdev);
  111. void (*txrx_vdev_tx_unlock)(struct cdp_vdev *vdev);
  112. void (*txrx_ath_getstats)(void *pdev,
  113. struct cdp_dev_stats *stats, uint8_t type);
  114. void (*txrx_set_gid_flag)(struct cdp_pdev *pdev, u_int8_t *mem_status,
  115. u_int8_t *user_position);
  116. uint32_t (*txrx_fw_supported_enh_stats_version)(struct cdp_pdev *pdev);
  117. void (*txrx_if_mgmt_drain)(void *ni, int force);
  118. void (*txrx_set_curchan)(struct cdp_pdev *pdev, uint32_t chan_mhz);
  119. void (*txrx_set_privacy_filters)
  120. (struct cdp_vdev *vdev, void *filter, uint32_t num);
  121. /********************************************************************
  122. * Data Interface (B Interface)
  123. ********************************************************************/
  124. void (*txrx_vdev_register)(struct cdp_vdev *vdev,
  125. void *osif_vdev, struct cdp_ctrl_objmgr_vdev *ctrl_vdev,
  126. struct ol_txrx_ops *txrx_ops);
  127. int (*txrx_mgmt_send)(struct cdp_vdev *vdev,
  128. qdf_nbuf_t tx_mgmt_frm, uint8_t type);
  129. int (*txrx_mgmt_send_ext)(struct cdp_vdev *vdev,
  130. qdf_nbuf_t tx_mgmt_frm, uint8_t type, uint8_t use_6mbps,
  131. uint16_t chanfreq);
  132. /**
  133. * ol_txrx_mgmt_tx_cb - tx management delivery notification
  134. * callback function
  135. */
  136. void (*txrx_mgmt_tx_cb_set)(struct cdp_pdev *pdev, uint8_t type,
  137. ol_txrx_mgmt_tx_cb download_cb,
  138. ol_txrx_mgmt_tx_cb ota_ack_cb,
  139. void *ctxt);
  140. int (*txrx_get_tx_pending)(struct cdp_pdev *pdev);
  141. /**
  142. * ol_txrx_data_tx_cb - Function registered with the data path
  143. * that is called when tx frames marked as "no free" are
  144. * done being transmitted
  145. */
  146. void (*txrx_data_tx_cb_set)(struct cdp_vdev *data_vdev,
  147. ol_txrx_data_tx_cb callback, void *ctxt);
  148. /*******************************************************************
  149. * Statistics and Debugging Interface (C Interface)
  150. ********************************************************************/
  151. int (*txrx_aggr_cfg)(struct cdp_vdev *vdev, int max_subfrms_ampdu,
  152. int max_subfrms_amsdu);
  153. A_STATUS (*txrx_fw_stats_get)(struct cdp_vdev *vdev,
  154. struct ol_txrx_stats_req *req,
  155. bool per_vdev, bool response_expected);
  156. int (*txrx_debug)(struct cdp_vdev *vdev, int debug_specs);
  157. void (*txrx_fw_stats_cfg)(struct cdp_vdev *vdev,
  158. uint8_t cfg_stats_type, uint32_t cfg_val);
  159. void (*txrx_print_level_set)(unsigned level);
  160. /**
  161. * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev
  162. * @vdev: vdev handle
  163. *
  164. * Return: vdev mac address
  165. */
  166. uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_vdev *vdev);
  167. /**
  168. * ol_txrx_get_vdev_struct_mac_addr() - Return handle to struct qdf_mac_addr of
  169. * vdev
  170. * @vdev: vdev handle
  171. *
  172. * Return: Handle to struct qdf_mac_addr
  173. */
  174. struct qdf_mac_addr *
  175. (*txrx_get_vdev_struct_mac_addr)(struct cdp_vdev *vdev);
  176. /**
  177. * ol_txrx_get_pdev_from_vdev() - Return handle to pdev of vdev
  178. * @vdev: vdev handle
  179. *
  180. * Return: Handle to pdev
  181. */
  182. struct cdp_pdev *(*txrx_get_pdev_from_vdev)
  183. (struct cdp_vdev *vdev);
  184. /**
  185. * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
  186. * @vdev: vdev handle
  187. *
  188. * Return: Handle to control pdev
  189. */
  190. struct cdp_cfg *
  191. (*txrx_get_ctrl_pdev_from_vdev)(struct cdp_vdev *vdev);
  192. struct cdp_vdev *
  193. (*txrx_get_vdev_from_vdev_id)(struct cdp_pdev *pdev,
  194. uint8_t vdev_id);
  195. void (*txrx_soc_detach)(void *soc);
  196. int (*addba_resp_tx_completion)(void *peer_handle, uint8_t tid,
  197. int status);
  198. int (*addba_requestprocess)(void *peer_handle, uint8_t dialogtoken,
  199. uint16_t tid, uint16_t batimeout,
  200. uint16_t buffersize,
  201. uint16_t startseqnum);
  202. void (*addba_responsesetup)(void *peer_handle, uint8_t tid,
  203. uint8_t *dialogtoken, uint16_t *statuscode,
  204. uint16_t *buffersize, uint16_t *batimeout);
  205. int (*delba_process)(void *peer_handle,
  206. int tid, uint16_t reasoncode);
  207. /**
  208. * delba_tx_completion() - Indicate delba tx status
  209. * @peer_handle: Peer handle
  210. * @tid: Tid number
  211. * @status: Tx completion status
  212. *
  213. * Return: 0 on Success, 1 on failure
  214. */
  215. int (*delba_tx_completion)(void *peer_handle,
  216. uint8_t tid, int status);
  217. void (*set_addba_response)(void *peer_handle,
  218. uint8_t tid, uint16_t statuscode);
  219. uint8_t (*get_peer_mac_addr_frm_id)(struct cdp_soc_t *soc_handle,
  220. uint16_t peer_id, uint8_t *mac_addr);
  221. void (*set_vdev_dscp_tid_map)(struct cdp_vdev *vdev_handle,
  222. uint8_t map_id);
  223. void (*flush_cache_rx_queue)(void);
  224. void (*set_pdev_dscp_tid_map)(struct cdp_pdev *pdev, uint8_t map_id,
  225. uint8_t tos, uint8_t tid);
  226. QDF_STATUS (*txrx_stats_request)(struct cdp_vdev *vdev,
  227. struct cdp_txrx_stats_req *req);
  228. QDF_STATUS (*display_stats)(void *psoc, uint16_t value,
  229. enum qdf_stats_verbosity_level level);
  230. void (*txrx_soc_set_nss_cfg)(ol_txrx_soc_handle soc, int config);
  231. int(*txrx_soc_get_nss_cfg)(ol_txrx_soc_handle soc);
  232. QDF_STATUS (*txrx_intr_attach)(void *soc);
  233. void (*txrx_intr_detach)(void *soc);
  234. void (*set_pn_check)(struct cdp_vdev *vdev,
  235. struct cdp_peer *peer_handle, enum cdp_sec_type sec_type,
  236. uint32_t *rx_pn);
  237. QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc,
  238. struct cdp_config_params *params);
  239. void *(*get_dp_txrx_handle)(struct cdp_pdev *pdev_hdl);
  240. void (*set_dp_txrx_handle)(struct cdp_pdev *pdev_hdl,
  241. void *dp_txrx_hdl);
  242. void *(*get_soc_dp_txrx_handle)(struct cdp_soc *soc_handle);
  243. void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle,
  244. void *dp_txrx_handle);
  245. void (*txrx_peer_reset_ast)
  246. (ol_txrx_soc_handle soc, uint8_t *ast_macaddr, void *vdev_hdl);
  247. void (*txrx_peer_reset_ast_table)(ol_txrx_soc_handle soc,
  248. void *vdev_hdl);
  249. void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc);
  250. void (*txrx_set_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
  251. uint8_t ac, uint32_t value);
  252. void (*txrx_get_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
  253. uint8_t ac, uint32_t *value);
  254. QDF_STATUS (*txrx_peer_map_attach)(ol_txrx_soc_handle soc,
  255. uint32_t num_peers,
  256. bool peer_map_unmap_v2);
  257. void (*txrx_pdev_set_ctrl_pdev)(struct cdp_pdev *pdev_hdl,
  258. struct cdp_ctrl_objmgr_pdev *ctrl_pdev);
  259. ol_txrx_tx_fp tx_send;
  260. /**
  261. * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev
  262. * to deliver pkt to stack.
  263. * @vdev: vdev handle
  264. * @stack_fn: pointer to - function pointer to deliver RX pkt to stack
  265. * @osif_vdev: pointer to - osif vdev to deliver RX packet to.
  266. */
  267. void (*txrx_get_os_rx_handles_from_vdev)
  268. (struct cdp_vdev *vdev,
  269. ol_txrx_rx_fp *stack_fn,
  270. ol_osif_vdev_handle *osif_vdev);
  271. int (*txrx_classify_update)
  272. (struct cdp_vdev *vdev, qdf_nbuf_t skb,
  273. enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class);
  274. };
  275. struct cdp_ctrl_ops {
  276. int
  277. (*txrx_mempools_attach)(void *ctrl_pdev);
  278. int
  279. (*txrx_set_filter_neighbour_peers)(
  280. struct cdp_pdev *pdev,
  281. uint32_t val);
  282. int
  283. (*txrx_update_filter_neighbour_peers)(
  284. struct cdp_vdev *vdev,
  285. uint32_t cmd, uint8_t *macaddr);
  286. /**
  287. * @brief set the safemode of the device
  288. * @details
  289. * This flag is used to bypass the encrypt and decrypt processes when
  290. * send and receive packets. It works like open AUTH mode, HW will
  291. * ctreate all packets as non-encrypt frames because no key installed.
  292. * For rx fragmented frames,it bypasses all the rx defragmentaion.
  293. *
  294. * @param vdev - the data virtual device object
  295. * @param val - the safemode state
  296. * @return - void
  297. */
  298. void
  299. (*txrx_set_safemode)(
  300. struct cdp_vdev *vdev,
  301. u_int32_t val);
  302. /**
  303. * @brief configure the drop unencrypted frame flag
  304. * @details
  305. * Rx related. When set this flag, all the unencrypted frames
  306. * received over a secure connection will be discarded
  307. *
  308. * @param vdev - the data virtual device object
  309. * @param val - flag
  310. * @return - void
  311. */
  312. void
  313. (*txrx_set_drop_unenc)(
  314. struct cdp_vdev *vdev,
  315. u_int32_t val);
  316. /**
  317. * @brief set the Tx encapsulation type of the VDEV
  318. * @details
  319. * This will be used to populate the HTT desc packet type field
  320. * during Tx
  321. * @param vdev - the data virtual device object
  322. * @param val - the Tx encap type
  323. * @return - void
  324. */
  325. void
  326. (*txrx_set_tx_encap_type)(
  327. struct cdp_vdev *vdev,
  328. enum htt_cmn_pkt_type val);
  329. /**
  330. * @brief set the Rx decapsulation type of the VDEV
  331. * @details
  332. * This will be used to configure into firmware and hardware
  333. * which format to decap all Rx packets into, for all peers under
  334. * the VDEV.
  335. * @param vdev - the data virtual device object
  336. * @param val - the Rx decap mode
  337. * @return - void
  338. */
  339. void
  340. (*txrx_set_vdev_rx_decap_type)(
  341. struct cdp_vdev *vdev,
  342. enum htt_cmn_pkt_type val);
  343. /**
  344. * @brief get the Rx decapsulation type of the VDEV
  345. *
  346. * @param vdev - the data virtual device object
  347. * @return - the Rx decap type
  348. */
  349. enum htt_cmn_pkt_type
  350. (*txrx_get_vdev_rx_decap_type)(struct cdp_vdev *vdev);
  351. /* Is this similar to ol_txrx_peer_state_update() in MCL */
  352. /**
  353. * @brief Update the authorize peer object at association time
  354. * @details
  355. * For the host-based implementation of rate-control, it
  356. * updates the peer/node-related parameters within rate-control
  357. * context of the peer at association.
  358. *
  359. * @param peer - pointer to the node's object
  360. * @authorize - either to authorize or unauthorize peer
  361. *
  362. * @return none
  363. */
  364. void
  365. (*txrx_peer_authorize)(struct cdp_peer *peer,
  366. u_int32_t authorize);
  367. bool
  368. (*txrx_set_inact_params)(struct cdp_pdev *pdev,
  369. u_int16_t inact_check_interval,
  370. u_int16_t inact_normal,
  371. u_int16_t inact_overload);
  372. bool
  373. (*txrx_start_inact_timer)(
  374. struct cdp_pdev *pdev,
  375. bool enable);
  376. /**
  377. * @brief Set the overload status of the radio
  378. * @details
  379. * Set the overload status of the radio, updating the inactivity
  380. * threshold and inactivity count for each node.
  381. *
  382. * @param pdev - the data physical device object
  383. * @param overload - whether the radio is overloaded or not
  384. */
  385. void (*txrx_set_overload)(
  386. struct cdp_pdev *pdev,
  387. bool overload);
  388. /**
  389. * @brief Check the inactivity status of the peer/node
  390. *
  391. * @param peer - pointer to the node's object
  392. * @return true if the node is inactive; otherwise return false
  393. */
  394. bool
  395. (*txrx_peer_is_inact)(void *peer);
  396. /**
  397. * @brief Mark inactivity status of the peer/node
  398. * @details
  399. * If it becomes active, reset inactivity count to reload value;
  400. * if the inactivity status changed, notify umac band steering.
  401. *
  402. * @param peer - pointer to the node's object
  403. * @param inactive - whether the node is inactive or not
  404. */
  405. void (*txrx_mark_peer_inact)(
  406. void *peer,
  407. bool inactive);
  408. /* Should be ol_txrx_ctrl_api.h */
  409. void (*txrx_set_mesh_mode)(struct cdp_vdev *vdev, u_int32_t val);
  410. /**
  411. * @brief setting mesh rx filter
  412. * @details
  413. * based on the bits enabled in the filter packets has to be dropped.
  414. *
  415. * @param vdev - the data virtual device object
  416. * @param val - value to set
  417. */
  418. void (*txrx_set_mesh_rx_filter)(struct cdp_vdev *vdev, uint32_t val);
  419. void (*tx_flush_buffers)(struct cdp_vdev *vdev);
  420. int (*txrx_is_target_ar900b)(struct cdp_vdev *vdev);
  421. void (*txrx_set_vdev_param)(struct cdp_vdev *vdev,
  422. enum cdp_vdev_param_type param, uint32_t val);
  423. void (*txrx_peer_set_nawds)(struct cdp_peer *peer, uint8_t value);
  424. /**
  425. * @brief Set the reo dest ring num of the radio
  426. * @details
  427. * Set the reo destination ring no on which we will receive
  428. * pkts for this radio.
  429. *
  430. * @param pdev - the data physical device object
  431. * @param reo_dest_ring_num - value ranges between 1 - 4
  432. */
  433. void (*txrx_set_pdev_reo_dest)(
  434. struct cdp_pdev *pdev,
  435. enum cdp_host_reo_dest_ring reo_dest_ring_num);
  436. /**
  437. * @brief Get the reo dest ring num of the radio
  438. * @details
  439. * Get the reo destination ring no on which we will receive
  440. * pkts for this radio.
  441. *
  442. * @param pdev - the data physical device object
  443. * @return the reo destination ring number
  444. */
  445. enum cdp_host_reo_dest_ring (*txrx_get_pdev_reo_dest)(
  446. struct cdp_pdev *pdev);
  447. int (*txrx_wdi_event_sub)(struct cdp_pdev *pdev, void *event_cb_sub,
  448. uint32_t event);
  449. int (*txrx_wdi_event_unsub)(struct cdp_pdev *pdev, void *event_cb_sub,
  450. uint32_t event);
  451. int (*txrx_get_sec_type)(struct cdp_peer *peer, uint8_t sec_idx);
  452. void (*txrx_update_mgmt_txpow_vdev)(struct cdp_vdev *vdev,
  453. uint8_t subtype, uint8_t tx_power);
  454. void (*txrx_set_pdev_param)(struct cdp_pdev *pdev,
  455. enum cdp_pdev_param_type type, uint8_t val);
  456. void * (*txrx_get_pldev)(struct cdp_pdev *pdev);
  457. #ifdef ATH_SUPPORT_NAC_RSSI
  458. QDF_STATUS (*txrx_vdev_config_for_nac_rssi)(struct cdp_vdev *vdev,
  459. enum cdp_nac_param_cmd cmd, char *bssid, char *client_macaddr,
  460. uint8_t chan_num);
  461. QDF_STATUS (*txrx_vdev_get_neighbour_rssi)(struct cdp_vdev *vdev,
  462. char *macaddr,
  463. uint8_t *rssi);
  464. #endif
  465. void (*set_key)(struct cdp_peer *peer_handle,
  466. bool is_unicast, uint32_t *key);
  467. };
  468. struct cdp_me_ops {
  469. u_int16_t (*tx_desc_alloc_and_mark_for_mcast_clone)
  470. (struct cdp_pdev *pdev, u_int16_t buf_count);
  471. u_int16_t (*tx_desc_free_and_unmark_for_mcast_clone)(
  472. struct cdp_pdev *pdev,
  473. u_int16_t buf_count);
  474. u_int16_t
  475. (*tx_get_mcast_buf_allocated_marked)
  476. (struct cdp_pdev *pdev);
  477. void
  478. (*tx_me_alloc_descriptor)(struct cdp_pdev *pdev);
  479. void
  480. (*tx_me_free_descriptor)(struct cdp_pdev *pdev);
  481. uint16_t
  482. (*tx_me_convert_ucast)(struct cdp_vdev *vdev,
  483. qdf_nbuf_t wbuf, u_int8_t newmac[][6],
  484. uint8_t newmaccnt);
  485. /* Should be a function pointer in ol_txrx_osif_ops{} */
  486. /**
  487. * @brief notify mcast frame indication from FW.
  488. * @details
  489. * This notification will be used to convert
  490. * multicast frame to unicast.
  491. *
  492. * @param pdev - handle to the ctrl SW's physical device object
  493. * @param vdev_id - ID of the virtual device received the special data
  494. * @param msdu - the multicast msdu returned by FW for host inspect
  495. */
  496. int (*mcast_notify)(struct cdp_pdev *pdev,
  497. u_int8_t vdev_id, qdf_nbuf_t msdu);
  498. };
  499. struct cdp_mon_ops {
  500. void (*txrx_monitor_set_filter_ucast_data)
  501. (struct cdp_pdev *, u_int8_t val);
  502. void (*txrx_monitor_set_filter_mcast_data)
  503. (struct cdp_pdev *, u_int8_t val);
  504. void (*txrx_monitor_set_filter_non_data)
  505. (struct cdp_pdev *, u_int8_t val);
  506. bool (*txrx_monitor_get_filter_ucast_data)
  507. (struct cdp_vdev *vdev_txrx_handle);
  508. bool (*txrx_monitor_get_filter_mcast_data)
  509. (struct cdp_vdev *vdev_txrx_handle);
  510. bool (*txrx_monitor_get_filter_non_data)
  511. (struct cdp_vdev *vdev_txrx_handle);
  512. int (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev);
  513. /* HK advance monitor filter support */
  514. int (*txrx_set_advance_monitor_filter)
  515. (struct cdp_pdev *pdev, struct cdp_monitor_filter *filter_val);
  516. };
  517. struct cdp_host_stats_ops {
  518. int (*txrx_host_stats_get)(struct cdp_vdev *vdev,
  519. struct ol_txrx_stats_req *req);
  520. void (*txrx_host_stats_clr)(struct cdp_vdev *vdev);
  521. void (*txrx_host_ce_stats)(struct cdp_vdev *vdev);
  522. int (*txrx_stats_publish)(struct cdp_pdev *pdev,
  523. void *buf);
  524. /**
  525. * @brief Enable enhanced stats functionality.
  526. *
  527. * @param pdev - the physical device object
  528. * @return - void
  529. */
  530. void (*txrx_enable_enhanced_stats)(struct cdp_pdev *pdev);
  531. /**
  532. * @brief Disable enhanced stats functionality.
  533. *
  534. * @param pdev - the physical device object
  535. * @return - void
  536. */
  537. void (*txrx_disable_enhanced_stats)(struct cdp_pdev *pdev);
  538. /**
  539. * @brief Get the desired stats from the message.
  540. *
  541. * @param pdev - the physical device object
  542. * @param stats_base - stats buffer received from FW
  543. * @param type - stats type.
  544. * @return - pointer to requested stat identified by type
  545. */
  546. uint32_t * (*txrx_get_stats_base)(struct cdp_pdev *pdev,
  547. uint32_t *stats_base, uint32_t msg_len, uint8_t type);
  548. void
  549. (*tx_print_tso_stats)(struct cdp_vdev *vdev);
  550. void
  551. (*tx_rst_tso_stats)(struct cdp_vdev *vdev);
  552. void
  553. (*tx_print_sg_stats)(struct cdp_vdev *vdev);
  554. void
  555. (*tx_rst_sg_stats)(struct cdp_vdev *vdev);
  556. void
  557. (*print_rx_cksum_stats)(struct cdp_vdev *vdev);
  558. void
  559. (*rst_rx_cksum_stats)(struct cdp_vdev *vdev);
  560. A_STATUS
  561. (*txrx_host_me_stats)(struct cdp_vdev *vdev);
  562. void
  563. (*txrx_per_peer_stats)(struct cdp_pdev *pdev, char *addr);
  564. int (*txrx_host_msdu_ttl_stats)(struct cdp_vdev *vdev,
  565. struct ol_txrx_stats_req *req);
  566. void
  567. (*print_lro_stats)(struct cdp_vdev *vdev);
  568. void
  569. (*reset_lro_stats)(struct cdp_vdev *vdev);
  570. void
  571. (*get_fw_peer_stats)(struct cdp_pdev *pdev, uint8_t *addr,
  572. uint32_t cap);
  573. void
  574. (*get_htt_stats)(struct cdp_pdev *pdev, void *data,
  575. uint32_t data_len);
  576. void
  577. (*txrx_update_pdev_stats)(struct cdp_pdev *pdev, void *data,
  578. uint16_t stats_id);
  579. struct cdp_peer_stats*
  580. (*txrx_get_peer_stats)(struct cdp_peer *peer);
  581. void
  582. (*txrx_reset_peer_ald_stats)(struct cdp_peer *peer);
  583. void
  584. (*txrx_reset_peer_stats)(struct cdp_peer *peer);
  585. int
  586. (*txrx_get_vdev_stats)(struct cdp_vdev *vdev, void *buf,
  587. bool is_aggregate);
  588. int
  589. (*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc,
  590. void *data, uint32_t len,
  591. uint32_t stats_id);
  592. int
  593. (*txrx_get_vdev_extd_stats)(struct cdp_vdev *vdev_handle,
  594. void *buffer);
  595. };
  596. struct cdp_wds_ops {
  597. void
  598. (*txrx_set_wds_rx_policy)(struct cdp_vdev *vdev,
  599. u_int32_t val);
  600. void
  601. (*txrx_wds_peer_tx_policy_update)(struct cdp_peer *peer,
  602. int wds_tx_ucast, int wds_tx_mcast);
  603. int (*vdev_set_wds)(void *vdev, uint32_t val);
  604. };
  605. struct cdp_raw_ops {
  606. int (*txrx_get_nwifi_mode)(struct cdp_vdev *vdev);
  607. void (*rsim_get_astentry)(struct cdp_vdev *vdev,
  608. qdf_nbuf_t *pnbuf,
  609. struct cdp_raw_ast *raw_ast);
  610. };
  611. #ifdef CONFIG_WIN
  612. struct cdp_pflow_ops {
  613. uint32_t(*pflow_update_pdev_params)(void *,
  614. enum _ol_ath_param_t, uint32_t, void *);
  615. };
  616. #endif /* CONFIG_WIN */
  617. #define LRO_IPV4_SEED_ARR_SZ 5
  618. #define LRO_IPV6_SEED_ARR_SZ 11
  619. /**
  620. * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters
  621. * @lro_enable: indicates whether rx_offld is enabled
  622. * @tcp_flag: If the TCP flags from the packet do not match
  623. * the values in this field after masking with TCP flags mask
  624. * below, packet is not rx_offld eligible
  625. * @tcp_flag_mask: field for comparing the TCP values provided
  626. * above with the TCP flags field in the received packet
  627. * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
  628. * 5-tuple toeplitz hash for ipv4 packets
  629. * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
  630. * 5-tuple toeplitz hash for ipv6 packets
  631. */
  632. struct cdp_lro_hash_config {
  633. uint32_t lro_enable;
  634. uint32_t tcp_flag:9,
  635. tcp_flag_mask:9;
  636. uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
  637. uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
  638. };
  639. struct ol_if_ops {
  640. void
  641. (*peer_set_default_routing)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
  642. uint8_t *peer_macaddr, uint8_t vdev_id,
  643. bool hash_based, uint8_t ring_num);
  644. QDF_STATUS
  645. (*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
  646. uint8_t vdev_id, uint8_t *peer_mac,
  647. qdf_dma_addr_t hw_qdesc, int tid,
  648. uint16_t queue_num,
  649. uint8_t ba_window_size_valid,
  650. uint16_t ba_window_size);
  651. QDF_STATUS
  652. (*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
  653. uint8_t vdev_id, uint8_t *peer_macaddr,
  654. uint32_t tid_mask);
  655. int (*peer_unref_delete)(void *scn_handle, uint8_t vdev_id,
  656. uint8_t *peer_macaddr);
  657. bool (*is_hw_dbs_2x2_capable)(struct wlan_objmgr_psoc *psoc);
  658. int (*peer_add_wds_entry)(void *ol_soc_handle,
  659. const uint8_t *dest_macaddr, uint8_t *peer_macaddr,
  660. uint32_t flags);
  661. int (*peer_update_wds_entry)(void *ol_soc_handle,
  662. uint8_t *dest_macaddr, uint8_t *peer_macaddr,
  663. uint32_t flags);
  664. void (*peer_del_wds_entry)(void *ol_soc_handle,
  665. uint8_t *wds_macaddr);
  666. QDF_STATUS
  667. (*lro_hash_config)(struct wlan_objmgr_psoc *ctrl_psoc,
  668. struct cdp_lro_hash_config *rx_offld_hash);
  669. void (*update_dp_stats)(void *soc, void *stats, uint16_t id,
  670. uint8_t type);
  671. #ifdef CONFIG_WIN
  672. uint8_t (*rx_invalid_peer)(void *ctrl_pdev, void *msg);
  673. #else
  674. uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh);
  675. #endif
  676. int (*peer_map_event)(void *ol_soc_handle, uint16_t peer_id, uint16_t hw_peer_id,
  677. uint8_t vdev_id, uint8_t *peer_mac_addr,
  678. enum cdp_txrx_ast_entry_type peer_type,
  679. uint32_t tx_ast_hashidx);
  680. int (*peer_unmap_event)(void *ol_soc_handle, uint16_t peer_id);
  681. int (*get_dp_cfg_param)(void *ol_soc_handle, enum cdp_cfg_param_type param_num);
  682. void (*rx_mic_error)(void *ol_soc_handle,
  683. uint16_t vdev_id, void *wh);
  684. bool (*rx_frag_tkip_demic)(struct wlan_objmgr_peer *ctrl_peer,
  685. qdf_nbuf_t nbuf,
  686. uint16_t hdr_space);
  687. uint8_t (*freq_to_channel)(void *ol_soc_handle, uint16_t vdev_id);
  688. void (*record_act_change)(struct wlan_objmgr_pdev *pdev,
  689. u_int8_t *dstmac, bool active);
  690. #ifdef ATH_SUPPORT_NAC_RSSI
  691. int (*config_fw_for_nac_rssi)(struct wlan_objmgr_pdev *pdev,
  692. u_int8_t vdev_id, enum cdp_nac_param_cmd cmd, char *bssid,
  693. char *client_macaddr, uint8_t chan_num);
  694. int (*config_bssid_in_fw_for_nac_rssi)(struct wlan_objmgr_pdev *pdev,
  695. u_int8_t vdev_id, enum cdp_nac_param_cmd cmd, char *bssid);
  696. #endif
  697. int (*peer_sta_kickout)(void *ctrl_pdev, uint8_t *peer_macaddr);
  698. /**
  699. * send_delba() - Send delba to peer
  700. * @pdev_handle: Dp pdev handle
  701. * @ctrl_peer: Peer handle
  702. * @peer_macaddr: Peer mac addr
  703. * @tid: Tid number
  704. *
  705. * Return: 0 for success, non-zero for failure
  706. */
  707. int (*send_delba)(void *pdev_handle, void *ctrl_peer,
  708. uint8_t *peer_macaddr, uint8_t tid, void *vdev_handle,
  709. uint8_t reason_code);
  710. /* TODO: Add any other control path calls required to OL_IF/WMA layer */
  711. };
  712. #ifndef CONFIG_WIN
  713. /* From here MCL specific OPs */
  714. /**
  715. * struct cdp_misc_ops - mcl ops not classified
  716. * @set_ibss_vdev_heart_beat_timer:
  717. * @bad_peer_txctl_set_setting:
  718. * @bad_peer_txctl_update_threshold:
  719. * @hl_tdls_flag_reset:
  720. * @tx_non_std:
  721. * @get_vdev_id:
  722. * @set_wisa_mode:
  723. * @txrx_data_stall_cb_register:
  724. * @txrx_data_stall_cb_deregister:
  725. * @txrx_post_data_stall_event
  726. * @runtime_suspend:
  727. * @runtime_resume:
  728. */
  729. struct cdp_misc_ops {
  730. uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_vdev *vdev,
  731. uint16_t timer_value_sec);
  732. void (*set_wmm_param)(struct cdp_pdev *cfg_pdev,
  733. struct ol_tx_wmm_param_t wmm_param);
  734. void (*bad_peer_txctl_set_setting)(struct cdp_pdev *pdev, int enable,
  735. int period, int txq_limit);
  736. void (*bad_peer_txctl_update_threshold)(struct cdp_pdev *pdev,
  737. int level, int tput_thresh, int tx_limit);
  738. void (*hl_tdls_flag_reset)(struct cdp_vdev *vdev, bool flag);
  739. qdf_nbuf_t (*tx_non_std)(struct cdp_vdev *vdev,
  740. enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
  741. uint16_t (*get_vdev_id)(struct cdp_vdev *vdev);
  742. uint32_t (*get_tx_ack_stats)(uint8_t vdev_id);
  743. QDF_STATUS (*set_wisa_mode)(struct cdp_vdev *vdev, bool enable);
  744. QDF_STATUS (*txrx_data_stall_cb_register)(data_stall_detect_cb cb);
  745. QDF_STATUS (*txrx_data_stall_cb_deregister)(data_stall_detect_cb cb);
  746. void (*txrx_post_data_stall_event)(
  747. enum data_stall_log_event_indicator indicator,
  748. enum data_stall_log_event_type data_stall_type,
  749. uint32_t pdev_id, uint32_t vdev_id_bitmap,
  750. enum data_stall_log_recovery_type recovery_type);
  751. QDF_STATUS (*runtime_suspend)(struct cdp_pdev *pdev);
  752. QDF_STATUS (*runtime_resume)(struct cdp_pdev *pdev);
  753. int (*get_opmode)(struct cdp_vdev *vdev);
  754. void (*mark_first_wakeup_packet)(uint8_t value);
  755. void (*update_mac_id)(uint8_t vdev_id, uint8_t mac_id);
  756. void (*flush_rx_frames)(void *peer, bool drop);
  757. A_STATUS (*get_intra_bss_fwd_pkts_count)(uint8_t vdev_id,
  758. uint64_t *fwd_tx_packets, uint64_t *fwd_rx_packets);
  759. void (*pkt_log_init)(struct cdp_pdev *handle, void *scn);
  760. void (*pkt_log_con_service)(struct cdp_pdev *pdev, void *scn);
  761. };
  762. /**
  763. * struct cdp_tx_delay_ops - mcl tx delay ops
  764. * @tx_delay:
  765. * @tx_delay_hist:
  766. * @tx_packet_count:
  767. * @tx_set_compute_interval:
  768. */
  769. struct cdp_tx_delay_ops {
  770. void (*tx_delay)(struct cdp_pdev *pdev, uint32_t *queue_delay_microsec,
  771. uint32_t *tx_delay_microsec, int category);
  772. void (*tx_delay_hist)(struct cdp_pdev *pdev,
  773. uint16_t *bin_values, int category);
  774. void (*tx_packet_count)(struct cdp_pdev *pdev,
  775. uint16_t *out_packet_count,
  776. uint16_t *out_packet_loss_count, int category);
  777. void (*tx_set_compute_interval)(struct cdp_pdev *pdev,
  778. uint32_t interval);
  779. };
  780. /**
  781. * struct cdp_pmf_ops - mcl protected management frame ops
  782. * @get_pn_info:
  783. */
  784. struct cdp_pmf_ops {
  785. void (*get_pn_info)(void *peer, uint8_t **last_pn_valid,
  786. uint64_t **last_pn, uint32_t **rmf_pn_replays);
  787. };
  788. /**
  789. * struct cdp_cfg_ops - mcl configuration ops
  790. * @set_cfg_rx_fwd_disabled:
  791. * @set_cfg_packet_log_enabled:
  792. * @cfg_attach:
  793. * @vdev_rx_set_intrabss_fwd:
  794. * @get_opmode:
  795. * @is_rx_fwd_disabled:
  796. * @tx_set_is_mgmt_over_wmi_enabled:
  797. * @is_high_latency:
  798. * @set_flow_control_parameters:
  799. */
  800. struct cdp_cfg_ops {
  801. void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev,
  802. uint8_t disable_rx_fwd);
  803. void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev,
  804. uint8_t val);
  805. struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
  806. void (*vdev_rx_set_intrabss_fwd)(struct cdp_vdev *vdev, bool val);
  807. uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev);
  808. void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value);
  809. int (*is_high_latency)(struct cdp_cfg *cfg_pdev);
  810. void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev,
  811. void *param);
  812. void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val);
  813. void (*set_ptp_rx_opt_enabled)(struct cdp_cfg *cfg_pdev, uint8_t val);
  814. };
  815. /**
  816. * struct cdp_flowctl_ops - mcl flow control
  817. * @register_pause_cb:
  818. * @set_desc_global_pool_size:
  819. * @dump_flow_pool_info:
  820. */
  821. struct cdp_flowctl_ops {
  822. QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc,
  823. struct cdp_pdev *pdev,
  824. uint8_t vdev_id);
  825. void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc,
  826. struct cdp_pdev *pdev,
  827. uint8_t vdev_id);
  828. QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc,
  829. tx_pause_callback);
  830. void (*set_desc_global_pool_size)(uint32_t num_msdu_desc);
  831. void (*dump_flow_pool_info)(void *);
  832. };
  833. /**
  834. * struct cdp_lflowctl_ops - mcl legacy flow control ops
  835. * @register_tx_flow_control:
  836. * @deregister_tx_flow_control_cb:
  837. * @flow_control_cb:
  838. * @get_tx_resource:
  839. * @ll_set_tx_pause_q_depth:
  840. * @vdev_flush:
  841. * @vdev_pause:
  842. * @vdev_unpause:
  843. */
  844. struct cdp_lflowctl_ops {
  845. #ifdef QCA_HL_NETDEV_FLOW_CONTROL
  846. int (*register_tx_flow_control)(struct cdp_soc_t *soc,
  847. tx_pause_callback flowcontrol);
  848. int (*set_vdev_tx_desc_limit)(u8 vdev_id, u8 chan);
  849. int (*set_vdev_os_queue_status)(u8 vdev_id,
  850. enum netif_action_type action);
  851. #else
  852. int (*register_tx_flow_control)(uint8_t vdev_id,
  853. ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx,
  854. ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause);
  855. #endif /* QCA_HL_NETDEV_FLOW_CONTROL */
  856. int (*deregister_tx_flow_control_cb)(uint8_t vdev_id);
  857. void (*flow_control_cb)(struct cdp_vdev *vdev, bool tx_resume);
  858. bool (*get_tx_resource)(uint8_t sta_id,
  859. unsigned int low_watermark,
  860. unsigned int high_watermark_offset);
  861. int (*ll_set_tx_pause_q_depth)(uint8_t vdev_id, int pause_q_depth);
  862. void (*vdev_flush)(struct cdp_vdev *vdev);
  863. void (*vdev_pause)(struct cdp_vdev *vdev, uint32_t reason);
  864. void (*vdev_unpause)(struct cdp_vdev *vdev, uint32_t reason);
  865. };
  866. #ifdef IPA_OFFLOAD
  867. /**
  868. * struct cdp_ipa_ops - mcl ipa data path ops
  869. * @ipa_get_resource:
  870. * @ipa_set_doorbell_paddr:
  871. * @ipa_set_active:
  872. * @ipa_op_response:
  873. * @ipa_register_op_cb:
  874. * @ipa_get_stat:
  875. * @ipa_tx_data_frame:
  876. */
  877. struct cdp_ipa_ops {
  878. QDF_STATUS (*ipa_get_resource)(struct cdp_pdev *pdev);
  879. QDF_STATUS (*ipa_set_doorbell_paddr)(struct cdp_pdev *pdev);
  880. QDF_STATUS (*ipa_set_active)(struct cdp_pdev *pdev, bool uc_active,
  881. bool is_tx);
  882. QDF_STATUS (*ipa_op_response)(struct cdp_pdev *pdev, uint8_t *op_msg);
  883. QDF_STATUS (*ipa_register_op_cb)(struct cdp_pdev *pdev,
  884. void (*ipa_uc_op_cb_type)(uint8_t *op_msg, void *osif_ctxt),
  885. void *usr_ctxt);
  886. QDF_STATUS (*ipa_get_stat)(struct cdp_pdev *pdev);
  887. qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_vdev *vdev, qdf_nbuf_t skb);
  888. void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *pdev,
  889. uint32_t value);
  890. #ifdef FEATURE_METERING
  891. QDF_STATUS (*ipa_uc_get_share_stats)(struct cdp_pdev *pdev,
  892. uint8_t reset_stats);
  893. QDF_STATUS (*ipa_uc_set_quota)(struct cdp_pdev *pdev,
  894. uint64_t quota_bytes);
  895. #endif
  896. QDF_STATUS (*ipa_enable_autonomy)(struct cdp_pdev *pdev);
  897. QDF_STATUS (*ipa_disable_autonomy)(struct cdp_pdev *pdev);
  898. #ifdef CONFIG_IPA_WDI_UNIFIED_API
  899. QDF_STATUS (*ipa_setup)(struct cdp_pdev *pdev, void *ipa_i2w_cb,
  900. void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
  901. uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
  902. uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle,
  903. bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in);
  904. #else /* CONFIG_IPA_WDI_UNIFIED_API */
  905. QDF_STATUS (*ipa_setup)(struct cdp_pdev *pdev, void *ipa_i2w_cb,
  906. void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
  907. uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
  908. uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle);
  909. #endif /* CONFIG_IPA_WDI_UNIFIED_API */
  910. QDF_STATUS (*ipa_cleanup)(uint32_t tx_pipe_handle,
  911. uint32_t rx_pipe_handle);
  912. QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr,
  913. qdf_ipa_client_type_t prod_client,
  914. qdf_ipa_client_type_t cons_client,
  915. uint8_t session_id, bool is_ipv6_enabled);
  916. QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled);
  917. QDF_STATUS (*ipa_enable_pipes)(struct cdp_pdev *pdev);
  918. QDF_STATUS (*ipa_disable_pipes)(struct cdp_pdev *pdev);
  919. QDF_STATUS (*ipa_set_perf_level)(int client,
  920. uint32_t max_supported_bw_mbps);
  921. };
  922. #endif
  923. /**
  924. * struct cdp_bus_ops - mcl bus suspend/resume ops
  925. * @bus_suspend:
  926. * @bus_resume:
  927. */
  928. struct cdp_bus_ops {
  929. QDF_STATUS (*bus_suspend)(struct cdp_pdev *opaque_pdev);
  930. QDF_STATUS (*bus_resume)(struct cdp_pdev *opaque_pdev);
  931. };
  932. /**
  933. * struct cdp_ocb_ops - mcl ocb ops
  934. * @set_ocb_chan_info:
  935. * @get_ocb_chan_info:
  936. */
  937. struct cdp_ocb_ops {
  938. void (*set_ocb_chan_info)(struct cdp_vdev *vdev,
  939. struct ol_txrx_ocb_set_chan ocb_set_chan);
  940. struct ol_txrx_ocb_chan_info *
  941. (*get_ocb_chan_info)(struct cdp_vdev *vdev);
  942. };
  943. /**
  944. * struct cdp_peer_ops - mcl peer related ops
  945. * @register_peer:
  946. * @clear_peer:
  947. * @cfg_attach:
  948. * @find_peer_by_addr:
  949. * @find_peer_by_addr_and_vdev:
  950. * @local_peer_id:
  951. * @peer_find_by_local_id:
  952. * @peer_state_update:
  953. * @get_vdevid:
  954. * @get_vdev_by_sta_id:
  955. * @register_ocb_peer:
  956. * @peer_get_peer_mac_addr:
  957. * @get_peer_state:
  958. * @get_vdev_for_peer:
  959. * @update_ibss_add_peer_num_of_vdev:
  960. * @remove_peers_for_vdev:
  961. * @remove_peers_for_vdev_no_lock:
  962. * @copy_mac_addr_raw:
  963. * @add_last_real_peer:
  964. * @is_vdev_restore_last_peer:
  965. * @update_last_real_peer:
  966. */
  967. struct cdp_peer_ops {
  968. QDF_STATUS (*register_peer)(struct cdp_pdev *pdev,
  969. struct ol_txrx_desc_type *sta_desc);
  970. QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev, uint8_t sta_id);
  971. QDF_STATUS (*change_peer_state)(uint8_t sta_id,
  972. enum ol_txrx_peer_state sta_state,
  973. bool roam_synch_in_progress);
  974. void * (*peer_get_ref_by_addr)(struct cdp_pdev *pdev,
  975. u8 *peer_addr, uint8_t *peer_id,
  976. enum peer_debug_id_type debug_id);
  977. void (*peer_release_ref)(void *peer, enum peer_debug_id_type debug_id);
  978. void * (*find_peer_by_addr)(struct cdp_pdev *pdev,
  979. uint8_t *peer_addr, uint8_t *peer_id);
  980. void * (*find_peer_by_addr_and_vdev)(struct cdp_pdev *pdev,
  981. struct cdp_vdev *vdev,
  982. uint8_t *peer_addr, uint8_t *peer_id);
  983. uint16_t (*local_peer_id)(void *peer);
  984. void * (*peer_find_by_local_id)(struct cdp_pdev *pdev,
  985. uint8_t local_peer_id);
  986. QDF_STATUS (*peer_state_update)(struct cdp_pdev *pdev,
  987. uint8_t *peer_addr,
  988. enum ol_txrx_peer_state state);
  989. QDF_STATUS (*get_vdevid)(void *peer, uint8_t *vdev_id);
  990. struct cdp_vdev * (*get_vdev_by_sta_id)(struct cdp_pdev *pdev,
  991. uint8_t sta_id);
  992. QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr, uint8_t *peer_id);
  993. uint8_t * (*peer_get_peer_mac_addr)(void *peer);
  994. int (*get_peer_state)(void *peer);
  995. struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
  996. int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_vdev *vdev,
  997. int16_t peer_num_delta);
  998. void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
  999. ol_txrx_vdev_peer_remove_cb callback,
  1000. void *callback_context, bool remove_last_peer);
  1001. void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
  1002. ol_txrx_vdev_peer_remove_cb callback,
  1003. void *callback_context);
  1004. void (*copy_mac_addr_raw)(struct cdp_vdev *vdev, uint8_t *bss_addr);
  1005. void (*add_last_real_peer)(struct cdp_pdev *pdev,
  1006. struct cdp_vdev *vdev, uint8_t *peer_id);
  1007. bool (*is_vdev_restore_last_peer)(void *peer);
  1008. void (*update_last_real_peer)(struct cdp_pdev *pdev, void *peer,
  1009. uint8_t *peer_id, bool restore_last_peer);
  1010. void (*peer_detach_force_delete)(void *peer);
  1011. };
  1012. /**
  1013. * struct cdp_ocb_ops - mcl ocb ops
  1014. * @throttle_init_period:
  1015. * @throttle_set_level:
  1016. */
  1017. struct cdp_throttle_ops {
  1018. void (*throttle_init_period)(struct cdp_pdev *pdev, int period,
  1019. uint8_t *dutycycle_level);
  1020. void (*throttle_set_level)(struct cdp_pdev *pdev, int level);
  1021. };
  1022. /**
  1023. * struct cdp_ocb_ops - mcl ocb ops
  1024. * @clear_stats:
  1025. * @stats:
  1026. */
  1027. struct cdp_mob_stats_ops {
  1028. void (*clear_stats)(uint16_t bitmap);
  1029. int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len);
  1030. };
  1031. #endif /* CONFIG_WIN */
  1032. #ifdef RECEIVE_OFFLOAD
  1033. /**
  1034. * struct cdp_rx_offld_ops - mcl receive offload ops
  1035. * @register_rx_offld_flush_cb:
  1036. * @deregister_rx_offld_flush_cb:
  1037. */
  1038. struct cdp_rx_offld_ops {
  1039. void (*register_rx_offld_flush_cb)(void (rx_offld_flush_cb)(void *));
  1040. void (*deregister_rx_offld_flush_cb)(void);
  1041. };
  1042. #endif
  1043. struct cdp_ops {
  1044. struct cdp_cmn_ops *cmn_drv_ops;
  1045. struct cdp_ctrl_ops *ctrl_ops;
  1046. struct cdp_me_ops *me_ops;
  1047. struct cdp_mon_ops *mon_ops;
  1048. struct cdp_host_stats_ops *host_stats_ops;
  1049. struct cdp_wds_ops *wds_ops;
  1050. struct cdp_raw_ops *raw_ops;
  1051. struct cdp_pflow_ops *pflow_ops;
  1052. #ifndef CONFIG_WIN
  1053. struct cdp_misc_ops *misc_ops;
  1054. struct cdp_cfg_ops *cfg_ops;
  1055. struct cdp_flowctl_ops *flowctl_ops;
  1056. struct cdp_lflowctl_ops *l_flowctl_ops;
  1057. #ifdef IPA_OFFLOAD
  1058. struct cdp_ipa_ops *ipa_ops;
  1059. #endif
  1060. #ifdef RECEIVE_OFFLOAD
  1061. struct cdp_rx_offld_ops *rx_offld_ops;
  1062. #endif
  1063. struct cdp_bus_ops *bus_ops;
  1064. struct cdp_ocb_ops *ocb_ops;
  1065. struct cdp_peer_ops *peer_ops;
  1066. struct cdp_throttle_ops *throttle_ops;
  1067. struct cdp_mob_stats_ops *mob_stats_ops;
  1068. struct cdp_tx_delay_ops *delay_ops;
  1069. struct cdp_pmf_ops *pmf_ops;
  1070. #endif /* CONFIG_WIN */
  1071. };
  1072. #endif