Changeset e1dbcbc in mainline for uspace/drv/usbhid/main.c


Ignore:
Timestamp:
2011-04-29T13:43:01Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a81a1d09
Parents:
380e0364 (diff), f19f1b7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge development/ changes

File:
1 edited

Legend:

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

    r380e0364 re1dbcbc  
    4242
    4343#include <usb/devdrv.h>
     44#include <usb/devpoll.h>
    4445
    4546#include "usbhid.h"
     
    7475static int usb_hid_try_add_device(usb_device_t *dev)
    7576{
     77        assert(dev != NULL);
     78       
    7679        /*
    7780         * Initialize device (get and process descriptors, get address, etc.)
     
    98101        /* Create the function exposed under /dev/devices. */
    99102        ddf_fun_t *hid_fun = ddf_fun_create(dev->ddf_dev, fun_exposed,
    100             usb_hid_get_function_name(hid_dev->device_type));
     103            usb_hid_get_function_name(hid_dev));
    101104        if (hid_fun == NULL) {
    102105                usb_log_error("Could not create DDF function node.\n");
     
    111114        hid_fun->ops = &hid_dev->ops;
    112115        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         */
    113127
    114128        rc = ddf_fun_bind(hid_fun);
     
    122136        }
    123137       
    124         rc = ddf_fun_add_to_class(hid_fun,
    125             usb_hid_get_class_name(hid_dev->device_type));
     138        rc = ddf_fun_add_to_class(hid_fun, usb_hid_get_class_name(hid_dev));
    126139        if (rc != EOK) {
    127140                usb_log_error(
     
    142155           hid_dev->poll_pipe_index,
    143156           /* Callback when data arrives. */
    144            hid_dev->poll_callback,
     157           usb_hid_polling_callback,
    145158           /* How much data to request. */
    146159           dev->pipes[hid_dev->poll_pipe_index].pipe->max_packet_size,
     
    178191        usb_log_debug("usb_hid_add_device()\n");
    179192       
     193        if (dev == NULL) {
     194                usb_log_warning("Wrong parameter given for add_device().\n");
     195                return EINVAL;
     196        }
     197       
    180198        if (dev->interface_no < 0) {
    181199                usb_log_warning("Device is not a supported HID device.\n");
Note: See TracChangeset for help on using the changeset viewer.