util.c (82d048186e403f36e083b37ad42aa90abb7dcaac) util.c (5bb644a0fd25a5e083ecbfaa92a211db99aa6ef7)
1/*
2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2005-2006, Devicescape Software, Inc.
4 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
5 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 1020 unchanged lines hidden (view full) ---

1029int ieee80211_reconfig(struct ieee80211_local *local)
1030{
1031 struct ieee80211_hw *hw = &local->hw;
1032 struct ieee80211_sub_if_data *sdata;
1033 struct ieee80211_if_init_conf conf;
1034 struct sta_info *sta;
1035 unsigned long flags;
1036 int res;
1/*
2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2005-2006, Devicescape Software, Inc.
4 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
5 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 1020 unchanged lines hidden (view full) ---

1029int ieee80211_reconfig(struct ieee80211_local *local)
1030{
1031 struct ieee80211_hw *hw = &local->hw;
1032 struct ieee80211_sub_if_data *sdata;
1033 struct ieee80211_if_init_conf conf;
1034 struct sta_info *sta;
1035 unsigned long flags;
1036 int res;
1037 bool from_suspend = local->suspended;
1037
1038
1039 /*
1040 * We're going to start the hardware, at that point
1041 * we are no longer suspended and can RX frames.
1042 */
1043 local->suspended = false;
1044
1038 /* restart hardware */
1039 if (local->open_count) {
1040 res = drv_start(local);
1041
1042 ieee80211_led_radio(local, hw->conf.radio_enabled);
1043 }
1044
1045 /* add interfaces */

--- 7 unchanged lines hidden (view full) ---

1053 res = drv_add_interface(local, &conf);
1054 }
1055 }
1056
1057 /* add STAs back */
1058 if (local->ops->sta_notify) {
1059 spin_lock_irqsave(&local->sta_lock, flags);
1060 list_for_each_entry(sta, &local->sta_list, list) {
1045 /* restart hardware */
1046 if (local->open_count) {
1047 res = drv_start(local);
1048
1049 ieee80211_led_radio(local, hw->conf.radio_enabled);
1050 }
1051
1052 /* add interfaces */

--- 7 unchanged lines hidden (view full) ---

1060 res = drv_add_interface(local, &conf);
1061 }
1062 }
1063
1064 /* add STAs back */
1065 if (local->ops->sta_notify) {
1066 spin_lock_irqsave(&local->sta_lock, flags);
1067 list_for_each_entry(sta, &local->sta_list, list) {
1068 sdata = sta->sdata;
1061 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
1062 sdata = container_of(sdata->bss,
1063 struct ieee80211_sub_if_data,
1064 u.ap);
1065
1066 drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD,
1067 &sta->sta);
1068 }

--- 54 unchanged lines hidden (view full) ---

1123 /* add back keys */
1124 list_for_each_entry(sdata, &local->interfaces, list)
1125 if (netif_running(sdata->dev))
1126 ieee80211_enable_keys(sdata);
1127
1128 ieee80211_wake_queues_by_reason(hw,
1129 IEEE80211_QUEUE_STOP_REASON_SUSPEND);
1130
1069 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
1070 sdata = container_of(sdata->bss,
1071 struct ieee80211_sub_if_data,
1072 u.ap);
1073
1074 drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD,
1075 &sta->sta);
1076 }

--- 54 unchanged lines hidden (view full) ---

1131 /* add back keys */
1132 list_for_each_entry(sdata, &local->interfaces, list)
1133 if (netif_running(sdata->dev))
1134 ieee80211_enable_keys(sdata);
1135
1136 ieee80211_wake_queues_by_reason(hw,
1137 IEEE80211_QUEUE_STOP_REASON_SUSPEND);
1138
1139 /*
1140 * If this is for hw restart things are still running.
1141 * We may want to change that later, however.
1142 */
1143 if (!from_suspend)
1144 return 0;
1145
1146#ifdef CONFIG_PM
1147 local->suspended = false;
1148
1149 list_for_each_entry(sdata, &local->interfaces, list) {
1150 switch(sdata->vif.type) {
1151 case NL80211_IFTYPE_STATION:
1152 ieee80211_sta_restart(sdata);
1153 break;
1154 case NL80211_IFTYPE_ADHOC:
1155 ieee80211_ibss_restart(sdata);
1156 break;
1157 case NL80211_IFTYPE_MESH_POINT:
1158 ieee80211_mesh_restart(sdata);
1159 break;
1160 default:
1161 break;
1162 }
1163 }
1164
1165 add_timer(&local->sta_cleanup);
1166
1167 spin_lock_irqsave(&local->sta_lock, flags);
1168 list_for_each_entry(sta, &local->sta_list, list)
1169 mesh_plink_restart(sta);
1170 spin_unlock_irqrestore(&local->sta_lock, flags);
1171#else
1172 WARN_ON(1);
1173#endif
1131 return 0;
1132}
1174 return 0;
1175}