openwrt/package/kernel/mac80211/patches/rt2x00/602-04-wifi-rt2x00-Support-EEPROM-swap-binding.patch
Christian Marangi 52a0873742
mac80211: update to version 6.18
Drop all upstreamed patch and refresh all affected patch.

Minor changes were needed to the
350-mac80211-allow-scanning-while-on-radar-channel due to changes in
6.18.

Also some changes were needed to downstream patch due to upstream commit
b74947b4f6ff ("wifi: cfg80211/mac80211: Add support to get radio index")

Link: https://github.com/openwrt/openwrt/pull/20964
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-12-08 00:37:06 +01:00

44 lines
1.3 KiB
Diff

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
@@ -19,6 +19,19 @@
#include "rt2x00.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_property_present(np, "ralink,eeprom-swap"))
+ 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)
{
struct device_node *np = rt2x00dev->dev->of_node, *mtd_np = NULL;
@@ -64,6 +77,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);
return ret;