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

Changeset 0b31409 in mainline


Ignore:
Timestamp:
2011-02-01T11:34:03Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial
Children:
0c3beeb, 1537ba6
Parents:
6028ec8
Message:

Virtual host controller uses usb_log_* functions

Location:
uspace/drv/vhc
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/vhc/Makefile

    r6028ec8 r0b31409  
    4444        conndev.c \
    4545        connhost.c \
    46         debug.c \
    4746        devices.c \
    4847        hc.c \
  • uspace/drv/vhc/conndev.c

    r6028ec8 r0b31409  
    9999                int rc = get_device_name(callback, devname, DEVICE_NAME_MAXLENGTH);
    100100
    101                 dprintf(0, "virtual device connected (name: %s, id: %x)",
     101                usb_log_info("New virtual device `%s' (id = %x).\n",
    102102                    rc == EOK ? devname : "<unknown>", dev->id);
    103103
     
    122122        }
    123123
    124         dprintf(0, "virtual device disconnected (id: %x)", dev->id);
     124        usb_log_info("Virtual device disconnected (id = %x).\n", dev->id);
    125125        virtdev_destroy_device(dev);
    126126}
  • uspace/drv/vhc/connhost.c

    r6028ec8 r0b31409  
    9393    usbhc_iface_transfer_out_callback_t callback, void *arg)
    9494{
    95         dprintf(3, "transfer OUT [%d.%d (%s); %zu]",
     95        usb_log_debug2("Transfer OUT [%d.%d (%s); %zu].\n",
    9696            target.address, target.endpoint,
    9797            usb_str_transfer_type(transfer_type),
     
    113113    usbhc_iface_transfer_out_callback_t callback, void *arg)
    114114{
    115         dprintf(3, "transfer SETUP [%d.%d (%s); %zu]",
     115        usb_log_debug2("Transfer SETUP [%d.%d (%s); %zu].\n",
    116116            target.address, target.endpoint,
    117117            usb_str_transfer_type(transfer_type),
     
    133133    usbhc_iface_transfer_in_callback_t callback, void *arg)
    134134{
    135         dprintf(3, "transfer IN [%d.%d (%s); %zu]",
     135        usb_log_debug2("Transfer IN [%d.%d (%s); %zu].\n",
    136136            target.address, target.endpoint,
    137137            usb_str_transfer_type(transfer_type),
  • uspace/drv/vhc/devices.c

    r6028ec8 r0b31409  
    196196        if (virtual_hub_device.address == transaction->target.address) {
    197197                size_t tmp;
    198                 dprintf(1, "sending `%s' transaction to hub",
     198                usb_log_debug2("Sending `%s' transaction to hub.\n",
    199199                    usbvirt_str_transaction_type(transaction->type));
    200200                switch (transaction->type) {
     
    222222                                break;
    223223                }
    224                 dprintf(4, "transaction on hub processed...");
    225224                outcome = USB_OUTCOME_OK;
    226225        }
  • uspace/drv/vhc/hc.c

    r6028ec8 r0b31409  
    9292    usb_transaction_outcome_t outcome)
    9393{
    94         dprintf(3, "transaction " TRANSACTION_FORMAT " done, outcome: %s",
     94        usb_log_debug2("Transaction " TRANSACTION_FORMAT " done: %s.\n",
    9595            TRANSACTION_PRINTF(*transaction),
    9696            usb_str_transaction_outcome(outcome));
     
    108108        static unsigned int seed = 4573;
    109109       
    110         printf("%s: transaction processor ready.\n", NAME);
     110        usb_log_info("Transaction processor ready.\n");
    111111       
    112112        while (true) {
     
    125125                list_remove(first_transaction_link);
    126126               
    127 
    128                 dprintf(0, "about to process " TRANSACTION_FORMAT " [%s]",
     127                usb_log_debug("Processing " TRANSACTION_FORMAT " [%s].\n",
    129128                    TRANSACTION_PRINTF(*transaction), ports);
    130129
    131                 dprintf(3, "processing transaction " TRANSACTION_FORMAT "",
    132                     TRANSACTION_PRINTF(*transaction));
    133                
    134130                usb_transaction_outcome_t outcome;
    135131                outcome = virtdev_send_to_all(transaction);
     
    148144        fid_t fid = fibril_create(hc_manager_fibril, NULL);
    149145        if (fid == 0) {
    150                 printf(NAME ": failed to start HC manager fibril\n");
     146                usb_log_fatal("Failed to start HC manager fibril.\n");
    151147                return;
    152148        }
     
    172168        transaction->callback = callback;
    173169        transaction->callback_arg = arg;
    174        
    175         dprintf(3, "creating transaction " TRANSACTION_FORMAT,
     170
     171        return transaction;
     172}
     173
     174static void hc_add_transaction(transaction_t *transaction)
     175{
     176        usb_log_debug("Adding transaction " TRANSACTION_FORMAT ".\n",
    176177            TRANSACTION_PRINTF(*transaction));
    177        
    178         return transaction;
     178        list_append(&transaction->link, &transaction_list);
    179179}
    180180
     
    190190            target, transfer_type,
    191191            buffer, len, callback, arg);
    192         list_append(&transaction->link, &transaction_list);
     192        hc_add_transaction(transaction);
    193193}
    194194
     
    203203            target, transfer_type,
    204204            buffer, len, callback, arg);
    205         list_append(&transaction->link, &transaction_list);
     205        hc_add_transaction(transaction);
    206206}
    207207
  • uspace/drv/vhc/hcd.c

    r6028ec8 r0b31409  
    9494        virtual_hub_device_init(dev);
    9595
    96         printf("%s: virtual USB host controller ready.\n", NAME);
     96        usb_log_info("Virtual USB host controller ready (id = %zu).\n",
     97            (size_t) dev->handle);
    9798
    9899        return EOK;
     
    117118        sleep(5);
    118119
    119         usb_dprintf_enable(NAME, -1);
     120        usb_log_enable(USB_LOG_LEVEL_INFO, NAME);
    120121
    121122        printf(NAME ": virtual USB host controller driver.\n");
  • uspace/drv/vhc/hub.c

    r6028ec8 r0b31409  
    6363            = fibril_create(hub_register_in_devman_fibril, hc_dev);
    6464        if (root_hub_registration == 0) {
    65                 printf(NAME ": failed to create hub registration fibril\n");
     65                usb_log_fatal("Failed to create hub registration fibril.\n");
    6666                return;
    6767        }
  • uspace/drv/vhc/vhcd.h

    r6028ec8 r0b31409  
    4545#define DEVMAP_PATH_DEV NAMESPACE "/" NAME_DEV
    4646
    47 #define dprintf(level, format, ...) \
    48         usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__)
    49 void dprintf_inval_call(int, ipc_call_t, sysarg_t);
     47//#define dprintf(level, format, ...)
     48//      usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__)
     49//void dprintf_inval_call(int, ipc_call_t, sysarg_t);
    5050
    5151#endif
Note: See TracChangeset for help on using the changeset viewer.