cdp_txrx_ops.h 24 KB

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