-
Notifications
You must be signed in to change notification settings - Fork 58
archlinux compile error #1
Comments
According to the following two help, I finally successfully compiled the firmware of RTL8852BE. Maybe this is only suitable for my situation, so I won't pr. The modification is as follows: diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c
index 26e17f6..22826e0 100644
--- a/core/rtw_br_ext.c
+++ b/core/rtw_br_ext.c
@@ -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>
@@ -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)
{
@@ -200,6 +204,7 @@ static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networ
_rtw_memcpy(networkAddr + 1, (unsigned char *)network, 2);
networkAddr[3] = *node;
}
+#endif
static __inline__ void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
@@ -330,6 +335,7 @@ 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;
@@ -343,6 +349,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3];
return x & (NAT25_HASH_SIZE - 1);
+#endif
} else if (networkAddr[0] == NAT25_PPPOE) {
unsigned long x;
@@ -886,6 +893,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
}
+#ifdef _NET_INET_IPX_H_
/*---------------------------------------------------*/
/* Handle IPX and Apple Talk frame */
/*---------------------------------------------------*/
@@ -1106,6 +1114,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
return -1;
}
+#endif
/*---------------------------------------------------*/
/* Handle PPPoE frame */
diff --git a/include/osdep_service_linux.h b/include/osdep_service_linux.h
index da472c3..73479f1 100644
--- a/include/osdep_service_linux.h
+++ b/include/osdep_service_linux.h
@@ -488,7 +488,7 @@ static inline void rtw_thread_enter(char *name)
static inline void rtw_thread_exit(_completion *comp)
{
- complete_and_exit(comp, 0);
+ kthread_complete_and_exit(comp, 0);
}
static inline _thread_hdl_ rtw_thread_start(int (*threadfn)(void *data),
diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c
index 43a110e..af5b4d6 100644
--- a/os_dep/linux/rtw_proc.c
+++ b/os_dep/linux/rtw_proc.c
@@ -35,7 +35,7 @@ inline struct proc_dir_entry *get_rtw_drv_proc(void)
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0))
-#define PDE_DATA(inode) PDE((inode))->data
+#define pde_data(inode) PDE((inode))->data
#define proc_get_parent_data(inode) PDE((inode))->parent->data
#endif
@@ -290,7 +290,7 @@ const int drv_proc_hdls_num = sizeof(drv_proc_hdls) / sizeof(struct rtw_proc_hdl
static int rtw_drv_proc_open(struct inode *inode, struct file *file)
{
/* struct net_device *dev = proc_get_parent_data(inode); */
- ssize_t index = (ssize_t)PDE_DATA(inode);
+ ssize_t index = (ssize_t)pde_data(inode);
const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
void *private = NULL;
@@ -319,7 +319,7 @@ static int rtw_drv_proc_open(struct inode *inode, struct file *file)
static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
{
- ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
+ ssize_t index = (ssize_t)pde_data(file_inode(file));
const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
@@ -5330,7 +5330,7 @@ const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(struct rtw_
static int rtw_adapter_proc_open(struct inode *inode, struct file *file)
{
- ssize_t index = (ssize_t)PDE_DATA(inode);
+ ssize_t index = (ssize_t)pde_data(inode);
const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
void *private = proc_get_parent_data(inode);
@@ -5360,7 +5360,7 @@ static int rtw_adapter_proc_open(struct inode *inode, struct file *file)
static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
{
- ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
+ ssize_t index = (ssize_t)pde_data(file_inode(file));
const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
@@ -5592,7 +5592,7 @@ const int odm_proc_hdls_num = sizeof(odm_proc_hdls) / sizeof(struct rtw_proc_hdl
static int rtw_odm_proc_open(struct inode *inode, struct file *file)
{
- ssize_t index = (ssize_t)PDE_DATA(inode);
+ ssize_t index = (ssize_t)pde_data(inode);
const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
void *private = proc_get_parent_data(inode);
@@ -5622,7 +5622,7 @@ static int rtw_odm_proc_open(struct inode *inode, struct file *file)
static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
{
- ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
+ ssize_t index = (ssize_t)pde_data(file_inode(file));
const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write; |
To be honest, bro, I didn't try to compile it in the kernel > 5.15. It seems that there are several situations similar to your problem in the issue of other libraries. Thank you for your feedback. |
啊?中国人啊?搞半天,敲英语好累的。 |
好像有问题的不止您一个,似乎在内核大于5.15的都有这个问题,如果大家都有这个问题的话您可以考虑加一个分支或者pr😄 |
其实我也只是测试我所用的内核而已,不敢说对其他版本的内核就一定有用啊。 |
如果方便的话,也想请问一下您的笔记本型号。似乎rtl8852be的笔记本都是近期发售的搭载12代CPU的本子,Intel的AX201网卡好像产能不足,故都采用Realtek的网卡代替了。 |
我是红米 RedmiBook Pro 14 2021锐龙款,CPU是AMD R5-5500U。 |
您好,我与你的情况类似,系统和内核一样,但是打完您的补丁仍然无法解决问题,redmibookpro15锐龙5800H |
所以我说我也不敢保证适用于所有情况啊。你可以google下你的问题。 |
您可以把具体的问题提供一下,这么说似乎无法定位任何问题。 |
|
感谢您的反馈!一个类似的解决方案 |
您确定只更改了pde_data而没有更改_rtw_memcpy么?因为看到您的报错信息里面有相关的信息。
您的改动和原来的代码区别在哪里呢?pde_data(inode) 指代的不还是 PDE((inode))->data么? 同时,您可否留下一个联系方式以便进行进一步探讨? |
参考2楼的两个链接 |
just want to note that compilation as is within the repo indeed fails for me too, however the patch from devome #1 (comment) indeed did the trick. can't say the driver is in stellar shape (it doesn't seem to like lspci) but wifi finally shows up and works with affomentioned patch. edit: same kernel version (5.17) and platform (x86_64). requires |
Hello, I'd like to ask if you have changed |
I literally took the patch from devome and did nothing else. There are a bunch of otherwise, compiling the
However, hardware seems to work just fine. I didn't do a lot of testing with it as I'm just glad it works as all but so far haven't encountered any issues. I'm not sure how similar the chipset is but the edit: format |
I'll attach my build log here just in case. |
Thank you for your reminder. It is precisely because rtw89 does not contain the driver of rtl8852be that I tried to change the driver version of a chipset. I created this repo based on the principle of "just use it". If there are too many warnings but it doesn't seem to affect the operation of the hardware, let it warn (snicker🤦♂️). |
That is alright, the way it is, it certainly saved me a lot of trouble and the effort is much appreciated. I might file a kernel bug for the Thanks |
os: archlinux
kernerl version: Linux laptop 5.17.3-arch1-1 #1 SMP PREEMPT Thu, 14 Apr 2022 01:18:36 +0000 x86_64 GNU/Linux
platform: x86_64
config:
When I tried to compile the firmware of rtl8852be for this machine, the following error occurred:
The text was updated successfully, but these errors were encountered: