wlan_vdev_mlme.h 55 KB

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