diff mbox series

Connect without scanning using PBSS

Message ID 090bccae-e466-cee2-df2c-346ee84733e3@bluwireless.com
State RFC
Headers show
Series Connect without scanning using PBSS | expand

Commit Message

Chris Bainbridge July 27, 2022, 6:54 p.m. UTC
Hi,

I am working with an 802.11ad system, which uses PBSS. I am trying to 
use wpa_supplicant to connect without scanning - for this, I'm using 
ap_scan=2 as per the configuration below:

ctrl_interface=/var/run/wpa_supplicant
ap_scan=2

network={
        ssid="myNetwork"
        key_mgmt=NONE
        pbss=1
        frequency=62640
        bssid=01:02:03:04:05:06
}

However, wpa_supplicant will not connect because it is not passing the 
BSSID or frequency down to the driver.

 From looking at hostap/wpa_supplicant/wpa_supplicant.c, I can see two 
options:
a) Setting IBSS (I believe this is the wrong approach) as per the line:

if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set &&
             wpa_s->conf->ap_scan == 2)

b) Somehow setting the bss parameter (cwork->bss) in 
wpas_start_assoc_cb. However from my understanding this is set when 
wpa_supplicant scans (which I am trying to avoid, as I just want to 
connect directly).

Is there any way round this without modifying wpa_supplicant? I have 
done the following, which works (possibly could be combined with the 
previous if statement..)

         if ((ssid->mode == WPAS_MODE_IBSS || ssid->mode == 
WPAS_MODE_MESH) &&
             ssid->frequency > 0 && params.freq.freq == 0)

Many thanks,
Chris
diff mbox series

Patch

diff --git a/wpa_supplicant/wpa_supplicant.c 
b/wpa_supplicant/wpa_supplicant.c
index d37a994f9..73f780145 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3787,6 +3787,12 @@  static void wpas_start_assoc_cb(struct 
wpa_radio_work *work, int deinit)
                 params.fixed_bssid = 1;
         }

+       if (ssid->pbss == 1 && ssid->bssid_set && wpa_s->conf->ap_scan 
== 2) {
+               params.bssid = ssid->bssid;
+               params.fixed_bssid = 1;
+               params.freq.freq = ssid->frequency;
+       }
+
         /* Initial frequency for IBSS/mesh */