Ignore:
File:
1 edited

Legend:

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

    rec59693 r5842493  
    4040
    4141#define USB_MAX_PAYLOAD_SIZE 1020
    42 #define HACK_MAX_PACKET_SIZE 8
    43 #define HACK_MAX_PACKET_SIZE_INTERRUPT_IN 4
    4442
    4543static void remote_usbhc_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
     
    242240
    243241static void callback_out(device_t *device,
    244     int outcome, void *arg)
     242    usb_transaction_outcome_t outcome, void *arg)
    245243{
    246244        async_transaction_t *trans = (async_transaction_t *)arg;
     
    252250
    253251static void callback_in(device_t *device,
    254     int outcome, size_t actual_size, void *arg)
     252    usb_transaction_outcome_t outcome, size_t actual_size, void *arg)
    255253{
    256254        async_transaction_t *trans = (async_transaction_t *)arg;
    257255
    258         if (outcome != EOK) {
     256        if (outcome != USB_OUTCOME_OK) {
    259257                async_answer_0(trans->caller, outcome);
    260258                if (trans->data_caller) {
     
    272270        }
    273271
    274         async_answer_0(trans->caller, EOK);
     272        async_answer_0(trans->caller, USB_OUTCOME_OK);
    275273
    276274        async_transaction_destroy(trans);
     
    324322        trans->size = len;
    325323
    326         int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE,
    327             buffer, len,
     324        int rc = transfer_func(device, target, buffer, len,
    328325            callback_out, trans);
    329326
     
    371368        trans->size = len;
    372369
    373         int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE_INTERRUPT_IN,
    374             trans->buffer, len,
     370        int rc = transfer_func(device, target, trans->buffer, len,
    375371            callback_in, trans);
    376372
     
    544540                .endpoint = DEV_IPC_GET_ARG2(*call)
    545541        };
    546         size_t data_buffer_len = DEV_IPC_GET_ARG3(*call);
    547542
    548543        int rc;
     
    551546        void *data_buffer = NULL;
    552547        size_t setup_packet_len = 0;
     548        size_t data_buffer_len = 0;
    553549
    554550        rc = async_data_write_accept(&setup_packet, false,
     
    558554                return;
    559555        }
    560 
    561         if (data_buffer_len > 0) {
    562                 rc = async_data_write_accept(&data_buffer, false,
    563                     1, USB_MAX_PAYLOAD_SIZE, 0, &data_buffer_len);
    564                 if (rc != EOK) {
    565                         async_answer_0(callid, rc);
    566                         free(setup_packet);
    567                         return;
    568                 }
     556        rc = async_data_write_accept(&data_buffer, false,
     557            1, USB_MAX_PAYLOAD_SIZE, 0, &data_buffer_len);
     558        if (rc != EOK) {
     559                async_answer_0(callid, rc);
     560                free(setup_packet);
     561                return;
    569562        }
    570563
     
    580573        trans->size = data_buffer_len;
    581574
    582         rc = usb_iface->control_write(device, target, HACK_MAX_PACKET_SIZE,
     575        rc = usb_iface->control_write(device, target,
    583576            setup_packet, setup_packet_len,
    584577            data_buffer, data_buffer_len,
     
    603596        }
    604597
     598        size_t data_len = DEV_IPC_GET_ARG3(*call);
    605599        usb_target_t target = {
    606600                .address = DEV_IPC_GET_ARG1(*call),
     
    612606        void *setup_packet = NULL;
    613607        size_t setup_packet_len = 0;
    614         size_t data_len = 0;
    615608
    616609        rc = async_data_write_accept(&setup_packet, false,
     
    644637        }
    645638
    646         rc = usb_iface->control_read(device, target, HACK_MAX_PACKET_SIZE,
     639        rc = usb_iface->control_read(device, target,
    647640            setup_packet, setup_packet_len,
    648641            trans->buffer, trans->size,
Note: See TracChangeset for help on using the changeset viewer.