target_if_spectral.h 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079
  1. /*
  2. * Copyright (c) 2011,2017-2020 The Linux Foundation. All rights reserved.
  3. *
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef _TARGET_IF_SPECTRAL_H_
  20. #define _TARGET_IF_SPECTRAL_H_
  21. #include <wlan_objmgr_cmn.h>
  22. #include <wlan_objmgr_psoc_obj.h>
  23. #include <wlan_objmgr_pdev_obj.h>
  24. #include <wlan_objmgr_vdev_obj.h>
  25. #include <qdf_lock.h>
  26. #include <wlan_spectral_public_structs.h>
  27. #include <reg_services_public_struct.h>
  28. #ifdef DIRECT_BUF_RX_ENABLE
  29. #include <target_if_direct_buf_rx_api.h>
  30. #endif
  31. #ifdef WIN32
  32. #pragma pack(push, target_if_spectral, 1)
  33. #define __ATTRIB_PACK
  34. #else
  35. #ifndef __ATTRIB_PACK
  36. #define __ATTRIB_PACK __attribute__ ((packed))
  37. #endif
  38. #endif
  39. #include <spectral_defs_i.h>
  40. #define FREQ_OFFSET_10MHZ 10
  41. #ifndef SPECTRAL_USE_NL_BCAST
  42. #define SPECTRAL_USE_NL_BCAST (0)
  43. #endif
  44. #define STATUS_PASS 1
  45. #define STATUS_FAIL 0
  46. #undef spectral_dbg_line
  47. #define spectral_dbg_line() \
  48. spectral_debug("----------------------------------------------------")
  49. #undef spectral_ops_not_registered
  50. #define spectral_ops_not_registered(str) \
  51. spectral_info("SPECTRAL : %s not registered\n", (str))
  52. #undef not_yet_implemented
  53. #define not_yet_implemented() \
  54. spectral_info("SPECTRAL : %s : %d Not yet implemented\n", \
  55. __func__, __LINE__)
  56. #define SPECTRAL_HT20_NUM_BINS 56
  57. #define SPECTRAL_HT20_FFT_LEN 56
  58. #define SPECTRAL_HT20_DC_INDEX (SPECTRAL_HT20_FFT_LEN / 2)
  59. #define SPECTRAL_HT20_DATA_LEN 60
  60. #define SPECTRAL_HT20_TOTAL_DATA_LEN (SPECTRAL_HT20_DATA_LEN + 3)
  61. #define SPECTRAL_HT40_TOTAL_NUM_BINS 128
  62. #define SPECTRAL_HT40_DATA_LEN 135
  63. #define SPECTRAL_HT40_TOTAL_DATA_LEN (SPECTRAL_HT40_DATA_LEN + 3)
  64. #define SPECTRAL_HT40_FFT_LEN 128
  65. #define SPECTRAL_HT40_DC_INDEX (SPECTRAL_HT40_FFT_LEN / 2)
  66. /*
  67. * Used for the SWAR to obtain approximate combined rssi
  68. * in secondary 80Mhz segment
  69. */
  70. #define OFFSET_CH_WIDTH_20 65
  71. #define OFFSET_CH_WIDTH_40 62
  72. #define OFFSET_CH_WIDTH_80 56
  73. #define OFFSET_CH_WIDTH_160 50
  74. /* Min and max for relevant Spectral params */
  75. #define SPECTRAL_PARAM_FFT_SIZE_MIN_GEN2 (1)
  76. #define SPECTRAL_PARAM_FFT_SIZE_MAX_GEN2 (9)
  77. #define SPECTRAL_PARAM_FFT_SIZE_MIN_GEN3 (5)
  78. #define SPECTRAL_PARAM_FFT_SIZE_MAX_GEN3_DEFAULT (9)
  79. #define SPECTRAL_PARAM_FFT_SIZE_MAX_GEN3_QCN9000 (10)
  80. #define SPECTRAL_PARAM_RPT_MODE_MIN (0)
  81. #define SPECTRAL_PARAM_RPT_MODE_MAX (3)
  82. /* DBR ring debug size for Spectral */
  83. #define SPECTRAL_DBR_RING_DEBUG_SIZE 512
  84. #ifdef BIG_ENDIAN_HOST
  85. #define SPECTRAL_MESSAGE_COPY_CHAR_ARRAY(destp, srcp, len) do { \
  86. int j; \
  87. uint32_t *src, *dest; \
  88. src = (uint32_t *)(srcp); \
  89. dest = (uint32_t *)(destp); \
  90. for (j = 0; j < roundup((len), sizeof(uint32_t)) / 4; j++) { \
  91. *(dest + j) = qdf_le32_to_cpu(*(src + j)); \
  92. } \
  93. } while (0)
  94. #else
  95. #define SPECTRAL_MESSAGE_COPY_CHAR_ARRAY(destp, srcp, len) \
  96. OS_MEMCPY((destp), (srcp), (len));
  97. #endif
  98. #define DUMMY_NF_VALUE (-123)
  99. /* 5 categories x (lower + upper) bands */
  100. #define MAX_INTERF 10
  101. #define HOST_MAX_ANTENNA 3
  102. /* Mask for time stamp from descriptor */
  103. #define SPECTRAL_TSMASK 0xFFFFFFFF
  104. #define SPECTRAL_SIGNATURE 0xdeadbeef
  105. /* Signature to write onto spectral buffer and then later validate */
  106. #define MEM_POISON_SIGNATURE (htobe32(0xdeadbeef))
  107. /* START of spectral GEN II HW specific details */
  108. #define SPECTRAL_PHYERR_SIGNATURE_GEN2 0xbb
  109. #define TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN2 0xF9
  110. #define TLV_TAG_ADC_REPORT_GEN2 0xFA
  111. #define TLV_TAG_SEARCH_FFT_REPORT_GEN2 0xFB
  112. /**
  113. * enum spectral_160mhz_report_delivery_state - 160 MHz state machine states
  114. * @SPECTRAL_REPORT_WAIT_PRIMARY80: Wait for primary80 report
  115. * @SPECTRAL_REPORT_RX_PRIMARY80: Receive primary 80 report
  116. * @SPECTRAL_REPORT_WAIT_SECONDARY80: Wait for secondory 80 report
  117. * @SPECTRAL_REPORT_RX_SECONDARY80: Receive secondary 80 report
  118. */
  119. enum spectral_160mhz_report_delivery_state {
  120. SPECTRAL_REPORT_WAIT_PRIMARY80,
  121. SPECTRAL_REPORT_RX_PRIMARY80,
  122. SPECTRAL_REPORT_WAIT_SECONDARY80,
  123. SPECTRAL_REPORT_RX_SECONDARY80,
  124. };
  125. /**
  126. * enum spectral_detector_id - Spectral detector id
  127. * @SPECTRAL_DETECTOR_PRIMARY: Primary detector
  128. * @SPECTRAL_DETECTOR_SECONDARY: Secondary detector
  129. * @SPECTRAL_DETECTOR_AGILE: Agile detector
  130. * @SPECTRAL_DETECTOR_INVALID: Invalid detector
  131. */
  132. enum spectral_detector_id {
  133. SPECTRAL_DETECTOR_PRIMARY,
  134. SPECTRAL_DETECTOR_SECONDARY,
  135. SPECTRAL_DETECTOR_AGILE,
  136. SPECTRAL_DETECTOR_INVALID,
  137. };
  138. /**
  139. * struct spectral_search_fft_info_gen2 - spectral search fft report for gen2
  140. * @relpwr_db: Total bin power in db
  141. * @num_str_bins_ib: Number of strong bins
  142. * @base_pwr: Base power
  143. * @total_gain_info: Total gain
  144. * @fft_chn_idx: FFT chain on which report is originated
  145. * @avgpwr_db: Average power in db
  146. * @peak_mag: Peak power seen in the bins
  147. * @peak_inx: Index of bin holding peak power
  148. */
  149. struct spectral_search_fft_info_gen2 {
  150. uint32_t relpwr_db;
  151. uint32_t num_str_bins_ib;
  152. uint32_t base_pwr;
  153. uint32_t total_gain_info;
  154. uint32_t fft_chn_idx;
  155. uint32_t avgpwr_db;
  156. uint32_t peak_mag;
  157. int16_t peak_inx;
  158. };
  159. /*
  160. * XXX Check if we should be handling the endinness difference in some
  161. * other way opaque to the host
  162. */
  163. #ifdef BIG_ENDIAN_HOST
  164. /**
  165. * struct spectral_phyerr_tlv_gen2 - phyerr tlv info for big endian host
  166. * @signature: signature
  167. * @tag: tag
  168. * @length: length
  169. */
  170. struct spectral_phyerr_tlv_gen2 {
  171. uint8_t signature;
  172. uint8_t tag;
  173. uint16_t length;
  174. } __ATTRIB_PACK;
  175. #else
  176. /**
  177. * struct spectral_phyerr_tlv_gen2 - phyerr tlv info for little endian host
  178. * @length: length
  179. * @tag: tag
  180. * @signature: signature
  181. */
  182. struct spectral_phyerr_tlv_gen2 {
  183. uint16_t length;
  184. uint8_t tag;
  185. uint8_t signature;
  186. } __ATTRIB_PACK;
  187. #endif /* BIG_ENDIAN_HOST */
  188. /**
  189. * struct spectral_phyerr_hdr_gen2 - phyerr header for gen2 HW
  190. * @hdr_a: Header[0:31]
  191. * @hdr_b: Header[32:63]
  192. */
  193. struct spectral_phyerr_hdr_gen2 {
  194. uint32_t hdr_a;
  195. uint32_t hdr_b;
  196. };
  197. /*
  198. * Segment ID information for 80+80.
  199. *
  200. * If the HW micro-architecture specification extends this DWORD for other
  201. * purposes, then redefine+rename accordingly. For now, the specification
  202. * mentions only segment ID (though this doesn't require an entire DWORD)
  203. * without mention of any generic terminology for the DWORD, or any reservation.
  204. * We use nomenclature accordingly.
  205. */
  206. typedef uint32_t SPECTRAL_SEGID_INFO;
  207. /**
  208. * struct spectral_phyerr_fft_gen2 - fft info in phyerr event
  209. * @buf: fft report
  210. */
  211. struct spectral_phyerr_fft_gen2 {
  212. uint8_t buf[0];
  213. };
  214. /* END of spectral GEN II HW specific details */
  215. /* START of spectral GEN III HW specific details */
  216. #define get_bitfield(value, size, pos) \
  217. (((value) >> (pos)) & ((1 << (size)) - 1))
  218. #define unsigned_to_signed(value, width) \
  219. (((value) >= (1 << ((width) - 1))) ? \
  220. (value - (1 << (width))) : (value))
  221. #define SSCAN_SUMMARY_REPORT_HDR_A_DETECTOR_ID_POS_GEN3 (29)
  222. #define SSCAN_SUMMARY_REPORT_HDR_A_DETECTOR_ID_SIZE_GEN3 (2)
  223. #define SSCAN_SUMMARY_REPORT_HDR_A_AGC_TOTAL_GAIN_POS_GEN3 (0)
  224. #define SSCAN_SUMMARY_REPORT_HDR_A_AGC_TOTAL_GAIN_SIZE_GEN3 (8)
  225. #define SSCAN_SUMMARY_REPORT_HDR_A_INBAND_PWR_DB_POS_GEN3 (18)
  226. #define SSCAN_SUMMARY_REPORT_HDR_A_INBAND_PWR_DB_SIZE_GEN3 (10)
  227. #define SSCAN_SUMMARY_REPORT_HDR_A_PRI80_POS_GEN3 (31)
  228. #define SSCAN_SUMMARY_REPORT_HDR_A_PRI80_SIZE_GEN3 (1)
  229. #define SSCAN_SUMMARY_REPORT_HDR_B_GAINCHANGE_POS_GEN3_V1 (30)
  230. #define SSCAN_SUMMARY_REPORT_HDR_B_GAINCHANGE_SIZE_GEN3_V1 (1)
  231. #define SSCAN_SUMMARY_REPORT_HDR_C_GAINCHANGE_POS_GEN3_V2 (16)
  232. #define SSCAN_SUMMARY_REPORT_HDR_C_GAINCHANGE_SIZE_GEN3_V2 (1)
  233. #define SPECTRAL_PHYERR_SIGNATURE_GEN3 (0xFA)
  234. #define TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN3 (0x02)
  235. #define TLV_TAG_SEARCH_FFT_REPORT_GEN3 (0x03)
  236. #define SPECTRAL_PHYERR_TLVSIZE_GEN3 (4)
  237. #define FFT_REPORT_HEADER_LENGTH_GEN3_V2 (24)
  238. #define FFT_REPORT_HEADER_LENGTH_GEN3_V1 (16)
  239. #define NUM_PADDING_BYTES_SSCAN_SUMARY_REPORT_GEN3_V1 (0)
  240. #define NUM_PADDING_BYTES_SSCAN_SUMARY_REPORT_GEN3_V2 (16)
  241. #define PHYERR_HDR_SIG_POS \
  242. (offsetof(struct spectral_phyerr_fft_report_gen3, fft_hdr_sig))
  243. #define PHYERR_HDR_TAG_POS \
  244. (offsetof(struct spectral_phyerr_fft_report_gen3, fft_hdr_tag))
  245. #define SPECTRAL_FFT_BINS_POS \
  246. (offsetof(struct spectral_phyerr_fft_report_gen3, buf))
  247. /**
  248. * struct phyerr_info - spectral search fft report for gen3
  249. * @data: handle to phyerror buffer
  250. * @datalen: length of phyerror bufer
  251. * @p_rfqual: rf quality matrices
  252. * @p_chaninfo: pointer to chaninfo
  253. * @tsf64: 64 bit TSF
  254. * @acs_stats: acs stats
  255. */
  256. struct phyerr_info {
  257. uint8_t *data;
  258. uint32_t datalen;
  259. struct target_if_spectral_rfqual_info *p_rfqual;
  260. struct target_if_spectral_chan_info *p_chaninfo;
  261. uint64_t tsf64;
  262. struct target_if_spectral_acs_stats *acs_stats;
  263. };
  264. /**
  265. * struct spectral_search_fft_info_gen3 - spectral search fft report for gen3
  266. * @timestamp: Timestamp at which fft report was generated
  267. * @fft_detector_id: Which radio generated this report
  268. * @fft_num: The FFT count number. Set to 0 for short FFT.
  269. * @fft_radar_check: NA for spectral
  270. * @fft_peak_sidx: Index of bin with maximum power
  271. * @fft_chn_idx: Rx chain index
  272. * @fft_base_pwr_db: Base power in dB
  273. * @fft_total_gain_db: Total gain in dB
  274. * @fft_num_str_bins_ib: Number of strong bins in the report
  275. * @fft_peak_mag: Peak magnitude
  276. * @fft_avgpwr_db: Average power in dB
  277. * @fft_relpwr_db: Relative power in dB
  278. */
  279. struct spectral_search_fft_info_gen3 {
  280. uint32_t timestamp;
  281. uint32_t fft_detector_id;
  282. uint32_t fft_num;
  283. uint32_t fft_radar_check;
  284. int32_t fft_peak_sidx;
  285. uint32_t fft_chn_idx;
  286. uint32_t fft_base_pwr_db;
  287. uint32_t fft_total_gain_db;
  288. uint32_t fft_num_str_bins_ib;
  289. int32_t fft_peak_mag;
  290. uint32_t fft_avgpwr_db;
  291. uint32_t fft_relpwr_db;
  292. };
  293. /**
  294. * struct spectral_phyerr_sfftreport_gen3 - fft info in phyerr event
  295. * @fft_timestamp: Timestamp at which fft report was generated
  296. * @fft_hdr_sig: signature
  297. * @fft_hdr_tag: tag
  298. * @fft_hdr_length: length
  299. * @hdr_a: Header[0:31]
  300. * @hdr_b: Header[32:63]
  301. * @hdr_c: Header[64:95]
  302. * @resv: Header[96:127]
  303. * @buf: fft bins
  304. */
  305. struct spectral_phyerr_fft_report_gen3 {
  306. uint32_t fft_timestamp;
  307. #ifdef BIG_ENDIAN_HOST
  308. uint8_t fft_hdr_sig;
  309. uint8_t fft_hdr_tag;
  310. uint16_t fft_hdr_length;
  311. #else
  312. uint16_t fft_hdr_length;
  313. uint8_t fft_hdr_tag;
  314. uint8_t fft_hdr_sig;
  315. #endif /* BIG_ENDIAN_HOST */
  316. uint32_t hdr_a;
  317. uint32_t hdr_b;
  318. uint32_t hdr_c;
  319. uint32_t resv;
  320. uint8_t buf[0];
  321. } __ATTRIB_PACK;
  322. /**
  323. * struct sscan_report_fields_gen3 - Fields of spectral report
  324. * @sscan_agc_total_gain: The AGC total gain in DB.
  325. * @inband_pwr_db: The in-band power of the signal in 1/2 DB steps
  326. * @sscan_gainchange: This bit is set to 1 if a gainchange occurred during
  327. * the spectral scan FFT. Software may choose to
  328. * disregard the results.
  329. * @sscan_pri80: This is set to 1 to indicate that the Spectral scan was
  330. * performed on the pri80 segment. Software may choose to
  331. * disregard the FFT sample if this is set to 1 but detector ID
  332. * does not correspond to the ID for the pri80 segment.
  333. */
  334. struct sscan_report_fields_gen3 {
  335. uint8_t sscan_agc_total_gain;
  336. int16_t inband_pwr_db;
  337. uint8_t sscan_gainchange;
  338. uint8_t sscan_pri80;
  339. };
  340. /**
  341. * struct spectral_sscan_summary_report_gen3 - Spectral summary report
  342. * event
  343. * @sscan_timestamp: Timestamp at which fft report was generated
  344. * @sscan_hdr_sig: signature
  345. * @sscan_hdr_tag: tag
  346. * @sscan_hdr_length: length
  347. * @hdr_a: Header[0:31]
  348. * @resv: Header[32:63]
  349. * @hdr_b: Header[64:95]
  350. * @hdr_c: Header[96:127]
  351. */
  352. struct spectral_sscan_summary_report_gen3 {
  353. u_int32_t sscan_timestamp;
  354. #ifdef BIG_ENDIAN_HOST
  355. u_int8_t sscan_hdr_sig;
  356. u_int8_t sscan_hdr_tag;
  357. u_int16_t sscan_hdr_length;
  358. #else
  359. u_int16_t sscan_hdr_length;
  360. u_int8_t sscan_hdr_tag;
  361. u_int8_t sscan_hdr_sig;
  362. #endif /* BIG_ENDIAN_HOST */
  363. u_int32_t hdr_a;
  364. u_int32_t res1;
  365. u_int32_t hdr_b;
  366. u_int32_t hdr_c;
  367. } __ATTRIB_PACK;
  368. #ifdef DIRECT_BUF_RX_ENABLE
  369. /**
  370. * struct Spectral_report - spectral report
  371. * @data: Report buffer
  372. * @noisefloor: Noise floor values
  373. * @reset_delay: Time taken for warm reset in us
  374. */
  375. struct spectral_report {
  376. uint8_t *data;
  377. int32_t noisefloor[DBR_MAX_CHAINS];
  378. uint32_t reset_delay;
  379. };
  380. #endif
  381. /* END of spectral GEN III HW specific details */
  382. typedef signed char pwr_dbm;
  383. /**
  384. * enum spectral_gen - spectral hw generation
  385. * @SPECTRAL_GEN1 : spectral hw gen 1
  386. * @SPECTRAL_GEN2 : spectral hw gen 2
  387. * @SPECTRAL_GEN3 : spectral hw gen 3
  388. */
  389. enum spectral_gen {
  390. SPECTRAL_GEN1,
  391. SPECTRAL_GEN2,
  392. SPECTRAL_GEN3,
  393. };
  394. /**
  395. * enum spectral_fftbin_size_war - spectral fft bin size war
  396. * @SPECTRAL_FFTBIN_SIZE_NO_WAR : No WAR applicable for Spectral FFT bin size
  397. * @SPECTRAL_FFTBIN_SIZE_2BYTE_TO_1BYTE : Spectral FFT bin size: Retain only
  398. * least significant byte from 2 byte
  399. * FFT bin transferred by HW
  400. * @SPECTRAL_FFTBIN_SIZE_4BYTE_TO_1BYTE : Spectral FFT bin size: Retain only
  401. * least significant byte from 4 byte
  402. * FFT bin transferred by HW
  403. */
  404. enum spectral_fftbin_size_war {
  405. SPECTRAL_FFTBIN_SIZE_NO_WAR = 0,
  406. SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE = 1,
  407. SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE = 2,
  408. };
  409. /**
  410. * enum spectral_report_format_version - This represents the report format
  411. * version number within each Spectral generation.
  412. * @SPECTRAL_REPORT_FORMAT_VERSION_1 : version 1
  413. * @SPECTRAL_REPORT_FORMAT_VERSION_2 : version 2
  414. */
  415. enum spectral_report_format_version {
  416. SPECTRAL_REPORT_FORMAT_VERSION_1,
  417. SPECTRAL_REPORT_FORMAT_VERSION_2,
  418. };
  419. /**
  420. * struct spectral_fft_bin_len_adj_swar - Encapsulate information required for
  421. * Spectral FFT bin length adjusting software WARS.
  422. * @inband_fftbin_size_adj: Whether to carry out FFT bin size adjustment for
  423. * in-band report format. This would be required on some chipsets under the
  424. * following circumstances: In report mode 2 only the in-band bins are DMA'ed.
  425. * Scatter/gather is used. However, the HW generates all bins, not just in-band,
  426. * and reports the number of bins accordingly. The subsystem arranging for the
  427. * DMA cannot change this value. On such chipsets the adjustment required at the
  428. * host driver is to check if report format is 2, and if so halve the number of
  429. * bins reported to get the number actually DMA'ed.
  430. * @null_fftbin_adj: Whether to remove NULL FFT bins for report mode (1) in
  431. * which only summary of metrics for each completed FFT + spectral scan summary
  432. * report are to be provided. This would be required on some chipsets under the
  433. * following circumstances: In report mode 1, HW reports a length corresponding
  434. * to all bins, and provides bins with value 0. This is because the subsystem
  435. * arranging for the FFT information does not arrange for DMA of FFT bin values
  436. * (as expected), but cannot arrange for a smaller length to be reported by HW.
  437. * In these circumstances, the driver would have to disregard the NULL bins and
  438. * report a bin count of 0 to higher layers.
  439. * @packmode_fftbin_size_adj: Pack mode in HW refers to packing of each Spectral
  440. * FFT bin into 2 bytes. But due to a bug HW reports 2 times the expected length
  441. * when packmode is enabled. This SWAR compensates this bug by dividing the
  442. * length with 2.
  443. * @fftbin_size_war: Type of FFT bin size SWAR
  444. */
  445. struct spectral_fft_bin_len_adj_swar {
  446. u_int8_t inband_fftbin_size_adj;
  447. u_int8_t null_fftbin_adj;
  448. uint8_t packmode_fftbin_size_adj;
  449. enum spectral_fftbin_size_war fftbin_size_war;
  450. };
  451. /**
  452. * struct spectral_report_params - Parameters related to format of Spectral
  453. * report.
  454. * @version: This represents the report format version number within each
  455. * Spectral generation.
  456. * @ssumaary_padding_bytes: Number of bytes of padding after Spectral summary
  457. * report
  458. * @fft_report_hdr_len: Number of bytes in the header of the FFT report. This
  459. * has to be subtracted from the length field of FFT report to find the length
  460. * of FFT bins.
  461. */
  462. struct spectral_report_params {
  463. enum spectral_report_format_version version;
  464. uint8_t ssumaary_padding_bytes;
  465. uint8_t fft_report_hdr_len;
  466. };
  467. /**
  468. * struct spectral_param_min_max - Spectral parameter minimum and maximum values
  469. * @fft_size_min: Minimum value of fft_size
  470. * @fft_size_max: Maximum value of fft_size for each BW
  471. */
  472. struct spectral_param_min_max {
  473. uint16_t fft_size_min;
  474. uint16_t fft_size_max[CH_WIDTH_MAX];
  475. };
  476. /**
  477. * struct spectral_timestamp_swar - Spectral time stamp WAR related parameters
  478. * @timestamp_war_offset: Offset to be added to correct timestamp
  479. * @target_reset_count: Number of times target exercised the reset routine
  480. * @last_fft_timestamp: last fft report timestamp
  481. */
  482. struct spectral_timestamp_war {
  483. uint32_t timestamp_war_offset[SPECTRAL_SCAN_MODE_MAX];
  484. uint64_t target_reset_count;
  485. uint32_t last_fft_timestamp[SPECTRAL_SCAN_MODE_MAX];
  486. };
  487. #if ATH_PERF_PWR_OFFLOAD
  488. /**
  489. * enum target_if_spectral_info - Enumerations for specifying which spectral
  490. * information (among parameters and states)
  491. * is desired.
  492. * @TARGET_IF_SPECTRAL_INFO_ACTIVE: Indicated whether spectral is active
  493. * @TARGET_IF_SPECTRAL_INFO_ENABLED: Indicated whether spectral is enabled
  494. * @TARGET_IF_SPECTRAL_INFO_PARAMS: Config params
  495. */
  496. enum target_if_spectral_info {
  497. TARGET_IF_SPECTRAL_INFO_ACTIVE,
  498. TARGET_IF_SPECTRAL_INFO_ENABLED,
  499. TARGET_IF_SPECTRAL_INFO_PARAMS,
  500. };
  501. #endif /* ATH_PERF_PWR_OFFLOAD */
  502. /* forward declaration */
  503. struct target_if_spectral;
  504. /**
  505. * struct target_if_spectral_chan_info - Channel information
  506. * @center_freq1: center frequency 1 in MHz
  507. * @center_freq2: center frequency 2 in MHz -valid only for
  508. * 11ACVHT 80PLUS80 mode
  509. * @chan_width: channel width in MHz
  510. */
  511. struct target_if_spectral_chan_info {
  512. uint16_t center_freq1;
  513. uint16_t center_freq2;
  514. uint8_t chan_width;
  515. };
  516. /**
  517. * struct target_if_spectral_acs_stats - EACS stats from spectral samples
  518. * @nfc_ctl_rssi: Control chan rssi
  519. * @nfc_ext_rssi: Extension chan rssi
  520. * @ctrl_nf: Control chan Noise Floor
  521. * @ext_nf: Extension chan Noise Floor
  522. */
  523. struct target_if_spectral_acs_stats {
  524. int8_t nfc_ctl_rssi;
  525. int8_t nfc_ext_rssi;
  526. int8_t ctrl_nf;
  527. int8_t ext_nf;
  528. };
  529. /**
  530. * struct target_if_spectral_perchain_rssi_info - per chain rssi info
  531. * @rssi_pri20: Rssi of primary 20 Mhz
  532. * @rssi_sec20: Rssi of secondary 20 Mhz
  533. * @rssi_sec40: Rssi of secondary 40 Mhz
  534. * @rssi_sec80: Rssi of secondary 80 Mhz
  535. */
  536. struct target_if_spectral_perchain_rssi_info {
  537. int8_t rssi_pri20;
  538. int8_t rssi_sec20;
  539. int8_t rssi_sec40;
  540. int8_t rssi_sec80;
  541. };
  542. /**
  543. * struct target_if_spectral_rfqual_info - RF measurement information
  544. * @rssi_comb: RSSI Information
  545. * @pc_rssi_info: XXX : For now, we know we are getting information
  546. * for only 4 chains at max. For future extensions
  547. * use a define
  548. * @noise_floor: Noise floor information
  549. */
  550. struct target_if_spectral_rfqual_info {
  551. int8_t rssi_comb;
  552. struct target_if_spectral_perchain_rssi_info pc_rssi_info[4];
  553. int16_t noise_floor[4];
  554. };
  555. #define GET_TARGET_IF_SPECTRAL_OPS(spectral) \
  556. ((struct target_if_spectral_ops *)(&((spectral)->spectral_ops)))
  557. /**
  558. * struct target_if_spectral_ops - spectral low level ops table
  559. * @get_tsf64: Get 64 bit TSF value
  560. * @get_capability: Get capability info
  561. * @set_rxfilter: Set rx filter
  562. * @get_rxfilter: Get rx filter
  563. * @is_spectral_active: Check whether icm is active
  564. * @is_spectral_enabled: Check whether spectral is enabled
  565. * @start_spectral_scan: Start spectral scan
  566. * @stop_spectral_scan: Stop spectral scan
  567. * @get_extension_channel: Get extension channel
  568. * @get_ctl_noisefloor: Get control noise floor
  569. * @get_ext_noisefloor: Get extension noise floor
  570. * @configure_spectral: Set spectral configurations
  571. * @get_spectral_config: Get spectral configurations
  572. * @get_ent_spectral_mask: Get spectral mask
  573. * @get_mac_address: Get mac address
  574. * @get_current_channel: Get current channel
  575. * @reset_hw: Reset HW
  576. * @get_chain_noise_floor: Get Channel noise floor
  577. * @spectral_process_phyerr: Process phyerr event
  578. * @process_spectral_report: Process spectral report
  579. */
  580. struct target_if_spectral_ops {
  581. uint64_t (*get_tsf64)(void *arg);
  582. uint32_t (*get_capability)(
  583. void *arg, enum spectral_capability_type type);
  584. uint32_t (*set_rxfilter)(void *arg, int rxfilter);
  585. uint32_t (*get_rxfilter)(void *arg);
  586. uint32_t (*is_spectral_active)(void *arg,
  587. enum spectral_scan_mode smode);
  588. uint32_t (*is_spectral_enabled)(void *arg,
  589. enum spectral_scan_mode smode);
  590. uint32_t (*start_spectral_scan)(void *arg,
  591. enum spectral_scan_mode smode,
  592. enum spectral_cp_error_code *err);
  593. uint32_t (*stop_spectral_scan)(void *arg,
  594. enum spectral_scan_mode smode);
  595. uint32_t (*get_extension_channel)(void *arg);
  596. int8_t (*get_ctl_noisefloor)(void *arg);
  597. int8_t (*get_ext_noisefloor)(void *arg);
  598. uint32_t (*configure_spectral)(
  599. void *arg,
  600. struct spectral_config *params,
  601. enum spectral_scan_mode smode);
  602. uint32_t (*get_spectral_config)(
  603. void *arg,
  604. struct spectral_config *params,
  605. enum spectral_scan_mode smode);
  606. uint32_t (*get_ent_spectral_mask)(void *arg);
  607. uint32_t (*get_mac_address)(void *arg, char *addr);
  608. uint32_t (*get_current_channel)(void *arg);
  609. uint32_t (*reset_hw)(void *arg);
  610. uint32_t (*get_chain_noise_floor)(void *arg, int16_t *nf_buf);
  611. int (*spectral_process_phyerr)(struct target_if_spectral *spectral,
  612. uint8_t *data, uint32_t datalen,
  613. struct target_if_spectral_rfqual_info *p_rfqual,
  614. struct target_if_spectral_chan_info *p_chaninfo,
  615. uint64_t tsf64,
  616. struct target_if_spectral_acs_stats *acs_stats);
  617. int (*process_spectral_report)(struct wlan_objmgr_pdev *pdev,
  618. void *payload);
  619. };
  620. /**
  621. * struct target_if_spectral_stats - spectral stats info
  622. * @num_spectral_detects: Total num. of spectral detects
  623. * @total_phy_errors: Total number of phyerrors
  624. * @owl_phy_errors: Indicated phyerrors in old gen1 chipsets
  625. * @pri_phy_errors: Phyerrors in primary channel
  626. * @ext_phy_errors: Phyerrors in secondary channel
  627. * @dc_phy_errors: Phyerrors due to dc
  628. * @early_ext_phy_errors: Early secondary channel phyerrors
  629. * @bwinfo_errors: Bandwidth info errors
  630. * @datalen_discards: Invalid data length errors, seen in gen1 chipsets
  631. * @rssi_discards bw: Indicates reports dropped due to RSSI threshold
  632. * @last_reset_tstamp: Last reset time stamp
  633. */
  634. struct target_if_spectral_stats {
  635. uint32_t num_spectral_detects;
  636. uint32_t total_phy_errors;
  637. uint32_t owl_phy_errors;
  638. uint32_t pri_phy_errors;
  639. uint32_t ext_phy_errors;
  640. uint32_t dc_phy_errors;
  641. uint32_t early_ext_phy_errors;
  642. uint32_t bwinfo_errors;
  643. uint32_t datalen_discards;
  644. uint32_t rssi_discards;
  645. uint64_t last_reset_tstamp;
  646. };
  647. /**
  648. * struct target_if_spectral_event - spectral event structure
  649. * @se_ts: Original 15 bit recv timestamp
  650. * @se_full_ts: 64-bit full timestamp from interrupt time
  651. * @se_rssi: Rssi of spectral event
  652. * @se_bwinfo: Rssi of spectral event
  653. * @se_dur: Duration of spectral pulse
  654. * @se_chanindex: Channel of event
  655. * @se_list: List of spectral events
  656. */
  657. struct target_if_spectral_event {
  658. uint32_t se_ts;
  659. uint64_t se_full_ts;
  660. uint8_t se_rssi;
  661. uint8_t se_bwinfo;
  662. uint8_t se_dur;
  663. uint8_t se_chanindex;
  664. STAILQ_ENTRY(spectral_event) se_list;
  665. };
  666. /**
  667. * struct target_if_chain_noise_pwr_info - Noise power info for each channel
  668. * @rptcount: Count of reports in pwr array
  669. * @un_cal_nf: Uncalibrated noise floor
  670. * @factory_cal_nf: Noise floor as calibrated at the factory for module
  671. * @median_pwr: Median power (median of pwr array)
  672. * @pwr: Power reports
  673. */
  674. struct target_if_chain_noise_pwr_info {
  675. int rptcount;
  676. pwr_dbm un_cal_nf;
  677. pwr_dbm factory_cal_nf;
  678. pwr_dbm median_pwr;
  679. pwr_dbm pwr[];
  680. } __ATTRIB_PACK;
  681. /**
  682. * struct target_if_spectral_chan_stats - Channel information
  683. * @cycle_count: Cycle count
  684. * @channel_load: Channel load
  685. * @per: Period
  686. * @noisefloor: Noise floor
  687. * @comp_usablity: Computed usability
  688. * @maxregpower: Maximum allowed regulatary power
  689. * @comp_usablity_sec80: Computed usability of secondary 80 Mhz
  690. * @maxregpower_sec80: Max regulatory power in secondary 80 Mhz
  691. */
  692. struct target_if_spectral_chan_stats {
  693. int cycle_count;
  694. int channel_load;
  695. int per;
  696. int noisefloor;
  697. uint16_t comp_usablity;
  698. int8_t maxregpower;
  699. uint16_t comp_usablity_sec80;
  700. int8_t maxregpower_sec80;
  701. };
  702. #if ATH_PERF_PWR_OFFLOAD
  703. /**
  704. * struct target_if_spectral_cache - Cache used to minimize WMI operations
  705. * in offload architecture
  706. * @osc_spectral_enabled: Whether Spectral is enabled
  707. * @osc_spectral_active: Whether spectral is active
  708. * XXX: Ideally, we should NOT cache this
  709. * since the hardware can self clear the bit,
  710. * the firmware can possibly stop spectral due to
  711. * intermittent off-channel activity, etc
  712. * A WMI read command should be introduced to handle
  713. * this This will be discussed.
  714. * @osc_params: Spectral parameters
  715. * @osc_is_valid: Whether the cache is valid
  716. */
  717. struct target_if_spectral_cache {
  718. uint8_t osc_spectral_enabled;
  719. uint8_t osc_spectral_active;
  720. struct spectral_config osc_params;
  721. uint8_t osc_is_valid;
  722. };
  723. /**
  724. * struct target_if_spectral_param_state_info - Structure used to represent and
  725. * manage spectral information
  726. * (parameters and states)
  727. * @osps_lock: Lock to synchronize accesses to information
  728. * @osps_cache: Cacheable' information
  729. */
  730. struct target_if_spectral_param_state_info {
  731. qdf_spinlock_t osps_lock;
  732. struct target_if_spectral_cache osps_cache;
  733. /* XXX - Non-cacheable information goes here, in the future */
  734. };
  735. #endif /* ATH_PERF_PWR_OFFLOAD */
  736. struct vdev_spectral_configure_params;
  737. struct vdev_spectral_enable_params;
  738. /**
  739. * struct wmi_spectral_cmd_ops - structure used holding the operations
  740. * related to wmi commands on spectral parameters.
  741. * @wmi_spectral_configure_cmd_send: Configure Spectral parameters
  742. * @wmi_spectral_enable_cmd_send: Enable/Disable Spectral
  743. * @wmi_spectral_crash_inject: Inject FW crash
  744. */
  745. struct wmi_spectral_cmd_ops {
  746. QDF_STATUS (*wmi_spectral_configure_cmd_send)(
  747. wmi_unified_t wmi_hdl,
  748. struct vdev_spectral_configure_params *param);
  749. QDF_STATUS (*wmi_spectral_enable_cmd_send)(
  750. wmi_unified_t wmi_hdl,
  751. struct vdev_spectral_enable_params *param);
  752. QDF_STATUS(*wmi_spectral_crash_inject)(
  753. wmi_unified_t wmi_handle, struct crash_inject *param);
  754. };
  755. /**
  756. * struct spectral_param_properties - structure holding Spectral
  757. * parameter properties
  758. * @supported: Parameter is supported or not
  759. * @common_all_modes: Parameter should be common for all modes or not
  760. */
  761. struct spectral_param_properties {
  762. bool supported;
  763. bool common_all_modes;
  764. };
  765. /**
  766. * struct target_if_spectral - main spectral structure
  767. * @pdev: Pointer to pdev
  768. * @spectral_ops: Target if internal Spectral low level operations table
  769. * @capability: Spectral capabilities structure
  770. * @properties: Spectral parameter properties per mode
  771. * @spectral_lock: Lock used for internal Spectral operations
  772. * @spectral_curchan_radindex: Current channel spectral index
  773. * @spectral_extchan_radindex: Extension channel spectral index
  774. * @spectraldomain: Current Spectral domain
  775. * @spectral_proc_phyerr: Flags to process for PHY errors
  776. * @spectral_defaultparams: Default PHY params per Spectral stat
  777. * @spectral_stats: Spectral related stats
  778. * @events: Events structure
  779. * @sc_spectral_ext_chan_ok: Can spectral be detected on the extension channel?
  780. * @sc_spectral_combined_rssi_ok: Can use combined spectral RSSI?
  781. * @sc_spectral_20_40_mode: Is AP in 20-40 mode?
  782. * @sc_spectral_noise_pwr_cal: Noise power cal required?
  783. * @sc_spectral_non_edma: Is the spectral capable device Non-EDMA?
  784. * @upper_is_control: Upper segment is primary
  785. * @upper_is_extension: Upper segment is secondary
  786. * @lower_is_control: Lower segment is primary
  787. * @lower_is_extension: Lower segment is secondary
  788. * @sc_spectraltest_ieeechan: IEEE channel number to return to after a spectral
  789. * mute test
  790. * @spectral_numbins: Number of bins
  791. * @spectral_fft_len: FFT length
  792. * @spectral_data_len: Total phyerror report length
  793. * @lb_edge_extrabins: Number of extra bins on left band edge
  794. * @rb_edge_extrabins: Number of extra bins on right band edge
  795. * @spectral_max_index_offset: Max FFT index offset (20 MHz mode)
  796. * @spectral_upper_max_index_offset: Upper max FFT index offset (20/40 MHz mode)
  797. * @spectral_lower_max_index_offset: Lower max FFT index offset (20/40 MHz mode)
  798. * @spectral_dc_index: At which index DC is present
  799. * @send_single_packet: Deprecated
  800. * @spectral_sent_msg: Indicates whether we send report to upper layers
  801. * @params: Spectral parameters
  802. * @last_capture_time: Indicates timestamp of previouse report
  803. * @num_spectral_data: Number of Spectral samples received in current session
  804. * @total_spectral_data: Total number of Spectral samples received
  805. * @max_rssi: Maximum RSSI
  806. * @detects_control_channel: NA
  807. * @detects_extension_channel: NA
  808. * @detects_below_dc: NA
  809. * @detects_above_dc: NA
  810. * @sc_scanning: Indicates active wifi scan
  811. * @sc_spectral_scan: Indicates active specral scan
  812. * @sc_spectral_full_scan: Deprecated
  813. * @scan_start_tstamp: Deprecated
  814. * @last_tstamp: Deprecated
  815. * @first_tstamp: Deprecated
  816. * @spectral_samp_count: Deprecated
  817. * @sc_spectral_samp_count: Deprecated
  818. * @noise_pwr_reports_reqd: Number of noise power reports required
  819. * @noise_pwr_reports_recv: Number of noise power reports received
  820. * @noise_pwr_reports_lock: Lock used for Noise power report processing
  821. * @noise_pwr_chain_ctl: Noise power report - control channel
  822. * @noise_pwr_chain_ext: Noise power report - extension channel
  823. * @chaninfo: Channel statistics
  824. * @tsf64: Latest TSF Value
  825. * @param_info: Offload architecture Spectral parameter cache information
  826. * @ch_width: Indicates Channel Width 20/40/80/160 MHz for each Spectral mode
  827. * @diag_stats: Diagnostic statistics
  828. * @is_160_format: Indicates whether information provided by HW is in altered
  829. * format for 802.11ac 160/80+80 MHz support (QCA9984 onwards)
  830. * @is_lb_edge_extrabins_format: Indicates whether information provided by
  831. * HW has 4 extra bins, at left band edge, for report mode 2
  832. * @is_rb_edge_extrabins_format: Indicates whether information provided
  833. * by HW has 4 extra bins, at right band edge, for report mode 2
  834. * @is_sec80_rssi_war_required: Indicates whether the software workaround is
  835. * required to obtain approximate combined RSSI for secondary 80Mhz segment
  836. * @simctx: Spectral Simulation context
  837. * @spectral_gen: Spectral hardware generation
  838. * @hdr_sig_exp: Expected signature in PHYERR TLV header, for the given hardware
  839. * generation
  840. * @tag_sscan_summary_exp: Expected Spectral Scan Summary tag in PHYERR TLV
  841. * header, for the given hardware generation
  842. * @tag_sscan_fft_exp: Expected Spectral Scan FFT report tag in PHYERR TLV
  843. * header, for the given hardware generation
  844. * @tlvhdr_size: Expected PHYERR TLV header size, for the given hardware
  845. * generation
  846. * @nl_cb: Netlink callbacks
  847. * @use_nl_bcast: Whether to use Netlink broadcast/unicast
  848. * @send_phy_data: Send data to the application layer for a particular msg type
  849. * @len_adj_swar: Spectral fft bin length adjustment SWAR related info
  850. * @timestamp_war: Spectral time stamp WAR related info
  851. * @dbr_ring_debug: Whether Spectral DBR ring debug is enabled
  852. * @dbr_buff_debug: Whether Spectral DBR buffer debug is enabled
  853. * @direct_dma_support: Whether Direct-DMA is supported on the current radio
  854. * @prev_tstamp: Timestamp of the previously received sample, which has to be
  855. * compared with the current tstamp to check descrepancy
  856. * @rparams: Parameters related to Spectral report structure
  857. * @param_min_max: Spectral parameter's minimum and maximum values
  858. */
  859. struct target_if_spectral {
  860. struct wlan_objmgr_pdev *pdev_obj;
  861. struct target_if_spectral_ops spectral_ops;
  862. struct spectral_caps capability;
  863. struct spectral_param_properties
  864. properties[SPECTRAL_SCAN_MODE_MAX][SPECTRAL_PARAM_MAX];
  865. qdf_spinlock_t spectral_lock;
  866. int16_t spectral_curchan_radindex;
  867. int16_t spectral_extchan_radindex;
  868. uint32_t spectraldomain;
  869. uint32_t spectral_proc_phyerr;
  870. struct spectral_config spectral_defaultparams;
  871. struct target_if_spectral_stats spectral_stats;
  872. struct target_if_spectral_event *events;
  873. unsigned int sc_spectral_ext_chan_ok:1,
  874. sc_spectral_combined_rssi_ok:1,
  875. sc_spectral_20_40_mode:1,
  876. sc_spectral_noise_pwr_cal:1,
  877. sc_spectral_non_edma:1;
  878. int upper_is_control;
  879. int upper_is_extension;
  880. int lower_is_control;
  881. int lower_is_extension;
  882. uint8_t sc_spectraltest_ieeechan;
  883. int spectral_numbins;
  884. int spectral_fft_len;
  885. int spectral_data_len;
  886. /*
  887. * For 11ac chipsets prior to AR900B version 2.0, a max of 512 bins are
  888. * delivered. However, there can be additional bins reported for
  889. * AR900B version 2.0 and QCA9984 as described next:
  890. *
  891. * AR900B version 2.0: An additional tone is processed on the right
  892. * hand side in order to facilitate detection of radar pulses out to
  893. * the extreme band-edge of the channel frequency. Since the HW design
  894. * processes four tones at a time, this requires one additional Dword
  895. * to be added to the search FFT report.
  896. *
  897. * QCA9984: When spectral_scan_rpt_mode = 2, i.e 2-dword summary +
  898. * 1x-oversampled bins (in-band) per FFT, then 8 more bins
  899. * (4 more on left side and 4 more on right side)are added.
  900. */
  901. int lb_edge_extrabins;
  902. int rb_edge_extrabins;
  903. int spectral_max_index_offset;
  904. int spectral_upper_max_index_offset;
  905. int spectral_lower_max_index_offset;
  906. int spectral_dc_index;
  907. int send_single_packet;
  908. int spectral_sent_msg;
  909. int classify_scan;
  910. qdf_timer_t classify_timer;
  911. struct spectral_config params[SPECTRAL_SCAN_MODE_MAX];
  912. bool params_valid[SPECTRAL_SCAN_MODE_MAX];
  913. struct spectral_classifier_params classifier_params;
  914. int last_capture_time;
  915. int num_spectral_data;
  916. int total_spectral_data;
  917. int max_rssi;
  918. int detects_control_channel;
  919. int detects_extension_channel;
  920. int detects_below_dc;
  921. int detects_above_dc;
  922. int sc_scanning;
  923. int sc_spectral_scan;
  924. int sc_spectral_full_scan;
  925. uint64_t scan_start_tstamp;
  926. uint32_t last_tstamp;
  927. uint32_t first_tstamp;
  928. uint32_t spectral_samp_count;
  929. uint32_t sc_spectral_samp_count;
  930. int noise_pwr_reports_reqd;
  931. int noise_pwr_reports_recv;
  932. qdf_spinlock_t noise_pwr_reports_lock;
  933. struct target_if_chain_noise_pwr_info
  934. *noise_pwr_chain_ctl[HOST_MAX_ANTENNA];
  935. struct target_if_chain_noise_pwr_info
  936. *noise_pwr_chain_ext[HOST_MAX_ANTENNA];
  937. uint64_t tsf64;
  938. #if ATH_PERF_PWR_OFFLOAD
  939. struct target_if_spectral_param_state_info
  940. param_info[SPECTRAL_SCAN_MODE_MAX];
  941. #endif
  942. enum phy_ch_width ch_width[SPECTRAL_SCAN_MODE_MAX];
  943. struct spectral_diag_stats diag_stats;
  944. bool is_160_format;
  945. bool is_lb_edge_extrabins_format;
  946. bool is_rb_edge_extrabins_format;
  947. bool is_sec80_rssi_war_required;
  948. #ifdef QCA_SUPPORT_SPECTRAL_SIMULATION
  949. void *simctx;
  950. #endif
  951. enum spectral_gen spectral_gen;
  952. uint8_t hdr_sig_exp;
  953. uint8_t tag_sscan_summary_exp;
  954. uint8_t tag_sscan_fft_exp;
  955. uint8_t tlvhdr_size;
  956. struct wmi_spectral_cmd_ops param_wmi_cmd_ops;
  957. struct spectral_nl_cb nl_cb;
  958. bool use_nl_bcast;
  959. int (*send_phy_data)(struct wlan_objmgr_pdev *pdev,
  960. enum spectral_msg_type smsg_type);
  961. struct spectral_fft_bin_len_adj_swar len_adj_swar;
  962. struct spectral_timestamp_war timestamp_war;
  963. enum spectral_160mhz_report_delivery_state state_160mhz_delivery;
  964. bool dbr_ring_debug;
  965. bool dbr_buff_debug;
  966. bool direct_dma_support;
  967. uint32_t prev_tstamp;
  968. struct spectral_report_params rparams;
  969. struct spectral_param_min_max param_min_max;
  970. };
  971. /**
  972. * struct target_if_samp_msg_params - Spectral Analysis Messaging Protocol
  973. * data format
  974. * @rssi: RSSI (except for secondary 80 segment)
  975. * @rssi_sec80: RSSI for secondary 80 segment
  976. * @lower_rssi: RSSI of lower band
  977. * @upper_rssi: RSSI of upper band
  978. * @chain_ctl_rssi: RSSI for control channel, for all antennas
  979. * @chain_ext_rssi: RSSI for extension channel, for all antennas
  980. * @bwinfo: bandwidth info
  981. * @data_len: length of FFT data (except for secondary 80 segment)
  982. * @data_len_sec80: length of FFT data for secondary 80 segment
  983. * @tstamp: timestamp
  984. * @last_tstamp: last time stamp
  985. * @max_mag: maximum magnitude (except for secondary 80 segment)
  986. * @max_mag_sec80: maximum magnitude for secondary 80 segment
  987. * @max_index: index of max magnitude (except for secondary 80 segment)
  988. * @max_index_sec80: index of max magnitude for secondary 80 segment
  989. * @max_exp: max exp
  990. * @peak: peak frequency (obsolete)
  991. * @pwr_count: number of FFT bins (except for secondary 80 segment)
  992. * @pwr_count_sec80: number of FFT bins in secondary 80 segment
  993. * @nb_lower: This is deprecated
  994. * @nb_upper: This is deprecated
  995. * @max_upper_index: index of max mag in upper band
  996. * @max_lower_index: index of max mag in lower band
  997. * @bin_pwr_data: Contains FFT magnitudes (except for secondary 80 segment)
  998. * @bin_pwr_data_sec80: Contains FFT magnitudes for the secondary 80 segment
  999. * @freq: Center frequency of primary 20MHz channel in MHz
  1000. * @vhtop_ch_freq_seg1: VHT operation first segment center frequency in MHz
  1001. * @vhtop_ch_freq_seg2: VHT operation second segment center frequency in MHz
  1002. * @agile_freq: Center frequency in MHz of the entire span across which Agile
  1003. * Spectral is carried out. Applicable only for Agile Spectral samples.
  1004. * @freq_loading: spectral control duty cycles
  1005. * @noise_floor: current noise floor (except for secondary 80 segment)
  1006. * @noise_floor_sec80: current noise floor for secondary 80 segment
  1007. * @interf_list: List of interfernce sources
  1008. * @classifier_params: classifier parameters
  1009. * @sc: classifier parameters
  1010. * @pri80ind: Indication from hardware that the sample was received on the
  1011. * primary 80 MHz segment. If this is set when smode =
  1012. * SPECTRAL_SCAN_MODE_AGILE, it indicates that Spectral was carried out on
  1013. * pri80 instead of the Agile frequency due to a channel switch - Software may
  1014. * choose to ignore the sample in this case.
  1015. * @pri80ind_sec80: Indication from hardware that the sample was received on the
  1016. * primary 80 MHz segment instead of the secondary 80 MHz segment due to a
  1017. * channel switch - Software may choose to ignore the sample if this is set.
  1018. * Applicable only if smode = SPECTRAL_SCAN_MODE_NORMAL and for 160/80+80 MHz
  1019. * Spectral operation.
  1020. * @last_raw_timestamp: Previous FFT report's raw timestamp. In case of 160MHz
  1021. * it will be primary 80 segment's timestamp as both primary & secondary
  1022. * segment's timestamps are expected to be almost equal
  1023. * @timestamp_war_offset: Offset calculated based on reset_delay and
  1024. * last_raw_stamp. It will be added to raw_timestamp to get tstamp.
  1025. * @raw_timestamp: FFT timestamp reported by HW on primary segment.
  1026. * @raw_timestamp_sec80: FFT timestamp reported by HW on secondary 80 segment.
  1027. * @reset_delay: Time gap between the last spectral report before reset and the
  1028. * end of reset.
  1029. * @target_reset_count: Indicates the the number of times the target went
  1030. * through reset routine after spectral was enabled.
  1031. */
  1032. struct target_if_samp_msg_params {
  1033. int8_t rssi;
  1034. int8_t rssi_sec80;
  1035. int8_t lower_rssi;
  1036. int8_t upper_rssi;
  1037. int8_t chain_ctl_rssi[HOST_MAX_ANTENNA];
  1038. int8_t chain_ext_rssi[HOST_MAX_ANTENNA];
  1039. uint16_t bwinfo;
  1040. uint16_t datalen;
  1041. uint16_t datalen_sec80;
  1042. uint32_t tstamp;
  1043. uint32_t last_tstamp;
  1044. uint16_t max_mag;
  1045. uint16_t max_mag_sec80;
  1046. uint16_t max_index;
  1047. uint16_t max_index_sec80;
  1048. uint8_t max_exp;
  1049. int peak;
  1050. int pwr_count;
  1051. int pwr_count_sec80;
  1052. int8_t nb_lower;
  1053. int8_t nb_upper;
  1054. uint16_t max_lower_index;
  1055. uint16_t max_upper_index;
  1056. uint8_t *bin_pwr_data;
  1057. uint8_t *bin_pwr_data_sec80;
  1058. uint16_t freq;
  1059. uint16_t vhtop_ch_freq_seg1;
  1060. uint16_t vhtop_ch_freq_seg2;
  1061. uint16_t agile_freq;
  1062. uint16_t freq_loading;
  1063. int16_t noise_floor;
  1064. int16_t noise_floor_sec80;
  1065. struct interf_src_rsp interf_list;
  1066. struct spectral_classifier_params classifier_params;
  1067. struct ath_softc *sc;
  1068. uint8_t agc_total_gain;
  1069. uint8_t agc_total_gain_sec80;
  1070. uint8_t gainchange;
  1071. uint8_t gainchange_sec80;
  1072. enum spectral_scan_mode smode;
  1073. uint8_t pri80ind;
  1074. uint8_t pri80ind_sec80;
  1075. uint32_t last_raw_timestamp;
  1076. uint32_t timestamp_war_offset;
  1077. uint32_t raw_timestamp;
  1078. uint32_t raw_timestamp_sec80;
  1079. uint32_t reset_delay;
  1080. uint32_t target_reset_count;
  1081. };
  1082. #ifdef WLAN_CONV_SPECTRAL_ENABLE
  1083. /**
  1084. * target_if_spectral_dump_fft() - Dump Spectral FFT
  1085. * @pfft: Pointer to Spectral Phyerr FFT
  1086. * @fftlen: FFT length
  1087. *
  1088. * Return: Success or failure
  1089. */
  1090. int target_if_spectral_dump_fft(uint8_t *pfft, int fftlen);
  1091. /**
  1092. * target_if_dbg_print_samp_param() - Print contents of SAMP struct
  1093. * @p: Pointer to SAMP message
  1094. *
  1095. * Return: Void
  1096. */
  1097. void target_if_dbg_print_samp_param(struct target_if_samp_msg_params *p);
  1098. /**
  1099. * target_if_get_offset_swar_sec80() - Get offset for SWAR according to
  1100. * the channel width
  1101. * @channel_width: Channel width
  1102. *
  1103. * Return: Offset for SWAR
  1104. */
  1105. uint32_t target_if_get_offset_swar_sec80(uint32_t channel_width);
  1106. /**
  1107. * target_if_sptrl_register_tx_ops() - Register Spectral target_if Tx Ops
  1108. * @tx_ops: Tx Ops
  1109. *
  1110. * Return: void
  1111. */
  1112. void target_if_sptrl_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
  1113. /**
  1114. * target_if_spectral_create_samp_msg() - Create the spectral samp message
  1115. * @spectral : Pointer to spectral internal structure
  1116. * @params : spectral samp message parameters
  1117. *
  1118. * API to create the spectral samp message
  1119. *
  1120. * Return: void
  1121. */
  1122. void target_if_spectral_create_samp_msg(
  1123. struct target_if_spectral *spectral,
  1124. struct target_if_samp_msg_params *params);
  1125. /**
  1126. * target_if_spectral_process_phyerr_gen3() - Process phyerror event for gen3
  1127. * @pdev: Pointer to pdev object
  1128. * @payload: Pointer to spectral report
  1129. *
  1130. * Process phyerror event for gen3
  1131. *
  1132. * Return: Success/Failure
  1133. */
  1134. int target_if_spectral_process_report_gen3(
  1135. struct wlan_objmgr_pdev *pdev,
  1136. void *buf);
  1137. /**
  1138. * target_if_process_phyerr_gen2() - Process PHY Error for gen2
  1139. * @spectral: Pointer to Spectral object
  1140. * @data: Pointer to phyerror event buffer
  1141. * @datalen: Data length
  1142. * @p_rfqual: RF quality info
  1143. * @p_chaninfo: Channel info
  1144. * @tsf64: 64 bit tsf timestamp
  1145. * @acs_stats: ACS stats
  1146. *
  1147. * Process PHY Error for gen2
  1148. *
  1149. * Return: Success/Failure
  1150. */
  1151. int target_if_process_phyerr_gen2(
  1152. struct target_if_spectral *spectral,
  1153. uint8_t *data,
  1154. uint32_t datalen, struct target_if_spectral_rfqual_info *p_rfqual,
  1155. struct target_if_spectral_chan_info *p_chaninfo,
  1156. uint64_t tsf64,
  1157. struct target_if_spectral_acs_stats *acs_stats);
  1158. /**
  1159. * target_if_spectral_send_intf_found_msg() - Indicate to application layer that
  1160. * interference has been found
  1161. * @pdev: Pointer to pdev
  1162. * @cw_int: 1 if CW interference is found, 0 if WLAN interference is found
  1163. * @dcs_enabled: 1 if DCS is enabled, 0 if DCS is disabled
  1164. *
  1165. * Send message to application layer
  1166. * indicating that interference has been found
  1167. *
  1168. * Return: None
  1169. */
  1170. void target_if_spectral_send_intf_found_msg(
  1171. struct wlan_objmgr_pdev *pdev,
  1172. uint16_t cw_int, uint32_t dcs_enabled);
  1173. /**
  1174. * target_if_stop_spectral_scan() - Stop spectral scan
  1175. * @pdev: Pointer to pdev object
  1176. * @smode: Spectral scan mode
  1177. * @err: Pointer to error code
  1178. *
  1179. * API to stop the current on-going spectral scan
  1180. *
  1181. * Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
  1182. */
  1183. QDF_STATUS target_if_stop_spectral_scan(struct wlan_objmgr_pdev *pdev,
  1184. const enum spectral_scan_mode smode,
  1185. enum spectral_cp_error_code *err);
  1186. /**
  1187. * target_if_spectral_get_vdev() - Get pointer to vdev to be used for Spectral
  1188. * operations
  1189. * @spectral: Pointer to Spectral target_if internal private data
  1190. *
  1191. * Spectral operates on pdev. However, in order to retrieve some WLAN
  1192. * properties, a vdev is required. To facilitate this, the function returns the
  1193. * first vdev in our pdev. The caller should release the reference to the vdev
  1194. * once it is done using it.
  1195. * TODO: If the framework later provides an API to obtain the first active
  1196. * vdev, then it would be preferable to use this API.
  1197. *
  1198. * Return: Pointer to vdev on success, NULL on failure
  1199. */
  1200. struct wlan_objmgr_vdev *target_if_spectral_get_vdev(
  1201. struct target_if_spectral *spectral);
  1202. /**
  1203. * target_if_spectral_dump_hdr_gen2() - Dump Spectral header for gen2
  1204. * @phdr: Pointer to Spectral Phyerr Header
  1205. *
  1206. * Dump Spectral header
  1207. *
  1208. * Return: Success/Failure
  1209. */
  1210. int target_if_spectral_dump_hdr_gen2(struct spectral_phyerr_hdr_gen2 *phdr);
  1211. /**
  1212. * target_if_get_combrssi_sec80_seg_gen2() - Get approximate combined RSSI
  1213. * for Secondary 80 segment
  1214. * @spectral: Pointer to spectral object
  1215. * @p_sfft_sec80: Pointer to search fft info of secondary 80 segment
  1216. *
  1217. * Get approximate combined RSSI for Secondary 80 segment
  1218. *
  1219. * Return: Combined RSSI for secondary 80Mhz segment
  1220. */
  1221. int8_t target_if_get_combrssi_sec80_seg_gen2(
  1222. struct target_if_spectral *spectral,
  1223. struct spectral_search_fft_info_gen2 *p_sfft_sec80);
  1224. /**
  1225. * target_if_spectral_dump_tlv_gen2() - Dump Spectral TLV for gen2
  1226. * @ptlv: Pointer to Spectral Phyerr TLV
  1227. * @is_160_format: Indicates 160 format
  1228. *
  1229. * Dump Spectral TLV for gen2
  1230. *
  1231. * Return: Success/Failure
  1232. */
  1233. int target_if_spectral_dump_tlv_gen2(
  1234. struct spectral_phyerr_tlv_gen2 *ptlv, bool is_160_format);
  1235. /**
  1236. * target_if_spectral_dump_phyerr_data_gen2() - Dump Spectral
  1237. * related PHY Error for gen2
  1238. * @data: Pointer to phyerror buffer
  1239. * @datalen: Data length
  1240. * @is_160_format: Indicates 160 format
  1241. *
  1242. * Dump Spectral related PHY Error for gen2
  1243. *
  1244. * Return: Success/Failure
  1245. */
  1246. int target_if_spectral_dump_phyerr_data_gen2(
  1247. uint8_t *data,
  1248. uint32_t datalen,
  1249. bool is_160_format);
  1250. /**
  1251. * target_if_dbg_print_samp_msg() - Print contents of SAMP Message
  1252. * @p: Pointer to SAMP message
  1253. *
  1254. * Print contents of SAMP Message
  1255. *
  1256. * Return: Void
  1257. */
  1258. void target_if_dbg_print_samp_msg(struct spectral_samp_msg *pmsg);
  1259. /**
  1260. * get_target_if_spectral_handle_from_pdev() - Get handle to target_if internal
  1261. * Spectral data
  1262. * @pdev: Pointer to pdev
  1263. *
  1264. * Return: Handle to target_if internal Spectral data on success, NULL on
  1265. * failure
  1266. */
  1267. static inline
  1268. struct target_if_spectral *get_target_if_spectral_handle_from_pdev(
  1269. struct wlan_objmgr_pdev *pdev)
  1270. {
  1271. struct target_if_spectral *spectral;
  1272. struct wlan_objmgr_psoc *psoc;
  1273. if (!pdev) {
  1274. spectral_err("pdev is null");
  1275. return NULL;
  1276. }
  1277. psoc = wlan_pdev_get_psoc(pdev);
  1278. if (!psoc) {
  1279. spectral_err("psoc is null");
  1280. return NULL;
  1281. }
  1282. spectral = (struct target_if_spectral *)
  1283. psoc->soc_cb.rx_ops.sptrl_rx_ops.sptrlro_get_target_handle(
  1284. pdev);
  1285. return spectral;
  1286. }
  1287. /**
  1288. * target_if_vdev_get_chan_freq() - Get the operating channel frequency of a
  1289. * given vdev
  1290. * @pdev: Pointer to vdev
  1291. *
  1292. * Get the operating channel frequency of a given vdev
  1293. *
  1294. * Return: Operating channel frequency of a vdev
  1295. */
  1296. static inline
  1297. int16_t target_if_vdev_get_chan_freq(struct wlan_objmgr_vdev *vdev)
  1298. {
  1299. struct wlan_objmgr_psoc *psoc = NULL;
  1300. psoc = wlan_vdev_get_psoc(vdev);
  1301. if (!psoc) {
  1302. spectral_err("psoc is NULL");
  1303. return -EINVAL;
  1304. }
  1305. return psoc->soc_cb.rx_ops.sptrl_rx_ops.sptrlro_vdev_get_chan_freq(
  1306. vdev);
  1307. }
  1308. /**
  1309. * target_if_vdev_get_chan_freq_seg2() - Get center frequency of secondary 80 of
  1310. * given vdev
  1311. * @vdev: Pointer to vdev
  1312. *
  1313. * Get the center frequency of secondary 80 of given vdev
  1314. *
  1315. * Return: center frequency of secondary 80
  1316. */
  1317. static inline
  1318. int16_t target_if_vdev_get_chan_freq_seg2(struct wlan_objmgr_vdev *vdev)
  1319. {
  1320. struct wlan_objmgr_psoc *psoc = NULL;
  1321. psoc = wlan_vdev_get_psoc(vdev);
  1322. if (!psoc) {
  1323. spectral_err("psoc is NULL");
  1324. return -EINVAL;
  1325. }
  1326. return psoc->soc_cb.rx_ops.sptrl_rx_ops.sptrlro_vdev_get_chan_freq_seg2(
  1327. vdev);
  1328. }
  1329. /**
  1330. * target_if_vdev_get_ch_width() - Get the operating channel bandwidth of a
  1331. * given vdev
  1332. * @pdev: Pointer to vdev
  1333. *
  1334. * Get the operating channel bandwidth of a given vdev
  1335. *
  1336. * Return: channel bandwidth enumeration corresponding to the vdev
  1337. */
  1338. static inline
  1339. enum phy_ch_width target_if_vdev_get_ch_width(struct wlan_objmgr_vdev *vdev)
  1340. {
  1341. struct wlan_objmgr_psoc *psoc = NULL;
  1342. psoc = wlan_vdev_get_psoc(vdev);
  1343. if (!psoc) {
  1344. spectral_err("psoc is NULL");
  1345. return CH_WIDTH_INVALID;
  1346. }
  1347. return psoc->soc_cb.rx_ops.sptrl_rx_ops.sptrlro_vdev_get_ch_width(
  1348. vdev);
  1349. }
  1350. /**
  1351. * target_if_vdev_get_sec20chan_freq_mhz() - Get the frequency of secondary
  1352. * 20 MHz channel for a given vdev
  1353. * @pdev: Pointer to vdev
  1354. *
  1355. * Get the frequency of secondary 20Mhz channel for a given vdev
  1356. *
  1357. * Return: Frequency of secondary 20Mhz channel for a given vdev
  1358. */
  1359. static inline
  1360. int target_if_vdev_get_sec20chan_freq_mhz(
  1361. struct wlan_objmgr_vdev *vdev,
  1362. uint16_t *sec20chan_freq)
  1363. {
  1364. struct wlan_objmgr_psoc *psoc = NULL;
  1365. psoc = wlan_vdev_get_psoc(vdev);
  1366. if (!psoc) {
  1367. spectral_err("psoc is NULL");
  1368. return -EINVAL;
  1369. }
  1370. return psoc->soc_cb.rx_ops.sptrl_rx_ops.
  1371. sptrlro_vdev_get_sec20chan_freq_mhz(vdev, sec20chan_freq);
  1372. }
  1373. /**
  1374. * target_if_spectral_set_rxchainmask() - Set Spectral Rx chainmask
  1375. * @pdev: Pointer to pdev
  1376. * @spectral_rx_chainmask: Spectral Rx chainmask
  1377. *
  1378. * Return: None
  1379. */
  1380. static inline
  1381. void target_if_spectral_set_rxchainmask(struct wlan_objmgr_pdev *pdev,
  1382. uint8_t spectral_rx_chainmask)
  1383. {
  1384. struct wlan_objmgr_psoc *psoc = NULL;
  1385. struct target_if_spectral *spectral = NULL;
  1386. enum spectral_scan_mode smode = SPECTRAL_SCAN_MODE_NORMAL;
  1387. psoc = wlan_pdev_get_psoc(pdev);
  1388. if (!psoc) {
  1389. spectral_err("psoc is NULL");
  1390. return;
  1391. }
  1392. if (smode >= SPECTRAL_SCAN_MODE_MAX) {
  1393. spectral_err("Invalid Spectral mode %u", smode);
  1394. return;
  1395. }
  1396. if (psoc->soc_cb.rx_ops.sptrl_rx_ops.
  1397. sptrlro_spectral_is_feature_disabled(psoc)) {
  1398. spectral_info("Spectral is disabled");
  1399. return;
  1400. }
  1401. spectral = get_target_if_spectral_handle_from_pdev(pdev);
  1402. if (!spectral) {
  1403. spectral_err("Spectral target if object is null");
  1404. return;
  1405. }
  1406. /* set chainmask for all the modes */
  1407. for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++)
  1408. spectral->params[smode].ss_chn_mask = spectral_rx_chainmask;
  1409. }
  1410. /**
  1411. * target_if_spectral_process_phyerr() - Process Spectral PHY error
  1412. * @pdev: Pointer to pdev
  1413. * @data: PHY error data received from FW
  1414. * @datalen: Length of data
  1415. * @p_rfqual: Pointer to RF Quality information
  1416. * @p_chaninfo: Pointer to channel information
  1417. * @tsf: TSF time instance at which the Spectral sample was received
  1418. * @acs_stats: ACS stats
  1419. *
  1420. * Process Spectral PHY error by extracting necessary information from the data
  1421. * sent by FW, and send the extracted information to application layer.
  1422. *
  1423. * Return: None
  1424. */
  1425. static inline
  1426. void target_if_spectral_process_phyerr(
  1427. struct wlan_objmgr_pdev *pdev,
  1428. uint8_t *data, uint32_t datalen,
  1429. struct target_if_spectral_rfqual_info *p_rfqual,
  1430. struct target_if_spectral_chan_info *p_chaninfo,
  1431. uint64_t tsf64,
  1432. struct target_if_spectral_acs_stats *acs_stats)
  1433. {
  1434. struct target_if_spectral *spectral = NULL;
  1435. struct target_if_spectral_ops *p_sops = NULL;
  1436. spectral = get_target_if_spectral_handle_from_pdev(pdev);
  1437. if (!spectral) {
  1438. spectral_err("Spectral target if object is null");
  1439. return;
  1440. }
  1441. p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
  1442. p_sops->spectral_process_phyerr(spectral, data, datalen,
  1443. p_rfqual, p_chaninfo,
  1444. tsf64, acs_stats);
  1445. }
  1446. static QDF_STATUS
  1447. target_if_get_spectral_msg_type(enum spectral_scan_mode smode,
  1448. enum spectral_msg_type *msg_type) {
  1449. switch (smode) {
  1450. case SPECTRAL_SCAN_MODE_NORMAL:
  1451. *msg_type = SPECTRAL_MSG_NORMAL_MODE;
  1452. break;
  1453. case SPECTRAL_SCAN_MODE_AGILE:
  1454. *msg_type = SPECTRAL_MSG_AGILE_MODE;
  1455. break;
  1456. default:
  1457. spectral_err("Invalid spectral mode");
  1458. return QDF_STATUS_E_FAILURE;
  1459. }
  1460. return QDF_STATUS_SUCCESS;
  1461. }
  1462. /**
  1463. * init_160mhz_delivery_state_machine() - Initialize 160MHz Spectral
  1464. * state machine
  1465. * @spectral: Pointer to Spectral
  1466. *
  1467. * Initialize 160MHz Spectral state machine
  1468. *
  1469. * Return: void
  1470. */
  1471. static inline void
  1472. init_160mhz_delivery_state_machine(struct target_if_spectral *spectral)
  1473. {
  1474. spectral->state_160mhz_delivery =
  1475. SPECTRAL_REPORT_WAIT_PRIMARY80;
  1476. }
  1477. /**
  1478. * reset_160mhz_delivery_state_machine() - Reset 160MHz Spectral state machine
  1479. * @spectral: Pointer to Spectral
  1480. *
  1481. * Reset 160MHz Spectral state machine
  1482. *
  1483. * Return: void
  1484. */
  1485. static inline void
  1486. reset_160mhz_delivery_state_machine(struct target_if_spectral *spectral,
  1487. enum spectral_scan_mode smode)
  1488. {
  1489. enum spectral_msg_type smsg_type;
  1490. QDF_STATUS ret;
  1491. if (spectral->ch_width[SPECTRAL_SCAN_MODE_NORMAL] == CH_WIDTH_160MHZ) {
  1492. spectral->state_160mhz_delivery =
  1493. SPECTRAL_REPORT_WAIT_PRIMARY80;
  1494. ret = target_if_get_spectral_msg_type(smode, &smsg_type);
  1495. if (QDF_IS_STATUS_ERROR(ret)) {
  1496. spectral_err("Failed to reset 160 MHz state machine");
  1497. return;
  1498. }
  1499. spectral->nl_cb.free_sbuff(spectral->pdev_obj,
  1500. smsg_type);
  1501. }
  1502. }
  1503. /**
  1504. * is_secondaryseg_expected() - Is waiting for secondary 80 report
  1505. * @spectral: Pointer to Spectral
  1506. *
  1507. * Return true if secondary 80 report expected and mode is 160 MHz
  1508. *
  1509. * Return: true or false
  1510. */
  1511. static inline
  1512. bool is_secondaryseg_expected(struct target_if_spectral *spectral)
  1513. {
  1514. return
  1515. ((spectral->ch_width[SPECTRAL_SCAN_MODE_NORMAL] == CH_WIDTH_160MHZ) &&
  1516. (spectral->state_160mhz_delivery == SPECTRAL_REPORT_WAIT_SECONDARY80));
  1517. }
  1518. /**
  1519. * is_primaryseg_expected() - Is waiting for primary 80 report
  1520. * @spectral: Pointer to Spectral
  1521. *
  1522. * Return true if mode is 160 Mhz and primary 80 report expected or
  1523. * mode is not 160 Mhz
  1524. *
  1525. * Return: true or false
  1526. */
  1527. static inline
  1528. bool is_primaryseg_expected(struct target_if_spectral *spectral)
  1529. {
  1530. return
  1531. ((spectral->ch_width[SPECTRAL_SCAN_MODE_NORMAL] != CH_WIDTH_160MHZ) ||
  1532. ((spectral->ch_width[SPECTRAL_SCAN_MODE_NORMAL] == CH_WIDTH_160MHZ) &&
  1533. (spectral->state_160mhz_delivery == SPECTRAL_REPORT_WAIT_PRIMARY80)));
  1534. }
  1535. /**
  1536. * is_primaryseg_rx_inprog() - Is primary 80 report processing is in progress
  1537. * @spectral: Pointer to Spectral
  1538. *
  1539. * Is primary 80 report processing is in progress
  1540. *
  1541. * Return: true or false
  1542. */
  1543. static inline
  1544. bool is_primaryseg_rx_inprog(struct target_if_spectral *spectral)
  1545. {
  1546. return
  1547. ((spectral->ch_width[SPECTRAL_SCAN_MODE_NORMAL] != CH_WIDTH_160MHZ) ||
  1548. ((spectral->ch_width[SPECTRAL_SCAN_MODE_NORMAL] == CH_WIDTH_160MHZ) &&
  1549. ((spectral->spectral_gen == SPECTRAL_GEN2) ||
  1550. ((spectral->spectral_gen == SPECTRAL_GEN3) &&
  1551. (spectral->state_160mhz_delivery == SPECTRAL_REPORT_RX_PRIMARY80)))));
  1552. }
  1553. /**
  1554. * is_secondaryseg_rx_inprog() - Is secondary80 report processing is in progress
  1555. * @spectral: Pointer to Spectral
  1556. *
  1557. * Is secondary 80 report processing is in progress
  1558. *
  1559. * Return: true or false
  1560. */
  1561. static inline
  1562. bool is_secondaryseg_rx_inprog(struct target_if_spectral *spectral)
  1563. {
  1564. return
  1565. ((spectral->ch_width[SPECTRAL_SCAN_MODE_NORMAL] == CH_WIDTH_160MHZ) &&
  1566. ((spectral->spectral_gen == SPECTRAL_GEN2) ||
  1567. ((spectral->spectral_gen == SPECTRAL_GEN3) &&
  1568. (spectral->state_160mhz_delivery == SPECTRAL_REPORT_RX_SECONDARY80))));
  1569. }
  1570. /**
  1571. * target_if_160mhz_delivery_state_change() - State transition for 160Mhz
  1572. * Spectral
  1573. * @spectral: Pointer to spectral object
  1574. * @detector_id: Detector id
  1575. *
  1576. * Move the states of state machine for 160MHz spectral scan report receive
  1577. *
  1578. * Return: QDF_STATUS
  1579. */
  1580. QDF_STATUS
  1581. target_if_160mhz_delivery_state_change(struct target_if_spectral *spectral,
  1582. uint8_t detector_id);
  1583. /**
  1584. * target_if_sops_is_spectral_enabled() - Get whether Spectral is enabled
  1585. * @arg: Pointer to handle for Spectral target_if internal private data
  1586. * @smode: Spectral scan mode
  1587. *
  1588. * Function to check whether Spectral is enabled
  1589. *
  1590. * Return: True if Spectral is enabled, false if Spectral is not enabled
  1591. */
  1592. uint32_t target_if_sops_is_spectral_enabled(void *arg,
  1593. enum spectral_scan_mode smode);
  1594. /**
  1595. * target_if_sops_is_spectral_active() - Get whether Spectral is active
  1596. * @arg: Pointer to handle for Spectral target_if internal private data
  1597. * @smode: Spectral scan mode
  1598. *
  1599. * Function to check whether Spectral is active
  1600. *
  1601. * Return: True if Spectral is active, false if Spectral is not active
  1602. */
  1603. uint32_t target_if_sops_is_spectral_active(void *arg,
  1604. enum spectral_scan_mode smode);
  1605. /**
  1606. * target_if_sops_start_spectral_scan() - Start Spectral scan
  1607. * @arg: Pointer to handle for Spectral target_if internal private data
  1608. * @smode: Spectral scan mode
  1609. * @err: Pointer to error code
  1610. *
  1611. * Function to start spectral scan
  1612. *
  1613. * Return: 0 on success else failure
  1614. */
  1615. uint32_t target_if_sops_start_spectral_scan(void *arg,
  1616. enum spectral_scan_mode smode,
  1617. enum spectral_cp_error_code *err);
  1618. /**
  1619. * target_if_sops_stop_spectral_scan() - Stop Spectral scan
  1620. * @arg: Pointer to handle for Spectral target_if internal private data
  1621. * @smode: Spectral scan mode
  1622. *
  1623. * Function to stop spectral scan
  1624. *
  1625. * Return: 0 in case of success, -1 on failure
  1626. */
  1627. uint32_t target_if_sops_stop_spectral_scan(void *arg,
  1628. enum spectral_scan_mode smode);
  1629. /**
  1630. * target_if_spectral_get_extension_channel() - Get the current Extension
  1631. * channel (in MHz)
  1632. * @arg: Pointer to handle for Spectral target_if internal private data
  1633. *
  1634. * Return: Current Extension channel (in MHz) on success, 0 on failure or if
  1635. * extension channel is not present.
  1636. */
  1637. uint32_t target_if_spectral_get_extension_channel(void *arg);
  1638. /**
  1639. * target_if_spectral_get_current_channel() - Get the current channel (in MHz)
  1640. * @arg: Pointer to handle for Spectral target_if internal private data
  1641. *
  1642. * Return: Current channel (in MHz) on success, 0 on failure
  1643. */
  1644. uint32_t target_if_spectral_get_current_channel(void *arg);
  1645. /**
  1646. * target_if_spectral_reset_hw() - Reset the hardware
  1647. * @arg: Pointer to handle for Spectral target_if internal private data
  1648. *
  1649. * This is only a placeholder since it is not currently required in the offload
  1650. * case.
  1651. *
  1652. * Return: 0
  1653. */
  1654. uint32_t target_if_spectral_reset_hw(void *arg);
  1655. /**
  1656. * target_if_spectral_get_chain_noise_floor() - Get the Chain noise floor from
  1657. * Noisefloor history buffer
  1658. * @arg: Pointer to handle for Spectral target_if internal private data
  1659. * @nf_buf: Pointer to buffer into which chain Noise Floor data should be copied
  1660. *
  1661. * This is only a placeholder since it is not currently required in the offload
  1662. * case.
  1663. *
  1664. * Return: 0
  1665. */
  1666. uint32_t target_if_spectral_get_chain_noise_floor(void *arg, int16_t *nf_buf);
  1667. /**
  1668. * target_if_spectral_get_ext_noisefloor() - Get the extension channel
  1669. * noisefloor
  1670. * @arg: Pointer to handle for Spectral target_if internal private data
  1671. *
  1672. * This is only a placeholder since it is not currently required in the offload
  1673. * case.
  1674. *
  1675. * Return: 0
  1676. */
  1677. int8_t target_if_spectral_get_ext_noisefloor(void *arg);
  1678. /**
  1679. * target_if_spectral_get_ctl_noisefloor() - Get the control channel noisefloor
  1680. * @arg: Pointer to handle for Spectral target_if internal private data
  1681. *
  1682. * This is only a placeholder since it is not currently required in the offload
  1683. * case.
  1684. *
  1685. * Return: 0
  1686. */
  1687. int8_t target_if_spectral_get_ctl_noisefloor(void *arg);
  1688. /**
  1689. * target_if_spectral_get_capability() - Get whether a given Spectral hardware
  1690. * capability is available
  1691. * @arg: Pointer to handle for Spectral target_if internal private data
  1692. * @type: Spectral hardware capability type
  1693. *
  1694. * Return: True if the capability is available, false if the capability is not
  1695. * available
  1696. */
  1697. uint32_t target_if_spectral_get_capability(
  1698. void *arg, enum spectral_capability_type type);
  1699. /**
  1700. * target_if_spectral_set_rxfilter() - Set the RX Filter before Spectral start
  1701. * @arg: Pointer to handle for Spectral target_if internal private data
  1702. * @rxfilter: Rx filter to be used
  1703. *
  1704. * Note: This is only a placeholder function. It is not currently required since
  1705. * FW should be taking care of setting the required filters.
  1706. *
  1707. * Return: 0
  1708. */
  1709. uint32_t target_if_spectral_set_rxfilter(void *arg, int rxfilter);
  1710. /**
  1711. * target_if_spectral_sops_configure_params() - Configure user supplied Spectral
  1712. * parameters
  1713. * @arg: Pointer to handle for Spectral target_if internal private data
  1714. * @params: Spectral parameters
  1715. * @smode: Spectral scan mode
  1716. *
  1717. * Return: 0 in case of success, -1 on failure
  1718. */
  1719. uint32_t target_if_spectral_sops_configure_params(
  1720. void *arg, struct spectral_config *params,
  1721. enum spectral_scan_mode smode);
  1722. /**
  1723. * target_if_spectral_get_rxfilter() - Get the current RX Filter settings
  1724. * @arg: Pointer to handle for Spectral target_if internal private data
  1725. *
  1726. * Note: This is only a placeholder function. It is not currently required since
  1727. * FW should be taking care of setting the required filters.
  1728. *
  1729. * Return: 0
  1730. */
  1731. uint32_t target_if_spectral_get_rxfilter(void *arg);
  1732. /**
  1733. * target_if_pdev_spectral_deinit() - De-initialize target_if Spectral
  1734. * functionality for the given pdev
  1735. * @pdev: Pointer to pdev object
  1736. *
  1737. * Return: None
  1738. */
  1739. void target_if_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev);
  1740. /**
  1741. * target_if_set_spectral_config() - Set spectral config
  1742. * @pdev: Pointer to pdev object
  1743. * @threshtype: config type
  1744. * @value: config value
  1745. * @smode: Spectral scan mode
  1746. * @err: Pointer to Spectral error code
  1747. *
  1748. * API to set spectral configurations
  1749. *
  1750. * Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
  1751. */
  1752. QDF_STATUS target_if_set_spectral_config(struct wlan_objmgr_pdev *pdev,
  1753. const uint32_t threshtype,
  1754. const uint32_t value,
  1755. const enum spectral_scan_mode smode,
  1756. enum spectral_cp_error_code *err);
  1757. /**
  1758. * target_if_pdev_spectral_init() - Initialize target_if Spectral
  1759. * functionality for the given pdev
  1760. * @pdev: Pointer to pdev object
  1761. *
  1762. * Return: On success, pointer to Spectral target_if internal private data, on
  1763. * failure, NULL
  1764. */
  1765. void *target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev);
  1766. /**
  1767. * target_if_spectral_sops_get_params() - Get user configured Spectral
  1768. * parameters
  1769. * @arg: Pointer to handle for Spectral target_if internal private data
  1770. * @params: Pointer to buffer into which Spectral parameters should be copied
  1771. * @smode: Spectral scan mode
  1772. *
  1773. * Return: 0 in case of success, -1 on failure
  1774. */
  1775. uint32_t target_if_spectral_sops_get_params(
  1776. void *arg, struct spectral_config *params,
  1777. enum spectral_scan_mode smode);
  1778. /**
  1779. * target_if_init_spectral_capability() - Initialize Spectral capability
  1780. * @spectral: Pointer to Spectral target_if internal private data
  1781. *
  1782. * This is a workaround.
  1783. *
  1784. * Return: QDF_STATUS
  1785. */
  1786. QDF_STATUS
  1787. target_if_init_spectral_capability(struct target_if_spectral *spectral);
  1788. /**
  1789. * target_if_start_spectral_scan() - Start spectral scan
  1790. * @pdev: Pointer to pdev object
  1791. * @smode: Spectral scan mode
  1792. * @err: Spectral error code
  1793. *
  1794. * API to start spectral scan
  1795. *
  1796. * Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
  1797. */
  1798. QDF_STATUS target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev,
  1799. enum spectral_scan_mode smode,
  1800. enum spectral_cp_error_code *err);
  1801. /**
  1802. * target_if_get_spectral_config() - Get spectral configuration
  1803. * @pdev: Pointer to pdev object
  1804. * @param: Pointer to spectral_config structure in which the configuration
  1805. * should be returned
  1806. * @smode: Spectral scan mode
  1807. *
  1808. * API to get the current spectral configuration
  1809. *
  1810. * Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
  1811. */
  1812. QDF_STATUS target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
  1813. struct spectral_config *param,
  1814. enum spectral_scan_mode smode);
  1815. /**
  1816. * target_if_spectral_scan_enable_params() - Enable use of desired Spectral
  1817. * parameters
  1818. * @spectral: Pointer to Spectral target_if internal private data
  1819. * @spectral_params: Pointer to Spectral parameters
  1820. * @smode: Spectral scan mode
  1821. * @err: Spectral error code
  1822. *
  1823. * Enable use of desired Spectral parameters by configuring them into HW, and
  1824. * starting Spectral scan
  1825. *
  1826. * Return: 0 on success, 1 on failure
  1827. */
  1828. int target_if_spectral_scan_enable_params(
  1829. struct target_if_spectral *spectral,
  1830. struct spectral_config *spectral_params,
  1831. enum spectral_scan_mode smode,
  1832. enum spectral_cp_error_code *err);
  1833. /**
  1834. * target_if_is_spectral_active() - Get whether Spectral is active
  1835. * @pdev: Pointer to pdev object
  1836. * @smode: Spectral scan mode
  1837. *
  1838. * Return: True if Spectral is active, false if Spectral is not active
  1839. */
  1840. bool target_if_is_spectral_active(struct wlan_objmgr_pdev *pdev,
  1841. enum spectral_scan_mode smode);
  1842. /**
  1843. * target_if_is_spectral_enabled() - Get whether Spectral is enabled
  1844. * @pdev: Pointer to pdev object
  1845. * @smode: Spectral scan mode
  1846. *
  1847. * Return: True if Spectral is enabled, false if Spectral is not enabled
  1848. */
  1849. bool target_if_is_spectral_enabled(struct wlan_objmgr_pdev *pdev,
  1850. enum spectral_scan_mode smode);
  1851. /**
  1852. * target_if_set_debug_level() - Set debug level for Spectral
  1853. * @pdev: Pointer to pdev object
  1854. * @debug_level: Debug level
  1855. *
  1856. * Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
  1857. *
  1858. */
  1859. QDF_STATUS target_if_set_debug_level(struct wlan_objmgr_pdev *pdev,
  1860. uint32_t debug_level);
  1861. /**
  1862. * target_if_get_debug_level() - Get debug level for Spectral
  1863. * @pdev: Pointer to pdev object
  1864. *
  1865. * Return: Current debug level
  1866. */
  1867. uint32_t target_if_get_debug_level(struct wlan_objmgr_pdev *pdev);
  1868. /**
  1869. * target_if_get_spectral_capinfo() - Get Spectral capability information
  1870. * @pdev: Pointer to pdev object
  1871. * @scaps: Buffer into which data should be copied
  1872. *
  1873. * Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
  1874. */
  1875. QDF_STATUS target_if_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev,
  1876. struct spectral_caps *scaps);
  1877. /**
  1878. * target_if_get_spectral_diagstats() - Get Spectral diagnostic statistics
  1879. * @pdev: Pointer to pdev object
  1880. * @stats: Buffer into which data should be copied
  1881. *
  1882. * Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
  1883. */
  1884. QDF_STATUS target_if_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev,
  1885. struct spectral_diag_stats *stats);
  1886. void target_if_register_wmi_spectral_cmd_ops(
  1887. struct wlan_objmgr_pdev *pdev,
  1888. struct wmi_spectral_cmd_ops *cmd_ops);
  1889. QDF_STATUS
  1890. target_if_160mhz_delivery_state_change(struct target_if_spectral *spectral,
  1891. uint8_t detector_id);
  1892. #ifdef DIRECT_BUF_RX_ENABLE
  1893. /**
  1894. * target_if_consume_sfft_report_gen3() - Process fft report for gen3
  1895. * @spectral: Pointer to spectral object
  1896. * @report: Pointer to spectral report
  1897. *
  1898. * Process fft report for gen3
  1899. *
  1900. * Return: Success/Failure
  1901. */
  1902. int
  1903. target_if_consume_spectral_report_gen3(
  1904. struct target_if_spectral *spectral,
  1905. struct spectral_report *report);
  1906. #endif
  1907. /**
  1908. * target_if_spectral_fw_hang() - Crash the FW from Spectral module
  1909. * @spectral: Pointer to Spectral LMAC object
  1910. *
  1911. * Return: QDF_STATUS of operation
  1912. */
  1913. QDF_STATUS target_if_spectral_fw_hang(struct target_if_spectral *spectral);
  1914. #ifdef WIN32
  1915. #pragma pack(pop, target_if_spectral)
  1916. #endif
  1917. #ifdef __ATTRIB_PACK
  1918. #undef __ATTRIB_PACK
  1919. #endif
  1920. #endif /* WLAN_CONV_SPECTRAL_ENABLE */
  1921. #endif /* _TARGET_IF_SPECTRAL_H_ */