Commit Graph
2904 Commits
Author SHA1 Message Date
Deren WuandFelix Fietkau fa187f5cf0 mt76: fix timestamp check in tx_status
Should keep SKBs only if timeout timestamp is still after jiffies.
Otherwise, report tx status and drop it direclty.

Fixes: bd1e3e7b693c ("mt76: introduce packet_id idr")
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-22 16:02:09 +01:00
Bo JiaoandFelix Fietkau 256789bb40 mt76: fix the wiphy's available antennas to the correct value
the wiphy's available antennas may be incorrect
When ext phy's antenna_mask is different from main phy

Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Xing SongandFelix Fietkau 526591b203 mt76: do not pass the received frame with decryption error
MAC80211 doesn't care any decryption error in 802.3 path, so received
frame will be dropped if HW tell us that the cipher configuration is not
matched as well as the header has been translated to 802.3. This case only
appears when IEEE80211_FCTL_PROTECTED is 0 and cipher suit is not none in
the corresponding HW entry.

The received frame is only reported to monitor interface if HW decryption
block tell us there is ICV error or CCMP/BIP/WPI MIC error. Note in this
case the reported frame is decrypted 802.11 frame and the payload may be
malformed due to mismatched key.

Signed-off-by: Xing Song <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Lorenzo BianconiandFelix Fietkau 39f6c37127 mt76: connac: remove PHY_MODE_AX_6G configuration in mt76_connac_get_phy_mode
Get rid of PHY_MODE_AX_6G configuration in mt76_connac_get_phy_mode
routine since mode is an u8 and PHY_MODE_AX_6G is set in phymode_ext
field in mt76_connac_bss_basic_tlv.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Lorenzo BianconiandFelix Fietkau 05953e7d6f mt76: mt7615: remove dead code in get_omac_idx
Remove always false if condition in get_omac_idx for sta type

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Lorenzo BianconiandFelix Fietkau 78fc0dcdce mt76: connac: fix a theoretical NULL pointer dereference in mt76_connac_get_phy_mode
Even if it is not a real bug since mt76_connac_get_phy_mode runs just
for mt7921 where only STA is supported, fix a theoretical NULL pointer
dereference if new added modes do not support HE

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Lorenzo BianconiandFelix Fietkau 9680a17b0a mt76: mt7921: fix possible NULL pointer dereference in mt7921_mac_write_txwi
Fix a possible NULL pointer deference issue in mt7921_mac_write_txwi
routine if vif is NULL.

Fixes: 33920b2bf0483 ("mt76: add support for setting mcast rate")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Lorenzo BianconiandFelix Fietkau c1574466c7 mt76: fix possible OOB issue in mt76_calculate_default_rate
Cap max offset value to ARRAY_SIZE(mt76_rates) - 1 in
mt76_calculate_default_rate routine in order to avoid possible Out Of
Bound accesses.

Fixes: 33920b2bf0483 ("mt76: add support for setting mcast rate")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Deren WuandFelix Fietkau 00b6f497e2 mt76: mt7921: introduce 160 MHz channel bandwidth support
Introduce the basic configuration for BW160 capability in 7922

Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Lorenzo BianconiandFelix Fietkau ca39b4bbc2 mt76: debugfs: fix queue reporting for mt76-usb
Fix number of rx-queued frames reported by mt76_usb driver.

Reported-by: kernel test robot <[email protected]>
Fixes: 2d8be76c1674 ("mt76: debugfs: improve queue node readability")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Deren WuandFelix Fietkau 91c5da3d0a mt76: mt7921: add support for PCIe ID 0x0608/0x0616
New mt7921 serials chip support

Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Shayne ChenandFelix Fietkau 0c489ea286 mt76: testmode: add support to set MAC
Add support to set SA/DA/BSSID in testmode.
During mass production stage, some test scripts or test equipments need
to set fixed addresses to detect or parse if a test is passed.
Also, MAC setting is necessary for some tx/rx tests with rx filter,
to make sure rx site only receives expected packets.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Shayne ChenandFelix Fietkau f1520c9bb3 mt76: mt7915: add default calibrated data support
Load the default eeprom data when the content of flash/efuse is invalid.
This could help to eliminate some issues due to incorrect or
insufficient rf values.

