diff options
author | Thibaut VARÈNE <hacks@slashdirt.org> | 2020-08-24 12:38:40 +0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2020-11-12 18:21:55 +0100 |
commit | 41b867165d9c31105f6ac0e407b350b4622ad077 (patch) | |
tree | 6404e1a324759f6ec811f876ce97430e8c37e56a /target/linux/omap | |
parent | e800ecfa3dd91bf789dc28f1c3f8f485c619c01c (diff) | |
download | upstream-41b867165d9c31105f6ac0e407b350b4622ad077.tar.gz upstream-41b867165d9c31105f6ac0e407b350b4622ad077.tar.bz2 upstream-41b867165d9c31105f6ac0e407b350b4622ad077.zip |
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>
Diffstat (limited to 'target/linux/omap')
0 files changed, 0 insertions, 0 deletions