Commit 9ec0b821 authored by Felix Fietkau's avatar Felix Fietkau
Browse files

mt76: rename mt76_driver_ops txwi_flags to drv_flags and include tx aligned4



This reduces the struct size and is useful for adding more flags later

Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent d515fdca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush)
			dev->drv->tx_complete_skb(dev, qid, &entry);

		if (entry.txwi) {
			if (!(dev->drv->txwi_flags & MT_TXWI_NO_FREE))
			if (!(dev->drv->drv_flags & MT_DRV_TXWI_NO_FREE))
				mt76_put_txwi(dev, entry.txwi);
			wake = !flush;
		}
@@ -301,7 +301,7 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid,
	txwi = mt76_get_txwi_ptr(dev, t);

	skb->prev = skb->next = NULL;
	if (dev->drv->tx_aligned4_skbs)
	if (dev->drv->drv_flags & MT_DRV_TX_ALIGNED4_SKBS)
		mt76_insert_hdr_pad(skb);

	len = skb_headlen(skb);
+3 −3
Original line number Diff line number Diff line
@@ -280,11 +280,11 @@ struct mt76_hw_cap {
	bool has_5ghz;
};

#define MT_TXWI_NO_FREE			BIT(0)
#define MT_DRV_TXWI_NO_FREE		BIT(0)
#define MT_DRV_TX_ALIGNED4_SKBS		BIT(1)

struct mt76_driver_ops {
	bool tx_aligned4_skbs;
	u32 txwi_flags;
	u32 drv_flags;
	u16 txwi_size;

	void (*update_survey)(struct mt76_dev *dev);
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ static int mt7615_pci_probe(struct pci_dev *pdev,
	static const struct mt76_driver_ops drv_ops = {
		/* txwi_size = txd size + txp size */
		.txwi_size = MT_TXD_SIZE + sizeof(struct mt7615_txp),
		.txwi_flags = MT_TXWI_NO_FREE,
		.drv_flags = MT_DRV_TXWI_NO_FREE,
		.tx_prepare_skb = mt7615_tx_prepare_skb,
		.tx_complete_skb = mt7615_tx_complete_skb,
		.rx_skb = mt7615_queue_rx_skb,
+1 −1
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
	static const struct mt76_driver_ops drv_ops = {
		.txwi_size = sizeof(struct mt76x02_txwi),
		.tx_aligned4_skbs = true,
		.drv_flags = MT_DRV_TX_ALIGNED4_SKBS,
		.update_survey = mt76x02_update_channel,
		.tx_prepare_skb = mt76x02_tx_prepare_skb,
		.tx_complete_skb = mt76x02_tx_complete_skb,
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
	static const struct mt76_driver_ops drv_ops = {
		.txwi_size = sizeof(struct mt76x02_txwi),
		.tx_aligned4_skbs = true,
		.drv_flags = MT_DRV_TX_ALIGNED4_SKBS,
		.update_survey = mt76x02_update_channel,
		.tx_prepare_skb = mt76x02_tx_prepare_skb,
		.tx_complete_skb = mt76x02_tx_complete_skb,