diff -Naur rtl8185_linux_26.1027.0823.2007/ieee80211/ieee80211_crypt_tkip.c rtl8185_linux_26.1027.0823.2007-patched/ieee80211/ieee80211_crypt_tkip.c --- rtl8185_linux_26.1027.0823.2007/ieee80211/ieee80211_crypt_tkip.c 2007-08-14 17:19:36.000000000 +0100 +++ rtl8185_linux_26.1027.0823.2007-patched/ieee80211/ieee80211_crypt_tkip.c 2008-04-25 17:25:03.000000000 +0100 @@ -414,9 +414,13 @@ crypto_cipher_encrypt(tkey->tfm_arc4, &sg, &sg, len + 4); #else crypto_blkcipher_setkey(tkey->tx_tfm_arc4, rc4key, 16); + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) sg.page = virt_to_page(pos); sg.offset = offset_in_page(pos); sg.length = len + 4; + #else + sg_set_page(&sg, virt_to_page(pos), len + 4, offset_in_page(pos)); + #endif ret= crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4); #endif @@ -502,15 +506,21 @@ #if(LINUX_VERSION_CODE tfm_arc4, rc4key, 16); + sg.page = virt_to_page(pos); sg.offset = offset_in_page(pos); sg.length = plen + 4; + crypto_cipher_decrypt(tkey->tfm_arc4, &sg, &sg, plen + 4); #else crypto_blkcipher_setkey(tkey->rx_tfm_arc4, rc4key, 16); + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) sg.page = virt_to_page(pos); sg.offset = offset_in_page(pos); sg.length = plen + 4; + #else + sg_set_page(&sg, virt_to_page(pos), plen + 4, offset_in_page(pos)); + #endif if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) { if (net_ratelimit()) { printk(KERN_DEBUG ": TKIP: failed to decrypt " @@ -610,14 +620,21 @@ printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n"); return -1; } + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) sg[0].page = virt_to_page(hdr); sg[0].offset = offset_in_page(hdr); sg[0].length = 16; + #else + sg_set_page(&sg[0], virt_to_page(hdr), 16, offset_in_page(hdr)); + #endif + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) sg[1].page = virt_to_page(data); sg[1].offset = offset_in_page(data); sg[1].length = data_len; - + #else + sg_set_page(&sg[1], virt_to_page(data), data_len, offset_in_page(data)); + #endif if (crypto_hash_setkey(tfm_michael, key, 8)) return -1; diff -Naur rtl8185_linux_26.1027.0823.2007/ieee80211/ieee80211_crypt_wep.c rtl8185_linux_26.1027.0823.2007-patched/ieee80211/ieee80211_crypt_wep.c --- rtl8185_linux_26.1027.0823.2007/ieee80211/ieee80211_crypt_wep.c 2007-08-14 17:19:36.000000000 +0100 +++ rtl8185_linux_26.1027.0823.2007-patched/ieee80211/ieee80211_crypt_wep.c 2008-04-25 17:25:30.000000000 +0100 @@ -201,13 +201,17 @@ sg.length = len + 4; crypto_cipher_encrypt(wep->tfm, &sg, &sg, len + 4); return 0; - #else + #else crypto_blkcipher_setkey(wep->tx_tfm, key, klen); + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) sg.page = virt_to_page(pos); sg.offset = offset_in_page(pos); sg.length = len + 4; + #else + sg_set_page(&sg, virt_to_page(pos), len + 4, offset_in_page(pos)); + #endif return crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4); - #endif + #endif } @@ -256,11 +260,15 @@ sg.offset = offset_in_page(pos); sg.length = plen + 4; crypto_cipher_decrypt(wep->tfm, &sg, &sg, plen + 4); - #else + #else crypto_blkcipher_setkey(wep->rx_tfm, key, klen); + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) sg.page = virt_to_page(pos); sg.offset = offset_in_page(pos); sg.length = plen + 4; + #else + sg_set_page(&sg, virt_to_page(pos), plen + 4, offset_in_page(pos)); + #endif if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) return -7; #endif diff -Naur rtl8185_linux_26.1027.0823.2007/rtl8185/r8180_core.c rtl8185_linux_26.1027.0823.2007-patched/rtl8185/r8180_core.c --- rtl8185_linux_26.1027.0823.2007/rtl8185/r8180_core.c 2007-08-23 03:03:27.000000000 +0100 +++ rtl8185_linux_26.1027.0823.2007-patched/rtl8185/r8180_core.c 2008-04-25 17:32:08.000000000 +0100 @@ -585,13 +585,21 @@ void rtl8180_proc_module_init(void) { DMESG("Initializing proc filesystem"); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) rtl8180_proc=create_proc_entry(RTL8180_MODULE_NAME, S_IFDIR, proc_net); +#else + rtl8180_proc=create_proc_entry(RTL8180_MODULE_NAME, S_IFDIR, init_net.proc_net); +#endif } void rtl8180_proc_module_remove(void) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) remove_proc_entry(RTL8180_MODULE_NAME, proc_net); +#else + remove_proc_entry(RTL8180_MODULE_NAME, init_net.proc_net); +#endif } @@ -3519,7 +3527,7 @@ else DMESG ("104-bit WEP is NOT supported in hardware"); } - if(request_irq(dev->irq, rtl8180_interrupt, SA_SHIRQ, dev->name, dev)){ + if(request_irq(dev->irq, rtl8180_interrupt, IRQF_SHARED, dev->name, dev)){ DMESGE("Error allocating IRQ %d",dev->irq); return -1; }else{ diff -Naur rtl8185_linux_26.1027.0823.2007/rtl8185/r8180.h rtl8185_linux_26.1027.0823.2007-patched/rtl8185/r8180.h --- rtl8185_linux_26.1027.0823.2007/rtl8185/r8180.h 2007-08-22 11:04:59.000000000 +0100 +++ rtl8185_linux_26.1027.0823.2007-patched/rtl8185/r8180.h 2008-04-25 16:47:17.000000000 +0100 @@ -24,6 +24,10 @@ #define DMESGW(x,a...) printk(KERN_WARNING RTL8180_MODULE_NAME ": WW:" x "\n", ## a) #define DMESGE(x,a...) printk(KERN_WARNING RTL8180_MODULE_NAME ": EE:" x "\n", ## a) +#if !defined(SET_MODULE_OWNER) +#define SET_MODULE_OWNER(dev) do { } while (0) +#endif + #include #include //#include