[INET]: Use MODULE_ALIAS_NET_PF_PROTO_TYPE where possible.
[powerpc.git] / net / mac80211 / key.c
index b10e33d..0b2328f 100644 (file)
@@ -63,6 +63,7 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
 {
        const u8 *addr;
        int ret;
+       DECLARE_MAC_BUF(mac);
 
        if (!key->local->ops->set_key)
                return;
@@ -73,22 +74,21 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
                                       key->sdata->dev->dev_addr, addr,
                                       &key->conf);
 
-       WARN_ON(!ret && (key->conf.hw_key_idx == HW_KEY_IDX_INVALID));
-
        if (!ret)
                key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
 
        if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP)
                printk(KERN_ERR "mac80211-%s: failed to set key "
-                      "(%d, " MAC_FMT ") to hardware (%d)\n",
+                      "(%d, %s) to hardware (%d)\n",
                       wiphy_name(key->local->hw.wiphy),
-                      key->conf.keyidx, MAC_ARG(addr), ret);
+                      key->conf.keyidx, print_mac(mac, addr), ret);
 }
 
 static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
 {
        const u8 *addr;
        int ret;
+       DECLARE_MAC_BUF(mac);
 
        if (!key->local->ops->set_key)
                return;
@@ -104,17 +104,16 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
 
        if (ret)
                printk(KERN_ERR "mac80211-%s: failed to remove key "
-                      "(%d, " MAC_FMT ") from hardware (%d)\n",
+                      "(%d, %s) from hardware (%d)\n",
                       wiphy_name(key->local->hw.wiphy),
-                      key->conf.keyidx, MAC_ARG(addr), ret);
+                      key->conf.keyidx, print_mac(mac, addr), ret);
 
        key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
-       key->conf.hw_key_idx = HW_KEY_IDX_INVALID;
 }
 
 struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata,
                                          struct sta_info *sta,
-                                         ieee80211_key_alg alg,
+                                         enum ieee80211_key_alg alg,
                                          int idx,
                                          size_t key_len,
                                          const u8 *key_data)
@@ -122,7 +121,6 @@ struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata,
        struct ieee80211_key *key;
 
        BUG_ON(idx < 0 || idx >= NUM_DEFAULT_KEYS);
-       BUG_ON(alg == ALG_NONE);
 
        key = kzalloc(sizeof(struct ieee80211_key) + key_len, GFP_KERNEL);
        if (!key)
@@ -132,7 +130,6 @@ struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata,
         * Default to software encryption; we'll later upload the
         * key to the hardware if possible.
         */
-       key->conf.hw_key_idx = HW_KEY_IDX_INVALID;
        key->conf.flags = 0;
        key->flags = 0;