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

Ignore:
Timestamp:
2011-01-08T19:01:10Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial
Children:
b276c3b
Parents:
93fb170c
Message:

Begin work on usb identification

Add uhci_setup_sync function to support blocking calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/utils/hc_synchronizer.c

    r93fb170c r15be932  
     1#include "debug.h"
    12#include "hc_synchronizer.h"
     3#include "uhci.h"
    24
    35void sync_init(sync_value_t *value)
     
    3133        fibril_semaphore_up(&value->done);
    3234}
     35/*----------------------------------------------------------------------------*/
     36int uhci_setup_sync(
     37  device_t *hc,
     38  usb_target_t target,
     39  usb_transfer_type_t type,
     40  void *buffer, size_t size,
     41  sync_value_t *result
     42  )
     43{
     44        assert(result);
     45        sync_init(result);
     46
     47        int ret =
     48          uhci_setup(hc, target, type, buffer, size,
     49                  sync_out_callback, (void*)result);
     50
     51        if (ret) {
     52                uhci_print_error("sync setup transaction failed(%d).\n", ret);
     53                return ret;
     54        }
     55
     56        uhci_print_verbose("setup transaction sent, waiting to complete.\n");
     57        sync_wait_for(result);
     58
     59        return ret;
     60}
Note: See TracChangeset for help on using the changeset viewer.