1 diff --git a/common.c b/common.c
2 index c3a288d..9c607de 100644
5 @@ -1451,60 +1451,66 @@ void acx_free_modes(acx_device_t * adev)
10 -#define RATETAB_ENT(_rate, _rateid, _flags) \
14 - .val2 = (_rateid), \
15 - .flags = (_flags), \
19 static struct ieee80211_rate acx_rates[] = {
20 { .bitrate = 10, .hw_value = 0, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
21 { .bitrate = 20, .hw_value = 1, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
22 { .bitrate = 55, .hw_value = 2, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
23 { .bitrate = 110, .hw_value = 3, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
24 - { .bitrate = 60, .hw_value = 4, },
25 - { .bitrate = 90, .hw_value = 5, },
26 - { .bitrate = 120, .hw_value = 6, },
27 - { .bitrate = 180, .hw_value = 7, },
28 - { .bitrate = 240, .hw_value = 8, },
29 - { .bitrate = 360, .hw_value = 9, },
30 - { .bitrate = 480, .hw_value = 10, },
31 - { .bitrate = 540, .hw_value = 11, },
32 + { .bitrate = 60, .hw_value = 4, .flags = 0 },
33 + { .bitrate = 90, .hw_value = 5, .flags = 0 },
34 + { .bitrate = 120, .hw_value = 6, .flags = 0 },
35 + { .bitrate = 180, .hw_value = 7, .flags = 0 },
36 + { .bitrate = 240, .hw_value = 8, .flags = 0 },
37 + { .bitrate = 360, .hw_value = 9, .flags = 0 },
38 + { .bitrate = 480, .hw_value = 10, .flags = 0 },
39 + { .bitrate = 540, .hw_value = 11, .flags = 0 },
42 +#define CHAN4G(_channel, _freq, _flags) { \
43 + .band = IEEE80211_BAND_2GHZ, \
44 + .center_freq = (_freq), \
45 + .hw_value = (_channel), \
46 + .flags = (_flags), \
47 + .max_antenna_gain = 0, \
50 static struct ieee80211_channel channels[] = {
51 - { .center_freq = 2412, .hw_value = 1, },
52 - { .center_freq = 2417, .hw_value = 2, },
53 - { .center_freq = 2422, .hw_value = 3, },
54 - { .center_freq = 2427, .hw_value = 4, },
55 - { .center_freq = 2432, .hw_value = 5, },
56 - { .center_freq = 2437, .hw_value = 6, },
57 - { .center_freq = 2442, .hw_value = 7, },
58 - { .center_freq = 2447, .hw_value = 8, },
59 - { .center_freq = 2452, .hw_value = 9, },
60 - { .center_freq = 2457, .hw_value = 10, },
61 - { .center_freq = 2462, .hw_value = 11, },
62 - { .center_freq = 2467, .hw_value = 12, },
63 - { .center_freq = 2472, .hw_value = 13, },
64 - { .center_freq = 2484, .hw_value = 14, },
74 + CHAN4G(10, 2457, 0),
75 + CHAN4G(11, 2462, 0),
76 + CHAN4G(12, 2467, 0),
77 + CHAN4G(13, 2472, 0),
78 + CHAN4G(14, 2484, 0),
82 +#define acx_b_ratetable (acx_rates + 0)
83 +#define acx_b_ratetable_size 4
84 +#define acx_g_ratetable (acx_rates + 0)
85 +#define acx_g_ratetable_size 12
87 static struct ieee80211_supported_band g_band_2GHz = {
88 + .band = IEEE80211_BAND_2GHZ,
90 .n_channels = ARRAY_SIZE(channels),
91 - .bitrates = acx_rates,
93 + .bitrates = acx_b_ratetable,
94 + .n_bitrates = acx_g_ratetable_size,
97 static struct ieee80211_supported_band b_band_2GHz = {
98 + .band = IEEE80211_BAND_2GHZ,
100 .n_channels = ARRAY_SIZE(channels),
101 - .bitrates = acx_rates,
103 + .bitrates = acx_g_ratetable,
104 + .n_bitrates = acx_b_ratetable_size,
107 int acx_setup_modes(acx_device_t * adev)