Changeset 86b4ee0 in mainline


Ignore:
Timestamp:
2011-04-10T09:09:28Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ede0c3
Parents:
edc4c66
Message:

Minor fixes

Size really does not matter for control and bulk endpoint registration,
we may just use max_packet_size for all.
Fix parameter order in error output.
Move debug output before endpoint creation (to see that message even if endpoint creation fails)

Location:
uspace/drv
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/iface.c

    redc4c66 r86b4ee0  
    6868                usb_log_error("Endpoint(%d:%d) %s needs %zu bw "
    6969                    "but only %zu is reserved.\n",
    70                     name, target.address, target.endpoint, bw, res_bw);
     70                    target.address, target.endpoint, name, bw, res_bw);
    7171                return ENOSPC;
    7272        }
     
    163163                speed = ep_speed;
    164164        }
    165         const size_t size =
    166             (transfer_type == USB_TRANSFER_INTERRUPT
    167             || transfer_type == USB_TRANSFER_ISOCHRONOUS) ?
    168             max_packet_size : 0;
     165        const size_t size = max_packet_size;
    169166        int ret;
     167
     168        usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n",
     169            address, endpoint, usb_str_transfer_type(transfer_type),
     170            usb_str_speed(speed), direction, size, max_packet_size, interval);
    170171
    171172        endpoint_t *ep = malloc(sizeof(endpoint_t));
     
    178179                return ret;
    179180        }
    180 
    181         usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n",
    182             address, endpoint, usb_str_transfer_type(transfer_type),
    183             usb_str_speed(speed), direction, size, max_packet_size, interval);
    184181
    185182        ret = usb_endpoint_manager_register_ep(&hc->ep_manager, ep, size);
  • uspace/drv/uhci-hcd/iface.c

    redc4c66 r86b4ee0  
    6868                usb_log_error("Endpoint(%d:%d) %s needs %zu bw "
    6969                    "but only %zu is reserved.\n",
    70                     name, target.address, target.endpoint, bw, res_bw);
     70                    target.address, target.endpoint, name, bw, res_bw);
    7171                return ENOSPC;
    7272        }
     
    146146        hc_t *hc = fun_to_hc(fun);
    147147        assert(hc);
     148        const size_t size = max_packet_size;
     149        int ret;
    148150        usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, address);
    149151        if (speed >= USB_SPEED_MAX) {
    150152                speed = ep_speed;
    151153        }
    152         const size_t size =
    153             (transfer_type == USB_TRANSFER_INTERRUPT
    154             || transfer_type == USB_TRANSFER_ISOCHRONOUS) ?
    155             max_packet_size : 0;
    156         int ret;
     154        usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n",
     155            address, endpoint, usb_str_transfer_type(transfer_type),
     156            usb_str_speed(speed), direction, size, max_packet_size, interval);
     157
    157158
    158159        endpoint_t *ep = malloc(sizeof(endpoint_t));
     
    166167        }
    167168
    168         usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n",
    169             address, endpoint, usb_str_transfer_type(transfer_type),
    170             usb_str_speed(speed), direction, size, max_packet_size, interval);
    171 
    172169        ret = usb_endpoint_manager_register_ep(&hc->ep_manager, ep, size);
    173170        if (ret != EOK) {
Note: See TracChangeset for help on using the changeset viewer.