wma.h 67 KB

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