All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: r8188eu: remove inline markings from functions in rtw_br_ext.c
@ 2021-08-16  7:34 Greg Kroah-Hartman
  2021-08-16  7:34 ` [PATCH 2/2] staging: r8188eu: remove ipx support from driver Greg Kroah-Hartman
  2021-08-16  8:02 ` [PATCH 1/2] staging: r8188eu: remove inline markings from functions in rtw_br_ext.c Phillip Potter
  0 siblings, 2 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-16  7:34 UTC (permalink / raw)
  To: Larry Finger, Phillip Potter
  Cc: fmdefrancesco, straube.linux, linux-staging, Greg Kroah-Hartman

The compiler is free to ignore, or follow, "inline" markings so they
really have no use in .c files, so just remove them.

This allows functions to properly show up as being unused when all
callers to them are removed, otherwise gcc does not warn you about this.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/r8188eu/core/rtw_br_ext.c | 24 +++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 22737cd0fe44..fb2bb36f9e2c 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -49,7 +49,7 @@
 -----------------------------------------------------------------*/
 
 /* 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)
+static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
 {
 	unsigned char *cur_ptr, *start_ptr;
 	unsigned short tagLen, tagType;
@@ -66,7 +66,7 @@ static inline unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsign
 	return NULL;
 }
 
-static inline int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
+static int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
 {
 	struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
 	int data_len;
@@ -106,7 +106,7 @@ static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len)
 	return 0;
 }
 
-static inline unsigned long __nat25_timeout(struct adapter *priv)
+static unsigned long __nat25_timeout(struct adapter *priv)
 {
 	unsigned long timeout;
 
@@ -115,7 +115,7 @@ static inline unsigned long __nat25_timeout(struct adapter *priv)
 	return timeout;
 }
 
-static inline int  __nat25_has_expired(struct adapter *priv,
+static int  __nat25_has_expired(struct adapter *priv,
 				struct nat25_network_db_entry *fdb)
 {
 	if (time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
@@ -124,7 +124,7 @@ static inline int  __nat25_has_expired(struct adapter *priv,
 	return 0;
 }
 
-static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
+static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
 				unsigned int *ipAddr)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -133,7 +133,7 @@ static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr
 	memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
 }
 
-static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
+static void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
 				__be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -143,7 +143,7 @@ static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *ne
 	memcpy(networkAddr+5, ipxNodeAddr, 6);
 }
 
-static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
+static void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
 				__be32 *ipxNetAddr, __be16 *ipxSocketAddr)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -153,7 +153,7 @@ static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *
 	memcpy(networkAddr+5, ipxSocketAddr, 2);
 }
 
-static inline void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
+static void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
 				__be16 *network, unsigned char *node)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -163,7 +163,7 @@ static inline void __nat25_generate_apple_network_addr(unsigned char *networkAdd
 	networkAddr[3] = *node;
 }
 
-static inline void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
+static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
 				unsigned char *ac_mac, __be16 *sid)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -258,7 +258,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
 	return 0;
 }
 
-static inline int __nat25_network_hash(unsigned char *networkAddr)
+static int __nat25_network_hash(unsigned char *networkAddr)
 {
 	if (networkAddr[0] == NAT25_IPV4) {
 		unsigned long x;
@@ -305,7 +305,7 @@ static inline int __nat25_network_hash(unsigned char *networkAddr)
 	}
 }
 
-static inline void __network_hash_link(struct adapter *priv,
+static void __network_hash_link(struct adapter *priv,
 				struct nat25_network_db_entry *ent, int hash)
 {
 	/*  Caller must spin_lock already! */
@@ -316,7 +316,7 @@ static inline void __network_hash_link(struct adapter *priv,
 	ent->pprev_hash = &priv->nethash[hash];
 }
 
-static inline void __network_hash_unlink(struct nat25_network_db_entry *ent)
+static void __network_hash_unlink(struct nat25_network_db_entry *ent)
 {
 	/*  Caller must spin_lock already! */
 	*ent->pprev_hash = ent->next_hash;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] staging: r8188eu: remove ipx support from driver
  2021-08-16  7:34 [PATCH 1/2] staging: r8188eu: remove inline markings from functions in rtw_br_ext.c Greg Kroah-Hartman
