Commit 1ec9e48d authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

Staging: rtl8192su: remove kernel version compatibility wrappers

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7fdb78d0
...@@ -218,7 +218,7 @@ int ToLegalChannel( ...@@ -218,7 +218,7 @@ int ToLegalChannel(
return default_chn; return default_chn;
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
EXPORT_SYMBOL(Dot11d_Init); EXPORT_SYMBOL(Dot11d_Init);
EXPORT_SYMBOL(Dot11d_Reset); EXPORT_SYMBOL(Dot11d_Reset);
EXPORT_SYMBOL(Dot11d_UpdateCountryIe); EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
...@@ -226,14 +226,5 @@ EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm); ...@@ -226,14 +226,5 @@ EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm);
EXPORT_SYMBOL(DOT11D_ScanComplete); EXPORT_SYMBOL(DOT11D_ScanComplete);
EXPORT_SYMBOL(IsLegalChannel); EXPORT_SYMBOL(IsLegalChannel);
EXPORT_SYMBOL(ToLegalChannel); EXPORT_SYMBOL(ToLegalChannel);
#else
EXPORT_SYMBOL_NOVERS(Dot11d_Init);
EXPORT_SYMBOL_NOVERS(Dot11d_Reset);
EXPORT_SYMBOL_NOVERS(Dot11d_UpdateCountryIe);
EXPORT_SYMBOL_NOVERS(DOT11D_GetMaxTxPwrInDbm);
EXPORT_SYMBOL_NOVERS(DOT11D_ScanComplete);
EXPORT_SYMBOL_NOVERS(IsLegalChannel);
EXPORT_SYMBOL_NOVERS(ToLegalChannel);
#endif
#endif #endif
...@@ -27,12 +27,7 @@ ...@@ -27,12 +27,7 @@
#include <linux/kernel.h> /* ARRAY_SIZE */ #include <linux/kernel.h> /* ARRAY_SIZE */
#include <linux/version.h> #include <linux/version.h>
#include <linux/module.h> #include <linux/module.h>
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
#include <linux/jiffies.h> #include <linux/jiffies.h>
#else
#include <linux/jffs.h>
#include <linux/tqueue.h>
#endif
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -43,12 +38,6 @@ ...@@ -43,12 +38,6 @@
#include "rtl819x_BA.h" #include "rtl819x_BA.h"
#include "rtl819x_TS.h" #include "rtl819x_TS.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
#ifndef bool
typedef enum{false = 0, true} bool;
#endif
#endif
#ifndef IW_MODE_MONITOR #ifndef IW_MODE_MONITOR
#define IW_MODE_MONITOR 6 #define IW_MODE_MONITOR 6
#endif #endif
...@@ -57,25 +46,6 @@ typedef enum{false = 0, true} bool; ...@@ -57,25 +46,6 @@ typedef enum{false = 0, true} bool;
#define IWEVCUSTOM 0x8c02 #define IWEVCUSTOM 0x8c02
#endif #endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#ifndef __bitwise
#define __bitwise __attribute__((bitwise))
#endif
typedef __u16 __le16;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27))
struct iw_spy_data{
/* --- Standard spy support --- */
int spy_number;
u_char spy_address[IW_MAX_SPY][ETH_ALEN];
struct iw_quality spy_stat[IW_MAX_SPY];
/* --- Enhanced spy support (event) */
struct iw_quality spy_thr_low; /* Low threshold */
struct iw_quality spy_thr_high; /* High threshold */
u_char spy_thr_under[IW_MAX_SPY];
};
#endif
#endif
#ifndef container_of #ifndef container_of
/** /**
* container_of - cast a member of a structure out to the containing structure * container_of - cast a member of a structure out to the containing structure
...@@ -456,46 +426,8 @@ typedef struct ieee_param { ...@@ -456,46 +426,8 @@ typedef struct ieee_param {
#define IW_QUAL_NOISE_UPDATED 0x4 #define IW_QUAL_NOISE_UPDATED 0x4
#endif #endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *data)
{
task->routine = func;
task->data = data;
//task->next = NULL;
INIT_LIST_HEAD(&task->list);
task->sync = 0;
}
#endif
// linux under 2.6.9 release may not support it, so modify it for common use
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9))
//#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000)
static inline unsigned long msleep_interruptible_rsl(unsigned int msecs)
{
unsigned long timeout = MSECS(msecs) + 1;
while (timeout) {
set_current_state(TASK_INTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
return timeout;
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31))
static inline void msleep(unsigned int msecs)
{
unsigned long timeout = MSECS(msecs) + 1;
while (timeout) {
set_current_state(TASK_UNINTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
}
#endif
#else
#define MSECS(t) msecs_to_jiffies(t) #define MSECS(t) msecs_to_jiffies(t)
#define msleep_interruptible_rsl msleep_interruptible #define msleep_interruptible_rsl msleep_interruptible
#endif
#define IEEE80211_DATA_LEN 2304 #define IEEE80211_DATA_LEN 2304
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
...@@ -1787,21 +1719,6 @@ enum ieee80211_state { ...@@ -1787,21 +1719,6 @@ enum ieee80211_state {
#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ #define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \
IEEE80211_52GHZ_MIN_CHANNEL + 1) IEEE80211_52GHZ_MIN_CHANNEL + 1)
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11))
extern inline int is_multicast_ether_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
}
#endif
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13))
extern inline int is_broadcast_ether_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
#endif
typedef struct tx_pending_t{ typedef struct tx_pending_t{
int frag; int frag;
struct ieee80211_txb *txb; struct ieee80211_txb *txb;
...@@ -1879,11 +1796,7 @@ typedef struct _RT_POWER_SAVE_CONTROL ...@@ -1879,11 +1796,7 @@ typedef struct _RT_POWER_SAVE_CONTROL
bool bHaltAdapterClkRQ; bool bHaltAdapterClkRQ;
bool bSwRfProcessing; bool bSwRfProcessing;
RT_RF_POWER_STATE eInactivePowerState; RT_RF_POWER_STATE eInactivePowerState;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
struct work_struct InactivePsWorkItem; struct work_struct InactivePsWorkItem;
#else
struct tq_struct InactivePsWorkItem;
#endif
struct timer_list InactivePsTimer; struct timer_list InactivePsTimer;
// Return point for join action // Return point for join action
...@@ -2290,41 +2203,17 @@ struct ieee80211_device { ...@@ -2290,41 +2203,17 @@ struct ieee80211_device {
/* used if IEEE_SOFTMAC_BEACONS is set */ /* used if IEEE_SOFTMAC_BEACONS is set */
struct timer_list beacon_timer; struct timer_list beacon_timer;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
struct work_struct associate_complete_wq; struct work_struct associate_complete_wq;
struct work_struct associate_procedure_wq; struct work_struct associate_procedure_wq;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
struct delayed_work softmac_scan_wq; struct delayed_work softmac_scan_wq;
struct delayed_work associate_retry_wq; struct delayed_work associate_retry_wq;
struct delayed_work start_ibss_wq; struct delayed_work start_ibss_wq;
struct delayed_work hw_wakeup_wq; struct delayed_work hw_wakeup_wq;
struct delayed_work hw_sleep_wq; struct delayed_work hw_sleep_wq;
struct delayed_work link_change_wq; struct delayed_work link_change_wq;
#else
struct work_struct softmac_scan_wq;
struct work_struct associate_retry_wq;
struct work_struct start_ibss_wq;
struct work_struct hw_wakeup_wq;
struct work_struct hw_sleep_wq;
struct work_struct link_change_wq;
#endif
struct work_struct wx_sync_scan_wq; struct work_struct wx_sync_scan_wq;
struct workqueue_struct *wq; struct workqueue_struct *wq;
#else
/* used for periodly scan */
struct timer_list scan_timer;
struct tq_struct associate_complete_wq;
struct tq_struct associate_retry_wq;
struct tq_struct start_ibss_wq;
struct tq_struct associate_procedure_wq;
struct tq_struct softmac_scan_wq;
struct tq_struct wx_sync_scan_wq;
struct tq_struct hw_wakeup_wq;
struct tq_struct hw_sleep_wq;
struct tq_struct link_change_wq;
#endif
// Qos related. Added by Annie, 2005-11-01. // Qos related. Added by Annie, 2005-11-01.
//STA_QOS StaQos; //STA_QOS StaQos;
...@@ -2512,11 +2401,7 @@ struct ieee80211_device { ...@@ -2512,11 +2401,7 @@ struct ieee80211_device {
static inline void *ieee80211_priv(struct net_device *dev) static inline void *ieee80211_priv(struct net_device *dev)
{ {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
return ((struct ieee80211_device *)netdev_priv(dev))->priv; return ((struct ieee80211_device *)netdev_priv(dev))->priv;
#else
return ((struct ieee80211_device *)dev->priv)->priv;
#endif
} }
extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
...@@ -2769,12 +2654,7 @@ extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_reques ...@@ -2769,12 +2654,7 @@ extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_reques
union iwreq_data *wrqu, char *b); union iwreq_data *wrqu, char *b);
//extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); //extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void ieee80211_wx_sync_scan_wq(struct work_struct *work); extern void ieee80211_wx_sync_scan_wq(struct work_struct *work);
#else
extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);
#endif
extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee, extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
struct iw_request_info *info, struct iw_request_info *info,
......
...@@ -55,11 +55,7 @@ void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, ...@@ -55,11 +55,7 @@ void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee,
if (entry->ops) { if (entry->ops) {
entry->ops->deinit(entry->priv); entry->ops->deinit(entry->priv);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
module_put(entry->ops->owner); module_put(entry->ops->owner);
#else
__MOD_DEC_USE_COUNT(entry->ops->owner);
#endif
} }
kfree(entry); kfree(entry);
} }
...@@ -251,7 +247,6 @@ static void __exit ieee80211_crypto_deinit(void) ...@@ -251,7 +247,6 @@ static void __exit ieee80211_crypto_deinit(void)
kfree(hcrypt); kfree(hcrypt);
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
EXPORT_SYMBOL(ieee80211_crypt_deinit_entries); EXPORT_SYMBOL(ieee80211_crypt_deinit_entries);
EXPORT_SYMBOL(ieee80211_crypt_deinit_handler); EXPORT_SYMBOL(ieee80211_crypt_deinit_handler);
EXPORT_SYMBOL(ieee80211_crypt_delayed_deinit); EXPORT_SYMBOL(ieee80211_crypt_delayed_deinit);
...@@ -259,15 +254,6 @@ EXPORT_SYMBOL(ieee80211_crypt_delayed_deinit); ...@@ -259,15 +254,6 @@ EXPORT_SYMBOL(ieee80211_crypt_delayed_deinit);
EXPORT_SYMBOL(ieee80211_register_crypto_ops); EXPORT_SYMBOL(ieee80211_register_crypto_ops);
EXPORT_SYMBOL(ieee80211_unregister_crypto_ops); EXPORT_SYMBOL(ieee80211_unregister_crypto_ops);
EXPORT_SYMBOL(ieee80211_get_crypto_ops); EXPORT_SYMBOL(ieee80211_get_crypto_ops);
#else
EXPORT_SYMBOL_NOVERS(ieee80211_crypt_deinit_entries);
EXPORT_SYMBOL_NOVERS(ieee80211_crypt_deinit_handler);
EXPORT_SYMBOL_NOVERS(ieee80211_crypt_delayed_deinit);
EXPORT_SYMBOL_NOVERS(ieee80211_register_crypto_ops);
EXPORT_SYMBOL_NOVERS(ieee80211_unregister_crypto_ops);
EXPORT_SYMBOL_NOVERS(ieee80211_get_crypto_ops);
#endif
module_init(ieee80211_crypto_init); module_init(ieee80211_crypto_init);
module_exit(ieee80211_crypto_deinit); module_exit(ieee80211_crypto_deinit);
...@@ -82,12 +82,5 @@ void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); ...@@ -82,12 +82,5 @@ void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int);
void ieee80211_crypt_deinit_handler(unsigned long); void ieee80211_crypt_deinit_handler(unsigned long);
void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
struct ieee80211_crypt_data **crypt); struct ieee80211_crypt_data **crypt);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31))
#define crypto_alloc_tfm crypto_alloc_tfm_rsl
#define crypto_free_tfm crypto_free_tfm_rsl
#endif
#endif #endif
...@@ -24,18 +24,8 @@ ...@@ -24,18 +24,8 @@
#include "ieee80211.h" #include "ieee80211.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#include "rtl_crypto.h"
#else
#include <linux/crypto.h> #include <linux/crypto.h>
#endif #include <linux/scatterlist.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
#include <asm/scatterlist.h>
#else
#include <linux/scatterlist.h>
#endif
//#include <asm/scatterlist.h>
MODULE_AUTHOR("Jouni Malinen"); MODULE_AUTHOR("Jouni Malinen");
MODULE_DESCRIPTION("Host AP crypt: CCMP"); MODULE_DESCRIPTION("Host AP crypt: CCMP");
...@@ -75,21 +65,7 @@ struct ieee80211_ccmp_data { ...@@ -75,21 +65,7 @@ struct ieee80211_ccmp_data {
void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm, void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm,
const u8 pt[16], u8 ct[16]) const u8 pt[16], u8 ct[16])
{ {
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED))
struct scatterlist src, dst;
src.page = virt_to_page(pt);
src.offset = offset_in_page(pt);
src.length = AES_BLOCK_LEN;
dst.page = virt_to_page(ct);
dst.offset = offset_in_page(ct);
dst.length = AES_BLOCK_LEN;
crypto_cipher_encrypt(tfm, &dst, &src, AES_BLOCK_LEN);
#else
crypto_cipher_encrypt_one((void*)tfm, ct, pt); crypto_cipher_encrypt_one((void*)tfm, ct, pt);
#endif
} }
static void * ieee80211_ccmp_init(int key_idx) static void * ieee80211_ccmp_init(int key_idx)
...@@ -102,32 +78,20 @@ static void * ieee80211_ccmp_init(int key_idx) ...@@ -102,32 +78,20 @@ static void * ieee80211_ccmp_init(int key_idx)
memset(priv, 0, sizeof(*priv)); memset(priv, 0, sizeof(*priv));
priv->key_idx = key_idx; priv->key_idx = key_idx;
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
priv->tfm = crypto_alloc_tfm("aes", 0);
if (priv->tfm == NULL) {
printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate "
"crypto API aes\n");
goto fail;
}
#else
priv->tfm = (void*)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tfm)) { if (IS_ERR(priv->tfm)) {
printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate " printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate "
"crypto API aes\n"); "crypto API aes\n");
priv->tfm = NULL; priv->tfm = NULL;
goto fail; goto fail;
} }
#endif
return priv; return priv;
fail: fail:
if (priv) { if (priv) {
if (priv->tfm) if (priv->tfm)
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
crypto_free_tfm(priv->tfm);
#else
crypto_free_cipher((void*)priv->tfm); crypto_free_cipher((void*)priv->tfm);
#endif
kfree(priv); kfree(priv);
} }
...@@ -138,12 +102,9 @@ static void * ieee80211_ccmp_init(int key_idx) ...@@ -138,12 +102,9 @@ static void * ieee80211_ccmp_init(int key_idx)
static void ieee80211_ccmp_deinit(void *priv) static void ieee80211_ccmp_deinit(void *priv)
{ {
struct ieee80211_ccmp_data *_priv = priv; struct ieee80211_ccmp_data *_priv = priv;
if (_priv && _priv->tfm) if (_priv && _priv->tfm)
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
crypto_free_tfm(_priv->tfm);
#else
crypto_free_cipher((void*)_priv->tfm); crypto_free_cipher((void*)_priv->tfm);
#endif
kfree(priv); kfree(priv);
} }
...@@ -524,11 +485,7 @@ static void __exit ieee80211_crypto_ccmp_exit(void) ...@@ -524,11 +485,7 @@ static void __exit ieee80211_crypto_ccmp_exit(void)
ieee80211_unregister_crypto_ops(&ieee80211_crypt_ccmp); ieee80211_unregister_crypto_ops(&ieee80211_crypt_ccmp);
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
EXPORT_SYMBOL(ieee80211_ccmp_null); EXPORT_SYMBOL(ieee80211_ccmp_null);
#else
EXPORT_SYMBOL_NOVERS(ieee80211_ccmp_null);
#endif
module_init(ieee80211_crypto_ccmp_init); module_init(ieee80211_crypto_ccmp_init);
module_exit(ieee80211_crypto_ccmp_exit); module_exit(ieee80211_crypto_ccmp_exit);
...@@ -20,35 +20,10 @@ ...@@ -20,35 +20,10 @@
#include "ieee80211.h" #include "ieee80211.h"
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20))
//#include "crypto_compat.h"
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#include "rtl_crypto.h"
#else
#include <linux/crypto.h> #include <linux/crypto.h>
#endif #include <linux/scatterlist.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
#include <asm/scatterlist.h>
#else
#include <linux/scatterlist.h>
#endif
//#include <asm/scatterlist.h>
#include <linux/crc32.h> #include <linux/crc32.h>
//
/*
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#include "rtl_crypto.h"
#else
#include <linux/crypto.h>
#endif
#include <asm/scatterlist.h>
#include <linux/crc32.h>
*/
MODULE_AUTHOR("Jouni Malinen"); MODULE_AUTHOR("Jouni Malinen");
MODULE_DESCRIPTION("Host AP crypt: WEP"); MODULE_DESCRIPTION("Host AP crypt: WEP");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -62,12 +37,8 @@ struct prism2_wep_data { ...@@ -62,12 +37,8 @@ struct prism2_wep_data {
u8 key[WEP_KEY_LEN + 1]; u8 key[WEP_KEY_LEN + 1];
u8 key_len; u8 key_len;
u8 key_idx; u8 key_idx;
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) struct crypto_blkcipher *tx_tfm;
struct crypto_tfm *tfm; struct crypto_blkcipher *rx_tfm;
#else
struct crypto_blkcipher *tx_tfm;
struct crypto_blkcipher *rx_tfm;
#endif
}; };
...@@ -81,14 +52,6 @@ static void * prism2_wep_init(int keyidx) ...@@ -81,14 +52,6 @@ static void * prism2_wep_init(int keyidx)
memset(priv, 0, sizeof(*priv)); memset(priv, 0, sizeof(*priv));
priv->key_idx = keyidx; priv->key_idx = keyidx;
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED))
priv->tfm = crypto_alloc_tfm("arc4", 0);
if (priv->tfm == NULL) {
printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
"crypto API arc4\n");
goto fail;
}
#else
priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tx_tfm)) { if (IS_ERR(priv->tx_tfm)) {
printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
...@@ -103,7 +66,6 @@ static void * prism2_wep_init(int keyidx) ...@@ -103,7 +66,6 @@ static void * prism2_wep_init(int keyidx)
priv->rx_tfm = NULL; priv->rx_tfm = NULL;
goto fail; goto fail;
} }
#endif
/* start WEP IV from a random value */ /* start WEP IV from a random value */
get_random_bytes(&priv->iv, 4); get_random_bytes(&priv->iv, 4);
...@@ -111,13 +73,6 @@ static void * prism2_wep_init(int keyidx) ...@@ -111,13 +73,6 @@ static void * prism2_wep_init(int keyidx)
return priv; return priv;
fail: fail:
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED))
if (priv) {
if (priv->tfm)
crypto_free_tfm(priv->tfm);
kfree(priv);
}
#else
if (priv) { if (priv) {
if (priv->tx_tfm) if (priv->tx_tfm)
crypto_free_blkcipher(priv->tx_tfm); crypto_free_blkcipher(priv->tx_tfm);
...@@ -125,7 +80,7 @@ static void * prism2_wep_init(int keyidx) ...@@ -125,7 +80,7 @@ static void * prism2_wep_init(int keyidx)
crypto_free_blkcipher(priv->rx_tfm); crypto_free_blkcipher(priv->rx_tfm);
kfree(priv); kfree(priv);
} }
#endif
return NULL; return NULL;
} }
...@@ -133,17 +88,13 @@ static void * prism2_wep_init(int keyidx) ...@@ -133,17 +88,13 @@ static void * prism2_wep_init(int keyidx)
static void prism2_wep_deinit(void *priv) static void prism2_wep_deinit(void *priv)
{ {
struct prism2_wep_data *_priv = priv; struct prism2_wep_data *_priv = priv;
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED))
if (_priv && _priv->tfm)
crypto_free_tfm(_priv->tfm);
#else
if (_priv) { if (_priv) {
if (_priv->tx_tfm) if (_priv->tx_tfm)
crypto_free_blkcipher(_priv->tx_tfm); crypto_free_blkcipher(_priv->tx_tfm);
if (_priv->rx_tfm) if (_priv->rx_tfm)
crypto_free_blkcipher(_priv->rx_tfm); crypto_free_blkcipher(_priv->rx_tfm);
} }
#endif
kfree(priv); kfree(priv);
} }
...@@ -160,9 +111,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -160,9 +111,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
u8 key[WEP_KEY_LEN + 3]; u8 key[WEP_KEY_LEN + 3];
u8 *pos; u8 *pos;
cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
#if((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)) || (OPENSUSE_SLED)) struct blkcipher_desc desc = { .tfm = wep->tx_tfm };
struct blkcipher_desc desc = {.tfm = wep->tx_tfm};
#endif
u32 crc; u32 crc;
u8 *icv; u8 *icv;
struct scatterlist sg; struct scatterlist sg;
...@@ -201,35 +150,17 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -201,35 +150,17 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
{ {
/* Append little-endian CRC32 and encrypt it to produce ICV */ /* Append little-endian CRC32 and encrypt it to produce ICV */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
crc = ~crc32_le(~0, pos, len); crc = ~crc32_le(~0, pos, len);
#else
crc = ~ether_crc_le(len, pos);
#endif
icv = skb_put(skb, 4); icv = skb_put(skb, 4);
icv[0] = crc; icv[0] = crc;
icv[1] = crc >> 8; icv[1] = crc >> 8;
icv[2] = crc >> 16; icv[2] = crc >> 16;
icv[3] = crc >> 24; icv[3] = crc >> 24;
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED))
crypto_cipher_setkey(wep->tfm, key, klen);
sg.page = virt_to_page(pos);
sg.offset = offset_in_page(pos);
sg.length = len + 4;
crypto_cipher_encrypt(wep->tfm, &sg, &sg, len + 4);
return 0;
#else
crypto_blkcipher_setkey(wep->tx_tfm, key, klen); 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_init_one(&sg, pos, len+4); sg_init_one(&sg, pos, len+4);
#endif
return crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4); return crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4);
#endif
} }
return 0; return 0;
...@@ -250,9 +181,7 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -250,9 +181,7 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
u8 key[WEP_KEY_LEN + 3]; u8 key[WEP_KEY_LEN + 3];
u8 keyidx, *pos; u8 keyidx, *pos;
cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
#if((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)) || (OPENSUSE_SLED)) struct blkcipher_desc desc = { .tfm = wep->rx_tfm };
struct blkcipher_desc desc = {.tfm = wep->rx_tfm};
#endif
u32 crc; u32 crc;
u8 icv[4]; u8 icv[4];
struct scatterlist sg; struct scatterlist sg;
...@@ -277,29 +206,13 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -277,29 +206,13 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
if (!tcb_desc->bHwSec) if (!tcb_desc->bHwSec)
{ {
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED))
crypto_cipher_setkey(wep->tfm, key, klen);
sg.page = virt_to_page(pos);
sg.offset = offset_in_page(pos);
sg.length = plen + 4;
crypto_cipher_decrypt(wep->tfm, &sg, &sg, plen + 4);
#else
crypto_blkcipher_setkey(wep->rx_tfm, key, klen); crypto_blkcipher_setkey(wep->rx_tfm, key, klen);
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) sg_init_one(&sg, pos, plen + 4);
sg.page = virt_to_page(pos);
sg.offset = offset_in_page(pos);
sg.length = plen + 4;
#else
sg_init_one(&sg, pos, plen+4);
#endif
if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4))
return -7; return -7;
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
crc = ~crc32_le(~0, pos, plen); crc = ~crc32_le(~0, pos, plen);
#else
crc = ~ether_crc_le(plen, pos);
#endif
icv[0] = crc; icv[0] = crc;
icv[1] = crc >> 8; icv[1] = crc >> 8;
icv[2] = crc >> 16; icv[2] = crc >> 16;
...@@ -387,11 +300,7 @@ void ieee80211_wep_null(void) ...@@ -387,11 +300,7 @@ void ieee80211_wep_null(void)
// printk("============>%s()\n", __FUNCTION__); // printk("============>%s()\n", __FUNCTION__);
return; return;
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
EXPORT_SYMBOL(ieee80211_wep_null); EXPORT_SYMBOL(ieee80211_wep_null);
#else
EXPORT_SYMBOL_NOVERS(ieee80211_wep_null);
#endif
module_init(ieee80211_crypto_wep_init); module_init(ieee80211_crypto_wep_init);
module_exit(ieee80211_crypto_wep_exit); module_exit(ieee80211_crypto_wep_exit);
...@@ -113,12 +113,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ...@@ -113,12 +113,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
goto failed; goto failed;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
ieee = netdev_priv(dev); ieee = netdev_priv(dev);
#else
ieee = (struct ieee80211_device *)dev->priv;
#endif
memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv); memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv);
ieee->dev = dev; ieee->dev = dev;
...@@ -166,12 +161,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ...@@ -166,12 +161,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
ieee80211_softmac_init(ieee); ieee80211_softmac_init(ieee);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
ieee->pHTInfo = (RT_HIGH_THROUGHPUT*)kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL); ieee->pHTInfo = (RT_HIGH_THROUGHPUT*)kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
#else
ieee->pHTInfo = (RT_HIGH_THROUGHPUT*)kmalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
memset(ieee->pHTInfo,0,sizeof(RT_HIGH_THROUGHPUT));
#endif
if (ieee->pHTInfo == NULL) if (ieee->pHTInfo == NULL)
{ {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n"); IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n");
...@@ -181,11 +171,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ...@@ -181,11 +171,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
HTInitializeHTInfo(ieee); //may move to other place. HTInitializeHTInfo(ieee); //may move to other place.
TSInitialize(ieee); TSInitialize(ieee);
#if 0 #if 0
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
INIT_WORK(&ieee->ht_onAssRsp, (void(*)(void*)) HTOnAssocRsp_wq); INIT_WORK(&ieee->ht_onAssRsp, (void(*)(void*)) HTOnAssocRsp_wq);
#else
INIT_WORK(&ieee->ht_onAssRsp, (void(*)(void*)) HTOnAssocRsp_wq, ieee);
#endif
#endif #endif
for (i = 0; i < IEEE_IBSS_MAC_HASH_SIZE; i++) for (i = 0; i < IEEE_IBSS_MAC_HASH_SIZE; i++)
INIT_LIST_HEAD(&ieee->ibss_mac_hash[i]); INIT_LIST_HEAD(&ieee->ibss_mac_hash[i]);
...@@ -205,22 +191,15 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ...@@ -205,22 +191,15 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
failed: failed:
if (dev) if (dev)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
free_netdev(dev); free_netdev(dev);
#else
kfree(dev);
#endif
return NULL; return NULL;
} }
void free_ieee80211(struct net_device *dev) void free_ieee80211(struct net_device *dev)
{ {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
struct ieee80211_device *ieee = netdev_priv(dev); struct ieee80211_device *ieee = netdev_priv(dev);
#else
struct ieee80211_device *ieee = (struct ieee80211_device *)dev->priv;
#endif
int i; int i;
//struct list_head *p, *q; //struct list_head *p, *q;
// del_timer_sync(&ieee->SwBwTimer); // del_timer_sync(&ieee->SwBwTimer);
...@@ -241,11 +220,7 @@ void free_ieee80211(struct net_device *dev) ...@@ -241,11 +220,7 @@ void free_ieee80211(struct net_device *dev)
if (crypt) { if (crypt) {
if (crypt->ops) { if (crypt->ops) {
crypt->ops->deinit(crypt->priv); crypt->ops->deinit(crypt->priv);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
module_put(crypt->ops->owner); module_put(crypt->ops->owner);
#else
__MOD_DEC_USE_COUNT(crypt->ops->owner);
#endif
} }
kfree(crypt); kfree(crypt);
ieee->crypt[i] = NULL; ieee->crypt[i] = NULL;
...@@ -262,11 +237,7 @@ void free_ieee80211(struct net_device *dev) ...@@ -262,11 +237,7 @@ void free_ieee80211(struct net_device *dev)
} }
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
free_netdev(dev); free_netdev(dev);
#else
kfree(dev);
#endif
} }
#ifdef CONFIG_IEEE80211_DEBUG #ifdef CONFIG_IEEE80211_DEBUG
...@@ -332,11 +303,8 @@ static int __init ieee80211_init(void) ...@@ -332,11 +303,8 @@ static int __init ieee80211_init(void)
struct proc_dir_entry *e; struct proc_dir_entry *e;
ieee80211_debug_level = debug; ieee80211_debug_level = debug;
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, proc_net);
#else
ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net); ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net);
#endif
if (ieee80211_proc == NULL) { if (ieee80211_proc == NULL) {
IEEE80211_ERROR("Unable to create " DRV_NAME IEEE80211_ERROR("Unable to create " DRV_NAME
" proc directory\n"); " proc directory\n");
...@@ -345,11 +313,7 @@ static int __init ieee80211_init(void) ...@@ -345,11 +313,7 @@ static int __init ieee80211_init(void)
e = create_proc_entry("debug_level", S_IFREG | S_IRUGO | S_IWUSR, e = create_proc_entry("debug_level", S_IFREG | S_IRUGO | S_IWUSR,
ieee80211_proc); ieee80211_proc);
if (!e) { if (!e) {
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
remove_proc_entry(DRV_NAME, proc_net);
#else
remove_proc_entry(DRV_NAME, init_net.proc_net); remove_proc_entry(DRV_NAME, init_net.proc_net);
#endif
ieee80211_proc = NULL; ieee80211_proc = NULL;
return -EIO; return -EIO;
} }
...@@ -364,16 +328,11 @@ static void __exit ieee80211_exit(void) ...@@ -364,16 +328,11 @@ static void __exit ieee80211_exit(void)
{ {
if (ieee80211_proc) { if (ieee80211_proc) {
remove_proc_entry("debug_level", ieee80211_proc); remove_proc_entry("debug_level", ieee80211_proc);
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
remove_proc_entry(DRV_NAME, proc_net);
#else
remove_proc_entry(DRV_NAME, init_net.proc_net); remove_proc_entry(DRV_NAME, init_net.proc_net);
#endif
ieee80211_proc = NULL; ieee80211_proc = NULL;
} }
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
module_param(debug, int, 0444); module_param(debug, int, 0444);
MODULE_PARM_DESC(debug, "debug output mask"); MODULE_PARM_DESC(debug, "debug output mask");
...@@ -382,12 +341,6 @@ MODULE_PARM_DESC(debug, "debug output mask"); ...@@ -382,12 +341,6 @@ MODULE_PARM_DESC(debug, "debug output mask");
module_exit(ieee80211_exit); module_exit(ieee80211_exit);
module_init(ieee80211_init); module_init(ieee80211_init);
#endif #endif
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
EXPORT_SYMBOL(alloc_ieee80211); EXPORT_SYMBOL(alloc_ieee80211);
EXPORT_SYMBOL(free_ieee80211); EXPORT_SYMBOL(free_ieee80211);
#else
EXPORT_SYMBOL_NOVERS(alloc_ieee80211);
EXPORT_SYMBOL_NOVERS(free_ieee80211);
#endif
...@@ -55,11 +55,7 @@ static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee, ...@@ -55,11 +55,7 @@ static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee,
u16 fc = le16_to_cpu(hdr->frame_ctl); u16 fc = le16_to_cpu(hdr->frame_ctl);
skb->dev = ieee->dev; skb->dev = ieee->dev;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
#else
skb->mac.raw = skb->data;
#endif
skb_pull(skb, ieee80211_get_hdrlen(fc)); skb_pull(skb, ieee80211_get_hdrlen(fc));
skb->pkt_type = PACKET_OTHERHOST; skb->pkt_type = PACKET_OTHERHOST;
...@@ -2823,10 +2819,5 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee, ...@@ -2823,10 +2819,5 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
} }
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
EXPORT_SYMBOL(ieee80211_rx_mgt); EXPORT_SYMBOL(ieee80211_rx_mgt);
EXPORT_SYMBOL(ieee80211_rx); EXPORT_SYMBOL(ieee80211_rx);
#else
EXPORT_SYMBOL_NOVERS(ieee80211_rx_mgt);
EXPORT_SYMBOL_NOVERS(ieee80211_rx);
#endif
...@@ -313,14 +313,9 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, struct iw_request_info ...@@ -313,14 +313,9 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, struct iw_request_info
return 0; return 0;
} }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
void ieee80211_wx_sync_scan_wq(struct work_struct *work) void ieee80211_wx_sync_scan_wq(struct work_struct *work)
{ {
struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq); struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq);
#else
void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee)
{
#endif
short chan; short chan;
HT_EXTCHNL_OFFSET chan_offset=0; HT_EXTCHNL_OFFSET chan_offset=0;
HT_CHANNEL_WIDTH bandwidth=0; HT_CHANNEL_WIDTH bandwidth=0;
...@@ -410,11 +405,7 @@ int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info ...@@ -410,11 +405,7 @@ int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info
} }
if ( ieee->state == IEEE80211_LINKED){ if ( ieee->state == IEEE80211_LINKED){
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
queue_work(ieee->wq, &ieee->wx_sync_scan_wq); queue_work(ieee->wq, &ieee->wx_sync_scan_wq);
#else
schedule_task(&ieee->wx_sync_scan_wq);
#endif
/* intentionally forget to up sem */ /* intentionally forget to up sem */
return 0; return 0;
} }
...@@ -460,18 +451,6 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee, ...@@ -460,18 +451,6 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
if (wrqu->essid.flags && wrqu->essid.length) { if (wrqu->essid.flags && wrqu->essid.length) {
//first flush current network.ssid //first flush current network.ssid
len = ((wrqu->essid.length-1) < IW_ESSID_MAX_SIZE) ? (wrqu->essid.length-1) : IW_ESSID_MAX_SIZE; len = ((wrqu->essid.length-1) < IW_ESSID_MAX_SIZE) ? (wrqu->essid.length-1) : IW_ESSID_MAX_SIZE;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
strncpy(ieee->current_network.ssid, extra, len);
ieee->current_network.ssid_len = len;
#if 0
{
int i;
for (i=0; i<len; i++)
printk("%c ", extra[i]);
printk("\n");
}
#endif
#else
strncpy(ieee->current_network.ssid, extra, len+1); strncpy(ieee->current_network.ssid, extra, len+1);
ieee->current_network.ssid_len = len+1; ieee->current_network.ssid_len = len+1;
#if 0 #if 0
...@@ -481,7 +460,6 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee, ...@@ -481,7 +460,6 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
printk("%c ", extra[i]); printk("%c ", extra[i]);
printk("\n"); printk("\n");
} }
#endif
#endif #endif
ieee->ssid_set = 1; ieee->ssid_set = 1;
} }
...@@ -670,7 +648,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee, ...@@ -670,7 +648,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
return ret; return ret;
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
EXPORT_SYMBOL(ieee80211_wx_get_essid); EXPORT_SYMBOL(ieee80211_wx_get_essid);
EXPORT_SYMBOL(ieee80211_wx_set_essid); EXPORT_SYMBOL(ieee80211_wx_set_essid);
EXPORT_SYMBOL(ieee80211_wx_set_rate); EXPORT_SYMBOL(ieee80211_wx_set_rate);
...@@ -689,23 +667,3 @@ EXPORT_SYMBOL(ieee80211_wx_get_power); ...@@ -689,23 +667,3 @@ EXPORT_SYMBOL(ieee80211_wx_get_power);
EXPORT_SYMBOL(ieee80211_wlan_frequencies); EXPORT_SYMBOL(ieee80211_wlan_frequencies);
EXPORT_SYMBOL(ieee80211_wx_set_rts); EXPORT_SYMBOL(ieee80211_wx_set_rts);
EXPORT_SYMBOL(ieee80211_wx_get_rts); EXPORT_SYMBOL(ieee80211_wx_get_rts);
#else
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_essid);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_essid);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rate);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_rate);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_wap);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_wap);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_mode);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_mode);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_scan);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_freq);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_freq);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rawtx);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_name);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_power);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_power);
EXPORT_SYMBOL_NOVERS(ieee80211_wlan_frequencies);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rts);
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_rts);
#endif
...@@ -287,11 +287,8 @@ ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network) ...@@ -287,11 +287,8 @@ ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network)
return 0; return 0;
// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
ip = ip_hdr(skb); ip = ip_hdr(skb);
#else
ip = (struct iphdr*)(skb->data + sizeof(struct ether_header));
#endif
switch (ip->tos & 0xfc) { switch (ip->tos & 0xfc) {
case 0x20: case 0x20:
return 2; return 2;
...@@ -620,11 +617,7 @@ void ieee80211_query_seqnum(struct ieee80211_device*ieee, struct sk_buff* skb, u ...@@ -620,11 +617,7 @@ void ieee80211_query_seqnum(struct ieee80211_device*ieee, struct sk_buff* skb, u
int rtl8192_ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) int rtl8192_ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
struct ieee80211_device *ieee = netdev_priv(dev); struct ieee80211_device *ieee = netdev_priv(dev);
#else
struct ieee80211_device *ieee = (struct ieee80211_device *)dev->priv;
#endif
struct ieee80211_txb *txb = NULL; struct ieee80211_txb *txb = NULL;
struct ieee80211_hdr_3addrqos *frag_hdr; struct ieee80211_hdr_3addrqos *frag_hdr;
int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size; int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size;
......
...@@ -1241,14 +1241,9 @@ u8 HTFilterMCSRate( struct ieee80211_device* ieee, u8* pSupportMCS, u8* pOperate ...@@ -1241,14 +1241,9 @@ u8 HTFilterMCSRate( struct ieee80211_device* ieee, u8* pSupportMCS, u8* pOperate
void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset); void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset);
#if 0 #if 0
//I need move this function to other places, such as rx? //I need move this function to other places, such as rx?
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
void HTOnAssocRsp_wq(struct work_struct *work) void HTOnAssocRsp_wq(struct work_struct *work)
{ {
struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, ht_onAssRsp); struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, ht_onAssRsp);
#else
void HTOnAssocRsp_wq(struct ieee80211_device *ieee)
{
#endif
#endif #endif
void HTOnAssocRsp(struct ieee80211_device *ieee) void HTOnAssocRsp(struct ieee80211_device *ieee)
{ {
...@@ -2030,8 +2025,4 @@ void HTSetConnectBwModeCallback(struct ieee80211_device* ieee) ...@@ -2030,8 +2025,4 @@ void HTSetConnectBwModeCallback(struct ieee80211_device* ieee)
pHTInfo->bSwBwInProgress = false; pHTInfo->bSwBwInProgress = false;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
EXPORT_SYMBOL_NOVERS(HTUpdateSelfAndPeerSetting);
#else
EXPORT_SYMBOL(HTUpdateSelfAndPeerSetting); EXPORT_SYMBOL(HTUpdateSelfAndPeerSetting);
#endif
...@@ -2,13 +2,6 @@ ...@@ -2,13 +2,6 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include "rtl819x_TS.h" #include "rtl819x_TS.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#define list_for_each_entry_safe(pos, n, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member), \
n = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))
#endif
void TsSetupTimeOut(unsigned long data) void TsSetupTimeOut(unsigned long data)
{ {
// Not implement yet // Not implement yet
...@@ -660,8 +653,5 @@ void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS) ...@@ -660,8 +653,5 @@ void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS)
else else
IEEE80211_DEBUG(IEEE80211_DL_ERR, "%s()==>BA timer is already added\n", __FUNCTION__); IEEE80211_DEBUG(IEEE80211_DL_ERR, "%s()==>BA timer is already added\n", __FUNCTION__);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
EXPORT_SYMBOL_NOVERS(RemovePeerTS);
#else
EXPORT_SYMBOL(RemovePeerTS); EXPORT_SYMBOL(RemovePeerTS);
#endif
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
#include "r8192xU_firmware_img.h" #include "r8192xU_firmware_img.h"
#endif #endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
#include <linux/firmware.h> #include <linux/firmware.h>
#endif
#define byte(x,n) ( (x >> (8 * n)) & 0xff ) #define byte(x,n) ( (x >> (8 * n)) & 0xff )
...@@ -405,16 +403,11 @@ bool FirmwareDownload92S(struct net_device *dev) ...@@ -405,16 +403,11 @@ bool FirmwareDownload92S(struct net_device *dev)
//3 //<1> Open Image file, and map file to contineous memory if open file success. //3 //<1> Open Image file, and map file to contineous memory if open file success.
//3 // or read image file from array. Default load from BIN file //3 // or read image file from array. Default load from BIN file
//3// //3//
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
priv->firmware_source = FW_SOURCE_HEADER_FILE;
#else
priv->firmware_source = FW_SOURCE_IMG_FILE;// We should decided by Reg. priv->firmware_source = FW_SOURCE_IMG_FILE;// We should decided by Reg.
#endif
switch( priv->firmware_source ) switch( priv->firmware_source )
{ {
case FW_SOURCE_IMG_FILE: case FW_SOURCE_IMG_FILE:
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
if(pFirmware->szFwTmpBufferLen == 0) if(pFirmware->szFwTmpBufferLen == 0)
{ {
...@@ -473,7 +466,6 @@ bool FirmwareDownload92S(struct net_device *dev) ...@@ -473,7 +466,6 @@ bool FirmwareDownload92S(struct net_device *dev)
} }
#endif
break; break;
case FW_SOURCE_HEADER_FILE: case FW_SOURCE_HEADER_FILE:
...@@ -870,11 +862,8 @@ bool init_firmware(struct net_device *dev) ...@@ -870,11 +862,8 @@ bool init_firmware(struct net_device *dev)
* Download boot, main, and data image for System reset. * Download boot, main, and data image for System reset.
* Download data image for firmware reseta * Download data image for firmware reseta
*/ */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
priv->firmware_source = FW_SOURCE_HEADER_FILE;
#else
priv->firmware_source = FW_SOURCE_IMG_FILE; priv->firmware_source = FW_SOURCE_IMG_FILE;
#endif
for(init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) { for(init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) {
/* /*
* Open Image file, and map file to contineous memory if open file success. * Open Image file, and map file to contineous memory if open file success.
...@@ -883,7 +872,6 @@ bool init_firmware(struct net_device *dev) ...@@ -883,7 +872,6 @@ bool init_firmware(struct net_device *dev)
if(rst_opt == OPT_SYSTEM_RESET) { if(rst_opt == OPT_SYSTEM_RESET) {
switch(priv->firmware_source) { switch(priv->firmware_source) {
case FW_SOURCE_IMG_FILE: case FW_SOURCE_IMG_FILE:
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
rc = request_firmware(&fw_entry, fw_name[init_step],&priv->udev->dev); rc = request_firmware(&fw_entry, fw_name[init_step],&priv->udev->dev);
if(rc < 0 ) { if(rc < 0 ) {
RT_TRACE(COMP_ERR, "request firmware fail!\n"); RT_TRACE(COMP_ERR, "request firmware fail!\n");
...@@ -912,7 +900,6 @@ bool init_firmware(struct net_device *dev) ...@@ -912,7 +900,6 @@ bool init_firmware(struct net_device *dev)
#endif #endif
} }
pfirmware->firmware_buf_size = file_length; pfirmware->firmware_buf_size = file_length;
#endif
break; break;
case FW_SOURCE_HEADER_FILE: case FW_SOURCE_HEADER_FILE:
...@@ -943,11 +930,10 @@ bool init_firmware(struct net_device *dev) ...@@ -943,11 +930,10 @@ bool init_firmware(struct net_device *dev)
* and Tx descriptor info * and Tx descriptor info
* */ * */
rt_status = fw_download_code(dev,mapped_file,file_length); rt_status = fw_download_code(dev,mapped_file,file_length);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
if(rst_opt == OPT_SYSTEM_RESET) { if(rst_opt == OPT_SYSTEM_RESET) {
release_firmware(fw_entry); release_firmware(fw_entry);
} }
#endif
if(rt_status != TRUE) { if(rt_status != TRUE) {
goto download_firmware_fail; goto download_firmware_fail;
......
...@@ -4678,29 +4678,15 @@ void InitialGain819xUsb(struct net_device *dev, u8 Operation) ...@@ -4678,29 +4678,15 @@ void InitialGain819xUsb(struct net_device *dev, u8 Operation)
if(priv->up) if(priv->up)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
queue_delayed_work(priv->priv_wq,&priv->initialgain_operate_wq,0); queue_delayed_work(priv->priv_wq,&priv->initialgain_operate_wq,0);
#else
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
schedule_task(&priv->initialgain_operate_wq);
#else
queue_work(priv->priv_wq,&priv->initialgain_operate_wq);
#endif
#endif
} }
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void InitialGainOperateWorkItemCallBack(struct work_struct *work) extern void InitialGainOperateWorkItemCallBack(struct work_struct *work)
{ {
struct delayed_work *dwork = container_of(work,struct delayed_work,work); struct delayed_work *dwork = container_of(work,struct delayed_work,work);
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,initialgain_operate_wq); struct r8192_priv *priv = container_of(dwork,struct r8192_priv,initialgain_operate_wq);
struct net_device *dev = priv->ieee80211->dev; struct net_device *dev = priv->ieee80211->dev;
#else
extern void InitialGainOperateWorkItemCallBack(struct net_device *dev)
{
struct r8192_priv *priv = ieee80211_priv(dev);
#endif
#define SCAN_RX_INITIAL_GAIN 0x17 #define SCAN_RX_INITIAL_GAIN 0x17
#define POWER_DETECTION_TH 0x08 #define POWER_DETECTION_TH 0x08
u32 BitMask; u32 BitMask;
......
...@@ -121,11 +121,8 @@ extern void PHY_IQCalibrateBcut(struct net_device* dev); ...@@ -121,11 +121,8 @@ extern void PHY_IQCalibrateBcut(struct net_device* dev);
extern void PHY_IQCalibrate(struct net_device* dev); extern void PHY_IQCalibrate(struct net_device* dev);
extern void PHY_GetHWRegOriginalValue(struct net_device* dev); extern void PHY_GetHWRegOriginalValue(struct net_device* dev);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void InitialGainOperateWorkItemCallBack(struct work_struct *work); extern void InitialGainOperateWorkItemCallBack(struct work_struct *work);
#else
extern void InitialGainOperateWorkItemCallBack(struct net_device *dev);
#endif
void PHY_SetTxPowerLevel8192S(struct net_device* dev, u8 channel); void PHY_SetTxPowerLevel8192S(struct net_device* dev, u8 channel);
void PHY_InitialGain8192S(struct net_device* dev,u8 Operation ); void PHY_InitialGain8192S(struct net_device* dev,u8 Operation );
......
...@@ -39,9 +39,7 @@ ...@@ -39,9 +39,7 @@
#include <linux/random.h> #include <linux/random.h>
#include <linux/version.h> #include <linux/version.h>
#include <asm/io.h> #include <asm/io.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
#include <asm/semaphore.h>
#endif
#include "ieee80211/ieee80211.h" #include "ieee80211/ieee80211.h"
#ifdef RTL8192SU #ifdef RTL8192SU
...@@ -1555,11 +1553,7 @@ typedef struct r8192_priv ...@@ -1555,11 +1553,7 @@ typedef struct r8192_priv
// spinlock_t irq_th_lock; // spinlock_t irq_th_lock;
spinlock_t tx_lock; spinlock_t tx_lock;
spinlock_t ps_lock; spinlock_t ps_lock;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16))
struct semaphore mutex;
#else
struct mutex mutex; struct mutex mutex;
#endif
spinlock_t rf_lock; //used to lock rf write operation added by wb spinlock_t rf_lock; //used to lock rf write operation added by wb
u16 irq_mask; u16 irq_mask;
...@@ -1619,11 +1613,9 @@ typedef struct r8192_priv ...@@ -1619,11 +1613,9 @@ typedef struct r8192_priv
/* modified by davad for Rx process */ /* modified by davad for Rx process */
struct sk_buff_head rx_queue; struct sk_buff_head rx_queue;
struct sk_buff_head skb_queue; struct sk_buff_head skb_queue;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
struct tq_struct qos_activate;
#else
struct work_struct qos_activate; struct work_struct qos_activate;
#endif
short tx_urb_index; short tx_urb_index;
atomic_t tx_pending[0x10];//UART_PRIORITY+1 atomic_t tx_pending[0x10];//UART_PRIORITY+1
...@@ -1653,11 +1645,8 @@ typedef struct r8192_priv ...@@ -1653,11 +1645,8 @@ typedef struct r8192_priv
u16 rts; u16 rts;
struct ChnlAccessSetting ChannelAccessSetting; struct ChnlAccessSetting ChannelAccessSetting;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
struct work_struct reset_wq; struct work_struct reset_wq;
#else
struct tq_struct reset_wq;
#endif
/**********************************************************/ /**********************************************************/
//for rtl819xUsb //for rtl819xUsb
...@@ -1874,33 +1863,14 @@ typedef struct r8192_priv ...@@ -1874,33 +1863,14 @@ typedef struct r8192_priv
u16 SifsTime; u16 SifsTime;
//define work item by amy 080526 //define work item by amy 080526
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
struct delayed_work update_beacon_wq; struct delayed_work update_beacon_wq;
struct delayed_work watch_dog_wq; struct delayed_work watch_dog_wq;
struct delayed_work txpower_tracking_wq; struct delayed_work txpower_tracking_wq;
struct delayed_work rfpath_check_wq; struct delayed_work rfpath_check_wq;
struct delayed_work gpio_change_rf_wq; struct delayed_work gpio_change_rf_wq;
struct delayed_work initialgain_operate_wq; struct delayed_work initialgain_operate_wq;
#else
struct work_struct update_beacon_wq;
struct work_struct watch_dog_wq;
struct work_struct txpower_tracking_wq;
struct work_struct rfpath_check_wq;
struct work_struct gpio_change_rf_wq;
struct work_struct initialgain_operate_wq;
#endif
struct workqueue_struct *priv_wq; struct workqueue_struct *priv_wq;
#else
/* used for periodly scan */
struct tq_struct update_beacon_wq;
struct tq_struct txpower_tracking_wq;
struct tq_struct rfpath_check_wq;
struct tq_struct watch_dog_wq;
struct tq_struct gpio_change_rf_wq;
struct tq_struct initialgain_operate_wq;
#endif
//#ifdef RTL8192SU //#ifdef RTL8192SU
//lzm add for 8192S //lzm add for 8192S
u32 IntrMask; u32 IntrMask;
......
This diff is collapsed.
...@@ -98,12 +98,7 @@ extern void hal_dm_watchdog(struct net_device *dev); ...@@ -98,12 +98,7 @@ extern void hal_dm_watchdog(struct net_device *dev);
extern void init_rate_adaptive(struct net_device *dev); extern void init_rate_adaptive(struct net_device *dev);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void dm_txpower_trackingcallback(struct work_struct *work); extern void dm_txpower_trackingcallback(struct work_struct *work);
#else
extern void dm_txpower_trackingcallback(struct net_device *dev);
#endif
extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14); extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14);
extern void dm_restore_dynamic_mechanism_state(struct net_device *dev); extern void dm_restore_dynamic_mechanism_state(struct net_device *dev);
extern void dm_backup_dynamic_mechanism_state(struct net_device *dev); extern void dm_backup_dynamic_mechanism_state(struct net_device *dev);
...@@ -118,11 +113,7 @@ extern void dm_force_tx_fw_info(struct net_device *dev, ...@@ -118,11 +113,7 @@ extern void dm_force_tx_fw_info(struct net_device *dev,
u32 force_value); u32 force_value);
extern void dm_init_edca_turbo(struct net_device *dev); extern void dm_init_edca_turbo(struct net_device *dev);
extern void dm_rf_operation_test_callback(unsigned long data); extern void dm_rf_operation_test_callback(unsigned long data);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work); extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work);
#else
extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev);
#endif
extern void dm_fsync_timer_callback(unsigned long data); extern void dm_fsync_timer_callback(unsigned long data);
#if 0 #if 0
extern bool dm_check_lbus_status(struct net_device *dev); extern bool dm_check_lbus_status(struct net_device *dev);
...@@ -1180,17 +1171,11 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device * dev) ...@@ -1180,17 +1171,11 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device * dev)
priv->txpower_count = 0; priv->txpower_count = 0;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void dm_txpower_trackingcallback(struct work_struct *work) extern void dm_txpower_trackingcallback(struct work_struct *work)
{ {
struct delayed_work *dwork = container_of(work,struct delayed_work,work); struct delayed_work *dwork = container_of(work,struct delayed_work,work);
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,txpower_tracking_wq); struct r8192_priv *priv = container_of(dwork,struct r8192_priv,txpower_tracking_wq);
struct net_device *dev = priv->ieee80211->dev; struct net_device *dev = priv->ieee80211->dev;
#else
extern void dm_txpower_trackingcallback(struct net_device *dev)
{
struct r8192_priv *priv = ieee80211_priv(dev);
#endif
#ifdef RTL8190P #ifdef RTL8190P
dm_TXPowerTrackingCallback_TSSI(dev); dm_TXPowerTrackingCallback_TSSI(dev);
...@@ -1754,15 +1739,7 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev) ...@@ -1754,15 +1739,7 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev)
{ {
if((tx_power_track_counter % 30 == 0)&&(tx_power_track_counter != 0)) if((tx_power_track_counter % 30 == 0)&&(tx_power_track_counter != 0))
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0); queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0);
#else
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
schedule_task(&priv->txpower_tracking_wq);
#else
queue_work(priv->priv_wq,&priv->txpower_tracking_wq);
#endif
#endif
} }
tx_power_track_counter++; tx_power_track_counter++;
} }
...@@ -1821,15 +1798,7 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev) ...@@ -1821,15 +1798,7 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev)
else else
{ {
//DbgPrint("Schedule TxPowerTrackingWorkItem\n"); //DbgPrint("Schedule TxPowerTrackingWorkItem\n");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0); queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0);
#else
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
schedule_task(&priv->txpower_tracking_wq);
#else
queue_work(priv->priv_wq,&priv->txpower_tracking_wq);
#endif
#endif
TM_Trigger = 0; TM_Trigger = 0;
} }
#endif #endif
...@@ -3345,15 +3314,7 @@ static void dm_check_rfctrl_gpio(struct net_device * dev) ...@@ -3345,15 +3314,7 @@ static void dm_check_rfctrl_gpio(struct net_device * dev)
return; return;
#endif #endif
#ifdef RTL8192E #ifdef RTL8192E
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
queue_delayed_work(priv->priv_wq,&priv->gpio_change_rf_wq,0); queue_delayed_work(priv->priv_wq,&priv->gpio_change_rf_wq,0);
#else
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
schedule_task(&priv->gpio_change_rf_wq);
#else
queue_work(priv->priv_wq,&priv->gpio_change_rf_wq);
#endif
#endif
#endif #endif
} /* dm_CheckRfCtrlGPIO */ } /* dm_CheckRfCtrlGPIO */
...@@ -3442,17 +3403,11 @@ static void dm_check_pbc_gpio(struct net_device *dev) ...@@ -3442,17 +3403,11 @@ static void dm_check_pbc_gpio(struct net_device *dev)
* 02/21/2008 MHC Create Version 0. * 02/21/2008 MHC Create Version 0.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void dm_gpio_change_rf_callback(struct work_struct *work) extern void dm_gpio_change_rf_callback(struct work_struct *work)
{ {
struct delayed_work *dwork = container_of(work,struct delayed_work,work); struct delayed_work *dwork = container_of(work,struct delayed_work,work);
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq); struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq);
struct net_device *dev = priv->ieee80211->dev; struct net_device *dev = priv->ieee80211->dev;
#else
extern void dm_gpio_change_rf_callback(struct net_device *dev)
{
struct r8192_priv *priv = ieee80211_priv(dev);
#endif
u8 tmp1byte; u8 tmp1byte;
RT_RF_POWER_STATE eRfPowerStateToSet; RT_RF_POWER_STATE eRfPowerStateToSet;
bool bActuallySet = false; bool bActuallySet = false;
...@@ -3520,17 +3475,11 @@ extern void dm_gpio_change_rf_callback(struct net_device *dev) ...@@ -3520,17 +3475,11 @@ extern void dm_gpio_change_rf_callback(struct net_device *dev)
* 01/30/2008 MHC Create Version 0. * 01/30/2008 MHC Create Version 0.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work) extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work)
{ {
struct delayed_work *dwork = container_of(work,struct delayed_work,work); struct delayed_work *dwork = container_of(work,struct delayed_work,work);
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,rfpath_check_wq); struct r8192_priv *priv = container_of(dwork,struct r8192_priv,rfpath_check_wq);
struct net_device *dev =priv->ieee80211->dev; struct net_device *dev =priv->ieee80211->dev;
#else
extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev)
{
struct r8192_priv *priv = ieee80211_priv(dev);
#endif
//bool bactually_set = false; //bool bactually_set = false;
u8 rfpath = 0, i; u8 rfpath = 0, i;
...@@ -3855,15 +3804,8 @@ static void dm_rxpath_sel_byrssi(struct net_device * dev) ...@@ -3855,15 +3804,8 @@ static void dm_rxpath_sel_byrssi(struct net_device * dev)
static void dm_check_rx_path_selection(struct net_device *dev) static void dm_check_rx_path_selection(struct net_device *dev)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
queue_delayed_work(priv->priv_wq,&priv->rfpath_check_wq,0); queue_delayed_work(priv->priv_wq,&priv->rfpath_check_wq,0);
#else
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
schedule_task(&priv->rfpath_check_wq);
#else
queue_work(priv->priv_wq,&priv->rfpath_check_wq);
#endif
#endif
} /* dm_CheckRxRFPath */ } /* dm_CheckRxRFPath */
......
...@@ -275,11 +275,7 @@ extern void deinit_hal_dm(struct net_device *dev); ...@@ -275,11 +275,7 @@ extern void deinit_hal_dm(struct net_device *dev);
extern void hal_dm_watchdog(struct net_device *dev); extern void hal_dm_watchdog(struct net_device *dev);
extern void init_rate_adaptive(struct net_device *dev); extern void init_rate_adaptive(struct net_device *dev);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void dm_txpower_trackingcallback(struct work_struct *work); extern void dm_txpower_trackingcallback(struct work_struct *work);
#else
extern void dm_txpower_trackingcallback(struct net_device *dev);
#endif
extern void dm_restore_dynamic_mechanism_state(struct net_device *dev); extern void dm_restore_dynamic_mechanism_state(struct net_device *dev);
extern void dm_backup_dynamic_mechanism_state(struct net_device *dev); extern void dm_backup_dynamic_mechanism_state(struct net_device *dev);
extern void dm_change_dynamic_initgain_thresh(struct net_device *dev, extern void dm_change_dynamic_initgain_thresh(struct net_device *dev,
...@@ -287,11 +283,7 @@ extern void dm_change_dynamic_initgain_thresh(struct net_device *dev, ...@@ -287,11 +283,7 @@ extern void dm_change_dynamic_initgain_thresh(struct net_device *dev,
extern void dm_force_tx_fw_info(struct net_device *dev,u32 force_type, u32 force_value); extern void dm_force_tx_fw_info(struct net_device *dev,u32 force_type, u32 force_value);
extern void dm_init_edca_turbo(struct net_device *dev); extern void dm_init_edca_turbo(struct net_device *dev);
extern void dm_rf_operation_test_callback(unsigned long data); extern void dm_rf_operation_test_callback(unsigned long data);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work); extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work);
#else
extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev);
#endif
extern void dm_fsync_timer_callback(unsigned long data); extern void dm_fsync_timer_callback(unsigned long data);
extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14); extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14);
#if 0 #if 0
......
...@@ -22,11 +22,8 @@ int rtl8192U_save_state (struct pci_dev *dev, u32 state) ...@@ -22,11 +22,8 @@ int rtl8192U_save_state (struct pci_dev *dev, u32 state)
int rtl8192U_suspend(struct usb_interface *intf, pm_message_t state) int rtl8192U_suspend(struct usb_interface *intf, pm_message_t state)
{ {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
struct net_device *dev = usb_get_intfdata(intf); struct net_device *dev = usb_get_intfdata(intf);
#else
//struct net_device *dev = (struct net_device *)ptr;
#endif
RT_TRACE(COMP_POWER, "============> r8192U suspend call.\n"); RT_TRACE(COMP_POWER, "============> r8192U suspend call.\n");
if(dev) { if(dev) {
...@@ -48,11 +45,7 @@ int rtl8192U_suspend(struct usb_interface *intf, pm_message_t state) ...@@ -48,11 +45,7 @@ int rtl8192U_suspend(struct usb_interface *intf, pm_message_t state)
int rtl8192U_resume (struct usb_interface *intf) int rtl8192U_resume (struct usb_interface *intf)
{ {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
struct net_device *dev = usb_get_intfdata(intf); struct net_device *dev = usb_get_intfdata(intf);
#else
//struct net_device *dev = (struct net_device *)ptr;
#endif
RT_TRACE(COMP_POWER, "================>r8192U resume call."); RT_TRACE(COMP_POWER, "================>r8192U resume call.");
......
...@@ -981,7 +981,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, ...@@ -981,7 +981,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
int ret=0; int ret=0;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device* ieee = priv->ieee80211; struct ieee80211_device* ieee = priv->ieee80211;
//printk("===>%s()\n", __FUNCTION__); //printk("===>%s()\n", __FUNCTION__);
...@@ -1065,22 +1064,19 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, ...@@ -1065,22 +1064,19 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
end_hw_sec: end_hw_sec:
up(&priv->wx_sem); up(&priv->wx_sem);
#endif
return ret; return ret;
} }
static int r8192_wx_set_auth(struct net_device *dev, static int r8192_wx_set_auth(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *data, char *extra) union iwreq_data *data, char *extra)
{ {
int ret=0; int ret=0;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
//printk("====>%s()\n", __FUNCTION__); //printk("====>%s()\n", __FUNCTION__);
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem); down(&priv->wx_sem);
ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), extra); ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), extra);
up(&priv->wx_sem); up(&priv->wx_sem);
#endif
return ret; return ret;
} }
...@@ -1091,13 +1087,10 @@ static int r8192_wx_set_mlme(struct net_device *dev, ...@@ -1091,13 +1087,10 @@ static int r8192_wx_set_mlme(struct net_device *dev,
//printk("====>%s()\n", __FUNCTION__); //printk("====>%s()\n", __FUNCTION__);
int ret=0; int ret=0;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem); down(&priv->wx_sem);
ret = ieee80211_wx_set_mlme(priv->ieee80211, info, wrqu, extra); ret = ieee80211_wx_set_mlme(priv->ieee80211, info, wrqu, extra);
up(&priv->wx_sem); up(&priv->wx_sem);
#endif
return ret; return ret;
} }
#endif #endif
...@@ -1107,7 +1100,6 @@ static int r8192_wx_set_gen_ie(struct net_device *dev, ...@@ -1107,7 +1100,6 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
{ {
//printk("====>%s(), len:%d\n", __FUNCTION__, data->length); //printk("====>%s(), len:%d\n", __FUNCTION__, data->length);
int ret=0; int ret=0;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem); down(&priv->wx_sem);
#if 1 #if 1
...@@ -1115,7 +1107,6 @@ static int r8192_wx_set_gen_ie(struct net_device *dev, ...@@ -1115,7 +1107,6 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
#endif #endif
up(&priv->wx_sem); up(&priv->wx_sem);
//printk("<======%s(), ret:%d\n", __FUNCTION__, ret); //printk("<======%s(), ret:%d\n", __FUNCTION__, ret);
#endif
return ret; return ret;
...@@ -1311,11 +1302,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) ...@@ -1311,11 +1302,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
wstats->qual.qual = 0; wstats->qual.qual = 0;
wstats->qual.level = 0; wstats->qual.level = 0;
wstats->qual.noise = 0; wstats->qual.noise = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
#else
wstats->qual.updated = 0x0f;
#endif
return wstats; return wstats;
} }
...@@ -1327,11 +1314,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) ...@@ -1327,11 +1314,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
wstats->qual.level = tmp_level; wstats->qual.level = tmp_level;
wstats->qual.qual = tmp_qual; wstats->qual.qual = tmp_qual;
wstats->qual.noise = tmp_noise; wstats->qual.noise = tmp_noise;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM; wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM;
#else
wstats->qual.updated = 0x0f;
#endif
return wstats; return wstats;
} }
//#endif //#endif
......
...@@ -15,9 +15,8 @@ ...@@ -15,9 +15,8 @@
#include "r8192U_hw.h" #include "r8192U_hw.h"
#include "r819xU_firmware_img.h" #include "r819xU_firmware_img.h"
#include "r819xU_firmware.h" #include "r819xU_firmware.h"
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
#include <linux/firmware.h> #include <linux/firmware.h>
#endif
void firmware_init_param(struct net_device *dev) void firmware_init_param(struct net_device *dev)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
...@@ -338,11 +337,8 @@ bool init_firmware(struct net_device *dev) ...@@ -338,11 +337,8 @@ bool init_firmware(struct net_device *dev)
* Download boot, main, and data image for System reset. * Download boot, main, and data image for System reset.
* Download data image for firmware reseta * Download data image for firmware reseta
*/ */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
priv->firmware_source = FW_SOURCE_HEADER_FILE;
#else
priv->firmware_source = FW_SOURCE_IMG_FILE; priv->firmware_source = FW_SOURCE_IMG_FILE;
#endif
for(init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) { for(init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) {
/* /*
* Open Image file, and map file to contineous memory if open file success. * Open Image file, and map file to contineous memory if open file success.
...@@ -351,7 +347,6 @@ bool init_firmware(struct net_device *dev) ...@@ -351,7 +347,6 @@ bool init_firmware(struct net_device *dev)
if(rst_opt == OPT_SYSTEM_RESET) { if(rst_opt == OPT_SYSTEM_RESET) {
switch(priv->firmware_source) { switch(priv->firmware_source) {
case FW_SOURCE_IMG_FILE: case FW_SOURCE_IMG_FILE:
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
if(pfirmware->firmware_buf_size[init_step] == 0) { if(pfirmware->firmware_buf_size[init_step] == 0) {
rc = request_firmware(&fw_entry, fw_name[init_step],&priv->udev->dev); rc = request_firmware(&fw_entry, fw_name[init_step],&priv->udev->dev);
if(rc < 0 ) { if(rc < 0 ) {
...@@ -382,16 +377,12 @@ bool init_firmware(struct net_device *dev) ...@@ -382,16 +377,12 @@ bool init_firmware(struct net_device *dev)
} }
//pfirmware->firmware_buf_size = file_length; //pfirmware->firmware_buf_size = file_length;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
if(rst_opt == OPT_SYSTEM_RESET) { if(rst_opt == OPT_SYSTEM_RESET) {
release_firmware(fw_entry); release_firmware(fw_entry);
} }
#endif
} }
mapped_file = pfirmware->firmware_buf[init_step]; mapped_file = pfirmware->firmware_buf[init_step];
file_length = pfirmware->firmware_buf_size[init_step]; file_length = pfirmware->firmware_buf_size[init_step];
#endif
break; break;
case FW_SOURCE_HEADER_FILE: case FW_SOURCE_HEADER_FILE:
......
...@@ -1726,29 +1726,15 @@ void InitialGain819xUsb(struct net_device *dev, u8 Operation) ...@@ -1726,29 +1726,15 @@ void InitialGain819xUsb(struct net_device *dev, u8 Operation)
if(priv->up) if(priv->up)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
queue_delayed_work(priv->priv_wq,&priv->initialgain_operate_wq,0); queue_delayed_work(priv->priv_wq,&priv->initialgain_operate_wq,0);
#else
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
schedule_task(&priv->initialgain_operate_wq);
#else
queue_work(priv->priv_wq,&priv->initialgain_operate_wq);
#endif
#endif
} }
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void InitialGainOperateWorkItemCallBack(struct work_struct *work) extern void InitialGainOperateWorkItemCallBack(struct work_struct *work)
{ {
struct delayed_work *dwork = container_of(work,struct delayed_work,work); struct delayed_work *dwork = container_of(work,struct delayed_work,work);
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,initialgain_operate_wq); struct r8192_priv *priv = container_of(dwork,struct r8192_priv,initialgain_operate_wq);
struct net_device *dev = priv->ieee80211->dev; struct net_device *dev = priv->ieee80211->dev;
#else
extern void InitialGainOperateWorkItemCallBack(struct net_device *dev)
{
struct r8192_priv *priv = ieee80211_priv(dev);
#endif
#define SCAN_RX_INITIAL_GAIN 0x17 #define SCAN_RX_INITIAL_GAIN 0x17
#define POWER_DETECTION_TH 0x08 #define POWER_DETECTION_TH 0x08
u32 BitMask; u32 BitMask;
......
...@@ -85,10 +85,6 @@ extern bool rtl8192_SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eR ...@@ -85,10 +85,6 @@ extern bool rtl8192_SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eR
//added by amy //added by amy
extern void InitialGain819xUsb(struct net_device *dev, u8 Operation); extern void InitialGain819xUsb(struct net_device *dev, u8 Operation);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
extern void InitialGainOperateWorkItemCallBack(struct work_struct *work); extern void InitialGainOperateWorkItemCallBack(struct work_struct *work);
#else
extern void InitialGainOperateWorkItemCallBack(struct net_device *dev);
#endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment