wlan_vdev_mlme.h 55 KB

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