diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-07-22 20:18:16 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-07-22 20:18:16 +0200 |
commit | bb41ed268154c266212055fdd6d3f381784cc62f (patch) | |
tree | 01fc4b5b871978f2f1d198bc69545fb6eaf39f1f /src/rfkill.c | |
parent | bcecacfaf462336fdcc36cf61354311069db3c5e (diff) | |
download | connman-bb41ed268154c266212055fdd6d3f381784cc62f.tar.gz connman-bb41ed268154c266212055fdd6d3f381784cc62f.tar.bz2 connman-bb41ed268154c266212055fdd6d3f381784cc62f.zip |
Add support for RFKILL changes of the WiFi subsystem
Diffstat (limited to 'src/rfkill.c')
-rw-r--r-- | src/rfkill.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/rfkill.c b/src/rfkill.c index 84693b43..ad624ffc 100644 --- a/src/rfkill.c +++ b/src/rfkill.c @@ -61,6 +61,8 @@ static gboolean rfkill_event(GIOChannel *chan, { unsigned char buf[32]; struct rfkill_event *event = (void *) buf; + char sysname[32]; + connman_bool_t blocked; gsize len; GIOError err; @@ -79,10 +81,23 @@ static gboolean rfkill_event(GIOChannel *chan, if (len != sizeof(struct rfkill_event)) return TRUE; - connman_info("RFKILL event: idx %u type %u op %u soft %u hard %u", + DBG("idx %u type %u op %u soft %u hard %u", event->idx, event->type, event->op, event->soft, event->hard); + snprintf(sysname, sizeof(sysname) - 1, "rfkill%d", event->idx); + + blocked = (event->soft || event->hard) ? TRUE : FALSE; + + switch (event->type) { + case RFKILL_TYPE_ALL: + case RFKILL_TYPE_WLAN: + __connman_udev_rfkill(sysname, blocked); + break; + default: + break; + } + return TRUE; } |