cdp_txrx_ops.h 37 KB

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