staging: rtl8188eu: Remove code implementing NAT
cover staging: rtl8188eu: Remove code implementing NAT
Driver has code which does Network address translation (NAT), and i don't see how this code is useful for driver.
navin patidar (9):
staging: rtl8188eu: Remove function rtw_br_client_tx()
staging: rtl8188eu: Remove unused functons defined in rtw_br_ext.c
staging: rtl8188eu: Remove function nat25_db_cleanup()
staging: rtl8188eu: Remove pppoe_connection_in_progress from struct
adapter
staging: rtl8188eu: Remove function nat25_db_expire()
staging: rtl8188eu: Remove function netdev_br_init()
staging: rtl8188eu: core: Remove file rtw_br_ext.c
staging: rtl8188eu: Remove unused members of struct adapter
staging: rtl8188eu: Remove file rtw_br_ext.h
drivers/staging/rtl8188eu/Makefile | 1 - drivers/staging/rtl8188eu/core/rtw_br_ext.c | 1118 ------------------------ drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 +- drivers/staging/rtl8188eu/core/rtw_mlme.c | 18 - drivers/staging/rtl8188eu/core/rtw_xmit.c | 135 --- drivers/staging/rtl8188eu/include/drv_types.h | 10 - drivers/staging/rtl8188eu/include/rtw_br_ext.h | 66 -- drivers/staging/rtl8188eu/include/usb_osintf.h | 3 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 31 - 9 files changed, 1 insertion(+), 1385 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/core/rtw_br_ext.c delete mode 100644 drivers/staging/rtl8188eu/include/rtw_br_ext.h
--
1.7.10.4
PATCH 1/9 staging: rtl8188eu: Remove function rtw_br_client_tx()
rtw_br_client_tx() pass tx packet to functions responsible for building NAT table.
--- drivers/staging/rtl8188eu/core/rtw_xmit.c | 135 ----------------------------- 1 file changed, 135 deletions(-)
drivers/staging/rtl8188eu/core/rtw_xmit.c +0 -135
@@ -1676,127 +1676,6 @@ void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry) phwxmit->accnt =0 ; } -static int rtw_br_client_tx (struct adapter *padapter,struct sk_buff **pskb) -{ -struct sk_buff *skb = *pskb; -int res, is_vlan_tag =0 , i, do_nat25 =1 ; -unsigned short vlan_hdr =0 ; -void *br_port =NULL ; - -rcu_read_lock (); - br_port =rcu_dereference (padapter->pnetdev->rx_handler_data); -rcu_read_unlock (); -spin_lock_bh (&padapter->br_ext_lock); -if (!(skb->data[0 ] &1 ) && br_port && -memcmp (skb->data+MACADDRLEN , padapter->br_mac,MACADDRLEN ) && - *((__be16 *)(skb->data+MACADDRLEN *2 )) !=__constant_htons (ETH_P_8021Q ) && - *((__be16 *)(skb->data+MACADDRLEN *2 )) ==__constant_htons (ETH_P_IP ) && - !memcmp (padapter->scdb_mac, skb->data+MACADDRLEN ,MACADDRLEN ) && padapter->scdb_entry) { -memcpy (skb->data+MACADDRLEN ,GET_MY_HWADDR (padapter),MACADDRLEN ); - padapter->scdb_entry->ageing_timer = jiffies; -spin_unlock_bh (&padapter->br_ext_lock); - }else { -if (*((__be16 *)(skb->data+MACADDRLEN *2 )) ==__constant_htons (ETH_P_8021Q )) { - is_vlan_tag =1 ; - vlan_hdr = *((unsigned short *)(skb->data+MACADDRLEN *2 +2 )); -for (i =0 ; i <6 ; i++) - *((unsigned short *)(skb->data+MACADDRLEN *2 +2 -i*2 )) = *((unsigned short *)(skb->data+MACADDRLEN *2 -2 -i*2 )); -skb_pull (skb,4 ); - } -if (!memcmp (skb->data+MACADDRLEN , padapter->br_mac,MACADDRLEN ) && - (*((__be16 *)(skb->data+MACADDRLEN *2 )) ==__constant_htons (ETH_P_IP ))) -memcpy (padapter->br_ip, skb->data+WLAN_ETHHDR_LEN +12 ,4 ); - -if (*((__be16 *)(skb->data+MACADDRLEN *2 )) ==__constant_htons (ETH_P_IP )) { -if (memcmp (padapter->scdb_mac, skb->data+MACADDRLEN ,MACADDRLEN )) { - padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry (padapter, - skb->data+MACADDRLEN , skb->data+WLAN_ETHHDR_LEN +12 ); -if (padapter->scdb_entry) { -memcpy (padapter->scdb_mac, skb->data+MACADDRLEN ,MACADDRLEN ); -memcpy (padapter->scdb_ip, skb->data+WLAN_ETHHDR_LEN +12 ,4 ); - padapter->scdb_entry->ageing_timer = jiffies; - do_nat25 =0 ; - } - }else { -if (padapter->scdb_entry) { - padapter->scdb_entry->ageing_timer = jiffies; - do_nat25 =0 ; - }else { -memset (padapter->scdb_mac,0 ,MACADDRLEN ); -memset (padapter->scdb_ip,0 ,4 ); - } - } - } -spin_unlock_bh (&padapter->br_ext_lock); -if (do_nat25) { -if (nat25_db_handle (padapter, skb,NAT25_CHECK ) ==0 ) { -struct sk_buff *newskb; - -if (is_vlan_tag) { -skb_push (skb,4 ); -for (i =0 ; i <6 ; i++) - *((unsigned short *)(skb->data+i*2 )) = *((unsigned short *)(skb->data+4 +i*2 )); - *((__be16 *)(skb->data+MACADDRLEN *2 )) =__constant_htons (ETH_P_8021Q ); - *((unsigned short *)(skb->data+MACADDRLEN *2 +2 )) = vlan_hdr; - } - - newskb =skb_copy (skb,GFP_ATOMIC ); -if (newskb ==NULL ) { -DEBUG_ERR ("TX DROP: skb_copy fail!\n" ); -return -1 ; - } -dev_kfree_skb_any (skb); - - *pskb = skb = newskb; -if (is_vlan_tag) { - vlan_hdr = *((unsigned short *)(skb->data+MACADDRLEN *2 +2 )); -for (i =0 ; i <6 ; i++) - *((unsigned short *)(skb->data+MACADDRLEN *2 +2 -i*2 )) = *((unsigned short *)(skb->data+MACADDRLEN *2 -2 -i*2 )); -skb_pull (skb,4 ); - } - } - -if (skb_is_nonlinear (skb)) -DEBUG_ERR ("%s(): skb_is_nonlinear!!\n" , __func__); - - res =skb_linearize (skb); -if (res <0 ) { -DEBUG_ERR ("TX DROP: skb_linearize fail!\n" ); -return -1 ; - } - - res =nat25_db_handle (padapter, skb,NAT25_INSERT ); -if (res <0 ) { -if (res ==-2 ) { -DEBUG_ERR ("TX DROP: nat25_db_handle fail!\n" ); -return -1 ; - } -return 0 ; - } - } - -memcpy (skb->data+MACADDRLEN ,GET_MY_HWADDR (padapter),MACADDRLEN ); - -dhcp_flag_bcast (padapter, skb); - -if (is_vlan_tag) { -skb_push (skb,4 ); -for (i =0 ; i <6 ; i++) - *((unsigned short *)(skb->data+i*2 )) = *((unsigned short *)(skb->data+4 +i*2 )); - *((__be16 *)(skb->data+MACADDRLEN *2 )) =__constant_htons (ETH_P_8021Q ); - *((unsigned short *)(skb->data+MACADDRLEN *2 +2 )) = vlan_hdr; - } - } - -/* check if SA is equal to our MAC */ -if (memcmp (skb->data+MACADDRLEN ,GET_MY_HWADDR (padapter),MACADDRLEN )) { -DEBUG_ERR ("TX DROP: untransformed frame SA:%02X%02X%02X%02X%02X%02X!\n" , - skb->data[6 ], skb->data[7 ], skb->data[8 ], skb->data[9 ], skb->data[10 ], skb->data[11 ]); -return -1 ; - } -return 0 ; -} -u32 rtw_get_ff_hwaddr (struct xmit_frame *pxmitframe) {u32 addr;
@@ -1856,8 +1735,6 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt) {struct xmit_priv *pxmitpriv = &padapter->xmitpriv;struct xmit_frame *pxmitframe =NULL ; -struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -void *br_port =NULL ;s32 res; pxmitframe =rtw_alloc_xmitframe (pxmitpriv);
@@ -1867,18 +1744,6 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)return -1 ; } -rcu_read_lock (); - br_port =rcu_dereference (padapter->pnetdev->rx_handler_data); -rcu_read_unlock (); - -if (br_port &&check_fwstate (pmlmepriv,WIFI_STATION_STATE |WIFI_ADHOC_STATE )) { - res =rtw_br_client_tx (padapter, ppkt); -if (res ==-1 ) { -rtw_free_xmitframe (pxmitpriv, pxmitframe); -return -1 ; - } - } - res =update_attrib (padapter, *ppkt, &pxmitframe->attrib);if (res == _FAIL) {
Signature · 1 line
1.7.10.4
PATCH 2/9 staging: rtl8188eu: Remove unused functons defined in rtw_br_ext.c
In reply to navin patidarThis patch removes some functions defined in rtw_br_ext.c, which have become obsolete after removal of rtw_br_client_tx().
--- drivers/staging/rtl8188eu/core/rtw_br_ext.c | 727 ------------------------ drivers/staging/rtl8188eu/include/usb_osintf.h | 1 - 2 files changed, 728 deletions(-)
drivers/staging/rtl8188eu/core/rtw_br_ext.c +0 -727
@@ -103,27 +103,6 @@ static inline int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *treturn data_len; } -static int skb_pull_and_merge (struct sk_buff *skb,unsigned char *src,int len) -{ -int tail_len; -unsigned long end, tail; - -if ((src+len) >skb_tail_pointer (skb) || skb->len < len) -return -1 ; - - tail = (unsigned long )skb_tail_pointer (skb); - end = (unsigned long )src+len; -if (tail < end) -return -1 ; - - tail_len = (int )(tail-end); -if (tail_len >0 ) -memmove (src, src+len, tail_len); - -skb_trim (skb, skb->len-len); -return 0 ; -} -static inline unsigned long __nat25_timeout (struct adapter *priv) {unsigned long timeout;
@@ -196,91 +175,6 @@ static inline void __nat25_generate_pppoe_network_addr(unsigned char *networkAddmemcpy (networkAddr+3 , (unsigned char *)ac_mac,6 ); } -static void __nat25_generate_ipv6_network_addr (unsigned char *networkAddr, -__be32 *ipAddr) -{ -memset (networkAddr,0 ,MAX_NETWORK_ADDR_LEN ); - - networkAddr[0 ] =NAT25_IPV6 ; -memcpy (networkAddr+1 , (unsigned char *)ipAddr,16 ); -} - -static unsigned char *scan_tlv (unsigned char *data,int len,unsigned char tag,unsigned char len8b) -{ -while (len >0 ) { -if (*data == tag && *(data+1 ) == len8b && len >= len8b*8 ) -return data+2 ; - - len -= (*(data+1 ))*8 ; - data += (*(data+1 ))*8 ; - } -return NULL ; -} - -static int update_nd_link_layer_addr (unsigned char *data,int len,unsigned char *replace_mac) -{ -struct icmp6hdr *icmphdr = (struct icmp6hdr *)data; -unsigned char *mac; - -if (icmphdr->icmp6_type ==NDISC_ROUTER_SOLICITATION ) { -if (len >=8 ) { - mac =scan_tlv (&data[8 ], len-8 ,1 ,1 ); -if (mac) { -_DEBUG_INFO ("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n" , - mac[0 ], mac[1 ], mac[2 ], mac[3 ], mac[4 ], mac[5 ], - replace_mac[0 ], replace_mac[1 ], replace_mac[2 ], replace_mac[3 ], replace_mac[4 ], replace_mac[5 ]); -memcpy (mac, replace_mac,6 ); -return 1 ; - } - } - }else if (icmphdr->icmp6_type ==NDISC_ROUTER_ADVERTISEMENT ) { -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" , - mac[0 ], mac[1 ], mac[2 ], mac[3 ], mac[4 ], mac[5 ], - replace_mac[0 ], replace_mac[1 ], replace_mac[2 ], replace_mac[3 ], replace_mac[4 ], replace_mac[5 ]); -memcpy (mac, replace_mac,6 ); -return 1 ; - } - } - }else if (icmphdr->icmp6_type ==NDISC_NEIGHBOUR_SOLICITATION ) { -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" , - mac[0 ], mac[1 ], mac[2 ], mac[3 ], mac[4 ], mac[5 ], - replace_mac[0 ], replace_mac[1 ], replace_mac[2 ], replace_mac[3 ], replace_mac[4 ], replace_mac[5 ]); -memcpy (mac, replace_mac,6 ); -return 1 ; - } - } - }else if (icmphdr->icmp6_type ==NDISC_NEIGHBOUR_ADVERTISEMENT ) { -if (len >=24 ) { - mac =scan_tlv (&data[24 ], len-24 ,2 ,1 ); -if (mac) { -_DEBUG_INFO ("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n" , - mac[0 ], mac[1 ], mac[2 ], mac[3 ], mac[4 ], mac[5 ], - replace_mac[0 ], replace_mac[1 ], replace_mac[2 ], replace_mac[3 ], replace_mac[4 ], replace_mac[5 ]); -memcpy (mac, replace_mac,6 ); -return 1 ; - } - } - }else if (icmphdr->icmp6_type ==NDISC_REDIRECT ) { -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" , - mac[0 ], mac[1 ], mac[2 ], mac[3 ], mac[4 ], mac[5 ], - replace_mac[0 ], replace_mac[1 ], replace_mac[2 ], replace_mac[3 ], replace_mac[4 ], replace_mac[5 ]); -memcpy (mac, replace_mac,6 ); -return 1 ; - } - } - } -return 0 ; -} -static inline int __nat25_network_hash (unsigned char *networkAddr) {if (networkAddr[0 ] ==NAT25_IPV4 ) {
@@ -349,88 +243,6 @@ static inline void __network_hash_unlink(struct nat25_network_db_entry *ent) ent->pprev_hash =NULL ; } -static int __nat25_db_network_lookup_and_replace (struct adapter *priv, -struct sk_buff *skb,unsigned char *networkAddr) -{ -struct nat25_network_db_entry *db; -spin_lock_bh (&priv->br_ext_lock); - - db = priv->nethash[__nat25_network_hash (networkAddr)]; -while (db !=NULL ) { -if (!memcmp (db->networkAddr, networkAddr,MAX_NETWORK_ADDR_LEN )) { -if (!__nat25_has_expired (priv, db)) { -/* replace the destination mac address */ -memcpy (skb->data, db->macAddr,ETH_ALEN ); -atomic_inc (&db->use_count); - -DEBUG_INFO ("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" -"%02x%02x%02x%02x%02x%02x\n" , - db->macAddr[0 ], - db->macAddr[1 ], - db->macAddr[2 ], - db->macAddr[3 ], - db->macAddr[4 ], - db->macAddr[5 ], - db->networkAddr[0 ], - db->networkAddr[1 ], - db->networkAddr[2 ], - db->networkAddr[3 ], - db->networkAddr[4 ], - db->networkAddr[5 ], - db->networkAddr[6 ], - db->networkAddr[7 ], - db->networkAddr[8 ], - db->networkAddr[9 ], - db->networkAddr[10 ], - db->networkAddr[11 ], - db->networkAddr[12 ], - db->networkAddr[13 ], - db->networkAddr[14 ], - db->networkAddr[15 ], - db->networkAddr[16 ]); - } -spin_unlock_bh (&priv->br_ext_lock); -return 1 ; - } - db = db->next_hash; - } -spin_unlock_bh (&priv->br_ext_lock); -return 0 ; -} - -static void __nat25_db_network_insert (struct adapter *priv, -unsigned char *macAddr,unsigned char *networkAddr) -{ -struct nat25_network_db_entry *db; -int hash; - -spin_lock_bh (&priv->br_ext_lock); - hash =__nat25_network_hash (networkAddr); - db = priv->nethash[hash]; -while (db !=NULL ) { -if (!memcmp (db->networkAddr, networkAddr,MAX_NETWORK_ADDR_LEN )) { -ether_addr_copy (db->macAddr, macAddr); - db->ageing_timer = jiffies; -spin_unlock_bh (&priv->br_ext_lock); -return ; - } - db = db->next_hash; - } - db = (struct nat25_network_db_entry *)rtw_malloc (sizeof (*db)); -if (db ==NULL ) { -spin_unlock_bh (&priv->br_ext_lock); -return ; - } -memcpy (db->networkAddr, networkAddr,MAX_NETWORK_ADDR_LEN ); -ether_addr_copy (db->macAddr, macAddr); -atomic_set (&db->use_count,1 ); - db->ageing_timer = jiffies; - -__network_hash_link (priv, db, hash); - -spin_unlock_bh (&priv->br_ext_lock); -} -/* * NAT2.5 interface */
@@ -491,545 +303,6 @@ void nat25_db_expire(struct adapter *priv)spin_unlock_bh (&priv->br_ext_lock); } -int nat25_db_handle (struct 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 ; - -if ((method <=NAT25_MIN ) || (method >=NAT25_MAX )) -return -1 ; - - protocol =be16_to_cpu (*((__be16 *)(skb->data +2 *ETH_ALEN ))); - -/*---------------------------------------------------*/ -/* Handle IP frame */ -/*---------------------------------------------------*/ -if (protocol ==ETH_P_IP ) { -struct iphdr *iph = (struct iphdr *)(skb->data +ETH_HLEN ); - -if (((unsigned char *)(iph) + (iph->ihl<<2 )) >= (skb->data +ETH_HLEN + skb->len)) { -DEBUG_WARN ("NAT25: malformed IP packet !\n" ); -return -1 ; - } - -switch (method) { -case NAT25_CHECK : -return -1 ; -case NAT25_INSERT : -/* some multicast 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 ; - 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); - -return 0 ; -case NAT25_LOOKUP : -DEBUG_INFO ("NAT25: Lookup IP, SA =%08x, DA =%08x\n" , iph->saddr, 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 */ -DEBUG_INFO ("NAT25: Set DA as broadcast\n" ); -memset (skb->data,0xff ,ETH_ALEN ); - }else { -/* forward unknown 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 ) { -netdev_info (skb->dev, -"Re-init netdev_br_init() due to br_mac == 0!\n" ); -netdev_br_init (priv->pnetdev); - } -memcpy (skb->data, priv->br_mac,ETH_ALEN ); - } - } -return 0 ; -default : -return -1 ; - } - }else if (protocol ==ETH_P_ARP ) { -/*---------------------------------------------------*/ -/* Handle ARP frame */ -/*---------------------------------------------------*/ -struct arphdr *arp = (struct arphdr *)(skb->data +ETH_HLEN ); -unsigned char *arp_ptr = (unsigned char *)(arp +1 ); -unsigned int *sender, *target; - -if (arp->ar_pro !=__constant_htons (ETH_P_IP )) { -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 */ -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 */ -memcpy (arp_ptr,GET_MY_HWADDR (priv),ETH_ALEN ); - arp_ptr += arp->ar_hln; - sender = (unsigned int *)arp_ptr; -__nat25_generate_ipv4_network_addr (networkAddr, sender); -__nat25_db_network_insert (priv, skb->data+ETH_ALEN , networkAddr); -return 0 ; -case NAT25_LOOKUP : -DEBUG_INFO ("NAT25: Lookup ARP\n" ); - - arp_ptr += arp->ar_hln; - sender = (unsigned int *)arp_ptr; - arp_ptr += (arp->ar_hln + arp->ar_pln); - target = (unsigned int *)arp_ptr; -__nat25_generate_ipv4_network_addr (networkAddr, target); -__nat25_db_network_lookup_and_replace (priv, skb, networkAddr); -/* 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 ); -return 0 ; -default : -return -1 ; - } - }else if ((protocol ==ETH_P_IPX ) || - (protocol <=ETH_FRAME_LEN )) { -/*---------------------------------------------------*/ -/* Handle IPX and Apple Talk frame */ -/*---------------------------------------------------*/ -unsigned char ipx_header[2 ] = {0xFF ,0xFF }; -struct ipxhdr *ipx =NULL ; -struct elapaarp *ea =NULL ; -struct ddpehdr *ddp =NULL ; -unsigned char *framePtr = skb->data +ETH_HLEN ; - -if (protocol ==ETH_P_IPX ) { -DEBUG_INFO ("NAT25: Protocol = IPX (Ethernet II)\n" ); - ipx = (struct ipxhdr *)framePtr; - }else if (protocol <=ETH_FRAME_LEN ) { -if (!memcmp (ipx_header, framePtr,2 )) { -DEBUG_INFO ("NAT25: Protocol = IPX (Ethernet 802.3)\n" ); - ipx = (struct ipxhdr *)framePtr; - }else { -unsigned char ipx_8022_type =0xE0 ; -unsigned char snap_8022_type =0xAA ; - -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 */ - - framePtr +=3 ;/* eliminate the 802.2 header */ - -if (!memcmp (ipx_snap_id, framePtr,5 )) { - 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 */ - - ea = (struct elapaarp *)framePtr; - }else if (!memcmp (ddp_snap_id, framePtr,5 )) { - framePtr +=5 ;/* eliminate the SNAP header */ - - ddp = (struct ddpehdr *)framePtr; - }else { -DEBUG_WARN ("NAT25: Protocol = Ethernet SNAP %02x%02x%02x%02x%02x\n" , framePtr[0 ], - framePtr[1 ], framePtr[2 ], framePtr[3 ], framePtr[4 ]); -return -1 ; - } - }else if (*framePtr == ipx_8022_type) { - framePtr +=3 ;/* eliminate the 802.2 header */ - -if (!memcmp (ipx_header, framePtr,2 )) { -DEBUG_INFO ("NAT25: Protocol = IPX (Ethernet 802.2)\n" ); - ipx = (struct ipxhdr *)framePtr; - }else { -return -1 ; - } - }else { -return -1 ; - } - } - }else { -return -1 ; - } - -/* IPX */ -if (ipx !=NULL ) { -switch (method) { -case NAT25_CHECK : -if (!memcmp (skb->data+ETH_ALEN , ipx->ipx_source.node,ETH_ALEN )) -DEBUG_INFO ("NAT25: Check IPX skb_copy\n" ); -return 0 ; -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" , - ipx->ipx_dest.net, - ipx->ipx_dest.node[0 ], - ipx->ipx_dest.node[1 ], - ipx->ipx_dest.node[2 ], - ipx->ipx_dest.node[3 ], - ipx->ipx_dest.node[4 ], - ipx->ipx_dest.node[5 ], - ipx->ipx_dest.sock, - ipx->ipx_source.net, - ipx->ipx_source.node[0 ], - ipx->ipx_source.node[1 ], - ipx->ipx_source.node[2 ], - ipx->ipx_source.node[3 ], - ipx->ipx_source.node[4 ], - ipx->ipx_source.node[5 ], - ipx->ipx_source.sock); - -if (!memcmp (skb->data+ETH_ALEN , ipx->ipx_source.node,ETH_ALEN )) { -DEBUG_INFO ("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); - -/* change IPX source node addr to wlan STA address */ -memcpy (ipx->ipx_source.node,GET_MY_HWADDR (priv),ETH_ALEN ); - }else { -__nat25_generate_ipx_network_addr_with_node (networkAddr, &ipx->ipx_source.net, ipx->ipx_source.node); - } -__nat25_db_network_insert (priv, skb->data+ETH_ALEN , networkAddr); -return 0 ; -case NAT25_LOOKUP : -if (!memcmp (GET_MY_HWADDR (priv), ipx->ipx_dest.node,ETH_ALEN )) { -DEBUG_INFO ("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); - -__nat25_db_network_lookup_and_replace (priv, skb, networkAddr); - -/* replace IPX destination node addr with Lookup destination MAC addr */ -memcpy (ipx->ipx_dest.node, skb->data,ETH_ALEN ); - }else { -__nat25_generate_ipx_network_addr_with_node (networkAddr, &ipx->ipx_dest.net, ipx->ipx_dest.node); - -__nat25_db_network_lookup_and_replace (priv, skb, networkAddr); - } -return 0 ; -default : -return -1 ; - } - }else if (ea !=NULL ) { -/* Sanity check fields. */ -if (ea->hw_len !=ETH_ALEN || ea->pa_len !=AARP_PA_ALEN ) { -DEBUG_WARN ("NAT25: Appletalk AARP Sanity check fail!\n" ); -return -1 ; - } - -switch (method) { -case NAT25_CHECK : -return 0 ; -case NAT25_INSERT : -/* 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" , - ea->pa_src_net, - ea->pa_src_node, - ea->pa_dst_net, - ea->pa_dst_node); - -__nat25_generate_apple_network_addr (networkAddr, &ea->pa_src_net, &ea->pa_src_node); - -__nat25_db_network_insert (priv, skb->data+ETH_ALEN , networkAddr); - -return 0 ; -case NAT25_LOOKUP : -DEBUG_INFO ("NAT25: Lookup AARP, Source =%d,%d Destination =%d,%d\n" , - ea->pa_src_net, - ea->pa_src_node, - ea->pa_dst_net, - ea->pa_dst_node); - -__nat25_generate_apple_network_addr (networkAddr, &ea->pa_dst_net, &ea->pa_dst_node); - -__nat25_db_network_lookup_and_replace (priv, skb, networkAddr); - -/* change to AARP destination mac address to Lookup result */ -memcpy (ea->hw_dst, skb->data,ETH_ALEN ); -return 0 ; -default : -return -1 ; - } - }else if (ddp !=NULL ) { -switch (method) { -case NAT25_CHECK : -return -1 ; -case NAT25_INSERT : -DEBUG_INFO ("NAT25: Insert DDP, Source =%d,%d Destination =%d,%d\n" , - ddp->deh_snet, - ddp->deh_snode, - ddp->deh_dnet, - ddp->deh_dnode); - -__nat25_generate_apple_network_addr (networkAddr, &ddp->deh_snet, &ddp->deh_snode); - -__nat25_db_network_insert (priv, skb->data+ETH_ALEN , networkAddr); - -return 0 ; -case NAT25_LOOKUP : -DEBUG_INFO ("NAT25: Lookup DDP, Source =%d,%d Destination =%d,%d\n" , - ddp->deh_snet, - ddp->deh_snode, - ddp->deh_dnet, - ddp->deh_dnode); -__nat25_generate_apple_network_addr (networkAddr, &ddp->deh_dnet, &ddp->deh_dnode); -__nat25_db_network_lookup_and_replace (priv, skb, networkAddr); -return 0 ; -default : -return -1 ; - } - } - -return -1 ; - }else if ((protocol ==ETH_P_PPP_DISC ) || - (protocol ==ETH_P_PPP_SES )) { -/*---------------------------------------------------*/ -/* Handle PPPoE frame */ -/*---------------------------------------------------*/ -struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data +ETH_HLEN ); -__be16 *pMagic; - -switch (method) { -case NAT25_CHECK : -if (ph->sid ==0 ) -return 0 ; -return 1 ; -case NAT25_INSERT : -if (ph->sid ==0 ) {/* Discovery phase according to tag */ -if (ph->code ==PADI_CODE || ph->code ==PADR_CODE ) { -if (priv->ethBrExtInfo.addPPPoETag) { -struct pppoe_tag *tag, *pOldTag; -unsigned char tag_buf[40 ]; -int old_tag_len =0 ; - - 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 */ - 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" ); -return -1 ; - } - -memcpy (tag->tag_data+MAGIC_CODE_LEN +RTL_RELAY_TAG_LEN , - pOldTag->tag_data, old_tag_len); - -if (skb_pull_and_merge (skb, (unsigned char *)pOldTag,TAG_HDR_LEN +old_tag_len) <0 ) { -DEBUG_ERR ("call skb_pull_and_merge() failed in PADI/R packet!\n" ); -return -1 ; - } - ph->length =htons (ntohs (ph->length)-TAG_HDR_LEN -old_tag_len); - } - - 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 */ - pMagic = (__be16 *)tag->tag_data; - *pMagic =htons (MAGIC_CODE ); -memcpy (tag->tag_data+MAGIC_CODE_LEN , skb->data+ETH_ALEN ,ETH_ALEN ); - -/* 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 */ -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" ); -return -2 ; - } - -if (priv->pppoe_connection_in_progress ==0 ) -memcpy (priv->pppoe_addr, skb->data+ETH_ALEN ,ETH_ALEN ); - - priv->pppoe_connection_in_progress =WAIT_TIME_PPPOE ; - } - }else { -return -1 ; - } - }else {/* session phase */ -DEBUG_INFO ("NAT25: Insert PPPoE, insert session packet to %s\n" , skb->dev->name); - -__nat25_generate_pppoe_network_addr (networkAddr, skb->data, &(ph->sid)); - -__nat25_db_network_insert (priv, skb->data+ETH_ALEN , networkAddr); - - -if (!priv->ethBrExtInfo.addPPPoETag && - priv->pppoe_connection_in_progress && - !memcmp (skb->data+ETH_ALEN , priv->pppoe_addr,ETH_ALEN )) - priv->pppoe_connection_in_progress =0 ; - } -return 0 ; -case NAT25_LOOKUP : -if (ph->code ==PADO_CODE || ph->code ==PADS_CODE ) { -if (priv->ethBrExtInfo.addPPPoETag) { -struct pppoe_tag *tag; -unsigned char *ptr; -unsigned short tagType, tagLen; -int offset =0 ; - - ptr =__nat25_find_pppoe_tag (ph,ntohs (PTT_RELAY_SID )); -if (ptr ==NULL ) { -DEBUG_ERR ("Fail to find PTT_RELAY_SID in FADO!\n" ); -return -1 ; - } - - tag = (struct pppoe_tag *)ptr; - tagType = (unsigned short )((ptr[0 ] <<8 ) + ptr[1 ]); - tagLen = (unsigned short )((ptr[2 ] <<8 ) + ptr[3 ]); - -if ((tagType !=ntohs (PTT_RELAY_SID )) || (tagLen < (MAGIC_CODE_LEN +RTL_RELAY_TAG_LEN ))) { -DEBUG_ERR ("Invalid PTT_RELAY_SID tag length [%d]!\n" , tagLen); -return -1 ; - } - - pMagic = (__be16 *)tag->tag_data; -if (ntohs (*pMagic) !=MAGIC_CODE ) { -DEBUG_ERR ("Can't find MAGIC_CODE in %s packet!\n" , - (ph->code ==PADO_CODE ?"PADO" :"PADS" )); -return -1 ; - } - -memcpy (skb->data, tag->tag_data+MAGIC_CODE_LEN ,ETH_ALEN ); - -if (tagLen >MAGIC_CODE_LEN +RTL_RELAY_TAG_LEN ) - offset =TAG_HDR_LEN ; - -if (skb_pull_and_merge (skb, ptr+offset,TAG_HDR_LEN +MAGIC_CODE_LEN +RTL_RELAY_TAG_LEN -offset) <0 ) { -DEBUG_ERR ("call skb_pull_and_merge() failed in PADO packet!\n" ); -return -1 ; - } - ph->length =htons (ntohs (ph->length)-(TAG_HDR_LEN +MAGIC_CODE_LEN +RTL_RELAY_TAG_LEN -offset)); -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" , - (ph->code ==PADO_CODE ?"PADO" :"PADS" ), skb->dev->name); - }else {/* not add relay tag */ -if (!priv->pppoe_connection_in_progress) { -DEBUG_ERR ("Discard PPPoE packet due to no connection in progress!\n" ); -return -1 ; - } -memcpy (skb->data, priv->pppoe_addr,ETH_ALEN ); - priv->pppoe_connection_in_progress =WAIT_TIME_PPPOE ; - } - }else { -if (ph->sid !=0 ) { -DEBUG_INFO ("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); - }else { -return -1 ; - } - } -return 0 ; -default : -return -1 ; - } - }else if (protocol ==0x888e ) { -/*---------------------------------------------------*/ -/* Handle EAP frame */ -/*---------------------------------------------------*/ -switch (method) { -case NAT25_CHECK : -return -1 ; -case NAT25_INSERT : -return 0 ; -case NAT25_LOOKUP : -return 0 ; -default : -return -1 ; - } - }else if ((protocol ==0xe2ae ) || (protocol ==0xe2af )) { -/*---------------------------------------------------*/ -/* Handle C-Media proprietary frame */ -/*---------------------------------------------------*/ -switch (method) { -case NAT25_CHECK : -return -1 ; -case NAT25_INSERT : -return 0 ; -case NAT25_LOOKUP : -return 0 ; -default : -return -1 ; - } - }else if (protocol ==ETH_P_IPV6 ) { -/*------------------------------------------------*/ -/* Handle IPV6 frame */ -/*------------------------------------------------*/ -struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data +ETH_HLEN ); - -if (sizeof (*iph) >= (skb->len -ETH_HLEN )) { -DEBUG_WARN ("NAT25: malformed IPv6 packet !\n" ); -return -1 ; - } - -switch (method) { -case NAT25_CHECK : -if (skb->data[0 ] &1 ) -return 0 ; -return -1 ; -case NAT25_INSERT : -DEBUG_INFO ("NAT25: Insert IP, SA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x," -" DA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n" , - iph->saddr.s6_addr16[0 ], iph->saddr.s6_addr16[1 ], iph->saddr.s6_addr16[2 ], iph->saddr.s6_addr16[3 ], - iph->saddr.s6_addr16[4 ], iph->saddr.s6_addr16[5 ], iph->saddr.s6_addr16[6 ], iph->saddr.s6_addr16[7 ], - iph->daddr.s6_addr16[0 ], iph->daddr.s6_addr16[1 ], iph->daddr.s6_addr16[2 ], iph->daddr.s6_addr16[3 ], - iph->daddr.s6_addr16[4 ], iph->daddr.s6_addr16[5 ], iph->daddr.s6_addr16[6 ], iph->daddr.s6_addr16[7 ]); - -if (memcmp (&iph->saddr,"\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0" ,16 )) { -__nat25_generate_ipv6_network_addr (networkAddr, (__be32 *)&iph->saddr); -__nat25_db_network_insert (priv, skb->data+ETH_ALEN , networkAddr); - -if (iph->nexthdr ==IPPROTO_ICMPV6 && - skb->len > (ETH_HLEN +sizeof (*iph) +4 )) { -if (update_nd_link_layer_addr (skb->data +ETH_HLEN +sizeof (*iph), - skb->len -ETH_HLEN -sizeof (*iph),GET_MY_HWADDR (priv))) { -struct icmp6hdr *hdr = (struct icmp6hdr *)(skb->data +ETH_HLEN +sizeof (*iph)); - hdr->icmp6_cksum =0 ; - hdr->icmp6_cksum =csum_ipv6_magic (&iph->saddr, &iph->daddr, -be16_to_cpu (iph->payload_len), -IPPROTO_ICMPV6 , -csum_partial ((__u8 *)hdr, -be16_to_cpu (iph->payload_len),0 )); - } - } - } -return 0 ; -case NAT25_LOOKUP : -DEBUG_INFO ("NAT25: Lookup IP, SA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x, DA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n" , - iph->saddr.s6_addr16[0 ], iph->saddr.s6_addr16[1 ], iph->saddr.s6_addr16[2 ], iph->saddr.s6_addr16[3 ], - iph->saddr.s6_addr16[4 ], iph->saddr.s6_addr16[5 ], iph->saddr.s6_addr16[6 ], iph->saddr.s6_addr16[7 ], - iph->daddr.s6_addr16[0 ], iph->daddr.s6_addr16[1 ], iph->daddr.s6_addr16[2 ], iph->daddr.s6_addr16[3 ], - iph->daddr.s6_addr16[4 ], iph->daddr.s6_addr16[5 ], iph->daddr.s6_addr16[6 ], iph->daddr.s6_addr16[7 ]); -__nat25_generate_ipv6_network_addr (networkAddr, (__be32 *)&iph->daddr); -__nat25_db_network_lookup_and_replace (priv, skb, networkAddr); -return 0 ; -default : -return -1 ; - } - } -return -1 ; -} -#define SERVER_PORT 67#define CLIENT_PORT 68#define DHCP_MAGIC 0x63825363
drivers/staging/rtl8188eu/include/usb_osintf.h +0 -1
@@ -34,7 +34,6 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb);void *scdb_findEntry (struct adapter *priv,unsigned char *macAddr,unsigned char *ipAddr);void nat25_db_expire (struct adapter *priv); -int nat25_db_handle (struct adapter *priv,struct sk_buff *skb,int method);int rtw_resume_process (struct adapter *padapter);
Signature · 1 line
1.7.10.4
PATCH 3/9 staging: rtl8188eu: Remove function nat25_db_cleanup()
In reply to navin patidarWe've removed the code which was responsible for building NAT table, so no use of keeping nat_db_cleanup().
--- drivers/staging/rtl8188eu/core/rtw_br_ext.c | 26 ------------------------ drivers/staging/rtl8188eu/core/rtw_cmd.c | 3 +-- drivers/staging/rtl8188eu/include/rtw_br_ext.h | 2 -- drivers/staging/rtl8188eu/os_dep/os_intfs.c | 2 -- 4 files changed, 1 insertion(+), 32 deletions(-)
drivers/staging/rtl8188eu/core/rtw_br_ext.c +0 -26
@@ -247,32 +247,6 @@ static inline void __network_hash_unlink(struct nat25_network_db_entry *ent)* NAT2.5 interface */ -void nat25_db_cleanup (struct adapter *priv) -{ -int i; - -spin_lock_bh (&priv->br_ext_lock); - -for (i =0 ; i <NAT25_HASH_SIZE ; i++) { -struct nat25_network_db_entry *f; - f = priv->nethash[i]; -while (f !=NULL ) { -struct nat25_network_db_entry *g; - - g = f->next_hash; -if (priv->scdb_entry == f) { -memset (priv->scdb_mac,0 ,ETH_ALEN ); -memset (priv->scdb_ip,0 ,4 ); - priv->scdb_entry =NULL ; - } -__network_hash_unlink (f); -kfree (f); - f = g; - } - } -spin_unlock_bh (&priv->br_ext_lock); -} -void nat25_db_expire (struct adapter *priv) {int i;
drivers/staging/rtl8188eu/core/rtw_cmd.c +1 -2
@@ -2059,8 +2059,7 @@ void rtw_disassoc_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)RT_TRACE (_module_rtl871x_cmd_c_, _drv_err_, ("\n ***Error: disconnect_cmd_callback Fail ***\n." ));return ; - }else /* clear bridge database */ -nat25_db_cleanup (padapter); + }/* free cmd */ rtw_free_cmd_obj (pcmd);
drivers/staging/rtl8188eu/include/rtw_br_ext.h +0 -2
@@ -61,6 +61,4 @@ struct br_ext_info { unsigned int nat25sc_disable; }; -void nat25_db_cleanup (struct adapter *priv); -#endif /* _RTW_BR_EXT_H_ */
drivers/staging/rtl8188eu/os_dep/os_intfs.c +0 -2
@@ -1228,8 +1228,6 @@ int netdev_close(struct net_device *pnetdev)rtw_led_control (padapter,LED_CTL_POWER_OFF ); } -nat25_db_cleanup (padapter); -#ifdef CONFIG_88EU_P2P rtw_p2p_enable (padapter,P2P_ROLE_DISABLE );#endif /* CONFIG_88EU_P2P */
Signature · 1 line
1.7.10.4
PATCH 4/9 staging: rtl8188eu: Remove pppoe_connection_in_progress from struct adapter
In reply to navin patidarValue stored in pppoe_connection_in_progress isn't being used by driver.
--- drivers/staging/rtl8188eu/core/rtw_mlme.c | 7 ------- drivers/staging/rtl8188eu/include/drv_types.h | 1 - 2 files changed, 8 deletions(-)
drivers/staging/rtl8188eu/core/rtw_mlme.c +0 -7
@@ -1546,13 +1546,6 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter) (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true)) {/* expire NAT2.5 entry */ nat25_db_expire (adapter); - -if (adapter->pppoe_connection_in_progress >0 ) - adapter->pppoe_connection_in_progress--; - -/* due to rtw_dynamic_check_timer_handlder() is called every 2 seconds */ -if (adapter->pppoe_connection_in_progress >0 ) - adapter->pppoe_connection_in_progress--; }rcu_read_unlock ();
drivers/staging/rtl8188eu/include/drv_types.h +0 -1
@@ -256,7 +256,6 @@ struct adapter {spinlock_t br_ext_lock;struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE ]; -int pppoe_connection_in_progress;unsigned char pppoe_addr[MACADDRLEN ];unsigned char scdb_mac[MACADDRLEN ];unsigned char scdb_ip[4 ];
Signature · 1 line
1.7.10.4
PATCH 5/9 staging: rtl8188eu: Remove function nat25_db_expire()
In reply to navin patidarWe've removed the code which was responsible for building NAT table, so no use of keeping nat_db_expire().
--- drivers/staging/rtl8188eu/core/rtw_mlme.c | 11 ----------- drivers/staging/rtl8188eu/include/usb_osintf.h | 1 - 2 files changed, 12 deletions(-)
drivers/staging/rtl8188eu/core/rtw_mlme.c +0 -11
@@ -1516,7 +1516,6 @@ static void rtw_auto_scan_handler(struct adapter *padapter)void rtw_dynamic_check_timer_handlder (struct adapter *adapter) { -struct mlme_priv *pmlmepriv = &adapter->mlmepriv;struct registry_priv *pregistrypriv = &adapter->registrypriv;if (!adapter)
@@ -1539,16 +1538,6 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)rtw_auto_scan_handler (adapter); } } - -rcu_read_lock (); - -if (rcu_dereference (adapter->pnetdev->rx_handler_data) && - (check_fwstate (pmlmepriv,WIFI_STATION_STATE |WIFI_ADHOC_STATE ) == true)) { -/* expire NAT2.5 entry */ -nat25_db_expire (adapter); - } - -rcu_read_unlock (); }#define RTW_SCAN_RESULT_EXPIRE 2000
drivers/staging/rtl8188eu/include/usb_osintf.h +0 -1
@@ -33,7 +33,6 @@ void netdev_br_init(struct net_device *netdev);void dhcp_flag_bcast (struct adapter *priv,struct sk_buff *skb);void *scdb_findEntry (struct adapter *priv,unsigned char *macAddr,unsigned char *ipAddr); -void nat25_db_expire (struct adapter *priv);int rtw_resume_process (struct adapter *padapter);
Signature · 1 line
1.7.10.4
PATCH 6/9 staging: rtl8188eu: Remove function netdev_br_init()
In reply to navin patidarnetdev_br_init() tries to find MAC address of network interface named "br0", then that MAC address is assigned to adapter->br_netdev and used by driver's NAT implementation code.
--- drivers/staging/rtl8188eu/include/usb_osintf.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 28 ------------------------ 2 files changed, 29 deletions(-)
drivers/staging/rtl8188eu/include/usb_osintf.h +0 -1
@@ -29,7 +29,6 @@ extern int rtw_mc2u_disable;#define USBD_HALTED (Status) ((u32)(Status) >> 30 == 3)int pm_netdev_open (struct net_device *pnetdev,u8 bnormal); -void netdev_br_init (struct net_device *netdev);void dhcp_flag_bcast (struct adapter *priv,struct sk_buff *skb);void *scdb_findEntry (struct adapter *priv,unsigned char *macAddr,unsigned char *ipAddr);
drivers/staging/rtl8188eu/os_dep/os_intfs.c +0 -28
@@ -36,7 +36,6 @@ MODULE_DESCRIPTION("Realtek Wireless Lan Driver");MODULE_AUTHOR ("Realtek Semiconductor Corp." );MODULE_VERSION (DRIVERVERSION ); -#define CONFIG_BR_EXT_BRNAME "br0"#define RTW_NOTCH_FILTER 0/* 0:Disable, 1:Enable, */ /* module param defaults */
@@ -1001,31 +1000,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter)return _SUCCESS; } -void netdev_br_init (struct net_device *netdev) -{ -struct adapter *adapter = (struct adapter *)rtw_netdev_priv (netdev); - -rcu_read_lock (); - -if (rcu_dereference (adapter->pnetdev->rx_handler_data)) { -struct net_device *br_netdev; -struct net *devnet =NULL ; - - devnet =dev_net (netdev); - br_netdev =dev_get_by_name (devnet,CONFIG_BR_EXT_BRNAME ); -if (br_netdev) { -memcpy (adapter->br_mac, br_netdev->dev_addr,ETH_ALEN ); -dev_put (br_netdev); - }else { -pr_info ("%s()-%d: dev_get_by_name(%s) failed!" , - __func__, __LINE__,CONFIG_BR_EXT_BRNAME ); - } - } - adapter->ethBrExtInfo.addPPPoETag =1 ; - -rcu_read_unlock (); -} -int _netdev_open (struct net_device *pnetdev) {uint status;
@@ -1082,8 +1056,6 @@ int _netdev_open(struct net_device *pnetdev)else netif_tx_wake_all_queues (pnetdev); -netdev_br_init (pnetdev); - netdev_open_normal_process:RT_TRACE (_module_os_intfs_c_, _drv_info_, ("-88eu_drv - dev_open\n" ));DBG_88E ("-88eu_drv - drv_open, bup =%d\n" , padapter->bup);
Signature · 1 line
1.7.10.4
PATCH 7/9 staging: rtl8188eu: core: Remove file rtw_br_ext.c
In reply to navin patidarfunctions defined in rtw_br_ext.c are not being used by driver anymore.
--- drivers/staging/rtl8188eu/Makefile | 1 - drivers/staging/rtl8188eu/core/rtw_br_ext.c | 365 --------------------------- 2 files changed, 366 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/core/rtw_br_ext.c
drivers/staging/rtl8188eu/Makefile +0 -1
@@ -1,6 +1,5 @@ r8188eu-y := \ core/rtw_ap.o \ - core/rtw_br_ext.o \ core/rtw_cmd.o \ core/rtw_debug.o \ core/rtw_efuse.o \
drivers/staging/rtl8188eu/core/rtw_br_ext.c deleted +0 -365
365 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 8/9 staging: rtl8188eu: Remove unused members of struct adapter
In reply to navin patidar--- drivers/staging/rtl8188eu/include/drv_types.h | 8 -------- 1 file changed, 8 deletions(-)
drivers/staging/rtl8188eu/include/drv_types.h +0 -8
@@ -255,14 +255,6 @@ struct adapter {struct mutex hw_init_mutex;spinlock_t br_ext_lock; -struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE ]; -unsigned char pppoe_addr[MACADDRLEN ]; -unsigned char scdb_mac[MACADDRLEN ]; -unsigned char scdb_ip[4 ]; -struct nat25_network_db_entry *scdb_entry; -unsigned char br_mac[MACADDRLEN ]; -unsigned char br_ip[4 ]; -struct br_ext_info ethBrExtInfo;u8 fix_rate;
Signature · 1 line
1.7.10.4
PATCH 9/9 staging: rtl8188eu: Remove file rtw_br_ext.h
In reply to navin patidardriver doesn't need rtw_br_ext.h any more.
--- drivers/staging/rtl8188eu/core/rtw_cmd.c | 1 - drivers/staging/rtl8188eu/include/drv_types.h | 1 - drivers/staging/rtl8188eu/include/rtw_br_ext.h | 64 ------------------------ drivers/staging/rtl8188eu/os_dep/os_intfs.c | 1 - 4 files changed, 67 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/rtw_br_ext.h
drivers/staging/rtl8188eu/core/rtw_cmd.c +0 -1
@@ -24,7 +24,6 @@#include <recv_osdep.h> #include <cmd_osdep.h> #include <mlme_osdep.h> -#include <rtw_br_ext.h> #include <rtw_mlme_ext.h> /*
drivers/staging/rtl8188eu/include/drv_types.h +0 -1
@@ -51,7 +51,6 @@#include <rtw_p2p.h> #include <rtw_ap.h> #include <rtw_mp.h> -#include <rtw_br_ext.h> #define SPEC_DEV_ID_NONE BIT(0)#define SPEC_DEV_ID_DISABLE_HT BIT(1)
drivers/staging/rtl8188eu/include/rtw_br_ext.h deleted +0 -64
64 lines not on this page · raw message
drivers/staging/rtl8188eu/os_dep/os_intfs.c +0 -1
@@ -29,7 +29,6 @@#include <usb_osintf.h> #include <usb_hal.h> -#include <rtw_br_ext.h> MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Realtek Wireless Lan Driver" );
Signature · 1 line
1.7.10.4