Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/iface.c

    r1998bcd r6acc80f3  
    7474            name, target.address, target.endpoint, size, ep->max_packet_size);
    7575
    76 //      assert(ep->speed ==
    77 //          usb_device_keeper_get_speed(&(*hc)->manager, target.address));
     76        assert(ep->speed ==
     77            usb_device_keeper_get_speed(&(*hc)->manager, target.address));
    7878//      assert(ep->max_packet_size == max_packet_size);
    7979//      assert(ep->transfer_type == USB_TRANSFER_CONTROL);
     
    198198/*----------------------------------------------------------------------------*/
    199199static int register_endpoint(
    200     ddf_fun_t *fun, usb_address_t address, usb_speed_t ep_speed,
    201     usb_endpoint_t endpoint,
     200    ddf_fun_t *fun, usb_address_t address, usb_endpoint_t endpoint,
    202201    usb_transfer_type_t transfer_type, usb_direction_t direction,
    203202    size_t max_packet_size, unsigned int interval)
     
    205204        hc_t *hc = fun_to_hc(fun);
    206205        assert(hc);
    207         usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, address);
    208         if (speed >= USB_SPEED_MAX) {
    209                 speed = ep_speed;
    210         }
    211         const size_t size =
    212             (transfer_type == USB_TRANSFER_INTERRUPT
    213             || transfer_type == USB_TRANSFER_ISOCHRONOUS) ?
    214             max_packet_size : 0;
     206        const usb_speed_t speed =
     207            usb_device_keeper_get_speed(&hc->manager, address);
     208        const size_t size = max_packet_size;
    215209        int ret;
    216210
     
    246240        usb_log_debug("Unregister endpoint %d:%d %d.\n",
    247241            address, endpoint, direction);
    248         endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    249             address, endpoint, direction, NULL);
    250         if (ep != NULL) {
    251                 usb_device_keeper_del_ep(&hc->manager, address, ep);
    252         }
    253242        return usb_endpoint_manager_unregister_ep(&hc->ep_manager, address,
    254243            endpoint, direction);
     
    259248 * @param[in] fun DDF function that was called.
    260249 * @param[in] target USB device to write to.
     250 * @param[in] max_packet_size maximum size of data packet the device accepts
    261251 * @param[in] data Source of data.
    262252 * @param[in] size Size of data source.
     
    266256 */
    267257static int interrupt_out(
    268     ddf_fun_t *fun, usb_target_t target, void *data,
     258    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
    269259    size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
    270260{
     
    287277 * @param[in] fun DDF function that was called.
    288278 * @param[in] target USB device to write to.
     279 * @param[in] max_packet_size maximum size of data packet the device accepts
    289280 * @param[out] data Data destination.
    290281 * @param[in] size Size of data source.
     
    294285 */
    295286static int interrupt_in(
    296     ddf_fun_t *fun, usb_target_t target, void *data,
     287    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
    297288    size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
    298289{
     
    315306 * @param[in] fun DDF function that was called.
    316307 * @param[in] target USB device to write to.
     308 * @param[in] max_packet_size maximum size of data packet the device accepts
    317309 * @param[in] data Source of data.
    318310 * @param[in] size Size of data source.
     
    322314 */
    323315static int bulk_out(
    324     ddf_fun_t *fun, usb_target_t target, void *data,
     316    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
    325317    size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
    326318{
     
    343335 * @param[in] fun DDF function that was called.
    344336 * @param[in] target USB device to write to.
     337 * @param[in] max_packet_size maximum size of data packet the device accepts
    345338 * @param[out] data Data destination.
    346339 * @param[in] size Size of data source.
     
    350343 */
    351344static int bulk_in(
    352     ddf_fun_t *fun, usb_target_t target, void *data,
     345    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
    353346    size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
    354347{
     
    371364 * @param[in] fun DDF function that was called.
    372365 * @param[in] target USB device to write to.
     366 * @param[in] max_packet_size maximum size of data packet the device accepts.
    373367 * @param[in] setup_data Data to send with SETUP transfer.
    374368 * @param[in] setup_size Size of data to send with SETUP transfer (always 8B).
     
    380374 */
    381375static int control_write(
    382     ddf_fun_t *fun, usb_target_t target,
     376    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
    383377    void *setup_data, size_t setup_size, void *data, size_t size,
    384378    usbhc_iface_transfer_out_callback_t callback, void *arg)
     
    404398 * @param[in] fun DDF function that was called.
    405399 * @param[in] target USB device to write to.
     400 * @param[in] max_packet_size maximum size of data packet the device accepts.
    406401 * @param[in] setup_data Data to send with SETUP packet.
    407402 * @param[in] setup_size Size of data to send with SETUP packet (should be 8B).
     
    413408 */
    414409static int control_read(
    415     ddf_fun_t *fun, usb_target_t target,
     410    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
    416411    void *setup_data, size_t setup_size, void *data, size_t size,
    417412    usbhc_iface_transfer_in_callback_t callback, void *arg)
Note: See TracChangeset for help on using the changeset viewer.