mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2026-03-31 22:49:56 +00:00
Updated to v4.3.8_12406.20140929
This commit is contained in:
@@ -261,14 +261,93 @@ static int proc_get_rf_reg_dump(struct seq_file *m, void *v)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//gpio setting
|
||||
#ifdef CONFIG_GPIO_API
|
||||
static ssize_t proc_set_config_gpio(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
char tmp[32]={0};
|
||||
int num=0,gpio_pin=0,gpio_mode=0;//gpio_mode:0 input 1:output;
|
||||
|
||||
if (count < 2)
|
||||
return -EFAULT;
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp)))
|
||||
{
|
||||
num =sscanf(tmp, "%d %d",&gpio_pin,&gpio_mode);
|
||||
DBG_871X("num=%d gpio_pin=%d mode=%d\n",num,gpio_pin,gpio_mode);
|
||||
padapter->pre_gpio_pin=gpio_pin;
|
||||
|
||||
if(gpio_mode==0 || gpio_mode==1 )
|
||||
rtw_hal_config_gpio(padapter, gpio_pin,gpio_mode);
|
||||
}
|
||||
return count;
|
||||
|
||||
}
|
||||
static ssize_t proc_set_gpio_output_value(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
char tmp[32]={0};
|
||||
int num=0,gpio_pin=0,pin_mode=0;//pin_mode: 1 high 0:low
|
||||
|
||||
if (count < 2)
|
||||
return -EFAULT;
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp)))
|
||||
{
|
||||
num =sscanf(tmp, "%d %d",&gpio_pin,&pin_mode);
|
||||
DBG_871X("num=%d gpio_pin=%d pin_high=%d\n",num,gpio_pin,pin_mode);
|
||||
padapter->pre_gpio_pin=gpio_pin;
|
||||
|
||||
if(pin_mode==0 || pin_mode==1 )
|
||||
rtw_hal_set_gpio_output_value(padapter, gpio_pin,pin_mode);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
static int proc_get_gpio(struct seq_file *m, void *v)
|
||||
{
|
||||
u8 gpioreturnvalue=0;
|
||||
struct net_device *dev = m->private;
|
||||
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
if(!padapter)
|
||||
return -EFAULT;
|
||||
gpioreturnvalue = rtw_hal_get_gpio(padapter, padapter->pre_gpio_pin);
|
||||
DBG_871X_SEL_NL(m, "get_gpio %d:%d \n",padapter->pre_gpio_pin ,gpioreturnvalue);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
static ssize_t proc_set_gpio(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
char tmp[32]={0};
|
||||
int num=0,gpio_pin=0;
|
||||
|
||||
if (count < 1)
|
||||
return -EFAULT;
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp)))
|
||||
{
|
||||
num =sscanf(tmp, "%d",&gpio_pin);
|
||||
DBG_871X("num=%d gpio_pin=%d\n",num,gpio_pin);
|
||||
padapter->pre_gpio_pin=gpio_pin;
|
||||
|
||||
}
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int proc_get_linked_info_dump(struct seq_file *m, void *v)
|
||||
{
|
||||
struct net_device *dev = m->private;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
if(padapter)
|
||||
if(padapter)
|
||||
DBG_871X_SEL_NL(m, "linked_info_dump :%s \n", (padapter->bLinkInfoDump)?"enable":"disable");
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -276,28 +355,40 @@ static ssize_t proc_set_linked_info_dump(struct file *file, const char __user *b
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
char tmp[2];
|
||||
int mode=0;
|
||||
|
||||
char tmp[32]={0};
|
||||
int mode=0,pre_mode=0;
|
||||
int num=0;
|
||||
|
||||
if (count < 1)
|
||||
return -EFAULT;
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
pre_mode=padapter->bLinkInfoDump;
|
||||
DBG_871X("pre_mode=%d \n",pre_mode);
|
||||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp)))
|
||||
{
|
||||
num =sscanf(tmp, "%d ", &mode);
|
||||
DBG_871X("num=%d mode=%d\n",num,mode);
|
||||
|
||||
if( padapter )
|
||||
if(num!=1)
|
||||
{
|
||||
//padapter->bLinkInfoDump = mode;
|
||||
//DBG_871X("linked_info_dump =%s \n", (padapter->bLinkInfoDump)?"enable":"disable");
|
||||
linked_info_dump(padapter,mode);
|
||||
DBG_871X("argument number is wrong\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if(mode==1 || (mode==0 && pre_mode==1) ) //not consider pwr_saving 0:
|
||||
{
|
||||
padapter->bLinkInfoDump = mode;
|
||||
|
||||
}
|
||||
else if( (mode==2 ) || (mode==0 && pre_mode==2))//consider power_saving
|
||||
{
|
||||
//DBG_871X("linked_info_dump =%s \n", (padapter->bLinkInfoDump)?"enable":"disable")
|
||||
linked_info_dump(padapter,mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
|
||||
int proc_get_rx_info(struct seq_file *m, void *v)
|
||||
@@ -318,8 +409,17 @@ int proc_get_rx_info(struct seq_file *m, void *v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int proc_get_mac_qinfo(struct seq_file *m, void *v)
|
||||
{
|
||||
struct net_device *dev = m->private;
|
||||
_adapter *adapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
int proc_reset_rx_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
|
||||
rtw_hal_get_hwreg(adapter, HW_VAR_DUMP_MAC_QUEUE_INFO, (u8 *)m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ssize_t proc_reset_rx_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
@@ -339,6 +439,94 @@ int proc_reset_rx_info(struct file *file, const char __user *buffer, size_t coun
|
||||
return count;
|
||||
}
|
||||
|
||||
int proc_get_wifi_spec(struct seq_file *m, void *v)
|
||||
{
|
||||
struct net_device *dev = m->private;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
DBG_871X_SEL_NL(m,"wifi_spec=%d\n",pregpriv->wifi_spec);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int proc_get_chan_plan(struct seq_file *m, void *v)
|
||||
{
|
||||
struct net_device *dev = m->private;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
DBG_871X_SEL_NL(m,"Channel plan=0x%02x\n",padapter->mlmepriv.ChannelPlan);
|
||||
return 0;
|
||||
}
|
||||
static ssize_t proc_set_chan_plan(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct SetChannelPlan_param setChannelPlan_param;
|
||||
|
||||
char tmp[32];
|
||||
u8 chan_plan = RT_CHANNEL_DOMAIN_REALTEK_DEFINE;
|
||||
|
||||
if (!padapter)
|
||||
return -EFAULT;
|
||||
|
||||
if (count < 1)
|
||||
{
|
||||
DBG_871X("argument size is less than 1\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%hhx", &chan_plan);
|
||||
|
||||
if (num != 1) {
|
||||
DBG_871X("invalid read_reg parameter!\n");
|
||||
return count;
|
||||
}
|
||||
|
||||
}
|
||||
setChannelPlan_param.channel_plan = chan_plan;
|
||||
if( H2C_SUCCESS != set_chplan_hdl(padapter, (unsigned char *)&setChannelPlan_param) )
|
||||
return -EFAULT;
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
|
||||
static int proc_get_macid_info(struct seq_file *m, void *v)
|
||||
{
|
||||
struct net_device *dev = m->private;
|
||||
_adapter *adapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj);
|
||||
u8 i;
|
||||
|
||||
DBG_871X_SEL_NL(m, "max_num:%u\n", macid_ctl->num);
|
||||
DBG_871X_SEL_NL(m, "\n");
|
||||
|
||||
DBG_871X_SEL_NL(m, "used:\n");
|
||||
dump_macid_map(m, &macid_ctl->used, macid_ctl->num);
|
||||
DBG_871X_SEL_NL(m, "\n");
|
||||
|
||||
DBG_871X_SEL_NL(m, "%-3s %-3s %-4s %-4s"
|
||||
"\n"
|
||||
, "id", "bmc", "if_g", "ch_g"
|
||||
);
|
||||
|
||||
for (i=0;i<macid_ctl->num;i++) {
|
||||
if (rtw_macid_is_used(macid_ctl, i))
|
||||
DBG_871X_SEL_NL(m, "%3u %3u %4d %4d"
|
||||
"\n"
|
||||
, i
|
||||
, rtw_macid_is_bmc(macid_ctl, i)
|
||||
, rtw_macid_get_if_g(macid_ctl, i)
|
||||
, rtw_macid_get_ch_g(macid_ctl, i)
|
||||
);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int proc_get_cam(struct seq_file *m, void *v)
|
||||
{
|
||||
struct net_device *dev = m->private;
|
||||
@@ -389,31 +577,67 @@ static int proc_get_cam_cache(struct seq_file *m, void *v)
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
u8 i;
|
||||
|
||||
DBG_871X_SEL_NL(m, "%-2s %-6s %-17s %-32s %-7s %-3s"
|
||||
//" %-2s %-2s"
|
||||
DBG_871X_SEL_NL(m, "cam bitmap:0x%016llx\n", dvobj->cam_ctl.bitmap);
|
||||
|
||||
DBG_871X_SEL_NL(m, "%-2s %-6s %-17s %-32s %-3s %-7s"
|
||||
//" %-2s %-2s %-4s %-5s"
|
||||
"\n"
|
||||
, "id", "ctrl", "mac", "key", "type", "kid"
|
||||
//, "DK", "GK"
|
||||
, "id", "ctrl", "addr", "key", "kid", "type"
|
||||
//, "MK", "GK", "MFB", "valid"
|
||||
);
|
||||
|
||||
for (i=0;i<32;i++) {
|
||||
if (dvobj->cam_cache[i].ctrl != 0)
|
||||
DBG_871X_SEL_NL(m, "%2u 0x%04x "MAC_FMT" "KEY_FMT" %-7s %3u"
|
||||
//" %2u %2u"
|
||||
DBG_871X_SEL_NL(m, "%2u 0x%04x "MAC_FMT" "KEY_FMT" %3u %-7s"
|
||||
//" %2u %2u 0x%02x %5u"
|
||||
"\n", i
|
||||
, dvobj->cam_cache[i].ctrl
|
||||
, MAC_ARG(dvobj->cam_cache[i].mac)
|
||||
, KEY_ARG(dvobj->cam_cache[i].key)
|
||||
, security_type_str(((dvobj->cam_cache[i].ctrl)>>2)&0x07)
|
||||
, (dvobj->cam_cache[i].ctrl)&0x03
|
||||
, security_type_str(((dvobj->cam_cache[i].ctrl)>>2)&0x07)
|
||||
//, ((dvobj->cam_cache[i].ctrl)>>5)&0x01
|
||||
//, ((dvobj->cam_cache[i].ctrl)>>6)&0x01
|
||||
//, ((dvobj->cam_cache[i].ctrl)>>8)&0x7f
|
||||
//, ((dvobj->cam_cache[i].ctrl)>>15)&0x01
|
||||
);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
ssize_t proc_set_btinfo_evt(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
char tmp[32];
|
||||
u8 btinfo[8];
|
||||
|
||||
if (count < 6)
|
||||
return -EFAULT;
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
int num = 0;
|
||||
|
||||
_rtw_memset(btinfo, 0, 8);
|
||||
|
||||
num = sscanf(tmp, "%hhx %hhx %hhx %hhx %hhx %hhx %hhx %hhx"
|
||||
, &btinfo[0], &btinfo[1], &btinfo[2], &btinfo[3]
|
||||
, &btinfo[4], &btinfo[5], &btinfo[6], &btinfo[7]);
|
||||
|
||||
if (num < 6)
|
||||
return -EINVAL;
|
||||
|
||||
btinfo[1] = num-2;
|
||||
|
||||
rtw_btinfo_cmd(padapter, btinfo, btinfo[1]+2);
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rtw_adapter_proc:
|
||||
* init/deinit when register/unregister net_device
|
||||
@@ -432,11 +656,14 @@ const struct rtw_proc_hdl adapter_proc_hdls [] = {
|
||||
{"adapter_state", proc_get_adapter_state, NULL},
|
||||
{"trx_info", proc_get_trx_info, NULL},
|
||||
{"rate_ctl", proc_get_rate_ctl, proc_set_rate_ctl},
|
||||
{"dis_pwt_ctl", proc_get_dis_pwt, proc_set_dis_pwt},
|
||||
{"mac_qinfo", proc_get_mac_qinfo, NULL},
|
||||
{"macid_info", proc_get_macid_info, NULL},
|
||||
{"cam", proc_get_cam, proc_set_cam},
|
||||
{"cam_cache", proc_get_cam_cache, NULL},
|
||||
{"suspend_info", proc_get_suspend_resume_info, NULL},
|
||||
{"rx_info", proc_get_rx_info, proc_reset_rx_info},
|
||||
|
||||
{"wifi_spec",proc_get_wifi_spec,NULL},
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
{"roam_flags", proc_get_roam_flags, proc_set_roam_flags},
|
||||
{"roam_param", proc_get_roam_param, proc_set_roam_param},
|
||||
@@ -475,22 +702,45 @@ const struct rtw_proc_hdl adapter_proc_hdls [] = {
|
||||
{"ampdu_enable", proc_get_ampdu_enable, proc_set_ampdu_enable},
|
||||
{"rx_stbc", proc_get_rx_stbc, proc_set_rx_stbc},
|
||||
{"rx_ampdu", proc_get_rx_ampdu, proc_set_rx_ampdu},
|
||||
{"rx_ampdu_factor",proc_get_rx_ampdu_factor,proc_set_rx_ampdu_factor},
|
||||
{"rx_ampdu_density",proc_get_rx_ampdu_density,proc_set_rx_ampdu_density},
|
||||
{"tx_ampdu_density",proc_get_tx_ampdu_density,proc_set_tx_ampdu_density},
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
||||
{"en_fwps", proc_get_en_fwps, proc_set_en_fwps},
|
||||
|
||||
//{"path_rssi", proc_get_two_path_rssi, NULL},
|
||||
{"rssi_disp",proc_get_rssi_disp, proc_set_rssi_disp},
|
||||
// {"rssi_disp",proc_get_rssi_disp, proc_set_rssi_disp},
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
{"btcoex_dbg", proc_get_btcoex_dbg, proc_set_btcoex_dbg},
|
||||
{"btcoex", proc_get_btcoex_info, NULL},
|
||||
{"btinfo_evt", proc_get_dummy, proc_set_btinfo_evt},
|
||||
#endif /* CONFIG_BT_COEXIST */
|
||||
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
{"sreset", proc_get_sreset, proc_set_sreset},
|
||||
#endif /* DBG_CONFIG_ERROR_DETECT */
|
||||
{"linked_info_dump",proc_get_linked_info_dump,proc_set_linked_info_dump},
|
||||
|
||||
#ifdef CONFIG_GPIO_API
|
||||
{"get_gpio",proc_get_gpio,proc_set_gpio},
|
||||
{"set_gpio_output_value",proc_get_dummy,proc_set_gpio_output_value},
|
||||
{"config_gpio",proc_get_dummy,proc_set_config_gpio},
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DBG_COUNTER
|
||||
{"rx_logs", proc_get_rx_logs, NULL},
|
||||
{"tx_logs", proc_get_tx_logs, NULL},
|
||||
{"int_logs", proc_get_int_logs, NULL},
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
{"rx_ring", proc_get_rx_ring, NULL},
|
||||
{"tx_ring", proc_get_tx_ring, NULL},
|
||||
#endif
|
||||
{"chan_plan",proc_get_chan_plan,proc_set_chan_plan},
|
||||
{"new_bcn_max", proc_get_new_bcn_max, proc_set_new_bcn_max},
|
||||
};
|
||||
|
||||
const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(struct rtw_proc_hdl);
|
||||
|
||||
Reference in New Issue
Block a user