Allow driver wrappers to indicate maximum remain-on-channel duration
authorJouni Malinen <jouni.malinen@atheros.com>
Sun, 11 Apr 2010 16:42:37 +0000 (19:42 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 11 Apr 2010 16:42:37 +0000 (19:42 +0300)
src/drivers/driver.h
src/drivers/driver_nl80211.c
src/drivers/driver_test.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 8e7dc96..0afc9fc 100644 (file)
@@ -505,6 +505,11 @@ struct wpa_driver_capa {
        unsigned int flags;
 
        int max_scan_ssids;
+
+       /**
+        * max_remain_on_chan - Maximum remain-on-channel duration in msec
+        */
+       unsigned int max_remain_on_chan;
 };
 
 
index a06fa84..4f574cf 100644 (file)
@@ -1157,6 +1157,7 @@ static int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv)
        }
 
        drv->capa.flags |= WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE;
+       drv->capa.max_remain_on_chan = 5000;
 
        return 0;
 }
index 338bc76..fb24673 100644 (file)
@@ -2386,6 +2386,7 @@ static int wpa_driver_test_get_capa(void *priv, struct wpa_driver_capa *capa)
                capa->flags |= WPA_DRIVER_FLAGS_USER_SPACE_MLME;
        capa->flags |= WPA_DRIVER_FLAGS_AP;
        capa->max_scan_ssids = 2;
+       capa->max_remain_on_chan = 60000;
 
        return 0;
 }
index 15ca6db..2ad0309 100644 (file)
@@ -2015,6 +2015,18 @@ next_driver:
                return -1;
        }
 
+       if (wpa_drv_get_capa(wpa_s, &capa) == 0) {
+               wpa_s->drv_flags = capa.flags;
+               if (capa.flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME) {
+                       if (ieee80211_sta_init(wpa_s))
+                               return -1;
+               }
+               wpa_s->max_scan_ssids = capa.max_scan_ssids;
+               wpa_s->max_remain_on_chan = capa.max_remain_on_chan;
+       }
+       if (wpa_s->max_remain_on_chan == 0)
+               wpa_s->max_remain_on_chan = 1000;
+
        if (wpa_supplicant_driver_init(wpa_s) < 0)
                return -1;
 
@@ -2047,15 +2059,6 @@ next_driver:
                return -1;
        }
 
-       if (wpa_drv_get_capa(wpa_s, &capa) == 0) {
-               wpa_s->drv_flags = capa.flags;
-               if (capa.flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME) {
-                       if (ieee80211_sta_init(wpa_s))
-                               return -1;
-               }
-               wpa_s->max_scan_ssids = capa.max_scan_ssids;
-       }
-
 #ifdef CONFIG_IBSS_RSN
        wpa_s->ibss_rsn = ibss_rsn_init(wpa_s);
        if (!wpa_s->ibss_rsn) {
index 84d642c..2ac8826 100644 (file)
@@ -384,6 +384,7 @@ struct wpa_supplicant {
        struct wpa_client_mlme mlme;
        unsigned int drv_flags;
        int max_scan_ssids;
+       unsigned int max_remain_on_chan;
 
        int pending_mic_error_report;
        int pending_mic_error_pairwise;