Changeset ff41576d in mainline


Ignore:
Timestamp:
2011-05-27T08:55:27Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8fb45e08
Parents:
aaa3d82b
Message:

Edited log messages + changed way of getting reports (get_event()).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/generic/hiddev.c

    raaa3d82b rff41576d  
    9090static size_t usb_generic_hid_get_event_length(ddf_fun_t *fun)
    9191{
    92         usb_log_debug("Generic HID: Get event length (fun: %p, "
     92        usb_log_debug2("Generic HID: Get event length (fun: %p, "
    9393            "fun->driver_data: %p.\n", fun, fun->driver_data);
    9494       
     
    9999        usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)fun->driver_data;
    100100       
    101         usb_log_debug("hid_dev: %p, Max input report size (%d).\n",
     101        usb_log_debug2("hid_dev: %p, Max input report size (%d).\n",
    102102            hid_dev, hid_dev->max_input_report_size);
    103103       
     
    110110    size_t size, size_t *act_size, unsigned int flags)
    111111{
    112         usb_log_debug("Generic HID: Get event.\n");
     112        usb_log_debug2("Generic HID: Get event.\n");
    113113       
    114114        if (fun == NULL || fun->driver_data == NULL) {
     
    126126       
    127127        /*! @todo This should probably be atomic. */
    128         if (usb_hid_report_ready()) {
    129                 usb_log_debug("Report ready, size: %zu\n",
    130                     hid_dev->input_report_size);
    131                 memcpy(buffer, hid_dev->input_report,
    132                     hid_dev->input_report_size);
    133                 *act_size = hid_dev->input_report_size;
    134                 usb_hid_report_received();
    135         }
     128//      if (usb_hid_report_ready()) {
     129//              usb_log_debug2("Report ready, size: %zu\n",
     130//                  hid_dev->input_report_size);
     131               
     132//              usb_hid_report_received();
     133//      } else {
     134//              memset(buffer, 0, hid_dev->input_report_size);
     135//      }
     136        memcpy(buffer, hid_dev->input_report,
     137            hid_dev->input_report_size);
     138        *act_size = hid_dev->input_report_size;
    136139       
    137140        // clear the buffer so that it will not be received twice
     
    140143        // note that we already received this report
    141144//      report_received = true;
    142         usb_log_debug("OK\n");
     145        usb_log_debug2("OK\n");
    143146       
    144147        return EOK;
     
    158161        usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)fun->driver_data;
    159162       
    160         printf("hid_dev->report_desc_size = %zu\n", hid_dev->report_desc_size);
     163        usb_log_debug2("hid_dev->report_desc_size = %zu\n",
     164            hid_dev->report_desc_size);
    161165       
    162166        return hid_dev->report_desc_size;
     
    168172    size_t size, size_t *actual_size)
    169173{
    170         usb_log_debug("Generic HID: Get report descriptor.\n");
     174        usb_log_debug2("Generic HID: Get report descriptor.\n");
    171175       
    172176        if (fun == NULL || fun->driver_data == NULL) {
     
    192196{
    193197        usb_log_debug("Generic HID: Client connected.\n");
    194         usb_hid_report_received();
    195198        return EOK;
    196199}
     
    242245    uint8_t *buffer, size_t buffer_size)
    243246{
    244         usb_log_debug("usb_hid_polling_callback(%p, %p, %zu)\n",
     247        usb_log_debug2("usb_hid_polling_callback(%p, %p, %zu)\n",
    245248            hid_dev, buffer, buffer_size);
    246249        usb_debug_str_buffer(buffer, buffer_size, 0);
Note: See TracChangeset for help on using the changeset viewer.