wlan_vdev_mlme.h 30 KB

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