Commit Graph

96956 Commits

Author SHA1 Message Date
Lorenzo Bianconi
2f89ab5db6 mt76: mt7615: introduce quota debugfs node for mt7663s
Add sched_quota debugfs node for mt7663s. Scheduling quota stats
are useful for debugging

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:15 +01:00
Lorenzo Bianconi
7124198ab1 mt76: mt7615: enable beacon filtering by default for offload fw
In order to reduce cpu cycles, enable hw beacon filter by default if
the device is running offload fw with sta only interfaces.
Disable runtime pm for multi-vif scenario.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:15 +01:00
Felix Fietkau
ed89b89330 mt76: add back the SUPPORTS_REORDERING_BUFFER flag
It was accidentally dropped while adding multiple wiphy support
Fixes fast-rx support and avoids handling reordering in both mac80211
and the driver

Cc: stable@vger.kernel.org
Fixes: c89d362541 ("mt76: add function for allocating an extra wiphy")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:15 +01:00
Felix Fietkau
11553d88d0 mt76: mt7915: query station rx rate from firmware
When per-packet rate reporting is enabled, the hardware can get stuck under
some conditions. It self-recovers quickly, but in practice this leads to
reduced performance.
In order to avoid running into this issue, disable per-packet rate reporting
by default and query the rx rate from firmware instead, unless monitor mode
is enabled.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:15 +01:00
Felix Fietkau
99de49fc6f mt76: mt7915: move eeprom parsing out of mt7915_mcu_parse_response
Use the new mt76_mcu_send_and_get_msg function

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:15 +01:00
Felix Fietkau
ae5ad6272d mt76: implement functions to get the response skb for MCU calls
Can be used by the caller to get the response data directly instead of using the
hack of storing the result in internal data structures from .mcu_parse_response

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:15 +01:00
Felix Fietkau
14b80ba245 mt76: mt7603: switch to .mcu_skb_send_msg
Reduces code duplication

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:15 +01:00
Felix Fietkau
64537a0213 mt76: make mcu_ops->mcu_send_msg optional
Remove it from mt7615 and mt7915 and implement it in core code instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:15 +01:00
Felix Fietkau
e452c6eb55 mt76: move waiting and locking out of mcu_ops->mcu_skb_send_msg
This removes some code duplication and prepares the code for making
the MCU API more flexible

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:15 +01:00
Felix Fietkau
96a607b643 mt76: move mcu timeout handling to .mcu_parse_response
Preparation for further cleanup

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:14 +01:00
Felix Fietkau
f320d812b7 mt76: implement .mcu_parse_response in struct mt76_mcu_ops
Do not free skb inside that function
Preparation for further cleanup

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:14 +01:00
Felix Fietkau
fa62d0e008 mt76: rename __mt76_mcu_skb_send_msg to mt76_mcu_skb_send_msg
Preparation for further cleanup

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:14 +01:00
Felix Fietkau
cb5cdd4c8d mt76: rename __mt76_mcu_send_msg to mt76_mcu_send_msg
Preparation for further cleanup

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:14 +01:00
Felix Fietkau
9b60eb90a1 mt76: mt7915: disable OFDMA/MU-MIMO UL
The feature is not ready in firmware yet, and it leads to hangs

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:14 +01:00
Felix Fietkau
bfff24de19 mt76: mt7915: fix DRR sta bss group index
The firmware/hardware supports only 16 entries. Trying to use more can lead
to timeouts on some firmware versions

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:14 +01:00
Felix Fietkau
660915d052 mt76: mt7915: use napi_consume_skb to bulk-free tx skbs
Slightly improves performance

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:14 +01:00
Felix Fietkau
6425791d35 mt76: mt7915: fix processing txfree events
In the MT7915 info, the fields for the WLAN index / queue overlap with the
token id, and the MT_TX_FREE_PAIR bit indicates, which one is present.

If MT_TX_FREE_PAIR is set, skip processing the token index, since the data
will not be valid.

