Changeset c10daa8 in mainline for uspace/drv/bus/usb/xhci/endpoint.c
- Timestamp:
- 2017-10-13T12:32:57Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 063dfe8
- Parents:
- 366e9b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/endpoint.c
r366e9b6 rc10daa8 50 50 51 51 endpoint_init(ep, bus); 52 53 /* FIXME: Set xhci_ep->slot_id */ 52 xhci_ep->device = NULL; 54 53 55 54 usb_log_debug("XHCI Endpoint %d:%d initialized.", ep->target.address, ep->target.endpoint); … … 69 68 } 70 69 70 int xhci_device_init(xhci_device_t *dev, xhci_bus_t *bus) 71 { 72 memset(&dev->endpoints, 0, sizeof(dev->endpoints)); 73 dev->active_endpoint_count = 0; 74 return EOK; 75 } 76 77 void xhci_device_fini(xhci_device_t *dev) 78 { 79 // TODO: Check that all endpoints are dead. 80 } 81 82 int xhci_device_add_endpoint(xhci_device_t *dev, xhci_endpoint_t *ep) 83 { 84 assert(dev->address == ep->base.target.address); 85 assert(!dev->endpoints[ep->base.target.endpoint]); 86 assert(!ep->device); 87 88 ep->device = dev; 89 dev->endpoints[ep->base.target.endpoint] = ep; 90 ++dev->active_endpoint_count; 91 return EOK; 92 } 93 94 int xhci_device_remove_endpoint(xhci_device_t *dev, xhci_endpoint_t *ep) 95 { 96 assert(dev->address == ep->base.target.address); 97 assert(dev->endpoints[ep->base.target.endpoint]); 98 assert(dev == ep->device); 99 100 ep->device = NULL; 101 dev->endpoints[ep->base.target.endpoint] = NULL; 102 --dev->active_endpoint_count; 103 return EOK; 104 } 105 106 xhci_endpoint_t * xhci_device_get_endpoint(xhci_device_t *dev, usb_endpoint_t ep) 107 { 108 return dev->endpoints[ep]; 109 } 110 71 111 /** 72 112 * @}
Note:
See TracChangeset
for help on using the changeset viewer.