summaryrefslogtreecommitdiff
path: root/net-wireless/compat-wireless/files/compat-chaos.patch
blob: e1447b5f9135332ba29cf978c0bc769975ff57e7 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
diff -Naur compat-wireless-2.6.32-rc1/drivers/net/wireless/ath/ath5k/base.c compat-chaos/drivers/net/wireless/ath/ath5k/base.c
--- compat-wireless-2.6.32-rc1/drivers/net/wireless/ath/ath5k/base.c	2009-10-02 16:42:13.000000000 -0700
+++ compat-chaos/drivers/net/wireless/ath/ath5k/base.c	2009-10-05 09:45:40.000000000 -0700
@@ -285,7 +285,7 @@
 static void 	ath5k_detach(struct pci_dev *pdev,
 			struct ieee80211_hw *hw);
 /* Channel/mode setup */
-static inline short ath5k_ieee2mhz(short chan);
+static inline short ath5k_ieee2mhz(int chan, unsigned int chfreq);
 static unsigned int ath5k_copy_channels(struct ath5k_hw *ah,
 				struct ieee80211_channel *channels,
 				unsigned int mode,
@@ -889,7 +889,7 @@
  * Convert IEEE channel number to MHz frequency.
  */
 static inline short
-ath5k_ieee2mhz(short chan)
+ath5k_ieee2mhz(int chan, unsigned int chfreq)
 {
 	if (chan <= 14 || chan >= 27)
 		return ieee80211chan2mhz(chan);
@@ -902,13 +902,7 @@
  */
 static bool ath5k_is_standard_channel(short chan)
 {
-	return ((chan <= 14) ||
-		/* UNII 1,2 */
-		((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
-		/* midband */
-		((chan & 3) == 0 && chan >= 100 && chan <= 140) ||
-		/* UNII-3 */
-		((chan & 3) == 1 && chan >= 149 && chan <= 165));
+	return true;
 }
 
 static unsigned int
@@ -917,7 +911,8 @@
 		unsigned int mode,
 		unsigned int max)
 {
-	unsigned int i, count, size, chfreq, freq, ch;
+	unsigned int i, count, size, chfreq, freq;
+		int ch;
 
 	if (!test_bit(mode, ah->ah_modes))
 		return 0;
@@ -926,13 +921,15 @@
 	case AR5K_MODE_11A:
 	case AR5K_MODE_11A_TURBO:
 		/* 1..220, but 2GHz frequencies are filtered by check_channel */
-		size = 220 ;
+		size = 3000 ;
+		ch = -40;
 		chfreq = CHANNEL_5GHZ;
 		break;
 	case AR5K_MODE_11B:
 	case AR5K_MODE_11G:
 	case AR5K_MODE_11G_TURBO:
-		size = 26;
+		size = 3000;
+		ch = -43;
 		chfreq = CHANNEL_2GHZ;
 		break;
 	default:
@@ -940,9 +937,8 @@
 		return 0;
 	}
 
-	for (i = 0, count = 0; i < size && max > 0; i++) {
-		ch = i + 1 ;
-		freq = ath5k_ieee2mhz(ch);
+	for (i = 0, count = 0; i < size && max > 0; i++,ch++) {
+		freq = ath5k_ieee2mhz(ch,chfreq);
 
 		/* Check if channel is supported by the chipset */
 		if (!ath5k_channel_ok(ah, freq, chfreq))
@@ -1246,7 +1242,9 @@
 
 	rate = ieee80211_get_tx_rate(sc->hw, info);
 
-	if (info->flags & IEEE80211_TX_CTL_NO_ACK)
+	if (info->flags & IEEE80211_TX_CTL_NO_ACK ||
+ 	   (info->flags & IEEE80211_TX_CTL_INJECTED &&
+          !(ieee80211_has_morefrags(((struct ieee80211_hdr *)skb->data)->frame_control))))
 		flags |= AR5K_TXDESC_NOACK;
 
 	rc_flags = info->control.rates[0].flags;
diff -Naur compat-wireless-2.6.32-rc1/drivers/net/wireless/ath/ath5k/base.h compat-chaos/drivers/net/wireless/ath/ath5k/base.h
--- compat-wireless-2.6.32-rc1/drivers/net/wireless/ath/ath5k/base.h	2009-10-02 16:42:15.000000000 -0700
+++ compat-chaos/drivers/net/wireless/ath/ath5k/base.h	2009-10-05 09:46:12.000000000 -0700
@@ -110,9 +110,9 @@
 };
 
 #if CHAN_DEBUG
-#define ATH_CHAN_MAX	(26+26+26+200+200)
+#define ATH_CHAN_MAX	(4000)
 #else
-#define ATH_CHAN_MAX	(14+14+14+252+20)
+#define ATH_CHAN_MAX	(4000)
 #endif
 
 /* Software Carrier, keeps track of the driver state
diff -Naur compat-wireless-2.6.32-rc1/drivers/net/wireless/ath/ath5k/caps.c compat-chaos/drivers/net/wireless/ath/ath5k/caps.c
--- compat-wireless-2.6.32-rc1/drivers/net/wireless/ath/ath5k/caps.c	2009-10-02 16:42:13.000000000 -0700
+++ compat-chaos/drivers/net/wireless/ath/ath5k/caps.c	2009-10-05 09:47:07.000000000 -0700
@@ -69,8 +69,8 @@
 
 		if (AR5K_EEPROM_HDR_11A(ee_header)) {
 			/* 4920 */
-			ah->ah_capabilities.cap_range.range_5ghz_min = 5005;
-			ah->ah_capabilities.cap_range.range_5ghz_max = 6100;
+			ah->ah_capabilities.cap_range.range_5ghz_min = 4800;
+			ah->ah_capabilities.cap_range.range_5ghz_max = 6000;
 
 			/* Set supported modes */
 			__set_bit(AR5K_MODE_11A,
@@ -88,7 +88,7 @@
 		    (AR5K_EEPROM_HDR_11G(ee_header) &&
 		     ah->ah_version != AR5K_AR5211)) {
 			/* 2312 */
-			ah->ah_capabilities.cap_range.range_2ghz_min = 2412;
+			ah->ah_capabilities.cap_range.range_2ghz_min = 2192;
 			ah->ah_capabilities.cap_range.range_2ghz_max = 2732;
 
 			if (AR5K_EEPROM_HDR_11B(ee_header))
diff -Naur compat-wireless-2.6.32-rc1/drivers/net/wireless/ath/ath5k/phy.c compat-chaos/drivers/net/wireless/ath/ath5k/phy.c
--- compat-wireless-2.6.32-rc1/drivers/net/wireless/ath/ath5k/phy.c	2009-10-02 16:42:13.000000000 -0700
+++ compat-chaos/drivers/net/wireless/ath/ath5k/phy.c	2009-10-05 09:48:55.000000000 -0700
@@ -830,13 +830,7 @@
 bool ath5k_channel_ok(struct ath5k_hw *ah, u16 freq, unsigned int flags)
 {
 	/* Check if the channel is in our supported range */
-	if (flags & CHANNEL_2GHZ) {
-		if ((freq >= ah->ah_capabilities.cap_range.range_2ghz_min) &&
-		    (freq <= ah->ah_capabilities.cap_range.range_2ghz_max))
-			return true;
-	} else if (flags & CHANNEL_5GHZ)
-		if ((freq >= ah->ah_capabilities.cap_range.range_5ghz_min) &&
-		    (freq <= ah->ah_capabilities.cap_range.range_5ghz_max))
+	if ((freq >=2190) && (freq <=5900)) 
 			return true;
 
 	return false;
diff -Naur compat-wireless-2.6.32-rc1/include/net/ieee80211_radiotap.h compat-chaos/include/net/ieee80211_radiotap.h
--- compat-wireless-2.6.32-rc1/include/net/ieee80211_radiotap.h	2009-10-02 16:42:12.000000000 -0700
+++ compat-chaos/include/net/ieee80211_radiotap.h	2009-10-05 09:49:54.000000000 -0700
@@ -247,7 +247,7 @@
 #define ieee80211chan2mhz(x) \
 	(((x) <= 14) ? \
 	(((x) == 14) ? 2484 : ((x) * 5) + 2407) : \
-	((x) + 1000) * 5)
+	((x) + 2100))
 
 /* helpers */
 static inline int ieee80211_get_radiotap_len(unsigned char *data)
diff -Naur compat-wireless-2.6.32-rc1/net/mac80211/tx.c compat-chaos/net/mac80211/tx.c
--- compat-wireless-2.6.32-rc1/net/mac80211/tx.c	2009-10-02 16:42:12.000000000 -0700
+++ compat-chaos/net/mac80211/tx.c	2009-10-05 09:50:38.000000000 -0700
@@ -1392,6 +1392,7 @@
 {
 	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+	struct ieee80211_channel *chan = local->hw.conf.channel;
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
 	struct ieee80211_sub_if_data *tmp_sdata;
 	int headroom;