]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/mac80211/cfg.c
cfg80211/nl80211: add support for scheduled scans
[mirror_ubuntu-bionic-kernel.git] / net / mac80211 / cfg.c
index 12d52cec9515183bf020ffb8a42c3ca4e2e59bbc..c416cce5e1ed9618ab84de30a9043d8800f47be9 100644 (file)
@@ -136,7 +136,10 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
        mutex_lock(&sdata->local->sta_mtx);
 
        if (mac_addr) {
-               sta = sta_info_get_bss(sdata, mac_addr);
+               if (ieee80211_vif_is_mesh(&sdata->vif))
+                       sta = sta_info_get(sdata, mac_addr);
+               else
+                       sta = sta_info_get_bss(sdata, mac_addr);
                if (!sta) {
                        ieee80211_key_free(sdata->local, key);
                        err = -ENOENT;
@@ -734,15 +737,27 @@ static void sta_apply_parameters(struct ieee80211_local *local,
                                                  params->ht_capa,
                                                  &sta->sta.ht_cap);
 
-       if (ieee80211_vif_is_mesh(&sdata->vif) && params->plink_action) {
-               switch (params->plink_action) {
-               case PLINK_ACTION_OPEN:
-                       mesh_plink_open(sta);
-                       break;
-               case PLINK_ACTION_BLOCK:
-                       mesh_plink_block(sta);
-                       break;
-               }
+       if (ieee80211_vif_is_mesh(&sdata->vif)) {
+               if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED)
+                       switch (params->plink_state) {
+                       case PLINK_LISTEN:
+                       case PLINK_ESTAB:
+                       case PLINK_BLOCKED:
+                               sta->plink_state = params->plink_state;
+                               break;
+                       default:
+                               /*  nothing  */
+                               break;
+                       }
+               else
+                       switch (params->plink_action) {
+                       case PLINK_ACTION_OPEN:
+                               mesh_plink_open(sta);
+                               break;
+                       case PLINK_ACTION_BLOCK:
+                               mesh_plink_block(sta);
+                               break;
+                       }
        }
 }
 
@@ -1064,7 +1079,11 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
        memcpy(ifmsh->mesh_id, setup->mesh_id, ifmsh->mesh_id_len);
        ifmsh->mesh_pp_id = setup->path_sel_proto;
        ifmsh->mesh_pm_id = setup->path_metric;
-       ifmsh->is_secure = setup->is_secure;
+       ifmsh->security = IEEE80211_MESH_SEC_NONE;
+       if (setup->is_authenticated)
+               ifmsh->security |= IEEE80211_MESH_SEC_AUTHED;
+       if (setup->is_secure)
+               ifmsh->security |= IEEE80211_MESH_SEC_SECURED;
 
        return 0;
 }
@@ -1297,9 +1316,10 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
 }
 
 #ifdef CONFIG_PM
-static int ieee80211_suspend(struct wiphy *wiphy)
+static int ieee80211_suspend(struct wiphy *wiphy,
+                            struct cfg80211_wowlan *wowlan)
 {
-       return __ieee80211_suspend(wiphy_priv(wiphy));
+       return __ieee80211_suspend(wiphy_priv(wiphy), wowlan);
 }
 
 static int ieee80211_resume(struct wiphy *wiphy)