Changeset d37514e in mainline for uspace/drv/bus/usb/xhci/bus.c


Ignore:
Timestamp:
2017-10-28T15:41:12Z (6 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c910ecf
Parents:
d46ceb2b
Message:

Routing fun_online and _offline through the USB bus. Added appropriate stubs and ops.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/bus.c

    rd46ceb2b rd37514e  
    280280}
    281281
     282static int online_device(bus_t *bus_base, hcd_t *hcd, device_t *dev_base)
     283{
     284        int err;
     285
     286        xhci_hc_t *hc = hcd_get_driver_data(hcd);
     287        assert(hc);
     288
     289        xhci_bus_t *bus = bus_to_xhci_bus(bus_base);
     290        assert(bus);
     291
     292        xhci_device_t *dev = xhci_device_get(dev_base);
     293        assert(dev);
     294
     295        // TODO: Prepare the device for use. Reset? Configure?
     296
     297        if ((err = ddf_fun_online(dev_base->fun))) {
     298                return err;
     299        }
     300
     301        return EOK;
     302}
     303
     304static int offline_device(bus_t *bus_base, hcd_t *hcd, device_t *dev_base)
     305{
     306        int err;
     307
     308        xhci_hc_t *hc = hcd_get_driver_data(hcd);
     309        assert(hc);
     310
     311        xhci_bus_t *bus = bus_to_xhci_bus(bus_base);
     312        assert(bus);
     313
     314        xhci_device_t *dev = xhci_device_get(dev_base);
     315        assert(dev);
     316
     317        /* Tear down all drivers working with the device. */
     318        if ((err = ddf_fun_offline(dev_base->fun))) {
     319                return err;
     320        }
     321
     322        // TODO: We want to keep the device addressed. Deconfigure?
     323
     324        return EOK;
     325}
     326
    282327static endpoint_t *create_endpoint(bus_t *base)
    283328{
     
    442487        .remove_device = remove_device,
    443488
     489        .online_device = online_device,
     490        .offline_device = offline_device,
     491
    444492        .create_endpoint = create_endpoint,
    445493        .destroy_endpoint = destroy_endpoint,
Note: See TracChangeset for help on using the changeset viewer.