2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
6 #include <net/mac80211.h>
7 #include "ieee80211_i.h"
9 #include "driver-ops.h"
12 int drv_sta_state(struct ieee80211_local *local,
13 struct ieee80211_sub_if_data *sdata,
15 enum ieee80211_sta_state old_state,
16 enum ieee80211_sta_state new_state)
22 sdata = get_bss_sdata(sdata);
23 if (!check_sdata_in_driver(sdata))
26 trace_drv_sta_state(local, sdata, &sta->sta, old_state, new_state);
27 if (local->ops->sta_state) {
28 ret = local->ops->sta_state(&local->hw, &sdata->vif, &sta->sta,
29 old_state, new_state);
30 } else if (old_state == IEEE80211_STA_AUTH &&
31 new_state == IEEE80211_STA_ASSOC) {
32 ret = drv_sta_add(local, sdata, &sta->sta);
35 } else if (old_state == IEEE80211_STA_ASSOC &&
36 new_state == IEEE80211_STA_AUTH) {
37 drv_sta_remove(local, sdata, &sta->sta);
39 trace_drv_return_int(local, ret);