cdp_txrx_ops.h 34 KB

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