mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 12:33:40 +00:00
rtl8188eu: Change C90 comments to kernel form for files in core/
This commit also includes some sparse fixes for endian issues. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
fb786d0283
commit
d2c90ee304
24 changed files with 4667 additions and 5077 deletions
403
core/rtw_ap.c
403
core/rtw_ap.c
File diff suppressed because it is too large
Load diff
|
@ -49,7 +49,7 @@
|
|||
|
||||
#ifdef CONFIG_BR_EXT
|
||||
|
||||
//#define BR_EXT_DEBUG
|
||||
/* define BR_EXT_DEBUG */
|
||||
|
||||
#define NAT25_IPV4 01
|
||||
#define NAT25_IPV6 02
|
||||
|
@ -62,7 +62,7 @@
|
|||
|
||||
#define MAGIC_CODE 0x8186
|
||||
#define MAGIC_CODE_LEN 2
|
||||
#define WAIT_TIME_PPPOE 5 // waiting time for pppoe server in sec
|
||||
#define WAIT_TIME_PPPOE 5 /* waiting time for pppoe server in sec */
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
How database records network address:
|
||||
|
@ -76,7 +76,7 @@
|
|||
-----------------------------------------------------------------*/
|
||||
|
||||
|
||||
//Find a tag in pppoe frame and return the pointer
|
||||
/* Find a tag in pppoe frame and return the pointer */
|
||||
static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
|
||||
{
|
||||
unsigned char *cur_ptr, *start_ptr;
|
||||
|
@ -84,7 +84,7 @@ static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, un
|
|||
|
||||
start_ptr = cur_ptr = (unsigned char *)ph->tag;
|
||||
while ((cur_ptr - start_ptr) < ntohs(ph->length)) {
|
||||
// prevent un-alignment access
|
||||
/* prevent un-alignment access */
|
||||
tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
|
||||
tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]);
|
||||
if (tagType == type)
|
||||
|
@ -107,7 +107,7 @@ static __inline__ int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_ta
|
|||
}
|
||||
|
||||
skb_put(skb, data_len);
|
||||
// have a room for new tag
|
||||
/* have a room for new tag */
|
||||
memmove(((unsigned char *)ph->tag + data_len), (unsigned char *)ph->tag, ntohs(ph->length));
|
||||
ph->length = htons(ntohs(ph->length) + data_len);
|
||||
memcpy((unsigned char *)ph->tag, tag, data_len);
|
||||
|
@ -307,8 +307,8 @@ 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;
|
||||
|
||||
//dst_mac[0] = 0xff;
|
||||
//dst_mac[1] = 0xff;
|
||||
/* dst_mac[0] = 0xff; */
|
||||
/* dst_mac[1] = 0xff; */
|
||||
/*modified by qinjunjie,ipv6 multicast address ix 0x33-33-xx-xx-xx-xx*/
|
||||
dst_mac[0] = 0x33;
|
||||
dst_mac[1] = 0x33;
|
||||
|
@ -385,9 +385,9 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
|||
static __inline__ void __network_hash_link(_adapter *priv,
|
||||
struct nat25_network_db_entry *ent, int hash)
|
||||
{
|
||||
// Caller must _enter_critical_bh already!
|
||||
//_irqL irqL;
|
||||
//_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
/* Caller must _enter_critical_bh already! */
|
||||
/* _irqL irqL; */
|
||||
/* _enter_critical_bh(&priv->br_ext_lock, &irqL); */
|
||||
|
||||
ent->next_hash = priv->nethash[hash];
|
||||
if (ent->next_hash != NULL)
|
||||
|
@ -395,15 +395,15 @@ static __inline__ void __network_hash_link(_adapter *priv,
|
|||
priv->nethash[hash] = ent;
|
||||
ent->pprev_hash = &priv->nethash[hash];
|
||||
|
||||
//_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
/* _exit_critical_bh(&priv->br_ext_lock, &irqL); */
|
||||
}
|
||||
|
||||
|
||||
static __inline__ void __network_hash_unlink(struct nat25_network_db_entry *ent)
|
||||
{
|
||||
// Caller must _enter_critical_bh already!
|
||||
//_irqL irqL;
|
||||
//_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
/* Caller must _enter_critical_bh already! */
|
||||
/* _irqL irqL; */
|
||||
/* _enter_critical_bh(&priv->br_ext_lock, &irqL); */
|
||||
|
||||
*(ent->pprev_hash) = ent->next_hash;
|
||||
if (ent->next_hash != NULL)
|
||||
|
@ -411,7 +411,7 @@ static __inline__ void __network_hash_unlink(struct nat25_network_db_entry *ent)
|
|||
ent->next_hash = NULL;
|
||||
ent->pprev_hash = NULL;
|
||||
|
||||
//_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
/* _exit_critical_bh(&priv->br_ext_lock, &irqL); */
|
||||
}
|
||||
|
||||
|
||||
|
@ -429,7 +429,7 @@ static int __nat25_db_network_lookup_and_replace(_adapter *priv,
|
|||
{
|
||||
if (!__nat25_has_expired(priv, db))
|
||||
{
|
||||
// replace the destination mac address
|
||||
/* replace the destination mac address */
|
||||
memcpy(skb->data, db->macAddr, ETH_ALEN);
|
||||
atomic_inc(&db->use_count);
|
||||
|
||||
|
@ -658,7 +658,7 @@ void nat25_db_expire(_adapter *priv)
|
|||
_irqL irqL;
|
||||
_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
//if (!priv->ethBrExtInfo.nat25_disable)
|
||||
/* if (!priv->ethBrExtInfo.nat25_disable) */
|
||||
{
|
||||
for (i=0; i<NAT25_HASH_SIZE; i++)
|
||||
{
|
||||
|
@ -777,6 +777,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
{
|
||||
unsigned short protocol;
|
||||
unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
|
||||
unsigned int tmp;
|
||||
|
||||
if (skb == NULL)
|
||||
return -1;
|
||||
|
@ -784,12 +785,12 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
if ((method <= NAT25_MIN) || (method >= NAT25_MAX))
|
||||
return -1;
|
||||
|
||||
protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN));
|
||||
protocol = be16_to_cpu(*((__be16 *)(skb->data + 2 * ETH_ALEN)));
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* Handle IP frame */
|
||||
/*---------------------------------------------------*/
|
||||
if (protocol == __constant_htons(ETH_P_IP))
|
||||
if (protocol == ETH_P_IP)
|
||||
{
|
||||
struct iphdr* iph = (struct iphdr *)(skb->data + ETH_HLEN);
|
||||
|
||||
|
@ -806,13 +807,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
case NAT25_INSERT:
|
||||
{
|
||||
//some muticast with source IP is all zero, maybe other case is illegal
|
||||
//in class A, B, C, host address is all zero or all one is illegal
|
||||
/* some muticast with source IP is all zero, maybe other case is illegal */
|
||||
/* in class A, B, C, host address is all zero or all one is illegal */
|
||||
if (iph->saddr == 0)
|
||||
return 0;
|
||||
DEBUG_INFO("NAT25: Insert IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr);
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, &iph->saddr);
|
||||
//record source IP address and , source mac address into db
|
||||
tmp = be32_to_cpu(iph->saddr);
|
||||
DEBUG_INFO("NAT25: Insert IP, SA=%08x, DA=%08x\n", tmp, iph->daddr);
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, &tmp);
|
||||
/* record source IP address and , source mac address into db */
|
||||
__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
|
||||
|
||||
__nat25_db_print(priv);
|
||||
|
@ -830,16 +832,17 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
(OPMODE & WIFI_ADHOC_STATE)))
|
||||
#endif
|
||||
{
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, &iph->daddr);
|
||||
tmp = be32_to_cpu(iph->daddr);
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, &tmp);
|
||||
|
||||
if (!__nat25_db_network_lookup_and_replace(priv, skb, networkAddr)) {
|
||||
if (*((unsigned char *)&iph->daddr + 3) == 0xff) {
|
||||
// L2 is unicast but L3 is broadcast, make L2 bacome broadcast
|
||||
/* L2 is unicast but L3 is broadcast, make L2 bacome broadcast */
|
||||
DEBUG_INFO("NAT25: Set DA as boardcast\n");
|
||||
memset(skb->data, 0xff, ETH_ALEN);
|
||||
}
|
||||
else {
|
||||
// forward unknow IP packet to upper TCP/IP
|
||||
/* forward unknow IP packet to upper TCP/IP */
|
||||
DEBUG_INFO("NAT25: Replace DA with BR's MAC\n");
|
||||
if ( (*(u32 *)priv->br_mac) == 0 && (*(u16 *)(priv->br_mac+4)) == 0 ) {
|
||||
printk("Re-init netdev_br_init() due to br_mac==0!\n");
|
||||
|
@ -860,7 +863,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle ARP frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if (protocol == __constant_htons(ETH_P_ARP))
|
||||
else if (protocol == ETH_P_ARP)
|
||||
{
|
||||
struct arphdr *arp = (struct arphdr *)(skb->data + ETH_HLEN);
|
||||
unsigned char *arp_ptr = (unsigned char *)(arp + 1);
|
||||
|
@ -868,21 +871,21 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
if (arp->ar_pro != __constant_htons(ETH_P_IP))
|
||||
{
|
||||
DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", htons(arp->ar_pro));
|
||||
DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", be16_to_cpu(arp->ar_pro));
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
return 0; // skb_copy for all ARP frame
|
||||
return 0; /* skb_copy for all ARP frame */
|
||||
|
||||
case NAT25_INSERT:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Insert ARP, MAC=%02x%02x%02x%02x%02x%02x\n", arp_ptr[0],
|
||||
arp_ptr[1], arp_ptr[2], arp_ptr[3], arp_ptr[4], arp_ptr[5]);
|
||||
|
||||
// change to ARP sender mac address to wlan STA address
|
||||
/* change to ARP sender mac address to wlan STA address */
|
||||
memcpy(arp_ptr, GET_MY_HWADDR(priv), ETH_ALEN);
|
||||
|
||||
arp_ptr += arp->ar_hln;
|
||||
|
@ -909,7 +912,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
|
||||
|
||||
// change to ARP target mac address to Lookup result
|
||||
/* change to ARP target mac address to Lookup result */
|
||||
arp_ptr = (unsigned char *)(arp + 1);
|
||||
arp_ptr += (arp->ar_hln + arp->ar_pln);
|
||||
memcpy(arp_ptr, skb->data, ETH_ALEN);
|
||||
|
@ -924,8 +927,8 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle IPX and Apple Talk frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if ((protocol == __constant_htons(ETH_P_IPX)) ||
|
||||
(protocol <= __constant_htons(ETH_FRAME_LEN)))
|
||||
else if ((protocol == ETH_P_IPX) ||
|
||||
(protocol <= ETH_FRAME_LEN))
|
||||
{
|
||||
unsigned char ipx_header[2] = {0xFF, 0xFF};
|
||||
struct ipxhdr *ipx = NULL;
|
||||
|
@ -933,12 +936,12 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
struct ddpehdr *ddp = NULL;
|
||||
unsigned char *framePtr = skb->data + ETH_HLEN;
|
||||
|
||||
if (protocol == __constant_htons(ETH_P_IPX))
|
||||
if (protocol == ETH_P_IPX)
|
||||
{
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet II)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
}
|
||||
else if (protocol <= __constant_htons(ETH_FRAME_LEN))
|
||||
else if (protocol <= ETH_FRAME_LEN)
|
||||
{
|
||||
if (!memcmp(ipx_header, framePtr, 2))
|
||||
{
|
||||
|
@ -952,28 +955,28 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
if (*framePtr == snap_8022_type)
|
||||
{
|
||||
unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37}; // IPX SNAP ID
|
||||
unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3}; // Apple Talk AARP SNAP ID
|
||||
unsigned char ddp_snap_id[5] = {0x08, 0x00, 0x07, 0x80, 0x9B}; // Apple Talk DDP SNAP ID
|
||||
unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37}; /* IPX SNAP ID */
|
||||
unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3}; /* Apple Talk AARP SNAP ID */
|
||||
unsigned char ddp_snap_id[5] = {0x08, 0x00, 0x07, 0x80, 0x9B}; /* Apple Talk DDP SNAP ID */
|
||||
|
||||
framePtr += 3; // eliminate the 802.2 header
|
||||
framePtr += 3; /* eliminate the 802.2 header */
|
||||
|
||||
if (!memcmp(ipx_snap_id, framePtr, 5))
|
||||
{
|
||||
framePtr += 5; // eliminate the SNAP header
|
||||
framePtr += 5; /* eliminate the SNAP header */
|
||||
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet SNAP)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
}
|
||||
else if (!memcmp(aarp_snap_id, framePtr, 5))
|
||||
{
|
||||
framePtr += 5; // eliminate the SNAP header
|
||||
framePtr += 5; /* eliminate the SNAP header */
|
||||
|
||||
ea = (struct elapaarp *)framePtr;
|
||||
}
|
||||
else if (!memcmp(ddp_snap_id, framePtr, 5))
|
||||
{
|
||||
framePtr += 5; // eliminate the SNAP header
|
||||
framePtr += 5; /* eliminate the SNAP header */
|
||||
|
||||
ddp = (struct ddpehdr *)framePtr;
|
||||
}
|
||||
|
@ -986,7 +989,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
}
|
||||
else if (*framePtr == ipx_8022_type)
|
||||
{
|
||||
framePtr += 3; // eliminate the 802.2 header
|
||||
framePtr += 3; /* eliminate the 802.2 header */
|
||||
|
||||
if (!memcmp(ipx_header, framePtr, 2))
|
||||
{
|
||||
|
@ -1042,7 +1045,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
__nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_source.net, &ipx->ipx_source.sock);
|
||||
|
||||
// change IPX source node addr to wlan STA address
|
||||
/* change IPX source node addr to wlan STA address */
|
||||
memcpy(ipx->ipx_source.node, GET_MY_HWADDR(priv), ETH_ALEN);
|
||||
}
|
||||
else
|
||||
|
@ -1066,7 +1069,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
|
||||
|
||||
// replace IPX destination node addr with Lookup destination MAC addr
|
||||
/* replace IPX destination node addr with Lookup destination MAC addr */
|
||||
memcpy(ipx->ipx_dest.node, skb->data, ETH_ALEN);
|
||||
}
|
||||
else
|
||||
|
@ -1100,7 +1103,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
case NAT25_INSERT:
|
||||
{
|
||||
// change to AARP source mac address to wlan STA address
|
||||
/* change to AARP source mac address to wlan STA address */
|
||||
memcpy(ea->hw_src, GET_MY_HWADDR(priv), ETH_ALEN);
|
||||
|
||||
DEBUG_INFO("NAT25: Insert AARP, Source=%d,%d Destination=%d,%d\n",
|
||||
|
@ -1129,7 +1132,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
|
||||
|
||||
// change to AARP destination mac address to Lookup result
|
||||
/* change to AARP destination mac address to Lookup result */
|
||||
memcpy(ea->hw_dst, skb->data, ETH_ALEN);
|
||||
}
|
||||
return 0;
|
||||
|
@ -1188,8 +1191,8 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle PPPoE frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if ((protocol == __constant_htons(ETH_P_PPP_DISC)) ||
|
||||
(protocol == __constant_htons(ETH_P_PPP_SES)))
|
||||
else if ((protocol == ETH_P_PPP_DISC) ||
|
||||
(protocol == ETH_P_PPP_SES))
|
||||
{
|
||||
struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
|
||||
unsigned short *pMagic;
|
||||
|
@ -1202,7 +1205,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
return 1;
|
||||
|
||||
case NAT25_INSERT:
|
||||
if (ph->sid == 0) // Discovery phase according to tag
|
||||
if (ph->sid == 0) /* Discovery phase according to tag */
|
||||
{
|
||||
if (ph->code == PADI_CODE || ph->code == PADR_CODE)
|
||||
{
|
||||
|
@ -1213,7 +1216,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
tag = (struct pppoe_tag *)tag_buf;
|
||||
pOldTag = (struct pppoe_tag *)__nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID));
|
||||
if (pOldTag) { // if SID existed, copy old value and delete it
|
||||
if (pOldTag) { /* if SID existed, copy old value and delete it */
|
||||
old_tag_len = ntohs(pOldTag->tag_len);
|
||||
if (old_tag_len+TAG_HDR_LEN+MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN > sizeof(tag_buf)) {
|
||||
DEBUG_ERR("SID tag length too long!\n");
|
||||
|
@ -1233,19 +1236,19 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
tag->tag_type = PTT_RELAY_SID;
|
||||
tag->tag_len = htons(MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN+old_tag_len);
|
||||
|
||||
// insert the magic_code+client mac in relay tag
|
||||
/* insert the magic_code+client mac in relay tag */
|
||||
pMagic = (unsigned short *)tag->tag_data;
|
||||
*pMagic = htons(MAGIC_CODE);
|
||||
memcpy(tag->tag_data+MAGIC_CODE_LEN, skb->data+ETH_ALEN, ETH_ALEN);
|
||||
|
||||
//Add relay tag
|
||||
/* Add relay tag */
|
||||
if (__nat25_add_pppoe_tag(skb, tag) < 0)
|
||||
return -1;
|
||||
|
||||
DEBUG_INFO("NAT25: Insert PPPoE, forward %s packet\n",
|
||||
(ph->code == PADI_CODE ? "PADI" : "PADR"));
|
||||
}
|
||||
else { // not add relay tag
|
||||
else { /* not add relay tag */
|
||||
if (priv->pppoe_connection_in_progress &&
|
||||
memcmp(skb->data+ETH_ALEN, priv->pppoe_addr, ETH_ALEN)) {
|
||||
DEBUG_ERR("Discard PPPoE packet due to another PPPoE connection is in progress!\n");
|
||||
|
@ -1261,7 +1264,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
else
|
||||
return -1;
|
||||
}
|
||||
else // session phase
|
||||
else /* session phase */
|
||||
{
|
||||
DEBUG_INFO("NAT25: Insert PPPoE, insert session packet to %s\n", skb->dev->name);
|
||||
|
||||
|
@ -1324,7 +1327,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
DEBUG_INFO("NAT25: Lookup PPPoE, forward %s Packet from %s\n",
|
||||
(ph->code == PADO_CODE ? "PADO" : "PADS"), skb->dev->name);
|
||||
}
|
||||
else { // not add relay tag
|
||||
else { /* not add relay tag */
|
||||
if (!priv->pppoe_connection_in_progress) {
|
||||
DEBUG_ERR("Discard PPPoE packet due to no connection in progresss!\n");
|
||||
return -1;
|
||||
|
@ -1357,7 +1360,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle EAP frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if (protocol == __constant_htons(0x888e))
|
||||
else if (protocol == 0x888e)
|
||||
{
|
||||
switch (method)
|
||||
{
|
||||
|
@ -1378,8 +1381,8 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle C-Media proprietary frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if ((protocol == __constant_htons(0xe2ae)) ||
|
||||
(protocol == __constant_htons(0xe2af)))
|
||||
else if ((protocol == 0xe2ae) ||
|
||||
(protocol == 0xe2af))
|
||||
{
|
||||
switch (method)
|
||||
{
|
||||
|
@ -1401,7 +1404,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/* Handle IPV6 frame */
|
||||
/*---------------------------------------------------*/
|
||||
#ifdef CL_IPV6_PASS
|
||||
else if (protocol == __constant_htons(ETH_P_IPV6))
|
||||
else if (protocol == ETH_P_IPV6)
|
||||
{
|
||||
struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);
|
||||
|
||||
|
@ -1470,7 +1473,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
#endif // CL_IPV6_PASS
|
||||
#endif /* CL_IPV6_PASS */
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -1501,8 +1504,10 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
{
|
||||
int is_vlan_tag=0, i, retval=0;
|
||||
unsigned short vlan_hdr=0;
|
||||
unsigned short protocol;
|
||||
|
||||
if (*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_8021Q)) {
|
||||
protocol = be16_to_cpu(*((__be16 *)(skb->data + 2 * ETH_ALEN)));
|
||||
if (protocol == ETH_P_8021Q) {
|
||||
is_vlan_tag = 1;
|
||||
vlan_hdr = *((unsigned short *)(skb->data+ETH_ALEN*2+2));
|
||||
for (i=0; i<6; i++)
|
||||
|
@ -1520,24 +1525,22 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
* corresponding network protocol is NOT support.
|
||||
*/
|
||||
if (!priv->ethBrExtInfo.nat25sc_disable &&
|
||||
(*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_IP)) &&
|
||||
(be16_to_cpu(*((__be16 *)(skb->data+ETH_ALEN*2))) == 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 {
|
||||
} else {
|
||||
_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
retval = nat25_db_handle(priv, skb, NAT25_LOOKUP);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (((*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_IP)) &&
|
||||
} else {
|
||||
if (((be16_to_cpu(*((__be16 *)(skb->data+ETH_ALEN*2))) == ETH_P_IP) &&
|
||||
!memcmp(priv->br_ip, skb->data+ETH_HLEN+16, 4)) ||
|
||||
((*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_ARP)) &&
|
||||
((be16_to_cpu(*((__be16 *)(skb->data+ETH_ALEN*2))) == ETH_P_ARP) &&
|
||||
!memcmp(priv->br_ip, skb->data+ETH_HLEN+24, 4))) {
|
||||
// for traffic to upper TCP/IP
|
||||
/* for traffic to upper TCP/IP */
|
||||
retval = nat25_db_handle(priv, skb, NAT25_LOOKUP);
|
||||
}
|
||||
}
|
||||
|
@ -1551,7 +1554,7 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
}
|
||||
|
||||
if (retval == -1) {
|
||||
//DEBUG_ERR("NAT25: Lookup fail!\n");
|
||||
/* DEBUG_ERR("NAT25: Lookup fail!\n"); */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -1590,34 +1593,33 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
|
|||
|
||||
if (!priv->ethBrExtInfo.dhcp_bcst_disable)
|
||||
{
|
||||
unsigned short protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN));
|
||||
__be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN));
|
||||
|
||||
if (protocol == __constant_htons(ETH_P_IP)) // IP
|
||||
if (protocol == __constant_htons(ETH_P_IP)) /* IP */
|
||||
{
|
||||
struct iphdr* iph = (struct iphdr *)(skb->data + ETH_HLEN);
|
||||
|
||||
if (iph->protocol == IPPROTO_UDP) // UDP
|
||||
if (iph->protocol == IPPROTO_UDP) /* UDP */
|
||||
{
|
||||
struct udphdr *udph = (struct udphdr *)((SIZE_PTR)iph + (iph->ihl << 2));
|
||||
|
||||
if ((udph->source == __constant_htons(CLIENT_PORT))
|
||||
&& (udph->dest == __constant_htons(SERVER_PORT))) // DHCP request
|
||||
{
|
||||
if ((udph->source == __constant_htons(CLIENT_PORT)) &&
|
||||
(udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */
|
||||
struct dhcpMessage *dhcph =
|
||||
(struct dhcpMessage *)((SIZE_PTR)udph + sizeof(struct udphdr));
|
||||
u32 cookie = be32_to_cpu((__be32)dhcph->cookie);
|
||||
|
||||
if (dhcph->cookie == __constant_htonl(DHCP_MAGIC)) // match magic word
|
||||
{
|
||||
if (!(dhcph->flags & htons(BROADCAST_FLAG))) // if not broadcast
|
||||
if (cookie == DHCP_MAGIC) { /* match magic word */
|
||||
if (!(dhcph->flags & htons(BROADCAST_FLAG))) /* if not broadcast */
|
||||
{
|
||||
register int sum = 0;
|
||||
|
||||
DEBUG_INFO("DHCP: change flag of DHCP request to broadcast.\n");
|
||||
// or BROADCAST flag
|
||||
/* or BROADCAST flag */
|
||||
dhcph->flags |= htons(BROADCAST_FLAG);
|
||||
// recalculate checksum
|
||||
/* recalculate checksum */
|
||||
sum = ~(udph->check) & 0xffff;
|
||||
sum += dhcph->flags;
|
||||
sum += be16_to_cpu(dhcph->flags);
|
||||
while (sum >> 16)
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
udph->check = ~sum;
|
||||
|
@ -1636,8 +1638,8 @@ void *scdb_findEntry(_adapter *priv, unsigned char *macAddr,
|
|||
unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
|
||||
struct nat25_network_db_entry *db;
|
||||
int hash;
|
||||
//_irqL irqL;
|
||||
//_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
/* _irqL irqL; */
|
||||
/* _enter_critical_bh(&priv->br_ext_lock, &irqL); */
|
||||
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr);
|
||||
hash = __nat25_network_hash(networkAddr);
|
||||
|
@ -1645,15 +1647,15 @@ void *scdb_findEntry(_adapter *priv, unsigned char *macAddr,
|
|||
while (db != NULL)
|
||||
{
|
||||
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
|
||||
//_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
/* _exit_critical_bh(&priv->br_ext_lock, &irqL); */
|
||||
return (void *)db;
|
||||
}
|
||||
|
||||
db = db->next_hash;
|
||||
}
|
||||
|
||||
//_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
/* _exit_critical_bh(&priv->br_ext_lock, &irqL); */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // CONFIG_BR_EXT
|
||||
#endif /* CONFIG_BR_EXT */
|
||||
|
|
275
core/rtw_cmd.c
275
core/rtw_cmd.c
|
@ -27,12 +27,12 @@
|
|||
#include <mlme_osdep.h>
|
||||
#ifdef CONFIG_BR_EXT
|
||||
#include <rtw_br_ext.h>
|
||||
#endif //CONFIG_BR_EXT
|
||||
#endif /* CONFIG_BR_EXT */
|
||||
#include <rtw_mlme_ext.h>
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
#include <rtl8723a_hal.h>
|
||||
#endif // CONFIG_BT_COEXIST
|
||||
#endif /* CONFIG_BT_COEXIST */
|
||||
|
||||
/*
|
||||
Caller and the rtw_cmd_thread can protect cmd_q by spin_lock.
|
||||
|
@ -46,13 +46,13 @@ sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv)
|
|||
_func_enter_;
|
||||
|
||||
_rtw_init_sema(&(pcmdpriv->cmd_queue_sema), 0);
|
||||
//_rtw_init_sema(&(pcmdpriv->cmd_done_sema), 0);
|
||||
/* _rtw_init_sema(&(pcmdpriv->cmd_done_sema), 0); */
|
||||
_rtw_init_sema(&(pcmdpriv->terminate_cmdthread_sema), 0);
|
||||
|
||||
|
||||
_rtw_init_queue(&(pcmdpriv->cmd_queue));
|
||||
|
||||
//allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf
|
||||
/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
|
||||
|
||||
pcmdpriv->cmd_seq = 1;
|
||||
|
||||
|
@ -100,7 +100,7 @@ _func_enter_;
|
|||
pevtpriv->cmdevt_parm = NULL;
|
||||
#endif
|
||||
|
||||
//allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf
|
||||
/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
|
||||
ATOMIC_SET(&pevtpriv->event_seq, 0);
|
||||
pevtpriv->evt_done_cnt = 0;
|
||||
|
||||
|
@ -136,13 +136,13 @@ _func_enter_;
|
|||
}
|
||||
MmBuildMdlForNonPagedPool(pevtpriv->pc2h_mdl);
|
||||
#endif
|
||||
#endif //end of CONFIG_SDIO_HCI
|
||||
#endif /* end of CONFIG_SDIO_HCI */
|
||||
|
||||
_rtw_init_queue(&(pevtpriv->evt_queue));
|
||||
|
||||
exit:
|
||||
|
||||
#endif //end of CONFIG_EVENT_THREAD_MODE
|
||||
#endif /* end of CONFIG_EVENT_THREAD_MODE */
|
||||
|
||||
#ifdef CONFIG_C2H_WK
|
||||
_init_workitem(&pevtpriv->c2h_wk, c2h_wk_callback, NULL);
|
||||
|
@ -197,7 +197,7 @@ _func_enter_;
|
|||
if (pcmdpriv){
|
||||
_rtw_spinlock_free(&(pcmdpriv->cmd_queue.lock));
|
||||
_rtw_free_sema(&(pcmdpriv->cmd_queue_sema));
|
||||
//_rtw_free_sema(&(pcmdpriv->cmd_done_sema));
|
||||
/* _rtw_free_sema(&(pcmdpriv->cmd_done_sema)); */
|
||||
_rtw_free_sema(&(pcmdpriv->terminate_cmdthread_sema));
|
||||
|
||||
if (pcmdpriv->cmd_allocated_buf)
|
||||
|
@ -228,12 +228,12 @@ _func_enter_;
|
|||
if (obj == NULL)
|
||||
goto exit;
|
||||
|
||||
//_enter_critical_bh(&queue->lock, &irqL);
|
||||
/* _enter_critical_bh(&queue->lock, &irqL); */
|
||||
_enter_critical(&queue->lock, &irqL);
|
||||
|
||||
rtw_list_insert_tail(&obj->list, &queue->queue);
|
||||
|
||||
//_exit_critical_bh(&queue->lock, &irqL);
|
||||
/* _exit_critical_bh(&queue->lock, &irqL); */
|
||||
_exit_critical(&queue->lock, &irqL);
|
||||
|
||||
exit:
|
||||
|
@ -250,7 +250,7 @@ struct cmd_obj *_rtw_dequeue_cmd(_queue *queue)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
//_enter_critical_bh(&(queue->lock), &irqL);
|
||||
/* _enter_critical_bh(&(queue->lock), &irqL); */
|
||||
_enter_critical(&queue->lock, &irqL);
|
||||
if (rtw_is_list_empty(&(queue->queue)))
|
||||
obj = NULL;
|
||||
|
@ -260,7 +260,7 @@ _func_enter_;
|
|||
rtw_list_delete(&obj->list);
|
||||
}
|
||||
|
||||
//_exit_critical_bh(&(queue->lock), &irqL);
|
||||
/* _exit_critical_bh(&(queue->lock), &irqL); */
|
||||
_exit_critical(&queue->lock, &irqL);
|
||||
|
||||
_func_exit_;
|
||||
|
@ -305,10 +305,10 @@ _func_exit_;
|
|||
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj);
|
||||
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
||||
{
|
||||
u8 bAllow = false; //set to true to allow enqueuing cmd when hw_init_completed is false
|
||||
u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
|
||||
|
||||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
//To decide allow or not
|
||||
/* To decide allow or not */
|
||||
if ( (pcmdpriv->padapter->pwrctrlpriv.bHWPwrPindetect)
|
||||
&&(!pcmdpriv->padapter->registrypriv.usbss_enable)
|
||||
)
|
||||
|
@ -318,7 +318,7 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
|||
struct drvextra_cmd_parm *pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)cmd_obj->parmbuf;
|
||||
if (pdrvextra_cmd_parm->ec_id == POWER_SAVING_CTRL_WK_CID)
|
||||
{
|
||||
//DBG_88E("==>enqueue POWER_SAVING_CTRL_WK_CID\n");
|
||||
/* DBG_88E("==>enqueue POWER_SAVING_CTRL_WK_CID\n"); */
|
||||
bAllow = true;
|
||||
}
|
||||
}
|
||||
|
@ -329,14 +329,14 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
|||
bAllow = true;
|
||||
|
||||
if ( (pcmdpriv->padapter->hw_init_completed ==false && bAllow == false)
|
||||
|| pcmdpriv->cmdthd_running== false //com_thread not running
|
||||
|| pcmdpriv->cmdthd_running== false /* com_thread not running */
|
||||
)
|
||||
{
|
||||
//DBG_88E("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __func__,
|
||||
// cmd_obj->cmdcode,
|
||||
// pcmdpriv->padapter->hw_init_completed,
|
||||
// pcmdpriv->cmdthd_running
|
||||
//);
|
||||
/* DBG_88E("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __func__, */
|
||||
/* cmd_obj->cmdcode, */
|
||||
/* pcmdpriv->padapter->hw_init_completed, */
|
||||
/* pcmdpriv->cmdthd_running */
|
||||
/* */
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv)
|
|||
{
|
||||
_func_enter_;
|
||||
pcmdpriv->cmd_done_cnt++;
|
||||
//_rtw_up_sema(&(pcmdpriv->cmd_done_sema));
|
||||
/* _rtw_up_sema(&(pcmdpriv->cmd_done_sema)); */
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
@ -406,7 +406,7 @@ _func_enter_;
|
|||
|
||||
if ((pcmd->cmdcode!=_JoinBss_CMD_) &&(pcmd->cmdcode!= _CreateBss_CMD_))
|
||||
{
|
||||
//free parmbuf in cmd_obj
|
||||
/* free parmbuf in cmd_obj */
|
||||
rtw_mfree((unsigned char*)pcmd->parmbuf, pcmd->cmdsz);
|
||||
}
|
||||
|
||||
|
@ -414,12 +414,12 @@ _func_enter_;
|
|||
{
|
||||
if (pcmd->rspsz!= 0)
|
||||
{
|
||||
//free rsp in cmd_obj
|
||||
/* free rsp in cmd_obj */
|
||||
rtw_mfree((unsigned char*)pcmd->rsp, pcmd->rspsz);
|
||||
}
|
||||
}
|
||||
|
||||
//free cmd_obj
|
||||
/* free cmd_obj */
|
||||
rtw_mfree((unsigned char*)pcmd, sizeof(struct cmd_obj));
|
||||
|
||||
_func_exit_;
|
||||
|
@ -490,7 +490,7 @@ _next:
|
|||
|
||||
pcmdpriv->cmd_issued_cnt++;
|
||||
|
||||
pcmd->cmdsz = _RND4((pcmd->cmdsz));//_RND4
|
||||
pcmd->cmdsz = _RND4((pcmd->cmdsz));/* _RND4 */
|
||||
|
||||
_rtw_memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
|
||||
|
||||
|
@ -515,7 +515,7 @@ _next:
|
|||
|
||||
post_process:
|
||||
|
||||
//call callback function for post-processed
|
||||
/* call callback function for post-processed */
|
||||
if (pcmd->cmdcode <= (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback)))
|
||||
{
|
||||
pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
|
||||
|
@ -526,8 +526,8 @@ post_process:
|
|||
}
|
||||
else
|
||||
{
|
||||
//todo: !!! fill rsp_buf to pcmd->rsp if (pcmd->rsp!=NULL)
|
||||
pcmd_callback(pcmd->padapter, pcmd);//need conider that free cmd_obj in rtw_cmd_callback
|
||||
/* todo: !!! fill rsp_buf to pcmd->rsp if (pcmd->rsp!=NULL) */
|
||||
pcmd_callback(pcmd->padapter, pcmd);/* need conider that free cmd_obj in rtw_cmd_callback */
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -544,13 +544,13 @@ post_process:
|
|||
pcmdpriv->cmdthd_running=false;
|
||||
|
||||
|
||||
// free all cmd_obj resources
|
||||
/* free all cmd_obj resources */
|
||||
do{
|
||||
pcmd = rtw_dequeue_cmd(pcmdpriv);
|
||||
if (pcmd==NULL)
|
||||
break;
|
||||
|
||||
//DBG_88E("%s: leaving... drop cmdcode:%u\n", __func__, pcmd->cmdcode);
|
||||
/* DBG_88E("%s: leaving... drop cmdcode:%u\n", __func__, pcmd->cmdcode); */
|
||||
|
||||
rtw_free_cmd_obj(pcmd);
|
||||
}while (1);
|
||||
|
@ -586,7 +586,7 @@ _func_enter_;
|
|||
|
||||
_exit_critical_bh(&queue->lock, &irqL);
|
||||
|
||||
//rtw_evt_notify_isr(pevtpriv);
|
||||
/* rtw_evt_notify_isr(pevtpriv); */
|
||||
|
||||
exit:
|
||||
|
||||
|
@ -695,7 +695,7 @@ u8 rtw_sitesurvey_cmd(_adapter *padapter, NDIS_802_11_SSID *ssid, int ssid_num,
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *pwdinfo= &(padapter->wdinfo);
|
||||
#endif //CONFIG_P2P
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -709,7 +709,7 @@ _func_enter_;
|
|||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
|
||||
p2p_ps_wk_cmd(padapter, P2P_PS_SCAN, 1);
|
||||
}
|
||||
#endif //CONFIG_P2P_PS
|
||||
#endif /* CONFIG_P2P_PS */
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (ph2c == NULL)
|
||||
|
@ -770,12 +770,12 @@ _func_enter_;
|
|||
if ((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE)
|
||||
_set_timer(&pmlmepriv->scan_to_timer, SURVEY_TO * ( 38 + ( 38 / RTW_SCAN_NUM_OF_CH ) * RTW_STAY_AP_CH_MILLISECOND ) + 1000 );
|
||||
else
|
||||
#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
|
||||
#endif /* CONFIG_STA_MODE_SCAN_UNDER_AP_MODE */
|
||||
_set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT);
|
||||
|
||||
rtw_led_control(padapter, LED_CTL_SITE_SURVEY);
|
||||
|
||||
pmlmepriv->scan_interval = SCAN_INTERVAL;// 30*2 sec = 60sec
|
||||
pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */
|
||||
} else {
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
|
||||
}
|
||||
|
@ -810,7 +810,7 @@ _func_enter_;
|
|||
init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate));
|
||||
#ifdef MP_FIRMWARE_OFFLOAD
|
||||
pbsetdataratepara->curr_rateidx = *(u32*)rateset;
|
||||
// _rtw_memcpy(pbsetdataratepara, rateset, sizeof(u32));
|
||||
/* _rtw_memcpy(pbsetdataratepara, rateset, sizeof(u32)); */
|
||||
#else
|
||||
pbsetdataratepara->mac_id = 5;
|
||||
_rtw_memcpy(pbsetdataratepara->datarates, rateset, NumRates);
|
||||
|
@ -870,8 +870,8 @@ u8 rtw_setphy_cmd(_adapter *padapter, u8 modem, u8 ch)
|
|||
struct cmd_obj* ph2c;
|
||||
struct setphy_parm* psetphypara;
|
||||
struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
|
||||
// struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
// struct registry_priv* pregistry_priv = &padapter->registrypriv;
|
||||
/* struct mlme_priv *pmlmepriv = &padapter->mlmepriv; */
|
||||
/* struct registry_priv* pregistry_priv = &padapter->registrypriv; */
|
||||
u8 res=_SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -1102,7 +1102,7 @@ _func_enter_;
|
|||
pdev_network->Length = pcmd->cmdsz;
|
||||
|
||||
#ifdef CONFIG_RTL8712
|
||||
//notes: translate IELength & Length after assign the Length to cmdsz;
|
||||
/* notes: translate IELength & Length after assign the Length to cmdsz; */
|
||||
pdev_network->Length = cpu_to_le32(pcmd->cmdsz);
|
||||
pdev_network->IELength = cpu_to_le32(pdev_network->IELength);
|
||||
pdev_network->Ssid.SsidLength = cpu_to_le32(pdev_network->Ssid.SsidLength);
|
||||
|
@ -1160,7 +1160,7 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network* pnetwork)
|
|||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
#endif //CONFIG_80211N_HT
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
NDIS_802_11_NETWORK_INFRASTRUCTURE ndis_network_mode = pnetwork->network.InfrastructureMode;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
@ -1181,19 +1181,11 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n"));
|
||||
goto exit;
|
||||
}
|
||||
/* // for IEs is pointer
|
||||
t_len = sizeof (ULONG) + sizeof (NDIS_802_11_MAC_ADDRESS) + 2 +
|
||||
sizeof (NDIS_802_11_SSID) + sizeof (ULONG) +
|
||||
sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) +
|
||||
sizeof (NDIS_802_11_CONFIGURATION) +
|
||||
sizeof (NDIS_802_11_NETWORK_INFRASTRUCTURE) +
|
||||
sizeof (NDIS_802_11_RATES_EX)+ sizeof(WLAN_PHY_INFO)+ sizeof (ULONG) + MAX_IE_SZ;
|
||||
*/
|
||||
//for IEs is fix buf size
|
||||
/* for IEs is fix buf size */
|
||||
t_len = sizeof(WLAN_BSSID_EX);
|
||||
|
||||
|
||||
//for hidden ap to set fw_state here
|
||||
/* for hidden ap to set fw_state here */
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) != true)
|
||||
{
|
||||
switch (ndis_network_mode)
|
||||
|
@ -1240,10 +1232,10 @@ _func_enter_;
|
|||
}
|
||||
|
||||
psecnetwork->IELength = 0;
|
||||
// Added by Albert 2009/02/18
|
||||
// If the the driver wants to use the bssid to create the connection.
|
||||
// If not, we have to copy the connecting AP's MAC address to it so that
|
||||
// the driver just has the bssid information for PMKIDList searching.
|
||||
/* Added by Albert 2009/02/18 */
|
||||
/* If the the driver wants to use the bssid to create the connection. */
|
||||
/* If not, we have to copy the connecting AP's MAC address to it so that */
|
||||
/* the driver just has the bssid information for PMKIDList searching. */
|
||||
|
||||
if ( pmlmepriv->assoc_by_bssid == false )
|
||||
{
|
||||
|
@ -1264,11 +1256,11 @@ _func_enter_;
|
|||
if (psecnetwork->IELength != tmp_len)
|
||||
{
|
||||
psecnetwork->IELength = tmp_len;
|
||||
pqospriv->qos_option = 1; //There is WMM IE in this corresp. beacon
|
||||
pqospriv->qos_option = 1; /* There is WMM IE in this corresp. beacon */
|
||||
}
|
||||
else
|
||||
{
|
||||
pqospriv->qos_option = 0;//There is no WMM IE in this corresp. beacon
|
||||
pqospriv->qos_option = 0;/* There is no WMM IE in this corresp. beacon */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1276,14 +1268,14 @@ _func_enter_;
|
|||
phtpriv->ht_option = false;
|
||||
if (pregistrypriv->ht_enable)
|
||||
{
|
||||
// Added by Albert 2010/06/23
|
||||
// For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue.
|
||||
// Especially for Realtek 8192u SoftAP.
|
||||
/* Added by Albert 2010/06/23 */
|
||||
/* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */
|
||||
/* Especially for Realtek 8192u SoftAP. */
|
||||
if ( ( padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_ ) &&
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_ ) &&
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_ ))
|
||||
{
|
||||
//rtw_restructure_ht_ie
|
||||
/* rtw_restructure_ht_ie */
|
||||
rtw_restructure_ht_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0],
|
||||
pnetwork->network.IELength, &psecnetwork->IELength);
|
||||
}
|
||||
|
@ -1300,10 +1292,10 @@ _func_enter_;
|
|||
|
||||
DBG_88E("%s: smart_ps=%d\n", __func__, padapter->pwrctrlpriv.smart_ps);
|
||||
|
||||
pcmd->cmdsz = get_WLAN_BSSID_EX_sz(psecnetwork);//get cmdsz before endian conversion
|
||||
pcmd->cmdsz = get_WLAN_BSSID_EX_sz(psecnetwork);/* get cmdsz before endian conversion */
|
||||
|
||||
#ifdef CONFIG_RTL8712
|
||||
//wlan_network endian conversion
|
||||
/* wlan_network endian conversion */
|
||||
psecnetwork->Length = cpu_to_le32(psecnetwork->Length);
|
||||
psecnetwork->Ssid.SsidLength= cpu_to_le32(psecnetwork->Ssid.SsidLength);
|
||||
psecnetwork->Privacy = cpu_to_le32(psecnetwork->Privacy);
|
||||
|
@ -1322,7 +1314,7 @@ _func_enter_;
|
|||
#endif
|
||||
|
||||
_rtw_init_listhead(&pcmd->list);
|
||||
pcmd->cmdcode = _JoinBss_CMD_;//GEN_CMD_CODE(_JoinBss)
|
||||
pcmd->cmdcode = _JoinBss_CMD_;/* GEN_CMD_CODE(_JoinBss) */
|
||||
pcmd->parmbuf = (unsigned char *)psecnetwork;
|
||||
pcmd->rsp = NULL;
|
||||
pcmd->rspsz = 0;
|
||||
|
@ -1460,7 +1452,7 @@ _func_enter_;
|
|||
if (sta->tdls_sta_state&TDLS_LINKED_STATE)
|
||||
psetstakey_para->algorithm=(u8)sta->dot118021XPrivacy;
|
||||
else
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
psetstakey_para->algorithm =(unsigned char) psecuritypriv->dot11PrivacyAlgrthm;
|
||||
}else{
|
||||
GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false);
|
||||
|
@ -1471,13 +1463,13 @@ _func_enter_;
|
|||
if ((sta->tdls_sta_state&TDLS_LINKED_STATE)==TDLS_LINKED_STATE)
|
||||
_rtw_memcpy(&psetstakey_para->key, sta->tpk.tk, 16);
|
||||
else
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
_rtw_memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
|
||||
} else {
|
||||
_rtw_memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
|
||||
}
|
||||
|
||||
//jeff: set this becasue at least sw key is ready
|
||||
/* jeff: set this becasue at least sw key is ready */
|
||||
padapter->securitypriv.busetkipkey=true;
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
@ -1603,7 +1595,7 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
|
||||
// init_h2fwcmd_w_parm_no_rsp(ph2c, psetrttblparm, GEN_CMD_CODE(_SetRaTable));
|
||||
/* init_h2fwcmd_w_parm_no_rsp(ph2c, psetrttblparm, GEN_CMD_CODE(_SetRaTable)); */
|
||||
|
||||
_rtw_init_listhead(&ph2c->list);
|
||||
ph2c->cmdcode =GEN_CMD_CODE(_GetRaTable);
|
||||
|
@ -1695,9 +1687,9 @@ _func_enter_;
|
|||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, GEN_CMD_CODE(_AddBAReq));
|
||||
|
||||
//DBG_88E("rtw_addbareq_cmd, tid=%d\n", tid);
|
||||
/* DBG_88E("rtw_addbareq_cmd, tid=%d\n", tid); */
|
||||
|
||||
//rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
exit:
|
||||
|
@ -1741,7 +1733,7 @@ _func_enter_;
|
|||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
|
||||
|
||||
//rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
exit:
|
||||
|
@ -1819,13 +1811,13 @@ _func_enter_;
|
|||
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_chplan_cmd\n"));
|
||||
|
||||
//check input parameter
|
||||
/* check input parameter */
|
||||
if (!rtw_is_channel_plan_valid(chplan)) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
//prepare cmd parameter
|
||||
/* prepare cmd parameter */
|
||||
setChannelPlan_param = (struct SetChannelPlan_param *)rtw_zmalloc(sizeof(struct SetChannelPlan_param));
|
||||
if (setChannelPlan_param == NULL) {
|
||||
res= _FAIL;
|
||||
|
@ -1835,7 +1827,7 @@ _func_enter_;
|
|||
|
||||
if (enqueue)
|
||||
{
|
||||
//need enqueue, prepare cmd_obj and enqueue
|
||||
/* need enqueue, prepare cmd_obj and enqueue */
|
||||
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (pcmdobj == NULL){
|
||||
rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param));
|
||||
|
@ -1848,14 +1840,14 @@ _func_enter_;
|
|||
}
|
||||
else
|
||||
{
|
||||
//no need to enqueue, do the cmd hdl directly and free cmd parameter
|
||||
/* no need to enqueue, do the cmd hdl directly and free cmd parameter */
|
||||
if ( H2C_SUCCESS !=set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param) )
|
||||
res = _FAIL;
|
||||
|
||||
rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param));
|
||||
}
|
||||
|
||||
//do something based on res...
|
||||
/* do something based on res... */
|
||||
if (res == _SUCCESS)
|
||||
padapter->mlmepriv.ChannelPlan = chplan;
|
||||
|
||||
|
@ -1976,7 +1968,7 @@ _func_enter_;
|
|||
init_h2fwcmd_w_parm_no_rsp(pcmdobj, TDLSoption, GEN_CMD_CODE(_TDLS));
|
||||
res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
|
||||
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
exit:
|
||||
|
||||
|
@ -1999,11 +1991,11 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &(padapter->tdlsinfo);
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
//
|
||||
// Determine if our traffic is busy now
|
||||
//
|
||||
/* */
|
||||
/* Determine if our traffic is busy now */
|
||||
/* */
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED)== true)
|
||||
/*&& !MgntInitAdapterInProgress(pMgntInfo)*/)
|
||||
{
|
||||
|
@ -2011,10 +2003,10 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
#ifdef CONFIG_BT_COEXIST
|
||||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 ||
|
||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 50 )
|
||||
#else // !CONFIG_BT_COEXIST
|
||||
#else /* !CONFIG_BT_COEXIST */
|
||||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 100 ||
|
||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 100 )
|
||||
#endif // !CONFIG_BT_COEXIST
|
||||
#endif /* !CONFIG_BT_COEXIST */
|
||||
{
|
||||
bBusyTraffic = true;
|
||||
|
||||
|
@ -2024,7 +2016,7 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
bTxBusyTraffic = true;
|
||||
}
|
||||
|
||||
// Higher Tx/Rx data.
|
||||
/* Higher Tx/Rx data. */
|
||||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
|
||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000 )
|
||||
{
|
||||
|
@ -2050,26 +2042,26 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
pmlmepriv->ftp_lock_flag = 0;
|
||||
rtw_unlock_suspend();
|
||||
}
|
||||
#endif //CONFIG_KEEP_FTP_TRANSMIT
|
||||
#endif /* CONFIG_KEEP_FTP_TRANSMIT */
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
#ifdef CONFIG_TDLS_AUTOSETUP
|
||||
if ( ( ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0 ) //10 * 2sec, periodically sending
|
||||
if ( ( ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0 ) /* 10 * 2sec, periodically sending */
|
||||
issue_tdls_dis_req( padapter, NULL );
|
||||
ptdlsinfo->watchdog_count++;
|
||||
#endif //CONFIG_TDLS_AUTOSETUP
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS_AUTOSETUP */
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
if (BT_1Ant(padapter) == false)
|
||||
#endif
|
||||
{
|
||||
// check traffic for powersaving.
|
||||
/* check traffic for powersaving. */
|
||||
if ( ((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) ||
|
||||
(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) )
|
||||
{
|
||||
//DBG_88E("Tx = %d, Rx = %d\n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod);
|
||||
/* DBG_88E("Tx = %d, Rx = %d\n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); */
|
||||
bEnterPS= false;
|
||||
}
|
||||
else
|
||||
|
@ -2077,7 +2069,7 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
bEnterPS= true;
|
||||
}
|
||||
|
||||
// LeisurePS only work in infra mode.
|
||||
/* LeisurePS only work in infra mode. */
|
||||
if (bEnterPS)
|
||||
{
|
||||
LPS_Enter(padapter);
|
||||
|
@ -2087,7 +2079,7 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
LPS_Leave(padapter);
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_LPS
|
||||
#endif /* CONFIG_LPS */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2122,13 +2114,13 @@ void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz)
|
|||
expire_timeout_chk(padapter);
|
||||
}
|
||||
#endif
|
||||
#endif //CONFIG_ACTIVE_KEEP_ALIVE_CHECK
|
||||
#endif /* CONFIG_ACTIVE_KEEP_ALIVE_CHECK */
|
||||
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
rtw_hal_sreset_xmit_status_check(padapter);
|
||||
#endif
|
||||
|
||||
//if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==false)
|
||||
/* if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==false) */
|
||||
{
|
||||
linked_status_chk(padapter);
|
||||
traffic_status_watchdog(padapter);
|
||||
|
@ -2136,12 +2128,12 @@ void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz)
|
|||
|
||||
rtw_hal_dm_watchdog(padapter);
|
||||
|
||||
//check_hw_pbc(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
|
||||
/* check_hw_pbc(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size); */
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
//
|
||||
// BT-Coexist
|
||||
//
|
||||
/* */
|
||||
/* BT-Coexist */
|
||||
/* */
|
||||
BT_CoexistMechanism(padapter);
|
||||
#endif
|
||||
}
|
||||
|
@ -2166,26 +2158,26 @@ _func_enter_;
|
|||
switch (lps_ctrl_type)
|
||||
{
|
||||
case LPS_CTRL_SCAN:
|
||||
//DBG_88E("LPS_CTRL_SCAN\n");
|
||||
/* DBG_88E("LPS_CTRL_SCAN\n"); */
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
BT_WifiScanNotify(padapter, true);
|
||||
if (BT_1Ant(padapter) == false)
|
||||
#endif
|
||||
{
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
||||
{ //connect
|
||||
{ /* connect */
|
||||
LPS_Leave(padapter);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LPS_CTRL_JOINBSS:
|
||||
//DBG_88E("LPS_CTRL_JOINBSS\n");
|
||||
/* DBG_88E("LPS_CTRL_JOINBSS\n"); */
|
||||
LPS_Leave(padapter);
|
||||
break;
|
||||
case LPS_CTRL_CONNECT:
|
||||
//DBG_88E("LPS_CTRL_CONNECT\n");
|
||||
mstatus = 1;//connect
|
||||
// Reset LPS Setting
|
||||
/* DBG_88E("LPS_CTRL_CONNECT\n"); */
|
||||
mstatus = 1;/* connect */
|
||||
/* Reset LPS Setting */
|
||||
padapter->pwrctrlpriv.LpsIdleCount = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_JOINBSSRPT, (u8 *)(&mstatus));
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
|
@ -2193,8 +2185,8 @@ _func_enter_;
|
|||
#endif
|
||||
break;
|
||||
case LPS_CTRL_DISCONNECT:
|
||||
//DBG_88E("LPS_CTRL_DISCONNECT\n");
|
||||
mstatus = 0;//disconnect
|
||||
/* DBG_88E("LPS_CTRL_DISCONNECT\n"); */
|
||||
mstatus = 0;/* disconnect */
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
BT_WifiMediaStatusNotify(padapter, mstatus);
|
||||
if (BT_1Ant(padapter) == false)
|
||||
|
@ -2205,7 +2197,7 @@ _func_enter_;
|
|||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_JOINBSSRPT, (u8 *)(&mstatus));
|
||||
break;
|
||||
case LPS_CTRL_SPECIAL_PACKET:
|
||||
//DBG_88E("LPS_CTRL_SPECIAL_PACKET\n");
|
||||
/* DBG_88E("LPS_CTRL_SPECIAL_PACKET\n"); */
|
||||
pwrpriv->DelayLPSLastTimeStamp = rtw_get_current_time();
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
BT_SpecialPacketNotify(padapter);
|
||||
|
@ -2216,7 +2208,7 @@ _func_enter_;
|
|||
}
|
||||
break;
|
||||
case LPS_CTRL_LEAVE:
|
||||
//DBG_88E("LPS_CTRL_LEAVE\n");
|
||||
/* DBG_88E("LPS_CTRL_LEAVE\n"); */
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
BT_LpsLeave(padapter);
|
||||
if (BT_1Ant(padapter) == false)
|
||||
|
@ -2238,13 +2230,13 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter*padapter, u8 lps_ctrl_type, u8 enqueue)
|
|||
struct cmd_obj *ph2c;
|
||||
struct drvextra_cmd_parm *pdrvextra_cmd_parm;
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
//struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
|
||||
/* struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv; */
|
||||
u8 res = _SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
//if (!pwrctrlpriv->bLeisurePs)
|
||||
// return res;
|
||||
/* if (!pwrctrlpriv->bLeisurePs) */
|
||||
/* return res; */
|
||||
|
||||
if (enqueue)
|
||||
{
|
||||
|
@ -2415,8 +2407,8 @@ _func_enter_;
|
|||
}
|
||||
|
||||
pdrvextra_cmd_parm->ec_id = P2P_PROTO_WK_CID;
|
||||
pdrvextra_cmd_parm->type_size = intCmdType; // As the command tppe.
|
||||
pdrvextra_cmd_parm->pbuf = NULL; // Must be NULL here
|
||||
pdrvextra_cmd_parm->type_size = intCmdType; /* As the command tppe. */
|
||||
pdrvextra_cmd_parm->pbuf = NULL; /* Must be NULL here */
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
|
||||
|
@ -2429,7 +2421,7 @@ _func_exit_;
|
|||
return res;
|
||||
|
||||
}
|
||||
#endif //CONFIG_P2P
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
u8 rtw_ps_cmd(_adapter*padapter)
|
||||
{
|
||||
|
@ -2488,8 +2480,8 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter)
|
|||
{
|
||||
u8 val = 0;
|
||||
|
||||
//while ((rtw_read32(padapter, 0x414)&0x00ffff00)!=0)
|
||||
//while ((rtw_read32(padapter, 0x414)&0x0000ff00)!=0)
|
||||
/* while ((rtw_read32(padapter, 0x414)&0x00ffff00)!=0) */
|
||||
/* while ((rtw_read32(padapter, 0x414)&0x0000ff00)!=0) */
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
|
||||
|
||||
|
@ -2512,7 +2504,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter)
|
|||
|
||||
update_beacon(padapter, _TIM_IE_, NULL, false);
|
||||
}
|
||||
else //re check again
|
||||
else /* re check again */
|
||||
{
|
||||
rtw_chk_hi_queue_cmd(padapter);
|
||||
}
|
||||
|
@ -2694,22 +2686,22 @@ u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf)
|
|||
case P2P_PS_WK_CID:
|
||||
p2p_ps_wk_hdl(padapter, pdrvextra_cmd->type_size);
|
||||
break;
|
||||
#endif // CONFIG_P2P_PS
|
||||
#endif /* CONFIG_P2P_PS */
|
||||
case P2P_PROTO_WK_CID:
|
||||
// Commented by Albert 2011/07/01
|
||||
// I used the type_size as the type command
|
||||
/* Commented by Albert 2011/07/01 */
|
||||
/* I used the type_size as the type command */
|
||||
p2p_protocol_wk_hdl( padapter, pdrvextra_cmd->type_size );
|
||||
break;
|
||||
#ifdef CONFIG_AP_MODE
|
||||
case CHECK_HIQ_WK_CID:
|
||||
rtw_chk_hi_queue_hdl(padapter);
|
||||
break;
|
||||
#endif //CONFIG_AP_MODE
|
||||
#endif /* CONFIG_AP_MODE */
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
case INTEl_WIDI_WK_CID:
|
||||
intel_widi_wk_hdl(padapter, pdrvextra_cmd->type_size, pdrvextra_cmd->pbuf);
|
||||
break;
|
||||
#endif //CONFIG_INTEL_WIDI
|
||||
#endif /* CONFIG_INTEL_WIDI */
|
||||
|
||||
case C2H_WK_CID:
|
||||
c2h_evt_hdl(padapter, (struct c2h_evt_hdr *)pdrvextra_cmd->pbuf, NULL);
|
||||
|
@ -2735,8 +2727,8 @@ _func_enter_;
|
|||
|
||||
if (pcmd->res == H2C_DROPPED)
|
||||
{
|
||||
//TODO: cancel timer and do timeout handler directly...
|
||||
//need to make timeout handlerOS independent
|
||||
/* TODO: cancel timer and do timeout handler directly... */
|
||||
/* need to make timeout handlerOS independent */
|
||||
_set_timer(&pmlmepriv->scan_to_timer, 1);
|
||||
}
|
||||
else if (pcmd->res != H2C_SUCCESS) {
|
||||
|
@ -2744,7 +2736,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ********Error: MgntActrtw_set_802_11_bssid_LIST_SCAN Fail ************\n\n."));
|
||||
}
|
||||
|
||||
// free cmd
|
||||
/* free cmd */
|
||||
rtw_free_cmd_obj(pcmd);
|
||||
|
||||
_func_exit_;
|
||||
|
@ -2767,11 +2759,11 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
#ifdef CONFIG_BR_EXT
|
||||
else //clear bridge database
|
||||
else /* clear bridge database */
|
||||
nat25_db_cleanup(padapter);
|
||||
#endif //CONFIG_BR_EXT
|
||||
#endif /* CONFIG_BR_EXT */
|
||||
|
||||
// free cmd
|
||||
/* free cmd */
|
||||
rtw_free_cmd_obj(pcmd);
|
||||
|
||||
exit:
|
||||
|
@ -2788,8 +2780,8 @@ _func_enter_;
|
|||
|
||||
if (pcmd->res == H2C_DROPPED)
|
||||
{
|
||||
//TODO: cancel timer and do timeout handler directly...
|
||||
//need to make timeout handlerOS independent
|
||||
/* TODO: cancel timer and do timeout handler directly... */
|
||||
/* need to make timeout handlerOS independent */
|
||||
_set_timer(&pmlmepriv->assoc_timer, 1);
|
||||
}
|
||||
else if (pcmd->res != H2C_SUCCESS)
|
||||
|
@ -2824,14 +2816,14 @@ _func_enter_;
|
|||
_cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled);
|
||||
|
||||
#ifdef CONFIG_FW_MLMLE
|
||||
//endian_convert
|
||||
/* endian_convert */
|
||||
pnetwork->Length = le32_to_cpu(pnetwork->Length);
|
||||
pnetwork->Ssid.SsidLength = le32_to_cpu(pnetwork->Ssid.SsidLength);
|
||||
pnetwork->Privacy =le32_to_cpu(pnetwork->Privacy);
|
||||
pnetwork->Rssi = le32_to_cpu(pnetwork->Rssi);
|
||||
pnetwork->NetworkTypeInUse =le32_to_cpu(pnetwork->NetworkTypeInUse);
|
||||
pnetwork->Configuration.ATIMWindow = le32_to_cpu(pnetwork->Configuration.ATIMWindow);
|
||||
//pnetwork->Configuration.BeaconPeriod = le32_to_cpu(pnetwork->Configuration.BeaconPeriod);
|
||||
/* pnetwork->Configuration.BeaconPeriod = le32_to_cpu(pnetwork->Configuration.BeaconPeriod); */
|
||||
pnetwork->Configuration.DSConfig =le32_to_cpu(pnetwork->Configuration.DSConfig);
|
||||
pnetwork->Configuration.FHConfig.DwellTime=le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime);
|
||||
pnetwork->Configuration.FHConfig.HopPattern=le32_to_cpu(pnetwork->Configuration.FHConfig.HopPattern);
|
||||
|
@ -2884,20 +2876,20 @@ _func_enter_;
|
|||
|
||||
pnetwork->Length = get_WLAN_BSSID_EX_sz(pnetwork);
|
||||
_rtw_memcpy(&(pwlan->network), pnetwork, pnetwork->Length);
|
||||
//pwlan->fixed = true;
|
||||
/* pwlan->fixed = true; */
|
||||
|
||||
//rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue);
|
||||
/* rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue); */
|
||||
|
||||
// copy pdev_network information to pmlmepriv->cur_network
|
||||
/* copy pdev_network information to pmlmepriv->cur_network */
|
||||
_rtw_memcpy(&tgt_network->network, pnetwork, (get_WLAN_BSSID_EX_sz(pnetwork)));
|
||||
|
||||
// reset DSConfig
|
||||
//tgt_network->network.Configuration.DSConfig = (u32)rtw_ch2freq(pnetwork->Configuration.DSConfig);
|
||||
/* reset DSConfig */
|
||||
/* tgt_network->network.Configuration.DSConfig = (u32)rtw_ch2freq(pnetwork->Configuration.DSConfig); */
|
||||
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
// we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback)
|
||||
/* we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback) */
|
||||
|
||||
}
|
||||
|
||||
|
@ -2927,16 +2919,11 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info\n\n"));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
//psta->aid = psta->mac_id = psetstakey_rsp->keyid; //CAM_ID(CAM_ENTRY)
|
||||
|
||||
exit:
|
||||
|
||||
rtw_free_cmd_obj(pcmd);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void rtw_setassocsta_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd)
|
||||
{
|
||||
_irqL irqL;
|
||||
|
|
|
@ -277,7 +277,7 @@ int proc_get_ht_option(char *page, char **start,
|
|||
int len = 0;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
len += snprintf(page + len, count - len, "ht_option=%d\n", pmlmepriv->htpriv.ht_option);
|
||||
#endif //CONFIG_80211N_HT
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ int proc_get_ap_info(char *page, char **start,
|
|||
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
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
||||
for (i=0;i<16;i++)
|
||||
{
|
||||
|
@ -532,7 +532,6 @@ int proc_get_rf_reg_dump1(char *page, char **start,
|
|||
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);
|
||||
|
@ -559,7 +558,6 @@ int proc_get_rf_reg_dump2(char *page, char **start,
|
|||
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);
|
||||
|
@ -585,7 +583,6 @@ int proc_get_rf_reg_dump3(char *page, char **start,
|
|||
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);
|
||||
|
@ -612,7 +609,6 @@ int proc_get_rf_reg_dump4(char *page, char **start,
|
|||
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);
|
||||
|
@ -825,7 +821,7 @@ int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
|
|||
return count;
|
||||
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
||||
int proc_get_two_path_rssi(char *page, char **start,
|
||||
off_t offset, int count,
|
||||
|
@ -893,7 +889,7 @@ int proc_set_rx_stbc(struct file *file, const char __user *buffer,
|
|||
return count;
|
||||
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
||||
|
||||
int proc_get_rssi_disp(char *page, char **start,
|
||||
|
@ -977,8 +973,6 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
|
||||
plist = get_next(plist);
|
||||
|
||||
//if (extra_arg == psta->aid)
|
||||
{
|
||||
len += snprintf(page + len, count - len, "sta's macaddr: %pM\n", psta->hwaddr);
|
||||
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);
|
||||
|
@ -987,7 +981,7 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
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
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
len += snprintf(page + len, count - len, "sleepq_len=%d\n", psta->sleepq_len);
|
||||
len += snprintf(page + len, count - len, "capability=0x%x\n", psta->capability);
|
||||
len += snprintf(page + len, count - len, "flags=0x%x\n", psta->flags);
|
||||
|
@ -1005,20 +999,13 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
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
|
||||
|
||||
#ifdef CONFIG_FIND_BEST_CHANNEL
|
||||
|
@ -1040,7 +1027,7 @@ int proc_get_best_channel(char *page, char **start,
|
|||
}
|
||||
|
||||
for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) {
|
||||
// 2.4G
|
||||
/* 2.4G */
|
||||
if ( pmlmeext->channel_set[i].ChannelNum == 6 ) {
|
||||
if ( pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_24G].rx_count ) {
|
||||
index_24G = i;
|
||||
|
@ -1048,10 +1035,10 @@ int proc_get_best_channel(char *page, char **start,
|
|||
}
|
||||
}
|
||||
|
||||
// 5G
|
||||
/* 5G */
|
||||
if ( pmlmeext->channel_set[i].ChannelNum >= 36
|
||||
&& pmlmeext->channel_set[i].ChannelNum < 140 ) {
|
||||
// Find primary channel
|
||||
/* Find primary channel */
|
||||
if ( (( pmlmeext->channel_set[i].ChannelNum - 36) % 8 == 0)
|
||||
&& (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count) ) {
|
||||
index_5G = i;
|
||||
|
@ -1061,14 +1048,14 @@ int proc_get_best_channel(char *page, char **start,
|
|||
|
||||
if ( pmlmeext->channel_set[i].ChannelNum >= 149
|
||||
&& pmlmeext->channel_set[i].ChannelNum < 165) {
|
||||
// find primary channel
|
||||
/* find primary channel */
|
||||
if ( (( pmlmeext->channel_set[i].ChannelNum - 149) % 8 == 0)
|
||||
&& (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count) ) {
|
||||
index_5G = i;
|
||||
best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
|
||||
}
|
||||
}
|
||||
#if 1 // debug
|
||||
#if 1 /* debug */
|
||||
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
|
||||
|
|
184
core/rtw_efuse.c
184
core/rtw_efuse.c
|
@ -44,10 +44,10 @@ u8 fakeBTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN]={0};
|
|||
u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN]={0};
|
||||
/*------------------------Define local variable------------------------------*/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
#define REG_EFUSE_CTRL 0x0030
|
||||
#define EFUSE_CTRL REG_EFUSE_CTRL // E-Fuse Control.
|
||||
//------------------------------------------------------------------------------
|
||||
#define EFUSE_CTRL REG_EFUSE_CTRL /* E-Fuse Control. */
|
||||
/* */
|
||||
|
||||
bool
|
||||
Efuse_Read1ByteFromFakeContent(
|
||||
|
@ -64,7 +64,6 @@ Efuse_Read1ByteFromFakeContent(
|
|||
{
|
||||
return false;
|
||||
}
|
||||
//DbgPrint("Read fake content, offset = %d\n", Offset);
|
||||
if (fakeEfuseBank == 0)
|
||||
*Value = fakeEfuseContent[Offset];
|
||||
else
|
||||
|
@ -157,24 +156,24 @@ u8
|
|||
Efuse_CalculateWordCnts(u8 word_en)
|
||||
{
|
||||
u8 word_cnts = 0;
|
||||
if (!(word_en & BIT(0))) word_cnts++; // 0 : write enable
|
||||
if (!(word_en & BIT(0))) word_cnts++; /* 0 : write enable */
|
||||
if (!(word_en & BIT(1))) word_cnts++;
|
||||
if (!(word_en & BIT(2))) word_cnts++;
|
||||
if (!(word_en & BIT(3))) word_cnts++;
|
||||
return word_cnts;
|
||||
}
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Execute E-Fuse read byte operation.
|
||||
// Refered from SD1 Richard.
|
||||
//
|
||||
// Assumption:
|
||||
// 1. Boot from E-Fuse and successfully auto-load.
|
||||
// 2. PASSIVE_LEVEL (USB interface)
|
||||
//
|
||||
// Created by Roger, 2008.10.21.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Execute E-Fuse read byte operation. */
|
||||
/* Refered from SD1 Richard. */
|
||||
/* */
|
||||
/* Assumption: */
|
||||
/* 1. Boot from E-Fuse and successfully auto-load. */
|
||||
/* 2. PASSIVE_LEVEL (USB interface) */
|
||||
/* */
|
||||
/* Created by Roger, 2008.10.21. */
|
||||
/* */
|
||||
void
|
||||
ReadEFuseByte(
|
||||
PADAPTER Adapter,
|
||||
|
@ -185,7 +184,6 @@ ReadEFuseByte(
|
|||
u32 value32;
|
||||
u8 readbyte;
|
||||
u16 retry;
|
||||
//u32 start=rtw_get_current_time();
|
||||
|
||||
if (bPseudoTest)
|
||||
{
|
||||
|
@ -193,55 +191,53 @@ ReadEFuseByte(
|
|||
return;
|
||||
}
|
||||
|
||||
//Write Address
|
||||
/* Write Address */
|
||||
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));
|
||||
|
||||
//Write bit 32 0
|
||||
/* Write bit 32 0 */
|
||||
readbyte = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f));
|
||||
|
||||
//Check bit 32 read-ready
|
||||
/* Check bit 32 read-ready */
|
||||
retry = 0;
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
//while (!(((value32 >> 24) & 0xff) & 0x80) && (retry<10))
|
||||
while (!(((value32 >> 24) & 0xff) & 0x80) && (retry<10000))
|
||||
{
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
retry++;
|
||||
}
|
||||
|
||||
// 20100205 Joseph: Add delay suggested by SD1 Victor.
|
||||
// This fix the problem that Efuse read error in high temperature condition.
|
||||
// Designer says that there shall be some delay after ready bit is set, or the
|
||||
// result will always stay on last data we read.
|
||||
/* 20100205 Joseph: Add delay suggested by SD1 Victor. */
|
||||
/* This fix the problem that Efuse read error in high temperature condition. */
|
||||
/* Designer says that there shall be some delay after ready bit is set, or the */
|
||||
/* result will always stay on last data we read. */
|
||||
rtw_udelay_os(50);
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
|
||||
*pbuf = (u8)(value32 & 0xff);
|
||||
//DBG_88E("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
|
||||
// save to E-Fuse table.
|
||||
// 2. Refered from SD1 Richard.
|
||||
//
|
||||
// Assumption:
|
||||
// 1. Boot from E-Fuse and successfully auto-load.
|
||||
// 2. PASSIVE_LEVEL (USB interface)
|
||||
//
|
||||
// Created by Roger, 2008.10.21.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* 1. Execute E-Fuse read byte operation according as map offset and */
|
||||
/* save to E-Fuse table. */
|
||||
/* 2. Refered from SD1 Richard. */
|
||||
/* */
|
||||
/* Assumption: */
|
||||
/* 1. Boot from E-Fuse and successfully auto-load. */
|
||||
/* 2. PASSIVE_LEVEL (USB interface) */
|
||||
/* */
|
||||
/* Created by Roger, 2008.10.21. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
|
||||
void
|
||||
efuse_ReadEFuse(
|
||||
|
@ -306,22 +302,22 @@ EFUSE_Read1Byte(
|
|||
|
||||
EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI , TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen, false);
|
||||
|
||||
if (Address < contentLen) //E-fuse 512Byte
|
||||
if (Address < contentLen) /* E-fuse 512Byte */
|
||||
{
|
||||
//Write E-fuse Register address bit0~7
|
||||
/* Write E-fuse Register address bit0~7 */
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
//Write E-fuse Register address bit8~9
|
||||
/* Write E-fuse Register address bit8~9 */
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
|
||||
//Write 0x30[31]=0
|
||||
/* Write 0x30[31]=0 */
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
temp = Bytetemp & 0x7F;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+3, temp);
|
||||
|
||||
//Wait Write-ready (0x30[31]=1)
|
||||
/* Wait Write-ready (0x30[31]=1) */
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
while (!(Bytetemp & 0x80))
|
||||
{
|
||||
|
@ -374,28 +370,28 @@ EFUSE_Write1Byte(
|
|||
u32 k=0;
|
||||
u16 contentLen=0;
|
||||
|
||||
//RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr=%x Data =%x\n", Address, Value));
|
||||
/* RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr=%x Data =%x\n", Address, Value)); */
|
||||
EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI , TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen, false);
|
||||
|
||||
if ( Address < contentLen) //E-fuse 512Byte
|
||||
if ( Address < contentLen) /* E-fuse 512Byte */
|
||||
{
|
||||
rtw_write8(Adapter, EFUSE_CTRL, Value);
|
||||
|
||||
//Write E-fuse Register address bit0~7
|
||||
/* Write E-fuse Register address bit0~7 */
|
||||
temp = Address & 0xFF;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
|
||||
|
||||
//Write E-fuse Register address bit8~9
|
||||
/* Write E-fuse Register address bit8~9 */
|
||||
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
|
||||
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
|
||||
|
||||
//Write 0x30[31]=1
|
||||
/* Write 0x30[31]=1 */
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
temp = Bytetemp | 0x80;
|
||||
rtw_write8(Adapter, EFUSE_CTRL+3, temp);
|
||||
|
||||
//Wait Write-ready (0x30[31]=0)
|
||||
/* Wait Write-ready (0x30[31]=0) */
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
while (Bytetemp & 0x80)
|
||||
{
|
||||
|
@ -426,13 +422,13 @@ efuse_OneByteRead(
|
|||
bResult = Efuse_Read1ByteFromFakeContent(pAdapter, addr, data);
|
||||
return bResult;
|
||||
}
|
||||
// -----------------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, ((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))
|
||||
{
|
||||
|
@ -467,18 +463,18 @@ efuse_OneByteWrite(
|
|||
bResult = Efuse_Write1ByteToFakeContent(pAdapter, addr, data);
|
||||
return bResult;
|
||||
}
|
||||
//RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr = %x Data=%x\n", addr, data));
|
||||
/* RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr = %x Data=%x\n", addr, data)); */
|
||||
|
||||
//return 0;
|
||||
/* 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, data);/* data */
|
||||
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);//write cmd
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);/* write cmd */
|
||||
|
||||
while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx<100) ){
|
||||
tmpidx++;
|
||||
|
@ -632,7 +628,7 @@ u8 rtw_efuse_access(PADAPTER padapter, u8 bWrite, u16 start_addr, u16 cnts, u8 *
|
|||
|
||||
Efuse_PowerSwitch(padapter, bWrite, true);
|
||||
|
||||
// e-fuse one byte read / write
|
||||
/* e-fuse one byte read / write */
|
||||
for (i = 0; i < cnts; i++) {
|
||||
if (start_addr >= real_content_len) {
|
||||
res = _FAIL;
|
||||
|
@ -647,14 +643,14 @@ u8 rtw_efuse_access(PADAPTER padapter, u8 bWrite, u16 start_addr, u16 cnts, u8 *
|
|||
|
||||
return res;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
u16 efuse_GetMaxSize(PADAPTER padapter)
|
||||
{
|
||||
u16 max_size;
|
||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI , TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (void *)&max_size, false);
|
||||
return max_size;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
u8 efuse_GetCurrentSize(PADAPTER padapter, u16 *size)
|
||||
{
|
||||
Efuse_PowerSwitch(padapter, false, true);
|
||||
|
@ -663,7 +659,7 @@ u8 efuse_GetCurrentSize(PADAPTER padapter, u16 *size)
|
|||
|
||||
return _SUCCESS;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
u8 rtw_efuse_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
||||
{
|
||||
u16 mapLen=0;
|
||||
|
@ -699,7 +695,7 @@ u8 rtw_BT_efuse_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
|
||||
return _SUCCESS;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
||||
{
|
||||
u8 offset, word_en;
|
||||
|
@ -727,11 +723,11 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
offset = (addr >> 3);
|
||||
word_en = 0xF;
|
||||
_rtw_memset(newdata, 0xFF, PGPKT_DATA_SIZE);
|
||||
i = addr & 0x7; // index of one package
|
||||
idx = 0; // data index
|
||||
i = addr & 0x7; /* index of one package */
|
||||
idx = 0; /* data index */
|
||||
|
||||
if (i & 0x1) {
|
||||
// odd start
|
||||
/* odd start */
|
||||
if (data[idx] != map[addr+idx]) {
|
||||
word_en &= ~BIT(i >> 1);
|
||||
newdata[i-1] = map[addr+idx-1];
|
||||
|
@ -791,7 +787,7 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
u8 rtw_BT_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
||||
{
|
||||
u8 offset, word_en;
|
||||
|
@ -818,11 +814,11 @@ u8 rtw_BT_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
offset = (addr >> 3);
|
||||
word_en = 0xF;
|
||||
_rtw_memset(newdata, 0xFF, PGPKT_DATA_SIZE);
|
||||
i = addr & 0x7; // index of one package
|
||||
idx = 0; // data index
|
||||
i = addr & 0x7; /* index of one package */
|
||||
idx = 0; /* data index */
|
||||
|
||||
if (i & 0x1) {
|
||||
// odd start
|
||||
/* odd start */
|
||||
if (data[idx] != map[addr+idx]) {
|
||||
word_en &= ~BIT(i >> 1);
|
||||
newdata[i-1] = map[addr+idx-1];
|
||||
|
@ -955,9 +951,9 @@ efuse_ShadowRead1Byte(
|
|||
|
||||
*Value = pEEPROM->efuse_eeprom_data[Offset];
|
||||
|
||||
} // EFUSE_ShadowRead1Byte
|
||||
} /* EFUSE_ShadowRead1Byte */
|
||||
|
||||
//---------------Read Two Bytes
|
||||
/* Read Two Bytes */
|
||||
static void
|
||||
efuse_ShadowRead2Byte(
|
||||
PADAPTER pAdapter,
|
||||
|
@ -969,9 +965,9 @@ efuse_ShadowRead2Byte(
|
|||
*Value = pEEPROM->efuse_eeprom_data[Offset];
|
||||
*Value |= pEEPROM->efuse_eeprom_data[Offset+1]<<8;
|
||||
|
||||
} // EFUSE_ShadowRead2Byte
|
||||
} /* EFUSE_ShadowRead2Byte */
|
||||
|
||||
//---------------Read Four Bytes
|
||||
/* Read Four Bytes */
|
||||
static void
|
||||
efuse_ShadowRead4Byte(
|
||||
PADAPTER pAdapter,
|
||||
|
@ -985,7 +981,7 @@ efuse_ShadowRead4Byte(
|
|||
*Value |= pEEPROM->efuse_eeprom_data[Offset+2]<<16;
|
||||
*Value |= pEEPROM->efuse_eeprom_data[Offset+3]<<24;
|
||||
|
||||
} // efuse_ShadowRead4Byte
|
||||
} /* efuse_ShadowRead4Byte */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
|
@ -1012,7 +1008,7 @@ efuse_ShadowWrite1Byte(
|
|||
PADAPTER pAdapter,
|
||||
u16 Offset,
|
||||
u8 Value);
|
||||
#endif //PLATFORM
|
||||
#endif /* PLATFORM */
|
||||
static void
|
||||
efuse_ShadowWrite1Byte(
|
||||
PADAPTER pAdapter,
|
||||
|
@ -1023,9 +1019,9 @@ efuse_ShadowWrite1Byte(
|
|||
|
||||
pEEPROM->efuse_eeprom_data[Offset] = Value;
|
||||
|
||||
} // efuse_ShadowWrite1Byte
|
||||
} /* efuse_ShadowWrite1Byte */
|
||||
|
||||
//---------------Write Two Bytes
|
||||
/* Write Two Bytes */
|
||||
static void
|
||||
efuse_ShadowWrite2Byte(
|
||||
PADAPTER pAdapter,
|
||||
|
@ -1037,9 +1033,9 @@ efuse_ShadowWrite2Byte(
|
|||
pEEPROM->efuse_eeprom_data[Offset] = Value&0x00FF;
|
||||
pEEPROM->efuse_eeprom_data[Offset+1] = Value>>8;
|
||||
|
||||
} // efuse_ShadowWrite1Byte
|
||||
} /* efuse_ShadowWrite1Byte */
|
||||
|
||||
//---------------Write Four Bytes
|
||||
/* Write Four Bytes */
|
||||
static void
|
||||
efuse_ShadowWrite4Byte(
|
||||
PADAPTER pAdapter,
|
||||
|
@ -1053,7 +1049,7 @@ efuse_ShadowWrite4Byte(
|
|||
pEEPROM->efuse_eeprom_data[Offset+2] = (u8)((Value>>16)&0x00FF);
|
||||
pEEPROM->efuse_eeprom_data[Offset+3] = (u8)((Value>>24)&0xFF);
|
||||
|
||||
} // efuse_ShadowWrite1Byte
|
||||
} /* efuse_ShadowWrite1Byte */
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: EFUSE_ShadowMapUpdate
|
||||
|
@ -1099,9 +1095,9 @@ void EFUSE_ShadowMapUpdate(
|
|||
#endif
|
||||
}
|
||||
|
||||
//PlatformMoveMemory((void *)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0],
|
||||
//(void *)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen);
|
||||
}// EFUSE_ShadowMapUpdate
|
||||
/* PlatformMoveMemory((void *)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0], */
|
||||
/* void *)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen); */
|
||||
}/* EFUSE_ShadowMapUpdate */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
|
@ -1134,7 +1130,7 @@ EFUSE_ShadowRead(
|
|||
else if (Type == 4)
|
||||
efuse_ShadowRead4Byte(pAdapter, Offset, (u32 *)Value);
|
||||
|
||||
} // EFUSE_ShadowRead
|
||||
} /* EFUSE_ShadowRead */
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: EFUSE_ShadowWrite
|
||||
|
@ -1179,7 +1175,7 @@ EFUSE_ShadowWrite(
|
|||
else if (Type == 4)
|
||||
efuse_ShadowWrite4Byte(pAdapter, Offset, (u32)Value);
|
||||
|
||||
} // EFUSE_ShadowWrite
|
||||
} /* EFUSE_ShadowWrite */
|
||||
|
||||
void
|
||||
Efuse_InitSomeVar(
|
||||
|
@ -1213,7 +1209,7 @@ Efuse_InitSomeVar(
|
|||
|
||||
#ifdef PLATFORM_LINUX
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
//#include <rtw_eeprom.h>
|
||||
/* include <rtw_eeprom.h> */
|
||||
|
||||
int isAdaptorInfoFileValid(void)
|
||||
{
|
||||
|
@ -1257,5 +1253,5 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
#endif //PLATFORM_LINUX
|
||||
#endif /* CONFIG_ADAPTOR_INFO_CACHING_FILE */
|
||||
#endif /* PLATFORM_LINUX */
|
||||
|
|
|
@ -47,9 +47,9 @@ u8 RSN_CIPHER_SUITE_TKIP[] = { 0x00, 0x0f, 0xac, 2 };
|
|||
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[] =
|
||||
{(IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK),
|
||||
|
@ -70,7 +70,7 @@ static u8 WIFI_OFDMRATES[] =
|
|||
|
||||
int rtw_get_bit_value_from_ieee_value(u8 val)
|
||||
{
|
||||
unsigned char dot11_rate_table[]={2,4,11,22,12,18,24,36,48,72,96,108,0}; // last element must be zero!!
|
||||
unsigned char dot11_rate_table[]={2,4,11,22,12,18,24,36,48,72,96,108,0}; /* last element must be zero!! */
|
||||
|
||||
int i=0;
|
||||
while (dot11_rate_table[i] != 0) {
|
||||
|
@ -124,7 +124,7 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
|
|||
else
|
||||
return WIRELESS_11A;
|
||||
}
|
||||
else // could be pure B, pure G, or B/G
|
||||
else /* could be pure B, pure G, or B/G */
|
||||
{
|
||||
if ((rtw_is_cckratesonly_included(rate)) == true)
|
||||
return WIRELESS_11B;
|
||||
|
@ -144,14 +144,14 @@ u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *sourc
|
|||
return (pbuf + len);
|
||||
}
|
||||
|
||||
// rtw_set_ie will update frame length
|
||||
/* rtw_set_ie will update frame length */
|
||||
u8 *rtw_set_ie
|
||||
(
|
||||
u8 *pbuf,
|
||||
sint index,
|
||||
uint len,
|
||||
u8 *source,
|
||||
uint *frlen //frame length
|
||||
uint *frlen /* frame length */
|
||||
)
|
||||
{
|
||||
_func_enter_;
|
||||
|
@ -300,7 +300,7 @@ 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 */
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ _func_enter_;
|
|||
case WIRELESS_11G:
|
||||
case WIRELESS_11A:
|
||||
case WIRELESS_11_5N:
|
||||
case WIRELESS_11A_5N://Todo: no basic rate for ofdm ?
|
||||
case WIRELESS_11A_5N:/* Todo: no basic rate for ofdm ? */
|
||||
_rtw_memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
|
||||
break;
|
||||
|
||||
|
@ -413,16 +413,16 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
//timestamp will be inserted by hardware
|
||||
/* timestamp will be inserted by hardware */
|
||||
sz += 8;
|
||||
ie += sz;
|
||||
|
||||
//beacon interval : 2bytes
|
||||
*(__le16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);//BCN_INTERVAL;
|
||||
/* beacon interval : 2bytes */
|
||||
*(__le16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);/* BCN_INTERVAL; */
|
||||
sz += 2;
|
||||
ie += 2;
|
||||
|
||||
//capability info
|
||||
/* capability info */
|
||||
*(u16*)ie = 0;
|
||||
|
||||
*(__le16*)ie |= cpu_to_le16(cap_IBSS);
|
||||
|
@ -436,10 +436,10 @@ _func_enter_;
|
|||
sz += 2;
|
||||
ie += 2;
|
||||
|
||||
//SSID
|
||||
/* SSID */
|
||||
ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);
|
||||
|
||||
//supported rates
|
||||
/* supported rates */
|
||||
if (pregistrypriv->wireless_mode == WIRELESS_11ABGN)
|
||||
{
|
||||
if (pdev_network->Configuration.DSConfig > 14)
|
||||
|
@ -459,18 +459,18 @@ _func_enter_;
|
|||
if (rateLen > 8)
|
||||
{
|
||||
ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, pdev_network->SupportedRates, &sz);
|
||||
//ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz);
|
||||
/* ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); */
|
||||
}
|
||||
else
|
||||
{
|
||||
ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, pdev_network->SupportedRates, &sz);
|
||||
}
|
||||
|
||||
//DS parameter set
|
||||
/* DS parameter set */
|
||||
ie = rtw_set_ie(ie, _DSSET_IE_, 1, (u8 *)&(pdev_network->Configuration.DSConfig), &sz);
|
||||
|
||||
|
||||
//IBSS Parameter Set
|
||||
/* IBSS Parameter Set */
|
||||
|
||||
ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz);
|
||||
|
||||
|
@ -480,22 +480,19 @@ _func_enter_;
|
|||
}
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
//HT Cap.
|
||||
/* HT Cap. */
|
||||
if (((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
|
||||
&& (pregistrypriv->ht_enable==true))
|
||||
{
|
||||
//todo:
|
||||
/* todo: */
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
//pdev_network->IELength = sz; //update IELength
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
||||
_func_exit_;
|
||||
|
||||
//return _SUCCESS;
|
||||
/* return _SUCCESS; */
|
||||
|
||||
return sz;
|
||||
|
||||
}
|
||||
|
||||
unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
|
||||
|
@ -513,13 +510,13 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
|
|||
|
||||
if (pbuf) {
|
||||
|
||||
//check if oui matches...
|
||||
/* check if oui matches... */
|
||||
if (_rtw_memcmp((pbuf + 2), wpa_oui_type, sizeof (wpa_oui_type)) == false) {
|
||||
|
||||
goto check_next_ie;
|
||||
}
|
||||
|
||||
//check version...
|
||||
/* check version... */
|
||||
_rtw_memcpy((u8 *)&le_tmp, (pbuf + 6), sizeof(val16));
|
||||
|
||||
val16 = le16_to_cpu(le_tmp);
|
||||
|
@ -619,7 +616,7 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|||
left = wpa_ie_len - 8;
|
||||
|
||||
|
||||
//group_cipher
|
||||
/* group_cipher */
|
||||
if (left >= WPA_SELECTOR_LEN) {
|
||||
|
||||
*group_cipher = rtw_get_wpa_cipher_suite(pos);
|
||||
|
@ -636,10 +633,10 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|||
}
|
||||
|
||||
|
||||
//pairwise_cipher
|
||||
/* 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;
|
||||
|
@ -701,7 +698,7 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
pos += 4;
|
||||
left = rsn_ie_len - 4;
|
||||
|
||||
//group_cipher
|
||||
/* group_cipher */
|
||||
if (left >= RSN_SELECTOR_LEN) {
|
||||
|
||||
*group_cipher = rtw_get_wpa2_cipher_suite(pos);
|
||||
|
@ -714,10 +711,10 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
//pairwise_cipher
|
||||
/* 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;
|
||||
|
@ -772,7 +769,7 @@ _func_enter_;
|
|||
{
|
||||
authmode=in_ie[cnt];
|
||||
|
||||
//if (authmode==_WAPI_IE_)
|
||||
/* 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))
|
||||
{
|
||||
|
@ -787,11 +784,11 @@ _func_enter_;
|
|||
}
|
||||
|
||||
*wapi_len=in_ie[cnt+1]+2;
|
||||
cnt+=in_ie[cnt+1]+2; //get next
|
||||
cnt+=in_ie[cnt+1]+2; /* get next */
|
||||
}
|
||||
else
|
||||
{
|
||||
cnt+=in_ie[cnt+1]+2; //get next
|
||||
cnt+=in_ie[cnt+1]+2; /* get next */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -810,7 +807,7 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16
|
|||
|
||||
_func_enter_;
|
||||
|
||||
//Search required WPA or WPA2 IE and copy to sec_ie[ ]
|
||||
/* Search required WPA or WPA2 IE and copy to sec_ie[ ] */
|
||||
|
||||
cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_);
|
||||
|
||||
|
@ -835,7 +832,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
*wpa_len=in_ie[cnt+1]+2;
|
||||
cnt+=in_ie[cnt+1]+2; //get next
|
||||
cnt+=in_ie[cnt+1]+2; /* get next */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -854,11 +851,11 @@ _func_enter_;
|
|||
}
|
||||
|
||||
*rsn_len=in_ie[cnt+1]+2;
|
||||
cnt+=in_ie[cnt+1]+2; //get next
|
||||
cnt+=in_ie[cnt+1]+2; /* get next */
|
||||
}
|
||||
else
|
||||
{
|
||||
cnt+=in_ie[cnt+1]+2; //get next
|
||||
cnt+=in_ie[cnt+1]+2; /* get next */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -881,7 +878,7 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
|
|||
|
||||
if ((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==true))
|
||||
{
|
||||
//DBG_88E("==> found WPS_IE.....\n");
|
||||
/* DBG_88E("==> found WPS_IE.....\n"); */
|
||||
*wps_ielen = ie_ptr[1]+2;
|
||||
match=true;
|
||||
}
|
||||
|
@ -931,7 +928,7 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
|
|||
}
|
||||
else
|
||||
{
|
||||
cnt+=in_ie[cnt+1]+2; //goto next
|
||||
cnt+=in_ie[cnt+1]+2; /* goto next */
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -964,17 +961,17 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
|
|||
return attr_ptr;
|
||||
}
|
||||
|
||||
// 6 = 1(Element ID) + 1(Length) + 4(WPS OUI)
|
||||
attr_ptr = wps_ie + 6; //goto first attr
|
||||
/* 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)
|
||||
/* 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_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len);
|
||||
/* DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); */
|
||||
if ( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
@ -989,7 +986,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
|
|||
}
|
||||
else
|
||||
{
|
||||
attr_ptr += attr_len; //goto next
|
||||
attr_ptr += attr_len; /* goto next */
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1291,7 +1288,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
if (mac_addr == NULL) return;
|
||||
|
||||
if ( rtw_initmac )
|
||||
{ // Users specify the mac address
|
||||
{ /* Users specify the mac address */
|
||||
int jj,kk;
|
||||
|
||||
for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 )
|
||||
|
@ -1301,7 +1298,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
|
||||
}
|
||||
else
|
||||
{ // Use the mac address stored in the Efuse
|
||||
{ /* Use the mac address stored in the Efuse */
|
||||
_rtw_memcpy(mac, mac_addr, ETH_ALEN);
|
||||
}
|
||||
|
||||
|
@ -1316,7 +1313,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
|
|||
mac[3] = 0x87;
|
||||
mac[4] = 0x00;
|
||||
mac[5] = 0x00;
|
||||
// use default mac addresss
|
||||
/* use default mac addresss */
|
||||
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
|
||||
DBG_88E("MAC Address from efuse error, assign default one !!!\n");
|
||||
}
|
||||
|
@ -1436,7 +1433,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|||
}
|
||||
else
|
||||
{
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
cnt += in_ie[ cnt + 1 ] +2; /* goto next */
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1470,17 +1467,17 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
|
|||
return attr_ptr;
|
||||
}
|
||||
|
||||
// 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type)
|
||||
attr_ptr = p2p_ie + 6; //goto first 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)
|
||||
/* 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_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len);
|
||||
/* DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); */
|
||||
if ( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
@ -1495,7 +1492,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
|
|||
}
|
||||
else
|
||||
{
|
||||
attr_ptr += attr_len; //goto next
|
||||
attr_ptr += attr_len; /* goto next */
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1543,7 +1540,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
|
|||
|
||||
*pbuf = attr_id;
|
||||
|
||||
//*(u16*)(pbuf + 1) = cpu_to_le16(attr_len);
|
||||
/* u16*)(pbuf + 1) = cpu_to_le16(attr_len); */
|
||||
RTW_PUT_LE16(pbuf + 1, attr_len);
|
||||
|
||||
if (pdata_attr)
|
||||
|
@ -1605,7 +1602,7 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
|
|||
}
|
||||
}
|
||||
|
||||
#endif //CONFIG_P2P
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
||||
|
@ -1653,7 +1650,7 @@ 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 */
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1667,8 +1664,8 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
|
||||
}
|
||||
|
||||
// attr_content: The output buffer, contains the "body field" of WFD attribute.
|
||||
// attr_contentlen: The data length of the "body field" of WFD attribute.
|
||||
/* attr_content: The output buffer, contains the "body field" of WFD attribute. */
|
||||
/* attr_contentlen: The data length of the "body field" of WFD attribute. */
|
||||
int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen)
|
||||
{
|
||||
int match;
|
||||
|
@ -1684,7 +1681,7 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
|
|||
return( match );
|
||||
}
|
||||
|
||||
// 1 ( WFD IE ) + 1 ( Length ) + 3 ( OUI ) + 1 ( OUI Type )
|
||||
/* 1 ( WFD IE ) + 1 ( Length ) + 3 ( OUI ) + 1 ( OUI Type ) */
|
||||
cnt = 6;
|
||||
while ( cnt < wfd_ielen )
|
||||
{
|
||||
|
@ -1693,7 +1690,7 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
|
|||
attr_id = wfd_ie[cnt];
|
||||
if ( attr_id == target_attr_id )
|
||||
{
|
||||
// 3 -> 1 byte for attribute ID field, 2 bytes for length field
|
||||
/* 3 -> 1 byte for attribute ID field, 2 bytes for length field */
|
||||
if (attr_content)
|
||||
_rtw_memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen );
|
||||
|
||||
|
@ -1707,7 +1704,7 @@ 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 */
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1715,9 +1712,9 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
|
|||
return match;
|
||||
|
||||
}
|
||||
#endif // CONFIG_WFD
|
||||
#endif /* CONFIG_WFD */
|
||||
|
||||
//Baron adds to avoid FreeBSD warning
|
||||
/* Baron adds to avoid FreeBSD warning */
|
||||
int ieee80211_is_empty_essid(const char *essid, int essid_len)
|
||||
{
|
||||
/* Single white space is for Linksys APs */
|
||||
|
@ -1860,7 +1857,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
}
|
||||
}
|
||||
|
||||
//show MCS rate, unit: 100Kbps
|
||||
/* show MCS rate, unit: 100Kbps */
|
||||
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;
|
||||
|
|
|
@ -90,7 +90,7 @@ jackson@realtek.com.tw
|
|||
u8 _rtw_read8(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u8 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
@ -104,30 +104,30 @@ u8 _rtw_read8(_adapter *adapter, u32 addr)
|
|||
|
||||
u16 _rtw_read16(_adapter *adapter, u32 addr)
|
||||
{
|
||||
__le16 r_val;
|
||||
u16 r_val;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
__le16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read16 = pintfhdl->io_ops._read16;
|
||||
|
||||
r_val = _read16(pintfhdl, addr);
|
||||
_func_exit_;
|
||||
return rtw_le16_to_cpu(r_val);
|
||||
return r_val;
|
||||
}
|
||||
|
||||
u32 _rtw_read32(_adapter *adapter, u32 addr)
|
||||
{
|
||||
__le32 r_val;
|
||||
u32 r_val;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
__le32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read32 = pintfhdl->io_ops._read32;
|
||||
|
||||
r_val = _read32(pintfhdl, addr);
|
||||
_func_exit_;
|
||||
return rtw_le32_to_cpu(r_val);
|
||||
return r_val;
|
||||
}
|
||||
|
||||
int _rtw_write8(_adapter *adapter, u32 addr, u8 val)
|
||||
|
@ -149,14 +149,12 @@ int _rtw_write16(_adapter *adapter, u32 addr, u16 val)
|
|||
{
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, __le16 val);
|
||||
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int ret;
|
||||
__le16 ival;
|
||||
_func_enter_;
|
||||
_write16 = pintfhdl->io_ops._write16;
|
||||
|
||||
ival = rtw_cpu_to_le16(val);
|
||||
ret = _write16(pintfhdl, addr, ival);
|
||||
ret = _write16(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
|
@ -165,14 +163,12 @@ int _rtw_write32(_adapter *adapter, u32 addr, u32 val)
|
|||
{
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, __le32 val);
|
||||
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret;
|
||||
__le32 ival;
|
||||
_func_enter_;
|
||||
_write32 = pintfhdl->io_ops._write32;
|
||||
|
||||
ival = rtw_cpu_to_le32(val);
|
||||
ret = _write32(pintfhdl, addr, ival);
|
||||
ret = _write32(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
|
@ -211,14 +207,12 @@ int _rtw_write16_async(_adapter *adapter, u32 addr, u16 val)
|
|||
{
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, __le16 val);
|
||||
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int ret;
|
||||
__le16 ival;
|
||||
|
||||
_func_enter_;
|
||||
_write16_async = pintfhdl->io_ops._write16_async;
|
||||
ival = rtw_cpu_to_le16(val);
|
||||
ret = _write16_async(pintfhdl, addr, ival);
|
||||
ret = _write16_async(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
|
@ -228,14 +222,12 @@ int _rtw_write32_async(_adapter *adapter, u32 addr, u32 val)
|
|||
{
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, __le32 val);
|
||||
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret;
|
||||
__le32 ival;
|
||||
|
||||
_func_enter_;
|
||||
_write32_async = pintfhdl->io_ops._write32_async;
|
||||
ival = rtw_cpu_to_le32(val);
|
||||
ret = _write32_async(pintfhdl, addr, ival);
|
||||
ret = _write32_async(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
|
@ -266,7 +258,6 @@ void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
void _rtw_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
|
@ -283,7 +274,6 @@ void _rtw_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
|
@ -319,7 +309,6 @@ void _rtw_read_port_cancel(_adapter *adapter)
|
|||
u32 _rtw_write_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 ret = _SUCCESS;
|
||||
|
@ -385,12 +374,9 @@ int rtw_init_io_priv(_adapter *padapter, void (*set_intf_ops)(struct _io_ops *po
|
|||
#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;
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
//
|
||||
// Added for WPA2-PSK, by Annie, 2005-09-20.
|
||||
//
|
||||
/* */
|
||||
/* Added for WPA2-PSK, by Annie, 2005-09-20. */
|
||||
/* */
|
||||
u8
|
||||
query_802_11_capability(
|
||||
_adapter* Adapter,
|
||||
|
@ -67,7 +67,7 @@ query_802_11_capability(
|
|||
pCap->NoOfPMKIDs = NUM_PMKID_CACHE;
|
||||
pCap->NoOfAuthEncryptPairsSupported = ulNumOfPairSupported;
|
||||
|
||||
if ( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size.
|
||||
if ( sizeof (szAuthEnc) <= 240 ) /* 240 = 256 - 4*4 SecurityInfo.szCapability: only 256 bytes in size. */
|
||||
{
|
||||
_rtw_memcpy( pucAuthEncryptionSupported, (u8*)szAuthEnc, sizeof (szAuthEnc) );
|
||||
*pulOutLen = pCap->Length;
|
||||
|
@ -90,14 +90,12 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
u8 * pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
unsigned char i,*auth_ie,*supp_ie;
|
||||
|
||||
//NdisZeroMemory(pAssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
|
||||
_rtw_memset(pAssocInfo, 0, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
|
||||
//pAssocInfo->Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
|
||||
//------------------------------------------------------
|
||||
// Association Request related information
|
||||
//------------------------------------------------------
|
||||
// Req_1. AvailableRequestFixedIEs
|
||||
/* */
|
||||
/* Association Request related information */
|
||||
/* */
|
||||
/* Req_1. AvailableRequestFixedIEs */
|
||||
if (psecnetwork!=NULL){
|
||||
|
||||
pAssocInfo->AvailableRequestFixedIEs |= NDIS_802_11_AI_REQFI_CAPABILITIES|NDIS_802_11_AI_REQFI_CURRENTAPADDRESS;
|
||||
|
@ -111,9 +109,9 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
{
|
||||
|
||||
if (psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2)
|
||||
pDest[0] =48; //RSN Information Element
|
||||
pDest[0] =48; /* RSN Information Element */
|
||||
else
|
||||
pDest[0] =221; //WPA(SSN) Information Element
|
||||
pDest[0] =221; /* WPA(SSN) Information Element */
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n Adapter->ndisauthtype==Ndis802_11AuthModeWPA)?0xdd:0x30 [%d]",pDest[0]));
|
||||
supp_ie=&psecuritypriv->supplicant_ie[0];
|
||||
|
@ -122,7 +120,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x\n\n", i,supp_ie[i]));
|
||||
}
|
||||
|
||||
i=13; //0~11 is fixed information element
|
||||
i=13; /* 0~11 is fixed information element */
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("i= %d tgt_network->network.IELength=%d\n\n", i,(int)psecnetwork->IELength));
|
||||
while ((i<supp_ie[0]) && (i<256)){
|
||||
if ((unsigned char)supp_ie[i]==pDest[0]){
|
||||
|
@ -141,7 +139,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
}
|
||||
|
||||
|
||||
pAssocInfo->RequestIELength += (2 + supp_ie[1+i]);// (2 + psecnetwork->IEs[1+i]+4);
|
||||
pAssocInfo->RequestIELength += (2 + supp_ie[1+i]);/* (2 + psecnetwork->IEs[1+i]+4); */
|
||||
|
||||
}
|
||||
|
||||
|
@ -151,9 +149,9 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
}
|
||||
|
||||
|
||||
//------------------------------------------------------
|
||||
// Association Response related information
|
||||
//------------------------------------------------------
|
||||
/* */
|
||||
/* Association Response related information */
|
||||
/* */
|
||||
|
||||
if (check_fwstate( pmlmepriv, _FW_LINKED)==true)
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ _func_enter_;
|
|||
|
||||
for (i = 0; i < ssid->SsidLength; i++)
|
||||
{
|
||||
//wifi, printable ascii code must be supported
|
||||
/* wifi, printable ascii code must be supported */
|
||||
if (!( (ssid->Ssid[i] >= 0x20) && (ssid->Ssid[i] <= 0x7e) )){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid has nonprintabl ascii\n"));
|
||||
ret= false;
|
||||
|
@ -108,8 +108,8 @@ _func_enter_;
|
|||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
||||
//when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty
|
||||
//we try to issue sitesurvey firstly
|
||||
/* when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty */
|
||||
/* we try to issue sitesurvey firstly */
|
||||
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic==false
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
|
@ -118,7 +118,7 @@ _func_enter_;
|
|||
)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_do_join(): site survey if scanned_queue is empty\n."));
|
||||
// submit site_survey_cmd
|
||||
/* submit site_survey_cmd */
|
||||
if (_SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ) {
|
||||
pmlmepriv->to_join = false;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_do_join(): site survey return error\n."));
|
||||
|
@ -145,9 +145,9 @@ _func_enter_;
|
|||
{
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==true)
|
||||
{
|
||||
// submit createbss_cmd to change to a ADHOC_MASTER
|
||||
/* submit createbss_cmd to change to a ADHOC_MASTER */
|
||||
|
||||
//pmlmepriv->lock has been acquired by caller...
|
||||
/* pmlmepriv->lock has been acquired by caller... */
|
||||
WLAN_BSSID_EX *pdev_network = &(padapter->registrypriv.dev_network);
|
||||
|
||||
pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
|
||||
|
@ -175,11 +175,11 @@ _func_enter_;
|
|||
}
|
||||
else
|
||||
{
|
||||
// can't associate ; reset under-linking
|
||||
/* can't associate ; reset under-linking */
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
||||
//when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue
|
||||
//we try to issue sitesurvey firstly
|
||||
/* when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue */
|
||||
/* we try to issue sitesurvey firstly */
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic==false
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
|| pmlmepriv->to_roaming >0
|
||||
|
@ -234,7 +234,6 @@ u8 rtw_pnp_set_power_sleep(_adapter* padapter)
|
|||
_func_enter_;
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("==>rtw_pnp_set_power_sleep!!!\n"));
|
||||
//DbgPrint("+rtw_pnp_set_power_sleep\n");
|
||||
|
||||
res = rtw_setstandby_cmd(padapter, 1);
|
||||
|
||||
|
@ -256,12 +255,11 @@ _func_enter_;
|
|||
break;
|
||||
}
|
||||
|
||||
// SecClearAllKeys(Adapter);
|
||||
// 8711 CAM was not for En/Decrypt only
|
||||
// so, we can't clear all keys.
|
||||
// should we disable WPAcfg (ox0088) bit 1-2, instead of clear all CAM
|
||||
/* 8711 CAM was not for En/Decrypt only */
|
||||
/* so, we can't clear all keys. */
|
||||
/* should we disable WPAcfg (ox0088) bit 1-2, instead of clear all CAM */
|
||||
|
||||
//TO DO...
|
||||
/* TO DO... */
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
@ -341,7 +339,7 @@ _func_enter_;
|
|||
if (_rtw_memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN) == true)
|
||||
{
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)
|
||||
goto release_mlme_lock;//it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again.
|
||||
goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */
|
||||
} else {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("Set BSSID not the same bssid\n"));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("set_bssid=%pM\n", (bssid) ));
|
||||
|
@ -362,7 +360,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
handle_tkip_countermeasure:
|
||||
//should we add something here...?
|
||||
/* should we add something here...? */
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
if (padapter->securitypriv.btkip_countermeasure == true) {
|
||||
|
@ -449,7 +447,7 @@ _func_enter_;
|
|||
|
||||
if (rtw_is_same_ibss(padapter, pnetwork) == false)
|
||||
{
|
||||
//if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again
|
||||
/* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */
|
||||
rtw_disassoc_cmd(padapter, 0, true);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
||||
|
@ -464,7 +462,7 @@ _func_enter_;
|
|||
}
|
||||
else
|
||||
{
|
||||
goto release_mlme_lock;//it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again.
|
||||
goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_LPS
|
||||
|
@ -501,19 +499,19 @@ handle_tkip_countermeasure:
|
|||
u32 diff_time,cur_time ;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid:padapter->securitypriv.btkip_countermeasure==true\n"));
|
||||
NdisGetCurrentSystemTime(&sys_time);
|
||||
cur_time=(u32)(sys_time.QuadPart/10); // In micro-second.
|
||||
cur_time=(u32)(sys_time.QuadPart/10); /* In micro-second. */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid:cur_time=0x%x\n",cur_time));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid:psecuritypriv->last_mic_err_time=0x%x\n",padapter->securitypriv.btkip_countermeasure_time));
|
||||
diff_time = cur_time -padapter->securitypriv.btkip_countermeasure_time; // In micro-second.
|
||||
diff_time = cur_time -padapter->securitypriv.btkip_countermeasure_time; /* In micro-second. */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid:diff_time=0x%x\n",diff_time));
|
||||
|
||||
if (diff_time > 60000000) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid(): countermeasure time >60s.\n"));
|
||||
padapter->securitypriv.btkip_countermeasure=false;
|
||||
// Update MIC error time.
|
||||
/* Update MIC error time. */
|
||||
padapter->securitypriv.btkip_countermeasure_time=0;
|
||||
} else {
|
||||
// can't join in 60 seconds.
|
||||
/* can't join in 60 seconds. */
|
||||
status = _FAIL;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid(): countermeasure time <60s.\n"));
|
||||
goto release_mlme_lock;
|
||||
|
@ -587,11 +585,11 @@ _func_enter_;
|
|||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,(" change mode!"));
|
||||
//DBG_88E("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv));
|
||||
/* DBG_88E("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */
|
||||
|
||||
if (*pold_state==Ndis802_11APMode)
|
||||
{
|
||||
//change to other mode from Ndis802_11APMode
|
||||
/* change to other mode from Ndis802_11APMode */
|
||||
cur_network->join_res = -1;
|
||||
|
||||
#ifdef CONFIG_NATIVEAP_MLME
|
||||
|
@ -610,7 +608,7 @@ _func_enter_;
|
|||
{
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
||||
{
|
||||
rtw_indicate_disconnect(padapter); //will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not
|
||||
rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -632,7 +630,6 @@ _func_enter_;
|
|||
set_fwstate(pmlmepriv, WIFI_AP_STATE);
|
||||
#ifdef CONFIG_NATIVEAP_MLME
|
||||
start_ap_mode(padapter);
|
||||
//rtw_indicate_connect(padapter);
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
@ -641,12 +638,6 @@ _func_enter_;
|
|||
case Ndis802_11InfrastructureMax:
|
||||
break;
|
||||
}
|
||||
|
||||
//SecClearAllKeys(adapter);
|
||||
|
||||
//RT_TRACE(COMP_OID_SET, DBG_LOUD, ("set_infrastructure: fw_state:%x after changing mode\n",
|
||||
// get_fwstate(pmlmepriv) ));
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
}
|
||||
|
||||
|
@ -705,7 +696,7 @@ _func_enter_;
|
|||
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) ||
|
||||
(pmlmepriv->LinkDetectInfo.bBusyTraffic == true))
|
||||
{
|
||||
// Scan or linking is in progress, do nothing.
|
||||
/* Scan or linking is in progress, do nothing. */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_bssid_list_scan fail since fw_state = %x\n", get_fwstate(pmlmepriv)));
|
||||
res = true;
|
||||
|
||||
|
@ -876,15 +867,15 @@ u8 rtw_set_802_11_add_key(_adapter* padapter, NDIS_802_11_KEY *key){
|
|||
u8 * pbssid;
|
||||
struct sta_info *stainfo;
|
||||
u8 bgroup = false;
|
||||
u8 bgrouptkey = false;//can be remove later
|
||||
u8 bgrouptkey = false;/* can be remove later */
|
||||
u8 ret=_SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (((key->KeyIndex & 0x80000000) == 0) && ((key->KeyIndex & 0x40000000) > 0)){
|
||||
|
||||
// It is invalid to clear bit 31 and set bit 30. If the miniport driver encounters this combination,
|
||||
// it must fail the request and return NDIS_STATUS_INVALID_DATA.
|
||||
/* It is invalid to clear bit 31 and set bit 30. If the miniport driver encounters this combination, */
|
||||
/* it must fail the request and return NDIS_STATUS_INVALID_DATA. */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key: ((key->KeyIndex & 0x80000000) == 0)[=%d] ",(int)(key->KeyIndex & 0x80000000) == 0));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key:((key->KeyIndex & 0x40000000) > 0)[=%d]" , (int)(key->KeyIndex & 0x40000000) > 0));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key: key->KeyIndex=%d\n" ,(int)key->KeyIndex));
|
||||
|
@ -894,7 +885,7 @@ _func_enter_;
|
|||
|
||||
if (key->KeyIndex & 0x40000000)
|
||||
{
|
||||
// Pairwise key
|
||||
/* Pairwise key */
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Pairwise key +++++\n"));
|
||||
|
||||
|
@ -919,15 +910,15 @@ _func_enter_;
|
|||
}
|
||||
|
||||
if (key->KeyIndex & 0x000000FF){
|
||||
// The key index is specified in the lower 8 bits by values of zero to 255.
|
||||
// The key index should be set to zero for a Pairwise key, and the driver should fail with
|
||||
// NDIS_STATUS_INVALID_DATA if the lower 8 bits is not zero
|
||||
/* The key index is specified in the lower 8 bits by values of zero to 255. */
|
||||
/* The key index should be set to zero for a Pairwise key, and the driver should fail with */
|
||||
/* NDIS_STATUS_INVALID_DATA if the lower 8 bits is not zero */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" key->KeyIndex & 0x000000FF.\n"));
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
// check BSSID
|
||||
/* check BSSID */
|
||||
if (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == true){
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("MacAddr_isBcst(key->BSSID)\n"));
|
||||
|
@ -935,8 +926,7 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
|
||||
// Check key length for TKIP.
|
||||
//if (encryptionAlgorithm == RT_ENC_TKIP_ENCRYPTION && key->KeyLength != 32)
|
||||
/* Check key length for TKIP. */
|
||||
if ((encryptionalgo== _TKIP_)&& (key->KeyLength != 32)){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("TKIP KeyLength:0x%x != 32\n", key->KeyLength));
|
||||
ret=_FAIL;
|
||||
|
@ -944,9 +934,9 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
// Check key length for AES.
|
||||
/* Check key length for AES. */
|
||||
if ((encryptionalgo== _AES_)&& (key->KeyLength != 16)) {
|
||||
// For our supplicant, EAPPkt9x.vxd, cannot differentiate TKIP and AES case.
|
||||
/* For our supplicant, EAPPkt9x.vxd, cannot differentiate TKIP and AES case. */
|
||||
if (key->KeyLength == 32) {
|
||||
key->KeyLength = 16;
|
||||
} else {
|
||||
|
@ -955,7 +945,7 @@ _func_enter_;
|
|||
}
|
||||
}
|
||||
|
||||
// Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko.
|
||||
/* Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko. */
|
||||
if ( (encryptionalgo== _WEP40_|| encryptionalgo== _WEP104_) && (key->KeyLength != 5 || key->KeyLength != 13)) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("WEP KeyLength:0x%x != 5 or 13\n", key->KeyLength));
|
||||
ret=_FAIL;
|
||||
|
@ -964,7 +954,7 @@ _func_enter_;
|
|||
|
||||
bgroup = false;
|
||||
|
||||
// Check the pairwise key. Added by Annie, 2005-07-06.
|
||||
/* Check the pairwise key. Added by Annie, 2005-07-06. */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n"));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("[Pairwise Key set]\n"));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n"));
|
||||
|
@ -975,11 +965,11 @@ _func_enter_;
|
|||
}
|
||||
else
|
||||
{
|
||||
// Group key - KeyIndex(BIT30==0)
|
||||
/* Group key - KeyIndex(BIT30==0) */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Group key +++++\n"));
|
||||
|
||||
|
||||
// when add wep key through add key and didn't assigned encryption type before
|
||||
/* when add wep key through add key and didn't assigned encryption type before */
|
||||
if ((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy==0))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("keylen=%d( Adapter->securitypriv.dot11PrivacyAlgrthm=%x )padapter->securitypriv.dot118021XGrpPrivacy(%x)\n", key->KeyLength,padapter->securitypriv.dot11PrivacyAlgrthm,padapter->securitypriv.dot118021XGrpPrivacy));
|
||||
|
@ -1018,7 +1008,7 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
|
||||
// Check key length for TKIP
|
||||
/* Check key length for TKIP */
|
||||
if ((encryptionalgo== _TKIP_) && (key->KeyLength != 32)) {
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" TKIP GTK KeyLength:%u != 32\n", key->KeyLength));
|
||||
|
@ -1027,20 +1017,20 @@ _func_enter_;
|
|||
|
||||
} else if (encryptionalgo== _AES_ && (key->KeyLength != 16 && key->KeyLength != 32) ) {
|
||||
|
||||
// Check key length for AES
|
||||
// For NDTEST, we allow keylen=32 in this case. 2005.01.27, by rcnjko.
|
||||
/* Check key length for AES */
|
||||
/* For NDTEST, we allow keylen=32 in this case. 2005.01.27, by rcnjko. */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("<=== SetInfo, OID_802_11_ADD_KEY: AES GTK KeyLength:%u != 16 or 32\n", key->KeyLength));
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
// Change the key length for EAPPkt9x.vxd. Added by Annie, 2005-11-03.
|
||||
/* Change the key length for EAPPkt9x.vxd. Added by Annie, 2005-11-03. */
|
||||
if ((encryptionalgo== _AES_) && (key->KeyLength == 32) ) {
|
||||
key->KeyLength = 16;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("AES key length changed: %u\n", key->KeyLength) );
|
||||
}
|
||||
|
||||
if (key->KeyIndex & 0x8000000) {//error ??? 0x8000_0000
|
||||
if (key->KeyIndex & 0x8000000) {/* error ??? 0x8000_0000 */
|
||||
bgrouptkey = true;
|
||||
}
|
||||
|
||||
|
@ -1060,7 +1050,7 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
// If WEP encryption algorithm, just call rtw_set_802_11_add_wep().
|
||||
/* If WEP encryption algorithm, just call rtw_set_802_11_add_wep(). */
|
||||
if ((padapter->securitypriv.dot11AuthAlgrthm !=dot11AuthAlgrthm_8021X)&&(encryptionalgo== _WEP40_ || encryptionalgo== _WEP104_))
|
||||
{
|
||||
u32 keyindex;
|
||||
|
@ -1089,7 +1079,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
if (key->KeyIndex & 0x20000000){
|
||||
// SetRSC
|
||||
/* SetRSC */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ SetRSC+++++\n"));
|
||||
if (bgroup == true)
|
||||
{
|
||||
|
@ -1104,9 +1094,9 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
// Indicate this key idx is used for TX
|
||||
// Save the key in KeyMaterial
|
||||
if (bgroup == true) // Group transmit key
|
||||
/* Indicate this key idx is used for TX */
|
||||
/* Save the key in KeyMaterial */
|
||||
if (bgroup == true) /* Group transmit key */
|
||||
{
|
||||
int res;
|
||||
|
||||
|
@ -1151,7 +1141,7 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
//set group key by index
|
||||
/* set group key by index */
|
||||
_rtw_memcpy(&padapter->securitypriv.dot118021XGrpKey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial, key->KeyLength);
|
||||
|
||||
key->KeyIndex=key->KeyIndex & 0x03;
|
||||
|
@ -1170,7 +1160,7 @@ _func_enter_;
|
|||
goto exit;
|
||||
|
||||
}
|
||||
else // Pairwise Key
|
||||
else /* Pairwise Key */
|
||||
{
|
||||
u8 res;
|
||||
|
||||
|
@ -1179,7 +1169,7 @@ _func_enter_;
|
|||
|
||||
if (stainfo!=NULL)
|
||||
{
|
||||
_rtw_memset( &stainfo->dot118021x_UncstKey, 0, 16);// clear keybuffer
|
||||
_rtw_memset( &stainfo->dot118021x_UncstKey, 0, 16);/* clear keybuffer */
|
||||
|
||||
_rtw_memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16);
|
||||
|
||||
|
@ -1187,11 +1177,11 @@ _func_enter_;
|
|||
{
|
||||
padapter->securitypriv.busetkipkey=false;
|
||||
|
||||
//_set_timer(&padapter->securitypriv.tkip_timer, 50);
|
||||
/* _set_timer(&padapter->securitypriv.tkip_timer, 50); */
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n ==========_set_timer\n"));
|
||||
|
||||
// if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255]
|
||||
/* if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255] */
|
||||
if ((key->KeyIndex & 0x10000000)){
|
||||
_rtw_memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8);
|
||||
_rtw_memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 24, 8);
|
||||
|
@ -1209,8 +1199,8 @@ _func_enter_;
|
|||
}
|
||||
|
||||
|
||||
//Set key to CAM through H2C command
|
||||
if (bgrouptkey)//never go to here
|
||||
/* Set key to CAM through H2C command */
|
||||
if (bgrouptkey)/* never go to here */
|
||||
{
|
||||
res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, false);
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n"));
|
||||
|
@ -1250,21 +1240,19 @@ _func_enter_;
|
|||
}
|
||||
|
||||
if (bgroup == true) {
|
||||
// clear group key by index
|
||||
//NdisZeroMemory(Adapter->MgntInfo.SecurityInfo.KeyBuf[keyIndex], MAX_WEP_KEY_LEN);
|
||||
//Adapter->MgntInfo.SecurityInfo.KeyLen[keyIndex] = 0;
|
||||
/* clear group key by index */
|
||||
|
||||
_rtw_memset(&padapter->securitypriv.dot118021XGrpKey[keyIndex], 0, 16);
|
||||
|
||||
//! \todo Send a H2C Command to Firmware for removing this Key in CAM Entry.
|
||||
/* \todo Send a H2C Command to Firmware for removing this Key in CAM Entry. */
|
||||
} else {
|
||||
pbssid=get_bssid(&padapter->mlmepriv);
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
|
||||
if (stainfo) {
|
||||
// clear key by BSSID
|
||||
/* clear key by BSSID */
|
||||
_rtw_memset(&stainfo->dot118021x_UncstKey, 0, 16);
|
||||
|
||||
//! \todo Send a H2C Command to Firmware for disable this Key in CAM Entry.
|
||||
/* \todo Send a H2C Command to Firmware for disable this Key in CAM Entry. */
|
||||
} else {
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
|
@ -1321,11 +1309,9 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
|||
|
||||
_rtw_memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2);
|
||||
|
||||
//bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) ? 1:0;
|
||||
//cur_bwmod is updated by beacon, pmlmeinfo is updated by association response
|
||||
/* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */
|
||||
bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1:0;
|
||||
|
||||
//short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1:0;
|
||||
short_GI_20 = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info)&IEEE80211_HT_CAP_SGI_20) ? 1:0;
|
||||
short_GI_40 = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info)&IEEE80211_HT_CAP_SGI_40) ? 1:0;
|
||||
|
||||
|
@ -1340,7 +1326,7 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
|||
}
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_80211N_HT
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
{
|
||||
while ( (pcur_bss->SupportedRates[i]!=0) && (pcur_bss->SupportedRates[i]!=0xFF))
|
||||
{
|
||||
|
@ -1385,7 +1371,7 @@ int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan)
|
|||
struct registry_priv *pregistrypriv = &adapter->registrypriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
//handle by cmd_thread to sync with scan operation
|
||||
/* handle by cmd_thread to sync with scan operation */
|
||||
return rtw_set_chplan_cmd(adapter, channel_plan, 1);
|
||||
}
|
||||
|
||||
|
@ -1402,8 +1388,8 @@ int rtw_set_country(_adapter *adapter, const char *country_code)
|
|||
|
||||
DBG_88E("%s country_code:%s\n", __func__, country_code);
|
||||
|
||||
//TODO: should have a table to match country code and RT_CHANNEL_DOMAIN
|
||||
//TODO: should consider 2-character and 3-character country code
|
||||
/* TODO: should have a table to match country code and RT_CHANNEL_DOMAIN */
|
||||
/* TODO: should consider 2-character and 3-character country code */
|
||||
if (0 == strcmp(country_code, "US"))
|
||||
channel_plan = RT_CHANNEL_DOMAIN_FCC;
|
||||
else if (0 == strcmp(country_code, "EU"))
|
||||
|
|
|
@ -50,7 +50,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter)
|
|||
|
||||
pattrib = &xmit_frame->attrib;
|
||||
update_mgntframe_attrib(adapter, pattrib);
|
||||
pattrib->qsel = 0x10;//Beacon
|
||||
pattrib->qsel = 0x10;/* Beacon */
|
||||
pattrib->subtype = WIFI_BEACON;
|
||||
pattrib->pktlen = pattrib->last_txcmdsz = 0;
|
||||
|
||||
|
@ -81,7 +81,7 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
|
|||
buf_offset = TXDESC_OFFSET;
|
||||
ori_len = buf_offset+pattrib->pktlen;
|
||||
|
||||
//check if the io_buf can accommodate new cmds
|
||||
/* check if the io_buf can accommodate new cmds */
|
||||
if (ori_len + cmd_len + 8 > MAX_XMITBUF_SZ) {
|
||||
DBG_88E("%s %u is large than MAX_XMITBUF_SZ:%u, can't accommodate new cmds\n", __func__
|
||||
, ori_len + cmd_len + 8, MAX_XMITBUF_SZ);
|
||||
|
@ -92,10 +92,9 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
|
|||
pattrib->pktlen += cmd_len;
|
||||
pattrib->last_txcmdsz += cmd_len;
|
||||
|
||||
//DBG_88E("%s ori:%u + cmd_len:%u = %u\n", __func__, ori_len, cmd_len, buf_offset+pattrib->pktlen);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
bool rtw_IOL_applied(ADAPTER *adapter)
|
||||
{
|
||||
if (1 == adapter->registrypriv.fw_iol)
|
||||
|
@ -137,40 +136,31 @@ 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);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if (mask!=0xFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_88E("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __func__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u16 mask)
|
||||
{
|
||||
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);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if (mask!=0xFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_88E("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __func__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
|
@ -179,19 +169,15 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u
|
|||
{
|
||||
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);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if (mask!=0xFFFFFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_88E("%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);
|
||||
|
||||
|
@ -201,33 +187,23 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr,
|
|||
{
|
||||
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);
|
||||
cmd.address = cpu_to_le16((rf_path<<8) |((addr) &0xFF));
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if (mask!=0x000FFFFF)
|
||||
{
|
||||
if (mask != 0x000FFFFF) {
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_88E("%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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
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);
|
||||
|
||||
//DBG_88E("%s %u\n", __func__, us);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
}
|
||||
|
||||
|
@ -235,15 +211,13 @@ 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);
|
||||
|
||||
//DBG_88E("%s %u\n", __func__, ms);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
}
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_END,0xFFFF, 0xFF,0x0};
|
||||
struct ioreg_cfg cmd = {4, IOREG_CMD_END, cpu_to_le16(0xFFFF), cpu_to_le32(0xFF), 0x0};
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
|
||||
}
|
||||
|
@ -255,7 +229,6 @@ u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame)
|
|||
rtw_IOL_append_END_cmd(pxmit_frame);
|
||||
pxmit_frame->attrib.pktlen = ((((pxmit_frame->attrib.pktlen+32)/256)+1)*256 );
|
||||
|
||||
//printk("==> %s, pktlen(%d)\n",__func__,pxmit_frame->attrib.pktlen);
|
||||
pxmit_frame->attrib.last_txcmdsz = pxmit_frame->attrib.pktlen;
|
||||
is_cmd_bndy = true;
|
||||
}
|
||||
|
@ -278,7 +251,7 @@ void rtw_IOL_cmd_buf_dump(ADAPTER *Adapter,int buf_len,u8 *pbuf)
|
|||
}
|
||||
|
||||
|
||||
#else //CONFIG_IOL_NEW_GENERATION
|
||||
#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};
|
||||
|
@ -351,8 +324,6 @@ int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
|||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)us);
|
||||
|
||||
//DBG_88E("%s %u\n", __func__, us);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
|
@ -362,8 +333,6 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
|||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)ms);
|
||||
|
||||
//DBG_88E("%s %u\n", __func__, ms);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
|
@ -394,9 +363,9 @@ int rtw_IOL_exec_empty_cmds_sync(ADAPTER *adapter, u32 max_wating_ms)
|
|||
IOL_CMD end_cmd = {0x0, IOL_CMD_END, 0x0, 0x0};
|
||||
return rtw_IOL_exec_cmd_array_sync(adapter, (u8*)&end_cmd, 1, max_wating_ms);
|
||||
}
|
||||
#endif //CONFIG_IOL_NEW_GENERATION
|
||||
#endif /* CONFIG_IOL_NEW_GENERATION */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //CONFIG_IOL
|
||||
#endif /* CONFIG_IOL */
|
||||
|
|
155
core/rtw_led.c
155
core/rtw_led.c
|
@ -21,21 +21,18 @@
|
|||
#include <drv_types.h>
|
||||
#include "rtw_led.h"
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Callback function of LED BlinkTimer,
|
||||
// it just schedules to corresponding BlinkWorkItem/led_blink_hdl
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Callback function of LED BlinkTimer, */
|
||||
/* it just schedules to corresponding BlinkWorkItem/led_blink_hdl */
|
||||
/* */
|
||||
void BlinkTimerCallback(void *data)
|
||||
{
|
||||
PLED_871x pLed = (PLED_871x)data;
|
||||
_adapter *padapter = pLed->padapter;
|
||||
|
||||
//DBG_88E("%s\n", __func__);
|
||||
|
||||
if ( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true))
|
||||
{
|
||||
//DBG_88E("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __func__, padapter->bSurpriseRemoved, padapter->bDriverStopped);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -52,11 +49,11 @@ void BlinkTimerCallback(void *data)
|
|||
}
|
||||
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
|
||||
//
|
||||
// Description:
|
||||
// Callback function of LED BlinkWorkItem.
|
||||
// We dispatch acture LED blink action according to LedStrategy.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Callback function of LED BlinkWorkItem. */
|
||||
/* We dispatch acture LED blink action according to LedStrategy. */
|
||||
/* */
|
||||
void BlinkWorkItemCallback(struct work_struct *work)
|
||||
{
|
||||
PLED_871x pLed = container_of(work, LED_871x, BlinkWorkItem);
|
||||
|
@ -64,20 +61,20 @@ void BlinkWorkItemCallback(struct work_struct *work)
|
|||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Reset status of LED_871x object.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Reset status of LED_871x object. */
|
||||
/* */
|
||||
void ResetLedStatus(PLED_871x pLed) {
|
||||
|
||||
pLed->CurrLedState = RTW_LED_OFF; // Current LED state.
|
||||
pLed->bLedOn = false; // true if LED is ON, false if LED is OFF.
|
||||
pLed->CurrLedState = RTW_LED_OFF; /* Current LED state. */
|
||||
pLed->bLedOn = false; /* true if LED is ON, false if LED is OFF. */
|
||||
|
||||
pLed->bLedBlinkInProgress = false; // true if it is blinking, false o.w..
|
||||
pLed->bLedBlinkInProgress = false; /* true if it is blinking, false o.w.. */
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
|
||||
pLed->BlinkTimes = 0; // Number of times to toggle led state for blinking.
|
||||
pLed->BlinkingLedState = LED_UNKNOWN; // Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are.
|
||||
pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */
|
||||
pLed->BlinkingLedState = LED_UNKNOWN; /* Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are. */
|
||||
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
|
@ -87,10 +84,10 @@ void ResetLedStatus(PLED_871x pLed) {
|
|||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Initialize an LED_871x object.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Initialize an LED_871x object. */
|
||||
/* */
|
||||
void
|
||||
InitLed871x(
|
||||
_adapter *padapter,
|
||||
|
@ -111,10 +108,10 @@ InitLed871x(
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// DeInitialize an LED_871x object.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* DeInitialize an LED_871x object. */
|
||||
/* */
|
||||
void
|
||||
DeInitLed871x(
|
||||
PLED_871x pLed
|
||||
|
@ -128,11 +125,11 @@ DeInitLed871x(
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Implementation of LED blinking behavior.
|
||||
// It toggle off LED and schedule corresponding timer if necessary.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Implementation of LED blinking behavior. */
|
||||
/* It toggle off LED and schedule corresponding timer if necessary. */
|
||||
/* */
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
|
||||
void SwLedOn(_adapter *padapter, PLED_871x pLed);
|
||||
|
@ -149,7 +146,7 @@ SwLedBlink(
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
u8 bStopBlinking = false;
|
||||
|
||||
// Change LED according to BlinkingLedState specified.
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
||||
{
|
||||
SwLedOn(padapter, pLed);
|
||||
|
@ -161,7 +158,7 @@ SwLedBlink(
|
|||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,( "Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
||||
}
|
||||
|
||||
// Determine if we shall change LED state again.
|
||||
/* Determine if we shall change LED state again. */
|
||||
pLed->BlinkTimes--;
|
||||
switch (pLed->CurrLedState)
|
||||
{
|
||||
|
@ -205,7 +202,7 @@ SwLedBlink(
|
|||
|
||||
if (bStopBlinking)
|
||||
{
|
||||
//if ( padapter->pwrctrlpriv.cpwm >= PS_STATE_S2)
|
||||
/* if ( padapter->pwrctrlpriv.cpwm >= PS_STATE_S2) */
|
||||
if (0)
|
||||
{
|
||||
SwLedOff(padapter, pLed);
|
||||
|
@ -224,13 +221,13 @@ SwLedBlink(
|
|||
}
|
||||
else
|
||||
{
|
||||
// Assign LED state to toggle.
|
||||
/* Assign LED state to toggle. */
|
||||
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
|
||||
// Schedule a timer to toggle LED state.
|
||||
/* Schedule a timer to toggle LED state. */
|
||||
switch ( pLed->CurrLedState )
|
||||
{
|
||||
case LED_BLINK_NORMAL:
|
||||
|
@ -277,7 +274,7 @@ SwLedBlink1(
|
|||
pLed = &(ledpriv->SwLed1);
|
||||
#endif
|
||||
|
||||
// Change LED according to BlinkingLedState specified.
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
||||
{
|
||||
SwLedOn(padapter, pLed);
|
||||
|
@ -438,7 +435,7 @@ SwLedBlink1(
|
|||
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
||||
break;
|
||||
|
||||
case LED_BLINK_WPS_STOP: //WPS success
|
||||
case LED_BLINK_WPS_STOP: /* WPS success */
|
||||
if (pLed->BlinkingLedState == RTW_LED_ON)
|
||||
bStopBlinking = false;
|
||||
else
|
||||
|
@ -479,7 +476,7 @@ SwLedBlink2(
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
u8 bStopBlinking = false;
|
||||
|
||||
// Change LED according to BlinkingLedState specified.
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if ( pLed->BlinkingLedState == RTW_LED_ON)
|
||||
{
|
||||
SwLedOn(padapter, pLed);
|
||||
|
@ -601,7 +598,7 @@ SwLedBlink3(
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
u8 bStopBlinking = false;
|
||||
|
||||
// Change LED according to BlinkingLedState specified.
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
||||
{
|
||||
SwLedOn(padapter, pLed);
|
||||
|
@ -726,7 +723,7 @@ SwLedBlink3(
|
|||
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
||||
break;
|
||||
|
||||
case LED_BLINK_WPS_STOP: //WPS success
|
||||
case LED_BLINK_WPS_STOP: /* WPS success */
|
||||
if (pLed->BlinkingLedState == RTW_LED_ON)
|
||||
{
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
|
@ -774,7 +771,7 @@ SwLedBlink4(
|
|||
PLED_871x pLed1 = &(ledpriv->SwLed1);
|
||||
u8 bStopBlinking = false;
|
||||
|
||||
// Change LED according to BlinkingLedState specified.
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
||||
{
|
||||
SwLedOn(padapter, pLed);
|
||||
|
@ -912,7 +909,7 @@ SwLedBlink4(
|
|||
}
|
||||
break;
|
||||
|
||||
case LED_BLINK_WPS_STOP: //WPS authentication fail
|
||||
case LED_BLINK_WPS_STOP: /* WPS authentication fail */
|
||||
if ( pLed->bLedOn )
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
|
@ -921,7 +918,7 @@ SwLedBlink4(
|
|||
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
||||
break;
|
||||
|
||||
case LED_BLINK_WPS_STOP_OVERLAP: //WPS session overlap
|
||||
case LED_BLINK_WPS_STOP_OVERLAP: /* WPS session overlap */
|
||||
pLed->BlinkTimes--;
|
||||
if (pLed->BlinkTimes == 0)
|
||||
{
|
||||
|
@ -971,7 +968,7 @@ SwLedBlink5(
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
u8 bStopBlinking = false;
|
||||
|
||||
// Change LED according to BlinkingLedState specified.
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
||||
{
|
||||
SwLedOn(padapter, pLed);
|
||||
|
@ -1089,7 +1086,7 @@ SwLedBlink6(
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
u8 bStopBlinking = false;
|
||||
|
||||
// Change LED according to BlinkingLedState specified.
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
||||
{
|
||||
SwLedOn(padapter, pLed);
|
||||
|
@ -1113,7 +1110,7 @@ SwLedControlMode0(
|
|||
struct led_priv *ledpriv = &(padapter->ledpriv);
|
||||
PLED_871x pLed = &(ledpriv->SwLed1);
|
||||
|
||||
// Decide led state
|
||||
/* Decide led state */
|
||||
switch (LedAction)
|
||||
{
|
||||
case LED_CTL_TX:
|
||||
|
@ -1218,7 +1215,7 @@ SwLedControlMode0(
|
|||
|
||||
}
|
||||
|
||||
//ALPHA, added by chiyoko, 20090106
|
||||
/* ALPHA, added by chiyoko, 20090106 */
|
||||
static void
|
||||
SwLedControlMode1(
|
||||
_adapter *padapter,
|
||||
|
@ -1359,7 +1356,7 @@ SwLedControlMode1(
|
|||
}
|
||||
break;
|
||||
|
||||
case LED_CTL_START_WPS: //wait until xinpin finish
|
||||
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
||||
case LED_CTL_START_WPS_BOTTON:
|
||||
if (pLed->bLedWPSBlinkInProgress ==false)
|
||||
{
|
||||
|
@ -1493,7 +1490,7 @@ SwLedControlMode1(
|
|||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState));
|
||||
}
|
||||
|
||||
//Arcadyan/Sitecom , added by chiyoko, 20090216
|
||||
/* Arcadyan/Sitecom , added by chiyoko, 20090216 */
|
||||
static void
|
||||
SwLedControlMode2(
|
||||
_adapter *padapter,
|
||||
|
@ -1567,7 +1564,7 @@ SwLedControlMode2(
|
|||
_set_timer(&(pLed->BlinkTimer), 0);
|
||||
break;
|
||||
|
||||
case LED_CTL_START_WPS: //wait until xinpin finish
|
||||
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
||||
case LED_CTL_START_WPS_BOTTON:
|
||||
if (pLed->bLedWPSBlinkInProgress ==false)
|
||||
{
|
||||
|
@ -1658,7 +1655,7 @@ SwLedControlMode2(
|
|||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
||||
}
|
||||
|
||||
//COREGA, added by chiyoko, 20090316
|
||||
/* COREGA, added by chiyoko, 20090316 */
|
||||
static void
|
||||
SwLedControlMode3(
|
||||
_adapter *padapter,
|
||||
|
@ -1735,7 +1732,7 @@ SwLedControlMode2(
|
|||
_set_timer(&(pLed->BlinkTimer), 0);
|
||||
break;
|
||||
|
||||
case LED_CTL_START_WPS: //wait until xinpin finish
|
||||
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
||||
case LED_CTL_START_WPS_BOTTON:
|
||||
if (pLed->bLedWPSBlinkInProgress ==false)
|
||||
{
|
||||
|
@ -1837,7 +1834,7 @@ SwLedControlMode2(
|
|||
}
|
||||
|
||||
|
||||
//Edimax-Belkin, added by chiyoko, 20090413
|
||||
/* Edimax-Belkin, added by chiyoko, 20090413 */
|
||||
static void
|
||||
SwLedControlMode4(
|
||||
_adapter *padapter,
|
||||
|
@ -1898,7 +1895,7 @@ SwLedControlMode4(
|
|||
|
||||
case LED_CTL_LINK:
|
||||
case LED_CTL_NO_LINK:
|
||||
//LED1 settings
|
||||
/* LED1 settings */
|
||||
if (LedAction == LED_CTL_LINK)
|
||||
{
|
||||
if (pLed1->bLedWPSBlinkInProgress)
|
||||
|
@ -1989,7 +1986,7 @@ SwLedControlMode4(
|
|||
}
|
||||
break;
|
||||
|
||||
case LED_CTL_START_WPS: //wait until xinpin finish
|
||||
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
||||
case LED_CTL_START_WPS_BOTTON:
|
||||
if (pLed1->bLedWPSBlinkInProgress)
|
||||
{
|
||||
|
@ -2035,7 +2032,7 @@ SwLedControlMode4(
|
|||
}
|
||||
break;
|
||||
|
||||
case LED_CTL_STOP_WPS: //WPS connect success
|
||||
case LED_CTL_STOP_WPS: /* WPS connect success */
|
||||
if (pLed->bLedWPSBlinkInProgress)
|
||||
{
|
||||
_cancel_timer_ex(&(pLed->BlinkTimer));
|
||||
|
@ -2052,7 +2049,7 @@ SwLedControlMode4(
|
|||
|
||||
break;
|
||||
|
||||
case LED_CTL_STOP_WPS_FAIL: //WPS authentication fail
|
||||
case LED_CTL_STOP_WPS_FAIL: /* WPS authentication fail */
|
||||
if (pLed->bLedWPSBlinkInProgress)
|
||||
{
|
||||
_cancel_timer_ex(&(pLed->BlinkTimer));
|
||||
|
@ -2067,7 +2064,7 @@ SwLedControlMode4(
|
|||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
||||
|
||||
//LED1 settings
|
||||
/* LED1 settings */
|
||||
if (pLed1->bLedWPSBlinkInProgress)
|
||||
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
||||
else
|
||||
|
@ -2082,7 +2079,7 @@ SwLedControlMode4(
|
|||
|
||||
break;
|
||||
|
||||
case LED_CTL_STOP_WPS_FAIL_OVERLAP: //WPS session overlap
|
||||
case LED_CTL_STOP_WPS_FAIL_OVERLAP: /* WPS session overlap */
|
||||
if (pLed->bLedWPSBlinkInProgress)
|
||||
{
|
||||
_cancel_timer_ex(&(pLed->BlinkTimer));
|
||||
|
@ -2097,7 +2094,7 @@ SwLedControlMode4(
|
|||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
||||
|
||||
//LED1 settings
|
||||
/* LED1 settings */
|
||||
if (pLed1->bLedWPSBlinkInProgress)
|
||||
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
||||
else
|
||||
|
@ -2169,7 +2166,7 @@ SwLedControlMode4(
|
|||
|
||||
|
||||
|
||||
//Sercomm-Belkin, added by chiyoko, 20090415
|
||||
/* Sercomm-Belkin, added by chiyoko, 20090415 */
|
||||
static void
|
||||
SwLedControlMode5(
|
||||
_adapter *padapter,
|
||||
|
@ -2192,7 +2189,7 @@ SwLedControlMode5(
|
|||
{
|
||||
case LED_CTL_POWER_ON:
|
||||
case LED_CTL_NO_LINK:
|
||||
case LED_CTL_LINK: //solid blue
|
||||
case LED_CTL_LINK: /* solid blue */
|
||||
pLed->CurrLedState = RTW_LED_ON;
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
|
||||
|
@ -2260,7 +2257,7 @@ SwLedControlMode5(
|
|||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState));
|
||||
}
|
||||
|
||||
//WNC-Corega, added by chiyoko, 20090902
|
||||
/* WNC-Corega, added by chiyoko, 20090902 */
|
||||
static void
|
||||
SwLedControlMode6(
|
||||
_adapter *padapter,
|
||||
|
@ -2293,23 +2290,18 @@ SwLedControlMode6(
|
|||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("ledcontrol 6 Led %d\n", pLed0->CurrLedState));
|
||||
}
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Handler function of LED Blinking.
|
||||
// We dispatch acture LED blink action according to LedStrategy.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Handler function of LED Blinking. */
|
||||
/* We dispatch acture LED blink action according to LedStrategy. */
|
||||
/* */
|
||||
void BlinkHandler(PLED_871x pLed)
|
||||
{
|
||||
_adapter *padapter = pLed->padapter;
|
||||
struct led_priv *ledpriv = &(padapter->ledpriv);
|
||||
|
||||
//DBG_88E("%s (%s:%d)\n",__func__, current->comm, current->pid);
|
||||
|
||||
if ( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true))
|
||||
{
|
||||
//DBG_88E("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __func__, padapter->bSurpriseRemoved, padapter->bDriverStopped);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (ledpriv->LedStrategy)
|
||||
{
|
||||
|
@ -2342,8 +2334,6 @@ void BlinkHandler(PLED_871x pLed)
|
|||
break;
|
||||
|
||||
default:
|
||||
//RT_TRACE(COMP_LED, DBG_LOUD, ("BlinkWorkItemCallback 0x%x\n", pHalData->LedStrategy));
|
||||
//SwLedBlink(pLed);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2366,11 +2356,7 @@ LedControl871x(
|
|||
if ( ledpriv->bRegUseLed == false)
|
||||
return;
|
||||
|
||||
//if (!priv->up)
|
||||
// return;
|
||||
|
||||
//if (priv->bInHctTest)
|
||||
// return;
|
||||
|
||||
if ( (padapter->pwrctrlpriv.rf_pwrstate != rf_on &&
|
||||
padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) &&
|
||||
|
@ -2386,7 +2372,6 @@ LedControl871x(
|
|||
switch (ledpriv->LedStrategy)
|
||||
{
|
||||
case SW_LED_MODE0:
|
||||
//SwLedControlMode0(padapter, LedAction);
|
||||
break;
|
||||
|
||||
case SW_LED_MODE1:
|
||||
|
|
472
core/rtw_mlme.c
472
core/rtw_mlme.c
File diff suppressed because it is too large
Load diff
3178
core/rtw_mlme_ext.c
3178
core/rtw_mlme_ext.c
File diff suppressed because it is too large
Load diff
275
core/rtw_mp.c
275
core/rtw_mp.c
|
@ -157,69 +157,6 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv)
|
|||
_rtw_memcpy(pnetwork->Ssid.Ssid, "mp_871x", pnetwork->Ssid.SsidLength);
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
/*
|
||||
void mp_wi_callback(
|
||||
IN NDIS_WORK_ITEM* pwk_item,
|
||||
IN void * cntx
|
||||
)
|
||||
{
|
||||
_adapter* padapter =(_adapter *)cntx;
|
||||
struct mp_priv *pmppriv=&padapter->mppriv;
|
||||
struct mp_wi_cntx *pmp_wi_cntx=&pmppriv->wi_cntx;
|
||||
|
||||
// Execute specified action.
|
||||
if (pmp_wi_cntx->curractfunc != NULL)
|
||||
{
|
||||
LARGE_INTEGER cur_time;
|
||||
ULONGLONG start_time, end_time;
|
||||
NdisGetCurrentSystemTime(&cur_time); // driver version
|
||||
start_time = cur_time.QuadPart/10; // The return value is in microsecond
|
||||
|
||||
pmp_wi_cntx->curractfunc(padapter);
|
||||
|
||||
NdisGetCurrentSystemTime(&cur_time); // driver version
|
||||
end_time = cur_time.QuadPart/10; // The return value is in microsecond
|
||||
|
||||
RT_TRACE(_module_mp_, _drv_info_,
|
||||
("WorkItemActType: %d, time spent: %I64d us\n",
|
||||
pmp_wi_cntx->param.act_type, (end_time-start_time)));
|
||||
}
|
||||
|
||||
NdisAcquireSpinLock(&(pmp_wi_cntx->mp_wi_lock));
|
||||
pmp_wi_cntx->bmp_wi_progress= false;
|
||||
NdisReleaseSpinLock(&(pmp_wi_cntx->mp_wi_lock));
|
||||
|
||||
if (pmp_wi_cntx->bmpdrv_unload)
|
||||
{
|
||||
NdisSetEvent(&(pmp_wi_cntx->mp_wi_evt));
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
|
||||
{
|
||||
struct mp_wi_cntx *pmp_wi_cntx;
|
||||
|
||||
if (pmp_priv == NULL) return _FAIL;
|
||||
|
||||
pmp_priv->rx_testcnt = 0;
|
||||
pmp_priv->rx_testcnt1 = 0;
|
||||
pmp_priv->rx_testcnt2 = 0;
|
||||
|
||||
pmp_priv->tx_testcnt = 0;
|
||||
pmp_priv->tx_testcnt1 = 0;
|
||||
|
||||
pmp_wi_cntx = &pmp_priv->wi_cntx
|
||||
pmp_wi_cntx->bmpdrv_unload = false;
|
||||
pmp_wi_cntx->bmp_wi_progress = false;
|
||||
pmp_wi_cntx->curractfunc = NULL;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
|
||||
{
|
||||
|
@ -268,26 +205,26 @@ static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter)
|
|||
struct pkt_attrib *pattrib;
|
||||
struct tx_desc *desc;
|
||||
|
||||
// init xmitframe attribute
|
||||
/* init xmitframe attribute */
|
||||
pattrib = &pmptx->attrib;
|
||||
_rtw_memset(pattrib, 0, sizeof(struct pkt_attrib));
|
||||
desc = &pmptx->desc;
|
||||
_rtw_memset(desc, 0, TXDESC_SIZE);
|
||||
|
||||
pattrib->ether_type = 0x8712;
|
||||
//_rtw_memcpy(pattrib->src, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||||
// _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
|
||||
/* _rtw_memcpy(pattrib->src, padapter->eeprompriv.mac_addr, ETH_ALEN); */
|
||||
/* _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); */
|
||||
_rtw_memset(pattrib->dst, 0xFF, ETH_ALEN);
|
||||
// pattrib->pctrl = 0;
|
||||
// pattrib->dhcp_pkt = 0;
|
||||
// pattrib->pktlen = 0;
|
||||
/* pattrib->pctrl = 0; */
|
||||
/* pattrib->dhcp_pkt = 0; */
|
||||
/* pattrib->pktlen = 0; */
|
||||
pattrib->ack_policy = 0;
|
||||
// pattrib->pkt_hdrlen = ETH_HLEN;
|
||||
/* pattrib->pkt_hdrlen = ETH_HLEN; */
|
||||
pattrib->hdrlen = WLAN_HDR_A3_LEN;
|
||||
pattrib->subtype = WIFI_DATA;
|
||||
pattrib->priority = 0;
|
||||
pattrib->qsel = pattrib->priority;
|
||||
// do_queue_select(padapter, pattrib);
|
||||
/* do_queue_select(padapter, pattrib); */
|
||||
pattrib->nr_frags = 1;
|
||||
pattrib->encrypt = 0;
|
||||
pattrib->bswenc = false;
|
||||
|
@ -340,14 +277,14 @@ void free_mp_priv(struct mp_priv *pmp_priv)
|
|||
#if defined (CONFIG_RTL8192C) || defined (CONFIG_RTL8723A)
|
||||
#define PHY_IQCalibrate(a,b) rtl8192c_PHY_IQCalibrate(a,b)
|
||||
#define PHY_LCCalibrate(a) rtl8192c_PHY_LCCalibrate(a)
|
||||
//#define dm_CheckTXPowerTracking(a) rtl8192c_odm_CheckTXPowerTracking(a)
|
||||
/* define dm_CheckTXPowerTracking(a) rtl8192c_odm_CheckTXPowerTracking(a) */
|
||||
#define PHY_SetRFPathSwitch(a,b) rtl8192c_PHY_SetRFPathSwitch(a,b)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8192D
|
||||
#define PHY_IQCalibrate(a,b) rtl8192d_PHY_IQCalibrate(a)
|
||||
#define PHY_LCCalibrate(a) rtl8192d_PHY_LCCalibrate(a)
|
||||
//#define dm_CheckTXPowerTracking(a) rtl8192d_odm_CheckTXPowerTracking(a)
|
||||
/* define dm_CheckTXPowerTracking(a) rtl8192d_odm_CheckTXPowerTracking(a) */
|
||||
#define PHY_SetRFPathSwitch(a,b) rtl8192d_PHY_SetRFPathSwitch(a,b)
|
||||
#endif
|
||||
|
||||
|
@ -368,18 +305,18 @@ MPT_InitializeAdapter(
|
|||
PMPT_CONTEXT pMptCtx = &pAdapter->mppriv.MptCtx;
|
||||
struct mlme_priv *pmlmepriv = &pAdapter->mlmepriv;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// HW Initialization for 8190 MPT.
|
||||
//-------------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------------
|
||||
// SW Initialization for 8190 MP.
|
||||
//-------------------------------------------------------------------------
|
||||
/* */
|
||||
/* HW Initialization for 8190 MPT. */
|
||||
/* */
|
||||
/* */
|
||||
/* SW Initialization for 8190 MP. */
|
||||
/* */
|
||||
pMptCtx->bMptDrvUnload = false;
|
||||
pMptCtx->bMassProdTest = false;
|
||||
pMptCtx->bMptIndexEven = true; //default gain index is -6.0db
|
||||
pMptCtx->bMptIndexEven = true; /* default gain index is -6.0db */
|
||||
pMptCtx->h2cReqNum = 0x0;
|
||||
/* Init mpt event. */
|
||||
//init for BT MP
|
||||
/* init for BT MP */
|
||||
#ifdef CONFIG_RTL8723A
|
||||
pMptCtx->bMPh2c_timeout = false;
|
||||
pMptCtx->MptH2cRspEvent = false;
|
||||
|
@ -391,13 +328,13 @@ MPT_InitializeAdapter(
|
|||
|
||||
pMptCtx->bMptWorkItemInProgress = false;
|
||||
pMptCtx->CurrMptAct = NULL;
|
||||
//-------------------------------------------------------------------------
|
||||
/* */
|
||||
|
||||
// Don't accept any packets
|
||||
/* Don't accept any packets */
|
||||
rtw_write32(pAdapter, REG_RCR, 0);
|
||||
|
||||
PHY_IQCalibrate(pAdapter, false);
|
||||
dm_CheckTXPowerTracking(&pHalData->odmpriv); //trigger thermal meter
|
||||
dm_CheckTXPowerTracking(&pHalData->odmpriv); /* trigger thermal meter */
|
||||
PHY_LCCalibrate(pAdapter);
|
||||
|
||||
pMptCtx->backup0xc50 = (u1Byte)PHY_QueryBBReg(pAdapter, rOFDM0_XAAGCCore1, bMaskByte0);
|
||||
|
@ -406,7 +343,7 @@ MPT_InitializeAdapter(
|
|||
pMptCtx->backup0x52_RF_A = (u1Byte)PHY_QueryRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0);
|
||||
pMptCtx->backup0x52_RF_B = (u1Byte)PHY_QueryRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0);
|
||||
|
||||
//set ant to wifi side in mp mode
|
||||
/* set ant to wifi side in mp mode */
|
||||
rtw_write16(pAdapter, 0x870, 0x300);
|
||||
rtw_write16(pAdapter, 0x860, 0x110);
|
||||
|
||||
|
@ -486,8 +423,8 @@ static void disable_dm(PADAPTER padapter)
|
|||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
|
||||
|
||||
//3 1. disable firmware dynamic mechanism
|
||||
// disable Power Training, Rate Adaptive
|
||||
/* 3 1. disable firmware dynamic mechanism */
|
||||
/* disable Power Training, Rate Adaptive */
|
||||
#ifdef CONFIG_RTL8723A
|
||||
SetBcnCtrlReg(padapter, 0, EN_BCN_FUNCTION);
|
||||
#else
|
||||
|
@ -496,20 +433,20 @@ static void disable_dm(PADAPTER padapter)
|
|||
rtw_write8(padapter, REG_BCN_CTRL, v8);
|
||||
#endif
|
||||
|
||||
//3 2. disable driver dynamic mechanism
|
||||
// disable Dynamic Initial Gain
|
||||
// disable High Power
|
||||
// disable Power Tracking
|
||||
/* 3 2. disable driver dynamic mechanism */
|
||||
/* disable Dynamic Initial Gain */
|
||||
/* disable High Power */
|
||||
/* disable Power Tracking */
|
||||
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false);
|
||||
|
||||
// enable APK, LCK and IQK but disable power tracking
|
||||
/* enable APK, LCK and IQK but disable power tracking */
|
||||
#ifndef CONFIG_RTL8188E
|
||||
pdmpriv->TxPowerTrackControl = false;
|
||||
#endif
|
||||
Switch_DM_Func(padapter, DYNAMIC_RF_CALIBRATION, true);
|
||||
}
|
||||
|
||||
//This function initializes the DUT to the MP test mode
|
||||
/* This function initializes the DUT to the MP test mode */
|
||||
s32 mp_start_test(PADAPTER padapter)
|
||||
{
|
||||
WLAN_BSSID_EX bssid;
|
||||
|
@ -525,15 +462,15 @@ s32 mp_start_test(PADAPTER padapter)
|
|||
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
|
||||
|
||||
padapter->registrypriv.mp_mode = 1;
|
||||
pmppriv->bSetTxPower=0; //for manually set tx power
|
||||
pmppriv->bSetTxPower=0; /* for manually set tx power */
|
||||
|
||||
//3 disable dynamic mechanism
|
||||
/* 3 disable dynamic mechanism */
|
||||
disable_dm(padapter);
|
||||
|
||||
//3 0. update mp_priv
|
||||
/* 3 0. update mp_priv */
|
||||
|
||||
if (padapter->registrypriv.rf_config == RF_819X_MAX_TYPE) {
|
||||
// switch (phal->rf_type) {
|
||||
/* switch (phal->rf_type) { */
|
||||
switch (GET_RF_TYPE(padapter)) {
|
||||
case RF_1T1R:
|
||||
pmppriv->antenna_tx = ANTENNA_A;
|
||||
|
@ -558,8 +495,8 @@ s32 mp_start_test(PADAPTER padapter)
|
|||
|
||||
mpt_ProStartTest(padapter);
|
||||
|
||||
//3 1. initialize a new WLAN_BSSID_EX
|
||||
// _rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX));
|
||||
/* 3 1. initialize a new WLAN_BSSID_EX */
|
||||
/* _rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX)); */
|
||||
_rtw_memcpy(bssid.MacAddress, pmppriv->network_macaddr, ETH_ALEN);
|
||||
bssid.Ssid.SsidLength = strlen("mp_pseudo_adhoc");
|
||||
_rtw_memcpy(bssid.Ssid.Ssid, (u8*)"mp_pseudo_adhoc", bssid.Ssid.SsidLength);
|
||||
|
@ -569,7 +506,7 @@ s32 mp_start_test(PADAPTER padapter)
|
|||
|
||||
length = get_WLAN_BSSID_EX_sz(&bssid);
|
||||
if (length % 4)
|
||||
bssid.Length = ((length >> 2) + 1) << 2; //round up to multiple of 4 bytes.
|
||||
bssid.Length = ((length >> 2) + 1) << 2; /* round up to multiple of 4 bytes. */
|
||||
else
|
||||
bssid.Length = length;
|
||||
|
||||
|
@ -578,7 +515,7 @@ s32 mp_start_test(PADAPTER padapter)
|
|||
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)
|
||||
goto end_of_mp_start_test;
|
||||
|
||||
//init mp_start_test status
|
||||
/* init mp_start_test status */
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
|
||||
rtw_disassoc_cmd(padapter, 500, true);
|
||||
rtw_indicate_disconnect(padapter);
|
||||
|
@ -589,8 +526,8 @@ s32 mp_start_test(PADAPTER padapter)
|
|||
pmlmepriv->fw_state = WIFI_MP_STATE;
|
||||
set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
||||
//3 2. create a new psta for mp driver
|
||||
//clear psta in the cur_network, if any
|
||||
/* 3 2. create a new psta for mp driver */
|
||||
/* clear psta in the cur_network, if any */
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, tgt_network->network.MacAddress);
|
||||
if (psta) rtw_free_stainfo(padapter, psta);
|
||||
|
||||
|
@ -602,7 +539,7 @@ s32 mp_start_test(PADAPTER padapter)
|
|||
goto end_of_mp_start_test;
|
||||
}
|
||||
|
||||
//3 3. join psudo AdHoc
|
||||
/* 3 3. join psudo AdHoc */
|
||||
tgt_network->join_res = 1;
|
||||
tgt_network->aid = psta->aid = 1;
|
||||
_rtw_memcpy(&tgt_network->network, &bssid, length);
|
||||
|
@ -616,31 +553,31 @@ end_of_mp_start_test:
|
|||
|
||||
if (res == _SUCCESS)
|
||||
{
|
||||
// set MSR to WIFI_FW_ADHOC_STATE
|
||||
/* set MSR to WIFI_FW_ADHOC_STATE */
|
||||
#if !defined (CONFIG_RTL8712)
|
||||
val8 = rtw_read8(padapter, MSR) & 0xFC; // 0x0102
|
||||
val8 = rtw_read8(padapter, MSR) & 0xFC; /* 0x0102 */
|
||||
val8 |= WIFI_FW_ADHOC_STATE;
|
||||
rtw_write8(padapter, MSR, val8); // Link in ad hoc network
|
||||
rtw_write8(padapter, MSR, val8); /* Link in ad hoc network */
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_RTL8712)
|
||||
rtw_write8(padapter, MSR, 1); // Link in ad hoc network
|
||||
rtw_write8(padapter, RCR, 0); // RCR : disable all pkt, 0x10250048
|
||||
rtw_write8(padapter, RCR+2, 0x57); // RCR disable Check BSSID, 0x1025004a
|
||||
rtw_write8(padapter, MSR, 1); /* Link in ad hoc network */
|
||||
rtw_write8(padapter, RCR, 0); /* RCR : disable all pkt, 0x10250048 */
|
||||
rtw_write8(padapter, RCR+2, 0x57); /* RCR disable Check BSSID, 0x1025004a */
|
||||
|
||||
// disable RX filter map , mgt frames will put in RX FIFO 0
|
||||
rtw_write16(padapter, RXFLTMAP0, 0x0); // 0x10250116
|
||||
/* disable RX filter map , mgt frames will put in RX FIFO 0 */
|
||||
rtw_write16(padapter, RXFLTMAP0, 0x0); /* 0x10250116 */
|
||||
|
||||
val8 = rtw_read8(padapter, EE_9346CR); // 0x1025000A
|
||||
if (!(val8 & _9356SEL))//boot from EFUSE
|
||||
val8 = rtw_read8(padapter, EE_9346CR); /* 0x1025000A */
|
||||
if (!(val8 & _9356SEL))/* boot from EFUSE */
|
||||
efuse_change_max_size(padapter);
|
||||
#endif
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
//This function change the DUT from the MP test mode into normal mode
|
||||
/* */
|
||||
/* This function change the DUT from the MP test mode into normal mode */
|
||||
void mp_stop_test(PADAPTER padapter)
|
||||
{
|
||||
struct mp_priv *pmppriv = &padapter->mppriv;
|
||||
|
@ -657,18 +594,18 @@ void mp_stop_test(PADAPTER padapter)
|
|||
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)
|
||||
goto end_of_mp_stop_test;
|
||||
|
||||
//3 1. disconnect psudo AdHoc
|
||||
/* 3 1. disconnect psudo AdHoc */
|
||||
rtw_indicate_disconnect(padapter);
|
||||
|
||||
//3 2. clear psta used in mp test mode.
|
||||
// rtw_free_assoc_resources(padapter, 1);
|
||||
/* 3 2. clear psta used in mp test mode. */
|
||||
/* rtw_free_assoc_resources(padapter, 1); */
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, tgt_network->network.MacAddress);
|
||||
if (psta) rtw_free_stainfo(padapter, psta);
|
||||
|
||||
//3 3. return to normal state (default:station mode)
|
||||
pmlmepriv->fw_state = pmppriv->prev_fw_state; // WIFI_STATION_STATE;
|
||||
/* 3 3. return to normal state (default:station mode) */
|
||||
pmlmepriv->fw_state = pmppriv->prev_fw_state; /* WIFI_STATION_STATE; */
|
||||
|
||||
//flush the cur_network
|
||||
/* flush the cur_network */
|
||||
_rtw_memset(tgt_network, 0, sizeof(struct wlan_network));
|
||||
|
||||
_clr_fwstate_(pmlmepriv, WIFI_MP_STATE);
|
||||
|
@ -870,7 +807,7 @@ void PhySetTxPowerLevel(PADAPTER pAdapter)
|
|||
{
|
||||
struct mp_priv *pmp_priv = &pAdapter->mppriv;
|
||||
|
||||
if (pmp_priv->bSetTxPower==0) // for NO manually set power index
|
||||
if (pmp_priv->bSetTxPower==0) /* for NO manually set power index */
|
||||
{
|
||||
#ifdef CONFIG_RTL8188E
|
||||
PHY_SetTxPowerLevel8188E(pAdapter,pmp_priv->channel);
|
||||
|
@ -882,7 +819,7 @@ void PhySetTxPowerLevel(PADAPTER pAdapter)
|
|||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
static void dump_mpframe(PADAPTER padapter, struct xmit_frame *pmpframe)
|
||||
{
|
||||
rtw_hal_mgnt_xmit(padapter, pmpframe);
|
||||
|
@ -931,7 +868,7 @@ static thread_return mp_xmit_packet_thread(thread_context context)
|
|||
|
||||
thread_enter("RTW_MP_THREAD");
|
||||
|
||||
//DBG_88E("%s:pkTx Start\n", __func__);
|
||||
/* DBG_88E("%s:pkTx Start\n", __func__); */
|
||||
while (1) {
|
||||
pxmitframe = alloc_mp_xmitframe(pxmitpriv);
|
||||
if (pxmitframe == NULL) {
|
||||
|
@ -966,7 +903,7 @@ static thread_return mp_xmit_packet_thread(thread_context context)
|
|||
}
|
||||
|
||||
exit:
|
||||
//DBG_88E("%s:pkTx Exit\n", __func__);
|
||||
/* DBG_88E("%s:pkTx Exit\n", __func__); */
|
||||
rtw_mfree(pmptx->pallocated_buf, pmptx->buf_size);
|
||||
pmptx->pallocated_buf = NULL;
|
||||
pmptx->stop = 1;
|
||||
|
@ -998,7 +935,7 @@ void SetPacketTx(PADAPTER padapter)
|
|||
pmp_priv->tx.stop = 0;
|
||||
pmp_priv->tx_pktcount = 0;
|
||||
|
||||
//3 1. update_attrib()
|
||||
/* 3 1. update_attrib() */
|
||||
pattrib = &pmp_priv->tx.attrib;
|
||||
_rtw_memcpy(pattrib->src, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||||
_rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
|
||||
|
@ -1014,7 +951,7 @@ void SetPacketTx(PADAPTER padapter)
|
|||
|
||||
pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->pktlen;
|
||||
|
||||
//3 2. allocate xmit buffer
|
||||
/* 3 2. allocate xmit buffer */
|
||||
pkt_size = pattrib->last_txcmdsz;
|
||||
|
||||
if (pmp_priv->tx.pallocated_buf)
|
||||
|
@ -1034,41 +971,37 @@ void SetPacketTx(PADAPTER padapter)
|
|||
pkt_start = ptr;
|
||||
pkt_end = pkt_start + pkt_size;
|
||||
|
||||
//3 3. init TX descriptor
|
||||
// offset 0
|
||||
/* 3 3. init TX descriptor */
|
||||
/* offset 0 */
|
||||
#if defined(CONFIG_RTL8188E) && !defined(CONFIG_RTL8188E_SDIO)
|
||||
desc->txdw0 |= cpu_to_le32(OWN | FSG | LSG);
|
||||
desc->txdw0 |= cpu_to_le32(pkt_size & 0x0000FFFF); // packet size
|
||||
desc->txdw0 |= cpu_to_le32(((TXDESC_SIZE + OFFSET_SZ) << OFFSET_SHT) & 0x00FF0000); //32 bytes for TX Desc
|
||||
if (bmcast) desc->txdw0 |= cpu_to_le32(BMC); // broadcast packet
|
||||
desc->txdw0 |= cpu_to_le32(pkt_size & 0x0000FFFF); /* packet size */
|
||||
desc->txdw0 |= cpu_to_le32(((TXDESC_SIZE + OFFSET_SZ) << OFFSET_SHT) & 0x00FF0000); /* 32 bytes for TX Desc */
|
||||
if (bmcast) desc->txdw0 |= cpu_to_le32(BMC); /* broadcast packet */
|
||||
|
||||
desc->txdw1 |= cpu_to_le32((0x01 << 26) & 0xff000000);
|
||||
#endif
|
||||
// offset 4
|
||||
/* offset 4 */
|
||||
#ifndef CONFIG_RTL8188E
|
||||
desc->txdw1 |= cpu_to_le32(BK); // don't aggregate(AMPDU)
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x1F); //CAM_ID(MAC_ID)
|
||||
desc->txdw1 |= cpu_to_le32(BK); /* don't aggregate(AMPDU) */
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x1F); /* CAM_ID(MAC_ID) */
|
||||
#else
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x3F); //CAM_ID(MAC_ID)
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x3F); /* CAM_ID(MAC_ID) */
|
||||
#endif
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->qsel << QSEL_SHT) & 0x00001F00); // Queue Select, TID
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->qsel << QSEL_SHT) & 0x00001F00); /* Queue Select, TID */
|
||||
|
||||
#ifdef CONFIG_RTL8188E
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->raid << RATE_ID_SHT) & 0x000F0000); // Rate Adaptive ID
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->raid << RATE_ID_SHT) & 0x000F0000); /* Rate Adaptive ID */
|
||||
#else
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->raid << Rate_ID_SHT) & 0x000F0000); // Rate Adaptive ID
|
||||
desc->txdw1 |= cpu_to_le32((pattrib->raid << Rate_ID_SHT) & 0x000F0000); /* Rate Adaptive ID */
|
||||
|
||||
#endif
|
||||
// offset 8
|
||||
// desc->txdw2 |= cpu_to_le32(AGG_BK);//AGG BK
|
||||
// offset 12
|
||||
/* offset 8 */
|
||||
/* offset 12 */
|
||||
|
||||
desc->txdw3 |= cpu_to_le32((pattrib->seqnum<<16)&0x0fff0000);
|
||||
// desc->txdw3 |= cpu_to_le32((pattrib->seqnum & 0xFFF) << SEQ_SHT);
|
||||
//desc->txdw3 |= cpu_to_le32((pattrib->seqnum << SEQ_SHT) & 0xffff0000);
|
||||
|
||||
// offset 16
|
||||
//desc->txdw4 |= cpu_to_le32(QoS)
|
||||
/* offset 16 */
|
||||
#ifdef CONFIG_RTL8188E
|
||||
desc->txdw4 |= cpu_to_le32(HW_SSN);
|
||||
#else
|
||||
|
@ -1079,33 +1012,33 @@ void SetPacketTx(PADAPTER padapter)
|
|||
|
||||
if ( pmp_priv->preamble ){
|
||||
if (pmp_priv->rateidx <= MPT_RATE_54M)
|
||||
desc->txdw4 |= cpu_to_le32(DATA_SHORT); // CCK Short Preamble
|
||||
desc->txdw4 |= cpu_to_le32(DATA_SHORT); /* CCK Short Preamble */
|
||||
}
|
||||
if (pmp_priv->bandwidth == HT_CHANNEL_WIDTH_40)
|
||||
desc->txdw4 |= cpu_to_le32(DATA_BW);
|
||||
|
||||
// offset 20
|
||||
/* offset 20 */
|
||||
desc->txdw5 |= cpu_to_le32(pmp_priv->rateidx & 0x0000001F);
|
||||
|
||||
if ( pmp_priv->preamble ){
|
||||
if (pmp_priv->rateidx > MPT_RATE_54M)
|
||||
desc->txdw5 |= cpu_to_le32(SGI); // MCS Short Guard Interval
|
||||
desc->txdw5 |= cpu_to_le32(SGI); /* MCS Short Guard Interval */
|
||||
}
|
||||
#ifdef CONFIG_RTL8188E
|
||||
desc->txdw5 |= cpu_to_le32(RTY_LMT_EN); // retry limit enable
|
||||
desc->txdw5 |= cpu_to_le32(0x00180000); // DATA/RTS Rate Fallback Limit
|
||||
desc->txdw5 |= cpu_to_le32(RTY_LMT_EN); /* retry limit enable */
|
||||
desc->txdw5 |= cpu_to_le32(0x00180000); /* DATA/RTS Rate Fallback Limit */
|
||||
#else
|
||||
desc->txdw5 |= cpu_to_le32(0x0001FF00); // DATA/RTS Rate Fallback Limit
|
||||
desc->txdw5 |= cpu_to_le32(0x0001FF00); /* DATA/RTS Rate Fallback Limit */
|
||||
#endif
|
||||
|
||||
//3 4. make wlan header, make_wlanhdr()
|
||||
/* 3 4. make wlan header, make_wlanhdr() */
|
||||
hdr = (struct rtw_ieee80211_hdr *)pkt_start;
|
||||
SetFrameSubType(&hdr->frame_ctl, pattrib->subtype);
|
||||
_rtw_memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); // DA
|
||||
_rtw_memcpy(hdr->addr2, pattrib->src, ETH_ALEN); // SA
|
||||
_rtw_memcpy(hdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); // RA, BSSID
|
||||
_rtw_memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); /* DA */
|
||||
_rtw_memcpy(hdr->addr2, pattrib->src, ETH_ALEN); /* SA */
|
||||
_rtw_memcpy(hdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); /* RA, BSSID */
|
||||
|
||||
//3 5. make payload
|
||||
/* 3 5. make payload */
|
||||
ptr = pkt_start + pattrib->hdrlen;
|
||||
|
||||
switch (pmp_priv->tx.payload) {
|
||||
|
@ -1128,7 +1061,7 @@ void SetPacketTx(PADAPTER padapter)
|
|||
|
||||
_rtw_memset(ptr, payload, pkt_end - ptr);
|
||||
|
||||
//3 6. start thread
|
||||
/* 3 6. start thread */
|
||||
#ifdef PLATFORM_LINUX
|
||||
pmp_priv->tx.PktTxThread = kthread_run(mp_xmit_packet_thread, pmp_priv, "RTW_MP_THREAD");
|
||||
if (IS_ERR(pmp_priv->tx.PktTxThread))
|
||||
|
@ -1153,16 +1086,16 @@ void SetPacketRx(PADAPTER pAdapter, u8 bStartRx)
|
|||
|
||||
if (bStartRx)
|
||||
{
|
||||
// Accept CRC error and destination address
|
||||
/* Accept CRC error and destination address */
|
||||
#if 1
|
||||
//ndef CONFIG_RTL8723A
|
||||
/* ndef CONFIG_RTL8723A */
|
||||
pHalData->ReceiveConfig = AAP | APM | AM | AB | APP_ICV | ADF | AMF | HTC_LOC_CTRL | APP_MIC | APP_PHYSTS;
|
||||
|
||||
pHalData->ReceiveConfig |= ACRC32;
|
||||
|
||||
rtw_write32(pAdapter, REG_RCR, pHalData->ReceiveConfig);
|
||||
|
||||
// Accept all data frames
|
||||
/* Accept all data frames */
|
||||
rtw_write16(pAdapter, REG_RXFLTMAP2, 0xFFFF);
|
||||
#else
|
||||
rtw_write32(pAdapter, REG_RCR, 0x70000101);
|
||||
|
@ -1180,21 +1113,21 @@ void ResetPhyRxPktCount(PADAPTER pAdapter)
|
|||
|
||||
for (i = 0; i <= 0xF; i++) {
|
||||
phyrx_set = 0;
|
||||
phyrx_set |= _RXERR_RPT_SEL(i); //select
|
||||
phyrx_set |= RXERR_RPT_RST; // set counter to zero
|
||||
phyrx_set |= _RXERR_RPT_SEL(i); /* select */
|
||||
phyrx_set |= RXERR_RPT_RST; /* set counter to zero */
|
||||
rtw_write32(pAdapter, REG_RXERR_RPT, phyrx_set);
|
||||
}
|
||||
}
|
||||
|
||||
static u32 GetPhyRxPktCounts(PADAPTER pAdapter, u32 selbit)
|
||||
{
|
||||
//selection
|
||||
/* selection */
|
||||
u32 phyrx_set = 0, count = 0;
|
||||
|
||||
phyrx_set = _RXERR_RPT_SEL(selbit & 0xF);
|
||||
rtw_write32(pAdapter, REG_RXERR_RPT, phyrx_set);
|
||||
|
||||
//Read packet count
|
||||
/* Read packet count */
|
||||
count = rtw_read32(pAdapter, REG_RXERR_RPT) & RXERR_COUNTER_MASK;
|
||||
|
||||
return count;
|
||||
|
@ -1222,9 +1155,9 @@ u32 GetPhyRxPktCRC32Error(PADAPTER pAdapter)
|
|||
return OFDM_cnt + CCK_cnt + HT_cnt;
|
||||
}
|
||||
|
||||
//reg 0x808[9:0]: FFT data x
|
||||
//reg 0x808[22]: 0 --> 1 to get 1 FFT data y
|
||||
//reg 0x8B4[15:0]: FFT data y report
|
||||
/* reg 0x808[9:0]: FFT data x */
|
||||
/* reg 0x808[22]: 0 --> 1 to get 1 FFT data y */
|
||||
/* reg 0x8B4[15:0]: FFT data y report */
|
||||
static u32 rtw_GetPSDData(PADAPTER pAdapter, u32 point)
|
||||
{
|
||||
int psd_val;
|
||||
|
@ -1273,7 +1206,7 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (strlen(data) == 0) { //default value
|
||||
if (strlen(data) == 0) { /* default value */
|
||||
psd_pts = 128;
|
||||
psd_start = 64;
|
||||
psd_stop = 128;
|
||||
|
@ -1349,7 +1282,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
num_xmit_extbuf = NR_XMIT_EXTBUFF;
|
||||
}
|
||||
|
||||
// Init xmit extension buff
|
||||
/* Init xmit extension buff */
|
||||
_rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue);
|
||||
|
||||
pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
#include <drv_types.h>
|
||||
#include <mlme_osdep.h>
|
||||
|
||||
//#include <rtw_mp.h>
|
||||
/* include <rtw_mp.h> */
|
||||
#include <rtw_mp_ioctl.h>
|
||||
|
||||
|
||||
//**************** oid_rtl_seg_81_85 section start ****************
|
||||
/* oid_rtl_seg_81_85 section start **************** */
|
||||
NDIS_STATUS oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
@ -53,7 +53,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//**************** oid_rtl_seg_81_87_80 section start ****************
|
||||
/* oid_rtl_seg_81_87_80 section start **************** */
|
||||
NDIS_STATUS oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -77,7 +77,7 @@ _func_enter_;
|
|||
|
||||
pbbreg = (struct bb_reg_param *)(poid_par_priv->information_buf);
|
||||
|
||||
offset = (u16)(pbbreg->offset) & 0xFFF; //0ffset :0x800~0xfff
|
||||
offset = (u16)(pbbreg->offset) & 0xFFF; /* 0ffset :0x800~0xfff */
|
||||
if (offset < BB_REG_BASE_ADDR) offset |= BB_REG_BASE_ADDR;
|
||||
|
||||
value = pbbreg->value;
|
||||
|
@ -94,7 +94,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -118,7 +118,7 @@ _func_enter_;
|
|||
|
||||
pbbreg = (struct bb_reg_param *)(poid_par_priv->information_buf);
|
||||
|
||||
offset = (u16)(pbbreg->offset) & 0xFFF; //0ffset :0x800~0xfff
|
||||
offset = (u16)(pbbreg->offset) & 0xFFF; /* 0ffset :0x800~0xfff */
|
||||
if (offset < BB_REG_BASE_ADDR) offset |= BB_REG_BASE_ADDR;
|
||||
|
||||
_irqlevel_changed_(&oldirql, LOWER);
|
||||
|
@ -135,7 +135,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -183,7 +183,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -232,17 +232,17 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//**************** oid_rtl_seg_81_87_00 section end****************
|
||||
//------------------------------------------------------------------------------
|
||||
/* oid_rtl_seg_81_87_00 section end**************** */
|
||||
/* */
|
||||
|
||||
//**************** oid_rtl_seg_81_80_00 section start ****************
|
||||
//------------------------------------------------------------------------------
|
||||
/* oid_rtl_seg_81_80_00 section start **************** */
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_set_data_rate_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
_irqL oldirql;
|
||||
#endif
|
||||
u32 ratevalue;//4
|
||||
u32 ratevalue;/* 4 */
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
|
@ -257,7 +257,7 @@ _func_enter_;
|
|||
if (poid_par_priv->information_buf_len != sizeof(u32))
|
||||
return NDIS_STATUS_INVALID_LENGTH;
|
||||
|
||||
ratevalue = *((u32*)poid_par_priv->information_buf);//4
|
||||
ratevalue = *((u32*)poid_par_priv->information_buf);/* 4 */
|
||||
RT_TRACE(_module_mp_, _drv_notice_,
|
||||
("oid_rt_pro_set_data_rate_hdl: data rate idx=%d\n", ratevalue));
|
||||
if (ratevalue >= MPT_RATE_LAST)
|
||||
|
@ -273,7 +273,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -295,10 +295,10 @@ _func_enter_;
|
|||
|
||||
_irqlevel_changed_(&oldirql, LOWER);
|
||||
|
||||
//IQCalibrateBcut(Adapter);
|
||||
/* IQCalibrateBcut(Adapter); */
|
||||
|
||||
mode = *((u32*)poid_par_priv->information_buf);
|
||||
Adapter->mppriv.mode = mode;// 1 for loopback
|
||||
Adapter->mppriv.mode = mode;/* 1 for loopback */
|
||||
|
||||
if (mp_start_test(Adapter) == _FAIL) {
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
|
@ -314,7 +314,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -340,7 +340,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -379,7 +379,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -401,7 +401,7 @@ _func_enter_;
|
|||
if (poid_par_priv->information_buf_len < sizeof(u32))
|
||||
return NDIS_STATUS_INVALID_LENGTH;
|
||||
|
||||
bandwidth = *((u32*)poid_par_priv->information_buf);//4
|
||||
bandwidth = *((u32*)poid_par_priv->information_buf);/* 4 */
|
||||
channel_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
|
||||
if (bandwidth != HT_CHANNEL_WIDTH_40)
|
||||
|
@ -421,7 +421,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -499,9 +499,9 @@ _func_exit_;
|
|||
return status;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//**************** oid_rtl_seg_81_80_20 section start ****************
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
/* oid_rtl_seg_81_80_20 section start **************** */
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
@ -525,7 +525,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
@ -550,7 +550,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
@ -575,7 +575,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
|
||||
NDIS_STATUS oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
|
@ -596,7 +596,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
@ -621,7 +621,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -645,7 +645,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -676,7 +676,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -708,7 +708,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//**************** oid_rtl_seg_81_80_20 section end ****************
|
||||
/* oid_rtl_seg_81_80_20 section end **************** */
|
||||
NDIS_STATUS oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -876,13 +876,13 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//**************** oid_rtl_seg_81_80_00 section end ****************
|
||||
//------------------------------------------------------------------------------
|
||||
/* oid_rtl_seg_81_80_00 section end **************** */
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro8711_join_bss_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -934,7 +934,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -997,69 +997,69 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_burst_read_register_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_write16_eeprom_hdl (struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_wr_attrib_mem_hdl (struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_poll_rx_status_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_cfg_debug_message_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
@ -1087,7 +1087,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -1118,12 +1118,12 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -1156,54 +1156,54 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//**************** oid_rtl_seg_87_12_00 section start ****************
|
||||
/* oid_rtl_seg_87_12_00 section start **************** */
|
||||
NDIS_STATUS oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return NDIS_STATUS_SUCCESS;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -1251,7 +1251,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -1294,7 +1294,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -1306,7 +1306,7 @@ NDIS_STATUS oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
// RT_TRACE(_module_mp_, _drv_info_, ("+oid_rt_pro_rw_efuse_pgpkt_hdl\n"));
|
||||
/* RT_TRACE(_module_mp_, _drv_info_, ("+oid_rt_pro_rw_efuse_pgpkt_hdl\n")); */
|
||||
|
||||
*poid_par_priv->bytes_rw = 0;
|
||||
|
||||
|
@ -1351,7 +1351,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_get_efuse_current_size_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -1383,7 +1383,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
@ -1408,7 +1408,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status;
|
||||
|
@ -1428,7 +1428,7 @@ _func_exit_;
|
|||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
@ -1467,7 +1467,7 @@ _func_enter_;
|
|||
status = NDIS_STATUS_FAILURE;
|
||||
}
|
||||
} else {
|
||||
// SET_OID
|
||||
/* SET_OID */
|
||||
RT_TRACE(_module_mp_, _drv_info_,
|
||||
("oid_rt_pro_efuse_map_hdl: WRITE\n"));
|
||||
|
||||
|
@ -1514,7 +1514,7 @@ _func_enter_;
|
|||
if (poid_par_priv->information_buf_len < sizeof(u8))
|
||||
return NDIS_STATUS_INVALID_LENGTH;
|
||||
|
||||
rx_pkt_type = *((u8*)poid_par_priv->information_buf);//4
|
||||
rx_pkt_type = *((u8*)poid_par_priv->information_buf);/* 4 */
|
||||
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("rx_pkt_type: %x\n",rx_pkt_type ));
|
||||
_func_exit_;
|
||||
|
@ -1566,7 +1566,7 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv)
|
|||
return NDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
|
@ -1583,14 +1583,14 @@ _func_enter_;
|
|||
|
||||
_irqlevel_changed_(&oldirql, LOWER);
|
||||
|
||||
//CALL the power_down function
|
||||
/* CALL the power_down function */
|
||||
_irqlevel_changed_(&oldirql, RAISE);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return status;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/* */
|
||||
NDIS_STATUS oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv)
|
||||
{
|
||||
return 0;
|
||||
|
|
1594
core/rtw_p2p.c
1594
core/rtw_p2p.c
File diff suppressed because it is too large
Load diff
|
@ -53,7 +53,7 @@ void ips_enter(_adapter * padapter)
|
|||
|
||||
pwrpriv->bips_processing = true;
|
||||
|
||||
// syn ips_mode with request
|
||||
/* syn ips_mode with request */
|
||||
pwrpriv->ips_mode = pwrpriv->ips_mode_req;
|
||||
|
||||
pwrpriv->ips_enter_cnts++;
|
||||
|
@ -149,7 +149,7 @@ static bool rtw_pwr_unassociated_idle(_adapter *adapter)
|
|||
bool ret = false;
|
||||
|
||||
if (adapter->pwrctrlpriv.ips_deny_time >= rtw_get_current_time()) {
|
||||
//DBG_88E("%s ips_deny_time\n", __func__);
|
||||
/* DBG_88E("%s ips_deny_time\n", __func__); */
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -200,12 +200,12 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
{
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *pwdinfo = &( padapter->wdinfo );
|
||||
#endif //CONFIG_P2P
|
||||
#endif /* CONFIG_P2P */
|
||||
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
rt_rf_power_state rfpwrstate;
|
||||
#endif //SUPPORT_HW_RFOFF_DETECTED
|
||||
#endif /* SUPPORT_HW_RFOFF_DETECTED */
|
||||
|
||||
pwrpriv->ps_processing = true;
|
||||
|
||||
|
@ -213,7 +213,7 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
if (pwrpriv->bips_processing == true)
|
||||
goto exit;
|
||||
|
||||
//DBG_88E("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca));
|
||||
/* DBG_88E("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca)); */
|
||||
if (padapter->pwrctrlpriv.bHWPwrPindetect)
|
||||
{
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
|
@ -241,7 +241,7 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
}
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_AUTOSUSPEND
|
||||
#endif /* CONFIG_AUTOSUSPEND */
|
||||
{
|
||||
rfpwrstate = RfOnOffDetect(padapter);
|
||||
DBG_88E("@@@@- #2 %s==> rfstate:%s\n",__func__,(rfpwrstate==rf_on)?"rf_on":"rf_off");
|
||||
|
@ -265,7 +265,7 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
}
|
||||
pwrpriv->pwr_state_check_cnts ++;
|
||||
}
|
||||
#endif //SUPPORT_HW_RFOFF_DETECTED
|
||||
#endif /* SUPPORT_HW_RFOFF_DETECTED */
|
||||
|
||||
if (pwrpriv->ips_mode_req == IPS_NONE
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
|
@ -305,17 +305,17 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
#else
|
||||
padapter->bCardDisableWOHSM = true;
|
||||
autosuspend_enter(padapter);
|
||||
#endif //if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
|
||||
}
|
||||
else if (pwrpriv->bHWPwrPindetect)
|
||||
{
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_AUTOSUSPEND
|
||||
#endif /* CONFIG_AUTOSUSPEND */
|
||||
{
|
||||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
#endif //defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
#endif /* defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
ips_enter(padapter);
|
||||
|
@ -368,7 +368,7 @@ _func_enter_;
|
|||
DBG_88E("%s: RPWM timeout, force to set RPWM(0x%02X) again!\n", __func__, pslv);
|
||||
}
|
||||
else
|
||||
#endif // CONFIG_LPS_RPWM_TIMER
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
{
|
||||
if ( (pwrpriv->rpwm == pslv)
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
|
@ -408,7 +408,7 @@ _func_enter_;
|
|||
|
||||
rpwm = pslv | pwrpriv->tog;
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
// only when from PS_STATE S0/S1 to S2 and higher needs ACK
|
||||
/* only when from PS_STATE S0/S1 to S2 and higher needs ACK */
|
||||
if ((pwrpriv->cpwm < PS_STATE_S2) && (pslv >= PS_STATE_S2))
|
||||
rpwm |= PS_ACK;
|
||||
#endif
|
||||
|
@ -420,13 +420,13 @@ _func_enter_;
|
|||
#ifdef CONFIG_LPS_RPWM_TIMER
|
||||
if (rpwm & PS_ACK)
|
||||
_set_timer(&pwrpriv->pwr_rpwm_timer, LPS_RPWM_WAIT_MS);
|
||||
#endif // CONFIG_LPS_RPWM_TIMER
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SET_RPWM, (u8 *)(&rpwm));
|
||||
|
||||
pwrpriv->tog += 0x80;
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
// No LPS 32K, No Ack
|
||||
/* No LPS 32K, No Ack */
|
||||
if (!(rpwm & PS_ACK))
|
||||
#endif
|
||||
{
|
||||
|
@ -485,14 +485,14 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
|
|||
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *pwdinfo = &( padapter->wdinfo );
|
||||
#endif //CONFIG_P2P
|
||||
#endif /* CONFIG_P2P */
|
||||
#ifdef CONFIG_TDLS
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
_irqL irqL;
|
||||
int i, j;
|
||||
_list *plist, *phead;
|
||||
struct sta_info *ptdls_sta;
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -520,12 +520,12 @@ _func_enter_;
|
|||
_enter_pwrlock(&pwrpriv->lock);
|
||||
#endif
|
||||
|
||||
//if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
/* if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) */
|
||||
if (ps_mode == PS_MODE_ACTIVE)
|
||||
{
|
||||
#ifdef CONFIG_P2P_PS
|
||||
if (pwdinfo->opp_ps == 0)
|
||||
#endif //CONFIG_P2P_PS
|
||||
#endif /* CONFIG_P2P_PS */
|
||||
{
|
||||
DBG_88E("rtw_set_ps_mode: Leave 802.11 power save\n");
|
||||
|
||||
|
@ -548,7 +548,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
pwrpriv->pwr_mode = ps_mode;
|
||||
rtw_set_rpwm(padapter, PS_STATE_S4);
|
||||
|
@ -585,7 +585,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
pwrpriv->bFwCurrentInPSMode = true;
|
||||
pwrpriv->pwr_mode = ps_mode;
|
||||
|
@ -594,10 +594,10 @@ _func_enter_;
|
|||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode));
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
// Set CTWindow after LPS
|
||||
/* Set CTWindow after LPS */
|
||||
if (pwdinfo->opp_ps == 1)
|
||||
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 0);
|
||||
#endif //CONFIG_P2P_PS
|
||||
#endif /* CONFIG_P2P_PS */
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
if (pwrpriv->alives == 0)
|
||||
|
@ -654,10 +654,10 @@ s32 LPS_RF_ON_check(PADAPTER padapter, u32 delay_ms)
|
|||
return err;
|
||||
}
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Enter the leisure power save mode.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Enter the leisure power save mode. */
|
||||
/* */
|
||||
void LPS_Enter(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
|
||||
|
@ -666,7 +666,7 @@ void LPS_Enter(PADAPTER padapter)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
// DBG_88E("+LeisurePSEnter\n");
|
||||
/* DBG_88E("+LeisurePSEnter\n"); */
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->iface_type != IFACE_PORT0)
|
||||
|
@ -703,14 +703,14 @@ _func_enter_;
|
|||
|
||||
if (true == pwrpriv->bLeisurePs)
|
||||
{
|
||||
// Idle for a while if we connect to AP a while ago.
|
||||
if (pwrpriv->LpsIdleCount >= 2) // 4 Sec
|
||||
/* Idle for a while if we connect to AP a while ago. */
|
||||
if (pwrpriv->LpsIdleCount >= 2) /* 4 Sec */
|
||||
{
|
||||
if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
{
|
||||
pwrpriv->bpower_saving = true;
|
||||
DBG_88E("%s smart_ps:%d\n", __func__, pwrpriv->smart_ps);
|
||||
//For Tenda W311R IOT issue
|
||||
/* For Tenda W311R IOT issue */
|
||||
rtw_set_ps_mode(padapter, pwrpriv->power_mgnt, pwrpriv->smart_ps, 0);
|
||||
}
|
||||
}
|
||||
|
@ -718,15 +718,15 @@ _func_enter_;
|
|||
pwrpriv->LpsIdleCount++;
|
||||
}
|
||||
|
||||
// DBG_88E("-LeisurePSEnter\n");
|
||||
/* DBG_88E("-LeisurePSEnter\n"); */
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Leave the leisure power save mode.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Leave the leisure power save mode. */
|
||||
/* */
|
||||
void LPS_Leave(PADAPTER padapter)
|
||||
{
|
||||
#define LPS_LEAVE_TIMEOUT_MS 100
|
||||
|
@ -742,7 +742,7 @@ _func_enter_;
|
|||
return; /* Skip power saving for concurrent mode port 1*/
|
||||
#endif
|
||||
|
||||
// DBG_88E("+LeisurePSLeave\n");
|
||||
/* DBG_88E("+LeisurePSLeave\n"); */
|
||||
|
||||
if (pwrpriv->bLeisurePs)
|
||||
{
|
||||
|
@ -757,16 +757,16 @@ _func_enter_;
|
|||
|
||||
pwrpriv->bpower_saving = false;
|
||||
|
||||
// DBG_88E("-LeisurePSLeave\n");
|
||||
/* DBG_88E("-LeisurePSLeave\n"); */
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Description: Leave all power save mode: LPS, FwLPS, IPS if needed.
|
||||
// Move code to function by tynli. 2010.03.26.
|
||||
//
|
||||
/* */
|
||||
/* Description: Leave all power save mode: LPS, FwLPS, IPS if needed. */
|
||||
/* Move code to function by tynli. 2010.03.26. */
|
||||
/* */
|
||||
void LeaveAllPowerSaveMode(PADAPTER Adapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
|
||||
|
@ -775,14 +775,14 @@ void LeaveAllPowerSaveMode(PADAPTER Adapter)
|
|||
_func_enter_;
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
||||
{ //connect
|
||||
{ /* connect */
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
enqueue = 1;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
p2p_ps_wk_cmd(Adapter, P2P_PS_DISABLE, enqueue);
|
||||
#endif //CONFIG_P2P_PS
|
||||
#endif /* CONFIG_P2P_PS */
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
rtw_lps_ctrl_wk_cmd(Adapter, LPS_CTRL_LEAVE, enqueue);
|
||||
|
@ -802,7 +802,7 @@ _func_enter_;
|
|||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
|
||||
usb_disable_autosuspend(adapter_to_dvobj(Adapter)->pusbdev);
|
||||
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34))
|
||||
adapter_to_dvobj(Adapter)->pusbdev->autosuspend_disabled = Adapter->bDisableAutosuspend;//autosuspend disabled by the user
|
||||
adapter_to_dvobj(Adapter)->pusbdev->autosuspend_disabled = Adapter->bDisableAutosuspend;/* autosuspend disabled by the user */
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@ -815,7 +815,7 @@ _func_enter_;
|
|||
DBG_88E("======> ips_leave fail.............\n");
|
||||
}
|
||||
#endif
|
||||
#endif //CONFIG_PLATFORM_SPRD && CONFIG_RTL8188E
|
||||
#endif /* CONFIG_PLATFORM_SPRD && CONFIG_RTL8188E */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -896,7 +896,7 @@ _func_enter_;
|
|||
_exit_pwrlock(&pwrpriv->lock);
|
||||
goto exit;
|
||||
}
|
||||
#endif // CONFIG_LPS_RPWM_TIMER
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
|
||||
pwrpriv->cpwm = PS_STATE(preportpwrstate->state);
|
||||
pwrpriv->cpwm_tog = preportpwrstate->state & PS_TOGGLE;
|
||||
|
@ -925,7 +925,7 @@ static void cpwm_event_callback(struct work_struct *work)
|
|||
_adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv);
|
||||
struct reportpwrstate_parm report;
|
||||
|
||||
//DBG_88E("%s\n",__func__);
|
||||
/* DBG_88E("%s\n",__func__); */
|
||||
|
||||
report.state = PS_STATE_S2;
|
||||
cpwm_int_hdl(adapter, &report);
|
||||
|
@ -940,7 +940,7 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work)
|
|||
|
||||
pwrpriv = container_of(work, struct pwrctrl_priv, rpwmtimeoutwi);
|
||||
padapter = container_of(pwrpriv, _adapter, pwrctrlpriv);
|
||||
// DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
|
||||
/* DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); */
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2))
|
||||
|
@ -991,7 +991,7 @@ static void pwr_rpwm_timeout_handler(void *FunctionContext)
|
|||
|
||||
padapter = (PADAPTER)FunctionContext;
|
||||
pwrpriv = &padapter->pwrctrlpriv;
|
||||
// DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
|
||||
/* DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); */
|
||||
|
||||
if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2))
|
||||
{
|
||||
|
@ -1001,7 +1001,7 @@ static void pwr_rpwm_timeout_handler(void *FunctionContext)
|
|||
|
||||
_set_workitem(&pwrpriv->rpwmtimeoutwi);
|
||||
}
|
||||
#endif // CONFIG_LPS_RPWM_TIMER
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
|
||||
__inline static void register_task_alive(struct pwrctrl_priv *pwrctrl, u32 tag)
|
||||
{
|
||||
|
@ -1313,7 +1313,7 @@ _func_exit_;
|
|||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
static void resume_workitem_callback(struct work_struct *work);
|
||||
#endif //CONFIG_RESUME_IN_WORKQUEUE
|
||||
#endif /* CONFIG_RESUME_IN_WORKQUEUE */
|
||||
|
||||
void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
{
|
||||
|
@ -1347,11 +1347,10 @@ _func_enter_;
|
|||
#endif
|
||||
|
||||
pwrctrlpriv->LpsIdleCount = 0;
|
||||
//pwrctrlpriv->FWCtrlPSMode =padapter->registrypriv.power_mgnt;// PS_MODE_MIN;
|
||||
if (padapter->registrypriv.mp_mode == 1)
|
||||
pwrctrlpriv->power_mgnt =PS_MODE_ACTIVE ;
|
||||
else
|
||||
pwrctrlpriv->power_mgnt =padapter->registrypriv.power_mgnt;// PS_MODE_MIN;
|
||||
pwrctrlpriv->power_mgnt =padapter->registrypriv.power_mgnt;/* PS_MODE_MIN; */
|
||||
pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt)?true:false;
|
||||
|
||||
pwrctrlpriv->bFwCurrentInPSMode = false;
|
||||
|
@ -1376,8 +1375,8 @@ _func_enter_;
|
|||
pwrctrlpriv->brpwmtimeout = false;
|
||||
_init_workitem(&pwrctrlpriv->rpwmtimeoutwi, rpwmtimeout_workitem_callback, NULL);
|
||||
_init_timer(&pwrctrlpriv->pwr_rpwm_timer, padapter->pnetdev, pwr_rpwm_timeout_handler, padapter);
|
||||
#endif // CONFIG_LPS_RPWM_TIMER
|
||||
#endif // CONFIG_LPS_LCLK
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
#endif /* CONFIG_LPS_LCLK */
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
_init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter);
|
||||
|
@ -1386,12 +1385,12 @@ _func_enter_;
|
|||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
_init_workitem(&pwrctrlpriv->resume_work, resume_workitem_callback, NULL);
|
||||
pwrctrlpriv->rtw_workqueue = create_singlethread_workqueue("rtw_workqueue");
|
||||
#endif //CONFIG_RESUME_IN_WORKQUEUE
|
||||
#endif /* CONFIG_RESUME_IN_WORKQUEUE */
|
||||
|
||||
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
pwrctrlpriv->early_suspend.suspend = NULL;
|
||||
rtw_register_early_suspend(pwrctrlpriv);
|
||||
#endif //CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER
|
||||
#endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */
|
||||
|
||||
|
||||
_func_exit_;
|
||||
|
@ -1405,7 +1404,7 @@ void rtw_free_pwrctrl_priv(PADAPTER adapter)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
//_rtw_memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv));
|
||||
/* _rtw_memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv)); */
|
||||
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
|
@ -1418,7 +1417,7 @@ _func_enter_;
|
|||
|
||||
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
rtw_unregister_early_suspend(pwrctrlpriv);
|
||||
#endif //CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER
|
||||
#endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */
|
||||
|
||||
_free_pwrlock(&pwrctrlpriv->lock);
|
||||
|
||||
|
@ -1444,7 +1443,7 @@ static void resume_workitem_callback(struct work_struct *work)
|
|||
|
||||
void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv)
|
||||
{
|
||||
// accquire system's suspend lock preventing from falliing asleep while resume in workqueue
|
||||
/* accquire system's suspend lock preventing from falliing asleep while resume in workqueue */
|
||||
rtw_lock_suspend();
|
||||
|
||||
#if 1
|
||||
|
@ -1453,7 +1452,7 @@ void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv)
|
|||
_set_workitem(&pwrpriv->resume_work);
|
||||
#endif
|
||||
}
|
||||
#endif //CONFIG_RESUME_IN_WORKQUEUE
|
||||
#endif /* CONFIG_RESUME_IN_WORKQUEUE */
|
||||
|
||||
#ifdef CONFIG_HAS_EARLYSUSPEND
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
|
@ -1464,7 +1463,7 @@ static void rtw_early_suspend(struct early_suspend *h)
|
|||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
DBG_88E("%s\n",__func__);
|
||||
|
||||
//jeff: do nothing but set do_late_resume to false
|
||||
/* jeff: do nothing but set do_late_resume to false */
|
||||
pwrpriv->do_late_resume = false;
|
||||
}
|
||||
|
||||
|
@ -1486,7 +1485,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
{
|
||||
DBG_88E("%s\n", __func__);
|
||||
|
||||
//jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit
|
||||
/* jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit */
|
||||
pwrpriv->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20;
|
||||
pwrpriv->early_suspend.suspend = rtw_early_suspend;
|
||||
pwrpriv->early_suspend.resume = rtw_late_resume;
|
||||
|
@ -1507,7 +1506,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
pwrpriv->early_suspend.suspend = NULL;
|
||||
pwrpriv->early_suspend.resume = NULL;
|
||||
}
|
||||
#endif //CONFIG_HAS_EARLYSUSPEND
|
||||
#endif /* CONFIG_HAS_EARLYSUSPEND */
|
||||
|
||||
#ifdef CONFIG_ANDROID_POWER
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
|
@ -1518,7 +1517,7 @@ static void rtw_early_suspend(android_early_suspend_t *h)
|
|||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
DBG_88E("%s\n",__func__);
|
||||
|
||||
//jeff: do nothing but set do_late_resume to false
|
||||
/* jeff: do nothing but set do_late_resume to false */
|
||||
pwrpriv->do_late_resume = false;
|
||||
}
|
||||
|
||||
|
@ -1540,7 +1539,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
{
|
||||
DBG_88E("%s\n", __func__);
|
||||
|
||||
//jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit
|
||||
/* jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit */
|
||||
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;
|
||||
|
@ -1559,7 +1558,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
|||
pwrpriv->early_suspend.suspend = NULL;
|
||||
pwrpriv->early_suspend.resume = NULL;
|
||||
}
|
||||
#endif //CONFIG_ANDROID_POWER
|
||||
#endif /* CONFIG_ANDROID_POWER */
|
||||
|
||||
u8 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val)
|
||||
{
|
||||
|
@ -1616,19 +1615,19 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
}
|
||||
}
|
||||
|
||||
//System suspend is not allowed to wakeup
|
||||
/* System suspend is not allowed to wakeup */
|
||||
if ((pwrpriv->bInternalAutoSuspend == false) && (true == pwrpriv->bInSuspend )){
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
//block???
|
||||
/* block??? */
|
||||
if ((pwrpriv->bInternalAutoSuspend == true) && (padapter->net_closed == true)) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
//I think this should be check in IPS, LPS, autosuspend functions...
|
||||
/* I think this should be check in IPS, LPS, autosuspend functions... */
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
||||
{
|
||||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
|
@ -1646,12 +1645,12 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
#endif
|
||||
pwrpriv->autopm_cnt++;
|
||||
}
|
||||
#endif //#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
|
||||
ret = _SUCCESS;
|
||||
goto exit;
|
||||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
#endif //#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
|
||||
}
|
||||
if (rf_off == pwrpriv->rf_pwrstate )
|
||||
{
|
||||
|
@ -1689,7 +1688,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
}
|
||||
}
|
||||
|
||||
//TODO: the following checking need to be merged...
|
||||
/* TODO: the following checking need to be merged... */
|
||||
if (padapter->bDriverStopped
|
||||
|| !padapter->bup
|
||||
|| !padapter->hw_init_completed
|
||||
|
|
688
core/rtw_recv.c
688
core/rtw_recv.c
File diff suppressed because it is too large
Load diff
|
@ -26,7 +26,7 @@
|
|||
#include <osdep_intf.h>
|
||||
|
||||
|
||||
//=====WEP related=====
|
||||
/* WEP related===== */
|
||||
|
||||
#define CRC32_POLY 0x04c11db7
|
||||
|
||||
|
@ -160,7 +160,7 @@ _func_exit_;
|
|||
Need to consider the fragment situation
|
||||
*/
|
||||
void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
{ // exclude ICV
|
||||
{ /* exclude ICV */
|
||||
|
||||
unsigned char crc[4];
|
||||
struct arc4context mycontext;
|
||||
|
@ -168,7 +168,7 @@ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe)
|
|||
sint curfragnum,length;
|
||||
u32 keylength;
|
||||
|
||||
u8 *pframe, *payload,*iv; //,*wepkey
|
||||
u8 *pframe, *payload,*iv; /* wepkey */
|
||||
u8 wepkey[16];
|
||||
u8 hw_hdr_offset=0;
|
||||
struct pkt_attrib *pattrib = &((struct xmit_frame*)pxmitframe)->attrib;
|
||||
|
@ -194,7 +194,7 @@ _func_enter_;
|
|||
|
||||
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
|
||||
|
||||
//start to encrypt each fragment
|
||||
/* start to encrypt each fragment */
|
||||
if ((pattrib->encrypt==_WEP40_)||(pattrib->encrypt==_WEP104_))
|
||||
{
|
||||
keylength=psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex];
|
||||
|
@ -207,7 +207,7 @@ _func_enter_;
|
|||
payload=pframe+pattrib->iv_len+pattrib->hdrlen;
|
||||
|
||||
if ((curfragnum+1)==pattrib->nr_frags)
|
||||
{ //the last fragment
|
||||
{ /* the last fragment */
|
||||
|
||||
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
|
||||
|
||||
|
@ -241,7 +241,7 @@ _func_exit_;
|
|||
|
||||
void rtw_wep_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
{
|
||||
// exclude ICV
|
||||
/* exclude ICV */
|
||||
u8 crc[4];
|
||||
struct arc4context mycontext;
|
||||
sint length;
|
||||
|
@ -255,7 +255,7 @@ _func_enter_;
|
|||
|
||||
pframe = (unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
|
||||
|
||||
//start to decrypt recvframe
|
||||
/* start to decrypt recvframe */
|
||||
if ((prxattrib->encrypt==_WEP40_)||(prxattrib->encrypt==_WEP104_)) {
|
||||
iv=pframe+prxattrib->hdrlen;
|
||||
keyindex = prxattrib->key_index;
|
||||
|
@ -266,11 +266,11 @@ _func_enter_;
|
|||
|
||||
payload=pframe+prxattrib->iv_len+prxattrib->hdrlen;
|
||||
|
||||
//decrypt payload include icv
|
||||
/* decrypt payload include icv */
|
||||
arcfour_init(&mycontext, wepkey,3+keylength);
|
||||
arcfour_encrypt(&mycontext, payload, payload, length);
|
||||
|
||||
//calculate icv and compare the icv
|
||||
/* calculate icv and compare the icv */
|
||||
*((__le32 *)crc) = getcrc32(payload, length - 4);
|
||||
|
||||
if (crc[3] != payload[length-1] ||
|
||||
|
@ -286,10 +286,10 @@ _func_exit_;
|
|||
return;
|
||||
}
|
||||
|
||||
//3 =====TKIP related=====
|
||||
/* 3 =====TKIP related===== */
|
||||
|
||||
static u32 secmicgetuint32( u8 * p )
|
||||
// Convert from Byte[] to Us4Byte32 in a portable way
|
||||
/* Convert from Byte[] to Us4Byte32 in a portable way */
|
||||
{
|
||||
s32 i;
|
||||
u32 res = 0;
|
||||
|
@ -303,7 +303,7 @@ _func_exit_;
|
|||
}
|
||||
|
||||
static void secmicputuint32( u8 * p, u32 val )
|
||||
// Convert from Us4Byte32 to Byte[] in a portable way
|
||||
/* Convert from Us4Byte32 to Byte[] in a portable way */
|
||||
{
|
||||
long i;
|
||||
_func_enter_;
|
||||
|
@ -317,7 +317,7 @@ _func_exit_;
|
|||
|
||||
static void secmicclear(struct mic_data *pmicdata)
|
||||
{
|
||||
// Reset the state to the empty message.
|
||||
/* Reset the state to the empty message. */
|
||||
_func_enter_;
|
||||
pmicdata->L = pmicdata->K0;
|
||||
pmicdata->R = pmicdata->K1;
|
||||
|
@ -328,11 +328,11 @@ _func_exit_;
|
|||
|
||||
void rtw_secmicsetkey(struct mic_data *pmicdata, u8 * key )
|
||||
{
|
||||
// Set the key
|
||||
/* Set the key */
|
||||
_func_enter_;
|
||||
pmicdata->K0 = secmicgetuint32( key );
|
||||
pmicdata->K1 = secmicgetuint32( key + 4 );
|
||||
// and reset the message
|
||||
/* and reset the message */
|
||||
secmicclear(pmicdata);
|
||||
_func_exit_;
|
||||
}
|
||||
|
@ -340,10 +340,10 @@ _func_exit_;
|
|||
void rtw_secmicappendbyte(struct mic_data *pmicdata, u8 b )
|
||||
{
|
||||
_func_enter_;
|
||||
// Append the byte to our word-sized buffer
|
||||
/* Append the byte to our word-sized buffer */
|
||||
pmicdata->M |= ((unsigned long)b) << (8*pmicdata->nBytesInM);
|
||||
pmicdata->nBytesInM++;
|
||||
// Process the word if it is full.
|
||||
/* Process the word if it is full. */
|
||||
if ( pmicdata->nBytesInM >= 4 )
|
||||
{
|
||||
pmicdata->L ^= pmicdata->M;
|
||||
|
@ -355,7 +355,7 @@ _func_enter_;
|
|||
pmicdata->L += pmicdata->R;
|
||||
pmicdata->R ^= ROR32( pmicdata->L, 2 );
|
||||
pmicdata->L += pmicdata->R;
|
||||
// Clear the buffer
|
||||
/* Clear the buffer */
|
||||
pmicdata->M = 0;
|
||||
pmicdata->nBytesInM = 0;
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ _func_exit_;
|
|||
void rtw_secmicappend(struct mic_data *pmicdata, u8 * src, u32 nbytes )
|
||||
{
|
||||
_func_enter_;
|
||||
// This is simple
|
||||
/* This is simple */
|
||||
while ( nbytes > 0 )
|
||||
{
|
||||
rtw_secmicappendbyte(pmicdata, *src++ );
|
||||
|
@ -377,21 +377,21 @@ _func_exit_;
|
|||
void rtw_secgetmic(struct mic_data *pmicdata, u8 * dst )
|
||||
{
|
||||
_func_enter_;
|
||||
// Append the minimum padding
|
||||
/* Append the minimum padding */
|
||||
rtw_secmicappendbyte(pmicdata, 0x5a );
|
||||
rtw_secmicappendbyte(pmicdata, 0 );
|
||||
rtw_secmicappendbyte(pmicdata, 0 );
|
||||
rtw_secmicappendbyte(pmicdata, 0 );
|
||||
rtw_secmicappendbyte(pmicdata, 0 );
|
||||
// and then zeroes until the length is a multiple of 4
|
||||
/* and then zeroes until the length is a multiple of 4 */
|
||||
while ( pmicdata->nBytesInM != 0 )
|
||||
{
|
||||
rtw_secmicappendbyte(pmicdata, 0 );
|
||||
}
|
||||
// The appendByte function has already computed the result.
|
||||
/* The appendByte function has already computed the result. */
|
||||
secmicputuint32( dst, pmicdata->L );
|
||||
secmicputuint32( dst+4, pmicdata->R );
|
||||
// Reset to the empty message.
|
||||
/* Reset to the empty message. */
|
||||
secmicclear(pmicdata);
|
||||
_func_exit_;
|
||||
}
|
||||
|
@ -407,16 +407,16 @@ _func_enter_;
|
|||
priority[0]=pri;
|
||||
|
||||
/* Michael MIC pseudo header: DA, SA, 3 x 0, Priority */
|
||||
if (header[1]&1){ //ToDS==1
|
||||
rtw_secmicappend(&micdata, &header[16], 6); //DA
|
||||
if (header[1]&2) //From Ds==1
|
||||
if (header[1]&1){ /* ToDS==1 */
|
||||
rtw_secmicappend(&micdata, &header[16], 6); /* DA */
|
||||
if (header[1]&2) /* From Ds==1 */
|
||||
rtw_secmicappend(&micdata, &header[24], 6);
|
||||
else
|
||||
rtw_secmicappend(&micdata, &header[10], 6);
|
||||
}
|
||||
else{ //ToDS==0
|
||||
rtw_secmicappend(&micdata, &header[4], 6); //DA
|
||||
if (header[1]&2) //From Ds==1
|
||||
else{ /* ToDS==0 */
|
||||
rtw_secmicappend(&micdata, &header[4], 6); /* DA */
|
||||
if (header[1]&2) /* From Ds==1 */
|
||||
rtw_secmicappend(&micdata, &header[16], 6);
|
||||
else
|
||||
rtw_secmicappend(&micdata, &header[10], 6);
|
||||
|
@ -642,9 +642,9 @@ _func_exit_;
|
|||
}
|
||||
|
||||
|
||||
//The hlen isn't include the IV
|
||||
/* The hlen isn't include the IV */
|
||||
u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
{ // exclude ICV
|
||||
{ /* exclude ICV */
|
||||
u16 pnl;
|
||||
u32 pnh;
|
||||
u8 rc4key[16];
|
||||
|
@ -678,7 +678,7 @@ _func_enter_;
|
|||
#endif
|
||||
|
||||
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
|
||||
//4 start to encrypt each fragment
|
||||
/* 4 start to encrypt each fragment */
|
||||
if (pattrib->encrypt==_TKIP_){
|
||||
|
||||
if (pattrib->psta)
|
||||
|
@ -715,7 +715,7 @@ _func_enter_;
|
|||
|
||||
phase2(&rc4key[0],prwskey,(u16 *)&ttkey[0],pnl);
|
||||
|
||||
if ((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
|
||||
if ((curfragnum+1)==pattrib->nr_frags){ /* 4 the last fragment */
|
||||
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
|
||||
RT_TRACE(_module_rtl871x_security_c_, _drv_info_,
|
||||
("pattrib->iv_len =%x, pattrib->icv_len =%x\n",
|
||||
|
@ -754,9 +754,9 @@ _func_exit_;
|
|||
}
|
||||
|
||||
|
||||
//The hlen isn't include the IV
|
||||
/* The hlen isn't include the IV */
|
||||
u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
{ // exclude ICV
|
||||
{ /* exclude ICV */
|
||||
u16 pnl;
|
||||
u32 pnh;
|
||||
u8 rc4key[16];
|
||||
|
@ -770,14 +770,14 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe)
|
|||
struct sta_info *stainfo;
|
||||
struct rx_pkt_attrib *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib;
|
||||
struct security_priv *psecuritypriv=&padapter->securitypriv;
|
||||
// struct recv_priv *precvpriv=&padapter->recvpriv;
|
||||
/* struct recv_priv *precvpriv=&padapter->recvpriv; */
|
||||
u32 res=_SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
|
||||
|
||||
//4 start to decrypt recvframe
|
||||
/* 4 start to decrypt recvframe */
|
||||
if (prxattrib->encrypt==_TKIP_){
|
||||
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] );
|
||||
|
@ -791,8 +791,8 @@ _func_enter_;
|
|||
DBG_88E("%s:rx bc/mc packets,but didn't install group key!!!!!!!!!!\n",__func__);
|
||||
goto exit;
|
||||
}
|
||||
//DBG_88E("rx bc/mc packets, to perform sw rtw_tkip_decrypt\n");
|
||||
//prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
|
||||
/* DBG_88E("rx bc/mc packets, to perform sw rtw_tkip_decrypt\n"); */
|
||||
/* prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; */
|
||||
prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey;
|
||||
}
|
||||
else
|
||||
|
@ -813,7 +813,7 @@ _func_enter_;
|
|||
phase1((u16 *)&ttkey[0],prwskey,&prxattrib->ta[0],pnh);
|
||||
phase2(&rc4key[0],prwskey,(unsigned short *)&ttkey[0],pnl);
|
||||
|
||||
//4 decrypt payload include icv
|
||||
/* 4 decrypt payload include icv */
|
||||
|
||||
arcfour_init(&mycontext, rc4key,16);
|
||||
arcfour_encrypt(&mycontext, payload, payload, length);
|
||||
|
@ -840,7 +840,7 @@ exit:
|
|||
}
|
||||
|
||||
|
||||
//3 =====AES related=====
|
||||
/* 3 =====AES related===== */
|
||||
|
||||
|
||||
|
||||
|
@ -926,7 +926,7 @@ static void add_round_key( u8 *shiftrow_in,
|
|||
u8 *block_in,
|
||||
sint round,
|
||||
u8 *out);
|
||||
#endif //PLATFORM_FREEBSD
|
||||
#endif /* PLATFORM_FREEBSD */
|
||||
static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext);
|
||||
|
||||
|
||||
|
@ -1218,7 +1218,6 @@ _func_enter_;
|
|||
mic_header2[4] = mpdu[20];
|
||||
mic_header2[5] = mpdu[21];
|
||||
|
||||
//mic_header2[6] = mpdu[22] & 0xf0; /* SC */
|
||||
mic_header2[6] = 0x00;
|
||||
mic_header2[7] = 0x00; /* mpdu[23]; */
|
||||
|
||||
|
@ -1306,7 +1305,6 @@ _func_exit_;
|
|||
static sint aes_cipher(u8 *key, uint hdrlen,
|
||||
u8 *pframe, uint plen)
|
||||
{
|
||||
// /*static*/ unsigned char message[MAX_MSG_SIZE];
|
||||
uint qc_exists, a4_exists, i, j, payload_remainder,
|
||||
num_blocks, payload_index;
|
||||
|
||||
|
@ -1321,7 +1319,6 @@ static sint aes_cipher(u8 *key, uint hdrlen,
|
|||
u8 aes_out[16];
|
||||
u8 padded_buffer[16];
|
||||
u8 mic[8];
|
||||
// uint offset = 0;
|
||||
uint frtype = GetFrameType(pframe);
|
||||
uint frsubtype = GetFrameSubType(pframe);
|
||||
|
||||
|
@ -1379,7 +1376,7 @@ _func_enter_;
|
|||
mic_iv,
|
||||
qc_exists,
|
||||
a4_exists,
|
||||
pframe, //message,
|
||||
pframe, /* message, */
|
||||
plen,
|
||||
pn_vector
|
||||
);
|
||||
|
@ -1387,11 +1384,11 @@ _func_enter_;
|
|||
construct_mic_header1(
|
||||
mic_header1,
|
||||
hdrlen,
|
||||
pframe //message
|
||||
pframe /* message */
|
||||
);
|
||||
construct_mic_header2(
|
||||
mic_header2,
|
||||
pframe, //message,
|
||||
pframe, /* message, */
|
||||
a4_exists,
|
||||
qc_exists
|
||||
);
|
||||
|
@ -1412,7 +1409,7 @@ _func_enter_;
|
|||
|
||||
for (i = 0; i < num_blocks; i++)
|
||||
{
|
||||
bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);//bitwise_xor(aes_out, &message[payload_index], chain_buffer);
|
||||
bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);/* bitwise_xor(aes_out, &message[payload_index], chain_buffer); */
|
||||
|
||||
payload_index += 16;
|
||||
aes128k128d(key, chain_buffer, aes_out);
|
||||
|
@ -1424,7 +1421,7 @@ _func_enter_;
|
|||
for (j = 0; j < 16; j++) padded_buffer[j] = 0x00;
|
||||
for (j = 0; j < payload_remainder; j++)
|
||||
{
|
||||
padded_buffer[j] = pframe[payload_index++];//padded_buffer[j] = message[payload_index++];
|
||||
padded_buffer[j] = pframe[payload_index++];/* padded_buffer[j] = message[payload_index++]; */
|
||||
}
|
||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
||||
aes128k128d(key, chain_buffer, aes_out);
|
||||
|
@ -1435,7 +1432,7 @@ _func_enter_;
|
|||
|
||||
/* Insert MIC into payload */
|
||||
for (j = 0; j < 8; j++)
|
||||
pframe[payload_index+j] = mic[j]; //message[payload_index+j] = mic[j];
|
||||
pframe[payload_index+j] = mic[j]; /* message[payload_index+j] = mic[j]; */
|
||||
|
||||
payload_index = hdrlen + 8;
|
||||
for (i=0; i< num_blocks; i++)
|
||||
|
@ -1444,12 +1441,12 @@ _func_enter_;
|
|||
ctr_preload,
|
||||
a4_exists,
|
||||
qc_exists,
|
||||
pframe, //message,
|
||||
pframe, /* message, */
|
||||
pn_vector,
|
||||
i+1);
|
||||
aes128k128d(key, ctr_preload, aes_out);
|
||||
bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);//bitwise_xor(aes_out, &message[payload_index], chain_buffer);
|
||||
for (j=0; j<16;j++) pframe[payload_index++] = chain_buffer[j];//for (j=0; j<16;j++) message[payload_index++] = chain_buffer[j];
|
||||
bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);/* bitwise_xor(aes_out, &message[payload_index], chain_buffer); */
|
||||
for (j=0; j<16;j++) pframe[payload_index++] = chain_buffer[j];/* for (j=0; j<16;j++) message[payload_index++] = chain_buffer[j]; */
|
||||
}
|
||||
|
||||
if (payload_remainder > 0) /* If there is a short final block, then pad it,*/
|
||||
|
@ -1458,18 +1455,18 @@ _func_enter_;
|
|||
ctr_preload,
|
||||
a4_exists,
|
||||
qc_exists,
|
||||
pframe, //message,
|
||||
pframe, /* message, */
|
||||
pn_vector,
|
||||
num_blocks+1);
|
||||
|
||||
for (j = 0; j < 16; j++) padded_buffer[j] = 0x00;
|
||||
for (j = 0; j < payload_remainder; j++)
|
||||
{
|
||||
padded_buffer[j] = pframe[payload_index+j];//padded_buffer[j] = message[payload_index+j];
|
||||
padded_buffer[j] = pframe[payload_index+j];/* padded_buffer[j] = message[payload_index+j]; */
|
||||
}
|
||||
aes128k128d(key, ctr_preload, aes_out);
|
||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
||||
for (j=0; j<payload_remainder;j++) pframe[payload_index++] = chain_buffer[j];//for (j=0; j<payload_remainder;j++) message[payload_index++] = chain_buffer[j];
|
||||
for (j=0; j<payload_remainder;j++) pframe[payload_index++] = chain_buffer[j];/* for (j=0; j<payload_remainder;j++) message[payload_index++] = chain_buffer[j]; */
|
||||
}
|
||||
|
||||
/* Encrypt the MIC */
|
||||
|
@ -1477,19 +1474,19 @@ _func_enter_;
|
|||
ctr_preload,
|
||||
a4_exists,
|
||||
qc_exists,
|
||||
pframe, //message,
|
||||
pframe, /* message, */
|
||||
pn_vector,
|
||||
0);
|
||||
|
||||
for (j = 0; j < 16; j++) padded_buffer[j] = 0x00;
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
padded_buffer[j] = pframe[j+hdrlen+8+plen];//padded_buffer[j] = message[j+hdrlen+8+plen];
|
||||
padded_buffer[j] = pframe[j+hdrlen+8+plen];/* padded_buffer[j] = message[j+hdrlen+8+plen]; */
|
||||
}
|
||||
|
||||
aes128k128d(key, ctr_preload, aes_out);
|
||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
||||
for (j=0; j<8;j++) pframe[payload_index++] = chain_buffer[j];//for (j=0; j<8;j++) message[payload_index++] = chain_buffer[j];
|
||||
for (j=0; j<8;j++) pframe[payload_index++] = chain_buffer[j];/* for (j=0; j<8;j++) message[payload_index++] = chain_buffer[j]; */
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
@ -1499,22 +1496,22 @@ _func_exit_;
|
|||
|
||||
|
||||
u32 rtw_aes_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
{ // exclude ICV
|
||||
{ /* exclude ICV */
|
||||
|
||||
|
||||
/*static*/
|
||||
// unsigned char message[MAX_MSG_SIZE];
|
||||
/* unsigned char message[MAX_MSG_SIZE]; */
|
||||
|
||||
/* Intermediate Buffers */
|
||||
sint curfragnum,length;
|
||||
u8 *pframe,*prwskey; //, *payload,*iv
|
||||
u8 *pframe,*prwskey; /* *payload,*iv */
|
||||
u8 hw_hdr_offset = 0;
|
||||
struct sta_info *stainfo;
|
||||
struct pkt_attrib *pattrib = &((struct xmit_frame *)pxmitframe)->attrib;
|
||||
struct security_priv *psecuritypriv=&padapter->securitypriv;
|
||||
struct xmit_priv *pxmitpriv=&padapter->xmitpriv;
|
||||
|
||||
// uint offset = 0;
|
||||
/* uint offset = 0; */
|
||||
u32 res=_SUCCESS;
|
||||
_func_enter_;
|
||||
|
||||
|
@ -1534,7 +1531,7 @@ _func_enter_;
|
|||
|
||||
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
|
||||
|
||||
//4 start to encrypt each fragment
|
||||
/* 4 start to encrypt each fragment */
|
||||
if ((pattrib->encrypt==_AES_)){
|
||||
|
||||
if (pattrib->psta)
|
||||
|
@ -1558,7 +1555,7 @@ _func_enter_;
|
|||
prwskey=&stainfo->dot118021x_UncstKey.skey[0];
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS //swencryption
|
||||
#ifdef CONFIG_TDLS /* swencryption */
|
||||
{
|
||||
struct sta_info *ptdls_sta;
|
||||
ptdls_sta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->dst[0] );
|
||||
|
@ -1568,10 +1565,10 @@ _func_enter_;
|
|||
prwskey=&ptdls_sta->tpk.tk[0];
|
||||
}
|
||||
}
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
for (curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
|
||||
|
||||
if ((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
|
||||
if ((curfragnum+1)==pattrib->nr_frags){ /* 4 the last fragment */
|
||||
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
|
||||
|
||||
aes_cipher(prwskey,pattrib->hdrlen,pframe, length);
|
||||
|
@ -1621,7 +1618,7 @@ static sint aes_decipher(u8 *key, uint hdrlen,
|
|||
u8 mic[8];
|
||||
|
||||
|
||||
// uint offset = 0;
|
||||
/* uint offset = 0; */
|
||||
uint frtype = GetFrameType(pframe);
|
||||
uint frsubtype = GetFrameSubType(pframe);
|
||||
_func_enter_;
|
||||
|
@ -1636,9 +1633,9 @@ _func_enter_;
|
|||
_rtw_memset((void *)aes_out, 0, 16);
|
||||
_rtw_memset((void *)padded_buffer, 0, 16);
|
||||
|
||||
//start to decrypt the payload
|
||||
/* start to decrypt the payload */
|
||||
|
||||
num_blocks = (plen-8) / 16; //(plen including llc, payload_length and mic )
|
||||
num_blocks = (plen-8) / 16; /* plen including llc, payload_length and mic ) */
|
||||
|
||||
payload_remainder = (plen-8) % 16;
|
||||
|
||||
|
@ -1681,9 +1678,9 @@ _func_enter_;
|
|||
qc_exists = 0;
|
||||
|
||||
|
||||
// now, decrypt pframe with hdrlen offset and plen long
|
||||
/* now, decrypt pframe with hdrlen offset and plen long */
|
||||
|
||||
payload_index = hdrlen + 8; // 8 is for extiv
|
||||
payload_index = hdrlen + 8; /* 8 is for extiv */
|
||||
|
||||
for (i=0; i< num_blocks; i++)
|
||||
{
|
||||
|
@ -1723,9 +1720,9 @@ _func_enter_;
|
|||
for (j=0; j<payload_remainder;j++) pframe[payload_index++] = chain_buffer[j];
|
||||
}
|
||||
|
||||
//start to calculate the mic
|
||||
/* start to calculate the mic */
|
||||
if ((hdrlen +plen+8) <= MAX_MSG_SIZE)
|
||||
_rtw_memcpy((void *)message, pframe, (hdrlen +plen+8)); //8 is for ext iv len
|
||||
_rtw_memcpy((void *)message, pframe, (hdrlen +plen+8)); /* 8 is for ext iv len */
|
||||
|
||||
|
||||
pn_vector[0]=pframe[hdrlen];
|
||||
|
@ -1853,7 +1850,7 @@ _func_enter_;
|
|||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
||||
for (j=0; j<8;j++) message[payload_index++] = chain_buffer[j];
|
||||
|
||||
//compare the mic
|
||||
/* compare the mic */
|
||||
for (i=0;i<8;i++){
|
||||
if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
|
||||
{
|
||||
|
@ -1869,26 +1866,26 @@ _func_exit_;
|
|||
}
|
||||
|
||||
u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
{ // exclude ICV
|
||||
{ /* exclude ICV */
|
||||
|
||||
|
||||
/*static*/
|
||||
// unsigned char message[MAX_MSG_SIZE];
|
||||
/* unsigned char message[MAX_MSG_SIZE]; */
|
||||
|
||||
|
||||
/* Intermediate Buffers */
|
||||
|
||||
|
||||
sint length;
|
||||
u8 *pframe,*prwskey; //, *payload,*iv
|
||||
u8 *pframe,*prwskey; /* *payload,*iv */
|
||||
struct sta_info *stainfo;
|
||||
struct rx_pkt_attrib *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib;
|
||||
struct security_priv *psecuritypriv=&padapter->securitypriv;
|
||||
// struct recv_priv *precvpriv=&padapter->recvpriv;
|
||||
/* struct recv_priv *precvpriv=&padapter->recvpriv; */
|
||||
u32 res=_SUCCESS;
|
||||
_func_enter_;
|
||||
pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
|
||||
//4 start to encrypt each fragment
|
||||
/* 4 start to encrypt each fragment */
|
||||
if ((prxattrib->encrypt==_AES_)){
|
||||
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] );
|
||||
|
@ -1897,9 +1894,9 @@ _func_enter_;
|
|||
|
||||
if (IS_MCAST(prxattrib->ra))
|
||||
{
|
||||
//in concurrent we should use sw descrypt in group key, so we remove this message
|
||||
//DBG_88E("rx bc/mc packets, to perform sw rtw_aes_decrypt\n");
|
||||
//prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
|
||||
/* in concurrent we should use sw descrypt in group key, so we remove this message */
|
||||
/* DBG_88E("rx bc/mc packets, to perform sw rtw_aes_decrypt\n"); */
|
||||
/* prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; */
|
||||
if (psecuritypriv->binstallGrpkey==false)
|
||||
{
|
||||
res=_FAIL;
|
||||
|
@ -2202,7 +2199,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
|
|||
_len[1] = 32;
|
||||
sha256_vector(2, _addr, _len, mac);
|
||||
}
|
||||
#endif //PLATFORM_FREEBSD
|
||||
#endif /* PLATFORM_FREEBSD */
|
||||
/**
|
||||
* sha256_prf - SHA256-based Pseudo-Random Function (IEEE 802.11r, 8.5.1.5.2)
|
||||
* @key: Key for PRF
|
||||
|
@ -2216,7 +2213,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
|
|||
* This function is used to derive new, cryptographically separate keys from a
|
||||
* given key.
|
||||
*/
|
||||
#ifndef PLATFORM_FREEBSD //Baron
|
||||
#ifndef PLATFORM_FREEBSD /* Baron */
|
||||
static void sha256_prf(u8 *key, size_t key_len, char *label,
|
||||
u8 *data, size_t data_len, u8 *buf, size_t buf_len)
|
||||
{
|
||||
|
@ -2253,7 +2250,7 @@ static void sha256_prf(u8 *key, size_t key_len, char *label,
|
|||
counter++;
|
||||
}
|
||||
}
|
||||
#endif //PLATFORM_FREEBSD Baron
|
||||
#endif /* PLATFORM_FREEBSD Baron */
|
||||
|
||||
/* AES tables*/
|
||||
const u32 Te0[256] = {
|
||||
|
@ -2432,7 +2429,7 @@ const u8 rcons[] = {
|
|||
*
|
||||
* @return the number of rounds for the given cipher key size.
|
||||
*/
|
||||
#ifndef PLATFORM_FREEBSD //Baron
|
||||
#ifndef PLATFORM_FREEBSD /* Baron */
|
||||
static void rijndaelKeySetupEnc(u32 rk[/*44*/], const u8 cipherKey[])
|
||||
{
|
||||
int i;
|
||||
|
@ -2648,7 +2645,7 @@ static int omac1_aes_128(u8 *key, u8 *data, size_t data_len, u8 *mac)
|
|||
{
|
||||
return omac1_aes_128_vector(key, 1, &data, &data_len, mac);
|
||||
}
|
||||
#endif //PLATFORM_FREEBSD Baron
|
||||
#endif /* PLATFORM_FREEBSD Baron */
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
void wpa_tdls_generate_tpk(_adapter *padapter, struct sta_info *psta)
|
||||
|
@ -2809,16 +2806,16 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq,
|
|||
rx_ftie = ftie+4;
|
||||
|
||||
if (os_memcmp(mic, rx_ftie, 16) == 0) {
|
||||
//Valid MIC
|
||||
/* Valid MIC */
|
||||
return 1;
|
||||
}
|
||||
|
||||
//Invalid MIC
|
||||
/* Invalid MIC */
|
||||
DBG_88E( "[%s] Invalid MIC\n", __func__);
|
||||
return 0;
|
||||
|
||||
}
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
void rtw_use_tkipkey_handler (
|
||||
|
|
|
@ -71,7 +71,7 @@ u8 sreset_get_wifi_status(_adapter *padapter)
|
|||
}
|
||||
DBG_88E("==> %s wifi_status(0x%x)\n",__func__,status);
|
||||
|
||||
//status restore
|
||||
/* status restore */
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
return status;
|
||||
|
|
|
@ -46,9 +46,9 @@ _func_enter_;
|
|||
_rtw_spinlock_init(&psta->lock);
|
||||
_rtw_init_listhead(&psta->list);
|
||||
_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->asoc_list); */
|
||||
/* _rtw_init_listhead(&psta->sleep_list); */
|
||||
/* _rtw_init_listhead(&psta->wakeup_list); */
|
||||
|
||||
_rtw_init_queue(&psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
@ -82,11 +82,11 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
psta->under_exist_checking = 0;
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
#endif /* CONFIG_TX_MCAST2UNI */
|
||||
|
||||
psta->keep_alive_trycnt = 0;
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
#endif /* CONFIG_AP_MODE */
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
@ -111,7 +111,7 @@ _func_enter_;
|
|||
|
||||
_rtw_spinlock_init(&pstapriv->sta_hash_lock);
|
||||
|
||||
//_rtw_init_queue(&pstapriv->asoc_q);
|
||||
/* _rtw_init_queue(&pstapriv->asoc_q); */
|
||||
pstapriv->asoc_sta_count = 0;
|
||||
_rtw_init_queue(&pstapriv->sleep_q);
|
||||
_rtw_init_queue(&pstapriv->wakeup_q);
|
||||
|
@ -144,14 +144,12 @@ _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.
|
||||
#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
|
||||
pstapriv->expire_to = 3; // 3*2 = 6 sec
|
||||
pstapriv->expire_to = 3; /* 3*2 = 6 sec */
|
||||
#else
|
||||
pstapriv->expire_to = 60;// 60*2 = 120 sec = 2 min, expire after no any traffic.
|
||||
pstapriv->expire_to = 60;/* 60*2 = 120 sec = 2 min, expire after no any traffic. */
|
||||
#endif
|
||||
pstapriv->max_num_sta = NUM_STA;
|
||||
|
||||
|
@ -222,7 +220,7 @@ _func_exit_;
|
|||
}
|
||||
|
||||
|
||||
// this function is used to free the memory of lock || sema for all stainfos
|
||||
/* this function is used to free the memory of lock || sema for all stainfos */
|
||||
void rtw_mfree_all_stainfo(struct sta_priv *pstapriv );
|
||||
void rtw_mfree_all_stainfo(struct sta_priv *pstapriv )
|
||||
{
|
||||
|
@ -258,7 +256,7 @@ void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
|
|||
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
|
||||
#endif
|
||||
|
||||
rtw_mfree_all_stainfo(pstapriv); //be done before free sta_hash_lock
|
||||
rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */
|
||||
|
||||
_rtw_spinlock_free(&pstapriv->free_sta_queue.lock);
|
||||
|
||||
|
@ -362,10 +360,10 @@ _func_enter_;
|
|||
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
// Commented by Albert 2009/08/13
|
||||
// For the SMC router, the sequence number of first packet of WPS handshake will be 0.
|
||||
// In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable.
|
||||
// So, we initialize the tid_rxseq variable as the 0xffff.
|
||||
/* Commented by Albert 2009/08/13 */
|
||||
/* For the SMC router, the sequence number of first packet of WPS handshake will be 0. */
|
||||
/* In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable. */
|
||||
/* So, we initialize the tid_rxseq variable as the 0xffff. */
|
||||
|
||||
for ( i = 0; i < 16; i++ )
|
||||
{
|
||||
|
@ -385,9 +383,9 @@ _func_enter_;
|
|||
init_off_ch_timer(pstapriv->padapter, psta);
|
||||
init_handshake_timer(pstapriv->padapter, psta);
|
||||
init_tdls_alive_timer(pstapriv->padapter, psta);
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
//for A-MPDU Rx reordering buffer control
|
||||
/* for A-MPDU Rx reordering buffer control */
|
||||
for (i=0; i < 16 ; i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
@ -402,8 +400,8 @@ _func_enter_;
|
|||
preorder_ctrl->indicate_seq);
|
||||
#endif
|
||||
preorder_ctrl->wend_b= 0xffff;
|
||||
//preorder_ctrl->wsize_b = (NR_RECVBUFF-2);
|
||||
preorder_ctrl->wsize_b = 64;//64;
|
||||
/* preorder_ctrl->wsize_b = (NR_RECVBUFF-2); */
|
||||
preorder_ctrl->wsize_b = 64;/* 64; */
|
||||
|
||||
_rtw_init_queue(&preorder_ctrl->pending_recvframe_queue);
|
||||
|
||||
|
@ -411,7 +409,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
|
||||
//init for DM
|
||||
/* init for DM */
|
||||
psta->rssi_stat.UndecoratedSmoothedPWDB = (-1);
|
||||
psta->rssi_stat.UndecoratedSmoothedCCK = (-1);
|
||||
|
||||
|
@ -429,7 +427,7 @@ _func_exit_;
|
|||
}
|
||||
|
||||
|
||||
// using pstapriv->sta_hash_lock to protect
|
||||
/* using pstapriv->sta_hash_lock to protect */
|
||||
u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
|
||||
{
|
||||
int i;
|
||||
|
@ -451,48 +449,48 @@ _func_enter_;
|
|||
|
||||
pstaxmitpriv = &psta->sta_xmitpriv;
|
||||
|
||||
//rtw_list_delete(&psta->sleep_list);
|
||||
/* rtw_list_delete(&psta->sleep_list); */
|
||||
|
||||
//rtw_list_delete(&psta->wakeup_list);
|
||||
/* rtw_list_delete(&psta->wakeup_list); */
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
||||
//_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
/* _enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); */
|
||||
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
|
||||
|
||||
rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));
|
||||
|
||||
//_exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
/* _exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); */
|
||||
|
||||
|
||||
//_enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
|
||||
/* _enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); */
|
||||
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);
|
||||
|
||||
rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending));
|
||||
|
||||
//_exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
|
||||
/* _exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); */
|
||||
|
||||
|
||||
//_enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
/* _enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); */
|
||||
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
|
||||
|
||||
rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));
|
||||
|
||||
//_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
/* _exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); */
|
||||
|
||||
//_enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
|
||||
/* _enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); */
|
||||
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->be_q.sta_pending);
|
||||
|
||||
rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
|
||||
|
||||
//_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
|
||||
/* _exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); */
|
||||
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
|
@ -501,7 +499,7 @@ _func_enter_;
|
|||
pstapriv->asoc_sta_count --;
|
||||
|
||||
|
||||
// re-init sta_info; 20061114
|
||||
/* re-init sta_info; 20061114 */
|
||||
_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
|
||||
_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
|
||||
|
||||
|
@ -514,9 +512,9 @@ _func_enter_;
|
|||
_cancel_timer_ex(&psta->off_ch_timer);
|
||||
_cancel_timer_ex(&psta->alive_timer1);
|
||||
_cancel_timer_ex(&psta->alive_timer2);
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
//for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer
|
||||
/* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */
|
||||
for (i=0; i < 16 ; i++)
|
||||
{
|
||||
_irqL irqL;
|
||||
|
@ -587,7 +585,7 @@ _func_enter_;
|
|||
pstapriv->sta_dz_bitmap &=~BIT(psta->aid);
|
||||
pstapriv->tim_bitmap &=~BIT(psta->aid);
|
||||
|
||||
//rtw_indicate_sta_disassoc_event(padapter, psta);
|
||||
/* rtw_indicate_sta_disassoc_event(padapter, psta); */
|
||||
|
||||
if ((psta->aid >0)&&(pstapriv->sta_aid[psta->aid - 1] == psta))
|
||||
{
|
||||
|
@ -595,13 +593,13 @@ _func_enter_;
|
|||
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_TX_MCAST2UNI */
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
#endif /* CONFIG_AP_MODE */
|
||||
|
||||
_enter_critical_bh(&(pfree_sta_queue->lock), &irqL0);
|
||||
rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue));
|
||||
|
@ -615,7 +613,7 @@ _func_exit_;
|
|||
|
||||
}
|
||||
|
||||
// free all stainfo which in sta_hash[all]
|
||||
/* free all stainfo which in sta_hash[all] */
|
||||
void rtw_free_all_stainfo(_adapter *padapter)
|
||||
{
|
||||
_irqL irqL;
|
||||
|
@ -701,7 +699,7 @@ _func_enter_;
|
|||
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== true)
|
||||
{ // if found the matched address
|
||||
{ /* if found the matched address */
|
||||
break;
|
||||
}
|
||||
psta=NULL;
|
||||
|
@ -722,7 +720,7 @@ u32 rtw_init_bcmc_stainfo(_adapter* padapter)
|
|||
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_;
|
||||
|
||||
|
@ -734,7 +732,7 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
|
||||
// default broadcast & multicast use macid 1
|
||||
/* default broadcast & multicast use macid 1 */
|
||||
psta->mac_id = 1;
|
||||
|
||||
exit:
|
||||
|
@ -786,11 +784,11 @@ u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr)
|
|||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
|
||||
|
||||
if (pacl_list->mode == 1)//accept unless in deny list
|
||||
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
|
||||
else if (pacl_list->mode == 2)/* deny unless in accept list */
|
||||
{
|
||||
res = (match == true) ? true:false;
|
||||
}
|
||||
|
|
537
core/rtw_tdls.c
537
core/rtw_tdls.c
File diff suppressed because it is too large
Load diff
|
@ -44,7 +44,7 @@ unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
|
|||
extern unsigned char MCS_rate_2R[16];
|
||||
#ifdef CONFIG_DISABLE_MCS13TO15
|
||||
extern unsigned char MCS_rate_2R_MCS13TO15_OFF[16];
|
||||
#endif //CONFIG_DISABLE_MCS13TO15
|
||||
#endif /* CONFIG_DISABLE_MCS13TO15 */
|
||||
extern unsigned char MCS_rate_1R[16];
|
||||
extern unsigned char RTW_WPA_OUI[];
|
||||
extern unsigned char WPA_TKIP_CIPHER[4];
|
||||
|
@ -52,7 +52,7 @@ extern unsigned char RSN_TKIP_CIPHER[4];
|
|||
|
||||
#define R2T_PHY_DELAY (0)
|
||||
|
||||
//#define WAIT_FOR_BCN_TO_M (3000)
|
||||
/* define WAIT_FOR_BCN_TO_M (3000) */
|
||||
#define WAIT_FOR_BCN_TO_MIN (6000)
|
||||
#define WAIT_FOR_BCN_TO_MAX (20000)
|
||||
|
||||
|
@ -314,7 +314,7 @@ void UpdateBrateTbl(PADAPTER Adapter, u8 *mBratesOS)
|
|||
u8 i;
|
||||
u8 rate;
|
||||
|
||||
// 1M, 2M, 5.5M, 11M, 6M, 12M, 24M are mandatory.
|
||||
/* 1M, 2M, 5.5M, 11M, 6M, 12M, 24M are mandatory. */
|
||||
for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) {
|
||||
rate = mBratesOS[i] & 0x7f;
|
||||
switch (rate) {
|
||||
|
@ -487,17 +487,17 @@ void SelectChannel(_adapter *padapter, unsigned char channel)
|
|||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
//saved channel info
|
||||
/* saved channel info */
|
||||
rtw_set_oper_ch(padapter, channel);
|
||||
dc_SelectChannel(padapter, channel);
|
||||
#else //CONFIG_DUALMAC_CONCURRENT
|
||||
#else /* CONFIG_DUALMAC_CONCURRENT */
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_enter_critical_mutex(padapter->psetch_mutex, NULL);
|
||||
#endif
|
||||
|
||||
//saved channel info
|
||||
/* saved channel info */
|
||||
rtw_set_oper_ch(padapter, channel);
|
||||
|
||||
rtw_hal_set_chan(padapter, channel);
|
||||
|
@ -507,7 +507,7 @@ void SelectChannel(_adapter *padapter, unsigned char channel)
|
|||
_exit_critical_mutex(padapter->psetch_mutex, NULL);
|
||||
#endif
|
||||
|
||||
#endif // CONFIG_DUALMAC_CONCURRENT
|
||||
#endif /* CONFIG_DUALMAC_CONCURRENT */
|
||||
}
|
||||
|
||||
void SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_offset)
|
||||
|
@ -515,17 +515,17 @@ void SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_
|
|||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
//saved bw info
|
||||
/* saved bw info */
|
||||
rtw_set_oper_bw(padapter, bwmode);
|
||||
rtw_set_oper_choffset(padapter, channel_offset);
|
||||
dc_SetBWMode(padapter, bwmode, channel_offset);
|
||||
#else //CONFIG_DUALMAC_CONCURRENT
|
||||
#else /* CONFIG_DUALMAC_CONCURRENT */
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_enter_critical_mutex(padapter->psetbw_mutex, NULL);
|
||||
#endif
|
||||
|
||||
//saved bw info
|
||||
/* saved bw info */
|
||||
rtw_set_oper_bw(padapter, bwmode);
|
||||
rtw_set_oper_choffset(padapter, channel_offset);
|
||||
|
||||
|
@ -535,7 +535,7 @@ void SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_
|
|||
_exit_critical_mutex(padapter->psetbw_mutex, NULL);
|
||||
#endif
|
||||
|
||||
#endif // CONFIG_DUALMAC_CONCURRENT
|
||||
#endif /* CONFIG_DUALMAC_CONCURRENT */
|
||||
}
|
||||
|
||||
void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char channel_offset, unsigned short bwmode)
|
||||
|
@ -550,50 +550,50 @@ void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char
|
|||
|
||||
if ((bwmode == HT_CHANNEL_WIDTH_20)||(channel_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE))
|
||||
{
|
||||
//SelectChannel(padapter, channel);
|
||||
/* SelectChannel(padapter, channel); */
|
||||
center_ch = channel;
|
||||
}
|
||||
else
|
||||
{
|
||||
//switch to the proper channel
|
||||
/* switch to the proper channel */
|
||||
if (channel_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
|
||||
{
|
||||
//SelectChannel(padapter, channel + 2);
|
||||
/* SelectChannel(padapter, channel + 2); */
|
||||
center_ch = channel + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
//SelectChannel(padapter, channel - 2);
|
||||
/* SelectChannel(padapter, channel - 2); */
|
||||
center_ch = channel - 2;
|
||||
}
|
||||
}
|
||||
|
||||
//set Channel
|
||||
/* set Channel */
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
//saved channel/bw info
|
||||
/* saved channel/bw info */
|
||||
rtw_set_oper_ch(padapter, channel);
|
||||
rtw_set_oper_bw(padapter, bwmode);
|
||||
rtw_set_oper_choffset(padapter, channel_offset);
|
||||
dc_SelectChannel(padapter, center_ch);// set center channel
|
||||
#else //CONFIG_DUALMAC_CONCURRENT
|
||||
dc_SelectChannel(padapter, center_ch);/* set center channel */
|
||||
#else /* CONFIG_DUALMAC_CONCURRENT */
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_enter_critical_mutex(padapter->psetch_mutex, NULL);
|
||||
#endif
|
||||
|
||||
//saved channel/bw info
|
||||
/* saved channel/bw info */
|
||||
rtw_set_oper_ch(padapter, channel);
|
||||
rtw_set_oper_bw(padapter, bwmode);
|
||||
rtw_set_oper_choffset(padapter, channel_offset);
|
||||
|
||||
rtw_hal_set_chan(padapter, center_ch); // set center channel
|
||||
rtw_hal_set_chan(padapter, center_ch); /* set center channel */
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_exit_critical_mutex(padapter->psetch_mutex, NULL);
|
||||
#endif
|
||||
|
||||
#endif // CONFIG_DUALMAC_CONCURRENT
|
||||
#endif /* CONFIG_DUALMAC_CONCURRENT */
|
||||
|
||||
|
||||
SetBWMode(padapter, bwmode, channel_offset);
|
||||
|
@ -745,12 +745,12 @@ void write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key)
|
|||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_WRITE, (u8 *)cam_val);
|
||||
|
||||
//rtw_write32(padapter, WCAMI, val);
|
||||
/* rtw_write32(padapter, WCAMI, val); */
|
||||
|
||||
//cmd = CAM_POLLINIG | CAM_WRITE | (addr + j);
|
||||
//rtw_write32(padapter, RWCAM, cmd);
|
||||
/* cmd = CAM_POLLINIG | CAM_WRITE | (addr + j); */
|
||||
/* rtw_write32(padapter, RWCAM, cmd); */
|
||||
|
||||
//DBG_88E("%s=> cam write: %x, %x\n",__func__, cmd, val);
|
||||
/* DBG_88E("%s=> cam write: %x, %x\n",__func__, cmd, val); */
|
||||
|
||||
}
|
||||
|
||||
|
@ -792,7 +792,7 @@ void flush_all_cam_entry(_adapter *padapter)
|
|||
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
//if (check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_))
|
||||
/* if (check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_)) */
|
||||
if (check_buddy_fwstate(padapter, _FW_LINKED) == false)
|
||||
{
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
|
||||
|
@ -803,32 +803,32 @@ void flush_all_cam_entry(_adapter *padapter)
|
|||
{
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
u8 cam_id;//cam_entry
|
||||
u8 cam_id;/* cam_entry */
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress);
|
||||
if (psta) {
|
||||
if (psta->state & WIFI_AP_STATE)
|
||||
{} //clear cam when ap free per sta_info
|
||||
{} /* clear cam when ap free per sta_info */
|
||||
else {
|
||||
if (psta->mac_id==2)
|
||||
cam_id = 5;
|
||||
else
|
||||
cam_id = 4;
|
||||
}
|
||||
//clear_cam_entry(padapter, cam_id);
|
||||
/* clear_cam_entry(padapter, cam_id); */
|
||||
rtw_clearstakey_cmd(padapter, (u8*)psta, cam_id, false);
|
||||
}
|
||||
}
|
||||
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
|
||||
{
|
||||
//clear cam when ap free per sta_info
|
||||
/* clear cam when ap free per sta_info */
|
||||
}
|
||||
}
|
||||
#else //CONFIG_CONCURRENT_MODE
|
||||
#else /* CONFIG_CONCURRENT_MODE */
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, NULL);
|
||||
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
#endif /* CONFIG_CONCURRENT_MODE */
|
||||
|
||||
_rtw_memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info));
|
||||
|
||||
|
@ -872,7 +872,7 @@ int WFD_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
|
||||
int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
||||
{
|
||||
//struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
/* struct registry_priv *pregpriv = &padapter->registrypriv; */
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
@ -886,27 +886,6 @@ int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
pmlmeinfo->WMM_enable = 1;
|
||||
_rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element));
|
||||
return true;
|
||||
|
||||
/*if (pregpriv->wifi_spec == 1)
|
||||
{
|
||||
if (pmlmeinfo->WMM_enable == 1)
|
||||
{
|
||||
//todo: compare the parameter set count & decide wheher to update or not
|
||||
return _FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
pmlmeinfo->WMM_enable = 1;
|
||||
_rtw_rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pmlmeinfo->WMM_enable = 0;
|
||||
return _FAIL;
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
void WMMOnAssocRsp(_adapter *padapter)
|
||||
|
@ -937,7 +916,7 @@ void WMMOnAssocRsp(_adapter *padapter)
|
|||
ACI = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >> 5) & 0x03;
|
||||
ACM = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >> 4) & 0x01;
|
||||
|
||||
//AIFS = AIFSN * slot time + SIFS - r2t phy delay
|
||||
/* AIFS = AIFSN * slot time + SIFS - r2t phy delay */
|
||||
AIFS = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN & 0x0f) * pmlmeinfo->slotTime + aSifsTime;
|
||||
|
||||
ECWMin = (pmlmeinfo->WMM_param.ac_param[i].CW & 0x0f);
|
||||
|
@ -955,7 +934,7 @@ void WMMOnAssocRsp(_adapter *padapter)
|
|||
|
||||
case 0x1:
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acParm));
|
||||
//acm_mask |= (ACM? BIT(0):0);
|
||||
/* acm_mask |= (ACM? BIT(0):0); */
|
||||
edca[XMIT_BK_QUEUE] = acParm;
|
||||
break;
|
||||
|
||||
|
@ -986,19 +965,19 @@ void WMMOnAssocRsp(_adapter *padapter)
|
|||
{
|
||||
u32 j, tmp, change_inx;
|
||||
|
||||
//entry indx: 0->vo, 1->vi, 2->be, 3->bk.
|
||||
/* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */
|
||||
for (i=0; i<4; i++)
|
||||
{
|
||||
for (j=i+1; j<4; j++)
|
||||
{
|
||||
//compare CW and AIFS
|
||||
/* compare CW and AIFS */
|
||||
if ((edca[j] & 0xFFFF) < (edca[i] & 0xFFFF))
|
||||
{
|
||||
change_inx = true;
|
||||
}
|
||||
else if ((edca[j] & 0xFFFF) == (edca[i] & 0xFFFF))
|
||||
{
|
||||
//compare TXOP
|
||||
/* compare TXOP */
|
||||
if ((edca[j] >> 16) > (edca[i] >> 16))
|
||||
change_inx = true;
|
||||
}
|
||||
|
@ -1082,7 +1061,7 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
|
|||
pmlmeext->cur_bwmode = new_bwmode;
|
||||
pmlmeext->cur_ch_offset = new_ch_offset;
|
||||
|
||||
//update HT info also
|
||||
/* update HT info also */
|
||||
HT_info_handler(padapter, pIE);
|
||||
}
|
||||
else
|
||||
|
@ -1097,10 +1076,10 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
|
|||
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
//set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
/* set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); */
|
||||
|
||||
|
||||
//update ap's stainfo
|
||||
/* update ap's stainfo */
|
||||
psta = rtw_get_stainfo(pstapriv, cur_network->MacAddress);
|
||||
if (psta)
|
||||
{
|
||||
|
@ -1108,7 +1087,7 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
|
|||
|
||||
if (phtpriv_sta->ht_option)
|
||||
{
|
||||
// bwmode
|
||||
/* bwmode */
|
||||
phtpriv_sta->bwmode = pmlmeext->cur_bwmode;
|
||||
phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset;
|
||||
}
|
||||
|
@ -1117,13 +1096,9 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
|
|||
phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_20;
|
||||
phtpriv_sta->ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//pmlmeinfo->bwmode_updated = false;//bwmode_updated done, reset it!
|
||||
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
}
|
||||
|
||||
void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
||||
|
@ -1148,13 +1123,13 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
{
|
||||
if (i != 2)
|
||||
{
|
||||
// Commented by Albert 2010/07/12
|
||||
// Got the endian issue here.
|
||||
/* Commented by Albert 2010/07/12 */
|
||||
/* Got the endian issue here. */
|
||||
pmlmeinfo->HT_caps.u.HT_cap[i] &= (pIE->data[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
//modify from fw by Thomas 2010/11/17
|
||||
/* modify from fw by Thomas 2010/11/17 */
|
||||
if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (pIE->data[i] & 0x3))
|
||||
{
|
||||
max_AMPDU_len = (pIE->data[i] & 0x3);
|
||||
|
@ -1179,7 +1154,7 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
|
||||
//update the MCS rates
|
||||
/* update the MCS rates */
|
||||
for (i = 0; i < 16; i++) {
|
||||
if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R)) {
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
|
||||
|
@ -1191,13 +1166,13 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i];
|
||||
#else
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i];
|
||||
#endif //CONFIG_DISABLE_MCS13TO15
|
||||
#endif /* CONFIG_DISABLE_MCS13TO15 */
|
||||
}
|
||||
#ifdef RTL8192C_RECONFIG_TO_1T1R
|
||||
pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
|
||||
#endif
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1219,7 +1194,7 @@ void HT_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
|
||||
pmlmeinfo->HT_info_enable = 1;
|
||||
_rtw_memcpy(&(pmlmeinfo->HT_info), pIE->data, pIE->Length);
|
||||
#endif //CONFIG_80211N_HT
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1227,7 +1202,7 @@ void HTOnAssocRsp(_adapter *padapter)
|
|||
{
|
||||
unsigned char max_AMPDU_len;
|
||||
unsigned char min_MPDU_spacing;
|
||||
//struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
/* struct registry_priv *pregpriv = &padapter->registrypriv; */
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
|
@ -1240,11 +1215,11 @@ void HTOnAssocRsp(_adapter *padapter)
|
|||
else
|
||||
{
|
||||
pmlmeinfo->HT_enable = 0;
|
||||
//set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
/* set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); */
|
||||
return;
|
||||
}
|
||||
|
||||
//handle A-MPDU parameter field
|
||||
/* handle A-MPDU parameter field */
|
||||
/*
|
||||
AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k
|
||||
AMPDU_para [4:2]:Min MPDU Start Spacing
|
||||
|
@ -1278,12 +1253,12 @@ void VCS_update(_adapter *padapter, struct sta_info *psta)
|
|||
|
||||
switch (pregpriv->vrtl_carrier_sense)/* 0:off 1:on 2:auto */
|
||||
{
|
||||
case 0: //off
|
||||
case 0: /* off */
|
||||
psta->rtsen = 0;
|
||||
psta->cts2self = 0;
|
||||
break;
|
||||
|
||||
case 1: //on
|
||||
case 1: /* on */
|
||||
if (pregpriv->vcs_type == 1) /* 1:RTS/CTS 2:CTS to self */
|
||||
{
|
||||
psta->rtsen = 1;
|
||||
|
@ -1296,7 +1271,7 @@ void VCS_update(_adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
break;
|
||||
|
||||
case 2: //auto
|
||||
case 2: /* auto */
|
||||
default:
|
||||
if ((pmlmeinfo->ERP_enable) && (pmlmeinfo->ERP_IE & BIT(1)))
|
||||
{
|
||||
|
@ -1323,7 +1298,7 @@ void VCS_update(_adapter *padapter, struct sta_info *psta)
|
|||
#ifdef CONFIG_TDLS
|
||||
int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len)
|
||||
{
|
||||
u8 tdls_prohibited_bit = 0x40; //bit(38); TDLS_prohibited
|
||||
u8 tdls_prohibited_bit = 0x40; /* bit(38); TDLS_prohibited */
|
||||
|
||||
if (pkt_len < 5)
|
||||
{
|
||||
|
@ -1336,7 +1311,7 @@ int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len)
|
|||
|
||||
return false;
|
||||
}
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
||||
{
|
||||
|
@ -1344,7 +1319,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
unsigned char *p;
|
||||
unsigned short val16, subtype;
|
||||
struct wlan_network *cur_network = &(Adapter->mlmepriv.cur_network);
|
||||
//u8 wpa_ie[255],rsn_ie[255];
|
||||
/* u8 wpa_ie[255],rsn_ie[255]; */
|
||||
u16 wpa_len=0,rsn_len=0;
|
||||
u8 encryp_protocol = 0;
|
||||
WLAN_BSSID_EX *bssid;
|
||||
|
@ -1414,12 +1389,12 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
cur_network->BcnInfo.ht_cap_info, cur_network->BcnInfo.ht_info_infos_0);
|
||||
DBG_88E("%s bw mode change, disconnect\n", __func__);
|
||||
{
|
||||
//bcn_info_update
|
||||
/* bcn_info_update */
|
||||
cur_network->BcnInfo.ht_cap_info = ht_cap_info;
|
||||
cur_network->BcnInfo.ht_info_infos_0 = ht_info_infos_0;
|
||||
//to do : need to check that whether modify related register of BB or not
|
||||
/* to do : need to check that whether modify related register of BB or not */
|
||||
}
|
||||
//goto _mismatch;
|
||||
/* goto _mismatch; */
|
||||
}
|
||||
|
||||
/* Checking for channel */
|
||||
|
@ -1555,8 +1530,8 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
|
|||
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
u8 tdls_prohibited[] = { 0x00, 0x00, 0x00, 0x00, 0x10 }; //bit(38): TDLS_prohibited
|
||||
#endif //CONFIG_TDLS
|
||||
u8 tdls_prohibited[] = { 0x00, 0x00, 0x00, 0x00, 0x10 }; /* bit(38): TDLS_prohibited */
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN);
|
||||
|
||||
|
@ -1566,8 +1541,8 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
|
|||
|
||||
switch (pIE->ElementID)
|
||||
{
|
||||
case _HT_EXTRA_INFO_IE_: //HT info
|
||||
//HT_info_handler(padapter, pIE);
|
||||
case _HT_EXTRA_INFO_IE_: /* HT info */
|
||||
/* HT_info_handler(padapter, pIE); */
|
||||
bwmode_update_check(padapter, pIE);
|
||||
break;
|
||||
|
||||
|
@ -1581,7 +1556,7 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
|
|||
if ( check_ap_tdls_prohibited(pIE->data, pIE->Length) == true )
|
||||
ptdlsinfo->ap_prohibited = true;
|
||||
break;
|
||||
#endif //CONFIG_TDLS
|
||||
#endif /* CONFIG_TDLS */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1618,7 +1593,7 @@ void process_csa_ie(_adapter *padapter, u8 *pframe, uint pkt_len)
|
|||
i += (pIE->Length + 2);
|
||||
}
|
||||
}
|
||||
#endif //CONFIG_DFS
|
||||
#endif /* CONFIG_DFS */
|
||||
|
||||
unsigned int is_ap_in_tkip(_adapter *padapter)
|
||||
{
|
||||
|
@ -1917,27 +1892,27 @@ void enable_rate_adaptive(_adapter *padapter, u32 mac_id)
|
|||
|
||||
void set_sta_rate(_adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
//rate adaptive
|
||||
/* rate adaptive */
|
||||
enable_rate_adaptive(padapter, psta->mac_id);
|
||||
}
|
||||
|
||||
// Update RRSR and Rate for USERATE
|
||||
/* Update RRSR and Rate for USERATE */
|
||||
void update_tx_basic_rate(_adapter *padapter, u8 wirelessmode)
|
||||
{
|
||||
NDIS_802_11_RATES_EX supported_rates;
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info* pwdinfo = &padapter->wdinfo;
|
||||
|
||||
// Added by Albert 2011/03/22
|
||||
// In the P2P mode, the driver should not support the b mode.
|
||||
// So, the Tx packet shouldn't use the CCK rate
|
||||
/* Added by Albert 2011/03/22 */
|
||||
/* In the P2P mode, the driver should not support the b mode. */
|
||||
/* So, the Tx packet shouldn't use the CCK rate */
|
||||
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
#endif //CONFIG_P2P
|
||||
#endif /* CONFIG_P2P */
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
if (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_NONE)
|
||||
return;
|
||||
#endif //CONFIG_INTEL_WIDI
|
||||
#endif /* CONFIG_INTEL_WIDI */
|
||||
|
||||
_rtw_memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX);
|
||||
|
||||
|
@ -2063,13 +2038,13 @@ void update_IOT_info(_adapter *padapter)
|
|||
case HT_IOT_PEER_RALINK:
|
||||
pmlmeinfo->turboMode_cts2self = 0;
|
||||
pmlmeinfo->turboMode_rtsen = 1;
|
||||
//disable high power
|
||||
/* disable high power */
|
||||
Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false);
|
||||
break;
|
||||
case HT_IOT_PEER_REALTEK:
|
||||
//rtw_write16(padapter, 0x4cc, 0xffff);
|
||||
//rtw_write16(padapter, 0x546, 0x01c0);
|
||||
//disable high power
|
||||
/* rtw_write16(padapter, 0x4cc, 0xffff); */
|
||||
/* rtw_write16(padapter, 0x546, 0x01c0); */
|
||||
/* disable high power */
|
||||
Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false);
|
||||
break;
|
||||
default:
|
||||
|
@ -2086,14 +2061,14 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
|
|||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
bool ShortPreamble;
|
||||
|
||||
// Check preamble mode, 2005.01.06, by rcnjko.
|
||||
// Mark to update preamble value forever, 2008.03.18 by lanhsin
|
||||
//if ( pMgntInfo->RegPreambleMode == PREAMBLE_AUTO )
|
||||
/* Check preamble mode, 2005.01.06, by rcnjko. */
|
||||
/* Mark to update preamble value forever, 2008.03.18 by lanhsin */
|
||||
/* if ( pMgntInfo->RegPreambleMode == PREAMBLE_AUTO ) */
|
||||
{
|
||||
|
||||
if (updateCap & cShortPreamble)
|
||||
{ // Short Preamble
|
||||
if (pmlmeinfo->preamble_mode != PREAMBLE_SHORT) // PREAMBLE_LONG or PREAMBLE_AUTO
|
||||
{ /* Short Preamble */
|
||||
if (pmlmeinfo->preamble_mode != PREAMBLE_SHORT) /* PREAMBLE_LONG or PREAMBLE_AUTO */
|
||||
{
|
||||
ShortPreamble = true;
|
||||
pmlmeinfo->preamble_mode = PREAMBLE_SHORT;
|
||||
|
@ -2101,8 +2076,8 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // Long Preamble
|
||||
if (pmlmeinfo->preamble_mode != PREAMBLE_LONG) // PREAMBLE_SHORT or PREAMBLE_AUTO
|
||||
{ /* Long Preamble */
|
||||
if (pmlmeinfo->preamble_mode != PREAMBLE_LONG) /* PREAMBLE_SHORT or PREAMBLE_AUTO */
|
||||
{
|
||||
ShortPreamble = false;
|
||||
pmlmeinfo->preamble_mode = PREAMBLE_LONG;
|
||||
|
@ -2112,23 +2087,23 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
|
|||
}
|
||||
|
||||
if ( updateCap & cIBSS ) {
|
||||
//Filen: See 802.11-2007 p.91
|
||||
/* Filen: See 802.11-2007 p.91 */
|
||||
pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Filen: See 802.11-2007 p.90
|
||||
/* Filen: See 802.11-2007 p.90 */
|
||||
if ( pmlmeext->cur_wireless_mode & (WIRELESS_11G | WIRELESS_11_24N))
|
||||
{
|
||||
if ( (updateCap & cShortSlotTime) /* && (!(pMgntInfo->pHTInfo->RT2RT_HT_Mode & RT_HT_CAP_USE_LONG_PREAMBLE)) */)
|
||||
{ // Short Slot Time
|
||||
{ /* Short Slot Time */
|
||||
if (pmlmeinfo->slotTime != SHORT_SLOT_TIME)
|
||||
{
|
||||
pmlmeinfo->slotTime = SHORT_SLOT_TIME;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // Long Slot Time
|
||||
{ /* Long Slot Time */
|
||||
if (pmlmeinfo->slotTime != NON_SHORT_SLOT_TIME)
|
||||
{
|
||||
pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
|
||||
|
@ -2141,7 +2116,7 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
|
|||
}
|
||||
else
|
||||
{
|
||||
//B Mode
|
||||
/* B Mode */
|
||||
pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
|
||||
}
|
||||
}
|
||||
|
@ -2197,16 +2172,9 @@ void update_wireless_mode(_adapter *padapter)
|
|||
}
|
||||
|
||||
pmlmeext->cur_wireless_mode = network_type & padapter->registrypriv.wireless_mode;
|
||||
/*
|
||||
if ((pmlmeext->cur_wireless_mode==WIRELESS_11G) ||
|
||||
(pmlmeext->cur_wireless_mode==WIRELESS_11BG))//WIRELESS_MODE_G)
|
||||
SIFS_Timer = 0x0a0a;//CCK
|
||||
else
|
||||
SIFS_Timer = 0x0e0e;//pHalData->SifsTime; //OFDM
|
||||
*/
|
||||
|
||||
SIFS_Timer = 0x0a0a0808; //0x0808 -> for CCK, 0x0a0a -> for OFDM
|
||||
//change this value if having IOT issues.
|
||||
SIFS_Timer = 0x0a0a0808; /* 0x0808 -> for CCK, 0x0a0a -> for OFDM */
|
||||
/* change this value if having IOT issues. */
|
||||
|
||||
padapter->HalFunc.SetHwRegHandler( padapter, HW_VAR_RESP_SIFS, (u8 *)&SIFS_Timer);
|
||||
|
||||
|
@ -2223,7 +2191,7 @@ void update_bmc_sta_support_rate(_adapter *padapter, u32 mac_id)
|
|||
|
||||
if (pmlmeext->cur_wireless_mode & WIRELESS_11B)
|
||||
{
|
||||
// Only B, B/G, and B/G/N AP could use CCK rate
|
||||
/* Only B, B/G, and B/G/N AP could use CCK rate */
|
||||
_rtw_memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_cck, 4);
|
||||
}
|
||||
else
|
||||
|
@ -2338,19 +2306,19 @@ int rtw_handle_dualmac(_adapter *adapter, bool init)
|
|||
} else {
|
||||
adapter->pbuddy_adapter = pbuddy_padapter;
|
||||
pbuddy_padapter->pbuddy_adapter = adapter;
|
||||
// clear global value
|
||||
/* clear global value */
|
||||
pbuddy_padapter = NULL;
|
||||
DBG_88E("%s(): pbuddy_padapter exist, Exchange Information\n",__func__);
|
||||
}
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
if (dvobj->InterfaceNumber == 0) {
|
||||
//set adapter_type/iface type
|
||||
/* set adapter_type/iface type */
|
||||
adapter->isprimary = true;
|
||||
adapter->adapter_type = PRIMARY_ADAPTER;
|
||||
adapter->iface_type = IFACE_PORT0;
|
||||
DBG_88E("%s(): PRIMARY_ADAPTER\n",__func__);
|
||||
} else {
|
||||
//set adapter_type/iface type
|
||||
/* set adapter_type/iface type */
|
||||
adapter->isprimary = false;
|
||||
adapter->adapter_type = SECONDARY_ADAPTER;
|
||||
adapter->iface_type = IFACE_PORT1;
|
||||
|
|
520
core/rtw_xmit.c
520
core/rtw_xmit.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue