Changeset 954ea70 in mainline for uspace/lib/usbvirt/main.c


Ignore:
Timestamp:
2010-10-22T14:55:33Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b8a3cda
Parents:
a498728
Message:

usbvirt: standard requests handled better

Also, SET_ADDRESS works according to specification.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbvirt/main.c

    ra498728 r954ea70  
    122122                return EINVAL;
    123123        }
    124         if ((buffer == NULL) || (size == 0)) {
     124        if ((buffer == NULL) && (size != 0)) {
    125125                return EINVAL;
    126126        }
     
    131131        int rc;
    132132       
    133         req = async_send_2(phone,
     133        req = async_send_3(phone,
    134134            IPC_M_USBVIRT_DATA_FROM_DEVICE,
    135135            dev->address,
    136136            endpoint,
     137            size,
    137138            &answer_data);
    138139       
    139         rc = async_data_write_start(phone, buffer, size);
    140         if (rc != EOK) {
    141                 async_wait_for(req, NULL);
    142                 return rc;
     140        if (size > 0) {
     141                rc = async_data_write_start(phone, buffer, size);
     142                if (rc != EOK) {
     143                        async_wait_for(req, NULL);
     144                        return rc;
     145                }
    143146        }
    144147       
Note: See TracChangeset for help on using the changeset viewer.