immortalwrt/target/linux
Thibaut VARÈNE 341983f234
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-14 13:47:42 +08:00
..
apm821xx kernel: bump 4.19 to 4.19.155 2020-11-08 03:24:12 +08:00
ar7 kernel: bump 4.9 to 4.9.237 2020-09-30 20:08:29 +08:00
ar71xx ar71xx: add support for Lute ZK400 2020-11-01 11:50:37 +08:00
arc770 update target 2019-08-19 22:26:19 +08:00
archs38 update target 2019-08-19 22:26:19 +08:00
armvirt update target 2019-08-19 22:26:19 +08:00
at91 at91: switch to 4.14 (#3040) 2020-02-11 17:26:30 +08:00
ath25 target: replace remaining occurrences of ifconfig with ip 2020-08-03 20:58:21 +08:00
ath79 ath79: fix LED labels for PowerCloud CAP324 2020-11-12 10:54:22 +08:00
bcm27xx kernel: bump 4.19 to 4.19.155 2020-11-08 03:24:12 +08:00
bcm53xx kernel: bump 4.19 to 4.19.155 2020-11-08 03:24:12 +08:00
brcm47xx kernel: bump 4.19 to 4.19.145 2020-09-12 23:08:12 +08:00
brcm63xx kernel: bump 4.19 to 4.19.148 2020-09-30 21:08:22 +08:00
cns3xxx kernel: bump to 4.14.203, 4.19.154 2020-10-31 01:29:00 +08:00
gemini gemini: Add swap partition to DNS-313 2020-08-03 00:21:24 +08:00
generic generic: platform/mikrotik: implement multi caldata 2020-11-14 13:47:42 +08:00
imx6 kernel: bump 4.19 to 4.19.110 2020-03-19 17:50:48 +08:00
ipq40xx kernel: bump 4.14 to 4.14.204 2020-11-08 02:26:20 +08:00
ipq806x kernel: bump 4.19 to 4.19.155 2020-11-08 03:24:12 +08:00
ixp4xx kernel: bump 4.9 to 4.9.238 2020-10-03 01:14:39 +08:00
kirkwood treewide: omit IMAGE_SIZE argument from check-size 2020-07-30 23:44:37 +08:00
lantiq kernel: bump 4.19 to 4.19.149 2020-10-01 21:53:50 +08:00
layerscape kernel: bump 4.14 to 4.14.204 2020-11-08 02:26:20 +08:00
malta update target 2019-08-19 22:26:19 +08:00
mediatek kernel: bump 4.14 to 4.14.204 2020-11-08 02:26:20 +08:00
mpc85xx kernel: bump 4.19 to 4.19.155 2020-11-08 03:24:12 +08:00
mvebu autocore-arm: add support for mvebu 2020-11-13 19:46:58 +08:00
mxs kernel: bump 4.14 to 4.14.177 2020-05-03 19:32:54 +08:00
octeon kernel: bump 4.19 to 4.19.155 2020-11-08 03:24:12 +08:00
octeontx kernel: bump to 4.9.219, 4.14.176, 4.19.115 (#4350) 2020-04-17 11:50:34 +08:00
omap update target 2019-08-19 22:26:19 +08:00
orion update target 2019-08-19 22:26:19 +08:00
oxnas kernel: bump 4.14 to 4.14.204 2020-11-08 02:26:20 +08:00
pistachio kernel: bump 4.14 to 4.14.186 2020-06-25 23:30:20 +08:00
ramips ramips: fix logic level for DIR-645 buttons 2020-11-12 10:54:56 +08:00
rb532 kernel: bump to 4.14.203, 4.19.154 2020-10-31 01:29:00 +08:00
samsung kernel: Update kernel 4.14 to version 4.14.187 2020-07-05 11:53:32 +08:00
sunxi kernel: bump to 4.14.203, 4.19.154 2020-10-31 01:29:00 +08:00
tegra kernel: bump to 4.14.167, 4.19.98 (#2871) 2020-01-30 01:43:29 +08:00
uml kernel: bump to 4.9.240, 4.14.202, 4.19.152 2020-10-17 19:46:46 +08:00
x86 x86: generic: disable CONFIG_EFI_VARS 2020-11-14 13:45:12 +08:00
zynq update target 2019-08-19 22:26:19 +08:00
Makefile build: add 'make kernel_xconfig' command 2020-07-09 12:03:26 +08:00