]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Android: Remove old WEXT extensions
authorJouni Malinen <j@w1.fi>
Tue, 24 Dec 2013 20:52:18 +0000 (22:52 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 24 Dec 2013 20:52:18 +0000 (22:52 +0200)
Android has moved to nl80211, so no need to maintain these old WEXT
extensions in wpa_supplicant.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/drivers/driver_wext.c
src/drivers/driver_wext.h

index 6e2e771b9fda2d89689d7abd1dd66fcaa258bec3..68035822fd11f77f60121043fa4cea72d230e910 100644 (file)
 #include "driver.h"
 #include "driver_wext.h"
 
-#ifdef ANDROID
-#include "android_drv.h"
-#endif /* ANDROID */
-
 static int wpa_driver_wext_flush_pmkid(void *priv);
 static int wpa_driver_wext_get_range(void *priv);
 static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv);
@@ -299,14 +295,6 @@ wpa_driver_wext_event_wireless_custom(void *ctx, char *custom)
                }
                wpa_supplicant_event(ctx, EVENT_STKSTART, &data);
 #endif /* CONFIG_PEERKEY */
-#ifdef ANDROID
-       } else if (os_strncmp(custom, "STOP", 4) == 0) {
-               wpa_msg(ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STOPPED");
-       } else if (os_strncmp(custom, "START", 5) == 0) {
-               wpa_msg(ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STARTED");
-       } else if (os_strncmp(custom, "HANG", 4) == 0) {
-               wpa_msg(ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED");
-#endif /* ANDROID */
        }
 }
 
@@ -858,12 +846,6 @@ void * wpa_driver_wext_init(void *ctx, const char *ifname)
 
        drv->mlme_sock = -1;
 
-#ifdef ANDROID
-       drv->errors = 0;
-       drv->driver_is_started = TRUE;
-       drv->bgscan_enabled = 0;
-#endif /* ANDROID */
-
        if (wpa_driver_wext_finish_drv_init(drv) < 0)
                goto err3;
 
@@ -1869,10 +1851,8 @@ static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv)
 {
        struct iwreq iwr;
        const u8 null_bssid[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
-#ifndef ANDROID
        u8 ssid[32];
        int i;
-#endif /* ANDROID */
 
        /*
         * Only force-disconnect when the card is in infrastructure mode,
@@ -1893,7 +1873,6 @@ static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv)
                                   "selection on disconnect");
                }
 
-#ifndef ANDROID
                if (drv->cfg80211) {
                        /*
                         * cfg80211 supports SIOCSIWMLME commands, so there is
@@ -1919,7 +1898,6 @@ static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv)
                        wpa_printf(MSG_DEBUG, "WEXT: Failed to set bogus "
                                   "SSID to disconnect");
                }
-#endif /* ANDROID */
        }
 }
 
@@ -2338,129 +2316,6 @@ static const char * wext_get_radio_name(void *priv)
 }
 
 
