| 1 |
diff -Naur r8187_orig/ieee80211/ieee80211_crypt.c r8187_rawtx/ieee80211/ieee80211_crypt.c |
| 2 |
--- r8187_orig/ieee80211/ieee80211_crypt.c 2007-01-15 03:00:37.000000000 +0100 |
| 3 |
+++ r8187_rawtx/ieee80211/ieee80211_crypt.c 2007-05-13 09:55:23.000000000 +0200 |
| 4 |
@@ -11,7 +11,6 @@ |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
-#include <linux/config.h> |
| 9 |
#include <linux/version.h> |
| 10 |
#include <linux/module.h> |
| 11 |
#include <linux/init.h> |
| 12 |
@@ -19,6 +18,12 @@ |
| 13 |
#include <asm/string.h> |
| 14 |
#include <asm/errno.h> |
| 15 |
|
| 16 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 17 |
+#include <linux/config.h> |
| 18 |
+#else |
| 19 |
+#include <linux/autoconf.h> |
| 20 |
+#endif |
| 21 |
+ |
| 22 |
#include "ieee80211.h" |
| 23 |
|
| 24 |
MODULE_AUTHOR("Jouni Malinen"); |
| 25 |
diff -Naur r8187_orig/ieee80211/ieee80211_crypt_ccmp.c r8187_rawtx/ieee80211/ieee80211_crypt_ccmp.c |
| 26 |
--- r8187_orig/ieee80211/ieee80211_crypt_ccmp.c 2007-01-15 03:00:37.000000000 +0100 |
| 27 |
+++ r8187_rawtx/ieee80211/ieee80211_crypt_ccmp.c 2007-05-13 09:55:23.000000000 +0200 |
| 28 |
@@ -9,7 +9,6 @@ |
| 29 |
* more details. |
| 30 |
*/ |
| 31 |
|
| 32 |
-#include <linux/config.h> |
| 33 |
#include <linux/version.h> |
| 34 |
#include <linux/module.h> |
| 35 |
#include <linux/init.h> |
| 36 |
@@ -22,11 +21,22 @@ |
| 37 |
#include <asm/string.h> |
| 38 |
#include <linux/wireless.h> |
| 39 |
|
| 40 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 41 |
+#include <linux/config.h> |
| 42 |
+#else |
| 43 |
+#include <linux/autoconf.h> |
| 44 |
+#endif |
| 45 |
+ |
| 46 |
#include "ieee80211.h" |
| 47 |
|
| 48 |
|
| 49 |
#include <linux/crypto.h> |
| 50 |
-#include <asm/scatterlist.h> |
| 51 |
+ |
| 52 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 53 |
+ #include <asm/scatterlist.h> |
| 54 |
+#else |
| 55 |
+ #include <linux/scatterlist.h> |
| 56 |
+#endif |
| 57 |
|
| 58 |
MODULE_AUTHOR("Jouni Malinen"); |
| 59 |
MODULE_DESCRIPTION("Host AP crypt: CCMP"); |
| 60 |
diff -Naur r8187_orig/ieee80211/ieee80211_crypt_tkip.c r8187_rawtx/ieee80211/ieee80211_crypt_tkip.c |
| 61 |
--- r8187_orig/ieee80211/ieee80211_crypt_tkip.c 2007-01-15 03:00:37.000000000 +0100 |
| 62 |
+++ r8187_rawtx/ieee80211/ieee80211_crypt_tkip.c 2007-05-13 09:55:23.000000000 +0200 |
| 63 |
@@ -9,7 +9,6 @@ |
| 64 |
* more details. |
| 65 |
*/ |
| 66 |
|
| 67 |
-#include <linux/config.h> |
| 68 |
#include <linux/version.h> |
| 69 |
#include <linux/module.h> |
| 70 |
#include <linux/init.h> |
| 71 |
@@ -21,11 +20,21 @@ |
| 72 |
#include <linux/if_arp.h> |
| 73 |
#include <asm/string.h> |
| 74 |
|
| 75 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 76 |
+#include <linux/config.h> |
| 77 |
+#else |
| 78 |
+#include <linux/autoconf.h> |
| 79 |
+#endif |
| 80 |
+ |
| 81 |
#include "ieee80211.h" |
| 82 |
|
| 83 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 84 |
+ #include <asm/scatterlist.h> |
| 85 |
+#else |
| 86 |
+ #include <linux/scatterlist.h> |
| 87 |
+#endif |
| 88 |
|
| 89 |
#include <linux/crypto.h> |
| 90 |
-#include <asm/scatterlist.h> |
| 91 |
#include <linux/crc32.h> |
| 92 |
|
| 93 |
MODULE_AUTHOR("Jouni Malinen"); |
| 94 |
@@ -431,7 +440,11 @@ |
| 95 |
static int michael_mic(struct ieee80211_tkip_data *tkey, u8 *key, u8 *hdr, |
| 96 |
u8 *data, size_t data_len, u8 *mic) |
| 97 |
{ |
| 98 |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) |
| 99 |
+ struct hash_desc desc; |
| 100 |
+#endif |
| 101 |
struct scatterlist sg[2]; |
| 102 |
+ int ret = 0; |
| 103 |
|
| 104 |
if (tkey->tfm_michael == NULL) { |
| 105 |
printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n"); |
| 106 |
@@ -445,12 +458,20 @@ |
| 107 |
sg[1].offset = offset_in_page(data); |
| 108 |
sg[1].length = data_len; |
| 109 |
|
| 110 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 111 |
crypto_digest_init(tkey->tfm_michael); |
| 112 |
crypto_digest_setkey(tkey->tfm_michael, key, 8); |
| 113 |
crypto_digest_update(tkey->tfm_michael, sg, 2); |
| 114 |
crypto_digest_final(tkey->tfm_michael, mic); |
| 115 |
+#else |
| 116 |
+ if (crypto_hash_setkey(tkey->tfm_michael, key, 8)) |
| 117 |
+ return -1; |
| 118 |
+ desc.tfm = tkey->tfm_michael; |
| 119 |
+ desc.flags = 0; |
| 120 |
+ ret = crypto_hash_digest(&desc, sg, data_len + 16, mic); |
| 121 |
+#endif |
| 122 |
|
| 123 |
- return 0; |
| 124 |
+ return ret; |
| 125 |
} |
| 126 |
|
| 127 |
static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) |
| 128 |
diff -Naur r8187_orig/ieee80211/ieee80211_crypt_wep.c r8187_rawtx/ieee80211/ieee80211_crypt_wep.c |
| 129 |
--- r8187_orig/ieee80211/ieee80211_crypt_wep.c 2007-01-15 03:00:37.000000000 +0100 |
| 130 |
+++ r8187_rawtx/ieee80211/ieee80211_crypt_wep.c 2007-05-13 09:55:23.000000000 +0200 |
| 131 |
@@ -9,7 +9,6 @@ |
| 132 |
* more details. |
| 133 |
*/ |
| 134 |
|
| 135 |
-#include <linux/config.h> |
| 136 |
#include <linux/version.h> |
| 137 |
#include <linux/module.h> |
| 138 |
#include <linux/init.h> |
| 139 |
@@ -18,11 +17,21 @@ |
| 140 |
#include <linux/skbuff.h> |
| 141 |
#include <asm/string.h> |
| 142 |
|
| 143 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 144 |
+#include <linux/config.h> |
| 145 |
+#else |
| 146 |
+#include <linux/autoconf.h> |
| 147 |
+#endif |
| 148 |
+ |
| 149 |
#include "ieee80211.h" |
| 150 |
|
| 151 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 152 |
+ #include <asm/scatterlist.h> |
| 153 |
+#else |
| 154 |
+ #include <linux/scatterlist.h> |
| 155 |
+#endif |
| 156 |
|
| 157 |
#include <linux/crypto.h> |
| 158 |
-#include <asm/scatterlist.h> |
| 159 |
#include <linux/crc32.h> |
| 160 |
|
| 161 |
MODULE_AUTHOR("Jouni Malinen"); |
| 162 |
diff -Naur r8187_orig/ieee80211/ieee80211.h r8187_rawtx/ieee80211/ieee80211.h |
| 163 |
--- r8187_orig/ieee80211/ieee80211.h 2007-12-05 09:27:45.000000000 +0100 |
| 164 |
+++ r8187_rawtx/ieee80211/ieee80211.h 2007-05-13 09:55:27.000000000 +0200 |
| 165 |
@@ -108,6 +108,8 @@ |
| 166 |
#define ieee80211_start_protocol ieee80211_start_protocol_rtl |
| 167 |
#define ieee80211_stop_protocol ieee80211_stop_protocol_rtl |
| 168 |
#define ieee80211_rx_mgt ieee80211_rx_mgt_rtl |
| 169 |
+#define ieee80211_stop_queue ieee80211_stop_queue_rtl |
| 170 |
+#define ieee80211_wake_queue ieee80211_wake_queue_rtl |
| 171 |
|
| 172 |
|
| 173 |
typedef struct ieee_param { |
| 174 |
@@ -193,6 +195,22 @@ |
| 175 |
struct list_head list; |
| 176 |
}; |
| 177 |
|
| 178 |
+#define LWNG_CAP_DID_BASE (4 | (1 << 6)) /* section 4, group 1 */ |
| 179 |
+/* ARPHRD_IEEE80211_PRISM uses a bloated version of Prism2 RX frame header |
| 180 |
+ * (from linux-wlan-ng) */ |
| 181 |
+struct linux_wlan_ng_val { |
| 182 |
+ u32 did; |
| 183 |
+ u16 status, len; |
| 184 |
+ u32 data; |
| 185 |
+} __attribute__ ((packed)); |
| 186 |
+ |
| 187 |
+struct linux_wlan_ng_prism_hdr { |
| 188 |
+ u32 msgcode, msglen; |
| 189 |
+ char devname[16]; |
| 190 |
+ struct linux_wlan_ng_val hosttime, mactime, channel, rssi, sq, signal, |
| 191 |
+ noise, rate, istx, frmlen; |
| 192 |
+} __attribute__ ((packed)); |
| 193 |
+ |
| 194 |
struct ieee80211_hdr { |
| 195 |
u16 frame_ctl; |
| 196 |
u16 duration_id; |
| 197 |
@@ -1064,10 +1082,15 @@ |
| 198 |
struct timer_list beacon_timer; |
| 199 |
|
| 200 |
struct work_struct associate_complete_wq; |
| 201 |
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 202 |
+ struct delayed_work associate_retry_wq; |
| 203 |
+ struct delayed_work softmac_scan_wq; |
| 204 |
+#else |
| 205 |
struct work_struct associate_retry_wq; |
| 206 |
+ struct work_struct softmac_scan_wq; |
| 207 |
+#endif |
| 208 |
struct work_struct start_ibss_wq; |
| 209 |
struct work_struct associate_procedure_wq; |
| 210 |
- struct work_struct softmac_scan_wq; |
| 211 |
struct work_struct wx_sync_scan_wq; |
| 212 |
struct work_struct ps_request_tx_ack_wq;//for ps |
| 213 |
struct work_struct hw_wakeup_wq; |
| 214 |
@@ -1390,7 +1413,11 @@ |
| 215 |
extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a, |
| 216 |
union iwreq_data *wrqu, char *b); |
| 217 |
|
| 218 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 219 |
+extern void ieee80211_wx_sync_scan_wq(struct work_struct *work); |
| 220 |
+#else |
| 221 |
extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); |
| 222 |
+#endif |
| 223 |
|
| 224 |
extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee, |
| 225 |
struct iw_request_info *info, |
| 226 |
diff -Naur r8187_orig/ieee80211/ieee80211_module.c r8187_rawtx/ieee80211/ieee80211_module.c |
| 227 |
--- r8187_orig/ieee80211/ieee80211_module.c 2007-12-03 10:07:33.000000000 +0100 |
| 228 |
+++ r8187_rawtx/ieee80211/ieee80211_module.c 2007-05-13 09:55:23.000000000 +0200 |
| 229 |
@@ -31,7 +31,6 @@ |
| 230 |
*******************************************************************************/ |
| 231 |
|
| 232 |
#include <linux/compiler.h> |
| 233 |
-#include <linux/config.h> |
| 234 |
#include <linux/errno.h> |
| 235 |
#include <linux/if_arp.h> |
| 236 |
#include <linux/in6.h> |
| 237 |
@@ -52,6 +51,12 @@ |
| 238 |
#include <asm/uaccess.h> |
| 239 |
#include <net/arp.h> |
| 240 |
|
| 241 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 242 |
+#include <linux/config.h> |
| 243 |
+#else |
| 244 |
+#include <linux/autoconf.h> |
| 245 |
+#endif |
| 246 |
+ |
| 247 |
#include "ieee80211.h" |
| 248 |
|
| 249 |
MODULE_DESCRIPTION("802.11 data/management/control stack"); |
| 250 |
diff -Naur r8187_orig/ieee80211/ieee80211_rx.c r8187_rawtx/ieee80211/ieee80211_rx.c |
| 251 |
--- r8187_orig/ieee80211/ieee80211_rx.c 2007-01-15 03:00:37.000000000 +0100 |
| 252 |
+++ r8187_rawtx/ieee80211/ieee80211_rx.c 2007-05-13 09:55:23.000000000 +0200 |
| 253 |
@@ -22,7 +22,6 @@ |
| 254 |
|
| 255 |
|
| 256 |
#include <linux/compiler.h> |
| 257 |
-#include <linux/config.h> |
| 258 |
#include <linux/errno.h> |
| 259 |
#include <linux/if_arp.h> |
| 260 |
#include <linux/in6.h> |
| 261 |
@@ -43,18 +42,85 @@ |
| 262 |
#include <asm/uaccess.h> |
| 263 |
#include <linux/ctype.h> |
| 264 |
|
| 265 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 266 |
+#include <linux/config.h> |
| 267 |
+#else |
| 268 |
+#include <linux/autoconf.h> |
| 269 |
+#endif |
| 270 |
+ |
| 271 |
#include "ieee80211.h" |
| 272 |
|
| 273 |
static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee, |
| 274 |
struct sk_buff *skb, |
| 275 |
struct ieee80211_rx_stats *rx_stats) |
| 276 |
{ |
| 277 |
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
| 278 |
- u16 fc = le16_to_cpu(hdr->frame_ctl); |
| 279 |
+ struct ieee80211_hdr *hdr1 = (struct ieee80211_hdr *)skb->data; |
| 280 |
+ u16 fc = le16_to_cpu(hdr1->frame_ctl); |
| 281 |
+//begin prism header code |
| 282 |
+ int prism_header; |
| 283 |
+ int hdrlen, phdrlen, head_need, tail_need; |
| 284 |
+ |
| 285 |
+ if (ieee->dev->type == ARPHRD_IEEE80211_PRISM) { |
| 286 |
+ prism_header = 1; |
| 287 |
+ phdrlen = sizeof(struct linux_wlan_ng_prism_hdr); |
| 288 |
+ } else { |
| 289 |
+ prism_header = 0; |
| 290 |
+ phdrlen = 0; |
| 291 |
+ } |
| 292 |
|
| 293 |
+ hdrlen = ieee80211_get_hdrlen(fc); |
| 294 |
+ |
| 295 |
+ /* check if there is enough room for extra data; if not, expand skb |
| 296 |
+ * buffer to be large enough for the changes */ |
| 297 |
+ head_need = phdrlen; |
| 298 |
+ tail_need = 0; |
| 299 |
+#ifdef PRISM2_ADD_BOGUS_CRC |
| 300 |
+ tail_need += 4; |
| 301 |
+#endif /* PRISM2_ADD_BOGUS_CRC */ |
| 302 |
+ |
| 303 |
+ head_need -= skb_headroom(skb); |
| 304 |
+ tail_need -= skb_tailroom(skb); |
| 305 |
+ |
| 306 |
+ if (head_need > 0 || tail_need > 0) { |
| 307 |
+ if (pskb_expand_head(skb, head_need > 0 ? head_need : 0, |
| 308 |
+ tail_need > 0 ? tail_need : 0, |
| 309 |
+ GFP_ATOMIC)) { |
| 310 |
+ printk(KERN_DEBUG "%s: ieee80211_rx failed to " |
| 311 |
+ "reallocate skb buffer\n", ieee->dev->name); |
| 312 |
+ dev_kfree_skb_any(skb); |
| 313 |
+ return; |
| 314 |
+ } |
| 315 |
+ } |
| 316 |
+ |
| 317 |
+ if (prism_header == 1) { |
| 318 |
+ struct linux_wlan_ng_prism_hdr *hdr; |
| 319 |
+ hdr = (struct linux_wlan_ng_prism_hdr *) |
| 320 |
+ skb_push(skb, phdrlen); |
| 321 |
+ memset(hdr, 0, phdrlen); |
| 322 |
+ hdr->msgcode = LWNG_CAP_DID_BASE; |
| 323 |
+ hdr->msglen = sizeof(*hdr); |
| 324 |
+ memcpy(hdr->devname, ieee->dev->name, sizeof(hdr->devname)); |
| 325 |
+#define LWNG_SETVAL(f,i,s,l,d) \ |
| 326 |
+hdr->f.did = LWNG_CAP_DID_BASE | (i << 12); \ |
| 327 |
+hdr->f.status = s; hdr->f.len = l; hdr->f.data = d |
| 328 |
+ LWNG_SETVAL(hosttime, 1, 0, 4, jiffies); |
| 329 |
+ LWNG_SETVAL(mactime, 2, 0, 4, ((u32)rx_stats->mac_time)); |
| 330 |
+ LWNG_SETVAL(channel, 3, 1 /* no value */, 4, 0); |
| 331 |
+ LWNG_SETVAL(rssi, 4, 1 /* no value */, 4, 0); |
| 332 |
+ LWNG_SETVAL(sq, 5, 1 /* no value */, 4, 0); |
| 333 |
+ LWNG_SETVAL(signal, 6, 0, 4, rx_stats->signal); |
| 334 |
+ LWNG_SETVAL(noise, 7, 0, 4, rx_stats->noise); |
| 335 |
+ LWNG_SETVAL(rate, 8, 0, 4, rx_stats->rate / 5); |
| 336 |
+ LWNG_SETVAL(istx, 9, 0, 4, 0); |
| 337 |
+ LWNG_SETVAL(frmlen, 10, 0, 4, skb->len - phdrlen); |
| 338 |
+#undef LWNG_SETVAL |
| 339 |
+ } |
| 340 |
+//end prism header code |
| 341 |
skb->dev = ieee->dev; |
| 342 |
skb->mac.raw = skb->data; |
| 343 |
- skb_pull(skb, ieee80211_get_hdrlen(fc)); |
| 344 |
+ skb_pull(skb, hdrlen); |
| 345 |
+ if (prism_header) |
| 346 |
+ skb_pull(skb, phdrlen); |
| 347 |
skb->pkt_type = PACKET_OTHERHOST; |
| 348 |
skb->protocol = __constant_htons(ETH_P_80211_RAW); |
| 349 |
memset(skb->cb, 0, sizeof(skb->cb)); |
| 350 |
diff -Naur r8187_orig/ieee80211/ieee80211_softmac.c r8187_rawtx/ieee80211/ieee80211_softmac.c |
| 351 |
--- r8187_orig/ieee80211/ieee80211_softmac.c 2007-12-05 09:26:56.000000000 +0100 |
| 352 |
+++ r8187_rawtx/ieee80211/ieee80211_softmac.c 2007-05-13 09:55:24.000000000 +0200 |
| 353 |
@@ -392,9 +392,16 @@ |
| 354 |
schedule_work(&ieee->softmac_scan_wq); |
| 355 |
} |
| 356 |
#endif |
| 357 |
- |
| 358 |
+ |
| 359 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 360 |
+void ieee80211_softmac_scan_wq(struct work_struct *work) |
| 361 |
+{ |
| 362 |
+ struct delayed_work *dwork = container_of(work, struct delayed_work, work); |
| 363 |
+ struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, softmac_scan_wq); |
| 364 |
+#else |
| 365 |
void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee) |
| 366 |
-{ |
| 367 |
+{ |
| 368 |
+#endif |
| 369 |
short watchdog = 0; |
| 370 |
down(&ieee->scan_sem); |
| 371 |
|
| 372 |
@@ -514,7 +521,11 @@ |
| 373 |
if (ieee->scanning == 0){ |
| 374 |
ieee->scanning = 1; |
| 375 |
//ieee80211_softmac_scan(ieee); |
| 376 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 377 |
queue_work(ieee->wq, &ieee->softmac_scan_wq); |
| 378 |
+#else |
| 379 |
+ queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, 0); |
| 380 |
+#endif |
| 381 |
} |
| 382 |
}else |
| 383 |
ieee->start_scan(ieee->dev); |
| 384 |
@@ -994,8 +1005,14 @@ |
| 385 |
} |
| 386 |
} |
| 387 |
|
| 388 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 389 |
+void ieee80211_associate_complete_wq(struct work_struct *work) |
| 390 |
+{ |
| 391 |
+ struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_complete_wq); |
| 392 |
+#else |
| 393 |
void ieee80211_associate_complete_wq(struct ieee80211_device *ieee) |
| 394 |
{ |
| 395 |
+#endif |
| 396 |
printk(KERN_INFO "Associated successfully\n"); |
| 397 |
if(ieee80211_is_54g(ieee->current_network) && |
| 398 |
(ieee->modulation & IEEE80211_OFDM_MODULATION)){ |
| 399 |
@@ -1025,8 +1042,14 @@ |
| 400 |
queue_work(ieee->wq, &ieee->associate_complete_wq); |
| 401 |
} |
| 402 |
|
| 403 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 404 |
+void ieee80211_associate_procedure_wq(struct work_struct *work) |
| 405 |
+{ |
| 406 |
+ struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_procedure_wq); |
| 407 |
+#else |
| 408 |
void ieee80211_associate_procedure_wq(struct ieee80211_device *ieee) |
| 409 |
{ |
| 410 |
+#endif |
| 411 |
ieee->sync_scan_hurryup = 1; |
| 412 |
down(&ieee->wx_sem); |
| 413 |
|
| 414 |
@@ -1660,7 +1683,6 @@ |
| 415 |
|
| 416 |
unsigned long flags; |
| 417 |
int i; |
| 418 |
- |
| 419 |
spin_lock_irqsave(&ieee->lock,flags); |
| 420 |
#if 0 |
| 421 |
if(ieee->queue_stop){ |
| 422 |
@@ -1691,7 +1713,6 @@ |
| 423 |
} |
| 424 |
/* called with 2nd parm 0, no tx mgmt lock required */ |
| 425 |
ieee80211_sta_wakeup(ieee,0); |
| 426 |
- |
| 427 |
for(i = 0; i < txb->nr_frags; i++) { |
| 428 |
|
| 429 |
if (ieee->queue_stop){ |
| 430 |
@@ -1874,8 +1895,15 @@ |
| 431 |
netif_carrier_on(ieee->dev); |
| 432 |
} |
| 433 |
} |
| 434 |
+ |
| 435 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 436 |
+void ieee80211_start_ibss_wq(struct work_struct *work) |
| 437 |
+{ |
| 438 |
+ struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, start_ibss_wq); |
| 439 |
+#else |
| 440 |
void ieee80211_start_ibss_wq(struct ieee80211_device *ieee) |
| 441 |
{ |
| 442 |
+#endif |
| 443 |
|
| 444 |
/* iwconfig mode ad-hoc will schedule this and return |
| 445 |
* on the other hand this will block further iwconfig SET |
| 446 |
@@ -2020,8 +2048,16 @@ |
| 447 |
notify_wx_assoc_event(ieee); |
| 448 |
|
| 449 |
} |
| 450 |
+ |
| 451 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 452 |
+void ieee80211_associate_retry_wq(struct work_struct *work) |
| 453 |
+{ |
| 454 |
+ struct delayed_work *dwork = container_of(work, struct delayed_work, work); |
| 455 |
+ struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, associate_retry_wq); |
| 456 |
+#else |
| 457 |
void ieee80211_associate_retry_wq(struct ieee80211_device *ieee) |
| 458 |
{ |
| 459 |
+#endif |
| 460 |
unsigned long flags; |
| 461 |
|
| 462 |
down(&ieee->wx_sem); |
| 463 |
@@ -2225,13 +2261,22 @@ |
| 464 |
#else |
| 465 |
ieee->wq = create_workqueue(DRV_NAME); |
| 466 |
#endif |
| 467 |
- |
| 468 |
+ |
| 469 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 470 |
INIT_WORK(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee); |
| 471 |
INIT_WORK(&ieee->associate_retry_wq,(void(*)(void*)) ieee80211_associate_retry_wq,ieee); |
| 472 |
INIT_WORK(&ieee->associate_complete_wq,(void(*)(void*)) ieee80211_associate_complete_wq,ieee); |
| 473 |
INIT_WORK(&ieee->associate_procedure_wq,(void(*)(void*)) ieee80211_associate_procedure_wq,ieee); |
| 474 |
INIT_WORK(&ieee->softmac_scan_wq,(void(*)(void*)) ieee80211_softmac_scan_wq,ieee); |
| 475 |
INIT_WORK(&ieee->wx_sync_scan_wq,(void(*)(void*)) ieee80211_wx_sync_scan_wq,ieee); |
| 476 |
+#else |
| 477 |
+ INIT_WORK(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq); |
| 478 |
+ INIT_DELAYED_WORK(&ieee->associate_retry_wq,(void(*)(void*)) ieee80211_associate_retry_wq); |
| 479 |
+ INIT_WORK(&ieee->associate_complete_wq,(void(*)(void*)) ieee80211_associate_complete_wq); |
| 480 |
+ INIT_WORK(&ieee->associate_procedure_wq,(void(*)(void*)) ieee80211_associate_procedure_wq); |
| 481 |
+ INIT_DELAYED_WORK(&ieee->softmac_scan_wq,(void(*)(void*)) ieee80211_softmac_scan_wq); |
| 482 |
+ INIT_WORK(&ieee->wx_sync_scan_wq,(void(*)(void*)) ieee80211_wx_sync_scan_wq); |
| 483 |
+#endif |
| 484 |
/// INIT_WORK(&ieee->ps_request_tx_ack_wq,(void(*)(void*))ieee->ps_request_tx_ack,ieee->dev);//for ps 07.26 |
| 485 |
|
| 486 |
|
| 487 |
diff -Naur r8187_orig/ieee80211/ieee80211_softmac_wx.c r8187_rawtx/ieee80211/ieee80211_softmac_wx.c |
| 488 |
--- r8187_orig/ieee80211/ieee80211_softmac_wx.c 2007-01-15 03:00:37.000000000 +0100 |
| 489 |
+++ r8187_rawtx/ieee80211/ieee80211_softmac_wx.c 2007-05-13 09:55:24.000000000 +0200 |
| 490 |
@@ -236,7 +236,7 @@ |
| 491 |
int ieee80211_wx_set_mode(struct ieee80211_device *ieee, struct iw_request_info *a, |
| 492 |
union iwreq_data *wrqu, char *b) |
| 493 |
{ |
| 494 |
- |
| 495 |
+ short prev = ieee->raw_tx; |
| 496 |
ieee->sync_scan_hurryup = 1; |
| 497 |
|
| 498 |
down(&ieee->wx_sem); |
| 499 |
@@ -246,7 +246,7 @@ |
| 500 |
|
| 501 |
if (wrqu->mode == IW_MODE_MONITOR){ |
| 502 |
|
| 503 |
- ieee->dev->type = ARPHRD_IEEE80211; |
| 504 |
+ ieee->dev->type = ARPHRD_IEEE80211_PRISM; |
| 505 |
}else{ |
| 506 |
ieee->dev->type = ARPHRD_ETHER; |
| 507 |
} |
| 508 |
@@ -259,13 +259,37 @@ |
| 509 |
ieee80211_start_protocol(ieee); |
| 510 |
} |
| 511 |
|
| 512 |
+ if(ieee->iw_mode == IW_MODE_MONITOR) |
| 513 |
+ { |
| 514 |
+ ieee->raw_tx = 1; |
| 515 |
+ if(prev == 0 && ieee->raw_tx){ |
| 516 |
+ if (ieee->data_hard_resume) |
| 517 |
+ ieee->data_hard_resume(ieee->dev); |
| 518 |
+ |
| 519 |
+ netif_carrier_on(ieee->dev); |
| 520 |
+ } |
| 521 |
+ |
| 522 |
+ netif_carrier_on(ieee->dev); |
| 523 |
+ } |
| 524 |
+ else |
| 525 |
+ { |
| 526 |
+ ieee->raw_tx = 0; |
| 527 |
+ } |
| 528 |
+ |
| 529 |
+ |
| 530 |
out: |
| 531 |
up(&ieee->wx_sem); |
| 532 |
return 0; |
| 533 |
} |
| 534 |
|
| 535 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 536 |
+void ieee80211_wx_sync_scan_wq(struct work_struct *work) |
| 537 |
+{ |
| 538 |
+ struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq); |
| 539 |
+#else |
| 540 |
void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee) |
| 541 |
{ |
| 542 |
+#endif |
| 543 |
short chan; |
| 544 |
|
| 545 |
chan = ieee->current_network.channel; |
| 546 |
@@ -356,7 +380,11 @@ |
| 547 |
spin_lock_irqsave(&ieee->lock, flags); |
| 548 |
|
| 549 |
if (wrqu->essid.flags && wrqu->essid.length) { |
| 550 |
+#if WIRELESS_EXT > 20 |
| 551 |
+ len = min((int)wrqu->essid.length, IW_ESSID_MAX_SIZE); |
| 552 |
+#else |
| 553 |
len = ((wrqu->essid.length-1) < IW_ESSID_MAX_SIZE) ? (wrqu->essid.length-1) : IW_ESSID_MAX_SIZE; |
| 554 |
+#endif |
| 555 |
|
| 556 |
strncpy(ieee->current_network.ssid, extra, len); |
| 557 |
ieee->current_network.ssid_len = len; |
| 558 |
diff -Naur r8187_orig/ieee80211/ieee80211_tx.c r8187_rawtx/ieee80211/ieee80211_tx.c |
| 559 |
--- r8187_orig/ieee80211/ieee80211_tx.c 2007-12-05 09:53:21.000000000 +0100 |
| 560 |
+++ r8187_rawtx/ieee80211/ieee80211_tx.c 2007-05-13 09:55:24.000000000 +0200 |
| 561 |
@@ -32,7 +32,6 @@ |
| 562 |
******************************************************************************/ |
| 563 |
|
| 564 |
#include <linux/compiler.h> |
| 565 |
-#include <linux/config.h> |
| 566 |
#include <linux/errno.h> |
| 567 |
#include <linux/if_arp.h> |
| 568 |
#include <linux/in6.h> |
| 569 |
@@ -52,6 +51,12 @@ |
| 570 |
#include <linux/etherdevice.h> |
| 571 |
#include <asm/uaccess.h> |
| 572 |
|
| 573 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 574 |
+#include <linux/config.h> |
| 575 |
+#else |
| 576 |
+#include <linux/autoconf.h> |
| 577 |
+#endif |
| 578 |
+ |
| 579 |
#include "ieee80211.h" |
| 580 |
|
| 581 |
|
| 582 |
@@ -481,19 +486,19 @@ |
| 583 |
ieee->seq_ctrl++; |
| 584 |
//--- |
| 585 |
}else{ |
| 586 |
- if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) { |
| 587 |
+ if (unlikely(skb->len < 14)) { |
| 588 |
printk(KERN_WARNING "%s: skb too small (%d).\n", |
| 589 |
ieee->dev->name, skb->len); |
| 590 |
goto success; |
| 591 |
} |
| 592 |
- |
| 593 |
+ |
| 594 |
txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC); |
| 595 |
if(!txb){ |
| 596 |
printk(KERN_WARNING "%s: Could not allocate TXB\n", |
| 597 |
ieee->dev->name); |
| 598 |
goto failed; |
| 599 |
} |
| 600 |
- |
| 601 |
+ txb->nr_frags = 1; |
| 602 |
txb->encrypted = 0; |
| 603 |
txb->payload_size = skb->len; |
| 604 |
memcpy(skb_put(txb->fragments[0],skb->len), skb->data, skb->len); |
| 605 |
diff -Naur r8187_orig/Makefile r8187_rawtx/Makefile |
| 606 |
--- r8187_orig/Makefile 1970-01-01 01:00:00.000000000 +0100 |
| 607 |
+++ r8187_rawtx/Makefile 2007-05-13 09:54:38.000000000 +0200 |
| 608 |
@@ -0,0 +1,36 @@ |
| 609 |
+prefix = /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless |
| 610 |
+r8187dir = $(prefix)/rtl8187 |
| 611 |
+ieeedir = $(prefix)/rtl_ieee80211 |
| 612 |
+ |
| 613 |
+default: all |
| 614 |
+ |
| 615 |
+all: |
| 616 |
+ $(MAKE) -C ieee80211 $(@) |
| 617 |
+ -chmod +x symvers |
| 618 |
+ -./symvers |
| 619 |
+ $(MAKE) -C rtl8187 $(@) |
| 620 |
+ |
| 621 |
+install: |
| 622 |
+ install -d $(ieeedir) |
| 623 |
+ install -d $(r8187dir) |
| 624 |
+ install -m 644 ./ieee80211/*.ko $(ieeedir) |
| 625 |
+ install -m 644 ./rtl8187/*.ko $(r8187dir) |
| 626 |
+ -depmod -ae |
| 627 |
+ |
| 628 |
+uninstall: |
| 629 |
+ -rm -f $(ieeedir)/ieee80211-rtl.ko |
| 630 |
+ -rm -f $(ieeedir)/ieee80211_crypt-rtl.ko |
| 631 |
+ -rm -f $(ieeedir)/ieee80211_crypt_ccmp-rtl.ko |
| 632 |
+ -rm -f $(ieeedir)/ieee80211_crypt_tkip-rtl.ko |
| 633 |
+ -rm -f $(ieeedir)/ieee80211_crypt_wep-rtl.ko |
| 634 |
+ -rm -f $(r8187dir)/r8187.ko |
| 635 |
+ -rm -fr $(ieeedir) |
| 636 |
+ -rm -fr $(r8187dir) |
| 637 |
+ -depmod -ae |
| 638 |
+ |
| 639 |
+clean: |
| 640 |
+ $(MAKE) -C ieee80211 $(@) |
| 641 |
+ $(MAKE) -C rtl8187 $(@) |
| 642 |
+ |
| 643 |
+distclean: clean |
| 644 |
+ |
| 645 |
diff -Naur r8187_orig/rtl8187/ieee80211.h r8187_rawtx/rtl8187/ieee80211.h |
| 646 |
--- r8187_orig/rtl8187/ieee80211.h 2007-12-05 09:50:41.000000000 +0100 |
| 647 |
+++ r8187_rawtx/rtl8187/ieee80211.h 2007-05-13 09:55:56.000000000 +0200 |
| 648 |
@@ -108,6 +108,8 @@ |
| 649 |
#define ieee80211_start_protocol ieee80211_start_protocol_rtl |
| 650 |
#define ieee80211_stop_protocol ieee80211_stop_protocol_rtl |
| 651 |
#define ieee80211_rx_mgt ieee80211_rx_mgt_rtl |
| 652 |
+#define ieee80211_stop_queue ieee80211_stop_queue_rtl |
| 653 |
+#define ieee80211_wake_queue ieee80211_wake_queue_rtl |
| 654 |
|
| 655 |
|
| 656 |
typedef struct ieee_param { |
| 657 |
@@ -193,6 +195,22 @@ |
| 658 |
struct list_head list; |
| 659 |
}; |
| 660 |
|
| 661 |
+#define LWNG_CAP_DID_BASE (4 | (1 << 6)) /* section 4, group 1 */ |
| 662 |
+/* ARPHRD_IEEE80211_PRISM uses a bloated version of Prism2 RX frame header |
| 663 |
+ * (from linux-wlan-ng) */ |
| 664 |
+struct linux_wlan_ng_val { |
| 665 |
+ u32 did; |
| 666 |
+ u16 status, len; |
| 667 |
+ u32 data; |
| 668 |
+} __attribute__ ((packed)); |
| 669 |
+ |
| 670 |
+struct linux_wlan_ng_prism_hdr { |
| 671 |
+ u32 msgcode, msglen; |
| 672 |
+ char devname[16]; |
| 673 |
+ struct linux_wlan_ng_val hosttime, mactime, channel, rssi, sq, signal, |
| 674 |
+ noise, rate, istx, frmlen; |
| 675 |
+} __attribute__ ((packed)); |
| 676 |
+ |
| 677 |
struct ieee80211_hdr { |
| 678 |
u16 frame_ctl; |
| 679 |
u16 duration_id; |
| 680 |
@@ -1064,10 +1082,15 @@ |
| 681 |
struct timer_list beacon_timer; |
| 682 |
|
| 683 |
struct work_struct associate_complete_wq; |
| 684 |
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 685 |
+ struct delayed_work associate_retry_wq; |
| 686 |
+ struct delayed_work softmac_scan_wq; |
| 687 |
+#else |
| 688 |
struct work_struct associate_retry_wq; |
| 689 |
+ struct work_struct softmac_scan_wq; |
| 690 |
+#endif |
| 691 |
struct work_struct start_ibss_wq; |
| 692 |
struct work_struct associate_procedure_wq; |
| 693 |
- struct work_struct softmac_scan_wq; |
| 694 |
struct work_struct wx_sync_scan_wq; |
| 695 |
struct work_struct ps_request_tx_ack_wq;//for ps |
| 696 |
struct work_struct hw_wakeup_wq; |
| 697 |
@@ -1390,7 +1413,11 @@ |
| 698 |
extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a, |
| 699 |
union iwreq_data *wrqu, char *b); |
| 700 |
|
| 701 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 702 |
+extern void ieee80211_wx_sync_scan_wq(struct work_struct *work); |
| 703 |
+#else |
| 704 |
extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); |
| 705 |
+#endif |
| 706 |
|
| 707 |
extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee, |
| 708 |
struct iw_request_info *info, |
| 709 |
diff -Naur r8187_orig/rtl8187/r8180_rtl8225.h r8187_rawtx/rtl8187/r8180_rtl8225.h |
| 710 |
--- r8187_orig/rtl8187/r8180_rtl8225.h 2007-01-15 03:00:37.000000000 +0100 |
| 711 |
+++ r8187_rawtx/rtl8187/r8180_rtl8225.h 2007-05-13 09:55:56.000000000 +0200 |
| 712 |
@@ -48,4 +48,5 @@ |
| 713 |
|
| 714 |
extern u32 rtl8225_chan[]; |
| 715 |
|
| 716 |
+void rtl8225z2_SetTXPowerLevel(struct net_device *dev, short ch); |
| 717 |
#endif |
| 718 |
diff -Naur r8187_orig/rtl8187/r8180_wx.c r8187_rawtx/rtl8187/r8180_wx.c |
| 719 |
--- r8187_orig/rtl8187/r8180_wx.c 2007-03-02 04:22:29.000000000 +0100 |
| 720 |
+++ r8187_rawtx/rtl8187/r8180_wx.c 2007-05-13 09:55:52.000000000 +0200 |
| 721 |
@@ -21,7 +21,7 @@ |
| 722 |
|
| 723 |
#include "r8187.h" |
| 724 |
#include "r8180_hw.h" |
| 725 |
- |
| 726 |
+#include "r8180_rtl8225.h" |
| 727 |
|
| 728 |
//#define RATE_COUNT 4 |
| 729 |
u32 rtl8180_rates[] = {1000000,2000000,5500000,11000000, |
| 730 |
@@ -121,22 +121,72 @@ |
| 731 |
return ret; |
| 732 |
} |
| 733 |
|
| 734 |
-static int r8180_wx_set_rawtx(struct net_device *dev, |
| 735 |
- struct iw_request_info *info, |
| 736 |
- union iwreq_data *wrqu, char *extra) |
| 737 |
+static int r8180_wx_get_txpow(struct net_device *dev, |
| 738 |
+ struct iw_request_info *info, |
| 739 |
+ union iwreq_data *wrqu, char *extra) |
| 740 |
{ |
| 741 |
struct r8180_priv *priv = ieee80211_priv(dev); |
| 742 |
- int ret; |
| 743 |
- |
| 744 |
+ int i=0; |
| 745 |
down(&priv->wx_sem); |
| 746 |
- |
| 747 |
- ret = ieee80211_wx_set_rawtx(priv->ieee80211, info, wrqu, extra); |
| 748 |
- |
| 749 |
+ wrqu->power.value = 0; |
| 750 |
+ for(i=0; i<15; i++) |
| 751 |
+ { |
| 752 |
+ if(priv->chtxpwr[i] > wrqu->power.value) wrqu->power.value = priv->chtxpwr[i]; |
| 753 |
+ if(priv->chtxpwr_ofdm[i] > wrqu->power.value) wrqu->power.value = priv->chtxpwr_ofdm[i]; |
| 754 |
+ } |
| 755 |
+ wrqu->power.fixed = 1; |
| 756 |
+ wrqu->power.flags = IW_TXPOW_DBM; |
| 757 |
+ wrqu->power.disabled = 0; |
| 758 |
up(&priv->wx_sem); |
| 759 |
- |
| 760 |
+ |
| 761 |
+ return 0; |
| 762 |
+} |
| 763 |
+ |
| 764 |
+#if 1 |
| 765 |
+static int r8180_wx_set_txpow(struct net_device *dev, |
| 766 |
+ struct iw_request_info *info, |
| 767 |
+ union iwreq_data *wrqu, char *extra) |
| 768 |
+{ |
| 769 |
+ int ret = 0, i=0; |
| 770 |
+ struct r8180_priv *priv = ieee80211_priv(dev); |
| 771 |
+ |
| 772 |
+ down(&priv->wx_sem); |
| 773 |
+ |
| 774 |
+ if (wrqu->power.flags != IW_TXPOW_DBM) |
| 775 |
+ { |
| 776 |
+ ret = -EINVAL; |
| 777 |
+ goto out; |
| 778 |
+ } |
| 779 |
+ |
| 780 |
+ if(wrqu->power.value > priv->txpwr_max) |
| 781 |
+ { |
| 782 |
+ ret = -EINVAL; |
| 783 |
+ goto out; |
| 784 |
+ } |
| 785 |
+ |
| 786 |
+ if(wrqu->power.value < 0) |
| 787 |
+ { |
| 788 |
+ ret = -EINVAL; |
| 789 |
+ goto out; |
| 790 |
+ } |
| 791 |
+ |
| 792 |
+ for(i=1;i<15;i++) |
| 793 |
+ { |
| 794 |
+ priv->chtxpwr[i] = priv->chtxpwr_orig[i] - (priv->txpwr_max - wrqu->power.value); |
| 795 |
+ if(priv->chtxpwr[i] > priv->chtxpwr_orig[i]) priv->chtxpwr[i] = 0; |
| 796 |
+ |
| 797 |
+ priv->chtxpwr_ofdm[i] = priv->chtxpwr_ofdm_orig[i] - (priv->txpwr_max - wrqu->power.value); |
| 798 |
+ if(priv->chtxpwr_ofdm[i] > priv->chtxpwr_ofdm_orig[i]) priv->chtxpwr_ofdm[i] = 0; |
| 799 |
+ } |
| 800 |
+ rtl8225z2_SetTXPowerLevel(dev, 1); |
| 801 |
+ |
| 802 |
+ out: |
| 803 |
+ up(&priv->wx_sem); |
| 804 |
+ |
| 805 |
return ret; |
| 806 |
|
| 807 |
} |
| 808 |
+#endif |
| 809 |
|
| 810 |
static int r8180_wx_set_rts(struct net_device *dev, |
| 811 |
struct iw_request_info *info, |
| 812 |
@@ -836,6 +886,7 @@ |
| 813 |
|
| 814 |
} |
| 815 |
|
| 816 |
+#if 0 |
| 817 |
static int r8180_wx_radio_on(struct net_device *dev, |
| 818 |
struct iw_request_info *info, |
| 819 |
union iwreq_data *wrqu, char *extra) |
| 820 |
@@ -871,6 +922,7 @@ |
| 821 |
return 0; |
| 822 |
|
| 823 |
} |
| 824 |
+#endif |
| 825 |
|
| 826 |
static int r8180_wx_set_channelplan(struct net_device *dev, |
| 827 |
struct iw_request_info *info, |
| 828 |
@@ -965,8 +1017,8 @@ |
| 829 |
r8180_wx_get_rts, /* SIOCGIWRTS */ |
| 830 |
r8180_wx_set_frag, /* SIOCSIWFRAG */ |
| 831 |
r8180_wx_get_frag, /* SIOCGIWFRAG */ |
| 832 |
- dummy, /* SIOCSIWTXPOW */ |
| 833 |
- dummy, /* SIOCGIWTXPOW */ |
| 834 |
+ r8180_wx_set_txpow, /* SIOCSIWTXPOW */ |
| 835 |
+ r8180_wx_get_txpow, /* SIOCGIWTXPOW */ |
| 836 |
r8180_wx_set_retry, /* SIOCSIWRETRY */ |
| 837 |
r8180_wx_get_retry, /* SIOCGIWRETRY */ |
| 838 |
r8180_wx_set_enc, /* SIOCSIWENCODE */ |
| 839 |
@@ -1007,7 +1059,7 @@ |
| 840 |
}, |
| 841 |
{ |
| 842 |
SIOCIWFIRSTPRIV + 0x6, |
| 843 |
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rawtx" |
| 844 |
+ 0, 0, "dummy" |
| 845 |
}, |
| 846 |
{ SIOCIWFIRSTPRIV + 0x7, |
| 847 |
0, 0, "dummy" |
| 848 |
@@ -1053,11 +1105,11 @@ |
| 849 |
}, |
| 850 |
{ |
| 851 |
SIOCIWFIRSTPRIV + 0x12, |
| 852 |
- 0, 0, "radioon" |
| 853 |
+ 0, 0, "dummy" |
| 854 |
}, |
| 855 |
{ |
| 856 |
SIOCIWFIRSTPRIV + 0x13, |
| 857 |
- 0, 0, "radiooff" |
| 858 |
+ 0, 0, "dummy" |
| 859 |
}, |
| 860 |
{ |
| 861 |
SIOCIWFIRSTPRIV + 0x14, |
| 862 |
@@ -1089,7 +1141,7 @@ |
| 863 |
dummy, |
| 864 |
r8180_wx_set_scan_type, |
| 865 |
dummy, |
| 866 |
- r8180_wx_set_rawtx, |
| 867 |
+ dummy, |
| 868 |
dummy, |
| 869 |
r8180_wx_set_iwmode, |
| 870 |
r8180_wx_get_iwmode, |
| 871 |
@@ -1101,8 +1153,8 @@ |
| 872 |
r8180_wx_get_sigqual, |
| 873 |
r8180_wx_reset_stats, |
| 874 |
dummy, |
| 875 |
- r8180_wx_radio_on, |
| 876 |
- r8180_wx_radio_off, |
| 877 |
+ dummy, |
| 878 |
+ dummy, |
| 879 |
r8180_wx_set_channelplan, |
| 880 |
r8180_wx_get_channelplan, |
| 881 |
dummy, |
| 882 |
diff -Naur r8187_orig/rtl8187/r8187_core.c r8187_rawtx/rtl8187/r8187_core.c |
| 883 |
--- r8187_orig/rtl8187/r8187_core.c 2007-03-28 08:39:13.000000000 +0200 |
| 884 |
+++ r8187_rawtx/rtl8187/r8187_core.c 2007-05-13 09:55:52.000000000 +0200 |
| 885 |
@@ -83,6 +83,10 @@ |
| 886 |
#define USB_VENDOR_ID_NETGEAR 0x0846 |
| 887 |
#endif |
| 888 |
|
| 889 |
+#if !(defined(CONFIG_USB_EHCI_HCD) || defined (CONFIG_USB_EHCI_HCD_MODULE)) |
| 890 |
+ #error Build your kernel with ehci_hcd support! |
| 891 |
+#endif |
| 892 |
+ |
| 893 |
static struct usb_device_id rtl8187_usb_id_tbl[] = { |
| 894 |
{USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8187)}, |
| 895 |
{USB_DEVICE(USB_VENDOR_ID_NETGEAR, 0x6100)}, |
| 896 |
@@ -271,9 +275,14 @@ |
| 897 |
//void set_nic_txring(struct net_device *dev); |
| 898 |
static struct net_device_stats *rtl8180_stats(struct net_device *dev); |
| 899 |
void rtl8180_commit(struct net_device *dev); |
| 900 |
-void rtl8180_restart(struct net_device *dev); |
| 901 |
void rtl8180_rq_tx_ack(struct net_device *dev); |
| 902 |
|
| 903 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 904 |
+void rtl8180_restart(struct work_struct *work); |
| 905 |
+#else |
| 906 |
+void rtl8180_restart(struct net_device *dev); |
| 907 |
+#endif |
| 908 |
+ |
| 909 |
/**************************************************************************** |
| 910 |
-----------------------------PROCFS STUFF------------------------- |
| 911 |
*****************************************************************************/ |
| 912 |
@@ -436,13 +445,14 @@ |
| 913 |
return len; |
| 914 |
} |
| 915 |
|
| 916 |
- |
| 917 |
+#if WIRELESS_EXT < 17 |
| 918 |
static struct iw_statistics *r8180_get_wireless_stats(struct net_device *dev) |
| 919 |
{ |
| 920 |
struct r8180_priv *priv = ieee80211_priv(dev); |
| 921 |
|
| 922 |
return &priv->wstats; |
| 923 |
} |
| 924 |
+#endif |
| 925 |
|
| 926 |
void rtl8180_proc_module_init(void) |
| 927 |
{ |
| 928 |
@@ -727,7 +737,7 @@ |
| 929 |
|
| 930 |
usb_fill_bulk_urb(rx_urb,priv->udev, |
| 931 |
usb_rcvbulkpipe(priv->udev,0x81), rx_urb->transfer_buffer, |
| 932 |
- RX_URB_SIZE,rtl8187_rx_isr,dev); |
| 933 |
+ RX_URB_SIZE,rtl8187_rx_isr, dev); |
| 934 |
err = usb_submit_urb(rx_urb, GFP_ATOMIC); |
| 935 |
if(err && err != -EPERM){ |
| 936 |
DMESGE("cannot submit RX command. URB_STATUS %x",rx_urb->status); |
| 937 |
@@ -880,9 +890,12 @@ |
| 938 |
txconf = txconf &~ TCR_DPRETRY_MASK; |
| 939 |
txconf = txconf &~ TCR_RTSRETRY_MASK; |
| 940 |
|
| 941 |
- txconf = txconf | (priv->retry_data<<TX_DPRETRY_SHIFT); // long |
| 942 |
- txconf = txconf | (priv->retry_rts<<TX_RTSRETRY_SHIFT); // short |
| 943 |
- |
| 944 |
+ if(priv->ieee80211->iw_mode != IW_MODE_MONITOR) |
| 945 |
+ { |
| 946 |
+ txconf = txconf | (priv->retry_data<<TX_DPRETRY_SHIFT); // long |
| 947 |
+ txconf = txconf | (priv->retry_rts<<TX_RTSRETRY_SHIFT); // short |
| 948 |
+ } |
| 949 |
+ |
| 950 |
txconf = txconf &~ (1<<TX_NOCRC_SHIFT); |
| 951 |
|
| 952 |
txconf = txconf &~ TCR_MXDMA_MASK; |
| 953 |
@@ -1228,8 +1241,9 @@ |
| 954 |
unsigned long flags; |
| 955 |
struct ieee80211_hdr *h = (struct ieee80211_hdr *) skb->data; |
| 956 |
|
| 957 |
- if (le16_to_cpu(h->frame_ctl) & IEEE80211_FCTL_MOREFRAGS) |
| 958 |
- morefrag = 1; |
| 959 |
+ if(priv->ieee80211->iw_mode != IW_MODE_MONITOR) |
| 960 |
+ if (le16_to_cpu(h->frame_ctl) & IEEE80211_FCTL_MOREFRAGS) |
| 961 |
+ morefrag = 1; |
| 962 |
// DMESG("%x %x", h->frame_ctl, h->seq_ctl); |
| 963 |
/* |
| 964 |
* This function doesn't require lock because we make |
| 965 |
@@ -1240,21 +1254,28 @@ |
| 966 |
*/ |
| 967 |
spin_lock_irqsave(&priv->tx_lock,flags); |
| 968 |
|
| 969 |
- //DMESG("TX"); |
| 970 |
- if (!check_nic_enought_desc(dev, LOW_PRIORITY)){ |
| 971 |
- DMESG("Error: no TX slot "); |
| 972 |
- ieee80211_stop_queue(priv->ieee80211); |
| 973 |
+ if(priv->ieee80211->iw_mode == IW_MODE_MONITOR) |
| 974 |
+ { |
| 975 |
+ rtl8180_tx(dev, skb->data, skb->len, NORM_PRIORITY, morefrag, |
| 976 |
+ ieeerate2rtlrate(rate)); |
| 977 |
} |
| 978 |
+ else |
| 979 |
+ { |
| 980 |
+ //DMESG("TX"); |
| 981 |
+ if (!check_nic_enought_desc(dev, LOW_PRIORITY)){ |
| 982 |
+ DMESG("Error: no TX slot "); |
| 983 |
+ ieee80211_stop_queue(priv->ieee80211); |
| 984 |
+ } |
| 985 |
+ |
| 986 |
+ rtl8180_tx(dev, skb->data, skb->len, LOW_PRIORITY, morefrag, |
| 987 |
+ ieeerate2rtlrate(rate)); |
| 988 |
|
| 989 |
- |
| 990 |
- rtl8180_tx(dev, skb->data, skb->len, LOW_PRIORITY, morefrag, |
| 991 |
- ieeerate2rtlrate(rate)); |
| 992 |
- |
| 993 |
- priv->stats.txdatapkt++; |
| 994 |
- |
| 995 |
- if (!check_nic_enought_desc(dev, LOW_PRIORITY)) |
| 996 |
- ieee80211_stop_queue(priv->ieee80211); |
| 997 |
+ priv->stats.txdatapkt++; |
| 998 |
|
| 999 |
+ if (!check_nic_enought_desc(dev, LOW_PRIORITY)) |
| 1000 |
+ ieee80211_stop_queue(priv->ieee80211); |
| 1001 |
+ } |
| 1002 |
+ |
| 1003 |
spin_unlock_irqrestore(&priv->tx_lock,flags); |
| 1004 |
|
| 1005 |
} |
| 1006 |
@@ -2050,11 +2071,19 @@ |
| 1007 |
priv->ieee80211->mode = IEEE_G|IEEE_B; //2007.1.25 |
| 1008 |
priv->promisc = (dev->flags & IFF_PROMISC) ? 1:0; |
| 1009 |
spin_lock_init(&priv->tx_lock); |
| 1010 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 1011 |
INIT_WORK(&priv->reset_wq,(void(*)(void*)) rtl8180_restart,dev); |
| 1012 |
INIT_WORK(&priv->rtl8180_hw_wakeup_wq,(void(*)(void*))rtl8180_hw_wakeup,dev); |
| 1013 |
INIT_WORK(&priv->ieee80211->ps_request_tx_ack_wq,(void(*)(void*))rtl8180_rq_tx_ack,dev); |
| 1014 |
INIT_WORK(&priv->ieee80211->hw_wakeup_wq,(void(*)(void*))rtl8180_hw_wakeup,dev); |
| 1015 |
INIT_WORK(&priv->ieee80211->hw_sleep_wq,(void(*)(void*))rtl8180_hw_sleep,dev); |
| 1016 |
+#else |
| 1017 |
+ INIT_WORK(&priv->reset_wq, rtl8180_restart); |
| 1018 |
+ INIT_WORK(&priv->rtl8180_hw_wakeup_wq,rtl8180_hw_wakeup); |
| 1019 |
+ INIT_WORK(&priv->ieee80211->ps_request_tx_ack_wq,rtl8180_rq_tx_ack); |
| 1020 |
+ INIT_WORK(&priv->ieee80211->hw_wakeup_wq,rtl8180_hw_wakeup); |
| 1021 |
+ INIT_WORK(&priv->ieee80211->hw_sleep_wq,rtl8180_hw_sleep); |
| 1022 |
+#endif |
| 1023 |
// INIT_WORK(&priv->ps_request_tx_ack_wq,(void(*)(void*))rtl8180_rq_tx_ack,dev); |
| 1024 |
sema_init(&priv->wx_sem,1); |
| 1025 |
sema_init(&priv->power_sem,1); |
| 1026 |
@@ -2259,6 +2288,15 @@ |
| 1027 |
priv->cck_txpwr_base = word & 0xf; |
| 1028 |
priv->ofdm_txpwr_base = (word>>4) & 0xf; |
| 1029 |
|
| 1030 |
+ priv->txpwr_max = 0; |
| 1031 |
+ for(i=1; i<15; i++) |
| 1032 |
+ { |
| 1033 |
+ if(priv->chtxpwr[i] > priv->txpwr_max) priv->txpwr_max = priv->chtxpwr[i]; |
| 1034 |
+ if(priv->chtxpwr_ofdm[i] > priv->txpwr_max) priv->txpwr_max = priv->chtxpwr_ofdm[i]; |
| 1035 |
+ priv->chtxpwr_orig[i] = priv->chtxpwr[i]; |
| 1036 |
+ priv->chtxpwr_ofdm_orig[i] = priv->chtxpwr_ofdm[i]; |
| 1037 |
+ } |
| 1038 |
+ |
| 1039 |
/* check RF frontend chipset */ |
| 1040 |
|
| 1041 |
switch (priv->rf_chip) { |
| 1042 |
@@ -2701,10 +2739,16 @@ |
| 1043 |
_rtl8180_up(dev); |
| 1044 |
} |
| 1045 |
|
| 1046 |
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
| 1047 |
+void rtl8180_restart(struct work_struct *work) |
| 1048 |
+{ |
| 1049 |
+ struct r8180_priv *priv = container_of(work, struct r8180_priv, reset_wq); |
| 1050 |
+ struct net_device *dev = priv->dev; |
| 1051 |
+#else |
| 1052 |
void rtl8180_restart(struct net_device *dev) |
| 1053 |
{ |
| 1054 |
struct r8180_priv *priv = ieee80211_priv(dev); |
| 1055 |
- |
| 1056 |
+#endif |
| 1057 |
down(&priv->wx_sem); |
| 1058 |
|
| 1059 |
rtl8180_commit(dev); |
| 1060 |
@@ -2885,6 +2929,11 @@ |
| 1061 |
// printk(KERN_INFO "quality is %d!\n",priv->wstats.qual.qual); |
| 1062 |
priv->wstats.qual.noise = 100 - priv ->wstats.qual.qual; |
| 1063 |
priv->wstats.qual.updated = 7; |
| 1064 |
+ if(priv->ieee80211->iw_mode == IW_MODE_MONITOR) |
| 1065 |
+ { |
| 1066 |
+ stats.signal = priv->wstats.qual.level; |
| 1067 |
+ stats.noise = priv->wstats.qual.noise; |
| 1068 |
+ } |
| 1069 |
//calculate link quality end |
| 1070 |
skb = dev_alloc_skb(flen-4); |
| 1071 |
if(skb){ |
| 1072 |
@@ -2953,7 +3002,12 @@ |
| 1073 |
dev->do_ioctl = rtl8180_ioctl; |
| 1074 |
dev->set_multicast_list = r8180_set_multicast; |
| 1075 |
dev->set_mac_address = r8180_set_mac_adr; |
| 1076 |
+#if WIRELESS_EXT >= 12 |
| 1077 |
+#if WIRELESS_EXT < 17 |
| 1078 |
dev->get_wireless_stats = r8180_get_wireless_stats; |
| 1079 |
+#endif |
| 1080 |
+ dev->wireless_handlers = (struct iw_handler_def *) &r8180_wx_handlers_def; |
| 1081 |
+#endif |
| 1082 |
dev->type=ARPHRD_ETHER; |
| 1083 |
|
| 1084 |
if (dev_alloc_name(dev, ifname) < 0){ |
| 1085 |
diff -Naur r8187_orig/rtl8187/r8187.h r8187_rawtx/rtl8187/r8187.h |
| 1086 |
--- r8187_orig/rtl8187/r8187.h 2007-12-05 04:22:20.000000000 +0100 |
| 1087 |
+++ r8187_rawtx/rtl8187/r8187.h 2007-05-13 09:55:56.000000000 +0200 |
| 1088 |
@@ -26,7 +26,6 @@ |
| 1089 |
|
| 1090 |
#include <linux/module.h> |
| 1091 |
#include <linux/kernel.h> |
| 1092 |
-#include <linux/config.h> |
| 1093 |
#include <linux/init.h> |
| 1094 |
#include <linux/ioport.h> |
| 1095 |
#include <linux/sched.h> |
| 1096 |
@@ -47,6 +46,12 @@ |
| 1097 |
#include <asm/io.h> |
| 1098 |
#include <asm/semaphore.h> |
| 1099 |
|
| 1100 |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) |
| 1101 |
+#include <linux/config.h> |
| 1102 |
+#else |
| 1103 |
+#include <linux/autoconf.h> |
| 1104 |
+#endif |
| 1105 |
+ |
| 1106 |
#include "ieee80211.h" |
| 1107 |
#include "r8187_led.h" |
| 1108 |
#include "r8180_hw.h" |
| 1109 |
@@ -165,14 +170,17 @@ |
| 1110 |
short max_sens; |
| 1111 |
u8 chtxpwr[15]; //channels from 1 to 14, 0 not used |
| 1112 |
u8 chtxpwr_ofdm[15]; //channels from 1 to 14, 0 not used |
| 1113 |
+ u8 chtxpwr_orig[15]; //channels from 1 to 14, 0 not used |
| 1114 |
+ u8 chtxpwr_ofdm_orig[15]; //channels from 1 to 14, 0 not used |
| 1115 |
u8 cck_txpwr_base; |
| 1116 |
u8 ofdm_txpwr_base; |
| 1117 |
+ u8 txpwr_max; |
| 1118 |
u8 challow[15]; //channels from 1 to 14, 0 not used |
| 1119 |
u8 channel_plan; // it's the channel plan index |
| 1120 |
|
| 1121 |
short up; |
| 1122 |
short crcmon; //if 1 allow bad crc frame reception in monitor mode |
| 1123 |
-// short prism_hdr; |
| 1124 |
+ short prism_hdr; |
| 1125 |
struct timer_list ps_timer; |
| 1126 |
short PS_timeout;//when ps set on ,if tx timeout ,this will be set 1 |
| 1127 |
|
| 1128 |
diff -Naur r8187_orig/rtl8187/r8187_led.c r8187_rawtx/rtl8187/r8187_led.c |
| 1129 |
--- r8187_orig/rtl8187/r8187_led.c 2007-01-15 03:00:37.000000000 +0100 |
| 1130 |
+++ r8187_rawtx/rtl8187/r8187_led.c 2007-05-13 09:55:52.000000000 +0200 |
| 1131 |
@@ -103,22 +103,34 @@ |
| 1132 |
&(priv->Gpio0Led), |
| 1133 |
LED_PIN_GPIO0, |
| 1134 |
Gpio0LedBlinkTimerCallback); |
| 1135 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 1136 |
INIT_WORK(&priv->Gpio0LedWorkItem, |
| 1137 |
(void(*)(void*))Gpio0LedWorkItemCallback, dev); |
| 1138 |
+#else |
| 1139 |
+ INIT_WORK(&priv->Gpio0LedWorkItem, Gpio0LedWorkItemCallback); |
| 1140 |
+#endif |
| 1141 |
|
| 1142 |
InitLed8187(dev, |
| 1143 |
&(priv->SwLed0), |
| 1144 |
LED_PIN_LED0, |
| 1145 |
SwLed0BlinkTimerCallback); |
| 1146 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 1147 |
INIT_WORK(&priv->SwLed0WorkItem, |
| 1148 |
(void(*)(void*))SwLed0WorkItemCallback, dev); |
| 1149 |
+#else |
| 1150 |
+ INIT_WORK(&priv->SwLed0WorkItem, SwLed0WorkItemCallback); |
| 1151 |
+#endif |
| 1152 |
|
| 1153 |
InitLed8187(dev, |
| 1154 |
&(priv->SwLed1), |
| 1155 |
LED_PIN_LED1, |
| 1156 |
SwLed1BlinkTimerCallback); |
| 1157 |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 1158 |
INIT_WORK(&priv->SwLed1WorkItem, |
| 1159 |
(void(*)(void*))SwLed1WorkItemCallback, dev); |
| 1160 |
+#else |
| 1161 |
+ INIT_WORK(&priv->SwLed1WorkItem, SwLed1WorkItemCallback); |
| 1162 |
+#endif |
| 1163 |
} |
| 1164 |
|
| 1165 |
void |
| 1166 |
diff -Naur r8187_orig/symvers r8187_rawtx/symvers |
| 1167 |
--- r8187_orig/symvers 1970-01-01 01:00:00.000000000 +0100 |
| 1168 |
+++ r8187_rawtx/symvers 2007-05-13 09:54:44.000000000 +0200 |
| 1169 |
@@ -0,0 +1,25 @@ |
| 1170 |
+#!/bin/sh |
| 1171 |
+ |
| 1172 |
+cd rtl8187 |
| 1173 |
+ |
| 1174 |
+if [ -e Module.symvers ] |
| 1175 |
+then |
| 1176 |
+ rm Module.symvers |
| 1177 |
+fi |
| 1178 |
+ |
| 1179 |
+if [ -e Modules.symvers ] |
| 1180 |
+then |
| 1181 |
+ rm Modules.symvers |
| 1182 |
+fi |
| 1183 |
+ |
| 1184 |
+if [ -e ../ieee80211/Module.symvers ] |
| 1185 |
+then |
| 1186 |
+ ln -sf ../ieee80211/Module.symvers ./ |
| 1187 |
+fi |
| 1188 |
+ |
| 1189 |
+if [ -e ../ieee80211/Modules.symvers ] |
| 1190 |
+then |
| 1191 |
+ ln -sf ../ieee80211/Modules.symvers ./ |
| 1192 |
+fi |
| 1193 |
+ |
| 1194 |
+cd .. |
| 1195 |
\ Kein Zeilenumbruch am Dateiende. |