Skip to contentSkip to conversation

package/rtl8821cu: fix build failure on PowerPC64

PATCH In review Giulio Benetti 3 participants 7 messages Mar 2, 2023 – Mar 6, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/rtl8821cu: fix build failure on PowerPC64

Let's add local patch pending upstream to fix get_ra() conflict on PowerPC64 architecture.

[0]: https://github.com/morrownr/8821cu-20210118/pull/93

---
 .../0001-Fix-build-on-PowerPC64.patch         | 123 ++++++++++++++++++
 1 file changed, 123 insertions(+)
 create mode 100644 package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch
package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch new file +123 -0
new file mode 100644
index 0000000000..8beedcaa38
@@ -0,0 +1,123 @@
+From 267ca7b6f850befc8b5d92544b81e12c60dda0f6 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <[email protected]>
+Date: Thu, 2 Mar 2023 16:14:52 +0100
+Subject: [PATCH] Fix build on PowerPC64
+
+On PowerPC64 architecture get_ra() is also present in Linux but with a
+different name causing build to fail. To fix this let's rename local
+get_ra() to rtl_get_ra().
+
+[Upstream status: https://github.com/morrownr/8821cu-20210118/pull/93]
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ core/rtw_odm.c                | 6 +++---
+ core/rtw_recv.c               | 6 +++---
+ hal/hal_com.c                 | 2 +-
+ include/wifi.h                | 2 +-
+ os_dep/linux/ioctl_cfg80211.c | 2 +-
+ 5 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/core/rtw_odm.c b/core/rtw_odm.c
+index 9651d4f..6174944 100644
+--- a/core/rtw_odm.c
++++ b/core/rtw_odm.c
+@@ -272,7 +272,7 @@ void rtw_odm_parse_rx_phy_status_chinfo(union recv_frame *rframe, u8 *phys)
+ 				RTW_PRINT("phys_t%u ta="MAC_FMT" %s, %s(band:%u, ch:%u, l_rxsc:%u)\n"
+ 					, *phys & 0xf
+ 					, MAC_ARG(get_ta(wlanhdr))
+-					, is_broadcast_mac_addr(get_ra(wlanhdr)) ? "BC" : is_multicast_mac_addr(get_ra(wlanhdr)) ? "MC" : "UC"
++					, is_broadcast_mac_addr(rtl_get_ra(wlanhdr)) ? "BC" : is_multicast_mac_addr(rtl_get_ra(wlanhdr)) ? "MC" : "UC"
+ 					, HDATA_RATE(attrib->data_rate)
+ 					, phys_t0->band, phys_t0->channel, phys_t0->rxsc
+ 				);
+@@ -382,7 +382,7 @@ type1_end:
+ 				RTW_PRINT("phys_t%u ta="MAC_FMT" %s, %s(band:%u, ch:%u, rf_mode:%u, l_rxsc:%u, ht_rxsc:%u) => %u,%u\n"
+ 					, *phys & 0xf
+ 					, MAC_ARG(get_ta(wlanhdr))
+-					, is_broadcast_mac_addr(get_ra(wlanhdr)) ? "BC" : is_multicast_mac_addr(get_ra(wlanhdr)) ? "MC" : "UC"
++					, is_broadcast_mac_addr(rtl_get_ra(wlanhdr)) ? "BC" : is_multicast_mac_addr(rtl_get_ra(wlanhdr)) ? "MC" : "UC"
+ 					, HDATA_RATE(attrib->data_rate)
+ 					, phys_t1->band, phys_t1->channel, phys_t1->rf_mode, phys_t1->l_rxsc, phys_t1->ht_rxsc
+ 					, pkt_cch, pkt_bw
+@@ -400,7 +400,7 @@ type1_end:
+ 				RTW_PRINT("phys_t%u ta="MAC_FMT" %s, %s(band:%u, ch:%u, l_rxsc:%u, ht_rxsc:%u)\n"
+ 					, *phys & 0xf
+ 					, MAC_ARG(get_ta(wlanhdr))
+-					, is_broadcast_mac_addr(get_ra(wlanhdr)) ? "BC" : is_multicast_mac_addr(get_ra(wlanhdr)) ? "MC" : "UC"
++					, is_broadcast_mac_addr(rtl_get_ra(wlanhdr)) ? "BC" : is_multicast_mac_addr(rtl_get_ra(wlanhdr)) ? "MC" : "UC"
+ 					, HDATA_RATE(attrib->data_rate)
+ 					, phys_t2->band, phys_t2->channel, phys_t2->l_rxsc, phys_t2->ht_rxsc
+ 				);
+diff --git a/core/rtw_recv.c b/core/rtw_recv.c
+index c19a492..7a2aa4b 100755
+--- a/core/rtw_recv.c
++++ b/core/rtw_recv.c
+@@ -4066,7 +4066,7 @@ int recv_func(_adapter *padapter, union recv_frame *rframe)
+ 
+ 	if (check_fwstate(mlmepriv, WIFI_MONITOR_STATE) 
+ #ifdef RTW_SIMPLE_CONFIG
+-		|| (check_fwstate(mlmepriv, WIFI_AP_STATE) && padapter->rtw_simple_config == _TRUE && IS_MCAST(get_ra(ptr)))
++		|| (check_fwstate(mlmepriv, WIFI_AP_STATE) && padapter->rtw_simple_config == _TRUE && IS_MCAST(rtl_get_ra(ptr)))
+ #endif
+ 		) {
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
+@@ -4419,7 +4419,7 @@ void rx_query_phy_status(
+ 	wlanhdr = get_recvframe_data(precvframe);
+ 
+ 	ta = get_ta(wlanhdr);
+-	ra = get_ra(wlanhdr);
++	ra = rtl_get_ra(wlanhdr);
+ 	is_ra_bmc = IS_MCAST(ra);
+ 
+ 	if (_rtw_memcmp(adapter_mac_addr(padapter), ta, ETH_ALEN) == _TRUE) {
+@@ -4567,7 +4567,7 @@ s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status)
+ {
+ 	s32 ret = _SUCCESS;
+ 	u8 *pbuf = precvframe->u.hdr.rx_data;
+-	u8 *ra = get_ra(pbuf);
++	u8 *ra = rtl_get_ra(pbuf);
+ 	u8 ra_is_bmc = IS_MCAST(ra);
+ 	bool phy_queried = 0;
+ 	_adapter *primary_padapter = precvframe->u.hdr.adapter;
+diff --git a/hal/hal_com.c b/hal/hal_com.c
+index a0f1595..42ef910 100644
+--- a/hal/hal_com.c
++++ b/hal/hal_com.c
+@@ -14286,7 +14286,7 @@ void rtw_store_phy_info(_adapter *padapter, union recv_frame *prframe)
+ 
+ 			/*RTW_INFO("=>%s WIFI_DATA_TYPE or WIFI_QOS_DATA_TYPE\n", __FUNCTION__);*/
+ 			if (psta) {
+-				if (IS_MCAST(get_ra(get_recvframe_data(prframe))))
++				if (IS_MCAST(rtl_get_ra(get_recvframe_data(prframe))))
+ 					psta_dframe_info = &psta->sta_dframe_info_bmc;
+ 				else
+ 					psta_dframe_info = &psta->sta_dframe_info;
+diff --git a/include/wifi.h b/include/wifi.h
+index d07b349..ce5990b 100755
+--- a/include/wifi.h
++++ b/include/wifi.h
+@@ -463,7 +463,7 @@ __inline static int IS_MCAST(const u8 *da)
+ 		return _FALSE;
+ }
+ 
+-__inline static unsigned char *get_ra(unsigned char *pframe)
++__inline static unsigned char *rtl_get_ra(unsigned char *pframe)
+ {
+ 	unsigned char	*ra;
+ 	ra = GetAddr1Ptr(pframe);
+diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
+index 7e7849c..47a0903 100755
+--- a/os_dep/linux/ioctl_cfg80211.c
++++ b/os_dep/linux/ioctl_cfg80211.c
+@@ -7074,7 +7074,7 @@ void rtw_cfg80211_rx_p2p_action_public(_adapter *adapter, union recv_frame *rfra
+ indicate:
+ #endif
+ 	#if defined(RTW_DEDICATED_P2P_DEVICE)
+-	if (rtw_cfg80211_redirect_pd_wdev(dvobj_to_wiphy(dvobj), get_ra(frame), &wdev))
++	if (rtw_cfg80211_redirect_pd_wdev(dvobj_to_wiphy(dvobj), rtl_get_ra(frame), &wdev))
+ 		if (0)
+ 			RTW_INFO("redirect to pd_wdev:%p\n", wdev);
+ 	#endif
+-- 
+2.34.1
+
Signature · 6 lines
2.34.1

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

Hi Giulio,

Quoted 11 lines · Giulio Benetti

Let's add local patch pending upstream to fix get_ra() conflict on PowerPC64 architecture.

[0]: https://github.com/morrownr/8821cu-20210118/pull/93

---
 .../0001-Fix-build-on-PowerPC64.patch         | 123 ++++++++++++++++++
 1 file changed, 123 insertions(+)
 create mode 100644 package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch

The repo owner morrownr requested that we switch to the newer version of the package, and send the PR there.

I sent the PR there: https://github.com/morrownr/8821cu-20210916/pull/73

The patch to update to the new version:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Best regards,
Christian Stewart
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hi Christian,

Quoted 16 lines · Christian Stewart

Hi Giulio,

Quoted 11 lines · Giulio Benetti

Let's add local patch pending upstream to fix get_ra() conflict on PowerPC64 architecture.

[0]: https://github.com/morrownr/8821cu-20210118/pull/93

---
  .../0001-Fix-build-on-PowerPC64.patch         | 123 ++++++++++++++++++
  1 file changed, 123 insertions(+)

create mode 100644 package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch

Quoted 4 lines

The repo owner morrownr requested that we switch to the newer version of the package, and send the PR there.

I sent the PR there: https://github.com/morrownr/8821cu-20210916/pull/73

Thank you!

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

The patch to update to the new version:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Best regards,
Christian Stewart

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

#3 lore raw
In reply to Christian Stewart via buildroot
Quoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christian" == Christian Stewart via buildroot <[email protected]> writes:

Hi Giulio,

Quoted 11 lines · Giulio Benetti

Let's add local patch pending upstream to fix get_ra() conflict on PowerPC64 architecture.

[0]: https://github.com/morrownr/8821cu-20210118/pull/93

---
.../0001-Fix-build-on-PowerPC64.patch | 123 ++++++++++++++++++

1 file changed, 123 insertions(+)

create mode 100644 package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch

Quoted 8 lines

The repo owner morrownr requested that we switch to the newer version of the package, and send the PR there.

I sent the PR there: https://github.com/morrownr/8821cu-20210916/pull/73

The patch to update to the new version:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

What is the relation exactly between these two patches? Are they fixing the same issue? Is this patch superseeded by your patch changing the version?

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Hi Peter,

Quoted 22 lines · Peter Korsgaard
Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christian" == Christian Stewart via buildroot <[email protected]> writes:

Hi Giulio,

Quoted 11 lines · Giulio Benetti

Let's add local patch pending upstream to fix get_ra() conflict on PowerPC64 architecture.

[0]: https://github.com/morrownr/8821cu-20210118/pull/93

---
.../0001-Fix-build-on-PowerPC64.patch | 123 ++++++++++++++++++

1 file changed, 123 insertions(+)

create mode 100644 package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch

The repo owner morrownr requested that we switch to the newer version of the package, and send the PR there.

I sent the PR there: https://github.com/morrownr/8821cu-20210916/pull/73

Quoted 7 lines
Quoted 3 lines

The patch to update to the new version:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

What is the relation exactly between these two patches? Are they fixing the same issue? Is this patch superseeded by your patch changing the version?

This patch is still valid, it fixes the bug for the current repository
used by the package.
But soon the repository will be moved to a new one:
https://github.com/morrownr/8821cu-20210916
because the actual one will be deleted(it's a strange choice...).
So Christian moved my PR to the new Repository but it's still now merged.
So IMHO, at this stage, I would:
1) apply this patch
2) wait for PR to be merged or for repository to be deleted
3) switch to the new repository keeping the local patch applied with point 1) or if it will be merged upstream we can remove local patch of point 1)

This is my 2 cents.

Kind regards

Signature · 6 lines
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Hi Giulio, Peter,

Quoted 5 lines · Giulio Benetti

This patch is still valid, it fixes the bug for the current repository used by the package.
But soon the repository will be moved to a new one:
https://github.com/morrownr/8821cu-20210916
because the actual one will be deleted(it's a strange choice...).

The PR with this patch has been merged to the 20210916 repo:

https://github.com/morrownr/8821cu-20210916/pull/73

submitted the patch w/ this new version:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

I suggest we merge the new version & skip adding the patch to the buildroot tree.

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

#6 lore raw

Hi Christian,

Quoted 14 lines

Il giorno 6 mar 2023, alle ore 08:28, Christian Stewart <[email protected]> ha scritto:

Hi Giulio, Peter,

Quoted 7 lines

On Sun, Mar 5, 2023 at 12:43 PM Giulio Benetti <[email protected]> wrote:
This patch is still valid, it fixes the bug for the current repository used by the package.
But soon the repository will be moved to a new one:
https://github.com/morrownr/8821cu-20210916
because the actual one will be deleted(it's a strange choice...).

The PR with this patch has been merged to the 20210916 repo:

Quoted 8 lines

https://github.com/morrownr/8821cu-20210916/pull/73

submitted the patch w/ this new version:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

I suggest we merge the new version & skip adding the patch to the buildroot tree.

I agree, you helped moving things very fast upstream,
so I would directly go with latest Christian’s patch and skip mine.

Best regards
Giulio

Quoted 3 lines

Best regards,
Christian

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