openwrt/target/linux
Thibaut VARÈNE 71d71e2b31 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>
Signed-off-by: maurerr <mariusd84@gmail.com>
2021-09-01 08:07:11 +00:00
..
apm821xx kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
arc770 arc770: drop support for kernel 4.14 2021-09-01 08:06:56 +00:00
archs38 treewide: use wpad-basic-wolfssl as default 2021-09-01 08:06:52 +00:00
armvirt kernel: remove support for kernel 4.19 2021-09-01 08:07:08 +00:00
at91 at91: explicitly set CONFIG_USB_SUPPORT for sam9x subtarget 2021-09-01 08:06:54 +00:00
ath25 ath25: fix preinit Ethernet port configuration 2021-09-01 08:06:58 +00:00
ath79 ath79: add support for Qxwlan E600G v2 / E600GAC v2 2021-09-01 08:07:10 +00:00
bcm27xx kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
bcm47xx kernel: remove support for kernel 4.19 2021-09-01 08:07:08 +00:00
bcm53xx kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
bcm63xx bcm63xx: reorganize board patches into fewer files 2021-09-01 08:07:07 +00:00
gemini kernel: remove support for kernel 4.19 2021-09-01 08:07:08 +00:00
generic generic: platform/mikrotik: implement multi caldata 2021-09-01 08:07:11 +00:00
imx6 kernel: remove support for kernel 4.19 2021-09-01 08:07:08 +00:00
ipq40xx ipq40xx: enable RX hash / CTAG TX offloading for single-phy 2021-09-01 08:07:08 +00:00
ipq806x kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
ipq807x kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-06 12:37:04 +02:00
kirkwood target: update SPDX license names 2021-09-01 08:07:01 +00:00
lantiq kernel: bump 5.4 to 5.4.73 2021-09-01 08:07:08 +00:00
layerscape kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
malta kernel: remove support for kernel 4.19 2021-09-01 08:07:08 +00:00
mediatek kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
mpc85xx kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
mvebu kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
mxs treewide: make dependency on kmod-usb-net selective 2021-09-01 08:06:49 +00:00
octeon kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
octeontx kernel: move F2FS_FS_XATTR and F2FS_STAT_FS symbols to generic 2021-09-01 08:07:04 +00:00
omap kernel: remove support for kernel 4.19 2021-09-01 08:07:08 +00:00
oxnas kernel: bump 5.4 to 5.4.75 2021-09-01 08:07:10 +00:00
pistachio kernel: bump 5.4 to 5.4.73 2021-09-01 08:07:08 +00:00
ramips ramips: add Xiaomi Mi Router 4A Gigabit explicitly 2021-09-01 08:07:10 +00:00
rockchip rockchip: remove unused config symbols 2021-09-01 08:07:09 +00:00
rtl838x rtl838x: Add switch and ethernet driver support for RTL839x SoCs 2021-09-01 08:07:11 +00:00
sunxi sunxi: add support for Libre Computer ALL-H3-CC H5 2021-09-01 08:07:11 +00:00
tegra kernel: remove support for kernel 4.19 2021-09-01 08:07:08 +00:00
uml kernel: bump 5.4 to 5.4.71 2021-09-01 08:07:05 +00:00
x86 x86: generic: disable CONFIG_EFI_VARS 2021-09-01 08:07:11 +00:00
zynq kernel: remove support for kernel 4.19 2021-09-01 08:07:08 +00:00
Makefile build: add 'make kernel_xconfig' command 2020-07-08 16:07:05 +02:00