aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/Makefile1
-rw-r--r--net/mac80211/driver-ops.c41
-rw-r--r--net/mac80211/driver-ops.h29
3 files changed, 44 insertions, 27 deletions
diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile
index 3275f01881be..783e891b7525 100644
--- a/net/mac80211/Makefile
+++ b/net/mac80211/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_MAC80211) += mac80211.o
3# mac80211 objects 3# mac80211 objects
4mac80211-y := \ 4mac80211-y := \
5 main.o status.o \ 5 main.o status.o \
6 driver-ops.o \
6 sta_info.o \ 7 sta_info.o \
7 wep.o \ 8 wep.o \
8 wpa.o \ 9 wpa.o \
diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c
new file mode 100644
index 000000000000..267c3b1ca047
--- /dev/null
+++ b/net/mac80211/driver-ops.c
@@ -0,0 +1,41 @@
1/*
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.
5 */
6#include <net/mac80211.h>
7#include "ieee80211_i.h"
8#include "trace.h"
9#include "driver-ops.h"
10
11__must_check
12int drv_sta_state(struct ieee80211_local *local,
13 struct ieee80211_sub_if_data *sdata,
14 struct sta_info *sta,
15 enum ieee80211_sta_state old_state,
16 enum ieee80211_sta_state new_state)
17{
18 int ret = 0;
19
20 might_sleep();
21
22 sdata = get_bss_sdata(sdata);
23 if (!check_sdata_in_driver(sdata))
24 return -EIO;
25
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);
33 if (ret == 0)
34 sta->uploaded = true;
35 } else if (old_state == IEEE80211_STA_ASSOC &&
36 new_state == IEEE80211_STA_AUTH) {
37 drv_sta_remove(local, sdata, &sta->sta);
38 }
39 trace_drv_return_int(local, ret);
40 return ret;
41}
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 32a2e707e222..02d91332d7dd 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -573,37 +573,12 @@ static inline void drv_sta_pre_rcu_remove(struct ieee80211_local *local,
573 trace_drv_return_void(local); 573 trace_drv_return_void(local);
574} 574}
575 575
576static inline __must_check 576__must_check
577int drv_sta_state(struct ieee80211_local *local, 577int drv_sta_state(struct ieee80211_local *local,
578 struct ieee80211_sub_if_data *sdata, 578 struct ieee80211_sub_if_data *sdata,
579 struct sta_info *sta, 579 struct sta_info *sta,
580 enum ieee80211_sta_state old_state, 580 enum ieee80211_sta_state old_state,
581 enum ieee80211_sta_state new_state) 581 enum ieee80211_sta_state new_state);
582{
583 int ret = 0;
584
585 might_sleep();
586
587 sdata = get_bss_sdata(sdata);
588 if (!check_sdata_in_driver(sdata))
589 return -EIO;
590
591 trace_drv_sta_state(local, sdata, &sta->sta, old_state, new_state);
592 if (local->ops->sta_state) {
593 ret = local->ops->sta_state(&local->hw, &sdata->vif, &sta->sta,
594 old_state, new_state);
595 } else if (old_state == IEEE80211_STA_AUTH &&
596 new_state == IEEE80211_STA_ASSOC) {
597 ret = drv_sta_add(local, sdata, &sta->sta);
598 if (ret == 0)
599 sta->uploaded = true;
600 } else if (old_state == IEEE80211_STA_ASSOC &&
601 new_state == IEEE80211_STA_AUTH) {
602 drv_sta_remove(local, sdata, &sta->sta);
603 }
604 trace_drv_return_int(local, ret);
605 return ret;
606}
607 582
608static inline void drv_sta_rc_update(struct ieee80211_local *local, 583static inline void drv_sta_rc_update(struct ieee80211_local *local,
609 struct ieee80211_sub_if_data *sdata, 584 struct ieee80211_sub_if_data *sdata,