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


Ignore:
Timestamp:
2017-10-25T14:36:20Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2cf28b9
Parents:
47ab89e
Message:

xhci: moved speed back to HC, keeping usb speed → port speed mapping

File:
1 edited

Legend:

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

    r47ab89e rf668d60  
    5353 */
    5454#define PSI_TO_BPS(psie, psim) (((uint64_t) psim) << (10 * psie))
    55 #define PORT_SPEED(mjr, psie, psim) { \
     55#define PORT_SPEED(usb, mjr, psie, psim) { \
    5656        .name = "USB ", \
    5757        .major = mjr, \
    5858        .minor = 0, \
     59        .usb_speed = USB_SPEED_##usb, \
    5960        .rx_bps = PSI_TO_BPS(psie, psim), \
    6061        .tx_bps = PSI_TO_BPS(psie, psim) \
    6162}
    62 static const xhci_port_speed_t ps_default_full  = PORT_SPEED(2, 2, 12);
    63 static const xhci_port_speed_t ps_default_low   = PORT_SPEED(2, 1, 1500);
    64 static const xhci_port_speed_t ps_default_high  = PORT_SPEED(2, 2, 480);
    65 static const xhci_port_speed_t ps_default_super = PORT_SPEED(3, 3, 5);
     63static const xhci_port_speed_t ps_default_full  = PORT_SPEED(FULL, 2, 2, 12);
     64static const xhci_port_speed_t ps_default_low   = PORT_SPEED(LOW, 2, 1, 1500);
     65static const xhci_port_speed_t ps_default_high  = PORT_SPEED(HIGH, 2, 2, 480);
     66static const xhci_port_speed_t ps_default_super = PORT_SPEED(SUPER, 3, 3, 5);
    6667
    6768/**
     
    7374        xhci_sp_name_t name;
    7475
    75         xhci_port_speed_t *speeds = hc->rh.speeds;
     76        xhci_port_speed_t *speeds = hc->speeds;
    7677
    7778        for (xhci_extcap_t *ec = hc->xecp; ec; ec = xhci_extcap_next(ec)) {
     
    106107                                        speeds[2] = ps_default_low;
    107108                                        speeds[3] = ps_default_high;
     109
     110                                        hc->speed_to_psiv[USB_SPEED_FULL] = 1;
     111                                        hc->speed_to_psiv[USB_SPEED_LOW] = 2;
     112                                        hc->speed_to_psiv[USB_SPEED_HIGH] = 3;
    108113                                } else if (major == 3) {
    109114                                        speeds[4] = ps_default_super;
     115                                        hc->speed_to_psiv[USB_SPEED_SUPER] = 4;
    110116                                } else {
    111117                                        return EINVAL;
     
    124130                                        speeds[psiv].minor = minor;
    125131                                        str_ncpy(speeds[psiv].name, 4, name.str, 4);
     132                                        speeds[psiv].usb_speed = USB_SPEED_MAX;
    126133
    127134                                        uint64_t bps = PSI_TO_BPS(psie, psim);
Note: See TracChangeset for help on using the changeset viewer.