On Tue, Aug 16, 2016 at 11:31:07AM +0100, Stuart Henderson wrote:
> On 2016/08/15 14:46, Stefan Sperling wrote:
> > The wireless stack usually runs its scanning loop once per frequency band.
> > It begins with 5GHz so that APs on this band are preferred. Within a band,
> > an AP with the best RSSI (receive signal strength indicator) is chosen,
> > after matching all other desired parameters such as the ESSID etc.
> 
> I find that iwn(4) almost always prefers 2GHz - before I did the csa
> tests it was sitting on chan 6 AP (-45dBm), there's another one visible
> on chan 104 (-53dBm).

This should fix it, in combination with my other patch.

iwn(4) should be setting the same scan capability flags as iwm(4)
because iwn(4) scans both bands before giving control back to the
stack by calling ieee80211_end_scan().

With iwm(4) bands are iterated in HW instead of the driver, but the
stack does not care about this difference so the flag applies to both.

Index: if_iwn.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
retrieving revision 1.169
diff -u -p -r1.169 if_iwn.c
--- if_iwn.c    20 Jul 2016 16:24:37 -0000      1.169
+++ if_iwn.c    16 Aug 2016 13:36:46 -0000
@@ -450,6 +450,8 @@ iwn_attach(struct device *parent, struct
        ic->ic_caps =
            IEEE80211_C_WEP |           /* WEP */
            IEEE80211_C_RSN |           /* WPA/RSN */
+           IEEE80211_C_SCANALL |       /* device scans all channels at once */
+           IEEE80211_C_SCANALLBAND |   /* driver scans all bands at once */
            IEEE80211_C_MONITOR |       /* monitor mode supported */
            IEEE80211_C_SHSLOT |        /* short slot time supported */
            IEEE80211_C_SHPREAMBLE |    /* short preamble supported */


Same applies to wpi(4) (untested).

Index: if_wpi.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_wpi.c,v
retrieving revision 1.133
diff -u -p -r1.133 if_wpi.c
--- if_wpi.c    13 Apr 2016 10:34:32 -0000      1.133
+++ if_wpi.c    16 Aug 2016 13:41:27 -0000
@@ -278,6 +278,8 @@ wpi_attach(struct device *parent, struct
        ic->ic_caps =
            IEEE80211_C_WEP |           /* WEP */
            IEEE80211_C_RSN |           /* WPA/RSN */
+           IEEE80211_C_SCANALL |       /* device scans all channels at once */
+           IEEE80211_C_SCANALLBAND |   /* driver scans all bands at once */
            IEEE80211_C_MONITOR |       /* monitor mode supported */
            IEEE80211_C_SHSLOT |        /* short slot time supported */
            IEEE80211_C_SHPREAMBLE |    /* short preamble supported */

Reply via email to