mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chan
[deliverable/linux.git] / drivers / net / wireless / p54 / main.c
index 2969d5321ca6b08a67ecf5cbea6c92f300c3ef97..067e6f2fd050fcad0ddc4eb00565ba3324397894 100644 (file)
@@ -340,7 +340,7 @@ static int p54_config(struct ieee80211_hw *dev, u32 changed)
                 * TODO: Use the LM_SCAN_TRAP to determine the current
                 * operating channel.
                 */
-               priv->curchan = priv->hw->conf.channel;
+               priv->curchan = priv->hw->conf.chandef.chan;
                p54_reset_stats(priv);
                WARN_ON(p54_fetch_statistics(priv));
        }
@@ -480,7 +480,7 @@ static void p54_bss_info_changed(struct ieee80211_hw *dev,
                p54_set_edcf(priv);
        }
        if (changed & BSS_CHANGED_BASIC_RATES) {
-               if (dev->conf.channel->band == IEEE80211_BAND_5GHZ)
+               if (dev->conf.chandef.chan->band == IEEE80211_BAND_5GHZ)
                        priv->basic_rate_mask = (info->basic_rates << 4);
                else
                        priv->basic_rate_mask = info->basic_rates;
@@ -515,6 +515,17 @@ static int p54_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd,
        if (modparam_nohwcrypt)
                return -EOPNOTSUPP;
 
+       if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) {
+               /*
+                * Unfortunately most/all firmwares are trying to decrypt
+                * incoming management frames if a suitable key can be found.
+                * However, in doing so the data in these frames gets
+                * corrupted. So, we can't have firmware supported crypto
+                * offload in this case.
+                */
+               return -EOPNOTSUPP;
+       }
+
        mutex_lock(&priv->conf_mutex);
        if (cmd == SET_KEY) {
                switch (key->cipher) {
@@ -659,7 +670,7 @@ static unsigned int p54_flush_count(struct p54_common *priv)
        return total;
 }
 
-static void p54_flush(struct ieee80211_hw *dev, bool drop)
+static void p54_flush(struct ieee80211_hw *dev, u32 queues, bool drop)
 {
        struct p54_common *priv = dev->priv;
        unsigned int total, i;
@@ -738,6 +749,7 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len)
                     IEEE80211_HW_SIGNAL_DBM |
                     IEEE80211_HW_SUPPORTS_PS |
                     IEEE80211_HW_PS_NULLFUNC_STACK |
+                    IEEE80211_HW_MFP_CAPABLE |
                     IEEE80211_HW_REPORTS_TX_ACK_STATUS;
 
        dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
This page took 0.024636 seconds and 5 git commands to generate.