2 * carl9170 firmware - used by the ar9170 wireless device
4 * Radar pulse definitions
6 * Copyright 2012 Christian Lamparter <chunkeey@googlemail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __CARL9170FW_RADAR_H
24 #define __CARL9170FW_RADAR_H
26 #include "generated/autoconf.h"
44 __CARL9170FW_NUM_RADARS
49 const struct radar_info_pattern *pattern;
52 struct radar_info_pattern {
53 unsigned int pulse_width;
54 unsigned int pulse_interval;
55 uint32_t pulse_pattern;
59 static const struct radar_info_pattern radar_NO_RADAR[0] = { };
60 static const struct radar_info_pattern radar_ONE_KHZ[] = {
63 .pulse_interval = 1000,
64 .pulse_pattern = 0xa7438080,
69 static const struct radar_info_pattern radar_TEN_KHZ[] = {
72 .pulse_interval = 100,
73 .pulse_pattern = 0x436f0001,
78 static const struct radar_info_pattern radar_ONE_TWO_KHZ[] = {
81 .pulse_interval = 1000,
82 .pulse_pattern = 0xa7438080,
88 .pulse_interval = 500,
89 .pulse_pattern = 0xa7431001,
96 * <http://linuxwireless.org/en/developers/DFS>
99 /* FCC Test Signal 1 - 1us pulse, 1428 us interval */
100 static const struct radar_info_pattern radar_FCC1[] = {
103 .pulse_interval = 1428,
104 .pulse_pattern = 0xa7438080,
105 .pulse_mode = 0x5f01,
109 /* FCC Test Signal 4 - 11-20us pulse, 200-500 us interval */
110 static const struct radar_info_pattern radar_FCC4[] = {
113 .pulse_interval = 200,
114 .pulse_pattern = 0xf3128008,
115 .pulse_mode = 0x5f01,
119 /* ETSI Test Signal 1 (Fixed) - 1us Pulse, 750 us interval */
120 static const struct radar_info_pattern radar_ETSIFIXED[] = {
123 .pulse_interval = 750,
124 .pulse_pattern = 0x8a5f8080,
125 .pulse_mode = 0x5f01,
130 #define ADD_RADAR(name) [name] = { .pulses = ARRAY_SIZE(radar_## name), .pattern = radar_## name }
132 static const struct radar_info radars[__CARL9170FW_NUM_RADARS] = {
136 ADD_RADAR(ONE_TWO_KHZ),
139 ADD_RADAR(ETSIFIXED),
142 #define MAP_ENTRY(idx) [idx] = { .index = idx, .name = # idx , }
143 #define NAMED_MAP_ENTRY(idx, named) [idx] = {.index = idx, .name = named, }
145 static const struct carl9170fw_radar_map_entry radar_names[__CARL9170FW_NUM_RADARS] = {
149 MAP_ENTRY(ONE_TWO_KHZ),
154 MAP_ENTRY(ETSIFIXED),
157 #endif /* __CARL9170FW_RADAR_H */