summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mt76: mt7615: fix throughput regression on DFS channelsFelix Fietkau2022-07-114-25/+7
| | | | | | | | | | | | For some reason, mt7615 reacts badly to repeatedly enabling/disabling the radar detector without also switching the channel. This results in very bad throughput on DFS channels, because hw->conf.radar_enabled can get toggled a few times after CAC ends. Fix this by always leaving the DFS detector enabled on DFS channels and instead suppress unwanted detection events. Fixes: 2c86f6752046 ("mt76: mt7615: fix/rewrite the dfs state handling logic") Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: allow receiving frames with invalid CCMP PN via monitor interfacesFelix Fietkau2022-07-111-14/+10
| | | | | | This can be useful for debugging Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: improve reliability of the beacon hang checkFelix Fietkau2022-07-112-4/+13
| | | | | | | | Increment the counter only when writing beacons to the hardware in order to avoid triggering restarts if beacons are disabled. Additionally, avoid resetting the MAC if stopping it failed Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: add sta_rec with EXTRA_INFO_NEW for the first time onlyFelix Fietkau2022-07-112-1/+9
| | | | | | | Set EXTRA_INFO_NEW for the first time only to prevent adding the same starec entry, otherwise the entry might be removed in fw. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: update the maximum size of beacon offloadMeiChia Chiu2022-07-112-3/+14
| | | | | | | | | | Since an in-band discovery frame is offloaded by MCU, here we enlarge the command size to accommodate the additional content. Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Money Wang <Money.Wang@mediatek.com> Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: do not check the ccmp pn for ONLY_MONITOR frameMeiChia Chiu2022-07-111-0/+3
| | | | | | | | | if the received frame enables RX_FLAG_ONLY_MONITOR, driver doesn't need to check the ccmp pn of this frame. Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: add sta_rec with EXTRA_INFO_NEW for the first time onlyShayne Chen2022-07-112-2/+3
| | | | | | | | | | Set EXTRA_INFO_NEW for the first time only to prevent adding the same starec entry, otherwise the entry might be removed in fw. Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: update mpdu density in 6g capabilityPeter Chiu2022-07-111-1/+1
| | | | | | | | Set mpdu density to 2 usec in 6g capability to meet hardware capability and also enhance throughput. Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: do not copy ieee80211_ops pointer in mt7915_mmio_probeLorenzo Bianconi2022-07-111-6/+1
| | | | | | | We do not modify ieee80211_ops pointers so we do not need to copy them. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: fix incorrect testmode ipg on band 1 caused by wmm_idxShayne Chen2022-07-111-4/+5
| | | | | | | | | Fix the issue that the measured inter packet gap didn't fit its setting value. Fixes: c2d3b1926f30 ("mt76: mt7915: add support for ipg in testmode") Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: disable UL MU-MIMO for mt7915Felix Fietkau2022-07-112-7/+9
| | | | | | | | After initially establishing a connection, it can produce multi-second latency spikes and tx hangs when pushing traffic. It should work better for MT7916 and MT7986, so leave it enabled there Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt76_connac2_mcu_fill_message in mt76_connac moduleLorenzo Bianconi2022-07-1114-171/+125
| | | | | | | | | Move mt76_connac2_mcu_fill_message routine in shared module in order to reuse it for mt7921 and mt7915e drivers. This is a preliminary patch to add mt7990 driver support. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mcu_txd/mcu_rxd structures in shared codeLorenzo Bianconi2022-07-1110-157/+131
| | | | | | | This is a preliminary patch to add mt7990 chipset support. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: rely on mt76_connac_tx_freeLorenzo Bianconi2022-07-113-15/+7
| | | | | | | | As for mt7921 and mt7615 drivers, rely on mt76_connac_tx_free data structure in mt7915e driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt7615_txp_skb_unmap in common codeLorenzo Bianconi2022-07-116-102/+65
| | | | | | | | Move mt7615_txp_skb_unmap in shared code and reuse it in mt7915e and mt7921e driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac_write_hw_txp in shared codeLorenzo Bianconi2022-07-116-82/+49
| | | | | | | | Now we can move mt76_connac_write_hw_txp routine in mt76-connac module and reuse it in mt7921e and mt7615e driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac_tx_complete_skb in shared codeLorenzo Bianconi2022-07-1113-85/+51
| | | | | | | | | Since now txp structures are in common code we can reuse mt76_connac_tx_complete_skb routine in mt7921e, mt7915e and mt7615e drivers. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac_tx_free in shared codeLorenzo Bianconi2022-07-115-22/+15
| | | | | | | | Move mt76_connac_tx_free structure in mt76_connac module since it is shared by mt7615 and mt7921 drivers. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt7615_txp_ptr in mt76_connac moduleLorenzo Bianconi2022-07-118-61/+39
| | | | | | | | Since mt7615_txp_ptr is shared between mt7615 and mt7921 move it in mt76_connac module. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac_fw_txp in common moduleLorenzo Bianconi2022-07-1110-117/+59
| | | | | | | | Since mt76_connac_fw_txp struct is shared between mt7615e, mt7915e and mt7921e, move it in mt76_connac module. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: get rid of unnecessary new line in mt7915_mac_write_txwiLorenzo Bianconi2022-07-111-1/+0
| | | | | | | Remove unnecessary new line in mt7915_mac_write_txwi routine. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: enlarge maximum VHT MPDU length to 11454Deren Wu2022-07-111-1/+1
| | | | | | | | | | Enlarge maximum MPDU length to 11454 that both mt7921/mt7922 can support. After this fixing, we can get better performance. Fixes: 5c14a5f944b9 ("mt76: mt7921: introduce mt7921e support") Tested-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: fix aggregation subframes setting to HE maxDeren Wu2022-07-111-2/+2
| | | | | | | | | | | mt7921/mt7922 support HE max aggregation subframes 256 for both tx/rx. Get better throughput then before. Fixes: 94bb18b03d43 ("mt76: mt7921: fix max aggregation subframes setting") Tested-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Reviewed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921s: fix possible sdio deadlock in command failDeren Wu2022-07-111-5/+5
| | | | | | | | | | | Move sdio_release_host() to final resource handing Fixes: b12deb5e86fa ("mt76: mt7921s: fix mt7921s_mcu_[fw|drv]_pmctrl") Reported-by: YN Chen <YN.Chen@mediatek.com> Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: do not update pm states in case of errorLorenzo Bianconi2022-07-111-3/+3
| | | | | | | | | Do not update pm stats if mt7921e_mcu_fw_pmctrl routine returns an error. Fixes: 36873246f78a2 ("mt76: mt7921: add awake and doze time accounting") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: do not update pm stats in case of errorLorenzo Bianconi2022-07-111-4/+5
| | | | | | | | Do not update pm stats if mt7615_mcu_fw_pmctrl returns an error. Fixes: abe912ae3cd42 ("mt76: mt7663: add awake and doze time accounting") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921s: remove unnecessary goto in mt7921s_mcu_drv_pmctrlLorenzo Bianconi2022-07-111-5/+4
| | | | | | | Get rid of unnecessary goto in mt7921s_mcu_drv_pmctrl routine. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac2_mac_fill_rx_rate in connac moduleLorenzo Bianconi2022-07-114-180/+117
| | | | | | | Rely on mt76_connac2_mac_fill_rx_rate routine in mt7921 driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac moduleLorenzo Bianconi2022-07-117-338/+189
| | | | | | | | mt76_connac2_reverse_frag0_hdr_trans routine is shared between mt7921 and mt7915e drivers. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move HE radiotap parsing in connac moduleLorenzo Bianconi2022-07-117-466/+251
| | | | | | | HE radiotap parsing code is shared between connac2 devices. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: fix command timeout in AP stop periodDeren Wu2022-07-114-13/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Due to AP stop improperly, mt7921 driver would face random command timeout by chip fw problem. Migrate AP start/stop process to .start_ap/.stop_ap and congiure BSS network settings in both hooks. The new flow is shown below. * AP start .start_ap() configure BSS network resource set BSS to connected state .bss_info_changed() enable fw beacon offload * AP stop .bss_info_changed() disable fw beacon offload (skip this command) .stop_ap() set BSS to disconnected state (beacon offload disabled automatically) destroy BSS network resource Fixes: 116c69603b01 ("mt76: mt7921: Add AP mode support") Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: not support beacon offload disable commandDeren Wu2022-07-111-2/+4
| | | | | | | | | | Beacon disable flow would be handled in bss stop handler automatically. Force return -EOPNOTSUPP in disable case. Fixes: 116c69603b01 ("mt76: mt7921: Add AP mode support") Reviewed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac2_mac_add_txs_skb in connac moduleLorenzo Bianconi2022-07-114-243/+130
| | | | | | | | Move mt76_connac2_mac_add_txs_skb in mt76-connac module since it is shared between connac2 devices (mt7921 and mt7915) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move connac2_mac_write_txwi in mt76_connac moduleLorenzo Bianconi2022-07-1110-472/+299
| | | | | | | | mac_write_txwi code is shared between connac2 devices (mt7915 and mt7921). Move it in connac module. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mac connac2 defs in mt76_connac2_mac.hLorenzo Bianconi2022-07-115-285/+171
| | | | | | | This is a preliminary patch to share connac2 mac txwi code. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: rely on mt76_dev in mt7915_mac_write_txwi signatureLorenzo Bianconi2022-07-113-15/+14
| | | | | | | This is a preliminary patch to share txwi configuration code. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: rely on mt76_dev in mt7921_mac_write_txwi signatureLorenzo Bianconi2022-07-114-15/+14
| | | | | | | This is a preliminary patch to share txwi configuration code. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: enable the VHT extended NSS BW featureDeren Wu2022-07-114-0/+5
| | | | | | | | | | | | | | | According IEEE Std 802.11-2020, its definition is: Indicates whether the STA is capable of interpreting the Extended NSS BW Support subfield of the VHT Capabilities Information field. Some APs, such as Xiaomi AX6000, would check this one for BW settings. mt76 driver can get max BW capability only if the this field is confgured properly. Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7663: rely on mt76_connac2_fw_trailerLorenzo Bianconi2022-07-111-16/+2
| | | | | | | Remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac2_load_patch in connac moduleLorenzo Bianconi2022-07-114-210/+123
| | | | | | | | | Move mt76_connac2_load_patch utility routine in mt76_connac module since it is shared between mt7921 and mt7915. This is a preliminary patch to support mt7902e driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac2_load_ram in connac moduleLorenzo Bianconi2022-07-114-198/+116
| | | | | | | | | Move mt76_connac2_load_ram utility routine in mt76_connac module since it is shared between mt7921 and mt7915. This is a preliminary patch to support mt7902e driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: move fw toggle in mt7921_load_firmwareLorenzo Bianconi2022-07-111-7/+7
| | | | | | | | | Move drv_own/fw_own toggle in mt7921_load_firmware. This change allow to reuse connac code to load patch for mt7921 driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Tested-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move shared fw structures in connac moduleLorenzo Bianconi2022-07-113-143/+79
| | | | | | | | | Move mt76_connac2 fw structures in connac module since they are shared between mt7921 and mt7915 drivers. This is a preliminary patch to add mt7902e support. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: get rid of mt7921_mcu_exitLorenzo Bianconi2022-07-116-12/+5
| | | | | | | Run skb_queue_purge when needed. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: add missing bh-disable around rx napi scheduleLorenzo Bianconi2022-07-111-0/+2
| | | | | | | | | napi_schedule() can call __raise_softirq_irqoff(), which can perform softirq handling, so it must not be called in a pure process context with BH enabled. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: add missing bh-disable around rx napi scheduleFelix Fietkau2022-07-111-0/+2
| | | | | | | napi_schedule() can call __raise_softirq_irqoff(), which can perform softirq handling, so it must not be called in a pure process context with BH enabled. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7915: add missing bh-disable around tx napi enable/scheduleFelix Fietkau2022-07-111-0/+2
| | | | | | | napi_schedule() can call __raise_softirq_irqoff(), which can perform softirq handling, so it must not be called in a pure process context with BH enabled. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* dt-bindings: net: wireless: mt76: add clock description for MT7986.Peter Chiu2022-07-111-0/+13
| | | | | | | | | Add clocks and clock-names for MT7986. Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921s: fix firmware download random failYN Chen2022-07-111-7/+8
| | | | | | | | | | To avoid racing problems in chip, mt7921s should reacquire drv-own after firmware semaphore is released. Fixes: 78b217580c509 ("mt76: mt7921s: fix bus hang with wrong privilege") Signed-off-by: YN Chen <yn.chen@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7921: add PATCH_FINISH_REQ cmd response handlingYN Chen2022-07-111-1/+2
| | | | | | | | add new case to fetch the return value of PATCH_FINISH_REQ Signed-off-by: YN Chen <yn.chen@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>