ath5k: claim support for IBSS RSN
authorAntonio Quartulli <ordex@autistici.org>
Sat, 14 Jan 2012 10:42:43 +0000 (11:42 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 24 Jan 2012 19:21:13 +0000 (14:21 -0500)
Disable group keys programming when using IBSS RSN. Keys will be managed using
software. In this way IBSS RSN can correctly work.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath5k/mac80211-ops.c

index d366dadcf86e6a47c6a48261bd2a480a803d5cac..4ab835f08a430ff6b7132176c9b6a69e2e5d054c 100644 (file)
@@ -2442,6 +2442,9 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
                BIT(NL80211_IFTYPE_ADHOC) |
                BIT(NL80211_IFTYPE_MESH_POINT);
 
+       /* SW support for IBSS_RSN is provided by mac80211 */
+       hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
+
        /* both antennas can be configured as RX or TX */
        hw->wiphy->available_antennas_tx = 0x3;
        hw->wiphy->available_antennas_rx = 0x3;
index 6ed4c0717e3e31bbe85ad871ada0c0b0fb11f62e..af4c7ecb4b303a6595413339de28473677ac135a 100644 (file)
@@ -483,6 +483,14 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        if (ath5k_modparam_nohwcrypt)
                return -EOPNOTSUPP;
 
+       if (vif->type == NL80211_IFTYPE_ADHOC &&
+           (key->cipher == WLAN_CIPHER_SUITE_TKIP ||
+            key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
+           !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
+               /* don't program group keys when using IBSS_RSN */
+               return -EOPNOTSUPP;
+       }
+
        switch (key->cipher) {
        case WLAN_CIPHER_SUITE_WEP40:
        case WLAN_CIPHER_SUITE_WEP104: