Changeset 692c40cb in mainline for uspace/lib/c/generic/devman.c


Ignore:
Timestamp:
2010-05-28T09:04:37Z (15 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5159ae9
Parents:
c9f3b45c
Message:

Introduce device classes.Device class specifies functional type of the device. Device classes are identified by their string names (actually device class is just a string value). Device classes can be dynamically added. A device can be added to any number of classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/devman.c

    rc9f3b45c r692c40cb  
    180180}
    181181
     182int devman_add_device_to_class(device_handle_t dev_handle, const char *class_name)
     183{
     184        int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING);
     185       
     186        if (phone < 0)
     187                return phone;
     188       
     189        async_serialize_start();
     190        ipc_call_t answer;
     191        aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, dev_handle, &answer);
     192       
     193        ipcarg_t retval = async_data_write_start(phone, class_name, str_size(class_name));
     194        if (retval != EOK) {
     195                async_wait_for(req, NULL);
     196                async_serialize_end();
     197                return retval;
     198        }
     199       
     200        async_wait_for(req, &retval);
     201        async_serialize_end();
     202       
     203        return retval; 
     204}
     205
    182206void devman_hangup_phone(devman_interface_t iface)
    183207{
Note: See TracChangeset for help on using the changeset viewer.