Skip to contentSkip to conversation

package/rtl8723b: fix build faillure with Linux 6.1

PATCH In review Giulio Benetti 1 participant 3 messages Dec 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/rtl8723b: fix build faillure with Linux 6.1

Add 2 local patches pending upstream[1] to fix build failure with Linux 6.1

[1]: https://github.com/lwfinger/rtl8723bu/pull/194

Fixes:
http://autobuild.buildroot.net/results/cc84b5f62ca59572f0f52086f157acc0409c03f5/

---
 ...vice.c-fix-missing-prandom_u32-with-.patch | 34 +++++++++
 ...80211.c-fix-build-failure-on-Linux-6.patch | 74 +++++++++++++++++++
 2 files changed, 108 insertions(+)
 create mode 100644 package/rtl8723bu/0002-os_dep-osdep_service.c-fix-missing-prandom_u32-with-.patch
 create mode 100644 package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch
package/rtl8723bu/0002-os_dep-osdep_service.c-fix-missing-prandom_u32-with-.patch new file +34 -0
new file mode 100644
index 0000000000..6198500f02
@@ -0,0 +1,34 @@
+From 509f24ce9fb24a9647b4295c9e9eb35efa8baa23 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <[email protected]>
+Date: Wed, 28 Dec 2022 17:49:29 +0100
+Subject: [PATCH] os_dep/osdep_service.c: fix missing prandom_u32() with Linux
+ >= 6.1.0
+
+prandom_u32() previously was only calling get_random_u32() so it's been
+dropped with Linux 6.1.0. So let's directly call get_random_u32() if Linux
+version >= 6.1.0.
+
+[Upstream status: https://github.com/lwfinger/rtl8723bu/pull/194]
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ os_dep/osdep_service.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
+index 545d00d..87266e0 100644
+--- a/os_dep/osdep_service.c
++++ b/os_dep/osdep_service.c
+@@ -1016,7 +1016,9 @@ u64 rtw_division64(u64 x, u64 y)
+ 
+ inline u32 rtw_random32(void)
+ {
+-	#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
++	#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
++	return get_random_u32();
++	#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ 	return prandom_u32();
+ 	#elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18))
+ 	u32 random_int;
+-- 
+2.34.1
+
package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch new file +74 -0

74 lines not on this page · raw message

Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Sorry, there's a typo on the subject:

s/rtl8723b/rtl8723bu

Is it possible to reword it while committing?

Thanks in advance
Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
Quoted 125 lines · Giulio Benetti

Add 2 local patches pending upstream[1] to fix build failure with Linux 6.1

[1]: https://github.com/lwfinger/rtl8723bu/pull/194

Fixes:
http://autobuild.buildroot.net/results/cc84b5f62ca59572f0f52086f157acc0409c03f5/

---
  ...vice.c-fix-missing-prandom_u32-with-.patch | 34 +++++++++
  ...80211.c-fix-build-failure-on-Linux-6.patch | 74 +++++++++++++++++++
  2 files changed, 108 insertions(+)

create mode 100644 package/rtl8723bu/0002-os_dep-osdep_service.c-fix-missing-prandom_u32-with-.patch create mode 100644 package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch

package/rtl8723bu/0002-os_dep-osdep_service.c-fix-missing-prandom_u32-with-.patch new file +34 -0
new file mode 100644
index 0000000000..6198500f02
@@ -0,0 +1,34 @@
+From 509f24ce9fb24a9647b4295c9e9eb35efa8baa23 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <[email protected]>
+Date: Wed, 28 Dec 2022 17:49:29 +0100
+Subject: [PATCH] os_dep/osdep_service.c: fix missing prandom_u32() with Linux
+ >= 6.1.0
+
+prandom_u32() previously was only calling get_random_u32() so it's been
+dropped with Linux 6.1.0. So let's directly call get_random_u32() if Linux
+version >= 6.1.0.
+
+[Upstream status: https://github.com/lwfinger/rtl8723bu/pull/194]
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ os_dep/osdep_service.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
+index 545d00d..87266e0 100644
+--- a/os_dep/osdep_service.c
++++ b/os_dep/osdep_service.c
+@@ -1016,7 +1016,9 @@ u64 rtw_division64(u64 x, u64 y)
+
+ inline u32 rtw_random32(void)
+ {
+-	#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
++	#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
++	return get_random_u32();
++	#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ 	return prandom_u32();
+ 	#elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18))
+ 	u32 random_int;
+--
+2.34.1
+
package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch new file +64 -0
new file mode 100644
index 0000000000..7926d305b3
@@ -0,0 +1,74 @@
+From 5b7ddfe0eab3a29847a8eb5e9563ef6059d744a5 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <[email protected]>
+Date: Wed, 28 Dec 2022 18:05:34 +0100
+Subject: [PATCH] os_dep/ioctl_cfg80211.c: fix build failure on Linux >= 6.1
+ because of cfg80211 api change
+
+Starting from Linux 6.1 some 80211 api requires 'int link_id' argument, so
+let's add it according to Linux version used.
+
+[Upstream status: https://github.com/lwfinger/rtl8723bu/pull/194]
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ os_dep/ioctl_cfg80211.c | 24 +++++++++++++++++-------
+ 1 file changed, 17 insertions(+), 7 deletions(-)
+
+diff --git a/os_dep/ioctl_cfg80211.c b/os_dep/ioctl_cfg80211.c
+index 0e38a66..4c9c954 100644
+--- a/os_dep/ioctl_cfg80211.c
++++ b/os_dep/ioctl_cfg80211.c
+@@ -1429,7 +1429,9 @@ exit:
+ }
+
+ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) || defined(COMPAT_KERNEL_RELEASE)
++				int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ 				u8 key_index, bool pairwise, const u8 *mac_addr,
+ #else	// (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ 				u8 key_index, const u8 *mac_addr,
+@@ -1566,7 +1568,9 @@ addkey_end:
+ }
+
+ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) || defined(COMPAT_KERNEL_RELEASE)
++				int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ 				u8 key_index, bool pairwise, const u8 *mac_addr,
+ #else	// (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ 				u8 key_index, const u8 *mac_addr,
+@@ -1580,7 +1584,9 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
+ }
+
+ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) || defined(COMPAT_KERNEL_RELEASE)
++				int link_id, u8 key_index, bool pairwise, const u8 *mac_addr)
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ 				u8 key_index, bool pairwise, const u8 *mac_addr)
+ #else	// (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ 				u8 key_index, const u8 *mac_addr)
+@@ -1601,10 +1607,14 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
+ }
+
+ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
+-	struct net_device *ndev, u8 key_index
+-	#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
+-	, bool unicast, bool multicast
+-	#endif
++					struct net_device *ndev,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) || defined(COMPAT_KERNEL_RELEASE)
++					int link_id,
++#endif

