Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset eac610e in mainline


Ignore:
Timestamp:
2010-12-08T23:40:38Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
07b9203e
Parents:
90fb679
Message:

Fix of several stupid bugs

There were actually four (kind of) bugs fixed in this commit:

  • switched arguments in a function call (really stupid)
  • async_data_read_receive and async_data_read_finalize not paired together
  • reading wrong arguments of a call (the DDF uses IPC_GET_ARG1 for the actual method (as the IPC_GET_METHOD returns interface index) and first argument is in IPC_GET_ARG2)
  • wrong SETUP packet for GET_DESCRIPTOR request


Also, added DEV_IPC_GET_ARG[1-4] for retrieveing arguments in DDF
interfaces in less confusing way (hope so).

Location:
uspace
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/vhc/connhost.c

    r90fb679 reac610e  
    5858                case USB_DIRECTION_IN:
    5959                        transfer->in_callback(transfer->dev,
    60                             size, outcome,
     60                            outcome, size,
    6161                            transfer->arg);
    6262                        break;
  • uspace/lib/c/include/ipc/dev_iface.h

    r90fb679 reac610e  
    5454        DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX)
    5555
     56/*
     57 * The first argument is actually method (as the "real" method is used
     58 * for indexing into interfaces.
     59 */
     60
     61#define DEV_IPC_GET_ARG1(call) IPC_GET_ARG2((call))
     62#define DEV_IPC_GET_ARG2(call) IPC_GET_ARG3((call))
     63#define DEV_IPC_GET_ARG3(call) IPC_GET_ARG4((call))
     64#define DEV_IPC_GET_ARG4(call) IPC_GET_ARG5((call))
     65
    5666
    5767#endif
  • uspace/lib/drv/generic/remote_usbhc.c

    r90fb679 reac610e  
    108108        }
    109109
    110         devman_handle_t handle = IPC_GET_ARG1(*call);
     110        devman_handle_t handle = DEV_IPC_GET_ARG1(*call);
    111111
    112112        usb_address_t address;
     
    122122    ipc_callid_t callid, ipc_call_t *call)
    123123{
    124         ipcarg_t buffer_hash = IPC_GET_ARG1(*call);
     124        ipcarg_t buffer_hash = DEV_IPC_GET_ARG1(*call);
    125125        async_transaction_t * trans = (async_transaction_t *)buffer_hash;
    126126        if (trans == NULL) {
     
    144144                accepted_size = trans->size;
    145145        }
    146         async_data_read_finalize(callid, trans->buffer, accepted_size);
     146        async_data_read_finalize(cid, trans->buffer, accepted_size);
    147147
    148148        ipc_answer_1(callid, EOK, accepted_size);
     
    211211        }
    212212
    213         usb_address_t address = (usb_address_t) IPC_GET_ARG1(*call);
    214         devman_handle_t handle = (devman_handle_t) IPC_GET_ARG2(*call);
     213        usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);
     214        devman_handle_t handle = (devman_handle_t) DEV_IPC_GET_ARG2(*call);
    215215
    216216        int rc = usb_iface->bind_address(device, address, handle);
     
    229229        }
    230230
    231         usb_address_t address = (usb_address_t) IPC_GET_ARG1(*call);
     231        usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);
    232232
    233233        int rc = usb_iface->release_address(device, address);
     
    275275        }
    276276
    277         size_t expected_len = IPC_GET_ARG3(*call);
     277        size_t expected_len = DEV_IPC_GET_ARG3(*call);
    278278        usb_target_t target = {
    279                 .address = IPC_GET_ARG1(*call),
    280                 .endpoint = IPC_GET_ARG2(*call)
     279                .address = DEV_IPC_GET_ARG1(*call),
     280                .endpoint = DEV_IPC_GET_ARG2(*call)
    281281        };
    282282
     
    327327        }
    328328
    329         size_t len = IPC_GET_ARG3(*call);
     329        size_t len = DEV_IPC_GET_ARG3(*call);
    330330        usb_target_t target = {
    331                 .address = IPC_GET_ARG1(*call),
    332                 .endpoint = IPC_GET_ARG2(*call)
     331                .address = DEV_IPC_GET_ARG1(*call),
     332                .endpoint = DEV_IPC_GET_ARG2(*call)
    333333        };
    334334
     
    384384
    385385        usb_target_t target = {
    386                 .address = IPC_GET_ARG1(*call),
    387                 .endpoint = IPC_GET_ARG2(*call)
     386                .address = DEV_IPC_GET_ARG1(*call),
     387                .endpoint = DEV_IPC_GET_ARG2(*call)
    388388        };
    389389
  • uspace/lib/usb/src/usbdrvreq.c

    r90fb679 reac610e  
    117117        /* Prepare the setup packet. */
    118118        usb_device_request_setup_packet_t setup_packet = {
    119                 .request_type = 0,
     119                .request_type = 128,
    120120                .request = USB_DEVREQ_GET_DESCRIPTOR,
    121121                .index = 0,
     
    130130        /* Start the control read transfer. */
    131131        rc = usb_drv_async_control_read_setup(phone, target,
    132             &setup_packet, sizeof(setup_packet), &handle);
     132            &setup_packet, sizeof(usb_device_request_setup_packet_t), &handle);
    133133        if (rc != EOK) {
    134134                return rc;
Note: See TracChangeset for help on using the changeset viewer.