Changeset f668d60 in mainline for uspace/drv/bus/usb/xhci/hc.c
- Timestamp:
- 2017-10-25T14:36:20Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2cf28b9
- Parents:
- 47ab89e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hc.c
r47ab89e rf668d60 53 53 */ 54 54 #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) { \ 56 56 .name = "USB ", \ 57 57 .major = mjr, \ 58 58 .minor = 0, \ 59 .usb_speed = USB_SPEED_##usb, \ 59 60 .rx_bps = PSI_TO_BPS(psie, psim), \ 60 61 .tx_bps = PSI_TO_BPS(psie, psim) \ 61 62 } 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);63 static const xhci_port_speed_t ps_default_full = PORT_SPEED(FULL, 2, 2, 12); 64 static const xhci_port_speed_t ps_default_low = PORT_SPEED(LOW, 2, 1, 1500); 65 static const xhci_port_speed_t ps_default_high = PORT_SPEED(HIGH, 2, 2, 480); 66 static const xhci_port_speed_t ps_default_super = PORT_SPEED(SUPER, 3, 3, 5); 66 67 67 68 /** … … 73 74 xhci_sp_name_t name; 74 75 75 xhci_port_speed_t *speeds = hc-> rh.speeds;76 xhci_port_speed_t *speeds = hc->speeds; 76 77 77 78 for (xhci_extcap_t *ec = hc->xecp; ec; ec = xhci_extcap_next(ec)) { … … 106 107 speeds[2] = ps_default_low; 107 108 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; 108 113 } else if (major == 3) { 109 114 speeds[4] = ps_default_super; 115 hc->speed_to_psiv[USB_SPEED_SUPER] = 4; 110 116 } else { 111 117 return EINVAL; … … 124 130 speeds[psiv].minor = minor; 125 131 str_ncpy(speeds[psiv].name, 4, name.str, 4); 132 speeds[psiv].usb_speed = USB_SPEED_MAX; 126 133 127 134 uint64_t bps = PSI_TO_BPS(psie, psim);
Note:
See TracChangeset
for help on using the changeset viewer.