mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: Remove trailing white space from all source files
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
77e736c66a
commit
f5f3863bc5
205 changed files with 55371 additions and 55581 deletions
5203
core/rtw_ap.c
5203
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.
|
||||
|
@ -235,10 +235,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;
|
||||
}
|
||||
|
@ -248,16 +248,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -266,55 +266,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;
|
||||
|
||||
|
@ -324,7 +324,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
|
||||
|
@ -376,10 +376,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;
|
||||
|
@ -445,8 +445,8 @@ static int __nat25_db_network_lookup_and_replace(_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],
|
||||
|
@ -470,7 +470,7 @@ static int __nat25_db_network_lookup_and_replace(_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],
|
||||
|
@ -637,7 +637,7 @@ void nat25_db_cleanup(_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;
|
||||
|
@ -668,7 +668,7 @@ void nat25_db_expire(_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++)
|
||||
|
@ -1410,7 +1410,7 @@ int nat25_db_handle(_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))
|
||||
|
@ -1427,13 +1427,13 @@ int nat25_db_handle(_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],
|
||||
|
@ -1444,10 +1444,10 @@ int nat25_db_handle(_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,
|
||||
|
@ -1455,26 +1455,26 @@ int nat25_db_handle(_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;
|
||||
|
||||
|
@ -1535,12 +1535,12 @@ int nat25_handle_frame(_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);
|
||||
}
|
||||
}
|
||||
|
@ -1669,4 +1669,3 @@ void *scdb_findEntry(_adapter *priv, unsigned char *macAddr,
|
|||
}
|
||||
|
||||
#endif // CONFIG_BR_EXT
|
||||
|
||||
|
|
789
core/rtw_cmd.c
789
core/rtw_cmd.c
File diff suppressed because it is too large
Load diff
335
core/rtw_debug.c
335
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;
|
||||
}
|
||||
|
@ -96,9 +96,9 @@ int proc_set_write_reg(struct file *file, const char __user *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);
|
||||
|
||||
|
@ -110,23 +110,23 @@ int proc_set_write_reg(struct file *file, const char __user *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;
|
||||
|
@ -135,21 +135,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;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
_adapter *padapter = (_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:
|
||||
|
@ -178,9 +178,9 @@ int proc_set_read_reg(struct file *file, const char __user *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);
|
||||
|
||||
|
@ -190,10 +190,10 @@ int proc_set_read_reg(struct file *file, const char __user *buffer,
|
|||
}
|
||||
|
||||
proc_get_read_addr = addr;
|
||||
|
||||
|
||||
proc_get_read_len = len;
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
|
@ -205,11 +205,11 @@ int proc_get_fwstate(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_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;
|
||||
}
|
||||
|
@ -219,15 +219,15 @@ int proc_get_sec_info(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
_adapter *padapter = (_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;
|
||||
}
|
||||
|
@ -237,14 +237,14 @@ int proc_get_mlmext_state(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
_adapter *padapter = (_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;
|
||||
}
|
||||
|
@ -256,11 +256,11 @@ int proc_get_qos_option(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_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;
|
||||
|
||||
|
@ -273,7 +273,7 @@ int proc_get_ht_option(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_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);
|
||||
|
@ -287,14 +287,14 @@ int proc_get_rf_info(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
_adapter *padapter = (_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;
|
||||
|
||||
|
@ -318,31 +318,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));
|
||||
}
|
||||
|
||||
|
@ -358,15 +358,15 @@ int proc_get_adapter_state(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_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)
|
||||
|
@ -376,8 +376,8 @@ int proc_get_trx_info(char *page, char **start,
|
|||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "free_xmitbuf_cnt=%d, free_xmitframe_cnt=%d, free_ext_xmitbuf_cnt=%d, free_recvframe_cnt=%d\n",
|
||||
|
||||
len += snprintf(page + len, count - len, "free_xmitbuf_cnt=%d, free_xmitframe_cnt=%d, free_ext_xmitbuf_cnt=%d, free_recvframe_cnt=%d\n",
|
||||
pxmitpriv->free_xmitbuf_cnt, pxmitpriv->free_xmitframe_cnt,pxmitpriv->free_xmit_extbuf_cnt, precvpriv->free_recvframe_cnt);
|
||||
#ifdef CONFIG_USB_HCI
|
||||
len += snprintf(page + len, count - len, "rx_urb_pending_cn=%d\n", precvpriv->rx_pending_cnt);
|
||||
|
@ -400,10 +400,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;
|
||||
|
@ -423,12 +423,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;
|
||||
|
||||
|
@ -446,10 +446,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;
|
||||
|
@ -462,19 +462,19 @@ int proc_get_bb_reg_dump1(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
_adapter *padapter = (_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,
|
||||
|
@ -482,19 +482,19 @@ int proc_get_bb_reg_dump2(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
_adapter *padapter = (_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,
|
||||
|
@ -502,19 +502,19 @@ int proc_get_bb_reg_dump3(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
_adapter *padapter = (_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,
|
||||
|
@ -526,21 +526,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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -552,21 +552,21 @@ int proc_get_rf_reg_dump2(char *page, char **start,
|
|||
_adapter *padapter = (_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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -578,22 +578,22 @@ int proc_get_rf_reg_dump3(char *page, char **start,
|
|||
_adapter *padapter = (_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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -611,7 +611,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);
|
||||
|
@ -619,11 +619,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)
|
||||
|
@ -631,7 +631,7 @@ int proc_get_rx_signal(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len,
|
||||
|
@ -639,14 +639,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;
|
||||
}
|
||||
|
@ -662,15 +662,15 @@ int proc_set_rx_signal(struct file *file, const char __user *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;
|
||||
|
||||
|
@ -681,11 +681,11 @@ int proc_set_rx_signal(struct file *file, const char __user *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
|
||||
|
||||
|
@ -696,9 +696,9 @@ int proc_get_ht_enable(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
if (pregpriv)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d\n",
|
||||
|
@ -721,7 +721,7 @@ int proc_set_ht_enable(struct file *file, const char __user *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);
|
||||
|
||||
|
@ -731,9 +731,9 @@ int proc_set_ht_enable(struct file *file, const char __user *buffer,
|
|||
printk("ht_enable=%d\n", pregpriv->ht_enable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int proc_get_cbw40_enable(char *page, char **start,
|
||||
|
@ -743,7 +743,7 @@ int proc_get_cbw40_enable(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
if (pregpriv)
|
||||
|
@ -768,7 +768,7 @@ int proc_set_cbw40_enable(struct file *file, const char __user *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);
|
||||
|
||||
|
@ -780,9 +780,9 @@ int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int proc_get_ampdu_enable(char *page, char **start,
|
||||
|
@ -792,7 +792,7 @@ int proc_get_ampdu_enable(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
if (pregpriv)
|
||||
|
@ -817,7 +817,7 @@ int proc_set_ampdu_enable(struct file *file, const char __user *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);
|
||||
|
||||
|
@ -828,9 +828,9 @@ int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
|
@ -840,9 +840,9 @@ int proc_get_two_path_rssi(char *page, char **start,
|
|||
{
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
if (padapter)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d %d\n",
|
||||
|
@ -861,7 +861,7 @@ int proc_get_rx_stbc(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
if (pregpriv)
|
||||
|
@ -886,7 +886,7 @@ int proc_set_rx_stbc(struct file *file, const char __user *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);
|
||||
|
||||
|
@ -896,9 +896,9 @@ int proc_set_rx_stbc(struct file *file, const char __user *buffer,
|
|||
printk("rx_stbc=%d\n", mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
|
@ -923,9 +923,9 @@ int proc_set_rssi_disp(struct file *file, const char __user *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);
|
||||
|
||||
|
@ -933,25 +933,25 @@ int proc_set_rssi_disp(struct file *file, const char __user *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,
|
||||
|
@ -966,18 +966,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);
|
||||
|
@ -990,9 +990,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);
|
||||
|
@ -1003,30 +1003,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>
|
||||
|
@ -1037,12 +1037,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;
|
||||
}
|
||||
|
@ -1064,8 +1064,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 ) {
|
||||
|
@ -1096,11 +1096,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);
|
||||
|
||||
|
@ -1156,9 +1156,9 @@ int proc_set_btcoex_dbg(struct file *file, const char __user *buffer,
|
|||
printk("btcoex_dbg=%d\n", BTCoexDbgLevel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1166,4 +1166,3 @@ int proc_set_btcoex_dbg(struct file *file, const char __user *buffer,
|
|||
#endif /* CONFIG_BT_COEXIST */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
206
core/rtw_efuse.c
206
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 PADAPTER pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value );
|
||||
IN u8 Value );
|
||||
BOOLEAN
|
||||
Efuse_Write1ByteToFakeContent(
|
||||
IN PADAPTER 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(
|
||||
PADAPTER 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(
|
|||
PADAPTER 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(
|
|||
PADAPTER 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 PADAPTER Adapter,
|
||||
EFUSE_Read1Byte(
|
||||
IN PADAPTER 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 PADAPTER Adapter,
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN PADAPTER Adapter,
|
||||
IN u16 Address,
|
||||
IN u8 Value);
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN PADAPTER Adapter,
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN PADAPTER 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 PADAPTER pAdapter,
|
||||
IN PADAPTER 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 PADAPTER pAdapter,
|
||||
IN u16 addr,
|
||||
IN PADAPTER 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 PADAPTER pAdapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
Efuse_PgPacketWrite(IN PADAPTER pAdapter,
|
||||
IN u8 offset,
|
||||
int
|
||||
Efuse_PgPacketWrite(IN PADAPTER pAdapter,
|
||||
IN u8 offset,
|
||||
IN u8 word_en,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -525,9 +525,9 @@ Efuse_PgPacketWrite(IN PADAPTER pAdapter,
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
Efuse_PgPacketWrite_BT(IN PADAPTER pAdapter,
|
||||
IN u8 offset,
|
||||
int
|
||||
Efuse_PgPacketWrite_BT(IN PADAPTER pAdapter,
|
||||
IN u8 offset,
|
||||
IN u8 word_en,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -552,15 +552,15 @@ Efuse_PgPacketWrite_BT(IN PADAPTER 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 PADAPTER 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 PADAPTER pAdapter,
|
||||
IN PADAPTER pAdapter,
|
||||
IN u8 efuseType,
|
||||
IN OUT u8 *Efuse,
|
||||
IN BOOLEAN bPseudoTest);
|
||||
VOID
|
||||
VOID
|
||||
Efuse_ReadAllMap(
|
||||
IN PADAPTER pAdapter,
|
||||
IN PADAPTER 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 PADAPTER pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value);
|
||||
IN u8 Value);
|
||||
#endif //PLATFORM
|
||||
static VOID
|
||||
efuse_ShadowWrite1Byte(
|
||||
IN PADAPTER 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 PADAPTER 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);
|
||||
|
@ -1253,11 +1253,11 @@ 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
|
||||
|
|
|
@ -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", __func__, 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", __func__, count, left));
|
||||
"count %u left %u", __func__, 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)", __func__));
|
||||
|
@ -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", __func__, 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", __func__, count, left));
|
||||
"count %u left %u", __func__, 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)", __func__));
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -919,20 +919,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;
|
||||
}
|
||||
|
@ -964,33 +964,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", __func__, 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;
|
||||
}
|
||||
|
@ -1012,7 +1012,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)
|
||||
|
@ -1123,7 +1123,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
|
|||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1156,7 +1156,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;
|
||||
}
|
||||
|
@ -1258,7 +1258,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
|||
return ParseFailed;
|
||||
|
||||
return unknown ? ParseUnknown : ParseOK;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static u8 key_char2num(u8 ch);
|
||||
|
@ -1296,7 +1296,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;
|
||||
|
@ -1311,7 +1311,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) &&
|
||||
|
@ -1326,7 +1326,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));
|
||||
}
|
||||
|
@ -1334,7 +1334,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
void dump_ies(u8 *buf, u32 buf_len) {
|
||||
u8* pos = (u8*)buf;
|
||||
u8 id, len;
|
||||
|
||||
|
||||
while (pos-buf<=buf_len){
|
||||
id = *pos;
|
||||
len = *(pos+1);
|
||||
|
@ -1346,7 +1346,7 @@ void dump_ies(u8 *buf, u32 buf_len) {
|
|||
dump_wps_ie(pos, len);
|
||||
|
||||
pos+=(2+len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dump_wps_ie(u8 *ie, u32 ie_len) {
|
||||
|
@ -1356,7 +1356,7 @@ void dump_wps_ie(u8 *ie, u32 ie_len) {
|
|||
|
||||
u8 *wps_ie;
|
||||
uint wps_ielen;
|
||||
|
||||
|
||||
wps_ie = rtw_get_wps_ie(ie, ie_len, NULL, &wps_ielen);
|
||||
if (wps_ie != ie || wps_ielen == 0)
|
||||
return;
|
||||
|
@ -1369,7 +1369,7 @@ void dump_wps_ie(u8 *ie, u32 ie_len) {
|
|||
DBG_871X("%s ID:0x%04x, LEN:%u\n", __func__, id, len);
|
||||
|
||||
pos+=(4+len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
|
@ -1380,7 +1380,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;
|
||||
|
@ -1393,7 +1393,7 @@ void dump_p2p_ie(u8 *ie, u32 ie_len) {
|
|||
DBG_871X("%s ID:%u, LEN:%u\n", __func__, id, len);
|
||||
|
||||
pos+=(3+len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1422,11 +1422,11 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|||
dump_stack();
|
||||
#endif
|
||||
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 );
|
||||
|
@ -1436,17 +1436,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;
|
||||
|
||||
|
@ -1479,33 +1479,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", __func__, 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;
|
||||
}
|
||||
|
@ -1527,7 +1527,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)
|
||||
|
@ -1545,19 +1545,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;
|
||||
}
|
||||
|
||||
|
@ -1595,12 +1595,12 @@ 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)) )
|
||||
{
|
||||
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);
|
||||
|
@ -1618,7 +1618,7 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
|
|||
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};
|
||||
|
||||
|
||||
|
@ -1632,13 +1632,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
|
||||
{
|
||||
|
@ -1647,12 +1647,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;
|
||||
|
@ -1660,16 +1660,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;
|
||||
|
||||
}
|
||||
|
@ -1679,7 +1679,7 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
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};
|
||||
|
||||
|
||||
|
@ -1696,17 +1696,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;
|
||||
|
@ -1714,10 +1714,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;
|
||||
|
||||
|
@ -1871,7 +1871,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))
|
||||
|
@ -1992,4 +1992,3 @@ const char *action_public_str(u8 action)
|
|||
action = (action >= ACT_PUBLIC_MAX) ? ACT_PUBLIC_MAX : action;
|
||||
return _action_public_str[action];
|
||||
}
|
||||
|
||||
|
|
|
@ -75,12 +75,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)
|
||||
|
@ -90,7 +90,7 @@ jackson@realtek.com.tw
|
|||
u8 _rtw_read8(_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);
|
||||
|
@ -105,10 +105,10 @@ u8 _rtw_read8(_adapter *adapter, u32 addr)
|
|||
u16 _rtw_read16(_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;
|
||||
|
||||
|
@ -120,10 +120,10 @@ u16 _rtw_read16(_adapter *adapter, u32 addr)
|
|||
u32 _rtw_read32(_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;
|
||||
|
||||
|
@ -135,7 +135,7 @@ u32 _rtw_read32(_adapter *adapter, u32 addr)
|
|||
|
||||
int _rtw_write8(_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);
|
||||
|
@ -145,12 +145,12 @@ int _rtw_write8(_adapter *adapter, u32 addr, u8 val)
|
|||
|
||||
ret = _write8(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write16(_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);
|
||||
|
@ -166,14 +166,14 @@ int _rtw_write16(_adapter *adapter, u32 addr, u16 val)
|
|||
}
|
||||
int _rtw_write32(_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_;
|
||||
|
@ -183,7 +183,7 @@ int _rtw_write32(_adapter *adapter, u32 addr, u32 val)
|
|||
|
||||
int _rtw_writeN(_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);
|
||||
|
@ -198,7 +198,7 @@ int _rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *pdata)
|
|||
}
|
||||
int _rtw_write8_async(_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);
|
||||
|
@ -213,7 +213,7 @@ int _rtw_write8_async(_adapter *adapter, u32 addr, u8 val)
|
|||
}
|
||||
int _rtw_write16_async(_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);
|
||||
|
@ -228,7 +228,7 @@ int _rtw_write16_async(_adapter *adapter, u32 addr, u16 val)
|
|||
}
|
||||
int _rtw_write32_async(_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);
|
||||
|
@ -245,7 +245,7 @@ int _rtw_write32_async(_adapter *adapter, u32 addr, u32 val)
|
|||
void _rtw_read_mem(_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);
|
||||
|
||||
|
@ -253,7 +253,7 @@ void _rtw_read_mem(_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;
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
void _rtw_write_mem(_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);
|
||||
|
||||
|
@ -285,7 +285,7 @@ void _rtw_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
void _rtw_read_port(_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);
|
||||
|
||||
|
@ -293,7 +293,7 @@ void _rtw_read_port(_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;
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ void _rtw_read_port_cancel(_adapter *adapter)
|
|||
u32 _rtw_write_port(_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;
|
||||
|
@ -329,7 +329,7 @@ u32 _rtw_write_port(_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_;
|
||||
|
@ -388,12 +388,12 @@ int rtw_init_io_priv(_adapter *padapter, void (*set_intf_ops)(struct _io_ops *po
|
|||
|
||||
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;
|
||||
|
@ -405,7 +405,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;
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,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;
|
||||
}
|
||||
|
||||
|
@ -433,7 +433,7 @@ u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line
|
|||
u16 dbg_rtw_read16(_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);
|
||||
|
||||
|
@ -443,7 +443,7 @@ u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int li
|
|||
u32 dbg_rtw_read32(_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);
|
||||
|
||||
|
@ -454,21 +454,21 @@ int dbg_rtw_write8(_adapter *adapter, u32 addr, u8 val, const char *caller, cons
|
|||
{
|
||||
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(_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(_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(_adapter *adapter, u32 addr ,u32 length , u8 *data, const char *caller, const int line)
|
||||
|
@ -479,5 +479,3 @@ int dbg_rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *data, const cha
|
|||
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.
|
||||
|
@ -37,23 +37,23 @@ query_802_11_capability(
|
|||
u32 * pulOutLen
|
||||
)
|
||||
{
|
||||
static NDIS_802_11_AUTHENTICATION_ENCRYPTION szAuthEnc[] =
|
||||
static NDIS_802_11_AUTHENTICATION_ENCRYPTION szAuthEnc[] =
|
||||
{
|
||||
{Ndis802_11AuthModeOpen, Ndis802_11EncryptionDisabled},
|
||||
{Ndis802_11AuthModeOpen, Ndis802_11EncryptionDisabled},
|
||||
{Ndis802_11AuthModeOpen, Ndis802_11Encryption1Enabled},
|
||||
{Ndis802_11AuthModeShared, Ndis802_11EncryptionDisabled},
|
||||
{Ndis802_11AuthModeShared, Ndis802_11EncryptionDisabled},
|
||||
{Ndis802_11AuthModeShared, Ndis802_11Encryption1Enabled},
|
||||
{Ndis802_11AuthModeWPA, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPANone, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPANone, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPANone, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPA2, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA2, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA2, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption3Enabled}
|
||||
};
|
||||
};
|
||||
static ULONG ulNumOfPairSupported = sizeof(szAuthEnc)/sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
|
||||
NDIS_802_11_CAPABILITY * pCap = (NDIS_802_11_CAPABILITY *)pucBuf;
|
||||
u8* pucAuthEncryptionSupported = (u8*) pCap->AuthenticationEncryptionSupported;
|
||||
|
@ -61,10 +61,10 @@ query_802_11_capability(
|
|||
|
||||
pCap->Length = sizeof(NDIS_802_11_CAPABILITY);
|
||||
if (ulNumOfPairSupported > 1 )
|
||||
pCap->Length += (ulNumOfPairSupported-1) * sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
|
||||
|
||||
pCap->Version = 2;
|
||||
pCap->NoOfPMKIDs = NUM_PMKID_CACHE;
|
||||
pCap->Length += (ulNumOfPairSupported-1) * sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
|
||||
|
||||
pCap->Version = 2;
|
||||
pCap->NoOfPMKIDs = NUM_PMKID_CACHE;
|
||||
pCap->NoOfAuthEncryptPairsSupported = ulNumOfPairSupported;
|
||||
|
||||
if ( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size.
|
||||
|
@ -86,7 +86,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
struct wlan_network *tgt_network;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct security_priv *psecuritypriv=&(padapter->securitypriv);
|
||||
WLAN_BSSID_EX *psecnetwork=(WLAN_BSSID_EX*)&(psecuritypriv->sec_bss);
|
||||
WLAN_BSSID_EX *psecnetwork=(WLAN_BSSID_EX*)&(psecuritypriv->sec_bss);
|
||||
u8 * pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
unsigned char i,*auth_ie,*supp_ie;
|
||||
|
||||
|
@ -99,7 +99,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
//------------------------------------------------------
|
||||
// Req_1. AvailableRequestFixedIEs
|
||||
if (psecnetwork!=NULL){
|
||||
|
||||
|
||||
pAssocInfo->AvailableRequestFixedIEs |= NDIS_802_11_AI_REQFI_CAPABILITIES|NDIS_802_11_AI_REQFI_CURRENTAPADDRESS;
|
||||
pAssocInfo->RequestFixedIEs.Capabilities = (unsigned short)* & psecnetwork->IEs[10];
|
||||
_rtw_memcpy(pAssocInfo->RequestFixedIEs.CurrentAPAddress,
|
||||
|
@ -109,12 +109,12 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
|
||||
if (check_fwstate( pmlmepriv, _FW_UNDER_LINKING|_FW_LINKED)==_TRUE)
|
||||
{
|
||||
|
||||
|
||||
if (psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2)
|
||||
pDest[0] =48; //RSN Information Element
|
||||
else
|
||||
else
|
||||
pDest[0] =221; //WPA(SSN) Information Element
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n Adapter->ndisauthtype==Ndis802_11AuthModeWPA)?0xdd:0x30 [%d]",pDest[0]));
|
||||
supp_ie=&psecuritypriv->supplicant_ie[0];
|
||||
for (i=0;i<supp_ie[0];i++)
|
||||
|
@ -122,34 +122,34 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x\n\n", i,supp_ie[i]));
|
||||
}
|
||||
|
||||
i=13; //0~11 is fixed information element
|
||||
i=13; //0~11 is fixed information element
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("i= %d tgt_network->network.IELength=%d\n\n", i,(int)psecnetwork->IELength));
|
||||
while ((i<supp_ie[0]) && (i<256)){
|
||||
if ((unsigned char)supp_ie[i]==pDest[0]){
|
||||
_rtw_memcpy((u8 *)(pDest),
|
||||
&supp_ie[i],
|
||||
&supp_ie[i],
|
||||
supp_ie[1+i]+2);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
i=i+supp_ie[i+1]+2;
|
||||
if (supp_ie[1+i]==0)
|
||||
i=i+1;
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("iteration i=%d IEs [%d] = 0x%x\n\n", i,i,supp_ie[i+1]));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
pAssocInfo->RequestIELength += (2 + supp_ie[1+i]);// (2 + psecnetwork->IEs[1+i]+4);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n psecnetwork != NULL,fwstate==_FW_UNDER_LINKING\n"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------
|
||||
// Association Response related information
|
||||
|
@ -177,20 +177,19 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
i=auth_ie[0]-12;
|
||||
if (i>0){
|
||||
_rtw_memcpy((u8 *)&pDest[0],&auth_ie[1],i);
|
||||
pAssocInfo->ResponseIELength =i;
|
||||
pAssocInfo->ResponseIELength =i;
|
||||
}
|
||||
|
||||
|
||||
pAssocInfo->OffsetResponseIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + pAssocInfo->RequestIELength;
|
||||
pAssocInfo->OffsetResponseIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + pAssocInfo->RequestIELength;
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n tgt_network != NULL,fwstate==_FW_LINKED\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n exit query_802_11_association_information\n"));
|
||||
_func_exit_;
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
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(ADAPTER *adapter)
|
|||
DBG_871X("%s rtw_alloc_xmitframe return null\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
if ((xmitbuf = rtw_alloc_xmitbuf(pxmitpriv)) == NULL)
|
||||
{
|
||||
DBG_871X("%s rtw_alloc_xmitbuf return null\n", __func__);
|
||||
|
@ -42,7 +42,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(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(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", __func__, ori_len, cmd_len, buf_offset+pattrib->pktlen);
|
||||
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
bool rtw_IOL_applied(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", __func__, 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", __func__, 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", __func__, 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", __func__, 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",__func__,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(ADAPTER *Adapter,int buf_len,u8 *pbuf)
|
|||
{
|
||||
int i;
|
||||
int j=1;
|
||||
|
||||
|
||||
printk("###### %s ######\n",__func__);
|
||||
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", __func__, 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", __func__, 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(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
1193
core/rtw_mlme.c
1193
core/rtw_mlme.c
File diff suppressed because it is too large
Load diff
1785
core/rtw_mlme_ext.c
1785
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.
|
||||
|
@ -39,8 +39,8 @@
|
|||
#include "rtw_bt_mp.h"
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188E
|
||||
#include "odm_precomp.h"
|
||||
#include "rtl8188e_hal.h"
|
||||
#include "odm_precomp.h"
|
||||
#include "rtl8188e_hal.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -67,7 +67,7 @@ u32 read_macreg(_adapter *padapter, u32 addr, u32 sz)
|
|||
}
|
||||
|
||||
return val;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void write_macreg(_adapter *padapter, u32 addr, u32 val, u32 sz)
|
||||
|
@ -385,7 +385,7 @@ MPT_InitializeAdapter(
|
|||
pMptCtx->bMPh2c_timeout = _FALSE;
|
||||
pMptCtx->MptH2cRspEvent = _FALSE;
|
||||
pMptCtx->MptBtC2hEvent = _FALSE;
|
||||
|
||||
|
||||
_rtw_init_sema(&pMptCtx->MPh2c_Sema, 0);
|
||||
_init_timer( &pMptCtx->MPh2c_timeout_timer, pAdapter->pnetdev, MPh2c_timeout_handle, pAdapter );
|
||||
#endif
|
||||
|
@ -412,12 +412,12 @@ MPT_InitializeAdapter(
|
|||
{
|
||||
//rtw_write32(pAdapter, REG_LEDCFG0, 0x08080);
|
||||
ledsetting = rtw_read32(pAdapter, REG_LEDCFG0);
|
||||
|
||||
|
||||
#if defined (CONFIG_RTL8192C) || defined( CONFIG_RTL8192D )
|
||||
rtw_write32(pAdapter, REG_LEDCFG0, ledsetting & ~LED0DIS);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
PHY_IQCalibrate(pAdapter, _FALSE);
|
||||
dm_CheckTXPowerTracking(&pHalData->odmpriv); //trigger thermal meter
|
||||
PHY_LCCalibrate(pAdapter);
|
||||
|
@ -561,7 +561,7 @@ s32 mp_start_test(PADAPTER padapter)
|
|||
|
||||
padapter->registrypriv.mp_mode = 1;
|
||||
pmppriv->bSetTxPower=0; //for manually set tx power
|
||||
|
||||
|
||||
//3 disable dynamic mechanism
|
||||
disable_dm(padapter);
|
||||
|
||||
|
@ -684,11 +684,11 @@ void mp_stop_test(PADAPTER padapter)
|
|||
struct sta_info *psta;
|
||||
|
||||
_irqL irqL;
|
||||
|
||||
|
||||
if (pmppriv->mode==MP_ON)
|
||||
{
|
||||
pmppriv->bSetTxPower=0;
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _FALSE)
|
||||
goto end_of_mp_stop_test;
|
||||
|
||||
|
@ -792,7 +792,7 @@ void SetAntennaPathPower(PADAPTER pAdapter)
|
|||
{
|
||||
Hal_SetAntennaPathPower(pAdapter);
|
||||
}
|
||||
|
||||
|
||||
void SetTxPower(PADAPTER pAdapter)
|
||||
{
|
||||
Hal_SetTxPower(pAdapter);
|
||||
|
@ -891,7 +891,7 @@ static void SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart)
|
|||
static void SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart)
|
||||
{
|
||||
PhySetTxPowerLevel(pAdapter);
|
||||
Hal_SetOFDMContinuousTx( pAdapter, bStart);
|
||||
Hal_SetOFDMContinuousTx( pAdapter, bStart);
|
||||
}/* mpt_StartOfdmContTx */
|
||||
|
||||
void SetContinuousTx(PADAPTER pAdapter, u8 bStart)
|
||||
|
@ -904,10 +904,10 @@ void SetContinuousTx(PADAPTER pAdapter, u8 bStart)
|
|||
void PhySetTxPowerLevel(PADAPTER pAdapter)
|
||||
{
|
||||
struct mp_priv *pmp_priv = &pAdapter->mppriv;
|
||||
|
||||
|
||||
if (pmp_priv->bSetTxPower==0) // for NO manually set power index
|
||||
{
|
||||
#ifdef CONFIG_RTL8188E
|
||||
#ifdef CONFIG_RTL8188E
|
||||
PHY_SetTxPowerLevel8188E(pAdapter,pmp_priv->channel);
|
||||
#elif defined(CONFIG_RTL8192D)
|
||||
PHY_SetTxPowerLevel8192D(pAdapter,pmp_priv->channel);
|
||||
|
@ -983,7 +983,7 @@ static thread_return mp_xmit_packet_thread(thread_context context)
|
|||
|
||||
_rtw_memcpy((u8 *)(pxmitframe->buf_addr+TXDESC_OFFSET), pmptx->buf, pmptx->write_size);
|
||||
_rtw_memcpy(&(pxmitframe->attrib), &(pmptx->attrib), sizeof(struct pkt_attrib));
|
||||
|
||||
|
||||
dump_mpframe(padapter, pxmitframe);
|
||||
|
||||
pmptx->sended++;
|
||||
|
@ -1010,7 +1010,7 @@ exit:
|
|||
}
|
||||
|
||||
void fill_txdesc_for_mp(PADAPTER padapter, struct tx_desc *ptxdesc)
|
||||
{
|
||||
{
|
||||
struct mp_priv *pmp_priv = &padapter->mppriv;
|
||||
_rtw_memcpy(ptxdesc, &(pmp_priv->tx.desc), TXDESC_SIZE);
|
||||
}
|
||||
|
@ -1080,14 +1080,14 @@ void SetPacketTx(PADAPTER padapter)
|
|||
desc->txdw1 |= cpu_to_le32((0x01 << 26) & 0xff000000);
|
||||
#endif
|
||||
// offset 4
|
||||
#ifndef CONFIG_RTL8188E
|
||||
#ifndef CONFIG_RTL8188E
|
||||
desc->txdw1 |= cpu_to_le32(BK); // don't aggregate(AMPDU)
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x1F); //CAM_ID(MAC_ID)
|
||||
#else
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x3F); //CAM_ID(MAC_ID)
|
||||
#endif
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->qsel << QSEL_SHT) & 0x00001F00); // Queue Select, TID
|
||||
|
||||
|
||||
#ifdef CONFIG_RTL8188E
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->raid << RATE_ID_SHT) & 0x000F0000); // Rate Adaptive ID
|
||||
#else
|
||||
|
@ -1128,7 +1128,7 @@ void SetPacketTx(PADAPTER padapter)
|
|||
}
|
||||
#ifdef CONFIG_RTL8188E
|
||||
desc->txdw5 |= cpu_to_le32(RTY_LMT_EN); // retry limit enable
|
||||
desc->txdw5 |= cpu_to_le32(0x00180000); // DATA/RTS Rate Fallback Limit
|
||||
desc->txdw5 |= cpu_to_le32(0x00180000); // DATA/RTS Rate Fallback Limit
|
||||
#else
|
||||
desc->txdw5 |= cpu_to_le32(0x0001FF00); // DATA/RTS Rate Fallback Limit
|
||||
#endif
|
||||
|
@ -1192,11 +1192,11 @@ void SetPacketRx(PADAPTER pAdapter, u8 bStartRx)
|
|||
#if 1
|
||||
//ndef CONFIG_RTL8723A
|
||||
pHalData->ReceiveConfig = AAP | APM | AM | AB | APP_ICV | ADF | AMF | HTC_LOC_CTRL | APP_MIC | APP_PHYSTS;
|
||||
|
||||
|
||||
pHalData->ReceiveConfig |= ACRC32;
|
||||
|
||||
|
||||
rtw_write32(pAdapter, REG_RCR, pHalData->ReceiveConfig);
|
||||
|
||||
|
||||
// Accept all data frames
|
||||
rtw_write16(pAdapter, REG_RXFLTMAP2, 0xFFFF);
|
||||
#else
|
||||
|
@ -1311,7 +1311,7 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
|
|||
if (strlen(data) == 0) { //default value
|
||||
psd_pts = 128;
|
||||
psd_start = 64;
|
||||
psd_stop = 128;
|
||||
psd_stop = 128;
|
||||
} else {
|
||||
sscanf(data, "pts=%d,start=%d,stop=%d", &psd_pts, &psd_start, &psd_stop);
|
||||
}
|
||||
|
@ -1347,7 +1347,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
_adapter *padapter = pxmitpriv->adapter;
|
||||
struct xmit_frame *pxmitframe = (struct xmit_frame*) pxmitpriv->pxmit_frame_buf;
|
||||
struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
|
||||
|
||||
|
||||
u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
|
||||
u32 num_xmit_extbuf = NR_XMIT_EXTBUFF;
|
||||
if (padapter->registrypriv.mp_mode ==0)
|
||||
|
@ -1365,7 +1365,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
for (i=0; i<num_xmit_extbuf; i++)
|
||||
{
|
||||
rtw_os_xmit_resource_free(padapter, pxmitbuf,(max_xmit_extbuf_size + XMITBUF_ALIGN_SZ));
|
||||
|
||||
|
||||
pxmitbuf++;
|
||||
}
|
||||
|
||||
|
@ -1383,12 +1383,12 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
|
||||
num_xmit_extbuf = NR_XMIT_EXTBUFF;
|
||||
}
|
||||
|
||||
|
||||
// Init xmit extension buff
|
||||
_rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue);
|
||||
|
||||
pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
|
||||
|
||||
|
||||
if (pxmitpriv->pallocated_xmit_extbuf == NULL){
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("alloc xmit_extbuf fail!\n"));
|
||||
res= _FAIL;
|
||||
|
@ -1416,13 +1416,13 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
}
|
||||
|
||||
pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), 4);
|
||||
*/
|
||||
*/
|
||||
|
||||
if ((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) {
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
pxmitbuf->phead = pxmitbuf->pbuf;
|
||||
pxmitbuf->pend = pxmitbuf->pbuf + max_xmit_extbuf_size;
|
||||
|
@ -1435,7 +1435,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
pxmitbuf->no=i;
|
||||
#endif
|
||||
pxmitbuf++;
|
||||
|
||||
|
||||
}
|
||||
|
||||
pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf;
|
||||
|
@ -1446,4 +1446,3 @@ exit:
|
|||
|
||||
|
||||
#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.
|
||||
|
@ -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);
|
||||
|
||||
|
@ -888,7 +888,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);
|
||||
|
@ -940,7 +940,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);
|
||||
|
@ -1596,7 +1596,7 @@ _func_enter_;
|
|||
//CALL the power_down function
|
||||
#ifdef PLATFORM_LINUX
|
||||
#if defined(CONFIG_RTL8712) //Linux MP insmod unknown symbol
|
||||
dev_power_down(padapter,bpwrup);
|
||||
dev_power_down(padapter,bpwrup);
|
||||
#endif
|
||||
#endif
|
||||
_irqlevel_changed_(&oldirql, RAISE);
|
||||
|
@ -1613,4 +1613,3 @@ NDIS_STATUS oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
607
core/rtw_p2p.c
607
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.
|
||||
|
@ -43,38 +43,38 @@ void ips_enter(_adapter * padapter)
|
|||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
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;
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
|
||||
}
|
||||
|
||||
int ips_leave(_adapter * padapter)
|
||||
|
@ -103,7 +103,7 @@ int ips_leave(_adapter * padapter)
|
|||
if ((_WEP40_ == psecuritypriv->dot11PrivacyAlgrthm) ||(_WEP104_ == psecuritypriv->dot11PrivacyAlgrthm))
|
||||
{
|
||||
DBG_871X("==>%s,channel(%d),processing(%x)\n",__func__,padapter->mlmeextpriv.cur_channel,pwrpriv->bips_processing);
|
||||
set_channel_bwmode(padapter, padapter->mlmeextpriv.cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
set_channel_bwmode(padapter, padapter->mlmeextpriv.cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
for (keyid=0;keyid<4;keyid++){
|
||||
if (pmlmepriv->key_mask & BIT(keyid)){
|
||||
if (keyid == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
|
@ -113,7 +113,7 @@ int ips_leave(_adapter * padapter)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DBG_871X("==> ips_leave.....LED(0x%08x)...\n",rtw_read32(padapter,0x4c));
|
||||
pwrpriv->bips_processing = _FALSE;
|
||||
|
||||
|
@ -130,7 +130,7 @@ int ips_leave(_adapter * padapter)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
extern void autosuspend_enter(_adapter* padapter);
|
||||
extern void autosuspend_enter(_adapter* padapter);
|
||||
extern int autoresume_enter(_adapter* padapter);
|
||||
#endif
|
||||
|
||||
|
@ -216,9 +216,9 @@ void rtw_ps_processor(_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 (padapter->pwrctrlpriv.bHWPwrPindetect)
|
||||
|
||||
//DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca));
|
||||
if (padapter->pwrctrlpriv.bHWPwrPindetect)
|
||||
{
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if (padapter->registrypriv.usbss_enable)
|
||||
|
@ -235,14 +235,14 @@ void rtw_ps_processor(_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(_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
|
||||
|
||||
|
@ -291,9 +291,9 @@ void rtw_ps_processor(_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;
|
||||
|
||||
|
@ -305,12 +305,12 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x) call autosuspend_enter\n",__func__,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)
|
||||
{
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
#endif //defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
ips_enter(padapter);
|
||||
ips_enter(padapter);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -448,11 +448,11 @@ u8 PS_RDY_CHECK(_adapter * padapter)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -479,7 +479,7 @@ u8 PS_RDY_CHECK(_adapter * padapter)
|
|||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
if (!rtw_cfg80211_pwr_mgmt(padapter))
|
||||
return _FALSE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
@ -681,11 +681,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)
|
||||
|
@ -708,7 +708,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)
|
||||
{
|
||||
|
@ -769,7 +769,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 PADAPTER Adapter)
|
||||
{
|
||||
|
@ -795,7 +795,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
LPS_Leave_check(Adapter);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -817,12 +817,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 && CONFIG_RTL8188E
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
|
@ -844,7 +844,7 @@ _func_enter_;
|
|||
start_time = rtw_get_current_time();
|
||||
|
||||
rtw_yield_os();
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
@ -1020,13 +1020,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.
|
||||
|
@ -1073,7 +1073,7 @@ _func_enter_;
|
|||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1347,7 +1347,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
|
||||
|
||||
|
@ -1355,7 +1355,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;
|
||||
|
||||
|
@ -1414,7 +1414,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);
|
||||
}
|
||||
|
@ -1444,16 +1444,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
|
||||
|
@ -1468,7 +1468,7 @@ static void rtw_early_suspend(struct early_suspend *h)
|
|||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
DBG_871X("%s\n",__func__);
|
||||
|
||||
|
||||
//jeff: do nothing but set do_late_resume to false
|
||||
pwrpriv->do_late_resume = _FALSE;
|
||||
}
|
||||
|
@ -1495,9 +1495,9 @@ 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)
|
||||
|
@ -1506,7 +1506,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
|
||||
pwrpriv->do_late_resume = _FALSE;
|
||||
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
unregister_early_suspend(&pwrpriv->early_suspend);
|
||||
|
||||
pwrpriv->early_suspend.suspend = NULL;
|
||||
|
@ -1522,7 +1522,7 @@ static void rtw_early_suspend(android_early_suspend_t *h)
|
|||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
DBG_871X("%s\n",__func__);
|
||||
|
||||
|
||||
//jeff: do nothing but set do_late_resume to false
|
||||
pwrpriv->do_late_resume = _FALSE;
|
||||
}
|
||||
|
@ -1549,7 +1549,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)
|
||||
|
@ -1558,7 +1558,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
|
||||
pwrpriv->do_late_resume = _FALSE;
|
||||
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
android_unregister_early_suspend(&pwrpriv->early_suspend);
|
||||
|
||||
pwrpriv->early_suspend.suspend = NULL;
|
||||
|
@ -1570,7 +1570,7 @@ u8 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val)
|
|||
{
|
||||
u8 bResult = _TRUE;
|
||||
rtw_hal_intf_ps_func(padapter,efunc_id,val);
|
||||
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -1591,7 +1591,7 @@ inline void rtw_set_ips_deny(_adapter *padapter, u32 ms)
|
|||
int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
int ret = _SUCCESS;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
|
@ -1639,12 +1639,12 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
#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);
|
||||
|
@ -1657,9 +1657,9 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
#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)
|
||||
|
@ -1676,7 +1676,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
DBG_8192C("======> autoresume fail.............\n");
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -1701,9 +1701,9 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
){
|
||||
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;
|
||||
}
|
||||
|
@ -1717,9 +1717,9 @@ exit:
|
|||
|
||||
int rtw_pm_set_lps(_adapter *padapter, u8 mode)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret = 0;
|
||||
struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
|
||||
|
||||
|
||||
if ( mode < PS_MODE_NUM )
|
||||
{
|
||||
if (pwrctrlpriv->power_mgnt !=mode)
|
||||
|
@ -1752,7 +1752,7 @@ int rtw_pm_set_ips(_adapter *padapter, u8 mode)
|
|||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
DBG_871X("%s %s\n", __func__, 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", __func__, "IPS_NONE");
|
||||
|
@ -1764,5 +1764,3 @@ int rtw_pm_set_ips(_adapter *padapter, u8 mode)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
299
core/rtw_recv.c
299
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.
|
||||
|
@ -90,7 +90,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;
|
||||
|
@ -154,7 +154,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
|
||||
|
@ -231,7 +231,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);
|
||||
|
@ -263,8 +263,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
|
||||
|
||||
|
||||
|
@ -338,7 +338,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);
|
||||
|
@ -368,7 +368,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_;
|
||||
|
@ -424,7 +424,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
|
||||
|
@ -434,27 +434,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;
|
||||
|
@ -468,7 +468,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
|
||||
|
@ -493,7 +493,7 @@ sint recvframe_chkmic(_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);
|
||||
|
@ -516,11 +516,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;
|
||||
|
@ -585,7 +585,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));
|
||||
|
@ -654,13 +654,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)))
|
||||
|
@ -668,7 +668,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
|
||||
|
@ -714,12 +714,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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
|
@ -738,7 +738,7 @@ union recv_frame * portctrl(_adapter *adapter,union recv_frame * precv_frame)
|
|||
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_;
|
||||
|
@ -902,13 +902,13 @@ void process_pwrbit_data(_adapter *padapter, union recv_frame *precv_frame)
|
|||
void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame);
|
||||
void process_wmmps_data(_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
|
||||
|
@ -921,15 +921,15 @@ void process_wmmps_data(_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:
|
||||
|
@ -948,7 +948,7 @@ void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame)
|
|||
case 3:
|
||||
default:
|
||||
wmmps_ac = psta->uapsd_be&BIT(1);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if (wmmps_ac)
|
||||
|
@ -964,11 +964,11 @@ void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame)
|
|||
issue_qos_nulldata(padapter, psta->hwaddr, (u16)pattrib->priority, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
@ -985,11 +985,11 @@ sint OnTDLS(_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)
|
||||
|
@ -999,14 +999,14 @@ sint OnTDLS(_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:
|
||||
|
@ -1033,7 +1033,7 @@ sint OnTDLS(_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) )
|
||||
{
|
||||
|
@ -1061,7 +1061,7 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame)
|
|||
|
||||
exit:
|
||||
return ret;
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1112,14 +1112,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;
|
||||
|
@ -1232,12 +1232,12 @@ _func_enter_;
|
|||
ret= OnTDLS(adapter, precv_frame);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
sta_addr = pattrib->src;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_TDLS
|
||||
{
|
||||
|
@ -1333,7 +1333,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);
|
||||
|
@ -1342,7 +1342,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 )
|
||||
)
|
||||
{
|
||||
|
@ -1353,7 +1353,7 @@ _func_enter_;
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s SA="MAC_FMT", myhwaddr="MAC_FMT"\n",
|
||||
__func__, MAC_ARG(pattrib->src), MAC_ARG(myhwaddr));
|
||||
#endif
|
||||
#endif
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1459,11 +1459,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", __func__, get_fwstate(pmlmepriv));
|
||||
|
@ -1489,9 +1489,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_;
|
||||
|
@ -1558,11 +1558,11 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -1576,12 +1576,12 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
|||
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;
|
||||
|
@ -1608,32 +1608,32 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
|||
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;
|
||||
|
||||
_enter_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
|
||||
_enter_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
|
||||
xmitframe_phead = get_list_head(&psta->sleep_q);
|
||||
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);
|
||||
|
@ -1651,12 +1651,12 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
//DBG_871X("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap);
|
||||
|
||||
_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);
|
||||
|
||||
if (psta->sleepq_len==0)
|
||||
{
|
||||
|
@ -1665,10 +1665,10 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
|||
//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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1685,24 +1685,24 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
|
||||
|
||||
_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
return _FAIL;
|
||||
|
@ -1738,7 +1738,7 @@ sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame)
|
|||
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++;
|
||||
}
|
||||
}
|
||||
|
@ -1750,7 +1750,7 @@ sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame)
|
|||
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);
|
||||
|
@ -1787,7 +1787,7 @@ sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame)
|
|||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
pattrib->priority=0;
|
||||
pattrib->hdrlen = pattrib->to_fr_ds==3 ? 30 : 24;
|
||||
|
||||
|
@ -1808,8 +1808,8 @@ sint validate_recv_data_frame(_adapter *adapter, union recv_frame *precv_frame)
|
|||
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;
|
||||
|
@ -1886,11 +1886,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;
|
||||
|
@ -2056,7 +2056,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));
|
||||
|
@ -2077,7 +2077,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));
|
||||
|
@ -2110,7 +2110,7 @@ _func_enter_;
|
|||
external_len = 2;
|
||||
else
|
||||
external_len= 0;
|
||||
|
||||
|
||||
wai_pkt = rtw_wapi_is_wai_packet(adapter,ptr);
|
||||
|
||||
phdr->bIsWaiPacket = wai_pkt;
|
||||
|
@ -2175,7 +2175,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe)
|
|||
u8 bsnaphdr;
|
||||
u8 *psnap_type;
|
||||
struct ieee80211_snap_hdr *psnap;
|
||||
|
||||
|
||||
sint ret=_SUCCESS;
|
||||
_adapter *adapter =precvframe->u.hdr.adapter;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
@ -2186,7 +2186,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);
|
||||
|
@ -2194,7 +2194,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)){
|
||||
|
@ -2215,9 +2215,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;
|
||||
|
||||
|
@ -2239,7 +2239,7 @@ _func_enter_;
|
|||
_rtw_memcpy(ptr+12, &len, 2);
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
@ -2269,7 +2269,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;
|
||||
|
@ -2661,9 +2661,9 @@ _func_exit_;
|
|||
|
||||
int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
#if defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) //for amsdu TP improvement,Creator: Thomas
|
||||
#if defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) //for amsdu TP improvement,Creator: Thomas
|
||||
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;
|
||||
|
@ -2675,7 +2675,7 @@ int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
|
|||
_queue *pfree_recv_queue = &(precvpriv->free_recv_queue);
|
||||
int ret = _SUCCESS;
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
struct mbuf *sub_m=NULL, *subframes[MAX_SUBFRAME_COUNT];
|
||||
struct mbuf *sub_m=NULL, *subframes[MAX_SUBFRAME_COUNT];
|
||||
u8 *ptr,offset;
|
||||
#endif //PLATFORM_FREEBSD
|
||||
nr_subframes = 0;
|
||||
|
@ -2683,7 +2683,7 @@ int amsdu_to_msdu(_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);
|
||||
|
@ -2694,7 +2694,7 @@ int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
|
|||
pdata = prframe->u.hdr.rx_data;
|
||||
|
||||
while (a_len > ETH_HLEN) {
|
||||
|
||||
|
||||
/* Offset 12 denote 2 mac address */
|
||||
//nSubframe_Length = ntohs(*((u16*)(pdata + 12)));
|
||||
nSubframe_Length = RTW_GET_BE16(pdata + 12);
|
||||
|
@ -2738,13 +2738,13 @@ int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
|
|||
#else // PLATFORM_FREEBSD
|
||||
|
||||
//PLATFORM_FREEBSD
|
||||
//Allocate a mbuff,
|
||||
//Allocate a mbuff,
|
||||
//sub_m =m_devget(pdata, nSubframe_Length+12, 12, padapter->pifp,NULL);
|
||||
sub_m =m_devget(pdata, nSubframe_Length+ETH_HLEN, ETHER_ALIGN, padapter->pifp,NULL);
|
||||
|
||||
pdata += ETH_HLEN;
|
||||
a_len -= ETH_HLEN;
|
||||
#endif // PLATFORM_FREEBSD
|
||||
#endif // PLATFORM_FREEBSD
|
||||
|
||||
#ifndef PLATFORM_FREEBSD
|
||||
//sub_skb->dev = padapter->pnetdev;
|
||||
|
@ -2823,14 +2823,14 @@ int amsdu_to_msdu(_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
|
||||
dev_kfree_skb_any(sub_skb);
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_BR_EXT
|
||||
|
||||
|
@ -2891,9 +2891,9 @@ int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
|
|||
taskqueue_enqueue(taskqueue_thread, &precvpriv->rx_indicate_tasklet);
|
||||
}
|
||||
#else // CONFIG_RX_INDICATE_QUEUE
|
||||
(*padapter->pifp->if_input)(padapter->pifp, sub_m);
|
||||
(*padapter->pifp->if_input)(padapter->pifp, sub_m);
|
||||
#endif // CONFIG_RX_INDICATE_QUEUE
|
||||
}
|
||||
}
|
||||
|
||||
#endif //PLATFORM_FREEBSD
|
||||
}
|
||||
|
@ -2902,9 +2902,9 @@ exit:
|
|||
|
||||
prframe->u.hdr.len=0;
|
||||
rtw_free_recvframe(prframe, pfree_recv_queue);//free this recv_frame
|
||||
|
||||
|
||||
return ret;
|
||||
#else // || defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD)
|
||||
#else // || defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD)
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
_irqL irql;
|
||||
#endif //PLATFORM_WINDOWS
|
||||
|
@ -3071,7 +3071,7 @@ exit:
|
|||
{
|
||||
#ifdef PLATFORM_LINUX
|
||||
_pkt *pskb = pnrframe->u.hdr.pkt;
|
||||
#endif //PLATFORM_LINUX
|
||||
#endif //PLATFORM_LINUX
|
||||
_rtw_init_listhead(&pnrframe_new->u.hdr.list);
|
||||
|
||||
pnrframe_new->u.hdr.len=0;
|
||||
|
@ -3154,7 +3154,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", __func__,
|
||||
DBG_871X("%s IndicateSeq: %d > NewSeq: %d\n", __func__,
|
||||
preorder_ctrl->indicate_seq, seq_num);
|
||||
#endif
|
||||
|
||||
|
@ -3277,7 +3277,7 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
|
|||
//_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);
|
||||
|
||||
// Handling some condition for forced indicate case.
|
||||
|
@ -3285,10 +3285,10 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
|
|||
{
|
||||
if (rtw_is_list_empty(phead))
|
||||
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", __func__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
|
@ -3299,7 +3299,7 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
|
|||
// 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;
|
||||
|
||||
|
@ -3329,9 +3329,9 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
|
|||
if ((padapter->bDriverStopped == _FALSE) &&
|
||||
(padapter->bSurpriseRemoved == _FALSE))
|
||||
{
|
||||
|
||||
|
||||
rtw_recv_indicatepkt(padapter, prframe);//indicate this recv_frame
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if (pattrib->amsdu==1)
|
||||
|
@ -3412,34 +3412,34 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
|
|||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s pattrib->qos !=1\n", __func__);
|
||||
#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", __func__, __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", __func__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
#endif
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_RECV_REORDERING_CTRL
|
||||
//indicate this recv_frame
|
||||
|
@ -3498,11 +3498,11 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s check_indicate_seq fail\n", __func__);
|
||||
#endif
|
||||
|
||||
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
|
||||
|
||||
|
||||
goto _success_exit;
|
||||
}
|
||||
|
||||
|
@ -3574,7 +3574,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);
|
||||
|
@ -3598,7 +3598,7 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe)
|
|||
|
||||
#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
|
||||
|
@ -3612,7 +3612,7 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe)
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s recv_indicatepkt_reorder error!\n", __func__);
|
||||
#endif
|
||||
|
||||
|
||||
if ((padapter->bDriverStopped == _FALSE) &&
|
||||
(padapter->bSurpriseRemoved == _FALSE))
|
||||
{
|
||||
|
@ -3663,7 +3663,7 @@ int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe)
|
|||
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
#endif //CONFIG_MP_INCLUDED
|
||||
|
@ -3708,7 +3708,7 @@ int recv_func_posthandle(_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;
|
||||
|
@ -3748,7 +3748,7 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s recvframe_chk_defrag: drop pkt\n", __func__);
|
||||
#endif
|
||||
goto _recv_data_drop;
|
||||
goto _recv_data_drop;
|
||||
}
|
||||
|
||||
prframe=portctrl(padapter, prframe);
|
||||
|
@ -3804,7 +3804,7 @@ int recv_func_posthandle(_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", __func__);
|
||||
#endif
|
||||
|
@ -3879,7 +3879,7 @@ int recv_func(_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 &&
|
||||
|
@ -3890,7 +3890,7 @@ int recv_func(_adapter *padapter, union recv_frame *rframe)
|
|||
DBG_871X("%s: no key, enqueue uc_swdec_pending_queue\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
ret = recv_func_posthandle(padapter, rframe);
|
||||
}
|
||||
|
||||
|
@ -3945,7 +3945,7 @@ _func_exit_;
|
|||
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
||||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
struct recv_priv *recvpriv = &adapter->recvpriv;
|
||||
|
||||
|
||||
u32 tmp_s, tmp_q;
|
||||
u8 avg_signal_strength = 0;
|
||||
u8 avg_signal_qual = 0;
|
||||
|
@ -3965,7 +3965,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;
|
||||
|
@ -4009,9 +4009,6 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
|||
}
|
||||
}
|
||||
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,87 +1,85 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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>
|
||||
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
void sreset_init_value(_adapter *padapter)
|
||||
{
|
||||
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;
|
||||
}
|
||||
void sreset_reset_value(_adapter *padapter)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
u8 sreset_get_wifi_status(_adapter *padapter)
|
||||
{
|
||||
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",__func__,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",__func__,status);
|
||||
|
||||
//status restore
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void sreset_set_wifi_error_status(_adapter *padapter, u32 status)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = status;
|
||||
}
|
||||
#endif /* defined(DBG_CONFIG_ERROR_DETECT) */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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>
|
||||
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
void sreset_init_value(_adapter *padapter)
|
||||
{
|
||||
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;
|
||||
}
|
||||
void sreset_reset_value(_adapter *padapter)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
u8 sreset_get_wifi_status(_adapter *padapter)
|
||||
{
|
||||
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",__func__,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",__func__,status);
|
||||
|
||||
//status restore
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void sreset_set_wifi_error_status(_adapter *padapter, u32 status)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = status;
|
||||
}
|
||||
#endif /* defined(DBG_CONFIG_ERROR_DETECT) */
|
||||
|
|
|
@ -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.
|
||||
|
@ -48,24 +48,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;
|
||||
|
@ -78,17 +78,17 @@ _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
|
||||
|
||||
_func_exit_;
|
||||
#endif // CONFIG_AP_MODE
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
|
@ -97,20 +97,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);
|
||||
|
@ -118,7 +118,7 @@ _func_enter_;
|
|||
|
||||
psta = (struct sta_info *)(pstapriv->pstainfo_buf);
|
||||
|
||||
|
||||
|
||||
for (i = 0; i < NUM_STA; i++)
|
||||
{
|
||||
_rtw_init_stainfo(psta);
|
||||
|
@ -130,7 +130,7 @@ _func_enter_;
|
|||
psta++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
|
@ -144,7 +144,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.
|
||||
|
@ -152,15 +152,15 @@ _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
|
||||
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)
|
||||
|
@ -192,12 +192,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);
|
||||
|
||||
|
@ -217,8 +217,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_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -229,14 +229,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);
|
||||
|
@ -244,10 +244,10 @@ _func_enter_;
|
|||
|
||||
rtw_mfree_stainfo(psta);
|
||||
}
|
||||
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
|
@ -276,53 +276,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;
|
||||
|
@ -332,11 +332,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);
|
||||
|
||||
if (_rtw_queue_empty(pfree_sta_queue) == _TRUE)
|
||||
|
@ -347,13 +347,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);
|
||||
|
||||
_rtw_memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
|
||||
|
@ -364,7 +364,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]);
|
||||
|
@ -387,7 +387,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);
|
||||
|
@ -408,15 +408,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", __func__, __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;
|
||||
|
||||
|
@ -429,11 +429,11 @@ _func_enter_;
|
|||
//init for DM
|
||||
psta->rssi_stat.UndecoratedSmoothedPWDB = (-1);
|
||||
psta->rssi_stat.UndecoratedSmoothedCCK = (-1);
|
||||
|
||||
|
||||
/* init for the sequence number of received management frame */
|
||||
psta->RxMgmtFrameSeqNum = 0xffff;
|
||||
}
|
||||
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
@ -446,7 +446,7 @@ _func_exit_;
|
|||
|
||||
// using pstapriv->sta_hash_lock to protect
|
||||
u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
|
||||
{
|
||||
{
|
||||
int i;
|
||||
_irqL irqL0;
|
||||
_queue *pfree_sta_queue;
|
||||
|
@ -456,8 +456,8 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
|
|||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (psta == NULL)
|
||||
goto exit;
|
||||
|
||||
|
@ -465,16 +465,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;
|
||||
|
||||
|
||||
//_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
|
||||
|
@ -482,7 +482,7 @@ _func_enter_;
|
|||
rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));
|
||||
|
||||
//_exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
|
||||
|
||||
|
||||
//_enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
|
||||
|
||||
|
@ -508,14 +508,14 @@ _func_enter_;
|
|||
rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
|
||||
|
||||
//_exit_critical_bh(&(pxmitpriv->be_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
|
||||
_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
|
||||
_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
|
||||
|
@ -539,42 +539,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);
|
||||
|
@ -583,9 +583,9 @@ _func_enter_;
|
|||
pstapriv->auth_list_cnt--;
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
|
||||
|
||||
psta->expire_to = 0;
|
||||
|
||||
|
||||
psta->sleepq_ac_len = 0;
|
||||
psta->qos_info = 0;
|
||||
|
||||
|
@ -598,9 +598,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);
|
||||
|
||||
|
@ -608,26 +608,26 @@ _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
|
||||
|
||||
_enter_critical_bh(&(pfree_sta_queue->lock), &irqL0);
|
||||
rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue));
|
||||
_exit_critical_bh(&(pfree_sta_queue->lock), &irqL0);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// free all stainfo which in sta_hash[all]
|
||||
|
@ -639,8 +639,8 @@ void rtw_free_all_stainfo(_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;
|
||||
|
@ -651,24 +651,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_;
|
||||
|
||||
}
|
||||
|
||||
|
@ -681,7 +681,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;
|
||||
|
@ -692,7 +692,7 @@ _func_enter_;
|
|||
|
||||
if (hwaddr==NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
if (IS_MCAST(hwaddr))
|
||||
{
|
||||
addr = bc_addr;
|
||||
|
@ -705,17 +705,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;
|
||||
}
|
||||
|
@ -724,26 +724,26 @@ _func_enter_;
|
|||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return psta;
|
||||
|
||||
|
||||
}
|
||||
|
||||
u32 rtw_init_bcmc_stainfo(_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"));
|
||||
|
@ -763,9 +763,9 @@ _func_enter_;
|
|||
|
||||
_exit_critical(&pstapending->lock, &irqL0);
|
||||
*/
|
||||
|
||||
|
||||
exit:
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
@ -773,12 +773,12 @@ _func_exit_;
|
|||
|
||||
struct sta_info* rtw_get_bcmc_stainfo(_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;
|
||||
|
||||
}
|
||||
|
@ -794,10 +794,10 @@ u8 rtw_access_ctrl(_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);
|
||||
|
@ -810,15 +810,15 @@ u8 rtw_access_ctrl(_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;
|
||||
|
@ -826,11 +826,10 @@ u8 rtw_access_ctrl(_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
679
core/rtw_xmit.c
679
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