On Tue, Feb 06, 2018 at 08:10:10PM -0700, Richard Johnson wrote:
> I initially noticed problems after I upgraded from 6.2 stable to the 6.2
> 2018-02-01 and 2018-02-05 snapshots. My trunk0 interface stopped being able
> to use iwn0 on the 5GHz SSID for failover at boot time.
> However, using the 2.4GHz SSID for failover works.
> I can get 5GHz SSID working by first bringing iwn0 up on the 2.4GHz SSID,
> then changing to the 5GHz SSID. One way: edit hostname.iwn0 and `doas sh
> /etc/netstart iwn0`.
> A zzz then sticks iwn0 in a non-responsive state.
> If I then `ifconfig iwn0 down delete`, and switch back to the 2.4GHz SSID
> (edit hostname.iwn0, redo netstart), I again get a working iwn0 on the
> 2.4GHz net.
> From there, I can switch back to the 5GHz SSID as above, until reboot or zzz
> requires a repeat.

There is a known behaviour of the firmware where, on a 5 GHz channel,
it will not transmit a probe request unless it first sees some other
valid packet on the channel. This has to do with how the firmware deals
with regulatory domains, which restrict 5Ghz channels in some parts of
the world. I don't really understand exactly how it works, and how we
can control it. But there are some parameters which go into the scan
command which you could try tweaking to see if they have any effect,
and let us know your results.

If you want to try playing with these parameters to the firmware,
(i.e. change them, recompile kernel, and test) you can find them
in if_iwnreg.h:

/*
 * For active scan, listen ACTIVE_DWELL_TIME (msec) on each channel after
 * sending probe req.  This should be set long enough to hear probe responses
 * from more than one AP.
 */
#define IWN_ACTIVE_DWELL_TIME_2GHZ      (30)    /* all times in msec */
#define IWN_ACTIVE_DWELL_TIME_5GHZ      (20)
#define IWN_ACTIVE_DWELL_FACTOR_2GHZ    (3)
#define IWN_ACTIVE_DWELL_FACTOR_5GHZ    (2)

/*
 * For passive scan, listen PASSIVE_DWELL_TIME (msec) on each channel.
 * Must be set longer than active dwell time.
 * For the most reliable scan, set > AP beacon interval (typically 100msec).
 */
#define IWN_PASSIVE_DWELL_TIME_2GHZ     (20)    /* all times in msec */
#define IWN_PASSIVE_DWELL_TIME_5GHZ     (10)
#define IWN_PASSIVE_DWELL_BASE          (100)
#define IWN_CHANNEL_TUNE_TIME           (5)

The firmware command is built in at iwn_scan() in if_iwn.c, so see
there for more details.

An 'active scan' happens if you have an SSID configured with 'ifconfig iwn0
nwid foo', and 'passive scan' happens if no SSID is configured.

My theory is that because of the firmware's behaviour described above,
sometimes 5Ghz APs do not show up in the list, as you can see in debug
output I'm quoting below.

> iwn0: end active scan
>  - 02:6b:9e:84:48:20   11  +181 54M   ess  privacy   rsn  "DIRECT-JC-VIZIOTV"!
>  - 04:bf:6d:c1:24:8f   11  +182 54M   ess  privacy   rsn  "OwlAmigas"!
>  - 06:0e:83:a3:6f:9f    1  +185 54M   ess       no!  rsn! "xfinitywifi"!
>  - 06:0e:83:a3:6f:a0  149  +171 54M   ess       no!  rsn! "xfinitywifi"!
>  - 10:13:31:28:85:92    1  +181 54M   ess  privacy   rsn  "CenturyLink3108"!
>  - 2c:30:33:7b:29:13    6  +178 54M   ess  privacy   rsn  "Wonka"!
>  - 38:63:bb:74:a1:d3   11  +180 54M   ess  privacy   rsn
> "HP-Print-D3-Officejet Pro 8610"!
>  - 58:8b:f3:d6:97:63   11  +186 54M   ess  privacy   rsn  "Owlhaus"!
>  - 58:8b:f3:e2:cb:b9   11  +183 54M   ess  privacy   rsn  "CenturyLink7111"!
>  + c4:ea:1d:96:d6:7b    1  +227 54M   ess  privacy   rsn  "Rope"
>  - c4:ea:1d:96:d6:80   48  +223 54M   ess  privacy   rsn  ""!
>  - c4:ea:1d:96:d6:81   48  +223 54M   ess  privacy   rsn  "Rope-5G"!

Here it was found (but it didn't match our configured SSID) ^

>  - e4:18:6b:e6:94:8b    3  +185 54M   ess  privacy   rsn  "CenturyLink2479"!
>  - f4:0e:83:a3:6f:9f    1  +185 54M   ess  privacy   rsn  "CurlySam"!

> iwn0: end active scan
>  - 06:0e:83:a3:6f:9f    1  +187 54M   ess       no!  rsn! "xfinitywifi"!
>  - 10:13:31:28:85:92    1  +180 54M   ess  privacy   rsn  "CenturyLink3108"!
>  - 16:0e:83:a3:6f:a0  149  +171 54M   ess  privacy   rsn  ""!
>  - 2c:30:33:7b:29:13    6  +179 54M   ess  privacy   rsn  "Wonka"!
>  - 38:63:bb:74:a1:d3   11  +183 54M   ess  privacy   rsn
> "HP-Print-D3-Officejet Pro 8610"!
>  - 58:8b:f3:d6:97:63   11  +182 54M   ess  privacy   rsn  "Owlhaus"!
>  - 58:8b:f3:e2:cb:b9   11  +183 54M   ess  privacy   rsn  "CenturyLink7111"!
>  - 5c:8f:e0:6a:10:ac    1  +187 54M   ess  privacy   rsn  "RedHouse"!
>  - 6e:8f:e0:6a:10:ac    1  +196 54M   ess       no!  rsn! "xfinitywifi"!
>  - 9e:8f:e0:6a:10:b1   36  +191 54M   ess  privacy   rsn! ""!
>  + c4:ea:1d:96:d6:7b    1  +227 54M   ess  privacy   rsn  "Rope"
>  - e0:b9:e5:87:3a:30    8  +181 54M   ess  privacy   rsn  "CenturyLink3451"!

This time it was not found, even though other 5GHz APs are in the list.
So the firmware didn't pass your AP's beacon/probe response to the driver,
probably because it never received it.

Reply via email to