summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7915/main.c
AgeCommit message (Collapse)Author
2020-12-04mt76: mt7915: introduce dbdc supportLorenzo Bianconi
Introduce mt7915 dbdc support. If dbdc is available, mt7915 primary phy will work on 2.4GHz band, while secondary one on 5GHz band. Co-developed-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt7915: use BIT_ULL for omac_idxRyder Lee
The omac_idx variable is u64 so we should use the 64-bit BIT_ULL(). Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt7915: implement testmode tx supportShayne Chen
Support testmode tx for MT7915A, including tx streams and HE rate settings. Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: switch to wep sw crypto for mt7615/mt7915Lorenzo Bianconi
Switch to wep sw crypto for mt7615/mt7915 since wtbl require a sta reference and wep key is not pairwise Tested-by: YN Chen <yn.chen@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt7915: query station rx rate from firmwareFelix Fietkau
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-04mt76: mt7915: support 32 station interfacesFelix Fietkau
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-04mt76: mt7915: add encap offload for 4-address mode stationsFelix Fietkau
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-04mt76: mt7915: measure channel noise and report it via surveyRyder Lee
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-09-24mt76: remove retry_q from struct mt76_txq and related codeFelix Fietkau
Since the switch to using AQL by default, mtxq->retry_q is never filled anymore Remove it to get rid of a few more unnecessary cycles in the tx path Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt7915: simplify aggregation session checkFelix Fietkau
Use the txwi data as primary source information to avoid touching skb data Use bitfield instead of state variable + spinlock Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt7915: enable offloading of sequence number assignmentFelix Fietkau
Preparation for supporting more offload features Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt7915: clean up station stats polling and rate control updateFelix Fietkau
Queueing a per-sta work item from the tx free path can become very expensive under load. This work is only supposed to pull rate control stats every second and deal with rate control changes. Additionally, the rate control update code was wrong, because it was confusing bit masks and bit numbers in test_bit. Fix this by introducing a dedicated device work item for rate control updates, and by polling station stats from the phy mac work. Stations requiring polling or rate control updates are added to lists protected by dev->sta_poll_lock. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: vif_mask to struct mt76_phyFelix Fietkau
All drivers use this in pretty much the same way. Moving it to core helps with some checks for the upcoming testmode support Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: mt7915: use ieee80211_tx_queue_params to avoid open codedRyder Lee
This is easy to add MU EDCA parameters in the future. This patch also fixes a wrong cw_min assignment. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: mt7915: add a fixed AC queue mappingRyder Lee
In MT7915, hardware queue map is flexible. However, certain firmware modules like MU and U-APSD presume a fixed queue order to adapt some devices that have DMA scheduler with a strict order, so this patch can help in the long run. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: add missing lock configuring coverage classLorenzo Bianconi
Coverage class callback can potentially run in parallel with other routines (e.g. mt7615_set_channel) that configures timing registers. Run coverage class callback holding mt76 mutex Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-28mt76: mt7915: fix some sparse warningsRyder Lee
drivers/net/wireless/mediatek/mt76/mt7915/main.c:694:1: sparse: sparse: context imbalance in 'mt7915_sta_rc_update' - wrong count at exit drivers/net/wireless/mediatek/mt76/mt7915/mac.c:303:43: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:304:43: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:305:43: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:319:35: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:327:35: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:345:41: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:355:33: sparse: sparse: cast to restricted __le32 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:451:21: sparse: sparse: invalid assignment: |= drivers/net/wireless/mediatek/mt76/mt7915/mac.c:451:21: sparse: left side has type unsigned int drivers/net/wireless/mediatek/mt76/mt7915/mac.c:451:21: sparse: right side has type restricted __le32 Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-28mt76: mt7915: add spatial reuse supportRyder Lee
Enable or disable OBSS PD when the bss config changes or we assoc to an AP that broadcasts the IE. With this patch, we can get ~20% gain in OBSS OTA environment. Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7915: fix possible deadlock in mt7915_stopRyder Lee
make mac_work per phy instead of per device and fix a possible deadlock in mt7915_stop since mt7915_mac_work runs holding mt76 mutex Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7915: add TxBF capabilitiesRyder Lee
This allows to set HE TxBF runtime stream capabilities Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7915: add Tx beamformer supportRyder Lee
Enable TxBF modules and trigger sounding process to support Tx beamformer. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: set runtime stream caps by mt76_phyRyder Lee
This patch can support concurrent dual-band operation. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7915: add tsf related callbacksRyder Lee
It is useful for IBSS Mesh to adjust t_clockdrift. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Reported-by: Shayne Chen <shayne.chen@mediatek.com> Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7915: add .sta_statistics supportRyder Lee
Add useful debug counters since this generation uses struct rate_info to report HE tx rate. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7915: add .sta_add_debugfs supportRyder Lee
This generation supports much more per-peer statistics than legacy ones, so add .sta_add_debugfs accordingly. This is convenient to set/get more settings/counters in the long run. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7915: register per-phy HE capabilities for each interfaceRyder Lee
The capabilities for the HE interfaces are generated from the capabilities reported by the firmware. This should move to common file once we got other HE devices support. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7915: implement HE per-rate tx power supportRyder Lee
Use firmware support for applying per-rate limit and power offsets. This can support all HE RU types. Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Tested-by: Chih-Min Chen <chih-min.chen@mediatek.com> Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com> Acked-by: Yiwei Chung <yiwei.chung@mediatek.com> Acked-by: YF Luo <yf.luo@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: add mac80211 driver for MT7915 PCIe-based chipsetsRyder Lee
Add support for the MediaTek latest generation IEEE 802.11ax 4x4 device MT7915E, which supports concurrent dual-band operation at both 5GHz and 2.4GHz. Note that this patch just add basic part and will add more HE capabilities support in the further patches. The driver supports AP, Station, Mesh and monitor mode. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Chih-Min Chen <chih-min.chen@mediatek.com> Suggested-by: Shihwei Lin <shihwei.lin@mediatek.com> Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com> Acked-by: Yiwei Chung <yiwei.chung@mediatek.com> Acked-by: YF Luo <yf.luo@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>