Changeset 0b5a4131 in mainline


Ignore:
Timestamp:
2010-11-18T18:10:11Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c63e70c
Parents:
991f645
Message:

Rename device_handle_t to devman_handle_t and make it explicitly clear that
device_handle_t is a handle understood by devman.

Location:
uspace
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/test_serial/test_serial.c

    r991f645 r0b5a4131  
    6969        int res;
    7070        res = devman_get_phone(DEVMAN_CLIENT, IPC_FLAG_BLOCKING);
    71         device_handle_t handle;
     71        devman_handle_t handle;
    7272       
    7373        res = devman_device_get_handle("/hw/pci0/00:01.0/com1", &handle,
  • uspace/lib/c/generic/devman.c

    r991f645 r0b5a4131  
    141141
    142142int devman_child_device_register(
    143         const char *name, match_id_list_t *match_ids, device_handle_t parent_handle, device_handle_t *handle)
     143        const char *name, match_id_list_t *match_ids, devman_handle_t parent_handle, devman_handle_t *handle)
    144144{               
    145145        int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING);
     
    180180}
    181181
    182 int devman_add_device_to_class(device_handle_t dev_handle, const char *class_name)
     182int devman_add_device_to_class(devman_handle_t devman_handle, const char *class_name)
    183183{
    184184        int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING);
     
    189189        async_serialize_start();
    190190        ipc_call_t answer;
    191         aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, dev_handle, &answer);
     191        aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, devman_handle, &answer);
    192192       
    193193        ipcarg_t retval = async_data_write_start(phone, class_name, str_size(class_name));
     
    224224}
    225225
    226 int devman_device_connect(device_handle_t handle, unsigned int flags)
     226int devman_device_connect(devman_handle_t handle, unsigned int flags)
    227227{
    228228        int phone;
     
    239239}
    240240
    241 int devman_parent_device_connect(device_handle_t handle, unsigned int flags)
     241int devman_parent_device_connect(devman_handle_t handle, unsigned int flags)
    242242{
    243243        int phone;
     
    254254}
    255255
    256 int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags)
     256int devman_device_get_handle(const char *pathname, devman_handle_t *handle, unsigned int flags)
    257257{
    258258        int phone = devman_get_phone(DEVMAN_CLIENT, flags);
     
    280280        if (retval != EOK) {
    281281                if (handle != NULL)
    282                         *handle = (device_handle_t) -1;
     282                        *handle = (devman_handle_t) -1;
    283283                return retval;
    284284        }
    285285       
    286286        if (handle != NULL)
    287                 *handle = (device_handle_t) IPC_GET_ARG1(answer);
     287                *handle = (devman_handle_t) IPC_GET_ARG1(answer);
    288288       
    289289        return retval;
  • uspace/lib/c/include/devman.h

    r991f645 r0b5a4131  
    4646
    4747int devman_driver_register(const char *, async_client_conn_t);
    48 int devman_child_device_register(const char *, match_id_list_t *, device_handle_t, device_handle_t *);
     48int devman_child_device_register(const char *, match_id_list_t *, devman_handle_t, devman_handle_t *);
    4949
    50 int devman_device_connect(device_handle_t handle, unsigned int flags);
    51 int devman_parent_device_connect(device_handle_t handle, unsigned int flags);
     50int devman_device_connect(devman_handle_t handle, unsigned int flags);
     51int devman_parent_device_connect(devman_handle_t handle, unsigned int flags);
    5252
    53 int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags);
     53int devman_device_get_handle(const char *pathname, devman_handle_t *handle, unsigned int flags);
    5454
    55 int devman_add_device_to_class(device_handle_t dev_handle, const char *class_name);
     55int devman_add_device_to_class(devman_handle_t devman_handle, const char *class_name);
    5656
    5757#endif
  • uspace/lib/c/include/ipc/devman.h

    r991f645 r0b5a4131  
    4242#define DEVMAN_NAME_MAXLEN 256
    4343
    44 typedef ipcarg_t device_handle_t;
     44typedef ipcarg_t devman_handle_t;
    4545
    4646/** Ids of device models used for device-to-driver matching.
  • uspace/lib/drv/generic/driver.c

    r991f645 r0b5a4131  
    139139}
    140140
    141 static device_t * driver_get_device(link_t *devices, device_handle_t handle)
     141static device_t * driver_get_device(link_t *devices, devman_handle_t handle)
    142142{
    143143        device_t *dev = NULL;
     
    163163        int res = EOK;
    164164       
    165         device_handle_t dev_handle =  IPC_GET_ARG1(*icall);
     165        devman_handle_t dev_handle =  IPC_GET_ARG1(*icall);
    166166        device_t *dev = create_device();
    167167        dev->handle = dev_handle;
     
    221221         * the device to which the client connected.
    222222         */
    223         device_handle_t handle = IPC_GET_ARG2(*icall);
     223        devman_handle_t handle = IPC_GET_ARG2(*icall);
    224224        device_t *dev = driver_get_device(&devices, handle);
    225225
  • uspace/lib/drv/include/driver.h

    r991f645 r0b5a4131  
    118118         * device manager).
    119119         */
    120         device_handle_t handle;
     120        devman_handle_t handle;
    121121       
    122122        /**
  • uspace/srv/devman/devman.c

    r991f645 r0b5a4131  
    5252{
    5353        node_t *dev = hash_table_get_instance(item, node_t, devman_link);
    54         return (dev->handle == (device_handle_t) key[0]);
     54        return (dev->handle == (devman_handle_t) key[0]);
    5555}
    5656
     
    782782 * @return              The device node.
    783783 */
    784 node_t *find_dev_node_no_lock(dev_tree_t *tree, device_handle_t handle)
     784node_t *find_dev_node_no_lock(dev_tree_t *tree, devman_handle_t handle)
    785785{
    786786        unsigned long key = handle;
     
    795795 * @return              The device node.
    796796 */
    797 node_t *find_dev_node(dev_tree_t *tree, device_handle_t handle)
     797node_t *find_dev_node(dev_tree_t *tree, devman_handle_t handle)
    798798{
    799799        node_t *node = NULL;
  • uspace/srv/devman/devman.h

    r991f645 r0b5a4131  
    121121struct node {
    122122        /** The global unique identifier of the device. */
    123         device_handle_t handle;
     123        devman_handle_t handle;
    124124        /** The name of the device specified by its parent. */
    125125        char *name;
     
    179179         * manner.
    180180         */
    181         device_handle_t current_handle;
     181        devman_handle_t current_handle;
    182182       
    183183        /** Synchronize access to the device tree. */
     
    309309extern void delete_dev_node(node_t *node);
    310310extern node_t *find_dev_node_no_lock(dev_tree_t *tree,
    311     device_handle_t handle);
    312 extern node_t *find_dev_node(dev_tree_t *tree, device_handle_t handle);
     311    devman_handle_t handle);
     312extern node_t *find_dev_node(dev_tree_t *tree, devman_handle_t handle);
    313313extern node_t *find_dev_node_by_path(dev_tree_t *, char *);
    314314extern node_t *find_node_child(node_t *, const char *);
  • uspace/srv/devman/main.c

    r991f645 r0b5a4131  
    202202static void devman_add_child(ipc_callid_t callid, ipc_call_t *call)
    203203{
    204         device_handle_t parent_handle = IPC_GET_ARG1(*call);
     204        devman_handle_t parent_handle = IPC_GET_ARG1(*call);
    205205        ipcarg_t match_count = IPC_GET_ARG2(*call);
    206206        dev_tree_t *tree = &device_tree;
     
    271271static void devman_add_device_to_class(ipc_callid_t callid, ipc_call_t *call)
    272272{
    273         device_handle_t handle = IPC_GET_ARG1(*call);
     273        devman_handle_t handle = IPC_GET_ARG1(*call);
    274274       
    275275        /* Get class name. */
     
    414414    bool drv_to_parent)
    415415{
    416         device_handle_t handle = IPC_GET_ARG2(*icall);
     416        devman_handle_t handle = IPC_GET_ARG2(*icall);
    417417       
    418418        node_t *dev = find_dev_node(&device_tree, handle);
Note: See TracChangeset for help on using the changeset viewer.