wlan_vdev_mlme.h 55 KB

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