enable AirTimeFairness for mt7663u
Subsystems (2)
Lorenzo Bianconi
maintainercover enable AirTimeFairness for mt7663u
Initialize tx_status_data pointer in order to enable Air Time Fairness for mt7663u chipset.
Rework mt7615_mac_sta_poll for usb code
Lorenzo Bianconi (2):
mt76: mt7615: rework mt7615_mac_sta_poll for usb code
mt76: mt7663u: enable AirTimeFairness
.../net/wireless/mediatek/mt76/mt7615/dma.c | 2 ++ .../net/wireless/mediatek/mt76/mt7615/mac.c | 20 ++++++++----------- .../net/wireless/mediatek/mt76/mt7615/usb.c | 12 +++++++++++ 3 files changed, 22 insertions(+), 12 deletions(-)
Signature · 1 line
2.25.3
Lorenzo Bianconi
maintainerPATCH 1/2 mt76: mt7615: rework mt7615_mac_sta_poll for usb code
Since usb code can't access device registers in interrupt context, move rcu_read_lock/rcu_read_unlock in mt7615_poll_tx routine. Moreover loop over a local msta list in mt7615_mac_sta_poll since mt7663u driver will not be able to complete the inner while loop before sta_poll_list list is refilled by mt7615_mac_add_txs/mt7615_mac_fill_rx
--- .../net/wireless/mediatek/mt76/mt7615/dma.c | 2 ++ .../net/wireless/mediatek/mt76/mt7615/mac.c | 20 ++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7615/dma.c +2 -0
@@ -121,7 +121,9 @@ static int mt7615_poll_tx(struct napi_struct *napi, int budget)mt7615_tx_cleanup (dev); +rcu_read_lock ();mt7615_mac_sta_poll (dev); +rcu_read_unlock ();tasklet_schedule (&dev->mt76.tx_tasklet);
drivers/net/wireless/mediatek/mt76/mt7615/mac.c +8 -12
@@ -724,22 +724,20 @@ void mt7615_mac_sta_poll(struct mt7615_dev *dev)struct ieee80211_sta *sta;struct mt7615_sta *msta;u32 addr, tx_time[4 ], rx_time[4 ]; +struct list_head sta_poll_list;int i; -rcu_read_lock (); +INIT_LIST_HEAD (&sta_poll_list); +spin_lock_bh (&dev->sta_poll_lock); +list_splice_init (&dev->sta_poll_list, &sta_poll_list); +spin_unlock_bh (&dev->sta_poll_lock); -while (true) { +while (!list_empty (&sta_poll_list)) {bool clear = false; -spin_lock_bh (&dev->sta_poll_lock); -if (list_empty (&dev->sta_poll_list)) { -spin_unlock_bh (&dev->sta_poll_lock); -break ; - } - msta =list_first_entry (&dev->sta_poll_list, - struct mt7615_sta, poll_list); + msta = list_first_entry(&sta_poll_list, struct mt7615_sta, + poll_list);list_del_init (&msta->poll_list); -spin_unlock_bh (&dev->sta_poll_lock); addr =mt7615_mac_wtbl_addr (dev, msta->wcid.idx) +19 *4 ;
@@ -779,8 +777,6 @@ void mt7615_mac_sta_poll(struct mt7615_dev *dev) rx_cur); } } - -rcu_read_unlock (); }EXPORT_SYMBOL_GPL (mt7615_mac_sta_poll);
Signature · 1 line
2.25.3
Lorenzo Bianconi
maintainerPATCH 2/2 mt76: mt7663u: enable AirTimeFairness
In reply to Lorenzo BianconiInitialize tx_status_data pointer in order to enable Air Time Fairness for mt7663u chipset
--- drivers/net/wireless/mediatek/mt76/mt7615/usb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7615/usb.c +12 -0
@@ -249,6 +249,17 @@ mt7663u_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,return mt76u_skb_dma_info (tx_info->skb, tx_info->skb->len); } +static bool mt7663u_tx_status_data (struct mt76_dev *mdev,u8 *update) +{ + struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76); + +mutex_lock (&dev->mt76.mutex); +mt7615_mac_sta_poll (dev); +mutex_unlock (&dev->mt76.mutex); + +return 0 ; +} +static int mt7663u_probe (struct usb_interface *usb_intf,const struct usb_device_id *id) {
@@ -257,6 +268,7 @@ static int mt7663u_probe(struct usb_interface *usb_intf, .drv_flags = MT_DRV_RX_DMA_HDR, .tx_prepare_skb = mt7663u_tx_prepare_skb, .tx_complete_skb = mt7663u_tx_complete_skb, + .tx_status_data = mt7663u_tx_status_data, .rx_skb = mt7615_queue_rx_skb, .sta_ps = mt7615_sta_ps, .sta_add = mt7615_mac_sta_add,
Signature · 1 line
2.25.3