wlan_vdev_mlme.h 52 KB

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