mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +00:00
rtl8188eu: Remove all trailing spaces from code
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
8db176767f
commit
bb33327257
190 changed files with 53569 additions and 53764 deletions
5919
core/rtw_ap.c
5919
core/rtw_ap.c
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -231,10 +231,10 @@ static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag,
|
|||
{
|
||||
while (len > 0) {
|
||||
if (*data == tag && *(data+1) == len8b && len >= len8b*8)
|
||||
return data+2;
|
||||
|
||||
len -= (*(data+1))*8;
|
||||
data += (*(data+1))*8;
|
||||
return data+2;
|
||||
|
||||
len -= (*(data+1))*8;
|
||||
data += (*(data+1))*8;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -244,16 +244,16 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
|||
{
|
||||
struct icmp6hdr *icmphdr = (struct icmp6hdr *)data;
|
||||
unsigned char *mac;
|
||||
|
||||
if (icmphdr->icmp6_type == NDISC_ROUTER_SOLICITATION) {
|
||||
|
||||
if (icmphdr->icmp6_type == NDISC_ROUTER_SOLICITATION) {
|
||||
if (len >= 8) {
|
||||
mac = scan_tlv(&data[8], len-8, 1, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -262,55 +262,55 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
|||
mac = scan_tlv(&data[16], len-16, 1, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) {
|
||||
if (len >= 24) {
|
||||
mac = scan_tlv(&data[24], len-24, 1, 1);
|
||||
if (mac) {
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT) {
|
||||
if (len >= 24) {
|
||||
mac = scan_tlv(&data[24], len-24, 2, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (icmphdr->icmp6_type == NDISC_REDIRECT) {
|
||||
if (len >= 40) {
|
||||
mac = scan_tlv(&data[40], len-40, 2, 1);
|
||||
if (mac) {
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Redirect, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
|
||||
{
|
||||
{
|
||||
struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);
|
||||
unsigned char *dst_mac = skb->data;
|
||||
|
||||
|
@ -320,7 +320,7 @@ static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
|
|||
dst_mac[0] = 0x33;
|
||||
dst_mac[1] = 0x33;
|
||||
memcpy(&dst_mac[2], &iph->daddr.s6_addr32[3], 4);
|
||||
#if defined(__LINUX_2_6__)
|
||||
#if defined(__LINUX_2_6__)
|
||||
/*modified by qinjunjie,warning:should not remove next line*/
|
||||
skb->pkt_type = PACKET_MULTICAST;
|
||||
#endif
|
||||
|
@ -372,10 +372,10 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
|||
networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10] ^
|
||||
networkAddr[11] ^ networkAddr[12] ^ networkAddr[13] ^ networkAddr[14] ^ networkAddr[15] ^
|
||||
networkAddr[16];
|
||||
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
else
|
||||
{
|
||||
unsigned long x = 0;
|
||||
|
@ -441,8 +441,8 @@ static int __nat25_db_network_lookup_and_replace(struct adapter *priv,
|
|||
atomic_inc(&db->use_count);
|
||||
|
||||
#ifdef CL_IPV6_PASS
|
||||
DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
|
||||
"%02x%02x%02x%02x%02x%02x\n",
|
||||
DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
|
||||
"%02x%02x%02x%02x%02x%02x\n",
|
||||
db->macAddr[0],
|
||||
db->macAddr[1],
|
||||
db->macAddr[2],
|
||||
|
@ -466,7 +466,7 @@ static int __nat25_db_network_lookup_and_replace(struct adapter *priv,
|
|||
db->networkAddr[14],
|
||||
db->networkAddr[15],
|
||||
db->networkAddr[16]);
|
||||
#else
|
||||
#else
|
||||
DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
|
||||
db->macAddr[0],
|
||||
db->macAddr[1],
|
||||
|
@ -633,7 +633,7 @@ void nat25_db_cleanup(struct adapter *priv)
|
|||
int i;
|
||||
_irqL irqL;
|
||||
_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
|
||||
for(i=0; i<NAT25_HASH_SIZE; i++)
|
||||
{
|
||||
struct nat25_network_db_entry *f;
|
||||
|
@ -664,7 +664,7 @@ void nat25_db_expire(struct adapter *priv)
|
|||
int i;
|
||||
_irqL irqL;
|
||||
_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
|
||||
//if(!priv->ethBrExtInfo.nat25_disable)
|
||||
{
|
||||
for (i=0; i<NAT25_HASH_SIZE; i++)
|
||||
|
@ -1405,7 +1405,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
}
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* Handle IPV6 frame */
|
||||
/* Handle IPV6 frame */
|
||||
/*---------------------------------------------------*/
|
||||
#ifdef CL_IPV6_PASS
|
||||
else if(protocol == __constant_htons(ETH_P_IPV6))
|
||||
|
@ -1422,13 +1422,13 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
{
|
||||
case NAT25_CHECK:
|
||||
if (skb->data[0] & 1)
|
||||
return 0;
|
||||
return 0;
|
||||
return -1;
|
||||
|
||||
case NAT25_INSERT:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Insert IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3],
|
||||
iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7],
|
||||
iph->daddr.s6_addr16[0],iph->daddr.s6_addr16[1],iph->daddr.s6_addr16[2],iph->daddr.s6_addr16[3],
|
||||
|
@ -1439,10 +1439,10 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
|
||||
__nat25_db_print(priv);
|
||||
|
||||
if (iph->nexthdr == IPPROTO_ICMPV6 &&
|
||||
if (iph->nexthdr == IPPROTO_ICMPV6 &&
|
||||
skb->len > (ETH_HLEN + sizeof(*iph) + 4)) {
|
||||
if (update_nd_link_layer_addr(skb->data + ETH_HLEN + sizeof(*iph),
|
||||
skb->len - ETH_HLEN - sizeof(*iph), GET_MY_HWADDR(priv))) {
|
||||
if (update_nd_link_layer_addr(skb->data + ETH_HLEN + sizeof(*iph),
|
||||
skb->len - ETH_HLEN - sizeof(*iph), GET_MY_HWADDR(priv))) {
|
||||
struct icmp6hdr *hdr = (struct icmp6hdr *)(skb->data + ETH_HLEN + sizeof(*iph));
|
||||
hdr->icmp6_cksum = 0;
|
||||
hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr,
|
||||
|
@ -1450,26 +1450,26 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
IPPROTO_ICMPV6,
|
||||
csum_partial((__u8 *)hdr, iph->payload_len, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
case NAT25_LOOKUP:
|
||||
DEBUG_INFO("NAT25: Lookup IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3],
|
||||
iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7],
|
||||
iph->daddr.s6_addr16[0],iph->daddr.s6_addr16[1],iph->daddr.s6_addr16[2],iph->daddr.s6_addr16[3],
|
||||
iph->daddr.s6_addr16[4],iph->daddr.s6_addr16[5],iph->daddr.s6_addr16[6],iph->daddr.s6_addr16[7]);
|
||||
|
||||
|
||||
|
||||
__nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->daddr);
|
||||
if (!__nat25_db_network_lookup_and_replace(priv, skb, networkAddr)) {
|
||||
#ifdef SUPPORT_RX_UNI2MCAST
|
||||
#ifdef SUPPORT_RX_UNI2MCAST
|
||||
if (iph->daddr.s6_addr[0] == 0xff)
|
||||
convert_ipv6_mac_to_mc(skb);
|
||||
#endif
|
||||
convert_ipv6_mac_to_mc(skb);
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
@ -1530,12 +1530,12 @@ int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb)
|
|||
(*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_IP)) &&
|
||||
!memcmp(priv->scdb_ip, skb->data+ETH_HLEN+16, 4)) {
|
||||
memcpy(skb->data, priv->scdb_mac, ETH_ALEN);
|
||||
|
||||
|
||||
_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
}
|
||||
else {
|
||||
_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
|
||||
retval = nat25_db_handle(priv, skb, NAT25_LOOKUP);
|
||||
}
|
||||
}
|
||||
|
@ -1664,4 +1664,3 @@ void *scdb_findEntry(struct adapter *priv, unsigned char *macAddr,
|
|||
}
|
||||
|
||||
#endif // CONFIG_BR_EXT
|
||||
|
||||
|
|
871
core/rtw_cmd.c
871
core/rtw_cmd.c
File diff suppressed because it is too large
Load diff
349
core/rtw_debug.c
349
core/rtw_debug.c
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -67,11 +67,11 @@ int proc_get_drv_version(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "%s\n", DRIVERVERSION);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ int proc_get_drv_version(char *page, char **start,
|
|||
int proc_get_mstat(char *page, char **start,
|
||||
off_t offset, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
len += _rtw_mstat_dump(page+len, count-len);
|
||||
|
@ -110,9 +110,9 @@ int proc_set_write_reg(struct file *file, const char *buffer,
|
|||
{
|
||||
DBG_871X("argument size is less than 3\n");
|
||||
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);
|
||||
|
||||
|
@ -124,23 +124,23 @@ int proc_set_write_reg(struct file *file, const char *buffer,
|
|||
switch(len)
|
||||
{
|
||||
case 1:
|
||||
rtw_write8(padapter, addr, (u8)val);
|
||||
rtw_write8(padapter, addr, (u8)val);
|
||||
break;
|
||||
case 2:
|
||||
rtw_write16(padapter, addr, (u16)val);
|
||||
rtw_write16(padapter, addr, (u16)val);
|
||||
break;
|
||||
case 4:
|
||||
rtw_write32(padapter, addr, val);
|
||||
rtw_write32(padapter, addr, val);
|
||||
break;
|
||||
default:
|
||||
DBG_871X("error write length=%d", len);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static u32 proc_get_read_addr=0xeeeeeeee;
|
||||
|
@ -149,21 +149,21 @@ static u32 proc_get_read_len=0x4;
|
|||
int proc_get_read_reg(char *page, char **start,
|
||||
off_t offset, int count,
|
||||
int *eof, void *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;
|
||||
|
||||
if(proc_get_read_addr==0xeeeeeeee)
|
||||
{
|
||||
*eof = 1;
|
||||
return 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));
|
||||
break;
|
||||
case 2:
|
||||
|
@ -192,9 +192,9 @@ int proc_set_read_reg(struct file *file, const char *buffer,
|
|||
{
|
||||
DBG_871X("argument size is less than 2\n");
|
||||
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);
|
||||
|
||||
|
@ -204,10 +204,10 @@ int proc_set_read_reg(struct file *file, const char *buffer,
|
|||
}
|
||||
|
||||
proc_get_read_addr = addr;
|
||||
|
||||
|
||||
proc_get_read_len = len;
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
|
@ -219,11 +219,11 @@ int proc_get_fwstate(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "fwstate=0x%x\n", get_fwstate(pmlmepriv));
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -233,15 +233,15 @@ int proc_get_sec_info(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n",
|
||||
len += snprintf(page + len, count - len, "auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n",
|
||||
psecuritypriv->dot11AuthAlgrthm, psecuritypriv->dot11PrivacyAlgrthm,
|
||||
psecuritypriv->ndisauthtype, psecuritypriv->ndisencryptstatus);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -251,14 +251,14 @@ int proc_get_mlmext_state(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "pmlmeinfo->state=0x%x\n", pmlmeinfo->state);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -270,11 +270,11 @@ int proc_get_qos_option(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "qos_option=%d\n", pmlmepriv->qospriv.qos_option);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
|
@ -287,7 +287,7 @@ int proc_get_ht_option(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
len += snprintf(page + len, count - len, "ht_option=%d\n", pmlmepriv->htpriv.ht_option);
|
||||
|
@ -301,14 +301,14 @@ int proc_get_rf_info(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
int len = 0;
|
||||
|
||||
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);
|
||||
|
||||
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
|
@ -332,31 +332,31 @@ int proc_get_ap_info(char *page, char **start,
|
|||
{
|
||||
int i;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
|
||||
len += snprintf(page + len, count - len, "SSID=%s\n", cur_network->network.Ssid.Ssid);
|
||||
|
||||
len += snprintf(page + len, count - len, "SSID=%s\n", cur_network->network.Ssid.Ssid);
|
||||
len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr));
|
||||
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, "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);
|
||||
#ifdef CONFIG_80211N_HT
|
||||
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);
|
||||
len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
|
||||
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);
|
||||
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);
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
|
||||
for(i=0;i<16;i++)
|
||||
{
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
if(preorder_ctrl->enable)
|
||||
{
|
||||
len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -372,15 +372,15 @@ int proc_get_adapter_state(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "bSurpriseRemoved=%d, bDriverStopped=%d\n",
|
||||
|
||||
len += snprintf(page + len, count - len, "bSurpriseRemoved=%d, bDriverStopped=%d\n",
|
||||
padapter->bSurpriseRemoved, padapter->bDriverStopped);
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int proc_get_trx_info(char *page, char **start,
|
||||
off_t offset, int count,
|
||||
int *eof, void *data)
|
||||
|
@ -392,7 +392,7 @@ int proc_get_trx_info(char *page, char **start,
|
|||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
struct hw_xmit *phwxmit;
|
||||
int len = 0;
|
||||
|
||||
|
||||
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",
|
||||
|
@ -400,7 +400,7 @@ int proc_get_trx_info(char *page, char **start,
|
|||
pxmitpriv->free_xmit_extbuf_cnt, pxmitpriv->free_xframe_ext_cnt,
|
||||
precvpriv->free_recvframe_cnt);
|
||||
|
||||
for(i = 0; i < 4; i++)
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
phwxmit = pxmitpriv->hwxmits + i;
|
||||
len += snprintf(page + len, count - len, "%d, hwq.accnt=%d\n", i, phwxmit->accnt);
|
||||
|
@ -427,10 +427,10 @@ int proc_get_mac_reg_dump1(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
|
||||
|
||||
for(i=0x0;i<0x300;i+=4)
|
||||
{
|
||||
{
|
||||
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));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
|
@ -450,12 +450,12 @@ int proc_get_mac_reg_dump2(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
|
||||
memset(page, 0, count);
|
||||
for(i=0x300;i<0x600;i+=4)
|
||||
{
|
||||
{
|
||||
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));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
|
@ -473,10 +473,10 @@ int proc_get_mac_reg_dump3(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
|
||||
|
||||
for(i=0x600;i<0x800;i+=4)
|
||||
{
|
||||
{
|
||||
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));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
|
@ -489,19 +489,19 @@ int proc_get_bb_reg_dump1(char *page, char **start,
|
|||
int *eof, void *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 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)
|
||||
{
|
||||
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));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
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));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
int proc_get_bb_reg_dump2(char *page, char **start,
|
||||
|
@ -509,19 +509,19 @@ int proc_get_bb_reg_dump2(char *page, char **start,
|
|||
int *eof, void *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 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)
|
||||
{
|
||||
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));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
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));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
int proc_get_bb_reg_dump3(char *page, char **start,
|
||||
|
@ -529,19 +529,19 @@ int proc_get_bb_reg_dump3(char *page, char **start,
|
|||
int *eof, void *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 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)
|
||||
{
|
||||
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));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
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));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
int proc_get_rf_reg_dump1(char *page, char **start,
|
||||
|
@ -553,21 +553,21 @@ int proc_get_rf_reg_dump1(char *page, char **start,
|
|||
int len = 0;
|
||||
int i,j=1,path;
|
||||
u32 value;
|
||||
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
path = 1;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0;i<0xC0;i++)
|
||||
{
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
@ -579,21 +579,21 @@ int proc_get_rf_reg_dump2(char *page, char **start,
|
|||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
int len = 0;
|
||||
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;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0xC0;i<0x100;i++)
|
||||
{
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
@ -605,22 +605,22 @@ int proc_get_rf_reg_dump3(char *page, char **start,
|
|||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
int len = 0;
|
||||
int i,j=1,path;
|
||||
u32 value;
|
||||
u32 value;
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
path = 2;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0;i<0xC0;i++)
|
||||
{
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
@ -638,7 +638,7 @@ int proc_get_rf_reg_dump4(char *page, char **start,
|
|||
path = 2;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0xC0;i<0x100;i++)
|
||||
{
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
|
@ -646,11 +646,11 @@ int proc_get_rf_reg_dump4(char *page, char **start,
|
|||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int proc_get_rx_signal(char *page, char **start,
|
||||
off_t offset, int count,
|
||||
int *eof, void *data)
|
||||
|
@ -658,7 +658,7 @@ int proc_get_rx_signal(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len,
|
||||
|
@ -666,14 +666,14 @@ int proc_get_rx_signal(char *page, char **start,
|
|||
"rxpwdb:%d\n"
|
||||
"signal_strength:%u\n"
|
||||
"signal_qual:%u\n"
|
||||
"noise:%u\n",
|
||||
"noise:%u\n",
|
||||
padapter->recvpriv.rssi,
|
||||
padapter->recvpriv.rxpwdb,
|
||||
padapter->recvpriv.signal_strength,
|
||||
padapter->recvpriv.signal_qual,
|
||||
padapter->recvpriv.noise
|
||||
);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -689,15 +689,15 @@ int proc_set_rx_signal(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
return -EFAULT;
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%u %u", &is_signal_dbg, &signal_strength);
|
||||
|
||||
is_signal_dbg = is_signal_dbg==0?0:1;
|
||||
|
||||
|
||||
if(is_signal_dbg && num!=2)
|
||||
return count;
|
||||
|
||||
|
||||
signal_strength = signal_strength>100?100:signal_strength;
|
||||
signal_strength = signal_strength<0?0:signal_strength;
|
||||
|
||||
|
@ -708,11 +708,11 @@ int proc_set_rx_signal(struct file *file, const char *buffer,
|
|||
DBG_871X("set %s %u\n", "DBG_SIGNAL_STRENGTH", signal_strength);
|
||||
else
|
||||
DBG_871X("set %s\n", "HW_SIGNAL_STRENGTH");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#ifdef CONFIG_80211N_HT
|
||||
|
||||
|
@ -723,9 +723,9 @@ int proc_get_ht_enable(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
if(pregpriv)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d\n",
|
||||
|
@ -748,7 +748,7 @@ int proc_set_ht_enable(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
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);
|
||||
|
||||
|
@ -758,9 +758,9 @@ int proc_set_ht_enable(struct file *file, const char *buffer,
|
|||
printk("ht_enable=%d\n", pregpriv->ht_enable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int proc_get_cbw40_enable(char *page, char **start,
|
||||
|
@ -770,7 +770,7 @@ int proc_get_cbw40_enable(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
|
@ -795,7 +795,7 @@ int proc_set_cbw40_enable(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
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);
|
||||
|
||||
|
@ -807,9 +807,9 @@ int proc_set_cbw40_enable(struct file *file, const char *buffer,
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int proc_get_ampdu_enable(char *page, char **start,
|
||||
|
@ -819,7 +819,7 @@ int proc_get_ampdu_enable(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
|
@ -844,7 +844,7 @@ int proc_set_ampdu_enable(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
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);
|
||||
|
||||
|
@ -855,9 +855,9 @@ int proc_set_ampdu_enable(struct file *file, const char *buffer,
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
|
@ -867,9 +867,9 @@ int proc_get_two_path_rssi(char *page, char **start,
|
|||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
if(padapter)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d %d\n",
|
||||
|
@ -888,7 +888,7 @@ int proc_get_rx_stbc(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
|
@ -913,7 +913,7 @@ int proc_set_rx_stbc(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
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);
|
||||
|
||||
|
@ -923,9 +923,9 @@ int proc_set_rx_stbc(struct file *file, const char *buffer,
|
|||
printk("rx_stbc=%d\n", mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
|
@ -950,9 +950,9 @@ int proc_set_rssi_disp(struct file *file, const char *buffer,
|
|||
{
|
||||
DBG_8192C("argument size is less than 1\n");
|
||||
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);
|
||||
|
||||
|
@ -960,25 +960,25 @@ int proc_set_rssi_disp(struct file *file, const char *buffer,
|
|||
DBG_8192C("invalid set_rssi_disp parameter!\n");
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
if(enable)
|
||||
{
|
||||
{
|
||||
DBG_8192C("Turn On Rx RSSI Display Function\n");
|
||||
padapter->bRxRSSIDisplay = enable ;
|
||||
padapter->bRxRSSIDisplay = enable ;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_8192C("Turn Off Rx RSSI Display Function\n");
|
||||
padapter->bRxRSSIDisplay = 0 ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
int proc_get_all_sta_info(char *page, char **start,
|
||||
|
@ -993,18 +993,18 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
int i, j;
|
||||
_list *plist, *phead;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int len = 0;
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
len += snprintf(page + len, count - len, "sta_dz_bitmap=0x%x, tim_bitmap=0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap);
|
||||
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[i]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
@ -1017,9 +1017,9 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
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);
|
||||
#ifdef CONFIG_80211N_HT
|
||||
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);
|
||||
len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
|
||||
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);
|
||||
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);
|
||||
#endif //CONFIG_80211N_HT
|
||||
len += snprintf(page + len, count - len, "sleepq_len=%d\n", psta->sleepq_len);
|
||||
|
@ -1030,30 +1030,30 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
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++)
|
||||
{
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[j];
|
||||
if(preorder_ctrl->enable)
|
||||
{
|
||||
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);
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DBG_MEMORY_LEAK
|
||||
#include <asm/atomic.h>
|
||||
|
@ -1064,12 +1064,12 @@ int proc_get_malloc_cnt(char *page, char **start,
|
|||
off_t offset, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "_malloc_cnt=%d\n", atomic_read(&_malloc_cnt));
|
||||
len += snprintf(page + len, count - len, "_malloc_size=%d\n", atomic_read(&_malloc_size));
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -1091,8 +1091,8 @@ int proc_get_best_channel(char *page, char **start,
|
|||
index_24G = i;
|
||||
if ( pmlmeext->channel_set[i].ChannelNum == 36)
|
||||
index_5G = i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) {
|
||||
// 2.4G
|
||||
if ( pmlmeext->channel_set[i].ChannelNum == 6 ) {
|
||||
|
@ -1123,11 +1123,11 @@ int proc_get_best_channel(char *page, char **start,
|
|||
}
|
||||
}
|
||||
#if 1 // debug
|
||||
len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
|
||||
len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
|
||||
pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
|
||||
|
@ -1208,9 +1208,9 @@ int proc_set_btcoex_dbg(struct file *file, const char *buffer,
|
|||
printk("btcoex_dbg=%d\n", BTCoexDbgLevel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif /* CONFIG_BT_COEXIST */
|
||||
|
||||
|
@ -1221,9 +1221,9 @@ int proc_get_sreset(char *page, char **start, off_t offset, int count, int *eof,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -1238,7 +1238,7 @@ int proc_set_sreset(struct file *file, const char *buffer, unsigned long count,
|
|||
if (count < 1)
|
||||
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", &trigger_point);
|
||||
|
||||
|
@ -1247,9 +1247,9 @@ int proc_set_sreset(struct file *file, const char *buffer, unsigned long count,
|
|||
else
|
||||
sreset_set_trigger_point(padapter, trigger_point);
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif /* DBG_CONFIG_ERROR_DETECT */
|
||||
|
||||
|
@ -1362,9 +1362,8 @@ int proc_set_odm_adaptivity(struct file *file, const char *buffer, unsigned long
|
|||
|
||||
rtw_odm_adaptivity_parm_set(padapter, (s8)TH_L2H_ini, TH_EDCCA_HL_diff, (s8)IGI_Base, (bool)ForceEDCCA, AdapEn_RSSI, IGI_LowerBound);
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -31,7 +31,7 @@ _func_enter_;
|
|||
rtw_udelay_os(CLOCK_RATE);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void down_clk(_adapter * padapter, u16 *x )
|
||||
|
@ -40,7 +40,7 @@ _func_enter_;
|
|||
*x = *x & ~_EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void shift_out_bits(_adapter * padapter, u16 data, u16 count)
|
||||
|
@ -78,14 +78,14 @@ _func_enter_;
|
|||
}
|
||||
x &= ~_EEDI;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
u16 shift_in_bits (_adapter * padapter)
|
||||
{
|
||||
u16 x,d=0,i;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
|
@ -111,8 +111,8 @@ _func_enter_;
|
|||
|
||||
down_clk(padapter, &x);
|
||||
}
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ _func_exit_;
|
|||
void standby(_adapter * padapter )
|
||||
{
|
||||
u8 x;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EECS | _EESK);
|
||||
|
@ -130,16 +130,16 @@ _func_enter_;
|
|||
x |= _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
u16 wait_eeprom_cmd_done(_adapter* padapter)
|
||||
{
|
||||
u8 x;
|
||||
u8 x;
|
||||
u16 i,res=_FALSE;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
standby(padapter );
|
||||
for (i=0; i<200; i++)
|
||||
for (i=0; i<200; i++)
|
||||
{
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
if (x & _EEDO){
|
||||
|
@ -148,15 +148,15 @@ _func_enter_;
|
|||
}
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
}
|
||||
exit:
|
||||
_func_exit_;
|
||||
exit:
|
||||
_func_exit_;
|
||||
return res;
|
||||
}
|
||||
|
||||
void eeprom_clean(_adapter * padapter)
|
||||
{
|
||||
u16 x;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
|
@ -178,15 +178,15 @@ _func_enter_;
|
|||
goto out;
|
||||
}
|
||||
down_clk(padapter, &x);
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void eeprom_write16(_adapter * padapter, u16 reg, u16 data)
|
||||
{
|
||||
u8 x;
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
|
@ -194,12 +194,12 @@ _func_enter_;
|
|||
rtw_write8(padapter, EE_9346CR, x);
|
||||
|
||||
shift_out_bits(padapter, EEPROM_EWEN_OPCODE, 5);
|
||||
|
||||
|
||||
if(padapter->EepromAddressSize==8) //CF+ and SDIO
|
||||
shift_out_bits(padapter, 0, 6);
|
||||
else //USB
|
||||
shift_out_bits(padapter, 0, 4);
|
||||
|
||||
|
||||
standby( padapter);
|
||||
|
||||
// Commented out by rcnjko, 2004.0
|
||||
|
@ -208,7 +208,7 @@ _func_enter_;
|
|||
// shift_out_bits(Adapter, EEPROM_ERASE_OPCODE, 3);
|
||||
// shift_out_bits(Adapter, reg, Adapter->EepromAddressSize);
|
||||
//
|
||||
// if (wait_eeprom_cmd_done(Adapter ) == FALSE)
|
||||
// if (wait_eeprom_cmd_done(Adapter ) == FALSE)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
@ -227,7 +227,7 @@ _func_enter_;
|
|||
// write the data to the selected EEPROM word.
|
||||
shift_out_bits(padapter, data, 16);
|
||||
|
||||
if (wait_eeprom_cmd_done(padapter ) == _FALSE)
|
||||
if (wait_eeprom_cmd_done(padapter ) == _FALSE)
|
||||
{
|
||||
|
||||
goto exit;
|
||||
|
@ -239,8 +239,8 @@ _func_enter_;
|
|||
shift_out_bits(padapter, reg, 4);
|
||||
|
||||
eeprom_clean(padapter );
|
||||
exit:
|
||||
_func_exit_;
|
||||
exit:
|
||||
_func_exit_;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -249,7 +249,7 @@ u16 eeprom_read16(_adapter * padapter, u16 reg) //ReadEEprom
|
|||
|
||||
u16 x;
|
||||
u16 data=0;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
|
@ -276,8 +276,8 @@ _func_enter_;
|
|||
data = shift_in_bits(padapter);
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -285,12 +285,12 @@ _func_exit_;
|
|||
|
||||
|
||||
//From even offset
|
||||
void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
|
||||
void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
|
||||
{
|
||||
|
||||
u16 x, data16;
|
||||
u32 i;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
|
@ -317,12 +317,12 @@ _func_enter_;
|
|||
{
|
||||
data16 = shift_in_bits(padapter);
|
||||
data[i] = data16 & 0xff;
|
||||
data[i+1] = data16 >>8;
|
||||
data[i+1] = data16 >>8;
|
||||
}
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
|
||||
|
||||
|
@ -334,7 +334,7 @@ u8 eeprom_read(_adapter * padapter, u32 addr_off, u8 sz, u8* rbuf)
|
|||
{
|
||||
u8 quotient, remainder, addr_2align_odd;
|
||||
u16 reg, stmp , i=0, idx = 0;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
reg = (u16)(addr_off >> 1);
|
||||
addr_2align_odd = (u8)(addr_off & 0x1);
|
||||
|
||||
|
@ -344,7 +344,7 @@ _func_enter_;
|
|||
rbuf[idx++] = (u8) ((stmp>>8)&0xff); //return hogh-part of the short
|
||||
reg++; sz--;
|
||||
}
|
||||
|
||||
|
||||
quotient = sz >> 1;
|
||||
remainder = sz & 0x1;
|
||||
|
||||
|
@ -354,13 +354,13 @@ _func_enter_;
|
|||
rbuf[idx++] = (u8) (stmp&0xff);
|
||||
rbuf[idx++] = (u8) ((stmp>>8)&0xff);
|
||||
}
|
||||
|
||||
|
||||
reg = reg+i;
|
||||
if(remainder){ //end of read at lower part of short : 0,2,4,6,...
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx] = (u8)(stmp & 0xff);
|
||||
rbuf[idx] = (u8)(stmp & 0xff);
|
||||
}
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
@ -369,9 +369,8 @@ _func_exit_;
|
|||
VOID read_eeprom_content(_adapter * padapter)
|
||||
{
|
||||
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
|
||||
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
|
210
core/rtw_efuse.c
210
core/rtw_efuse.c
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -77,12 +77,12 @@ BOOLEAN
|
|||
Efuse_Write1ByteToFakeContent(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value );
|
||||
IN u8 Value );
|
||||
BOOLEAN
|
||||
Efuse_Write1ByteToFakeContent(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value )
|
||||
IN u8 Value )
|
||||
{
|
||||
if(Offset >= EFUSE_MAX_HW_SIZE)
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ Efuse_Write1ByteToFakeContent(
|
|||
/*-----------------------------------------------------------------------------
|
||||
* Function: Efuse_PowerSwitch
|
||||
*
|
||||
* Overview: When we want to enable write operation, we should change to
|
||||
* Overview: When we want to enable write operation, we should change to
|
||||
* pwr on state. When we stop write, we should switch to 500k mode
|
||||
* and disable LDO 2.5V.
|
||||
*
|
||||
|
@ -112,7 +112,7 @@ Efuse_Write1ByteToFakeContent(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/17/2008 MHC Create Version 0.
|
||||
* 11/17/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
VOID
|
||||
|
@ -122,7 +122,7 @@ Efuse_PowerSwitch(
|
|||
IN u8 PwrState)
|
||||
{
|
||||
pAdapter->HalFunc.EfusePowerSwitch(pAdapter, bWrite, PwrState);
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: efuse_GetCurrentSize
|
||||
|
@ -137,7 +137,7 @@ Efuse_PowerSwitch(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/16/2008 MHC Create Version 0.
|
||||
* 11/16/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
u16
|
||||
|
@ -179,9 +179,9 @@ Efuse_CalculateWordCnts(IN u8 word_en)
|
|||
VOID
|
||||
ReadEFuseByte(
|
||||
struct adapter *Adapter,
|
||||
u16 _offset,
|
||||
u8 *pbuf,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
u16 _offset,
|
||||
u8 *pbuf,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
{
|
||||
u32 value32;
|
||||
u8 readbyte;
|
||||
|
@ -195,14 +195,14 @@ ReadEFuseByte(
|
|||
}
|
||||
|
||||
//Write Address
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff));
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff));
|
||||
readbyte = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc));
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc));
|
||||
|
||||
//Write bit 32 0
|
||||
readbyte = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f));
|
||||
|
||||
readbyte = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f));
|
||||
|
||||
//Check bit 32 read-ready
|
||||
retry = 0;
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
|
@ -219,16 +219,16 @@ ReadEFuseByte(
|
|||
// result will always stay on last data we read.
|
||||
rtw_udelay_os(50);
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
|
||||
|
||||
*pbuf = (u8)(value32 & 0xff);
|
||||
//DBG_871X("ReadEFuseByte _offset:%08u, in %d ms\n",_offset ,rtw_get_passing_time_ms(start));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// 1. Execute E-Fuse read byte operation according as map offset and
|
||||
// 1. Execute E-Fuse read byte operation according as map offset and
|
||||
// save to E-Fuse table.
|
||||
// 2. Refered from SD1 Richard.
|
||||
//
|
||||
|
@ -238,7 +238,7 @@ ReadEFuseByte(
|
|||
//
|
||||
// Created by Roger, 2008.10.21.
|
||||
//
|
||||
// 2008/12/12 MH 1. Reorganize code flow and reserve bytes. and add description.
|
||||
// 2008/12/12 MH 1. Reorganize code flow and reserve bytes. and add description.
|
||||
// 2. Add efuse utilization collect.
|
||||
// 2008/12/22 MH Read Efuse must check if we write section 1 data again!!! Sec1
|
||||
// write addr must be after sec5.
|
||||
|
@ -249,8 +249,8 @@ efuse_ReadEFuse(
|
|||
struct adapter *Adapter,
|
||||
u8 efuseType,
|
||||
u16 _offset,
|
||||
u16 _size_byte,
|
||||
u8 *pbuf,
|
||||
u16 _size_byte,
|
||||
u8 *pbuf,
|
||||
IN BOOLEAN bPseudoTest
|
||||
);
|
||||
VOID
|
||||
|
@ -258,8 +258,8 @@ efuse_ReadEFuse(
|
|||
struct adapter *Adapter,
|
||||
u8 efuseType,
|
||||
u16 _offset,
|
||||
u16 _size_byte,
|
||||
u8 *pbuf,
|
||||
u16 _size_byte,
|
||||
u8 *pbuf,
|
||||
IN BOOLEAN bPseudoTest
|
||||
)
|
||||
{
|
||||
|
@ -291,12 +291,12 @@ EFUSE_GetEfuseDefinition(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 09/23/2008 MHC Copy from WMAC.
|
||||
* 09/23/2008 MHC Copy from WMAC.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
u8
|
||||
EFUSE_Read1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
EFUSE_Read1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
IN u16 Address)
|
||||
{
|
||||
u8 data;
|
||||
|
@ -310,12 +310,12 @@ EFUSE_Read1Byte(
|
|||
if (Address < contentLen) //E-fuse 512Byte
|
||||
{
|
||||
//Write E-fuse Register address bit0~7
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
//Write E-fuse Register address bit8~9
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
|
||||
//Write 0x30[31]=0
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
|
@ -325,7 +325,7 @@ EFUSE_Read1Byte(
|
|||
//Wait Write-ready (0x30[31]=1)
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
while(!(Bytetemp & 0x80))
|
||||
{
|
||||
{
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
k++;
|
||||
if(k==1000)
|
||||
|
@ -339,7 +339,7 @@ EFUSE_Read1Byte(
|
|||
}
|
||||
else
|
||||
return 0xFF;
|
||||
|
||||
|
||||
}/* EFUSE_Read1Byte */
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
|
@ -355,18 +355,18 @@ EFUSE_Read1Byte(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 09/23/2008 MHC Copy from WMAC.
|
||||
* 09/23/2008 MHC Copy from WMAC.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
IN u16 Address,
|
||||
IN u8 Value);
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
IN u16 Address,
|
||||
IN u8 Value)
|
||||
{
|
||||
|
@ -383,13 +383,13 @@ EFUSE_Write1Byte(
|
|||
rtw_write8(Adapter, EFUSE_CTRL, Value);
|
||||
|
||||
//Write E-fuse Register address bit0~7
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
|
||||
//Write E-fuse Register address bit8~9
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
|
||||
//Write 0x30[31]=1
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
|
@ -400,7 +400,7 @@ EFUSE_Write1Byte(
|
|||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
while(Bytetemp & 0x80)
|
||||
{
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
k++;
|
||||
if(k==100)
|
||||
{
|
||||
|
@ -414,7 +414,7 @@ EFUSE_Write1Byte(
|
|||
/* 11/16/2008 MH Read one byte from real Efuse. */
|
||||
u8
|
||||
efuse_OneByteRead(
|
||||
IN struct adapter *pAdapter,
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 addr,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -428,35 +428,35 @@ efuse_OneByteRead(
|
|||
return bResult;
|
||||
}
|
||||
// -----------------e-fuse reg ctrl ---------------------------------
|
||||
//address
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) &0x03) ) |
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC ));
|
||||
//address
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) &0x03) ) |
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC ));
|
||||
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);//read cmd
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);//read cmd
|
||||
|
||||
while(!(0x80 &rtw_read8(pAdapter, EFUSE_CTRL+3))&&(tmpidx<100))
|
||||
{
|
||||
tmpidx++;
|
||||
}
|
||||
if(tmpidx<100)
|
||||
{
|
||||
*data=rtw_read8(pAdapter, EFUSE_CTRL);
|
||||
{
|
||||
*data=rtw_read8(pAdapter, EFUSE_CTRL);
|
||||
bResult = _TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
*data = 0xff;
|
||||
*data = 0xff;
|
||||
bResult = _FALSE;
|
||||
}
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
/* 11/16/2008 MH Write one byte to reald Efuse. */
|
||||
u8
|
||||
efuse_OneByteWrite(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 addr,
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 addr,
|
||||
IN u8 data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
{
|
||||
|
@ -472,29 +472,29 @@ efuse_OneByteWrite(
|
|||
|
||||
//return 0;
|
||||
|
||||
// -----------------e-fuse reg ctrl ---------------------------------
|
||||
//address
|
||||
// -----------------e-fuse reg ctrl ---------------------------------
|
||||
//address
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+2,
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC )|(u8)((addr>>8)&0x03) );
|
||||
rtw_write8(pAdapter, EFUSE_CTRL, data);//data
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+2,
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC )|(u8)((addr>>8)&0x03) );
|
||||
rtw_write8(pAdapter, EFUSE_CTRL, data);//data
|
||||
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);//write cmd
|
||||
|
||||
|
||||
while((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx<100) ){
|
||||
tmpidx++;
|
||||
}
|
||||
|
||||
|
||||
if(tmpidx<100)
|
||||
{
|
||||
{
|
||||
bResult = _TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
bResult = _FALSE;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -510,9 +510,9 @@ Efuse_PgPacketRead( IN struct adapter *pAdapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
Efuse_PgPacketWrite(IN struct adapter *pAdapter,
|
||||
IN u8 offset,
|
||||
int
|
||||
Efuse_PgPacketWrite(IN struct adapter *pAdapter,
|
||||
IN u8 offset,
|
||||
IN u8 word_en,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -525,9 +525,9 @@ Efuse_PgPacketWrite(IN struct adapter *pAdapter,
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
Efuse_PgPacketWrite_BT(IN struct adapter *pAdapter,
|
||||
IN u8 offset,
|
||||
int
|
||||
Efuse_PgPacketWrite_BT(IN struct adapter *pAdapter,
|
||||
IN u8 offset,
|
||||
IN u8 word_en,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -552,15 +552,15 @@ Efuse_PgPacketWrite_BT(IN struct adapter *pAdapter,
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/16/2008 MHC Create Version 0.
|
||||
* 11/21/2008 MHC Fix Write bug when we only enable late word.
|
||||
* 11/16/2008 MHC Create Version 0.
|
||||
* 11/21/2008 MHC Fix Write bug when we only enable late word.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
efuse_WordEnableDataRead(IN u8 word_en,
|
||||
IN u8 *sourdata,
|
||||
IN u8 *targetdata)
|
||||
{
|
||||
{
|
||||
if (!(word_en&BIT(0)))
|
||||
{
|
||||
targetdata[0] = sourdata[0];
|
||||
|
@ -587,14 +587,14 @@ efuse_WordEnableDataRead(IN u8 word_en,
|
|||
u8
|
||||
Efuse_WordEnableDataWrite( IN struct adapter *pAdapter,
|
||||
IN u16 efuse_addr,
|
||||
IN u8 word_en,
|
||||
IN u8 word_en,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
{
|
||||
u8 ret=0;
|
||||
|
||||
ret = pAdapter->HalFunc.Efuse_WordEnableDataWrite(pAdapter, efuse_addr, word_en, data, bPseudoTest);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -911,18 +911,18 @@ exit:
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/11/2008 MHC Create Version 0.
|
||||
* 11/11/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
VOID
|
||||
VOID
|
||||
Efuse_ReadAllMap(
|
||||
IN struct adapter *pAdapter,
|
||||
IN struct adapter *pAdapter,
|
||||
IN u8 efuseType,
|
||||
IN OUT u8 *Efuse,
|
||||
IN BOOLEAN bPseudoTest);
|
||||
VOID
|
||||
VOID
|
||||
Efuse_ReadAllMap(
|
||||
IN struct adapter *pAdapter,
|
||||
IN struct adapter *pAdapter,
|
||||
IN u8 efuseType,
|
||||
IN OUT u8 *Efuse,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -953,7 +953,7 @@ Efuse_ReadAllMap(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
static VOID
|
||||
|
@ -1014,7 +1014,7 @@ efuse_ShadowRead4Byte(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
#ifdef PLATFORM
|
||||
|
@ -1022,13 +1022,13 @@ static VOID
|
|||
efuse_ShadowWrite1Byte(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value);
|
||||
IN u8 Value);
|
||||
#endif //PLATFORM
|
||||
static VOID
|
||||
efuse_ShadowWrite1Byte(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value)
|
||||
IN u8 Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
|
||||
|
@ -1041,7 +1041,7 @@ static VOID
|
|||
efuse_ShadowWrite2Byte(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u16 Value)
|
||||
IN u16 Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
|
||||
|
@ -1079,7 +1079,7 @@ efuse_ShadowWrite4Byte(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/13/2008 MHC Create Version 0.
|
||||
* 11/13/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
void EFUSE_ShadowMapUpdate(
|
||||
|
@ -1098,19 +1098,19 @@ void EFUSE_ShadowMapUpdate(
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
if(_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM)) {
|
||||
#endif
|
||||
|
||||
|
||||
Efuse_ReadAllMap(pAdapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest);
|
||||
|
||||
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
storeAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//PlatformMoveMemory((PVOID)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0],
|
||||
//PlatformMoveMemory((PVOID)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0],
|
||||
//(PVOID)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen);
|
||||
}// EFUSE_ShadowMapUpdate
|
||||
|
||||
|
@ -1128,7 +1128,7 @@ void EFUSE_ShadowMapUpdate(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
|
@ -1144,7 +1144,7 @@ EFUSE_ShadowRead(
|
|||
efuse_ShadowRead2Byte(pAdapter, Offset, (u16 *)Value);
|
||||
else if (Type == 4)
|
||||
efuse_ShadowRead4Byte(pAdapter, Offset, (u32 *)Value);
|
||||
|
||||
|
||||
} // EFUSE_ShadowRead
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
|
@ -1160,7 +1160,7 @@ EFUSE_ShadowRead(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
VOID
|
||||
|
@ -1202,7 +1202,7 @@ Efuse_InitSomeVar(
|
|||
)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
|
||||
_rtw_memset((PVOID)&fakeEfuseContent[0], 0xff, EFUSE_MAX_HW_SIZE);
|
||||
_rtw_memset((PVOID)&fakeEfuseInitMap[0], 0xff, EFUSE_MAX_MAP_LEN);
|
||||
_rtw_memset((PVOID)&fakeEfuseModifiedMap[0], 0xff, EFUSE_MAX_MAP_LEN);
|
||||
|
@ -1252,24 +1252,24 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
|
|||
int ret = _SUCCESS;
|
||||
mm_segment_t oldfs;
|
||||
struct file *fp;
|
||||
|
||||
|
||||
if(path && eeprom_priv) {
|
||||
|
||||
ret = rtw_retrive_from_file(path, eeprom_priv->efuse_eeprom_data, EEPROM_MAX_SIZE);
|
||||
|
||||
|
||||
if(ret == EEPROM_MAX_SIZE)
|
||||
ret = _SUCCESS;
|
||||
else
|
||||
ret = _FAIL;
|
||||
|
||||
#if 0
|
||||
if(isAdaptorInfoFileValid()) {
|
||||
if(isAdaptorInfoFileValid()) {
|
||||
return 0;
|
||||
} else {
|
||||
return _FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
} else {
|
||||
DBG_871X("%s NULL pointer\n",__FUNCTION__);
|
||||
ret = _FAIL;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -47,16 +47,16 @@ u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 };
|
|||
u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 };
|
||||
u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 };
|
||||
//-----------------------------------------------------------
|
||||
// for adhoc-master to generate ie and provide supported-rate to fw
|
||||
// for adhoc-master to generate ie and provide supported-rate to fw
|
||||
//-----------------------------------------------------------
|
||||
|
||||
static u8 WIFI_CCKRATES[] =
|
||||
static u8 WIFI_CCKRATES[] =
|
||||
{(IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK),
|
||||
(IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK),
|
||||
(IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK),
|
||||
(IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK)};
|
||||
|
||||
static u8 WIFI_OFDMRATES[] =
|
||||
static u8 WIFI_OFDMRATES[] =
|
||||
{(IEEE80211_OFDM_RATE_6MB),
|
||||
(IEEE80211_OFDM_RATE_9MB),
|
||||
(IEEE80211_OFDM_RATE_12MB),
|
||||
|
@ -81,17 +81,17 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
|
|||
}
|
||||
|
||||
uint rtw_is_cckrates_included(u8 *rate)
|
||||
{
|
||||
u32 i = 0;
|
||||
{
|
||||
u32 i = 0;
|
||||
|
||||
while(rate[i]!=0)
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
return _TRUE;
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
return _TRUE;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
|
@ -105,11 +105,11 @@ uint rtw_is_cckratesonly_included(u8 *rate)
|
|||
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||
|
||||
return _FALSE;
|
||||
return _FALSE;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
return _TRUE;
|
||||
|
||||
}
|
||||
|
@ -122,17 +122,17 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
|
|||
return WIRELESS_INVALID;
|
||||
else
|
||||
return WIRELESS_11A;
|
||||
}
|
||||
}
|
||||
else // could be pure B, pure G, or B/G
|
||||
{
|
||||
if ((rtw_is_cckratesonly_included(rate)) == _TRUE)
|
||||
if ((rtw_is_cckratesonly_included(rate)) == _TRUE)
|
||||
return WIRELESS_11B;
|
||||
else if((rtw_is_cckrates_included(rate)) == _TRUE)
|
||||
return WIRELESS_11BG;
|
||||
return WIRELESS_11BG;
|
||||
else
|
||||
return WIRELESS_11G;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source,
|
||||
|
@ -146,10 +146,10 @@ u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *sourc
|
|||
// rtw_set_ie will update frame length
|
||||
u8 *rtw_set_ie
|
||||
(
|
||||
u8 *pbuf,
|
||||
sint index,
|
||||
u8 *pbuf,
|
||||
sint index,
|
||||
uint len,
|
||||
u8 *source,
|
||||
u8 *source,
|
||||
uint *frlen //frame length
|
||||
)
|
||||
{
|
||||
|
@ -160,11 +160,11 @@ _func_enter_;
|
|||
|
||||
if (len > 0)
|
||||
_rtw_memcpy((void *)(pbuf + 2), (void *)source, len);
|
||||
|
||||
|
||||
*frlen = *frlen + (len + 2);
|
||||
|
||||
|
||||
return (pbuf + len + 2);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
inline u8 *rtw_set_ie_ch_switch(u8 *buf, u32 *buf_len, u8 ch_switch_mode,
|
||||
|
@ -229,7 +229,7 @@ u8 *rtw_get_ie(u8 *pbuf, sint index, sint *len, sint limit)
|
|||
u8 *p;
|
||||
_func_enter_;
|
||||
if (limit < 1){
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ _func_enter_;
|
|||
if (i >= limit)
|
||||
break;
|
||||
}
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
|
|||
|
||||
if(ie)
|
||||
_rtw_memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
|
||||
|
||||
|
||||
if(ielen)
|
||||
*ielen = in_ie[cnt+1]+2;
|
||||
|
||||
|
@ -299,10 +299,10 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
|
|||
}
|
||||
else
|
||||
{
|
||||
cnt+=in_ie[cnt+1]+2; //goto next
|
||||
}
|
||||
cnt+=in_ie[cnt+1]+2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return target_ie;
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 o
|
|||
u32 target_ielen;
|
||||
u8 *start;
|
||||
uint search_len;
|
||||
|
||||
|
||||
if(!ies || !ies_len || *ies_len <= offset)
|
||||
goto exit;
|
||||
|
||||
|
@ -338,7 +338,7 @@ int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 o
|
|||
u8 buf[MAX_IE_SZ] = {0};
|
||||
u8 *remain_ies = target_ie + target_ielen;
|
||||
uint remain_len = search_len - (remain_ies - start);
|
||||
|
||||
|
||||
_rtw_memcpy(buf, remain_ies, remain_len);
|
||||
_rtw_memcpy(target_ie, buf, remain_len);
|
||||
*ies_len = *ies_len - target_ielen;
|
||||
|
@ -354,25 +354,25 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
|
||||
void rtw_set_supported_rate(u8* SupportedRates, uint mode)
|
||||
void rtw_set_supported_rate(u8* SupportedRates, uint mode)
|
||||
{
|
||||
_func_enter_;
|
||||
|
||||
_rtw_memset(SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX);
|
||||
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case WIRELESS_11B:
|
||||
_rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
|
||||
break;
|
||||
|
||||
|
||||
case WIRELESS_11G:
|
||||
case WIRELESS_11A:
|
||||
case WIRELESS_11_5N:
|
||||
case WIRELESS_11A_5N://Todo: no basic rate for ofdm ?
|
||||
_rtw_memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
|
||||
break;
|
||||
|
||||
|
||||
case WIRELESS_11BG:
|
||||
case WIRELESS_11G_24N:
|
||||
case WIRELESS_11_24N:
|
||||
|
@ -380,64 +380,64 @@ _func_enter_;
|
|||
_rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
|
||||
_rtw_memcpy(SupportedRates + IEEE80211_CCK_RATE_LEN, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
uint rtw_get_rateset_len(u8 *rateset)
|
||||
{
|
||||
uint i = 0;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
while(1)
|
||||
{
|
||||
if ((rateset[i]) == 0)
|
||||
break;
|
||||
|
||||
|
||||
if (i > 12)
|
||||
break;
|
||||
|
||||
i++;
|
||||
|
||||
i++;
|
||||
}
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return i;
|
||||
}
|
||||
|
||||
int rtw_generate_ie(struct registry_priv *pregistrypriv)
|
||||
{
|
||||
u8 wireless_mode;
|
||||
int sz = 0, rateLen;
|
||||
int sz = 0, rateLen;
|
||||
WLAN_BSSID_EX* pdev_network = &pregistrypriv->dev_network;
|
||||
u8* ie = pdev_network->IEs;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
//timestamp will be inserted by hardware
|
||||
sz += 8;
|
||||
sz += 8;
|
||||
ie += sz;
|
||||
|
||||
|
||||
//beacon interval : 2bytes
|
||||
*(u16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);//BCN_INTERVAL;
|
||||
sz += 2;
|
||||
sz += 2;
|
||||
ie += 2;
|
||||
|
||||
|
||||
//capability info
|
||||
*(u16*)ie = 0;
|
||||
|
||||
|
||||
*(u16*)ie |= cpu_to_le16(cap_IBSS);
|
||||
|
||||
if(pregistrypriv->preamble == PREAMBLE_SHORT)
|
||||
*(u16*)ie |= cpu_to_le16(cap_ShortPremble);
|
||||
|
||||
|
||||
if (pdev_network->Privacy)
|
||||
*(u16*)ie |= cpu_to_le16(cap_Privacy);
|
||||
|
||||
|
||||
sz += 2;
|
||||
ie += 2;
|
||||
|
||||
|
||||
//SSID
|
||||
ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);
|
||||
|
||||
|
||||
//supported rates
|
||||
if(pregistrypriv->wireless_mode == WIRELESS_11ABGN)
|
||||
{
|
||||
|
@ -450,9 +450,9 @@ _func_enter_;
|
|||
{
|
||||
wireless_mode = pregistrypriv->wireless_mode;
|
||||
}
|
||||
|
||||
|
||||
rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode) ;
|
||||
|
||||
|
||||
rateLen = rtw_get_rateset_len(pdev_network->SupportedRates);
|
||||
|
||||
if (rateLen > 8)
|
||||
|
@ -470,17 +470,17 @@ _func_enter_;
|
|||
|
||||
|
||||
//IBSS Parameter Set
|
||||
|
||||
|
||||
ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz);
|
||||
|
||||
if (rateLen > 8)
|
||||
{
|
||||
{
|
||||
ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
//HT Cap.
|
||||
if(((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
|
||||
if(((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
|
||||
&& (pregistrypriv->ht_enable==_TRUE))
|
||||
{
|
||||
//todo:
|
||||
|
@ -505,7 +505,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
|
|||
u8 *pbuf = pie;
|
||||
int limit_new = limit;
|
||||
|
||||
while(1)
|
||||
while(1)
|
||||
{
|
||||
pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new);
|
||||
|
||||
|
@ -553,7 +553,7 @@ check_next_ie:
|
|||
}
|
||||
|
||||
unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
|
||||
{
|
||||
{
|
||||
|
||||
return rtw_get_ie(pie, _WPA2_IE_ID_,rsn_ie_len, limit);
|
||||
|
||||
|
@ -604,59 +604,59 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) ||
|
||||
(_rtw_memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN) != _TRUE) )
|
||||
{
|
||||
{
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
pos = wpa_ie;
|
||||
|
||||
pos += 8;
|
||||
left = wpa_ie_len - 8;
|
||||
left = wpa_ie_len - 8;
|
||||
|
||||
|
||||
//group_cipher
|
||||
if (left >= WPA_SELECTOR_LEN) {
|
||||
|
||||
*group_cipher = rtw_get_wpa_cipher_suite(pos);
|
||||
|
||||
|
||||
pos += WPA_SELECTOR_LEN;
|
||||
left -= WPA_SELECTOR_LEN;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (left > 0)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie length mismatch, %u too much", __FUNCTION__, left));
|
||||
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
//pairwise_cipher
|
||||
if (left >= 2)
|
||||
{
|
||||
//count = le16_to_cpu(*(u16*)pos);
|
||||
{
|
||||
//count = le16_to_cpu(*(u16*)pos);
|
||||
count = RTW_GET_LE16(pos);
|
||||
pos += 2;
|
||||
left -= 2;
|
||||
|
||||
|
||||
if (count == 0 || left < count * WPA_SELECTOR_LEN) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie count botch (pairwise), "
|
||||
"count %u left %u", __FUNCTION__, count, left));
|
||||
"count %u left %u", __FUNCTION__, count, left));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
*pairwise_cipher |= rtw_get_wpa_cipher_suite(pos);
|
||||
|
||||
|
||||
pos += WPA_SELECTOR_LEN;
|
||||
left -= WPA_SELECTOR_LEN;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (left == 1)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie too short (for key mgmt)", __FUNCTION__));
|
||||
|
@ -672,9 +672,9 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x)
|
||||
|
@ -691,22 +691,22 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
|
||||
|
||||
if ((*rsn_ie!= _WPA2_IE_ID_) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2)))
|
||||
{
|
||||
{
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
pos = rsn_ie;
|
||||
pos += 4;
|
||||
left = rsn_ie_len - 4;
|
||||
left = rsn_ie_len - 4;
|
||||
|
||||
//group_cipher
|
||||
if (left >= RSN_SELECTOR_LEN) {
|
||||
|
||||
*group_cipher = rtw_get_wpa2_cipher_suite(pos);
|
||||
|
||||
|
||||
pos += RSN_SELECTOR_LEN;
|
||||
left -= RSN_SELECTOR_LEN;
|
||||
|
||||
|
||||
} else if (left > 0) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie length mismatch, %u too much", __FUNCTION__, left));
|
||||
return _FAIL;
|
||||
|
@ -714,7 +714,7 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
|
||||
//pairwise_cipher
|
||||
if (left >= 2)
|
||||
{
|
||||
{
|
||||
//count = le16_to_cpu(*(u16*)pos);
|
||||
count = RTW_GET_LE16(pos);
|
||||
pos += 2;
|
||||
|
@ -722,23 +722,23 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
|
||||
if (count == 0 || left < count * RSN_SELECTOR_LEN) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie count botch (pairwise), "
|
||||
"count %u left %u", __FUNCTION__, count, left));
|
||||
"count %u left %u", __FUNCTION__, count, left));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
{
|
||||
*pairwise_cipher |= rtw_get_wpa2_cipher_suite(pos);
|
||||
|
||||
|
||||
pos += RSN_SELECTOR_LEN;
|
||||
left -= RSN_SELECTOR_LEN;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (left == 1)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie too short (for key mgmt)", __FUNCTION__));
|
||||
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
@ -753,14 +753,14 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
}
|
||||
|
||||
return ret;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
int rtw_get_wapi_ie(u8 *in_ie,uint in_len,u8 *wapi_ie,u16 *wapi_len)
|
||||
{
|
||||
u8 authmode, i;
|
||||
uint cnt;
|
||||
uint cnt;
|
||||
u8 wapi_oui1[4]={0x0,0x14,0x72,0x01};
|
||||
u8 wapi_oui2[4]={0x0,0x14,0x72,0x02};
|
||||
|
||||
|
@ -772,7 +772,7 @@ _func_enter_;
|
|||
|
||||
//if(authmode==_WAPI_IE_)
|
||||
if(authmode==_WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt+6], wapi_oui1,4)==_TRUE ||
|
||||
_rtw_memcmp(&in_ie[cnt+6], wapi_oui2,4)==_TRUE))
|
||||
_rtw_memcmp(&in_ie[cnt+6], wapi_oui2,4)==_TRUE))
|
||||
{
|
||||
if (wapi_ie) {
|
||||
_rtw_memcpy(wapi_ie, &in_ie[cnt],in_ie[cnt+1]+2);
|
||||
|
@ -804,23 +804,23 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16
|
|||
{
|
||||
u8 authmode, sec_idx, i;
|
||||
u8 wpa_oui[4]={0x0,0x50,0xf2,0x01};
|
||||
uint cnt;
|
||||
|
||||
uint cnt;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
//Search required WPA or WPA2 IE and copy to sec_ie[ ]
|
||||
|
||||
|
||||
cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_);
|
||||
|
||||
|
||||
sec_idx=0;
|
||||
|
||||
|
||||
while(cnt<in_len)
|
||||
{
|
||||
authmode=in_ie[cnt];
|
||||
|
||||
|
||||
if((authmode==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], &wpa_oui[0],4)==_TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_get_wpa_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_get_wpa_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
|
||||
if (wpa_ie) {
|
||||
_rtw_memcpy(wpa_ie, &in_ie[cnt],in_ie[cnt+1]+2);
|
||||
|
@ -839,7 +839,7 @@ _func_enter_;
|
|||
{
|
||||
if(authmode==_WPA2_IE_ID_)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n get_rsn_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n get_rsn_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
|
||||
if (rsn_ie) {
|
||||
_rtw_memcpy(rsn_ie, &in_ie[cnt],in_ie[cnt+1]+2);
|
||||
|
@ -857,32 +857,32 @@ _func_enter_;
|
|||
else
|
||||
{
|
||||
cnt+=in_ie[cnt+1]+2; //get next
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return (*rsn_len+*wpa_len);
|
||||
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
|
||||
{
|
||||
{
|
||||
u8 match = _FALSE;
|
||||
u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04};
|
||||
|
||||
|
||||
if(ie_ptr == NULL) return match;
|
||||
|
||||
|
||||
eid = ie_ptr[0];
|
||||
|
||||
|
||||
if((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==_TRUE))
|
||||
{
|
||||
{
|
||||
//DBG_8192C("==> found WPS_IE.....\n");
|
||||
*wps_ielen = ie_ptr[1]+2;
|
||||
*wps_ielen = ie_ptr[1]+2;
|
||||
match=_TRUE;
|
||||
}
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
|
@ -941,20 +941,20 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
|
|||
|
||||
if(wps_ie)
|
||||
_rtw_memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2);
|
||||
|
||||
|
||||
if(wps_ielen)
|
||||
*wps_ielen = in_ie[cnt+1]+2;
|
||||
|
||||
|
||||
cnt+=in_ie[cnt+1]+2;
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
cnt+=in_ie[cnt+1]+2; //goto next
|
||||
}
|
||||
cnt+=in_ie[cnt+1]+2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return wpsie_ptr;
|
||||
}
|
||||
|
@ -986,33 +986,33 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
|
|||
|
||||
// 6 = 1(Element ID) + 1(Length) + 4(WPS OUI)
|
||||
attr_ptr = wps_ie + 6; //goto first attr
|
||||
|
||||
|
||||
while(attr_ptr - wps_ie < wps_ielen)
|
||||
{
|
||||
// 4 = 2(Attribute ID) + 2(Length)
|
||||
u16 attr_id = RTW_GET_BE16(attr_ptr);
|
||||
u16 attr_data_len = RTW_GET_BE16(attr_ptr + 2);
|
||||
u16 attr_len = attr_data_len + 4;
|
||||
|
||||
|
||||
//DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len);
|
||||
if( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
||||
|
||||
if(buf_attr)
|
||||
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
|
||||
|
||||
|
||||
if(len_attr)
|
||||
*len_attr = attr_len;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
attr_ptr += attr_len; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return target_attr_ptr;
|
||||
}
|
||||
|
@ -1034,7 +1034,7 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8
|
|||
|
||||
if(len_content)
|
||||
*len_content = 0;
|
||||
|
||||
|
||||
attr_ptr = rtw_get_wps_attr(wps_ie, wps_ielen, target_attr_id, NULL, &attr_len);
|
||||
|
||||
if(attr_ptr && attr_len)
|
||||
|
@ -1145,7 +1145,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
|
|||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1178,7 +1178,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
|||
DBG_871X("IEEE 802.11 element "
|
||||
"parse failed (id=%d elen=%d "
|
||||
"left=%lu)\n",
|
||||
id, elen, (unsigned long) left);
|
||||
id, elen, (unsigned long) left);
|
||||
}
|
||||
return ParseFailed;
|
||||
}
|
||||
|
@ -1280,7 +1280,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
|||
return ParseFailed;
|
||||
|
||||
return unknown ? ParseUnknown : ParseOK;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static u8 key_char2num(u8 ch);
|
||||
|
@ -1317,7 +1317,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
{
|
||||
u8 mac[ETH_ALEN];
|
||||
if(mac_addr == NULL) return;
|
||||
|
||||
|
||||
if ( rtw_initmac )
|
||||
{ // Users specify the mac address
|
||||
int jj,kk;
|
||||
|
@ -1332,7 +1332,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
{ // Use the mac address stored in the Efuse
|
||||
_rtw_memcpy(mac, mac_addr, ETH_ALEN);
|
||||
}
|
||||
|
||||
|
||||
if (((mac[0]==0xff) &&(mac[1]==0xff) && (mac[2]==0xff) &&
|
||||
(mac[3]==0xff) && (mac[4]==0xff) &&(mac[5]==0xff)) ||
|
||||
((mac[0]==0x0) && (mac[1]==0x0) && (mac[2]==0x0) &&
|
||||
|
@ -1347,7 +1347,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
// use default mac addresss
|
||||
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
|
||||
DBG_871X("MAC Address from efuse error, assign default one !!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr));
|
||||
}
|
||||
|
@ -1477,7 +1477,7 @@ void dump_p2p_ie(u8 *ie, u32 ie_len) {
|
|||
|
||||
u8 *p2p_ie;
|
||||
uint p2p_ielen;
|
||||
|
||||
|
||||
p2p_ie = rtw_get_p2p_ie(ie, ie_len, NULL, &p2p_ielen);
|
||||
if(p2p_ie != ie || p2p_ielen == 0)
|
||||
return;
|
||||
|
@ -1490,7 +1490,7 @@ void dump_p2p_ie(u8 *ie, u32 ie_len) {
|
|||
DBG_871X("%s ID:%u, LEN:%u\n", __FUNCTION__, id, len);
|
||||
|
||||
pos+=(3+len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u8 *rtw_get_p2p_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen, u8 frame_type)
|
||||
|
@ -1539,11 +1539,11 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|||
if ((in_len < 0) || (cnt > MAX_IE_SZ)) {
|
||||
dump_stack();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == _TRUE ) )
|
||||
{
|
||||
p2p_ie_ptr = in_ie + cnt;
|
||||
|
||||
|
||||
if ( p2p_ie != NULL )
|
||||
{
|
||||
_rtw_memcpy( p2p_ie, &in_ie[ cnt ], in_ie[ cnt + 1 ] + 2 );
|
||||
|
@ -1553,17 +1553,17 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|||
{
|
||||
*p2p_ielen = in_ie[ cnt + 1 ] + 2;
|
||||
}
|
||||
|
||||
|
||||
return p2p_ie_ptr;
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
|
@ -1596,33 +1596,33 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
|
|||
|
||||
// 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type)
|
||||
attr_ptr = p2p_ie + 6; //goto first attr
|
||||
|
||||
|
||||
while(attr_ptr - p2p_ie < p2p_ielen)
|
||||
{
|
||||
// 3 = 1(Attribute ID) + 2(Length)
|
||||
u8 attr_id = *attr_ptr;
|
||||
u16 attr_data_len = RTW_GET_LE16(attr_ptr + 1);
|
||||
u16 attr_len = attr_data_len + 3;
|
||||
|
||||
|
||||
//DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len);
|
||||
if( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
||||
|
||||
if(buf_attr)
|
||||
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
|
||||
|
||||
|
||||
if(len_attr)
|
||||
*len_attr = attr_len;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
attr_ptr += attr_len; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return target_attr_ptr;
|
||||
}
|
||||
|
@ -1644,7 +1644,7 @@ u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *
|
|||
|
||||
if(len_content)
|
||||
*len_content = 0;
|
||||
|
||||
|
||||
attr_ptr = rtw_get_p2p_attr(p2p_ie, p2p_ielen, target_attr_id, NULL, &attr_len);
|
||||
|
||||
if(attr_ptr && attr_len)
|
||||
|
@ -1662,19 +1662,19 @@ u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *
|
|||
}
|
||||
|
||||
u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
|
||||
{
|
||||
{
|
||||
u32 a_len;
|
||||
|
||||
*pbuf = attr_id;
|
||||
|
||||
|
||||
//*(u16*)(pbuf + 1) = cpu_to_le16(attr_len);
|
||||
RTW_PUT_LE16(pbuf + 1, attr_len);
|
||||
|
||||
if(pdata_attr)
|
||||
_rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
|
||||
|
||||
_rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
|
||||
|
||||
a_len = attr_len + 3;
|
||||
|
||||
|
||||
return a_len;
|
||||
}
|
||||
|
||||
|
@ -1725,8 +1725,8 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
|
|||
u8 *p2p_ie;
|
||||
uint p2p_ielen, p2p_ielen_ori;
|
||||
int cnt;
|
||||
|
||||
if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
|
||||
|
||||
if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
|
||||
{
|
||||
#if 0
|
||||
if(rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) {
|
||||
|
@ -1737,7 +1737,7 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
|
|||
|
||||
p2p_ielen=rtw_p2p_attr_remove(p2p_ie, p2p_ielen_ori, attr_id);
|
||||
if(p2p_ielen != p2p_ielen_ori) {
|
||||
|
||||
|
||||
u8 *next_ie_ori = p2p_ie+p2p_ielen_ori;
|
||||
u8 *next_ie = p2p_ie+p2p_ielen;
|
||||
uint remain_len = bss_ex->IELength-(next_ie_ori-bss_ex->IEs);
|
||||
|
@ -1783,7 +1783,7 @@ void dump_wfd_ie(u8 *ie, u32 ie_len)
|
|||
int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
||||
{
|
||||
int match;
|
||||
uint cnt = 0;
|
||||
uint cnt = 0;
|
||||
u8 eid, wfd_oui[4]={0x50,0x6F,0x9A,0x0A};
|
||||
|
||||
|
||||
|
@ -1797,13 +1797,13 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
while(cnt<in_len)
|
||||
{
|
||||
eid = in_ie[cnt];
|
||||
|
||||
|
||||
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], wfd_oui, 4) == _TRUE ) )
|
||||
{
|
||||
if ( wfd_ie != NULL )
|
||||
{
|
||||
_rtw_memcpy( wfd_ie, &in_ie[ cnt ], in_ie[ cnt + 1 ] + 2 );
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1812,12 +1812,12 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
*wfd_ielen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( wfd_ielen != NULL )
|
||||
{
|
||||
*wfd_ielen = in_ie[ cnt + 1 ] + 2;
|
||||
}
|
||||
|
||||
|
||||
cnt += in_ie[ cnt + 1 ] + 2;
|
||||
|
||||
match = _TRUE;
|
||||
|
@ -1825,16 +1825,16 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
}
|
||||
else
|
||||
{
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( match == _TRUE )
|
||||
{
|
||||
match = cnt;
|
||||
}
|
||||
|
||||
|
||||
return match;
|
||||
|
||||
}
|
||||
|
@ -1868,7 +1868,7 @@ int rtw_get_wfd_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_
|
|||
int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen)
|
||||
{
|
||||
int match;
|
||||
uint cnt = 0;
|
||||
uint cnt = 0;
|
||||
u8 attr_id, wfd_oui[4]={0x50,0x6F,0x9A,0x0A};
|
||||
|
||||
|
||||
|
@ -1885,17 +1885,17 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
|
|||
while( cnt < wfd_ielen )
|
||||
{
|
||||
u16 attrlen = RTW_GET_BE16(wfd_ie + cnt + 1);
|
||||
|
||||
|
||||
attr_id = wfd_ie[cnt];
|
||||
if( attr_id == target_attr_id )
|
||||
{
|
||||
// 3 -> 1 byte for attribute ID field, 2 bytes for length field
|
||||
if(attr_content)
|
||||
_rtw_memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen );
|
||||
|
||||
|
||||
if(attr_contentlen)
|
||||
*attr_contentlen = attrlen;
|
||||
|
||||
|
||||
cnt += attrlen + 3;
|
||||
|
||||
match = _TRUE;
|
||||
|
@ -1903,10 +1903,10 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
|
|||
}
|
||||
else
|
||||
{
|
||||
cnt += attrlen + 3; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
cnt += attrlen + 3; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return match;
|
||||
|
||||
|
@ -2060,7 +2060,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char * MCS_rate)
|
||||
{
|
||||
u16 max_rate = 0;
|
||||
|
||||
|
||||
if(rf_type == RF_1T1R)
|
||||
{
|
||||
if(MCS_rate[0] & BIT(7))
|
||||
|
@ -2181,4 +2181,3 @@ const char *action_public_str(u8 action)
|
|||
action = (action >= ACT_PUBLIC_MAX) ? ACT_PUBLIC_MAX : action;
|
||||
return _action_public_str[action];
|
||||
}
|
||||
|
||||
|
|
|
@ -71,12 +71,12 @@ jackson@realtek.com.tw
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#define rtw_le16_to_cpu(val) val
|
||||
#define rtw_le16_to_cpu(val) val
|
||||
#define rtw_le32_to_cpu(val) val
|
||||
#define rtw_cpu_to_le16(val) val
|
||||
#define rtw_cpu_to_le32(val) val
|
||||
#else
|
||||
#define rtw_le16_to_cpu(val) le16_to_cpu(val)
|
||||
#define rtw_le16_to_cpu(val) le16_to_cpu(val)
|
||||
#define rtw_le32_to_cpu(val) le32_to_cpu(val)
|
||||
#define rtw_cpu_to_le16(val) cpu_to_le16(val)
|
||||
#define rtw_cpu_to_le32(val) cpu_to_le32(val)
|
||||
|
@ -86,7 +86,7 @@ jackson@realtek.com.tw
|
|||
u8 _rtw_read8(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u8 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
@ -101,10 +101,10 @@ u8 _rtw_read8(struct adapter *adapter, u32 addr)
|
|||
u16 _rtw_read16(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u16 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read16 = pintfhdl->io_ops._read16;
|
||||
|
||||
|
@ -116,10 +116,10 @@ u16 _rtw_read16(struct adapter *adapter, u32 addr)
|
|||
u32 _rtw_read32(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u32 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read32 = pintfhdl->io_ops._read32;
|
||||
|
||||
|
@ -131,7 +131,7 @@ u32 _rtw_read32(struct adapter *adapter, u32 addr)
|
|||
|
||||
int _rtw_write8(struct adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
|
@ -141,12 +141,12 @@ int _rtw_write8(struct adapter *adapter, u32 addr, u8 val)
|
|||
|
||||
ret = _write8(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write16(struct adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
|
@ -162,14 +162,14 @@ int _rtw_write16(struct adapter *adapter, u32 addr, u16 val)
|
|||
}
|
||||
int _rtw_write32(struct adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write32 = pintfhdl->io_ops._write32;
|
||||
|
||||
|
||||
val = rtw_cpu_to_le32(val);
|
||||
ret = _write32(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
@ -179,7 +179,7 @@ int _rtw_write32(struct adapter *adapter, u32 addr, u32 val)
|
|||
|
||||
int _rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *pdata)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = (struct intf_hdl*)(&(pio_priv->intf));
|
||||
int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr,u32 length, u8 *pdata);
|
||||
|
@ -194,7 +194,7 @@ int _rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *pdata)
|
|||
}
|
||||
int _rtw_write8_async(struct adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
|
@ -209,7 +209,7 @@ int _rtw_write8_async(struct adapter *adapter, u32 addr, u8 val)
|
|||
}
|
||||
int _rtw_write16_async(struct adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
|
@ -224,7 +224,7 @@ int _rtw_write16_async(struct adapter *adapter, u32 addr, u16 val)
|
|||
}
|
||||
int _rtw_write32_async(struct adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
|
@ -241,7 +241,7 @@ int _rtw_write32_async(struct adapter *adapter, u32 addr, u32 val)
|
|||
void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
|
@ -249,7 +249,7 @@ void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
|
||||
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
|
@ -281,7 +281,7 @@ void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
|
@ -289,7 +289,7 @@ void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
|
||||
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ void _rtw_read_port_cancel(struct adapter *adapter)
|
|||
u32 _rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 ret = _SUCCESS;
|
||||
|
@ -325,7 +325,7 @@ u32 _rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
_func_enter_;
|
||||
|
||||
_write_port = pintfhdl->io_ops._write_port;
|
||||
|
||||
|
||||
ret = _write_port(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
@ -403,19 +403,19 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
|
|||
*/
|
||||
void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
ATOMIC_SET(&dvobj->continual_io_error, 0);
|
||||
ATOMIC_SET(&dvobj->continual_io_error, 0);
|
||||
}
|
||||
|
||||
#ifdef DBG_IO
|
||||
|
||||
u16 read_sniff_ranges[][2] = {
|
||||
//{0x550, 0x551},
|
||||
};
|
||||
};
|
||||
|
||||
u16 write_sniff_ranges[][2] = {
|
||||
//{0x550, 0x551},
|
||||
//{0x4c, 0x4c},
|
||||
};
|
||||
};
|
||||
|
||||
int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u16)/2;
|
||||
int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u16)/2;
|
||||
|
@ -427,7 +427,7 @@ bool match_read_sniff_ranges(u16 addr, u16 len)
|
|||
if (addr + len > read_sniff_ranges[i][0] && addr <= read_sniff_ranges[i][1])
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
|
@ -438,7 +438,7 @@ bool match_write_sniff_ranges(u16 addr, u16 len)
|
|||
if (addr + len > write_sniff_ranges[i][0] && addr <= write_sniff_ranges[i][1])
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ u8 dbg_rtw_read8(struct adapter *adapter, u32 addr, const char *caller, const in
|
|||
u16 dbg_rtw_read16(struct adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u16 val = _rtw_read16(adapter, addr);
|
||||
|
||||
|
||||
if (match_read_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read16(0x%04x) return 0x%04x\n", caller, line, addr, val);
|
||||
|
||||
|
@ -465,7 +465,7 @@ u16 dbg_rtw_read16(struct adapter *adapter, u32 addr, const char *caller, const
|
|||
u32 dbg_rtw_read32(struct adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u32 val = _rtw_read32(adapter, addr);
|
||||
|
||||
|
||||
if (match_read_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read32(0x%04x) return 0x%08x\n", caller, line, addr, val);
|
||||
|
||||
|
@ -476,21 +476,21 @@ int dbg_rtw_write8(struct adapter *adapter, u32 addr, u8 val, const char *caller
|
|||
{
|
||||
if (match_write_sniff_ranges(addr, 1))
|
||||
DBG_871X("DBG_IO %s:%d rtw_write8(0x%04x, 0x%02x)\n", caller, line, addr, val);
|
||||
|
||||
|
||||
return _rtw_write8(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_write16(struct adapter *adapter, u32 addr, u16 val, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d rtw_write16(0x%04x, 0x%04x)\n", caller, line, addr, val);
|
||||
|
||||
|
||||
return _rtw_write16(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_write32(struct adapter *adapter, u32 addr, u32 val, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d rtw_write32(0x%04x, 0x%08x)\n", caller, line, addr, val);
|
||||
|
||||
|
||||
return _rtw_write32(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *data, const char *caller, const int line)
|
||||
|
@ -501,5 +501,3 @@ int dbg_rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *data, con
|
|||
return _rtw_writeN(adapter, addr, length, data);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -24,6 +24,3 @@
|
|||
#include <drv_types.h>
|
||||
#include <rtw_ioctl_query.h>
|
||||
#include <wifi.h>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -57,8 +57,8 @@ struct oid_obj_priv oid_rtl_seg_01_01[] =
|
|||
{1, &oid_rt_get_preamble_mode_hdl}, //0x96
|
||||
{1, &oid_null_function}, //0x97
|
||||
{1, &oid_rt_get_ap_ip_hdl}, //0x98
|
||||
{1, &oid_rt_get_channelplan_hdl}, //0x99
|
||||
{1, &oid_rt_set_preamble_mode_hdl}, //0x9A
|
||||
{1, &oid_rt_get_channelplan_hdl}, //0x99
|
||||
{1, &oid_rt_set_preamble_mode_hdl}, //0x9A
|
||||
{1, &oid_rt_set_bcn_intvl_hdl}, //0x9B
|
||||
{1, &oid_null_function}, //0x9C
|
||||
{1, &oid_rt_dedicate_probe_hdl}, //0x9D
|
||||
|
@ -73,8 +73,8 @@ struct oid_obj_priv oid_rtl_seg_01_01[] =
|
|||
{1, &oid_null_function}, //0xA6
|
||||
{1, &oid_rt_get_total_tx_bytes_hdl}, //0xA7
|
||||
{1, &oid_rt_get_total_rx_bytes_hdl}, //0xA8
|
||||
{1, &oid_rt_current_tx_power_level_hdl}, //0xA9
|
||||
{1, &oid_rt_get_enc_key_mismatch_count_hdl}, //0xAA
|
||||
{1, &oid_rt_current_tx_power_level_hdl}, //0xA9
|
||||
{1, &oid_rt_get_enc_key_mismatch_count_hdl}, //0xAA
|
||||
{1, &oid_rt_get_enc_key_match_count_hdl}, //0xAB
|
||||
{1, &oid_rt_get_channel_hdl}, //0xAC
|
||||
{1, &oid_rt_set_channelplan_hdl}, //0xAD
|
||||
|
@ -89,8 +89,8 @@ struct oid_obj_priv oid_rtl_seg_01_01[] =
|
|||
{1, &oid_null_function}, //0xB6
|
||||
{1, &oid_null_function}, //0xB7
|
||||
{1, &oid_null_function}, //0xB8
|
||||
{1, &oid_null_function}, //0xB9
|
||||
{1, &oid_null_function}, //0xBA
|
||||
{1, &oid_null_function}, //0xB9
|
||||
{1, &oid_null_function}, //0xBA
|
||||
{1, &oid_rt_supported_wireless_mode_hdl}, //0xBB
|
||||
{1, &oid_rt_get_channel_list_hdl}, //0xBC
|
||||
{1, &oid_rt_get_scan_in_progress_hdl}, //0xBD
|
||||
|
@ -105,14 +105,14 @@ struct oid_obj_priv oid_rtl_seg_01_01[] =
|
|||
{1, &oid_null_function}, //0xC6
|
||||
{1, &oid_null_function}, //0xC7
|
||||
{1, &oid_null_function}, //0xC8
|
||||
{1, &oid_null_function}, //0xC9
|
||||
{1, &oid_null_function}, //0xCA
|
||||
{1, &oid_null_function}, //0xC9
|
||||
{1, &oid_null_function}, //0xCA
|
||||
{1, &oid_null_function}, //0xCB
|
||||
{1, &oid_null_function}, //0xCC
|
||||
{1, &oid_null_function}, //0xCD
|
||||
{1, &oid_null_function}, //0xCE
|
||||
{1, &oid_null_function}, //0xCF
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct oid_obj_priv oid_rtl_seg_01_03[] =
|
||||
|
@ -128,7 +128,7 @@ struct oid_obj_priv oid_rtl_seg_01_03[] =
|
|||
|
||||
struct oid_obj_priv oid_rtl_seg_01_11[] =
|
||||
{
|
||||
{1, &oid_null_function}, //0xC0 OID_RT_PRO_RX_FILTER
|
||||
{1, &oid_null_function}, //0xC0 OID_RT_PRO_RX_FILTER
|
||||
{1, &oid_null_function}, //0xC1 OID_CE_USB_WRITE_REGISTRY
|
||||
{1, &oid_null_function}, //0xC2 OID_CE_USB_READ_REGISTRY
|
||||
{1, &oid_null_function}, //0xC3 OID_RT_PRO_SET_INITIAL_GAIN
|
||||
|
@ -136,10 +136,10 @@ struct oid_obj_priv oid_rtl_seg_01_11[] =
|
|||
{1, &oid_null_function}, //0xC5 OID_RT_PRO_SET_BB_RF_SHUTDOWN_MODE
|
||||
{1, &oid_null_function}, //0xC6 OID_RT_PRO_SET_TX_CHARGE_PUMP
|
||||
{1, &oid_null_function}, //0xC7 OID_RT_PRO_SET_RX_CHARGE_PUMP
|
||||
{1, &oid_rt_pro_rf_write_registry_hdl}, //0xC8
|
||||
{1, &oid_rt_pro_rf_read_registry_hdl}, //0xC9
|
||||
{1, &oid_rt_pro_rf_write_registry_hdl}, //0xC8
|
||||
{1, &oid_rt_pro_rf_read_registry_hdl}, //0xC9
|
||||
{1, &oid_null_function} //0xCA OID_RT_PRO_QUERY_RF_TYPE
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct oid_obj_priv oid_rtl_seg_03_00[] =
|
||||
|
@ -150,11 +150,11 @@ struct oid_obj_priv oid_rtl_seg_03_00[] =
|
|||
{1, &oid_null_function}, //0x03
|
||||
{1, &oid_rt_set_default_key_id_hdl}, //0x04
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
//************** oid_rtl_seg_01_01 section start **************
|
||||
//************** oid_rtl_seg_01_01 section start **************
|
||||
|
||||
NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
|
@ -162,28 +162,28 @@ NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
#if 0
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
_irqL oldirql;
|
||||
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
if(poid_par_priv->information_buf_len >= sizeof(struct setdig_parm))
|
||||
{
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_dig_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_dig_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
}
|
||||
_irqlevel_changed_(&oldirql,RAISE);
|
||||
_func_exit_;
|
||||
#endif
|
||||
|
@ -197,29 +197,29 @@ NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
#if 0
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
_irqL oldirql;
|
||||
|
||||
_func_enter_;
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
||||
_func_enter_;
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(struct setra_parm))
|
||||
{
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_ra_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_ra_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
}
|
||||
_irqlevel_changed_(&oldirql,RAISE);
|
||||
_func_exit_;
|
||||
#endif
|
||||
|
@ -228,7 +228,7 @@ NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//-----------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
//DEBUG_ERR(("<**********************oid_rt_get_signal_quality_hdl \n"));
|
||||
|
@ -236,7 +236,7 @@ NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(pMgntInfo->mAssoc || pMgntInfo->mIbss)
|
||||
|
@ -258,19 +258,19 @@ NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
NDIS_STATUS oid_rt_get_small_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
{
|
||||
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_smallpacket_crcerr;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -282,19 +282,19 @@ NDIS_STATUS oid_rt_get_small_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
{
|
||||
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_middlepacket_crcerr;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -307,19 +307,19 @@ NDIS_STATUS oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_large_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
{
|
||||
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_largepacket_crcerr;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -333,27 +333,27 @@ NDIS_STATUS oid_rt_get_large_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_tx_retry_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_rx_retry_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
return status;
|
||||
}
|
||||
|
@ -367,11 +367,11 @@ NDIS_STATUS oid_rt_get_rx_total_packet_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
{
|
||||
*(u64 *)poid_par_priv->information_buf = padapter->recvpriv.rx_pkts + padapter->recvpriv.rx_drop;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -384,34 +384,34 @@ NDIS_STATUS oid_rt_get_rx_total_packet_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_tx_beacon_ok_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_tx_beacon_err_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_rx_icv_err_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
|
@ -429,46 +429,46 @@ NDIS_STATUS oid_rt_get_rx_icv_err_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_INVALID_LENGTH ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_set_encryption_algorithm_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
ULONG preamblemode = 0 ;
|
||||
|
||||
ULONG preamblemode = 0 ;
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
{
|
||||
if(padapter->registrypriv.preamble == PREAMBLE_LONG)
|
||||
preamblemode = 0;
|
||||
else if (padapter->registrypriv.preamble == PREAMBLE_AUTO)
|
||||
preamblemode = 1;
|
||||
else if (padapter->registrypriv.preamble == PREAMBLE_SHORT)
|
||||
preamblemode = 2;
|
||||
|
||||
|
||||
|
||||
|
||||
*(ULONG *)poid_par_priv->information_buf = preamblemode ;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
|
@ -481,29 +481,29 @@ NDIS_STATUS oid_rt_get_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_ap_ip_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*(u16 *)poid_par_priv->information_buf = peeprompriv->channel_plan ;
|
||||
|
||||
|
@ -511,16 +511,16 @@ NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
}
|
||||
NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
peeprompriv->channel_plan = *(u16 *)poid_par_priv->information_buf ;
|
||||
|
||||
return status;
|
||||
|
@ -528,7 +528,7 @@ NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_set_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
ULONG preamblemode = 0;
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
@ -536,31 +536,31 @@ NDIS_STATUS oid_rt_set_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
|||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
{
|
||||
preamblemode = *(ULONG *)poid_par_priv->information_buf ;
|
||||
if( preamblemode == 0)
|
||||
padapter->registrypriv.preamble = PREAMBLE_LONG;
|
||||
else if (preamblemode==1 )
|
||||
padapter->registrypriv.preamble = PREAMBLE_AUTO;
|
||||
else if ( preamblemode==2 )
|
||||
padapter->registrypriv.preamble = PREAMBLE_SHORT;
|
||||
|
||||
padapter->registrypriv.preamble = PREAMBLE_SHORT;
|
||||
|
||||
*(ULONG *)poid_par_priv->information_buf = preamblemode ;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = NDIS_STATUS_INVALID_LENGTH ;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_set_bcn_intvl_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
@ -573,7 +573,7 @@ NDIS_STATUS oid_rt_set_bcn_intvl_hdl(struct oid_par_priv* poid_par_priv)
|
|||
}
|
||||
NDIS_STATUS oid_rt_dedicate_probe_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
|
@ -581,16 +581,16 @@ NDIS_STATUS oid_rt_dedicate_probe_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
{
|
||||
*(u64 *)poid_par_priv->information_buf = padapter->xmitpriv.tx_bytes;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
|
@ -598,7 +598,7 @@ NDIS_STATUS oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_INVALID_LENGTH ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -628,40 +628,40 @@ NDIS_STATUS oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_current_tx_power_level_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_enc_key_mismatch_count_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_enc_key_match_count_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
NDIS_802_11_CONFIGURATION *pnic_Config;
|
||||
|
@ -673,7 +673,7 @@ NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if ( (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE))
|
||||
|
@ -683,7 +683,7 @@ NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
channelnum = pnic_Config->DSConfig;
|
||||
*(ULONG *)poid_par_priv->information_buf = channelnum;
|
||||
|
||||
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
|
||||
_func_exit_;
|
||||
|
@ -694,79 +694,79 @@ NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
|
|||
}
|
||||
NDIS_STATUS oid_rt_get_hardware_radio_off_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_key_mismatch_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_supported_wireless_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
ULONG ulInfo = 0 ;
|
||||
//DEBUG_ERR(("<**********************oid_rt_supported_wireless_mode_hdl \n"));
|
||||
ULONG ulInfo = 0 ;
|
||||
//DEBUG_ERR(("<**********************oid_rt_supported_wireless_mode_hdl \n"));
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG)){
|
||||
ulInfo |= 0x0100; //WIRELESS_MODE_B
|
||||
ulInfo |= 0x0200; //WIRELESS_MODE_G
|
||||
ulInfo |= 0x0400; //WIRELESS_MODE_A
|
||||
|
||||
*(ULONG *) poid_par_priv->information_buf = ulInfo;
|
||||
//DEBUG_ERR(("<===oid_rt_supported_wireless_mode %x\n",ulInfo));
|
||||
*(ULONG *) poid_par_priv->information_buf = ulInfo;
|
||||
//DEBUG_ERR(("<===oid_rt_supported_wireless_mode %x\n",ulInfo));
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else{
|
||||
status = NDIS_STATUS_INVALID_LENGTH;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_channel_list_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_scan_in_progress_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -774,84 +774,84 @@ NDIS_STATUS oid_rt_get_scan_in_progress_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
NDIS_STATUS oid_rt_forced_data_rate_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_wireless_mode_for_scan_list_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_bss_wireless_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
NDIS_STATUS oid_rt_scan_with_magic_packet_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
//************** oid_rtl_seg_01_01 section end **************
|
||||
//************** oid_rtl_seg_01_01 section end **************
|
||||
|
||||
//************** oid_rtl_seg_01_03 section start **************
|
||||
//************** oid_rtl_seg_01_03 section start **************
|
||||
NDIS_STATUS oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_ap_switch_into_ap_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_ap_supported_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_ap_set_passphrase_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//************** oid_rtl_seg_01_03 section end **************
|
||||
//************** oid_rtl_seg_01_03 section end **************
|
||||
|
||||
//**************** oid_rtl_seg_01_11 section start ****************
|
||||
NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv)
|
||||
|
@ -866,27 +866,27 @@ NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
|
||||
{
|
||||
{
|
||||
//RegOffsetValue - The offset of RF register to write.
|
||||
//RegDataWidth - The data width of RF register to write.
|
||||
//RegDataValue - The value to write.
|
||||
//RegDataValue - The value to write.
|
||||
//RegOffsetValue = *((unsigned long*)InformationBuffer);
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_setrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_setrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
(unsigned long)(*((unsigned long*)poid_par_priv->information_buf+2))))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
status = NDIS_STATUS_INVALID_LENGTH;
|
||||
}
|
||||
}
|
||||
_irqlevel_changed_(&oldirql,RAISE);
|
||||
_func_exit_;
|
||||
|
||||
|
@ -907,8 +907,8 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
|
||||
{
|
||||
|
@ -922,24 +922,24 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
Adapter->mppriv.act_in_progress = _TRUE;
|
||||
Adapter->mppriv.workparam.bcompleted= _FALSE;
|
||||
Adapter->mppriv.workparam.act_type = MPT_READ_RF;
|
||||
Adapter->mppriv.workparam.io_offset = *(unsigned long*)poid_par_priv->information_buf;
|
||||
Adapter->mppriv.workparam.io_offset = *(unsigned long*)poid_par_priv->information_buf;
|
||||
Adapter->mppriv.workparam.io_value = 0xcccccccc;
|
||||
|
||||
|
||||
//RegOffsetValue - The offset of RF register to read.
|
||||
//RegDataWidth - The data width of RF register to read.
|
||||
//RegDataValue - The value to read.
|
||||
//RegDataValue - The value to read.
|
||||
//RegOffsetValue = *((unsigned long*)InformationBuffer);
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_getrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_getrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
(unsigned char*)&Adapter->mppriv.workparam.io_value))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
status = NDIS_STATUS_INVALID_LENGTH;
|
||||
|
@ -950,10 +950,10 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
return status;
|
||||
}
|
||||
|
||||
//**************** oid_rtl_seg_01_11 section end****************
|
||||
//**************** oid_rtl_seg_01_11 section end****************
|
||||
|
||||
|
||||
//************** oid_rtl_seg_03_00 section start **************
|
||||
//************** oid_rtl_seg_03_00 section start **************
|
||||
enum _CONNECT_STATE_{
|
||||
CHECKINGSTATUS,
|
||||
ASSOCIATED,
|
||||
|
@ -969,21 +969,21 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
ULONG ulInfo;
|
||||
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
// nStatus==0 CheckingStatus
|
||||
// nStatus==1 Associated
|
||||
// nStatus==2 AdHocMode
|
||||
// nStatus==3 NotAssociated
|
||||
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE)
|
||||
ulInfo = CHECKINGSTATUS;
|
||||
else if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
else if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
ulInfo = ASSOCIATED;
|
||||
else if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)== _TRUE)
|
||||
ulInfo = ADHOCMODE;
|
||||
|
@ -1013,7 +1013,7 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
NDIS_STATUS oid_rt_set_default_key_id_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
@ -1021,8 +1021,7 @@ NDIS_STATUS oid_rt_set_default_key_id_hdl(struct oid_par_priv* poid_par_priv)
|
|||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
//************** oid_rtl_seg_03_00 section end **************
|
||||
|
||||
//************** oid_rtl_seg_03_00 section end **************
|
||||
|
|
File diff suppressed because it is too large
Load diff
117
core/rtw_iol.c
117
core/rtw_iol.c
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -34,7 +34,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter)
|
|||
DBG_871X("%s rtw_alloc_xmitframe return null\n", __FUNCTION__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
if ((xmitbuf = rtw_alloc_xmitbuf(pxmitpriv)) == NULL)
|
||||
{
|
||||
DBG_871X("%s rtw_alloc_xmitbuf return null\n", __FUNCTION__);
|
||||
|
@ -42,7 +42,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter)
|
|||
xmit_frame=NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
xmit_frame->frame_tag = MGNT_FRAMETAG;
|
||||
xmit_frame->pxmitbuf = xmitbuf;
|
||||
xmit_frame->buf_addr = xmitbuf->pbuf;
|
||||
|
@ -50,8 +50,8 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter)
|
|||
|
||||
pattrib = &xmit_frame->attrib;
|
||||
update_mgntframe_attrib(adapter, pattrib);
|
||||
pattrib->qsel = 0x10;//Beacon
|
||||
pattrib->subtype = WIFI_BEACON;
|
||||
pattrib->qsel = 0x10;//Beacon
|
||||
pattrib->subtype = WIFI_BEACON;
|
||||
pattrib->pktlen = pattrib->last_txcmdsz = 0;
|
||||
|
||||
#else
|
||||
|
@ -93,11 +93,11 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
|
|||
pattrib->last_txcmdsz += cmd_len;
|
||||
|
||||
//DBG_871X("%s ori:%u + cmd_len:%u = %u\n", __FUNCTION__, ori_len, cmd_len, buf_offset+pattrib->pktlen);
|
||||
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
bool rtw_IOL_applied(struct adapter *adapter)
|
||||
{
|
||||
{
|
||||
if(1 == adapter->registrypriv.fw_iol)
|
||||
return _TRUE;
|
||||
|
||||
|
@ -137,18 +137,18 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8
|
|||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WB_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
|
||||
if(mask!=0xFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
@ -158,65 +158,65 @@ int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u
|
|||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WW_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
|
||||
if(mask!=0xFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
|
||||
}
|
||||
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u32 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WD_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
|
||||
if(mask!=0xFFFFFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, u32 value, u32 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_W_RF,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = (rf_path<<8) |((addr) &0xFF);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = (rf_path<<8) |((addr) &0xFF);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
|
||||
if(mask!=0x000FFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//DBG_871X("%s rf_path:0x%02x addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__,rf_path, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -224,8 +224,8 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr,
|
|||
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0};
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, us);
|
||||
cmd.address = cpu_to_le16(us);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, us);
|
||||
cmd.address = cpu_to_le16(us);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, us);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
|
@ -235,29 +235,29 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
|||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, ms);
|
||||
cmd.address = cpu_to_le16(ms);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, ms);
|
||||
cmd.address = cpu_to_le16(ms);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, ms);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
}
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_END,0xFFFF, 0xFF,0x0};
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame)
|
||||
{
|
||||
{
|
||||
u8 is_cmd_bndy = _FALSE;
|
||||
if(((pxmit_frame->attrib.pktlen+32)%256) + 8 >= 256){
|
||||
rtw_IOL_append_END_cmd(pxmit_frame);
|
||||
pxmit_frame->attrib.pktlen = ((((pxmit_frame->attrib.pktlen+32)/256)+1)*256 );
|
||||
|
||||
|
||||
//printk("==> %s, pktlen(%d)\n",__FUNCTION__,pxmit_frame->attrib.pktlen);
|
||||
pxmit_frame->attrib.last_txcmdsz = pxmit_frame->attrib.pktlen;
|
||||
is_cmd_bndy = _TRUE;
|
||||
is_cmd_bndy = _TRUE;
|
||||
}
|
||||
return is_cmd_bndy;
|
||||
}
|
||||
|
@ -266,23 +266,23 @@ void rtw_IOL_cmd_buf_dump(struct adapter *Adapter,int buf_len,u8 *pbuf)
|
|||
{
|
||||
int i;
|
||||
int j=1;
|
||||
|
||||
|
||||
printk("###### %s ######\n",__FUNCTION__);
|
||||
for(i=0;i< buf_len;i++){
|
||||
printk("%02x-",*(pbuf+i));
|
||||
|
||||
if(j%32 ==0) printk("\n");j++;
|
||||
|
||||
if(j%32 ==0) printk("\n");j++;
|
||||
}
|
||||
printk("\n");
|
||||
printk("============= ioreg_cmd len = %d =============== \n",buf_len);
|
||||
printk("============= ioreg_cmd len = %d =============== \n",buf_len);
|
||||
}
|
||||
|
||||
|
||||
#else //CONFIG_IOL_NEW_GENERATION
|
||||
int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary)
|
||||
{
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_LLT, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)page_boundary);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
|
@ -291,7 +291,7 @@ int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary)
|
|||
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WB_REG, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
|
@ -301,7 +301,7 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value)
|
|||
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WW_REG, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
|
@ -312,7 +312,7 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value)
|
|||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WD_REG, 0x0, 0x0};
|
||||
u8* pos = (u8 *)&cmd;
|
||||
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
|
@ -348,7 +348,7 @@ int dbg_rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value
|
|||
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_DELAY_US, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)us);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, us);
|
||||
|
@ -359,7 +359,7 @@ int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
|||
int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_DELAY_MS, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)ms);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, ms);
|
||||
|
@ -368,7 +368,7 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
|||
}
|
||||
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
{
|
||||
IOL_CMD end_cmd = {0x0, IOL_CMD_END, 0x0, 0x0};
|
||||
|
||||
|
||||
|
@ -400,4 +400,3 @@ int rtw_IOL_exec_empty_cmds_sync(struct adapter *adapter, u32 max_wating_ms)
|
|||
|
||||
|
||||
#endif //CONFIG_IOL
|
||||
|
||||
|
|
4843
core/rtw_led.c
4843
core/rtw_led.c
File diff suppressed because it is too large
Load diff
1123
core/rtw_mlme.c
1123
core/rtw_mlme.c
File diff suppressed because it is too large
Load diff
1791
core/rtw_mlme_ext.c
1791
core/rtw_mlme_ext.c
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -176,7 +176,7 @@ _func_enter_;
|
|||
path, offset, value));
|
||||
|
||||
_irqlevel_changed_(&oldirql, LOWER);
|
||||
write_rfreg(Adapter, path, offset, value);
|
||||
write_rfreg(Adapter, path, offset, value);
|
||||
_irqlevel_changed_(&oldirql, RAISE);
|
||||
|
||||
_func_exit_;
|
||||
|
@ -828,7 +828,7 @@ NDIS_STATUS oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv
|
|||
#ifdef PLATFORM_OS_XP
|
||||
_irqL oldirql;
|
||||
#endif
|
||||
u32 bStartTest;
|
||||
u32 bStartTest;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
|
@ -924,7 +924,7 @@ NDIS_STATUS oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv)
|
|||
#ifdef PLATFORM_OS_XP
|
||||
_irqL oldirql;
|
||||
#endif
|
||||
pRW_Reg RegRWStruct;
|
||||
pRW_Reg RegRWStruct;
|
||||
u32 offset, width;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
@ -976,7 +976,7 @@ NDIS_STATUS oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv)
|
|||
#ifdef PLATFORM_OS_XP
|
||||
_irqL oldirql;
|
||||
#endif
|
||||
pRW_Reg RegRWStruct;
|
||||
pRW_Reg RegRWStruct;
|
||||
u32 offset, width, value;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
@ -1125,7 +1125,7 @@ _func_enter_;
|
|||
TxCmd_Info=(TX_CMD_Desc*)poid_par_priv->information_buf;
|
||||
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:Addr=%.8X\n", TxCmd_Info->offset));
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:1.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[0]));
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:1.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[0]));
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:2.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[1]));
|
||||
RT_TRACE(_module_mp_, _drv_info_, (("WRITE_TXCMD:3.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[2]));
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:4.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[3]));
|
||||
|
@ -1929,7 +1929,7 @@ NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
||||
struct sta_info *psta = NULL;
|
||||
UCHAR *macaddr;
|
||||
UCHAR *macaddr;
|
||||
|
||||
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
|
@ -2693,7 +2693,7 @@ NDIS_STATUS oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv *poid_par_priv)
|
|||
#endif
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
||||
u32 txagc;
|
||||
u32 txagc;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -2728,7 +2728,7 @@ NDIS_STATUS oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv *poid_par_priv)
|
|||
|
||||
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
|
||||
struct mp_priv *pmppriv = &Adapter->mppriv;
|
||||
u32 type;
|
||||
u32 type;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -2944,4 +2944,3 @@ _func_exit_;
|
|||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -203,4 +203,3 @@ void rtw_odm_adaptivity_parm_set(struct adapter *adapter, s8 TH_L2H_ini, s8 TH_E
|
|||
odm->AdapEn_RSSI = AdapEn_RSSI;
|
||||
odm->IGI_LowerBound = IGI_LowerBound;
|
||||
}
|
||||
|
||||
|
|
571
core/rtw_p2p.c
571
core/rtw_p2p.c
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -35,34 +35,34 @@ void _ips_enter(struct adapter * padapter)
|
|||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
if (padapter->hw_init_completed == _FALSE) {
|
||||
DBG_871X("%s: hw_init_completed: %d\n",
|
||||
DBG_871X("%s: hw_init_completed: %d\n",
|
||||
__func__, padapter->hw_init_completed);
|
||||
return;
|
||||
}
|
||||
|
||||
pwrpriv->bips_processing = _TRUE;
|
||||
pwrpriv->bips_processing = _TRUE;
|
||||
|
||||
// syn ips_mode with request
|
||||
pwrpriv->ips_mode = pwrpriv->ips_mode_req;
|
||||
|
||||
pwrpriv->ips_enter_cnts++;
|
||||
|
||||
pwrpriv->ips_enter_cnts++;
|
||||
DBG_871X("==>ips_enter cnts:%d\n",pwrpriv->ips_enter_cnts);
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
BTDM_TurnOffBtCoexistBeforeEnterIPS(padapter);
|
||||
#endif
|
||||
if(rf_off == pwrpriv->change_rfpwrstate )
|
||||
{
|
||||
{
|
||||
pwrpriv->bpower_saving = _TRUE;
|
||||
DBG_871X_LEVEL(_drv_always_, "nolinked power save enter\n");
|
||||
|
||||
if(pwrpriv->ips_mode == IPS_LEVEL_2)
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
|
||||
|
||||
rtw_ips_pwr_down(padapter);
|
||||
pwrpriv->rf_pwrstate = rf_off;
|
||||
}
|
||||
pwrpriv->bips_processing = _FALSE;
|
||||
|
||||
}
|
||||
pwrpriv->bips_processing = _FALSE;
|
||||
|
||||
}
|
||||
|
||||
void ips_enter(struct adapter * padapter)
|
||||
|
@ -90,7 +90,7 @@ int _ips_leave(struct adapter * padapter)
|
|||
pwrpriv->rf_pwrstate = rf_on;
|
||||
}
|
||||
DBG_871X_LEVEL(_drv_always_, "nolinked power save leave\n");
|
||||
|
||||
|
||||
DBG_871X("==> ips_leave.....LED(0x%08x)...\n",rtw_read32(padapter,0x4c));
|
||||
pwrpriv->bips_processing = _FALSE;
|
||||
|
||||
|
@ -115,7 +115,7 @@ int ips_leave(struct adapter * padapter)
|
|||
#endif /* CONFIG_IPS */
|
||||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
extern void autosuspend_enter(struct adapter* padapter);
|
||||
extern void autosuspend_enter(struct adapter* padapter);
|
||||
extern int autoresume_enter(struct adapter* padapter);
|
||||
#endif
|
||||
|
||||
|
@ -184,15 +184,15 @@ bool rtw_pwr_unassociated_idle(struct adapter *adapter)
|
|||
if(adapter->proximity.proxim_on==_TRUE){
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (pxmit_priv->free_xmitbuf_cnt != NR_XMITBUFF ||
|
||||
pxmit_priv->free_xmit_extbuf_cnt != NR_XMIT_EXTBUFF) {
|
||||
DBG_871X_LEVEL(_drv_always_, "There are some pkts to transmit\n");
|
||||
DBG_871X_LEVEL(_drv_info_, "free_xmitbuf_cnt: %d, free_xmit_extbuf_cnt: %d\n",
|
||||
pxmit_priv->free_xmitbuf_cnt, pxmit_priv->free_xmit_extbuf_cnt);
|
||||
DBG_871X_LEVEL(_drv_info_, "free_xmitbuf_cnt: %d, free_xmit_extbuf_cnt: %d\n",
|
||||
pxmit_priv->free_xmitbuf_cnt, pxmit_priv->free_xmit_extbuf_cnt);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
ret = _TRUE;
|
||||
|
||||
|
@ -216,9 +216,9 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
if(pwrpriv->bips_processing == _TRUE)
|
||||
goto exit;
|
||||
|
||||
//DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca));
|
||||
if(pwrpriv->bHWPwrPindetect)
|
||||
|
||||
//DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca));
|
||||
if(pwrpriv->bHWPwrPindetect)
|
||||
{
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(padapter->registrypriv.usbss_enable)
|
||||
|
@ -235,14 +235,14 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
if(rfpwrstate == rf_off)
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
pwrpriv->brfoffbyhw = _TRUE;
|
||||
|
||||
autosuspend_enter(padapter);
|
||||
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
pwrpriv->brfoffbyhw = _TRUE;
|
||||
|
||||
autosuspend_enter(padapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_AUTOSUSPEND
|
||||
|
@ -253,21 +253,21 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
if(rfpwrstate!= pwrpriv->rf_pwrstate)
|
||||
{
|
||||
if(rfpwrstate == rf_off)
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
pwrpriv->brfoffbyhw = _TRUE;
|
||||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
rtw_hw_suspend(padapter );
|
||||
rtw_hw_suspend(padapter );
|
||||
}
|
||||
else
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_on;
|
||||
rtw_hw_resume(padapter );
|
||||
rtw_hw_resume(padapter );
|
||||
}
|
||||
DBG_871X("current rf_pwrstate(%s)\n",(pwrpriv->rf_pwrstate == rf_off)?"rf_off":"rf_on");
|
||||
}
|
||||
}
|
||||
pwrpriv->pwr_state_check_cnts ++;
|
||||
pwrpriv->pwr_state_check_cnts ++;
|
||||
}
|
||||
#endif //SUPPORT_HW_RFOFF_DETECTED
|
||||
|
||||
|
@ -287,9 +287,9 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(padapter->registrypriv.usbss_enable)
|
||||
{
|
||||
if(pwrpriv->bHWPwrPindetect)
|
||||
if(pwrpriv->bHWPwrPindetect)
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
|
||||
|
||||
if(padapter->net_closed == _TRUE)
|
||||
pwrpriv->ps_flag = _TRUE;
|
||||
|
||||
|
@ -301,12 +301,12 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x) call autosuspend_enter\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend);
|
||||
autosuspend_enter(padapter);
|
||||
}
|
||||
}
|
||||
#else
|
||||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
autosuspend_enter(padapter);
|
||||
#endif //if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
}
|
||||
else if(pwrpriv->bHWPwrPindetect)
|
||||
{
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
#endif //defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
ips_enter(padapter);
|
||||
ips_enter(padapter);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ _func_enter_;
|
|||
//cpwm_orig = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HCPWM1);
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_GET_CPWM, (u8 *)(&cpwm_orig));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_LPS_RPWM_TIMER) && !defined(CONFIG_DETECT_CPWM_BY_POLLING)
|
||||
if (rpwm & PS_ACK)
|
||||
|
@ -446,7 +446,7 @@ _func_enter_;
|
|||
//polling cpwm
|
||||
do{
|
||||
rtw_mdelay_os(1);
|
||||
|
||||
|
||||
//cpwm_now = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HCPWM1);
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_GET_CPWM, (u8 *)(&cpwm_now));
|
||||
if ((cpwm_orig ^ cpwm_now) & 0x80)
|
||||
|
@ -490,11 +490,11 @@ u8 PS_RDY_CHECK(struct adapter * padapter)
|
|||
return _FALSE;
|
||||
#endif
|
||||
|
||||
curr_time = rtw_get_current_time();
|
||||
curr_time = rtw_get_current_time();
|
||||
delta_time = curr_time -pwrpriv->DelayLPSLastTimeStamp;
|
||||
|
||||
if(delta_time < LPS_DELAY_TIME)
|
||||
{
|
||||
{
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
|
@ -515,7 +515,7 @@ u8 PS_RDY_CHECK(struct adapter * padapter)
|
|||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
if (!rtw_cfg80211_pwr_mgmt(padapter))
|
||||
return _FALSE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
@ -740,11 +740,11 @@ _func_enter_;
|
|||
struct mlme_priv *b_pmlmepriv = &(buddy->mlmepriv);
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *b_pwdinfo = &(buddy->wdinfo);
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
struct cfg80211_wifidirect_info *b_pcfg80211_wdinfo = &buddy->cfg80211_wdinfo;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
if (check_fwstate(b_pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR)
|
||||
|| check_fwstate(b_pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS)
|
||||
|| check_fwstate(b_pmlmepriv, WIFI_AP_STATE)
|
||||
|
@ -767,7 +767,7 @@ _func_enter_;
|
|||
if (_TRUE == pwrpriv->bLeisurePs)
|
||||
{
|
||||
// Idle for a while if we connect to AP a while ago.
|
||||
if(pwrpriv->LpsIdleCount >= 2) // 4 Sec
|
||||
if(pwrpriv->LpsIdleCount >= 2) // 4 Sec
|
||||
{
|
||||
if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
{
|
||||
|
@ -828,7 +828,7 @@ _func_exit_;
|
|||
|
||||
//
|
||||
// Description: Leave all power save mode: LPS, FwLPS, IPS if needed.
|
||||
// Move code to function by tynli. 2010.03.26.
|
||||
// Move code to function by tynli. 2010.03.26.
|
||||
//
|
||||
void LeaveAllPowerSaveMode(IN struct adapter *Adapter)
|
||||
{
|
||||
|
@ -854,7 +854,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
LPS_Leave_check(Adapter);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -876,12 +876,12 @@ _func_enter_;
|
|||
#ifdef CONFIG_IPS
|
||||
if(_FALSE == ips_leave(Adapter))
|
||||
{
|
||||
DBG_871X("======> ips_leave fail.............\n");
|
||||
DBG_871X("======> ips_leave fail.............\n");
|
||||
}
|
||||
#endif
|
||||
#endif //CONFIG_PLATFORM_SPRD
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
|
@ -903,7 +903,7 @@ _func_enter_;
|
|||
start_time = rtw_get_current_time();
|
||||
|
||||
rtw_yield_os();
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
@ -1091,13 +1091,13 @@ __inline static void unregister_task_alive(struct pwrctrl_priv *pwrctrl, u32 tag
|
|||
|
||||
/*
|
||||
* Caller: rtw_xmit_thread
|
||||
*
|
||||
*
|
||||
* Check if the fw_pwrstate is okay for xmit.
|
||||
* If not (cpwm is less than S3), then the sub-routine
|
||||
* will raise the cpwm to be greater than or equal to S3.
|
||||
* will raise the cpwm to be greater than or equal to S3.
|
||||
*
|
||||
* Calling Context: Passive
|
||||
*
|
||||
*
|
||||
* Return Value:
|
||||
* _SUCCESS rtw_xmit_thread can write fifo/txcmd afterwards.
|
||||
* _FAIL rtw_xmit_thread can not do anything.
|
||||
|
@ -1152,7 +1152,7 @@ _func_enter_;
|
|||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1435,7 +1435,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
pwrctrlpriv->pwr_state_check_interval = (pwrctrlpriv->bHWPwrPindetect) ?1000:2000;
|
||||
pwrctrlpriv->pwr_state_check_interval = (pwrctrlpriv->bHWPwrPindetect) ?1000:2000;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -1443,7 +1443,7 @@ _func_enter_;
|
|||
//pwrctrlpriv->FWCtrlPSMode =padapter->registrypriv.power_mgnt;// PS_MODE_MIN;
|
||||
if (padapter->registrypriv.mp_mode == 1)
|
||||
pwrctrlpriv->power_mgnt =PS_MODE_ACTIVE ;
|
||||
else
|
||||
else
|
||||
pwrctrlpriv->power_mgnt =padapter->registrypriv.power_mgnt;// PS_MODE_MIN;
|
||||
pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt)?_TRUE:_FALSE;
|
||||
|
||||
|
@ -1497,7 +1497,7 @@ void rtw_free_pwrctrl_priv(struct adapter *adapter)
|
|||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (adapter->adapter_type != PRIMARY_ADAPTER)
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -1505,7 +1505,7 @@ _func_enter_;
|
|||
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
if (pwrctrlpriv->rtw_workqueue) {
|
||||
if (pwrctrlpriv->rtw_workqueue) {
|
||||
flush_workqueue(pwrctrlpriv->rtw_workqueue);
|
||||
destroy_workqueue(pwrctrlpriv->rtw_workqueue);
|
||||
}
|
||||
|
@ -1536,16 +1536,16 @@ static void resume_workitem_callback(struct work_struct *work)
|
|||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
rtw_resume_process(adapter);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv)
|
||||
{
|
||||
// accquire system's suspend lock preventing from falliing asleep while resume in workqueue
|
||||
rtw_lock_suspend();
|
||||
|
||||
|
||||
#if 1
|
||||
queue_work(pwrpriv->rtw_workqueue, &pwrpriv->resume_work);
|
||||
queue_work(pwrpriv->rtw_workqueue, &pwrpriv->resume_work);
|
||||
#else
|
||||
_set_workitem(&pwrpriv->resume_work);
|
||||
#endif
|
||||
|
@ -1604,7 +1604,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
pwrpriv->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20;
|
||||
pwrpriv->early_suspend.suspend = rtw_early_suspend;
|
||||
pwrpriv->early_suspend.resume = rtw_late_resume;
|
||||
register_early_suspend(&pwrpriv->early_suspend);
|
||||
register_early_suspend(&pwrpriv->early_suspend);
|
||||
}
|
||||
|
||||
void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
||||
|
@ -1613,7 +1613,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
|
||||
rtw_set_do_late_resume(pwrpriv, _FALSE);
|
||||
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
unregister_early_suspend(&pwrpriv->early_suspend);
|
||||
|
||||
pwrpriv->early_suspend.suspend = NULL;
|
||||
|
@ -1656,7 +1656,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
pwrpriv->early_suspend.level = ANDROID_EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20;
|
||||
pwrpriv->early_suspend.suspend = rtw_early_suspend;
|
||||
pwrpriv->early_suspend.resume = rtw_late_resume;
|
||||
android_register_early_suspend(&pwrpriv->early_suspend);
|
||||
android_register_early_suspend(&pwrpriv->early_suspend);
|
||||
}
|
||||
|
||||
void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
||||
|
@ -1665,7 +1665,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
|
||||
rtw_set_do_late_resume(pwrpriv, _FALSE);
|
||||
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
android_unregister_early_suspend(&pwrpriv->early_suspend);
|
||||
|
||||
pwrpriv->early_suspend.suspend = NULL;
|
||||
|
@ -1677,7 +1677,7 @@ u8 rtw_interface_ps_func(struct adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8*
|
|||
{
|
||||
u8 bResult = _TRUE;
|
||||
rtw_hal_intf_ps_func(padapter,efunc_id,val);
|
||||
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -1698,7 +1698,7 @@ inline void rtw_set_ips_deny(struct adapter *padapter, u32 ms)
|
|||
int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
int ret = _SUCCESS;
|
||||
u32 start = rtw_get_current_time();
|
||||
|
||||
|
@ -1740,7 +1740,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
|
||||
if (pwrpriv->bInternalAutoSuspend == _FALSE && pwrpriv->bInSuspend) {
|
||||
DBG_871X("%s wait bInSuspend...\n", __func__);
|
||||
while (pwrpriv->bInSuspend
|
||||
while (pwrpriv->bInSuspend
|
||||
&& ((rtw_get_passing_time_ms(start) <= 3000 && !rtw_is_do_late_resume(pwrpriv))
|
||||
|| (rtw_get_passing_time_ms(start) <= 500 && rtw_is_do_late_resume(pwrpriv)))
|
||||
) {
|
||||
|
@ -1770,12 +1770,12 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
if(_TRUE==pwrpriv->bInternalAutoSuspend){
|
||||
if(0==pwrpriv->autopm_cnt){
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
|
||||
if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0)
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
|
||||
if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0)
|
||||
{
|
||||
DBG_871X( "can't get autopm: \n");
|
||||
}
|
||||
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
|
||||
}
|
||||
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
|
||||
usb_autopm_disable(adapter_to_dvobj(padapter)->pusbintf);
|
||||
#else
|
||||
usb_autoresume_device(adapter_to_dvobj(padapter)->pusbdev, 1);
|
||||
|
@ -1788,10 +1788,10 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
#endif //#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
}
|
||||
|
||||
if(rf_off == pwrpriv->rf_pwrstate )
|
||||
{
|
||||
{
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(pwrpriv->brfoffbyhw==_TRUE)
|
||||
|
@ -1808,7 +1808,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
DBG_8192C("======> autoresume fail.............\n");
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -1833,9 +1833,9 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
){
|
||||
DBG_8192C("%s: bDriverStopped=%d, bup=%d, hw_init_completed=%u\n"
|
||||
, caller
|
||||
, padapter->bDriverStopped
|
||||
, padapter->bup
|
||||
, padapter->hw_init_completed);
|
||||
, padapter->bDriverStopped
|
||||
, padapter->bup
|
||||
, padapter->hw_init_completed);
|
||||
ret= _FALSE;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1849,9 +1849,9 @@ exit:
|
|||
|
||||
int rtw_pm_set_lps(struct adapter *padapter, u8 mode)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret = 0;
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
|
||||
if ( mode < PS_MODE_NUM )
|
||||
{
|
||||
if(pwrctrlpriv->power_mgnt !=mode)
|
||||
|
@ -1884,7 +1884,7 @@ int rtw_pm_set_ips(struct adapter *padapter, u8 mode)
|
|||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
DBG_871X("%s %s\n", __FUNCTION__, mode == IPS_NORMAL?"IPS_NORMAL":"IPS_LEVEL_2");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else if(mode ==IPS_NONE){
|
||||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
DBG_871X("%s %s\n", __FUNCTION__, "IPS_NONE");
|
||||
|
@ -1896,5 +1896,3 @@ int rtw_pm_set_ips(struct adapter *padapter, u8 mode)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
301
core/rtw_recv.c
301
core/rtw_recv.c
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -88,7 +88,7 @@ _func_enter_;
|
|||
rtw_os_recv_resource_init(precvpriv, padapter);
|
||||
|
||||
precvpriv->pallocated_frame_buf = rtw_zvmalloc(NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ);
|
||||
|
||||
|
||||
if(precvpriv->pallocated_frame_buf==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -148,7 +148,7 @@ void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv);
|
|||
void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv)
|
||||
{
|
||||
_rtw_spinlock_free(&precvpriv->lock);
|
||||
#ifdef CONFIG_RECV_THREAD_MODE
|
||||
#ifdef CONFIG_RECV_THREAD_MODE
|
||||
_rtw_free_sema(&precvpriv->recv_sema);
|
||||
_rtw_free_sema(&precvpriv->terminate_recvthread_sema);
|
||||
#endif
|
||||
|
@ -225,7 +225,7 @@ union recv_frame *rtw_alloc_recvframe (_queue *pfree_recv_queue)
|
|||
{
|
||||
_irqL irqL;
|
||||
union recv_frame *precvframe;
|
||||
|
||||
|
||||
_enter_critical_bh(&pfree_recv_queue->lock, &irqL);
|
||||
|
||||
precvframe = _rtw_alloc_recvframe(pfree_recv_queue);
|
||||
|
@ -257,8 +257,8 @@ _func_enter_;
|
|||
padapter = padapter->pbuddy_adapter;//get primary_padapter
|
||||
precvpriv = &padapter->recvpriv;
|
||||
pfree_recv_queue = &precvpriv->free_recv_queue;
|
||||
precvframe->u.hdr.adapter = padapter;
|
||||
}
|
||||
precvframe->u.hdr.adapter = padapter;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -324,7 +324,7 @@ sint rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue)
|
|||
{
|
||||
sint ret;
|
||||
_irqL irqL;
|
||||
|
||||
|
||||
//_spinlock(&pfree_recv_queue->lock);
|
||||
_enter_critical_bh(&queue->lock, &irqL);
|
||||
ret = _rtw_enqueue_recvframe(precvframe, queue);
|
||||
|
@ -354,7 +354,7 @@ using spinlock to protect
|
|||
|
||||
void rtw_free_recvframe_queue(_queue *pframequeue, _queue *pfree_recv_queue)
|
||||
{
|
||||
union recv_frame *precvframe;
|
||||
union recv_frame *precvframe;
|
||||
_list *plist, *phead;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -412,7 +412,7 @@ sint rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, _queue *queue)
|
|||
|
||||
sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue)
|
||||
{
|
||||
_irqL irqL;
|
||||
_irqL irqL;
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
_enter_critical_bh(&queue->lock, &irqL);
|
||||
#else
|
||||
|
@ -422,27 +422,27 @@ sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue)
|
|||
rtw_list_delete(&precvbuf->list);
|
||||
|
||||
rtw_list_insert_tail(&precvbuf->list, get_list_head(queue));
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
_exit_critical_bh(&queue->lock, &irqL);
|
||||
#else
|
||||
_exit_critical_ex(&queue->lock, &irqL);
|
||||
#endif/*#ifdef CONFIG_SDIO_HCI*/
|
||||
return _SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
|
||||
struct recv_buf *rtw_dequeue_recvbuf (_queue *queue)
|
||||
{
|
||||
_irqL irqL;
|
||||
struct recv_buf *precvbuf;
|
||||
_list *plist, *phead;
|
||||
_list *plist, *phead;
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
_enter_critical_bh(&queue->lock, &irqL);
|
||||
#else
|
||||
_enter_critical_ex(&queue->lock, &irqL);
|
||||
#endif/*#ifdef CONFIG_SDIO_HCI*/
|
||||
|
||||
|
||||
if(_rtw_queue_empty(queue) == _TRUE)
|
||||
{
|
||||
precvbuf = NULL;
|
||||
|
@ -456,7 +456,7 @@ struct recv_buf *rtw_dequeue_recvbuf (_queue *queue)
|
|||
precvbuf = LIST_CONTAINOR(plist, struct recv_buf, list);
|
||||
|
||||
rtw_list_delete(&precvbuf->list);
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
|
@ -481,7 +481,7 @@ sint recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe){
|
|||
//u8 *iv,rxdata_key_idx=0;
|
||||
struct sta_info *stainfo;
|
||||
struct rx_pkt_attrib *prxattrib=&precvframe->u.hdr.attrib;
|
||||
struct security_priv *psecuritypriv=&adapter->securitypriv;
|
||||
struct security_priv *psecuritypriv=&adapter->securitypriv;
|
||||
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
@ -504,11 +504,11 @@ _func_enter_;
|
|||
//iv = precvframe->u.hdr.rx_data+prxattrib->hdrlen;
|
||||
//rxdata_key_idx =( ((iv[3])>>6)&0x3) ;
|
||||
mickey=&psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0];
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n recvframe_chkmic: bcmc key \n"));
|
||||
//DBG_871X("\n recvframe_chkmic: bcmc key psecuritypriv->dot118021XGrpKeyid(%d),pmlmeinfo->key_index(%d) ,recv key_id(%d)\n",
|
||||
// psecuritypriv->dot118021XGrpKeyid,pmlmeinfo->key_index,rxdata_key_idx);
|
||||
|
||||
|
||||
if(psecuritypriv->binstallGrpkey==_FALSE)
|
||||
{
|
||||
res=_FAIL;
|
||||
|
@ -573,7 +573,7 @@ _func_enter_;
|
|||
// cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue
|
||||
if((IS_MCAST(prxattrib->ra)==_TRUE) && (prxattrib->key_index != pmlmeinfo->key_index ))
|
||||
brpt_micerror = _FALSE;
|
||||
|
||||
|
||||
if((prxattrib->bdecrypted ==_TRUE)&& (brpt_micerror == _TRUE))
|
||||
{
|
||||
rtw_handle_tkip_mic_err(adapter,(u8)IS_MCAST(prxattrib->ra));
|
||||
|
@ -642,13 +642,13 @@ _func_enter_;
|
|||
case _WEP104_:
|
||||
prxattrib->key_index = psecuritypriv->dot11PrivacyKeyIndex;
|
||||
break;
|
||||
case _TKIP_:
|
||||
case _AES_:
|
||||
case _TKIP_:
|
||||
case _AES_:
|
||||
default:
|
||||
prxattrib->key_index = psecuritypriv->dot118021XGrpKeyid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((prxattrib->encrypt>0) && ((prxattrib->bdecrypted==0) ||(psecuritypriv->sw_decrypt==_TRUE)))
|
||||
|
@ -656,7 +656,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(!IS_MCAST(prxattrib->ra))//bc/mc packets use sw decryption for concurrent mode
|
||||
#endif
|
||||
#endif
|
||||
psecuritypriv->hw_decrypted=_FALSE;
|
||||
|
||||
#ifdef DBG_RX_DECRYPTOR
|
||||
|
@ -718,12 +718,12 @@ _func_enter_;
|
|||
, prxattrib->bdecrypted ,prxattrib->encrypt, psecuritypriv->hw_decrypted);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if(res == _FAIL)
|
||||
{
|
||||
rtw_free_recvframe(return_packet,&padapter->recvpriv.free_recv_queue);
|
||||
rtw_free_recvframe(return_packet,&padapter->recvpriv.free_recv_queue);
|
||||
return_packet = NULL;
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
prxattrib->bdecrypted = _TRUE;
|
||||
|
@ -746,7 +746,7 @@ union recv_frame * portctrl(struct adapter *adapter,union recv_frame * precv_fra
|
|||
struct sta_priv *pstapriv ;
|
||||
union recv_frame *prtnframe;
|
||||
u16 ether_type=0;
|
||||
u16 eapol_type = 0x888e;//for Funia BD's WPA issue
|
||||
u16 eapol_type = 0x888e;//for Funia BD's WPA issue
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -911,13 +911,13 @@ void process_pwrbit_data(struct adapter *padapter, union recv_frame *precv_frame
|
|||
void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame);
|
||||
void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
||||
{
|
||||
#ifdef CONFIG_AP_MODE
|
||||
#ifdef CONFIG_AP_MODE
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta=NULL;
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, pattrib->src);
|
||||
|
||||
|
||||
if(!psta) return;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
|
@ -930,15 +930,15 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
if(!(psta->qos_info&0xf))
|
||||
return;
|
||||
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
}
|
||||
#endif //CONFIG_TDLS
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
if(psta->state&WIFI_SLEEP_STATE)
|
||||
{
|
||||
u8 wmmps_ac=0;
|
||||
|
||||
u8 wmmps_ac=0;
|
||||
|
||||
switch(pattrib->priority)
|
||||
{
|
||||
case 1:
|
||||
|
@ -957,7 +957,7 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
case 3:
|
||||
default:
|
||||
wmmps_ac = psta->uapsd_be&BIT(1);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if(wmmps_ac)
|
||||
|
@ -973,11 +973,11 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
issue_qos_nulldata(padapter, psta->hwaddr, (u16)pattrib->priority, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
@ -994,11 +994,11 @@ sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
struct tdls_info *ptdlsinfo = &(adapter->tdlsinfo);
|
||||
|
||||
//point to action field
|
||||
paction+=pattrib->hdrlen
|
||||
+ pattrib->iv_len
|
||||
+ SNAP_SIZE
|
||||
+ ETH_TYPE_LEN
|
||||
+ PAYLOAD_TYPE_LEN
|
||||
paction+=pattrib->hdrlen
|
||||
+ pattrib->iv_len
|
||||
+ SNAP_SIZE
|
||||
+ ETH_TYPE_LEN
|
||||
+ PAYLOAD_TYPE_LEN
|
||||
+ category_field;
|
||||
|
||||
if(ptdlsinfo->enable == 0)
|
||||
|
@ -1008,14 +1008,14 @@ sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
ret = _FAIL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
switch(*paction){
|
||||
case TDLS_SETUP_REQUEST:
|
||||
DBG_871X("recv tdls setup request frame\n");
|
||||
ret=On_TDLS_Setup_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_RESPONSE:
|
||||
DBG_871X("recv tdls setup response frame\n");
|
||||
DBG_871X("recv tdls setup response frame\n");
|
||||
ret=On_TDLS_Setup_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_CONFIRM:
|
||||
|
@ -1042,7 +1042,7 @@ sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
DBG_871X("recv tdls channel switch response frame\n");
|
||||
ret=On_TDLS_Ch_Switch_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
#ifdef CONFIG_WFD
|
||||
#ifdef CONFIG_WFD
|
||||
case 0x50: //First byte of WFA OUI
|
||||
if( _rtw_memcmp(WFA_OUI, (paction), 3) )
|
||||
{
|
||||
|
@ -1070,7 +1070,7 @@ sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
|
||||
exit:
|
||||
return ret;
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1121,14 +1121,14 @@ sint sta2sta_data_frame(
|
|||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
sint ret = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
u8 *mybssid = get_bssid(pmlmepriv);
|
||||
u8 *myhwaddr = myid(&adapter->eeprompriv);
|
||||
u8 * sta_addr = NULL;
|
||||
sint bmcast = IS_MCAST(pattrib->dst);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
struct sta_info *ptdls_sta=NULL;
|
||||
u8 *psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
|
||||
|
@ -1241,12 +1241,12 @@ _func_enter_;
|
|||
ret= OnTDLS(adapter, precv_frame);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
sta_addr = pattrib->src;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_TDLS
|
||||
{
|
||||
|
@ -1335,7 +1335,7 @@ sint ap2sta_data_frame(
|
|||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
sint ret = _SUCCESS;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
u8 *mybssid = get_bssid(pmlmepriv);
|
||||
u8 *myhwaddr = myid(&adapter->eeprompriv);
|
||||
|
@ -1344,7 +1344,7 @@ sint ap2sta_data_frame(
|
|||
_func_enter_;
|
||||
|
||||
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)
|
||||
&& (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE
|
||||
&& (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE
|
||||
|| check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE )
|
||||
)
|
||||
{
|
||||
|
@ -1355,7 +1355,7 @@ _func_enter_;
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s SA="MAC_FMT", myhwaddr="MAC_FMT"\n",
|
||||
__FUNCTION__, MAC_ARG(pattrib->src), MAC_ARG(myhwaddr));
|
||||
#endif
|
||||
#endif
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1461,11 +1461,11 @@ _func_enter_;
|
|||
if (*psta == NULL)
|
||||
{
|
||||
DBG_871X("issue_deauth to the ap=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid));
|
||||
|
||||
|
||||
issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ret = _FAIL;
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s fw_state:0x%x\n", __FUNCTION__, get_fwstate(pmlmepriv));
|
||||
|
@ -1491,9 +1491,9 @@ sint sta2ap_data_frame(
|
|||
{
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
unsigned char *mybssid = get_bssid(pmlmepriv);
|
||||
unsigned char *mybssid = get_bssid(pmlmepriv);
|
||||
sint ret=_SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -1560,11 +1560,11 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
u8 *pframe = precv_frame->u.hdr.rx_data;
|
||||
//uint len = precv_frame->u.hdr.len;
|
||||
|
||||
|
||||
//DBG_871X("+validate_recv_ctrl_frame\n");
|
||||
|
||||
if (GetFrameType(pframe) != WIFI_CTRL_TYPE)
|
||||
{
|
||||
{
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
@ -1578,12 +1578,12 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
if(GetFrameSubType(pframe) == WIFI_PSPOLL)
|
||||
{
|
||||
u16 aid;
|
||||
u8 wmmps_ac=0;
|
||||
u8 wmmps_ac=0;
|
||||
struct sta_info *psta=NULL;
|
||||
|
||||
|
||||
aid = GetAid(pframe);
|
||||
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
|
||||
|
||||
|
||||
if((psta==NULL) || (psta->aid!=aid))
|
||||
{
|
||||
return _FAIL;
|
||||
|
@ -1610,26 +1610,26 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
case 3:
|
||||
default:
|
||||
wmmps_ac = psta->uapsd_be&BIT(0);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if(wmmps_ac)
|
||||
return _FAIL;
|
||||
|
||||
if(psta->state & WIFI_STA_ALIVE_CHK_STATE)
|
||||
{
|
||||
{
|
||||
DBG_871X("%s alive check-rx ps-poll\n", __func__);
|
||||
psta->expire_to = pstapriv->expire_to;
|
||||
psta->state ^= WIFI_STA_ALIVE_CHK_STATE;
|
||||
}
|
||||
}
|
||||
|
||||
if((psta->state&WIFI_SLEEP_STATE) && (pstapriv->sta_dz_bitmap&BIT(psta->aid)))
|
||||
{
|
||||
_irqL irqL;
|
||||
_irqL irqL;
|
||||
_list *xmitframe_plist, *xmitframe_phead;
|
||||
struct xmit_frame *pxmitframe=NULL;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
|
||||
//_enter_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
|
@ -1637,7 +1637,7 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
xmitframe_plist = get_next(xmitframe_phead);
|
||||
|
||||
if ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE)
|
||||
{
|
||||
{
|
||||
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
|
||||
|
||||
xmitframe_plist = get_next(xmitframe_plist);
|
||||
|
@ -1656,12 +1656,12 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
//DBG_871X("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap);
|
||||
|
||||
#if 0
|
||||
_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
if(rtw_hal_xmit(padapter, pxmitframe) == _TRUE)
|
||||
{
|
||||
{
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
}
|
||||
_enter_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_enter_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
#endif
|
||||
rtw_hal_xmitframe_enqueue(padapter, pxmitframe);
|
||||
|
||||
|
@ -1672,19 +1672,19 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
//DBG_871X("after handling ps-poll, tim=%x\n", pstapriv->tim_bitmap);
|
||||
|
||||
//upate BCN for TIM IE
|
||||
//update_BCNTIM(padapter);
|
||||
//update_BCNTIM(padapter);
|
||||
update_beacon(padapter, _TIM_IE_, NULL, _FALSE);
|
||||
}
|
||||
|
||||
|
||||
//_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
|
||||
//DBG_871X("no buffered packets to xmit\n");
|
||||
if(pstapriv->tim_bitmap&BIT(psta->aid))
|
||||
{
|
||||
|
@ -1698,22 +1698,22 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
else
|
||||
{
|
||||
DBG_871X("error!psta->sleepq_len=%d\n", psta->sleepq_len);
|
||||
psta->sleepq_len=0;
|
||||
psta->sleepq_len=0;
|
||||
}
|
||||
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
||||
//upate BCN for TIM IE
|
||||
//update_BCNTIM(padapter);
|
||||
update_beacon(padapter, _TIM_IE_, NULL, _FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
return _FAIL;
|
||||
|
@ -1764,7 +1764,7 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data))
|
||||
|| is_multicast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)))
|
||||
psta->sta_stats.rx_probersp_bm_pkts++;
|
||||
else
|
||||
else
|
||||
psta->sta_stats.rx_probersp_uo_pkts++;
|
||||
}
|
||||
}
|
||||
|
@ -1776,7 +1776,7 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
struct rx_pkt_attrib * pattrib=&precv_frame->u.hdr.attrib;
|
||||
struct recv_stat* prxstat=( struct recv_stat * ) precv_frame->u.hdr.rx_head ;
|
||||
u8 * pda,*psa,*pbssid,*ptr;
|
||||
ptr=precv_frame->u.hdr.rx_data;
|
||||
ptr=precv_frame->u.hdr.rx_data;
|
||||
pda = get_da(ptr);
|
||||
psa = get_sa(ptr);
|
||||
pbssid = get_hdr_bssid(ptr);
|
||||
|
@ -1813,7 +1813,7 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
pattrib->priority=0;
|
||||
pattrib->hdrlen = pattrib->to_fr_ds==3 ? 30 : 24;
|
||||
|
||||
|
@ -1834,8 +1834,8 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f
|
|||
struct sta_info *psta = NULL;
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
sint ret = _SUCCESS;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
|
@ -1912,11 +1912,11 @@ _func_enter_;
|
|||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
//psta->rssi = prxcmd->rssi;
|
||||
//psta->signal_quality= prxcmd->sq;
|
||||
precv_frame->u.hdr.psta = psta;
|
||||
|
||||
|
||||
|
||||
pattrib->amsdu=0;
|
||||
pattrib->ack_policy = 0;
|
||||
|
@ -2005,22 +2005,22 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec
|
|||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
u8 type;
|
||||
u8 subtype;
|
||||
|
||||
|
||||
type = GetFrameType(ptr);
|
||||
subtype = GetFrameSubType(ptr); //bit(7)~bit(2)
|
||||
|
||||
|
||||
//only support station mode
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED)
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED)
|
||||
&& adapter->securitypriv.binstallBIPkey == _TRUE)
|
||||
{
|
||||
//unicast management frame decrypt
|
||||
if(pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) &&
|
||||
if(pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) &&
|
||||
(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_ACTION))
|
||||
{
|
||||
u8 *ppp, *mgmt_DATA;
|
||||
u32 data_len=0;
|
||||
ppp = GetAddr2Ptr(ptr);
|
||||
|
||||
|
||||
pattrib->bdecrypted = 0;
|
||||
pattrib->encrypt = _AES_;
|
||||
pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
|
@ -2044,7 +2044,7 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec
|
|||
printk(" %02x ", ptr[pp]);
|
||||
printk("\n");
|
||||
}*/
|
||||
|
||||
|
||||
precv_frame = decryptor(adapter, precv_frame);
|
||||
//save actual management data frame body
|
||||
_rtw_memcpy(mgmt_DATA, ptr+pattrib->hdrlen+pattrib->iv_len, data_len);
|
||||
|
@ -2111,10 +2111,10 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec
|
|||
}
|
||||
}
|
||||
return _SUCCESS;
|
||||
|
||||
|
||||
validate_80211w_fail:
|
||||
return _FAIL;
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_IEEE80211W
|
||||
|
||||
|
@ -2210,7 +2210,7 @@ _func_enter_;
|
|||
if(bDumpRxPkt ==1){//dump all rx packets
|
||||
int i;
|
||||
DBG_871X("############################# \n");
|
||||
|
||||
|
||||
for(i=0; i<64;i=i+8)
|
||||
DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i),
|
||||
*(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7));
|
||||
|
@ -2231,7 +2231,7 @@ _func_enter_;
|
|||
if(type== WIFI_DATA_TYPE){
|
||||
int i;
|
||||
DBG_871X("############################# \n");
|
||||
|
||||
|
||||
for(i=0; i<64;i=i+8)
|
||||
DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i),
|
||||
*(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7));
|
||||
|
@ -2250,7 +2250,7 @@ _func_enter_;
|
|||
break;
|
||||
}
|
||||
#endif //CONFIG_IEEE80211W
|
||||
|
||||
|
||||
retval = validate_recv_mgnt_frame(adapter, precv_frame);
|
||||
if (retval == _FAIL)
|
||||
{
|
||||
|
@ -2272,7 +2272,7 @@ _func_enter_;
|
|||
external_len = 2;
|
||||
else
|
||||
external_len= 0;
|
||||
|
||||
|
||||
wai_pkt = rtw_wapi_is_wai_packet(adapter,ptr);
|
||||
|
||||
phdr->bIsWaiPacket = wai_pkt;
|
||||
|
@ -2337,7 +2337,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe)
|
|||
u8 bsnaphdr;
|
||||
u8 *psnap_type;
|
||||
struct ieee80211_snap_hdr *psnap;
|
||||
|
||||
|
||||
sint ret=_SUCCESS;
|
||||
struct adapter *adapter =precvframe->u.hdr.adapter;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
@ -2348,7 +2348,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe)
|
|||
_func_enter_;
|
||||
|
||||
if(pattrib->encrypt){
|
||||
recvframe_pull_tail(precvframe, pattrib->icv_len);
|
||||
recvframe_pull_tail(precvframe, pattrib->icv_len);
|
||||
}
|
||||
|
||||
psnap=(struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len);
|
||||
|
@ -2356,7 +2356,7 @@ _func_enter_;
|
|||
/* convert hdr + possible LLC headers into Ethernet header */
|
||||
//eth_type = (psnap_type[0] << 8) | psnap_type[1];
|
||||
if((_rtw_memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) &&
|
||||
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == _FALSE) &&
|
||||
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == _FALSE) &&
|
||||
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2)==_FALSE) )||
|
||||
//eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) ||
|
||||
_rtw_memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)){
|
||||
|
@ -2377,9 +2377,9 @@ _func_enter_;
|
|||
eth_type= ntohs((unsigned short )eth_type); //pattrib->ether_type
|
||||
pattrib->eth_type = eth_type;
|
||||
|
||||
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE))
|
||||
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE))
|
||||
{
|
||||
ptr += rmv_len ;
|
||||
ptr += rmv_len ;
|
||||
*ptr = 0x87;
|
||||
*(ptr+1) = 0x12;
|
||||
|
||||
|
@ -2401,7 +2401,7 @@ _func_enter_;
|
|||
_rtw_memcpy(ptr+12, &len, 2);
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
@ -2431,7 +2431,7 @@ _func_enter_;
|
|||
if (psnap->dsap==0xaa && psnap->ssap==0xaa && psnap->ctrl==0x03)
|
||||
{
|
||||
if (_rtw_memcmp(psnap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN))
|
||||
bsnaphdr=_TRUE;//wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042;
|
||||
bsnaphdr=_TRUE;//wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042;
|
||||
else if (_rtw_memcmp(psnap->oui, SNAP_HDR_APPLETALK_DDP, WLAN_IEEE_OUI_LEN) &&
|
||||
_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_DDP, 2) )
|
||||
bsnaphdr=_TRUE; //wlan_pkt_format = WLAN_PKT_FORMAT_APPLETALK;
|
||||
|
@ -2819,7 +2819,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe);
|
|||
int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
int a_len, padding_len;
|
||||
u16 eth_type, nSubframe_Length;
|
||||
u16 eth_type, nSubframe_Length;
|
||||
u8 nr_subframes, i;
|
||||
unsigned char *pdata;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
|
@ -2833,7 +2833,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
pattrib = &prframe->u.hdr.attrib;
|
||||
|
||||
recvframe_pull(prframe, prframe->u.hdr.attrib.hdrlen);
|
||||
|
||||
|
||||
if(prframe->u.hdr.attrib.iv_len >0)
|
||||
{
|
||||
recvframe_pull(prframe, prframe->u.hdr.attrib.iv_len);
|
||||
|
@ -2844,7 +2844,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
pdata = prframe->u.hdr.rx_data;
|
||||
|
||||
while(a_len > ETH_HLEN) {
|
||||
|
||||
|
||||
/* Offset 12 denote 2 mac address */
|
||||
#ifdef ENDIAN_FREE
|
||||
//nSubframe_Length = ntohs(*((u16*)(pdata + 12)));
|
||||
|
@ -2921,7 +2921,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
#ifdef ENDIAN_FREE
|
||||
//eth_type = ntohs(*(u16*)&sub_skb->data[6]);
|
||||
eth_type = RTW_GET_BE16(&sub_skb->data[6]);
|
||||
#else // ENDIAN_FREE
|
||||
#else // ENDIAN_FREE
|
||||
eth_type = (sub_skb->data[6] << 8) | sub_skb->data[7];
|
||||
#endif // ENDIAN_FREE
|
||||
if (sub_skb->len >= 8 &&
|
||||
|
@ -2966,14 +2966,14 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
//priv->ext_stats.rx_data_drops++;
|
||||
//DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n");
|
||||
//return FAIL;
|
||||
|
||||
|
||||
#if 1
|
||||
// bypass this frame to upper layer!!
|
||||
#else
|
||||
rtw_skb_free(sub_skb);
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_BR_EXT
|
||||
|
||||
|
@ -2998,7 +2998,7 @@ exit:
|
|||
|
||||
prframe->u.hdr.len=0;
|
||||
rtw_free_recvframe(prframe, pfree_recv_queue);//free this recv_frame
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3028,7 +3028,7 @@ int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
|
|||
//DbgPrint("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num);
|
||||
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("%s IndicateSeq: %d > NewSeq: %d\n", __FUNCTION__,
|
||||
DBG_871X("%s IndicateSeq: %d > NewSeq: %d\n", __FUNCTION__,
|
||||
preorder_ctrl->indicate_seq, seq_num);
|
||||
#endif
|
||||
|
||||
|
@ -3151,7 +3151,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
//_enter_critical_ex(&ppending_recvframe_queue->lock, &irql);
|
||||
//_rtw_spinlock_ex(&ppending_recvframe_queue->lock);
|
||||
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
#if 0
|
||||
|
@ -3169,10 +3169,10 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
//_rtw_spinunlock_ex(&ppending_recvframe_queue->lock);
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
|
@ -3183,7 +3183,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
// Check if there is any packet need indicate.
|
||||
while(!rtw_is_list_empty(phead))
|
||||
{
|
||||
|
||||
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
|
||||
|
@ -3245,9 +3245,9 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
if ((padapter->bDriverStopped == _FALSE) &&
|
||||
(padapter->bSurpriseRemoved == _FALSE))
|
||||
{
|
||||
|
||||
|
||||
rtw_recv_indicatepkt(padapter, prframe);//indicate this recv_frame
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if(pattrib->amsdu==1)
|
||||
|
@ -3329,34 +3329,34 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s pattrib->qos !=1\n", __FUNCTION__);
|
||||
#endif
|
||||
|
||||
|
||||
return _FAIL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (preorder_ctrl->enable == _FALSE)
|
||||
{
|
||||
//indicate this recv_frame
|
||||
//indicate this recv_frame
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
#endif
|
||||
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
|
||||
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
|
||||
preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1)%4096;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
#endif
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_RECV_REORDERING_CTRL
|
||||
//indicate this recv_frame
|
||||
|
@ -3415,11 +3415,11 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s check_indicate_seq fail\n", __FUNCTION__);
|
||||
#endif
|
||||
#if 0
|
||||
#if 0
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
|
||||
|
||||
|
||||
goto _success_exit;
|
||||
#else
|
||||
goto _err_exit;
|
||||
|
@ -3494,7 +3494,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext)
|
|||
|
||||
if(recv_indicatepkts_in_order(padapter, preorder_ctrl, _TRUE)==_TRUE)
|
||||
{
|
||||
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
|
||||
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
|
||||
|
@ -3518,7 +3518,7 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram
|
|||
|
||||
#ifdef CONFIG_TDLS
|
||||
if( (phtpriv->ht_option==_TRUE) ||
|
||||
((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
|
||||
((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
|
||||
(psta->htpriv.ht_option==_TRUE) &&
|
||||
(psta->htpriv.ampdu_enable==_TRUE))) //B/G/N Mode
|
||||
#else
|
||||
|
@ -3532,7 +3532,7 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s recv_indicatepkt_reorder error!\n", __FUNCTION__);
|
||||
#endif
|
||||
|
||||
|
||||
if ((padapter->bDriverStopped == _FALSE) &&
|
||||
(padapter->bSurpriseRemoved == _FALSE))
|
||||
{
|
||||
|
@ -3605,7 +3605,7 @@ int recv_func_posthandle(struct adapter *padapter, union recv_frame *prframe)
|
|||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
u8 *psnap_type, *pcategory;
|
||||
|
@ -3661,7 +3661,7 @@ int recv_func_posthandle(struct adapter *padapter, union recv_frame *prframe)
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s recvframe_chk_defrag: drop pkt\n", __FUNCTION__);
|
||||
#endif
|
||||
goto _recv_data_drop;
|
||||
goto _recv_data_drop;
|
||||
}
|
||||
|
||||
prframe=portctrl(padapter, prframe);
|
||||
|
@ -3717,7 +3717,7 @@ int recv_func_posthandle(struct adapter *padapter, union recv_frame *prframe)
|
|||
//indicate this recv_frame
|
||||
ret = rtw_recv_indicatepkt(padapter, prframe);
|
||||
if (ret != _SUCCESS)
|
||||
{
|
||||
{
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s rtw_recv_indicatepkt fail!\n", __FUNCTION__);
|
||||
#endif
|
||||
|
@ -3796,7 +3796,7 @@ int recv_func(struct adapter *padapter, union recv_frame *rframe)
|
|||
ret = recv_func_prehandle(padapter, rframe);
|
||||
|
||||
if(ret == _SUCCESS) {
|
||||
|
||||
|
||||
/* check if need to enqueue into uc_swdec_pending_queue*/
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
|
||||
!IS_MCAST(prxattrib->ra) && prxattrib->encrypt>0 &&
|
||||
|
@ -3864,7 +3864,7 @@ _func_exit_;
|
|||
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
||||
struct adapter *adapter = (struct adapter *)FunctionContext;
|
||||
struct recv_priv *recvpriv = &adapter->recvpriv;
|
||||
|
||||
|
||||
u32 tmp_s, tmp_q;
|
||||
u8 avg_signal_strength = 0;
|
||||
u8 avg_signal_qual = 0;
|
||||
|
@ -3884,7 +3884,7 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
|||
// after avg_vals are accquired, we can re-stat the signal values
|
||||
recvpriv->signal_strength_data.update_req = 1;
|
||||
}
|
||||
|
||||
|
||||
if(recvpriv->signal_qual_data.update_req == 0) {// update_req is clear, means we got rx
|
||||
avg_signal_qual = recvpriv->signal_qual_data.avg_val;
|
||||
num_signal_qual = recvpriv->signal_qual_data.total_num;
|
||||
|
@ -3905,7 +3905,7 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
|||
|
||||
if(check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE
|
||||
|| check_fwstate(&adapter->mlmepriv, _FW_LINKED) == _FALSE
|
||||
) {
|
||||
) {
|
||||
goto set_timer;
|
||||
}
|
||||
|
||||
|
@ -3952,9 +3952,6 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
|||
|
||||
set_timer:
|
||||
rtw_set_signal_stat_timer(recvpriv);
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -92,4 +92,3 @@ u32 rtw_freq2ch(u32 freq)
|
|||
|
||||
return ch;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,356 +1,355 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include<rtw_sreset.h>
|
||||
|
||||
void sreset_init_value(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
_rtw_mutex_init(&psrtpriv->silentreset_mutex);
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
void sreset_reset_value(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
//psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 sreset_get_wifi_status(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
u8 status = WIFI_STATUS_SUCCESS;
|
||||
u32 val32 = 0;
|
||||
_irqL irqL;
|
||||
if(psrtpriv->silent_reset_inprogress == _TRUE)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
val32 =rtw_read32(padapter,REG_TXDMA_STATUS);
|
||||
if(val32==0xeaeaeaea){
|
||||
psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
|
||||
}
|
||||
else if(val32!=0){
|
||||
DBG_8192C("txdmastatu(%x)\n",val32);
|
||||
psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
|
||||
}
|
||||
|
||||
if(WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
|
||||
{
|
||||
DBG_8192C("==>%s error_status(0x%x) \n",__FUNCTION__,psrtpriv->Wifi_Error_Status);
|
||||
status = (psrtpriv->Wifi_Error_Status &( ~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL)));
|
||||
}
|
||||
DBG_8192C("==> %s wifi_status(0x%x)\n",__FUNCTION__,status);
|
||||
|
||||
//status restore
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
return status;
|
||||
#else
|
||||
return WIFI_STATUS_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_wifi_error_status(struct adapter *padapter, u32 status)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = status;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_trigger_point(struct adapter *padapter, s32 tgp)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.dbg_trigger_point = tgp;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool sreset_inprogress(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_RESET)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
return pHalData->srestpriv.silent_reset_inprogress;
|
||||
#else
|
||||
return _FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_restore_security_station(struct adapter *padapter)
|
||||
{
|
||||
u8 EntryId = 0;
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct sta_priv * pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct security_priv* psecuritypriv=&(padapter->securitypriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
|
||||
{
|
||||
u8 val8;
|
||||
|
||||
if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) {
|
||||
val8 = 0xcc;
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
} else if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) {
|
||||
//Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey.
|
||||
val8 = 0x4c;
|
||||
#endif
|
||||
} else {
|
||||
val8 = 0xcf;
|
||||
}
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( ( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_ ) ||
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_ ))
|
||||
{
|
||||
|
||||
for(EntryId=0; EntryId<4; EntryId++)
|
||||
{
|
||||
if(EntryId == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 1,_FALSE);
|
||||
else
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 0,_FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
|
||||
{
|
||||
psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv));
|
||||
if (psta == NULL) {
|
||||
//DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail \n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//pairwise key
|
||||
rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE,_FALSE);
|
||||
//group key
|
||||
rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_restore_network_station(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
#if 0
|
||||
{
|
||||
//=======================================================
|
||||
// reset related register of Beacon control
|
||||
|
||||
//set MSR to nolink
|
||||
Set_MSR(padapter, _HW_STATE_NOLINK_);
|
||||
// reject all data frame
|
||||
rtw_write16(padapter, REG_RXFLTMAP2,0x00);
|
||||
//reset TSF
|
||||
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
|
||||
|
||||
// disable update TSF
|
||||
SetBcnCtrlReg(padapter, BIT(4), 0);
|
||||
|
||||
//=======================================================
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure,_FALSE);
|
||||
|
||||
{
|
||||
u8 threshold;
|
||||
#ifdef CONFIG_USB_HCI
|
||||
// TH=1 => means that invalidate usb rx aggregation
|
||||
// TH=0 => means that validate usb rx aggregation, use init value.
|
||||
if(mlmepriv->htpriv.ht_option) {
|
||||
if(padapter->registrypriv.wifi_spec==1)
|
||||
threshold = 1;
|
||||
else
|
||||
threshold = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
} else {
|
||||
threshold = 1;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
|
||||
//disable dynamic functions, such as high power, DIG
|
||||
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
|
||||
|
||||
{
|
||||
u8 join_type = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
|
||||
}
|
||||
|
||||
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
|
||||
|
||||
mlmeext_joinbss_event_callback(padapter, 1);
|
||||
//restore Sequence No.
|
||||
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
|
||||
|
||||
sreset_restore_security_station(padapter);
|
||||
}
|
||||
|
||||
|
||||
void sreset_restore_network_status(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
sreset_restore_network_station(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_AP_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
rtw_ap_restore_network(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_ADHOC_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_ADHOC_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
} else {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_stop_adapter(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (!rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_stop_queue(padapter->pnetdev);
|
||||
|
||||
rtw_cancel_all_timer(padapter);
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
tasklet_kill(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_scan_abort(padapter);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
{
|
||||
rtw_set_roaming(padapter, 0);
|
||||
_rtw_join_timeout_handler(padapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void sreset_start_adapter(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
sreset_restore_network_status(padapter);
|
||||
}
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
|
||||
if (rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_wake_queue(padapter->pnetdev);
|
||||
|
||||
}
|
||||
|
||||
void sreset_reset(struct adapter *padapter)
|
||||
{
|
||||
#ifdef DBG_CONFIG_ERROR_RESET
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
u32 start = rtw_get_current_time();
|
||||
|
||||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _TRUE;
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
sreset_stop_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_stop_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
_ips_enter(padapter);
|
||||
_ips_leave(padapter);
|
||||
#endif
|
||||
|
||||
sreset_start_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_start_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
DBG_871X("%s done in %d ms\n", __FUNCTION__, rtw_get_passing_time_ms(start));
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include<rtw_sreset.h>
|
||||
|
||||
void sreset_init_value(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
_rtw_mutex_init(&psrtpriv->silentreset_mutex);
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
void sreset_reset_value(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
//psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 sreset_get_wifi_status(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
u8 status = WIFI_STATUS_SUCCESS;
|
||||
u32 val32 = 0;
|
||||
_irqL irqL;
|
||||
if(psrtpriv->silent_reset_inprogress == _TRUE)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
val32 =rtw_read32(padapter,REG_TXDMA_STATUS);
|
||||
if(val32==0xeaeaeaea){
|
||||
psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
|
||||
}
|
||||
else if(val32!=0){
|
||||
DBG_8192C("txdmastatu(%x)\n",val32);
|
||||
psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
|
||||
}
|
||||
|
||||
if(WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
|
||||
{
|
||||
DBG_8192C("==>%s error_status(0x%x) \n",__FUNCTION__,psrtpriv->Wifi_Error_Status);
|
||||
status = (psrtpriv->Wifi_Error_Status &( ~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL)));
|
||||
}
|
||||
DBG_8192C("==> %s wifi_status(0x%x)\n",__FUNCTION__,status);
|
||||
|
||||
//status restore
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
return status;
|
||||
#else
|
||||
return WIFI_STATUS_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_wifi_error_status(struct adapter *padapter, u32 status)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = status;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_trigger_point(struct adapter *padapter, s32 tgp)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.dbg_trigger_point = tgp;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool sreset_inprogress(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_RESET)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
return pHalData->srestpriv.silent_reset_inprogress;
|
||||
#else
|
||||
return _FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_restore_security_station(struct adapter *padapter)
|
||||
{
|
||||
u8 EntryId = 0;
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct sta_priv * pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct security_priv* psecuritypriv=&(padapter->securitypriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
|
||||
{
|
||||
u8 val8;
|
||||
|
||||
if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) {
|
||||
val8 = 0xcc;
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
} else if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) {
|
||||
//Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey.
|
||||
val8 = 0x4c;
|
||||
#endif
|
||||
} else {
|
||||
val8 = 0xcf;
|
||||
}
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( ( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_ ) ||
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_ ))
|
||||
{
|
||||
|
||||
for(EntryId=0; EntryId<4; EntryId++)
|
||||
{
|
||||
if(EntryId == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 1,_FALSE);
|
||||
else
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 0,_FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
|
||||
{
|
||||
psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv));
|
||||
if (psta == NULL) {
|
||||
//DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail \n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//pairwise key
|
||||
rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE,_FALSE);
|
||||
//group key
|
||||
rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_restore_network_station(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
#if 0
|
||||
{
|
||||
//=======================================================
|
||||
// reset related register of Beacon control
|
||||
|
||||
//set MSR to nolink
|
||||
Set_MSR(padapter, _HW_STATE_NOLINK_);
|
||||
// reject all data frame
|
||||
rtw_write16(padapter, REG_RXFLTMAP2,0x00);
|
||||
//reset TSF
|
||||
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
|
||||
|
||||
// disable update TSF
|
||||
SetBcnCtrlReg(padapter, BIT(4), 0);
|
||||
|
||||
//=======================================================
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure,_FALSE);
|
||||
|
||||
{
|
||||
u8 threshold;
|
||||
#ifdef CONFIG_USB_HCI
|
||||
// TH=1 => means that invalidate usb rx aggregation
|
||||
// TH=0 => means that validate usb rx aggregation, use init value.
|
||||
if(mlmepriv->htpriv.ht_option) {
|
||||
if(padapter->registrypriv.wifi_spec==1)
|
||||
threshold = 1;
|
||||
else
|
||||
threshold = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
} else {
|
||||
threshold = 1;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
|
||||
//disable dynamic functions, such as high power, DIG
|
||||
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
|
||||
|
||||
{
|
||||
u8 join_type = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
|
||||
}
|
||||
|
||||
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
|
||||
|
||||
mlmeext_joinbss_event_callback(padapter, 1);
|
||||
//restore Sequence No.
|
||||
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
|
||||
|
||||
sreset_restore_security_station(padapter);
|
||||
}
|
||||
|
||||
|
||||
void sreset_restore_network_status(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
sreset_restore_network_station(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_AP_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
rtw_ap_restore_network(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_ADHOC_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_ADHOC_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
} else {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_stop_adapter(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (!rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_stop_queue(padapter->pnetdev);
|
||||
|
||||
rtw_cancel_all_timer(padapter);
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
tasklet_kill(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_scan_abort(padapter);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
{
|
||||
rtw_set_roaming(padapter, 0);
|
||||
_rtw_join_timeout_handler(padapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void sreset_start_adapter(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
sreset_restore_network_status(padapter);
|
||||
}
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
|
||||
if (rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_wake_queue(padapter->pnetdev);
|
||||
|
||||
}
|
||||
|
||||
void sreset_reset(struct adapter *padapter)
|
||||
{
|
||||
#ifdef DBG_CONFIG_ERROR_RESET
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
u32 start = rtw_get_current_time();
|
||||
|
||||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _TRUE;
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
sreset_stop_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_stop_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
_ips_enter(padapter);
|
||||
_ips_leave(padapter);
|
||||
#endif
|
||||
|
||||
sreset_start_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_start_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
DBG_871X("%s done in %d ms\n", __FUNCTION__, rtw_get_passing_time_ms(start));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
@ -42,24 +42,24 @@ _func_enter_;
|
|||
_rtw_init_listhead(&psta->hash_list);
|
||||
//_rtw_init_listhead(&psta->asoc_list);
|
||||
//_rtw_init_listhead(&psta->sleep_list);
|
||||
//_rtw_init_listhead(&psta->wakeup_list);
|
||||
//_rtw_init_listhead(&psta->wakeup_list);
|
||||
|
||||
_rtw_init_queue(&psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
||||
_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
|
||||
_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
_rtw_init_listhead(&psta->asoc_list);
|
||||
|
||||
_rtw_init_listhead(&psta->auth_list);
|
||||
|
||||
|
||||
psta->expire_to = 0;
|
||||
|
||||
|
||||
psta->flags = 0;
|
||||
|
||||
|
||||
psta->capability = 0;
|
||||
|
||||
psta->bpairwise_key_installed = _FALSE;
|
||||
|
@ -72,28 +72,28 @@ _func_enter_;
|
|||
psta->no_ht_gf_set = 0;
|
||||
psta->no_ht_set = 0;
|
||||
psta->ht_20mhz_set = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
psta->under_exist_checking = 0;
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
|
||||
|
||||
psta->keep_alive_trycnt = 0;
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
#endif // CONFIG_AP_MODE
|
||||
|
||||
#ifdef DBG_TRX_STA_PKTS
|
||||
#ifdef DBG_TRX_STA_PKTS
|
||||
psta->tx_be_cnt = 0;
|
||||
psta->tx_bk_cnt = 0;
|
||||
psta->tx_vi_cnt = 0;
|
||||
psta->tx_vo_cnt = 0;
|
||||
|
||||
|
||||
psta->rx_be_cnt = 0;
|
||||
psta->rx_bk_cnt = 0;
|
||||
psta->rx_vi_cnt = 0;
|
||||
psta->rx_vo_cnt = 0;
|
||||
#endif
|
||||
_func_exit_;
|
||||
#endif
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
|
@ -102,20 +102,20 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
|
|||
struct sta_info *psta;
|
||||
s32 i;
|
||||
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
|
||||
pstapriv->pallocated_stainfo_buf = rtw_zvmalloc (sizeof(struct sta_info) * NUM_STA+ 4);
|
||||
|
||||
|
||||
if(!pstapriv->pallocated_stainfo_buf)
|
||||
return _FAIL;
|
||||
|
||||
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
|
||||
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
|
||||
((SIZE_PTR)(pstapriv->pallocated_stainfo_buf ) & 3);
|
||||
|
||||
_rtw_init_queue(&pstapriv->free_sta_queue);
|
||||
|
||||
_rtw_spinlock_init(&pstapriv->sta_hash_lock);
|
||||
|
||||
|
||||
//_rtw_init_queue(&pstapriv->asoc_q);
|
||||
pstapriv->asoc_sta_count = 0;
|
||||
_rtw_init_queue(&pstapriv->sleep_q);
|
||||
|
@ -123,7 +123,7 @@ _func_enter_;
|
|||
|
||||
psta = (struct sta_info *)(pstapriv->pstainfo_buf);
|
||||
|
||||
|
||||
|
||||
for(i = 0; i < NUM_STA; i++)
|
||||
{
|
||||
_rtw_init_stainfo(psta);
|
||||
|
@ -135,7 +135,7 @@ _func_enter_;
|
|||
psta++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
|
@ -149,7 +149,7 @@ _func_enter_;
|
|||
pstapriv->asoc_list_cnt = 0;
|
||||
pstapriv->auth_list_cnt = 0;
|
||||
|
||||
pstapriv->auth_to = 3; // 3*2 = 6 sec
|
||||
pstapriv->auth_to = 3; // 3*2 = 6 sec
|
||||
pstapriv->assoc_to = 3;
|
||||
//pstapriv->expire_to = 900;// 900*2 = 1800 sec = 30 min, expire after no any traffic.
|
||||
//pstapriv->expire_to = 30;// 30*2 = 60 sec = 1 min, expire after no any traffic.
|
||||
|
@ -157,18 +157,18 @@ _func_enter_;
|
|||
pstapriv->expire_to = 3; // 3*2 = 6 sec
|
||||
#else
|
||||
pstapriv->expire_to = 60;// 60*2 = 120 sec = 2 min, expire after no any traffic.
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
_rtw_memset( pstapriv->atmel_rc_pattern, 0, ETH_ALEN);
|
||||
#endif
|
||||
pstapriv->max_num_sta = NUM_STA;
|
||||
|
||||
#endif
|
||||
|
||||
_func_exit_;
|
||||
pstapriv->max_num_sta = NUM_STA;
|
||||
|
||||
#endif
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
|
||||
inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
|
||||
|
@ -200,12 +200,12 @@ _func_enter_;
|
|||
_rtw_spinlock_free(&(psta_xmitpriv->bk_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->vi_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->vo_q.sta_pending.lock));
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
static void _rtw_free_sta_recv_priv_lock(struct sta_recv_priv *psta_recvpriv)
|
||||
{
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
|
||||
_rtw_spinlock_free(&psta_recvpriv->lock);
|
||||
|
||||
|
@ -225,8 +225,8 @@ _func_enter_;
|
|||
|
||||
_rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
|
||||
_rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -237,14 +237,14 @@ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv )
|
|||
_irqL irqL;
|
||||
_list *plist, *phead;
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
phead = get_list_head(&pstapriv->free_sta_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,list);
|
||||
|
@ -252,10 +252,10 @@ _func_enter_;
|
|||
|
||||
rtw_mfree_stainfo(psta);
|
||||
}
|
||||
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
|
@ -284,53 +284,53 @@ void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
|
|||
|
||||
u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
|
||||
{
|
||||
_irqL irqL;
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
struct sta_info *psta = NULL;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int index;
|
||||
int index;
|
||||
|
||||
_func_enter_;
|
||||
if(pstapriv){
|
||||
|
||||
/* delete all reordering_ctrl_timer */
|
||||
/* delete all reordering_ctrl_timer */
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
for(index = 0; index < NUM_STA; index++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
for(i=0; i < 16 ; i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
/*===============================*/
|
||||
|
||||
|
||||
rtw_mfree_sta_priv_lock(pstapriv);
|
||||
|
||||
if(pstapriv->pallocated_stainfo_buf) {
|
||||
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info)*NUM_STA+4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr)
|
||||
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||
{
|
||||
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||
{
|
||||
_irqL irqL, irqL2;
|
||||
uint tmp_aid;
|
||||
s32 index;
|
||||
|
@ -340,11 +340,11 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int i = 0;
|
||||
u16 wRxSeqInitialValue = 0xffff;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pfree_sta_queue = &pstapriv->free_sta_queue;
|
||||
|
||||
|
||||
//_enter_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
|
@ -357,13 +357,13 @@ _func_enter_;
|
|||
else
|
||||
{
|
||||
psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);
|
||||
|
||||
|
||||
rtw_list_delete(&(psta->list));
|
||||
|
||||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
|
||||
tmp_aid = psta->aid;
|
||||
|
||||
|
||||
tmp_aid = psta->aid;
|
||||
|
||||
_rtw_init_stainfo(psta);
|
||||
|
||||
psta->padapter = pstapriv->padapter;
|
||||
|
@ -376,7 +376,7 @@ _func_enter_;
|
|||
|
||||
if(index >= NUM_STA){
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA"));
|
||||
psta= NULL;
|
||||
psta= NULL;
|
||||
goto exit;
|
||||
}
|
||||
phash_list = &(pstapriv->sta_hash[index]);
|
||||
|
@ -399,7 +399,7 @@ _func_enter_;
|
|||
_rtw_memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 );
|
||||
}
|
||||
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n",
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n",
|
||||
pstapriv->asoc_sta_count , hwaddr[0], hwaddr[1], hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5]));
|
||||
|
||||
init_addba_retry_timer(pstapriv->padapter, psta);
|
||||
|
@ -420,15 +420,15 @@ _func_enter_;
|
|||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
preorder_ctrl->padapter = pstapriv->padapter;
|
||||
|
||||
|
||||
preorder_ctrl->enable = _FALSE;
|
||||
|
||||
|
||||
preorder_ctrl->indicate_seq = 0xffff;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq);
|
||||
#endif
|
||||
preorder_ctrl->wend_b= 0xffff;
|
||||
preorder_ctrl->wend_b= 0xffff;
|
||||
//preorder_ctrl->wsize_b = (NR_RECVBUFF-2);
|
||||
preorder_ctrl->wsize_b = 64;//64;
|
||||
|
||||
|
@ -447,7 +447,7 @@ _func_enter_;
|
|||
/* init for the sequence number of received management frame */
|
||||
psta->RxMgmtFrameSeqNum = 0xffff;
|
||||
}
|
||||
|
||||
|
||||
exit:
|
||||
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
@ -462,7 +462,7 @@ _func_exit_;
|
|||
|
||||
// using pstapriv->sta_hash_lock to protect
|
||||
u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
|
||||
{
|
||||
{
|
||||
int i;
|
||||
_irqL irqL0;
|
||||
_queue *pfree_sta_queue;
|
||||
|
@ -473,8 +473,8 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
|
|||
struct hw_xmit *phwxmit;
|
||||
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (psta == NULL)
|
||||
goto exit;
|
||||
|
||||
|
@ -487,16 +487,16 @@ _func_enter_;
|
|||
|
||||
|
||||
pstaxmitpriv = &psta->sta_xmitpriv;
|
||||
|
||||
|
||||
//rtw_list_delete(&psta->sleep_list);
|
||||
|
||||
|
||||
//rtw_list_delete(&psta->wakeup_list);
|
||||
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
||||
|
||||
//vo
|
||||
//_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
|
||||
|
@ -523,7 +523,7 @@ _func_enter_;
|
|||
phwxmit->accnt -= pstaxmitpriv->be_q.qcnt;
|
||||
pstaxmitpriv->be_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
|
||||
|
||||
|
||||
//bk
|
||||
//_enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
|
||||
|
@ -532,14 +532,14 @@ _func_enter_;
|
|||
phwxmit->accnt -= pstaxmitpriv->bk_q.qcnt;
|
||||
pstaxmitpriv->bk_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
|
||||
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
|
||||
rtw_list_delete(&psta->hash_list);
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]));
|
||||
pstapriv->asoc_sta_count --;
|
||||
|
||||
|
||||
|
||||
|
||||
// re-init sta_info; 20061114 // will be init in alloc_stainfo
|
||||
//_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
|
||||
//_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
|
||||
|
@ -563,42 +563,42 @@ _func_enter_;
|
|||
union recv_frame *prframe;
|
||||
_queue *ppending_recvframe_queue;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
|
||||
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
|
||||
|
||||
ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
|
||||
|
||||
_enter_critical_bh(&ppending_recvframe_queue->lock, &irqL);
|
||||
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while(!rtw_is_list_empty(phead))
|
||||
{
|
||||
{
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
|
||||
|
||||
plist = get_next(plist);
|
||||
|
||||
|
||||
rtw_list_delete(&(prframe->u.hdr.list));
|
||||
|
||||
rtw_free_recvframe(prframe, pfree_recv_queue);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irqL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!(psta->state & WIFI_AP_STATE))
|
||||
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, _FALSE);
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
/*
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
*/
|
||||
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
|
@ -607,7 +607,7 @@ _func_enter_;
|
|||
pstapriv->auth_list_cnt--;
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
|
||||
|
||||
psta->expire_to = 0;
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
psta->flag_atmel_rc = 0;
|
||||
|
@ -624,9 +624,9 @@ _func_enter_;
|
|||
psta->has_legacy_ac = 0;
|
||||
|
||||
#ifdef CONFIG_NATIVEAP_MLME
|
||||
|
||||
|
||||
pstapriv->sta_dz_bitmap &=~BIT(psta->aid);
|
||||
pstapriv->tim_bitmap &=~BIT(psta->aid);
|
||||
pstapriv->tim_bitmap &=~BIT(psta->aid);
|
||||
|
||||
//rtw_indicate_sta_disassoc_event(padapter, psta);
|
||||
|
||||
|
@ -634,15 +634,15 @@ _func_enter_;
|
|||
{
|
||||
pstapriv->sta_aid[psta->aid - 1] = NULL;
|
||||
psta->aid = 0;
|
||||
}
|
||||
|
||||
#endif // CONFIG_NATIVEAP_MLME
|
||||
}
|
||||
|
||||
#endif // CONFIG_NATIVEAP_MLME
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
psta->under_exist_checking = 0;
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
#endif // CONFIG_AP_MODE
|
||||
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
|
||||
|
@ -651,11 +651,11 @@ _func_enter_;
|
|||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL0);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// free all stainfo which in sta_hash[all]
|
||||
|
@ -667,8 +667,8 @@ void rtw_free_all_stainfo(struct adapter *padapter)
|
|||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info* pbcmc_stainfo =rtw_get_bcmc_stainfo( padapter);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if(pstapriv->asoc_sta_count==1)
|
||||
goto exit;
|
||||
|
@ -679,24 +679,24 @@ _func_enter_;
|
|||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
|
||||
|
||||
plist = get_next(plist);
|
||||
|
||||
if(pbcmc_stainfo!=psta)
|
||||
if(pbcmc_stainfo!=psta)
|
||||
rtw_free_stainfo(padapter , psta);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
|
@ -709,7 +709,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
_list *plist, *phead;
|
||||
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
|
||||
u32 index;
|
||||
|
||||
u8 *addr;
|
||||
|
@ -720,7 +720,7 @@ _func_enter_;
|
|||
|
||||
if(hwaddr==NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
if(IS_MCAST(hwaddr))
|
||||
{
|
||||
addr = bc_addr;
|
||||
|
@ -733,17 +733,17 @@ _func_enter_;
|
|||
index = wifi_mac_hash(addr);
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
|
||||
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== _TRUE)
|
||||
|
||||
if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== _TRUE)
|
||||
{ // if found the matched address
|
||||
break;
|
||||
}
|
||||
|
@ -752,26 +752,26 @@ _func_enter_;
|
|||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return psta;
|
||||
|
||||
|
||||
}
|
||||
|
||||
u32 rtw_init_bcmc_stainfo(struct adapter* padapter)
|
||||
{
|
||||
|
||||
struct sta_info *psta;
|
||||
struct sta_info *psta;
|
||||
struct tx_servq *ptxservq;
|
||||
u32 res=_SUCCESS;
|
||||
NDIS_802_11_MAC_ADDRESS bcast_addr= {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
|
||||
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
//_queue *pstapending = &padapter->xmitpriv.bm_pending;
|
||||
|
||||
//_queue *pstapending = &padapter->xmitpriv.bm_pending;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
|
||||
|
||||
|
||||
if(psta==NULL){
|
||||
res=_FAIL;
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("rtw_alloc_stainfo fail"));
|
||||
|
@ -791,9 +791,9 @@ _func_enter_;
|
|||
|
||||
_exit_critical(&pstapending->lock, &irqL0);
|
||||
*/
|
||||
|
||||
|
||||
exit:
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
@ -801,12 +801,12 @@ _func_exit_;
|
|||
|
||||
struct sta_info* rtw_get_bcmc_stainfo(struct adapter* padapter)
|
||||
{
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
_func_enter_;
|
||||
psta = rtw_get_stainfo(pstapriv, bc_addr);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return psta;
|
||||
|
||||
}
|
||||
|
@ -822,10 +822,10 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
|
|||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
|
||||
_queue *pacl_node_q =&pacl_list->acl_node_q;
|
||||
|
||||
|
||||
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
phead = get_list_head(pacl_node_q);
|
||||
plist = get_next(phead);
|
||||
plist = get_next(phead);
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
|
||||
|
@ -838,15 +838,15 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
|
|||
match = _TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
|
||||
|
||||
|
||||
if(pacl_list->mode == 1)//accept unless in deny list
|
||||
{
|
||||
res = (match == _TRUE) ? _FALSE:_TRUE;
|
||||
}
|
||||
}
|
||||
else if(pacl_list->mode == 2)//deny unless in accept list
|
||||
{
|
||||
res = (match == _TRUE) ? _TRUE:_FALSE;
|
||||
|
@ -854,11 +854,10 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
|
|||
else
|
||||
{
|
||||
res = _TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
|
|
5881
core/rtw_tdls.c
5881
core/rtw_tdls.c
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
739
core/rtw_xmit.c
739
core/rtw_xmit.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue