Changeset d33dc780 in mainline
- Timestamp:
- 2017-10-29T10:56:02Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ef1a3a8
- Parents:
- 9620a54
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/rh.c
r9620a54 rd33dc780 68 68 rh->hc = hc; 69 69 rh->max_ports = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_PORTS); 70 rh->devices = (xhci_device_t **) calloc(rh->max_ports, sizeof(xhci_device_t *));70 rh->devices_by_port = (xhci_device_t **) calloc(rh->max_ports, sizeof(xhci_device_t *)); 71 71 rh->hc_device = device; 72 72 … … 90 90 assert(rh->hc_device); 91 91 92 assert(rh->devices [port_id - 1] == NULL);92 assert(rh->devices_by_port[port_id - 1] == NULL); 93 93 94 94 xhci_bus_t *bus = &rh->hc->bus; … … 126 126 fibril_mutex_lock(&rh->device.base.guard); 127 127 list_append(&dev->link, &rh->device.base.devices); 128 rh->devices [port_id - 1] = xhci_dev;128 rh->devices_by_port[port_id - 1] = xhci_dev; 129 129 fibril_mutex_unlock(&rh->device.base.guard); 130 130 … … 180 180 181 181 /* Find XHCI device by the port. */ 182 xhci_device_t *dev = rh->devices [port_id - 1];182 xhci_device_t *dev = rh->devices_by_port[port_id - 1]; 183 183 if (!dev) { 184 184 /* Must be extraneous call. */ … … 192 192 fibril_mutex_lock(&rh->device.base.guard); 193 193 list_remove(&dev->base.link); 194 rh->devices [port_id - 1] = NULL;194 rh->devices_by_port[port_id - 1] = NULL; 195 195 fibril_mutex_unlock(&rh->device.base.guard); 196 196 … … 358 358 usb_log_debug2("Called xhci_rh_fini()."); 359 359 360 free(rh->devices );360 free(rh->devices_by_port); 361 361 362 362 return EOK; -
uspace/drv/bus/usb/xhci/rh.h
r9620a54 rd33dc780 77 77 78 78 /* Device pointers connected to RH ports or NULL. (size is `max_ports`) */ 79 xhci_device_t **devices ;79 xhci_device_t **devices_by_port; 80 80 } xhci_rh_t; 81 81
Note:
See TracChangeset
for help on using the changeset viewer.