This fixes accidentally freeing tokens which are still in use by the
hardware with a wrong station pointer.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:14 +01:00
Felix Fietkau
8aa2c6f471 mt76: mt7915: support 32 station interfaces
When looking for a MAC address slot, start by using main BSSID slots 1-3,
afterwards use 16 repeater mode BSSID slots, then start using the slots
usually used for AP mode.
This search order should prevent unnecessary conflicts with AP mode interfaces
on the same PHY

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:14 +01:00
Felix Fietkau
7af1ae62dd mt76: do not set NEEDS_UNIQUE_STA_ADDR for 7615 and 7915
The newer chipsets can deal with the same STA on multiple interfaces
Preparation for supporting more station interfaces

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Felix Fietkau
d22da02842 mt76: mt7615: add debugfs knob for setting extended local mac addresses
This is primarily for testing and can be used in combination with monitor
mode to make the card respond to packets sent to a specific MAC address.
For now this is only exposed as a debug/testing feature, later on the
approach might be used to support more concurrent station interfaces

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Felix Fietkau
3298b1f866 mt76: use ieee80211_rx_list to pass frames to the network stack as a batch
Improves icache footprint

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Felix Fietkau
e151d71e50 mt76: mt7915: add encap offload for 4-address mode stations
Enable MWDS mode in firmware as well and fix txp->rept_wds_wcid for wcid >= 255

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Felix Fietkau
55f7c9b027 mt76: mt7915: add 802.11 encap offload support
It is currently limited to 3-address mode AP and STA interfaces

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Lorenzo Bianconi
6a618acb7e mt76: sdio: convert {status/net}_work to mt76_worker
In order to improve driver throughput, convert status_work and net_work
to mt76 worker APIs.
Remove txrx_wq sdio workqueue since it is no longer used

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Lorenzo Bianconi
1a3efbcc42 mt76: mt7663s: disable interrupt during txrx_worker processing
In order to reduce sdio bus contention, disable interrupts during
txrx_worker processing

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Lorenzo Bianconi
fefb584d46 mt76: mt7663s: convert txrx_work to mt76_worker
In order to improve driver throughput, convert txrx_work to mt76 worker
threads APIs.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Lorenzo Bianconi
e0ad800243 mt76: mt7663s: move tx/rx processing in the same txrx workqueue
Move mt7663 tx and rx processing in the same workqueue in order to
reduce jitter that can hit tcp performances. This is a preliminary patch
to switch to mt76 workers APIs

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Chuanhong Guo
ced050ae3a mt76: mt7615: retry if mt7615_mcu_init returns -EAGAIN
mt7615_load_patch in mt7615/mcu.c sometimes fails with:
mt7622-wmac 18000000.wmac: Failed to get patch semaphore
and returns -EAGAIN. But this error is returned all the way up to
mt7615_init_work with no actual retrial performed, leaving a
broken wireless phy.
Wait a bit and retry for up to 10 times before giving up.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:13 +01:00
Ryder Lee
77d157f200 mt76: mt7915: fix VHT LDPC capability
The MCU field should contain a boolean 0/1, not the flag itself.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:12 +01:00
Ryder Lee
998493980e mt76: mt7915: measure channel noise and report it via survey
Read per-stream measurements every 100 ms and build a simple moving average.

Tested-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 13:46:12 +01:00
Kalle Valo
9eb597c744 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git patches for v5.11. Major changes:

ath11k

* Fast Initial Link Setup (FILS) discovery and unsolicited broadcast
  probe response support

* qcom,ath11k-calibration-variant Device Tree setting

* cold boot calibration support

* new DFS region: JP

wnc36xx

* enable connection monitoring and keepalive in firmware

ath10k

* firmware IRAM recovery feature

mhi

* merge mhi-ath11k-immutable branch to make MHI API change go smoothly
2020-12-02 21:46:55 +02:00
Tom Rix
fc6877b879 wl1251: remove trailing semicolon in macro definition
The macro use will already have a semicolon.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201127180835.2769297-1-trix@redhat.com
2020-12-02 21:39:20 +02:00
Tom Rix
a460b0e1ba airo: remove trailing semicolon in macro definition
The macro use will already have a semicolon.

Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201127175821.2756988-1-trix@redhat.com
2020-12-02 21:38:54 +02:00
Ajay Singh
339754ffdb wilc1000: added queue support for WMM
Added multiple queues[BK,BE,VI,VO] to handle different priority data
packets. Before adding a packet to the queue, checked its priority from
the header, and then add to the suitable queue. The limit for each queue
is maintained separately. Also while passing the packets to the firmware
via VMM take care to select data packets based on priority and available
space.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201125114059.10006-6-ajay.kathat@microchip.com
2020-12-02 21:38:12 +02:00
Ajay Singh
9c172f30b4 wilc1000: call complete() for failure in wilc_wlan_txq_add_cfg_pkt()
Added complete() call for failure case in wilc_wlan_txq_add_cfg_pkt().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201125114059.10006-5-ajay.kathat@microchip.com
2020-12-02 21:38:11 +02:00
Ajay Singh
66aea5d198 wilc1000: free resource in wilc_wlan_txq_add_mgmt_pkt() for failure path
Before returing from wilc_wlan_txq_add_mgmt_pkt() invoke tx_complete_fn()
callback to free up allocated memory for failure case.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201125114059.10006-4-ajay.kathat@microchip.com
2020-12-02 21:38:10 +02:00
Ajay Singh
dd460e2ac0 wilc1000: free resource in wilc_wlan_txq_add_net_pkt() for failure path
Before returing from wilc_wlan_txq_add_net_pkt() invoke tx_complete_fn()
callback to free up allocated memory for failure cases.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201125114059.10006-3-ajay.kathat@microchip.com
2020-12-02 21:38:08 +02:00
Ajay Singh
c04fabacb7 wilc1000: added 'ndo_set_mac_address' callback support
Added support for 'ndo_set_mac_address call' callback to allow change of
interface MAC address.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201125114059.10006-2-ajay.kathat@microchip.com
2020-12-02 21:38:07 +02:00
Matthias Brugger
75729e110e brcmfmac: expose firmware config files through modinfo
Apart from a firmware binary the chip needs a config file used by the
FW. Add the config files to modinfo so that they can be read by
userspace.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201124120018.31358-1-matthias.bgg@kernel.org
2020-12-02 21:37:36 +02:00
Tian Tao
3b52cf6242 wlcore: Switch to using the new API kobj_to_dev()
Switch to using the new API kobj_to_dev().

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1606096062-32251-1-git-send-email-tiantao6@hisilicon.com
2020-12-02 21:25:39 +02:00
Ching-Te Ku
5b2e9a35e4 rtw88: coex: add feature to enhance HID coexistence performance
Add toggle table related function to enhance WL throughput when WL coexist
with 4/18 HID.
The toggle table feature will toggle WL/BT priority table during WL slot,
it can decrease the impact from HID's frequently packets and prevent HID
lag.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-11-pkshih@realtek.com
2020-12-02 21:24:04 +02:00
Ching-Te Ku
1a74daed6c rtw88: coex: upgrade coexistence A2DP mechanism
Add modifications for A2DP interoperability issue of TWS earphones.
Some TWS earphones has low buffer size, so it's necessary to reduce
the slot period to let it get data more frequently.
(e.g. use 4-slot to replace the original 2-slot method).

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-10-pkshih@realtek.com
2020-12-02 21:24:02 +02:00
Ching-Te Ku
79d06b20d0 rtw88: coex: add action for coexistence in hardware initial
The original setting misses some necessary configuration.
Make coexistence slot align to beacon and check the connection situation
to know if we need to extend WLAN slot or not.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-9-pkshih@realtek.com
2020-12-02 21:24:01 +02:00
Ching-Te Ku
8e6947dcb9 rtw88: coex: add function to avoid cck lock
Some AP will not follow the power save request, or it cannot stop
transmission until its queue is empty. It may bring the decreasing of
data rate.

