aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-02-19 13:06:55 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-19 15:52:52 -0500
commit1d669cbf52a01490c14a999daa978e0fa00b494d (patch)
tree111471a31b5ec29ae22704a08430eb58d779df8c /drivers/net/wireless/mac80211_hwsim.c
parent17f6f054fec57b1bd5c8333bc40b1f3b2b7941aa (diff)
mac80211_hwsim: convert to new station add/remove callbacks
This converts mac80211_hwsim to use the new station add/remove callbacks instead of using the old sta_notify callback. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 00ffe6dd435e..6ea77e95277b 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -771,23 +771,41 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
771 } 771 }
772} 772}
773 773
774static int mac80211_hwsim_sta_add(struct ieee80211_hw *hw,
775 struct ieee80211_vif *vif,
776 struct ieee80211_sta *sta)
777{
778 hwsim_check_magic(vif);
779 hwsim_set_sta_magic(sta);
780
781 return 0;
782}
783
784static int mac80211_hwsim_sta_remove(struct ieee80211_hw *hw,
785 struct ieee80211_vif *vif,
786 struct ieee80211_sta *sta)
787{
788 hwsim_check_magic(vif);
789 hwsim_clear_sta_magic(sta);
790
791 return 0;
792}
793
774static void mac80211_hwsim_sta_notify(struct ieee80211_hw *hw, 794static void mac80211_hwsim_sta_notify(struct ieee80211_hw *hw,
775 struct ieee80211_vif *vif, 795 struct ieee80211_vif *vif,
776 enum sta_notify_cmd cmd, 796 enum sta_notify_cmd cmd,
777 struct ieee80211_sta *sta) 797 struct ieee80211_sta *sta)
778{ 798{
779 hwsim_check_magic(vif); 799 hwsim_check_magic(vif);
800
780 switch (cmd) { 801 switch (cmd) {
781 case STA_NOTIFY_ADD:
782 hwsim_set_sta_magic(sta);
783 break;
784 case STA_NOTIFY_REMOVE:
785 hwsim_clear_sta_magic(sta);
786 break;
787 case STA_NOTIFY_SLEEP: 802 case STA_NOTIFY_SLEEP:
788 case STA_NOTIFY_AWAKE: 803 case STA_NOTIFY_AWAKE:
789 /* TODO: make good use of these flags */ 804 /* TODO: make good use of these flags */
790 break; 805 break;
806 default:
807 WARN(1, "Invalid sta notify: %d\n", cmd);
808 break;
791 } 809 }
792} 810}
793 811
@@ -958,6 +976,8 @@ static struct ieee80211_ops mac80211_hwsim_ops =
958 .config = mac80211_hwsim_config, 976 .config = mac80211_hwsim_config,
959 .configure_filter = mac80211_hwsim_configure_filter, 977 .configure_filter = mac80211_hwsim_configure_filter,
960 .bss_info_changed = mac80211_hwsim_bss_info_changed, 978 .bss_info_changed = mac80211_hwsim_bss_info_changed,
979 .sta_add = mac80211_hwsim_sta_add,
980 .sta_remove = mac80211_hwsim_sta_remove,
961 .sta_notify = mac80211_hwsim_sta_notify, 981 .sta_notify = mac80211_hwsim_sta_notify,
962 .set_tim = mac80211_hwsim_set_tim, 982 .set_tim = mac80211_hwsim_set_tim,
963 .conf_tx = mac80211_hwsim_conf_tx, 983 .conf_tx = mac80211_hwsim_conf_tx,