Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for kernels >=5.15 #93

Open
wants to merge 2 commits into
base: v5.8.5.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/rtw_br_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
#ifdef __KERNEL__
#include <linux/if_arp.h>
#include <net/ip.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
#include <net/ipx.h>
#endif
#include <linux/atalk.h>
#include <linux/udp.h>
#include <linux/if_pppox.h>
Expand Down Expand Up @@ -169,6 +172,7 @@ static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *network
}


#ifdef _NET_INET_IPX_H_
static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
{
Expand All @@ -189,6 +193,7 @@ static __inline__ void __nat25_generate_ipx_network_addr_with_socket(unsigned ch
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,
Expand Down Expand Up @@ -330,13 +335,15 @@ 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;

x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^
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;

Expand Down Expand Up @@ -889,6 +896,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
}

#ifdef _NET_INET_IPX_H_
/*---------------------------------------------------*/
/* Handle IPX and Apple Talk frame */
/*---------------------------------------------------*/
Expand Down Expand Up @@ -1109,6 +1117,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)

return -1;
}
#endif

/*---------------------------------------------------*/
/* Handle PPPoE frame */
Expand Down
5 changes: 5 additions & 0 deletions os_dep/linux/recv_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,13 @@ static int napi_recv(_adapter *padapter, int budget)

#ifdef CONFIG_RTW_GRO
if (pregistrypriv->en_gro) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0))
rtw_napi_gro_receive(&padapter->napi, pskb);
rx_ok = _TRUE;
#else
if (rtw_napi_gro_receive(&padapter->napi, pskb) != GRO_DROP)
rx_ok = _TRUE;
#endif
goto next;
}
#endif /* CONFIG_RTW_GRO */
Expand Down