wma.h 63 KB

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