Changes in uspace/drv/vhc/hc.c [daec5e04:e63a4e1] in mainline


Ignore:
File:
1 edited

Legend:

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

    rdaec5e04 re63a4e1  
    2727 */
    2828
    29 /** @addtogroup drvusbvhc
     29/** @addtogroup usb
    3030 * @{
    3131 */
     
    3434 */
    3535
     36#include <ipc/ipc.h>
    3637#include <adt/list.h>
    3738#include <bool.h>
     
    8990 */
    9091static void process_transaction_with_outcome(transaction_t * transaction,
    91     int outcome)
    92 {
    93         usb_log_debug2("Transaction " TRANSACTION_FORMAT " done: %s.\n",
     92    usb_transaction_outcome_t outcome)
     93{
     94        dprintf(3, "transaction " TRANSACTION_FORMAT " done, outcome: %s",
    9495            TRANSACTION_PRINTF(*transaction),
    95             str_error(outcome));
    96        
    97         transaction->callback(transaction->buffer, transaction->actual_len,
    98             outcome, transaction->callback_arg);
     96            usb_str_transaction_outcome(outcome));
     97       
     98        transaction->callback(transaction->buffer, transaction->len, outcome,
     99            transaction->callback_arg);
    99100}
    100101
     
    107108        static unsigned int seed = 4573;
    108109       
    109         usb_log_info("Transaction processor ready.\n");
     110        printf("%s: transaction processor ready.\n", NAME);
    110111       
    111112        while (true) {
     
    124125                list_remove(first_transaction_link);
    125126               
    126                 usb_log_debug("Processing " TRANSACTION_FORMAT " [%s].\n",
     127
     128                dprintf(0, "about to process " TRANSACTION_FORMAT " [%s]",
    127129                    TRANSACTION_PRINTF(*transaction), ports);
    128130
    129                 int outcome;
     131                dprintf(3, "processing transaction " TRANSACTION_FORMAT "",
     132                    TRANSACTION_PRINTF(*transaction));
     133               
     134                usb_transaction_outcome_t outcome;
    130135                outcome = virtdev_send_to_all(transaction);
    131136               
     
    143148        fid_t fid = fibril_create(hc_manager_fibril, NULL);
    144149        if (fid == 0) {
    145                 usb_log_fatal("Failed to start HC manager fibril.\n");
     150                printf(NAME ": failed to start HC manager fibril\n");
    146151                return;
    147152        }
     
    164169        transaction->buffer = buffer;
    165170        transaction->len = len;
    166         transaction->actual_len = len;
    167171        transaction->callback = callback;
    168172        transaction->callback_arg = arg;
    169 
     173       
     174        dprintf(3, "creating transaction " TRANSACTION_FORMAT,
     175            TRANSACTION_PRINTF(*transaction));
     176       
    170177        return transaction;
    171 }
    172 
    173 static void hc_add_transaction(transaction_t *transaction)
    174 {
    175         usb_log_debug("Adding transaction " TRANSACTION_FORMAT ".\n",
    176             TRANSACTION_PRINTF(*transaction));
    177         list_append(&transaction->link, &transaction_list);
    178178}
    179179
     
    189189            target, transfer_type,
    190190            buffer, len, callback, arg);
    191         hc_add_transaction(transaction);
     191        list_append(&transaction->link, &transaction_list);
    192192}
    193193
     
    202202            target, transfer_type,
    203203            buffer, len, callback, arg);
    204         hc_add_transaction(transaction);
     204        list_append(&transaction->link, &transaction_list);
    205205}
    206206
Note: See TracChangeset for help on using the changeset viewer.