]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/libertas/scan.c
wext: Emit event stream entries correctly when compat.
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / libertas / scan.c
index 0598541451d87ae1c2a3647e2505e968a97a5d4a..343ed38f772d6a30d4f38526d381c34f7b6eae22 100644 (file)
@@ -4,22 +4,13 @@
   * IOCTL handlers as well as command preperation and response routines
   *  for sending scan commands to the firmware.
   */
-#include <linux/ctype.h>
-#include <linux/if.h>
-#include <linux/netdevice.h>
-#include <linux/wireless.h>
 #include <linux/etherdevice.h>
-
-#include <net/ieee80211.h>
-#include <net/iw_handler.h>
-
 #include <asm/unaligned.h>
 
 #include "host.h"
 #include "decl.h"
 #include "dev.h"
 #include "scan.h"
-#include "join.h"
 #include "cmd.h"
 
 //! Approximate amount of data needed to pass a scan result back to iwlist
@@ -110,69 +101,6 @@ int lbs_ssid_cmp(uint8_t *ssid1, uint8_t ssid1_len, uint8_t *ssid2,
        return memcmp(ssid1, ssid2, ssid1_len);
 }
 
-static inline int match_bss_no_security(struct lbs_802_11_security *secinfo,
-                                       struct bss_descriptor *match_bss)
-{
-       if (!secinfo->wep_enabled  && !secinfo->WPAenabled
-           && !secinfo->WPA2enabled
-           && match_bss->wpa_ie[0] != MFIE_TYPE_GENERIC
-           && match_bss->rsn_ie[0] != MFIE_TYPE_RSN
-           && !(match_bss->capability & WLAN_CAPABILITY_PRIVACY))
-               return 1;
-       else
-               return 0;
-}
-
-static inline int match_bss_static_wep(struct lbs_802_11_security *secinfo,
-                                      struct bss_descriptor *match_bss)
-{
-       if (secinfo->wep_enabled && !secinfo->WPAenabled
-           && !secinfo->WPA2enabled
-           && (match_bss->capability & WLAN_CAPABILITY_PRIVACY))
-               return 1;
-       else
-               return 0;
-}
-
-static inline int match_bss_wpa(struct lbs_802_11_security *secinfo,
-                               struct bss_descriptor *match_bss)
-{
-       if (!secinfo->wep_enabled && secinfo->WPAenabled
-           && (match_bss->wpa_ie[0] == MFIE_TYPE_GENERIC)
-           /* privacy bit may NOT be set in some APs like LinkSys WRT54G
-           && (match_bss->capability & WLAN_CAPABILITY_PRIVACY) */
-          )
-               return 1;
-       else
-               return 0;
-}
-
-static inline int match_bss_wpa2(struct lbs_802_11_security *secinfo,
-                                struct bss_descriptor *match_bss)
-{
-       if (!secinfo->wep_enabled && secinfo->WPA2enabled
-           && (match_bss->rsn_ie[0] == MFIE_TYPE_RSN)
-           /* privacy bit may NOT be set in some APs like LinkSys WRT54G
-            && (match_bss->capability & WLAN_CAPABILITY_PRIVACY) */
-          )
-               return 1;
-       else
-               return 0;
-}
-
-static inline int match_bss_dynamic_wep(struct lbs_802_11_security *secinfo,
-                                       struct bss_descriptor *match_bss)
-{
-       if (!secinfo->wep_enabled && !secinfo->WPAenabled
-           && !secinfo->WPA2enabled
-           && (match_bss->wpa_ie[0] != MFIE_TYPE_GENERIC)
-           && (match_bss->rsn_ie[0] != MFIE_TYPE_RSN)
-           && (match_bss->capability & WLAN_CAPABILITY_PRIVACY))
-               return 1;
-       else
-               return 0;
-}
-
 static inline int is_same_network(struct bss_descriptor *src,
                                  struct bss_descriptor *dst)
 {
@@ -185,78 +113,6 @@ static inline int is_same_network(struct bss_descriptor *src,
                !memcmp(src->ssid, dst->ssid, src->ssid_len));
 }
 
