wma.h 62 KB

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