immortalwrt/target/linux
Thibaut VARÈNE 41b867165d generic: platform/mikrotik: implement multi caldata
MikroTik recently changed again the way they store wlan calibration data
on devices. Prior to this change, ERD calibration data for all available
radios was stored within a single identifier node ("tag" in RouterBoot
parlance).

Recent devices have been seen with calibration (and BDF) data stored in
separate identifiers within LZOR packing for each radio: this patch
addresses this by:
1) ensuring that both variants are properly supported,
2) preserving backward compatibility with existing data consumers,
3) allowing for more than 2 calibration blobs to be exposed via sysfs.

Specifically, before this patch, the driver would provide a single sysfs
file named /sys/firmware/mikrotik/hard_config/wlan_data that contained
whatever calibration data found on the device's flash. After this patch,
when executed on a device that uses the old style storage, this behavior
is unchanged, but when executed on a device that uses new style storage
(for either traditional "ERD" packing or "LZOR" packing), the driver
replaces that single file with a folder containing one or more files
each containing the data encoded within individual identifiers.

As far as OpenWRT is concerned, this means that for devices which are
known to exist with both styles of data storage, a suitable hotplug stub
could look like this for e.g. the second radio:

wdata="/sys/firmware/mikrotik/hard_config/wlan_data"
( [ -f "$wdata" ] && caldata_sysfsload_from_file "$wdata" 0x8000 0x2f20 ) || \
( [ -d "$wdata" ] && caldata_sysfsload_from_file "$wdata/data_2" 0x0 0x2f20 )

This patch has been tested with LZOR old and new style packing on ipq4019,
and with old style on ath79.

Tested-by: John Thomson <git@johnthomson.fastmail.com.au>
Tested-by: Шебанов Алексей <admin@ublaze.ru>
Tested-by: Alen Opačić <subixonfire@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Tested-by: Robert Marko <robimarko@gmail.com>
2020-11-12 18:21:55 +01:00
..
apm821xx kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
arc770 arc770: drop support for kernel 4.14 2020-09-02 16:29:22 +02:00
archs38 treewide: use wpad-basic-wolfssl as default 2020-08-20 14:19:39 +02:00
armvirt kernel: remove support for kernel 4.19 2020-10-30 19:29:59 +01:00
at91 at91: explicitly set CONFIG_USB_SUPPORT for sam9x subtarget 2020-08-27 16:36:18 +02:00
ath25 ath25: fix preinit Ethernet port configuration 2020-09-10 18:52:15 +02:00
ath79 ath79: add support for Qxwlan E600G v2 / E600GAC v2 2020-11-12 17:18:26 +01:00
bcm27xx kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
bcm47xx kernel: remove support for kernel 4.19 2020-10-30 19:29:59 +01:00
bcm53xx kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
bcm63xx bcm63xx: reorganize board patches into fewer files 2020-10-26 23:48:08 +01:00
gemini kernel: remove support for kernel 4.19 2020-10-30 19:29:59 +01:00
generic generic: platform/mikrotik: implement multi caldata 2020-11-12 18:21:55 +01:00
imx6 kernel: remove support for kernel 4.19 2020-10-30 19:29:59 +01:00
ipq40xx ipq40xx: enable RX hash / CTAG TX offloading for single-phy 2020-11-01 15:30:22 +01:00
ipq806x kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
ipq807x kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-06 12:37:04 +02:00
kirkwood target: update SPDX license names 2020-09-22 20:58:26 +02:00
lantiq kernel: bump 5.4 to 5.4.73 2020-11-01 14:44:06 +01:00
layerscape kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
malta kernel: remove support for kernel 4.19 2020-10-30 19:29:59 +01:00
mediatek kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
mpc85xx kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
mvebu kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
mxs treewide: make dependency on kmod-usb-net selective 2020-08-10 12:54:30 +02:00
octeon kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
octeontx kernel: move F2FS_FS_XATTR and F2FS_STAT_FS symbols to generic 2020-10-09 23:20:19 +01:00
omap kernel: remove support for kernel 4.19 2020-10-30 19:29:59 +01:00
oxnas kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
pistachio kernel: bump 5.4 to 5.4.73 2020-11-01 14:44:06 +01:00
ramips ramips: add Xiaomi Mi Router 4A Gigabit explicitly 2020-11-12 17:18:26 +01:00
rockchip rockchip: remove unused config symbols 2020-11-04 23:58:27 +01:00
rtl838x rtl838x: Add switch and ethernet driver support for RTL839x SoCs 2020-11-12 18:21:55 +01:00
sunxi sunxi: add support for Libre Computer ALL-H3-CC H5 2020-11-12 18:21:17 +01:00
tegra kernel: remove support for kernel 4.19 2020-10-30 19:29:59 +01:00
uml kernel: bump 5.4 to 5.4.71 2020-10-15 17:46:54 +02:00
x86 x86: generic: disable CONFIG_EFI_VARS 2020-11-12 18:21:55 +01:00
zynq kernel: remove support for kernel 4.19 2020-10-30 19:29:59 +01:00
Makefile build: add 'make kernel_xconfig' command 2020-07-08 16:07:05 +02:00