WLAN firmware will count is the AP still leaked packet after power save
handshake was done or not to enable WLAN slot extend mechanism.

The extend WLAN slot mechanism will extend the WLAN slot after power save
handshake, 5 ms per times, maximum is 5 times to received the leaked packet
to avoid the rate lower down.

And if the transmission was already locked at CCK rate.
The extended WLAN slot can also increase the opportunity that we can
received the CCK's long packet and be released from CCK rate.

While BT multi-link status was finished, there is possible that it still
has some packet remained for seconds. Add a timer to remain the multi-link
mechanism to protect WLAN Rx.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-8-pkshih@realtek.com
2020-12-02 21:23:59 +02:00
Ching-Te Ku
c404dbd4fb rtw88: coex: change the coexistence mechanism for WLAN connected
Add a flag to make decision whether the mechanism
should go into free-run mode or not.
For now, it is always false, the flag assignment will
be implemented later.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-7-pkshih@realtek.com
2020-12-02 21:23:58 +02:00
Ching-Te Ku
6a910a2a7d rtw88: coex: change the coexistence mechanism for HID
Add TDMA slot type setting for later usage.
Since the transmission of HID profile is very frequently,
it may bring a big impact to WLAN performance.
To change slot type, it can make mechanism be more flexible.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-6-pkshih@realtek.com
2020-12-02 21:23:57 +02:00
Ching-Te Ku
4d0087e763 rtw88: coex: update AFH information while in free-run mode
In free run mode, this WLAN info updating is only related to AFH
information, not related to the connection state, which is the current
implementation.
Always update WLAN info in free run mode now.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-5-pkshih@realtek.com
2020-12-02 21:23:55 +02:00
Ching-Te Ku
76f631cb40 rtw88: coex: update the mechanism for A2DP + PAN
Update A2DP+PAN+WL mechanism for CPT(Coexistence Performance Test) to
enhance WL/BT performance at the environment that some specific AP are
existing.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-4-pkshih@realtek.com
2020-12-02 21:23:54 +02:00
Ching-Te Ku
1a589bd5be rtw88: coex: add debug message
Add message for debugging usage and the program flow is no change.
Add a variable reserved for WLAN firmware synchronize.
Add a group of variable to save BT packet counter, it will be
assigned as mechanism judgment in the future. Now it is just for
debug usage.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-3-pkshih@realtek.com
2020-12-02 21:23:53 +02:00
Ching-Te Ku
1329c0dbd4 rtw88: coex: run coexistence when WLAN entering/leaving LPS
When WLAN entering or leaving, it's necessary to run coexistence mechanism
to ensure the setting matched current status.
Without calling rtw_coex_run_coex(), WLAN poor throughput or bad A2DP
quality may happen.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201126021059.11981-2-pkshih@realtek.com
2020-12-02 21:23:51 +02:00