Changeset da56be2 in mainline


Ignore:
Timestamp:
2011-05-26T11:55:14Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6a544f5
Parents:
a9cdca0
Message:

Some debug output, checking return value from report parsing.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkbd/main.c

    ra9cdca0 rda56be2  
    4545#include <devmap.h>
    4646#include <usb/dev/hub.h>
    47 #include <usb/host.h>
    48 #include <usb/driver.h>
     47//#include <usb/host.h>
     48//#include <usb/driver.h>
    4949#include <usb/hid/iface.h>
    5050#include <usb/dev/pipes.h>
     
    140140        assert(report != NULL);
    141141       
     142        printf("Calling usb_hid_parse_report() with size %zu and "
     143            "buffer: \n", size);
     144        for (size_t i = 0; i < size; ++i) {
     145                printf(" %X ", buffer[i]);
     146        }
     147        printf("\n");
     148       
    142149        uint8_t report_id;
    143         usb_hid_parse_report(report, buffer, size, &report_id);
     150        int rc = usb_hid_parse_report(report, buffer, size, &report_id);
     151        if (rc != EOK) {
     152                printf("Error parsing report: %s\n", str_error(rc));
     153                return;
     154        }
    144155       
    145156        usb_hid_report_path_t *path = usb_hid_report_path();
     
    196207       
    197208        //char *devpath = argv[1];
    198         const char *devpath = "/hw/pci0/00:06.0/ohci-rh/usb00_a2/HID0/hid";
     209        const char *devpath = "/hw/pci0/00:06.0/ohci-rh/usb00_a2/HID1/hid";
    199210       
    200211        int rc;
     
    269280                }
    270281               
    271                 printf("Got buffer: %p, size: %zu\n", event, actual_size);
     282                printf("Got buffer: %p, size: %zu, max size: %zu\n", event,
     283                    actual_size, size);
    272284               
    273285                print_key(event, size, report);
  • uspace/drv/usbhid/generic/hiddev.c

    ra9cdca0 rda56be2  
    120120       
    121121        if (hid_dev->input_report_size > size) {
     122                usb_log_debug("input_report_size > size (%zu, %zu)\n",
     123                    hid_dev->input_report_size, size);
    122124                return EINVAL;  // TODO: other error code
    123125        }
     
    125127        /*! @todo This should probably be atomic. */
    126128        if (usb_hid_report_ready()) {
     129                usb_log_debug("Report ready, size: %zu\n",
     130                    hid_dev->input_report_size);
    127131                memcpy(buffer, hid_dev->input_report,
    128132                    hid_dev->input_report_size);
     
    136140        // note that we already received this report
    137141//      report_received = true;
     142        usb_log_debug("OK\n");
    138143       
    139144        return EOK;
Note: See TracChangeset for help on using the changeset viewer.