wlan_vdev_mlme.h 49 KB

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