diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2010-10-08 15:52:45 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-10-08 15:54:28 +0200 |
commit | 89e99ca4a4e5081d95c6d152c42c5699abd323a9 (patch) | |
tree | 0525cd5b3675c955361a44c18b0ca61b88644cd0 | |
parent | fc6a5bcad7df1b234bd0fbd2aa5b89f7bcd443b8 (diff) | |
download | connman-89e99ca4a4e5081d95c6d152c42c5699abd323a9.tar.gz connman-89e99ca4a4e5081d95c6d152c42c5699abd323a9.tar.bz2 connman-89e99ca4a4e5081d95c6d152c42c5699abd323a9.zip |
technology: Do not update a technology blocked counter when unchanged
Some buggy rfkill driver send rfkill CHANGE events while the actual rfkill
status has not changed. ConnMan should just ignore those.
-rw-r--r-- | src/technology.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/technology.c b/src/technology.c index 0a585120..37414d75 100644 --- a/src/technology.c +++ b/src/technology.c @@ -661,7 +661,7 @@ int __connman_technology_update_rfkill(unsigned int index, { struct connman_technology *technology; struct connman_rfkill *rfkill; - connman_bool_t blocked; + connman_bool_t blocked, old_blocked; DBG("index %u soft %u hard %u", index, softblock, hardblock); @@ -673,10 +673,14 @@ int __connman_technology_update_rfkill(unsigned int index, if (rfkill == NULL) return -ENXIO; + old_blocked = (rfkill->softblock || rfkill->hardblock) ? TRUE : FALSE; + blocked = (softblock || hardblock) ? TRUE : FALSE; + rfkill->softblock = softblock; rfkill->hardblock = hardblock; - blocked = (softblock || hardblock) ? TRUE : FALSE; + if (blocked == old_blocked) + return 0; if (blocked) { guint n_blocked; |