Changeset 228f251 in mainline


Ignore:
Timestamp:
2011-02-18T20:06:27Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b36e5de2
Parents:
867e6735
Message:

Max packet size actually sent over IPC

Location:
uspace/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usbhc.c

    r867e6735 r228f251  
    297297        }
    298298
    299         size_t expected_len = DEV_IPC_GET_ARG3(*call);
     299        size_t max_packet_size = DEV_IPC_GET_ARG3(*call);
    300300        usb_target_t target = {
    301301                .address = DEV_IPC_GET_ARG1(*call),
     
    305305        size_t len = 0;
    306306        void *buffer = NULL;
    307         if (expected_len > 0) {
    308                 int rc = async_data_write_accept(&buffer, false,
    309                     1, USB_MAX_PAYLOAD_SIZE,
    310                     0, &len);
    311 
    312                 if (rc != EOK) {
    313                         async_answer_0(callid, rc);
    314                         return;
    315                 }
     307
     308        int rc = async_data_write_accept(&buffer, false,
     309            1, USB_MAX_PAYLOAD_SIZE,
     310            0, &len);
     311
     312        if (rc != EOK) {
     313                async_answer_0(callid, rc);
     314                return;
    316315        }
    317316
     
    328327        trans->size = len;
    329328
    330         int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE,
     329        rc = transfer_func(device, target, max_packet_size,
    331330            buffer, len,
    332331            callback_out, trans);
     
    354353        }
    355354
    356         size_t len = DEV_IPC_GET_ARG3(*call);
     355        size_t max_packet_size = DEV_IPC_GET_ARG3(*call);
    357356        usb_target_t target = {
    358357                .address = DEV_IPC_GET_ARG1(*call),
     
    360359        };
    361360
     361        size_t len;
    362362        ipc_callid_t data_callid;
    363363        if (!async_data_read_receive(&data_callid, &len)) {
     
    375375        trans->size = len;
    376376
    377         int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE_INTERRUPT_IN,
     377        int rc = transfer_func(device, target, max_packet_size,
    378378            trans->buffer, len,
    379379            callback_in, trans);
     
    549549        };
    550550        size_t data_buffer_len = DEV_IPC_GET_ARG3(*call);
     551        size_t max_packet_size = DEV_IPC_GET_ARG4(*call);
    551552
    552553        int rc;
     
    584585        trans->size = data_buffer_len;
    585586
    586         rc = usb_iface->control_write(device, target, HACK_MAX_PACKET_SIZE,
     587        rc = usb_iface->control_write(device, target, max_packet_size,
    587588            setup_packet, setup_packet_len,
    588589            data_buffer, data_buffer_len,
     
    611612                .endpoint = DEV_IPC_GET_ARG2(*call)
    612613        };
     614        size_t max_packet_size = DEV_IPC_GET_ARG3(*call);
    613615
    614616        int rc;
     
    648650        }
    649651
    650         rc = usb_iface->control_read(device, target, HACK_MAX_PACKET_SIZE,
     652        rc = usb_iface->control_read(device, target, max_packet_size,
    651653            setup_packet, setup_packet_len,
    652654            trans->buffer, trans->size,
  • uspace/lib/drv/include/usbhc_iface.h

    r867e6735 r228f251  
    5353 *   - argument #1 is target address
    5454 *   - argument #2 is target endpoint
    55  *   - argument #3 is buffer size
     55 *   - argument #3 is max packet size of the endpoint
    5656 * - this call is immediately followed by IPC data write (from caller)
    5757 * - the initial call (and the whole transaction) is answer after the
     
    6666 *   - argument #1 is target address
    6767 *   - argument #2 is target endpoint
    68  *   - argument #3 is buffer size
     68 *   - argument #3 is max packet size of the endpoint
    6969 * - this call is immediately followed by IPC data read (async version)
    7070 * - the call is not answered until the device returns some data (or until
     
    194194        IPC_M_USBHC_CONTROL_WRITE,
    195195
    196         /** Issue control WRITE transfer.
     196        /** Issue control READ transfer.
    197197         * See explanation at usb_iface_funcs_t (IN transaction) for
    198198         * call parameters.
    199          * This call is immediately followed by IPC data read from the caller
    200          * (setup packet).
    201          * Actual data are retrieved through IPC_M_USBHC_GET_BUFFER.
     199         * This call is immediately followed by IPC data write from the caller
     200         * (setup packet) and IPC data read (buffer that was read).
    202201         */
    203202        IPC_M_USBHC_CONTROL_READ,
  • uspace/lib/usb/src/pipesio.c

    r867e6735 r228f251  
    7878         * Make call identifying target USB device and type of transfer.
    7979         */
    80         aid_t opening_request = async_send_3(pipe->hc_phone,
     80        aid_t opening_request = async_send_4(pipe->hc_phone,
    8181            DEV_IFACE_ID(USBHC_DEV_IFACE), ipc_method,
    8282            pipe->wire->address, pipe->endpoint_no,
     83            pipe->max_packet_size,
    8384            NULL);
    8485        if (opening_request == 0) {
     
    201202         * Make call identifying target USB device and type of transfer.
    202203         */
    203         aid_t opening_request = async_send_3(pipe->hc_phone,
     204        aid_t opening_request = async_send_4(pipe->hc_phone,
    204205            DEV_IFACE_ID(USBHC_DEV_IFACE), ipc_method,
    205206            pipe->wire->address, pipe->endpoint_no,
     207            pipe->max_packet_size,
    206208            NULL);
    207209        if (opening_request == 0) {
     
    283285         * Make call identifying target USB device and control transfer type.
    284286         */
    285         aid_t opening_request = async_send_3(pipe->hc_phone,
     287        aid_t opening_request = async_send_4(pipe->hc_phone,
    286288            DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_CONTROL_READ,
    287289            pipe->wire->address, pipe->endpoint_no,
     290            pipe->max_packet_size,
    288291            NULL);
    289292        if (opening_request == 0) {
     
    402405         * Make call identifying target USB device and control transfer type.
    403406         */
    404         aid_t opening_request = async_send_4(pipe->hc_phone,
     407        aid_t opening_request = async_send_5(pipe->hc_phone,
    405408            DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_CONTROL_WRITE,
    406409            pipe->wire->address, pipe->endpoint_no,
    407410            data_buffer_size,
     411            pipe->max_packet_size,
    408412            NULL);
    409413        if (opening_request == 0) {
Note: See TracChangeset for help on using the changeset viewer.