Commit 88a9fd04 authored by Larry Finger's avatar Larry Finger

staging: rtl8192e: Cleanup checkpatch -f warnings and errors - Part IX

Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
parent 54586533
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/string.h> #include <linux/string.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/errno.h> #include <linux/errno.h>
#define crypto_register_alg crypto_register_alg_rsl #define crypto_register_alg crypto_register_alg_rsl
#define crypto_unregister_alg crypto_unregister_alg_rsl #define crypto_unregister_alg crypto_unregister_alg_rsl
...@@ -73,7 +73,7 @@ struct cipher_alg { ...@@ -73,7 +73,7 @@ struct cipher_alg {
unsigned int cia_min_keysize; unsigned int cia_min_keysize;
unsigned int cia_max_keysize; unsigned int cia_max_keysize;
int (*cia_setkey)(void *ctx, const u8 *key, int (*cia_setkey)(void *ctx, const u8 *key,
unsigned int keylen, u32 *flags); unsigned int keylen, u32 *flags);
void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src);
void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src);
}; };
...@@ -84,16 +84,16 @@ struct digest_alg { ...@@ -84,16 +84,16 @@ struct digest_alg {
void (*dia_update)(void *ctx, const u8 *data, unsigned int len); void (*dia_update)(void *ctx, const u8 *data, unsigned int len);
void (*dia_final)(void *ctx, u8 *out); void (*dia_final)(void *ctx, u8 *out);
int (*dia_setkey)(void *ctx, const u8 *key, int (*dia_setkey)(void *ctx, const u8 *key,
unsigned int keylen, u32 *flags); unsigned int keylen, u32 *flags);
}; };
struct compress_alg { struct compress_alg {
int (*coa_init)(void *ctx); int (*coa_init)(void *ctx);
void (*coa_exit)(void *ctx); void (*coa_exit)(void *ctx);
int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen, int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen); u8 *dst, unsigned int *dlen);
int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen, int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen); u8 *dst, unsigned int *dlen);
}; };
#define cra_cipher cra_u.cipher #define cra_cipher cra_u.cipher
...@@ -139,15 +139,15 @@ struct cipher_tfm { ...@@ -139,15 +139,15 @@ struct cipher_tfm {
unsigned int cit_ivsize; unsigned int cit_ivsize;
u32 cit_mode; u32 cit_mode;
int (*cit_setkey)(struct crypto_tfm *tfm, int (*cit_setkey)(struct crypto_tfm *tfm,
const u8 *key, unsigned int keylen); const u8 *key, unsigned int keylen);
int (*cit_encrypt)(struct crypto_tfm *tfm, int (*cit_encrypt)(struct crypto_tfm *tfm,
struct scatterlist *dst, struct scatterlist *dst,
struct scatterlist *src, struct scatterlist *src,
unsigned int nbytes); unsigned int nbytes);
int (*cit_encrypt_iv)(struct crypto_tfm *tfm, int (*cit_encrypt_iv)(struct crypto_tfm *tfm,
struct scatterlist *dst, struct scatterlist *dst,
struct scatterlist *src, struct scatterlist *src,
unsigned int nbytes, u8 *iv); unsigned int nbytes, u8 *iv);
int (*cit_decrypt)(struct crypto_tfm *tfm, int (*cit_decrypt)(struct crypto_tfm *tfm,
struct scatterlist *dst, struct scatterlist *dst,
struct scatterlist *src, struct scatterlist *src,
...@@ -162,21 +162,21 @@ struct cipher_tfm { ...@@ -162,21 +162,21 @@ struct cipher_tfm {
struct digest_tfm { struct digest_tfm {
void (*dit_init)(struct crypto_tfm *tfm); void (*dit_init)(struct crypto_tfm *tfm);
void (*dit_update)(struct crypto_tfm *tfm, void (*dit_update)(struct crypto_tfm *tfm,
struct scatterlist *sg, unsigned int nsg); struct scatterlist *sg, unsigned int nsg);
void (*dit_final)(struct crypto_tfm *tfm, u8 *out); void (*dit_final)(struct crypto_tfm *tfm, u8 *out);
void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg, void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg,
unsigned int nsg, u8 *out); unsigned int nsg, u8 *out);
int (*dit_setkey)(struct crypto_tfm *tfm, int (*dit_setkey)(struct crypto_tfm *tfm,
const u8 *key, unsigned int keylen); const u8 *key, unsigned int keylen);
}; };
struct compress_tfm { struct compress_tfm {
int (*cot_compress)(struct crypto_tfm *tfm, int (*cot_compress)(struct crypto_tfm *tfm,
const u8 *src, unsigned int slen, const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen); u8 *dst, unsigned int *dlen);
int (*cot_decompress)(struct crypto_tfm *tfm, int (*cot_decompress)(struct crypto_tfm *tfm,
const u8 *src, unsigned int slen, const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen); u8 *dst, unsigned int *dlen);
}; };
#define crt_cipher crt_u.cipher #define crt_cipher crt_u.cipher
...@@ -274,8 +274,8 @@ static inline void crypto_digest_init(struct crypto_tfm *tfm) ...@@ -274,8 +274,8 @@ static inline void crypto_digest_init(struct crypto_tfm *tfm)
} }
static inline void crypto_digest_update(struct crypto_tfm *tfm, static inline void crypto_digest_update(struct crypto_tfm *tfm,
struct scatterlist *sg, struct scatterlist *sg,
unsigned int nsg) unsigned int nsg)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
tfm->crt_digest.dit_update(tfm, sg, nsg); tfm->crt_digest.dit_update(tfm, sg, nsg);
...@@ -288,15 +288,15 @@ static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out) ...@@ -288,15 +288,15 @@ static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out)
} }
static inline void crypto_digest_digest(struct crypto_tfm *tfm, static inline void crypto_digest_digest(struct crypto_tfm *tfm,
struct scatterlist *sg, struct scatterlist *sg,
unsigned int nsg, u8 *out) unsigned int nsg, u8 *out)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
tfm->crt_digest.dit_digest(tfm, sg, nsg, out); tfm->crt_digest.dit_digest(tfm, sg, nsg, out);
} }
static inline int crypto_digest_setkey(struct crypto_tfm *tfm, static inline int crypto_digest_setkey(struct crypto_tfm *tfm,
const u8 *key, unsigned int keylen) const u8 *key, unsigned int keylen)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
if (tfm->crt_digest.dit_setkey == NULL) if (tfm->crt_digest.dit_setkey == NULL)
...@@ -305,25 +305,25 @@ static inline int crypto_digest_setkey(struct crypto_tfm *tfm, ...@@ -305,25 +305,25 @@ static inline int crypto_digest_setkey(struct crypto_tfm *tfm,
} }
static inline int crypto_cipher_setkey(struct crypto_tfm *tfm, static inline int crypto_cipher_setkey(struct crypto_tfm *tfm,
const u8 *key, unsigned int keylen) const u8 *key, unsigned int keylen)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
return tfm->crt_cipher.cit_setkey(tfm, key, keylen); return tfm->crt_cipher.cit_setkey(tfm, key, keylen);
} }
static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
struct scatterlist *dst, struct scatterlist *dst,
struct scatterlist *src, struct scatterlist *src,
unsigned int nbytes) unsigned int nbytes)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes); return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes);
} }
static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm, static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
struct scatterlist *dst, struct scatterlist *dst,
struct scatterlist *src, struct scatterlist *src,
unsigned int nbytes, u8 *iv) unsigned int nbytes, u8 *iv)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB);
...@@ -331,18 +331,18 @@ static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm, ...@@ -331,18 +331,18 @@ static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
} }
static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
struct scatterlist *dst, struct scatterlist *dst,
struct scatterlist *src, struct scatterlist *src,
unsigned int nbytes) unsigned int nbytes)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes);
} }
static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
struct scatterlist *dst, struct scatterlist *dst,
struct scatterlist *src, struct scatterlist *src,
unsigned int nbytes, u8 *iv) unsigned int nbytes, u8 *iv)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB);
...@@ -350,30 +350,30 @@ static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, ...@@ -350,30 +350,30 @@ static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
} }
static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm, static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm,
const u8 *src, unsigned int len) const u8 *src, unsigned int len)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
memcpy(tfm->crt_cipher.cit_iv, src, len); memcpy(tfm->crt_cipher.cit_iv, src, len);
} }
static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm, static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
u8 *dst, unsigned int len) u8 *dst, unsigned int len)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
memcpy(dst, tfm->crt_cipher.cit_iv, len); memcpy(dst, tfm->crt_cipher.cit_iv, len);
} }
static inline int crypto_comp_compress(struct crypto_tfm *tfm, static inline int crypto_comp_compress(struct crypto_tfm *tfm,
const u8 *src, unsigned int slen, const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen) u8 *dst, unsigned int *dlen)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS);
return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen); return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen);
} }
static inline int crypto_comp_decompress(struct crypto_tfm *tfm, static inline int crypto_comp_decompress(struct crypto_tfm *tfm,
const u8 *src, unsigned int slen, const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen) u8 *dst, unsigned int *dlen)
{ {
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS);
return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen); return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen);
......
...@@ -53,12 +53,10 @@ u32 DBGP_Type[DBGP_TYPE_MAX]; ...@@ -53,12 +53,10 @@ u32 DBGP_Type[DBGP_TYPE_MAX];
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
void rtl8192_dbgp_flag_init(struct net_device *dev) void rtl8192_dbgp_flag_init(struct net_device *dev)
{ {
u8 i; u8 i;
for (i = 0; i < DBGP_TYPE_MAX; i++) for (i = 0; i < DBGP_TYPE_MAX; i++)
{
DBGP_Type[i] = 0; DBGP_Type[i] = 0;
}
} /* DBGP_Flag_Init */ } /* DBGP_Flag_Init */
...@@ -67,19 +65,19 @@ void rtl8192_dbgp_flag_init(struct net_device *dev) ...@@ -67,19 +65,19 @@ void rtl8192_dbgp_flag_init(struct net_device *dev)
void print_buffer(u32 *buffer, int len) void print_buffer(u32 *buffer, int len)
{ {
int i; int i;
u8 *buf =(u8*)buffer; u8 *buf = (u8 *)buffer;
printk("ASCII BUFFER DUMP (len: %x):\n",len); printk(KERN_INFO "ASCII BUFFER DUMP (len: %x):\n", len);
for (i=0;i<len;i++) for (i = 0; i < len; i++)
printk("%c",buf[i]); printk(KERN_INFO "%c", buf[i]);
printk("\nBINARY BUFFER DUMP (len: %x):\n",len); printk(KERN_INFO "\nBINARY BUFFER DUMP (len: %x):\n", len);
for (i=0;i<len;i++) for (i = 0; i < len; i++)
printk("%x",buf[i]); printk(KERN_INFO "%x", buf[i]);
printk("\n"); printk(KERN_INFO "\n");
} }
/* this is only for debug */ /* this is only for debug */
...@@ -87,9 +85,9 @@ void dump_eprom(struct net_device *dev) ...@@ -87,9 +85,9 @@ void dump_eprom(struct net_device *dev)
{ {
int i; int i;
for (i = 0; i < 0xff; i++) { for (i = 0; i < 0xff; i++)
RT_TRACE(COMP_INIT, "EEPROM addr %x : %x", i, eprom_read(dev,i)); RT_TRACE(COMP_INIT, "EEPROM addr %x : %x", i,
} eprom_read(dev, i));
} }
/* this is only for debug */ /* this is only for debug */
...@@ -102,18 +100,18 @@ void rtl8192_dump_reg(struct net_device *dev) ...@@ -102,18 +100,18 @@ void rtl8192_dump_reg(struct net_device *dev)
RT_TRACE(COMP_INIT, "Dumping NIC register map"); RT_TRACE(COMP_INIT, "Dumping NIC register map");
for (n = 0; n <= max; ) { for (n = 0; n <= max; ) {
printk( "\nD: %2x> ", n); printk(KERN_INFO "\nD: %2x> ", n);
for (i = 0; i < 16 && n <= max; i++, n++) for (i = 0; i < 16 && n <= max; i++, n++)
printk("%2x ", read_nic_byte(dev, n)); printk(KERN_INFO "%2x ", read_nic_byte(dev, n));
} }
printk("\n"); printk(KERN_INFO "\n");
} }
/**************************************************************************** /****************************************************************************
-----------------------------PROCFS STUFF------------------------- -----------------------------PROCFS STUFF-------------------------
*****************************************************************************/ *****************************************************************************/
/*This part is related to PROC, which will record some statistics. */ /*This part is related to PROC, which will record some statistics. */
static struct proc_dir_entry *rtl8192_proc = NULL; static struct proc_dir_entry *rtl8192_proc;
static int proc_get_stats_ap(char *page, char **start, static int proc_get_stats_ap(char *page, char **start,
off_t offset, int count, off_t offset, int count,
...@@ -123,24 +121,21 @@ static int proc_get_stats_ap(char *page, char **start, ...@@ -123,24 +121,21 @@ static int proc_get_stats_ap(char *page, char **start,
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
struct rtllib_device *ieee = priv->rtllib; struct rtllib_device *ieee = priv->rtllib;
struct rtllib_network *target; struct rtllib_network *target;
int len = 0; int len = 0;
list_for_each_entry(target, &ieee->network_list, list) { list_for_each_entry(target, &ieee->network_list, list) {
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%s ", target->ssid); "%s ", target->ssid);
if (target->wpa_ie_len>0 || target->rsn_ie_len>0){ if (target->wpa_ie_len > 0 || target->rsn_ie_len > 0)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"WPA\n"); "WPA\n");
} else
else{ len += snprintf(page + len, count - len,
len += snprintf(page + len, count - len, "non_WPA\n");
"non_WPA\n");
}
} }
*eof = 1; *eof = 1;
return len; return len;
...@@ -153,25 +148,25 @@ static int proc_get_registers_0(char *page, char **start, ...@@ -153,25 +148,25 @@ static int proc_get_registers_0(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x000; page0 = 0x000;
{ len += snprintf(page + len, count - len,
len += snprintf(page + len, count - len, "\n####################page %x##################\n ",
"\n####################page %x##################\n ", (page0>>8)); (page0>>8));
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); "\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B "
for (n=0;n<=max;) "0C 0D 0E 0F");
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, "\nD: %2x > ",n); len += snprintf(page + len, count - len, "\nD: %2x > ", n);
for (i=0;i<16 && n<=max;n++,i++) for (i = 0; i < 16 && n <= max; n++, i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%2.2x ",read_nic_byte(dev,(page0|n))); "%2.2x ", read_nic_byte(dev,
} (page0 | n)));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
...@@ -183,25 +178,27 @@ static int proc_get_registers_1(char *page, char **start, ...@@ -183,25 +178,27 @@ static int proc_get_registers_1(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x100; page0 = 0x100;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n ",
(page0>>8));
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); "\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B "
for (n=0;n<=max;) "0C 0D 0E 0F");
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: %2x > ",n); "\nD: %2x > ", n);
for (i=0;i<16 && n<=max;i++,n++) for (i = 0; i < 16 && n <= max; i++, n++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%2.2x ",read_nic_byte(dev,(page0|n))); "%2.2x ", read_nic_byte(dev,
(page0 | n)));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
...@@ -213,25 +210,27 @@ static int proc_get_registers_2(char *page, char **start, ...@@ -213,25 +210,27 @@ static int proc_get_registers_2(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x200; page0 = 0x200;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n ",
(page0 >> 8));
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); "\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C "
for (n=0;n<=max;) "0D 0E 0F");
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: %2x > ",n); "\nD: %2x > ", n);
for (i=0;i<16 && n<=max;i++,n++) for (i = 0; i < 16 && n <= max; i++, n++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%2.2x ",read_nic_byte(dev,(page0|n))); "%2.2x ", read_nic_byte(dev,
(page0 | n)));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
...@@ -243,25 +242,27 @@ static int proc_get_registers_3(char *page, char **start, ...@@ -243,25 +242,27 @@ static int proc_get_registers_3(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x300; page0 = 0x300;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n ",
(page0>>8));
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); "\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B "
for (n=0;n<=max;) "0C 0D 0E 0F");
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: %2x > ",n); "\nD: %2x > ", n);
for (i=0;i<16 && n<=max;i++,n++) for (i = 0; i < 16 && n <= max; i++, n++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%2.2x ",read_nic_byte(dev,(page0|n))); "%2.2x ", read_nic_byte(dev,
(page0 | n)));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
...@@ -273,117 +274,125 @@ static int proc_get_registers_4(char *page, char **start, ...@@ -273,117 +274,125 @@ static int proc_get_registers_4(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x400; page0 = 0x400;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n ",
(page0>>8));
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); "\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B "
for (n=0;n<=max;) "0C 0D 0E 0F");
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: %2x > ",n); "\nD: %2x > ", n);
for (i=0;i<16 && n<=max;i++,n++) for (i = 0; i < 16 && n <= max; i++, n++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%2.2x ",read_nic_byte(dev,(page0|n))); "%2.2x ", read_nic_byte(dev,
(page0 | n)));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
static int proc_get_registers_5(char *page, char **start, static int proc_get_registers_5(char *page, char **start,
off_t offset, int count, off_t offset, int count,
int *eof, void *data) int *eof, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x500; page0 = 0x500;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n ",
(page0 >> 8));
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); "\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B "
for (n=0;n<=max;) "0C 0D 0E 0F");
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: %2x > ",n); "\nD: %2x > ", n);
for (i=0;i<16 && n<=max;i++,n++) for (i = 0; i < 16 && n <= max; i++, n++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%2.2x ",read_nic_byte(dev,(page0|n))); "%2.2x ", read_nic_byte(dev,
} (page0 | n)));
len += snprintf(page + len, count - len,"\n"); }
*eof = 1; len += snprintf(page + len, count - len, "\n");
return len; *eof = 1;
return len;
} }
static int proc_get_registers_6(char *page, char **start, static int proc_get_registers_6(char *page, char **start,
off_t offset, int count, off_t offset, int count,
int *eof, void *data) int *eof, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x600; page0 = 0x600;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8));
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); "\n####################page %x##################\n ",
for (n=0;n<=max;) (page0>>8));
{ len += snprintf(page + len, count - len,
len += snprintf(page + len, count - len, "\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B "
"\nD: %2x > ",n); "0C 0D 0E 0F");
for (i=0;i<16 && n<=max;i++,n++) for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%2.2x ",read_nic_byte(dev,(page0|n))); "\nD: %2x > ", n);
} for (i = 0; i < 16 && n <= max; i++, n++)
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len,
*eof = 1; "%2.2x ", read_nic_byte(dev,
return len; (page0 | n)));
}
len += snprintf(page + len, count - len, "\n");
*eof = 1;
return len;
} }
static int proc_get_registers_7(char *page, char **start, static int proc_get_registers_7(char *page, char **start,
off_t offset, int count, off_t offset, int count,
int *eof, void *data) int *eof, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x700; page0 = 0x700;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n ",
(page0 >> 8));
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); "\nD: OF > 00 01 02 03 04 05 06 07 08 09 0A 0B 0C "
for (n=0;n<=max;) "0D 0E 0F");
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\nD: %2x > ",n); "\nD: %2x > ", n);
for (i=0;i<16 && n<=max;i++,n++) for (i = 0; i < 16 && n <= max; i++, n++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%2.2x ",read_nic_byte(dev,(page0|n))); "%2.2x ", read_nic_byte(dev,
} (page0 | n)));
len += snprintf(page + len, count - len,"\n"); }
*eof = 1; len += snprintf(page + len, count - len, "\n");
return len; *eof = 1;
return len;
} }
static int proc_get_registers_8(char *page, char **start, static int proc_get_registers_8(char *page, char **start,
...@@ -393,22 +402,23 @@ static int proc_get_registers_8(char *page, char **start, ...@@ -393,22 +402,23 @@ static int proc_get_registers_8(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x800; page0 = 0x800;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n",
for (n=0;n<=max;) (page0 >> 8));
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, "\nD: %2x > ",n); len += snprintf(page + len, count - len, "\nD: %2x > ", n);
for (i=0;i<4 && n<=max;n+=4,i++) for (i = 0; i < 4 && n <= max; n += 4, i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_QueryBBReg(dev,(page0|n), bMaskDWord)); "%8.8x ", rtl8192_QueryBBReg(dev,
(page0 | n), bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
...@@ -420,22 +430,23 @@ static int proc_get_registers_9(char *page, char **start, ...@@ -420,22 +430,23 @@ static int proc_get_registers_9(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0x900; page0 = 0x900;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n",
for (n=0;n<=max;) (page0>>8));
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, "\nD: %2x > ",n); len += snprintf(page + len, count - len, "\nD: %2x > ", n);
for (i=0;i<4 && n<=max;n+=4,i++) for (i = 0; i < 4 && n <= max; n += 4, i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_QueryBBReg(dev,(page0|n), bMaskDWord)); "%8.8x ", rtl8192_QueryBBReg(dev,
(page0 | n), bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -446,22 +457,23 @@ static int proc_get_registers_a(char *page, char **start, ...@@ -446,22 +457,23 @@ static int proc_get_registers_a(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0xa00; page0 = 0xa00;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n",
for (n=0;n<=max;) (page0>>8));
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, "\nD: %2x > ",n); len += snprintf(page + len, count - len, "\nD: %2x > ", n);
for (i=0;i<4 && n<=max;n+=4,i++) for (i = 0; i < 4 && n <= max; n += 4, i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_QueryBBReg(dev,(page0|n), bMaskDWord)); "%8.8x ", rtl8192_QueryBBReg(dev,
(page0 | n), bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -472,22 +484,23 @@ static int proc_get_registers_b(char *page, char **start, ...@@ -472,22 +484,23 @@ static int proc_get_registers_b(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0xb00; page0 = 0xb00;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n",
for (n=0;n<=max;) (page0 >> 8));
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, "\nD: %2x > ",n); len += snprintf(page + len, count - len, "\nD: %2x > ", n);
for (i=0;i<4 && n<=max;n+=4,i++) for (i = 0; i < 4 && n <= max; n += 4, i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_QueryBBReg(dev,(page0|n), bMaskDWord)); "%8.8x ", rtl8192_QueryBBReg(dev,
(page0 | n), bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -498,22 +511,23 @@ static int proc_get_registers_c(char *page, char **start, ...@@ -498,22 +511,23 @@ static int proc_get_registers_c(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0xc00; page0 = 0xc00;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n",
for (n=0;n<=max;) (page0>>8));
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, "\nD: %2x > ",n); len += snprintf(page + len, count - len, "\nD: %2x > ", n);
for (i=0;i<4 && n<=max;n+=4,i++) for (i = 0; i < 4 && n <= max; n += 4, i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_QueryBBReg(dev,(page0|n), bMaskDWord)); "%8.8x ", rtl8192_QueryBBReg(dev,
(page0 | n), bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -524,22 +538,23 @@ static int proc_get_registers_d(char *page, char **start, ...@@ -524,22 +538,23 @@ static int proc_get_registers_d(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0xd00; page0 = 0xd00;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n",
for (n=0;n<=max;) (page0>>8));
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, "\nD: %2x > ",n); len += snprintf(page + len, count - len, "\nD: %2x > ", n);
for (i=0;i<4 && n<=max;n+=4,i++) for (i = 0; i < 4 && n <= max; n += 4, i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_QueryBBReg(dev,(page0|n), bMaskDWord)); "%8.8x ", rtl8192_QueryBBReg(dev,
(page0 | n), bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -550,22 +565,23 @@ static int proc_get_registers_e(char *page, char **start, ...@@ -550,22 +565,23 @@ static int proc_get_registers_e(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n,page0; int i, n, page0;
int max=0xff; int max = 0xff;
page0 = 0xe00; page0 = 0xe00;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n####################page %x##################\n ", (page0>>8)); "\n####################page %x##################\n",
for (n=0;n<=max;) (page0>>8));
{ for (n = 0; n <= max;) {
len += snprintf(page + len, count - len, "\nD: %2x > ",n); len += snprintf(page + len, count - len, "\nD: %2x > ", n);
for (i=0;i<4 && n<=max;n+=4,i++) for (i = 0; i < 4 && n <= max; n += 4, i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_QueryBBReg(dev,(page0|n), bMaskDWord)); "%8.8x ", rtl8192_QueryBBReg(dev,
(page0 | n), bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -577,21 +593,22 @@ static int proc_get_reg_rf_a(char *page, char **start, ...@@ -577,21 +593,22 @@ static int proc_get_reg_rf_a(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n; int i, n;
int max=0xff; int max = 0xff;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n#################### RF-A ##################\n "); "\n#################### RF-A ##################\n ");
for (n=0;n<=max;) for (n = 0; n <= max;) {
{ len += snprintf(page + len, count - len, "\nD: %2x > ", n);
len += snprintf(page + len, count - len, "\nD: %2x > ",n); for (i = 0; i < 4 && n <= max; n += 4, i++)
for (i=0;i<4 && n<=max;n+=4,i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_phy_QueryRFReg(dev, (enum rf90_radio_path)RF90_PATH_A,n, bMaskDWord)); "%8.8x ", rtl8192_phy_QueryRFReg(dev,
(enum rf90_radio_path)RF90_PATH_A, n,
bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -603,21 +620,22 @@ static int proc_get_reg_rf_b(char *page, char **start, ...@@ -603,21 +620,22 @@ static int proc_get_reg_rf_b(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n; int i, n;
int max=0xff; int max = 0xff;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n#################### RF-B ##################\n "); "\n#################### RF-B ##################\n ");
for (n=0;n<=max;) for (n = 0; n <= max;) {
{ len += snprintf(page + len, count - len, "\nD: %2x > ", n);
len += snprintf(page + len, count - len, "\nD: %2x > ",n); for (i = 0; i < 4 && n <= max; n += 4, i++)
for (i=0;i<4 && n<=max;n+=4,i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_phy_QueryRFReg(dev, (enum rf90_radio_path)RF90_PATH_B, n, bMaskDWord)); "%8.8x ", rtl8192_phy_QueryRFReg(dev,
(enum rf90_radio_path)RF90_PATH_B, n,
bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -629,21 +647,22 @@ static int proc_get_reg_rf_c(char *page, char **start, ...@@ -629,21 +647,22 @@ static int proc_get_reg_rf_c(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n; int i, n;
int max=0xff; int max = 0xff;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n#################### RF-C ##################\n "); "\n#################### RF-C ##################\n");
for (n=0;n<=max;) for (n = 0; n <= max;) {
{ len += snprintf(page + len, count - len, "\nD: %2x > ", n);
len += snprintf(page + len, count - len, "\nD: %2x > ",n); for (i = 0; i < 4 && n <= max; n += 4, i++)
for (i=0;i<4 && n<=max;n+=4,i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_phy_QueryRFReg(dev, (enum rf90_radio_path)RF90_PATH_C, n, bMaskDWord)); "%8.8x ", rtl8192_phy_QueryRFReg(dev,
(enum rf90_radio_path)RF90_PATH_C, n,
bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -655,21 +674,22 @@ static int proc_get_reg_rf_d(char *page, char **start, ...@@ -655,21 +674,22 @@ static int proc_get_reg_rf_d(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
int len = 0; int len = 0;
int i,n; int i, n;
int max=0xff; int max = 0xff;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n#################### RF-D ##################\n "); "\n#################### RF-D ##################\n ");
for (n=0;n<=max;) for (n = 0; n <= max;) {
{ len += snprintf(page + len, count - len, "\nD: %2x > ", n);
len += snprintf(page + len, count - len, "\nD: %2x > ",n); for (i = 0; i < 4 && n <= max; n += 4, i++)
for (i=0;i<4 && n<=max;n+=4,i++)
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"%8.8x ",rtl8192_phy_QueryRFReg(dev, (enum rf90_radio_path)RF90_PATH_D, n, bMaskDWord)); "%8.8x ", rtl8192_phy_QueryRFReg(dev,
(enum rf90_radio_path)RF90_PATH_D, n,
bMaskDWord));
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -679,41 +699,38 @@ static int proc_get_cam_register_1(char *page, char **start, ...@@ -679,41 +699,38 @@ static int proc_get_cam_register_1(char *page, char **start,
int *eof, void *data) int *eof, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
u32 target_command=0; u32 target_command = 0;
u32 target_content=0; u32 target_content = 0;
u8 entry_i=0; u8 entry_i = 0;
u32 ulStatus; u32 ulStatus;
int len = 0; int len = 0;
int i=100, j = 0; int i = 100, j = 0;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n#################### SECURITY CAM (0-10) ##################\n "); "\n#################### SECURITY CAM (0-10) ######"
for (j=0; j<11; j++) "############\n ");
{ for (j = 0; j < 11; j++) {
len += snprintf(page + len, count - len, "\nD: %2x > ",j); len += snprintf(page + len, count - len, "\nD: %2x > ", j);
for (entry_i=0;entry_i<CAM_CONTENT_COUNT;entry_i++) for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
{ target_command = entry_i+CAM_CONTENT_COUNT*j;
target_command= entry_i+CAM_CONTENT_COUNT*j; target_command = target_command | BIT31;
target_command= target_command | BIT31;
while ((i--) >= 0) {
while((i--)>=0)
{
ulStatus = read_nic_dword(dev, RWCAM); ulStatus = read_nic_dword(dev, RWCAM);
if (ulStatus & BIT31){ if (ulStatus & BIT31)
continue; continue;
} else
else{
break; break;
}
} }
write_nic_dword(dev, RWCAM, target_command); write_nic_dword(dev, RWCAM, target_command);
target_content = read_nic_dword(dev, RCAMO); target_content = read_nic_dword(dev, RCAMO);
len += snprintf(page + len, count - len,"%8.8x ",target_content); len += snprintf(page + len, count - len, "%8.8x ",
target_content);
} }
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -723,41 +740,38 @@ static int proc_get_cam_register_2(char *page, char **start, ...@@ -723,41 +740,38 @@ static int proc_get_cam_register_2(char *page, char **start,
int *eof, void *data) int *eof, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
u32 target_command=0; u32 target_command = 0;
u32 target_content=0; u32 target_content = 0;
u8 entry_i=0; u8 entry_i = 0;
u32 ulStatus; u32 ulStatus;
int len = 0; int len = 0;
int i=100, j = 0; int i = 100, j = 0;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n#################### SECURITY CAM (11-21) ##################\n "); "\n#################### SECURITY CAM (11-21) "
for (j=11; j<22; j++) "##################\n ");
{ for (j = 11; j < 22; j++) {
len += snprintf(page + len, count - len, "\nD: %2x > ",j); len += snprintf(page + len, count - len, "\nD: %2x > ", j);
for (entry_i=0;entry_i<CAM_CONTENT_COUNT;entry_i++) for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
{ target_command = entry_i + CAM_CONTENT_COUNT * j;
target_command= entry_i+CAM_CONTENT_COUNT*j; target_command = target_command | BIT31;
target_command= target_command | BIT31;
while ((i--) >= 0) {
while((i--)>=0)
{
ulStatus = read_nic_dword(dev, RWCAM); ulStatus = read_nic_dword(dev, RWCAM);
if (ulStatus & BIT31){ if (ulStatus & BIT31)
continue; continue;
} else
else{
break; break;
}
} }
write_nic_dword(dev, RWCAM, target_command); write_nic_dword(dev, RWCAM, target_command);
target_content = read_nic_dword(dev, RCAMO); target_content = read_nic_dword(dev, RCAMO);
len += snprintf(page + len, count - len,"%8.8x ",target_content); len += snprintf(page + len, count - len, "%8.8x ",
target_content);
} }
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -767,41 +781,38 @@ static int proc_get_cam_register_3(char *page, char **start, ...@@ -767,41 +781,38 @@ static int proc_get_cam_register_3(char *page, char **start,
int *eof, void *data) int *eof, void *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
u32 target_command=0; u32 target_command = 0;
u32 target_content=0; u32 target_content = 0;
u8 entry_i=0; u8 entry_i = 0;
u32 ulStatus; u32 ulStatus;
int len = 0; int len = 0;
int i=100, j = 0; int i = 100, j = 0;
/* This dump the current register page */ /* This dump the current register page */
len += snprintf(page + len, count - len, len += snprintf(page + len, count - len,
"\n#################### SECURITY CAM (22-31) ##################\n "); "\n#################### SECURITY CAM (22-31) ######"
for (j=22; j<TOTAL_CAM_ENTRY; j++) "############\n ");
{ for (j = 22; j < TOTAL_CAM_ENTRY; j++) {
len += snprintf(page + len, count - len, "\nD: %2x > ",j); len += snprintf(page + len, count - len, "\nD: %2x > ", j);
for (entry_i=0;entry_i<CAM_CONTENT_COUNT;entry_i++) for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
{ target_command = entry_i + CAM_CONTENT_COUNT * j;
target_command= entry_i+CAM_CONTENT_COUNT*j; target_command = target_command | BIT31;
target_command= target_command | BIT31;
while ((i--) >= 0) {
while((i--)>=0)
{
ulStatus = read_nic_dword(dev, RWCAM); ulStatus = read_nic_dword(dev, RWCAM);
if (ulStatus & BIT31){ if (ulStatus & BIT31)
continue; continue;
} else
else{
break; break;
}
} }
write_nic_dword(dev, RWCAM, target_command); write_nic_dword(dev, RWCAM, target_command);
target_content = read_nic_dword(dev, RCAMO); target_content = read_nic_dword(dev, RCAMO);
len += snprintf(page + len, count - len,"%8.8x ",target_content); len += snprintf(page + len, count - len, "%8.8x ",
target_content);
} }
} }
len += snprintf(page + len, count - len,"\n"); len += snprintf(page + len, count - len, "\n");
*eof = 1; *eof = 1;
return len; return len;
} }
...@@ -877,7 +888,7 @@ static int proc_get_stats_rx(char *page, char **start, ...@@ -877,7 +888,7 @@ static int proc_get_stats_rx(char *page, char **start,
void rtl8192_proc_module_init(void) void rtl8192_proc_module_init(void)
{ {
RT_TRACE(COMP_INIT, "Initializing proc filesystem"); RT_TRACE(COMP_INIT, "Initializing proc filesystem");
rtl8192_proc=create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net); rtl8192_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net);
} }
...@@ -891,7 +902,7 @@ void rtl8192_proc_remove_one(struct net_device *dev) ...@@ -891,7 +902,7 @@ void rtl8192_proc_remove_one(struct net_device *dev)
{ {
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
printk("dev name %s\n",dev->name); printk(KERN_INFO "dev name %s\n", dev->name);
if (priv->dir_dev) { if (priv->dir_dev) {
remove_proc_entry("stats-tx", priv->dir_dev); remove_proc_entry("stats-tx", priv->dir_dev);
...@@ -929,194 +940,169 @@ void rtl8192_proc_init_one(struct net_device *dev) ...@@ -929,194 +940,169 @@ void rtl8192_proc_init_one(struct net_device *dev)
{ {
struct proc_dir_entry *e; struct proc_dir_entry *e;
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
priv->dir_dev = create_proc_entry(dev->name, priv->dir_dev = create_proc_entry(dev->name,
S_IFDIR | S_IRUGO | S_IXUGO, S_IFDIR | S_IRUGO | S_IXUGO,
rtl8192_proc); rtl8192_proc);
if (!priv->dir_dev) { if (!priv->dir_dev) {
RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n", RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192"
dev->name); "/%s\n", dev->name);
return; return;
} }
e = create_proc_read_entry("stats-rx", S_IFREG | S_IRUGO, e = create_proc_read_entry("stats-rx", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_stats_rx, dev); priv->dir_dev, proc_get_stats_rx, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR,"Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/stats-rx\n", "/proc/net/rtl8192/%s/stats-rx\n",
dev->name); dev->name);
}
e = create_proc_read_entry("stats-tx", S_IFREG | S_IRUGO, e = create_proc_read_entry("stats-tx", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_stats_tx, dev); priv->dir_dev, proc_get_stats_tx, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/stats-tx\n", "/proc/net/rtl8192/%s/stats-tx\n",
dev->name); dev->name);
}
e = create_proc_read_entry("stats-ap", S_IFREG | S_IRUGO, e = create_proc_read_entry("stats-ap", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_stats_ap, dev); priv->dir_dev, proc_get_stats_ap, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/stats-ap\n", "/proc/net/rtl8192/%s/stats-ap\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-0", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-0", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_0, dev); priv->dir_dev, proc_get_registers_0, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-0\n", "/proc/net/rtl8192/%s/registers-0\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-1", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-1", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_1, dev); priv->dir_dev, proc_get_registers_1, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-1\n", "/proc/net/rtl8192/%s/registers-1\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-2", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-2", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_2, dev); priv->dir_dev, proc_get_registers_2, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-2\n", "/proc/net/rtl8192/%s/registers-2\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-3", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-3", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_3, dev); priv->dir_dev, proc_get_registers_3, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-3\n", "/proc/net/rtl8192/%s/registers-3\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-4", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-4", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_4, dev); priv->dir_dev, proc_get_registers_4, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-4\n", "/proc/net/rtl8192/%s/registers-4\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-5", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-5", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_5, dev); priv->dir_dev, proc_get_registers_5, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-5\n", "/proc/net/rtl8192/%s/registers-5\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-6", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-6", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_6, dev); priv->dir_dev, proc_get_registers_6, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-6\n", "/proc/net/rtl8192/%s/registers-6\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-7", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-7", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_7, dev); priv->dir_dev, proc_get_registers_7, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-7\n", "/proc/net/rtl8192/%s/registers-7\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-8", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-8", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_8, dev); priv->dir_dev, proc_get_registers_8, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-8\n", "/proc/net/rtl8192/%s/registers-8\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-9", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-9", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_9, dev); priv->dir_dev, proc_get_registers_9, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-9\n", "/proc/net/rtl8192/%s/registers-9\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-a", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-a", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_a, dev); priv->dir_dev, proc_get_registers_a, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-a\n", "/proc/net/rtl8192/%s/registers-a\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-b", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-b", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_b, dev); priv->dir_dev, proc_get_registers_b, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-b\n", "/proc/net/rtl8192/%s/registers-b\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-c", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-c", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_c, dev); priv->dir_dev, proc_get_registers_c, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-c\n", "/proc/net/rtl8192/%s/registers-c\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-d", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-d", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_d, dev); priv->dir_dev, proc_get_registers_d, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-d\n", "/proc/net/rtl8192/%s/registers-d\n",
dev->name); dev->name);
}
e = create_proc_read_entry("registers-e", S_IFREG | S_IRUGO, e = create_proc_read_entry("registers-e", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_registers_e, dev); priv->dir_dev, proc_get_registers_e, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/registers-e\n", "/proc/net/rtl8192/%s/registers-e\n",
dev->name); dev->name);
}
e = create_proc_read_entry("RF-A", S_IFREG | S_IRUGO, e = create_proc_read_entry("RF-A", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_reg_rf_a, dev); priv->dir_dev, proc_get_reg_rf_a, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/RF-A\n", "/proc/net/rtl8192/%s/RF-A\n",
dev->name); dev->name);
}
e = create_proc_read_entry("RF-B", S_IFREG | S_IRUGO, e = create_proc_read_entry("RF-B", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_reg_rf_b, dev); priv->dir_dev, proc_get_reg_rf_b, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/RF-B\n", "/proc/net/rtl8192/%s/RF-B\n",
dev->name); dev->name);
}
e = create_proc_read_entry("RF-C", S_IFREG | S_IRUGO, e = create_proc_read_entry("RF-C", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_reg_rf_c, dev); priv->dir_dev, proc_get_reg_rf_c, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/RF-C\n", "/proc/net/rtl8192/%s/RF-C\n",
dev->name); dev->name);
}
e = create_proc_read_entry("RF-D", S_IFREG | S_IRUGO, e = create_proc_read_entry("RF-D", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_reg_rf_d, dev); priv->dir_dev, proc_get_reg_rf_d, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/RF-D\n", "/proc/net/rtl8192/%s/RF-D\n",
dev->name); dev->name);
}
e = create_proc_read_entry("SEC-CAM-1", S_IFREG | S_IRUGO, e = create_proc_read_entry("SEC-CAM-1", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_cam_register_1, dev); priv->dir_dev, proc_get_cam_register_1, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/SEC-CAM-1\n", "/proc/net/rtl8192/%s/SEC-CAM-1\n",
dev->name); dev->name);
}
e = create_proc_read_entry("SEC-CAM-2", S_IFREG | S_IRUGO, e = create_proc_read_entry("SEC-CAM-2", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_cam_register_2, dev); priv->dir_dev, proc_get_cam_register_2, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/SEC-CAM-2\n", "/proc/net/rtl8192/%s/SEC-CAM-2\n",
dev->name); dev->name);
}
e = create_proc_read_entry("SEC-CAM-3", S_IFREG | S_IRUGO, e = create_proc_read_entry("SEC-CAM-3", S_IFREG | S_IRUGO,
priv->dir_dev, proc_get_cam_register_3, dev); priv->dir_dev, proc_get_cam_register_3, dev);
if (!e) { if (!e)
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/SEC-CAM-3\n", "/proc/net/rtl8192/%s/SEC-CAM-3\n",
dev->name); dev->name);
}
} }
...@@ -36,31 +36,30 @@ struct net_device; ...@@ -36,31 +36,30 @@ struct net_device;
#define DBG_LOUD 4 #define DBG_LOUD 4
#define RT_ASSERT(_Exp,Fmt) \ #define RT_ASSERT(_Exp, Fmt) \
if (!(_Exp)) \ if (!(_Exp)) { \
{ \ printk("Rtl819x: "); \
printk("Rtl819x: "); \ printk Fmt; \
printk Fmt; \
} }
enum dbgp_flag { enum dbgp_flag {
FQoS = 0, FQoS = 0,
FTX = 1, FTX = 1,
FRX = 2, FRX = 2,
FSEC = 3, FSEC = 3,
FMGNT = 4, FMGNT = 4,
FMLME = 5, FMLME = 5,
FRESOURCE = 6, FRESOURCE = 6,
FBEACON = 7, FBEACON = 7,
FISR = 8, FISR = 8,
FPHY = 9, FPHY = 9,
FMP = 10, FMP = 10,
FEEPROM = 11, FEEPROM = 11,
FPWR = 12, FPWR = 12,
FDM = 13, FDM = 13,
FDBGCtrl = 14, FDBGCtrl = 14,
FC2H = 15, FC2H = 15,
FBT = 16, FBT = 16,
FINIT = 17, FINIT = 17,
FIOCTL = 18, FIOCTL = 18,
DBGP_TYPE_MAX DBGP_TYPE_MAX
...@@ -76,10 +75,10 @@ enum dbgp_flag { ...@@ -76,10 +75,10 @@ enum dbgp_flag {
#define RX_PHY_STS BIT1 #define RX_PHY_STS BIT1
#define RX_PHY_SS BIT2 #define RX_PHY_SS BIT2
#define RX_PHY_SQ BIT3 #define RX_PHY_SQ BIT3
#define RX_PHY_ASTS BIT4 #define RX_PHY_ASTS BIT4
#define RX_ERR_LEN BIT5 #define RX_ERR_LEN BIT5
#define RX_DEFRAG BIT6 #define RX_DEFRAG BIT6
#define RX_ERR_RATE BIT7 #define RX_ERR_RATE BIT7
...@@ -93,68 +92,68 @@ enum dbgp_flag { ...@@ -93,68 +92,68 @@ enum dbgp_flag {
#define ISR_CHK BIT0 #define ISR_CHK BIT0
#define PHY_BBR BIT0 #define PHY_BBR BIT0
#define PHY_BBW BIT1 #define PHY_BBW BIT1
#define PHY_RFR BIT2 #define PHY_RFR BIT2
#define PHY_RFW BIT3 #define PHY_RFW BIT3
#define PHY_MACR BIT4 #define PHY_MACR BIT4
#define PHY_MACW BIT5 #define PHY_MACW BIT5
#define PHY_ALLR BIT6 #define PHY_ALLR BIT6
#define PHY_ALLW BIT7 #define PHY_ALLW BIT7
#define PHY_TXPWR BIT8 #define PHY_TXPWR BIT8
#define PHY_PWRDIFF BIT9 #define PHY_PWRDIFF BIT9
#define MP_RX BIT0 #define MP_RX BIT0
#define MP_SWICH_CH BIT1 #define MP_SWICH_CH BIT1
#define EEPROM_W BIT0 #define EEPROM_W BIT0
#define EFUSE_PG BIT1 #define EFUSE_PG BIT1
#define EFUSE_READ_ALL BIT2 #define EFUSE_READ_ALL BIT2
#define LPS BIT0 #define LPS BIT0
#define IPS BIT1 #define IPS BIT1
#define PWRSW BIT2 #define PWRSW BIT2
#define PWRHW BIT3 #define PWRHW BIT3
#define PWRHAL BIT4 #define PWRHAL BIT4
#define WA_IOT BIT0 #define WA_IOT BIT0
#define DM_PWDB BIT1 #define DM_PWDB BIT1
#define DM_Monitor BIT2 #define DM_Monitor BIT2
#define DM_DIG BIT3 #define DM_DIG BIT3
#define DM_EDCA_Turbo BIT4 #define DM_EDCA_Turbo BIT4
#define DbgCtrl_Trace BIT0 #define DbgCtrl_Trace BIT0
#define DbgCtrl_InbandNoise BIT1 #define DbgCtrl_InbandNoise BIT1
#define BT_TRACE BIT0 #define BT_TRACE BIT0
#define BT_RFPoll BIT1 #define BT_RFPoll BIT1
#define C2H_Summary BIT0 #define C2H_Summary BIT0
#define C2H_PacketData BIT1 #define C2H_PacketData BIT1
#define C2H_ContentData BIT2 #define C2H_ContentData BIT2
#define BT_TRACE BIT0 #define BT_TRACE BIT0
#define BT_RFPoll BIT1 #define BT_RFPoll BIT1
#define INIT_EEPROM BIT0 #define INIT_EEPROM BIT0
#define INIT_TxPower BIT1 #define INIT_TxPower BIT1
#define INIT_IQK BIT2 #define INIT_IQK BIT2
#define INIT_RF BIT3 #define INIT_RF BIT3
#define IOCTL_TRACE BIT0 #define IOCTL_TRACE BIT0
#define IOCTL_BT_EVENT BIT1 #define IOCTL_BT_EVENT BIT1
#define IOCTL_BT_EVENT_DETAIL BIT2 #define IOCTL_BT_EVENT_DETAIL BIT2
#define IOCTL_BT_TX_ACLDATA BIT3 #define IOCTL_BT_TX_ACLDATA BIT3
#define IOCTL_BT_TX_ACLDATA_DETAIL BIT4 #define IOCTL_BT_TX_ACLDATA_DETAIL BIT4
#define IOCTL_BT_RX_ACLDATA BIT5 #define IOCTL_BT_RX_ACLDATA BIT5
#define IOCTL_BT_RX_ACLDATA_DETAIL BIT6 #define IOCTL_BT_RX_ACLDATA_DETAIL BIT6
#define IOCTL_BT_HCICMD BIT7 #define IOCTL_BT_HCICMD BIT7
#define IOCTL_BT_HCICMD_DETAIL BIT8 #define IOCTL_BT_HCICMD_DETAIL BIT8
#define IOCTL_IRP BIT9 #define IOCTL_IRP BIT9
#define IOCTL_IRP_DETAIL BIT10 #define IOCTL_IRP_DETAIL BIT10
#define IOCTL_CALLBACK_FUN BIT11 #define IOCTL_CALLBACK_FUN BIT11
#define IOCTL_STATE BIT12 #define IOCTL_STATE BIT12
#define IOCTL_BT_TP BIT13 #define IOCTL_BT_TP BIT13
#define IOCTL_BT_LOGO BIT14 #define IOCTL_BT_LOGO BIT14
/* 2007/07/13 MH ------For DeBuG Print modeue------*/ /* 2007/07/13 MH ------For DeBuG Print modeue------*/
/*------------------------------Define structure----------------------------*/ /*------------------------------Define structure----------------------------*/
...@@ -164,97 +163,98 @@ enum dbgp_flag { ...@@ -164,97 +163,98 @@ enum dbgp_flag {
#define DEBUG_PRINT 1 #define DEBUG_PRINT 1
#if (DEBUG_PRINT == 1) #if (DEBUG_PRINT == 1)
#define RTPRINT(dbgtype, dbgflag, printstr) \ #define RTPRINT(dbgtype, dbgflag, printstr) \
{ \ { \
if (DBGP_Type[dbgtype] & dbgflag)\ if (DBGP_Type[dbgtype] & dbgflag) { \
{ \
printk printstr; \ printk printstr; \
} \ } \
} }
#define RTPRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)\ #define RTPRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) \
{\ { \
if (DBGP_Type[dbgtype] & dbgflag)\ if (DBGP_Type[dbgtype] & dbgflag) { \
{\ int __i; \
int __i; \ u8 *ptr = (u8 *)_Ptr; \
u8* ptr = (u8*)_Ptr; \ printk printstr; \
printk printstr; \ printk(" "); \
printk(" "); \ for (__i = 0; __i < 6; __i++) \
for ( __i=0; __i<6; __i++ ) \ printk("%02X%s", ptr[__i], \
printk("%02X%s", ptr[__i], (__i==5)?"":"-"); \ (__i == 5) ? "" : "-"); \
printk("\n"); \ printk("\n"); \
}\ } \
} }
#define RTPRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\ #define RTPRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\
{\ { \
if (DBGP_Type[dbgtype] & dbgflag)\ if (DBGP_Type[dbgtype] & dbgflag) { \
{\ int __i; \
int __i; \ u8 *ptr = (u8 *)_HexData; \
u8* ptr = (u8*)_HexData; \ printk(_TitleString); \
printk(_TitleString); \ for (__i = 0; __i < (int)_HexDataLen; __i++) { \
for ( __i=0; __i<(int)_HexDataLen; __i++ ) \ printk("%02X%s", ptr[__i], (((__i + 1) \
{ \ % 4) == 0) ? " " : " "); \
printk("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" ");\ if (((__i + 1) % 16) == 0) \
if (((__i + 1) % 16) == 0) printk("\n");\ printk("\n"); \
} \ } \
printk("\n"); \ printk("\n"); \
}\ } \
} }
#else #else
#define RTPRINT(dbgtype, dbgflag, printstr) #define RTPRINT(dbgtype, dbgflag, printstr)
#define RTPRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) #define RTPRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)
#define RTPRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen) #define RTPRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)
#endif #endif
extern u32 DBGP_Type[DBGP_TYPE_MAX]; extern u32 DBGP_Type[DBGP_TYPE_MAX];
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \ #define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
do {\ do {\
if (((_Comp) & rt_global_debug_component ) && (_Level <= rt_global_debug_component )) \ if (((_Comp) & rt_global_debug_component) && \
{ \ (_Level <= rt_global_debug_component)) { \
int __i; \ int __i; \
u8* ptr = (u8*)_HexData; \ u8* ptr = (u8 *)_HexData; \
printk("Rtl819x: "); \ printk(KERN_INFO "Rtl819x: "); \
printk(_TitleString); \ printk(_TitleString); \
for ( __i=0; __i<(int)_HexDataLen; __i++ ) \ for (__i = 0; __i < (int)_HexDataLen; __i++) { \
{ \ printk("%02X%s", ptr[__i], (((__i + 1) % \
printk("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" "); \ 4) == 0) ? " " : " "); \
if (((__i + 1) % 16) == 0) printk("\n"); \ if (((__i + 1) % 16) == 0) \
} \ printk("\n"); \
printk("\n"); \ } \
printk("\n"); \
} \ } \
}while(0); } while (0);
#define DMESG(x,a...) #define DMESG(x, a...)
#define DMESGW(x,a...) #define DMESGW(x, a...)
#define DMESGE(x,a...) #define DMESGE(x, a...)
extern u32 rt_global_debug_component; extern u32 rt_global_debug_component;
#define RT_TRACE(component, x, args...) \ #define RT_TRACE(component, x, args...) \
do { if (rt_global_debug_component & component) \ do { \
printk(KERN_DEBUG DRV_NAME ":" x "\n" , \ if (rt_global_debug_component & component) \
##args);\ printk(KERN_DEBUG DRV_NAME ":" x "\n" , \
}while(0); ##args);\
} while (0);
#define assert(expr) \ #define assert(expr) \
if (!(expr)) { \ if (!(expr)) { \
printk( "Assertion failed! %s,%s,%s,line=%d\n", \ printk(KERN_INFO "Assertion failed! %s,%s,%s,line=%d\n", \
#expr,__FILE__,__func__,__LINE__); \ #expr, __FILE__, __func__, __LINE__); \
} }
#define RT_DEBUG_DATA(level, data, datalen) \ #define RT_DEBUG_DATA(level, data, datalen) \
do{ if ((rt_global_debug_component & (level)) == (level)) \ do { \
{ \ if ((rt_global_debug_component & (level)) == (level)) {\
int _i; \ int _i; \
u8* _pdata = (u8*) data; \ u8 *_pdata = (u8 *)data; \
printk(KERN_DEBUG DRV_NAME ": %s()\n", __func__); \ printk(KERN_DEBUG DRV_NAME ": %s()\n", __func__); \
for (_i=0; _i<(int)(datalen); _i++) \ for (_i = 0; _i < (int)(datalen); _i++) { \
{ \ printk(KERN_INFO "%2x ", _pdata[_i]); \
printk("%2x ", _pdata[_i]); \ if ((_i+1) % 16 == 0) \
if ((_i+1)%16 == 0) printk("\n"); \ printk("\n"); \
} \ } \
printk("\n"); \ printk(KERN_INFO "\n"); \
} \ } \
} while (0) } while (0)
struct rtl_fs_debug { struct rtl_fs_debug {
const char *name; const char *name;
...@@ -270,16 +270,23 @@ void dump_eprom(struct net_device *dev); ...@@ -270,16 +270,23 @@ void dump_eprom(struct net_device *dev);
void rtl8192_dump_reg(struct net_device *dev); void rtl8192_dump_reg(struct net_device *dev);
/* debugfs stuff */ /* debugfs stuff */
static inline int rtl_debug_module_init(struct r8192_priv *priv, const char *name) { static inline int rtl_debug_module_init(struct r8192_priv *priv,
const char *name)
{
return 0; return 0;
} }
static inline void rtl_debug_module_remove(struct r8192_priv *priv) {
static inline void rtl_debug_module_remove(struct r8192_priv *priv)
{
} }
static inline int rtl_create_debugfs_root(void) {
static inline int rtl_create_debugfs_root(void)
{
return 0; return 0;
} }
static inline void rtl_remove_debugfs_root(void) {
static inline void rtl_remove_debugfs_root(void)
{
} }
/* proc stuff */ /* proc stuff */
...@@ -288,4 +295,5 @@ void rtl8192_proc_remove_one(struct net_device *dev); ...@@ -288,4 +295,5 @@ void rtl8192_proc_remove_one(struct net_device *dev);
void rtl8192_proc_module_init(void); void rtl8192_proc_module_init(void);
void rtl8192_proc_module_remove(void); void rtl8192_proc_module_remove(void);
void rtl8192_dbgp_flag_init(struct net_device *dev); void rtl8192_dbgp_flag_init(struct net_device *dev);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment