From 3b5034b445823e3ef83e673458a68c00736d489d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Sun, 10 Oct 2021 12:33:58 +0200 Subject: [PATCH] Fix kernel 5.15 compilation Remove IPX support from driver, set as obsolete in Jan 2018. IPX is not supported by the linux kernel since v5.15-rc1 see commit 6c9b40844751ea30c72f7a2f92f4d704bc6b2927 --- core/rtw_br_ext.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c index 1236f50..d1685fc 100644 --- a/core/rtw_br_ext.c +++ b/core/rtw_br_ext.c @@ -21,7 +21,10 @@ #include #include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) #include +#endif #include #include #include @@ -149,6 +152,7 @@ static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr memcpy(networkAddr+7, (unsigned char *)ipAddr, 4); } +#ifdef _NET_INET_IPX_H_ static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr, unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr) { @@ -168,6 +172,7 @@ static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char * memcpy(networkAddr+1, (unsigned char *)ipxNetAddr, 4); memcpy(networkAddr+5, (unsigned char *)ipxSocketAddr, 2); } +#endif static inline void __nat25_generate_apple_network_addr(unsigned char *networkAddr, unsigned short *network, unsigned char *node) @@ -282,6 +287,7 @@ static inline int __nat25_network_hash(unsigned char *networkAddr) x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10]; return x & (NAT25_HASH_SIZE - 1); +#ifdef _NET_INET_IPX_H_ } else if (networkAddr[0] == NAT25_IPX) { unsigned long x; @@ -289,6 +295,7 @@ static inline int __nat25_network_hash(unsigned char *networkAddr) networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10]; return x & (NAT25_HASH_SIZE - 1); +#endif } else if (networkAddr[0] == NAT25_APPLE) { unsigned long x; @@ -600,6 +607,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) default: return -1; } +#ifdef _NET_INET_IPX_H_ } else if ((protocol == ETH_P_IPX) || (protocol <= ETH_FRAME_LEN)) { /*---------------------------------------------------*/ @@ -797,6 +805,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) } return -1; +#endif } else if ((protocol == ETH_P_PPP_DISC) || (protocol == ETH_P_PPP_SES)) { /*---------------------------------------------------*/