Changeset 0892663a in mainline for uspace/drv/bus/usb/ehci/ehci_bus.c
- Timestamp:
- 2018-01-11T04:14:37Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9848c77
- Parents:
- bad4a05
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-11 03:59:03)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-11 04:14:37)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_bus.c
rbad4a05 r0892663a 135 135 } 136 136 137 static int ehci_device_online(device_t *device)138 {139 int err;140 141 /* Allow creation of new endpoints and transfers. */142 usb_log_info("Device(%d): Going online.", device->address);143 fibril_mutex_lock(&device->guard);144 device->online = true;145 fibril_mutex_unlock(&device->guard);146 147 if ((err = ddf_fun_online(device->fun))) {148 return err;149 }150 151 return EOK;152 }153 154 static int ehci_device_offline(device_t *device)155 {156 int err;157 158 /* Tear down all drivers working with the device. */159 if ((err = ddf_fun_offline(device->fun))) {160 return err;161 }162 163 /* At this point, all drivers are assumed to have already terminated164 * in a consistent way. The following code just cleans up hanging165 * transfers if there are any. */166 167 /* Block creation of new endpoints and transfers. */168 usb_log_info("Device(%d): Going offline.", device->address);169 fibril_mutex_lock(&device->guard);170 device->online = false;171 fibril_mutex_unlock(&device->guard);172 173 /* FIXME: Abort all transfers to all endpoints. */174 175 return EOK;176 }177 178 137 static const bus_ops_t ehci_bus_ops = { 179 138 .parent = &usb2_bus_ops, … … 190 149 .batch_destroy = ehci_destroy_batch, 191 150 .batch_schedule = ehci_hc_schedule, 192 .device_online = ehci_device_online,193 .device_offline = ehci_device_offline,194 151 }; 195 152
Note:
See TracChangeset
for help on using the changeset viewer.