Changeset ee794529 in mainline


Ignore:
Timestamp:
2017-10-22T16:38:19Z (6 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
89cefe78
Parents:
4594baa
Message:

Refactoring. Renamed functions in bus endpoint interface. Register/release is now register/unregister to prevent name collisions with use/release.

Location:
uspace
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/ehci_bus.c

    r4594baa ree794529  
    129129}
    130130
    131 static int ehci_release_ep(bus_t *bus_base, endpoint_t *ep)
     131static int ehci_unregister_ep(bus_t *bus_base, endpoint_t *ep)
    132132{
    133133        ehci_bus_t *bus = (ehci_bus_t *) bus_base;
     
    135135        assert(ep);
    136136
    137         const int err = bus->parent_ops.release_endpoint(bus_base, ep);
     137        const int err = bus->parent_ops.unregister_endpoint(bus_base, ep);
    138138        if (err)
    139139                return err;
     
    170170
    171171        ops->register_endpoint = ehci_register_ep;
    172         ops->release_endpoint = ehci_release_ep;
     172        ops->unregister_endpoint = ehci_unregister_ep;
    173173
    174174        ops->create_batch = ehci_bus_create_batch;
  • uspace/drv/bus/usb/ohci/ohci_bus.c

    r4594baa ree794529  
    130130}
    131131
    132 static int ohci_release_ep(bus_t *bus_base, endpoint_t *ep)
     132static int ohci_unregister_ep(bus_t *bus_base, endpoint_t *ep)
    133133{
    134134        ohci_bus_t *bus = (ohci_bus_t *) bus_base;
     
    136136        assert(ep);
    137137
    138         const int err = bus->parent_ops.release_endpoint(bus_base, ep);
     138        const int err = bus->parent_ops.unregister_endpoint(bus_base, ep);
    139139        if (err)
    140140                return err;
     
    170170
    171171        ops->register_endpoint = ohci_register_ep;
    172         ops->release_endpoint = ohci_release_ep;
     172        ops->unregister_endpoint = ohci_unregister_ep;
    173173
    174174        ops->create_batch = ohci_bus_create_batch;
  • uspace/drv/bus/usb/xhci/bus.c

    r4594baa ree794529  
    118118        xhci_device_t *xhci_dev = xhci_device_get(dev);
    119119
    120         /* Release remaining endpoints. */
     120        /* Unregister remaining endpoints. */
    121121        for (size_t i = 0; i < ARRAY_SIZE(xhci_dev->endpoints); ++i) {
    122122                if (!xhci_dev->endpoints[i])
     
    124124
    125125                // FIXME: ignoring return code
    126                 bus_release_endpoint(&bus->base, &xhci_dev->endpoints[i]->base);
     126                bus_unregister_endpoint(&bus->base, &xhci_dev->endpoints[i]->base);
    127127        }
    128128
     
    257257}
    258258
    259 static int release_endpoint(bus_t *bus_base, endpoint_t *ep)
     259static int unregister_endpoint(bus_t *bus_base, endpoint_t *ep)
    260260{
    261261        xhci_bus_t *bus = bus_to_xhci_bus(bus_base);
    262262        assert(bus);
    263263
    264         usb_log_info("Endpoint(%d:%d) released from XHCI bus.", ep->target.address, ep->target.endpoint);
     264        usb_log_info("Endpoint(%d:%d) unregistered from XHCI bus.", ep->target.address, ep->target.endpoint);
    265265
    266266        xhci_device_t *xhci_dev = xhci_device_get(ep->device);
     
    329329
    330330        .register_endpoint = register_endpoint,
    331         .release_endpoint = release_endpoint,
     331        .unregister_endpoint = unregister_endpoint,
    332332        .find_endpoint = find_endpoint,
    333333
  • uspace/lib/usbhost/include/usb/host/bus.h

    r4594baa ree794529  
    8484        endpoint_t *(*create_endpoint)(bus_t *);
    8585        int (*register_endpoint)(bus_t *, endpoint_t *);
    86         int (*release_endpoint)(bus_t *, endpoint_t *);
     86        int (*unregister_endpoint)(bus_t *, endpoint_t *);
    8787        endpoint_t *(*find_endpoint)(bus_t *, usb_target_t, usb_direction_t);
    8888        void (*destroy_endpoint)(endpoint_t *);                 /**< Optional */
     
    129129endpoint_t *bus_create_endpoint(bus_t *);
    130130int bus_register_endpoint(bus_t *, endpoint_t *);
    131 int bus_release_endpoint(bus_t *, endpoint_t *);
     131int bus_unregister_endpoint(bus_t *, endpoint_t *);
    132132endpoint_t *bus_find_endpoint(bus_t *, usb_target_t, usb_direction_t);
    133133
  • uspace/lib/usbhost/src/bus.c

    r4594baa ree794529  
    106106                return ENOENT;
    107107
    108         return bus_release_endpoint(bus, ep);
     108        return bus_unregister_endpoint(bus, ep);
    109109}
    110110
     
    180180}
    181181
    182 int bus_release_endpoint(bus_t *bus, endpoint_t *ep)
     182int bus_unregister_endpoint(bus_t *bus, endpoint_t *ep)
    183183{
    184184        assert(bus);
     
    186186
    187187        fibril_mutex_lock(&bus->guard);
    188         const int r = bus->ops.release_endpoint(bus, ep);
     188        const int r = bus->ops.unregister_endpoint(bus, ep);
    189189        fibril_mutex_unlock(&bus->guard);
    190190
  • uspace/lib/usbhost/src/usb2_bus.c

    r4594baa ree794529  
    309309/** Release bandwidth reserved by the given endpoint.
    310310 */
    311 static int usb2_bus_release_ep(bus_t *bus_base, endpoint_t *ep)
     311static int usb2_bus_unregister_ep(bus_t *bus_base, endpoint_t *ep)
    312312{
    313313        usb2_bus_t *bus = bus_to_usb2_bus(bus_base);
     
    416416        .create_endpoint = usb2_bus_create_ep,
    417417        .find_endpoint = usb2_bus_find_ep,
    418         .release_endpoint = usb2_bus_release_ep,
     418        .unregister_endpoint = usb2_bus_unregister_ep,
    419419        .register_endpoint = usb2_bus_register_ep,
    420420        .request_address = usb2_bus_request_address,
Note: See TracChangeset for help on using the changeset viewer.