Changeset d347b53 in mainline for uspace/srv/devman/devman.h


Ignore:
Timestamp:
2010-03-21T19:33:58Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
66babbd
Parents:
bda60d9
Message:

child device registration - parts of code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.h

    rbda60d9 rd347b53  
    141141// Drivers
    142142
     143/**
     144 * Initialize the list of device driver's.
     145 *
     146 * @param drv_list the list of device driver's.
     147 *
     148 */
    143149static inline void init_driver_list(driver_list_t *drv_list)
    144150{
     
    165171void initialize_running_driver(driver_t *driver);
    166172
    167 
     173/**
     174 * Initialize device driver structure.
     175 *
     176 * @param drv the device driver structure.
     177 *
     178 */
    168179static inline void init_driver(driver_t *drv)
    169180{
     
    176187}
    177188
     189/**
     190 * Device driver structure clean-up.
     191 *
     192 * @param drv the device driver structure.
     193 */
    178194static inline void clean_driver(driver_t *drv)
    179195{
     
    188204}
    189205
     206/**
     207 * Delete device driver structure.
     208 *
     209 *  @param drv the device driver structure.*
     210 */
    190211static inline void delete_driver(driver_t *drv)
    191212{
     
    197218
    198219// Device nodes
    199 
     220/**
     221 * Create a new device node.
     222 *
     223 * @return a device node structure.
     224 *
     225 */
    200226static inline node_t * create_dev_node()
    201227{
     
    207233        list_initialize(&res->children);
    208234        list_initialize(&res->match_ids.ids);
     235        fibril_mutex_initialize(&res->children_mutex);
    209236       
    210237        return res;
    211238}
    212239
     240static inline void delete_dev_node(node_t *node)
     241{
     242        assert(list_empty(&node->children) && NULL == node->parent && NULL == node->drv);
     243       
     244        clean_match_ids(&node->match_ids);
     245        free_not_null(node->name);
     246        free_not_null(node->pathname);
     247        free(node);     
     248}
     249
     250/**
     251 * Find the device node structure of the device witch has the specified handle.
     252 *
     253 * @param tree the device tree where we look for the device node.
     254 * @param handle the handle of the device.
     255 * @return the device node.
     256 */
    213257static inline node_t * find_dev_node(dev_tree_t *tree, long handle)
    214258{
Note: See TracChangeset for help on using the changeset viewer.