Changeset 56257ba in mainline for uspace/drv/bus/usb/ohci/ohci_bus.c


Ignore:
Timestamp:
2018-01-07T01:01:42Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63431db
Parents:
9efad54
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-07 01:01:41)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-07 01:01:42)
Message:

usbhost: manage endpoints by library + get/set_toggle → reset_toggle

That simplifies things A LOT. Now you can find endpoints for device in
an array inside device. This array is managed automatically in
register/unregister endpoint. HC drivers still needs to write to it when
setting up/tearing down the device.

Sorry for these two changes being in one commit, but splitting them
would be simply more work for no benefit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/ohci_bus.c

    r9efad54 r56257ba  
    4343#include "hc.h"
    4444
    45 /** Callback to set toggle on ED.
     45/** Callback to reset toggle on ED.
    4646 *
    4747 * @param[in] hcd_ep hcd endpoint structure
    4848 * @param[in] toggle new value of toggle bit
    4949 */
    50 static void ohci_ep_toggle_set(endpoint_t *ep, bool toggle)
     50static void ohci_ep_toggle_reset(endpoint_t *ep)
    5151{
    5252        ohci_endpoint_t *instance = ohci_endpoint_get(ep);
    5353        assert(instance);
    5454        assert(instance->ed);
    55         ep->toggle = toggle;
    56         ed_toggle_set(instance->ed, toggle);
    57 }
    58 
    59 /** Callback to get value of toggle bit.
    60  *
    61  * @param[in] hcd_ep hcd endpoint structure
    62  * @return Current value of toggle bit.
    63  */
    64 static bool ohci_ep_toggle_get(endpoint_t *ep)
    65 {
    66         ohci_endpoint_t *instance = ohci_endpoint_get(ep);
    67         assert(instance);
    68         assert(instance->ed);
    69         return ed_toggle_get(instance->ed);
     55        ep->toggle = 0;
     56        ed_toggle_set(instance->ed, 0);
    7057}
    7158
     
    166153        .endpoint_unregister = ohci_unregister_ep,
    167154        .endpoint_count_bw = bandwidth_count_usb11,
    168         .endpoint_set_toggle = ohci_ep_toggle_set,
    169         .endpoint_get_toggle = ohci_ep_toggle_get,
     155        .endpoint_toggle_reset = ohci_ep_toggle_reset,
    170156        .batch_create = ohci_create_batch,
    171157        .batch_destroy = ohci_destroy_batch,
Note: See TracChangeset for help on using the changeset viewer.