Refresh patches

This commit is contained in:
Sophie Brun 2022-10-06 15:05:13 +02:00
parent 7338edb800
commit d1092bd331
No known key found for this signature in database
GPG Key ID: 5792783B206FEE30
2 changed files with 8 additions and 73 deletions

View File

@ -4,22 +4,14 @@ Subject: Fix build for linux kernel >= 5.17
Origin: https://github.com/aircrack-ng/rtl8188eus/commit/0f1905259ec9b85fd1453be3abd322ff543e12bc
---
include/ieee80211.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
include/ieee80211.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/ieee80211.h b/include/ieee80211.h
index 5ba92b5..ace221c 100644
index 89d2eff..5d7ebe1 100644
--- a/include/ieee80211.h
+++ b/include/ieee80211.h
@@ -1529,18 +1529,20 @@ enum ieee80211_state {
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
-extern __inline int is_multicast_mac_addr(const u8 *addr)
+
+// I don't know what happened. I think the compiler just got crazy after kernel 5.18+. Normally it have a 'extern' at the beginning.
+__inline int is_multicast_mac_addr(const u8 *addr)
{
@@ -1535,13 +1535,13 @@ extern __inline int is_multicast_mac_addr(const u8 *addr)
return (addr[0] != 0xff) && (0x01 & addr[0]);
}

View File

@ -4,44 +4,14 @@ Subject: Build support with kernel v5.17
Origin: https://github.com/aircrack-ng/rtl8188eus/commit/13cc38399eb44f234a52dde5f94509e54a09c71f
---
os_dep/linux/os_intfs.c | 8 ++++++++
os_dep/linux/rtw_proc.c | 8 ++++++++
os_dep/osdep_service.c | 4 ++++
3 files changed, 20 insertions(+)
os_dep/linux/rtw_proc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c
index bd7da8b..f006fc8 100644
--- a/os_dep/linux/os_intfs.c
+++ b/os_dep/linux/os_intfs.c
@@ -1199,7 +1199,11 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr)
}
_rtw_memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+ eth_hw_addr_set(pnetdev, sa->sa_data);
+#else
_rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */
+#endif
#if 0
if (rtw_is_hw_init_completed(padapter)) {
@@ -1628,7 +1632,11 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
/* alloc netdev name */
rtw_init_netdev_name(ndev, name);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+ eth_hw_addr_set(ndev, adapter_mac_addr(adapter));
+#else
_rtw_memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
+#endif
#if defined(CONFIG_NET_NS)
dev_net_set(ndev, wiphy_net(adapter_to_wiphy(adapter)));
#endif //defined(CONFIG_NET_NS)
diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c
index 8a0fd3e..9bd4041 100644
index 8b1a424..9bd4041 100644
--- a/os_dep/linux/rtw_proc.c
+++ b/os_dep/linux/rtw_proc.c
@@ -39,12 +39,20 @@ inline struct proc_dir_entry *get_rtw_drv_proc(void)
@@ -39,6 +39,10 @@ inline struct proc_dir_entry *get_rtw_drv_proc(void)
#define proc_get_parent_data(inode) PDE((inode))->parent->data
#endif
@ -52,30 +22,3 @@ index 8a0fd3e..9bd4041 100644
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
#define get_proc_net proc_net
#else
#define get_proc_net init_net.proc_net
#endif
+#if(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+#define PDE_DATA(inode) pde_data(inode)
+#endif
+
inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_dir_entry *parent, void *data)
{
struct proc_dir_entry *entry;
diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
index 81b951d..7367bca 100644
--- a/os_dep/osdep_service.c
+++ b/os_dep/osdep_service.c
@@ -1268,8 +1268,12 @@ u32 _rtw_down_sema(_sema *sema)
inline void thread_exit(_completion *comp)
{
#ifdef PLATFORM_LINUX
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+ kthread_complete_and_exit(comp, 0);
+#else
complete_and_exit(comp, 0);
#endif
+#endif
#ifdef PLATFORM_FREEBSD
printf("%s", "RTKTHREAD_exit");