Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/kbd/kbddev.c

    r4d3c13e re8a69913  
    434434 *     usb_hid_parse_report().
    435435 */
    436 static void usb_kbd_process_data(usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev)
     436static void usb_kbd_process_data(usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev,
     437                                 uint8_t *buffer, size_t actual_size)
    437438{
    438439        assert(hid_dev->report != NULL);
    439440        assert(hid_dev != NULL);
    440441        assert(kbd_dev != NULL);
     442
     443        usb_log_debug("Calling usb_hid_parse_report() with "
     444            "buffer %s\n", usb_debug_str_buffer(buffer, actual_size, 0));
    441445       
    442446        usb_hid_report_path_t *path = usb_hid_report_path();
    443447        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    444448
    445         usb_hid_report_path_set_report_id (path, hid_dev->report_id);
     449        uint8_t report_id;
     450        int rc = usb_hid_parse_report(hid_dev->report, buffer, actual_size,
     451            &report_id);
     452       
     453        if (rc != EOK) {
     454                usb_log_warning("Error in usb_hid_parse_report():"
     455                    "%s\n", str_error(rc));
     456        }
     457       
     458        usb_hid_report_path_set_report_id (path, report_id);
    446459       
    447460        // fill in the currently pressed keys
     
    743756/*----------------------------------------------------------------------------*/
    744757
    745 bool usb_kbd_polling_callback(usb_hid_dev_t *hid_dev, void *data)
    746 {
    747         if (hid_dev == NULL/* || buffer == NULL*/ || data == NULL) {
     758bool usb_kbd_polling_callback(usb_hid_dev_t *hid_dev, void *data,
     759     uint8_t *buffer, size_t buffer_size)
     760{
     761        if (hid_dev == NULL || buffer == NULL || data == NULL) {
    748762                // do not continue polling (???)
    749763                return false;
     
    754768       
    755769        // TODO: add return value from this function
    756         usb_kbd_process_data(hid_dev, kbd_dev);
     770        usb_kbd_process_data(hid_dev, kbd_dev, buffer, buffer_size);
    757771       
    758772        return true;
     
    790804        if ((*kbd_dev)->repeat_mtx != NULL) {
    791805                //assert(!fibril_mutex_is_locked((*kbd_dev)->repeat_mtx));
    792                 // FIXME - the fibril_mutex_is_locked may not cause
    793                 // fibril scheduling
    794806                while (fibril_mutex_is_locked((*kbd_dev)->repeat_mtx)) {}
    795807                free((*kbd_dev)->repeat_mtx);
Note: See TracChangeset for help on using the changeset viewer.