-/**
- *  @brief Check if a scanned network compatible with the driver settings
- *
- *   WEP     WPA     WPA2    ad-hoc  encrypt                      Network
- * enabled enabled  enabled   AES     mode   privacy  WPA  WPA2  Compatible
- *    0       0        0       0      NONE      0      0    0   yes No security
- *    1       0        0       0      NONE      1      0    0   yes Static WEP
- *    0       1        0       0       x        1x     1    x   yes WPA
- *    0       0        1       0       x        1x     x    1   yes WPA2
- *    0       0        0       1      NONE      1      0    0   yes Ad-hoc AES
- *    0       0        0       0     !=NONE     1      0    0   yes Dynamic WEP
- *
- *
- *  @param priv A pointer to struct lbs_private
- *  @param index   Index in scantable to check against current driver settings
- *  @param mode    Network mode: Infrastructure or IBSS
- *
- *  @return        Index in scantable, or error code if negative
- */
-static int is_network_compatible(struct lbs_private *priv,
-                                struct bss_descriptor *bss, uint8_t mode)
-{
-       int matched = 0;
-
-       lbs_deb_enter(LBS_DEB_SCAN);
-
-       if (bss->mode != mode)
-               goto done;
-
-       if ((matched = match_bss_no_security(&priv->secinfo, bss))) {
-               goto done;
-       } else if ((matched = match_bss_static_wep(&priv->secinfo, bss))) {
-               goto done;
-       } else if ((matched = match_bss_wpa(&priv->secinfo, bss))) {
-               lbs_deb_scan("is_network_compatible() WPA: wpa_ie 0x%x "
-                            "wpa2_ie 0x%x WEP %s WPA %s WPA2 %s "
-                            "privacy 0x%x\n", bss->wpa_ie[0], bss->rsn_ie[0],
-                            priv->secinfo.wep_enabled ? "e" : "d",
-                            priv->secinfo.WPAenabled ? "e" : "d",
-                            priv->secinfo.WPA2enabled ? "e" : "d",
-                            (bss->capability & WLAN_CAPABILITY_PRIVACY));
-               goto done;
-       } else if ((matched = match_bss_wpa2(&priv->secinfo, bss))) {
-               lbs_deb_scan("is_network_compatible() WPA2: wpa_ie 0x%x "
-                            "wpa2_ie 0x%x WEP %s WPA %s WPA2 %s "
-                            "privacy 0x%x\n", bss->wpa_ie[0], bss->rsn_ie[0],
-                            priv->secinfo.wep_enabled ? "e" : "d",
-                            priv->secinfo.WPAenabled ? "e" : "d",
-                            priv->secinfo.WPA2enabled ? "e" : "d",
-                            (bss->capability & WLAN_CAPABILITY_PRIVACY));
-               goto done;
-       } else if ((matched = match_bss_dynamic_wep(&priv->secinfo, bss))) {
-               lbs_deb_scan("is_network_compatible() dynamic WEP: "
-                            "wpa_ie 0x%x wpa2_ie 0x%x privacy 0x%x\n",
-                            bss->wpa_ie[0], bss->rsn_ie[0],
-                            (bss->capability & WLAN_CAPABILITY_PRIVACY));
-               goto done;
-       }
-
-       /* bss security settings don't match those configured on card */
-       lbs_deb_scan("is_network_compatible() FAILED: wpa_ie 0x%x "
-                    "wpa2_ie 0x%x WEP %s WPA %s WPA2 %s privacy 0x%x\n",
-                    bss->wpa_ie[0], bss->rsn_ie[0],
-                    priv->secinfo.wep_enabled ? "e" : "d",
-                    priv->secinfo.WPAenabled ? "e" : "d",
-                    priv->secinfo.WPA2enabled ? "e" : "d",
-                    (bss->capability & WLAN_CAPABILITY_PRIVACY));
-
-done:
-       lbs_deb_leave_args(LBS_DEB_SCAN, "matched: %d", matched);
-       return matched;
-}
 
 
 
@@ -341,7 +197,6 @@ static int lbs_scan_create_channel_list(struct lbs_private *priv,
        return chanidx;
 }
 
