mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: change .sta_assoc callback to .sta_event
Also report auth/disassoc events, in order to give the driver more control over handling the station state. Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+17
-6
@@ -1501,21 +1501,32 @@ int mt76_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
{
|
||||
struct mt76_phy *phy = hw->priv;
|
||||
struct mt76_dev *dev = phy->dev;
|
||||
enum mt76_sta_event ev;
|
||||
|
||||
if (old_state == IEEE80211_STA_NOTEXIST &&
|
||||
new_state == IEEE80211_STA_NONE)
|
||||
return mt76_sta_add(phy, vif, sta);
|
||||
|
||||
if (old_state == IEEE80211_STA_AUTH &&
|
||||
new_state == IEEE80211_STA_ASSOC &&
|
||||
dev->drv->sta_assoc)
|
||||
dev->drv->sta_assoc(dev, vif, sta);
|
||||
|
||||
if (old_state == IEEE80211_STA_NONE &&
|
||||
new_state == IEEE80211_STA_NOTEXIST)
|
||||
mt76_sta_remove(dev, vif, sta);
|
||||
|
||||
return 0;
|
||||
if (!dev->drv->sta_event)
|
||||
return 0;
|
||||
|
||||
if (old_state == IEEE80211_STA_AUTH &&
|
||||
new_state == IEEE80211_STA_ASSOC)
|
||||
ev = MT76_STA_EVENT_ASSOC;
|
||||
else if (old_state == IEEE80211_STA_ASSOC &&
|
||||
new_state == IEEE80211_STA_AUTHORIZED)
|
||||
ev = MT76_STA_EVENT_AUTHORIZE;
|
||||
else if (old_state == IEEE80211_STA_ASSOC &&
|
||||
new_state == IEEE80211_STA_AUTH)
|
||||
ev = MT76_STA_EVENT_DISASSOC;
|
||||
else
|
||||
return 0;
|
||||
|
||||
return dev->drv->sta_event(dev, vif, sta, ev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_sta_state);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user