]> Pileus Git - ~andy/linux/blobdiff - net/mac80211/main.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
[~andy/linux] / net / mac80211 / main.c
index b142bd4c239096f51fbf0e79e9b507a2bf35d1d0..2306d7514fff5bb2c82d609a859a3e826fdd6099 100644 (file)
@@ -155,7 +155,8 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
                power = chan->max_power;
        else
                power = local->power_constr_level ?
-                       (chan->max_power - local->power_constr_level) :
+                       min(chan->max_power,
+                               (chan->max_reg_power  - local->power_constr_level)) :
                        chan->max_power;
 
        if (local->user_power_level >= 0)
@@ -198,15 +199,7 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
                return;
 
        if (sdata->vif.type == NL80211_IFTYPE_STATION) {
-               /*
-                * While not associated, claim a BSSID of all-zeroes
-                * so that drivers don't do any weird things with the
-                * BSSID at that time.
-                */
-               if (sdata->vif.bss_conf.assoc)
-                       sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid;
-               else
-                       sdata->vif.bss_conf.bssid = zero;
+               sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid;
        } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
                sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid;
        else if (sdata->vif.type == NL80211_IFTYPE_AP)
@@ -534,6 +527,9 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
        int priv_size, i;
        struct wiphy *wiphy;
 
+       if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove)))
+               return NULL;
+
        /* Ensure 32-byte alignment of our private data and hw private data.
         * We use the wiphy priv data for both our ieee80211_local and for
         * the driver's private data
@@ -701,6 +697,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
            )
                return -EINVAL;
 
+       if ((hw->flags & IEEE80211_HW_SCAN_WHILE_IDLE) && !local->ops->hw_scan)
+               return -EINVAL;
+
        if (hw->max_report_rates == 0)
                hw->max_report_rates = hw->max_rates;