diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2010-10-08 17:23:38 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-10-08 17:25:07 +0200 |
commit | ee8ba75ee4d8030602912826f46cbcadfd0a6b83 (patch) | |
tree | d7b95e5a91f21619e7c13df93d7fdd924f8440fe /src/device.c | |
parent | b680f0c062d77d3b045193025e774f0424ae2da1 (diff) | |
download | connman-ee8ba75ee4d8030602912826f46cbcadfd0a6b83.tar.gz connman-ee8ba75ee4d8030602912826f46cbcadfd0a6b83.tar.bz2 connman-ee8ba75ee4d8030602912826f46cbcadfd0a6b83.zip |
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.
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c index f6fc15e6..373eb5fd 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: |