diff options
author | merge <null@invalid> | 2009-01-22 13:55:32 +0000 |
---|---|---|
committer | Andy Green <agreen@octopus.localdomain> | 2009-01-22 13:55:32 +0000 |
commit | aa6f5ffbdba45aa8e19e5048648fc6c7b25376d3 (patch) | |
tree | fbb786d0ac6f8a774fd834e9ce951197e60fbffa /drivers/staging/meilhaus/medlist.h | |
parent | f2d78193eae5dccd3d588d2c8ea0866efc368332 (diff) |
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040
stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch
mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage:
From: Andy Green <andy@openmoko.com>
fix-stray-endmenu.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/staging/meilhaus/medlist.h')
-rw-r--r-- | drivers/staging/meilhaus/medlist.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/drivers/staging/meilhaus/medlist.h b/drivers/staging/meilhaus/medlist.h new file mode 100644 index 00000000000..091c11e48ed --- /dev/null +++ b/drivers/staging/meilhaus/medlist.h @@ -0,0 +1,91 @@ +/** + * @file me_dlist.h + * + * @brief Provides the device list class. + * @note Copyright (C) 2007 Meilhaus Electronic GmbH (support@meilhaus.de) + * @author Guenter Gebhardt + */ + +#ifndef _ME_DLIST_H_ +#define _ME_DLIST_H_ + +#include <linux/list.h> + +#include "medevice.h" + +#ifdef __KERNEL__ + +/** + * @brief The device list container. + */ +typedef struct me_dlist { + struct list_head head; /**< The head of the internal list. */ + unsigned int n; /**< The number of devices in the list. */ +} me_dlist_t; + +/** + * @brief Queries the number of devices currently inside the list. + * + * @param dlist The device list to query. + * @param[out] number The number of devices. + * + * @return ME-iDS error code. + */ +int me_dlist_query_number_devices(struct me_dlist *dlist, int *number); + +/** + * @brief Returns the number of devices currently inside the list. + * + * @param dlist The device list to query. + * + * @return The number of devices in the list. + */ +unsigned int me_dlist_get_number_devices(struct me_dlist *dlist); + +/** + * @brief Get a device by index. + * + * @param dlist The device list to query. + * @param index The index of the device to get in the list. + * + * @return The device at index if available.\n + * NULL if the index is out of range. + */ +me_device_t *me_dlist_get_device(struct me_dlist *dlist, unsigned int index); + +/** + * @brief Adds a device to the tail of the list. + * + * @param dlist The device list to add a device to. + * @param device The device to add to the list. + */ +void me_dlist_add_device_tail(struct me_dlist *dlist, me_device_t * device); + +/** + * @brief Removes a device from the tail of the list. + * + * @param dlist The device list. + * + * @return Pointer to the removed subdeivce.\n + * NULL in cases where the list was empty. + */ +me_device_t *me_dlist_del_device_tail(struct me_dlist *dlist); + +/** + * @brief Initializes a device list structure. + * + * @param lock The device list structure to initialize. + * @return 0 on success. + */ +int me_dlist_init(me_dlist_t * dlist); + +/** + * @brief Deinitializes a device list structure and destructs every device in it. + * + * @param dlist The device list structure to deinitialize. + * @return 0 on success. + */ +void me_dlist_deinit(me_dlist_t * dlist); + +#endif +#endif |