Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 888238e9 in mainline


Ignore:
Timestamp:
2017-11-20T12:56:00Z (4 years ago)
Author:
Aearsis <Hlavaty.Ondrej@…>
Branches:
lfn, master
Children:
d3086873
Parents:
ff14aede
git-author:
Aearsis <Hlavaty.Ondrej@…> (2017-11-20 12:55:58)
git-committer:
Aearsis <Hlavaty.Ondrej@…> (2017-11-20 12:56:00)
Message:

usbhost: endpoints do not have speed on their own

This information was redundant, and the fact it was never set proves it
should be removed because it is source of errors.

Location:
uspace
Files:
8 edited

Legend:

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

    rff14aede r888238e9  
    6464                return;
    6565        }
    66         assert(ep->speed < ARRAY_SIZE(speed));
     66        assert(ep->device->speed < ARRAY_SIZE(speed));
    6767        EHCI_MEM32_WR(instance->ep_char,
    6868            QH_EP_CHAR_ADDR_SET(ep->device->address) |
    6969            QH_EP_CHAR_EP_SET(ep->endpoint) |
    70             speed[ep->speed] |
     70            speed[ep->device->speed] |
    7171            QH_EP_CHAR_MAX_LENGTH_SET(ep->max_packet_size)
    7272        );
    7373        if (ep->transfer_type == USB_TRANSFER_CONTROL) {
    74                 if (ep->speed != USB_SPEED_HIGH)
     74                if (ep->device->speed != USB_SPEED_HIGH)
    7575                        EHCI_MEM32_SET(instance->ep_char, QH_EP_CHAR_C_FLAG);
    7676                /* Let BULK and INT use queue head managed toggle,
     
    8080        uint32_t ep_cap = QH_EP_CAP_C_MASK_SET(3 << 2) |
    8181                    QH_EP_CAP_MULTI_SET(ep->packets);
    82         if (ep->speed != USB_SPEED_HIGH) {
     82        if (ep->device->speed != USB_SPEED_HIGH) {
    8383                ep_cap |=
    8484                    QH_EP_CAP_TT_PORT_SET(ep->device->tt.port) |
  • uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c

    rff14aede r888238e9  
    8888
    8989        /* Low speed flag */
    90         if (ep->speed == USB_SPEED_LOW)
     90        if (ep->device->speed == USB_SPEED_LOW)
    9191                OHCI_MEM32_SET(instance->status, ED_STATUS_S_FLAG);
    9292
  • uspace/drv/bus/usb/uhci/hc.c

    rff14aede r888238e9  
    475475
    476476        transfer_list_t *list =
    477             instance->transfers[batch->ep->speed][batch->ep->transfer_type];
     477            instance->transfers[batch->ep->device->speed][batch->ep->transfer_type];
    478478        assert(list);
    479479        transfer_list_add_batch(list, uhci_batch);
  • uspace/drv/bus/usb/uhci/uhci_batch.c

    rff14aede r888238e9  
    233233        const usb_packet_id pid = direction_pids[dir];
    234234        const bool low_speed =
    235             uhci_batch->base.ep->speed == USB_SPEED_LOW;
     235            uhci_batch->base.ep->device->speed == USB_SPEED_LOW;
    236236        const size_t mps = uhci_batch->base.ep->max_packet_size;
    237237
     
    295295        const usb_packet_id status_stage_pid = status_stage_pids[dir];
    296296        const bool low_speed =
    297             uhci_batch->base.ep->speed == USB_SPEED_LOW;
     297            uhci_batch->base.ep->device->speed == USB_SPEED_LOW;
    298298        const size_t mps = uhci_batch->base.ep->max_packet_size;
    299299        const usb_target_t target = uhci_batch->base.target;
  • uspace/drv/bus/usb/xhci/endpoint.c

    rff14aede r888238e9  
    141141int xhci_endpoint_request_streams(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *xhci_ep, unsigned count) {
    142142        if (xhci_ep->base.transfer_type != USB_TRANSFER_BULK
    143                 || xhci_ep->base.speed != USB_SPEED_SUPER) {
     143                || dev->base.speed != USB_SPEED_SUPER) {
    144144                usb_log_error("Streams are only supported by superspeed bulk endpoints.");
    145145                return EINVAL;
  • uspace/lib/usbhost/include/usb/host/endpoint.h

    rff14aede r888238e9  
    6666        /** USB transfer type. */
    6767        usb_transfer_type_t transfer_type;
    68         /** Communication speed. */
    69         usb_speed_t speed;
    7068        /** Maximum size of data packets. */
    7169        size_t max_packet_size;
  • uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h

    rff14aede r888238e9  
    3939#include <usb/usb.h>
    4040#include <usb/request.h>
     41#include <usb/host/bus.h>
    4142#include <usbhc_iface.h>
    4243
     
    99100#define USB_TRANSFER_BATCH_ARGS(batch) \
    100101        (batch).target.address, (batch).target.endpoint, \
    101         usb_str_speed((batch).ep->speed), \
     102        usb_str_speed((batch).ep->device->speed), \
    102103        usb_str_transfer_type_short((batch).ep->transfer_type), \
    103104        usb_str_direction((batch).ep->direction), \
  • uspace/lib/usbhost/src/bandwidth.c

    rff14aede r888238e9  
    3636#include <usb/host/bandwidth.h>
    3737#include <usb/host/endpoint.h>
     38#include <usb/host/bus.h>
    3839
    3940#include <assert.h>
     
    4243/** Calculate bandwidth that needs to be reserved for communication with EP.
    4344 * Calculation follows USB 1.1 specification.
    44  * @param speed Device's speed.
    45  * @param type Type of the transfer.
    46  * @param size Number of byte to transfer.
     45 * @param ep Registered endpoint
     46 * @param size Number of bytes to transfer.
    4747 * @param max_packet_size Maximum bytes in one packet.
    4848 */
     
    5050{
    5151        assert(ep);
     52        assert(ep->device);
    5253
    5354        const usb_transfer_type_t type = ep->transfer_type;
     
    6667         * transaction, but I did not find text in USB spec to confirm this */
    6768        /* NOTE: All data packets will be considered to be max_packet_size */
    68         switch (ep->speed)
     69        switch (ep->device->speed)
    6970        {
    7071        case USB_SPEED_LOW:
Note: See TracChangeset for help on using the changeset viewer.