-
 /*
  * Add SSID TLV of the form:
  *
@@ -359,7 +214,6 @@ static int lbs_scan_add_ssid_tlv(struct lbs_private *priv, u8 *tlv)
        return sizeof(ssid_tlv->header) + priv->scan_ssid_len;
 }
 
-
 /*
  * Add CHANLIST TLV of the form
  *
@@ -398,7 +252,6 @@ static int lbs_scan_add_chanlist_tlv(uint8_t *tlv,
        return sizeof(chan_tlv->header) + size;
 }
 
-
 /*
  * Add RATES TLV of the form
  *
@@ -433,7 +286,6 @@ static int lbs_scan_add_rates_tlv(uint8_t *tlv)
        return sizeof(rate_tlv->header) + i;
 }
 
-
 /*
  * Generate the CMD_802_11_SCAN command with the proper tlv
  * for a bunch of channels.
@@ -446,7 +298,8 @@ static int lbs_do_scan(struct lbs_private *priv, uint8_t bsstype,
        uint8_t *tlv;   /* pointer into our current, growing TLV storage area */
 
        lbs_deb_enter_args(LBS_DEB_SCAN, "bsstype %d, chanlist[].chan %d, chan_count %d",
-                          bsstype, chan_list[0].channumber, chan_count);
+               bsstype, chan_list ? chan_list[0].channumber : -1,
+               chan_count);
 
        /* create the fixed part for scan command */
        scan_cmd = kzalloc(MAX_SCAN_CFG_ALLOC, GFP_KERNEL);
@@ -482,12 +335,9 @@ out:
        return ret;
 }
 
-
 /**
  *  @brief Internal function used to start a scan based on an input config
  *
- *  Also used from debugfs
- *
  *  Use the input user scan configuration information when provided in
  *    order to send the appropriate scan commands to firmware to populate or
  *    update the internal driver scan table
@@ -497,7 +347,7 @@ out:
  *
  *  @return              0 or < 0 if error
  */
-static int lbs_scan_networks(struct lbs_private *priv, int full_scan)
+int lbs_scan_networks(struct lbs_private *priv, int full_scan)
 {
        int ret = -ENOMEM;
        struct chanscanparamset *chan_list;
@@ -602,7 +452,7 @@ static int lbs_scan_networks(struct lbs_private *priv, int full_scan)
        lbs_deb_scan("scan table:\n");
        list_for_each_entry(iter, &priv->network_list, list)
                lbs_deb_scan("%02d: BSSID %s, RSSI %d, SSID '%s'\n",
-                            i++, print_mac(mac, iter->bssid), (int)iter->rssi,
+                            i++, print_mac(mac, iter->bssid), iter->rssi,
                             escape_essid(iter->ssid, iter->ssid_len));
        mutex_unlock(&priv->lock);
 #endif
@@ -627,9 +477,6 @@ out:
        return ret;
 }
 
