Skip to content

Commit

Permalink
mt76: mt76x02u: avoid overwrite max_tx_fragments
Browse files Browse the repository at this point in the history
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: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Jan 27, 2020
1 parent 29fec3a commit 2bb5187
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions mt76x0/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,12 @@ static int mt76x0u_register_device(struct mt76x02_dev *dev)
if (err < 0)
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);
if (err < 0)
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);

return 0;
Expand Down
8 changes: 2 additions & 6 deletions mt76x2/usb_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,13 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
if (err < 0)
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,
ARRAY_SIZE(mt76x02_rates));
if (err)
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);

mt76x02_init_debugfs(dev);
Expand Down

0 comments on commit 2bb5187

Please sign in to comment.