Ignore:
Timestamp:
2010-10-25T07:44:02Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ca07cd3
Parents:
7a7bfeb3
Message:

Better debugging support in VHCD

Also, added some missing comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/bus/usb/hcd/virtual/connhost.c

    r7a7bfeb3 r355f7c2  
    5656static void out_callback(void * buffer, size_t len, usb_transaction_outcome_t outcome, void * arg)
    5757{
    58         dprintf("out_callback(buffer, %u, %d, %p)", len, outcome, arg);
    59         (void)len;
     58        dprintf(2, "out_callback(buffer, %u, %d, %p)", len, outcome, arg);
     59       
    6060        transaction_details_t * trans = (transaction_details_t *)arg;
    6161       
     
    6363       
    6464        free(trans);
    65         free(buffer);
     65        if (buffer) {
     66                free(buffer);
     67        }
    6668}
    6769
     
    7072static void in_callback(void * buffer, size_t len, usb_transaction_outcome_t outcome, void * arg)
    7173{
    72         dprintf("in_callback(buffer, %u, %d, %p)", len, outcome, arg);
     74        dprintf(2, "in_callback(buffer, %u, %d, %p)", len, outcome, arg);
    7375        transaction_details_t * trans = (transaction_details_t *)arg;
    7476       
     
    116118        };
    117119       
    118         dprintf("pretending transfer to function (dev=%d:%d)",
     120        dprintf(1, "pretending transfer to function (dev=%d:%d)",
    119121            target.address, target.endpoint);
    120122       
     
    144146        trans->handle = handle;
    145147       
    146         dprintf("adding transaction to HC", NAME);
    147148        hc_add_transaction_to_device(setup_transaction, target,
    148149            buffer, len,
     
    150151       
    151152        ipc_answer_1(iid, EOK, handle);
    152         dprintf("transfer to function scheduled (handle %d)", handle);
     153        dprintf(2, "transfer to function scheduled (handle %d)", handle);
    153154}
    154155
     
    163164        size_t len = IPC_GET_ARG3(icall);
    164165       
    165         dprintf("pretending transfer from function (dev=%d:%d)",
     166        dprintf(1, "pretending transfer from function (dev=%d:%d)",
    166167            target.address, target.endpoint);
    167168       
     
    183184        trans->handle = handle;
    184185       
    185         dprintf("adding transaction to HC", NAME);
    186186        hc_add_transaction_from_device(target,
    187187            buffer, len,
     
    189189       
    190190        ipc_answer_1(iid, EOK, handle);
    191         dprintf("transfer from function scheduled (handle %d)", handle);
     191        dprintf(2, "transfer from function scheduled (handle %d)", handle);
    192192}
    193193
     
    197197 * By host is typically meant top-level USB driver.
    198198 *
     199 * This function also takes care of proper phone hung-up.
     200 *
    199201 * @param phone_hash Incoming phone hash.
    200202 * @param host_phone Callback phone to host.
     
    204206        assert(host_phone > 0);
    205207       
    206         dprintf("phone%#x: host connected", phone_hash);
     208        dprintf(0, "host connected through phone %#x", phone_hash);
    207209       
    208210       
     
    217219                                ipc_hangup(host_phone);
    218220                                ipc_answer_0(callid, EOK);
    219                                 dprintf("phone%#x: host hang-up", phone_hash);
     221                                dprintf(0, "phone%#x: host hung-up",
     222                                    phone_hash);
    220223                                return;
    221224                       
     
    223226                                ipc_answer_0(callid, ELIMIT);
    224227                                break;
    225 
    226                        
    227                         case IPC_M_USB_HCD_SEND_DATA:
    228                                 handle_data_to_function(callid, call,
    229                                     false, host_phone);
    230                                 break;
    231                        
    232                         case IPC_M_USB_HCD_RECEIVE_DATA:
    233                                 handle_data_from_function(callid, call, host_phone);
    234                                 break;
    235228                       
    236229                        case IPC_M_USB_HCD_TRANSACTION_SIZE:
     
    271264                       
    272265                        default:
     266                                dprintf_inval_call(2, call, phone_hash);
    273267                                ipc_answer_0(callid, EINVAL);
    274268                                break;
Note: See TracChangeset for help on using the changeset viewer.