Changeset 763dbcb in mainline
- Timestamp:
- 2014-01-24T20:21:28Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0a751aa
- Parents:
- 5f5321ee
- Location:
- uspace/drv/bus/usb/ehci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_endpoint.c
r5f5321ee r763dbcb 107 107 ehci_endpoint_t *instance = ehci_endpoint_get(ep); 108 108 hc_dequeue_endpoint(hcd->driver.data, ep); 109 endpoint_clear_hc_data(ep); 109 110 if (instance) { 110 111 free32(instance->qh); 111 112 free(instance); 112 113 } 113 endpoint_clear_hc_data(ep);114 114 } 115 115 /** -
uspace/drv/bus/usb/ehci/hc.c
r5f5321ee r763dbcb 176 176 list_initialize(&instance->pending_batches); 177 177 fibril_mutex_initialize(&instance->guard); 178 fibril_condvar_initialize(&instance->async_doorbell); 178 179 179 180 ret = hc_init_memory(instance); … … 230 231 void hc_dequeue_endpoint(hc_t *instance, const endpoint_t *ep) 231 232 { 233 assert(instance); 234 assert(ep); 235 ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep); 236 switch (ep->transfer_type) 237 { 238 case USB_TRANSFER_INTERRUPT: 239 endpoint_list_append_ep(&instance->int_list, ehci_ep); 240 /* Fall through */ 241 case USB_TRANSFER_ISOCHRONOUS: 242 /* NOT SUPPORTED */ 243 return; 244 case USB_TRANSFER_CONTROL: 245 case USB_TRANSFER_BULK: 246 endpoint_list_remove_ep(&instance->async_list, ehci_ep); 247 break; 248 } 249 fibril_mutex_lock(&instance->guard); 250 EHCI_SET(instance->registers->usbcmd, USB_CMD_ASYNC_SCHEDULE_FLAG); 251 fibril_condvar_wait(&instance->async_doorbell, &instance->guard); 252 fibril_mutex_unlock(&instance->guard); 232 253 } 233 254 … … 279 300 if (status & USB_STS_PORT_CHANGE_FLAG) { 280 301 ehci_rh_interrupt(&instance->rh); 302 } 303 if (status & USB_STS_ASYNC_SCHED_FLAG) { 304 fibril_condvar_signal(&instance->async_doorbell); 281 305 } 282 306 } … … 313 337 } 314 338 /* Enable interrupts */ 315 EHCI_WR(instance->registers->usbintr, USB_INTR_PORT_CHANGE_FLAG | USB_INTR_IRQ_FLAG );316 /* Use lower4G segment */339 EHCI_WR(instance->registers->usbintr, USB_INTR_PORT_CHANGE_FLAG | USB_INTR_IRQ_FLAG | USB_INTR_ASYNC_ADVANCE_FLAG); 340 /* Use the lowest 4G segment */ 317 341 EHCI_WR(instance->registers->ctrldssegment, 0); 318 342 /* Set periodic list */ … … 326 350 EHCI_SET(instance->registers->usbcmd, USB_CMD_RUN_FLAG); 327 351 EHCI_SET(instance->registers->configflag, USB_CONFIG_FLAG_FLAG); 352 328 353 #if 0 329 354 /* -
uspace/drv/bus/usb/ehci/hc.h
r5f5321ee r763dbcb 75 75 fibril_mutex_t guard; 76 76 77 /** Wait for hc to restart async chedule */ 78 fibril_condvar_t async_doorbell; 79 77 80 /** USB hub emulation structure */ 78 81 ehci_rh_t rh;
Note:
See TracChangeset
for help on using the changeset viewer.