diff mbox series

[1/4] mt76: mt76x02: ommit beacon slot clearing

Message ID 20191116111709.4686-2-markus.theil@tu-ilmenau.de (mailing list archive)
State Superseded
Delegated to: Felix Fietkau
Headers show
Series [1/4] mt76: mt76x02: ommit beacon slot clearing | expand

Commit Message

Markus Theil Nov. 16, 2019, 11:17 a.m. UTC
mt76 hw does not send beacons from beacon slots, if the corresponding
bitmask is set accordingly. Therefore we can ommit clearing the beacon
memory. Clearing uses many usb calls, if usb drivers are used. These
calls unnecessarily slow down the beacon tasklet. Thanks to Stanislaw
Gruzska for pointing this out.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Markus Theil Nov. 16, 2019, 11:44 a.m. UTC | #1
On 11/16/19 12:17 PM, Markus Theil wrote:
> mt76 hw does not send beacons from beacon slots, if the corresponding
> bitmask is set accordingly. Therefore we can ommit clearing the beacon
> memory. Clearing uses many usb calls, if usb drivers are used. These
> calls unnecessarily slow down the beacon tasklet. Thanks to Stanislaw
> Gruzska for pointing this out.
>
> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
> ---
>  drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
> index 4209209ac940..54fe449f01c9 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
> @@ -56,10 +56,6 @@ __mt76x02_mac_set_beacon(struct mt76x02_dev *dev, u8 bcn_idx,
>  		ret = mt76x02_write_beacon(dev, beacon_addr, skb);
>  		if (!ret)
>  			dev->beacon_data_mask |= BIT(bcn_idx);
> -	} else {
> -		dev->beacon_data_mask &= ~BIT(bcn_idx);

I've noticed, that I have to keep the line above, in order to correctly
track the beacon_data_mask.
I'll correct it in the next version.

> -		for (i = 0; i < beacon_len; i += 4)
> -			mt76_wr(dev, beacon_addr + i, 0);
>  	}
>  
>  	mt76_wr(dev, MT_BCN_BYPASS_MASK, 0xff00 | ~dev->beacon_data_mask);
> @@ -241,17 +237,11 @@ EXPORT_SYMBOL_GPL(mt76x02_enqueue_buffered_bc);
>  
>  void mt76x02_init_beacon_config(struct mt76x02_dev *dev)
>  {
> -	int i;
> -
>  	mt76_clear(dev, MT_BEACON_TIME_CFG, (MT_BEACON_TIME_CFG_TIMER_EN |
>  					     MT_BEACON_TIME_CFG_TBTT_EN |
>  					     MT_BEACON_TIME_CFG_BEACON_TX));
>  	mt76_set(dev, MT_BEACON_TIME_CFG, MT_BEACON_TIME_CFG_SYNC_MODE);
>  	mt76_wr(dev, MT_BCN_BYPASS_MASK, 0xffff);
> -
> -	for (i = 0; i < 8; i++)
> -		mt76x02_mac_set_beacon(dev, i, NULL);
> -
>  	mt76x02_set_beacon_offsets(dev);
>  }
>  EXPORT_SYMBOL_GPL(mt76x02_init_beacon_config);
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
index 4209209ac940..54fe449f01c9 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
@@ -56,10 +56,6 @@  __mt76x02_mac_set_beacon(struct mt76x02_dev *dev, u8 bcn_idx,
 		ret = mt76x02_write_beacon(dev, beacon_addr, skb);
 		if (!ret)
 			dev->beacon_data_mask |= BIT(bcn_idx);
-	} else {
-		dev->beacon_data_mask &= ~BIT(bcn_idx);
-		for (i = 0; i < beacon_len; i += 4)
-			mt76_wr(dev, beacon_addr + i, 0);
 	}
 
 	mt76_wr(dev, MT_BCN_BYPASS_MASK, 0xff00 | ~dev->beacon_data_mask);
@@ -241,17 +237,11 @@  EXPORT_SYMBOL_GPL(mt76x02_enqueue_buffered_bc);
 
 void mt76x02_init_beacon_config(struct mt76x02_dev *dev)
 {
-	int i;
-
 	mt76_clear(dev, MT_BEACON_TIME_CFG, (MT_BEACON_TIME_CFG_TIMER_EN |
 					     MT_BEACON_TIME_CFG_TBTT_EN |
 					     MT_BEACON_TIME_CFG_BEACON_TX));
 	mt76_set(dev, MT_BEACON_TIME_CFG, MT_BEACON_TIME_CFG_SYNC_MODE);
 	mt76_wr(dev, MT_BCN_BYPASS_MASK, 0xffff);
-
-	for (i = 0; i < 8; i++)
-		mt76x02_mac_set_beacon(dev, i, NULL);
-
 	mt76x02_set_beacon_offsets(dev);
 }
 EXPORT_SYMBOL_GPL(mt76x02_init_beacon_config);