Changeset 7969087 in mainline for uspace/lib/c/generic/devman.c


Ignore:
Timestamp:
2013-09-11T10:35:49Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
43dd8028
Parents:
e5556e4a
Message:

devctl load-drv to manually load a driver.

File:
1 edited

Legend:

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

    re5556e4a r7969087  
    598598}
    599599
     600int devman_driver_get_handle(const char *drvname, devman_handle_t *handle)
     601{
     602        async_exch_t *exch;
     603
     604        exch = devman_exchange_begin(DEVMAN_CLIENT);
     605        if (exch == NULL)
     606                return ENOMEM;
     607       
     608        ipc_call_t answer;
     609        aid_t req = async_send_0(exch, DEVMAN_DRIVER_GET_HANDLE, &answer);
     610        sysarg_t retval = async_data_write_start(exch, drvname,
     611            str_size(drvname));
     612       
     613        devman_exchange_end(exch);
     614       
     615        if (retval != EOK) {
     616                async_forget(req);
     617                return retval;
     618        }
     619       
     620        async_wait_for(req, &retval);
     621       
     622        if (retval != EOK) {
     623                if (handle != NULL)
     624                        *handle = (devman_handle_t) -1;
     625               
     626                return retval;
     627        }
     628       
     629        if (handle != NULL)
     630                *handle = (devman_handle_t) IPC_GET_ARG1(answer);
     631       
     632        return retval;
     633}
     634
    600635int devman_driver_get_name(devman_handle_t handle, char *buf, size_t buf_size)
    601636{
     
    622657}
    623658
     659int devman_driver_load(devman_handle_t drvh)
     660{
     661        async_exch_t *exch = devman_exchange_begin(DEVMAN_CLIENT);
     662        if (exch == NULL)
     663                return ENOMEM;
     664       
     665        int rc = async_req_1_0(exch, DEVMAN_DRIVER_LOAD, drvh);
     666       
     667        devman_exchange_end(exch);
     668        return rc;
     669}
     670
    624671/** @}
    625672 */
Note: See TracChangeset for help on using the changeset viewer.