Changeset 0ee999d in mainline


Ignore:
Timestamp:
2013-08-20T12:24:16Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5856b627
Parents:
5dad73d
Message:

libusbhost: Add TT information to usb_enpoint_t structure.

Location:
uspace/lib/usbhost
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/endpoint.h

    r5dad73d r0ee999d  
    6767        /** Signals change of active status. */
    6868        fibril_condvar_t avail;
     69        /** High speed TT data */
     70        struct {
     71                usb_address_t address;
     72                unsigned port;
     73        } tt;
    6974        /** Optional device specific data. */
    7075        struct {
     
    8085endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint,
    8186    usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed,
    82     size_t max_packet_size, size_t bw);
     87    size_t max_packet_size, size_t bw, usb_address_t tt_address,
     88    unsigned tt_port);
    8389void endpoint_destroy(endpoint_t *instance);
    8490
  • uspace/lib/usbhost/include/usb/host/hcd.h

    r5dad73d r0ee999d  
    7676        hcd->ep_add_hook = add_hook;
    7777        hcd->ep_remove_hook = rem_hook;
    78 
    7978}
    8079
     
    9190
    9291int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir,
    93     usb_transfer_type_t type, size_t max_packet_size, size_t size);
     92    usb_transfer_type_t type, size_t max_packet_size, size_t size,
     93    usb_address_t tt_address, unsigned tt_port);
    9494
    9595int hcd_remove_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir);
  • uspace/lib/usbhost/include/usb/host/usb_endpoint_manager.h

    r5dad73d r0ee999d  
    9393    usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction,
    9494    usb_transfer_type_t type, size_t max_packet_size, size_t data_size,
    95     ep_add_callback_t callback, void *arg);
     95    ep_add_callback_t callback, void *arg, usb_address_t tt_address,
     96    unsigned tt_port);
    9697
    9798int usb_endpoint_manager_remove_ep(usb_endpoint_manager_t *instance,
     
    108109    usb_address_t *address, bool strict, usb_speed_t speed);
    109110
    110 int usb_endpoint_manager_get_info_by_address(usb_endpoint_manager_t *instance,
     111int usb_endpoint_manager_get_speed(usb_endpoint_manager_t *instance,
    111112    usb_address_t address, usb_speed_t *speed);
    112113#endif
  • uspace/lib/usbhost/src/ddf_helpers.c

    r5dad73d r0ee999d  
    114114
    115115        return hcd_add_ep(hcd, target, direction, transfer_type,
    116             max_packet_size, size);
     116            max_packet_size, size, dev->tt_address, dev->port);
    117117}
    118118
     
    391391                    (d->device_version & 0xff));
    392392       
    393                 /* Next, without release number. */     
     393                /* Next, without release number. */
    394394                ADD_MATCHID_OR_RETURN(l, 90, "usb&vendor=%#04x&product=%#04x",
    395395                    d->vendor_id, d->product_id);
     
    453453
    454454        /* This checks whether the default address is reserved and gets speed */
    455         int ret = usb_endpoint_manager_get_info_by_address(&hcd->ep_manager,
     455        int ret = usb_endpoint_manager_get_speed(&hcd->ep_manager,
    456456                USB_ADDRESS_DEFAULT, &speed);
    457457        if (ret != EOK) {
     
    473473        }};
    474474
     475        const usb_address_t tt_address = hub ? hub->tt_address : -1;
     476
    475477        /* Add default pipe on default address */
    476478        ret = hcd_add_ep(hcd,
    477479            default_target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL,
    478             CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE);
     480            CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE,
     481            tt_address, port);
    479482
    480483        if (ret != EOK) {
     
    501504        /* Register EP on the new address */
    502505        ret = hcd_add_ep(hcd, target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL,
    503             desc.max_packet_size, desc.max_packet_size);
     506            desc.max_packet_size, desc.max_packet_size, tt_address, port);
    504507        if (ret != EOK) {
    505508                hcd_remove_ep(hcd, default_target, USB_DIRECTION_BOTH);
  • uspace/lib/usbhost/src/endpoint.c

    r5dad73d r0ee999d  
    5050endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint,
    5151    usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed,
    52     size_t max_packet_size, size_t bw)
     52    size_t max_packet_size, size_t bw, usb_address_t tt_address, unsigned tt_p)
    5353{
    5454        endpoint_t *instance = malloc(sizeof(endpoint_t));
     
    6363                instance->toggle = 0;
    6464                instance->active = false;
     65                instance->tt.address = tt_address;
     66                instance->tt.port = tt_p;
    6567                instance->hc_data.data = NULL;
    6668                instance->hc_data.toggle_get = NULL;
  • uspace/lib/usbhost/src/hcd.c

    r5dad73d r0ee999d  
    130130
    131131int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir,
    132     usb_transfer_type_t type, size_t max_packet_size, size_t size)
     132    usb_transfer_type_t type, size_t max_packet_size, size_t size,
     133    usb_address_t tt_address, unsigned tt_port)
    133134{
    134135        assert(hcd);
    135136        return usb_endpoint_manager_add_ep(&hcd->ep_manager, target.address,
    136137            target.endpoint, dir, type, max_packet_size, size, register_helper,
    137             hcd);
     138            hcd, tt_address, tt_port);
    138139}
    139140
  • uspace/lib/usbhost/src/usb_endpoint_manager.c

    r5dad73d r0ee999d  
    287287    usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction,
    288288    usb_transfer_type_t type, size_t max_packet_size, size_t data_size,
    289     ep_add_callback_t callback, void *arg)
     289    ep_add_callback_t callback, void *arg, usb_address_t tt_address,
     290    unsigned tt_port)
    290291{
    291292        assert(instance);
     
    320321        }
    321322
    322         ep = endpoint_create(
    323             address, endpoint, direction, type, speed, max_packet_size, bw);
     323        ep = endpoint_create(address, endpoint, direction, type, speed,
     324            max_packet_size, bw, tt_address, tt_port);
    324325        if (!ep) {
    325326                fibril_mutex_unlock(&instance->guard);
     
    484485 * @return Error code.
    485486 */
    486 int usb_endpoint_manager_get_info_by_address(usb_endpoint_manager_t *instance,
     487int usb_endpoint_manager_get_speed(usb_endpoint_manager_t *instance,
    487488    usb_address_t address, usb_speed_t *speed)
    488489{
Note: See TracChangeset for help on using the changeset viewer.