wlan_vdev_mlme.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  1. /*
  2. * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC: Define VDEV MLME structure and APIs
  18. */
  19. #ifndef _WLAN_VDEV_MLME_H_
  20. #define _WLAN_VDEV_MLME_H_
  21. #include <wlan_vdev_mgr_tgt_if_rx_defs.h>
  22. struct vdev_mlme_obj;
  23. /* Requestor ID for multiple vdev restart */
  24. #define MULTIPLE_VDEV_RESTART_REQ_ID 0x1234
  25. /* values for vdev_type */
  26. #define WLAN_VDEV_MLME_TYPE_AP 0x1
  27. #define WLAN_VDEV_MLME_TYPE_STA 0x2
  28. #define WLAN_VDEV_MLME_TYPE_IBSS 0x3
  29. #define WLAN_VDEV_MLME_TYPE_MONITOR 0x4
  30. /* values for vdev_subtype */
  31. #define WLAN_VDEV_MLME_SUBTYPE_P2P_DEVICE 0x1
  32. #define WLAN_VDEV_MLME_SUBTYPE_P2P_CLIENT 0x2
  33. #define WLAN_VDEV_MLME_SUBTYPE_P2P_GO 0x3
  34. #define WLAN_VDEV_MLME_SUBTYPE_PROXY_STA 0x4
  35. #define WLAN_VDEV_MLME_SUBTYPE_MESH 0x5
  36. /* vdev control flags (per bits) */
  37. #define WLAN_VDEV_MLME_FLAGS_NON_MBSSID_AP 0x00000001
  38. #define WLAN_VDEV_MLME_FLAGS_TRANSMIT_AP 0x00000002
  39. #define WLAN_VDEV_MLME_FLAGS_NON_TRANSMIT_AP 0x00000004
  40. /**
  41. * struct vdev_mlme_proto_generic - generic mlme proto structure
  42. * sent in frames
  43. * @dtim_period: frequency of data transmissions per beacon 1-255
  44. * @slot_time: slot time
  45. * @protection_mode: rts cts protection mode
  46. * @beacon_interval: beacon interval
  47. * @ldpc: low density parity check value
  48. * @nss: number of spatial stream
  49. * @nss_2g: 2.4GHz number of spatial stream
  50. * @nss_5g: 5GHz number of spatial stream
  51. * @tsfadjust: adjusted timer sync value
  52. */
  53. struct vdev_mlme_proto_generic {
  54. uint8_t dtim_period;
  55. uint32_t slot_time;
  56. uint32_t protection_mode;
  57. uint16_t beacon_interval;
  58. uint8_t ldpc;
  59. uint8_t nss;
  60. uint8_t nss_2g;
  61. uint8_t nss_5g;
  62. uint64_t tsfadjust;
  63. };
  64. /**
  65. * struct vdev_mlme_proto_ap - ap specific mlme protocol
  66. * @.
  67. */
  68. struct vdev_mlme_proto_ap {
  69. };
  70. /**
  71. * struct vdev_mlme_proto_sta - sta specific mlme protocol
  72. * @assoc_id: association id of station
  73. * @uapsd_cfg: uapsd configuration
  74. */
  75. struct vdev_mlme_proto_sta {
  76. uint16_t assoc_id;
  77. uint16_t uapsd_cfg;
  78. };
  79. /**
  80. * struct vdev_mlme_proto_bss_color - bss color cfg
  81. * @flags: proposed for future use cases, currently not used.
  82. * @evt_type: bss color collision event.
  83. * @current_bss_color: current bss color.
  84. * @detection_period_ms: scan interval for both AP and STA mode.
  85. * @scan_period_ms: scan period for passive scan to detect collision.
  86. * @free_slot_expiry_time_ms: FW to notify host at timer expiry after
  87. * which Host will disable the bss color.
  88. */
  89. struct vdev_mlme_proto_bss_color {
  90. uint32_t flags;
  91. uint8_t evt_type;
  92. uint32_t current_bss_color;
  93. uint32_t detection_period_ms;
  94. uint32_t scan_period_ms;
  95. uint32_t free_slot_expiry_time_ms;
  96. };
  97. /**
  98. * struct vdev_mlme_vht_info - vdev VHT information
  99. * @caps: vht capabilities
  100. * @subfer: su beam former capability
  101. * @subfee: su beam formee capability
  102. * @mubfer: mu beam former capability
  103. * @mubfee: mu beam formee capability
  104. * @implicit_bf: Implicit BF support
  105. * @sounding_dimension: Beamformer number of sounding dimension
  106. * @en_2gvht: 256 qam status
  107. * @allow_vht: vht capability status
  108. */
  109. struct vdev_mlme_vht_info {
  110. uint32_t caps;
  111. uint8_t subfer;
  112. uint8_t mubfer;
  113. uint8_t subfee;
  114. uint8_t mubfee;
  115. uint8_t implicit_bf;
  116. uint8_t sounding_dimension;
  117. uint8_t en_2gvht;
  118. bool allow_vht;
  119. };
  120. /**
  121. * struct vdev_mlme_ht_info - vdev HT information
  122. * @ht_caps: HT capabilities
  123. * @allow_ht: HT capability status
  124. */
  125. struct vdev_mlme_ht_info {
  126. uint32_t ht_caps;
  127. bool allow_ht;
  128. };
  129. /**
  130. * struct vdev_mlme_he_ops_info - vdev mlme HEOPS information
  131. * @he_ops: he ops
  132. */
  133. struct vdev_mlme_he_ops_info {
  134. uint32_t he_ops;
  135. };
  136. /**
  137. * struct vdev_mlme_he_ops_info - vdev protocol structure holding information
  138. * that is used in frames
  139. * @generic: generic protocol information
  140. * @ap: ap specific protocol information
  141. * @sta: sta specific protocol information
  142. * @vht_info: vht information
  143. * @ht_info: ht capabilities information
  144. * @he_ops_info: he ops information
  145. * @bss_color: 11ax HE BSS Color information
  146. */
  147. struct vdev_mlme_proto {
  148. struct vdev_mlme_proto_generic generic;
  149. struct vdev_mlme_proto_ap ap;
  150. struct vdev_mlme_proto_sta sta;
  151. struct vdev_mlme_vht_info vht_info;
  152. struct vdev_mlme_ht_info ht_info;
  153. struct vdev_mlme_he_ops_info he_ops_info;
  154. struct vdev_mlme_proto_bss_color bss_color;
  155. };
  156. /**
  157. * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg
  158. * @rts_threshold: RTS threshold
  159. * @frag_threshold: Fragmentation threshold
  160. * @probe_delay: time in msec for delaying to send first probe request
  161. * @repeat_probe_time: probe request transmission time
  162. * @drop_unencry: drop unencrypted status
  163. * @ tx_pwrlimit: Tx power limit
  164. * @tx_power: Tx power
  165. * @minpower: Min power
  166. * @maxpower: Max power
  167. * @maxregpower: max regulatory power
  168. * @antennamax: max antenna
  169. * @ampdu: ampdu limit
  170. * @amsdu: amsdu limit
  171. * @ssid: service set identifier
  172. * @ssid_len: ssid length
  173. * @type: vdev type
  174. * @sub_type: vdev subtype
  175. * @rx_decap_type: rx decap type
  176. * @tx_decap_type: tx decap type
  177. * @disable_hw_ack: disable ha ack flag
  178. * @chan_flags: channel flags
  179. * @chan_flags_ext: extended channel flags
  180. * @cfreq0: channel frequency index0
  181. * @cfreq1: channel frequency index1
  182. * @dfs_set: DFS status flag
  183. * @dfs_set_cfreq2: DFS status channel index
  184. * @is_chan_passive: channel passive indication flag
  185. * @reg_class_id: reg domain class id
  186. * @is_11ax_stub_enabled: 11AX stub status indication flag
  187. * @nss_2g: 2G spatial streams
  188. * @nss_5g: 5G spatial streams
  189. * @bssid: bssid
  190. */
  191. struct vdev_mlme_mgmt_generic {
  192. uint32_t rts_threshold;
  193. uint32_t frag_threshold;
  194. uint32_t probe_delay;
  195. uint32_t repeat_probe_time;
  196. uint32_t drop_unencry;
  197. uint32_t tx_pwrlimit;
  198. uint8_t tx_power;
  199. uint8_t minpower;
  200. uint8_t maxpower;
  201. uint8_t maxregpower;
  202. uint8_t antennamax;
  203. uint8_t ampdu;
  204. uint8_t amsdu;
  205. char ssid[WLAN_SSID_MAX_LEN + 1];
  206. uint8_t ssid_len;
  207. uint8_t type;
  208. uint8_t subtype;
  209. uint8_t rx_decap_type;
  210. uint8_t tx_decap_type;
  211. bool disable_hw_ack;
  212. uint64_t chan_flags;
  213. uint16_t chan_flags_ext;
  214. uint32_t cfreq1;
  215. uint32_t cfreq2;
  216. bool dfs_set;
  217. bool dfs_set_cfreq2;
  218. bool is_chan_passive;
  219. uint8_t reg_class_id;
  220. uint8_t is_11ax_stub_enabled;
  221. uint8_t nss_2g;
  222. uint8_t nss_5g;
  223. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  224. };
  225. /**
  226. * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg
  227. * @.
  228. */
  229. struct vdev_mlme_mgmt_ap {
  230. };
  231. /**
  232. * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg
  233. * @.
  234. */
  235. struct vdev_mlme_mgmt_sta {
  236. };
  237. /**
  238. * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters
  239. * @bmiss_first_bcnt: bmiss first time
  240. * @bmiss_final_bcnt: bmiss final time
  241. * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be
  242. * inactive
  243. * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send
  244. * data-null
  245. * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT
  246. */
  247. struct vdev_mlme_inactivity_params {
  248. uint32_t bmiss_first_bcnt;
  249. uint32_t bmiss_final_bcnt;
  250. uint32_t keepalive_min_idle_inactive_time_secs;
  251. uint32_t keepalive_max_idle_inactive_time_secs;
  252. uint32_t keepalive_max_unresponsive_time_secs;
  253. };
  254. /**
  255. * struct vdev_mlme_rate_info - vdev mlme rate information
  256. * @rate_flags: dynamic bandwidth info
  257. * @per_band_tx_mgmt_rate: per band Tx mgmt rate
  258. * @max_rate: max bandwidth rate
  259. * @tx_mgmt_rate: Tx Mgmt rate
  260. * @bcn_tx_rate: beacon Tx rate
  261. * @type: Type of ratemask configuration
  262. * @lower32: Lower 32 bits in the 1st 64-bit value
  263. * @higher32: Higher 32 bits in the 1st 64-bit value
  264. * @lower32_2: Lower 32 bits in the 2nd 64-bit value
  265. * @half_rate: Half rate
  266. * @quarter_rate: quarter rate
  267. */
  268. struct vdev_mlme_rate_info {
  269. uint32_t rate_flags;
  270. uint32_t per_band_tx_mgmt_rate;
  271. uint32_t max_rate;
  272. uint32_t tx_mgmt_rate;
  273. uint32_t bcn_tx_rate;
  274. uint8_t type;
  275. uint32_t lower32;
  276. uint32_t higher32;
  277. uint32_t lower32_2;
  278. bool half_rate;
  279. bool quarter_rate;
  280. };
  281. /**
  282. * struct vdev_mlme_chainmask_info - vdev mlme chainmask information
  283. * @tx_chainmask: Tx chainmask
  284. * @rx_chainmask: Rx Chainmask
  285. * @num_rx_chain: Num of bits set in Rx chain
  286. * @num_tx_chain: Num of bits set in Tx chain
  287. */
  288. struct vdev_mlme_chainmask_info {
  289. uint8_t tx_chainmask;
  290. uint8_t rx_chainmask;
  291. uint8_t num_rx_chain;
  292. uint8_t num_tx_chain;
  293. };
  294. /**
  295. * struct vdev_mlme_powersave_info - vdev mlme powersave information
  296. * @packet_powersave: packet powersave
  297. * @max_li_of_moddtim: max mod dtim
  298. * @dyndtim_cnt: dynamic dtim count
  299. * @listen_interval: listen interval
  300. * @moddtim_cnt: mod dtim count
  301. */
  302. struct vdev_mlme_powersave_info {
  303. uint32_t packet_powersave;
  304. uint32_t max_li_of_moddtim;
  305. uint32_t dyndtim_cnt;
  306. uint32_t listen_interval;
  307. uint32_t moddtim_cnt;
  308. };
  309. /**
  310. * struct vdev_mlme_beacon_info - vdev mlme beacon information
  311. * @beacon_buffer: buffer allocated for beacon frame
  312. * @beacon_offsets: beacon IE's offsets
  313. */
  314. struct vdev_mlme_beacon_info {
  315. qdf_nbuf_t beacon_buffer;
  316. void *beacon_offsets;
  317. };
  318. /**
  319. * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd
  320. * @profile_idx: profile index of the connected non-trans ap (mbssid case).
  321. * 0 means invalid.
  322. * @profile_num: the total profile numbers of non-trans aps (mbssid
  323. * case).
  324. * 0 means non-MBSS AP.
  325. * @mbssid-flags: MBSS IE flags indicating vdev type
  326. * @vdevid_trans: id of transmitting vdev for MBSS IE
  327. * @trans_bssid: bssid of transmitted AP (MBSS IE case)
  328. */
  329. struct vdev_mlme_mbss_11ax {
  330. uint32_t profile_idx;
  331. uint32_t profile_num;
  332. uint32_t mbssid_flags;
  333. uint8_t vdevid_trans;
  334. uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
  335. };
  336. /**
  337. * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg
  338. * @generic: generic mgmt information
  339. * @ap: ap specific mgmt information
  340. * @sta: sta specific mgmt information
  341. * @inactivity_params: inactivity parameters
  342. * @rate_info: bandwidth rate information
  343. * @chainmask_info: Chainmask information
  344. * @powersave_info: Power save parameters
  345. * @beacon_info: beacon buffer information
  346. * @mbss_11ax: MBSS 11ax information
  347. */
  348. struct vdev_mlme_mgmt {
  349. struct vdev_mlme_mgmt_generic generic;
  350. struct vdev_mlme_mgmt_ap ap;
  351. struct vdev_mlme_mgmt_sta sta;
  352. struct vdev_mlme_inactivity_params inactivity_params;
  353. struct vdev_mlme_rate_info rate_info;
  354. struct vdev_mlme_chainmask_info chainmask_info;
  355. struct vdev_mlme_powersave_info powersave_info;
  356. struct vdev_mlme_beacon_info beacon_info;
  357. struct vdev_mlme_mbss_11ax mbss_11ax;
  358. };
  359. /**
  360. * enum beacon_update_op - Beacon update op type
  361. * @BEACON_INIT: Initialize beacon
  362. * @BEACON_REINIT: Re-initialize beacon
  363. * @BEACON_UPDATE: Update dynamic fields of beacon
  364. * @BEACON_CSA: Enable CSA IE
  365. * @BEACON_FREE: Beacon buffer free
  366. */
  367. enum beacon_update_op {
  368. BEACON_INIT,
  369. BEACON_REINIT,
  370. BEACON_UPDATE,
  371. BEACON_CSA,
  372. BEACON_FREE,
  373. };
  374. /**
  375. * enum vdev_cmd_type - Command type
  376. * @START_REQ: Start request
  377. * @RESTART_REQ: Restart request
  378. * @STOP_REQ: STOP request
  379. * @DELETE_REQ: DELETE request
  380. */
  381. enum vdev_cmd_type {
  382. START_REQ,
  383. RESTART_REQ,
  384. STOP_REQ,
  385. DELETE_REQ,
  386. };
  387. /**
  388. * enum vdev_start_resp_type - start respone type
  389. * @START_RESPONSE: Start response
  390. * @RESTART_RESPONSE: Restart response
  391. */
  392. enum vdev_start_resp_type {
  393. START_RESPONSE = 0,
  394. RESTART_RESPONSE,
  395. };
  396. /**
  397. * struct vdev_mlme_ops - VDEV MLME operation callbacks structure
  398. * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params
  399. * @mlme_vdev_reset_proto_params: callback to Reset protocol params
  400. * @mlme_vdev_start_send: callback to initiate actions of VDEV
  401. * MLME start operation
  402. * @mlme_vdev_restart_send: callback to initiate actions of VDEV
  403. * MLME restart operation
  404. * @mlme_vdev_stop_start_send: callback to block start/restart VDEV
  405. * request command
  406. * @mlme_vdev_start_continue: callback to initiate operations on
  407. * LMAC/FW start response
  408. * @mlme_vdev_up_send: callback to initiate actions of VDEV
  409. * MLME up operation
  410. * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving
  411. * to UP state
  412. * @mlme_vdev_notify_roam_start: callback to initiate roaming
  413. * @mlme_vdev_update_beacon: callback to initiate beacon update
  414. * @mlme_vdev_disconnect_peers: callback to initiate disconnection of
  415. * peers
  416. * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer
  417. * @mlme_vdev_stop_send: callback to initiate actions of VDEV
  418. * MLME stop operation
  419. * @mlme_vdev_stop_continue: callback to initiate operations on
  420. * LMAC/FW stop response
  421. * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
  422. * peer delete completion
  423. * @mlme_vdev_down_send: callback to initiate actions of VDEV
  424. * MLME down operation
  425. */
  426. struct vdev_mlme_ops {
  427. QDF_STATUS (*mlme_vdev_validate_basic_params)(
  428. struct vdev_mlme_obj *vdev_mlme,
  429. uint16_t event_data_len, void *event_data);
  430. QDF_STATUS (*mlme_vdev_reset_proto_params)(
  431. struct vdev_mlme_obj *vdev_mlme,
  432. uint16_t event_data_len, void *event_data);
  433. QDF_STATUS (*mlme_vdev_start_send)(
  434. struct vdev_mlme_obj *vdev_mlme,
  435. uint16_t event_data_len, void *event_data);
  436. QDF_STATUS (*mlme_vdev_restart_send)(
  437. struct vdev_mlme_obj *vdev_mlme,
  438. uint16_t event_data_len, void *event_data);
  439. QDF_STATUS (*mlme_vdev_stop_start_send)(
  440. struct vdev_mlme_obj *vdev_mlme,
  441. enum vdev_cmd_type type,
  442. uint16_t event_data_len, void *event_data);
  443. QDF_STATUS (*mlme_vdev_start_continue)(
  444. struct vdev_mlme_obj *vdev_mlme,
  445. uint16_t event_data_len, void *event_data);
  446. QDF_STATUS (*mlme_vdev_sta_conn_start)(
  447. struct vdev_mlme_obj *vdev_mlme,
  448. uint16_t event_data_len, void *event_data);
  449. QDF_STATUS (*mlme_vdev_start_req_failed)(
  450. struct vdev_mlme_obj *vdev_mlme,
  451. uint16_t event_data_len, void *event_data);
  452. QDF_STATUS (*mlme_vdev_up_send)(
  453. struct vdev_mlme_obj *vdev_mlme,
  454. uint16_t event_data_len, void *event_data);
  455. QDF_STATUS (*mlme_vdev_notify_up_complete)(
  456. struct vdev_mlme_obj *vdev_mlme,
  457. uint16_t event_data_len, void *event_data);
  458. QDF_STATUS (*mlme_vdev_notify_roam_start)(
  459. struct vdev_mlme_obj *vdev_mlme,
  460. uint16_t event_data_len, void *event_data);
  461. QDF_STATUS (*mlme_vdev_update_beacon)(
  462. struct vdev_mlme_obj *vdev_mlme,
  463. enum beacon_update_op op,
  464. uint16_t event_data_len, void *event_data);
  465. QDF_STATUS (*mlme_vdev_disconnect_peers)(
  466. struct vdev_mlme_obj *vdev_mlme,
  467. uint16_t event_data_len, void *event_data);
  468. QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)(
  469. struct vdev_mlme_obj *vdev_mlme,
  470. uint16_t event_data_len, void *event_data);
  471. QDF_STATUS (*mlme_vdev_stop_send)(
  472. struct vdev_mlme_obj *vdev_mlme,
  473. uint16_t event_data_len, void *event_data);
  474. QDF_STATUS (*mlme_vdev_stop_continue)(
  475. struct vdev_mlme_obj *vdev_mlme,
  476. uint16_t event_data_len, void *event_data);
  477. QDF_STATUS (*mlme_vdev_down_send)(
  478. struct vdev_mlme_obj *vdev_mlme,
  479. uint16_t event_data_len, void *event_data);
  480. QDF_STATUS (*mlme_vdev_notify_down_complete)(
  481. struct vdev_mlme_obj *vdev_mlme,
  482. uint16_t event_data_len, void *event_data);
  483. QDF_STATUS (*mlme_vdev_ext_delete_rsp)(
  484. struct vdev_mlme_obj *vdev_mlme,
  485. struct vdev_delete_response *rsp);
  486. QDF_STATUS (*mlme_vdev_ext_stop_rsp)(
  487. struct vdev_mlme_obj *vdev_mlme,
  488. struct vdev_stop_response *rsp);
  489. QDF_STATUS (*mlme_vdev_ext_start_rsp)(
  490. struct vdev_mlme_obj *vdev_mlme,
  491. struct vdev_start_response *rsp);
  492. };
  493. /**
  494. * struct vdev_mlme_obj - VDEV MLME component object
  495. * @proto: VDEV MLME proto substructure
  496. * @mgmt: VDEV MLME mgmt substructure
  497. * @sm_lock: VDEV SM lock
  498. * @vdev_cmd_lock: VDEV MLME command atomicity
  499. * @sm_hdl: VDEV SM handle
  500. * @vdev: Pointer to vdev objmgr
  501. * @ops: VDEV MLME callback table
  502. * @ext_vdev_ptr: VDEV MLME legacy pointer
  503. * @vdev_rt: VDEV response timer
  504. */
  505. struct vdev_mlme_obj {
  506. struct vdev_mlme_proto proto;
  507. struct vdev_mlme_mgmt mgmt;
  508. #ifdef VDEV_SM_LOCK_SUPPORT
  509. qdf_spinlock_t sm_lock;
  510. qdf_mutex_t vdev_cmd_lock;
  511. #endif
  512. struct wlan_sm *sm_hdl;
  513. struct wlan_objmgr_vdev *vdev;
  514. struct vdev_mlme_ops *ops;
  515. void *ext_vdev_ptr;
  516. struct vdev_response_timer vdev_rt;
  517. };
  518. /**
  519. * mlme_vdev_validate_basic_params - Validate basic params
  520. * @vdev_mlme_obj: VDEV MLME comp object
  521. * @event_data_len: data size
  522. * @event_data: event data
  523. *
  524. * API validate MLME VDEV basic parameters
  525. *
  526. * Return: SUCCESS on successful validation
  527. * FAILURE, if any parameter is not initialized
  528. */
  529. static inline QDF_STATUS mlme_vdev_validate_basic_params(
  530. struct vdev_mlme_obj *vdev_mlme,
  531. uint16_t event_data_len, void *event_data)
  532. {
  533. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  534. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_validate_basic_params)
  535. ret = vdev_mlme->ops->mlme_vdev_validate_basic_params(
  536. vdev_mlme, event_data_len, event_data);
  537. return ret;
  538. }
  539. /**
  540. * mlme_vdev_reset_proto_params - Reset VDEV protocol params
  541. * @vdev_mlme_obj: VDEV MLME comp object
  542. * @event_data_len: data size
  543. * @event_data: event data
  544. *
  545. * API resets the protocol params fo vdev
  546. *
  547. * Return: SUCCESS on successful reset
  548. * FAILURE, if it fails due to any
  549. */
  550. static inline QDF_STATUS mlme_vdev_reset_proto_params(
  551. struct vdev_mlme_obj *vdev_mlme,
  552. uint16_t event_data_len, void *event_data)
  553. {
  554. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  555. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_reset_proto_params)
  556. ret = vdev_mlme->ops->mlme_vdev_reset_proto_params(
  557. vdev_mlme, event_data_len, event_data);
  558. return ret;
  559. }
  560. /**
  561. * mlme_vdev_start_send - Invokes VDEV start operation
  562. * @vdev_mlme_obj: VDEV MLME comp object
  563. * @event_data_len: data size
  564. * @event_data: event data
  565. *
  566. * API invokes VDEV start operation
  567. *
  568. * Return: SUCCESS on successful completion of start operation
  569. * FAILURE, if it fails due to any
  570. */
  571. static inline QDF_STATUS mlme_vdev_start_send(
  572. struct vdev_mlme_obj *vdev_mlme,
  573. uint16_t event_data_len, void *event_data)
  574. {
  575. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  576. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_send)
  577. ret = vdev_mlme->ops->mlme_vdev_start_send(
  578. vdev_mlme, event_data_len, event_data);
  579. return ret;
  580. }
  581. /**
  582. * mlme_vdev_restart_send - Invokes VDEV restart operation
  583. * @vdev_mlme_obj: VDEV MLME comp object
  584. * @event_data_len: data size
  585. * @event_data: event data
  586. *
  587. * API invokes VDEV restart operation
  588. *
  589. * Return: SUCCESS on successful completion of restart operation
  590. * FAILURE, if it fails due to any
  591. */
  592. static inline QDF_STATUS mlme_vdev_restart_send(
  593. struct vdev_mlme_obj *vdev_mlme,
  594. uint16_t event_data_len, void *event_data)
  595. {
  596. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  597. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_restart_send)
  598. ret = vdev_mlme->ops->mlme_vdev_restart_send(
  599. vdev_mlme, event_data_len, event_data);
  600. return ret;
  601. }
  602. /**
  603. * mlme_vdev_stop_start_send - Invoke block VDEV restart operation
  604. * @vdev_mlme_obj: VDEV MLME comp object
  605. * @restart: restart req/start req
  606. * @event_data_len: data size
  607. * @event_data: event data
  608. *
  609. * API invokes stops pending VDEV restart operation
  610. *
  611. * Return: SUCCESS alsways
  612. */
  613. static inline QDF_STATUS mlme_vdev_stop_start_send(
  614. struct vdev_mlme_obj *vdev_mlme,
  615. uint8_t restart,
  616. uint16_t event_data_len, void *event_data)
  617. {
  618. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  619. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_start_send)
  620. ret = vdev_mlme->ops->mlme_vdev_stop_start_send(
  621. vdev_mlme, restart, event_data_len, event_data);
  622. return ret;
  623. }
  624. /**
  625. * mlme_vdev_start_continue - VDEV start response handling
  626. * @vdev_mlme_obj: VDEV MLME comp object
  627. * @event_data_len: data size
  628. * @event_data: event data
  629. *
  630. * API invokes VDEV start response actions
  631. *
  632. * Return: SUCCESS on successful completion of start response operation
  633. * FAILURE, if it fails due to any
  634. */
  635. static inline QDF_STATUS mlme_vdev_start_continue(
  636. struct vdev_mlme_obj *vdev_mlme,
  637. uint16_t event_data_len, void *event_data)
  638. {
  639. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  640. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_continue)
  641. ret = vdev_mlme->ops->mlme_vdev_start_continue(
  642. vdev_mlme, event_data_len, event_data);
  643. return ret;
  644. }
  645. /**
  646. * mlme_vdev_start_req_failed - Invoke Station VDEV connection, if it pause
  647. * @vdev_mlme_obj: VDEV MLME comp object
  648. * @event_data_len: data size
  649. * @event_data: event data
  650. *
  651. * API invokes on START fail response
  652. *
  653. * Return: SUCCESS on successful invocation of callback
  654. * FAILURE, if it fails due to any
  655. */
  656. static inline QDF_STATUS mlme_vdev_start_req_failed(
  657. struct vdev_mlme_obj *vdev_mlme,
  658. uint16_t event_data_len, void *event_data)
  659. {
  660. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  661. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_req_failed)
  662. ret = vdev_mlme->ops->mlme_vdev_start_req_failed(
  663. vdev_mlme, event_data_len, event_data);
  664. return ret;
  665. }
  666. /**
  667. * mlme_vdev_sta_conn_start - Invoke Station VDEV connection, if it pause
  668. * @vdev_mlme_obj: VDEV MLME comp object
  669. * @event_data_len: data size
  670. * @event_data: event data
  671. *
  672. * API invokes connection SM to start station connection
  673. *
  674. * Return: SUCCESS on successful invocation of connection sm
  675. * FAILURE, if it fails due to any
  676. */
  677. static inline QDF_STATUS mlme_vdev_sta_conn_start(
  678. struct vdev_mlme_obj *vdev_mlme,
  679. uint16_t event_data_len, void *event_data)
  680. {
  681. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  682. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_sta_conn_start)
  683. ret = vdev_mlme->ops->mlme_vdev_sta_conn_start(
  684. vdev_mlme, event_data_len, event_data);
  685. return ret;
  686. }
  687. /**
  688. * mlme_vdev_up_send - VDEV up operation
  689. * @vdev_mlme_obj: VDEV MLME comp object
  690. * @event_data_len: data size
  691. * @event_data: event data
  692. *
  693. * API invokes VDEV up operations
  694. *
  695. * Return: SUCCESS on successful completion of up operation
  696. * FAILURE, if it fails due to any
  697. */
  698. static inline QDF_STATUS mlme_vdev_up_send(
  699. struct vdev_mlme_obj *vdev_mlme,
  700. uint16_t event_data_len, void *event_data)
  701. {
  702. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  703. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_up_send)
  704. ret = vdev_mlme->ops->mlme_vdev_up_send(
  705. vdev_mlme, event_data_len, event_data);
  706. return ret;
  707. }
  708. /**
  709. * mlme_vdev_notify_up_complete - VDEV up state transition notification
  710. * @vdev_mlme_obj: VDEV MLME comp object
  711. * @event_data_len: data size
  712. * @event_data: event data
  713. *
  714. * API notifies MLME on moving to UP state
  715. *
  716. * Return: SUCCESS on successful completion of up notification
  717. * FAILURE, if it fails due to any
  718. */
  719. static inline
  720. QDF_STATUS mlme_vdev_notify_up_complete(struct vdev_mlme_obj *vdev_mlme,
  721. uint16_t event_data_len,
  722. void *event_data)
  723. {
  724. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  725. if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_up_complete)
  726. ret = vdev_mlme->ops->mlme_vdev_notify_up_complete(
  727. vdev_mlme, event_data_len, event_data);
  728. return ret;
  729. }
  730. /**
  731. * mlme_vdev_notify_roam_start - VDEV Roaming notification
  732. * @vdev_mlme_obj: VDEV MLME comp object
  733. * @event_len: data size
  734. * @event_data: event data
  735. *
  736. * API notifies MLME on roaming
  737. *
  738. * Return: SUCCESS on successful completion of up notification
  739. * FAILURE, if it fails due to any
  740. */
  741. static inline
  742. QDF_STATUS mlme_vdev_notify_roam_start(struct vdev_mlme_obj *vdev_mlme,
  743. uint16_t event_len, void *event_data)
  744. {
  745. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  746. if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_roam_start)
  747. ret = vdev_mlme->ops->mlme_vdev_notify_roam_start(vdev_mlme,
  748. event_len,
  749. event_data);
  750. return ret;
  751. }
  752. /**
  753. * mlme_vdev_update_beacon - Updates beacon
  754. * @vdev_mlme_obj: VDEV MLME comp object
  755. * @op: beacon update type
  756. * @event_data_len: data size
  757. * @event_data: event data
  758. *
  759. * API updates/allocates/frees the beacon
  760. *
  761. * Return: SUCCESS on successful update of beacon
  762. * FAILURE, if it fails due to any
  763. */
  764. static inline
  765. QDF_STATUS mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme,
  766. enum beacon_update_op op,
  767. uint16_t event_data_len, void *event_data)
  768. {
  769. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  770. if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_update_beacon)
  771. ret = vdev_mlme->ops->mlme_vdev_update_beacon(vdev_mlme, op,
  772. event_data_len, event_data);
  773. return ret;
  774. }
  775. /**
  776. * mlme_vdev_disconnect_peers - Disconnect peers
  777. * @vdev_mlme_obj: VDEV MLME comp object
  778. * @event_data_len: data size
  779. * @event_data: event data
  780. *
  781. * API trigger stations disconnection with AP VDEV or AP disconnection with STA
  782. * VDEV
  783. *
  784. * Return: SUCCESS on successful invocation of station disconnection
  785. * FAILURE, if it fails due to any
  786. */
  787. static inline QDF_STATUS mlme_vdev_disconnect_peers(
  788. struct vdev_mlme_obj *vdev_mlme,
  789. uint16_t event_data_len, void *event_data)
  790. {
  791. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  792. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_disconnect_peers)
  793. ret = vdev_mlme->ops->mlme_vdev_disconnect_peers(
  794. vdev_mlme, event_data_len, event_data);
  795. return ret;
  796. }
  797. /**
  798. * mlme_vdev_dfs_cac_timer_stop - Stop CAC timer
  799. * @vdev_mlme_obj: VDEV MLME comp object
  800. * @event_data_len: data size
  801. * @event_data: event data
  802. *
  803. * API stops the CAC timer through DFS API
  804. *
  805. * Return: SUCCESS on successful CAC timer stop
  806. * FAILURE, if it fails due to any
  807. */
  808. static inline QDF_STATUS mlme_vdev_dfs_cac_timer_stop(
  809. struct vdev_mlme_obj *vdev_mlme,
  810. uint16_t event_data_len, void *event_data)
  811. {
  812. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  813. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop)
  814. ret = vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop(
  815. vdev_mlme, event_data_len, event_data);
  816. return ret;
  817. }
  818. /**
  819. * mlme_vdev_stop_send - Invokes VDEV stop operation
  820. * @vdev_mlme_obj: VDEV MLME comp object
  821. * @event_data_len: data size
  822. * @event_data: event data
  823. *
  824. * API invokes VDEV stop operation
  825. *
  826. * Return: SUCCESS on successful completion of stop operation
  827. * FAILURE, if it fails due to any
  828. */
  829. static inline QDF_STATUS mlme_vdev_stop_send(
  830. struct vdev_mlme_obj *vdev_mlme,
  831. uint16_t event_data_len, void *event_data)
  832. {
  833. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  834. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_send)
  835. ret = vdev_mlme->ops->mlme_vdev_stop_send(
  836. vdev_mlme, event_data_len, event_data);
  837. return ret;
  838. }
  839. /**
  840. * mlme_vdev_stop_continue - VDEV stop response handling
  841. * @vdev_mlme_obj: VDEV MLME comp object
  842. * @event_data_len: data size
  843. * @event_data: event data
  844. *
  845. * API invokes VDEV stop response actions
  846. *
  847. * Return: SUCCESS on successful completion of stop response operation
  848. * FAILURE, if it fails due to any
  849. */
  850. static inline QDF_STATUS mlme_vdev_stop_continue(
  851. struct vdev_mlme_obj *vdev_mlme,
  852. uint16_t event_data_len, void *event_data)
  853. {
  854. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  855. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_continue)
  856. ret = vdev_mlme->ops->mlme_vdev_stop_continue(vdev_mlme,
  857. event_data_len,
  858. event_data);
  859. return ret;
  860. }
  861. /**
  862. * mlme_vdev_down_send - VDEV down operation
  863. * @vdev_mlme_obj: VDEV MLME comp object
  864. * @event_data_len: data size
  865. * @event_data: event data
  866. *
  867. * API invokes VDEV down operation
  868. *
  869. * Return: SUCCESS on successful completion of VDEV down operation
  870. * FAILURE, if it fails due to any
  871. */
  872. static inline QDF_STATUS mlme_vdev_down_send(
  873. struct vdev_mlme_obj *vdev_mlme,
  874. uint16_t event_data_len, void *event_data)
  875. {
  876. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  877. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_down_send)
  878. ret = vdev_mlme->ops->mlme_vdev_down_send(
  879. vdev_mlme, event_data_len, event_data);
  880. return ret;
  881. }
  882. /**
  883. * mlme_vdev_notify_down_complete - VDEV init state transition notification
  884. * @vdev_mlme_obj: VDEV MLME comp object
  885. * @event_data_len: data size
  886. * @event_data: event data
  887. *
  888. * API notifies MLME on moving to INIT state
  889. *
  890. * Return: SUCCESS on successful completion of down notification
  891. * FAILURE, if it fails due to any
  892. */
  893. static inline QDF_STATUS mlme_vdev_notify_down_complete(
  894. struct vdev_mlme_obj *vdev_mlme,
  895. uint16_t event_data_len, void *event_data)
  896. {
  897. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  898. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_notify_down_complete)
  899. ret = vdev_mlme->ops->mlme_vdev_notify_down_complete(
  900. vdev_mlme, event_data_len, event_data);
  901. return ret;
  902. }
  903. #endif