@ 2021-08-16  7:34 ` Greg Kroah-Hartman
  2021-08-16  8:02   ` Phillip Potter
  2021-08-16  8:02 ` [PATCH 1/2] staging: r8188eu: remove inline markings from functions in rtw_br_ext.c Phillip Potter
  1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-16  7:34 UTC (permalink / raw)
  To: Larry Finger, Phillip Potter
  Cc: fmdefrancesco, straube.linux, linux-staging, Greg Kroah-Hartman,
	Stephen Rothwell

The ipx.h header files are being removed from the kernel, and support
for them was long removed from the tree, so remove all references to it
in the r8188eu driver as well, to allow it to continue to build properly
in linux-next

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/r8188eu/core/rtw_br_ext.c | 228 ----------------------
 1 file changed, 228 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index fb2bb36f9e2c..8be025992270 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -5,7 +5,6 @@
 
 #include "../include/linux/if_arp.h"
 #include "../include/net/ip.h"
-#include "../include/net/ipx.h"
 #include "../include/linux/atalk.h"
 #include "../include/linux/udp.h"
 #include "../include/linux/if_pppox.h"
@@ -133,36 +132,6 @@ static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
 	memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
 }
 
-static void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
-				__be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
-{
-	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
-
-	networkAddr[0] = NAT25_IPX;
-	memcpy(networkAddr+1, ipxNetAddr, 4);
-	memcpy(networkAddr+5, ipxNodeAddr, 6);
-}
-
-static void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
-				__be32 *ipxNetAddr, __be16 *ipxSocketAddr)
-{
-	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
-
-	networkAddr[0] = NAT25_IPX;
-	memcpy(networkAddr+1, ipxNetAddr, 4);
-	memcpy(networkAddr+5, ipxSocketAddr, 2);
-}
-
-static void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
-				__be16 *network, unsigned char *node)
-{
-	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
-
-	networkAddr[0] = NAT25_APPLE;
-	memcpy(networkAddr+1, network, 2);
-	networkAddr[3] = *node;
-}
-
 static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
 				unsigned char *ac_mac, __be16 *sid)
 {
@@ -584,203 +553,6 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
 		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) {
-			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);
-				__nat25_db_print(priv);
-				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) {
-			/* 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);
-
-				__nat25_db_print(priv);
-				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) {
-			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);
-
-				__nat25_db_print(priv);
-				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)) {
 		/*---------------------------------------------------*/
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] staging: r8188eu: remove inline markings from functions in rtw_br_ext.c
  2021-08-16  7:34 [PATCH 1/2] staging: r8188eu: remove inline markings from functions in rtw_br_ext.c Greg Kroah-Hartman
  2021-08-16  7:34 ` [PATCH 2/2] staging: r8188eu: remove ipx support from driver Greg Kroah-Hartman
@ 2021-08-16  8:02 ` Phillip Potter
  1 sibling, 0 replies; 4+ messages in thread
From: Phillip Potter @ 2021-08-16  8:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Fabio M. De Francesco, Michael Straube, linux-staging

On Mon, 16 Aug 2021 at 08:35, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> The compiler is free to ignore, or follow, "inline" markings so they
> really have no use in .c files, so just remove them.
>
> This allows functions to properly show up as being unused when all
> callers to them are removed, otherwise gcc does not warn you about this.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/staging/r8188eu/core/rtw_br_ext.c | 24 +++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> index 22737cd0fe44..fb2bb36f9e2c 100644
> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> @@ -49,7 +49,7 @@
>  -----------------------------------------------------------------*/
>
>  /* 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)
> +static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
>  {
>         unsigned char *cur_ptr, *start_ptr;
>         unsigned short tagLen, tagType;
> @@ -66,7 +66,7 @@ static inline unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsign
>         return NULL;
>  }
>
> -static inline int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
> +static int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
>  {
>         struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
>         int data_len;
> @@ -106,7 +106,7 @@ static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len)
>         return 0;
>  }
>
> -static inline unsigned long __nat25_timeout(struct adapter *priv)
> +static unsigned long __nat25_timeout(struct adapter *priv)
>  {
>         unsigned long timeout;
>
> @@ -115,7 +115,7 @@ static inline unsigned long __nat25_timeout(struct adapter *priv)
>         return timeout;
>  }
>
> -static inline int  __nat25_has_expired(struct adapter *priv,
> +static int  __nat25_has_expired(struct adapter *priv,
>                                 struct nat25_network_db_entry *fdb)
>  {
>         if (time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
> @@ -124,7 +124,7 @@ static inline int  __nat25_has_expired(struct adapter *priv,
>         return 0;
>  }
>
> -static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
> +static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
>                                 unsigned int *ipAddr)
>  {
>         memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
> @@ -133,7 +133,7 @@ static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr
>         memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
>  }
>
> -static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
> +static void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
>                                 __be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
>  {
>         memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
> @@ -143,7 +143,7 @@ static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *ne
>         memcpy(networkAddr+5, ipxNodeAddr, 6);
>  }
>
> -static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
> +static void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
>                                 __be32 *ipxNetAddr, __be16 *ipxSocketAddr)
>  {
>         memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
> @@ -153,7 +153,7 @@ static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *
>         memcpy(networkAddr+5, ipxSocketAddr, 2);
>  }
>
> -static inline void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
> +static void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
>                                 __be16 *network, unsigned char *node)
>  {
>         memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
> @@ -163,7 +163,7 @@ static inline void __nat25_generate_apple_network_addr(unsigned char *networkAdd
>         networkAddr[3] = *node;
>  }
>
> -static inline void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
> +static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
>                                 unsigned char *ac_mac, __be16 *sid)
>  {
>         memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
> @@ -258,7 +258,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
>         return 0;
>  }
>
> -static inline int __nat25_network_hash(unsigned char *networkAddr)
> +static int __nat25_network_hash(unsigned char *networkAddr)
>  {
>         if (networkAddr[0] == NAT25_IPV4) {
>                 unsigned long x;
> @@ -305,7 +305,7 @@ static inline int __nat25_network_hash(unsigned char *networkAddr)
>         }
>  }
>
> -static inline void __network_hash_link(struct adapter *priv,
> +static void __network_hash_link(struct adapter *priv,
>                                 struct nat25_network_db_entry *ent, int hash)
>  {
>         /*  Caller must spin_lock already! */
> @@ -316,7 +316,7 @@ static inline void __network_hash_link(struct adapter *priv,
>         ent->pprev_hash = &priv->nethash[hash];
>  }
>
> -static inline void __network_hash_unlink(struct nat25_network_db_entry *ent)
> +static void __network_hash_unlink(struct nat25_network_db_entry *ent)
>  {
>         /*  Caller must spin_lock already! */
>         *ent->pprev_hash = ent->next_hash;
> --
> 2.32.0
>

Acked-by: Phillip Potter <phil@philpotter.co.uk>

Regards,
Phil

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] staging: r8188eu: remove ipx support from driver
  2021-08-16  7:34 ` [PATCH 2/2] staging: r8188eu: remove ipx support from driver Greg Kroah-Hartman
