Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
From 9c9a3c27b96e057f3c3f47151d7a170d84e3bb5f Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Sun, 15 Oct 2023 15:31:47 +0200
|
||||
Subject: [PATCH 4/5] wifi: rt2x00: Support EEPROM swap binding
|
||||
|
||||
Add binding "ralink,eeprom-swap" to swap bytes of EEPROM before using
|
||||
it.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
@@ -20,6 +20,19 @@
|
||||
#include "rt2x00soc.h"
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD)
|
||||
+static void rt2800lib_eeprom_swap(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ struct device_node *np = rt2x00dev->dev->of_node;
|
||||
+ size_t len = rt2x00dev->ops->eeprom_size;
|
||||
+ int i;
|
||||
+
|
||||
+ if (!of_find_property(np, "ralink,eeprom-swap", NULL))
|
||||
+ return;
|
||||
+
|
||||
+ for (i = 0; i < len / sizeof(u16); i++)
|
||||
+ rt2x00dev->eeprom[i] = swab16(rt2x00dev->eeprom[i]);
|
||||
+}
|
||||
+
|
||||
static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
@@ -66,6 +79,8 @@ static int rt2800lib_read_eeprom_mtd(str
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ rt2800lib_eeprom_swap(rt2x00dev);
|
||||
+
|
||||
dev_info(rt2x00dev->dev, "loaded eeprom from mtd device \"%s\"\n", part);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user