 8cae215d4d
			
		
	
	8cae215d4d
	
	
	
		
			
			Add kernel 6.1 support to SSDK, it was just a case of adding the kernel version identification and fixing up get_random_u32. Signed-off-by: Robert Marko <robimarko@gmail.com>
		
			
				
	
	
		
			28 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 55ea8c9b278aafe3211f7250986b1f9d9a06cd21 Mon Sep 17 00:00:00 2001
 | |
| From: Robert Marko <robimarko@gmail.com>
 | |
| Date: Fri, 21 Oct 2022 13:40:15 +0200
 | |
| Subject: [PATCH] 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);
 |