This diff allows the root user to trigger a background scan with:

        ifconfig iwm0 scan

It supports two use cases which are currently not supported:

1) It will force an attempt at finding a better AP, even if the
current AP is above the signal level threshold which will usually
trigger a background scan.

2) It will update the list of cached APs. The updated list will be
shown by subsequent invocations of 'ifconfig scan'. This allows the
root user to view an up-to-date list of available networks without
disassociating from the current AP. Currently, the list is updated only
if a background scan is triggered via the signal strength threshold.

Suggested by sthen@

ok?

diff 1bc5f745876be1d7923afca9b40fb6641254e697 /usr/src (staged changes)
blob - b7b2ea6d631958b607ffdee06d272cd56320bf2e
blob + d4c2a0ba6b1893af9652837998c759a6c0857048
--- sys/net80211/ieee80211_ioctl.c
+++ sys/net80211/ieee80211_ioctl.c
@@ -906,6 +906,8 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t
                        na->na_nodes++;
                        ni = RBT_NEXT(ieee80211_tree, ni);
                }
+               if (suser(curproc) == 0)
+                       ieee80211_begin_bgscan(ifp);
                break;
        case SIOCG80211FLAGS:
                flags = ic->ic_userflags;
blob - b493ff0a5362fa11d7824fd8bd0ae0d57462d6c4
blob + 501cbca0b9b8422fc9384ffbb9fb2c36b16cd2c0
--- sys/net80211/ieee80211_var.h
+++ sys/net80211/ieee80211_var.h
@@ -460,6 +460,7 @@ void        ieee80211_del_ess(struct ieee80211com *, char 
*, 
 void   ieee80211_set_ess(struct ieee80211com *, struct ieee80211_ess *,
            struct ieee80211_node *);
 struct ieee80211_ess *ieee80211_get_ess(struct ieee80211com *, const char *, 
int);
+void   ieee80211_begin_bgscan(struct ifnet *);
 
 extern int ieee80211_cache_size;
 

Reply via email to