2 * carl9170 firmware - used by the ar9170 wireless device
4 * Pattern 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_PATTERN_H
24 #define __CARL9170FW_PATTERN_H
43 __CARL9170FW_NUM_PATTERNS
46 struct pattern_pulse_info {
47 unsigned int pulse_width;
48 unsigned int pulse_interval;
49 uint32_t pulse_pattern;
55 const struct pattern_pulse_info *pattern;
58 static const struct pattern_pulse_info pattern_NO_PATTERN[0] = { };
59 static const struct pattern_pulse_info pattern_ONE_KHZ[] = {
62 .pulse_interval = 1000,
63 .pulse_pattern = 0xa7438080,
68 static const struct pattern_pulse_info pattern_TEN_KHZ[] = {
71 .pulse_interval = 100,
72 .pulse_pattern = 0x436f0001,
77 static const struct pattern_pulse_info pattern_ONE_TWO_KHZ[] = {
80 .pulse_interval = 1000,
81 .pulse_pattern = 0xa7438080,
87 .pulse_interval = 500,
88 .pulse_pattern = 0xa7431001,
95 * <http://linuxwireless.org/en/developers/DFS>
98 /* FCC Test Signal 1 - 1us pulse, 1428 us interval */
99 static const struct pattern_pulse_info pattern_FCC1[] = {
102 .pulse_interval = 1428,
103 .pulse_pattern = 0xa7438080,
104 .pulse_mode = 0x5f01,
108 /* FCC Test Signal 4 - 11-20us pulse, 200-500 us interval */
109 static const struct pattern_pulse_info pattern_FCC4[] = {
112 .pulse_interval = 200,
113 .pulse_pattern = 0xf3128008,
114 .pulse_mode = 0x5f01,
118 /* ETSI Test Signal 1 (Fixed) - 1us Pulse, 750 us interval */
119 static const struct pattern_pulse_info pattern_ETSIFIXED[] = {
122 .pulse_interval = 750,
123 .pulse_pattern = 0x8a5f8080,
124 .pulse_mode = 0x5f01,
129 #define ADD_RADAR(name) [name] = { .pulses = ARRAY_SIZE(pattern_## name), .pattern = pattern_## name }
131 static const struct pattern_info patterns[__CARL9170FW_NUM_PATTERNS] = {
132 ADD_RADAR(NO_PATTERN),
135 ADD_RADAR(ONE_TWO_KHZ),
138 ADD_RADAR(ETSIFIXED),
141 #define MAP_ENTRY(idx) [idx] = { .index = idx, .name = # idx , }
142 #define NAMED_MAP_ENTRY(idx, named) [idx] = {.index = idx, .name = named, }
144 static const struct carl9170fw_pattern_map_entry pattern_names[__CARL9170FW_NUM_PATTERNS] = {
145 MAP_ENTRY(NO_PATTERN),
148 MAP_ENTRY(ONE_TWO_KHZ),
153 MAP_ENTRY(ETSIFIXED),
156 #endif /* __CARL9170FW_PATTERN_H */