wma.h 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027
  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. #ifdef WLAN_FEATURE_ROAM_OFFLOAD
  1233. void (*csr_roam_synch_cb)(tpAniSirGlobal mac,
  1234. roam_offload_synch_ind *roam_synch_data,
  1235. tpSirBssDescription bss_desc_ptr, uint8_t reason);
  1236. QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
  1237. roam_offload_synch_ind *roam_synch_data,
  1238. tpSirBssDescription bss_desc_ptr);
  1239. #endif
  1240. qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
  1241. qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
  1242. qdf_runtime_lock_t wma_runtime_resume_lock;
  1243. uint32_t fine_time_measurement_cap;
  1244. struct wma_ini_config ini_config;
  1245. } t_wma_handle, *tp_wma_handle;
  1246. /**
  1247. * struct wma_target_cap - target capabality
  1248. * @wmi_service_bitmap: wmi services bitmap
  1249. * @wlan_resource_config: resource config
  1250. */
  1251. struct wma_target_cap {
  1252. /* wmi services bitmap received from Target */
  1253. uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  1254. /* default resource config,the os shim can overwrite it */
  1255. wmi_resource_config wlan_resource_config;
  1256. };
  1257. /**
  1258. * struct t_wma_start_req - wma start request parameters
  1259. * @pConfigBuffer: config buffer
  1260. * @usConfigBufferLen: Length of the config buffer above
  1261. * @driver_type: Production or FTM driver
  1262. * @pUserData: user data
  1263. * @pIndUserData: indication function pointer to send to UMAC
  1264. *
  1265. * The shared memory between WDI and HAL is 4K so maximum data can be
  1266. * transferred from WDI to HAL is 4K
  1267. */
  1268. typedef struct {
  1269. void *pConfigBuffer;
  1270. uint16_t usConfigBufferLen;
  1271. t_wma_drv_type driver_type;
  1272. void *pUserData;
  1273. void *pIndUserData;
  1274. } t_wma_start_req;
  1275. /* Enumeration for Version */
  1276. typedef enum {
  1277. WLAN_HAL_MSG_VERSION0 = 0,
  1278. WLAN_HAL_MSG_VERSION1 = 1,
  1279. WLAN_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF, /*define as 2 bytes data */
  1280. WLAN_HAL_MSG_VERSION_MAX_FIELD = WLAN_HAL_MSG_WCNSS_CTRL_VERSION
  1281. } tHalHostMsgVersion;
  1282. /**
  1283. * struct sHalMacStartParameter - mac start request parameters
  1284. * @driverType: driver type (production/FTM)
  1285. * @uConfigBufferLen: length of config buffer
  1286. */
  1287. typedef struct qdf_packed sHalMacStartParameter {
  1288. tDriverType driverType;
  1289. uint32_t uConfigBufferLen;
  1290. /* Following this there is a TLV formatted buffer of length
  1291. * "uConfigBufferLen" bytes containing all config values.
  1292. * The TLV is expected to be formatted like this:
  1293. * 0 15 31 31+CFG_LEN-1 length-1
  1294. * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
  1295. */
  1296. } tHalMacStartParameter, *tpHalMacStartParameter;
  1297. extern void cds_wma_complete_cback(void *p_cds_context);
  1298. extern void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
  1299. uint16_t regdmn5G, int8_t ctl2G,
  1300. int8_t ctl5G);
  1301. /**
  1302. * enum frame_index - Frame index
  1303. * @GENERIC_NODOWNLD_NOACK_COMP_INDEX: Frame index for no download comp no ack
  1304. * @GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX: Frame index for download comp no ack
  1305. * @GENERIC_DOWNLD_COMP_ACK_COMP_INDEX: Frame index for download comp and ack
  1306. * @GENERIC_NODOWLOAD_ACK_COMP_INDEX: Frame index for no download comp and ack
  1307. * @FRAME_INDEX_MAX: maximum frame index
  1308. */
  1309. enum frame_index {
  1310. GENERIC_NODOWNLD_NOACK_COMP_INDEX,
  1311. GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
  1312. GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
  1313. GENERIC_NODOWLOAD_ACK_COMP_INDEX,
  1314. FRAME_INDEX_MAX
  1315. };
  1316. /**
  1317. * struct wma_tx_ack_work_ctx - tx ack work context
  1318. * @wma_handle: wma handle
  1319. * @sub_type: sub type
  1320. * @status: status
  1321. * @ack_cmp_work: work structure
  1322. */
  1323. struct wma_tx_ack_work_ctx {
  1324. tp_wma_handle wma_handle;
  1325. uint16_t sub_type;
  1326. int32_t status;
  1327. qdf_work_t ack_cmp_work;
  1328. };
  1329. /**
  1330. * struct wma_target_req - target request parameters
  1331. * @event_timeout: event timeout
  1332. * @node: list
  1333. * @user_data: user data
  1334. * @msg_type: message type
  1335. * @vdev_id: vdev id
  1336. * @type: type
  1337. */
  1338. struct wma_target_req {
  1339. qdf_mc_timer_t event_timeout;
  1340. qdf_list_node_t node;
  1341. void *user_data;
  1342. uint32_t msg_type;
  1343. uint8_t vdev_id;
  1344. uint8_t type;
  1345. };
  1346. /**
  1347. * struct wma_vdev_start_req - vdev start request parameters
  1348. * @beacon_intval: beacon interval
  1349. * @dtim_period: dtim period
  1350. * @max_txpow: max tx power
  1351. * @chan_offset: channel offset
  1352. * @is_dfs: is dfs supported or not
  1353. * @vdev_id: vdev id
  1354. * @chan: channel
  1355. * @oper_mode: operating mode
  1356. * @ssid: ssid
  1357. * @hidden_ssid: hidden ssid
  1358. * @pmf_enabled: is pmf enabled or not
  1359. * @vht_capable: VHT capabality
  1360. * @ht_capable: HT capabality
  1361. * @dfs_pri_multiplier: DFS multiplier
  1362. * @dot11_mode: 802.11 mode
  1363. * @is_half_rate: is the channel operating at 10MHz
  1364. * @is_quarter_rate: is the channel operating at 5MHz
  1365. * @preferred_tx_streams: policy manager indicates the preferred
  1366. * number of transmit streams
  1367. * @preferred_rx_streams: policy manager indicates the preferred
  1368. * number of receive streams
  1369. */
  1370. struct wma_vdev_start_req {
  1371. uint32_t beacon_intval;
  1372. uint32_t dtim_period;
  1373. int32_t max_txpow;
  1374. enum phy_ch_width chan_width;
  1375. bool is_dfs;
  1376. uint8_t vdev_id;
  1377. uint8_t chan;
  1378. uint8_t oper_mode;
  1379. tSirMacSSid ssid;
  1380. uint8_t hidden_ssid;
  1381. uint8_t pmf_enabled;
  1382. uint8_t vht_capable;
  1383. uint8_t ch_center_freq_seg0;
  1384. uint8_t ch_center_freq_seg1;
  1385. uint8_t ht_capable;
  1386. int32_t dfs_pri_multiplier;
  1387. uint8_t dot11_mode;
  1388. bool is_half_rate;
  1389. bool is_quarter_rate;
  1390. uint32_t preferred_tx_streams;
  1391. uint32_t preferred_rx_streams;
  1392. };
  1393. /**
  1394. * struct wma_set_key_params - set key parameters
  1395. * @vdev_id: vdev id
  1396. * @def_key_idx: used to see if we have to read the key from cfg
  1397. * @key_len: key length
  1398. * @peer_mac: peer mac address
  1399. * @singl_tid_rc: 1=Single TID based Replay Count, 0=Per TID based RC
  1400. * @key_type: key type
  1401. * @key_idx: key index
  1402. * @unicast: unicast flag
  1403. * @key_data: key data
  1404. */
  1405. struct wma_set_key_params {
  1406. uint8_t vdev_id;
  1407. /* def_key_idx can be used to see if we have to read the key from cfg */
  1408. uint32_t def_key_idx;
  1409. uint16_t key_len;
  1410. uint8_t peer_mac[IEEE80211_ADDR_LEN];
  1411. uint8_t singl_tid_rc;
  1412. enum eAniEdType key_type;
  1413. uint32_t key_idx;
  1414. bool unicast;
  1415. uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
  1416. };
  1417. /**
  1418. * struct t_thermal_cmd_params - thermal command parameters
  1419. * @minTemp: minimum temprature
  1420. * @maxTemp: maximum temprature
  1421. * @thermalEnable: thermal enable
  1422. */
  1423. typedef struct {
  1424. uint16_t minTemp;
  1425. uint16_t maxTemp;
  1426. uint8_t thermalEnable;
  1427. } t_thermal_cmd_params, *tp_thermal_cmd_params;
  1428. /**
  1429. * enum wma_cfg_cmd_id - wma cmd ids
  1430. * @WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID: txrx firmware stats enable command
  1431. * @WMA_VDEV_TXRX_FWSTATS_RESET_CMDID: txrx firmware stats reset command
  1432. * @WMA_VDEV_MCC_SET_TIME_LATENCY: set MCC latency time
  1433. * @WMA_VDEV_MCC_SET_TIME_QUOTA: set MCC time quota
  1434. * @WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE: set IBSS ATIM window size
  1435. * @WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED: set IBSS enable power save
  1436. * @WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED: set IBSS power collapse enable
  1437. * @WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX: awake IBSS on TX/RX
  1438. * @WMA_VDEV_IBSS_SET_INACTIVITY_TIME: set IBSS inactivity time
  1439. * @WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME: set IBSS TXSP
  1440. * @WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS: set IBSS power save warmup time
  1441. * @WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW: set IBSS power save ATIM
  1442. * @WMA_VDEV_DFS_CONTROL_CMDID: DFS control command
  1443. * @WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID: get IPA microcontroller fw stats
  1444. *
  1445. * wma command ids for configuration request which
  1446. * does not involve sending a wmi command.
  1447. */
  1448. enum wma_cfg_cmd_id {
  1449. WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID = WMI_CMDID_MAX,
  1450. WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
  1451. WMA_VDEV_MCC_SET_TIME_LATENCY,
  1452. WMA_VDEV_MCC_SET_TIME_QUOTA,
  1453. WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
  1454. WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
  1455. WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
  1456. WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
  1457. WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
  1458. WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
  1459. WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
  1460. WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
  1461. WMA_VDEV_DFS_CONTROL_CMDID,
  1462. WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
  1463. WMA_CMD_ID_MAX
  1464. };
  1465. /**
  1466. * struct wma_trigger_uapsd_params - trigger uapsd parameters
  1467. * @wmm_ac: wmm access catagory
  1468. * @user_priority: user priority
  1469. * @service_interval: service interval
  1470. * @suspend_interval: suspend interval
  1471. * @delay_interval: delay interval
  1472. */
  1473. typedef struct wma_trigger_uapsd_params {
  1474. uint32_t wmm_ac;
  1475. uint32_t user_priority;
  1476. uint32_t service_interval;
  1477. uint32_t suspend_interval;
  1478. uint32_t delay_interval;
  1479. } t_wma_trigger_uapsd_params, *tp_wma_trigger_uapsd_params;
  1480. /**
  1481. * enum uapsd_peer_param_max_sp - U-APSD maximum service period of peer station
  1482. * @UAPSD_MAX_SP_LEN_UNLIMITED: unlimited max service period
  1483. * @UAPSD_MAX_SP_LEN_2: max service period = 2
  1484. * @UAPSD_MAX_SP_LEN_4: max service period = 4
  1485. * @UAPSD_MAX_SP_LEN_6: max service period = 6
  1486. */
  1487. enum uapsd_peer_param_max_sp {
  1488. UAPSD_MAX_SP_LEN_UNLIMITED = 0,
  1489. UAPSD_MAX_SP_LEN_2 = 2,
  1490. UAPSD_MAX_SP_LEN_4 = 4,
  1491. UAPSD_MAX_SP_LEN_6 = 6
  1492. };
  1493. /**
  1494. * enum uapsd_peer_param_enabled_ac - U-APSD Enabled AC's of peer station
  1495. * @UAPSD_VO_ENABLED: enable uapsd for voice
  1496. * @UAPSD_VI_ENABLED: enable uapsd for video
  1497. * @UAPSD_BK_ENABLED: enable uapsd for background
  1498. * @UAPSD_BE_ENABLED: enable uapsd for best effort
  1499. */
  1500. enum uapsd_peer_param_enabled_ac {
  1501. UAPSD_VO_ENABLED = 0x01,
  1502. UAPSD_VI_ENABLED = 0x02,
  1503. UAPSD_BK_ENABLED = 0x04,
  1504. UAPSD_BE_ENABLED = 0x08
  1505. };
  1506. /**
  1507. * enum profile_id_t - Firmware profiling index
  1508. * @PROF_CPU_IDLE: cpu idle profile
  1509. * @PROF_PPDU_PROC: ppdu processing profile
  1510. * @PROF_PPDU_POST: ppdu post profile
  1511. * @PROF_HTT_TX_INPUT: htt tx input profile
  1512. * @PROF_MSDU_ENQ: msdu enqueue profile
  1513. * @PROF_PPDU_POST_HAL: ppdu post profile
  1514. * @PROF_COMPUTE_TX_TIME: tx time profile
  1515. * @PROF_MAX_ID: max profile index
  1516. */
  1517. enum profile_id_t {
  1518. PROF_CPU_IDLE,
  1519. PROF_PPDU_PROC,
  1520. PROF_PPDU_POST,
  1521. PROF_HTT_TX_INPUT,
  1522. PROF_MSDU_ENQ,
  1523. PROF_PPDU_POST_HAL,
  1524. PROF_COMPUTE_TX_TIME,
  1525. PROF_MAX_ID,
  1526. };
  1527. /**
  1528. * struct p2p_ie - P2P IE structural definition.
  1529. * @p2p_id: p2p id
  1530. * @p2p_len: p2p length
  1531. * @p2p_oui: p2p OUI
  1532. * @p2p_oui_type: p2p OUI type
  1533. */
  1534. struct p2p_ie {
  1535. uint8_t p2p_id;
  1536. uint8_t p2p_len;
  1537. uint8_t p2p_oui[3];
  1538. uint8_t p2p_oui_type;
  1539. } __packed;
  1540. /**
  1541. * struct p2p_noa_descriptor - noa descriptor
  1542. * @type_count: 255: continuous schedule, 0: reserved
  1543. * @duration: Absent period duration in micro seconds
  1544. * @interval: Absent period interval in micro seconds
  1545. * @start_time: 32 bit tsf time when in starts
  1546. */
  1547. struct p2p_noa_descriptor {
  1548. uint8_t type_count;
  1549. uint32_t duration;
  1550. uint32_t interval;
  1551. uint32_t start_time;
  1552. } __packed;
  1553. /**
  1554. * struct p2p_sub_element_noa - p2p noa element
  1555. * @p2p_sub_id: p2p sub id
  1556. * @p2p_sub_len: p2p sub length
  1557. * @index: identifies instance of NOA su element
  1558. * @oppPS: oppPS state of the AP
  1559. * @ctwindow: ctwindow in TUs
  1560. * @num_descriptors: number of NOA descriptors
  1561. * @noa_descriptors: noa descriptors
  1562. */
  1563. struct p2p_sub_element_noa {
  1564. uint8_t p2p_sub_id;
  1565. uint8_t p2p_sub_len;
  1566. uint8_t index; /* identifies instance of NOA su element */
  1567. uint8_t oppPS:1, /* oppPS state of the AP */
  1568. ctwindow:7; /* ctwindow in TUs */
  1569. uint8_t num_descriptors; /* number of NOA descriptors */
  1570. struct p2p_noa_descriptor noa_descriptors[WMA_MAX_NOA_DESCRIPTORS];
  1571. };
  1572. /**
  1573. * struct wma_decap_info_t - decapsulation info
  1574. * @hdr: header
  1575. * @hdr_len: header length
  1576. */
  1577. struct wma_decap_info_t {
  1578. uint8_t hdr[sizeof(struct ieee80211_qosframe_addr4)];
  1579. int32_t hdr_len;
  1580. };
  1581. /**
  1582. * enum packet_power_save - packet power save params
  1583. * @WMI_VDEV_PPS_PAID_MATCH: paid match param
  1584. * @WMI_VDEV_PPS_GID_MATCH: gid match param
  1585. * @WMI_VDEV_PPS_EARLY_TIM_CLEAR: early tim clear param
  1586. * @WMI_VDEV_PPS_EARLY_DTIM_CLEAR: early dtim clear param
  1587. * @WMI_VDEV_PPS_EOF_PAD_DELIM: eof pad delim param
  1588. * @WMI_VDEV_PPS_MACADDR_MISMATCH: macaddr mismatch param
  1589. * @WMI_VDEV_PPS_DELIM_CRC_FAIL: delim CRC fail param
  1590. * @WMI_VDEV_PPS_GID_NSTS_ZERO: gid nsts zero param
  1591. * @WMI_VDEV_PPS_RSSI_CHECK: RSSI check param
  1592. * @WMI_VDEV_PPS_5G_EBT: 5G ebt param
  1593. */
  1594. typedef enum {
  1595. WMI_VDEV_PPS_PAID_MATCH = 0,
  1596. WMI_VDEV_PPS_GID_MATCH = 1,
  1597. WMI_VDEV_PPS_EARLY_TIM_CLEAR = 2,
  1598. WMI_VDEV_PPS_EARLY_DTIM_CLEAR = 3,
  1599. WMI_VDEV_PPS_EOF_PAD_DELIM = 4,
  1600. WMI_VDEV_PPS_MACADDR_MISMATCH = 5,
  1601. WMI_VDEV_PPS_DELIM_CRC_FAIL = 6,
  1602. WMI_VDEV_PPS_GID_NSTS_ZERO = 7,
  1603. WMI_VDEV_PPS_RSSI_CHECK = 8,
  1604. WMI_VDEV_VHT_SET_GID_MGMT = 9,
  1605. WMI_VDEV_PPS_5G_EBT = 10
  1606. } packet_power_save;
  1607. /**
  1608. * enum green_tx_param - green tx parameters
  1609. * @WMI_VDEV_PARAM_GTX_HT_MCS: ht mcs param
  1610. * @WMI_VDEV_PARAM_GTX_VHT_MCS: vht mcs param
  1611. * @WMI_VDEV_PARAM_GTX_USR_CFG: user cfg param
  1612. * @WMI_VDEV_PARAM_GTX_THRE: thre param
  1613. * @WMI_VDEV_PARAM_GTX_MARGIN: green tx margin param
  1614. * @WMI_VDEV_PARAM_GTX_STEP: green tx step param
  1615. * @WMI_VDEV_PARAM_GTX_MINTPC: mintpc param
  1616. * @WMI_VDEV_PARAM_GTX_BW_MASK: bandwidth mask
  1617. */
  1618. typedef enum {
  1619. WMI_VDEV_PARAM_GTX_HT_MCS,
  1620. WMI_VDEV_PARAM_GTX_VHT_MCS,
  1621. WMI_VDEV_PARAM_GTX_USR_CFG,
  1622. WMI_VDEV_PARAM_GTX_THRE,
  1623. WMI_VDEV_PARAM_GTX_MARGIN,
  1624. WMI_VDEV_PARAM_GTX_STEP,
  1625. WMI_VDEV_PARAM_GTX_MINTPC,
  1626. WMI_VDEV_PARAM_GTX_BW_MASK,
  1627. } green_tx_param;
  1628. #ifdef FEATURE_WLAN_TDLS
  1629. /**
  1630. * struct wma_tdls_params - TDLS parameters
  1631. * @vdev_id: vdev id
  1632. * @tdls_state: TDLS state
  1633. * @notification_interval_ms: notification inerval
  1634. * @tx_discovery_threshold: tx discovery threshold
  1635. * @tx_teardown_threshold: tx teardown threashold
  1636. * @rssi_teardown_threshold: RSSI teardown threshold
  1637. * @rssi_delta: RSSI delta
  1638. * @tdls_options: TDLS options
  1639. * @peer_traffic_ind_window: raffic indication window
  1640. * @peer_traffic_response_timeout: traffic response timeout
  1641. * @puapsd_mask: uapsd mask
  1642. * @puapsd_inactivity_time: uapsd inactivity time
  1643. * @puapsd_rx_frame_threshold: uapsd rx frame threshold
  1644. * @teardown_notification_ms: tdls teardown notification interval
  1645. * @tdls_peer_kickout_threshold: tdls packet threshold for
  1646. * peer kickout operation
  1647. */
  1648. typedef struct wma_tdls_params {
  1649. uint32_t vdev_id;
  1650. uint32_t tdls_state;
  1651. uint32_t notification_interval_ms;
  1652. uint32_t tx_discovery_threshold;
  1653. uint32_t tx_teardown_threshold;
  1654. int32_t rssi_teardown_threshold;
  1655. int32_t rssi_delta;
  1656. uint32_t tdls_options;
  1657. uint32_t peer_traffic_ind_window;
  1658. uint32_t peer_traffic_response_timeout;
  1659. uint32_t puapsd_mask;
  1660. uint32_t puapsd_inactivity_time;
  1661. uint32_t puapsd_rx_frame_threshold;
  1662. uint32_t teardown_notification_ms;
  1663. uint32_t tdls_peer_kickout_threshold;
  1664. } t_wma_tdls_params;
  1665. /**
  1666. * struct wma_tdls_peer_event - TDLS peer event
  1667. * @vdev_id: vdev id
  1668. * @peer_macaddr: peer MAC address
  1669. * @peer_status: TDLS peer status
  1670. * @peer_reason: TDLS peer reason
  1671. */
  1672. typedef struct {
  1673. A_UINT32 vdev_id;
  1674. wmi_mac_addr peer_macaddr;
  1675. A_UINT32 peer_status;
  1676. A_UINT32 peer_reason;
  1677. } wma_tdls_peer_event;
  1678. #endif /* FEATURE_WLAN_TDLS */
  1679. /**
  1680. * struct wma_dfs_radar_channel_list - dfs radar channel list
  1681. * @nchannels: nuber of channels
  1682. * @channels: Channel number including bonded channels on which
  1683. * radar is present
  1684. */
  1685. struct wma_dfs_radar_channel_list {
  1686. A_UINT32 nchannels;
  1687. uint8_t channels[WMA_DFS_MAX_20M_SUB_CH];
  1688. };
  1689. /**
  1690. * struct wma_dfs_radar_indication - Structure to indicate RADAR
  1691. * @vdev_id: vdev id
  1692. * @chan_list: Channel list on which RADAR is detected
  1693. * @dfs_radar_status: Flag to Indicate RADAR presence on the current channel
  1694. * @use_nol: Flag to indicate use NOL
  1695. */
  1696. struct wma_dfs_radar_indication {
  1697. A_UINT32 vdev_id;
  1698. struct wma_dfs_radar_channel_list chan_list;
  1699. uint32_t dfs_radar_status;
  1700. int use_nol;
  1701. };
  1702. /**
  1703. * enum uapsd_ac - U-APSD Access Categories
  1704. * @UAPSD_BE: best effort
  1705. * @UAPSD_BK: back ground
  1706. * @UAPSD_VI: video
  1707. * @UAPSD_VO: voice
  1708. */
  1709. enum uapsd_ac {
  1710. UAPSD_BE,
  1711. UAPSD_BK,
  1712. UAPSD_VI,
  1713. UAPSD_VO
  1714. };
  1715. QDF_STATUS wma_disable_uapsd_per_ac(tp_wma_handle wma_handle,
  1716. uint32_t vdev_id, enum uapsd_ac ac);
  1717. /**
  1718. * enum uapsd_up - U-APSD User Priorities
  1719. * @UAPSD_UP_BE: best effort
  1720. * @UAPSD_UP_BK: back ground
  1721. * @UAPSD_UP_RESV: reserve
  1722. * @UAPSD_UP_EE: Excellent Effort
  1723. * @UAPSD_UP_CL: Critical Applications
  1724. * @UAPSD_UP_VI: video
  1725. * @UAPSD_UP_VO: voice
  1726. * @UAPSD_UP_NC: Network Control
  1727. */
  1728. enum uapsd_up {
  1729. UAPSD_UP_BE,
  1730. UAPSD_UP_BK,
  1731. UAPSD_UP_RESV,
  1732. UAPSD_UP_EE,
  1733. UAPSD_UP_CL,
  1734. UAPSD_UP_VI,
  1735. UAPSD_UP_VO,
  1736. UAPSD_UP_NC,
  1737. UAPSD_UP_MAX
  1738. };
  1739. /**
  1740. * struct wma_unit_test_cmd - unit test command parameters
  1741. * @vdev_id: vdev id
  1742. * @module_id: module id
  1743. * @num_args: number of arguments
  1744. * @args: arguments
  1745. */
  1746. typedef struct wma_unit_test_cmd {
  1747. uint32_t vdev_id;
  1748. WLAN_MODULE_ID module_id;
  1749. uint32_t num_args;
  1750. uint32_t args[WMA_MAX_NUM_ARGS];
  1751. } t_wma_unit_test_cmd;
  1752. /**
  1753. * struct wma_roam_invoke_cmd - roam invoke command
  1754. * @vdev_id: vdev id
  1755. * @bssid: mac address
  1756. * @channel: channel
  1757. */
  1758. struct wma_roam_invoke_cmd {
  1759. uint32_t vdev_id;
  1760. uint8_t bssid[IEEE80211_ADDR_LEN];
  1761. uint32_t channel;
  1762. };
  1763. /**
  1764. * struct wma_process_fw_event_params - fw event parameters
  1765. * @wmi_handle: wmi handle
  1766. * @evt_buf: event buffer
  1767. */
  1768. typedef struct {
  1769. void *wmi_handle;
  1770. void *evt_buf;
  1771. } wma_process_fw_event_params;
  1772. int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx);
  1773. A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
  1774. eCsrEncryptionType encr);
  1775. A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
  1776. /*
  1777. * WMA-DFS Hooks
  1778. */
  1779. int ol_if_dfs_attach(struct ieee80211com *ic, void *ptr, void *radar_info);
  1780. uint64_t ol_if_get_tsf64(struct ieee80211com *ic);
  1781. int ol_if_dfs_disable(struct ieee80211com *ic);
  1782. struct dfs_ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
  1783. int freq, uint32_t flags);
  1784. int ol_if_dfs_enable(struct ieee80211com *ic, int *is_fastclk, void *pe);
  1785. uint32_t ieee80211_ieee2mhz(uint32_t chan, uint32_t flags);
  1786. int ol_if_dfs_get_ext_busy(struct ieee80211com *ic);
  1787. int ol_if_dfs_get_mib_cycle_counts_pct(struct ieee80211com *ic,
  1788. uint32_t *rxc_pcnt, uint32_t *rxf_pcnt,
  1789. uint32_t *txf_pcnt);
  1790. uint16_t ol_if_dfs_usenol(struct ieee80211com *ic);
  1791. void ieee80211_mark_dfs(struct ieee80211com *ic,
  1792. struct dfs_ieee80211_channel *ichan);
  1793. int wma_dfs_indicate_radar(struct ieee80211com *ic,
  1794. struct dfs_ieee80211_channel *ichan);
  1795. uint16_t dfs_usenol(struct ieee80211com *ic);
  1796. QDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,
  1797. tp_wma_trigger_uapsd_params
  1798. trigger_uapsd_params);
  1799. /* added to get average snr for both data and beacon */
  1800. QDF_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq);
  1801. QDF_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, uint8_t vdev_id,
  1802. ol_txrx_vdev_handle tx_rx_vdev_handle,
  1803. uint8_t *mac, uint32_t vdev_type, bool add_del);
  1804. void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle);
  1805. void wma_log_completion_timeout(void *data);
  1806. QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
  1807. struct rssi_monitor_req *req);
  1808. QDF_STATUS wma_send_soc_set_pcl_cmd(tp_wma_handle wma_handle,
  1809. struct sir_pcl_list *msg);
  1810. QDF_STATUS wma_send_soc_set_hw_mode_cmd(tp_wma_handle wma_handle,
  1811. struct sir_hw_mode *msg);
  1812. QDF_STATUS wma_get_scan_id(uint32_t *scan_id);
  1813. QDF_STATUS wma_send_soc_set_dual_mac_config(tp_wma_handle wma_handle,
  1814. struct sir_dual_mac_config *msg);
  1815. QDF_STATUS wma_send_pdev_set_antenna_mode(tp_wma_handle wma_handle,
  1816. struct sir_antenna_mode_param *msg);
  1817. QDF_STATUS wma_crash_inject(tp_wma_handle wma_handle, uint32_t type,
  1818. uint32_t delay_time_ms);
  1819. struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
  1820. uint8_t vdev_id,
  1821. uint32_t msg_type, uint8_t type,
  1822. void *params, uint32_t timeout);
  1823. struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
  1824. uint8_t vdev_id, uint32_t msg_type,
  1825. uint8_t type, void *params,
  1826. uint32_t timeout);
  1827. QDF_STATUS wma_vdev_start(tp_wma_handle wma,
  1828. struct wma_vdev_start_req *req, bool isRestart);
  1829. void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
  1830. uint8_t type);
  1831. int wmi_desc_pool_init(tp_wma_handle wma_handle, uint32_t pool_size);
  1832. void wmi_desc_pool_deinit(tp_wma_handle wma_handle);
  1833. struct wmi_desc_t *wmi_desc_get(tp_wma_handle wma_handle);
  1834. void wmi_desc_put(tp_wma_handle wma_handle, struct wmi_desc_t *wmi_desc);
  1835. int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
  1836. uint32_t len);
  1837. void wma_set_dfs_region(tp_wma_handle wma, uint8_t dfs_region);
  1838. uint32_t wma_get_vht_ch_width(void);
  1839. QDF_STATUS
  1840. wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
  1841. A_UINT32 val, A_UINT32 *module_id_bitmap,
  1842. A_UINT32 bitmap_len);
  1843. #ifdef FEATURE_LFR_SUBNET_DETECTION
  1844. QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
  1845. struct gateway_param_update_req *req);
  1846. #else
  1847. static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
  1848. struct gateway_param_update_req *req)
  1849. {
  1850. return QDF_STATUS_SUCCESS;
  1851. }
  1852. #endif /* FEATURE_LFR_SUBNET_DETECTION */
  1853. #if defined(FEATURE_LRO)
  1854. QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
  1855. struct wma_lro_config_cmd_t *wma_lro_cmd);
  1856. #else
  1857. static inline QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
  1858. struct wma_lro_config_cmd_t *wma_lro_cmd)
  1859. {
  1860. return QDF_STATUS_SUCCESS;
  1861. }
  1862. #endif
  1863. void
  1864. wma_indicate_err(enum ol_rx_err_type err_type,
  1865. struct ol_error_info *err_info);
  1866. QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma_handle,
  1867. int32_t vdev_id);
  1868. QDF_STATUS wma_send_ht40_obss_scanind(tp_wma_handle wma,
  1869. struct obss_ht40_scanind *req);
  1870. #endif
  1871. struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle);