Commit Graph
15 Commits
Author SHA1 Message Date
Shayne ChenandFelix Fietkau f47087a6dd wifi: mt76: mt7996: fix chainmask calculation in mt7996_set_antenna()
Fix per-band chainmask when restoring from the dev chainmask.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-01-23 10:32:48 +01:00
Lorenzo BianconiandFelix Fietkau 14fbb6d6e8 wifi: mt76: move leds struct in mt76_phy
Move leds struct in mt76_phy in order to have leds associated to phy
(e.g. in dbdc mode) instead of per device.

Tested-by: Frank Wunderlich <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:05 +01:00
Lorenzo BianconiandFelix Fietkau 551201379e wifi: mt76: move leds field in leds struct
This is a preliminary patch to support per-phy leds.

Tested-by: Frank Wunderlich <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:05 +01:00
Ryder LeeandFelix Fietkau a44109267e wifi: mt76: mt7996: fix unintended sign extension of mt7996_hw_queue_read()
In the expression "map[i].qid << 24" starts as u8, but is promoted to
"signed int", then sign-extended to type "unsigned long", which is not
intended. Cast to u32 to avoid the sign extension.

Reported-by: coverity-bot <[email protected]>
Addresses-Coverity-ID: 1527813 ("Integer handling issues")
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:05 +01:00
Lorenzo BianconiandFelix Fietkau 5185bbab89 wifi: mt76: mt7996: fix endianness warning in mt7996_mcu_sta_he_tlv
Fix the following sparse warnings in mt7996_mcu_sta_he_tlv routine:

warning: incorrect type in assignment (different base types)
   expected unsigned char
   got restricted __le16 [usertype]
warning: incorrect type in assignment (different base types)
   expected unsigned char
   got restricted __le16 [usertype]

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:05 +01:00
Ryder LeeandFelix Fietkau 01a256c1dc wifi: mt76: mt7996: drop always true condition of __mt7996_reg_addr()
addr <= MT_CBTOP2_PHY_END(0xffffffff) is always true (<= u32max),
so drop it.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:05 +01:00
Ryder LeeandFelix Fietkau f1cc3696d7 wifi: mt76: mt7996: check return value before accessing free_block_num
Check return value of mt7996_mcu_get_eeprom_free_block() first before
accessing free_block_num.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:05 +01:00
Ryder LeeandFelix Fietkau 5616c4cc1d wifi: mt76: mt7996: fix integer handling issue of mt7996_rf_regval_set()
This code is supposed to set a u32 value, but casting will not work on
big endian systems.

Reported-by: coverity-bot <[email protected]>
Addresses-Coverity-ID: 1527816 ("Integer handling issues")
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:04 +01:00
Ryder LeeandFelix Fietkau 233c272f0f wifi: mt76: mt7996: fix insecure data handling of mt7996_mcu_rx_radar_detected()
Coverity message:
using tainted "r->band_idx" variable as an index into an array "(*dev).mt76.phys".

Reported-by: coverity-bot <[email protected]>
Addresses-Coverity-ID: 1527812 ("Insecure data handling")
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:04 +01:00
Ryder LeeandFelix Fietkau 379f3fc0fc wifi: mt76: mt7996: fix insecure data handling of mt7996_mcu_ie_countdown()
Coverity message:
using tainted "hdr->band" variable as an index into an array "(*dev).mt76.phys".

Reported-by: coverity-bot <[email protected]>
Addresses-Coverity-ID: 1527797 ("Insecure data handling")
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:04 +01:00
Ryder LeeandFelix Fietkau 2a41e7a82f wifi: mt76: mt7996: add support to configure spatial reuse parameter set
The SPR parameter set comprises OBSS PD threshold for SRG and
non SRG and Bitmap of BSS color and partial BSSID. This adds
support to configure fields of SPR element to firmware.

User can disable firmware SR algorithms by turning sr_scene_detect off.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:04 +01:00
Ryder LeeandFelix Fietkau 98492dff3b wifi: mt76: mt7996: enable ack signal support
This reports signal strength of ACK packets from the peer as measured
at each interface.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:04 +01:00
Ryder LeeandFelix Fietkau d3838a52df wifi: mt76: mt7996: enable use_cts_prot support
This adds selectable RTC/CTS enablement for each interface.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:04 +01:00
Shayne ChenandFelix Fietkau f0c191a9f6 wifi: mt76: mt7996: add missing argument in mt7996_queue_rx_skb()
An argument has been added in .rx_skb driver ops callback after
introducing WED RX support. Align it to fix the following compile error:

>> drivers/net/wireless/mediatek/mt76/mt7996/mmio.c:328:13: error: incompatible function pointer types initializing 'void (*)(struct mt76_dev *, enum mt76_rxq_id, struct sk_buff *, u32 *)' (aka 'void (*)(struct mt76_dev *, enum mt76_rxq_id, struct sk_buff *, unsigned int *)') with an expression of type 'void (struct mt76_dev *, enum mt76_rxq_id, struct sk_buff *)' [-Werror,-Wincompatible-function-pointer-types]
                   .rx_skb = mt7996_queue_rx_skb,
                             ^~~~~~~~~~~~~~~~~~~
   1 error generated.

Reported-by: kernel test robot <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:04 +01:00
Shayne ChenandFelix Fietkau de3e77227f wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices
The driver first supports Filogic 680 PCI device, which is a Wi-Fi 7
chipset supporting concurrent tri-band operation at 6 GHz, 5 GHz, and
2.4 GHz with 4x4 antennas on each band.

Currently, mt7996 only supports tri-band HE or older mode.
EHT mode and more variants of Filogic 680 support will be introduced
in further patches.

Reviewed-by: Ryder Lee <[email protected]>
Co-developed-by: Peter Chiu <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Co-developed-by: Bo Jiao <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Co-developed-by: Howard Hsu <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Co-developed-by: MeiChia Chiu <[email protected]>
Signed-off-by: MeiChia Chiu <[email protected]>
Co-developed-by: StanleyYP Wang <[email protected]>
Signed-off-by: StanleyYP Wang <[email protected]>
Co-developed-by: Money Wang <[email protected]>
Signed-off-by: Money Wang <[email protected]>
Co-developed-by: Evelyn Tsai <[email protected]>
Signed-off-by: Evelyn Tsai <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:04 +01:00