wlan_vdev_mlme.h 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724
  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. * enum mlme_vdev_dot11_mode - Dot11 mode of the vdev
  275. * MLME_VDEV_DOT11_MODE_AUTO: vdev uses mlme_dot11_mode
  276. * MLME_VDEV_DOT11_MODE_11N: vdev supports 11N mode
  277. * MLME_VDEV_DOT11_MODE_11AC: vdev supports 11AC mode
  278. * MLME_VDEV_DOT11_MODE_11AX: vdev supports 11AX mode
  279. * MLME_VDEV_DOT11_MODE_11BE: vdev supports 11BE mode
  280. */
  281. enum mlme_vdev_dot11_mode {
  282. MLME_VDEV_DOT11_MODE_AUTO,
  283. MLME_VDEV_DOT11_MODE_11N,
  284. MLME_VDEV_DOT11_MODE_11AC,
  285. MLME_VDEV_DOT11_MODE_11AX,
  286. MLME_VDEV_DOT11_MODE_11BE,
  287. };
  288. /**
  289. * struct vdev_mlme_he_ops_info - vdev protocol structure holding information
  290. * that is used in frames
  291. * @vdev_dot11_mode: supported dot11 mode
  292. * @generic: generic protocol information
  293. * @ap: ap specific protocol information
  294. * @sta: sta specific protocol information
  295. * @vht_info: vht information
  296. * @ht_info: ht capabilities information
  297. * @he_ops_info: he ops information
  298. * @eht_cap_info: EHT capability information
  299. * @eht_ops_info: EHT operation information
  300. * @bss_color: 11ax HE BSS Color information
  301. */
  302. struct vdev_mlme_proto {
  303. enum mlme_vdev_dot11_mode vdev_dot11_mode;
  304. struct vdev_mlme_proto_generic generic;
  305. struct vdev_mlme_proto_ap ap;
  306. struct vdev_mlme_proto_sta sta;
  307. struct vdev_mlme_vht_info vht_info;
  308. struct vdev_mlme_ht_info ht_info;
  309. struct vdev_mlme_he_ops_info he_ops_info;
  310. #ifdef WLAN_FEATURE_11BE
  311. struct vdev_mlme_eht_caps_info eht_cap_info;
  312. struct vdev_mlme_eht_ops_info eht_ops_info;
  313. #endif
  314. struct vdev_mlme_proto_bss_color bss_color;
  315. };
  316. /**
  317. * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg
  318. * @rts_threshold: RTS threshold
  319. * @frag_threshold: Fragmentation threshold
  320. * @probe_delay: time in msec for delaying to send first probe request
  321. * @repeat_probe_time: probe request transmission time
  322. * @drop_unencry: drop unencrypted status
  323. * @ tx_pwrlimit: Tx power limit
  324. * @tx_power: Tx power
  325. * @minpower: Min power
  326. * @maxpower: Max power
  327. * @maxregpower: max regulatory power
  328. * @antennamax: max antenna
  329. * @reg_class_id: reg domain class id
  330. * @ampdu: ampdu limit
  331. * @amsdu: amsdu limit
  332. * @ssid: service set identifier
  333. * @ssid_len: ssid length
  334. * @type: vdev type
  335. * @sub_type: vdev subtype
  336. * @rx_decap_type: rx decap type
  337. * @tx_encap_type: tx encap type
  338. * @disable_hw_ack: disable ha ack flag
  339. * @bssid: bssid
  340. * @phy_mode: phy mode
  341. * @special_vdev_mode: indicates special vdev mode
  342. * @he_spr_sr_ctrl: Spatial reuse SR control
  343. * @he_spr_non_srg_pd_max_offset: Non-SRG PD max offset
  344. * @he_spr_srg_max_pd_offset: SRG PD max offset
  345. * @he_spr_srg_min_pd_offset: SRG PD min offset
  346. * @he_spr_enabled: Spatial reuse enabled or not
  347. * @pd_threshold: pd threshold sent by userspace
  348. * @he_spr_disabled_due_conc: spr disabled due to concurrency
  349. * @srg_bss_color: srg bss color
  350. * @srg_partial_bssid: srg partial bssid
  351. */
  352. struct vdev_mlme_mgmt_generic {
  353. uint32_t rts_threshold;
  354. uint32_t frag_threshold;
  355. uint32_t probe_delay;
  356. uint32_t repeat_probe_time;
  357. uint32_t drop_unencry;
  358. uint32_t tx_pwrlimit;
  359. uint8_t tx_power;
  360. uint8_t minpower;
  361. uint8_t maxpower;
  362. uint8_t maxregpower;
  363. uint8_t antennamax;
  364. uint8_t reg_class_id;
  365. uint8_t ampdu;
  366. uint8_t amsdu;
  367. char ssid[WLAN_SSID_MAX_LEN + 1];
  368. uint8_t ssid_len;
  369. uint8_t type;
  370. uint8_t subtype;
  371. uint8_t rx_decap_type;
  372. uint8_t tx_encap_type;
  373. bool disable_hw_ack;
  374. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  375. uint32_t phy_mode;
  376. bool special_vdev_mode;
  377. #ifdef WLAN_FEATURE_SR
  378. uint8_t he_spr_sr_ctrl;
  379. uint8_t he_spr_non_srg_pd_max_offset;
  380. uint8_t he_spr_srg_max_pd_offset;
  381. uint8_t he_spr_srg_min_pd_offset;
  382. bool he_spr_enabled;
  383. bool he_spr_disabled_due_conc;
  384. bool sr_prohibit_enabled;
  385. int32_t pd_threshold;
  386. uint64_t srg_bss_color;
  387. uint64_t srg_partial_bssid;
  388. #endif
  389. };
  390. /*
  391. * struct wlan_vdev_aid_mgr – AID manager
  392. * @aid_bitmap: AID bitmap array
  393. * @start_aid: start of AID index
  394. * @max_aid: Max allowed AID
  395. * @ref_cnt: to share AID across VDEVs for MBSSID
  396. */
  397. struct wlan_vdev_aid_mgr {
  398. qdf_bitmap(aid_bitmap, WLAN_UMAC_MAX_AID);
  399. uint16_t start_aid;
  400. uint16_t max_aid;
  401. qdf_atomic_t ref_cnt;
  402. };
  403. /**
  404. * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg
  405. * @hidden_ssid: flag to indicate whether it is hidden ssid
  406. * @cac_duration_ms: cac duration in milliseconds
  407. * @aid_mgr: AID bitmap mgr
  408. * @max_chan_switch_time: Max channel switch time in milliseconds.
  409. * @last_bcn_ts_ms: Timestamp (in milliseconds) of the last beacon sent on the
  410. * CSA triggered channel.
  411. */
  412. struct vdev_mlme_mgmt_ap {
  413. bool hidden_ssid;
  414. uint32_t cac_duration_ms;
  415. struct wlan_vdev_aid_mgr *aid_mgr;
  416. uint32_t max_chan_switch_time;
  417. unsigned long last_bcn_ts_ms;
  418. };
  419. /**
  420. * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg
  421. * @he_mcs_12_13_map: map to indicate mcs12/13 caps of peer&dut
  422. */
  423. struct vdev_mlme_mgmt_sta {
  424. uint16_t he_mcs_12_13_map;
  425. };
  426. /**
  427. * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters
  428. * @bmiss_first_bcnt: bmiss first time
  429. * @bmiss_final_bcnt: bmiss final time
  430. * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be
  431. * inactive
  432. * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send
  433. * data-null
  434. * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT
  435. */
  436. struct vdev_mlme_inactivity_params {
  437. uint32_t bmiss_first_bcnt;
  438. uint32_t bmiss_final_bcnt;
  439. uint32_t keepalive_min_idle_inactive_time_secs;
  440. uint32_t keepalive_max_idle_inactive_time_secs;
  441. uint32_t keepalive_max_unresponsive_time_secs;
  442. };
  443. /**
  444. * enum vdev_ratemask_type - ratemask phy type
  445. * @WLAN_VDEV_RATEMASK_TYPE_CCK: phy type CCK
  446. * @WLAN_VDEV_RATEMASK_TYPE_HT: phy type ht
  447. * @WLAN_VDEV_RATEMASK_TYPE_VHT: phy type vht
  448. * WLAN_VDEV_RATEMASK_TYPE_HE: phy type he
  449. */
  450. enum vdev_ratemask_type {
  451. WLAN_VDEV_RATEMASK_TYPE_CCK,
  452. WLAN_VDEV_RATEMASK_TYPE_HT,
  453. WLAN_VDEV_RATEMASK_TYPE_VHT,
  454. WLAN_VDEV_RATEMASK_TYPE_HE,
  455. WLAN_VDEV_RATEMASK_TYPE_MAX,
  456. };
  457. /**
  458. * struct vdev_ratemask_params - vdev ratemask parameters
  459. * @type: ratemask phy type
  460. * @lower32: ratemask lower32 bitmask
  461. * @higher32: ratemask higher32 bitmask
  462. * @lower32_2: ratemask lower32_2 bitmask
  463. * @higher32_2: rtaemask higher32_2 bitmask
  464. */
  465. struct vdev_ratemask_params {
  466. uint32_t lower32;
  467. uint32_t higher32;
  468. uint32_t lower32_2;
  469. uint32_t higher32_2;
  470. };
  471. /**
  472. * struct vdev_mlme_rate_info - vdev mlme rate information
  473. * @rate_flags: dynamic bandwidth info
  474. * @per_band_tx_mgmt_rate: per band Tx mgmt rate
  475. * @max_rate: max bandwidth rate
  476. * @tx_mgmt_rate: Tx Mgmt rate
  477. * @bcn_tx_rate: beacon Tx rate
  478. * @bcn_tx_rate_code: beacon Tx rate code
  479. * @ratemask_params: vdev ratemask params per phy type
  480. * @half_rate: Half rate
  481. * @quarter_rate: quarter rate
  482. */
  483. struct vdev_mlme_rate_info {
  484. uint32_t rate_flags;
  485. uint32_t per_band_tx_mgmt_rate;
  486. uint32_t max_rate;
  487. uint32_t tx_mgmt_rate;
  488. uint32_t bcn_tx_rate;
  489. #ifdef WLAN_BCN_RATECODE_ENABLE
  490. uint32_t bcn_tx_rate_code;
  491. #endif
  492. uint32_t rtscts_tx_rate;
  493. struct vdev_ratemask_params ratemask_params[
  494. WLAN_VDEV_RATEMASK_TYPE_MAX];
  495. bool half_rate;
  496. bool quarter_rate;
  497. };
  498. /**
  499. * struct vdev_mlme_chainmask_info - vdev mlme chainmask information
  500. * @tx_chainmask: Tx chainmask
  501. * @rx_chainmask: Rx Chainmask
  502. * @num_rx_chain: Num of bits set in Rx chain
  503. * @num_tx_chain: Num of bits set in Tx chain
  504. */
  505. struct vdev_mlme_chainmask_info {
  506. uint8_t tx_chainmask;
  507. uint8_t rx_chainmask;
  508. uint8_t num_rx_chain;
  509. uint8_t num_tx_chain;
  510. };
  511. /**
  512. * struct vdev_mlme_powersave_info - vdev mlme powersave information
  513. * @packet_powersave: packet powersave
  514. * @max_li_of_moddtim: max mod dtim
  515. * @dyndtim_cnt: dynamic dtim count
  516. * @listen_interval: listen interval
  517. * @moddtim_cnt: mod dtim count
  518. */
  519. struct vdev_mlme_powersave_info {
  520. uint32_t packet_powersave;
  521. uint32_t max_li_of_moddtim;
  522. uint32_t dyndtim_cnt;
  523. uint32_t listen_interval;
  524. uint32_t moddtim_cnt;
  525. };
  526. /**
  527. * struct vdev_mlme_beacon_info - vdev mlme beacon information
  528. * @beacon_buffer: buffer allocated for beacon frame
  529. * @beacon_offsets: beacon IE's offsets
  530. */
  531. struct vdev_mlme_beacon_info {
  532. qdf_nbuf_t beacon_buffer;
  533. void *beacon_offsets;
  534. };
  535. /**
  536. * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd
  537. * @profile_idx: profile index of the connected non-trans ap (mbssid case).
  538. * 0 means invalid.
  539. * @profile_num: the total profile numbers of non-trans aps (mbssid
  540. * case).
  541. * 0 means non-MBSS AP.
  542. * @mbssid-flags: MBSS IE flags indicating vdev type
  543. * @vdevid_trans: id of transmitting vdev for MBSS IE
  544. * @vdev_bmap: vdev bitmap of VAPs in MBSS group
  545. * @is_cmn_param: flag to check mbss common param
  546. * @trans_bssid: bssid of transmitted AP (MBSS IE case)
  547. * @is_multi_mbssid: Flag to identify multi group mbssid support
  548. * @grp_id: Group id of current vdev
  549. */
  550. struct vdev_mlme_mbss_11ax {
  551. uint32_t profile_idx;
  552. uint32_t profile_num;
  553. uint32_t mbssid_flags;
  554. uint8_t vdevid_trans;
  555. unsigned long vdev_bmap;
  556. bool is_cmn_param;
  557. uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
  558. bool is_multi_mbssid;
  559. uint32_t grp_id;
  560. };
  561. /**
  562. * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg
  563. * @generic: generic mgmt information
  564. * @ap: ap specific mgmt information
  565. * @sta: sta specific mgmt information
  566. * @inactivity_params: inactivity parameters
  567. * @rate_info: bandwidth rate information
  568. * @chainmask_info: Chainmask information
  569. * @powersave_info: Power save parameters
  570. * @beacon_info: beacon buffer information
  571. * @mbss_11ax: MBSS 11ax information
  572. */
  573. struct vdev_mlme_mgmt {
  574. struct vdev_mlme_mgmt_generic generic;
  575. struct vdev_mlme_mgmt_ap ap;
  576. struct vdev_mlme_mgmt_sta sta;
  577. struct vdev_mlme_inactivity_params inactivity_params;
  578. struct vdev_mlme_rate_info rate_info;
  579. struct vdev_mlme_chainmask_info chainmask_info;
  580. struct vdev_mlme_powersave_info powersave_info;
  581. struct vdev_mlme_beacon_info beacon_info;
  582. struct vdev_mlme_mbss_11ax mbss_11ax;
  583. };
  584. /**
  585. * enum beacon_update_op - Beacon update op type
  586. * @BEACON_INIT: Initialize beacon
  587. * @BEACON_REINIT: Re-initialize beacon
  588. * @BEACON_UPDATE: Update dynamic fields of beacon
  589. * @BEACON_CSA: Enable CSA IE
  590. * @BEACON_FREE: Beacon buffer free
  591. */
  592. enum beacon_update_op {
  593. BEACON_INIT,
  594. BEACON_REINIT,
  595. BEACON_UPDATE,
  596. BEACON_CSA,
  597. BEACON_FREE,
  598. };
  599. /**
  600. * enum vdev_cmd_type - Command type
  601. * @START_REQ: Start request
  602. * @RESTART_REQ: Restart request
  603. * @STOP_REQ: STOP request
  604. * @DELETE_REQ: DELETE request
  605. */
  606. enum vdev_cmd_type {
  607. START_REQ,
  608. RESTART_REQ,
  609. STOP_REQ,
  610. DELETE_REQ,
  611. };
  612. /**
  613. * enum vdev_start_resp_type - start respone type
  614. * @START_RESPONSE: Start response
  615. * @RESTART_RESPONSE: Restart response
  616. */
  617. enum vdev_start_resp_type {
  618. START_RESPONSE = 0,
  619. RESTART_RESPONSE,
  620. };
  621. /**
  622. * struct vdev_mlme_ops - VDEV MLME operation callbacks structure
  623. * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params
  624. * @mlme_vdev_reset_proto_params: callback to Reset protocol params
  625. * @mlme_vdev_start_send: callback to initiate actions of VDEV
  626. * MLME start operation
  627. * @mlme_vdev_restart_send: callback to initiate actions of VDEV
  628. * MLME restart operation
  629. * @mlme_vdev_stop_start_send: callback to block start/restart VDEV
  630. * request command
  631. * @mlme_vdev_start_continue: callback to initiate operations on
  632. * LMAC/FW start response
  633. * @mlme_vdev_sta_conn_start: callback to initiate STA connection
  634. * @mlme_vdev_up_send: callback to initiate actions of VDEV
  635. * MLME up operation
  636. * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving
  637. * to UP state
  638. * @mlme_vdev_notify_roam_start: callback to initiate roaming
  639. * @mlme_vdev_update_beacon: callback to initiate beacon update
  640. * @mlme_vdev_disconnect_peers: callback to initiate disconnection of
  641. * peers
  642. * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer
  643. * @mlme_vdev_stop_send: callback to initiate actions of VDEV
  644. * MLME stop operation
  645. * @mlme_vdev_stop_continue: callback to initiate operations on
  646. * LMAC/FW stop response
  647. * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
  648. * peer delete completion
  649. * @mlme_vdev_down_send: callback to initiate actions of VDEV
  650. * MLME down operation
  651. * @mlme_vdev_notify_start_state_exit: callback to notify on vdev start
  652. * start state exit
  653. * @mlme_vdev_is_newchan_no_cac: callback to check CAC is required
  654. * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for
  655. * vdev mlme peer delete all response
  656. * @mlme_vdev_dfs_cac_wait_notify: callback to notify about CAC state
  657. * @mlme_vdev_csa_complete: callback to indicate CSA complete
  658. * @mlme_vdev_sta_disconn_start: callback to initiate STA disconnection
  659. */
  660. struct vdev_mlme_ops {
  661. QDF_STATUS (*mlme_vdev_validate_basic_params)(
  662. struct vdev_mlme_obj *vdev_mlme,
  663. uint16_t event_data_len, void *event_data);
  664. QDF_STATUS (*mlme_vdev_reset_proto_params)(
  665. struct vdev_mlme_obj *vdev_mlme,
  666. uint16_t event_data_len, void *event_data);
  667. QDF_STATUS (*mlme_vdev_start_send)(
  668. struct vdev_mlme_obj *vdev_mlme,
  669. uint16_t event_data_len, void *event_data);
  670. QDF_STATUS (*mlme_vdev_restart_send)(
  671. struct vdev_mlme_obj *vdev_mlme,
  672. uint16_t event_data_len, void *event_data);
  673. QDF_STATUS (*mlme_vdev_stop_start_send)(
  674. struct vdev_mlme_obj *vdev_mlme,
  675. enum vdev_cmd_type type,
  676. uint16_t event_data_len, void *event_data);
  677. QDF_STATUS (*mlme_vdev_start_continue)(
  678. struct vdev_mlme_obj *vdev_mlme,
  679. uint16_t event_data_len, void *event_data);
  680. QDF_STATUS (*mlme_vdev_sta_conn_start)(
  681. struct vdev_mlme_obj *vdev_mlme,
  682. uint16_t event_data_len, void *event_data);
  683. QDF_STATUS (*mlme_vdev_start_req_failed)(
  684. struct vdev_mlme_obj *vdev_mlme,
  685. uint16_t event_data_len, void *event_data);
  686. QDF_STATUS (*mlme_vdev_up_send)(
  687. struct vdev_mlme_obj *vdev_mlme,
  688. uint16_t event_data_len, void *event_data);
  689. QDF_STATUS (*mlme_vdev_notify_up_complete)(
  690. struct vdev_mlme_obj *vdev_mlme,
  691. uint16_t event_data_len, void *event_data);
  692. QDF_STATUS (*mlme_vdev_notify_roam_start)(
  693. struct vdev_mlme_obj *vdev_mlme,
  694. uint16_t event_data_len, void *event_data);
  695. QDF_STATUS (*mlme_vdev_update_beacon)(
  696. struct vdev_mlme_obj *vdev_mlme,
  697. enum beacon_update_op op,
  698. uint16_t event_data_len, void *event_data);
  699. QDF_STATUS (*mlme_vdev_disconnect_peers)(
  700. struct vdev_mlme_obj *vdev_mlme,
  701. uint16_t event_data_len, void *event_data);
  702. QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)(
  703. struct vdev_mlme_obj *vdev_mlme,
  704. uint16_t event_data_len, void *event_data);
  705. QDF_STATUS (*mlme_vdev_stop_send)(
  706. struct vdev_mlme_obj *vdev_mlme,
  707. uint16_t event_data_len, void *event_data);
  708. QDF_STATUS (*mlme_vdev_stop_continue)(
  709. struct vdev_mlme_obj *vdev_mlme,
  710. uint16_t event_data_len, void *event_data);
  711. QDF_STATUS (*mlme_vdev_down_send)(
  712. struct vdev_mlme_obj *vdev_mlme,
  713. uint16_t event_data_len, void *event_data);
  714. QDF_STATUS (*mlme_vdev_notify_down_complete)(
  715. struct vdev_mlme_obj *vdev_mlme,
  716. uint16_t event_data_len, void *event_data);
  717. QDF_STATUS (*mlme_vdev_ext_stop_rsp)(
  718. struct vdev_mlme_obj *vdev_mlme,
  719. struct vdev_stop_response *rsp);
  720. QDF_STATUS (*mlme_vdev_ext_start_rsp)(
  721. struct vdev_mlme_obj *vdev_mlme,
  722. struct vdev_start_response *rsp);
  723. QDF_STATUS (*mlme_vdev_notify_start_state_exit)(
  724. struct vdev_mlme_obj *vdev_mlme);
  725. QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
  726. struct vdev_mlme_obj *vdev_mlme);
  727. QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)(
  728. struct vdev_mlme_obj *vdev_mlme,
  729. struct peer_delete_all_response *rsp);
  730. QDF_STATUS (*mlme_vdev_dfs_cac_wait_notify)(
  731. struct vdev_mlme_obj *vdev_mlme);
  732. QDF_STATUS (*mlme_vdev_csa_complete)(
  733. struct vdev_mlme_obj *vdev_mlme);
  734. QDF_STATUS (*mlme_vdev_sta_disconn_start)(
  735. struct vdev_mlme_obj *vdev_mlme,
  736. uint16_t event_data_len, void *event_data);
  737. QDF_STATUS (*mlme_vdev_notify_mlo_sync_wait_entry)(
  738. struct vdev_mlme_obj *vdev_mlme);
  739. };
  740. /**
  741. * struct vdev_mlme_obj - VDEV MLME component object
  742. * @proto: VDEV MLME proto substructure
  743. * @mgmt: VDEV MLME mgmt substructure
  744. * @sm_lock: VDEV SM lock
  745. * @vdev_cmd_lock: VDEV MLME command atomicity
  746. * @sm_hdl: VDEV SM handle
  747. * @cnx_mgr_ctx: connection manager context, valid for STA and P2P-CLI mode only
  748. * @vdev: Pointer to vdev objmgr
  749. * @ops: VDEV MLME callback table
  750. * @ext_vdev_ptr: VDEV MLME legacy pointer
  751. * @reg_tpc_obj: Regulatory transmit power info
  752. * @vdev_rt: VDEV response timer
  753. * @vdev_wakelock: vdev wakelock sub structure
  754. */
  755. struct vdev_mlme_obj {
  756. struct vdev_mlme_proto proto;
  757. struct vdev_mlme_mgmt mgmt;
  758. #ifdef VDEV_SM_LOCK_SUPPORT
  759. qdf_spinlock_t sm_lock;
  760. qdf_mutex_t vdev_cmd_lock;
  761. #endif
  762. struct wlan_sm *sm_hdl;
  763. union {
  764. struct cnx_mgr *cnx_mgr_ctx;
  765. };
  766. struct wlan_objmgr_vdev *vdev;
  767. struct vdev_mlme_ops *ops;
  768. mlme_vdev_ext_t *ext_vdev_ptr;
  769. struct reg_tpc_power_info reg_tpc_obj;
  770. };
  771. /**
  772. * wlan_vdev_mlme_set_ssid() - set ssid
  773. * @vdev: VDEV object
  774. * @ssid: SSID (input)
  775. * @ssid_len: Length of SSID
  776. *
  777. * API to set the SSID of VDEV
  778. *
  779. * Caller need to acquire lock with wlan_vdev_obj_lock()
  780. *
  781. * Return: SUCCESS, if update is done
  782. * FAILURE, if ssid length is > max ssid len
  783. */
  784. static inline QDF_STATUS wlan_vdev_mlme_set_ssid(
  785. struct wlan_objmgr_vdev *vdev,
  786. const uint8_t *ssid, uint8_t ssid_len)
  787. {
  788. struct vdev_mlme_obj *vdev_mlme;
  789. /* This API is invoked with lock acquired, do not add log prints */
  790. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  791. if (!vdev_mlme)
  792. return QDF_STATUS_E_FAILURE;
  793. if (ssid_len <= WLAN_SSID_MAX_LEN) {
  794. qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len);
  795. vdev_mlme->mgmt.generic.ssid_len = ssid_len;
  796. } else {
  797. vdev_mlme->mgmt.generic.ssid_len = 0;
  798. return QDF_STATUS_E_FAILURE;
  799. }
  800. return QDF_STATUS_SUCCESS;
  801. }
  802. /**
  803. * wlan_vdev_mlme_get_ssid() - get ssid
  804. * @vdev: VDEV object
  805. * @ssid: SSID
  806. * @ssid_len: Length of SSID
  807. *
  808. * API to get the SSID of VDEV, it updates the SSID and its length
  809. * in @ssid, @ssid_len respectively
  810. *
  811. * Caller need to acquire lock with wlan_vdev_obj_lock()
  812. *
  813. * Return: SUCCESS, if update is done
  814. * FAILURE, if ssid length is > max ssid len
  815. */
  816. static inline QDF_STATUS wlan_vdev_mlme_get_ssid(
  817. struct wlan_objmgr_vdev *vdev,
  818. uint8_t *ssid, uint8_t *ssid_len)
  819. {
  820. struct vdev_mlme_obj *vdev_mlme;
  821. /* This API is invoked with lock acquired, do not add log prints */
  822. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  823. if (!vdev_mlme)
  824. return QDF_STATUS_E_FAILURE;
  825. if (vdev_mlme->mgmt.generic.ssid_len > 0) {
  826. *ssid_len = vdev_mlme->mgmt.generic.ssid_len;
  827. qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len);
  828. } else {
  829. *ssid_len = 0;
  830. return QDF_STATUS_E_FAILURE;
  831. }
  832. return QDF_STATUS_SUCCESS;
  833. }
  834. /**
  835. * wlan_vdev_mlme_set_nss() - set NSS
  836. * @vdev: VDEV object
  837. * @nss: nss configured by user
  838. *
  839. * API to set the Number of Spatial streams
  840. *
  841. * Return: void
  842. */
  843. static inline void wlan_vdev_mlme_set_nss(
  844. struct wlan_objmgr_vdev *vdev,
  845. uint8_t nss)
  846. {
  847. struct vdev_mlme_obj *vdev_mlme;
  848. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  849. if (!vdev_mlme)
  850. return;
  851. vdev_mlme->proto.generic.nss = nss;
  852. }
  853. /**
  854. * wlan_vdev_mlme_get_nss() - get NSS
  855. * @vdev: VDEV object
  856. *
  857. * API to get the Number of Spatial Streams
  858. *
  859. * Return:
  860. * @nss: nss value
  861. */
  862. static inline uint8_t wlan_vdev_mlme_get_nss(
  863. struct wlan_objmgr_vdev *vdev)
  864. {
  865. struct vdev_mlme_obj *vdev_mlme;
  866. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  867. if (!vdev_mlme)
  868. return 0;
  869. return vdev_mlme->proto.generic.nss;
  870. }
  871. /**
  872. * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask
  873. * @vdev: VDEV object
  874. * @chainmask : chainmask either configured by user or max supported
  875. *
  876. * API to set the Tx chainmask
  877. *
  878. * Return: void
  879. */
  880. static inline void wlan_vdev_mlme_set_txchainmask(
  881. struct wlan_objmgr_vdev *vdev,
  882. uint8_t chainmask)
  883. {
  884. struct vdev_mlme_obj *vdev_mlme;
  885. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  886. if (!vdev_mlme)
  887. return;
  888. vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask;
  889. }
  890. /**
  891. * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask
  892. * @vdev: VDEV object
  893. *
  894. * API to get the Tx chainmask
  895. *
  896. * Return:
  897. * @chainmask : Tx chainmask either configured by user or max supported
  898. */
  899. static inline uint8_t wlan_vdev_mlme_get_txchainmask(
  900. struct wlan_objmgr_vdev *vdev)
  901. {
  902. struct vdev_mlme_obj *vdev_mlme;
  903. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  904. if (!vdev_mlme)
  905. return 0;
  906. return vdev_mlme->mgmt.chainmask_info.tx_chainmask;
  907. }
  908. /**
  909. * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask
  910. * @vdev: VDEV object
  911. * @chainmask : Rx chainmask either configured by user or max supported
  912. *
  913. * API to set the Rx chainmask
  914. *
  915. * Return: void
  916. */
  917. static inline void wlan_vdev_mlme_set_rxchainmask(
  918. struct wlan_objmgr_vdev *vdev,
  919. uint8_t chainmask)
  920. {
  921. struct vdev_mlme_obj *vdev_mlme;
  922. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  923. if (!vdev_mlme)
  924. return;
  925. vdev_mlme->mgmt.chainmask_info.rx_chainmask = chainmask;
  926. }
  927. /**
  928. * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask
  929. * @vdev: VDEV object
  930. *
  931. * API to get the Rx chainmask
  932. *
  933. * Return:
  934. * @chainmask : Rx chainmask either configured by user or max supported
  935. */
  936. static inline uint8_t wlan_vdev_mlme_get_rxchainmask(
  937. struct wlan_objmgr_vdev *vdev)
  938. {
  939. struct vdev_mlme_obj *vdev_mlme;
  940. /* This API is invoked with lock acquired, do not add log prints */
  941. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  942. if (!vdev_mlme)
  943. return 0;
  944. return vdev_mlme->mgmt.chainmask_info.rx_chainmask;
  945. }
  946. /**
  947. * wlan_vdev_mlme_set_txpower() - set tx power
  948. * @vdev: VDEV object
  949. * @txpow: tx power either configured by used or max allowed
  950. *
  951. * API to set the tx power
  952. *
  953. * Return: void
  954. */
  955. static inline void wlan_vdev_mlme_set_txpower(
  956. struct wlan_objmgr_vdev *vdev,
  957. uint8_t txpow)
  958. {
  959. struct vdev_mlme_obj *vdev_mlme;
  960. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  961. if (!vdev_mlme)
  962. return;
  963. vdev_mlme->mgmt.generic.tx_power = txpow;
  964. }
  965. /**
  966. * wlan_vdev_mlme_get_txpower() - get tx power
  967. * @vdev: VDEV object
  968. *
  969. * API to get the tx power
  970. *
  971. * Return:
  972. * @txpow: tx power either configured by used or max allowed
  973. */
  974. static inline uint8_t wlan_vdev_mlme_get_txpower(
  975. struct wlan_objmgr_vdev *vdev)
  976. {
  977. struct vdev_mlme_obj *vdev_mlme;
  978. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  979. if (!vdev_mlme)
  980. return 0;
  981. return vdev_mlme->mgmt.generic.tx_power;
  982. }
  983. /**
  984. * wlan_vdev_mlme_set_maxrate() - set max rate
  985. * @vdev: VDEV object
  986. * @maxrate: configured by used or based on configured mode
  987. *
  988. * API to set the max rate the vdev supports
  989. *
  990. * Return: void
  991. */
  992. static inline void wlan_vdev_mlme_set_maxrate(
  993. struct wlan_objmgr_vdev *vdev,
  994. uint32_t maxrate)
  995. {
  996. struct vdev_mlme_obj *vdev_mlme;
  997. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  998. if (!vdev_mlme)
  999. return;
  1000. vdev_mlme->mgmt.rate_info.max_rate = maxrate;
  1001. }
  1002. /**
  1003. * wlan_vdev_mlme_get_maxrate() - get max rate
  1004. * @vdev: VDEV object
  1005. *
  1006. * API to get the max rate the vdev supports
  1007. *
  1008. * Return:
  1009. * @maxrate: configured by used or based on configured mode
  1010. */
  1011. static inline uint32_t wlan_vdev_mlme_get_maxrate(
  1012. struct wlan_objmgr_vdev *vdev)
  1013. {
  1014. struct vdev_mlme_obj *vdev_mlme;
  1015. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1016. if (!vdev_mlme)
  1017. return 0;
  1018. return vdev_mlme->mgmt.rate_info.max_rate;
  1019. }
  1020. /**
  1021. * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate
  1022. * @vdev: VDEV object
  1023. * @txmgmtrate: Tx Mgmt rate
  1024. *
  1025. * API to set Mgmt Tx rate
  1026. *
  1027. * Return: void
  1028. */
  1029. static inline void wlan_vdev_mlme_set_txmgmtrate(
  1030. struct wlan_objmgr_vdev *vdev,
  1031. uint32_t txmgmtrate)
  1032. {
  1033. struct vdev_mlme_obj *vdev_mlme;
  1034. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1035. if (!vdev_mlme)
  1036. return;
  1037. vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate;
  1038. }
  1039. /**
  1040. * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate
  1041. * @vdev: VDEV object
  1042. *
  1043. * API to get Mgmt Tx rate
  1044. *
  1045. * Return:
  1046. * @txmgmtrate: Tx Mgmt rate
  1047. */
  1048. static inline uint32_t wlan_vdev_mlme_get_txmgmtrate(
  1049. struct wlan_objmgr_vdev *vdev)
  1050. {
  1051. struct vdev_mlme_obj *vdev_mlme;
  1052. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1053. if (!vdev_mlme)
  1054. return 0;
  1055. return vdev_mlme->mgmt.rate_info.tx_mgmt_rate;
  1056. }
  1057. /**
  1058. * wlan_vdev_mlme_is_special_vdev() - check given vdev is a special vdev
  1059. * @vdev: VDEV object
  1060. *
  1061. * API to check given vdev is a special vdev.
  1062. *
  1063. * Return: true if given vdev is special vdev, else false
  1064. */
  1065. static inline bool wlan_vdev_mlme_is_special_vdev(
  1066. struct wlan_objmgr_vdev *vdev)
  1067. {
  1068. struct vdev_mlme_obj *vdev_mlme;
  1069. if (!vdev)
  1070. return false;
  1071. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1072. if (!vdev_mlme)
  1073. return false;
  1074. return vdev_mlme->mgmt.generic.special_vdev_mode;
  1075. }
  1076. #ifdef WLAN_FEATURE_11AX
  1077. /**
  1078. * wlan_vdev_mlme_set_he_mcs_12_13_map() - set he mcs12/13 map
  1079. * @vdev: VDEV object
  1080. * @he_mcs_12_13_map: he mcs12/13 map from self&peer
  1081. *
  1082. * API to set he mcs 12/13 map
  1083. *
  1084. * Return: void
  1085. */
  1086. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1087. struct wlan_objmgr_vdev *vdev,
  1088. uint16_t he_mcs_12_13_map)
  1089. {
  1090. struct vdev_mlme_obj *vdev_mlme;
  1091. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1092. if (!vdev_mlme)
  1093. return;
  1094. vdev_mlme->mgmt.sta.he_mcs_12_13_map = he_mcs_12_13_map;
  1095. }
  1096. /**
  1097. * wlan_vdev_mlme_get_he_mcs_12_13_map() - get he mcs12/13 map
  1098. * @vdev: VDEV object
  1099. *
  1100. * API to get he mcs12/13 support capability
  1101. *
  1102. * Return:
  1103. * @he_mcs_12_13_map: he mcs12/13 map
  1104. */
  1105. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1106. 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.sta.he_mcs_12_13_map;
  1113. }
  1114. #ifdef WLAN_FEATURE_SR
  1115. /**
  1116. * wlan_vdev_mlme_get_sr_ctrl() - get spatial reuse SR control
  1117. * @vdev: VDEV object
  1118. *
  1119. * API to retrieve the spatial reuse SR control from VDEV
  1120. *
  1121. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1122. *
  1123. * Return:
  1124. * @he_spr_sr_ctrl: SR control
  1125. */
  1126. static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(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_sr_ctrl;
  1133. }
  1134. /**
  1135. * wlan_vdev_mlme_get_pd_offset() - get spatial reuse pd offset
  1136. * @vdev: VDEV object
  1137. *
  1138. * API to retrieve the spatial reuse pd offset from VDEV
  1139. *
  1140. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1141. *
  1142. * Return:
  1143. * @he_spr_non_srg_pd_max_offset: max pd offset
  1144. */
  1145. static inline uint8_t wlan_vdev_mlme_get_pd_offset(
  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 0;
  1152. return vdev_mlme->mgmt.generic.he_spr_non_srg_pd_max_offset;
  1153. }
  1154. /**
  1155. * wlan_vdev_mlme_get_he_spr_enabled() - spatial reuse enabled or not
  1156. * @vdev: VDEV object
  1157. *
  1158. * API to check whether the spatial reuse enabled or not
  1159. *
  1160. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1161. *
  1162. * Return:
  1163. * @he_spr_enabled: Spatial reuse enabled or not
  1164. */
  1165. static inline bool wlan_vdev_mlme_get_he_spr_enabled(
  1166. struct wlan_objmgr_vdev *vdev)
  1167. {
  1168. struct vdev_mlme_obj *vdev_mlme;
  1169. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1170. if (!vdev_mlme)
  1171. return false;
  1172. return vdev_mlme->mgmt.generic.he_spr_enabled;
  1173. }
  1174. /**
  1175. * wlan_vdev_mlme_is_sr_disable_due_conc() - spatial reuse disabled due
  1176. * to concurrency
  1177. * @vdev: VDEV object
  1178. *
  1179. * API to check whether the spatial reuse disabled due to concurrency or not
  1180. *
  1181. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1182. *
  1183. * Return:
  1184. * true/false: true if spatial reuse disabled due to concurrency else false
  1185. */
  1186. static inline
  1187. bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev)
  1188. {
  1189. struct vdev_mlme_obj *vdev_mlme;
  1190. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1191. if (!vdev_mlme)
  1192. return false;
  1193. return vdev_mlme->mgmt.generic.he_spr_disabled_due_conc;
  1194. }
  1195. /**
  1196. * wlan_vdev_mlme_is_sr_prohibit_en() - spatial reuse PD prohibit enabled
  1197. * / disabled (HE_SIGA_Val15_Allowed)
  1198. * @vdev: VDEV object
  1199. *
  1200. * API to check whether the spatial reuse PD prohibit is enabled / disabled
  1201. *
  1202. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1203. *
  1204. * Return:
  1205. * @sr_prohibit_enabled: Spatial reuse PD prohibit enabled / disabled
  1206. */
  1207. static inline
  1208. bool wlan_vdev_mlme_is_sr_prohibit_en(struct wlan_objmgr_vdev *vdev)
  1209. {
  1210. struct vdev_mlme_obj *vdev_mlme;
  1211. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1212. if (!vdev_mlme)
  1213. return false;
  1214. return vdev_mlme->mgmt.generic.sr_prohibit_enabled;
  1215. }
  1216. /**
  1217. * wlan_vdev_mlme_set_sr_ctrl() - set spatial reuse SR control
  1218. * @vdev: VDEV object
  1219. *
  1220. * API to set the spatial reuse SR control
  1221. *
  1222. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1223. *
  1224. * Return: void
  1225. */
  1226. static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev,
  1227. uint8_t sr_ctrl)
  1228. {
  1229. struct vdev_mlme_obj *vdev_mlme;
  1230. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1231. if (!vdev_mlme)
  1232. return;
  1233. vdev_mlme->mgmt.generic.he_spr_sr_ctrl = sr_ctrl;
  1234. }
  1235. /**
  1236. * wlan_vdev_mlme_set_pd_offset() - set spatial reuse pd max offset
  1237. * @vdev: VDEV object
  1238. *
  1239. * API to set the spatial reuse pd max offset
  1240. *
  1241. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1242. *
  1243. * Return: void
  1244. */
  1245. static inline void wlan_vdev_mlme_set_pd_offset(struct wlan_objmgr_vdev *vdev,
  1246. uint8_t pd_max_offset)
  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_non_srg_pd_max_offset = pd_max_offset;
  1253. }
  1254. /**
  1255. * wlan_vdev_mlme_set_he_spr_enabled() - set spatial reuse enabled
  1256. * @vdev: VDEV object
  1257. *
  1258. * API to set the spatial reuse enabled
  1259. *
  1260. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1261. *
  1262. * Return: void
  1263. */
  1264. static inline void wlan_vdev_mlme_set_he_spr_enabled(
  1265. struct wlan_objmgr_vdev *vdev,
  1266. bool enable_he_spr)
  1267. {
  1268. struct vdev_mlme_obj *vdev_mlme;
  1269. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1270. if (!vdev_mlme)
  1271. return;
  1272. vdev_mlme->mgmt.generic.he_spr_enabled = enable_he_spr;
  1273. }
  1274. /**
  1275. * wlan_vdev_mlme_set_sr_disable_due_conc() - set spatial reuse disabled due
  1276. * to concurrency
  1277. * @vdev: VDEV object
  1278. *
  1279. * API to set the spatial reuse disabled due to concurrency
  1280. *
  1281. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1282. *
  1283. * Return: void
  1284. */
  1285. static inline
  1286. void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev,
  1287. bool he_spr_disabled_due_conc)
  1288. {
  1289. struct vdev_mlme_obj *vdev_mlme;
  1290. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1291. if (!vdev_mlme)
  1292. return;
  1293. vdev_mlme->mgmt.generic.he_spr_disabled_due_conc =
  1294. he_spr_disabled_due_conc;
  1295. }
  1296. /**
  1297. * wlan_vdev_mlme_set_sr_prohibit_en() - set spatial reuse PD prohibit enabled
  1298. * / disabled (HE_SIGA_Val15_Allowed)
  1299. * @vdev: VDEV object
  1300. * @sr_prohibit_enabled: True / False - PD Prohibit enabled / disabled
  1301. *
  1302. * API to set spatial reuse PD prohibit enabled / disabled
  1303. *
  1304. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1305. *
  1306. * Return: void
  1307. */
  1308. static inline
  1309. void wlan_vdev_mlme_set_sr_prohibit_en(struct wlan_objmgr_vdev *vdev,
  1310. bool sr_prohibit_enabled)
  1311. {
  1312. struct vdev_mlme_obj *vdev_mlme;
  1313. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1314. if (!vdev_mlme)
  1315. return;
  1316. vdev_mlme->mgmt.generic.sr_prohibit_enabled = sr_prohibit_enabled;
  1317. }
  1318. /**
  1319. * wlan_vdev_mlme_set_srg_pd_offset() - set spatial reuse SRG pd max/min offset
  1320. * @vdev: VDEV object
  1321. * @srg_max_pd_offset: SRG max pd offset
  1322. * @srg_min_pd_offset: SRG min pd offset
  1323. *
  1324. * API to set the spatial reuse SRG pd min max offset
  1325. *
  1326. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1327. *
  1328. * Return: void
  1329. */
  1330. static inline
  1331. void wlan_vdev_mlme_set_srg_pd_offset(struct wlan_objmgr_vdev *vdev,
  1332. uint8_t srg_max_pd_offset,
  1333. uint8_t srg_min_pd_offset)
  1334. {
  1335. struct vdev_mlme_obj *vdev_mlme;
  1336. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1337. if (!vdev_mlme)
  1338. return;
  1339. vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset = srg_max_pd_offset;
  1340. vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset = srg_min_pd_offset;
  1341. }
  1342. /**
  1343. * wlan_vdev_mlme_get_srg_pd_offset() - get spatial reuse SRG pd min/max offset
  1344. * @vdev: VDEV object
  1345. * @srg_max_pd_offset: SRG max pd offset
  1346. * @srg_min_pd_offset: SRG min pd offset
  1347. *
  1348. * API to set the spatial reuse SRG pd min max offset
  1349. *
  1350. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1351. *
  1352. * Return: void
  1353. */
  1354. static inline
  1355. void wlan_vdev_mlme_get_srg_pd_offset(struct wlan_objmgr_vdev *vdev,
  1356. uint8_t *srg_max_pd_offset,
  1357. uint8_t *srg_min_pd_offset)
  1358. {
  1359. struct vdev_mlme_obj *vdev_mlme;
  1360. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1361. if (!vdev_mlme)
  1362. return;
  1363. *srg_max_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset;
  1364. *srg_min_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset;
  1365. }
  1366. /**
  1367. * wlan_vdev_mlme_set_srg_bss_color() - set spatial reuse bss
  1368. * colorbitmap
  1369. * @vdev: VDEV object
  1370. * @srg_bss_color: SRG BSS color bitmap
  1371. *
  1372. * API to set the spatial reuse bss color bit map
  1373. *
  1374. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1375. *
  1376. * Return: void
  1377. */
  1378. static inline
  1379. void wlan_vdev_mlme_set_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev,
  1380. uint64_t srg_bss_color)
  1381. {
  1382. struct vdev_mlme_obj *vdev_mlme;
  1383. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1384. if (!vdev_mlme)
  1385. return;
  1386. vdev_mlme->mgmt.generic.srg_bss_color = srg_bss_color;
  1387. }
  1388. /**
  1389. * wlan_vdev_mlme_set_srg_partial_bssid_bit_map() - set spatial reuse
  1390. * srg partial bitmap
  1391. * @vdev: VDEV object
  1392. * @srg_partial_bssid: SRG partial BSSID bitmap
  1393. *
  1394. * API to set the spatial reuse partial bssid bitmap
  1395. *
  1396. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1397. *
  1398. * Return: void
  1399. */
  1400. static inline
  1401. void wlan_vdev_mlme_set_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev,
  1402. uint64_t srg_partial_bssid)
  1403. {
  1404. struct vdev_mlme_obj *vdev_mlme;
  1405. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1406. if (!vdev_mlme)
  1407. return;
  1408. vdev_mlme->mgmt.generic.srg_partial_bssid = srg_partial_bssid;
  1409. }
  1410. /**
  1411. * wlan_vdev_mlme_get_srg_bss_color_bit_map() - get spatial reuse bss
  1412. * colorbitmap
  1413. * @vdev: VDEV object
  1414. * @srg_bss_color: SRG BSS color bitmap
  1415. *
  1416. * API to get the spatial reuse bss color bit map
  1417. *
  1418. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1419. *
  1420. * Return: void
  1421. */
  1422. static inline
  1423. void wlan_vdev_mlme_get_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev,
  1424. uint64_t *srg_bss_color)
  1425. {
  1426. struct vdev_mlme_obj *vdev_mlme;
  1427. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1428. if (!vdev_mlme)
  1429. return;
  1430. *srg_bss_color = vdev_mlme->mgmt.generic.srg_bss_color;
  1431. }
  1432. /**
  1433. * wlan_vdev_mlme_get_srg_partial_bssid_bit_map() - get spatial reuse
  1434. * srg partial bitmap
  1435. * @vdev: VDEV object
  1436. * @srg_partial_bssid: SRG partial BSSID bitmap
  1437. *
  1438. * API to get the spatial reuse partial bssid bitmap
  1439. *
  1440. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1441. *
  1442. * Return: void
  1443. */
  1444. static inline void
  1445. wlan_vdev_mlme_get_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev,
  1446. uint64_t *srg_partial_bssid)
  1447. {
  1448. struct vdev_mlme_obj *vdev_mlme;
  1449. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1450. if (!vdev_mlme)
  1451. return;
  1452. *srg_partial_bssid = vdev_mlme->mgmt.generic.srg_partial_bssid;
  1453. }
  1454. #else
  1455. static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(struct wlan_objmgr_vdev *vdev)
  1456. {
  1457. return 0;
  1458. }
  1459. static inline uint8_t wlan_vdev_mlme_get_pd_offset(
  1460. struct wlan_objmgr_vdev *vdev)
  1461. {
  1462. return 0;
  1463. }
  1464. static inline bool wlan_vdev_mlme_get_he_spr_enabled(
  1465. struct wlan_objmgr_vdev *vdev)
  1466. {
  1467. return 0;
  1468. }
  1469. static inline
  1470. bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev)
  1471. {
  1472. return false;
  1473. }
  1474. static inline
  1475. bool wlan_vdev_mlme_is_sr_prohibit_en(struct wlan_objmgr_vdev *vdev)
  1476. {
  1477. return false;
  1478. }
  1479. static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev,
  1480. uint8_t sr_ctrl)
  1481. {
  1482. }
  1483. static inline void wlan_vdev_mlme_set_pd_offset(struct wlan_objmgr_vdev *vdev,
  1484. uint8_t pd_max_offset)
  1485. {
  1486. }
  1487. static inline void wlan_vdev_mlme_set_he_spr_enabled(
  1488. struct wlan_objmgr_vdev *vdev,
  1489. bool enable_he_spr)
  1490. {
  1491. }
  1492. static inline
  1493. void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev,
  1494. bool he_spr_disabled_due_conc)
  1495. {
  1496. }
  1497. static inline
  1498. void wlan_vdev_mlme_set_sr_prohibit_en(struct wlan_objmgr_vdev *vdev,
  1499. bool sr_prohibit_enabled)
  1500. {
  1501. }
  1502. #endif
  1503. #else
  1504. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1505. struct wlan_objmgr_vdev *vdev,
  1506. uint16_t he_mcs_12_13_map)
  1507. {
  1508. }
  1509. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1510. struct wlan_objmgr_vdev *vdev)
  1511. {
  1512. return 0;
  1513. }
  1514. #endif
  1515. /**
  1516. * wlan_vdev_mlme_set_aid_mgr() - set aid mgr
  1517. * @vdev: VDEV object
  1518. * @aid_mgr: AID mgr
  1519. *
  1520. * API to set AID mgr in VDEV MLME cmpt object
  1521. *
  1522. * Return: void
  1523. */
  1524. static inline void wlan_vdev_mlme_set_aid_mgr(
  1525. struct wlan_objmgr_vdev *vdev,
  1526. struct wlan_vdev_aid_mgr *aid_mgr)
  1527. {
  1528. struct vdev_mlme_obj *vdev_mlme;
  1529. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1530. if (!vdev_mlme)
  1531. return;
  1532. vdev_mlme->mgmt.ap.aid_mgr = aid_mgr;
  1533. }
  1534. /**
  1535. * wlan_vdev_mlme_get_aid_mgr() - get aid mgr
  1536. * @vdev: VDEV object
  1537. *
  1538. * API to get AID mgr in VDEV MLME cmpt object
  1539. *
  1540. * Return: aid_mgr
  1541. */
  1542. static inline struct wlan_vdev_aid_mgr *wlan_vdev_mlme_get_aid_mgr(
  1543. struct wlan_objmgr_vdev *vdev)
  1544. {
  1545. struct vdev_mlme_obj *vdev_mlme;
  1546. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1547. if (!vdev_mlme)
  1548. return NULL;
  1549. return vdev_mlme->mgmt.ap.aid_mgr;
  1550. }
  1551. #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
  1552. /**
  1553. * vdev_mgr_cdp_vdev_attach() - MLME API to attach CDP vdev
  1554. * @mlme_obj: pointer to vdev_mlme_obj
  1555. *
  1556. * Return: QDF_STATUS - Success or Failure
  1557. */
  1558. QDF_STATUS vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj);
  1559. /**
  1560. * vdev_mgr_cdp_vdev_detach() - MLME API to detach CDP vdev
  1561. * @mlme_obj: pointer to vdev_mlme_obj
  1562. *
  1563. * Return: QDF_STATUS - Success or Failure
  1564. */
  1565. QDF_STATUS vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj);
  1566. #endif
  1567. #endif