]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/wireless/nl80211.c
cfg80211: fix dfs channels remain DFS_AVAILABLE after ch_switch
[linux.git] / net / wireless / nl80211.c
index fc83dd179c1a8b64b622a0646840fe70a06c3b2f..08a66c1bcb838c442e82ba2db0caeddddd73eb97 100644 (file)
@@ -2172,6 +2172,30 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
                            rdev->wiphy.vht_capa_mod_mask))
                        goto nla_put_failure;
 
+               if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN,
+                           rdev->wiphy.perm_addr))
+                       goto nla_put_failure;
+
+               if (!is_zero_ether_addr(rdev->wiphy.addr_mask) &&
+                   nla_put(msg, NL80211_ATTR_MAC_MASK, ETH_ALEN,
+                           rdev->wiphy.addr_mask))
+                       goto nla_put_failure;
+
+               if (rdev->wiphy.n_addresses > 1) {
+                       void *attr;
+
+                       attr = nla_nest_start(msg, NL80211_ATTR_MAC_ADDRS);
+                       if (!attr)
+                               goto nla_put_failure;
+
+                       for (i = 0; i < rdev->wiphy.n_addresses; i++)
+                               if (nla_put(msg, i + 1, ETH_ALEN,
+                                           rdev->wiphy.addresses[i].addr))
+                                       goto nla_put_failure;
+
+                       nla_nest_end(msg, attr);
+               }
+
                state->split_start++;
                break;
        case 10:
@@ -16092,7 +16116,9 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
 
        if (wdev->iftype == NL80211_IFTYPE_STATION &&
            !WARN_ON(!wdev->current_bss))
-               wdev->current_bss->pub.channel = chandef->chan;
+               cfg80211_update_assoc_bss_entry(wdev, chandef->chan);
+
+       cfg80211_sched_dfs_chan_update(rdev);
 
        nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL,
                                 NL80211_CMD_CH_SWITCH_NOTIFY, 0);