]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/ipw2200.c
[IEEE80211] ipw2200: Simplify multicast checks.
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / ipw2200.c
index f49b0125375ba762b9c91c7aa120ba6599d59000..64f6d1f257535637ea240e23e32aabeec1d13940 100644 (file)
@@ -31,8 +31,9 @@
 ******************************************************************************/
 
 #include "ipw2200.h"
+#include <linux/version.h>
 
-#define IPW2200_VERSION "1.0.7"
+#define IPW2200_VERSION "git-1.0.8"
 #define DRV_DESCRIPTION        "Intel(R) PRO/Wireless 2200/2915 Network Driver"
 #define DRV_COPYRIGHT  "Copyright(c) 2003-2005 Intel Corporation"
 #define DRV_VERSION     IPW2200_VERSION
@@ -1109,8 +1110,7 @@ static struct ipw_fw_error *ipw_alloc_error_log(struct ipw_priv *priv)
        error->elem_len = elem_len;
        error->log_len = log_len;
        error->elem = (struct ipw_error_elem *)error->payload;
-       error->log = (struct ipw_event *)(error->elem +
-                                         (sizeof(*error->elem) * elem_len));
+       error->log = (struct ipw_event *)(error->elem + elem_len);
 
        ipw_capture_event_log(priv, log_len, error->log);
 
@@ -2834,7 +2834,7 @@ struct fw_chunk {
 };
 
 #define IPW_FW_MAJOR_VERSION 2
-#define IPW_FW_MINOR_VERSION 3
+#define IPW_FW_MINOR_VERSION 4
 
 #define IPW_FW_MINOR(x) ((x & 0xff) >> 8)
 #define IPW_FW_MAJOR(x) (x & 0xff)
@@ -7456,8 +7456,7 @@ static void ipw_handle_data_packet(struct ipw_priv *priv,
        /* HW decrypt will not clear the WEP bit, MIC, PN, etc. */
        hdr = (struct ieee80211_hdr_4addr *)rxb->skb->data;
        if (priv->ieee->iw_mode != IW_MODE_MONITOR &&
-           ((is_multicast_ether_addr(hdr->addr1) ||
-             is_broadcast_ether_addr(hdr->addr1)) ?
+           (is_multicast_ether_addr(hdr->addr1) ?
             !priv->ieee->host_mc_decrypt : !priv->ieee->host_decrypt))
                ipw_rebuild_decrypted_skb(priv, rxb->skb);
 
@@ -7648,8 +7647,7 @@ static inline int is_network_packet(struct ipw_priv *priv,
                        return 0;
 
                /* {broad,multi}cast packets to our BSSID go through */
-               if (is_multicast_ether_addr(header->addr1) ||
-                   is_broadcast_ether_addr(header->addr1))
+               if (is_multicast_ether_addr(header->addr1))
                        return !memcmp(header->addr3, priv->bssid, ETH_ALEN);
 
                /* packets to our adapter go through */
@@ -7662,8 +7660,7 @@ static inline int is_network_packet(struct ipw_priv *priv,
                        return 0;
 
                /* {broad,multi}cast packets to our BSS go through */
-               if (is_multicast_ether_addr(header->addr1) ||
-                   is_broadcast_ether_addr(header->addr1))
+               if (is_multicast_ether_addr(header->addr1))
                        return !memcmp(header->addr2, priv->bssid, ETH_ALEN);
 
                /* packets to our adapter go through */
@@ -8925,6 +8922,10 @@ static int ipw_request_direct_scan(struct ipw_priv *priv, char *essid,
        struct ipw_scan_request_ext scan;
        int err = 0, scan_type;
 
+       if (!(priv->status & STATUS_INIT) ||
+           (priv->status & STATUS_EXIT_PENDING))
+               return 0;
+
        down(&priv->sem);
 
        if (priv->status & STATUS_RF_KILL_MASK) {
@@ -9653,8 +9654,7 @@ static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
        switch (priv->ieee->iw_mode) {
        case IW_MODE_ADHOC:
                hdr_len = IEEE80211_3ADDR_LEN;
-               unicast = !(is_multicast_ether_addr(hdr->addr1) ||
-                           is_broadcast_ether_addr(hdr->addr1));
+               unicast = !is_multicast_ether_addr(hdr->addr1);
                id = ipw_find_station(priv, hdr->addr1);
                if (id == IPW_INVALID_STATION) {
                        id = ipw_add_station(priv, hdr->addr1);
@@ -9669,8 +9669,7 @@ static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
 
        case IW_MODE_INFRA:
        default:
-               unicast = !(is_multicast_ether_addr(hdr->addr3) ||
-                           is_broadcast_ether_addr(hdr->addr3));
+               unicast = !is_multicast_ether_addr(hdr->addr3);
                hdr_len = IEEE80211_3ADDR_LEN;
                id = 0;
                break;