rtl8188eu: Fix checkpatch ERRORs in core/rtw_debug.c

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-28 10:22:04 -05:00
parent a839bebbbd
commit 4f7065928d

View file

@ -52,23 +52,19 @@ int proc_set_write_reg(struct file *file, const char __user *buffer,
char tmp[32]; char tmp[32];
u32 addr, val, len; u32 addr, val, len;
if (count < 3) if (count < 3) {
{
DBG_88E("argument size is less than 3\n"); DBG_88E("argument size is less than 3\n");
return -EFAULT; return -EFAULT;
} }
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
int num = sscanf(tmp, "%x %x %x", &addr, &val, &len); int num = sscanf(tmp, "%x %x %x", &addr, &val, &len);
if (num != 3) { if (num != 3) {
DBG_88E("invalid write_reg parameter!\n"); DBG_88E("invalid write_reg parameter!\n");
return count; return count;
} }
switch (len) {
switch (len)
{
case 1: case 1:
rtw_write8(padapter, addr, (u8)val); rtw_write8(padapter, addr, (u8)val);
break; break;
@ -79,18 +75,15 @@ int proc_set_write_reg(struct file *file, const char __user *buffer,
rtw_write32(padapter, addr, val); rtw_write32(padapter, addr, val);
break; break;
default: default:
DBG_88E("error write length=%d", len); DBG_88E("error write length =%d", len);
break; break;
} }
} }
return count; return count;
} }
static u32 proc_get_read_addr=0xeeeeeeee; static u32 proc_get_read_addr = 0xeeeeeeee;
static u32 proc_get_read_len=0x4; static u32 proc_get_read_len = 0x4;
int proc_get_read_reg(char *page, char **start, int proc_get_read_reg(char *page, char **start,
off_t offset, int count, off_t offset, int count,
@ -101,14 +94,12 @@ int proc_get_read_reg(char *page, char **start,
int len = 0; int len = 0;
if (proc_get_read_addr==0xeeeeeeee) if (proc_get_read_addr == 0xeeeeeeee) {
{
*eof = 1; *eof = 1;
return len; return len;
} }
switch (proc_get_read_len) switch (proc_get_read_len) {
{
case 1: case 1:
len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr)); len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr));
break; break;
@ -125,7 +116,6 @@ int proc_get_read_reg(char *page, char **start,
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_set_read_reg(struct file *file, const char __user *buffer, int proc_set_read_reg(struct file *file, const char __user *buffer,
@ -134,14 +124,12 @@ int proc_set_read_reg(struct file *file, const char __user *buffer,
char tmp[16]; char tmp[16];
u32 addr, len; u32 addr, len;
if (count < 2) if (count < 2) {
{
DBG_88E("argument size is less than 2\n"); DBG_88E("argument size is less than 2\n");
return -EFAULT; return -EFAULT;
} }
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
int num = sscanf(tmp, "%x %x", &addr, &len); int num = sscanf(tmp, "%x %x", &addr, &len);
if (num != 2) { if (num != 2) {
@ -155,7 +143,6 @@ int proc_set_read_reg(struct file *file, const char __user *buffer,
} }
return count; return count;
} }
int proc_get_fwstate(char *page, char **start, int proc_get_fwstate(char *page, char **start,
@ -223,7 +210,6 @@ int proc_get_qos_option(char *page, char **start,
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_ht_option(char *page, char **start, int proc_get_ht_option(char *page, char **start,
@ -251,11 +237,8 @@ int proc_get_rf_info(char *page, char **start,
len += snprintf(page + len, count - len, "cur_ch=%d, cur_bw=%d, cur_ch_offet=%d\n", len += snprintf(page + len, count - len, "cur_ch=%d, cur_bw=%d, cur_ch_offet=%d\n",
pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset); pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset);
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_ap_info(char *page, char **start, int proc_get_ap_info(char *page, char **start,
@ -272,8 +255,7 @@ int proc_get_ap_info(char *page, char **start,
int len = 0; int len = 0;
psta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress); psta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
if (psta) if (psta) {
{
int i; int i;
struct recv_reorder_ctrl *preorder_ctrl; struct recv_reorder_ctrl *preorder_ctrl;
@ -287,24 +269,17 @@ int proc_get_ap_info(char *page, char **start,
len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable); len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap);
for (i=0;i<16;i++) for (i = 0; i < 16; i++) {
{
preorder_ctrl = &psta->recvreorder_ctrl[i]; preorder_ctrl = &psta->recvreorder_ctrl[i];
if (preorder_ctrl->enable) if (preorder_ctrl->enable)
{
len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq); len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq);
} }
} } else {
}
else
{
len += snprintf(page + len, count - len, "can't get sta's macaddr, cur_network's macaddr: %pM\n", cur_network->network.MacAddress); len += snprintf(page + len, count - len, "can't get sta's macaddr, cur_network's macaddr: %pM\n", cur_network->network.MacAddress);
} }
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_adapter_state(char *page, char **start, int proc_get_adapter_state(char *page, char **start,
@ -320,7 +295,6 @@ int proc_get_adapter_state(char *page, char **start,
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_trx_info(char *page, char **start, int proc_get_trx_info(char *page, char **start,
@ -334,12 +308,11 @@ int proc_get_trx_info(char *page, char **start,
int len = 0; int len = 0;
len += snprintf(page + len, count - len, "free_xmitbuf_cnt=%d, free_xmitframe_cnt=%d, free_ext_xmitbuf_cnt=%d, free_recvframe_cnt=%d\n", len += snprintf(page + len, count - len, "free_xmitbuf_cnt=%d, free_xmitframe_cnt=%d, free_ext_xmitbuf_cnt=%d, free_recvframe_cnt=%d\n",
pxmitpriv->free_xmitbuf_cnt, pxmitpriv->free_xmitframe_cnt,pxmitpriv->free_xmit_extbuf_cnt, precvpriv->free_recvframe_cnt); pxmitpriv->free_xmitbuf_cnt, pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmit_extbuf_cnt, precvpriv->free_recvframe_cnt);
len += snprintf(page + len, count - len, "rx_urb_pending_cn=%d\n", precvpriv->rx_pending_cnt); len += snprintf(page + len, count - len, "rx_urb_pending_cn=%d\n", precvpriv->rx_pending_cnt);
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_mac_reg_dump1(char *page, char **start, int proc_get_mac_reg_dump1(char *page, char **start,
@ -349,20 +322,20 @@ int proc_get_mac_reg_dump1(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1; int i, j = 1;
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n"); len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
for (i=0x0;i<0x300;i+=4) for (i = 0x0; i < 0x300; i += 4) {
{ if (j%4 == 1)
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); len += snprintf(page + len, count - len, "0x%02x", i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); len += snprintf(page + len, count - len, " 0x%08x ", rtw_read32(padapter, i));
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_mac_reg_dump2(char *page, char **start, int proc_get_mac_reg_dump2(char *page, char **start,
@ -372,20 +345,20 @@ int proc_get_mac_reg_dump2(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1; int i, j = 1;
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n"); len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
memset(page, 0, count); memset(page, 0, count);
for (i=0x300;i<0x600;i+=4) for (i = 0x300; i < 0x600; i += 4) {
{ if (j%4 == 1)
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); len += snprintf(page + len, count - len, "0x%02x", i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); len += snprintf(page + len, count - len, " 0x%08x ", rtw_read32(padapter, i));
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_mac_reg_dump3(char *page, char **start, int proc_get_mac_reg_dump3(char *page, char **start,
@ -395,20 +368,20 @@ int proc_get_mac_reg_dump3(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1; int i, j = 1;
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n"); len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
for (i=0x600;i<0x800;i+=4) for (i = 0x600; i < 0x800; i += 4) {
{ if (j%4 == 1)
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); len += snprintf(page + len, count - len, "0x%02x", i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); len += snprintf(page + len, count - len, " 0x%08x ", rtw_read32(padapter, i));
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_bb_reg_dump1(char *page, char **start, int proc_get_bb_reg_dump1(char *page, char **start,
@ -418,14 +391,15 @@ int proc_get_bb_reg_dump1(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1; int i, j = 1;
len += snprintf(page + len, count - len, "\n======= BB REG =======\n"); len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
for (i=0x800;i<0xB00;i+=4) for (i = 0x800; i < 0xB00; i += 4) {
{ if (j%4 == 1)
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); len += snprintf(page + len, count - len, "0x%02x", i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); len += snprintf(page + len, count - len, " 0x%08x ", rtw_read32(padapter, i));
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
return len; return len;
@ -438,14 +412,15 @@ int proc_get_bb_reg_dump2(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1; int i, j = 1;
len += snprintf(page + len, count - len, "\n======= BB REG =======\n"); len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
for (i=0xB00;i<0xE00;i+=4) for (i = 0xB00; i < 0xE00; i += 4) {
{ if (j%4 == 1)
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); len += snprintf(page + len, count - len, "0x%02x", i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); len += snprintf(page + len, count - len, " 0x%08x ", rtw_read32(padapter, i));
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
return len; return len;
@ -458,14 +433,15 @@ int proc_get_bb_reg_dump3(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1; int i, j = 1;
len += snprintf(page + len, count - len, "\n======= BB REG =======\n"); len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
for (i=0xE00;i<0x1000;i+=4) for (i = 0xE00; i < 0x1000; i += 4) {
{ if (j%4 == 1)
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); len += snprintf(page + len, count - len, "0x%02x", i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); len += snprintf(page + len, count - len, " 0x%08x ", rtw_read32(padapter, i));
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
return len; return len;
@ -478,25 +454,24 @@ int proc_get_rf_reg_dump1(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1,path; int i, j = 1, path;
u32 value; u32 value;
len += snprintf(page + len, count - len, "\n======= RF REG =======\n"); len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
path = 1; path = 1;
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
for (i=0;i<0xC0;i++) for (i = 0; i < 0xC0; i++) {
{
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); if (j%4 == 1)
len += snprintf(page + len, count - len, " 0x%08x ",value); len += snprintf(page + len, count - len, "0x%02x ", i);
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n"); len += snprintf(page + len, count - len, " 0x%08x ", value);
if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_rf_reg_dump2(char *page, char **start, int proc_get_rf_reg_dump2(char *page, char **start,
off_t offset, int count, off_t offset, int count,
int *eof, void *data) int *eof, void *data)
@ -504,24 +479,24 @@ int proc_get_rf_reg_dump2(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1,path; int i, j = 1, path;
u32 value; u32 value;
len += snprintf(page + len, count - len, "\n======= RF REG =======\n"); len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
path = 1; path = 1;
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
for (i=0xC0;i<0x100;i++) for (i = 0xC0; i < 0x100; i++) {
{
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); if (j%4 == 1)
len += snprintf(page + len, count - len, " 0x%08x ",value); len += snprintf(page + len, count - len, "0x%02x ", i);
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n"); len += snprintf(page + len, count - len, " 0x%08x ", value);
if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
return len; return len;
} }
int proc_get_rf_reg_dump3(char *page, char **start, int proc_get_rf_reg_dump3(char *page, char **start,
off_t offset, int count, off_t offset, int count,
int *eof, void *data) int *eof, void *data)
@ -529,18 +504,19 @@ int proc_get_rf_reg_dump3(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1,path; int i, j = 1, path;
u32 value; u32 value;
len += snprintf(page + len, count - len, "\n======= RF REG =======\n"); len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
path = 2; path = 2;
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
for (i=0;i<0xC0;i++) for (i = 0; i < 0xC0; i++) {
{
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); if (j%4 == 1)
len += snprintf(page + len, count - len, " 0x%08x ",value); len += snprintf(page + len, count - len, "0x%02x ", i);
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n"); len += snprintf(page + len, count - len, " 0x%08x ", value);
if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
@ -555,18 +531,19 @@ int proc_get_rf_reg_dump4(char *page, char **start,
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0; int len = 0;
int i,j=1,path; int i, j = 1, path;
u32 value; u32 value;
len += snprintf(page + len, count - len, "\n======= RF REG =======\n"); len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
path = 2; path = 2;
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
for (i=0xC0;i<0x100;i++) for (i = 0xC0; i < 0x100; i++) {
{
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); if (j%4 == 1)
len += snprintf(page + len, count - len, " 0x%08x ",value); len += snprintf(page + len, count - len, "0x%02x ", i);
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n"); len += snprintf(page + len, count - len, " 0x%08x ", value);
if ((j++)%4 == 0)
len += snprintf(page + len, count - len, "\n");
} }
*eof = 1; *eof = 1;
return len; return len;
@ -664,18 +641,15 @@ int proc_set_ht_enable(struct file *file, const char __user *buffer,
return -EFAULT; return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
int num = sscanf(tmp, "%d ", &mode); int num = sscanf(tmp, "%d ", &mode);
if ( pregpriv && mode >= 0 && mode < 2 ) if (pregpriv && mode >= 0 && mode < 2) {
{ pregpriv->ht_enable = mode;
pregpriv->ht_enable= mode; pr_info("ht_enable=%d\n", pregpriv->ht_enable);
printk("ht_enable=%d\n", pregpriv->ht_enable);
} }
} }
return count; return count;
} }
int proc_get_cbw40_enable(char *page, char **start, int proc_get_cbw40_enable(char *page, char **start,
@ -711,20 +685,14 @@ int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
return -EFAULT; return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
int num = sscanf(tmp, "%d ", &mode); int num = sscanf(tmp, "%d ", &mode);
if ( pregpriv && mode >= 0 && mode < 2 ) if (pregpriv && mode >= 0 && mode < 2) {
{ pregpriv->cbw40_enable = mode;
pr_info("cbw40_enable=%d\n", mode);
pregpriv->cbw40_enable= mode;
printk("cbw40_enable=%d\n", mode);
} }
} }
return count; return count;
} }
int proc_get_ampdu_enable(char *page, char **start, int proc_get_ampdu_enable(char *page, char **start,
@ -760,19 +728,14 @@ int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
return -EFAULT; return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
int num = sscanf(tmp, "%d ", &mode); int num = sscanf(tmp, "%d ", &mode);
if ( pregpriv && mode >= 0 && mode < 3 ) if (pregpriv && mode >= 0 && mode < 3) {
{ pregpriv->ampdu_enable = mode;
pregpriv->ampdu_enable= mode; pr_info("ampdu_enable=%d\n", mode);
printk("ampdu_enable=%d\n", mode);
} }
} }
return count; return count;
} }
int proc_get_two_path_rssi(char *page, char **start, int proc_get_two_path_rssi(char *page, char **start,
@ -828,18 +791,14 @@ int proc_set_rx_stbc(struct file *file, const char __user *buffer,
return -EFAULT; return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
int num = sscanf(tmp, "%d ", &mode); int num = sscanf(tmp, "%d ", &mode);
if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3)) if (pregpriv && (mode == 0 || mode == 1 || mode == 2 || mode == 3)) {
{ pregpriv->rx_stbc = mode;
pregpriv->rx_stbc= mode;
printk("rx_stbc=%d\n", mode); printk("rx_stbc=%d\n", mode);
} }
} }
return count; return count;
} }
int proc_get_rssi_disp(char *page, char **start, int proc_get_rssi_disp(char *page, char **start,
@ -856,16 +815,14 @@ int proc_set_rssi_disp(struct file *file, const char __user *buffer,
struct net_device *dev = (struct net_device *)data; struct net_device *dev = (struct net_device *)data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
char tmp[32]; char tmp[32];
u32 enable=0; u32 enable = 0;
if (count < 1) if (count < 1) {
{
DBG_88E("argument size is less than 1\n"); DBG_88E("argument size is less than 1\n");
return -EFAULT; return -EFAULT;
} }
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
int num = sscanf(tmp, "%x", &enable); int num = sscanf(tmp, "%x", &enable);
if (num != 1) { if (num != 1) {
@ -873,24 +830,17 @@ int proc_set_rssi_disp(struct file *file, const char __user *buffer,
return count; return count;
} }
if (enable) if (enable) {
{
DBG_88E("Turn On Rx RSSI Display Function\n"); DBG_88E("Turn On Rx RSSI Display Function\n");
padapter->bRxRSSIDisplay = enable ; padapter->bRxRSSIDisplay = enable ;
} } else {
else
{
DBG_88E("Turn Off Rx RSSI Display Function\n"); DBG_88E("Turn Off Rx RSSI Display Function\n");
padapter->bRxRSSIDisplay = 0 ; padapter->bRxRSSIDisplay = 0;
} }
} }
return count; return count;
} }
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
int proc_get_all_sta_info(char *page, char **start, int proc_get_all_sta_info(char *page, char **start,
@ -912,13 +862,11 @@ int proc_get_all_sta_info(char *page, char **start,
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for (i=0; i< NUM_STA; i++) for (i = 0; i < NUM_STA; i++) {
{
phead = &(pstapriv->sta_hash[i]); phead = &(pstapriv->sta_hash[i]);
plist = get_next(phead); plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == false) while ((rtw_end_of_queue_search(phead, plist)) == false) {
{
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
plist = get_next(plist); plist = get_next(plist);
@ -939,16 +887,13 @@ int proc_get_all_sta_info(char *page, char **start,
len += snprintf(page + len, count - len, "qos_info=0x%x\n", psta->qos_info); len += snprintf(page + len, count - len, "qos_info=0x%x\n", psta->qos_info);
len += snprintf(page + len, count - len, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy); len += snprintf(page + len, count - len, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy);
for (j=0;j<16;j++) for (j = 0; j < 16; j++) {
{
preorder_ctrl = &psta->recvreorder_ctrl[j]; preorder_ctrl = &psta->recvreorder_ctrl[j];
if (preorder_ctrl->enable) if (preorder_ctrl->enable)
{
len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq); len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq);
} }
} }
} }
}
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
*eof = 1; *eof = 1;
@ -966,38 +911,38 @@ int proc_get_best_channel(char *page, char **start,
int len = 0; int len = 0;
u32 i, best_channel_24G = 1, best_channel_5G = 36, index_24G = 0, index_5G = 0; u32 i, best_channel_24G = 1, best_channel_5G = 36, index_24G = 0, index_5G = 0;
for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { for (i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++) {
if ( pmlmeext->channel_set[i].ChannelNum == 1) if (pmlmeext->channel_set[i].ChannelNum == 1)
index_24G = i; index_24G = i;
if ( pmlmeext->channel_set[i].ChannelNum == 36) if (pmlmeext->channel_set[i].ChannelNum == 36)
index_5G = i; index_5G = i;
} }
for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { for (i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++) {
/* 2.4G */ /* 2.4G */
if ( pmlmeext->channel_set[i].ChannelNum == 6 ) { if (pmlmeext->channel_set[i].ChannelNum == 6) {
if ( pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_24G].rx_count ) { if (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_24G].rx_count) {
index_24G = i; index_24G = i;
best_channel_24G = pmlmeext->channel_set[i].ChannelNum; best_channel_24G = pmlmeext->channel_set[i].ChannelNum;
} }
} }
/* 5G */ /* 5G */
if ( pmlmeext->channel_set[i].ChannelNum >= 36 if (pmlmeext->channel_set[i].ChannelNum >= 36 &&
&& pmlmeext->channel_set[i].ChannelNum < 140 ) { pmlmeext->channel_set[i].ChannelNum < 140) {
/* Find primary channel */ /* Find primary channel */
if ( (( pmlmeext->channel_set[i].ChannelNum - 36) % 8 == 0) if (((pmlmeext->channel_set[i].ChannelNum - 36) % 8 == 0) &&
&& (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count) ) { (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) {
index_5G = i; index_5G = i;
best_channel_5G = pmlmeext->channel_set[i].ChannelNum; best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
} }
} }
if ( pmlmeext->channel_set[i].ChannelNum >= 149 if (pmlmeext->channel_set[i].ChannelNum >= 149 &&
&& pmlmeext->channel_set[i].ChannelNum < 165) { pmlmeext->channel_set[i].ChannelNum < 165) {
/* find primary channel */ /* find primary channel */
if ( (( pmlmeext->channel_set[i].ChannelNum - 149) % 8 == 0) if (((pmlmeext->channel_set[i].ChannelNum - 149) % 8 == 0) &&
&& (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count) ) { (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) {
index_5G = i; index_5G = i;
best_channel_5G = pmlmeext->channel_set[i].ChannelNum; best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
} }
@ -1012,7 +957,6 @@ int proc_get_best_channel(char *page, char **start,
*eof = 1; *eof = 1;
return len; return len;
} }
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
#define _bt_dbg_off_ 0 #define _bt_dbg_off_ 0
@ -1052,18 +996,14 @@ int proc_set_btcoex_dbg(struct file *file, const char __user *buffer,
return -EFAULT; return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
int num = sscanf(tmp, "%d ", &mode); int num = sscanf(tmp, "%d ", &mode);
if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3)) if (pregpriv && (mode == 0 || mode == 1 || mode == 2 || mode == 3)) {
{ BTCoexDbgLevel = mode;
BTCoexDbgLevel= mode; pr_info("btcoex_dbg=%d\n", BTCoexDbgLevel);
printk("btcoex_dbg=%d\n", BTCoexDbgLevel);
} }
} }
return count; return count;
} }
#endif /* CONFIG_BT_COEXIST */ #endif /* CONFIG_BT_COEXIST */