OSDN Git Service

mt76x0: add quirk to disable 2.4GHz band for Archer T1U
authorStanislaw Gruszka <sgruszka@redhat.com>
Tue, 25 Sep 2018 06:49:48 +0000 (08:49 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 1 Oct 2018 10:34:15 +0000 (12:34 +0200)
TP-LINK Archer T1U do not support 2.4GHz band despite EEPROM
reports that. Add quirk to mask out 2.4GHz support.

Reported-by: Sid Hayn <sidhayn@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h
drivers/net/wireless/mediatek/mt76/mt76x0/usb.c

index 18bd80a..3d712f6 100644 (file)
@@ -62,6 +62,11 @@ static void mt76x0_set_chip_cap(struct mt76x0_dev *dev)
        dev_dbg(dev->mt76.dev, "2GHz %d 5GHz %d\n",
                dev->mt76.cap.has_2ghz, dev->mt76.cap.has_5ghz);
 
+       if (dev->no_2ghz) {
+               dev->mt76.cap.has_2ghz = false;
+               dev_dbg(dev->mt76.dev, "mask out 2GHz support\n");
+       }
+
        if (!mt76x02_field_valid(nic_conf1 & 0xff))
                nic_conf1 &= 0xff00;
 
index 7e13124..242abab 100644 (file)
@@ -108,6 +108,8 @@ struct mt76x0_dev {
        u8 agc_save;
        u16 chainmask;
 
+       bool no_2ghz;
+
        struct mac_stats stats;
 };
 
index 7647d84..0d56346 100644 (file)
@@ -45,7 +45,8 @@ static struct usb_device_id mt76x0_device_table[] = {
        { USB_DEVICE(0x20f4, 0x806b) }, /* TRENDnet TEW-806UBH  */
        { USB_DEVICE(0x7392, 0xc711) }, /* Devolo Wifi ac Stick */
        { USB_DEVICE(0x0df6, 0x0079) }, /* Sitecom Europe B.V. ac  Stick */
-       { USB_DEVICE(0x2357, 0x0105) }, /* TP-LINK Archer T1U */
+       { USB_DEVICE(0x2357, 0x0105),
+         .driver_info = 1,          }, /* TP-LINK Archer T1U */
        { USB_DEVICE_AND_INTERFACE_INFO(0x0E8D, 0x7630, 0xff, 0x2, 0xff)}, /* MT7630U */
        { USB_DEVICE_AND_INTERFACE_INFO(0x0E8D, 0x7650, 0xff, 0x2, 0xff)}, /* MT7650U */
        { 0, }
@@ -222,6 +223,10 @@ static int mt76x0u_probe(struct usb_interface *usb_intf,
        if (!dev)
                return -ENOMEM;
 
+       /* Quirk for Archer T1U */
+       if (id->driver_info)
+               dev->no_2ghz = true;
+
        usb_dev = usb_get_dev(usb_dev);
        usb_reset_device(usb_dev);