Commit a1ea1d68 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mt76x02u: avoid overwrite max_tx_fragments

Starting from 'commit ee8040139ab1 ("mt76: do not overwrite
max_tx_fragments if it has been set")' we can avoid overwriting
max_tx_fragments for mt76x02u devices
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 85b7a5d0
...@@ -182,16 +182,12 @@ static int mt76x0u_register_device(struct mt76x02_dev *dev) ...@@ -182,16 +182,12 @@ static int mt76x0u_register_device(struct mt76x02_dev *dev)
if (err < 0) if (err < 0)
goto out_err; goto out_err;
/* 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 = mt76x0_register_device(dev); err = mt76x0_register_device(dev);
if (err < 0) if (err < 0)
goto out_err; goto out_err;
/* check hw sg support in order to enable AMSDU */
if (dev->mt76.usb.sg_en)
hw->max_tx_fragments = MT_TX_SG_MAX_SIZE;
else
hw->max_tx_fragments = 1;
set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state); set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);
return 0; return 0;
......
...@@ -207,17 +207,13 @@ int mt76x2u_register_device(struct mt76x02_dev *dev) ...@@ -207,17 +207,13 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
if (err < 0) if (err < 0)
goto fail; goto fail;
/* 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, err = mt76_register_device(&dev->mt76, true, mt76x02_rates,
ARRAY_SIZE(mt76x02_rates)); ARRAY_SIZE(mt76x02_rates));
if (err) if (err)
goto fail; goto fail;
/* check hw sg support in order to enable AMSDU */
if (dev->mt76.usb.sg_en)
hw->max_tx_fragments = MT_TX_SG_MAX_SIZE;
else
hw->max_tx_fragments = 1;
set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state); set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);
mt76x02_init_debugfs(dev); mt76x02_init_debugfs(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment