cdp_txrx_ops.h 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661
  1. /*
  2. * Copyright (c) 2017-2019 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. #include <wmi_unified_api.h>
  32. #include <wdi_event_api.h>
  33. #ifdef IPA_OFFLOAD
  34. #ifdef CONFIG_IPA_WDI_UNIFIED_API
  35. #include <qdf_ipa_wdi3.h>
  36. #else
  37. #include <qdf_ipa.h>
  38. #endif
  39. #endif
  40. /**
  41. * bitmap values to indicate special handling of peer_delete
  42. */
  43. #define CDP_PEER_DELETE_NO_SPECIAL 0
  44. #define CDP_PEER_DO_NOT_START_UNMAP_TIMER 1
  45. struct hif_opaque_softc;
  46. /* same as ieee80211_nac_param */
  47. enum cdp_nac_param_cmd {
  48. /* IEEE80211_NAC_PARAM_ADD */
  49. CDP_NAC_PARAM_ADD = 1,
  50. /* IEEE80211_NAC_PARAM_DEL */
  51. CDP_NAC_PARAM_DEL,
  52. /* IEEE80211_NAC_PARAM_LIST */
  53. CDP_NAC_PARAM_LIST,
  54. };
  55. /******************************************************************************
  56. *
  57. * Control Interface (A Interface)
  58. *
  59. *****************************************************************************/
  60. struct cdp_cmn_ops {
  61. QDF_STATUS (*txrx_soc_attach_target)(ol_txrx_soc_handle soc);
  62. int (*txrx_pdev_attach_target)(ol_txrx_soc_handle soc, uint8_t pdev_id);
  63. struct cdp_vdev *(*txrx_vdev_attach)
  64. (struct cdp_soc_t *soc, uint8_t pdev_id, uint8_t *mac,
  65. uint8_t vdev_id, enum wlan_op_mode op_mode,
  66. enum wlan_op_subtype subtype);
  67. QDF_STATUS
  68. (*txrx_vdev_detach)(struct cdp_soc_t *cdp_soc, uint8_t vdev_id,
  69. ol_txrx_vdev_delete_cb callback,
  70. void *cb_context);
  71. struct cdp_pdev *(*txrx_pdev_attach)
  72. (ol_txrx_soc_handle soc, HTC_HANDLE htc_pdev,
  73. qdf_device_t osdev, uint8_t pdev_id);
  74. int (*txrx_pdev_post_attach)(struct cdp_pdev *pdev);
  75. void
  76. (*txrx_pdev_pre_detach)(struct cdp_pdev *pdev, int force);
  77. QDF_STATUS
  78. (*txrx_pdev_detach)(struct cdp_soc_t *psoc, uint8_t pdev_id,
  79. int force);
  80. /**
  81. * txrx_pdev_deinit() - Deinitialize pdev and dp ring memory
  82. * @soc: soc dp handle
  83. * @pdev_id: id of Dp pdev handle
  84. * @force: Force deinit or not
  85. *
  86. * Return: QDF_STATUS
  87. */
  88. QDF_STATUS
  89. (*txrx_pdev_deinit)(struct cdp_soc_t *soc, uint8_t pdev_id,
  90. int force);
  91. void *(*txrx_peer_create)
  92. (ol_txrx_soc_handle soc, uint8_t vdev_id,
  93. uint8_t *peer_mac_addr);
  94. QDF_STATUS
  95. (*txrx_peer_setup)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  96. uint8_t *peer_mac);
  97. QDF_STATUS
  98. (*txrx_cp_peer_del_response)
  99. (ol_txrx_soc_handle soc, uint8_t vdev_id,
  100. uint8_t *peer_mac_addr);
  101. QDF_STATUS
  102. (*txrx_peer_teardown)
  103. (struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *peer_mac);
  104. int (*txrx_peer_add_ast)
  105. (ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
  106. uint8_t *mac_addr, enum cdp_txrx_ast_entry_type type,
  107. uint32_t flags);
  108. int (*txrx_peer_update_ast)
  109. (ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
  110. uint8_t *mac_addr, uint32_t flags);
  111. bool (*txrx_peer_get_ast_info_by_soc)
  112. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  113. struct cdp_ast_entry_info *ast_entry_info);
  114. bool (*txrx_peer_get_ast_info_by_pdev)
  115. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  116. uint8_t pdev_id,
  117. struct cdp_ast_entry_info *ast_entry_info);
  118. QDF_STATUS (*txrx_peer_ast_delete_by_soc)
  119. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  120. txrx_ast_free_cb callback,
  121. void *cookie);
  122. QDF_STATUS (*txrx_peer_ast_delete_by_pdev)
  123. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  124. uint8_t pdev_id,
  125. txrx_ast_free_cb callback,
  126. void *cookie);
  127. QDF_STATUS
  128. (*txrx_peer_delete)(struct cdp_soc_t *soc, uint8_t vdev_id,
  129. uint8_t *peer_mac, uint32_t bitmap);
  130. QDF_STATUS (*txrx_set_monitor_mode)(struct cdp_soc_t *soc,
  131. uint8_t vdev_id,
  132. uint8_t smart_monitor);
  133. void (*txrx_peer_delete_sync)(void *peer,
  134. QDF_STATUS(*delete_cb)(
  135. uint8_t vdev_id,
  136. uint32_t peerid_cnt,
  137. uint16_t *peerid_list),
  138. uint32_t bitmap);
  139. void (*txrx_peer_unmap_sync_cb_set)(struct cdp_pdev *pdev,
  140. QDF_STATUS(*unmap_resp_cb)(
  141. uint8_t vdev_id,
  142. uint32_t peerid_cnt,
  143. uint16_t *peerid_list));
  144. uint8_t (*txrx_get_pdev_id_frm_pdev)(struct cdp_pdev *pdev);
  145. bool (*txrx_get_vow_config_frm_pdev)(struct cdp_pdev *pdev);
  146. void (*txrx_pdev_set_chan_noise_floor)(struct cdp_pdev *pdev,
  147. int16_t chan_noise_floor);
  148. void
  149. (*txrx_set_nac)(ol_txrx_soc_handle soc, uint8_t vdev_id,
  150. uint8_t *peer_mac);
  151. /**
  152. * txrx_set_pdev_tx_capture() - callback to set pdev tx_capture
  153. * @soc: opaque soc handle
  154. * @pdev: data path pdev handle
  155. * @val: value of pdev_tx_capture
  156. *
  157. * Return: status: 0 - Success, non-zero: Failure
  158. */
  159. QDF_STATUS (*txrx_set_pdev_tx_capture)(struct cdp_pdev *pdev, int val);
  160. QDF_STATUS
  161. (*txrx_get_peer_mac_from_peer_id)
  162. (struct cdp_soc_t *cdp_soc,
  163. uint32_t peer_id, uint8_t *peer_mac);
  164. void
  165. (*txrx_vdev_tx_lock)(struct cdp_soc_t *soc, uint8_t vdev_id);
  166. void
  167. (*txrx_vdev_tx_unlock)(struct cdp_soc_t *soc, uint8_t vdev_id);
  168. QDF_STATUS
  169. (*txrx_ath_getstats)(struct cdp_soc_t *soc, uint8_t id,
  170. struct cdp_dev_stats *stats, uint8_t type);
  171. QDF_STATUS
  172. (*txrx_set_gid_flag)(struct cdp_soc_t *soc, uint8_t pdev_id,
  173. u_int8_t *mem_status,
  174. u_int8_t *user_position);
  175. uint32_t (*txrx_fw_supported_enh_stats_version)(struct cdp_soc_t *soc,
  176. uint8_t pdev_id);
  177. QDF_STATUS
  178. (*txrx_if_mgmt_drain)(struct cdp_soc_t *soc, uint8_t pdev_id,
  179. int force);
  180. QDF_STATUS
  181. (*txrx_set_curchan)(struct cdp_soc_t *soc, uint8_t pdev_id,
  182. uint32_t chan_mhz);
  183. QDF_STATUS
  184. (*txrx_set_privacy_filters)
  185. (struct cdp_soc_t *soc, uint8_t vdev_id, void *filter,
  186. uint32_t num);
  187. uint32_t (*txrx_get_cfg)(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg);
  188. /********************************************************************
  189. * Data Interface (B Interface)
  190. ********************************************************************/
  191. QDF_STATUS
  192. (*txrx_vdev_register)(struct cdp_soc_t *soc, uint8_t vdev_id,
  193. ol_osif_vdev_handle osif_vdev,
  194. struct ol_txrx_ops *txrx_ops);
  195. int (*txrx_mgmt_send)(struct cdp_soc_t *soc, uint8_t vdev_id,
  196. qdf_nbuf_t tx_mgmt_frm, uint8_t type);
  197. int (*txrx_mgmt_send_ext)(struct cdp_soc_t *soc, uint8_t vdev_id,
  198. qdf_nbuf_t tx_mgmt_frm, uint8_t type,
  199. uint8_t use_6mbps, uint16_t chanfreq);
  200. /**
  201. * ol_txrx_mgmt_tx_cb - tx management delivery notification
  202. * callback function
  203. */
  204. QDF_STATUS
  205. (*txrx_mgmt_tx_cb_set)(struct cdp_soc_t *soc, uint8_t pdev_id,
  206. uint8_t type,
  207. ol_txrx_mgmt_tx_cb download_cb,
  208. ol_txrx_mgmt_tx_cb ota_ack_cb,
  209. void *ctxt);
  210. int (*txrx_get_tx_pending)(struct cdp_pdev *pdev);
  211. /**
  212. * ol_txrx_data_tx_cb - Function registered with the data path
  213. * that is called when tx frames marked as "no free" are
  214. * done being transmitted
  215. */
  216. void (*txrx_data_tx_cb_set)(struct cdp_vdev *data_vdev,
  217. ol_txrx_data_tx_cb callback, void *ctxt);
  218. /*******************************************************************
  219. * Statistics and Debugging Interface (C Interface)
  220. ********************************************************************/
  221. int (*txrx_aggr_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id,
  222. int max_subfrms_ampdu,
  223. int max_subfrms_amsdu);
  224. A_STATUS
  225. (*txrx_fw_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id,
  226. struct ol_txrx_stats_req *req,
  227. bool per_vdev, bool response_expected);
  228. int (*txrx_debug)(struct cdp_soc_t *soc, uint8_t vdev_id,
  229. int debug_specs);
  230. QDF_STATUS
  231. (*txrx_fw_stats_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id,
  232. uint8_t cfg_stats_type, uint32_t cfg_val);
  233. void (*txrx_print_level_set)(unsigned level);
  234. /**
  235. * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev
  236. * @vdev: vdev handle
  237. *
  238. * Return: vdev mac address
  239. */
  240. uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_vdev *vdev);
  241. /**
  242. * ol_txrx_get_vdev_struct_mac_addr() - Return handle to struct qdf_mac_addr of
  243. * vdev
  244. * @vdev: vdev handle
  245. *
  246. * Return: Handle to struct qdf_mac_addr
  247. */
  248. struct qdf_mac_addr *
  249. (*txrx_get_vdev_struct_mac_addr)(struct cdp_vdev *vdev);
  250. /**
  251. * ol_txrx_get_pdev_from_vdev() - Return handle to pdev of vdev
  252. * @vdev: vdev handle
  253. *
  254. * Return: Handle to pdev
  255. */
  256. struct cdp_pdev *(*txrx_get_pdev_from_vdev)
  257. (struct cdp_vdev *vdev);
  258. /**
  259. * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
  260. * @vdev: vdev handle
  261. *
  262. * Return: Handle to control pdev
  263. */
  264. struct cdp_cfg *
  265. (*txrx_get_ctrl_pdev_from_vdev)(struct cdp_vdev *vdev);
  266. /**
  267. * txrx_get_mon_vdev_from_pdev() - Return monitor mode vdev
  268. * @pdev: pdev handle
  269. *
  270. * Return: Handle to vdev
  271. */
  272. struct cdp_vdev *
  273. (*txrx_get_mon_vdev_from_pdev)(struct cdp_pdev *pdev);
  274. void (*txrx_soc_detach)(struct cdp_soc_t *soc);
  275. /**
  276. * txrx_soc_deinit() - Deinitialize dp soc and dp ring memory
  277. * @soc: Opaque Dp handle
  278. *
  279. * Return None
  280. */
  281. void (*txrx_soc_deinit)(struct cdp_soc_t *soc);
  282. /**
  283. * txrx_soc_init() - Initialize dp soc and dp ring memory
  284. * @soc: Opaque Dp handle
  285. * @ctrl_psoc: Opaque Cp handle
  286. * @htchdl: Opaque htc handle
  287. * @hifhdl: Opaque hif handle
  288. *
  289. * Return: None
  290. */
  291. void *(*txrx_soc_init)(struct cdp_soc_t *soc,
  292. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  293. struct hif_opaque_softc *hif_handle,
  294. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  295. struct ol_if_ops *ol_ops, uint16_t device_id);
  296. /**
  297. * txrx_tso_soc_attach() - TSO attach handler triggered during
  298. * dynamic tso activation
  299. * @soc: Opaque Dp handle
  300. *
  301. * Return: QDF status
  302. */
  303. QDF_STATUS (*txrx_tso_soc_attach)(struct cdp_soc_t *soc);
  304. /**
  305. * txrx_tso_soc_detach() - TSO detach handler triggered during
  306. * dynamic tso de-activation
  307. * @soc: Opaque Dp handle
  308. *
  309. * Return: QDF status
  310. */
  311. QDF_STATUS (*txrx_tso_soc_detach)(struct cdp_soc_t *soc);
  312. int (*addba_resp_tx_completion)(struct cdp_soc_t *cdp_soc,
  313. uint8_t *peer_mac,
  314. uint16_t vdev_id, uint8_t tid,
  315. int status);
  316. int (*addba_requestprocess)(struct cdp_soc_t *cdp_soc,
  317. uint8_t *peer_mac,
  318. uint16_t vdev_id,
  319. uint8_t dialogtoken,
  320. uint16_t tid, uint16_t batimeout,
  321. uint16_t buffersize,
  322. uint16_t startseqnum);
  323. QDF_STATUS
  324. (*addba_responsesetup)(struct cdp_soc_t *cdp_soc,
  325. uint8_t *peer_mac,
  326. uint16_t vdev_id, uint8_t tid,
  327. uint8_t *dialogtoken, uint16_t *statuscode,
  328. uint16_t *buffersize, uint16_t *batimeout);
  329. int (*delba_process)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
  330. uint16_t vdev_id, int tid, uint16_t reasoncode);
  331. /**
  332. * delba_tx_completion() - Indicate delba tx status
  333. * @cdp_soc: soc handle
  334. * @peer_mac: Peer mac address
  335. * @vdev_id: vdev id
  336. * @tid: Tid number
  337. * @status: Tx completion status
  338. *
  339. * Return: 0 on Success, 1 on failure
  340. */
  341. int (*delba_tx_completion)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
  342. uint16_t vdev_id,
  343. uint8_t tid, int status);
  344. QDF_STATUS
  345. (*set_addba_response)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
  346. uint16_t vdev_id, uint8_t tid,
  347. uint16_t statuscode);
  348. QDF_STATUS
  349. (*set_vdev_dscp_tid_map)(struct cdp_soc_t *soc_handle,
  350. uint8_t vdev_id, uint8_t map_id);
  351. int (*txrx_get_total_per)(struct cdp_soc_t *soc, uint8_t pdev_id);
  352. void (*flush_cache_rx_queue)(void);
  353. QDF_STATUS (*set_pdev_dscp_tid_map)(struct cdp_soc_t *soc_handle,
  354. uint8_t pdev_id,
  355. uint8_t map_id,
  356. uint8_t tos, uint8_t tid);
  357. void (*hmmc_tid_override_en)(struct cdp_pdev *pdev, bool val);
  358. void (*set_hmmc_tid_val)(struct cdp_pdev *pdev, uint8_t tid);
  359. QDF_STATUS (*txrx_stats_request)(struct cdp_soc_t *soc_handle,
  360. uint8_t vdev_id,
  361. struct cdp_txrx_stats_req *req);
  362. QDF_STATUS (*display_stats)(struct cdp_soc_t *psoc, uint16_t value,
  363. enum qdf_stats_verbosity_level level);
  364. void (*txrx_soc_set_nss_cfg)(ol_txrx_soc_handle soc, int config);
  365. int(*txrx_soc_get_nss_cfg)(ol_txrx_soc_handle soc);
  366. QDF_STATUS (*txrx_intr_attach)(struct cdp_soc_t *soc_handle);
  367. void (*txrx_intr_detach)(struct cdp_soc_t *soc_handle);
  368. QDF_STATUS (*set_pn_check)(struct cdp_soc_t *soc_handle,
  369. uint8_t vdev_id, uint8_t *peermac,
  370. enum cdp_sec_type sec_type,
  371. uint32_t *rx_pn);
  372. QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc,
  373. struct cdp_config_params *params);
  374. void *(*get_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id);
  375. void (*set_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id,
  376. void *dp_hdl);
  377. void *(*get_soc_dp_txrx_handle)(struct cdp_soc *soc_handle);
  378. void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle,
  379. void *dp_txrx_handle);
  380. QDF_STATUS (*map_pdev_to_lmac)(ol_txrx_soc_handle soc, uint8_t pdev_id,
  381. uint32_t lmac_id);
  382. QDF_STATUS (*set_pdev_status_down)(struct cdp_soc_t *soc_handle,
  383. uint8_t pdev_id, bool is_pdev_down);
  384. QDF_STATUS (*txrx_peer_reset_ast)
  385. (ol_txrx_soc_handle soc, uint8_t *ast_macaddr,
  386. uint8_t *peer_macaddr, uint8_t vdev_id);
  387. QDF_STATUS (*txrx_peer_reset_ast_table)(ol_txrx_soc_handle soc,
  388. uint8_t vdev_id);
  389. void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc);
  390. void (*txrx_set_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
  391. uint8_t ac, uint32_t value);
  392. void (*txrx_get_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
  393. uint8_t ac, uint32_t *value);
  394. QDF_STATUS (*txrx_peer_map_attach)(ol_txrx_soc_handle soc,
  395. uint32_t num_peers,
  396. uint32_t max_ast_index,
  397. bool peer_map_unmap_v2);
  398. ol_txrx_tx_fp tx_send;
  399. /**
  400. * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev
  401. * to deliver pkt to stack.
  402. * @vdev: vdev handle
  403. * @stack_fn: pointer to - function pointer to deliver RX pkt to stack
  404. * @osif_vdev: pointer to - osif vdev to deliver RX packet to.
  405. */
  406. void (*txrx_get_os_rx_handles_from_vdev)
  407. (struct cdp_vdev *vdev,
  408. ol_txrx_rx_fp *stack_fn,
  409. ol_osif_vdev_handle *osif_vdev);
  410. int (*txrx_classify_update)
  411. (struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t skb,
  412. enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class);
  413. bool (*get_dp_capabilities)(struct cdp_soc_t *soc,
  414. enum cdp_capabilities dp_caps);
  415. void (*set_rate_stats_ctx)(struct cdp_soc_t *soc, void *ctx);
  416. void* (*get_rate_stats_ctx)(struct cdp_soc_t *soc);
  417. QDF_STATUS (*txrx_peer_flush_rate_stats)(struct cdp_soc_t *soc,
  418. uint8_t pdev_id,
  419. void *buf);
  420. QDF_STATUS (*txrx_flush_rate_stats_request)(struct cdp_soc_t *soc,
  421. uint8_t pdev_id);
  422. QDF_STATUS (*set_pdev_pcp_tid_map)(struct cdp_soc_t *soc,
  423. uint8_t pdev_id,
  424. uint8_t pcp, uint8_t tid);
  425. QDF_STATUS (*set_pdev_tidmap_prty)(struct cdp_pdev *pdev, uint8_t prty);
  426. QDF_STATUS (*set_vdev_pcp_tid_map)(struct cdp_soc_t *soc,
  427. uint8_t vdev_id,
  428. uint8_t pcp, uint8_t tid);
  429. QDF_STATUS (*set_vdev_tidmap_prty)(struct cdp_vdev *vdev, uint8_t prty);
  430. QDF_STATUS (*set_vdev_tidmap_tbl_id)(struct cdp_vdev *vdev,
  431. uint8_t mapid);
  432. #ifdef QCA_MULTIPASS_SUPPORT
  433. QDF_STATUS (*set_vlan_groupkey)(struct cdp_soc_t *soc, uint8_t vdev_id,
  434. uint16_t vlan_id, uint16_t group_key);
  435. #endif
  436. };
  437. struct cdp_ctrl_ops {
  438. int
  439. (*txrx_mempools_attach)(void *ctrl_pdev);
  440. int
  441. (*txrx_set_filter_neighbour_peers)(
  442. struct cdp_pdev *pdev,
  443. uint32_t val);
  444. int
  445. (*txrx_update_filter_neighbour_peers)(
  446. struct cdp_vdev *vdev,
  447. uint32_t cmd, uint8_t *macaddr);
  448. /**
  449. * @brief set the safemode of the device
  450. * @details
  451. * This flag is used to bypass the encrypt and decrypt processes when
  452. * send and receive packets. It works like open AUTH mode, HW will
  453. * ctreate all packets as non-encrypt frames because no key installed.
  454. * For rx fragmented frames,it bypasses all the rx defragmentaion.
  455. *
  456. * @param vdev - the data virtual device object
  457. * @param val - the safemode state
  458. * @return - void
  459. */
  460. void
  461. (*txrx_set_safemode)(
  462. struct cdp_vdev *vdev,
  463. u_int32_t val);
  464. /**
  465. * @brief configure the drop unencrypted frame flag
  466. * @details
  467. * Rx related. When set this flag, all the unencrypted frames
  468. * received over a secure connection will be discarded
  469. *
  470. * @param vdev - the data virtual device object
  471. * @param val - flag
  472. * @return - void
  473. */
  474. void
  475. (*txrx_set_drop_unenc)(
  476. struct cdp_vdev *vdev,
  477. u_int32_t val);
  478. /**
  479. * @brief set the Tx encapsulation type of the VDEV
  480. * @details
  481. * This will be used to populate the HTT desc packet type field
  482. * during Tx
  483. * @param vdev - the data virtual device object
  484. * @param val - the Tx encap type
  485. * @return - void
  486. */
  487. void
  488. (*txrx_set_tx_encap_type)(
  489. struct cdp_vdev *vdev,
  490. enum htt_cmn_pkt_type val);
  491. /**
  492. * @brief set the Rx decapsulation type of the VDEV
  493. * @details
  494. * This will be used to configure into firmware and hardware
  495. * which format to decap all Rx packets into, for all peers under
  496. * the VDEV.
  497. * @param vdev - the data virtual device object
  498. * @param val - the Rx decap mode
  499. * @return - void
  500. */
  501. void
  502. (*txrx_set_vdev_rx_decap_type)(
  503. struct cdp_vdev *vdev,
  504. enum htt_cmn_pkt_type val);
  505. /**
  506. * @brief get the Rx decapsulation type of the VDEV
  507. *
  508. * @param vdev - the data virtual device object
  509. * @return - the Rx decap type
  510. */
  511. enum htt_cmn_pkt_type
  512. (*txrx_get_vdev_rx_decap_type)(struct cdp_vdev *vdev);
  513. /* Is this similar to ol_txrx_peer_state_update() in MCL */
  514. /**
  515. * @brief Update the authorize peer object at association time
  516. * @details
  517. * For the host-based implementation of rate-control, it
  518. * updates the peer/node-related parameters within rate-control
  519. * context of the peer at association.
  520. *
  521. * @param peer - pointer to the node's object
  522. * @authorize - either to authorize or unauthorize peer
  523. *
  524. * @return none
  525. */
  526. void
  527. (*txrx_peer_authorize)(struct cdp_peer *peer,
  528. u_int32_t authorize);
  529. /* Should be ol_txrx_ctrl_api.h */
  530. void (*txrx_set_mesh_mode)(struct cdp_vdev *vdev, u_int32_t val);
  531. /**
  532. * @brief setting mesh rx filter
  533. * @details
  534. * based on the bits enabled in the filter packets has to be dropped.
  535. *
  536. * @param vdev - the data virtual device object
  537. * @param val - value to set
  538. */
  539. void (*txrx_set_mesh_rx_filter)(struct cdp_vdev *vdev, uint32_t val);
  540. void (*tx_flush_buffers)(struct cdp_vdev *vdev);
  541. int (*txrx_is_target_ar900b)(struct cdp_vdev *vdev);
  542. void (*txrx_set_vdev_param)(struct cdp_vdev *vdev,
  543. enum cdp_vdev_param_type param, uint32_t val);
  544. void (*txrx_peer_set_nawds)(struct cdp_peer *peer, uint8_t value);
  545. /**
  546. * @brief Set the reo dest ring num of the radio
  547. * @details
  548. * Set the reo destination ring no on which we will receive
  549. * pkts for this radio.
  550. *
  551. * @param pdev - the data physical device object
  552. * @param reo_dest_ring_num - value ranges between 1 - 4
  553. */
  554. void (*txrx_set_pdev_reo_dest)(
  555. struct cdp_pdev *pdev,
  556. enum cdp_host_reo_dest_ring reo_dest_ring_num);
  557. /**
  558. * @brief Get the reo dest ring num of the radio
  559. * @details
  560. * Get the reo destination ring no on which we will receive
  561. * pkts for this radio.
  562. *
  563. * @param pdev - the data physical device object
  564. * @return the reo destination ring number
  565. */
  566. enum cdp_host_reo_dest_ring (*txrx_get_pdev_reo_dest)(
  567. struct cdp_pdev *pdev);
  568. int (*txrx_wdi_event_sub)(struct cdp_pdev *pdev, void *event_cb_sub,
  569. uint32_t event);
  570. int (*txrx_wdi_event_unsub)(struct cdp_pdev *pdev, void *event_cb_sub,
  571. uint32_t event);
  572. int (*txrx_get_sec_type)(struct cdp_peer *peer, uint8_t sec_idx);
  573. void (*txrx_update_mgmt_txpow_vdev)(struct cdp_vdev *vdev,
  574. uint8_t subtype, uint8_t tx_power);
  575. /**
  576. * txrx_set_pdev_param() - callback to set pdev parameter
  577. * @soc: opaque soc handle
  578. * @pdev: data path pdev handle
  579. * @val: value of pdev_tx_capture
  580. *
  581. * Return: status: 0 - Success, non-zero: Failure
  582. */
  583. QDF_STATUS (*txrx_set_pdev_param)(struct cdp_pdev *pdev,
  584. enum cdp_pdev_param_type type,
  585. uint32_t val);
  586. void * (*txrx_get_pldev)(struct cdp_pdev *pdev);
  587. #ifdef ATH_SUPPORT_NAC_RSSI
  588. QDF_STATUS (*txrx_vdev_config_for_nac_rssi)(struct cdp_vdev *vdev,
  589. enum cdp_nac_param_cmd cmd, char *bssid, char *client_macaddr,
  590. uint8_t chan_num);
  591. QDF_STATUS (*txrx_vdev_get_neighbour_rssi)(struct cdp_vdev *vdev,
  592. char *macaddr,
  593. uint8_t *rssi);
  594. #endif
  595. void (*set_key)(struct cdp_peer *peer_handle,
  596. bool is_unicast, uint32_t *key);
  597. uint32_t (*txrx_get_vdev_param)(struct cdp_vdev *vdev,
  598. enum cdp_vdev_param_type param);
  599. int (*enable_peer_based_pktlog)(struct cdp_pdev
  600. *txrx_pdev_handle, char *macaddr, uint8_t enb_dsb);
  601. void (*calculate_delay_stats)(struct cdp_vdev *vdev, qdf_nbuf_t nbuf);
  602. #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
  603. QDF_STATUS (*txrx_update_pdev_rx_protocol_tag)(
  604. struct cdp_pdev *txrx_pdev_handle,
  605. uint32_t protocol_mask, uint16_t protocol_type,
  606. uint16_t tag);
  607. #ifdef WLAN_SUPPORT_RX_TAG_STATISTICS
  608. void (*txrx_dump_pdev_rx_protocol_tag_stats)(
  609. struct cdp_pdev *txrx_pdev_handle,
  610. uint16_t protocol_type);
  611. #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
  612. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
  613. #ifdef WLAN_SUPPORT_RX_FLOW_TAG
  614. QDF_STATUS (*txrx_set_rx_flow_tag)(
  615. struct cdp_pdev *txrx_pdev_handle,
  616. struct cdp_rx_flow_info *flow_info);
  617. QDF_STATUS (*txrx_dump_rx_flow_tag_stats)(
  618. struct cdp_pdev *txrx_pdev_handle,
  619. struct cdp_rx_flow_info *flow_info);
  620. #endif /* WLAN_SUPPORT_RX_FLOW_TAG */
  621. #ifdef QCA_MULTIPASS_SUPPORT
  622. void (*txrx_peer_set_vlan_id)(ol_txrx_soc_handle soc,
  623. struct cdp_vdev *vdev, uint8_t *peer_mac,
  624. uint16_t vlan_id);
  625. #endif
  626. #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH)
  627. QDF_STATUS (*txrx_update_peer_pkt_capture_params)(
  628. struct cdp_pdev *txrx_pdev_handle,
  629. bool is_rx_pkt_cap_enable, bool is_tx_pkt_cap_enable,
  630. uint8_t *peer_mac);
  631. #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */
  632. };
  633. struct cdp_me_ops {
  634. u_int16_t (*tx_desc_alloc_and_mark_for_mcast_clone)
  635. (struct cdp_pdev *pdev, u_int16_t buf_count);
  636. u_int16_t (*tx_desc_free_and_unmark_for_mcast_clone)(
  637. struct cdp_pdev *pdev,
  638. u_int16_t buf_count);
  639. u_int16_t
  640. (*tx_get_mcast_buf_allocated_marked)
  641. (struct cdp_pdev *pdev);
  642. void
  643. (*tx_me_alloc_descriptor)(struct cdp_pdev *pdev);
  644. void
  645. (*tx_me_free_descriptor)(struct cdp_pdev *pdev);
  646. uint16_t
  647. (*tx_me_convert_ucast)(struct cdp_vdev *vdev,
  648. qdf_nbuf_t wbuf, u_int8_t newmac[][6],
  649. uint8_t newmaccnt);
  650. /* Should be a function pointer in ol_txrx_osif_ops{} */
  651. /**
  652. * @brief notify mcast frame indication from FW.
  653. * @details
  654. * This notification will be used to convert
  655. * multicast frame to unicast.
  656. *
  657. * @param pdev - handle to the ctrl SW's physical device object
  658. * @param vdev_id - ID of the virtual device received the special data
  659. * @param msdu - the multicast msdu returned by FW for host inspect
  660. */
  661. int (*mcast_notify)(struct cdp_pdev *pdev,
  662. u_int8_t vdev_id, qdf_nbuf_t msdu);
  663. };
  664. struct cdp_mon_ops {
  665. void (*txrx_monitor_set_filter_ucast_data)
  666. (struct cdp_pdev *, u_int8_t val);
  667. void (*txrx_monitor_set_filter_mcast_data)
  668. (struct cdp_pdev *, u_int8_t val);
  669. void (*txrx_monitor_set_filter_non_data)
  670. (struct cdp_pdev *, u_int8_t val);
  671. bool (*txrx_monitor_get_filter_ucast_data)
  672. (struct cdp_vdev *vdev_txrx_handle);
  673. bool (*txrx_monitor_get_filter_mcast_data)
  674. (struct cdp_vdev *vdev_txrx_handle);
  675. bool (*txrx_monitor_get_filter_non_data)
  676. (struct cdp_vdev *vdev_txrx_handle);
  677. QDF_STATUS (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev);
  678. /* HK advance monitor filter support */
  679. QDF_STATUS (*txrx_set_advance_monitor_filter)
  680. (struct cdp_pdev *pdev, struct cdp_monitor_filter *filter_val);
  681. void (*txrx_monitor_record_channel)
  682. (struct cdp_pdev *, int val);
  683. void (*txrx_deliver_tx_mgmt)
  684. (struct cdp_pdev *pdev, qdf_nbuf_t nbuf);
  685. void (*txrx_set_bsscolor)
  686. (struct cdp_pdev *pdev, uint8_t bsscolor);
  687. };
  688. #ifdef WLAN_FEATURE_PKT_CAPTURE
  689. struct cdp_pktcapture_ops {
  690. void (*txrx_pktcapture_set_mode)
  691. (struct cdp_soc_t *soc,
  692. uint8_t pdev_id,
  693. uint8_t mode);
  694. uint8_t (*txrx_pktcapture_get_mode)
  695. (struct cdp_soc_t *soc,
  696. uint8_t pdev_id);
  697. QDF_STATUS (*txrx_pktcapture_cb_register)
  698. (struct cdp_soc_t *soc,
  699. uint8_t pdev_id,
  700. void *context,
  701. QDF_STATUS(cb)(void *, qdf_nbuf_t));
  702. QDF_STATUS (*txrx_pktcapture_cb_deregister)
  703. (struct cdp_soc_t *soc,
  704. uint8_t pdev_id);
  705. QDF_STATUS (*txrx_pktcapture_mgmtpkt_process)
  706. (struct cdp_soc_t *soc,
  707. uint8_t pdev_id,
  708. struct mon_rx_status *txrx_status,
  709. qdf_nbuf_t nbuf, uint8_t status);
  710. void (*txrx_pktcapture_record_channel)
  711. (struct cdp_soc_t *soc,
  712. uint8_t pdev_id,
  713. int chan_no);
  714. };
  715. #endif /* #ifdef WLAN_FEATURE_PKT_CAPTURE */
  716. struct cdp_host_stats_ops {
  717. int (*txrx_host_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id,
  718. struct ol_txrx_stats_req *req);
  719. QDF_STATUS (*txrx_host_stats_clr)(struct cdp_soc_t *soc,
  720. uint8_t vdev_id);
  721. QDF_STATUS
  722. (*txrx_host_ce_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  723. int (*txrx_stats_publish)(struct cdp_soc_t *soc, uint8_t pdev_id,
  724. struct cdp_stats_extd *buf);
  725. /**
  726. * @brief Enable enhanced stats functionality.
  727. *
  728. * @param soc - the soc handle
  729. * @param pdev_id - pdev_id of pdev
  730. * @return - QDF_STATUS
  731. */
  732. QDF_STATUS (*txrx_enable_enhanced_stats)(struct cdp_soc_t *soc,
  733. uint8_t pdev_id);
  734. /**
  735. * @brief Disable enhanced stats functionality.
  736. *
  737. * @param soc - the soc handle
  738. * @param pdev_id - pdev_id of pdev
  739. * @return - QDF_STATUS
  740. */
  741. QDF_STATUS (*txrx_disable_enhanced_stats)(struct cdp_soc_t *soc,
  742. uint8_t pdev_id);
  743. QDF_STATUS
  744. (*tx_print_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  745. QDF_STATUS
  746. (*tx_rst_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  747. QDF_STATUS
  748. (*tx_print_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  749. QDF_STATUS
  750. (*tx_rst_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  751. QDF_STATUS
  752. (*print_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  753. QDF_STATUS
  754. (*rst_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  755. QDF_STATUS
  756. (*txrx_host_me_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  757. QDF_STATUS
  758. (*txrx_per_peer_stats)(struct cdp_soc_t *soc, uint8_t *addr);
  759. int (*txrx_host_msdu_ttl_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  760. struct ol_txrx_stats_req *req);
  761. int (*ol_txrx_update_peer_stats)(struct cdp_soc_t *soc,
  762. uint8_t pdev_id,
  763. uint8_t *addr, void *stats,
  764. uint32_t last_tx_rate_mcs,
  765. uint32_t stats_id);
  766. QDF_STATUS
  767. (*get_fw_peer_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  768. uint8_t *addr,
  769. uint32_t cap, uint32_t copy_stats);
  770. QDF_STATUS
  771. (*get_htt_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  772. void *data,
  773. uint32_t data_len);
  774. QDF_STATUS
  775. (*txrx_update_pdev_stats)(struct cdp_soc_t *soc,
  776. uint8_t pdev_id, void *data,
  777. uint16_t stats_id);
  778. QDF_STATUS
  779. (*txrx_get_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  780. uint8_t *peer_mac,
  781. struct cdp_peer_stats *peer_stats);
  782. QDF_STATUS
  783. (*txrx_reset_peer_ald_stats)(struct cdp_soc_t *soc,
  784. uint8_t vdev_id,
  785. uint8_t *peer_mac);
  786. QDF_STATUS
  787. (*txrx_reset_peer_stats)(struct cdp_soc_t *soc,
  788. uint8_t vdev_id, uint8_t *peer_mac);
  789. int
  790. (*txrx_get_vdev_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  791. void *buf, bool is_aggregate);
  792. int
  793. (*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc,
  794. void *data, uint32_t len,
  795. uint32_t stats_id);
  796. int
  797. (*txrx_get_vdev_extd_stats)(struct cdp_soc_t *soc,
  798. uint8_t vdev_id,
  799. wmi_host_vdev_extd_stats *buffer);
  800. QDF_STATUS
  801. (*txrx_update_vdev_stats)(struct cdp_soc_t *soc,
  802. uint8_t vdev_id, void *buf,
  803. uint16_t stats_id);
  804. int
  805. (*txrx_get_radio_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  806. void *buf);
  807. QDF_STATUS
  808. (*txrx_get_pdev_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  809. struct cdp_pdev_stats *buf);
  810. int
  811. (*txrx_get_ratekbps)(int preamb, int mcs,
  812. int htflag, int gintval);
  813. QDF_STATUS
  814. (*configure_rate_stats)(struct cdp_soc_t *soc, uint8_t val);
  815. QDF_STATUS
  816. (*txrx_update_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  817. uint8_t *peer_mac, void *stats,
  818. uint32_t last_tx_rate_mcs,
  819. uint32_t stats_id);
  820. };
  821. struct cdp_wds_ops {
  822. QDF_STATUS
  823. (*txrx_set_wds_rx_policy)(struct cdp_soc_t *soc, uint8_t vdev_id,
  824. u_int32_t val);
  825. QDF_STATUS
  826. (*txrx_wds_peer_tx_policy_update)(struct cdp_soc_t *soc,
  827. uint8_t vdev_id, uint8_t *peer_mac,
  828. int wds_tx_ucast, int wds_tx_mcast);
  829. int (*vdev_set_wds)(struct cdp_soc_t *soc, uint8_t vdev_id,
  830. uint32_t val);
  831. };
  832. struct cdp_raw_ops {
  833. int (*txrx_get_nwifi_mode)(struct cdp_soc_t *soc, uint8_t vdev_id);
  834. QDF_STATUS
  835. (*rsim_get_astentry)(struct cdp_soc_t *soc, uint8_t vdev_id,
  836. qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast);
  837. };
  838. #ifdef PEER_FLOW_CONTROL
  839. struct cdp_pflow_ops {
  840. uint32_t (*pflow_update_pdev_params)(struct cdp_soc_t *soc,
  841. uint8_t pdev_id,
  842. enum _ol_ath_param_t,
  843. uint32_t, void *);
  844. };
  845. #endif /* PEER_FLOW_CONTROL */
  846. #define LRO_IPV4_SEED_ARR_SZ 5
  847. #define LRO_IPV6_SEED_ARR_SZ 11
  848. /**
  849. * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters
  850. * @lro_enable: indicates whether rx_offld is enabled
  851. * @tcp_flag: If the TCP flags from the packet do not match
  852. * the values in this field after masking with TCP flags mask
  853. * below, packet is not rx_offld eligible
  854. * @tcp_flag_mask: field for comparing the TCP values provided
  855. * above with the TCP flags field in the received packet
  856. * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
  857. * 5-tuple toeplitz hash for ipv4 packets
  858. * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
  859. * 5-tuple toeplitz hash for ipv6 packets
  860. */
  861. struct cdp_lro_hash_config {
  862. uint32_t lro_enable;
  863. uint32_t tcp_flag:9,
  864. tcp_flag_mask:9;
  865. uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
  866. uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
  867. };
  868. struct ol_if_ops {
  869. void
  870. (*peer_set_default_routing)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  871. uint8_t pdev_id, uint8_t *peer_macaddr,
  872. uint8_t vdev_id,
  873. bool hash_based, uint8_t ring_num);
  874. QDF_STATUS
  875. (*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  876. uint8_t pdev_id,
  877. uint8_t vdev_id, uint8_t *peer_mac,
  878. qdf_dma_addr_t hw_qdesc, int tid,
  879. uint16_t queue_num,
  880. uint8_t ba_window_size_valid,
  881. uint16_t ba_window_size);
  882. QDF_STATUS
  883. (*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  884. uint8_t pdev_id,
  885. uint8_t vdev_id, uint8_t *peer_macaddr,
  886. uint32_t tid_mask);
  887. int (*peer_unref_delete)(struct cdp_ctrl_objmgr_psoc *psoc,
  888. uint8_t pdev_id,
  889. uint8_t *peer_mac,
  890. uint8_t *vdev_mac, enum wlan_op_mode opmode);
  891. bool (*is_hw_dbs_2x2_capable)(struct wlan_objmgr_psoc *psoc);
  892. int (*peer_add_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
  893. uint8_t vdev_id,
  894. uint8_t *peer_macaddr,
  895. const uint8_t *dest_macaddr,
  896. uint8_t *next_node_mac,
  897. uint32_t flags);
  898. int (*peer_update_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
  899. uint8_t vdev_id,
  900. uint8_t *dest_macaddr,
  901. uint8_t *peer_macaddr,
  902. uint32_t flags);
  903. void (*peer_del_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
  904. uint8_t vdev_id,
  905. uint8_t *wds_macaddr,
  906. uint8_t type);
  907. QDF_STATUS
  908. (*lro_hash_config)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id,
  909. struct cdp_lro_hash_config *rx_offld_hash);
  910. void (*update_dp_stats)(void *soc, void *stats, uint16_t id,
  911. uint8_t type);
  912. #ifdef FEATURE_NAC_RSSI
  913. uint8_t (*rx_invalid_peer)(struct cdp_ctrl_objmgr_psoc *soc,
  914. uint8_t pdev_id, void *msg);
  915. #else
  916. uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh);
  917. #endif
  918. int (*peer_map_event)(struct cdp_ctrl_objmgr_psoc *psoc,
  919. uint16_t peer_id, uint16_t hw_peer_id,
  920. uint8_t vdev_id, uint8_t *peer_mac_addr,
  921. enum cdp_txrx_ast_entry_type peer_type,
  922. uint32_t tx_ast_hashidx);
  923. int (*peer_unmap_event)(struct cdp_ctrl_objmgr_psoc *psoc,
  924. uint16_t peer_id,
  925. uint8_t vdev_id);
  926. int (*get_dp_cfg_param)(struct cdp_ctrl_objmgr_psoc *psoc,
  927. enum cdp_cfg_param_type param_num);
  928. void (*rx_mic_error)(struct cdp_ctrl_objmgr_psoc *psoc,
  929. uint8_t pdev_id,
  930. struct cdp_rx_mic_err_info *info);
  931. bool (*rx_frag_tkip_demic)(struct cdp_ctrl_objmgr_psoc *psoc,
  932. uint8_t vdev_id, uint8_t *peer_mac_addr,
  933. qdf_nbuf_t nbuf,
  934. uint16_t hdr_space);
  935. uint8_t (*freq_to_channel)(struct cdp_ctrl_objmgr_psoc *psoc,
  936. uint8_t vdev_id, uint16_t freq);
  937. #ifdef ATH_SUPPORT_NAC_RSSI
  938. int (*config_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc,
  939. uint8_t pdev_id,
  940. u_int8_t vdev_id,
  941. enum cdp_nac_param_cmd cmd, char *bssid,
  942. char *client_macaddr, uint8_t chan_num);
  943. int
  944. (*config_bssid_in_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc,
  945. uint8_t pdev_id, u_int8_t vdev_id,
  946. enum cdp_nac_param_cmd cmd,
  947. char *bssid, char *client_mac);
  948. #endif
  949. int (*peer_sta_kickout)(struct cdp_ctrl_objmgr_psoc *psoc,
  950. uint16_t pdev_id, uint8_t *peer_macaddr);
  951. /**
  952. * send_delba() - Send delba to peer
  953. * @psoc: Objmgr soc handle
  954. * @vdev_id: dp vdev id
  955. * @peer_macaddr: Peer mac addr
  956. * @tid: Tid number
  957. *
  958. * Return: 0 for success, non-zero for failure
  959. */
  960. int (*send_delba)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t vdev_id,
  961. uint8_t *peer_macaddr, uint8_t tid,
  962. uint8_t reason_code);
  963. int
  964. (*peer_delete_multiple_wds_entries)(struct cdp_ctrl_objmgr_psoc *psoc,
  965. uint8_t vdev_id,
  966. uint8_t *dest_macaddr,
  967. uint8_t *peer_macaddr,
  968. uint32_t flags);
  969. bool (*is_roam_inprogress)(uint32_t vdev_id);
  970. enum QDF_GLOBAL_MODE (*get_con_mode)(void);
  971. /* TODO: Add any other control path calls required to OL_IF/WMA layer */
  972. };
  973. #ifdef DP_PEER_EXTENDED_API
  974. /**
  975. * struct cdp_misc_ops - mcl ops not classified
  976. * @set_ibss_vdev_heart_beat_timer: Update ibss vdev heart beat timer
  977. * @set_wmm_param: set wmm parameters
  978. * @bad_peer_txctl_set_setting: configure bad peer tx limit setting
  979. * @bad_peer_txctl_update_threshold: configure bad peer tx threshold limit
  980. * @hl_tdls_flag_reset: reset tdls flag for vdev
  981. * @tx_non_std: Allow the control-path SW to send data frames
  982. * @get_vdev_id: get vdev id
  983. * @set_wisa_mode: set wisa mode for a vdev
  984. * @txrx_data_stall_cb_register: register data stall callback
  985. * @txrx_data_stall_cb_deregister: deregister data stall callback
  986. * @txrx_post_data_stall_event: post data stall event
  987. * @runtime_suspend: ensure TXRX is ready to runtime suspend
  988. * @runtime_resume: ensure TXRX is ready to runtime resume
  989. * @get_opmode: get operation mode of vdev
  990. * @mark_first_wakeup_packet: set flag to indicate that fw is compatible for
  991. marking first packet after wow wakeup
  992. * @update_mac_id: update mac_id for vdev
  993. * @flush_rx_frames: flush rx frames on the queue
  994. * @get_intra_bss_fwd_pkts_count: to get the total tx and rx packets that
  995. has been forwarded from txrx layer
  996. without going to upper layers
  997. * @pkt_log_init: handler to initialize packet log
  998. * @pkt_log_con_service: handler to connect packet log service
  999. * @get_num_rx_contexts: handler to get number of RX contexts
  1000. * @register_packetdump_cb: register callback for different pktlog
  1001. * @unregister_packetdump_cb: unregister callback for different pktlog
  1002. * @pdev_reset_driver_del_ack: reset driver delayed ack enabled flag
  1003. * @vdev_set_driver_del_ack_enable: set driver delayed ack enabled flag
  1004. *
  1005. * Function pointers for miscellaneous soc/pdev/vdev related operations.
  1006. */
  1007. struct cdp_misc_ops {
  1008. uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_soc_t *soc_hdl,
  1009. uint8_t vdev_id,
  1010. uint16_t timer_value_sec);
  1011. void (*set_wmm_param)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1012. struct ol_tx_wmm_param_t wmm_param);
  1013. void (*bad_peer_txctl_set_setting)(struct cdp_soc_t *soc_hdl,
  1014. uint8_t pdev_id, int enable,
  1015. int period, int txq_limit);
  1016. void (*bad_peer_txctl_update_threshold)(struct cdp_soc_t *soc_hdl,
  1017. uint8_t pdev_id,
  1018. int level, int tput_thresh,
  1019. int tx_limit);
  1020. void (*hl_tdls_flag_reset)(struct cdp_soc_t *soc_hdl,
  1021. uint8_t vdev_id, bool flag);
  1022. qdf_nbuf_t (*tx_non_std)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1023. enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
  1024. uint16_t (*get_vdev_id)(struct cdp_vdev *vdev);
  1025. uint32_t (*get_tx_ack_stats)(struct cdp_soc_t *soc_hdl,
  1026. uint8_t vdev_id);
  1027. QDF_STATUS (*set_wisa_mode)(struct cdp_soc_t *soc_hdl,
  1028. uint8_t vdev_id, bool enable);
  1029. QDF_STATUS (*txrx_data_stall_cb_register)(struct cdp_soc_t *soc_hdl,
  1030. uint8_t pdev_id,
  1031. data_stall_detect_cb cb);
  1032. QDF_STATUS (*txrx_data_stall_cb_deregister)(struct cdp_soc_t *soc_hdl,
  1033. uint8_t pdev_id,
  1034. data_stall_detect_cb cb);
  1035. void (*txrx_post_data_stall_event)(
  1036. struct cdp_soc_t *soc_hdl,
  1037. enum data_stall_log_event_indicator indicator,
  1038. enum data_stall_log_event_type data_stall_type,
  1039. uint32_t pdev_id, uint32_t vdev_id_bitmap,
  1040. enum data_stall_log_recovery_type recovery_type);
  1041. QDF_STATUS (*runtime_suspend)(struct cdp_soc_t *soc_hdl,
  1042. uint8_t pdev_id);
  1043. QDF_STATUS (*runtime_resume)(struct cdp_soc_t *soc_hdl,
  1044. uint8_t pdev_id);
  1045. int (*get_opmode)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  1046. void (*mark_first_wakeup_packet)(struct cdp_soc_t *soc_hdl,
  1047. uint8_t pdev_id, uint8_t value);
  1048. void (*update_mac_id)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1049. uint8_t mac_id);
  1050. void (*flush_rx_frames)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1051. void *peer, bool drop);
  1052. A_STATUS(*get_intra_bss_fwd_pkts_count)(struct cdp_soc_t *soc_hdl,
  1053. uint8_t vdev_id,
  1054. uint64_t *fwd_tx_packets,
  1055. uint64_t *fwd_rx_packets);
  1056. void (*pkt_log_init)(struct cdp_soc_t *soc_hdl, uint8_t pdev,
  1057. void *scn);
  1058. void (*pkt_log_con_service)(struct cdp_soc_t *soc_hdl,
  1059. uint8_t pdev_id, void *scn);
  1060. int (*get_num_rx_contexts)(struct cdp_soc_t *soc_hdl);
  1061. void (*register_pktdump_cb)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1062. ol_txrx_pktdump_cb tx_cb,
  1063. ol_txrx_pktdump_cb rx_cb);
  1064. void (*unregister_pktdump_cb)(struct cdp_soc_t *soc_hdl,
  1065. uint8_t pdev_id);
  1066. void (*pdev_reset_driver_del_ack)(struct cdp_soc_t *soc_hdl,
  1067. uint8_t pdev_id);
  1068. void (*vdev_set_driver_del_ack_enable)(struct cdp_soc_t *soc_hdl,
  1069. uint8_t vdev_id,
  1070. unsigned long rx_packets,
  1071. uint32_t time_in_ms,
  1072. uint32_t high_th,
  1073. uint32_t low_th);
  1074. void (*vdev_set_bundle_require_flag)(uint8_t vdev_id,
  1075. unsigned long tx_bytes,
  1076. uint32_t time_in_ms,
  1077. uint32_t high_th,
  1078. uint32_t low_th);
  1079. void (*pdev_reset_bundle_require_flag)(struct cdp_soc_t *soc_hdl,
  1080. uint8_t pdev_id);
  1081. };
  1082. /**
  1083. * struct cdp_ocb_ops - mcl ocb ops
  1084. * @set_ocb_chan_info: set OCB channel info
  1085. * @get_ocb_chan_info: get OCB channel info
  1086. *
  1087. * Function pointers for operations related to OCB.
  1088. */
  1089. struct cdp_ocb_ops {
  1090. void (*set_ocb_chan_info)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1091. struct ol_txrx_ocb_set_chan ocb_set_chan);
  1092. struct ol_txrx_ocb_chan_info *(*get_ocb_chan_info)(
  1093. struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  1094. };
  1095. /**
  1096. * struct cdp_peer_ops - mcl peer related ops
  1097. * @register_peer:
  1098. * @clear_peer:
  1099. * @cfg_attach:
  1100. * @find_peer_by_addr:
  1101. * @find_peer_by_addr_and_vdev:
  1102. * @local_peer_id:
  1103. * @peer_find_by_local_id:
  1104. * @peer_state_update:
  1105. * @get_vdevid:
  1106. * @get_vdev_by_sta_id:
  1107. * @register_ocb_peer:
  1108. * @peer_get_peer_mac_addr:
  1109. * @get_peer_state:
  1110. * @get_vdev_for_peer:
  1111. * @update_ibss_add_peer_num_of_vdev:
  1112. * @remove_peers_for_vdev:
  1113. * @remove_peers_for_vdev_no_lock:
  1114. * @copy_mac_addr_raw:
  1115. * @add_last_real_peer:
  1116. * @is_vdev_restore_last_peer:
  1117. * @update_last_real_peer:
  1118. */
  1119. struct cdp_peer_ops {
  1120. QDF_STATUS (*register_peer)(struct cdp_pdev *pdev,
  1121. struct ol_txrx_desc_type *sta_desc);
  1122. QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev,
  1123. struct qdf_mac_addr peer_addr);
  1124. QDF_STATUS (*change_peer_state)(uint8_t sta_id,
  1125. enum ol_txrx_peer_state sta_state,
  1126. bool roam_synch_in_progress);
  1127. void * (*peer_get_ref_by_addr)(struct cdp_pdev *pdev,
  1128. uint8_t *peer_addr,
  1129. enum peer_debug_id_type debug_id);
  1130. void (*peer_release_ref)(void *peer, enum peer_debug_id_type debug_id);
  1131. void * (*find_peer_by_addr)(struct cdp_pdev *pdev,
  1132. uint8_t *peer_addr);
  1133. void * (*find_peer_by_addr_and_vdev)(struct cdp_pdev *pdev,
  1134. struct cdp_vdev *vdev,
  1135. uint8_t *peer_addr);
  1136. QDF_STATUS (*peer_state_update)(struct cdp_pdev *pdev,
  1137. uint8_t *peer_addr,
  1138. enum ol_txrx_peer_state state);
  1139. QDF_STATUS (*get_vdevid)(void *peer, uint8_t *vdev_id);
  1140. struct cdp_vdev * (*get_vdev_by_peer_addr)(struct cdp_pdev *pdev,
  1141. struct qdf_mac_addr peer_addr);
  1142. QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr);
  1143. uint8_t * (*peer_get_peer_mac_addr)(void *peer);
  1144. int (*get_peer_state)(void *peer);
  1145. struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
  1146. int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_vdev *vdev,
  1147. int16_t peer_num_delta);
  1148. void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
  1149. ol_txrx_vdev_peer_remove_cb callback,
  1150. void *callback_context, bool remove_last_peer);
  1151. void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
  1152. ol_txrx_vdev_peer_remove_cb callback,
  1153. void *callback_context);
  1154. void (*copy_mac_addr_raw)(struct cdp_vdev *vdev, uint8_t *bss_addr);
  1155. void (*add_last_real_peer)(struct cdp_pdev *pdev,
  1156. struct cdp_vdev *vdev);
  1157. bool (*is_vdev_restore_last_peer)(void *peer);
  1158. void (*update_last_real_peer)(struct cdp_pdev *pdev, void *vdev,
  1159. bool restore_last_peer);
  1160. void (*peer_detach_force_delete)(void *peer);
  1161. void (*set_tdls_offchan_enabled)(void *peer, bool val);
  1162. void (*set_peer_as_tdls_peer)(void *peer, bool val);
  1163. };
  1164. /**
  1165. * struct cdp_mob_stats_ops - mcl mob stats ops
  1166. * @clear_stats: handler to clear ol txrx stats
  1167. * @stats: handler to update ol txrx stats
  1168. */
  1169. struct cdp_mob_stats_ops {
  1170. QDF_STATUS(*clear_stats)(struct cdp_soc_t *soc_hdl,
  1171. uint8_t pdev_id, uint8_t bitmap);
  1172. int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len);
  1173. };
  1174. /**
  1175. * struct cdp_pmf_ops - mcl protected management frame ops
  1176. * @get_pn_info: handler to get pn info from peer
  1177. *
  1178. * Function pointers for pmf related operations.
  1179. */
  1180. struct cdp_pmf_ops {
  1181. void (*get_pn_info)(struct cdp_soc_t *soc, uint8_t *peer_mac,
  1182. uint8_t vdev_id, uint8_t **last_pn_valid,
  1183. uint64_t **last_pn, uint32_t **rmf_pn_replays);
  1184. };
  1185. #endif
  1186. #ifdef DP_FLOW_CTL
  1187. /**
  1188. * struct cdp_cfg_ops - mcl configuration ops
  1189. * @set_cfg_rx_fwd_disabled: set rx_fwd_disabled flag
  1190. * @set_cfg_packet_log_enabled: set is_packet_log_enabled flag
  1191. * @cfg_attach: hardcode the configuration parameters
  1192. * @vdev_rx_set_intrabss_fwd: set disable_intrabss_fwd flag
  1193. * @is_rx_fwd_disabled: get the rx_fwd_disabled flag,
  1194. * 1 enabled, 0 disabled.
  1195. * @tx_set_is_mgmt_over_wmi_enabled: set is_mgmt_over_wmi_enabled flag to
  1196. * indicate that mgmt over wmi is enabled
  1197. * or not,
  1198. * 1 for enabled, 0 for disable
  1199. * @is_high_latency: get device is high or low latency device,
  1200. * 1 high latency bus, 0 low latency bus
  1201. * @set_flow_control_parameters: set flow control parameters
  1202. * @set_flow_steering: set flow_steering_enabled flag
  1203. * @set_ptp_rx_opt_enabled: set is_ptp_rx_opt_enabled flag
  1204. * @set_new_htt_msg_format: set new_htt_msg_format flag
  1205. * @set_peer_unmap_conf_support: set enable_peer_unmap_conf_support flag
  1206. * @get_peer_unmap_conf_support: get enable_peer_unmap_conf_support flag
  1207. * @set_tx_compl_tsf64: set enable_tx_compl_tsf64 flag,
  1208. * 1 enabled, 0 disabled.
  1209. * @get_tx_compl_tsf64: get enable_tx_compl_tsf64 flag,
  1210. * 1 enabled, 0 disabled.
  1211. */
  1212. struct cdp_cfg_ops {
  1213. void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev,
  1214. uint8_t disable_rx_fwd);
  1215. void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev,
  1216. uint8_t val);
  1217. struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
  1218. void (*vdev_rx_set_intrabss_fwd)(struct cdp_vdev *vdev, bool val);
  1219. uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev);
  1220. void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value);
  1221. int (*is_high_latency)(struct cdp_cfg *cfg_pdev);
  1222. void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev,
  1223. void *param);
  1224. void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val);
  1225. void (*set_ptp_rx_opt_enabled)(struct cdp_cfg *cfg_pdev, uint8_t val);
  1226. void (*set_new_htt_msg_format)(uint8_t val);
  1227. void (*set_peer_unmap_conf_support)(bool val);
  1228. bool (*get_peer_unmap_conf_support)(void);
  1229. void (*set_tx_compl_tsf64)(bool val);
  1230. bool (*get_tx_compl_tsf64)(void);
  1231. };
  1232. /**
  1233. * struct cdp_flowctl_ops - mcl flow control
  1234. * @flow_pool_map_handler: handler to map flow_id and pool descriptors
  1235. * @flow_pool_unmap_handler: handler to unmap flow_id and pool descriptors
  1236. * @register_pause_cb: handler to register tx pause callback
  1237. * @set_desc_global_pool_size: handler to set global pool size
  1238. * @dump_flow_pool_info: handler to dump global and flow pool info
  1239. * @tx_desc_thresh_reached: handler to set tx desc threshold
  1240. *
  1241. * Function pointers for operations related to flow control
  1242. */
  1243. struct cdp_flowctl_ops {
  1244. QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc,
  1245. uint8_t pdev_id,
  1246. uint8_t vdev_id);
  1247. void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc,
  1248. uint8_t pdev_id,
  1249. uint8_t vdev_id);
  1250. QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc,
  1251. tx_pause_callback);
  1252. void (*set_desc_global_pool_size)(uint32_t num_msdu_desc);
  1253. void (*dump_flow_pool_info)(struct cdp_soc_t *soc_hdl);
  1254. bool (*tx_desc_thresh_reached)(struct cdp_soc_t *soc_hdl,
  1255. uint8_t vdev_id);
  1256. };
  1257. /**
  1258. * struct cdp_lflowctl_ops - mcl legacy flow control ops
  1259. * @register_tx_flow_control: Register tx flow control callback
  1260. * @set_vdev_tx_desc_limit: Set tx descriptor limit for a vdev
  1261. * @set_vdev_os_queue_status: Set vdev queue status
  1262. * @deregister_tx_flow_control_cb: Deregister tx flow control callback
  1263. * @flow_control_cb: Call osif flow control callback
  1264. * @get_tx_resource: Get tx resources and comapre with watermark
  1265. * @ll_set_tx_pause_q_depth: set pause queue depth
  1266. * @vdev_flush: Flush all packets on a particular vdev
  1267. * @vdev_pause: Pause a particular vdev
  1268. * @vdev_unpause: Unpause a particular vdev
  1269. *
  1270. * Function pointers for operations related to flow control
  1271. */
  1272. struct cdp_lflowctl_ops {
  1273. #ifdef QCA_HL_NETDEV_FLOW_CONTROL
  1274. int (*register_tx_flow_control)(struct cdp_soc_t *soc_hdl,
  1275. uint8_t pdev_id,
  1276. tx_pause_callback flowcontrol);
  1277. int (*set_vdev_tx_desc_limit)(struct cdp_soc_t *soc_hdl,
  1278. uint8_t vdev_id, uint32_t chan_freq);
  1279. int (*set_vdev_os_queue_status)(struct cdp_soc_t *soc_hdl,
  1280. uint8_t vdev_id,
  1281. enum netif_action_type action);
  1282. #else
  1283. int (*register_tx_flow_control)(
  1284. struct cdp_soc_t *soc_hdl,
  1285. uint8_t vdev_id,
  1286. ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx,
  1287. ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause);
  1288. #endif /* QCA_HL_NETDEV_FLOW_CONTROL */
  1289. int (*deregister_tx_flow_control_cb)(struct cdp_soc_t *soc_hdl,
  1290. uint8_t vdev_id);
  1291. void (*flow_control_cb)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1292. bool tx_resume);
  1293. bool (*get_tx_resource)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1294. struct qdf_mac_addr peer_addr,
  1295. unsigned int low_watermark,
  1296. unsigned int high_watermark_offset);
  1297. int (*ll_set_tx_pause_q_depth)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1298. int pause_q_depth);
  1299. void (*vdev_flush)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  1300. void (*vdev_pause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1301. uint32_t reason, uint32_t pause_type);
  1302. void (*vdev_unpause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1303. uint32_t reason, uint32_t pause_type);
  1304. };
  1305. /**
  1306. * struct cdp_throttle_ops - mcl throttle ops
  1307. * @throttle_init_period: handler to initialize tx throttle time
  1308. * @throttle_set_level: handler to set tx throttle level
  1309. */
  1310. struct cdp_throttle_ops {
  1311. void (*throttle_init_period)(struct cdp_soc_t *soc_hdl,
  1312. uint8_t pdev_id, int period,
  1313. uint8_t *dutycycle_level);
  1314. void (*throttle_set_level)(struct cdp_soc_t *soc_hdl,
  1315. uint8_t pdev_id, int level);
  1316. };
  1317. #endif
  1318. #ifdef IPA_OFFLOAD
  1319. /**
  1320. * struct cdp_ipa_ops - mcl ipa data path ops
  1321. * @ipa_get_resource:
  1322. * @ipa_set_doorbell_paddr:
  1323. * @ipa_set_active:
  1324. * @ipa_op_response:
  1325. * @ipa_register_op_cb:
  1326. * @ipa_get_stat:
  1327. * @ipa_tx_data_frame:
  1328. */
  1329. struct cdp_ipa_ops {
  1330. QDF_STATUS (*ipa_get_resource)(struct cdp_soc_t *soc_hdl,
  1331. uint8_t pdev_id);
  1332. QDF_STATUS (*ipa_set_doorbell_paddr)(struct cdp_soc_t *soc_hdl,
  1333. uint8_t pdev_id);
  1334. QDF_STATUS (*ipa_set_active)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1335. bool uc_active, bool is_tx);
  1336. QDF_STATUS (*ipa_op_response)(struct cdp_soc_t *soc_hdl,
  1337. uint8_t pdev_id, uint8_t *op_msg);
  1338. QDF_STATUS (*ipa_register_op_cb)(struct cdp_soc_t *soc_hdl,
  1339. uint8_t pdev_id,
  1340. void (*ipa_uc_op_cb_type)
  1341. (uint8_t *op_msg, void *osif_ctxt),
  1342. void *usr_ctxt);
  1343. QDF_STATUS (*ipa_get_stat)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  1344. qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_soc_t *soc_hdl,
  1345. uint8_t vdev_id, qdf_nbuf_t skb);
  1346. void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *pdev,
  1347. uint32_t value);
  1348. #ifdef FEATURE_METERING
  1349. QDF_STATUS (*ipa_uc_get_share_stats)(struct cdp_soc_t *soc_hdl,
  1350. uint8_t pdev_id,
  1351. uint8_t reset_stats);
  1352. QDF_STATUS (*ipa_uc_set_quota)(struct cdp_soc_t *soc_hdl,
  1353. uint8_t pdev_id, uint64_t quota_bytes);
  1354. #endif
  1355. QDF_STATUS (*ipa_enable_autonomy)(struct cdp_soc_t *soc_hdl,
  1356. uint8_t pdev_id);
  1357. QDF_STATUS (*ipa_disable_autonomy)(struct cdp_soc_t *soc_hdl,
  1358. uint8_t pdev_id);
  1359. #ifdef CONFIG_IPA_WDI_UNIFIED_API
  1360. QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1361. void *ipa_i2w_cb, void *ipa_w2i_cb,
  1362. void *ipa_wdi_meter_notifier_cb,
  1363. uint32_t ipa_desc_size, void *ipa_priv,
  1364. bool is_rm_enabled, uint32_t *tx_pipe_handle,
  1365. uint32_t *rx_pipe_handle, bool is_smmu_enabled,
  1366. qdf_ipa_sys_connect_params_t *sys_in,
  1367. bool over_gsi);
  1368. #else /* CONFIG_IPA_WDI_UNIFIED_API */
  1369. QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1370. void *ipa_i2w_cb, void *ipa_w2i_cb,
  1371. void *ipa_wdi_meter_notifier_cb,
  1372. uint32_t ipa_desc_size, void *ipa_priv,
  1373. bool is_rm_enabled, uint32_t *tx_pipe_handle,
  1374. uint32_t *rx_pipe_handle);
  1375. #endif /* CONFIG_IPA_WDI_UNIFIED_API */
  1376. QDF_STATUS (*ipa_cleanup)(uint32_t tx_pipe_handle,
  1377. uint32_t rx_pipe_handle);
  1378. QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr,
  1379. qdf_ipa_client_type_t prod_client,
  1380. qdf_ipa_client_type_t cons_client,
  1381. uint8_t session_id, bool is_ipv6_enabled);
  1382. QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled);
  1383. QDF_STATUS (*ipa_enable_pipes)(struct cdp_soc_t *soc_hdl,
  1384. uint8_t pdev_id);
  1385. QDF_STATUS (*ipa_disable_pipes)(struct cdp_soc_t *soc_hdl,
  1386. uint8_t pdev_id);
  1387. QDF_STATUS (*ipa_set_perf_level)(int client,
  1388. uint32_t max_supported_bw_mbps);
  1389. bool (*ipa_rx_intrabss_fwd)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1390. qdf_nbuf_t nbuf, bool *fwd_success);
  1391. };
  1392. #endif
  1393. #ifdef DP_POWER_SAVE
  1394. /**
  1395. * struct cdp_tx_delay_ops - mcl tx delay ops
  1396. * @tx_delay: handler to get tx packet delay
  1397. * @tx_delay_hist: handler to get tx packet delay histogram
  1398. * @tx_packet_count: handler to get tx packet count
  1399. * @tx_set_compute_interval: update compute interval period for TSM stats
  1400. *
  1401. * Function pointer for operations related to tx delay.
  1402. */
  1403. struct cdp_tx_delay_ops {
  1404. void (*tx_delay)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1405. uint32_t *queue_delay_microsec,
  1406. uint32_t *tx_delay_microsec, int category);
  1407. void (*tx_delay_hist)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1408. uint16_t *bin_values, int category);
  1409. void (*tx_packet_count)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1410. uint16_t *out_packet_count,
  1411. uint16_t *out_packet_loss_count, int category);
  1412. void (*tx_set_compute_interval)(struct cdp_soc_t *soc_hdl,
  1413. uint8_t pdev_id, uint32_t interval);
  1414. };
  1415. /**
  1416. * struct cdp_bus_ops - mcl bus suspend/resume ops
  1417. * @bus_suspend: handler for bus suspend
  1418. * @bus_resume: handler for bus resume
  1419. */
  1420. struct cdp_bus_ops {
  1421. QDF_STATUS (*bus_suspend)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  1422. QDF_STATUS (*bus_resume)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  1423. };
  1424. #endif
  1425. #ifdef RECEIVE_OFFLOAD
  1426. /**
  1427. * struct cdp_rx_offld_ops - mcl host receive offload ops
  1428. * @register_rx_offld_flush_cb:
  1429. * @deregister_rx_offld_flush_cb:
  1430. */
  1431. struct cdp_rx_offld_ops {
  1432. void (*register_rx_offld_flush_cb)(void (rx_offld_flush_cb)(void *));
  1433. void (*deregister_rx_offld_flush_cb)(void);
  1434. };
  1435. #endif
  1436. struct cdp_ops {
  1437. struct cdp_cmn_ops *cmn_drv_ops;
  1438. struct cdp_ctrl_ops *ctrl_ops;
  1439. struct cdp_me_ops *me_ops;
  1440. struct cdp_mon_ops *mon_ops;
  1441. struct cdp_host_stats_ops *host_stats_ops;
  1442. struct cdp_wds_ops *wds_ops;
  1443. struct cdp_raw_ops *raw_ops;
  1444. struct cdp_pflow_ops *pflow_ops;
  1445. #ifdef DP_PEER_EXTENDED_API
  1446. struct cdp_misc_ops *misc_ops;
  1447. struct cdp_peer_ops *peer_ops;
  1448. struct cdp_ocb_ops *ocb_ops;
  1449. struct cdp_mob_stats_ops *mob_stats_ops;
  1450. struct cdp_pmf_ops *pmf_ops;
  1451. #endif
  1452. #ifdef DP_FLOW_CTL
  1453. struct cdp_cfg_ops *cfg_ops;
  1454. struct cdp_flowctl_ops *flowctl_ops;
  1455. struct cdp_lflowctl_ops *l_flowctl_ops;
  1456. struct cdp_throttle_ops *throttle_ops;
  1457. #endif
  1458. #ifdef DP_POWER_SAVE
  1459. struct cdp_bus_ops *bus_ops;
  1460. struct cdp_tx_delay_ops *delay_ops;
  1461. #endif
  1462. #ifdef IPA_OFFLOAD
  1463. struct cdp_ipa_ops *ipa_ops;
  1464. #endif
  1465. #ifdef RECEIVE_OFFLOAD
  1466. struct cdp_rx_offld_ops *rx_offld_ops;
  1467. #endif
  1468. #ifdef WLAN_FEATURE_PKT_CAPTURE
  1469. struct cdp_pktcapture_ops *pktcapture_ops;
  1470. #endif
  1471. };
  1472. #endif