8000 "prandom_u32_max" build failure under Linux 6.1.0 · Issue #39 · fastoe/RTL8812BU · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

"prandom_u32_max" build failure under Linux 6.1.0 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lamby opened this issue Dec 21, 2022 · 5 comments
Open

"prandom_u32_max" build failure under Linux 6.1.0 #39

lamby opened this issue Dec 21, 2022 · 5 comments

Comments

@lamby
Copy link
lamby commented Dec 21, 2022
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c: In function ‘rtw_change_ifname’:
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c:2574:28: warning: passing argument 1 of ‘_rtw_memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2574 |         _rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
      |                     ~~~~~~~^~~~~~~~~~
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c:922:24: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
  922 | void _rtw_memcpy(void *dst, const void *src, u32 sz)
      |                  ~~~~~~^~~
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c: In function ‘rtw_random32’:
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c:2698:16: error: implicit declaration of function ‘prandom_u32’; did you mean ‘prandom_u32_max’? [-Werror=implicit-function-declaration]
 2698 |         return prandom_u32();
      |                ^~~~~~~~~~~
      |                prandom_u32_max
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.1.0-0-common/scripts/Makefile.build:255: /home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-0-common/Makefile:2017: /home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.0-0-amd64'
make: *** [Makefile:2390: modules] Error 2
@fastoe
Copy link
Owner
fastoe commented Jan 14, 2023

Please provide the error message and OS information 'uname -a'.

@fastoe
Copy link
Owner
fastoe commented Jan 15, 2023

For kernel 5.11 or later, please clone the v5.13.1 branch:

sudo apt update
sudo apt install -y build-essential dkms git bc
git clone -b v5.13.1 https://github.com/fastoe/RTL8812BU.git
cd RTL8812BU
make
sudo make install
sudo reboot

@hubgit115
Copy link
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c: In function ‘rtw_change_ifname’:
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c:2574:28: warning: passing argument 1 of ‘_rtw_memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2574 |         _rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
      |                     ~~~~~~~^~~~~~~~~~
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c:922:24: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
  922 | void _rtw_memcpy(void *dst, const void *src, u32 sz)
      |                  ~~~~~~^~~
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c: In function ‘rtw_random32’:
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c:2698:16: error: implicit declaration of function ‘prandom_u32’; did you mean ‘prandom_u32_max’? [-Werror=implicit-function-declaration]
 2698 |         return prandom_u32();
      |                ^~~~~~~~~~~
      |                prandom_u32_max
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.1.0-0-common/scripts/Makefile.build:255: /home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-0-common/Makefile:2017: /home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.0-0-amd64'
make: *** [Makefile:2390: modules] Error 2

i have the same problem plz provide me with the soultion
i am trying it for the tp link wifi adapter

@hubgit115
Copy link
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c: In function ‘rtw_change_ifname’:
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c:2574:28: warning: passing argument 1 of ‘_rtw_memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2574 |         _rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
      |                     ~~~~~~~^~~~~~~~~~
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c:922:24: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
  922 | void _rtw_memcpy(void *dst, const void *src, u32 sz)
      |                  ~~~~~~^~~
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c: In function ‘rtw_random32’:
/home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.c:2698:16: error: implicit declaration of function ‘prandom_u32’; did you mean ‘prandom_u32_max’? [-Werror=implicit-function-declaration]
 2698 |         return prandom_u32();
      |                ^~~~~~~~~~~
      |                prandom_u32_max
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.1.0-0-common/scripts/Makefile.build:255: /home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU/os_dep/osdep_service.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-0-common/Makefile:2017: /home/lamby/temp/cdt.20221221115757.cmvTwmdtNA/RTL8812BU] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.0-0-amd64'
make: *** [Makefile:2390: modules] Error 2

i have the same problem plz provide me with the soultion i am trying it for the tp link wifi adapter

Linux monster 6.1.0-kali7-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.20-1kali1 (2023-03-22) x86_64 GNU/Linux

@averissimo
Copy link

The function was deprecated on kernel 6.1.0

Change line 2609 on os_dep/osdep_service.c to match the code below (adds a if clause and moves current if to and else-if)

#ifdef PLATFORM_LINUX
#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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0