summaryrefslogtreecommitdiff
path: root/package/acx-mac80211/patches/002-rate_definitions.patch
blob: 7c9dc459e0faf4212cc993db9decc22517d56ef2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
--- a/common.c
+++ b/common.c
@@ -1452,60 +1452,66 @@ void acx_free_modes(acx_device_t * adev)
 //        adev->modes = NULL;
 }
 
-/*
-#define RATETAB_ENT(_rate, _rateid, _flags) \
-	{							\
-		.rate	= (_rate),				\
-		.val	= (_rateid),				\
-		.val2   = (_rateid),				\
-		.flags  = (_flags),				\
-	}
-*/
-
 static struct ieee80211_rate acx_rates[] = {
 	{ .bitrate = 10, .hw_value = 0, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
 	{ .bitrate = 20, .hw_value = 1, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
 	{ .bitrate = 55, .hw_value = 2, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
 	{ .bitrate = 110, .hw_value = 3, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
-	{ .bitrate = 60, .hw_value = 4, },
-	{ .bitrate = 90, .hw_value = 5, },
-	{ .bitrate = 120, .hw_value = 6, },
-	{ .bitrate = 180, .hw_value = 7, },
-	{ .bitrate = 240, .hw_value = 8, },
-	{ .bitrate = 360, .hw_value = 9, },
-	{ .bitrate = 480, .hw_value = 10, },
-	{ .bitrate = 540, .hw_value = 11, },
+	{ .bitrate = 60, .hw_value = 4, .flags = 0 },
+	{ .bitrate = 90, .hw_value = 5, .flags = 0 },
+	{ .bitrate = 120, .hw_value = 6, .flags = 0 },
+	{ .bitrate = 180, .hw_value = 7, .flags = 0 },
+	{ .bitrate = 240, .hw_value = 8, .flags = 0 },
+	{ .bitrate = 360, .hw_value = 9, .flags = 0 },
+	{ .bitrate = 480, .hw_value = 10, .flags = 0 },
+	{ .bitrate = 540, .hw_value = 11, .flags = 0 },
 };
 
+#define CHAN4G(_channel, _freq, _flags) {			\
+	.band			= IEEE80211_BAND_2GHZ,		\
+	.center_freq		= (_freq),			\
+	.hw_value		= (_channel),			\
+	.flags			= (_flags),			\
+	.max_antenna_gain	= 0,				\
+	.max_power		= 30,				\
+}
 static struct ieee80211_channel channels[] = {
-	{ .center_freq = 2412, .hw_value = 1, },
-	{ .center_freq = 2417, .hw_value = 2, },
-	{ .center_freq = 2422, .hw_value = 3, },
-	{ .center_freq = 2427, .hw_value = 4, },
-	{ .center_freq = 2432, .hw_value = 5, },
-	{ .center_freq = 2437, .hw_value = 6, },
-	{ .center_freq = 2442, .hw_value = 7, },
-	{ .center_freq = 2447, .hw_value = 8, },
-	{ .center_freq = 2452, .hw_value = 9, },
-	{ .center_freq = 2457, .hw_value = 10, },
-	{ .center_freq = 2462, .hw_value = 11, },
-	{ .center_freq = 2467, .hw_value = 12, },
-	{ .center_freq = 2472, .hw_value = 13, },
-	{ .center_freq = 2484, .hw_value = 14, },
+	CHAN4G(1, 2412, 0),
+	CHAN4G(2, 2417, 0),
+	CHAN4G(3, 2422, 0),
+	CHAN4G(4, 2427, 0),
+	CHAN4G(5, 2432, 0),
+	CHAN4G(6, 2437, 0),
+	CHAN4G(7, 2442, 0),
+	CHAN4G(8, 2447, 0),
+	CHAN4G(9, 2452, 0),
+	CHAN4G(10, 2457, 0),
+	CHAN4G(11, 2462, 0),
+	CHAN4G(12, 2467, 0),
+	CHAN4G(13, 2472, 0),
+	CHAN4G(14, 2484, 0),
 };
+#undef CHAN4G
+
+#define acx_b_ratetable		(acx_rates + 0)
+#define acx_b_ratetable_size	4
+#define acx_g_ratetable		(acx_rates + 0)
+#define acx_g_ratetable_size	12
 
 static struct ieee80211_supported_band g_band_2GHz = {
+	.band = IEEE80211_BAND_2GHZ,
 	.channels = channels,
 	.n_channels = ARRAY_SIZE(channels),
-	.bitrates = acx_rates,
-	.n_bitrates = 12,
+	.bitrates = acx_b_ratetable,
+	.n_bitrates = acx_g_ratetable_size,
 };
 
 static struct ieee80211_supported_band b_band_2GHz = {
+	.band = IEEE80211_BAND_2GHZ,
 	.channels = channels,
 	.n_channels = ARRAY_SIZE(channels),
-	.bitrates = acx_rates,
-	.n_bitrates = 4,
+	.bitrates = acx_g_ratetable,
+	.n_bitrates = acx_b_ratetable_size,
 };
 
 int acx_setup_modes(acx_device_t * adev)