-
-
-
 void lbs_scan_worker(struct work_struct *work)
 {
        struct lbs_private *priv =
@@ -676,7 +523,7 @@ static int lbs_process_bss(struct bss_descriptor *bss,
 
        if (*bytesleft >= sizeof(beaconsize)) {
                /* Extract & convert beacon size from the command buffer */
-               beaconsize = le16_to_cpu(get_unaligned((__le16 *)*pbeaconinfo));
+               beaconsize = get_unaligned_le16(*pbeaconinfo);
                *bytesleft -= sizeof(beaconsize);
                *pbeaconinfo += sizeof(beaconsize);
        }
@@ -880,214 +727,6 @@ done:
        return ret;
 }
 
-/**
- *  @brief This function finds a specific compatible BSSID in the scan list
- *
- *  Used in association code
- *
- *  @param priv  A pointer to struct lbs_private
- *  @param bssid    BSSID to find in the scan list
- *  @param mode     Network mode: Infrastructure or IBSS
- *
- *  @return         index in BSSID list, or error return code (< 0)
- */
-struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv,
-                                             uint8_t *bssid, uint8_t mode)
-{
-       struct bss_descriptor *iter_bss;
-       struct bss_descriptor *found_bss = NULL;
-
-       lbs_deb_enter(LBS_DEB_SCAN);
-
-       if (!bssid)
-               goto out;
-
-       lbs_deb_hex(LBS_DEB_SCAN, "looking for", bssid, ETH_ALEN);
-
-       /* Look through the scan table for a compatible match.  The loop will
-        *   continue past a matched bssid that is not compatible in case there
-        *   is an AP with multiple SSIDs assigned to the same BSSID
-        */
-       mutex_lock(&priv->lock);
-       list_for_each_entry (iter_bss, &priv->network_list, list) {
-               if (compare_ether_addr(iter_bss->bssid, bssid))
-                       continue; /* bssid doesn't match */
-               switch (mode) {
-               case IW_MODE_INFRA:
-               case IW_MODE_ADHOC:
-                       if (!is_network_compatible(priv, iter_bss, mode))
-                               break;
-                       found_bss = iter_bss;
-                       break;
-               default:
-                       found_bss = iter_bss;
-                       break;
-               }
-       }
-       mutex_unlock(&priv->lock);
-
-out:
-       lbs_deb_leave_args(LBS_DEB_SCAN, "found_bss %p", found_bss);
-       return found_bss;
-}
-
-/**
- *  @brief This function finds ssid in ssid list.
- *
- *  Used in association code
- *
- *  @param priv  A pointer to struct lbs_private
- *  @param ssid     SSID to find in the list
- *  @param bssid    BSSID to qualify the SSID selection (if provided)
- *  @param mode     Network mode: Infrastructure or IBSS
- *
- *  @return         index in BSSID list
- */
-struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
-                                            uint8_t *ssid, uint8_t ssid_len,
-                                            uint8_t *bssid, uint8_t mode,
-                                            int channel)
-{
-       uint8_t bestrssi = 0;
-       struct bss_descriptor * iter_bss = NULL;
-       struct bss_descriptor * found_bss = NULL;
-       struct bss_descriptor * tmp_oldest = NULL;
-
-       lbs_deb_enter(LBS_DEB_SCAN);
-
-       mutex_lock(&priv->lock);
-
-       list_for_each_entry (iter_bss, &priv->network_list, list) {
-               if (   !tmp_oldest
-                   || (iter_bss->last_scanned < tmp_oldest->last_scanned))
-                       tmp_oldest = iter_bss;
-
-               if (lbs_ssid_cmp(iter_bss->ssid, iter_bss->ssid_len,
-                                ssid, ssid_len) != 0)
-                       continue; /* ssid doesn't match */
-               if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0)
-                       continue; /* bssid doesn't match */
-               if ((channel > 0) && (iter_bss->channel != channel))
-                       continue; /* channel doesn't match */
-
-               switch (mode) {
-               case IW_MODE_INFRA:
-               case IW_MODE_ADHOC:
-                       if (!is_network_compatible(priv, iter_bss, mode))
-                               break;
-
-                       if (bssid) {
-                               /* Found requested BSSID */
-                               found_bss = iter_bss;
-                               goto out;
-                       }
-
-                       if (SCAN_RSSI(iter_bss->rssi) > bestrssi) {
-                               bestrssi = SCAN_RSSI(iter_bss->rssi);
-                               found_bss = iter_bss;
-                       }
-                       break;
-               case IW_MODE_AUTO:
-               default:
-                       if (SCAN_RSSI(iter_bss->rssi) > bestrssi) {
-                               bestrssi = SCAN_RSSI(iter_bss->rssi);
-                               found_bss = iter_bss;
-                       }
-                       break;
-               }
-       }
-
-out:
-       mutex_unlock(&priv->lock);
-       lbs_deb_leave_args(LBS_DEB_SCAN, "found_bss %p", found_bss);
-       return found_bss;
-}
-
-/**
- *  @brief This function finds the best SSID in the Scan List
- *
- *  Search the scan table for the best SSID that also matches the current
- *   adapter network preference (infrastructure or adhoc)
- *
- *  @param priv  A pointer to struct lbs_private
- *
- *  @return         index in BSSID list
- */
-static struct bss_descriptor *lbs_find_best_ssid_in_list(struct lbs_private *priv,
-                                                        uint8_t mode)
-{
-       uint8_t bestrssi = 0;
-       struct bss_descriptor *iter_bss;
-       struct bss_descriptor *best_bss = NULL;
-
-       lbs_deb_enter(LBS_DEB_SCAN);
-
-       mutex_lock(&priv->lock);
-
-       list_for_each_entry (iter_bss, &priv->network_list, list) {
-               switch (mode) {
-               case IW_MODE_INFRA:
-               case IW_MODE_ADHOC:
-                       if (!is_network_compatible(priv, iter_bss, mode))
-                               break;
-                       if (SCAN_RSSI(iter_bss->rssi) <= bestrssi)
-                               break;
-                       bestrssi = SCAN_RSSI(iter_bss->rssi);
-                       best_bss = iter_bss;
-                       break;
-               case IW_MODE_AUTO:
-               default:
-                       if (SCAN_RSSI(iter_bss->rssi) <= bestrssi)
-                               break;
-                       bestrssi = SCAN_RSSI(iter_bss->rssi);
-                       best_bss = iter_bss;
-                       break;
-               }
-       }
-
-       mutex_unlock(&priv->lock);
-       lbs_deb_leave_args(LBS_DEB_SCAN, "best_bss %p", best_bss);
-       return best_bss;
-}
-
-/**
- *  @brief Find the best AP
- *
- *  Used from association worker.
- *
- *  @param priv         A pointer to struct lbs_private structure
- *  @param pSSID        A pointer to AP's ssid
- *
- *  @return             0--success, otherwise--fail
- */
-int lbs_find_best_network_ssid(struct lbs_private *priv, uint8_t *out_ssid,
-                              uint8_t *out_ssid_len, uint8_t preferred_mode,
-                              uint8_t *out_mode)
-{
-       int ret = -1;
-       struct bss_descriptor *found;
-
-       lbs_deb_enter(LBS_DEB_SCAN);
-
-       priv->scan_ssid_len = 0;
-       lbs_scan_networks(priv, 1);
-       if (priv->surpriseremoved)
-               goto out;
-
-       found = lbs_find_best_ssid_in_list(priv, preferred_mode);
-       if (found && (found->ssid_len > 0)) {
-               memcpy(out_ssid, &found->ssid, IW_ESSID_MAX_SIZE);
-               *out_ssid_len = found->ssid_len;
-               *out_mode = found->mode;
-               ret = 0;
-       }
-
-out:
-       lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret);
-       return ret;
-}
-
-
 /**
  *  @brief Send a scan command for all available channels filtered on a spec
  *
@@ -1137,8 +776,9 @@ out:
 #define MAX_CUSTOM_LEN 64
 
 static inline char *lbs_translate_scan(struct lbs_private *priv,
-                                      char *start, char *stop,
-                                      struct bss_descriptor *bss)
+                                           struct iw_request_info *info,
+                                           char *start, char *stop,
+                                           struct bss_descriptor *bss)
 {
        struct chan_freq_power *cfp;
        char *current_val;      /* For rates */
