Commit 96a51d06 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: rtl8192e: remove kernel version checks

This removes a lot of code that is never built in to the driver.

The size of the built code after this patch is identical to before it.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 19bebc52
...@@ -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 "ieee80211/rtl819x_BA.h" #include "ieee80211/rtl819x_BA.h"
#include "ieee80211/rtl819x_TS.h" #include "ieee80211/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
...@@ -425,46 +395,8 @@ typedef struct ieee_param { ...@@ -425,46 +395,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
...@@ -1736,21 +1668,6 @@ enum ieee80211_state { ...@@ -1736,21 +1668,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;
...@@ -1827,11 +1744,7 @@ typedef struct _RT_POWER_SAVE_CONTROL ...@@ -1827,11 +1744,7 @@ typedef struct _RT_POWER_SAVE_CONTROL
bool bIPSModeBackup; bool bIPSModeBackup;
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
...@@ -2198,36 +2111,16 @@ struct ieee80211_device { ...@@ -2198,36 +2111,16 @@ 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;
#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;
#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;
#endif
// Qos related. Added by Annie, 2005-11-01. // Qos related. Added by Annie, 2005-11-01.
//STA_QOS StaQos; //STA_QOS StaQos;
...@@ -2413,11 +2306,7 @@ struct ieee80211_device { ...@@ -2413,11 +2306,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)
...@@ -2670,11 +2559,7 @@ extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_reques ...@@ -2670,11 +2559,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,
......
...@@ -39,9 +39,6 @@ ...@@ -39,9 +39,6 @@
#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.h" #include "ieee80211.h"
...@@ -1020,11 +1017,7 @@ typedef struct r8192_priv ...@@ -1020,11 +1017,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 rf_ps_lock; spinlock_t rf_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
spinlock_t ps_lock; spinlock_t ps_lock;
...@@ -1163,11 +1156,7 @@ typedef struct r8192_priv ...@@ -1163,11 +1156,7 @@ 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
...@@ -1196,11 +1185,7 @@ typedef struct r8192_priv ...@@ -1196,11 +1185,7 @@ typedef struct r8192_priv
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 rtl819xPci //for rtl819xPci
...@@ -1379,32 +1364,13 @@ typedef struct r8192_priv ...@@ -1379,32 +1364,13 @@ typedef struct r8192_priv
u8 InitialGainOperateType; u8 InitialGainOperateType;
//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
struct tq_struct update_beacon_wq;
/* used for periodly scan */
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
}r8192_priv; }r8192_priv;
// for rtl8187 // for rtl8187
...@@ -1540,11 +1506,7 @@ void CamPrintDbgReg(struct net_device* dev); ...@@ -1540,11 +1506,7 @@ void CamPrintDbgReg(struct net_device* dev);
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 firmware_init_param(struct net_device *dev); extern void firmware_init_param(struct net_device *dev);
extern RT_STATUS cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len); extern RT_STATUS cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
void rtl8192_hw_wakeup_wq (struct work_struct *work); void rtl8192_hw_wakeup_wq (struct work_struct *work);
#else
void rtl8192_hw_wakeup_wq(struct net_device *dev);
#endif
short rtl8192_is_tx_queue_empty(struct net_device *dev); short rtl8192_is_tx_queue_empty(struct net_device *dev);
#ifdef ENABLE_IPS #ifdef ENABLE_IPS
......
This diff is collapsed.
...@@ -69,11 +69,7 @@ extern void hal_dm_watchdog(struct net_device *dev); ...@@ -69,11 +69,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);
...@@ -89,22 +85,14 @@ extern void dm_force_tx_fw_info(struct net_device *dev, ...@@ -89,22 +85,14 @@ 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);
extern void dm_check_fsync(struct net_device *dev); extern void dm_check_fsync(struct net_device *dev);
extern void dm_shadow_init(struct net_device *dev); extern void dm_shadow_init(struct net_device *dev);
extern void dm_initialize_txpower_tracking(struct net_device *dev); extern void dm_initialize_txpower_tracking(struct net_device *dev);
#ifdef RTL8192E #ifdef RTL8192E
#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);
#else
extern void dm_gpio_change_rf_callback(struct net_device *dev);
#endif
#endif #endif
...@@ -217,11 +205,7 @@ void init_hal_dm(struct net_device *dev) ...@@ -217,11 +205,7 @@ void init_hal_dm(struct net_device *dev)
dm_init_rxpath_selection(dev); dm_init_rxpath_selection(dev);
dm_init_ctstoself(dev); dm_init_ctstoself(dev);
#ifdef RTL8192E #ifdef RTL8192E
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
INIT_DELAYED_WORK(&priv->gpio_change_rf_wq, dm_gpio_change_rf_callback); INIT_DELAYED_WORK(&priv->gpio_change_rf_wq, dm_gpio_change_rf_callback);
#else
INIT_WORK(&priv->gpio_change_rf_wq, (void(*)(void*)) dm_gpio_change_rf_callback,dev);
#endif
#endif #endif
} // InitHalDm } // InitHalDm
...@@ -1021,19 +1005,11 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device * dev) ...@@ -1021,19 +1005,11 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device * dev)
priv->txpower_count = 0; priv->txpower_count = 0;
} }
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
void dm_txpower_trackingcallback(struct work_struct *work) 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)
{
#ifndef RTL8190P
struct r8192_priv *priv = ieee80211_priv(dev);
#endif
#endif
#ifdef RTL8190P #ifdef RTL8190P
dm_TXPowerTrackingCallback_TSSI(dev); dm_TXPowerTrackingCallback_TSSI(dev);
...@@ -1599,15 +1575,7 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev) ...@@ -1599,15 +1575,7 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev)
if(tx_power_track_counter > 90) if(tx_power_track_counter > 90)
{ {
#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 =0; tx_power_track_counter =0;
} }
...@@ -1646,15 +1614,7 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev) ...@@ -1646,15 +1614,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;
} }
} }
...@@ -2880,15 +2840,7 @@ static void dm_check_rfctrl_gpio(struct net_device * dev) ...@@ -2880,15 +2840,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 */
...@@ -2949,17 +2901,11 @@ static void dm_check_pbc_gpio(struct net_device *dev) ...@@ -2949,17 +2901,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))
void dm_gpio_change_rf_callback(struct work_struct *work) 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;
...@@ -3025,17 +2971,11 @@ extern void dm_gpio_change_rf_callback(struct net_device *dev) ...@@ -3025,17 +2971,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))
void dm_rf_pathcheck_workitemcallback(struct work_struct *work) 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;
...@@ -3360,15 +3300,7 @@ static void dm_rxpath_sel_byrssi(struct net_device * dev) ...@@ -3360,15 +3300,7 @@ 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 */
......
...@@ -280,11 +280,7 @@ extern void hal_dm_watchdog(struct net_device *dev); ...@@ -280,11 +280,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);
...@@ -300,11 +296,7 @@ extern void dm_force_tx_fw_info(struct net_device *dev, ...@@ -300,11 +296,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);
......
...@@ -1008,7 +1008,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, ...@@ -1008,7 +1008,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;
...@@ -1093,7 +1092,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, ...@@ -1093,7 +1092,6 @@ 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;
} }
...@@ -1102,13 +1100,11 @@ static int r8192_wx_set_auth(struct net_device *dev, ...@@ -1102,13 +1100,11 @@ static int r8192_wx_set_auth(struct net_device *dev,
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;
} }
...@@ -1119,12 +1115,10 @@ static int r8192_wx_set_mlme(struct net_device *dev, ...@@ -1119,12 +1115,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
...@@ -1134,18 +1128,12 @@ static int r8192_wx_set_gen_ie(struct net_device *dev, ...@@ -1134,18 +1128,12 @@ 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
ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, data->data.length); ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, data->data.length);
#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;
} }
static int dummy(struct net_device *dev, struct iw_request_info *a, static int dummy(struct net_device *dev, struct iw_request_info *a,
...@@ -1325,11 +1313,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) ...@@ -1325,11 +1313,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;
} }
...@@ -1341,11 +1325,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) ...@@ -1341,11 +1325,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
......
...@@ -55,26 +55,12 @@ int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state) ...@@ -55,26 +55,12 @@ int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state)
write_nic_dword(dev,ISR,read_nic_dword(dev, ISR)); write_nic_dword(dev,ISR,read_nic_dword(dev, ISR));
/* need to free DM related functions */ /* need to free DM related functions */
#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20)
cancel_work_sync(&priv->reset_wq); cancel_work_sync(&priv->reset_wq);
#else
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
cancel_delayed_work(&priv->reset_wq);
#endif
#endif
del_timer_sync(&priv->fsync_timer); del_timer_sync(&priv->fsync_timer);
del_timer_sync(&priv->watch_dog_timer); del_timer_sync(&priv->watch_dog_timer);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
cancel_delayed_work(&priv->watch_dog_wq); cancel_delayed_work(&priv->watch_dog_wq);
cancel_delayed_work(&priv->update_beacon_wq); cancel_delayed_work(&priv->update_beacon_wq);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
cancel_work_sync(&priv->qos_activate); cancel_work_sync(&priv->qos_activate);
#else
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
cancel_delayed_work(&priv->qos_activate);
#endif
#endif
/* TODO /* TODO
#if ((DEV_BUS_TYPE == PCI_INTERFACE) && (HAL_CODE_BASE == RTL8192)) #if ((DEV_BUS_TYPE == PCI_INTERFACE) && (HAL_CODE_BASE == RTL8192))
......
...@@ -20,9 +20,7 @@ ...@@ -20,9 +20,7 @@
#include "r819xE_firmware_img.h" #include "r819xE_firmware_img.h"
#endif #endif
#include "r819xE_firmware.h" #include "r819xE_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)
{ {
...@@ -254,11 +252,7 @@ bool init_firmware(struct net_device *dev) ...@@ -254,11 +252,7 @@ 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.
...@@ -268,7 +262,6 @@ bool init_firmware(struct net_device *dev) ...@@ -268,7 +262,6 @@ bool init_firmware(struct net_device *dev)
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->pdev->dev); rc = request_firmware(&fw_entry, fw_name[init_step],&priv->pdev->dev);
if(rc < 0 ) { if(rc < 0 ) {
...@@ -300,15 +293,12 @@ bool init_firmware(struct net_device *dev) ...@@ -300,15 +293,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:
......
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