Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhid/src/hiddescriptor.c

    r9d58539 rfeeac0d  
    4141#include <assert.h>
    4242
    43 /*---------------------------------------------------------------------------*/
     43
    4444/*
    4545 * Constants defining current parsing mode for correct parsing of the set of
     
    6161#define INSIDE_DELIMITER_SET    2
    6262
    63 /*---------------------------------------------------------------------------*/
     63
    6464       
    6565/** The new report item flag. Used to determine when the item is completly
     
    7878#define USB_HID_UNKNOWN_TAG             -99
    7979
    80 /*---------------------------------------------------------------------------*/
     80
    8181/**
    8282 * Checks if given collection path is already present in report structure and
     
    124124}
    125125
    126 /*---------------------------------------------------------------------------*/
     126
    127127/**
    128128 * Initialize the report descriptor parser structure
     
    147147}
    148148
    149 /*---------------------------------------------------------------------------*/
     149
    150150
    151151/**
     
    314314        return EOK;
    315315}
    316 /*---------------------------------------------------------------------------*/
     316
    317317/**
    318318 * Finds description of report with given report_id and of given type in
     
    333333        }
    334334
    335         usb_hid_report_description_t *report_des = NULL;
    336        
    337         list_foreach(report->reports, report_it) {
    338                 report_des = list_get_instance(report_it,
    339                                 usb_hid_report_description_t, reports_link);
    340 
     335        list_foreach(report->reports, reports_link,
     336            usb_hid_report_description_t, report_des) {
    341337                // if report id not set, return the first of the type
    342338                if(((report_des->report_id == report_id) || (report_id == 0)) &&
     
    348344        return NULL;
    349345}
    350 /*---------------------------------------------------------------------------*/
     346
    351347
    352348/** Parse HID report descriptor.
     
    536532}
    537533
    538 /*---------------------------------------------------------------------------*/
     534
    539535
    540536/**
     
    871867        return EOK;
    872868}
    873 /*---------------------------------------------------------------------------*/
     869
    874870
    875871/**
     
    892888        return result;
    893889}
    894 /*---------------------------------------------------------------------------*/
     890
    895891
    896892/**
     
    902898void usb_hid_descriptor_print_list(list_t *list)
    903899{
    904         usb_hid_report_field_t *report_item;
    905 
    906900        if(list == NULL || list_empty(list)) {
    907901            usb_log_debug("\tempty\n");
     
    909903        }
    910904
    911         list_foreach(*list, item) {
    912                 report_item = list_get_instance(item, usb_hid_report_field_t,
    913                                 ritems_link);
    914 
     905        list_foreach(*list, ritems_link, usb_hid_report_field_t,
     906            report_item) {
    915907                usb_log_debug("\t\tOFFSET: %X\n", report_item->offset);
    916908                usb_log_debug("\t\tSIZE: %zu\n", report_item->size);
     
    937929
    938930                usb_log_debug("\n");
    939 
    940         }
    941 
    942 }
    943 /*---------------------------------------------------------------------------*/
     931        }
     932}
     933
    944934
    945935/**
     
    951941void usb_hid_descriptor_print(usb_hid_report_t *report)
    952942{
    953         if(report == NULL) {
     943        if (report == NULL)
    954944                return;
    955         }
    956 
    957         usb_hid_report_description_t *report_des;
    958 
    959         list_foreach(report->reports, report_it) {
    960                 report_des = list_get_instance(report_it,
    961                         usb_hid_report_description_t, reports_link);
     945
     946        list_foreach(report->reports, reports_link,
     947            usb_hid_report_description_t, report_des) {
    962948                usb_log_debug("Report ID: %d\n", report_des->report_id);
    963949                usb_log_debug("\tType: %d\n", report_des->type);
     
    972958        }
    973959}
    974 /*---------------------------------------------------------------------------*/
     960
    975961
    976962
     
    10221008        return;
    10231009}
    1024 /*---------------------------------------------------------------------------*/
     1010
    10251011
    10261012/**
Note: See TracChangeset for help on using the changeset viewer.