Commit 50a09b3b authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Greg Kroah-Hartman

Staging: rtl8192u: remove dead code

Remove #ifse against older kernel versions;
Remove codes marked with #if 0;
Remove #if 1
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e406322b
...@@ -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,11 +38,6 @@ ...@@ -43,11 +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
...@@ -57,24 +47,6 @@ typedef enum{false = 0, true} bool; ...@@ -57,24 +47,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
/** /**
...@@ -425,46 +397,10 @@ typedef struct ieee_param { ...@@ -425,46 +397,10 @@ 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 // 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
...@@ -926,7 +862,6 @@ struct ieee_ibss_seq { ...@@ -926,7 +862,6 @@ struct ieee_ibss_seq {
* information for frames received. Not setting these will not cause * information for frames received. Not setting these will not cause
* any adverse affects. */ * any adverse affects. */
struct ieee80211_rx_stats { struct ieee80211_rx_stats {
#if 1
u32 mac_time[2]; u32 mac_time[2];
s8 rssi; s8 rssi;
u8 signal; u8 signal;
...@@ -988,7 +923,6 @@ struct ieee80211_rx_stats { ...@@ -988,7 +923,6 @@ struct ieee80211_rx_stats {
bool bToSelfBA; //cosa add for rssi bool bToSelfBA; //cosa add for rssi
char cck_adc_pwdb[4]; //cosa add for rx path selection char cck_adc_pwdb[4]; //cosa add for rx path selection
u16 Seq_Num; u16 Seq_Num;
#endif
}; };
...@@ -1336,7 +1270,6 @@ typedef union _frameqos { ...@@ -1336,7 +1270,6 @@ typedef union _frameqos {
#define QOS_OUI_PARAM_SUB_TYPE 1 #define QOS_OUI_PARAM_SUB_TYPE 1
#define QOS_VERSION_1 1 #define QOS_VERSION_1 1
#define QOS_AIFSN_MIN_VALUE 2 #define QOS_AIFSN_MIN_VALUE 2
#if 1
struct ieee80211_qos_information_element { struct ieee80211_qos_information_element {
u8 elementID; u8 elementID;
u8 length; u8 length;
...@@ -1411,7 +1344,6 @@ struct ieee80211_wmm_tspec_elem { ...@@ -1411,7 +1344,6 @@ struct ieee80211_wmm_tspec_elem {
u16 surp_band_allow; u16 surp_band_allow;
u16 medium_time; u16 medium_time;
}__attribute__((packed)); }__attribute__((packed));
#endif
enum eap_type { enum eap_type {
EAP_PACKET = 0, EAP_PACKET = 0,
EAPOL_START, EAPOL_START,
...@@ -1534,14 +1466,12 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame}; ...@@ -1534,14 +1466,12 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
//UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP //UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP
//#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1)) //#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1))
#if 1
#define UP2AC(up) ( \ #define UP2AC(up) ( \
((up) < 1) ? WME_AC_BE : \ ((up) < 1) ? WME_AC_BE : \
((up) < 3) ? WME_AC_BK : \ ((up) < 3) ? WME_AC_BK : \
((up) < 4) ? WME_AC_BE : \ ((up) < 4) ? WME_AC_BE : \
((up) < 6) ? WME_AC_VI : \ ((up) < 6) ? WME_AC_VI : \
WME_AC_VO) WME_AC_VO)
#endif
//AC Mapping to UP, using in Tx part for selecting the corresponding TX queue //AC Mapping to UP, using in Tx part for selecting the corresponding TX queue
#define AC2UP(_ac) ( \ #define AC2UP(_ac) ( \
((_ac) == WME_AC_VO) ? 6 : \ ((_ac) == WME_AC_VO) ? 6 : \
...@@ -1597,12 +1527,7 @@ struct ieee80211_network { ...@@ -1597,12 +1527,7 @@ struct ieee80211_network {
/* Ensure null-terminated for any debug msgs */ /* Ensure null-terminated for any debug msgs */
u8 ssid[IW_ESSID_MAX_SIZE + 1]; u8 ssid[IW_ESSID_MAX_SIZE + 1];
u8 ssid_len; u8 ssid_len;
#if 1
struct ieee80211_qos_data qos_data; struct ieee80211_qos_data qos_data;
#else
// Qos related. Added by Annie, 2005-11-01.
BSS_QOS BssQos;
#endif
//added by amy for LEAP //added by amy for LEAP
bool bWithAironetIE; bool bWithAironetIE;
bool bCkipSupported; bool bCkipSupported;
...@@ -1667,7 +1592,6 @@ struct ieee80211_network { ...@@ -1667,7 +1592,6 @@ struct ieee80211_network {
struct list_head list; struct list_head list;
}; };
#if 1
enum ieee80211_state { enum ieee80211_state {
/* the card is not linked at all */ /* the card is not linked at all */
...@@ -1706,17 +1630,6 @@ enum ieee80211_state { ...@@ -1706,17 +1630,6 @@ enum ieee80211_state {
IEEE80211_LINKED_SCANNING, IEEE80211_LINKED_SCANNING,
}; };
#else
enum ieee80211_state {
IEEE80211_UNINITIALIZED = 0,
IEEE80211_INITIALIZED,
IEEE80211_ASSOCIATING,
IEEE80211_ASSOCIATED,
IEEE80211_AUTHENTICATING,
IEEE80211_AUTHENTICATED,
IEEE80211_SHUTDOWN
};
#endif
#define DEFAULT_MAX_SCAN_AGE (15 * HZ) #define DEFAULT_MAX_SCAN_AGE (15 * HZ)
#define DEFAULT_FTS 2346 #define DEFAULT_FTS 2346
...@@ -1735,20 +1648,7 @@ enum ieee80211_state { ...@@ -1735,20 +1648,7 @@ 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;
...@@ -1826,11 +1726,7 @@ typedef struct _RT_POWER_SAVE_CONTROL ...@@ -1826,11 +1726,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
...@@ -2195,32 +2091,13 @@ struct ieee80211_device { ...@@ -2195,32 +2091,13 @@ 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;
#else
struct work_struct softmac_scan_wq;
struct work_struct associate_retry_wq;
struct work_struct start_ibss_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;
...@@ -2320,35 +2197,9 @@ struct ieee80211_device { ...@@ -2320,35 +2197,9 @@ struct ieee80211_device {
void (*ps_request_tx_ack) (struct net_device *dev); void (*ps_request_tx_ack) (struct net_device *dev);
void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl); void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl);
short (*ps_is_queue_empty) (struct net_device *dev); short (*ps_is_queue_empty) (struct net_device *dev);
#if 0
/* Typical STA methods */
int (*handle_auth) (struct net_device * dev,
struct ieee80211_auth * auth);
int (*handle_deauth) (struct net_device * dev,
struct ieee80211_deauth * auth);
int (*handle_action) (struct net_device * dev,
struct ieee80211_action * action,
struct ieee80211_rx_stats * stats);
int (*handle_disassoc) (struct net_device * dev,
struct ieee80211_disassoc * assoc);
#endif
int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network);
#if 0
int (*handle_probe_response) (struct net_device * dev,
struct ieee80211_probe_response * resp,
struct ieee80211_network * network);
int (*handle_probe_request) (struct net_device * dev,
struct ieee80211_probe_request * req,
struct ieee80211_rx_stats * stats);
#endif
int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network);
#if 0
/* Typical AP methods */
int (*handle_assoc_request) (struct net_device * dev);
int (*handle_reassoc_request) (struct net_device * dev,
struct ieee80211_reassoc_request * req);
#endif
/* check whether Tx hw resouce available */ /* check whether Tx hw resouce available */
short (*check_nic_enough_desc)(struct net_device *dev, int queue_index); short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
...@@ -2406,11 +2257,7 @@ struct ieee80211_device { ...@@ -2406,11 +2257,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)
...@@ -2663,11 +2510,7 @@ extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_reques ...@@ -2663,11 +2510,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,
......
...@@ -7,11 +7,6 @@ ...@@ -7,11 +7,6 @@
* 2. Before write integer to IO. * 2. Before write integer to IO.
* 3. After read integer from IO. * 3. After read integer from IO.
*/ */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
#ifndef bool
typedef enum{false = 0, true} bool;
#endif
#endif
#define __MACHINE_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ #define __MACHINE_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define __MACHINE_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net, ppc */ #define __MACHINE_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net, ppc */
......
...@@ -30,35 +30,6 @@ static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, ...@@ -30,35 +30,6 @@ static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes);
} }
#if 0
/*
* crypto_free_tfm - Free crypto transform
* @tfm: Transform to free
*
* crypto_free_tfm() frees up the transform and any associated resources,
* then drops the refcount on the associated algorithm.
*/
void crypto_free_tfm(struct crypto_tfm *tfm)
{
struct crypto_alg *alg;
int size;
if (unlikely(!tfm))
return;
alg = tfm->__crt_alg;
size = sizeof(*tfm) + alg->cra_ctxsize;
if (alg->cra_exit)
alg->cra_exit(tfm);
crypto_exit_ops(tfm);
crypto_mod_put(alg);
memset(tfm, 0, size);
kfree(tfm);
}
#endif
#if 1
struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags) struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags)
{ {
struct crypto_tfm *tfm = NULL; struct crypto_tfm *tfm = NULL;
...@@ -83,7 +54,6 @@ void crypto_free_tfm(struct crypto_tfm *tfm) ...@@ -83,7 +54,6 @@ void crypto_free_tfm(struct crypto_tfm *tfm)
return tfm; return tfm;
} }
#endif
//EXPORT_SYMBOL_GPL(crypto_alloc_tfm); //EXPORT_SYMBOL_GPL(crypto_alloc_tfm);
//EXPORT_SYMBOL_GPL(crypto_free_tfm); //EXPORT_SYMBOL_GPL(crypto_free_tfm);
......
...@@ -35,10 +35,6 @@ Dot11d_Reset(struct ieee80211_device *ieee) ...@@ -35,10 +35,6 @@ Dot11d_Reset(struct ieee80211_device *ieee)
{ {
u32 i; u32 i;
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee); PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
#if 0
if(!pDot11dInfo->bEnabled)
return;
#endif
// Clear old channel map // Clear old channel map
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
...@@ -108,14 +104,12 @@ Dot11d_UpdateCountryIe( ...@@ -108,14 +104,12 @@ Dot11d_UpdateCountryIe(
pTriple = (PCHNL_TXPOWER_TRIPLE)((u8*)pTriple + 3); pTriple = (PCHNL_TXPOWER_TRIPLE)((u8*)pTriple + 3);
} }
#if 1
//printk("Dot11d_UpdateCountryIe(): Channel List:\n"); //printk("Dot11d_UpdateCountryIe(): Channel List:\n");
printk("Channel List:"); printk("Channel List:");
for(i=1; i<= MAX_CHANNEL_NUMBER; i++) for(i=1; i<= MAX_CHANNEL_NUMBER; i++)
if(pDot11dInfo->channel_map[i] > 0) if(pDot11dInfo->channel_map[i] > 0)
printk(" %d", i); printk(" %d", i);
printk("\n"); printk("\n");
#endif
UPDATE_CIE_SRC(dev, pTaddr); UPDATE_CIE_SRC(dev, pTaddr);
...@@ -218,7 +212,6 @@ int ToLegalChannel( ...@@ -218,7 +212,6 @@ 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 +219,5 @@ EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm); ...@@ -226,14 +219,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,11 +38,6 @@ ...@@ -43,11 +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
...@@ -57,24 +47,6 @@ typedef enum{false = 0, true} bool; ...@@ -57,24 +47,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
/** /**
...@@ -425,46 +397,10 @@ typedef struct ieee_param { ...@@ -425,46 +397,10 @@ 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 // 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
...@@ -926,7 +862,6 @@ struct ieee_ibss_seq { ...@@ -926,7 +862,6 @@ struct ieee_ibss_seq {
* information for frames received. Not setting these will not cause * information for frames received. Not setting these will not cause
* any adverse affects. */ * any adverse affects. */
struct ieee80211_rx_stats { struct ieee80211_rx_stats {
#if 1
u32 mac_time[2]; u32 mac_time[2];
s8 rssi; s8 rssi;
u8 signal; u8 signal;
...@@ -988,7 +923,6 @@ struct ieee80211_rx_stats { ...@@ -988,7 +923,6 @@ struct ieee80211_rx_stats {
bool bToSelfBA; //cosa add for rssi bool bToSelfBA; //cosa add for rssi
char cck_adc_pwdb[4]; //cosa add for rx path selection char cck_adc_pwdb[4]; //cosa add for rx path selection
u16 Seq_Num; u16 Seq_Num;
#endif
}; };
...@@ -1336,7 +1270,6 @@ typedef union _frameqos { ...@@ -1336,7 +1270,6 @@ typedef union _frameqos {
#define QOS_OUI_PARAM_SUB_TYPE 1 #define QOS_OUI_PARAM_SUB_TYPE 1
#define QOS_VERSION_1 1 #define QOS_VERSION_1 1
#define QOS_AIFSN_MIN_VALUE 2 #define QOS_AIFSN_MIN_VALUE 2
#if 1
struct ieee80211_qos_information_element { struct ieee80211_qos_information_element {
u8 elementID; u8 elementID;
u8 length; u8 length;
...@@ -1411,7 +1344,6 @@ struct ieee80211_wmm_tspec_elem { ...@@ -1411,7 +1344,6 @@ struct ieee80211_wmm_tspec_elem {
u16 surp_band_allow; u16 surp_band_allow;
u16 medium_time; u16 medium_time;
}__attribute__((packed)); }__attribute__((packed));
#endif
enum eap_type { enum eap_type {
EAP_PACKET = 0, EAP_PACKET = 0,
EAPOL_START, EAPOL_START,
...@@ -1534,14 +1466,12 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame}; ...@@ -1534,14 +1466,12 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
//UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP //UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP
//#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1)) //#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1))
#if 1
#define UP2AC(up) ( \ #define UP2AC(up) ( \
((up) < 1) ? WME_AC_BE : \ ((up) < 1) ? WME_AC_BE : \
((up) < 3) ? WME_AC_BK : \ ((up) < 3) ? WME_AC_BK : \
((up) < 4) ? WME_AC_BE : \ ((up) < 4) ? WME_AC_BE : \
((up) < 6) ? WME_AC_VI : \ ((up) < 6) ? WME_AC_VI : \
WME_AC_VO) WME_AC_VO)
#endif
//AC Mapping to UP, using in Tx part for selecting the corresponding TX queue //AC Mapping to UP, using in Tx part for selecting the corresponding TX queue
#define AC2UP(_ac) ( \ #define AC2UP(_ac) ( \
((_ac) == WME_AC_VO) ? 6 : \ ((_ac) == WME_AC_VO) ? 6 : \
...@@ -1597,12 +1527,7 @@ struct ieee80211_network { ...@@ -1597,12 +1527,7 @@ struct ieee80211_network {
/* Ensure null-terminated for any debug msgs */ /* Ensure null-terminated for any debug msgs */
u8 ssid[IW_ESSID_MAX_SIZE + 1]; u8 ssid[IW_ESSID_MAX_SIZE + 1];
u8 ssid_len; u8 ssid_len;
#if 1
struct ieee80211_qos_data qos_data; struct ieee80211_qos_data qos_data;
#else
// Qos related. Added by Annie, 2005-11-01.
BSS_QOS BssQos;
#endif
//added by amy for LEAP //added by amy for LEAP
bool bWithAironetIE; bool bWithAironetIE;
...@@ -1668,7 +1593,6 @@ struct ieee80211_network { ...@@ -1668,7 +1593,6 @@ struct ieee80211_network {
struct list_head list; struct list_head list;
}; };
#if 1
enum ieee80211_state { enum ieee80211_state {
/* the card is not linked at all */ /* the card is not linked at all */
...@@ -1707,17 +1631,6 @@ enum ieee80211_state { ...@@ -1707,17 +1631,6 @@ enum ieee80211_state {
IEEE80211_LINKED_SCANNING, IEEE80211_LINKED_SCANNING,
}; };
#else
enum ieee80211_state {
IEEE80211_UNINITIALIZED = 0,
IEEE80211_INITIALIZED,
IEEE80211_ASSOCIATING,
IEEE80211_ASSOCIATED,
IEEE80211_AUTHENTICATING,
IEEE80211_AUTHENTICATED,
IEEE80211_SHUTDOWN
};
#endif
#define DEFAULT_MAX_SCAN_AGE (15 * HZ) #define DEFAULT_MAX_SCAN_AGE (15 * HZ)
#define DEFAULT_FTS 2346 #define DEFAULT_FTS 2346
...@@ -1736,20 +1649,7 @@ enum ieee80211_state { ...@@ -1736,20 +1649,7 @@ 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;
...@@ -1827,11 +1727,7 @@ typedef struct _RT_POWER_SAVE_CONTROL ...@@ -1827,11 +1727,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
...@@ -2196,32 +2092,13 @@ struct ieee80211_device { ...@@ -2196,32 +2092,13 @@ 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;
#else
struct work_struct softmac_scan_wq;
struct work_struct associate_retry_wq;
struct work_struct start_ibss_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;
...@@ -2321,35 +2198,9 @@ struct ieee80211_device { ...@@ -2321,35 +2198,9 @@ struct ieee80211_device {
void (*ps_request_tx_ack) (struct net_device *dev); void (*ps_request_tx_ack) (struct net_device *dev);
void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl); void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl);
short (*ps_is_queue_empty) (struct net_device *dev); short (*ps_is_queue_empty) (struct net_device *dev);
#if 0
/* Typical STA methods */
int (*handle_auth) (struct net_device * dev,
struct ieee80211_auth * auth);
int (*handle_deauth) (struct net_device * dev,
struct ieee80211_deauth * auth);
int (*handle_action) (struct net_device * dev,
struct ieee80211_action * action,
struct ieee80211_rx_stats * stats);
int (*handle_disassoc) (struct net_device * dev,
struct ieee80211_disassoc * assoc);
#endif
int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network);
#if 0
int (*handle_probe_response) (struct net_device * dev,
struct ieee80211_probe_response * resp,
struct ieee80211_network * network);
int (*handle_probe_request) (struct net_device * dev,
struct ieee80211_probe_request * req,
struct ieee80211_rx_stats * stats);
#endif
int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network);
#if 0
/* Typical AP methods */
int (*handle_assoc_request) (struct net_device * dev);
int (*handle_reassoc_request) (struct net_device * dev,
struct ieee80211_reassoc_request * req);
#endif
/* check whether Tx hw resouce available */ /* check whether Tx hw resouce available */
short (*check_nic_enough_desc)(struct net_device *dev, int queue_index); short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
...@@ -2407,11 +2258,7 @@ struct ieee80211_device { ...@@ -2407,11 +2258,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)
...@@ -2664,11 +2511,7 @@ extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_reques ...@@ -2664,11 +2511,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,
......
...@@ -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
...@@ -201,13 +201,11 @@ void free_ieee80211(struct net_device *dev) ...@@ -201,13 +201,11 @@ void free_ieee80211(struct net_device *dev)
int i; int i;
//struct list_head *p, *q; //struct list_head *p, *q;
// del_timer_sync(&ieee->SwBwTimer); // del_timer_sync(&ieee->SwBwTimer);
#if 1
if (ieee->pHTInfo != NULL) if (ieee->pHTInfo != NULL)
{ {
kfree(ieee->pHTInfo); kfree(ieee->pHTInfo);
ieee->pHTInfo = NULL; ieee->pHTInfo = NULL;
} }
#endif
RemoveAllTS(ieee); RemoveAllTS(ieee);
ieee80211_softmac_free(ieee); ieee80211_softmac_free(ieee);
del_timer_sync(&ieee->crypt_deinit_timer); del_timer_sync(&ieee->crypt_deinit_timer);
......
...@@ -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;
...@@ -351,13 +347,11 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, struct sk_buff *skb, ...@@ -351,13 +347,11 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, struct sk_buff *skb,
if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
return 0; return 0;
#if 1
if (ieee->hwsec_active) if (ieee->hwsec_active)
{ {
cb_desc *tcb_desc = (cb_desc *)(skb->cb+ MAX_DEV_ADDR_SIZE); cb_desc *tcb_desc = (cb_desc *)(skb->cb+ MAX_DEV_ADDR_SIZE);
tcb_desc->bHwSec = 1; tcb_desc->bHwSec = 1;
} }
#endif
hdr = (struct ieee80211_hdr_4addr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
...@@ -534,7 +528,6 @@ AddReorderEntry( ...@@ -534,7 +528,6 @@ AddReorderEntry(
) )
{ {
struct list_head *pList = &pTS->RxPendingPktList; struct list_head *pList = &pTS->RxPendingPktList;
#if 1
while(pList->next != &pTS->RxPendingPktList) while(pList->next != &pTS->RxPendingPktList)
{ {
if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) ) if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
...@@ -550,7 +543,6 @@ AddReorderEntry( ...@@ -550,7 +543,6 @@ AddReorderEntry(
break; break;
} }
} }
#endif
pReorderEntry->List.next = pList->next; pReorderEntry->List.next = pList->next;
pReorderEntry->List.next->prev = &pReorderEntry->List; pReorderEntry->List.next->prev = &pReorderEntry->List;
pReorderEntry->List.prev = pList; pReorderEntry->List.prev = pList;
...@@ -626,10 +618,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, ...@@ -626,10 +618,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
u8 index = 0; u8 index = 0;
bool bMatchWinStart = false, bPktInBuf = false; bool bMatchWinStart = false, bPktInBuf = false;
IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): Seq is %d,pTS->RxIndicateSeq is %d, WinSize is %d\n",__FUNCTION__,SeqNum,pTS->RxIndicateSeq,WinSize); IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): Seq is %d,pTS->RxIndicateSeq is %d, WinSize is %d\n",__FUNCTION__,SeqNum,pTS->RxIndicateSeq,WinSize);
#if 0
if(!list_empty(&ieee->RxReorder_Unused_List))
IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): ieee->RxReorder_Unused_List is nut NULL\n");
#endif
/* Rx Reorder initialize condition.*/ /* Rx Reorder initialize condition.*/
if(pTS->RxIndicateSeq == 0xffff) { if(pTS->RxIndicateSeq == 0xffff) {
pTS->RxIndicateSeq = SeqNum; pTS->RxIndicateSeq = SeqNum;
...@@ -696,7 +684,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, ...@@ -696,7 +684,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
pReorderEntry->prxb = prxb; pReorderEntry->prxb = prxb;
// IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): pREorderEntry->SeqNum is %d\n",__FUNCTION__,pReorderEntry->SeqNum); // IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): pREorderEntry->SeqNum is %d\n",__FUNCTION__,pReorderEntry->SeqNum);
#if 1
if(!AddReorderEntry(pTS, pReorderEntry)) { if(!AddReorderEntry(pTS, pReorderEntry)) {
IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n", IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n",
__FUNCTION__, pTS->RxIndicateSeq, SeqNum); __FUNCTION__, pTS->RxIndicateSeq, SeqNum);
...@@ -713,7 +700,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, ...@@ -713,7 +700,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
IEEE80211_DEBUG(IEEE80211_DL_REORDER, IEEE80211_DEBUG(IEEE80211_DL_REORDER,
"Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n",pTS->RxIndicateSeq, SeqNum); "Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n",pTS->RxIndicateSeq, SeqNum);
} }
#endif
} }
else { else {
/* /*
...@@ -736,7 +722,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, ...@@ -736,7 +722,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
/* Check if there is any packet need indicate.*/ /* Check if there is any packet need indicate.*/
while(!list_empty(&pTS->RxPendingPktList)) { while(!list_empty(&pTS->RxPendingPktList)) {
IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__FUNCTION__); IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__FUNCTION__);
#if 1
pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List);
if( SN_LESS(pReorderEntry->SeqNum, pTS->RxIndicateSeq) || if( SN_LESS(pReorderEntry->SeqNum, pTS->RxIndicateSeq) ||
SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq))
...@@ -763,7 +748,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, ...@@ -763,7 +748,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
bPktInBuf = true; bPktInBuf = true;
break; break;
} }
#endif
} }
/* Handling pending timer. Set this timer to prevent from long time Rx buffering.*/ /* Handling pending timer. Set this timer to prevent from long time Rx buffering.*/
...@@ -780,7 +764,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, ...@@ -780,7 +764,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
ieee80211_indicate_packets(ieee, prxbIndicateArray, index); ieee80211_indicate_packets(ieee, prxbIndicateArray, index);
} }
#if 1
if(bPktInBuf && pTS->RxTimeoutIndicateSeq==0xffff) { if(bPktInBuf && pTS->RxTimeoutIndicateSeq==0xffff) {
// Set new pending timer. // Set new pending timer.
IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): SET rx timeout timer\n", __FUNCTION__); IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): SET rx timeout timer\n", __FUNCTION__);
...@@ -790,7 +773,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, ...@@ -790,7 +773,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
pTS->RxPktPendingTimer.expires = jiffies + MSECS(pHTInfo->RxReorderPendingTime); pTS->RxPktPendingTimer.expires = jiffies + MSECS(pHTInfo->RxReorderPendingTime);
add_timer(&pTS->RxPktPendingTimer); add_timer(&pTS->RxPktPendingTimer);
} }
#endif
} }
u8 parse_subframe(struct sk_buff *skb, u8 parse_subframe(struct sk_buff *skb,
...@@ -857,11 +839,6 @@ u8 parse_subframe(struct sk_buff *skb, ...@@ -857,11 +839,6 @@ u8 parse_subframe(struct sk_buff *skb,
nSubframe_Length = (nSubframe_Length>>8) + (nSubframe_Length<<8); nSubframe_Length = (nSubframe_Length>>8) + (nSubframe_Length<<8);
if(skb->len<(ETHERNET_HEADER_SIZE + nSubframe_Length)) { if(skb->len<(ETHERNET_HEADER_SIZE + nSubframe_Length)) {
#if 0//cosa
RT_ASSERT(
(nRemain_Length>=(ETHERNET_HEADER_SIZE + nSubframe_Length)),
("ParseSubframe(): A-MSDU subframe parse error!! Subframe Length: %d\n", nSubframe_Length) );
#endif
printk("%s: A-MSDU parse error!! pRfd->nTotalSubframe : %d\n",\ printk("%s: A-MSDU parse error!! pRfd->nTotalSubframe : %d\n",\
__FUNCTION__,rxb->nr_subframes); __FUNCTION__,rxb->nr_subframes);
printk("%s: A-MSDU parse error!! Subframe Length: %d\n",__FUNCTION__, nSubframe_Length); printk("%s: A-MSDU parse error!! Subframe Length: %d\n",__FUNCTION__, nSubframe_Length);
...@@ -1058,19 +1035,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1058,19 +1035,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
else else
{ {
PRX_TS_RECORD pRxTS = NULL; PRX_TS_RECORD pRxTS = NULL;
#if 0
struct ieee80211_hdr_3addr *hdr;
u16 fc;
hdr = (struct ieee80211_hdr_3addr *)skb->data;
fc = le16_to_cpu(hdr->frame_ctl);
u8 tmp = (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS);
u8 tid = (*((u8*)skb->data + (((fc& IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))?30:24)))&0xf;
printk("====================>fc:%x, tid:%d, tmp:%d\n", fc, tid, tmp);
//u8 tid = (u8)((frameqos*)(buf + ((fc & IEEE80211_FCTL_TODS)&&(fc & IEEE80211_FCTL_FROMDS))? 30 : 24))->field.tid;
#endif
//IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): QOS ENABLE AND RECEIVE QOS DATA , we will get Ts, tid:%d\n",__FUNCTION__, tid); //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): QOS ENABLE AND RECEIVE QOS DATA , we will get Ts, tid:%d\n",__FUNCTION__, tid);
#if 1
if(GetTs( if(GetTs(
ieee, ieee,
(PTS_COMMON_INFO*) &pRxTS, (PTS_COMMON_INFO*) &pRxTS,
...@@ -1099,22 +1064,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1099,22 +1064,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
goto rx_dropped; goto rx_dropped;
} }
} }
#endif
if (type == IEEE80211_FTYPE_MGMT) { if (type == IEEE80211_FTYPE_MGMT) {
#if 0
if ( stype == IEEE80211_STYPE_AUTH &&
fc & IEEE80211_FCTL_WEP && ieee->host_decrypt &&
(keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0)
{
printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
"from " MAC_FMT "\n", dev->name,
MAC_ARG(hdr->addr2));
/* TODO: could inform hostapd about this so that it
* could send auth failure report */
goto rx_dropped;
}
#endif
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
if (ieee80211_rx_frame_mgmt(ieee, skb, rx_stats, type, stype)) if (ieee80211_rx_frame_mgmt(ieee, skb, rx_stats, type, stype))
...@@ -1336,7 +1287,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1336,7 +1287,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
} }
*/ */
//added by amy for reorder //added by amy for reorder
#if 1
if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data) if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
&& !is_multicast_ether_addr(hdr->addr1) && !is_broadcast_ether_addr(hdr->addr1)) && !is_multicast_ether_addr(hdr->addr1) && !is_broadcast_ether_addr(hdr->addr1))
{ {
...@@ -1348,7 +1298,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1348,7 +1298,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
ieee->bis_any_nonbepkts = true; ieee->bis_any_nonbepkts = true;
} }
} }
#endif
//added by amy for reorder //added by amy for reorder
/* skb: hdr + (possible reassembled) full plaintext payload */ /* skb: hdr + (possible reassembled) full plaintext payload */
payload = skb->data + hdrlen; payload = skb->data + hdrlen;
...@@ -1974,16 +1923,6 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, ...@@ -1974,16 +1923,6 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
} }
} }
#if 0
if (tmp_htcap_len !=0)
{
u16 cap_ext = ((PHT_CAPABILITY_ELE)&info_element->data[0])->ExtHTCapInfo;
if ((cap_ext & 0x0c00) == 0x0c00)
{
network->ralink_cap_exist = true;
}
}
#endif
if(info_element->len >= 3 && if(info_element->len >= 3 &&
info_element->data[0] == 0x00 && info_element->data[0] == 0x00 &&
info_element->data[1] == 0x0c && info_element->data[1] == 0x0c &&
...@@ -2156,44 +2095,6 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, ...@@ -2156,44 +2095,6 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
break; break;
#endif #endif
/* TODO */ /* TODO */
#if 0
/* 802.11h */
case MFIE_TYPE_POWER_CONSTRAINT:
network->power_constraint = info_element->data[0];
network->flags |= NETWORK_HAS_POWER_CONSTRAINT;
break;
case MFIE_TYPE_CSA:
network->power_constraint = info_element->data[0];
network->flags |= NETWORK_HAS_CSA;
break;
case MFIE_TYPE_QUIET:
network->quiet.count = info_element->data[0];
network->quiet.period = info_element->data[1];
network->quiet.duration = info_element->data[2];
network->quiet.offset = info_element->data[3];
network->flags |= NETWORK_HAS_QUIET;
break;
case MFIE_TYPE_IBSS_DFS:
if (network->ibss_dfs)
break;
network->ibss_dfs = kmemdup(info_element->data,
info_element->len,
GFP_ATOMIC);
if (!network->ibss_dfs)
return 1;
network->flags |= NETWORK_HAS_IBSS_DFS;
break;
case MFIE_TYPE_TPC_REPORT:
network->tpc_report.transmit_power =
info_element->data[0];
network->tpc_report.link_margin = info_element->data[1];
network->flags |= NETWORK_HAS_TPC_REPORT;
break;
#endif
default: default:
IEEE80211_DEBUG_MGMT IEEE80211_DEBUG_MGMT
("Unsupported info element: %s (%d)\n", ("Unsupported info element: %s (%d)\n",
...@@ -2376,11 +2277,9 @@ static inline int ieee80211_network_init( ...@@ -2376,11 +2277,9 @@ static inline int ieee80211_network_init(
if (ieee80211_is_empty_essid(network->ssid, network->ssid_len)) if (ieee80211_is_empty_essid(network->ssid, network->ssid_len))
network->flags |= NETWORK_EMPTY_ESSID; network->flags |= NETWORK_EMPTY_ESSID;
#if 1
stats->signal = 30 + (stats->SignalStrength * 70) / 100; stats->signal = 30 + (stats->SignalStrength * 70) / 100;
//stats->signal = ieee80211_SignalStrengthTranslate(stats->signal); //stats->signal = ieee80211_SignalStrengthTranslate(stats->signal);
stats->noise = ieee80211_translate_todbm((u8)(100-stats->signal)) -25; stats->noise = ieee80211_translate_todbm((u8)(100-stats->signal)) -25;
#endif
memcpy(&network->stats, stats, sizeof(network->stats)); memcpy(&network->stats, stats, sizeof(network->stats));
...@@ -2488,7 +2387,6 @@ static inline void update_network(struct ieee80211_network *dst, ...@@ -2488,7 +2387,6 @@ static inline void update_network(struct ieee80211_network *dst,
dst->qos_data.old_param_count = old_param; dst->qos_data.old_param_count = old_param;
/* dst->last_associate is not overwritten */ /* dst->last_associate is not overwritten */
#if 1
dst->wmm_info = src->wmm_info; //sure to exist in beacon or probe response frame. dst->wmm_info = src->wmm_info; //sure to exist in beacon or probe response frame.
if(src->wmm_param[0].ac_aci_acm_aifsn|| \ if(src->wmm_param[0].ac_aci_acm_aifsn|| \
src->wmm_param[1].ac_aci_acm_aifsn|| \ src->wmm_param[1].ac_aci_acm_aifsn|| \
...@@ -2497,9 +2395,6 @@ static inline void update_network(struct ieee80211_network *dst, ...@@ -2497,9 +2395,6 @@ static inline void update_network(struct ieee80211_network *dst,
memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN); memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN);
} }
//dst->QoS_Enable = src->QoS_Enable; //dst->QoS_Enable = src->QoS_Enable;
#else
dst->QoS_Enable = 1;//for Rtl8187 simulation
#endif
#ifdef THOMAS_TURBO #ifdef THOMAS_TURBO
dst->Turbo_Enable = src->Turbo_Enable; dst->Turbo_Enable = src->Turbo_Enable;
#endif #endif
...@@ -2769,10 +2664,5 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee, ...@@ -2769,10 +2664,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
...@@ -234,23 +234,8 @@ int ieee80211_wx_get_rate(struct ieee80211_device *ieee, ...@@ -234,23 +234,8 @@ int ieee80211_wx_get_rate(struct ieee80211_device *ieee,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
u32 tmp_rate; u32 tmp_rate;
#if 0
printk("===>mode:%d, halfNmode:%d\n", ieee->mode, ieee->bHalfWirelessN24GMode);
if (ieee->mode & (IEEE_A | IEEE_B | IEEE_G))
tmp_rate = ieee->rate;
else if (ieee->mode & IEEE_N_5G)
tmp_rate = 580;
else if (ieee->mode & IEEE_N_24G)
{
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
tmp_rate = HTHalfMcsToDataRate(ieee, 15);
else
tmp_rate = HTMcsToDataRate(ieee, 15);
}
#else
tmp_rate = TxCountToDataRate(ieee, ieee->softmac_stats.CurrentShowTxate); tmp_rate = TxCountToDataRate(ieee, ieee->softmac_stats.CurrentShowTxate);
#endif
wrqu->bitrate.value = tmp_rate * 500000; wrqu->bitrate.value = tmp_rate * 500000;
return 0; return 0;
...@@ -313,14 +298,9 @@ out: ...@@ -313,14 +298,9 @@ out:
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;
...@@ -392,11 +372,7 @@ int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info ...@@ -392,11 +372,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;
} }
...@@ -442,29 +418,8 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee, ...@@ -442,29 +418,8 @@ 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
{
int i;
for (i=0; i<len + 1; i++)
printk("%c ", extra[i]);
printk("\n");
}
#endif
#endif
ieee->ssid_set = 1; ieee->ssid_set = 1;
} }
else{ else{
...@@ -557,18 +512,6 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee, ...@@ -557,18 +512,6 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
int ret = 0; int ret = 0;
#if 0
if(
(!ieee->sta_wake_up) ||
(!ieee->ps_request_tx_ack) ||
(!ieee->enter_sleep_state) ||
(!ieee->ps_is_queue_empty)){
// printk("ERROR. PS mode is tryied to be use but driver missed a callback\n\n");
return -1;
}
#endif
down(&ieee->wx_sem); down(&ieee->wx_sem);
if (wrqu->power.disabled){ if (wrqu->power.disabled){
...@@ -652,7 +595,6 @@ exit: ...@@ -652,7 +595,6 @@ exit:
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);
...@@ -671,23 +613,3 @@ EXPORT_SYMBOL(ieee80211_wx_get_power); ...@@ -671,23 +613,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
...@@ -235,11 +235,6 @@ void ieee80211_txb_free(struct ieee80211_txb *txb) { ...@@ -235,11 +235,6 @@ void ieee80211_txb_free(struct ieee80211_txb *txb) {
//int i; //int i;
if (unlikely(!txb)) if (unlikely(!txb))
return; return;
#if 0
for (i = 0; i < txb->nr_frags; i++)
if (txb->fragments[i])
dev_kfree_skb_any(txb->fragments[i]);
#endif
kfree(txb); kfree(txb);
} }
...@@ -287,11 +282,7 @@ ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network) ...@@ -287,11 +282,7 @@ 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;
...@@ -334,12 +325,10 @@ void ieee80211_tx_query_agg_cap(struct ieee80211_device* ieee, struct sk_buff* s ...@@ -334,12 +325,10 @@ void ieee80211_tx_query_agg_cap(struct ieee80211_device* ieee, struct sk_buff* s
if(!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter)) if(!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter))
return; return;
#endif #endif
#if 1
if(!ieee->GetNmodeSupportBySecCfg(ieee->dev)) if(!ieee->GetNmodeSupportBySecCfg(ieee->dev))
{ {
return; return;
} }
#endif
if(pHTInfo->bCurrentAMPDUEnable) if(pHTInfo->bCurrentAMPDUEnable)
{ {
if (!GetTs(ieee, (PTS_COMMON_INFO*)(&pTxTs), hdr->addr1, skb->priority, TX_DIR, true)) if (!GetTs(ieee, (PTS_COMMON_INFO*)(&pTxTs), hdr->addr1, skb->priority, TX_DIR, true))
...@@ -602,11 +591,7 @@ void ieee80211_query_seqnum(struct ieee80211_device*ieee, struct sk_buff* skb, u ...@@ -602,11 +591,7 @@ void ieee80211_query_seqnum(struct ieee80211_device*ieee, struct sk_buff* skb, u
int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) int 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;
...@@ -878,7 +863,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -878,7 +863,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
//WB add to fill data tcb_desc here. only first fragment is considered, need to change, and you may remove to other place. //WB add to fill data tcb_desc here. only first fragment is considered, need to change, and you may remove to other place.
if (txb) if (txb)
{ {
#if 1
cb_desc *tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE); cb_desc *tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->bTxEnableFwCalcDur = 1; tcb_desc->bTxEnableFwCalcDur = 1;
if (is_multicast_ether_addr(header.addr1)) if (is_multicast_ether_addr(header.addr1))
...@@ -899,7 +883,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -899,7 +883,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
ieee80211_query_seqnum(ieee, txb->fragments[0], header.addr1); ieee80211_query_seqnum(ieee, txb->fragments[0], header.addr1);
// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, txb->fragments[0]->data, txb->fragments[0]->len); // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, txb->fragments[0]->data, txb->fragments[0]->len);
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, tcb_desc, sizeof(cb_desc)); //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, tcb_desc, sizeof(cb_desc));
#endif
} }
spin_unlock_irqrestore(&ieee->lock, flags); spin_unlock_irqrestore(&ieee->lock, flags);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
......
...@@ -22,22 +22,6 @@ ...@@ -22,22 +22,6 @@
#include <asm/softirq.h> #include <asm/softirq.h>
#include <asm/kmap_types.h> #include <asm/kmap_types.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20))
#define list_for_each_entry(pos, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member), \
prefetch(pos->member.next); \
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member), \
prefetch(pos->member.next))
static inline void cond_resched(void)
{
if (need_resched()) {
set_current_state(TASK_RUNNING);
schedule();
}
}
#endif
extern enum km_type crypto_km_types[]; extern enum km_type crypto_km_types[];
......
...@@ -174,48 +174,6 @@ static struct sk_buff* ieee80211_ADDBA(struct ieee80211_device* ieee, u8* Dst, P ...@@ -174,48 +174,6 @@ static struct sk_buff* ieee80211_ADDBA(struct ieee80211_device* ieee, u8* Dst, P
//return NULL; //return NULL;
} }
#if 0 //I try to merge ADDBA_REQ and ADDBA_RSP frames together..
/********************************************************************************************************************
*function: construct ADDBAREQ frame
* input: u8* dst //ADDBARsp frame's destination
* PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA_RSP.
* u16 StatusCode //status code.
* output: none
* return: sk_buff* skb //return constructed skb to xmit
********************************************************************************************************************/
static struct sk_buff* ieee80211_ADDBA_Rsp( IN struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA, u16 StatusCode)
{
OCTET_STRING osADDBAFrame, tmp;
FillOctetString(osADDBAFrame, Buffer, 0);
*pLength = 0;
ConstructMaFrameHdr(
Adapter,
Addr,
ACT_CAT_BA,
ACT_ADDBARSP,
&osADDBAFrame );
// Dialog Token
FillOctetString(tmp, &pBA->DialogToken, 1);
PacketAppendData(&osADDBAFrame, tmp);
// Status Code
FillOctetString(tmp, &StatusCode, 2);
PacketAppendData(&osADDBAFrame, tmp);
// BA Parameter Set
FillOctetString(tmp, &pBA->BaParamSet, 2);
PacketAppendData(&osADDBAFrame, tmp);
// BA Timeout Value
FillOctetString(tmp, &pBA->BaTimeoutValue, 2);
PacketAppendData(&osADDBAFrame, tmp);
*pLength = osADDBAFrame.Length;
}
#endif
/******************************************************************************************************************** /********************************************************************************************************************
*function: construct DELBA frame *function: construct DELBA frame
......
...@@ -70,147 +70,6 @@ typedef enum _ACK_POLICY{ ...@@ -70,147 +70,6 @@ typedef enum _ACK_POLICY{
}ACK_POLICY,*PACK_POLICY; }ACK_POLICY,*PACK_POLICY;
#define WMM_PARAM_ELEMENT_SIZE (8+(4*AC_PARAM_SIZE)) #define WMM_PARAM_ELEMENT_SIZE (8+(4*AC_PARAM_SIZE))
#if 0
#define GET_QOS_CTRL(_pStart) ReadEF2Byte((u8 *)(_pStart) + 24)
#define SET_QOS_CTRL(_pStart, _value) WriteEF2Byte((u8 *)(_pStart) + 24, _value)
// WMM control field.
#define GET_QOS_CTRL_WMM_UP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 3))
#define SET_QOS_CTRL_WMM_UP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 3, (u8)(_value))
#define GET_QOS_CTRL_WMM_EOSP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1))
#define SET_QOS_CTRL_WMM_EOSP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value))
#define GET_QOS_CTRL_WMM_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2))
#define SET_QOS_CTRL_WMM_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value))
// 802.11e control field (by STA, data)
#define GET_QOS_CTRL_STA_DATA_TID(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 4))
#define SET_QOS_CTRL_STA_DATA_TID(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 4, (u8)(_value))
#define GET_QOS_CTRL_STA_DATA_QSIZE_FLAG(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1))
#define SET_QOS_CTRL_STA_DATA_QSIZE_FLAG(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value))
#define GET_QOS_CTRL_STA_DATA_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2))
#define SET_QOS_CTRL_STA_DATA_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value))
#define GET_QOS_CTRL_STA_DATA_TXOP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 8, 8))
#define SET_QOS_CTRL_STA_DATA_TXOP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 8, 8, (u8)(_value))
#define GET_QOS_CTRL_STA_DATA_QSIZE(_pStart) GET_QOS_CTRL_STA_DATA_TXOP(_pStart)
#define SET_QOS_CTRL_STA_DATA_QSIZE(_pStart, _value) SET_QOS_CTRL_STA_DATA_TXOP(_pStart)
// 802.11e control field (by HC, data)
#define GET_QOS_CTRL_HC_DATA_TID(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 4))
#define SET_QOS_CTRL_HC_DATA_TID(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 4, (u8)(_value))
#define GET_QOS_CTRL_HC_DATA_EOSP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1))
#define SET_QOS_CTRL_HC_DATA_EOSP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value))
#define GET_QOS_CTRL_HC_DATA_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2))
#define SET_QOS_CTRL_HC_DATA_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value))
#define GET_QOS_CTRL_HC_DATA_PS_BUFSTATE(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 8, 8))
#define SET_QOS_CTRL_HC_DATA_PS_BUFSTATE(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 8, 8, (u8)(_value))
// 802.11e control field (by HC, CFP)
#define GET_QOS_CTRL_HC_CFP_TID(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 4))
#define SET_QOS_CTRL_HC_CFP_TID(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 4, (u8)(_value))
#define GET_QOS_CTRL_HC_CFP_EOSP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1))
#define SET_QOS_CTRL_HC_CFP_EOSP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value))
#define GET_QOS_CTRL_HC_CFP_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2))
#define SET_QOS_CTRL_HC_CFP_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value))
#define GET_QOS_CTRL_HC_CFP_TXOP_LIMIT(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 8, 8))
#define SET_QOS_CTRL_HC_CFP_TXOP_LIMIT(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 8, 8, (u8)(_value))
#define SET_WMM_QOS_INFO_FIELD(_pStart, _val) WriteEF1Byte(_pStart, _val)
#define GET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 4)
#define SET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 4, _val)
#define GET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 7, 1)
#define SET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 7, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 1)
#define SET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 1, 1)
#define SET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 1, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 2, 1)
#define SET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 2, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 3, 1)
#define SET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 3, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart) LE_BITS_TO_1BYTE(_pStart, 5, 2)
#define SET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 5, 2, _val)
#define WMM_INFO_ELEMENT_SIZE 7
#define GET_WMM_INFO_ELE_OUI(_pStart) ((u8 *)(_pStart))
#define SET_WMM_INFO_ELE_OUI(_pStart, _pVal) PlatformMoveMemory(_pStart, _pVal, 3);
#define GET_WMM_INFO_ELE_OUI_TYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+3) ) )
#define SET_WMM_INFO_ELE_OUI_TYPE(_pStart, _val) ( *((u8 *)(_pStart)+3) = EF1Byte(_val) )
#define GET_WMM_INFO_ELE_OUI_SUBTYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+4) ) )
#define SET_WMM_INFO_ELE_OUI_SUBTYPE(_pStart, _val) ( *((u8 *)(_pStart)+4) = EF1Byte(_val) )
#define GET_WMM_INFO_ELE_VERSION(_pStart) ( EF1Byte( *((u8 *)(_pStart)+5) ) )
#define SET_WMM_INFO_ELE_VERSION(_pStart, _val) ( *((u8 *)(_pStart)+5) = EF1Byte(_val) )
#define GET_WMM_INFO_ELE_QOS_INFO_FIELD(_pStart) ( EF1Byte( *((u8 *)(_pStart)+6) ) )
#define SET_WMM_INFO_ELE_QOS_INFO_FIELD(_pStart, _val) ( *((u8 *)(_pStart)+6) = EF1Byte(_val) )
#define GET_WMM_AC_PARAM_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 4) )
#define SET_WMM_AC_PARAM_AIFSN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 0, 4, _val)
#define GET_WMM_AC_PARAM_ACM(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 4, 1) )
#define SET_WMM_AC_PARAM_ACM(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 4, 1, _val)
#define GET_WMM_AC_PARAM_ACI(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 5, 2) )
#define SET_WMM_AC_PARAM_ACI(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 5, 2, _val)
#define GET_WMM_AC_PARAM_ACI_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 8) )
#define SET_WMM_AC_PARAM_ACI_AIFSN(_pStart, _val) SET_BTIS_TO_LE_4BYTE(_pStart, 0, 8, _val)
#define GET_WMM_AC_PARAM_ECWMIN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 8, 4) )
#define SET_WMM_AC_PARAM_ECWMIN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 8, 4, _val)
#define GET_WMM_AC_PARAM_ECWMAX(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 12, 4) )
#define SET_WMM_AC_PARAM_ECWMAX(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 12, 4, _val)
#define GET_WMM_AC_PARAM_TXOP_LIMIT(_pStart) ( (u16)LE_BITS_TO_4BYTE(_pStart, 16, 16) )
#define SET_WMM_AC_PARAM_TXOP_LIMIT(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 16, 16, _val)
#define GET_WMM_PARAM_ELE_OUI(_pStart) ((u8 *)(_pStart))
#define SET_WMM_PARAM_ELE_OUI(_pStart, _pVal) PlatformMoveMemory(_pStart, _pVal, 3)
#define GET_WMM_PARAM_ELE_OUI_TYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+3) ) )
#define SET_WMM_PARAM_ELE_OUI_TYPE(_pStart, _val) ( *((u8 *)(_pStart)+3) = EF1Byte(_val) )
#define GET_WMM_PARAM_ELE_OUI_SUBTYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+4) ) )
#define SET_WMM_PARAM_ELE_OUI_SUBTYPE(_pStart, _val) ( *((u8 *)(_pStart)+4) = EF1Byte(_val) )
#define GET_WMM_PARAM_ELE_VERSION(_pStart) ( EF1Byte( *((u8 *)(_pStart)+5) ) )
#define SET_WMM_PARAM_ELE_VERSION(_pStart, _val) ( *((u8 *)(_pStart)+5) = EF1Byte(_val) )
#define GET_WMM_PARAM_ELE_QOS_INFO_FIELD(_pStart) ( EF1Byte( *((u8 *)(_pStart)+6) ) )
#define SET_WMM_PARAM_ELE_QOS_INFO_FIELD(_pStart, _val) ( *((u8 *)(_pStart)+6) = EF1Byte(_val) )
#define GET_WMM_PARAM_ELE_AC_PARAM(_pStart) ( (u8 *)(_pStart)+8 )
#define SET_WMM_PARAM_ELE_AC_PARAM(_pStart, _pVal) PlatformMoveMemory((_pStart)+8, _pVal, 16)
#endif
// //
// QoS Control Field // QoS Control Field
...@@ -361,21 +220,6 @@ typedef union _QOS_INFO_FIELD{ ...@@ -361,21 +220,6 @@ typedef union _QOS_INFO_FIELD{
}QOS_INFO_FIELD, *PQOS_INFO_FIELD; }QOS_INFO_FIELD, *PQOS_INFO_FIELD;
#if 0
//
// WMM Information Element
// Ref: WMM spec 2.2.1: WME Information Element, p.10.
//
typedef struct _WMM_INFO_ELEMENT{
// u8 ElementID;
// u8 Length;
u8 OUI[3];
u8 OUI_Type;
u8 OUI_SubType;
u8 Version;
QOS_INFO_FIELD QosInfo;
}WMM_INFO_ELEMENT, *PWMM_INFO_ELEMENT;
#endif
// //
// ACI to AC coding. // ACI to AC coding.
...@@ -650,16 +494,6 @@ typedef struct _OCTET_STRING{ ...@@ -650,16 +494,6 @@ typedef struct _OCTET_STRING{
u8 *Octet; u8 *Octet;
u16 Length; u16 Length;
}OCTET_STRING, *POCTET_STRING; }OCTET_STRING, *POCTET_STRING;
#if 0
#define FillOctetString(_os,_octet,_len) \
(_os).Octet=(u8 *)(_octet); \
(_os).Length=(_len);
#define WMM_ELEM_HDR_LEN 6
#define WMMElemSkipHdr(_osWMMElem) \
(_osWMMElem).Octet += WMM_ELEM_HDR_LEN; \
(_osWMMElem).Length -= WMM_ELEM_HDR_LEN;
#endif
// //
// STA QoS data. // STA QoS data.
// Ref: DOT11_QOS in 8185 code. [def. in QoS_mp.h] // Ref: DOT11_QOS in 8185 code. [def. in QoS_mp.h]
......
...@@ -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
...@@ -28,7 +21,6 @@ void TsInactTimeout(unsigned long data) ...@@ -28,7 +21,6 @@ void TsInactTimeout(unsigned long data)
* return: NULL * return: NULL
* notice: * notice:
********************************************************************************************************************/ ********************************************************************************************************************/
#if 1
void RxPktPendingTimeout(unsigned long data) void RxPktPendingTimeout(unsigned long data)
{ {
PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)data; PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)data;
...@@ -102,7 +94,6 @@ void RxPktPendingTimeout(unsigned long data) ...@@ -102,7 +94,6 @@ void RxPktPendingTimeout(unsigned long data)
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
//PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK); //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK);
} }
#endif
/******************************************************************************************************************** /********************************************************************************************************************
*function: Add BA timer function *function: Add BA timer function
...@@ -366,17 +357,10 @@ bool GetTs( ...@@ -366,17 +357,10 @@ bool GetTs(
IEEE80211_DEBUG(IEEE80211_DL_ERR, "get TS for Broadcast or Multicast\n"); IEEE80211_DEBUG(IEEE80211_DL_ERR, "get TS for Broadcast or Multicast\n");
return false; return false;
} }
#if 0
if(ieee->pStaQos->CurrentQosMode == QOS_DISABLE)
{ UP = 0; } //only use one TS
else if(ieee->pStaQos->CurrentQosMode & QOS_WMM)
{
#else
if (ieee->current_network.qos_data.supported == 0) if (ieee->current_network.qos_data.supported == 0)
UP = 0; UP = 0;
else else
{ {
#endif
// In WMM case: we use 4 TID only // In WMM case: we use 4 TID only
if (!IsACValid(TID)) if (!IsACValid(TID))
{ {
...@@ -548,7 +532,6 @@ void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr) ...@@ -548,7 +532,6 @@ void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr)
{ {
PTS_COMMON_INFO pTS, pTmpTS; PTS_COMMON_INFO pTS, pTmpTS;
printk("===========>RemovePeerTS,"MAC_FMT"\n", MAC_ARG(Addr)); printk("===========>RemovePeerTS,"MAC_FMT"\n", MAC_ARG(Addr));
#if 1
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List)
{ {
if (memcmp(pTS->Addr, Addr, 6) == 0) if (memcmp(pTS->Addr, Addr, 6) == 0)
...@@ -589,13 +572,11 @@ void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr) ...@@ -589,13 +572,11 @@ void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr)
list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
} }
} }
#endif
} }
void RemoveAllTS(struct ieee80211_device* ieee) void RemoveAllTS(struct ieee80211_device* ieee)
{ {
PTS_COMMON_INFO pTS, pTmpTS; PTS_COMMON_INFO pTS, pTmpTS;
#if 1
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List)
{ {
RemoveTsEntry(ieee, pTS, TX_DIR); RemoveTsEntry(ieee, pTS, TX_DIR);
...@@ -623,7 +604,6 @@ void RemoveAllTS(struct ieee80211_device* ieee) ...@@ -623,7 +604,6 @@ void RemoveAllTS(struct ieee80211_device* ieee)
list_del_init(&pTS->List); list_del_init(&pTS->List);
list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
} }
#endif
} }
void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS) void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS)
...@@ -631,7 +611,6 @@ void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS) ...@@ -631,7 +611,6 @@ void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS)
if(pTxTS->bAddBaReqInProgress == false) if(pTxTS->bAddBaReqInProgress == false)
{ {
pTxTS->bAddBaReqInProgress = true; pTxTS->bAddBaReqInProgress = true;
#if 1
if(pTxTS->bAddBaReqDelayed) if(pTxTS->bAddBaReqDelayed)
{ {
IEEE80211_DEBUG(IEEE80211_DL_BA, "TsStartAddBaProcess(): Delayed Start ADDBA after 60 sec!!\n"); IEEE80211_DEBUG(IEEE80211_DL_BA, "TsStartAddBaProcess(): Delayed Start ADDBA after 60 sec!!\n");
...@@ -642,13 +621,8 @@ void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS) ...@@ -642,13 +621,8 @@ void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS)
IEEE80211_DEBUG(IEEE80211_DL_BA,"TsStartAddBaProcess(): Immediately Start ADDBA now!!\n"); IEEE80211_DEBUG(IEEE80211_DL_BA,"TsStartAddBaProcess(): Immediately Start ADDBA now!!\n");
mod_timer(&pTxTS->TsAddBaTimer, jiffies+10); //set 10 ticks mod_timer(&pTxTS->TsAddBaTimer, jiffies+10); //set 10 ticks
} }
#endif
} }
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
...@@ -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"
#define RTL8192U #define RTL8192U
...@@ -87,11 +84,6 @@ ...@@ -87,11 +84,6 @@
// Rx smooth factor // Rx smooth factor
#define Rx_Smooth_Factor 20 #define Rx_Smooth_Factor 20
#if 0 //we need to use RT_TRACE instead DMESG as RT_TRACE will clearly show debug level wb.
#define DMESG(x,a...) printk(KERN_INFO RTL819xU_MODULE_NAME ": " x "\n", ## a)
#define DMESGW(x,a...) printk(KERN_WARNING RTL819xU_MODULE_NAME ": WW:" x "\n", ## a)
#define DMESGE(x,a...) printk(KERN_WARNING RTL819xU_MODULE_NAME ": EE:" x "\n", ## a)
#else
#define DMESG(x,a...) #define DMESG(x,a...)
#define DMESGW(x,a...) #define DMESGW(x,a...)
#define DMESGE(x,a...) #define DMESGE(x,a...)
...@@ -141,7 +133,6 @@ do { if(rt_global_debug_component & component) \ ...@@ -141,7 +133,6 @@ do { if(rt_global_debug_component & component) \
#define COMP_DOWN BIT29 //for rm driver module #define COMP_DOWN BIT29 //for rm driver module
#define COMP_RESET BIT30 //for silent reset #define COMP_RESET BIT30 //for silent reset
#define COMP_ERR BIT31 //for error out, always on #define COMP_ERR BIT31 //for error out, always on
#endif
#define RTL819x_DEBUG #define RTL819x_DEBUG
#ifdef RTL819x_DEBUG #ifdef RTL819x_DEBUG
...@@ -596,16 +587,6 @@ typedef struct rtl_reg_debug{ ...@@ -596,16 +587,6 @@ typedef struct rtl_reg_debug{
#if 0
typedef struct tx_pendingbuf
{
struct ieee80211_txb *txb;
short ispending;
short descfrag;
} tx_pendigbuf;
#endif
typedef struct _rt_9x_tx_rate_history { typedef struct _rt_9x_tx_rate_history {
u32 cck[4]; u32 cck[4];
...@@ -933,11 +914,7 @@ typedef struct r8192_priv ...@@ -933,11 +914,7 @@ typedef struct r8192_priv
spinlock_t irq_lock; spinlock_t irq_lock;
// spinlock_t irq_th_lock; // spinlock_t irq_th_lock;
spinlock_t tx_lock; spinlock_t tx_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;
...@@ -1007,11 +984,7 @@ typedef struct r8192_priv ...@@ -1007,11 +984,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
...@@ -1041,11 +1014,7 @@ typedef struct r8192_priv ...@@ -1041,11 +1014,7 @@ 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
...@@ -1194,33 +1163,14 @@ typedef struct r8192_priv ...@@ -1194,33 +1163,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
}r8192_priv; }r8192_priv;
// for rtl8187 // for rtl8187
...@@ -1259,60 +1209,6 @@ typedef enum{ ...@@ -1259,60 +1209,6 @@ typedef enum{
} nic_t; } nic_t;
#if 0 //defined in Qos.h
//typedef u32 AC_CODING;
#define AC0_BE 0 // ACI: 0x00 // Best Effort
#define AC1_BK 1 // ACI: 0x01 // Background
#define AC2_VI 2 // ACI: 0x10 // Video
#define AC3_VO 3 // ACI: 0x11 // Voice
#define AC_MAX 4 // Max: define total number; Should not to be used as a real enum.
//
// ECWmin/ECWmax field.
// Ref: WMM spec 2.2.2: WME Parameter Element, p.13.
//
typedef union _ECW{
u8 charData;
struct
{
u8 ECWmin:4;
u8 ECWmax:4;
}f; // Field
}ECW, *PECW;
//
// ACI/AIFSN Field.
// Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
//
typedef union _ACI_AIFSN{
u8 charData;
struct
{
u8 AIFSN:4;
u8 ACM:1;
u8 ACI:2;
u8 Reserved:1;
}f; // Field
}ACI_AIFSN, *PACI_AIFSN;
//
// AC Parameters Record Format.
// Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
//
typedef union _AC_PARAM{
u32 longData;
u8 charData[4];
struct
{
ACI_AIFSN AciAifsn;
ECW Ecw;
u16 TXOPLimit;
}f; // Field
}AC_PARAM, *PAC_PARAM;
#endif
#ifdef JOHN_HWSEC #ifdef JOHN_HWSEC
struct ssid_thread { struct ssid_thread {
struct net_device *dev; struct net_device *dev;
......
This diff is collapsed.
This diff is collapsed.
...@@ -62,50 +62,6 @@ ...@@ -62,50 +62,6 @@
#define Initial_Tx_Rate_Reg 0x1b9 #define Initial_Tx_Rate_Reg 0x1b9
#define Tx_Retry_Count_Reg 0x1ac #define Tx_Retry_Count_Reg 0x1ac
#define RegC38_TH 20 #define RegC38_TH 20
#if 0
//----------------------------------------------------------------------------
// 8190 Rate Adaptive Table Register (offset 0x320, 4 byte)
//----------------------------------------------------------------------------
//CCK
#define RATR_1M 0x00000001
#define RATR_2M 0x00000002
#define RATR_55M 0x00000004
#define RATR_11M 0x00000008
//OFDM
#define RATR_6M 0x00000010
#define RATR_9M 0x00000020
#define RATR_12M 0x00000040
#define RATR_18M 0x00000080
#define RATR_24M 0x00000100
#define RATR_36M 0x00000200
#define RATR_48M 0x00000400
#define RATR_54M 0x00000800
//MCS 1 Spatial Stream
#define RATR_MCS0 0x00001000
#define RATR_MCS1 0x00002000
#define RATR_MCS2 0x00004000
#define RATR_MCS3 0x00008000
#define RATR_MCS4 0x00010000
#define RATR_MCS5 0x00020000
#define RATR_MCS6 0x00040000
#define RATR_MCS7 0x00080000
//MCS 2 Spatial Stream
#define RATR_MCS8 0x00100000
#define RATR_MCS9 0x00200000
#define RATR_MCS10 0x00400000
#define RATR_MCS11 0x00800000
#define RATR_MCS12 0x01000000
#define RATR_MCS13 0x02000000
#define RATR_MCS14 0x04000000
#define RATR_MCS15 0x08000000
// ALL CCK Rate
#define RATE_ALL_CCK RATR_1M|RATR_2M|RATR_55M|RATR_11M
#define RATE_ALL_OFDM_AG RATR_6M|RATR_9M|RATR_12M|RATR_18M|RATR_24M\
|RATR_36M|RATR_48M|RATR_54M
#define RATE_ALL_OFDM_2SS RATR_MCS8|RATR_MCS9 |RATR_MCS10|RATR_MCS11| \
RATR_MCS12|RATR_MCS13|RATR_MCS14|RATR_MCS15
#endif
/*--------------------------Define Parameters-------------------------------*/ /*--------------------------Define Parameters-------------------------------*/
...@@ -275,11 +231,7 @@ extern void deinit_hal_dm(struct net_device *dev); ...@@ -275,11 +231,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,16 +239,9 @@ extern void dm_change_dynamic_initgain_thresh(struct net_device *dev, ...@@ -287,16 +239,9 @@ 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
extern char dm_check_lbus_status(IN PADAPTER Adapter);
#endif
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);
/*--------------------------Exported Function prototype---------------------*/ /*--------------------------Exported Function prototype---------------------*/
......
This diff is collapsed.
...@@ -44,40 +44,6 @@ static int r8192_wx_get_freq(struct net_device *dev, ...@@ -44,40 +44,6 @@ static int r8192_wx_get_freq(struct net_device *dev,
} }
#if 0
static int r8192_wx_set_beaconinterval(struct net_device *dev, struct iw_request_info *aa,
union iwreq_data *wrqu, char *b)
{
int *parms = (int *)b;
int bi = parms[0];
struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem);
DMESG("setting beacon interval to %x",bi);
priv->ieee80211->beacon_interval=bi;
rtl8180_commit(dev);
up(&priv->wx_sem);
return 0;
}
static int r8192_wx_set_forceassociate(struct net_device *dev, struct iw_request_info *aa,
union iwreq_data *wrqu, char *extra)
{
struct r8192_priv *priv=ieee80211_priv(dev);
int *parms = (int *)extra;
priv->ieee80211->force_associate = (parms[0] > 0);
return 0;
}
#endif
static int r8192_wx_get_mode(struct net_device *dev, struct iw_request_info *a, static int r8192_wx_get_mode(struct net_device *dev, struct iw_request_info *a,
union iwreq_data *wrqu, char *b) union iwreq_data *wrqu, char *b)
{ {
...@@ -215,10 +181,6 @@ static int r8192_wx_read_bb(struct net_device *dev, ...@@ -215,10 +181,6 @@ static int r8192_wx_read_bb(struct net_device *dev,
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
u8 databb; u8 databb;
#if 0
int i;
for(i=0;i<12;i++) printk("%8x\n", read_cam(dev, i) );
#endif
down(&priv->wx_sem); down(&priv->wx_sem);
...@@ -316,14 +278,6 @@ static int r8192_wx_get_ap_status(struct net_device *dev, ...@@ -316,14 +278,6 @@ static int r8192_wx_get_ap_status(struct net_device *dev,
#endif
#if 0
static int r8192_wx_null(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
return 0;
}
#endif #endif
static int r8192_wx_force_reset(struct net_device *dev, static int r8192_wx_force_reset(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
...@@ -937,24 +891,12 @@ exit: ...@@ -937,24 +891,12 @@ exit:
} }
#if (WIRELESS_EXT >= 18) #if (WIRELESS_EXT >= 18)
#if 0
static int r8192_wx_get_enc_ext(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
struct r8192_priv *priv = ieee80211_priv(dev);
int ret = 0;
ret = ieee80211_wx_get_encode_ext(priv->ieee80211, info, wrqu, extra);
return ret;
}
#endif
//hw security need to reorganized. //hw security need to reorganized.
static int r8192_wx_set_enc_ext(struct net_device *dev, static int r8192_wx_set_enc_ext(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
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__);
...@@ -969,13 +911,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, ...@@ -969,13 +911,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
u32 key[4] = {0}; u32 key[4] = {0};
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
struct iw_point *encoding = &wrqu->encoding; struct iw_point *encoding = &wrqu->encoding;
#if 0
static u8 CAM_CONST_ADDR[4][6] = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x03}};
#endif
u8 idx = 0, alg = 0, group = 0; u8 idx = 0, alg = 0, group = 0;
if ((encoding->flags & IW_ENCODE_DISABLED) || if ((encoding->flags & IW_ENCODE_DISABLED) ||
ext->alg == IW_ENCODE_ALG_NONE) //none is not allowed to use hwsec WB 2008.07.01 ext->alg == IW_ENCODE_ALG_NONE) //none is not allowed to use hwsec WB 2008.07.01
...@@ -1035,7 +970,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, ...@@ -1035,7 +970,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;
} }
...@@ -1044,13 +978,11 @@ static int r8192_wx_set_auth(struct net_device *dev, ...@@ -1044,13 +978,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;
} }
...@@ -1061,13 +993,11 @@ static int r8192_wx_set_mlme(struct net_device *dev, ...@@ -1061,13 +993,11 @@ 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
...@@ -1077,15 +1007,11 @@ static int r8192_wx_set_gen_ie(struct net_device *dev, ...@@ -1077,15 +1007,11 @@ 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;
...@@ -1271,11 +1197,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) ...@@ -1271,11 +1197,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;
} }
...@@ -1287,11 +1209,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) ...@@ -1287,11 +1209,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
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -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