]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Allow driver wrapper to indicate how many stations are supported
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 29 Jul 2010 22:32:33 +0000 (15:32 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 9 Sep 2010 14:17:21 +0000 (07:17 -0700)
This can be used to limit the number of clients allowed to connect
to the group on the GO.

src/drivers/driver.h
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 7f1f526c2e9bf9093600dbadb9a9ca6667b1e62c..1af83f1519a13bb50cc04132f28c2e8424e61167 100644 (file)
@@ -550,6 +550,12 @@ struct wpa_driver_capa {
         * max_remain_on_chan - Maximum remain-on-channel duration in msec
         */
        unsigned int max_remain_on_chan;
+
+       /**
+        * max_stations - Maximum number of associated stations the driver
+        * supports in AP mode
+        */
+       unsigned int max_stations;
 };
 
 
index fa6cfed0012409585d9edfc305f7ed80f753ca12..8b1d5c4bde7c7d7389e24196042199300c2e3998 100644 (file)
@@ -2160,7 +2160,7 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s)
        p2p.concurrent_operations = !!(wpa_s->drv_flags &
                                       WPA_DRIVER_FLAGS_P2P_CONCURRENT);
 
-       p2p.max_peers = 100;
+       p2p.max_peers = wpa_s->max_stations ? wpa_s->max_stations : 100;
 
        if (wpa_s->conf->p2p_ssid_postfix) {
                p2p.ssid_postfix_len =
index bbfa291660667680a3d84c70c93a542a6e6a8dd5..61d1c87e48d82a2e48eef242257f1a62b704f045 100644 (file)
@@ -2101,6 +2101,7 @@ next_driver:
                }
                wpa_s->max_scan_ssids = capa.max_scan_ssids;
                wpa_s->max_remain_on_chan = capa.max_remain_on_chan;
+               wpa_s->max_stations = capa.max_stations;
        }
        if (wpa_s->max_remain_on_chan == 0)
                wpa_s->max_remain_on_chan = 1000;
index ca3a27334b5a99ac0beb6e9e503bebc3f18777e7..df4a24dedbd7596e05e9143bd3238ff7ac1192de 100644 (file)
@@ -408,6 +408,7 @@ struct wpa_supplicant {
        unsigned int drv_flags;
        int max_scan_ssids;
        unsigned int max_remain_on_chan;
+       unsigned int max_stations;
 
        int pending_mic_error_report;
        int pending_mic_error_pairwise;