cdp_txrx_ops.h 22 KB

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