wlan_tdls_public_structs.h 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088
  1. /*
  2. * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: wlan_tdls_public_structs.h
  20. *
  21. * TDLS public structure definations
  22. */
  23. #ifndef _WLAN_TDLS_STRUCTS_H_
  24. #define _WLAN_TDLS_STRUCTS_H_
  25. #include <qdf_timer.h>
  26. #include <qdf_list.h>
  27. #include <qdf_mc_timer.h>
  28. #include <wlan_cmn.h>
  29. #include <wlan_cmn_ieee80211.h>
  30. #define WLAN_TDLS_STA_MAX_NUM 8
  31. #define WLAN_TDLS_STA_P_UAPSD_OFFCHAN_MAX_NUM 1
  32. #define WLAN_TDLS_PEER_LIST_SIZE 16
  33. #define WLAN_TDLS_CT_TABLE_SIZE 8
  34. #define WLAN_TDLS_PEER_SUB_LIST_SIZE 10
  35. #define WLAN_MAC_MAX_EXTN_CAP 8
  36. #define WLAN_MAC_MAX_SUPP_CHANNELS 100
  37. #define WLAN_MAC_WMI_MAX_SUPP_CHANNELS 128
  38. #define WLAN_MAX_SUPP_OPER_CLASSES 32
  39. #define WLAN_MAC_MAX_SUPP_RATES 32
  40. #define WLAN_CHANNEL_14 14
  41. #define ENABLE_CHANSWITCH 1
  42. #define DISABLE_CHANSWITCH 2
  43. #define WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_MIN 1
  44. #define WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_MAX 165
  45. #define WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEF 36
  46. #define AC_PRIORITY_NUM 4
  47. /** Maximum time(ms) to wait for tdls add sta to complete **/
  48. #define WAIT_TIME_TDLS_ADD_STA 1500
  49. /** Maximum time(ms) to wait for tdls del sta to complete **/
  50. #define WAIT_TIME_TDLS_DEL_STA 1500
  51. /** Maximum time(ms) to wait for Link Establish Req to complete **/
  52. #define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ 1500
  53. /** Maximum time(ms) to wait for tdls mgmt to complete **/
  54. #define WAIT_TIME_FOR_TDLS_MGMT 11000
  55. /** Maximum time(ms) to wait for tdls mgmt to complete **/
  56. #define WAIT_TIME_FOR_TDLS_USER_CMD 11000
  57. /** Maximum waittime for TDLS teardown links **/
  58. #define WAIT_TIME_FOR_TDLS_TEARDOWN_LINKS 10000
  59. /** Maximum waittime for TDLS antenna switch **/
  60. #define WAIT_TIME_FOR_TDLS_ANTENNA_SWITCH 1000
  61. #define TDLS_TEARDOWN_PEER_UNREACHABLE 25
  62. #define TDLS_TEARDOWN_PEER_UNSPEC_REASON 26
  63. #define TDLS_STA_INDEX_CHECK(sta_id) \
  64. (((sta_id) >= 1) && ((sta_id) < 0xFF))
  65. /**
  66. * enum tdls_conc_cap - tdls concurrency support
  67. * @TDLS_SUPPORTED_ONLY_ON_STA: only support sta tdls
  68. * @TDLS_SUPPORTED_ONLY_ON_P2P_CLIENT: only support p2p client tdls
  69. */
  70. enum tdls_conc_cap {
  71. TDLS_SUPPORTED_ONLY_ON_STA = 0,
  72. TDLS_SUPPORTED_ONLY_ON_P2P_CLIENT,
  73. };
  74. /**
  75. * enum tdls_peer_capab - tdls capability type
  76. * @TDLS_CAP_NOT_SUPPORTED: tdls not supported
  77. * @TDLS_CAP_UNKNOWN: unknown capability
  78. * @TDLS_CAP_SUPPORTED: tdls capability supported
  79. */
  80. enum tdls_peer_capab {
  81. TDLS_CAP_NOT_SUPPORTED = -1,
  82. TDLS_CAP_UNKNOWN = 0,
  83. TDLS_CAP_SUPPORTED = 1,
  84. };
  85. /**
  86. * enum tdls_peer_state - tdls peer state
  87. * @TDLS_PEER_STATE_PEERING: tdls connection in progress
  88. * @TDLS_PEER_STATE_CONNCTED: tdls peer is connected
  89. * @TDLS_PEER_STATE_TEARDOWN: tdls peer is tear down
  90. * @TDLS_PEER_ADD_MAC_ADDR: add peer mac into connection table
  91. * @TDLS_PEER_REMOVE_MAC_ADDR: remove peer mac from connection table
  92. */
  93. enum tdls_peer_state {
  94. TDLS_PEER_STATE_PEERING,
  95. TDLS_PEER_STATE_CONNCTED,
  96. TDLS_PEER_STATE_TEARDOWN,
  97. TDLS_PEER_ADD_MAC_ADDR,
  98. TDLS_PEER_REMOVE_MAC_ADDR
  99. };
  100. /**
  101. * enum tdls_link_state - tdls link state
  102. * @TDLS_LINK_IDLE: tdls link idle
  103. * @TDLS_LINK_DISCOVERING: tdls link discovering
  104. * @TDLS_LINK_DISCOVERED: tdls link discovered
  105. * @TDLS_LINK_CONNECTING: tdls link connecting
  106. * @TDLS_LINK_CONNECTED: tdls link connected
  107. * @TDLS_LINK_TEARING: tdls link tearing
  108. */
  109. enum tdls_link_state {
  110. TDLS_LINK_IDLE = 0,
  111. TDLS_LINK_DISCOVERING,
  112. TDLS_LINK_DISCOVERED,
  113. TDLS_LINK_CONNECTING,
  114. TDLS_LINK_CONNECTED,
  115. TDLS_LINK_TEARING,
  116. };
  117. /**
  118. * enum tdls_link_state_reason - tdls link reason
  119. * @TDLS_LINK_SUCCESS: Success
  120. * @TDLS_LINK_UNSPECIFIED: Unspecified reason
  121. * @TDLS_LINK_NOT_SUPPORTED: Remote side doesn't support TDLS
  122. * @TDLS_LINK_UNSUPPORTED_BAND: Remote side doesn't support this band
  123. * @TDLS_LINK_NOT_BENEFICIAL: Going to AP is better than direct
  124. * @TDLS_LINK_DROPPED_BY_REMOTE: Remote side doesn't want it anymore
  125. */
  126. enum tdls_link_state_reason {
  127. TDLS_LINK_SUCCESS,
  128. TDLS_LINK_UNSPECIFIED = -1,
  129. TDLS_LINK_NOT_SUPPORTED = -2,
  130. TDLS_LINK_UNSUPPORTED_BAND = -3,
  131. TDLS_LINK_NOT_BENEFICIAL = -4,
  132. TDLS_LINK_DROPPED_BY_REMOTE = -5,
  133. };
  134. /**
  135. * enum tdls_feature_mode - TDLS support mode
  136. * @TDLS_SUPPORT_DISABLED: Disabled in ini or FW
  137. * @TDLS_SUPPORT_SUSPENDED: TDLS supported by ini and FW, but disabled
  138. * temporarily due to off-channel operations or due to other reasons
  139. * @TDLS_SUPPORT_EXP_TRIG_ONLY: Explicit trigger mode
  140. * @TDLS_SUPPORT_IMP_MODE: Implicit mode
  141. * @TDLS_SUPPORT_EXT_CONTROL: External control mode
  142. */
  143. enum tdls_feature_mode {
  144. TDLS_SUPPORT_DISABLED = 0,
  145. TDLS_SUPPORT_SUSPENDED,
  146. TDLS_SUPPORT_EXP_TRIG_ONLY,
  147. TDLS_SUPPORT_IMP_MODE,
  148. TDLS_SUPPORT_EXT_CONTROL,
  149. };
  150. /**
  151. * enum tdls_command_type - TDLS command type
  152. * @TDLS_CMD_TX_ACTION: send tdls action frame
  153. * @TDLS_CMD_ADD_STA: add tdls peer
  154. * @TDLS_CMD_CHANGE_STA: change tdls peer
  155. * @TDLS_CMD_ENABLE_LINK: enable tdls link
  156. * @TDLS_CMD_DISABLE_LINK: disable tdls link
  157. * @TDLS_CMD_CONFIG_FORCE_PEER: config external peer
  158. * @TDLS_CMD_REMOVE_FORCE_PEER: remove external peer
  159. * @TDLS_CMD_STATS_UPDATE: update tdls stats
  160. * @TDLS_CMD_CONFIG_UPDATE: config tdls
  161. * @TDLS_CMD_SCAN_DONE: scon done event
  162. * @TDLS_CMD_SET_RESPONDER: responder event
  163. * @TDLS_NOTIFY_STA_CONNECTION: notify sta connection
  164. * @TDLS_NOTIFY_STA_DISCONNECTION: notify sta disconnection
  165. * @TDLS_CMD_SET_TDLS_MODE: set the tdls mode
  166. * @TDLS_CMD_SESSION_INCREMENT: notify session increment
  167. * @TDLS_CMD_SESSION_DECREMENT: notify session decrement
  168. * @TDLS_CMD_TEARDOWN_LINKS: notify teardown
  169. * @TDLS_NOTIFY_RESET_ADAPTERS: notify adapter reset
  170. * @TDLS_CMD_GET_ALL_PEERS: get all the tdls peers from the list
  171. * @TDLS_CMD_ANTENNA_SWITCH: dynamic tdls antenna switch
  172. */
  173. enum tdls_command_type {
  174. TDLS_CMD_TX_ACTION = 1,
  175. TDLS_CMD_ADD_STA,
  176. TDLS_CMD_CHANGE_STA,
  177. TDLS_CMD_ENABLE_LINK,
  178. TDLS_CMD_DISABLE_LINK,
  179. TDLS_CMD_CONFIG_FORCE_PEER,
  180. TDLS_CMD_REMOVE_FORCE_PEER,
  181. TDLS_CMD_STATS_UPDATE,
  182. TDLS_CMD_CONFIG_UPDATE,
  183. TDLS_CMD_SCAN_DONE,
  184. TDLS_CMD_SET_RESPONDER,
  185. TDLS_NOTIFY_STA_CONNECTION,
  186. TDLS_NOTIFY_STA_DISCONNECTION,
  187. TDLS_CMD_SET_TDLS_MODE,
  188. TDLS_CMD_SESSION_INCREMENT,
  189. TDLS_CMD_SESSION_DECREMENT,
  190. TDLS_CMD_TEARDOWN_LINKS,
  191. TDLS_NOTIFY_RESET_ADAPTERS,
  192. TDLS_CMD_GET_ALL_PEERS,
  193. TDLS_CMD_ANTENNA_SWITCH
  194. };
  195. /**
  196. * enum tdls_event_type - TDLS event type
  197. * @TDLS_EVENT_VDEV_STATE_CHANGE: umac connect/disconnect event
  198. * @TDLS_EVENT_MGMT_TX_ACK_CNF: tx tdls frame ack event
  199. * @TDLS_EVENT_RX_MGMT: rx discovery response frame
  200. * @TDLS_EVENT_ADD_PEER: add peer or update peer
  201. * @TDLS_EVENT_DEL_PEER: delete peer
  202. * @TDLS_EVENT_DISCOVERY_REQ: dicovery request
  203. * @TDLS_EVENT_TEARDOWN_REQ: teardown request
  204. * @TDLS_EVENT_SETUP_REQ: setup request
  205. * @TDLS_EVENT_TEARDOWN_LINKS_DONE: teardown completion event
  206. * @TDLS_EVENT_USER_CMD: tdls user command
  207. * @TDLS_EVENT_ANTENNA_SWITCH: antenna switch event
  208. */
  209. enum tdls_event_type {
  210. TDLS_EVENT_VDEV_STATE_CHANGE = 0,
  211. TDLS_EVENT_MGMT_TX_ACK_CNF,
  212. TDLS_EVENT_RX_MGMT,
  213. TDLS_EVENT_ADD_PEER,
  214. TDLS_EVENT_DEL_PEER,
  215. TDLS_EVENT_DISCOVERY_REQ,
  216. TDLS_EVENT_TEARDOWN_REQ,
  217. TDLS_EVENT_SETUP_REQ,
  218. TDLS_EVENT_TEARDOWN_LINKS_DONE,
  219. TDLS_EVENT_USER_CMD,
  220. TDLS_EVENT_ANTENNA_SWITCH,
  221. };
  222. /**
  223. * enum tdls_state_t - tdls state
  224. * @QCA_WIFI_HAL_TDLS_DISABLED: TDLS is not enabled, or is disabled now
  225. * @QCA_WIFI_HAL_TDLS_ENABLED: TDLS is enabled, but not yet tried
  226. * @QCA_WIFI_HAL_TDLS_ESTABLISHED: Direct link is established
  227. * @QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL: Direct link established using MCC
  228. * @QCA_WIFI_HAL_TDLS_DROPPED: Direct link was established, but is now dropped
  229. * @QCA_WIFI_HAL_TDLS_FAILED: Direct link failed
  230. */
  231. enum tdls_state_t {
  232. QCA_WIFI_HAL_TDLS_S_DISABLED = 1,
  233. QCA_WIFI_HAL_TDLS_S_ENABLED,
  234. QCA_WIFI_HAL_TDLS_S_ESTABLISHED,
  235. QCA_WIFI_HAL_TDLS_S_ESTABLISHED_OFF_CHANNEL,
  236. QCA_WIFI_HAL_TDLS_S_DROPPED,
  237. QCA_WIFI_HAL_TDLS_S_FAILED,
  238. };
  239. /**
  240. * enum tdls_off_chan_mode - mode for WMI_TDLS_SET_OFFCHAN_MODE_CMDID
  241. * @TDLS_ENABLE_OFFCHANNEL: enable off channel
  242. * @TDLS_DISABLE_OFFCHANNEL: disable off channel
  243. */
  244. enum tdls_off_chan_mode {
  245. TDLS_ENABLE_OFFCHANNEL,
  246. TDLS_DISABLE_OFFCHANNEL
  247. };
  248. /**
  249. * enum tdls_event_msg_type - TDLS event message type
  250. * @TDLS_SHOULD_DISCOVER: should do discover for peer (based on tx bytes per
  251. * second > tx_discover threshold)
  252. * @TDLS_SHOULD_TEARDOWN: recommend teardown the link for peer due to tx bytes
  253. * per second below tx_teardown_threshold
  254. * @TDLS_PEER_DISCONNECTED: tdls peer disconnected
  255. * @TDLS_CONNECTION_TRACKER_NOTIFY: TDLS/BT role change notification for
  256. * connection tracker
  257. */
  258. enum tdls_event_msg_type {
  259. TDLS_SHOULD_DISCOVER = 0,
  260. TDLS_SHOULD_TEARDOWN,
  261. TDLS_PEER_DISCONNECTED,
  262. TDLS_CONNECTION_TRACKER_NOTIFY
  263. };
  264. /**
  265. * enum tdls_event_reason - TDLS event reason
  266. * @TDLS_TEARDOWN_TX: tdls teardown recommended due to low transmits
  267. * @TDLS_TEARDOWN_RSSI: tdls link tear down recommended due to poor RSSI
  268. * @TDLS_TEARDOWN_SCAN: tdls link tear down recommended due to offchannel scan
  269. * @TDLS_TEARDOWN_PTR_TIMEOUT: tdls peer disconnected due to PTR timeout
  270. * @TDLS_TEARDOWN_BAD_PTR: tdls peer disconnected due wrong PTR format
  271. * @TDLS_TEARDOWN_NO_RSP: tdls peer not responding
  272. * @TDLS_DISCONNECTED_PEER_DELETE: tdls peer disconnected due to peer deletion
  273. * @TDLS_PEER_ENTER_BUF_STA: tdls entered buffer STA role, TDLS connection
  274. * tracker needs to handle this
  275. * @TDLS_PEER_EXIT_BUF_STA: tdls exited buffer STA role, TDLS connection tracker
  276. * needs to handle this
  277. * @TDLS_ENTER_BT_BUSY: BT entered busy mode, TDLS connection tracker needs to
  278. * handle this
  279. * @TDLS_EXIT_BT_BUSY: BT exited busy mode, TDLS connection tracker needs to
  280. * handle this
  281. * @DLS_SCAN_STARTED: TDLS module received a scan start event, TDLS connection
  282. * tracker needs to handle this
  283. * @TDLS_SCAN_COMPLETED: TDLS module received a scan complete event, TDLS
  284. * connection tracker needs to handle this
  285. */
  286. enum tdls_event_reason {
  287. TDLS_TEARDOWN_TX,
  288. TDLS_TEARDOWN_RSSI,
  289. TDLS_TEARDOWN_SCAN,
  290. TDLS_TEARDOWN_PTR_TIMEOUT,
  291. TDLS_TEARDOWN_BAD_PTR,
  292. TDLS_TEARDOWN_NO_RSP,
  293. TDLS_DISCONNECTED_PEER_DELETE,
  294. TDLS_PEER_ENTER_BUF_STA,
  295. TDLS_PEER_EXIT_BUF_STA,
  296. TDLS_ENTER_BT_BUSY,
  297. TDLS_EXIT_BT_BUSY,
  298. TDLS_SCAN_STARTED,
  299. TDLS_SCAN_COMPLETED,
  300. };
  301. /**
  302. * enum tdls_disable_sources - TDLS disable sources
  303. * @TDLS_SET_MODE_SOURCE_USER: disable from user
  304. * @TDLS_SET_MODE_SOURCE_SCAN: disable during scan
  305. * @TDLS_SET_MODE_SOURCE_OFFCHANNEL: disable during offchannel
  306. * @TDLS_SET_MODE_SOURCE_BTC: disable during bluetooth
  307. * @TDLS_SET_MODE_SOURCE_P2P: disable during p2p
  308. */
  309. enum tdls_disable_sources {
  310. TDLS_SET_MODE_SOURCE_USER = 0,
  311. TDLS_SET_MODE_SOURCE_SCAN,
  312. TDLS_SET_MODE_SOURCE_OFFCHANNEL,
  313. TDLS_SET_MODE_SOURCE_BTC,
  314. TDLS_SET_MODE_SOURCE_P2P,
  315. };
  316. /**
  317. * struct tdls_osif_indication - tdls indication to os if layer
  318. * @vdev: vdev object
  319. * @reason: used with teardown indication
  320. * @peer_mac: MAC address of the TDLS peer
  321. */
  322. struct tdls_osif_indication {
  323. struct wlan_objmgr_vdev *vdev;
  324. uint16_t reason;
  325. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  326. QDF_STATUS status;
  327. };
  328. /**
  329. * struct tx_frame - tx frame
  330. * @buf: frame buffer
  331. * @buf_len: buffer length
  332. * @tx_timer: tx send timer
  333. */
  334. struct tx_frame {
  335. uint8_t *buf;
  336. size_t buf_len;
  337. qdf_timer_t tx_timer;
  338. };
  339. /**
  340. * enum tdls_feature_bit
  341. * @TDLS_FEATURE_OFF_CHANNEL: tdls off channel
  342. * @TDLS_FEATURE_WMM: tdls wmm
  343. * @TDLS_FEATURE_BUFFER_STA: tdls buffer sta
  344. * @TDLS_FEATURE_SLEEP_STA: tdls sleep sta feature
  345. * @TDLS_FEATURE_SCAN: tdls scan
  346. * @TDLS_FEATURE_ENABLE: tdls enabled
  347. * @TDLS_FEAUTRE_IMPLICIT_TRIGGER: tdls implicit trigger
  348. * @TDLS_FEATURE_EXTERNAL_CONTROL: tdls external control
  349. */
  350. enum tdls_feature_bit {
  351. TDLS_FEATURE_OFF_CHANNEL,
  352. TDLS_FEATURE_WMM,
  353. TDLS_FEATURE_BUFFER_STA,
  354. TDLS_FEATURE_SLEEP_STA,
  355. TDLS_FEATURE_SCAN,
  356. TDLS_FEATURE_ENABLE,
  357. TDLS_FEAUTRE_IMPLICIT_TRIGGER,
  358. TDLS_FEATURE_EXTERNAL_CONTROL
  359. };
  360. #define TDLS_IS_OFF_CHANNEL_ENABLED(flags) \
  361. CHECK_BIT(flags, TDLS_FEATURE_OFF_CHANNEL)
  362. #define TDLS_IS_WMM_ENABLED(flags) \
  363. CHECK_BIT(flags, TDLS_FEATURE_WMM)
  364. #define TDLS_IS_BUFFER_STA_ENABLED(flags) \
  365. CHECK_BIT(flags, TDLS_FEATURE_BUFFER_STA)
  366. #define TDLS_IS_SLEEP_STA_ENABLED(flags) \
  367. CHECK_BIT(flags, TDLS_FEATURE_SLEEP_STA)
  368. #define TDLS_IS_SCAN_ENABLED(flags) \
  369. CHECK_BIT(flags, TDLS_FEATURE_SCAN)
  370. #define TDLS_IS_ENABLED(flags) \
  371. CHECK_BIT(flags, TDLS_FEATURE_ENABLE)
  372. #define TDLS_IS_IMPLICIT_TRIG_ENABLED(flags) \
  373. CHECK_BIT(flags, TDLS_FEAUTRE_IMPLICIT_TRIGGER)
  374. #define TDLS_IS_EXTERNAL_CONTROL_ENABLED(flags) \
  375. CHECK_BIT(flags, TDLS_FEATURE_EXTERNAL_CONTROL)
  376. /**
  377. * struct tdls_user_config - TDLS user configuration
  378. * @tdls_tx_states_period: tdls tx states period
  379. * @tdls_tx_pkt_threshold: tdls tx packets threshold
  380. * @tdls_rx_pkt_threshold: tdls rx packets threshold
  381. * @tdls_max_discovery_attempt: tdls discovery max times
  382. * @tdls_idle_timeout: tdls idle timeout
  383. * @tdls_idle_pkt_threshold: tdls idle packets threshold
  384. * @tdls_rssi_trigger_threshold: tdls rssi trigger threshold
  385. * @tdls_rssi_teardown_threshold: tdls rssi tear down threshold
  386. * @tdls_rssi_delta: tdls rssi delta
  387. * @tdls_uapsd_mask: tdls uapsd mask
  388. * @tdls_uapsd_inactivity_time: tdls uapsd inactivity time
  389. * @tdls_uapsd_pti_window: tdls peer traffic indication window
  390. * @tdls_uapsd_ptr_timeout: tdls peer response timeout
  391. * @tdls_feature_flags: tdls feature flags
  392. * @tdls_pre_off_chan_num: tdls off channel number
  393. * @tdls_pre_off_chan_bw: tdls off channel bandwidth
  394. * @tdls_peer_kickout_threshold: sta kickout threshold for tdls peer
  395. * @delayed_trig_framint: delayed trigger frame interval
  396. * @tdls_vdev_nss_2g: tdls NSS setting for 2G band
  397. * @tdls_vdev_nss_5g: tdls NSS setting for 5G band
  398. */
  399. struct tdls_user_config {
  400. uint32_t tdls_tx_states_period;
  401. uint32_t tdls_tx_pkt_threshold;
  402. uint32_t tdls_rx_pkt_threshold;
  403. uint32_t tdls_max_discovery_attempt;
  404. uint32_t tdls_idle_timeout;
  405. uint32_t tdls_idle_pkt_threshold;
  406. uint32_t tdls_rssi_trigger_threshold;
  407. uint32_t tdls_rssi_teardown_threshold;
  408. uint32_t tdls_rssi_delta;
  409. uint32_t tdls_uapsd_mask;
  410. uint32_t tdls_uapsd_inactivity_time;
  411. uint32_t tdls_uapsd_pti_window;
  412. uint32_t tdls_uapsd_ptr_timeout;
  413. uint32_t tdls_feature_flags;
  414. uint32_t tdls_pre_off_chan_num;
  415. uint32_t tdls_pre_off_chan_bw;
  416. uint32_t tdls_peer_kickout_threshold;
  417. uint32_t delayed_trig_framint;
  418. uint8_t tdls_vdev_nss_2g;
  419. uint8_t tdls_vdev_nss_5g;
  420. };
  421. /**
  422. * struct tdls_config_params - tdls configure paramets
  423. * @tdls: tdls support mode
  424. * @tx_period_t: tdls tx stats period
  425. * @tx_packet_n: tdls tx packets number threshold
  426. * @discovery_tries_n: tdls max discovery attempt count
  427. * @idle_timeout_t: tdls idle time timeout
  428. * @idle_packet_n: tdls idle pkt threshold
  429. * @rssi_trigger_threshold: tdls rssi trigger threshold, checked before setup
  430. * @rssi_teardown_threshold: tdls rssi teardown threshold
  431. * @rssi_delta: rssi delta
  432. */
  433. struct tdls_config_params {
  434. uint32_t tdls;
  435. uint32_t tx_period_t;
  436. uint32_t tx_packet_n;
  437. uint32_t discovery_tries_n;
  438. uint32_t idle_timeout_t;
  439. uint32_t idle_packet_n;
  440. int32_t rssi_trigger_threshold;
  441. int32_t rssi_teardown_threshold;
  442. int32_t rssi_delta;
  443. };
  444. /**
  445. * struct tdls_tx_cnf: tdls tx ack
  446. * @vdev_id: vdev id
  447. * @action_cookie: frame cookie
  448. * @buf: frame buf
  449. * @buf_len: buffer length
  450. * @status: tx send status
  451. */
  452. struct tdls_tx_cnf {
  453. int vdev_id;
  454. uint64_t action_cookie;
  455. void *buf;
  456. size_t buf_len;
  457. int status;
  458. };
  459. /**
  460. * struct tdls_rx_mgmt_frame - rx mgmt frame structure
  461. * @frame_len: frame length
  462. * @rx_chan: rx channel
  463. * @vdev_id: vdev id
  464. * @frm_type: frame type
  465. * @rx_rssi: rx rssi
  466. * @buf: buffer address
  467. */
  468. struct tdls_rx_mgmt_frame {
  469. uint32_t frame_len;
  470. uint32_t rx_chan;
  471. uint32_t vdev_id;
  472. uint32_t frm_type;
  473. uint32_t rx_rssi;
  474. uint8_t buf[1];
  475. };
  476. /**
  477. * tdls_rx_callback() - Callback for rx mgmt frame
  478. * @user_data: user data associated to this rx mgmt frame.
  479. * @rx_frame: RX mgmt frame
  480. *
  481. * This callback will be used to give rx frames to hdd.
  482. *
  483. * Return: None
  484. */
  485. typedef void (*tdls_rx_callback)(void *user_data,
  486. struct tdls_rx_mgmt_frame *rx_frame);
  487. /**
  488. * tdls_wmm_check() - Callback for wmm info
  489. * @psoc: psoc object
  490. *
  491. * This callback will be used to check wmm information
  492. *
  493. * Return: true or false
  494. */
  495. typedef bool (*tdls_wmm_check)(struct wlan_objmgr_vdev **vdev);
  496. /* This callback is used to report state change of peer to wpa_supplicant */
  497. typedef int (*tdls_state_change_callback)(const uint8_t *mac,
  498. uint32_t opclass,
  499. uint32_t channel,
  500. uint32_t state,
  501. int32_t reason, void *ctx);
  502. /* This callback is used to report events to os_if layer */
  503. typedef void (*tdls_evt_callback) (void *data,
  504. enum tdls_event_type ev_type,
  505. struct tdls_osif_indication *event);
  506. /* prototype of callback registered by hdd to receive the ack cnf */
  507. typedef int (*tdls_tx_ack_cnf_callback)(void *user_data,
  508. struct tdls_tx_cnf *tx_ack_cnf_cb_data);
  509. /* This callback is used to register TDLS peer with the datapath */
  510. typedef QDF_STATUS (*tdls_register_peer_callback)(void *userdata,
  511. uint32_t vdev_id,
  512. const uint8_t *mac,
  513. uint16_t stat_id,
  514. uint8_t qos);
  515. /* This callback is used to deregister TDLS peer from the datapath */
  516. typedef QDF_STATUS (*tdls_deregister_peer_callback)(void *userdata,
  517. uint32_t vdev_id,
  518. uint8_t sta_id);
  519. /* This callback is used to update datapath vdev flags */
  520. typedef QDF_STATUS
  521. (*tdls_dp_vdev_update_flags_callback)(void *cbk_data,
  522. uint8_t sta_id,
  523. uint32_t vdev_param,
  524. bool is_link_up);
  525. /**
  526. * struct tdls_start_params - tdls start params
  527. * @config: tdls user config
  528. * @tdls_send_mgmt_req: pass eWNI_SME_TDLS_SEND_MGMT_REQ value
  529. * @tdls_add_sta_req: pass eWNI_SME_TDLS_ADD_STA_REQ value
  530. * @tdls_del_sta_req: pass eWNI_SME_TDLS_DEL_STA_REQ value
  531. * @tdls_update_peer_state: pass WMA_UPDATE_TDLS_PEER_STATE value
  532. * @tdls_del_all_peers: pass eWNI_SME_DEL_ALL_TDLS_PEERS
  533. * @tdls_update_dp_vdev_flags: pass CDP_UPDATE_TDLS_FLAGS
  534. * @tdls_event_cb: tdls event callback
  535. * @tdls_evt_cb_data: tdls event data
  536. * @ack_cnf_cb: tdls tx ack callback to indicate the tx status
  537. * @tx_ack_cnf_cb_data: tdls tx ack user data
  538. * @tdls_peer_context: userdata for register/deregister TDLS peer
  539. * @tdls_reg_peer: register tdls peer with datapath
  540. * @tdls_dereg_peer: deregister tdls peer from datapath
  541. * @tdls_dp_vdev_update: update vdev flags in datapath
  542. */
  543. struct tdls_start_params {
  544. struct tdls_user_config config;
  545. uint16_t tdls_send_mgmt_req;
  546. uint16_t tdls_add_sta_req;
  547. uint16_t tdls_del_sta_req;
  548. uint16_t tdls_update_peer_state;
  549. uint16_t tdls_del_all_peers;
  550. uint32_t tdls_update_dp_vdev_flags;
  551. tdls_rx_callback tdls_rx_cb;
  552. void *tdls_rx_cb_data;
  553. tdls_wmm_check tdls_wmm_cb;
  554. void *tdls_wmm_cb_data;
  555. tdls_evt_callback tdls_event_cb;
  556. void *tdls_evt_cb_data;
  557. tdls_tx_ack_cnf_callback ack_cnf_cb;
  558. void *tx_ack_cnf_cb_data;
  559. void *tdls_peer_context;
  560. tdls_register_peer_callback tdls_reg_peer;
  561. tdls_deregister_peer_callback tdls_dereg_peer;
  562. tdls_dp_vdev_update_flags_callback tdls_dp_vdev_update;
  563. };
  564. /**
  565. * struct tdls_add_peer_params - add peer request parameter
  566. * @peer_addr: peer mac addr
  567. * @peer_type: peer type
  568. * @vdev_id: vdev id
  569. */
  570. struct tdls_add_peer_params {
  571. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  572. uint32_t peer_type;
  573. uint32_t vdev_id;
  574. };
  575. /**
  576. * struct tdls_add_peer_request - peer add request
  577. * @vdev: vdev
  578. * @add_peer_req: add peer request parameters
  579. */
  580. struct tdls_add_peer_request {
  581. struct wlan_objmgr_vdev *vdev;
  582. struct tdls_add_peer_params add_peer_req;
  583. };
  584. /**
  585. * struct tdls_del_peer_params - delete peer request parameter
  586. * @peer_addr: peer mac addr
  587. * @peer_type: peer type
  588. * @vdev_id: vdev id
  589. */
  590. struct tdls_del_peer_params {
  591. const uint8_t *peer_addr;
  592. uint32_t peer_type;
  593. uint32_t vdev_id;
  594. };
  595. /**
  596. * struct tdls_del_peer_request - peer delete request
  597. * @vdev: vdev
  598. * @del_peer_req: delete peer request parameters
  599. */
  600. struct tdls_del_peer_request {
  601. struct wlan_objmgr_vdev *vdev;
  602. struct tdls_del_peer_params del_peer_req;
  603. };
  604. /**
  605. * struct vhgmcsinfo - VHT MCS information
  606. * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams
  607. * @rx_highest: Indicates highest long GI VHT PPDU data rate
  608. * STA can receive. Rate expressed in units of 1 Mbps.
  609. * If this field is 0 this value should not be used to
  610. * consider the highest RX data rate supported.
  611. * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
  612. * @tx_highest: Indicates highest long GI VHT PPDU data rate
  613. * STA can transmit. Rate expressed in units of 1 Mbps.
  614. * If this field is 0 this value should not be used to
  615. * consider the highest TX data rate supported.
  616. */
  617. struct vhtmcsinfo {
  618. uint16_t rx_mcs_map;
  619. uint16_t rx_highest;
  620. uint16_t tx_mcs_map;
  621. uint16_t tx_highest;
  622. };
  623. /**
  624. * struct vhtcap - VHT capabilities
  625. *
  626. * This structure is the "VHT capabilities element" as
  627. * described in 802.11ac D3.0 8.4.2.160
  628. * @vht_cap_info: VHT capability info
  629. * @supp_mcs: VHT MCS supported rates
  630. */
  631. struct vhtcap {
  632. uint32_t vht_capinfo;
  633. struct vhtmcsinfo supp_mcs;
  634. };
  635. struct tdls_update_peer_params {
  636. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  637. uint32_t peer_type;
  638. uint32_t vdev_id;
  639. uint16_t capability;
  640. uint8_t extn_capability[WLAN_MAC_MAX_EXTN_CAP];
  641. uint8_t supported_rates_len;
  642. uint8_t supported_rates[WLAN_MAC_MAX_SUPP_RATES];
  643. uint8_t htcap_present;
  644. struct htcap_cmn_ie ht_cap;
  645. uint8_t vhtcap_present;
  646. struct vhtcap vht_cap;
  647. uint8_t uapsd_queues;
  648. uint8_t max_sp;
  649. uint8_t supported_channels_len;
  650. uint8_t supported_channels[WLAN_MAC_MAX_SUPP_CHANNELS];
  651. uint8_t supported_oper_classes_len;
  652. uint8_t supported_oper_classes[WLAN_MAX_SUPP_OPER_CLASSES];
  653. bool is_qos_wmm_sta;
  654. };
  655. struct tdls_update_peer_request {
  656. struct wlan_objmgr_vdev *vdev;
  657. struct tdls_update_peer_params update_peer_req;
  658. };
  659. /**
  660. * struct tdls_oper_request - tdls operation request
  661. * @vdev: vdev object
  662. * @peer_addr: MAC address of the TDLS peer
  663. */
  664. struct tdls_oper_request {
  665. struct wlan_objmgr_vdev *vdev;
  666. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  667. };
  668. /**
  669. * struct tdls_oper_config_force_peer_request - tdls enable force peer request
  670. * @vdev: vdev object
  671. * @peer_addr: MAC address of the TDLS peer
  672. * @chan: channel
  673. * @max_latency: maximum latency
  674. * @op_class: operation class
  675. * @min_bandwidth: minimal bandwidth
  676. * @callback: state change callback
  677. */
  678. struct tdls_oper_config_force_peer_request {
  679. struct wlan_objmgr_vdev *vdev;
  680. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  681. uint32_t chan;
  682. uint32_t max_latency;
  683. uint32_t op_class;
  684. uint32_t min_bandwidth;
  685. tdls_state_change_callback callback;
  686. };
  687. /**
  688. * struct tdls_info - tdls info
  689. *
  690. * @vdev_id: vdev id
  691. * @tdls_state: tdls state
  692. * @notification_interval_ms: notification interval in ms
  693. * @tx_discovery_threshold: tx discovery threshold
  694. * @tx_teardown_threshold: tx teardown threshold
  695. * @rssi_teardown_threshold: rx teardown threshold
  696. * @rssi_delta: rssi delta
  697. * @tdls_options: tdls options
  698. * @peer_traffic_ind_window: peer traffic indication window
  699. * @peer_traffic_response_timeout: peer traffic response timeout
  700. * @puapsd_mask: puapsd mask
  701. * @puapsd_inactivity_time: puapsd inactivity time
  702. * @puapsd_rx_frame_threshold: puapsd rx frame threshold
  703. * @teardown_notification_ms: tdls teardown notification interval
  704. * @tdls_peer_kickout_threshold: tdls packets threshold
  705. * for peer kickout operation
  706. */
  707. struct tdls_info {
  708. uint32_t vdev_id;
  709. uint32_t tdls_state;
  710. uint32_t notification_interval_ms;
  711. uint32_t tx_discovery_threshold;
  712. uint32_t tx_teardown_threshold;
  713. int32_t rssi_teardown_threshold;
  714. int32_t rssi_delta;
  715. uint32_t tdls_options;
  716. uint32_t peer_traffic_ind_window;
  717. uint32_t peer_traffic_response_timeout;
  718. uint32_t puapsd_mask;
  719. uint32_t puapsd_inactivity_time;
  720. uint32_t puapsd_rx_frame_threshold;
  721. uint32_t teardown_notification_ms;
  722. uint32_t tdls_peer_kickout_threshold;
  723. };
  724. /**
  725. * struct tdls_ch_params - channel parameters
  726. * @chan_id: ID of the channel
  727. * @pwr: power level
  728. * @dfs_set: is dfs supported or not
  729. * @half_rate: is the channel operating at 10MHz
  730. * @quarter_rate: is the channel operating at 5MHz
  731. */
  732. struct tdls_ch_params {
  733. uint8_t chan_id;
  734. uint8_t pwr;
  735. bool dfs_set;
  736. bool half_rate;
  737. bool quarter_rate;
  738. };
  739. /**
  740. * struct tdls_peer_params - TDLS peer capablities parameters
  741. * @is_peer_responder: is peer responder or not
  742. * @peer_uapsd_queue: peer uapsd queue
  743. * @peer_max_sp: peer max SP value
  744. * @peer_buff_sta_support: peer buffer sta supported or not
  745. * @peer_off_chan_support: peer offchannel support
  746. * @peer_curr_operclass: peer current operating class
  747. * @self_curr_operclass: self current operating class
  748. * @peer_chanlen: peer channel length
  749. * @peer_chan: peer channel list
  750. * @peer_oper_classlen: peer operating class length
  751. * @peer_oper_class: peer operating class
  752. * @pref_off_channum: peer offchannel number
  753. * @pref_off_chan_bandwidth: peer offchannel bandwidth
  754. * @opclass_for_prefoffchan: operating class for offchannel
  755. */
  756. struct tdls_peer_params {
  757. uint8_t is_peer_responder;
  758. uint8_t peer_uapsd_queue;
  759. uint8_t peer_max_sp;
  760. uint8_t peer_buff_sta_support;
  761. uint8_t peer_off_chan_support;
  762. uint8_t peer_curr_operclass;
  763. uint8_t self_curr_operclass;
  764. uint8_t peer_chanlen;
  765. struct tdls_ch_params peer_chan[WLAN_MAC_WMI_MAX_SUPP_CHANNELS];
  766. uint8_t peer_oper_classlen;
  767. uint8_t peer_oper_class[WLAN_MAX_SUPP_OPER_CLASSES];
  768. uint8_t pref_off_channum;
  769. uint8_t pref_off_chan_bandwidth;
  770. uint8_t opclass_for_prefoffchan;
  771. };
  772. /**
  773. * struct tdls_peer_update_state - TDLS peer state parameters
  774. * @vdev_id: vdev id
  775. * @peer_macaddr: peer mac address
  776. * @peer_cap: peer capabality
  777. * @resp_reqd: response needed
  778. */
  779. struct tdls_peer_update_state {
  780. uint32_t vdev_id;
  781. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  782. uint32_t peer_state;
  783. struct tdls_peer_params peer_cap;
  784. bool resp_reqd;
  785. };
  786. /**
  787. * struct tdls_channel_switch_params - channel switch parameter structure
  788. * @vdev_id: vdev ID
  789. * @peer_mac_addr: Peer mac address
  790. * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset
  791. * @tdls_off_ch: Target Off Channel
  792. * @oper_class: Operating class for target channel
  793. * @is_responder: Responder or initiator
  794. */
  795. struct tdls_channel_switch_params {
  796. uint32_t vdev_id;
  797. uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
  798. uint16_t tdls_off_ch_bw_offset;
  799. uint8_t tdls_off_ch;
  800. uint8_t tdls_sw_mode;
  801. uint8_t oper_class;
  802. uint8_t is_responder;
  803. };
  804. /**
  805. * enum uapsd_access_cat - U-APSD Access Categories
  806. * @UAPSD_AC_BE: best effort
  807. * @UAPSD_AC_BK: back ground
  808. * @UAPSD_AC_VI: video
  809. * @UAPSD_AC_VO: voice
  810. */
  811. enum uapsd_access_cat {
  812. UAPSD_AC_BE,
  813. UAPSD_AC_BK,
  814. UAPSD_AC_VI,
  815. UAPSD_AC_VO
  816. };
  817. /**
  818. * enum tspec_dir_type - TSPEC Direction type
  819. * @TX_DIR: uplink
  820. * @RX_DIR: downlink
  821. * @BI_DIR: bidirectional
  822. */
  823. enum tspec_dir_type {
  824. TX_DIR = 0,
  825. RX_DIR = 1,
  826. BI_DIR = 2,
  827. };
  828. /**
  829. * struct sta_uapsd_params - uapsd auto trig params
  830. * @wmm_ac: WMM access category from 0 to 3
  831. * @user_priority: User priority to use in trigger frames
  832. * @service_interval: service interval
  833. * @suspend_interval: suspend interval
  834. * @delay_interval: delay interval
  835. */
  836. struct sta_uapsd_params {
  837. uint32_t wmm_ac;
  838. uint32_t user_priority;
  839. uint32_t service_interval;
  840. uint32_t suspend_interval;
  841. uint32_t delay_interval;
  842. };
  843. /**
  844. * struct sta_uapsd_trig_params - uapsd trigger parameter
  845. * @vdevid: vdev id
  846. * @peer_addr: peer address
  847. * @auto_triggerparam: trigger parameters
  848. * @num_ac: no of access category
  849. */
  850. struct sta_uapsd_trig_params {
  851. uint32_t vdevid;
  852. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  853. struct sta_uapsd_params *auto_triggerparam;
  854. uint32_t num_ac;
  855. };
  856. /**
  857. * struct tdls_event_info - firmware tdls event
  858. * @vdev_id: vdev id
  859. * @peermac: peer mac address
  860. * @message_type: message type
  861. * @peer_reason: reason
  862. */
  863. struct tdls_event_info {
  864. uint8_t vdev_id;
  865. struct qdf_mac_addr peermac;
  866. uint16_t message_type;
  867. uint32_t peer_reason;
  868. };
  869. /**
  870. * struct tdls_event_notify - tdls event notify
  871. * @vdev: vdev object
  872. * @event: tdls event
  873. */
  874. struct tdls_event_notify {
  875. struct wlan_objmgr_vdev *vdev;
  876. struct tdls_event_info event;
  877. };
  878. /**
  879. * struct tdls_event_notify - tdls event notify
  880. * @peer_mac: peer's mac address
  881. * @frame_type: Type of TDLS mgmt frame to be sent
  882. * @dialog: dialog token used in the frame.
  883. * @status_code: status to be incuded in the frame
  884. * @responder: Tdls request type
  885. * @peer_capability: peer cpabilities
  886. * @len: length of additional Ies
  887. * @buf: additional IEs to be included
  888. */
  889. struct tdls_send_mgmt {
  890. struct qdf_mac_addr peer_mac;
  891. uint8_t frame_type;
  892. uint8_t dialog;
  893. uint16_t status_code;
  894. uint8_t responder;
  895. uint32_t peer_capability;
  896. uint8_t len;
  897. /* Variable length, do not add anything after this */
  898. uint8_t buf[];
  899. };
  900. /**
  901. * struct tdls_validate_action_req - tdls validate mgmt request
  902. * @vdev: vdev object
  903. * @action_code: action code
  904. * @peer_mac: peer mac address
  905. * @dialog_token: dialog code
  906. * @status_code: status code to add
  907. * @len: len of the frame
  908. * @responder: whether to respond or not
  909. * @max_sta_failed: mgmt failure reason
  910. */
  911. struct tdls_validate_action_req {
  912. struct wlan_objmgr_vdev *vdev;
  913. uint8_t action_code;
  914. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  915. uint8_t dialog_token;
  916. uint8_t status_code;
  917. size_t len;
  918. int responder;
  919. int max_sta_failed;
  920. };
  921. /**
  922. * struct tdls_get_all_peers - get all peers from the list
  923. * @vdev: vdev object
  924. * @buf: output string buffer to hold the peer info
  925. * @buf_len: the size of output string buffer
  926. */
  927. struct tdls_get_all_peers {
  928. struct wlan_objmgr_vdev *vdev;
  929. char *buf;
  930. int buf_len;
  931. };
  932. /**
  933. * struct tdls_send_action_frame_request - tdls send mgmt request
  934. * @vdev: vdev object
  935. * @chk_frame: frame validation structure
  936. * @session_id: session id
  937. * @vdev_id: vdev id
  938. * @cmd_buf: cmd buffer
  939. * @len: length of the frame
  940. * @use_default_ac: access category
  941. * @tdls_mgmt: tdls management
  942. */
  943. struct tdls_action_frame_request {
  944. struct wlan_objmgr_vdev *vdev;
  945. struct tdls_validate_action_req *chk_frame;
  946. uint8_t session_id;
  947. uint8_t vdev_id;
  948. const uint8_t *cmd_buf;
  949. uint8_t len;
  950. bool use_default_ac;
  951. /* Variable length, do not add anything after this */
  952. struct tdls_send_mgmt tdls_mgmt;
  953. };
  954. /**
  955. * struct tdls_set_responder_req - tdls set responder in peer
  956. * @vdev: vdev object
  957. * @peer_mac: peer mac address
  958. * @responder: whether to respond or not
  959. */
  960. struct tdls_set_responder_req {
  961. struct wlan_objmgr_vdev *vdev;
  962. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  963. uint8_t responder;
  964. };
  965. /**
  966. * struct tdls_sta_notify_params - STA connection notify info
  967. * @vdev: vdev object
  968. * @tdls_prohibited: peer mac addr
  969. * @tdls_chan_swit_prohibited: peer type
  970. * @lfr_roam: is trigger due to lfr
  971. * @session_id: session id
  972. */
  973. struct tdls_sta_notify_params {
  974. struct wlan_objmgr_vdev *vdev;
  975. bool tdls_prohibited;
  976. bool tdls_chan_swit_prohibited;
  977. bool lfr_roam;
  978. bool user_disconnect;
  979. uint8_t session_id;
  980. };
  981. /**
  982. * struct tdls_set_mode_params - TDLS set mode params
  983. * @vdev: vdev object
  984. * @tdls_mode: tdls mode to set
  985. * @update_last: inform to update last tdls mode
  986. * @source: mode change requester
  987. */
  988. struct tdls_set_mode_params {
  989. struct wlan_objmgr_vdev *vdev;
  990. enum tdls_feature_mode tdls_mode;
  991. bool update_last;
  992. enum tdls_disable_sources source;
  993. };
  994. /**
  995. * struct tdls_del_all_tdls_peers - delete all tdls peers
  996. * @msg_type: type of message
  997. * @msg_len: length of message
  998. * @bssid: bssid of peer device
  999. */
  1000. struct tdls_del_all_tdls_peers {
  1001. uint16_t msg_type;
  1002. uint16_t msg_len;
  1003. struct qdf_mac_addr bssid;
  1004. };
  1005. /**
  1006. * struct tdls_antenna_switch_request - TDLS antenna switch request
  1007. * @vdev: vdev object
  1008. * @mode: antenna mode, 1x1 or 2x2
  1009. */
  1010. struct tdls_antenna_switch_request {
  1011. struct wlan_objmgr_vdev *vdev;
  1012. uint32_t mode;
  1013. };
  1014. #endif