Changeset 681f24b3 in mainline


Ignore:
Timestamp:
2011-04-15T16:52:45Z (13 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dc9f122
Parents:
175ad13e
Message:

usb_hid_report_path_t link fix

Location:
uspace/lib/usb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/classes/hidparser.h

    r175ad13e r681f24b3  
    102102       
    103103        /** */ 
    104         link_t link;
     104        link_t link; /* list */
     105
     106        link_t head; /* head of list of usage paths */
    105107
    106108} usb_hid_report_path_t;
  • uspace/lib/usb/src/hidparser.c

    r175ad13e r681f24b3  
    3939#include <mem.h>
    4040#include <usb/debug.h>
     41#include <assert.h>
    4142
    4243/** The new report item flag. Used to determine when the item is completly
     
    139140        if(path_it == &report->collection_paths) {
    140141                path = usb_hid_report_path_clone(report_item->usage_path);                     
    141 
    142                 usb_log_debug("PUVODNI: \n");
     142                list_initialize(&path->link);
     143
     144                list_append(&path->link, &report->collection_paths);                                   
     145               
    143146                usb_hid_print_usage_path (report_item->usage_path);
    144                 usb_log_debug("KLON - path: \n");
    145                 usb_hid_print_usage_path (path);               
    146                 usb_log_debug("KLON - clone: \n");
    147                 usb_hid_print_usage_path (usb_hid_report_path_clone(report_item->usage_path));         
    148 
    149                 list_append(&path->link, &report->collection_paths);                   
    150 
    151                 // PROC SE KRUVA VLOZI NESMYSLY??
    152                 usb_log_debug("VLOZENO: \n");
    153                 usb_hid_print_usage_path (list_get_instance(report->collection_paths.prev, usb_hid_report_path_t, link));
    154                 usb_log_debug("\n");
     147                usb_hid_print_usage_path (path);
     148                usb_hid_print_usage_path(list_get_instance(report->collection_paths.prev, usb_hid_report_path_t, link));
     149
     150                assert(usb_hid_report_compare_usage_path (report_item->usage_path,
     151                list_get_instance(report->collection_paths.prev,
     152                                  usb_hid_report_path_t, link),
     153                        USB_HID_PATH_COMPARE_STRICT) == EOK);
     154
    155155                report->collection_paths_count++;
    156156        }
     
    11351135                                }
    11361136
    1137                                 report_link = report_path->link.next;
    1138                                 path_link = path->link.next;
     1137                                report_link = report_path->head.next;
     1138                                path_link = path->head.next;
    11391139                       
    1140                                 while((report_link != &report_path->link) && (path_link != &path->link)) {
     1140                                while((report_link != &report_path->head) && (path_link != &path->head)) {
    11411141                                        report_item = list_get_instance(report_link, usb_hid_report_usage_path_t, link);
    11421142                                        path_item = list_get_instance(path_link, usb_hid_report_usage_path_t, link);           
     
    11521152                                }
    11531153
    1154                                 if((report_link == &report_path->link) && (path_link == &path->link)) {
     1154                                if((report_link == &report_path->head) && (path_link == &path->head)) {
    11551155                                        return EOK;
    11561156                                }
     
    11621162                /* compare with only the end of path*/
    11631163                case USB_HID_PATH_COMPARE_END:
    1164                                 report_link = report_path->link.prev;
    1165                                 path_link = path->link.prev;
    1166 
    1167                                 if(list_empty(&path->link)){
     1164                                report_link = report_path->head.prev;
     1165                                path_link = path->head.prev;
     1166
     1167                                if(list_empty(&path->head)){
    11681168                                        return EOK;
    11691169                                }
    11701170                       
    1171                                 while((report_link != &report_path->link) && (path_link != &path->link)) {
     1171                                while((report_link != &report_path->head) && (path_link != &path->head)) {
    11721172                                        report_item = list_get_instance(report_link, usb_hid_report_usage_path_t, link);
    11731173                                        path_item = list_get_instance(path_link, usb_hid_report_usage_path_t, link);           
     
    11831183                                }
    11841184
    1185                                 if(path_link == &path->link) {
     1185                                if(path_link == &path->head) {
    11861186                                        return EOK;
    11871187                                }
Note: See TracChangeset for help on using the changeset viewer.