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 connman_bool_t enabled)
175 const char *ident, *passphrase, *bridge;
177 ident = technology->tethering_ident;
178 passphrase = technology->tethering_passphrase;
180 if (technology->driver == NULL ||
181 technology->driver->set_tethering == NULL)
184 bridge = __connman_tethering_get_bridge();
188 if (technology->type == CONNMAN_SERVICE_TYPE_WIFI &&
189 (ident == NULL || passphrase == NULL))
192 return technology->driver->set_tethering(technology, ident, passphrase,
196 void connman_technology_regdom_notify(struct connman_technology *technology,
202 connman_error("Failed to set regulatory domain");
204 DBG("Regulatory domain set to %s", alpha2);
206 g_free(technology->regdom);
207 technology->regdom = g_strdup(alpha2);
210 int connman_technology_set_regdom(const char *alpha2)
214 for (list = technology_list; list; list = list->next) {
215 struct connman_technology *technology = list->data;
217 if (technology->driver == NULL)
220 if (technology->driver->set_regdom)
221 technology->driver->set_regdom(technology, alpha2);
227 static void free_rfkill(gpointer data)
229 struct connman_rfkill *rfkill = data;
234 void __connman_technology_list(DBusMessageIter *iter, void *user_data)
238 for (list = technology_list; list; list = list->next) {
239 struct connman_technology *technology = list->data;
241 if (technology->path == NULL)
244 dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH,
249 static void technologies_changed(void)
251 connman_dbus_property_changed_array(CONNMAN_MANAGER_PATH,
252 CONNMAN_MANAGER_INTERFACE, "Technologies",
253 DBUS_TYPE_OBJECT_PATH, __connman_technology_list, NULL);
256 static const char *state2string(enum connman_technology_state state)
259 case CONNMAN_TECHNOLOGY_STATE_UNKNOWN:
261 case CONNMAN_TECHNOLOGY_STATE_OFFLINE:
263 case CONNMAN_TECHNOLOGY_STATE_ENABLED:
265 case CONNMAN_TECHNOLOGY_STATE_CONNECTED:
272 static void state_changed(struct connman_technology *technology)
276 str = state2string(technology->state);
280 connman_dbus_property_changed_basic(technology->path,
281 CONNMAN_TECHNOLOGY_INTERFACE, "State",
282 DBUS_TYPE_STRING, &str);
285 static const char *get_name(enum connman_service_type type)
288 case CONNMAN_SERVICE_TYPE_UNKNOWN:
289 case CONNMAN_SERVICE_TYPE_SYSTEM:
290 case CONNMAN_SERVICE_TYPE_GPS:
291 case CONNMAN_SERVICE_TYPE_VPN:
292 case CONNMAN_SERVICE_TYPE_GADGET:
294 case CONNMAN_SERVICE_TYPE_ETHERNET:
296 case CONNMAN_SERVICE_TYPE_WIFI:
298 case CONNMAN_SERVICE_TYPE_WIMAX:
300 case CONNMAN_SERVICE_TYPE_BLUETOOTH:
302 case CONNMAN_SERVICE_TYPE_CELLULAR:
309 static void load_state(struct connman_technology *technology)
313 GError *error = NULL;
314 connman_bool_t enable;
316 DBG("technology %p", technology);
318 keyfile = __connman_storage_load_global();
319 /* Fallback on disabling technology if file not found. */
320 if (keyfile == NULL) {
321 technology->enable_persistent = FALSE;
325 identifier = g_strdup_printf("%s", get_name(technology->type));
326 if (identifier == NULL)
329 enable = g_key_file_get_boolean(keyfile, identifier, "Enable", &error);
331 technology->enable_persistent = enable;
333 technology->enable_persistent = FALSE;
334 g_clear_error(&error);
339 g_key_file_free(keyfile);
344 static void save_state(struct connman_technology *technology)
349 DBG("technology %p", technology);
351 keyfile = __connman_storage_load_global();
353 keyfile = g_key_file_new();
355 identifier = g_strdup_printf("%s", get_name(technology->type));
356 if (identifier == NULL)
359 g_key_file_set_boolean(keyfile, identifier, "Enable",
360 technology->enable_persistent);
365 __connman_storage_save_global(keyfile);
367 g_key_file_free(keyfile);
372 connman_bool_t __connman_technology_get_offlinemode(void)
374 return global_offlinemode;
377 static void connman_technology_save_offlinemode()
381 keyfile = __connman_storage_load_global();
383 keyfile = g_key_file_new();
385 g_key_file_set_boolean(keyfile, "global",
386 "OfflineMode", global_offlinemode);
388 __connman_storage_save_global(keyfile);
390 g_key_file_free(keyfile);
395 static connman_bool_t connman_technology_load_offlinemode()
398 GError *error = NULL;
399 connman_bool_t offlinemode;
401 /* If there is a error, we enable offlinemode */
402 keyfile = __connman_storage_load_global();
406 offlinemode = g_key_file_get_boolean(keyfile, "global",
407 "OfflineMode", &error);
410 g_clear_error(&error);
413 g_key_file_free(keyfile);
418 static DBusMessage *get_properties(DBusConnection *conn,
419 DBusMessage *message, void *user_data)
421 struct connman_technology *technology = user_data;
423 DBusMessageIter array, dict;
426 reply = dbus_message_new_method_return(message);
430 dbus_message_iter_init_append(reply, &array);
432 connman_dbus_dict_open(&array, &dict);
434 str = state2string(technology->state);
436 connman_dbus_dict_append_basic(&dict, "State",
437 DBUS_TYPE_STRING, &str);
439 str = get_name(technology->type);
441 connman_dbus_dict_append_basic(&dict, "Name",
442 DBUS_TYPE_STRING, &str);
444 str = __connman_service_type2string(technology->type);
446 connman_dbus_dict_append_basic(&dict, "Type",
447 DBUS_TYPE_STRING, &str);
449 connman_dbus_dict_append_basic(&dict, "Tethering",
451 &technology->tethering);
453 if (technology->tethering_ident != NULL)
454 connman_dbus_dict_append_basic(&dict, "TetheringIdentifier",
456 &technology->tethering_ident);
458 if (technology->tethering_passphrase != NULL)
459 connman_dbus_dict_append_basic(&dict, "TetheringPassphrase",
461 &technology->tethering_passphrase);
463 connman_dbus_dict_close(&array, &dict);
468 static DBusMessage *set_property(DBusConnection *conn,
469 DBusMessage *msg, void *data)
471 struct connman_technology *technology = data;
472 DBusMessageIter iter, value;
476 DBG("conn %p", conn);
478 if (dbus_message_iter_init(msg, &iter) == FALSE)
479 return __connman_error_invalid_arguments(msg);
481 dbus_message_iter_get_basic(&iter, &name);
482 dbus_message_iter_next(&iter);
483 dbus_message_iter_recurse(&iter, &value);
485 type = dbus_message_iter_get_arg_type(&value);
487 DBG("property %s", name);
489 if (g_str_equal(name, "Tethering") == TRUE) {
491 connman_bool_t tethering;
493 if (type != DBUS_TYPE_BOOLEAN)
494 return __connman_error_invalid_arguments(msg);
496 dbus_message_iter_get_basic(&value, &tethering);
498 if (technology->tethering == tethering)
499 return __connman_error_in_progress(msg);
501 err = set_tethering(technology, tethering);
503 return __connman_error_failed(msg, -err);
505 } else if (g_str_equal(name, "TetheringIdentifier") == TRUE) {
508 dbus_message_iter_get_basic(&value, &str);
510 if (technology->type != CONNMAN_SERVICE_TYPE_WIFI)
511 return __connman_error_not_supported(msg);
513 technology->tethering_ident = g_strdup(str);
514 } else if (g_str_equal(name, "TetheringPassphrase") == TRUE) {
517 dbus_message_iter_get_basic(&value, &str);
519 if (technology->type != CONNMAN_SERVICE_TYPE_WIFI)
520 return __connman_error_not_supported(msg);
523 return __connman_error_invalid_arguments(msg);
525 technology->tethering_passphrase = g_strdup(str);
527 return __connman_error_invalid_property(msg);
529 return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
532 static GDBusMethodTable technology_methods[] = {
533 { "GetProperties", "", "a{sv}", get_properties },
534 { "SetProperty", "sv", "", set_property },
538 static GDBusSignalTable technology_signals[] = {
539 { "PropertyChanged", "sv" },
543 static struct connman_technology *technology_find(enum connman_service_type type)
547 DBG("type %d", type);
549 for (list = technology_list; list; list = list->next) {
550 struct connman_technology *technology = list->data;
552 if (technology->type == type)
559 static struct connman_technology *technology_get(enum connman_service_type type)
561 struct connman_technology *technology;
565 DBG("type %d", type);
567 technology = technology_find(type);
568 if (technology != NULL) {
569 g_atomic_int_inc(&technology->refcount);
573 str = __connman_service_type2string(type);
577 technology = g_try_new0(struct connman_technology, 1);
578 if (technology == NULL)
581 technology->refcount = 1;
583 technology->type = type;
584 technology->path = g_strdup_printf("%s/technology/%s",
587 technology->rfkill_list = g_hash_table_new_full(g_int_hash, g_int_equal,
589 technology->device_list = NULL;
591 technology->pending_reply = NULL;
592 technology->state = CONNMAN_TECHNOLOGY_STATE_OFFLINE;
594 load_state(technology);
596 if (g_dbus_register_interface(connection, technology->path,
597 CONNMAN_TECHNOLOGY_INTERFACE,
598 technology_methods, technology_signals,
599 NULL, technology, NULL) == FALSE) {
600 connman_error("Failed to register %s", technology->path);
605 technology_list = g_slist_append(technology_list, technology);
607 technologies_changed();
609 if (technology->driver != NULL)
612 for (list = driver_list; list; list = list->next) {
613 struct connman_technology_driver *driver = list->data;
615 DBG("driver %p name %s", driver, driver->name);
617 if (driver->type != technology->type)
620 if (driver->probe(technology) == 0) {
621 technology->driver = driver;
627 DBG("technology %p", technology);
632 static void technology_put(struct connman_technology *technology)
634 DBG("technology %p", technology);
636 if (g_atomic_int_dec_and_test(&technology->refcount) == FALSE)
639 if (technology->driver) {
640 technology->driver->remove(technology);
641 technology->driver = NULL;
644 technology_list = g_slist_remove(technology_list, technology);
646 technologies_changed();
648 g_dbus_unregister_interface(connection, technology->path,
649 CONNMAN_TECHNOLOGY_INTERFACE);
651 g_slist_free(technology->device_list);
652 g_hash_table_destroy(technology->rfkill_list);
654 g_free(technology->path);
655 g_free(technology->regdom);
659 void __connman_technology_add_interface(enum connman_service_type type,
660 int index, const char *name, const char *ident)
662 struct connman_technology *technology;
665 case CONNMAN_SERVICE_TYPE_UNKNOWN:
666 case CONNMAN_SERVICE_TYPE_SYSTEM:
668 case CONNMAN_SERVICE_TYPE_ETHERNET:
669 case CONNMAN_SERVICE_TYPE_WIFI:
670 case CONNMAN_SERVICE_TYPE_WIMAX:
671 case CONNMAN_SERVICE_TYPE_BLUETOOTH:
672 case CONNMAN_SERVICE_TYPE_CELLULAR:
673 case CONNMAN_SERVICE_TYPE_GPS:
674 case CONNMAN_SERVICE_TYPE_VPN:
675 case CONNMAN_SERVICE_TYPE_GADGET:
679 connman_info("Create interface %s [ %s ]", name,
680 __connman_service_type2string(type));
682 technology = technology_get(type);
684 if (technology == NULL || technology->driver == NULL
685 || technology->driver->add_interface == NULL)
688 technology->driver->add_interface(technology,
692 void __connman_technology_remove_interface(enum connman_service_type type,
693 int index, const char *name, const char *ident)
695 struct connman_technology *technology;
698 case CONNMAN_SERVICE_TYPE_UNKNOWN:
699 case CONNMAN_SERVICE_TYPE_SYSTEM:
701 case CONNMAN_SERVICE_TYPE_ETHERNET:
702 case CONNMAN_SERVICE_TYPE_WIFI:
703 case CONNMAN_SERVICE_TYPE_WIMAX:
704 case CONNMAN_SERVICE_TYPE_BLUETOOTH:
705 case CONNMAN_SERVICE_TYPE_CELLULAR:
706 case CONNMAN_SERVICE_TYPE_GPS:
707 case CONNMAN_SERVICE_TYPE_VPN:
708 case CONNMAN_SERVICE_TYPE_GADGET:
712 connman_info("Remove interface %s [ %s ]", name,
713 __connman_service_type2string(type));
715 technology = technology_find(type);
717 if (technology == NULL || technology->driver == NULL)
720 if (technology->driver->remove_interface)
721 technology->driver->remove_interface(technology, index);
723 technology_put(technology);
726 int __connman_technology_add_device(struct connman_device *device)
728 struct connman_technology *technology;
729 enum connman_service_type type;
731 DBG("device %p", device);
733 type = __connman_device_get_service_type(device);
734 __connman_notifier_register(type);
736 technology = technology_get(type);
737 if (technology == NULL)
740 if (technology->enable_persistent && !global_offlinemode)
741 __connman_device_enable(device);
742 /* if technology persistent state is offline */
743 if (!technology->enable_persistent)
744 __connman_device_disable(device);
746 technology->device_list = g_slist_append(technology->device_list,
752 int __connman_technology_remove_device(struct connman_device *device)
754 struct connman_technology *technology;
755 enum connman_service_type type;
757 DBG("device %p", device);
759 type = __connman_device_get_service_type(device);
760 __connman_notifier_unregister(type);
762 technology = technology_find(type);
763 if (technology == NULL)
766 technology->device_list = g_slist_remove(technology->device_list,
768 if (technology->device_list == NULL) {
769 technology->state = CONNMAN_TECHNOLOGY_STATE_OFFLINE;
770 state_changed(technology);
776 static gboolean technology_pending_reply(gpointer user_data)
778 struct connman_technology *technology = user_data;
781 /* Power request timedout, send ETIMEDOUT. */
782 if (technology->pending_reply != NULL) {
783 reply = __connman_error_failed(technology->pending_reply, ETIMEDOUT);
785 g_dbus_send_message(connection, reply);
787 dbus_message_unref(technology->pending_reply);
788 technology->pending_reply = NULL;
789 technology->pending_timeout = 0;
795 int __connman_technology_enabled(enum connman_service_type type)
797 struct connman_technology *technology;
799 technology = technology_find(type);
800 if (technology == NULL)
803 if (g_atomic_int_exchange_and_add(&technology->enabled, 1) == 0) {
804 __connman_notifier_enable(type);
805 technology->state = CONNMAN_TECHNOLOGY_STATE_ENABLED;
806 state_changed(technology);
809 if (technology->pending_reply != NULL) {
810 g_dbus_send_reply(connection, technology->pending_reply, DBUS_TYPE_INVALID);
811 dbus_message_unref(technology->pending_reply);
812 technology->pending_reply = NULL;
813 technology->pending_timeout = 0;
819 int __connman_technology_enable(enum connman_service_type type, DBusMessage *msg)
821 struct connman_technology *technology;
827 DBG("type %d enable", type);
829 technology = technology_find(type);
830 if (technology == NULL) {
835 if (technology->pending_reply != NULL) {
841 technology->pending_reply = dbus_message_ref(msg);
843 * This is a bit of a trick. When msg is not NULL it means
844 * thats technology_enable was invoked from the manager API. Hence we save
847 technology->enable_persistent = TRUE;
848 save_state(technology);
851 __connman_rfkill_block(technology->type, FALSE);
853 for (list = technology->device_list; list; list = list->next) {
854 struct connman_device *device = list->data;
856 err = __connman_device_enable(device);
858 * err = 0 : Device was enabled right away.
859 * If atleast one device gets enabled, we consider
860 * the technology to be enabled.
871 if (err == -EINPROGRESS)
872 technology->pending_timeout = g_timeout_add_seconds(10,
873 technology_pending_reply, technology);
875 reply = __connman_error_failed(msg, -err);
877 g_dbus_send_message(connection, reply);
884 int __connman_technology_disabled(enum connman_service_type type)
886 struct connman_technology *technology;
888 technology = technology_find(type);
889 if (technology == NULL)
892 if (technology->pending_reply != NULL) {
893 g_dbus_send_reply(connection, technology->pending_reply, DBUS_TYPE_INVALID);
894 dbus_message_unref(technology->pending_reply);
895 technology->pending_reply = NULL;
898 if (g_atomic_int_dec_and_test(&technology->enabled) == TRUE) {
899 __connman_notifier_disable(type);
900 technology->state = CONNMAN_TECHNOLOGY_STATE_OFFLINE;
901 state_changed(technology);
907 int __connman_technology_disable(enum connman_service_type type, DBusMessage *msg)
909 struct connman_technology *technology;
915 DBG("type %d disable", type);
917 technology = technology_find(type);
918 if (technology == NULL) {
923 if (technology->pending_reply != NULL) {
928 if (technology->tethering == TRUE)
929 set_tethering(technology, FALSE);
932 technology->pending_reply = dbus_message_ref(msg);
933 technology->enable_persistent = FALSE;
934 save_state(technology);
937 __connman_rfkill_block(technology->type, TRUE);
939 for (list = technology->device_list; list; list = list->next) {
940 struct connman_device *device = list->data;
942 err = __connman_device_disable(device);
952 if (err == -EINPROGRESS)
953 technology->pending_timeout = g_timeout_add_seconds(10,
954 technology_pending_reply, technology);
956 reply = __connman_error_failed(msg, -err);
958 g_dbus_send_message(connection, reply);
965 int __connman_technology_set_offlinemode(connman_bool_t offlinemode)
970 if (global_offlinemode == offlinemode)
973 DBG("offlinemode %s", offlinemode ? "On" : "Off");
976 * This is a bit tricky. When you set offlinemode, there is no
977 * way to differentiate between attempting offline mode and
978 * resuming offlinemode from last saved profile. We need that
979 * information in rfkill_update, otherwise it falls back on the
980 * technology's persistent state. Hence we set the offline mode here
981 * but save it & call the notifier only if its successful.
984 global_offlinemode = offlinemode;
986 /* Traverse technology list, enable/disable each technology. */
987 for (list = technology_list; list; list = list->next) {
988 struct connman_technology *technology = list->data;
991 err = __connman_technology_disable(technology->type, NULL);
993 if (!offlinemode && technology->enable_persistent)
994 err = __connman_technology_enable(technology->type, NULL);
997 if (err == 0 || err == -EINPROGRESS || err == -EALREADY) {
998 connman_technology_save_offlinemode();
999 __connman_notifier_offlinemode(offlinemode);
1001 global_offlinemode = connman_technology_load_offlinemode();
1006 int __connman_technology_add_rfkill(unsigned int index,
1007 enum connman_service_type type,
1008 connman_bool_t softblock,
1009 connman_bool_t hardblock)
1011 struct connman_technology *technology;
1012 struct connman_rfkill *rfkill;
1014 DBG("index %u type %d soft %u hard %u", index, type,
1015 softblock, hardblock);
1017 technology = technology_get(type);
1018 if (technology == NULL)
1021 rfkill = g_try_new0(struct connman_rfkill, 1);
1025 rfkill->index = index;
1026 rfkill->type = type;
1027 rfkill->softblock = softblock;
1028 rfkill->hardblock = hardblock;
1030 g_hash_table_replace(technology->rfkill_list, &rfkill->index, rfkill);
1033 DBG("%s is switched off.", get_name(type));
1038 * If Offline mode is on, we softblock the device if it isnt already.
1039 * If Offline mode is off, we rely on the persistent state of tech.
1041 if (global_offlinemode) {
1043 return __connman_rfkill_block(type, TRUE);
1045 if (technology->enable_persistent && softblock)
1046 return __connman_rfkill_block(type, FALSE);
1047 /* if technology persistent state is offline */
1048 if (!technology->enable_persistent && !softblock)
1049 return __connman_rfkill_block(type, TRUE);
1055 int __connman_technology_update_rfkill(unsigned int index,
1056 enum connman_service_type type,
1057 connman_bool_t softblock,
1058 connman_bool_t hardblock)
1060 struct connman_technology *technology;
1061 struct connman_rfkill *rfkill;
1063 DBG("index %u soft %u hard %u", index, softblock, hardblock);
1065 technology = technology_find(type);
1066 if (technology == NULL)
1069 rfkill = g_hash_table_lookup(technology->rfkill_list, &index);
1073 if (rfkill->softblock == softblock &&
1074 rfkill->hardblock == hardblock)
1077 rfkill->softblock = softblock;
1078 rfkill->hardblock = hardblock;
1081 DBG("%s is switched off.", get_name(type));
1085 if (!global_offlinemode) {
1086 if (technology->enable_persistent && softblock)
1087 return __connman_rfkill_block(type, FALSE);
1088 if (!technology->enable_persistent && !softblock)
1089 return __connman_rfkill_block(type, TRUE);
1095 int __connman_technology_remove_rfkill(unsigned int index,
1096 enum connman_service_type type)
1098 struct connman_technology *technology;
1099 struct connman_rfkill *rfkill;
1101 DBG("index %u", index);
1103 technology = technology_find(type);
1104 if (technology == NULL)
1107 rfkill = g_hash_table_lookup(technology->rfkill_list, &index);
1111 g_hash_table_remove(technology->rfkill_list, &index);
1113 technology_put(technology);
1118 int __connman_technology_init(void)
1122 connection = connman_dbus_get_connection();
1124 global_offlinemode = connman_technology_load_offlinemode();
1129 void __connman_technology_cleanup(void)
1133 dbus_connection_unref(connection);