package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch line 74

Quoted 10 lines
package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch new file +10 -0
++					u8 key_index,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
++					bool unicast, bool multicast
++#endif
+ 	)
+ {
+ 	_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
+--
+2.34.1
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to Giulio Benetti

These local patches have already been merged, so please drop this patch. Sorry for the noise.

Best regards

Signature · 2 lines
Giulio Benetti
CEO/CTO@Benetti Engineering sas
Quoted 125 lines · Giulio Benetti

Add 2 local patches pending upstream[1] to fix build failure with Linux 6.1

[1]: https://github.com/lwfinger/rtl8723bu/pull/194

Fixes:
http://autobuild.buildroot.net/results/cc84b5f62ca59572f0f52086f157acc0409c03f5/

---
  ...vice.c-fix-missing-prandom_u32-with-.patch | 34 +++++++++
  ...80211.c-fix-build-failure-on-Linux-6.patch | 74 +++++++++++++++++++
  2 files changed, 108 insertions(+)

create mode 100644 package/rtl8723bu/0002-os_dep-osdep_service.c-fix-missing-prandom_u32-with-.patch create mode 100644 package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch

package/rtl8723bu/0002-os_dep-osdep_service.c-fix-missing-prandom_u32-with-.patch new file +34 -0
new file mode 100644
index 0000000000..6198500f02
@@ -0,0 +1,34 @@
+From 509f24ce9fb24a9647b4295c9e9eb35efa8baa23 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <[email protected]>
+Date: Wed, 28 Dec 2022 17:49:29 +0100
+Subject: [PATCH] os_dep/osdep_service.c: fix missing prandom_u32() with Linux
+ >= 6.1.0
+
+prandom_u32() previously was only calling get_random_u32() so it's been
+dropped with Linux 6.1.0. So let's directly call get_random_u32() if Linux
+version >= 6.1.0.
+
+[Upstream status: https://github.com/lwfinger/rtl8723bu/pull/194]
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ os_dep/osdep_service.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
+index 545d00d..87266e0 100644
+--- a/os_dep/osdep_service.c
++++ b/os_dep/osdep_service.c
+@@ -1016,7 +1016,9 @@ u64 rtw_division64(u64 x, u64 y)
+
+ inline u32 rtw_random32(void)
+ {
+-	#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
++	#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
++	return get_random_u32();
++	#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ 	return prandom_u32();
+ 	#elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18))
+ 	u32 random_int;
+--
+2.34.1
+
package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch new file +64 -0
new file mode 100644
index 0000000000..7926d305b3
@@ -0,0 +1,74 @@
+From 5b7ddfe0eab3a29847a8eb5e9563ef6059d744a5 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <[email protected]>
+Date: Wed, 28 Dec 2022 18:05:34 +0100
+Subject: [PATCH] os_dep/ioctl_cfg80211.c: fix build failure on Linux >= 6.1
+ because of cfg80211 api change
+
+Starting from Linux 6.1 some 80211 api requires 'int link_id' argument, so
+let's add it according to Linux version used.
+
+[Upstream status: https://github.com/lwfinger/rtl8723bu/pull/194]
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ os_dep/ioctl_cfg80211.c | 24 +++++++++++++++++-------
+ 1 file changed, 17 insertions(+), 7 deletions(-)
+
+diff --git a/os_dep/ioctl_cfg80211.c b/os_dep/ioctl_cfg80211.c
+index 0e38a66..4c9c954 100644
+--- a/os_dep/ioctl_cfg80211.c
++++ b/os_dep/ioctl_cfg80211.c
+@@ -1429,7 +1429,9 @@ exit:
+ }
+
+ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) || defined(COMPAT_KERNEL_RELEASE)
++				int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ 				u8 key_index, bool pairwise, const u8 *mac_addr,
+ #else	// (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ 				u8 key_index, const u8 *mac_addr,
+@@ -1566,7 +1568,9 @@ addkey_end:
+ }
+
+ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) || defined(COMPAT_KERNEL_RELEASE)
++				int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ 				u8 key_index, bool pairwise, const u8 *mac_addr,
+ #else	// (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ 				u8 key_index, const u8 *mac_addr,
+@@ -1580,7 +1584,9 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
+ }
+
+ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) || defined(COMPAT_KERNEL_RELEASE)
++				int link_id, u8 key_index, bool pairwise, const u8 *mac_addr)
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ 				u8 key_index, bool pairwise, const u8 *mac_addr)
+ #else	// (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ 				u8 key_index, const u8 *mac_addr)
+@@ -1601,10 +1607,14 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
+ }
+
+ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
+-	struct net_device *ndev, u8 key_index
+-	#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
+-	, bool unicast, bool multicast
+-	#endif
++					struct net_device *ndev,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) || defined(COMPAT_KERNEL_RELEASE)
++					int link_id,
++#endif

package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch line 74

Quoted 10 lines
package/rtl8723bu/0003-os_dep-ioctl_cfg80211.c-fix-build-failure-on-Linux-6.patch new file +10 -0
++					u8 key_index,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
++					bool unicast, bool multicast
++#endif
+ 	)
+ {
+ 	_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
+--
+2.34.1
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot