mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: beaconing fixes for USB
Configure beaconing on USB devices without PS buffering support. Signed-off-by: Stanislaw Gruszka <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
171adaf2c2
commit
dcab682bd3
+26
-3
@@ -1061,8 +1061,9 @@ int mt76x02_mac_set_beacon(struct mt76x02_dev *dev, u8 vif_idx,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev,
|
static void
|
||||||
u8 vif_idx, bool val)
|
__mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev, u8 vif_idx,
|
||||||
|
bool val, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
u8 old_mask = dev->beacon_mask;
|
u8 old_mask = dev->beacon_mask;
|
||||||
bool en;
|
bool en;
|
||||||
@@ -1070,6 +1071,8 @@ void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev,
|
|||||||
|
|
||||||
if (val) {
|
if (val) {
|
||||||
dev->beacon_mask |= BIT(vif_idx);
|
dev->beacon_mask |= BIT(vif_idx);
|
||||||
|
if (skb)
|
||||||
|
mt76x02_mac_set_beacon(dev, vif_idx, skb);
|
||||||
} else {
|
} else {
|
||||||
dev->beacon_mask &= ~BIT(vif_idx);
|
dev->beacon_mask &= ~BIT(vif_idx);
|
||||||
mt76x02_mac_set_beacon(dev, vif_idx, NULL);
|
mt76x02_mac_set_beacon(dev, vif_idx, NULL);
|
||||||
@@ -1080,14 +1083,34 @@ void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev,
|
|||||||
|
|
||||||
en = dev->beacon_mask;
|
en = dev->beacon_mask;
|
||||||
|
|
||||||
mt76_rmw_field(dev, MT_INT_TIMER_EN, MT_INT_TIMER_EN_PRE_TBTT_EN, en);
|
|
||||||
reg = MT_BEACON_TIME_CFG_BEACON_TX |
|
reg = MT_BEACON_TIME_CFG_BEACON_TX |
|
||||||
MT_BEACON_TIME_CFG_TBTT_EN |
|
MT_BEACON_TIME_CFG_TBTT_EN |
|
||||||
MT_BEACON_TIME_CFG_TIMER_EN;
|
MT_BEACON_TIME_CFG_TIMER_EN;
|
||||||
mt76_rmw(dev, MT_BEACON_TIME_CFG, reg, reg * en);
|
mt76_rmw(dev, MT_BEACON_TIME_CFG, reg, reg * en);
|
||||||
|
|
||||||
|
if (mt76_is_usb(dev))
|
||||||
|
return;
|
||||||
|
|
||||||
|
mt76_rmw_field(dev, MT_INT_TIMER_EN, MT_INT_TIMER_EN_PRE_TBTT_EN, en);
|
||||||
if (en)
|
if (en)
|
||||||
mt76x02_irq_enable(dev, MT_INT_PRE_TBTT | MT_INT_TBTT);
|
mt76x02_irq_enable(dev, MT_INT_PRE_TBTT | MT_INT_TBTT);
|
||||||
else
|
else
|
||||||
mt76x02_irq_disable(dev, MT_INT_PRE_TBTT | MT_INT_TBTT);
|
mt76x02_irq_disable(dev, MT_INT_PRE_TBTT | MT_INT_TBTT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev,
|
||||||
|
struct ieee80211_vif *vif, bool val)
|
||||||
|
{
|
||||||
|
u8 vif_idx = ((struct mt76x02_vif *)vif->drv_priv)->idx;
|
||||||
|
struct sk_buff *skb = NULL;
|
||||||
|
|
||||||
|
if (mt76_is_mmio(dev))
|
||||||
|
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||||
|
else if (val)
|
||||||
|
skb = ieee80211_beacon_get(mt76_hw(dev), vif);
|
||||||
|
|
||||||
|
__mt76x02_mac_set_beacon_enable(dev, vif_idx, val, skb);
|
||||||
|
|
||||||
|
if (mt76_is_mmio(dev))
|
||||||
|
tasklet_enable(&dev->pre_tbtt_tasklet);
|
||||||
|
}
|
||||||
|
|||||||
+2
-2
@@ -204,8 +204,8 @@ void mt76x02_mac_work(struct work_struct *work);
|
|||||||
void mt76x02_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr);
|
void mt76x02_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr);
|
||||||
int mt76x02_mac_set_beacon(struct mt76x02_dev *dev, u8 vif_idx,
|
int mt76x02_mac_set_beacon(struct mt76x02_dev *dev, u8 vif_idx,
|
||||||
struct sk_buff *skb);
|
struct sk_buff *skb);
|
||||||
void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev, u8 vif_idx,
|
void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev,
|
||||||
bool val);
|
struct ieee80211_vif *vif, bool val);
|
||||||
|
|
||||||
void mt76x02_edcca_init(struct mt76x02_dev *dev);
|
void mt76x02_edcca_init(struct mt76x02_dev *dev);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-6
@@ -705,12 +705,8 @@ void mt76x02_bss_info_changed(struct ieee80211_hw *hw,
|
|||||||
if (changed & BSS_CHANGED_BSSID)
|
if (changed & BSS_CHANGED_BSSID)
|
||||||
mt76x02_mac_set_bssid(dev, mvif->idx, info->bssid);
|
mt76x02_mac_set_bssid(dev, mvif->idx, info->bssid);
|
||||||
|
|
||||||
if (changed & BSS_CHANGED_BEACON_ENABLED) {
|
if (changed & BSS_CHANGED_BEACON_ENABLED)
|
||||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
mt76x02_mac_set_beacon_enable(dev, vif, info->enable_beacon);
|
||||||
mt76x02_mac_set_beacon_enable(dev, mvif->idx,
|
|
||||||
info->enable_beacon);
|
|
||||||
tasklet_enable(&dev->pre_tbtt_tasklet);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed & BSS_CHANGED_HT || changed & BSS_CHANGED_ERP_CTS_PROT)
|
if (changed & BSS_CHANGED_HT || changed & BSS_CHANGED_ERP_CTS_PROT)
|
||||||
mt76x02_mac_set_tx_protection(dev, info->use_cts_prot,
|
mt76x02_mac_set_tx_protection(dev, info->use_cts_prot,
|
||||||
|
|||||||
Reference in New Issue
Block a user