| 1 |
diff -Naur rtl8187_orig/beta-8187/ieee80211.h rtl8187_txpower/beta-8187/ieee80211.h |
| 2 |
--- rtl8187_orig/beta-8187/ieee80211.h 2006-06-06 04:58:02.000000000 +0200 |
| 3 |
+++ rtl8187_txpower/beta-8187/ieee80211.h 2007-01-24 20:49:55.897494222 +0100 |
| 4 |
@@ -156,6 +156,23 @@ |
| 5 |
struct list_head list; |
| 6 |
}; |
| 7 |
|
| 8 |
+#define LWNG_CAP_DID_BASE (4 | (1 << 6)) /* section 4, group 1 */ |
| 9 |
+#define IW_MODE_MONITOR_PRISM 15 |
| 10 |
+/* ARPHRD_IEEE80211_PRISM uses a bloated version of Prism2 RX frame header |
| 11 |
+ * (from linux-wlan-ng) */ |
| 12 |
+struct linux_wlan_ng_val { |
| 13 |
+ u32 did; |
| 14 |
+ u16 status, len; |
| 15 |
+ u32 data; |
| 16 |
+} __attribute__ ((packed)); |
| 17 |
+ |
| 18 |
+struct linux_wlan_ng_prism_hdr { |
| 19 |
+ u32 msgcode, msglen; |
| 20 |
+ char devname[16]; |
| 21 |
+ struct linux_wlan_ng_val hosttime, mactime, channel, rssi, sq, signal, |
| 22 |
+ noise, rate, istx, frmlen; |
| 23 |
+} __attribute__ ((packed)); |
| 24 |
+ |
| 25 |
struct ieee80211_hdr { |
| 26 |
u16 frame_ctl; |
| 27 |
u16 duration_id; |
| 28 |
diff -Naur rtl8187_orig/beta-8187/r8180_hw.h rtl8187_txpower/beta-8187/r8180_hw.h |
| 29 |
--- rtl8187_orig/beta-8187/r8180_hw.h 2006-06-06 04:58:00.000000000 +0200 |
| 30 |
+++ rtl8187_txpower/beta-8187/r8180_hw.h 2007-01-24 20:49:55.942487382 +0100 |
| 31 |
@@ -646,6 +646,7 @@ |
| 32 |
#define FFER_INTR ((1<<15)) |
| 33 |
#define FFER_GWAKE ((1<< 4)) |
| 34 |
|
| 35 |
- |
| 36 |
+#define MAX_TX_POWER 27 |
| 37 |
+#define MIN_TX_POWER 20 |
| 38 |
|
| 39 |
#endif |
| 40 |
diff -Naur rtl8187_orig/beta-8187/r8180_rtl8225.h rtl8187_txpower/beta-8187/r8180_rtl8225.h |
| 41 |
--- rtl8187_orig/beta-8187/r8180_rtl8225.h 2006-06-06 04:58:00.000000000 +0200 |
| 42 |
+++ rtl8187_txpower/beta-8187/r8180_rtl8225.h 2007-01-24 20:49:55.980481606 +0100 |
| 43 |
@@ -44,3 +44,5 @@ |
| 44 |
extern u32 rtl8225_chan[]; |
| 45 |
|
| 46 |
#endif |
| 47 |
+ |
| 48 |
+void rtl8225z2_SetTXPowerLevel(struct net_device *dev, short ch); |
| 49 |
diff -Naur rtl8187_orig/beta-8187/r8180_rtl8225z2.c rtl8187_txpower/beta-8187/r8180_rtl8225z2.c |
| 50 |
--- rtl8187_orig/beta-8187/r8180_rtl8225z2.c 2006-06-06 04:58:02.000000000 +0200 |
| 51 |
+++ rtl8187_txpower/beta-8187/r8180_rtl8225z2.c 2007-01-24 20:49:52.313039142 +0100 |
| 52 |
@@ -418,7 +418,10 @@ |
| 53 |
|
| 54 |
/* CCK power setting */ |
| 55 |
if(cck_power_level > max_cck_power_level) |
| 56 |
+ { |
| 57 |
cck_power_level = max_cck_power_level; |
| 58 |
+ priv->chtxpwr[ch] = max_cck_power_level; |
| 59 |
+ } |
| 60 |
|
| 61 |
cck_power_level += priv->cck_txpwr_base; |
| 62 |
|
| 63 |
diff -Naur rtl8187_orig/beta-8187/r8180_wx.c rtl8187_txpower/beta-8187/r8180_wx.c |
| 64 |
--- rtl8187_orig/beta-8187/r8180_wx.c 2006-06-06 04:58:02.000000000 +0200 |
| 65 |
+++ rtl8187_txpower/beta-8187/r8180_wx.c 2007-01-24 20:49:52.347033974 +0100 |
| 66 |
@@ -21,6 +21,7 @@ |
| 67 |
|
| 68 |
#include "r8187.h" |
| 69 |
#include "r8180_hw.h" |
| 70 |
+#include "r8180_rtl8225.h" |
| 71 |
|
| 72 |
|
| 73 |
#define RATE_COUNT 4 |
| 74 |
@@ -108,6 +109,61 @@ |
| 75 |
return ret; |
| 76 |
} |
| 77 |
|
| 78 |
+static int r8180_wx_get_txpow(struct net_device *dev, |
| 79 |
+ struct iw_request_info *info, |
| 80 |
+ union iwreq_data *wrqu, char *extra) |
| 81 |
+{ |
| 82 |
+ struct r8180_priv *priv = ieee80211_priv(dev); |
| 83 |
+ down(&priv->wx_sem); |
| 84 |
+ wrqu->power.value = priv->chtxpwr_ofdm[1] + MIN_TX_POWER; |
| 85 |
+ wrqu->power.fixed = 1; |
| 86 |
+ wrqu->power.flags = IW_TXPOW_DBM; |
| 87 |
+ wrqu->power.disabled = 0; |
| 88 |
+ up(&priv->wx_sem); |
| 89 |
+ |
| 90 |
+ return 0; |
| 91 |
+} |
| 92 |
+ |
| 93 |
+static int r8180_wx_set_txpow(struct net_device *dev, |
| 94 |
+ struct iw_request_info *info, |
| 95 |
+ union iwreq_data *wrqu, char *extra) |
| 96 |
+{ |
| 97 |
+ int ret = 0, i = 0; |
| 98 |
+ struct r8180_priv *priv = ieee80211_priv(dev); |
| 99 |
+ |
| 100 |
+ down(&priv->wx_sem); |
| 101 |
+ |
| 102 |
+ if (wrqu->power.flags != IW_TXPOW_DBM) |
| 103 |
+ { |
| 104 |
+ ret = -EINVAL; |
| 105 |
+ goto out; |
| 106 |
+ } |
| 107 |
+ |
| 108 |
+ if(wrqu->power.value > MAX_TX_POWER) |
| 109 |
+ { |
| 110 |
+ ret = -EINVAL; |
| 111 |
+ goto out; |
| 112 |
+ } |
| 113 |
+ |
| 114 |
+ if(wrqu->power.value < MIN_TX_POWER) |
| 115 |
+ { |
| 116 |
+ ret = -EINVAL; |
| 117 |
+ goto out; |
| 118 |
+ } |
| 119 |
+ |
| 120 |
+ for(i=1;i<=14;i++) |
| 121 |
+ { |
| 122 |
+ priv->chtxpwr[i] = wrqu->power.value + 1 - MIN_TX_POWER; |
| 123 |
+ priv->chtxpwr_ofdm[i] = wrqu->power.value - MIN_TX_POWER; |
| 124 |
+ } |
| 125 |
+ rtl8225z2_SetTXPowerLevel(dev, 1); |
| 126 |
+ |
| 127 |
+ out: |
| 128 |
+ up(&priv->wx_sem); |
| 129 |
+ |
| 130 |
+ return ret; |
| 131 |
+} |
| 132 |
+ |
| 133 |
static int r8180_wx_set_rawtx(struct net_device *dev, |
| 134 |
struct iw_request_info *info, |
| 135 |
union iwreq_data *wrqu, char *extra) |
| 136 |
@@ -623,8 +679,8 @@ |
| 137 |
dummy, /* SIOCGIWRTS */ |
| 138 |
r8180_wx_set_frag, /* SIOCSIWFRAG */ |
| 139 |
r8180_wx_get_frag, /* SIOCGIWFRAG */ |
| 140 |
- dummy, /* SIOCSIWTXPOW */ |
| 141 |
- dummy, /* SIOCGIWTXPOW */ |
| 142 |
+ r8180_wx_set_txpow, /* SIOCSIWTXPOW */ |
| 143 |
+ r8180_wx_get_txpow, /* SIOCGIWTXPOW */ |
| 144 |
r8180_wx_set_retry, /* SIOCSIWRETRY */ |
| 145 |
r8180_wx_get_retry, /* SIOCGIWRETRY */ |
| 146 |
r8180_wx_set_enc, /* SIOCSIWENCODE */ |
| 147 |
diff -Naur rtl8187_orig/beta-8187/r8187_core.c rtl8187_txpower/beta-8187/r8187_core.c |
| 148 |
--- rtl8187_orig/beta-8187/r8187_core.c 2006-06-22 07:43:30.000000000 +0200 |
| 149 |
+++ rtl8187_txpower/beta-8187/r8187_core.c 2007-01-24 20:49:52.381028806 +0100 |
| 150 |
@@ -158,7 +158,6 @@ |
| 151 |
#endif |
| 152 |
}; |
| 153 |
|
| 154 |
- |
| 155 |
void write_nic_byte_E(struct net_device *dev, int indx, u8 data) |
| 156 |
{ |
| 157 |
|
| 158 |
@@ -407,13 +406,14 @@ |
| 159 |
return len; |
| 160 |
} |
| 161 |
|
| 162 |
- |
| 163 |
+#if WIRELESS_EXT < 17 |
| 164 |
static struct iw_statistics *r8180_get_wireless_stats(struct net_device *dev) |
| 165 |
{ |
| 166 |
struct r8180_priv *priv = ieee80211_priv(dev); |
| 167 |
|
| 168 |
return &priv->wstats; |
| 169 |
} |
| 170 |
+#endif |
| 171 |
|
| 172 |
void rtl8180_proc_module_init(void) |
| 173 |
{ |
| 174 |
@@ -1112,7 +1112,10 @@ |
| 175 |
struct ieee80211_hdr *h = (struct ieee80211_hdr *) skb->data; |
| 176 |
|
| 177 |
if (le16_to_cpu(h->frame_ctl) & IEEE80211_FCTL_MOREFRAGS) |
| 178 |
- morefrag = 1; |
| 179 |
+ { |
| 180 |
+ if(priv->ieee80211->iw_mode != IW_MODE_MONITOR || priv->ieee80211->raw_tx != 1) |
| 181 |
+ morefrag = 1; |
| 182 |
+ } |
| 183 |
// DMESG("%x %x", h->frame_ctl, h->seq_ctl); |
| 184 |
/* |
| 185 |
* This function doesn't require lock because we make |
| 186 |
@@ -2291,13 +2294,17 @@ |
| 187 |
/* based on ipw2200 driver */ |
| 188 |
int rtl8180_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
| 189 |
{ |
| 190 |
- struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); |
| 191 |
+ struct r8180_priv *priv = NULL; |
| 192 |
+ struct iwreq *wrq = NULL; |
| 193 |
+ |
| 194 |
+ int ret=-1; |
| 195 |
+ |
| 196 |
+ priv = (struct r8180_priv *)ieee80211_priv(dev); |
| 197 |
|
| 198 |
down(&priv->wx_sem); |
| 199 |
|
| 200 |
- struct iwreq *wrq = (struct iwreq *)rq; |
| 201 |
- |
| 202 |
- int ret=-1; |
| 203 |
+ wrq = (struct iwreq *)rq; |
| 204 |
+ |
| 205 |
switch (cmd) { |
| 206 |
case RTL_IOCTL_WPA_SUPPLICANT: |
| 207 |
ret = ieee80211_wpa_supplicant_ioctl(priv->ieee80211, &wrq->u.data); |
| 208 |
@@ -2346,7 +2353,8 @@ |
| 209 |
|
| 210 |
if( flen <= rx_urb->actual_length){ |
| 211 |
|
| 212 |
- stats.signal = (desc[1] & 0x7f00)>>8; |
| 213 |
+// stats.signal = (desc[1] & 0x7f00)>>8; |
| 214 |
+ stats.signal = (desc[1] & 0xff00)>>8; |
| 215 |
stats.noise = desc[1] &0xff; |
| 216 |
stats.rate = desc[0] >> 20 & 0xf; |
| 217 |
stats.mac_time[0] = desc[2]; |
| 218 |
@@ -2368,6 +2376,8 @@ |
| 219 |
// priv->rxskb = skb; |
| 220 |
// priv->tempstats = &stats; |
| 221 |
|
| 222 |
+ |
| 223 |
+ stats.signal -= stats.noise; |
| 224 |
if(!ieee80211_rx(priv->ieee80211, |
| 225 |
skb, &stats)) |
| 226 |
dev_kfree_skb_any(skb); |
| 227 |
@@ -2418,7 +2428,12 @@ |
| 228 |
dev->do_ioctl = rtl8180_ioctl; |
| 229 |
dev->set_multicast_list = r8180_set_multicast; |
| 230 |
dev->set_mac_address = r8180_set_mac_adr; |
| 231 |
+#if WIRELESS_EXT >= 12 |
| 232 |
+#if WIRELESS_EXT < 17 |
| 233 |
dev->get_wireless_stats = r8180_get_wireless_stats; |
| 234 |
+#endif |
| 235 |
+ dev->wireless_handlers = (struct iw_handler_def *) &r8180_wx_handlers_def; |
| 236 |
+#endif |
| 237 |
dev->type=ARPHRD_ETHER; |
| 238 |
|
| 239 |
if (dev_alloc_name(dev, ifname) < 0){ |
| 240 |
diff -Naur rtl8187_orig/beta-8187/r8187.h rtl8187_txpower/beta-8187/r8187.h |
| 241 |
--- rtl8187_orig/beta-8187/r8187.h 2006-06-06 08:48:10.000000000 +0200 |
| 242 |
+++ rtl8187_txpower/beta-8187/r8187.h 2007-01-24 20:49:56.017475982 +0100 |
| 243 |
@@ -26,7 +26,6 @@ |
| 244 |
|
| 245 |
#include <linux/module.h> |
| 246 |
#include <linux/kernel.h> |
| 247 |
-#include <linux/config.h> |
| 248 |
#include <linux/init.h> |
| 249 |
#include <linux/ioport.h> |
| 250 |
#include <linux/sched.h> |
| 251 |
@@ -47,6 +46,10 @@ |
| 252 |
#include <asm/io.h> |
| 253 |
#include <asm/semaphore.h> |
| 254 |
|
| 255 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 256 |
+#include <linux/config.h> |
| 257 |
+#endif |
| 258 |
+ |
| 259 |
#include "ieee80211.h" |
| 260 |
|
| 261 |
#define EPROM_93c46 0 |
| 262 |
@@ -148,7 +151,7 @@ |
| 263 |
u8 challow[15]; //channels from 1 to 14, 0 not used |
| 264 |
short up; |
| 265 |
short crcmon; //if 1 allow bad crc frame reception in monitor mode |
| 266 |
-// short prism_hdr; |
| 267 |
+ short prism_hdr; |
| 268 |
|
| 269 |
// struct timer_list scan_timer; |
| 270 |
/*short scanpending; |
| 271 |
diff -Naur rtl8187_orig/beta-8187/r8187.mod.c rtl8187_txpower/beta-8187/r8187.mod.c |
| 272 |
--- rtl8187_orig/beta-8187/r8187.mod.c 1970-01-01 01:00:00.000000000 +0100 |
| 273 |
+++ rtl8187_txpower/beta-8187/r8187.mod.c 2007-01-24 20:49:52.415023638 +0100 |
| 274 |
@@ -0,0 +1,25 @@ |
| 275 |
+#include <linux/module.h> |
| 276 |
+#include <linux/vermagic.h> |
| 277 |
+#include <linux/compiler.h> |
| 278 |
+ |
| 279 |
+MODULE_INFO(vermagic, VERMAGIC_STRING); |
| 280 |
+ |
| 281 |
+struct module __this_module |
| 282 |
+__attribute__((section(".gnu.linkonce.this_module"))) = { |
| 283 |
+ .name = KBUILD_MODNAME, |
| 284 |
+ .init = init_module, |
| 285 |
+#ifdef CONFIG_MODULE_UNLOAD |
| 286 |
+ .exit = cleanup_module, |
| 287 |
+#endif |
| 288 |
+}; |
| 289 |
+ |
| 290 |
+static const char __module_depends[] |
| 291 |
+__attribute_used__ |
| 292 |
+__attribute__((section(".modinfo"))) = |
| 293 |
+"depends="; |
| 294 |
+ |
| 295 |
+MODULE_ALIAS("usb:v0BDAp8187d*dc*dsc*dp*ic*isc*ip*"); |
| 296 |
+MODULE_ALIAS("usb:v0846p6100d*dc*dsc*dp*ic*isc*ip*"); |
| 297 |
+MODULE_ALIAS("usb:v0846p6A00d*dc*dsc*dp*ic*isc*ip*"); |
| 298 |
+ |
| 299 |
+MODULE_INFO(srcversion, "873BF2D6E209C814550BA28"); |
| 300 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_crypt.c rtl8187_txpower/ieee80211/ieee80211_crypt.c |
| 301 |
--- rtl8187_orig/ieee80211/ieee80211_crypt.c 2006-06-06 04:57:56.000000000 +0200 |
| 302 |
+++ rtl8187_txpower/ieee80211/ieee80211_crypt.c 2007-01-24 20:50:08.016651830 +0100 |
| 303 |
@@ -11,7 +11,6 @@ |
| 304 |
* |
| 305 |
*/ |
| 306 |
|
| 307 |
-#include <linux/config.h> |
| 308 |
#include <linux/version.h> |
| 309 |
#include <linux/module.h> |
| 310 |
#include <linux/init.h> |
| 311 |
@@ -19,6 +18,10 @@ |
| 312 |
#include <asm/string.h> |
| 313 |
#include <asm/errno.h> |
| 314 |
|
| 315 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 316 |
+#include <linux/config.h> |
| 317 |
+#endif |
| 318 |
+ |
| 319 |
#include "ieee80211.h" |
| 320 |
|
| 321 |
MODULE_AUTHOR("Jouni Malinen"); |
| 322 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_crypt_ccmp.c rtl8187_txpower/ieee80211/ieee80211_crypt_ccmp.c |
| 323 |
--- rtl8187_orig/ieee80211/ieee80211_crypt_ccmp.c 2006-06-06 04:58:00.000000000 +0200 |
| 324 |
+++ rtl8187_txpower/ieee80211/ieee80211_crypt_ccmp.c 2007-01-24 20:50:08.017651678 +0100 |
| 325 |
@@ -9,7 +9,6 @@ |
| 326 |
* more details. |
| 327 |
*/ |
| 328 |
|
| 329 |
-#include <linux/config.h> |
| 330 |
#include <linux/version.h> |
| 331 |
#include <linux/module.h> |
| 332 |
#include <linux/init.h> |
| 333 |
@@ -22,6 +21,10 @@ |
| 334 |
#include <asm/string.h> |
| 335 |
#include <linux/wireless.h> |
| 336 |
|
| 337 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 338 |
+#include <linux/config.h> |
| 339 |
+#endif |
| 340 |
+ |
| 341 |
#include "ieee80211.h" |
| 342 |
|
| 343 |
|
| 344 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_crypt_ccmp-rtl.mod.c rtl8187_txpower/ieee80211/ieee80211_crypt_ccmp-rtl.mod.c |
| 345 |
--- rtl8187_orig/ieee80211/ieee80211_crypt_ccmp-rtl.mod.c 1970-01-01 01:00:00.000000000 +0100 |
| 346 |
+++ rtl8187_txpower/ieee80211/ieee80211_crypt_ccmp-rtl.mod.c 2007-01-24 20:50:08.054646054 +0100 |
| 347 |
@@ -0,0 +1,20 @@ |
| 348 |
+#include <linux/module.h> |
| 349 |
+#include <linux/vermagic.h> |
| 350 |
+#include <linux/compiler.h> |
| 351 |
+ |
| 352 |
+MODULE_INFO(vermagic, VERMAGIC_STRING); |
| 353 |
+ |
| 354 |
+struct module __this_module |
| 355 |
+__attribute__((section(".gnu.linkonce.this_module"))) = { |
| 356 |
+ .name = KBUILD_MODNAME, |
| 357 |
+ .init = init_module, |
| 358 |
+#ifdef CONFIG_MODULE_UNLOAD |
| 359 |
+ .exit = cleanup_module, |
| 360 |
+#endif |
| 361 |
+}; |
| 362 |
+ |
| 363 |
+static const char __module_depends[] |
| 364 |
+__attribute_used__ |
| 365 |
+__attribute__((section(".modinfo"))) = |
| 366 |
+"depends=ieee80211_crypt"; |
| 367 |
+ |
| 368 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_crypt-rtl.mod.c rtl8187_txpower/ieee80211/ieee80211_crypt-rtl.mod.c |
| 369 |
--- rtl8187_orig/ieee80211/ieee80211_crypt-rtl.mod.c 1970-01-01 01:00:00.000000000 +0100 |
| 370 |
+++ rtl8187_txpower/ieee80211/ieee80211_crypt-rtl.mod.c 2007-01-24 20:50:08.057645598 +0100 |
| 371 |
@@ -0,0 +1,20 @@ |
| 372 |
+#include <linux/module.h> |
| 373 |
+#include <linux/vermagic.h> |
| 374 |
+#include <linux/compiler.h> |
| 375 |
+ |
| 376 |
+MODULE_INFO(vermagic, VERMAGIC_STRING); |
| 377 |
+ |
| 378 |
+struct module __this_module |
| 379 |
+__attribute__((section(".gnu.linkonce.this_module"))) = { |
| 380 |
+ .name = KBUILD_MODNAME, |
| 381 |
+ .init = init_module, |
| 382 |
+#ifdef CONFIG_MODULE_UNLOAD |
| 383 |
+ .exit = cleanup_module, |
| 384 |
+#endif |
| 385 |
+}; |
| 386 |
+ |
| 387 |
+static const char __module_depends[] |
| 388 |
+__attribute_used__ |
| 389 |
+__attribute__((section(".modinfo"))) = |
| 390 |
+"depends="; |
| 391 |
+ |
| 392 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_crypt_tkip.c rtl8187_txpower/ieee80211/ieee80211_crypt_tkip.c |
| 393 |
--- rtl8187_orig/ieee80211/ieee80211_crypt_tkip.c 2006-06-06 04:57:54.000000000 +0200 |
| 394 |
+++ rtl8187_txpower/ieee80211/ieee80211_crypt_tkip.c 2007-01-24 20:50:08.104638454 +0100 |
| 395 |
@@ -9,7 +9,6 @@ |
| 396 |
* more details. |
| 397 |
*/ |
| 398 |
|
| 399 |
-#include <linux/config.h> |
| 400 |
#include <linux/version.h> |
| 401 |
#include <linux/module.h> |
| 402 |
#include <linux/init.h> |
| 403 |
@@ -21,6 +20,10 @@ |
| 404 |
#include <linux/if_arp.h> |
| 405 |
#include <asm/string.h> |
| 406 |
|
| 407 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 408 |
+#include <linux/config.h> |
| 409 |
+#endif |
| 410 |
+ |
| 411 |
#include "ieee80211.h" |
| 412 |
|
| 413 |
|
| 414 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_crypt_tkip-rtl.mod.c rtl8187_txpower/ieee80211/ieee80211_crypt_tkip-rtl.mod.c |
| 415 |
--- rtl8187_orig/ieee80211/ieee80211_crypt_tkip-rtl.mod.c 1970-01-01 01:00:00.000000000 +0100 |
| 416 |
+++ rtl8187_txpower/ieee80211/ieee80211_crypt_tkip-rtl.mod.c 2007-01-24 20:50:08.135633742 +0100 |
| 417 |
@@ -0,0 +1,20 @@ |
| 418 |
+#include <linux/module.h> |
| 419 |
+#include <linux/vermagic.h> |
| 420 |
+#include <linux/compiler.h> |
| 421 |
+ |
| 422 |
+MODULE_INFO(vermagic, VERMAGIC_STRING); |
| 423 |
+ |
| 424 |
+struct module __this_module |
| 425 |
+__attribute__((section(".gnu.linkonce.this_module"))) = { |
| 426 |
+ .name = KBUILD_MODNAME, |
| 427 |
+ .init = init_module, |
| 428 |
+#ifdef CONFIG_MODULE_UNLOAD |
| 429 |
+ .exit = cleanup_module, |
| 430 |
+#endif |
| 431 |
+}; |
| 432 |
+ |
| 433 |
+static const char __module_depends[] |
| 434 |
+__attribute_used__ |
| 435 |
+__attribute__((section(".modinfo"))) = |
| 436 |
+"depends=ieee80211_crypt"; |
| 437 |
+ |
| 438 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_crypt_wep.c rtl8187_txpower/ieee80211/ieee80211_crypt_wep.c |
| 439 |
--- rtl8187_orig/ieee80211/ieee80211_crypt_wep.c 2006-06-06 04:57:54.000000000 +0200 |
| 440 |
+++ rtl8187_txpower/ieee80211/ieee80211_crypt_wep.c 2007-01-24 20:50:08.138633286 +0100 |
| 441 |
@@ -9,7 +9,6 @@ |
| 442 |
* more details. |
| 443 |
*/ |
| 444 |
|
| 445 |
-#include <linux/config.h> |
| 446 |
#include <linux/version.h> |
| 447 |
#include <linux/module.h> |
| 448 |
#include <linux/init.h> |
| 449 |
@@ -18,6 +17,10 @@ |
| 450 |
#include <linux/skbuff.h> |
| 451 |
#include <asm/string.h> |
| 452 |
|
| 453 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 454 |
+#include <linux/config.h> |
| 455 |
+#endif |
| 456 |
+ |
| 457 |
#include "ieee80211.h" |
| 458 |
|
| 459 |
|
| 460 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_crypt_wep-rtl.mod.c rtl8187_txpower/ieee80211/ieee80211_crypt_wep-rtl.mod.c |
| 461 |
--- rtl8187_orig/ieee80211/ieee80211_crypt_wep-rtl.mod.c 1970-01-01 01:00:00.000000000 +0100 |
| 462 |
+++ rtl8187_txpower/ieee80211/ieee80211_crypt_wep-rtl.mod.c 2007-01-24 20:50:08.192625078 +0100 |
| 463 |
@@ -0,0 +1,20 @@ |
| 464 |
+#include <linux/module.h> |
| 465 |
+#include <linux/vermagic.h> |
| 466 |
+#include <linux/compiler.h> |
| 467 |
+ |
| 468 |
+MODULE_INFO(vermagic, VERMAGIC_STRING); |
| 469 |
+ |
| 470 |
+struct module __this_module |
| 471 |
+__attribute__((section(".gnu.linkonce.this_module"))) = { |
| 472 |
+ .name = KBUILD_MODNAME, |
| 473 |
+ .init = init_module, |
| 474 |
+#ifdef CONFIG_MODULE_UNLOAD |
| 475 |
+ .exit = cleanup_module, |
| 476 |
+#endif |
| 477 |
+}; |
| 478 |
+ |
| 479 |
+static const char __module_depends[] |
| 480 |
+__attribute_used__ |
| 481 |
+__attribute__((section(".modinfo"))) = |
| 482 |
+"depends=ieee80211_crypt"; |
| 483 |
+ |
| 484 |
diff -Naur rtl8187_orig/ieee80211/ieee80211.h rtl8187_txpower/ieee80211/ieee80211.h |
| 485 |
--- rtl8187_orig/ieee80211/ieee80211.h 2006-06-06 04:57:56.000000000 +0200 |
| 486 |
+++ rtl8187_txpower/ieee80211/ieee80211.h 2007-01-24 20:50:15.464519582 +0100 |
| 487 |
@@ -156,6 +156,22 @@ |
| 488 |
struct list_head list; |
| 489 |
}; |
| 490 |
|
| 491 |
+#define LWNG_CAP_DID_BASE (4 | (1 << 6)) /* section 4, group 1 */ |
| 492 |
+/* ARPHRD_IEEE80211_PRISM uses a bloated version of Prism2 RX frame header |
| 493 |
+ * (from linux-wlan-ng) */ |
| 494 |
+struct linux_wlan_ng_val { |
| 495 |
+ u32 did; |
| 496 |
+ u16 status, len; |
| 497 |
+ u32 data; |
| 498 |
+} __attribute__ ((packed)); |
| 499 |
+ |
| 500 |
+struct linux_wlan_ng_prism_hdr { |
| 501 |
+ u32 msgcode, msglen; |
| 502 |
+ char devname[16]; |
| 503 |
+ struct linux_wlan_ng_val hosttime, mactime, channel, rssi, sq, signal, |
| 504 |
+ noise, rate, istx, frmlen; |
| 505 |
+} __attribute__ ((packed)); |
| 506 |
+ |
| 507 |
struct ieee80211_hdr { |
| 508 |
u16 frame_ctl; |
| 509 |
u16 duration_id; |
| 510 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_module.c rtl8187_txpower/ieee80211/ieee80211_module.c |
| 511 |
--- rtl8187_orig/ieee80211/ieee80211_module.c 2006-06-06 04:58:00.000000000 +0200 |
| 512 |
+++ rtl8187_txpower/ieee80211/ieee80211_module.c 2007-01-24 20:50:08.195624622 +0100 |
| 513 |
@@ -31,7 +31,6 @@ |
| 514 |
*******************************************************************************/ |
| 515 |
|
| 516 |
#include <linux/compiler.h> |
| 517 |
-#include <linux/config.h> |
| 518 |
#include <linux/errno.h> |
| 519 |
#include <linux/if_arp.h> |
| 520 |
#include <linux/in6.h> |
| 521 |
@@ -52,6 +51,10 @@ |
| 522 |
#include <asm/uaccess.h> |
| 523 |
#include <net/arp.h> |
| 524 |
|
| 525 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 526 |
+#include <linux/config.h> |
| 527 |
+#endif |
| 528 |
+ |
| 529 |
#include "ieee80211.h" |
| 530 |
|
| 531 |
MODULE_DESCRIPTION("802.11 data/management/control stack"); |
| 532 |
diff -Naur rtl8187_orig/ieee80211/ieee80211-rtl.mod.c rtl8187_txpower/ieee80211/ieee80211-rtl.mod.c |
| 533 |
--- rtl8187_orig/ieee80211/ieee80211-rtl.mod.c 1970-01-01 01:00:00.000000000 +0100 |
| 534 |
+++ rtl8187_txpower/ieee80211/ieee80211-rtl.mod.c 2007-01-24 20:50:08.237618238 +0100 |
| 535 |
@@ -0,0 +1,16 @@ |
| 536 |
+#include <linux/module.h> |
| 537 |
+#include <linux/vermagic.h> |
| 538 |
+#include <linux/compiler.h> |
| 539 |
+ |
| 540 |
+MODULE_INFO(vermagic, VERMAGIC_STRING); |
| 541 |
+ |
| 542 |
+struct module __this_module |
| 543 |
+__attribute__((section(".gnu.linkonce.this_module"))) = { |
| 544 |
+ .name = KBUILD_MODNAME, |
| 545 |
+}; |
| 546 |
+ |
| 547 |
+static const char __module_depends[] |
| 548 |
+__attribute_used__ |
| 549 |
+__attribute__((section(".modinfo"))) = |
| 550 |
+"depends=ieee80211_crypt"; |
| 551 |
+ |
| 552 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_rx.c rtl8187_txpower/ieee80211/ieee80211_rx.c |
| 553 |
--- rtl8187_orig/ieee80211/ieee80211_rx.c 2006-06-06 04:58:00.000000000 +0200 |
| 554 |
+++ rtl8187_txpower/ieee80211/ieee80211_rx.c 2007-01-24 20:50:08.240617782 +0100 |
| 555 |
@@ -22,7 +22,6 @@ |
| 556 |
|
| 557 |
|
| 558 |
#include <linux/compiler.h> |
| 559 |
-#include <linux/config.h> |
| 560 |
#include <linux/errno.h> |
| 561 |
#include <linux/if_arp.h> |
| 562 |
#include <linux/in6.h> |
| 563 |
@@ -43,18 +42,83 @@ |
| 564 |
#include <asm/uaccess.h> |
| 565 |
#include <linux/ctype.h> |
| 566 |
|
| 567 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 568 |
+#include <linux/config.h> |
| 569 |
+#endif |
| 570 |
+ |
| 571 |
+ |
| 572 |
#include "ieee80211.h" |
| 573 |
|
| 574 |
static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee, |
| 575 |
struct sk_buff *skb, |
| 576 |
struct ieee80211_rx_stats *rx_stats) |
| 577 |
{ |
| 578 |
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
| 579 |
- u16 fc = le16_to_cpu(hdr->frame_ctl); |
| 580 |
+ struct ieee80211_hdr *hdr1 = (struct ieee80211_hdr *)skb->data; |
| 581 |
+ u16 fc = le16_to_cpu(hdr1->frame_ctl); |
| 582 |
+ int prism_header; |
| 583 |
+ int hdrlen, phdrlen, head_need, tail_need; |
| 584 |
+ |
| 585 |
+ if (ieee->dev->type == ARPHRD_IEEE80211_PRISM) { |
| 586 |
+ prism_header = 1; |
| 587 |
+ phdrlen = sizeof(struct linux_wlan_ng_prism_hdr); |
| 588 |
+ } else { |
| 589 |
+ prism_header = 0; |
| 590 |
+ phdrlen = 0; |
| 591 |
+ } |
| 592 |
+ |
| 593 |
+ hdrlen = ieee80211_get_hdrlen(fc); |
| 594 |
+ |
| 595 |
+ /* check if there is enough room for extra data; if not, expand skb |
| 596 |
+ * buffer to be large enough for the changes */ |
| 597 |
+ head_need = phdrlen; |
| 598 |
+ tail_need = 0; |
| 599 |
+#ifdef PRISM2_ADD_BOGUS_CRC |
| 600 |
+ tail_need += 4; |
| 601 |
+#endif /* PRISM2_ADD_BOGUS_CRC */ |
| 602 |
+ |
| 603 |
+ head_need -= skb_headroom(skb); |
| 604 |
+ tail_need -= skb_tailroom(skb); |
| 605 |
+ |
| 606 |
+ if (head_need > 0 || tail_need > 0) { |
| 607 |
+ if (pskb_expand_head(skb, head_need > 0 ? head_need : 0, |
| 608 |
+ tail_need > 0 ? tail_need : 0, |
| 609 |
+ GFP_ATOMIC)) { |
| 610 |
+ printk(KERN_DEBUG "%s: ieee80211_rx failed to " |
| 611 |
+ "reallocate skb buffer\n", ieee->dev->name); |
| 612 |
+ dev_kfree_skb_any(skb); |
| 613 |
+ return; |
| 614 |
+ } |
| 615 |
+ } |
| 616 |
+ |
| 617 |
+ if (prism_header == 1) { |
| 618 |
+ struct linux_wlan_ng_prism_hdr *hdr; |
| 619 |
+ hdr = (struct linux_wlan_ng_prism_hdr *) |
| 620 |
+ skb_push(skb, phdrlen); |
| 621 |
+ memset(hdr, 0, phdrlen); |
| 622 |
+ hdr->msgcode = LWNG_CAP_DID_BASE; |
| 623 |
+ hdr->msglen = sizeof(*hdr); |
| 624 |
+ memcpy(hdr->devname, ieee->dev->name, sizeof(hdr->devname)); |
| 625 |
+#define LWNG_SETVAL(f,i,s,l,d) \ |
| 626 |
+hdr->f.did = LWNG_CAP_DID_BASE | (i << 12); \ |
| 627 |
+hdr->f.status = s; hdr->f.len = l; hdr->f.data = d |
| 628 |
+ LWNG_SETVAL(hosttime, 1, 0, 4, jiffies); |
| 629 |
+ LWNG_SETVAL(mactime, 2, 0, 4, ((u32)rx_stats->mac_time)); |
| 630 |
+ LWNG_SETVAL(channel, 3, 1 /* no value */, 4, 0); |
| 631 |
+ LWNG_SETVAL(rssi, 4, 1 /* no value */, 4, 0); |
| 632 |
+ LWNG_SETVAL(sq, 5, 1 /* no value */, 4, 0); |
| 633 |
+ LWNG_SETVAL(signal, 6, 0, 4, rx_stats->signal); |
| 634 |
+ LWNG_SETVAL(noise, 7, 0, 4, rx_stats->noise); |
| 635 |
+ LWNG_SETVAL(rate, 8, 0, 4, rx_stats->rate / 5); |
| 636 |
+ LWNG_SETVAL(istx, 9, 0, 4, 0); |
| 637 |
+ LWNG_SETVAL(frmlen, 10, 0, 4, skb->len - phdrlen); |
| 638 |
+#undef LWNG_SETVAL |
| 639 |
+ } |
| 640 |
|
| 641 |
skb->dev = ieee->dev; |
| 642 |
skb->mac.raw = skb->data; |
| 643 |
- skb_pull(skb, ieee80211_get_hdrlen(fc)); |
| 644 |
+ skb_pull(skb, hdrlen); |
| 645 |
+ if (prism_header) |
| 646 |
+ skb_pull(skb, phdrlen); |
| 647 |
skb->pkt_type = PACKET_OTHERHOST; |
| 648 |
skb->protocol = __constant_htons(ETH_P_80211_RAW); |
| 649 |
memset(skb->cb, 0, sizeof(skb->cb)); |
| 650 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_softmac.c rtl8187_txpower/ieee80211/ieee80211_softmac.c |
| 651 |
--- rtl8187_orig/ieee80211/ieee80211_softmac.c 2006-06-19 03:27:33.000000000 +0200 |
| 652 |
+++ rtl8187_txpower/ieee80211/ieee80211_softmac.c 2007-01-24 20:50:08.295609422 +0100 |
| 653 |
@@ -386,9 +386,8 @@ |
| 654 |
|
| 655 |
void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee) |
| 656 |
{ |
| 657 |
- down(&ieee->scan_sem); |
| 658 |
- |
| 659 |
short watchdog = 0; |
| 660 |
+ down(&ieee->scan_sem); |
| 661 |
|
| 662 |
do{ |
| 663 |
ieee->current_network.channel = |
| 664 |
@@ -1467,12 +1466,13 @@ |
| 665 |
u16 stype) |
| 666 |
{ |
| 667 |
struct ieee80211_hdr_3addr *header; |
| 668 |
- header = (struct ieee80211_hdr_3addr *) skb->data; |
| 669 |
u16 errcode; |
| 670 |
u8* challenge; |
| 671 |
int chlen; |
| 672 |
int aid; |
| 673 |
|
| 674 |
+ header = (struct ieee80211_hdr_3addr *) skb->data; |
| 675 |
+ |
| 676 |
if(!ieee->proto_started) |
| 677 |
return 0; |
| 678 |
|
| 679 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_softmac_wx.c rtl8187_txpower/ieee80211/ieee80211_softmac_wx.c |
| 680 |
--- rtl8187_orig/ieee80211/ieee80211_softmac_wx.c 2006-06-06 04:57:54.000000000 +0200 |
| 681 |
+++ rtl8187_txpower/ieee80211/ieee80211_softmac_wx.c 2007-01-24 20:50:08.297609118 +0100 |
| 682 |
@@ -134,14 +134,14 @@ |
| 683 |
u8 zero[] = {0,0,0,0,0,0}; |
| 684 |
unsigned long flags; |
| 685 |
|
| 686 |
+ struct sockaddr *temp = NULL; |
| 687 |
short ifup = ieee->proto_started;//dev->flags & IFF_UP; |
| 688 |
|
| 689 |
ieee->sync_scan_hurryup = 1; |
| 690 |
|
| 691 |
down(&ieee->wx_sem); |
| 692 |
|
| 693 |
- struct sockaddr *temp = (struct sockaddr *)awrq; |
| 694 |
- |
| 695 |
+ temp = (struct sockaddr *)awrq; |
| 696 |
/* use ifconfig hw ether */ |
| 697 |
if (ieee->iw_mode == IW_MODE_MASTER){ |
| 698 |
ret = -1; |
| 699 |
@@ -245,8 +245,7 @@ |
| 700 |
goto out; |
| 701 |
|
| 702 |
if (wrqu->mode == IW_MODE_MONITOR){ |
| 703 |
- |
| 704 |
- ieee->dev->type = ARPHRD_IEEE80211; |
| 705 |
+ ieee->dev->type = ARPHRD_IEEE80211_PRISM; |
| 706 |
}else{ |
| 707 |
ieee->dev->type = ARPHRD_ETHER; |
| 708 |
} |
| 709 |
diff -Naur rtl8187_orig/ieee80211/ieee80211_tx.c rtl8187_txpower/ieee80211/ieee80211_tx.c |
| 710 |
--- rtl8187_orig/ieee80211/ieee80211_tx.c 2006-06-06 04:57:54.000000000 +0200 |
| 711 |
+++ rtl8187_txpower/ieee80211/ieee80211_tx.c 2007-01-24 20:50:08.351600910 +0100 |
| 712 |
@@ -32,7 +32,6 @@ |
| 713 |
******************************************************************************/ |
| 714 |
|
| 715 |
#include <linux/compiler.h> |
| 716 |
-#include <linux/config.h> |
| 717 |
#include <linux/errno.h> |
| 718 |
#include <linux/if_arp.h> |
| 719 |
#include <linux/in6.h> |
| 720 |
@@ -52,6 +51,10 @@ |
| 721 |
#include <linux/etherdevice.h> |
| 722 |
#include <asm/uaccess.h> |
| 723 |
|
| 724 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 725 |
+#include <linux/config.h> |
| 726 |
+#endif |
| 727 |
+ |
| 728 |
#include "ieee80211.h" |
| 729 |
|
| 730 |
|
| 731 |
@@ -458,7 +461,8 @@ |
| 732 |
ieee->seq_ctrl++; |
| 733 |
//--- |
| 734 |
}else{ |
| 735 |
- if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) { |
| 736 |
+// if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) { |
| 737 |
+ if (unlikely(skb->len < 14)) { |
| 738 |
printk(KERN_WARNING "%s: skb too small (%d).\n", |
| 739 |
ieee->dev->name, skb->len); |
| 740 |
goto success; |