cdp_txrx_ops.h 34 KB

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