Co-developed-by: Bo Jiao <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Ryder LeeandFelix Fietkau dd054b7e16 mt76: only set rx radiotap flag from within decoder functions
Only set RX_FLAG_RADIOTAP_HE and RX_FLAG_RADIOTAP_HE_MU from with their
own decoder functions to prevent header calculation error.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Lorenzo BianconiandFelix Fietkau c9bca3ed95 mt76: mt7915: fix NULL pointer dereference in mt7915_get_phy_mode
Fix the following NULL pointer dereference in mt7915_get_phy_mode
routine adding an ibss interface to the mt7915 driver.

[  101.137097] wlan0: Trigger new scan to find an IBSS to join
[  102.827039] wlan0: Creating new IBSS network, BSSID 26:a4:50:1a:6e:69
[  103.064756] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[  103.073670] Mem abort info:
[  103.076520]   ESR = 0x96000005
[  103.079614]   EC = 0x25: DABT (current EL), IL = 32 bits
[  103.084934]   SET = 0, FnV = 0
[  103.088042]   EA = 0, S1PTW = 0
[  103.091215] Data abort info:
[  103.094104]   ISV = 0, ISS = 0x00000005
[  103.098041]   CM = 0, WnR = 0
[  103.101044] user pgtable: 4k pages, 39-bit VAs, pgdp=00000000460b1000
[  103.107565] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
[  103.116590] Internal error: Oops: 96000005 [#1] SMP
[  103.189066] CPU: 1 PID: 333 Comm: kworker/u4:3 Not tainted 5.10.75 #0
[  103.195498] Hardware name: MediaTek MT7622 RFB1 board (DT)
[  103.201124] Workqueue: phy0 ieee80211_iface_work [mac80211]
[  103.206695] pstate: 20000005 (nzCv daif -PAN -UAO -TCO BTYPE=--)
[  103.212705] pc : mt7915_get_phy_mode+0x68/0x120 [mt7915e]
[  103.218103] lr : mt7915_mcu_add_bss_info+0x11c/0x760 [mt7915e]
[  103.223927] sp : ffffffc011cdb9e0
[  103.227235] x29: ffffffc011cdb9e0 x28: ffffff8006563098
[  103.232545] x27: ffffff8005f4da22 x26: ffffff800685ac40
[  103.237855] x25: 0000000000000001 x24: 000000000000011f
[  103.243165] x23: ffffff8005f4e260 x22: ffffff8006567918
[  103.248475] x21: ffffff8005f4df80 x20: ffffff800685ac58
[  103.253785] x19: ffffff8006744400 x18: 0000000000000000
[  103.259094] x17: 0000000000000000 x16: 0000000000000001
[  103.264403] x15: 000899c3a2d9d2e4 x14: 000899bdc3c3a1c8
[  103.269713] x13: 0000000000000000 x12: 0000000000000000
[  103.275024] x11: ffffffc010e30c20 x10: 0000000000000000
[  103.280333] x9 : 0000000000000050 x8 : ffffff8006567d88
[  103.285642] x7 : ffffff8006563b5c x6 : ffffff8006563b44
[  103.290952] x5 : 0000000000000002 x4 : 0000000000000001
[  103.296262] x3 : 0000000000000001 x2 : 0000000000000001
[  103.301572] x1 : 0000000000000000 x0 : 0000000000000011
[  103.306882] Call trace:
[  103.309328]  mt7915_get_phy_mode+0x68/0x120 [mt7915e]
[  103.314378]  mt7915_bss_info_changed+0x198/0x200 [mt7915e]
[  103.319941]  ieee80211_bss_info_change_notify+0x128/0x290 [mac80211]
[  103.326360]  __ieee80211_sta_join_ibss+0x308/0x6c4 [mac80211]
[  103.332171]  ieee80211_sta_create_ibss+0x8c/0x10c [mac80211]
[  103.337895]  ieee80211_ibss_work+0x3dc/0x614 [mac80211]
[  103.343185]  ieee80211_iface_work+0x388/0x3f0 [mac80211]
[  103.348495]  process_one_work+0x288/0x690
[  103.352499]  worker_thread+0x70/0x464
[  103.356157]  kthread+0x144/0x150
[  103.359380]  ret_from_fork+0x10/0x18
[  103.362952] Code: 394008c3 52800220 394000e4 7100007f (39400023)

Fixes: 37f4ca907c46 ("mt76: mt7915: register per-phy HE capabilities for each interface")
Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 18:14:42 +01:00
Xing SongandFelix Fietkau e814e15716 mt76: reverse the first fragmented frame to 802.11
The HW can apply header translation to first fragmented frame, and
ramaining fragmented frame can only keep 802.11 format. Check and
reverse the first fragmented frame to  802.11 format to make sure
them can be defragmented by mac80211.

Signed-off-by: Xing Song <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-12 13:13:18 +01:00
Ryder LeeandFelix Fietkau ae8e02ddd2 mt76: mt7915: fix SMPS operation fail
TGn fails sending SM power save mode action frame to the AP to switch
from dynamic SMPS mode to static mode.

Reported-by: Fang Zhao <[email protected]>
Signed-off-by: Fang Zhao <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-12 13:13:18 +01:00
Shayne ChenandFelix Fietkau f44685f2fa mt76: mt7915: fix return condition in mt7915_tm_reg_backup_restore()
Fix the issue that some registers not configured properly after
restarting testmode.
(e.g. change state from idle to off, and off to idle)

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-12 13:13:18 +01:00
Sean WangandFelix Fietkau 29a8a08827 mt76: mt7921: fix MT7921E reset failure
There is a missing mt7921e_driver_own in the MT7921E reset procedure
since the mt7921 mcu.c has been refactored for MT7921S, that will
result in MT7921E reset failure, so add it back now.

Fixes: dfc7743de1eb ("mt76: mt7921: refactor mcu.c to be bus independent")
Reported-by: YN Chen <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-12 13:13:18 +01:00
Peter ChiuandFelix Fietkau f5ad840ca5 mt76: mt7615: fix possible deadlock while mt7615_register_ext_phy()
ieee80211_register_hw() is called with rtnl_lock held, and this could be
caused lockdep from a work item that's on a workqueue that is flushed
with the rtnl held.

Move mt7615_register_ext_phy() outside the init_work().

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-12 13:13:18 +01:00
Sean WangandFelix Fietkau f5cfaaff3d mt76: mt7921: drop offload_flags overwritten
offload_flags have to be dropped for mt7921 because mt76.omac_idx 0 would
always run as station mode that would cause Tx encapsulation setting
is not applied to mac80211.

Also, drop IEEE80211_OFFLOAD_ENCAP_4ADDR too because it is not really
being supported.

Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-12 13:13:18 +01:00
Lorenzo BianconiandFelix Fietkau 5dd32475c8 mt76: mt7915: get rid of mt7915_mcu_set_fixed_rate routine
Fix the following sparse warning removing mt7915_mcu_set_fixed_rate
since it is no longer used:
warning: symbol 'mt7915_mcu_set_fixed_rate' was not declared.
Should it be static?

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-12 13:13:18 +01:00
Felix Fietkau f6bde7ba82 mt76: connac: fix unresolved symbols when CONFIG_PM is unset
mt76_connac_mcu_reg_* functions are always needed by connac based drivers

Fixes: 87f9bf24ea84 ("mt76: connac: move mcu reg access utility routines in mt76_connac_lib module")
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 13:24:17 +02:00
Randy DunlapandFelix Fietkau 1d01257662 wireless: mediatek: mt7921: fix Wformat build warning
ARRAY_SIZE() is of type size_t, so the format specfier should
be %zu instead of %lu.

Fixes this build warning:

../drivers/net/wireless/mediatek/mt76/mt7921/main.c: In function ‘mt7921_get_et_stats’:
../drivers/net/wireless/mediatek/mt76/mt7921/main.c:1024:26: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
   dev_err(dev->mt76.dev, "ei: %d  SSTATS_LEN: %lu",

Signed-off-by: Randy Dunlap <[email protected]>
Cc: Sean Wang <[email protected]>
Cc: [email protected]
Cc: Felix Fietkau <[email protected]>
Cc: Lorenzo Bianconi <[email protected]>
Cc: Ryder Lee <[email protected]>
Cc: Kalle Valo <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:31 +02:00
Cai HuoqingandFelix Fietkau fd25a55096 mt76: Make use of the helper macro kthread_run()
Repalce kthread_create/wake_up_process() with kthread_run()
to simplify the code.

Signed-off-by: Cai Huoqing <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:31 +02:00
Hauke MehrtensandFelix Fietkau f81f42fe87 mt76: Print error message when reading EEPROM from mtd failed
When the EEPROM data is stored on a MTD partition print an error message
when reading this MTD partition failed. This is currently happening
often in OpenWrt because the initial data was written with using a flash
driver which ignores the error detection data and now OpenWrt uses a
driver which checks it.

With this patch a better error message is shown:
[    8.986988] mt7915e 0000:01:00.0: WA Firmware Version: DEV_000000, Build Time: 20201105222323
[    9.100508] mt7915e 0000:01:00.0: reading EEPROM from mtd factory failed: -117
[    9.144289] mt7915e: probe of 0000:01:00.0 failed with error -22

mt7915 does not work without an EEPROM, MT7922 still works.

Signed-off-by: Hauke Mehrtens <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:31 +02:00
Lorenzo BianconiandFelix Fietkau 754d4a37ab mt76: mt7921: fix mt7921s Kconfig
Add missing MMC dependency in mt7921s Kconfig

Fixes: 48fab5bbef409 ("mt76: mt7921: introduce mt7921s support")
Reported-by: Randy Dunlap <[email protected]>
Tested-by: Randy Dunlap <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Lorenzo BianconiandFelix Fietkau 0f49a22314 mt76: mt7921: disable 4addr capability
4addr is not supported by the driver/firmware yet

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Shayne ChenandFelix Fietkau ed3d8569c4 mt76: mt7915: add debugfs knobs for MCU utilization
Add debugfs knobs to read MCU utilization, which helps user know
firmware status more easily to narrow down CPU bottleneck issues.

Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Shayne ChenandFelix Fietkau b52adf9815 mt76: mt7915: add WA firmware log support
Support to turn on/off WA firmware log from debugfs.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Lorenzo BianconiandFelix Fietkau b68af355f7 mt76: mt7915: fix endiannes warning mt7915_mcu_beacon_check_caps
Fix the following sparse warning mt7915_mcu_beacon_check_caps routine:
warning: cast to restricted __le32
warning: cast from restricted __le16

Fixes: 22dffbddf0167 ("mt76: mt7915: introduce mt7915_mcu_beacon_check_caps()")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Ryder LeeandFelix Fietkau 577d45f6e4 mt76: mt7915: rework debugfs fixed-rate knob
Switch to use new mt7915_mcu_set_fixed_rate_ctrl().

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Ryder LeeandFelix Fietkau 2c8c3bcd76 mt76: mt7915: rework .set_bitrate_mask() to support more options
With this patch, driver can support single rate, (HE)GI and HE_LTF
configuration through .set_bitrate_mask().

Tested-by: MeiChia Chiu <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Ryder LeeandFelix Fietkau 4d2e81d9ec mt76: mt7915: remove mt7915_mcu_add_he()
Make mt7915_mcu_sta_he_tlv() as a part of mt7915_mcu_add_rate_ctrl() as
firmware rate control should get HE rate information from sta_rec_he,
and reduce a global function accordingly.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Ryder LeeandFelix Fietkau 9d288d7c0c mt76: mt7615: apply cached RF data for DBDC
Band0 and band1 share the same hardware, so band0 will stop Tx/Rx when
band1 performs Rx calibration. cal_cache is introduced to solve such
corner cases by moving necessary datas from channel_switch to bootup.

Co-developed-by: Peter Chiu <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Shayne ChenandFelix Fietkau b649678c18 mt76: mt7915: change max rx len limit of hw modules
Update max rx len of some hw modules, which aligns out vendor SDK.
In normal modes, we exchange MPDU 7991 cap with peers; however, this
won't play a part in sniffer mode.
To prevent packets which exceed the max MPDU size from entering specific
rx path in hw, we need to set a proper limit to filter them out.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-20 10:32:31 +02:00
Shayne ChenandFelix Fietkau 5fbb686e9c mt76: mt7915: fix missing HE phy cap
Fix missing HE phy cap related to vif and starec setting.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-20 10:32:31 +02:00
Shayne ChenandFelix Fietkau a0b94987df mt76: mt7915: rework mt7915_mcu_sta_muru_tlv()
Re-order and modify conditions for MU DL/UL and ofdma DL fields, and
also clean up some unnecessary zero settings.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-20 10:32:31 +02:00
Shayne ChenandFelix Fietkau cfbbd861eb mt76: mt7915: enable HE UL MU-MIMO
Enable HE UL MU-MIMO in sta_rec_muru, which works on both ap and station
mode.

For sending trigger frames, one of the conditions fw uses is to check if
mib rx airtime meets the threshold.
There's a main control of mib rx airtime report register in fw, so we
need to enable the register by mcu cmd instead of directly writing it,
otherwise it will still be disabled by fw.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-20 10:32:31 +02:00
Lorenzo BianconiandFelix Fietkau 35b8025f46 mt76: mt7921: add per-vif counters in ethtool
Similar to mt7915 driver, add per-vif tx counters in ethtool.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau 4b65fbc4e2 mt76: mt7921: move tx amsdu stats in mib_stats
Move tx_amsdu histogram stats in mib_stats structure since registers are
clear-on-read

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau 69154ae23f mt76: mt7921: add sta stats accounting in mt7921_mac_add_txs_skb
This is a preliminary patch to add ethtool stats to mt7921 driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau 5ffe086fcd mt76: mt7921: introduce stats reporting through ethtool
Similar to mt7915 driver, add tx/rx statistics reporting through ethtool.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau d8837b7c8d mt76: mt7921: add some more MIB counters
This is a preliminary patch to introduce ethtool stats support to mt7921
driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau 486da6fa25 mt76: do not reset MIB counters in get_stats callback
MIB counters are used for ethtool stats as well

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau 4a11cb67dc mt76: mt7915: move tx amsdu stats in mib_stats
Move tx_amsdu histogram stats in mib_stats structure since registers are
clear-on-read

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau f80ab6dde6 mt76: mt7915: run mt7915_get_et_stats holding mt76 mutex
Since it can run in parallel with mac_work, hold mutex lock in
mt7915_get_et_stats. Moreover update mib counters running
mt7915_get_et_stats.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau 094e085abf mt76: move mt76_ethtool_worker_info in mt76 module
Move mt76_ethtool_worker_info in common code in order to be reused in
mt7921 driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau d54796787c mt76: move mt76_sta_stats in mt76.h
This is a preliminary patch to add ethtool stats to mt7921 driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Richard HuynhandFelix Fietkau 645eac64be mt76: mt76x0: correct VHT MCS 8/9 tx power eeprom offset
Appears to have incorrectly offset 0x120 + 0x12 instead of 12 decimal,
leading to bogus power values being used.

Signed-off-by: Richard Huynh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:30:30 +02:00