@@ -1162,24 +802,24 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,
        iwe.cmd = SIOCGIWAP;
        iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
        memcpy(iwe.u.ap_addr.sa_data, &bss->bssid, ETH_ALEN);
-       start = iwe_stream_add_event(start, stop, &iwe, IW_EV_ADDR_LEN);
+       start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_ADDR_LEN);
 
        /* SSID */
        iwe.cmd = SIOCGIWESSID;
        iwe.u.data.flags = 1;
        iwe.u.data.length = min((uint32_t) bss->ssid_len, (uint32_t) IW_ESSID_MAX_SIZE);
-       start = iwe_stream_add_point(start, stop, &iwe, bss->ssid);
+       start = iwe_stream_add_point(info, start, stop, &iwe, bss->ssid);
 
        /* Mode */
        iwe.cmd = SIOCGIWMODE;
        iwe.u.mode = bss->mode;
-       start = iwe_stream_add_event(start, stop, &iwe, IW_EV_UINT_LEN);
+       start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_UINT_LEN);
 
        /* Frequency */
        iwe.cmd = SIOCGIWFREQ;
        iwe.u.freq.m = (long)cfp->freq * 100000;
        iwe.u.freq.e = 1;
-       start = iwe_stream_add_event(start, stop, &iwe, IW_EV_FREQ_LEN);
+       start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_FREQ_LEN);
 
        /* Add quality statistics */
        iwe.cmd = IWEVQUAL;