-#ifdef ANDROID
-
-static int android_wext_cmd(struct wpa_driver_wext_data *drv, const char *cmd)
-{
-       struct iwreq iwr;
-       char buf[MAX_DRV_CMD_SIZE];
-       int ret;
-
-       os_memset(&iwr, 0, sizeof(iwr));
-       os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
-
-       os_memset(buf, 0, sizeof(buf));
-       os_strlcpy(buf, cmd, sizeof(buf));
-
-       iwr.u.data.pointer = buf;
-       iwr.u.data.length = sizeof(buf);
-
-       ret = ioctl(drv->ioctl_sock, SIOCSIWPRIV, &iwr);
-
-       if (ret < 0) {
-               wpa_printf(MSG_ERROR, "%s failed (%d): %s", __func__, ret,
-                          cmd);
-               drv->errors++;
-               if (drv->errors > DRV_NUMBER_SEQUENTIAL_ERRORS) {
-                       drv->errors = 0;
-                       wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE
-                               "HANGED");
-               }
-               return ret;
-       }
-
-       drv->errors = 0;
-       return 0;
-}
-
-
-static int wext_sched_scan(void *priv, struct wpa_driver_scan_params *params,
-                          u32 interval)
-{
-       struct wpa_driver_wext_data *drv = priv;
-       struct iwreq iwr;
-       int ret = 0, i = 0, bp;
-       char buf[WEXT_PNO_MAX_COMMAND_SIZE];
-
-       bp = WEXT_PNOSETUP_HEADER_SIZE;
-       os_memcpy(buf, WEXT_PNOSETUP_HEADER, bp);
-       buf[bp++] = WEXT_PNO_TLV_PREFIX;
-       buf[bp++] = WEXT_PNO_TLV_VERSION;
-       buf[bp++] = WEXT_PNO_TLV_SUBVERSION;
-       buf[bp++] = WEXT_PNO_TLV_RESERVED;
-
-       while (i < WEXT_PNO_AMOUNT && (size_t) i < params->num_ssids) {
-               /*
-                * Check that there is enough space needed for 1 more SSID, the
-                * other sections and null termination.
-                */
-               if ((bp + WEXT_PNO_SSID_HEADER_SIZE + IW_ESSID_MAX_SIZE +
-                    WEXT_PNO_NONSSID_SECTIONS_SIZE + 1) >= (int) sizeof(buf))
-                       break;
-
-               wpa_hexdump_ascii(MSG_DEBUG, "For PNO Scan",
-                                 params->ssids[i].ssid,
-                                 params->ssids[i].ssid_len);
-               buf[bp++] = WEXT_PNO_SSID_SECTION;
-               buf[bp++] = params->ssids[i].ssid_len;
-               os_memcpy(&buf[bp], params->ssids[i].ssid,
-                         params->ssids[i].ssid_len);
-               bp += params->ssids[i].ssid_len;
-               i++;
-       }
-
-       buf[bp++] = WEXT_PNO_SCAN_INTERVAL_SECTION;
-       /* TODO: consider using interval parameter (interval in msec) instead
-        * of hardcoded value here */
-       os_snprintf(&buf[bp], WEXT_PNO_SCAN_INTERVAL_LENGTH + 1, "%x",
-                   WEXT_PNO_SCAN_INTERVAL);
-       bp += WEXT_PNO_SCAN_INTERVAL_LENGTH;
-
-       buf[bp++] = WEXT_PNO_REPEAT_SECTION;
-       os_snprintf(&buf[bp], WEXT_PNO_REPEAT_LENGTH + 1, "%x",
-                   WEXT_PNO_REPEAT);
-       bp += WEXT_PNO_REPEAT_LENGTH;
-
-       buf[bp++] = WEXT_PNO_MAX_REPEAT_SECTION;
-       os_snprintf(&buf[bp], WEXT_PNO_MAX_REPEAT_LENGTH + 1, "%x",
-                   WEXT_PNO_MAX_REPEAT);
-       bp += WEXT_PNO_MAX_REPEAT_LENGTH + 1;
-
-       os_memset(&iwr, 0, sizeof(iwr));
-       os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
-       iwr.u.data.pointer = buf;
-       iwr.u.data.length = bp;
-
-       ret = ioctl(drv->ioctl_sock, SIOCSIWPRIV, &iwr);
-       if (ret < 0) {
-               wpa_printf(MSG_ERROR, "ioctl[SIOCSIWPRIV] (pnosetup): %d",
-                          ret);
-               drv->errors++;
-               if (drv->errors > DRV_NUMBER_SEQUENTIAL_ERRORS) {
-                       drv->errors = 0;
-                       wpa_msg(drv->ctx, MSG_INFO,
-                               WPA_EVENT_DRIVER_STATE "HANGED");
-               }
-               return ret;
-       }
-
-       drv->errors = 0;
-       drv->bgscan_enabled = 1;
-
-       return android_wext_cmd(drv, "PNOFORCE 1");
-}
-
-
-static int wext_stop_sched_scan(void *priv)
-{
-       struct wpa_driver_wext_data *drv = priv;
-       drv->bgscan_enabled = 0;
-       return android_wext_cmd(drv, "PNOFORCE 0");
-}
-
-#endif /* ANDROID */
-
-
 const struct wpa_driver_ops wpa_driver_wext_ops = {
        .name = "wext",
        .desc = "Linux wireless extensions (generic)",
@@ -2480,8 +2335,4 @@ const struct wpa_driver_ops wpa_driver_wext_ops = {
        .get_capa = wpa_driver_wext_get_capa,
        .set_operstate = wpa_driver_wext_set_operstate,
        .get_radio_name = wext_get_radio_name,
-#ifdef ANDROID
-       .sched_scan = wext_sched_scan,
-       .stop_sched_scan = wext_stop_sched_scan,
-#endif /* ANDROID */
 };
index c4a5bc99c80393b20c11b2b0c9ca18095695e16a..b4b5960a776639a68aa86d9e496486f3896452f8 100644 (file)
@@ -44,12 +44,6 @@ struct wpa_driver_wext_data {
        int cfg80211; /* whether driver is using cfg80211 */
 
        u8 max_level;
-
-#ifdef ANDROID
-       int errors;
-       int driver_is_started;
-       int bgscan_enabled;
-#endif /* ANDROID */
 };
 
 int wpa_driver_wext_get_bssid(void *priv, u8 *bssid);