[PATCH 1/2] supplicant: do not change iftype for static AP interface

Avinash Patil avinashapatil
Tue Aug 5 00:19:46 PDT 2014


Some devices have limitations which do not allow changing virtual interface
mode from AP to station or vice versa. To work around this, check if such
AP interface is not dynamic. If such an interface is enumarated,
just set ifmode to AP & avoid setting nlmode to default station mode.

Signed-off-by: Avinash Patil <avinashapatil at gmail.com>
---
 src/drivers/driver_nl80211.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index aa2cd04..0c8717f 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -238,6 +238,7 @@ struct i802_bss {
        int freq;
        int bandwidth;
        int if_dynamic;
+       u8 static_ap;

        void *ctx;
        struct nl_handle *nl_preq, *nl_mgmt;
@@ -4752,6 +4753,9 @@ wpa_driver_nl80211_finish_drv_init(struct
wpa_driver_nl80211_data *drv,
        bss->if_dynamic = bss->if_dynamic || drv->global->if_add_wdevid_set;
        drv->global->if_add_wdevid_set = 0;

+       if (!bss->if_dynamic && nl80211_get_ifmode(bss) == NL80211_IFTYPE_AP)
+               bss->static_ap = 1;
+
        if (wpa_driver_nl80211_capa(drv))
                return -1;

@@ -4767,7 +4771,7 @@ wpa_driver_nl80211_finish_drv_init(struct
wpa_driver_nl80211_data *drv,
        if (first && nl80211_get_ifmode(bss) == NL80211_IFTYPE_AP)
                drv->start_mode_ap = 1;

-       if (drv->hostapd)
+       if (drv->hostapd || (bss->static_ap))
                nlmode = NL80211_IFTYPE_AP;
        else if (bss->if_dynamic)
                nlmode = nl80211_get_ifmode(bss);
-- 
1.8.1.4



More information about the Hostap mailing list