@@ -1213,7 +853,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,
                nf = priv->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE;
                iwe.u.qual.level = CAL_RSSI(snr, nf);
        }
-       start = iwe_stream_add_event(start, stop, &iwe, IW_EV_QUAL_LEN);
+       start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_QUAL_LEN);
 
        /* Add encryption capability */
        iwe.cmd = SIOCGIWENCODE;
@@ -1223,9 +863,9 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,
                iwe.u.data.flags = IW_ENCODE_DISABLED;
        }
        iwe.u.data.length = 0;
-       start = iwe_stream_add_point(start, stop, &iwe, bss->ssid);
+       start = iwe_stream_add_point(info, start, stop, &iwe, bss->ssid);
 
-       current_val = start + IW_EV_LCP_LEN;
+       current_val = start + iwe_stream_lcp_len(info);
 
        iwe.cmd = SIOCGIWRATE;
        iwe.u.bitrate.fixed = 0;
@@ -1235,19 +875,19 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,
        for (j = 0; bss->rates[j] && (j < sizeof(bss->rates)); j++) {
                /* Bit rate given in 500 kb/s units */
                iwe.u.bitrate.value = bss->rates[j] * 500000;
-               current_val = iwe_stream_add_value(start, current_val,
-                                        stop, &iwe, IW_EV_PARAM_LEN);
+               current_val = iwe_stream_add_value(info, start, current_val,
+                                                  stop, &iwe, IW_EV_PARAM_LEN);
        }
        if ((bss->mode == IW_MODE_ADHOC) && priv->adhoccreate
            && !lbs_ssid_cmp(priv->curbssparams.ssid,
                             priv->curbssparams.ssid_len,
                             bss->ssid, bss->ssid_len)) {
                iwe.u.bitrate.value = 22 * 500000;
-               current_val = iwe_stream_add_value(start, current_val,
+               current_val = iwe_stream_add_value(info, start, current_val,
                                                   stop, &iwe, IW_EV_PARAM_LEN);
        }
        /* Check if we added any event */
-       if((current_val - start) > IW_EV_LCP_LEN)
+       if ((current_val - start) > iwe_stream_lcp_len(info))
                start = current_val;
 
        memset(&iwe, 0, sizeof(iwe));
@@ -1256,7 +896,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,
                memcpy(buf, bss->wpa_ie, bss->wpa_ie_len);
                iwe.cmd = IWEVGENIE;
                iwe.u.data.length = bss->wpa_ie_len;
-               start = iwe_stream_add_point(start, stop, &iwe, buf);
+               start = iwe_stream_add_point(info, start, stop, &iwe, buf);
        }
 
        memset(&iwe, 0, sizeof(iwe));
@@ -1265,7 +905,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,
                memcpy(buf, bss->rsn_ie, bss->rsn_ie_len);
                iwe.cmd = IWEVGENIE;
                iwe.u.data.length = bss->rsn_ie_len;
-               start = iwe_stream_add_point(start, stop, &iwe, buf);
+               start = iwe_stream_add_point(info, start, stop, &iwe, buf);
        }
 
        if (bss->mesh) {
@@ -1276,7 +916,8 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,
                p += snprintf(p, MAX_CUSTOM_LEN, "mesh-type: olpc");
                iwe.u.data.length = p - custom;
                if (iwe.u.data.length)
-                       start = iwe_stream_add_point(start, stop, &iwe, custom);
+                       start = iwe_stream_add_point(info, start, stop,
+                                                    &iwe, custom);
        }
 
 out:
@@ -1397,7 +1038,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
                }
 
                /* Translate to WE format this entry */
-               next_ev = lbs_translate_scan(priv, ev, stop, iter_bss);
+               next_ev = lbs_translate_scan(priv, info, ev, stop, iter_bss);
                if (next_ev == NULL)
                        continue;
                ev = next_ev;