wireless: remove NETWORK_EMPTY_ESSID flag
[safe/jmp/linux-2.6] / net / ieee80211 / ieee80211_rx.c
index 200ee1e..f15f82e 100644 (file)
@@ -32,6 +32,7 @@
 #include <asm/uaccess.h>
 #include <linux/ctype.h>
 
+#include <net/lib80211.h>
 #include <net/ieee80211.h>
 
 static void ieee80211_monitor_rx(struct ieee80211_device *ieee,
@@ -282,12 +283,8 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
        res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
        atomic_dec(&crypt->refcnt);
        if (res < 0) {
-               IEEE80211_DEBUG_DROP("decryption failed (SA=" MAC_FMT
-                                    ") res=%d\n",
-                                    hdr->addr2[0], hdr->addr2[1],
-                                    hdr->addr2[2], hdr->addr2[3],
-                                    hdr->addr2[4], hdr->addr2[5],
-                                    res);
+               IEEE80211_DEBUG_DROP("decryption failed (SA=%pM) res=%d\n",
+                                    hdr->addr2, res);
                if (res == -2)
                        IEEE80211_DEBUG_DROP("Decryption failed ICV "
                                             "mismatch (key %d)\n",
@@ -319,11 +316,7 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee,
        atomic_dec(&crypt->refcnt);
        if (res < 0) {
                printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed"
-                      " (SA=" MAC_FMT " keyidx=%d)\n",
-                      ieee->dev->name,
-                      hdr->addr2[0], hdr->addr2[1],
-                      hdr->addr2[2], hdr->addr2[3],
-                      hdr->addr2[4], hdr->addr2[5],
+                      " (SA=%pM keyidx=%d)\n", ieee->dev->name, hdr->addr2,
                       keyidx);
                return -1;
        }
@@ -358,7 +351,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
        struct ieee80211_crypt_data *crypt = NULL;
        int keyidx = 0;
        int can_be_decrypted = 0;
-       DECLARE_MAC_BUF(mac);
 
        hdr = (struct ieee80211_hdr_4addr *)skb->data;
        stats = &ieee->stats;
@@ -391,7 +383,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
                wstats.updated = 0;
                if (rx_stats->mask & IEEE80211_STATMASK_RSSI) {
-                       wstats.level = rx_stats->rssi;
+                       wstats.level = rx_stats->signal;
                        wstats.updated |= IW_QUAL_LEVEL_UPDATED;
                } else
                        wstats.updated |= IW_QUAL_LEVEL_INVALID;
@@ -468,10 +460,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                         * frames silently instead of filling system log with
                         * these reports. */
                        IEEE80211_DEBUG_DROP("Decryption failed (not set)"
-                                            " (SA=" MAC_FMT ")\n",
-                                            hdr->addr2[0], hdr->addr2[1],
-                                            hdr->addr2[2], hdr->addr2[3],
-                                            hdr->addr2[4], hdr->addr2[5]);
+                                            " (SA=%pM)\n", hdr->addr2);
                        ieee->ieee_stats.rx_discards_undecryptable++;
                        goto rx_dropped;
                }
@@ -482,10 +471,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                    fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt &&
                    (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) {
                        printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
-                              "from " MAC_FMT "\n", dev->name,
-                              hdr->addr2[0], hdr->addr2[1],
-                              hdr->addr2[2], hdr->addr2[3],
-                              hdr->addr2[4], hdr->addr2[5]);
+                              "from %pM\n", dev->name, hdr->addr2);
                        /* TODO: could inform hostapd about this so that it
                         * could send auth failure report */
                        goto rx_dropped;
@@ -663,11 +649,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                         * configured */
                } else {
                        IEEE80211_DEBUG_DROP("encryption configured, but RX "
-                                            "frame not encrypted (SA="
-                                            MAC_FMT ")\n",
-                                            hdr->addr2[0], hdr->addr2[1],
-                                            hdr->addr2[2], hdr->addr2[3],
-                                            hdr->addr2[4], hdr->addr2[5]);
+                                            "frame not encrypted (SA=%pM)\n",
+                                            hdr->addr2);
                        goto rx_dropped;
                }
        }
@@ -675,11 +658,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
        if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep &&
            !ieee80211_is_eapol_frame(ieee, skb)) {
                IEEE80211_DEBUG_DROP("dropped unencrypted RX data "
-                                    "frame from " MAC_FMT
-                                    " (drop_unencrypted=1)\n",
-                                    hdr->addr2[0], hdr->addr2[1],
-                                    hdr->addr2[2], hdr->addr2[3],
-                                    hdr->addr2[4], hdr->addr2[5]);
+                                    "frame from %pM (drop_unencrypted=1)\n",
+                                    hdr->addr2);
                goto rx_dropped;
        }
 
@@ -1166,12 +1146,6 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
 
                switch (info_element->id) {
                case MFIE_TYPE_SSID:
-                       if (ieee80211_is_empty_essid(info_element->data,
-                                                    info_element->len)) {
-                               network->flags |= NETWORK_EMPTY_ESSID;
-                               break;
-                       }
-
                        network->ssid_len = min(info_element->len,
                                                (u8) IW_ESSID_MAX_SIZE);
                        memcpy(network->ssid, info_element->data,
@@ -1181,7 +1155,8 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
                                       IW_ESSID_MAX_SIZE - network->ssid_len);
 
                        IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n",
-                                            network->ssid, network->ssid_len);
+                                            escape_ssid(network->ssid),
+                                            network->ssid_len);
                        break;
 
                case MFIE_TYPE_RATES:
