cdp_txrx_ops.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  1. /*
  2. * Copyright (c) 2011-2017 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. #ifdef CONFIG_WIN
  28. #include <cdp_txrx_stats_struct.h>
  29. #endif
  30. #include "cdp_txrx_handle.h"
  31. /******************************************************************************
  32. *
  33. * Control Interface (A Interface)
  34. *
  35. *****************************************************************************/
  36. struct cdp_cmn_ops {
  37. int (*txrx_soc_attach_target)(ol_txrx_soc_handle soc);
  38. int (*txrx_pdev_attach_target)(struct cdp_pdev *pdev);
  39. struct cdp_vdev *(*txrx_vdev_attach)
  40. (struct cdp_pdev *pdev, uint8_t *vdev_mac_addr,
  41. uint8_t vdev_id, enum wlan_op_mode op_mode);
  42. void (*txrx_vdev_detach)
  43. (struct cdp_vdev *vdev, ol_txrx_vdev_delete_cb callback,
  44. void *cb_context);
  45. struct cdp_pdev *(*txrx_pdev_attach)
  46. (ol_txrx_soc_handle soc, struct cdp_cfg *ctrl_pdev,
  47. HTC_HANDLE htc_pdev, qdf_device_t osdev, uint8_t pdev_id);
  48. int (*txrx_pdev_post_attach)(struct cdp_pdev *pdev);
  49. void (*txrx_pdev_pre_detach)(struct cdp_pdev *pdev, int force);
  50. void (*txrx_pdev_detach)(struct cdp_pdev *pdev, int force);
  51. void *(*txrx_peer_create)
  52. (struct cdp_vdev *vdev, uint8_t *peer_mac_addr);
  53. void (*txrx_peer_setup)
  54. (struct cdp_vdev *vdev_hdl, void *peer_hdl);
  55. void (*txrx_peer_teardown)
  56. (struct cdp_vdev *vdev_hdl, void *peer_hdl);
  57. void (*txrx_peer_delete)(void *peer);
  58. int (*txrx_set_monitor_mode)(struct cdp_vdev *vdev);
  59. void (*txrx_set_curchan)(struct cdp_pdev *pdev, uint32_t chan_mhz);
  60. void (*txrx_set_privacy_filters)
  61. (struct cdp_vdev *vdev, void *filter, uint32_t num);
  62. /********************************************************************
  63. * Data Interface (B Interface)
  64. ********************************************************************/
  65. void (*txrx_vdev_register)(struct cdp_vdev *vdev,
  66. void *osif_vdev, struct ol_txrx_ops *txrx_ops);
  67. int (*txrx_mgmt_send)(struct cdp_vdev *vdev,
  68. qdf_nbuf_t tx_mgmt_frm, uint8_t type);
  69. int (*txrx_mgmt_send_ext)(struct cdp_vdev *vdev,
  70. qdf_nbuf_t tx_mgmt_frm, uint8_t type, uint8_t use_6mbps,
  71. uint16_t chanfreq);
  72. /**
  73. * ol_txrx_mgmt_tx_cb - tx management delivery notification
  74. * callback function
  75. */
  76. void (*txrx_mgmt_tx_cb_set)
  77. (struct cdp_pdev *pdev, uint8_t type,
  78. ol_txrx_mgmt_tx_cb download_cb, ol_txrx_mgmt_tx_cb ota_ack_cb,
  79. void *ctxt);
  80. int (*txrx_get_tx_pending)(struct cdp_pdev *pdev);
  81. /**
  82. * ol_txrx_data_tx_cb - Function registered with the data path
  83. * that is called when tx frames marked as "no free" are
  84. * done being transmitted
  85. */
  86. void (*txrx_data_tx_cb_set)(struct cdp_vdev *data_vdev,
  87. ol_txrx_data_tx_cb callback, void *ctxt);
  88. /*******************************************************************
  89. * Statistics and Debugging Interface (C Inteface)
  90. ********************************************************************/
  91. int (*txrx_aggr_cfg)(struct cdp_vdev *vdev, int max_subfrms_ampdu,
  92. int max_subfrms_amsdu);
  93. A_STATUS (*txrx_fw_stats_get)(struct cdp_vdev *vdev,
  94. struct ol_txrx_stats_req *req,
  95. bool per_vdev, bool response_expected);
  96. int (*txrx_debug)(struct cdp_vdev *vdev, int debug_specs);
  97. void (*txrx_fw_stats_cfg)(struct cdp_vdev *vdev,
  98. uint8_t cfg_stats_type, uint32_t cfg_val);
  99. void (*txrx_print_level_set)(unsigned level);
  100. /**
  101. * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev
  102. * @vdev: vdev handle
  103. *
  104. * Return: vdev mac address
  105. */
  106. uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_vdev *vdev);
  107. /**
  108. * ol_txrx_get_vdev_struct_mac_addr() - Return handle to struct qdf_mac_addr of
  109. * vdev
  110. * @vdev: vdev handle
  111. *
  112. * Return: Handle to struct qdf_mac_addr
  113. */
  114. struct qdf_mac_addr *
  115. (*txrx_get_vdev_struct_mac_addr)(struct cdp_vdev *vdev);
  116. /**
  117. * ol_txrx_get_pdev_from_vdev() - Return handle to pdev of vdev
  118. * @vdev: vdev handle
  119. *
  120. * Return: Handle to pdev
  121. */
  122. struct cdp_pdev *(*txrx_get_pdev_from_vdev)
  123. (struct cdp_vdev *vdev);
  124. /**
  125. * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
  126. * @vdev: vdev handle
  127. *
  128. * Return: Handle to control pdev
  129. */
  130. struct cdp_cfg *
  131. (*txrx_get_ctrl_pdev_from_vdev)(struct cdp_vdev *vdev);
  132. struct cdp_vdev *
  133. (*txrx_get_vdev_from_vdev_id)(struct cdp_pdev *pdev,
  134. uint8_t vdev_id);
  135. void (*txrx_soc_detach)(void *soc);
  136. int (*addba_requestprocess)(void *peer_handle, uint8_t dialogtoken,
  137. uint16_t tid, uint16_t batimeout, uint16_t buffersize,
  138. uint16_t startseqnum);
  139. void (*addba_responsesetup)(void *peer_handle, uint8_t tid,
  140. uint8_t *dialogtoken, uint16_t *statuscode,
  141. uint16_t *buffersize, uint16_t *batimeout);
  142. int (*delba_process)(void *peer_handle,
  143. int tid, uint16_t reasoncode);
  144. uint8_t (*get_peer_mac_addr_frm_id)(struct cdp_soc_t *soc_handle,
  145. uint16_t peer_id, uint8_t *mac_addr);
  146. void (*set_vdev_dscp_tid_map)(struct cdp_vdev *vdev_handle,
  147. uint8_t map_id);
  148. void (*flush_cache_rx_queue)(void);
  149. void (*set_pdev_dscp_tid_map)(struct cdp_pdev *pdev, uint8_t map_id,
  150. uint8_t tos, uint8_t tid);
  151. A_STATUS(*txrx_stats)(struct cdp_vdev *vdev,
  152. struct ol_txrx_stats_req *req, enum cdp_stats stats);
  153. };
  154. struct cdp_ctrl_ops {
  155. int
  156. (*txrx_mempools_attach)(void *ctrl_pdev);
  157. int
  158. (*txrx_set_filter_neighbour_peers)(
  159. struct cdp_pdev *pdev,
  160. u_int32_t val);
  161. /**
  162. * @brief set the safemode of the device
  163. * @details
  164. * This flag is used to bypass the encrypt and decrypt processes when
  165. * send and receive packets. It works like open AUTH mode, HW will
  166. * ctreate all packets as non-encrypt frames because no key installed.
  167. * For rx fragmented frames,it bypasses all the rx defragmentaion.
  168. *
  169. * @param vdev - the data virtual device object
  170. * @param val - the safemode state
  171. * @return - void
  172. */
  173. void
  174. (*txrx_set_safemode)(
  175. struct cdp_vdev *vdev,
  176. u_int32_t val);
  177. /**
  178. * @brief configure the drop unencrypted frame flag
  179. * @details
  180. * Rx related. When set this flag, all the unencrypted frames
  181. * received over a secure connection will be discarded
  182. *
  183. * @param vdev - the data virtual device object
  184. * @param val - flag
  185. * @return - void
  186. */
  187. void
  188. (*txrx_set_drop_unenc)(
  189. struct cdp_vdev *vdev,
  190. u_int32_t val);
  191. /**
  192. * @brief set the Tx encapsulation type of the VDEV
  193. * @details
  194. * This will be used to populate the HTT desc packet type field
  195. * during Tx
  196. * @param vdev - the data virtual device object
  197. * @param val - the Tx encap type
  198. * @return - void
  199. */
  200. void
  201. (*txrx_set_tx_encap_type)(
  202. struct cdp_vdev *vdev,
  203. enum htt_cmn_pkt_type val);
  204. /**
  205. * @brief set the Rx decapsulation type of the VDEV
  206. * @details
  207. * This will be used to configure into firmware and hardware
  208. * which format to decap all Rx packets into, for all peers under
  209. * the VDEV.
  210. * @param vdev - the data virtual device object
  211. * @param val - the Rx decap mode
  212. * @return - void
  213. */
  214. void
  215. (*txrx_set_vdev_rx_decap_type)(
  216. struct cdp_vdev *vdev,
  217. enum htt_cmn_pkt_type val);
  218. /**
  219. * @brief get the Rx decapsulation type of the VDEV
  220. *
  221. * @param vdev - the data virtual device object
  222. * @return - the Rx decap type
  223. */
  224. enum htt_cmn_pkt_type
  225. (*txrx_get_vdev_rx_decap_type)(struct cdp_vdev *vdev);
  226. /* Is this similar to ol_txrx_peer_state_update() in MCL */
  227. /**
  228. * @brief Update the authorize peer object at association time
  229. * @details
  230. * For the host-based implementation of rate-control, it
  231. * updates the peer/node-related parameters within rate-control
  232. * context of the peer at association.
  233. *
  234. * @param peer - pointer to the node's object
  235. * @authorize - either to authorize or unauthorize peer
  236. *
  237. * @return none
  238. */
  239. void
  240. (*txrx_peer_authorize)(void *peer,
  241. u_int32_t authorize);
  242. bool
  243. (*txrx_set_inact_params)(struct cdp_pdev *pdev,
  244. u_int16_t inact_check_interval,
  245. u_int16_t inact_normal,
  246. u_int16_t inact_overload);
  247. bool
  248. (*txrx_start_inact_timer)(
  249. struct cdp_pdev *pdev,
  250. bool enable);
  251. /**
  252. * @brief Set the overload status of the radio
  253. * @details
  254. * Set the overload status of the radio, updating the inactivity
  255. * threshold and inactivity count for each node.
  256. *
  257. * @param pdev - the data physical device object
  258. * @param overload - whether the radio is overloaded or not
  259. */
  260. void (*txrx_set_overload)(
  261. struct cdp_pdev *pdev,
  262. bool overload);
  263. /**
  264. * @brief Check the inactivity status of the peer/node
  265. *
  266. * @param peer - pointer to the node's object
  267. * @return true if the node is inactive; otherwise return false
  268. */
  269. bool
  270. (*txrx_peer_is_inact)(void *peer);
  271. /**
  272. * @brief Mark inactivity status of the peer/node
  273. * @details
  274. * If it becomes active, reset inactivity count to reload value;
  275. * if the inactivity status changed, notify umac band steering.
  276. *
  277. * @param peer - pointer to the node's object
  278. * @param inactive - whether the node is inactive or not
  279. */
  280. void (*txrx_mark_peer_inact)(
  281. void *peer,
  282. bool inactive);
  283. /* Should be ol_txrx_ctrl_api.h */
  284. void (*txrx_set_mesh_mode)(struct cdp_vdev *vdev, u_int32_t val);
  285. /**
  286. * @brief setting mesh rx filter
  287. * @details
  288. * based on the bits enabled in the filter packets has to be dropped.
  289. *
  290. * @param vdev - the data virtual device object
  291. * @param val - value to set
  292. */
  293. void (*txrx_set_mesh_rx_filter)(struct cdp_vdev *vdev, uint32_t val);
  294. void (*tx_flush_buffers)(struct cdp_vdev *vdev);
  295. int (*txrx_is_target_ar900b)(struct cdp_vdev *vdev);
  296. };
  297. struct cdp_me_ops {
  298. u_int16_t (*tx_desc_alloc_and_mark_for_mcast_clone)
  299. (struct cdp_pdev *pdev, u_int16_t buf_count);
  300. u_int16_t (*tx_desc_free_and_unmark_for_mcast_clone)(
  301. struct cdp_pdev *pdev,
  302. u_int16_t buf_count);
  303. u_int16_t
  304. (*tx_get_mcast_buf_allocated_marked)
  305. (struct cdp_pdev *pdev);
  306. void
  307. (*tx_me_alloc_descriptor)(struct cdp_pdev *pdev);
  308. void
  309. (*tx_me_free_descriptor)(struct cdp_pdev *pdev);
  310. uint16_t
  311. (*tx_me_convert_ucast)(struct cdp_vdev *vdev,
  312. qdf_nbuf_t wbuf, u_int8_t newmac[][6],
  313. uint8_t newmaccnt);
  314. /* Should be a function pointer in ol_txrx_osif_ops{} */
  315. /**
  316. * @brief notify mcast frame indication from FW.
  317. * @details
  318. * This notification will be used to convert
  319. * multicast frame to unicast.
  320. *
  321. * @param pdev - handle to the ctrl SW's physical device object
  322. * @param vdev_id - ID of the virtual device received the special data
  323. * @param msdu - the multicast msdu returned by FW for host inspect
  324. */
  325. int (*mcast_notify)(struct cdp_pdev *pdev,
  326. u_int8_t vdev_id, qdf_nbuf_t msdu);
  327. };
  328. struct cdp_mon_ops {
  329. void (*txrx_monitor_set_filter_ucast_data)
  330. (struct cdp_pdev *, u_int8_t val);
  331. void (*txrx_monitor_set_filter_mcast_data)
  332. (struct cdp_pdev *, u_int8_t val);
  333. void (*txrx_monitor_set_filter_non_data)
  334. (struct cdp_pdev *, u_int8_t val);
  335. u_int8_t (*txrx_monitor_get_filter_ucast_data)
  336. (struct cdp_vdev *vdev_txrx_handle);
  337. u_int8_t (*txrx_monitor_get_filter_mcast_data)
  338. (struct cdp_vdev *vdev_txrx_handle);
  339. u_int8_t (*txrx_monitor_get_filter_non_data)
  340. (struct cdp_vdev *vdev_txrx_handle);
  341. int (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev);
  342. };
  343. struct cdp_host_stats_ops {
  344. int (*txrx_host_stats_get)(struct cdp_vdev *vdev,
  345. struct ol_txrx_stats_req *req,
  346. enum cdp_host_txrx_stats type);
  347. void (*txrx_host_ce_stats)(struct cdp_vdev *vdev);
  348. int (*txrx_stats_publish)(struct cdp_pdev *pdev,
  349. void *buf);
  350. /**
  351. * @brief Enable enhanced stats functionality.
  352. *
  353. * @param pdev - the physical device object
  354. * @return - void
  355. */
  356. void (*txrx_enable_enhanced_stats)(struct cdp_pdev *pdev);
  357. /**
  358. * @brief Disable enhanced stats functionality.
  359. *
  360. * @param pdev - the physical device object
  361. * @return - void
  362. */
  363. void (*txrx_disable_enhanced_stats)(struct cdp_pdev *pdev);
  364. /**
  365. * @brief Get the desired stats from the message.
  366. *
  367. * @param pdev - the physical device object
  368. * @param stats_base - stats buffer recieved from FW
  369. * @param type - stats type.
  370. * @return - pointer to requested stat identified by type
  371. */
  372. uint32_t * (*txrx_get_stats_base)(struct cdp_pdev *pdev,
  373. uint32_t *stats_base, uint32_t msg_len, uint8_t type);
  374. void
  375. (*tx_print_tso_stats)(struct cdp_vdev *vdev);
  376. void
  377. (*tx_rst_tso_stats)(struct cdp_vdev *vdev);
  378. void
  379. (*tx_print_sg_stats)(struct cdp_vdev *vdev);
  380. void
  381. (*tx_rst_sg_stats)(struct cdp_vdev *vdev);
  382. void
  383. (*print_rx_cksum_stats)(struct cdp_vdev *vdev);
  384. void
  385. (*rst_rx_cksum_stats)(struct cdp_vdev *vdev);
  386. A_STATUS
  387. (*txrx_host_me_stats)(struct cdp_vdev *vdev);
  388. void
  389. (*txrx_per_peer_stats)(struct cdp_pdev *pdev, char *addr);
  390. int (*txrx_host_msdu_ttl_stats)(struct cdp_vdev *vdev,
  391. struct ol_txrx_stats_req *req);
  392. void
  393. (*print_lro_stats)(struct cdp_vdev *vdev);
  394. void
  395. (*reset_lro_stats)(struct cdp_vdev *vdev);
  396. };
  397. struct cdp_wds_ops {
  398. void
  399. (*txrx_set_wds_rx_policy)(struct cdp_vdev *vdev,
  400. u_int32_t val);
  401. };
  402. struct cdp_raw_ops {
  403. int (*txrx_get_nwifi_mode)(struct cdp_vdev *vdev);
  404. void (*rsim_get_astentry)(struct cdp_vdev *vdev,
  405. qdf_nbuf_t *pnbuf,
  406. struct cdp_raw_ast *raw_ast);
  407. };
  408. #ifdef CONFIG_WIN
  409. struct cdp_pflow_ops {
  410. uint32_t(*pflow_update_pdev_params)(void *,
  411. ol_ath_param_t, uint32_t, void *);
  412. };
  413. #endif /* CONFIG_WIN */
  414. #define LRO_IPV4_SEED_ARR_SZ 5
  415. #define LRO_IPV6_SEED_ARR_SZ 11
  416. /**
  417. * struct cdp_lro_config - set LRO init parameters
  418. * @lro_enable: indicates whether lro is enabled
  419. * @tcp_flag: If the TCP flags from the packet do not match
  420. * the values in this field after masking with TCP flags mask
  421. * below, packet is not LRO eligible
  422. * @tcp_flag_mask: field for comparing the TCP values provided
  423. * above with the TCP flags field in the received packet
  424. * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
  425. * 5-tuple toeplitz hash for ipv4 packets
  426. * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
  427. * 5-tuple toeplitz hash for ipv6 packets
  428. */
  429. struct cdp_lro_hash_config {
  430. uint32_t lro_enable;
  431. uint32_t tcp_flag:9,
  432. tcp_flag_mask:9;
  433. uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
  434. uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
  435. };
  436. struct ol_if_ops {
  437. void (*peer_set_default_routing)(void *scn_handle,
  438. uint8_t *peer_macaddr, uint8_t vdev_id,
  439. bool hash_based, uint8_t ring_num);
  440. int (*peer_rx_reorder_queue_setup)(void *scn_handle,
  441. uint8_t vdev_id, uint8_t *peer_mac,
  442. qdf_dma_addr_t hw_qdesc, int tid, uint16_t queue_num);
  443. int (*peer_rx_reorder_queue_remove)(void *scn_handle,
  444. uint8_t vdev_id, uint8_t *peer_macaddr,
  445. uint32_t tid_mask);
  446. int (*peer_unref_delete)(void *scn_handle, uint8_t vdev_id,
  447. uint8_t *peer_macaddr);
  448. bool (*is_hw_dbs_2x2_capable)(void);
  449. int (*peer_add_wds_entry)(void *ol_soc_handle,
  450. const uint8_t *dest_macaddr, uint8_t *peer_macaddr,
  451. uint32_t flags);
  452. int (*peer_update_wds_entry)(void *ol_soc_handle,
  453. uint8_t *dest_macaddr, uint8_t *peer_macaddr,
  454. uint32_t flags);
  455. void (*peer_del_wds_entry)(void *ol_soc_handle,
  456. uint8_t *wds_macaddr);
  457. QDF_STATUS (*lro_hash_config)(void *scn_handle,
  458. struct cdp_lro_hash_config *lro_hash);
  459. void (*update_dp_stats)(void *soc, void *stats, uint16_t id,
  460. uint8_t type);
  461. /* TODO: Add any other control path calls required to OL_IF/WMA layer */
  462. };
  463. #ifndef CONFIG_WIN
  464. /* From here MCL specific OPs */
  465. /**
  466. * struct cdp_misc_ops - mcl ops not classified
  467. * @set_ibss_vdev_heart_beat_timer:
  468. * @bad_peer_txctl_set_setting:
  469. * @bad_peer_txctl_update_threshold:
  470. * @hl_tdls_flag_reset:
  471. * @tx_non_std:
  472. * @get_vdev_id:
  473. * @set_wisa_mode:
  474. * @runtime_suspend:
  475. * @runtime_resume:
  476. */
  477. struct cdp_misc_ops {
  478. uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_vdev *vdev,
  479. uint16_t timer_value_sec);
  480. void (*set_wmm_param)(struct cdp_pdev *cfg_pdev,
  481. struct ol_tx_wmm_param_t wmm_param);
  482. void (*bad_peer_txctl_set_setting)(struct cdp_pdev *pdev, int enable,
  483. int period, int txq_limit);
  484. void (*bad_peer_txctl_update_threshold)(struct cdp_pdev *pdev,
  485. int level, int tput_thresh, int tx_limit);
  486. void (*hl_tdls_flag_reset)(struct cdp_vdev *vdev, bool flag);
  487. qdf_nbuf_t (*tx_non_std)(struct cdp_vdev *vdev,
  488. enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
  489. uint16_t (*get_vdev_id)(struct cdp_vdev *vdev);
  490. QDF_STATUS (*set_wisa_mode)(struct cdp_vdev *vdev, bool enable);
  491. QDF_STATUS (*runtime_suspend)(struct cdp_pdev *pdev);
  492. QDF_STATUS (*runtime_resume)(struct cdp_pdev *pdev);
  493. int (*get_opmode)(struct cdp_vdev *vdev);
  494. void (*mark_first_wakeup_packet)(uint8_t value);
  495. void (*update_mac_id)(uint8_t vdev_id, uint8_t mac_id);
  496. void (*flush_rx_frames)(void *peer, bool drop);
  497. A_STATUS (*get_intra_bss_fwd_pkts_count)(uint8_t vdev_id,
  498. uint64_t *fwd_tx_packets, uint64_t *fwd_rx_packets);
  499. void (*pkt_log_init)(struct cdp_pdev *handle, void *scn);
  500. void (*pkt_log_con_service)(struct cdp_pdev *pdev, void *scn);
  501. };
  502. /**
  503. * struct cdp_tx_delay_ops - mcl tx delay ops
  504. * @tx_delay:
  505. * @tx_delay_hist:
  506. * @tx_packet_count:
  507. * @tx_set_compute_interval:
  508. */
  509. struct cdp_tx_delay_ops {
  510. void (*tx_delay)(struct cdp_pdev *pdev, uint32_t *queue_delay_microsec,
  511. uint32_t *tx_delay_microsec, int category);
  512. void (*tx_delay_hist)(struct cdp_pdev *pdev,
  513. uint16_t *bin_values, int category);
  514. void (*tx_packet_count)(struct cdp_pdev *pdev,
  515. uint16_t *out_packet_count,
  516. uint16_t *out_packet_loss_count, int category);
  517. void (*tx_set_compute_interval)(struct cdp_pdev *pdev,
  518. uint32_t interval);
  519. };
  520. /**
  521. * struct cdp_pmf_ops - mcl protected management frame ops
  522. * @get_pn_info:
  523. */
  524. struct cdp_pmf_ops {
  525. void (*get_pn_info)(void *peer, uint8_t **last_pn_valid,
  526. uint64_t **last_pn, uint32_t **rmf_pn_replays);
  527. };
  528. /**
  529. * struct cdp_cfg_ops - mcl configuration ops
  530. * @set_cfg_rx_fwd_disabled:
  531. * @set_cfg_packet_log_enabled:
  532. * @cfg_attach:
  533. * @vdev_rx_set_intrabss_fwd:
  534. * @get_opmode:
  535. * @is_rx_fwd_disabled:
  536. * @tx_set_is_mgmt_over_wmi_enabled:
  537. * @is_high_latency:
  538. * @set_flow_control_parameters:
  539. */
  540. struct cdp_cfg_ops {
  541. void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev,
  542. uint8_t disable_rx_fwd);
  543. void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev,
  544. uint8_t val);
  545. struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
  546. void (*vdev_rx_set_intrabss_fwd)(struct cdp_vdev *vdev, bool val);
  547. uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev);
  548. void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value);
  549. int (*is_high_latency)(struct cdp_cfg *cfg_pdev);
  550. void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev,
  551. void *param);
  552. void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val);
  553. };
  554. /**
  555. * struct cdp_flowctl_ops - mcl flow control
  556. * @register_pause_cb:
  557. * @set_desc_global_pool_size:
  558. * @dump_flow_pool_info:
  559. */
  560. struct cdp_flowctl_ops {
  561. QDF_STATUS (*register_pause_cb)(ol_tx_pause_callback_fp);
  562. void (*set_desc_global_pool_size)(uint32_t num_msdu_desc);
  563. void (*dump_flow_pool_info)(void);
  564. };
  565. /**
  566. * struct cdp_lflowctl_ops - mcl legacy flow control ops
  567. * @register_tx_flow_control:
  568. * @deregister_tx_flow_control_cb:
  569. * @flow_control_cb:
  570. * @get_tx_resource:
  571. * @ll_set_tx_pause_q_depth:
  572. * @vdev_flush:
  573. * @vdev_pause:
  574. * @vdev_unpause:
  575. */
  576. struct cdp_lflowctl_ops {
  577. int (*register_tx_flow_control)(uint8_t vdev_id,
  578. ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx);
  579. int (*deregister_tx_flow_control_cb)(uint8_t vdev_id);
  580. void (*flow_control_cb)(struct cdp_vdev *vdev, bool tx_resume);
  581. bool (*get_tx_resource)(uint8_t sta_id,
  582. unsigned int low_watermark,
  583. unsigned int high_watermark_offset);
  584. int (*ll_set_tx_pause_q_depth)(uint8_t vdev_id, int pause_q_depth);
  585. void (*vdev_flush)(struct cdp_vdev *vdev);
  586. void (*vdev_pause)(struct cdp_vdev *vdev, uint32_t reason);
  587. void (*vdev_unpause)(struct cdp_vdev *vdev, uint32_t reason);
  588. };
  589. /**
  590. * struct cdp_ipa_ops - mcl ipa data path ops
  591. * @ipa_get_resource:
  592. * @ipa_set_doorbell_paddr:
  593. * @ipa_set_active:
  594. * @ipa_op_response:
  595. * @ipa_register_op_cb:
  596. * @ipa_get_stat:
  597. * @ipa_tx_data_frame:
  598. */
  599. struct cdp_ipa_ops {
  600. void (*ipa_get_resource)(struct cdp_pdev *pdev,
  601. struct ol_txrx_ipa_resources *ipa_res);
  602. void (*ipa_set_doorbell_paddr)(struct cdp_pdev *pdev,
  603. qdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
  604. qdf_dma_addr_t ipa_rx_uc_doorbell_paddr);
  605. void (*ipa_set_active)(struct cdp_pdev *pdev,
  606. bool uc_active, bool is_tx);
  607. void (*ipa_op_response)(struct cdp_pdev *pdev, uint8_t *op_msg);
  608. void (*ipa_register_op_cb)(struct cdp_pdev *pdev,
  609. void (*ipa_uc_op_cb_type)(uint8_t *op_msg, void *osif_ctxt),
  610. void *osif_dev);
  611. void (*ipa_get_stat)(struct cdp_pdev *pdev);
  612. qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_vdev *vdev, qdf_nbuf_t skb);
  613. void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *cfg_pdev,
  614. uint32_t value);
  615. void (*ipa_uc_get_share_stats)(struct cdp_pdev *pdev,
  616. uint8_t reset_stats);
  617. void (*ipa_uc_set_quota)(struct cdp_pdev *pdev,
  618. uint64_t quota_bytes);
  619. };
  620. /**
  621. * struct cdp_lro_ops - mcl large receive offload ops
  622. * @register_lro_flush_cb:
  623. * @deregister_lro_flush_cb:
  624. */
  625. struct cdp_lro_ops {
  626. void (*register_lro_flush_cb)(void (lro_flush_cb)(void *),
  627. void *(lro_init_cb)(void));
  628. void (*deregister_lro_flush_cb)(void (lro_deinit_cb)(void *));
  629. };
  630. /**
  631. * struct cdp_bus_ops - mcl bus suspend/resume ops
  632. * @bus_suspend:
  633. * @bus_resume:
  634. */
  635. struct cdp_bus_ops {
  636. QDF_STATUS (*bus_suspend)(void);
  637. QDF_STATUS (*bus_resume)(void);
  638. };
  639. /**
  640. * struct cdp_ocb_ops - mcl ocb ops
  641. * @set_ocb_chan_info:
  642. * @get_ocb_chan_info:
  643. */
  644. struct cdp_ocb_ops {
  645. void (*set_ocb_chan_info)(struct cdp_vdev *vdev,
  646. struct ol_txrx_ocb_set_chan ocb_set_chan);
  647. struct ol_txrx_ocb_chan_info *
  648. (*get_ocb_chan_info)(struct cdp_vdev *vdev);
  649. };
  650. /**
  651. * struct cdp_peer_ops - mcl peer related ops
  652. * @register_peer:
  653. * @clear_peer:
  654. * @cfg_attach:
  655. * @find_peer_by_addr:
  656. * @find_peer_by_addr_and_vdev:
  657. * @local_peer_id:
  658. * @peer_find_by_local_id:
  659. * @peer_state_update:
  660. * @get_vdevid:
  661. * @get_vdev_by_sta_id:
  662. * @register_ocb_peer:
  663. * @peer_get_peer_mac_addr:
  664. * @get_peer_state:
  665. * @get_vdev_for_peer:
  666. * @update_ibss_add_peer_num_of_vdev:
  667. * @remove_peers_for_vdev:
  668. * @remove_peers_for_vdev_no_lock:
  669. * @copy_mac_addr_raw:
  670. * @add_last_real_peer:
  671. * @last_assoc_received:
  672. * @last_disassoc_received:
  673. * @last_deauth_received:
  674. * @is_vdev_restore_last_peer:
  675. * @update_last_real_peer:
  676. */
  677. struct cdp_peer_ops {
  678. QDF_STATUS (*register_peer)(struct cdp_pdev *pdev,
  679. struct ol_txrx_desc_type *sta_desc);
  680. QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev, uint8_t sta_id);
  681. QDF_STATUS (*change_peer_state)(uint8_t sta_id,
  682. enum ol_txrx_peer_state sta_state,
  683. bool roam_synch_in_progress);
  684. void * (*find_peer_by_addr)(struct cdp_pdev *pdev,
  685. uint8_t *peer_addr, uint8_t *peer_id);
  686. void * (*find_peer_by_addr_and_vdev)(struct cdp_pdev *pdev,
  687. struct cdp_vdev *vdev,
  688. uint8_t *peer_addr, uint8_t *peer_id);
  689. uint16_t (*local_peer_id)(void *peer);
  690. void * (*peer_find_by_local_id)(struct cdp_pdev *pdev,
  691. uint8_t local_peer_id);
  692. QDF_STATUS (*peer_state_update)(struct cdp_pdev *pdev,
  693. uint8_t *peer_addr,
  694. enum ol_txrx_peer_state state);
  695. QDF_STATUS (*get_vdevid)(void *peer, uint8_t *vdev_id);
  696. struct cdp_vdev * (*get_vdev_by_sta_id)(uint8_t sta_id);
  697. QDF_STATUS (*register_ocb_peer)(void *cds_ctx, uint8_t *mac_addr,
  698. uint8_t *peer_id);
  699. uint8_t * (*peer_get_peer_mac_addr)(void *peer);
  700. int (*get_peer_state)(void *peer);
  701. struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
  702. int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_vdev *vdev,
  703. int16_t peer_num_delta);
  704. void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
  705. ol_txrx_vdev_peer_remove_cb callback,
  706. void *callback_context, bool remove_last_peer);
  707. void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
  708. ol_txrx_vdev_peer_remove_cb callback,
  709. void *callback_context);
  710. void (*copy_mac_addr_raw)(struct cdp_vdev *vdev, uint8_t *bss_addr);
  711. void (*add_last_real_peer)(struct cdp_pdev *pdev,
  712. struct cdp_vdev *vdev, uint8_t *peer_id);
  713. qdf_time_t * (*last_assoc_received)(void *peer);
  714. qdf_time_t * (*last_disassoc_received)(void *peer);
  715. qdf_time_t * (*last_deauth_received)(void *peer);
  716. bool (*is_vdev_restore_last_peer)(void *peer);
  717. void (*update_last_real_peer)(struct cdp_pdev *pdev, void *peer,
  718. uint8_t *peer_id, bool restore_last_peer);
  719. void (*peer_detach_force_delete)(void *peer);
  720. };
  721. /**
  722. * struct cdp_ocb_ops - mcl ocb ops
  723. * @throttle_init_period:
  724. * @throttle_set_level:
  725. */
  726. struct cdp_throttle_ops {
  727. void (*throttle_init_period)(struct cdp_pdev *pdev, int period,
  728. uint8_t *dutycycle_level);
  729. void (*throttle_set_level)(struct cdp_pdev *pdev, int level);
  730. };
  731. /**
  732. * struct cdp_ocb_ops - mcl ocb ops
  733. * @display_stats:
  734. * @clear_stats:
  735. * @stats:
  736. */
  737. struct cdp_mob_stats_ops {
  738. void (*display_stats)(uint16_t bitmap);
  739. void (*clear_stats)(uint16_t bitmap);
  740. int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len);
  741. };
  742. #endif /* CONFIG_WIN */
  743. struct cdp_ops {
  744. struct cdp_cmn_ops *cmn_drv_ops;
  745. struct cdp_ctrl_ops *ctrl_ops;
  746. struct cdp_me_ops *me_ops;
  747. struct cdp_mon_ops *mon_ops;
  748. struct cdp_host_stats_ops *host_stats_ops;
  749. struct cdp_wds_ops *wds_ops;
  750. struct cdp_raw_ops *raw_ops;
  751. struct cdp_pflow_ops *pflow_ops;
  752. #ifndef CONFIG_WIN
  753. struct cdp_misc_ops *misc_ops;
  754. struct cdp_cfg_ops *cfg_ops;
  755. struct cdp_flowctl_ops *flowctl_ops;
  756. struct cdp_lflowctl_ops *l_flowctl_ops;
  757. struct cdp_ipa_ops *ipa_ops;
  758. struct cdp_lro_ops *lro_ops;
  759. struct cdp_bus_ops *bus_ops;
  760. struct cdp_ocb_ops *ocb_ops;
  761. struct cdp_peer_ops *peer_ops;
  762. struct cdp_throttle_ops *throttle_ops;
  763. struct cdp_mob_stats_ops *mob_stats_ops;
  764. struct cdp_tx_delay_ops *delay_ops;
  765. struct cdp_pmf_ops *pmf_ops;
  766. #endif /* CONFIG_WIN */
  767. };
  768. #endif