From: Samuel Ortiz Date: Fri, 8 Oct 2010 15:23:38 +0000 (+0200) Subject: device: Set blocked field depending on the technology status X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~2301 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee8ba75ee4d8030602912826f46cbcadfd0a6b83;p=profile%2Fivi%2Fconnman.git 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. --- 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: