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


Ignore:
File:
1 edited

Legend:

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

    re63a4e1 rf8597ca  
    6868static link_t transaction_list;
    6969
    70 #define TRANSACTION_FORMAT "T[%d.%d %s/%s (%d)]"
     70#define TRANSACTION_FORMAT "T[%d:%d %s (%d)]"
    7171#define TRANSACTION_PRINTF(t) \
    7272        (t).target.address, (t).target.endpoint, \
    73         usb_str_transfer_type((t).transfer_type), \
    7473        usbvirt_str_transaction_type((t).type), \
    7574        (int)(t).len
     
    7776#define transaction_get_instance(lnk) \
    7877        list_get_instance(lnk, transaction_t, link)
    79 
    80 #define HUB_STATUS_MAX_LEN (HUB_PORT_COUNT + 64)
    8178
    8279static inline unsigned int pseudo_random(unsigned int *seed)
     
    10299/** Host controller manager main function.
    103100 */
    104 static int hc_manager_fibril(void *arg)
     101void hc_manager(void)
    105102{
    106103        list_initialize(&transaction_list);
     
    117114                }
    118115               
    119                 char ports[HUB_STATUS_MAX_LEN + 1];
    120                 virthub_get_status(&virtual_hub_device, ports, HUB_STATUS_MAX_LEN);
     116                char ports[HUB_PORT_COUNT + 2];
     117                hub_get_port_statuses(ports, HUB_PORT_COUNT + 1);
     118                dprintf(4, "virtual hub: addr=%d ports=%s",
     119                    virthub_dev.address, ports);
    121120               
    122121                link_t *first_transaction_link = transaction_list.next;
     
    126125               
    127126
    128                 dprintf(0, "about to process " TRANSACTION_FORMAT " [%s]",
     127                dprintf(0, "about to process " TRANSACTION_FORMAT " (vhub:%s)",
    129128                    TRANSACTION_PRINTF(*transaction), ports);
    130129
     
    139138                free(transaction);
    140139        }
    141 
    142         assert(false && "unreachable");
    143         return EOK;
    144 }
    145 
    146 void hc_manager(void)
    147 {
    148         fid_t fid = fibril_create(hc_manager_fibril, NULL);
    149         if (fid == 0) {
    150                 printf(NAME ": failed to start HC manager fibril\n");
    151                 return;
    152         }
    153         fibril_add_ready(fid);
    154140}
    155141
     
    157143 */
    158144static transaction_t *transaction_create(usbvirt_transaction_type_t type,
    159     usb_target_t target, usb_transfer_type_t transfer_type,
     145    usb_target_t target,
    160146    void * buffer, size_t len,
    161147    hc_transaction_done_callback_t callback, void * arg)
     
    165151        list_initialize(&transaction->link);
    166152        transaction->type = type;
    167         transaction->transfer_type = transfer_type;
    168153        transaction->target = target;
    169154        transaction->buffer = buffer;
     
    181166 */
    182167void hc_add_transaction_to_device(bool setup, usb_target_t target,
    183     usb_transfer_type_t transfer_type,
    184168    void * buffer, size_t len,
    185169    hc_transaction_done_callback_t callback, void * arg)
    186170{
    187171        transaction_t *transaction = transaction_create(
    188             setup ? USBVIRT_TRANSACTION_SETUP : USBVIRT_TRANSACTION_OUT,
    189             target, transfer_type,
     172            setup ? USBVIRT_TRANSACTION_SETUP : USBVIRT_TRANSACTION_OUT, target,
    190173            buffer, len, callback, arg);
    191174        list_append(&transaction->link, &transaction_list);
     
    195178 */
    196179void hc_add_transaction_from_device(usb_target_t target,
    197     usb_transfer_type_t transfer_type,
    198180    void * buffer, size_t len,
    199181    hc_transaction_done_callback_t callback, void * arg)
    200182{
    201183        transaction_t *transaction = transaction_create(USBVIRT_TRANSACTION_IN,
    202             target, transfer_type,
    203             buffer, len, callback, arg);
     184            target, buffer, len, callback, arg);
    204185        list_append(&transaction->link, &transaction_list);
    205186}
Note: See TracChangeset for help on using the changeset viewer.