Ignore:
File:
1 edited

Legend:

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

    rfbe148ee ra8c4e871  
    4646#include "usbhid.h"
    4747
     48/*----------------------------------------------------------------------------*/
     49
    4850#define NAME "usbhid"
    4951
     
    6567 *
    6668 * @param dev Device to add.
    67  * @return Error code.
     69 *
     70 * @retval EOK if successful.
     71 * @retval ENOMEM if there
     72 * @return Other error code inherited from one of functions usb_kbd_init(),
     73 *         ddf_fun_bind() and ddf_fun_add_to_class().
    6874 */
    6975static int usb_hid_try_add_device(usb_device_t *dev)
     
    132138        return EOK;
    133139}
     140
    134141/*----------------------------------------------------------------------------*/
    135142/**
     
    139146 *
    140147 * @param dev Structure representing the new device.
    141  * @return Error code.
     148 *
     149 * @retval EOK if successful.
     150 * @retval EREFUSED if the device is not supported.
    142151 */
    143152static int usb_hid_device_add(usb_device_t *dev)
     
    170179        return EOK;
    171180}
    172 /*----------------------------------------------------------------------------*/
    173 /**
    174  * Callback for a device about to be removed from the driver.
     181
     182/*----------------------------------------------------------------------------*/
     183
     184/**
     185 * Callback for removing a device from the driver.
    175186 *
    176187 * @param dev Structure representing the device.
    177  * @return Error code.
    178  */
    179 static int usb_hid_device_rem(usb_device_t *dev)
    180 {
    181         return EOK;
    182 }
    183 /*----------------------------------------------------------------------------*/
    184 /**
    185  * Callback for removing a device from the driver.
    186  *
    187  * @param dev Structure representing the device.
    188  * @return Error code.
     188 *
     189 * @retval EOK if successful.
     190 * @retval EREFUSED if the device is not supported.
    189191 */
    190192static int usb_hid_device_gone(usb_device_t *dev)
     
    196198                if (!tries--) {
    197199                        usb_log_error("Can't remove hub, still running.\n");
    198                         return EBUSY;
     200                        return EINPROGRESS;
    199201                }
    200202        }
     
    205207        return EOK;
    206208}
    207 /*----------------------------------------------------------------------------*/
     209
    208210/** USB generic driver callbacks */
    209 static const usb_driver_ops_t usb_hid_driver_ops = {
     211static usb_driver_ops_t usb_hid_driver_ops = {
    210212        .device_add = usb_hid_device_add,
    211         .device_rem = usb_hid_device_rem,
    212213        .device_gone = usb_hid_device_gone,
    213214};
    214 /*----------------------------------------------------------------------------*/
     215
     216
    215217/** The driver itself. */
    216 static const usb_driver_t usb_hid_driver = {
     218static usb_driver_t usb_hid_driver = {
    217219        .name = NAME,
    218220        .ops = &usb_hid_driver_ops,
    219221        .endpoints = usb_hid_endpoints
    220222};
    221 /*----------------------------------------------------------------------------*/
     223
     224/*----------------------------------------------------------------------------*/
     225
    222226int main(int argc, char *argv[])
    223227{
     
    228232        return usb_driver_main(&usb_hid_driver);
    229233}
     234
    230235/**
    231236 * @}
Note: See TracChangeset for help on using the changeset viewer.