wlan_vdev_mlme.h 53 KB

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