wma.h 62 KB

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