diff mbox series

package/rtl8821cu: fix build failure on PowerPC64

Message ID 20230302151859.400567-1-giulio.benetti@benettiengineering.com
State Superseded
Headers show
Series package/rtl8821cu: fix build failure on PowerPC64 | expand

Commit Message

Giulio Benetti March 2, 2023, 3:18 p.m. UTC
Let's add local patch pending upstream to fix get_ra() conflict on
PowerPC64 architecture.

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

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 .../0001-Fix-build-on-PowerPC64.patch         | 123 ++++++++++++++++++
 1 file changed, 123 insertions(+)
 create mode 100644 package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch

Comments

Christian Stewart March 3, 2023, 7:49 a.m. UTC | #1
Hi Giulio,

On Thu, Mar 2, 2023 at 7:19 AM Giulio Benetti
<giulio.benetti@benettiengineering.com> wrote:
>
> Let's add local patch pending upstream to fix get_ra() conflict on
> PowerPC64 architecture.
>
> [0]: https://github.com/morrownr/8821cu-20210118/pull/93
>
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  .../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/20230303074829.2139881-1-christian@paral.in/

Best regards,
Christian Stewart
Giulio Benetti March 3, 2023, 10:31 a.m. UTC | #2
Hi Christian,

On 03/03/23 08:49, Christian Stewart wrote:
> Hi Giulio,
> 
> On Thu, Mar 2, 2023 at 7:19 AM Giulio Benetti
> <giulio.benetti@benettiengineering.com> wrote:
>>
>> Let's add local patch pending upstream to fix get_ra() conflict on
>> PowerPC64 architecture.
>>
>> [0]: https://github.com/morrownr/8821cu-20210118/pull/93
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>>   .../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

Thank you!
Peter Korsgaard March 5, 2023, 6:33 p.m. UTC | #3
>>>>> "Christian" == Christian Stewart via buildroot <buildroot@buildroot.org> writes:

 > Hi Giulio,
 > On Thu, Mar 2, 2023 at 7:19 AM Giulio Benetti
 > <giulio.benetti@benettiengineering.com> wrote:
 >> 
 >> Let's add local patch pending upstream to fix get_ra() conflict on
 >> PowerPC64 architecture.
 >> 
 >> [0]: https://github.com/morrownr/8821cu-20210118/pull/93
 >> 
 >> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
 >> ---
 >> .../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/20230303074829.2139881-1-christian@paral.in/

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?
Giulio Benetti March 5, 2023, 8:43 p.m. UTC | #4
Hi Peter,

On 05/03/23 19:33, Peter Korsgaard wrote:
>>>>>> "Christian" == Christian Stewart via buildroot <buildroot@buildroot.org> writes:
> 
>   > Hi Giulio,
>   > On Thu, Mar 2, 2023 at 7:19 AM Giulio Benetti
>   > <giulio.benetti@benettiengineering.com> wrote:
>   >>
>   >> Let's add local patch pending upstream to fix get_ra() conflict on
>   >> PowerPC64 architecture.
>   >>
>   >> [0]: https://github.com/morrownr/8821cu-20210118/pull/93
>   >>
>   >> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>   >> ---
>   >> .../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/20230303074829.2139881-1-christian@paral.in/
> 
> 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
Christian Stewart March 6, 2023, 7:27 a.m. UTC | #5
Hi Giulio, Peter,

On Sun, Mar 5, 2023 at 12:43 PM Giulio Benetti
<giulio.benetti@benettiengineering.com> 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:

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

submitted the patch w/ this new version:

https://patchwork.ozlabs.org/project/buildroot/patch/20230306072558.31515-1-christian@paral.in/

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

Best regards,
Christian
Giulio Benetti March 6, 2023, 10:01 a.m. UTC | #6
Hi Christian,

> Il giorno 6 mar 2023, alle ore 08:28, Christian Stewart <christian@paral.in> ha scritto:
> 
> Hi Giulio, Peter,
> 
>> On Sun, Mar 5, 2023 at 12:43 PM Giulio Benetti
>> <giulio.benetti@benettiengineering.com> 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:
> 
> https://github.com/morrownr/8821cu-20210916/pull/73
> 
> submitted the patch w/ this new version:
> 
> https://patchwork.ozlabs.org/project/buildroot/patch/20230306072558.31515-1-christian@paral.in/
> 
> 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

> 
> Best regards,
> Christian
diff mbox series

Patch

diff --git a/package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch b/package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch
new file mode 100644
index 0000000000..8beedcaa38
--- /dev/null
+++ b/package/rtl8821cu/0001-Fix-build-on-PowerPC64.patch
@@ -0,0 +1,123 @@ 
+From 267ca7b6f850befc8b5d92544b81e12c60dda0f6 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+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 <giulio.benetti@benettiengineering.com>
+---
+ 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
+