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


Ignore:
File:
1 edited

Legend:

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

    re63a4e1 rdaec5e04  
    2727 */
    2828
    29 /** @addtogroup usb
     29/** @addtogroup drvusbvhc
    3030 * @{
    3131 */
     
    3434 */
    3535
    36 #include <ipc/ipc.h>
    3736#include <adt/list.h>
    3837#include <bool.h>
     
    9089 */
    9190static void process_transaction_with_outcome(transaction_t * transaction,
    92     usb_transaction_outcome_t outcome)
    93 {
    94         dprintf(3, "transaction " TRANSACTION_FORMAT " done, outcome: %s",
     91    int outcome)
     92{
     93        usb_log_debug2("Transaction " TRANSACTION_FORMAT " done: %s.\n",
    9594            TRANSACTION_PRINTF(*transaction),
    96             usb_str_transaction_outcome(outcome));
    97        
    98         transaction->callback(transaction->buffer, transaction->len, outcome,
    99             transaction->callback_arg);
     95            str_error(outcome));
     96       
     97        transaction->callback(transaction->buffer, transaction->actual_len,
     98            outcome, transaction->callback_arg);
    10099}
    101100
     
    108107        static unsigned int seed = 4573;
    109108       
    110         printf("%s: transaction processor ready.\n", NAME);
     109        usb_log_info("Transaction processor ready.\n");
    111110       
    112111        while (true) {
     
    125124                list_remove(first_transaction_link);
    126125               
    127 
    128                 dprintf(0, "about to process " TRANSACTION_FORMAT " [%s]",
     126                usb_log_debug("Processing " TRANSACTION_FORMAT " [%s].\n",
    129127                    TRANSACTION_PRINTF(*transaction), ports);
    130128
    131                 dprintf(3, "processing transaction " TRANSACTION_FORMAT "",
    132                     TRANSACTION_PRINTF(*transaction));
    133                
    134                 usb_transaction_outcome_t outcome;
     129                int outcome;
    135130                outcome = virtdev_send_to_all(transaction);
    136131               
     
    148143        fid_t fid = fibril_create(hc_manager_fibril, NULL);
    149144        if (fid == 0) {
    150                 printf(NAME ": failed to start HC manager fibril\n");
     145                usb_log_fatal("Failed to start HC manager fibril.\n");
    151146                return;
    152147        }
     
    169164        transaction->buffer = buffer;
    170165        transaction->len = len;
     166        transaction->actual_len = len;
    171167        transaction->callback = callback;
    172168        transaction->callback_arg = arg;
    173        
    174         dprintf(3, "creating transaction " TRANSACTION_FORMAT,
     169
     170        return transaction;
     171}
     172
     173static void hc_add_transaction(transaction_t *transaction)
     174{
     175        usb_log_debug("Adding transaction " TRANSACTION_FORMAT ".\n",
    175176            TRANSACTION_PRINTF(*transaction));
    176        
    177         return transaction;
     177        list_append(&transaction->link, &transaction_list);
    178178}
    179179
     
    189189            target, transfer_type,
    190190            buffer, len, callback, arg);
    191         list_append(&transaction->link, &transaction_list);
     191        hc_add_transaction(transaction);
    192192}
    193193
     
    202202            target, transfer_type,
    203203            buffer, len, callback, arg);
    204         list_append(&transaction->link, &transaction_list);
     204        hc_add_transaction(transaction);
    205205}
    206206
Note: See TracChangeset for help on using the changeset viewer.