5 * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 static DBusConnection *connection;
35 static GSList *technology_list = NULL;
37 static connman_bool_t global_offlinemode;
39 struct connman_rfkill {
41 enum connman_service_type type;
42 connman_bool_t softblock;
43 connman_bool_t hardblock;
46 enum connman_technology_state {
47 CONNMAN_TECHNOLOGY_STATE_UNKNOWN = 0,
48 CONNMAN_TECHNOLOGY_STATE_OFFLINE = 1,
49 CONNMAN_TECHNOLOGY_STATE_ENABLED = 2,
50 CONNMAN_TECHNOLOGY_STATE_CONNECTED = 3,
53 struct connman_technology {
55 enum connman_service_type type;
56 enum connman_technology_state state;
58 GHashTable *rfkill_list;
63 connman_bool_t tethering;
64 char *tethering_ident;
65 char *tethering_passphrase;
67 connman_bool_t enable_persistent; /* Save the tech state */
69 struct connman_technology_driver *driver;
72 DBusMessage *pending_reply;
73 guint pending_timeout;
76 static GSList *driver_list = NULL;
78 static gint compare_priority(gconstpointer a, gconstpointer b)
80 const struct connman_technology_driver *driver1 = a;
81 const struct connman_technology_driver *driver2 = b;
83 return driver2->priority - driver1->priority;
87 * connman_technology_driver_register:
88 * @driver: Technology driver definition
90 * Register a new technology driver
92 * Returns: %0 on success
94 int connman_technology_driver_register(struct connman_technology_driver *driver)
97 struct connman_technology *technology;
99 DBG("driver %p name %s", driver, driver->name);
101 driver_list = g_slist_insert_sorted(driver_list, driver,
104 for (list = technology_list; list; list = list->next) {
105 technology = list->data;
107 if (technology->driver != NULL)
110 if (technology->type == driver->type)
111 technology->driver = driver;
118 * connman_technology_driver_unregister:
119 * @driver: Technology driver definition
121 * Remove a previously registered technology driver
123 void connman_technology_driver_unregister(struct connman_technology_driver *driver)
126 struct connman_technology *technology;
128 DBG("driver %p name %s", driver, driver->name);
130 for (list = technology_list; list; list = list->next) {
131 technology = list->data;
133 if (technology->driver == NULL)
136 if (technology->type == driver->type) {
137 technology->driver->remove(technology);
138 technology->driver = NULL;
142 driver_list = g_slist_remove(driver_list, driver);
145 static void tethering_changed(struct connman_technology *technology)
147 connman_bool_t tethering = technology->tethering;
149 connman_dbus_property_changed_basic(technology->path,
150 CONNMAN_TECHNOLOGY_INTERFACE, "Tethering",
151 DBUS_TYPE_BOOLEAN, &tethering);
154 void connman_technology_tethering_notify(struct connman_technology *technology,
155 connman_bool_t enabled)
157 DBG("technology %p enabled %u", technology, enabled);
159 if (technology->tethering == enabled)
162 technology->tethering = enabled;
164 tethering_changed(technology);
167 __connman_tethering_set_enabled();
169 __connman_tethering_set_disabled();
172 static int set_tethering(struct connman_technology *technology,
173 const char *bridge, connman_bool_t enabled)
175 const char *ident, *passphrase;
177 ident = technology->tethering_ident;
178 passphrase = technology->tethering_passphrase;
180 if (technology->driver == NULL ||
181 technology->driver->set_tethering == NULL)
184 if (technology->type == CONNMAN_SERVICE_TYPE_WIFI &&
185 (ident == NULL || passphrase == NULL))
188 return technology->driver->set_tethering(technology, ident, passphrase,
192 void connman_technology_regdom_notify(struct connman_technology *technology,
198 connman_error("Failed to set regulatory domain");
200 DBG("Regulatory domain set to %s", alpha2);
202 g_free(technology->regdom);
203 technology->regdom = g_strdup(alpha2);
206 int connman_technology_set_regdom(const char *alpha2)
210 for (list = technology_list; list; list = list->next) {
211 struct connman_technology *technology = list->data;
213 if (technology->driver == NULL)
216 if (technology->driver->set_regdom)
217 technology->driver->set_regdom(technology, alpha2);
223 static void free_rfkill(gpointer data)
225 struct connman_rfkill *rfkill = data;
230 void __connman_technology_list(DBusMessageIter *iter, void *user_data)
234 for (list = technology_list; list; list = list->next) {
235 struct connman_technology *technology = list->data;
237 if (technology->path == NULL)
240 dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH,
245 static void technologies_changed(void)
247 connman_dbus_property_changed_array(CONNMAN_MANAGER_PATH,
248 CONNMAN_MANAGER_INTERFACE, "Technologies",
249 DBUS_TYPE_OBJECT_PATH, __connman_technology_list, NULL);
252 static const char *state2string(enum connman_technology_state state)
255 case CONNMAN_TECHNOLOGY_STATE_UNKNOWN:
257 case CONNMAN_TECHNOLOGY_STATE_OFFLINE:
259 case CONNMAN_TECHNOLOGY_STATE_ENABLED:
261 case CONNMAN_TECHNOLOGY_STATE_CONNECTED:
268 static void state_changed(struct connman_technology *technology)
272 str = state2string(technology->state);
276 connman_dbus_property_changed_basic(technology->path,
277 CONNMAN_TECHNOLOGY_INTERFACE, "State",
278 DBUS_TYPE_STRING, &str);
281 static const char *get_name(enum connman_service_type type)
284 case CONNMAN_SERVICE_TYPE_UNKNOWN:
285 case CONNMAN_SERVICE_TYPE_SYSTEM:
286 case CONNMAN_SERVICE_TYPE_GPS:
287 case CONNMAN_SERVICE_TYPE_VPN:
288 case CONNMAN_SERVICE_TYPE_GADGET:
290 case CONNMAN_SERVICE_TYPE_ETHERNET:
292 case CONNMAN_SERVICE_TYPE_WIFI:
294 case CONNMAN_SERVICE_TYPE_WIMAX:
296 case CONNMAN_SERVICE_TYPE_BLUETOOTH:
298 case CONNMAN_SERVICE_TYPE_CELLULAR:
305 static int load_state(struct connman_technology *technology)
309 GError *error = NULL;
310 connman_bool_t enable;
312 DBG("technology %p", technology);
314 keyfile = __connman_storage_open_profile("default");
318 identifier = g_strdup_printf("%s", get_name(technology->type));
319 if (identifier == NULL)
322 enable = g_key_file_get_boolean(keyfile, identifier, "Enable", &error);
324 technology->enable_persistent = enable;
326 technology->enable_persistent = FALSE;
328 g_clear_error(&error);
332 __connman_storage_close_profile("default", keyfile, FALSE);
337 static int save_state(struct connman_technology *technology)
342 DBG("technology %p", technology);
344 keyfile = __connman_storage_open_profile("default");
348 identifier = g_strdup_printf("%s", get_name(technology->type));
349 if (identifier == NULL)
352 g_key_file_set_boolean(keyfile, identifier, "Enable",
353 technology->enable_persistent);
358 __connman_storage_close_profile("default", keyfile, TRUE);
363 connman_bool_t __connman_technology_get_offlinemode(void)
365 return global_offlinemode;
368 static int connman_technology_save_offlinemode()
372 keyfile = __connman_storage_open_profile("default");
376 g_key_file_set_boolean(keyfile, "global",
377 "OfflineMode", global_offlinemode);
379 __connman_storage_close_profile("default", keyfile, TRUE);
384 static connman_bool_t connman_technology_load_offlinemode()
387 GError *error = NULL;
388 connman_bool_t offlinemode;
390 /* If there is a error, we enable offlinemode */
391 keyfile = __connman_storage_open_profile("default");
395 offlinemode = g_key_file_get_boolean(keyfile, "global",
396 "OfflineMode", &error);
399 g_clear_error(&error);
401 __connman_storage_close_profile("default", keyfile, FALSE);
406 static DBusMessage *get_properties(DBusConnection *conn,
407 DBusMessage *message, void *user_data)
409 struct connman_technology *technology = user_data;
411 DBusMessageIter array, dict;
414 reply = dbus_message_new_method_return(message);
418 dbus_message_iter_init_append(reply, &array);
420 connman_dbus_dict_open(&array, &dict);
422 str = state2string(technology->state);
424 connman_dbus_dict_append_basic(&dict, "State",
425 DBUS_TYPE_STRING, &str);
427 str = get_name(technology->type);
429 connman_dbus_dict_append_basic(&dict, "Name",
430 DBUS_TYPE_STRING, &str);
432 str = __connman_service_type2string(technology->type);
434 connman_dbus_dict_append_basic(&dict, "Type",
435 DBUS_TYPE_STRING, &str);
437 connman_dbus_dict_append_basic(&dict, "Tethering",
439 &technology->tethering);
441 if (technology->tethering_ident != NULL)
442 connman_dbus_dict_append_basic(&dict, "TetheringIdentifier",
444 &technology->tethering_ident);
446 if (technology->tethering_passphrase != NULL)
447 connman_dbus_dict_append_basic(&dict, "TetheringPassphrase",
449 &technology->tethering_passphrase);
451 connman_dbus_dict_close(&array, &dict);
456 static DBusMessage *set_property(DBusConnection *conn,
457 DBusMessage *msg, void *data)
459 struct connman_technology *technology = data;
460 DBusMessageIter iter, value;
464 DBG("conn %p", conn);
466 if (dbus_message_iter_init(msg, &iter) == FALSE)
467 return __connman_error_invalid_arguments(msg);
469 dbus_message_iter_get_basic(&iter, &name);
470 dbus_message_iter_next(&iter);
471 dbus_message_iter_recurse(&iter, &value);
473 type = dbus_message_iter_get_arg_type(&value);
475 DBG("property %s", name);
477 if (g_str_equal(name, "Tethering") == TRUE) {
479 connman_bool_t tethering;
482 if (type != DBUS_TYPE_BOOLEAN)
483 return __connman_error_invalid_arguments(msg);
485 dbus_message_iter_get_basic(&value, &tethering);
487 if (technology->tethering == tethering)
488 return __connman_error_in_progress(msg);
490 bridge = __connman_tethering_get_bridge();
492 return __connman_error_not_supported(msg);
494 err = set_tethering(technology, bridge, tethering);
496 return __connman_error_failed(msg, -err);
498 } else if (g_str_equal(name, "TetheringIdentifier") == TRUE) {
501 dbus_message_iter_get_basic(&value, &str);
503 if (technology->type != CONNMAN_SERVICE_TYPE_WIFI)
504 return __connman_error_not_supported(msg);
506 technology->tethering_ident = g_strdup(str);
507 } else if (g_str_equal(name, "TetheringPassphrase") == TRUE) {
510 dbus_message_iter_get_basic(&value, &str);
512 if (technology->type != CONNMAN_SERVICE_TYPE_WIFI)
513 return __connman_error_not_supported(msg);
516 return __connman_error_invalid_arguments(msg);
518 technology->tethering_passphrase = g_strdup(str);
520 return __connman_error_invalid_property(msg);
522 return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
525 static GDBusMethodTable technology_methods[] = {
526 { "GetProperties", "", "a{sv}", get_properties },
527 { "SetProperty", "sv", "", set_property },
531 static GDBusSignalTable technology_signals[] = {
532 { "PropertyChanged", "sv" },
536 static struct connman_technology *technology_find(enum connman_service_type type)
540 DBG("type %d", type);
542 for (list = technology_list; list; list = list->next) {
543 struct connman_technology *technology = list->data;
545 if (technology->type == type)
552 static struct connman_technology *technology_get(enum connman_service_type type)
554 struct connman_technology *technology;
558 DBG("type %d", type);
560 technology = technology_find(type);
561 if (technology != NULL) {
562 g_atomic_int_inc(&technology->refcount);
566 str = __connman_service_type2string(type);
570 technology = g_try_new0(struct connman_technology, 1);
571 if (technology == NULL)
574 technology->refcount = 1;
576 technology->type = type;
577 technology->path = g_strdup_printf("%s/technology/%s",
580 technology->rfkill_list = g_hash_table_new_full(g_int_hash, g_int_equal,
582 technology->device_list = NULL;
584 technology->pending_reply = NULL;
585 technology->state = CONNMAN_TECHNOLOGY_STATE_OFFLINE;
587 load_state(technology);
589 if (g_dbus_register_interface(connection, technology->path,
590 CONNMAN_TECHNOLOGY_INTERFACE,
591 technology_methods, technology_signals,
592 NULL, technology, NULL) == FALSE) {
593 connman_error("Failed to register %s", technology->path);
598 technology_list = g_slist_append(technology_list, technology);
600 technologies_changed();
602 if (technology->driver != NULL)
605 for (list = driver_list; list; list = list->next) {
606 struct connman_technology_driver *driver = list->data;
608 DBG("driver %p name %s", driver, driver->name);
610 if (driver->type != technology->type)
613 if (driver->probe(technology) == 0) {
614 technology->driver = driver;
620 DBG("technology %p", technology);
625 static void technology_put(struct connman_technology *technology)
627 DBG("technology %p", technology);
629 if (g_atomic_int_dec_and_test(&technology->refcount) == FALSE)
632 if (technology->driver) {
633 technology->driver->remove(technology);
634 technology->driver = NULL;
637 technology_list = g_slist_remove(technology_list, technology);
639 technologies_changed();
641 g_dbus_unregister_interface(connection, technology->path,
642 CONNMAN_TECHNOLOGY_INTERFACE);
644 g_slist_free(technology->device_list);
645 g_hash_table_destroy(technology->rfkill_list);
647 g_free(technology->path);
648 g_free(technology->regdom);
652 void __connman_technology_add_interface(enum connman_service_type type,
653 int index, const char *name, const char *ident)
655 struct connman_technology *technology;
658 case CONNMAN_SERVICE_TYPE_UNKNOWN:
659 case CONNMAN_SERVICE_TYPE_SYSTEM:
661 case CONNMAN_SERVICE_TYPE_ETHERNET:
662 case CONNMAN_SERVICE_TYPE_WIFI:
663 case CONNMAN_SERVICE_TYPE_WIMAX:
664 case CONNMAN_SERVICE_TYPE_BLUETOOTH:
665 case CONNMAN_SERVICE_TYPE_CELLULAR:
666 case CONNMAN_SERVICE_TYPE_GPS:
667 case CONNMAN_SERVICE_TYPE_VPN:
668 case CONNMAN_SERVICE_TYPE_GADGET:
672 connman_info("Create interface %s [ %s ]", name,
673 __connman_service_type2string(type));
675 technology = technology_get(type);
677 if (technology == NULL || technology->driver == NULL
678 || technology->driver->add_interface == NULL)
681 technology->driver->add_interface(technology,
685 void __connman_technology_remove_interface(enum connman_service_type type,
686 int index, const char *name, const char *ident)
688 struct connman_technology *technology;
691 case CONNMAN_SERVICE_TYPE_UNKNOWN:
692 case CONNMAN_SERVICE_TYPE_SYSTEM:
694 case CONNMAN_SERVICE_TYPE_ETHERNET:
695 case CONNMAN_SERVICE_TYPE_WIFI:
696 case CONNMAN_SERVICE_TYPE_WIMAX:
697 case CONNMAN_SERVICE_TYPE_BLUETOOTH:
698 case CONNMAN_SERVICE_TYPE_CELLULAR:
699 case CONNMAN_SERVICE_TYPE_GPS:
700 case CONNMAN_SERVICE_TYPE_VPN:
701 case CONNMAN_SERVICE_TYPE_GADGET:
705 connman_info("Remove interface %s [ %s ]", name,
706 __connman_service_type2string(type));
708 technology = technology_find(type);
710 if (technology == NULL || technology->driver == NULL)
713 if (technology->driver->remove_interface)
714 technology->driver->remove_interface(technology, index);
716 technology_put(technology);
719 int __connman_technology_add_device(struct connman_device *device)
721 struct connman_technology *technology;
722 enum connman_service_type type;
724 DBG("device %p", device);
726 type = __connman_device_get_service_type(device);
727 __connman_notifier_register(type);
729 technology = technology_get(type);
730 if (technology == NULL)
733 if (technology->enable_persistent && !global_offlinemode)
734 __connman_device_enable(device);
735 /* if technology persistent state is offline */
736 if (!technology->enable_persistent)
737 __connman_device_disable(device);
739 technology->device_list = g_slist_append(technology->device_list,
745 int __connman_technology_remove_device(struct connman_device *device)
747 struct connman_technology *technology;
748 enum connman_service_type type;
750 DBG("device %p", device);
752 type = __connman_device_get_service_type(device);
753 __connman_notifier_unregister(type);
755 technology = technology_find(type);
756 if (technology == NULL)
759 technology->device_list = g_slist_remove(technology->device_list,
761 if (technology->device_list == NULL) {
762 technology->state = CONNMAN_TECHNOLOGY_STATE_OFFLINE;
763 state_changed(technology);
769 static gboolean technology_pending_reply(gpointer user_data)
771 struct connman_technology *technology = user_data;
774 /* Power request timedout, send ETIMEDOUT. */
775 if (technology->pending_reply != NULL) {
776 reply = __connman_error_failed(technology->pending_reply, ETIMEDOUT);
778 g_dbus_send_message(connection, reply);
780 dbus_message_unref(technology->pending_reply);
781 technology->pending_reply = NULL;
782 technology->pending_timeout = 0;
788 int __connman_technology_enabled(enum connman_service_type type)
790 struct connman_technology *technology;
792 technology = technology_find(type);
793 if (technology == NULL)
796 if (g_atomic_int_exchange_and_add(&technology->enabled, 1) == 0) {
797 __connman_notifier_enable(type);
798 technology->state = CONNMAN_TECHNOLOGY_STATE_ENABLED;
799 state_changed(technology);
802 if (technology->pending_reply != NULL) {
803 g_dbus_send_reply(connection, technology->pending_reply, DBUS_TYPE_INVALID);
804 dbus_message_unref(technology->pending_reply);
805 technology->pending_reply = NULL;
806 technology->pending_timeout = 0;
812 int __connman_technology_enable(enum connman_service_type type, DBusMessage *msg)
814 struct connman_technology *technology;
820 DBG("type %d enable", type);
822 technology = technology_find(type);
823 if (technology == NULL) {
828 if (technology->pending_reply != NULL) {
834 technology->pending_reply = dbus_message_ref(msg);
836 * This is a bit of a trick. When msg is not NULL it means
837 * thats technology_enable was invoked from the manager API. Hence we save
840 technology->enable_persistent = TRUE;
841 save_state(technology);
844 __connman_rfkill_block(technology->type, FALSE);
846 for (list = technology->device_list; list; list = list->next) {
847 struct connman_device *device = list->data;
849 err = __connman_device_enable(device);
851 * err = 0 : Device was enabled right away.
852 * If atleast one device gets enabled, we consider
853 * the technology to be enabled.
864 if (err == -EINPROGRESS)
865 technology->pending_timeout = g_timeout_add_seconds(10,
866 technology_pending_reply, technology);
868 reply = __connman_error_failed(msg, -err);
870 g_dbus_send_message(connection, reply);
877 int __connman_technology_disabled(enum connman_service_type type)
879 struct connman_technology *technology;
881 technology = technology_find(type);
882 if (technology == NULL)
885 if (technology->pending_reply != NULL) {
886 g_dbus_send_reply(connection, technology->pending_reply, DBUS_TYPE_INVALID);
887 dbus_message_unref(technology->pending_reply);
888 technology->pending_reply = NULL;
891 if (g_atomic_int_dec_and_test(&technology->enabled) == TRUE) {
892 __connman_notifier_disable(type);
893 technology->state = CONNMAN_TECHNOLOGY_STATE_OFFLINE;
894 state_changed(technology);
900 int __connman_technology_disable(enum connman_service_type type, DBusMessage *msg)
902 struct connman_technology *technology;
908 DBG("type %d disable", type);
910 technology = technology_find(type);
911 if (technology == NULL) {
916 if (technology->pending_reply != NULL) {
922 technology->pending_reply = dbus_message_ref(msg);
923 technology->enable_persistent = FALSE;
924 save_state(technology);
927 __connman_rfkill_block(technology->type, TRUE);
929 for (list = technology->device_list; list; list = list->next) {
930 struct connman_device *device = list->data;
932 err = __connman_device_disable(device);
942 if (err == -EINPROGRESS)
943 technology->pending_timeout = g_timeout_add_seconds(10,
944 technology_pending_reply, technology);
946 reply = __connman_error_failed(msg, -err);
948 g_dbus_send_message(connection, reply);
955 int __connman_technology_set_offlinemode(connman_bool_t offlinemode)
960 if (global_offlinemode == offlinemode)
963 DBG("offlinemode %s", offlinemode ? "On" : "Off");
966 * This is a bit tricky. When you set offlinemode, there is no
967 * way to differentiate between attempting offline mode and
968 * resuming offlinemode from last saved profile. We need that
969 * information in rfkill_update, otherwise it falls back on the
970 * technology's persistent state. Hence we set the offline mode here
971 * but save it & call the notifier only if its successful.
974 global_offlinemode = offlinemode;
976 /* Traverse technology list, enable/disable each technology. */
977 for (list = technology_list; list; list = list->next) {
978 struct connman_technology *technology = list->data;
981 err = __connman_technology_disable(technology->type, NULL);
983 if (!offlinemode && technology->enable_persistent)
984 err = __connman_technology_enable(technology->type, NULL);
987 if (err == 0 || err == -EINPROGRESS || err == -EALREADY) {
988 connman_technology_save_offlinemode();
989 __connman_notifier_offlinemode(offlinemode);
991 global_offlinemode = connman_technology_load_offlinemode();
996 int __connman_technology_add_rfkill(unsigned int index,
997 enum connman_service_type type,
998 connman_bool_t softblock,
999 connman_bool_t hardblock)
1001 struct connman_technology *technology;
1002 struct connman_rfkill *rfkill;
1004 DBG("index %u type %d soft %u hard %u", index, type,
1005 softblock, hardblock);
1007 technology = technology_get(type);
1008 if (technology == NULL)
1011 rfkill = g_try_new0(struct connman_rfkill, 1);
1015 rfkill->index = index;
1016 rfkill->type = type;
1017 rfkill->softblock = softblock;
1018 rfkill->hardblock = hardblock;
1020 g_hash_table_replace(technology->rfkill_list, &rfkill->index, rfkill);
1023 DBG("%s is switched off.", get_name(type));
1028 * If Offline mode is on, we softblock the device if it isnt already.
1029 * If Offline mode is off, we rely on the persistent state of tech.
1031 if (global_offlinemode) {
1033 return __connman_rfkill_block(type, TRUE);
1035 if (technology->enable_persistent && softblock)
1036 return __connman_rfkill_block(type, FALSE);
1037 /* if technology persistent state is offline */
1038 if (!technology->enable_persistent && !softblock)
1039 return __connman_rfkill_block(type, TRUE);
1045 int __connman_technology_update_rfkill(unsigned int index,
1046 enum connman_service_type type,
1047 connman_bool_t softblock,
1048 connman_bool_t hardblock)
1050 struct connman_technology *technology;
1051 struct connman_rfkill *rfkill;
1053 DBG("index %u soft %u hard %u", index, softblock, hardblock);
1055 technology = technology_find(type);
1056 if (technology == NULL)
1059 rfkill = g_hash_table_lookup(technology->rfkill_list, &index);
1063 if (rfkill->softblock == softblock &&
1064 rfkill->hardblock == hardblock)
1067 rfkill->softblock = softblock;
1068 rfkill->hardblock = hardblock;
1071 DBG("%s is switched off.", get_name(type));
1075 if (!global_offlinemode) {
1076 if (technology->enable_persistent && softblock)
1077 return __connman_rfkill_block(type, FALSE);
1078 if (!technology->enable_persistent && !softblock)
1079 return __connman_rfkill_block(type, TRUE);
1085 int __connman_technology_remove_rfkill(unsigned int index,
1086 enum connman_service_type type)
1088 struct connman_technology *technology;
1089 struct connman_rfkill *rfkill;
1091 DBG("index %u", index);
1093 technology = technology_find(type);
1094 if (technology == NULL)
1097 rfkill = g_hash_table_lookup(technology->rfkill_list, &index);
1101 g_hash_table_remove(technology->rfkill_list, &index);
1103 technology_put(technology);
1108 int __connman_technology_init(void)
1112 connection = connman_dbus_get_connection();
1114 global_offlinemode = connman_technology_load_offlinemode();
1119 void __connman_technology_cleanup(void)
1123 dbus_connection_unref(connection);