wlan_vdev_mlme.h 55 KB

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