mt76x0: set max fragments size
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Thu, 6 Sep 2018 09:18:33 +0000 (11:18 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 19 Sep 2018 10:29:45 +0000 (12:29 +0200)
Set maximum number of tx fragments according to usb controller
features

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x0/init.c

index 33730c9..cd7cdf3 100644 (file)
@@ -722,6 +722,12 @@ int mt76x0_register_device(struct mt76x0_dev *dev)
        if (ret)
                return ret;
 
+       /* check hw sg support in order to enable AMSDU */
+       if (mt76u_check_sg(&dev->mt76))
+               hw->max_tx_fragments = MT_SG_MAX_SIZE;
+       else
+               hw->max_tx_fragments = 1;
+
        mt76x0_init_debugfs(dev);
 
        return 0;