mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-10 07:29:40 +00:00
rtl8188eu: Remove all trailing spaces from code
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
8db176767f
commit
bb33327257
190 changed files with 53569 additions and 53764 deletions
7
Makefile
7
Makefile
|
@ -82,7 +82,7 @@ OUTSRC_FILES := hal/odm_debug.o \
|
|||
hal/odm_HWConfig.o\
|
||||
hal/odm.o\
|
||||
hal/HalPhyRf.o
|
||||
|
||||
|
||||
HAL_COMM_FILES := hal/rtl8188e_xmit.o\
|
||||
hal/rtl8188e_sreset.o
|
||||
|
||||
|
@ -104,7 +104,7 @@ endif
|
|||
PWRSEQ_FILES := hal/HalPwrSeqCmd.o \
|
||||
hal/Hal8188EPwrSeq.o
|
||||
|
||||
CHIP_FILES += $(HAL_COMM_FILES) $(OUTSRC_FILES) $(PWRSEQ_FILES)
|
||||
CHIP_FILES += $(HAL_COMM_FILES) $(OUTSRC_FILES) $(PWRSEQ_FILES)
|
||||
|
||||
HCI_NAME = usb
|
||||
|
||||
|
@ -481,7 +481,7 @@ endif
|
|||
ifeq ($(CONFIG_PLATFORM_SZEBOOK), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN
|
||||
ARCH:=arm
|
||||
CROSS_COMPILE:=/opt/crosstool2/bin/armeb-unknown-linux-gnueabi-
|
||||
CROSS_COMPILE:=/opt/crosstool2/bin/armeb-unknown-linux-gnueabi-
|
||||
KVER:= 2.6.31.6
|
||||
KSRC:= ../code/linux-2.6.31.6-2020/
|
||||
endif
|
||||
|
@ -654,4 +654,3 @@ clean: $(clean_more)
|
|||
cd hal ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
endif
|
||||
|
||||
|
|
5919
core/rtw_ap.c
5919
core/rtw_ap.c
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -231,10 +231,10 @@ static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag,
|
|||
{
|
||||
while (len > 0) {
|
||||
if (*data == tag && *(data+1) == len8b && len >= len8b*8)
|
||||
return data+2;
|
||||
|
||||
len -= (*(data+1))*8;
|
||||
data += (*(data+1))*8;
|
||||
return data+2;
|
||||
|
||||
len -= (*(data+1))*8;
|
||||
data += (*(data+1))*8;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -244,16 +244,16 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
|||
{
|
||||
struct icmp6hdr *icmphdr = (struct icmp6hdr *)data;
|
||||
unsigned char *mac;
|
||||
|
||||
if (icmphdr->icmp6_type == NDISC_ROUTER_SOLICITATION) {
|
||||
|
||||
if (icmphdr->icmp6_type == NDISC_ROUTER_SOLICITATION) {
|
||||
if (len >= 8) {
|
||||
mac = scan_tlv(&data[8], len-8, 1, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -262,55 +262,55 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
|||
mac = scan_tlv(&data[16], len-16, 1, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) {
|
||||
if (len >= 24) {
|
||||
mac = scan_tlv(&data[24], len-24, 1, 1);
|
||||
if (mac) {
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT) {
|
||||
if (len >= 24) {
|
||||
mac = scan_tlv(&data[24], len-24, 2, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (icmphdr->icmp6_type == NDISC_REDIRECT) {
|
||||
if (len >= 40) {
|
||||
mac = scan_tlv(&data[40], len-40, 2, 1);
|
||||
if (mac) {
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Redirect, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
memcpy(mac, replace_mac, 6);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
|
||||
{
|
||||
{
|
||||
struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);
|
||||
unsigned char *dst_mac = skb->data;
|
||||
|
||||
|
@ -320,7 +320,7 @@ static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
|
|||
dst_mac[0] = 0x33;
|
||||
dst_mac[1] = 0x33;
|
||||
memcpy(&dst_mac[2], &iph->daddr.s6_addr32[3], 4);
|
||||
#if defined(__LINUX_2_6__)
|
||||
#if defined(__LINUX_2_6__)
|
||||
/*modified by qinjunjie,warning:should not remove next line*/
|
||||
skb->pkt_type = PACKET_MULTICAST;
|
||||
#endif
|
||||
|
@ -372,10 +372,10 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
|||
networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10] ^
|
||||
networkAddr[11] ^ networkAddr[12] ^ networkAddr[13] ^ networkAddr[14] ^ networkAddr[15] ^
|
||||
networkAddr[16];
|
||||
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
else
|
||||
{
|
||||
unsigned long x = 0;
|
||||
|
@ -441,8 +441,8 @@ static int __nat25_db_network_lookup_and_replace(struct adapter *priv,
|
|||
atomic_inc(&db->use_count);
|
||||
|
||||
#ifdef CL_IPV6_PASS
|
||||
DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
|
||||
"%02x%02x%02x%02x%02x%02x\n",
|
||||
DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
|
||||
"%02x%02x%02x%02x%02x%02x\n",
|
||||
db->macAddr[0],
|
||||
db->macAddr[1],
|
||||
db->macAddr[2],
|
||||
|
@ -466,7 +466,7 @@ static int __nat25_db_network_lookup_and_replace(struct adapter *priv,
|
|||
db->networkAddr[14],
|
||||
db->networkAddr[15],
|
||||
db->networkAddr[16]);
|
||||
#else
|
||||
#else
|
||||
DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
|
||||
db->macAddr[0],
|
||||
db->macAddr[1],
|
||||
|
@ -633,7 +633,7 @@ void nat25_db_cleanup(struct adapter *priv)
|
|||
int i;
|
||||
_irqL irqL;
|
||||
_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
|
||||
for(i=0; i<NAT25_HASH_SIZE; i++)
|
||||
{
|
||||
struct nat25_network_db_entry *f;
|
||||
|
@ -664,7 +664,7 @@ void nat25_db_expire(struct adapter *priv)
|
|||
int i;
|
||||
_irqL irqL;
|
||||
_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
|
||||
//if(!priv->ethBrExtInfo.nat25_disable)
|
||||
{
|
||||
for (i=0; i<NAT25_HASH_SIZE; i++)
|
||||
|
@ -1405,7 +1405,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
}
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* Handle IPV6 frame */
|
||||
/* Handle IPV6 frame */
|
||||
/*---------------------------------------------------*/
|
||||
#ifdef CL_IPV6_PASS
|
||||
else if(protocol == __constant_htons(ETH_P_IPV6))
|
||||
|
@ -1422,13 +1422,13 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
{
|
||||
case NAT25_CHECK:
|
||||
if (skb->data[0] & 1)
|
||||
return 0;
|
||||
return 0;
|
||||
return -1;
|
||||
|
||||
case NAT25_INSERT:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Insert IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3],
|
||||
iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7],
|
||||
iph->daddr.s6_addr16[0],iph->daddr.s6_addr16[1],iph->daddr.s6_addr16[2],iph->daddr.s6_addr16[3],
|
||||
|
@ -1439,10 +1439,10 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
|
||||
__nat25_db_print(priv);
|
||||
|
||||
if (iph->nexthdr == IPPROTO_ICMPV6 &&
|
||||
if (iph->nexthdr == IPPROTO_ICMPV6 &&
|
||||
skb->len > (ETH_HLEN + sizeof(*iph) + 4)) {
|
||||
if (update_nd_link_layer_addr(skb->data + ETH_HLEN + sizeof(*iph),
|
||||
skb->len - ETH_HLEN - sizeof(*iph), GET_MY_HWADDR(priv))) {
|
||||
if (update_nd_link_layer_addr(skb->data + ETH_HLEN + sizeof(*iph),
|
||||
skb->len - ETH_HLEN - sizeof(*iph), GET_MY_HWADDR(priv))) {
|
||||
struct icmp6hdr *hdr = (struct icmp6hdr *)(skb->data + ETH_HLEN + sizeof(*iph));
|
||||
hdr->icmp6_cksum = 0;
|
||||
hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr,
|
||||
|
@ -1450,26 +1450,26 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
IPPROTO_ICMPV6,
|
||||
csum_partial((__u8 *)hdr, iph->payload_len, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
case NAT25_LOOKUP:
|
||||
DEBUG_INFO("NAT25: Lookup IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3],
|
||||
iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7],
|
||||
iph->daddr.s6_addr16[0],iph->daddr.s6_addr16[1],iph->daddr.s6_addr16[2],iph->daddr.s6_addr16[3],
|
||||
iph->daddr.s6_addr16[4],iph->daddr.s6_addr16[5],iph->daddr.s6_addr16[6],iph->daddr.s6_addr16[7]);
|
||||
|
||||
|
||||
|
||||
__nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->daddr);
|
||||
if (!__nat25_db_network_lookup_and_replace(priv, skb, networkAddr)) {
|
||||
#ifdef SUPPORT_RX_UNI2MCAST
|
||||
#ifdef SUPPORT_RX_UNI2MCAST
|
||||
if (iph->daddr.s6_addr[0] == 0xff)
|
||||
convert_ipv6_mac_to_mc(skb);
|
||||
#endif
|
||||
convert_ipv6_mac_to_mc(skb);
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
@ -1530,12 +1530,12 @@ int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb)
|
|||
(*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_IP)) &&
|
||||
!memcmp(priv->scdb_ip, skb->data+ETH_HLEN+16, 4)) {
|
||||
memcpy(skb->data, priv->scdb_mac, ETH_ALEN);
|
||||
|
||||
|
||||
_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
}
|
||||
else {
|
||||
_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
|
||||
retval = nat25_db_handle(priv, skb, NAT25_LOOKUP);
|
||||
}
|
||||
}
|
||||
|
@ -1664,4 +1664,3 @@ void *scdb_findEntry(struct adapter *priv, unsigned char *macAddr,
|
|||
}
|
||||
|
||||
#endif // CONFIG_BR_EXT
|
||||
|
||||
|
|
871
core/rtw_cmd.c
871
core/rtw_cmd.c
File diff suppressed because it is too large
Load diff
349
core/rtw_debug.c
349
core/rtw_debug.c
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -67,11 +67,11 @@ int proc_get_drv_version(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "%s\n", DRIVERVERSION);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ int proc_get_drv_version(char *page, char **start,
|
|||
int proc_get_mstat(char *page, char **start,
|
||||
off_t offset, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
len += _rtw_mstat_dump(page+len, count-len);
|
||||
|
@ -110,9 +110,9 @@ int proc_set_write_reg(struct file *file, const char *buffer,
|
|||
{
|
||||
DBG_871X("argument size is less than 3\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%x %x %x", &addr, &val, &len);
|
||||
|
||||
|
@ -124,23 +124,23 @@ int proc_set_write_reg(struct file *file, const char *buffer,
|
|||
switch(len)
|
||||
{
|
||||
case 1:
|
||||
rtw_write8(padapter, addr, (u8)val);
|
||||
rtw_write8(padapter, addr, (u8)val);
|
||||
break;
|
||||
case 2:
|
||||
rtw_write16(padapter, addr, (u16)val);
|
||||
rtw_write16(padapter, addr, (u16)val);
|
||||
break;
|
||||
case 4:
|
||||
rtw_write32(padapter, addr, val);
|
||||
rtw_write32(padapter, addr, val);
|
||||
break;
|
||||
default:
|
||||
DBG_871X("error write length=%d", len);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static u32 proc_get_read_addr=0xeeeeeeee;
|
||||
|
@ -149,21 +149,21 @@ static u32 proc_get_read_len=0x4;
|
|||
int proc_get_read_reg(char *page, char **start,
|
||||
off_t offset, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
int len = 0;
|
||||
|
||||
if(proc_get_read_addr==0xeeeeeeee)
|
||||
{
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
}
|
||||
|
||||
switch(proc_get_read_len)
|
||||
{
|
||||
case 1:
|
||||
case 1:
|
||||
len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr));
|
||||
break;
|
||||
case 2:
|
||||
|
@ -192,9 +192,9 @@ int proc_set_read_reg(struct file *file, const char *buffer,
|
|||
{
|
||||
DBG_871X("argument size is less than 2\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%x %x", &addr, &len);
|
||||
|
||||
|
@ -204,10 +204,10 @@ int proc_set_read_reg(struct file *file, const char *buffer,
|
|||
}
|
||||
|
||||
proc_get_read_addr = addr;
|
||||
|
||||
|
||||
proc_get_read_len = len;
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
|
@ -219,11 +219,11 @@ int proc_get_fwstate(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "fwstate=0x%x\n", get_fwstate(pmlmepriv));
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -233,15 +233,15 @@ int proc_get_sec_info(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n",
|
||||
len += snprintf(page + len, count - len, "auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n",
|
||||
psecuritypriv->dot11AuthAlgrthm, psecuritypriv->dot11PrivacyAlgrthm,
|
||||
psecuritypriv->ndisauthtype, psecuritypriv->ndisencryptstatus);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -251,14 +251,14 @@ int proc_get_mlmext_state(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "pmlmeinfo->state=0x%x\n", pmlmeinfo->state);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -270,11 +270,11 @@ int proc_get_qos_option(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "qos_option=%d\n", pmlmepriv->qospriv.qos_option);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
|
@ -287,7 +287,7 @@ int proc_get_ht_option(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
len += snprintf(page + len, count - len, "ht_option=%d\n", pmlmepriv->htpriv.ht_option);
|
||||
|
@ -301,14 +301,14 @@ int proc_get_rf_info(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "cur_ch=%d, cur_bw=%d, cur_ch_offet=%d\n",
|
||||
len += snprintf(page + len, count - len, "cur_ch=%d, cur_bw=%d, cur_ch_offet=%d\n",
|
||||
pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset);
|
||||
|
||||
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
|
@ -332,31 +332,31 @@ int proc_get_ap_info(char *page, char **start,
|
|||
{
|
||||
int i;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
|
||||
len += snprintf(page + len, count - len, "SSID=%s\n", cur_network->network.Ssid.Ssid);
|
||||
|
||||
len += snprintf(page + len, count - len, "SSID=%s\n", cur_network->network.Ssid.Ssid);
|
||||
len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr));
|
||||
len += snprintf(page + len, count - len, "cur_channel=%d, cur_bwmode=%d, cur_ch_offset=%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset);
|
||||
len += snprintf(page + len, count - len, "cur_channel=%d, cur_bwmode=%d, cur_ch_offset=%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset);
|
||||
len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self);
|
||||
len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
|
||||
#ifdef CONFIG_80211N_HT
|
||||
len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
|
||||
len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
|
||||
len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
|
||||
len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
|
||||
len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
|
||||
len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
|
||||
len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap);
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
|
||||
for(i=0;i<16;i++)
|
||||
{
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
if(preorder_ctrl->enable)
|
||||
{
|
||||
len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
len += snprintf(page + len, count - len, "can't get sta's macaddr, cur_network's macaddr:" MAC_FMT "\n", MAC_ARG(cur_network->network.MacAddress));
|
||||
}
|
||||
|
||||
|
@ -372,15 +372,15 @@ int proc_get_adapter_state(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "bSurpriseRemoved=%d, bDriverStopped=%d\n",
|
||||
|
||||
len += snprintf(page + len, count - len, "bSurpriseRemoved=%d, bDriverStopped=%d\n",
|
||||
padapter->bSurpriseRemoved, padapter->bDriverStopped);
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int proc_get_trx_info(char *page, char **start,
|
||||
off_t offset, int count,
|
||||
int *eof, void *data)
|
||||
|
@ -392,7 +392,7 @@ int proc_get_trx_info(char *page, char **start,
|
|||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
struct hw_xmit *phwxmit;
|
||||
int len = 0;
|
||||
|
||||
|
||||
len += snprintf(page + len, count - len, "free_xmitbuf_cnt=%d, free_xmitframe_cnt=%d"
|
||||
", free_ext_xmitbuf_cnt=%d, free_xframe_ext_cnt=%d"
|
||||
", free_recvframe_cnt=%d\n",
|
||||
|
@ -400,7 +400,7 @@ int proc_get_trx_info(char *page, char **start,
|
|||
pxmitpriv->free_xmit_extbuf_cnt, pxmitpriv->free_xframe_ext_cnt,
|
||||
precvpriv->free_recvframe_cnt);
|
||||
|
||||
for(i = 0; i < 4; i++)
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
phwxmit = pxmitpriv->hwxmits + i;
|
||||
len += snprintf(page + len, count - len, "%d, hwq.accnt=%d\n", i, phwxmit->accnt);
|
||||
|
@ -427,10 +427,10 @@ int proc_get_mac_reg_dump1(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
|
||||
|
||||
for(i=0x0;i<0x300;i+=4)
|
||||
{
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
|
@ -450,12 +450,12 @@ int proc_get_mac_reg_dump2(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
|
||||
memset(page, 0, count);
|
||||
for(i=0x300;i<0x600;i+=4)
|
||||
{
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
|
@ -473,10 +473,10 @@ int proc_get_mac_reg_dump3(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
|
||||
|
||||
for(i=0x600;i<0x800;i+=4)
|
||||
{
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
|
@ -489,19 +489,19 @@ int proc_get_bb_reg_dump1(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
int len = 0;
|
||||
int i,j=1;
|
||||
int i,j=1;
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
|
||||
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
|
||||
for(i=0x800;i<0xB00;i+=4)
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
int proc_get_bb_reg_dump2(char *page, char **start,
|
||||
|
@ -509,19 +509,19 @@ int proc_get_bb_reg_dump2(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
int len = 0;
|
||||
int i,j=1;
|
||||
int i,j=1;
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
|
||||
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
|
||||
for(i=0xB00;i<0xE00;i+=4)
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
int proc_get_bb_reg_dump3(char *page, char **start,
|
||||
|
@ -529,19 +529,19 @@ int proc_get_bb_reg_dump3(char *page, char **start,
|
|||
int *eof, void *data)
|
||||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
int len = 0;
|
||||
int i,j=1;
|
||||
int i,j=1;
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
|
||||
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
|
||||
for(i=0xE00;i<0x1000;i+=4)
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
int proc_get_rf_reg_dump1(char *page, char **start,
|
||||
|
@ -553,21 +553,21 @@ int proc_get_rf_reg_dump1(char *page, char **start,
|
|||
int len = 0;
|
||||
int i,j=1,path;
|
||||
u32 value;
|
||||
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
path = 1;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0;i<0xC0;i++)
|
||||
{
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
@ -579,21 +579,21 @@ int proc_get_rf_reg_dump2(char *page, char **start,
|
|||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
int len = 0;
|
||||
int i,j=1,path;
|
||||
u32 value;
|
||||
u32 value;
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
path = 1;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0xC0;i<0x100;i++)
|
||||
{
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
@ -605,22 +605,22 @@ int proc_get_rf_reg_dump3(char *page, char **start,
|
|||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
int len = 0;
|
||||
int i,j=1,path;
|
||||
u32 value;
|
||||
u32 value;
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
path = 2;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0;i<0xC0;i++)
|
||||
{
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
@ -638,7 +638,7 @@ int proc_get_rf_reg_dump4(char *page, char **start,
|
|||
path = 2;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0xC0;i<0x100;i++)
|
||||
{
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
|
@ -646,11 +646,11 @@ int proc_get_rf_reg_dump4(char *page, char **start,
|
|||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int proc_get_rx_signal(char *page, char **start,
|
||||
off_t offset, int count,
|
||||
int *eof, void *data)
|
||||
|
@ -658,7 +658,7 @@ int proc_get_rx_signal(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len,
|
||||
|
@ -666,14 +666,14 @@ int proc_get_rx_signal(char *page, char **start,
|
|||
"rxpwdb:%d\n"
|
||||
"signal_strength:%u\n"
|
||||
"signal_qual:%u\n"
|
||||
"noise:%u\n",
|
||||
"noise:%u\n",
|
||||
padapter->recvpriv.rssi,
|
||||
padapter->recvpriv.rxpwdb,
|
||||
padapter->recvpriv.signal_strength,
|
||||
padapter->recvpriv.signal_qual,
|
||||
padapter->recvpriv.noise
|
||||
);
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -689,15 +689,15 @@ int proc_set_rx_signal(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
return -EFAULT;
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%u %u", &is_signal_dbg, &signal_strength);
|
||||
|
||||
is_signal_dbg = is_signal_dbg==0?0:1;
|
||||
|
||||
|
||||
if(is_signal_dbg && num!=2)
|
||||
return count;
|
||||
|
||||
|
||||
signal_strength = signal_strength>100?100:signal_strength;
|
||||
signal_strength = signal_strength<0?0:signal_strength;
|
||||
|
||||
|
@ -708,11 +708,11 @@ int proc_set_rx_signal(struct file *file, const char *buffer,
|
|||
DBG_871X("set %s %u\n", "DBG_SIGNAL_STRENGTH", signal_strength);
|
||||
else
|
||||
DBG_871X("set %s\n", "HW_SIGNAL_STRENGTH");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#ifdef CONFIG_80211N_HT
|
||||
|
||||
|
@ -723,9 +723,9 @@ int proc_get_ht_enable(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
if(pregpriv)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d\n",
|
||||
|
@ -748,7 +748,7 @@ int proc_set_ht_enable(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
return -EFAULT;
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
|
||||
|
@ -758,9 +758,9 @@ int proc_set_ht_enable(struct file *file, const char *buffer,
|
|||
printk("ht_enable=%d\n", pregpriv->ht_enable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int proc_get_cbw40_enable(char *page, char **start,
|
||||
|
@ -770,7 +770,7 @@ int proc_get_cbw40_enable(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
|
@ -795,7 +795,7 @@ int proc_set_cbw40_enable(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
return -EFAULT;
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
|
||||
|
@ -807,9 +807,9 @@ int proc_set_cbw40_enable(struct file *file, const char *buffer,
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int proc_get_ampdu_enable(char *page, char **start,
|
||||
|
@ -819,7 +819,7 @@ int proc_get_ampdu_enable(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
|
@ -844,7 +844,7 @@ int proc_set_ampdu_enable(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
return -EFAULT;
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
|
||||
|
@ -855,9 +855,9 @@ int proc_set_ampdu_enable(struct file *file, const char *buffer,
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
|
@ -867,9 +867,9 @@ int proc_get_two_path_rssi(char *page, char **start,
|
|||
{
|
||||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
if(padapter)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d %d\n",
|
||||
|
@ -888,7 +888,7 @@ int proc_get_rx_stbc(char *page, char **start,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
|
@ -913,7 +913,7 @@ int proc_set_rx_stbc(struct file *file, const char *buffer,
|
|||
if (count < 1)
|
||||
return -EFAULT;
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
|
||||
|
@ -923,9 +923,9 @@ int proc_set_rx_stbc(struct file *file, const char *buffer,
|
|||
printk("rx_stbc=%d\n", mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
|
@ -950,9 +950,9 @@ int proc_set_rssi_disp(struct file *file, const char *buffer,
|
|||
{
|
||||
DBG_8192C("argument size is less than 1\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%x", &enable);
|
||||
|
||||
|
@ -960,25 +960,25 @@ int proc_set_rssi_disp(struct file *file, const char *buffer,
|
|||
DBG_8192C("invalid set_rssi_disp parameter!\n");
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
if(enable)
|
||||
{
|
||||
{
|
||||
DBG_8192C("Turn On Rx RSSI Display Function\n");
|
||||
padapter->bRxRSSIDisplay = enable ;
|
||||
padapter->bRxRSSIDisplay = enable ;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_8192C("Turn Off Rx RSSI Display Function\n");
|
||||
padapter->bRxRSSIDisplay = 0 ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
int proc_get_all_sta_info(char *page, char **start,
|
||||
|
@ -993,18 +993,18 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
int i, j;
|
||||
_list *plist, *phead;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int len = 0;
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
len += snprintf(page + len, count - len, "sta_dz_bitmap=0x%x, tim_bitmap=0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap);
|
||||
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[i]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
@ -1017,9 +1017,9 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self);
|
||||
len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
|
||||
#ifdef CONFIG_80211N_HT
|
||||
len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
|
||||
len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
|
||||
len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
|
||||
len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
|
||||
len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
|
||||
len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
|
||||
len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap);
|
||||
#endif //CONFIG_80211N_HT
|
||||
len += snprintf(page + len, count - len, "sleepq_len=%d\n", psta->sleepq_len);
|
||||
|
@ -1030,30 +1030,30 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "wpa2_pairwise_cipher=0x%x\n", psta->wpa2_pairwise_cipher);
|
||||
len += snprintf(page + len, count - len, "qos_info=0x%x\n", psta->qos_info);
|
||||
len += snprintf(page + len, count - len, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy);
|
||||
|
||||
|
||||
for(j=0;j<16;j++)
|
||||
{
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[j];
|
||||
if(preorder_ctrl->enable)
|
||||
{
|
||||
len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DBG_MEMORY_LEAK
|
||||
#include <asm/atomic.h>
|
||||
|
@ -1064,12 +1064,12 @@ int proc_get_malloc_cnt(char *page, char **start,
|
|||
off_t offset, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
len += snprintf(page + len, count - len, "_malloc_cnt=%d\n", atomic_read(&_malloc_cnt));
|
||||
len += snprintf(page + len, count - len, "_malloc_size=%d\n", atomic_read(&_malloc_size));
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -1091,8 +1091,8 @@ int proc_get_best_channel(char *page, char **start,
|
|||
index_24G = i;
|
||||
if ( pmlmeext->channel_set[i].ChannelNum == 36)
|
||||
index_5G = i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) {
|
||||
// 2.4G
|
||||
if ( pmlmeext->channel_set[i].ChannelNum == 6 ) {
|
||||
|
@ -1123,11 +1123,11 @@ int proc_get_best_channel(char *page, char **start,
|
|||
}
|
||||
}
|
||||
#if 1 // debug
|
||||
len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
|
||||
len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
|
||||
pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
len += snprintf(page + len, count - len, "best_channel_5G = %d\n", best_channel_5G);
|
||||
len += snprintf(page + len, count - len, "best_channel_24G = %d\n", best_channel_24G);
|
||||
|
||||
|
@ -1208,9 +1208,9 @@ int proc_set_btcoex_dbg(struct file *file, const char *buffer,
|
|||
printk("btcoex_dbg=%d\n", BTCoexDbgLevel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif /* CONFIG_BT_COEXIST */
|
||||
|
||||
|
@ -1221,9 +1221,9 @@ int proc_get_sreset(char *page, char **start, off_t offset, int count, int *eof,
|
|||
struct net_device *dev = data;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
||||
int len = 0;
|
||||
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -1238,7 +1238,7 @@ int proc_set_sreset(struct file *file, const char *buffer, unsigned long count,
|
|||
if (count < 1)
|
||||
return -EFAULT;
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
|
||||
|
||||
int num = sscanf(tmp, "%d", &trigger_point);
|
||||
|
||||
|
@ -1247,9 +1247,9 @@ int proc_set_sreset(struct file *file, const char *buffer, unsigned long count,
|
|||
else
|
||||
sreset_set_trigger_point(padapter, trigger_point);
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
#endif /* DBG_CONFIG_ERROR_DETECT */
|
||||
|
||||
|
@ -1362,9 +1362,8 @@ int proc_set_odm_adaptivity(struct file *file, const char *buffer, unsigned long
|
|||
|
||||
rtw_odm_adaptivity_parm_set(padapter, (s8)TH_L2H_ini, TH_EDCCA_HL_diff, (s8)IGI_Base, (bool)ForceEDCCA, AdapEn_RSSI, IGI_LowerBound);
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -31,7 +31,7 @@ _func_enter_;
|
|||
rtw_udelay_os(CLOCK_RATE);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void down_clk(_adapter * padapter, u16 *x )
|
||||
|
@ -40,7 +40,7 @@ _func_enter_;
|
|||
*x = *x & ~_EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void shift_out_bits(_adapter * padapter, u16 data, u16 count)
|
||||
|
@ -78,14 +78,14 @@ _func_enter_;
|
|||
}
|
||||
x &= ~_EEDI;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
u16 shift_in_bits (_adapter * padapter)
|
||||
{
|
||||
u16 x,d=0,i;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
|
@ -111,8 +111,8 @@ _func_enter_;
|
|||
|
||||
down_clk(padapter, &x);
|
||||
}
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ _func_exit_;
|
|||
void standby(_adapter * padapter )
|
||||
{
|
||||
u8 x;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EECS | _EESK);
|
||||
|
@ -130,16 +130,16 @@ _func_enter_;
|
|||
x |= _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
u16 wait_eeprom_cmd_done(_adapter* padapter)
|
||||
{
|
||||
u8 x;
|
||||
u8 x;
|
||||
u16 i,res=_FALSE;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
standby(padapter );
|
||||
for (i=0; i<200; i++)
|
||||
for (i=0; i<200; i++)
|
||||
{
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
if (x & _EEDO){
|
||||
|
@ -148,15 +148,15 @@ _func_enter_;
|
|||
}
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
}
|
||||
exit:
|
||||
_func_exit_;
|
||||
exit:
|
||||
_func_exit_;
|
||||
return res;
|
||||
}
|
||||
|
||||
void eeprom_clean(_adapter * padapter)
|
||||
{
|
||||
u16 x;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
|
@ -178,15 +178,15 @@ _func_enter_;
|
|||
goto out;
|
||||
}
|
||||
down_clk(padapter, &x);
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void eeprom_write16(_adapter * padapter, u16 reg, u16 data)
|
||||
{
|
||||
u8 x;
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
|
@ -194,12 +194,12 @@ _func_enter_;
|
|||
rtw_write8(padapter, EE_9346CR, x);
|
||||
|
||||
shift_out_bits(padapter, EEPROM_EWEN_OPCODE, 5);
|
||||
|
||||
|
||||
if(padapter->EepromAddressSize==8) //CF+ and SDIO
|
||||
shift_out_bits(padapter, 0, 6);
|
||||
else //USB
|
||||
shift_out_bits(padapter, 0, 4);
|
||||
|
||||
|
||||
standby( padapter);
|
||||
|
||||
// Commented out by rcnjko, 2004.0
|
||||
|
@ -208,7 +208,7 @@ _func_enter_;
|
|||
// shift_out_bits(Adapter, EEPROM_ERASE_OPCODE, 3);
|
||||
// shift_out_bits(Adapter, reg, Adapter->EepromAddressSize);
|
||||
//
|
||||
// if (wait_eeprom_cmd_done(Adapter ) == FALSE)
|
||||
// if (wait_eeprom_cmd_done(Adapter ) == FALSE)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
@ -227,7 +227,7 @@ _func_enter_;
|
|||
// write the data to the selected EEPROM word.
|
||||
shift_out_bits(padapter, data, 16);
|
||||
|
||||
if (wait_eeprom_cmd_done(padapter ) == _FALSE)
|
||||
if (wait_eeprom_cmd_done(padapter ) == _FALSE)
|
||||
{
|
||||
|
||||
goto exit;
|
||||
|
@ -239,8 +239,8 @@ _func_enter_;
|
|||
shift_out_bits(padapter, reg, 4);
|
||||
|
||||
eeprom_clean(padapter );
|
||||
exit:
|
||||
_func_exit_;
|
||||
exit:
|
||||
_func_exit_;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -249,7 +249,7 @@ u16 eeprom_read16(_adapter * padapter, u16 reg) //ReadEEprom
|
|||
|
||||
u16 x;
|
||||
u16 data=0;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
|
@ -276,8 +276,8 @@ _func_enter_;
|
|||
data = shift_in_bits(padapter);
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -285,12 +285,12 @@ _func_exit_;
|
|||
|
||||
|
||||
//From even offset
|
||||
void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
|
||||
void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
|
||||
{
|
||||
|
||||
u16 x, data16;
|
||||
u32 i;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
|
@ -317,12 +317,12 @@ _func_enter_;
|
|||
{
|
||||
data16 = shift_in_bits(padapter);
|
||||
data[i] = data16 & 0xff;
|
||||
data[i+1] = data16 >>8;
|
||||
data[i+1] = data16 >>8;
|
||||
}
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
_func_exit_;
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
|
||||
|
||||
|
@ -334,7 +334,7 @@ u8 eeprom_read(_adapter * padapter, u32 addr_off, u8 sz, u8* rbuf)
|
|||
{
|
||||
u8 quotient, remainder, addr_2align_odd;
|
||||
u16 reg, stmp , i=0, idx = 0;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
reg = (u16)(addr_off >> 1);
|
||||
addr_2align_odd = (u8)(addr_off & 0x1);
|
||||
|
||||
|
@ -344,7 +344,7 @@ _func_enter_;
|
|||
rbuf[idx++] = (u8) ((stmp>>8)&0xff); //return hogh-part of the short
|
||||
reg++; sz--;
|
||||
}
|
||||
|
||||
|
||||
quotient = sz >> 1;
|
||||
remainder = sz & 0x1;
|
||||
|
||||
|
@ -354,13 +354,13 @@ _func_enter_;
|
|||
rbuf[idx++] = (u8) (stmp&0xff);
|
||||
rbuf[idx++] = (u8) ((stmp>>8)&0xff);
|
||||
}
|
||||
|
||||
|
||||
reg = reg+i;
|
||||
if(remainder){ //end of read at lower part of short : 0,2,4,6,...
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx] = (u8)(stmp & 0xff);
|
||||
rbuf[idx] = (u8)(stmp & 0xff);
|
||||
}
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
@ -369,9 +369,8 @@ _func_exit_;
|
|||
VOID read_eeprom_content(_adapter * padapter)
|
||||
{
|
||||
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
|
||||
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
|
210
core/rtw_efuse.c
210
core/rtw_efuse.c
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -77,12 +77,12 @@ BOOLEAN
|
|||
Efuse_Write1ByteToFakeContent(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value );
|
||||
IN u8 Value );
|
||||
BOOLEAN
|
||||
Efuse_Write1ByteToFakeContent(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value )
|
||||
IN u8 Value )
|
||||
{
|
||||
if(Offset >= EFUSE_MAX_HW_SIZE)
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ Efuse_Write1ByteToFakeContent(
|
|||
/*-----------------------------------------------------------------------------
|
||||
* Function: Efuse_PowerSwitch
|
||||
*
|
||||
* Overview: When we want to enable write operation, we should change to
|
||||
* Overview: When we want to enable write operation, we should change to
|
||||
* pwr on state. When we stop write, we should switch to 500k mode
|
||||
* and disable LDO 2.5V.
|
||||
*
|
||||
|
@ -112,7 +112,7 @@ Efuse_Write1ByteToFakeContent(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/17/2008 MHC Create Version 0.
|
||||
* 11/17/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
VOID
|
||||
|
@ -122,7 +122,7 @@ Efuse_PowerSwitch(
|
|||
IN u8 PwrState)
|
||||
{
|
||||
pAdapter->HalFunc.EfusePowerSwitch(pAdapter, bWrite, PwrState);
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: efuse_GetCurrentSize
|
||||
|
@ -137,7 +137,7 @@ Efuse_PowerSwitch(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/16/2008 MHC Create Version 0.
|
||||
* 11/16/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
u16
|
||||
|
@ -179,9 +179,9 @@ Efuse_CalculateWordCnts(IN u8 word_en)
|
|||
VOID
|
||||
ReadEFuseByte(
|
||||
struct adapter *Adapter,
|
||||
u16 _offset,
|
||||
u8 *pbuf,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
u16 _offset,
|
||||
u8 *pbuf,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
{
|
||||
u32 value32;
|
||||
u8 readbyte;
|
||||
|
@ -195,14 +195,14 @@ ReadEFuseByte(
|
|||
}
|
||||
|
||||
//Write Address
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff));
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff));
|
||||
readbyte = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc));
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc));
|
||||
|
||||
//Write bit 32 0
|
||||
readbyte = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f));
|
||||
|
||||
readbyte = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f));
|
||||
|
||||
//Check bit 32 read-ready
|
||||
retry = 0;
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
|
@ -219,16 +219,16 @@ ReadEFuseByte(
|
|||
// result will always stay on last data we read.
|
||||
rtw_udelay_os(50);
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
|
||||
|
||||
*pbuf = (u8)(value32 & 0xff);
|
||||
//DBG_871X("ReadEFuseByte _offset:%08u, in %d ms\n",_offset ,rtw_get_passing_time_ms(start));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// 1. Execute E-Fuse read byte operation according as map offset and
|
||||
// 1. Execute E-Fuse read byte operation according as map offset and
|
||||
// save to E-Fuse table.
|
||||
// 2. Refered from SD1 Richard.
|
||||
//
|
||||
|
@ -238,7 +238,7 @@ ReadEFuseByte(
|
|||
//
|
||||
// Created by Roger, 2008.10.21.
|
||||
//
|
||||
// 2008/12/12 MH 1. Reorganize code flow and reserve bytes. and add description.
|
||||
// 2008/12/12 MH 1. Reorganize code flow and reserve bytes. and add description.
|
||||
// 2. Add efuse utilization collect.
|
||||
// 2008/12/22 MH Read Efuse must check if we write section 1 data again!!! Sec1
|
||||
// write addr must be after sec5.
|
||||
|
@ -249,8 +249,8 @@ efuse_ReadEFuse(
|
|||
struct adapter *Adapter,
|
||||
u8 efuseType,
|
||||
u16 _offset,
|
||||
u16 _size_byte,
|
||||
u8 *pbuf,
|
||||
u16 _size_byte,
|
||||
u8 *pbuf,
|
||||
IN BOOLEAN bPseudoTest
|
||||
);
|
||||
VOID
|
||||
|
@ -258,8 +258,8 @@ efuse_ReadEFuse(
|
|||
struct adapter *Adapter,
|
||||
u8 efuseType,
|
||||
u16 _offset,
|
||||
u16 _size_byte,
|
||||
u8 *pbuf,
|
||||
u16 _size_byte,
|
||||
u8 *pbuf,
|
||||
IN BOOLEAN bPseudoTest
|
||||
)
|
||||
{
|
||||
|
@ -291,12 +291,12 @@ EFUSE_GetEfuseDefinition(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 09/23/2008 MHC Copy from WMAC.
|
||||
* 09/23/2008 MHC Copy from WMAC.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
u8
|
||||
EFUSE_Read1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
EFUSE_Read1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
IN u16 Address)
|
||||
{
|
||||
u8 data;
|
||||
|
@ -310,12 +310,12 @@ EFUSE_Read1Byte(
|
|||
if (Address < contentLen) //E-fuse 512Byte
|
||||
{
|
||||
//Write E-fuse Register address bit0~7
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
//Write E-fuse Register address bit8~9
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
|
||||
//Write 0x30[31]=0
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
|
@ -325,7 +325,7 @@ EFUSE_Read1Byte(
|
|||
//Wait Write-ready (0x30[31]=1)
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
while(!(Bytetemp & 0x80))
|
||||
{
|
||||
{
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
k++;
|
||||
if(k==1000)
|
||||
|
@ -339,7 +339,7 @@ EFUSE_Read1Byte(
|
|||
}
|
||||
else
|
||||
return 0xFF;
|
||||
|
||||
|
||||
}/* EFUSE_Read1Byte */
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
|
@ -355,18 +355,18 @@ EFUSE_Read1Byte(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 09/23/2008 MHC Copy from WMAC.
|
||||
* 09/23/2008 MHC Copy from WMAC.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
IN u16 Address,
|
||||
IN u8 Value);
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
void
|
||||
EFUSE_Write1Byte(
|
||||
IN struct adapter *Adapter,
|
||||
IN u16 Address,
|
||||
IN u8 Value)
|
||||
{
|
||||
|
@ -383,13 +383,13 @@ EFUSE_Write1Byte(
|
|||
rtw_write8(Adapter, EFUSE_CTRL, Value);
|
||||
|
||||
//Write E-fuse Register address bit0~7
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
|
||||
//Write E-fuse Register address bit8~9
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
|
||||
//Write 0x30[31]=1
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
|
@ -400,7 +400,7 @@ EFUSE_Write1Byte(
|
|||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
while(Bytetemp & 0x80)
|
||||
{
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
k++;
|
||||
if(k==100)
|
||||
{
|
||||
|
@ -414,7 +414,7 @@ EFUSE_Write1Byte(
|
|||
/* 11/16/2008 MH Read one byte from real Efuse. */
|
||||
u8
|
||||
efuse_OneByteRead(
|
||||
IN struct adapter *pAdapter,
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 addr,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -428,35 +428,35 @@ efuse_OneByteRead(
|
|||
return bResult;
|
||||
}
|
||||
// -----------------e-fuse reg ctrl ---------------------------------
|
||||
//address
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) &0x03) ) |
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC ));
|
||||
//address
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) &0x03) ) |
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC ));
|
||||
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);//read cmd
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);//read cmd
|
||||
|
||||
while(!(0x80 &rtw_read8(pAdapter, EFUSE_CTRL+3))&&(tmpidx<100))
|
||||
{
|
||||
tmpidx++;
|
||||
}
|
||||
if(tmpidx<100)
|
||||
{
|
||||
*data=rtw_read8(pAdapter, EFUSE_CTRL);
|
||||
{
|
||||
*data=rtw_read8(pAdapter, EFUSE_CTRL);
|
||||
bResult = _TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
*data = 0xff;
|
||||
*data = 0xff;
|
||||
bResult = _FALSE;
|
||||
}
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
/* 11/16/2008 MH Write one byte to reald Efuse. */
|
||||
u8
|
||||
efuse_OneByteWrite(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 addr,
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 addr,
|
||||
IN u8 data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
{
|
||||
|
@ -472,29 +472,29 @@ efuse_OneByteWrite(
|
|||
|
||||
//return 0;
|
||||
|
||||
// -----------------e-fuse reg ctrl ---------------------------------
|
||||
//address
|
||||
// -----------------e-fuse reg ctrl ---------------------------------
|
||||
//address
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+2,
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC )|(u8)((addr>>8)&0x03) );
|
||||
rtw_write8(pAdapter, EFUSE_CTRL, data);//data
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+2,
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC )|(u8)((addr>>8)&0x03) );
|
||||
rtw_write8(pAdapter, EFUSE_CTRL, data);//data
|
||||
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);//write cmd
|
||||
|
||||
|
||||
while((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx<100) ){
|
||||
tmpidx++;
|
||||
}
|
||||
|
||||
|
||||
if(tmpidx<100)
|
||||
{
|
||||
{
|
||||
bResult = _TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
bResult = _FALSE;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -510,9 +510,9 @@ Efuse_PgPacketRead( IN struct adapter *pAdapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
Efuse_PgPacketWrite(IN struct adapter *pAdapter,
|
||||
IN u8 offset,
|
||||
int
|
||||
Efuse_PgPacketWrite(IN struct adapter *pAdapter,
|
||||
IN u8 offset,
|
||||
IN u8 word_en,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -525,9 +525,9 @@ Efuse_PgPacketWrite(IN struct adapter *pAdapter,
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
Efuse_PgPacketWrite_BT(IN struct adapter *pAdapter,
|
||||
IN u8 offset,
|
||||
int
|
||||
Efuse_PgPacketWrite_BT(IN struct adapter *pAdapter,
|
||||
IN u8 offset,
|
||||
IN u8 word_en,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -552,15 +552,15 @@ Efuse_PgPacketWrite_BT(IN struct adapter *pAdapter,
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/16/2008 MHC Create Version 0.
|
||||
* 11/21/2008 MHC Fix Write bug when we only enable late word.
|
||||
* 11/16/2008 MHC Create Version 0.
|
||||
* 11/21/2008 MHC Fix Write bug when we only enable late word.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
efuse_WordEnableDataRead(IN u8 word_en,
|
||||
IN u8 *sourdata,
|
||||
IN u8 *targetdata)
|
||||
{
|
||||
{
|
||||
if (!(word_en&BIT(0)))
|
||||
{
|
||||
targetdata[0] = sourdata[0];
|
||||
|
@ -587,14 +587,14 @@ efuse_WordEnableDataRead(IN u8 word_en,
|
|||
u8
|
||||
Efuse_WordEnableDataWrite( IN struct adapter *pAdapter,
|
||||
IN u16 efuse_addr,
|
||||
IN u8 word_en,
|
||||
IN u8 word_en,
|
||||
IN u8 *data,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
{
|
||||
u8 ret=0;
|
||||
|
||||
ret = pAdapter->HalFunc.Efuse_WordEnableDataWrite(pAdapter, efuse_addr, word_en, data, bPseudoTest);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -911,18 +911,18 @@ exit:
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/11/2008 MHC Create Version 0.
|
||||
* 11/11/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
VOID
|
||||
VOID
|
||||
Efuse_ReadAllMap(
|
||||
IN struct adapter *pAdapter,
|
||||
IN struct adapter *pAdapter,
|
||||
IN u8 efuseType,
|
||||
IN OUT u8 *Efuse,
|
||||
IN BOOLEAN bPseudoTest);
|
||||
VOID
|
||||
VOID
|
||||
Efuse_ReadAllMap(
|
||||
IN struct adapter *pAdapter,
|
||||
IN struct adapter *pAdapter,
|
||||
IN u8 efuseType,
|
||||
IN OUT u8 *Efuse,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
|
@ -953,7 +953,7 @@ Efuse_ReadAllMap(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
static VOID
|
||||
|
@ -1014,7 +1014,7 @@ efuse_ShadowRead4Byte(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
#ifdef PLATFORM
|
||||
|
@ -1022,13 +1022,13 @@ static VOID
|
|||
efuse_ShadowWrite1Byte(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value);
|
||||
IN u8 Value);
|
||||
#endif //PLATFORM
|
||||
static VOID
|
||||
efuse_ShadowWrite1Byte(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u8 Value)
|
||||
IN u8 Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
|
||||
|
@ -1041,7 +1041,7 @@ static VOID
|
|||
efuse_ShadowWrite2Byte(
|
||||
IN struct adapter *pAdapter,
|
||||
IN u16 Offset,
|
||||
IN u16 Value)
|
||||
IN u16 Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
|
||||
|
@ -1079,7 +1079,7 @@ efuse_ShadowWrite4Byte(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/13/2008 MHC Create Version 0.
|
||||
* 11/13/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
void EFUSE_ShadowMapUpdate(
|
||||
|
@ -1098,19 +1098,19 @@ void EFUSE_ShadowMapUpdate(
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
if(_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM)) {
|
||||
#endif
|
||||
|
||||
|
||||
Efuse_ReadAllMap(pAdapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest);
|
||||
|
||||
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
storeAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//PlatformMoveMemory((PVOID)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0],
|
||||
//PlatformMoveMemory((PVOID)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0],
|
||||
//(PVOID)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen);
|
||||
}// EFUSE_ShadowMapUpdate
|
||||
|
||||
|
@ -1128,7 +1128,7 @@ void EFUSE_ShadowMapUpdate(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
|
@ -1144,7 +1144,7 @@ EFUSE_ShadowRead(
|
|||
efuse_ShadowRead2Byte(pAdapter, Offset, (u16 *)Value);
|
||||
else if (Type == 4)
|
||||
efuse_ShadowRead4Byte(pAdapter, Offset, (u32 *)Value);
|
||||
|
||||
|
||||
} // EFUSE_ShadowRead
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
|
@ -1160,7 +1160,7 @@ EFUSE_ShadowRead(
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
* 11/12/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
VOID
|
||||
|
@ -1202,7 +1202,7 @@ Efuse_InitSomeVar(
|
|||
)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
|
||||
_rtw_memset((PVOID)&fakeEfuseContent[0], 0xff, EFUSE_MAX_HW_SIZE);
|
||||
_rtw_memset((PVOID)&fakeEfuseInitMap[0], 0xff, EFUSE_MAX_MAP_LEN);
|
||||
_rtw_memset((PVOID)&fakeEfuseModifiedMap[0], 0xff, EFUSE_MAX_MAP_LEN);
|
||||
|
@ -1252,24 +1252,24 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
|
|||
int ret = _SUCCESS;
|
||||
mm_segment_t oldfs;
|
||||
struct file *fp;
|
||||
|
||||
|
||||
if(path && eeprom_priv) {
|
||||
|
||||
ret = rtw_retrive_from_file(path, eeprom_priv->efuse_eeprom_data, EEPROM_MAX_SIZE);
|
||||
|
||||
|
||||
if(ret == EEPROM_MAX_SIZE)
|
||||
ret = _SUCCESS;
|
||||
else
|
||||
ret = _FAIL;
|
||||
|
||||
#if 0
|
||||
if(isAdaptorInfoFileValid()) {
|
||||
if(isAdaptorInfoFileValid()) {
|
||||
return 0;
|
||||
} else {
|
||||
return _FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
} else {
|
||||
DBG_871X("%s NULL pointer\n",__FUNCTION__);
|
||||
ret = _FAIL;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -47,16 +47,16 @@ u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 };
|
|||
u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 };
|
||||
u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 };
|
||||
//-----------------------------------------------------------
|
||||
// for adhoc-master to generate ie and provide supported-rate to fw
|
||||
// for adhoc-master to generate ie and provide supported-rate to fw
|
||||
//-----------------------------------------------------------
|
||||
|
||||
static u8 WIFI_CCKRATES[] =
|
||||
static u8 WIFI_CCKRATES[] =
|
||||
{(IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK),
|
||||
(IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK),
|
||||
(IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK),
|
||||
(IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK)};
|
||||
|
||||
static u8 WIFI_OFDMRATES[] =
|
||||
static u8 WIFI_OFDMRATES[] =
|
||||
{(IEEE80211_OFDM_RATE_6MB),
|
||||
(IEEE80211_OFDM_RATE_9MB),
|
||||
(IEEE80211_OFDM_RATE_12MB),
|
||||
|
@ -81,17 +81,17 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
|
|||
}
|
||||
|
||||
uint rtw_is_cckrates_included(u8 *rate)
|
||||
{
|
||||
u32 i = 0;
|
||||
{
|
||||
u32 i = 0;
|
||||
|
||||
while(rate[i]!=0)
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
return _TRUE;
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
return _TRUE;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
|
@ -105,11 +105,11 @@ uint rtw_is_cckratesonly_included(u8 *rate)
|
|||
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||
|
||||
return _FALSE;
|
||||
return _FALSE;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
return _TRUE;
|
||||
|
||||
}
|
||||
|
@ -122,17 +122,17 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
|
|||
return WIRELESS_INVALID;
|
||||
else
|
||||
return WIRELESS_11A;
|
||||
}
|
||||
}
|
||||
else // could be pure B, pure G, or B/G
|
||||
{
|
||||
if ((rtw_is_cckratesonly_included(rate)) == _TRUE)
|
||||
if ((rtw_is_cckratesonly_included(rate)) == _TRUE)
|
||||
return WIRELESS_11B;
|
||||
else if((rtw_is_cckrates_included(rate)) == _TRUE)
|
||||
return WIRELESS_11BG;
|
||||
return WIRELESS_11BG;
|
||||
else
|
||||
return WIRELESS_11G;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source,
|
||||
|
@ -146,10 +146,10 @@ u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *sourc
|
|||
// rtw_set_ie will update frame length
|
||||
u8 *rtw_set_ie
|
||||
(
|
||||
u8 *pbuf,
|
||||
sint index,
|
||||
u8 *pbuf,
|
||||
sint index,
|
||||
uint len,
|
||||
u8 *source,
|
||||
u8 *source,
|
||||
uint *frlen //frame length
|
||||
)
|
||||
{
|
||||
|
@ -160,11 +160,11 @@ _func_enter_;
|
|||
|
||||
if (len > 0)
|
||||
_rtw_memcpy((void *)(pbuf + 2), (void *)source, len);
|
||||
|
||||
|
||||
*frlen = *frlen + (len + 2);
|
||||
|
||||
|
||||
return (pbuf + len + 2);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
inline u8 *rtw_set_ie_ch_switch(u8 *buf, u32 *buf_len, u8 ch_switch_mode,
|
||||
|
@ -229,7 +229,7 @@ u8 *rtw_get_ie(u8 *pbuf, sint index, sint *len, sint limit)
|
|||
u8 *p;
|
||||
_func_enter_;
|
||||
if (limit < 1){
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ _func_enter_;
|
|||
if (i >= limit)
|
||||
break;
|
||||
}
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
|
|||
|
||||
if(ie)
|
||||
_rtw_memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
|
||||
|
||||
|
||||
if(ielen)
|
||||
*ielen = in_ie[cnt+1]+2;
|
||||
|
||||
|
@ -299,10 +299,10 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
|
|||
}
|
||||
else
|
||||
{
|
||||
cnt+=in_ie[cnt+1]+2; //goto next
|
||||
}
|
||||
cnt+=in_ie[cnt+1]+2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return target_ie;
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 o
|
|||
u32 target_ielen;
|
||||
u8 *start;
|
||||
uint search_len;
|
||||
|
||||
|
||||
if(!ies || !ies_len || *ies_len <= offset)
|
||||
goto exit;
|
||||
|
||||
|
@ -338,7 +338,7 @@ int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 o
|
|||
u8 buf[MAX_IE_SZ] = {0};
|
||||
u8 *remain_ies = target_ie + target_ielen;
|
||||
uint remain_len = search_len - (remain_ies - start);
|
||||
|
||||
|
||||
_rtw_memcpy(buf, remain_ies, remain_len);
|
||||
_rtw_memcpy(target_ie, buf, remain_len);
|
||||
*ies_len = *ies_len - target_ielen;
|
||||
|
@ -354,25 +354,25 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
|
||||
void rtw_set_supported_rate(u8* SupportedRates, uint mode)
|
||||
void rtw_set_supported_rate(u8* SupportedRates, uint mode)
|
||||
{
|
||||
_func_enter_;
|
||||
|
||||
_rtw_memset(SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX);
|
||||
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case WIRELESS_11B:
|
||||
_rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
|
||||
break;
|
||||
|
||||
|
||||
case WIRELESS_11G:
|
||||
case WIRELESS_11A:
|
||||
case WIRELESS_11_5N:
|
||||
case WIRELESS_11A_5N://Todo: no basic rate for ofdm ?
|
||||
_rtw_memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
|
||||
break;
|
||||
|
||||
|
||||
case WIRELESS_11BG:
|
||||
case WIRELESS_11G_24N:
|
||||
case WIRELESS_11_24N:
|
||||
|
@ -380,64 +380,64 @@ _func_enter_;
|
|||
_rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
|
||||
_rtw_memcpy(SupportedRates + IEEE80211_CCK_RATE_LEN, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
uint rtw_get_rateset_len(u8 *rateset)
|
||||
{
|
||||
uint i = 0;
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
while(1)
|
||||
{
|
||||
if ((rateset[i]) == 0)
|
||||
break;
|
||||
|
||||
|
||||
if (i > 12)
|
||||
break;
|
||||
|
||||
i++;
|
||||
|
||||
i++;
|
||||
}
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return i;
|
||||
}
|
||||
|
||||
int rtw_generate_ie(struct registry_priv *pregistrypriv)
|
||||
{
|
||||
u8 wireless_mode;
|
||||
int sz = 0, rateLen;
|
||||
int sz = 0, rateLen;
|
||||
WLAN_BSSID_EX* pdev_network = &pregistrypriv->dev_network;
|
||||
u8* ie = pdev_network->IEs;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
//timestamp will be inserted by hardware
|
||||
sz += 8;
|
||||
sz += 8;
|
||||
ie += sz;
|
||||
|
||||
|
||||
//beacon interval : 2bytes
|
||||
*(u16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);//BCN_INTERVAL;
|
||||
sz += 2;
|
||||
sz += 2;
|
||||
ie += 2;
|
||||
|
||||
|
||||
//capability info
|
||||
*(u16*)ie = 0;
|
||||
|
||||
|
||||
*(u16*)ie |= cpu_to_le16(cap_IBSS);
|
||||
|
||||
if(pregistrypriv->preamble == PREAMBLE_SHORT)
|
||||
*(u16*)ie |= cpu_to_le16(cap_ShortPremble);
|
||||
|
||||
|
||||
if (pdev_network->Privacy)
|
||||
*(u16*)ie |= cpu_to_le16(cap_Privacy);
|
||||
|
||||
|
||||
sz += 2;
|
||||
ie += 2;
|
||||
|
||||
|
||||
//SSID
|
||||
ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);
|
||||
|
||||
|
||||
//supported rates
|
||||
if(pregistrypriv->wireless_mode == WIRELESS_11ABGN)
|
||||
{
|
||||
|
@ -450,9 +450,9 @@ _func_enter_;
|
|||
{
|
||||
wireless_mode = pregistrypriv->wireless_mode;
|
||||
}
|
||||
|
||||
|
||||
rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode) ;
|
||||
|
||||
|
||||
rateLen = rtw_get_rateset_len(pdev_network->SupportedRates);
|
||||
|
||||
if (rateLen > 8)
|
||||
|
@ -470,17 +470,17 @@ _func_enter_;
|
|||
|
||||
|
||||
//IBSS Parameter Set
|
||||
|
||||
|
||||
ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz);
|
||||
|
||||
if (rateLen > 8)
|
||||
{
|
||||
{
|
||||
ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
//HT Cap.
|
||||
if(((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
|
||||
if(((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
|
||||
&& (pregistrypriv->ht_enable==_TRUE))
|
||||
{
|
||||
//todo:
|
||||
|
@ -505,7 +505,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
|
|||
u8 *pbuf = pie;
|
||||
int limit_new = limit;
|
||||
|
||||
while(1)
|
||||
while(1)
|
||||
{
|
||||
pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new);
|
||||
|
||||
|
@ -553,7 +553,7 @@ check_next_ie:
|
|||
}
|
||||
|
||||
unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
|
||||
{
|
||||
{
|
||||
|
||||
return rtw_get_ie(pie, _WPA2_IE_ID_,rsn_ie_len, limit);
|
||||
|
||||
|
@ -604,59 +604,59 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) ||
|
||||
(_rtw_memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN) != _TRUE) )
|
||||
{
|
||||
{
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
pos = wpa_ie;
|
||||
|
||||
pos += 8;
|
||||
left = wpa_ie_len - 8;
|
||||
left = wpa_ie_len - 8;
|
||||
|
||||
|
||||
//group_cipher
|
||||
if (left >= WPA_SELECTOR_LEN) {
|
||||
|
||||
*group_cipher = rtw_get_wpa_cipher_suite(pos);
|
||||
|
||||
|
||||
pos += WPA_SELECTOR_LEN;
|
||||
left -= WPA_SELECTOR_LEN;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (left > 0)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie length mismatch, %u too much", __FUNCTION__, left));
|
||||
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
//pairwise_cipher
|
||||
if (left >= 2)
|
||||
{
|
||||
//count = le16_to_cpu(*(u16*)pos);
|
||||
{
|
||||
//count = le16_to_cpu(*(u16*)pos);
|
||||
count = RTW_GET_LE16(pos);
|
||||
pos += 2;
|
||||
left -= 2;
|
||||
|
||||
|
||||
if (count == 0 || left < count * WPA_SELECTOR_LEN) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie count botch (pairwise), "
|
||||
"count %u left %u", __FUNCTION__, count, left));
|
||||
"count %u left %u", __FUNCTION__, count, left));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
*pairwise_cipher |= rtw_get_wpa_cipher_suite(pos);
|
||||
|
||||
|
||||
pos += WPA_SELECTOR_LEN;
|
||||
left -= WPA_SELECTOR_LEN;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (left == 1)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie too short (for key mgmt)", __FUNCTION__));
|
||||
|
@ -672,9 +672,9 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x)
|
||||
|
@ -691,22 +691,22 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
|
||||
|
||||
if ((*rsn_ie!= _WPA2_IE_ID_) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2)))
|
||||
{
|
||||
{
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
pos = rsn_ie;
|
||||
pos += 4;
|
||||
left = rsn_ie_len - 4;
|
||||
left = rsn_ie_len - 4;
|
||||
|
||||
//group_cipher
|
||||
if (left >= RSN_SELECTOR_LEN) {
|
||||
|
||||
*group_cipher = rtw_get_wpa2_cipher_suite(pos);
|
||||
|
||||
|
||||
pos += RSN_SELECTOR_LEN;
|
||||
left -= RSN_SELECTOR_LEN;
|
||||
|
||||
|
||||
} else if (left > 0) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie length mismatch, %u too much", __FUNCTION__, left));
|
||||
return _FAIL;
|
||||
|
@ -714,7 +714,7 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
|
||||
//pairwise_cipher
|
||||
if (left >= 2)
|
||||
{
|
||||
{
|
||||
//count = le16_to_cpu(*(u16*)pos);
|
||||
count = RTW_GET_LE16(pos);
|
||||
pos += 2;
|
||||
|
@ -722,23 +722,23 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
|
||||
if (count == 0 || left < count * RSN_SELECTOR_LEN) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie count botch (pairwise), "
|
||||
"count %u left %u", __FUNCTION__, count, left));
|
||||
"count %u left %u", __FUNCTION__, count, left));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
{
|
||||
*pairwise_cipher |= rtw_get_wpa2_cipher_suite(pos);
|
||||
|
||||
|
||||
pos += RSN_SELECTOR_LEN;
|
||||
left -= RSN_SELECTOR_LEN;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (left == 1)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie too short (for key mgmt)", __FUNCTION__));
|
||||
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
@ -753,14 +753,14 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
}
|
||||
|
||||
return ret;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
int rtw_get_wapi_ie(u8 *in_ie,uint in_len,u8 *wapi_ie,u16 *wapi_len)
|
||||
{
|
||||
u8 authmode, i;
|
||||
uint cnt;
|
||||
uint cnt;
|
||||
u8 wapi_oui1[4]={0x0,0x14,0x72,0x01};
|
||||
u8 wapi_oui2[4]={0x0,0x14,0x72,0x02};
|
||||
|
||||
|
@ -772,7 +772,7 @@ _func_enter_;
|
|||
|
||||
//if(authmode==_WAPI_IE_)
|
||||
if(authmode==_WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt+6], wapi_oui1,4)==_TRUE ||
|
||||
_rtw_memcmp(&in_ie[cnt+6], wapi_oui2,4)==_TRUE))
|
||||
_rtw_memcmp(&in_ie[cnt+6], wapi_oui2,4)==_TRUE))
|
||||
{
|
||||
if (wapi_ie) {
|
||||
_rtw_memcpy(wapi_ie, &in_ie[cnt],in_ie[cnt+1]+2);
|
||||
|
@ -804,23 +804,23 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16
|
|||
{
|
||||
u8 authmode, sec_idx, i;
|
||||
u8 wpa_oui[4]={0x0,0x50,0xf2,0x01};
|
||||
uint cnt;
|
||||
|
||||
uint cnt;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
//Search required WPA or WPA2 IE and copy to sec_ie[ ]
|
||||
|
||||
|
||||
cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_);
|
||||
|
||||
|
||||
sec_idx=0;
|
||||
|
||||
|
||||
while(cnt<in_len)
|
||||
{
|
||||
authmode=in_ie[cnt];
|
||||
|
||||
|
||||
if((authmode==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], &wpa_oui[0],4)==_TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_get_wpa_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_get_wpa_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
|
||||
if (wpa_ie) {
|
||||
_rtw_memcpy(wpa_ie, &in_ie[cnt],in_ie[cnt+1]+2);
|
||||
|
@ -839,7 +839,7 @@ _func_enter_;
|
|||
{
|
||||
if(authmode==_WPA2_IE_ID_)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n get_rsn_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n get_rsn_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
|
||||
if (rsn_ie) {
|
||||
_rtw_memcpy(rsn_ie, &in_ie[cnt],in_ie[cnt+1]+2);
|
||||
|
@ -857,32 +857,32 @@ _func_enter_;
|
|||
else
|
||||
{
|
||||
cnt+=in_ie[cnt+1]+2; //get next
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return (*rsn_len+*wpa_len);
|
||||
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
|
||||
{
|
||||
{
|
||||
u8 match = _FALSE;
|
||||
u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04};
|
||||
|
||||
|
||||
if(ie_ptr == NULL) return match;
|
||||
|
||||
|
||||
eid = ie_ptr[0];
|
||||
|
||||
|
||||
if((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==_TRUE))
|
||||
{
|
||||
{
|
||||
//DBG_8192C("==> found WPS_IE.....\n");
|
||||
*wps_ielen = ie_ptr[1]+2;
|
||||
*wps_ielen = ie_ptr[1]+2;
|
||||
match=_TRUE;
|
||||
}
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
|
@ -941,20 +941,20 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
|
|||
|
||||
if(wps_ie)
|
||||
_rtw_memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2);
|
||||
|
||||
|
||||
if(wps_ielen)
|
||||
*wps_ielen = in_ie[cnt+1]+2;
|
||||
|
||||
|
||||
cnt+=in_ie[cnt+1]+2;
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
cnt+=in_ie[cnt+1]+2; //goto next
|
||||
}
|
||||
cnt+=in_ie[cnt+1]+2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return wpsie_ptr;
|
||||
}
|
||||
|
@ -986,33 +986,33 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
|
|||
|
||||
// 6 = 1(Element ID) + 1(Length) + 4(WPS OUI)
|
||||
attr_ptr = wps_ie + 6; //goto first attr
|
||||
|
||||
|
||||
while(attr_ptr - wps_ie < wps_ielen)
|
||||
{
|
||||
// 4 = 2(Attribute ID) + 2(Length)
|
||||
u16 attr_id = RTW_GET_BE16(attr_ptr);
|
||||
u16 attr_data_len = RTW_GET_BE16(attr_ptr + 2);
|
||||
u16 attr_len = attr_data_len + 4;
|
||||
|
||||
|
||||
//DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len);
|
||||
if( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
||||
|
||||
if(buf_attr)
|
||||
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
|
||||
|
||||
|
||||
if(len_attr)
|
||||
*len_attr = attr_len;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
attr_ptr += attr_len; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return target_attr_ptr;
|
||||
}
|
||||
|
@ -1034,7 +1034,7 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8
|
|||
|
||||
if(len_content)
|
||||
*len_content = 0;
|
||||
|
||||
|
||||
attr_ptr = rtw_get_wps_attr(wps_ie, wps_ielen, target_attr_id, NULL, &attr_len);
|
||||
|
||||
if(attr_ptr && attr_len)
|
||||
|
@ -1145,7 +1145,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
|
|||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1178,7 +1178,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
|||
DBG_871X("IEEE 802.11 element "
|
||||
"parse failed (id=%d elen=%d "
|
||||
"left=%lu)\n",
|
||||
id, elen, (unsigned long) left);
|
||||
id, elen, (unsigned long) left);
|
||||
}
|
||||
return ParseFailed;
|
||||
}
|
||||
|
@ -1280,7 +1280,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
|||
return ParseFailed;
|
||||
|
||||
return unknown ? ParseUnknown : ParseOK;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static u8 key_char2num(u8 ch);
|
||||
|
@ -1317,7 +1317,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
{
|
||||
u8 mac[ETH_ALEN];
|
||||
if(mac_addr == NULL) return;
|
||||
|
||||
|
||||
if ( rtw_initmac )
|
||||
{ // Users specify the mac address
|
||||
int jj,kk;
|
||||
|
@ -1332,7 +1332,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
{ // Use the mac address stored in the Efuse
|
||||
_rtw_memcpy(mac, mac_addr, ETH_ALEN);
|
||||
}
|
||||
|
||||
|
||||
if (((mac[0]==0xff) &&(mac[1]==0xff) && (mac[2]==0xff) &&
|
||||
(mac[3]==0xff) && (mac[4]==0xff) &&(mac[5]==0xff)) ||
|
||||
((mac[0]==0x0) && (mac[1]==0x0) && (mac[2]==0x0) &&
|
||||
|
@ -1347,7 +1347,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
// use default mac addresss
|
||||
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
|
||||
DBG_871X("MAC Address from efuse error, assign default one !!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr));
|
||||
}
|
||||
|
@ -1477,7 +1477,7 @@ void dump_p2p_ie(u8 *ie, u32 ie_len) {
|
|||
|
||||
u8 *p2p_ie;
|
||||
uint p2p_ielen;
|
||||
|
||||
|
||||
p2p_ie = rtw_get_p2p_ie(ie, ie_len, NULL, &p2p_ielen);
|
||||
if(p2p_ie != ie || p2p_ielen == 0)
|
||||
return;
|
||||
|
@ -1490,7 +1490,7 @@ void dump_p2p_ie(u8 *ie, u32 ie_len) {
|
|||
DBG_871X("%s ID:%u, LEN:%u\n", __FUNCTION__, id, len);
|
||||
|
||||
pos+=(3+len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u8 *rtw_get_p2p_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen, u8 frame_type)
|
||||
|
@ -1539,11 +1539,11 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|||
if ((in_len < 0) || (cnt > MAX_IE_SZ)) {
|
||||
dump_stack();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == _TRUE ) )
|
||||
{
|
||||
p2p_ie_ptr = in_ie + cnt;
|
||||
|
||||
|
||||
if ( p2p_ie != NULL )
|
||||
{
|
||||
_rtw_memcpy( p2p_ie, &in_ie[ cnt ], in_ie[ cnt + 1 ] + 2 );
|
||||
|
@ -1553,17 +1553,17 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|||
{
|
||||
*p2p_ielen = in_ie[ cnt + 1 ] + 2;
|
||||
}
|
||||
|
||||
|
||||
return p2p_ie_ptr;
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
|
@ -1596,33 +1596,33 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
|
|||
|
||||
// 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type)
|
||||
attr_ptr = p2p_ie + 6; //goto first attr
|
||||
|
||||
|
||||
while(attr_ptr - p2p_ie < p2p_ielen)
|
||||
{
|
||||
// 3 = 1(Attribute ID) + 2(Length)
|
||||
u8 attr_id = *attr_ptr;
|
||||
u16 attr_data_len = RTW_GET_LE16(attr_ptr + 1);
|
||||
u16 attr_len = attr_data_len + 3;
|
||||
|
||||
|
||||
//DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len);
|
||||
if( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
||||
|
||||
if(buf_attr)
|
||||
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
|
||||
|
||||
|
||||
if(len_attr)
|
||||
*len_attr = attr_len;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
attr_ptr += attr_len; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return target_attr_ptr;
|
||||
}
|
||||
|
@ -1644,7 +1644,7 @@ u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *
|
|||
|
||||
if(len_content)
|
||||
*len_content = 0;
|
||||
|
||||
|
||||
attr_ptr = rtw_get_p2p_attr(p2p_ie, p2p_ielen, target_attr_id, NULL, &attr_len);
|
||||
|
||||
if(attr_ptr && attr_len)
|
||||
|
@ -1662,19 +1662,19 @@ u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *
|
|||
}
|
||||
|
||||
u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
|
||||
{
|
||||
{
|
||||
u32 a_len;
|
||||
|
||||
*pbuf = attr_id;
|
||||
|
||||
|
||||
//*(u16*)(pbuf + 1) = cpu_to_le16(attr_len);
|
||||
RTW_PUT_LE16(pbuf + 1, attr_len);
|
||||
|
||||
if(pdata_attr)
|
||||
_rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
|
||||
|
||||
_rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
|
||||
|
||||
a_len = attr_len + 3;
|
||||
|
||||
|
||||
return a_len;
|
||||
}
|
||||
|
||||
|
@ -1725,8 +1725,8 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
|
|||
u8 *p2p_ie;
|
||||
uint p2p_ielen, p2p_ielen_ori;
|
||||
int cnt;
|
||||
|
||||
if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
|
||||
|
||||
if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
|
||||
{
|
||||
#if 0
|
||||
if(rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) {
|
||||
|
@ -1737,7 +1737,7 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
|
|||
|
||||
p2p_ielen=rtw_p2p_attr_remove(p2p_ie, p2p_ielen_ori, attr_id);
|
||||
if(p2p_ielen != p2p_ielen_ori) {
|
||||
|
||||
|
||||
u8 *next_ie_ori = p2p_ie+p2p_ielen_ori;
|
||||
u8 *next_ie = p2p_ie+p2p_ielen;
|
||||
uint remain_len = bss_ex->IELength-(next_ie_ori-bss_ex->IEs);
|
||||
|
@ -1783,7 +1783,7 @@ void dump_wfd_ie(u8 *ie, u32 ie_len)
|
|||
int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
||||
{
|
||||
int match;
|
||||
uint cnt = 0;
|
||||
uint cnt = 0;
|
||||
u8 eid, wfd_oui[4]={0x50,0x6F,0x9A,0x0A};
|
||||
|
||||
|
||||
|
@ -1797,13 +1797,13 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
while(cnt<in_len)
|
||||
{
|
||||
eid = in_ie[cnt];
|
||||
|
||||
|
||||
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], wfd_oui, 4) == _TRUE ) )
|
||||
{
|
||||
if ( wfd_ie != NULL )
|
||||
{
|
||||
_rtw_memcpy( wfd_ie, &in_ie[ cnt ], in_ie[ cnt + 1 ] + 2 );
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1812,12 +1812,12 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
*wfd_ielen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( wfd_ielen != NULL )
|
||||
{
|
||||
*wfd_ielen = in_ie[ cnt + 1 ] + 2;
|
||||
}
|
||||
|
||||
|
||||
cnt += in_ie[ cnt + 1 ] + 2;
|
||||
|
||||
match = _TRUE;
|
||||
|
@ -1825,16 +1825,16 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
}
|
||||
else
|
||||
{
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( match == _TRUE )
|
||||
{
|
||||
match = cnt;
|
||||
}
|
||||
|
||||
|
||||
return match;
|
||||
|
||||
}
|
||||
|
@ -1868,7 +1868,7 @@ int rtw_get_wfd_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_
|
|||
int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen)
|
||||
{
|
||||
int match;
|
||||
uint cnt = 0;
|
||||
uint cnt = 0;
|
||||
u8 attr_id, wfd_oui[4]={0x50,0x6F,0x9A,0x0A};
|
||||
|
||||
|
||||
|
@ -1885,17 +1885,17 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
|
|||
while( cnt < wfd_ielen )
|
||||
{
|
||||
u16 attrlen = RTW_GET_BE16(wfd_ie + cnt + 1);
|
||||
|
||||
|
||||
attr_id = wfd_ie[cnt];
|
||||
if( attr_id == target_attr_id )
|
||||
{
|
||||
// 3 -> 1 byte for attribute ID field, 2 bytes for length field
|
||||
if(attr_content)
|
||||
_rtw_memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen );
|
||||
|
||||
|
||||
if(attr_contentlen)
|
||||
*attr_contentlen = attrlen;
|
||||
|
||||
|
||||
cnt += attrlen + 3;
|
||||
|
||||
match = _TRUE;
|
||||
|
@ -1903,10 +1903,10 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
|
|||
}
|
||||
else
|
||||
{
|
||||
cnt += attrlen + 3; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
cnt += attrlen + 3; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return match;
|
||||
|
||||
|
@ -2060,7 +2060,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char * MCS_rate)
|
||||
{
|
||||
u16 max_rate = 0;
|
||||
|
||||
|
||||
if(rf_type == RF_1T1R)
|
||||
{
|
||||
if(MCS_rate[0] & BIT(7))
|
||||
|
@ -2181,4 +2181,3 @@ const char *action_public_str(u8 action)
|
|||
action = (action >= ACT_PUBLIC_MAX) ? ACT_PUBLIC_MAX : action;
|
||||
return _action_public_str[action];
|
||||
}
|
||||
|
||||
|
|
|
@ -71,12 +71,12 @@ jackson@realtek.com.tw
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#define rtw_le16_to_cpu(val) val
|
||||
#define rtw_le16_to_cpu(val) val
|
||||
#define rtw_le32_to_cpu(val) val
|
||||
#define rtw_cpu_to_le16(val) val
|
||||
#define rtw_cpu_to_le32(val) val
|
||||
#else
|
||||
#define rtw_le16_to_cpu(val) le16_to_cpu(val)
|
||||
#define rtw_le16_to_cpu(val) le16_to_cpu(val)
|
||||
#define rtw_le32_to_cpu(val) le32_to_cpu(val)
|
||||
#define rtw_cpu_to_le16(val) cpu_to_le16(val)
|
||||
#define rtw_cpu_to_le32(val) cpu_to_le32(val)
|
||||
|
@ -86,7 +86,7 @@ jackson@realtek.com.tw
|
|||
u8 _rtw_read8(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u8 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
@ -101,10 +101,10 @@ u8 _rtw_read8(struct adapter *adapter, u32 addr)
|
|||
u16 _rtw_read16(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u16 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read16 = pintfhdl->io_ops._read16;
|
||||
|
||||
|
@ -116,10 +116,10 @@ u16 _rtw_read16(struct adapter *adapter, u32 addr)
|
|||
u32 _rtw_read32(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u32 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read32 = pintfhdl->io_ops._read32;
|
||||
|
||||
|
@ -131,7 +131,7 @@ u32 _rtw_read32(struct adapter *adapter, u32 addr)
|
|||
|
||||
int _rtw_write8(struct adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
|
@ -141,12 +141,12 @@ int _rtw_write8(struct adapter *adapter, u32 addr, u8 val)
|
|||
|
||||
ret = _write8(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write16(struct adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
|
@ -162,14 +162,14 @@ int _rtw_write16(struct adapter *adapter, u32 addr, u16 val)
|
|||
}
|
||||
int _rtw_write32(struct adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write32 = pintfhdl->io_ops._write32;
|
||||
|
||||
|
||||
val = rtw_cpu_to_le32(val);
|
||||
ret = _write32(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
@ -179,7 +179,7 @@ int _rtw_write32(struct adapter *adapter, u32 addr, u32 val)
|
|||
|
||||
int _rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *pdata)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = (struct intf_hdl*)(&(pio_priv->intf));
|
||||
int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr,u32 length, u8 *pdata);
|
||||
|
@ -194,7 +194,7 @@ int _rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *pdata)
|
|||
}
|
||||
int _rtw_write8_async(struct adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
|
@ -209,7 +209,7 @@ int _rtw_write8_async(struct adapter *adapter, u32 addr, u8 val)
|
|||
}
|
||||
int _rtw_write16_async(struct adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
|
@ -224,7 +224,7 @@ int _rtw_write16_async(struct adapter *adapter, u32 addr, u16 val)
|
|||
}
|
||||
int _rtw_write32_async(struct adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
|
@ -241,7 +241,7 @@ int _rtw_write32_async(struct adapter *adapter, u32 addr, u32 val)
|
|||
void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
|
@ -249,7 +249,7 @@ void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
|
||||
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
|
@ -281,7 +281,7 @@ void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
|
@ -289,7 +289,7 @@ void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
|
||||
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ void _rtw_read_port_cancel(struct adapter *adapter)
|
|||
u32 _rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 ret = _SUCCESS;
|
||||
|
@ -325,7 +325,7 @@ u32 _rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
_func_enter_;
|
||||
|
||||
_write_port = pintfhdl->io_ops._write_port;
|
||||
|
||||
|
||||
ret = _write_port(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
@ -403,19 +403,19 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
|
|||
*/
|
||||
void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
ATOMIC_SET(&dvobj->continual_io_error, 0);
|
||||
ATOMIC_SET(&dvobj->continual_io_error, 0);
|
||||
}
|
||||
|
||||
#ifdef DBG_IO
|
||||
|
||||
u16 read_sniff_ranges[][2] = {
|
||||
//{0x550, 0x551},
|
||||
};
|
||||
};
|
||||
|
||||
u16 write_sniff_ranges[][2] = {
|
||||
//{0x550, 0x551},
|
||||
//{0x4c, 0x4c},
|
||||
};
|
||||
};
|
||||
|
||||
int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u16)/2;
|
||||
int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u16)/2;
|
||||
|
@ -427,7 +427,7 @@ bool match_read_sniff_ranges(u16 addr, u16 len)
|
|||
if (addr + len > read_sniff_ranges[i][0] && addr <= read_sniff_ranges[i][1])
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
|
@ -438,7 +438,7 @@ bool match_write_sniff_ranges(u16 addr, u16 len)
|
|||
if (addr + len > write_sniff_ranges[i][0] && addr <= write_sniff_ranges[i][1])
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ u8 dbg_rtw_read8(struct adapter *adapter, u32 addr, const char *caller, const in
|
|||
u16 dbg_rtw_read16(struct adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u16 val = _rtw_read16(adapter, addr);
|
||||
|
||||
|
||||
if (match_read_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read16(0x%04x) return 0x%04x\n", caller, line, addr, val);
|
||||
|
||||
|
@ -465,7 +465,7 @@ u16 dbg_rtw_read16(struct adapter *adapter, u32 addr, const char *caller, const
|
|||
u32 dbg_rtw_read32(struct adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u32 val = _rtw_read32(adapter, addr);
|
||||
|
||||
|
||||
if (match_read_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read32(0x%04x) return 0x%08x\n", caller, line, addr, val);
|
||||
|
||||
|
@ -476,21 +476,21 @@ int dbg_rtw_write8(struct adapter *adapter, u32 addr, u8 val, const char *caller
|
|||
{
|
||||
if (match_write_sniff_ranges(addr, 1))
|
||||
DBG_871X("DBG_IO %s:%d rtw_write8(0x%04x, 0x%02x)\n", caller, line, addr, val);
|
||||
|
||||
|
||||
return _rtw_write8(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_write16(struct adapter *adapter, u32 addr, u16 val, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d rtw_write16(0x%04x, 0x%04x)\n", caller, line, addr, val);
|
||||
|
||||
|
||||
return _rtw_write16(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_write32(struct adapter *adapter, u32 addr, u32 val, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d rtw_write32(0x%04x, 0x%08x)\n", caller, line, addr, val);
|
||||
|
||||
|
||||
return _rtw_write32(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *data, const char *caller, const int line)
|
||||
|
@ -501,5 +501,3 @@ int dbg_rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *data, con
|
|||
return _rtw_writeN(adapter, addr, length, data);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -24,6 +24,3 @@
|
|||
#include <drv_types.h>
|
||||
#include <rtw_ioctl_query.h>
|
||||
#include <wifi.h>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -57,8 +57,8 @@ struct oid_obj_priv oid_rtl_seg_01_01[] =
|
|||
{1, &oid_rt_get_preamble_mode_hdl}, //0x96
|
||||
{1, &oid_null_function}, //0x97
|
||||
{1, &oid_rt_get_ap_ip_hdl}, //0x98
|
||||
{1, &oid_rt_get_channelplan_hdl}, //0x99
|
||||
{1, &oid_rt_set_preamble_mode_hdl}, //0x9A
|
||||
{1, &oid_rt_get_channelplan_hdl}, //0x99
|
||||
{1, &oid_rt_set_preamble_mode_hdl}, //0x9A
|
||||
{1, &oid_rt_set_bcn_intvl_hdl}, //0x9B
|
||||
{1, &oid_null_function}, //0x9C
|
||||
{1, &oid_rt_dedicate_probe_hdl}, //0x9D
|
||||
|
@ -73,8 +73,8 @@ struct oid_obj_priv oid_rtl_seg_01_01[] =
|
|||
{1, &oid_null_function}, //0xA6
|
||||
{1, &oid_rt_get_total_tx_bytes_hdl}, //0xA7
|
||||
{1, &oid_rt_get_total_rx_bytes_hdl}, //0xA8
|
||||
{1, &oid_rt_current_tx_power_level_hdl}, //0xA9
|
||||
{1, &oid_rt_get_enc_key_mismatch_count_hdl}, //0xAA
|
||||
{1, &oid_rt_current_tx_power_level_hdl}, //0xA9
|
||||
{1, &oid_rt_get_enc_key_mismatch_count_hdl}, //0xAA
|
||||
{1, &oid_rt_get_enc_key_match_count_hdl}, //0xAB
|
||||
{1, &oid_rt_get_channel_hdl}, //0xAC
|
||||
{1, &oid_rt_set_channelplan_hdl}, //0xAD
|
||||
|
@ -89,8 +89,8 @@ struct oid_obj_priv oid_rtl_seg_01_01[] =
|
|||
{1, &oid_null_function}, //0xB6
|
||||
{1, &oid_null_function}, //0xB7
|
||||
{1, &oid_null_function}, //0xB8
|
||||
{1, &oid_null_function}, //0xB9
|
||||
{1, &oid_null_function}, //0xBA
|
||||
{1, &oid_null_function}, //0xB9
|
||||
{1, &oid_null_function}, //0xBA
|
||||
{1, &oid_rt_supported_wireless_mode_hdl}, //0xBB
|
||||
{1, &oid_rt_get_channel_list_hdl}, //0xBC
|
||||
{1, &oid_rt_get_scan_in_progress_hdl}, //0xBD
|
||||
|
@ -105,14 +105,14 @@ struct oid_obj_priv oid_rtl_seg_01_01[] =
|
|||
{1, &oid_null_function}, //0xC6
|
||||
{1, &oid_null_function}, //0xC7
|
||||
{1, &oid_null_function}, //0xC8
|
||||
{1, &oid_null_function}, //0xC9
|
||||
{1, &oid_null_function}, //0xCA
|
||||
{1, &oid_null_function}, //0xC9
|
||||
{1, &oid_null_function}, //0xCA
|
||||
{1, &oid_null_function}, //0xCB
|
||||
{1, &oid_null_function}, //0xCC
|
||||
{1, &oid_null_function}, //0xCD
|
||||
{1, &oid_null_function}, //0xCE
|
||||
{1, &oid_null_function}, //0xCF
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct oid_obj_priv oid_rtl_seg_01_03[] =
|
||||
|
@ -128,7 +128,7 @@ struct oid_obj_priv oid_rtl_seg_01_03[] =
|
|||
|
||||
struct oid_obj_priv oid_rtl_seg_01_11[] =
|
||||
{
|
||||
{1, &oid_null_function}, //0xC0 OID_RT_PRO_RX_FILTER
|
||||
{1, &oid_null_function}, //0xC0 OID_RT_PRO_RX_FILTER
|
||||
{1, &oid_null_function}, //0xC1 OID_CE_USB_WRITE_REGISTRY
|
||||
{1, &oid_null_function}, //0xC2 OID_CE_USB_READ_REGISTRY
|
||||
{1, &oid_null_function}, //0xC3 OID_RT_PRO_SET_INITIAL_GAIN
|
||||
|
@ -136,10 +136,10 @@ struct oid_obj_priv oid_rtl_seg_01_11[] =
|
|||
{1, &oid_null_function}, //0xC5 OID_RT_PRO_SET_BB_RF_SHUTDOWN_MODE
|
||||
{1, &oid_null_function}, //0xC6 OID_RT_PRO_SET_TX_CHARGE_PUMP
|
||||
{1, &oid_null_function}, //0xC7 OID_RT_PRO_SET_RX_CHARGE_PUMP
|
||||
{1, &oid_rt_pro_rf_write_registry_hdl}, //0xC8
|
||||
{1, &oid_rt_pro_rf_read_registry_hdl}, //0xC9
|
||||
{1, &oid_rt_pro_rf_write_registry_hdl}, //0xC8
|
||||
{1, &oid_rt_pro_rf_read_registry_hdl}, //0xC9
|
||||
{1, &oid_null_function} //0xCA OID_RT_PRO_QUERY_RF_TYPE
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct oid_obj_priv oid_rtl_seg_03_00[] =
|
||||
|
@ -150,11 +150,11 @@ struct oid_obj_priv oid_rtl_seg_03_00[] =
|
|||
{1, &oid_null_function}, //0x03
|
||||
{1, &oid_rt_set_default_key_id_hdl}, //0x04
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
//************** oid_rtl_seg_01_01 section start **************
|
||||
//************** oid_rtl_seg_01_01 section start **************
|
||||
|
||||
NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
|
@ -162,28 +162,28 @@ NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
#if 0
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
_irqL oldirql;
|
||||
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
if(poid_par_priv->information_buf_len >= sizeof(struct setdig_parm))
|
||||
{
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_dig_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_dig_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
}
|
||||
_irqlevel_changed_(&oldirql,RAISE);
|
||||
_func_exit_;
|
||||
#endif
|
||||
|
@ -197,29 +197,29 @@ NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
#if 0
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
_irqL oldirql;
|
||||
|
||||
_func_enter_;
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
||||
_func_enter_;
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(struct setra_parm))
|
||||
{
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_ra_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_ra_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
}
|
||||
_irqlevel_changed_(&oldirql,RAISE);
|
||||
_func_exit_;
|
||||
#endif
|
||||
|
@ -228,7 +228,7 @@ NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//-----------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
//DEBUG_ERR(("<**********************oid_rt_get_signal_quality_hdl \n"));
|
||||
|
@ -236,7 +236,7 @@ NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(pMgntInfo->mAssoc || pMgntInfo->mIbss)
|
||||
|
@ -258,19 +258,19 @@ NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
NDIS_STATUS oid_rt_get_small_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
{
|
||||
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_smallpacket_crcerr;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -282,19 +282,19 @@ NDIS_STATUS oid_rt_get_small_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
{
|
||||
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_middlepacket_crcerr;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -307,19 +307,19 @@ NDIS_STATUS oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_large_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
{
|
||||
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_largepacket_crcerr;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -333,27 +333,27 @@ NDIS_STATUS oid_rt_get_large_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_tx_retry_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_rx_retry_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
return status;
|
||||
}
|
||||
|
@ -367,11 +367,11 @@ NDIS_STATUS oid_rt_get_rx_total_packet_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
{
|
||||
*(u64 *)poid_par_priv->information_buf = padapter->recvpriv.rx_pkts + padapter->recvpriv.rx_drop;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -384,34 +384,34 @@ NDIS_STATUS oid_rt_get_rx_total_packet_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_tx_beacon_ok_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_tx_beacon_err_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_rx_icv_err_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
|
@ -429,46 +429,46 @@ NDIS_STATUS oid_rt_get_rx_icv_err_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_INVALID_LENGTH ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_set_encryption_algorithm_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
ULONG preamblemode = 0 ;
|
||||
|
||||
ULONG preamblemode = 0 ;
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
{
|
||||
if(padapter->registrypriv.preamble == PREAMBLE_LONG)
|
||||
preamblemode = 0;
|
||||
else if (padapter->registrypriv.preamble == PREAMBLE_AUTO)
|
||||
preamblemode = 1;
|
||||
else if (padapter->registrypriv.preamble == PREAMBLE_SHORT)
|
||||
preamblemode = 2;
|
||||
|
||||
|
||||
|
||||
|
||||
*(ULONG *)poid_par_priv->information_buf = preamblemode ;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
|
@ -481,29 +481,29 @@ NDIS_STATUS oid_rt_get_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_ap_ip_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*(u16 *)poid_par_priv->information_buf = peeprompriv->channel_plan ;
|
||||
|
||||
|
@ -511,16 +511,16 @@ NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
}
|
||||
NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
peeprompriv->channel_plan = *(u16 *)poid_par_priv->information_buf ;
|
||||
|
||||
return status;
|
||||
|
@ -528,7 +528,7 @@ NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_set_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
ULONG preamblemode = 0;
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
@ -536,31 +536,31 @@ NDIS_STATUS oid_rt_set_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
|||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
{
|
||||
preamblemode = *(ULONG *)poid_par_priv->information_buf ;
|
||||
if( preamblemode == 0)
|
||||
padapter->registrypriv.preamble = PREAMBLE_LONG;
|
||||
else if (preamblemode==1 )
|
||||
padapter->registrypriv.preamble = PREAMBLE_AUTO;
|
||||
else if ( preamblemode==2 )
|
||||
padapter->registrypriv.preamble = PREAMBLE_SHORT;
|
||||
|
||||
padapter->registrypriv.preamble = PREAMBLE_SHORT;
|
||||
|
||||
*(ULONG *)poid_par_priv->information_buf = preamblemode ;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = NDIS_STATUS_INVALID_LENGTH ;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_set_bcn_intvl_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
@ -573,7 +573,7 @@ NDIS_STATUS oid_rt_set_bcn_intvl_hdl(struct oid_par_priv* poid_par_priv)
|
|||
}
|
||||
NDIS_STATUS oid_rt_dedicate_probe_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
|
@ -581,16 +581,16 @@ NDIS_STATUS oid_rt_dedicate_probe_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
{
|
||||
*(u64 *)poid_par_priv->information_buf = padapter->xmitpriv.tx_bytes;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
|
@ -598,7 +598,7 @@ NDIS_STATUS oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_INVALID_LENGTH ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -628,40 +628,40 @@ NDIS_STATUS oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//------------------------------------------------------------------------------
|
||||
NDIS_STATUS oid_rt_current_tx_power_level_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_enc_key_mismatch_count_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_enc_key_match_count_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
NDIS_802_11_CONFIGURATION *pnic_Config;
|
||||
|
@ -673,7 +673,7 @@ NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if ( (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE))
|
||||
|
@ -683,7 +683,7 @@ NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
channelnum = pnic_Config->DSConfig;
|
||||
*(ULONG *)poid_par_priv->information_buf = channelnum;
|
||||
|
||||
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
|
||||
_func_exit_;
|
||||
|
@ -694,79 +694,79 @@ NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
|
|||
}
|
||||
NDIS_STATUS oid_rt_get_hardware_radio_off_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_key_mismatch_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_supported_wireless_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
ULONG ulInfo = 0 ;
|
||||
//DEBUG_ERR(("<**********************oid_rt_supported_wireless_mode_hdl \n"));
|
||||
ULONG ulInfo = 0 ;
|
||||
//DEBUG_ERR(("<**********************oid_rt_supported_wireless_mode_hdl \n"));
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG)){
|
||||
ulInfo |= 0x0100; //WIRELESS_MODE_B
|
||||
ulInfo |= 0x0200; //WIRELESS_MODE_G
|
||||
ulInfo |= 0x0400; //WIRELESS_MODE_A
|
||||
|
||||
*(ULONG *) poid_par_priv->information_buf = ulInfo;
|
||||
//DEBUG_ERR(("<===oid_rt_supported_wireless_mode %x\n",ulInfo));
|
||||
*(ULONG *) poid_par_priv->information_buf = ulInfo;
|
||||
//DEBUG_ERR(("<===oid_rt_supported_wireless_mode %x\n",ulInfo));
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
}
|
||||
else{
|
||||
status = NDIS_STATUS_INVALID_LENGTH;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_channel_list_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_scan_in_progress_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -774,84 +774,84 @@ NDIS_STATUS oid_rt_get_scan_in_progress_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
NDIS_STATUS oid_rt_forced_data_rate_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_wireless_mode_for_scan_list_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_get_bss_wireless_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
NDIS_STATUS oid_rt_scan_with_magic_packet_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
//************** oid_rtl_seg_01_01 section end **************
|
||||
//************** oid_rtl_seg_01_01 section end **************
|
||||
|
||||
//************** oid_rtl_seg_01_03 section start **************
|
||||
//************** oid_rtl_seg_01_03 section start **************
|
||||
NDIS_STATUS oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_ap_switch_into_ap_mode_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_ap_supported_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
return status;
|
||||
}
|
||||
NDIS_STATUS oid_rt_ap_set_passphrase_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//************** oid_rtl_seg_01_03 section end **************
|
||||
//************** oid_rtl_seg_01_03 section end **************
|
||||
|
||||
//**************** oid_rtl_seg_01_11 section start ****************
|
||||
NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv)
|
||||
|
@ -866,27 +866,27 @@ NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
|
||||
{
|
||||
{
|
||||
//RegOffsetValue - The offset of RF register to write.
|
||||
//RegDataWidth - The data width of RF register to write.
|
||||
//RegDataValue - The value to write.
|
||||
//RegDataValue - The value to write.
|
||||
//RegOffsetValue = *((unsigned long*)InformationBuffer);
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_setrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_setrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
(unsigned long)(*((unsigned long*)poid_par_priv->information_buf+2))))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
status = NDIS_STATUS_INVALID_LENGTH;
|
||||
}
|
||||
}
|
||||
_irqlevel_changed_(&oldirql,RAISE);
|
||||
_func_exit_;
|
||||
|
||||
|
@ -907,8 +907,8 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
|
||||
{
|
||||
|
@ -922,24 +922,24 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
Adapter->mppriv.act_in_progress = _TRUE;
|
||||
Adapter->mppriv.workparam.bcompleted= _FALSE;
|
||||
Adapter->mppriv.workparam.act_type = MPT_READ_RF;
|
||||
Adapter->mppriv.workparam.io_offset = *(unsigned long*)poid_par_priv->information_buf;
|
||||
Adapter->mppriv.workparam.io_offset = *(unsigned long*)poid_par_priv->information_buf;
|
||||
Adapter->mppriv.workparam.io_value = 0xcccccccc;
|
||||
|
||||
|
||||
//RegOffsetValue - The offset of RF register to read.
|
||||
//RegDataWidth - The data width of RF register to read.
|
||||
//RegDataValue - The value to read.
|
||||
//RegDataValue - The value to read.
|
||||
//RegOffsetValue = *((unsigned long*)InformationBuffer);
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_getrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_getrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
(unsigned char*)&Adapter->mppriv.workparam.io_value))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
status = NDIS_STATUS_INVALID_LENGTH;
|
||||
|
@ -950,10 +950,10 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
return status;
|
||||
}
|
||||
|
||||
//**************** oid_rtl_seg_01_11 section end****************
|
||||
//**************** oid_rtl_seg_01_11 section end****************
|
||||
|
||||
|
||||
//************** oid_rtl_seg_03_00 section start **************
|
||||
//************** oid_rtl_seg_03_00 section start **************
|
||||
enum _CONNECT_STATE_{
|
||||
CHECKINGSTATUS,
|
||||
ASSOCIATED,
|
||||
|
@ -969,21 +969,21 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
ULONG ulInfo;
|
||||
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
// nStatus==0 CheckingStatus
|
||||
// nStatus==1 Associated
|
||||
// nStatus==2 AdHocMode
|
||||
// nStatus==3 NotAssociated
|
||||
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE)
|
||||
ulInfo = CHECKINGSTATUS;
|
||||
else if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
else if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
ulInfo = ASSOCIATED;
|
||||
else if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)== _TRUE)
|
||||
ulInfo = ADHOCMODE;
|
||||
|
@ -1013,7 +1013,7 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
NDIS_STATUS oid_rt_set_default_key_id_hdl(struct oid_par_priv* poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
|
@ -1021,8 +1021,7 @@ NDIS_STATUS oid_rt_set_default_key_id_hdl(struct oid_par_priv* poid_par_priv)
|
|||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
//************** oid_rtl_seg_03_00 section end **************
|
||||
|
||||
//************** oid_rtl_seg_03_00 section end **************
|
||||
|
|
File diff suppressed because it is too large
Load diff
117
core/rtw_iol.c
117
core/rtw_iol.c
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -34,7 +34,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter)
|
|||
DBG_871X("%s rtw_alloc_xmitframe return null\n", __FUNCTION__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
if ((xmitbuf = rtw_alloc_xmitbuf(pxmitpriv)) == NULL)
|
||||
{
|
||||
DBG_871X("%s rtw_alloc_xmitbuf return null\n", __FUNCTION__);
|
||||
|
@ -42,7 +42,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter)
|
|||
xmit_frame=NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
xmit_frame->frame_tag = MGNT_FRAMETAG;
|
||||
xmit_frame->pxmitbuf = xmitbuf;
|
||||
xmit_frame->buf_addr = xmitbuf->pbuf;
|
||||
|
@ -50,8 +50,8 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter)
|
|||
|
||||
pattrib = &xmit_frame->attrib;
|
||||
update_mgntframe_attrib(adapter, pattrib);
|
||||
pattrib->qsel = 0x10;//Beacon
|
||||
pattrib->subtype = WIFI_BEACON;
|
||||
pattrib->qsel = 0x10;//Beacon
|
||||
pattrib->subtype = WIFI_BEACON;
|
||||
pattrib->pktlen = pattrib->last_txcmdsz = 0;
|
||||
|
||||
#else
|
||||
|
@ -93,11 +93,11 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
|
|||
pattrib->last_txcmdsz += cmd_len;
|
||||
|
||||
//DBG_871X("%s ori:%u + cmd_len:%u = %u\n", __FUNCTION__, ori_len, cmd_len, buf_offset+pattrib->pktlen);
|
||||
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
bool rtw_IOL_applied(struct adapter *adapter)
|
||||
{
|
||||
{
|
||||
if(1 == adapter->registrypriv.fw_iol)
|
||||
return _TRUE;
|
||||
|
||||
|
@ -137,18 +137,18 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8
|
|||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WB_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
|
||||
if(mask!=0xFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
@ -158,65 +158,65 @@ int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u
|
|||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WW_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
|
||||
if(mask!=0xFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
|
||||
}
|
||||
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u32 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WD_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
|
||||
if(mask!=0xFFFFFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, u32 value, u32 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_W_RF,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = (rf_path<<8) |((addr) &0xFF);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = (rf_path<<8) |((addr) &0xFF);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
|
||||
if(mask!=0x000FFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//DBG_871X("%s rf_path:0x%02x addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__,rf_path, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -224,8 +224,8 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr,
|
|||
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0};
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, us);
|
||||
cmd.address = cpu_to_le16(us);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, us);
|
||||
cmd.address = cpu_to_le16(us);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, us);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
|
@ -235,29 +235,29 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
|||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, ms);
|
||||
cmd.address = cpu_to_le16(ms);
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, ms);
|
||||
cmd.address = cpu_to_le16(ms);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, ms);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
}
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_END,0xFFFF, 0xFF,0x0};
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame)
|
||||
{
|
||||
{
|
||||
u8 is_cmd_bndy = _FALSE;
|
||||
if(((pxmit_frame->attrib.pktlen+32)%256) + 8 >= 256){
|
||||
rtw_IOL_append_END_cmd(pxmit_frame);
|
||||
pxmit_frame->attrib.pktlen = ((((pxmit_frame->attrib.pktlen+32)/256)+1)*256 );
|
||||
|
||||
|
||||
//printk("==> %s, pktlen(%d)\n",__FUNCTION__,pxmit_frame->attrib.pktlen);
|
||||
pxmit_frame->attrib.last_txcmdsz = pxmit_frame->attrib.pktlen;
|
||||
is_cmd_bndy = _TRUE;
|
||||
is_cmd_bndy = _TRUE;
|
||||
}
|
||||
return is_cmd_bndy;
|
||||
}
|
||||
|
@ -266,23 +266,23 @@ void rtw_IOL_cmd_buf_dump(struct adapter *Adapter,int buf_len,u8 *pbuf)
|
|||
{
|
||||
int i;
|
||||
int j=1;
|
||||
|
||||
|
||||
printk("###### %s ######\n",__FUNCTION__);
|
||||
for(i=0;i< buf_len;i++){
|
||||
printk("%02x-",*(pbuf+i));
|
||||
|
||||
if(j%32 ==0) printk("\n");j++;
|
||||
|
||||
if(j%32 ==0) printk("\n");j++;
|
||||
}
|
||||
printk("\n");
|
||||
printk("============= ioreg_cmd len = %d =============== \n",buf_len);
|
||||
printk("============= ioreg_cmd len = %d =============== \n",buf_len);
|
||||
}
|
||||
|
||||
|
||||
#else //CONFIG_IOL_NEW_GENERATION
|
||||
int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary)
|
||||
{
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_LLT, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)page_boundary);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
|
@ -291,7 +291,7 @@ int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary)
|
|||
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WB_REG, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
|
@ -301,7 +301,7 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value)
|
|||
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WW_REG, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
|
@ -312,7 +312,7 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value)
|
|||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WD_REG, 0x0, 0x0};
|
||||
u8* pos = (u8 *)&cmd;
|
||||
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
|
@ -348,7 +348,7 @@ int dbg_rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value
|
|||
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_DELAY_US, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)us);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, us);
|
||||
|
@ -359,7 +359,7 @@ int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
|||
int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_DELAY_MS, 0x0, 0x0};
|
||||
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)ms);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, ms);
|
||||
|
@ -368,7 +368,7 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
|||
}
|
||||
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
{
|
||||
IOL_CMD end_cmd = {0x0, IOL_CMD_END, 0x0, 0x0};
|
||||
|
||||
|
||||
|
@ -400,4 +400,3 @@ int rtw_IOL_exec_empty_cmds_sync(struct adapter *adapter, u32 max_wating_ms)
|
|||
|
||||
|
||||
#endif //CONFIG_IOL
|
||||
|
||||
|
|
4843
core/rtw_led.c
4843
core/rtw_led.c
File diff suppressed because it is too large
Load diff
1123
core/rtw_mlme.c
1123
core/rtw_mlme.c
File diff suppressed because it is too large
Load diff
1791
core/rtw_mlme_ext.c
1791
core/rtw_mlme_ext.c
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -176,7 +176,7 @@ _func_enter_;
|
|||
path, offset, value));
|
||||
|
||||
_irqlevel_changed_(&oldirql, LOWER);
|
||||
write_rfreg(Adapter, path, offset, value);
|
||||
write_rfreg(Adapter, path, offset, value);
|
||||
_irqlevel_changed_(&oldirql, RAISE);
|
||||
|
||||
_func_exit_;
|
||||
|
@ -828,7 +828,7 @@ NDIS_STATUS oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv
|
|||
#ifdef PLATFORM_OS_XP
|
||||
_irqL oldirql;
|
||||
#endif
|
||||
u32 bStartTest;
|
||||
u32 bStartTest;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
|
@ -924,7 +924,7 @@ NDIS_STATUS oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv)
|
|||
#ifdef PLATFORM_OS_XP
|
||||
_irqL oldirql;
|
||||
#endif
|
||||
pRW_Reg RegRWStruct;
|
||||
pRW_Reg RegRWStruct;
|
||||
u32 offset, width;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
@ -976,7 +976,7 @@ NDIS_STATUS oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv)
|
|||
#ifdef PLATFORM_OS_XP
|
||||
_irqL oldirql;
|
||||
#endif
|
||||
pRW_Reg RegRWStruct;
|
||||
pRW_Reg RegRWStruct;
|
||||
u32 offset, width, value;
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
@ -1125,7 +1125,7 @@ _func_enter_;
|
|||
TxCmd_Info=(TX_CMD_Desc*)poid_par_priv->information_buf;
|
||||
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:Addr=%.8X\n", TxCmd_Info->offset));
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:1.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[0]));
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:1.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[0]));
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:2.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[1]));
|
||||
RT_TRACE(_module_mp_, _drv_info_, (("WRITE_TXCMD:3.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[2]));
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("WRITE_TXCMD:4.)%.8X\n", (ULONG)TxCmd_Info->TxCMD.value[3]));
|
||||
|
@ -1929,7 +1929,7 @@ NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
||||
struct sta_info *psta = NULL;
|
||||
UCHAR *macaddr;
|
||||
UCHAR *macaddr;
|
||||
|
||||
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
|
@ -2693,7 +2693,7 @@ NDIS_STATUS oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv *poid_par_priv)
|
|||
#endif
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
||||
u32 txagc;
|
||||
u32 txagc;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -2728,7 +2728,7 @@ NDIS_STATUS oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv *poid_par_priv)
|
|||
|
||||
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
|
||||
struct mp_priv *pmppriv = &Adapter->mppriv;
|
||||
u32 type;
|
||||
u32 type;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -2944,4 +2944,3 @@ _func_exit_;
|
|||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -203,4 +203,3 @@ void rtw_odm_adaptivity_parm_set(struct adapter *adapter, s8 TH_L2H_ini, s8 TH_E
|
|||
odm->AdapEn_RSSI = AdapEn_RSSI;
|
||||
odm->IGI_LowerBound = IGI_LowerBound;
|
||||
}
|
||||
|
||||
|
|
571
core/rtw_p2p.c
571
core/rtw_p2p.c
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -35,34 +35,34 @@ void _ips_enter(struct adapter * padapter)
|
|||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
if (padapter->hw_init_completed == _FALSE) {
|
||||
DBG_871X("%s: hw_init_completed: %d\n",
|
||||
DBG_871X("%s: hw_init_completed: %d\n",
|
||||
__func__, padapter->hw_init_completed);
|
||||
return;
|
||||
}
|
||||
|
||||
pwrpriv->bips_processing = _TRUE;
|
||||
pwrpriv->bips_processing = _TRUE;
|
||||
|
||||
// syn ips_mode with request
|
||||
pwrpriv->ips_mode = pwrpriv->ips_mode_req;
|
||||
|
||||
pwrpriv->ips_enter_cnts++;
|
||||
|
||||
pwrpriv->ips_enter_cnts++;
|
||||
DBG_871X("==>ips_enter cnts:%d\n",pwrpriv->ips_enter_cnts);
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
BTDM_TurnOffBtCoexistBeforeEnterIPS(padapter);
|
||||
#endif
|
||||
if(rf_off == pwrpriv->change_rfpwrstate )
|
||||
{
|
||||
{
|
||||
pwrpriv->bpower_saving = _TRUE;
|
||||
DBG_871X_LEVEL(_drv_always_, "nolinked power save enter\n");
|
||||
|
||||
if(pwrpriv->ips_mode == IPS_LEVEL_2)
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
|
||||
|
||||
rtw_ips_pwr_down(padapter);
|
||||
pwrpriv->rf_pwrstate = rf_off;
|
||||
}
|
||||
pwrpriv->bips_processing = _FALSE;
|
||||
|
||||
}
|
||||
pwrpriv->bips_processing = _FALSE;
|
||||
|
||||
}
|
||||
|
||||
void ips_enter(struct adapter * padapter)
|
||||
|
@ -90,7 +90,7 @@ int _ips_leave(struct adapter * padapter)
|
|||
pwrpriv->rf_pwrstate = rf_on;
|
||||
}
|
||||
DBG_871X_LEVEL(_drv_always_, "nolinked power save leave\n");
|
||||
|
||||
|
||||
DBG_871X("==> ips_leave.....LED(0x%08x)...\n",rtw_read32(padapter,0x4c));
|
||||
pwrpriv->bips_processing = _FALSE;
|
||||
|
||||
|
@ -115,7 +115,7 @@ int ips_leave(struct adapter * padapter)
|
|||
#endif /* CONFIG_IPS */
|
||||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
extern void autosuspend_enter(struct adapter* padapter);
|
||||
extern void autosuspend_enter(struct adapter* padapter);
|
||||
extern int autoresume_enter(struct adapter* padapter);
|
||||
#endif
|
||||
|
||||
|
@ -184,15 +184,15 @@ bool rtw_pwr_unassociated_idle(struct adapter *adapter)
|
|||
if(adapter->proximity.proxim_on==_TRUE){
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (pxmit_priv->free_xmitbuf_cnt != NR_XMITBUFF ||
|
||||
pxmit_priv->free_xmit_extbuf_cnt != NR_XMIT_EXTBUFF) {
|
||||
DBG_871X_LEVEL(_drv_always_, "There are some pkts to transmit\n");
|
||||
DBG_871X_LEVEL(_drv_info_, "free_xmitbuf_cnt: %d, free_xmit_extbuf_cnt: %d\n",
|
||||
pxmit_priv->free_xmitbuf_cnt, pxmit_priv->free_xmit_extbuf_cnt);
|
||||
DBG_871X_LEVEL(_drv_info_, "free_xmitbuf_cnt: %d, free_xmit_extbuf_cnt: %d\n",
|
||||
pxmit_priv->free_xmitbuf_cnt, pxmit_priv->free_xmit_extbuf_cnt);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
ret = _TRUE;
|
||||
|
||||
|
@ -216,9 +216,9 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
if(pwrpriv->bips_processing == _TRUE)
|
||||
goto exit;
|
||||
|
||||
//DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca));
|
||||
if(pwrpriv->bHWPwrPindetect)
|
||||
|
||||
//DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca));
|
||||
if(pwrpriv->bHWPwrPindetect)
|
||||
{
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(padapter->registrypriv.usbss_enable)
|
||||
|
@ -235,14 +235,14 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
if(rfpwrstate == rf_off)
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
pwrpriv->brfoffbyhw = _TRUE;
|
||||
|
||||
autosuspend_enter(padapter);
|
||||
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
pwrpriv->brfoffbyhw = _TRUE;
|
||||
|
||||
autosuspend_enter(padapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_AUTOSUSPEND
|
||||
|
@ -253,21 +253,21 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
if(rfpwrstate!= pwrpriv->rf_pwrstate)
|
||||
{
|
||||
if(rfpwrstate == rf_off)
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
pwrpriv->brfoffbyhw = _TRUE;
|
||||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
rtw_hw_suspend(padapter );
|
||||
rtw_hw_suspend(padapter );
|
||||
}
|
||||
else
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_on;
|
||||
rtw_hw_resume(padapter );
|
||||
rtw_hw_resume(padapter );
|
||||
}
|
||||
DBG_871X("current rf_pwrstate(%s)\n",(pwrpriv->rf_pwrstate == rf_off)?"rf_off":"rf_on");
|
||||
}
|
||||
}
|
||||
pwrpriv->pwr_state_check_cnts ++;
|
||||
pwrpriv->pwr_state_check_cnts ++;
|
||||
}
|
||||
#endif //SUPPORT_HW_RFOFF_DETECTED
|
||||
|
||||
|
@ -287,9 +287,9 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(padapter->registrypriv.usbss_enable)
|
||||
{
|
||||
if(pwrpriv->bHWPwrPindetect)
|
||||
if(pwrpriv->bHWPwrPindetect)
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
|
||||
|
||||
if(padapter->net_closed == _TRUE)
|
||||
pwrpriv->ps_flag = _TRUE;
|
||||
|
||||
|
@ -301,12 +301,12 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x) call autosuspend_enter\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend);
|
||||
autosuspend_enter(padapter);
|
||||
}
|
||||
}
|
||||
#else
|
||||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
autosuspend_enter(padapter);
|
||||
#endif //if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
}
|
||||
else if(pwrpriv->bHWPwrPindetect)
|
||||
{
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ void rtw_ps_processor(struct adapter*padapter)
|
|||
#endif //defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
ips_enter(padapter);
|
||||
ips_enter(padapter);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ _func_enter_;
|
|||
//cpwm_orig = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HCPWM1);
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_GET_CPWM, (u8 *)(&cpwm_orig));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_LPS_RPWM_TIMER) && !defined(CONFIG_DETECT_CPWM_BY_POLLING)
|
||||
if (rpwm & PS_ACK)
|
||||
|
@ -446,7 +446,7 @@ _func_enter_;
|
|||
//polling cpwm
|
||||
do{
|
||||
rtw_mdelay_os(1);
|
||||
|
||||
|
||||
//cpwm_now = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HCPWM1);
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_GET_CPWM, (u8 *)(&cpwm_now));
|
||||
if ((cpwm_orig ^ cpwm_now) & 0x80)
|
||||
|
@ -490,11 +490,11 @@ u8 PS_RDY_CHECK(struct adapter * padapter)
|
|||
return _FALSE;
|
||||
#endif
|
||||
|
||||
curr_time = rtw_get_current_time();
|
||||
curr_time = rtw_get_current_time();
|
||||
delta_time = curr_time -pwrpriv->DelayLPSLastTimeStamp;
|
||||
|
||||
if(delta_time < LPS_DELAY_TIME)
|
||||
{
|
||||
{
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
|
@ -515,7 +515,7 @@ u8 PS_RDY_CHECK(struct adapter * padapter)
|
|||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
if (!rtw_cfg80211_pwr_mgmt(padapter))
|
||||
return _FALSE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
@ -740,11 +740,11 @@ _func_enter_;
|
|||
struct mlme_priv *b_pmlmepriv = &(buddy->mlmepriv);
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *b_pwdinfo = &(buddy->wdinfo);
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
struct cfg80211_wifidirect_info *b_pcfg80211_wdinfo = &buddy->cfg80211_wdinfo;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
if (check_fwstate(b_pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR)
|
||||
|| check_fwstate(b_pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS)
|
||||
|| check_fwstate(b_pmlmepriv, WIFI_AP_STATE)
|
||||
|
@ -767,7 +767,7 @@ _func_enter_;
|
|||
if (_TRUE == pwrpriv->bLeisurePs)
|
||||
{
|
||||
// Idle for a while if we connect to AP a while ago.
|
||||
if(pwrpriv->LpsIdleCount >= 2) // 4 Sec
|
||||
if(pwrpriv->LpsIdleCount >= 2) // 4 Sec
|
||||
{
|
||||
if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
{
|
||||
|
@ -828,7 +828,7 @@ _func_exit_;
|
|||
|
||||
//
|
||||
// Description: Leave all power save mode: LPS, FwLPS, IPS if needed.
|
||||
// Move code to function by tynli. 2010.03.26.
|
||||
// Move code to function by tynli. 2010.03.26.
|
||||
//
|
||||
void LeaveAllPowerSaveMode(IN struct adapter *Adapter)
|
||||
{
|
||||
|
@ -854,7 +854,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
LPS_Leave_check(Adapter);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -876,12 +876,12 @@ _func_enter_;
|
|||
#ifdef CONFIG_IPS
|
||||
if(_FALSE == ips_leave(Adapter))
|
||||
{
|
||||
DBG_871X("======> ips_leave fail.............\n");
|
||||
DBG_871X("======> ips_leave fail.............\n");
|
||||
}
|
||||
#endif
|
||||
#endif //CONFIG_PLATFORM_SPRD
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
|
@ -903,7 +903,7 @@ _func_enter_;
|
|||
start_time = rtw_get_current_time();
|
||||
|
||||
rtw_yield_os();
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
@ -1091,13 +1091,13 @@ __inline static void unregister_task_alive(struct pwrctrl_priv *pwrctrl, u32 tag
|
|||
|
||||
/*
|
||||
* Caller: rtw_xmit_thread
|
||||
*
|
||||
*
|
||||
* Check if the fw_pwrstate is okay for xmit.
|
||||
* If not (cpwm is less than S3), then the sub-routine
|
||||
* will raise the cpwm to be greater than or equal to S3.
|
||||
* will raise the cpwm to be greater than or equal to S3.
|
||||
*
|
||||
* Calling Context: Passive
|
||||
*
|
||||
*
|
||||
* Return Value:
|
||||
* _SUCCESS rtw_xmit_thread can write fifo/txcmd afterwards.
|
||||
* _FAIL rtw_xmit_thread can not do anything.
|
||||
|
@ -1152,7 +1152,7 @@ _func_enter_;
|
|||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1435,7 +1435,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
pwrctrlpriv->pwr_state_check_interval = (pwrctrlpriv->bHWPwrPindetect) ?1000:2000;
|
||||
pwrctrlpriv->pwr_state_check_interval = (pwrctrlpriv->bHWPwrPindetect) ?1000:2000;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -1443,7 +1443,7 @@ _func_enter_;
|
|||
//pwrctrlpriv->FWCtrlPSMode =padapter->registrypriv.power_mgnt;// PS_MODE_MIN;
|
||||
if (padapter->registrypriv.mp_mode == 1)
|
||||
pwrctrlpriv->power_mgnt =PS_MODE_ACTIVE ;
|
||||
else
|
||||
else
|
||||
pwrctrlpriv->power_mgnt =padapter->registrypriv.power_mgnt;// PS_MODE_MIN;
|
||||
pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt)?_TRUE:_FALSE;
|
||||
|
||||
|
@ -1497,7 +1497,7 @@ void rtw_free_pwrctrl_priv(struct adapter *adapter)
|
|||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (adapter->adapter_type != PRIMARY_ADAPTER)
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -1505,7 +1505,7 @@ _func_enter_;
|
|||
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
if (pwrctrlpriv->rtw_workqueue) {
|
||||
if (pwrctrlpriv->rtw_workqueue) {
|
||||
flush_workqueue(pwrctrlpriv->rtw_workqueue);
|
||||
destroy_workqueue(pwrctrlpriv->rtw_workqueue);
|
||||
}
|
||||
|
@ -1536,16 +1536,16 @@ static void resume_workitem_callback(struct work_struct *work)
|
|||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
rtw_resume_process(adapter);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv)
|
||||
{
|
||||
// accquire system's suspend lock preventing from falliing asleep while resume in workqueue
|
||||
rtw_lock_suspend();
|
||||
|
||||
|
||||
#if 1
|
||||
queue_work(pwrpriv->rtw_workqueue, &pwrpriv->resume_work);
|
||||
queue_work(pwrpriv->rtw_workqueue, &pwrpriv->resume_work);
|
||||
#else
|
||||
_set_workitem(&pwrpriv->resume_work);
|
||||
#endif
|
||||
|
@ -1604,7 +1604,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
pwrpriv->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20;
|
||||
pwrpriv->early_suspend.suspend = rtw_early_suspend;
|
||||
pwrpriv->early_suspend.resume = rtw_late_resume;
|
||||
register_early_suspend(&pwrpriv->early_suspend);
|
||||
register_early_suspend(&pwrpriv->early_suspend);
|
||||
}
|
||||
|
||||
void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
||||
|
@ -1613,7 +1613,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
|
||||
rtw_set_do_late_resume(pwrpriv, _FALSE);
|
||||
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
unregister_early_suspend(&pwrpriv->early_suspend);
|
||||
|
||||
pwrpriv->early_suspend.suspend = NULL;
|
||||
|
@ -1656,7 +1656,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
pwrpriv->early_suspend.level = ANDROID_EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20;
|
||||
pwrpriv->early_suspend.suspend = rtw_early_suspend;
|
||||
pwrpriv->early_suspend.resume = rtw_late_resume;
|
||||
android_register_early_suspend(&pwrpriv->early_suspend);
|
||||
android_register_early_suspend(&pwrpriv->early_suspend);
|
||||
}
|
||||
|
||||
void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
||||
|
@ -1665,7 +1665,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
|
||||
rtw_set_do_late_resume(pwrpriv, _FALSE);
|
||||
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
android_unregister_early_suspend(&pwrpriv->early_suspend);
|
||||
|
||||
pwrpriv->early_suspend.suspend = NULL;
|
||||
|
@ -1677,7 +1677,7 @@ u8 rtw_interface_ps_func(struct adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8*
|
|||
{
|
||||
u8 bResult = _TRUE;
|
||||
rtw_hal_intf_ps_func(padapter,efunc_id,val);
|
||||
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -1698,7 +1698,7 @@ inline void rtw_set_ips_deny(struct adapter *padapter, u32 ms)
|
|||
int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
int ret = _SUCCESS;
|
||||
u32 start = rtw_get_current_time();
|
||||
|
||||
|
@ -1740,7 +1740,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
|
||||
if (pwrpriv->bInternalAutoSuspend == _FALSE && pwrpriv->bInSuspend) {
|
||||
DBG_871X("%s wait bInSuspend...\n", __func__);
|
||||
while (pwrpriv->bInSuspend
|
||||
while (pwrpriv->bInSuspend
|
||||
&& ((rtw_get_passing_time_ms(start) <= 3000 && !rtw_is_do_late_resume(pwrpriv))
|
||||
|| (rtw_get_passing_time_ms(start) <= 500 && rtw_is_do_late_resume(pwrpriv)))
|
||||
) {
|
||||
|
@ -1770,12 +1770,12 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
if(_TRUE==pwrpriv->bInternalAutoSuspend){
|
||||
if(0==pwrpriv->autopm_cnt){
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
|
||||
if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0)
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
|
||||
if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0)
|
||||
{
|
||||
DBG_871X( "can't get autopm: \n");
|
||||
}
|
||||
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
|
||||
}
|
||||
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
|
||||
usb_autopm_disable(adapter_to_dvobj(padapter)->pusbintf);
|
||||
#else
|
||||
usb_autoresume_device(adapter_to_dvobj(padapter)->pusbdev, 1);
|
||||
|
@ -1788,10 +1788,10 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
#endif //#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
}
|
||||
|
||||
if(rf_off == pwrpriv->rf_pwrstate )
|
||||
{
|
||||
{
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(pwrpriv->brfoffbyhw==_TRUE)
|
||||
|
@ -1808,7 +1808,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
DBG_8192C("======> autoresume fail.............\n");
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -1833,9 +1833,9 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
){
|
||||
DBG_8192C("%s: bDriverStopped=%d, bup=%d, hw_init_completed=%u\n"
|
||||
, caller
|
||||
, padapter->bDriverStopped
|
||||
, padapter->bup
|
||||
, padapter->hw_init_completed);
|
||||
, padapter->bDriverStopped
|
||||
, padapter->bup
|
||||
, padapter->hw_init_completed);
|
||||
ret= _FALSE;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1849,9 +1849,9 @@ exit:
|
|||
|
||||
int rtw_pm_set_lps(struct adapter *padapter, u8 mode)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret = 0;
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
|
||||
if ( mode < PS_MODE_NUM )
|
||||
{
|
||||
if(pwrctrlpriv->power_mgnt !=mode)
|
||||
|
@ -1884,7 +1884,7 @@ int rtw_pm_set_ips(struct adapter *padapter, u8 mode)
|
|||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
DBG_871X("%s %s\n", __FUNCTION__, mode == IPS_NORMAL?"IPS_NORMAL":"IPS_LEVEL_2");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else if(mode ==IPS_NONE){
|
||||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
DBG_871X("%s %s\n", __FUNCTION__, "IPS_NONE");
|
||||
|
@ -1896,5 +1896,3 @@ int rtw_pm_set_ips(struct adapter *padapter, u8 mode)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
301
core/rtw_recv.c
301
core/rtw_recv.c
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -88,7 +88,7 @@ _func_enter_;
|
|||
rtw_os_recv_resource_init(precvpriv, padapter);
|
||||
|
||||
precvpriv->pallocated_frame_buf = rtw_zvmalloc(NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ);
|
||||
|
||||
|
||||
if(precvpriv->pallocated_frame_buf==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -148,7 +148,7 @@ void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv);
|
|||
void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv)
|
||||
{
|
||||
_rtw_spinlock_free(&precvpriv->lock);
|
||||
#ifdef CONFIG_RECV_THREAD_MODE
|
||||
#ifdef CONFIG_RECV_THREAD_MODE
|
||||
_rtw_free_sema(&precvpriv->recv_sema);
|
||||
_rtw_free_sema(&precvpriv->terminate_recvthread_sema);
|
||||
#endif
|
||||
|
@ -225,7 +225,7 @@ union recv_frame *rtw_alloc_recvframe (_queue *pfree_recv_queue)
|
|||
{
|
||||
_irqL irqL;
|
||||
union recv_frame *precvframe;
|
||||
|
||||
|
||||
_enter_critical_bh(&pfree_recv_queue->lock, &irqL);
|
||||
|
||||
precvframe = _rtw_alloc_recvframe(pfree_recv_queue);
|
||||
|
@ -257,8 +257,8 @@ _func_enter_;
|
|||
padapter = padapter->pbuddy_adapter;//get primary_padapter
|
||||
precvpriv = &padapter->recvpriv;
|
||||
pfree_recv_queue = &precvpriv->free_recv_queue;
|
||||
precvframe->u.hdr.adapter = padapter;
|
||||
}
|
||||
precvframe->u.hdr.adapter = padapter;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -324,7 +324,7 @@ sint rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue)
|
|||
{
|
||||
sint ret;
|
||||
_irqL irqL;
|
||||
|
||||
|
||||
//_spinlock(&pfree_recv_queue->lock);
|
||||
_enter_critical_bh(&queue->lock, &irqL);
|
||||
ret = _rtw_enqueue_recvframe(precvframe, queue);
|
||||
|
@ -354,7 +354,7 @@ using spinlock to protect
|
|||
|
||||
void rtw_free_recvframe_queue(_queue *pframequeue, _queue *pfree_recv_queue)
|
||||
{
|
||||
union recv_frame *precvframe;
|
||||
union recv_frame *precvframe;
|
||||
_list *plist, *phead;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -412,7 +412,7 @@ sint rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, _queue *queue)
|
|||
|
||||
sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue)
|
||||
{
|
||||
_irqL irqL;
|
||||
_irqL irqL;
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
_enter_critical_bh(&queue->lock, &irqL);
|
||||
#else
|
||||
|
@ -422,27 +422,27 @@ sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue)
|
|||
rtw_list_delete(&precvbuf->list);
|
||||
|
||||
rtw_list_insert_tail(&precvbuf->list, get_list_head(queue));
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
_exit_critical_bh(&queue->lock, &irqL);
|
||||
#else
|
||||
_exit_critical_ex(&queue->lock, &irqL);
|
||||
#endif/*#ifdef CONFIG_SDIO_HCI*/
|
||||
return _SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
|
||||
struct recv_buf *rtw_dequeue_recvbuf (_queue *queue)
|
||||
{
|
||||
_irqL irqL;
|
||||
struct recv_buf *precvbuf;
|
||||
_list *plist, *phead;
|
||||
_list *plist, *phead;
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
_enter_critical_bh(&queue->lock, &irqL);
|
||||
#else
|
||||
_enter_critical_ex(&queue->lock, &irqL);
|
||||
#endif/*#ifdef CONFIG_SDIO_HCI*/
|
||||
|
||||
|
||||
if(_rtw_queue_empty(queue) == _TRUE)
|
||||
{
|
||||
precvbuf = NULL;
|
||||
|
@ -456,7 +456,7 @@ struct recv_buf *rtw_dequeue_recvbuf (_queue *queue)
|
|||
precvbuf = LIST_CONTAINOR(plist, struct recv_buf, list);
|
||||
|
||||
rtw_list_delete(&precvbuf->list);
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
|
@ -481,7 +481,7 @@ sint recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe){
|
|||
//u8 *iv,rxdata_key_idx=0;
|
||||
struct sta_info *stainfo;
|
||||
struct rx_pkt_attrib *prxattrib=&precvframe->u.hdr.attrib;
|
||||
struct security_priv *psecuritypriv=&adapter->securitypriv;
|
||||
struct security_priv *psecuritypriv=&adapter->securitypriv;
|
||||
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
@ -504,11 +504,11 @@ _func_enter_;
|
|||
//iv = precvframe->u.hdr.rx_data+prxattrib->hdrlen;
|
||||
//rxdata_key_idx =( ((iv[3])>>6)&0x3) ;
|
||||
mickey=&psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0];
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n recvframe_chkmic: bcmc key \n"));
|
||||
//DBG_871X("\n recvframe_chkmic: bcmc key psecuritypriv->dot118021XGrpKeyid(%d),pmlmeinfo->key_index(%d) ,recv key_id(%d)\n",
|
||||
// psecuritypriv->dot118021XGrpKeyid,pmlmeinfo->key_index,rxdata_key_idx);
|
||||
|
||||
|
||||
if(psecuritypriv->binstallGrpkey==_FALSE)
|
||||
{
|
||||
res=_FAIL;
|
||||
|
@ -573,7 +573,7 @@ _func_enter_;
|
|||
// cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue
|
||||
if((IS_MCAST(prxattrib->ra)==_TRUE) && (prxattrib->key_index != pmlmeinfo->key_index ))
|
||||
brpt_micerror = _FALSE;
|
||||
|
||||
|
||||
if((prxattrib->bdecrypted ==_TRUE)&& (brpt_micerror == _TRUE))
|
||||
{
|
||||
rtw_handle_tkip_mic_err(adapter,(u8)IS_MCAST(prxattrib->ra));
|
||||
|
@ -642,13 +642,13 @@ _func_enter_;
|
|||
case _WEP104_:
|
||||
prxattrib->key_index = psecuritypriv->dot11PrivacyKeyIndex;
|
||||
break;
|
||||
case _TKIP_:
|
||||
case _AES_:
|
||||
case _TKIP_:
|
||||
case _AES_:
|
||||
default:
|
||||
prxattrib->key_index = psecuritypriv->dot118021XGrpKeyid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((prxattrib->encrypt>0) && ((prxattrib->bdecrypted==0) ||(psecuritypriv->sw_decrypt==_TRUE)))
|
||||
|
@ -656,7 +656,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(!IS_MCAST(prxattrib->ra))//bc/mc packets use sw decryption for concurrent mode
|
||||
#endif
|
||||
#endif
|
||||
psecuritypriv->hw_decrypted=_FALSE;
|
||||
|
||||
#ifdef DBG_RX_DECRYPTOR
|
||||
|
@ -718,12 +718,12 @@ _func_enter_;
|
|||
, prxattrib->bdecrypted ,prxattrib->encrypt, psecuritypriv->hw_decrypted);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if(res == _FAIL)
|
||||
{
|
||||
rtw_free_recvframe(return_packet,&padapter->recvpriv.free_recv_queue);
|
||||
rtw_free_recvframe(return_packet,&padapter->recvpriv.free_recv_queue);
|
||||
return_packet = NULL;
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
prxattrib->bdecrypted = _TRUE;
|
||||
|
@ -746,7 +746,7 @@ union recv_frame * portctrl(struct adapter *adapter,union recv_frame * precv_fra
|
|||
struct sta_priv *pstapriv ;
|
||||
union recv_frame *prtnframe;
|
||||
u16 ether_type=0;
|
||||
u16 eapol_type = 0x888e;//for Funia BD's WPA issue
|
||||
u16 eapol_type = 0x888e;//for Funia BD's WPA issue
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -911,13 +911,13 @@ void process_pwrbit_data(struct adapter *padapter, union recv_frame *precv_frame
|
|||
void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame);
|
||||
void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
||||
{
|
||||
#ifdef CONFIG_AP_MODE
|
||||
#ifdef CONFIG_AP_MODE
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta=NULL;
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, pattrib->src);
|
||||
|
||||
|
||||
if(!psta) return;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
|
@ -930,15 +930,15 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
if(!(psta->qos_info&0xf))
|
||||
return;
|
||||
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
}
|
||||
#endif //CONFIG_TDLS
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
if(psta->state&WIFI_SLEEP_STATE)
|
||||
{
|
||||
u8 wmmps_ac=0;
|
||||
|
||||
u8 wmmps_ac=0;
|
||||
|
||||
switch(pattrib->priority)
|
||||
{
|
||||
case 1:
|
||||
|
@ -957,7 +957,7 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
case 3:
|
||||
default:
|
||||
wmmps_ac = psta->uapsd_be&BIT(1);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if(wmmps_ac)
|
||||
|
@ -973,11 +973,11 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
issue_qos_nulldata(padapter, psta->hwaddr, (u16)pattrib->priority, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
@ -994,11 +994,11 @@ sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
struct tdls_info *ptdlsinfo = &(adapter->tdlsinfo);
|
||||
|
||||
//point to action field
|
||||
paction+=pattrib->hdrlen
|
||||
+ pattrib->iv_len
|
||||
+ SNAP_SIZE
|
||||
+ ETH_TYPE_LEN
|
||||
+ PAYLOAD_TYPE_LEN
|
||||
paction+=pattrib->hdrlen
|
||||
+ pattrib->iv_len
|
||||
+ SNAP_SIZE
|
||||
+ ETH_TYPE_LEN
|
||||
+ PAYLOAD_TYPE_LEN
|
||||
+ category_field;
|
||||
|
||||
if(ptdlsinfo->enable == 0)
|
||||
|
@ -1008,14 +1008,14 @@ sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
ret = _FAIL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
switch(*paction){
|
||||
case TDLS_SETUP_REQUEST:
|
||||
DBG_871X("recv tdls setup request frame\n");
|
||||
ret=On_TDLS_Setup_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_RESPONSE:
|
||||
DBG_871X("recv tdls setup response frame\n");
|
||||
DBG_871X("recv tdls setup response frame\n");
|
||||
ret=On_TDLS_Setup_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_CONFIRM:
|
||||
|
@ -1042,7 +1042,7 @@ sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
DBG_871X("recv tdls channel switch response frame\n");
|
||||
ret=On_TDLS_Ch_Switch_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
#ifdef CONFIG_WFD
|
||||
#ifdef CONFIG_WFD
|
||||
case 0x50: //First byte of WFA OUI
|
||||
if( _rtw_memcmp(WFA_OUI, (paction), 3) )
|
||||
{
|
||||
|
@ -1070,7 +1070,7 @@ sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
|
||||
exit:
|
||||
return ret;
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1121,14 +1121,14 @@ sint sta2sta_data_frame(
|
|||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
sint ret = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
u8 *mybssid = get_bssid(pmlmepriv);
|
||||
u8 *myhwaddr = myid(&adapter->eeprompriv);
|
||||
u8 * sta_addr = NULL;
|
||||
sint bmcast = IS_MCAST(pattrib->dst);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
struct sta_info *ptdls_sta=NULL;
|
||||
u8 *psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
|
||||
|
@ -1241,12 +1241,12 @@ _func_enter_;
|
|||
ret= OnTDLS(adapter, precv_frame);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
sta_addr = pattrib->src;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_TDLS
|
||||
{
|
||||
|
@ -1335,7 +1335,7 @@ sint ap2sta_data_frame(
|
|||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
sint ret = _SUCCESS;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
u8 *mybssid = get_bssid(pmlmepriv);
|
||||
u8 *myhwaddr = myid(&adapter->eeprompriv);
|
||||
|
@ -1344,7 +1344,7 @@ sint ap2sta_data_frame(
|
|||
_func_enter_;
|
||||
|
||||
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)
|
||||
&& (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE
|
||||
&& (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE
|
||||
|| check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE )
|
||||
)
|
||||
{
|
||||
|
@ -1355,7 +1355,7 @@ _func_enter_;
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s SA="MAC_FMT", myhwaddr="MAC_FMT"\n",
|
||||
__FUNCTION__, MAC_ARG(pattrib->src), MAC_ARG(myhwaddr));
|
||||
#endif
|
||||
#endif
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1461,11 +1461,11 @@ _func_enter_;
|
|||
if (*psta == NULL)
|
||||
{
|
||||
DBG_871X("issue_deauth to the ap=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid));
|
||||
|
||||
|
||||
issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ret = _FAIL;
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s fw_state:0x%x\n", __FUNCTION__, get_fwstate(pmlmepriv));
|
||||
|
@ -1491,9 +1491,9 @@ sint sta2ap_data_frame(
|
|||
{
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
unsigned char *mybssid = get_bssid(pmlmepriv);
|
||||
unsigned char *mybssid = get_bssid(pmlmepriv);
|
||||
sint ret=_SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -1560,11 +1560,11 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
u8 *pframe = precv_frame->u.hdr.rx_data;
|
||||
//uint len = precv_frame->u.hdr.len;
|
||||
|
||||
|
||||
//DBG_871X("+validate_recv_ctrl_frame\n");
|
||||
|
||||
if (GetFrameType(pframe) != WIFI_CTRL_TYPE)
|
||||
{
|
||||
{
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
@ -1578,12 +1578,12 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
if(GetFrameSubType(pframe) == WIFI_PSPOLL)
|
||||
{
|
||||
u16 aid;
|
||||
u8 wmmps_ac=0;
|
||||
u8 wmmps_ac=0;
|
||||
struct sta_info *psta=NULL;
|
||||
|
||||
|
||||
aid = GetAid(pframe);
|
||||
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
|
||||
|
||||
|
||||
if((psta==NULL) || (psta->aid!=aid))
|
||||
{
|
||||
return _FAIL;
|
||||
|
@ -1610,26 +1610,26 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
case 3:
|
||||
default:
|
||||
wmmps_ac = psta->uapsd_be&BIT(0);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if(wmmps_ac)
|
||||
return _FAIL;
|
||||
|
||||
if(psta->state & WIFI_STA_ALIVE_CHK_STATE)
|
||||
{
|
||||
{
|
||||
DBG_871X("%s alive check-rx ps-poll\n", __func__);
|
||||
psta->expire_to = pstapriv->expire_to;
|
||||
psta->state ^= WIFI_STA_ALIVE_CHK_STATE;
|
||||
}
|
||||
}
|
||||
|
||||
if((psta->state&WIFI_SLEEP_STATE) && (pstapriv->sta_dz_bitmap&BIT(psta->aid)))
|
||||
{
|
||||
_irqL irqL;
|
||||
_irqL irqL;
|
||||
_list *xmitframe_plist, *xmitframe_phead;
|
||||
struct xmit_frame *pxmitframe=NULL;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
|
||||
//_enter_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
|
@ -1637,7 +1637,7 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
xmitframe_plist = get_next(xmitframe_phead);
|
||||
|
||||
if ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE)
|
||||
{
|
||||
{
|
||||
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
|
||||
|
||||
xmitframe_plist = get_next(xmitframe_plist);
|
||||
|
@ -1656,12 +1656,12 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
//DBG_871X("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap);
|
||||
|
||||
#if 0
|
||||
_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
if(rtw_hal_xmit(padapter, pxmitframe) == _TRUE)
|
||||
{
|
||||
{
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
}
|
||||
_enter_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_enter_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
#endif
|
||||
rtw_hal_xmitframe_enqueue(padapter, pxmitframe);
|
||||
|
||||
|
@ -1672,19 +1672,19 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
//DBG_871X("after handling ps-poll, tim=%x\n", pstapriv->tim_bitmap);
|
||||
|
||||
//upate BCN for TIM IE
|
||||
//update_BCNTIM(padapter);
|
||||
//update_BCNTIM(padapter);
|
||||
update_beacon(padapter, _TIM_IE_, NULL, _FALSE);
|
||||
}
|
||||
|
||||
|
||||
//_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
|
||||
//DBG_871X("no buffered packets to xmit\n");
|
||||
if(pstapriv->tim_bitmap&BIT(psta->aid))
|
||||
{
|
||||
|
@ -1698,22 +1698,22 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
else
|
||||
{
|
||||
DBG_871X("error!psta->sleepq_len=%d\n", psta->sleepq_len);
|
||||
psta->sleepq_len=0;
|
||||
psta->sleepq_len=0;
|
||||
}
|
||||
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
||||
//upate BCN for TIM IE
|
||||
//update_BCNTIM(padapter);
|
||||
update_beacon(padapter, _TIM_IE_, NULL, _FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
return _FAIL;
|
||||
|
@ -1764,7 +1764,7 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data))
|
||||
|| is_multicast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)))
|
||||
psta->sta_stats.rx_probersp_bm_pkts++;
|
||||
else
|
||||
else
|
||||
psta->sta_stats.rx_probersp_uo_pkts++;
|
||||
}
|
||||
}
|
||||
|
@ -1776,7 +1776,7 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
struct rx_pkt_attrib * pattrib=&precv_frame->u.hdr.attrib;
|
||||
struct recv_stat* prxstat=( struct recv_stat * ) precv_frame->u.hdr.rx_head ;
|
||||
u8 * pda,*psa,*pbssid,*ptr;
|
||||
ptr=precv_frame->u.hdr.rx_data;
|
||||
ptr=precv_frame->u.hdr.rx_data;
|
||||
pda = get_da(ptr);
|
||||
psa = get_sa(ptr);
|
||||
pbssid = get_hdr_bssid(ptr);
|
||||
|
@ -1813,7 +1813,7 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_
|
|||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
pattrib->priority=0;
|
||||
pattrib->hdrlen = pattrib->to_fr_ds==3 ? 30 : 24;
|
||||
|
||||
|
@ -1834,8 +1834,8 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f
|
|||
struct sta_info *psta = NULL;
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
sint ret = _SUCCESS;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
|
@ -1912,11 +1912,11 @@ _func_enter_;
|
|||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
//psta->rssi = prxcmd->rssi;
|
||||
//psta->signal_quality= prxcmd->sq;
|
||||
precv_frame->u.hdr.psta = psta;
|
||||
|
||||
|
||||
|
||||
pattrib->amsdu=0;
|
||||
pattrib->ack_policy = 0;
|
||||
|
@ -2005,22 +2005,22 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec
|
|||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
u8 type;
|
||||
u8 subtype;
|
||||
|
||||
|
||||
type = GetFrameType(ptr);
|
||||
subtype = GetFrameSubType(ptr); //bit(7)~bit(2)
|
||||
|
||||
|
||||
//only support station mode
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED)
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED)
|
||||
&& adapter->securitypriv.binstallBIPkey == _TRUE)
|
||||
{
|
||||
//unicast management frame decrypt
|
||||
if(pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) &&
|
||||
if(pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) &&
|
||||
(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_ACTION))
|
||||
{
|
||||
u8 *ppp, *mgmt_DATA;
|
||||
u32 data_len=0;
|
||||
ppp = GetAddr2Ptr(ptr);
|
||||
|
||||
|
||||
pattrib->bdecrypted = 0;
|
||||
pattrib->encrypt = _AES_;
|
||||
pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
|
@ -2044,7 +2044,7 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec
|
|||
printk(" %02x ", ptr[pp]);
|
||||
printk("\n");
|
||||
}*/
|
||||
|
||||
|
||||
precv_frame = decryptor(adapter, precv_frame);
|
||||
//save actual management data frame body
|
||||
_rtw_memcpy(mgmt_DATA, ptr+pattrib->hdrlen+pattrib->iv_len, data_len);
|
||||
|
@ -2111,10 +2111,10 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec
|
|||
}
|
||||
}
|
||||
return _SUCCESS;
|
||||
|
||||
|
||||
validate_80211w_fail:
|
||||
return _FAIL;
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_IEEE80211W
|
||||
|
||||
|
@ -2210,7 +2210,7 @@ _func_enter_;
|
|||
if(bDumpRxPkt ==1){//dump all rx packets
|
||||
int i;
|
||||
DBG_871X("############################# \n");
|
||||
|
||||
|
||||
for(i=0; i<64;i=i+8)
|
||||
DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i),
|
||||
*(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7));
|
||||
|
@ -2231,7 +2231,7 @@ _func_enter_;
|
|||
if(type== WIFI_DATA_TYPE){
|
||||
int i;
|
||||
DBG_871X("############################# \n");
|
||||
|
||||
|
||||
for(i=0; i<64;i=i+8)
|
||||
DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i),
|
||||
*(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7));
|
||||
|
@ -2250,7 +2250,7 @@ _func_enter_;
|
|||
break;
|
||||
}
|
||||
#endif //CONFIG_IEEE80211W
|
||||
|
||||
|
||||
retval = validate_recv_mgnt_frame(adapter, precv_frame);
|
||||
if (retval == _FAIL)
|
||||
{
|
||||
|
@ -2272,7 +2272,7 @@ _func_enter_;
|
|||
external_len = 2;
|
||||
else
|
||||
external_len= 0;
|
||||
|
||||
|
||||
wai_pkt = rtw_wapi_is_wai_packet(adapter,ptr);
|
||||
|
||||
phdr->bIsWaiPacket = wai_pkt;
|
||||
|
@ -2337,7 +2337,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe)
|
|||
u8 bsnaphdr;
|
||||
u8 *psnap_type;
|
||||
struct ieee80211_snap_hdr *psnap;
|
||||
|
||||
|
||||
sint ret=_SUCCESS;
|
||||
struct adapter *adapter =precvframe->u.hdr.adapter;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
@ -2348,7 +2348,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe)
|
|||
_func_enter_;
|
||||
|
||||
if(pattrib->encrypt){
|
||||
recvframe_pull_tail(precvframe, pattrib->icv_len);
|
||||
recvframe_pull_tail(precvframe, pattrib->icv_len);
|
||||
}
|
||||
|
||||
psnap=(struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len);
|
||||
|
@ -2356,7 +2356,7 @@ _func_enter_;
|
|||
/* convert hdr + possible LLC headers into Ethernet header */
|
||||
//eth_type = (psnap_type[0] << 8) | psnap_type[1];
|
||||
if((_rtw_memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) &&
|
||||
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == _FALSE) &&
|
||||
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == _FALSE) &&
|
||||
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2)==_FALSE) )||
|
||||
//eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) ||
|
||||
_rtw_memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)){
|
||||
|
@ -2377,9 +2377,9 @@ _func_enter_;
|
|||
eth_type= ntohs((unsigned short )eth_type); //pattrib->ether_type
|
||||
pattrib->eth_type = eth_type;
|
||||
|
||||
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE))
|
||||
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE))
|
||||
{
|
||||
ptr += rmv_len ;
|
||||
ptr += rmv_len ;
|
||||
*ptr = 0x87;
|
||||
*(ptr+1) = 0x12;
|
||||
|
||||
|
@ -2401,7 +2401,7 @@ _func_enter_;
|
|||
_rtw_memcpy(ptr+12, &len, 2);
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
@ -2431,7 +2431,7 @@ _func_enter_;
|
|||
if (psnap->dsap==0xaa && psnap->ssap==0xaa && psnap->ctrl==0x03)
|
||||
{
|
||||
if (_rtw_memcmp(psnap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN))
|
||||
bsnaphdr=_TRUE;//wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042;
|
||||
bsnaphdr=_TRUE;//wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042;
|
||||
else if (_rtw_memcmp(psnap->oui, SNAP_HDR_APPLETALK_DDP, WLAN_IEEE_OUI_LEN) &&
|
||||
_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_DDP, 2) )
|
||||
bsnaphdr=_TRUE; //wlan_pkt_format = WLAN_PKT_FORMAT_APPLETALK;
|
||||
|
@ -2819,7 +2819,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe);
|
|||
int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
int a_len, padding_len;
|
||||
u16 eth_type, nSubframe_Length;
|
||||
u16 eth_type, nSubframe_Length;
|
||||
u8 nr_subframes, i;
|
||||
unsigned char *pdata;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
|
@ -2833,7 +2833,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
pattrib = &prframe->u.hdr.attrib;
|
||||
|
||||
recvframe_pull(prframe, prframe->u.hdr.attrib.hdrlen);
|
||||
|
||||
|
||||
if(prframe->u.hdr.attrib.iv_len >0)
|
||||
{
|
||||
recvframe_pull(prframe, prframe->u.hdr.attrib.iv_len);
|
||||
|
@ -2844,7 +2844,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
pdata = prframe->u.hdr.rx_data;
|
||||
|
||||
while(a_len > ETH_HLEN) {
|
||||
|
||||
|
||||
/* Offset 12 denote 2 mac address */
|
||||
#ifdef ENDIAN_FREE
|
||||
//nSubframe_Length = ntohs(*((u16*)(pdata + 12)));
|
||||
|
@ -2921,7 +2921,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
#ifdef ENDIAN_FREE
|
||||
//eth_type = ntohs(*(u16*)&sub_skb->data[6]);
|
||||
eth_type = RTW_GET_BE16(&sub_skb->data[6]);
|
||||
#else // ENDIAN_FREE
|
||||
#else // ENDIAN_FREE
|
||||
eth_type = (sub_skb->data[6] << 8) | sub_skb->data[7];
|
||||
#endif // ENDIAN_FREE
|
||||
if (sub_skb->len >= 8 &&
|
||||
|
@ -2966,14 +2966,14 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
//priv->ext_stats.rx_data_drops++;
|
||||
//DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n");
|
||||
//return FAIL;
|
||||
|
||||
|
||||
#if 1
|
||||
// bypass this frame to upper layer!!
|
||||
#else
|
||||
rtw_skb_free(sub_skb);
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_BR_EXT
|
||||
|
||||
|
@ -2998,7 +2998,7 @@ exit:
|
|||
|
||||
prframe->u.hdr.len=0;
|
||||
rtw_free_recvframe(prframe, pfree_recv_queue);//free this recv_frame
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3028,7 +3028,7 @@ int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
|
|||
//DbgPrint("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num);
|
||||
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("%s IndicateSeq: %d > NewSeq: %d\n", __FUNCTION__,
|
||||
DBG_871X("%s IndicateSeq: %d > NewSeq: %d\n", __FUNCTION__,
|
||||
preorder_ctrl->indicate_seq, seq_num);
|
||||
#endif
|
||||
|
||||
|
@ -3151,7 +3151,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
//_enter_critical_ex(&ppending_recvframe_queue->lock, &irql);
|
||||
//_rtw_spinlock_ex(&ppending_recvframe_queue->lock);
|
||||
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
#if 0
|
||||
|
@ -3169,10 +3169,10 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
//_rtw_spinunlock_ex(&ppending_recvframe_queue->lock);
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
|
@ -3183,7 +3183,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
// Check if there is any packet need indicate.
|
||||
while(!rtw_is_list_empty(phead))
|
||||
{
|
||||
|
||||
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
|
||||
|
@ -3245,9 +3245,9 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
if ((padapter->bDriverStopped == _FALSE) &&
|
||||
(padapter->bSurpriseRemoved == _FALSE))
|
||||
{
|
||||
|
||||
|
||||
rtw_recv_indicatepkt(padapter, prframe);//indicate this recv_frame
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if(pattrib->amsdu==1)
|
||||
|
@ -3329,34 +3329,34 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s pattrib->qos !=1\n", __FUNCTION__);
|
||||
#endif
|
||||
|
||||
|
||||
return _FAIL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (preorder_ctrl->enable == _FALSE)
|
||||
{
|
||||
//indicate this recv_frame
|
||||
//indicate this recv_frame
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
#endif
|
||||
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
|
||||
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
|
||||
preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1)%4096;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
#endif
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_RECV_REORDERING_CTRL
|
||||
//indicate this recv_frame
|
||||
|
@ -3415,11 +3415,11 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s check_indicate_seq fail\n", __FUNCTION__);
|
||||
#endif
|
||||
#if 0
|
||||
#if 0
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
|
||||
|
||||
|
||||
goto _success_exit;
|
||||
#else
|
||||
goto _err_exit;
|
||||
|
@ -3494,7 +3494,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext)
|
|||
|
||||
if(recv_indicatepkts_in_order(padapter, preorder_ctrl, _TRUE)==_TRUE)
|
||||
{
|
||||
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
|
||||
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
|
||||
|
@ -3518,7 +3518,7 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram
|
|||
|
||||
#ifdef CONFIG_TDLS
|
||||
if( (phtpriv->ht_option==_TRUE) ||
|
||||
((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
|
||||
((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
|
||||
(psta->htpriv.ht_option==_TRUE) &&
|
||||
(psta->htpriv.ampdu_enable==_TRUE))) //B/G/N Mode
|
||||
#else
|
||||
|
@ -3532,7 +3532,7 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s recv_indicatepkt_reorder error!\n", __FUNCTION__);
|
||||
#endif
|
||||
|
||||
|
||||
if ((padapter->bDriverStopped == _FALSE) &&
|
||||
(padapter->bSurpriseRemoved == _FALSE))
|
||||
{
|
||||
|
@ -3605,7 +3605,7 @@ int recv_func_posthandle(struct adapter *padapter, union recv_frame *prframe)
|
|||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
u8 *psnap_type, *pcategory;
|
||||
|
@ -3661,7 +3661,7 @@ int recv_func_posthandle(struct adapter *padapter, union recv_frame *prframe)
|
|||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s recvframe_chk_defrag: drop pkt\n", __FUNCTION__);
|
||||
#endif
|
||||
goto _recv_data_drop;
|
||||
goto _recv_data_drop;
|
||||
}
|
||||
|
||||
prframe=portctrl(padapter, prframe);
|
||||
|
@ -3717,7 +3717,7 @@ int recv_func_posthandle(struct adapter *padapter, union recv_frame *prframe)
|
|||
//indicate this recv_frame
|
||||
ret = rtw_recv_indicatepkt(padapter, prframe);
|
||||
if (ret != _SUCCESS)
|
||||
{
|
||||
{
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s rtw_recv_indicatepkt fail!\n", __FUNCTION__);
|
||||
#endif
|
||||
|
@ -3796,7 +3796,7 @@ int recv_func(struct adapter *padapter, union recv_frame *rframe)
|
|||
ret = recv_func_prehandle(padapter, rframe);
|
||||
|
||||
if(ret == _SUCCESS) {
|
||||
|
||||
|
||||
/* check if need to enqueue into uc_swdec_pending_queue*/
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
|
||||
!IS_MCAST(prxattrib->ra) && prxattrib->encrypt>0 &&
|
||||
|
@ -3864,7 +3864,7 @@ _func_exit_;
|
|||
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
||||
struct adapter *adapter = (struct adapter *)FunctionContext;
|
||||
struct recv_priv *recvpriv = &adapter->recvpriv;
|
||||
|
||||
|
||||
u32 tmp_s, tmp_q;
|
||||
u8 avg_signal_strength = 0;
|
||||
u8 avg_signal_qual = 0;
|
||||
|
@ -3884,7 +3884,7 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
|||
// after avg_vals are accquired, we can re-stat the signal values
|
||||
recvpriv->signal_strength_data.update_req = 1;
|
||||
}
|
||||
|
||||
|
||||
if(recvpriv->signal_qual_data.update_req == 0) {// update_req is clear, means we got rx
|
||||
avg_signal_qual = recvpriv->signal_qual_data.avg_val;
|
||||
num_signal_qual = recvpriv->signal_qual_data.total_num;
|
||||
|
@ -3905,7 +3905,7 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
|||
|
||||
if(check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE
|
||||
|| check_fwstate(&adapter->mlmepriv, _FW_LINKED) == _FALSE
|
||||
) {
|
||||
) {
|
||||
goto set_timer;
|
||||
}
|
||||
|
||||
|
@ -3952,9 +3952,6 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
|||
|
||||
set_timer:
|
||||
rtw_set_signal_stat_timer(recvpriv);
|
||||
|
||||
|
||||
}
|
||||
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -92,4 +92,3 @@ u32 rtw_freq2ch(u32 freq)
|
|||
|
||||
return ch;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,356 +1,355 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include<rtw_sreset.h>
|
||||
|
||||
void sreset_init_value(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
_rtw_mutex_init(&psrtpriv->silentreset_mutex);
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
void sreset_reset_value(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
//psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 sreset_get_wifi_status(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
u8 status = WIFI_STATUS_SUCCESS;
|
||||
u32 val32 = 0;
|
||||
_irqL irqL;
|
||||
if(psrtpriv->silent_reset_inprogress == _TRUE)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
val32 =rtw_read32(padapter,REG_TXDMA_STATUS);
|
||||
if(val32==0xeaeaeaea){
|
||||
psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
|
||||
}
|
||||
else if(val32!=0){
|
||||
DBG_8192C("txdmastatu(%x)\n",val32);
|
||||
psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
|
||||
}
|
||||
|
||||
if(WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
|
||||
{
|
||||
DBG_8192C("==>%s error_status(0x%x) \n",__FUNCTION__,psrtpriv->Wifi_Error_Status);
|
||||
status = (psrtpriv->Wifi_Error_Status &( ~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL)));
|
||||
}
|
||||
DBG_8192C("==> %s wifi_status(0x%x)\n",__FUNCTION__,status);
|
||||
|
||||
//status restore
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
return status;
|
||||
#else
|
||||
return WIFI_STATUS_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_wifi_error_status(struct adapter *padapter, u32 status)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = status;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_trigger_point(struct adapter *padapter, s32 tgp)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.dbg_trigger_point = tgp;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool sreset_inprogress(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_RESET)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
return pHalData->srestpriv.silent_reset_inprogress;
|
||||
#else
|
||||
return _FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_restore_security_station(struct adapter *padapter)
|
||||
{
|
||||
u8 EntryId = 0;
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct sta_priv * pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct security_priv* psecuritypriv=&(padapter->securitypriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
|
||||
{
|
||||
u8 val8;
|
||||
|
||||
if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) {
|
||||
val8 = 0xcc;
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
} else if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) {
|
||||
//Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey.
|
||||
val8 = 0x4c;
|
||||
#endif
|
||||
} else {
|
||||
val8 = 0xcf;
|
||||
}
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( ( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_ ) ||
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_ ))
|
||||
{
|
||||
|
||||
for(EntryId=0; EntryId<4; EntryId++)
|
||||
{
|
||||
if(EntryId == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 1,_FALSE);
|
||||
else
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 0,_FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
|
||||
{
|
||||
psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv));
|
||||
if (psta == NULL) {
|
||||
//DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail \n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//pairwise key
|
||||
rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE,_FALSE);
|
||||
//group key
|
||||
rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_restore_network_station(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
#if 0
|
||||
{
|
||||
//=======================================================
|
||||
// reset related register of Beacon control
|
||||
|
||||
//set MSR to nolink
|
||||
Set_MSR(padapter, _HW_STATE_NOLINK_);
|
||||
// reject all data frame
|
||||
rtw_write16(padapter, REG_RXFLTMAP2,0x00);
|
||||
//reset TSF
|
||||
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
|
||||
|
||||
// disable update TSF
|
||||
SetBcnCtrlReg(padapter, BIT(4), 0);
|
||||
|
||||
//=======================================================
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure,_FALSE);
|
||||
|
||||
{
|
||||
u8 threshold;
|
||||
#ifdef CONFIG_USB_HCI
|
||||
// TH=1 => means that invalidate usb rx aggregation
|
||||
// TH=0 => means that validate usb rx aggregation, use init value.
|
||||
if(mlmepriv->htpriv.ht_option) {
|
||||
if(padapter->registrypriv.wifi_spec==1)
|
||||
threshold = 1;
|
||||
else
|
||||
threshold = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
} else {
|
||||
threshold = 1;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
|
||||
//disable dynamic functions, such as high power, DIG
|
||||
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
|
||||
|
||||
{
|
||||
u8 join_type = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
|
||||
}
|
||||
|
||||
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
|
||||
|
||||
mlmeext_joinbss_event_callback(padapter, 1);
|
||||
//restore Sequence No.
|
||||
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
|
||||
|
||||
sreset_restore_security_station(padapter);
|
||||
}
|
||||
|
||||
|
||||
void sreset_restore_network_status(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
sreset_restore_network_station(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_AP_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
rtw_ap_restore_network(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_ADHOC_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_ADHOC_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
} else {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_stop_adapter(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (!rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_stop_queue(padapter->pnetdev);
|
||||
|
||||
rtw_cancel_all_timer(padapter);
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
tasklet_kill(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_scan_abort(padapter);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
{
|
||||
rtw_set_roaming(padapter, 0);
|
||||
_rtw_join_timeout_handler(padapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void sreset_start_adapter(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
sreset_restore_network_status(padapter);
|
||||
}
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
|
||||
if (rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_wake_queue(padapter->pnetdev);
|
||||
|
||||
}
|
||||
|
||||
void sreset_reset(struct adapter *padapter)
|
||||
{
|
||||
#ifdef DBG_CONFIG_ERROR_RESET
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
u32 start = rtw_get_current_time();
|
||||
|
||||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _TRUE;
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
sreset_stop_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_stop_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
_ips_enter(padapter);
|
||||
_ips_leave(padapter);
|
||||
#endif
|
||||
|
||||
sreset_start_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_start_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
DBG_871X("%s done in %d ms\n", __FUNCTION__, rtw_get_passing_time_ms(start));
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include<rtw_sreset.h>
|
||||
|
||||
void sreset_init_value(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
_rtw_mutex_init(&psrtpriv->silentreset_mutex);
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
void sreset_reset_value(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
//psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 sreset_get_wifi_status(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
u8 status = WIFI_STATUS_SUCCESS;
|
||||
u32 val32 = 0;
|
||||
_irqL irqL;
|
||||
if(psrtpriv->silent_reset_inprogress == _TRUE)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
val32 =rtw_read32(padapter,REG_TXDMA_STATUS);
|
||||
if(val32==0xeaeaeaea){
|
||||
psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
|
||||
}
|
||||
else if(val32!=0){
|
||||
DBG_8192C("txdmastatu(%x)\n",val32);
|
||||
psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
|
||||
}
|
||||
|
||||
if(WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
|
||||
{
|
||||
DBG_8192C("==>%s error_status(0x%x) \n",__FUNCTION__,psrtpriv->Wifi_Error_Status);
|
||||
status = (psrtpriv->Wifi_Error_Status &( ~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL)));
|
||||
}
|
||||
DBG_8192C("==> %s wifi_status(0x%x)\n",__FUNCTION__,status);
|
||||
|
||||
//status restore
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
return status;
|
||||
#else
|
||||
return WIFI_STATUS_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_wifi_error_status(struct adapter *padapter, u32 status)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = status;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_trigger_point(struct adapter *padapter, s32 tgp)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.dbg_trigger_point = tgp;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool sreset_inprogress(struct adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_RESET)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
return pHalData->srestpriv.silent_reset_inprogress;
|
||||
#else
|
||||
return _FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_restore_security_station(struct adapter *padapter)
|
||||
{
|
||||
u8 EntryId = 0;
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct sta_priv * pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct security_priv* psecuritypriv=&(padapter->securitypriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
|
||||
{
|
||||
u8 val8;
|
||||
|
||||
if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) {
|
||||
val8 = 0xcc;
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
} else if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) {
|
||||
//Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey.
|
||||
val8 = 0x4c;
|
||||
#endif
|
||||
} else {
|
||||
val8 = 0xcf;
|
||||
}
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( ( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_ ) ||
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_ ))
|
||||
{
|
||||
|
||||
for(EntryId=0; EntryId<4; EntryId++)
|
||||
{
|
||||
if(EntryId == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 1,_FALSE);
|
||||
else
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 0,_FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
|
||||
{
|
||||
psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv));
|
||||
if (psta == NULL) {
|
||||
//DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail \n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//pairwise key
|
||||
rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE,_FALSE);
|
||||
//group key
|
||||
rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_restore_network_station(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
#if 0
|
||||
{
|
||||
//=======================================================
|
||||
// reset related register of Beacon control
|
||||
|
||||
//set MSR to nolink
|
||||
Set_MSR(padapter, _HW_STATE_NOLINK_);
|
||||
// reject all data frame
|
||||
rtw_write16(padapter, REG_RXFLTMAP2,0x00);
|
||||
//reset TSF
|
||||
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
|
||||
|
||||
// disable update TSF
|
||||
SetBcnCtrlReg(padapter, BIT(4), 0);
|
||||
|
||||
//=======================================================
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure,_FALSE);
|
||||
|
||||
{
|
||||
u8 threshold;
|
||||
#ifdef CONFIG_USB_HCI
|
||||
// TH=1 => means that invalidate usb rx aggregation
|
||||
// TH=0 => means that validate usb rx aggregation, use init value.
|
||||
if(mlmepriv->htpriv.ht_option) {
|
||||
if(padapter->registrypriv.wifi_spec==1)
|
||||
threshold = 1;
|
||||
else
|
||||
threshold = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
} else {
|
||||
threshold = 1;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
|
||||
//disable dynamic functions, such as high power, DIG
|
||||
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
|
||||
|
||||
{
|
||||
u8 join_type = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
|
||||
}
|
||||
|
||||
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
|
||||
|
||||
mlmeext_joinbss_event_callback(padapter, 1);
|
||||
//restore Sequence No.
|
||||
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
|
||||
|
||||
sreset_restore_security_station(padapter);
|
||||
}
|
||||
|
||||
|
||||
void sreset_restore_network_status(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
sreset_restore_network_station(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_AP_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
rtw_ap_restore_network(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_ADHOC_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_ADHOC_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
} else {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_stop_adapter(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (!rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_stop_queue(padapter->pnetdev);
|
||||
|
||||
rtw_cancel_all_timer(padapter);
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
tasklet_kill(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_scan_abort(padapter);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
{
|
||||
rtw_set_roaming(padapter, 0);
|
||||
_rtw_join_timeout_handler(padapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void sreset_start_adapter(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
sreset_restore_network_status(padapter);
|
||||
}
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
|
||||
if (rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_wake_queue(padapter->pnetdev);
|
||||
|
||||
}
|
||||
|
||||
void sreset_reset(struct adapter *padapter)
|
||||
{
|
||||
#ifdef DBG_CONFIG_ERROR_RESET
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
u32 start = rtw_get_current_time();
|
||||
|
||||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _TRUE;
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
sreset_stop_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_stop_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
_ips_enter(padapter);
|
||||
_ips_leave(padapter);
|
||||
#endif
|
||||
|
||||
sreset_start_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_start_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
DBG_871X("%s done in %d ms\n", __FUNCTION__, rtw_get_passing_time_ms(start));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -42,24 +42,24 @@ _func_enter_;
|
|||
_rtw_init_listhead(&psta->hash_list);
|
||||
//_rtw_init_listhead(&psta->asoc_list);
|
||||
//_rtw_init_listhead(&psta->sleep_list);
|
||||
//_rtw_init_listhead(&psta->wakeup_list);
|
||||
//_rtw_init_listhead(&psta->wakeup_list);
|
||||
|
||||
_rtw_init_queue(&psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
||||
_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
|
||||
_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
_rtw_init_listhead(&psta->asoc_list);
|
||||
|
||||
_rtw_init_listhead(&psta->auth_list);
|
||||
|
||||
|
||||
psta->expire_to = 0;
|
||||
|
||||
|
||||
psta->flags = 0;
|
||||
|
||||
|
||||
psta->capability = 0;
|
||||
|
||||
psta->bpairwise_key_installed = _FALSE;
|
||||
|
@ -72,28 +72,28 @@ _func_enter_;
|
|||
psta->no_ht_gf_set = 0;
|
||||
psta->no_ht_set = 0;
|
||||
psta->ht_20mhz_set = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
psta->under_exist_checking = 0;
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
|
||||
|
||||
psta->keep_alive_trycnt = 0;
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
#endif // CONFIG_AP_MODE
|
||||
|
||||
#ifdef DBG_TRX_STA_PKTS
|
||||
#ifdef DBG_TRX_STA_PKTS
|
||||
psta->tx_be_cnt = 0;
|
||||
psta->tx_bk_cnt = 0;
|
||||
psta->tx_vi_cnt = 0;
|
||||
psta->tx_vo_cnt = 0;
|
||||
|
||||
|
||||
psta->rx_be_cnt = 0;
|
||||
psta->rx_bk_cnt = 0;
|
||||
psta->rx_vi_cnt = 0;
|
||||
psta->rx_vo_cnt = 0;
|
||||
#endif
|
||||
_func_exit_;
|
||||
#endif
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
|
@ -102,20 +102,20 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
|
|||
struct sta_info *psta;
|
||||
s32 i;
|
||||
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
|
||||
pstapriv->pallocated_stainfo_buf = rtw_zvmalloc (sizeof(struct sta_info) * NUM_STA+ 4);
|
||||
|
||||
|
||||
if(!pstapriv->pallocated_stainfo_buf)
|
||||
return _FAIL;
|
||||
|
||||
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
|
||||
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
|
||||
((SIZE_PTR)(pstapriv->pallocated_stainfo_buf ) & 3);
|
||||
|
||||
_rtw_init_queue(&pstapriv->free_sta_queue);
|
||||
|
||||
_rtw_spinlock_init(&pstapriv->sta_hash_lock);
|
||||
|
||||
|
||||
//_rtw_init_queue(&pstapriv->asoc_q);
|
||||
pstapriv->asoc_sta_count = 0;
|
||||
_rtw_init_queue(&pstapriv->sleep_q);
|
||||
|
@ -123,7 +123,7 @@ _func_enter_;
|
|||
|
||||
psta = (struct sta_info *)(pstapriv->pstainfo_buf);
|
||||
|
||||
|
||||
|
||||
for(i = 0; i < NUM_STA; i++)
|
||||
{
|
||||
_rtw_init_stainfo(psta);
|
||||
|
@ -135,7 +135,7 @@ _func_enter_;
|
|||
psta++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
|
@ -149,7 +149,7 @@ _func_enter_;
|
|||
pstapriv->asoc_list_cnt = 0;
|
||||
pstapriv->auth_list_cnt = 0;
|
||||
|
||||
pstapriv->auth_to = 3; // 3*2 = 6 sec
|
||||
pstapriv->auth_to = 3; // 3*2 = 6 sec
|
||||
pstapriv->assoc_to = 3;
|
||||
//pstapriv->expire_to = 900;// 900*2 = 1800 sec = 30 min, expire after no any traffic.
|
||||
//pstapriv->expire_to = 30;// 30*2 = 60 sec = 1 min, expire after no any traffic.
|
||||
|
@ -157,18 +157,18 @@ _func_enter_;
|
|||
pstapriv->expire_to = 3; // 3*2 = 6 sec
|
||||
#else
|
||||
pstapriv->expire_to = 60;// 60*2 = 120 sec = 2 min, expire after no any traffic.
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
_rtw_memset( pstapriv->atmel_rc_pattern, 0, ETH_ALEN);
|
||||
#endif
|
||||
pstapriv->max_num_sta = NUM_STA;
|
||||
|
||||
#endif
|
||||
|
||||
_func_exit_;
|
||||
pstapriv->max_num_sta = NUM_STA;
|
||||
|
||||
#endif
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
|
||||
inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
|
||||
|
@ -200,12 +200,12 @@ _func_enter_;
|
|||
_rtw_spinlock_free(&(psta_xmitpriv->bk_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->vi_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->vo_q.sta_pending.lock));
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
static void _rtw_free_sta_recv_priv_lock(struct sta_recv_priv *psta_recvpriv)
|
||||
{
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
|
||||
_rtw_spinlock_free(&psta_recvpriv->lock);
|
||||
|
||||
|
@ -225,8 +225,8 @@ _func_enter_;
|
|||
|
||||
_rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
|
||||
_rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -237,14 +237,14 @@ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv )
|
|||
_irqL irqL;
|
||||
_list *plist, *phead;
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
phead = get_list_head(&pstapriv->free_sta_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,list);
|
||||
|
@ -252,10 +252,10 @@ _func_enter_;
|
|||
|
||||
rtw_mfree_stainfo(psta);
|
||||
}
|
||||
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
|
@ -284,53 +284,53 @@ void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
|
|||
|
||||
u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
|
||||
{
|
||||
_irqL irqL;
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
struct sta_info *psta = NULL;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int index;
|
||||
int index;
|
||||
|
||||
_func_enter_;
|
||||
if(pstapriv){
|
||||
|
||||
/* delete all reordering_ctrl_timer */
|
||||
/* delete all reordering_ctrl_timer */
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
for(index = 0; index < NUM_STA; index++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
for(i=0; i < 16 ; i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
/*===============================*/
|
||||
|
||||
|
||||
rtw_mfree_sta_priv_lock(pstapriv);
|
||||
|
||||
if(pstapriv->pallocated_stainfo_buf) {
|
||||
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info)*NUM_STA+4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr)
|
||||
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||
{
|
||||
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||
{
|
||||
_irqL irqL, irqL2;
|
||||
uint tmp_aid;
|
||||
s32 index;
|
||||
|
@ -340,11 +340,11 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int i = 0;
|
||||
u16 wRxSeqInitialValue = 0xffff;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pfree_sta_queue = &pstapriv->free_sta_queue;
|
||||
|
||||
|
||||
//_enter_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
|
@ -357,13 +357,13 @@ _func_enter_;
|
|||
else
|
||||
{
|
||||
psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);
|
||||
|
||||
|
||||
rtw_list_delete(&(psta->list));
|
||||
|
||||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
|
||||
tmp_aid = psta->aid;
|
||||
|
||||
|
||||
tmp_aid = psta->aid;
|
||||
|
||||
_rtw_init_stainfo(psta);
|
||||
|
||||
psta->padapter = pstapriv->padapter;
|
||||
|
@ -376,7 +376,7 @@ _func_enter_;
|
|||
|
||||
if(index >= NUM_STA){
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA"));
|
||||
psta= NULL;
|
||||
psta= NULL;
|
||||
goto exit;
|
||||
}
|
||||
phash_list = &(pstapriv->sta_hash[index]);
|
||||
|
@ -399,7 +399,7 @@ _func_enter_;
|
|||
_rtw_memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 );
|
||||
}
|
||||
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n",
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n",
|
||||
pstapriv->asoc_sta_count , hwaddr[0], hwaddr[1], hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5]));
|
||||
|
||||
init_addba_retry_timer(pstapriv->padapter, psta);
|
||||
|
@ -420,15 +420,15 @@ _func_enter_;
|
|||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
preorder_ctrl->padapter = pstapriv->padapter;
|
||||
|
||||
|
||||
preorder_ctrl->enable = _FALSE;
|
||||
|
||||
|
||||
preorder_ctrl->indicate_seq = 0xffff;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq);
|
||||
#endif
|
||||
preorder_ctrl->wend_b= 0xffff;
|
||||
preorder_ctrl->wend_b= 0xffff;
|
||||
//preorder_ctrl->wsize_b = (NR_RECVBUFF-2);
|
||||
preorder_ctrl->wsize_b = 64;//64;
|
||||
|
||||
|
@ -447,7 +447,7 @@ _func_enter_;
|
|||
/* init for the sequence number of received management frame */
|
||||
psta->RxMgmtFrameSeqNum = 0xffff;
|
||||
}
|
||||
|
||||
|
||||
exit:
|
||||
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
@ -462,7 +462,7 @@ _func_exit_;
|
|||
|
||||
// using pstapriv->sta_hash_lock to protect
|
||||
u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
|
||||
{
|
||||
{
|
||||
int i;
|
||||
_irqL irqL0;
|
||||
_queue *pfree_sta_queue;
|
||||
|
@ -473,8 +473,8 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
|
|||
struct hw_xmit *phwxmit;
|
||||
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (psta == NULL)
|
||||
goto exit;
|
||||
|
||||
|
@ -487,16 +487,16 @@ _func_enter_;
|
|||
|
||||
|
||||
pstaxmitpriv = &psta->sta_xmitpriv;
|
||||
|
||||
|
||||
//rtw_list_delete(&psta->sleep_list);
|
||||
|
||||
|
||||
//rtw_list_delete(&psta->wakeup_list);
|
||||
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
||||
|
||||
//vo
|
||||
//_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
|
||||
|
@ -523,7 +523,7 @@ _func_enter_;
|
|||
phwxmit->accnt -= pstaxmitpriv->be_q.qcnt;
|
||||
pstaxmitpriv->be_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
|
||||
|
||||
|
||||
//bk
|
||||
//_enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
|
||||
|
@ -532,14 +532,14 @@ _func_enter_;
|
|||
phwxmit->accnt -= pstaxmitpriv->bk_q.qcnt;
|
||||
pstaxmitpriv->bk_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
|
||||
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
|
||||
rtw_list_delete(&psta->hash_list);
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]));
|
||||
pstapriv->asoc_sta_count --;
|
||||
|
||||
|
||||
|
||||
|
||||
// re-init sta_info; 20061114 // will be init in alloc_stainfo
|
||||
//_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
|
||||
//_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
|
||||
|
@ -563,42 +563,42 @@ _func_enter_;
|
|||
union recv_frame *prframe;
|
||||
_queue *ppending_recvframe_queue;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
|
||||
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
|
||||
|
||||
ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
|
||||
|
||||
_enter_critical_bh(&ppending_recvframe_queue->lock, &irqL);
|
||||
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while(!rtw_is_list_empty(phead))
|
||||
{
|
||||
{
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
|
||||
|
||||
plist = get_next(plist);
|
||||
|
||||
|
||||
rtw_list_delete(&(prframe->u.hdr.list));
|
||||
|
||||
rtw_free_recvframe(prframe, pfree_recv_queue);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irqL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!(psta->state & WIFI_AP_STATE))
|
||||
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, _FALSE);
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
/*
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
*/
|
||||
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
|
@ -607,7 +607,7 @@ _func_enter_;
|
|||
pstapriv->auth_list_cnt--;
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
|
||||
|
||||
psta->expire_to = 0;
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
psta->flag_atmel_rc = 0;
|
||||
|
@ -624,9 +624,9 @@ _func_enter_;
|
|||
psta->has_legacy_ac = 0;
|
||||
|
||||
#ifdef CONFIG_NATIVEAP_MLME
|
||||
|
||||
|
||||
pstapriv->sta_dz_bitmap &=~BIT(psta->aid);
|
||||
pstapriv->tim_bitmap &=~BIT(psta->aid);
|
||||
pstapriv->tim_bitmap &=~BIT(psta->aid);
|
||||
|
||||
//rtw_indicate_sta_disassoc_event(padapter, psta);
|
||||
|
||||
|
@ -634,15 +634,15 @@ _func_enter_;
|
|||
{
|
||||
pstapriv->sta_aid[psta->aid - 1] = NULL;
|
||||
psta->aid = 0;
|
||||
}
|
||||
|
||||
#endif // CONFIG_NATIVEAP_MLME
|
||||
}
|
||||
|
||||
#endif // CONFIG_NATIVEAP_MLME
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
psta->under_exist_checking = 0;
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
#endif // CONFIG_AP_MODE
|
||||
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
|
||||
|
@ -651,11 +651,11 @@ _func_enter_;
|
|||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL0);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// free all stainfo which in sta_hash[all]
|
||||
|
@ -667,8 +667,8 @@ void rtw_free_all_stainfo(struct adapter *padapter)
|
|||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info* pbcmc_stainfo =rtw_get_bcmc_stainfo( padapter);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if(pstapriv->asoc_sta_count==1)
|
||||
goto exit;
|
||||
|
@ -679,24 +679,24 @@ _func_enter_;
|
|||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
|
||||
|
||||
plist = get_next(plist);
|
||||
|
||||
if(pbcmc_stainfo!=psta)
|
||||
if(pbcmc_stainfo!=psta)
|
||||
rtw_free_stainfo(padapter , psta);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
|
@ -709,7 +709,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
_list *plist, *phead;
|
||||
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
|
||||
u32 index;
|
||||
|
||||
u8 *addr;
|
||||
|
@ -720,7 +720,7 @@ _func_enter_;
|
|||
|
||||
if(hwaddr==NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
if(IS_MCAST(hwaddr))
|
||||
{
|
||||
addr = bc_addr;
|
||||
|
@ -733,17 +733,17 @@ _func_enter_;
|
|||
index = wifi_mac_hash(addr);
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
|
||||
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== _TRUE)
|
||||
|
||||
if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== _TRUE)
|
||||
{ // if found the matched address
|
||||
break;
|
||||
}
|
||||
|
@ -752,26 +752,26 @@ _func_enter_;
|
|||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return psta;
|
||||
|
||||
|
||||
}
|
||||
|
||||
u32 rtw_init_bcmc_stainfo(struct adapter* padapter)
|
||||
{
|
||||
|
||||
struct sta_info *psta;
|
||||
struct sta_info *psta;
|
||||
struct tx_servq *ptxservq;
|
||||
u32 res=_SUCCESS;
|
||||
NDIS_802_11_MAC_ADDRESS bcast_addr= {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
|
||||
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
//_queue *pstapending = &padapter->xmitpriv.bm_pending;
|
||||
|
||||
//_queue *pstapending = &padapter->xmitpriv.bm_pending;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
|
||||
|
||||
|
||||
if(psta==NULL){
|
||||
res=_FAIL;
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("rtw_alloc_stainfo fail"));
|
||||
|
@ -791,9 +791,9 @@ _func_enter_;
|
|||
|
||||
_exit_critical(&pstapending->lock, &irqL0);
|
||||
*/
|
||||
|
||||
|
||||
exit:
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
@ -801,12 +801,12 @@ _func_exit_;
|
|||
|
||||
struct sta_info* rtw_get_bcmc_stainfo(struct adapter* padapter)
|
||||
{
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
_func_enter_;
|
||||
psta = rtw_get_stainfo(pstapriv, bc_addr);
|
||||
_func_exit_;
|
||||
_func_exit_;
|
||||
return psta;
|
||||
|
||||
}
|
||||
|
@ -822,10 +822,10 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
|
|||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
|
||||
_queue *pacl_node_q =&pacl_list->acl_node_q;
|
||||
|
||||
|
||||
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
phead = get_list_head(pacl_node_q);
|
||||
plist = get_next(phead);
|
||||
plist = get_next(phead);
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
|
||||
|
@ -838,15 +838,15 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
|
|||
match = _TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
|
||||
|
||||
|
||||
if(pacl_list->mode == 1)//accept unless in deny list
|
||||
{
|
||||
res = (match == _TRUE) ? _FALSE:_TRUE;
|
||||
}
|
||||
}
|
||||
else if(pacl_list->mode == 2)//deny unless in accept list
|
||||
{
|
||||
res = (match == _TRUE) ? _TRUE:_FALSE;
|
||||
|
@ -854,11 +854,10 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
|
|||
else
|
||||
{
|
||||
res = _TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
|
|
5881
core/rtw_tdls.c
5881
core/rtw_tdls.c
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
739
core/rtw_xmit.c
739
core/rtw_xmit.c
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,97 +1,96 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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 "Hal8188EPwrSeq.h"
|
||||
#include <rtl8188e_hal.h>
|
||||
|
||||
/*
|
||||
drivers should parse below arrays and do the corresponding actions
|
||||
*/
|
||||
//3 Power on Array
|
||||
WLAN_PWR_CFG rtl8188E_power_on_flow[RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_CARDEMU_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3Radio off Array
|
||||
WLAN_PWR_CFG rtl8188E_radio_off_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3Card Disable Array
|
||||
WLAN_PWR_CFG rtl8188E_card_disable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_CARDDIS
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3 Card Enable Array
|
||||
WLAN_PWR_CFG rtl8188E_card_enable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_CARDDIS_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3Suspend Array
|
||||
WLAN_PWR_CFG rtl8188E_suspend_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_SUS
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3 Resume Array
|
||||
WLAN_PWR_CFG rtl8188E_resume_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_SUS_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
|
||||
//3HWPDN Array
|
||||
WLAN_PWR_CFG rtl8188E_hwpdn_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_PDN
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3 Enter LPS
|
||||
WLAN_PWR_CFG rtl8188E_enter_lps_flow[RTL8188E_TRANS_ACT_TO_LPS_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
//FW behavior
|
||||
RTL8188E_TRANS_ACT_TO_LPS
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3 Leave LPS
|
||||
WLAN_PWR_CFG rtl8188E_leave_lps_flow[RTL8188E_TRANS_LPS_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
//FW behavior
|
||||
RTL8188E_TRANS_LPS_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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 "Hal8188EPwrSeq.h"
|
||||
#include <rtl8188e_hal.h>
|
||||
|
||||
/*
|
||||
drivers should parse below arrays and do the corresponding actions
|
||||
*/
|
||||
//3 Power on Array
|
||||
WLAN_PWR_CFG rtl8188E_power_on_flow[RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_CARDEMU_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3Radio off Array
|
||||
WLAN_PWR_CFG rtl8188E_radio_off_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3Card Disable Array
|
||||
WLAN_PWR_CFG rtl8188E_card_disable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_CARDDIS
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3 Card Enable Array
|
||||
WLAN_PWR_CFG rtl8188E_card_enable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_CARDDIS_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3Suspend Array
|
||||
WLAN_PWR_CFG rtl8188E_suspend_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_SUS
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3 Resume Array
|
||||
WLAN_PWR_CFG rtl8188E_resume_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_SUS_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
|
||||
//3HWPDN Array
|
||||
WLAN_PWR_CFG rtl8188E_hwpdn_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_PDN
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3 Enter LPS
|
||||
WLAN_PWR_CFG rtl8188E_enter_lps_flow[RTL8188E_TRANS_ACT_TO_LPS_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
//FW behavior
|
||||
RTL8188E_TRANS_ACT_TO_LPS
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
//3 Leave LPS
|
||||
WLAN_PWR_CFG rtl8188E_leave_lps_flow[RTL8188E_TRANS_LPS_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS]=
|
||||
{
|
||||
//FW behavior
|
||||
RTL8188E_TRANS_LPS_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
|
|
@ -3,19 +3,19 @@ Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
|||
|
||||
Module Name:
|
||||
RateAdaptive.c
|
||||
|
||||
|
||||
Abstract:
|
||||
Implement Rate Adaptive functions for common operations.
|
||||
|
||||
|
||||
Major Change History:
|
||||
When Who What
|
||||
---------- --------------- -------------------------------
|
||||
2011-08-12 Page Create.
|
||||
---------- --------------- -------------------------------
|
||||
2011-08-12 Page Create.
|
||||
|
||||
--*/
|
||||
#include "odm_precomp.h"
|
||||
|
||||
//#if( DM_ODM_SUPPORT_TYPE == ODM_MP)
|
||||
//#if( DM_ODM_SUPPORT_TYPE == ODM_MP)
|
||||
//#include "Mp_Precomp.h"
|
||||
//#endif
|
||||
|
||||
|
@ -64,26 +64,26 @@ static u1Byte PT_PENALTY[RETRYSIZE+1]={34,31,30,24,0,32};
|
|||
#if 0
|
||||
static u1Byte RETRY_PENALTY_IDX[2][RATESIZE] = {{4,4,4,5,4,4,5,7,7,7,8,0x0a, // SS>TH
|
||||
4,4,4,4,6,0x0a,0x0b,0x0d,
|
||||
5,5,7,7,8,0x0b,0x0d,0x0f}, // 0329 R01
|
||||
5,5,7,7,8,0x0b,0x0d,0x0f}, // 0329 R01
|
||||
{4,4,4,5,7,7,9,9,0x0c,0x0e,0x10,0x12, // SS<TH
|
||||
4,4,5,5,6,0x0a,0x11,0x13,
|
||||
9,9,9,9,0x0c,0x0e,0x11,0x13}};
|
||||
9,9,9,9,0x0c,0x0e,0x11,0x13}};
|
||||
#endif
|
||||
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
static u1Byte RETRY_PENALTY_IDX[2][RATESIZE] = {{4,4,4,5,4,4,5,7,7,7,8,0x0a, // SS>TH
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
static u1Byte RETRY_PENALTY_IDX[2][RATESIZE] = {{4,4,4,5,4,4,5,7,7,7,8,0x0a, // SS>TH
|
||||
4,4,4,4,6,0x0a,0x0b,0x0d,
|
||||
5,5,7,7,8,0x0b,0x0d,0x0f}, // 0329 R01
|
||||
5,5,7,7,8,0x0b,0x0d,0x0f}, // 0329 R01
|
||||
{0x0a,0x0a,0x0a,0x0a,0x0c,0x0c,0x0e,0x10,0x11,0x12,0x12,0x13, // SS<TH
|
||||
0x0e,0x0f,0x10,0x10,0x11,0x14,0x14,0x15,
|
||||
9,9,9,9,0x0c,0x0e,0x11,0x13}};
|
||||
9,9,9,9,0x0c,0x0e,0x11,0x13}};
|
||||
|
||||
static u1Byte RETRY_PENALTY_UP_IDX[RATESIZE] = {0x10,0x10,0x10,0x10,0x11,0x11,0x12,0x12,0x12,0x13,0x13,0x14, // SS>TH
|
||||
static u1Byte RETRY_PENALTY_UP_IDX[RATESIZE] = {0x10,0x10,0x10,0x10,0x11,0x11,0x12,0x12,0x12,0x13,0x13,0x14, // SS>TH
|
||||
0x13,0x13,0x14,0x14,0x15,0x15,0x15,0x15,
|
||||
0x11,0x11,0x12,0x13,0x13,0x13,0x14,0x15};
|
||||
0x11,0x11,0x12,0x13,0x13,0x13,0x14,0x15};
|
||||
|
||||
static u1Byte RSSI_THRESHOLD[RATESIZE] = {0,0,0,0,
|
||||
static u1Byte RSSI_THRESHOLD[RATESIZE] = {0,0,0,0,
|
||||
0,0,0,0,0,0x24,0x26,0x2a,
|
||||
0x13,0x15,0x17,0x18,0x1a,0x1c,0x1d,0x1f,
|
||||
0,0,0,0x1f,0x23,0x28,0x2a,0x2c};
|
||||
|
@ -92,21 +92,21 @@ static u1Byte RSSI_THRESHOLD[RATESIZE] = {0,0,0,0,
|
|||
// wilson modify
|
||||
static u1Byte RETRY_PENALTY_IDX[2][RATESIZE] = {{4,4,4,5,4,4,5,7,7,7,8,0x0a, // SS>TH
|
||||
4,4,4,4,6,0x0a,0x0b,0x0d,
|
||||
5,5,7,7,8,0x0b,0x0d,0x0f}, // 0329 R01
|
||||
5,5,7,7,8,0x0b,0x0d,0x0f}, // 0329 R01
|
||||
{0x0a,0x0a,0x0b,0x0c,0x0a,0x0a,0x0b,0x0c,0x0d,0x10,0x13,0x14, // SS<TH
|
||||
0x0b,0x0c,0x0d,0x0e,0x0f,0x11,0x13,0x15,
|
||||
9,9,9,9,0x0c,0x0e,0x11,0x13}};
|
||||
9,9,9,9,0x0c,0x0e,0x11,0x13}};
|
||||
|
||||
static u1Byte RETRY_PENALTY_UP_IDX[RATESIZE] = {0x0c,0x0d,0x0d,0x0f,0x0d,0x0e,0x0f,0x0f,0x10,0x12,0x13,0x14, // SS>TH
|
||||
0x0f,0x10,0x10,0x12,0x12,0x13,0x14,0x15,
|
||||
0x11,0x11,0x12,0x13,0x13,0x13,0x14,0x15};
|
||||
0x11,0x11,0x12,0x13,0x13,0x13,0x14,0x15};
|
||||
|
||||
static u1Byte RSSI_THRESHOLD[RATESIZE] = {0,0,0,0,
|
||||
0,0,0,0,0,0x24,0x26,0x2a,
|
||||
0x18,0x1a,0x1d,0x1f,0x21,0x27,0x29,0x2a,
|
||||
0,0,0,0x1f,0x23,0x28,0x2a,0x2c};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*static u1Byte RSSI_THRESHOLD[RATESIZE] = {0,0,0,0,
|
||||
0,0,0,0,0,0x24,0x26,0x2a,
|
||||
|
@ -116,7 +116,7 @@ static u2Byte N_THRESHOLD_HIGH[RATESIZE] = {4,4,8,16,
|
|||
24,36,48,72,96,144,192,216,
|
||||
60,80,100,160,240,400,560,640,
|
||||
300,320,480,720,1000,1200,1600,2000};
|
||||
static u2Byte N_THRESHOLD_LOW[RATESIZE] = {2,2,4,8,
|
||||
static u2Byte N_THRESHOLD_LOW[RATESIZE] = {2,2,4,8,
|
||||
12,18,24,36,48,72,96,108,
|
||||
30,40,50,80,120,200,280,320,
|
||||
150,160,240,360,500,600,800,1000};
|
||||
|
@ -128,7 +128,7 @@ static u1Byte TRYING_NECESSARY[RATESIZE] = {2,2,2,2,
|
|||
static u1Byte POOL_RETRY_TH[RATESIZE] = {30,30,30,30,
|
||||
30,30,25,25,20,15,15,10,
|
||||
30,25,25,20,15,10,10,10,
|
||||
30,25,25,20,15,10,10,10};
|
||||
30,25,25,20,15,10,10,10};
|
||||
#endif
|
||||
|
||||
static u1Byte DROPING_NECESSARY[RATESIZE] = {1,1,1,1,
|
||||
|
@ -153,18 +153,18 @@ static u4Byte INIT_RATE_FALLBACK_TABLE[16]={0x0f8ff015, // 0: 40M BGN mode
|
|||
0, // 13:
|
||||
0, // 14:
|
||||
0, // 15:
|
||||
|
||||
|
||||
};
|
||||
static u1Byte PendingForRateUpFail[5]={2,10,24,40,60};
|
||||
static u2Byte DynamicTxRPTTiming[6]={0x186a, 0x30d4, 0x493e, 0x61a8, 0x7a12 ,0x927c}; // 200ms-1200ms
|
||||
|
||||
// End Rate adaptive parameters
|
||||
|
||||
static void
|
||||
static void
|
||||
odm_SetTxRPTTiming_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PODM_RA_INFO_T pRaInfo,
|
||||
IN u1Byte extend
|
||||
IN PODM_RA_INFO_T pRaInfo,
|
||||
IN u1Byte extend
|
||||
)
|
||||
{
|
||||
u1Byte idx = 0;
|
||||
|
@ -185,14 +185,14 @@ odm_SetTxRPTTiming_8188E(
|
|||
idx-=1;
|
||||
}
|
||||
pRaInfo->RptTime=DynamicTxRPTTiming[idx];
|
||||
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("pRaInfo->RptTime=0x%x\n", pRaInfo->RptTime));
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
odm_RateDown_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
)
|
||||
{
|
||||
u1Byte RateID, LowestRate, HighestRate;
|
||||
|
@ -208,8 +208,8 @@ odm_RateDown_8188E(
|
|||
LowestRate = pRaInfo->LowestRate;
|
||||
HighestRate = pRaInfo->HighestRate;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" RateID=%d LowestRate=%d HighestRate=%d RateSGI=%d\n",
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" RateID=%d LowestRate=%d HighestRate=%d RateSGI=%d\n",
|
||||
RateID, LowestRate, HighestRate, pRaInfo->RateSGI));
|
||||
if (RateID > HighestRate)
|
||||
{
|
||||
|
@ -229,7 +229,7 @@ odm_RateDown_8188E(
|
|||
{
|
||||
RateID=i;
|
||||
goto RateDownFinish;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ RateDownFinish:
|
|||
|
||||
if(pRaInfo->RAPendingCounter>=4)
|
||||
pRaInfo->RAPendingCounter=4;
|
||||
|
||||
|
||||
pRaInfo->DecisionRate=RateID;
|
||||
odm_SetTxRPTTiming_8188E(pDM_Odm,pRaInfo, 2);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("Rate down, RPT Timing default\n"));
|
||||
|
@ -262,10 +262,10 @@ RateDownFinish:
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
odm_RateUp_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
)
|
||||
{
|
||||
u1Byte RateID, HighestRate;
|
||||
|
@ -279,20 +279,20 @@ odm_RateUp_8188E(
|
|||
}
|
||||
RateID = pRaInfo->PreRate;
|
||||
HighestRate = pRaInfo->HighestRate;
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" RateID=%d HighestRate=%d\n",
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" RateID=%d HighestRate=%d\n",
|
||||
RateID, HighestRate));
|
||||
if (pRaInfo->RAWaitingCounter==1){
|
||||
pRaInfo->RAWaitingCounter=0;
|
||||
pRaInfo->RAPendingCounter=0;
|
||||
}
|
||||
}
|
||||
else if (pRaInfo->RAWaitingCounter>1){
|
||||
pRaInfo->PreRssiStaRA=pRaInfo->RssiStaRA;
|
||||
goto RateUpfinish;
|
||||
}
|
||||
odm_SetTxRPTTiming_8188E(pDM_Odm,pRaInfo, 0);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("odm_RateUp_8188E():Decrease RPT Timing\n"));
|
||||
|
||||
|
||||
if (RateID < HighestRate)
|
||||
{
|
||||
for (i=RateID+1; i<=HighestRate; i++)
|
||||
|
@ -314,7 +314,7 @@ odm_RateUp_8188E(
|
|||
else //if((sta_info_ra->Decision_rate) > (sta_info_ra->Highest_rate))
|
||||
{
|
||||
RateID = HighestRate;
|
||||
|
||||
|
||||
}
|
||||
RateUpfinish:
|
||||
//if(pRaInfo->RAWaitingCounter==10)
|
||||
|
@ -337,18 +337,18 @@ static void odm_ResetRaCounter_8188E( IN PODM_RA_INFO_T pRaInfo){
|
|||
pRaInfo->NscDown=(N_THRESHOLD_HIGH[RateID]+N_THRESHOLD_LOW[RateID])>>1;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
odm_RateDecision_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
)
|
||||
{
|
||||
u1Byte RateID = 0, RtyPtID = 0, PenaltyID1 = 0, PenaltyID2 = 0;
|
||||
//u4Byte pool_retry;
|
||||
static u1Byte DynamicTxRPTTimingCounter=0;
|
||||
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("=====>odm_RateDecision_8188E() \n"));
|
||||
|
||||
|
||||
if (pRaInfo->Active && (pRaInfo->TOTAL > 0)) // STA used and data packet exits
|
||||
{
|
||||
if ( (pRaInfo->RssiStaRA<(pRaInfo->PreRssiStaRA-3))|| (pRaInfo->RssiStaRA>(pRaInfo->PreRssiStaRA+3))){
|
||||
|
@ -358,15 +358,15 @@ odm_RateDecision_8188E(
|
|||
// Start RA decision
|
||||
if (pRaInfo->PreRate > pRaInfo->HighestRate)
|
||||
RateID = pRaInfo->HighestRate;
|
||||
else
|
||||
else
|
||||
RateID = pRaInfo->PreRate;
|
||||
if (pRaInfo->RssiStaRA > RSSI_THRESHOLD[RateID])
|
||||
RtyPtID=0;
|
||||
else
|
||||
RtyPtID=1;
|
||||
PenaltyID1 = RETRY_PENALTY_IDX[RtyPtID][RateID]; //TODO by page
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" NscDown init is %d\n", pRaInfo->NscDown));
|
||||
//pool_retry=pRaInfo->RTY[2]+pRaInfo->RTY[3]+pRaInfo->RTY[4]+pRaInfo->DROP;
|
||||
pRaInfo->NscDown += pRaInfo->RTY[0] * RETRY_PENALTY[PenaltyID1][0];
|
||||
|
@ -374,33 +374,33 @@ odm_RateDecision_8188E(
|
|||
pRaInfo->NscDown += pRaInfo->RTY[2] * RETRY_PENALTY[PenaltyID1][2];
|
||||
pRaInfo->NscDown += pRaInfo->RTY[3] * RETRY_PENALTY[PenaltyID1][3];
|
||||
pRaInfo->NscDown += pRaInfo->RTY[4] * RETRY_PENALTY[PenaltyID1][4];
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" NscDown is %d, total*penalty[5] is %d\n",
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" NscDown is %d, total*penalty[5] is %d\n",
|
||||
pRaInfo->NscDown, (pRaInfo->TOTAL * RETRY_PENALTY[PenaltyID1][5])));
|
||||
if (pRaInfo->NscDown > (pRaInfo->TOTAL * RETRY_PENALTY[PenaltyID1][5]))
|
||||
pRaInfo->NscDown -= pRaInfo->TOTAL * RETRY_PENALTY[PenaltyID1][5];
|
||||
else
|
||||
pRaInfo->NscDown=0;
|
||||
|
||||
|
||||
// rate up
|
||||
PenaltyID2 = RETRY_PENALTY_UP_IDX[RateID];
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" NscUp init is %d\n", pRaInfo->NscUp));
|
||||
pRaInfo->NscUp += pRaInfo->RTY[0] * RETRY_PENALTY[PenaltyID2][0];
|
||||
pRaInfo->NscUp += pRaInfo->RTY[1] * RETRY_PENALTY[PenaltyID2][1];
|
||||
pRaInfo->NscUp += pRaInfo->RTY[2] * RETRY_PENALTY[PenaltyID2][2];
|
||||
pRaInfo->NscUp += pRaInfo->RTY[3] * RETRY_PENALTY[PenaltyID2][3];
|
||||
pRaInfo->NscUp += pRaInfo->RTY[4] * RETRY_PENALTY[PenaltyID2][4];
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
("NscUp is %d, total*up[5] is %d\n",
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
("NscUp is %d, total*up[5] is %d\n",
|
||||
pRaInfo->NscUp, (pRaInfo->TOTAL * RETRY_PENALTY[PenaltyID2][5])));
|
||||
if (pRaInfo->NscUp > (pRaInfo->TOTAL * RETRY_PENALTY[PenaltyID2][5]))
|
||||
pRaInfo->NscUp -= pRaInfo->TOTAL * RETRY_PENALTY[PenaltyID2][5];
|
||||
else
|
||||
pRaInfo->NscUp = 0;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE|ODM_COMP_INIT, ODM_DBG_LOUD,
|
||||
(" RssiStaRa= %d RtyPtID=%d PenaltyID1=0x%x PenaltyID2=0x%x RateID=%d NscDown=%d NscUp=%d SGI=%d\n",
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE|ODM_COMP_INIT, ODM_DBG_LOUD,
|
||||
(" RssiStaRa= %d RtyPtID=%d PenaltyID1=0x%x PenaltyID2=0x%x RateID=%d NscDown=%d NscUp=%d SGI=%d\n",
|
||||
pRaInfo->RssiStaRA,RtyPtID, PenaltyID1,PenaltyID2, RateID, pRaInfo->NscDown, pRaInfo->NscUp, pRaInfo->RateSGI));
|
||||
if ((pRaInfo->NscDown < N_THRESHOLD_LOW[RateID]) ||(pRaInfo->DROP>DROPING_NECESSARY[RateID]))
|
||||
odm_RateDown_8188E(pDM_Odm,pRaInfo);
|
||||
|
@ -410,8 +410,8 @@ odm_RateDecision_8188E(
|
|||
|
||||
if(pRaInfo->DecisionRate > pRaInfo->HighestRate)
|
||||
pRaInfo->DecisionRate = pRaInfo->HighestRate;
|
||||
|
||||
if ((pRaInfo->DecisionRate)==(pRaInfo->PreRate))
|
||||
|
||||
if ((pRaInfo->DecisionRate)==(pRaInfo->PreRate))
|
||||
DynamicTxRPTTimingCounter+=1;
|
||||
else
|
||||
DynamicTxRPTTimingCounter=0;
|
||||
|
@ -429,10 +429,10 @@ odm_RateDecision_8188E(
|
|||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("<=====odm_RateDecision_8188E() \n"));
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
odm_ARFBRefresh_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
)
|
||||
{ // Wilson 2011/10/26
|
||||
u4Byte MaskFromReg;
|
||||
|
@ -460,7 +460,7 @@ odm_ARFBRefresh_8188E(
|
|||
case RATR_INX_WIRELESS_B:
|
||||
pRaInfo->RAUseRate=(pRaInfo->RateMask)&0x0000000d;
|
||||
break;
|
||||
case 12:
|
||||
case 12:
|
||||
MaskFromReg=ODM_Read4Byte(pDM_Odm, REG_ARFR0);
|
||||
pRaInfo->RAUseRate=(pRaInfo->RateMask)&MaskFromReg;
|
||||
break;
|
||||
|
@ -476,7 +476,7 @@ odm_ARFBRefresh_8188E(
|
|||
MaskFromReg=ODM_Read4Byte(pDM_Odm, REG_ARFR3);
|
||||
pRaInfo->RAUseRate=(pRaInfo->RateMask)&MaskFromReg;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
pRaInfo->RAUseRate=(pRaInfo->RateMask);
|
||||
break;
|
||||
|
@ -508,7 +508,7 @@ odm_ARFBRefresh_8188E(
|
|||
else{
|
||||
pRaInfo->LowestRate=0;
|
||||
}
|
||||
|
||||
|
||||
#if POWER_TRAINING_ACTIVE == 1
|
||||
if (pRaInfo->HighestRate >0x13)
|
||||
pRaInfo->PTModeSS=3;
|
||||
|
@ -518,41 +518,41 @@ odm_ARFBRefresh_8188E(
|
|||
pRaInfo->PTModeSS=1;
|
||||
else
|
||||
pRaInfo->PTModeSS=0;
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
("ODM_ARFBRefresh_8188E(): PTModeSS=%d\n", pRaInfo->PTModeSS));
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
if(pRaInfo->DecisionRate > pRaInfo->HighestRate)
|
||||
pRaInfo->DecisionRate = pRaInfo->HighestRate;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
("ODM_ARFBRefresh_8188E(): RateID=%d RateMask=%8.8x RAUseRate=%8.8x HighestRate=%d,DecisionRate=%d \n",
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
("ODM_ARFBRefresh_8188E(): RateID=%d RateMask=%8.8x RAUseRate=%8.8x HighestRate=%d,DecisionRate=%d \n",
|
||||
pRaInfo->RateID, pRaInfo->RateMask, pRaInfo->RAUseRate, pRaInfo->HighestRate,pRaInfo->DecisionRate));
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if POWER_TRAINING_ACTIVE == 1
|
||||
static void
|
||||
static void
|
||||
odm_PTTryState_8188E(
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
)
|
||||
{
|
||||
pRaInfo->PTTryState=0;
|
||||
switch (pRaInfo->PTModeSS)
|
||||
{
|
||||
case 3:
|
||||
if (pRaInfo->DecisionRate>=0x19)
|
||||
case 3:
|
||||
if (pRaInfo->DecisionRate>=0x19)
|
||||
pRaInfo->PTTryState=1;
|
||||
break;
|
||||
case 2:
|
||||
if (pRaInfo->DecisionRate>=0x11)
|
||||
pRaInfo->PTTryState=1;
|
||||
break;
|
||||
break;
|
||||
case 1:
|
||||
if (pRaInfo->DecisionRate>=0x0a)
|
||||
pRaInfo->PTTryState=1;
|
||||
break;
|
||||
break;
|
||||
case 0:
|
||||
if (pRaInfo->DecisionRate>=0x03)
|
||||
pRaInfo->PTTryState=1;
|
||||
|
@ -579,7 +579,7 @@ odm_PTTryState_8188E(
|
|||
|
||||
pRaInfo->PTPreRssi=pRaInfo->RssiStaRA;
|
||||
pRaInfo->PTStopCount=0;
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
pRaInfo->RAstage=0;
|
||||
|
@ -593,9 +593,9 @@ odm_PTTryState_8188E(
|
|||
pRaInfo->PTPreRate=pRaInfo->DecisionRate;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
odm_PTDecision_8188E(
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
IN PODM_RA_INFO_T pRaInfo
|
||||
)
|
||||
{
|
||||
u1Byte stage_BUF;
|
||||
|
@ -604,7 +604,7 @@ odm_PTDecision_8188E(
|
|||
u4Byte numsc;
|
||||
u4Byte num_total;
|
||||
u1Byte stage_id;
|
||||
|
||||
|
||||
stage_BUF=pRaInfo->PTStage;
|
||||
numsc = 0;
|
||||
num_total= pRaInfo->TOTAL* PT_PENALTY[5];
|
||||
|
@ -621,7 +621,7 @@ odm_PTDecision_8188E(
|
|||
stage_id=temp_stage-j;
|
||||
else
|
||||
stage_id=0;
|
||||
|
||||
|
||||
pRaInfo->PTSmoothFactor=(pRaInfo->PTSmoothFactor>>1) + (pRaInfo->PTSmoothFactor>>2) + stage_id*16+2;
|
||||
if (pRaInfo->PTSmoothFactor>192)
|
||||
pRaInfo->PTSmoothFactor=192;
|
||||
|
@ -639,31 +639,31 @@ odm_PTDecision_8188E(
|
|||
static VOID
|
||||
odm_RATxRPTTimerSetting(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u2Byte minRptTime
|
||||
IN u2Byte minRptTime
|
||||
)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,(" =====>odm_RATxRPTTimerSetting()\n"));
|
||||
|
||||
|
||||
|
||||
|
||||
if(pDM_Odm->CurrminRptTime != minRptTime){
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
(" CurrminRptTime =0x%04x minRptTime=0x%04x\n", pDM_Odm->CurrminRptTime, minRptTime));
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_AP))
|
||||
ODM_RA_Set_TxRPT_Time(pDM_Odm,minRptTime);
|
||||
ODM_RA_Set_TxRPT_Time(pDM_Odm,minRptTime);
|
||||
#else
|
||||
rtw_rpt_timer_cfg_cmd(pDM_Odm->Adapter,minRptTime);
|
||||
#endif
|
||||
#endif
|
||||
pDM_Odm->CurrminRptTime = minRptTime;
|
||||
}
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,(" <=====odm_RATxRPTTimerSetting()\n"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
VOID
|
||||
ODM_RASupport_Init(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("=====>ODM_RASupport_Init()\n"));
|
||||
|
||||
// 2012/02/14 MH Be noticed, the init must be after IC type is recognized!!!!!
|
||||
|
@ -674,10 +674,10 @@ ODM_RASupport_Init(
|
|||
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ODM_RAInfo_Init(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
)
|
||||
{
|
||||
PODM_RA_INFO_T pRaInfo = &pDM_Odm->RAInfo[MacID];
|
||||
|
@ -685,7 +685,7 @@ ODM_RAInfo_Init(
|
|||
u1Byte WirelessMode=0xFF; //invalid value
|
||||
u1Byte max_rate_idx = 0x13; //MCS7
|
||||
if(pDM_Odm->pWirelessMode!=NULL){
|
||||
WirelessMode=*(pDM_Odm->pWirelessMode);
|
||||
WirelessMode=*(pDM_Odm->pWirelessMode);
|
||||
}
|
||||
|
||||
if(WirelessMode != 0xFF ){
|
||||
|
@ -696,19 +696,19 @@ ODM_RAInfo_Init(
|
|||
else if(WirelessMode & ODM_WM_B)
|
||||
max_rate_idx = 0x03;
|
||||
}
|
||||
|
||||
|
||||
//printk("%s ==>WirelessMode:0x%08x ,max_raid_idx:0x%02x\n ",__FUNCTION__,WirelessMode,max_rate_idx);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
("ODM_RAInfo_Init(): WirelessMode:0x%08x ,max_raid_idx:0x%02x \n",
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
("ODM_RAInfo_Init(): WirelessMode:0x%08x ,max_raid_idx:0x%02x \n",
|
||||
WirelessMode,max_rate_idx));
|
||||
|
||||
|
||||
pRaInfo->DecisionRate = max_rate_idx;
|
||||
pRaInfo->PreRate = max_rate_idx;
|
||||
pRaInfo->HighestRate=max_rate_idx;
|
||||
#else
|
||||
pRaInfo->DecisionRate = 0x13;
|
||||
pRaInfo->PreRate = 0x13;
|
||||
pRaInfo->HighestRate= 0x13;
|
||||
#else
|
||||
pRaInfo->DecisionRate = 0x13;
|
||||
pRaInfo->PreRate = 0x13;
|
||||
pRaInfo->HighestRate= 0x13;
|
||||
#endif
|
||||
pRaInfo->LowestRate=0;
|
||||
pRaInfo->RateID=0;
|
||||
|
@ -746,7 +746,7 @@ ODM_RAInfo_Init(
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
ODM_RAInfo_Init_all(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
|
@ -765,21 +765,21 @@ ODM_RAInfo_Init_all(
|
|||
|
||||
u1Byte
|
||||
ODM_RA_GetShortGI_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
)
|
||||
{
|
||||
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
|
||||
return 0;
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
("MacID=%d SGI=%d\n", MacID, pDM_Odm->RAInfo[MacID].RateSGI));
|
||||
return pDM_Odm->RAInfo[MacID].RateSGI;
|
||||
}
|
||||
|
||||
u1Byte
|
||||
u1Byte
|
||||
ODM_RA_GetDecisionRate_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
)
|
||||
{
|
||||
u1Byte DecisionRate = 0;
|
||||
|
@ -787,43 +787,43 @@ ODM_RA_GetDecisionRate_8188E(
|
|||
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
|
||||
return 0;
|
||||
DecisionRate = (pDM_Odm->RAInfo[MacID].DecisionRate);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" MacID=%d DecisionRate=0x%x\n", MacID, DecisionRate));
|
||||
return DecisionRate;
|
||||
}
|
||||
|
||||
u1Byte
|
||||
ODM_RA_GetHwPwrStatus_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
)
|
||||
{
|
||||
u1Byte PTStage = 5;
|
||||
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
|
||||
return 0;
|
||||
PTStage = (pDM_Odm->RAInfo[MacID].PTStage);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
("MacID=%d PTStage=0x%x\n", MacID, PTStage));
|
||||
return PTStage;
|
||||
}
|
||||
|
||||
VOID
|
||||
VOID
|
||||
ODM_RA_UpdateRateInfo_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID,
|
||||
IN u1Byte RateID,
|
||||
IN u1Byte RateID,
|
||||
IN u4Byte RateMask,
|
||||
IN u1Byte SGIEnable
|
||||
)
|
||||
{
|
||||
PODM_RA_INFO_T pRaInfo = NULL;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
("MacID=%d RateID=0x%x RateMask=0x%x SGIEnable=%d\n",
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
("MacID=%d RateID=0x%x RateMask=0x%x SGIEnable=%d\n",
|
||||
MacID, RateID, RateMask, SGIEnable));
|
||||
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
|
||||
return;
|
||||
|
||||
|
||||
pRaInfo = &(pDM_Odm->RAInfo[MacID]);
|
||||
pRaInfo->RateID = RateID;
|
||||
pRaInfo->RateMask = RateMask;
|
||||
|
@ -831,16 +831,16 @@ ODM_RA_UpdateRateInfo_8188E(
|
|||
odm_ARFBRefresh_8188E(pDM_Odm, pRaInfo);
|
||||
}
|
||||
|
||||
VOID
|
||||
VOID
|
||||
ODM_RA_SetRSSI_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID,
|
||||
IN u1Byte Rssi
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID,
|
||||
IN u1Byte Rssi
|
||||
)
|
||||
{
|
||||
PODM_RA_INFO_T pRaInfo = NULL;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
|
||||
(" MacID=%d Rssi=%d\n", MacID, Rssi));
|
||||
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
|
||||
return;
|
||||
|
@ -849,10 +849,10 @@ ODM_RA_SetRSSI_8188E(
|
|||
pRaInfo->RssiStaRA = Rssi;
|
||||
}
|
||||
|
||||
VOID
|
||||
VOID
|
||||
ODM_RA_Set_TxRPT_Time(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u2Byte minRptTime
|
||||
IN u2Byte minRptTime
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP))
|
||||
|
@ -863,7 +863,7 @@ ODM_RA_Set_TxRPT_Time(
|
|||
|
||||
|
||||
VOID
|
||||
ODM_RA_TxRPT2Handle_8188E(
|
||||
ODM_RA_TxRPT2Handle_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN pu1Byte TxRPT_Buf,
|
||||
IN u2Byte TxRPT_Len,
|
||||
|
@ -875,11 +875,11 @@ ODM_RA_TxRPT2Handle_8188E(
|
|||
u1Byte MacId = 0;
|
||||
pu1Byte pBuffer = NULL;
|
||||
u4Byte valid = 0, ItemNum = 0;
|
||||
u2Byte minRptTime = 0x927c;
|
||||
u2Byte minRptTime = 0x927c;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("=====>ODM_RA_TxRPT2Handle_8188E(): valid0=%d valid1=%d BufferLength=%d\n",
|
||||
MacIDValidEntry0, MacIDValidEntry1, TxRPT_Len));
|
||||
|
||||
|
||||
ItemNum = TxRPT_Len >> 3;
|
||||
pBuffer = TxRPT_Buf;
|
||||
|
||||
|
@ -921,8 +921,8 @@ ODM_RA_TxRPT2Handle_8188E(
|
|||
pRAInfo->DROP;
|
||||
if(pRAInfo->TOTAL != 0)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
("macid=%d Total=%d R0=%d R1=%d R2=%d R3=%d R4=%d D0=%d valid0=%x valid1=%x\n",
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||
("macid=%d Total=%d R0=%d R1=%d R2=%d R3=%d R4=%d D0=%d valid0=%x valid1=%x\n",
|
||||
MacId,
|
||||
pRAInfo->TOTAL,
|
||||
pRAInfo->RTY[0],
|
||||
|
@ -964,11 +964,11 @@ ODM_RA_TxRPT2Handle_8188E(
|
|||
#ifdef DETECT_STA_EXISTANCE
|
||||
void RTL8188E_DetectSTAExistance(PDM_ODM_T pDM_Odm, PODM_RA_INFO_T pRAInfo, int MacID);
|
||||
RTL8188E_DetectSTAExistance(pDM_Odm, pRAInfo, MacId);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD,
|
||||
("macid=%d R0=%d R1=%d R2=%d R3=%d R4=%d drop=%d valid0=%x RateID=%d SGI=%d\n",
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD,
|
||||
("macid=%d R0=%d R1=%d R2=%d R3=%d R4=%d drop=%d valid0=%x RateID=%d SGI=%d\n",
|
||||
MacId,
|
||||
pRAInfo->RTY[0],
|
||||
pRAInfo->RTY[1],
|
||||
|
@ -985,14 +985,14 @@ ODM_RA_TxRPT2Handle_8188E(
|
|||
}
|
||||
|
||||
if(minRptTime > pRAInfo->RptTime)
|
||||
minRptTime = pRAInfo->RptTime;
|
||||
minRptTime = pRAInfo->RptTime;
|
||||
|
||||
pBuffer += TX_RPT2_ITEM_SIZE;
|
||||
MacId++;
|
||||
}while(MacId < ItemNum);
|
||||
|
||||
|
||||
odm_RATxRPTTimerSetting(pDM_Odm,minRptTime);
|
||||
|
||||
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("<===== ODM_RA_TxRPT2Handle_8188E()\n"));
|
||||
}
|
||||
|
@ -1002,7 +1002,7 @@ ODM_RA_TxRPT2Handle_8188E(
|
|||
static VOID
|
||||
odm_RATxRPTTimerSetting(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u2Byte minRptTime
|
||||
IN u2Byte minRptTime
|
||||
)
|
||||
{
|
||||
return;
|
||||
|
@ -1011,22 +1011,22 @@ odm_RATxRPTTimerSetting(
|
|||
|
||||
VOID
|
||||
ODM_RASupport_Init(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
ODM_RAInfo_Init(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
ODM_RAInfo_Init_all(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
|
@ -1034,37 +1034,37 @@ ODM_RAInfo_Init_all(
|
|||
return 0;
|
||||
}
|
||||
|
||||
u1Byte
|
||||
u1Byte
|
||||
ODM_RA_GetShortGI_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
u1Byte
|
||||
u1Byte
|
||||
ODM_RA_GetDecisionRate_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
u1Byte
|
||||
ODM_RA_GetHwPwrStatus_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
VOID
|
||||
VOID
|
||||
ODM_RA_UpdateRateInfo_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID,
|
||||
IN u1Byte RateID,
|
||||
IN u1Byte RateID,
|
||||
IN u4Byte RateMask,
|
||||
IN u1Byte SGIEnable
|
||||
)
|
||||
|
@ -1072,27 +1072,27 @@ ODM_RA_UpdateRateInfo_8188E(
|
|||
return;
|
||||
}
|
||||
|
||||
VOID
|
||||
VOID
|
||||
ODM_RA_SetRSSI_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte MacID,
|
||||
IN u1Byte Rssi
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_RA_Set_TxRPT_Time(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u2Byte minRptTime
|
||||
IN u1Byte MacID,
|
||||
IN u1Byte Rssi
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_RA_TxRPT2Handle_8188E(
|
||||
ODM_RA_Set_TxRPT_Time(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u2Byte minRptTime
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_RA_TxRPT2Handle_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN pu1Byte TxRPT_Buf,
|
||||
IN u2Byte TxRPT_Len,
|
||||
|
@ -1102,7 +1102,6 @@ ODM_RA_TxRPT2Handle_8188E(
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
615
hal/HalPhyRf.c
615
hal/HalPhyRf.c
File diff suppressed because it is too large
Load diff
6090
hal/HalPhyRf_8188e.c
6090
hal/HalPhyRf_8188e.c
File diff suppressed because it is too large
Load diff
|
@ -1,187 +1,185 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
/*++
|
||||
Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
HalPwrSeqCmd.c
|
||||
|
||||
Abstract:
|
||||
Implement HW Power sequence configuration CMD handling routine for Realtek devices.
|
||||
|
||||
Major Change History:
|
||||
When Who What
|
||||
---------- --------------- -------------------------------
|
||||
2011-10-26 Lucas Modify to be compatible with SD4-CE driver.
|
||||
2011-07-07 Roger Create.
|
||||
|
||||
--*/
|
||||
#include <HalPwrSeqCmd.h>
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#include <sdio_ops.h>
|
||||
#elif defined(CONFIG_GSPI_HCI)
|
||||
#include <gspi_ops.h>
|
||||
#endif
|
||||
|
||||
//
|
||||
// Description:
|
||||
// This routine deal with the Power Configuration CMDs parsing for RTL8723/RTL8188E Series IC.
|
||||
//
|
||||
// Assumption:
|
||||
// We should follow specific format which was released from HW SD.
|
||||
//
|
||||
// 2011.07.07, added by Roger.
|
||||
//
|
||||
u8 HalPwrSeqCmdParsing(
|
||||
struct adapter * padapter,
|
||||
u8 CutVersion,
|
||||
u8 FabVersion,
|
||||
u8 InterfaceType,
|
||||
WLAN_PWR_CFG PwrSeqCmd[])
|
||||
{
|
||||
WLAN_PWR_CFG PwrCfgCmd = {0};
|
||||
u8 bPollingBit = _FALSE;
|
||||
u32 AryIdx = 0;
|
||||
u8 value = 0;
|
||||
u32 offset = 0;
|
||||
u32 pollingCount = 0; // polling autoload done.
|
||||
u32 maxPollingCnt = 5000;
|
||||
|
||||
do {
|
||||
PwrCfgCmd = PwrSeqCmd[AryIdx];
|
||||
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_,
|
||||
("HalPwrSeqCmdParsing: offset(%#x) cut_msk(%#x) fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x) msk(%#x) value(%#x)\n",
|
||||
GET_PWR_CFG_OFFSET(PwrCfgCmd),
|
||||
GET_PWR_CFG_CUT_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_FAB_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_INTF_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_BASE(PwrCfgCmd),
|
||||
GET_PWR_CFG_CMD(PwrCfgCmd),
|
||||
GET_PWR_CFG_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_VALUE(PwrCfgCmd)));
|
||||
|
||||
//2 Only Handle the command whose FAB, CUT, and Interface are matched
|
||||
if ((GET_PWR_CFG_FAB_MASK(PwrCfgCmd) & FabVersion) &&
|
||||
(GET_PWR_CFG_CUT_MASK(PwrCfgCmd) & CutVersion) &&
|
||||
(GET_PWR_CFG_INTF_MASK(PwrCfgCmd) & InterfaceType))
|
||||
{
|
||||
switch (GET_PWR_CFG_CMD(PwrCfgCmd))
|
||||
{
|
||||
case PWR_CMD_READ:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_READ\n"));
|
||||
break;
|
||||
|
||||
case PWR_CMD_WRITE:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_WRITE\n"));
|
||||
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
//
|
||||
// <Roger_Notes> We should deal with interface specific address mapping for some interfaces, e.g., SDIO interface
|
||||
// 2011.07.07.
|
||||
//
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
{
|
||||
// Read Back SDIO Local value
|
||||
value = SdioLocalCmd52Read1Byte(padapter, offset);
|
||||
|
||||
value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
|
||||
// Write Back SDIO Local value
|
||||
SdioLocalCmd52Write1Byte(padapter, offset, value);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_GSPI_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
offset = SPI_LOCAL_OFFSET | offset;
|
||||
#endif
|
||||
// Read the value from system register
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
|
||||
// Write the value back to sytem register
|
||||
rtw_write8(padapter, offset, value);
|
||||
}
|
||||
break;
|
||||
|
||||
case PWR_CMD_POLLING:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_POLLING\n"));
|
||||
|
||||
bPollingBit = _FALSE;
|
||||
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
|
||||
#ifdef CONFIG_GSPI_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
offset = SPI_LOCAL_OFFSET | offset;
|
||||
#endif
|
||||
do {
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
value = SdioLocalCmd52Read1Byte(padapter, offset);
|
||||
else
|
||||
#endif
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value &= GET_PWR_CFG_MASK(PwrCfgCmd);
|
||||
if (value == (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd)))
|
||||
bPollingBit = _TRUE;
|
||||
else
|
||||
rtw_udelay_os(10);
|
||||
|
||||
if (pollingCount++ > maxPollingCnt) {
|
||||
DBG_871X("Fail to polling Offset[%#x]\n", offset);
|
||||
return _FALSE;
|
||||
}
|
||||
} while (!bPollingBit);
|
||||
|
||||
break;
|
||||
|
||||
case PWR_CMD_DELAY:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_DELAY\n"));
|
||||
if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd));
|
||||
else
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd)*1000);
|
||||
break;
|
||||
|
||||
case PWR_CMD_END:
|
||||
// When this command is parsed, end the process
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_END\n"));
|
||||
return _TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_err_, ("HalPwrSeqCmdParsing: Unknown CMD!!\n"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AryIdx++;//Add Array Index
|
||||
}while(1);
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
/*++
|
||||
Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
HalPwrSeqCmd.c
|
||||
|
||||
Abstract:
|
||||
Implement HW Power sequence configuration CMD handling routine for Realtek devices.
|
||||
|
||||
Major Change History:
|
||||
When Who What
|
||||
---------- --------------- -------------------------------
|
||||
2011-10-26 Lucas Modify to be compatible with SD4-CE driver.
|
||||
2011-07-07 Roger Create.
|
||||
|
||||
--*/
|
||||
#include <HalPwrSeqCmd.h>
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#include <sdio_ops.h>
|
||||
#elif defined(CONFIG_GSPI_HCI)
|
||||
#include <gspi_ops.h>
|
||||
#endif
|
||||
|
||||
//
|
||||
// Description:
|
||||
// This routine deal with the Power Configuration CMDs parsing for RTL8723/RTL8188E Series IC.
|
||||
//
|
||||
// Assumption:
|
||||
// We should follow specific format which was released from HW SD.
|
||||
//
|
||||
// 2011.07.07, added by Roger.
|
||||
//
|
||||
u8 HalPwrSeqCmdParsing(
|
||||
struct adapter * padapter,
|
||||
u8 CutVersion,
|
||||
u8 FabVersion,
|
||||
u8 InterfaceType,
|
||||
WLAN_PWR_CFG PwrSeqCmd[])
|
||||
{
|
||||
WLAN_PWR_CFG PwrCfgCmd = {0};
|
||||
u8 bPollingBit = _FALSE;
|
||||
u32 AryIdx = 0;
|
||||
u8 value = 0;
|
||||
u32 offset = 0;
|
||||
u32 pollingCount = 0; // polling autoload done.
|
||||
u32 maxPollingCnt = 5000;
|
||||
|
||||
do {
|
||||
PwrCfgCmd = PwrSeqCmd[AryIdx];
|
||||
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_,
|
||||
("HalPwrSeqCmdParsing: offset(%#x) cut_msk(%#x) fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x) msk(%#x) value(%#x)\n",
|
||||
GET_PWR_CFG_OFFSET(PwrCfgCmd),
|
||||
GET_PWR_CFG_CUT_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_FAB_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_INTF_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_BASE(PwrCfgCmd),
|
||||
GET_PWR_CFG_CMD(PwrCfgCmd),
|
||||
GET_PWR_CFG_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_VALUE(PwrCfgCmd)));
|
||||
|
||||
//2 Only Handle the command whose FAB, CUT, and Interface are matched
|
||||
if ((GET_PWR_CFG_FAB_MASK(PwrCfgCmd) & FabVersion) &&
|
||||
(GET_PWR_CFG_CUT_MASK(PwrCfgCmd) & CutVersion) &&
|
||||
(GET_PWR_CFG_INTF_MASK(PwrCfgCmd) & InterfaceType))
|
||||
{
|
||||
switch (GET_PWR_CFG_CMD(PwrCfgCmd))
|
||||
{
|
||||
case PWR_CMD_READ:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_READ\n"));
|
||||
break;
|
||||
|
||||
case PWR_CMD_WRITE:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_WRITE\n"));
|
||||
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
//
|
||||
// <Roger_Notes> We should deal with interface specific address mapping for some interfaces, e.g., SDIO interface
|
||||
// 2011.07.07.
|
||||
//
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
{
|
||||
// Read Back SDIO Local value
|
||||
value = SdioLocalCmd52Read1Byte(padapter, offset);
|
||||
|
||||
value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
|
||||
// Write Back SDIO Local value
|
||||
SdioLocalCmd52Write1Byte(padapter, offset, value);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_GSPI_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
offset = SPI_LOCAL_OFFSET | offset;
|
||||
#endif
|
||||
// Read the value from system register
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
|
||||
// Write the value back to sytem register
|
||||
rtw_write8(padapter, offset, value);
|
||||
}
|
||||
break;
|
||||
|
||||
case PWR_CMD_POLLING:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_POLLING\n"));
|
||||
|
||||
bPollingBit = _FALSE;
|
||||
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
|
||||
#ifdef CONFIG_GSPI_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
offset = SPI_LOCAL_OFFSET | offset;
|
||||
#endif
|
||||
do {
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
value = SdioLocalCmd52Read1Byte(padapter, offset);
|
||||
else
|
||||
#endif
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value &= GET_PWR_CFG_MASK(PwrCfgCmd);
|
||||
if (value == (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd)))
|
||||
bPollingBit = _TRUE;
|
||||
else
|
||||
rtw_udelay_os(10);
|
||||
|
||||
if (pollingCount++ > maxPollingCnt) {
|
||||
DBG_871X("Fail to polling Offset[%#x]\n", offset);
|
||||
return _FALSE;
|
||||
}
|
||||
} while (!bPollingBit);
|
||||
|
||||
break;
|
||||
|
||||
case PWR_CMD_DELAY:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_DELAY\n"));
|
||||
if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd));
|
||||
else
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd)*1000);
|
||||
break;
|
||||
|
||||
case PWR_CMD_END:
|
||||
// When this command is parsed, end the process
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_END\n"));
|
||||
return _TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_err_, ("HalPwrSeqCmdParsing: Unknown CMD!!\n"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AryIdx++;//Add Array Index
|
||||
}while(1);
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
@ -107,7 +107,7 @@ hal_com_get_channel_plan(
|
|||
u8 MRateToHwRate(u8 rate)
|
||||
{
|
||||
u8 ret = DESC_RATE1M;
|
||||
|
||||
|
||||
switch(rate)
|
||||
{
|
||||
// CCK and OFDM non-HT rates
|
||||
|
@ -151,9 +151,9 @@ void HalSetBrateCfg(
|
|||
{
|
||||
is_brate = mBratesOS[i] & IEEE80211_BASIC_RATE_MASK;
|
||||
brate = mBratesOS[i] & 0x7f;
|
||||
|
||||
|
||||
if( is_brate )
|
||||
{
|
||||
{
|
||||
switch(brate)
|
||||
{
|
||||
case IEEE80211_CCK_RATE_1MB: *pBrateCfg |= RATE_1M; break;
|
||||
|
@ -184,7 +184,7 @@ _OneOutPipeMapping(
|
|||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[0];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];//BK
|
||||
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
|
@ -194,89 +194,89 @@ _OneOutPipeMapping(
|
|||
static VOID
|
||||
_TwoOutPipeMapping(
|
||||
IN struct adapter *pAdapter,
|
||||
IN BOOLEAN bWIFICfg
|
||||
IN BOOLEAN bWIFICfg
|
||||
)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(pAdapter);
|
||||
|
||||
if(bWIFICfg){ //WMM
|
||||
|
||||
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 0, 1, 0, 1, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:L
|
||||
|
||||
|
||||
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 0, 1, 0, 1, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:L
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[1];//VO
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];//BK
|
||||
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
|
||||
|
||||
}
|
||||
else{//typical setting
|
||||
|
||||
|
||||
//BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 1, 1, 0, 0, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:L
|
||||
|
||||
|
||||
//BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 1, 1, 0, 0, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:L
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];//VO
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];//BK
|
||||
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static VOID _ThreeOutPipeMapping(
|
||||
IN struct adapter *pAdapter,
|
||||
IN BOOLEAN bWIFICfg
|
||||
IN BOOLEAN bWIFICfg
|
||||
)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(pAdapter);
|
||||
|
||||
if(bWIFICfg){//for WMM
|
||||
|
||||
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 1, 2, 1, 0, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:N, 2:L
|
||||
|
||||
|
||||
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 1, 2, 1, 0, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:N, 2:L
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];//VO
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];//BK
|
||||
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
|
||||
|
||||
}
|
||||
else{//typical setting
|
||||
|
||||
|
||||
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 2, 2, 1, 0, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:N, 2:L
|
||||
|
||||
|
||||
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 2, 2, 1, 0, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:N, 2:L
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];//VO
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[2];//BK
|
||||
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ Hal_MappingOutPipe(
|
|||
struct registry_priv *pregistrypriv = &pAdapter->registrypriv;
|
||||
|
||||
BOOLEAN bWIFICfg = (pregistrypriv->wifi_spec) ?_TRUE:_FALSE;
|
||||
|
||||
|
||||
BOOLEAN result = _TRUE;
|
||||
|
||||
switch(NumOutPipe)
|
||||
|
@ -310,7 +310,7 @@ Hal_MappingOutPipe(
|
|||
}
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void hal_init_macaddr(struct adapter *adapter)
|
||||
|
@ -322,10 +322,10 @@ void hal_init_macaddr(struct adapter *adapter)
|
|||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* C2H event format:
|
||||
* Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
|
||||
* BITS [127:120] [119:16] [15:8] [7:4] [3:0]
|
||||
* Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
|
||||
* BITS [127:120] [119:16] [15:8] [7:4] [3:0]
|
||||
*/
|
||||
|
||||
void c2h_evt_clear(struct adapter *adapter)
|
||||
|
@ -356,7 +356,7 @@ s32 c2h_evt_read(struct adapter *adapter, u8 *buf)
|
|||
_rtw_memset(c2h_evt, 0, 16);
|
||||
|
||||
*buf = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL);
|
||||
*(buf+1) = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1);
|
||||
*(buf+1) = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1);
|
||||
|
||||
RT_PRINT_DATA(_module_hal_init_c_, _drv_info_, "c2h_evt_read(): ",
|
||||
&c2h_evt , sizeof(c2h_evt));
|
||||
|
@ -376,7 +376,7 @@ s32 c2h_evt_read(struct adapter *adapter, u8 *buf)
|
|||
ret = _SUCCESS;
|
||||
|
||||
clear_evt:
|
||||
/*
|
||||
/*
|
||||
* Clear event to notify FW we have read the command.
|
||||
* If this field isn't clear, the FW won't update the next command message.
|
||||
*/
|
||||
|
@ -439,4 +439,3 @@ GetHalDefVar(struct adapter *adapter, HAL_DEF_VARIABLE variable, void *value)
|
|||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
@ -98,11 +98,11 @@ u32 rtw_hal_power_on(struct adapter *padapter)
|
|||
void rtw_hal_power_off(struct adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.hal_power_off)
|
||||
padapter->HalFunc.hal_power_off(padapter);
|
||||
padapter->HalFunc.hal_power_off(padapter);
|
||||
}
|
||||
|
||||
|
||||
uint rtw_hal_init(struct adapter *padapter)
|
||||
uint rtw_hal_init(struct adapter *padapter)
|
||||
{
|
||||
uint status = _SUCCESS;
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||
|
@ -125,12 +125,12 @@ uint rtw_hal_init(struct adapter *padapter)
|
|||
}
|
||||
else
|
||||
{
|
||||
status = padapter->HalFunc.hal_init(padapter->pbuddy_adapter);
|
||||
status = padapter->HalFunc.hal_init(padapter->pbuddy_adapter);
|
||||
if(status == _SUCCESS){
|
||||
padapter->pbuddy_adapter->hw_init_completed = _TRUE;
|
||||
}
|
||||
else{
|
||||
padapter->pbuddy_adapter->hw_init_completed = _FALSE;
|
||||
padapter->pbuddy_adapter->hw_init_completed = _FALSE;
|
||||
RT_TRACE(_module_hal_init_c_,_drv_err_,("rtw_hal_init: hal__init fail(pbuddy_adapter)\n"));
|
||||
DBG_871X("rtw_hal_init: hal__init fail(pbuddy_adapter)\n");
|
||||
return status;
|
||||
|
@ -146,7 +146,7 @@ uint rtw_hal_init(struct adapter *padapter)
|
|||
padapter = dvobj->padapters[i];
|
||||
padapter->hw_init_completed = _TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (padapter->registrypriv.notch_filter == 1)
|
||||
rtw_hal_notch_filter(padapter, 1);
|
||||
|
||||
|
@ -167,7 +167,7 @@ uint rtw_hal_init(struct adapter *padapter)
|
|||
|
||||
return status;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
uint rtw_hal_deinit(struct adapter *padapter)
|
||||
{
|
||||
|
@ -193,9 +193,9 @@ _func_enter_;
|
|||
{
|
||||
DBG_871X("\n rtw_hal_deinit: hal_init fail\n");
|
||||
}
|
||||
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -212,17 +212,17 @@ void rtw_hal_get_hwreg(struct adapter *padapter, u8 variable, u8 *val)
|
|||
}
|
||||
|
||||
u8 rtw_hal_set_def_var(struct adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue)
|
||||
{
|
||||
{
|
||||
if(padapter->HalFunc.SetHalDefVarHandler)
|
||||
return padapter->HalFunc.SetHalDefVarHandler(padapter,eVariable,pValue);
|
||||
return _FAIL;
|
||||
}
|
||||
u8 rtw_hal_get_def_var(struct adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue)
|
||||
{
|
||||
{
|
||||
if(padapter->HalFunc.GetHalDefVarHandler)
|
||||
return padapter->HalFunc.GetHalDefVarHandler(padapter,eVariable,pValue);
|
||||
return _FAIL;
|
||||
}
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
void rtw_hal_set_odm_var(struct adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet)
|
||||
{
|
||||
|
@ -241,12 +241,12 @@ void rtw_hal_enable_interrupt(struct adapter *padapter)
|
|||
DBG_871X(" rtw_hal_enable_interrupt: Secondary adapter return l\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (padapter->HalFunc.enable_interrupt)
|
||||
padapter->HalFunc.enable_interrupt(padapter);
|
||||
else
|
||||
else
|
||||
DBG_871X("%s: HalFunc.enable_interrupt is NULL!\n", __FUNCTION__);
|
||||
|
||||
|
||||
}
|
||||
void rtw_hal_disable_interrupt(struct adapter *padapter)
|
||||
{
|
||||
|
@ -254,38 +254,38 @@ void rtw_hal_disable_interrupt(struct adapter *padapter)
|
|||
DBG_871X(" rtw_hal_disable_interrupt: Secondary adapter return l\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (padapter->HalFunc.disable_interrupt)
|
||||
padapter->HalFunc.disable_interrupt(padapter);
|
||||
else
|
||||
else
|
||||
DBG_871X("%s: HalFunc.disable_interrupt is NULL!\n", __FUNCTION__);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
u32 rtw_hal_inirp_init(struct adapter *padapter)
|
||||
{
|
||||
u32 rst = _FAIL;
|
||||
if(padapter->HalFunc.inirp_init)
|
||||
rst = padapter->HalFunc.inirp_init(padapter);
|
||||
else
|
||||
DBG_871X(" %s HalFunc.inirp_init is NULL!!!\n",__FUNCTION__);
|
||||
if(padapter->HalFunc.inirp_init)
|
||||
rst = padapter->HalFunc.inirp_init(padapter);
|
||||
else
|
||||
DBG_871X(" %s HalFunc.inirp_init is NULL!!!\n",__FUNCTION__);
|
||||
return rst;
|
||||
}
|
||||
|
||||
|
||||
u32 rtw_hal_inirp_deinit(struct adapter *padapter)
|
||||
{
|
||||
|
||||
|
||||
if(padapter->HalFunc.inirp_deinit)
|
||||
return padapter->HalFunc.inirp_deinit(padapter);
|
||||
|
||||
return _FAIL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_hal_intf_ps_func(struct adapter *padapter,HAL_INTF_PS_FUNC efunc_id, u8* val)
|
||||
{
|
||||
if(padapter->HalFunc.interface_ps_func)
|
||||
{
|
||||
if(padapter->HalFunc.interface_ps_func)
|
||||
return padapter->HalFunc.interface_ps_func(padapter,efunc_id,val);
|
||||
return _FAIL;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ s32 rtw_hal_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmit
|
|||
if(padapter->HalFunc.hal_xmitframe_enqueue)
|
||||
return padapter->HalFunc.hal_xmitframe_enqueue(padapter, pxmitframe);
|
||||
|
||||
return _FALSE;
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
s32 rtw_hal_xmit(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
|
@ -303,7 +303,7 @@ s32 rtw_hal_xmit(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
|||
if(padapter->HalFunc.hal_xmit)
|
||||
return padapter->HalFunc.hal_xmit(padapter, pxmitframe);
|
||||
|
||||
return _FALSE;
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
s32 rtw_hal_mgnt_xmit(struct adapter *padapter, struct xmit_frame *pmgntframe)
|
||||
|
@ -323,7 +323,7 @@ s32 rtw_hal_mgnt_xmit(struct adapter *padapter, struct xmit_frame *pmgntframe)
|
|||
{
|
||||
pmgntframe->attrib.encrypt = _BIP_;
|
||||
//pmgntframe->attrib.bswenc = _TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pmgntframe->attrib.encrypt = _AES_;
|
||||
|
@ -332,14 +332,14 @@ s32 rtw_hal_mgnt_xmit(struct adapter *padapter, struct xmit_frame *pmgntframe)
|
|||
rtw_mgmt_xmitframe_coalesce(padapter, pmgntframe->pkt, pmgntframe);
|
||||
}
|
||||
#endif //CONFIG_IEEE80211W
|
||||
|
||||
|
||||
if(padapter->HalFunc.mgnt_xmit)
|
||||
ret = padapter->HalFunc.mgnt_xmit(padapter, pmgntframe);
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 rtw_hal_init_xmit_priv(struct adapter *padapter)
|
||||
{
|
||||
{
|
||||
if(padapter->HalFunc.init_xmit_priv != NULL)
|
||||
return padapter->HalFunc.init_xmit_priv(padapter);
|
||||
return _FAIL;
|
||||
|
@ -351,14 +351,14 @@ void rtw_hal_free_xmit_priv(struct adapter *padapter)
|
|||
}
|
||||
|
||||
s32 rtw_hal_init_recv_priv(struct adapter *padapter)
|
||||
{
|
||||
{
|
||||
if(padapter->HalFunc.init_recv_priv)
|
||||
return padapter->HalFunc.init_recv_priv(padapter);
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
void rtw_hal_free_recv_priv(struct adapter *padapter)
|
||||
{
|
||||
{
|
||||
if(padapter->HalFunc.free_recv_priv)
|
||||
padapter->HalFunc.free_recv_priv(padapter);
|
||||
}
|
||||
|
@ -380,10 +380,10 @@ void rtw_hal_update_ra_mask(struct sta_info *psta, u8 rssi_level)
|
|||
add_RATid(padapter, psta, rssi_level);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
if(padapter->HalFunc.UpdateRAMaskHandler)
|
||||
padapter->HalFunc.UpdateRAMaskHandler(padapter, psta->mac_id, rssi_level);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_hal_add_ra_tid(struct adapter *padapter, u32 bitmap, u8 arg, u8 rssi_level)
|
||||
|
@ -428,7 +428,7 @@ u32 rtw_hal_read_rfreg(struct adapter *padapter, u32 eRFPath, u32 RegAddr, u32 B
|
|||
void rtw_hal_write_rfreg(struct adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask, u32 Data)
|
||||
{
|
||||
if(padapter->HalFunc.write_rfreg)
|
||||
padapter->HalFunc.write_rfreg(padapter, eRFPath, RegAddr, BitMask, Data);
|
||||
padapter->HalFunc.write_rfreg(padapter, eRFPath, RegAddr, BitMask, Data);
|
||||
}
|
||||
|
||||
s32 rtw_hal_interrupt_handler(struct adapter *padapter)
|
||||
|
@ -455,7 +455,7 @@ void rtw_hal_dm_watchdog(struct adapter *padapter)
|
|||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER)
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
if(padapter->HalFunc.hal_dm_watchdog)
|
||||
padapter->HalFunc.hal_dm_watchdog(padapter);
|
||||
}
|
||||
|
@ -463,16 +463,16 @@ void rtw_hal_dm_watchdog(struct adapter *padapter)
|
|||
void rtw_hal_bcn_related_reg_setting(struct adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.SetBeaconRelatedRegistersHandler)
|
||||
padapter->HalFunc.SetBeaconRelatedRegistersHandler(padapter);
|
||||
padapter->HalFunc.SetBeaconRelatedRegistersHandler(padapter);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_ANTENNA_DIVERSITY
|
||||
u8 rtw_hal_antdiv_before_linked(struct adapter *padapter)
|
||||
{
|
||||
{
|
||||
if(padapter->HalFunc.AntDivBeforeLinkHandler)
|
||||
return padapter->HalFunc.AntDivBeforeLinkHandler(padapter);
|
||||
return _FALSE;
|
||||
return _FALSE;
|
||||
}
|
||||
void rtw_hal_antdiv_rssi_compared(struct adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src)
|
||||
{
|
||||
|
@ -494,7 +494,7 @@ s32 rtw_hal_hostap_mgnt_xmit_entry(struct adapter *padapter, _pkt *pkt)
|
|||
void rtw_hal_sreset_init(struct adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.sreset_init_value)
|
||||
padapter->HalFunc.sreset_init_value(padapter);
|
||||
padapter->HalFunc.sreset_init_value(padapter);
|
||||
}
|
||||
void rtw_hal_sreset_reset(struct adapter *padapter)
|
||||
{
|
||||
|
@ -516,7 +516,7 @@ void rtw_hal_sreset_xmit_status_check(struct adapter *padapter)
|
|||
return;
|
||||
|
||||
if(padapter->HalFunc.sreset_xmit_status_check)
|
||||
padapter->HalFunc.sreset_xmit_status_check(padapter);
|
||||
padapter->HalFunc.sreset_xmit_status_check(padapter);
|
||||
}
|
||||
void rtw_hal_sreset_linked_status_check(struct adapter *padapter)
|
||||
{
|
||||
|
@ -524,13 +524,13 @@ void rtw_hal_sreset_linked_status_check(struct adapter *padapter)
|
|||
return;
|
||||
|
||||
if(padapter->HalFunc.sreset_linked_status_check)
|
||||
padapter->HalFunc.sreset_linked_status_check(padapter);
|
||||
padapter->HalFunc.sreset_linked_status_check(padapter);
|
||||
}
|
||||
u8 rtw_hal_sreset_get_wifi_status(struct adapter *padapter)
|
||||
{
|
||||
u8 status = 0;
|
||||
if(padapter->HalFunc.sreset_get_wifi_status)
|
||||
status = padapter->HalFunc.sreset_get_wifi_status(padapter);
|
||||
if(padapter->HalFunc.sreset_get_wifi_status)
|
||||
status = padapter->HalFunc.sreset_get_wifi_status(padapter);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -567,7 +567,7 @@ s32 rtw_hal_xmit_thread_handler(struct adapter *padapter)
|
|||
void rtw_hal_notch_filter(struct adapter *adapter, bool enable)
|
||||
{
|
||||
if(adapter->HalFunc.hal_notch_filter)
|
||||
adapter->HalFunc.hal_notch_filter(adapter,enable);
|
||||
adapter->HalFunc.hal_notch_filter(adapter,enable);
|
||||
}
|
||||
|
||||
void rtw_hal_reset_security_engine(struct adapter * adapter)
|
||||
|
@ -588,4 +588,3 @@ c2h_id_filter rtw_hal_c2h_id_filter_ccx(struct adapter *adapter)
|
|||
{
|
||||
return adapter->HalFunc.c2h_id_filter_ccx;
|
||||
}
|
||||
|
||||
|
|
2395
hal/odm_HWConfig.c
2395
hal/odm_HWConfig.c
File diff suppressed because it is too large
Load diff
2579
hal/odm_RTL8188E.c
2579
hal/odm_RTL8188E.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.
|
||||
|
@ -20,22 +20,22 @@
|
|||
|
||||
#include "odm_precomp.h"
|
||||
|
||||
#if (RTL8188E_SUPPORT == 1)
|
||||
#if (RTL8188E_SUPPORT == 1)
|
||||
|
||||
void
|
||||
odm_ConfigRFReg_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data,
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data,
|
||||
IN ODM_RF_RADIO_PATH_E RF_PATH,
|
||||
IN u4Byte RegAddr
|
||||
)
|
||||
{
|
||||
if(Addr == 0xffe)
|
||||
{
|
||||
{
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
ODM_sleep_ms(50);
|
||||
#else
|
||||
#else
|
||||
ODM_delay_ms(50);
|
||||
#endif
|
||||
}
|
||||
|
@ -64,15 +64,15 @@ odm_ConfigRFReg_8188E(
|
|||
ODM_SetRFReg(pDM_Odm, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
|
||||
// Add 1us delay between BB/RF register setting.
|
||||
ODM_delay_us(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
odm_ConfigRF_RadioA_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
u4Byte content = 0x1000; // RF_Content: radioa_txt
|
||||
|
@ -83,60 +83,60 @@ odm_ConfigRF_RadioA_8188E(
|
|||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
odm_ConfigRF_RadioB_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
u4Byte content = 0x1001; // RF_Content: radiob_txt
|
||||
u4Byte maskforPhySet= (u4Byte)(content&0xE000);
|
||||
|
||||
odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, ODM_RF_PATH_B, Addr|maskforPhySet);
|
||||
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioB] %08X %08X\n", Addr, Data));
|
||||
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
odm_ConfigMAC_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u1Byte Data
|
||||
)
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u1Byte Data
|
||||
)
|
||||
{
|
||||
ODM_Write1Byte(pDM_Odm, Addr, Data);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
odm_ConfigBB_AGC_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
// Add 1us delay between BB/RF register setting.
|
||||
ODM_delay_us(1);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
odm_ConfigBB_PHY_REG_PG_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
{
|
||||
if (Addr == 0xfe){
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
ODM_sleep_ms(50);
|
||||
#else
|
||||
#else
|
||||
ODM_delay_ms(50);
|
||||
#endif
|
||||
}
|
||||
|
@ -165,18 +165,18 @@ odm_ConfigBB_PHY_REG_PG_8188E(
|
|||
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
odm_ConfigBB_PHY_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
{
|
||||
if (Addr == 0xfe){
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
ODM_sleep_ms(50);
|
||||
#else
|
||||
#else
|
||||
ODM_delay_ms(50);
|
||||
#endif
|
||||
}
|
||||
|
@ -197,13 +197,12 @@ odm_ConfigBB_PHY_8188E(
|
|||
}
|
||||
else{
|
||||
if (Addr == 0xa24)
|
||||
pDM_Odm->RFCalibrateInfo.RegA24 = Data;
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.RegA24 = Data;
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
|
||||
// Add 1us delay between BB/RF register setting.
|
||||
ODM_delay_us(1);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X\n", Addr, Data));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
1253
hal/odm_debug.c
1253
hal/odm_debug.c
File diff suppressed because it is too large
Load diff
1327
hal/odm_interface.c
1327
hal/odm_interface.c
File diff suppressed because it is too large
Load diff
2986
hal/rtl8188e_cmd.c
2986
hal/rtl8188e_cmd.c
File diff suppressed because it is too large
Load diff
1293
hal/rtl8188e_dm.c
1293
hal/rtl8188e_dm.c
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -48,7 +48,7 @@ static void process_rssi(struct adapter *padapter,union recv_frame *prframe)
|
|||
//DBG_8192C("process_rssi=> pattrib->rssil(%d) signal_strength(%d)\n ",pattrib->RecvSignalPower,pattrib->signal_strength);
|
||||
//if(pRfd->Status.bPacketToSelf || pRfd->Status.bPacketBeacon)
|
||||
{
|
||||
|
||||
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
if(signal_stat->update_req) {
|
||||
signal_stat->total_num = 0;
|
||||
|
@ -58,9 +58,9 @@ static void process_rssi(struct adapter *padapter,union recv_frame *prframe)
|
|||
|
||||
signal_stat->total_num++;
|
||||
signal_stat->total_val += pattrib->phy_info.SignalStrength;
|
||||
signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num;
|
||||
signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num;
|
||||
#else //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
|
||||
|
||||
//Adapter->RxStats.RssiCalculateCnt++; //For antenna Test
|
||||
if(padapter->recvpriv.signal_strength_data.total_num++ >= PHY_RSSI_SLID_WIN_MAX)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ static void process_rssi(struct adapter *padapter,union recv_frame *prframe)
|
|||
|
||||
|
||||
tmp_val = padapter->recvpriv.signal_strength_data.total_val/padapter->recvpriv.signal_strength_data.total_num;
|
||||
|
||||
|
||||
if(padapter->recvpriv.is_signal_dbg) {
|
||||
padapter->recvpriv.signal_strength= padapter->recvpriv.signal_strength_dbg;
|
||||
padapter->recvpriv.rssi=(s8)translate2dbm((u8)padapter->recvpriv.signal_strength_dbg);
|
||||
|
@ -96,7 +96,7 @@ static void process_rssi(struct adapter *padapter,union recv_frame *prframe)
|
|||
static void process_link_qual(struct adapter *padapter,union recv_frame *prframe)
|
||||
{
|
||||
u32 last_evm=0, tmpVal;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
struct signal_stat * signal_stat;
|
||||
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
|
@ -122,7 +122,7 @@ static void process_link_qual(struct adapter *padapter,union recv_frame *prframe
|
|||
signal_stat->total_num++;
|
||||
signal_stat->total_val += pattrib->phy_info.SignalQuality;
|
||||
signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num;
|
||||
|
||||
|
||||
#else //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
if(pattrib->phy_info.SignalQuality != 0)
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ void rtl8188e_process_phy_info(struct adapter *padapter, void *prframe)
|
|||
//
|
||||
// Check PWDB.
|
||||
//
|
||||
//process_PWDB(padapter, precvframe);
|
||||
//process_PWDB(padapter, precvframe);
|
||||
|
||||
//UpdateRxSignalStatistics8192C(Adapter, pRfd);
|
||||
//
|
||||
|
@ -202,17 +202,17 @@ void update_recvframe_attrib_88e(
|
|||
pattrib = &precvframe->u.hdr.attrib;
|
||||
_rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib));
|
||||
|
||||
pattrib->crc_err = (u8)((report.rxdw0 >> 14) & 0x1);;//(u8)prxreport->crc32;
|
||||
|
||||
pattrib->crc_err = (u8)((report.rxdw0 >> 14) & 0x1);;//(u8)prxreport->crc32;
|
||||
|
||||
// update rx report to recv_frame attribute
|
||||
pattrib->pkt_rpt_type = (u8)((report.rxdw3 >> 14) & 0x3);//prxreport->rpt_sel;
|
||||
|
||||
if(pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
|
||||
|
||||
if(pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
|
||||
{
|
||||
pattrib->pkt_len = (u16)(report.rxdw0 &0x00003fff);//(u16)prxreport->pktlen;
|
||||
pattrib->drvinfo_sz = (u8)((report.rxdw0 >> 16) & 0xf) * 8;//(u8)(prxreport->drvinfosize << 3);
|
||||
|
||||
pattrib->physt = (u8)((report.rxdw0 >> 26) & 0x1);//(u8)prxreport->physt;
|
||||
|
||||
pattrib->physt = (u8)((report.rxdw0 >> 26) & 0x1);//(u8)prxreport->physt;
|
||||
|
||||
pattrib->bdecrypted = (report.rxdw0 & BIT(27))? 0:1;//(u8)(prxreport->swdec ? 0 : 1);
|
||||
pattrib->encrypt = (u8)((report.rxdw0 >> 20) & 0x7);//(u8)prxreport->security;
|
||||
|
@ -229,10 +229,10 @@ void update_recvframe_attrib_88e(
|
|||
|
||||
pattrib->mcs_rate = (u8)(report.rxdw3 & 0x3f);//(u8)prxreport->rxmcs;
|
||||
pattrib->rxht = (u8)((report.rxdw3 >> 6) & 0x1);//(u8)prxreport->rxht;
|
||||
|
||||
|
||||
pattrib->icv_err = (u8)((report.rxdw0 >> 15) & 0x1);//(u8)prxreport->icverr;
|
||||
pattrib->shift_sz = (u8)((report.rxdw0 >> 24) & 0x3);
|
||||
|
||||
|
||||
}
|
||||
else if(pattrib->pkt_rpt_type == TX_REPORT1)//CCX
|
||||
{
|
||||
|
@ -249,13 +249,13 @@ void update_recvframe_attrib_88e(
|
|||
//
|
||||
pattrib->MacIDValidEntry[0] = report.rxdw4;
|
||||
pattrib->MacIDValidEntry[1] = report.rxdw5;
|
||||
|
||||
|
||||
}
|
||||
else if(pattrib->pkt_rpt_type == HIS_REPORT)// USB HISR RPT
|
||||
{
|
||||
pattrib->pkt_len = (u16)(report.rxdw0 &0x00003fff);//(u16)prxreport->pktlen;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -269,19 +269,19 @@ void update_recvframe_phyinfo_88e(
|
|||
{
|
||||
struct adapter * padapter = precvframe->u.hdr.adapter;
|
||||
struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
PODM_PHY_INFO_T pPHYInfo = (PODM_PHY_INFO_T)(&pattrib->phy_info);
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
PODM_PHY_INFO_T pPHYInfo = (PODM_PHY_INFO_T)(&pattrib->phy_info);
|
||||
u8 *wlanhdr;
|
||||
ODM_PACKET_INFO_T pkt_info;
|
||||
u8 *sa;
|
||||
struct sta_priv *pstapriv;
|
||||
struct sta_info *psta;
|
||||
//_irqL irqL;
|
||||
|
||||
|
||||
pkt_info.bPacketMatchBSSID =_FALSE;
|
||||
pkt_info.bPacketToSelf = _FALSE;
|
||||
pkt_info.bPacketBeacon = _FALSE;
|
||||
|
||||
|
||||
wlanhdr = get_recvframe_data(precvframe);
|
||||
|
||||
pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) &&
|
||||
|
@ -293,12 +293,12 @@ void update_recvframe_phyinfo_88e(
|
|||
pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && (GetFrameSubType(wlanhdr) == WIFI_BEACON);
|
||||
|
||||
if(pkt_info.bPacketBeacon){
|
||||
if(check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE) == _TRUE){
|
||||
if(check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE) == _TRUE){
|
||||
sa = padapter->mlmepriv.cur_network.network.MacAddress;
|
||||
#if 0
|
||||
{
|
||||
{
|
||||
DBG_8192C("==> rx beacon from AP[%02x:%02x:%02x:%02x:%02x:%02x]\n",
|
||||
sa[0],sa[1],sa[2],sa[3],sa[4],sa[5]);
|
||||
sa[0],sa[1],sa[2],sa[3],sa[4],sa[5]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -307,44 +307,43 @@ void update_recvframe_phyinfo_88e(
|
|||
}
|
||||
else{
|
||||
sa = get_sa(wlanhdr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pstapriv = &padapter->stapriv;
|
||||
pkt_info.StationID = 0xFF;
|
||||
psta = rtw_get_stainfo(pstapriv, sa);
|
||||
if (psta)
|
||||
{
|
||||
pkt_info.StationID = psta->mac_id;
|
||||
pkt_info.StationID = psta->mac_id;
|
||||
//DBG_8192C("%s ==> StationID(%d)\n",__FUNCTION__,pkt_info.StationID);
|
||||
}
|
||||
pkt_info.Rate = pattrib->mcs_rate;
|
||||
}
|
||||
pkt_info.Rate = pattrib->mcs_rate;
|
||||
//rtl8188e_query_rx_phy_status(precvframe, pphy_status);
|
||||
|
||||
//_enter_critical_bh(&pHalData->odm_stainfo_lock, &irqL);
|
||||
//_enter_critical_bh(&pHalData->odm_stainfo_lock, &irqL);
|
||||
ODM_PhyStatusQuery(&pHalData->odmpriv,pPHYInfo,(u8 *)pphy_status,&(pkt_info));
|
||||
//_exit_critical_bh(&pHalData->odm_stainfo_lock, &irqL);
|
||||
|
||||
precvframe->u.hdr.psta = NULL;
|
||||
if (pkt_info.bPacketMatchBSSID &&
|
||||
(check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == _TRUE))
|
||||
{
|
||||
{
|
||||
if (psta)
|
||||
{
|
||||
{
|
||||
precvframe->u.hdr.psta = psta;
|
||||
rtl8188e_process_phy_info(padapter, precvframe);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (pkt_info.bPacketToSelf || pkt_info.bPacketBeacon)
|
||||
{
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == _TRUE)
|
||||
{
|
||||
{
|
||||
if (psta)
|
||||
{
|
||||
{
|
||||
precvframe->u.hdr.psta = psta;
|
||||
}
|
||||
}
|
||||
rtl8188e_process_phy_info(padapter, precvframe);
|
||||
rtl8188e_process_phy_info(padapter, precvframe);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,125 +1,124 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTL8188E_SRESET_C_
|
||||
|
||||
#include <rtl8188e_sreset.h>
|
||||
#include <rtl8188e_hal.h>
|
||||
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
|
||||
void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
unsigned long current_time;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
unsigned int diff_time;
|
||||
u32 txdma_status;
|
||||
|
||||
if( (txdma_status=rtw_read32(padapter, REG_TXDMA_STATUS)) !=0x00){
|
||||
DBG_871X("%s REG_TXDMA_STATUS:0x%08x\n", __FUNCTION__, txdma_status);
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
}
|
||||
#ifdef CONFIG_USB_HCI
|
||||
//total xmit irp = 4
|
||||
//DBG_8192C("==>%s free_xmitbuf_cnt(%d),txirp_cnt(%d)\n",__FUNCTION__,pxmitpriv->free_xmitbuf_cnt,pxmitpriv->txirp_cnt);
|
||||
//if(pxmitpriv->txirp_cnt == NR_XMITBUFF+1)
|
||||
current_time = rtw_get_current_time();
|
||||
|
||||
if(0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) {
|
||||
|
||||
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_time);
|
||||
|
||||
if (diff_time > 2000) {
|
||||
if (psrtpriv->last_tx_complete_time == 0) {
|
||||
psrtpriv->last_tx_complete_time = current_time;
|
||||
}
|
||||
else{
|
||||
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_complete_time);
|
||||
if (diff_time > 4000) {
|
||||
u32 ability;
|
||||
|
||||
//padapter->Wifi_Error_Status = WIFI_TX_HANG;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DM_FUNC, &ability);
|
||||
|
||||
DBG_871X("%s tx hang %s\n", __FUNCTION__,
|
||||
(ability & ODM_BB_ADAPTIVITY)? "ODM_BB_ADAPTIVITY" : "");
|
||||
|
||||
if (!(ability & ODM_BB_ADAPTIVITY))
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //CONFIG_USB_HCI
|
||||
|
||||
if (psrtpriv->dbg_trigger_point == SRESET_TGP_XMIT_STATUS) {
|
||||
psrtpriv->dbg_trigger_point = SRESET_TGP_NULL;
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
u32 rx_dma_status = 0;
|
||||
u8 fw_status=0;
|
||||
rx_dma_status = rtw_read32(padapter,REG_RXDMA_STATUS);
|
||||
if(rx_dma_status!= 0x00){
|
||||
DBG_8192C("%s REG_RXDMA_STATUS:0x%08x \n",__FUNCTION__,rx_dma_status);
|
||||
rtw_write32(padapter,REG_RXDMA_STATUS,rx_dma_status);
|
||||
}
|
||||
fw_status = rtw_read8(padapter,REG_FMETHR);
|
||||
if(fw_status != 0x00)
|
||||
{
|
||||
if(fw_status == 1)
|
||||
DBG_8192C("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !! \n",__FUNCTION__,fw_status);
|
||||
else if(fw_status == 2)
|
||||
DBG_8192C("%s REG_FW_STATUS (0x%02x), Condition_No_Match !! \n",__FUNCTION__,fw_status);
|
||||
}
|
||||
#if 0
|
||||
u32 regc50,regc58,reg824,reg800;
|
||||
regc50 = rtw_read32(padapter,0xc50);
|
||||
regc58 = rtw_read32(padapter,0xc58);
|
||||
reg824 = rtw_read32(padapter,0x824);
|
||||
reg800 = rtw_read32(padapter,0x800);
|
||||
if( ((regc50&0xFFFFFF00)!= 0x69543400)||
|
||||
((regc58&0xFFFFFF00)!= 0x69543400)||
|
||||
(((reg824&0xFFFFFF00)!= 0x00390000)&&(((reg824&0xFFFFFF00)!= 0x80390000)))||
|
||||
( ((reg800&0xFFFFFF00)!= 0x03040000)&&((reg800&0xFFFFFF00)!= 0x83040000)))
|
||||
{
|
||||
DBG_8192C("%s regc50:0x%08x, regc58:0x%08x, reg824:0x%08x, reg800:0x%08x,\n", __FUNCTION__,
|
||||
regc50, regc58, reg824, reg800);
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (psrtpriv->dbg_trigger_point == SRESET_TGP_LINK_STATUS) {
|
||||
psrtpriv->dbg_trigger_point = SRESET_TGP_NULL;
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTL8188E_SRESET_C_
|
||||
|
||||
#include <rtl8188e_sreset.h>
|
||||
#include <rtl8188e_hal.h>
|
||||
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
|
||||
void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
unsigned long current_time;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
unsigned int diff_time;
|
||||
u32 txdma_status;
|
||||
|
||||
if( (txdma_status=rtw_read32(padapter, REG_TXDMA_STATUS)) !=0x00){
|
||||
DBG_871X("%s REG_TXDMA_STATUS:0x%08x\n", __FUNCTION__, txdma_status);
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
}
|
||||
#ifdef CONFIG_USB_HCI
|
||||
//total xmit irp = 4
|
||||
//DBG_8192C("==>%s free_xmitbuf_cnt(%d),txirp_cnt(%d)\n",__FUNCTION__,pxmitpriv->free_xmitbuf_cnt,pxmitpriv->txirp_cnt);
|
||||
//if(pxmitpriv->txirp_cnt == NR_XMITBUFF+1)
|
||||
current_time = rtw_get_current_time();
|
||||
|
||||
if(0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) {
|
||||
|
||||
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_time);
|
||||
|
||||
if (diff_time > 2000) {
|
||||
if (psrtpriv->last_tx_complete_time == 0) {
|
||||
psrtpriv->last_tx_complete_time = current_time;
|
||||
}
|
||||
else{
|
||||
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_complete_time);
|
||||
if (diff_time > 4000) {
|
||||
u32 ability;
|
||||
|
||||
//padapter->Wifi_Error_Status = WIFI_TX_HANG;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DM_FUNC, &ability);
|
||||
|
||||
DBG_871X("%s tx hang %s\n", __FUNCTION__,
|
||||
(ability & ODM_BB_ADAPTIVITY)? "ODM_BB_ADAPTIVITY" : "");
|
||||
|
||||
if (!(ability & ODM_BB_ADAPTIVITY))
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //CONFIG_USB_HCI
|
||||
|
||||
if (psrtpriv->dbg_trigger_point == SRESET_TGP_XMIT_STATUS) {
|
||||
psrtpriv->dbg_trigger_point = SRESET_TGP_NULL;
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
u32 rx_dma_status = 0;
|
||||
u8 fw_status=0;
|
||||
rx_dma_status = rtw_read32(padapter,REG_RXDMA_STATUS);
|
||||
if(rx_dma_status!= 0x00){
|
||||
DBG_8192C("%s REG_RXDMA_STATUS:0x%08x \n",__FUNCTION__,rx_dma_status);
|
||||
rtw_write32(padapter,REG_RXDMA_STATUS,rx_dma_status);
|
||||
}
|
||||
fw_status = rtw_read8(padapter,REG_FMETHR);
|
||||
if(fw_status != 0x00)
|
||||
{
|
||||
if(fw_status == 1)
|
||||
DBG_8192C("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !! \n",__FUNCTION__,fw_status);
|
||||
else if(fw_status == 2)
|
||||
DBG_8192C("%s REG_FW_STATUS (0x%02x), Condition_No_Match !! \n",__FUNCTION__,fw_status);
|
||||
}
|
||||
#if 0
|
||||
u32 regc50,regc58,reg824,reg800;
|
||||
regc50 = rtw_read32(padapter,0xc50);
|
||||
regc58 = rtw_read32(padapter,0xc58);
|
||||
reg824 = rtw_read32(padapter,0x824);
|
||||
reg800 = rtw_read32(padapter,0x800);
|
||||
if( ((regc50&0xFFFFFF00)!= 0x69543400)||
|
||||
((regc58&0xFFFFFF00)!= 0x69543400)||
|
||||
(((reg824&0xFFFFFF00)!= 0x00390000)&&(((reg824&0xFFFFFF00)!= 0x80390000)))||
|
||||
( ((reg800&0xFFFFFF00)!= 0x03040000)&&((reg800&0xFFFFFF00)!= 0x83040000)))
|
||||
{
|
||||
DBG_8192C("%s regc50:0x%08x, regc58:0x%08x, reg824:0x%08x, reg800:0x%08x,\n", __FUNCTION__,
|
||||
regc50, regc58, reg824, reg800);
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (psrtpriv->dbg_trigger_point == SRESET_TGP_LINK_STATUS) {
|
||||
psrtpriv->dbg_trigger_point = SRESET_TGP_NULL;
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,7 @@ void dump_txrpt_ccx_88e(void *buf)
|
|||
, __func__
|
||||
, txrpt_ccx->tag1, txrpt_ccx->pkt_num, txrpt_ccx->txdma_underflow, txrpt_ccx->int_bt, txrpt_ccx->int_tri, txrpt_ccx->int_ccx
|
||||
, txrpt_ccx->mac_id, txrpt_ccx->pkt_ok, txrpt_ccx->bmc
|
||||
, txrpt_ccx->retry_cnt, txrpt_ccx->lifetime_over, txrpt_ccx->retry_over
|
||||
, txrpt_ccx->retry_cnt, txrpt_ccx->lifetime_over, txrpt_ccx->retry_over
|
||||
, txrpt_ccx_qtime_88e(txrpt_ccx)
|
||||
, txrpt_ccx->final_data_rate
|
||||
, txrpt_ccx->qsel, txrpt_ccx_sw_88e(txrpt_ccx)
|
||||
|
@ -71,16 +71,16 @@ void _dbg_dump_tx_info(struct adapter *padapter,int frame_tag,struct tx_desc *pt
|
|||
|
||||
if(bDumpTxPkt ==1){//dump txdesc for data frame
|
||||
DBG_871X("dump tx_desc for data frame\n");
|
||||
if((frame_tag&0x0f) == DATA_FRAMETAG){
|
||||
bDumpTxDesc = _TRUE;
|
||||
if((frame_tag&0x0f) == DATA_FRAMETAG){
|
||||
bDumpTxDesc = _TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(bDumpTxPkt ==2){//dump txdesc for mgnt frame
|
||||
DBG_871X("dump tx_desc for mgnt frame\n");
|
||||
if((frame_tag&0x0f) == MGNT_FRAMETAG){
|
||||
bDumpTxDesc = _TRUE;
|
||||
if((frame_tag&0x0f) == MGNT_FRAMETAG){
|
||||
bDumpTxDesc = _TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(bDumpTxPkt ==3){//dump early info
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ void _dbg_dump_tx_info(struct adapter *padapter,int frame_tag,struct tx_desc *pt
|
|||
|
||||
//#define DBG_EMINFO
|
||||
|
||||
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
|
||||
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
|
||||
#define EARLY_MODE_MAX_PKT_NUM 10
|
||||
#else
|
||||
#define EARLY_MODE_MAX_PKT_NUM 5
|
||||
|
@ -122,7 +122,7 @@ void _dbg_dump_tx_info(struct adapter *padapter,int frame_tag,struct tx_desc *pt
|
|||
|
||||
|
||||
struct EMInfo{
|
||||
u8 EMPktNum;
|
||||
u8 EMPktNum;
|
||||
u16 EMPktLen[EARLY_MODE_MAX_PKT_NUM];
|
||||
};
|
||||
|
||||
|
@ -152,7 +152,7 @@ InsertEMContent_8188E(
|
|||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
|
||||
SET_EARLYMODE_PKTNUM(VirtualAddress, pEMInfo->EMPktNum);
|
||||
|
||||
|
@ -197,7 +197,7 @@ InsertEMContent_8188E(
|
|||
dwtmp += pEMInfo->EMPktLen[9];
|
||||
}
|
||||
SET_EARLYMODE_LEN4(VirtualAddress, dwtmp);
|
||||
#else
|
||||
#else
|
||||
SET_EARLYMODE_PKTNUM(VirtualAddress, pEMInfo->EMPktNum);
|
||||
SET_EARLYMODE_LEN0(VirtualAddress, pEMInfo->EMPktLen[0]);
|
||||
SET_EARLYMODE_LEN1(VirtualAddress, pEMInfo->EMPktLen[1]);
|
||||
|
@ -205,7 +205,7 @@ InsertEMContent_8188E(
|
|||
SET_EARLYMODE_LEN2_2(VirtualAddress, pEMInfo->EMPktLen[2]>>4);
|
||||
SET_EARLYMODE_LEN3(VirtualAddress, pEMInfo->EMPktLen[3]);
|
||||
SET_EARLYMODE_LEN4(VirtualAddress, pEMInfo->EMPktLen[4]);
|
||||
#endif
|
||||
#endif
|
||||
//RT_PRINT_DATA(COMP_SEND, DBG_LOUD, "EMHdr:", VirtualAddress, 8);
|
||||
|
||||
}
|
||||
|
@ -218,34 +218,34 @@ void UpdateEarlyModeInfo8188E(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmit
|
|||
int index,j;
|
||||
u16 offset,pktlen;
|
||||
PTXDESC ptxdesc;
|
||||
|
||||
|
||||
u8 *pmem,*pEMInfo_mem;
|
||||
s8 node_num_0=0,node_num_1=0;
|
||||
struct EMInfo eminfo;
|
||||
struct agg_pkt_info *paggpkt;
|
||||
struct xmit_frame *pframe = (struct xmit_frame*)pxmitbuf->priv_data;
|
||||
pmem= pframe->buf_addr;
|
||||
|
||||
#ifdef DBG_EMINFO
|
||||
struct xmit_frame *pframe = (struct xmit_frame*)pxmitbuf->priv_data;
|
||||
pmem= pframe->buf_addr;
|
||||
|
||||
#ifdef DBG_EMINFO
|
||||
DBG_8192C("\n%s ==> agg_num:%d\n",__FUNCTION__, pframe->agg_num);
|
||||
for(index=0;index<pframe->agg_num;index++){
|
||||
offset = pxmitpriv->agg_pkt[index].offset;
|
||||
offset = pxmitpriv->agg_pkt[index].offset;
|
||||
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
|
||||
DBG_8192C("%s ==> agg_pkt[%d].offset=%d\n",__FUNCTION__,index,offset);
|
||||
DBG_8192C("%s ==> agg_pkt[%d].pkt_len=%d\n",__FUNCTION__,index,pktlen);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM)
|
||||
{
|
||||
{
|
||||
node_num_0 = pframe->agg_num;
|
||||
node_num_1= EARLY_MODE_MAX_PKT_NUM-1;
|
||||
}
|
||||
|
||||
|
||||
for(index=0;index<pframe->agg_num;index++){
|
||||
|
||||
offset = pxmitpriv->agg_pkt[index].offset;
|
||||
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
|
||||
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
|
||||
|
||||
_rtw_memset(&eminfo,0,sizeof(struct EMInfo));
|
||||
if( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM){
|
||||
|
@ -255,38 +255,36 @@ void UpdateEarlyModeInfo8188E(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmit
|
|||
}
|
||||
else{
|
||||
eminfo.EMPktNum = node_num_1;
|
||||
node_num_1--;
|
||||
}
|
||||
node_num_1--;
|
||||
}
|
||||
}
|
||||
else{
|
||||
eminfo.EMPktNum = pframe->agg_num-(index+1);
|
||||
}
|
||||
eminfo.EMPktNum = pframe->agg_num-(index+1);
|
||||
}
|
||||
for(j=0;j< eminfo.EMPktNum ;j++){
|
||||
eminfo.EMPktLen[j] = pxmitpriv->agg_pkt[index+1+j].pkt_len+4;// 4 bytes CRC
|
||||
}
|
||||
|
||||
|
||||
if(pmem){
|
||||
if(index==0){
|
||||
ptxdesc = (PTXDESC)(pmem);
|
||||
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
|
||||
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
|
||||
}
|
||||
else{
|
||||
pmem = pmem + pxmitpriv->agg_pkt[index-1].offset;
|
||||
ptxdesc = (PTXDESC)(pmem);
|
||||
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
|
||||
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
|
||||
}
|
||||
|
||||
|
||||
#ifdef DBG_EMINFO
|
||||
DBG_8192C("%s ==> desc.pkt_len=%d\n",__FUNCTION__,ptxdesc->pktlen);
|
||||
#endif
|
||||
InsertEMContent_8188E(&eminfo,pEMInfo_mem);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
_rtw_memset(pxmitpriv->agg_pkt,0,sizeof(struct agg_pkt_info)*MAX_AGG_PKT_NUM);
|
||||
|
||||
}
|
||||
#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.
|
||||
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
//================================================================================
|
||||
// LED_819xUsb routines.
|
||||
// LED_819xUsb routines.
|
||||
//================================================================================
|
||||
|
||||
//
|
||||
|
@ -43,7 +43,7 @@
|
|||
//
|
||||
void
|
||||
SwLedOn(
|
||||
struct adapter *padapter,
|
||||
struct adapter *padapter,
|
||||
PLED_871x pLed
|
||||
)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ SwLedOn(
|
|||
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
|
||||
switch(pLed->LedPin)
|
||||
{
|
||||
{
|
||||
case LED_PIN_LED0:
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); // SW control led0 on.
|
||||
break;
|
||||
|
@ -69,7 +69,7 @@ SwLedOn(
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
pLed->bLedOn = _TRUE;
|
||||
}
|
||||
|
||||
|
@ -80,14 +80,14 @@ SwLedOn(
|
|||
//
|
||||
void
|
||||
SwLedOff(
|
||||
struct adapter *padapter,
|
||||
struct adapter *padapter,
|
||||
PLED_871x pLed
|
||||
)
|
||||
{
|
||||
u8 LedCfg;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if((padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
|
||||
if((padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
|
||||
{
|
||||
goto exit;
|
||||
}
|
||||
|
@ -100,11 +100,11 @@ SwLedOff(
|
|||
case LED_PIN_LED0:
|
||||
if(pHalData->bLedOpenDrain == _TRUE) // Open-drain arrangement for controlling the LED)
|
||||
{
|
||||
LedCfg &= 0x90; // Set to software control.
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));
|
||||
LedCfg &= 0x90; // Set to software control.
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));
|
||||
LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG);
|
||||
LedCfg &= 0xFE;
|
||||
rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
|
||||
rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ SwLedOff(
|
|||
}
|
||||
exit:
|
||||
pLed->bLedOn = _FALSE;
|
||||
|
||||
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
|
@ -167,4 +167,3 @@ rtl8188eu_DeInitSwLeds(
|
|||
DeInitLed871x( &(ledpriv->SwLed0) );
|
||||
DeInitLed871x( &(ledpriv->SwLed1) );
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
@ -58,7 +58,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
|
|||
int i, res = _SUCCESS;
|
||||
struct recv_buf *precvbuf;
|
||||
|
||||
#ifdef CONFIG_RECV_THREAD_MODE
|
||||
#ifdef CONFIG_RECV_THREAD_MODE
|
||||
_rtw_init_sema(&precvpriv->recv_sema, 0);//will be removed
|
||||
_rtw_init_sema(&precvpriv->terminate_recvthread_sema, 0);//will be removed
|
||||
#endif
|
||||
|
@ -208,5 +208,3 @@ void rtl8188eu_free_recv_priv (struct adapter *padapter)
|
|||
#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.
|
||||
|
@ -52,7 +52,7 @@ u8 urb_zero_packet_chk(struct adapter *padapter, int sz)
|
|||
u8 blnSetTxDescOffset;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
blnSetTxDescOffset = (((sz + TXDESC_SIZE) % pHalData->UsbBulkOutSize) ==0)?1:0;
|
||||
|
||||
|
||||
return blnSetTxDescOffset;
|
||||
}
|
||||
|
||||
|
@ -65,12 +65,12 @@ void rtl8188eu_cal_txdesc_chksum(struct tx_desc *ptxdesc)
|
|||
|
||||
//Clear first
|
||||
ptxdesc->txdw7 &= cpu_to_le32(0xffff0000);
|
||||
|
||||
|
||||
for(index = 0 ; index < count ; index++){
|
||||
checksum = checksum ^ le16_to_cpu(*(usPtr + index));
|
||||
}
|
||||
|
||||
ptxdesc->txdw7 |= cpu_to_le32(0x0000ffff&checksum);
|
||||
ptxdesc->txdw7 |= cpu_to_le32(0x0000ffff&checksum);
|
||||
|
||||
}
|
||||
//
|
||||
|
@ -133,15 +133,15 @@ void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxdesc)
|
|||
if ((pattrib->encrypt > 0) && !pattrib->bswenc)
|
||||
{
|
||||
switch (pattrib->encrypt)
|
||||
{
|
||||
{
|
||||
//SEC_TYPE : 0:NO_ENC,1:WEP40/TKIP,2:WAPI,3:AES
|
||||
case _WEP40_:
|
||||
case _WEP104_:
|
||||
ptxdesc->txdw1 |= cpu_to_le32((0x01<<SEC_TYPE_SHT)&0x00c00000);
|
||||
ptxdesc->txdw2 |= cpu_to_le32(0x7 << AMPDU_DENSITY_SHT);
|
||||
break;
|
||||
break;
|
||||
case _TKIP_:
|
||||
case _TKIP_WTMIC_:
|
||||
case _TKIP_WTMIC_:
|
||||
ptxdesc->txdw1 |= cpu_to_le32((0x01<<SEC_TYPE_SHT)&0x00c00000);
|
||||
ptxdesc->txdw2 |= cpu_to_le32(0x7 << AMPDU_DENSITY_SHT);
|
||||
break;
|
||||
|
@ -158,16 +158,16 @@ void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxdesc)
|
|||
case _NO_PRIVACY_:
|
||||
default:
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void fill_txdesc_vcs(struct pkt_attrib *pattrib, u32 *pdw)
|
||||
{
|
||||
//DBG_8192C("cvs_mode=%d\n", pattrib->vcs_mode);
|
||||
//DBG_8192C("cvs_mode=%d\n", pattrib->vcs_mode);
|
||||
|
||||
switch(pattrib->vcs_mode)
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ void fill_txdesc_vcs(struct pkt_attrib *pattrib, u32 *pdw)
|
|||
break;
|
||||
case NONE_VCS:
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if(pattrib->vcs_mode) {
|
||||
|
@ -211,7 +211,7 @@ void fill_txdesc_phy(struct pkt_attrib *pattrib, u32 *pdw)
|
|||
*pdw |= (pattrib->bwmode&HT_CHANNEL_WIDTH_40)? cpu_to_le32(BIT(25)):0;
|
||||
|
||||
if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
|
||||
*pdw |= cpu_to_le32((0x01<<DATA_SC_SHT)&0x003f0000);
|
||||
*pdw |= cpu_to_le32((0x01<<DATA_SC_SHT)&0x003f0000);
|
||||
else if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
|
||||
*pdw |= cpu_to_le32((0x02<<DATA_SC_SHT)&0x003f0000);
|
||||
else if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)
|
||||
|
@ -223,12 +223,12 @@ void fill_txdesc_phy(struct pkt_attrib *pattrib, u32 *pdw)
|
|||
|
||||
|
||||
static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bagg_pkt)
|
||||
{
|
||||
{
|
||||
int pull=0;
|
||||
uint qsel;
|
||||
u8 data_rate,pwr_status,offset;
|
||||
struct adapter *padapter = pxmitframe->padapter;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
//struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
|
@ -236,16 +236,16 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
|
|||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
sint bmcst = IS_MCAST(pattrib->ra);
|
||||
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info* pwdinfo = &padapter->wdinfo;
|
||||
#endif //CONFIG_P2P
|
||||
|
||||
#ifndef CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
#ifndef CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
if (padapter->registrypriv.mp_mode == 0)
|
||||
{
|
||||
if((!bagg_pkt) &&(urb_zero_packet_chk(padapter, sz)==0))//(sz %512) != 0
|
||||
//if((!bagg_pkt) &&(rtw_usb_bulk_size_boundary(padapter,TXDESC_SIZE+sz)==_FALSE))
|
||||
//if((!bagg_pkt) &&(rtw_usb_bulk_size_boundary(padapter,TXDESC_SIZE+sz)==_FALSE))
|
||||
{
|
||||
ptxdesc = (struct tx_desc *)(pmem+PACKET_OFFSET_SZ);
|
||||
//DBG_8192C("==> non-agg-pkt,shift pointer...\n");
|
||||
|
@ -255,17 +255,17 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
|
||||
_rtw_memset(ptxdesc, 0, sizeof(struct tx_desc));
|
||||
|
||||
|
||||
//4 offset 0
|
||||
ptxdesc->txdw0 |= cpu_to_le32(OWN | FSG | LSG);
|
||||
//DBG_8192C("%s==> pkt_len=%d,bagg_pkt=%02x\n",__FUNCTION__,sz,bagg_pkt);
|
||||
ptxdesc->txdw0 |= cpu_to_le32(sz & 0x0000ffff);//update TXPKTSIZE
|
||||
|
||||
offset = TXDESC_SIZE + OFFSET_SZ;
|
||||
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
if(bagg_pkt){
|
||||
offset += EARLY_MODE_INFO_SIZE ;//0x28
|
||||
offset = TXDESC_SIZE + OFFSET_SZ;
|
||||
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
if(bagg_pkt){
|
||||
offset += EARLY_MODE_INFO_SIZE ;//0x28
|
||||
}
|
||||
#endif
|
||||
//DBG_8192C("%s==>offset(0x%02x) \n",__FUNCTION__,offset);
|
||||
|
@ -277,11 +277,11 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
if (padapter->registrypriv.mp_mode == 0)
|
||||
{
|
||||
if(!bagg_pkt){
|
||||
if((pull) && (pxmitframe->pkt_offset>0)) {
|
||||
pxmitframe->pkt_offset = pxmitframe->pkt_offset -1;
|
||||
if((pull) && (pxmitframe->pkt_offset>0)) {
|
||||
pxmitframe->pkt_offset = pxmitframe->pkt_offset -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//DBG_8192C("%s, pkt_offset=0x%02x\n",__FUNCTION__,pxmitframe->pkt_offset);
|
||||
|
||||
|
@ -294,7 +294,7 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
|
||||
if((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG)
|
||||
{
|
||||
//DBG_8192C("pxmitframe->frame_tag == DATA_FRAMETAG\n");
|
||||
//DBG_8192C("pxmitframe->frame_tag == DATA_FRAMETAG\n");
|
||||
|
||||
//offset 4
|
||||
ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id&0x3F);
|
||||
|
@ -309,20 +309,20 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
|
||||
if(pattrib->ampdu_en==_TRUE){
|
||||
ptxdesc->txdw2 |= cpu_to_le32(AGG_EN);//AGG EN
|
||||
|
||||
|
||||
//SET_TX_DESC_MAX_AGG_NUM_88E(pDesc, 0x1F);
|
||||
//SET_TX_DESC_MCSG1_MAX_LEN_88E(pDesc, 0x6);
|
||||
//SET_TX_DESC_MCSG2_MAX_LEN_88E(pDesc, 0x6);
|
||||
//SET_TX_DESC_MCSG3_MAX_LEN_88E(pDesc, 0x6);
|
||||
//SET_TX_DESC_MCS7_SGI_MAX_LEN_88E(pDesc, 0x6);
|
||||
ptxdesc->txdw6 = 0x6666f800;
|
||||
ptxdesc->txdw6 = 0x6666f800;
|
||||
}
|
||||
else{
|
||||
ptxdesc->txdw2 |= cpu_to_le32(AGG_BK);//AGG BK
|
||||
}
|
||||
|
||||
|
||||
//offset 8
|
||||
|
||||
|
||||
|
||||
//offset 12
|
||||
ptxdesc->txdw3 |= cpu_to_le32((pattrib->seqnum<< SEQ_SHT)&0x0FFF0000);
|
||||
|
@ -346,49 +346,49 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
(pattrib->dhcp_pkt != 1))
|
||||
{
|
||||
//Non EAP & ARP & DHCP type data packet
|
||||
|
||||
|
||||
fill_txdesc_vcs(pattrib, &ptxdesc->txdw4);
|
||||
fill_txdesc_phy(pattrib, &ptxdesc->txdw4);
|
||||
|
||||
ptxdesc->txdw4 |= cpu_to_le32(0x00000008);//RTS Rate=24M
|
||||
ptxdesc->txdw5 |= cpu_to_le32(0x0001ff00);//DATA/RTS Rate FB LMT
|
||||
ptxdesc->txdw5 |= cpu_to_le32(0x0001ff00);//DATA/RTS Rate FB LMT
|
||||
|
||||
#if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
#if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
if(pattrib->ht_en){
|
||||
if( ODM_RA_GetShortGI_8188E(&pHalData->odmpriv,pattrib->mac_id))
|
||||
ptxdesc->txdw5 |= cpu_to_le32(SGI);//SGI
|
||||
}
|
||||
|
||||
data_rate =ODM_RA_GetDecisionRate_8188E(&pHalData->odmpriv,pattrib->mac_id);
|
||||
|
||||
data_rate =ODM_RA_GetDecisionRate_8188E(&pHalData->odmpriv,pattrib->mac_id);
|
||||
//for debug
|
||||
#if 1
|
||||
#if 1
|
||||
if(padapter->fix_rate!= 0xFF){
|
||||
|
||||
|
||||
data_rate = padapter->fix_rate;
|
||||
ptxdesc->txdw4 |= cpu_to_le32(DISDATAFB);
|
||||
//printk("==> fix data_rate:0x%02x\n",data_rate);
|
||||
}
|
||||
#endif
|
||||
|
||||
ptxdesc->txdw5 |= cpu_to_le32(data_rate & 0x3F);
|
||||
|
||||
ptxdesc->txdw5 |= cpu_to_le32(data_rate & 0x3F);
|
||||
|
||||
#if (POWER_TRAINING_ACTIVE==1)
|
||||
pwr_status = ODM_RA_GetHwPwrStatus_8188E(&pHalData->odmpriv,pattrib->mac_id);
|
||||
ptxdesc->txdw4 |=cpu_to_le32( (pwr_status & 0x7)<< PWR_STATUS_SHT);
|
||||
#endif //(POWER_TRAINING_ACTIVE==1)
|
||||
#else//if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
|
||||
#else//if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
|
||||
if(pattrib->ht_en)
|
||||
ptxdesc->txdw5 |= cpu_to_le32(SGI);//SGI
|
||||
|
||||
data_rate = 0x13; //default rate: MCS7
|
||||
data_rate = 0x13; //default rate: MCS7
|
||||
if(padapter->fix_rate!= 0xFF){//rate control by iwpriv
|
||||
data_rate = padapter->fix_rate;
|
||||
data_rate = padapter->fix_rate;
|
||||
ptxdesc->txdw4 | cpu_to_le32(DISDATAFB);
|
||||
}
|
||||
ptxdesc->txdw5 |= cpu_to_le32(data_rate & 0x3F);
|
||||
ptxdesc->txdw5 |= cpu_to_le32(data_rate & 0x3F);
|
||||
|
||||
#endif//if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
#endif//if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -397,7 +397,7 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
// Use the 1M data rate to send the EAP/ARP packet.
|
||||
// This will maybe make the handshake smooth.
|
||||
|
||||
ptxdesc->txdw2 |= cpu_to_le32(AGG_BK);//AGG BK
|
||||
ptxdesc->txdw2 |= cpu_to_le32(AGG_BK);//AGG BK
|
||||
|
||||
if (pmlmeinfo->preamble_mode == PREAMBLE_SHORT)
|
||||
ptxdesc->txdw4 |= cpu_to_le32(BIT(24));// DATA_SHORT
|
||||
|
@ -417,19 +417,19 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
}
|
||||
else if((pxmitframe->frame_tag&0x0f)== MGNT_FRAMETAG)
|
||||
{
|
||||
//DBG_8192C("pxmitframe->frame_tag == MGNT_FRAMETAG\n");
|
||||
|
||||
//offset 4
|
||||
//DBG_8192C("pxmitframe->frame_tag == MGNT_FRAMETAG\n");
|
||||
|
||||
//offset 4
|
||||
ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id&0x3f);
|
||||
|
||||
|
||||
qsel = (uint)(pattrib->qsel&0x0000001f);
|
||||
ptxdesc->txdw1 |= cpu_to_le32((qsel<<QSEL_SHT)&0x00001f00);
|
||||
|
||||
ptxdesc->txdw1 |= cpu_to_le32((pattrib->raid<< RATE_ID_SHT) & 0x000f0000);
|
||||
|
||||
|
||||
//fill_txdesc_sectype(pattrib, ptxdesc);
|
||||
|
||||
//offset 8
|
||||
|
||||
//offset 8
|
||||
#ifdef CONFIG_XMIT_ACK
|
||||
//CCX-TXRPT ack for xmit mgmt frames.
|
||||
if (pxmitframe->ack_report) {
|
||||
|
@ -445,7 +445,7 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
|
||||
//offset 12
|
||||
ptxdesc->txdw3 |= cpu_to_le32((pattrib->seqnum<<SEQ_SHT)&0x0FFF0000);
|
||||
|
||||
|
||||
//offset 20
|
||||
ptxdesc->txdw5 |= cpu_to_le32(RTY_LMT_EN);//retry limit enable
|
||||
if(pattrib->retry_ctrl == _TRUE)
|
||||
|
@ -472,12 +472,12 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
{
|
||||
DBG_8192C("pxmitframe->frame_tag = %d\n", pxmitframe->frame_tag);
|
||||
|
||||
//offset 4
|
||||
//offset 4
|
||||
ptxdesc->txdw1 |= cpu_to_le32((4)&0x3f);//CAM_ID(MAC_ID)
|
||||
|
||||
ptxdesc->txdw1 |= cpu_to_le32((6<< RATE_ID_SHT) & 0x000f0000);//raid
|
||||
|
||||
//offset 8
|
||||
//offset 8
|
||||
|
||||
//offset 12
|
||||
ptxdesc->txdw3 |= cpu_to_le32((pattrib->seqnum<<SEQ_SHT)&0x0fff0000);
|
||||
|
@ -495,23 +495,23 @@ if (padapter->registrypriv.mp_mode == 0)
|
|||
// (3) Use HW Qos SEQ to control the seq num of Ext port non-Qos packets.
|
||||
// 2010.06.23. Added by tynli.
|
||||
if(!pattrib->qos_en)
|
||||
{
|
||||
{
|
||||
//ptxdesc->txdw4 |= cpu_to_le32(BIT(7)); // Hw set sequence number
|
||||
//ptxdesc->txdw3 |= cpu_to_le32((8 <<28)); //set bit3 to 1. Suugested by TimChen. 2009.12.29.
|
||||
|
||||
ptxdesc->txdw3 |= cpu_to_le32(EN_HWSEQ); // Hw set sequence number
|
||||
ptxdesc->txdw4 |= cpu_to_le32(HW_SSN); // Hw set sequence number
|
||||
|
||||
ptxdesc->txdw4 |= cpu_to_le32(HW_SSN); // Hw set sequence number
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HW_ANTENNA_DIVERSITY //CONFIG_ANTENNA_DIVERSITY
|
||||
#ifdef CONFIG_HW_ANTENNA_DIVERSITY //CONFIG_ANTENNA_DIVERSITY
|
||||
ODM_SetTxAntByTxInfo_88E(&pHalData->odmpriv, pmem, pattrib->mac_id);
|
||||
#endif
|
||||
|
||||
rtl8188eu_cal_txdesc_chksum(ptxdesc);
|
||||
_dbg_dump_tx_info(padapter,pxmitframe->frame_tag,ptxdesc);
|
||||
_dbg_dump_tx_info(padapter,pxmitframe->frame_tag,ptxdesc);
|
||||
return pull;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -606,18 +606,18 @@ static s32 rtw_dump_xframe(struct adapter *padapter, struct xmit_frame *pxmitfra
|
|||
mem_addr = pxmitframe->buf_addr;
|
||||
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_dump_xframe()\n"));
|
||||
|
||||
|
||||
for (t = 0; t < pattrib->nr_frags; t++)
|
||||
{
|
||||
if (inner_ret != _SUCCESS && ret == _SUCCESS)
|
||||
ret = _FAIL;
|
||||
|
||||
|
||||
if (t != (pattrib->nr_frags - 1))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("pattrib->nr_frags=%d\n", pattrib->nr_frags));
|
||||
|
||||
sz = pxmitpriv->frag_len;
|
||||
sz = sz - 4 - (psecuritypriv->sw_encrypt ? 0 : pattrib->icv_len);
|
||||
sz = sz - 4 - (psecuritypriv->sw_encrypt ? 0 : pattrib->icv_len);
|
||||
}
|
||||
else //no frag
|
||||
{
|
||||
|
@ -625,12 +625,12 @@ static s32 rtw_dump_xframe(struct adapter *padapter, struct xmit_frame *pxmitfra
|
|||
}
|
||||
|
||||
pull = update_txdesc(pxmitframe, mem_addr, sz, _FALSE);
|
||||
|
||||
|
||||
if(pull)
|
||||
{
|
||||
mem_addr += PACKET_OFFSET_SZ; //pull txdesc head
|
||||
|
||||
//pxmitbuf ->pbuf = mem_addr;
|
||||
|
||||
//pxmitbuf ->pbuf = mem_addr;
|
||||
pxmitframe->buf_addr = mem_addr;
|
||||
|
||||
w_sz = sz + TXDESC_SIZE;
|
||||
|
@ -638,10 +638,10 @@ static s32 rtw_dump_xframe(struct adapter *padapter, struct xmit_frame *pxmitfra
|
|||
else
|
||||
{
|
||||
w_sz = sz + TXDESC_SIZE + PACKET_OFFSET_SZ;
|
||||
}
|
||||
#ifdef CONFIG_IOL_IOREG_CFG_DBG
|
||||
}
|
||||
#ifdef CONFIG_IOL_IOREG_CFG_DBG
|
||||
rtw_IOL_cmd_buf_dump(padapter,w_sz,pxmitframe->buf_addr);
|
||||
#endif
|
||||
#endif
|
||||
ff_hwaddr = rtw_get_ff_hwaddr(pxmitframe);
|
||||
|
||||
#ifdef CONFIG_XMIT_THREAD_MODE
|
||||
|
@ -655,19 +655,19 @@ static s32 rtw_dump_xframe(struct adapter *padapter, struct xmit_frame *pxmitfra
|
|||
rtw_count_tx_stats(padapter, pxmitframe, sz);
|
||||
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_write_port, w_sz=%d\n", w_sz));
|
||||
//DBG_8192C("rtw_write_port, w_sz=%d, sz=%d, txdesc_sz=%d, tid=%d\n", w_sz, sz, w_sz-sz, pattrib->priority);
|
||||
//DBG_8192C("rtw_write_port, w_sz=%d, sz=%d, txdesc_sz=%d, tid=%d\n", w_sz, sz, w_sz-sz, pattrib->priority);
|
||||
|
||||
mem_addr += w_sz;
|
||||
|
||||
mem_addr = (u8 *)RND4(((SIZE_PTR)(mem_addr)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
||||
|
||||
if (ret != _SUCCESS)
|
||||
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_UNKNOWN);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -736,7 +736,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
//3 1. pick up first frame
|
||||
do {
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
||||
|
||||
pxmitframe = rtw_dequeue_xframe(pxmitpriv, pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
|
||||
if (pxmitframe == NULL) {
|
||||
// no more xmit frame, release xmit buffer
|
||||
|
@ -807,15 +807,15 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
//psta = pfirstframe->attrib.psta;
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, pfirstframe->attrib.ra);
|
||||
if(pfirstframe->attrib.psta != psta){
|
||||
DBG_871X("%s, pattrib->psta(%p) != psta(%p)\n", __func__, pfirstframe->attrib.psta, psta);
|
||||
DBG_871X("%s, pattrib->psta(%p) != psta(%p)\n", __func__, pfirstframe->attrib.psta, psta);
|
||||
}
|
||||
if (psta == NULL) {
|
||||
DBG_8192C("rtw_xmit_classifier: psta == NULL\n");
|
||||
if (psta == NULL) {
|
||||
DBG_8192C("rtw_xmit_classifier: psta == NULL\n");
|
||||
}
|
||||
if(!(psta->state &_FW_LINKED)){
|
||||
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
|
||||
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
|
||||
}
|
||||
|
||||
|
||||
switch (pfirstframe->attrib.priority) {
|
||||
case 1:
|
||||
case 2:
|
||||
|
@ -849,7 +849,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
|
||||
xmitframe_phead = get_list_head(&ptxservq->sta_pending);
|
||||
xmitframe_plist = get_next(xmitframe_phead);
|
||||
|
||||
|
||||
while (rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist) == _FALSE)
|
||||
{
|
||||
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
|
||||
|
@ -860,17 +860,17 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
pxmitframe->pkt_offset = 1;// not first frame of aggregation,reserve offset for EM Info
|
||||
#else
|
||||
pxmitframe->pkt_offset = 0; // not first frame of aggregation, no need to reserve offset
|
||||
#endif
|
||||
#endif
|
||||
|
||||
len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE +(pxmitframe->pkt_offset*PACKET_OFFSET_SZ);
|
||||
|
||||
|
||||
if (_RND8(pbuf + len) > MAX_XMITBUF_SZ)
|
||||
//if (_RND8(pbuf + len) > (MAX_XMITBUF_SZ/2))//to do : for TX TP finial tune , Georgia 2012-0323
|
||||
{
|
||||
//DBG_8192C("%s....len> MAX_XMITBUF_SZ\n",__FUNCTION__);
|
||||
pxmitframe->agg_num = 1;
|
||||
pxmitframe->pkt_offset = 1;
|
||||
break;
|
||||
pxmitframe->pkt_offset = 1;
|
||||
break;
|
||||
}
|
||||
rtw_list_delete(&pxmitframe->list);
|
||||
ptxservq->qcnt--;
|
||||
|
@ -899,7 +899,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
|
||||
// pxmitframe->pxmitbuf = pxmitbuf;
|
||||
pxmitframe->buf_addr = pxmitbuf->pbuf + pbuf;
|
||||
|
||||
|
||||
if (rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe) == _FALSE) {
|
||||
DBG_871X("%s coalesce failed \n",__FUNCTION__);
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
@ -912,7 +912,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
|
||||
// (len - TXDESC_SIZE) == pxmitframe->attrib.last_txcmdsz
|
||||
update_txdesc(pxmitframe, pxmitframe->buf_addr, pxmitframe->attrib.last_txcmdsz,_TRUE);
|
||||
|
||||
|
||||
// don't need xmitframe any more
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
||||
|
@ -922,9 +922,9 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
|
||||
|
||||
pfirstframe->agg_num++;
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
pxmitpriv->agg_pkt[pfirstframe->agg_num-1].offset = _RND8(len);
|
||||
pxmitpriv->agg_pkt[pfirstframe->agg_num-1].pkt_len = pxmitframe->attrib.last_txcmdsz;
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
pxmitpriv->agg_pkt[pfirstframe->agg_num-1].offset = _RND8(len);
|
||||
pxmitpriv->agg_pkt[pfirstframe->agg_num-1].pkt_len = pxmitframe->attrib.last_txcmdsz;
|
||||
#endif
|
||||
if (MAX_TX_AGG_PACKET_NUMBER == pfirstframe->agg_num)
|
||||
break;
|
||||
|
@ -965,15 +965,15 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
|
||||
update_txdesc(pfirstframe, pfirstframe->buf_addr, pfirstframe->attrib.last_txcmdsz,_TRUE);
|
||||
|
||||
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
//prepare EM info for first frame, agg_num value start from 1
|
||||
pxmitpriv->agg_pkt[0].offset = _RND8(pfirstframe->attrib.last_txcmdsz +TXDESC_SIZE +(pfirstframe->pkt_offset*PACKET_OFFSET_SZ));
|
||||
pxmitpriv->agg_pkt[0].pkt_len = pfirstframe->attrib.last_txcmdsz;//get from rtw_xmitframe_coalesce
|
||||
pxmitpriv->agg_pkt[0].pkt_len = pfirstframe->attrib.last_txcmdsz;//get from rtw_xmitframe_coalesce
|
||||
|
||||
UpdateEarlyModeInfo8188E(pxmitpriv,pxmitbuf );
|
||||
#endif
|
||||
|
||||
|
||||
//3 4. write xmit buffer to USB FIFO
|
||||
ff_hwaddr = rtw_get_ff_hwaddr(pfirstframe);
|
||||
//DBG_8192C("%s ===================================== write port,buf_size(%d) \n",__FUNCTION__,pbuf_tail);
|
||||
|
@ -984,8 +984,8 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
//3 5. update statisitc
|
||||
pbuf_tail -= (pfirstframe->agg_num * TXDESC_SIZE);
|
||||
pbuf_tail -= (pfirstframe->pkt_offset * PACKET_OFFSET_SZ);
|
||||
|
||||
|
||||
|
||||
|
||||
rtw_count_tx_stats(padapter, pfirstframe, pbuf_tail);
|
||||
|
||||
rtw_free_xmitframe(pxmitpriv, pfirstframe);
|
||||
|
@ -996,11 +996,11 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
#else
|
||||
|
||||
s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
|
||||
{
|
||||
{
|
||||
|
||||
struct hw_xmit *phwxmits;
|
||||
sint hwentry;
|
||||
struct xmit_frame *pxmitframe=NULL;
|
||||
struct xmit_frame *pxmitframe=NULL;
|
||||
int res=_SUCCESS, xcnt = 0;
|
||||
|
||||
phwxmits = pxmitpriv->hwxmits;
|
||||
|
@ -1010,65 +1010,65 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
|
||||
if(pxmitbuf==NULL)
|
||||
{
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
if(!pxmitbuf)
|
||||
{
|
||||
return _FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
{
|
||||
pxmitframe = rtw_dequeue_xframe(pxmitpriv, phwxmits, hwentry);
|
||||
|
||||
|
||||
if(pxmitframe)
|
||||
{
|
||||
pxmitframe->pxmitbuf = pxmitbuf;
|
||||
pxmitframe->pxmitbuf = pxmitbuf;
|
||||
|
||||
pxmitframe->buf_addr = pxmitbuf->pbuf;
|
||||
|
||||
pxmitbuf->priv_data = pxmitframe;
|
||||
pxmitbuf->priv_data = pxmitframe;
|
||||
|
||||
if((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG)
|
||||
{
|
||||
{
|
||||
if(pxmitframe->attrib.priority<=15)//TID0~15
|
||||
{
|
||||
res = rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
|
||||
}
|
||||
}
|
||||
//DBG_8192C("==> pxmitframe->attrib.priority:%d\n",pxmitframe->attrib.priority);
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);//always return ndis_packet after rtw_xmitframe_coalesce
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);//always return ndis_packet after rtw_xmitframe_coalesce
|
||||
}
|
||||
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("xmitframe_complete(): rtw_dump_xframe\n"));
|
||||
|
||||
|
||||
|
||||
if(res == _SUCCESS)
|
||||
{
|
||||
rtw_dump_xframe(padapter, pxmitframe);
|
||||
rtw_dump_xframe(padapter, pxmitframe);
|
||||
}
|
||||
else
|
||||
{
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
}
|
||||
|
||||
|
||||
xcnt++;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
}while(0/*xcnt < (NR_XMITFRAME >> 3)*/);
|
||||
|
||||
return _TRUE;
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1103,11 +1103,11 @@ static s32 pre_xmitframe(struct adapter *padapter, struct xmit_frame *pxmitframe
|
|||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv);
|
||||
struct mlme_priv *pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv);
|
||||
#endif
|
||||
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
//DBG_8192C("==> %s \n",__FUNCTION__);
|
||||
|
@ -1122,7 +1122,7 @@ static s32 pre_xmitframe(struct adapter *padapter, struct xmit_frame *pxmitframe
|
|||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE)
|
||||
goto enqueue;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_fwstate(pbuddy_mlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE)
|
||||
goto enqueue;
|
||||
#endif
|
||||
|
@ -1178,31 +1178,31 @@ s32 rtl8188eu_hal_xmit(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
|||
|
||||
s32 rtl8188eu_hal_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
s32 err;
|
||||
|
||||
if ((err=rtw_xmitframe_enqueue(padapter, pxmitframe)) != _SUCCESS)
|
||||
|
||||
if ((err=rtw_xmitframe_enqueue(padapter, pxmitframe)) != _SUCCESS)
|
||||
{
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
||||
// Trick, make the statistics correct
|
||||
pxmitpriv->tx_pkts--;
|
||||
pxmitpriv->tx_drop++;
|
||||
pxmitpriv->tx_drop++;
|
||||
}
|
||||
else
|
||||
{
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
}
|
||||
|
||||
|
||||
return err;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_HOSTAPD_MLME
|
||||
|
||||
static void rtl8188eu_hostap_mgnt_xmit_cb(struct urb *urb)
|
||||
{
|
||||
{
|
||||
struct sk_buff *skb = (struct sk_buff *)urb->context;
|
||||
|
||||
//DBG_8192C("%s\n", __FUNCTION__);
|
||||
|
@ -1213,23 +1213,23 @@ static void rtl8188eu_hostap_mgnt_xmit_cb(struct urb *urb)
|
|||
s32 rtl8188eu_hostap_mgnt_xmit_entry(struct adapter *padapter, _pkt *pkt)
|
||||
{
|
||||
u16 fc;
|
||||
int rc, len, pipe;
|
||||
int rc, len, pipe;
|
||||
unsigned int bmcst, tid, qsel;
|
||||
struct sk_buff *skb, *pxmit_skb;
|
||||
struct urb *urb;
|
||||
unsigned char *pxmitbuf;
|
||||
struct tx_desc *ptxdesc;
|
||||
struct rtw_ieee80211_hdr *tx_hdr;
|
||||
struct hostapd_priv *phostapdpriv = padapter->phostapdpriv;
|
||||
struct hostapd_priv *phostapdpriv = padapter->phostapdpriv;
|
||||
struct net_device *pnetdev = padapter->pnetdev;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
|
||||
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
|
||||
|
||||
|
||||
|
||||
//DBG_8192C("%s\n", __FUNCTION__);
|
||||
|
||||
skb = pkt;
|
||||
|
||||
|
||||
len = skb->len;
|
||||
tx_hdr = (struct rtw_ieee80211_hdr *)(skb->data);
|
||||
fc = le16_to_cpu(tx_hdr->frame_ctl);
|
||||
|
@ -1250,42 +1250,42 @@ s32 rtl8188eu_hostap_mgnt_xmit_entry(struct adapter *padapter, _pkt *pkt)
|
|||
goto _exit;
|
||||
}
|
||||
|
||||
// ----- fill tx desc -----
|
||||
ptxdesc = (struct tx_desc *)pxmitbuf;
|
||||
// ----- fill tx desc -----
|
||||
ptxdesc = (struct tx_desc *)pxmitbuf;
|
||||
_rtw_memset(ptxdesc, 0, sizeof(*ptxdesc));
|
||||
|
||||
//offset 0
|
||||
ptxdesc->txdw0 |= cpu_to_le32(len&0x0000ffff);
|
||||
|
||||
//offset 0
|
||||
ptxdesc->txdw0 |= cpu_to_le32(len&0x0000ffff);
|
||||
ptxdesc->txdw0 |= cpu_to_le32(((TXDESC_SIZE+OFFSET_SZ)<<OFFSET_SHT)&0x00ff0000);//default = 32 bytes for TX Desc
|
||||
ptxdesc->txdw0 |= cpu_to_le32(OWN | FSG | LSG);
|
||||
|
||||
if(bmcst)
|
||||
if(bmcst)
|
||||
{
|
||||
ptxdesc->txdw0 |= cpu_to_le32(BIT(24));
|
||||
}
|
||||
}
|
||||
|
||||
//offset 4
|
||||
//offset 4
|
||||
ptxdesc->txdw1 |= cpu_to_le32(0x00);//MAC_ID
|
||||
|
||||
ptxdesc->txdw1 |= cpu_to_le32((0x12<<QSEL_SHT)&0x00001f00);
|
||||
|
||||
ptxdesc->txdw1 |= cpu_to_le32((0x06<< 16) & 0x000f0000);//b mode
|
||||
|
||||
//offset 8
|
||||
//offset 8
|
||||
|
||||
//offset 12
|
||||
//offset 12
|
||||
ptxdesc->txdw3 |= cpu_to_le32((le16_to_cpu(tx_hdr->seq_ctl)<<16)&0xffff0000);
|
||||
|
||||
//offset 16
|
||||
//offset 16
|
||||
ptxdesc->txdw4 |= cpu_to_le32(BIT(8));//driver uses rate
|
||||
|
||||
|
||||
//offset 20
|
||||
|
||||
|
||||
//HW append seq
|
||||
ptxdesc->txdw4 |= cpu_to_le32(BIT(7)); // Hw set sequence number
|
||||
ptxdesc->txdw3 |= cpu_to_le32((8 <<28)); //set bit3 to 1. Suugested by TimChen. 2009.12.29.
|
||||
|
||||
|
||||
|
||||
rtl8188eu_cal_txdesc_chksum(ptxdesc);
|
||||
// ----- end of fill tx desc -----
|
||||
|
@ -1299,14 +1299,14 @@ s32 rtl8188eu_hostap_mgnt_xmit_entry(struct adapter *padapter, _pkt *pkt)
|
|||
|
||||
|
||||
// ----- prepare urb for submit -----
|
||||
|
||||
|
||||
//translate DMA FIFO addr to pipehandle
|
||||
//pipe = ffaddr2pipehdl(pdvobj, MGT_QUEUE_INX);
|
||||
pipe = usb_sndbulkpipe(pdvobj->pusbdev, pHalData->Queue2EPNum[(u8)MGT_QUEUE_INX]&0x0f);
|
||||
|
||||
|
||||
usb_fill_bulk_urb(urb, pdvobj->pusbdev, pipe,
|
||||
pxmit_skb->data, pxmit_skb->len, rtl8192cu_hostap_mgnt_xmit_cb, pxmit_skb);
|
||||
|
||||
|
||||
urb->transfer_flags |= URB_ZERO_PACKET;
|
||||
usb_anchor_urb(urb, &phostapdpriv->anchored);
|
||||
rc = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
|
@ -1316,12 +1316,11 @@ s32 rtl8188eu_hostap_mgnt_xmit_entry(struct adapter *padapter, _pkt *pkt)
|
|||
}
|
||||
usb_free_urb(urb);
|
||||
|
||||
|
||||
_exit:
|
||||
|
||||
|
||||
_exit:
|
||||
|
||||
rtw_skb_free(skb);
|
||||
return 0;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
1023
hal/usb_halinit.c
1023
hal/usb_halinit.c
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,429 +1,428 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __INC_HAL8188EPHYCFG_H__
|
||||
#define __INC_HAL8188EPHYCFG_H__
|
||||
|
||||
|
||||
/*--------------------------Define Parameters-------------------------------*/
|
||||
#define LOOP_LIMIT 5
|
||||
#define MAX_STALL_TIME 50 //us
|
||||
#define AntennaDiversityValue 0x80 //(Adapter->bSoftwareAntennaDiversity ? 0x00:0x80)
|
||||
#define MAX_TXPWR_IDX_NMODE_92S 63
|
||||
#define Reset_Cnt_Limit 3
|
||||
|
||||
#define IQK_MAC_REG_NUM 4
|
||||
#define IQK_ADDA_REG_NUM 16
|
||||
#define IQK_BB_REG_NUM 9
|
||||
#define HP_THERMAL_NUM 8
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
#define MAX_AGGR_NUM 0x0B
|
||||
#else
|
||||
#define MAX_AGGR_NUM 0x07
|
||||
#endif // CONFIG_PCI_HCI
|
||||
|
||||
|
||||
/*--------------------------Define Parameters-------------------------------*/
|
||||
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
typedef enum _SwChnlCmdID{
|
||||
CmdID_End,
|
||||
CmdID_SetTxPowerLevel,
|
||||
CmdID_BBRegWrite10,
|
||||
CmdID_WritePortUlong,
|
||||
CmdID_WritePortUshort,
|
||||
CmdID_WritePortUchar,
|
||||
CmdID_RF_WriteReg,
|
||||
}SwChnlCmdID;
|
||||
|
||||
|
||||
/* 1. Switch channel related */
|
||||
typedef struct _SwChnlCmd{
|
||||
SwChnlCmdID CmdID;
|
||||
u32 Para1;
|
||||
u32 Para2;
|
||||
u32 msDelay;
|
||||
}SwChnlCmd;
|
||||
|
||||
typedef enum _HW90_BLOCK{
|
||||
HW90_BLOCK_MAC = 0,
|
||||
HW90_BLOCK_PHY0 = 1,
|
||||
HW90_BLOCK_PHY1 = 2,
|
||||
HW90_BLOCK_RF = 3,
|
||||
HW90_BLOCK_MAXIMUM = 4, // Never use this
|
||||
}HW90_BLOCK_E, *PHW90_BLOCK_E;
|
||||
|
||||
typedef enum _RF_RADIO_PATH{
|
||||
RF_PATH_A = 0, //Radio Path A
|
||||
RF_PATH_B = 1, //Radio Path B
|
||||
RF_PATH_C = 2, //Radio Path C
|
||||
RF_PATH_D = 3, //Radio Path D
|
||||
//RF_PATH_MAX //Max RF number 90 support
|
||||
}RF_RADIO_PATH_E, *PRF_RADIO_PATH_E;
|
||||
|
||||
#define MAX_PG_GROUP 13
|
||||
|
||||
#define RF_PATH_MAX 2
|
||||
#define MAX_RF_PATH RF_PATH_MAX
|
||||
#define MAX_TX_COUNT_88E 1
|
||||
#define MAX_TX_COUNT MAX_TX_COUNT_88E // 4 //path numbers
|
||||
|
||||
#define CHANNEL_MAX_NUMBER 14 // 14 is the max channel number
|
||||
#define MAX_CHNL_GROUP_24G 6 // ch1~2, ch3~5, ch6~8,ch9~11,ch12~13,CH 14 total six groups
|
||||
#define CHANNEL_GROUP_MAX_88E 6
|
||||
|
||||
typedef enum _WIRELESS_MODE {
|
||||
WIRELESS_MODE_UNKNOWN = 0x00,
|
||||
WIRELESS_MODE_A = BIT2,
|
||||
WIRELESS_MODE_B = BIT0,
|
||||
WIRELESS_MODE_G = BIT1,
|
||||
WIRELESS_MODE_AUTO = BIT5,
|
||||
WIRELESS_MODE_N_24G = BIT3,
|
||||
WIRELESS_MODE_N_5G = BIT4,
|
||||
WIRELESS_MODE_AC = BIT6
|
||||
} WIRELESS_MODE;
|
||||
|
||||
|
||||
typedef enum _PHY_Rate_Tx_Power_Offset_Area{
|
||||
RA_OFFSET_LEGACY_OFDM1,
|
||||
RA_OFFSET_LEGACY_OFDM2,
|
||||
RA_OFFSET_HT_OFDM1,
|
||||
RA_OFFSET_HT_OFDM2,
|
||||
RA_OFFSET_HT_OFDM3,
|
||||
RA_OFFSET_HT_OFDM4,
|
||||
RA_OFFSET_HT_CCK,
|
||||
}RA_OFFSET_AREA,*PRA_OFFSET_AREA;
|
||||
|
||||
|
||||
/* BB/RF related */
|
||||
typedef enum _RF_TYPE_8190P{
|
||||
RF_TYPE_MIN, // 0
|
||||
RF_8225=1, // 1 11b/g RF for verification only
|
||||
RF_8256=2, // 2 11b/g/n
|
||||
RF_8258=3, // 3 11a/b/g/n RF
|
||||
RF_6052=4, // 4 11b/g/n RF
|
||||
//RF_6052=5, // 4 11b/g/n RF
|
||||
// TODO: We sholud remove this psudo PHY RF after we get new RF.
|
||||
RF_PSEUDO_11N=5, // 5, It is a temporality RF.
|
||||
}RF_TYPE_8190P_E,*PRF_TYPE_8190P_E;
|
||||
|
||||
|
||||
typedef struct _BB_REGISTER_DEFINITION{
|
||||
u32 rfintfs; // set software control:
|
||||
// 0x870~0x877[8 bytes]
|
||||
|
||||
u32 rfintfi; // readback data:
|
||||
// 0x8e0~0x8e7[8 bytes]
|
||||
|
||||
u32 rfintfo; // output data:
|
||||
// 0x860~0x86f [16 bytes]
|
||||
|
||||
u32 rfintfe; // output enable:
|
||||
// 0x860~0x86f [16 bytes]
|
||||
|
||||
u32 rf3wireOffset; // LSSI data:
|
||||
// 0x840~0x84f [16 bytes]
|
||||
|
||||
u32 rfLSSI_Select; // BB Band Select:
|
||||
// 0x878~0x87f [8 bytes]
|
||||
|
||||
u32 rfTxGainStage; // Tx gain stage:
|
||||
// 0x80c~0x80f [4 bytes]
|
||||
|
||||
u32 rfHSSIPara1; // wire parameter control1 :
|
||||
// 0x820~0x823,0x828~0x82b, 0x830~0x833, 0x838~0x83b [16 bytes]
|
||||
|
||||
u32 rfHSSIPara2; // wire parameter control2 :
|
||||
// 0x824~0x827,0x82c~0x82f, 0x834~0x837, 0x83c~0x83f [16 bytes]
|
||||
|
||||
u32 rfSwitchControl; //Tx Rx antenna control :
|
||||
// 0x858~0x85f [16 bytes]
|
||||
|
||||
u32 rfAGCControl1; //AGC parameter control1 :
|
||||
// 0xc50~0xc53,0xc58~0xc5b, 0xc60~0xc63, 0xc68~0xc6b [16 bytes]
|
||||
|
||||
u32 rfAGCControl2; //AGC parameter control2 :
|
||||
// 0xc54~0xc57,0xc5c~0xc5f, 0xc64~0xc67, 0xc6c~0xc6f [16 bytes]
|
||||
|
||||
u32 rfRxIQImbalance; //OFDM Rx IQ imbalance matrix :
|
||||
// 0xc14~0xc17,0xc1c~0xc1f, 0xc24~0xc27, 0xc2c~0xc2f [16 bytes]
|
||||
|
||||
u32 rfRxAFE; //Rx IQ DC ofset and Rx digital filter, Rx DC notch filter :
|
||||
// 0xc10~0xc13,0xc18~0xc1b, 0xc20~0xc23, 0xc28~0xc2b [16 bytes]
|
||||
|
||||
u32 rfTxIQImbalance; //OFDM Tx IQ imbalance matrix
|
||||
// 0xc80~0xc83,0xc88~0xc8b, 0xc90~0xc93, 0xc98~0xc9b [16 bytes]
|
||||
|
||||
u32 rfTxAFE; //Tx IQ DC Offset and Tx DFIR type
|
||||
// 0xc84~0xc87,0xc8c~0xc8f, 0xc94~0xc97, 0xc9c~0xc9f [16 bytes]
|
||||
|
||||
u32 rfLSSIReadBack; //LSSI RF readback data SI mode
|
||||
// 0x8a0~0x8af [16 bytes]
|
||||
|
||||
u32 rfLSSIReadBackPi; //LSSI RF readback data PI mode 0x8b8-8bc for Path A and B
|
||||
|
||||
}BB_REGISTER_DEFINITION_T, *PBB_REGISTER_DEFINITION_T;
|
||||
|
||||
typedef struct _R_ANTENNA_SELECT_OFDM{
|
||||
u32 r_tx_antenna:4;
|
||||
u32 r_ant_l:4;
|
||||
u32 r_ant_non_ht:4;
|
||||
u32 r_ant_ht1:4;
|
||||
u32 r_ant_ht2:4;
|
||||
u32 r_ant_ht_s1:4;
|
||||
u32 r_ant_non_ht_s1:4;
|
||||
u32 OFDM_TXSC:2;
|
||||
u32 Reserved:2;
|
||||
}R_ANTENNA_SELECT_OFDM;
|
||||
|
||||
typedef struct _R_ANTENNA_SELECT_CCK{
|
||||
u8 r_cckrx_enable_2:2;
|
||||
u8 r_cckrx_enable:2;
|
||||
u8 r_ccktx_enable:4;
|
||||
}R_ANTENNA_SELECT_CCK;
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
|
||||
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
//
|
||||
// BB and RF register read/write
|
||||
//
|
||||
u32 rtl8188e_PHY_QueryBBReg( IN struct adapter *Adapter,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask );
|
||||
void rtl8188e_PHY_SetBBReg( IN struct adapter *Adapter,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask,
|
||||
IN u32 Data );
|
||||
u32 rtl8188e_PHY_QueryRFReg( IN struct adapter * Adapter,
|
||||
IN RF_RADIO_PATH_E eRFPath,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask );
|
||||
void rtl8188e_PHY_SetRFReg( IN struct adapter * Adapter,
|
||||
IN RF_RADIO_PATH_E eRFPath,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask,
|
||||
IN u32 Data );
|
||||
|
||||
//
|
||||
// Initialization related function
|
||||
//
|
||||
/* MAC/BB/RF HAL config */
|
||||
int PHY_MACConfig8188E(IN struct adapter *Adapter );
|
||||
int PHY_BBConfig8188E(IN struct adapter *Adapter );
|
||||
int PHY_RFConfig8188E(IN struct adapter *Adapter );
|
||||
|
||||
/* RF config */
|
||||
int rtl8188e_PHY_ConfigRFWithParaFile(IN struct adapter *Adapter, IN u8 * pFileName, RF_RADIO_PATH_E eRFPath);
|
||||
int rtl8188e_PHY_ConfigRFWithHeaderFile( IN struct adapter * Adapter,
|
||||
IN RF_RADIO_PATH_E eRFPath);
|
||||
|
||||
/* Read initi reg value for tx power setting. */
|
||||
void rtl8192c_PHY_GetHWRegOriginalValue( IN struct adapter * Adapter );
|
||||
|
||||
//
|
||||
// RF Power setting
|
||||
//
|
||||
//extern BOOLEAN PHY_SetRFPowerState(IN struct adapter * Adapter,
|
||||
// IN RT_RF_POWER_STATE eRFPowerState);
|
||||
|
||||
//
|
||||
// BB TX Power R/W
|
||||
//
|
||||
void PHY_GetTxPowerLevel8188E( IN struct adapter * Adapter,
|
||||
OUT u32* powerlevel );
|
||||
void PHY_SetTxPowerLevel8188E( IN struct adapter * Adapter,
|
||||
IN u8 channel );
|
||||
BOOLEAN PHY_UpdateTxPowerDbm8188E( IN struct adapter *Adapter,
|
||||
IN int powerInDbm );
|
||||
|
||||
//
|
||||
VOID
|
||||
PHY_ScanOperationBackup8188E(IN struct adapter *Adapter,
|
||||
IN u8 Operation );
|
||||
|
||||
//
|
||||
// Switch bandwidth for 8192S
|
||||
//
|
||||
//extern void PHY_SetBWModeCallback8192C( IN PRT_TIMER pTimer );
|
||||
void PHY_SetBWMode8188E( IN struct adapter * pAdapter,
|
||||
IN HT_CHANNEL_WIDTH ChnlWidth,
|
||||
IN unsigned char Offset );
|
||||
|
||||
//
|
||||
// Set FW CMD IO for 8192S.
|
||||
//
|
||||
//extern BOOLEAN HalSetIO8192C( IN struct adapter * Adapter,
|
||||
// IN IO_TYPE IOType);
|
||||
|
||||
//
|
||||
// Set A2 entry to fw for 8192S
|
||||
//
|
||||
extern void FillA2Entry8192C( IN struct adapter * Adapter,
|
||||
IN u8 index,
|
||||
IN u8* val);
|
||||
|
||||
|
||||
//
|
||||
// channel switch related funciton
|
||||
//
|
||||
//extern void PHY_SwChnlCallback8192C( IN PRT_TIMER pTimer );
|
||||
void PHY_SwChnl8188E( IN struct adapter * pAdapter,
|
||||
IN u8 channel );
|
||||
// Call after initialization
|
||||
void PHY_SwChnlPhy8192C( IN struct adapter * pAdapter,
|
||||
IN u8 channel );
|
||||
|
||||
void ChkFwCmdIoDone( IN struct adapter *Adapter);
|
||||
|
||||
//
|
||||
// BB/MAC/RF other monitor API
|
||||
//
|
||||
void PHY_SetMonitorMode8192C(IN struct adapter *pAdapter,
|
||||
IN BOOLEAN bEnableMonitorMode );
|
||||
|
||||
BOOLEAN PHY_CheckIsLegalRfPath8192C(IN struct adapter *pAdapter,
|
||||
IN u32 eRFPath );
|
||||
|
||||
VOID PHY_SetRFPathSwitch_8188E(IN struct adapter *pAdapter, IN BOOLEAN bMain);
|
||||
|
||||
extern VOID
|
||||
PHY_SwitchEphyParameter(
|
||||
IN struct adapter * Adapter
|
||||
);
|
||||
|
||||
extern VOID
|
||||
PHY_EnableHostClkReq(
|
||||
IN struct adapter * Adapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
SetAntennaConfig92C(
|
||||
IN struct adapter *Adapter,
|
||||
IN u8 DefaultAnt
|
||||
);
|
||||
|
||||
#ifdef CONFIG_PHY_SETTING_WITH_ODM
|
||||
VOID
|
||||
storePwrIndexDiffRateOffset(
|
||||
IN struct adapter *Adapter,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask,
|
||||
IN u32 Data
|
||||
);
|
||||
#endif //CONFIG_PHY_SETTING_WITH_ODM
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
|
||||
#define PHY_QueryBBReg(Adapter, RegAddr, BitMask) rtl8188e_PHY_QueryBBReg((Adapter), (RegAddr), (BitMask))
|
||||
#define PHY_SetBBReg(Adapter, RegAddr, BitMask, Data) rtl8188e_PHY_SetBBReg((Adapter), (RegAddr), (BitMask), (Data))
|
||||
#define PHY_QueryRFReg(Adapter, eRFPath, RegAddr, BitMask) rtl8188e_PHY_QueryRFReg((Adapter), (eRFPath), (RegAddr), (BitMask))
|
||||
#define PHY_SetRFReg(Adapter, eRFPath, RegAddr, BitMask, Data) rtl8188e_PHY_SetRFReg((Adapter), (eRFPath), (RegAddr), (BitMask), (Data))
|
||||
|
||||
#define PHY_SetMacReg PHY_SetBBReg
|
||||
#define PHY_QueryMacReg PHY_QueryBBReg
|
||||
|
||||
|
||||
//
|
||||
// Initialization related function
|
||||
//
|
||||
/* MAC/BB/RF HAL config */
|
||||
//extern s32 PHY_MACConfig8723(struct adapter *padapter);
|
||||
//s32 PHY_BBConfig8723(struct adapter *padapter);
|
||||
//s32 PHY_RFConfig8723(struct adapter *padapter);
|
||||
|
||||
|
||||
|
||||
//==================================================================
|
||||
// Note: If SIC_ENABLE under PCIE, because of the slow operation
|
||||
// you should
|
||||
// 2) "#define RTL8723_FPGA_VERIFICATION 1" in Precomp.h.WlanE.Windows
|
||||
// 3) "#define RTL8190_Download_Firmware_From_Header 0" in Precomp.h.WlanE.Windows if needed.
|
||||
//
|
||||
#if (RTL8188E_SUPPORT == 1) && (RTL8188E_FPGA_TRUE_PHY_VERIFICATION == 1)
|
||||
#define SIC_ENABLE 1
|
||||
#define SIC_HW_SUPPORT 1
|
||||
#else
|
||||
#define SIC_ENABLE 0
|
||||
#define SIC_HW_SUPPORT 0
|
||||
#endif
|
||||
//==================================================================
|
||||
|
||||
|
||||
#define SIC_MAX_POLL_CNT 5
|
||||
|
||||
#if(SIC_HW_SUPPORT == 1)
|
||||
#define SIC_CMD_READY 0
|
||||
#define SIC_CMD_PREWRITE 0x1
|
||||
#if(RTL8188E_SUPPORT == 1)
|
||||
#define SIC_CMD_WRITE 0x40
|
||||
#define SIC_CMD_PREREAD 0x2
|
||||
#define SIC_CMD_READ 0x80
|
||||
#define SIC_CMD_INIT 0xf0
|
||||
#define SIC_INIT_VAL 0xff
|
||||
|
||||
#define SIC_INIT_REG 0x1b7
|
||||
#define SIC_CMD_REG 0x1EB // 1byte
|
||||
#define SIC_ADDR_REG 0x1E8 // 1b4~1b5, 2 bytes
|
||||
#define SIC_DATA_REG 0x1EC // 1b0~1b3
|
||||
#else
|
||||
#define SIC_CMD_WRITE 0x11
|
||||
#define SIC_CMD_PREREAD 0x2
|
||||
#define SIC_CMD_READ 0x12
|
||||
#define SIC_CMD_INIT 0x1f
|
||||
#define SIC_INIT_VAL 0xff
|
||||
|
||||
#define SIC_INIT_REG 0x1b7
|
||||
#define SIC_CMD_REG 0x1b6 // 1byte
|
||||
#define SIC_ADDR_REG 0x1b4 // 1b4~1b5, 2 bytes
|
||||
#define SIC_DATA_REG 0x1b0 // 1b0~1b3
|
||||
#endif
|
||||
#else
|
||||
#define SIC_CMD_READY 0
|
||||
#define SIC_CMD_WRITE 1
|
||||
#define SIC_CMD_READ 2
|
||||
|
||||
#if(RTL8188E_SUPPORT == 1)
|
||||
#define SIC_CMD_REG 0x1EB // 1byte
|
||||
#define SIC_ADDR_REG 0x1E8 // 1b9~1ba, 2 bytes
|
||||
#define SIC_DATA_REG 0x1EC // 1bc~1bf
|
||||
#else
|
||||
#define SIC_CMD_REG 0x1b8 // 1byte
|
||||
#define SIC_ADDR_REG 0x1b9 // 1b9~1ba, 2 bytes
|
||||
#define SIC_DATA_REG 0x1bc // 1bc~1bf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if(SIC_ENABLE == 1)
|
||||
VOID SIC_Init(IN struct adapter *Adapter);
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __INC_HAL8192CPHYCFG_H
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __INC_HAL8188EPHYCFG_H__
|
||||
#define __INC_HAL8188EPHYCFG_H__
|
||||
|
||||
|
||||
/*--------------------------Define Parameters-------------------------------*/
|
||||
#define LOOP_LIMIT 5
|
||||
#define MAX_STALL_TIME 50 //us
|
||||
#define AntennaDiversityValue 0x80 //(Adapter->bSoftwareAntennaDiversity ? 0x00:0x80)
|
||||
#define MAX_TXPWR_IDX_NMODE_92S 63
|
||||
#define Reset_Cnt_Limit 3
|
||||
|
||||
#define IQK_MAC_REG_NUM 4
|
||||
#define IQK_ADDA_REG_NUM 16
|
||||
#define IQK_BB_REG_NUM 9
|
||||
#define HP_THERMAL_NUM 8
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
#define MAX_AGGR_NUM 0x0B
|
||||
#else
|
||||
#define MAX_AGGR_NUM 0x07
|
||||
#endif // CONFIG_PCI_HCI
|
||||
|
||||
|
||||
/*--------------------------Define Parameters-------------------------------*/
|
||||
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
typedef enum _SwChnlCmdID{
|
||||
CmdID_End,
|
||||
CmdID_SetTxPowerLevel,
|
||||
CmdID_BBRegWrite10,
|
||||
CmdID_WritePortUlong,
|
||||
CmdID_WritePortUshort,
|
||||
CmdID_WritePortUchar,
|
||||
CmdID_RF_WriteReg,
|
||||
}SwChnlCmdID;
|
||||
|
||||
|
||||
/* 1. Switch channel related */
|
||||
typedef struct _SwChnlCmd{
|
||||
SwChnlCmdID CmdID;
|
||||
u32 Para1;
|
||||
u32 Para2;
|
||||
u32 msDelay;
|
||||
}SwChnlCmd;
|
||||
|
||||
typedef enum _HW90_BLOCK{
|
||||
HW90_BLOCK_MAC = 0,
|
||||
HW90_BLOCK_PHY0 = 1,
|
||||
HW90_BLOCK_PHY1 = 2,
|
||||
HW90_BLOCK_RF = 3,
|
||||
HW90_BLOCK_MAXIMUM = 4, // Never use this
|
||||
}HW90_BLOCK_E, *PHW90_BLOCK_E;
|
||||
|
||||
typedef enum _RF_RADIO_PATH{
|
||||
RF_PATH_A = 0, //Radio Path A
|
||||
RF_PATH_B = 1, //Radio Path B
|
||||
RF_PATH_C = 2, //Radio Path C
|
||||
RF_PATH_D = 3, //Radio Path D
|
||||
//RF_PATH_MAX //Max RF number 90 support
|
||||
}RF_RADIO_PATH_E, *PRF_RADIO_PATH_E;
|
||||
|
||||
#define MAX_PG_GROUP 13
|
||||
|
||||
#define RF_PATH_MAX 2
|
||||
#define MAX_RF_PATH RF_PATH_MAX
|
||||
#define MAX_TX_COUNT_88E 1
|
||||
#define MAX_TX_COUNT MAX_TX_COUNT_88E // 4 //path numbers
|
||||
|
||||
#define CHANNEL_MAX_NUMBER 14 // 14 is the max channel number
|
||||
#define MAX_CHNL_GROUP_24G 6 // ch1~2, ch3~5, ch6~8,ch9~11,ch12~13,CH 14 total six groups
|
||||
#define CHANNEL_GROUP_MAX_88E 6
|
||||
|
||||
typedef enum _WIRELESS_MODE {
|
||||
WIRELESS_MODE_UNKNOWN = 0x00,
|
||||
WIRELESS_MODE_A = BIT2,
|
||||
WIRELESS_MODE_B = BIT0,
|
||||
WIRELESS_MODE_G = BIT1,
|
||||
WIRELESS_MODE_AUTO = BIT5,
|
||||
WIRELESS_MODE_N_24G = BIT3,
|
||||
WIRELESS_MODE_N_5G = BIT4,
|
||||
WIRELESS_MODE_AC = BIT6
|
||||
} WIRELESS_MODE;
|
||||
|
||||
|
||||
typedef enum _PHY_Rate_Tx_Power_Offset_Area{
|
||||
RA_OFFSET_LEGACY_OFDM1,
|
||||
RA_OFFSET_LEGACY_OFDM2,
|
||||
RA_OFFSET_HT_OFDM1,
|
||||
RA_OFFSET_HT_OFDM2,
|
||||
RA_OFFSET_HT_OFDM3,
|
||||
RA_OFFSET_HT_OFDM4,
|
||||
RA_OFFSET_HT_CCK,
|
||||
}RA_OFFSET_AREA,*PRA_OFFSET_AREA;
|
||||
|
||||
|
||||
/* BB/RF related */
|
||||
typedef enum _RF_TYPE_8190P{
|
||||
RF_TYPE_MIN, // 0
|
||||
RF_8225=1, // 1 11b/g RF for verification only
|
||||
RF_8256=2, // 2 11b/g/n
|
||||
RF_8258=3, // 3 11a/b/g/n RF
|
||||
RF_6052=4, // 4 11b/g/n RF
|
||||
//RF_6052=5, // 4 11b/g/n RF
|
||||
// TODO: We sholud remove this psudo PHY RF after we get new RF.
|
||||
RF_PSEUDO_11N=5, // 5, It is a temporality RF.
|
||||
}RF_TYPE_8190P_E,*PRF_TYPE_8190P_E;
|
||||
|
||||
|
||||
typedef struct _BB_REGISTER_DEFINITION{
|
||||
u32 rfintfs; // set software control:
|
||||
// 0x870~0x877[8 bytes]
|
||||
|
||||
u32 rfintfi; // readback data:
|
||||
// 0x8e0~0x8e7[8 bytes]
|
||||
|
||||
u32 rfintfo; // output data:
|
||||
// 0x860~0x86f [16 bytes]
|
||||
|
||||
u32 rfintfe; // output enable:
|
||||
// 0x860~0x86f [16 bytes]
|
||||
|
||||
u32 rf3wireOffset; // LSSI data:
|
||||
// 0x840~0x84f [16 bytes]
|
||||
|
||||
u32 rfLSSI_Select; // BB Band Select:
|
||||
// 0x878~0x87f [8 bytes]
|
||||
|
||||
u32 rfTxGainStage; // Tx gain stage:
|
||||
// 0x80c~0x80f [4 bytes]
|
||||
|
||||
u32 rfHSSIPara1; // wire parameter control1 :
|
||||
// 0x820~0x823,0x828~0x82b, 0x830~0x833, 0x838~0x83b [16 bytes]
|
||||
|
||||
u32 rfHSSIPara2; // wire parameter control2 :
|
||||
// 0x824~0x827,0x82c~0x82f, 0x834~0x837, 0x83c~0x83f [16 bytes]
|
||||
|
||||
u32 rfSwitchControl; //Tx Rx antenna control :
|
||||
// 0x858~0x85f [16 bytes]
|
||||
|
||||
u32 rfAGCControl1; //AGC parameter control1 :
|
||||
// 0xc50~0xc53,0xc58~0xc5b, 0xc60~0xc63, 0xc68~0xc6b [16 bytes]
|
||||
|
||||
u32 rfAGCControl2; //AGC parameter control2 :
|
||||
// 0xc54~0xc57,0xc5c~0xc5f, 0xc64~0xc67, 0xc6c~0xc6f [16 bytes]
|
||||
|
||||
u32 rfRxIQImbalance; //OFDM Rx IQ imbalance matrix :
|
||||
// 0xc14~0xc17,0xc1c~0xc1f, 0xc24~0xc27, 0xc2c~0xc2f [16 bytes]
|
||||
|
||||
u32 rfRxAFE; //Rx IQ DC ofset and Rx digital filter, Rx DC notch filter :
|
||||
// 0xc10~0xc13,0xc18~0xc1b, 0xc20~0xc23, 0xc28~0xc2b [16 bytes]
|
||||
|
||||
u32 rfTxIQImbalance; //OFDM Tx IQ imbalance matrix
|
||||
// 0xc80~0xc83,0xc88~0xc8b, 0xc90~0xc93, 0xc98~0xc9b [16 bytes]
|
||||
|
||||
u32 rfTxAFE; //Tx IQ DC Offset and Tx DFIR type
|
||||
// 0xc84~0xc87,0xc8c~0xc8f, 0xc94~0xc97, 0xc9c~0xc9f [16 bytes]
|
||||
|
||||
u32 rfLSSIReadBack; //LSSI RF readback data SI mode
|
||||
// 0x8a0~0x8af [16 bytes]
|
||||
|
||||
u32 rfLSSIReadBackPi; //LSSI RF readback data PI mode 0x8b8-8bc for Path A and B
|
||||
|
||||
}BB_REGISTER_DEFINITION_T, *PBB_REGISTER_DEFINITION_T;
|
||||
|
||||
typedef struct _R_ANTENNA_SELECT_OFDM{
|
||||
u32 r_tx_antenna:4;
|
||||
u32 r_ant_l:4;
|
||||
u32 r_ant_non_ht:4;
|
||||
u32 r_ant_ht1:4;
|
||||
u32 r_ant_ht2:4;
|
||||
u32 r_ant_ht_s1:4;
|
||||
u32 r_ant_non_ht_s1:4;
|
||||
u32 OFDM_TXSC:2;
|
||||
u32 Reserved:2;
|
||||
}R_ANTENNA_SELECT_OFDM;
|
||||
|
||||
typedef struct _R_ANTENNA_SELECT_CCK{
|
||||
u8 r_cckrx_enable_2:2;
|
||||
u8 r_cckrx_enable:2;
|
||||
u8 r_ccktx_enable:4;
|
||||
}R_ANTENNA_SELECT_CCK;
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
|
||||
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
//
|
||||
// BB and RF register read/write
|
||||
//
|
||||
u32 rtl8188e_PHY_QueryBBReg( IN struct adapter *Adapter,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask );
|
||||
void rtl8188e_PHY_SetBBReg( IN struct adapter *Adapter,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask,
|
||||
IN u32 Data );
|
||||
u32 rtl8188e_PHY_QueryRFReg( IN struct adapter * Adapter,
|
||||
IN RF_RADIO_PATH_E eRFPath,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask );
|
||||
void rtl8188e_PHY_SetRFReg( IN struct adapter * Adapter,
|
||||
IN RF_RADIO_PATH_E eRFPath,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask,
|
||||
IN u32 Data );
|
||||
|
||||
//
|
||||
// Initialization related function
|
||||
//
|
||||
/* MAC/BB/RF HAL config */
|
||||
int PHY_MACConfig8188E(IN struct adapter *Adapter );
|
||||
int PHY_BBConfig8188E(IN struct adapter *Adapter );
|
||||
int PHY_RFConfig8188E(IN struct adapter *Adapter );
|
||||
|
||||
/* RF config */
|
||||
int rtl8188e_PHY_ConfigRFWithParaFile(IN struct adapter *Adapter, IN u8 * pFileName, RF_RADIO_PATH_E eRFPath);
|
||||
int rtl8188e_PHY_ConfigRFWithHeaderFile( IN struct adapter * Adapter,
|
||||
IN RF_RADIO_PATH_E eRFPath);
|
||||
|
||||
/* Read initi reg value for tx power setting. */
|
||||
void rtl8192c_PHY_GetHWRegOriginalValue( IN struct adapter * Adapter );
|
||||
|
||||
//
|
||||
// RF Power setting
|
||||
//
|
||||
//extern BOOLEAN PHY_SetRFPowerState(IN struct adapter * Adapter,
|
||||
// IN RT_RF_POWER_STATE eRFPowerState);
|
||||
|
||||
//
|
||||
// BB TX Power R/W
|
||||
//
|
||||
void PHY_GetTxPowerLevel8188E( IN struct adapter * Adapter,
|
||||
OUT u32* powerlevel );
|
||||
void PHY_SetTxPowerLevel8188E( IN struct adapter * Adapter,
|
||||
IN u8 channel );
|
||||
BOOLEAN PHY_UpdateTxPowerDbm8188E( IN struct adapter *Adapter,
|
||||
IN int powerInDbm );
|
||||
|
||||
//
|
||||
VOID
|
||||
PHY_ScanOperationBackup8188E(IN struct adapter *Adapter,
|
||||
IN u8 Operation );
|
||||
|
||||
//
|
||||
// Switch bandwidth for 8192S
|
||||
//
|
||||
//extern void PHY_SetBWModeCallback8192C( IN PRT_TIMER pTimer );
|
||||
void PHY_SetBWMode8188E( IN struct adapter * pAdapter,
|
||||
IN HT_CHANNEL_WIDTH ChnlWidth,
|
||||
IN unsigned char Offset );
|
||||
|
||||
//
|
||||
// Set FW CMD IO for 8192S.
|
||||
//
|
||||
//extern BOOLEAN HalSetIO8192C( IN struct adapter * Adapter,
|
||||
// IN IO_TYPE IOType);
|
||||
|
||||
//
|
||||
// Set A2 entry to fw for 8192S
|
||||
//
|
||||
extern void FillA2Entry8192C( IN struct adapter * Adapter,
|
||||
IN u8 index,
|
||||
IN u8* val);
|
||||
|
||||
|
||||
//
|
||||
// channel switch related funciton
|
||||
//
|
||||
//extern void PHY_SwChnlCallback8192C( IN PRT_TIMER pTimer );
|
||||
void PHY_SwChnl8188E( IN struct adapter * pAdapter,
|
||||
IN u8 channel );
|
||||
// Call after initialization
|
||||
void PHY_SwChnlPhy8192C( IN struct adapter * pAdapter,
|
||||
IN u8 channel );
|
||||
|
||||
void ChkFwCmdIoDone( IN struct adapter *Adapter);
|
||||
|
||||
//
|
||||
// BB/MAC/RF other monitor API
|
||||
//
|
||||
void PHY_SetMonitorMode8192C(IN struct adapter *pAdapter,
|
||||
IN BOOLEAN bEnableMonitorMode );
|
||||
|
||||
BOOLEAN PHY_CheckIsLegalRfPath8192C(IN struct adapter *pAdapter,
|
||||
IN u32 eRFPath );
|
||||
|
||||
VOID PHY_SetRFPathSwitch_8188E(IN struct adapter *pAdapter, IN BOOLEAN bMain);
|
||||
|
||||
extern VOID
|
||||
PHY_SwitchEphyParameter(
|
||||
IN struct adapter * Adapter
|
||||
);
|
||||
|
||||
extern VOID
|
||||
PHY_EnableHostClkReq(
|
||||
IN struct adapter * Adapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
SetAntennaConfig92C(
|
||||
IN struct adapter *Adapter,
|
||||
IN u8 DefaultAnt
|
||||
);
|
||||
|
||||
#ifdef CONFIG_PHY_SETTING_WITH_ODM
|
||||
VOID
|
||||
storePwrIndexDiffRateOffset(
|
||||
IN struct adapter *Adapter,
|
||||
IN u32 RegAddr,
|
||||
IN u32 BitMask,
|
||||
IN u32 Data
|
||||
);
|
||||
#endif //CONFIG_PHY_SETTING_WITH_ODM
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
|
||||
#define PHY_QueryBBReg(Adapter, RegAddr, BitMask) rtl8188e_PHY_QueryBBReg((Adapter), (RegAddr), (BitMask))
|
||||
#define PHY_SetBBReg(Adapter, RegAddr, BitMask, Data) rtl8188e_PHY_SetBBReg((Adapter), (RegAddr), (BitMask), (Data))
|
||||
#define PHY_QueryRFReg(Adapter, eRFPath, RegAddr, BitMask) rtl8188e_PHY_QueryRFReg((Adapter), (eRFPath), (RegAddr), (BitMask))
|
||||
#define PHY_SetRFReg(Adapter, eRFPath, RegAddr, BitMask, Data) rtl8188e_PHY_SetRFReg((Adapter), (eRFPath), (RegAddr), (BitMask), (Data))
|
||||
|
||||
#define PHY_SetMacReg PHY_SetBBReg
|
||||
#define PHY_QueryMacReg PHY_QueryBBReg
|
||||
|
||||
|
||||
//
|
||||
// Initialization related function
|
||||
//
|
||||
/* MAC/BB/RF HAL config */
|
||||
//extern s32 PHY_MACConfig8723(struct adapter *padapter);
|
||||
//s32 PHY_BBConfig8723(struct adapter *padapter);
|
||||
//s32 PHY_RFConfig8723(struct adapter *padapter);
|
||||
|
||||
|
||||
|
||||
//==================================================================
|
||||
// Note: If SIC_ENABLE under PCIE, because of the slow operation
|
||||
// you should
|
||||
// 2) "#define RTL8723_FPGA_VERIFICATION 1" in Precomp.h.WlanE.Windows
|
||||
// 3) "#define RTL8190_Download_Firmware_From_Header 0" in Precomp.h.WlanE.Windows if needed.
|
||||
//
|
||||
#if (RTL8188E_SUPPORT == 1) && (RTL8188E_FPGA_TRUE_PHY_VERIFICATION == 1)
|
||||
#define SIC_ENABLE 1
|
||||
#define SIC_HW_SUPPORT 1
|
||||
#else
|
||||
#define SIC_ENABLE 0
|
||||
#define SIC_HW_SUPPORT 0
|
||||
#endif
|
||||
//==================================================================
|
||||
|
||||
|
||||
#define SIC_MAX_POLL_CNT 5
|
||||
|
||||
#if(SIC_HW_SUPPORT == 1)
|
||||
#define SIC_CMD_READY 0
|
||||
#define SIC_CMD_PREWRITE 0x1
|
||||
#if(RTL8188E_SUPPORT == 1)
|
||||
#define SIC_CMD_WRITE 0x40
|
||||
#define SIC_CMD_PREREAD 0x2
|
||||
#define SIC_CMD_READ 0x80
|
||||
#define SIC_CMD_INIT 0xf0
|
||||
#define SIC_INIT_VAL 0xff
|
||||
|
||||
#define SIC_INIT_REG 0x1b7
|
||||
#define SIC_CMD_REG 0x1EB // 1byte
|
||||
#define SIC_ADDR_REG 0x1E8 // 1b4~1b5, 2 bytes
|
||||
#define SIC_DATA_REG 0x1EC // 1b0~1b3
|
||||
#else
|
||||
#define SIC_CMD_WRITE 0x11
|
||||
#define SIC_CMD_PREREAD 0x2
|
||||
#define SIC_CMD_READ 0x12
|
||||
#define SIC_CMD_INIT 0x1f
|
||||
#define SIC_INIT_VAL 0xff
|
||||
|
||||
#define SIC_INIT_REG 0x1b7
|
||||
#define SIC_CMD_REG 0x1b6 // 1byte
|
||||
#define SIC_ADDR_REG 0x1b4 // 1b4~1b5, 2 bytes
|
||||
#define SIC_DATA_REG 0x1b0 // 1b0~1b3
|
||||
#endif
|
||||
#else
|
||||
#define SIC_CMD_READY 0
|
||||
#define SIC_CMD_WRITE 1
|
||||
#define SIC_CMD_READ 2
|
||||
|
||||
#if(RTL8188E_SUPPORT == 1)
|
||||
#define SIC_CMD_REG 0x1EB // 1byte
|
||||
#define SIC_ADDR_REG 0x1E8 // 1b9~1ba, 2 bytes
|
||||
#define SIC_DATA_REG 0x1EC // 1bc~1bf
|
||||
#else
|
||||
#define SIC_CMD_REG 0x1b8 // 1byte
|
||||
#define SIC_ADDR_REG 0x1b9 // 1b9~1ba, 2 bytes
|
||||
#define SIC_DATA_REG 0x1bc // 1bc~1bf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if(SIC_ENABLE == 1)
|
||||
VOID SIC_Init(IN struct adapter *Adapter);
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __INC_HAL8192CPHYCFG_H
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,177 +1,176 @@
|
|||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __HAL8188EPWRSEQ_H__
|
||||
#define __HAL8188EPWRSEQ_H__
|
||||
|
||||
#include "HalPwrSeqCmd.h"
|
||||
|
||||
/*
|
||||
Check document WM-20110607-Paul-RTL8188E_Power_Architecture-R02.vsd
|
||||
There are 6 HW Power States:
|
||||
0: POFF--Power Off
|
||||
1: PDN--Power Down
|
||||
2: CARDEMU--Card Emulation
|
||||
3: ACT--Active Mode
|
||||
4: LPS--Low Power State
|
||||
5: SUS--Suspend
|
||||
|
||||
The transision from different states are defined below
|
||||
TRANS_CARDEMU_TO_ACT
|
||||
TRANS_ACT_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_SUS
|
||||
TRANS_SUS_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_PDN
|
||||
TRANS_ACT_TO_LPS
|
||||
TRANS_LPS_TO_ACT
|
||||
|
||||
TRANS_END
|
||||
|
||||
PWR SEQ Version: rtl8188E_PwrSeq_V09.h
|
||||
*/
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS 10
|
||||
#define RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS 10
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS 10
|
||||
#define RTL8188E_TRANS_SUS_TO_CARDEMU_STEPS 10
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS 10
|
||||
#define RTL8188E_TRANS_PDN_TO_CARDEMU_STEPS 10
|
||||
#define RTL8188E_TRANS_ACT_TO_LPS_STEPS 15
|
||||
#define RTL8188E_TRANS_LPS_TO_ACT_STEPS 15
|
||||
#define RTL8188E_TRANS_END_STEPS 1
|
||||
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT1, BIT1},/* wait till 0x04[17] = 1 power ready*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0|BIT1, 0}, /* 0x02[1:0] = 0 reset BB*/ \
|
||||
{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, BIT7}, /*0x24[23] = 2b'01 schmit trigger */ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0}, /* 0x04[15] = 0 disable HWPDN (control by DRV)*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4|BIT3, 0}, /*0x04[12:11] = 2b'00 disable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0}, /*0x04[8] = 1 polling until return 0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT0, 0}, /*wait till 0x04[8] = 0*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*LDO normal mode*/ \
|
||||
{0x0074, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*SDIO Driving*/ \
|
||||
|
||||
#define RTL8188E_TRANS_ACT_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},/*0x1F[7:0] = 0 turn off RF*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*LDO Sleep mode*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, BIT1}, /*0x04[9] = 1 turn off MAC by HW state machine*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT1, 0}, /*wait till 0x04[9] = 0 polling until return 0 to disable*/ \
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_SUS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3}, /*0x04[12:11] = 2b'01enable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3|BIT4}, /*0x04[12:11] = 2b'11enable WL suspend for PCIe*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, BIT7}, /* 0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */ \
|
||||
{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*Clear SIC_EN register 0x40[12] = 1'b0 */ \
|
||||
{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*Set USB suspend enable local register 0xfe10[4]=1 */ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, BIT0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_SUS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, BIT1}, /*wait power state to suspend*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, 0}, /*0x04[12:11] = 2b'01enable WL suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_CARDDIS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, BIT7}, /*0x24[23] = 2b'01 schmit trigger */ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3}, /*0x04[12:11] = 2b'01 enable WL suspend*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0}, /* 0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */ \
|
||||
{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*Clear SIC_EN register 0x40[12] = 1'b0 */ \
|
||||
{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*Set USB suspend enable local register 0xfe10[4]=1 */ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, BIT0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_CARDDIS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, BIT1}, /*wait power state to suspend*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, 0}, /*0x04[12:11] = 2b'01enable WL suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_PDN \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0},/* 0x04[16] = 0*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, BIT7},/* 0x04[15] = 1*/
|
||||
|
||||
#define RTL8188E_TRANS_PDN_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},/* 0x04[15] = 0*/
|
||||
|
||||
//This is used by driver for LPSRadioOff Procedure, not for FW LPS Step
|
||||
#define RTL8188E_TRANS_ACT_TO_LPS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x7F},/*Tx Pause*/ \
|
||||
{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0},/*CCK and OFDM are disabled,and clock are gated*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US},/*Delay 1us*/ \
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x3F},/*Reset MAC TRX*/ \
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, 0},/*check if removed later*/ \
|
||||
{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT5, BIT5},/*Respond TxOK to scheduler*/ \
|
||||
|
||||
|
||||
#define RTL8188E_TRANS_LPS_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, 0xFF, 0x84}, /*SDIO RPWM*/\
|
||||
{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x84}, /*USB RPWM*/\
|
||||
{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x84}, /*PCIe RPWM*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, /*Delay*/\
|
||||
{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*. 0x08[4] = 0 switch TSF to 40M*/\
|
||||
{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT7, 0}, /*Polling 0x109[7]=0 TSF in 40M*/\
|
||||
{0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT6|BIT7, 0}, /*. 0x29[7:6] = 2b'00 enable BB clock*/\
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, BIT1}, /*. 0x101[1] = 1*/\
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0xFF}, /*. 0x100[7:0] = 0xFF enable WMAC TRX*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1|BIT0, BIT1|BIT0}, /*. 0x02[1:0] = 2b'11 enable BB macro*/\
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0}, /*. 0x522 = 0*/
|
||||
|
||||
#define RTL8188E_TRANS_END \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,0,PWR_CMD_END, 0, 0}, //
|
||||
|
||||
|
||||
extern WLAN_PWR_CFG rtl8188E_power_on_flow[RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_radio_off_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_card_disable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_card_enable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_suspend_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_resume_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_hwpdn_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_enter_lps_flow[RTL8188E_TRANS_ACT_TO_LPS_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_leave_lps_flow[RTL8188E_TRANS_LPS_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
|
||||
#endif //__HAL8188EPWRSEQ_H__
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __HAL8188EPWRSEQ_H__
|
||||
#define __HAL8188EPWRSEQ_H__
|
||||
|
||||
#include "HalPwrSeqCmd.h"
|
||||
|
||||
/*
|
||||
Check document WM-20110607-Paul-RTL8188E_Power_Architecture-R02.vsd
|
||||
There are 6 HW Power States:
|
||||
0: POFF--Power Off
|
||||
1: PDN--Power Down
|
||||
2: CARDEMU--Card Emulation
|
||||
3: ACT--Active Mode
|
||||
4: LPS--Low Power State
|
||||
5: SUS--Suspend
|
||||
|
||||
The transision from different states are defined below
|
||||
TRANS_CARDEMU_TO_ACT
|
||||
TRANS_ACT_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_SUS
|
||||
TRANS_SUS_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_PDN
|
||||
TRANS_ACT_TO_LPS
|
||||
TRANS_LPS_TO_ACT
|
||||
|
||||
TRANS_END
|
||||
|
||||
PWR SEQ Version: rtl8188E_PwrSeq_V09.h
|
||||
*/
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS 10
|
||||
#define RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS 10
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS 10
|
||||
#define RTL8188E_TRANS_SUS_TO_CARDEMU_STEPS 10
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS 10
|
||||
#define RTL8188E_TRANS_PDN_TO_CARDEMU_STEPS 10
|
||||
#define RTL8188E_TRANS_ACT_TO_LPS_STEPS 15
|
||||
#define RTL8188E_TRANS_LPS_TO_ACT_STEPS 15
|
||||
#define RTL8188E_TRANS_END_STEPS 1
|
||||
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT1, BIT1},/* wait till 0x04[17] = 1 power ready*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0|BIT1, 0}, /* 0x02[1:0] = 0 reset BB*/ \
|
||||
{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, BIT7}, /*0x24[23] = 2b'01 schmit trigger */ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0}, /* 0x04[15] = 0 disable HWPDN (control by DRV)*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4|BIT3, 0}, /*0x04[12:11] = 2b'00 disable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0}, /*0x04[8] = 1 polling until return 0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT0, 0}, /*wait till 0x04[8] = 0*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*LDO normal mode*/ \
|
||||
{0x0074, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*SDIO Driving*/ \
|
||||
|
||||
#define RTL8188E_TRANS_ACT_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},/*0x1F[7:0] = 0 turn off RF*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*LDO Sleep mode*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, BIT1}, /*0x04[9] = 1 turn off MAC by HW state machine*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT1, 0}, /*wait till 0x04[9] = 0 polling until return 0 to disable*/ \
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_SUS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3}, /*0x04[12:11] = 2b'01enable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3|BIT4}, /*0x04[12:11] = 2b'11enable WL suspend for PCIe*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, BIT7}, /* 0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */ \
|
||||
{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*Clear SIC_EN register 0x40[12] = 1'b0 */ \
|
||||
{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*Set USB suspend enable local register 0xfe10[4]=1 */ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, BIT0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_SUS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, BIT1}, /*wait power state to suspend*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, 0}, /*0x04[12:11] = 2b'01enable WL suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_CARDDIS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, BIT7}, /*0x24[23] = 2b'01 schmit trigger */ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3}, /*0x04[12:11] = 2b'01 enable WL suspend*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0}, /* 0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */ \
|
||||
{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*Clear SIC_EN register 0x40[12] = 1'b0 */ \
|
||||
{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*Set USB suspend enable local register 0xfe10[4]=1 */ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, BIT0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_CARDDIS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, BIT1}, /*wait power state to suspend*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, 0}, /*0x04[12:11] = 2b'01enable WL suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_PDN \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0},/* 0x04[16] = 0*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, BIT7},/* 0x04[15] = 1*/
|
||||
|
||||
#define RTL8188E_TRANS_PDN_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},/* 0x04[15] = 0*/
|
||||
|
||||
//This is used by driver for LPSRadioOff Procedure, not for FW LPS Step
|
||||
#define RTL8188E_TRANS_ACT_TO_LPS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x7F},/*Tx Pause*/ \
|
||||
{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0},/*CCK and OFDM are disabled,and clock are gated*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US},/*Delay 1us*/ \
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x3F},/*Reset MAC TRX*/ \
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, 0},/*check if removed later*/ \
|
||||
{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT5, BIT5},/*Respond TxOK to scheduler*/ \
|
||||
|
||||
|
||||
#define RTL8188E_TRANS_LPS_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, 0xFF, 0x84}, /*SDIO RPWM*/\
|
||||
{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x84}, /*USB RPWM*/\
|
||||
{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x84}, /*PCIe RPWM*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, /*Delay*/\
|
||||
{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*. 0x08[4] = 0 switch TSF to 40M*/\
|
||||
{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT7, 0}, /*Polling 0x109[7]=0 TSF in 40M*/\
|
||||
{0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT6|BIT7, 0}, /*. 0x29[7:6] = 2b'00 enable BB clock*/\
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, BIT1}, /*. 0x101[1] = 1*/\
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0xFF}, /*. 0x100[7:0] = 0xFF enable WMAC TRX*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1|BIT0, BIT1|BIT0}, /*. 0x02[1:0] = 2b'11 enable BB macro*/\
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0}, /*. 0x522 = 0*/
|
||||
|
||||
#define RTL8188E_TRANS_END \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,0,PWR_CMD_END, 0, 0}, //
|
||||
|
||||
|
||||
extern WLAN_PWR_CFG rtl8188E_power_on_flow[RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_radio_off_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_card_disable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_card_enable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_suspend_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_resume_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_hwpdn_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_enter_lps_flow[RTL8188E_TRANS_ACT_TO_LPS_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8188E_leave_lps_flow[RTL8188E_TRANS_LPS_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
|
||||
#endif //__HAL8188EPWRSEQ_H__
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -21,18 +21,18 @@
|
|||
* Module: __INC_HAL8192CPHYCFG_H
|
||||
*
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
*
|
||||
* Export: Constants, macro, functions(API), global variables(None).
|
||||
*
|
||||
* Abbrev:
|
||||
* Abbrev:
|
||||
*
|
||||
* History:
|
||||
* Data Who Remark
|
||||
* 08/07/2007 MHC 1. Porting from 9x series PHYCFG.h.
|
||||
* Data Who Remark
|
||||
* 08/07/2007 MHC 1. Porting from 9x series PHYCFG.h.
|
||||
* 2. Reorganize code architecture.
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
/* Check to see if the file has been included already. */
|
||||
#ifndef __INC_HAL8192CPHYCFG_H
|
||||
|
@ -79,7 +79,7 @@
|
|||
/*--------------------------Define Parameters-------------------------------*/
|
||||
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
typedef enum _SwChnlCmdID{
|
||||
CmdID_End,
|
||||
CmdID_SetTxPowerLevel,
|
||||
|
@ -112,7 +112,7 @@ typedef enum _RF_RADIO_PATH{
|
|||
RF_PATH_B = 1, //Radio Path B
|
||||
RF_PATH_C = 2, //Radio Path C
|
||||
RF_PATH_D = 3, //Radio Path D
|
||||
//RF_PATH_MAX //Max RF number 90 support
|
||||
//RF_PATH_MAX //Max RF number 90 support
|
||||
}RF_RADIO_PATH_E, *PRF_RADIO_PATH_E;
|
||||
|
||||
#define RF_PATH_MAX 2
|
||||
|
@ -122,12 +122,12 @@ typedef enum _RF_RADIO_PATH{
|
|||
|
||||
typedef enum _WIRELESS_MODE {
|
||||
WIRELESS_MODE_UNKNOWN = 0x00,
|
||||
WIRELESS_MODE_A = BIT2,
|
||||
WIRELESS_MODE_B = BIT0,
|
||||
WIRELESS_MODE_G = BIT1,
|
||||
WIRELESS_MODE_AUTO = BIT5,
|
||||
WIRELESS_MODE_N_24G = BIT3,
|
||||
WIRELESS_MODE_N_5G = BIT4,
|
||||
WIRELESS_MODE_A = BIT2,
|
||||
WIRELESS_MODE_B = BIT0,
|
||||
WIRELESS_MODE_G = BIT1,
|
||||
WIRELESS_MODE_AUTO = BIT5,
|
||||
WIRELESS_MODE_N_24G = BIT3,
|
||||
WIRELESS_MODE_N_5G = BIT4,
|
||||
WIRELESS_MODE_AC = BIT6
|
||||
} WIRELESS_MODE;
|
||||
|
||||
|
@ -152,75 +152,75 @@ typedef enum _PHY_Rate_Tx_Power_Offset_Area{
|
|||
typedef enum _RF_TYPE_8190P{
|
||||
RF_TYPE_MIN, // 0
|
||||
RF_8225=1, // 1 11b/g RF for verification only
|
||||
RF_8256=2, // 2 11b/g/n
|
||||
RF_8256=2, // 2 11b/g/n
|
||||
RF_8258=3, // 3 11a/b/g/n RF
|
||||
RF_6052=4, // 4 11b/g/n RF
|
||||
//RF_6052=5, // 4 11b/g/n RF
|
||||
// TODO: We sholud remove this psudo PHY RF after we get new RF.
|
||||
RF_PSEUDO_11N=5, // 5, It is a temporality RF.
|
||||
RF_PSEUDO_11N=5, // 5, It is a temporality RF.
|
||||
}RF_TYPE_8190P_E,*PRF_TYPE_8190P_E;
|
||||
|
||||
|
||||
typedef struct _BB_REGISTER_DEFINITION{
|
||||
u32 rfintfs; // set software control:
|
||||
u32 rfintfs; // set software control:
|
||||
// 0x870~0x877[8 bytes]
|
||||
|
||||
u32 rfintfi; // readback data:
|
||||
|
||||
u32 rfintfi; // readback data:
|
||||
// 0x8e0~0x8e7[8 bytes]
|
||||
|
||||
u32 rfintfo; // output data:
|
||||
|
||||
u32 rfintfo; // output data:
|
||||
// 0x860~0x86f [16 bytes]
|
||||
|
||||
u32 rfintfe; // output enable:
|
||||
|
||||
u32 rfintfe; // output enable:
|
||||
// 0x860~0x86f [16 bytes]
|
||||
|
||||
|
||||
u32 rf3wireOffset; // LSSI data:
|
||||
// 0x840~0x84f [16 bytes]
|
||||
|
||||
u32 rfLSSI_Select; // BB Band Select:
|
||||
|
||||
u32 rfLSSI_Select; // BB Band Select:
|
||||
// 0x878~0x87f [8 bytes]
|
||||
|
||||
u32 rfTxGainStage; // Tx gain stage:
|
||||
|
||||
u32 rfTxGainStage; // Tx gain stage:
|
||||
// 0x80c~0x80f [4 bytes]
|
||||
|
||||
u32 rfHSSIPara1; // wire parameter control1 :
|
||||
|
||||
u32 rfHSSIPara1; // wire parameter control1 :
|
||||
// 0x820~0x823,0x828~0x82b, 0x830~0x833, 0x838~0x83b [16 bytes]
|
||||
|
||||
u32 rfHSSIPara2; // wire parameter control2 :
|
||||
|
||||
u32 rfHSSIPara2; // wire parameter control2 :
|
||||
// 0x824~0x827,0x82c~0x82f, 0x834~0x837, 0x83c~0x83f [16 bytes]
|
||||
|
||||
u32 rfSwitchControl; //Tx Rx antenna control :
|
||||
|
||||
u32 rfSwitchControl; //Tx Rx antenna control :
|
||||
// 0x858~0x85f [16 bytes]
|
||||
|
||||
u32 rfAGCControl1; //AGC parameter control1 :
|
||||
// 0xc50~0xc53,0xc58~0xc5b, 0xc60~0xc63, 0xc68~0xc6b [16 bytes]
|
||||
|
||||
u32 rfAGCControl2; //AGC parameter control2 :
|
||||
// 0xc54~0xc57,0xc5c~0xc5f, 0xc64~0xc67, 0xc6c~0xc6f [16 bytes]
|
||||
|
||||
u32 rfRxIQImbalance; //OFDM Rx IQ imbalance matrix :
|
||||
|
||||
u32 rfAGCControl1; //AGC parameter control1 :
|
||||
// 0xc50~0xc53,0xc58~0xc5b, 0xc60~0xc63, 0xc68~0xc6b [16 bytes]
|
||||
|
||||
u32 rfAGCControl2; //AGC parameter control2 :
|
||||
// 0xc54~0xc57,0xc5c~0xc5f, 0xc64~0xc67, 0xc6c~0xc6f [16 bytes]
|
||||
|
||||
u32 rfRxIQImbalance; //OFDM Rx IQ imbalance matrix :
|
||||
// 0xc14~0xc17,0xc1c~0xc1f, 0xc24~0xc27, 0xc2c~0xc2f [16 bytes]
|
||||
|
||||
u32 rfRxAFE; //Rx IQ DC ofset and Rx digital filter, Rx DC notch filter :
|
||||
|
||||
u32 rfRxAFE; //Rx IQ DC ofset and Rx digital filter, Rx DC notch filter :
|
||||
// 0xc10~0xc13,0xc18~0xc1b, 0xc20~0xc23, 0xc28~0xc2b [16 bytes]
|
||||
|
||||
|
||||
u32 rfTxIQImbalance; //OFDM Tx IQ imbalance matrix
|
||||
// 0xc80~0xc83,0xc88~0xc8b, 0xc90~0xc93, 0xc98~0xc9b [16 bytes]
|
||||
|
||||
u32 rfTxAFE; //Tx IQ DC Offset and Tx DFIR type
|
||||
|
||||
u32 rfTxAFE; //Tx IQ DC Offset and Tx DFIR type
|
||||
// 0xc84~0xc87,0xc8c~0xc8f, 0xc94~0xc97, 0xc9c~0xc9f [16 bytes]
|
||||
|
||||
u32 rfLSSIReadBack; //LSSI RF readback data SI mode
|
||||
|
||||
u32 rfLSSIReadBack; //LSSI RF readback data SI mode
|
||||
// 0x8a0~0x8af [16 bytes]
|
||||
|
||||
u32 rfLSSIReadBackPi; //LSSI RF readback data PI mode 0x8b8-8bc for Path A and B
|
||||
u32 rfLSSIReadBackPi; //LSSI RF readback data PI mode 0x8b8-8bc for Path A and B
|
||||
|
||||
}BB_REGISTER_DEFINITION_T, *PBB_REGISTER_DEFINITION_T;
|
||||
|
||||
typedef struct _R_ANTENNA_SELECT_OFDM{
|
||||
u32 r_tx_antenna:4;
|
||||
typedef struct _R_ANTENNA_SELECT_OFDM{
|
||||
u32 r_tx_antenna:4;
|
||||
u32 r_ant_l:4;
|
||||
u32 r_ant_non_ht:4;
|
||||
u32 r_ant_non_ht:4;
|
||||
u32 r_ant_ht1:4;
|
||||
u32 r_ant_ht2:4;
|
||||
u32 r_ant_ht_s1:4;
|
||||
|
@ -230,12 +230,12 @@ typedef struct _R_ANTENNA_SELECT_OFDM{
|
|||
}R_ANTENNA_SELECT_OFDM;
|
||||
|
||||
typedef struct _R_ANTENNA_SELECT_CCK{
|
||||
u8 r_cckrx_enable_2:2;
|
||||
u8 r_cckrx_enable_2:2;
|
||||
u8 r_cckrx_enable:2;
|
||||
u8 r_ccktx_enable:4;
|
||||
}R_ANTENNA_SELECT_CCK;
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
|
@ -276,7 +276,7 @@ int PHY_BBConfig8192C( IN struct adapter *Adapter );
|
|||
int PHY_RFConfig8192C( IN struct adapter *Adapter );
|
||||
/* RF config */
|
||||
int rtl8192c_PHY_ConfigRFWithParaFile( IN struct adapter *Adapter,
|
||||
IN u8* pFileName,
|
||||
IN u8* pFileName,
|
||||
IN RF_RADIO_PATH_E eRFPath);
|
||||
int rtl8192c_PHY_ConfigRFWithHeaderFile( IN struct adapter * Adapter,
|
||||
IN RF_RADIO_PATH_E eRFPath);
|
||||
|
@ -291,21 +291,21 @@ void rtl8192c_PHY_GetHWRegOriginalValue( IN struct adapter * Adapter );
|
|||
//
|
||||
// RF Power setting
|
||||
//
|
||||
//extern BOOLEAN PHY_SetRFPowerState(IN struct adapter * Adapter,
|
||||
//extern BOOLEAN PHY_SetRFPowerState(IN struct adapter * Adapter,
|
||||
// IN RT_RF_POWER_STATE eRFPowerState);
|
||||
|
||||
//
|
||||
// BB TX Power R/W
|
||||
//
|
||||
void PHY_GetTxPowerLevel8192C( IN struct adapter * Adapter,
|
||||
OUT u32* powerlevel );
|
||||
OUT u32* powerlevel );
|
||||
void PHY_SetTxPowerLevel8192C( IN struct adapter * Adapter,
|
||||
IN u8 channel );
|
||||
BOOLEAN PHY_UpdateTxPowerDbm8192C( IN struct adapter *Adapter,
|
||||
IN int powerInDbm );
|
||||
|
||||
//
|
||||
VOID
|
||||
VOID
|
||||
PHY_ScanOperationBackup8192C(IN struct adapter *Adapter,
|
||||
IN u8 Operation );
|
||||
|
||||
|
@ -342,7 +342,7 @@ void PHY_SwChnlPhy8192C( IN struct adapter * pAdapter,
|
|||
IN u8 channel );
|
||||
|
||||
void ChkFwCmdIoDone( IN struct adapter *Adapter);
|
||||
|
||||
|
||||
//
|
||||
// BB/MAC/RF other monitor API
|
||||
//
|
||||
|
@ -358,7 +358,7 @@ VOID rtl8192c_PHY_SetRFPathSwitch(IN struct adapter *pAdapter, IN BOOLEAN bMain
|
|||
//
|
||||
// Modify the value of the hw register when beacon interval be changed.
|
||||
//
|
||||
void
|
||||
void
|
||||
rtl8192c_PHY_SetBeaconHwReg( IN struct adapter * Adapter,
|
||||
IN u16 BeaconInterval );
|
||||
|
||||
|
@ -376,7 +376,7 @@ PHY_EnableHostClkReq(
|
|||
BOOLEAN
|
||||
SetAntennaConfig92C(
|
||||
IN struct adapter *Adapter,
|
||||
IN u8 DefaultAnt
|
||||
IN u8 DefaultAnt
|
||||
);
|
||||
|
||||
#ifdef RTL8192C_RECONFIG_TO_1T1R
|
||||
|
@ -393,4 +393,3 @@ extern void PHY_Reconfig_To_1T1R(struct adapter *padapter);
|
|||
#define PHY_QueryMacReg PHY_QueryBBReg
|
||||
|
||||
#endif // __INC_HAL8192CPHYCFG_H
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -27,18 +27,18 @@
|
|||
* 3. PMAC/BB register bit mask.
|
||||
* 4. RF reg bit mask.
|
||||
* 5. Other BB/RF relative definition.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Export: Constants, macro, functions(API), global variables(None).
|
||||
*
|
||||
* Abbrev:
|
||||
* Abbrev:
|
||||
*
|
||||
* History:
|
||||
* Data Who Remark
|
||||
* 08/07/2007 MHC 1. Porting from 9x series PHYCFG.h.
|
||||
* Data Who Remark
|
||||
* 08/07/2007 MHC 1. Porting from 9x series PHYCFG.h.
|
||||
* 2. Reorganize code architecture.
|
||||
* 09/25/2008 MH 1. Add RL6052 register definition
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __INC_HAL8192CPHYREG_H
|
||||
#define __INC_HAL8192CPHYREG_H
|
||||
|
@ -179,8 +179,8 @@
|
|||
#define rCCK0_AFESetting 0xa04 // Disable init gain now // Select RX path by RSSI
|
||||
#define rCCK0_CCA 0xa08 // Disable init gain now // Init gain
|
||||
|
||||
#define rCCK0_RxAGC1 0xa0c //AGC default value, saturation level // Antenna Diversity, RX AGC, LNA Threshold, RX LNA Threshold useless now. Not the same as 90 series
|
||||
#define rCCK0_RxAGC2 0xa10 //AGC & DAGC
|
||||
#define rCCK0_RxAGC1 0xa0c //AGC default value, saturation level // Antenna Diversity, RX AGC, LNA Threshold, RX LNA Threshold useless now. Not the same as 90 series
|
||||
#define rCCK0_RxAGC2 0xa10 //AGC & DAGC
|
||||
|
||||
#define rCCK0_RxHP 0xa14
|
||||
|
||||
|
@ -191,20 +191,20 @@
|
|||
#define rCCK0_TxFilter2 0xa24
|
||||
#define rCCK0_DebugPort 0xa28 //debug port and Tx filter3
|
||||
#define rCCK0_FalseAlarmReport 0xa2c //0xa2d useless now 0xa30-a4f channel report
|
||||
#define rCCK0_TRSSIReport 0xa50
|
||||
#define rCCK0_RxReport 0xa54 //0xa57
|
||||
#define rCCK0_FACounterLower 0xa5c //0xa5b
|
||||
#define rCCK0_FACounterUpper 0xa58 //0xa5c
|
||||
#define rCCK0_TRSSIReport 0xa50
|
||||
#define rCCK0_RxReport 0xa54 //0xa57
|
||||
#define rCCK0_FACounterLower 0xa5c //0xa5b
|
||||
#define rCCK0_FACounterUpper 0xa58 //0xa5c
|
||||
//
|
||||
// PageB(0xB00)
|
||||
//
|
||||
#define rPdp_AntA 0xb00
|
||||
#define rPdp_AntA_4 0xb04
|
||||
#define rConfig_Pmpd_AntA 0xb28
|
||||
#define rConfig_AntA 0xb68
|
||||
#define rConfig_AntB 0xb6c
|
||||
#define rPdp_AntB 0xb70
|
||||
#define rPdp_AntB_4 0xb74
|
||||
#define rPdp_AntA 0xb00
|
||||
#define rPdp_AntA_4 0xb04
|
||||
#define rConfig_Pmpd_AntA 0xb28
|
||||
#define rConfig_AntA 0xb68
|
||||
#define rConfig_AntB 0xb6c
|
||||
#define rPdp_AntB 0xb70
|
||||
#define rPdp_AntB_4 0xb74
|
||||
#define rConfig_Pmpd_AntB 0xb98
|
||||
#define rAPK 0xbd8
|
||||
|
||||
|
@ -218,16 +218,16 @@
|
|||
#define rOFDM0_TRSWIsolation 0xc0c
|
||||
|
||||
#define rOFDM0_XARxAFE 0xc10 //RxIQ DC offset, Rx digital filter, DC notch filter
|
||||
#define rOFDM0_XARxIQImbalance 0xc14 //RxIQ imblance matrix
|
||||
#define rOFDM0_XBRxAFE 0xc18
|
||||
#define rOFDM0_XBRxIQImbalance 0xc1c
|
||||
#define rOFDM0_XCRxAFE 0xc20
|
||||
#define rOFDM0_XCRxIQImbalance 0xc24
|
||||
#define rOFDM0_XDRxAFE 0xc28
|
||||
#define rOFDM0_XDRxIQImbalance 0xc2c
|
||||
#define rOFDM0_XARxIQImbalance 0xc14 //RxIQ imblance matrix
|
||||
#define rOFDM0_XBRxAFE 0xc18
|
||||
#define rOFDM0_XBRxIQImbalance 0xc1c
|
||||
#define rOFDM0_XCRxAFE 0xc20
|
||||
#define rOFDM0_XCRxIQImbalance 0xc24
|
||||
#define rOFDM0_XDRxAFE 0xc28
|
||||
#define rOFDM0_XDRxIQImbalance 0xc2c
|
||||
|
||||
#define rOFDM0_RxDetector1 0xc30 //PD,BW & SBD // DM tune init gain
|
||||
#define rOFDM0_RxDetector2 0xc34 //SBD & Fame Sync.
|
||||
#define rOFDM0_RxDetector2 0xc34 //SBD & Fame Sync.
|
||||
#define rOFDM0_RxDetector3 0xc38 //Frame Sync.
|
||||
#define rOFDM0_RxDetector4 0xc3c //PD, SBD, Frame Sync & Short-GI
|
||||
|
||||
|
@ -255,7 +255,7 @@
|
|||
#define rOFDM0_XBTxIQImbalance 0xc88
|
||||
#define rOFDM0_XBTxAFE 0xc8c
|
||||
#define rOFDM0_XCTxIQImbalance 0xc90
|
||||
#define rOFDM0_XCTxAFE 0xc94
|
||||
#define rOFDM0_XCTxAFE 0xc94
|
||||
#define rOFDM0_XDTxIQImbalance 0xc98
|
||||
#define rOFDM0_XDTxAFE 0xc9c
|
||||
|
||||
|
@ -298,8 +298,8 @@
|
|||
#define rOFDM_LongCFOCD 0xdb8
|
||||
#define rOFDM_TailCFOAB 0xdbc
|
||||
#define rOFDM_TailCFOCD 0xdc0
|
||||
#define rOFDM_PWMeasure1 0xdc4
|
||||
#define rOFDM_PWMeasure2 0xdc8
|
||||
#define rOFDM_PWMeasure1 0xdc4
|
||||
#define rOFDM_PWMeasure2 0xdc8
|
||||
#define rOFDM_BWReport 0xdcc
|
||||
#define rOFDM_AGCReport 0xdd0
|
||||
#define rOFDM_RxSNR 0xdd4
|
||||
|
@ -324,7 +324,7 @@
|
|||
#define rTx_IQK_PI_A 0xe38
|
||||
#define rRx_IQK_PI_A 0xe3c
|
||||
|
||||
#define rTx_IQK 0xe40
|
||||
#define rTx_IQK 0xe40
|
||||
#define rRx_IQK 0xe44
|
||||
#define rIQK_AGC_Pts 0xe48
|
||||
#define rIQK_AGC_Rsp 0xe4c
|
||||
|
@ -361,10 +361,10 @@
|
|||
#define rRx_Power_After_IQK_B_2 0xecc
|
||||
|
||||
#define rRx_OFDM 0xed0
|
||||
#define rRx_Wait_RIFS 0xed4
|
||||
#define rRx_TO_Rx 0xed8
|
||||
#define rStandby 0xedc
|
||||
#define rSleep 0xee0
|
||||
#define rRx_Wait_RIFS 0xed4
|
||||
#define rRx_TO_Rx 0xed8
|
||||
#define rStandby 0xedc
|
||||
#define rSleep 0xee0
|
||||
#define rPMPD_ANAEN 0xeec
|
||||
|
||||
//
|
||||
|
@ -398,56 +398,56 @@
|
|||
//
|
||||
// RL6052 Register definition
|
||||
//
|
||||
#define RF_AC 0x00 //
|
||||
#define RF_AC 0x00 //
|
||||
|
||||
#define RF_IQADJ_G1 0x01 //
|
||||
#define RF_IQADJ_G2 0x02 //
|
||||
#define RF_IQADJ_G1 0x01 //
|
||||
#define RF_IQADJ_G2 0x02 //
|
||||
#define RF_BS_PA_APSET_G1_G4 0x03
|
||||
#define RF_BS_PA_APSET_G5_G8 0x04
|
||||
#define RF_POW_TRSW 0x05 //
|
||||
#define RF_POW_TRSW 0x05 //
|
||||
|
||||
#define RF_GAIN_RX 0x06 //
|
||||
#define RF_GAIN_TX 0x07 //
|
||||
#define RF_GAIN_RX 0x06 //
|
||||
#define RF_GAIN_TX 0x07 //
|
||||
|
||||
#define RF_TXM_IDAC 0x08 //
|
||||
#define RF_IPA_G 0x09 //
|
||||
#define RF_TXM_IDAC 0x08 //
|
||||
#define RF_IPA_G 0x09 //
|
||||
#define RF_TXBIAS_G 0x0A
|
||||
#define RF_TXPA_AG 0x0B
|
||||
#define RF_IPA_A 0x0C //
|
||||
#define RF_IPA_A 0x0C //
|
||||
#define RF_TXBIAS_A 0x0D
|
||||
#define RF_BS_PA_APSET_G9_G11 0x0E
|
||||
#define RF_BS_IQGEN 0x0F //
|
||||
#define RF_BS_IQGEN 0x0F //
|
||||
|
||||
#define RF_MODE1 0x10 //
|
||||
#define RF_MODE2 0x11 //
|
||||
#define RF_MODE1 0x10 //
|
||||
#define RF_MODE2 0x11 //
|
||||
|
||||
#define RF_RX_AGC_HP 0x12 //
|
||||
#define RF_TX_AGC 0x13 //
|
||||
#define RF_BIAS 0x14 //
|
||||
#define RF_IPA 0x15 //
|
||||
#define RF_RX_AGC_HP 0x12 //
|
||||
#define RF_TX_AGC 0x13 //
|
||||
#define RF_BIAS 0x14 //
|
||||
#define RF_IPA 0x15 //
|
||||
#define RF_TXBIAS 0x16 //
|
||||
#define RF_POW_ABILITY 0x17 //
|
||||
#define RF_MODE_AG 0x18 //
|
||||
#define RF_POW_ABILITY 0x17 //
|
||||
#define RF_MODE_AG 0x18 //
|
||||
#define rRfChannel 0x18 // RF channel and BW switch
|
||||
#define RF_CHNLBW 0x18 // RF channel and BW switch
|
||||
#define RF_TOP 0x19 //
|
||||
#define RF_TOP 0x19 //
|
||||
|
||||
#define RF_RX_G1 0x1A //
|
||||
#define RF_RX_G2 0x1B //
|
||||
#define RF_RX_G1 0x1A //
|
||||
#define RF_RX_G2 0x1B //
|
||||
|
||||
#define RF_RX_BB2 0x1C //
|
||||
#define RF_RX_BB1 0x1D //
|
||||
#define RF_RX_BB2 0x1C //
|
||||
#define RF_RX_BB1 0x1D //
|
||||
|
||||
#define RF_RCK1 0x1E //
|
||||
#define RF_RCK2 0x1F //
|
||||
#define RF_RCK1 0x1E //
|
||||
#define RF_RCK2 0x1F //
|
||||
|
||||
#define RF_TX_G1 0x20 //
|
||||
#define RF_TX_G2 0x21 //
|
||||
#define RF_TX_G3 0x22 //
|
||||
#define RF_TX_G1 0x20 //
|
||||
#define RF_TX_G2 0x21 //
|
||||
#define RF_TX_G3 0x22 //
|
||||
|
||||
#define RF_TX_BB1 0x23 //
|
||||
#define RF_TX_BB1 0x23 //
|
||||
|
||||
#define RF_T_METER 0x24 //
|
||||
#define RF_T_METER 0x24 //
|
||||
|
||||
#define RF_SYN_G1 0x25 // RF TX Power control
|
||||
#define RF_SYN_G2 0x26 // RF TX Power control
|
||||
|
@ -513,7 +513,7 @@
|
|||
#define bCCKTxStatus 0x1
|
||||
#define bOFDMTxStatus 0x2
|
||||
|
||||
#define IS_BB_REG_OFFSET_92S(_Offset) ((_Offset >= 0x800) && (_Offset <= 0xfff))
|
||||
#define IS_BB_REG_OFFSET_92S(_Offset) ((_Offset >= 0x800) && (_Offset <= 0xfff))
|
||||
|
||||
// 2. Page8(0x800)
|
||||
#define bRFMOD 0x1 // Reg 0x800 rFPGA0_RFMOD
|
||||
|
@ -522,157 +522,157 @@
|
|||
#define bCCKEn 0x1000000
|
||||
#define bOFDMEn 0x2000000
|
||||
|
||||
#define bOFDMRxADCPhase 0x10000 // Useless now
|
||||
#define bOFDMTxDACPhase 0x40000
|
||||
#define bXATxAGC 0x3f
|
||||
#define bOFDMRxADCPhase 0x10000 // Useless now
|
||||
#define bOFDMTxDACPhase 0x40000
|
||||
#define bXATxAGC 0x3f
|
||||
|
||||
#define bAntennaSelect 0x0300
|
||||
#define bAntennaSelect 0x0300
|
||||
|
||||
#define bXBTxAGC 0xf00 // Reg 80c rFPGA0_TxGainStage
|
||||
#define bXCTxAGC 0xf000
|
||||
#define bXDTxAGC 0xf0000
|
||||
|
||||
#define bPAStart 0xf0000000 // Useless now
|
||||
#define bTRStart 0x00f00000
|
||||
#define bRFStart 0x0000f000
|
||||
#define bBBStart 0x000000f0
|
||||
#define bBBCCKStart 0x0000000f
|
||||
#define bPAEnd 0xf //Reg0x814
|
||||
#define bTREnd 0x0f000000
|
||||
#define bRFEnd 0x000f0000
|
||||
#define bCCAMask 0x000000f0 //T2R
|
||||
#define bR2RCCAMask 0x00000f00
|
||||
#define bHSSI_R2TDelay 0xf8000000
|
||||
#define bHSSI_T2RDelay 0xf80000
|
||||
#define bContTxHSSI 0x400 //chane gain at continue Tx
|
||||
#define bIGFromCCK 0x200
|
||||
#define bAGCAddress 0x3f
|
||||
#define bRxHPTx 0x7000
|
||||
#define bRxHPT2R 0x38000
|
||||
#define bRxHPCCKIni 0xc0000
|
||||
#define bAGCTxCode 0xc00000
|
||||
#define bAGCRxCode 0x300000
|
||||
#define bXBTxAGC 0xf00 // Reg 80c rFPGA0_TxGainStage
|
||||
#define bXCTxAGC 0xf000
|
||||
#define bXDTxAGC 0xf0000
|
||||
|
||||
#define b3WireDataLength 0x800 // Reg 0x820~84f rFPGA0_XA_HSSIParameter1
|
||||
#define b3WireAddressLength 0x400
|
||||
#define bPAStart 0xf0000000 // Useless now
|
||||
#define bTRStart 0x00f00000
|
||||
#define bRFStart 0x0000f000
|
||||
#define bBBStart 0x000000f0
|
||||
#define bBBCCKStart 0x0000000f
|
||||
#define bPAEnd 0xf //Reg0x814
|
||||
#define bTREnd 0x0f000000
|
||||
#define bRFEnd 0x000f0000
|
||||
#define bCCAMask 0x000000f0 //T2R
|
||||
#define bR2RCCAMask 0x00000f00
|
||||
#define bHSSI_R2TDelay 0xf8000000
|
||||
#define bHSSI_T2RDelay 0xf80000
|
||||
#define bContTxHSSI 0x400 //chane gain at continue Tx
|
||||
#define bIGFromCCK 0x200
|
||||
#define bAGCAddress 0x3f
|
||||
#define bRxHPTx 0x7000
|
||||
#define bRxHPT2R 0x38000
|
||||
#define bRxHPCCKIni 0xc0000
|
||||
#define bAGCTxCode 0xc00000
|
||||
#define bAGCRxCode 0x300000
|
||||
|
||||
#define b3WireRFPowerDown 0x1 // Useless now
|
||||
//#define bHWSISelect 0x8
|
||||
#define b5GPAPEPolarity 0x40000000
|
||||
#define b2GPAPEPolarity 0x80000000
|
||||
#define bRFSW_TxDefaultAnt 0x3
|
||||
#define bRFSW_TxOptionAnt 0x30
|
||||
#define bRFSW_RxDefaultAnt 0x300
|
||||
#define bRFSW_RxOptionAnt 0x3000
|
||||
#define bRFSI_3WireData 0x1
|
||||
#define bRFSI_3WireClock 0x2
|
||||
#define bRFSI_3WireLoad 0x4
|
||||
#define bRFSI_3WireRW 0x8
|
||||
#define bRFSI_3Wire 0xf
|
||||
#define b3WireDataLength 0x800 // Reg 0x820~84f rFPGA0_XA_HSSIParameter1
|
||||
#define b3WireAddressLength 0x400
|
||||
|
||||
#define bRFSI_RFENV 0x10 // Reg 0x870 rFPGA0_XAB_RFInterfaceSW
|
||||
#define b3WireRFPowerDown 0x1 // Useless now
|
||||
//#define bHWSISelect 0x8
|
||||
#define b5GPAPEPolarity 0x40000000
|
||||
#define b2GPAPEPolarity 0x80000000
|
||||
#define bRFSW_TxDefaultAnt 0x3
|
||||
#define bRFSW_TxOptionAnt 0x30
|
||||
#define bRFSW_RxDefaultAnt 0x300
|
||||
#define bRFSW_RxOptionAnt 0x3000
|
||||
#define bRFSI_3WireData 0x1
|
||||
#define bRFSI_3WireClock 0x2
|
||||
#define bRFSI_3WireLoad 0x4
|
||||
#define bRFSI_3WireRW 0x8
|
||||
#define bRFSI_3Wire 0xf
|
||||
|
||||
#define bRFSI_TRSW 0x20 // Useless now
|
||||
#define bRFSI_TRSWB 0x40
|
||||
#define bRFSI_ANTSW 0x100
|
||||
#define bRFSI_ANTSWB 0x200
|
||||
#define bRFSI_PAPE 0x400
|
||||
#define bRFSI_PAPE5G 0x800
|
||||
#define bBandSelect 0x1
|
||||
#define bHTSIG2_GI 0x80
|
||||
#define bHTSIG2_Smoothing 0x01
|
||||
#define bHTSIG2_Sounding 0x02
|
||||
#define bHTSIG2_Aggreaton 0x08
|
||||
#define bHTSIG2_STBC 0x30
|
||||
#define bHTSIG2_AdvCoding 0x40
|
||||
#define bHTSIG2_NumOfHTLTF 0x300
|
||||
#define bHTSIG2_CRC8 0x3fc
|
||||
#define bHTSIG1_MCS 0x7f
|
||||
#define bHTSIG1_BandWidth 0x80
|
||||
#define bHTSIG1_HTLength 0xffff
|
||||
#define bLSIG_Rate 0xf
|
||||
#define bLSIG_Reserved 0x10
|
||||
#define bLSIG_Length 0x1fffe
|
||||
#define bLSIG_Parity 0x20
|
||||
#define bCCKRxPhase 0x4
|
||||
#define bRFSI_RFENV 0x10 // Reg 0x870 rFPGA0_XAB_RFInterfaceSW
|
||||
|
||||
#define bLSSIReadAddress 0x7f800000 // T65 RF
|
||||
#define bRFSI_TRSW 0x20 // Useless now
|
||||
#define bRFSI_TRSWB 0x40
|
||||
#define bRFSI_ANTSW 0x100
|
||||
#define bRFSI_ANTSWB 0x200
|
||||
#define bRFSI_PAPE 0x400
|
||||
#define bRFSI_PAPE5G 0x800
|
||||
#define bBandSelect 0x1
|
||||
#define bHTSIG2_GI 0x80
|
||||
#define bHTSIG2_Smoothing 0x01
|
||||
#define bHTSIG2_Sounding 0x02
|
||||
#define bHTSIG2_Aggreaton 0x08
|
||||
#define bHTSIG2_STBC 0x30
|
||||
#define bHTSIG2_AdvCoding 0x40
|
||||
#define bHTSIG2_NumOfHTLTF 0x300
|
||||
#define bHTSIG2_CRC8 0x3fc
|
||||
#define bHTSIG1_MCS 0x7f
|
||||
#define bHTSIG1_BandWidth 0x80
|
||||
#define bHTSIG1_HTLength 0xffff
|
||||
#define bLSIG_Rate 0xf
|
||||
#define bLSIG_Reserved 0x10
|
||||
#define bLSIG_Length 0x1fffe
|
||||
#define bLSIG_Parity 0x20
|
||||
#define bCCKRxPhase 0x4
|
||||
|
||||
#define bLSSIReadEdge 0x80000000 //LSSI "Read" edge signal
|
||||
#define bLSSIReadAddress 0x7f800000 // T65 RF
|
||||
|
||||
#define bLSSIReadBackData 0xfffff // T65 RF
|
||||
#define bLSSIReadEdge 0x80000000 //LSSI "Read" edge signal
|
||||
|
||||
#define bLSSIReadOKFlag 0x1000 // Useless now
|
||||
#define bCCKSampleRate 0x8 //0: 44MHz, 1:88MHz
|
||||
#define bRegulator0Standby 0x1
|
||||
#define bRegulatorPLLStandby 0x2
|
||||
#define bRegulator1Standby 0x4
|
||||
#define bPLLPowerUp 0x8
|
||||
#define bDPLLPowerUp 0x10
|
||||
#define bDA10PowerUp 0x20
|
||||
#define bAD7PowerUp 0x200
|
||||
#define bDA6PowerUp 0x2000
|
||||
#define bXtalPowerUp 0x4000
|
||||
#define b40MDClkPowerUP 0x8000
|
||||
#define bDA6DebugMode 0x20000
|
||||
#define bDA6Swing 0x380000
|
||||
#define bLSSIReadBackData 0xfffff // T65 RF
|
||||
|
||||
#define bADClkPhase 0x4000000 // Reg 0x880 rFPGA0_AnalogParameter1 20/40 CCK support switch 40/80 BB MHZ
|
||||
#define bLSSIReadOKFlag 0x1000 // Useless now
|
||||
#define bCCKSampleRate 0x8 //0: 44MHz, 1:88MHz
|
||||
#define bRegulator0Standby 0x1
|
||||
#define bRegulatorPLLStandby 0x2
|
||||
#define bRegulator1Standby 0x4
|
||||
#define bPLLPowerUp 0x8
|
||||
#define bDPLLPowerUp 0x10
|
||||
#define bDA10PowerUp 0x20
|
||||
#define bAD7PowerUp 0x200
|
||||
#define bDA6PowerUp 0x2000
|
||||
#define bXtalPowerUp 0x4000
|
||||
#define b40MDClkPowerUP 0x8000
|
||||
#define bDA6DebugMode 0x20000
|
||||
#define bDA6Swing 0x380000
|
||||
|
||||
#define b80MClkDelay 0x18000000 // Useless
|
||||
#define bAFEWatchDogEnable 0x20000000
|
||||
#define bADClkPhase 0x4000000 // Reg 0x880 rFPGA0_AnalogParameter1 20/40 CCK support switch 40/80 BB MHZ
|
||||
|
||||
#define bXtalCap01 0xc0000000 // Reg 0x884 rFPGA0_AnalogParameter2 Crystal cap
|
||||
#define bXtalCap23 0x3
|
||||
#define b80MClkDelay 0x18000000 // Useless
|
||||
#define bAFEWatchDogEnable 0x20000000
|
||||
|
||||
#define bXtalCap01 0xc0000000 // Reg 0x884 rFPGA0_AnalogParameter2 Crystal cap
|
||||
#define bXtalCap23 0x3
|
||||
#define bXtalCap92x 0x0f000000
|
||||
#define bXtalCap 0x0f000000
|
||||
#define bXtalCap 0x0f000000
|
||||
|
||||
#define bIntDifClkEnable 0x400 // Useless
|
||||
#define bExtSigClkEnable 0x800
|
||||
#define bBandgapMbiasPowerUp 0x10000
|
||||
#define bAD11SHGain 0xc0000
|
||||
#define bAD11InputRange 0x700000
|
||||
#define bAD11OPCurrent 0x3800000
|
||||
#define bIPathLoopback 0x4000000
|
||||
#define bQPathLoopback 0x8000000
|
||||
#define bAFELoopback 0x10000000
|
||||
#define bDA10Swing 0x7e0
|
||||
#define bDA10Reverse 0x800
|
||||
#define bDAClkSource 0x1000
|
||||
#define bAD7InputRange 0x6000
|
||||
#define bAD7Gain 0x38000
|
||||
#define bAD7OutputCMMode 0x40000
|
||||
#define bAD7InputCMMode 0x380000
|
||||
#define bAD7Current 0xc00000
|
||||
#define bRegulatorAdjust 0x7000000
|
||||
#define bAD11PowerUpAtTx 0x1
|
||||
#define bDA10PSAtTx 0x10
|
||||
#define bAD11PowerUpAtRx 0x100
|
||||
#define bDA10PSAtRx 0x1000
|
||||
#define bCCKRxAGCFormat 0x200
|
||||
#define bPSDFFTSamplepPoint 0xc000
|
||||
#define bPSDAverageNum 0x3000
|
||||
#define bIQPathControl 0xc00
|
||||
#define bPSDFreq 0x3ff
|
||||
#define bPSDAntennaPath 0x30
|
||||
#define bPSDIQSwitch 0x40
|
||||
#define bPSDRxTrigger 0x400000
|
||||
#define bPSDTxTrigger 0x80000000
|
||||
#define bPSDSineToneScale 0x7f000000
|
||||
#define bPSDReport 0xffff
|
||||
#define bIntDifClkEnable 0x400 // Useless
|
||||
#define bExtSigClkEnable 0x800
|
||||
#define bBandgapMbiasPowerUp 0x10000
|
||||
#define bAD11SHGain 0xc0000
|
||||
#define bAD11InputRange 0x700000
|
||||
#define bAD11OPCurrent 0x3800000
|
||||
#define bIPathLoopback 0x4000000
|
||||
#define bQPathLoopback 0x8000000
|
||||
#define bAFELoopback 0x10000000
|
||||
#define bDA10Swing 0x7e0
|
||||
#define bDA10Reverse 0x800
|
||||
#define bDAClkSource 0x1000
|
||||
#define bAD7InputRange 0x6000
|
||||
#define bAD7Gain 0x38000
|
||||
#define bAD7OutputCMMode 0x40000
|
||||
#define bAD7InputCMMode 0x380000
|
||||
#define bAD7Current 0xc00000
|
||||
#define bRegulatorAdjust 0x7000000
|
||||
#define bAD11PowerUpAtTx 0x1
|
||||
#define bDA10PSAtTx 0x10
|
||||
#define bAD11PowerUpAtRx 0x100
|
||||
#define bDA10PSAtRx 0x1000
|
||||
#define bCCKRxAGCFormat 0x200
|
||||
#define bPSDFFTSamplepPoint 0xc000
|
||||
#define bPSDAverageNum 0x3000
|
||||
#define bIQPathControl 0xc00
|
||||
#define bPSDFreq 0x3ff
|
||||
#define bPSDAntennaPath 0x30
|
||||
#define bPSDIQSwitch 0x40
|
||||
#define bPSDRxTrigger 0x400000
|
||||
#define bPSDTxTrigger 0x80000000
|
||||
#define bPSDSineToneScale 0x7f000000
|
||||
#define bPSDReport 0xffff
|
||||
|
||||
// 3. Page9(0x900)
|
||||
#define bOFDMTxSC 0x30000000 // Useless
|
||||
#define bCCKTxOn 0x1
|
||||
#define bOFDMTxOn 0x2
|
||||
#define bDebugPage 0xfff //reset debug page and also HWord, LWord
|
||||
#define bDebugItem 0xff //reset debug page and LWord
|
||||
#define bAntL 0x10
|
||||
#define bAntNonHT 0x100
|
||||
#define bAntHT1 0x1000
|
||||
#define bAntHT2 0x10000
|
||||
#define bAntHT1S1 0x100000
|
||||
#define bAntNonHTS1 0x1000000
|
||||
#define bOFDMTxSC 0x30000000 // Useless
|
||||
#define bCCKTxOn 0x1
|
||||
#define bOFDMTxOn 0x2
|
||||
#define bDebugPage 0xfff //reset debug page and also HWord, LWord
|
||||
#define bDebugItem 0xff //reset debug page and LWord
|
||||
#define bAntL 0x10
|
||||
#define bAntNonHT 0x100
|
||||
#define bAntHT1 0x1000
|
||||
#define bAntHT2 0x10000
|
||||
#define bAntHT1S1 0x100000
|
||||
#define bAntNonHTS1 0x1000000
|
||||
|
||||
// 4. PageA(0xA00)
|
||||
#define bCCKBBMode 0x3 // Useless
|
||||
|
@ -716,7 +716,7 @@
|
|||
#define bCCKRxAGCSatCount 0xe0
|
||||
#define bCCKRxRFSettle 0x1f //AGCsamp_dly
|
||||
#define bCCKFixedRxAGC 0x8000
|
||||
//#define bCCKRxAGCFormat 0x4000 //remove to HSSI register 0x824
|
||||
//#define bCCKRxAGCFormat 0x4000 //remove to HSSI register 0x824
|
||||
#define bCCKAntennaPolarity 0x2000
|
||||
#define bCCKTxFilterType 0x0c00
|
||||
#define bCCKRxAGCReportType 0x0300
|
||||
|
@ -748,9 +748,9 @@
|
|||
#define bCCKRxFACounterLower 0xff
|
||||
#define bCCKRxFACounterUpper 0xff000000
|
||||
#define bCCKRxHPAGCStart 0xe000
|
||||
#define bCCKRxHPAGCFinal 0x1c00
|
||||
#define bCCKRxHPAGCFinal 0x1c00
|
||||
#define bCCKRxFalseAlarmEnable 0x8000
|
||||
#define bCCKFACounterFreeze 0x4000
|
||||
#define bCCKFACounterFreeze 0x4000
|
||||
#define bCCKTxPathSel 0x10000000
|
||||
#define bCCKDefaultRxPath 0xc000000
|
||||
#define bCCKOptionRxPath 0x3000000
|
||||
|
@ -902,16 +902,16 @@
|
|||
#define bRxSGI_TH 0xc0000000
|
||||
#define bDFSCnt0 0xff
|
||||
#define bDFSCnt1 0xff00
|
||||
#define bDFSFlag 0xf0000
|
||||
#define bDFSFlag 0xf0000
|
||||
#define bMFWeightSum 0x300000
|
||||
#define bMinIdxTH 0x7f000000
|
||||
#define bDAFormat 0x40000
|
||||
#define bTxChEmuEnable 0x01000000
|
||||
#define bMinIdxTH 0x7f000000
|
||||
#define bDAFormat 0x40000
|
||||
#define bTxChEmuEnable 0x01000000
|
||||
#define bTRSWIsolation_A 0x7f
|
||||
#define bTRSWIsolation_B 0x7f00
|
||||
#define bTRSWIsolation_C 0x7f0000
|
||||
#define bTRSWIsolation_D 0x7f000000
|
||||
#define bExtLNAGain 0x7c00
|
||||
#define bTRSWIsolation_D 0x7f000000
|
||||
#define bExtLNAGain 0x7c00
|
||||
|
||||
// 6. PageE(0xE00)
|
||||
#define bSTBCEn 0x4 // Useless
|
||||
|
@ -948,7 +948,7 @@
|
|||
#define bLongCFOFLength 11
|
||||
#define bTailCFO 0x1fff
|
||||
#define bTailCFOTLength 13
|
||||
#define bTailCFOFLength 12
|
||||
#define bTailCFOFLength 12
|
||||
#define bmax_en_pwdB 0xffff
|
||||
#define bCC_power_dB 0xffff0000
|
||||
#define bnoise_pwdB 0xffff
|
||||
|
@ -956,27 +956,27 @@
|
|||
#define bPowerMeasFLength 3
|
||||
#define bRx_HT_BW 0x1
|
||||
#define bRxSC 0x6
|
||||
#define bRx_HT 0x8
|
||||
#define bRx_HT 0x8
|
||||
#define bNB_intf_det_on 0x1
|
||||
#define bIntf_win_len_cfg 0x30
|
||||
#define bNB_Intf_TH_cfg 0x1c0
|
||||
#define bNB_Intf_TH_cfg 0x1c0
|
||||
#define bRFGain 0x3f
|
||||
#define bTableSel 0x40
|
||||
#define bTRSW 0x80
|
||||
#define bTRSW 0x80
|
||||
#define bRxSNR_A 0xff
|
||||
#define bRxSNR_B 0xff00
|
||||
#define bRxSNR_C 0xff0000
|
||||
#define bRxSNR_D 0xff000000
|
||||
#define bSNREVMTLength 8
|
||||
#define bSNREVMFLength 1
|
||||
#define bSNREVMFLength 1
|
||||
#define bCSI1st 0xff
|
||||
#define bCSI2nd 0xff00
|
||||
#define bRxEVM1st 0xff0000
|
||||
#define bRxEVM2nd 0xff000000
|
||||
#define bRxEVM2nd 0xff000000
|
||||
#define bSIGEVM 0xff
|
||||
#define bPWDB 0xff00
|
||||
#define bSGIEN 0x10000
|
||||
|
||||
|
||||
#define bSFactorQAM1 0xf // Useless
|
||||
#define bSFactorQAM2 0xf0
|
||||
#define bSFactorQAM3 0xf00
|
||||
|
@ -987,7 +987,7 @@
|
|||
#define bSFactorQAM8 0xf000000
|
||||
#define bSFactorQAM9 0xf0000000
|
||||
#define bCSIScheme 0x100000
|
||||
|
||||
|
||||
#define bNoiseLvlTopSet 0x3 // Useless
|
||||
#define bChSmooth 0x4
|
||||
#define bChSmoothCfg1 0x38
|
||||
|
@ -996,7 +996,7 @@
|
|||
#define bChSmoothCfg4 0x7000
|
||||
#define bMRCMode 0x800000
|
||||
#define bTHEVMCfg 0x7000000
|
||||
|
||||
|
||||
#define bLoopFitType 0x1 // Useless
|
||||
#define bUpdCFO 0x40
|
||||
#define bUpdCFOOffData 0x80
|
||||
|
@ -1070,24 +1070,24 @@
|
|||
#define bMaskLWord 0x0000ffff
|
||||
#define bMaskDWord 0xffffffff
|
||||
#define bMask12Bits 0xfff
|
||||
#define bMaskH4Bits 0xf0000000
|
||||
#define bMaskH4Bits 0xf0000000
|
||||
#define bMaskOFDM_D 0xffc00000
|
||||
#define bMaskCCK 0x3f3f3f3f
|
||||
|
||||
//for PutRFRegsetting & GetRFRegSetting BitMask
|
||||
//#define bMask12Bits 0xfffff // RF Reg mask bits
|
||||
//#define bMask20Bits 0xfffff // RF Reg mask bits T65 RF
|
||||
#define bRFRegOffsetMask 0xfffff
|
||||
|
||||
#define bRFRegOffsetMask 0xfffff
|
||||
|
||||
#define bEnable 0x1 // Useless
|
||||
#define bDisable 0x0
|
||||
|
||||
|
||||
#define LeftAntenna 0x0 // Useless
|
||||
#define RightAntenna 0x1
|
||||
|
||||
|
||||
#define tCheckTxStatus 500 //500ms // Useless
|
||||
#define tUpdateRxCounter 100 //100ms
|
||||
|
||||
|
||||
#define rateCCK 0 // Useless
|
||||
#define rateOFDM 1
|
||||
#define rateHT 2
|
||||
|
@ -1110,7 +1110,7 @@
|
|||
#define bPMACControl 0x0 // Useless
|
||||
#define bWMACControl 0x1
|
||||
#define bWNICControl 0x2
|
||||
|
||||
|
||||
#define PathA 0x0 // Useless
|
||||
#define PathB 0x1
|
||||
#define PathC 0x2
|
||||
|
@ -1120,4 +1120,3 @@
|
|||
|
||||
|
||||
#endif //__INC_HAL8192SPHYREG_H
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -22,18 +22,18 @@
|
|||
* Module: __INC_HAL8192DPHYCFG_H
|
||||
*
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
*
|
||||
* Export: Constants, macro, functions(API), global variables(None).
|
||||
*
|
||||
* Abbrev:
|
||||
* Abbrev:
|
||||
*
|
||||
* History:
|
||||
* Data Who Remark
|
||||
* 08/07/2007 MHC 1. Porting from 9x series PHYCFG.h.
|
||||
* Data Who Remark
|
||||
* 08/07/2007 MHC 1. Porting from 9x series PHYCFG.h.
|
||||
* 2. Reorganize code architecture.
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
/* Check to see if the file has been included already. */
|
||||
#ifndef __INC_HAL8192DPHYCFG_H
|
||||
|
@ -74,7 +74,7 @@
|
|||
/*--------------------------Define Parameters-------------------------------*/
|
||||
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
typedef enum _SwChnlCmdID{
|
||||
CmdID_End,
|
||||
CmdID_SetTxPowerLevel,
|
||||
|
@ -115,7 +115,7 @@ typedef enum _RF_RADIO_PATH{
|
|||
RF_PATH_B = 1, //Radio Path B
|
||||
RF_PATH_C = 2, //Radio Path C
|
||||
RF_PATH_D = 3, //Radio Path D
|
||||
//RF_PATH_MAX //Max RF number 90 support
|
||||
//RF_PATH_MAX //Max RF number 90 support
|
||||
}RF_RADIO_PATH_E, *PRF_RADIO_PATH_E;
|
||||
|
||||
#define RF_PATH_MAX 2
|
||||
|
@ -150,8 +150,8 @@ typedef enum _WIRELESS_MODE {
|
|||
|
||||
#if (RTL8192D_DUAL_MAC_MODE_SWITCH == 1)
|
||||
typedef enum _BaseBand_Config_Type{
|
||||
BaseBand_Config_PHY_REG = 0,
|
||||
BaseBand_Config_AGC_TAB = 1,
|
||||
BaseBand_Config_PHY_REG = 0,
|
||||
BaseBand_Config_AGC_TAB = 1,
|
||||
BaseBand_Config_AGC_TAB_2G = 2,
|
||||
BaseBand_Config_AGC_TAB_5G = 3,
|
||||
}BaseBand_Config_Type, *PBaseBand_Config_Type;
|
||||
|
@ -166,7 +166,7 @@ typedef enum _BaseBand_Config_Type{
|
|||
typedef enum _MACPHY_MODE_8192D{
|
||||
SINGLEMAC_SINGLEPHY, //SMSP
|
||||
DUALMAC_DUALPHY, //DMDP
|
||||
DUALMAC_SINGLEPHY, //DMSP
|
||||
DUALMAC_SINGLEPHY, //DMSP
|
||||
}MACPHY_MODE_8192D,*PMACPHY_MODE_8192D;
|
||||
|
||||
typedef enum _MACPHY_MODE_CHANGE_ACTION{
|
||||
|
@ -180,7 +180,7 @@ typedef enum _MACPHY_MODE_CHANGE_ACTION{
|
|||
}MACPHY_MODE_CHANGE_ACTION,*PMACPHY_MODE_CHANGE_ACTION;
|
||||
|
||||
typedef enum _BAND_TYPE{
|
||||
BAND_ON_2_4G = 1,
|
||||
BAND_ON_2_4G = 1,
|
||||
BAND_ON_5G = 2,
|
||||
BAND_ON_BOTH,
|
||||
BANDMAX
|
||||
|
@ -201,77 +201,77 @@ typedef enum _PHY_Rate_Tx_Power_Offset_Area{
|
|||
typedef enum _RF_TYPE_8190P{
|
||||
RF_TYPE_MIN, // 0
|
||||
RF_8225=1, // 1 11b/g RF for verification only
|
||||
RF_8256=2, // 2 11b/g/n
|
||||
RF_8256=2, // 2 11b/g/n
|
||||
RF_8258=3, // 3 11a/b/g/n RF
|
||||
RF_6052=4, // 4 11b/g/n RF
|
||||
//RF_6052=5, // 4 11b/g/n RF
|
||||
// TODO: We sholud remove this psudo PHY RF after we get new RF.
|
||||
RF_PSEUDO_11N=5, // 5, It is a temporality RF.
|
||||
RF_PSEUDO_11N=5, // 5, It is a temporality RF.
|
||||
}RF_TYPE_8190P_E,*PRF_TYPE_8190P_E;
|
||||
|
||||
|
||||
|
||||
typedef struct _BB_REGISTER_DEFINITION{
|
||||
u32 rfintfs; // set software control:
|
||||
u32 rfintfs; // set software control:
|
||||
// 0x870~0x877[8 bytes]
|
||||
|
||||
u32 rfintfi; // readback data:
|
||||
|
||||
u32 rfintfi; // readback data:
|
||||
// 0x8e0~0x8e7[8 bytes]
|
||||
|
||||
u32 rfintfo; // output data:
|
||||
|
||||
u32 rfintfo; // output data:
|
||||
// 0x860~0x86f [16 bytes]
|
||||
|
||||
u32 rfintfe; // output enable:
|
||||
|
||||
u32 rfintfe; // output enable:
|
||||
// 0x860~0x86f [16 bytes]
|
||||
|
||||
|
||||
u32 rf3wireOffset; // LSSI data:
|
||||
// 0x840~0x84f [16 bytes]
|
||||
|
||||
u32 rfLSSI_Select; // BB Band Select:
|
||||
|
||||
u32 rfLSSI_Select; // BB Band Select:
|
||||
// 0x878~0x87f [8 bytes]
|
||||
|
||||
u32 rfTxGainStage; // Tx gain stage:
|
||||
|
||||
u32 rfTxGainStage; // Tx gain stage:
|
||||
// 0x80c~0x80f [4 bytes]
|
||||
|
||||
u32 rfHSSIPara1; // wire parameter control1 :
|
||||
|
||||
u32 rfHSSIPara1; // wire parameter control1 :
|
||||
// 0x820~0x823,0x828~0x82b, 0x830~0x833, 0x838~0x83b [16 bytes]
|
||||
|
||||
u32 rfHSSIPara2; // wire parameter control2 :
|
||||
|
||||
u32 rfHSSIPara2; // wire parameter control2 :
|
||||
// 0x824~0x827,0x82c~0x82f, 0x834~0x837, 0x83c~0x83f [16 bytes]
|
||||
|
||||
u32 rfSwitchControl; //Tx Rx antenna control :
|
||||
|
||||
u32 rfSwitchControl; //Tx Rx antenna control :
|
||||
// 0x858~0x85f [16 bytes]
|
||||
|
||||
u32 rfAGCControl1; //AGC parameter control1 :
|
||||
// 0xc50~0xc53,0xc58~0xc5b, 0xc60~0xc63, 0xc68~0xc6b [16 bytes]
|
||||
|
||||
u32 rfAGCControl2; //AGC parameter control2 :
|
||||
// 0xc54~0xc57,0xc5c~0xc5f, 0xc64~0xc67, 0xc6c~0xc6f [16 bytes]
|
||||
|
||||
u32 rfRxIQImbalance; //OFDM Rx IQ imbalance matrix :
|
||||
|
||||
u32 rfAGCControl1; //AGC parameter control1 :
|
||||
// 0xc50~0xc53,0xc58~0xc5b, 0xc60~0xc63, 0xc68~0xc6b [16 bytes]
|
||||
|
||||
u32 rfAGCControl2; //AGC parameter control2 :
|
||||
// 0xc54~0xc57,0xc5c~0xc5f, 0xc64~0xc67, 0xc6c~0xc6f [16 bytes]
|
||||
|
||||
u32 rfRxIQImbalance; //OFDM Rx IQ imbalance matrix :
|
||||
// 0xc14~0xc17,0xc1c~0xc1f, 0xc24~0xc27, 0xc2c~0xc2f [16 bytes]
|
||||
|
||||
u32 rfRxAFE; //Rx IQ DC ofset and Rx digital filter, Rx DC notch filter :
|
||||
|
||||
u32 rfRxAFE; //Rx IQ DC ofset and Rx digital filter, Rx DC notch filter :
|
||||
// 0xc10~0xc13,0xc18~0xc1b, 0xc20~0xc23, 0xc28~0xc2b [16 bytes]
|
||||
|
||||
|
||||
u32 rfTxIQImbalance; //OFDM Tx IQ imbalance matrix
|
||||
// 0xc80~0xc83,0xc88~0xc8b, 0xc90~0xc93, 0xc98~0xc9b [16 bytes]
|
||||
|
||||
u32 rfTxAFE; //Tx IQ DC Offset and Tx DFIR type
|
||||
|
||||
u32 rfTxAFE; //Tx IQ DC Offset and Tx DFIR type
|
||||
// 0xc84~0xc87,0xc8c~0xc8f, 0xc94~0xc97, 0xc9c~0xc9f [16 bytes]
|
||||
|
||||
u32 rfLSSIReadBack; //LSSI RF readback data SI mode
|
||||
|
||||
u32 rfLSSIReadBack; //LSSI RF readback data SI mode
|
||||
// 0x8a0~0x8af [16 bytes]
|
||||
|
||||
u32 rfLSSIReadBackPi; //LSSI RF readback data PI mode 0x8b8-8bc for Path A and B
|
||||
u32 rfLSSIReadBackPi; //LSSI RF readback data PI mode 0x8b8-8bc for Path A and B
|
||||
|
||||
}BB_REGISTER_DEFINITION_T, *PBB_REGISTER_DEFINITION_T;
|
||||
|
||||
|
||||
typedef struct _R_ANTENNA_SELECT_OFDM{
|
||||
u32 r_tx_antenna:4;
|
||||
typedef struct _R_ANTENNA_SELECT_OFDM{
|
||||
u32 r_tx_antenna:4;
|
||||
u32 r_ant_l:4;
|
||||
u32 r_ant_non_ht:4;
|
||||
u32 r_ant_non_ht:4;
|
||||
u32 r_ant_ht1:4;
|
||||
u32 r_ant_ht2:4;
|
||||
u32 r_ant_ht_s1:4;
|
||||
|
@ -281,12 +281,12 @@ typedef struct _R_ANTENNA_SELECT_OFDM{
|
|||
}R_ANTENNA_SELECT_OFDM;
|
||||
|
||||
typedef struct _R_ANTENNA_SELECT_CCK{
|
||||
u8 r_cckrx_enable_2:2;
|
||||
u8 r_cckrx_enable_2:2;
|
||||
u8 r_cckrx_enable:2;
|
||||
u8 r_ccktx_enable:4;
|
||||
}R_ANTENNA_SELECT_CCK;
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
|
@ -329,7 +329,7 @@ extern int PHY_BBConfig8192D( IN struct adapter *Adapter );
|
|||
extern int PHY_RFConfig8192D( IN struct adapter *Adapter );
|
||||
/* RF config */
|
||||
int rtl8192d_PHY_ConfigRFWithParaFile( IN struct adapter *Adapter,
|
||||
IN u8* pFileName,
|
||||
IN u8* pFileName,
|
||||
IN RF_RADIO_PATH_E eRFPath);
|
||||
int rtl8192d_PHY_ConfigRFWithHeaderFile( IN struct adapter * Adapter,
|
||||
IN RF_CONTENT Content,
|
||||
|
@ -344,21 +344,21 @@ void rtl8192d_PHY_GetHWRegOriginalValue( IN struct adapter * Adapter );
|
|||
//
|
||||
// RF Power setting
|
||||
//
|
||||
//extern BOOLEAN PHY_SetRFPowerState(IN struct adapter * Adapter,
|
||||
//extern BOOLEAN PHY_SetRFPowerState(IN struct adapter * Adapter,
|
||||
// IN RT_RF_POWER_STATE eRFPowerState);
|
||||
|
||||
//
|
||||
// BB TX Power R/W
|
||||
//
|
||||
void PHY_GetTxPowerLevel8192D( IN struct adapter * Adapter,
|
||||
OUT u32* powerlevel );
|
||||
OUT u32* powerlevel );
|
||||
void PHY_SetTxPowerLevel8192D( IN struct adapter * Adapter,
|
||||
IN u8 channel );
|
||||
BOOLEAN PHY_UpdateTxPowerDbm8192D( IN struct adapter *Adapter,
|
||||
IN int powerInDbm );
|
||||
|
||||
//
|
||||
VOID
|
||||
VOID
|
||||
PHY_ScanOperationBackup8192D(IN struct adapter *Adapter,
|
||||
IN u8 Operation );
|
||||
|
||||
|
@ -396,7 +396,7 @@ void PHY_SwChnlPhy8192D( IN struct adapter * pAdapter,
|
|||
|
||||
extern void ChkFwCmdIoDone( IN struct adapter *Adapter);
|
||||
|
||||
|
||||
|
||||
//
|
||||
// BB/MAC/RF other monitor API
|
||||
//
|
||||
|
@ -410,7 +410,7 @@ BOOLEAN PHY_CheckIsLegalRfPath8192D(IN struct adapter *pAdapter,
|
|||
//
|
||||
// Modify the value of the hw register when beacon interval be changed.
|
||||
//
|
||||
void
|
||||
void
|
||||
rtl8192d_PHY_SetBeaconHwReg( IN struct adapter * Adapter,
|
||||
IN u16 BeaconInterval );
|
||||
|
||||
|
@ -428,7 +428,7 @@ PHY_EnableHostClkReq(
|
|||
BOOLEAN
|
||||
SetAntennaConfig92C(
|
||||
IN struct adapter *Adapter,
|
||||
IN u8 DefaultAnt
|
||||
IN u8 DefaultAnt
|
||||
);
|
||||
|
||||
VOID
|
||||
|
@ -439,7 +439,7 @@ PHY_UpdateBBRFConfiguration8192D(
|
|||
|
||||
VOID PHY_ReadMacPhyMode92D(
|
||||
IN struct adapter *Adapter,
|
||||
IN BOOLEAN AutoloadFail
|
||||
IN BOOLEAN AutoloadFail
|
||||
);
|
||||
|
||||
VOID PHY_ConfigMacPhyMode92D(
|
||||
|
@ -460,7 +460,7 @@ rtl8192d_PHY_InitRxSetting(
|
|||
);
|
||||
|
||||
|
||||
VOID
|
||||
VOID
|
||||
rtl8192d_PHY_SetRFPathSwitch(IN struct adapter *pAdapter, IN BOOLEAN bMain);
|
||||
|
||||
VOID
|
||||
|
@ -469,7 +469,7 @@ HalChangeCCKStatus8192D(
|
|||
IN BOOLEAN bCCKDisable
|
||||
);
|
||||
|
||||
VOID
|
||||
VOID
|
||||
PHY_InitPABias92D(IN struct adapter *Adapter);
|
||||
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
|
@ -484,4 +484,3 @@ PHY_InitPABias92D(IN struct adapter *Adapter);
|
|||
#define PHY_QueryMacReg PHY_QueryBBReg
|
||||
|
||||
#endif // __INC_HAL8192SPHYCFG_H
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,30 +1,29 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __INC_HAL8723PHYCFG_H__
|
||||
#define __INC_HAL8723PHYCFG_H__
|
||||
|
||||
#include <Hal8192CPhyCfg.h>
|
||||
/* MAC/BB/RF HAL config */
|
||||
int PHY_BBConfig8723A( IN struct adapter *Adapter );
|
||||
int PHY_RFConfig8723A( IN struct adapter *Adapter );
|
||||
s32 PHY_MACConfig8723A(struct adapter *padapter);
|
||||
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __INC_HAL8723PHYCFG_H__
|
||||
#define __INC_HAL8723PHYCFG_H__
|
||||
|
||||
#include <Hal8192CPhyCfg.h>
|
||||
/* MAC/BB/RF HAL config */
|
||||
int PHY_BBConfig8723A( IN struct adapter *Adapter );
|
||||
int PHY_RFConfig8723A( IN struct adapter *Adapter );
|
||||
s32 PHY_MACConfig8723A(struct adapter *padapter);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,74 +1,73 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __INC_HAL8723APHYREG_H__
|
||||
#define __INC_HAL8723APHYREG_H__
|
||||
|
||||
#include <Hal8192CPhyReg.h>
|
||||
|
||||
//
|
||||
// PageB(0xB00)
|
||||
//
|
||||
#define rPdp_AntA 0xb00
|
||||
#define rPdp_AntA_4 0xb04
|
||||
#define rPdp_AntA_8 0xb08
|
||||
#define rPdp_AntA_C 0xb0c
|
||||
#define rPdp_AntA_10 0xb10
|
||||
#define rPdp_AntA_14 0xb14
|
||||
#define rPdp_AntA_18 0xb18
|
||||
#define rPdp_AntA_1C 0xb1c
|
||||
#define rPdp_AntA_20 0xb20
|
||||
#define rPdp_AntA_24 0xb24
|
||||
|
||||
#define rConfig_Pmpd_AntA 0xb28
|
||||
#define rConfig_ram64x16 0xb2c
|
||||
|
||||
#define rBndA 0xb30
|
||||
#define rHssiPar 0xb34
|
||||
|
||||
#define rConfig_AntA 0xb68
|
||||
#define rConfig_AntB 0xb6c
|
||||
|
||||
#define rPdp_AntB 0xb70
|
||||
#define rPdp_AntB_4 0xb74
|
||||
#define rPdp_AntB_8 0xb78
|
||||
#define rPdp_AntB_C 0xb7c
|
||||
#define rPdp_AntB_10 0xb80
|
||||
#define rPdp_AntB_14 0xb84
|
||||
#define rPdp_AntB_18 0xb88
|
||||
#define rPdp_AntB_1C 0xb8c
|
||||
#define rPdp_AntB_20 0xb90
|
||||
#define rPdp_AntB_24 0xb94
|
||||
|
||||
#define rConfig_Pmpd_AntB 0xb98
|
||||
|
||||
#define rBndB 0xba0
|
||||
|
||||
#define rAPK 0xbd8
|
||||
#define rPm_Rx0_AntA 0xbdc
|
||||
#define rPm_Rx1_AntA 0xbe0
|
||||
#define rPm_Rx2_AntA 0xbe4
|
||||
#define rPm_Rx3_AntA 0xbe8
|
||||
#define rPm_Rx0_AntB 0xbec
|
||||
#define rPm_Rx1_AntB 0xbf0
|
||||
#define rPm_Rx2_AntB 0xbf4
|
||||
#define rPm_Rx3_AntB 0xbf8
|
||||
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __INC_HAL8723APHYREG_H__
|
||||
#define __INC_HAL8723APHYREG_H__
|
||||
|
||||
#include <Hal8192CPhyReg.h>
|
||||
|
||||
//
|
||||
// PageB(0xB00)
|
||||
//
|
||||
#define rPdp_AntA 0xb00
|
||||
#define rPdp_AntA_4 0xb04
|
||||
#define rPdp_AntA_8 0xb08
|
||||
#define rPdp_AntA_C 0xb0c
|
||||
#define rPdp_AntA_10 0xb10
|
||||
#define rPdp_AntA_14 0xb14
|
||||
#define rPdp_AntA_18 0xb18
|
||||
#define rPdp_AntA_1C 0xb1c
|
||||
#define rPdp_AntA_20 0xb20
|
||||
#define rPdp_AntA_24 0xb24
|
||||
|
||||
#define rConfig_Pmpd_AntA 0xb28
|
||||
#define rConfig_ram64x16 0xb2c
|
||||
|
||||
#define rBndA 0xb30
|
||||
#define rHssiPar 0xb34
|
||||
|
||||
#define rConfig_AntA 0xb68
|
||||
#define rConfig_AntB 0xb6c
|
||||
|
||||
#define rPdp_AntB 0xb70
|
||||
#define rPdp_AntB_4 0xb74
|
||||
#define rPdp_AntB_8 0xb78
|
||||
#define rPdp_AntB_C 0xb7c
|
||||
#define rPdp_AntB_10 0xb80
|
||||
#define rPdp_AntB_14 0xb84
|
||||
#define rPdp_AntB_18 0xb88
|
||||
#define rPdp_AntB_1C 0xb8c
|
||||
#define rPdp_AntB_20 0xb90
|
||||
#define rPdp_AntB_24 0xb94
|
||||
|
||||
#define rConfig_Pmpd_AntB 0xb98
|
||||
|
||||
#define rBndB 0xba0
|
||||
|
||||
#define rAPK 0xbd8
|
||||
#define rPm_Rx0_AntA 0xbdc
|
||||
#define rPm_Rx1_AntA 0xbe0
|
||||
#define rPm_Rx2_AntA 0xbe4
|
||||
#define rPm_Rx3_AntA 0xbe8
|
||||
#define rPm_Rx0_AntB 0xbec
|
||||
#define rPm_Rx1_AntB 0xbf0
|
||||
#define rPm_Rx2_AntB 0xbf4
|
||||
#define rPm_Rx3_AntB 0xbf8
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,171 +1,170 @@
|
|||
#ifndef __HAL8723PWRSEQ_H__
|
||||
#define __HAL8723PWRSEQ_H__
|
||||
/*
|
||||
Check document WM-20110607-Paul-RTL8723A_Power_Architecture-R02.vsd
|
||||
There are 6 HW Power States:
|
||||
0: POFF--Power Off
|
||||
1: PDN--Power Down
|
||||
2: CARDEMU--Card Emulation
|
||||
3: ACT--Active Mode
|
||||
4: LPS--Low Power State
|
||||
5: SUS--Suspend
|
||||
|
||||
The transision from different states are defined below
|
||||
TRANS_CARDEMU_TO_ACT
|
||||
TRANS_ACT_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_SUS
|
||||
TRANS_SUS_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_PDN
|
||||
TRANS_ACT_TO_LPS
|
||||
TRANS_LPS_TO_ACT
|
||||
|
||||
TRANS_END
|
||||
*/
|
||||
#include "HalPwrSeqCmd.h"
|
||||
#include "rtl8723a_spec.h"
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_ACT_STEPS 15
|
||||
#define RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS 15
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS 15
|
||||
#define RTL8723A_TRANS_SUS_TO_CARDEMU_STEPS 15
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS 15
|
||||
#define RTL8723A_TRANS_PDN_TO_CARDEMU_STEPS 15
|
||||
#define RTL8723A_TRANS_ACT_TO_LPS_STEPS 15
|
||||
#define RTL8723A_TRANS_LPS_TO_ACT_STEPS 15
|
||||
#define RTL8723A_TRANS_END_STEPS 1
|
||||
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0}, /*0x20[0] = 1b'1 enable LDOA12 MACRO block for all interface*/ \
|
||||
{0x0067, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*0x67[0] = 0 to disable BT_GPS_SEL pins*/ \
|
||||
{0x0001, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 1, PWRSEQ_DELAY_MS},/*Delay 1ms*/ \
|
||||
{0x0000, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT5, 0}, /*0x00[5] = 1b'0 release analog Ips to digital ,1:isolation*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT2, 0},/* disable SW LPS 0x04[10]=0*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT1, BIT1},/* wait till 0x04[17] = 1 power ready*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0},/* release WLON reset 0x04[16]=1*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},/* disable HWPDN 0x04[15]=0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, (BIT4|BIT3), 0},/* disable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0},/* polling until return 0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT0, 0},/**/ \
|
||||
{0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 1},/*0x4C[23] = 0x4E[7] = 1, switch DPDT_SEL_P output from WL BB */\
|
||||
|
||||
#define RTL8723A_TRANS_ACT_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},/*0x1F[7:0] = 0 turn off RF*/ \
|
||||
{0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},/*0x4C[23] = 0x4E[7] = 0, switch DPDT_SEL_P output from register 0x65[2] */\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, BIT1}, /*0x04[9] = 1 turn off MAC by HW state machine*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT1, 0}, /*wait till 0x04[9] = 0 polling until return 0 to disable*/ \
|
||||
{0x0000, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT5, BIT5}, /*0x00[5] = 1b'1 analog Ips to digital ,1:isolation*/ \
|
||||
{0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0}, /*0x20[0] = 1b'0 disable LDOA12 MACRO block*/ \
|
||||
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_SUS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4|BIT3, (BIT4|BIT3)}, /*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3}, /*0x04[12:11] = 2b'01 enable WL suspend*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x20}, /*0x07[7:0] = 0x20 SDIO SOP option to disable BG/MB/ACK/SWR*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3|BIT4}, /*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, BIT0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8723A_TRANS_SUS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3 | BIT7, 0}, /*clear suspend enable and power down enable*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, BIT1}, /*wait power state to suspend*/\
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*0x23[4] = 1b'0 12H LDO enter normal mode*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, 0}, /*0x04[12:11] = 2b'01enable WL suspend*/
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_CARDDIS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x20}, /*0x07=0x20 , SOP option to disable BG/MB*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3}, /*0x04[12:11] = 2b'01 enable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT2, BIT2}, /*0x04[10] = 1, enable SW LPS*/ \
|
||||
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 1}, /*0x48[16] = 1 to enable GPIO9 as EXT WAKEUP*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, BIT0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8723A_TRANS_CARDDIS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3 | BIT7, 0}, /*clear suspend enable and power down enable*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, BIT1}, /*wait power state to suspend*/\
|
||||
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0}, /*0x48[16] = 0 to disable GPIO9 as EXT WAKEUP*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, 0}, /*0x04[12:11] = 2b'01enable WL suspend*/\
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*0x23[4] = 1b'0 12H LDO enter normal mode*/ \
|
||||
{0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},/*PCIe DMA start*/
|
||||
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_PDN \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK|PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x20}, /*0x07[7:0] = 0x20 SOP option to disable BG/MB/ACK/SWR*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0},/* 0x04[16] = 0*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, BIT7},/* 0x04[15] = 1*/
|
||||
|
||||
#define RTL8723A_TRANS_PDN_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},/* 0x04[15] = 0*/
|
||||
|
||||
#define RTL8723A_TRANS_ACT_TO_LPS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0xFF},/*PCIe DMA stop*/ \
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0xFF},/*Tx Pause*/ \
|
||||
{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0},/*CCK and OFDM are disabled,and clock are gated*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US},/*Delay 1us*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, 0},/*Whole BB is reset*/ \
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x03},/*Reset MAC TRX*/ \
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, 0},/*check if removed later*/ \
|
||||
{0x0093, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x00},/*When driver enter Sus/ Disable, enable LOP for BT*/ \
|
||||
{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT5, BIT5},/*Respond TxOK to scheduler*/ \
|
||||
|
||||
|
||||
#define RTL8723A_TRANS_LPS_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, 0xFF, 0x84}, /*SDIO RPWM*/\
|
||||
{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x84}, /*USB RPWM*/\
|
||||
{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x84}, /*PCIe RPWM*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, /*Delay*/\
|
||||
{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*. 0x08[4] = 0 switch TSF to 40M*/\
|
||||
{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT7, 0}, /*Polling 0x109[7]=0 TSF in 40M*/\
|
||||
{0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT6|BIT7, 0}, /*. 0x29[7:6] = 2b'00 enable BB clock*/\
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, BIT1}, /*. 0x101[1] = 1*/\
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0xFF}, /*. 0x100[7:0] = 0xFF enable WMAC TRX*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1|BIT0, BIT1|BIT0}, /*. 0x02[1:0] = 2b'11 enable BB macro*/\
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0}, /*. 0x522 = 0*/
|
||||
|
||||
#define RTL8723A_TRANS_END \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,0,PWR_CMD_END, 0, 0}, //
|
||||
|
||||
|
||||
extern WLAN_PWR_CFG rtl8723A_power_on_flow[RTL8723A_TRANS_CARDEMU_TO_ACT_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_radio_off_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_card_disable_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_card_enable_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_suspend_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_resume_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_hwpdn_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_enter_lps_flow[RTL8723A_TRANS_ACT_TO_LPS_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_leave_lps_flow[RTL8723A_TRANS_LPS_TO_ACT_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __HAL8723PWRSEQ_H__
|
||||
#define __HAL8723PWRSEQ_H__
|
||||
/*
|
||||
Check document WM-20110607-Paul-RTL8723A_Power_Architecture-R02.vsd
|
||||
There are 6 HW Power States:
|
||||
0: POFF--Power Off
|
||||
1: PDN--Power Down
|
||||
2: CARDEMU--Card Emulation
|
||||
3: ACT--Active Mode
|
||||
4: LPS--Low Power State
|
||||
5: SUS--Suspend
|
||||
|
||||
The transision from different states are defined below
|
||||
TRANS_CARDEMU_TO_ACT
|
||||
TRANS_ACT_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_SUS
|
||||
TRANS_SUS_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_PDN
|
||||
TRANS_ACT_TO_LPS
|
||||
TRANS_LPS_TO_ACT
|
||||
|
||||
TRANS_END
|
||||
*/
|
||||
#include "HalPwrSeqCmd.h"
|
||||
#include "rtl8723a_spec.h"
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_ACT_STEPS 15
|
||||
#define RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS 15
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS 15
|
||||
#define RTL8723A_TRANS_SUS_TO_CARDEMU_STEPS 15
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS 15
|
||||
#define RTL8723A_TRANS_PDN_TO_CARDEMU_STEPS 15
|
||||
#define RTL8723A_TRANS_ACT_TO_LPS_STEPS 15
|
||||
#define RTL8723A_TRANS_LPS_TO_ACT_STEPS 15
|
||||
#define RTL8723A_TRANS_END_STEPS 1
|
||||
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0}, /*0x20[0] = 1b'1 enable LDOA12 MACRO block for all interface*/ \
|
||||
{0x0067, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*0x67[0] = 0 to disable BT_GPS_SEL pins*/ \
|
||||
{0x0001, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 1, PWRSEQ_DELAY_MS},/*Delay 1ms*/ \
|
||||
{0x0000, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT5, 0}, /*0x00[5] = 1b'0 release analog Ips to digital ,1:isolation*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT2, 0},/* disable SW LPS 0x04[10]=0*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT1, BIT1},/* wait till 0x04[17] = 1 power ready*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0},/* release WLON reset 0x04[16]=1*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},/* disable HWPDN 0x04[15]=0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, (BIT4|BIT3), 0},/* disable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, BIT0},/* polling until return 0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT0, 0},/**/ \
|
||||
{0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 1},/*0x4C[23] = 0x4E[7] = 1, switch DPDT_SEL_P output from WL BB */\
|
||||
|
||||
#define RTL8723A_TRANS_ACT_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},/*0x1F[7:0] = 0 turn off RF*/ \
|
||||
{0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},/*0x4C[23] = 0x4E[7] = 0, switch DPDT_SEL_P output from register 0x65[2] */\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, BIT1}, /*0x04[9] = 1 turn off MAC by HW state machine*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT1, 0}, /*wait till 0x04[9] = 0 polling until return 0 to disable*/ \
|
||||
{0x0000, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT5, BIT5}, /*0x00[5] = 1b'1 analog Ips to digital ,1:isolation*/ \
|
||||
{0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0}, /*0x20[0] = 1b'0 disable LDOA12 MACRO block*/ \
|
||||
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_SUS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4|BIT3, (BIT4|BIT3)}, /*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3}, /*0x04[12:11] = 2b'01 enable WL suspend*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x20}, /*0x07[7:0] = 0x20 SDIO SOP option to disable BG/MB/ACK/SWR*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3|BIT4}, /*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, BIT0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8723A_TRANS_SUS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3 | BIT7, 0}, /*clear suspend enable and power down enable*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, BIT1}, /*wait power state to suspend*/\
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*0x23[4] = 1b'0 12H LDO enter normal mode*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, 0}, /*0x04[12:11] = 2b'01enable WL suspend*/
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_CARDDIS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x20}, /*0x07=0x20 , SOP option to disable BG/MB*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, BIT3}, /*0x04[12:11] = 2b'01 enable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT2, BIT2}, /*0x04[10] = 1, enable SW LPS*/ \
|
||||
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 1}, /*0x48[16] = 1 to enable GPIO9 as EXT WAKEUP*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, BIT0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8723A_TRANS_CARDDIS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3 | BIT7, 0}, /*clear suspend enable and power down enable*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, BIT0, 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_POLLING, BIT1, BIT1}, /*wait power state to suspend*/\
|
||||
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0}, /*0x48[16] = 0 to disable GPIO9 as EXT WAKEUP*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT3|BIT4, 0}, /*0x04[12:11] = 2b'01enable WL suspend*/\
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*0x23[4] = 1b'0 12H LDO enter normal mode*/ \
|
||||
{0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0},/*PCIe DMA start*/
|
||||
|
||||
|
||||
#define RTL8723A_TRANS_CARDEMU_TO_PDN \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, BIT4}, /*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK|PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x20}, /*0x07[7:0] = 0x20 SOP option to disable BG/MB/ACK/SWR*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0},/* 0x04[16] = 0*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, BIT7},/* 0x04[15] = 1*/
|
||||
|
||||
#define RTL8723A_TRANS_PDN_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT7, 0},/* 0x04[15] = 0*/
|
||||
|
||||
#define RTL8723A_TRANS_ACT_TO_LPS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0xFF},/*PCIe DMA stop*/ \
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0xFF},/*Tx Pause*/ \
|
||||
{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT0, 0},/*CCK and OFDM are disabled,and clock are gated*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US},/*Delay 1us*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, 0},/*Whole BB is reset*/ \
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x03},/*Reset MAC TRX*/ \
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, 0},/*check if removed later*/ \
|
||||
{0x0093, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x00},/*When driver enter Sus/ Disable, enable LOP for BT*/ \
|
||||
{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT5, BIT5},/*Respond TxOK to scheduler*/ \
|
||||
|
||||
|
||||
#define RTL8723A_TRANS_LPS_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,PWR_BASEADDR_SDIO,PWR_CMD_WRITE, 0xFF, 0x84}, /*SDIO RPWM*/\
|
||||
{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x84}, /*USB RPWM*/\
|
||||
{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0x84}, /*PCIe RPWM*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, /*Delay*/\
|
||||
{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT4, 0}, /*. 0x08[4] = 0 switch TSF to 40M*/\
|
||||
{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_POLLING, BIT7, 0}, /*Polling 0x109[7]=0 TSF in 40M*/\
|
||||
{0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT6|BIT7, 0}, /*. 0x29[7:6] = 2b'00 enable BB clock*/\
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1, BIT1}, /*. 0x101[1] = 1*/\
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0xFF}, /*. 0x100[7:0] = 0xFF enable WMAC TRX*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, BIT1|BIT0, BIT1|BIT0}, /*. 0x02[1:0] = 2b'11 enable BB macro*/\
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,PWR_BASEADDR_MAC,PWR_CMD_WRITE, 0xFF, 0}, /*. 0x522 = 0*/
|
||||
|
||||
#define RTL8723A_TRANS_END \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, // comments here*/ \
|
||||
{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,0,PWR_CMD_END, 0, 0}, //
|
||||
|
||||
|
||||
extern WLAN_PWR_CFG rtl8723A_power_on_flow[RTL8723A_TRANS_CARDEMU_TO_ACT_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_radio_off_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_card_disable_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_card_enable_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_suspend_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_resume_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_hwpdn_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_enter_lps_flow[RTL8723A_TRANS_ACT_TO_LPS_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
extern WLAN_PWR_CFG rtl8723A_leave_lps_flow[RTL8723A_TRANS_LPS_TO_ACT_STEPS+RTL8723A_TRANS_END_STEPS];
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,138 +1,137 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __HALPWRSEQCMD_H__
|
||||
#define __HALPWRSEQCMD_H__
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of cmd: 4 bits
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_CMD_READ 0x00
|
||||
// offset: the read register offset
|
||||
// msk: the mask of the read value
|
||||
// value: N/A, left by 0
|
||||
// note: dirver shall implement this function by read & msk
|
||||
|
||||
#define PWR_CMD_WRITE 0x01
|
||||
// offset: the read register offset
|
||||
// msk: the mask of the write bits
|
||||
// value: write value
|
||||
// note: driver shall implement this cmd by read & msk after write
|
||||
|
||||
#define PWR_CMD_POLLING 0x02
|
||||
// offset: the read register offset
|
||||
// msk: the mask of the polled value
|
||||
// value: the value to be polled, masked by the msd field.
|
||||
// note: driver shall implement this cmd by
|
||||
// do{
|
||||
// if( (Read(offset) & msk) == (value & msk) )
|
||||
// break;
|
||||
// } while(not timeout);
|
||||
|
||||
#define PWR_CMD_DELAY 0x03
|
||||
// offset: the value to delay
|
||||
// msk: N/A
|
||||
// value: the unit of delay, 0: us, 1: ms
|
||||
|
||||
#define PWR_CMD_END 0x04
|
||||
// offset: N/A
|
||||
// msk: N/A
|
||||
// value: N/A
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of base: 4 bits
|
||||
/*---------------------------------------------*/
|
||||
// define the base address of each block
|
||||
#define PWR_BASEADDR_MAC 0x00
|
||||
#define PWR_BASEADDR_USB 0x01
|
||||
#define PWR_BASEADDR_PCIE 0x02
|
||||
#define PWR_BASEADDR_SDIO 0x03
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of interface_msk: 4 bits
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_INTF_SDIO_MSK BIT(0)
|
||||
#define PWR_INTF_USB_MSK BIT(1)
|
||||
#define PWR_INTF_PCI_MSK BIT(2)
|
||||
#define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of fab_msk: 4 bits
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_FAB_TSMC_MSK BIT(0)
|
||||
#define PWR_FAB_UMC_MSK BIT(1)
|
||||
#define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of cut_msk: 8 bits
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_CUT_TESTCHIP_MSK BIT(0)
|
||||
#define PWR_CUT_A_MSK BIT(1)
|
||||
#define PWR_CUT_B_MSK BIT(2)
|
||||
#define PWR_CUT_C_MSK BIT(3)
|
||||
#define PWR_CUT_D_MSK BIT(4)
|
||||
#define PWR_CUT_E_MSK BIT(5)
|
||||
#define PWR_CUT_F_MSK BIT(6)
|
||||
#define PWR_CUT_G_MSK BIT(7)
|
||||
#define PWR_CUT_ALL_MSK 0xFF
|
||||
|
||||
|
||||
typedef enum _PWRSEQ_CMD_DELAY_UNIT_
|
||||
{
|
||||
PWRSEQ_DELAY_US,
|
||||
PWRSEQ_DELAY_MS,
|
||||
} PWRSEQ_DELAY_UNIT;
|
||||
|
||||
typedef struct _WL_PWR_CFG_
|
||||
{
|
||||
u16 offset;
|
||||
u8 cut_msk;
|
||||
u8 fab_msk:4;
|
||||
u8 interface_msk:4;
|
||||
u8 base:4;
|
||||
u8 cmd:4;
|
||||
u8 msk;
|
||||
u8 value;
|
||||
} WLAN_PWR_CFG, *PWLAN_PWR_CFG;
|
||||
|
||||
|
||||
#define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset
|
||||
#define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk
|
||||
#define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk
|
||||
#define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk
|
||||
#define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base
|
||||
#define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd
|
||||
#define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk
|
||||
#define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value
|
||||
|
||||
|
||||
//================================================================================
|
||||
// Prototype of protected function.
|
||||
//================================================================================
|
||||
u8 HalPwrSeqCmdParsing(
|
||||
struct adapter * padapter,
|
||||
u8 CutVersion,
|
||||
u8 FabVersion,
|
||||
u8 InterfaceType,
|
||||
WLAN_PWR_CFG PwrCfgCmd[]);
|
||||
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __HALPWRSEQCMD_H__
|
||||
#define __HALPWRSEQCMD_H__
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of cmd: 4 bits
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_CMD_READ 0x00
|
||||
// offset: the read register offset
|
||||
// msk: the mask of the read value
|
||||
// value: N/A, left by 0
|
||||
// note: dirver shall implement this function by read & msk
|
||||
|
||||
#define PWR_CMD_WRITE 0x01
|
||||
// offset: the read register offset
|
||||
// msk: the mask of the write bits
|
||||
// value: write value
|
||||
// note: driver shall implement this cmd by read & msk after write
|
||||
|
||||
#define PWR_CMD_POLLING 0x02
|
||||
// offset: the read register offset
|
||||
// msk: the mask of the polled value
|
||||
// value: the value to be polled, masked by the msd field.
|
||||
// note: driver shall implement this cmd by
|
||||
// do{
|
||||
// if( (Read(offset) & msk) == (value & msk) )
|
||||
// break;
|
||||
// } while(not timeout);
|
||||
|
||||
#define PWR_CMD_DELAY 0x03
|
||||
// offset: the value to delay
|
||||
// msk: N/A
|
||||
// value: the unit of delay, 0: us, 1: ms
|
||||
|
||||
#define PWR_CMD_END 0x04
|
||||
// offset: N/A
|
||||
// msk: N/A
|
||||
// value: N/A
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of base: 4 bits
|
||||
/*---------------------------------------------*/
|
||||
// define the base address of each block
|
||||
#define PWR_BASEADDR_MAC 0x00
|
||||
#define PWR_BASEADDR_USB 0x01
|
||||
#define PWR_BASEADDR_PCIE 0x02
|
||||
#define PWR_BASEADDR_SDIO 0x03
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of interface_msk: 4 bits
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_INTF_SDIO_MSK BIT(0)
|
||||
#define PWR_INTF_USB_MSK BIT(1)
|
||||
#define PWR_INTF_PCI_MSK BIT(2)
|
||||
#define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of fab_msk: 4 bits
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_FAB_TSMC_MSK BIT(0)
|
||||
#define PWR_FAB_UMC_MSK BIT(1)
|
||||
#define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
|
||||
|
||||
/*---------------------------------------------*/
|
||||
//3 The value of cut_msk: 8 bits
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_CUT_TESTCHIP_MSK BIT(0)
|
||||
#define PWR_CUT_A_MSK BIT(1)
|
||||
#define PWR_CUT_B_MSK BIT(2)
|
||||
#define PWR_CUT_C_MSK BIT(3)
|
||||
#define PWR_CUT_D_MSK BIT(4)
|
||||
#define PWR_CUT_E_MSK BIT(5)
|
||||
#define PWR_CUT_F_MSK BIT(6)
|
||||
#define PWR_CUT_G_MSK BIT(7)
|
||||
#define PWR_CUT_ALL_MSK 0xFF
|
||||
|
||||
|
||||
typedef enum _PWRSEQ_CMD_DELAY_UNIT_
|
||||
{
|
||||
PWRSEQ_DELAY_US,
|
||||
PWRSEQ_DELAY_MS,
|
||||
} PWRSEQ_DELAY_UNIT;
|
||||
|
||||
typedef struct _WL_PWR_CFG_
|
||||
{
|
||||
u16 offset;
|
||||
u8 cut_msk;
|
||||
u8 fab_msk:4;
|
||||
u8 interface_msk:4;
|
||||
u8 base:4;
|
||||
u8 cmd:4;
|
||||
u8 msk;
|
||||
u8 value;
|
||||
} WLAN_PWR_CFG, *PWLAN_PWR_CFG;
|
||||
|
||||
|
||||
#define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset
|
||||
#define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk
|
||||
#define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk
|
||||
#define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk
|
||||
#define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base
|
||||
#define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd
|
||||
#define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk
|
||||
#define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value
|
||||
|
||||
|
||||
//================================================================================
|
||||
// Prototype of protected function.
|
||||
//================================================================================
|
||||
u8 HalPwrSeqCmdParsing(
|
||||
struct adapter * padapter,
|
||||
u8 CutVersion,
|
||||
u8 FabVersion,
|
||||
u8 InterfaceType,
|
||||
WLAN_PWR_CFG PwrCfgCmd[]);
|
||||
|
||||
#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.
|
||||
|
@ -20,60 +20,60 @@
|
|||
#ifndef __HAL_VERSION_DEF_H__
|
||||
#define __HAL_VERSION_DEF_H__
|
||||
|
||||
#define TRUE _TRUE
|
||||
#define TRUE _TRUE
|
||||
#define FALSE _FALSE
|
||||
|
||||
// HAL_IC_TYPE_E
|
||||
typedef enum tag_HAL_IC_Type_Definition
|
||||
{
|
||||
CHIP_8192S = 0,
|
||||
CHIP_8188C = 1,
|
||||
CHIP_8192C = 2,
|
||||
CHIP_8192D = 3,
|
||||
CHIP_8723A = 4,
|
||||
CHIP_8188E = 5,
|
||||
CHIP_8881A = 6,
|
||||
CHIP_8812A = 7,
|
||||
CHIP_8821A = 8,
|
||||
CHIP_8723B = 9,
|
||||
CHIP_8192E = 10,
|
||||
CHIP_8192S = 0,
|
||||
CHIP_8188C = 1,
|
||||
CHIP_8192C = 2,
|
||||
CHIP_8192D = 3,
|
||||
CHIP_8723A = 4,
|
||||
CHIP_8188E = 5,
|
||||
CHIP_8881A = 6,
|
||||
CHIP_8812A = 7,
|
||||
CHIP_8821A = 8,
|
||||
CHIP_8723B = 9,
|
||||
CHIP_8192E = 10,
|
||||
}HAL_IC_TYPE_E;
|
||||
|
||||
//HAL_CHIP_TYPE_E
|
||||
typedef enum tag_HAL_CHIP_Type_Definition
|
||||
{
|
||||
TEST_CHIP = 0,
|
||||
NORMAL_CHIP = 1,
|
||||
TEST_CHIP = 0,
|
||||
NORMAL_CHIP = 1,
|
||||
FPGA = 2,
|
||||
}HAL_CHIP_TYPE_E;
|
||||
|
||||
//HAL_CUT_VERSION_E
|
||||
typedef enum tag_HAL_Cut_Version_Definition
|
||||
{
|
||||
A_CUT_VERSION = 0,
|
||||
B_CUT_VERSION = 1,
|
||||
C_CUT_VERSION = 2,
|
||||
D_CUT_VERSION = 3,
|
||||
E_CUT_VERSION = 4,
|
||||
F_CUT_VERSION = 5,
|
||||
G_CUT_VERSION = 6,
|
||||
H_CUT_VERSION = 7,
|
||||
I_CUT_VERSION = 8,
|
||||
J_CUT_VERSION = 9,
|
||||
K_CUT_VERSION = 10,
|
||||
A_CUT_VERSION = 0,
|
||||
B_CUT_VERSION = 1,
|
||||
C_CUT_VERSION = 2,
|
||||
D_CUT_VERSION = 3,
|
||||
E_CUT_VERSION = 4,
|
||||
F_CUT_VERSION = 5,
|
||||
G_CUT_VERSION = 6,
|
||||
H_CUT_VERSION = 7,
|
||||
I_CUT_VERSION = 8,
|
||||
J_CUT_VERSION = 9,
|
||||
K_CUT_VERSION = 10,
|
||||
}HAL_CUT_VERSION_E;
|
||||
|
||||
// HAL_Manufacturer
|
||||
typedef enum tag_HAL_Manufacturer_Version_Definition
|
||||
{
|
||||
CHIP_VENDOR_TSMC = 0,
|
||||
CHIP_VENDOR_UMC = 1,
|
||||
CHIP_VENDOR_TSMC = 0,
|
||||
CHIP_VENDOR_UMC = 1,
|
||||
}HAL_VENDOR_E;
|
||||
|
||||
typedef enum tag_HAL_RF_Type_Definition
|
||||
{
|
||||
RF_TYPE_1T1R = 0,
|
||||
RF_TYPE_1T2R = 1,
|
||||
RF_TYPE_1T1R = 0,
|
||||
RF_TYPE_1T2R = 1,
|
||||
RF_TYPE_2T2R = 2,
|
||||
RF_TYPE_2T3R = 3,
|
||||
RF_TYPE_2T4R = 4,
|
||||
|
@ -88,7 +88,7 @@ typedef struct tag_HAL_VERSION
|
|||
HAL_CHIP_TYPE_E ChipType;
|
||||
HAL_CUT_VERSION_E CUTVersion;
|
||||
HAL_VENDOR_E VendorType;
|
||||
HAL_RF_TYPE_E RFType;
|
||||
HAL_RF_TYPE_E RFType;
|
||||
u8 ROMVer;
|
||||
}HAL_VERSION,*PHAL_VERSION;
|
||||
|
||||
|
@ -145,7 +145,7 @@ typedef struct tag_HAL_VERSION
|
|||
//----------------------------------------------------------------------------
|
||||
#define IS_81XXC_TEST_CHIP(version) ((IS_81XXC(version) && (!IS_NORMAL_CHIP(version)))? TRUE: FALSE)
|
||||
|
||||
#define IS_92C_SERIAL(version) ((IS_81XXC(version) && IS_2T2R(version)) ? TRUE : FALSE)
|
||||
#define IS_92C_SERIAL(version) ((IS_81XXC(version) && IS_2T2R(version)) ? TRUE : FALSE)
|
||||
#define IS_81xxC_VENDOR_UMC_A_CUT(version) (IS_81XXC(version)?(IS_CHIP_VENDOR_UMC(version) ? (IS_A_CUT(version) ? TRUE : FALSE) : FALSE): FALSE)
|
||||
#define IS_81xxC_VENDOR_UMC_B_CUT(version) (IS_81XXC(version)?(IS_CHIP_VENDOR_UMC(version) ? (IS_B_CUT(version) ? TRUE : FALSE) : FALSE): FALSE)
|
||||
#define IS_81xxC_VENDOR_UMC_C_CUT(version) (IS_81XXC(version)?(IS_CHIP_VENDOR_UMC(version) ? (IS_C_CUT(version) ? TRUE : FALSE) : FALSE): FALSE)
|
||||
|
@ -161,4 +161,3 @@ typedef struct tag_HAL_VERSION
|
|||
#define IS_8723A_B_CUT(version) ((IS_8723_SERIES(version)) ? ( IS_B_CUT(version)?TRUE : FALSE) : FALSE)
|
||||
|
||||
#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.
|
||||
|
@ -35,20 +35,20 @@
|
|||
#define RTL871X_MODULE_NAME "88EU"
|
||||
#define DRV_NAME "rtl8188eu"
|
||||
|
||||
#define CONFIG_USB_HCI
|
||||
#define CONFIG_USB_HCI
|
||||
|
||||
#define CONFIG_RTL8188E
|
||||
#define CONFIG_RTL8188E
|
||||
|
||||
#if defined(CONFIG_PLATFORM_ACTIONS_ATM702X)
|
||||
#ifndef CONFIG_IOCTL_CFG80211
|
||||
#define CONFIG_IOCTL_CFG80211
|
||||
#ifndef CONFIG_IOCTL_CFG80211
|
||||
#define CONFIG_IOCTL_CFG80211
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
//#define RTW_USE_CFG80211_STA_EVENT /* Indecate new sta asoc through cfg80211_new_sta */
|
||||
#define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
|
||||
//#define CONFIG_DEBUG_CFG80211
|
||||
//#define CONFIG_DEBUG_CFG80211
|
||||
//#define CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2
|
||||
#define CONFIG_SET_SCAN_DENY_TIMER
|
||||
|
||||
|
@ -60,37 +60,37 @@
|
|||
|
||||
//#define CONFIG_H2CLBK
|
||||
|
||||
#define CONFIG_EMBEDDED_FWIMG
|
||||
#define CONFIG_EMBEDDED_FWIMG
|
||||
//#define CONFIG_FILE_FWIMG
|
||||
|
||||
#define CONFIG_XMIT_ACK
|
||||
#ifdef CONFIG_XMIT_ACK
|
||||
#define CONFIG_ACTIVE_KEEP_ALIVE_CHECK
|
||||
#endif
|
||||
#define CONFIG_80211N_HT
|
||||
#define CONFIG_80211N_HT
|
||||
|
||||
#define CONFIG_RECV_REORDERING_CTRL
|
||||
#define CONFIG_RECV_REORDERING_CTRL
|
||||
|
||||
//#define CONFIG_TCP_CSUM_OFFLOAD_RX
|
||||
//#define CONFIG_TCP_CSUM_OFFLOAD_RX
|
||||
|
||||
//#define CONFIG_DRVEXT_MODULE
|
||||
//#define CONFIG_DRVEXT_MODULE
|
||||
|
||||
#define CONFIG_SUPPORT_USB_INT
|
||||
#ifdef CONFIG_SUPPORT_USB_INT
|
||||
//#define CONFIG_USB_INTERRUPT_IN_PIPE
|
||||
//#define CONFIG_USB_INTERRUPT_IN_PIPE
|
||||
#endif
|
||||
|
||||
#define CONFIG_IPS
|
||||
#define CONFIG_IPS
|
||||
#ifdef CONFIG_IPS
|
||||
//#define CONFIG_IPS_LEVEL_2 //enable this to set default IPS mode to IPS_LEVEL_2
|
||||
#endif
|
||||
#define SUPPORT_HW_RFOFF_DETECTED
|
||||
#define SUPPORT_HW_RFOFF_DETECTED
|
||||
|
||||
#define CONFIG_LPS
|
||||
#define CONFIG_LPS
|
||||
#if defined(CONFIG_LPS) && defined(CONFIG_SUPPORT_USB_INT)
|
||||
|
||||
|
||||
//#define CONFIG_LPS_LCLK
|
||||
//#define CONFIG_LPS_LCLK
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
|
@ -101,21 +101,21 @@
|
|||
#define CONFIG_ANTENNA_DIVERSITY
|
||||
|
||||
//after link
|
||||
#ifdef CONFIG_ANTENNA_DIVERSITY
|
||||
#define CONFIG_HW_ANTENNA_DIVERSITY
|
||||
#ifdef CONFIG_ANTENNA_DIVERSITY
|
||||
#define CONFIG_HW_ANTENNA_DIVERSITY
|
||||
#endif
|
||||
|
||||
|
||||
//#define CONFIG_CONCURRENT_MODE
|
||||
//#define CONFIG_CONCURRENT_MODE
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
//#define CONFIG_HWPORT_SWAP //Port0->Sec , Port1 -> Pri
|
||||
//#define CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
|
||||
#define CONFIG_TSF_RESET_OFFLOAD // For 2 PORT TSF SYNC.
|
||||
#define CONFIG_TSF_RESET_OFFLOAD // For 2 PORT TSF SYNC.
|
||||
#endif
|
||||
|
||||
#define CONFIG_IOL
|
||||
|
||||
#define CONFIG_AP_MODE
|
||||
#define CONFIG_AP_MODE
|
||||
#ifdef CONFIG_AP_MODE
|
||||
//#define CONFIG_INTERRUPT_BASED_TXBCN // Tx Beacon when driver BCN_OK ,BCN_ERR interrupt occurs
|
||||
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_INTERRUPT_BASED_TXBCN)
|
||||
|
@ -123,22 +123,22 @@
|
|||
#endif
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
//#define CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
#define CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
#define CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
#endif
|
||||
|
||||
|
||||
#define CONFIG_NATIVEAP_MLME
|
||||
#ifndef CONFIG_NATIVEAP_MLME
|
||||
#define CONFIG_HOSTAPD_MLME
|
||||
#endif
|
||||
#define CONFIG_FIND_BEST_CHANNEL
|
||||
//#define CONFIG_NO_WIRELESS_HANDLERS
|
||||
#define CONFIG_HOSTAPD_MLME
|
||||
#endif
|
||||
#define CONFIG_FIND_BEST_CHANNEL
|
||||
//#define CONFIG_NO_WIRELESS_HANDLERS
|
||||
#endif
|
||||
|
||||
#define CONFIG_P2P
|
||||
#define CONFIG_P2P
|
||||
#ifdef CONFIG_P2P
|
||||
//The CONFIG_WFD is for supporting the Wi-Fi display
|
||||
#define CONFIG_WFD
|
||||
|
||||
|
||||
#ifndef CONFIG_WIFI_TEST
|
||||
#define CONFIG_P2P_REMOVE_GROUP_INFO
|
||||
#endif
|
||||
|
@ -150,13 +150,13 @@
|
|||
#endif
|
||||
|
||||
// Added by Kurt 20110511
|
||||
//#define CONFIG_TDLS
|
||||
//#define CONFIG_TDLS
|
||||
#ifdef CONFIG_TDLS
|
||||
// #ifndef CONFIG_WFD
|
||||
// #define CONFIG_WFD
|
||||
// #define CONFIG_WFD
|
||||
// #endif
|
||||
// #define CONFIG_TDLS_AUTOSETUP
|
||||
// #define CONFIG_TDLS_AUTOCHECKALIVE
|
||||
// #define CONFIG_TDLS_AUTOSETUP
|
||||
// #define CONFIG_TDLS_AUTOCHECKALIVE
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -175,9 +175,9 @@
|
|||
#define CONFIG_IOL_READ_EFUSE_MAP
|
||||
//#define DBG_IOL_READ_EFUSE_MAP
|
||||
//#define CONFIG_IOL_LLT
|
||||
#define CONFIG_IOL_EFUSE_PATCH
|
||||
#define CONFIG_IOL_EFUSE_PATCH
|
||||
//#define CONFIG_IOL_IOREG_CFG
|
||||
//#define CONFIG_IOL_IOREG_CFG_DBG
|
||||
//#define CONFIG_IOL_IOREG_CFG_DBG
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -201,31 +201,31 @@
|
|||
#endif // CONFIG_BR_EXT
|
||||
|
||||
#define CONFIG_TX_MCAST2UNI // Support IP multicast->unicast
|
||||
//#define CONFIG_CHECK_AC_LIFETIME // Check packet lifetime of 4 ACs.
|
||||
//#define CONFIG_CHECK_AC_LIFETIME // Check packet lifetime of 4 ACs.
|
||||
|
||||
/*
|
||||
* Interface Related Config
|
||||
/*
|
||||
* Interface Related Config
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_MINIMAL_MEMORY_USAGE
|
||||
#define CONFIG_USB_TX_AGGREGATION
|
||||
#define CONFIG_USB_RX_AGGREGATION
|
||||
#define CONFIG_USB_TX_AGGREGATION
|
||||
#define CONFIG_USB_RX_AGGREGATION
|
||||
#endif
|
||||
|
||||
#define CONFIG_PREALLOC_RECV_SKB
|
||||
#define CONFIG_PREALLOC_RECV_SKB
|
||||
//#define CONFIG_REDUCE_USB_TX_INT // Trade-off: Improve performance, but may cause TX URBs blocked by USB Host/Bus driver on few platforms.
|
||||
//#define CONFIG_EASY_REPLACEMENT
|
||||
//#define CONFIG_EASY_REPLACEMENT
|
||||
|
||||
/*
|
||||
/*
|
||||
* CONFIG_USE_USB_BUFFER_ALLOC_XX uses Linux USB Buffer alloc API and is for Linux platform only now!
|
||||
*/
|
||||
//#define CONFIG_USE_USB_BUFFER_ALLOC_TX // Trade-off: For TX path, improve stability on some platforms, but may cause performance degrade on other platforms.
|
||||
//#define CONFIG_USE_USB_BUFFER_ALLOC_RX // For RX path
|
||||
//#define CONFIG_USE_USB_BUFFER_ALLOC_TX // Trade-off: For TX path, improve stability on some platforms, but may cause performance degrade on other platforms.
|
||||
//#define CONFIG_USE_USB_BUFFER_ALLOC_RX // For RX path
|
||||
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
#undef CONFIG_PREALLOC_RECV_SKB
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
* USB VENDOR REQ BUFFER ALLOCATION METHOD
|
||||
* if not set we'll use function local variable (stack memory)
|
||||
*/
|
||||
|
@ -235,7 +235,7 @@
|
|||
#define CONFIG_USB_VENDOR_REQ_MUTEX
|
||||
#define CONFIG_VENDOR_REQ_RETRY
|
||||
|
||||
//#define CONFIG_USB_SUPPORT_ASYNC_VDN_REQ
|
||||
//#define CONFIG_USB_SUPPORT_ASYNC_VDN_REQ
|
||||
|
||||
|
||||
/*
|
||||
|
@ -254,7 +254,7 @@
|
|||
#define ENABLE_USB_DROP_INCORRECT_OUT
|
||||
|
||||
|
||||
//#define RTL8192CU_ADHOC_WORKAROUND_SETTING
|
||||
//#define RTL8192CU_ADHOC_WORKAROUND_SETTING
|
||||
|
||||
#define DISABLE_BB_RF 0
|
||||
|
||||
|
@ -268,8 +268,8 @@
|
|||
*/
|
||||
#ifdef CONFIG_PLATFORM_MN10300
|
||||
#define CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV
|
||||
#define CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
|
||||
#define CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
|
||||
#if defined (CONFIG_SW_ANTENNA_DIVERSITY)
|
||||
#undef CONFIG_SW_ANTENNA_DIVERSITY
|
||||
#define CONFIG_HW_ANTENNA_DIVERSITY
|
||||
|
@ -278,18 +278,18 @@
|
|||
#if defined (CONFIG_POWER_SAVING)
|
||||
#undef CONFIG_POWER_SAVING
|
||||
#endif
|
||||
|
||||
|
||||
#endif//CONFIG_PLATFORM_MN10300
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_PLATFORM_TI_DM365
|
||||
#define CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
#define CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(CONFIG_PLATFORM_ACTIONS_ATM702X)
|
||||
#ifdef CONFIG_USB_TX_AGGREGATION
|
||||
#ifdef CONFIG_USB_TX_AGGREGATION
|
||||
#undef CONFIG_USB_TX_AGGREGATION
|
||||
#endif
|
||||
#ifndef CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
|
@ -305,20 +305,20 @@
|
|||
* Outsource Related Config
|
||||
*/
|
||||
|
||||
#define RTL8192CE_SUPPORT 0
|
||||
#define RTL8192CU_SUPPORT 0
|
||||
#define RTL8192C_SUPPORT (RTL8192CE_SUPPORT|RTL8192CU_SUPPORT)
|
||||
#define RTL8192CE_SUPPORT 0
|
||||
#define RTL8192CU_SUPPORT 0
|
||||
#define RTL8192C_SUPPORT (RTL8192CE_SUPPORT|RTL8192CU_SUPPORT)
|
||||
|
||||
#define RTL8192DE_SUPPORT 0
|
||||
#define RTL8192DU_SUPPORT 0
|
||||
#define RTL8192D_SUPPORT (RTL8192DE_SUPPORT|RTL8192DU_SUPPORT)
|
||||
#define RTL8192DE_SUPPORT 0
|
||||
#define RTL8192DU_SUPPORT 0
|
||||
#define RTL8192D_SUPPORT (RTL8192DE_SUPPORT|RTL8192DU_SUPPORT)
|
||||
|
||||
#define RTL8723AU_SUPPORT 0
|
||||
#define RTL8723AS_SUPPORT 0
|
||||
#define RTL8723AE_SUPPORT 0
|
||||
#define RTL8723A_SUPPORT (RTL8723AU_SUPPORT|RTL8723AS_SUPPORT|RTL8723AE_SUPPORT)
|
||||
#define RTL8723AU_SUPPORT 0
|
||||
#define RTL8723AS_SUPPORT 0
|
||||
#define RTL8723AE_SUPPORT 0
|
||||
#define RTL8723A_SUPPORT (RTL8723AU_SUPPORT|RTL8723AS_SUPPORT|RTL8723AE_SUPPORT)
|
||||
|
||||
#define RTL8723_FPGA_VERIFICATION 0
|
||||
#define RTL8723_FPGA_VERIFICATION 0
|
||||
|
||||
#define RTL8188EE_SUPPORT 0
|
||||
#define RTL8188EU_SUPPORT 1
|
||||
|
@ -326,13 +326,13 @@
|
|||
#define RTL8188E_SUPPORT (RTL8188EE_SUPPORT|RTL8188EU_SUPPORT|RTL8188ES_SUPPORT)
|
||||
#define RTL8188E_FOR_TEST_CHIP 0
|
||||
//#if (RTL8188E_SUPPORT==1)
|
||||
#define RATE_ADAPTIVE_SUPPORT 1
|
||||
#define RATE_ADAPTIVE_SUPPORT 1
|
||||
#define POWER_TRAINING_ACTIVE 1
|
||||
|
||||
//#endif
|
||||
|
||||
#ifdef CONFIG_USB_TX_AGGREGATION
|
||||
//#define CONFIG_TX_EARLY_MODE
|
||||
//#define CONFIG_TX_EARLY_MODE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
|
@ -381,10 +381,9 @@
|
|||
|
||||
//#define DBG_HAL_INIT_PROFILING
|
||||
|
||||
//#define DBG_MEMORY_LEAK
|
||||
//#define DBG_MEMORY_LEAK
|
||||
|
||||
//TX use 1 urb
|
||||
//#define CONFIG_SINGLE_XMIT_BUF
|
||||
//RX use 1 urb
|
||||
//#define CONFIG_SINGLE_RECV_BUF
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
@ -29,13 +29,13 @@
|
|||
#ifndef TRUE
|
||||
#define _TRUE 1
|
||||
#else
|
||||
#define _TRUE TRUE
|
||||
#define _TRUE TRUE
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
|
||||
#ifndef FALSE
|
||||
#define _FALSE 0
|
||||
#else
|
||||
#define _FALSE FALSE
|
||||
#define _FALSE FALSE
|
||||
#endif
|
||||
|
||||
#include <linux/types.h>
|
||||
|
@ -55,14 +55,14 @@
|
|||
#define UCHAR u8
|
||||
#define USHORT u16
|
||||
#define UINT u32
|
||||
#define ULONG u32
|
||||
#define ULONG u32
|
||||
|
||||
typedef void (*proc_t)(void*);
|
||||
|
||||
typedef __kernel_size_t SIZE_T;
|
||||
typedef __kernel_size_t SIZE_T;
|
||||
typedef __kernel_ssize_t SSIZE_T;
|
||||
#define FIELD_OFFSET(s,field) ((SSIZE_T)&((s*)(0))->field)
|
||||
|
||||
|
||||
|
||||
#define MEM_ALIGNMENT_OFFSET (sizeof (SIZE_T))
|
||||
#define MEM_ALIGNMENT_PADDING (sizeof(SIZE_T) - 1)
|
||||
|
@ -83,8 +83,8 @@
|
|||
//
|
||||
// Byte Swapping routine.
|
||||
//
|
||||
#define EF1Byte
|
||||
#define EF2Byte le16_to_cpu
|
||||
#define EF1Byte
|
||||
#define EF2Byte le16_to_cpu
|
||||
#define EF4Byte le32_to_cpu
|
||||
|
||||
//
|
||||
|
@ -99,7 +99,7 @@
|
|||
//
|
||||
#define WriteEF1Byte(_ptr, _val) (*((u8 *)(_ptr)))=EF1Byte(_val)
|
||||
#define WriteEF2Byte(_ptr, _val) (*((u16 *)(_ptr)))=EF2Byte(_val)
|
||||
#define WriteEF4Byte(_ptr, _val) (*((u32 *)(_ptr)))=EF4Byte(_val)
|
||||
#define WriteEF4Byte(_ptr, _val) (*((u32 *)(_ptr)))=EF4Byte(_val)
|
||||
|
||||
//
|
||||
// Example:
|
||||
|
@ -116,7 +116,7 @@
|
|||
// BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000
|
||||
//
|
||||
#define BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) \
|
||||
(BIT_LEN_MASK_32(__BitLen) << (__BitOffset))
|
||||
(BIT_LEN_MASK_32(__BitLen) << (__BitOffset))
|
||||
|
||||
//
|
||||
// Description:
|
||||
|
@ -140,7 +140,7 @@
|
|||
|
||||
//
|
||||
// Description:
|
||||
// Mask subfield (continuous bits in little-endian) of 4-byte value in litten byte oredering
|
||||
// Mask subfield (continuous bits in little-endian) of 4-byte value in litten byte oredering
|
||||
// and return the result in 4-byte value in host byte ordering.
|
||||
//
|
||||
#define LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
|
@ -152,7 +152,7 @@
|
|||
|
||||
//
|
||||
// Description:
|
||||
// Set subfield of little-endian 4-byte value to specified value.
|
||||
// Set subfield of little-endian 4-byte value to specified value.
|
||||
//
|
||||
#define SET_BITS_TO_LE_4BYTE(__pStart, __BitOffset, __BitLen, __Value) \
|
||||
*((u32 *)(__pStart)) = \
|
||||
|
@ -162,23 +162,23 @@
|
|||
( (((u32)__Value) & BIT_LEN_MASK_32(__BitLen)) << (__BitOffset) ) \
|
||||
);
|
||||
|
||||
|
||||
|
||||
#define BIT_LEN_MASK_16(__BitLen) \
|
||||
(0xFFFF >> (16 - (__BitLen)))
|
||||
|
||||
|
||||
#define BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) \
|
||||
(BIT_LEN_MASK_16(__BitLen) << (__BitOffset))
|
||||
|
||||
|
||||
#define LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
|
||||
(EF2Byte(*((u16 *)(__pStart))))
|
||||
|
||||
|
||||
#define LE_BITS_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
( \
|
||||
( LE_P2BYTE_TO_HOST_2BYTE(__pStart) >> (__BitOffset) ) \
|
||||
& \
|
||||
BIT_LEN_MASK_16(__BitLen) \
|
||||
)
|
||||
|
||||
|
||||
#define LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
( \
|
||||
LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
|
||||
|
@ -193,7 +193,7 @@
|
|||
| \
|
||||
( (((u16)__Value) & BIT_LEN_MASK_16(__BitLen)) << (__BitOffset) ) \
|
||||
);
|
||||
|
||||
|
||||
#define BIT_LEN_MASK_8(__BitLen) \
|
||||
(0xFF >> (8 - (__BitLen)))
|
||||
|
||||
|
@ -248,4 +248,3 @@
|
|||
typedef unsigned char BOOLEAN,*PBOOLEAN;
|
||||
|
||||
#endif //__BASIC_TYPES_H__
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -25,4 +25,3 @@
|
|||
#define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size))
|
||||
|
||||
#endif //_CIRC_BUF_H_
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -33,4 +33,3 @@ extern sint _rtw_enqueue_cmd(_queue *queue, struct cmd_obj *obj);
|
|||
extern struct cmd_obj *_rtw_dequeue_cmd(_queue *queue);
|
||||
|
||||
#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.
|
||||
|
@ -56,7 +56,7 @@
|
|||
#endif
|
||||
|
||||
//About USB VENDOR REQ
|
||||
#if defined(CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
|
||||
#if defined(CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
|
||||
#warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC automatically"
|
||||
#define CONFIG_USB_VENDOR_REQ_MUTEX
|
||||
#endif
|
||||
|
@ -69,4 +69,3 @@
|
|||
//#include <rtl871x_byteorder.h>
|
||||
|
||||
#endif // __DRV_CONF_H__
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ struct registry_priv
|
|||
u8 network_mode; //infra, ad-hoc, auto
|
||||
u8 channel;//ad-hoc support requirement
|
||||
u8 wireless_mode;//A, B, G, auto
|
||||
u8 scan_mode;//active, passive
|
||||
u8 scan_mode;//active, passive
|
||||
u8 radio_enable;
|
||||
u8 preamble;//long, short, auto
|
||||
u8 vrtl_carrier_sense;//Enable, Disable, Auto
|
||||
|
@ -150,7 +150,7 @@ struct registry_priv
|
|||
u8 ht_enable;
|
||||
u8 cbw40_enable;
|
||||
u8 ampdu_enable;//for tx
|
||||
u8 rx_stbc;
|
||||
u8 rx_stbc;
|
||||
u8 ampdu_amsdu;//A-MPDU Supports A-MSDU is permitted
|
||||
#endif
|
||||
u8 lowrate_two_xmit;
|
||||
|
@ -241,8 +241,8 @@ struct registry_priv
|
|||
enum _IFACE_ID {
|
||||
IFACE_ID0, //maping to PRIMARY_ADAPTER
|
||||
IFACE_ID1, //maping to SECONDARY_ADAPTER
|
||||
IFACE_ID2,
|
||||
IFACE_ID3,
|
||||
IFACE_ID2,
|
||||
IFACE_ID3,
|
||||
IFACE_ID_MAX,
|
||||
};
|
||||
|
||||
|
@ -250,7 +250,7 @@ struct dvobj_priv
|
|||
{
|
||||
struct adapter *if1; //PRIMARY_ADAPTER
|
||||
struct adapter *if2; //SECONDARY_ADAPTER
|
||||
|
||||
|
||||
s32 processing_dev_remove;
|
||||
|
||||
//for local/global synchronization
|
||||
|
@ -343,10 +343,10 @@ struct dvobj_priv
|
|||
u8 const_hwsw_rfoff_d3;
|
||||
u8 const_support_pciaspm;
|
||||
// pci-e bridge */
|
||||
u8 const_hostpci_aspm_setting;
|
||||
u8 const_hostpci_aspm_setting;
|
||||
// pci-e device */
|
||||
u8 const_devicepci_aspm_setting;
|
||||
u8 b_support_aspm; // If it supports ASPM, Offset[560h] = 0x40, otherwise Offset[560h] = 0x00.
|
||||
u8 const_devicepci_aspm_setting;
|
||||
u8 b_support_aspm; // If it supports ASPM, Offset[560h] = 0x40, otherwise Offset[560h] = 0x00.
|
||||
u8 b_support_backdoor;
|
||||
u8 bdma64;
|
||||
|
||||
|
@ -425,7 +425,7 @@ struct adapter {
|
|||
int DriverState;// for disable driver using module, use dongle to replace module.
|
||||
int pid[3];//process id from UI, 0:wps, 1:hostapd, 2:dhcpcd
|
||||
int bDongle;//build-in module or external dongle
|
||||
u16 chip_type;
|
||||
u16 chip_type;
|
||||
u16 HardwareType;
|
||||
u16 interface_type;//USB,SDIO,SPI,PCI
|
||||
|
||||
|
@ -435,20 +435,20 @@ struct adapter {
|
|||
struct cmd_priv cmdpriv;
|
||||
struct evt_priv evtpriv;
|
||||
//struct io_queue *pio_queue;
|
||||
struct io_priv iopriv;
|
||||
struct io_priv iopriv;
|
||||
struct xmit_priv xmitpriv;
|
||||
struct recv_priv recvpriv;
|
||||
struct sta_priv stapriv;
|
||||
struct security_priv securitypriv;
|
||||
_lock security_key_mutex; // add for CONFIG_IEEE80211W, none 11w also can use
|
||||
struct registry_priv registrypriv;
|
||||
struct eeprom_priv eeprompriv;
|
||||
struct eeprom_priv eeprompriv;
|
||||
struct led_priv ledpriv;
|
||||
#if defined(CONFIG_CHECK_BT_HANG) && defined(CONFIG_BT_COEXIST)
|
||||
#if defined(CONFIG_CHECK_BT_HANG) && defined(CONFIG_BT_COEXIST)
|
||||
//Check BT status for BT Hung.
|
||||
struct workqueue_struct *priv_checkbt_wq;
|
||||
struct delayed_work checkbt_work;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DRVEXT_MODULE
|
||||
struct drvext_priv drvextpriv;
|
||||
|
@ -611,4 +611,3 @@ __inline static u8 *myid(struct eeprom_priv *peepriv)
|
|||
|
||||
|
||||
#endif //__DRV_TYPES_H__
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -49,7 +49,7 @@ typedef struct _MP_REG_ENTRY
|
|||
u8 Type; // NdisParameterInteger/NdisParameterHexInteger/NdisParameterStringle/NdisParameterMultiString
|
||||
uint FieldOffset; // offset to MP_ADAPTER field
|
||||
uint FieldSize; // size (in bytes) of the field
|
||||
|
||||
|
||||
#ifdef UNDER_AMD64
|
||||
u64 Default;
|
||||
#else
|
||||
|
@ -64,7 +64,7 @@ typedef struct _MP_REG_ENTRY
|
|||
typedef struct _USB_EXTENSION {
|
||||
LPCUSB_FUNCS _lpUsbFuncs;
|
||||
USB_HANDLE _hDevice;
|
||||
PVOID pAdapter;
|
||||
PVOID pAdapter;
|
||||
|
||||
#if 0
|
||||
USB_ENDPOINT_DESCRIPTOR _endpACLIn;
|
||||
|
@ -90,4 +90,3 @@ typedef struct _OCTET_STRING{
|
|||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,45 +1,44 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __DRV_TYPES_GSPI_H__
|
||||
#define __DRV_TYPES_GSPI_H__
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <basic_types.h>
|
||||
|
||||
// SPI Header Files
|
||||
#include <linux/spi/spi.h>
|
||||
|
||||
|
||||
typedef struct gspi_data
|
||||
{
|
||||
u8 func_number;
|
||||
|
||||
u8 tx_block_mode;
|
||||
u8 rx_block_mode;
|
||||
u32 block_transfer_len;
|
||||
|
||||
struct spi_device *func;
|
||||
|
||||
struct workqueue_struct *priv_wq;
|
||||
struct delayed_work irq_work;
|
||||
} GSPI_DATA, *PGSPI_DATA;
|
||||
|
||||
#endif // #ifndef __DRV_TYPES_GSPI_H__
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __DRV_TYPES_GSPI_H__
|
||||
#define __DRV_TYPES_GSPI_H__
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <basic_types.h>
|
||||
|
||||
// SPI Header Files
|
||||
#include <linux/spi/spi.h>
|
||||
|
||||
|
||||
typedef struct gspi_data
|
||||
{
|
||||
u8 func_number;
|
||||
|
||||
u8 tx_block_mode;
|
||||
u8 rx_block_mode;
|
||||
u32 block_transfer_len;
|
||||
|
||||
struct spi_device *func;
|
||||
|
||||
struct workqueue_struct *priv_wq;
|
||||
struct delayed_work irq_work;
|
||||
} GSPI_DATA, *PGSPI_DATA;
|
||||
|
||||
#endif // #ifndef __DRV_TYPES_GSPI_H__
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -22,4 +22,3 @@
|
|||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,42 +1,41 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __DRV_TYPES_SDIO_H__
|
||||
#define __DRV_TYPES_SDIO_H__
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <basic_types.h>
|
||||
|
||||
// SDIO Header Files
|
||||
#include <linux/mmc/sdio_func.h>
|
||||
|
||||
typedef struct sdio_data
|
||||
{
|
||||
u8 func_number;
|
||||
|
||||
u8 tx_block_mode;
|
||||
u8 rx_block_mode;
|
||||
u32 block_transfer_len;
|
||||
|
||||
struct sdio_func *func;
|
||||
_thread_hdl_ sys_sdio_irq_thd;
|
||||
} SDIO_DATA, *PSDIO_DATA;
|
||||
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __DRV_TYPES_SDIO_H__
|
||||
#define __DRV_TYPES_SDIO_H__
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <basic_types.h>
|
||||
|
||||
// SDIO Header Files
|
||||
#include <linux/mmc/sdio_func.h>
|
||||
|
||||
typedef struct sdio_data
|
||||
{
|
||||
u8 func_number;
|
||||
|
||||
u8 tx_block_mode;
|
||||
u8 rx_block_mode;
|
||||
u32 block_transfer_len;
|
||||
|
||||
struct sdio_func *func;
|
||||
_thread_hdl_ sys_sdio_irq_thd;
|
||||
} SDIO_DATA, *PSDIO_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.
|
||||
|
@ -70,7 +70,7 @@ typedef struct _MP_REG_ENTRY
|
|||
u8 Type; // NdisParameterInteger/NdisParameterHexInteger/NdisParameterStringle/NdisParameterMultiString
|
||||
uint FieldOffset; // offset to MP_ADAPTER field
|
||||
uint FieldSize; // size (in bytes) of the field
|
||||
|
||||
|
||||
#ifdef UNDER_AMD64
|
||||
u64 Default;
|
||||
#else
|
||||
|
@ -92,4 +92,3 @@ typedef struct _OCTET_STRING{
|
|||
|
||||
|
||||
#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.
|
||||
|
@ -17,7 +17,7 @@
|
|||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
/*! \file */
|
||||
/*! \file */
|
||||
#ifndef __INC_ETHERNET_H
|
||||
#define __INC_ETHERNET_H
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
|||
|
||||
#define RT_ETH_IS_MULTICAST(_pAddr) ((((UCHAR *)(_pAddr))[0]&0x01)!=0) //!< Is Multicast Address?
|
||||
#define RT_ETH_IS_BROADCAST(_pAddr) ( \
|
||||
((UCHAR *)(_pAddr))[0]==0xff && \
|
||||
((UCHAR *)(_pAddr))[0]==0xff && \
|
||||
((UCHAR *)(_pAddr))[1]==0xff && \
|
||||
((UCHAR *)(_pAddr))[2]==0xff && \
|
||||
((UCHAR *)(_pAddr))[3]==0xff && \
|
||||
|
@ -39,4 +39,3 @@
|
|||
|
||||
|
||||
#endif // #ifndef __INC_ETHERNET_H
|
||||
|
||||
|
|
|
@ -26,4 +26,3 @@ void rtl8188es_set_hal_ops(struct adapter *padapter);
|
|||
#define hal_set_hal_ops rtl8188es_set_hal_ops
|
||||
|
||||
#endif //__GSPI_HAL_H__
|
||||
|
||||
|
|
|
@ -25,28 +25,28 @@
|
|||
* suppose that it will be the same
|
||||
* for diff chips of GSPI, if not
|
||||
* we should move it to HAL folder */
|
||||
#define SPI_LOCAL_DOMAIN 0x0
|
||||
#define WLAN_IOREG_DOMAIN 0x8
|
||||
#define FW_FIFO_DOMAIN 0x4
|
||||
#define TX_HIQ_DOMAIN 0xc
|
||||
#define TX_MIQ_DOMAIN 0xd
|
||||
#define TX_LOQ_DOMAIN 0xe
|
||||
#define RX_RXFIFO_DOMAIN 0x1f
|
||||
#define SPI_LOCAL_DOMAIN 0x0
|
||||
#define WLAN_IOREG_DOMAIN 0x8
|
||||
#define FW_FIFO_DOMAIN 0x4
|
||||
#define TX_HIQ_DOMAIN 0xc
|
||||
#define TX_MIQ_DOMAIN 0xd
|
||||
#define TX_LOQ_DOMAIN 0xe
|
||||
#define RX_RXFIFO_DOMAIN 0x1f
|
||||
|
||||
//IO Bus domain address mapping
|
||||
#define DEFUALT_OFFSET 0x0
|
||||
#define SPI_LOCAL_OFFSET 0x10250000
|
||||
#define WLAN_IOREG_OFFSET 0x10260000
|
||||
#define FW_FIFO_OFFSET 0x10270000
|
||||
#define TX_HIQ_OFFSET 0x10310000
|
||||
#define SPI_LOCAL_OFFSET 0x10250000
|
||||
#define WLAN_IOREG_OFFSET 0x10260000
|
||||
#define FW_FIFO_OFFSET 0x10270000
|
||||
#define TX_HIQ_OFFSET 0x10310000
|
||||
#define TX_MIQ_OFFSET 0x1032000
|
||||
#define TX_LOQ_OFFSET 0x10330000
|
||||
#define RX_RXOFF_OFFSET 0x10340000
|
||||
#define RX_RXOFF_OFFSET 0x10340000
|
||||
|
||||
//SPI Local registers
|
||||
#define SPI_REG_TX_CTRL 0x0000 // SPI Tx Control
|
||||
#define SPI_REG_STATUS_RECOVERY 0x0004
|
||||
#define SPI_REG_INT_TIMEOUT 0x0006
|
||||
#define SPI_REG_INT_TIMEOUT 0x0006
|
||||
#define SPI_REG_HIMR 0x0014 // SPI Host Interrupt Mask
|
||||
#define SPI_REG_HISR 0x0018 // SPI Host Interrupt Service Routine
|
||||
#define SPI_REG_RX0_REQ_LEN 0x001C // RXDMA Request Length
|
||||
|
@ -62,18 +62,18 @@
|
|||
#define SPI_REG_HISR_ON 0x0091 //SPI Host Extension Interrupt Status Always
|
||||
#define SPI_REG_CFG 0x00F0 //SPI Configuration Register
|
||||
|
||||
#define SPI_TX_CTRL (SPI_REG_TX_CTRL |SPI_LOCAL_OFFSET)
|
||||
#define SPI_STATUS_RECOVERY (SPI_REG_STATUS_RECOVERY |SPI_LOCAL_OFFSET)
|
||||
#define SPI_INT_TIMEOUT (SPI_REG_INT_TIMEOUT |SPI_LOCAL_OFFSET)
|
||||
#define SPI_HIMR (SPI_REG_HIMR |SPI_LOCAL_OFFSET)
|
||||
#define SPI_HISR (SPI_REG_HISR |SPI_LOCAL_OFFSET)
|
||||
#define SPI_RX0_REQ_LEN_1_BYTE (SPI_REG_RX0_REQ_LEN |SPI_LOCAL_OFFSET)
|
||||
#define SPI_FREE_TXPG (SPI_REG_FREE_TXPG |SPI_LOCAL_OFFSET)
|
||||
#define SPI_TX_CTRL (SPI_REG_TX_CTRL |SPI_LOCAL_OFFSET)
|
||||
#define SPI_STATUS_RECOVERY (SPI_REG_STATUS_RECOVERY |SPI_LOCAL_OFFSET)
|
||||
#define SPI_INT_TIMEOUT (SPI_REG_INT_TIMEOUT |SPI_LOCAL_OFFSET)
|
||||
#define SPI_HIMR (SPI_REG_HIMR |SPI_LOCAL_OFFSET)
|
||||
#define SPI_HISR (SPI_REG_HISR |SPI_LOCAL_OFFSET)
|
||||
#define SPI_RX0_REQ_LEN_1_BYTE (SPI_REG_RX0_REQ_LEN |SPI_LOCAL_OFFSET)
|
||||
#define SPI_FREE_TXPG (SPI_REG_FREE_TXPG |SPI_LOCAL_OFFSET)
|
||||
|
||||
#define SPI_HIMR_DISABLED 0
|
||||
|
||||
//SPI HIMR MASK diff with SDIO
|
||||
#define SPI_HISR_RX_REQUEST BIT(0)
|
||||
#define SPI_HISR_RX_REQUEST BIT(0)
|
||||
#define SPI_HISR_AVAL BIT(1)
|
||||
#define SPI_HISR_TXERR BIT(2)
|
||||
#define SPI_HISR_RXERR BIT(3)
|
||||
|
@ -110,17 +110,17 @@
|
|||
SPI_HISR_PSTIMEOUT |\
|
||||
SPI_HISR_OCPINT)
|
||||
|
||||
#define REG_LEN_FORMAT(pcmd, x) SET_BITS_TO_LE_4BYTE(pcmd, 0, 8, x)//(x<<(unsigned int)24)
|
||||
#define REG_ADDR_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 8, 16, x)//(x<<(unsigned int)16)
|
||||
#define REG_DOMAIN_ID_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 24, 5, x)//(x<<(unsigned int)0)
|
||||
#define REG_FUN_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 29, 2, x)//(x<<(unsigned int)5)
|
||||
#define REG_RW_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 31, 1, x)//(x<<(unsigned int)7)
|
||||
#define REG_LEN_FORMAT(pcmd, x) SET_BITS_TO_LE_4BYTE(pcmd, 0, 8, x)//(x<<(unsigned int)24)
|
||||
#define REG_ADDR_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 8, 16, x)//(x<<(unsigned int)16)
|
||||
#define REG_DOMAIN_ID_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 24, 5, x)//(x<<(unsigned int)0)
|
||||
#define REG_FUN_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 29, 2, x)//(x<<(unsigned int)5)
|
||||
#define REG_RW_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 31, 1, x)//(x<<(unsigned int)7)
|
||||
|
||||
#define FIFO_LEN_FORMAT(pcmd, x) SET_BITS_TO_LE_4BYTE(pcmd, 0, 16, x)//(x<<(unsigned int)24)
|
||||
//#define FIFO_ADDR_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 8, 16, x)//(x<<(unsigned int)16)
|
||||
#define FIFO_DOMAIN_ID_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 24, 5, x)//(x<<(unsigned int)0)
|
||||
#define FIFO_FUN_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 29, 2, x)//(x<<(unsigned int)5)
|
||||
#define FIFO_RW_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 31, 1, x)//(x<<(unsigned int)7)
|
||||
#define FIFO_LEN_FORMAT(pcmd, x) SET_BITS_TO_LE_4BYTE(pcmd, 0, 16, x)//(x<<(unsigned int)24)
|
||||
//#define FIFO_ADDR_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 8, 16, x)//(x<<(unsigned int)16)
|
||||
#define FIFO_DOMAIN_ID_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 24, 5, x)//(x<<(unsigned int)0)
|
||||
#define FIFO_FUN_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 29, 2, x)//(x<<(unsigned int)5)
|
||||
#define FIFO_RW_FORMAT(pcmd,x) SET_BITS_TO_LE_4BYTE(pcmd, 31, 1, x)//(x<<(unsigned int)7)
|
||||
|
||||
|
||||
//get status dword0
|
||||
|
@ -133,8 +133,8 @@
|
|||
//get status dword1
|
||||
#define GET_STATUS_HISR_MID8BIT(status) LE_BITS_TO_4BYTE(status + 4, 24, 8)
|
||||
#define GET_STATUS_HISR_LOW8BIT(status) LE_BITS_TO_4BYTE(status + 4, 16, 8)
|
||||
#define GET_STATUS_ERROR(status) LE_BITS_TO_4BYTE(status + 4, 17, 1)
|
||||
#define GET_STATUS_INT(status) LE_BITS_TO_4BYTE(status + 4, 16, 1)
|
||||
#define GET_STATUS_ERROR(status) LE_BITS_TO_4BYTE(status + 4, 17, 1)
|
||||
#define GET_STATUS_INT(status) LE_BITS_TO_4BYTE(status + 4, 16, 1)
|
||||
#define GET_STATUS_RX_LENGTH(status) LE_BITS_TO_4BYTE(status + 4, 0, 16)
|
||||
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@
|
|||
#define __SDIO_OPS_LINUX_H__
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -32,4 +32,3 @@ extern void sd_setup_irs(struct adapter *padapter);
|
|||
#endif
|
||||
|
||||
#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.
|
||||
|
@ -33,4 +33,3 @@ void _lbk_rsp(struct adapter *Adapter);
|
|||
void _lbk_evt(IN struct adapter *Adapter);
|
||||
|
||||
void h2c_event_callback(unsigned char *dev, unsigned char *pbuf);
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
@ -28,7 +28,7 @@
|
|||
#define RATR_2M 0x00000002
|
||||
#define RATR_55M 0x00000004
|
||||
#define RATR_11M 0x00000008
|
||||
//OFDM
|
||||
//OFDM
|
||||
#define RATR_6M 0x00000010
|
||||
#define RATR_9M 0x00000020
|
||||
#define RATR_12M 0x00000040
|
||||
|
@ -37,7 +37,7 @@
|
|||
#define RATR_36M 0x00000200
|
||||
#define RATR_48M 0x00000400
|
||||
#define RATR_54M 0x00000800
|
||||
//MCS 1 Spatial Stream
|
||||
//MCS 1 Spatial Stream
|
||||
#define RATR_MCS0 0x00001000
|
||||
#define RATR_MCS1 0x00002000
|
||||
#define RATR_MCS2 0x00004000
|
||||
|
@ -61,7 +61,7 @@
|
|||
#define RATE_2M BIT(1)
|
||||
#define RATE_5_5M BIT(2)
|
||||
#define RATE_11M BIT(3)
|
||||
//OFDM
|
||||
//OFDM
|
||||
#define RATE_6M BIT(4)
|
||||
#define RATE_9M BIT(5)
|
||||
#define RATE_12M BIT(6)
|
||||
|
@ -90,15 +90,15 @@
|
|||
#define RATE_MCS15 BIT(27)
|
||||
|
||||
// ALL CCK Rate
|
||||
#define RATE_ALL_CCK RATR_1M|RATR_2M|RATR_55M|RATR_11M
|
||||
#define RATE_ALL_CCK RATR_1M|RATR_2M|RATR_55M|RATR_11M
|
||||
#define RATE_ALL_OFDM_AG RATR_6M|RATR_9M|RATR_12M|RATR_18M|RATR_24M|\
|
||||
RATR_36M|RATR_48M|RATR_54M
|
||||
RATR_36M|RATR_48M|RATR_54M
|
||||
#define RATE_ALL_OFDM_1SS RATR_MCS0|RATR_MCS1|RATR_MCS2|RATR_MCS3 |\
|
||||
RATR_MCS4|RATR_MCS5|RATR_MCS6 |RATR_MCS7
|
||||
RATR_MCS4|RATR_MCS5|RATR_MCS6 |RATR_MCS7
|
||||
#define RATE_ALL_OFDM_2SS RATR_MCS8|RATR_MCS9 |RATR_MCS10|RATR_MCS11|\
|
||||
RATR_MCS12|RATR_MCS13|RATR_MCS14|RATR_MCS15
|
||||
|
||||
/*------------------------------ Tx Desc definition Macro ------------------------*/
|
||||
/*------------------------------ Tx Desc definition Macro ------------------------*/
|
||||
//#pragma mark -- Tx Desc related definition. --
|
||||
//----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------
|
||||
|
@ -182,4 +182,3 @@ u8 SetHalDefVar(struct adapter *adapter, HAL_DEF_VARIABLE variable, void *value)
|
|||
u8 GetHalDefVar(struct adapter *adapter, HAL_DEF_VARIABLE variable, void *value);
|
||||
|
||||
#endif //__HAL_COMMON_H__
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
@ -31,8 +31,8 @@
|
|||
|
||||
enum RTL871X_HCI_TYPE {
|
||||
RTW_PCIE = BIT0,
|
||||
RTW_USB = BIT1,
|
||||
RTW_SDIO = BIT2,
|
||||
RTW_USB = BIT1,
|
||||
RTW_SDIO = BIT2,
|
||||
RTW_GSPI = BIT3,
|
||||
};
|
||||
|
||||
|
@ -43,7 +43,7 @@ enum _CHIP_TYPE {
|
|||
RTL8188C_8192C,
|
||||
RTL8192D,
|
||||
RTL8723A,
|
||||
RTL8188E,
|
||||
RTL8188E,
|
||||
MAX_CHIP_TYPE
|
||||
};
|
||||
|
||||
|
@ -101,7 +101,7 @@ typedef enum _HW_VARIABLES{
|
|||
HW_VAR_INITIAL_GAIN,
|
||||
HW_VAR_TRIGGER_GPIO_0,
|
||||
HW_VAR_BT_SET_COEXIST,
|
||||
HW_VAR_BT_ISSUE_DELBA,
|
||||
HW_VAR_BT_ISSUE_DELBA,
|
||||
HW_VAR_CURRENT_ANTENNA,
|
||||
HW_VAR_ANTENNA_DIVERSITY_LINK,
|
||||
HW_VAR_ANTENNA_DIVERSITY_SELECT,
|
||||
|
@ -121,7 +121,7 @@ typedef enum _HW_VARIABLES{
|
|||
HW_VAR_SYS_CLKR,
|
||||
HW_VAR_NAV_UPPER,
|
||||
HW_VAR_RPT_TIMER_SETTING,
|
||||
HW_VAR_TX_RPT_MAX_MACID,
|
||||
HW_VAR_TX_RPT_MAX_MACID,
|
||||
HW_VAR_H2C_MEDIA_STATUS_RPT,
|
||||
HW_VAR_CHK_HI_QUEUE_EMPTY,
|
||||
HW_VAR_READ_LLT_TAB,
|
||||
|
@ -150,7 +150,7 @@ typedef enum _HAL_DEF_VARIABLE{
|
|||
}HAL_DEF_VARIABLE;
|
||||
|
||||
typedef enum _HAL_ODM_VARIABLE{
|
||||
HAL_ODM_STA_INFO,
|
||||
HAL_ODM_STA_INFO,
|
||||
HAL_ODM_P2P_STATE,
|
||||
HAL_ODM_WIFI_DISPLAY_STATE,
|
||||
}HAL_ODM_VARIABLE;
|
||||
|
@ -243,14 +243,14 @@ struct hal_ops {
|
|||
void (*ReadEFuse)(struct adapter *padapter, u8 efuseType, u16 _offset, u16 _size_byte, u8 *pbuf, BOOLEAN bPseudoTest);
|
||||
void (*EFUSEGetEfuseDefinition)(struct adapter *padapter, u8 efuseType, u8 type, void *pOut, BOOLEAN bPseudoTest);
|
||||
u16 (*EfuseGetCurrentSize)(struct adapter *padapter, u8 efuseType, BOOLEAN bPseudoTest);
|
||||
int (*Efuse_PgPacketRead)(struct adapter *padapter, u8 offset, u8 *data, BOOLEAN bPseudoTest);
|
||||
int (*Efuse_PgPacketWrite)(struct adapter *padapter, u8 offset, u8 word_en, u8 *data, BOOLEAN bPseudoTest);
|
||||
int (*Efuse_PgPacketRead)(struct adapter *padapter, u8 offset, u8 *data, BOOLEAN bPseudoTest);
|
||||
int (*Efuse_PgPacketWrite)(struct adapter *padapter, u8 offset, u8 word_en, u8 *data, BOOLEAN bPseudoTest);
|
||||
u8 (*Efuse_WordEnableDataWrite)(struct adapter *padapter, u16 efuse_addr, u8 word_en, u8 *data, BOOLEAN bPseudoTest);
|
||||
BOOLEAN (*Efuse_PgPacketWrite_BT)(struct adapter *padapter, u8 offset, u8 word_en, u8 *data, BOOLEAN bPseudoTest);
|
||||
|
||||
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
void (*sreset_init_value)(struct adapter *padapter);
|
||||
void (*sreset_reset_value)(struct adapter *padapter);
|
||||
void (*sreset_reset_value)(struct adapter *padapter);
|
||||
void (*silentreset)(struct adapter *padapter);
|
||||
void (*sreset_xmit_status_check)(struct adapter *padapter);
|
||||
void (*sreset_linked_status_check) (struct adapter *padapter);
|
||||
|
@ -273,8 +273,8 @@ struct hal_ops {
|
|||
void (*hal_init_checkbthang_workqueue)(struct adapter * padapter);
|
||||
void (*hal_free_checkbthang_workqueue)(struct adapter * padapter);
|
||||
void (*hal_cancel_checkbthang_workqueue)(struct adapter * padapter);
|
||||
void (*hal_checke_bt_hang)(struct adapter * padapter);
|
||||
#endif
|
||||
void (*hal_checke_bt_hang)(struct adapter * padapter);
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef enum _RT_EEPROM_TYPE{
|
||||
|
@ -286,10 +286,10 @@ typedef enum _RT_EEPROM_TYPE{
|
|||
|
||||
|
||||
#define RF_CHANGE_BY_INIT 0
|
||||
#define RF_CHANGE_BY_IPS BIT28
|
||||
#define RF_CHANGE_BY_PS BIT29
|
||||
#define RF_CHANGE_BY_HW BIT30
|
||||
#define RF_CHANGE_BY_SW BIT31
|
||||
#define RF_CHANGE_BY_IPS BIT28
|
||||
#define RF_CHANGE_BY_PS BIT29
|
||||
#define RF_CHANGE_BY_HW BIT30
|
||||
#define RF_CHANGE_BY_SW BIT31
|
||||
|
||||
typedef enum _HARDWARE_TYPE{
|
||||
HARDWARE_TYPE_RTL8180,
|
||||
|
@ -412,7 +412,7 @@ u8 rtw_hal_get_def_var(struct adapter *padapter, HAL_DEF_VARIABLE eVariable, PVO
|
|||
|
||||
void rtw_hal_set_odm_var(struct adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet);
|
||||
void rtw_hal_get_odm_var(struct adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet);
|
||||
|
||||
|
||||
void rtw_hal_enable_interrupt(struct adapter *padapter);
|
||||
void rtw_hal_disable_interrupt(struct adapter *padapter);
|
||||
|
||||
|
@ -484,4 +484,3 @@ s32 rtw_hal_c2h_handler(struct adapter *adapter, struct c2h_evt_hdr *c2h_evt);
|
|||
c2h_id_filter rtw_hal_c2h_id_filter_ccx(struct adapter *adapter);
|
||||
|
||||
#endif //__HAL_INTF_H__
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -115,11 +115,11 @@ enum {
|
|||
|
||||
#define IEEE_CRYPT_ALG_NAME_LEN 16
|
||||
|
||||
#define WPA_CIPHER_NONE BIT(0)
|
||||
#define WPA_CIPHER_WEP40 BIT(1)
|
||||
#define WPA_CIPHER_NONE BIT(0)
|
||||
#define WPA_CIPHER_WEP40 BIT(1)
|
||||
#define WPA_CIPHER_WEP104 BIT(2)
|
||||
#define WPA_CIPHER_TKIP BIT(3)
|
||||
#define WPA_CIPHER_CCMP BIT(4)
|
||||
#define WPA_CIPHER_TKIP BIT(3)
|
||||
#define WPA_CIPHER_CCMP BIT(4)
|
||||
|
||||
|
||||
|
||||
|
@ -171,8 +171,8 @@ enum NETWORK_TYPE
|
|||
WIRELESS_11A = BIT(2), // tx: ofdm only, rx: ofdm only, hw: ofdm only
|
||||
WIRELESS_11_24N = BIT(3), // tx: MCS only, rx: MCS & cck, hw: MCS & cck
|
||||
WIRELESS_11_5N = BIT(4), // tx: MCS only, rx: MCS & ofdm, hw: ofdm only
|
||||
//WIRELESS_AUTO = BIT(5),
|
||||
WIRELESS_AC = BIT(6),
|
||||
//WIRELESS_AUTO = BIT(5),
|
||||
WIRELESS_AC = BIT(6),
|
||||
|
||||
//Combination
|
||||
WIRELESS_11BG = (WIRELESS_11B|WIRELESS_11G), // tx: cck & ofdm, rx: cck & ofdm & MCS, hw: cck & ofdm
|
||||
|
@ -198,7 +198,7 @@ enum NETWORK_TYPE
|
|||
|
||||
#define IsSupportedTxCCK(NetType) ((NetType) & (WIRELESS_11B) ? _TRUE : _FALSE)
|
||||
#define IsSupportedTxOFDM(NetType) ((NetType) & (WIRELESS_11G|WIRELESS_11A) ? _TRUE : _FALSE)
|
||||
#define IsSupportedTxMCS(NetType) ((NetType) & (WIRELESS_11_24N|WIRELESS_11_5N) ? _TRUE : _FALSE)
|
||||
#define IsSupportedTxMCS(NetType) ((NetType) & (WIRELESS_11_24N|WIRELESS_11_5N) ? _TRUE : _FALSE)
|
||||
|
||||
|
||||
typedef struct ieee_param {
|
||||
|
@ -216,7 +216,7 @@ typedef struct ieee_param {
|
|||
} wpa_ie;
|
||||
struct{
|
||||
int command;
|
||||
int reason_code;
|
||||
int reason_code;
|
||||
} mlme;
|
||||
struct {
|
||||
u8 alg[IEEE_CRYPT_ALG_NAME_LEN];
|
||||
|
@ -232,7 +232,7 @@ typedef struct ieee_param {
|
|||
u16 aid;
|
||||
u16 capability;
|
||||
int flags;
|
||||
u8 tx_supp_rates[16];
|
||||
u8 tx_supp_rates[16];
|
||||
struct rtw_ieee80211_ht_cap ht_cap;
|
||||
} add_sta;
|
||||
struct {
|
||||
|
@ -241,7 +241,7 @@ typedef struct ieee_param {
|
|||
} bcn_ie;
|
||||
#endif
|
||||
|
||||
} u;
|
||||
} u;
|
||||
}ieee_param;
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
@ -256,7 +256,7 @@ struct sta_data{
|
|||
u16 capability;
|
||||
int flags;
|
||||
u32 sta_set;
|
||||
u8 tx_supp_rates[16];
|
||||
u8 tx_supp_rates[16];
|
||||
u32 tx_supp_rates_len;
|
||||
struct rtw_ieee80211_ht_cap ht_cap;
|
||||
u64 rx_pkts;
|
||||
|
@ -388,7 +388,7 @@ enum eap_type {
|
|||
|
||||
/* management */
|
||||
#define RTW_IEEE80211_STYPE_ASSOC_REQ 0x0000
|
||||
#define RTW_IEEE80211_STYPE_ASSOC_RESP 0x0010
|
||||
#define RTW_IEEE80211_STYPE_ASSOC_RESP 0x0010
|
||||
#define RTW_IEEE80211_STYPE_REASSOC_REQ 0x0020
|
||||
#define RTW_IEEE80211_STYPE_REASSOC_RESP 0x0030
|
||||
#define RTW_IEEE80211_STYPE_PROBE_REQ 0x0040
|
||||
|
@ -581,7 +581,7 @@ struct ieee80211_snap_hdr {
|
|||
#define IEEE80211_24GHZ_BAND (1<<0)
|
||||
#define IEEE80211_52GHZ_BAND (1<<1)
|
||||
|
||||
#define IEEE80211_CCK_RATE_LEN 4
|
||||
#define IEEE80211_CCK_RATE_LEN 4
|
||||
#define IEEE80211_NUM_OFDM_RATESLEN 8
|
||||
|
||||
|
||||
|
@ -589,7 +589,7 @@ struct ieee80211_snap_hdr {
|
|||
#define IEEE80211_CCK_RATE_2MB 0x04
|
||||
#define IEEE80211_CCK_RATE_5MB 0x0B
|
||||
#define IEEE80211_CCK_RATE_11MB 0x16
|
||||
#define IEEE80211_OFDM_RATE_LEN 8
|
||||
#define IEEE80211_OFDM_RATE_LEN 8
|
||||
#define IEEE80211_OFDM_RATE_6MB 0x0C
|
||||
#define IEEE80211_OFDM_RATE_9MB 0x12
|
||||
#define IEEE80211_OFDM_RATE_12MB 0x18
|
||||
|
@ -925,9 +925,9 @@ struct ieee80211_network {
|
|||
u8 rates_len;
|
||||
u8 rates_ex[MAX_RATES_EX_LENGTH];
|
||||
u8 rates_ex_len;
|
||||
|
||||
|
||||
u8 edca_parmsets[18];
|
||||
|
||||
|
||||
u8 mode;
|
||||
u8 flags;
|
||||
u8 time_stamp[8];
|
||||
|
@ -946,7 +946,7 @@ struct ieee80211_network {
|
|||
u8 qbssload[5];
|
||||
u8 network_type;
|
||||
int join_res;
|
||||
unsigned long last_scanned;
|
||||
unsigned long last_scanned;
|
||||
};
|
||||
#endif
|
||||
/*
|
||||
|
@ -960,7 +960,7 @@ enum ieee80211_state {
|
|||
|
||||
/* the card is not linked at all */
|
||||
IEEE80211_NOLINK = 0,
|
||||
|
||||
|
||||
/* IEEE80211_ASSOCIATING* are for BSS client mode
|
||||
* the driver shall not perform RX filtering unless
|
||||
* the state is LINKED.
|
||||
|
@ -968,31 +968,31 @@ enum ieee80211_state {
|
|||
* defaults to NOLINK for ALL the other states (including
|
||||
* LINKED_SCANNING)
|
||||
*/
|
||||
|
||||
|
||||
/* the association procedure will start (wq scheduling)*/
|
||||
IEEE80211_ASSOCIATING,
|
||||
IEEE80211_ASSOCIATING_RETRY,
|
||||
|
||||
|
||||
/* the association procedure is sending AUTH request*/
|
||||
IEEE80211_ASSOCIATING_AUTHENTICATING,
|
||||
|
||||
|
||||
/* the association procedure has successfully authentcated
|
||||
* and is sending association request
|
||||
*/
|
||||
IEEE80211_ASSOCIATING_AUTHENTICATED,
|
||||
|
||||
|
||||
/* the link is ok. the card associated to a BSS or linked
|
||||
* to a ibss cell or acting as an AP and creating the bss
|
||||
*/
|
||||
IEEE80211_LINKED,
|
||||
|
||||
|
||||
/* same as LINKED, but the driver shall apply RX filter
|
||||
* rules as we are in NO_LINK mode. As the card is still
|
||||
* logically linked, but it is doing a syncro site survey
|
||||
* then it will be back to LINKED state.
|
||||
*/
|
||||
IEEE80211_LINKED_SCANNING,
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
|
||||
|
@ -1197,7 +1197,7 @@ enum rtw_ieee80211_back_parties {
|
|||
RTW_IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
|
||||
RTW_IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
|
||||
};
|
||||
|
||||
|
||||
#define RTW_IEEE80211_CHAN_NO_HT40 \
|
||||
(RTW_IEEE80211_CHAN_NO_HT40PLUS | RTW_IEEE80211_CHAN_NO_HT40MINUS)
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ struct rtw_ieee80211_channel {
|
|||
//u32 orig_flags;
|
||||
//int orig_mag;
|
||||
//int orig_mpwr;
|
||||
};
|
||||
};
|
||||
|
||||
#define CHAN_FMT \
|
||||
/*"band:%d, "*/ \
|
||||
|
@ -1227,7 +1227,7 @@ struct rtw_ieee80211_channel {
|
|||
/*"beacon_found:%u\n"*/ \
|
||||
/*"orig_flags:0x%08x\n"*/ \
|
||||
/*"orig_mag:%d\n"*/ \
|
||||
/*"orig_mpwr:%d\n"*/
|
||||
/*"orig_mpwr:%d\n"*/
|
||||
|
||||
#define CHAN_ARG(channel) \
|
||||
/*(channel)->band*/ \
|
||||
|
@ -1389,4 +1389,3 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8* category, u8 *act
|
|||
const char *action_public_str(u8 action);
|
||||
|
||||
#endif /* IEEE80211_H */
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -16,296 +16,295 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __IEEE80211_EXT_H
|
||||
#define __IEEE80211_EXT_H
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
|
||||
#define WMM_OUI_TYPE 2
|
||||
#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
|
||||
#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
|
||||
#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
|
||||
#define WMM_VERSION 1
|
||||
|
||||
#define WPA_PROTO_WPA BIT(0)
|
||||
#define WPA_PROTO_RSN BIT(1)
|
||||
|
||||
#define WPA_KEY_MGMT_IEEE8021X BIT(0)
|
||||
#define WPA_KEY_MGMT_PSK BIT(1)
|
||||
#define WPA_KEY_MGMT_NONE BIT(2)
|
||||
#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
|
||||
#define WPA_KEY_MGMT_WPA_NONE BIT(4)
|
||||
|
||||
|
||||
#define WPA_CAPABILITY_PREAUTH BIT(0)
|
||||
#define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6)
|
||||
#define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9)
|
||||
|
||||
|
||||
#define PMKID_LEN 16
|
||||
|
||||
|
||||
struct wpa_ie_hdr {
|
||||
u8 elem_id;
|
||||
u8 len;
|
||||
u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
|
||||
u8 version[2]; /* little endian */
|
||||
}__attribute__ ((packed));
|
||||
|
||||
struct rsn_ie_hdr {
|
||||
u8 elem_id; /* WLAN_EID_RSN */
|
||||
u8 len;
|
||||
u8 version[2]; /* little endian */
|
||||
}__attribute__ ((packed));
|
||||
|
||||
struct wme_ac_parameter {
|
||||
#if defined(CONFIG_LITTLE_ENDIAN)
|
||||
/* byte 1 */
|
||||
u8 aifsn:4,
|
||||
acm:1,
|
||||
aci:2,
|
||||
reserved:1;
|
||||
|
||||
/* byte 2 */
|
||||
u8 eCWmin:4,
|
||||
eCWmax:4;
|
||||
#elif defined(CONFIG_BIG_ENDIAN)
|
||||
/* byte 1 */
|
||||
u8 reserved:1,
|
||||
aci:2,
|
||||
acm:1,
|
||||
aifsn:4;
|
||||
|
||||
/* byte 2 */
|
||||
u8 eCWmax:4,
|
||||
eCWmin:4;
|
||||
#else
|
||||
#error "Please fix <endian.h>"
|
||||
#endif
|
||||
|
||||
/* bytes 3 & 4 */
|
||||
u16 txopLimit;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct wme_parameter_element {
|
||||
/* required fields for WME version 1 */
|
||||
u8 oui[3];
|
||||
u8 oui_type;
|
||||
u8 oui_subtype;
|
||||
u8 version;
|
||||
u8 acInfo;
|
||||
u8 reserved;
|
||||
struct wme_ac_parameter ac[4];
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define WPA_PUT_LE16(a, val) \
|
||||
do { \
|
||||
(a)[1] = ((u16) (val)) >> 8; \
|
||||
(a)[0] = ((u16) (val)) & 0xff; \
|
||||
} while (0)
|
||||
|
||||
#define WPA_PUT_BE32(a, val) \
|
||||
do { \
|
||||
(a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \
|
||||
(a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \
|
||||
(a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \
|
||||
(a)[3] = (u8) (((u32) (val)) & 0xff); \
|
||||
} while (0)
|
||||
|
||||
#define WPA_PUT_LE32(a, val) \
|
||||
do { \
|
||||
(a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
|
||||
(a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
|
||||
(a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
|
||||
(a)[0] = (u8) (((u32) (val)) & 0xff); \
|
||||
} while (0)
|
||||
|
||||
#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val))
|
||||
//#define RSN_SELECTOR_PUT(a, val) WPA_PUT_LE32((u8 *) (a), (val))
|
||||
|
||||
|
||||
|
||||
/* Action category code */
|
||||
enum ieee80211_category {
|
||||
WLAN_CATEGORY_SPECTRUM_MGMT = 0,
|
||||
WLAN_CATEGORY_QOS = 1,
|
||||
WLAN_CATEGORY_DLS = 2,
|
||||
WLAN_CATEGORY_BACK = 3,
|
||||
WLAN_CATEGORY_HT = 7,
|
||||
WLAN_CATEGORY_WMM = 17,
|
||||
};
|
||||
|
||||
/* SPECTRUM_MGMT action code */
|
||||
enum ieee80211_spectrum_mgmt_actioncode {
|
||||
WLAN_ACTION_SPCT_MSR_REQ = 0,
|
||||
WLAN_ACTION_SPCT_MSR_RPRT = 1,
|
||||
WLAN_ACTION_SPCT_TPC_REQ = 2,
|
||||
WLAN_ACTION_SPCT_TPC_RPRT = 3,
|
||||
WLAN_ACTION_SPCT_CHL_SWITCH = 4,
|
||||
WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5,
|
||||
};
|
||||
|
||||
/* BACK action code */
|
||||
enum ieee80211_back_actioncode {
|
||||
WLAN_ACTION_ADDBA_REQ = 0,
|
||||
WLAN_ACTION_ADDBA_RESP = 1,
|
||||
WLAN_ACTION_DELBA = 2,
|
||||
};
|
||||
|
||||
/* HT features action code */
|
||||
enum ieee80211_ht_actioncode {
|
||||
WLAN_ACTION_NOTIFY_CH_WIDTH = 0,
|
||||
WLAN_ACTION_SM_PS = 1,
|
||||
WLAN_ACTION_PSPM = 2,
|
||||
WLAN_ACTION_PCO_PHASE = 3,
|
||||
WLAN_ACTION_MIMO_CSI_MX = 4,
|
||||
WLAN_ACTION_MIMO_NONCP_BF = 5,
|
||||
WLAN_ACTION_MIMP_CP_BF = 6,
|
||||
WLAN_ACTION_ASEL_INDICATES_FB = 7,
|
||||
WLAN_ACTION_HI_INFO_EXCHG = 8,
|
||||
};
|
||||
|
||||
/* BACK (block-ack) parties */
|
||||
enum ieee80211_back_parties {
|
||||
WLAN_BACK_RECIPIENT = 0,
|
||||
WLAN_BACK_INITIATOR = 1,
|
||||
WLAN_BACK_TIMER = 2,
|
||||
};
|
||||
|
||||
struct ieee80211_mgmt {
|
||||
u16 frame_control;
|
||||
u16 duration;
|
||||
u8 da[6];
|
||||
u8 sa[6];
|
||||
u8 bssid[6];
|
||||
u16 seq_ctrl;
|
||||
union {
|
||||
struct {
|
||||
u16 auth_alg;
|
||||
u16 auth_transaction;
|
||||
u16 status_code;
|
||||
/* possibly followed by Challenge text */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) auth;
|
||||
struct {
|
||||
u16 reason_code;
|
||||
} __attribute__ ((packed)) deauth;
|
||||
struct {
|
||||
u16 capab_info;
|
||||
u16 listen_interval;
|
||||
/* followed by SSID and Supported rates */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) assoc_req;
|
||||
struct {
|
||||
u16 capab_info;
|
||||
u16 status_code;
|
||||
u16 aid;
|
||||
/* followed by Supported rates */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) assoc_resp, reassoc_resp;
|
||||
struct {
|
||||
u16 capab_info;
|
||||
u16 listen_interval;
|
||||
u8 current_ap[6];
|
||||
/* followed by SSID and Supported rates */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) reassoc_req;
|
||||
struct {
|
||||
u16 reason_code;
|
||||
} __attribute__ ((packed)) disassoc;
|
||||
struct {
|
||||
__le64 timestamp;
|
||||
u16 beacon_int;
|
||||
u16 capab_info;
|
||||
/* followed by some of SSID, Supported rates,
|
||||
* FH Params, DS Params, CF Params, IBSS Params, TIM */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) beacon;
|
||||
struct {
|
||||
/* only variable items: SSID, Supported rates */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) probe_req;
|
||||
struct {
|
||||
__le64 timestamp;
|
||||
u16 beacon_int;
|
||||
u16 capab_info;
|
||||
/* followed by some of SSID, Supported rates,
|
||||
* FH Params, DS Params, CF Params, IBSS Params */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) probe_resp;
|
||||
struct {
|
||||
u8 category;
|
||||
union {
|
||||
struct {
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u8 status_code;
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) wme_action;
|
||||
#if 0
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 element_id;
|
||||
u8 length;
|
||||
struct ieee80211_channel_sw_ie sw_elem;
|
||||
} __attribute__ ((packed)) chan_switch;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u8 element_id;
|
||||
u8 length;
|
||||
struct ieee80211_msrment_ie msr_elem;
|
||||
} __attribute__ ((packed)) measurement;
|
||||
#endif
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u16 capab;
|
||||
u16 timeout;
|
||||
u16 start_seq_num;
|
||||
} __attribute__ ((packed)) addba_req;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u16 status;
|
||||
u16 capab;
|
||||
u16 timeout;
|
||||
} __attribute__ ((packed)) addba_resp;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u16 params;
|
||||
u16 reason_code;
|
||||
} __attribute__ ((packed)) delba;
|
||||
struct{
|
||||
u8 action_code;
|
||||
/* capab_info for open and confirm,
|
||||
* reason for close
|
||||
*/
|
||||
u16 aux;
|
||||
/* Followed in plink_confirm by status
|
||||
* code, AID and supported rates,
|
||||
* and directly by supported rates in
|
||||
* plink_open and plink_close
|
||||
*/
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) plink_action;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) mesh_action;
|
||||
} __attribute__ ((packed)) u;
|
||||
} __attribute__ ((packed)) action;
|
||||
} __attribute__ ((packed)) u;
|
||||
}__attribute__ ((packed));
|
||||
|
||||
/* mgmt header + 1 byte category code */
|
||||
#define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u)
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
******************************************************************************/
|
||||
#ifndef __IEEE80211_EXT_H
|
||||
#define __IEEE80211_EXT_H
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
|
||||
#define WMM_OUI_TYPE 2
|
||||
#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
|
||||
#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
|
||||
#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
|
||||
#define WMM_VERSION 1
|
||||
|
||||
#define WPA_PROTO_WPA BIT(0)
|
||||
#define WPA_PROTO_RSN BIT(1)
|
||||
|
||||
#define WPA_KEY_MGMT_IEEE8021X BIT(0)
|
||||
#define WPA_KEY_MGMT_PSK BIT(1)
|
||||
#define WPA_KEY_MGMT_NONE BIT(2)
|
||||
#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
|
||||
#define WPA_KEY_MGMT_WPA_NONE BIT(4)
|
||||
|
||||
|
||||
#define WPA_CAPABILITY_PREAUTH BIT(0)
|
||||
#define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6)
|
||||
#define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9)
|
||||
|
||||
|
||||
#define PMKID_LEN 16
|
||||
|
||||
|
||||
struct wpa_ie_hdr {
|
||||
u8 elem_id;
|
||||
u8 len;
|
||||
u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
|
||||
u8 version[2]; /* little endian */
|
||||
}__attribute__ ((packed));
|
||||
|
||||
struct rsn_ie_hdr {
|
||||
u8 elem_id; /* WLAN_EID_RSN */
|
||||
u8 len;
|
||||
u8 version[2]; /* little endian */
|
||||
}__attribute__ ((packed));
|
||||
|
||||
struct wme_ac_parameter {
|
||||
#if defined(CONFIG_LITTLE_ENDIAN)
|
||||
/* byte 1 */
|
||||
u8 aifsn:4,
|
||||
acm:1,
|
||||
aci:2,
|
||||
reserved:1;
|
||||
|
||||
/* byte 2 */
|
||||
u8 eCWmin:4,
|
||||
eCWmax:4;
|
||||
#elif defined(CONFIG_BIG_ENDIAN)
|
||||
/* byte 1 */
|
||||
u8 reserved:1,
|
||||
aci:2,
|
||||
acm:1,
|
||||
aifsn:4;
|
||||
|
||||
/* byte 2 */
|
||||
u8 eCWmax:4,
|
||||
eCWmin:4;
|
||||
#else
|
||||
#error "Please fix <endian.h>"
|
||||
#endif
|
||||
|
||||
/* bytes 3 & 4 */
|
||||
u16 txopLimit;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct wme_parameter_element {
|
||||
/* required fields for WME version 1 */
|
||||
u8 oui[3];
|
||||
u8 oui_type;
|
||||
u8 oui_subtype;
|
||||
u8 version;
|
||||
u8 acInfo;
|
||||
u8 reserved;
|
||||
struct wme_ac_parameter ac[4];
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define WPA_PUT_LE16(a, val) \
|
||||
do { \
|
||||
(a)[1] = ((u16) (val)) >> 8; \
|
||||
(a)[0] = ((u16) (val)) & 0xff; \
|
||||
} while (0)
|
||||
|
||||
#define WPA_PUT_BE32(a, val) \
|
||||
do { \
|
||||
(a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \
|
||||
(a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \
|
||||
(a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \
|
||||
(a)[3] = (u8) (((u32) (val)) & 0xff); \
|
||||
} while (0)
|
||||
|
||||
#define WPA_PUT_LE32(a, val) \
|
||||
do { \
|
||||
(a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
|
||||
(a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
|
||||
(a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
|
||||
(a)[0] = (u8) (((u32) (val)) & 0xff); \
|
||||
} while (0)
|
||||
|
||||
#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val))
|
||||
//#define RSN_SELECTOR_PUT(a, val) WPA_PUT_LE32((u8 *) (a), (val))
|
||||
|
||||
|
||||
|
||||
/* Action category code */
|
||||
enum ieee80211_category {
|
||||
WLAN_CATEGORY_SPECTRUM_MGMT = 0,
|
||||
WLAN_CATEGORY_QOS = 1,
|
||||
WLAN_CATEGORY_DLS = 2,
|
||||
WLAN_CATEGORY_BACK = 3,
|
||||
WLAN_CATEGORY_HT = 7,
|
||||
WLAN_CATEGORY_WMM = 17,
|
||||
};
|
||||
|
||||
/* SPECTRUM_MGMT action code */
|
||||
enum ieee80211_spectrum_mgmt_actioncode {
|
||||
WLAN_ACTION_SPCT_MSR_REQ = 0,
|
||||
WLAN_ACTION_SPCT_MSR_RPRT = 1,
|
||||
WLAN_ACTION_SPCT_TPC_REQ = 2,
|
||||
WLAN_ACTION_SPCT_TPC_RPRT = 3,
|
||||
WLAN_ACTION_SPCT_CHL_SWITCH = 4,
|
||||
WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5,
|
||||
};
|
||||
|
||||
/* BACK action code */
|
||||
enum ieee80211_back_actioncode {
|
||||
WLAN_ACTION_ADDBA_REQ = 0,
|
||||
WLAN_ACTION_ADDBA_RESP = 1,
|
||||
WLAN_ACTION_DELBA = 2,
|
||||
};
|
||||
|
||||
/* HT features action code */
|
||||
enum ieee80211_ht_actioncode {
|
||||
WLAN_ACTION_NOTIFY_CH_WIDTH = 0,
|
||||
WLAN_ACTION_SM_PS = 1,
|
||||
WLAN_ACTION_PSPM = 2,
|
||||
WLAN_ACTION_PCO_PHASE = 3,
|
||||
WLAN_ACTION_MIMO_CSI_MX = 4,
|
||||
WLAN_ACTION_MIMO_NONCP_BF = 5,
|
||||
WLAN_ACTION_MIMP_CP_BF = 6,
|
||||
WLAN_ACTION_ASEL_INDICATES_FB = 7,
|
||||
WLAN_ACTION_HI_INFO_EXCHG = 8,
|
||||
};
|
||||
|
||||
/* BACK (block-ack) parties */
|
||||
enum ieee80211_back_parties {
|
||||
WLAN_BACK_RECIPIENT = 0,
|
||||
WLAN_BACK_INITIATOR = 1,
|
||||
WLAN_BACK_TIMER = 2,
|
||||
};
|
||||
|
||||
struct ieee80211_mgmt {
|
||||
u16 frame_control;
|
||||
u16 duration;
|
||||
u8 da[6];
|
||||
u8 sa[6];
|
||||
u8 bssid[6];
|
||||
u16 seq_ctrl;
|
||||
union {
|
||||
struct {
|
||||
u16 auth_alg;
|
||||
u16 auth_transaction;
|
||||
u16 status_code;
|
||||
/* possibly followed by Challenge text */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) auth;
|
||||
struct {
|
||||
u16 reason_code;
|
||||
} __attribute__ ((packed)) deauth;
|
||||
struct {
|
||||
u16 capab_info;
|
||||
u16 listen_interval;
|
||||
/* followed by SSID and Supported rates */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) assoc_req;
|
||||
struct {
|
||||
u16 capab_info;
|
||||
u16 status_code;
|
||||
u16 aid;
|
||||
/* followed by Supported rates */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) assoc_resp, reassoc_resp;
|
||||
struct {
|
||||
u16 capab_info;
|
||||
u16 listen_interval;
|
||||
u8 current_ap[6];
|
||||
/* followed by SSID and Supported rates */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) reassoc_req;
|
||||
struct {
|
||||
u16 reason_code;
|
||||
} __attribute__ ((packed)) disassoc;
|
||||
struct {
|
||||
__le64 timestamp;
|
||||
u16 beacon_int;
|
||||
u16 capab_info;
|
||||
/* followed by some of SSID, Supported rates,
|
||||
* FH Params, DS Params, CF Params, IBSS Params, TIM */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) beacon;
|
||||
struct {
|
||||
/* only variable items: SSID, Supported rates */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) probe_req;
|
||||
struct {
|
||||
__le64 timestamp;
|
||||
u16 beacon_int;
|
||||
u16 capab_info;
|
||||
/* followed by some of SSID, Supported rates,
|
||||
* FH Params, DS Params, CF Params, IBSS Params */
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) probe_resp;
|
||||
struct {
|
||||
u8 category;
|
||||
union {
|
||||
struct {
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u8 status_code;
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) wme_action;
|
||||
#if 0
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 element_id;
|
||||
u8 length;
|
||||
struct ieee80211_channel_sw_ie sw_elem;
|
||||
} __attribute__ ((packed)) chan_switch;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u8 element_id;
|
||||
u8 length;
|
||||
struct ieee80211_msrment_ie msr_elem;
|
||||
} __attribute__ ((packed)) measurement;
|
||||
#endif
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u16 capab;
|
||||
u16 timeout;
|
||||
u16 start_seq_num;
|
||||
} __attribute__ ((packed)) addba_req;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u16 status;
|
||||
u16 capab;
|
||||
u16 timeout;
|
||||
} __attribute__ ((packed)) addba_resp;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u16 params;
|
||||
u16 reason_code;
|
||||
} __attribute__ ((packed)) delba;
|
||||
struct{
|
||||
u8 action_code;
|
||||
/* capab_info for open and confirm,
|
||||
* reason for close
|
||||
*/
|
||||
u16 aux;
|
||||
/* Followed in plink_confirm by status
|
||||
* code, AID and supported rates,
|
||||
* and directly by supported rates in
|
||||
* plink_open and plink_close
|
||||
*/
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) plink_action;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 variable[0];
|
||||
} __attribute__ ((packed)) mesh_action;
|
||||
} __attribute__ ((packed)) u;
|
||||
} __attribute__ ((packed)) action;
|
||||
} __attribute__ ((packed)) u;
|
||||
}__attribute__ ((packed));
|
||||
|
||||
/* mgmt header + 1 byte category code */
|
||||
#define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u)
|
||||
|
||||
|
||||
|
||||
#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.
|
||||
|
@ -17,13 +17,13 @@
|
|||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _LINUX_IF_ETHER_H
|
||||
#define _LINUX_IF_ETHER_H
|
||||
|
||||
/*
|
||||
* IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
|
||||
* and FCS/CRC (frame check sequence).
|
||||
* and FCS/CRC (frame check sequence).
|
||||
*/
|
||||
|
||||
#define ETH_ALEN 6 /* Octets in one ethernet addr */
|
||||
|
@ -69,18 +69,18 @@
|
|||
/*
|
||||
* Non DIX types. Won't clash for 1500 types.
|
||||
*/
|
||||
|
||||
|
||||
#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
|
||||
#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
|
||||
#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
|
||||
#define ETH_P_802_2 0x0004 /* 802.2 frames */
|
||||
#define ETH_P_802_2 0x0004 /* 802.2 frames */
|
||||
#define ETH_P_SNAP 0x0005 /* Internal only */
|
||||
#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
|
||||
#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
|
||||
#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
|
||||
#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
|
||||
#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
|
||||
#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
|
||||
#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
|
||||
#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
|
||||
#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
|
||||
#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
|
||||
#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
|
||||
|
@ -89,8 +89,8 @@
|
|||
/*
|
||||
* This is an Ethernet frame header.
|
||||
*/
|
||||
|
||||
struct ethhdr
|
||||
|
||||
struct ethhdr
|
||||
{
|
||||
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
|
||||
unsigned char h_source[ETH_ALEN]; /* source ether addr */
|
||||
|
@ -110,4 +110,3 @@ struct _vlan {
|
|||
|
||||
|
||||
#endif /* _LINUX_IF_ETHER_H */
|
||||
|
||||
|
|
|
@ -1,176 +1,175 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __IOCTL_CFG80211_H__
|
||||
#define __IOCTL_CFG80211_H__
|
||||
|
||||
|
||||
#if defined(RTW_USE_CFG80211_STA_EVENT)
|
||||
#undef CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
|
||||
#endif
|
||||
|
||||
struct rtw_wdev_invit_info {
|
||||
u8 state; /* 0: req, 1:rep */
|
||||
u8 peer_mac[ETH_ALEN];
|
||||
u8 active;
|
||||
u8 token;
|
||||
u8 flags;
|
||||
u8 status;
|
||||
u8 req_op_ch;
|
||||
u8 rsp_op_ch;
|
||||
};
|
||||
|
||||
#define rtw_wdev_invit_info_init(invit_info) \
|
||||
do { \
|
||||
(invit_info)->state = 0xff; \
|
||||
_rtw_memset((invit_info)->peer_mac, 0, ETH_ALEN); \
|
||||
(invit_info)->active = 0xff; \
|
||||
(invit_info)->token = 0; \
|
||||
(invit_info)->flags = 0x00; \
|
||||
(invit_info)->status = 0xff; \
|
||||
(invit_info)->req_op_ch = 0; \
|
||||
(invit_info)->rsp_op_ch = 0; \
|
||||
} while (0)
|
||||
|
||||
struct rtw_wdev_nego_info {
|
||||
u8 state; /* 0: req, 1:rep, 3:conf */
|
||||
u8 peer_mac[ETH_ALEN];
|
||||
u8 active;
|
||||
u8 token;
|
||||
u8 status;
|
||||
u8 req_intent;
|
||||
u8 req_op_ch;
|
||||
u8 req_listen_ch;
|
||||
u8 rsp_intent;
|
||||
u8 rsp_op_ch;
|
||||
u8 conf_op_ch;
|
||||
};
|
||||
|
||||
#define rtw_wdev_nego_info_init(nego_info) \
|
||||
do { \
|
||||
(nego_info)->state = 0xff; \
|
||||
_rtw_memset((nego_info)->peer_mac, 0, ETH_ALEN); \
|
||||
(nego_info)->active = 0xff; \
|
||||
(nego_info)->token = 0; \
|
||||
(nego_info)->status = 0xff; \
|
||||
(nego_info)->req_intent = 0xff; \
|
||||
(nego_info)->req_op_ch = 0; \
|
||||
(nego_info)->req_listen_ch = 0; \
|
||||
(nego_info)->rsp_intent = 0xff; \
|
||||
(nego_info)->rsp_op_ch = 0; \
|
||||
(nego_info)->conf_op_ch = 0; \
|
||||
} while (0)
|
||||
|
||||
struct rtw_wdev_priv
|
||||
{
|
||||
struct wireless_dev *rtw_wdev;
|
||||
|
||||
struct adapter *padapter;
|
||||
|
||||
struct cfg80211_scan_request *scan_request;
|
||||
_lock scan_req_lock;
|
||||
|
||||
struct net_device *pmon_ndev;//for monitor interface
|
||||
char ifname_mon[IFNAMSIZ + 1]; //interface name for monitor interface
|
||||
|
||||
u8 p2p_enabled;
|
||||
|
||||
u8 provdisc_req_issued;
|
||||
|
||||
struct rtw_wdev_invit_info invit_info;
|
||||
struct rtw_wdev_nego_info nego_info;
|
||||
|
||||
u8 bandroid_scan;
|
||||
bool block;
|
||||
bool power_mgmt;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
ATOMIC_T ro_ch_to;
|
||||
ATOMIC_T switch_ch_to;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#define wdev_to_priv(w) ((struct rtw_wdev_priv *)(wdev_priv(w)))
|
||||
|
||||
#define wiphy_to_adapter(x) (struct adapter *)(((struct rtw_wdev_priv*)wiphy_priv(x))->padapter)
|
||||
|
||||
#define wiphy_to_wdev(x) (struct wireless_dev *)(((struct rtw_wdev_priv*)wiphy_priv(x))->rtw_wdev)
|
||||
|
||||
int rtw_wdev_alloc(struct adapter *padapter, struct device *dev);
|
||||
void rtw_wdev_free(struct wireless_dev *wdev);
|
||||
void rtw_wdev_unregister(struct wireless_dev *wdev);
|
||||
|
||||
void rtw_cfg80211_init_wiphy(struct adapter *padapter);
|
||||
|
||||
void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter);
|
||||
struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wlan_network *pnetwork);
|
||||
int rtw_cfg80211_check_bss(struct adapter *padapter);
|
||||
void rtw_cfg80211_ibss_indicate_connect(struct adapter *padapter);
|
||||
void rtw_cfg80211_indicate_connect(struct adapter *padapter);
|
||||
void rtw_cfg80211_indicate_disconnect(struct adapter *padapter);
|
||||
void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv, bool aborted);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len);
|
||||
void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter, unsigned char *da, unsigned short reason);
|
||||
#endif //CONFIG_AP_MODE
|
||||
|
||||
void rtw_cfg80211_issue_p2p_provision_request(struct adapter *padapter, const u8 *buf, size_t len);
|
||||
void rtw_cfg80211_rx_p2p_action_public(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len);
|
||||
void rtw_cfg80211_rx_action_p2p(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len);
|
||||
void rtw_cfg80211_rx_action(struct adapter *adapter, u8 *frame, uint frame_len, const char*msg);
|
||||
|
||||
int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, int type);
|
||||
|
||||
bool rtw_cfg80211_pwr_mgmt(struct adapter *adapter);
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
|
||||
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, buf, len, gfp)
|
||||
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
|
||||
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp)
|
||||
#else
|
||||
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp)
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
|
||||
#define rtw_cfg80211_send_rx_assoc(adapter, bss, buf, len) cfg80211_send_rx_assoc((adapter)->pnetdev, buf, len)
|
||||
#else
|
||||
#define rtw_cfg80211_send_rx_assoc(adapter, bss, buf, len) cfg80211_send_rx_assoc((adapter)->pnetdev, bss, buf, len)
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
|
||||
#define rtw_cfg80211_mgmt_tx_status(adapter, cookie, buf, len, ack, gfp) cfg80211_mgmt_tx_status((adapter)->pnetdev, cookie, buf, len, ack, gfp)
|
||||
#else
|
||||
#define rtw_cfg80211_mgmt_tx_status(adapter, cookie, buf, len, ack, gfp) cfg80211_mgmt_tx_status((adapter)->rtw_wdev, cookie, buf, len, ack, gfp)
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
|
||||
#define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->pnetdev, cookie, chan, channel_type, duration, gfp)
|
||||
#define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->pnetdev, cookie, chan, chan_type, gfp)
|
||||
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
|
||||
#define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->rtw_wdev, cookie, chan, channel_type, duration, gfp)
|
||||
#define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->rtw_wdev, cookie, chan, chan_type, gfp)
|
||||
#else
|
||||
#define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->rtw_wdev, cookie, chan, duration, gfp)
|
||||
#define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->rtw_wdev, cookie, chan, gfp)
|
||||
#endif
|
||||
|
||||
#endif //__IOCTL_CFG80211_H__
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __IOCTL_CFG80211_H__
|
||||
#define __IOCTL_CFG80211_H__
|
||||
|
||||
|
||||
#if defined(RTW_USE_CFG80211_STA_EVENT)
|
||||
#undef CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
|
||||
#endif
|
||||
|
||||
struct rtw_wdev_invit_info {
|
||||
u8 state; /* 0: req, 1:rep */
|
||||
u8 peer_mac[ETH_ALEN];
|
||||
u8 active;
|
||||
u8 token;
|
||||
u8 flags;
|
||||
u8 status;
|
||||
u8 req_op_ch;
|
||||
u8 rsp_op_ch;
|
||||
};
|
||||
|
||||
#define rtw_wdev_invit_info_init(invit_info) \
|
||||
do { \
|
||||
(invit_info)->state = 0xff; \
|
||||
_rtw_memset((invit_info)->peer_mac, 0, ETH_ALEN); \
|
||||
(invit_info)->active = 0xff; \
|
||||
(invit_info)->token = 0; \
|
||||
(invit_info)->flags = 0x00; \
|
||||
(invit_info)->status = 0xff; \
|
||||
(invit_info)->req_op_ch = 0; \
|
||||
(invit_info)->rsp_op_ch = 0; \
|
||||
} while (0)
|
||||
|
||||
struct rtw_wdev_nego_info {
|
||||
u8 state; /* 0: req, 1:rep, 3:conf */
|
||||
u8 peer_mac[ETH_ALEN];
|
||||
u8 active;
|
||||
u8 token;
|
||||
u8 status;
|
||||
u8 req_intent;
|
||||
u8 req_op_ch;
|
||||
u8 req_listen_ch;
|
||||
u8 rsp_intent;
|
||||
u8 rsp_op_ch;
|
||||
u8 conf_op_ch;
|
||||
};
|
||||
|
||||
#define rtw_wdev_nego_info_init(nego_info) \
|
||||
do { \
|
||||
(nego_info)->state = 0xff; \
|
||||
_rtw_memset((nego_info)->peer_mac, 0, ETH_ALEN); \
|
||||
(nego_info)->active = 0xff; \
|
||||
(nego_info)->token = 0; \
|
||||
(nego_info)->status = 0xff; \
|
||||
(nego_info)->req_intent = 0xff; \
|
||||
(nego_info)->req_op_ch = 0; \
|
||||
(nego_info)->req_listen_ch = 0; \
|
||||
(nego_info)->rsp_intent = 0xff; \
|
||||
(nego_info)->rsp_op_ch = 0; \
|
||||
(nego_info)->conf_op_ch = 0; \
|
||||
} while (0)
|
||||
|
||||
struct rtw_wdev_priv
|
||||
{
|
||||
struct wireless_dev *rtw_wdev;
|
||||
|
||||
struct adapter *padapter;
|
||||
|
||||
struct cfg80211_scan_request *scan_request;
|
||||
_lock scan_req_lock;
|
||||
|
||||
struct net_device *pmon_ndev;//for monitor interface
|
||||
char ifname_mon[IFNAMSIZ + 1]; //interface name for monitor interface
|
||||
|
||||
u8 p2p_enabled;
|
||||
|
||||
u8 provdisc_req_issued;
|
||||
|
||||
struct rtw_wdev_invit_info invit_info;
|
||||
struct rtw_wdev_nego_info nego_info;
|
||||
|
||||
u8 bandroid_scan;
|
||||
bool block;
|
||||
bool power_mgmt;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
ATOMIC_T ro_ch_to;
|
||||
ATOMIC_T switch_ch_to;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#define wdev_to_priv(w) ((struct rtw_wdev_priv *)(wdev_priv(w)))
|
||||
|
||||
#define wiphy_to_adapter(x) (struct adapter *)(((struct rtw_wdev_priv*)wiphy_priv(x))->padapter)
|
||||
|
||||
#define wiphy_to_wdev(x) (struct wireless_dev *)(((struct rtw_wdev_priv*)wiphy_priv(x))->rtw_wdev)
|
||||
|
||||
int rtw_wdev_alloc(struct adapter *padapter, struct device *dev);
|
||||
void rtw_wdev_free(struct wireless_dev *wdev);
|
||||
void rtw_wdev_unregister(struct wireless_dev *wdev);
|
||||
|
||||
void rtw_cfg80211_init_wiphy(struct adapter *padapter);
|
||||
|
||||
void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter);
|
||||
struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wlan_network *pnetwork);
|
||||
int rtw_cfg80211_check_bss(struct adapter *padapter);
|
||||
void rtw_cfg80211_ibss_indicate_connect(struct adapter *padapter);
|
||||
void rtw_cfg80211_indicate_connect(struct adapter *padapter);
|
||||
void rtw_cfg80211_indicate_disconnect(struct adapter *padapter);
|
||||
void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv, bool aborted);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len);
|
||||
void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter, unsigned char *da, unsigned short reason);
|
||||
#endif //CONFIG_AP_MODE
|
||||
|
||||
void rtw_cfg80211_issue_p2p_provision_request(struct adapter *padapter, const u8 *buf, size_t len);
|
||||
void rtw_cfg80211_rx_p2p_action_public(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len);
|
||||
void rtw_cfg80211_rx_action_p2p(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len);
|
||||
void rtw_cfg80211_rx_action(struct adapter *adapter, u8 *frame, uint frame_len, const char*msg);
|
||||
|
||||
int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, int type);
|
||||
|
||||
bool rtw_cfg80211_pwr_mgmt(struct adapter *adapter);
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
|
||||
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, buf, len, gfp)
|
||||
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
|
||||
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp)
|
||||
#else
|
||||
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp)
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
|
||||
#define rtw_cfg80211_send_rx_assoc(adapter, bss, buf, len) cfg80211_send_rx_assoc((adapter)->pnetdev, buf, len)
|
||||
#else
|
||||
#define rtw_cfg80211_send_rx_assoc(adapter, bss, buf, len) cfg80211_send_rx_assoc((adapter)->pnetdev, bss, buf, len)
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
|
||||
#define rtw_cfg80211_mgmt_tx_status(adapter, cookie, buf, len, ack, gfp) cfg80211_mgmt_tx_status((adapter)->pnetdev, cookie, buf, len, ack, gfp)
|
||||
#else
|
||||
#define rtw_cfg80211_mgmt_tx_status(adapter, cookie, buf, len, ack, gfp) cfg80211_mgmt_tx_status((adapter)->rtw_wdev, cookie, buf, len, ack, gfp)
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
|
||||
#define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->pnetdev, cookie, chan, channel_type, duration, gfp)
|
||||
#define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->pnetdev, cookie, chan, chan_type, gfp)
|
||||
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
|
||||
#define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->rtw_wdev, cookie, chan, channel_type, duration, gfp)
|
||||
#define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->rtw_wdev, cookie, chan, chan_type, gfp)
|
||||
#else
|
||||
#define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->rtw_wdev, cookie, chan, duration, gfp)
|
||||
#define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->rtw_wdev, cookie, chan, gfp)
|
||||
#endif
|
||||
|
||||
#endif //__IOCTL_CFG80211_H__
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -101,7 +101,7 @@ struct ip_options {
|
|||
is_data:1, /* Options in __data, rather than skb */
|
||||
is_strictroute:1, /* Strict source route */
|
||||
srr_is_hit:1, /* Packet destination addr was our one */
|
||||
is_changed:1, /* IP checksum more not valid */
|
||||
is_changed:1, /* IP checksum more not valid */
|
||||
rr_needaddr:1, /* Need to record addr of outgoing dev */
|
||||
ts_needtime:1, /* Need to record timestamp */
|
||||
ts_needaddr:1; /* Need to record addr of outgoing dev */
|
||||
|
@ -119,7 +119,7 @@ struct iphdr {
|
|||
version:4;
|
||||
#elif defined (__BIG_ENDIAN_BITFIELD)
|
||||
__u8 version:4,
|
||||
ihl:4;
|
||||
ihl:4;
|
||||
#else
|
||||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
|
@ -136,4 +136,3 @@ struct iphdr {
|
|||
};
|
||||
|
||||
#endif /* _LINUX_IP_H */
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -37,4 +37,3 @@ extern void rtw_report_sec_ie(struct adapter *adapter,u8 authmode,u8 *sec_ie);
|
|||
void rtw_reset_securitypriv( struct adapter *adapter );
|
||||
|
||||
#endif //_MLME_OSDEP_H_
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -38,7 +38,7 @@
|
|||
#define OID_RT_PRO_RESET_DUT 0xFF818000
|
||||
#define OID_RT_PRO_SET_DATA_RATE 0xFF818001
|
||||
#define OID_RT_PRO_START_TEST 0xFF818002
|
||||
#define OID_RT_PRO_STOP_TEST 0xFF818003
|
||||
#define OID_RT_PRO_STOP_TEST 0xFF818003
|
||||
#define OID_RT_PRO_SET_PREAMBLE 0xFF818004
|
||||
#define OID_RT_PRO_SET_SCRAMBLER 0xFF818005
|
||||
#define OID_RT_PRO_SET_FILTER_BB 0xFF818006
|
||||
|
@ -71,7 +71,7 @@
|
|||
#define OID_RT_PRO_READ_EEPROM 0xFF818022
|
||||
#define OID_RT_PRO_RESET_TX_PACKET_SENT 0xFF818023
|
||||
#define OID_RT_PRO_QUERY_TX_PACKET_SENT 0xFF818024
|
||||
#define OID_RT_PRO_RESET_RX_PACKET_RECEIVED 0xFF818025
|
||||
#define OID_RT_PRO_RESET_RX_PACKET_RECEIVED 0xFF818025
|
||||
#define OID_RT_PRO_QUERY_RX_PACKET_RECEIVED 0xFF818026
|
||||
#define OID_RT_PRO_QUERY_RX_PACKET_CRC32_ERROR 0xFF818027
|
||||
#define OID_RT_PRO_QUERY_CURRENT_ADDRESS 0xFF818028
|
||||
|
@ -84,7 +84,7 @@
|
|||
#define OID_RT_PRO_SET_MODULATION 0xFF81802F
|
||||
//
|
||||
|
||||
//Sean
|
||||
//Sean
|
||||
#define OID_RT_DRIVER_OPTION 0xFF818080
|
||||
#define OID_RT_RF_OFF 0xFF818081
|
||||
#define OID_RT_AUTH_STATUS 0xFF818082
|
||||
|
@ -114,15 +114,15 @@
|
|||
#define OID_RT_WIRELESS_MODE_STARTING_ADHOC 0xFF818503
|
||||
//
|
||||
|
||||
#define OID_RT_GET_CONNECT_STATE 0xFF030001
|
||||
#define OID_RT_RESCAN 0xFF030002
|
||||
#define OID_RT_GET_CONNECT_STATE 0xFF030001
|
||||
#define OID_RT_RESCAN 0xFF030002
|
||||
#define OID_RT_SET_KEY_LENGTH 0xFF030003
|
||||
#define OID_RT_SET_DEFAULT_KEY_ID 0xFF030004
|
||||
|
||||
#define OID_RT_SET_CHANNEL 0xFF010182
|
||||
#define OID_RT_SET_SNIFFER_MODE 0xFF010183
|
||||
#define OID_RT_GET_SIGNAL_QUALITY 0xFF010184
|
||||
#define OID_RT_GET_SMALL_PACKET_CRC 0xFF010185
|
||||
#define OID_RT_SET_SNIFFER_MODE 0xFF010183
|
||||
#define OID_RT_GET_SIGNAL_QUALITY 0xFF010184
|
||||
#define OID_RT_GET_SMALL_PACKET_CRC 0xFF010185
|
||||
#define OID_RT_GET_MIDDLE_PACKET_CRC 0xFF010186
|
||||
#define OID_RT_GET_LARGE_PACKET_CRC 0xFF010187
|
||||
#define OID_RT_GET_TX_RETRY 0xFF010188
|
||||
|
@ -239,8 +239,8 @@
|
|||
#define OID_RT_PRO_READ_REGISTER 0xFF871101 //Q
|
||||
#define OID_RT_PRO_WRITE_REGISTER 0xFF871102 //S
|
||||
|
||||
#define OID_RT_PRO_BURST_READ_REGISTER 0xFF871103 //Q
|
||||
#define OID_RT_PRO_BURST_WRITE_REGISTER 0xFF871104 //S
|
||||
#define OID_RT_PRO_BURST_READ_REGISTER 0xFF871103 //Q
|
||||
#define OID_RT_PRO_BURST_WRITE_REGISTER 0xFF871104 //S
|
||||
|
||||
#define OID_RT_PRO_WRITE_TXCMD 0xFF871105 //S
|
||||
|
||||
|
@ -283,9 +283,9 @@
|
|||
#define OID_RT_PRO_READ_TSSI 0xFF871123//S
|
||||
#define OID_RT_PRO_SET_POWER_TRACKING 0xFF871124//S
|
||||
|
||||
|
||||
|
||||
#define OID_RT_PRO_QRY_PWRSTATE 0xFF871150 //Q
|
||||
#define OID_RT_PRO_SET_PWRSTATE 0xFF871151 //S
|
||||
#define OID_RT_PRO_SET_PWRSTATE 0xFF871151 //S
|
||||
|
||||
//Method 2 , using workitem
|
||||
#define OID_RT_SET_READ_REG 0xFF871181 //S
|
||||
|
@ -299,7 +299,7 @@
|
|||
|
||||
//For SDIO INTERFACE only
|
||||
#define OID_RT_PRO_SYNCPAGERW_SRAM 0xFF8711A0 //Q, S
|
||||
#define OID_RT_PRO_871X_DRV_EXT 0xFF8711A1
|
||||
#define OID_RT_PRO_871X_DRV_EXT 0xFF8711A1
|
||||
|
||||
//For USB INTERFACE only
|
||||
#define OID_RT_PRO_USB_VENDOR_REQ 0xFF8711B0 //Q, S
|
||||
|
@ -314,8 +314,8 @@
|
|||
|
||||
#define OID_RT_PRO_ENCRYPTION_CTRL 0xFF871200 //Q, S
|
||||
#define OID_RT_PRO_ADD_STA_INFO 0xFF871201 //S
|
||||
#define OID_RT_PRO_DELE_STA_INFO 0xFF871202 //S
|
||||
#define OID_RT_PRO_QUERY_DR_VARIABLE 0xFF871203 //Q
|
||||
#define OID_RT_PRO_DELE_STA_INFO 0xFF871202 //S
|
||||
#define OID_RT_PRO_QUERY_DR_VARIABLE 0xFF871203 //Q
|
||||
|
||||
#define OID_RT_PRO_RX_PACKET_TYPE 0xFF871204 //Q, S
|
||||
|
||||
|
@ -327,7 +327,7 @@
|
|||
#define OID_RT_SET_BANDWIDTH 0xFF871209 //S
|
||||
#define OID_RT_SET_CRYSTAL_CAP 0xFF87120A //S
|
||||
|
||||
#define OID_RT_SET_RX_PACKET_TYPE 0xFF87120B //S
|
||||
#define OID_RT_SET_RX_PACKET_TYPE 0xFF87120B //S
|
||||
|
||||
#define OID_RT_GET_EFUSE_MAX_SIZE 0xFF87120C //Q
|
||||
|
||||
|
@ -351,4 +351,3 @@
|
|||
#define OID_RT_PRO_EFUSE_MAP 0xFF871217 //Q, S
|
||||
|
||||
#endif //#ifndef __CUSTOM_OID_H
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
|
@ -16,7 +16,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef __NIC_SPEC_H__
|
||||
|
@ -44,4 +44,3 @@
|
|||
|
||||
|
||||
#endif // __RTL8711_SPEC_H__
|
||||
|
||||
|
|
|
@ -452,7 +452,7 @@ enum odm_ability_def {
|
|||
ODM_RF_CALIBRATION = BIT26,
|
||||
};
|
||||
|
||||
/* ODM_CMNINFO_INTERFACE */
|
||||
/* ODM_CMNINFO_INTERFACE */
|
||||
enum odm_interface_def {
|
||||
ODM_ITRF_PCIE = 0x1,
|
||||
ODM_ITRF_USB = 0x2,
|
||||
|
@ -578,7 +578,7 @@ enum odm_security {
|
|||
ODM_SEC_RESERVE = 3,
|
||||
ODM_SEC_AESCCMP = 4,
|
||||
ODM_SEC_WEP104 = 5,
|
||||
ODM_WEP_WPA_MIXED = 6, /* WEP + WPA */
|
||||
ODM_WEP_WPA_MIXED = 6, /* WEP + WPA */
|
||||
ODM_SEC_SMS4 = 7,
|
||||
};
|
||||
|
||||
|
@ -758,7 +758,7 @@ enum ant_div_type {
|
|||
|
||||
/* Copy from SD4 defined structure. We use to support PHY DM integration. */
|
||||
struct odm_dm_struct {
|
||||
/* Add for different team use temporarily */
|
||||
/* Add for different team use temporarily */
|
||||
struct adapter *Adapter; /* For CE/NIC team */
|
||||
struct rtl8192cd_priv *priv; /* For AP/ADSL team */
|
||||
/* WHen you use above pointers, they must be initialized. */
|
||||
|
|
|
@ -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.
|
||||
|
@ -16,156 +16,155 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __OSDEP_CE_SERVICE_H_
|
||||
#define __OSDEP_CE_SERVICE_H_
|
||||
|
||||
|
||||
#include <ndis.h>
|
||||
#include <ntddndis.h>
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#include "SDCardDDK.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#include <usbdi.h>
|
||||
#endif
|
||||
|
||||
typedef HANDLE _sema;
|
||||
typedef LIST_ENTRY _list;
|
||||
typedef NDIS_STATUS _OS_STATUS;
|
||||
|
||||
typedef NDIS_SPIN_LOCK _lock;
|
||||
|
||||
typedef HANDLE _rwlock; //Mutex
|
||||
|
||||
typedef u32 _irqL;
|
||||
|
||||
typedef NDIS_HANDLE _nic_hdl;
|
||||
|
||||
|
||||
typedef NDIS_MINIPORT_TIMER _timer;
|
||||
|
||||
struct __queue {
|
||||
LIST_ENTRY queue;
|
||||
_lock lock;
|
||||
};
|
||||
|
||||
typedef NDIS_PACKET _pkt;
|
||||
typedef NDIS_BUFFER _buffer;
|
||||
typedef struct __queue _queue;
|
||||
|
||||
typedef HANDLE _thread_hdl_;
|
||||
typedef DWORD thread_return;
|
||||
typedef void* thread_context;
|
||||
typedef NDIS_WORK_ITEM _workitem;
|
||||
|
||||
#define thread_exit() ExitThread(STATUS_SUCCESS); return 0;
|
||||
|
||||
|
||||
#define SEMA_UPBND (0x7FFFFFFF) //8192
|
||||
|
||||
__inline static _list *get_prev(_list *list)
|
||||
{
|
||||
return list->Blink;
|
||||
}
|
||||
|
||||
__inline static _list *get_next(_list *list)
|
||||
{
|
||||
return list->Flink;
|
||||
}
|
||||
|
||||
__inline static _list *get_list_head(_queue *queue)
|
||||
{
|
||||
return (&(queue->queue));
|
||||
}
|
||||
|
||||
#define LIST_CONTAINOR(ptr, type, member) CONTAINING_RECORD(ptr, type, member)
|
||||
|
||||
__inline static void _enter_critical(_lock *plock, _irqL *pirqL)
|
||||
{
|
||||
NdisAcquireSpinLock(plock);
|
||||
}
|
||||
|
||||
__inline static void _exit_critical(_lock *plock, _irqL *pirqL)
|
||||
{
|
||||
NdisReleaseSpinLock(plock);
|
||||
}
|
||||
|
||||
__inline static _enter_critical_ex(_lock *plock, _irqL *pirqL)
|
||||
{
|
||||
NdisDprAcquireSpinLock(plock);
|
||||
}
|
||||
|
||||
__inline static _exit_critical_ex(_lock *plock, _irqL *pirqL)
|
||||
{
|
||||
NdisDprReleaseSpinLock(plock);
|
||||
}
|
||||
|
||||
|
||||
__inline static void _enter_hwio_critical(_rwlock *prwlock, _irqL *pirqL)
|
||||
{
|
||||
WaitForSingleObject(*prwlock, INFINITE );
|
||||
|
||||
}
|
||||
|
||||
__inline static void _exit_hwio_critical(_rwlock *prwlock, _irqL *pirqL)
|
||||
{
|
||||
ReleaseMutex(*prwlock);
|
||||
}
|
||||
|
||||
__inline static void rtw_list_delete(_list *plist)
|
||||
{
|
||||
RemoveEntryList(plist);
|
||||
InitializeListHead(plist);
|
||||
}
|
||||
|
||||
__inline static void _init_timer(_timer *ptimer,_nic_hdl nic_hdl,void *pfunc,PVOID cntx)
|
||||
{
|
||||
NdisMInitializeTimer(ptimer, nic_hdl, pfunc, cntx);
|
||||
}
|
||||
|
||||
__inline static void _set_timer(_timer *ptimer,u32 delay_time)
|
||||
{
|
||||
NdisMSetTimer(ptimer,delay_time);
|
||||
}
|
||||
|
||||
__inline static void _cancel_timer(_timer *ptimer,u8 *bcancelled)
|
||||
{
|
||||
NdisMCancelTimer(ptimer,bcancelled);
|
||||
}
|
||||
|
||||
__inline static void _init_workitem(_workitem *pwork, void *pfunc, PVOID cntx)
|
||||
{
|
||||
|
||||
NdisInitializeWorkItem(pwork, pfunc, cntx);
|
||||
}
|
||||
|
||||
__inline static void _set_workitem(_workitem *pwork)
|
||||
{
|
||||
NdisScheduleWorkItem(pwork);
|
||||
}
|
||||
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
|
||||
//
|
||||
// Global Mutex: can only be used at PASSIVE level.
|
||||
//
|
||||
|
||||
#define ACQUIRE_GLOBAL_MUTEX(_MutexCounter) \
|
||||
{ \
|
||||
while (NdisInterlockedIncrement((PULONG)&(_MutexCounter)) != 1)\
|
||||
{ \
|
||||
NdisInterlockedDecrement((PULONG)&(_MutexCounter)); \
|
||||
NdisMSleep(10000); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define RELEASE_GLOBAL_MUTEX(_MutexCounter) \
|
||||
{ \
|
||||
NdisInterlockedDecrement((PULONG)&(_MutexCounter)); \
|
||||
}
|
||||
#endif
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __OSDEP_CE_SERVICE_H_
|
||||
#define __OSDEP_CE_SERVICE_H_
|
||||
|
||||
|
||||
#include <ndis.h>
|
||||
#include <ntddndis.h>
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#include "SDCardDDK.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#include <usbdi.h>
|
||||
#endif
|
||||
|
||||
typedef HANDLE _sema;
|
||||
typedef LIST_ENTRY _list;
|
||||
typedef NDIS_STATUS _OS_STATUS;
|
||||
|
||||
typedef NDIS_SPIN_LOCK _lock;
|
||||
|
||||
typedef HANDLE _rwlock; //Mutex
|
||||
|
||||
typedef u32 _irqL;
|
||||
|
||||
typedef NDIS_HANDLE _nic_hdl;
|
||||
|
||||
|
||||
typedef NDIS_MINIPORT_TIMER _timer;
|
||||
|
||||
struct __queue {
|
||||
LIST_ENTRY queue;
|
||||
_lock lock;
|
||||
};
|
||||
|
||||
typedef NDIS_PACKET _pkt;
|
||||
typedef NDIS_BUFFER _buffer;
|
||||
typedef struct __queue _queue;
|
||||
|
||||
typedef HANDLE _thread_hdl_;
|
||||
typedef DWORD thread_return;
|
||||
typedef void* thread_context;
|
||||
typedef NDIS_WORK_ITEM _workitem;
|
||||
|
||||
#define thread_exit() ExitThread(STATUS_SUCCESS); return 0;
|
||||
|
||||
|
||||
#define SEMA_UPBND (0x7FFFFFFF) //8192
|
||||
|
||||
__inline static _list *get_prev(_list *list)
|
||||
{
|
||||
return list->Blink;
|
||||
}
|
||||
|
||||
__inline static _list *get_next(_list *list)
|
||||
{
|
||||
return list->Flink;
|
||||
}
|
||||
|
||||
__inline static _list *get_list_head(_queue *queue)
|
||||
{
|
||||
return (&(queue->queue));
|
||||
}
|
||||
|
||||
#define LIST_CONTAINOR(ptr, type, member) CONTAINING_RECORD(ptr, type, member)
|
||||
|
||||
__inline static void _enter_critical(_lock *plock, _irqL *pirqL)
|
||||
{
|
||||
NdisAcquireSpinLock(plock);
|
||||
}
|
||||
|
||||
__inline static void _exit_critical(_lock *plock, _irqL *pirqL)
|
||||
{
|
||||
NdisReleaseSpinLock(plock);
|
||||
}
|
||||
|
||||
__inline static _enter_critical_ex(_lock *plock, _irqL *pirqL)
|
||||
{
|
||||
NdisDprAcquireSpinLock(plock);
|
||||
}
|
||||
|
||||
__inline static _exit_critical_ex(_lock *plock, _irqL *pirqL)
|
||||
{
|
||||
NdisDprReleaseSpinLock(plock);
|
||||
}
|
||||
|
||||
|
||||
__inline static void _enter_hwio_critical(_rwlock *prwlock, _irqL *pirqL)
|
||||
{
|
||||
WaitForSingleObject(*prwlock, INFINITE );
|
||||
|
||||
}
|
||||
|
||||
__inline static void _exit_hwio_critical(_rwlock *prwlock, _irqL *pirqL)
|
||||
{
|
||||
ReleaseMutex(*prwlock);
|
||||
}
|
||||
|
||||
__inline static void rtw_list_delete(_list *plist)
|
||||
{
|
||||
RemoveEntryList(plist);
|
||||
InitializeListHead(plist);
|
||||
}
|
||||
|
||||
__inline static void _init_timer(_timer *ptimer,_nic_hdl nic_hdl,void *pfunc,PVOID cntx)
|
||||
{
|
||||
NdisMInitializeTimer(ptimer, nic_hdl, pfunc, cntx);
|
||||
}
|
||||
|
||||
__inline static void _set_timer(_timer *ptimer,u32 delay_time)
|
||||
{
|
||||
NdisMSetTimer(ptimer,delay_time);
|
||||
}
|
||||
|
||||
__inline static void _cancel_timer(_timer *ptimer,u8 *bcancelled)
|
||||
{
|
||||
NdisMCancelTimer(ptimer,bcancelled);
|
||||
}
|
||||
|
||||
__inline static void _init_workitem(_workitem *pwork, void *pfunc, PVOID cntx)
|
||||
{
|
||||
|
||||
NdisInitializeWorkItem(pwork, pfunc, cntx);
|
||||
}
|
||||
|
||||
__inline static void _set_workitem(_workitem *pwork)
|
||||
{
|
||||
NdisScheduleWorkItem(pwork);
|
||||
}
|
||||
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
|
||||
//
|
||||
// Global Mutex: can only be used at PASSIVE level.
|
||||
//
|
||||
|
||||
#define ACQUIRE_GLOBAL_MUTEX(_MutexCounter) \
|
||||
{ \
|
||||
while (NdisInterlockedIncrement((PULONG)&(_MutexCounter)) != 1)\
|
||||
{ \
|
||||
NdisInterlockedDecrement((PULONG)&(_MutexCounter)); \
|
||||
NdisMSleep(10000); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define RELEASE_GLOBAL_MUTEX(_MutexCounter) \
|
||||
{ \
|
||||
NdisInterlockedDecrement((PULONG)&(_MutexCounter)); \
|
||||
}
|
||||
#endif
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue