006-os_dep-osdep_service-use-new-get_random_u32.patch 869 B

12345678910111213141516171819202122232425
  1. From e8f10b21abd8ae440632f561f8b65f37b4b55cc8 Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Sun, 30 Jul 2023 11:16:32 +0200
  4. Subject: [PATCH 1/5] os_dep/osdep_service: use new get_random_u32
  5. Drop prandom_u32 as got deprecated for get_random_u32.
  6. Signed-off-by: Christian Marangi <[email protected]>
  7. ---
  8. os_dep/osdep_service.c | 4 +++-
  9. 1 file changed, 3 insertions(+), 1 deletion(-)
  10. --- a/os_dep/osdep_service.c
  11. +++ b/os_dep/osdep_service.c
  12. @@ -2335,7 +2335,9 @@ u64 rtw_division64(u64 x, u64 y)
  13. inline u32 rtw_random32(void)
  14. {
  15. #ifdef PLATFORM_LINUX
  16. -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
  17. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
  18. + return get_random_u32();
  19. +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
  20. return prandom_u32();
  21. #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18))
  22. u32 random_int;