mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
Staging: rtl8192u: remove dead code
Remove #ifse against older kernel versions; Remove codes marked with #if 0; Remove #if 1 Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
e406322b4b
commit
50a09b3b09
29 changed files with 1 additions and 3831 deletions
|
@ -27,12 +27,7 @@
|
|||
#include <linux/kernel.h> /* ARRAY_SIZE */
|
||||
#include <linux/version.h>
|
||||
#include <linux/module.h>
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
|
||||
#include <linux/jiffies.h>
|
||||
#else
|
||||
#include <linux/jffs.h>
|
||||
#include <linux/tqueue.h>
|
||||
#endif
|
||||
#include <linux/timer.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
|
@ -43,11 +38,6 @@
|
|||
#include "ieee80211/rtl819x_BA.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
|
||||
#define IW_MODE_MONITOR 6
|
||||
|
@ -57,24 +47,6 @@ typedef enum{false = 0, true} bool;
|
|||
#define IWEVCUSTOM 0x8c02
|
||||
#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
|
||||
/**
|
||||
|
@ -425,46 +397,10 @@ typedef struct ieee_param {
|
|||
#define IW_QUAL_NOISE_UPDATED 0x4
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
|
||||
static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *data)
|
||||
{
|
||||
task->routine = func;
|
||||
task->data = data;
|
||||
//task->next = NULL;
|
||||
INIT_LIST_HEAD(&task->list);
|
||||
task->sync = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// linux under 2.6.9 release may not support it, so modify it for common use
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9))
|
||||
//#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
|
||||
#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000)
|
||||
static inline unsigned long msleep_interruptible_rsl(unsigned int msecs)
|
||||
{
|
||||
unsigned long timeout = MSECS(msecs) + 1;
|
||||
|
||||
while (timeout) {
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
timeout = schedule_timeout(timeout);
|
||||
}
|
||||
return timeout;
|
||||
}
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31))
|
||||
static inline void msleep(unsigned int msecs)
|
||||
{
|
||||
unsigned long timeout = MSECS(msecs) + 1;
|
||||
|
||||
while (timeout) {
|
||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
||||
timeout = schedule_timeout(timeout);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#define MSECS(t) msecs_to_jiffies(t)
|
||||
#define msleep_interruptible_rsl msleep_interruptible
|
||||
#endif
|
||||
|
||||
#define IEEE80211_DATA_LEN 2304
|
||||
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
|
||||
|
@ -926,7 +862,6 @@ struct ieee_ibss_seq {
|
|||
* information for frames received. Not setting these will not cause
|
||||
* any adverse affects. */
|
||||
struct ieee80211_rx_stats {
|
||||
#if 1
|
||||
u32 mac_time[2];
|
||||
s8 rssi;
|
||||
u8 signal;
|
||||
|
@ -988,7 +923,6 @@ struct ieee80211_rx_stats {
|
|||
bool bToSelfBA; //cosa add for rssi
|
||||
char cck_adc_pwdb[4]; //cosa add for rx path selection
|
||||
u16 Seq_Num;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
@ -1336,7 +1270,6 @@ typedef union _frameqos {
|
|||
#define QOS_OUI_PARAM_SUB_TYPE 1
|
||||
#define QOS_VERSION_1 1
|
||||
#define QOS_AIFSN_MIN_VALUE 2
|
||||
#if 1
|
||||
struct ieee80211_qos_information_element {
|
||||
u8 elementID;
|
||||
u8 length;
|
||||
|
@ -1411,7 +1344,6 @@ struct ieee80211_wmm_tspec_elem {
|
|||
u16 surp_band_allow;
|
||||
u16 medium_time;
|
||||
}__attribute__((packed));
|
||||
#endif
|
||||
enum eap_type {
|
||||
EAP_PACKET = 0,
|
||||
EAPOL_START,
|
||||
|
@ -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
|
||||
//#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1))
|
||||
#if 1
|
||||
#define UP2AC(up) ( \
|
||||
((up) < 1) ? WME_AC_BE : \
|
||||
((up) < 3) ? WME_AC_BK : \
|
||||
((up) < 4) ? WME_AC_BE : \
|
||||
((up) < 6) ? WME_AC_VI : \
|
||||
WME_AC_VO)
|
||||
#endif
|
||||
//AC Mapping to UP, using in Tx part for selecting the corresponding TX queue
|
||||
#define AC2UP(_ac) ( \
|
||||
((_ac) == WME_AC_VO) ? 6 : \
|
||||
|
@ -1597,12 +1527,7 @@ struct ieee80211_network {
|
|||
/* Ensure null-terminated for any debug msgs */
|
||||
u8 ssid[IW_ESSID_MAX_SIZE + 1];
|
||||
u8 ssid_len;
|
||||
#if 1
|
||||
struct ieee80211_qos_data qos_data;
|
||||
#else
|
||||
// Qos related. Added by Annie, 2005-11-01.
|
||||
BSS_QOS BssQos;
|
||||
#endif
|
||||
//added by amy for LEAP
|
||||
bool bWithAironetIE;
|
||||
bool bCkipSupported;
|
||||
|
@ -1667,7 +1592,6 @@ struct ieee80211_network {
|
|||
struct list_head list;
|
||||
};
|
||||
|
||||
#if 1
|
||||
enum ieee80211_state {
|
||||
|
||||
/* the card is not linked at all */
|
||||
|
@ -1706,17 +1630,6 @@ enum ieee80211_state {
|
|||
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_FTS 2346
|
||||
|
@ -1735,20 +1648,7 @@ enum ieee80211_state {
|
|||
#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \
|
||||
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{
|
||||
int frag;
|
||||
|
@ -1826,11 +1726,7 @@ typedef struct _RT_POWER_SAVE_CONTROL
|
|||
bool bIPSModeBackup;
|
||||
bool bSwRfProcessing;
|
||||
RT_RF_POWER_STATE eInactivePowerState;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct work_struct InactivePsWorkItem;
|
||||
#else
|
||||
struct tq_struct InactivePsWorkItem;
|
||||
#endif
|
||||
struct timer_list InactivePsTimer;
|
||||
|
||||
// Return point for join action
|
||||
|
@ -2195,32 +2091,13 @@ struct ieee80211_device {
|
|||
|
||||
/* used if IEEE_SOFTMAC_BEACONS is set */
|
||||
struct timer_list beacon_timer;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct work_struct associate_complete_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 associate_retry_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 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.
|
||||
//STA_QOS StaQos;
|
||||
|
||||
|
@ -2320,35 +2197,9 @@ struct ieee80211_device {
|
|||
void (*ps_request_tx_ack) (struct net_device *dev);
|
||||
void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl);
|
||||
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);
|
||||
#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);
|
||||
|
||||
#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 */
|
||||
short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
|
||||
|
@ -2406,11 +2257,7 @@ struct ieee80211_device {
|
|||
|
||||
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;
|
||||
#else
|
||||
return ((struct ieee80211_device *)dev->priv)->priv;
|
||||
#endif
|
||||
}
|
||||
|
||||
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
|
|||
union iwreq_data *wrqu, char *b);
|
||||
|
||||
//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);
|
||||
#else
|
||||
extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);
|
||||
#endif
|
||||
|
||||
|
||||
extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
|
||||
|
|
|
@ -7,11 +7,6 @@
|
|||
* 2. Before write integer to 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_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net, ppc */
|
||||
|
|
|
@ -30,35 +30,6 @@ static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
|
|||
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 *tfm = NULL;
|
||||
|
@ -83,7 +54,6 @@ void crypto_free_tfm(struct crypto_tfm *tfm)
|
|||
|
||||
return tfm;
|
||||
}
|
||||
#endif
|
||||
//EXPORT_SYMBOL_GPL(crypto_alloc_tfm);
|
||||
//EXPORT_SYMBOL_GPL(crypto_free_tfm);
|
||||
|
||||
|
|
|
@ -35,10 +35,6 @@ Dot11d_Reset(struct ieee80211_device *ieee)
|
|||
{
|
||||
u32 i;
|
||||
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
|
||||
#if 0
|
||||
if(!pDot11dInfo->bEnabled)
|
||||
return;
|
||||
#endif
|
||||
// Clear old channel map
|
||||
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
|
||||
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
|
||||
|
@ -108,14 +104,12 @@ Dot11d_UpdateCountryIe(
|
|||
|
||||
pTriple = (PCHNL_TXPOWER_TRIPLE)((u8*)pTriple + 3);
|
||||
}
|
||||
#if 1
|
||||
//printk("Dot11d_UpdateCountryIe(): Channel List:\n");
|
||||
printk("Channel List:");
|
||||
for(i=1; i<= MAX_CHANNEL_NUMBER; i++)
|
||||
if(pDot11dInfo->channel_map[i] > 0)
|
||||
printk(" %d", i);
|
||||
printk("\n");
|
||||
#endif
|
||||
|
||||
UPDATE_CIE_SRC(dev, pTaddr);
|
||||
|
||||
|
@ -218,7 +212,6 @@ int ToLegalChannel(
|
|||
|
||||
return default_chn;
|
||||
}
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
|
||||
EXPORT_SYMBOL(Dot11d_Init);
|
||||
EXPORT_SYMBOL(Dot11d_Reset);
|
||||
EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
|
||||
|
@ -226,14 +219,5 @@ EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm);
|
|||
EXPORT_SYMBOL(DOT11D_ScanComplete);
|
||||
EXPORT_SYMBOL(IsLegalChannel);
|
||||
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
|
||||
|
|
|
@ -27,12 +27,7 @@
|
|||
#include <linux/kernel.h> /* ARRAY_SIZE */
|
||||
#include <linux/version.h>
|
||||
#include <linux/module.h>
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
|
||||
#include <linux/jiffies.h>
|
||||
#else
|
||||
#include <linux/jffs.h>
|
||||
#include <linux/tqueue.h>
|
||||
#endif
|
||||
#include <linux/timer.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
|
@ -43,11 +38,6 @@
|
|||
#include "rtl819x_BA.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
|
||||
#define IW_MODE_MONITOR 6
|
||||
|
@ -57,24 +47,6 @@ typedef enum{false = 0, true} bool;
|
|||
#define IWEVCUSTOM 0x8c02
|
||||
#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
|
||||
/**
|
||||
|
@ -425,46 +397,10 @@ typedef struct ieee_param {
|
|||
#define IW_QUAL_NOISE_UPDATED 0x4
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
|
||||
static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *data)
|
||||
{
|
||||
task->routine = func;
|
||||
task->data = data;
|
||||
//task->next = NULL;
|
||||
INIT_LIST_HEAD(&task->list);
|
||||
task->sync = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// linux under 2.6.9 release may not support it, so modify it for common use
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9))
|
||||
//#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
|
||||
#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000)
|
||||
static inline unsigned long msleep_interruptible_rsl(unsigned int msecs)
|
||||
{
|
||||
unsigned long timeout = MSECS(msecs) + 1;
|
||||
|
||||
while (timeout) {
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
timeout = schedule_timeout(timeout);
|
||||
}
|
||||
return timeout;
|
||||
}
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31))
|
||||
static inline void msleep(unsigned int msecs)
|
||||
{
|
||||
unsigned long timeout = MSECS(msecs) + 1;
|
||||
|
||||
while (timeout) {
|
||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
||||
timeout = schedule_timeout(timeout);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#define MSECS(t) msecs_to_jiffies(t)
|
||||
#define msleep_interruptible_rsl msleep_interruptible
|
||||
#endif
|
||||
|
||||
#define IEEE80211_DATA_LEN 2304
|
||||
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
|
||||
|
@ -926,7 +862,6 @@ struct ieee_ibss_seq {
|
|||
* information for frames received. Not setting these will not cause
|
||||
* any adverse affects. */
|
||||
struct ieee80211_rx_stats {
|
||||
#if 1
|
||||
u32 mac_time[2];
|
||||
s8 rssi;
|
||||
u8 signal;
|
||||
|
@ -988,7 +923,6 @@ struct ieee80211_rx_stats {
|
|||
bool bToSelfBA; //cosa add for rssi
|
||||
char cck_adc_pwdb[4]; //cosa add for rx path selection
|
||||
u16 Seq_Num;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
@ -1336,7 +1270,6 @@ typedef union _frameqos {
|
|||
#define QOS_OUI_PARAM_SUB_TYPE 1
|
||||
#define QOS_VERSION_1 1
|
||||
#define QOS_AIFSN_MIN_VALUE 2
|
||||
#if 1
|
||||
struct ieee80211_qos_information_element {
|
||||
u8 elementID;
|
||||
u8 length;
|
||||
|
@ -1411,7 +1344,6 @@ struct ieee80211_wmm_tspec_elem {
|
|||
u16 surp_band_allow;
|
||||
u16 medium_time;
|
||||
}__attribute__((packed));
|
||||
#endif
|
||||
enum eap_type {
|
||||
EAP_PACKET = 0,
|
||||
EAPOL_START,
|
||||
|
@ -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
|
||||
//#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1))
|
||||
#if 1
|
||||
#define UP2AC(up) ( \
|
||||
((up) < 1) ? WME_AC_BE : \
|
||||
((up) < 3) ? WME_AC_BK : \
|
||||
((up) < 4) ? WME_AC_BE : \
|
||||
((up) < 6) ? WME_AC_VI : \
|
||||
WME_AC_VO)
|
||||
#endif
|
||||
//AC Mapping to UP, using in Tx part for selecting the corresponding TX queue
|
||||
#define AC2UP(_ac) ( \
|
||||
((_ac) == WME_AC_VO) ? 6 : \
|
||||
|
@ -1597,12 +1527,7 @@ struct ieee80211_network {
|
|||
/* Ensure null-terminated for any debug msgs */
|
||||
u8 ssid[IW_ESSID_MAX_SIZE + 1];
|
||||
u8 ssid_len;
|
||||
#if 1
|
||||
struct ieee80211_qos_data qos_data;
|
||||
#else
|
||||
// Qos related. Added by Annie, 2005-11-01.
|
||||
BSS_QOS BssQos;
|
||||
#endif
|
||||
|
||||
//added by amy for LEAP
|
||||
bool bWithAironetIE;
|
||||
|
@ -1668,7 +1593,6 @@ struct ieee80211_network {
|
|||
struct list_head list;
|
||||
};
|
||||
|
||||
#if 1
|
||||
enum ieee80211_state {
|
||||
|
||||
/* the card is not linked at all */
|
||||
|
@ -1707,17 +1631,6 @@ enum ieee80211_state {
|
|||
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_FTS 2346
|
||||
|
@ -1736,20 +1649,7 @@ enum ieee80211_state {
|
|||
#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \
|
||||
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{
|
||||
int frag;
|
||||
|
@ -1827,11 +1727,7 @@ typedef struct _RT_POWER_SAVE_CONTROL
|
|||
bool bIPSModeBackup;
|
||||
bool bSwRfProcessing;
|
||||
RT_RF_POWER_STATE eInactivePowerState;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct work_struct InactivePsWorkItem;
|
||||
#else
|
||||
struct tq_struct InactivePsWorkItem;
|
||||
#endif
|
||||
struct timer_list InactivePsTimer;
|
||||
|
||||
// Return point for join action
|
||||
|
@ -2196,32 +2092,13 @@ struct ieee80211_device {
|
|||
|
||||
/* used if IEEE_SOFTMAC_BEACONS is set */
|
||||
struct timer_list beacon_timer;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct work_struct associate_complete_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 associate_retry_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 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.
|
||||
//STA_QOS StaQos;
|
||||
|
||||
|
@ -2321,35 +2198,9 @@ struct ieee80211_device {
|
|||
void (*ps_request_tx_ack) (struct net_device *dev);
|
||||
void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl);
|
||||
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);
|
||||
#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);
|
||||
|
||||
#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 */
|
||||
short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
|
||||
|
@ -2407,11 +2258,7 @@ struct ieee80211_device {
|
|||
|
||||
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;
|
||||
#else
|
||||
return ((struct ieee80211_device *)dev->priv)->priv;
|
||||
#endif
|
||||
}
|
||||
|
||||
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
|
|||
union iwreq_data *wrqu, char *b);
|
||||
|
||||
//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);
|
||||
#else
|
||||
extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);
|
||||
#endif
|
||||
|
||||
|
||||
extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
|
||||
|
|
|
@ -82,12 +82,5 @@ void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int);
|
|||
void ieee80211_crypt_deinit_handler(unsigned long);
|
||||
void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
|
||||
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
|
||||
|
|
|
@ -201,13 +201,11 @@ void free_ieee80211(struct net_device *dev)
|
|||
int i;
|
||||
//struct list_head *p, *q;
|
||||
// del_timer_sync(&ieee->SwBwTimer);
|
||||
#if 1
|
||||
if (ieee->pHTInfo != NULL)
|
||||
{
|
||||
kfree(ieee->pHTInfo);
|
||||
ieee->pHTInfo = NULL;
|
||||
}
|
||||
#endif
|
||||
RemoveAllTS(ieee);
|
||||
ieee80211_softmac_free(ieee);
|
||||
del_timer_sync(&ieee->crypt_deinit_timer);
|
||||
|
|
|
@ -55,11 +55,7 @@ static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee,
|
|||
u16 fc = le16_to_cpu(hdr->frame_ctl);
|
||||
|
||||
skb->dev = ieee->dev;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
|
||||
skb_reset_mac_header(skb);
|
||||
#else
|
||||
skb->mac.raw = skb->data;
|
||||
#endif
|
||||
|
||||
skb_pull(skb, ieee80211_get_hdrlen(fc));
|
||||
skb->pkt_type = PACKET_OTHERHOST;
|
||||
|
@ -351,13 +347,11 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, struct sk_buff *skb,
|
|||
|
||||
if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
|
||||
return 0;
|
||||
#if 1
|
||||
if (ieee->hwsec_active)
|
||||
{
|
||||
cb_desc *tcb_desc = (cb_desc *)(skb->cb+ MAX_DEV_ADDR_SIZE);
|
||||
tcb_desc->bHwSec = 1;
|
||||
}
|
||||
#endif
|
||||
hdr = (struct ieee80211_hdr_4addr *) skb->data;
|
||||
hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
|
||||
|
||||
|
@ -534,7 +528,6 @@ AddReorderEntry(
|
|||
)
|
||||
{
|
||||
struct list_head *pList = &pTS->RxPendingPktList;
|
||||
#if 1
|
||||
while(pList->next != &pTS->RxPendingPktList)
|
||||
{
|
||||
if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
|
||||
|
@ -550,7 +543,6 @@ AddReorderEntry(
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
pReorderEntry->List.next = pList->next;
|
||||
pReorderEntry->List.next->prev = &pReorderEntry->List;
|
||||
pReorderEntry->List.prev = pList;
|
||||
|
@ -626,10 +618,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
|
|||
u8 index = 0;
|
||||
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);
|
||||
#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.*/
|
||||
if(pTS->RxIndicateSeq == 0xffff) {
|
||||
pTS->RxIndicateSeq = SeqNum;
|
||||
|
@ -696,7 +684,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
|
|||
pReorderEntry->prxb = prxb;
|
||||
// IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): pREorderEntry->SeqNum is %d\n",__FUNCTION__,pReorderEntry->SeqNum);
|
||||
|
||||
#if 1
|
||||
if(!AddReorderEntry(pTS, pReorderEntry)) {
|
||||
IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n",
|
||||
__FUNCTION__, pTS->RxIndicateSeq, SeqNum);
|
||||
|
@ -713,7 +700,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
|
|||
IEEE80211_DEBUG(IEEE80211_DL_REORDER,
|
||||
"Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n",pTS->RxIndicateSeq, SeqNum);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
/*
|
||||
|
@ -736,7 +722,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
|
|||
/* Check if there is any packet need indicate.*/
|
||||
while(!list_empty(&pTS->RxPendingPktList)) {
|
||||
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);
|
||||
if( SN_LESS(pReorderEntry->SeqNum, pTS->RxIndicateSeq) ||
|
||||
SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq))
|
||||
|
@ -763,7 +748,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
|
|||
bPktInBuf = true;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Handling pending timer. Set this timer to prevent from long time Rx buffering.*/
|
||||
|
@ -780,7 +764,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
|
|||
ieee80211_indicate_packets(ieee, prxbIndicateArray, index);
|
||||
}
|
||||
|
||||
#if 1
|
||||
if(bPktInBuf && pTS->RxTimeoutIndicateSeq==0xffff) {
|
||||
// Set new pending timer.
|
||||
IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): SET rx timeout timer\n", __FUNCTION__);
|
||||
|
@ -790,7 +773,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee,
|
|||
pTS->RxPktPendingTimer.expires = jiffies + MSECS(pHTInfo->RxReorderPendingTime);
|
||||
add_timer(&pTS->RxPktPendingTimer);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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",\
|
||||
__FUNCTION__,rxb->nr_subframes);
|
||||
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,
|
|||
else
|
||||
{
|
||||
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);
|
||||
#if 1
|
||||
if(GetTs(
|
||||
ieee,
|
||||
(PTS_COMMON_INFO*) &pRxTS,
|
||||
|
@ -1099,22 +1064,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
|
|||
goto rx_dropped;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
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);
|
||||
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,
|
|||
}
|
||||
*/
|
||||
//added by amy for reorder
|
||||
#if 1
|
||||
if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
|
||||
&& !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,
|
|||
ieee->bis_any_nonbepkts = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//added by amy for reorder
|
||||
/* skb: hdr + (possible reassembled) full plaintext payload */
|
||||
payload = skb->data + hdrlen;
|
||||
|
@ -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 &&
|
||||
info_element->data[0] == 0x00 &&
|
||||
info_element->data[1] == 0x0c &&
|
||||
|
@ -2156,44 +2095,6 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
|
|||
break;
|
||||
#endif
|
||||
/* 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:
|
||||
IEEE80211_DEBUG_MGMT
|
||||
("Unsupported info element: %s (%d)\n",
|
||||
|
@ -2376,11 +2277,9 @@ static inline int ieee80211_network_init(
|
|||
if (ieee80211_is_empty_essid(network->ssid, network->ssid_len))
|
||||
network->flags |= NETWORK_EMPTY_ESSID;
|
||||
|
||||
#if 1
|
||||
stats->signal = 30 + (stats->SignalStrength * 70) / 100;
|
||||
//stats->signal = ieee80211_SignalStrengthTranslate(stats->signal);
|
||||
stats->noise = ieee80211_translate_todbm((u8)(100-stats->signal)) -25;
|
||||
#endif
|
||||
|
||||
memcpy(&network->stats, stats, sizeof(network->stats));
|
||||
|
||||
|
@ -2488,7 +2387,6 @@ static inline void update_network(struct ieee80211_network *dst,
|
|||
dst->qos_data.old_param_count = old_param;
|
||||
|
||||
/* dst->last_associate is not overwritten */
|
||||
#if 1
|
||||
dst->wmm_info = src->wmm_info; //sure to exist in beacon or probe response frame.
|
||||
if(src->wmm_param[0].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,
|
|||
memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN);
|
||||
}
|
||||
//dst->QoS_Enable = src->QoS_Enable;
|
||||
#else
|
||||
dst->QoS_Enable = 1;//for Rtl8187 simulation
|
||||
#endif
|
||||
#ifdef THOMAS_TURBO
|
||||
dst->Turbo_Enable = src->Turbo_Enable;
|
||||
#endif
|
||||
|
@ -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);
|
||||
#else
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_rx_mgt);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_rx);
|
||||
#endif
|
||||
|
|
|
@ -503,34 +503,11 @@ out:
|
|||
}
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
/* called both by wq with ieee->lock held */
|
||||
void ieee80211_softmac_scan(struct ieee80211_device *ieee)
|
||||
{
|
||||
#if 0
|
||||
short watchdog = 0;
|
||||
do{
|
||||
ieee->current_network.channel =
|
||||
(ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER;
|
||||
if (watchdog++ > MAX_CHANNEL_NUMBER)
|
||||
return; /* no good chans */
|
||||
|
||||
}while(!ieee->channel_map[ieee->current_network.channel]);
|
||||
#endif
|
||||
|
||||
schedule_task(&ieee->softmac_scan_wq);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
void ieee80211_softmac_scan_wq(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *dwork = container_of(work, struct delayed_work, work);
|
||||
struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, softmac_scan_wq);
|
||||
#else
|
||||
void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee)
|
||||
{
|
||||
#endif
|
||||
static short watchdog = 0;
|
||||
#ifdef ENABLE_DOT11D
|
||||
u8 channel_map[MAX_CHANNEL_NUMBER+1];
|
||||
|
@ -567,13 +544,7 @@ void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee)
|
|||
ieee80211_send_probe_requests(ieee);
|
||||
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, IEEE80211_SOFTMAC_SCAN_TIME);
|
||||
#else
|
||||
//ieee->scan_timer.expires = jiffies + MSECS(IEEE80211_SOFTMAC_SCAN_TIME);
|
||||
if (ieee->scanning == 1)
|
||||
mod_timer(&ieee->scan_timer,(jiffies + MSECS(IEEE80211_SOFTMAC_SCAN_TIME)));
|
||||
#endif
|
||||
|
||||
up(&ieee->scan_sem);
|
||||
return;
|
||||
|
@ -588,17 +559,6 @@ out:
|
|||
up(&ieee->scan_sem);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
void ieee80211_softmac_scan_cb(unsigned long _dev)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct ieee80211_device *ieee = (struct ieee80211_device *)_dev;
|
||||
|
||||
spin_lock_irqsave(&ieee->lock, flags);
|
||||
ieee80211_softmac_scan(ieee);
|
||||
spin_unlock_irqrestore(&ieee->lock, flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void ieee80211_beacons_start(struct ieee80211_device *ieee)
|
||||
|
@ -656,11 +616,7 @@ void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee)
|
|||
if (ieee->scanning == 1){
|
||||
ieee->scanning = 0;
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
cancel_delayed_work(&ieee->softmac_scan_wq);
|
||||
#else
|
||||
del_timer_sync(&ieee->scan_timer);
|
||||
#endif
|
||||
}
|
||||
|
||||
// spin_unlock_irqrestore(&ieee->lock, flags);
|
||||
|
@ -690,16 +646,7 @@ void ieee80211_start_scan(struct ieee80211_device *ieee)
|
|||
if (ieee->softmac_features & IEEE_SOFTMAC_SCAN){
|
||||
if (ieee->scanning == 0){
|
||||
ieee->scanning = 1;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, 0);
|
||||
#else
|
||||
|
||||
queue_work(ieee->wq, &ieee->softmac_scan_wq);
|
||||
#endif
|
||||
#else
|
||||
ieee80211_softmac_scan(ieee);
|
||||
#endif
|
||||
}
|
||||
}else
|
||||
ieee->start_scan(ieee->dev);
|
||||
|
@ -800,22 +747,10 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
else
|
||||
atim_len = 0;
|
||||
|
||||
#if 1
|
||||
if(ieee80211_is_54g(ieee->current_network))
|
||||
erp_len = 3;
|
||||
else
|
||||
erp_len = 0;
|
||||
#else
|
||||
if((ieee->current_network.mode == IEEE_G)
|
||||
||( ieee->current_network.mode == IEEE_N_24G && ieee->pHTInfo->bCurSuppCCK)) {
|
||||
erp_len = 3;
|
||||
erpinfo_content = 0;
|
||||
if(ieee->current_network.buseprotection)
|
||||
erpinfo_content |= ERP_UseProtection;
|
||||
}
|
||||
else
|
||||
erp_len = 0;
|
||||
#endif
|
||||
|
||||
|
||||
crypt = ieee->crypt[ieee->tx_keyidx];
|
||||
|
@ -824,7 +759,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
encrypt = ieee->host_encrypt && crypt && crypt->ops &&
|
||||
((0 == strcmp(crypt->ops->name, "WEP") || wpa_ie_len));
|
||||
//HT ralated element
|
||||
#if 1
|
||||
tmp_ht_cap_buf =(u8*) &(ieee->pHTInfo->SelfHTCap);
|
||||
tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
|
||||
tmp_ht_info_buf =(u8*) &(ieee->pHTInfo->SelfHTInfo);
|
||||
|
@ -840,7 +774,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len);
|
||||
}
|
||||
// printk("===============>tmp_ht_cap_len is %d,tmp_ht_info_len is %d, tmp_generic_ie_len is %d\n",tmp_ht_cap_len,tmp_ht_info_len,tmp_generic_ie_len);
|
||||
#endif
|
||||
beacon_size = sizeof(struct ieee80211_probe_response)+2+
|
||||
ssid_len
|
||||
+3 //channel
|
||||
|
@ -875,10 +808,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
cpu_to_le16((beacon_buf->capability |= WLAN_CAPABILITY_SHORT_SLOT));
|
||||
|
||||
crypt = ieee->crypt[ieee->tx_keyidx];
|
||||
#if 0
|
||||
encrypt = ieee->host_encrypt && crypt && crypt->ops &&
|
||||
(0 == strcmp(crypt->ops->name, "WEP"));
|
||||
#endif
|
||||
if (encrypt)
|
||||
beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY);
|
||||
|
||||
|
@ -917,14 +846,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
*(tag++) = 1;
|
||||
*(tag++) = erpinfo_content;
|
||||
}
|
||||
#if 0
|
||||
//Include High Throuput capability
|
||||
|
||||
*(tag++) = MFIE_TYPE_HT_CAP;
|
||||
*(tag++) = tmp_ht_cap_len - 2;
|
||||
memcpy(tag, tmp_ht_cap_buf, tmp_ht_cap_len - 2);
|
||||
tag += tmp_ht_cap_len - 2;
|
||||
#endif
|
||||
if(rate_ex_len){
|
||||
*(tag++) = MFIE_TYPE_RATES_EX;
|
||||
*(tag++) = rate_ex_len-2;
|
||||
|
@ -932,14 +853,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
tag+=rate_ex_len-2;
|
||||
}
|
||||
|
||||
#if 0
|
||||
//Include High Throuput info
|
||||
|
||||
*(tag++) = MFIE_TYPE_HT_INFO;
|
||||
*(tag++) = tmp_ht_info_len - 2;
|
||||
memcpy(tag, tmp_ht_info_buf, tmp_ht_info_len -2);
|
||||
tag += tmp_ht_info_len - 2;
|
||||
#endif
|
||||
if (wpa_ie_len)
|
||||
{
|
||||
if (ieee->iw_mode == IW_MODE_ADHOC)
|
||||
|
@ -950,28 +863,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
tag += wpa_ie_len;
|
||||
}
|
||||
|
||||
#if 0
|
||||
//
|
||||
// Construct Realtek Proprietary Aggregation mode (Set AMPDU Factor to 2, 32k)
|
||||
//
|
||||
if(pHTInfo->bRegRT2RTAggregation)
|
||||
{
|
||||
(*tag++) = 0xdd;
|
||||
(*tag++) = tmp_generic_ie_len - 2;
|
||||
memcpy(tag,tmp_generic_ie_buf,tmp_generic_ie_len -2);
|
||||
tag += tmp_generic_ie_len -2;
|
||||
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
if(ieee->qos_support)
|
||||
{
|
||||
(*tag++) = 0xdd;
|
||||
(*tag++) = wmm_len;
|
||||
memcpy(tag,QosOui,wmm_len);
|
||||
tag += wmm_len;
|
||||
}
|
||||
#endif
|
||||
//skb->dev = ieee->dev;
|
||||
return skb;
|
||||
}
|
||||
|
@ -1380,12 +1271,8 @@ void ieee80211_associate_abort(struct ieee80211_device *ieee)
|
|||
|
||||
ieee->state = IEEE80211_ASSOCIATING_RETRY;
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
queue_delayed_work(ieee->wq, &ieee->associate_retry_wq, \
|
||||
IEEE80211_SOFTMAC_ASSOC_RETRY_TIME);
|
||||
#else
|
||||
schedule_task(&ieee->associate_retry_wq);
|
||||
#endif
|
||||
|
||||
spin_unlock_irqrestore(&ieee->lock, flags);
|
||||
}
|
||||
|
@ -1447,10 +1334,6 @@ void ieee80211_auth_challenge(struct ieee80211_device *ieee, u8 *challenge, int
|
|||
|
||||
softmac_mgmt_xmit(skb, ieee);
|
||||
mod_timer(&ieee->associate_timer, jiffies + (HZ/2));
|
||||
#if 0
|
||||
ieee->associate_timer.expires = jiffies + (HZ / 2);
|
||||
add_timer(&ieee->associate_timer);
|
||||
#endif
|
||||
//dev_kfree_skb_any(skb);//edit by thomas
|
||||
}
|
||||
kfree(challenge);
|
||||
|
@ -1472,21 +1355,12 @@ void ieee80211_associate_step2(struct ieee80211_device *ieee)
|
|||
else{
|
||||
softmac_mgmt_xmit(skb, ieee);
|
||||
mod_timer(&ieee->associate_timer, jiffies + (HZ/2));
|
||||
#if 0
|
||||
ieee->associate_timer.expires = jiffies + (HZ / 2);
|
||||
add_timer(&ieee->associate_timer);
|
||||
#endif
|
||||
//dev_kfree_skb_any(skb);//edit by thomas
|
||||
}
|
||||
}
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
void ieee80211_associate_complete_wq(struct work_struct *work)
|
||||
{
|
||||
struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_complete_wq);
|
||||
#else
|
||||
void ieee80211_associate_complete_wq(struct ieee80211_device *ieee)
|
||||
{
|
||||
#endif
|
||||
printk(KERN_INFO "Associated successfully\n");
|
||||
if(ieee80211_is_54g(ieee->current_network) &&
|
||||
(ieee->modulation & IEEE80211_OFDM_MODULATION)){
|
||||
|
@ -1537,41 +1411,14 @@ void ieee80211_associate_complete(struct ieee80211_device *ieee)
|
|||
// struct net_device* dev = ieee->dev;
|
||||
del_timer_sync(&ieee->associate_timer);
|
||||
|
||||
#if 0
|
||||
for(i = 0; i < 6; i++) {
|
||||
ieee->seq_ctrl[i] = 0;
|
||||
}
|
||||
#endif
|
||||
ieee->state = IEEE80211_LINKED;
|
||||
#if 0
|
||||
if (ieee->pHTInfo->bCurrentHTSupport)
|
||||
{
|
||||
printk("Successfully associated, ht enabled\n");
|
||||
queue_work(ieee->wq, &ieee->ht_onAssRsp);
|
||||
}
|
||||
else
|
||||
{
|
||||
printk("Successfully associated, ht not enabled\n");
|
||||
memset(ieee->dot11HTOperationalRateSet, 0, 16);
|
||||
HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
|
||||
}
|
||||
#endif
|
||||
//ieee->UpdateHalRATRTableHandler(dev, ieee->dot11HTOperationalRateSet);
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
queue_work(ieee->wq, &ieee->associate_complete_wq);
|
||||
#else
|
||||
schedule_task(&ieee->associate_complete_wq);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
void ieee80211_associate_procedure_wq(struct work_struct *work)
|
||||
{
|
||||
struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_procedure_wq);
|
||||
#else
|
||||
void ieee80211_associate_procedure_wq(struct ieee80211_device *ieee)
|
||||
{
|
||||
#endif
|
||||
ieee->sync_scan_hurryup = 1;
|
||||
down(&ieee->wx_sem);
|
||||
|
||||
|
@ -1669,11 +1516,7 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee
|
|||
}
|
||||
|
||||
ieee->state = IEEE80211_ASSOCIATING;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
queue_work(ieee->wq, &ieee->associate_procedure_wq);
|
||||
#else
|
||||
schedule_task(&ieee->associate_procedure_wq);
|
||||
#endif
|
||||
}else{
|
||||
if(ieee80211_is_54g(ieee->current_network) &&
|
||||
(ieee->modulation & IEEE80211_OFDM_MODULATION)){
|
||||
|
@ -1890,11 +1733,6 @@ ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb)
|
|||
|
||||
printk(KERN_INFO"New client associated: "MAC_FMT"\n", MAC_ARG(dest));
|
||||
//FIXME
|
||||
#if 0
|
||||
spin_lock_irqsave(&ieee->lock,flags);
|
||||
add_associate(ieee,dest);
|
||||
spin_unlock_irqrestore(&ieee->lock,flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -2179,11 +2017,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
|
|||
"Association response status code 0x%x\n",
|
||||
errcode);
|
||||
if(ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT) {
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
queue_work(ieee->wq, &ieee->associate_procedure_wq);
|
||||
#else
|
||||
schedule_task(&ieee->associate_procedure_wq);
|
||||
#endif
|
||||
} else {
|
||||
ieee80211_associate_abort(ieee);
|
||||
}
|
||||
|
@ -2290,11 +2124,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
|
|||
notify_wx_assoc_event(ieee);
|
||||
//HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
|
||||
RemovePeerTS(ieee, header->addr2);
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
queue_work(ieee->wq, &ieee->associate_procedure_wq);
|
||||
#else
|
||||
schedule_task(&ieee->associate_procedure_wq);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case IEEE80211_STYPE_MANAGE_ACT:
|
||||
|
@ -2347,7 +2177,6 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *
|
|||
if(tcb_desc->bMulticast) {
|
||||
ieee->stats.multicast++;
|
||||
}
|
||||
#if 1
|
||||
/* if xmit available, just xmit it immediately, else just insert it to the wait queue */
|
||||
for(i = 0; i < txb->nr_frags; i++) {
|
||||
#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
|
||||
|
@ -2377,7 +2206,6 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *
|
|||
//ieee->dev->trans_start = jiffies;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ieee80211_txb_free(txb);
|
||||
|
||||
//exit:
|
||||
|
@ -2531,16 +2359,11 @@ void ieee80211_start_monitor_mode(struct ieee80211_device *ieee)
|
|||
netif_carrier_on(ieee->dev);
|
||||
}
|
||||
}
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
void ieee80211_start_ibss_wq(struct work_struct *work)
|
||||
{
|
||||
|
||||
struct delayed_work *dwork = container_of(work, struct delayed_work, work);
|
||||
struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, start_ibss_wq);
|
||||
#else
|
||||
void ieee80211_start_ibss_wq(struct ieee80211_device *ieee)
|
||||
{
|
||||
#endif
|
||||
/* iwconfig mode ad-hoc will schedule this and return
|
||||
* on the other hand this will block further iwconfig SET
|
||||
* operations because of the wx_sem hold.
|
||||
|
@ -2650,11 +2473,7 @@ void ieee80211_start_ibss_wq(struct ieee80211_device *ieee)
|
|||
|
||||
inline void ieee80211_start_ibss(struct ieee80211_device *ieee)
|
||||
{
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
queue_delayed_work(ieee->wq, &ieee->start_ibss_wq, 150);
|
||||
#else
|
||||
schedule_task(&ieee->start_ibss_wq);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* this is called only in user context, with wx_sem held */
|
||||
|
@ -2719,15 +2538,10 @@ void ieee80211_disassociate(struct ieee80211_device *ieee)
|
|||
notify_wx_assoc_event(ieee);
|
||||
|
||||
}
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
void ieee80211_associate_retry_wq(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *dwork = container_of(work, struct delayed_work, work);
|
||||
struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, associate_retry_wq);
|
||||
#else
|
||||
void ieee80211_associate_retry_wq(struct ieee80211_device *ieee)
|
||||
{
|
||||
#endif
|
||||
unsigned long flags;
|
||||
|
||||
down(&ieee->wx_sem);
|
||||
|
@ -2822,10 +2636,8 @@ void ieee80211_stop_protocol(struct ieee80211_device *ieee)
|
|||
|
||||
ieee80211_stop_send_beacons(ieee);
|
||||
del_timer_sync(&ieee->associate_timer);
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
cancel_delayed_work(&ieee->associate_retry_wq);
|
||||
cancel_delayed_work(&ieee->start_ibss_wq);
|
||||
#endif
|
||||
ieee80211_stop_scan(ieee);
|
||||
|
||||
ieee80211_disassociate(ieee);
|
||||
|
@ -2943,11 +2755,6 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
|
|||
ieee->sta_edca_param[3] = 0x002F3262;
|
||||
ieee->aggregation = true;
|
||||
ieee->enable_rx_imm_BA = 1;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
init_timer(&ieee->scan_timer);
|
||||
ieee->scan_timer.data = (unsigned long)ieee;
|
||||
ieee->scan_timer.function = ieee80211_softmac_scan_cb;
|
||||
#endif
|
||||
ieee->tx_pending.txb = NULL;
|
||||
|
||||
init_timer(&ieee->associate_timer);
|
||||
|
@ -2958,16 +2765,12 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
|
|||
ieee->beacon_timer.data = (unsigned long) ieee;
|
||||
ieee->beacon_timer.function = ieee80211_send_beacon_cb;
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
#ifdef PF_SYNCTHREAD
|
||||
ieee->wq = create_workqueue(DRV_NAME,0);
|
||||
#else
|
||||
ieee->wq = create_workqueue(DRV_NAME);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
INIT_DELAYED_WORK(&ieee->start_ibss_wq,ieee80211_start_ibss_wq);
|
||||
INIT_WORK(&ieee->associate_complete_wq, ieee80211_associate_complete_wq);
|
||||
INIT_WORK(&ieee->associate_procedure_wq, ieee80211_associate_procedure_wq);
|
||||
|
@ -2975,23 +2778,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
|
|||
INIT_DELAYED_WORK(&ieee->associate_retry_wq, ieee80211_associate_retry_wq);
|
||||
INIT_WORK(&ieee->wx_sync_scan_wq,ieee80211_wx_sync_scan_wq);
|
||||
|
||||
#else
|
||||
INIT_WORK(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee);
|
||||
INIT_WORK(&ieee->associate_retry_wq,(void(*)(void*)) ieee80211_associate_retry_wq,ieee);
|
||||
INIT_WORK(&ieee->associate_complete_wq,(void(*)(void*)) ieee80211_associate_complete_wq,ieee);
|
||||
INIT_WORK(&ieee->associate_procedure_wq,(void(*)(void*)) ieee80211_associate_procedure_wq,ieee);
|
||||
INIT_WORK(&ieee->softmac_scan_wq,(void(*)(void*)) ieee80211_softmac_scan_wq,ieee);
|
||||
INIT_WORK(&ieee->wx_sync_scan_wq,(void(*)(void*)) ieee80211_wx_sync_scan_wq,ieee);
|
||||
#endif
|
||||
|
||||
#else
|
||||
tq_init(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee);
|
||||
tq_init(&ieee->associate_retry_wq,(void(*)(void*)) ieee80211_associate_retry_wq,ieee);
|
||||
tq_init(&ieee->associate_complete_wq,(void(*)(void*)) ieee80211_associate_complete_wq,ieee);
|
||||
tq_init(&ieee->associate_procedure_wq,(void(*)(void*)) ieee80211_associate_procedure_wq,ieee);
|
||||
tq_init(&ieee->softmac_scan_wq,(void(*)(void*)) ieee80211_softmac_scan_wq,ieee);
|
||||
tq_init(&ieee->wx_sync_scan_wq,(void(*)(void*)) ieee80211_wx_sync_scan_wq,ieee);
|
||||
#endif
|
||||
sema_init(&ieee->wx_sem, 1);
|
||||
sema_init(&ieee->scan_sem, 1);
|
||||
|
||||
|
@ -3016,10 +2803,8 @@ void ieee80211_softmac_free(struct ieee80211_device *ieee)
|
|||
#endif
|
||||
del_timer_sync(&ieee->associate_timer);
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
cancel_delayed_work(&ieee->associate_retry_wq);
|
||||
destroy_workqueue(ieee->wq);
|
||||
#endif
|
||||
|
||||
up(&ieee->wx_sem);
|
||||
}
|
||||
|
@ -3296,11 +3081,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
|
|||
}
|
||||
memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data));
|
||||
new_crypt->ops = ops;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
|
||||
if (new_crypt->ops && try_module_get(new_crypt->ops->owner))
|
||||
#else
|
||||
if (new_crypt->ops && try_inc_mod_count(new_crypt->ops->owner))
|
||||
#endif
|
||||
new_crypt->priv =
|
||||
new_crypt->ops->init(param->u.crypt.idx);
|
||||
|
||||
|
@ -3483,7 +3264,6 @@ void notify_wx_assoc_event(struct ieee80211_device *ieee)
|
|||
wireless_send_event(ieee->dev, SIOCGIWAP, &wrqu, NULL);
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
|
||||
EXPORT_SYMBOL(ieee80211_get_beacon);
|
||||
EXPORT_SYMBOL(ieee80211_wake_queue);
|
||||
EXPORT_SYMBOL(ieee80211_stop_queue);
|
||||
|
@ -3504,26 +3284,4 @@ EXPORT_SYMBOL(ieee80211_stop_scan);
|
|||
EXPORT_SYMBOL(ieee80211_send_probe_requests);
|
||||
EXPORT_SYMBOL(ieee80211_softmac_scan_syncro);
|
||||
EXPORT_SYMBOL(ieee80211_start_scan_syncro);
|
||||
#else
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_get_beacon);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_wake_queue);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_stop_queue);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_reset_queue);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_softmac_stop_protocol);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_softmac_start_protocol);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_is_shortslot);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_is_54g);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_wpa_supplicant_ioctl);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_ps_tx_ack);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_softmac_xmit);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_stop_send_beacons);
|
||||
EXPORT_SYMBOL_NOVERS(notify_wx_assoc_event);
|
||||
EXPORT_SYMBOL_NOVERS(SendDisassociation);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_disassociate);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_start_send_beacons);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_stop_scan);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_send_probe_requests);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_softmac_scan_syncro);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_start_scan_syncro);
|
||||
#endif
|
||||
//EXPORT_SYMBOL(ieee80211_sta_ps_send_null_frame);
|
||||
|
|
|
@ -234,23 +234,8 @@ int ieee80211_wx_get_rate(struct ieee80211_device *ieee,
|
|||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
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);
|
||||
|
||||
#endif
|
||||
wrqu->bitrate.value = tmp_rate * 500000;
|
||||
|
||||
return 0;
|
||||
|
@ -313,14 +298,9 @@ out:
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
void ieee80211_wx_sync_scan_wq(struct work_struct *work)
|
||||
{
|
||||
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;
|
||||
HT_EXTCHNL_OFFSET chan_offset=0;
|
||||
HT_CHANNEL_WIDTH bandwidth=0;
|
||||
|
@ -392,11 +372,7 @@ int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info
|
|||
}
|
||||
|
||||
if ( ieee->state == IEEE80211_LINKED){
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
queue_work(ieee->wq, &ieee->wx_sync_scan_wq);
|
||||
#else
|
||||
schedule_task(&ieee->wx_sync_scan_wq);
|
||||
#endif
|
||||
/* intentionally forget to up sem */
|
||||
return 0;
|
||||
}
|
||||
|
@ -442,29 +418,8 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
|
|||
if (wrqu->essid.flags && wrqu->essid.length) {
|
||||
//first flush current network.ssid
|
||||
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);
|
||||
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;
|
||||
}
|
||||
else{
|
||||
|
@ -557,18 +512,6 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
|
|||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
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);
|
||||
|
||||
if (wrqu->power.disabled){
|
||||
|
@ -652,7 +595,6 @@ exit:
|
|||
return ret;
|
||||
|
||||
}
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
|
||||
EXPORT_SYMBOL(ieee80211_wx_get_essid);
|
||||
EXPORT_SYMBOL(ieee80211_wx_set_essid);
|
||||
EXPORT_SYMBOL(ieee80211_wx_set_rate);
|
||||
|
@ -671,23 +613,3 @@ EXPORT_SYMBOL(ieee80211_wx_get_power);
|
|||
EXPORT_SYMBOL(ieee80211_wlan_frequencies);
|
||||
EXPORT_SYMBOL(ieee80211_wx_set_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) {
|
|||
//int i;
|
||||
if (unlikely(!txb))
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -287,11 +282,7 @@ ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network)
|
|||
return 0;
|
||||
|
||||
// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
|
||||
ip = ip_hdr(skb);
|
||||
#else
|
||||
ip = (struct iphdr*)(skb->data + sizeof(struct ether_header));
|
||||
#endif
|
||||
switch (ip->tos & 0xfc) {
|
||||
case 0x20:
|
||||
return 2;
|
||||
|
@ -334,12 +325,10 @@ void ieee80211_tx_query_agg_cap(struct ieee80211_device* ieee, struct sk_buff* s
|
|||
if(!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter))
|
||||
return;
|
||||
#endif
|
||||
#if 1
|
||||
if(!ieee->GetNmodeSupportBySecCfg(ieee->dev))
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if(pHTInfo->bCurrentAMPDUEnable)
|
||||
{
|
||||
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
|
|||
|
||||
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);
|
||||
#else
|
||||
struct ieee80211_device *ieee = (struct ieee80211_device *)dev->priv;
|
||||
#endif
|
||||
struct ieee80211_txb *txb = NULL;
|
||||
struct ieee80211_hdr_3addrqos *frag_hdr;
|
||||
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)
|
|||
//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 1
|
||||
cb_desc *tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE);
|
||||
tcb_desc->bTxEnableFwCalcDur = 1;
|
||||
if (is_multicast_ether_addr(header.addr1))
|
||||
|
@ -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_DEBUG_DATA(IEEE80211_DL_DATA, txb->fragments[0]->data, txb->fragments[0]->len);
|
||||
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, tcb_desc, sizeof(cb_desc));
|
||||
#endif
|
||||
}
|
||||
spin_unlock_irqrestore(&ieee->lock, flags);
|
||||
dev_kfree_skb_any(skb);
|
||||
|
|
|
@ -35,11 +35,6 @@
|
|||
#include <linux/module.h>
|
||||
|
||||
#include "ieee80211.h"
|
||||
#if 0
|
||||
static const char *ieee80211_modes[] = {
|
||||
"?", "a", "b", "ab", "g", "ag", "bg", "abg"
|
||||
};
|
||||
#endif
|
||||
struct modes_unit {
|
||||
char *mode_string;
|
||||
int mode_size;
|
||||
|
@ -53,25 +48,7 @@ struct modes_unit ieee80211_modes[] = {
|
|||
{"N-5G",4},
|
||||
};
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
|
||||
static inline char *
|
||||
iwe_stream_add_event_rsl(char * stream, /* Stream of events */
|
||||
char * ends, /* End of stream */
|
||||
struct iw_event *iwe, /* Payload */
|
||||
int event_len) /* Real size of payload */
|
||||
{
|
||||
/* Check if it's possible */
|
||||
if((stream + event_len) < ends) {
|
||||
iwe->len = event_len;
|
||||
ndelay(1); //new
|
||||
memcpy(stream, (char *) iwe, event_len);
|
||||
stream += event_len;
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
#else
|
||||
#define iwe_stream_add_event_rsl iwe_stream_add_event
|
||||
#endif
|
||||
|
||||
#define MAX_CUSTOM_LEN 64
|
||||
static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
||||
|
@ -92,11 +69,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
iwe.cmd = SIOCGIWAP;
|
||||
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
|
||||
memcpy(iwe.u.ap_addr.sa_data, network->bssid, ETH_ALEN);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_ADDR_LEN);
|
||||
#else
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_ADDR_LEN);
|
||||
#endif
|
||||
/* Remaining entries will be displayed in the order we provide them */
|
||||
|
||||
/* Add the ESSID */
|
||||
|
@ -105,18 +78,10 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
// if (network->flags & NETWORK_EMPTY_ESSID) {
|
||||
if (network->ssid_len == 0) {
|
||||
iwe.u.data.length = sizeof("<hidden>");
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>");
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, "<hidden>");
|
||||
#endif
|
||||
} else {
|
||||
iwe.u.data.length = min(network->ssid_len, (u8)32);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, network->ssid);
|
||||
#endif
|
||||
}
|
||||
/* Add the protocol name */
|
||||
iwe.cmd = SIOCGIWNAME;
|
||||
|
@ -128,11 +93,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
}
|
||||
*pname = '\0';
|
||||
snprintf(iwe.u.name, IFNAMSIZ, "IEEE802.11%s", proto_name);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_CHAR_LEN);
|
||||
#else
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_CHAR_LEN);
|
||||
#endif
|
||||
/* Add mode */
|
||||
iwe.cmd = SIOCGIWMODE;
|
||||
if (network->capability &
|
||||
|
@ -141,11 +102,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
iwe.u.mode = IW_MODE_MASTER;
|
||||
else
|
||||
iwe.u.mode = IW_MODE_ADHOC;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_UINT_LEN);
|
||||
#else
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_UINT_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Add frequency/channel */
|
||||
|
@ -155,11 +112,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
iwe.u.freq.m = network->channel;
|
||||
iwe.u.freq.e = 0;
|
||||
iwe.u.freq.i = 0;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_FREQ_LEN);
|
||||
#else
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_FREQ_LEN);
|
||||
#endif
|
||||
/* Add encryption capability */
|
||||
iwe.cmd = SIOCGIWENCODE;
|
||||
if (network->capability & WLAN_CAPABILITY_PRIVACY)
|
||||
|
@ -167,11 +120,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
else
|
||||
iwe.u.data.flags = IW_ENCODE_DISABLED;
|
||||
iwe.u.data.length = 0;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, network->ssid);
|
||||
#endif
|
||||
/* Add basic and extended rates */
|
||||
max_rate = 0;
|
||||
p = custom;
|
||||
|
@ -215,33 +164,15 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
if (rate > max_rate)
|
||||
max_rate = rate;
|
||||
}
|
||||
#if 0
|
||||
printk("max rate:%d ===basic rate:\n", max_rate);
|
||||
for (i=0;i<network->rates_len;i++)
|
||||
printk(" %x", network->rates[i]);
|
||||
printk("\n=======extend rate\n");
|
||||
for (i=0; i<network->rates_ex_len; i++)
|
||||
printk(" %x", network->rates_ex[i]);
|
||||
printk("\n");
|
||||
#endif
|
||||
iwe.cmd = SIOCGIWRATE;
|
||||
iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0;
|
||||
iwe.u.bitrate.value = max_rate * 500000;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe,
|
||||
IW_EV_PARAM_LEN);
|
||||
#else
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe,
|
||||
IW_EV_PARAM_LEN);
|
||||
#endif
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
iwe.u.data.length = p - custom;
|
||||
if (iwe.u.data.length)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, custom);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, custom);
|
||||
#endif
|
||||
/* Add quality statistics */
|
||||
/* TODO: Fix these values... */
|
||||
iwe.cmd = IWEVQUAL;
|
||||
|
@ -256,21 +187,13 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
if (!(network->stats.mask & IEEE80211_STATMASK_SIGNAL))
|
||||
iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID;
|
||||
iwe.u.qual.updated = 7;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_QUAL_LEN);
|
||||
#else
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_QUAL_LEN);
|
||||
#endif
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
p = custom;
|
||||
|
||||
iwe.u.data.length = p - custom;
|
||||
if (iwe.u.data.length)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, custom);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, custom);
|
||||
#endif
|
||||
#if (WIRELESS_EXT < 18)
|
||||
if (ieee->wpa_enabled && network->wpa_ie_len){
|
||||
char buf[MAX_WPA_IE_LEN * 2 + 30];
|
||||
|
@ -284,11 +207,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
memset(&iwe, 0, sizeof(iwe));
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
iwe.u.data.length = strlen(buf);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ieee->wpa_enabled && network->rsn_ie_len){
|
||||
|
@ -303,11 +222,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
memset(&iwe, 0, sizeof(iwe));
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
iwe.u.data.length = strlen(buf);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
|
@ -317,11 +232,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
memcpy(buf, network->wpa_ie, network->wpa_ie_len);
|
||||
iwe.cmd = IWEVGENIE;
|
||||
iwe.u.data.length = network->wpa_ie_len;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
#endif
|
||||
}
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
if (network->rsn_ie_len)
|
||||
|
@ -330,11 +241,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
memcpy(buf, network->rsn_ie, network->rsn_ie_len);
|
||||
iwe.cmd = IWEVGENIE;
|
||||
iwe.u.data.length = network->rsn_ie_len;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -347,11 +254,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
" Last beacon: %lums ago", (jiffies - network->last_scanned) / (HZ / 100));
|
||||
iwe.u.data.length = p - custom;
|
||||
if (iwe.u.data.length)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, custom);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, custom);
|
||||
#endif
|
||||
|
||||
return start;
|
||||
}
|
||||
|
@ -486,11 +389,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
|
|||
request_module("ieee80211_crypt_wep");
|
||||
new_crypt->ops = ieee80211_get_crypto_ops("WEP");
|
||||
}
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
|
||||
if (new_crypt->ops && try_module_get(new_crypt->ops->owner))
|
||||
#else
|
||||
if (new_crypt->ops && try_inc_mod_count(new_crypt->ops->owner))
|
||||
#endif
|
||||
new_crypt->priv = new_crypt->ops->init(key);
|
||||
|
||||
if (!new_crypt->ops || !new_crypt->priv) {
|
||||
|
@ -611,15 +510,6 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
|
|||
erq->flags |= IW_ENCODE_DISABLED;
|
||||
return 0;
|
||||
}
|
||||
#if 0
|
||||
if (strcmp(crypt->ops->name, "WEP") != 0) {
|
||||
/* only WEP is supported with wireless extensions, so just
|
||||
* report that encryption is used */
|
||||
erq->length = 0;
|
||||
erq->flags |= IW_ENCODE_ENABLED;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
len = crypt->ops->get_key(keybuf, SCM_KEY_LEN, NULL, crypt->priv);
|
||||
erq->length = (len >= 0 ? len : 0);
|
||||
|
||||
|
@ -638,7 +528,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
|||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
int ret = 0;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct net_device *dev = ieee->dev;
|
||||
struct iw_point *encoding = &wrqu->encoding;
|
||||
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
|
||||
|
@ -702,12 +591,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
|||
|
||||
sec.enabled = 1;
|
||||
// sec.encrypt = 1;
|
||||
#if 0
|
||||
if (group_key ? !ieee->host_mc_decrypt :
|
||||
!(ieee->host_encrypt || ieee->host_decrypt ||
|
||||
ieee->host_encrypt_msdu))
|
||||
goto skip_host_crypt;
|
||||
#endif
|
||||
switch (ext->alg) {
|
||||
case IW_ENCODE_ALG_WEP:
|
||||
alg = "WEP";
|
||||
|
@ -747,12 +630,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
|||
|
||||
ieee80211_crypt_delayed_deinit(ieee, crypt);
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
|
||||
new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
|
||||
#else
|
||||
new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
|
||||
memset(new_crypt,0,sizeof(*new_crypt));
|
||||
#endif
|
||||
if (new_crypt == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
|
@ -777,7 +655,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
|||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
#if 1
|
||||
//skip_host_crypt:
|
||||
//printk("skip_host_crypt:ext_flags:%x\n", ext->ext_flags);
|
||||
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
|
||||
|
@ -807,7 +684,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
|||
if (group_key)
|
||||
sec.flags &= ~SEC_LEVEL;
|
||||
}
|
||||
#endif
|
||||
done:
|
||||
if (ieee->set_security)
|
||||
ieee->set_security(ieee->dev, &sec);
|
||||
|
@ -818,7 +694,6 @@ done:
|
|||
IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -881,7 +756,6 @@ int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
|
|||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct iw_mlme *mlme = (struct iw_mlme *) extra;
|
||||
switch (mlme->cmd) {
|
||||
case IW_MLME_DEAUTH:
|
||||
|
@ -891,7 +765,6 @@ int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
|
|||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -899,7 +772,6 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
|
|||
struct iw_request_info *info,
|
||||
struct iw_param *data, char *extra)
|
||||
{
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
switch (data->flags & IW_AUTH_INDEX) {
|
||||
case IW_AUTH_WPA_VERSION:
|
||||
/*need to support wpa2 here*/
|
||||
|
@ -941,13 +813,11 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
|
|||
//printk("open_wep:%d\n", ieee->open_wep);
|
||||
break;
|
||||
|
||||
#if 1
|
||||
case IW_AUTH_WPA_ENABLED:
|
||||
ieee->wpa_enabled = (data->value)?1:0;
|
||||
//printk("enalbe wpa:%d\n", ieee->wpa_enabled);
|
||||
break;
|
||||
|
||||
#endif
|
||||
case IW_AUTH_RX_UNENCRYPTED_EAPOL:
|
||||
ieee->ieee802_1x = data->value;
|
||||
break;
|
||||
|
@ -957,23 +827,11 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
|
|||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#if 1
|
||||
int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
|
||||
{
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
#if 0
|
||||
printk("====>%s()\n", __FUNCTION__);
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<len; i++)
|
||||
printk("%2x ", ie[i]&0xff);
|
||||
printk("\n");
|
||||
}
|
||||
#endif
|
||||
u8 *buf;
|
||||
|
||||
if (len>MAX_WPA_IE_LEN || (len && ie == NULL))
|
||||
|
@ -1004,13 +862,10 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
|
|||
ieee->wpa_ie = NULL;
|
||||
ieee->wpa_ie_len = 0;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
|
||||
EXPORT_SYMBOL(ieee80211_wx_set_gen_ie);
|
||||
#if (WIRELESS_EXT >= 18)
|
||||
EXPORT_SYMBOL(ieee80211_wx_set_mlme);
|
||||
|
@ -1021,12 +876,3 @@ EXPORT_SYMBOL(ieee80211_wx_get_encode_ext);
|
|||
EXPORT_SYMBOL(ieee80211_wx_get_scan);
|
||||
EXPORT_SYMBOL(ieee80211_wx_set_encode);
|
||||
EXPORT_SYMBOL(ieee80211_wx_get_encode);
|
||||
#else
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_gen_ie);
|
||||
//EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_mlme);
|
||||
//EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_auth);
|
||||
//EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_encode_ext);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_scan);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_encode);
|
||||
EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_encode);
|
||||
#endif
|
||||
|
|
|
@ -22,22 +22,6 @@
|
|||
#include <asm/softirq.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[];
|
||||
|
||||
|
|
|
@ -174,48 +174,6 @@ static struct sk_buff* ieee80211_ADDBA(struct ieee80211_device* ieee, u8* Dst, P
|
|||
//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
|
||||
|
|
|
@ -348,11 +348,6 @@ bool IsHTHalfNmodeAPs(struct ieee80211_device* ieee)
|
|||
{
|
||||
bool retValue = false;
|
||||
struct ieee80211_network* net = &ieee->current_network;
|
||||
#if 0
|
||||
if(pMgntInfo->bHalfNMode == false)
|
||||
retValue = false;
|
||||
else
|
||||
#endif
|
||||
if((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3)==0) ||
|
||||
(memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3)==0) ||
|
||||
(memcmp(net->bssid, PCI_RALINK, 3)==0) ||
|
||||
|
@ -421,24 +416,6 @@ void HTIOTPeerDetermine(struct ieee80211_device* ieee)
|
|||
u8 HTIOTActIsDisableMCS14(struct ieee80211_device* ieee, u8* PeerMacAddr)
|
||||
{
|
||||
u8 ret = 0;
|
||||
#if 0
|
||||
// Apply for 819u only
|
||||
#if (HAL_CODE_BASE==RTL8192 && DEV_BUS_TYPE==USB_INTERFACE)
|
||||
if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) ||
|
||||
(memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)
|
||||
)
|
||||
{
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
|
||||
if(pHTInfo->bCurrentRT2RTAggregation)
|
||||
{
|
||||
// The parameter of pHTInfo->bCurrentRT2RTAggregation must be decided previously
|
||||
ret = 1;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -498,21 +475,6 @@ bool HTIOTActIsDisableMCSTwoSpatialStream(struct ieee80211_device* ieee, u8 *Pee
|
|||
|
||||
#ifdef TODO
|
||||
// Apply for 819u only
|
||||
//#if (HAL_CODE_BASE==RTL8192)
|
||||
|
||||
//This rule only apply to Belkin(Ralink) AP
|
||||
if(IS_UNDER_11N_AES_MODE(Adapter))
|
||||
{
|
||||
if((PlatformCompareMemory(PeerMacAddr, BELKINF5D8233V1_RALINK, 3)==0) ||
|
||||
(PlatformCompareMemory(PeerMacAddr, PCI_RALINK, 3)==0) ||
|
||||
(PlatformCompareMemory(PeerMacAddr, EDIMAX_RALINK, 3)==0))
|
||||
{
|
||||
//Set True to disable this function. Disable by default, Emily, 2008.04.23
|
||||
retValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
//#endif
|
||||
#endif
|
||||
return retValue;
|
||||
}
|
||||
|
@ -530,18 +492,6 @@ u8 HTIOTActIsDisableEDCATurbo(struct ieee80211_device* ieee, u8* PeerMacAddr)
|
|||
// Set specific EDCA parameter for different AP in DM handler.
|
||||
|
||||
return retValue;
|
||||
#if 0
|
||||
if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0)||
|
||||
(memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)||
|
||||
(memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)||
|
||||
(memcmp(PeerMacAddr, NETGEAR834Bv2_BROADCOM, 3)==0))
|
||||
|
||||
{
|
||||
retValue = 1; //Linksys disable EDCA turbo mode
|
||||
}
|
||||
|
||||
return retValue;
|
||||
#endif
|
||||
}
|
||||
|
||||
/********************************************************************************************************************
|
||||
|
@ -809,7 +759,7 @@ void HTConstructRT2RTAggElement(struct ieee80211_device* ieee, u8* posRT2RTAgg,
|
|||
*len = 6 + 2;
|
||||
return;
|
||||
#ifdef TODO
|
||||
#if(HAL_CODE_BASE == RTL8192 && DEV_BUS_TYPE == USB_INTERFACE)
|
||||
#if (HAL_CODE_BASE == RTL8192 && DEV_BUS_TYPE == USB_INTERFACE)
|
||||
/*
|
||||
//Emily. If it is required to Ask Realtek AP to send AMPDU during AES mode, enable this
|
||||
section of code.
|
||||
|
@ -988,17 +938,6 @@ u8 HTFilterMCSRate( struct ieee80211_device* ieee, u8* pSupportMCS, u8* pOperate
|
|||
return true;
|
||||
}
|
||||
void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset);
|
||||
#if 0
|
||||
//I need move this function to other places, such as rx?
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
void HTOnAssocRsp_wq(struct work_struct *work)
|
||||
{
|
||||
struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, ht_onAssRsp);
|
||||
#else
|
||||
void HTOnAssocRsp_wq(struct ieee80211_device *ieee)
|
||||
{
|
||||
#endif
|
||||
#endif
|
||||
void HTOnAssocRsp(struct ieee80211_device *ieee)
|
||||
{
|
||||
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
|
||||
|
@ -1100,10 +1039,6 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
|
|||
{
|
||||
// Set MPDU density to 2 to Realtek AP, and set it to 0 for others
|
||||
// Replace MPDU factor declared in original association response frame format. 2007.08.20 by Emily
|
||||
#if 0
|
||||
osTmp= PacketGetElement( asocpdu, EID_Vendor, OUI_SUB_REALTEK_AGG, OUI_SUBTYPE_DONT_CARE);
|
||||
if(osTmp.Length >= 5) //00:e0:4c:02:00
|
||||
#endif
|
||||
if (ieee->current_network.bssht.bdRT2RTAggregation)
|
||||
{
|
||||
if( ieee->pairwise_key_type != KEY_TYPE_NA)
|
||||
|
@ -1122,19 +1057,12 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
|
|||
|
||||
// <2> Set AMPDU Minimum MPDU Start Spacing
|
||||
// 802.11n 3.0 section 9.7d.3
|
||||
#if 1
|
||||
if(pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity)
|
||||
pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density;
|
||||
else
|
||||
pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity;
|
||||
if(ieee->pairwise_key_type != KEY_TYPE_NA )
|
||||
pHTInfo->CurrentMPDUDensity = 7; // 8us
|
||||
#else
|
||||
if(pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity)
|
||||
pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density;
|
||||
else
|
||||
pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity;
|
||||
#endif
|
||||
// Force TX AMSDU
|
||||
|
||||
// Lanhsin: mark for tmp to avoid deauth by ap from s3
|
||||
|
@ -1278,187 +1206,6 @@ void HTInitializeBssDesc(PBSS_HT pBssHT)
|
|||
pBssHT->bdRT2RTAggregation = false;
|
||||
pBssHT->bdRT2RTLongSlotTime = false;
|
||||
}
|
||||
#if 0
|
||||
//below function has merged into ieee80211_network_init() in ieee80211_rx.c
|
||||
void
|
||||
HTParsingHTCapElement(
|
||||
IN PADAPTER Adapter,
|
||||
IN OCTET_STRING HTCapIE,
|
||||
OUT PRT_WLAN_BSS pBssDesc
|
||||
)
|
||||
{
|
||||
PMGNT_INFO pMgntInfo = &Adapter->MgntInfo;
|
||||
|
||||
if( HTCapIE.Length > sizeof(pBssDesc->BssHT.bdHTCapBuf) )
|
||||
{
|
||||
RT_TRACE( COMP_HT, DBG_LOUD, ("HTParsingHTCapElement(): HT Capability Element length is too long!\n") );
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Check the correctness of HT Cap
|
||||
//Print each field in detail. Driver should not print out this message by default
|
||||
if(!pMgntInfo->mActingAsAp && !pMgntInfo->mAssoc)
|
||||
HTDebugHTCapability(DBG_TRACE, Adapter, &HTCapIE, (pu8)"HTParsingHTCapElement()");
|
||||
|
||||
HTCapIE.Length = HTCapIE.Length > sizeof(pBssDesc->BssHT.bdHTCapBuf)?\
|
||||
sizeof(pBssDesc->BssHT.bdHTCapBuf):HTCapIE.Length; //prevent from overflow
|
||||
|
||||
CopyMem(pBssDesc->BssHT.bdHTCapBuf, HTCapIE.Octet, HTCapIE.Length);
|
||||
pBssDesc->BssHT.bdHTCapLen = HTCapIE.Length;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
HTParsingHTInfoElement(
|
||||
PADAPTER Adapter,
|
||||
OCTET_STRING HTInfoIE,
|
||||
PRT_WLAN_BSS pBssDesc
|
||||
)
|
||||
{
|
||||
PMGNT_INFO pMgntInfo = &Adapter->MgntInfo;
|
||||
|
||||
if( HTInfoIE.Length > sizeof(pBssDesc->BssHT.bdHTInfoBuf))
|
||||
{
|
||||
RT_TRACE( COMP_HT, DBG_LOUD, ("HTParsingHTInfoElement(): HT Information Element length is too long!\n") );
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Check the correctness of HT Info
|
||||
//Print each field in detail. Driver should not print out this message by default
|
||||
if(!pMgntInfo->mActingAsAp && !pMgntInfo->mAssoc)
|
||||
HTDebugHTInfo(DBG_TRACE, Adapter, &HTInfoIE, (pu8)"HTParsingHTInfoElement()");
|
||||
|
||||
HTInfoIE.Length = HTInfoIE.Length > sizeof(pBssDesc->BssHT.bdHTInfoBuf)?\
|
||||
sizeof(pBssDesc->BssHT.bdHTInfoBuf):HTInfoIE.Length; //prevent from overflow
|
||||
|
||||
CopyMem( pBssDesc->BssHT.bdHTInfoBuf, HTInfoIE.Octet, HTInfoIE.Length);
|
||||
pBssDesc->BssHT.bdHTInfoLen = HTInfoIE.Length;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get HT related information from beacon and save it in BssDesc
|
||||
*
|
||||
* (1) Parse HTCap, and HTInfo, and record whether it is 11n AP
|
||||
* (2) If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT()
|
||||
* (3) Check whether peer is Realtek AP (for Realtek proprietary aggregation mode).
|
||||
* Input:
|
||||
* PADAPTER Adapter
|
||||
*
|
||||
* Output:
|
||||
* PRT_TCB BssDesc
|
||||
*
|
||||
*/
|
||||
void HTGetValueFromBeaconOrProbeRsp(
|
||||
PADAPTER Adapter,
|
||||
POCTET_STRING pSRCmmpdu,
|
||||
PRT_WLAN_BSS bssDesc
|
||||
)
|
||||
{
|
||||
PMGNT_INFO pMgntInfo = &Adapter->MgntInfo;
|
||||
PRT_HIGH_THROUGHPUT pHTInfo = GET_HT_INFO(pMgntInfo);
|
||||
OCTET_STRING HTCapIE, HTInfoIE, HTRealtekAgg, mmpdu;
|
||||
OCTET_STRING BroadcomElement, CiscoElement;
|
||||
|
||||
mmpdu.Octet = pSRCmmpdu->Octet;
|
||||
mmpdu.Length = pSRCmmpdu->Length;
|
||||
|
||||
//2Note:
|
||||
// Mark for IOT testing using Linksys WRT350N, This AP does not contain WMM IE when
|
||||
// it is configured at pure-N mode.
|
||||
// if(bssDesc->BssQos.bdQoSMode & QOS_WMM)
|
||||
//
|
||||
|
||||
HTInitializeBssDesc (&bssDesc->BssHT);
|
||||
|
||||
//2<1> Parse HTCap, and HTInfo
|
||||
// Get HT Capability IE: (1) Get IEEE Draft N IE or (2) Get EWC IE
|
||||
HTCapIE = PacketGetElement(mmpdu, EID_HTCapability, OUI_SUB_DONT_CARE, OUI_SUBTYPE_DONT_CARE);
|
||||
if(HTCapIE.Length == 0)
|
||||
{
|
||||
HTCapIE = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_11N_EWC_HT_CAP, OUI_SUBTYPE_DONT_CARE);
|
||||
if(HTCapIE.Length != 0)
|
||||
bssDesc->BssHT.bdHTSpecVer= HT_SPEC_VER_EWC;
|
||||
}
|
||||
if(HTCapIE.Length != 0)
|
||||
HTParsingHTCapElement(Adapter, HTCapIE, bssDesc);
|
||||
|
||||
// Get HT Information IE: (1) Get IEEE Draft N IE or (2) Get EWC IE
|
||||
HTInfoIE = PacketGetElement(mmpdu, EID_HTInfo, OUI_SUB_DONT_CARE, OUI_SUBTYPE_DONT_CARE);
|
||||
if(HTInfoIE.Length == 0)
|
||||
{
|
||||
HTInfoIE = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_11N_EWC_HT_INFO, OUI_SUBTYPE_DONT_CARE);
|
||||
if(HTInfoIE.Length != 0)
|
||||
bssDesc->BssHT.bdHTSpecVer = HT_SPEC_VER_EWC;
|
||||
}
|
||||
if(HTInfoIE.Length != 0)
|
||||
HTParsingHTInfoElement(Adapter, HTInfoIE, bssDesc);
|
||||
|
||||
//2<2>If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT()
|
||||
if(HTCapIE.Length != 0)
|
||||
{
|
||||
bssDesc->BssHT.bdSupportHT = true;
|
||||
if(bssDesc->BssQos.bdQoSMode == QOS_DISABLE)
|
||||
QosSetLegacyWMMParamWithHT(Adapter, bssDesc);
|
||||
}
|
||||
else
|
||||
{
|
||||
bssDesc->BssHT.bdSupportHT = false;
|
||||
}
|
||||
|
||||
//2<3>Check whether the peer is Realtek AP/STA
|
||||
if(pHTInfo->bRegRT2RTAggregation)
|
||||
{
|
||||
if(bssDesc->BssHT.bdSupportHT)
|
||||
{
|
||||
HTRealtekAgg = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_REALTEK_AGG, OUI_SUBTYPE_DONT_CARE);
|
||||
if(HTRealtekAgg.Length >=5 )
|
||||
{
|
||||
bssDesc->BssHT.bdRT2RTAggregation = true;
|
||||
|
||||
if((HTRealtekAgg.Octet[4]==1) && (HTRealtekAgg.Octet[5] & 0x02))
|
||||
bssDesc->BssHT.bdRT2RTLongSlotTime = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 2008/01/25 MH Get Broadcom AP IE for manamgent frame CCK rate problem.
|
||||
// AP can not receive CCK managemtn from from 92E.
|
||||
//
|
||||
|
||||
// Initialize every new bss broadcom cap exist as false..
|
||||
bssDesc->bBroadcomCapExist= false;
|
||||
|
||||
if(HTCapIE.Length != 0 || HTInfoIE.Length != 0)
|
||||
{
|
||||
u4Byte Length = 0;
|
||||
|
||||
FillOctetString(BroadcomElement, NULL, 0);
|
||||
|
||||
BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_1, OUI_SUBTYPE_DONT_CARE);
|
||||
Length += BroadcomElement.Length;
|
||||
BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_2, OUI_SUBTYPE_DONT_CARE);
|
||||
Length += BroadcomElement.Length;
|
||||
BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_3, OUI_SUBTYPE_DONT_CARE);
|
||||
Length += BroadcomElement.Length;
|
||||
|
||||
if(Length > 0)
|
||||
bssDesc->bBroadcomCapExist = true;
|
||||
}
|
||||
|
||||
|
||||
// For Cisco IOT issue
|
||||
CiscoElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_CISCO_IE, OUI_SUBTYPE_DONT_CARE);
|
||||
if(CiscoElement.Length != 0){ // 3: 0x00, 0x40, 0x96 ....
|
||||
bssDesc->bCiscoCapExist = true;
|
||||
}else{
|
||||
bssDesc->bCiscoCapExist = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
/********************************************************************************************************************
|
||||
*function: initialize Bss HT structure(struct PBSS_HT)
|
||||
* input: struct ieee80211_device *ieee
|
||||
|
@ -1712,8 +1459,4 @@ void HTSetConnectBwModeCallback(struct ieee80211_device* ieee)
|
|||
pHTInfo->bSwBwInProgress = false;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
EXPORT_SYMBOL_NOVERS(HTUpdateSelfAndPeerSetting);
|
||||
#else
|
||||
EXPORT_SYMBOL(HTUpdateSelfAndPeerSetting);
|
||||
#endif
|
||||
|
|
|
@ -70,147 +70,6 @@ typedef enum _ACK_POLICY{
|
|||
}ACK_POLICY,*PACK_POLICY;
|
||||
|
||||
#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
|
||||
|
@ -361,21 +220,6 @@ typedef union _QOS_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.
|
||||
|
@ -650,16 +494,6 @@ typedef struct _OCTET_STRING{
|
|||
u8 *Octet;
|
||||
u16 Length;
|
||||
}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.
|
||||
// Ref: DOT11_QOS in 8185 code. [def. in QoS_mp.h]
|
||||
|
|
|
@ -2,13 +2,6 @@
|
|||
#include <linux/etherdevice.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)
|
||||
{
|
||||
// Not implement yet
|
||||
|
@ -28,7 +21,6 @@ void TsInactTimeout(unsigned long data)
|
|||
* return: NULL
|
||||
* notice:
|
||||
********************************************************************************************************************/
|
||||
#if 1
|
||||
void RxPktPendingTimeout(unsigned long data)
|
||||
{
|
||||
PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)data;
|
||||
|
@ -102,7 +94,6 @@ void RxPktPendingTimeout(unsigned long data)
|
|||
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
|
||||
//PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK);
|
||||
}
|
||||
#endif
|
||||
|
||||
/********************************************************************************************************************
|
||||
*function: Add BA timer function
|
||||
|
@ -366,17 +357,10 @@ bool GetTs(
|
|||
IEEE80211_DEBUG(IEEE80211_DL_ERR, "get TS for Broadcast or Multicast\n");
|
||||
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)
|
||||
UP = 0;
|
||||
else
|
||||
{
|
||||
#endif
|
||||
// In WMM case: we use 4 TID only
|
||||
if (!IsACValid(TID))
|
||||
{
|
||||
|
@ -548,7 +532,6 @@ void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr)
|
|||
{
|
||||
PTS_COMMON_INFO pTS, pTmpTS;
|
||||
printk("===========>RemovePeerTS,"MAC_FMT"\n", MAC_ARG(Addr));
|
||||
#if 1
|
||||
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List)
|
||||
{
|
||||
if (memcmp(pTS->Addr, Addr, 6) == 0)
|
||||
|
@ -589,13 +572,11 @@ void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr)
|
|||
list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void RemoveAllTS(struct ieee80211_device* ieee)
|
||||
{
|
||||
PTS_COMMON_INFO pTS, pTmpTS;
|
||||
#if 1
|
||||
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List)
|
||||
{
|
||||
RemoveTsEntry(ieee, pTS, TX_DIR);
|
||||
|
@ -623,7 +604,6 @@ void RemoveAllTS(struct ieee80211_device* ieee)
|
|||
list_del_init(&pTS->List);
|
||||
list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
pTxTS->bAddBaReqInProgress = true;
|
||||
#if 1
|
||||
if(pTxTS->bAddBaReqDelayed)
|
||||
{
|
||||
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)
|
|||
IEEE80211_DEBUG(IEEE80211_DL_BA,"TsStartAddBaProcess(): Immediately Start ADDBA now!!\n");
|
||||
mod_timer(&pTxTS->TsAddBaTimer, jiffies+10); //set 10 ticks
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
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);
|
||||
#endif
|
||||
|
|
|
@ -39,9 +39,6 @@
|
|||
#include <linux/random.h>
|
||||
#include <linux/version.h>
|
||||
#include <asm/io.h>
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
|
||||
#include <asm/semaphore.h>
|
||||
#endif
|
||||
#include "ieee80211.h"
|
||||
|
||||
#define RTL8192U
|
||||
|
@ -87,11 +84,6 @@
|
|||
|
||||
// Rx smooth factor
|
||||
#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 DMESGW(x,a...)
|
||||
#define DMESGE(x,a...)
|
||||
|
@ -141,7 +133,6 @@ do { if(rt_global_debug_component & component) \
|
|||
#define COMP_DOWN BIT29 //for rm driver module
|
||||
#define COMP_RESET BIT30 //for silent reset
|
||||
#define COMP_ERR BIT31 //for error out, always on
|
||||
#endif
|
||||
|
||||
#define RTL819x_DEBUG
|
||||
#ifdef RTL819x_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 {
|
||||
u32 cck[4];
|
||||
|
@ -933,11 +914,7 @@ typedef struct r8192_priv
|
|||
spinlock_t irq_lock;
|
||||
// spinlock_t irq_th_lock;
|
||||
spinlock_t tx_lock;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16))
|
||||
struct semaphore mutex;
|
||||
#else
|
||||
struct mutex mutex;
|
||||
#endif
|
||||
//spinlock_t rf_lock; //used to lock rf write operation added by wb
|
||||
|
||||
u16 irq_mask;
|
||||
|
@ -1007,11 +984,7 @@ typedef struct r8192_priv
|
|||
/* modified by davad for Rx process */
|
||||
struct sk_buff_head rx_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;
|
||||
#endif
|
||||
short tx_urb_index;
|
||||
atomic_t tx_pending[0x10];//UART_PRIORITY+1
|
||||
|
||||
|
@ -1041,11 +1014,7 @@ typedef struct r8192_priv
|
|||
u16 rts;
|
||||
|
||||
struct ChnlAccessSetting ChannelAccessSetting;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct work_struct reset_wq;
|
||||
#else
|
||||
struct tq_struct reset_wq;
|
||||
#endif
|
||||
|
||||
/**********************************************************/
|
||||
//for rtl819xUsb
|
||||
|
@ -1194,33 +1163,14 @@ typedef struct r8192_priv
|
|||
u16 SifsTime;
|
||||
|
||||
//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 watch_dog_wq;
|
||||
struct delayed_work txpower_tracking_wq;
|
||||
struct delayed_work rfpath_check_wq;
|
||||
struct delayed_work gpio_change_rf_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;
|
||||
#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;
|
||||
|
||||
// for rtl8187
|
||||
|
@ -1259,60 +1209,6 @@ typedef enum{
|
|||
} 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
|
||||
struct ssid_thread {
|
||||
struct net_device *dev;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -24,25 +24,11 @@ Major Change History:
|
|||
//
|
||||
// Indicate different AP vendor for IOT issue.
|
||||
//
|
||||
#if 0
|
||||
typedef enum _HT_IOT_PEER
|
||||
{
|
||||
HT_IOT_PEER_UNKNOWN = 0,
|
||||
HT_IOT_PEER_REALTEK = 1,
|
||||
HT_IOT_PEER_BROADCOM = 2,
|
||||
HT_IOT_PEER_RALINK = 3,
|
||||
HT_IOT_PEER_ATHEROS = 4,
|
||||
HT_IOT_PEER_CISCO = 5,
|
||||
HT_IOT_PEER_MAX = 6
|
||||
}HT_IOT_PEER_E, *PHTIOT_PEER_E;
|
||||
#endif
|
||||
#if 1
|
||||
static u32 edca_setting_DL[HT_IOT_PEER_MAX] =
|
||||
{ 0x5e4322, 0x5e4322, 0x5e4322, 0x604322, 0xa44f, 0x5ea44f};
|
||||
static u32 edca_setting_UL[HT_IOT_PEER_MAX] =
|
||||
{ 0x5e4322, 0xa44f, 0x5e4322, 0x604322, 0x5ea44f, 0x5ea44f};
|
||||
|
||||
#endif
|
||||
|
||||
#define RTK_UL_EDCA 0xa44f
|
||||
#define RTK_DL_EDCA 0x5e4322
|
||||
|
@ -71,11 +57,7 @@ extern void hal_dm_watchdog(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);
|
||||
#else
|
||||
extern void dm_txpower_trackingcallback(struct net_device *dev);
|
||||
#endif
|
||||
|
||||
extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14);
|
||||
extern void dm_restore_dynamic_mechanism_state(struct net_device *dev);
|
||||
|
@ -91,15 +73,8 @@ extern void dm_force_tx_fw_info(struct net_device *dev,
|
|||
u32 force_value);
|
||||
extern void dm_init_edca_turbo(struct net_device *dev);
|
||||
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);
|
||||
#else
|
||||
extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev);
|
||||
#endif
|
||||
extern void dm_fsync_timer_callback(unsigned long data);
|
||||
#if 0
|
||||
extern bool dm_check_lbus_status(struct net_device *dev);
|
||||
#endif
|
||||
extern void dm_check_fsync(struct net_device *dev);
|
||||
extern void dm_shadow_init(struct net_device *dev);
|
||||
|
||||
|
@ -498,11 +473,9 @@ static void dm_check_rate_adaptive(struct net_device * dev)
|
|||
}
|
||||
|
||||
// 2008.04.01
|
||||
#if 1
|
||||
// For RTL819X, if pairwisekey = wep/tkip, we support only MCS0~7.
|
||||
if(priv->ieee80211->GetHalfNmodeSupportByAPsHandler(dev))
|
||||
targetRATR &= 0xf00fffff;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Check whether updating of RATR0 is required
|
||||
|
@ -884,29 +857,6 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device * dev)
|
|||
|
||||
//==========================
|
||||
// this is only for test, should be masked
|
||||
#if 0
|
||||
{
|
||||
//UINT32 eRFPath;
|
||||
//UINT32 start_rf, end_rf;
|
||||
UINT32 curr_addr;
|
||||
//UINT32 reg_addr;
|
||||
//UINT32 reg_addr_end;
|
||||
UINT32 reg_value;
|
||||
//start_rf = RF90_PATH_A;
|
||||
//end_rf = RF90_PATH_B;//RF90_PATH_MAX;
|
||||
//reg_addr = 0x0;
|
||||
//reg_addr_end = 0x2F;
|
||||
|
||||
for (curr_addr = 0; curr_addr < 0x2d; curr_addr++)
|
||||
{
|
||||
reg_value = PHY_QueryRFReg( Adapter, (RF90_RADIO_PATH_E)RF90_PATH_A,
|
||||
curr_addr, bMaskDWord);
|
||||
}
|
||||
|
||||
pHalData->TXPowercount = 0;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
//==========================
|
||||
|
||||
// read and filter out unreasonable value
|
||||
|
@ -981,17 +931,11 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device * dev)
|
|||
priv->txpower_count = 0;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
extern void dm_txpower_trackingcallback(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *dwork = container_of(work,struct delayed_work,work);
|
||||
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,txpower_tracking_wq);
|
||||
struct net_device *dev = priv->ieee80211->dev;
|
||||
#else
|
||||
extern void dm_txpower_trackingcallback(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
#endif
|
||||
|
||||
#ifdef RTL8190P
|
||||
dm_TXPowerTrackingCallback_TSSI(dev);
|
||||
|
@ -1550,15 +1494,7 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev)
|
|||
{
|
||||
if((tx_power_track_counter % 30 == 0)&&(tx_power_track_counter != 0))
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0);
|
||||
#else
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
schedule_task(&priv->txpower_tracking_wq);
|
||||
#else
|
||||
queue_work(priv->priv_wq,&priv->txpower_tracking_wq);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
tx_power_track_counter++;
|
||||
}
|
||||
|
@ -1570,19 +1506,6 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev)
|
|||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
static u8 TM_Trigger=0;
|
||||
#if 0
|
||||
u1Byte i;
|
||||
u4Byte tmpRegA;
|
||||
for(i=0; i<50; i++)
|
||||
{
|
||||
tmpRegA = PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, 0x078); // 0x12: RF Reg[10:7]
|
||||
PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4d);
|
||||
//delay_us(100);
|
||||
PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4f);
|
||||
//delay_us(100);
|
||||
}
|
||||
DbgPrint("Trigger and readback ThermalMeter, write RF reg0x2 = 0x4d to 0x4f for 50 times\n");
|
||||
#else
|
||||
//DbgPrint("dm_CheckTXPowerTracking() \n");
|
||||
if(!priv->btxpower_tracking)
|
||||
return;
|
||||
|
@ -1610,18 +1533,9 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev)
|
|||
else
|
||||
{
|
||||
//DbgPrint("Schedule TxPowerTrackingWorkItem\n");
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0);
|
||||
#else
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
schedule_task(&priv->txpower_tracking_wq);
|
||||
#else
|
||||
queue_work(priv->priv_wq,&priv->txpower_tracking_wq);
|
||||
#endif
|
||||
#endif
|
||||
TM_Trigger = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1829,14 +1743,6 @@ extern void dm_restore_dynamic_mechanism_state(struct net_device *dev)
|
|||
//cosa PlatformEFIOWrite4Byte(Adapter, RATR0, ((pu4Byte)(val))[0]);
|
||||
write_nic_dword(dev, RATR0, ratr_value);
|
||||
write_nic_byte(dev, UFWP, 1);
|
||||
#if 0 // Disable old code.
|
||||
u1Byte index;
|
||||
u4Byte input_value;
|
||||
index = (u1Byte)((((pu4Byte)(val))[0]) >> 28);
|
||||
input_value = (((pu4Byte)(val))[0]) & 0x0fffffff;
|
||||
// TODO: Correct it. Emily 2007.01.11
|
||||
PlatformEFIOWrite4Byte(Adapter, RATR0+index*4, input_value);
|
||||
#endif
|
||||
}
|
||||
//Resore TX Power Tracking Index
|
||||
if(priv->btxpower_trackingInit && priv->btxpower_tracking){
|
||||
|
@ -2099,28 +2005,6 @@ dm_change_rxpath_selection_setting(
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
extern void dm_force_tx_fw_info(struct net_device *dev,
|
||||
u32 force_type,
|
||||
u32 force_value)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
|
||||
if (force_type == 0) // don't force TxSC
|
||||
{
|
||||
//DbgPrint("Set Force SubCarrier Off\n");
|
||||
priv->tx_fwinfo_force_subcarriermode = 0;
|
||||
}
|
||||
else if(force_type == 1) //force
|
||||
{
|
||||
//DbgPrint("Set Force SubCarrier On\n");
|
||||
priv->tx_fwinfo_force_subcarriermode = 1;
|
||||
if(force_value > 3)
|
||||
force_value = 3;
|
||||
priv->tx_fwinfo_force_subcarrierval = (u8)force_value;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: dm_dig_init()
|
||||
|
@ -2759,7 +2643,6 @@ extern void dm_init_edca_turbo(struct net_device * dev)
|
|||
priv->bis_cur_rdlstate = false;
|
||||
} // dm_init_edca_turbo
|
||||
|
||||
#if 1
|
||||
static void dm_check_edca_turbo(
|
||||
struct net_device * dev)
|
||||
{
|
||||
|
@ -2777,10 +2660,8 @@ static void dm_check_edca_turbo(
|
|||
// Do not be Turbo if it's under WiFi config and Qos Enabled, because the EDCA parameters
|
||||
// should follow the settings from QAP. By Bruce, 2007-12-07.
|
||||
//
|
||||
#if 1
|
||||
if(priv->ieee80211->state != IEEE80211_LINKED)
|
||||
goto dm_CheckEdcaTurbo_EXIT;
|
||||
#endif
|
||||
// We do not turn on EDCA turbo mode for some AP that has IOT issue
|
||||
if(priv->ieee80211->pHTInfo->IOTAction & HT_IOT_ACT_DISABLE_EDCA_TURBO)
|
||||
goto dm_CheckEdcaTurbo_EXIT;
|
||||
|
@ -2871,7 +2752,6 @@ dm_CheckEdcaTurbo_EXIT:
|
|||
lastTxOkCnt = priv->stats.txbytesunicast;
|
||||
lastRxOkCnt = priv->stats.rxbytesunicast;
|
||||
} // dm_CheckEdcaTurbo
|
||||
#endif
|
||||
|
||||
extern void DM_CTSToSelfSetting(struct net_device * dev,u32 DM_Type, u32 DM_Value)
|
||||
{
|
||||
|
@ -2932,20 +2812,7 @@ static void dm_ctstoself(struct net_device *dev)
|
|||
}
|
||||
else //uplink
|
||||
{
|
||||
#if 1
|
||||
pHTInfo->IOTAction |= HT_IOT_ACT_FORCED_CTS2SELF;
|
||||
#else
|
||||
if(priv->undecorated_smoothed_pwdb < priv->ieee80211->CTSToSelfTH) // disable CTS to self
|
||||
{
|
||||
pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF;
|
||||
//DbgPrint("dm_CTSToSelf() ==> CTS to self disabled\n");
|
||||
}
|
||||
else if(priv->undecorated_smoothed_pwdb >= (priv->ieee80211->CTSToSelfTH+5)) // enable CTS to self
|
||||
{
|
||||
pHTInfo->IOTAction |= HT_IOT_ACT_FORCED_CTS2SELF;
|
||||
//DbgPrint("dm_CTSToSelf() ==> CTS to self enabled\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
lastTxOkCnt = priv->stats.txbytesunicast;
|
||||
|
@ -2954,79 +2821,6 @@ static void dm_ctstoself(struct net_device *dev)
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: dm_rf_operation_test_callback()
|
||||
*
|
||||
* Overview: Only for RF operation test now.
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 05/29/2008 amy Create Version 0 porting from windows code.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern void dm_rf_operation_test_callback(unsigned long dev)
|
||||
{
|
||||
// struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev);
|
||||
u8 erfpath;
|
||||
|
||||
|
||||
for(erfpath=0; erfpath<4; erfpath++)
|
||||
{
|
||||
//DbgPrint("Set RF-%d\n\r", eRFPath);
|
||||
//PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x2c, bMask12Bits, 0x3d7);
|
||||
udelay(100);
|
||||
}
|
||||
|
||||
{
|
||||
//PlatformSetPeriodicTimer(Adapter, &pHalData->RfTest1Timer, 500);
|
||||
}
|
||||
|
||||
// For test
|
||||
{
|
||||
//u8 i;
|
||||
//PlatformSetPeriodicTimer(Adapter, &pHalData->RfTest1Timer, 500);
|
||||
#if 0
|
||||
for(i=0; i<50; i++)
|
||||
{
|
||||
// Write Test
|
||||
PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4d);
|
||||
//delay_us(100);
|
||||
PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4f);
|
||||
//delay_us(100);
|
||||
PHY_SetRFReg(Adapter, RF90_PATH_C, 0x02, bMask12Bits, 0x4d);
|
||||
//delay_us(100);
|
||||
PHY_SetRFReg(Adapter, RF90_PATH_C, 0x02, bMask12Bits, 0x4f);
|
||||
//delay_us(100);
|
||||
|
||||
#if 0
|
||||
// Read test
|
||||
PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits);
|
||||
//delay_us(100);
|
||||
PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits);
|
||||
//delay_us(100);
|
||||
PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, bMask12Bits);
|
||||
//delay_us(100);
|
||||
PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, bMask12Bits);
|
||||
//delay_us(100);
|
||||
PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x21, bMask12Bits);
|
||||
//delay_us(100);
|
||||
PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x21, bMask12Bits);
|
||||
//delay_us(100);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} /* DM_RfOperationTestCallBack */
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: dm_check_rfctrl_gpio()
|
||||
*
|
||||
|
@ -3043,7 +2837,6 @@ extern void dm_rf_operation_test_callback(unsigned long dev)
|
|||
* 05/28/2008 amy Create Version 0 porting from windows code.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
#if 1
|
||||
static void dm_check_rfctrl_gpio(struct net_device * dev)
|
||||
{
|
||||
//struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
|
@ -3060,20 +2853,11 @@ static void dm_check_rfctrl_gpio(struct net_device * dev)
|
|||
return;
|
||||
#endif
|
||||
#ifdef RTL8192E
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
queue_delayed_work(priv->priv_wq,&priv->gpio_change_rf_wq,0);
|
||||
#else
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
schedule_task(&priv->gpio_change_rf_wq);
|
||||
#else
|
||||
queue_work(priv->priv_wq,&priv->gpio_change_rf_wq);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} /* dm_CheckRfCtrlGPIO */
|
||||
|
||||
#endif
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: dm_check_pbc_gpio()
|
||||
*
|
||||
|
@ -3129,17 +2913,11 @@ static void dm_check_pbc_gpio(struct net_device *dev)
|
|||
* 02/21/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
extern void dm_gpio_change_rf_callback(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *dwork = container_of(work,struct delayed_work,work);
|
||||
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq);
|
||||
struct net_device *dev = priv->ieee80211->dev;
|
||||
#else
|
||||
extern void dm_gpio_change_rf_callback(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
#endif
|
||||
u8 tmp1byte;
|
||||
RT_RF_POWER_STATE eRfPowerStateToSet;
|
||||
bool bActuallySet = false;
|
||||
|
@ -3207,17 +2985,11 @@ extern void dm_gpio_change_rf_callback(struct net_device *dev)
|
|||
* 01/30/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *dwork = container_of(work,struct delayed_work,work);
|
||||
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,rfpath_check_wq);
|
||||
struct net_device *dev =priv->ieee80211->dev;
|
||||
#else
|
||||
extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
#endif
|
||||
//bool bactually_set = false;
|
||||
u8 rfpath = 0, i;
|
||||
|
||||
|
@ -3542,15 +3314,7 @@ static void dm_rxpath_sel_byrssi(struct net_device * dev)
|
|||
static void dm_check_rx_path_selection(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
queue_delayed_work(priv->priv_wq,&priv->rfpath_check_wq,0);
|
||||
#else
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
schedule_task(&priv->rfpath_check_wq);
|
||||
#else
|
||||
queue_work(priv->priv_wq,&priv->rfpath_check_wq);
|
||||
#endif
|
||||
#endif
|
||||
} /* dm_CheckRxRFPath */
|
||||
|
||||
|
||||
|
@ -3898,12 +3662,6 @@ void dm_check_fsync(struct net_device *dev)
|
|||
#endif
|
||||
|
||||
reg_c38_State = RegC38_NonFsync_Other_AP;
|
||||
#if 0//cosa
|
||||
if (Adapter->HardwareType == HARDWARE_TYPE_RTL8190P)
|
||||
DbgPrint("Fsync is idle, rssi<=35, write 0xc38 = 0x%x \n", 0x10);
|
||||
else
|
||||
DbgPrint("Fsync is idle, rssi<=35, write 0xc38 = 0x%x \n", 0x90);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if(priv->undecorated_smoothed_pwdb >= (RegC38_TH+5))
|
||||
|
@ -3948,50 +3706,6 @@ void dm_check_fsync(struct net_device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: DM_CheckLBusStatus()
|
||||
*
|
||||
* Overview: For 9x series, we must make sure LBUS is active for IO.
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 02/22/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern s1Byte DM_CheckLBusStatus(IN PADAPTER Adapter)
|
||||
{
|
||||
PMGNT_INFO pMgntInfo=&Adapter->MgntInfo;
|
||||
|
||||
#if (HAL_CODE_BASE & RTL819X)
|
||||
|
||||
#if (HAL_CODE_BASE == RTL8192)
|
||||
|
||||
#if( DEV_BUS_TYPE==PCI_INTERFACE)
|
||||
//return (pMgntInfo->bLbusEnable); // For debug only
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
#if( DEV_BUS_TYPE==USB_INTERFACE)
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
#endif // #if (HAL_CODE_BASE == RTL8192)
|
||||
|
||||
#if (HAL_CODE_BASE == RTL8190)
|
||||
return TRUE;
|
||||
#endif // #if (HAL_CODE_BASE == RTL8190)
|
||||
|
||||
#endif // #if (HAL_CODE_BASE & RTL819X)
|
||||
} /* DM_CheckLBusStatus */
|
||||
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: dm_shadow_init()
|
||||
|
@ -4164,14 +3878,12 @@ static void dm_send_rssi_tofw(struct net_device *dev)
|
|||
// 0x1e0(byte) to botify driver.
|
||||
write_nic_byte(dev, DRIVER_RSSI, (u8)priv->undecorated_smoothed_pwdb);
|
||||
return;
|
||||
#if 1
|
||||
tx_cmd.Op = TXCMD_SET_RX_RSSI;
|
||||
tx_cmd.Length = 4;
|
||||
tx_cmd.Value = priv->undecorated_smoothed_pwdb;
|
||||
|
||||
cmpk_message_handle_tx(dev, (u8*)&tx_cmd,
|
||||
DESC_PACKET_TYPE_INIT, sizeof(DCMD_TXCMD_T));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*---------------------------Define function prototype------------------------*/
|
||||
|
|
|
@ -62,50 +62,6 @@
|
|||
#define Initial_Tx_Rate_Reg 0x1b9
|
||||
#define Tx_Retry_Count_Reg 0x1ac
|
||||
#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-------------------------------*/
|
||||
|
||||
|
||||
|
@ -275,11 +231,7 @@ extern void deinit_hal_dm(struct net_device *dev);
|
|||
extern void hal_dm_watchdog(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);
|
||||
#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_backup_dynamic_mechanism_state(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,
|
|||
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_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);
|
||||
#else
|
||||
extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev);
|
||||
#endif
|
||||
extern void dm_fsync_timer_callback(unsigned long data);
|
||||
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_initialize_txpower_tracking(struct net_device *dev);
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
|
|
|
@ -39,15 +39,6 @@ typedef enum _BaseBand_Config_Type{
|
|||
BaseBand_Config_PHY_REG = 0, //Radio Path A
|
||||
BaseBand_Config_AGC_TAB = 1, //Radio Path B
|
||||
}BaseBand_Config_Type, *PBaseBand_Config_Type;
|
||||
#if 0
|
||||
typedef enum _RT_RF_TYPE_819xU{
|
||||
RF_TYPE_MIN = 0,
|
||||
RF_8225,
|
||||
RF_8256,
|
||||
RF_8258,
|
||||
RF_PSEUDO_11N = 4,
|
||||
}RT_RF_TYPE_819xU, *PRT_RF_TYPE_819xU;
|
||||
#endif
|
||||
#define RTL8187_REQT_READ 0xc0
|
||||
#define RTL8187_REQT_WRITE 0x40
|
||||
#define RTL8187_REQ_GET_REGS 0x05
|
||||
|
@ -408,332 +399,6 @@ enum _RTL8192Usb_HW {
|
|||
MAC4 = 0x004,
|
||||
MAC5 = 0x005,
|
||||
|
||||
#if 0
|
||||
/* 0x0006 - 0x0007 - reserved */
|
||||
RXFIFOCOUNT = 0x010,
|
||||
TXFIFOCOUNT = 0x012,
|
||||
BQREQ = 0x013,
|
||||
/* 0x0010 - 0x0017 - reserved */
|
||||
TSFTR = 0x018,
|
||||
TLPDA = 0x020,
|
||||
TNPDA = 0x024,
|
||||
THPDA = 0x028,
|
||||
BSSID = 0x02E,
|
||||
RESP_RATE = 0x034,
|
||||
CMD = 0x037,
|
||||
#define CMD_RST_SHIFT 4
|
||||
#define CMD_RESERVED_MASK ((1<<1) | (1<<5) | (1<<6) | (1<<7))
|
||||
#define CMD_RX_ENABLE_SHIFT 3
|
||||
#define CMD_TX_ENABLE_SHIFT 2
|
||||
#define CR_RST ((1<< 4))
|
||||
#define CR_RE ((1<< 3))
|
||||
#define CR_TE ((1<< 2))
|
||||
#define CR_MulRW ((1<< 0))
|
||||
|
||||
INTA_MASK = 0x03c,
|
||||
INTA = 0x03e,
|
||||
#define INTA_TXOVERFLOW (1<<15)
|
||||
#define INTA_TIMEOUT (1<<14)
|
||||
#define INTA_BEACONTIMEOUT (1<<13)
|
||||
#define INTA_ATIM (1<<12)
|
||||
#define INTA_BEACONDESCERR (1<<11)
|
||||
#define INTA_BEACONDESCOK (1<<10)
|
||||
#define INTA_HIPRIORITYDESCERR (1<<9)
|
||||
#define INTA_HIPRIORITYDESCOK (1<<8)
|
||||
#define INTA_NORMPRIORITYDESCERR (1<<7)
|
||||
#define INTA_NORMPRIORITYDESCOK (1<<6)
|
||||
#define INTA_RXOVERFLOW (1<<5)
|
||||
#define INTA_RXDESCERR (1<<4)
|
||||
#define INTA_LOWPRIORITYDESCERR (1<<3)
|
||||
#define INTA_LOWPRIORITYDESCOK (1<<2)
|
||||
#define INTA_RXCRCERR (1<<1)
|
||||
#define INTA_RXOK (1)
|
||||
TX_CONF = 0x040,
|
||||
#define TX_CONF_HEADER_AUTOICREMENT_SHIFT 30
|
||||
#define TX_LOOPBACK_SHIFT 17
|
||||
#define TX_LOOPBACK_MAC 1
|
||||
#define TX_LOOPBACK_BASEBAND 2
|
||||
#define TX_LOOPBACK_NONE 0
|
||||
#define TX_LOOPBACK_CONTINUE 3
|
||||
#define TX_LOOPBACK_MASK ((1<<17)|(1<<18))
|
||||
#define TX_LRLRETRY_SHIFT 0
|
||||
#define TX_SRLRETRY_SHIFT 8
|
||||
#define TX_NOICV_SHIFT 19
|
||||
#define TX_NOCRC_SHIFT 16
|
||||
#define TCR_DurProcMode ((1<<30))
|
||||
#define TCR_DISReqQsize ((1<<28))
|
||||
#define TCR_HWVERID_MASK ((1<<27)|(1<<26)|(1<<25))
|
||||
#define TCR_HWVERID_SHIFT 25
|
||||
#define TCR_SWPLCPLEN ((1<<24))
|
||||
#define TCR_PLCP_LEN TCR_SAT // rtl8180
|
||||
#define TCR_MXDMA_MASK ((1<<23)|(1<<22)|(1<<21))
|
||||
#define TCR_MXDMA_1024 6
|
||||
#define TCR_MXDMA_2048 7
|
||||
#define TCR_MXDMA_SHIFT 21
|
||||
#define TCR_DISCW ((1<<20))
|
||||
#define TCR_ICV ((1<<19))
|
||||
#define TCR_LBK ((1<<18)|(1<<17))
|
||||
#define TCR_LBK1 ((1<<18))
|
||||
#define TCR_LBK0 ((1<<17))
|
||||
#define TCR_CRC ((1<<16))
|
||||
#define TCR_SRL_MASK ((1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8))
|
||||
#define TCR_LRL_MASK ((1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7))
|
||||
#define TCR_PROBE_NOTIMESTAMP_SHIFT 29 //rtl8185
|
||||
RX_CONF = 0x044,
|
||||
#define MAC_FILTER_MASK ((1<<0) | (1<<1) | (1<<2) | (1<<3) | (1<<5) | \
|
||||
(1<<12) | (1<<18) | (1<<19) | (1<<20) | (1<<21) | (1<<22) | (1<<23))
|
||||
#define RX_CHECK_BSSID_SHIFT 23
|
||||
#define ACCEPT_PWR_FRAME_SHIFT 22
|
||||
#define ACCEPT_MNG_FRAME_SHIFT 20
|
||||
#define ACCEPT_CTL_FRAME_SHIFT 19
|
||||
#define ACCEPT_DATA_FRAME_SHIFT 18
|
||||
#define ACCEPT_ICVERR_FRAME_SHIFT 12
|
||||
#define ACCEPT_CRCERR_FRAME_SHIFT 5
|
||||
#define ACCEPT_BCAST_FRAME_SHIFT 3
|
||||
#define ACCEPT_MCAST_FRAME_SHIFT 2
|
||||
#define ACCEPT_ALLMAC_FRAME_SHIFT 0
|
||||
#define ACCEPT_NICMAC_FRAME_SHIFT 1
|
||||
#define RX_FIFO_THRESHOLD_MASK ((1<<13) | (1<<14) | (1<<15))
|
||||
#define RX_FIFO_THRESHOLD_SHIFT 13
|
||||
#define RX_FIFO_THRESHOLD_128 3
|
||||
#define RX_FIFO_THRESHOLD_256 4
|
||||
#define RX_FIFO_THRESHOLD_512 5
|
||||
#define RX_FIFO_THRESHOLD_1024 6
|
||||
#define RX_FIFO_THRESHOLD_NONE 7
|
||||
#define RX_AUTORESETPHY_SHIFT 28
|
||||
#define MAX_RX_DMA_MASK ((1<<8) | (1<<9) | (1<<10))
|
||||
#define MAX_RX_DMA_2048 7
|
||||
#define MAX_RX_DMA_1024 6
|
||||
#define MAX_RX_DMA_SHIFT 10
|
||||
#define RCR_ONLYERLPKT ((1<<31))
|
||||
#define RCR_CS_SHIFT 29
|
||||
#define RCR_CS_MASK ((1<<30) | (1<<29))
|
||||
#define RCR_ENMARP ((1<<28))
|
||||
#define RCR_CBSSID ((1<<23))
|
||||
#define RCR_APWRMGT ((1<<22))
|
||||
#define RCR_ADD3 ((1<<21))
|
||||
#define RCR_AMF ((1<<20))
|
||||
#define RCR_ACF ((1<<19))
|
||||
#define RCR_ADF ((1<<18))
|
||||
#define RCR_RXFTH ((1<<15)|(1<<14)|(1<<13))
|
||||
#define RCR_RXFTH2 ((1<<15))
|
||||
#define RCR_RXFTH1 ((1<<14))
|
||||
#define RCR_RXFTH0 ((1<<13))
|
||||
#define RCR_AICV ((1<<12))
|
||||
#define RCR_MXDMA ((1<<10)|(1<< 9)|(1<< 8))
|
||||
#define RCR_MXDMA2 ((1<<10))
|
||||
#define RCR_MXDMA1 ((1<< 9))
|
||||
#define RCR_MXDMA0 ((1<< 8))
|
||||
#define RCR_9356SEL ((1<< 6))
|
||||
#define RCR_ACRC32 ((1<< 5))
|
||||
#define RCR_AB ((1<< 3))
|
||||
#define RCR_AM ((1<< 2))
|
||||
#define RCR_APM ((1<< 1))
|
||||
#define RCR_AAP ((1<< 0))
|
||||
INT_TIMEOUT = 0x048,
|
||||
TX_BEACON_RING_ADDR = 0x04c,
|
||||
EPROM_CMD = 0x58,
|
||||
#define EPROM_CMD_RESERVED_MASK ((1<<5)|(1<<4))
|
||||
#define EPROM_CMD_OPERATING_MODE_SHIFT 6
|
||||
#define EPROM_CMD_OPERATING_MODE_MASK ((1<<7)|(1<<6))
|
||||
#define EPROM_CMD_CONFIG 0x3
|
||||
#define EPROM_CMD_NORMAL 0
|
||||
#define EPROM_CMD_LOAD 1
|
||||
#define EPROM_CMD_PROGRAM 2
|
||||
#define EPROM_CS_SHIFT 3
|
||||
#define EPROM_CK_SHIFT 2
|
||||
#define EPROM_W_SHIFT 1
|
||||
#define EPROM_R_SHIFT 0
|
||||
CONFIG0 = 0x051,
|
||||
#define CONFIG0_WEP104 ((1<<6))
|
||||
#define CONFIG0_LEDGPO_En ((1<<4))
|
||||
#define CONFIG0_Aux_Status ((1<<3))
|
||||
#define CONFIG0_GL ((1<<1)|(1<<0))
|
||||
#define CONFIG0_GL1 ((1<<1))
|
||||
#define CONFIG0_GL0 ((1<<0))
|
||||
CONFIG1 = 0x052,
|
||||
#define CONFIG1_LEDS ((1<<7)|(1<<6))
|
||||
#define CONFIG1_LEDS1 ((1<<7))
|
||||
#define CONFIG1_LEDS0 ((1<<6))
|
||||
#define CONFIG1_LWACT ((1<<4))
|
||||
#define CONFIG1_MEMMAP ((1<<3))
|
||||
#define CONFIG1_IOMAP ((1<<2))
|
||||
#define CONFIG1_VPD ((1<<1))
|
||||
#define CONFIG1_PMEn ((1<<0))
|
||||
CONFIG2 = 0x053,
|
||||
#define CONFIG2_LCK ((1<<7))
|
||||
#define CONFIG2_ANT ((1<<6))
|
||||
#define CONFIG2_DPS ((1<<3))
|
||||
#define CONFIG2_PAPE_sign ((1<<2))
|
||||
#define CONFIG2_PAPE_time ((1<<1)|(1<<0))
|
||||
#define CONFIG2_PAPE_time1 ((1<<1))
|
||||
#define CONFIG2_PAPE_time0 ((1<<0))
|
||||
ANA_PARAM = 0x054,
|
||||
CONFIG3 = 0x059,
|
||||
#define CONFIG3_GNTSel ((1<<7))
|
||||
#define CONFIG3_PARM_En ((1<<6))
|
||||
#define CONFIG3_Magic ((1<<5))
|
||||
#define CONFIG3_CardB_En ((1<<3))
|
||||
#define CONFIG3_CLKRUN_En ((1<<2))
|
||||
#define CONFIG3_FuncRegEn ((1<<1))
|
||||
#define CONFIG3_FBtbEn ((1<<0))
|
||||
#define CONFIG3_CLKRUN_SHIFT 2
|
||||
#define CONFIG3_ANAPARAM_W_SHIFT 6
|
||||
CONFIG4 = 0x05a,
|
||||
#define CONFIG4_VCOPDN ((1<<7))
|
||||
#define CONFIG4_PWROFF ((1<<6))
|
||||
#define CONFIG4_PWRMGT ((1<<5))
|
||||
#define CONFIG4_LWPME ((1<<4))
|
||||
#define CONFIG4_LWPTN ((1<<2))
|
||||
#define CONFIG4_RFTYPE ((1<<1)|(1<<0))
|
||||
#define CONFIG4_RFTYPE1 ((1<<1))
|
||||
#define CONFIG4_RFTYPE0 ((1<<0))
|
||||
TESTR = 0x05b,
|
||||
#define TFPC_AC 0x05C
|
||||
|
||||
#define SCR 0x05F
|
||||
PGSELECT = 0x05e,
|
||||
#define PGSELECT_PG_SHIFT 0
|
||||
SECURITY = 0x05f,
|
||||
#define SECURITY_WEP_TX_ENABLE_SHIFT 1
|
||||
#define SECURITY_WEP_RX_ENABLE_SHIFT 0
|
||||
#define SECURITY_ENCRYP_104 1
|
||||
#define SECURITY_ENCRYP_SHIFT 4
|
||||
#define SECURITY_ENCRYP_MASK ((1<<4)|(1<<5))
|
||||
ANA_PARAM2 = 0x060,
|
||||
BEACON_INTERVAL = 0x070,
|
||||
#define BEACON_INTERVAL_MASK ((1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)| \
|
||||
(1<<6)|(1<<7)|(1<<8)|(1<<9))
|
||||
ATIM_WND = 0x072,
|
||||
#define ATIM_WND_MASK (0x01FF)
|
||||
BCN_INTR_ITV = 0x074,
|
||||
#define BCN_INTR_ITV_MASK (0x01FF)
|
||||
ATIM_INTR_ITV = 0x076,
|
||||
#define ATIM_INTR_ITV_MASK (0x01FF)
|
||||
AckTimeOutReg = 0x079, //ACK timeout register, in unit of 4 us.
|
||||
PHY_ADR = 0x07c,
|
||||
PHY_READ = 0x07e,
|
||||
RFPinsOutput = 0x080,
|
||||
RFPinsEnable = 0x082,
|
||||
|
||||
//Page 0
|
||||
RFPinsSelect = 0x084,
|
||||
#define SW_CONTROL_GPIO 0x400
|
||||
RFPinsInput = 0x086,
|
||||
RF_PARA = 0x088,
|
||||
RF_TIMING = 0x08c,
|
||||
GP_ENABLE = 0x090,
|
||||
GPIO = 0x091,
|
||||
TX_AGC_CTL = 0x09c,
|
||||
#define TX_AGC_CTL_PER_PACKET_TXAGC 0x01
|
||||
#define TX_AGC_CTL_PERPACKET_GAIN_SHIFT 0
|
||||
#define TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT 1
|
||||
#define TX_AGC_CTL_FEEDBACK_ANT 2
|
||||
#define TXAGC_CTL_PER_PACKET_ANT_SEL 0x02
|
||||
OFDM_TXAGC = 0x09e,
|
||||
ANTSEL = 0x09f,
|
||||
WPA_CONFIG = 0x0b0,
|
||||
SIFS = 0x0b4,
|
||||
DIFS = 0x0b5,
|
||||
SLOT = 0x0b6,
|
||||
CW_CONF = 0x0bc,
|
||||
#define CW_CONF_PERPACKET_RETRY_LIMIT 0x02
|
||||
#define CW_CONF_PERPACKET_CW 0x01
|
||||
#define CW_CONF_PERPACKET_RETRY_SHIFT 1
|
||||
#define CW_CONF_PERPACKET_CW_SHIFT 0
|
||||
CW_VAL = 0x0bd,
|
||||
RATE_FALLBACK = 0x0be,
|
||||
#define MAX_RESP_RATE_SHIFT 4
|
||||
#define MIN_RESP_RATE_SHIFT 0
|
||||
#define RATE_FALLBACK_CTL_ENABLE 0x80
|
||||
#define RATE_FALLBACK_CTL_AUTO_STEP0 0x00
|
||||
ACM_CONTROL = 0x0BF, // ACM Control Registe
|
||||
//----------------------------------------------------------------------------
|
||||
// 8187B ACM_CONTROL bits (Offset 0xBF, 1 Byte)
|
||||
//----------------------------------------------------------------------------
|
||||
#define VOQ_ACM_EN (0x01 << 7) //BIT7
|
||||
#define VIQ_ACM_EN (0x01 << 6) //BIT6
|
||||
#define BEQ_ACM_EN (0x01 << 5) //BIT5
|
||||
#define ACM_HW_EN (0x01 << 4) //BIT4
|
||||
#define TXOPSEL (0x01 << 3) //BIT3
|
||||
#define VOQ_ACM_CTL (0x01 << 2) //BIT2 // Set to 1 when AC_VO used time reaches or exceeds the admitted time
|
||||
#define VIQ_ACM_CTL (0x01 << 1) //BIT1 // Set to 1 when AC_VI used time reaches or exceeds the admitted time
|
||||
#define BEQ_ACM_CTL (0x01 << 0) //BIT0 // Set to 1 when AC_BE used time reaches or exceeds the admitted time
|
||||
CONFIG5 = 0x0D8,
|
||||
#define CONFIG5_TX_FIFO_OK ((1<<7))
|
||||
#define CONFIG5_RX_FIFO_OK ((1<<6))
|
||||
#define CONFIG5_CALON ((1<<5))
|
||||
#define CONFIG5_EACPI ((1<<2))
|
||||
#define CONFIG5_LANWake ((1<<1))
|
||||
#define CONFIG5_PME_STS ((1<<0))
|
||||
TX_DMA_POLLING = 0x0d9,
|
||||
#define TX_DMA_POLLING_BEACON_SHIFT 7
|
||||
#define TX_DMA_POLLING_HIPRIORITY_SHIFT 6
|
||||
#define TX_DMA_POLLING_NORMPRIORITY_SHIFT 5
|
||||
#define TX_DMA_POLLING_LOWPRIORITY_SHIFT 4
|
||||
#define TX_DMA_STOP_BEACON_SHIFT 3
|
||||
#define TX_DMA_STOP_HIPRIORITY_SHIFT 2
|
||||
#define TX_DMA_STOP_NORMPRIORITY_SHIFT 1
|
||||
#define TX_DMA_STOP_LOWPRIORITY_SHIFT 0
|
||||
CWR = 0x0DC,
|
||||
RetryCTR = 0x0DE,
|
||||
INT_MIG = 0x0E2, // Interrupt Migration (0xE2 ~ 0xE3)
|
||||
TID_AC_MAP = 0x0E8, // TID to AC Mapping Register
|
||||
ANA_PARAM3 = 0x0EE,
|
||||
|
||||
|
||||
//page 1
|
||||
Wakeup0 = 0x084,
|
||||
Wakeup1 = 0x08C,
|
||||
Wakeup2LD = 0x094,
|
||||
Wakeup2HD = 0x09C,
|
||||
Wakeup3LD = 0x0A4,
|
||||
Wakeup3HD = 0x0AC,
|
||||
Wakeup4LD = 0x0B4,
|
||||
Wakeup4HD = 0x0BC,
|
||||
CRC0 = 0x0C4,
|
||||
CRC1 = 0x0C6,
|
||||
CRC2 = 0x0C8,
|
||||
CRC3 = 0x0CA,
|
||||
CRC4 = 0x0CC,
|
||||
/* 0x00CE - 0x00D3 - reserved */
|
||||
|
||||
RFSW_CTRL = 0x272, // 0x272-0x273.
|
||||
|
||||
//Reg Diff between rtl8187 and rtl8187B
|
||||
/**************************************************************************/
|
||||
BRSR_8187 = 0x02C,
|
||||
BRSR_8187B = 0x034,
|
||||
#define BRSR_BPLCP ((1<< 8))
|
||||
#define BRSR_MBR ((1<< 1)|(1<< 0))
|
||||
#define BRSR_MBR_8185 ((1<< 11)|(1<< 10)|(1<< 9)|(1<< 8)|(1<< 7)|(1<< 6)|(1<< 5)|(1<< 4)|(1<< 3)|(1<< 2)|(1<< 1)|(1<< 0))
|
||||
#define BRSR_MBR0 ((1<< 0))
|
||||
#define BRSR_MBR1 ((1<< 1))
|
||||
|
||||
/**************************************************************************/
|
||||
EIFS_8187 = 0x035,
|
||||
EIFS_8187B = 0x02D,
|
||||
|
||||
/**************************************************************************/
|
||||
FER = 0x0F0,
|
||||
FEMR = 0x0F4,
|
||||
FPSR = 0x0F8,
|
||||
FFER = 0x0FC,
|
||||
|
||||
AC_VO_PARAM = 0x0F0, // AC_VO Parameters Record
|
||||
AC_VI_PARAM = 0x0F4, // AC_VI Parameters Record
|
||||
AC_BE_PARAM = 0x0F8, // AC_BE Parameters Record
|
||||
AC_BK_PARAM = 0x0FC, // AC_BK Parameters Record
|
||||
TALLY_SEL = 0x0fc,
|
||||
//----------------------------------------------------------------------------
|
||||
// 8187B AC_XX_PARAM bits
|
||||
//----------------------------------------------------------------------------
|
||||
#define AC_PARAM_TXOP_LIMIT_OFFSET 16
|
||||
#define AC_PARAM_ECW_MAX_OFFSET 12
|
||||
#define AC_PARAM_ECW_MIN_OFFSET 8
|
||||
#define AC_PARAM_AIFS_OFFSET 0
|
||||
|
||||
#endif
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
// 818xB AnaParm & AnaParm2 Register
|
||||
|
|
|
@ -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,
|
||||
union iwreq_data *wrqu, char *b)
|
||||
{
|
||||
|
@ -215,10 +181,6 @@ static int r8192_wx_read_bb(struct net_device *dev,
|
|||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
u8 databb;
|
||||
#if 0
|
||||
int i;
|
||||
for(i=0;i<12;i++) printk("%8x\n", read_cam(dev, i) );
|
||||
#endif
|
||||
|
||||
down(&priv->wx_sem);
|
||||
|
||||
|
@ -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
|
||||
static int r8192_wx_force_reset(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
|
@ -937,24 +891,12 @@ exit:
|
|||
}
|
||||
|
||||
#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.
|
||||
static int r8192_wx_set_enc_ext(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
int ret=0;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
struct ieee80211_device* ieee = priv->ieee80211;
|
||||
//printk("===>%s()\n", __FUNCTION__);
|
||||
|
@ -969,13 +911,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
|
|||
u32 key[4] = {0};
|
||||
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
|
||||
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;
|
||||
if ((encoding->flags & IW_ENCODE_DISABLED) ||
|
||||
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,
|
|||
end_hw_sec:
|
||||
|
||||
up(&priv->wx_sem);
|
||||
#endif
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
@ -1044,13 +978,11 @@ static int r8192_wx_set_auth(struct net_device *dev,
|
|||
union iwreq_data *data, char *extra)
|
||||
{
|
||||
int ret=0;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
//printk("====>%s()\n", __FUNCTION__);
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
down(&priv->wx_sem);
|
||||
ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), extra);
|
||||
up(&priv->wx_sem);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1061,13 +993,11 @@ static int r8192_wx_set_mlme(struct net_device *dev,
|
|||
//printk("====>%s()\n", __FUNCTION__);
|
||||
|
||||
int ret=0;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
down(&priv->wx_sem);
|
||||
ret = ieee80211_wx_set_mlme(priv->ieee80211, info, wrqu, extra);
|
||||
|
||||
up(&priv->wx_sem);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
@ -1077,15 +1007,11 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
|
|||
{
|
||||
//printk("====>%s(), len:%d\n", __FUNCTION__, data->length);
|
||||
int ret=0;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
down(&priv->wx_sem);
|
||||
#if 1
|
||||
ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, data->data.length);
|
||||
#endif
|
||||
up(&priv->wx_sem);
|
||||
//printk("<======%s(), ret:%d\n", __FUNCTION__, ret);
|
||||
#endif
|
||||
return ret;
|
||||
|
||||
|
||||
|
@ -1271,11 +1197,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
|
|||
wstats->qual.qual = 0;
|
||||
wstats->qual.level = 0;
|
||||
wstats->qual.noise = 0;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
|
||||
wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
|
||||
#else
|
||||
wstats->qual.updated = 0x0f;
|
||||
#endif
|
||||
return wstats;
|
||||
}
|
||||
|
||||
|
@ -1287,11 +1209,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
|
|||
wstats->qual.level = tmp_level;
|
||||
wstats->qual.qual = tmp_qual;
|
||||
wstats->qual.noise = tmp_noise;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
|
||||
wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM;
|
||||
#else
|
||||
wstats->qual.updated = 0x0f;
|
||||
#endif
|
||||
return wstats;
|
||||
}
|
||||
//#endif
|
||||
|
|
|
@ -318,42 +318,11 @@ cmpk_handle_tx_feedback(
|
|||
/* It seems that FW use big endian(MIPS) and DRV use little endian in
|
||||
windows OS. So we have to read the content byte by byte or transfer
|
||||
endian type before copy the message copy. */
|
||||
#if 0 // The TX FEEDBACK packet element address
|
||||
//rx_tx_fb.Element_ID = pMsg[0];
|
||||
//rx_tx_fb.Length = pMsg[1];
|
||||
rx_tx_fb.TOK = pMsg[2]>>7;
|
||||
rx_tx_fb.Fail_Reason = (pMsg[2] & 0x70) >> 4;
|
||||
rx_tx_fb.TID = (pMsg[2] & 0x0F);
|
||||
rx_tx_fb.Qos_Pkt = pMsg[3] >> 7;
|
||||
rx_tx_fb.Bandwidth = (pMsg[3] & 0x40) >> 6;
|
||||
rx_tx_fb.Retry_Cnt = pMsg[5];
|
||||
rx_tx_fb.Pkt_ID = (pMsg[6] << 8) | pMsg[7];
|
||||
rx_tx_fb.Seq_Num = (pMsg[8] << 8) | pMsg[9];
|
||||
rx_tx_fb.S_Rate = pMsg[10];
|
||||
rx_tx_fb.F_Rate = pMsg[11];
|
||||
rx_tx_fb.S_RTS_Rate = pMsg[12];
|
||||
rx_tx_fb.F_RTS_Rate = pMsg[13];
|
||||
rx_tx_fb.pkt_length = (pMsg[14] << 8) | pMsg[15];
|
||||
#endif
|
||||
/* 2007/07/05 MH Use pointer to transfer structure memory. */
|
||||
//memcpy((UINT8 *)&rx_tx_fb, pMsg, sizeof(CMPK_TXFB_T));
|
||||
memcpy((u8*)&rx_tx_fb, pmsg, sizeof(cmpk_txfb_t));
|
||||
/* 2. Use tx feedback info to count TX statistics. */
|
||||
cmpk_count_txstatistic(dev, &rx_tx_fb);
|
||||
#if 0
|
||||
/* 2007/07/11 MH Assign current operate rate. */
|
||||
if (pAdapter->RegWirelessMode == WIRELESS_MODE_A ||
|
||||
pAdapter->RegWirelessMode == WIRELESS_MODE_B ||
|
||||
pAdapter->RegWirelessMode == WIRELESS_MODE_G)
|
||||
{
|
||||
pMgntInfo->CurrentOperaRate = (rx_tx_fb.F_Rate & 0x7F);
|
||||
}
|
||||
else if (pAdapter->RegWirelessMode == WIRELESS_MODE_N_24G ||
|
||||
pAdapter->RegWirelessMode == WIRELESS_MODE_N_5G)
|
||||
{
|
||||
pMgntInfo->HTCurrentOperaRate = (rx_tx_fb.F_Rate & 0x8F);
|
||||
}
|
||||
#endif
|
||||
/* 2007/01/17 MH Comment previous method for TX statistic function. */
|
||||
/* Collect info TX feedback packet to fill TCB. */
|
||||
/* We can not know the packet length and transmit type: broadcast or uni
|
||||
|
|
|
@ -13,16 +13,6 @@
|
|||
#define ISR_TxBcnErr BIT26 // Transmit Beacon Error
|
||||
#define ISR_BcnTimerIntr BIT13 // Beacon Timer Interrupt
|
||||
|
||||
#if 0
|
||||
/* Define packet type. */
|
||||
typedef enum tag_packet_type
|
||||
{
|
||||
PACKET_BROADCAST,
|
||||
PACKET_MULTICAST,
|
||||
PACKET_UNICAST,
|
||||
PACKET_TYPE_MAX
|
||||
}cmpk_pkt_type_e;
|
||||
#endif
|
||||
|
||||
/* Define element ID of command packet. */
|
||||
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
#include "r8192U_hw.h"
|
||||
#include "r819xU_firmware_img.h"
|
||||
#include "r819xU_firmware.h"
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
#include <linux/firmware.h>
|
||||
#endif
|
||||
void firmware_init_param(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
|
@ -107,12 +105,6 @@ bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, u32 buff
|
|||
|
||||
return rt_status;
|
||||
|
||||
#if 0
|
||||
cmdsend_downloadcode_fail:
|
||||
rt_status = false;
|
||||
RT_TRACE(COMP_ERR, "CmdSendDownloadCode fail !!\n");
|
||||
return rt_status;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -154,52 +146,6 @@ fwSendNullPacket(
|
|||
return rtStatus;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Procedure : Download code into IMEM or DMEM
|
||||
* Description: This routine will intialize firmware. If any error occurs during the initialization
|
||||
* process, the routine shall terminate immediately and return fail.
|
||||
* The routine copy virtual address get from opening of file into shared memory
|
||||
* allocated during initialization. If code size larger than a conitneous shared
|
||||
* memory may contain, the code should be divided into several section.
|
||||
* !!!NOTES This finction should only be called during MPInitialization because
|
||||
* A NIC driver should call NdisOpenFile only from MiniportInitialize.
|
||||
* Arguments : The pointer of the adapter
|
||||
* Code address (Virtual address, should fill descriptor with physical address)
|
||||
* Code size
|
||||
* Returns :
|
||||
* RT_STATUS_FAILURE - the following initialization process should be terminated
|
||||
* RT_STATUS_SUCCESS - if firmware initialization process success
|
||||
*/
|
||||
bool fwsend_download_code(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
rt_firmware *pfirmware = (rt_firmware*)(&priv->firmware);
|
||||
|
||||
bool rt_status = true;
|
||||
u16 length = 0;
|
||||
u16 offset = 0;
|
||||
u16 frag_threhold;
|
||||
bool last_init_packet = false;
|
||||
u32 check_txcmdwait_queueemptytime = 100000;
|
||||
u16 cmd_buf_len;
|
||||
u8 *ptr_cmd_buf;
|
||||
|
||||
/* reset to 0 for first segment of img download */
|
||||
pfirmware->firmware_seg_index = 1;
|
||||
|
||||
if(pfirmware->firmware_seg_index == pfirmware->firmware_seg_maxnum) {
|
||||
last_init_packet = 1;
|
||||
}
|
||||
|
||||
cmd_buf_len = pfirmware->firmware_seg_container[pfirmware->firmware_seg_index-1].seg_size;
|
||||
ptr_cmd_buf = pfirmware->firmware_seg_container[pfirmware->firmware_seg_index-1].seg_ptr;
|
||||
rtl819xU_tx_cmd(dev, ptr_cmd_buf, cmd_buf_len, last_init_packet, DESC_PACKET_TYPE_INIT);
|
||||
|
||||
rt_status = true;
|
||||
return rt_status;
|
||||
}
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Procedure: Check whether main code is download OK. If OK, turn on CPU
|
||||
|
@ -338,11 +284,7 @@ bool init_firmware(struct net_device *dev)
|
|||
* Download boot, main, and data image for System reset.
|
||||
* Download data image for firmware reseta
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
priv->firmware_source = FW_SOURCE_HEADER_FILE;
|
||||
#else
|
||||
priv->firmware_source = FW_SOURCE_IMG_FILE;
|
||||
#endif
|
||||
for(init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) {
|
||||
/*
|
||||
* Open Image file, and map file to contineous memory if open file success.
|
||||
|
@ -351,7 +293,6 @@ bool init_firmware(struct net_device *dev)
|
|||
if(rst_opt == OPT_SYSTEM_RESET) {
|
||||
switch(priv->firmware_source) {
|
||||
case FW_SOURCE_IMG_FILE:
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
rc = request_firmware(&fw_entry, fw_name[init_step],&priv->udev->dev);
|
||||
if(rc < 0 ) {
|
||||
RT_TRACE(COMP_ERR, "request firmware fail!\n");
|
||||
|
@ -380,7 +321,6 @@ bool init_firmware(struct net_device *dev)
|
|||
#endif
|
||||
}
|
||||
pfirmware->firmware_buf_size = file_length;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FW_SOURCE_HEADER_FILE:
|
||||
|
@ -411,11 +351,9 @@ bool init_firmware(struct net_device *dev)
|
|||
* and Tx descriptor info
|
||||
* */
|
||||
rt_status = fw_download_code(dev,mapped_file,file_length);
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
if(rst_opt == OPT_SYSTEM_RESET) {
|
||||
release_firmware(fw_entry);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(rt_status != TRUE) {
|
||||
goto download_firmware_fail;
|
||||
|
@ -487,214 +425,10 @@ download_firmware_fail:
|
|||
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Procedure: (1) Transform firmware code from little endian to big endian if required.
|
||||
* (2) Number of bytes in Firmware downloading should be multiple
|
||||
* of 4 bytes. If length is not multiple of 4 bytes, appending of zeros is required
|
||||
*
|
||||
*/
|
||||
void CmdAppendZeroAndEndianTransform(
|
||||
u1Byte *pDst,
|
||||
u1Byte *pSrc,
|
||||
u2Byte *pLength)
|
||||
{
|
||||
|
||||
u2Byte ulAppendBytes = 0, i;
|
||||
u2Byte ulLength = *pLength;
|
||||
|
||||
//test only
|
||||
//memset(pDst, 0xcc, 12);
|
||||
|
||||
|
||||
/* Transform from little endian to big endian */
|
||||
//#if DEV_BUS_TYPE==PCI_INTERFACE
|
||||
#if 0
|
||||
for( i=0 ; i<(*pLength) ; i+=4)
|
||||
{
|
||||
if((i+3) < (*pLength)) pDst[i+0] = pSrc[i+3];
|
||||
if((i+2) < (*pLength)) pDst[i+1] = pSrc[i+2];
|
||||
if((i+1) < (*pLength)) pDst[i+2] = pSrc[i+1];
|
||||
if((i+0) < (*pLength)) pDst[i+3] = pSrc[i+0];
|
||||
}
|
||||
#else
|
||||
pDst += USB_HWDESC_HEADER_LEN;
|
||||
ulLength -= USB_HWDESC_HEADER_LEN;
|
||||
|
||||
for( i=0 ; i<ulLength ; i+=4) {
|
||||
if((i+3) < ulLength) pDst[i+0] = pSrc[i+3];
|
||||
if((i+2) < ulLength) pDst[i+1] = pSrc[i+2];
|
||||
if((i+1) < ulLength) pDst[i+2] = pSrc[i+1];
|
||||
if((i+0) < ulLength) pDst[i+3] = pSrc[i+0];
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
//1(2) Append Zero
|
||||
if( ((*pLength) % 4) >0)
|
||||
{
|
||||
ulAppendBytes = 4-((*pLength) % 4);
|
||||
|
||||
for(i=0 ; i<ulAppendBytes; i++)
|
||||
pDst[ 4*((*pLength)/4) + i ] = 0x0;
|
||||
|
||||
*pLength += ulAppendBytes;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
RT_STATUS
|
||||
CmdSendPacket(
|
||||
PADAPTER Adapter,
|
||||
PRT_TCB pTcb,
|
||||
PRT_TX_LOCAL_BUFFER pBuf,
|
||||
u4Byte BufferLen,
|
||||
u4Byte PacketType,
|
||||
BOOLEAN bLastInitPacket
|
||||
)
|
||||
{
|
||||
s2Byte i;
|
||||
u1Byte QueueID;
|
||||
u2Byte firstDesc,curDesc = 0;
|
||||
u2Byte FragIndex=0, FragBufferIndex=0;
|
||||
|
||||
RT_STATUS rtStatus = RT_STATUS_SUCCESS;
|
||||
|
||||
CmdInitTCB(Adapter, pTcb, pBuf, BufferLen);
|
||||
|
||||
|
||||
if(CmdCheckFragment(Adapter, pTcb, pBuf))
|
||||
CmdFragmentTCB(Adapter, pTcb);
|
||||
else
|
||||
pTcb->FragLength[0] = (u2Byte)pTcb->BufferList[0].Length;
|
||||
|
||||
QueueID=pTcb->SpecifiedQueueID;
|
||||
#if DEV_BUS_TYPE!=USB_INTERFACE
|
||||
firstDesc=curDesc=Adapter->NextTxDescToFill[QueueID];
|
||||
#endif
|
||||
|
||||
#if DEV_BUS_TYPE!=USB_INTERFACE
|
||||
if(VacancyTxDescNum(Adapter, QueueID) > pTcb->BufferCount)
|
||||
#else
|
||||
if(PlatformIsTxQueueAvailable(Adapter, QueueID, pTcb->BufferCount) &&
|
||||
RTIsListEmpty(&Adapter->TcbWaitQueue[QueueID]))
|
||||
#endif
|
||||
{
|
||||
pTcb->nDescUsed=0;
|
||||
|
||||
for(i=0 ; i<pTcb->BufferCount ; i++)
|
||||
{
|
||||
Adapter->HalFunc.TxFillCmdDescHandler(
|
||||
Adapter,
|
||||
pTcb,
|
||||
QueueID, //QueueIndex
|
||||
curDesc, //index
|
||||
FragBufferIndex==0, //bFirstSeg
|
||||
FragBufferIndex==(pTcb->FragBufCount[FragIndex]-1), //bLastSeg
|
||||
pTcb->BufferList[i].VirtualAddress, //VirtualAddress
|
||||
pTcb->BufferList[i].PhysicalAddressLow, //PhyAddressLow
|
||||
pTcb->BufferList[i].Length, //BufferLen
|
||||
i!=0, //bSetOwnBit
|
||||
(i==(pTcb->BufferCount-1)) && bLastInitPacket, //bLastInitPacket
|
||||
PacketType, //DescPacketType
|
||||
pTcb->FragLength[FragIndex] //PktLen
|
||||
);
|
||||
|
||||
if(FragBufferIndex==(pTcb->FragBufCount[FragIndex]-1))
|
||||
{ // Last segment of the fragment.
|
||||
pTcb->nFragSent++;
|
||||
}
|
||||
|
||||
FragBufferIndex++;
|
||||
if(FragBufferIndex==pTcb->FragBufCount[FragIndex])
|
||||
{
|
||||
FragIndex++;
|
||||
FragBufferIndex=0;
|
||||
}
|
||||
|
||||
#if DEV_BUS_TYPE!=USB_INTERFACE
|
||||
curDesc=(curDesc+1)%Adapter->NumTxDesc[QueueID];
|
||||
#endif
|
||||
pTcb->nDescUsed++;
|
||||
}
|
||||
|
||||
#if DEV_BUS_TYPE!=USB_INTERFACE
|
||||
RTInsertTailList(&Adapter->TcbBusyQueue[QueueID], &pTcb->List);
|
||||
IncrementTxDescToFill(Adapter, QueueID, pTcb->nDescUsed);
|
||||
Adapter->HalFunc.SetTxDescOWNHandler(Adapter, QueueID, firstDesc);
|
||||
// TODO: should call poll use QueueID
|
||||
Adapter->HalFunc.TxPollingHandler(Adapter, TXCMD_QUEUE);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#if DEV_BUS_TYPE!=USB_INTERFACE
|
||||
goto CmdSendPacket_Fail;
|
||||
#else
|
||||
{
|
||||
pTcb->bLastInitPacket = bLastInitPacket;
|
||||
RTInsertTailList(&Adapter->TcbWaitQueue[pTcb->SpecifiedQueueID], &pTcb->List);
|
||||
}
|
||||
#endif
|
||||
|
||||
return rtStatus;
|
||||
|
||||
#if DEV_BUS_TYPE!=USB_INTERFACE
|
||||
CmdSendPacket_Fail:
|
||||
rtStatus = RT_STATUS_FAILURE;
|
||||
return rtStatus;
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
RT_STATUS
|
||||
FWSendNullPacket(
|
||||
IN PADAPTER Adapter,
|
||||
IN u4Byte Length
|
||||
)
|
||||
{
|
||||
RT_STATUS rtStatus = RT_STATUS_SUCCESS;
|
||||
|
||||
|
||||
PRT_TCB pTcb;
|
||||
PRT_TX_LOCAL_BUFFER pBuf;
|
||||
BOOLEAN bLastInitPacket = FALSE;
|
||||
|
||||
PlatformAcquireSpinLock(Adapter, RT_TX_SPINLOCK);
|
||||
|
||||
#if DEV_BUS_TYPE==USB_INTERFACE
|
||||
Length += USB_HWDESC_HEADER_LEN;
|
||||
#endif
|
||||
|
||||
//Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ)
|
||||
if(MgntGetBuffer(Adapter, &pTcb, &pBuf))
|
||||
{
|
||||
PlatformZeroMemory(pBuf->Buffer.VirtualAddress, Length);
|
||||
rtStatus = CmdSendPacket(Adapter, pTcb, pBuf, Length, DESC_PACKET_TYPE_INIT, bLastInitPacket); //0 : always set LastInitPacket to zero
|
||||
//#if HAL_CODE_BASE != RTL8190HW
|
||||
// // TODO: for test only
|
||||
// ReturnTCB(Adapter, pTcb, RT_STATUS_SUCCESS);
|
||||
//#endif
|
||||
if(rtStatus == RT_STATUS_FAILURE)
|
||||
goto CmdSendNullPacket_Fail;
|
||||
}else
|
||||
goto CmdSendNullPacket_Fail;
|
||||
|
||||
PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK);
|
||||
return rtStatus;
|
||||
|
||||
|
||||
CmdSendNullPacket_Fail:
|
||||
PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK);
|
||||
rtStatus = RT_STATUS_FAILURE;
|
||||
RT_ASSERT(rtStatus == RT_STATUS_SUCCESS, ("CmdSendDownloadCode fail !!\n"));
|
||||
return rtStatus;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -23,46 +23,5 @@ typedef enum _opt_rst_type{
|
|||
OPT_FIRMWARE_RESET = 1,
|
||||
}opt_rst_type_e;
|
||||
|
||||
#if 0
|
||||
/* CPU related */
|
||||
RT_STATUS
|
||||
CPUCheckMainCodeOKAndTurnOnCPU(
|
||||
IN PADAPTER Adapter
|
||||
);
|
||||
|
||||
RT_STATUS
|
||||
CPUCheckFirmwareReady(
|
||||
IN PADAPTER Adapter
|
||||
);
|
||||
|
||||
/* Firmware related */
|
||||
VOID
|
||||
FWInitializeParameters(
|
||||
IN PADAPTER Adapter
|
||||
);
|
||||
|
||||
RT_STATUS
|
||||
FWSendDownloadCode(
|
||||
IN PADAPTER Adapter,
|
||||
IN pu1Byte CodeVirtualAddrress,
|
||||
IN u4Byte BufferLen
|
||||
);
|
||||
|
||||
RT_STATUS
|
||||
FWSendNullPacket(
|
||||
IN PADAPTER Adapter,
|
||||
IN u4Byte Length
|
||||
);
|
||||
|
||||
RT_STATUS
|
||||
CmdSendPacket(
|
||||
PADAPTER Adapter,
|
||||
PRT_TCB pTcb,
|
||||
PRT_TX_LOCAL_BUFFER pBuf,
|
||||
u4Byte BufferLen,
|
||||
u4Byte PacketType,
|
||||
BOOLEAN bLastInitPacket
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1079,18 +1079,6 @@ bool rtl8192_SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eRFPowerS
|
|||
switch( eRFPowerState )
|
||||
{
|
||||
case eRfOn:
|
||||
#if 0
|
||||
rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x1); // 0x860[4]
|
||||
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0x300, 0x3); // 0x88c[4]
|
||||
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x60, 0x3); // 0x880[6:5]
|
||||
rtl8192_setBBreg(dev, rOFDM0_TRxPathEnable, 0xf, 0x3); // 0xc04[3:0]
|
||||
rtl8192_setBBreg(dev, rOFDM1_TRxPathEnable, 0xf, 0x3); // 0xd04[3:0]
|
||||
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0x7000, 0x3); // 0x884[14:12]
|
||||
// for(eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
|
||||
// PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x4, 0xC00, 0x2);
|
||||
|
||||
//SwChnl(Adapter->ChannelID);
|
||||
#endif
|
||||
//RF-A, RF-B
|
||||
//enable RF-Chip A/B
|
||||
rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x1); // 0x860[4]
|
||||
|
@ -1112,16 +1100,6 @@ bool rtl8192_SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eRFPowerS
|
|||
break;
|
||||
|
||||
case eRfOff:
|
||||
#if 0
|
||||
rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x0); // 0x860[4]
|
||||
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0x300, 0x0); // 0x88c[4]
|
||||
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x60, 0x0); // 0x880[6:5]
|
||||
rtl8192_setBBreg(dev, rOFDM0_TRxPathEnable, 0xf, 0); // 0xc04[3:0]
|
||||
rtl8192_setBBreg(dev, rOFDM1_TRxPathEnable, 0xf, 0); // 0xd04[3:0]
|
||||
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0x7000, 0x0); // 0x884[14:12]
|
||||
// for(eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
|
||||
// PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x4, 0xC00, 0x0);
|
||||
#endif
|
||||
//RF-A, RF-B
|
||||
//disable RF-Chip A/B
|
||||
rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x0); // 0x860[4]
|
||||
|
@ -1582,11 +1560,6 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
|
|||
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 1);
|
||||
|
||||
// Correct the tx power for CCK rate in 20M. Suggest by YN, 20071207
|
||||
#if 0
|
||||
write_nic_dword(dev, rCCK0_TxFilter1, 0x1a1b0000);
|
||||
write_nic_dword(dev, rCCK0_TxFilter2, 0x090e1317);
|
||||
write_nic_dword(dev, rCCK0_DebugPort, 0x00000204);
|
||||
#endif
|
||||
priv->cck_present_attentuation =
|
||||
priv->cck_present_attentuation_20Mdefault + priv->cck_present_attentuation_difference;
|
||||
|
||||
|
@ -1617,12 +1590,6 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
|
|||
rtl8192_setBBreg(dev, rCCK0_System, bCCKSideBand, (priv->nCur40MhzPrimeSC>>1));
|
||||
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 0);
|
||||
rtl8192_setBBreg(dev, rOFDM1_LSTF, 0xC00, priv->nCur40MhzPrimeSC);
|
||||
#if 0
|
||||
// Correct the tx power for CCK rate in 40M. Suggest by YN, 20071207
|
||||
write_nic_dword(dev, rCCK0_TxFilter1, 0x35360000);
|
||||
write_nic_dword(dev, rCCK0_TxFilter2, 0x121c252e);
|
||||
write_nic_dword(dev, rCCK0_DebugPort, 0x00000409);
|
||||
#endif
|
||||
priv->cck_present_attentuation =
|
||||
priv->cck_present_attentuation_40Mdefault + priv->cck_present_attentuation_difference;
|
||||
|
||||
|
@ -1653,7 +1620,6 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
|
|||
}
|
||||
//Skip over setting of J-mode in BB register here. Default value is "None J mode". Emily 20070315
|
||||
|
||||
#if 1
|
||||
//<3>Set RF related register
|
||||
switch( priv->rf_chip )
|
||||
{
|
||||
|
@ -1679,7 +1645,6 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
|
|||
RT_TRACE(COMP_ERR, "Unknown RFChipID: %d\n", priv->rf_chip);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
priv->SetBWModeInProgress= false;
|
||||
|
||||
RT_TRACE(COMP_SWBW, "<==SetBWMode819xUsb(), %d", atomic_read(&(priv->ieee80211->atm_swbw)) );
|
||||
|
@ -1726,29 +1691,15 @@ void InitialGain819xUsb(struct net_device *dev, u8 Operation)
|
|||
|
||||
if(priv->up)
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
queue_delayed_work(priv->priv_wq,&priv->initialgain_operate_wq,0);
|
||||
#else
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
schedule_task(&priv->initialgain_operate_wq);
|
||||
#else
|
||||
queue_work(priv->priv_wq,&priv->initialgain_operate_wq);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
extern void InitialGainOperateWorkItemCallBack(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *dwork = container_of(work,struct delayed_work,work);
|
||||
struct r8192_priv *priv = container_of(dwork,struct r8192_priv,initialgain_operate_wq);
|
||||
struct net_device *dev = priv->ieee80211->dev;
|
||||
#else
|
||||
extern void InitialGainOperateWorkItemCallBack(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
#endif
|
||||
#define SCAN_RX_INITIAL_GAIN 0x17
|
||||
#define POWER_DETECTION_TH 0x08
|
||||
u32 BitMask;
|
||||
|
|
|
@ -85,10 +85,6 @@ extern bool rtl8192_SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eR
|
|||
//added by amy
|
||||
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);
|
||||
#else
|
||||
extern void InitialGainOperateWorkItemCallBack(struct net_device *dev);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue