Staging: rtl8192u: remove bad whitespaces
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Родитель
f61fb9356d
Коммит
e406322b4b
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -126,15 +126,15 @@ f_mult (u8 a, u8 b)
|
|||
|
||||
#define f_rn(bo, bi, n, k) \
|
||||
bo[n] = ft_tab[0][byte(bi[n],0)] ^ \
|
||||
ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
|
||||
ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
|
||||
ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
|
||||
ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
|
||||
ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
|
||||
ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
|
||||
|
||||
#define i_rn(bo, bi, n, k) \
|
||||
bo[n] = it_tab[0][byte(bi[n],0)] ^ \
|
||||
it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
|
||||
it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
|
||||
it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
|
||||
it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
|
||||
it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
|
||||
it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
|
||||
|
||||
#define ls_box(x) \
|
||||
( fl_tab[0][byte(x, 0)] ^ \
|
||||
|
@ -144,15 +144,15 @@ f_mult (u8 a, u8 b)
|
|||
|
||||
#define f_rl(bo, bi, n, k) \
|
||||
bo[n] = fl_tab[0][byte(bi[n],0)] ^ \
|
||||
fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
|
||||
fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
|
||||
fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
|
||||
fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
|
||||
fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
|
||||
fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
|
||||
|
||||
#define i_rl(bo, bi, n, k) \
|
||||
bo[n] = il_tab[0][byte(bi[n],0)] ^ \
|
||||
il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
|
||||
il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
|
||||
il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
|
||||
il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
|
||||
il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
|
||||
il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
|
||||
|
||||
static void __init
|
||||
gen_tabs (void)
|
||||
|
@ -234,8 +234,8 @@ gen_tabs (void)
|
|||
t = w ^ (x); \
|
||||
(y) = u ^ v ^ w; \
|
||||
(y) ^= rotr(u ^ t, 8) ^ \
|
||||
rotr(v ^ t, 16) ^ \
|
||||
rotr(t,24)
|
||||
rotr(v ^ t, 16) ^ \
|
||||
rotr(t,24)
|
||||
|
||||
/* initialise the key schedule from the user supplied key */
|
||||
|
||||
|
@ -443,9 +443,9 @@ static struct crypto_alg aes_alg = {
|
|||
.cipher = {
|
||||
.cia_min_keysize = AES_MIN_KEY_SIZE,
|
||||
.cia_max_keysize = AES_MAX_KEY_SIZE,
|
||||
.cia_setkey = aes_set_key,
|
||||
.cia_encrypt = aes_encrypt,
|
||||
.cia_decrypt = aes_decrypt
|
||||
.cia_setkey = aes_set_key,
|
||||
.cia_encrypt = aes_encrypt,
|
||||
.cia_decrypt = aes_decrypt
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -79,9 +79,9 @@ static struct crypto_alg arc4_alg = {
|
|||
.cra_u = { .cipher = {
|
||||
.cia_min_keysize = ARC4_MIN_KEY_SIZE,
|
||||
.cia_max_keysize = ARC4_MAX_KEY_SIZE,
|
||||
.cia_setkey = arc4_set_key,
|
||||
.cia_encrypt = arc4_crypt,
|
||||
.cia_decrypt = arc4_crypt } }
|
||||
.cia_setkey = arc4_set_key,
|
||||
.cia_encrypt = arc4_crypt,
|
||||
.cia_decrypt = arc4_crypt } }
|
||||
};
|
||||
|
||||
static int __init arc4_init(void)
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
typedef void (cryptfn_t)(void *, u8 *, const u8 *);
|
||||
typedef void (procfn_t)(struct crypto_tfm *, u8 *,
|
||||
u8*, cryptfn_t, int enc, void *, int);
|
||||
u8*, cryptfn_t, int enc, void *, int);
|
||||
|
||||
static inline void xor_64(u8 *a, const u8 *b)
|
||||
{
|
||||
|
@ -48,8 +48,8 @@ static inline void xor_128(u8 *a, const u8 *b)
|
|||
static int crypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, cryptfn_t crfn,
|
||||
procfn_t prfn, int enc, void *info)
|
||||
unsigned int nbytes, cryptfn_t crfn,
|
||||
procfn_t prfn, int enc, void *info)
|
||||
{
|
||||
struct scatter_walk walk_in, walk_out;
|
||||
const unsigned int bsize = crypto_tfm_alg_blocksize(tfm);
|
||||
|
@ -136,80 +136,80 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
|
|||
return -EINVAL;
|
||||
} else
|
||||
return cia->cia_setkey(crypto_tfm_ctx(tfm), key, keylen,
|
||||
&tfm->crt_flags);
|
||||
&tfm->crt_flags);
|
||||
}
|
||||
|
||||
static int ecb_encrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src, unsigned int nbytes)
|
||||
struct scatterlist *src, unsigned int nbytes)
|
||||
{
|
||||
return crypt(tfm, dst, src, nbytes,
|
||||
tfm->__crt_alg->cra_cipher.cia_encrypt,
|
||||
ecb_process, 1, NULL);
|
||||
tfm->__crt_alg->cra_cipher.cia_encrypt,
|
||||
ecb_process, 1, NULL);
|
||||
}
|
||||
|
||||
static int ecb_decrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
return crypt(tfm, dst, src, nbytes,
|
||||
tfm->__crt_alg->cra_cipher.cia_decrypt,
|
||||
ecb_process, 1, NULL);
|
||||
tfm->__crt_alg->cra_cipher.cia_decrypt,
|
||||
ecb_process, 1, NULL);
|
||||
}
|
||||
|
||||
static int cbc_encrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
return crypt(tfm, dst, src, nbytes,
|
||||
tfm->__crt_alg->cra_cipher.cia_encrypt,
|
||||
cbc_process, 1, tfm->crt_cipher.cit_iv);
|
||||
tfm->__crt_alg->cra_cipher.cia_encrypt,
|
||||
cbc_process, 1, tfm->crt_cipher.cit_iv);
|
||||
}
|
||||
|
||||
static int cbc_encrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
{
|
||||
return crypt(tfm, dst, src, nbytes,
|
||||
tfm->__crt_alg->cra_cipher.cia_encrypt,
|
||||
cbc_process, 1, iv);
|
||||
tfm->__crt_alg->cra_cipher.cia_encrypt,
|
||||
cbc_process, 1, iv);
|
||||
}
|
||||
|
||||
static int cbc_decrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
return crypt(tfm, dst, src, nbytes,
|
||||
tfm->__crt_alg->cra_cipher.cia_decrypt,
|
||||
cbc_process, 0, tfm->crt_cipher.cit_iv);
|
||||
tfm->__crt_alg->cra_cipher.cia_decrypt,
|
||||
cbc_process, 0, tfm->crt_cipher.cit_iv);
|
||||
}
|
||||
|
||||
static int cbc_decrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
{
|
||||
return crypt(tfm, dst, src, nbytes,
|
||||
tfm->__crt_alg->cra_cipher.cia_decrypt,
|
||||
cbc_process, 0, iv);
|
||||
tfm->__crt_alg->cra_cipher.cia_decrypt,
|
||||
cbc_process, 0, iv);
|
||||
}
|
||||
|
||||
static int nocrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static int nocrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
@ -265,25 +265,25 @@ int crypto_init_cipher_ops(struct crypto_tfm *tfm)
|
|||
|
||||
if (ops->cit_mode == CRYPTO_TFM_MODE_CBC) {
|
||||
|
||||
switch (crypto_tfm_alg_blocksize(tfm)) {
|
||||
case 8:
|
||||
ops->cit_xor_block = xor_64;
|
||||
break;
|
||||
switch (crypto_tfm_alg_blocksize(tfm)) {
|
||||
case 8:
|
||||
ops->cit_xor_block = xor_64;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
ops->cit_xor_block = xor_128;
|
||||
break;
|
||||
case 16:
|
||||
ops->cit_xor_block = xor_128;
|
||||
break;
|
||||
|
||||
default:
|
||||
printk(KERN_WARNING "%s: block size %u not supported\n",
|
||||
crypto_tfm_alg_name(tfm),
|
||||
crypto_tfm_alg_blocksize(tfm));
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
default:
|
||||
printk(KERN_WARNING "%s: block size %u not supported\n",
|
||||
crypto_tfm_alg_name(tfm),
|
||||
crypto_tfm_alg_blocksize(tfm));
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ops->cit_ivsize = crypto_tfm_alg_blocksize(tfm);
|
||||
ops->cit_iv = kmalloc(ops->cit_ivsize, GFP_KERNEL);
|
||||
ops->cit_iv = kmalloc(ops->cit_ivsize, GFP_KERNEL);
|
||||
if (ops->cit_iv == NULL)
|
||||
ret = -ENOMEM;
|
||||
}
|
||||
|
|
|
@ -20,21 +20,21 @@
|
|||
#include "internal.h"
|
||||
|
||||
static int crypto_compress(struct crypto_tfm *tfm,
|
||||
const u8 *src, unsigned int slen,
|
||||
u8 *dst, unsigned int *dlen)
|
||||
const u8 *src, unsigned int slen,
|
||||
u8 *dst, unsigned int *dlen)
|
||||
{
|
||||
return tfm->__crt_alg->cra_compress.coa_compress(crypto_tfm_ctx(tfm),
|
||||
src, slen, dst,
|
||||
dlen);
|
||||
src, slen, dst,
|
||||
dlen);
|
||||
}
|
||||
|
||||
static int crypto_decompress(struct crypto_tfm *tfm,
|
||||
const u8 *src, unsigned int slen,
|
||||
u8 *dst, unsigned int *dlen)
|
||||
const u8 *src, unsigned int slen,
|
||||
u8 *dst, unsigned int *dlen)
|
||||
{
|
||||
return tfm->__crt_alg->cra_compress.coa_decompress(crypto_tfm_ctx(tfm),
|
||||
src, slen, dst,
|
||||
dlen);
|
||||
src, slen, dst,
|
||||
dlen);
|
||||
}
|
||||
|
||||
int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags)
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
#include <linux/crypto.h>
|
||||
|
||||
static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes);
|
||||
|
@ -22,9 +22,9 @@ static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
|
|||
|
||||
|
||||
static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes);
|
||||
|
|
|
@ -25,7 +25,7 @@ static void init(struct crypto_tfm *tfm)
|
|||
}
|
||||
|
||||
static void update(struct crypto_tfm *tfm,
|
||||
struct scatterlist *sg, unsigned int nsg)
|
||||
struct scatterlist *sg, unsigned int nsg)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -68,7 +68,7 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
|
|||
}
|
||||
|
||||
static void digest(struct crypto_tfm *tfm,
|
||||
struct scatterlist *sg, unsigned int nsg, u8 *out)
|
||||
struct scatterlist *sg, unsigned int nsg, u8 *out)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -77,7 +77,7 @@ static void digest(struct crypto_tfm *tfm,
|
|||
for (i = 0; i < nsg; i++) {
|
||||
char *p = crypto_kmap(sg[i].page, 0) + sg[i].offset;
|
||||
tfm->__crt_alg->cra_digest.dia_update(crypto_tfm_ctx(tfm),
|
||||
p, sg[i].length);
|
||||
p, sg[i].length);
|
||||
crypto_kunmap(p, 0);
|
||||
crypto_yield(tfm);
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -131,7 +131,7 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
|
|||
/*
|
||||
qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
|
||||
(WLAN_FC_GET_STYPE(fc) & 0x08));
|
||||
*/
|
||||
*/
|
||||
// fixed by David :2006.9.6
|
||||
qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
|
||||
(WLAN_FC_GET_STYPE(fc) & 0x80));
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "ieee80211.h"
|
||||
|
||||
#include <linux/crypto.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/crc32.h>
|
||||
|
||||
MODULE_AUTHOR("Jouni Malinen");
|
||||
|
@ -382,7 +382,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
|
|||
if (!tcb_desc->bHwSec)
|
||||
return ret;
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
@ -502,26 +502,26 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
|
|||
}
|
||||
|
||||
static int michael_mic(struct crypto_hash *tfm_michael, u8 * key, u8 * hdr,
|
||||
u8 * data, size_t data_len, u8 * mic)
|
||||
u8 * data, size_t data_len, u8 * mic)
|
||||
{
|
||||
struct hash_desc desc;
|
||||
struct scatterlist sg[2];
|
||||
struct hash_desc desc;
|
||||
struct scatterlist sg[2];
|
||||
|
||||
if (tfm_michael == NULL) {
|
||||
printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n");
|
||||
return -1;
|
||||
}
|
||||
if (tfm_michael == NULL) {
|
||||
printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
sg_init_table(sg, 2);
|
||||
sg_set_buf(&sg[0], hdr, 16);
|
||||
sg_set_buf(&sg[1], data, data_len);
|
||||
sg_init_table(sg, 2);
|
||||
sg_set_buf(&sg[0], hdr, 16);
|
||||
sg_set_buf(&sg[1], data, data_len);
|
||||
|
||||
if (crypto_hash_setkey(tfm_michael, key, 8))
|
||||
return -1;
|
||||
if (crypto_hash_setkey(tfm_michael, key, 8))
|
||||
return -1;
|
||||
|
||||
desc.tfm = tfm_michael;
|
||||
desc.flags = 0;
|
||||
return crypto_hash_digest(&desc, sg, data_len + 16, mic);
|
||||
desc.tfm = tfm_michael;
|
||||
desc.flags = 0;
|
||||
return crypto_hash_digest(&desc, sg, data_len + 16, mic);
|
||||
}
|
||||
|
||||
static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr)
|
||||
|
@ -630,7 +630,7 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
|
|||
|
||||
if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr,
|
||||
skb->data + hdr_len, skb->len - 8 - hdr_len, mic))
|
||||
return -1;
|
||||
return -1;
|
||||
if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) {
|
||||
struct ieee80211_hdr_4addr *hdr;
|
||||
hdr = (struct ieee80211_hdr_4addr *) skb->data;
|
||||
|
@ -760,7 +760,7 @@ static struct ieee80211_crypto_ops ieee80211_crypt_tkip = {
|
|||
.print_stats = ieee80211_tkip_print_stats,
|
||||
.extra_prefix_len = 4 + 4, /* IV + ExtIV */
|
||||
.extra_postfix_len = 8 + 4, /* MIC + ICV */
|
||||
.owner = THIS_MODULE,
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
int __init ieee80211_crypto_tkip_init(void)
|
||||
|
@ -776,5 +776,5 @@ void __exit ieee80211_crypto_tkip_exit(void)
|
|||
void ieee80211_tkip_null(void)
|
||||
{
|
||||
// printk("============>%s()\n", __FUNCTION__);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ struct prism2_wep_data {
|
|||
u8 key[WEP_KEY_LEN + 1];
|
||||
u8 key_len;
|
||||
u8 key_idx;
|
||||
struct crypto_blkcipher *tx_tfm;
|
||||
struct crypto_blkcipher *rx_tfm;
|
||||
struct crypto_blkcipher *tx_tfm;
|
||||
struct crypto_blkcipher *rx_tfm;
|
||||
};
|
||||
|
||||
|
||||
|
@ -50,19 +50,19 @@ static void * prism2_wep_init(int keyidx)
|
|||
priv->key_idx = keyidx;
|
||||
|
||||
priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
|
||||
if (IS_ERR(priv->tx_tfm)) {
|
||||
printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
|
||||
"crypto API arc4\n");
|
||||
priv->tx_tfm = NULL;
|
||||
goto fail;
|
||||
}
|
||||
priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
|
||||
if (IS_ERR(priv->rx_tfm)) {
|
||||
printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
|
||||
"crypto API arc4\n");
|
||||
priv->rx_tfm = NULL;
|
||||
goto fail;
|
||||
}
|
||||
if (IS_ERR(priv->tx_tfm)) {
|
||||
printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
|
||||
"crypto API arc4\n");
|
||||
priv->tx_tfm = NULL;
|
||||
goto fail;
|
||||
}
|
||||
priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
|
||||
if (IS_ERR(priv->rx_tfm)) {
|
||||
printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
|
||||
"crypto API arc4\n");
|
||||
priv->rx_tfm = NULL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* start WEP IV from a random value */
|
||||
get_random_bytes(&priv->iv, 4);
|
||||
|
@ -71,12 +71,12 @@ static void * prism2_wep_init(int keyidx)
|
|||
|
||||
fail:
|
||||
if (priv) {
|
||||
if (priv->tx_tfm)
|
||||
crypto_free_blkcipher(priv->tx_tfm);
|
||||
if (priv->rx_tfm)
|
||||
crypto_free_blkcipher(priv->rx_tfm);
|
||||
kfree(priv);
|
||||
}
|
||||
if (priv->tx_tfm)
|
||||
crypto_free_blkcipher(priv->tx_tfm);
|
||||
if (priv->rx_tfm)
|
||||
crypto_free_blkcipher(priv->rx_tfm);
|
||||
kfree(priv);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -87,11 +87,11 @@ static void prism2_wep_deinit(void *priv)
|
|||
struct prism2_wep_data *_priv = priv;
|
||||
|
||||
if (_priv) {
|
||||
if (_priv->tx_tfm)
|
||||
crypto_free_blkcipher(_priv->tx_tfm);
|
||||
if (_priv->rx_tfm)
|
||||
crypto_free_blkcipher(_priv->rx_tfm);
|
||||
}
|
||||
if (_priv->tx_tfm)
|
||||
crypto_free_blkcipher(_priv->tx_tfm);
|
||||
if (_priv->rx_tfm)
|
||||
crypto_free_blkcipher(_priv->rx_tfm);
|
||||
}
|
||||
kfree(priv);
|
||||
}
|
||||
|
||||
|
@ -293,5 +293,5 @@ void __exit ieee80211_crypto_wep_exit(void)
|
|||
void ieee80211_wep_null(void)
|
||||
{
|
||||
// printk("============>%s()\n", __FUNCTION__);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -150,11 +150,11 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
|
|||
atomic_set(&(ieee->atm_swbw), 0);
|
||||
|
||||
ieee->wpax_type_set = 0;
|
||||
ieee->wpa_enabled = 0;
|
||||
ieee->tkip_countermeasures = 0;
|
||||
ieee->drop_unencrypted = 0;
|
||||
ieee->privacy_invoked = 0;
|
||||
ieee->ieee802_1x = 1;
|
||||
ieee->wpa_enabled = 0;
|
||||
ieee->tkip_countermeasures = 0;
|
||||
ieee->drop_unencrypted = 0;
|
||||
ieee->privacy_invoked = 0;
|
||||
ieee->ieee802_1x = 1;
|
||||
ieee->raw_tx = 0;
|
||||
//ieee->hwsec_support = 1; //defalt support hw security. //use module_param instead.
|
||||
ieee->hwsec_active = 0; //disable hwsec, switch it on when necessary.
|
||||
|
|
|
@ -133,14 +133,14 @@ void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p) {
|
|||
void ieee80211_TURBO_Info(struct ieee80211_device *ieee, u8 **tag_p) {
|
||||
u8 *tag = *tag_p;
|
||||
|
||||
*tag++ = MFIE_TYPE_GENERIC; //0
|
||||
*tag++ = 7;
|
||||
*tag++ = 0x00;
|
||||
*tag++ = 0xe0;
|
||||
*tag++ = 0x4c;
|
||||
*tag++ = 0x01;//5
|
||||
*tag++ = 0x02;
|
||||
*tag++ = 0x11;
|
||||
*tag++ = MFIE_TYPE_GENERIC; //0
|
||||
*tag++ = 7;
|
||||
*tag++ = 0x00;
|
||||
*tag++ = 0xe0;
|
||||
*tag++ = 0x4c;
|
||||
*tag++ = 0x01;//5
|
||||
*tag++ = 0x02;
|
||||
*tag++ = 0x11;
|
||||
*tag++ = 0x00;
|
||||
|
||||
*tag_p = tag;
|
||||
|
@ -238,9 +238,9 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee
|
|||
|
||||
tcb_desc->queue_index = MGNT_QUEUE;
|
||||
tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee);
|
||||
tcb_desc->RATRIndex = 7;
|
||||
tcb_desc->bTxDisableRateFallBack = 1;
|
||||
tcb_desc->bTxUseDriverAssingedRate = 1;
|
||||
tcb_desc->RATRIndex = 7;
|
||||
tcb_desc->bTxDisableRateFallBack = 1;
|
||||
tcb_desc->bTxUseDriverAssingedRate = 1;
|
||||
|
||||
if(single){
|
||||
if(ieee->queue_stop){
|
||||
|
@ -525,8 +525,8 @@ void ieee80211_softmac_scan(struct ieee80211_device *ieee)
|
|||
#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);
|
||||
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)
|
||||
{
|
||||
|
@ -546,7 +546,7 @@ void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee)
|
|||
{
|
||||
//if current channel is not in channel map, set to default channel.
|
||||
#ifdef ENABLE_DOT11D
|
||||
if (!channel_map[ieee->current_network.channel]);
|
||||
if (!channel_map[ieee->current_network.channel]);
|
||||
#else
|
||||
if (!ieee->channel_map[ieee->current_network.channel]);
|
||||
#endif
|
||||
|
@ -554,7 +554,7 @@ void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee)
|
|||
goto out; /* no good chans */
|
||||
}
|
||||
#ifdef ENABLE_DOT11D
|
||||
}while(!channel_map[ieee->current_network.channel]);
|
||||
}while(!channel_map[ieee->current_network.channel]);
|
||||
#else
|
||||
}while(!ieee->channel_map[ieee->current_network.channel]);
|
||||
#endif
|
||||
|
@ -582,7 +582,7 @@ out:
|
|||
if(IS_DOT11D_ENABLE(ieee))
|
||||
DOT11D_ScanComplete(ieee);
|
||||
#endif
|
||||
ieee->actscanning = false;
|
||||
ieee->actscanning = false;
|
||||
watchdog = 0;
|
||||
ieee->scanning = 0;
|
||||
up(&ieee->scan_sem);
|
||||
|
@ -619,7 +619,7 @@ void ieee80211_beacons_stop(struct ieee80211_device *ieee)
|
|||
spin_lock_irqsave(&ieee->beacon_lock,flags);
|
||||
|
||||
ieee->beacon_txing = 0;
|
||||
del_timer_sync(&ieee->beacon_timer);
|
||||
del_timer_sync(&ieee->beacon_timer);
|
||||
|
||||
spin_unlock_irqrestore(&ieee->beacon_lock,flags);
|
||||
|
||||
|
@ -807,12 +807,12 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
erp_len = 0;
|
||||
#else
|
||||
if((ieee->current_network.mode == IEEE_G)
|
||||
||( ieee->current_network.mode == IEEE_N_24G && ieee->pHTInfo->bCurSuppCCK)) {
|
||||
erp_len = 3;
|
||||
||( 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
|
||||
|
@ -833,12 +833,12 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt);
|
||||
|
||||
|
||||
if(pHTInfo->bRegRT2RTAggregation)
|
||||
{
|
||||
tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer;
|
||||
if(pHTInfo->bRegRT2RTAggregation)
|
||||
{
|
||||
tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer;
|
||||
tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer);
|
||||
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+
|
||||
|
@ -848,7 +848,7 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
|
|||
+rate_ex_len
|
||||
+atim_len
|
||||
+erp_len
|
||||
+wpa_ie_len
|
||||
+wpa_ie_len
|
||||
// +tmp_ht_cap_len
|
||||
// +tmp_ht_info_len
|
||||
// +tmp_generic_ie_len
|
||||
|
@ -1187,7 +1187,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
|
|||
+ wpa_ie_len
|
||||
+ wmm_info_len
|
||||
+ turbo_info_len
|
||||
+ ht_cap_len
|
||||
+ ht_cap_len
|
||||
+ realtek_ie_len
|
||||
+ ckip_ie_len
|
||||
+ ccxrm_ie_len
|
||||
|
@ -1199,7 +1199,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
|
|||
+ rate_len//rates tagged val
|
||||
+ wpa_ie_len
|
||||
+ wmm_info_len
|
||||
+ ht_cap_len
|
||||
+ ht_cap_len
|
||||
+ realtek_ie_len
|
||||
+ ckip_ie_len
|
||||
+ ccxrm_ie_len
|
||||
|
@ -1235,7 +1235,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
|
|||
|
||||
if(ieee->short_slot)
|
||||
hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT);
|
||||
if (wmm_info_len) //QOS
|
||||
if (wmm_info_len) //QOS
|
||||
hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_QOS);
|
||||
|
||||
hdr->listen_interval = 0xa; //FIXME
|
||||
|
@ -1304,7 +1304,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
|
|||
memcpy(tag,osCcxVerNum.Octet,osCcxVerNum.Length);
|
||||
tag += osCcxVerNum.Length;
|
||||
}
|
||||
//HT cap element
|
||||
//HT cap element
|
||||
if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){
|
||||
if(ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC)
|
||||
{
|
||||
|
@ -1329,9 +1329,9 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
|
|||
}
|
||||
#ifdef THOMAS_TURBO
|
||||
tag = skb_put(skb,turbo_info_len);
|
||||
if(turbo_info_len) {
|
||||
ieee80211_TURBO_Info(ieee, &tag);
|
||||
}
|
||||
if(turbo_info_len) {
|
||||
ieee80211_TURBO_Info(ieee, &tag);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){
|
||||
|
@ -1382,7 +1382,7 @@ void ieee80211_associate_abort(struct ieee80211_device *ieee)
|
|||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
queue_delayed_work(ieee->wq, &ieee->associate_retry_wq, \
|
||||
IEEE80211_SOFTMAC_ASSOC_RETRY_TIME);
|
||||
IEEE80211_SOFTMAC_ASSOC_RETRY_TIME);
|
||||
#else
|
||||
schedule_task(&ieee->associate_retry_wq);
|
||||
#endif
|
||||
|
@ -1482,7 +1482,7 @@ void ieee80211_associate_step2(struct ieee80211_device *ieee)
|
|||
#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);
|
||||
struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_complete_wq);
|
||||
#else
|
||||
void ieee80211_associate_complete_wq(struct ieee80211_device *ieee)
|
||||
{
|
||||
|
@ -1567,7 +1567,7 @@ void ieee80211_associate_complete(struct ieee80211_device *ieee)
|
|||
#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);
|
||||
struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_procedure_wq);
|
||||
#else
|
||||
void ieee80211_associate_procedure_wq(struct ieee80211_device *ieee)
|
||||
{
|
||||
|
@ -1623,7 +1623,7 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee
|
|||
|
||||
|
||||
if ( /* if the user set the AP check if match.
|
||||
* if the network does not broadcast essid we check the user supplyed ANY essid
|
||||
* if the network does not broadcast essid we check the user supplyed ANY essid
|
||||
* if the network does broadcast and the user does not set essid it is OK
|
||||
* if the network does broadcast and the user did set essid chech if essid match
|
||||
*/
|
||||
|
@ -1837,8 +1837,8 @@ static inline u16 assoc_parse(struct ieee80211_device *ieee, struct sk_buff *skb
|
|||
status_code==WLAN_STATUS_CAPS_UNSUPPORTED)&&
|
||||
((ieee->mode == IEEE_G) &&
|
||||
(ieee->current_network.mode == IEEE_N_24G) &&
|
||||
(ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) {
|
||||
ieee->pHTInfo->IOTAction |= HT_IOT_ACT_PURE_N_MODE;
|
||||
(ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) {
|
||||
ieee->pHTInfo->IOTAction |= HT_IOT_ACT_PURE_N_MODE;
|
||||
}else {
|
||||
ieee->AsocRetryCount = 0;
|
||||
}
|
||||
|
@ -2535,8 +2535,8 @@ void ieee80211_start_monitor_mode(struct ieee80211_device *ieee)
|
|||
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);
|
||||
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)
|
||||
{
|
||||
|
@ -2843,7 +2843,7 @@ void ieee80211_softmac_start_protocol(struct ieee80211_device *ieee)
|
|||
void ieee80211_start_protocol(struct ieee80211_device *ieee)
|
||||
{
|
||||
short ch = 0;
|
||||
int i = 0;
|
||||
int i = 0;
|
||||
if (ieee->proto_started)
|
||||
return;
|
||||
|
||||
|
@ -2867,7 +2867,7 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
|
|||
// printk("===>%s(), chan:%d\n", __FUNCTION__, ieee->current_network.channel);
|
||||
// ieee->set_chan(ieee->dev,ieee->current_network.channel);
|
||||
|
||||
for(i = 0; i < 17; i++) {
|
||||
for(i = 0; i < 17; i++) {
|
||||
ieee->last_rxseq_num[i] = -1;
|
||||
ieee->last_rxfrag_num[i] = -1;
|
||||
ieee->last_packet_time[i] = 0;
|
||||
|
@ -2915,7 +2915,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
|
|||
//added for AP roaming
|
||||
ieee->LinkDetectInfo.SlotNum = 2;
|
||||
ieee->LinkDetectInfo.NumRecvBcnInPeriod=0;
|
||||
ieee->LinkDetectInfo.NumRecvDataInPeriod=0;
|
||||
ieee->LinkDetectInfo.NumRecvDataInPeriod=0;
|
||||
|
||||
ieee->assoc_id = 0;
|
||||
ieee->queue_stop = 0;
|
||||
|
@ -2968,12 +2968,12 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
|
|||
|
||||
#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);
|
||||
INIT_DELAYED_WORK(&ieee->softmac_scan_wq,ieee80211_softmac_scan_wq);
|
||||
INIT_DELAYED_WORK(&ieee->associate_retry_wq, ieee80211_associate_retry_wq);
|
||||
INIT_WORK(&ieee->wx_sync_scan_wq,ieee80211_wx_sync_scan_wq);
|
||||
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);
|
||||
INIT_DELAYED_WORK(&ieee->softmac_scan_wq,ieee80211_softmac_scan_wq);
|
||||
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);
|
||||
|
@ -3165,7 +3165,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name, u32 v
|
|||
.flags = SEC_ENABLED,
|
||||
.enabled = value,
|
||||
};
|
||||
ieee->drop_unencrypted = value;
|
||||
ieee->drop_unencrypted = value;
|
||||
/* We only change SEC_LEVEL for open mode. Others
|
||||
* are set by ipw_wpa_set_encryption.
|
||||
*/
|
||||
|
|
|
@ -316,7 +316,7 @@ out:
|
|||
#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);
|
||||
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)
|
||||
{
|
||||
|
@ -641,7 +641,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
|
|||
}
|
||||
|
||||
if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST))
|
||||
wrqu->power.flags |= IW_POWER_ALL_R;
|
||||
wrqu->power.flags |= IW_POWER_ALL_R;
|
||||
else if (ieee->ps & IEEE80211_PS_MBCAST)
|
||||
wrqu->power.flags |= IW_POWER_MULTICAST_R;
|
||||
else
|
||||
|
|
|
@ -56,18 +56,18 @@ struct modes_unit ieee80211_modes[] = {
|
|||
#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 */
|
||||
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;
|
||||
/* 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;
|
||||
memcpy(stream, (char *) iwe, event_len);
|
||||
stream += event_len;
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
#else
|
||||
#define iwe_stream_add_event_rsl iwe_stream_add_event
|
||||
|
@ -75,9 +75,9 @@ iwe_stream_add_event_rsl(char * stream, /* Stream of events */
|
|||
|
||||
#define MAX_CUSTOM_LEN 64
|
||||
static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
||||
char *start, char *stop,
|
||||
char *start, char *stop,
|
||||
struct ieee80211_network *network,
|
||||
struct iw_request_info *info)
|
||||
struct iw_request_info *info)
|
||||
{
|
||||
char custom[MAX_CUSTOM_LEN];
|
||||
char proto_name[IFNAMSIZ];
|
||||
|
@ -106,18 +106,18 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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>");
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>");
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, "<hidden>");
|
||||
start = iwe_stream_add_point(start, stop, &iwe, "<hidden>");
|
||||
#endif
|
||||
} else {
|
||||
} 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);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, network->ssid);
|
||||
start = iwe_stream_add_point(start, stop, &iwe, network->ssid);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/* Add the protocol name */
|
||||
iwe.cmd = SIOCGIWNAME;
|
||||
for(i=0; i<(sizeof(ieee80211_modes)/sizeof(ieee80211_modes[0])); i++) {
|
||||
|
@ -129,26 +129,26 @@ 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);
|
||||
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);
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_CHAR_LEN);
|
||||
#endif
|
||||
/* Add mode */
|
||||
iwe.cmd = SIOCGIWMODE;
|
||||
if (network->capability &
|
||||
/* Add mode */
|
||||
iwe.cmd = SIOCGIWMODE;
|
||||
if (network->capability &
|
||||
(WLAN_CAPABILITY_BSS | WLAN_CAPABILITY_IBSS)) {
|
||||
if (network->capability & WLAN_CAPABILITY_BSS)
|
||||
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);
|
||||
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);
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_UINT_LEN);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* Add frequency/channel */
|
||||
/* Add frequency/channel */
|
||||
iwe.cmd = SIOCGIWFREQ;
|
||||
/* iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode);
|
||||
iwe.u.freq.e = 3; */
|
||||
|
@ -156,9 +156,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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);
|
||||
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);
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_FREQ_LEN);
|
||||
#endif
|
||||
/* Add encryption capability */
|
||||
iwe.cmd = SIOCGIWENCODE;
|
||||
|
@ -168,9 +168,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, network->ssid);
|
||||
start = iwe_stream_add_point(start, stop, &iwe, network->ssid);
|
||||
#endif
|
||||
/* Add basic and extended rates */
|
||||
max_rate = 0;
|
||||
|
@ -228,19 +228,19 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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,
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe,
|
||||
IW_EV_PARAM_LEN);
|
||||
#else
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe,
|
||||
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);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, custom);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, custom);
|
||||
start = iwe_stream_add_point(start, stop, &iwe, custom);
|
||||
#endif
|
||||
/* Add quality statistics */
|
||||
/* TODO: Fix these values... */
|
||||
|
@ -257,9 +257,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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);
|
||||
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);
|
||||
start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_QUAL_LEN);
|
||||
#endif
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
p = custom;
|
||||
|
@ -267,9 +267,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, custom);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, custom);
|
||||
start = iwe_stream_add_point(start, stop, &iwe, custom);
|
||||
#endif
|
||||
#if (WIRELESS_EXT < 18)
|
||||
if (ieee->wpa_enabled && network->wpa_ie_len){
|
||||
|
@ -285,11 +285,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (ieee->wpa_enabled && network->rsn_ie_len){
|
||||
char buf[MAX_WPA_IE_LEN * 2 + 30];
|
||||
|
@ -304,11 +304,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#else
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
if (network->wpa_ie_len)
|
||||
|
@ -318,11 +318,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
if (network->rsn_ie_len)
|
||||
{
|
||||
|
@ -331,11 +331,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
start = iwe_stream_add_point(start, stop, &iwe, buf);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -348,9 +348,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
|
|||
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);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, custom);
|
||||
#else
|
||||
start = iwe_stream_add_point(start, stop, &iwe, custom);
|
||||
start = iwe_stream_add_point(start, stop, &iwe, custom);
|
||||
#endif
|
||||
|
||||
return start;
|
||||
|
@ -516,7 +516,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
|
|||
key, escape_essid(sec.keys[key], len),
|
||||
erq->length, len);
|
||||
sec.key_sizes[key] = len;
|
||||
(*crypt)->ops->set_key(sec.keys[key], len, NULL,
|
||||
(*crypt)->ops->set_key(sec.keys[key], len, NULL,
|
||||
(*crypt)->priv);
|
||||
sec.flags |= (1 << key);
|
||||
/* This ensures a key will be activated if no key is
|
||||
|
@ -634,192 +634,192 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
|
|||
}
|
||||
#if (WIRELESS_EXT >= 18)
|
||||
int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
struct iw_request_info *info,
|
||||
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;
|
||||
int i, idx;
|
||||
int group_key = 0;
|
||||
const char *alg, *module;
|
||||
struct ieee80211_crypto_ops *ops;
|
||||
struct ieee80211_crypt_data **crypt;
|
||||
struct iw_point *encoding = &wrqu->encoding;
|
||||
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
|
||||
int i, idx;
|
||||
int group_key = 0;
|
||||
const char *alg, *module;
|
||||
struct ieee80211_crypto_ops *ops;
|
||||
struct ieee80211_crypt_data **crypt;
|
||||
|
||||
struct ieee80211_security sec = {
|
||||
.flags = 0,
|
||||
};
|
||||
struct ieee80211_security sec = {
|
||||
.flags = 0,
|
||||
};
|
||||
//printk("======>encoding flag:%x,ext flag:%x, ext alg:%d\n", encoding->flags,ext->ext_flags, ext->alg);
|
||||
idx = encoding->flags & IW_ENCODE_INDEX;
|
||||
if (idx) {
|
||||
if (idx < 1 || idx > WEP_KEYS)
|
||||
return -EINVAL;
|
||||
idx--;
|
||||
} else
|
||||
idx = ieee->tx_keyidx;
|
||||
idx = encoding->flags & IW_ENCODE_INDEX;
|
||||
if (idx) {
|
||||
if (idx < 1 || idx > WEP_KEYS)
|
||||
return -EINVAL;
|
||||
idx--;
|
||||
} else
|
||||
idx = ieee->tx_keyidx;
|
||||
|
||||
if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
|
||||
if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
|
||||
|
||||
crypt = &ieee->crypt[idx];
|
||||
crypt = &ieee->crypt[idx];
|
||||
|
||||
group_key = 1;
|
||||
} else {
|
||||
/* some Cisco APs use idx>0 for unicast in dynamic WEP */
|
||||
group_key = 1;
|
||||
} else {
|
||||
/* some Cisco APs use idx>0 for unicast in dynamic WEP */
|
||||
//printk("not group key, flags:%x, ext->alg:%d\n", ext->ext_flags, ext->alg);
|
||||
if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP)
|
||||
return -EINVAL;
|
||||
if (ieee->iw_mode == IW_MODE_INFRA)
|
||||
if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP)
|
||||
return -EINVAL;
|
||||
if (ieee->iw_mode == IW_MODE_INFRA)
|
||||
|
||||
crypt = &ieee->crypt[idx];
|
||||
crypt = &ieee->crypt[idx];
|
||||
|
||||
else
|
||||
return -EINVAL;
|
||||
}
|
||||
else
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
sec.flags |= SEC_ENABLED;// | SEC_ENCRYPT;
|
||||
if ((encoding->flags & IW_ENCODE_DISABLED) ||
|
||||
ext->alg == IW_ENCODE_ALG_NONE) {
|
||||
if (*crypt)
|
||||
ieee80211_crypt_delayed_deinit(ieee, crypt);
|
||||
sec.flags |= SEC_ENABLED;// | SEC_ENCRYPT;
|
||||
if ((encoding->flags & IW_ENCODE_DISABLED) ||
|
||||
ext->alg == IW_ENCODE_ALG_NONE) {
|
||||
if (*crypt)
|
||||
ieee80211_crypt_delayed_deinit(ieee, crypt);
|
||||
|
||||
for (i = 0; i < WEP_KEYS; i++)
|
||||
for (i = 0; i < WEP_KEYS; i++)
|
||||
|
||||
if (ieee->crypt[i] != NULL)
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
if (i == WEP_KEYS) {
|
||||
sec.enabled = 0;
|
||||
// sec.encrypt = 0;
|
||||
sec.level = SEC_LEVEL_0;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
}
|
||||
if (i == WEP_KEYS) {
|
||||
sec.enabled = 0;
|
||||
// sec.encrypt = 0;
|
||||
sec.level = SEC_LEVEL_0;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
}
|
||||
//printk("disabled: flag:%x\n", encoding->flags);
|
||||
goto done;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
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;
|
||||
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";
|
||||
module = "ieee80211_crypt_wep";
|
||||
break;
|
||||
case IW_ENCODE_ALG_TKIP:
|
||||
alg = "TKIP";
|
||||
module = "ieee80211_crypt_tkip";
|
||||
break;
|
||||
case IW_ENCODE_ALG_CCMP:
|
||||
alg = "CCMP";
|
||||
module = "ieee80211_crypt_ccmp";
|
||||
break;
|
||||
default:
|
||||
IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n",
|
||||
dev->name, ext->alg);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
switch (ext->alg) {
|
||||
case IW_ENCODE_ALG_WEP:
|
||||
alg = "WEP";
|
||||
module = "ieee80211_crypt_wep";
|
||||
break;
|
||||
case IW_ENCODE_ALG_TKIP:
|
||||
alg = "TKIP";
|
||||
module = "ieee80211_crypt_tkip";
|
||||
break;
|
||||
case IW_ENCODE_ALG_CCMP:
|
||||
alg = "CCMP";
|
||||
module = "ieee80211_crypt_ccmp";
|
||||
break;
|
||||
default:
|
||||
IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n",
|
||||
dev->name, ext->alg);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
printk("alg name:%s\n",alg);
|
||||
|
||||
ops = ieee80211_get_crypto_ops(alg);
|
||||
if (ops == NULL) {
|
||||
request_module(module);
|
||||
ops = ieee80211_get_crypto_ops(alg);
|
||||
}
|
||||
if (ops == NULL) {
|
||||
IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n",
|
||||
dev->name, ext->alg);
|
||||
if (ops == NULL) {
|
||||
request_module(module);
|
||||
ops = ieee80211_get_crypto_ops(alg);
|
||||
}
|
||||
if (ops == NULL) {
|
||||
IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n",
|
||||
dev->name, ext->alg);
|
||||
printk("========>unknown crypto alg %d\n", ext->alg);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (*crypt == NULL || (*crypt)->ops != ops) {
|
||||
struct ieee80211_crypt_data *new_crypt;
|
||||
if (*crypt == NULL || (*crypt)->ops != ops) {
|
||||
struct ieee80211_crypt_data *new_crypt;
|
||||
|
||||
ieee80211_crypt_delayed_deinit(ieee, crypt);
|
||||
ieee80211_crypt_delayed_deinit(ieee, crypt);
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
|
||||
new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
|
||||
new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
|
||||
#else
|
||||
new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
|
||||
new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
|
||||
memset(new_crypt,0,sizeof(*new_crypt));
|
||||
#endif
|
||||
if (new_crypt == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
new_crypt->ops = ops;
|
||||
if (new_crypt->ops && try_module_get(new_crypt->ops->owner))
|
||||
new_crypt->priv = new_crypt->ops->init(idx);
|
||||
if (new_crypt->priv == NULL) {
|
||||
kfree(new_crypt);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
*crypt = new_crypt;
|
||||
if (new_crypt == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
new_crypt->ops = ops;
|
||||
if (new_crypt->ops && try_module_get(new_crypt->ops->owner))
|
||||
new_crypt->priv = new_crypt->ops->init(idx);
|
||||
if (new_crypt->priv == NULL) {
|
||||
kfree(new_crypt);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
*crypt = new_crypt;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (ext->key_len > 0 && (*crypt)->ops->set_key &&
|
||||
(*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq,
|
||||
(*crypt)->priv) < 0) {
|
||||
IEEE80211_DEBUG_WX("%s: key setting failed\n", dev->name);
|
||||
if (ext->key_len > 0 && (*crypt)->ops->set_key &&
|
||||
(*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq,
|
||||
(*crypt)->priv) < 0) {
|
||||
IEEE80211_DEBUG_WX("%s: key setting failed\n", dev->name);
|
||||
printk("key setting failed\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
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) {
|
||||
ieee->tx_keyidx = idx;
|
||||
sec.active_key = idx;
|
||||
sec.flags |= SEC_ACTIVE_KEY;
|
||||
}
|
||||
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
|
||||
ieee->tx_keyidx = idx;
|
||||
sec.active_key = idx;
|
||||
sec.flags |= SEC_ACTIVE_KEY;
|
||||
}
|
||||
|
||||
if (ext->alg != IW_ENCODE_ALG_NONE) {
|
||||
//memcpy(sec.keys[idx], ext->key, ext->key_len);
|
||||
sec.key_sizes[idx] = ext->key_len;
|
||||
sec.flags |= (1 << idx);
|
||||
if (ext->alg == IW_ENCODE_ALG_WEP) {
|
||||
// sec.encode_alg[idx] = SEC_ALG_WEP;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
sec.level = SEC_LEVEL_1;
|
||||
} else if (ext->alg == IW_ENCODE_ALG_TKIP) {
|
||||
// sec.encode_alg[idx] = SEC_ALG_TKIP;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
sec.level = SEC_LEVEL_2;
|
||||
} else if (ext->alg == IW_ENCODE_ALG_CCMP) {
|
||||
// sec.encode_alg[idx] = SEC_ALG_CCMP;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
sec.level = SEC_LEVEL_3;
|
||||
}
|
||||
/* Don't set sec level for group keys. */
|
||||
if (group_key)
|
||||
sec.flags &= ~SEC_LEVEL;
|
||||
}
|
||||
if (ext->alg != IW_ENCODE_ALG_NONE) {
|
||||
//memcpy(sec.keys[idx], ext->key, ext->key_len);
|
||||
sec.key_sizes[idx] = ext->key_len;
|
||||
sec.flags |= (1 << idx);
|
||||
if (ext->alg == IW_ENCODE_ALG_WEP) {
|
||||
// sec.encode_alg[idx] = SEC_ALG_WEP;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
sec.level = SEC_LEVEL_1;
|
||||
} else if (ext->alg == IW_ENCODE_ALG_TKIP) {
|
||||
// sec.encode_alg[idx] = SEC_ALG_TKIP;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
sec.level = SEC_LEVEL_2;
|
||||
} else if (ext->alg == IW_ENCODE_ALG_CCMP) {
|
||||
// sec.encode_alg[idx] = SEC_ALG_CCMP;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
sec.level = SEC_LEVEL_3;
|
||||
}
|
||||
/* Don't set sec level for group keys. */
|
||||
if (group_key)
|
||||
sec.flags &= ~SEC_LEVEL;
|
||||
}
|
||||
#endif
|
||||
done:
|
||||
if (ieee->set_security)
|
||||
ieee->set_security(ieee->dev, &sec);
|
||||
if (ieee->set_security)
|
||||
ieee->set_security(ieee->dev, &sec);
|
||||
|
||||
if (ieee->reset_on_keychange &&
|
||||
ieee->iw_mode != IW_MODE_INFRA &&
|
||||
ieee->reset_port && ieee->reset_port(dev)) {
|
||||
IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
ieee->iw_mode != IW_MODE_INFRA &&
|
||||
ieee->reset_port && ieee->reset_port(dev)) {
|
||||
IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
|
||||
|
@ -878,46 +878,46 @@ int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
|
|||
}
|
||||
|
||||
int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
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:
|
||||
case IW_MLME_DEAUTH:
|
||||
case IW_MLME_DISASSOC:
|
||||
ieee80211_disassociate(ieee);
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
|
||||
struct iw_request_info *info,
|
||||
struct iw_param *data, char *extra)
|
||||
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:
|
||||
case IW_AUTH_WPA_VERSION:
|
||||
/*need to support wpa2 here*/
|
||||
//printk("wpa version:%x\n", data->value);
|
||||
break;
|
||||
case IW_AUTH_CIPHER_PAIRWISE:
|
||||
case IW_AUTH_CIPHER_GROUP:
|
||||
case IW_AUTH_KEY_MGMT:
|
||||
/*
|
||||
case IW_AUTH_CIPHER_PAIRWISE:
|
||||
case IW_AUTH_CIPHER_GROUP:
|
||||
case IW_AUTH_KEY_MGMT:
|
||||
/*
|
||||
* * Host AP driver does not use these parameters and allows
|
||||
* * wpa_supplicant to control them internally.
|
||||
* */
|
||||
break;
|
||||
case IW_AUTH_TKIP_COUNTERMEASURES:
|
||||
ieee->tkip_countermeasures = data->value;
|
||||
break;
|
||||
case IW_AUTH_DROP_UNENCRYPTED:
|
||||
ieee->drop_unencrypted = data->value;
|
||||
break;
|
||||
case IW_AUTH_TKIP_COUNTERMEASURES:
|
||||
ieee->tkip_countermeasures = data->value;
|
||||
break;
|
||||
case IW_AUTH_DROP_UNENCRYPTED:
|
||||
ieee->drop_unencrypted = data->value;
|
||||
break;
|
||||
|
||||
case IW_AUTH_80211_AUTH_ALG:
|
||||
|
@ -949,13 +949,13 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
|
|||
|
||||
#endif
|
||||
case IW_AUTH_RX_UNENCRYPTED_EAPOL:
|
||||
ieee->ieee802_1x = data->value;
|
||||
ieee->ieee802_1x = data->value;
|
||||
break;
|
||||
case IW_AUTH_PRIVACY_INVOKED:
|
||||
ieee->privacy_invoked = data->value;
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
|
|
@ -73,7 +73,7 @@ static int c_show(struct seq_file *m, void *p)
|
|||
seq_printf(m, "type : digest\n");
|
||||
seq_printf(m, "blocksize : %u\n", alg->cra_blocksize);
|
||||
seq_printf(m, "digestsize : %u\n",
|
||||
alg->cra_digest.dia_digestsize);
|
||||
alg->cra_digest.dia_digestsize);
|
||||
break;
|
||||
case CRYPTO_ALG_TYPE_COMPRESS:
|
||||
seq_printf(m, "type : compression\n");
|
||||
|
|
|
@ -437,7 +437,7 @@ extern u8 MCS_FILTER_1SS[16];
|
|||
|
||||
// MCS Bw 40 {1~7, 12~15,32}
|
||||
#define RATE_ADPT_1SS_MASK 0xFF
|
||||
#define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily
|
||||
#define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily
|
||||
#define RATE_ADPT_MCS32_MASK 0x01
|
||||
|
||||
#define IS_11N_MCS_RATE(rate) (rate&0x80)
|
||||
|
|
|
@ -361,11 +361,11 @@ bool IsHTHalfNmodeAPs(struct ieee80211_device* ieee)
|
|||
(net->ralink_cap_exist))
|
||||
retValue = true;
|
||||
else if((memcmp(net->bssid, UNKNOWN_BORADCOM, 3)==0) ||
|
||||
(memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)||
|
||||
(memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)||
|
||||
(memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) ||
|
||||
(net->broadcom_cap_exist))
|
||||
retValue = true;
|
||||
(memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)||
|
||||
(memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)||
|
||||
(memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) ||
|
||||
(net->broadcom_cap_exist))
|
||||
retValue = true;
|
||||
else if(net->bssht.bdRT2RTAggregation)
|
||||
retValue = true;
|
||||
else
|
||||
|
@ -425,7 +425,7 @@ u8 HTIOTActIsDisableMCS14(struct ieee80211_device* ieee, u8* PeerMacAddr)
|
|||
// 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)
|
||||
(memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)
|
||||
)
|
||||
{
|
||||
ret = 1;
|
||||
|
@ -569,8 +569,8 @@ u8 HTIOTActIsCCDFsync(u8* PeerMacAddr)
|
|||
{
|
||||
u8 retValue = 0;
|
||||
if( (memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) ||
|
||||
(memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) ||
|
||||
(memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ==0))
|
||||
(memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) ||
|
||||
(memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ==0))
|
||||
{
|
||||
retValue = 1;
|
||||
}
|
||||
|
@ -648,7 +648,7 @@ void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u
|
|||
|
||||
|
||||
//MAC HT parameters info
|
||||
// TODO: Nedd to take care of this part
|
||||
// TODO: Nedd to take care of this part
|
||||
IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", pCapELE->ChlWidth, pCapELE->MaxAMSDUSize, pCapELE->DssCCk);
|
||||
|
||||
if( IsEncrypt)
|
||||
|
@ -1662,7 +1662,7 @@ void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidt
|
|||
//if in half N mode, set to 20M bandwidth please 09.08.2008 WB.
|
||||
if(Bandwidth==HT_CHANNEL_WIDTH_20_40 && (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)))
|
||||
{
|
||||
// Handle Illegal extention channel offset!!
|
||||
// Handle Illegal extention channel offset!!
|
||||
if(ieee->current_network.channel<2 && Offset==HT_EXTCHNL_OFFSET_LOWER)
|
||||
Offset = HT_EXTCHNL_OFFSET_NO_EXT;
|
||||
if(Offset==HT_EXTCHNL_OFFSET_UPPER || Offset==HT_EXTCHNL_OFFSET_LOWER) {
|
||||
|
|
|
@ -647,18 +647,18 @@ typedef struct _QOS_TSTREAM{
|
|||
// 802.11 Management frame Status Code field
|
||||
//----------------------------------------------------------------------------
|
||||
typedef struct _OCTET_STRING{
|
||||
u8 *Octet;
|
||||
u16 Length;
|
||||
u8 *Octet;
|
||||
u16 Length;
|
||||
}OCTET_STRING, *POCTET_STRING;
|
||||
#if 0
|
||||
#define FillOctetString(_os,_octet,_len) \
|
||||
(_os).Octet=(u8 *)(_octet); \
|
||||
(_os).Length=(_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;
|
||||
(_osWMMElem).Octet += WMM_ELEM_HDR_LEN; \
|
||||
(_osWMMElem).Length -= WMM_ELEM_HDR_LEN;
|
||||
#endif
|
||||
//
|
||||
// STA QoS data.
|
||||
|
|
|
@ -509,31 +509,31 @@ void RemoveTsEntry(
|
|||
if(timer_pending(&pRxTS->RxPktPendingTimer))
|
||||
del_timer_sync(&pRxTS->RxPktPendingTimer);
|
||||
|
||||
while(!list_empty(&pRxTS->RxPendingPktList))
|
||||
{
|
||||
// PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK);
|
||||
spin_lock_irqsave(&(ieee->reorder_spinlock), flags);
|
||||
//pRxReorderEntry = list_entry(&pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List);
|
||||
while(!list_empty(&pRxTS->RxPendingPktList))
|
||||
{
|
||||
// PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK);
|
||||
spin_lock_irqsave(&(ieee->reorder_spinlock), flags);
|
||||
//pRxReorderEntry = list_entry(&pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List);
|
||||
pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List);
|
||||
list_del_init(&pRxReorderEntry->List);
|
||||
{
|
||||
int i = 0;
|
||||
struct ieee80211_rxb * prxb = pRxReorderEntry->prxb;
|
||||
list_del_init(&pRxReorderEntry->List);
|
||||
{
|
||||
int i = 0;
|
||||
struct ieee80211_rxb * prxb = pRxReorderEntry->prxb;
|
||||
if (unlikely(!prxb))
|
||||
{
|
||||
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
|
||||
return;
|
||||
}
|
||||
for(i =0; i < prxb->nr_subframes; i++) {
|
||||
dev_kfree_skb(prxb->subframes[i]);
|
||||
}
|
||||
kfree(prxb);
|
||||
prxb = NULL;
|
||||
}
|
||||
list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List);
|
||||
//PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK);
|
||||
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
|
||||
}
|
||||
for(i =0; i < prxb->nr_subframes; i++) {
|
||||
dev_kfree_skb(prxb->subframes[i]);
|
||||
}
|
||||
kfree(prxb);
|
||||
prxb = NULL;
|
||||
}
|
||||
list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List);
|
||||
//PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK);
|
||||
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
|
||||
}
|
||||
|
||||
//#endif
|
||||
}
|
||||
|
|
|
@ -17,28 +17,28 @@
|
|||
|
||||
int rtl8180_save_state (struct pci_dev *dev, u32 state)
|
||||
{
|
||||
printk(KERN_NOTICE "r8180 save state call (state %u).\n", state);
|
||||
printk(KERN_NOTICE "r8180 save state call (state %u).\n", state);
|
||||
return(-EAGAIN);
|
||||
}
|
||||
|
||||
|
||||
int rtl8180_suspend (struct pci_dev *dev, u32 state)
|
||||
{
|
||||
printk(KERN_NOTICE "r8180 suspend call (state %u).\n", state);
|
||||
printk(KERN_NOTICE "r8180 suspend call (state %u).\n", state);
|
||||
return(-EAGAIN);
|
||||
}
|
||||
|
||||
|
||||
int rtl8180_resume (struct pci_dev *dev)
|
||||
{
|
||||
printk(KERN_NOTICE "r8180 resume call.\n");
|
||||
printk(KERN_NOTICE "r8180 resume call.\n");
|
||||
return(-EAGAIN);
|
||||
}
|
||||
|
||||
|
||||
int rtl8180_enable_wake (struct pci_dev *dev, u32 state, int enable)
|
||||
{
|
||||
printk(KERN_NOTICE "r8180 enable wake call (state %u, enable %d).\n",
|
||||
printk(KERN_NOTICE "r8180 enable wake call (state %u, enable %d).\n",
|
||||
state, enable);
|
||||
return(-EAGAIN);
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -282,7 +282,7 @@ void dm_CheckRxAggregation(struct net_device *dev) {
|
|||
|
||||
extern void hal_dm_watchdog(struct net_device *dev)
|
||||
{
|
||||
//struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
//struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
|
||||
//static u8 previous_bssid[6] ={0};
|
||||
|
||||
|
@ -621,7 +621,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device * dev)
|
|||
bool bHighpowerstate, viviflag = FALSE;
|
||||
DCMD_TXCMD_T tx_cmd;
|
||||
u8 powerlevelOFDM24G;
|
||||
int i =0, j = 0, k = 0;
|
||||
int i =0, j = 0, k = 0;
|
||||
u8 RF_Type, tmp_report[5]={0, 0, 0, 0, 0};
|
||||
u32 Value;
|
||||
u8 Pwr_Flag;
|
||||
|
@ -1010,13 +1010,13 @@ static void dm_InitializeTXPowerTracking_TSSI(struct net_device *dev)
|
|||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
|
||||
//Initial the Tx BB index and mapping value
|
||||
priv->txbbgain_table[0].txbb_iq_amplifygain = 12;
|
||||
priv->txbbgain_table[0].txbb_iq_amplifygain = 12;
|
||||
priv->txbbgain_table[0].txbbgain_value=0x7f8001fe;
|
||||
priv->txbbgain_table[1].txbb_iq_amplifygain = 11;
|
||||
priv->txbbgain_table[1].txbb_iq_amplifygain = 11;
|
||||
priv->txbbgain_table[1].txbbgain_value=0x788001e2;
|
||||
priv->txbbgain_table[2].txbb_iq_amplifygain = 10;
|
||||
priv->txbbgain_table[2].txbb_iq_amplifygain = 10;
|
||||
priv->txbbgain_table[2].txbbgain_value=0x71c001c7;
|
||||
priv->txbbgain_table[3].txbb_iq_amplifygain = 9;
|
||||
priv->txbbgain_table[3].txbb_iq_amplifygain = 9;
|
||||
priv->txbbgain_table[3].txbbgain_value=0x6b8001ae;
|
||||
priv->txbbgain_table[4].txbb_iq_amplifygain = 8;
|
||||
priv->txbbgain_table[4].txbbgain_value=0x65400195;
|
||||
|
@ -1046,7 +1046,7 @@ static void dm_InitializeTXPowerTracking_TSSI(struct net_device *dev)
|
|||
priv->txbbgain_table[16].txbbgain_value=0x32c000cb;
|
||||
priv->txbbgain_table[17].txbb_iq_amplifygain = -5;
|
||||
priv->txbbgain_table[17].txbbgain_value=0x300000c0;
|
||||
priv->txbbgain_table[18].txbb_iq_amplifygain = -6;
|
||||
priv->txbbgain_table[18].txbb_iq_amplifygain = -6;
|
||||
priv->txbbgain_table[18].txbbgain_value=0x2d4000b5;
|
||||
priv->txbbgain_table[19].txbb_iq_amplifygain = -7;
|
||||
priv->txbbgain_table[19].txbbgain_value=0x2ac000ab;
|
||||
|
@ -1548,9 +1548,9 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev)
|
|||
return;
|
||||
else
|
||||
{
|
||||
if((tx_power_track_counter % 30 == 0)&&(tx_power_track_counter != 0))
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
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)
|
||||
|
@ -1559,7 +1559,7 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev)
|
|||
queue_work(priv->priv_wq,&priv->txpower_tracking_wq);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
tx_power_track_counter++;
|
||||
}
|
||||
|
||||
|
@ -3065,7 +3065,7 @@ static void dm_check_rfctrl_gpio(struct net_device * dev)
|
|||
#else
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
schedule_task(&priv->gpio_change_rf_wq);
|
||||
#else
|
||||
#else
|
||||
queue_work(priv->priv_wq,&priv->gpio_change_rf_wq);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -3602,7 +3602,7 @@ extern void dm_fsync_timer_callback(unsigned long data)
|
|||
{
|
||||
rate_bitmap = 1 << rate_index;
|
||||
if(priv->ieee80211->fsync_rate_bitmap & rate_bitmap)
|
||||
rate_count+= priv->stats.received_rate_histogram[1][rate_index];
|
||||
rate_count+= priv->stats.received_rate_histogram[1][rate_index];
|
||||
}
|
||||
|
||||
if(rate_count < priv->rate_record)
|
||||
|
@ -4036,7 +4036,7 @@ extern void dm_shadow_init(struct net_device *dev)
|
|||
* Function: DM_DynamicTxPower()
|
||||
*
|
||||
* Overview: Detect Signal strength to control TX Registry
|
||||
Tx Power Control For Near/Far Range
|
||||
Tx Power Control For Near/Far Range
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
|
|
|
@ -283,7 +283,7 @@ extern void dm_txpower_trackingcallback(struct net_device *dev);
|
|||
extern void dm_restore_dynamic_mechanism_state(struct net_device *dev);
|
||||
extern void dm_backup_dynamic_mechanism_state(struct net_device *dev);
|
||||
extern void dm_change_dynamic_initgain_thresh(struct net_device *dev,
|
||||
u32 dm_type, u32 dm_value);
|
||||
u32 dm_type, u32 dm_value);
|
||||
extern void dm_force_tx_fw_info(struct net_device *dev,u32 force_type, u32 force_value);
|
||||
extern void dm_init_edca_turbo(struct net_device *dev);
|
||||
extern void dm_rf_operation_test_callback(unsigned long data);
|
||||
|
|
|
@ -226,7 +226,7 @@ enum _RTL8192Usb_HW {
|
|||
#define CPU_GEN_NO_LOOPBACK_SET 0x00080000 // Set BIT19 to 1
|
||||
CPU_GEN = 0x100, // CPU Reset Register
|
||||
LED1Cfg = 0x154,// LED1 Configuration Register
|
||||
LED0Cfg = 0x155,// LED0 Configuration Register
|
||||
LED0Cfg = 0x155,// LED0 Configuration Register
|
||||
|
||||
AcmAvg = 0x170, // ACM Average Period Register
|
||||
AcmHwCtrl = 0x171, // ACM Hardware Control Register
|
||||
|
|
|
@ -193,15 +193,15 @@ static int r8192_wx_write_regs(struct net_device *dev,
|
|||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
u8 addr;
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
u8 addr;
|
||||
|
||||
down(&priv->wx_sem);
|
||||
down(&priv->wx_sem);
|
||||
|
||||
get_user(addr, (u8*)wrqu->data.pointer);
|
||||
get_user(addr, (u8*)wrqu->data.pointer);
|
||||
write_rtl8225(dev, addr, wrqu->data.length);
|
||||
|
||||
up(&priv->wx_sem);
|
||||
up(&priv->wx_sem);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
@ -213,14 +213,14 @@ static int r8192_wx_read_bb(struct net_device *dev,
|
|||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(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);
|
||||
down(&priv->wx_sem);
|
||||
|
||||
databb = rtl8187_read_phy(dev, (u8)wrqu->data.length, 0x00000000);
|
||||
wrqu->data.length = databb;
|
||||
|
@ -231,74 +231,74 @@ static int r8192_wx_read_bb(struct net_device *dev,
|
|||
|
||||
void rtl8187_write_phy(struct net_device *dev, u8 adr, u32 data);
|
||||
static int r8192_wx_write_bb(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
u8 databb;
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
u8 databb;
|
||||
|
||||
down(&priv->wx_sem);
|
||||
down(&priv->wx_sem);
|
||||
|
||||
get_user(databb, (u8*)wrqu->data.pointer);
|
||||
rtl8187_write_phy(dev, wrqu->data.length, databb);
|
||||
get_user(databb, (u8*)wrqu->data.pointer);
|
||||
rtl8187_write_phy(dev, wrqu->data.length, databb);
|
||||
|
||||
up(&priv->wx_sem);
|
||||
return 0;
|
||||
up(&priv->wx_sem);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
static int r8192_wx_write_nicb(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
u32 addr;
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
u32 addr;
|
||||
|
||||
down(&priv->wx_sem);
|
||||
down(&priv->wx_sem);
|
||||
|
||||
get_user(addr, (u32*)wrqu->data.pointer);
|
||||
write_nic_byte(dev, addr, wrqu->data.length);
|
||||
get_user(addr, (u32*)wrqu->data.pointer);
|
||||
write_nic_byte(dev, addr, wrqu->data.length);
|
||||
|
||||
up(&priv->wx_sem);
|
||||
return 0;
|
||||
up(&priv->wx_sem);
|
||||
return 0;
|
||||
|
||||
}
|
||||
static int r8192_wx_read_nicb(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
u32 addr;
|
||||
u16 data1;
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
u32 addr;
|
||||
u16 data1;
|
||||
|
||||
down(&priv->wx_sem);
|
||||
down(&priv->wx_sem);
|
||||
|
||||
get_user(addr,(u32*)wrqu->data.pointer);
|
||||
data1 = read_nic_byte(dev, addr);
|
||||
wrqu->data.length = data1;
|
||||
get_user(addr,(u32*)wrqu->data.pointer);
|
||||
data1 = read_nic_byte(dev, addr);
|
||||
wrqu->data.length = data1;
|
||||
|
||||
up(&priv->wx_sem);
|
||||
return 0;
|
||||
up(&priv->wx_sem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int r8192_wx_get_ap_status(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
struct ieee80211_device *ieee = priv->ieee80211;
|
||||
struct ieee80211_network *target;
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
struct ieee80211_device *ieee = priv->ieee80211;
|
||||
struct ieee80211_network *target;
|
||||
int name_len;
|
||||
|
||||
down(&priv->wx_sem);
|
||||
down(&priv->wx_sem);
|
||||
|
||||
//count the length of input ssid
|
||||
for(name_len=0 ; ((char*)wrqu->data.pointer)[name_len]!='\0' ; name_len++);
|
||||
|
||||
//search for the correspoding info which is received
|
||||
list_for_each_entry(target, &ieee->network_list, list) {
|
||||
if ( (target->ssid_len == name_len) &&
|
||||
list_for_each_entry(target, &ieee->network_list, list) {
|
||||
if ( (target->ssid_len == name_len) &&
|
||||
(strncmp(target->ssid, (char*)wrqu->data.pointer, name_len)==0)){
|
||||
if(target->wpa_ie_len>0 || target->rsn_ie_len>0 )
|
||||
//set flags=1 to indicate this ap is WPA
|
||||
|
@ -307,11 +307,11 @@ static int r8192_wx_get_ap_status(struct net_device *dev,
|
|||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
up(&priv->wx_sem);
|
||||
return 0;
|
||||
up(&priv->wx_sem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -404,25 +404,25 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
|
|||
|
||||
struct iw_range_with_scan_capa
|
||||
{
|
||||
/* Informative stuff (to choose between different interface) */
|
||||
__u32 throughput; /* To give an idea... */
|
||||
/* In theory this value should be the maximum benchmarked
|
||||
* TCP/IP throughput, because with most of these devices the
|
||||
* bit rate is meaningless (overhead an co) to estimate how
|
||||
* fast the connection will go and pick the fastest one.
|
||||
* I suggest people to play with Netperf or any benchmark...
|
||||
*/
|
||||
/* Informative stuff (to choose between different interface) */
|
||||
__u32 throughput; /* To give an idea... */
|
||||
/* In theory this value should be the maximum benchmarked
|
||||
* TCP/IP throughput, because with most of these devices the
|
||||
* bit rate is meaningless (overhead an co) to estimate how
|
||||
* fast the connection will go and pick the fastest one.
|
||||
* I suggest people to play with Netperf or any benchmark...
|
||||
*/
|
||||
|
||||
/* NWID (or domain id) */
|
||||
__u32 min_nwid; /* Minimal NWID we are able to set */
|
||||
__u32 max_nwid; /* Maximal NWID we are able to set */
|
||||
/* NWID (or domain id) */
|
||||
__u32 min_nwid; /* Minimal NWID we are able to set */
|
||||
__u32 max_nwid; /* Maximal NWID we are able to set */
|
||||
|
||||
/* Old Frequency (backward compat - moved lower ) */
|
||||
__u16 old_num_channels;
|
||||
__u8 old_num_frequency;
|
||||
/* Old Frequency (backward compat - moved lower ) */
|
||||
__u16 old_num_channels;
|
||||
__u8 old_num_frequency;
|
||||
|
||||
/* Scan capabilities */
|
||||
__u8 scan_capa;
|
||||
/* Scan capabilities */
|
||||
__u8 scan_capa;
|
||||
};
|
||||
static int rtl8180_wx_get_range(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
|
@ -453,7 +453,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
|
|||
// TODO: Not used in 802.11b?
|
||||
// range->max_nwid; /* Maximal NWID we are able to set */
|
||||
|
||||
/* Old Frequency (backward compat - moved lower ) */
|
||||
/* Old Frequency (backward compat - moved lower ) */
|
||||
// range->old_num_channels;
|
||||
// range->old_num_frequency;
|
||||
// range->old_freq[6]; /* Filler to keep "version" at the same offset */
|
||||
|
@ -509,7 +509,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
|
|||
#else
|
||||
if ((priv->ieee80211->channel_map)[i+1]) {
|
||||
#endif
|
||||
range->freq[val].i = i + 1;
|
||||
range->freq[val].i = i + 1;
|
||||
range->freq[val].m = ieee80211_wlan_frequencies[i] * 100000;
|
||||
range->freq[val].e = 1;
|
||||
val++;
|
||||
|
@ -522,7 +522,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
|
|||
break;
|
||||
}
|
||||
range->num_frequency = val;
|
||||
range->num_channels = val;
|
||||
range->num_channels = val;
|
||||
#if WIRELESS_EXT > 17
|
||||
range->enc_capa = IW_ENC_CAPA_WPA|IW_ENC_CAPA_WPA2|
|
||||
IW_ENC_CAPA_CIPHER_TKIP|IW_ENC_CAPA_CIPHER_CCMP;
|
||||
|
@ -557,10 +557,10 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
|
||||
down(&priv->wx_sem);
|
||||
if(priv->ieee80211->state != IEEE80211_LINKED){
|
||||
priv->ieee80211->scanning = 0;
|
||||
ieee80211_softmac_scan_syncro(priv->ieee80211);
|
||||
ret = 0;
|
||||
}
|
||||
priv->ieee80211->scanning = 0;
|
||||
ieee80211_softmac_scan_syncro(priv->ieee80211);
|
||||
ret = 0;
|
||||
}
|
||||
else
|
||||
ret = ieee80211_wx_set_scan(priv->ieee80211,a,wrqu,b);
|
||||
up(&priv->wx_sem);
|
||||
|
@ -809,7 +809,7 @@ static int r8192_wx_set_enc(struct net_device *dev,
|
|||
static int r8192_wx_set_scan_type(struct net_device *dev, struct iw_request_info *aa, union
|
||||
iwreq_data *wrqu, char *p){
|
||||
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
int *parms=(int*)p;
|
||||
int mode=parms[0];
|
||||
|
||||
|
@ -858,7 +858,7 @@ static int r8192_wx_set_retry(struct net_device *dev,
|
|||
* I'm unsure if whole reset is really needed
|
||||
*/
|
||||
|
||||
rtl8192_commit(dev);
|
||||
rtl8192_commit(dev);
|
||||
/*
|
||||
if(priv->up){
|
||||
rtl8180_rtx_disable(dev);
|
||||
|
@ -939,8 +939,8 @@ 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 iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||
int ret = 0;
|
||||
|
@ -950,8 +950,8 @@ static int r8192_wx_get_enc_ext(struct net_device *dev,
|
|||
#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)
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
int ret=0;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
|
@ -1040,8 +1040,8 @@ end_hw_sec:
|
|||
|
||||
}
|
||||
static int r8192_wx_set_auth(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *data, char *extra)
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *data, char *extra)
|
||||
{
|
||||
int ret=0;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
|
||||
|
@ -1055,8 +1055,8 @@ static int r8192_wx_set_auth(struct net_device *dev,
|
|||
}
|
||||
|
||||
static int r8192_wx_set_mlme(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
//printk("====>%s()\n", __FUNCTION__);
|
||||
|
||||
|
@ -1072,21 +1072,21 @@ static int r8192_wx_set_mlme(struct net_device *dev,
|
|||
}
|
||||
#endif
|
||||
static int r8192_wx_set_gen_ie(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *data, char *extra)
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *data, char *extra)
|
||||
{
|
||||
//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);
|
||||
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);
|
||||
ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, data->data.length);
|
||||
#endif
|
||||
up(&priv->wx_sem);
|
||||
up(&priv->wx_sem);
|
||||
//printk("<======%s(), ret:%d\n", __FUNCTION__, ret);
|
||||
#endif
|
||||
return ret;
|
||||
return ret;
|
||||
|
||||
|
||||
}
|
||||
|
@ -1100,56 +1100,56 @@ static int dummy(struct net_device *dev, struct iw_request_info *a,
|
|||
|
||||
static iw_handler r8192_wx_handlers[] =
|
||||
{
|
||||
NULL, /* SIOCSIWCOMMIT */
|
||||
r8192_wx_get_name, /* SIOCGIWNAME */
|
||||
dummy, /* SIOCSIWNWID */
|
||||
dummy, /* SIOCGIWNWID */
|
||||
r8192_wx_set_freq, /* SIOCSIWFREQ */
|
||||
r8192_wx_get_freq, /* SIOCGIWFREQ */
|
||||
r8192_wx_set_mode, /* SIOCSIWMODE */
|
||||
r8192_wx_get_mode, /* SIOCGIWMODE */
|
||||
r8192_wx_set_sens, /* SIOCSIWSENS */
|
||||
r8192_wx_get_sens, /* SIOCGIWSENS */
|
||||
NULL, /* SIOCSIWRANGE */
|
||||
rtl8180_wx_get_range, /* SIOCGIWRANGE */
|
||||
NULL, /* SIOCSIWPRIV */
|
||||
NULL, /* SIOCGIWPRIV */
|
||||
NULL, /* SIOCSIWSTATS */
|
||||
NULL, /* SIOCGIWSTATS */
|
||||
dummy, /* SIOCSIWSPY */
|
||||
dummy, /* SIOCGIWSPY */
|
||||
NULL, /* SIOCGIWTHRSPY */
|
||||
NULL, /* SIOCWIWTHRSPY */
|
||||
r8192_wx_set_wap, /* SIOCSIWAP */
|
||||
r8192_wx_get_wap, /* SIOCGIWAP */
|
||||
NULL, /* SIOCSIWCOMMIT */
|
||||
r8192_wx_get_name, /* SIOCGIWNAME */
|
||||
dummy, /* SIOCSIWNWID */
|
||||
dummy, /* SIOCGIWNWID */
|
||||
r8192_wx_set_freq, /* SIOCSIWFREQ */
|
||||
r8192_wx_get_freq, /* SIOCGIWFREQ */
|
||||
r8192_wx_set_mode, /* SIOCSIWMODE */
|
||||
r8192_wx_get_mode, /* SIOCGIWMODE */
|
||||
r8192_wx_set_sens, /* SIOCSIWSENS */
|
||||
r8192_wx_get_sens, /* SIOCGIWSENS */
|
||||
NULL, /* SIOCSIWRANGE */
|
||||
rtl8180_wx_get_range, /* SIOCGIWRANGE */
|
||||
NULL, /* SIOCSIWPRIV */
|
||||
NULL, /* SIOCGIWPRIV */
|
||||
NULL, /* SIOCSIWSTATS */
|
||||
NULL, /* SIOCGIWSTATS */
|
||||
dummy, /* SIOCSIWSPY */
|
||||
dummy, /* SIOCGIWSPY */
|
||||
NULL, /* SIOCGIWTHRSPY */
|
||||
NULL, /* SIOCWIWTHRSPY */
|
||||
r8192_wx_set_wap, /* SIOCSIWAP */
|
||||
r8192_wx_get_wap, /* SIOCGIWAP */
|
||||
#if (WIRELESS_EXT >= 18)
|
||||
r8192_wx_set_mlme, /* MLME-- */
|
||||
r8192_wx_set_mlme, /* MLME-- */
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
dummy, /* SIOCGIWAPLIST -- depricated */
|
||||
r8192_wx_set_scan, /* SIOCSIWSCAN */
|
||||
r8192_wx_get_scan, /* SIOCGIWSCAN */
|
||||
r8192_wx_set_essid, /* SIOCSIWESSID */
|
||||
r8192_wx_get_essid, /* SIOCGIWESSID */
|
||||
dummy, /* SIOCSIWNICKN */
|
||||
dummy, /* SIOCGIWNICKN */
|
||||
NULL, /* -- hole -- */
|
||||
NULL, /* -- hole -- */
|
||||
r8192_wx_set_rate, /* SIOCSIWRATE */
|
||||
r8192_wx_get_rate, /* SIOCGIWRATE */
|
||||
r8192_wx_set_rts, /* SIOCSIWRTS */
|
||||
r8192_wx_get_rts, /* SIOCGIWRTS */
|
||||
r8192_wx_set_frag, /* SIOCSIWFRAG */
|
||||
r8192_wx_get_frag, /* SIOCGIWFRAG */
|
||||
dummy, /* SIOCSIWTXPOW */
|
||||
dummy, /* SIOCGIWTXPOW */
|
||||
r8192_wx_set_retry, /* SIOCSIWRETRY */
|
||||
r8192_wx_get_retry, /* SIOCGIWRETRY */
|
||||
r8192_wx_set_enc, /* SIOCSIWENCODE */
|
||||
r8192_wx_get_enc, /* SIOCGIWENCODE */
|
||||
r8192_wx_set_power, /* SIOCSIWPOWER */
|
||||
r8192_wx_get_power, /* SIOCGIWPOWER */
|
||||
dummy, /* SIOCGIWAPLIST -- depricated */
|
||||
r8192_wx_set_scan, /* SIOCSIWSCAN */
|
||||
r8192_wx_get_scan, /* SIOCGIWSCAN */
|
||||
r8192_wx_set_essid, /* SIOCSIWESSID */
|
||||
r8192_wx_get_essid, /* SIOCGIWESSID */
|
||||
dummy, /* SIOCSIWNICKN */
|
||||
dummy, /* SIOCGIWNICKN */
|
||||
NULL, /* -- hole -- */
|
||||
NULL, /* -- hole -- */
|
||||
r8192_wx_set_rate, /* SIOCSIWRATE */
|
||||
r8192_wx_get_rate, /* SIOCGIWRATE */
|
||||
r8192_wx_set_rts, /* SIOCSIWRTS */
|
||||
r8192_wx_get_rts, /* SIOCGIWRTS */
|
||||
r8192_wx_set_frag, /* SIOCSIWFRAG */
|
||||
r8192_wx_get_frag, /* SIOCGIWFRAG */
|
||||
dummy, /* SIOCSIWTXPOW */
|
||||
dummy, /* SIOCGIWTXPOW */
|
||||
r8192_wx_set_retry, /* SIOCSIWRETRY */
|
||||
r8192_wx_get_retry, /* SIOCGIWRETRY */
|
||||
r8192_wx_set_enc, /* SIOCSIWENCODE */
|
||||
r8192_wx_get_enc, /* SIOCGIWENCODE */
|
||||
r8192_wx_set_power, /* SIOCSIWPOWER */
|
||||
r8192_wx_get_power, /* SIOCGIWPOWER */
|
||||
NULL, /*---hole---*/
|
||||
NULL, /*---hole---*/
|
||||
r8192_wx_set_gen_ie,//NULL, /* SIOCSIWGENIE */
|
||||
|
@ -1192,38 +1192,38 @@ static const struct iw_priv_args r8192_private_args[] = {
|
|||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x3,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readRF"
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readRF"
|
||||
}
|
||||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x4,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeRF"
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeRF"
|
||||
}
|
||||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x5,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readBB"
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readBB"
|
||||
}
|
||||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x6,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeBB"
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeBB"
|
||||
}
|
||||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x7,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readnicb"
|
||||
}
|
||||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x8,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writenicb"
|
||||
}
|
||||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x9,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "apinfo"
|
||||
}
|
||||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x7,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readnicb"
|
||||
}
|
||||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x8,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writenicb"
|
||||
}
|
||||
,
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x9,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "apinfo"
|
||||
}
|
||||
|
||||
#endif
|
||||
,
|
||||
|
@ -1249,8 +1249,8 @@ static iw_handler r8192_private_handler[] = {
|
|||
r8192_wx_write_regs,
|
||||
r8192_wx_read_bb,
|
||||
r8192_wx_write_bb,
|
||||
r8192_wx_read_nicb,
|
||||
r8192_wx_write_nicb,
|
||||
r8192_wx_read_nicb,
|
||||
r8192_wx_write_nicb,
|
||||
r8192_wx_get_ap_status,
|
||||
#endif
|
||||
//r8192_wx_null,
|
||||
|
@ -1290,7 +1290,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
|
|||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
|
||||
wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM;
|
||||
#else
|
||||
wstats->qual.updated = 0x0f;
|
||||
wstats->qual.updated = 0x0f;
|
||||
#endif
|
||||
return wstats;
|
||||
}
|
||||
|
@ -1302,7 +1302,7 @@ struct iw_handler_def r8192_wx_handlers_def={
|
|||
.num_standard = sizeof(r8192_wx_handlers) / sizeof(iw_handler),
|
||||
.private = r8192_private_handler,
|
||||
.num_private = sizeof(r8192_private_handler) / sizeof(iw_handler),
|
||||
.num_private_args = sizeof(r8192_private_args) / sizeof(struct iw_priv_args),
|
||||
.num_private_args = sizeof(r8192_private_args) / sizeof(struct iw_priv_args),
|
||||
#if WIRELESS_EXT >= 17
|
||||
.get_wireless_stats = r8192_get_wireless_stats,
|
||||
#endif
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
Module: r819xusb_cmdpkt.c (RTL8190 TX/RX command packet handler Source C File)
|
||||
|
||||
Note: The module is responsible for handling TX and RX command packet.
|
||||
1. TX : Send set and query configuration command packet.
|
||||
2. RX : Receive tx feedback, beacon state, query configuration
|
||||
command packet.
|
||||
1. TX : Send set and query configuration command packet.
|
||||
2. RX : Receive tx feedback, beacon state, query configuration
|
||||
command packet.
|
||||
|
||||
Function:
|
||||
|
||||
|
@ -158,7 +158,7 @@ SendTxCommandPacket(
|
|||
seg_ptr = skb_put(skb, buffer_len);
|
||||
/*
|
||||
* Transform from little endian to big endian
|
||||
* and pending zero
|
||||
* and pending zero
|
||||
*/
|
||||
memcpy(seg_ptr,codevirtualaddress,buffer_len);
|
||||
tcb_desc->txbuf_size= (u16)buffer_len;
|
||||
|
@ -349,7 +349,7 @@ cmpk_handle_tx_feedback(
|
|||
pMgntInfo->CurrentOperaRate = (rx_tx_fb.F_Rate & 0x7F);
|
||||
}
|
||||
else if (pAdapter->RegWirelessMode == WIRELESS_MODE_N_24G ||
|
||||
pAdapter->RegWirelessMode == WIRELESS_MODE_N_5G)
|
||||
pAdapter->RegWirelessMode == WIRELESS_MODE_N_5G)
|
||||
{
|
||||
pMgntInfo->HTCurrentOperaRate = (rx_tx_fb.F_Rate & 0x8F);
|
||||
}
|
||||
|
@ -802,7 +802,7 @@ cmpk_message_handle_rx(
|
|||
|
||||
default:
|
||||
|
||||
RT_TRACE(COMP_ERR, "---->cmpk_message_handle_rx():unknow CMD Element\n");
|
||||
RT_TRACE(COMP_ERR, "---->cmpk_message_handle_rx():unknow CMD Element\n");
|
||||
return 1; /* This is a command packet. */
|
||||
}
|
||||
// 2007/01/22 MH Display received rx command packet info.
|
||||
|
|
|
@ -202,10 +202,10 @@ typedef enum tag_command_packet_directories
|
|||
}cmpk_element_e;
|
||||
|
||||
typedef enum _rt_status{
|
||||
RT_STATUS_SUCCESS,
|
||||
RT_STATUS_FAILURE,
|
||||
RT_STATUS_PENDING,
|
||||
RT_STATUS_RESOURCE
|
||||
RT_STATUS_SUCCESS,
|
||||
RT_STATUS_FAILURE,
|
||||
RT_STATUS_PENDING,
|
||||
RT_STATUS_RESOURCE
|
||||
}rt_status,*prt_status;
|
||||
|
||||
extern rt_status cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len);
|
||||
|
|
|
@ -80,7 +80,7 @@ bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, u32 buff
|
|||
seg_ptr = skb->data;
|
||||
/*
|
||||
* Transform from little endian to big endian
|
||||
* and pending zero
|
||||
* and pending zero
|
||||
*/
|
||||
for(i=0 ; i < frag_length; i+=4) {
|
||||
*seg_ptr++ = ((i+0)<frag_length)?code_virtual_address[i+3]:0;
|
||||
|
@ -218,7 +218,7 @@ bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
|
|||
{
|
||||
bool rt_status = true;
|
||||
int check_putcodeOK_time = 200000, check_bootOk_time = 200000;
|
||||
u32 CPU_status = 0;
|
||||
u32 CPU_status = 0;
|
||||
|
||||
/* Check whether put code OK */
|
||||
do {
|
||||
|
@ -299,12 +299,12 @@ bool init_firmware(struct net_device *dev)
|
|||
bool rt_status = TRUE;
|
||||
|
||||
u8 *firmware_img_buf[3] = { &rtl8190_fwboot_array[0],
|
||||
&rtl8190_fwmain_array[0],
|
||||
&rtl8190_fwdata_array[0]};
|
||||
&rtl8190_fwmain_array[0],
|
||||
&rtl8190_fwdata_array[0]};
|
||||
|
||||
u32 firmware_img_len[3] = { sizeof(rtl8190_fwboot_array),
|
||||
sizeof(rtl8190_fwmain_array),
|
||||
sizeof(rtl8190_fwdata_array)};
|
||||
sizeof(rtl8190_fwmain_array),
|
||||
sizeof(rtl8190_fwdata_array)};
|
||||
u32 file_length = 0;
|
||||
u8 *mapped_file = NULL;
|
||||
u32 init_step = 0;
|
||||
|
@ -314,7 +314,7 @@ bool init_firmware(struct net_device *dev)
|
|||
rt_firmware *pfirmware = priv->pFirmware;
|
||||
const struct firmware *fw_entry;
|
||||
const char *fw_name[3] = { "RTL8192U/boot.img",
|
||||
"RTL8192U/main.img",
|
||||
"RTL8192U/main.img",
|
||||
"RTL8192U/data.img"};
|
||||
int rc;
|
||||
|
||||
|
@ -490,8 +490,8 @@ 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
|
||||
* (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(
|
||||
|
|
|
@ -94,7 +94,7 @@ void rtl8192_setBBreg(struct net_device* dev, u32 dwRegAddr, u32 dwBitMask, u32
|
|||
{//if not "double word" write
|
||||
OriginalValue = read_nic_dword(dev, dwRegAddr);
|
||||
BitShift = rtl8192_CalculateBitShift(dwBitMask);
|
||||
NewValue = (((OriginalValue) & (~dwBitMask)) | (dwData << BitShift));
|
||||
NewValue = (((OriginalValue) & (~dwBitMask)) | (dwData << BitShift));
|
||||
write_nic_dword(dev, dwRegAddr, NewValue);
|
||||
}else
|
||||
write_nic_dword(dev, dwRegAddr, dwData);
|
||||
|
@ -265,7 +265,7 @@ void rtl8192_phy_RFSerialWrite(struct net_device* dev, RF90_RADIO_PATH_E eRFPath
|
|||
priv->RfReg0Value[eRFPath] = Data;
|
||||
|
||||
// Switch back to Reg_Mode0;
|
||||
if(priv->rf_chip == RF_8256)
|
||||
if(priv->rf_chip == RF_8256)
|
||||
{
|
||||
if(Offset != 0)
|
||||
{
|
||||
|
@ -320,13 +320,13 @@ void rtl8192_phy_SetRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32
|
|||
else
|
||||
{
|
||||
if (BitMask != bMask12Bits) // RF data is 12 bits only
|
||||
{
|
||||
{
|
||||
Original_Value = rtl8192_phy_RFSerialRead(dev, eRFPath, RegAddr);
|
||||
BitShift = rtl8192_CalculateBitShift(BitMask);
|
||||
New_Value = (((Original_Value) & (~BitMask)) | (Data<< BitShift));
|
||||
BitShift = rtl8192_CalculateBitShift(BitMask);
|
||||
New_Value = (((Original_Value) & (~BitMask)) | (Data<< BitShift));
|
||||
|
||||
rtl8192_phy_RFSerialWrite(dev, eRFPath, RegAddr, New_Value);
|
||||
}else
|
||||
}else
|
||||
rtl8192_phy_RFSerialWrite(dev, eRFPath, RegAddr, Data);
|
||||
}
|
||||
return;
|
||||
|
@ -360,8 +360,8 @@ u32 rtl8192_phy_QueryRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u3
|
|||
else
|
||||
{
|
||||
Original_Value = rtl8192_phy_RFSerialRead(dev, eRFPath, RegAddr);
|
||||
BitShift = rtl8192_CalculateBitShift(BitMask);
|
||||
Readback_Value = (Original_Value & BitMask) >> BitShift;
|
||||
BitShift = rtl8192_CalculateBitShift(BitMask);
|
||||
Readback_Value = (Original_Value & BitMask) >> BitShift;
|
||||
return (Readback_Value);
|
||||
}
|
||||
}
|
||||
|
@ -800,7 +800,7 @@ void rtl8192_BB_Config_ParaFile(struct net_device* dev)
|
|||
dwRegValue = read_nic_dword(dev, CPU_GEN);
|
||||
write_nic_dword(dev, CPU_GEN, (dwRegValue|CPU_GEN_BB_RST));
|
||||
|
||||
/*----BB AGC table Initialization----*/
|
||||
/*----BB AGC table Initialization----*/
|
||||
//==m==>Set PHY REG From Header<==m==
|
||||
rtl8192_phyConfigBB(dev, BaseBand_Config_AGC_TAB);
|
||||
|
||||
|
@ -1563,7 +1563,7 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
|
|||
|
||||
case HT_CHANNEL_WIDTH_20_40:
|
||||
regBwOpMode &= ~BW_OPMODE_20MHZ;
|
||||
// 2007/02/07 Mark by Emily becasue we have not verify whether this register works
|
||||
// 2007/02/07 Mark by Emily becasue we have not verify whether this register works
|
||||
write_nic_byte(dev, BW_OPMODE, regBwOpMode);
|
||||
break;
|
||||
|
||||
|
@ -1615,7 +1615,7 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
|
|||
rtl8192_setBBreg(dev, rFPGA0_RFMOD, bRFMOD, 0x1);
|
||||
rtl8192_setBBreg(dev, rFPGA1_RFMOD, bRFMOD, 0x1);
|
||||
rtl8192_setBBreg(dev, rCCK0_System, bCCKSideBand, (priv->nCur40MhzPrimeSC>>1));
|
||||
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 0);
|
||||
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
|
||||
|
|
|
@ -204,7 +204,7 @@
|
|||
#define rZebra1_AGC 0x4
|
||||
#define rZebra1_ChargePump 0x5
|
||||
#define rZebra1_Channel 0x7
|
||||
#define rZebra1_TxGain 0x8
|
||||
#define rZebra1_TxGain 0x8
|
||||
#define rZebra1_TxLPF 0x9
|
||||
#define rZebra1_RxLPF 0xb
|
||||
#define rZebra1_RxHPFCorner 0xc
|
||||
|
@ -360,7 +360,7 @@
|
|||
#define bAFEWatchDogEnable 0x20000000
|
||||
#define bXtalCap 0x0f000000
|
||||
#define bIntDifClkEnable 0x400
|
||||
#define bExtSigClkEnable 0x800
|
||||
#define bExtSigClkEnable 0x800
|
||||
#define bBandgapMbiasPowerUp 0x10000
|
||||
#define bAD11SHGain 0xc0000
|
||||
#define bAD11InputRange 0x700000
|
||||
|
@ -401,8 +401,8 @@
|
|||
#define bOFDMTxOn 0x2
|
||||
#define bDebugPage 0xfff //reset debug page and also HWord, LWord
|
||||
#define bDebugItem 0xff //reset debug page and LWord
|
||||
#define bAntL 0x10
|
||||
#define bAntNonHT 0x100
|
||||
#define bAntL 0x10
|
||||
#define bAntNonHT 0x100
|
||||
#define bAntHT1 0x1000
|
||||
#define bAntHT2 0x10000
|
||||
#define bAntHT1S1 0x100000
|
||||
|
@ -414,26 +414,26 @@
|
|||
#define bCCKRxPowerSaving 0x40
|
||||
#define bCCKSideBand 0x10
|
||||
#define bCCKScramble 0x8
|
||||
#define bCCKAntDiversity 0x8000
|
||||
#define bCCKCarrierRecovery 0x4000
|
||||
#define bCCKTxRate 0x3000
|
||||
#define bCCKDCCancel 0x0800
|
||||
#define bCCKAntDiversity 0x8000
|
||||
#define bCCKCarrierRecovery 0x4000
|
||||
#define bCCKTxRate 0x3000
|
||||
#define bCCKDCCancel 0x0800
|
||||
#define bCCKISICancel 0x0400
|
||||
#define bCCKMatchFilter 0x0200
|
||||
#define bCCKEqualizer 0x0100
|
||||
#define bCCKPreambleDetect 0x800000
|
||||
#define bCCKPreambleDetect 0x800000
|
||||
#define bCCKFastFalseCCA 0x400000
|
||||
#define bCCKChEstStart 0x300000
|
||||
#define bCCKCCACount 0x080000
|
||||
#define bCCKcs_lim 0x070000
|
||||
#define bCCKBistMode 0x80000000
|
||||
#define bCCKCCAMask 0x40000000
|
||||
#define bCCKTxDACPhase 0x4
|
||||
#define bCCKRxADCPhase 0x20000000 //r_rx_clk
|
||||
#define bCCKr_cp_mode0 0x0100
|
||||
#define bCCKTxDCOffset 0xf0
|
||||
#define bCCKRxDCOffset 0xf
|
||||
#define bCCKCCAMode 0xc000
|
||||
#define bCCKCCAMask 0x40000000
|
||||
#define bCCKTxDACPhase 0x4
|
||||
#define bCCKRxADCPhase 0x20000000 //r_rx_clk
|
||||
#define bCCKr_cp_mode0 0x0100
|
||||
#define bCCKTxDCOffset 0xf0
|
||||
#define bCCKRxDCOffset 0xf
|
||||
#define bCCKCCAMode 0xc000
|
||||
#define bCCKFalseCS_lim 0x3f00
|
||||
#define bCCKCS_ratio 0xc00000
|
||||
#define bCCKCorgBit_sel 0x300000
|
||||
|
@ -444,18 +444,18 @@
|
|||
#define bCCKLNAPolarity 0x800000
|
||||
#define bCCKRx1stGain 0x7f0000
|
||||
#define bCCKRFExtend 0x20000000 //CCK Rx Iinital gain polarity
|
||||
#define bCCKRxAGCSatLevel 0x1f000000
|
||||
#define bCCKRxAGCSatCount 0xe0
|
||||
#define bCCKRxAGCSatLevel 0x1f000000
|
||||
#define bCCKRxAGCSatCount 0xe0
|
||||
#define bCCKRxRFSettle 0x1f //AGCsamp_dly
|
||||
#define bCCKFixedRxAGC 0x8000
|
||||
//#define bCCKRxAGCFormat 0x4000 //remove to HSSI register 0x824
|
||||
#define bCCKAntennaPolarity 0x2000
|
||||
#define bCCKFixedRxAGC 0x8000
|
||||
//#define bCCKRxAGCFormat 0x4000 //remove to HSSI register 0x824
|
||||
#define bCCKAntennaPolarity 0x2000
|
||||
#define bCCKTxFilterType 0x0c00
|
||||
#define bCCKRxAGCReportType 0x0300
|
||||
#define bCCKRxAGCReportType 0x0300
|
||||
#define bCCKRxDAGCEn 0x80000000
|
||||
#define bCCKRxDAGCPeriod 0x20000000
|
||||
#define bCCKRxDAGCSatLevel 0x1f000000
|
||||
#define bCCKTimingRecovery 0x800000
|
||||
#define bCCKRxDAGCPeriod 0x20000000
|
||||
#define bCCKRxDAGCSatLevel 0x1f000000
|
||||
#define bCCKTimingRecovery 0x800000
|
||||
#define bCCKTxC0 0x3f0000
|
||||
#define bCCKTxC1 0x3f000000
|
||||
#define bCCKTxC2 0x3f
|
||||
|
|
Загрузка…
Ссылка в новой задаче