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