Changeset d8b275d in mainline for uspace/drv/usbhid/subdrivers.c


Ignore:
Timestamp:
2011-04-14T08:24:29Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5e07e2b5
Parents:
3f2af64 (diff), 34e8bab (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 moved

Legend:

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

    r3f2af64 rd8b275d  
    11/*
    2  * Copyright (c) 2007 Jan Hudecek
    3  * Copyright (c) 2008 Martin Decky
     2 * Copyright (c) 2011 Lubos Slovak
    43 * All rights reserved.
    54 *
     
    2827 */
    2928
    30 /** @addtogroup genericproc
     29/** @addtogroup drvusbhid
    3130 * @{
    3231 */
    33 /** @file tasklet.c
    34  *  @brief Tasklet implementation
     32/** @file
     33 * USB HID subdriver mappings.
    3534 */
    3635
    37 #include <proc/tasklet.h>
    38 #include <synch/spinlock.h>
    39 #include <mm/slab.h>
    40 #include <config.h>
     36#include "subdrivers.h"
     37#include "usb/classes/hidut.h"
    4138
    42 /** Spinlock protecting list of tasklets */
    43 SPINLOCK_INITIALIZE(tasklet_lock);
     39static usb_hid_subdriver_usage_t path_kbd[] = {{USB_HIDUT_PAGE_KEYBOARD, 0}};
    4440
    45 /** Array of tasklet lists for every CPU */
    46 tasklet_descriptor_t **tasklet_list;
     41const usb_hid_subdriver_mapping_t usb_hid_subdrivers[] = {
     42        {
     43                path_kbd,
     44                1,
     45                USB_HID_PATH_COMPARE_END
     46                | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     47                NULL,
     48                NULL,
     49                {
     50                        usb_kbd_init,
     51                        usb_kbd_deinit,
     52                        usb_kbd_polling_callback,
     53                        NULL
     54                },
     55               
     56        },
     57        {NULL, 0, 0, NULL, NULL, {NULL, NULL, NULL, NULL}}
     58};
    4759
    48 void tasklet_init(void)
    49 {
    50         unsigned int i;
    51        
    52         tasklet_list = malloc(sizeof(tasklet_descriptor_t *) * config.cpu_count, 0);
    53         if (!tasklet_list)
    54                 panic("Error initializing tasklets.");
    55        
    56         for (i = 0; i < config.cpu_count; i++)
    57                 tasklet_list[i] = NULL;
    58        
    59         spinlock_initialize(&tasklet_lock, "tasklet_lock");
    60 }
    61 
    62 
    63 /** @}
     60/**
     61 * @}
    6462 */
Note: See TracChangeset for help on using the changeset viewer.