Changeset 0d92638 in mainline


Ignore:
Timestamp:
2011-03-24T23:26:20Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1cbfd6b, a8ac368
Parents:
252e30c
Message:

Added boot protocol static descriptor.

  • The fallback does not work very well, because the usb_kbd_init() function receives the device even if it does not support boot protocol.
Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbkbd/kbddev.c

    r252e30c r0d92638  
    112112
    113113enum {
    114         BOOT_REPORT_DESCRIPTOR_SIZE = 0
     114        BOOT_REPORT_DESCRIPTOR_SIZE = 63
    115115};
    116116
    117 static const uint8_t BOOT_REPORT_DESCRIPTOR[BOOT_REPORT_DESCRIPTOR_SIZE] = {};
     117static const uint8_t BOOT_REPORT_DESCRIPTOR[BOOT_REPORT_DESCRIPTOR_SIZE] = {
     118        0x05, 0x01,  // Usage Page (Generic Desktop),
     119        0x09, 0x06,  // Usage (Keyboard),
     120        0xA1, 0x01,  // Collection (Application),
     121        0x75, 0x01,  //   Report Size (1),
     122        0x95, 0x08,  //   Report Count (8),       
     123        0x05, 0x07,  //   Usage Page (Key Codes);
     124        0x19, 0xE0,  //   Usage Minimum (224),
     125        0x29, 0xE7,  //   Usage Maximum (231),
     126        0x15, 0x00,  //   Logical Minimum (0),
     127        0x25, 0x01,  //   Logical Maximum (1),
     128        0x81, 0x02,  //   Input (Data, Variable, Absolute),   ; Modifier byte
     129        0x95, 0x01,  //   Report Count (1),
     130        0x75, 0x08,  //   Report Size (8),
     131        0x81, 0x01,  //   Input (Constant),                   ; Reserved byte
     132        0x95, 0x05,  //   Report Count (5),
     133        0x75, 0x01,  //   Report Size (1),
     134        0x05, 0x08,  //   Usage Page (Page# for LEDs),
     135        0x19, 0x01,  //   Usage Minimum (1),
     136        0x29, 0x05,  //   Usage Maxmimum (5),
     137        0x91, 0x02,  //   Output (Data, Variable, Absolute),  ; LED report
     138        0x95, 0x01,  //   Report Count (1),
     139        0x75, 0x03,  //   Report Size (3),
     140        0x91, 0x01,  //   Output (Constant),              ; LED report padding
     141        0x95, 0x06,  //   Report Count (6),
     142        0x75, 0x08,  //   Report Size (8),
     143        0x15, 0x00,  //   Logical Minimum (0),
     144        0x25, 0xff,  //   Logical Maximum (255),
     145        0x05, 0x07,  //   Usage Page (Key Codes),
     146        0x19, 0x00,  //   Usage Minimum (0),
     147        0x29, 0xff,  //   Usage Maximum (255),
     148        0x81, 0x00,  //   Input (Data, Array),            ; Key arrays (6 bytes)
     149        0xC0           // End Collection
     150
     151};
    118152
    119153/*----------------------------------------------------------------------------*/
     
    669703        }
    670704       
    671         //rc = usbhid_dev_init(kbd_dev->hid_dev, dev, &poll_endpoint_description);
    672        
    673        
    674 //      if (rc != EOK) {
    675 //              usb_log_error("Failed to initialize HID device structure: %s\n",
    676 //                 str_error(rc));
    677 //              return rc;
    678 //      }
    679        
    680 //      assert(kbd_dev->hid_dev->initialized == USB_KBD_STATUS_INITIALIZED);
    681        
    682         // save the size of the report (boot protocol report by default)
    683 //      kbd_dev->key_count = BOOTP_REPORT_SIZE;
     705        /* TODO: does not work! */
     706        if (dev->pipes[USB_KBD_POLL_EP_NO].interface_no < 0) {
     707                usb_log_warning("Required endpoint not found - probably not "
     708                    "a supported device.\n");
     709                return ENOTSUP;
     710        }
    684711       
    685712        /* The USB device should already be initialized, save it in structure */
  • uspace/lib/usb/src/hidreport.c

    r252e30c r0d92638  
    8383       
    8484        if (d == NULL) {
    85                 usb_log_error("The %. interface descriptor not found!\n",
     85                usb_log_error("The %d. interface descriptor not found!\n",
    8686                    dev->interface_no);
    8787                return ENOENT;
Note: See TracChangeset for help on using the changeset viewer.