wlan_vdev_mlme.h 55 KB

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