diff options
author | Martin Xu <martin.xu@intel.com> | 2010-12-08 16:28:40 +0800 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-12-08 12:24:58 +0100 |
commit | c48061ba2f015b7a8e82c5c12e1ac30bf06c1f38 (patch) | |
tree | baf3c62bf98a17d9aacae24644eb87acdd1b6d83 | |
parent | 597ccb4900f3c3d8713529f90a738c6bc6df37c3 (diff) | |
download | connman-c48061ba2f015b7a8e82c5c12e1ac30bf06c1f38.tar.gz connman-c48061ba2f015b7a8e82c5c12e1ac30bf06c1f38.tar.bz2 connman-c48061ba2f015b7a8e82c5c12e1ac30bf06c1f38.zip |
Add CONNMAN_DEVICE_TYPE_GADGET and CONNMAN_SERVICE_TYPE_GADGET
-rw-r--r-- | include/device.h | 1 | ||||
-rw-r--r-- | include/service.h | 1 | ||||
-rw-r--r-- | plugins/iospm.c | 1 | ||||
-rw-r--r-- | plugins/portal.c | 1 | ||||
-rw-r--r-- | src/detect.c | 1 | ||||
-rw-r--r-- | src/device.c | 12 | ||||
-rw-r--r-- | src/element.c | 4 | ||||
-rw-r--r-- | src/inet.c | 2 | ||||
-rw-r--r-- | src/notifier.c | 7 | ||||
-rw-r--r-- | src/rtnl.c | 4 | ||||
-rw-r--r-- | src/service.c | 10 | ||||
-rw-r--r-- | src/session.c | 1 | ||||
-rw-r--r-- | src/technology.c | 3 |
13 files changed, 48 insertions, 0 deletions
diff --git a/include/device.h b/include/device.h index 31aa92b8..c5e005d7 100644 --- a/include/device.h +++ b/include/device.h @@ -43,6 +43,7 @@ enum connman_device_type { CONNMAN_DEVICE_TYPE_BLUETOOTH = 4, CONNMAN_DEVICE_TYPE_CELLULAR = 5, CONNMAN_DEVICE_TYPE_GPS = 6, + CONNMAN_DEVICE_TYPE_GADGET = 7, CONNMAN_DEVICE_TYPE_VENDOR = 10000, }; diff --git a/include/service.h b/include/service.h index 16d10f2a..e67dd422 100644 --- a/include/service.h +++ b/include/service.h @@ -44,6 +44,7 @@ enum connman_service_type { CONNMAN_SERVICE_TYPE_CELLULAR = 6, CONNMAN_SERVICE_TYPE_GPS = 7, CONNMAN_SERVICE_TYPE_VPN = 8, + CONNMAN_SERVICE_TYPE_GADGET = 9, }; enum connman_service_mode { diff --git a/plugins/iospm.c b/plugins/iospm.c index 20c9b46b..a36e4aa0 100644 --- a/plugins/iospm.c +++ b/plugins/iospm.c @@ -73,6 +73,7 @@ static void iospm_service_enabled(enum connman_service_type type, case CONNMAN_SERVICE_TYPE_CELLULAR: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: break; case CONNMAN_SERVICE_TYPE_BLUETOOTH: send_indication(IOSPM_BLUETOOTH, enabled); diff --git a/plugins/portal.c b/plugins/portal.c index f1d5ce37..d4456f5f 100644 --- a/plugins/portal.c +++ b/plugins/portal.c @@ -123,6 +123,7 @@ static int location_detect(struct connman_location *location) case CONNMAN_SERVICE_TYPE_SYSTEM: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: return -EOPNOTSUPP; } diff --git a/src/detect.c b/src/detect.c index c27d2cc7..39ab06a1 100644 --- a/src/detect.c +++ b/src/detect.c @@ -63,6 +63,7 @@ static void detect_newlink(unsigned short type, int index, return; case CONNMAN_DEVICE_TYPE_ETHERNET: case CONNMAN_DEVICE_TYPE_WIFI: + case CONNMAN_DEVICE_TYPE_GADGET: break; } diff --git a/src/device.c b/src/device.c index 7f2b54fd..b8110c47 100644 --- a/src/device.c +++ b/src/device.c @@ -124,6 +124,9 @@ static const char *type2description(enum connman_device_type type) return "GPS"; case CONNMAN_DEVICE_TYPE_CELLULAR: return "Cellular"; + case CONNMAN_DEVICE_TYPE_GADGET: + return "Gadget"; + } return NULL; @@ -147,6 +150,9 @@ static const char *type2string(enum connman_device_type type) return "gps"; case CONNMAN_DEVICE_TYPE_CELLULAR: return "cellular"; + case CONNMAN_DEVICE_TYPE_GADGET: + return "gadget"; + } return NULL; @@ -171,6 +177,9 @@ enum connman_service_type __connman_device_get_service_type(struct connman_devic return CONNMAN_SERVICE_TYPE_BLUETOOTH; case CONNMAN_DEVICE_TYPE_CELLULAR: return CONNMAN_SERVICE_TYPE_CELLULAR; + case CONNMAN_DEVICE_TYPE_GADGET: + return CONNMAN_SERVICE_TYPE_GADGET; + } return CONNMAN_SERVICE_TYPE_UNKNOWN; @@ -482,6 +491,9 @@ struct connman_device *connman_device_create(const char *node, case CONNMAN_DEVICE_TYPE_CELLULAR: device->scan_interval = 0; break; + case CONNMAN_DEVICE_TYPE_GADGET: + device->scan_interval = 0; + break; } device->networks = g_hash_table_new_full(g_str_hash, g_str_equal, diff --git a/src/element.c b/src/element.c index 5d74bdaf..a4230b7c 100644 --- a/src/element.c +++ b/src/element.c @@ -205,6 +205,7 @@ struct connman_service *__connman_element_get_service(struct connman_element *el case CONNMAN_DEVICE_TYPE_UNKNOWN: case CONNMAN_DEVICE_TYPE_VENDOR: case CONNMAN_DEVICE_TYPE_GPS: + case CONNMAN_DEVICE_TYPE_GADGET: break; case CONNMAN_DEVICE_TYPE_ETHERNET: case CONNMAN_DEVICE_TYPE_WIFI: @@ -290,6 +291,7 @@ static gboolean request_scan(GNode *node, gpointer user_data) case CONNMAN_SERVICE_TYPE_CELLULAR: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: return FALSE; case CONNMAN_SERVICE_TYPE_WIFI: case CONNMAN_SERVICE_TYPE_WIMAX: @@ -334,6 +336,7 @@ static gboolean enable_technology(GNode *node, gpointer user_data) 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: @@ -386,6 +389,7 @@ static gboolean disable_technology(GNode *node, gpointer user_data) 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: @@ -470,6 +470,7 @@ struct connman_device *connman_inet_create_device(int index) g_free(devname); return NULL; case CONNMAN_DEVICE_TYPE_ETHERNET: + case CONNMAN_DEVICE_TYPE_GADGET: case CONNMAN_DEVICE_TYPE_WIFI: case CONNMAN_DEVICE_TYPE_WIMAX: name = index2ident(index, ""); @@ -493,6 +494,7 @@ struct connman_device *connman_inet_create_device(int index) case CONNMAN_DEVICE_TYPE_GPS: break; case CONNMAN_DEVICE_TYPE_ETHERNET: + case CONNMAN_DEVICE_TYPE_GADGET: ident = index2ident(index, NULL); break; case CONNMAN_DEVICE_TYPE_WIFI: diff --git a/src/notifier.c b/src/notifier.c index 7871ffb8..bf6aaa18 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -223,6 +223,7 @@ void __connman_notifier_register(enum connman_service_type type) 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: @@ -245,6 +246,7 @@ void __connman_notifier_unregister(enum connman_service_type type) 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: @@ -267,6 +269,7 @@ void __connman_notifier_enable(enum connman_service_type type) 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: @@ -289,6 +292,7 @@ void __connman_notifier_disable(enum connman_service_type type) 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: @@ -311,6 +315,7 @@ void __connman_notifier_connect(enum connman_service_type type) 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: @@ -333,6 +338,7 @@ void __connman_notifier_disconnect(enum connman_service_type type) 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: @@ -413,6 +419,7 @@ static connman_bool_t technology_supported(enum connman_service_type type) 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: @@ -176,6 +176,10 @@ static void read_uevent(struct interface_data *interface) } else if (strcmp(line + 8, "wimax") == 0) { interface->service_type = CONNMAN_SERVICE_TYPE_WIMAX; interface->device_type = CONNMAN_DEVICE_TYPE_WIMAX; + } else if (strcmp(line + 8, "gadget") == 0) { + interface->service_type = CONNMAN_SERVICE_TYPE_GADGET; + interface->device_type = CONNMAN_DEVICE_TYPE_GADGET; + } else { interface->service_type = CONNMAN_SERVICE_TYPE_UNKNOWN; interface->device_type = CONNMAN_DEVICE_TYPE_UNKNOWN; diff --git a/src/service.c b/src/service.c index aecbe9a9..626cd317 100644 --- a/src/service.c +++ b/src/service.c @@ -172,6 +172,8 @@ const char *__connman_service_type2string(enum connman_service_type type) return "gps"; case CONNMAN_SERVICE_TYPE_VPN: return "vpn"; + case CONNMAN_SERVICE_TYPE_GADGET: + return "gadget"; } return NULL; @@ -677,6 +679,7 @@ static void passphrase_changed(struct connman_service *service) case CONNMAN_SERVICE_TYPE_CELLULAR: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: return; case CONNMAN_SERVICE_TYPE_WIFI: required = FALSE; @@ -728,6 +731,7 @@ static void apn_changed(struct connman_service *service) case CONNMAN_SERVICE_TYPE_WIFI: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: return; case CONNMAN_SERVICE_TYPE_CELLULAR: break; @@ -1372,6 +1376,7 @@ static void append_properties(DBusMessageIter *dict, dbus_bool_t limited, case CONNMAN_SERVICE_TYPE_SYSTEM: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: break; case CONNMAN_SERVICE_TYPE_CELLULAR: connman_dbus_dict_append_basic(dict, "Roaming", @@ -2788,6 +2793,7 @@ static gint service_compare(gconstpointer a, gconstpointer b, case CONNMAN_SERVICE_TYPE_ETHERNET: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: break; case CONNMAN_SERVICE_TYPE_WIFI: return 1; @@ -3224,6 +3230,7 @@ int __connman_service_connect(struct connman_service *service) case CONNMAN_SERVICE_TYPE_UNKNOWN: case CONNMAN_SERVICE_TYPE_SYSTEM: case CONNMAN_SERVICE_TYPE_GPS: + case CONNMAN_SERVICE_TYPE_GADGET: return -EINVAL; case CONNMAN_SERVICE_TYPE_ETHERNET: case CONNMAN_SERVICE_TYPE_WIMAX: @@ -4047,6 +4054,7 @@ struct connman_service * __connman_service_create_from_network(struct connman_ne case CONNMAN_SERVICE_TYPE_BLUETOOTH: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: service->autoconnect = FALSE; break; case CONNMAN_SERVICE_TYPE_WIFI: @@ -4259,6 +4267,7 @@ static int service_load(struct connman_service *service) case CONNMAN_SERVICE_TYPE_ETHERNET: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: break; case CONNMAN_SERVICE_TYPE_WIFI: if (service->name == NULL) { @@ -4456,6 +4465,7 @@ update: case CONNMAN_SERVICE_TYPE_ETHERNET: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: break; case CONNMAN_SERVICE_TYPE_WIFI: if (service->network) { diff --git a/src/session.c b/src/session.c index 9264c0cc..49aed258 100644 --- a/src/session.c +++ b/src/session.c @@ -86,6 +86,7 @@ static char *service2bearer(enum connman_service_type type) case CONNMAN_SERVICE_TYPE_SYSTEM: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: return NULL; } diff --git a/src/technology.c b/src/technology.c index d698ee98..a65136a1 100644 --- a/src/technology.c +++ b/src/technology.c @@ -120,6 +120,7 @@ void __connman_technology_add_interface(enum connman_service_type type, case CONNMAN_SERVICE_TYPE_CELLULAR: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: break; } @@ -157,6 +158,7 @@ void __connman_technology_remove_interface(enum connman_service_type type, case CONNMAN_SERVICE_TYPE_CELLULAR: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: break; } @@ -302,6 +304,7 @@ static const char *get_name(enum connman_service_type type) case CONNMAN_SERVICE_TYPE_SYSTEM: case CONNMAN_SERVICE_TYPE_GPS: case CONNMAN_SERVICE_TYPE_VPN: + case CONNMAN_SERVICE_TYPE_GADGET: break; case CONNMAN_SERVICE_TYPE_ETHERNET: return "Wired"; |