diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-01-19 14:27:50 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-01-20 01:59:37 +0100 |
commit | 09d04acb9fa02ee7d5d6d3088f5a0fd8aede79fe (patch) | |
tree | 34ea558721c8028d0f60bed9234e55dbe3d00ce2 /src/notifier.c | |
parent | ab08bc6a5a5b2406c4f151dcb29af1c977b8880b (diff) | |
download | connman-09d04acb9fa02ee7d5d6d3088f5a0fd8aede79fe.tar.gz connman-09d04acb9fa02ee7d5d6d3088f5a0fd8aede79fe.tar.bz2 connman-09d04acb9fa02ee7d5d6d3088f5a0fd8aede79fe.zip |
notifier: Remove unused technology notifiers
Since there only user of __connman_notifier_is_enabled()
and __connman_notifier_is_register() was removed with the
technology method calls in Manager, remove the now unnecessary
support functions.
Diffstat (limited to 'src/notifier.c')
-rw-r--r-- | src/notifier.c | 179 |
1 files changed, 0 insertions, 179 deletions
diff --git a/src/notifier.c b/src/notifier.c index c1346f20..cb6af859 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -73,31 +73,8 @@ void connman_notifier_unregister(struct connman_notifier *notifier) #define MAX_TECHNOLOGIES 10 -static volatile int registered[MAX_TECHNOLOGIES]; -static volatile int enabled[MAX_TECHNOLOGIES]; static volatile int connected[MAX_TECHNOLOGIES]; -static void technology_registered(enum connman_service_type type, - connman_bool_t registered) -{ - DBG("type %d registered %d", type, registered); -} - -static void technology_enabled(enum connman_service_type type, - connman_bool_t enabled) -{ - GSList *list; - - DBG("type %d enabled %d", type, enabled); - - for (list = notifier_list; list; list = list->next) { - struct connman_notifier *notifier = list->data; - - if (notifier->service_enabled) - notifier->service_enabled(type, enabled); - } -} - unsigned int __connman_notifier_count_connected(void) { unsigned int i, count = 0; @@ -149,114 +126,6 @@ static void technology_connected(enum connman_service_type type, state_changed(connected); } -void __connman_notifier_register(enum connman_service_type type) -{ - DBG("type %d", type); - - switch (type) { - case CONNMAN_SERVICE_TYPE_UNKNOWN: - case CONNMAN_SERVICE_TYPE_SYSTEM: - case CONNMAN_SERVICE_TYPE_GPS: - case CONNMAN_SERVICE_TYPE_VPN: - case CONNMAN_SERVICE_TYPE_GADGET: - return; - case CONNMAN_SERVICE_TYPE_ETHERNET: - case CONNMAN_SERVICE_TYPE_WIFI: - case CONNMAN_SERVICE_TYPE_WIMAX: - case CONNMAN_SERVICE_TYPE_BLUETOOTH: - case CONNMAN_SERVICE_TYPE_CELLULAR: - break; - } - - if (__sync_fetch_and_add(®istered[type], 1) == 0) - technology_registered(type, TRUE); -} - -void __connman_notifier_unregister(enum connman_service_type type) -{ - DBG("type %d", type); - - __sync_synchronize(); - if (registered[type] == 0) { - connman_error("notifier unregister underflow"); - return; - } - - switch (type) { - case CONNMAN_SERVICE_TYPE_UNKNOWN: - case CONNMAN_SERVICE_TYPE_SYSTEM: - case CONNMAN_SERVICE_TYPE_GPS: - case CONNMAN_SERVICE_TYPE_VPN: - case CONNMAN_SERVICE_TYPE_GADGET: - return; - case CONNMAN_SERVICE_TYPE_ETHERNET: - case CONNMAN_SERVICE_TYPE_WIFI: - case CONNMAN_SERVICE_TYPE_WIMAX: - case CONNMAN_SERVICE_TYPE_BLUETOOTH: - case CONNMAN_SERVICE_TYPE_CELLULAR: - break; - } - - if (__sync_fetch_and_sub(®istered[type], 1) != 1) - return; - - technology_registered(type, FALSE); -} - -void __connman_notifier_enable(enum connman_service_type type) -{ - DBG("type %d", type); - - switch (type) { - case CONNMAN_SERVICE_TYPE_UNKNOWN: - case CONNMAN_SERVICE_TYPE_SYSTEM: - case CONNMAN_SERVICE_TYPE_GPS: - case CONNMAN_SERVICE_TYPE_VPN: - case CONNMAN_SERVICE_TYPE_GADGET: - return; - case CONNMAN_SERVICE_TYPE_ETHERNET: - case CONNMAN_SERVICE_TYPE_WIFI: - case CONNMAN_SERVICE_TYPE_WIMAX: - case CONNMAN_SERVICE_TYPE_BLUETOOTH: - case CONNMAN_SERVICE_TYPE_CELLULAR: - break; - } - - if (__sync_fetch_and_add(&enabled[type], 1) == 0) - technology_enabled(type, TRUE); -} - -void __connman_notifier_disable(enum connman_service_type type) -{ - DBG("type %d", type); - - __sync_synchronize(); - if (enabled[type] == 0) { - connman_error("notifier disable underflow"); - return; - } - - switch (type) { - case CONNMAN_SERVICE_TYPE_UNKNOWN: - case CONNMAN_SERVICE_TYPE_SYSTEM: - case CONNMAN_SERVICE_TYPE_GPS: - case CONNMAN_SERVICE_TYPE_VPN: - case CONNMAN_SERVICE_TYPE_GADGET: - return; - case CONNMAN_SERVICE_TYPE_ETHERNET: - case CONNMAN_SERVICE_TYPE_WIFI: - case CONNMAN_SERVICE_TYPE_WIMAX: - case CONNMAN_SERVICE_TYPE_BLUETOOTH: - case CONNMAN_SERVICE_TYPE_CELLULAR: - break; - } - - if (__sync_fetch_and_sub(&enabled[type], 1) != 1) - return; - - technology_enabled(type, FALSE); -} - void __connman_notifier_connect(enum connman_service_type type) { DBG("type %d", type); @@ -489,54 +358,6 @@ void __connman_notifier_ipconfig_changed(struct connman_service *service, } } -static connman_bool_t technology_supported(enum connman_service_type type) -{ - switch (type) { - case CONNMAN_SERVICE_TYPE_UNKNOWN: - case CONNMAN_SERVICE_TYPE_SYSTEM: - case CONNMAN_SERVICE_TYPE_GPS: - case CONNMAN_SERVICE_TYPE_VPN: - case CONNMAN_SERVICE_TYPE_GADGET: - return FALSE; - case CONNMAN_SERVICE_TYPE_ETHERNET: - case CONNMAN_SERVICE_TYPE_WIFI: - case CONNMAN_SERVICE_TYPE_WIMAX: - case CONNMAN_SERVICE_TYPE_BLUETOOTH: - case CONNMAN_SERVICE_TYPE_CELLULAR: - break; - } - - return TRUE; -} - -connman_bool_t __connman_notifier_is_registered(enum connman_service_type type) -{ - DBG("type %d", type); - - if (technology_supported(type) == FALSE) - return FALSE; - - __sync_synchronize(); - if (registered[type] > 0) - return TRUE; - - return FALSE; -} - -connman_bool_t __connman_notifier_is_enabled(enum connman_service_type type) -{ - DBG("type %d", type); - - if (technology_supported(type) == FALSE) - return FALSE; - - __sync_synchronize(); - if (enabled[type] > 0) - return TRUE; - - return FALSE; -} - int __connman_notifier_init(void) { DBG(""); |