Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/main.c

    rb20de1d r61257f4  
    4242
    4343#include <usb/devdrv.h>
    44 #include <usb/devpoll.h>
    4544
    4645#include "usbhid.h"
     
    7574static int usb_hid_try_add_device(usb_device_t *dev)
    7675{
    77         assert(dev != NULL);
    78        
    7976        /*
    8077         * Initialize device (get and process descriptors, get address, etc.)
     
    10198        /* Create the function exposed under /dev/devices. */
    10299        ddf_fun_t *hid_fun = ddf_fun_create(dev->ddf_dev, fun_exposed,
    103             usb_hid_get_function_name(hid_dev));
     100            usb_hid_get_function_name(hid_dev->device_type));
    104101        if (hid_fun == NULL) {
    105102                usb_log_error("Could not create DDF function node.\n");
     
    114111        hid_fun->ops = &hid_dev->ops;
    115112        hid_fun->driver_data = hid_dev;   // TODO: maybe change to hid_dev->data
    116        
    117         /*
    118          * 1) subdriver vytvori vlastnu ddf_fun, vlastne ddf_dev_ops, ktore da
    119          *    do nej.
    120          * 2) do tych ops do .interfaces[DEV_IFACE_USBHID (asi)] priradi
    121          *    vyplnenu strukturu usbhid_iface_t.
    122          * 3) klientska aplikacia - musi si rucne vytvorit telefon
    123          *    (devman_device_connect() - cesta k zariadeniu (/hw/pci0/...) az
    124          *    k tej fcii.
    125          *    pouzit usb/classes/hid/iface.h - prvy int je telefon
    126          */
    127113
    128114        rc = ddf_fun_bind(hid_fun);
     
    136122        }
    137123       
    138         rc = ddf_fun_add_to_class(hid_fun, usb_hid_get_class_name(hid_dev));
     124        rc = ddf_fun_add_to_class(hid_fun,
     125            usb_hid_get_class_name(hid_dev->device_type));
    139126        if (rc != EOK) {
    140127                usb_log_error(
     
    155142           hid_dev->poll_pipe_index,
    156143           /* Callback when data arrives. */
    157            usb_hid_polling_callback,
     144           hid_dev->poll_callback,
    158145           /* How much data to request. */
    159146           dev->pipes[hid_dev->poll_pipe_index].pipe->max_packet_size,
     
    191178        usb_log_debug("usb_hid_add_device()\n");
    192179       
    193         if (dev == NULL) {
    194                 usb_log_warning("Wrong parameter given for add_device().\n");
    195                 return EINVAL;
    196         }
    197        
    198180        if (dev->interface_no < 0) {
    199181                usb_log_warning("Device is not a supported HID device.\n");
Note: See TracChangeset for help on using the changeset viewer.