openwrt/package/kernel/qca-ssdk/patches/0014-SSDK-qca808x-use-get_random_u32.patch
Robert Marko ff0465b26e
kernel: qca-ssdk: renumber patches
Lets reexport the patches in order to have them renumbered from 0 again.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-10 17:51:31 +02:00

28 lines
1.0 KiB
Diff

From 6a49dd6bb2e40ce49351adb6100599f176d80494 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Fri, 21 Oct 2022 13:40:15 +0200
Subject: [PATCH 14/14] SSDK: qca808x: use get_random_u32
prandom has been removed from the kernel in 6.1-rc1, so use get_random_u32
instead as its the drop-in replacement.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
src/hsl/phy/qca808x_phy.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/src/hsl/phy/qca808x_phy.c
+++ b/src/hsl/phy/qca808x_phy.c
@@ -299,7 +299,11 @@ qca808x_phy_ms_random_seed_set(a_uint32_
phy_data = qca808x_phy_debug_read(dev_id, phy_id,
QCA808X_DEBUG_LOCAL_SEED);
phy_data &= ~(QCA808X_MASTER_SLAVE_SEED_CFG);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
phy_data |= (prandom_u32()%QCA808X_MASTER_SLAVE_SEED_RANGE) << 2;
+#else
+ phy_data |= (get_random_u32()%QCA808X_MASTER_SLAVE_SEED_RANGE) << 2;
+#endif
SSDK_DEBUG("QCA808X_DEBUG_LOCAL_SEED:%x\n", phy_data);
rv = qca808x_phy_debug_write(dev_id, phy_id,
QCA808X_DEBUG_LOCAL_SEED, phy_data);