1 /* 2 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 /** 20 * DOC: wlan_dfs_public_struct.h 21 * This file contains DFS data structures 22 */ 23 24 #ifndef __WLAN_DFS_PUBLIC_STRUCT_H_ 25 #define __WLAN_DFS_PUBLIC_STRUCT_H_ 26 27 /* TODO: This structure has many redundant variables, needs cleanup */ 28 /** 29 * struct radar_found_info - radar found info 30 * @pdev_id: pdev id. 31 * @detection_mode: 0 indicates RADAR detected, non-zero indicates debug mode. 32 * @freq_offset: frequency offset. 33 * @chan_width: channel width. 34 * @detector_id: detector id for full-offload. 35 * @segment_id: segment id (same as detector_id) for partial-offload. 36 * @timestamp: timestamp (Time when filter match is found in Firmware). 37 * @is_chirp: is chirp or not. 38 * @chan_freq: channel frequency (Primary channel frequency). 39 * @radar_freq: radar frequency (Is it same as '@chan_freq'?). 40 * @sidx: sidx value (same as freq_offset). 41 */ 42 struct radar_found_info { 43 uint32_t pdev_id; 44 uint32_t detection_mode; 45 int32_t freq_offset; 46 uint32_t chan_width; 47 uint32_t detector_id; 48 uint32_t segment_id; 49 uint32_t timestamp; 50 uint32_t is_chirp; 51 uint32_t chan_freq; 52 uint32_t radar_freq; 53 int32_t sidx; 54 }; 55 56 /** 57 * struct dfs_acs_info - acs info, ch range 58 * @acs_mode: to enable/disable acs 1/0. 59 * @start_ch: start channel number, ignore all channels before. 60 * @end_ch: end channel number, ignore all channels after. 61 */ 62 struct dfs_acs_info { 63 uint8_t acs_mode; 64 uint8_t start_ch; 65 uint8_t end_ch; 66 }; 67 68 /** 69 * struct radar_event_info - radar event info. 70 * @pulse_is_chirp: flag to indicate if this pulse is chirp. 71 * @pulse_center_freq: the center frequency of the radar pulse detected, KHz. 72 * @pulse_duration: the duaration of the pulse in us. 73 * @rssi: RSSI recorded in the ppdu. 74 * @pulse_detect_ts: timestamp indicates the time when DFS pulse is detected. 75 * @upload_fullts_low: low 32 tsf timestamp get from MAC tsf timer indicates 76 * the time that the radar event uploading to host. 77 * @upload_fullts_high: high 32 tsf timestamp get from MAC tsf timer indicates 78 * the time that the radar event uploading to host. 79 * @peak_sidx: index of peak magnitude bin (signed) 80 * @pdev_id: pdev_id for identifying the MAC. 81 */ 82 struct radar_event_info { 83 uint8_t pulse_is_chirp; 84 uint32_t pulse_center_freq; 85 uint32_t pulse_duration; 86 uint8_t rssi; 87 uint32_t pulse_detect_ts; 88 uint32_t upload_fullts_low; 89 uint32_t upload_fullts_high; 90 int32_t peak_sidx; 91 uint8_t pdev_id; 92 uint8_t delta_diff; 93 int8_t delta_peak; 94 }; 95 96 /** 97 * struct dfs_user_config - user configuration required for for DFS. 98 * @dfs_is_phyerr_filter_offload: flag to indicate DFS phyerr filtering offload. 99 */ 100 struct dfs_user_config { 101 bool dfs_is_phyerr_filter_offload; 102 }; 103 #endif 104