wlan_vdev_mlme.h 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643
  1. /*
  2. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /**
  18. * DOC: Define VDEV MLME structure and APIs
  19. */
  20. #ifndef _WLAN_VDEV_MLME_H_
  21. #define _WLAN_VDEV_MLME_H_
  22. #include <wlan_vdev_mgr_tgt_if_rx_defs.h>
  23. #include <wlan_objmgr_vdev_obj.h>
  24. #include <wlan_vdev_mlme_api.h>
  25. #include <wlan_ext_mlme_obj_types.h>
  26. struct vdev_mlme_obj;
  27. struct cnx_mgr;
  28. /* Requestor ID for multiple vdev restart */
  29. #define MULTIPLE_VDEV_RESTART_REQ_ID 0x1234
  30. /* values for vdev_type */
  31. #define WLAN_VDEV_MLME_TYPE_UNKNOWN 0x0
  32. #define WLAN_VDEV_MLME_TYPE_AP 0x1
  33. #define WLAN_VDEV_MLME_TYPE_STA 0x2
  34. #define WLAN_VDEV_MLME_TYPE_IBSS 0x3
  35. #define WLAN_VDEV_MLME_TYPE_MONITOR 0x4
  36. #define WLAN_VDEV_MLME_TYPE_NAN 0x5
  37. #define WLAN_VDEV_MLME_TYPE_OCB 0x6
  38. #define WLAN_VDEV_MLME_TYPE_NDI 0x7
  39. /* values for vdev_subtype */
  40. #define WLAN_VDEV_MLME_SUBTYPE_UNKNOWN 0x0
  41. #define WLAN_VDEV_MLME_SUBTYPE_P2P_DEVICE 0x1
  42. #define WLAN_VDEV_MLME_SUBTYPE_P2P_CLIENT 0x2
  43. #define WLAN_VDEV_MLME_SUBTYPE_P2P_GO 0x3
  44. #define WLAN_VDEV_MLME_SUBTYPE_PROXY_STA 0x4
  45. #define WLAN_VDEV_MLME_SUBTYPE_MESH 0x5
  46. #define WLAN_VDEV_MLME_SUBTYPE_MESH_11S 0x6
  47. #define WLAN_VDEV_MLME_SUBTYPE_SMART_MONITOR 0x7
  48. /* vdev control flags (per bits) */
  49. #define WLAN_VDEV_MLME_FLAGS_NON_MBSSID_AP 0x00000001
  50. #define WLAN_VDEV_MLME_FLAGS_TRANSMIT_AP 0x00000002
  51. #define WLAN_VDEV_MLME_FLAGS_NON_TRANSMIT_AP 0x00000004
  52. #define WLAN_VDEV_MLME_FLAGS_EMA_MODE 0x00000008
  53. #define WLAN_VDEV_MLME_FLAGS_MBSS_CMN_PARAM 0x00000010
  54. /**
  55. * struct vdev_mlme_proto_generic - generic mlme proto structure
  56. * sent in frames
  57. * @dtim_period: frequency of data transmissions per beacon 1-255
  58. * @slot_time: slot time
  59. * @protection_mode: rts cts protection mode
  60. * @beacon_interval: beacon interval
  61. * @ldpc: low density parity check value
  62. * @nss: number of spatial stream
  63. * @nss_2g: 2.4GHz number of spatial stream
  64. * @nss_5g: 5GHz number of spatial stream
  65. * @tsfadjust: adjusted timer sync value
  66. */
  67. struct vdev_mlme_proto_generic {
  68. uint8_t dtim_period;
  69. uint32_t slot_time;
  70. uint32_t protection_mode;
  71. uint16_t beacon_interval;
  72. uint8_t ldpc;
  73. uint8_t nss;
  74. uint8_t nss_2g;
  75. uint8_t nss_5g;
  76. uint64_t tsfadjust;
  77. };
  78. /**
  79. * struct vdev_mlme_proto_ap - ap specific mlme protocol
  80. * @.
  81. */
  82. struct vdev_mlme_proto_ap {
  83. };
  84. /**
  85. * struct vdev_mlme_proto_sta - sta specific mlme protocol
  86. * @assoc_id: association id of station
  87. * @uapsd_cfg: uapsd configuration
  88. */
  89. struct vdev_mlme_proto_sta {
  90. uint16_t assoc_id;
  91. uint16_t uapsd_cfg;
  92. };
  93. /**
  94. * struct vdev_mlme_proto_bss_color - bss color cfg
  95. * @flags: proposed for future use cases, currently not used.
  96. * @evt_type: bss color collision event.
  97. * @current_bss_color: current bss color.
  98. * @detection_period_ms: scan interval for both AP and STA mode.
  99. * @scan_period_ms: scan period for passive scan to detect collision.
  100. * @free_slot_expiry_time_ms: FW to notify host at timer expiry after
  101. * which Host will disable the bss color.
  102. */
  103. struct vdev_mlme_proto_bss_color {
  104. uint32_t flags;
  105. uint8_t evt_type;
  106. uint32_t current_bss_color;
  107. uint32_t detection_period_ms;
  108. uint32_t scan_period_ms;
  109. uint32_t free_slot_expiry_time_ms;
  110. };
  111. /**
  112. * struct vdev_mlme_vht_info - vdev VHT information
  113. * @caps: vht capabilities
  114. * @subfer: su beam former capability
  115. * @subfee: su beam formee capability
  116. * @mubfer: mu beam former capability
  117. * @mubfee: mu beam formee capability
  118. * @implicit_bf: Implicit BF support
  119. * @sounding_dimension: Beamformer number of sounding dimension
  120. * @bfee_sts_cap: beam formee STA capability
  121. * @allow_vht: vht capability status
  122. */
  123. struct vdev_mlme_vht_info {
  124. uint32_t caps;
  125. uint8_t subfer;
  126. uint8_t mubfer;
  127. uint8_t subfee;
  128. uint8_t mubfee;
  129. uint8_t implicit_bf;
  130. uint8_t sounding_dimension;
  131. uint8_t bfee_sts_cap;
  132. bool allow_vht;
  133. };
  134. /**
  135. * struct vdev_mlme_ht_info - vdev HT information
  136. * @ht_caps: HT capabilities
  137. * @allow_ht: HT capability status
  138. */
  139. struct vdev_mlme_ht_info {
  140. uint32_t ht_caps;
  141. bool allow_ht;
  142. };
  143. /**
  144. * struct vdev_mlme_he_ops_info - vdev mlme HEOPS information
  145. * @he_ops: he ops
  146. */
  147. struct vdev_mlme_he_ops_info {
  148. uint32_t he_ops;
  149. };
  150. #ifdef WLAN_FEATURE_11BE
  151. /**
  152. * struct vdev_mlme_eht_caps_info - vdev mlme EHT capability information
  153. * @eht_maccap_epcspriaccess_support : EPCS Priority Access Supported
  154. * @eht_maccap_ehtomctrl_support : EHT OM Control Support
  155. * @eht_maccap_trigtxop_sharing_mode1: Triggered TXOP Sharing mode1 Support
  156. * @eht_maccap_trigtxop_sharing_mode2: Triggered TXOP Sharing mode2 Support
  157. * @eht_maccap_rtwt_support : Restricted TWT Support
  158. * @eht_maccap_scs_traffic_description : SCS Traffic Description Support
  159. * @eht_maccap_max_mpdu_len : Maximum MPDU Length
  160. * @eht_maccap_max_ampdu_len_exp_etn : Maximum A-MPDU Length Exponent Extension
  161. * @eht_maccap_trs_support : EHT TRS Support
  162. * @eht_maccap_txop_ret_supp_in_txop_mode2: TXOP Return Support In TXOP
  163. * Sharing Mode 2
  164. * @eht_phycap_reserved : Reserved
  165. * @eht_phycap_320mhzin6ghz : Support For 320 MHz In 6 GHz
  166. * @eht_phycap_242tonerubwlt20mhz : Support for 242-tone RU In BW Wider Than
  167. * 20 MHz
  168. * @eht_phycap_ndp4xehtltfand320nsgi : NDP With 4. EHT-LTF And 3.2 .s GI
  169. * @eht_phycap_partialbwulmu : Partial Bandwidth UL MU-MIMO
  170. * @eht_phycap_subfmr : SU Beamformer
  171. * @eht_phycap_subfme : SU Beamformee
  172. * @eht_phycap_bfmesslt80mhz : Beamformee SS (<= 80 MHz)
  173. * @eht_phycap_bfmess160mhz : Beamformee SS (= 160 MHz)
  174. * @eht_phycap_bfmess320mhz : Beamformee SS (= 320 MHz)
  175. * @eht_phycap_numsoundlt80mhz : Number Of Sounding Dimensions (<=80 MHz)
  176. * @eht_phycap_numsound160mhz : Number Of Sounding Dimensions (=160 MHz)
  177. * @eht_phycap_numsound320mhz : Number Of Sounding Dimensions (=320 MHz)
  178. * @eht_phycap_ng16sufb : Ng = 16 SU Feedback
  179. * @eht_phycap_ng16mufb : Ng = 16 MU Feedback
  180. * @eht_phycap_codbk42sufb : Codebook Size {4,2} SU Feedback
  181. * @eht_phycap_codbk75mufb : Codebook Size {4,2} MU Feedback
  182. * @eht_phycap_trigsubffb : Triggered SU Beamforming Feedback
  183. * @eht_phycap_trigmubfpartbwfb : Triggered MU Beamforming Partial B
  184. * Feedback
  185. * @eht_phycap_trigcqifb : Triggered CQI Feedback
  186. * @eht_phycap_partbwdlmumimo : Partial Bandwidth DL MU-MIMO
  187. * @eht_phycap_psrsr : PSR-Based SR Support
  188. * @eht_phycap_pwrbstfactor : Power Boost Factor Support
  189. * @eht_phycap_4xehtltfand800nsgi : EHT MU PPDU With 4xEHT-LTF And 0.8 .s GI
  190. * @eht_phycap_maxnc : Max Nc
  191. * @eht_phycap_nontrigcqifb : Non-Triggered CQI Feedback
  192. * @eht_phycap_tx1024and4096qamls242toneru : Tx 1024-QAM And 4096-QAM <
  193. * 242-tone RU Support
  194. * @eht_phycap_rx1024and4096qamls242toneru : Rx 1024-QAM And 4096-QAM <
  195. * 242-tone RU Support
  196. * @eht_phycap_ppethrespresent : PPE Thresholds Present
  197. * @eht_phycap_cmnnompktpad : Common Nominal Packet Padding
  198. * @eht_phycap_maxnumehtltf : Maximum Number Of Supported EHT-LTFs
  199. * @eht_phycap_supmcs15 : Support of MCS 15
  200. * @eht_phycap_ehtdupin6ghz : Support Of EHT DUP In 6 GHz
  201. * @eht_phycap_20mhzopstarxndpwiderbw : Support For 20 MHz Operating STA
  202. * Receiving NDP With Wider Bandwidth
  203. * @eht_phycap_nonofdmaulmumimolt80mhz : Non-OFDMA UL MU-MIMO (BW <= 80 MHz)
  204. * @eht_phycap_nonofdmaulmumimo160mhz : Non-OFDMA UL MU-MIMO (BW = 160 MHz)
  205. * @eht_phycap_nonofdmaulmumimo320mhz : Non-OFDMA UL MU-MIMO (BW = 320 MHz)
  206. * @eht_phycap_mubfmrlt80mhz : MU Beamformer (BW <= 80 MHz)
  207. * @eht_phycap_mubfmr160mhz : MU Beamformer (BW = 160 MHz)
  208. * @eht_phycap_mubfmr320mhz : MU Beamformer (BW = 320 MHz)
  209. */
  210. struct vdev_mlme_eht_caps_info {
  211. uint32_t eht_maccap_epcspriaccess_support :1,
  212. eht_maccap_ehtomctrl_support :1,
  213. eht_maccap_trigtxop_sharing_mode1 :1,
  214. eht_maccap_trigtxop_sharing_mode2 :1,
  215. eht_maccap_rtwt_support :1,
  216. eht_maccap_scs_traffic_description :1,
  217. eht_maccap_max_mpdu_len :2,
  218. eht_maccap_max_ampdu_len_exp_etn :1,
  219. eht_maccap_trs_support :1,
  220. eht_maccap_txop_ret_supp_in_txop_mode2 :1;
  221. uint32_t eht_phycap_reserved :1,
  222. eht_phycap_320mhzin6ghz :1,
  223. eht_phycap_242tonerubwlt20mhz :1,
  224. eht_phycap_ndp4xehtltfand320nsgi :1,
  225. eht_phycap_partialbwulmu :1,
  226. eht_phycap_subfmr :1,
  227. eht_phycap_subfme :1,
  228. eht_phycap_bfmesslt80mhz :3,
  229. eht_phycap_bfmess160mhz :3,
  230. eht_phycap_bfmess320mhz :3,
  231. eht_phycap_numsoundlt80mhz :3,
  232. eht_phycap_numsound160mhz :3,
  233. eht_phycap_numsound320mhz :3,
  234. eht_phycap_ng16sufb :1,
  235. eht_phycap_ng16mufb :1,
  236. eht_phycap_codbk42sufb :1,
  237. eht_phycap_codbk75mufb :1,
  238. eht_phycap_trigsubffb :1,
  239. eht_phycap_trigmubfpartbwfb :1,
  240. eht_phycap_trigcqifb :1;
  241. uint32_t eht_phycap_partbwdlmumimo :1,
  242. eht_phycap_psrsr :1,
  243. eht_phycap_pwrbstfactor :1,
  244. eht_phycap_4xehtltfand800nsgi :1,
  245. eht_phycap_maxnc :4,
  246. eht_phycap_nontrigcqifb :1,
  247. eht_phycap_tx1024and4096qamls242toneru :1,
  248. eht_phycap_rx1024and4096qamls242toneru :1,
  249. eht_phycap_ppethrespresent :1,
  250. eht_phycap_cmnnompktpad :2,
  251. eht_phycap_maxnumehtltf :5,
  252. eht_phycap_supmcs15 :4,
  253. eht_phycap_ehtdupin6ghz :1,
  254. eht_phycap_20mhzopstarxndpwiderbw :1,
  255. eht_phycap_nonofdmaulmumimolt80mhz :1,
  256. eht_phycap_nonofdmaulmumimo160mhz :1,
  257. eht_phycap_nonofdmaulmumimo320mhz :1,
  258. eht_phycap_mubfmrlt80mhz :1,
  259. eht_phycap_mubfmr160mhz :1,
  260. eht_phycap_mubfmr320mhz :1,
  261. eht_phycap_tb_sounding_feedback_rl :1;
  262. uint32_t eht_phycap_rx1024qamwiderbwdlofdma :1,
  263. eht_phycap_rx4096qamwiderbwdlofdma :1;
  264. };
  265. /**
  266. * struct vdev_mlme_eht_ops_info - vdev mlme EHTOPS information
  267. * @eht_ops: eht ops
  268. */
  269. struct vdev_mlme_eht_ops_info {
  270. uint32_t eht_ops;
  271. };
  272. #endif
  273. /**
  274. * struct vdev_mlme_he_ops_info - vdev protocol structure holding information
  275. * that is used in frames
  276. * @generic: generic protocol information
  277. * @ap: ap specific protocol information
  278. * @sta: sta specific protocol information
  279. * @vht_info: vht information
  280. * @ht_info: ht capabilities information
  281. * @he_ops_info: he ops information
  282. * @eht_cap_info: EHT capability information
  283. * @eht_ops_info: EHT operation information
  284. * @bss_color: 11ax HE BSS Color information
  285. */
  286. struct vdev_mlme_proto {
  287. struct vdev_mlme_proto_generic generic;
  288. struct vdev_mlme_proto_ap ap;
  289. struct vdev_mlme_proto_sta sta;
  290. struct vdev_mlme_vht_info vht_info;
  291. struct vdev_mlme_ht_info ht_info;
  292. struct vdev_mlme_he_ops_info he_ops_info;
  293. #ifdef WLAN_FEATURE_11BE
  294. struct vdev_mlme_eht_caps_info eht_cap_info;
  295. struct vdev_mlme_eht_ops_info eht_ops_info;
  296. #endif
  297. struct vdev_mlme_proto_bss_color bss_color;
  298. };
  299. /**
  300. * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg
  301. * @rts_threshold: RTS threshold
  302. * @frag_threshold: Fragmentation threshold
  303. * @probe_delay: time in msec for delaying to send first probe request
  304. * @repeat_probe_time: probe request transmission time
  305. * @drop_unencry: drop unencrypted status
  306. * @ tx_pwrlimit: Tx power limit
  307. * @tx_power: Tx power
  308. * @minpower: Min power
  309. * @maxpower: Max power
  310. * @maxregpower: max regulatory power
  311. * @antennamax: max antenna
  312. * @reg_class_id: reg domain class id
  313. * @ampdu: ampdu limit
  314. * @amsdu: amsdu limit
  315. * @ssid: service set identifier
  316. * @ssid_len: ssid length
  317. * @type: vdev type
  318. * @sub_type: vdev subtype
  319. * @rx_decap_type: rx decap type
  320. * @tx_encap_type: tx encap type
  321. * @disable_hw_ack: disable ha ack flag
  322. * @bssid: bssid
  323. * @phy_mode: phy mode
  324. * @special_vdev_mode: indicates special vdev mode
  325. * @he_spr_sr_ctrl: Spatial reuse SR control
  326. * @he_spr_non_srg_pd_max_offset: Non-SRG PD max offset
  327. * @he_spr_srg_max_pd_offset: SRG PD max offset
  328. * @he_spr_srg_min_pd_offset: SRG PD min offset
  329. * @he_spr_enabled: Spatial reuse enabled or not
  330. * @pd_threshold: pd threshold sent by userspace
  331. * @he_spr_disabled_due_conc: spr disabled due to concurrency
  332. * @srg_bss_color: srg bss color
  333. * @srg_partial_bssid: srg partial bssid
  334. */
  335. struct vdev_mlme_mgmt_generic {
  336. uint32_t rts_threshold;
  337. uint32_t frag_threshold;
  338. uint32_t probe_delay;
  339. uint32_t repeat_probe_time;
  340. uint32_t drop_unencry;
  341. uint32_t tx_pwrlimit;
  342. uint8_t tx_power;
  343. uint8_t minpower;
  344. uint8_t maxpower;
  345. uint8_t maxregpower;
  346. uint8_t antennamax;
  347. uint8_t reg_class_id;
  348. uint8_t ampdu;
  349. uint8_t amsdu;
  350. char ssid[WLAN_SSID_MAX_LEN + 1];
  351. uint8_t ssid_len;
  352. uint8_t type;
  353. uint8_t subtype;
  354. uint8_t rx_decap_type;
  355. uint8_t tx_encap_type;
  356. bool disable_hw_ack;
  357. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  358. uint32_t phy_mode;
  359. bool special_vdev_mode;
  360. #ifdef WLAN_FEATURE_SR
  361. uint8_t he_spr_sr_ctrl;
  362. uint8_t he_spr_non_srg_pd_max_offset;
  363. uint8_t he_spr_srg_max_pd_offset;
  364. uint8_t he_spr_srg_min_pd_offset;
  365. bool he_spr_enabled;
  366. int32_t pd_threshold;
  367. bool he_spr_disabled_due_conc;
  368. uint64_t srg_bss_color;
  369. uint64_t srg_partial_bssid;
  370. #endif
  371. };
  372. /*
  373. * struct wlan_vdev_aid_mgr – AID manager
  374. * @aid_bitmap: AID bitmap array
  375. * @start_aid: start of AID index
  376. * @max_aid: Max allowed AID
  377. * @ref_cnt: to share AID across VDEVs for MBSSID
  378. */
  379. struct wlan_vdev_aid_mgr {
  380. qdf_bitmap(aid_bitmap, WLAN_UMAC_MAX_AID);
  381. uint16_t start_aid;
  382. uint16_t max_aid;
  383. qdf_atomic_t ref_cnt;
  384. };
  385. /**
  386. * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg
  387. * @hidden_ssid: flag to indicate whether it is hidden ssid
  388. * @cac_duration_ms: cac duration in milliseconds
  389. * @aid_mgr: AID bitmap mgr
  390. * @max_chan_switch_time: Max channel switch time in milliseconds.
  391. * @last_bcn_ts_ms: Timestamp (in milliseconds) of the last beacon sent on the
  392. * CSA triggered channel.
  393. */
  394. struct vdev_mlme_mgmt_ap {
  395. bool hidden_ssid;
  396. uint32_t cac_duration_ms;
  397. struct wlan_vdev_aid_mgr *aid_mgr;
  398. uint32_t max_chan_switch_time;
  399. unsigned long last_bcn_ts_ms;
  400. };
  401. /**
  402. * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg
  403. * @he_mcs_12_13_map: map to indicate mcs12/13 caps of peer&dut
  404. */
  405. struct vdev_mlme_mgmt_sta {
  406. uint16_t he_mcs_12_13_map;
  407. };
  408. /**
  409. * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters
  410. * @bmiss_first_bcnt: bmiss first time
  411. * @bmiss_final_bcnt: bmiss final time
  412. * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be
  413. * inactive
  414. * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send
  415. * data-null
  416. * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT
  417. */
  418. struct vdev_mlme_inactivity_params {
  419. uint32_t bmiss_first_bcnt;
  420. uint32_t bmiss_final_bcnt;
  421. uint32_t keepalive_min_idle_inactive_time_secs;
  422. uint32_t keepalive_max_idle_inactive_time_secs;
  423. uint32_t keepalive_max_unresponsive_time_secs;
  424. };
  425. /**
  426. * enum vdev_ratemask_type - ratemask phy type
  427. * @WLAN_VDEV_RATEMASK_TYPE_CCK: phy type CCK
  428. * @WLAN_VDEV_RATEMASK_TYPE_HT: phy type ht
  429. * @WLAN_VDEV_RATEMASK_TYPE_VHT: phy type vht
  430. * WLAN_VDEV_RATEMASK_TYPE_HE: phy type he
  431. */
  432. enum vdev_ratemask_type {
  433. WLAN_VDEV_RATEMASK_TYPE_CCK,
  434. WLAN_VDEV_RATEMASK_TYPE_HT,
  435. WLAN_VDEV_RATEMASK_TYPE_VHT,
  436. WLAN_VDEV_RATEMASK_TYPE_HE,
  437. WLAN_VDEV_RATEMASK_TYPE_MAX,
  438. };
  439. /**
  440. * struct vdev_ratemask_params - vdev ratemask parameters
  441. * @type: ratemask phy type
  442. * @lower32: ratemask lower32 bitmask
  443. * @higher32: ratemask higher32 bitmask
  444. * @lower32_2: ratemask lower32_2 bitmask
  445. * @higher32_2: rtaemask higher32_2 bitmask
  446. */
  447. struct vdev_ratemask_params {
  448. uint32_t lower32;
  449. uint32_t higher32;
  450. uint32_t lower32_2;
  451. uint32_t higher32_2;
  452. };
  453. /**
  454. * struct vdev_mlme_rate_info - vdev mlme rate information
  455. * @rate_flags: dynamic bandwidth info
  456. * @per_band_tx_mgmt_rate: per band Tx mgmt rate
  457. * @max_rate: max bandwidth rate
  458. * @tx_mgmt_rate: Tx Mgmt rate
  459. * @bcn_tx_rate: beacon Tx rate
  460. * @bcn_tx_rate_code: beacon Tx rate code
  461. * @ratemask_params: vdev ratemask params per phy type
  462. * @half_rate: Half rate
  463. * @quarter_rate: quarter rate
  464. */
  465. struct vdev_mlme_rate_info {
  466. uint32_t rate_flags;
  467. uint32_t per_band_tx_mgmt_rate;
  468. uint32_t max_rate;
  469. uint32_t tx_mgmt_rate;
  470. uint32_t bcn_tx_rate;
  471. #ifdef WLAN_BCN_RATECODE_ENABLE
  472. uint32_t bcn_tx_rate_code;
  473. #endif
  474. uint32_t rtscts_tx_rate;
  475. struct vdev_ratemask_params ratemask_params[
  476. WLAN_VDEV_RATEMASK_TYPE_MAX];
  477. bool half_rate;
  478. bool quarter_rate;
  479. };
  480. /**
  481. * struct vdev_mlme_chainmask_info - vdev mlme chainmask information
  482. * @tx_chainmask: Tx chainmask
  483. * @rx_chainmask: Rx Chainmask
  484. * @num_rx_chain: Num of bits set in Rx chain
  485. * @num_tx_chain: Num of bits set in Tx chain
  486. */
  487. struct vdev_mlme_chainmask_info {
  488. uint8_t tx_chainmask;
  489. uint8_t rx_chainmask;
  490. uint8_t num_rx_chain;
  491. uint8_t num_tx_chain;
  492. };
  493. /**
  494. * struct vdev_mlme_powersave_info - vdev mlme powersave information
  495. * @packet_powersave: packet powersave
  496. * @max_li_of_moddtim: max mod dtim
  497. * @dyndtim_cnt: dynamic dtim count
  498. * @listen_interval: listen interval
  499. * @moddtim_cnt: mod dtim count
  500. */
  501. struct vdev_mlme_powersave_info {
  502. uint32_t packet_powersave;
  503. uint32_t max_li_of_moddtim;
  504. uint32_t dyndtim_cnt;
  505. uint32_t listen_interval;
  506. uint32_t moddtim_cnt;
  507. };
  508. /**
  509. * struct vdev_mlme_beacon_info - vdev mlme beacon information
  510. * @beacon_buffer: buffer allocated for beacon frame
  511. * @beacon_offsets: beacon IE's offsets
  512. */
  513. struct vdev_mlme_beacon_info {
  514. qdf_nbuf_t beacon_buffer;
  515. void *beacon_offsets;
  516. };
  517. /**
  518. * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd
  519. * @profile_idx: profile index of the connected non-trans ap (mbssid case).
  520. * 0 means invalid.
  521. * @profile_num: the total profile numbers of non-trans aps (mbssid
  522. * case).
  523. * 0 means non-MBSS AP.
  524. * @mbssid-flags: MBSS IE flags indicating vdev type
  525. * @vdevid_trans: id of transmitting vdev for MBSS IE
  526. * @vdev_bmap: vdev bitmap of VAPs in MBSS group
  527. * @is_cmn_param: flag to check mbss common param
  528. * @trans_bssid: bssid of transmitted AP (MBSS IE case)
  529. * @is_multi_mbssid: Flag to identify multi group mbssid support
  530. * @grp_id: Group id of current vdev
  531. */
  532. struct vdev_mlme_mbss_11ax {
  533. uint32_t profile_idx;
  534. uint32_t profile_num;
  535. uint32_t mbssid_flags;
  536. uint8_t vdevid_trans;
  537. unsigned long vdev_bmap;
  538. bool is_cmn_param;
  539. uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
  540. bool is_multi_mbssid;
  541. uint32_t grp_id;
  542. };
  543. /**
  544. * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg
  545. * @generic: generic mgmt information
  546. * @ap: ap specific mgmt information
  547. * @sta: sta specific mgmt information
  548. * @inactivity_params: inactivity parameters
  549. * @rate_info: bandwidth rate information
  550. * @chainmask_info: Chainmask information
  551. * @powersave_info: Power save parameters
  552. * @beacon_info: beacon buffer information
  553. * @mbss_11ax: MBSS 11ax information
  554. */
  555. struct vdev_mlme_mgmt {
  556. struct vdev_mlme_mgmt_generic generic;
  557. struct vdev_mlme_mgmt_ap ap;
  558. struct vdev_mlme_mgmt_sta sta;
  559. struct vdev_mlme_inactivity_params inactivity_params;
  560. struct vdev_mlme_rate_info rate_info;
  561. struct vdev_mlme_chainmask_info chainmask_info;
  562. struct vdev_mlme_powersave_info powersave_info;
  563. struct vdev_mlme_beacon_info beacon_info;
  564. struct vdev_mlme_mbss_11ax mbss_11ax;
  565. };
  566. /**
  567. * enum beacon_update_op - Beacon update op type
  568. * @BEACON_INIT: Initialize beacon
  569. * @BEACON_REINIT: Re-initialize beacon
  570. * @BEACON_UPDATE: Update dynamic fields of beacon
  571. * @BEACON_CSA: Enable CSA IE
  572. * @BEACON_FREE: Beacon buffer free
  573. */
  574. enum beacon_update_op {
  575. BEACON_INIT,
  576. BEACON_REINIT,
  577. BEACON_UPDATE,
  578. BEACON_CSA,
  579. BEACON_FREE,
  580. };
  581. /**
  582. * enum vdev_cmd_type - Command type
  583. * @START_REQ: Start request
  584. * @RESTART_REQ: Restart request
  585. * @STOP_REQ: STOP request
  586. * @DELETE_REQ: DELETE request
  587. */
  588. enum vdev_cmd_type {
  589. START_REQ,
  590. RESTART_REQ,
  591. STOP_REQ,
  592. DELETE_REQ,
  593. };
  594. /**
  595. * enum vdev_start_resp_type - start respone type
  596. * @START_RESPONSE: Start response
  597. * @RESTART_RESPONSE: Restart response
  598. */
  599. enum vdev_start_resp_type {
  600. START_RESPONSE = 0,
  601. RESTART_RESPONSE,
  602. };
  603. /**
  604. * struct vdev_mlme_ops - VDEV MLME operation callbacks structure
  605. * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params
  606. * @mlme_vdev_reset_proto_params: callback to Reset protocol params
  607. * @mlme_vdev_start_send: callback to initiate actions of VDEV
  608. * MLME start operation
  609. * @mlme_vdev_restart_send: callback to initiate actions of VDEV
  610. * MLME restart operation
  611. * @mlme_vdev_stop_start_send: callback to block start/restart VDEV
  612. * request command
  613. * @mlme_vdev_start_continue: callback to initiate operations on
  614. * LMAC/FW start response
  615. * @mlme_vdev_sta_conn_start: callback to initiate STA connection
  616. * @mlme_vdev_up_send: callback to initiate actions of VDEV
  617. * MLME up operation
  618. * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving
  619. * to UP state
  620. * @mlme_vdev_notify_roam_start: callback to initiate roaming
  621. * @mlme_vdev_update_beacon: callback to initiate beacon update
  622. * @mlme_vdev_disconnect_peers: callback to initiate disconnection of
  623. * peers
  624. * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer
  625. * @mlme_vdev_stop_send: callback to initiate actions of VDEV
  626. * MLME stop operation
  627. * @mlme_vdev_stop_continue: callback to initiate operations on
  628. * LMAC/FW stop response
  629. * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
  630. * peer delete completion
  631. * @mlme_vdev_down_send: callback to initiate actions of VDEV
  632. * MLME down operation
  633. * @mlme_vdev_notify_start_state_exit: callback to notify on vdev start
  634. * start state exit
  635. * @mlme_vdev_is_newchan_no_cac: callback to check CAC is required
  636. * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for
  637. * vdev mlme peer delete all response
  638. * @mlme_vdev_dfs_cac_wait_notify: callback to notify about CAC state
  639. * @mlme_vdev_csa_complete: callback to indicate CSA complete
  640. * @mlme_vdev_sta_disconn_start: callback to initiate STA disconnection
  641. */
  642. struct vdev_mlme_ops {
  643. QDF_STATUS (*mlme_vdev_validate_basic_params)(
  644. struct vdev_mlme_obj *vdev_mlme,
  645. uint16_t event_data_len, void *event_data);
  646. QDF_STATUS (*mlme_vdev_reset_proto_params)(
  647. struct vdev_mlme_obj *vdev_mlme,
  648. uint16_t event_data_len, void *event_data);
  649. QDF_STATUS (*mlme_vdev_start_send)(
  650. struct vdev_mlme_obj *vdev_mlme,
  651. uint16_t event_data_len, void *event_data);
  652. QDF_STATUS (*mlme_vdev_restart_send)(
  653. struct vdev_mlme_obj *vdev_mlme,
  654. uint16_t event_data_len, void *event_data);
  655. QDF_STATUS (*mlme_vdev_stop_start_send)(
  656. struct vdev_mlme_obj *vdev_mlme,
  657. enum vdev_cmd_type type,
  658. uint16_t event_data_len, void *event_data);
  659. QDF_STATUS (*mlme_vdev_start_continue)(
  660. struct vdev_mlme_obj *vdev_mlme,
  661. uint16_t event_data_len, void *event_data);
  662. QDF_STATUS (*mlme_vdev_sta_conn_start)(
  663. struct vdev_mlme_obj *vdev_mlme,
  664. uint16_t event_data_len, void *event_data);
  665. QDF_STATUS (*mlme_vdev_start_req_failed)(
  666. struct vdev_mlme_obj *vdev_mlme,
  667. uint16_t event_data_len, void *event_data);
  668. QDF_STATUS (*mlme_vdev_up_send)(
  669. struct vdev_mlme_obj *vdev_mlme,
  670. uint16_t event_data_len, void *event_data);
  671. QDF_STATUS (*mlme_vdev_notify_up_complete)(
  672. struct vdev_mlme_obj *vdev_mlme,
  673. uint16_t event_data_len, void *event_data);
  674. QDF_STATUS (*mlme_vdev_notify_roam_start)(
  675. struct vdev_mlme_obj *vdev_mlme,
  676. uint16_t event_data_len, void *event_data);
  677. QDF_STATUS (*mlme_vdev_update_beacon)(
  678. struct vdev_mlme_obj *vdev_mlme,
  679. enum beacon_update_op op,
  680. uint16_t event_data_len, void *event_data);
  681. QDF_STATUS (*mlme_vdev_disconnect_peers)(
  682. struct vdev_mlme_obj *vdev_mlme,
  683. uint16_t event_data_len, void *event_data);
  684. QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)(
  685. struct vdev_mlme_obj *vdev_mlme,
  686. uint16_t event_data_len, void *event_data);
  687. QDF_STATUS (*mlme_vdev_stop_send)(
  688. struct vdev_mlme_obj *vdev_mlme,
  689. uint16_t event_data_len, void *event_data);
  690. QDF_STATUS (*mlme_vdev_stop_continue)(
  691. struct vdev_mlme_obj *vdev_mlme,
  692. uint16_t event_data_len, void *event_data);
  693. QDF_STATUS (*mlme_vdev_down_send)(
  694. struct vdev_mlme_obj *vdev_mlme,
  695. uint16_t event_data_len, void *event_data);
  696. QDF_STATUS (*mlme_vdev_notify_down_complete)(
  697. struct vdev_mlme_obj *vdev_mlme,
  698. uint16_t event_data_len, void *event_data);
  699. QDF_STATUS (*mlme_vdev_ext_stop_rsp)(
  700. struct vdev_mlme_obj *vdev_mlme,
  701. struct vdev_stop_response *rsp);
  702. QDF_STATUS (*mlme_vdev_ext_start_rsp)(
  703. struct vdev_mlme_obj *vdev_mlme,
  704. struct vdev_start_response *rsp);
  705. QDF_STATUS (*mlme_vdev_notify_start_state_exit)(
  706. struct vdev_mlme_obj *vdev_mlme);
  707. QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
  708. struct vdev_mlme_obj *vdev_mlme);
  709. QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)(
  710. struct vdev_mlme_obj *vdev_mlme,
  711. struct peer_delete_all_response *rsp);
  712. QDF_STATUS (*mlme_vdev_dfs_cac_wait_notify)(
  713. struct vdev_mlme_obj *vdev_mlme);
  714. QDF_STATUS (*mlme_vdev_csa_complete)(
  715. struct vdev_mlme_obj *vdev_mlme);
  716. QDF_STATUS (*mlme_vdev_sta_disconn_start)(
  717. struct vdev_mlme_obj *vdev_mlme,
  718. uint16_t event_data_len, void *event_data);
  719. };
  720. /**
  721. * struct vdev_mlme_obj - VDEV MLME component object
  722. * @proto: VDEV MLME proto substructure
  723. * @mgmt: VDEV MLME mgmt substructure
  724. * @sm_lock: VDEV SM lock
  725. * @vdev_cmd_lock: VDEV MLME command atomicity
  726. * @sm_hdl: VDEV SM handle
  727. * @cnx_mgr_ctx: connection manager context, valid for STA and P2P-CLI mode only
  728. * @vdev: Pointer to vdev objmgr
  729. * @ops: VDEV MLME callback table
  730. * @ext_vdev_ptr: VDEV MLME legacy pointer
  731. * @reg_tpc_obj: Regulatory transmit power info
  732. * @vdev_rt: VDEV response timer
  733. * @vdev_wakelock: vdev wakelock sub structure
  734. */
  735. struct vdev_mlme_obj {
  736. struct vdev_mlme_proto proto;
  737. struct vdev_mlme_mgmt mgmt;
  738. #ifdef VDEV_SM_LOCK_SUPPORT
  739. qdf_spinlock_t sm_lock;
  740. qdf_mutex_t vdev_cmd_lock;
  741. #endif
  742. struct wlan_sm *sm_hdl;
  743. union {
  744. struct cnx_mgr *cnx_mgr_ctx;
  745. };
  746. struct wlan_objmgr_vdev *vdev;
  747. struct vdev_mlme_ops *ops;
  748. mlme_vdev_ext_t *ext_vdev_ptr;
  749. struct reg_tpc_power_info reg_tpc_obj;
  750. };
  751. /**
  752. * wlan_vdev_mlme_set_ssid() - set ssid
  753. * @vdev: VDEV object
  754. * @ssid: SSID (input)
  755. * @ssid_len: Length of SSID
  756. *
  757. * API to set the SSID of VDEV
  758. *
  759. * Caller need to acquire lock with wlan_vdev_obj_lock()
  760. *
  761. * Return: SUCCESS, if update is done
  762. * FAILURE, if ssid length is > max ssid len
  763. */
  764. static inline QDF_STATUS wlan_vdev_mlme_set_ssid(
  765. struct wlan_objmgr_vdev *vdev,
  766. const uint8_t *ssid, uint8_t ssid_len)
  767. {
  768. struct vdev_mlme_obj *vdev_mlme;
  769. /* This API is invoked with lock acquired, do not add log prints */
  770. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  771. if (!vdev_mlme)
  772. return QDF_STATUS_E_FAILURE;
  773. if (ssid_len <= WLAN_SSID_MAX_LEN) {
  774. qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len);
  775. vdev_mlme->mgmt.generic.ssid_len = ssid_len;
  776. } else {
  777. vdev_mlme->mgmt.generic.ssid_len = 0;
  778. return QDF_STATUS_E_FAILURE;
  779. }
  780. return QDF_STATUS_SUCCESS;
  781. }
  782. /**
  783. * wlan_vdev_mlme_get_ssid() - get ssid
  784. * @vdev: VDEV object
  785. * @ssid: SSID
  786. * @ssid_len: Length of SSID
  787. *
  788. * API to get the SSID of VDEV, it updates the SSID and its length
  789. * in @ssid, @ssid_len respectively
  790. *
  791. * Caller need to acquire lock with wlan_vdev_obj_lock()
  792. *
  793. * Return: SUCCESS, if update is done
  794. * FAILURE, if ssid length is > max ssid len
  795. */
  796. static inline QDF_STATUS wlan_vdev_mlme_get_ssid(
  797. struct wlan_objmgr_vdev *vdev,
  798. uint8_t *ssid, uint8_t *ssid_len)
  799. {
  800. struct vdev_mlme_obj *vdev_mlme;
  801. /* This API is invoked with lock acquired, do not add log prints */
  802. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  803. if (!vdev_mlme)
  804. return QDF_STATUS_E_FAILURE;
  805. if (vdev_mlme->mgmt.generic.ssid_len > 0) {
  806. *ssid_len = vdev_mlme->mgmt.generic.ssid_len;
  807. qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len);
  808. } else {
  809. *ssid_len = 0;
  810. return QDF_STATUS_E_FAILURE;
  811. }
  812. return QDF_STATUS_SUCCESS;
  813. }
  814. /**
  815. * wlan_vdev_mlme_set_nss() - set NSS
  816. * @vdev: VDEV object
  817. * @nss: nss configured by user
  818. *
  819. * API to set the Number of Spatial streams
  820. *
  821. * Return: void
  822. */
  823. static inline void wlan_vdev_mlme_set_nss(
  824. struct wlan_objmgr_vdev *vdev,
  825. uint8_t nss)
  826. {
  827. struct vdev_mlme_obj *vdev_mlme;
  828. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  829. if (!vdev_mlme)
  830. return;
  831. vdev_mlme->proto.generic.nss = nss;
  832. }
  833. /**
  834. * wlan_vdev_mlme_get_nss() - get NSS
  835. * @vdev: VDEV object
  836. *
  837. * API to get the Number of Spatial Streams
  838. *
  839. * Return:
  840. * @nss: nss value
  841. */
  842. static inline uint8_t wlan_vdev_mlme_get_nss(
  843. struct wlan_objmgr_vdev *vdev)
  844. {
  845. struct vdev_mlme_obj *vdev_mlme;
  846. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  847. if (!vdev_mlme)
  848. return 0;
  849. return vdev_mlme->proto.generic.nss;
  850. }
  851. /**
  852. * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask
  853. * @vdev: VDEV object
  854. * @chainmask : chainmask either configured by user or max supported
  855. *
  856. * API to set the Tx chainmask
  857. *
  858. * Return: void
  859. */
  860. static inline void wlan_vdev_mlme_set_txchainmask(
  861. struct wlan_objmgr_vdev *vdev,
  862. uint8_t chainmask)
  863. {
  864. struct vdev_mlme_obj *vdev_mlme;
  865. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  866. if (!vdev_mlme)
  867. return;
  868. vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask;
  869. }
  870. /**
  871. * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask
  872. * @vdev: VDEV object
  873. *
  874. * API to get the Tx chainmask
  875. *
  876. * Return:
  877. * @chainmask : Tx chainmask either configured by user or max supported
  878. */
  879. static inline uint8_t wlan_vdev_mlme_get_txchainmask(
  880. struct wlan_objmgr_vdev *vdev)
  881. {
  882. struct vdev_mlme_obj *vdev_mlme;
  883. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  884. if (!vdev_mlme)
  885. return 0;
  886. return vdev_mlme->mgmt.chainmask_info.tx_chainmask;
  887. }
  888. /**
  889. * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask
  890. * @vdev: VDEV object
  891. * @chainmask : Rx chainmask either configured by user or max supported
  892. *
  893. * API to set the Rx chainmask
  894. *
  895. * Return: void
  896. */
  897. static inline void wlan_vdev_mlme_set_rxchainmask(
  898. struct wlan_objmgr_vdev *vdev,
  899. uint8_t chainmask)
  900. {
  901. struct vdev_mlme_obj *vdev_mlme;
  902. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  903. if (!vdev_mlme)
  904. return;
  905. vdev_mlme->mgmt.chainmask_info.rx_chainmask = chainmask;
  906. }
  907. /**
  908. * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask
  909. * @vdev: VDEV object
  910. *
  911. * API to get the Rx chainmask
  912. *
  913. * Return:
  914. * @chainmask : Rx chainmask either configured by user or max supported
  915. */
  916. static inline uint8_t wlan_vdev_mlme_get_rxchainmask(
  917. struct wlan_objmgr_vdev *vdev)
  918. {
  919. struct vdev_mlme_obj *vdev_mlme;
  920. /* This API is invoked with lock acquired, do not add log prints */
  921. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  922. if (!vdev_mlme)
  923. return 0;
  924. return vdev_mlme->mgmt.chainmask_info.rx_chainmask;
  925. }
  926. /**
  927. * wlan_vdev_mlme_set_txpower() - set tx power
  928. * @vdev: VDEV object
  929. * @txpow: tx power either configured by used or max allowed
  930. *
  931. * API to set the tx power
  932. *
  933. * Return: void
  934. */
  935. static inline void wlan_vdev_mlme_set_txpower(
  936. struct wlan_objmgr_vdev *vdev,
  937. uint8_t txpow)
  938. {
  939. struct vdev_mlme_obj *vdev_mlme;
  940. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  941. if (!vdev_mlme)
  942. return;
  943. vdev_mlme->mgmt.generic.tx_power = txpow;
  944. }
  945. /**
  946. * wlan_vdev_mlme_get_txpower() - get tx power
  947. * @vdev: VDEV object
  948. *
  949. * API to get the tx power
  950. *
  951. * Return:
  952. * @txpow: tx power either configured by used or max allowed
  953. */
  954. static inline uint8_t wlan_vdev_mlme_get_txpower(
  955. struct wlan_objmgr_vdev *vdev)
  956. {
  957. struct vdev_mlme_obj *vdev_mlme;
  958. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  959. if (!vdev_mlme)
  960. return 0;
  961. return vdev_mlme->mgmt.generic.tx_power;
  962. }
  963. /**
  964. * wlan_vdev_mlme_set_maxrate() - set max rate
  965. * @vdev: VDEV object
  966. * @maxrate: configured by used or based on configured mode
  967. *
  968. * API to set the max rate the vdev supports
  969. *
  970. * Return: void
  971. */
  972. static inline void wlan_vdev_mlme_set_maxrate(
  973. struct wlan_objmgr_vdev *vdev,
  974. uint32_t maxrate)
  975. {
  976. struct vdev_mlme_obj *vdev_mlme;
  977. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  978. if (!vdev_mlme)
  979. return;
  980. vdev_mlme->mgmt.rate_info.max_rate = maxrate;
  981. }
  982. /**
  983. * wlan_vdev_mlme_get_maxrate() - get max rate
  984. * @vdev: VDEV object
  985. *
  986. * API to get the max rate the vdev supports
  987. *
  988. * Return:
  989. * @maxrate: configured by used or based on configured mode
  990. */
  991. static inline uint32_t wlan_vdev_mlme_get_maxrate(
  992. struct wlan_objmgr_vdev *vdev)
  993. {
  994. struct vdev_mlme_obj *vdev_mlme;
  995. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  996. if (!vdev_mlme)
  997. return 0;
  998. return vdev_mlme->mgmt.rate_info.max_rate;
  999. }
  1000. /**
  1001. * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate
  1002. * @vdev: VDEV object
  1003. * @txmgmtrate: Tx Mgmt rate
  1004. *
  1005. * API to set Mgmt Tx rate
  1006. *
  1007. * Return: void
  1008. */
  1009. static inline void wlan_vdev_mlme_set_txmgmtrate(
  1010. struct wlan_objmgr_vdev *vdev,
  1011. uint32_t txmgmtrate)
  1012. {
  1013. struct vdev_mlme_obj *vdev_mlme;
  1014. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1015. if (!vdev_mlme)
  1016. return;
  1017. vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate;
  1018. }
  1019. /**
  1020. * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate
  1021. * @vdev: VDEV object
  1022. *
  1023. * API to get Mgmt Tx rate
  1024. *
  1025. * Return:
  1026. * @txmgmtrate: Tx Mgmt rate
  1027. */
  1028. static inline uint32_t wlan_vdev_mlme_get_txmgmtrate(
  1029. struct wlan_objmgr_vdev *vdev)
  1030. {
  1031. struct vdev_mlme_obj *vdev_mlme;
  1032. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1033. if (!vdev_mlme)
  1034. return 0;
  1035. return vdev_mlme->mgmt.rate_info.tx_mgmt_rate;
  1036. }
  1037. /**
  1038. * wlan_vdev_mlme_is_special_vdev() - check given vdev is a special vdev
  1039. * @vdev: VDEV object
  1040. *
  1041. * API to check given vdev is a special vdev.
  1042. *
  1043. * Return: true if given vdev is special vdev, else false
  1044. */
  1045. static inline bool wlan_vdev_mlme_is_special_vdev(
  1046. struct wlan_objmgr_vdev *vdev)
  1047. {
  1048. struct vdev_mlme_obj *vdev_mlme;
  1049. if (!vdev)
  1050. return false;
  1051. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1052. if (!vdev_mlme)
  1053. return false;
  1054. return vdev_mlme->mgmt.generic.special_vdev_mode;
  1055. }
  1056. #ifdef WLAN_FEATURE_11AX
  1057. /**
  1058. * wlan_vdev_mlme_set_he_mcs_12_13_map() - set he mcs12/13 map
  1059. * @vdev: VDEV object
  1060. * @he_mcs_12_13_map: he mcs12/13 map from self&peer
  1061. *
  1062. * API to set he mcs 12/13 map
  1063. *
  1064. * Return: void
  1065. */
  1066. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1067. struct wlan_objmgr_vdev *vdev,
  1068. uint16_t he_mcs_12_13_map)
  1069. {
  1070. struct vdev_mlme_obj *vdev_mlme;
  1071. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1072. if (!vdev_mlme)
  1073. return;
  1074. vdev_mlme->mgmt.sta.he_mcs_12_13_map = he_mcs_12_13_map;
  1075. }
  1076. /**
  1077. * wlan_vdev_mlme_get_he_mcs_12_13_map() - get he mcs12/13 map
  1078. * @vdev: VDEV object
  1079. *
  1080. * API to get he mcs12/13 support capability
  1081. *
  1082. * Return:
  1083. * @he_mcs_12_13_map: he mcs12/13 map
  1084. */
  1085. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1086. struct wlan_objmgr_vdev *vdev)
  1087. {
  1088. struct vdev_mlme_obj *vdev_mlme;
  1089. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1090. if (!vdev_mlme)
  1091. return 0;
  1092. return vdev_mlme->mgmt.sta.he_mcs_12_13_map;
  1093. }
  1094. #ifdef WLAN_FEATURE_SR
  1095. /**
  1096. * wlan_vdev_mlme_get_sr_ctrl() - get spatial reuse SR control
  1097. * @vdev: VDEV object
  1098. *
  1099. * API to retrieve the spatial reuse SR control from VDEV
  1100. *
  1101. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1102. *
  1103. * Return:
  1104. * @he_spr_sr_ctrl: SR control
  1105. */
  1106. static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(struct wlan_objmgr_vdev *vdev)
  1107. {
  1108. struct vdev_mlme_obj *vdev_mlme;
  1109. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1110. if (!vdev_mlme)
  1111. return 0;
  1112. return vdev_mlme->mgmt.generic.he_spr_sr_ctrl;
  1113. }
  1114. /**
  1115. * wlan_vdev_mlme_get_pd_offset() - get spatial reuse pd offset
  1116. * @vdev: VDEV object
  1117. *
  1118. * API to retrieve the spatial reuse pd offset from VDEV
  1119. *
  1120. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1121. *
  1122. * Return:
  1123. * @he_spr_non_srg_pd_max_offset: max pd offset
  1124. */
  1125. static inline uint8_t wlan_vdev_mlme_get_pd_offset(
  1126. struct wlan_objmgr_vdev *vdev)
  1127. {
  1128. struct vdev_mlme_obj *vdev_mlme;
  1129. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1130. if (!vdev_mlme)
  1131. return 0;
  1132. return vdev_mlme->mgmt.generic.he_spr_non_srg_pd_max_offset;
  1133. }
  1134. /**
  1135. * wlan_vdev_mlme_get_he_spr_enabled() - spatial reuse enabled or not
  1136. * @vdev: VDEV object
  1137. *
  1138. * API to check whether the spatial reuse enabled or not
  1139. *
  1140. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1141. *
  1142. * Return:
  1143. * @he_spr_enabled: Spatial reuse enabled or not
  1144. */
  1145. static inline bool wlan_vdev_mlme_get_he_spr_enabled(
  1146. struct wlan_objmgr_vdev *vdev)
  1147. {
  1148. struct vdev_mlme_obj *vdev_mlme;
  1149. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1150. if (!vdev_mlme)
  1151. return false;
  1152. return vdev_mlme->mgmt.generic.he_spr_enabled;
  1153. }
  1154. /**
  1155. * wlan_vdev_mlme_is_sr_disable_due_conc() - spatial reuse disabled due
  1156. * to concurrency
  1157. * @vdev: VDEV object
  1158. *
  1159. * API to check whether the spatial reuse disabled due to concurrency or not
  1160. *
  1161. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1162. *
  1163. * Return:
  1164. * true/false: true if spatial reuse disabled due to concurrency else false
  1165. */
  1166. static inline
  1167. bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev)
  1168. {
  1169. struct vdev_mlme_obj *vdev_mlme;
  1170. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1171. if (!vdev_mlme)
  1172. return false;
  1173. return vdev_mlme->mgmt.generic.he_spr_disabled_due_conc;
  1174. }
  1175. /**
  1176. * wlan_vdev_mlme_set_sr_ctrl() - set spatial reuse SR control
  1177. * @vdev: VDEV object
  1178. *
  1179. * API to set the spatial reuse SR control
  1180. *
  1181. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1182. *
  1183. * Return: void
  1184. */
  1185. static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev,
  1186. uint8_t sr_ctrl)
  1187. {
  1188. struct vdev_mlme_obj *vdev_mlme;
  1189. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1190. if (!vdev_mlme)
  1191. return;
  1192. vdev_mlme->mgmt.generic.he_spr_sr_ctrl = sr_ctrl;
  1193. }
  1194. /**
  1195. * wlan_vdev_mlme_set_pd_offset() - set spatial reuse pd max offset
  1196. * @vdev: VDEV object
  1197. *
  1198. * API to set the spatial reuse pd max offset
  1199. *
  1200. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1201. *
  1202. * Return: void
  1203. */
  1204. static inline void wlan_vdev_mlme_set_pd_offset(struct wlan_objmgr_vdev *vdev,
  1205. uint8_t pd_max_offset)
  1206. {
  1207. struct vdev_mlme_obj *vdev_mlme;
  1208. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1209. if (!vdev_mlme)
  1210. return;
  1211. vdev_mlme->mgmt.generic.he_spr_non_srg_pd_max_offset = pd_max_offset;
  1212. }
  1213. /**
  1214. * wlan_vdev_mlme_set_he_spr_enabled() - set spatial reuse enabled
  1215. * @vdev: VDEV object
  1216. *
  1217. * API to set the spatial reuse enabled
  1218. *
  1219. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1220. *
  1221. * Return: void
  1222. */
  1223. static inline void wlan_vdev_mlme_set_he_spr_enabled(
  1224. struct wlan_objmgr_vdev *vdev,
  1225. bool enable_he_spr)
  1226. {
  1227. struct vdev_mlme_obj *vdev_mlme;
  1228. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1229. if (!vdev_mlme)
  1230. return;
  1231. vdev_mlme->mgmt.generic.he_spr_enabled = enable_he_spr;
  1232. }
  1233. /**
  1234. * wlan_vdev_mlme_set_sr_disable_due_conc() - set spatial reuse disabled due
  1235. * to concurrency
  1236. * @vdev: VDEV object
  1237. *
  1238. * API to set the spatial reuse disabled due to concurrency
  1239. *
  1240. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1241. *
  1242. * Return: void
  1243. */
  1244. static inline
  1245. void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev,
  1246. bool he_spr_disabled_due_conc)
  1247. {
  1248. struct vdev_mlme_obj *vdev_mlme;
  1249. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1250. if (!vdev_mlme)
  1251. return;
  1252. vdev_mlme->mgmt.generic.he_spr_disabled_due_conc =
  1253. he_spr_disabled_due_conc;
  1254. }
  1255. /**
  1256. * wlan_vdev_mlme_set_srg_pd_offset() - set spatial reuse SRG pd max/min offset
  1257. * @vdev: VDEV object
  1258. * @srg_max_pd_offset: SRG max pd offset
  1259. * @srg_min_pd_offset: SRG min pd offset
  1260. *
  1261. * API to set the spatial reuse SRG pd min max offset
  1262. *
  1263. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1264. *
  1265. * Return: void
  1266. */
  1267. static inline
  1268. void wlan_vdev_mlme_set_srg_pd_offset(struct wlan_objmgr_vdev *vdev,
  1269. uint8_t srg_max_pd_offset,
  1270. uint8_t srg_min_pd_offset)
  1271. {
  1272. struct vdev_mlme_obj *vdev_mlme;
  1273. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1274. if (!vdev_mlme)
  1275. return;
  1276. vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset = srg_max_pd_offset;
  1277. vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset = srg_min_pd_offset;
  1278. }
  1279. /**
  1280. * wlan_vdev_mlme_get_srg_pd_offset() - get spatial reuse SRG pd min/max offset
  1281. * @vdev: VDEV object
  1282. * @srg_max_pd_offset: SRG max pd offset
  1283. * @srg_min_pd_offset: SRG min pd offset
  1284. *
  1285. * API to set the spatial reuse SRG pd min max offset
  1286. *
  1287. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1288. *
  1289. * Return: void
  1290. */
  1291. static inline
  1292. void wlan_vdev_mlme_get_srg_pd_offset(struct wlan_objmgr_vdev *vdev,
  1293. uint8_t *srg_max_pd_offset,
  1294. uint8_t *srg_min_pd_offset)
  1295. {
  1296. struct vdev_mlme_obj *vdev_mlme;
  1297. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1298. if (!vdev_mlme)
  1299. return;
  1300. *srg_max_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset;
  1301. *srg_min_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset;
  1302. }
  1303. /**
  1304. * wlan_vdev_mlme_set_srg_bss_color() - set spatial reuse bss
  1305. * colorbitmap
  1306. * @vdev: VDEV object
  1307. * @srg_bss_color: SRG BSS color bitmap
  1308. *
  1309. * API to set the spatial reuse bss color bit map
  1310. *
  1311. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1312. *
  1313. * Return: void
  1314. */
  1315. static inline
  1316. void wlan_vdev_mlme_set_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev,
  1317. uint64_t srg_bss_color)
  1318. {
  1319. struct vdev_mlme_obj *vdev_mlme;
  1320. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1321. if (!vdev_mlme)
  1322. return;
  1323. vdev_mlme->mgmt.generic.srg_bss_color = srg_bss_color;
  1324. }
  1325. /**
  1326. * wlan_vdev_mlme_set_srg_partial_bssid_bit_map() - set spatial reuse
  1327. * srg partial bitmap
  1328. * @vdev: VDEV object
  1329. * @srg_partial_bssid: SRG partial BSSID bitmap
  1330. *
  1331. * API to set the spatial reuse partial bssid bitmap
  1332. *
  1333. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1334. *
  1335. * Return: void
  1336. */
  1337. static inline
  1338. void wlan_vdev_mlme_set_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev,
  1339. uint64_t srg_partial_bssid)
  1340. {
  1341. struct vdev_mlme_obj *vdev_mlme;
  1342. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1343. if (!vdev_mlme)
  1344. return;
  1345. vdev_mlme->mgmt.generic.srg_partial_bssid = srg_partial_bssid;
  1346. }
  1347. /**
  1348. * wlan_vdev_mlme_get_srg_bss_color_bit_map() - get spatial reuse bss
  1349. * colorbitmap
  1350. * @vdev: VDEV object
  1351. * @srg_bss_color: SRG BSS color bitmap
  1352. *
  1353. * API to get the spatial reuse bss color bit map
  1354. *
  1355. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1356. *
  1357. * Return: void
  1358. */
  1359. static inline
  1360. void wlan_vdev_mlme_get_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev,
  1361. uint64_t *srg_bss_color)
  1362. {
  1363. struct vdev_mlme_obj *vdev_mlme;
  1364. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1365. if (!vdev_mlme)
  1366. return;
  1367. *srg_bss_color = vdev_mlme->mgmt.generic.srg_bss_color;
  1368. }
  1369. /**
  1370. * wlan_vdev_mlme_get_srg_partial_bssid_bit_map() - get spatial reuse
  1371. * srg partial bitmap
  1372. * @vdev: VDEV object
  1373. * @srg_partial_bssid: SRG partial BSSID bitmap
  1374. *
  1375. * API to get the spatial reuse partial bssid bitmap
  1376. *
  1377. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1378. *
  1379. * Return: void
  1380. */
  1381. static inline void
  1382. wlan_vdev_mlme_get_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev,
  1383. uint64_t *srg_partial_bssid)
  1384. {
  1385. struct vdev_mlme_obj *vdev_mlme;
  1386. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1387. if (!vdev_mlme)
  1388. return;
  1389. *srg_partial_bssid = vdev_mlme->mgmt.generic.srg_partial_bssid;
  1390. }
  1391. #else
  1392. static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(struct wlan_objmgr_vdev *vdev)
  1393. {
  1394. return 0;
  1395. }
  1396. static inline uint8_t wlan_vdev_mlme_get_pd_offset(
  1397. struct wlan_objmgr_vdev *vdev)
  1398. {
  1399. return 0;
  1400. }
  1401. static inline bool wlan_vdev_mlme_get_he_spr_enabled(
  1402. struct wlan_objmgr_vdev *vdev)
  1403. {
  1404. return 0;
  1405. }
  1406. static inline
  1407. bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev)
  1408. {
  1409. return false;
  1410. }
  1411. static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev,
  1412. uint8_t sr_ctrl)
  1413. {
  1414. }
  1415. static inline void wlan_vdev_mlme_set_pd_offset(struct wlan_objmgr_vdev *vdev,
  1416. uint8_t pd_max_offset)
  1417. {
  1418. }
  1419. static inline void wlan_vdev_mlme_set_he_spr_enabled(
  1420. struct wlan_objmgr_vdev *vdev,
  1421. bool enable_he_spr)
  1422. {
  1423. }
  1424. static inline
  1425. void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev,
  1426. bool he_spr_disabled_due_conc)
  1427. {
  1428. }
  1429. #endif
  1430. #else
  1431. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1432. struct wlan_objmgr_vdev *vdev,
  1433. uint16_t he_mcs_12_13_map)
  1434. {
  1435. }
  1436. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1437. struct wlan_objmgr_vdev *vdev)
  1438. {
  1439. return 0;
  1440. }
  1441. #endif
  1442. /**
  1443. * wlan_vdev_mlme_set_aid_mgr() - set aid mgr
  1444. * @vdev: VDEV object
  1445. * @aid_mgr: AID mgr
  1446. *
  1447. * API to set AID mgr in VDEV MLME cmpt object
  1448. *
  1449. * Return: void
  1450. */
  1451. static inline void wlan_vdev_mlme_set_aid_mgr(
  1452. struct wlan_objmgr_vdev *vdev,
  1453. struct wlan_vdev_aid_mgr *aid_mgr)
  1454. {
  1455. struct vdev_mlme_obj *vdev_mlme;
  1456. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1457. if (!vdev_mlme)
  1458. return;
  1459. vdev_mlme->mgmt.ap.aid_mgr = aid_mgr;
  1460. }
  1461. /**
  1462. * wlan_vdev_mlme_get_aid_mgr() - get aid mgr
  1463. * @vdev: VDEV object
  1464. *
  1465. * API to get AID mgr in VDEV MLME cmpt object
  1466. *
  1467. * Return: aid_mgr
  1468. */
  1469. static inline struct wlan_vdev_aid_mgr *wlan_vdev_mlme_get_aid_mgr(
  1470. struct wlan_objmgr_vdev *vdev)
  1471. {
  1472. struct vdev_mlme_obj *vdev_mlme;
  1473. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1474. if (!vdev_mlme)
  1475. return NULL;
  1476. return vdev_mlme->mgmt.ap.aid_mgr;
  1477. }
  1478. #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
  1479. /**
  1480. * vdev_mgr_cdp_vdev_attach() - MLME API to attach CDP vdev
  1481. * @mlme_obj: pointer to vdev_mlme_obj
  1482. *
  1483. * Return: QDF_STATUS - Success or Failure
  1484. */
  1485. QDF_STATUS vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj);
  1486. /**
  1487. * vdev_mgr_cdp_vdev_detach() - MLME API to detach CDP vdev
  1488. * @mlme_obj: pointer to vdev_mlme_obj
  1489. *
  1490. * Return: QDF_STATUS - Success or Failure
  1491. */
  1492. QDF_STATUS vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj);
  1493. #endif
  1494. #endif