@@ -1411,9 +1386,6 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee
                        network->mode |= IEEE_B;
        }
 
-       if (ieee80211_is_empty_essid(network->ssid, network->ssid_len))
-               network->flags |= NETWORK_EMPTY_ESSID;
-
        memcpy(&network->stats, stats, sizeof(network->stats));
 
        if (ieee->handle_assoc_response != NULL)
@@ -1429,8 +1401,6 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
                                         struct ieee80211_network *network,
                                         struct ieee80211_rx_stats *stats)
 {
-       DECLARE_MAC_BUF(mac);
-
        network->qos_data.active = 0;
        network->qos_data.supported = 0;
        network->qos_data.param_count = 0;
@@ -1477,17 +1447,14 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
        }
 
        if (network->mode == 0) {
-               IEEE80211_DEBUG_SCAN("Filtered out '%s (%s)' "
+               IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' "
                                     "network.\n",
-                                    escape_essid(network->ssid,
-                                                 network->ssid_len),
-                                    print_mac(mac, network->bssid));
+                                    escape_ssid(network->ssid,
+                                                network->ssid_len),
+                                    network->bssid);
                return 1;
        }
 
-       if (ieee80211_is_empty_essid(network->ssid, network->ssid_len))
-               network->flags |= NETWORK_EMPTY_ESSID;
-
        memcpy(&network->stats, stats, sizeof(network->stats));
 
        return 0;
@@ -1510,7 +1477,6 @@ static void update_network(struct ieee80211_network *dst,
 {
        int qos_active;
        u8 old_param;
-       DECLARE_MAC_BUF(mac);
 
        ieee80211_network_reset(dst);
        dst->ibss_dfs = src->ibss_dfs;
@@ -1524,8 +1490,8 @@ static void update_network(struct ieee80211_network *dst,
                memcpy(&dst->stats, &src->stats,
                       sizeof(struct ieee80211_rx_stats));
        else
-               IEEE80211_DEBUG_SCAN("Network %s info received "
-                       "off channel (%d vs. %d)\n", print_mac(mac, src->bssid),
+               IEEE80211_DEBUG_SCAN("Network %pM info received "
+                       "off channel (%d vs. %d)\n", src->bssid,
                        dst->channel, src->stats.received_channel);
 
        dst->capability = src->capability;
@@ -1597,12 +1563,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device
        struct ieee80211_info_element *info_element = beacon->info_element;
 #endif
        unsigned long flags;
-       DECLARE_MAC_BUF(mac);
 
-       IEEE80211_DEBUG_SCAN("'%s' (%s"
+       IEEE80211_DEBUG_SCAN("'%s' (%pM"
                     "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
-                    escape_essid(info_element->data, info_element->len),
-                    print_mac(mac, beacon->header.addr3),
+                    escape_ssid(info_element->data, info_element->len),
+                    beacon->header.addr3,
                     (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0',
                     (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0',
                     (beacon->capability & cpu_to_le16(1 << 0xd)) ? '1' : '0',
@@ -1621,10 +1586,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device
                     (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0');
 
        if (ieee80211_network_init(ieee, beacon, &network, stats)) {
-               IEEE80211_DEBUG_SCAN("Dropped '%s' (%s) via %s.\n",
-                                    escape_essid(info_element->data,
-                                                 info_element->len),
-                                    print_mac(mac, beacon->header.addr3),
+               IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n",
+                                    escape_ssid(info_element->data,
+                                                info_element->len),
+                                    beacon->header.addr3,
                                     is_beacon(beacon->header.frame_ctl) ?
                                     "BEACON" : "PROBE RESPONSE");
                return;
@@ -1658,11 +1623,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device
                        /* If there are no more slots, expire the oldest */
                        list_del(&oldest->list);
                        target = oldest;
-                       IEEE80211_DEBUG_SCAN("Expired '%s' (%s) from "
+                       IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from "
                                             "network list.\n",
-                                            escape_essid(target->ssid,
-                                                         target->ssid_len),
-                                            print_mac(mac, target->bssid));
+                                            escape_ssid(target->ssid,
+                                                        target->ssid_len),
+                                            target->bssid);
                        ieee80211_network_reset(target);
                } else {
                        /* Otherwise just pull from the free list */
@@ -1672,10 +1637,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device
                }
 
 #ifdef CONFIG_IEEE80211_DEBUG
-               IEEE80211_DEBUG_SCAN("Adding '%s' (%s) via %s.\n",
-                                    escape_essid(network.ssid,
-                                                 network.ssid_len),
-                                    print_mac(mac, network.bssid),
+               IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n",
+                                    escape_ssid(network.ssid,
+                                                network.ssid_len),
+                                    network.bssid,
                                     is_beacon(beacon->header.frame_ctl) ?
                                     "BEACON" : "PROBE RESPONSE");
 #endif
@@ -1683,10 +1648,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device
                network.ibss_dfs = NULL;
                list_add_tail(&target->list, &ieee->network_list);
        } else {
-               IEEE80211_DEBUG_SCAN("Updating '%s' (%s) via %s.\n",
-                                    escape_essid(target->ssid,
-                                                 target->ssid_len),
-                                    print_mac(mac, target->bssid),
+               IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n",
+                                    escape_ssid(target->ssid,
+                                                target->ssid_len),
+                                    target->bssid,
                                     is_beacon(beacon->header.frame_ctl) ?
                                     "BEACON" : "PROBE RESPONSE");
                update_network(target, &network);