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


Ignore:
Timestamp:
2017-10-15T02:04:10Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
20eaa82
Parents:
d7869d7e
Message:

hcd_ddf_new_device refactoring

This long function is now split into parts. Instead of passing dozens of arguments, it now creates the usb_dev_t right away, and uses that to pass it along. The address_device part is now modifiable by drivers.

There is still a work to be done. The biggest problem I see is in the addressing - currently, there is usb_address_t, and for high speed transaction translating there is another address. For (near) future extensibility, we should pass address as a structure. Or even better, make a way how to reference a device, maybe in a similar way how we work with endpoints.

File:
1 edited

Legend:

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

    rd7869d7e r867b375  
    129129int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir,
    130130    usb_transfer_type_t type, size_t max_packet_size, unsigned packets,
    131     size_t size, usb_address_t tt_address, unsigned tt_port)
     131    size_t size, usb_tt_address_t tt)
    132132{
    133133        assert(hcd);
     
    143143        ep->max_packet_size = max_packet_size;
    144144        ep->packets = packets;
    145 
    146         ep->tt.address = tt_address;
    147         ep->tt.port = tt_port;
     145        ep->tt = tt;
    148146
    149147        ep->bandwidth = bus_count_bw(ep, size);
Note: See TracChangeset for help on using the changeset viewer.