bgscan: Add new channel condition parameters to signal change events
authorPaul Stewart <pstew@google.com>
Tue, 12 Oct 2010 17:03:36 +0000 (20:03 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 12 Oct 2010 17:03:36 +0000 (20:03 +0300)
bgscan modules can potentially get a richer feel for the channel
condition and make better choices about scan/no-scan and roam/no-roam.

wpa_supplicant/bgscan.c
wpa_supplicant/bgscan.h
wpa_supplicant/bgscan_learn.c
wpa_supplicant/bgscan_simple.c
wpa_supplicant/events.c

index e76e954..5661830 100644 (file)
@@ -112,9 +112,12 @@ void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
 
 
 void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above,
-                                int current_signal)
+                                int current_signal, int current_noise,
+                                int current_txrate)
 {
        if (wpa_s->bgscan && wpa_s->bgscan_priv)
                wpa_s->bgscan->notify_signal_change(wpa_s->bgscan_priv, above,
-                                                   current_signal);
+                                                   current_signal,
+                                                   current_noise,
+                                                   current_txrate);
 }
index 9f2ba2f..ae94a48 100644 (file)
@@ -28,7 +28,9 @@ struct bgscan_ops {
        int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
        void (*notify_beacon_loss)(void *priv);
        void (*notify_signal_change)(void *priv, int above,
-                                    int current_signal);
+                                    int current_signal,
+                                    int current_noise,
+                                    int current_txrate);
 };
 
 #ifdef CONFIG_BGSCAN
@@ -39,7 +41,8 @@ int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
                       struct wpa_scan_results *scan_res);
 void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
 void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above,
-                                int current_signal);
+                                int current_signal, int current_noise,
+                                int current_txrate);
 
 #else /* CONFIG_BGSCAN */
 
@@ -64,7 +67,9 @@ static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
 }
 
 static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
-                                              int above, int current_signal)
+                                              int above, int current_signal,
+                                              int current_noise,
+                                              int current_txrate)
 {
 }
 
index 492ce38..ee79511 100644 (file)
@@ -556,7 +556,9 @@ static void bgscan_learn_notify_beacon_loss(void *priv)
 
 
 static void bgscan_learn_notify_signal_change(void *priv, int above,
-                                             int current_signal)
+                                             int current_signal,
+                                             int current_noise,
+                                             int current_txrate)
 {
        struct bgscan_learn_data *data = priv;
        int scan = 0;
@@ -567,7 +569,9 @@ static void bgscan_learn_notify_signal_change(void *priv, int above,
                return;
 
        wpa_printf(MSG_DEBUG, "bgscan learn: signal level changed "
-                  "(above=%d current_signal=%d)", above, current_signal);
+                  "(above=%d current_signal=%d current_noise=%d "
+                  "current_txrate=%d)", above, current_signal,
+                  current_noise, current_txrate);
        if (data->scan_interval == data->long_interval && !above) {
                wpa_printf(MSG_DEBUG, "bgscan learn: Start using short bgscan "
                           "interval");
index 6325d73..409d9ce 100644 (file)
@@ -177,7 +177,9 @@ static void bgscan_simple_notify_beacon_loss(void *priv)
 
 
 static void bgscan_simple_notify_signal_change(void *priv, int above,
-                                              int current_signal)
+                                              int current_signal,
+                                              int current_noise,
+                                              int current_txrate)
 {
        struct bgscan_simple_data *data = priv;
        int scan = 0;
@@ -188,7 +190,9 @@ static void bgscan_simple_notify_signal_change(void *priv, int above,
                return;
 
        wpa_printf(MSG_DEBUG, "bgscan simple: signal level changed "
-                  "(above=%d current_signal=%d)", above, current_signal);
+                  "(above=%d current_signal=%d current_noise=%d "
+                  "current_txrate=%d))", above, current_signal,
+                  current_noise, current_txrate);
        if (data->scan_interval == data->long_interval && !above) {
                wpa_printf(MSG_DEBUG, "bgscan simple: Start using short "
                           "bgscan interval");
index e9dea15..602f992 100644 (file)
@@ -1803,7 +1803,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
        case EVENT_SIGNAL_CHANGE:
                bgscan_notify_signal_change(
                        wpa_s, data->signal_change.above_threshold,
-                       data->signal_change.current_signal);
+                       data->signal_change.current_signal,
+                       data->signal_change.current_noise,
+                       data->signal_change.current_txrate);
                break;
        case EVENT_INTERFACE_ENABLED:
                wpa_printf(MSG_DEBUG, "Interface was enabled");