wlan_vdev_mlme.h 48 KB

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