Changes in / [dc4c19e:82e8861] in mainline


Ignore:
Location:
uspace/drv/usbhid
Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/Makefile

    rdc4c19e r82e8861  
    4444        kbd/kbdrepeat.c \
    4545        generic/hiddev.c \
    46         mouse/mousedev.c \
    4746        $(STOLEN_LAYOUT_SOURCES)
    4847
  • uspace/drv/usbhid/generic/hiddev.c

    rdc4c19e r82e8861  
    5757     size_t buffer_size, void *arg)
    5858{
    59         usb_log_debug("usb_hid_polling_callback(%p, %p, %zu, %p)\n",
    60             dev, buffer, buffer_size, arg);
     59        usb_log_debug("usb_hid_polling_callback()\n");
    6160        usb_debug_str_buffer(buffer, buffer_size, 0);
    6261        return true;
  • uspace/drv/usbhid/generic/hiddev.h

    rdc4c19e r82e8861  
    3434 */
    3535
    36 #ifndef USB_HIDDDEV_H_
    37 #define USB_HIDDDEV_H_
     36#ifndef USB_HIDD_H_
     37#define USB_HIDD_H_
    3838
    3939#include <usb/devdrv.h>
     
    4747     size_t buffer_size, void *arg);
    4848
    49 #endif // USB_HIDDDEV_H_
     49#endif // USB_HIDD_H_
    5050
    5151/**
  • uspace/drv/usbhid/kbd/kbddev.c

    rdc4c19e r82e8861  
    238238 * @param icall Call data.
    239239 */
    240 static void default_connection_handler(ddf_fun_t *fun,
     240void default_connection_handler(ddf_fun_t *fun,
    241241    ipc_callid_t icallid, ipc_call_t *icall)
    242242{
  • uspace/drv/usbhid/kbd/kbddev.h

    rdc4c19e r82e8861  
    6565 */
    6666typedef struct usb_kbd_t {
     67        /** Structure holding generic USB device information. */
     68        //usbhid_dev_t *hid_dev;
     69        //usb_device_t *usb_dev;
     70       
    6771        /** Currently pressed keys (not translated to key codes). */
    6872        uint8_t *keys;
     
    8791        fibril_mutex_t *repeat_mtx;
    8892       
     93        /** Report descriptor. */
     94        //uint8_t *report_desc;
     95
     96        /** Report descriptor size. */
     97        //size_t report_desc_size;
     98       
    8999        uint8_t *output_buffer;
    90100       
     
    96106       
    97107        int32_t *led_data;
     108
     109        /** HID Report parser. */
     110        //usb_hid_report_parser_t *parser;
    98111       
    99112        /** State of the structure (for checking before use).
     
    108121/*----------------------------------------------------------------------------*/
    109122
     123//enum {
     124//      USB_KBD_POLL_EP_NO = 0,
     125//      USB_HID_POLL_EP_NO = 1,
     126//      USB_KBD_POLL_EP_COUNT = 2
     127//};
     128
     129//usb_endpoint_description_t *usb_kbd_endpoints[USB_KBD_POLL_EP_COUNT + 1];
     130
     131//ddf_dev_ops_t keyboard_ops;
     132
    110133usb_endpoint_description_t usb_hid_kbd_poll_endpoint_description;
    111134
     
    115138/*----------------------------------------------------------------------------*/
    116139
     140//usb_kbd_t *usb_kbd_new(void);
     141
    117142int usb_kbd_init(struct usb_hid_dev_t *hid_dev);
    118143
    119144bool usb_kbd_polling_callback(usb_device_t *dev, uint8_t *buffer,
    120145     size_t buffer_size, void *arg);
     146
     147//void usb_kbd_polling_ended_callback(usb_device_t *dev, bool reason,
     148//     void *arg);
    121149
    122150int usb_kbd_is_initialized(const usb_kbd_t *kbd_dev);
     
    129157    int type, unsigned int key);
    130158
     159
    131160void usb_kbd_deinit(struct usb_hid_dev_t *hid_dev);
    132161
  • uspace/drv/usbhid/usbhid.c

    rdc4c19e r82e8861  
    4747#include "kbd/kbddev.h"
    4848#include "generic/hiddev.h"
    49 #include "mouse/mousedev.h"
    50 
    51 /*----------------------------------------------------------------------------*/
     49
     50/*----------------------------------------------------------------------------*/
     51
     52/** Mouse polling endpoint description for boot protocol class. */
     53static usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = {
     54        .transfer_type = USB_TRANSFER_INTERRUPT,
     55        .direction = USB_DIRECTION_IN,
     56        .interface_class = USB_CLASS_HID,
     57        .interface_subclass = USB_HID_SUBCLASS_BOOT,
     58        .interface_protocol = USB_HID_PROTOCOL_MOUSE,
     59        .flags = 0
     60};
    5261
    5362/* Array of endpoints expected on the device, NULL terminated. */
     
    5968};
    6069
     70static const char *HID_MOUSE_FUN_NAME = "mouse";
     71static const char *HID_MOUSE_CLASS_NAME = "mouse";
     72
    6173/*----------------------------------------------------------------------------*/
    6274
     
    8496/*----------------------------------------------------------------------------*/
    8597
     98static bool usb_dummy_polling_callback(usb_device_t *dev, uint8_t *buffer,
     99     size_t buffer_size, void *arg)
     100{
     101        usb_log_debug("Dummy polling callback.\n");
     102        return false;
     103}
     104
     105/*----------------------------------------------------------------------------*/
     106
    86107static int usb_hid_check_pipes(usb_hid_dev_t *hid_dev, usb_device_t *dev)
    87108{
     
    104125               
    105126                // set the polling callback
    106                 hid_dev->poll_callback = usb_mouse_polling_callback;
     127                hid_dev->poll_callback = usb_dummy_polling_callback;
    107128               
    108129        } else if (dev->pipes[USB_HID_GENERIC_POLL_EP_NO].present) {
     
    140161            hid_dev->parser);
    141162       
    142         if (rc != EOK || hid_dev->device_type == USB_HID_PROTOCOL_MOUSE) {
     163        if (rc != EOK) {
    143164                usb_log_warning("Could not process report descriptor.\n");
    144165               
    145166                if (hid_dev->device_type == USB_HID_PROTOCOL_KEYBOARD) {
    146167                        usb_log_warning("Falling back to boot protocol.\n");
     168                       
    147169                        rc = usb_kbd_set_boot_protocol(hid_dev);
     170                       
    148171                } else if (hid_dev->device_type == USB_HID_PROTOCOL_MOUSE) {
    149                         usb_log_warning("Falling back to boot protocol.\n");
    150                         rc = usb_mouse_set_boot_protocol(hid_dev);
     172                        usb_log_warning("No boot protocol for mouse yet.\n");
     173                        rc = ENOTSUP;
    151174                }
    152175        }
     
    199222                break;
    200223        case USB_HID_PROTOCOL_MOUSE:
    201                 rc = usb_mouse_init(hid_dev);
    202                 if (rc != EOK) {
    203                         usb_log_warning("Failed to initialize Mouse structure."
    204                             "\n");
    205                 }
    206224                break;
    207225        default:
     226//              usbhid_req_set_idle(&hid_dev->usb_dev->ctrl_pipe,
     227//                  hid_dev->usb_dev->interface_no, 0);
    208228                break;
    209229        }
     
    271291                break;
    272292        case USB_HID_PROTOCOL_MOUSE:
    273                 usb_mouse_deinit(*hid_dev);
    274293                break;
    275294        default:
  • uspace/drv/usbhid/usbhid.ma

    rdc4c19e r82e8861  
    11100 usb&interface&class=HID&subclass=0x01&protocol=0x01
    2 1000 usb&interface&class=HID&subclass=0x01&protocol=0x02
     2100 usb&interface&class=HID&subclass=0x01&protocol=0x02
    33100 usb&interface&class=HID
Note: See TracChangeset for help on using the changeset viewer.