diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-10-14 18:05:16 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-10-14 18:05:16 +0200 |
commit | 4fe64c1ea26c8d0d5c2d51c495a83824613cf2e4 (patch) | |
tree | 3d03b520b48814db2099fd0fd09c1c3cecdc7a90 /include | |
parent | 0af74f53a3dfd5d4aa93326d5900b8562b019687 (diff) | |
download | connman-4fe64c1ea26c8d0d5c2d51c495a83824613cf2e4.tar.gz connman-4fe64c1ea26c8d0d5c2d51c495a83824613cf2e4.tar.bz2 connman-4fe64c1ea26c8d0d5c2d51c495a83824613cf2e4.zip |
Add first step towards providing device abstraction
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 2 | ||||
-rw-r--r-- | include/device.h | 83 |
2 files changed, 84 insertions, 1 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index 76057be1..74a8cb78 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -2,7 +2,7 @@ includedir = @includedir@/connman include_HEADERS = log.h plugin.h security.h driver.h element.h property.h \ - rtnl.h dbus.h + device.h rtnl.h dbus.h MAINTAINERCLEANFILES = Makefile.in diff --git a/include/device.h b/include/device.h new file mode 100644 index 00000000..09d28561 --- /dev/null +++ b/include/device.h @@ -0,0 +1,83 @@ +/* + * + * Connection Manager + * + * Copyright (C) 2007-2008 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __CONNMAN_DEVICE_H +#define __CONNMAN_DEVICE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <connman/element.h> + +/** + * SECTION:driver + * @title: Driver premitives + * @short_description: Functions for registering drivers + */ + +enum connman_device_type { + CONNMAN_DEVICE_TYPE_UNKNOWN = CONNMAN_ELEMENT_SUBTYPE_UNKNOWN, + CONNMAN_DEVICE_TYPE_FAKE = CONNMAN_ELEMENT_SUBTYPE_FAKE, + CONNMAN_DEVICE_TYPE_ETHERNET = CONNMAN_ELEMENT_SUBTYPE_ETHERNET, + CONNMAN_DEVICE_TYPE_WIFI = CONNMAN_ELEMENT_SUBTYPE_WIFI, + CONNMAN_DEVICE_TYPE_WIMAX = CONNMAN_ELEMENT_SUBTYPE_WIMAX, + CONNMAN_DEVICE_TYPE_MODEM = CONNMAN_ELEMENT_SUBTYPE_MODEM, + CONNMAN_DEVICE_TYPE_BLUETOOTH = CONNMAN_ELEMENT_SUBTYPE_BLUETOOTH, +}; + +enum connman_device_state { + CONNMAN_DEVICE_STATE_UNKNOWN = 0, + CONNMAN_DEVICE_STATE_OFF = 1, +}; + +struct connman_device_driver; + +struct connman_device { + struct connman_element *element; + enum connman_device_state state; + + struct connman_device_driver *driver; + void *driver_data; + + GSList *networks; +}; + +extern int connman_device_set_enabled(struct connman_device *device, + gboolean enabled); + +struct connman_device_driver { + const char *name; + enum connman_device_type type; + int priority; + int (*probe) (struct connman_device *device); + void (*remove) (struct connman_device *device); + int (*scan) (struct connman_device *device); +}; + +extern int connman_device_driver_register(struct connman_device_driver *driver); +extern void connman_device_driver_unregister(struct connman_device_driver *driver); + +#ifdef __cplusplus +} +#endif + +#endif /* __CONNMAN_DEVICE_H */ |