aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mlme.c')
-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)
1855 } 1855 }
1856} 1856}
1857 1857
1858int ieee80211_sta_commit(struct ieee80211_sub_if_data *sdata)
1859{
1860 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1861
1862 ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET;
1863
1864 if (ifmgd->ssid_len)
1865 ifmgd->flags |= IEEE80211_STA_SSID_SET;
1866 else
1867 ifmgd->flags &= ~IEEE80211_STA_SSID_SET;
1868
1869 return 0;
1870}
1871
1858int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t len) 1872int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t len)
1859{ 1873{
1860 struct ieee80211_if_managed *ifmgd; 1874 struct ieee80211_if_managed *ifmgd;
@@ -1870,14 +1884,7 @@ int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size
1870 ifmgd->ssid_len = len; 1884 ifmgd->ssid_len = len;
1871 } 1885 }
1872 1886
1873 ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET; 1887 return ieee80211_sta_commit(sdata);
1874
1875 if (len)
1876 ifmgd->flags |= IEEE80211_STA_SSID_SET;
1877 else
1878 ifmgd->flags &= ~IEEE80211_STA_SSID_SET;
1879
1880 return 0;
1881} 1888}
1882 1889
1883int ieee80211_sta_get_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t *len) 1890int 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)
1907 } 1914 }
1908 } 1915 }
1909 1916
1910 return ieee80211_sta_set_ssid(sdata, ifmgd->ssid, ifmgd->ssid_len); 1917 return ieee80211_sta_commit(sdata);
1911} 1918}
1912 1919
1913int ieee80211_sta_set_extra_ie(struct ieee80211_sub_if_data *sdata, char *ie, size_t len) 1920int ieee80211_sta_set_extra_ie(struct ieee80211_sub_if_data *sdata, char *ie, size_t len)