wlan_vdev_mlme.h 52 KB

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