diff --git a/debugfs.c b/debugfs.c index 99589309f..bd3536022 100644 --- a/debugfs.c +++ b/debugfs.c @@ -31,7 +31,7 @@ int mt76_queues_read(struct seq_file *s, void *data) int i; for (i = 0; i < ARRAY_SIZE(dev->q_tx); i++) { - struct mt76_queue *q = dev->q_tx[i].q; + struct mt76_queue *q = dev->q_tx[i]; if (!q) continue; diff --git a/dma.c b/dma.c index b6e1f4c4b..3548d0ff9 100644 --- a/dma.c +++ b/dma.c @@ -150,8 +150,7 @@ mt76_dma_kick_queue(struct mt76_dev *dev, struct mt76_queue *q) static void mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush) { - struct mt76_sw_queue *sq = &dev->q_tx[qid]; - struct mt76_queue *q = sq->q; + struct mt76_queue *q = dev->q_tx[qid]; struct mt76_queue_entry entry; bool wake = false; int last; @@ -249,7 +248,7 @@ static int mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, enum mt76_txq_id qid, struct sk_buff *skb, u32 tx_info) { - struct mt76_queue *q = dev->q_tx[qid].q; + struct mt76_queue *q = dev->q_tx[qid]; struct mt76_queue_buf buf; dma_addr_t addr; @@ -281,7 +280,7 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid, struct sk_buff *skb, struct mt76_wcid *wcid, struct ieee80211_sta *sta) { - struct mt76_queue *q = dev->q_tx[qid].q; + struct mt76_queue *q = dev->q_tx[qid]; struct mt76_tx_info tx_info = { .skb = skb, }; diff --git a/mac80211.c b/mac80211.c index ac7a9222a..e0c649566 100644 --- a/mac80211.c +++ b/mac80211.c @@ -552,7 +552,7 @@ bool mt76_has_tx_pending(struct mt76_phy *phy) offset = __MT_TXQ_MAX * (phy != &dev->phy); for (i = 0; i < __MT_TXQ_MAX; i++) { - q = dev->q_tx[offset + i].q; + q = dev->q_tx[offset + i]; if (q && q->queued) return true; } diff --git a/mt76.h b/mt76.h index 3c9fadcbd..e56e30366 100644 --- a/mt76.h +++ b/mt76.h @@ -139,10 +139,6 @@ struct mt76_queue { struct page_frag_cache rx_page; }; -struct mt76_sw_queue { - struct mt76_queue *q; -}; - struct mt76_mcu_ops { u32 headroom; u32 tailroom; @@ -230,7 +226,7 @@ struct mt76_wcid { }; struct mt76_txq { - struct mt76_sw_queue *swq; + struct mt76_queue *q; struct mt76_wcid *wcid; struct sk_buff_head retry_q; @@ -606,7 +602,7 @@ struct mt76_dev { struct sk_buff_head rx_skb[__MT_RXQ_MAX]; struct list_head txwi_cache; - struct mt76_sw_queue q_tx[2 * __MT_TXQ_MAX]; + struct mt76_queue *q_tx[2 * __MT_TXQ_MAX]; struct mt76_queue q_rx[__MT_RXQ_MAX]; const struct mt76_queue_ops *queue_ops; int tx_dma_idx[4]; diff --git a/mt7603/beacon.c b/mt7603/beacon.c index 7a41cdf1c..d728c5e43 100644 --- a/mt7603/beacon.c +++ b/mt7603/beacon.c @@ -29,7 +29,7 @@ mt7603_update_beacon_iter(void *priv, u8 *mac, struct ieee80211_vif *vif) mt76_wr(dev, MT_DMA_FQCR0, MT_DMA_FQCR0_BUSY | FIELD_PREP(MT_DMA_FQCR0_TARGET_WCID, mvif->sta.wcid.idx) | FIELD_PREP(MT_DMA_FQCR0_TARGET_QID, - dev->mt76.q_tx[MT_TXQ_CAB].q->hw_idx) | + dev->mt76.q_tx[MT_TXQ_CAB]->hw_idx) | FIELD_PREP(MT_DMA_FQCR0_DEST_PORT_ID, 3) | FIELD_PREP(MT_DMA_FQCR0_DEST_QUEUE_ID, 8)); @@ -78,7 +78,7 @@ void mt7603_pre_tbtt_tasklet(unsigned long arg) data.dev = dev; __skb_queue_head_init(&data.q); - q = dev->mt76.q_tx[MT_TXQ_BEACON].q; + q = dev->mt76.q_tx[MT_TXQ_BEACON]; spin_lock_bh(&q->lock); ieee80211_iterate_active_interfaces_atomic(mt76_hw(dev), IEEE80211_IFACE_ITER_RESUME_ALL, @@ -95,7 +95,7 @@ void mt7603_pre_tbtt_tasklet(unsigned long arg) if (dev->mt76.csa_complete) goto out; - q = dev->mt76.q_tx[MT_TXQ_CAB].q; + q = dev->mt76.q_tx[MT_TXQ_CAB]; do { nframes = skb_queue_len(&data.q); ieee80211_iterate_active_interfaces_atomic(mt76_hw(dev), @@ -136,7 +136,7 @@ void mt7603_pre_tbtt_tasklet(unsigned long arg) out: mt76_queue_tx_cleanup(dev, MT_TXQ_BEACON, false); - if (dev->mt76.q_tx[MT_TXQ_BEACON].q->queued > + if (dev->mt76.q_tx[MT_TXQ_BEACON]->queued > hweight8(dev->mt76.beacon_mask)) dev->beacon_check++; } diff --git a/mt7603/dma.c b/mt7603/dma.c index 3d7914535..19eb0693d 100644 --- a/mt7603/dma.c +++ b/mt7603/dma.c @@ -5,8 +5,7 @@ #include "../dma.h" static int -mt7603_init_tx_queue(struct mt7603_dev *dev, struct mt76_sw_queue *q, - int idx, int n_desc) +mt7603_init_tx_queue(struct mt7603_dev *dev, int qid, int idx, int n_desc) { struct mt76_queue *hwq; int err; @@ -19,7 +18,7 @@ mt7603_init_tx_queue(struct mt7603_dev *dev, struct mt76_sw_queue *q, if (err < 0) return err; - q->q = hwq; + dev->mt76.q_tx[qid] = hwq; mt7603_irq_enable(dev, MT_INT_TX_DONE(idx)); @@ -192,29 +191,28 @@ int mt7603_dma_init(struct mt7603_dev *dev) mt7603_pse_client_reset(dev); for (i = 0; i < ARRAY_SIZE(wmm_queue_map); i++) { - ret = mt7603_init_tx_queue(dev, &dev->mt76.q_tx[i], - wmm_queue_map[i], + ret = mt7603_init_tx_queue(dev, i, wmm_queue_map[i], MT_TX_RING_SIZE); if (ret) return ret; } - ret = mt7603_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_PSD], + ret = mt7603_init_tx_queue(dev, MT_TXQ_PSD, MT_TX_HW_QUEUE_MGMT, MT_TX_RING_SIZE); if (ret) return ret; - ret = mt7603_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_MCU], + ret = mt7603_init_tx_queue(dev, MT_TXQ_MCU, MT_TX_HW_QUEUE_MCU, MT_MCU_RING_SIZE); if (ret) return ret; - ret = mt7603_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_BEACON], + ret = mt7603_init_tx_queue(dev, MT_TXQ_BEACON, MT_TX_HW_QUEUE_BCN, MT_MCU_RING_SIZE); if (ret) return ret; - ret = mt7603_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_CAB], + ret = mt7603_init_tx_queue(dev, MT_TXQ_CAB, MT_TX_HW_QUEUE_BMC, MT_MCU_RING_SIZE); if (ret) return ret; diff --git a/mt7603/mac.c b/mt7603/mac.c index acd5b0c0f..97679eb4d 100644 --- a/mt7603/mac.c +++ b/mt7603/mac.c @@ -445,7 +445,7 @@ void mt7603_mac_sta_poll(struct mt7603_dev *dev) sta = container_of((void *)msta, struct ieee80211_sta, drv_priv); for (i = 0; i < 4; i++) { - struct mt76_queue *q = dev->mt76.q_tx[i].q; + struct mt76_queue *q = dev->mt76.q_tx[i]; u8 qidx = q->hw_idx; u8 tid = ac_to_tid[i]; u32 txtime = airtime[qidx]; @@ -896,7 +896,7 @@ mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi, struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_bar *bar = (struct ieee80211_bar *)skb->data; struct ieee80211_vif *vif = info->control.vif; - struct mt76_queue *q = dev->mt76.q_tx[qid].q; + struct mt76_queue *q = dev->mt76.q_tx[qid]; struct mt7603_vif *mvif; int wlan_idx; int hdr_len = ieee80211_get_hdrlen_from_skb(skb); @@ -1514,7 +1514,7 @@ static bool mt7603_tx_hang(struct mt7603_dev *dev) int i; for (i = 0; i < 4; i++) { - q = dev->mt76.q_tx[i].q; + q = dev->mt76.q_tx[i]; if (!q->queued) continue; diff --git a/mt7603/main.c b/mt7603/main.c index 447f2c63e..f9ffa8825 100644 --- a/mt7603/main.c +++ b/mt7603/main.c @@ -514,7 +514,7 @@ mt7603_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, u16 cw_max = (1 << 10) - 1; u32 val; - queue = dev->mt76.q_tx[queue].q->hw_idx; + queue = dev->mt76.q_tx[queue]->hw_idx; if (params->cw_min) cw_min = params->cw_min; diff --git a/mt7615/debugfs.c b/mt7615/debugfs.c index 937cb71be..27c3216d9 100644 --- a/mt7615/debugfs.c +++ b/mt7615/debugfs.c @@ -339,15 +339,15 @@ mt7615_queues_read(struct seq_file *s, void *data) int i; for (i = 0; i < ARRAY_SIZE(queue_map); i++) { - struct mt76_sw_queue *q = &dev->mt76.q_tx[queue_map[i].id]; + struct mt76_queue *q = dev->mt76.q_tx[queue_map[i].id]; - if (!q->q) + if (!q) continue; seq_printf(s, "%s: queued=%d head=%d tail=%d\n", - queue_map[i].queue, q->q->queued, q->q->head, - q->q->tail); + queue_map[i].queue, q->queued, q->head, + q->tail); } return 0; diff --git a/mt7615/dma.c b/mt7615/dma.c index 8743a0551..bf8ae1412 100644 --- a/mt7615/dma.c +++ b/mt7615/dma.c @@ -12,8 +12,7 @@ #include "mac.h" static int -mt7615_init_tx_queue(struct mt7615_dev *dev, struct mt76_sw_queue *q, - int idx, int n_desc) +mt7615_init_tx_queue(struct mt7615_dev *dev, int qid, int idx, int n_desc) { struct mt76_queue *hwq; int err; @@ -26,7 +25,7 @@ mt7615_init_tx_queue(struct mt7615_dev *dev, struct mt76_sw_queue *q, if (err < 0) return err; - q->q = hwq; + dev->mt76.q_tx[qid] = hwq; return 0; } @@ -44,19 +43,18 @@ mt7622_init_tx_queues_multi(struct mt7615_dev *dev) int i; for (i = 0; i < ARRAY_SIZE(wmm_queue_map); i++) { - ret = mt7615_init_tx_queue(dev, &dev->mt76.q_tx[i], - wmm_queue_map[i], + ret = mt7615_init_tx_queue(dev, i, wmm_queue_map[i], MT7615_TX_RING_SIZE / 2); if (ret) return ret; } - ret = mt7615_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_PSD], + ret = mt7615_init_tx_queue(dev, MT_TXQ_PSD, MT7622_TXQ_MGMT, MT7615_TX_MGMT_RING_SIZE); if (ret) return ret; - ret = mt7615_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_MCU], + ret = mt7615_init_tx_queue(dev, MT_TXQ_MCU, MT7622_TXQ_MCU, MT7615_TX_MCU_RING_SIZE); return ret; } @@ -64,10 +62,9 @@ mt7622_init_tx_queues_multi(struct mt7615_dev *dev) static int mt7615_init_tx_queues(struct mt7615_dev *dev) { - struct mt76_sw_queue *q; int ret, i; - ret = mt7615_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_FWDL], + ret = mt7615_init_tx_queue(dev, MT_TXQ_FWDL, MT7615_TXQ_FWDL, MT7615_TX_FWDL_RING_SIZE); if (ret) @@ -76,18 +73,14 @@ mt7615_init_tx_queues(struct mt7615_dev *dev) if (!is_mt7615(&dev->mt76)) return mt7622_init_tx_queues_multi(dev); - ret = mt7615_init_tx_queue(dev, &dev->mt76.q_tx[0], 0, - MT7615_TX_RING_SIZE); + ret = mt7615_init_tx_queue(dev, 0, 0, MT7615_TX_RING_SIZE); if (ret) return ret; - for (i = 1; i < MT_TXQ_MCU; i++) { - q = &dev->mt76.q_tx[i]; - q->q = dev->mt76.q_tx[0].q; - } + for (i = 1; i < MT_TXQ_MCU; i++) + dev->mt76.q_tx[i] = dev->mt76.q_tx[0]; - ret = mt7615_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_MCU], - MT7615_TXQ_MCU, + ret = mt7615_init_tx_queue(dev, MT_TXQ_MCU, MT7615_TXQ_MCU, MT7615_TX_MCU_RING_SIZE); return 0; } diff --git a/mt7615/mt7615.h b/mt7615/mt7615.h index 9e048ff85..6a9f9187f 100644 --- a/mt7615/mt7615.h +++ b/mt7615/mt7615.h @@ -542,7 +542,7 @@ static inline u8 mt7615_lmac_mapping(struct mt7615_dev *dev, u8 ac) static inline u32 mt7615_tx_mcu_int_mask(struct mt7615_dev *dev) { - return MT_INT_TX_DONE(dev->mt76.q_tx[MT_TXQ_MCU].q->hw_idx); + return MT_INT_TX_DONE(dev->mt76.q_tx[MT_TXQ_MCU]->hw_idx); } void mt7615_dma_reset(struct mt7615_dev *dev); diff --git a/mt7615/sdio_mcu.c b/mt7615/sdio_mcu.c index 53fb6018d..38670c003 100644 --- a/mt7615/sdio_mcu.c +++ b/mt7615/sdio_mcu.c @@ -53,7 +53,7 @@ mt7663s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, if (ret) goto out; - mt76_queue_kick(dev, mdev->q_tx[MT_TXQ_MCU].q); + mt76_queue_kick(dev, mdev->q_tx[MT_TXQ_MCU]); if (wait_resp) ret = mt7615_mcu_wait_response(dev, cmd, seq); diff --git a/mt7615/sdio_txrx.c b/mt7615/sdio_txrx.c index 8863c3a23..3557df528 100644 --- a/mt7615/sdio_txrx.c +++ b/mt7615/sdio_txrx.c @@ -162,7 +162,7 @@ static int mt7663s_tx_update_sched(struct mt76_dev *dev, static int mt7663s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q) { - bool mcu = q == dev->q_tx[MT_TXQ_MCU].q; + bool mcu = q == dev->q_tx[MT_TXQ_MCU]; struct mt76_sdio *sdio = &dev->sdio; int nframes = 0; @@ -204,7 +204,7 @@ void mt7663s_tx_work(struct work_struct *work) for (i = 0; i < MT_TXQ_MCU_WA; i++) { int ret; - ret = mt7663s_tx_run_queue(dev, dev->q_tx[i].q); + ret = mt7663s_tx_run_queue(dev, dev->q_tx[i]); if (ret < 0) break; diff --git a/mt76x02_mmio.c b/mt76x02_mmio.c index fc1662964..f6c59f510 100644 --- a/mt76x02_mmio.c +++ b/mt76x02_mmio.c @@ -14,7 +14,7 @@ static void mt76x02_pre_tbtt_tasklet(unsigned long arg) { struct mt76x02_dev *dev = (struct mt76x02_dev *)arg; - struct mt76_queue *q = dev->mt76.q_tx[MT_TXQ_PSD].q; + struct mt76_queue *q = dev->mt76.q_tx[MT_TXQ_PSD]; struct beacon_bc_data data = {}; struct sk_buff *skb; int i; @@ -103,8 +103,7 @@ void mt76x02e_init_beacon_config(struct mt76x02_dev *dev) EXPORT_SYMBOL_GPL(mt76x02e_init_beacon_config); static int -mt76x02_init_tx_queue(struct mt76x02_dev *dev, struct mt76_sw_queue *q, - int idx, int n_desc) +mt76x02_init_tx_queue(struct mt76x02_dev *dev, int qid, int idx, int n_desc) { struct mt76_queue *hwq; int err; @@ -117,7 +116,7 @@ mt76x02_init_tx_queue(struct mt76x02_dev *dev, struct mt76_sw_queue *q, if (err < 0) return err; - q->q = hwq; + dev->mt76.q_tx[qid] = hwq; mt76x02_irq_enable(dev, MT_INT_TX_DONE(idx)); @@ -209,19 +208,18 @@ int mt76x02_dma_init(struct mt76x02_dev *dev) mt76_wr(dev, MT_WPDMA_RST_IDX, ~0); for (i = 0; i < IEEE80211_NUM_ACS; i++) { - ret = mt76x02_init_tx_queue(dev, &dev->mt76.q_tx[i], - mt76_ac_to_hwq(i), + ret = mt76x02_init_tx_queue(dev, i, mt76_ac_to_hwq(i), MT_TX_RING_SIZE); if (ret) return ret; } - ret = mt76x02_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_PSD], + ret = mt76x02_init_tx_queue(dev, MT_TXQ_PSD, MT_TX_HW_QUEUE_MGMT, MT_TX_RING_SIZE); if (ret) return ret; - ret = mt76x02_init_tx_queue(dev, &dev->mt76.q_tx[MT_TXQ_MCU], + ret = mt76x02_init_tx_queue(dev, MT_TXQ_MCU, MT_TX_HW_QUEUE_MCU, MT_MCU_RING_SIZE); if (ret) return ret; @@ -293,7 +291,7 @@ irqreturn_t mt76x02_irq_handler(int irq, void *dev_instance) if (dev->mt76.csa_complete) mt76_csa_finish(&dev->mt76); else - mt76_queue_kick(dev, dev->mt76.q_tx[MT_TXQ_PSD].q); + mt76_queue_kick(dev, dev->mt76.q_tx[MT_TXQ_PSD]); } if (intr & MT_INT_TX_STAT) @@ -358,7 +356,7 @@ static bool mt76x02_tx_hang(struct mt76x02_dev *dev) int i; for (i = 0; i < 4; i++) { - q = dev->mt76.q_tx[i].q; + q = dev->mt76.q_tx[i]; if (!q->queued) continue; diff --git a/mt76x02_usb_core.c b/mt76x02_usb_core.c index 693daab5d..5d0a2857f 100644 --- a/mt76x02_usb_core.c +++ b/mt76x02_usb_core.c @@ -66,7 +66,7 @@ int mt76x02u_tx_prepare_skb(struct mt76_dev *mdev, void *data, struct mt76_tx_info *tx_info) { struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); - int pid, len = tx_info->skb->len, ep = q2ep(mdev->q_tx[qid].q->hw_idx); + int pid, len = tx_info->skb->len, ep = q2ep(mdev->q_tx[qid]->hw_idx); struct mt76x02_txwi *txwi; bool ampdu = IEEE80211_SKB_CB(tx_info->skb)->flags & IEEE80211_TX_CTL_AMPDU; enum mt76_qsel qsel; diff --git a/mt76x02_util.c b/mt76x02_util.c index dbd4077ea..412f3f7aa 100644 --- a/mt76x02_util.c +++ b/mt76x02_util.c @@ -490,7 +490,7 @@ int mt76x02_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u8 cw_min = 5, cw_max = 10, qid; u32 val; - qid = dev->mt76.q_tx[queue].q->hw_idx; + qid = dev->mt76.q_tx[queue]->hw_idx; if (params->cw_min) cw_min = fls(params->cw_min); diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c index 677b94791..388077ac2 100644 --- a/mt7915/debugfs.c +++ b/mt7915/debugfs.c @@ -292,15 +292,15 @@ mt7915_queues_read(struct seq_file *s, void *data) int i; for (i = 0; i < ARRAY_SIZE(queue_map); i++) { - struct mt76_sw_queue *q = &dev->mt76.q_tx[queue_map[i].id]; + struct mt76_queue *q = dev->mt76.q_tx[queue_map[i].id]; - if (!q->q) + if (!q) continue; seq_printf(s, "%s: queued=%d head=%d tail=%d\n", - queue_map[i].queue, q->q->queued, q->q->head, - q->q->tail); + queue_map[i].queue, q->queued, q->head, + q->tail); } return 0; diff --git a/mt7915/dma.c b/mt7915/dma.c index 3dec15b9d..875badcc3 100644 --- a/mt7915/dma.c +++ b/mt7915/dma.c @@ -8,7 +8,6 @@ static int mt7915_init_tx_queues(struct mt7915_dev *dev, int n_desc) { - struct mt76_sw_queue *q; struct mt76_queue *hwq; int err, i; @@ -21,17 +20,14 @@ mt7915_init_tx_queues(struct mt7915_dev *dev, int n_desc) if (err < 0) return err; - for (i = 0; i < MT_TXQ_MCU; i++) { - q = &dev->mt76.q_tx[i]; - q->q = hwq; - } + for (i = 0; i < MT_TXQ_MCU; i++) + dev->mt76.q_tx[i] = hwq; return 0; } static int -mt7915_init_mcu_queue(struct mt7915_dev *dev, struct mt76_sw_queue *q, - int idx, int n_desc) +mt7915_init_mcu_queue(struct mt7915_dev *dev, int qid, int idx, int n_desc) { struct mt76_queue *hwq; int err; @@ -44,7 +40,7 @@ mt7915_init_mcu_queue(struct mt7915_dev *dev, struct mt76_sw_queue *q, if (err < 0) return err; - q->q = hwq; + dev->mt76.q_tx[qid] = hwq; return 0; } @@ -266,22 +262,19 @@ int mt7915_dma_init(struct mt7915_dev *dev) return ret; /* command to WM */ - ret = mt7915_init_mcu_queue(dev, &dev->mt76.q_tx[MT_TXQ_MCU], - MT7915_TXQ_MCU_WM, + ret = mt7915_init_mcu_queue(dev, MT_TXQ_MCU, MT7915_TXQ_MCU_WM, MT7915_TX_MCU_RING_SIZE); if (ret) return ret; /* command to WA */ - ret = mt7915_init_mcu_queue(dev, &dev->mt76.q_tx[MT_TXQ_MCU_WA], - MT7915_TXQ_MCU_WA, + ret = mt7915_init_mcu_queue(dev, MT_TXQ_MCU_WA, MT7915_TXQ_MCU_WA, MT7915_TX_MCU_RING_SIZE); if (ret) return ret; /* firmware download */ - ret = mt7915_init_mcu_queue(dev, &dev->mt76.q_tx[MT_TXQ_FWDL], - MT7915_TXQ_FWDL, + ret = mt7915_init_mcu_queue(dev, MT_TXQ_FWDL, MT7915_TXQ_FWDL, MT7915_TX_FWDL_RING_SIZE); if (ret) return ret; diff --git a/sdio.c b/sdio.c index 8ed18c951..7777d4944 100644 --- a/sdio.c +++ b/sdio.c @@ -48,7 +48,7 @@ static int mt76s_alloc_tx(struct mt76_dev *dev) spin_lock_init(&q->lock); q->hw_idx = i; - dev->q_tx[i].q = q; + dev->q_tx[i] = q; q->entry = devm_kcalloc(dev->dev, MT_NUM_TX_ENTRIES, sizeof(*q->entry), @@ -133,9 +133,8 @@ mt76s_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q) static void mt76s_process_tx_queue(struct mt76_dev *dev, enum mt76_txq_id qid) { - struct mt76_sw_queue *sq = &dev->q_tx[qid]; + struct mt76_queue *q = dev->q_tx[qid]; struct mt76_queue_entry entry; - struct mt76_queue *q = sq->q; bool wake; while (q->queued > 0) { @@ -199,7 +198,7 @@ mt76s_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid, struct sk_buff *skb, struct mt76_wcid *wcid, struct ieee80211_sta *sta) { - struct mt76_queue *q = dev->q_tx[qid].q; + struct mt76_queue *q = dev->q_tx[qid]; struct mt76_tx_info tx_info = { .skb = skb, }; @@ -226,7 +225,7 @@ static int mt76s_tx_queue_skb_raw(struct mt76_dev *dev, enum mt76_txq_id qid, struct sk_buff *skb, u32 tx_info) { - struct mt76_queue *q = dev->q_tx[qid].q; + struct mt76_queue *q = dev->q_tx[qid]; int ret = -ENOSPC, len = skb->len; if (q->queued == q->ndesc) diff --git a/testmode.c b/testmode.c index 1653f0b10..3808808b0 100644 --- a/testmode.c +++ b/testmode.c @@ -29,7 +29,7 @@ void mt76_testmode_tx_pending(struct mt76_dev *dev) return; qid = skb_get_queue_mapping(skb); - q = dev->q_tx[qid].q; + q = dev->q_tx[qid]; spin_lock_bh(&q->lock); diff --git a/tx.c b/tx.c index 215536724..66bf56594 100644 --- a/tx.c +++ b/tx.c @@ -310,7 +310,7 @@ __mt76_tx_queue_skb(struct mt76_dev *dev, int qid, struct sk_buff *skb, return idx; wcid = (struct mt76_wcid *)sta->drv_priv; - q = dev->q_tx[qid].q; + q = dev->q_tx[qid]; q->entry[idx].wcid = wcid->idx; pending = atomic_inc_return(&wcid->non_aql_packets); if (stop && pending >= MT_MAX_NON_AQL_PKT) @@ -355,7 +355,7 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta, if (ext_phy) info->hw_queue |= MT_TX_HW_QUEUE_EXT_PHY; - q = dev->q_tx[qid].q; + q = dev->q_tx[qid]; spin_lock_bh(&q->lock); __mt76_tx_queue_skb(dev, qid, skb, wcid, sta, NULL); @@ -424,7 +424,7 @@ mt76_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct mt76_phy *phy = hw->priv; struct mt76_dev *dev = phy->dev; struct sk_buff *last_skb = NULL; - struct mt76_queue *hwq = dev->q_tx[MT_TXQ_PSD].q; + struct mt76_queue *hwq = dev->q_tx[MT_TXQ_PSD]; int i; spin_lock_bh(&hwq->lock); @@ -461,14 +461,13 @@ mt76_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta, EXPORT_SYMBOL_GPL(mt76_release_buffered_frames); static int -mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_sw_queue *sq, +mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q, struct mt76_txq *mtxq) { struct mt76_dev *dev = phy->dev; struct ieee80211_txq *txq = mtxq_to_txq(mtxq); enum mt76_txq_id qid = mt76_txq_get_qid(txq); struct mt76_wcid *wcid = mtxq->wcid; - struct mt76_queue *hwq = sq->q; struct ieee80211_tx_info *info; struct sk_buff *skb; int n_frames = 1; @@ -518,7 +517,7 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_sw_queue *sq, n_frames++; } while (1); - dev->queue_ops->kick(dev, hwq); + dev->queue_ops->kick(dev, q); return n_frames; } @@ -527,14 +526,13 @@ static int mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid) { struct mt76_dev *dev = phy->dev; - struct mt76_sw_queue *sq = &dev->q_tx[qid]; - struct mt76_queue *hwq = sq->q; + struct mt76_queue *q = dev->q_tx[qid]; struct ieee80211_txq *txq; struct mt76_txq *mtxq; struct mt76_wcid *wcid; int ret = 0; - spin_lock_bh(&hwq->lock); + spin_lock_bh(&q->lock); while (1) { if (test_bit(MT76_STATE_PM, &phy->state) || test_bit(MT76_RESET, &phy->state)) { @@ -562,16 +560,16 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid) u8 tid = txq->tid; mtxq->send_bar = false; - spin_unlock_bh(&hwq->lock); + spin_unlock_bh(&q->lock); ieee80211_send_bar(vif, sta->addr, tid, agg_ssn); - spin_lock_bh(&hwq->lock); + spin_lock_bh(&q->lock); } - ret += mt76_txq_send_burst(phy, sq, mtxq); + ret += mt76_txq_send_burst(phy, q, mtxq); ieee80211_return_txq(phy->hw, txq, !skb_queue_empty(&mtxq->retry_q)); } - spin_unlock_bh(&hwq->lock); + spin_unlock_bh(&q->lock); return ret; } @@ -632,7 +630,7 @@ void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta, continue; mtxq = (struct mt76_txq *)txq->drv_priv; - hwq = mtxq->swq->q; + hwq = mtxq->q; spin_lock_bh(&hwq->lock); mtxq->send_bar = mtxq->aggr && send_bar; @@ -677,7 +675,7 @@ void mt76_txq_init(struct mt76_dev *dev, struct ieee80211_txq *txq) skb_queue_head_init(&mtxq->retry_q); - mtxq->swq = &dev->q_tx[mt76_txq_get_qid(txq)]; + mtxq->q = dev->q_tx[mt76_txq_get_qid(txq)]; } EXPORT_SYMBOL_GPL(mt76_txq_init); diff --git a/usb.c b/usb.c index 8a2988b2a..edbcabd2b 100644 --- a/usb.c +++ b/usb.c @@ -796,14 +796,12 @@ static void mt76u_tx_worker(struct mt76_worker *w) { struct mt76_dev *dev = container_of(w, struct mt76_dev, tx_worker); struct mt76_queue_entry entry; - struct mt76_sw_queue *sq; struct mt76_queue *q; bool wake; int i; for (i = 0; i < IEEE80211_NUM_ACS; i++) { - sq = &dev->q_tx[i]; - q = sq->q; + q = dev->q_tx[i]; while (q->queued > 0) { if (!q->entry[q->tail].done) @@ -893,7 +891,7 @@ mt76u_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid, struct sk_buff *skb, struct mt76_wcid *wcid, struct ieee80211_sta *sta) { - struct mt76_queue *q = dev->q_tx[qid].q; + struct mt76_queue *q = dev->q_tx[qid]; struct mt76_tx_info tx_info = { .skb = skb, }; @@ -972,7 +970,7 @@ static int mt76u_alloc_tx(struct mt76_dev *dev) for (i = 0; i <= MT_TXQ_PSD; i++) { if (i >= IEEE80211_NUM_ACS) { - dev->q_tx[i].q = dev->q_tx[0].q; + dev->q_tx[i] = dev->q_tx[0]; continue; } @@ -982,7 +980,7 @@ static int mt76u_alloc_tx(struct mt76_dev *dev) spin_lock_init(&q->lock); q->hw_idx = mt76u_ac_to_hwq(dev, i); - dev->q_tx[i].q = q; + dev->q_tx[i] = q; q->entry = devm_kcalloc(dev->dev, MT_NUM_TX_ENTRIES, sizeof(*q->entry), @@ -1009,7 +1007,7 @@ static void mt76u_free_tx(struct mt76_dev *dev) struct mt76_queue *q; int j; - q = dev->q_tx[i].q; + q = dev->q_tx[i]; if (!q) continue; @@ -1034,7 +1032,7 @@ void mt76u_stop_tx(struct mt76_dev *dev) dev_err(dev->dev, "timed out waiting for pending tx\n"); for (i = 0; i < IEEE80211_NUM_ACS; i++) { - q = dev->q_tx[i].q; + q = dev->q_tx[i]; if (!q) continue; @@ -1046,7 +1044,7 @@ void mt76u_stop_tx(struct mt76_dev *dev) * will fail to submit urb, cleanup those skb's manually. */ for (i = 0; i < IEEE80211_NUM_ACS; i++) { - q = dev->q_tx[i].q; + q = dev->q_tx[i]; if (!q) continue;