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

Changeset 69ac0fd in mainline


Ignore:
Timestamp:
2011-05-07T11:36:17Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
df0bbe1
Parents:
e5165a3
Message:

Getting HC handle by class in libusb

Location:
uspace
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/lsusb/main.c

    re5165a3 r69ac0fd  
    4444#include <devman.h>
    4545#include <devmap.h>
     46#include <usb/host.h>
    4647
    4748#define NAME "lsusb"
     
    4950#define MAX_FAILED_ATTEMPTS 4
    5051#define MAX_PATH_LENGTH 1024
    51 
    52 static int get_hc_handle(size_t class_index, devman_handle_t *hc_handle)
    53 {
    54         char *class_index_str;
    55         devman_handle_t hc_handle_tmp;
    56         int rc;
    57 
    58         rc = asprintf(&class_index_str, "%zu", class_index);
    59         if (rc < 0) {
    60                 return ENOMEM;
    61         }
    62         rc = devman_device_get_handle_by_class("usbhc", class_index_str,
    63             &hc_handle_tmp, 0);
    64         free(class_index_str);
    65         if (rc != EOK) {
    66                 return rc;
    67         }
    68 
    69         if (hc_handle != NULL) {
    70                 *hc_handle = hc_handle_tmp;
    71         }
    72 
    73         return EOK;
    74 }
    7552
    7653int main(int argc, char *argv[])
     
    8259                class_index++;
    8360                devman_handle_t hc_handle = 0;
    84                 int rc = get_hc_handle(class_index, &hc_handle);
     61                int rc = usb_ddf_get_hc_handle_by_class(class_index, &hc_handle);
    8562                if (rc != EOK) {
    8663                        failed_attempts++;
  • uspace/lib/usb/Makefile

    re5165a3 r69ac0fd  
    4646        src/hidparser.c \
    4747        src/hiddescriptor.c \
     48        src/host.c \
    4849        src/hub.c \
    4950        src/pipepriv.c \
Note: See TracChangeset for help on using the changeset viewer.