make acx-mac80211 compile against latest compat-wireless, still does not work though ;)
[oweals/openwrt.git] / package / acx-mac80211 / patches / 002-rate_definitions.patch
1 diff --git a/common.c b/common.c
2 index c3a288d..9c607de 100644
3 --- a/common.c
4 +++ b/common.c
5 @@ -1451,60 +1451,66 @@ void acx_free_modes(acx_device_t * adev)
6  //        adev->modes = NULL;
7  }
8  
9 -/*
10 -#define RATETAB_ENT(_rate, _rateid, _flags) \
11 -       {                                                       \
12 -               .rate   = (_rate),                              \
13 -               .val    = (_rateid),                            \
14 -               .val2   = (_rateid),                            \
15 -               .flags  = (_flags),                             \
16 -       }
17 -*/
18 -
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 },
40  };
41  
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,                            \
48 +       .max_power              = 30,                           \
49 +}
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, },
65 +       CHAN4G(1, 2412, 0),
66 +       CHAN4G(2, 2417, 0),
67 +       CHAN4G(3, 2422, 0),
68 +       CHAN4G(4, 2427, 0),
69 +       CHAN4G(5, 2432, 0),
70 +       CHAN4G(6, 2437, 0),
71 +       CHAN4G(7, 2442, 0),
72 +       CHAN4G(8, 2447, 0),
73 +       CHAN4G(9, 2452, 0),
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),
79  };
80 +#undef CHAN4G
81 +
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
86  
87  static struct ieee80211_supported_band g_band_2GHz = {
88 +       .band = IEEE80211_BAND_2GHZ,
89         .channels = channels,
90         .n_channels = ARRAY_SIZE(channels),
91 -       .bitrates = acx_rates,
92 -       .n_bitrates = 12,
93 +       .bitrates = acx_b_ratetable,
94 +       .n_bitrates = acx_g_ratetable_size,
95  };
96  
97  static struct ieee80211_supported_band b_band_2GHz = {
98 +       .band = IEEE80211_BAND_2GHZ,
99         .channels = channels,
100         .n_channels = ARRAY_SIZE(channels),
101 -       .bitrates = acx_rates,
102 -       .n_bitrates = 4,
103 +       .bitrates = acx_g_ratetable,
104 +       .n_bitrates = acx_b_ratetable_size,
105  };
106  
107  int acx_setup_modes(acx_device_t * adev)
108