Changeset 8300c72 in mainline for uspace/lib/device/src/devman.c


Ignore:
Timestamp:
2025-03-03T22:58:05Z (13 hours ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
77a0119
Parents:
f35749e
Message:

Quiesce devices before proceeding with shutdown.

Only implemented for e1k, uhci and xhci.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/device/src/devman.c

    rf35749e r8300c72  
    343343}
    344344
     345errno_t devman_drv_fun_quiesce(devman_handle_t funh)
     346{
     347        async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_DRIVER);
     348        if (exch == NULL)
     349                return ENOMEM;
     350
     351        errno_t retval = async_req_1_0(exch, DEVMAN_DRV_FUN_QUIESCE, funh);
     352
     353        devman_exchange_end(exch);
     354        return retval;
     355}
     356
    345357errno_t devman_drv_fun_wait_stable(devman_handle_t funh)
    346358{
     
    506518}
    507519
     520errno_t devman_fun_quiesce(devman_handle_t funh)
     521{
     522        async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_CLIENT);
     523        if (exch == NULL)
     524                return ENOMEM;
     525
     526        errno_t retval = async_req_1_0(exch, DEVMAN_FUN_QUIESCE, funh);
     527
     528        devman_exchange_end(exch);
     529        return retval;
     530}
     531
    508532static errno_t devman_get_handles_once(sysarg_t method, sysarg_t arg1,
    509533    devman_handle_t *handle_buf, size_t buf_size, size_t *act_size)
     
    632656}
    633657
     658errno_t devman_quiesce_devices(const char *path)
     659{
     660        devman_handle_t funh;
     661        errno_t rc;
     662
     663        funh = 0;
     664        rc = devman_fun_get_handle(path, &funh, 0);
     665        if (rc != EOK)
     666                return rc;
     667
     668        return devman_fun_quiesce(funh);
     669}
     670
    634671errno_t devman_get_drivers(devman_handle_t **drvs,
    635672    size_t *count)
Note: See TracChangeset for help on using the changeset viewer.