Changeset 745d2ad in mainline


Ignore:
Timestamp:
2011-02-20T12:35:56Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
540e2d2
Parents:
0a46c41e
Message:

Add standard USB descriptor nesting to libusb

Location:
uspace/lib/usb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/dp.h

    r0a46c41e r745d2ad  
    4545} usb_dp_descriptor_nesting_t;
    4646
     47extern usb_dp_descriptor_nesting_t usb_dp_standard_descriptor_nesting[];
     48
    4749typedef struct {
    4850        usb_dp_descriptor_nesting_t *nesting;
  • uspace/lib/usb/src/dp.c

    r0a46c41e r745d2ad  
    4040#include <bool.h>
    4141#include <usb/dp.h>
     42#include <usb/descriptor.h>
     43
     44#define NESTING(parentname, childname) \
     45        { \
     46                .child = USB_DESCTYPE_##childname, \
     47                .parent = USB_DESCTYPE_##parentname, \
     48        }
     49#define LAST_NESTING { -1, -1 }
     50
     51/** Nesting of standard USB descriptors. */
     52usb_dp_descriptor_nesting_t usb_dp_standard_descriptor_nesting[] = {
     53        NESTING(CONFIGURATION, INTERFACE),
     54        NESTING(INTERFACE, ENDPOINT),
     55        NESTING(INTERFACE, HUB),
     56        NESTING(INTERFACE, HID),
     57        NESTING(HID, HID_REPORT),
     58        LAST_NESTING
     59};
     60
     61#undef NESTING
     62#undef LAST_NESTING
    4263
    4364/** Tells whether pointer points inside descriptor data.
Note: See TracChangeset for help on using the changeset viewer.