]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mt76: mt76x2: Add support for LiteOn WN4516R,WN4519R
authorHenk Vergonet <henk.vergonet@gmail.com>
Fri, 18 Apr 2025 14:39:14 +0000 (16:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:31 +0000 (11:05 +0100)
[ Upstream commit 3c0e4f606d8693795a2c965d6f4987b1bfc31097 ]

Adds support for:
 - LiteOn WN4516R
 - LiteOn WN4519R
 Both use:
 - A nonstandard USB connector
 - Mediatek chipset MT7600U
 - ASIC revision: 76320044

Disabled VHT support on ASIC revision 76320044:

 This fixes the 5G connectibity issue on LiteOn WN4519R module
 see https://github.com/openwrt/mt76/issues/971

 And may also fix the 5G issues on the XBox One Wireless Adapter
 see https://github.com/openwrt/mt76/issues/200

 I have looked at the FCC info related to the MT7632U chip as mentioned in here:
 https://github.com/openwrt/mt76/issues/459
 These confirm the chipset does not support 'ac' mode and hence VHT should be turned of.

Signed-off-by: Henk Vergonet <henk.vergonet@gmail.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20250418143914.31384-1-henk.vergonet@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c

index 09b01e09bcfe0b49bed0b652773cbbe3831d12c9..1f2990d45d9e3bf971f9f2f38ec92923f6ea731c 100644 (file)
@@ -17,6 +17,8 @@ static const struct usb_device_id mt76x2u_device_table[] = {
        { USB_DEVICE(0x057c, 0x8503) }, /* Avm FRITZ!WLAN AC860 */
        { USB_DEVICE(0x7392, 0xb711) }, /* Edimax EW 7722 UAC */
        { USB_DEVICE(0x0e8d, 0x7632) }, /* HC-M7662BU1 */
+       { USB_DEVICE(0x0471, 0x2126) }, /* LiteOn WN4516R module, nonstandard USB connector */
+       { USB_DEVICE(0x0471, 0x7600) }, /* LiteOn WN4519R module, nonstandard USB connector */
        { USB_DEVICE(0x2c4e, 0x0103) }, /* Mercury UD13 */
        { USB_DEVICE(0x0846, 0x9053) }, /* Netgear A6210 */
        { USB_DEVICE(0x045e, 0x02e6) }, /* XBox One Wireless Adapter */
index 85dcdc22fbebf385818815be17fa6a0ef522aee5..41b9a996658223f2a8c500b02d376314e17a4ea4 100644 (file)
@@ -191,6 +191,7 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 {
        struct ieee80211_hw *hw = mt76_hw(dev);
        struct mt76_usb *usb = &dev->mt76.usb;
+       bool vht;
        int err;
 
        INIT_DELAYED_WORK(&dev->cal_work, mt76x2u_phy_calibrate);
@@ -215,7 +216,17 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 
        /* check hw sg support in order to enable AMSDU */
        hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_TX_SG_MAX_SIZE : 1;
-       err = mt76_register_device(&dev->mt76, true, mt76x02_rates,
+       switch (dev->mt76.rev) {
+       case 0x76320044:
+               /* these ASIC revisions do not support VHT */
+               vht = false;
+               break;
+       default:
+               vht = true;
+               break;
+       }
+
+       err = mt76_register_device(&dev->mt76, vht, mt76x02_rates,
                                   ARRAY_SIZE(mt76x02_rates));
        if (err)
                goto fail;