Changeset 6832245 in mainline for uspace/lib/usbhost/src/hcd.c


Ignore:
Timestamp:
2017-12-14T23:01:57Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
837d53d
Parents:
bd05140
git-author:
Ondřej Hlavatý <aearsis@…> (2017-12-14 23:01:54)
git-committer:
Ondřej Hlavatý <aearsis@…> (2017-12-14 23:01:57)
Message:

usbhost bus: refactor the bus ops

This way, method names better represent the entity it is working with.
Their semantics was shifted a bit.

Regarding the tree of structures:

bus ← device ← endpoint ← batch

Previously, devices were kept in DDF function nodes, and endpoints had
pointer to the bus and device. Now, devices have pointer to bus,
endpoints don't.

Pointer to hcd_t in bus is WIP, and will be removed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/hcd.c

    rbd05140 r6832245  
    208208        }
    209209
    210         endpoint_t *ep = bus_find_endpoint(hcd->bus, device, target, direction);
     210        endpoint_t *ep = bus_find_endpoint(device, target, direction);
    211211        if (ep == NULL) {
    212212                usb_log_error("Endpoint(%d:%d) not registered for %s.\n",
     
    216216
    217217        // TODO cut here aka provide helper to call with instance of endpoint_t in hand
     218        assert(ep->device == device);
    218219
    219220        usb_log_debug2("%s %d:%d %zu(%zu).\n",
    220221            name, target.address, target.endpoint, size, ep->max_packet_size);
    221222
    222         const size_t bw = bus_count_bw(ep, size);
     223        const size_t bw = endpoint_count_bw(ep, size);
    223224        /* Check if we have enough bandwidth reserved */
    224225        if (ep->bandwidth < bw) {
Note: See TracChangeset for help on using the changeset viewer.