2013-05-08 21:45:39 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
2014-12-19 06:59:46 +00:00
|
|
|
*
|
2013-05-08 21:45:39 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of version 2 of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
#define _RTW_DEBUG_C_
|
|
|
|
|
|
|
|
#include <rtw_debug.h>
|
2015-03-12 01:21:04 +00:00
|
|
|
#include <rtw_sreset.h>
|
2014-12-11 21:15:04 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_PROC_DEBUG
|
2013-07-21 15:41:57 +00:00
|
|
|
#include <rtw_version.h>
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
int proc_get_drv_version(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
2014-12-11 21:15:04 +00:00
|
|
|
struct net_device *dev = data;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
|
|
|
len += snprintf(page + len, count - len, "%s\n", DRIVERVERSION);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
#ifdef DBG_MEM_ALLOC
|
|
|
|
int proc_get_mstat(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-11 21:15:04 +00:00
|
|
|
int len = 0;
|
|
|
|
|
|
|
|
len += _rtw_mstat_dump(page+len, count-len);
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return len;
|
|
|
|
}
|
2014-12-11 21:15:04 +00:00
|
|
|
#endif /* DBG_MEM_ALLOC */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
int proc_get_write_reg(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
*eof = 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_write_reg(struct file *file, const char __user *buffer,
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
char tmp[32];
|
|
|
|
u32 addr, val, len;
|
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
if (count < 3)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("argument size is less than 3\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
return -EFAULT;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
int num = sscanf(tmp, "%x %x %x", &addr, &val, &len);
|
|
|
|
|
|
|
|
if (num != 3) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("invalid write_reg parameter!\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
|
|
|
}
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (len)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
case 1:
|
2014-12-19 06:59:46 +00:00
|
|
|
rtw_write8(padapter, addr, (u8)val);
|
2014-12-11 21:15:04 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2014-12-19 06:59:46 +00:00
|
|
|
rtw_write16(padapter, addr, (u16)val);
|
2014-12-11 21:15:04 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2014-12-19 06:59:46 +00:00
|
|
|
rtw_write32(padapter, addr, val);
|
2014-12-11 21:15:04 +00:00
|
|
|
break;
|
|
|
|
default:
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("error write length =%d", len);
|
2014-12-11 21:15:04 +00:00
|
|
|
break;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
static u32 proc_get_read_addr =0xeeeeeeee;
|
|
|
|
static u32 proc_get_read_len =0x4;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
int proc_get_read_reg(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
struct net_device *dev = data;
|
2014-12-19 06:59:46 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:22:58 +00:00
|
|
|
if (proc_get_read_addr == 0xeeeeeeee)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (proc_get_read_len)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2014-12-19 06:59:46 +00:00
|
|
|
case 1:
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "rtw_read8(0x%x) =0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr));
|
2014-12-11 21:15:04 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "rtw_read16(0x%x) =0x%x\n", proc_get_read_addr, rtw_read16(padapter, proc_get_read_addr));
|
2014-12-11 21:15:04 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "rtw_read32(0x%x) =0x%x\n", proc_get_read_addr, rtw_read32(padapter, proc_get_read_addr));
|
2014-12-11 21:15:04 +00:00
|
|
|
break;
|
|
|
|
default:
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "error read length =%d\n", proc_get_read_len);
|
2014-12-11 21:15:04 +00:00
|
|
|
break;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_read_reg(struct file *file, const char __user *buffer,
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
char tmp[16];
|
|
|
|
u32 addr, len;
|
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
if (count < 2)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("argument size is less than 2\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
return -EFAULT;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
int num = sscanf(tmp, "%x %x", &addr, &len);
|
|
|
|
|
|
|
|
if (num != 2) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("invalid read_reg parameter!\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
proc_get_read_addr = addr;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
proc_get_read_len = len;
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_fwstate(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "fwstate =0x%x\n", get_fwstate(pmlmepriv));
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_sec_info(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-19 06:59:46 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "auth_alg =0x%x, enc_alg =0x%x, auth_type =0x%x, enc_type =0x%x\n",
|
2013-05-08 21:45:39 +00:00
|
|
|
psecuritypriv->dot11AuthAlgrthm, psecuritypriv->dot11PrivacyAlgrthm,
|
|
|
|
psecuritypriv->ndisauthtype, psecuritypriv->ndisencryptstatus);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_mlmext_state(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-19 06:59:46 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
|
|
|
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "pmlmeinfo->state =0x%x\n", pmlmeinfo->state);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_qos_option(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "qos_option =%d\n", pmlmepriv->qospriv.qos_option);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_ht_option(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "ht_option =%d\n", pmlmepriv->htpriv.ht_option);
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_rf_info(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-19 06:59:46 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
|
|
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "cur_ch =%d, cur_bw =%d, cur_ch_offet =%d\n",
|
2013-05-08 21:45:39 +00:00
|
|
|
pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_ap_info(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct sta_info *psta;
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
|
|
|
struct wlan_network *cur_network = &(pmlmepriv->cur_network);
|
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
|
int len = 0;
|
|
|
|
|
|
|
|
psta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
|
2015-08-15 18:02:34 +00:00
|
|
|
if (psta)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
int i;
|
|
|
|
struct recv_reorder_ctrl *preorder_ctrl;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "SSID =%s\n", cur_network->network.Ssid.Ssid);
|
2014-12-11 21:15:04 +00:00
|
|
|
len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr));
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "cur_channel =%d, cur_bwmode =%d, cur_ch_offset =%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset);
|
|
|
|
len += snprintf(page + len, count - len, "rtsen =%d, cts2slef =%d\n", psta->rtsen, psta->cts2self);
|
|
|
|
len += snprintf(page + len, count - len, "state =0x%x, aid =%d, macid =%d, raid =%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
|
|
|
|
len += snprintf(page + len, count - len, "qos_en =%d, ht_en =%d, init_rate =%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
|
|
|
|
len += snprintf(page + len, count - len, "bwmode =%d, ch_offset =%d, sgi =%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
|
2014-12-19 06:59:46 +00:00
|
|
|
len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
|
2015-08-15 18:19:16 +00:00
|
|
|
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);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
for (i =0;i<16;i++)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
2015-08-15 18:02:34 +00:00
|
|
|
if (preorder_ctrl->enable)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "tid =%d, indicate_seq =%d\n", i, preorder_ctrl->indicate_seq);
|
2014-12-11 21:15:04 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
}
|
|
|
|
else
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-11 21:15:04 +00:00
|
|
|
len += snprintf(page + len, count - len, "can't get sta's macaddr, cur_network's macaddr:" MAC_FMT "\n", MAC_ARG(cur_network->network.MacAddress));
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_adapter_state(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "bSurpriseRemoved =%d, bDriverStopped =%d\n",
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->bSurpriseRemoved, padapter->bDriverStopped);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int proc_get_trx_info(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
2014-12-11 21:15:04 +00:00
|
|
|
int i;
|
2013-05-08 21:45:39 +00:00
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
|
|
|
struct recv_priv *precvpriv = &padapter->recvpriv;
|
2014-12-11 21:15:04 +00:00
|
|
|
struct hw_xmit *phwxmit;
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "free_xmitbuf_cnt =%d, free_xmitframe_cnt =%d"
|
|
|
|
", free_ext_xmitbuf_cnt =%d, free_xframe_ext_cnt =%d"
|
|
|
|
", free_recvframe_cnt =%d\n",
|
2014-12-11 21:15:04 +00:00
|
|
|
pxmitpriv->free_xmitbuf_cnt, pxmitpriv->free_xmitframe_cnt,
|
|
|
|
pxmitpriv->free_xmit_extbuf_cnt, pxmitpriv->free_xframe_ext_cnt,
|
|
|
|
precvpriv->free_recvframe_cnt);
|
|
|
|
|
2015-08-15 18:06:32 +00:00
|
|
|
for (i = 0; i < 4; i++)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
phwxmit = pxmitpriv->hwxmits + i;
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "%d, hwq.accnt =%d\n", i, phwxmit->accnt);
|
2014-12-11 21:15:04 +00:00
|
|
|
}
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "rx_urb_pending_cn =%d\n", precvpriv->rx_pending_cnt);
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_mac_reg_dump1(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= MAC REG =======\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
for (i =0x0;i<0x300;i+=4)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i);
|
|
|
|
len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i));
|
2015-08-15 18:02:34 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_mac_reg_dump2(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= MAC REG =======\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
memset(page, 0, count);
|
2015-08-15 18:19:16 +00:00
|
|
|
for (i =0x300;i<0x600;i+=4)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i);
|
|
|
|
len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i));
|
2015-08-15 18:02:34 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_mac_reg_dump3(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= MAC REG =======\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
for (i =0x600;i<0x800;i+=4)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i);
|
|
|
|
len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i));
|
2015-08-15 18:02:34 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_bb_reg_dump1(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-19 06:59:46 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= BB REG =======\n");
|
|
|
|
for (i =0x800;i<0xB00;i+=4)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i);
|
|
|
|
len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i));
|
2015-08-15 18:02:34 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
*eof = 1;
|
2014-12-19 06:59:46 +00:00
|
|
|
return len;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_bb_reg_dump2(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-19 06:59:46 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= BB REG =======\n");
|
|
|
|
for (i =0xB00;i<0xE00;i+=4)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i);
|
|
|
|
len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i));
|
2015-08-15 18:02:34 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
*eof = 1;
|
2014-12-19 06:59:46 +00:00
|
|
|
return len;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_bb_reg_dump3(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-19 06:59:46 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= BB REG =======\n");
|
|
|
|
for (i =0xE00;i<0x1000;i+=4)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i);
|
|
|
|
len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i));
|
2015-08-15 18:02:34 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
*eof = 1;
|
2014-12-19 06:59:46 +00:00
|
|
|
return len;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_rf_reg_dump1(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1, path;
|
2013-05-08 21:45:39 +00:00
|
|
|
u32 value;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= RF REG =======\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
path = 1;
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
|
|
|
|
for (i =0;i<0xC0;i++)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
/* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path, i, bMaskDWord); */
|
2013-05-08 21:45:39 +00:00
|
|
|
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len, "0x%02x ", i);
|
|
|
|
len += snprintf(page + len, count - len, " 0x%08x ", value);
|
2015-08-15 18:22:58 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len, "\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
2014-12-19 06:59:46 +00:00
|
|
|
return len;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_rf_reg_dump2(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1, path;
|
2014-12-19 06:59:46 +00:00
|
|
|
u32 value;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= RF REG =======\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
path = 1;
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
|
|
|
|
for (i =0xC0;i<0x100;i++)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
/* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path, i, bMaskDWord); */
|
2013-05-08 21:45:39 +00:00
|
|
|
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len, "0x%02x ", i);
|
|
|
|
len += snprintf(page + len, count - len, " 0x%08x ", value);
|
2015-08-15 18:22:58 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len, "\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
*eof = 1;
|
2014-12-19 06:59:46 +00:00
|
|
|
return len;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_rf_reg_dump3(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1, path;
|
2014-12-19 06:59:46 +00:00
|
|
|
u32 value;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= RF REG =======\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
path = 2;
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
|
|
|
|
for (i =0;i<0xC0;i++)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
/* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path, i, bMaskDWord); */
|
2013-05-08 21:45:39 +00:00
|
|
|
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len, "0x%02x ", i);
|
|
|
|
len += snprintf(page + len, count - len, " 0x%08x ", value);
|
2015-08-15 18:22:58 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len, "\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*eof = 1;
|
2014-12-19 06:59:46 +00:00
|
|
|
return len;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_rf_reg_dump4(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2015-08-15 18:19:16 +00:00
|
|
|
int i, j =1, path;
|
2013-05-08 21:45:39 +00:00
|
|
|
u32 value;
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\n ======= RF REG =======\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
path = 2;
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path);
|
|
|
|
for (i =0xC0;i<0x100;i++)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
/* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path, i, bMaskDWord); */
|
2013-05-08 21:45:39 +00:00
|
|
|
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
2015-08-15 18:19:16 +00:00
|
|
|
if (j%4 ==1) len += snprintf(page + len, count - len, "0x%02x ", i);
|
|
|
|
len += snprintf(page + len, count - len, " 0x%08x ", value);
|
2015-08-15 18:22:58 +00:00
|
|
|
if ((j++)%4 == 0) len += snprintf(page + len, count - len, "\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
*eof = 1;
|
2014-12-19 06:59:46 +00:00
|
|
|
return len;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_rx_signal(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
len += snprintf(page + len, count - len,
|
2013-05-08 21:45:39 +00:00
|
|
|
"rssi:%d\n"
|
|
|
|
"rxpwdb:%d\n"
|
|
|
|
"signal_strength:%u\n"
|
|
|
|
"signal_qual:%u\n"
|
2014-12-19 06:59:46 +00:00
|
|
|
"noise:%u\n",
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->recvpriv.rssi,
|
|
|
|
padapter->recvpriv.rxpwdb,
|
|
|
|
padapter->recvpriv.signal_strength,
|
|
|
|
padapter->recvpriv.signal_qual,
|
|
|
|
padapter->recvpriv.noise
|
|
|
|
);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_rx_signal(struct file *file, const char __user *buffer,
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
char tmp[32];
|
2014-12-11 21:15:04 +00:00
|
|
|
u32 is_signal_dbg, signal_strength;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int num = sscanf(tmp, "%u %u", &is_signal_dbg, &signal_strength);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2015-08-15 18:22:58 +00:00
|
|
|
is_signal_dbg = is_signal_dbg == 0?0:1;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (is_signal_dbg && num!=2)
|
2014-12-11 21:15:04 +00:00
|
|
|
return count;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
signal_strength = signal_strength>100?100:signal_strength;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
padapter->recvpriv.is_signal_dbg = is_signal_dbg;
|
2015-08-15 18:19:16 +00:00
|
|
|
padapter->recvpriv.signal_strength_dbg =signal_strength;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (is_signal_dbg)
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("set %s %u\n", "DBG_SIGNAL_STRENGTH", signal_strength);
|
2013-05-08 21:45:39 +00:00
|
|
|
else
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("set %s\n", "HW_SIGNAL_STRENGTH");
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_ht_enable(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pregpriv)
|
2013-05-08 21:45:39 +00:00
|
|
|
len += snprintf(page + len, count - len,
|
|
|
|
"%d\n",
|
|
|
|
pregpriv->ht_enable
|
|
|
|
);
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_ht_enable(struct file *file, const char __user *buffer,
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
|
|
|
char tmp[32];
|
2014-12-11 21:15:04 +00:00
|
|
|
u32 mode;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
2014-12-11 21:15:04 +00:00
|
|
|
|
|
|
|
int num = sscanf(tmp, "%d ", &mode);
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pregpriv && mode >= 0 && mode < 2 )
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
pregpriv->ht_enable = mode;
|
|
|
|
printk("ht_enable =%d\n", pregpriv->ht_enable);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_cbw40_enable(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pregpriv)
|
2013-05-08 21:45:39 +00:00
|
|
|
len += snprintf(page + len, count - len,
|
|
|
|
"%d\n",
|
|
|
|
pregpriv->cbw40_enable
|
|
|
|
);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
|
|
|
char tmp[32];
|
2014-12-11 21:15:04 +00:00
|
|
|
u32 mode;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
2014-12-11 21:15:04 +00:00
|
|
|
|
|
|
|
int num = sscanf(tmp, "%d ", &mode);
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pregpriv && mode >= 0 && mode < 2 )
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
pregpriv->cbw40_enable = mode;
|
|
|
|
printk("cbw40_enable =%d\n", mode);
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_ampdu_enable(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pregpriv)
|
2013-05-08 21:45:39 +00:00
|
|
|
len += snprintf(page + len, count - len,
|
|
|
|
"%d\n",
|
|
|
|
pregpriv->ampdu_enable
|
|
|
|
);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
|
|
|
char tmp[32];
|
2014-12-11 21:15:04 +00:00
|
|
|
u32 mode;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
2014-12-11 21:15:04 +00:00
|
|
|
|
|
|
|
int num = sscanf(tmp, "%d ", &mode);
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pregpriv && mode >= 0 && mode < 3 )
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
pregpriv->ampdu_enable = mode;
|
|
|
|
printk("ampdu_enable =%d\n", mode);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_two_path_rssi(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (padapter)
|
2013-05-08 21:45:39 +00:00
|
|
|
len += snprintf(page + len, count - len,
|
|
|
|
"%d %d\n",
|
|
|
|
padapter->recvpriv.RxRssi[0],
|
|
|
|
padapter->recvpriv.RxRssi[1]
|
|
|
|
);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
2015-02-21 02:30:23 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int proc_get_rx_stbc(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pregpriv)
|
2013-05-08 21:45:39 +00:00
|
|
|
len += snprintf(page + len, count - len,
|
|
|
|
"%d\n",
|
|
|
|
pregpriv->rx_stbc
|
|
|
|
);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_rx_stbc(struct file *file, const char __user *buffer,
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
|
|
|
char tmp[32];
|
2014-12-11 21:15:04 +00:00
|
|
|
u32 mode;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
2014-12-11 21:15:04 +00:00
|
|
|
|
|
|
|
int num = sscanf(tmp, "%d ", &mode);
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
pregpriv->rx_stbc = mode;
|
|
|
|
printk("rx_stbc =%d\n", mode);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_rssi_disp(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
*eof = 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_rssi_disp(struct file *file, const char __user *buffer,
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
char tmp[32];
|
2015-08-15 18:19:16 +00:00
|
|
|
u32 enable =0;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
if (count < 1)
|
|
|
|
{
|
|
|
|
DBG_8192C("argument size is less than 1\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
return -EFAULT;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
int num = sscanf(tmp, "%x", &enable);
|
|
|
|
|
|
|
|
if (num != 1) {
|
2014-12-11 21:15:04 +00:00
|
|
|
DBG_8192C("invalid set_rssi_disp parameter!\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (enable)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-11 21:15:04 +00:00
|
|
|
DBG_8192C("Turn On Rx RSSI Display Function\n");
|
2014-12-19 06:59:46 +00:00
|
|
|
padapter->bRxRSSIDisplay = enable ;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-11 21:15:04 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
DBG_8192C("Turn Off Rx RSSI Display Function\n");
|
|
|
|
padapter->bRxRSSIDisplay = 0 ;
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return count;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
#ifdef CONFIG_AP_MODE
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
int proc_get_all_sta_info(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct sta_info *psta;
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
|
int i, j;
|
2015-03-16 13:54:18 +00:00
|
|
|
struct list_head *plist, *phead;
|
2013-05-08 21:45:39 +00:00
|
|
|
struct recv_reorder_ctrl *preorder_ctrl;
|
2014-12-19 06:59:46 +00:00
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "sta_dz_bitmap =0x%x, tim_bitmap =0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-03-06 17:54:48 +00:00
|
|
|
spin_lock_bh(&pstapriv->sta_hash_lock);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
for (i =0; i< NUM_STA; i++)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
phead = &(pstapriv->sta_hash[i]);
|
|
|
|
plist = get_next(phead);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
while ((rtw_end_of_queue_search(phead, plist)) == false)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
|
|
|
|
|
|
|
plist = get_next(plist);
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
/* if (extra_arg == psta->aid) */
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr));
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "rtsen =%d, cts2slef =%d\n", psta->rtsen, psta->cts2self);
|
|
|
|
len += snprintf(page + len, count - len, "state =0x%x, aid =%d, macid =%d, raid =%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
|
|
|
|
len += snprintf(page + len, count - len, "qos_en =%d, ht_en =%d, init_rate =%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
|
|
|
|
len += snprintf(page + len, count - len, "bwmode =%d, ch_offset =%d, sgi =%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
|
2014-12-19 06:59:46 +00:00
|
|
|
len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
|
2015-08-15 18:19:16 +00:00
|
|
|
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, "sleepq_len =%d\n", psta->sleepq_len);
|
|
|
|
len += snprintf(page + len, count - len, "capability =0x%x\n", psta->capability);
|
|
|
|
len += snprintf(page + len, count - len, "flags =0x%x\n", psta->flags);
|
|
|
|
len += snprintf(page + len, count - len, "wpa_psk =0x%x\n", psta->wpa_psk);
|
|
|
|
len += snprintf(page + len, count - len, "wpa2_group_cipher =0x%x\n", psta->wpa2_group_cipher);
|
|
|
|
len += snprintf(page + len, count - len, "wpa2_pairwise_cipher =0x%x\n", psta->wpa2_pairwise_cipher);
|
|
|
|
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);
|
|
|
|
|
|
|
|
for (j =0;j<16;j++)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-11 21:15:04 +00:00
|
|
|
preorder_ctrl = &psta->recvreorder_ctrl[j];
|
2015-08-15 18:02:34 +00:00
|
|
|
if (preorder_ctrl->enable)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
len += snprintf(page + len, count - len, "tid =%d, indicate_seq =%d\n", j, preorder_ctrl->indicate_seq);
|
2014-12-11 21:15:04 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-03-06 17:54:48 +00:00
|
|
|
spin_unlock_bh(&pstapriv->sta_hash_lock);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
#endif
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2015-03-01 17:00:26 +00:00
|
|
|
#ifdef CONFIG_AP_MODE
|
2013-05-08 21:45:39 +00:00
|
|
|
int proc_get_best_channel(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2013-05-08 21:45:39 +00:00
|
|
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
|
|
|
int len = 0;
|
|
|
|
u32 i, best_channel_24G = 1, best_channel_5G = 36, index_24G = 0, index_5G = 0;
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
for (i =0; pmlmeext->channel_set[i].ChannelNum !=0; i++) {
|
2014-12-11 21:15:04 +00:00
|
|
|
if ( pmlmeext->channel_set[i].ChannelNum == 1)
|
2013-05-08 21:45:39 +00:00
|
|
|
index_24G = i;
|
2014-12-11 21:15:04 +00:00
|
|
|
if ( pmlmeext->channel_set[i].ChannelNum == 36)
|
2013-05-08 21:45:39 +00:00
|
|
|
index_5G = i;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
for (i =0; pmlmeext->channel_set[i].ChannelNum !=0; i++) {
|
2015-02-19 21:34:32 +00:00
|
|
|
/* 2.4G */
|
2014-12-11 21:15:04 +00:00
|
|
|
if ( pmlmeext->channel_set[i].ChannelNum == 6 ) {
|
|
|
|
if ( pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_24G].rx_count ) {
|
2013-05-08 21:45:39 +00:00
|
|
|
index_24G = i;
|
|
|
|
best_channel_24G = pmlmeext->channel_set[i].ChannelNum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* 5G */
|
2014-12-11 21:15:04 +00:00
|
|
|
if ( pmlmeext->channel_set[i].ChannelNum >= 36
|
|
|
|
&& pmlmeext->channel_set[i].ChannelNum < 140 ) {
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Find primary channel */
|
2014-12-11 21:15:04 +00:00
|
|
|
if ( (( pmlmeext->channel_set[i].ChannelNum - 36) % 8 == 0)
|
|
|
|
&& (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count) ) {
|
2013-05-08 21:45:39 +00:00
|
|
|
index_5G = i;
|
|
|
|
best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
if ( pmlmeext->channel_set[i].ChannelNum >= 149
|
|
|
|
&& pmlmeext->channel_set[i].ChannelNum < 165) {
|
2015-02-19 21:34:32 +00:00
|
|
|
/* find primary channel */
|
2014-12-11 21:15:04 +00:00
|
|
|
if ( (( pmlmeext->channel_set[i].ChannelNum - 149) % 8 == 0)
|
|
|
|
&& (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count) ) {
|
2013-05-08 21:45:39 +00:00
|
|
|
index_5G = i;
|
|
|
|
best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
|
|
|
|
}
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
|
2013-05-08 21:45:39 +00:00
|
|
|
pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count);
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
len += snprintf(page + len, count - len, "best_channel_5G = %d\n", best_channel_5G);
|
|
|
|
len += snprintf(page + len, count - len, "best_channel_24G = %d\n", best_channel_24G);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-11 21:15:04 +00:00
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_best_channel(struct file *file, const char __user *buffer,
|
2014-12-11 21:15:04 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
|
|
|
char tmp[32];
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (count < 1)
|
2014-12-11 21:15:04 +00:00
|
|
|
return -EFAULT;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp)))
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
int i;
|
2015-08-15 18:06:32 +00:00
|
|
|
for (i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
pmlmeext->channel_set[i].rx_count = 0;
|
|
|
|
}
|
|
|
|
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("set %s\n", "Clean Best Channel Count");
|
2014-12-11 21:15:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
2015-03-01 17:00:26 +00:00
|
|
|
#endif /* CONFIG_AP_MODE */
|
2014-12-11 21:15:04 +00:00
|
|
|
#ifdef CONFIG_BT_COEXIST
|
|
|
|
#define _bt_dbg_off_ 0
|
|
|
|
#define _bt_dbg_on_ 1
|
|
|
|
|
|
|
|
extern u32 BTCoexDbgLevel;
|
|
|
|
int proc_get_btcoex_dbg(char *page, char **start,
|
|
|
|
off_t offset, int count,
|
|
|
|
int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
|
|
|
|
|
|
|
int len = 0;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pregpriv)
|
2014-12-11 21:15:04 +00:00
|
|
|
len += snprintf(page + len, count - len,
|
|
|
|
"%d\n",
|
|
|
|
BTCoexDbgLevel
|
|
|
|
);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_btcoex_dbg(struct file *file, const char __user *buffer,
|
2014-12-11 21:15:04 +00:00
|
|
|
unsigned long count, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
struct registry_priv *pregpriv = &padapter->registrypriv;
|
|
|
|
char tmp[32];
|
|
|
|
u32 mode;
|
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
|
|
|
|
|
|
|
int num = sscanf(tmp, "%d ", &mode);
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
BTCoexDbgLevel = mode;
|
|
|
|
printk("btcoex_dbg =%d\n", BTCoexDbgLevel);
|
2014-12-11 21:15:04 +00:00
|
|
|
}
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
return count;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
}
|
|
|
|
#endif /* CONFIG_BT_COEXIST */
|
|
|
|
|
|
|
|
int proc_get_sreset(char *page, char **start, off_t offset, int count, int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
int len = 0;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_sreset(struct file *file, const char __user *buffer, unsigned long count, void *data)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
char tmp[32];
|
|
|
|
s32 trigger_point;
|
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
2014-12-11 21:15:04 +00:00
|
|
|
|
|
|
|
int num = sscanf(tmp, "%d", &trigger_point);
|
|
|
|
|
|
|
|
if (trigger_point == SRESET_TGP_NULL)
|
|
|
|
rtw_hal_sreset_reset(padapter);
|
|
|
|
else
|
|
|
|
sreset_set_trigger_point(padapter, trigger_point);
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
return count;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_odm_dbg_comp(char *page, char **start, off_t offset, int count, int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
int len = 0;
|
|
|
|
|
|
|
|
len += _rtw_odm_dbg_comp_msg(adapter, page, count);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_odm_dbg_comp(struct file *file, const char __user *buffer, unsigned long count, void *data)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
char tmp[32];
|
|
|
|
|
|
|
|
u64 dbg_comp;
|
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
|
|
|
|
|
|
|
int num = sscanf(tmp, "%llx", &dbg_comp);
|
|
|
|
|
|
|
|
if (num != 1)
|
|
|
|
return count;
|
|
|
|
|
|
|
|
rtw_odm_dbg_comp_set(adapter, dbg_comp);
|
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_odm_dbg_level(char *page, char **start, off_t offset, int count, int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
int len = 0;
|
|
|
|
|
|
|
|
len += _rtw_odm_dbg_level_msg(adapter, page, count);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_odm_dbg_level(struct file *file, const char __user *buffer, unsigned long count, void *data)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
char tmp[32];
|
|
|
|
|
|
|
|
u32 dbg_level;
|
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
|
|
|
|
|
|
|
int num = sscanf(tmp, "%u", &dbg_level);
|
|
|
|
|
|
|
|
if (num != 1)
|
|
|
|
return count;
|
|
|
|
|
|
|
|
rtw_odm_dbg_level_set(adapter, dbg_level);
|
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
int proc_get_odm_adaptivity(char *page, char **start, off_t offset, int count, int *eof, void *data)
|
|
|
|
{
|
|
|
|
struct net_device *dev = data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
int len = 0;
|
|
|
|
|
|
|
|
len += _rtw_odm_adaptivity_parm_msg(padapter, page, count);
|
|
|
|
|
|
|
|
*eof = 1;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
int proc_set_odm_adaptivity(struct file *file, const char __user *buffer, unsigned long count, void *data)
|
2014-12-11 21:15:04 +00:00
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *)data;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
2014-12-11 21:15:04 +00:00
|
|
|
char tmp[32];
|
|
|
|
u32 TH_L2H_ini;
|
|
|
|
s8 TH_EDCCA_HL_diff;
|
|
|
|
u32 IGI_Base;
|
|
|
|
int ForceEDCCA;
|
|
|
|
u8 AdapEn_RSSI;
|
|
|
|
u8 IGI_LowerBound;
|
|
|
|
|
|
|
|
if (count < 1)
|
|
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
|
|
|
|
|
|
|
int num = sscanf(tmp, "%x %hhd %x %d %hhu %hhu",
|
|
|
|
&TH_L2H_ini, &TH_EDCCA_HL_diff, &IGI_Base, &ForceEDCCA, &AdapEn_RSSI, &IGI_LowerBound);
|
|
|
|
|
|
|
|
if (num != 6)
|
|
|
|
return count;
|
|
|
|
|
|
|
|
rtw_odm_adaptivity_parm_set(padapter, (s8)TH_L2H_ini, TH_EDCCA_HL_diff, (s8)IGI_Base, (bool)ForceEDCCA, AdapEn_RSSI, IGI_LowerBound);
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-11 21:15:04 +00:00
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|