wlan_spectral_public_structs.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. /*
  2. * Copyright (c) 2011,2017 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. #include <qdf_types.h>
  20. #include "wlan_dfs_ioctl.h"
  21. #ifndef _WLAN_SPECTRAL_PUBLIC_STRUCTS_H_
  22. #define _WLAN_SPECTRAL_PUBLIC_STRUCTS_H_
  23. #ifdef WIN32
  24. #pragma pack(push, spectral, 1)
  25. #define __ATTRIB_PACKED
  26. #else
  27. #ifndef __ATTRIB_PACKED
  28. #define __ATTRIB_PACKED __attribute__ ((packed))
  29. #endif
  30. #endif
  31. #ifndef AH_MAX_CHAINS
  32. #define AH_MAX_CHAINS 3
  33. #endif
  34. #define MAX_NUM_CHANNELS 255
  35. #define MAX_SPECTRAL_CHAINS 3
  36. #define MAX_NUM_BINS 520
  37. #define SPECTRAL_PHYERR_PARAM_NOVAL 65535
  38. /* 5 categories x (lower + upper) bands */
  39. #define MAX_INTERF 10
  40. /* ioctl parameter types */
  41. #define SPECTRAL_PARAM_FFT_PERIOD (1)
  42. #define SPECTRAL_PARAM_SCAN_PERIOD (2)
  43. #define SPECTRAL_PARAM_SCAN_COUNT (3)
  44. #define SPECTRAL_PARAM_SHORT_REPORT (4)
  45. #define SPECTRAL_PARAM_SPECT_PRI (5)
  46. #define SPECTRAL_PARAM_FFT_SIZE (6)
  47. #define SPECTRAL_PARAM_GC_ENA (7)
  48. #define SPECTRAL_PARAM_RESTART_ENA (8)
  49. #define SPECTRAL_PARAM_NOISE_FLOOR_REF (9)
  50. #define SPECTRAL_PARAM_INIT_DELAY (10)
  51. #define SPECTRAL_PARAM_NB_TONE_THR (11)
  52. #define SPECTRAL_PARAM_STR_BIN_THR (12)
  53. #define SPECTRAL_PARAM_WB_RPT_MODE (13)
  54. #define SPECTRAL_PARAM_RSSI_RPT_MODE (14)
  55. #define SPECTRAL_PARAM_RSSI_THR (15)
  56. #define SPECTRAL_PARAM_PWR_FORMAT (16)
  57. #define SPECTRAL_PARAM_RPT_MODE (17)
  58. #define SPECTRAL_PARAM_BIN_SCALE (18)
  59. #define SPECTRAL_PARAM_DBM_ADJ (19)
  60. #define SPECTRAL_PARAM_CHN_MASK (20)
  61. #define SPECTRAL_PARAM_ACTIVE (21)
  62. #define SPECTRAL_PARAM_STOP (22)
  63. #define SPECTRAL_PARAM_ENABLE (23)
  64. #ifdef ATH_SPECTRAL_USE_EMU_DEFAULTS
  65. /* Use defaults from emulation */
  66. #define SPECTRAL_SCAN_ACTIVE_DEFAULT (0x0)
  67. #define SPECTRAL_SCAN_ENABLE_DEFAULT (0x0)
  68. #define SPECTRAL_SCAN_COUNT_DEFAULT (0x0)
  69. #define SPECTRAL_SCAN_PERIOD_DEFAULT (250)
  70. #define SPECTRAL_SCAN_PRIORITY_DEFAULT (0x1)
  71. #define SPECTRAL_SCAN_FFT_SIZE_DEFAULT (0x7)
  72. #define SPECTRAL_SCAN_GC_ENA_DEFAULT (0x1)
  73. #define SPECTRAL_SCAN_RESTART_ENA_DEFAULT (0x0)
  74. #define SPECTRAL_SCAN_NOISE_FLOOR_REF_DEFAULT (0xa0)
  75. #define SPECTRAL_SCAN_INIT_DELAY_DEFAULT (0x50)
  76. #define SPECTRAL_SCAN_NB_TONE_THR_DEFAULT (0xc)
  77. #define SPECTRAL_SCAN_STR_BIN_THR_DEFAULT (0x7)
  78. #define SPECTRAL_SCAN_WB_RPT_MODE_DEFAULT (0x0)
  79. #define SPECTRAL_SCAN_RSSI_RPT_MODE_DEFAULT (0x1)
  80. #define SPECTRAL_SCAN_RSSI_THR_DEFAULT (0xf)
  81. #define SPECTRAL_SCAN_PWR_FORMAT_DEFAULT (0x1)
  82. #define SPECTRAL_SCAN_RPT_MODE_DEFAULT (0x2)
  83. #define SPECTRAL_SCAN_BIN_SCALE_DEFAULT (0x1)
  84. #define SPECTRAL_SCAN_DBM_ADJ_DEFAULT (0x0)
  85. #define SPECTRAL_SCAN_CHN_MASK_DEFAULT (0x1)
  86. #else
  87. /* Static default values for spectral state and configuration.
  88. * These definitions should be treated as temporary. Ideally,
  89. * we should get the defaults from firmware - this will be discussed.
  90. *
  91. * Use defaults from Spectral Hardware Micro-Architecture
  92. * document (v1.0)
  93. */
  94. #define SPECTRAL_SCAN_ACTIVE_DEFAULT (0)
  95. #define SPECTRAL_SCAN_ENABLE_DEFAULT (0)
  96. #define SPECTRAL_SCAN_COUNT_DEFAULT (0)
  97. #define SPECTRAL_SCAN_PERIOD_DEFAULT (35)
  98. #define SPECTRAL_SCAN_PRIORITY_DEFAULT (1)
  99. #define SPECTRAL_SCAN_FFT_SIZE_DEFAULT (7)
  100. #define SPECTRAL_SCAN_GC_ENA_DEFAULT (1)
  101. #define SPECTRAL_SCAN_RESTART_ENA_DEFAULT (0)
  102. #define SPECTRAL_SCAN_NOISE_FLOOR_REF_DEFAULT (-96)
  103. #define SPECTRAL_SCAN_INIT_DELAY_DEFAULT (80)
  104. #define SPECTRAL_SCAN_NB_TONE_THR_DEFAULT (12)
  105. #define SPECTRAL_SCAN_STR_BIN_THR_DEFAULT (8)
  106. #define SPECTRAL_SCAN_WB_RPT_MODE_DEFAULT (0)
  107. #define SPECTRAL_SCAN_RSSI_RPT_MODE_DEFAULT (0)
  108. #define SPECTRAL_SCAN_RSSI_THR_DEFAULT (0xf0)
  109. #define SPECTRAL_SCAN_PWR_FORMAT_DEFAULT (0)
  110. #define SPECTRAL_SCAN_RPT_MODE_DEFAULT (2)
  111. #define SPECTRAL_SCAN_BIN_SCALE_DEFAULT (1)
  112. #define SPECTRAL_SCAN_DBM_ADJ_DEFAULT (1)
  113. #define SPECTRAL_SCAN_CHN_MASK_DEFAULT (1)
  114. #endif /* ATH_SPECTRAL_USE_EMU_DEFAULTS */
  115. /* The below two definitions apply only to pre-11ac chipsets */
  116. #define SPECTRAL_SCAN_SHORT_REPORT_DEFAULT (1)
  117. #define SPECTRAL_SCAN_FFT_PERIOD_DEFAULT (1)
  118. enum wlan_cfg80211_spectral_vendorcmd_handler_idx {
  119. SPECTRAL_SCAN_START_HANDLER_IDX,
  120. SPECTRAL_SCAN_STOP_HANDLER_IDX,
  121. SPECTRAL_SCAN_GET_CONFIG_HANDLER_IDX,
  122. SPECTRAL_SCAN_GET_DIAG_STATS_HANDLER_IDX,
  123. SPECTRAL_SCAN_GET_CAP_HANDLER_IDX,
  124. SPECTRAL_SCAN_GET_STATUS_HANDLER_IDX,
  125. SPECTRAL_SCAN_VENDOR_CMD_HANDLER_MAX,
  126. };
  127. /**
  128. * enum spectral_debug - Spectral debug level
  129. * @ATH_DEBUG_SPECTRAL: Minimal SPECTRAL debug
  130. * @ATH_DEBUG_SPECTRAL1: Normal SPECTRAL debug
  131. * @ATH_DEBUG_SPECTRAL2: Maximal SPECTRAL debug
  132. * @ATH_DEBUG_SPECTRAL3: Matched filterID display
  133. * @ATH_DEBUG_SPECTRAL4: One time dump of FFT report
  134. */
  135. enum spectral_debug {
  136. ATH_DEBUG_SPECTRAL = 0x00000100,
  137. ATH_DEBUG_SPECTRAL1 = 0x00000200,
  138. ATH_DEBUG_SPECTRAL2 = 0x00000400,
  139. ATH_DEBUG_SPECTRAL3 = 0x00000800,
  140. ATH_DEBUG_SPECTRAL4 = 0x00001000,
  141. };
  142. /**
  143. * enum SPECTRAL_CAPABILITY_TYPE - Spectral capability type
  144. * @SPECTRAL_CAP_PHYDIAG: Phydiag capability
  145. * @SPECTRAL_CAP_RADAR: Radar detection capability
  146. * @SPECTRAL_CAP_SPECTRAL_SCAN: Spectral capability
  147. * @SPECTRAL_CAP_ADVNCD_SPECTRAL_SCAN: Advanced spectral capability
  148. */
  149. typedef enum {
  150. SPECTRAL_CAP_PHYDIAG,
  151. SPECTRAL_CAP_RADAR,
  152. SPECTRAL_CAP_SPECTRAL_SCAN,
  153. SPECTRAL_CAP_ADVNCD_SPECTRAL_SCAN,
  154. } SPECTRAL_CAPABILITY_TYPE;
  155. /**
  156. * struct spectral_chan_stats - channel status info
  157. * @cycle_count: Cycle count
  158. * @channel_load: Channel load
  159. * @per: Period
  160. * @noisefloor: Noise floor
  161. * @comp_usablity: Computed usability
  162. * @maxregpower: Maximum allowed regulatory power
  163. * @comp_usablity_sec80: Computed usability of secondary 80 Mhz
  164. * @maxregpower_sec80: Max regulatory power of secondary 80 Mhz
  165. */
  166. struct spectral_chan_stats {
  167. int cycle_count;
  168. int channel_load;
  169. int per;
  170. int noisefloor;
  171. u_int16_t comp_usablity;
  172. int8_t maxregpower;
  173. u_int16_t comp_usablity_sec80;
  174. int8_t maxregpower_sec80;
  175. };
  176. /**
  177. * struct spectral_diag_stats - spectral diag stats
  178. * @spectral_mismatch: Spectral TLV signature mismatches
  179. * @spectral_sec80_sfft_insufflen: Insufficient length when parsing for
  180. * Secondary 80 Search FFT report
  181. * @spectral_no_sec80_sfft: Secondary 80 Search FFT report
  182. * TLV not found
  183. * @spectral_vhtseg1id_mismatch: VHT Operation Segment 1 ID
  184. * mismatches in Search FFT report
  185. * @spectral_vhtseg2id_mismatch: VHT Operation Segment 2 ID
  186. * mismatches in Search FFT report
  187. */
  188. struct spectral_diag_stats {
  189. u_int64_t spectral_mismatch;
  190. u_int64_t spectral_sec80_sfft_insufflen;
  191. u_int64_t spectral_no_sec80_sfft;
  192. u_int64_t spectral_vhtseg1id_mismatch;
  193. u_int64_t spectral_vhtseg2id_mismatch;
  194. };
  195. /**
  196. * struct spectral_caps - Spectral capabilities structure
  197. * @phydiag_cap: Phydiag capability
  198. * @radar_cap: Radar detection capability
  199. * @spectral_cap: Spectral capability
  200. * @advncd_spectral_cap: Advanced spectral capability
  201. */
  202. struct spectral_caps {
  203. u_int8_t phydiag_cap;
  204. u_int8_t radar_cap;
  205. u_int8_t spectral_cap;
  206. u_int8_t advncd_spectral_cap;
  207. };
  208. /**
  209. * struct spectral_config
  210. * @ss_fft_period: Skip interval for FFT reports
  211. * @ss_period: Spectral scan period
  212. * @ss_count: # of reports to return from ss_active
  213. * @ss_short_report: Set to report only 1 set of FFT results
  214. * @radar_bin_thresh_sel: Select threshold to classify strong bin for FFT
  215. * @ss_spectral_pri: Priority, and are we doing a noise power cal ?
  216. * @ss_fft_size: Defines the number of FFT data points to compute,
  217. * defined as a log index num_fft_pts =
  218. * 2^ss_fft_size
  219. * @ss_gc_ena: Set, to enable targeted gain change before
  220. * starting the spectral scan FFT
  221. * @ss_restart_ena: Set, to enable abort of receive frames when in high
  222. * priority and a spectral scan is queued
  223. * @ss_noise_floor_ref: Noise floor reference number (signed) for the
  224. * calculation of bin power (dBm) Though stored as an
  225. * unsigned this should be treated as a signed 8-bit int.
  226. * @ss_init_delay: Disallow spectral scan triggers after tx/rx packets
  227. * by setting this delay value to roughly SIFS time
  228. * period or greater Delay timer count in units of 0.25us
  229. * @ss_nb_tone_thr: Number of strong bins (inclusive) per sub-channel,
  230. * below which a signal is declared a narrowband tone
  231. * @ss_str_bin_thr: Bin/max_bin ratio threshold over which a bin is
  232. * declared strong (for spectral scan bandwidth analysis)
  233. * @ss_wb_rpt_mode: Set this bit to report spectral scans as EXT_BLOCKER
  234. * (phy_error=36), if none of the sub-channels are
  235. * deemed narrowband
  236. * @ss_rssi_rpt_mode: Set this bit to report spectral scans as EXT_BLOCKER
  237. * (phy_error=36), if the ADC RSSI is below the
  238. * threshold ss_rssi_thr
  239. * @ss_rssi_thr: ADC RSSI must be greater than or equal to this
  240. * threshold (signed Db) to ensure spectral scan
  241. * reporting with normal phy error codes (please see
  242. * ss_rssi_rpt_mode above).Though stored as an unsigned
  243. * value, this should be treated as a signed 8-bit int
  244. * @ss_pwr_format: Format of frequency bin magnitude for spectral scan
  245. * triggered FFTs 0: linear magnitude
  246. * 1: log magnitude (20*log10(lin_mag), 1/2 dB step size)
  247. * @ss_rpt_mode: Format of per-FFT reports to software for spectral
  248. * scan triggered FFTs
  249. * 0: No FFT report (only pulse end summary)
  250. * 1: 2-dword summary of metrics for each completed FFT
  251. * 2: 2-dword summary + 1x-oversampled bins(in-band) per
  252. * FFT
  253. * 3: 2-dword summary + 2x-oversampled bins (all) per FFT
  254. * @ss_bin_scale: Number of LSBs to shift out to scale the FFT bins
  255. * for spectral scan triggered FFTs
  256. * @ss_dbm_adj: Set (with ss_pwr_format=1), to report bin
  257. * magnitudes
  258. * converted to dBm power using the noisefloor
  259. * calibration results
  260. * @ss_chn_mask: Per chain enable mask to select input ADC for search
  261. * FFT
  262. * @ss_nf_cal: nf calibrated values for ctl+ext
  263. * @ss_nf_pwr: nf pwr values for ctl+ext
  264. * @ss_nf_temp_data: temperature data taken during nf scan
  265. */
  266. struct spectral_config {
  267. u_int16_t ss_fft_period;
  268. u_int16_t ss_period;
  269. u_int16_t ss_count;
  270. u_int16_t ss_short_report;
  271. u_int8_t radar_bin_thresh_sel;
  272. u_int16_t ss_spectral_pri;
  273. u_int16_t ss_fft_size;
  274. u_int16_t ss_gc_ena;
  275. u_int16_t ss_restart_ena;
  276. u_int16_t ss_noise_floor_ref;
  277. u_int16_t ss_init_delay;
  278. u_int16_t ss_nb_tone_thr;
  279. u_int16_t ss_str_bin_thr;
  280. u_int16_t ss_wb_rpt_mode;
  281. u_int16_t ss_rssi_rpt_mode;
  282. u_int16_t ss_rssi_thr;
  283. u_int16_t ss_pwr_format;
  284. u_int16_t ss_rpt_mode;
  285. u_int16_t ss_bin_scale;
  286. u_int16_t ss_dbm_adj;
  287. u_int16_t ss_chn_mask;
  288. int8_t ss_nf_cal[AH_MAX_CHAINS * 2];
  289. int8_t ss_nf_pwr[AH_MAX_CHAINS * 2];
  290. int32_t ss_nf_temp_data;
  291. };
  292. /**
  293. * struct spectral_scan_state - State of spectral scan
  294. * @is_active: Is spectral scan active
  295. * @is_enabled: Is spectral scan enabled
  296. */
  297. struct spectral_scan_state {
  298. uint8_t is_active;
  299. uint8_t is_enabled;
  300. };
  301. typedef enum _dcs_int_type {
  302. SPECTRAL_DCS_INT_NONE,
  303. SPECTRAL_DCS_INT_CW,
  304. SPECTRAL_DCS_INT_WIFI
  305. } DCS_INT_TYPE;
  306. /**
  307. * struct INTERF_RSP - Interference record
  308. * @interf_type: eINTERF_TYPE giving type of interference
  309. * @interf_min_freq: Minimum frequency in MHz at which interference has been
  310. * found
  311. * @interf_max_freq: Maximum frequency in MHz at which interference has been
  312. * found
  313. * @advncd_spectral_cap: Advanced spectral capability
  314. */
  315. struct INTERF_RSP {
  316. u_int8_t interf_type;
  317. u_int16_t interf_min_freq;
  318. u_int16_t interf_max_freq;
  319. } __ATTRIB_PACKED;
  320. /**
  321. * struct INTERF_SRC_RSP - List of interference sources
  322. * @count: Number of interference records
  323. * @interf: Array of interference records
  324. */
  325. struct INTERF_SRC_RSP {
  326. u_int16_t count;
  327. struct INTERF_RSP interf[MAX_INTERF];
  328. } __ATTRIB_PACKED;
  329. /**
  330. * struct spectral_classifier_params -
  331. * @spectral_20_40_mode: Is AP in 20/40 mode?
  332. * @spectral_dc_index: DC index
  333. * @spectral_dc_in_mhz: DC in MHz
  334. * @upper_chan_in_mhz: Upper channel in MHz
  335. * @lower_chan_in_mhz: Lower channel in MHz
  336. */
  337. typedef struct spectral_classifier_params {
  338. int spectral_20_40_mode;
  339. int spectral_dc_index;
  340. int spectral_dc_in_mhz;
  341. int upper_chan_in_mhz;
  342. int lower_chan_in_mhz;
  343. } __ATTRIB_PACKED SPECTRAL_CLASSIFIER_PARAMS;
  344. /**
  345. * struct spectral_samp_data - Spectral Analysis Messaging Protocol Data format
  346. * @spectral_data_len: Indicates the bin size
  347. * @spectral_data_len_sec80: Indicates the bin size for secondary 80 segment
  348. * @spectral_rssi: Indicates RSSI
  349. * @spectral_rssi_sec80: Indicates RSSI for secondary 80 segment
  350. * @spectral_combined_rssi: Indicates combined RSSI from all antennas
  351. * @spectral_upper_rssi: Indicates RSSI of upper band
  352. * @spectral_lower_rssi: Indicates RSSI of lower band
  353. * @spectral_chain_ctl_rssi: RSSI for control channel, for all antennas
  354. * @spectral_chain_ext_rssi: RSSI for extension channel, for all antennas
  355. * @spectral_max_scale: Indicates scale factor
  356. * @spectral_bwinfo: Indicates bandwidth info
  357. * @spectral_tstamp: Indicates timestamp
  358. * @spectral_max_index: Indicates the index of max magnitude
  359. * @spectral_max_index_sec80: Indicates the index of max magnitude for secondary
  360. * 80 segment
  361. * @spectral_max_mag: Indicates the maximum magnitude
  362. * @spectral_max_mag_sec80: Indicates the maximum magnitude for secondary 80
  363. * segment
  364. * @spectral_max_exp: Indicates the max exp
  365. * @spectral_last_tstamp: Indicates the last time stamp
  366. * @spectral_upper_max_index: Indicates the index of max mag in upper band
  367. * @spectral_lower_max_index: Indicates the index of max mag in lower band
  368. * @spectral_nb_upper: Not Used
  369. * @spectral_nb_lower: Not Used
  370. * @classifier_params: Indicates classifier parameters
  371. * @bin_pwr_count: Indicates the number of FFT bins
  372. * @lb_edge_extrabins: Number of extra bins on left band edge
  373. * @rb_edge_extrabins: Number of extra bins on right band edge
  374. * @bin_pwr_count_sec80: Indicates the number of FFT bins in secondary 80
  375. * segment
  376. * @bin_pwr: Contains FFT magnitudes
  377. * @bin_pwr_sec80: Contains FFT magnitudes for the secondary 80
  378. * segment
  379. * @interf_list: List of interfernce sources
  380. * @noise_floor: Indicates the current noise floor
  381. * @noise_floor_sec80: Indicates the current noise floor for secondary 80
  382. * segment
  383. * @ch_width: Channel width 20/40/80/160 MHz
  384. */
  385. typedef struct spectral_samp_data {
  386. int16_t spectral_data_len;
  387. int16_t spectral_data_len_sec80;
  388. int16_t spectral_rssi;
  389. int16_t spectral_rssi_sec80;
  390. int8_t spectral_combined_rssi;
  391. int8_t spectral_upper_rssi;
  392. int8_t spectral_lower_rssi;
  393. int8_t spectral_chain_ctl_rssi[MAX_SPECTRAL_CHAINS];
  394. int8_t spectral_chain_ext_rssi[MAX_SPECTRAL_CHAINS];
  395. u_int8_t spectral_max_scale;
  396. int16_t spectral_bwinfo;
  397. int32_t spectral_tstamp;
  398. int16_t spectral_max_index;
  399. int16_t spectral_max_index_sec80;
  400. int16_t spectral_max_mag;
  401. int16_t spectral_max_mag_sec80;
  402. u_int8_t spectral_max_exp;
  403. int32_t spectral_last_tstamp;
  404. int16_t spectral_upper_max_index;
  405. int16_t spectral_lower_max_index;
  406. u_int8_t spectral_nb_upper;
  407. u_int8_t spectral_nb_lower;
  408. struct spectral_classifier_params classifier_params;
  409. u_int16_t bin_pwr_count;
  410. /* For 11ac chipsets prior to AR900B version 2.0, a max of 512 bins are
  411. * delivered. However, there can be additional bins reported for
  412. * AR900B version 2.0 and QCA9984 as described next:
  413. *
  414. * AR900B version 2.0: An additional tone is processed on the right
  415. * hand side in order to facilitate detection of radar pulses out to
  416. * the extreme band-edge of the channel frequency.
  417. * Since the HW design processes four tones at a time,
  418. * this requires one additional Dword to be added to the
  419. * search FFT report.
  420. *
  421. * QCA9984: When spectral_scan_rpt_mode=2, i.e 2-dword summary +
  422. * 1x-oversampled bins (in-band) per FFT,
  423. * then 8 more bins (4 more on left side and 4 more on right side)
  424. * are added.
  425. */
  426. u_int8_t lb_edge_extrabins;
  427. u_int8_t rb_edge_extrabins;
  428. u_int16_t bin_pwr_count_sec80;
  429. u_int8_t bin_pwr[MAX_NUM_BINS];
  430. u_int8_t bin_pwr_sec80[MAX_NUM_BINS];
  431. struct INTERF_SRC_RSP interf_list;
  432. int16_t noise_floor;
  433. int16_t noise_floor_sec80;
  434. u_int32_t ch_width;
  435. } __ATTRIB_PACKED SPECTRAL_SAMP_DATA;
  436. /**
  437. * struct spectral_samp_msg - Spectral SAMP message
  438. * @signature: Validates the SAMP message
  439. * @freq: Operating frequency in MHz
  440. * @vhtop_ch_freq_seg1: VHT Segment 1 centre frequency in MHz
  441. * @vhtop_ch_freq_seg2: VHT Segment 2 centre frequency in MHz
  442. * @freq_loading: How busy was the channel
  443. * @dcs_enabled: Whether DCS is enabled
  444. * @int_type: Interference type indicated by DCS
  445. * @macaddr: Indicates the device interface
  446. * @samp_data: SAMP Data
  447. */
  448. typedef struct spectral_samp_msg {
  449. u_int32_t signature;
  450. u_int16_t freq;
  451. u_int16_t vhtop_ch_freq_seg1;
  452. u_int16_t vhtop_ch_freq_seg2;
  453. u_int16_t freq_loading;
  454. u_int16_t dcs_enabled;
  455. DCS_INT_TYPE int_type;
  456. u_int8_t macaddr[6];
  457. SPECTRAL_SAMP_DATA samp_data;
  458. } __ATTRIB_PACKED SPECTRAL_SAMP_MSG;
  459. #ifdef WIN32
  460. #pragma pack(pop, spectral)
  461. #endif
  462. #ifdef __ATTRIB_PACKED
  463. #undef __ATTRIB_PACKED
  464. #endif
  465. #endif /* _WLAN_SPECTRAL_PUBLIC_STRUCTS_H_ */