wma.h 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025
  1. /*
  2. * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #ifndef WMA_H
  27. #define WMA_H
  28. #include "a_types.h"
  29. #include "qdf_types.h"
  30. #include "osapi_linux.h"
  31. #include "htc_packet.h"
  32. #include "i_qdf_event.h"
  33. #include "wmi_services.h"
  34. #include "wmi_unified.h"
  35. #include "wmi_version.h"
  36. #include "qdf_types.h"
  37. #include "cfg_api.h"
  38. #include "qdf_status.h"
  39. #include "cds_sched.h"
  40. #include "sir_mac_prot_def.h"
  41. #include "wma_types.h"
  42. #include "ol_txrx_types.h"
  43. #include <linux/workqueue.h>
  44. #include "utils_api.h"
  45. #include "lim_types.h"
  46. #include "wmi_unified_api.h"
  47. #include "cdp_txrx_cmn.h"
  48. /* Platform specific configuration for max. no. of fragments */
  49. #define QCA_OL_11AC_TX_MAX_FRAGS 2
  50. /* Private */
  51. #define WMA_READY_EVENTID_TIMEOUT 2000
  52. #define WMA_SERVICE_READY_EXT_TIMEOUT 2000
  53. #define WMA_TGT_SUSPEND_COMPLETE_TIMEOUT 6000
  54. #define WMA_WAKE_LOCK_TIMEOUT 1000
  55. #define WMA_RESUME_TIMEOUT 6000
  56. #define MAX_MEM_CHUNKS 32
  57. #define WMA_CRASH_INJECT_TIMEOUT 5000
  58. /* In prima 12 HW stations are supported including BCAST STA(staId 0)
  59. * and SELF STA(staId 1) so total ASSOC stations which can connect to Prima
  60. * SoftAP = 12 - 1(Self STa) - 1(Bcast Sta) = 10 Stations.
  61. */
  62. #ifdef WLAN_SOFTAP_VSTA_FEATURE
  63. #define WMA_MAX_SUPPORTED_STAS 38
  64. #else
  65. #define WMA_MAX_SUPPORTED_STAS 12
  66. #endif
  67. #define WMA_MAX_SUPPORTED_BSS 5
  68. #define FRAGMENT_SIZE 3072
  69. #define WMA_INVALID_VDEV_ID 0xFF
  70. #define MAX_MEM_CHUNKS 32
  71. #define WMA_MAX_VDEV_SIZE 20
  72. #define WMA_VDEV_TBL_ENTRY_ADD 1
  73. #define WMA_VDEV_TBL_ENTRY_DEL 0
  74. /* 11A/G channel boundary */
  75. #define WMA_11A_CHANNEL_BEGIN 34
  76. #define WMA_11A_CHANNEL_END 165
  77. #define WMA_11G_CHANNEL_BEGIN 1
  78. #define WMA_11G_CHANNEL_END 14
  79. #define WMA_11P_CHANNEL_BEGIN (170)
  80. #define WMA_11P_CHANNEL_END (184)
  81. #define WMA_LOGD(args ...) \
  82. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, ## args)
  83. #define WMA_LOGI(args ...) \
  84. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_INFO, ## args)
  85. #define WMA_LOGW(args ...) \
  86. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_WARN, ## args)
  87. #define WMA_LOGE(args ...) \
  88. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, ## args)
  89. #define WMA_LOGP(args ...) \
  90. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
  91. #define WMA_DEBUG_ALWAYS
  92. #ifdef WMA_DEBUG_ALWAYS
  93. #define WMA_LOGA(args ...) \
  94. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
  95. #else
  96. #define WMA_LOGA(args ...)
  97. #endif
  98. #define ALIGNED_WORD_SIZE 4
  99. #define WLAN_HAL_MSG_TYPE_MAX_ENUM_SIZE 0x7FFF
  100. #define WMA_WILDCARD_PDEV_ID 0x0
  101. /* Prefix used by scan req ids generated on the host */
  102. #define WMA_HOST_SCAN_REQID_PREFIX 0xA000
  103. /* Prefix used by roam scan req ids generated on the host */
  104. #define WMA_HOST_ROAM_SCAN_REQID_PREFIX 0xA800
  105. /* Prefix used by scan requestor id on host */
  106. #define WMA_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  107. #define WMA_HW_DEF_SCAN_MAX_DURATION 30000 /* 30 secs */
  108. /* Max offchannel duration */
  109. #define WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS (3)
  110. #define WMA_SCAN_NPROBES_DEFAULT (2)
  111. #define WMA_SCAN_IDLE_TIME_DEFAULT (25)
  112. #define WMA_P2P_SCAN_MAX_BURST_DURATION (180)
  113. #define WMA_CTS_DURATION_MS_MAX (32)
  114. #define WMA_GO_MIN_ACTIVE_SCAN_BURST_DURATION (40)
  115. #define WMA_GO_MAX_ACTIVE_SCAN_BURST_DURATION (120)
  116. #define WMA_DWELL_TIME_PASSIVE_DEFAULT (110)
  117. #define WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE (11)
  118. #define WMA_3PORT_CONC_SCAN_MAX_BURST_DURATION (25)
  119. #define WMA_SEC_TO_USEC (1000000)
  120. #define BEACON_TX_BUFFER_SIZE (512)
  121. /* WMA_ETHER_TYPE_OFFSET = sa(6) + da(6) */
  122. #define WMA_ETHER_TYPE_OFFSET (6 + 6)
  123. /* WMA_ICMP_V6_HEADER_OFFSET = sa(6) + da(6) + eth_type(2) + icmp_v6_hdr(6)*/
  124. #define WMA_ICMP_V6_HEADER_OFFSET (6 + 6 + 2 + 6)
  125. /* WMA_ICMP_V6_TYPE_OFFSET = sa(6) + da(6) + eth_type(2) + 40 */
  126. #define WMA_ICMP_V6_TYPE_OFFSET (6 + 6 + 2 + 40)
  127. #define WMA_ICMP_V6_HEADER_TYPE (0x3A)
  128. #define WMA_ICMP_V6_RA_TYPE (0x86)
  129. #define WMA_ICMP_V6_NS_TYPE (0x87)
  130. #define WMA_ICMP_V6_NA_TYPE (0x88)
  131. #define WMA_BCAST_MAC_ADDR (0xFF)
  132. #define WMA_MCAST_IPV4_MAC_ADDR (0x01)
  133. #define WMA_MCAST_IPV6_MAC_ADDR (0x33)
  134. /* Roaming default values
  135. * All time and period values are in milliseconds.
  136. * All rssi values are in dB except for WMA_NOISE_FLOOR_DBM_DEFAULT.
  137. */
  138. #define WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME (4)
  139. #define WMA_NOISE_FLOOR_DBM_DEFAULT (-96)
  140. #define WMA_ROAM_RSSI_DIFF_DEFAULT (5)
  141. #define WMA_ROAM_DWELL_TIME_ACTIVE_DEFAULT (100)
  142. #define WMA_ROAM_DWELL_TIME_PASSIVE_DEFAULT (110)
  143. #define WMA_ROAM_MIN_REST_TIME_DEFAULT (50)
  144. #define WMA_ROAM_MAX_REST_TIME_DEFAULT (500)
  145. #define WMA_ROAM_LOW_RSSI_TRIGGER_DEFAULT (20)
  146. #define WMA_ROAM_LOW_RSSI_TRIGGER_VERYLOW (10)
  147. #define WMA_ROAM_BEACON_WEIGHT_DEFAULT (14)
  148. #define WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT (120000)
  149. #define WMA_ROAM_OPP_SCAN_AGING_PERIOD_DEFAULT (WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT * 5)
  150. #define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT (10)
  151. #define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT (10)
  152. #define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT_P2P (15)
  153. #define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT_P2P (45)
  154. #define WMA_INVALID_KEY_IDX 0xff
  155. #define WMA_DFS_RADAR_FOUND 1
  156. #define WMA_MAX_RF_CHAINS(x) ((1 << x) - 1)
  157. #define WMA_MIN_RF_CHAINS (1)
  158. #ifdef FEATURE_WLAN_EXTSCAN
  159. #define WMA_MAX_EXTSCAN_MSG_SIZE 1536
  160. #define WMA_EXTSCAN_REST_TIME 100
  161. #define WMA_EXTSCAN_MAX_SCAN_TIME 50000
  162. #define WMA_EXTSCAN_BURST_DURATION 150
  163. #endif
  164. #define WMA_BCN_BUF_MAX_SIZE 2500
  165. #define WMA_NOA_IE_SIZE(num_desc) (2 + (13 * (num_desc)))
  166. #define WMA_MAX_NOA_DESCRIPTORS 4
  167. #define WMA_TIM_SUPPORTED_PVB_LENGTH ((HAL_NUM_STA / 8) + 1)
  168. #define WMA_WOW_PTRN_MASK_VALID 0xFF
  169. #define WMA_NUM_BITS_IN_BYTE 8
  170. #define WMA_AP_WOW_DEFAULT_PTRN_MAX 4
  171. #define WMA_STA_WOW_DEFAULT_PTRN_MAX 4
  172. #define WMA_BSS_STATUS_STARTED 0x1
  173. #define WMA_BSS_STATUS_STOPPED 0x2
  174. #define WMA_TARGET_REQ_TYPE_VDEV_START 0x1
  175. #define WMA_TARGET_REQ_TYPE_VDEV_STOP 0x2
  176. #define WMA_TARGET_REQ_TYPE_VDEV_DEL 0x3
  177. #define WMA_PEER_ASSOC_CNF_START 0x01
  178. #define WMA_PEER_ASSOC_TIMEOUT (3000) /* 3 seconds */
  179. #define WMA_DELETE_STA_RSP_START 0x02
  180. #define WMA_DELETE_STA_TIMEOUT (6000) /* 6 seconds */
  181. #define WMA_DEL_P2P_SELF_STA_RSP_START 0x03
  182. #define WMA_VDEV_START_REQUEST_TIMEOUT (3000) /* 3 seconds */
  183. #define WMA_VDEV_STOP_REQUEST_TIMEOUT (3000) /* 3 seconds */
  184. #define WMA_TGT_INVALID_SNR (-1)
  185. #define WMA_TX_Q_RECHECK_TIMER_WAIT 2 /* 2 ms */
  186. #define WMA_TX_Q_RECHECK_TIMER_MAX_WAIT 20 /* 20 ms */
  187. #define WMA_MAX_NUM_ARGS 8
  188. #define WMA_SMPS_MASK_LOWER_16BITS 0xFF
  189. #define WMA_SMPS_MASK_UPPER_3BITS 0x7
  190. #define WMA_SMPS_PARAM_VALUE_S 29
  191. #define WMA_MAX_SCAN_ID 0x00FF
  192. /*
  193. * Setting the Tx Comp Timeout to 1 secs.
  194. * TODO: Need to Revist the Timing
  195. */
  196. #define WMA_TX_FRAME_COMPLETE_TIMEOUT 1000
  197. #define WMA_TX_FRAME_BUFFER_NO_FREE 0
  198. #define WMA_TX_FRAME_BUFFER_FREE 1
  199. /* Default InActivity Time is 200 ms */
  200. #define POWERSAVE_DEFAULT_INACTIVITY_TIME 200
  201. /* Default Listen Interval */
  202. #define POWERSAVE_DEFAULT_LISTEN_INTERVAL 1
  203. /*
  204. * TODO: Add WMI_CMD_ID_MAX as part of WMI_CMD_ID
  205. * instead of assigning it to the last valid wmi
  206. * cmd+1 to avoid updating this when a command is
  207. * added/deleted.
  208. */
  209. #define WMI_CMDID_MAX (WMI_TXBF_CMDID + 1)
  210. #define WMA_NLO_FREQ_THRESH 1000 /* in MHz */
  211. #define WMA_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
  212. #define WMA_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
  213. /* Default rssi threshold defined in CFG80211 */
  214. #define WMA_RSSI_THOLD_DEFAULT -300
  215. #ifdef FEATURE_WLAN_SCAN_PNO
  216. #define WMA_PNO_MATCH_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
  217. #define WMA_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT (2 * 1000) /* in msec */
  218. #endif
  219. #define WMA_AUTH_REQ_RECV_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
  220. #define WMA_ASSOC_REQ_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
  221. #define WMA_DEAUTH_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
  222. #define WMA_DISASSOC_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
  223. #ifdef FEATURE_WLAN_AUTO_SHUTDOWN
  224. #define WMA_AUTO_SHUTDOWN_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
  225. #endif
  226. #define WMA_BMISS_EVENT_WAKE_LOCK_DURATION (4 * 1000) /* in msec */
  227. #define WMA_FW_RSP_EVENT_WAKE_LOCK_DURATION (3 * 1000) /* in msec */
  228. #define WMA_TXMIC_LEN 8
  229. #define WMA_RXMIC_LEN 8
  230. /*
  231. * Length = (2 octets for Index and CTWin/Opp PS) and
  232. * (13 octets for each NOA Descriptors)
  233. */
  234. #define WMA_P2P_NOA_IE_OPP_PS_SET (0x80)
  235. #define WMA_P2P_NOA_IE_CTWIN_MASK (0x7F)
  236. #define WMA_P2P_IE_ID 0xdd
  237. #define WMA_P2P_WFA_OUI { 0x50, 0x6f, 0x9a }
  238. #define WMA_P2P_WFA_VER 0x09 /* ver 1.0 */
  239. #define WMA_WSC_OUI { 0x00, 0x50, 0xF2 } /* Microsoft WSC OUI byte */
  240. /* P2P Sub element defintions (according to table 5 of Wifi's P2P spec) */
  241. #define WMA_P2P_SUB_ELEMENT_STATUS 0
  242. #define WMA_P2P_SUB_ELEMENT_MINOR_REASON 1
  243. #define WMA_P2P_SUB_ELEMENT_CAPABILITY 2
  244. #define WMA_P2P_SUB_ELEMENT_DEVICE_ID 3
  245. #define WMA_P2P_SUB_ELEMENT_GO_INTENT 4
  246. #define WMA_P2P_SUB_ELEMENT_CONFIGURATION_TIMEOUT 5
  247. #define WMA_P2P_SUB_ELEMENT_LISTEN_CHANNEL 6
  248. #define WMA_P2P_SUB_ELEMENT_GROUP_BSSID 7
  249. #define WMA_P2P_SUB_ELEMENT_EXTENDED_LISTEN_TIMING 8
  250. #define WMA_P2P_SUB_ELEMENT_INTENDED_INTERFACE_ADDR 9
  251. #define WMA_P2P_SUB_ELEMENT_MANAGEABILITY 10
  252. #define WMA_P2P_SUB_ELEMENT_CHANNEL_LIST 11
  253. #define WMA_P2P_SUB_ELEMENT_NOA 12
  254. #define WMA_P2P_SUB_ELEMENT_DEVICE_INFO 13
  255. #define WMA_P2P_SUB_ELEMENT_GROUP_INFO 14
  256. #define WMA_P2P_SUB_ELEMENT_GROUP_ID 15
  257. #define WMA_P2P_SUB_ELEMENT_INTERFACE 16
  258. #define WMA_P2P_SUB_ELEMENT_OP_CHANNEL 17
  259. #define WMA_P2P_SUB_ELEMENT_INVITATION_FLAGS 18
  260. #define WMA_P2P_SUB_ELEMENT_VENDOR 221
  261. /* Macros for handling unaligned memory accesses */
  262. #define P2PIE_PUT_LE16(a, val) \
  263. do { \
  264. (a)[1] = ((u16) (val)) >> 8; \
  265. (a)[0] = ((u16) (val)) & 0xff; \
  266. } while (0)
  267. #define P2PIE_PUT_LE32(a, val) \
  268. do { \
  269. (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
  270. (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
  271. (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
  272. (a)[0] = (u8) (((u32) (val)) & 0xff); \
  273. } while (0)
  274. #define WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE 1
  275. #define WMA_DEFAULT_QPOWER_MAX_PSPOLL_BEFORE_WAKE 1
  276. #define WMA_DEFAULT_QPOWER_TX_WAKE_THRESHOLD 2
  277. #define WMA_DEFAULT_SIFS_BURST_DURATION 8160
  278. #define WMA_VHT_PPS_PAID_MATCH 1
  279. #define WMA_VHT_PPS_GID_MATCH 2
  280. #define WMA_VHT_PPS_DELIM_CRC_FAIL 3
  281. #define WMA_DFS_MAX_20M_SUB_CH 8
  282. #define WMA_80MHZ_START_CENTER_CH_DIFF 6
  283. #define WMA_160MHZ_START_CENTER_CH_DIFF 14
  284. #define WMA_NEXT_20MHZ_START_CH_DIFF 4
  285. #define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF
  286. /**
  287. * struct probeTime_dwellTime - probe time, dwell time map
  288. * @dwell_time: dwell time
  289. * @probe_time: repeat probe time
  290. */
  291. typedef struct probeTime_dwellTime {
  292. uint8_t dwell_time;
  293. uint8_t probe_time;
  294. } t_probeTime_dwellTime;
  295. static const t_probeTime_dwellTime
  296. probe_time_dwell_time_map[WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE] = {
  297. {28, 0}, /* 0 SSID */
  298. {28, 20}, /* 1 SSID */
  299. {28, 20}, /* 2 SSID */
  300. {28, 20}, /* 3 SSID */
  301. {28, 20}, /* 4 SSID */
  302. {28, 20}, /* 5 SSID */
  303. {28, 20}, /* 6 SSID */
  304. {28, 11}, /* 7 SSID */
  305. {28, 11}, /* 8 SSID */
  306. {28, 11}, /* 9 SSID */
  307. {28, 8} /* 10 SSID */
  308. };
  309. typedef void (*txFailIndCallback)(uint8_t *peer_mac, uint8_t seqNo);
  310. /**
  311. * enum t_wma_drv_type - wma driver type
  312. * @WMA_DRIVER_TYPE_PRODUCTION: production driver type
  313. * @WMA_DRIVER_TYPE_MFG: manufacture driver type
  314. * @WMA_DRIVER_TYPE_INVALID: invalid driver type
  315. */
  316. typedef enum {
  317. WMA_DRIVER_TYPE_PRODUCTION = 0,
  318. WMA_DRIVER_TYPE_MFG = 1,
  319. WMA_DRIVER_TYPE_INVALID = 0x7FFFFFFF
  320. } t_wma_drv_type;
  321. #ifdef FEATURE_WLAN_TDLS
  322. /**
  323. * enum t_wma_tdls_mode - TDLS mode
  324. * @WMA_TDLS_SUPPORT_NOT_ENABLED: tdls is disable
  325. * @WMA_TDLS_SUPPORT_DISABLED: suppress implicit trigger and not respond to peer
  326. * @WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger,
  327. * but respond to the peer
  328. * @WMA_TDLS_SUPPORT_ENABLED: implicit trigger
  329. * @WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL: External control means
  330. * implicit trigger but only to a peer mac configured by user space.
  331. */
  332. typedef enum {
  333. WMA_TDLS_SUPPORT_NOT_ENABLED = 0,
  334. WMA_TDLS_SUPPORT_DISABLED,
  335. WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY,
  336. WMA_TDLS_SUPPORT_ENABLED,
  337. WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL,
  338. } t_wma_tdls_mode;
  339. /**
  340. * enum wma_tdls_peer_notification - TDLS events
  341. * @WMA_TDLS_SHOULD_DISCOVER: tdls discovery recommended for peer (always based
  342. * on tx bytes per second > tx_discover threshold
  343. * NB: notification will be re-sent after
  344. * discovery_request_interval_ms
  345. * @WMA_TDLS_SHOULD_TEARDOWN: tdls link tear down recommended for peer
  346. * due to tx bytes per second below
  347. * tx_teardown_threshold
  348. * NB: this notification sent once
  349. * @WMA_TDLS_PEER_DISCONNECTED: tx peer TDLS link tear down complete
  350. */
  351. enum wma_tdls_peer_notification {
  352. WMA_TDLS_SHOULD_DISCOVER,
  353. WMA_TDLS_SHOULD_TEARDOWN,
  354. WMA_TDLS_PEER_DISCONNECTED,
  355. };
  356. /**
  357. * enum wma_tdls_peer_reason - TDLS peer reason
  358. * @WMA_TDLS_TEARDOWN_REASON_TX: tdls teardown recommended due to low transmits
  359. * @WMA_TDLS_TEARDOWN_REASON_RATE: tdls tear down recommended due to
  360. * packet rates < AP rates
  361. * @WMA_TDLS_TEARDOWN_REASON_RSSI: tdls link tear down recommended
  362. * due to poor RSSI
  363. * @WMA_TDLS_TEARDOWN_REASON_SCAN: tdls link tear down recommended
  364. * due to offchannel scan
  365. * @WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE: tdls peer disconnected
  366. * due to peer deletion
  367. */
  368. enum wma_tdls_peer_reason {
  369. WMA_TDLS_TEARDOWN_REASON_TX,
  370. WMA_TDLS_TEARDOWN_REASON_RATE,
  371. WMA_TDLS_TEARDOWN_REASON_RSSI,
  372. WMA_TDLS_TEARDOWN_REASON_SCAN,
  373. WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE,
  374. };
  375. #endif /* FEATURE_WLAN_TDLS */
  376. /**
  377. * enum wma_rx_exec_ctx - wma rx execution context
  378. * @WMA_RX_WORK_CTX: work queue context execution
  379. * @WMA_RX_TASKLET_CTX: tasklet context execution
  380. * @WMA_RX_SERIALIZER_CTX: MC thread context execution
  381. *
  382. */
  383. enum wma_rx_exec_ctx {
  384. WMA_RX_WORK_CTX,
  385. WMA_RX_TASKLET_CTX,
  386. WMA_RX_SERIALIZER_CTX
  387. };
  388. /**
  389. * struct wma_mem_chunk - memory chunks
  390. * @vaddr: virtual address
  391. * @paddr: physical address
  392. * @memctx: dma mapped memory
  393. * @len: length of data
  394. * @req_id: request id
  395. *
  396. * memory chunck allocated by Host to be managed by FW
  397. * used only for low latency interfaces like pcie
  398. */
  399. struct wma_mem_chunk {
  400. uint32_t *vaddr;
  401. uint32_t paddr;
  402. qdf_dma_mem_context(memctx);
  403. uint32_t len;
  404. uint32_t req_id;
  405. };
  406. /**
  407. * struct p2p_scan_param - p2p scan listen parameters
  408. * @scan_id: scan id
  409. * @p2p_scan_type: p2p scan type
  410. */
  411. struct p2p_scan_param {
  412. uint32_t scan_id;
  413. tSirP2pScanType p2p_scan_type;
  414. };
  415. /**
  416. * struct scan_param - scan parameters
  417. * @scan_id: scan id
  418. * @scan_requestor_id: scan requestor id
  419. * @p2p_scan_type: p2p scan type
  420. */
  421. struct scan_param {
  422. uint32_t scan_id;
  423. uint32_t scan_requestor_id;
  424. tSirP2pScanType p2p_scan_type;
  425. uint32_t chan_freq;
  426. };
  427. /**
  428. * struct beacon_info - structure to store beacon template
  429. * @buf: skb ptr
  430. * @len: length
  431. * @dma_mapped: is it dma mapped or not
  432. * @tim_ie_offset: TIM IE offset
  433. * @dtim_count: DTIM count
  434. * @seq_no: sequence no
  435. * @noa_sub_ie: NOA sub IE
  436. * @noa_sub_ie_len: NOA sub IE length
  437. * @noa_ie: NOA IE
  438. * @p2p_ie_offset: p2p IE offset
  439. * @lock: lock
  440. */
  441. struct beacon_info {
  442. qdf_nbuf_t buf;
  443. uint32_t len;
  444. uint8_t dma_mapped;
  445. uint32_t tim_ie_offset;
  446. uint8_t dtim_count;
  447. uint16_t seq_no;
  448. uint8_t noa_sub_ie[2 + WMA_NOA_IE_SIZE(WMA_MAX_NOA_DESCRIPTORS)];
  449. uint16_t noa_sub_ie_len;
  450. uint8_t *noa_ie;
  451. uint16_t p2p_ie_offset;
  452. qdf_spinlock_t lock;
  453. };
  454. /**
  455. * struct beacon_tim_ie - structure to store TIM IE of beacon
  456. * @tim_ie: tim ie
  457. * @tim_len: tim ie length
  458. * @dtim_count: dtim count
  459. * @dtim_period: dtim period
  460. * @tim_bitctl: tim bit control
  461. * @tim_bitmap: tim bitmap
  462. */
  463. struct beacon_tim_ie {
  464. uint8_t tim_ie;
  465. uint8_t tim_len;
  466. uint8_t dtim_count;
  467. uint8_t dtim_period;
  468. uint8_t tim_bitctl;
  469. uint8_t tim_bitmap[1];
  470. } __ATTRIB_PACK;
  471. /**
  472. * struct pps - packet power save parameter
  473. * @paid_match_enable: paid match enable
  474. * @gid_match_enable: gid match enable
  475. * @tim_clear: time clear
  476. * @dtim_clear: dtim clear
  477. * @eof_delim: eof delim
  478. * @mac_match: mac match
  479. * @delim_fail: delim fail
  480. * @nsts_zero: nsts zero
  481. * @rssi_chk: RSSI check
  482. * @ebt_5g: ebt 5GHz
  483. */
  484. struct pps {
  485. bool paid_match_enable;
  486. bool gid_match_enable;
  487. bool tim_clear;
  488. bool dtim_clear;
  489. bool eof_delim;
  490. bool mac_match;
  491. bool delim_fail;
  492. bool nsts_zero;
  493. bool rssi_chk;
  494. bool ebt_5g;
  495. };
  496. /**
  497. * struct qpower_params - qpower related parameters
  498. * @max_ps_poll_cnt: max ps poll count
  499. * @max_tx_before_wake: max tx before wake
  500. * @spec_ps_poll_wake_interval: ps poll wake interval
  501. * @max_spec_nodata_ps_poll: no data ps poll
  502. */
  503. struct qpower_params {
  504. uint32_t max_ps_poll_cnt;
  505. uint32_t max_tx_before_wake;
  506. uint32_t spec_ps_poll_wake_interval;
  507. uint32_t max_spec_nodata_ps_poll;
  508. };
  509. /**
  510. * struct gtx_config_t - GTX config
  511. * @gtxRTMask: for HT and VHT rate masks
  512. * @gtxUsrcfg: host request for GTX mask
  513. * @gtxPERThreshold: PER Threshold (default: 10%)
  514. * @gtxPERMargin: PER margin (default: 2%)
  515. * @gtxTPCstep: TCP step (default: 1)
  516. * @gtxTPCMin: TCP min (default: 5)
  517. * @gtxBWMask: BW mask (20/40/80/160 Mhz)
  518. */
  519. typedef struct {
  520. uint32_t gtxRTMask[2];
  521. uint32_t gtxUsrcfg;
  522. uint32_t gtxPERThreshold;
  523. uint32_t gtxPERMargin;
  524. uint32_t gtxTPCstep;
  525. uint32_t gtxTPCMin;
  526. uint32_t gtxBWMask;
  527. } gtx_config_t;
  528. /**
  529. * struct pdev_cli_config_t - store pdev parameters
  530. * @ani_enable: ANI is enabled/disable on target
  531. * @ani_poll_len: store ANI polling period
  532. * @ani_listen_len: store ANI listening period
  533. * @ani_ofdm_level: store ANI OFDM immunity level
  534. * @ani_cck_level: store ANI CCK immunity level
  535. * @cwmenable: Dynamic bw is enable/disable in fw
  536. * @txchainmask: tx chain mask
  537. * @rxchainmask: rx chain mask
  538. * @txpow2g: tx power limit for 2GHz
  539. * @txpow5g: tx power limit for 5GHz
  540. * @burst_enable: is burst enable/disable
  541. * @burst_dur: burst duration
  542. *
  543. * This structure stores pdev parameters.
  544. * Some of these parameters are set in fw and some
  545. * parameters are only maintained in host.
  546. */
  547. typedef struct {
  548. uint32_t ani_enable;
  549. uint32_t ani_poll_len;
  550. uint32_t ani_listen_len;
  551. uint32_t ani_ofdm_level;
  552. uint32_t ani_cck_level;
  553. uint32_t cwmenable;
  554. uint32_t cts_cbw;
  555. uint32_t txchainmask;
  556. uint32_t rxchainmask;
  557. uint32_t txpow2g;
  558. uint32_t txpow5g;
  559. uint32_t burst_enable;
  560. uint32_t burst_dur;
  561. } pdev_cli_config_t;
  562. /**
  563. * struct vdev_cli_config_t - store vdev parameters
  564. * @nss: nss width
  565. * @ldpc: is ldpc is enable/disable
  566. * @tx_stbc: TX STBC is enable/disable
  567. * @rx_stbc: RX STBC is enable/disable
  568. * @shortgi: short gi is enable/disable
  569. * @rtscts_en: RTS/CTS is enable/disable
  570. * @chwidth: channel width
  571. * @tx_rate: tx rate
  572. * @ampdu: ampdu size
  573. * @amsdu: amsdu size
  574. * @erx_adjust: enable/disable early rx enable
  575. * @erx_bmiss_num: target bmiss number per sample
  576. * @erx_bmiss_cycle: sample cycle
  577. * @erx_slop_step: slop_step value
  578. * @erx_init_slop: init slop
  579. * @erx_adj_pause: pause adjust enable/disable
  580. * @erx_dri_sample: enable/disable drift sample
  581. * @pps_params: packet power save parameters
  582. * @qpower_params: qpower parameters
  583. * @gtx_info: GTX offload info
  584. *
  585. * This structure stores vdev parameters.
  586. * Some of these parameters are set in fw and some
  587. * parameters are only maintained in host.
  588. */
  589. typedef struct {
  590. uint32_t nss;
  591. uint32_t ldpc;
  592. uint32_t tx_stbc;
  593. uint32_t rx_stbc;
  594. uint32_t shortgi;
  595. uint32_t rtscts_en;
  596. uint32_t chwidth;
  597. uint32_t tx_rate;
  598. uint32_t ampdu;
  599. uint32_t amsdu;
  600. uint32_t erx_adjust;
  601. uint32_t erx_bmiss_num;
  602. uint32_t erx_bmiss_cycle;
  603. uint32_t erx_slop_step;
  604. uint32_t erx_init_slop;
  605. uint32_t erx_adj_pause;
  606. uint32_t erx_dri_sample;
  607. struct pps pps_params;
  608. struct qpower_params qpower_params;
  609. gtx_config_t gtx_info;
  610. } vdev_cli_config_t;
  611. /**
  612. * struct wma_wow - store wow patterns
  613. * @magic_ptrn_enable: magic pattern enable/disable
  614. * @wow_enable: wow enable/disable
  615. * @wow_enable_cmd_sent: is wow enable command sent to fw
  616. * @deauth_enable: is deauth wakeup enable/disable
  617. * @disassoc_enable: is disassoc wakeup enable/disable
  618. * @bmiss_enable: is bmiss wakeup enable/disable
  619. * @gtk_pdev_enable: is GTK based wakeup enable/disable
  620. * @gtk_err_enable: is GTK error wakeup enable/disable
  621. * @lphb_cache: lphb cache
  622. *
  623. * This structure stores wow patterns and
  624. * wow related parameters in host.
  625. */
  626. struct wma_wow {
  627. bool magic_ptrn_enable;
  628. bool wow_enable;
  629. bool wow_enable_cmd_sent;
  630. bool deauth_enable;
  631. bool disassoc_enable;
  632. bool bmiss_enable;
  633. bool gtk_err_enable[WMA_MAX_SUPPORTED_BSS];
  634. #ifdef FEATURE_WLAN_LPHB
  635. /* currently supports only vdev 0.
  636. * cache has two entries: one for TCP and one for UDP.
  637. */
  638. tSirLPHBReq lphb_cache[2];
  639. #endif
  640. };
  641. #ifdef WLAN_FEATURE_11W
  642. #define CMAC_IPN_LEN (6)
  643. #define WMA_IGTK_KEY_INDEX_4 (4)
  644. #define WMA_IGTK_KEY_INDEX_5 (5)
  645. /**
  646. * struct wma_igtk_ipn_t - GTK IPN info
  647. * @ipn: IPN info
  648. */
  649. typedef struct {
  650. uint8_t ipn[CMAC_IPN_LEN];
  651. } wma_igtk_ipn_t;
  652. /**
  653. * struct wma_igtk_key_t - GTK key
  654. * @key_length: key length
  655. * @key: key
  656. * @key_id: key id
  657. */
  658. typedef struct {
  659. uint16_t key_length;
  660. uint8_t key[CSR_AES_KEY_LEN];
  661. /* IPN is maintained per iGTK keyID
  662. * 0th index for iGTK keyID = 4;
  663. * 1st index for iGTK KeyID = 5
  664. */
  665. wma_igtk_ipn_t key_id[2];
  666. } wma_igtk_key_t;
  667. #endif
  668. /**
  669. * struct vdev_restart_params_t - vdev restart parameters
  670. * @vdev_id: vdev id
  671. * @ssid: ssid
  672. * @flags: flags
  673. * @requestor_id: requestor id
  674. * @chan: channel
  675. * @hidden_ssid_restart_in_progress: hidden ssid restart flag
  676. * @ssidHidden: is ssid hidden or not
  677. */
  678. typedef struct {
  679. A_UINT32 vdev_id;
  680. wmi_ssid ssid;
  681. A_UINT32 flags;
  682. A_UINT32 requestor_id;
  683. A_UINT32 disable_hw_ack;
  684. wmi_channel chan;
  685. qdf_atomic_t hidden_ssid_restart_in_progress;
  686. uint8_t ssidHidden;
  687. } vdev_restart_params_t;
  688. /**
  689. * struct wma_txrx_node - txrx node
  690. * @addr: mac address
  691. * @bssid: bssid
  692. * @handle: wma handle
  693. * @beacon: beacon info
  694. * @vdev_restart_params: vdev restart parameters
  695. * @config: per vdev config parameters
  696. * @scan_info: scan info
  697. * @type: type
  698. * @sub_type: sub type
  699. * @nlo_match_evt_received: is nlo match event received or not
  700. * @pno_in_progress: is pno in progress or not
  701. * @plm_in_progress: is plm in progress or not
  702. * @ptrn_match_enable: is pattern match is enable or not
  703. * @num_wow_default_patterns: number of default wow patterns configured for vdev
  704. * @num_wow_user_patterns: number of user wow patterns configured for vdev
  705. * @conn_state: connection state
  706. * @beaconInterval: beacon interval
  707. * @llbCoexist: 11b coexist
  708. * @shortSlotTimeSupported: is short slot time supported or not
  709. * @dtimPeriod: DTIM period
  710. * @chanmode: channel mode
  711. * @vht_capable: VHT capablity flag
  712. * @ht_capable: HT capablity flag
  713. * @mhz: channel frequency in KHz
  714. * @vdev_up: is vdev up or not
  715. * @tsfadjust: TSF adjust
  716. * @addBssStaContext: add bss context
  717. * @aid: association id
  718. * @rmfEnabled: Robust Management Frame (RMF) enabled/disabled
  719. * @key: GTK key
  720. * @uapsd_cached_val: uapsd cached value
  721. * @stats_rsp: stats response
  722. * @fw_stats_set: fw stats value
  723. * @del_staself_req: delete sta self request
  724. * @bss_status: bss status
  725. * @rate_flags: rate flags
  726. * @nss: nss value
  727. * @is_channel_switch: is channel switch
  728. * @pause_bitmap: pause bitmap
  729. * @tx_power: tx power in dbm
  730. * @max_tx_power: max tx power in dbm
  731. * @nwType: network type (802.11a/b/g/n/ac)
  732. * @staKeyParams: sta key parameters
  733. * @ps_enabled: is powersave enable/disable
  734. * @dtim_policy: DTIM policy
  735. * @peer_count: peer count
  736. * @roam_synch_in_progress: flag is in progress or not
  737. * @plink_status_req: link status request
  738. * @psnr_req: snr request
  739. * @delay_before_vdev_stop: delay
  740. * @tx_streams: number of tx streams can be used by the vdev
  741. * @rx_streams: number of rx streams can be used by the vdev
  742. * @chain_mask: chain mask can be used by the vdev
  743. * @mac_id: the mac on which vdev is on
  744. *
  745. * It stores parameters per vdev in wma.
  746. */
  747. struct wma_txrx_node {
  748. uint8_t addr[IEEE80211_ADDR_LEN];
  749. uint8_t bssid[IEEE80211_ADDR_LEN];
  750. void *handle;
  751. struct beacon_info *beacon;
  752. vdev_restart_params_t vdev_restart_params;
  753. vdev_cli_config_t config;
  754. struct scan_param scan_info;
  755. struct p2p_scan_param p2p_scan_info;
  756. uint32_t type;
  757. uint32_t sub_type;
  758. #ifdef FEATURE_WLAN_SCAN_PNO
  759. bool nlo_match_evt_received;
  760. bool pno_in_progress;
  761. #endif
  762. #ifdef FEATURE_WLAN_ESE
  763. bool plm_in_progress;
  764. #endif
  765. bool ptrn_match_enable;
  766. uint8_t num_wow_default_patterns;
  767. uint8_t num_wow_user_patterns;
  768. bool conn_state;
  769. tSirMacBeaconInterval beaconInterval;
  770. uint8_t llbCoexist;
  771. uint8_t shortSlotTimeSupported;
  772. uint8_t dtimPeriod;
  773. WLAN_PHY_MODE chanmode;
  774. uint8_t vht_capable;
  775. uint8_t ht_capable;
  776. A_UINT32 mhz;
  777. bool vdev_up;
  778. uint64_t tsfadjust;
  779. void *addBssStaContext;
  780. uint8_t aid;
  781. uint8_t rmfEnabled;
  782. #ifdef WLAN_FEATURE_11W
  783. wma_igtk_key_t key;
  784. #endif /* WLAN_FEATURE_11W */
  785. uint32_t uapsd_cached_val;
  786. tAniGetPEStatsRsp *stats_rsp;
  787. uint8_t fw_stats_set;
  788. void *del_staself_req;
  789. qdf_atomic_t bss_status;
  790. uint8_t rate_flags;
  791. uint8_t nss;
  792. bool is_channel_switch;
  793. uint16_t pause_bitmap;
  794. int8_t tx_power;
  795. int8_t max_tx_power;
  796. uint32_t nwType;
  797. void *staKeyParams;
  798. bool ps_enabled;
  799. uint32_t dtim_policy;
  800. uint32_t peer_count;
  801. bool roam_synch_in_progress;
  802. void *plink_status_req;
  803. void *psnr_req;
  804. uint8_t delay_before_vdev_stop;
  805. #ifdef FEATURE_WLAN_EXTSCAN
  806. bool extscan_in_progress;
  807. #endif
  808. uint32_t alt_modulated_dtim;
  809. bool alt_modulated_dtim_enabled;
  810. uint32_t tx_streams;
  811. uint32_t rx_streams;
  812. uint32_t chain_mask;
  813. uint32_t mac_id;
  814. bool roaming_in_progress;
  815. };
  816. #if defined(QCA_WIFI_FTM)
  817. #define MAX_UTF_EVENT_LENGTH 2048
  818. #define MAX_WMI_UTF_LEN 252
  819. /**
  820. * struct SEG_HDR_INFO_STRUCT - header info
  821. * @len: length
  822. * @msgref: message refrence
  823. * @segmentInfo: segment info
  824. * @pad: padding
  825. */
  826. typedef struct {
  827. A_UINT32 len;
  828. A_UINT32 msgref;
  829. A_UINT32 segmentInfo;
  830. A_UINT32 pad;
  831. } SEG_HDR_INFO_STRUCT;
  832. /**
  833. * struct utf_event_info - UTF event info
  834. * @data: data ptr
  835. * @length: length
  836. * @offset: offset
  837. * @currentSeq: curent squence
  838. * @expectedSeq: expected sequence
  839. */
  840. struct utf_event_info {
  841. uint8_t *data;
  842. uint32_t length;
  843. qdf_size_t offset;
  844. uint8_t currentSeq;
  845. uint8_t expectedSeq;
  846. };
  847. #endif
  848. /**
  849. * struct scan_timer_info - scan timer info
  850. * @vdev_id: vdev id
  851. * @scan_id: scan id
  852. */
  853. typedef struct {
  854. uint8_t vdev_id;
  855. uint32_t scan_id;
  856. } scan_timer_info;
  857. /**
  858. * struct ibss_power_save_params - IBSS power save parameters
  859. * @atimWindowLength: ATIM window length
  860. * @isPowerSaveAllowed: is power save allowed
  861. * @isPowerCollapseAllowed: is power collapsed allowed
  862. * @isAwakeonTxRxEnabled: is awake on tx/rx enabled
  863. * @inactivityCount: inactivity count
  864. * @txSPEndInactivityTime: tx SP end inactivity time
  865. * @ibssPsWarmupTime: IBSS power save warm up time
  866. * @ibssPs1RxChainInAtimEnable: IBSS power save rx chain in ATIM enable
  867. */
  868. typedef struct {
  869. uint32_t atimWindowLength;
  870. uint32_t isPowerSaveAllowed;
  871. uint32_t isPowerCollapseAllowed;
  872. uint32_t isAwakeonTxRxEnabled;
  873. uint32_t inactivityCount;
  874. uint32_t txSPEndInactivityTime;
  875. uint32_t ibssPsWarmupTime;
  876. uint32_t ibssPs1RxChainInAtimEnable;
  877. } ibss_power_save_params;
  878. /**
  879. * struct dbs_hw_mode_info - WLAN_DBS_HW_MODES_TLV Format
  880. * @tlv_header: TLV header, TLV tag and len; tag equals WMITLV_TAG_ARRAY_UINT32
  881. * @hw_mode_list: WLAN_DBS_HW_MODE_LIST entries
  882. */
  883. struct dbs_hw_mode_info {
  884. uint32_t tlv_header;
  885. uint32_t *hw_mode_list;
  886. };
  887. /* Current HTC credit is 2, pool size of 50 is sufficient */
  888. #define WMI_DESC_POOL_MAX 50
  889. /**
  890. * struct wmi_desc_t - wmi management Tx descriptor.
  891. * @tx_cmpl_cb_func: completion callback function, when DL completion and
  892. * OTA done.
  893. * @ota_post_proc_func: Post process callback function registered.
  894. * @nbuf: Network buffer to be freed.
  895. * @desc_id: WMI descriptor.
  896. */
  897. struct wmi_desc_t {
  898. pWMATxRxCompFunc tx_cmpl_cb;
  899. pWMAAckFnTxComp ota_post_proc_cb;
  900. qdf_nbuf_t nbuf;
  901. uint32_t desc_id;
  902. };
  903. /**
  904. * union wmi_desc_elem_t - linked list wmi desc pool.
  905. * @next: Pointer next descritor in the pool.
  906. * @wmi_desc: wmi descriptor element.
  907. */
  908. union wmi_desc_elem_t {
  909. union wmi_desc_elem_t *next;
  910. struct wmi_desc_t wmi_desc;
  911. };
  912. /**
  913. * struct dual_mac_config - Dual MAC configurations
  914. * @prev_scan_config: Previous scan configuration
  915. * @prev_fw_mode_config: Previous FW mode configuration
  916. * @cur_scan_config: Current scan configuration
  917. * @cur_fw_mode_config: Current FW mode configuration
  918. * @req_scan_config: Requested scan configuration
  919. * @req_fw_mode_config: Requested FW mode configuration
  920. */
  921. struct dual_mac_config {
  922. uint32_t prev_scan_config;
  923. uint32_t prev_fw_mode_config;
  924. uint32_t cur_scan_config;
  925. uint32_t cur_fw_mode_config;
  926. uint32_t req_scan_config;
  927. uint32_t req_fw_mode_config;
  928. };
  929. /**
  930. * struct wma_ini_config - Structure to hold wma ini configuration
  931. * @max_no_of_peers: Max Number of supported
  932. *
  933. * Placeholder for WMA ini parameters.
  934. */
  935. struct wma_ini_config {
  936. uint8_t max_no_of_peers;
  937. };
  938. /**
  939. * struct t_wma_handle - wma context
  940. * @wmi_handle: wmi handle
  941. * @htc_handle: htc handle
  942. * @cds_context: cds handle
  943. * @mac_context: mac context
  944. * @wma_ready_event: wma rx ready event
  945. * @wma_resume_event: wma resume event
  946. * @target_suspend: target suspend event
  947. * @recovery_event: wma FW recovery event
  948. * @max_station: max stations
  949. * @max_bssid: max bssid
  950. * @frame_xln_reqd: frame transmission required
  951. * @driver_type: driver type
  952. * @myaddr: current mac address
  953. * @hwaddr: mac address from EEPROM
  954. * @target_abi_vers: target firmware version
  955. * @final_abi_vers: The final ABI version to be used for communicating
  956. * @target_fw_version: Target f/w build version
  957. * @lpss_support: LPSS feature is supported in target or not
  958. * @egap_support: Enhanced Green AP support flag
  959. * @wmi_ready: wmi status flag
  960. * @wlan_init_status: wlan init status
  961. * @qdf_dev: qdf device
  962. * @phy_capability: PHY Capability from Target
  963. * @max_frag_entry: Max number of Fragment entry
  964. * @wmi_service_bitmap: wmi services bitmap received from Target
  965. * @wlan_resource_config: resource config
  966. * @frameTransRequired: frame transmission required
  967. * @wmaGlobalSystemRole: global system role
  968. * @tx_frm_download_comp_cb: Tx Frame Compl Cb registered by umac
  969. * @tx_frm_download_comp_event: Event to wait for tx download completion
  970. * @tx_queue_empty_event: wait for tx queue to get flushed
  971. * @umac_ota_ack_cb: Ack Complete Callback registered by umac
  972. * @umac_data_ota_ack_cb: ack complete callback
  973. * @last_umac_data_ota_timestamp: timestamp when OTA of last umac data was done
  974. * @last_umac_data_nbuf: cache nbuf ptr for the last umac data buf
  975. * @needShutdown: is shutdown needed or not
  976. * @num_mem_chunks: number of memory chunk
  977. * @mem_chunks: memory chunks
  978. * @tgt_cfg_update_cb: configuration update callback
  979. * @dfs_radar_indication_cb: Callback to indicate radar to HDD
  980. * @reg_cap: regulatory capablities
  981. * @scan_id: scan id
  982. * @interfaces: txrx nodes(per vdev)
  983. * @pdevconfig: pdev related configrations
  984. * @vdev_resp_queue: vdev response queue
  985. * @vdev_respq_lock: vdev response queue lock
  986. * @ht_cap_info: HT capablity info
  987. * @vht_cap_info: VHT capablity info
  988. * @vht_supp_mcs: VHT supported MCS
  989. * @num_rf_chains: number of RF chains
  990. * @utf_event_info: UTF event information
  991. * @is_fw_assert: is fw asserted
  992. * @wow: wow related patterns & parameters
  993. * @no_of_suspend_ind: number of suspend indications
  994. * @no_of_resume_ind: number of resume indications
  995. * @mArpInfo: arp info
  996. * @powersave_mode: power save mode
  997. * @ptrn_match_enable_all_vdev: is pattern match is enable/disable
  998. * @pGetRssiReq: get RSSI request
  999. * @thermal_mgmt_info: Thermal mitigation related info
  1000. * @roam_offload_enabled: is roam offload enable/disable
  1001. * @ol_ini_info: store ini status of arp offload, ns offload
  1002. * @ssdp: ssdp flag
  1003. * @ibss_started: is IBSS started or not
  1004. * @ibsskey_info: IBSS key info
  1005. * @dfs_ic: DFS umac interface information
  1006. * @hddTxFailCb: tx fail indication callback
  1007. * @pno_wake_lock: PNO wake lock
  1008. * @extscan_wake_lock: extscan wake lock
  1009. * @wow_wake_lock: wow wake lock
  1010. * @wow_nack: wow negative ack flag
  1011. * @ap_client_cnt: ap client count
  1012. * @is_wow_bus_suspended: is wow bus suspended flag
  1013. * @wma_scan_comp_timer: scan completion timer
  1014. * @dfs_phyerr_filter_offload: dfs phy error filter is offloaded or not
  1015. * @suitable_ap_hb_failure: better ap found
  1016. * @wma_ibss_power_save_params: IBSS Power Save config Parameters
  1017. * @IsRArateLimitEnabled: RA rate limiti s enabled or not
  1018. * @RArateLimitInterval: RA rate limit interval
  1019. * @is_lpass_enabled: Flag to indicate if LPASS feature is enabled or not
  1020. * @is_nan_enabled: Flag to indicate if NaN feature is enabled or not
  1021. * @staMaxLIModDtim: station max listen interval
  1022. * @staModDtim: station mode DTIM
  1023. * @staDynamicDtim: station dynamic DTIM
  1024. * @enable_mhf_offload: is MHF offload enable/disable
  1025. * @last_mhf_entries_timestamp: timestamp when last entries where set
  1026. * @dfs_pri_multiplier: DFS multiplier
  1027. * @hw_bd_id: hardware board id
  1028. * @hw_bd_info: hardware board info
  1029. * @in_d0wow: D0WOW is enable/disable
  1030. * @miracast_value: miracast value
  1031. * @log_completion_timer: log completion timer
  1032. * @mgmt_rx: management rx callback
  1033. * @num_dbs_hw_modes: Number of HW modes supported by the FW
  1034. * @dbs_mode: DBS HW mode list
  1035. * @old_hw_mode_index: Previous configured HW mode index
  1036. * @new_hw_mode_index: Current configured HW mode index
  1037. * @peer_authorized_cb: peer authorized hdd callback
  1038. * @ocb_callback: callback to OCB commands
  1039. * @ocb_resp: response to OCB commands
  1040. * @wow_pno_match_wake_up_count: PNO match wake up count
  1041. * @wow_pno_complete_wake_up_count: PNO complete wake up count
  1042. * @wow_gscan_wake_up_count: Gscan wake up count
  1043. * @wow_low_rssi_wake_up_count: Low rssi wake up count
  1044. * @wow_rssi_breach_wake_up_count: RSSI breach wake up count
  1045. * @wow_ucast_wake_up_count: WoW unicast packet wake up count
  1046. * @wow_bcast_wake_up_count: WoW brodcast packet wake up count
  1047. * @wow_ipv4_mcast_wake_up_count: WoW IPV4 mcast packet wake up count
  1048. * @wow_ipv6_mcast_wake_up_count: WoW IPV6 mcast packet wake up count
  1049. * @wow_ipv6_mcast_ra_stats: WoW IPV6 mcast RA packet wake up count
  1050. * @wow_ipv6_mcast_ns_stats: WoW IPV6 mcast NS packet wake up count
  1051. * @wow_ipv6_mcast_na_stats: WoW IPV6 mcast NA packet wake up count
  1052. * @dual_mac_cfg: Dual mac configuration params for scan and fw mode
  1053. *
  1054. * @max_scan: maximum scan requests than can be queued
  1055. * This structure is global wma context
  1056. * It contains global wma module parameters and
  1057. * handle of other modules.
  1058. * @saved_wmi_init_cmd: Saved WMI INIT command
  1059. * @service_ready_ext_evt: Wait event for service ready ext
  1060. * @wmi_cmd_rsp_wake_lock: wmi command response wake lock
  1061. * @wmi_cmd_rsp_runtime_lock: wmi command response bus lock
  1062. */
  1063. typedef struct {
  1064. void *wmi_handle;
  1065. void *htc_handle;
  1066. void *cds_context;
  1067. void *mac_context;
  1068. qdf_event_t wma_ready_event;
  1069. qdf_event_t wma_resume_event;
  1070. qdf_event_t target_suspend;
  1071. qdf_event_t runtime_suspend;
  1072. qdf_event_t recovery_event;
  1073. uint16_t max_station;
  1074. uint16_t max_bssid;
  1075. uint32_t frame_xln_reqd;
  1076. t_wma_drv_type driver_type;
  1077. uint8_t myaddr[IEEE80211_ADDR_LEN];
  1078. uint8_t hwaddr[IEEE80211_ADDR_LEN];
  1079. wmi_abi_version target_abi_vers;
  1080. wmi_abi_version final_abi_vers;
  1081. uint32_t target_fw_version;
  1082. #ifdef WLAN_FEATURE_LPSS
  1083. uint8_t lpss_support;
  1084. #endif
  1085. uint8_t ap_arpns_support;
  1086. #ifdef FEATURE_GREEN_AP
  1087. bool egap_support;
  1088. #endif
  1089. bool wmi_ready;
  1090. uint32_t wlan_init_status;
  1091. qdf_device_t qdf_dev;
  1092. uint32_t phy_capability;
  1093. uint32_t max_frag_entry;
  1094. uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  1095. wmi_resource_config wlan_resource_config;
  1096. uint32_t frameTransRequired;
  1097. tBssSystemRole wmaGlobalSystemRole;
  1098. pWMATxRxCompFunc tx_frm_download_comp_cb;
  1099. qdf_event_t tx_frm_download_comp_event;
  1100. /*
  1101. * Dummy event to wait for draining MSDUs left in hardware tx
  1102. * queue and before requesting VDEV_STOP. Nobody will set this
  1103. * and wait will timeout, and code will poll the pending tx
  1104. * descriptors number to be zero.
  1105. */
  1106. qdf_event_t tx_queue_empty_event;
  1107. pWMAAckFnTxComp umac_ota_ack_cb[SIR_MAC_MGMT_RESERVED15];
  1108. pWMAAckFnTxComp umac_data_ota_ack_cb;
  1109. unsigned long last_umac_data_ota_timestamp;
  1110. qdf_nbuf_t last_umac_data_nbuf;
  1111. bool needShutdown;
  1112. uint32_t num_mem_chunks;
  1113. struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS];
  1114. wma_tgt_cfg_cb tgt_cfg_update_cb;
  1115. wma_dfs_radar_indication_cb dfs_radar_indication_cb;
  1116. HAL_REG_CAPABILITIES reg_cap;
  1117. uint32_t scan_id;
  1118. struct wma_txrx_node *interfaces;
  1119. pdev_cli_config_t pdevconfig;
  1120. qdf_list_t vdev_resp_queue;
  1121. qdf_spinlock_t vdev_respq_lock;
  1122. qdf_list_t wma_hold_req_queue;
  1123. qdf_spinlock_t wma_hold_req_q_lock;
  1124. uint32_t ht_cap_info;
  1125. uint32_t vht_cap_info;
  1126. uint32_t vht_supp_mcs;
  1127. uint32_t num_rf_chains;
  1128. #if defined(QCA_WIFI_FTM)
  1129. struct utf_event_info utf_event_info;
  1130. #endif
  1131. uint8_t is_fw_assert;
  1132. struct wma_wow wow;
  1133. uint8_t no_of_suspend_ind;
  1134. uint8_t no_of_resume_ind;
  1135. /* Have a back up of arp info to send along
  1136. * with ns info suppose if ns also enabled
  1137. */
  1138. tSirHostOffloadReq mArpInfo;
  1139. struct wma_tx_ack_work_ctx *ack_work_ctx;
  1140. uint8_t powersave_mode;
  1141. bool ptrn_match_enable_all_vdev;
  1142. void *pGetRssiReq;
  1143. t_thermal_mgmt thermal_mgmt_info;
  1144. bool roam_offload_enabled;
  1145. /* Here ol_ini_info is used to store ini
  1146. * status of arp offload, ns offload
  1147. * and others. Currently 1st bit is used
  1148. * for arp off load and 2nd bit for ns
  1149. * offload currently, rest bits are unused
  1150. */
  1151. uint8_t ol_ini_info;
  1152. bool ssdp;
  1153. uint8_t ibss_started;
  1154. tSetBssKeyParams ibsskey_info;
  1155. struct ieee80211com *dfs_ic;
  1156. txFailIndCallback hddTxFailCb;
  1157. #ifdef FEATURE_WLAN_SCAN_PNO
  1158. qdf_wake_lock_t pno_wake_lock;
  1159. #endif
  1160. #ifdef FEATURE_WLAN_EXTSCAN
  1161. qdf_wake_lock_t extscan_wake_lock;
  1162. #endif
  1163. qdf_wake_lock_t wow_wake_lock;
  1164. int wow_nack;
  1165. qdf_atomic_t is_wow_bus_suspended;
  1166. qdf_mc_timer_t wma_scan_comp_timer;
  1167. uint8_t dfs_phyerr_filter_offload;
  1168. bool suitable_ap_hb_failure;
  1169. ibss_power_save_params wma_ibss_power_save_params;
  1170. #ifdef FEATURE_WLAN_RA_FILTERING
  1171. bool IsRArateLimitEnabled;
  1172. uint16_t RArateLimitInterval;
  1173. #endif
  1174. #ifdef WLAN_FEATURE_LPSS
  1175. bool is_lpass_enabled;
  1176. #endif
  1177. #ifdef WLAN_FEATURE_NAN
  1178. bool is_nan_enabled;
  1179. #endif
  1180. uint8_t staMaxLIModDtim;
  1181. uint8_t staModDtim;
  1182. uint8_t staDynamicDtim;
  1183. uint8_t enable_mhf_offload;
  1184. unsigned long last_mhf_entries_timestamp;
  1185. int32_t dfs_pri_multiplier;
  1186. uint32_t hw_bd_id;
  1187. uint32_t hw_bd_info[HW_BD_INFO_SIZE];
  1188. uint32_t miracast_value;
  1189. qdf_mc_timer_t log_completion_timer;
  1190. wma_mgmt_frame_rx_callback mgmt_rx;
  1191. uint32_t num_dbs_hw_modes;
  1192. struct dbs_hw_mode_info hw_mode;
  1193. uint32_t old_hw_mode_index;
  1194. uint32_t new_hw_mode_index;
  1195. qdf_atomic_t scan_id_counter;
  1196. wma_peer_authorized_fp peer_authorized_cb;
  1197. uint32_t wow_pno_match_wake_up_count;
  1198. uint32_t wow_pno_complete_wake_up_count;
  1199. uint32_t wow_gscan_wake_up_count;
  1200. uint32_t wow_low_rssi_wake_up_count;
  1201. uint32_t wow_rssi_breach_wake_up_count;
  1202. uint32_t wow_ucast_wake_up_count;
  1203. uint32_t wow_bcast_wake_up_count;
  1204. uint32_t wow_ipv4_mcast_wake_up_count;
  1205. uint32_t wow_ipv6_mcast_wake_up_count;
  1206. uint32_t wow_ipv6_mcast_ra_stats;
  1207. uint32_t wow_ipv6_mcast_ns_stats;
  1208. uint32_t wow_ipv6_mcast_na_stats;
  1209. /* OCB request contexts */
  1210. struct sir_ocb_config *ocb_config_req;
  1211. struct dual_mac_config dual_mac_cfg;
  1212. struct {
  1213. uint16_t pool_size;
  1214. uint16_t num_free;
  1215. union wmi_desc_elem_t *array;
  1216. union wmi_desc_elem_t *freelist;
  1217. qdf_spinlock_t wmi_desc_pool_lock;
  1218. } wmi_desc_pool;
  1219. uint8_t max_scan;
  1220. uint16_t self_gen_frm_pwr;
  1221. bool tx_chain_mask_cck;
  1222. /* Going with a timer instead of wait event because on receiving the
  1223. * service ready event, we will be waiting on the MC thread for the
  1224. * service extended ready event which is also processed in MC thread.
  1225. * This leads to MC thread being stuck. Alternative was to process
  1226. * these events in tasklet/workqueue context. But, this leads to
  1227. * race conditions when the events are processed in two different
  1228. * context. So, processing ready event and extended ready event in
  1229. * the serialized MC thread context with a timer.
  1230. */
  1231. qdf_mc_timer_t service_ready_ext_timer;
  1232. void (*csr_roam_synch_cb)(tpAniSirGlobal mac,
  1233. roam_offload_synch_ind *roam_synch_data,
  1234. tpSirBssDescription bss_desc_ptr, uint8_t reason);
  1235. QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
  1236. roam_offload_synch_ind *roam_synch_data,
  1237. tpSirBssDescription bss_desc_ptr);
  1238. qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
  1239. qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
  1240. qdf_runtime_lock_t wma_runtime_resume_lock;
  1241. uint32_t fine_time_measurement_cap;
  1242. struct wma_ini_config ini_config;
  1243. } t_wma_handle, *tp_wma_handle;
  1244. /**
  1245. * struct wma_target_cap - target capabality
  1246. * @wmi_service_bitmap: wmi services bitmap
  1247. * @wlan_resource_config: resource config
  1248. */
  1249. struct wma_target_cap {
  1250. /* wmi services bitmap received from Target */
  1251. uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  1252. /* default resource config,the os shim can overwrite it */
  1253. wmi_resource_config wlan_resource_config;
  1254. };
  1255. /**
  1256. * struct t_wma_start_req - wma start request parameters
  1257. * @pConfigBuffer: config buffer
  1258. * @usConfigBufferLen: Length of the config buffer above
  1259. * @driver_type: Production or FTM driver
  1260. * @pUserData: user data
  1261. * @pIndUserData: indication function pointer to send to UMAC
  1262. *
  1263. * The shared memory between WDI and HAL is 4K so maximum data can be
  1264. * transferred from WDI to HAL is 4K
  1265. */
  1266. typedef struct {
  1267. void *pConfigBuffer;
  1268. uint16_t usConfigBufferLen;
  1269. t_wma_drv_type driver_type;
  1270. void *pUserData;
  1271. void *pIndUserData;
  1272. } t_wma_start_req;
  1273. /* Enumeration for Version */
  1274. typedef enum {
  1275. WLAN_HAL_MSG_VERSION0 = 0,
  1276. WLAN_HAL_MSG_VERSION1 = 1,
  1277. WLAN_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF, /*define as 2 bytes data */
  1278. WLAN_HAL_MSG_VERSION_MAX_FIELD = WLAN_HAL_MSG_WCNSS_CTRL_VERSION
  1279. } tHalHostMsgVersion;
  1280. /**
  1281. * struct sHalMacStartParameter - mac start request parameters
  1282. * @driverType: driver type (production/FTM)
  1283. * @uConfigBufferLen: length of config buffer
  1284. */
  1285. typedef struct qdf_packed sHalMacStartParameter {
  1286. tDriverType driverType;
  1287. uint32_t uConfigBufferLen;
  1288. /* Following this there is a TLV formatted buffer of length
  1289. * "uConfigBufferLen" bytes containing all config values.
  1290. * The TLV is expected to be formatted like this:
  1291. * 0 15 31 31+CFG_LEN-1 length-1
  1292. * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
  1293. */
  1294. } tHalMacStartParameter, *tpHalMacStartParameter;
  1295. extern void cds_wma_complete_cback(void *p_cds_context);
  1296. extern void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
  1297. uint16_t regdmn5G, int8_t ctl2G,
  1298. int8_t ctl5G);
  1299. /**
  1300. * enum frame_index - Frame index
  1301. * @GENERIC_NODOWNLD_NOACK_COMP_INDEX: Frame index for no download comp no ack
  1302. * @GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX: Frame index for download comp no ack
  1303. * @GENERIC_DOWNLD_COMP_ACK_COMP_INDEX: Frame index for download comp and ack
  1304. * @GENERIC_NODOWLOAD_ACK_COMP_INDEX: Frame index for no download comp and ack
  1305. * @FRAME_INDEX_MAX: maximum frame index
  1306. */
  1307. enum frame_index {
  1308. GENERIC_NODOWNLD_NOACK_COMP_INDEX,
  1309. GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
  1310. GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
  1311. GENERIC_NODOWLOAD_ACK_COMP_INDEX,
  1312. FRAME_INDEX_MAX
  1313. };
  1314. /**
  1315. * struct wma_tx_ack_work_ctx - tx ack work context
  1316. * @wma_handle: wma handle
  1317. * @sub_type: sub type
  1318. * @status: status
  1319. * @ack_cmp_work: work structure
  1320. */
  1321. struct wma_tx_ack_work_ctx {
  1322. tp_wma_handle wma_handle;
  1323. uint16_t sub_type;
  1324. int32_t status;
  1325. qdf_work_t ack_cmp_work;
  1326. };
  1327. /**
  1328. * struct wma_target_req - target request parameters
  1329. * @event_timeout: event timeout
  1330. * @node: list
  1331. * @user_data: user data
  1332. * @msg_type: message type
  1333. * @vdev_id: vdev id
  1334. * @type: type
  1335. */
  1336. struct wma_target_req {
  1337. qdf_mc_timer_t event_timeout;
  1338. qdf_list_node_t node;
  1339. void *user_data;
  1340. uint32_t msg_type;
  1341. uint8_t vdev_id;
  1342. uint8_t type;
  1343. };
  1344. /**
  1345. * struct wma_vdev_start_req - vdev start request parameters
  1346. * @beacon_intval: beacon interval
  1347. * @dtim_period: dtim period
  1348. * @max_txpow: max tx power
  1349. * @chan_offset: channel offset
  1350. * @is_dfs: is dfs supported or not
  1351. * @vdev_id: vdev id
  1352. * @chan: channel
  1353. * @oper_mode: operating mode
  1354. * @ssid: ssid
  1355. * @hidden_ssid: hidden ssid
  1356. * @pmf_enabled: is pmf enabled or not
  1357. * @vht_capable: VHT capabality
  1358. * @ht_capable: HT capabality
  1359. * @dfs_pri_multiplier: DFS multiplier
  1360. * @dot11_mode: 802.11 mode
  1361. * @is_half_rate: is the channel operating at 10MHz
  1362. * @is_quarter_rate: is the channel operating at 5MHz
  1363. * @preferred_tx_streams: policy manager indicates the preferred
  1364. * number of transmit streams
  1365. * @preferred_rx_streams: policy manager indicates the preferred
  1366. * number of receive streams
  1367. */
  1368. struct wma_vdev_start_req {
  1369. uint32_t beacon_intval;
  1370. uint32_t dtim_period;
  1371. int32_t max_txpow;
  1372. enum phy_ch_width chan_width;
  1373. bool is_dfs;
  1374. uint8_t vdev_id;
  1375. uint8_t chan;
  1376. uint8_t oper_mode;
  1377. tSirMacSSid ssid;
  1378. uint8_t hidden_ssid;
  1379. uint8_t pmf_enabled;
  1380. uint8_t vht_capable;
  1381. uint8_t ch_center_freq_seg0;
  1382. uint8_t ch_center_freq_seg1;
  1383. uint8_t ht_capable;
  1384. int32_t dfs_pri_multiplier;
  1385. uint8_t dot11_mode;
  1386. bool is_half_rate;
  1387. bool is_quarter_rate;
  1388. uint32_t preferred_tx_streams;
  1389. uint32_t preferred_rx_streams;
  1390. };
  1391. /**
  1392. * struct wma_set_key_params - set key parameters
  1393. * @vdev_id: vdev id
  1394. * @def_key_idx: used to see if we have to read the key from cfg
  1395. * @key_len: key length
  1396. * @peer_mac: peer mac address
  1397. * @singl_tid_rc: 1=Single TID based Replay Count, 0=Per TID based RC
  1398. * @key_type: key type
  1399. * @key_idx: key index
  1400. * @unicast: unicast flag
  1401. * @key_data: key data
  1402. */
  1403. struct wma_set_key_params {
  1404. uint8_t vdev_id;
  1405. /* def_key_idx can be used to see if we have to read the key from cfg */
  1406. uint32_t def_key_idx;
  1407. uint16_t key_len;
  1408. uint8_t peer_mac[IEEE80211_ADDR_LEN];
  1409. uint8_t singl_tid_rc;
  1410. enum eAniEdType key_type;
  1411. uint32_t key_idx;
  1412. bool unicast;
  1413. uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
  1414. };
  1415. /**
  1416. * struct t_thermal_cmd_params - thermal command parameters
  1417. * @minTemp: minimum temprature
  1418. * @maxTemp: maximum temprature
  1419. * @thermalEnable: thermal enable
  1420. */
  1421. typedef struct {
  1422. uint16_t minTemp;
  1423. uint16_t maxTemp;
  1424. uint8_t thermalEnable;
  1425. } t_thermal_cmd_params, *tp_thermal_cmd_params;
  1426. /**
  1427. * enum wma_cfg_cmd_id - wma cmd ids
  1428. * @WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID: txrx firmware stats enable command
  1429. * @WMA_VDEV_TXRX_FWSTATS_RESET_CMDID: txrx firmware stats reset command
  1430. * @WMA_VDEV_MCC_SET_TIME_LATENCY: set MCC latency time
  1431. * @WMA_VDEV_MCC_SET_TIME_QUOTA: set MCC time quota
  1432. * @WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE: set IBSS ATIM window size
  1433. * @WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED: set IBSS enable power save
  1434. * @WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED: set IBSS power collapse enable
  1435. * @WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX: awake IBSS on TX/RX
  1436. * @WMA_VDEV_IBSS_SET_INACTIVITY_TIME: set IBSS inactivity time
  1437. * @WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME: set IBSS TXSP
  1438. * @WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS: set IBSS power save warmup time
  1439. * @WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW: set IBSS power save ATIM
  1440. * @WMA_VDEV_DFS_CONTROL_CMDID: DFS control command
  1441. * @WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID: get IPA microcontroller fw stats
  1442. *
  1443. * wma command ids for configuration request which
  1444. * does not involve sending a wmi command.
  1445. */
  1446. enum wma_cfg_cmd_id {
  1447. WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID = WMI_CMDID_MAX,
  1448. WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
  1449. WMA_VDEV_MCC_SET_TIME_LATENCY,
  1450. WMA_VDEV_MCC_SET_TIME_QUOTA,
  1451. WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
  1452. WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
  1453. WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
  1454. WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
  1455. WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
  1456. WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
  1457. WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
  1458. WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
  1459. WMA_VDEV_DFS_CONTROL_CMDID,
  1460. WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
  1461. WMA_CMD_ID_MAX
  1462. };
  1463. /**
  1464. * struct wma_trigger_uapsd_params - trigger uapsd parameters
  1465. * @wmm_ac: wmm access catagory
  1466. * @user_priority: user priority
  1467. * @service_interval: service interval
  1468. * @suspend_interval: suspend interval
  1469. * @delay_interval: delay interval
  1470. */
  1471. typedef struct wma_trigger_uapsd_params {
  1472. uint32_t wmm_ac;
  1473. uint32_t user_priority;
  1474. uint32_t service_interval;
  1475. uint32_t suspend_interval;
  1476. uint32_t delay_interval;
  1477. } t_wma_trigger_uapsd_params, *tp_wma_trigger_uapsd_params;
  1478. /**
  1479. * enum uapsd_peer_param_max_sp - U-APSD maximum service period of peer station
  1480. * @UAPSD_MAX_SP_LEN_UNLIMITED: unlimited max service period
  1481. * @UAPSD_MAX_SP_LEN_2: max service period = 2
  1482. * @UAPSD_MAX_SP_LEN_4: max service period = 4
  1483. * @UAPSD_MAX_SP_LEN_6: max service period = 6
  1484. */
  1485. enum uapsd_peer_param_max_sp {
  1486. UAPSD_MAX_SP_LEN_UNLIMITED = 0,
  1487. UAPSD_MAX_SP_LEN_2 = 2,
  1488. UAPSD_MAX_SP_LEN_4 = 4,
  1489. UAPSD_MAX_SP_LEN_6 = 6
  1490. };
  1491. /**
  1492. * enum uapsd_peer_param_enabled_ac - U-APSD Enabled AC's of peer station
  1493. * @UAPSD_VO_ENABLED: enable uapsd for voice
  1494. * @UAPSD_VI_ENABLED: enable uapsd for video
  1495. * @UAPSD_BK_ENABLED: enable uapsd for background
  1496. * @UAPSD_BE_ENABLED: enable uapsd for best effort
  1497. */
  1498. enum uapsd_peer_param_enabled_ac {
  1499. UAPSD_VO_ENABLED = 0x01,
  1500. UAPSD_VI_ENABLED = 0x02,
  1501. UAPSD_BK_ENABLED = 0x04,
  1502. UAPSD_BE_ENABLED = 0x08
  1503. };
  1504. /**
  1505. * enum profile_id_t - Firmware profiling index
  1506. * @PROF_CPU_IDLE: cpu idle profile
  1507. * @PROF_PPDU_PROC: ppdu processing profile
  1508. * @PROF_PPDU_POST: ppdu post profile
  1509. * @PROF_HTT_TX_INPUT: htt tx input profile
  1510. * @PROF_MSDU_ENQ: msdu enqueue profile
  1511. * @PROF_PPDU_POST_HAL: ppdu post profile
  1512. * @PROF_COMPUTE_TX_TIME: tx time profile
  1513. * @PROF_MAX_ID: max profile index
  1514. */
  1515. enum profile_id_t {
  1516. PROF_CPU_IDLE,
  1517. PROF_PPDU_PROC,
  1518. PROF_PPDU_POST,
  1519. PROF_HTT_TX_INPUT,
  1520. PROF_MSDU_ENQ,
  1521. PROF_PPDU_POST_HAL,
  1522. PROF_COMPUTE_TX_TIME,
  1523. PROF_MAX_ID,
  1524. };
  1525. /**
  1526. * struct p2p_ie - P2P IE structural definition.
  1527. * @p2p_id: p2p id
  1528. * @p2p_len: p2p length
  1529. * @p2p_oui: p2p OUI
  1530. * @p2p_oui_type: p2p OUI type
  1531. */
  1532. struct p2p_ie {
  1533. uint8_t p2p_id;
  1534. uint8_t p2p_len;
  1535. uint8_t p2p_oui[3];
  1536. uint8_t p2p_oui_type;
  1537. } __packed;
  1538. /**
  1539. * struct p2p_noa_descriptor - noa descriptor
  1540. * @type_count: 255: continuous schedule, 0: reserved
  1541. * @duration: Absent period duration in micro seconds
  1542. * @interval: Absent period interval in micro seconds
  1543. * @start_time: 32 bit tsf time when in starts
  1544. */
  1545. struct p2p_noa_descriptor {
  1546. uint8_t type_count;
  1547. uint32_t duration;
  1548. uint32_t interval;
  1549. uint32_t start_time;
  1550. } __packed;
  1551. /**
  1552. * struct p2p_sub_element_noa - p2p noa element
  1553. * @p2p_sub_id: p2p sub id
  1554. * @p2p_sub_len: p2p sub length
  1555. * @index: identifies instance of NOA su element
  1556. * @oppPS: oppPS state of the AP
  1557. * @ctwindow: ctwindow in TUs
  1558. * @num_descriptors: number of NOA descriptors
  1559. * @noa_descriptors: noa descriptors
  1560. */
  1561. struct p2p_sub_element_noa {
  1562. uint8_t p2p_sub_id;
  1563. uint8_t p2p_sub_len;
  1564. uint8_t index; /* identifies instance of NOA su element */
  1565. uint8_t oppPS:1, /* oppPS state of the AP */
  1566. ctwindow:7; /* ctwindow in TUs */
  1567. uint8_t num_descriptors; /* number of NOA descriptors */
  1568. struct p2p_noa_descriptor noa_descriptors[WMA_MAX_NOA_DESCRIPTORS];
  1569. };
  1570. /**
  1571. * struct wma_decap_info_t - decapsulation info
  1572. * @hdr: header
  1573. * @hdr_len: header length
  1574. */
  1575. struct wma_decap_info_t {
  1576. uint8_t hdr[sizeof(struct ieee80211_qosframe_addr4)];
  1577. int32_t hdr_len;
  1578. };
  1579. /**
  1580. * enum packet_power_save - packet power save params
  1581. * @WMI_VDEV_PPS_PAID_MATCH: paid match param
  1582. * @WMI_VDEV_PPS_GID_MATCH: gid match param
  1583. * @WMI_VDEV_PPS_EARLY_TIM_CLEAR: early tim clear param
  1584. * @WMI_VDEV_PPS_EARLY_DTIM_CLEAR: early dtim clear param
  1585. * @WMI_VDEV_PPS_EOF_PAD_DELIM: eof pad delim param
  1586. * @WMI_VDEV_PPS_MACADDR_MISMATCH: macaddr mismatch param
  1587. * @WMI_VDEV_PPS_DELIM_CRC_FAIL: delim CRC fail param
  1588. * @WMI_VDEV_PPS_GID_NSTS_ZERO: gid nsts zero param
  1589. * @WMI_VDEV_PPS_RSSI_CHECK: RSSI check param
  1590. * @WMI_VDEV_PPS_5G_EBT: 5G ebt param
  1591. */
  1592. typedef enum {
  1593. WMI_VDEV_PPS_PAID_MATCH = 0,
  1594. WMI_VDEV_PPS_GID_MATCH = 1,
  1595. WMI_VDEV_PPS_EARLY_TIM_CLEAR = 2,
  1596. WMI_VDEV_PPS_EARLY_DTIM_CLEAR = 3,
  1597. WMI_VDEV_PPS_EOF_PAD_DELIM = 4,
  1598. WMI_VDEV_PPS_MACADDR_MISMATCH = 5,
  1599. WMI_VDEV_PPS_DELIM_CRC_FAIL = 6,
  1600. WMI_VDEV_PPS_GID_NSTS_ZERO = 7,
  1601. WMI_VDEV_PPS_RSSI_CHECK = 8,
  1602. WMI_VDEV_VHT_SET_GID_MGMT = 9,
  1603. WMI_VDEV_PPS_5G_EBT = 10
  1604. } packet_power_save;
  1605. /**
  1606. * enum green_tx_param - green tx parameters
  1607. * @WMI_VDEV_PARAM_GTX_HT_MCS: ht mcs param
  1608. * @WMI_VDEV_PARAM_GTX_VHT_MCS: vht mcs param
  1609. * @WMI_VDEV_PARAM_GTX_USR_CFG: user cfg param
  1610. * @WMI_VDEV_PARAM_GTX_THRE: thre param
  1611. * @WMI_VDEV_PARAM_GTX_MARGIN: green tx margin param
  1612. * @WMI_VDEV_PARAM_GTX_STEP: green tx step param
  1613. * @WMI_VDEV_PARAM_GTX_MINTPC: mintpc param
  1614. * @WMI_VDEV_PARAM_GTX_BW_MASK: bandwidth mask
  1615. */
  1616. typedef enum {
  1617. WMI_VDEV_PARAM_GTX_HT_MCS,
  1618. WMI_VDEV_PARAM_GTX_VHT_MCS,
  1619. WMI_VDEV_PARAM_GTX_USR_CFG,
  1620. WMI_VDEV_PARAM_GTX_THRE,
  1621. WMI_VDEV_PARAM_GTX_MARGIN,
  1622. WMI_VDEV_PARAM_GTX_STEP,
  1623. WMI_VDEV_PARAM_GTX_MINTPC,
  1624. WMI_VDEV_PARAM_GTX_BW_MASK,
  1625. } green_tx_param;
  1626. #ifdef FEATURE_WLAN_TDLS
  1627. /**
  1628. * struct wma_tdls_params - TDLS parameters
  1629. * @vdev_id: vdev id
  1630. * @tdls_state: TDLS state
  1631. * @notification_interval_ms: notification inerval
  1632. * @tx_discovery_threshold: tx discovery threshold
  1633. * @tx_teardown_threshold: tx teardown threashold
  1634. * @rssi_teardown_threshold: RSSI teardown threshold
  1635. * @rssi_delta: RSSI delta
  1636. * @tdls_options: TDLS options
  1637. * @peer_traffic_ind_window: raffic indication window
  1638. * @peer_traffic_response_timeout: traffic response timeout
  1639. * @puapsd_mask: uapsd mask
  1640. * @puapsd_inactivity_time: uapsd inactivity time
  1641. * @puapsd_rx_frame_threshold: uapsd rx frame threshold
  1642. * @teardown_notification_ms: tdls teardown notification interval
  1643. * @tdls_peer_kickout_threshold: tdls packet threshold for
  1644. * peer kickout operation
  1645. */
  1646. typedef struct wma_tdls_params {
  1647. uint32_t vdev_id;
  1648. uint32_t tdls_state;
  1649. uint32_t notification_interval_ms;
  1650. uint32_t tx_discovery_threshold;
  1651. uint32_t tx_teardown_threshold;
  1652. int32_t rssi_teardown_threshold;
  1653. int32_t rssi_delta;
  1654. uint32_t tdls_options;
  1655. uint32_t peer_traffic_ind_window;
  1656. uint32_t peer_traffic_response_timeout;
  1657. uint32_t puapsd_mask;
  1658. uint32_t puapsd_inactivity_time;
  1659. uint32_t puapsd_rx_frame_threshold;
  1660. uint32_t teardown_notification_ms;
  1661. uint32_t tdls_peer_kickout_threshold;
  1662. } t_wma_tdls_params;
  1663. /**
  1664. * struct wma_tdls_peer_event - TDLS peer event
  1665. * @vdev_id: vdev id
  1666. * @peer_macaddr: peer MAC address
  1667. * @peer_status: TDLS peer status
  1668. * @peer_reason: TDLS peer reason
  1669. */
  1670. typedef struct {
  1671. A_UINT32 vdev_id;
  1672. wmi_mac_addr peer_macaddr;
  1673. A_UINT32 peer_status;
  1674. A_UINT32 peer_reason;
  1675. } wma_tdls_peer_event;
  1676. #endif /* FEATURE_WLAN_TDLS */
  1677. /**
  1678. * struct wma_dfs_radar_channel_list - dfs radar channel list
  1679. * @nchannels: nuber of channels
  1680. * @channels: Channel number including bonded channels on which
  1681. * radar is present
  1682. */
  1683. struct wma_dfs_radar_channel_list {
  1684. A_UINT32 nchannels;
  1685. uint8_t channels[WMA_DFS_MAX_20M_SUB_CH];
  1686. };
  1687. /**
  1688. * struct wma_dfs_radar_indication - Structure to indicate RADAR
  1689. * @vdev_id: vdev id
  1690. * @chan_list: Channel list on which RADAR is detected
  1691. * @dfs_radar_status: Flag to Indicate RADAR presence on the current channel
  1692. * @use_nol: Flag to indicate use NOL
  1693. */
  1694. struct wma_dfs_radar_indication {
  1695. A_UINT32 vdev_id;
  1696. struct wma_dfs_radar_channel_list chan_list;
  1697. uint32_t dfs_radar_status;
  1698. int use_nol;
  1699. };
  1700. /**
  1701. * enum uapsd_ac - U-APSD Access Categories
  1702. * @UAPSD_BE: best effort
  1703. * @UAPSD_BK: back ground
  1704. * @UAPSD_VI: video
  1705. * @UAPSD_VO: voice
  1706. */
  1707. enum uapsd_ac {
  1708. UAPSD_BE,
  1709. UAPSD_BK,
  1710. UAPSD_VI,
  1711. UAPSD_VO
  1712. };
  1713. QDF_STATUS wma_disable_uapsd_per_ac(tp_wma_handle wma_handle,
  1714. uint32_t vdev_id, enum uapsd_ac ac);
  1715. /**
  1716. * enum uapsd_up - U-APSD User Priorities
  1717. * @UAPSD_UP_BE: best effort
  1718. * @UAPSD_UP_BK: back ground
  1719. * @UAPSD_UP_RESV: reserve
  1720. * @UAPSD_UP_EE: Excellent Effort
  1721. * @UAPSD_UP_CL: Critical Applications
  1722. * @UAPSD_UP_VI: video
  1723. * @UAPSD_UP_VO: voice
  1724. * @UAPSD_UP_NC: Network Control
  1725. */
  1726. enum uapsd_up {
  1727. UAPSD_UP_BE,
  1728. UAPSD_UP_BK,
  1729. UAPSD_UP_RESV,
  1730. UAPSD_UP_EE,
  1731. UAPSD_UP_CL,
  1732. UAPSD_UP_VI,
  1733. UAPSD_UP_VO,
  1734. UAPSD_UP_NC,
  1735. UAPSD_UP_MAX
  1736. };
  1737. /**
  1738. * struct wma_unit_test_cmd - unit test command parameters
  1739. * @vdev_id: vdev id
  1740. * @module_id: module id
  1741. * @num_args: number of arguments
  1742. * @args: arguments
  1743. */
  1744. typedef struct wma_unit_test_cmd {
  1745. uint32_t vdev_id;
  1746. WLAN_MODULE_ID module_id;
  1747. uint32_t num_args;
  1748. uint32_t args[WMA_MAX_NUM_ARGS];
  1749. } t_wma_unit_test_cmd;
  1750. /**
  1751. * struct wma_roam_invoke_cmd - roam invoke command
  1752. * @vdev_id: vdev id
  1753. * @bssid: mac address
  1754. * @channel: channel
  1755. */
  1756. struct wma_roam_invoke_cmd {
  1757. uint32_t vdev_id;
  1758. uint8_t bssid[IEEE80211_ADDR_LEN];
  1759. uint32_t channel;
  1760. };
  1761. /**
  1762. * struct wma_process_fw_event_params - fw event parameters
  1763. * @wmi_handle: wmi handle
  1764. * @evt_buf: event buffer
  1765. */
  1766. typedef struct {
  1767. void *wmi_handle;
  1768. void *evt_buf;
  1769. } wma_process_fw_event_params;
  1770. int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx);
  1771. A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
  1772. eCsrEncryptionType encr);
  1773. A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
  1774. /*
  1775. * WMA-DFS Hooks
  1776. */
  1777. int ol_if_dfs_attach(struct ieee80211com *ic, void *ptr, void *radar_info);
  1778. uint64_t ol_if_get_tsf64(struct ieee80211com *ic);
  1779. int ol_if_dfs_disable(struct ieee80211com *ic);
  1780. struct dfs_ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
  1781. int freq, uint32_t flags);
  1782. int ol_if_dfs_enable(struct ieee80211com *ic, int *is_fastclk, void *pe);
  1783. uint32_t ieee80211_ieee2mhz(uint32_t chan, uint32_t flags);
  1784. int ol_if_dfs_get_ext_busy(struct ieee80211com *ic);
  1785. int ol_if_dfs_get_mib_cycle_counts_pct(struct ieee80211com *ic,
  1786. uint32_t *rxc_pcnt, uint32_t *rxf_pcnt,
  1787. uint32_t *txf_pcnt);
  1788. uint16_t ol_if_dfs_usenol(struct ieee80211com *ic);
  1789. void ieee80211_mark_dfs(struct ieee80211com *ic,
  1790. struct dfs_ieee80211_channel *ichan);
  1791. int wma_dfs_indicate_radar(struct ieee80211com *ic,
  1792. struct dfs_ieee80211_channel *ichan);
  1793. uint16_t dfs_usenol(struct ieee80211com *ic);
  1794. QDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,
  1795. tp_wma_trigger_uapsd_params
  1796. trigger_uapsd_params);
  1797. /* added to get average snr for both data and beacon */
  1798. QDF_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq);
  1799. QDF_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, uint8_t vdev_id,
  1800. ol_txrx_vdev_handle tx_rx_vdev_handle,
  1801. uint8_t *mac, uint32_t vdev_type, bool add_del);
  1802. void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle);
  1803. void wma_log_completion_timeout(void *data);
  1804. QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
  1805. struct rssi_monitor_req *req);
  1806. QDF_STATUS wma_send_soc_set_pcl_cmd(tp_wma_handle wma_handle,
  1807. struct sir_pcl_list *msg);
  1808. QDF_STATUS wma_send_soc_set_hw_mode_cmd(tp_wma_handle wma_handle,
  1809. struct sir_hw_mode *msg);
  1810. QDF_STATUS wma_get_scan_id(uint32_t *scan_id);
  1811. QDF_STATUS wma_send_soc_set_dual_mac_config(tp_wma_handle wma_handle,
  1812. struct sir_dual_mac_config *msg);
  1813. QDF_STATUS wma_send_pdev_set_antenna_mode(tp_wma_handle wma_handle,
  1814. struct sir_antenna_mode_param *msg);
  1815. QDF_STATUS wma_crash_inject(tp_wma_handle wma_handle, uint32_t type,
  1816. uint32_t delay_time_ms);
  1817. struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
  1818. uint8_t vdev_id,
  1819. uint32_t msg_type, uint8_t type,
  1820. void *params, uint32_t timeout);
  1821. struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
  1822. uint8_t vdev_id, uint32_t msg_type,
  1823. uint8_t type, void *params,
  1824. uint32_t timeout);
  1825. QDF_STATUS wma_vdev_start(tp_wma_handle wma,
  1826. struct wma_vdev_start_req *req, bool isRestart);
  1827. void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
  1828. uint8_t type);
  1829. int wmi_desc_pool_init(tp_wma_handle wma_handle, uint32_t pool_size);
  1830. void wmi_desc_pool_deinit(tp_wma_handle wma_handle);
  1831. struct wmi_desc_t *wmi_desc_get(tp_wma_handle wma_handle);
  1832. void wmi_desc_put(tp_wma_handle wma_handle, struct wmi_desc_t *wmi_desc);
  1833. int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
  1834. uint32_t len);
  1835. void wma_set_dfs_region(tp_wma_handle wma, uint8_t dfs_region);
  1836. uint32_t wma_get_vht_ch_width(void);
  1837. QDF_STATUS
  1838. wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
  1839. A_UINT32 val, A_UINT32 *module_id_bitmap,
  1840. A_UINT32 bitmap_len);
  1841. #ifdef FEATURE_LFR_SUBNET_DETECTION
  1842. QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
  1843. struct gateway_param_update_req *req);
  1844. #else
  1845. static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
  1846. struct gateway_param_update_req *req)
  1847. {
  1848. return QDF_STATUS_SUCCESS;
  1849. }
  1850. #endif /* FEATURE_LFR_SUBNET_DETECTION */
  1851. #if defined(FEATURE_LRO)
  1852. QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
  1853. struct wma_lro_config_cmd_t *wma_lro_cmd);
  1854. #else
  1855. static inline QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
  1856. struct wma_lro_config_cmd_t *wma_lro_cmd)
  1857. {
  1858. return QDF_STATUS_SUCCESS;
  1859. }
  1860. #endif
  1861. void
  1862. wma_indicate_err(enum ol_rx_err_type err_type,
  1863. struct ol_error_info *err_info);
  1864. QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma_handle,
  1865. int32_t vdev_id);
  1866. QDF_STATUS wma_send_ht40_obss_scanind(tp_wma_handle wma,
  1867. struct obss_ht40_scanind *req);
  1868. #endif
  1869. struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle);