From ee8ba75ee4d8030602912826f46cbcadfd0a6b83 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Fri, 8 Oct 2010 17:23:38 +0200 Subject: [PATCH] device: Set blocked field depending on the technology status If a device is created before any rfkill event is received, it will not be blocked. Otherwise, it will mirror the technology blocked status. --- src/device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index f6fc15e..373eb5f 100644 --- a/src/device.c +++ b/src/device.c @@ -205,7 +205,7 @@ int __connman_device_enable(struct connman_device *device) { int err; - DBG("device %p", device); + DBG("device %p %d", device, device->blocked); if (!device->driver || !device->driver->enable) return -EOPNOTSUPP; @@ -742,6 +742,7 @@ struct connman_device *connman_device_create(const char *node, { struct connman_device *device; const char *str; + enum connman_service_type service_type; DBG("node %s type %d", node, type); @@ -774,6 +775,9 @@ struct connman_device *connman_device_create(const char *node, device->phyindex = -1; + service_type = __connman_device_get_service_type(device); + device->blocked = __connman_technology_get_blocked(service_type); + switch (type) { case CONNMAN_DEVICE_TYPE_UNKNOWN: case CONNMAN_DEVICE_TYPE_VENDOR: -- 2.7.4