Toggle WiFi device powered field
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 5 Feb 2010 19:14:59 +0000 (20:14 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 5 Feb 2010 19:33:00 +0000 (11:33 -0800)
When receiving an RTNL message for a WiFI NEWLINK, the powered device
field should be toggled accordingly.

plugins/wifi.c

index b115c84..5fd82b0 100644 (file)
@@ -97,9 +97,10 @@ static void wifi_newlink(unsigned flags, unsigned change, void *user_data)
        if ((wifi->flags & IFF_UP) != (flags & IFF_UP)) {
                if (flags & IFF_UP) {
                        DBG("power on");
-
+                       connman_device_set_powered(device, TRUE);
                        supplicant_scan(device);
                } else {
+                       connman_device_set_powered(device, FALSE);
                        DBG("power off");
                }
        }