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


Ignore:
Timestamp:
2018-01-19T15:25:20Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
861b5d6
Parents:
c7d5189
Message:

xhci: setup also slot context where needed

File:
1 edited

Legend:

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

    rc7d5189 ra4e7e6e1  
    8787
    8888        /* Address device */
    89         if ((err = hc_address_device(bus->hc, dev, ep0)))
     89        if ((err = hc_address_device(dev, ep0)))
    9090                goto err_added;
    9191
     
    128128        xhci_setup_endpoint_context(ep0, &ep_ctx);
    129129
    130         if ((err = hc_update_endpoint(hc, dev->slot_id, 0, &ep_ctx)))
     130        if ((err = hc_update_endpoint(dev, 0, &ep_ctx)))
    131131                return err;
    132132
     
    238238
    239239        /* Transition the device from the Addressed to the Configured state. */
    240         if ((err = hc_configure_device(bus->hc, dev->slot_id))) {
     240        if ((err = hc_configure_device(dev))) {
    241241                usb_log_warning("Failed to configure device " XHCI_DEV_FMT ".", XHCI_DEV_ARGS(*dev));
    242242                return err;
     
    263263
    264264        /* Issue one HC command to simultaneously drop all endpoints except zero. */
    265         if ((err = hc_deconfigure_device(bus->hc, dev->slot_id))) {
     265        if ((err = hc_deconfigure_device(dev))) {
    266266                usb_log_warning("Failed to deconfigure device " XHCI_DEV_FMT ".",
    267267                    XHCI_DEV_ARGS(*dev));
     
    312312{
    313313        int err;
    314         xhci_bus_t *bus = bus_to_xhci_bus(endpoint_get_bus(ep_base));
    315314        xhci_endpoint_t *ep = xhci_endpoint_get(ep_base);
    316315        xhci_device_t *dev = xhci_device_get(ep_base->device);
     
    319318        xhci_setup_endpoint_context(ep, &ep_ctx);
    320319
    321         if ((err = hc_add_endpoint(bus->hc, dev->slot_id, xhci_endpoint_index(ep), &ep_ctx)))
     320        if ((err = hc_add_endpoint(dev, xhci_endpoint_index(ep), &ep_ctx)))
    322321                return err;
    323322
     
    330329static int endpoint_abort(endpoint_t *ep)
    331330{
    332         xhci_bus_t *bus = bus_to_xhci_bus(endpoint_get_bus(ep));
    333331        xhci_device_t *dev = xhci_device_get(ep->device);
    334332
     
    337335        if (ep->active_batch) {
    338336                if (dev->slot_id) {
    339                         const int err = hc_stop_endpoint(bus->hc, dev->slot_id, xhci_endpoint_dci(xhci_endpoint_get(ep)));
     337                        const int err = hc_stop_endpoint(dev, xhci_endpoint_dci(xhci_endpoint_get(ep)));
    340338                        if (err) {
    341339                                usb_log_warning("Failed to stop endpoint %u of device " XHCI_DEV_FMT ": %s",
     
    370368{
    371369        int err;
    372         xhci_bus_t *bus = bus_to_xhci_bus(endpoint_get_bus(ep_base));
    373370        xhci_endpoint_t *ep = xhci_endpoint_get(ep_base);
    374371        xhci_device_t *dev = xhci_device_get(ep_base->device);
     
    379376        if (dev->slot_id) {
    380377
    381                 if ((err = hc_drop_endpoint(bus->hc, dev->slot_id, xhci_endpoint_index(ep)))) {
     378                if ((err = hc_drop_endpoint(dev, xhci_endpoint_index(ep)))) {
    382379                        usb_log_error("Failed to drop endpoint " XHCI_EP_FMT ": %s", XHCI_EP_ARGS(*ep), str_error(err));
    383380                }
Note: See TracChangeset for help on using the changeset viewer.