summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorAlina Friedrichsen <x-alina@gmx.net>2009-02-21 01:27:29 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 20:52:54 +0100
commit79f6440c527c61bcd84edfbdeb390841b9fe5095 (patch)
tree90d86bb64fade58b3acdc8b5954b9e9148c963bd /net/mac80211/mlme.c
parentb43: Convert usage of b43_radio_maskset() (diff)
downloadlinux-79f6440c527c61bcd84edfbdeb390841b9fe5095.tar.xz
linux-79f6440c527c61bcd84edfbdeb390841b9fe5095.zip
mac80211: Introduce a generic commit() to apply changes
This patch introduces a generic commit() function which initiate a new network joining process. It should be called after some interface config changes, so that the changes get applied more cleanly. Currently set_ssid() and set_bssid() call it. Others can be added in future patches. In version 1 the header files was forgotten, sorry. Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to '')
-rw-r--r--net/mac80211/mlme.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 5a4977936f6f..7f238589b6ff 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1855,6 +1855,20 @@ void ieee80211_sta_req_auth(struct ieee80211_sub_if_data *sdata)
}
}
+int ieee80211_sta_commit(struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
+
+ ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET;
+
+ if (ifmgd->ssid_len)
+ ifmgd->flags |= IEEE80211_STA_SSID_SET;
+ else
+ ifmgd->flags &= ~IEEE80211_STA_SSID_SET;
+
+ return 0;
+}
+
int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t len)
{
struct ieee80211_if_managed *ifmgd;
@@ -1870,14 +1884,7 @@ int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size
ifmgd->ssid_len = len;
}
- ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET;
-
- if (len)
- ifmgd->flags |= IEEE80211_STA_SSID_SET;
- else
- ifmgd->flags &= ~IEEE80211_STA_SSID_SET;
-
- return 0;
+ return ieee80211_sta_commit(sdata);
}
int ieee80211_sta_get_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t *len)
@@ -1907,7 +1914,7 @@ int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid)
}
}
- return ieee80211_sta_set_ssid(sdata, ifmgd->ssid, ifmgd->ssid_len);
+ return ieee80211_sta_commit(sdata);
}
int ieee80211_sta_set_extra_ie(struct ieee80211_sub_if_data *sdata, char *ie, size_t len)