Revert "ath9k: Group Key fix for VAPs"
[pandora-kernel.git] / drivers / net / wireless / ath / ath9k / main.c
index aad370a..abfa049 100644 (file)
@@ -752,7 +752,6 @@ static int ath_key_config(struct ath_common *common,
        struct ath_hw *ah = common->ah;
        struct ath9k_keyval hk;
        const u8 *mac = NULL;
-       u8 gmac[ETH_ALEN];
        int ret = 0;
        int idx;
 
@@ -776,30 +775,9 @@ static int ath_key_config(struct ath_common *common,
        memcpy(hk.kv_val, key->key, key->keylen);
 
        if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
-
-               if (key->ap_addr) {
-                       /*
-                        * Group keys on hardware that supports multicast frame
-                        * key search use a mac that is the sender's address with
-                        * the high bit set instead of the app-specified address.
-                        */
-                       memcpy(gmac, key->ap_addr, ETH_ALEN);
-                       gmac[0] |= 0x80;
-                       mac = gmac;
-
-                       if (key->alg == ALG_TKIP)
-                               idx = ath_reserve_key_cache_slot_tkip(common);
-                       else
-                               idx = ath_reserve_key_cache_slot(common);
-                       if (idx < 0)
-                               mac = NULL; /* no free key cache entries */
-               }
-
-               if (!mac) {
-                       /* For now, use the default keys for broadcast keys. This may
-                        * need to change with virtual interfaces. */
-                       idx = key->keyidx;
-               }
+               /* For now, use the default keys for broadcast keys. This may
+                * need to change with virtual interfaces. */
+               idx = key->keyidx;
        } else if (key->keyidx) {
                if (WARN_ON(!sta))
                        return -EOPNOTSUPP;
@@ -2044,6 +2022,25 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
        return ret;
 }
 
+static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
+                            struct survey_info *survey)
+{
+       struct ath_wiphy *aphy = hw->priv;
+       struct ath_softc *sc = aphy->sc;
+       struct ath_hw *ah = sc->sc_ah;
+       struct ath_common *common = ath9k_hw_common(ah);
+       struct ieee80211_conf *conf = &hw->conf;
+
+        if (idx != 0)
+               return -ENOENT;
+
+       survey->channel = conf->channel;
+       survey->filled = SURVEY_INFO_NOISE_DBM;
+       survey->noise = common->ani.noise_floor;
+
+       return 0;
+}
+
 static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
 {
        struct ath_wiphy *aphy = hw->priv;
@@ -2115,6 +2112,7 @@ struct ieee80211_ops ath9k_ops = {
        .set_tsf            = ath9k_set_tsf,
        .reset_tsf          = ath9k_reset_tsf,
        .ampdu_action       = ath9k_ampdu_action,
+       .get_survey         = ath9k_get_survey,
        .sw_scan_start      = ath9k_sw_scan_start,
        .sw_scan_complete   = ath9k_sw_scan_complete,
        .rfkill_poll        = ath9k_rfkill_poll_state,