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


Ignore:
Timestamp:
2018-01-18T02:05:35Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5bccec3
Parents:
94f8c363
Message:

xhci: rewrite RH to use usb/port

File:
1 edited

Legend:

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

    r94f8c363 ra9fcd73  
    109109                                return ENOTSUP;
    110110                        }
     111
     112                        unsigned offset = XHCI_REG_RD(ec, XHCI_EC_SP_CP_OFF);
     113                        unsigned count = XHCI_REG_RD(ec, XHCI_EC_SP_CP_COUNT);
     114                        xhci_rh_set_ports_protocol(&hc->rh, offset, count, major);
    111115
    112116                        // "Implied" speed
     
    229233        hc->ist = (ist & 0x10 >> 1) * (ist & 0xf);
    230234
    231         if ((err = hc_parse_ec(hc))) {
    232                 pio_disable(hc->reg_base, RNGSZ(hc->mmio_range));
    233                 return err;
    234         }
    235 
    236         return EOK;
     235        if ((err = xhci_rh_init(&hc->rh, hc)))
     236                goto err_pio;
     237
     238        if ((err = hc_parse_ec(hc)))
     239                goto err_rh;
     240
     241        return EOK;
     242
     243err_rh:
     244        xhci_rh_fini(&hc->rh);
     245err_pio:
     246        pio_disable(hc->reg_base, RNGSZ(hc->mmio_range));
     247        return err;
    237248}
    238249
     
    260271                goto err_cmd;
    261272
    262         if ((err = xhci_rh_init(&hc->rh, hc)))
    263                 goto err_bus;
    264 
    265         return EOK;
    266 
    267 err_bus:
    268         xhci_bus_fini(&hc->bus);
     273        return EOK;
     274
    269275err_cmd:
    270276        xhci_fini_commands(hc);
Note: See TracChangeset for help on using the changeset viewer.