mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2025-12-10 00:04:17 +00:00
Updated to v4.3.8_12406.20140929
This commit is contained in:
@@ -247,7 +247,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
||||
if (len >= 8) {
|
||||
mac = scan_tlv(&data[8], len-8, 1, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
DBG_871X("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
@@ -259,7 +259,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
||||
if (len >= 16) {
|
||||
mac = scan_tlv(&data[16], len-16, 1, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
DBG_871X("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
@@ -271,7 +271,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
||||
if (len >= 24) {
|
||||
mac = scan_tlv(&data[24], len-24, 1, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
DBG_871X("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
@@ -283,7 +283,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
||||
if (len >= 24) {
|
||||
mac = scan_tlv(&data[24], len-24, 2, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
DBG_871X("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
@@ -295,7 +295,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
||||
if (len >= 40) {
|
||||
mac = scan_tlv(&data[40], len-40, 2, 1);
|
||||
if (mac) {
|
||||
_DEBUG_INFO("Redirect, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
DBG_871X("Redirect, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
|
||||
replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
|
||||
memcpy(mac, replace_mac, 6);
|
||||
@@ -439,7 +439,7 @@ static int __nat25_db_network_lookup_and_replace(_adapter *priv,
|
||||
atomic_inc(&db->use_count);
|
||||
|
||||
#ifdef CL_IPV6_PASS
|
||||
DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
|
||||
DBG_871X("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
|
||||
"%02x%02x%02x%02x%02x%02x\n",
|
||||
db->macAddr[0],
|
||||
db->macAddr[1],
|
||||
@@ -465,7 +465,7 @@ static int __nat25_db_network_lookup_and_replace(_adapter *priv,
|
||||
db->networkAddr[15],
|
||||
db->networkAddr[16]);
|
||||
#else
|
||||
DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
|
||||
DBG_871X("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
|
||||
db->macAddr[0],
|
||||
db->macAddr[1],
|
||||
db->macAddr[2],
|
||||
@@ -815,7 +815,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
//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);
|
||||
DBG_871X("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
|
||||
__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
|
||||
@@ -826,7 +826,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
case NAT25_LOOKUP:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Lookup IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr);
|
||||
DBG_871X("NAT25: Lookup IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr);
|
||||
#ifdef SUPPORT_TX_MCAST2UNI
|
||||
if (priv->pshare->rf_ft_var.mc2u_disable ||
|
||||
((((OPMODE & (WIFI_STATION_STATE|WIFI_ASOC_STATE))
|
||||
@@ -840,12 +840,12 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
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
|
||||
DEBUG_INFO("NAT25: Set DA as boardcast\n");
|
||||
DBG_871X("NAT25: Set DA as boardcast\n");
|
||||
memset(skb->data, 0xff, ETH_ALEN);
|
||||
}
|
||||
else {
|
||||
// forward unknow IP packet to upper TCP/IP
|
||||
DEBUG_INFO("NAT25: Replace DA with BR's MAC\n");
|
||||
DBG_871X("NAT25: Replace DA with BR's MAC\n");
|
||||
if ( (*(u32 *)priv->br_mac) == 0 && (*(u16 *)(priv->br_mac+4)) == 0 ) {
|
||||
void netdev_br_init(struct net_device *netdev);
|
||||
printk("Re-init netdev_br_init() due to br_mac==0!\n");
|
||||
@@ -885,7 +885,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
case NAT25_INSERT:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Insert ARP, MAC=%02x%02x%02x%02x%02x%02x\n", arp_ptr[0],
|
||||
DBG_871X("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
|
||||
@@ -904,7 +904,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
case NAT25_LOOKUP:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Lookup ARP\n");
|
||||
DBG_871X("NAT25: Lookup ARP\n");
|
||||
|
||||
arp_ptr += arp->ar_hln;
|
||||
sender = (unsigned int *)arp_ptr;
|
||||
@@ -930,8 +930,9 @@ 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 == __constant_htons(ETH_P_IPX)) ||
|
||||
(protocol == __constant_htons(ETH_P_ATALK)) ||
|
||||
(protocol == __constant_htons(ETH_P_AARP)))
|
||||
{
|
||||
unsigned char ipx_header[2] = {0xFF, 0xFF};
|
||||
struct ipxhdr *ipx = NULL;
|
||||
@@ -941,14 +942,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
if(protocol == __constant_htons(ETH_P_IPX))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet II)\n");
|
||||
DBG_871X("NAT25: Protocol=IPX (Ethernet II)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
}
|
||||
else if(protocol <= __constant_htons(ETH_FRAME_LEN))
|
||||
else //if(protocol <= __constant_htons(ETH_FRAME_LEN))
|
||||
{
|
||||
if(!memcmp(ipx_header, framePtr, 2))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.3)\n");
|
||||
DBG_871X("NAT25: Protocol=IPX (Ethernet 802.3)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
}
|
||||
else
|
||||
@@ -968,7 +969,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
{
|
||||
framePtr += 5; // eliminate the SNAP header
|
||||
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet SNAP)\n");
|
||||
DBG_871X("NAT25: Protocol=IPX (Ethernet SNAP)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
}
|
||||
else if(!memcmp(aarp_snap_id, framePtr, 5))
|
||||
@@ -996,18 +997,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
if(!memcmp(ipx_header, framePtr, 2))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.2)\n");
|
||||
DBG_871X("NAT25: Protocol=IPX (Ethernet 802.2)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
|
||||
/* IPX */
|
||||
if(ipx != NULL)
|
||||
@@ -1017,14 +1014,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
case NAT25_CHECK:
|
||||
if(!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Check IPX skb_copy\n");
|
||||
DBG_871X("NAT25: Check IPX skb_copy\n");
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
|
||||
case NAT25_INSERT:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Insert IPX, Dest=%08x,%02x%02x%02x%02x%02x%02x,%04x Source=%08x,%02x%02x%02x%02x%02x%02x,%04x\n",
|
||||
DBG_871X("NAT25: Insert IPX, Dest=%08x,%02x%02x%02x%02x%02x%02x,%04x Source=%08x,%02x%02x%02x%02x%02x%02x,%04x\n",
|
||||
ipx->ipx_dest.net,
|
||||
ipx->ipx_dest.node[0],
|
||||
ipx->ipx_dest.node[1],
|
||||
@@ -1044,7 +1041,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
if(!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Use IPX Net, and Socket as network addr\n");
|
||||
DBG_871X("NAT25: Use IPX Net, and Socket as network addr\n");
|
||||
|
||||
__nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_source.net, &ipx->ipx_source.sock);
|
||||
|
||||
@@ -1066,7 +1063,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
{
|
||||
if(!memcmp(GET_MY_HWADDR(priv), ipx->ipx_dest.node, ETH_ALEN))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Lookup IPX, Modify Destination IPX Node addr\n");
|
||||
DBG_871X("NAT25: Lookup IPX, Modify Destination IPX Node addr\n");
|
||||
|
||||
__nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_dest.net, &ipx->ipx_dest.sock);
|
||||
|
||||
@@ -1109,7 +1106,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
// 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",
|
||||
DBG_871X("NAT25: Insert AARP, Source=%d,%d Destination=%d,%d\n",
|
||||
ea->pa_src_net,
|
||||
ea->pa_src_node,
|
||||
ea->pa_dst_net,
|
||||
@@ -1125,7 +1122,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
case NAT25_LOOKUP:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Lookup AARP, Source=%d,%d Destination=%d,%d\n",
|
||||
DBG_871X("NAT25: Lookup AARP, Source=%d,%d Destination=%d,%d\n",
|
||||
ea->pa_src_net,
|
||||
ea->pa_src_node,
|
||||
ea->pa_dst_net,
|
||||
@@ -1155,7 +1152,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
case NAT25_INSERT:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Insert DDP, Source=%d,%d Destination=%d,%d\n",
|
||||
DBG_871X("NAT25: Insert DDP, Source=%d,%d Destination=%d,%d\n",
|
||||
ddp->deh_snet,
|
||||
ddp->deh_snode,
|
||||
ddp->deh_dnet,
|
||||
@@ -1171,7 +1168,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
case NAT25_LOOKUP:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Lookup DDP, Source=%d,%d Destination=%d,%d\n",
|
||||
DBG_871X("NAT25: Lookup DDP, Source=%d,%d Destination=%d,%d\n",
|
||||
ddp->deh_snet,
|
||||
ddp->deh_snode,
|
||||
ddp->deh_dnet,
|
||||
@@ -1248,7 +1245,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
if(__nat25_add_pppoe_tag(skb, tag) < 0)
|
||||
return -1;
|
||||
|
||||
DEBUG_INFO("NAT25: Insert PPPoE, forward %s packet\n",
|
||||
DBG_871X("NAT25: Insert PPPoE, forward %s packet\n",
|
||||
(ph->code == PADI_CODE ? "PADI" : "PADR"));
|
||||
}
|
||||
else { // not add relay tag
|
||||
@@ -1269,7 +1266,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
}
|
||||
else // session phase
|
||||
{
|
||||
DEBUG_INFO("NAT25: Insert PPPoE, insert session packet to %s\n", skb->dev->name);
|
||||
DBG_871X("NAT25: Insert PPPoE, insert session packet to %s\n", skb->dev->name);
|
||||
|
||||
__nat25_generate_pppoe_network_addr(networkAddr, skb->data, &(ph->sid));
|
||||
|
||||
@@ -1327,7 +1324,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
if (offset > 0)
|
||||
tag->tag_len = htons(tagLen-MAGIC_CODE_LEN-RTL_RELAY_TAG_LEN);
|
||||
|
||||
DEBUG_INFO("NAT25: Lookup PPPoE, forward %s Packet from %s\n",
|
||||
DBG_871X("NAT25: Lookup PPPoE, forward %s Packet from %s\n",
|
||||
(ph->code == PADO_CODE ? "PADO" : "PADS"), skb->dev->name);
|
||||
}
|
||||
else { // not add relay tag
|
||||
@@ -1342,7 +1339,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
else {
|
||||
if(ph->sid != 0)
|
||||
{
|
||||
DEBUG_INFO("NAT25: Lookup PPPoE, lookup session packet from %s\n", skb->dev->name);
|
||||
DBG_871X("NAT25: Lookup PPPoE, lookup session packet from %s\n", skb->dev->name);
|
||||
__nat25_generate_pppoe_network_addr(networkAddr, skb->data+ETH_ALEN, &(ph->sid));
|
||||
|
||||
__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
|
||||
@@ -1426,7 +1423,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
case NAT25_INSERT:
|
||||
{
|
||||
DEBUG_INFO("NAT25: Insert IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
|
||||
DBG_871X("NAT25: Insert IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3],
|
||||
iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7],
|
||||
@@ -1455,7 +1452,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
return 0;
|
||||
|
||||
case NAT25_LOOKUP:
|
||||
DEBUG_INFO("NAT25: Lookup IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
|
||||
DBG_871X("NAT25: Lookup IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
|
||||
" DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
|
||||
iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3],
|
||||
iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7],
|
||||
@@ -1571,7 +1568,7 @@ void mac_clone(_adapter *priv, unsigned char *addr)
|
||||
struct sockaddr sa;
|
||||
|
||||
memcpy(sa.sa_data, addr, ETH_ALEN);
|
||||
DEBUG_INFO("MAC Clone: Addr=%02x%02x%02x%02x%02x%02x\n",
|
||||
DBG_871X("MAC Clone: Addr=%02x%02x%02x%02x%02x%02x\n",
|
||||
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
|
||||
rtl8192cd_set_hwaddr(priv->dev, &sa);
|
||||
}
|
||||
@@ -1650,7 +1647,7 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
|
||||
{
|
||||
register int sum = 0;
|
||||
|
||||
DEBUG_INFO("DHCP: change flag of DHCP request to broadcast.\n");
|
||||
DBG_871X("DHCP: change flag of DHCP request to broadcast.\n");
|
||||
// or BROADCAST flag
|
||||
dhcph->flags |= htons(BROADCAST_FLAG);
|
||||
// recalculate checksum
|
||||
|
||||
Reference in New Issue
Block a user