aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel
Commit message (Collapse)AuthorAgeFilesLines
* mt76: Fix mirror hashHauke Mehrtens2018-08-301-1/+1
| | | | | | | | | The mirror hash added in this commit was wrong. The file on the mirror server and the newly generated file from git have a different hash value, use that one. Fixes: 4b5861c47 ("mt76: update to the latest version") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* mac80211: brcmfmac: fix compilation with SDIO supportRafał Miłecki2018-08-171-2/+12
| | | | | | | | | This fixes following error when compiling with CONFIG_BRCMFMAC_SDIO=y: drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:1100:23: error: 'sdiod' undeclared (first use in this function) brcmf_dev_coredump(&sdiod->func1->dev); Fixes: 9d8940c5b92f ("mac80211: brcmfmac: backport important changes from the 4.18") Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport patch setting WIPHY_FLAG_HAVE_AP_SMERafał Miłecki2018-08-168-2/+36
| | | | | | | It's an important hint for authenticator (e.g. hostapd) about hardware capabilities. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport important changes from the 4.19Rafał Miłecki2018-08-168-2/+472
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport important changes from the 4.18Rafał Miłecki2018-08-169-2/+393
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport important changes from the 4.16Rafał Miłecki2018-08-163-1/+74
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport important changes from the 4.15Rafał Miłecki2018-08-165-1/+100
| | | | | | | | Two more patches that may be worth backporting in the future: fdd0bd88ceae brcmfmac: add CLM download support cc124d5cc8d8 brcmfmac: fix CLM load error for legacy chips when user helper is enabled Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport important changes from the 4.14Rafał Miłecki2018-08-167-5/+250
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport important changes from the 4.13Rafał Miłecki2018-08-169-4/+259
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport important changes from the 4.12Rafał Miłecki2018-08-1614-5/+613
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport use-after-free fix from 4.11Rafał Miłecki2018-08-162-1/+62
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: group 4.11 backport patchesRafał Miłecki2018-08-166-0/+0
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* kmod-sched-cake: bump to 20180716Kevin Darbyshire-Bryant2018-07-251-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump to the latest cake recipe. This backports tc class support to kernel 4.9 and other than conditional kernel compilation pre-processor macros represents the cake that has gone upstream into kernel 4.19. Loud cheer! Fun may be had by changing cake tin classification for packets on ingress. e.g. tc filter add dev ifb4eth0 parent 800b: protocol ip u32 match \ ip dport 6981 0xffff action skbedit priority 800b:1 Where 800b: represents the filter handle for the ifb obtained by 'tc qdisc' and the 1 from 800b:1 represents the cake tin number. So the above example puts all incoming packets destined for port 6981 into the BULK (lowest priority) tin. f39ab9a Obey tin_order for tc filter classifiers 1e2473f Clean up after latest backport. 82531d0 Reorder includes to fix out of tree compilation 52cbc00 Code style cleanup 6cdb496 Fix argument order for NL_SET_ERR_MSG_ATTR() cab17b6 Remove duplicate call to qdisc_watchdog_init() 71c7991 Merge branch 'backport-classful' 32aa7fb Fix compilation on Linux 4.9 9f8fe7a Fix compilation on Linux 4.14 ceab7a3 Rework filter classification aad5436 Fixed version of class stats be1c549 Add cake-specific class stats 483399d Use tin_order for class dumps 80dc129 Add class dumping 0c8e6c1 Fix dropping when using filters c220493 Add the minimum class ops 5ed54d2 Start implementing tc filter/class support Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> (cherry picked from commit c729c43b391e759b6700b28c8e02ba93fe15f8c2)
* Revert "kmod-sched-cake: bump to 20180716"Kevin Darbyshire-Bryant2018-07-191-4/+3
| | | | | | | | | This reverts commit 0e1606ba3d3b068e9261832c2e31f38df47f447b. 17.01.5 encountered mismatch between kmod version ABI & iproute2/tc version ABI. Revert for now, revisit for 17.01.6 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
* kmod-sched-cake: bump to 20180716Kevin Darbyshire-Bryant2018-07-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump to the latest cake recipe. This backports tc class support to kernel 4.9 and other than conditional kernel compilation pre-processor macros represents the cake that has gone upstream into kernel 4.19. Loud cheer! Fun may be had by changing cake tin classification for packets on ingress. e.g. tc filter add dev ifb4eth0 parent 800b: protocol ip u32 match \ ip dport 6981 0xffff action skbedit priority 800b:1 Where 800b: represents the filter handle for the ifb obtained by 'tc qdisc' and the 1 from 800b:1 represents the cake tin number. So the above example puts all incoming packets destined for port 6981 into the BULK (lowest priority) tin. f39ab9a Obey tin_order for tc filter classifiers 1e2473f Clean up after latest backport. 82531d0 Reorder includes to fix out of tree compilation 52cbc00 Code style cleanup 6cdb496 Fix argument order for NL_SET_ERR_MSG_ATTR() cab17b6 Remove duplicate call to qdisc_watchdog_init() 71c7991 Merge branch 'backport-classful' 32aa7fb Fix compilation on Linux 4.9 9f8fe7a Fix compilation on Linux 4.14 ceab7a3 Rework filter classification aad5436 Fixed version of class stats be1c549 Add cake-specific class stats 483399d Use tin_order for class dumps 80dc129 Add class dumping 0c8e6c1 Fix dropping when using filters c220493 Add the minimum class ops 5ed54d2 Start implementing tc filter/class support Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> (cherry picked from commit c729c43b391e759b6700b28c8e02ba93fe15f8c2)
* mac80211: rt2x00: no longer use TXOP_BACKOFF for probe framesDaniel Golle2018-06-152-1/+46
| | | | | | | | Import a revert-commit from Stanislaw Gruszka which significantly improves WiFi performance on rt2x00 based hardware. Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry-picked from commit f4a639a3d7d40b4f63c431c2d554c479fbcc6b74)
* mac80211: brcmfmac: add support for BCM4366E chipsetRafał Miłecki2018-04-032-1/+47
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mac80211: brcmfmac: backport commit dropping IAPP packets by defaultRafał Miłecki2018-03-212-1/+158
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* iptables: make kmod-ipt-debug part of default ALL buildYousong Zhou2018-01-261-2/+1
| | | | | | | | | The iptables TRACE target is only available in raw table that's why the dependency was moved from iptables-mod-trace into kmod-ipt-debug Fixes FS#1219 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* kmod-sched-cake: bump to latest cake bake for 17.01Kevin Darbyshire-Bryant2018-01-161-3/+3
| | | | | | | | | | | | | | | | | More important bug fix: 402f05c Use full-rate mtu_time in all tins. Fixes an issue where some cake tins experienced excessive latency since 49776da (dynamically adjust target) Minor bug fixes: 31277c2 Avoid unsigned comparison against zero. Fix compiler warning, no known impact. 8cf5278 ack_filter: fix TCP flag check. A very contrived case may have lead to dropping a SYN packet that should not be dropped. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
* kmod-sched-cake: bump to latest bake of cake for 17.01Kevin Darbyshire-Bryant2017-12-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There has been recent significant activity with the cake qdisc of late but in the cobalt branch. Some of that effort is related to upstreaming to kernel & iproute2 mainline but we're not quite there yet. Relevant feature changes: ingress mode: Instead of only counting packets that make it past the shaper, include packets we've decided to drop as well, since they did arrive with us on the link and took link capacity. This mode is more suitable for shaping the ingress of a link (e.g. from ISP) rather than the more normal egress. ptm mode: Minor optimisation in packet overhead calculation. dual-src/dsthost/triple-isolate: Optimise only calculating src or dst host hashes only if required. ack-filter/ack-filter-aggressive: Filter excessive TCP ACKS. Useful in highly assymetric links (downstream v upstream capacity) where the majority of upstream link capacity is occupied with ACKS for downstream traffic. A separate iproute2 patch to teach it about Cake's new features will follow. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
* mac80211: don't pass the hostapd ctrl iface in adhocAntonio Quartulli2017-12-131-2/+8
| | | | | | | | Passing the ctrl iface to wpa_supplicant will automatically cause wpa_supplicant to send "STOP_AP" messages to the hostapd. This breaks the AP interfaces. Signed-off-by: Antonio Quartulli <ordex@autistici.org> (cherry picked from commit 0da54fa6428ea98d31b49f5d9a4a272214f5d188)
* kmod-sched-cake: drop maintainerKevin Darbyshire-Bryant2017-12-131-1/+0
| | | | | | | Drop myself from maintainership of 'cake'. Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk> (cherry picked from commit c7f8bcede6be73d0c07e058d57b55e4efc746440)
* netfilter: add iptables-mod-rpfilter packageAlin Nastac2017-12-131-0/+18
| | | | | | | | | | Unlike /proc/sys/net/ipv4/conf/INTF/rp_filter flag, rule iptables -t raw -I PREROUTING -m rpfilter --invert -j DROP prevents conntrack table to become full when a packet flood with randomly selected source IP addresses is received from the lan side. Signed-off-by: Alin Nastac <alin.nastac@gmail.com> (cherry picked from commit d8748e537f11ab5f2b5e2ed25d94baa5ce353984)
* mac80211: gracefully handle preexisting VIFJo-Philipp Wich2017-12-131-0/+6
| | | | | | | | | | | | | | | | | | | | | Gracefully handle cases where the to-be-created wireless interface already exists on the system which might commonly happen with non-multi-SSID capable wireless drivers. This fixes commit 8301e613655c2d95fa5430a1a57d92d966fdc70b which caused previously ignored "Too many open files in system (-23)" errors to fail the wireless setup procedure. With the updated approach we'll still try recreating the vif after one second if the first attempt to do so failed with ENFILE but we will now consider the operation successfull if a second attempt still yields ENFILE with the requested ifname already existing on the system. Fixes FS#664, FS#704. Suggested-by: Vittorio Gambaletta <openwrt@vittgam.net> Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit 4a033475453b63d0d5ae41489e7c395882567698)
* kernel: allow selecting RTC drivers on targets without explicit RTC supportFelix Fietkau2017-12-131-8/+15
| | | | | | | Keep them disabled by default to avoid pulling in extra kernel bloat Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry picked from commit 5afe9a054cbcb1630a42200f3ac799432522a87d)
* mac80211: Fix race condition leading to wifi interfaces not coming up at ↵Vittorio Gambaletta2017-12-131-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | boot sometimes. In the drv_mac80211_setup function, mac80211_interface_cleanup is called to ask the kernel to delete all existing interfaces for the phy that is being configured via netlink. Later in the first function, mac80211_prepare_vif is called to set up the new interfaces as required. But sometimes, when mac80211_prepare_vif (and so the relevant `iw phy x interface add y` command) runs, the kernel might still be cleaning up the old interface with the same ifname. It usually takes very few time to do that; possibly a few milliseconds of sleep in the script after detecting this error condition could be enough, but the busybox sh does not support sub-second sleep intervals. When this happens, iw obviously fails to create the new interface; and the following message is printed in the system log, followed by subsequent failure messages from hostapd in case this would have been an AP interface. Tue Mar 14 04:21:57 2017 daemon.notice netifd: radio1 (2767): command failed: Too many open files in system (-23) This was a long-standing issue existing since at least OpenWrt Backfire, and today I finally managed to debug and (hopefully) solve it. It was happening very few times on most devices; but it was happening a lot more frequently on fast platforms with multiple radios, such as the powerpc-based dual-ath9k-radio tl-wdr4900-v1. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net> (cherry picked from commit 8301e613655c2d95fa5430a1a57d92d966fdc70b)
* mt76: update to the latest versionFelix Fietkau2017-12-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Significant performance/stability improvements for MT76x2 and MT7603. Adds LED support. Changes: 2895775 mt76x2: mcu: remove unused parameter in mt76x2_mcu_msg_alloc signature 1dae8f0 mt7603: mcu: remove unused parameter in mt7603_mcu_msg_alloc() signature 5e49aa9 Fix errors found by cppcheck 1b8c8a0 mt7603: add LED definition registers 4d83561 mt76x2: add LED register definitions 2f40e4a mt76x2: Support using PCI ID as chip ID 27c64bc mt76: add led support using mac80211 led framework dfd64fc mt76x2: init: add ma80211 led callbacks 215edf1 mt7603: init: add ma80211 led callbacks 9d36ff2 mt76x2: Add PCI identifier for MT7602 0b7984e mt7603: remove unnecessary mcu register read function f5498d2 debugfs: add support for changing the LED pin 8e453b3 mac80211: move DT led configuration to the "led" child node 8f1673a mt76x2: limit client WCID entries to 0-127 f9d9c22 mt76x2: clear drop flag for all WCIDs on init 0dd8b68 mt76x2: clear per-WCID tx rate lookup register 3e5afe7 mt76x2: add helper function for setting drop mask 941555b mt76x2: clear drop mask when sending a PS response 7dfb354 mt76: increase rx ring size for mt76x2 73902dc mt76x2: add rx statistics registers fe79816 mt76x2: fix LNA gain register annotation cc588c5 mt76x2: sync channel gain value with latest reference driver 60a4d67 mt76x2: implement dynamic AGC tuning based on false packet detection count 4bc9aa9 mt76x2: add more gain tuning based on the latest reference driver 0a0d16f mt76x2: sync tx power related values with reference driver 8c821aa mac80211: add missing include 82acc85 mt7603: add missing include required on newer kernels 2c1a77c mt76x2: fix transmission of encrypted management frames 0532315 mt76x2: increase OFDM SIFS time 1acde21 mt76x2: add channel argument to eeprom tx power functions 58364a2 mt76x2: initialize channel power limits c2bd89e mt76x2: convert between per-chain tx power and combined output e7eaa7c mt7603: rename mt7603_mac_reset to mt7603_pse_reset ea4c2a1 mt7603: rename MT_PSE_RESET register c86c3a0 mt7603: remove watchdog reset on interface stop 4490f93 mt7603: remove WARN_ON_ONCE for workaround checks 3075059 mt7603: simplify PSE reset 4ed7e07 mt7603: warn if PSE reset fails 7dc8db1 mt7603: clean up dma debug reads 41e6a04 mt7603: make mt7603_mac_watchdog_reset() static dc7a351 mt7603: clear wtbl PS bit for powersave responses 123acf2 mt7603: set tx-skip flag for powersave clients 7dd2a9e mt7603: initialize wtbl ps flag on station add 86ddef3 mt76x2: remove some harmless WARN_ONs in tx status and rx path e326bc2 mt7603: remove some harmless WARN_ONs in rx path Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: backport kernel fix for CVE-2017-13080Stijn Tintel2017-10-171-0/+81
| | | | | Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> (cherry picked from commit 2f701194c29da50bfda968a83c6609843f74a7f4)
* mac80211: Update wireless-regdb to master-2017-03-07Ryan Mounce2017-10-161-12/+19
| | | | | | | | | | | | | | | | | The short log of changes since the 2016-06-10 release is below. Jouni Malinen (1): wireless-regdb: Remove DFS requirement for India (IN) Ryan Mounce (1): wireless-regdb: Update rules for Australia (AU) and add 60GHz rules Seth Forshee (2): wireless-regdb: Update 5 GHz rules for Canada wireless-regdb: update regulatory.bin based on preceding changes Signed-off-by: Ryan Mounce <ryan@mounce.com.au> (cherry picked from commit 8b12e62e9cd6ba2e3bb2e7f2555180df0173c7c6)
* brcmfmac: backport length check in brcmf_cfg80211_escan_handler()Felix Fietkau2017-10-161-0/+63
| | | | | | Fixes CVE-2017-0786 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: sync with version 878456caf60d from masterFelix Fietkau2017-10-131-4/+4
| | | | | | | Backport required DT changes from commit dabdd123c90c. Significantly improves stability and performance for MT76x2 and MT7603 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ltq-vdsl-mei: revert disable optimized firmware downloadMathias Kresin2017-09-301-2/+2
| | | | | | | | | | | | This reverts commit b428f45c062dc8ca8c2f35f491fa467dc5b85519. If the optimized firmware download is disabled, the xdsl subsystem hangs in the "idle request" state after physically disconnecting and reconnecting the xdsl modem from the line. It might fix the failing line init on boot as well. Signed-off-by: Mathias Kresin <dev@kresin.me>
* ltq-vdsl-mei: disable optimized firmware downloadMathias Kresin2017-09-281-2/+2
| | | | | | | | | With ltq-vdsl-mei 1.5.17.6 an optimized firmware download was added and enabled by default. As soon as the optimized firmware download is enabled, a watchdog based reboot is trigger between 24h to 48h of uptime if the board isn't connected to a xdsl line. Signed-off-by: Mathias Kresin <dev@kresin.me>
* ltq-vdsl: fix PM thread suspend and resume handlingMartin Schiller2017-09-282-1/+108
| | | | | | | | This is a backport form drv_dsl_cpe_api-4.18.10 and fixes some PM thread handling issues which lead to high system load and watchdog trigger within 1h of uptime for boards not connected to a xdsl line. Signed-off-by: Martin Schiller <ms@dev.tdt.de>
* treewide: fix shellscript syntax errors/typosLorenzo Santina2017-09-132-2/+2
| | | | | | | | | Fix multiple syntax errors in shelscripts (of packages only) These errors were causing many conditions to not working properly Signed-off-by: Lorenzo Santina <lorenzo.santina@edu.unito.it> [increase PKG_RELEASE, drop command substitution from directip.sh] Signed-off-by: Mathias Kresin <dev@kresin.em>
* kernel: netfilter: fix nf-nathelper(-extra) descriptionUwe Arnold2017-07-251-2/+2
| | | | | | | | | The tftp and irc netfilter modules are provided by nf-nathelper-extra and not by nf-nathelper. Signed-off-by: Uwe Arnold <donvipre@gmail.com> [move the irc module as well] Signed-off-by: Mathias Kresin <dev@kresin.me>
* mwlwifi: update to version 10.3.4.0 / 2017-06-06Jo-Philipp Wich2017-06-081-3/+3
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* mac80211, hostapd: always explicitly set beacon intervalMatthias Schiffer2017-05-272-5/+7
| | | | | | | | | | | | | | | | One of the latest mac80211 updates added sanity checks, requiring the beacon intervals of all VIFs of the same radio to match. This often broke AP+11s setups, as these modes use different default intervals, at least in some configurations (observed on ath9k). Instead of relying on driver or hostapd defaults, change the scripts to always explicitly set the beacon interval, defaulting to 100. This also applies the beacon interval to 11s interfaces, which had been forgotten before. VIF-specific beacon_int setting is removed from hostapd.sh. Fixes FS#619. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* kernel: fix autoloading arch-specific modulesYousong Zhou2017-05-253-9/+9
| | | | | | Fixes FS#745 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* backlight-pwm: fix module descriptionYousong Zhou2017-05-251-1/+1
| | | | Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* om-watchdog: add support for Teltonika RUT5xx (ramips)Steffen Weinreich2017-05-152-1/+10
| | | | | | | | | | | Add rut5xx GPIO PIN selection to om-package startup script. Testet on a RUT500 device, the timeout value of the hardware watchdog is about 280 sec. Signed-off-by: Steffen Weinreich <steve@weinreich.org> [split into two commits, bump PKG_RELEASE] Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
* om-watchdog: cosmetic code style fixesPiotr Dymacz2017-05-151-31/+31
| | | | Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
* om-watchdog: cleanup MakefilePiotr Dymacz2017-05-151-8/+0
| | | | | | Drop redundant Build/Prepare, empty lines and duplicated Build/Compile. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
* mac80211: rt2800: fix mt7620 E2 channel registersTomislav Požega2017-05-021-0/+41
| | | | | | | | update RF register 47 and 54 values according to vendor driver Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> [daniel@makrotopia.org: moved changes into a separate patch]
* mac80211: rt2800: fix mt7620 vco calibration registersTomislav Požega2017-05-021-0/+50
| | | | | | | | | | Use register values from init LNA function instead of the ones from restore LNA function. Apply register values based on rx path configuration. Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> [daniel@makrotopia.org: moved changes into a separate patch]
* mac80211: rt2x00: fix MT7620 LNA gain and VCO-after-ALCDaniel Golle2017-05-022-0/+88
| | | | | | | This should fix issues with bad RX as well as AP not coming up and/or scanning failing. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mac80211: rt2x00: import upstream changes and rebase our patchesDaniel Golle2017-05-0249-189/+1676
| | | | | | | | Some of our local patches have been accepted upstream. And there are some more relevant changes (mostly for rt2800usb). Import them and rebase our remaining local patches on top. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* rt2x00: mt7620: make fixes requested upstreamDaniel Golle2017-05-021-170/+674
| | | | | | | | Introduce RT6352 instead of matching against RF7620. Clean up channel setting rfvals. Port bandwidth filter calibration. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* rt2x00: mt7620: yet another beauty sessionDaniel Golle2017-05-021-171/+524
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So here is another round of improvements for MT7620 WiFi. This commit fixes a few significant issues related to TX_PWR_CFG_x and TX_ALC and also makes the code more readable by adding register descriptions for things added for MT7620 and use the usual bit-field access macros and the now defined macros instead of plain bit-ops and magic numbers. Properly describe EEPROM_TARGET_POWER at word 0x68 (== byte 0xD0) and thereby fix internal TXALC which would otherwise just read out-of-bounds of the EEPROM map. Split-out tx-power/ALC related stuff into an additional function. Fix VCO calibration, it was carried out properly in the channel switching but incomplete in the actual VCO calibration function. Also there is no need to trigger VCO calibration in channel switching, the VCO calibration function is already being called at this point. Remove it from channel switching function to avoid redundant code. The TX power calibration differs significantly from all other Mediatek/Ralink chips: They finally allow 0.5dB steps stored as 8-bit values for (almost) each bitrate -- and promptly ran out of space and for some reason didn't want to change the EEPROM layout. The hence opted for a scheme of sharing values for some adjecent bitrates and a highly over-complicated (or obfuscated?) way to populate the TX_PWR_CFG_x registers with the values stored in the EEPROM. The code here now looks much less complicated than what you see in the vendor's driver, however, it does the exact same thing: bGpwrdeltaMinus is a constant and always TRUE, hence half of the code was dead. Gpwrdelta is always 0 (rather than using the value read from the EEPROM). What remains is some very grotesque effort to avoid 0x20, probably some hardware bug related to some misunderstanding of what a singed 8-bit value is (imagine: if it was a signed 6-bit value then someone could believe that 0x20 == 0x0). And then they didn't clean it up once they later on anandonned that whole story of having a constant offset for 40 MHz channels and just set the offset to be constant 0 -- there is no effort for avoiding 0x20 for the 20 MHz values stored in the EEPROM, hence that's probably just a forbidden value in the EEPROM specs and won't appear anyway... Anyway, the whole thing felt like solving some college math test where in the end everything cancels out and the result equals 0 ;) To make sure that channel bandwidth power compensation really doesn't need to be taken care of, output a warning when the corresponding value stored in the EEPROM is non-zero. Also there is no apparent reason to refrain from initializing RFCSR register 13, it doesn't fail what-so-ever. Signed-off-by: Daniel Golle <daniel@makrotopia.org>