@ 2021-08-16  8:02   ` Phillip Potter
  0 siblings, 0 replies; 4+ messages in thread
From: Phillip Potter @ 2021-08-16  8:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Fabio M. De Francesco, Michael Straube,
	linux-staging, Stephen Rothwell

On Mon, 16 Aug 2021 at 08:35, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> The ipx.h header files are being removed from the kernel, and support
> for them was long removed from the tree, so remove all references to it
> in the r8188eu driver as well, to allow it to continue to build properly
> in linux-next
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/staging/r8188eu/core/rtw_br_ext.c | 228 ----------------------
>  1 file changed, 228 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> index fb2bb36f9e2c..8be025992270 100644
> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> @@ -5,7 +5,6 @@
>
>  #include "../include/linux/if_arp.h"
>  #include "../include/net/ip.h"
> -#include "../include/net/ipx.h"
>  #include "../include/linux/atalk.h"
>  #include "../include/linux/udp.h"
>  #include "../include/linux/if_pppox.h"
> @@ -133,36 +132,6 @@ static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
>         memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
>  }
>
> -static void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
> -                               __be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
> -{
> -       memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
> -
> -       networkAddr[0] = NAT25_IPX;
> -       memcpy(networkAddr+1, ipxNetAddr, 4);
> -       memcpy(networkAddr+5, ipxNodeAddr, 6);
> -}
> -
> -static void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
> -                               __be32 *ipxNetAddr, __be16 *ipxSocketAddr)
> -{
> -       memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
> -
> -       networkAddr[0] = NAT25_IPX;
> -       memcpy(networkAddr+1, ipxNetAddr, 4);
> -       memcpy(networkAddr+5, ipxSocketAddr, 2);
> -}
> -
> -static void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
> -                               __be16 *network, unsigned char *node)
> -{
> -       memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
> -
> -       networkAddr[0] = NAT25_APPLE;
> -       memcpy(networkAddr+1, network, 2);
> -       networkAddr[3] = *node;
> -}
> -
>  static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
>                                 unsigned char *ac_mac, __be16 *sid)
>  {
> @@ -584,203 +553,6 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>                 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) {
> -                       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);
> -                               __nat25_db_print(priv);
> -                               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) {
> -                       /* 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);
> -
> -                               __nat25_db_print(priv);
> -                               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) {
> -                       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);
> -
> -                               __nat25_db_print(priv);
> -                               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)) {
>                 /*---------------------------------------------------*/
> --
> 2.32.0
>

Acked-by: Phillip Potter <phil@philpotter.co.uk>

Regards,
Phil

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-16  8:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16  7:34 [PATCH 1/2] staging: r8188eu: remove inline markings from functions in rtw_br_ext.c Greg Kroah-Hartman
2021-08-16  7:34 ` [PATCH 2/2] staging: r8188eu: remove ipx support from driver Greg Kroah-Hartman
2021-08-16  8:02   ` Phillip Potter
2021-08-16  8:02 ` [PATCH 1/2] staging: r8188eu: remove inline markings from functions in rtw_br_ext.c Phillip Potter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.