Changeset 7dfc06fa in mainline for uspace/drv/uhci-hcd/iface.c


Ignore:
Timestamp:
2011-04-08T18:08:46Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c6cb76d
Parents:
c1b1944
Message:

Do not send max packet size with each transfer

See ticket #177, #121 and partly #49.

File:
1 edited

Legend:

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

    rc1b1944 r7dfc06fa  
    204204 * @param[in] fun DDF function that was called.
    205205 * @param[in] target USB device to write to.
    206  * @param[in] max_packet_size maximum size of data packet the device accepts
    207206 * @param[in] data Source of data.
    208207 * @param[in] size Size of data source.
     
    212211 */
    213212static int interrupt_out(
    214     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     213    ddf_fun_t *fun, usb_target_t target, void *data,
    215214    size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
    216215{
     
    219218        assert(hc);
    220219
    221         usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n",
    222             target.address, target.endpoint, size, max_packet_size);
     220        usb_log_debug("Interrupt OUT %d:%d %zu.\n",
     221            target.address, target.endpoint, size);
    223222
    224223        size_t res_bw;
     
    241240        assert(ep->speed ==
    242241            usb_device_keeper_get_speed(&hc->manager, target.address));
    243         assert(ep->max_packet_size == max_packet_size);
    244242        assert(ep->transfer_type == USB_TRANSFER_INTERRUPT);
    245243
     
    261259 * @param[in] fun DDF function that was called.
    262260 * @param[in] target USB device to write to.
    263  * @param[in] max_packet_size maximum size of data packet the device accepts
    264261 * @param[out] data Data destination.
    265262 * @param[in] size Size of data source.
     
    269266 */
    270267static int interrupt_in(
    271     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     268    ddf_fun_t *fun, usb_target_t target, void *data,
    272269    size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
    273270{
     
    276273        assert(hc);
    277274
    278         usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n",
    279             target.address, target.endpoint, size, max_packet_size);
     275        usb_log_debug("Interrupt IN %d:%d %zu.\n",
     276            target.address, target.endpoint, size);
    280277
    281278        size_t res_bw;
     
    299296        assert(ep->speed ==
    300297            usb_device_keeper_get_speed(&hc->manager, target.address));
    301         assert(ep->max_packet_size == max_packet_size);
    302298        assert(ep->transfer_type == USB_TRANSFER_INTERRUPT);
    303299
     
    319315 * @param[in] fun DDF function that was called.
    320316 * @param[in] target USB device to write to.
    321  * @param[in] max_packet_size maximum size of data packet the device accepts
    322317 * @param[in] data Source of data.
    323318 * @param[in] size Size of data source.
     
    327322 */
    328323static int bulk_out(
    329     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     324    ddf_fun_t *fun, usb_target_t target, void *data,
    330325    size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
    331326{
     
    334329        assert(hc);
    335330
    336         usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n",
    337             target.address, target.endpoint, size, max_packet_size);
     331        usb_log_debug("Bulk OUT %d:%d %zu.\n",
     332            target.address, target.endpoint, size);
    338333
    339334        endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
     
    346341        assert(ep->speed ==
    347342            usb_device_keeper_get_speed(&hc->manager, target.address));
    348         assert(ep->max_packet_size == max_packet_size);
    349343        assert(ep->transfer_type == USB_TRANSFER_BULK);
    350344
     
    366360 * @param[in] fun DDF function that was called.
    367361 * @param[in] target USB device to write to.
    368  * @param[in] max_packet_size maximum size of data packet the device accepts
    369362 * @param[out] data Data destination.
    370363 * @param[in] size Size of data source.
     
    374367 */
    375368static int bulk_in(
    376     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     369    ddf_fun_t *fun, usb_target_t target, void *data,
    377370    size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
    378371{
     
    380373        hc_t *hc = fun_to_hc(fun);
    381374        assert(hc);
    382         usb_log_debug("Bulk IN %d:%d %zu(%zu).\n",
    383             target.address, target.endpoint, size, max_packet_size);
     375        usb_log_debug("Bulk IN %d:%d %zu.\n",
     376            target.address, target.endpoint, size);
    384377
    385378        endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
     
    392385        assert(ep->speed ==
    393386            usb_device_keeper_get_speed(&hc->manager, target.address));
    394         assert(ep->max_packet_size == max_packet_size);
    395387        assert(ep->transfer_type == USB_TRANSFER_BULK);
    396388
     
    412404 * @param[in] fun DDF function that was called.
    413405 * @param[in] target USB device to write to.
    414  * @param[in] max_packet_size maximum size of data packet the device accepts.
    415406 * @param[in] setup_data Data to send with SETUP transfer.
    416407 * @param[in] setup_size Size of data to send with SETUP transfer (always 8B).
     
    422413 */
    423414static int control_write(
    424     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
     415    ddf_fun_t *fun, usb_target_t target,
    425416    void *setup_data, size_t setup_size, void *data, size_t size,
    426417    usbhc_iface_transfer_out_callback_t callback, void *arg)
     
    431422        usb_speed_t speed =
    432423            usb_device_keeper_get_speed(&hc->manager, target.address);
    433         usb_log_debug("Control WRITE (%d) %d:%d %zu(%zu).\n",
    434             speed, target.address, target.endpoint, size, max_packet_size);
     424        usb_log_debug("Control WRITE (%d) %d:%d %zu.\n",
     425            speed, target.address, target.endpoint, size);
    435426        endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    436427            target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
     
    444435
    445436        usb_transfer_batch_t *batch =
    446             batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,
     437            batch_get(fun, target, USB_TRANSFER_CONTROL, ep->max_packet_size, speed,
    447438                data, size, setup_data, setup_size, NULL, callback, arg, ep);
    448439        if (!batch)
     
    461452 * @param[in] fun DDF function that was called.
    462453 * @param[in] target USB device to write to.
    463  * @param[in] max_packet_size maximum size of data packet the device accepts.
    464454 * @param[in] setup_data Data to send with SETUP packet.
    465455 * @param[in] setup_size Size of data to send with SETUP packet (should be 8B).
     
    471461 */
    472462static int control_read(
    473     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
     463    ddf_fun_t *fun, usb_target_t target,
    474464    void *setup_data, size_t setup_size, void *data, size_t size,
    475465    usbhc_iface_transfer_in_callback_t callback, void *arg)
     
    481471            usb_device_keeper_get_speed(&hc->manager, target.address);
    482472
    483         usb_log_debug("Control READ(%d) %d:%d %zu(%zu).\n",
    484             speed, target.address, target.endpoint, size, max_packet_size);
     473        usb_log_debug("Control READ(%d) %d:%d %zu.\n",
     474            speed, target.address, target.endpoint, size);
    485475        endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    486476            target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
     
    490480        }
    491481        usb_transfer_batch_t *batch =
    492             batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,
     482            batch_get(fun, target, USB_TRANSFER_CONTROL, ep->max_packet_size, speed,
    493483                data, size, setup_data, setup_size, callback, NULL, arg, ep);
    494484        if (!batch)
Note: See TracChangeset for help on using the changeset viewer.