]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
authorDavid S. Miller <davem@davemloft.net>
Sat, 6 Dec 2008 06:09:56 +0000 (22:09 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 6 Dec 2008 06:09:56 +0000 (22:09 -0800)
drivers/net/wireless/ipw2200.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-sta.c
drivers/net/wireless/zd1211rw/zd_mac.c
net/mac80211/sta_info.c

index dcce3542d5a771d9eb24753d8d464854bb4e6639..7a9f901d4ff6dee5cf15ae78d0f9bb763344bdd7 100644 (file)
@@ -3897,6 +3897,7 @@ static int ipw_disassociate(void *data)
        if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)))
                return 0;
        ipw_send_disassociate(data, 0);
+       netif_carrier_off(priv->net_dev);
        return 1;
 }
 
@@ -10190,6 +10191,9 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
        u16 remaining_bytes;
        int fc;
 
+       if (!(priv->status & STATUS_ASSOCIATED))
+               goto drop;
+
        hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
        switch (priv->ieee->iw_mode) {
        case IW_MODE_ADHOC:
index 4c312c55f90cf49838af8954e0e891a0893af99c..01a84585133834a45c603a0c55763b7864441181 100644 (file)
@@ -290,6 +290,9 @@ void iwl_clear_stations_table(struct iwl_priv *priv)
        priv->num_stations = 0;
        memset(priv->stations, 0, sizeof(priv->stations));
 
+       /* clean ucode key table bit map */
+       priv->ucode_key_table = 0;
+
        spin_unlock_irqrestore(&priv->sta_lock, flags);
 }
 EXPORT_SYMBOL(iwl_clear_stations_table);
index 61797f3f8d5c9a475b85d7fb980fe6a16dbb804a..26f7084d3011b7f8f514a4e23090ddfce33ca62c 100644 (file)
@@ -475,7 +475,7 @@ static int iwl_get_free_ucode_key_index(struct iwl_priv *priv)
                if (!test_and_set_bit(i, &priv->ucode_key_table))
                        return i;
 
-       return -1;
+       return WEP_INVALID_OFFSET;
 }
 
 int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty)
@@ -620,6 +620,9 @@ static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv,
        /* else, we are overriding an existing key => no need to allocated room
         * in uCode. */
 
+       WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,
+               "no space for new kew");
+
        priv->stations[sta_id].sta.key.key_flags = key_flags;
        priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
        priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
@@ -637,6 +640,7 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv,
 {
        unsigned long flags;
        __le16 key_flags = 0;
+       int ret;
 
        key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK);
        key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
@@ -664,14 +668,18 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv,
        /* else, we are overriding an existing key => no need to allocated room
         * in uCode. */
 
+       WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,
+               "no space for new kew");
+
        priv->stations[sta_id].sta.key.key_flags = key_flags;
        priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
        priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
 
+       ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
+
        spin_unlock_irqrestore(&priv->sta_lock, flags);
 
-       IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n");
-       return iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
+       return ret;
 }
 
 static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
@@ -696,6 +704,9 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
        /* else, we are overriding an existing key => no need to allocated room
         * in uCode. */
 
+       WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,
+               "no space for new kew");
+
        /* This copy is acutally not needed: we get the key with each TX */
        memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16);
 
@@ -734,6 +745,13 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
                return 0;
        }
 
+       if (priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) {
+               IWL_WARNING("Removing wrong key %d 0x%x\n",
+                           keyconf->keyidx, key_flags);
+               spin_unlock_irqrestore(&priv->sta_lock, flags);
+               return 0;
+       }
+
        if (!test_and_clear_bit(priv->stations[sta_id].sta.key.key_offset,
                &priv->ucode_key_table))
                IWL_ERROR("index %d not used in uCode key table.\n",
index fe1867b25ff7fb522e57927dfa6180f5f0f177bb..cac732f4047f524b3b575a1e86dbee1d7fd68644 100644 (file)
@@ -615,7 +615,7 @@ static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr,
                struct ieee80211_hdr *tx_hdr;
 
                tx_hdr = (struct ieee80211_hdr *)skb->data;
-               if (likely(!compare_ether_addr(tx_hdr->addr2, rx_hdr->addr1)))
+               if (likely(!memcmp(tx_hdr->addr2, rx_hdr->addr1, ETH_ALEN)))
                {
                        __skb_unlink(skb, q);
                        tx_status(hw, skb, IEEE80211_TX_STAT_ACK, stats->signal, 1);
index 7fef8ea1f5ecf53eaf5b1596479ef1d8a834b348..d254446b85b59d76bf3d940fce4364270a2d5bb0 100644 (file)
@@ -99,7 +99,7 @@ struct sta_info *sta_info_get(struct ieee80211_local *local, const u8 *addr)
 
        sta = rcu_dereference(local->sta_hash[STA_HASH(addr)]);
        while (sta) {
-               if (compare_ether_addr(sta->sta.addr, addr) == 0)
+               if (memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
                        break;
                sta = rcu_dereference(sta->hnext);
        }