"Fossies" - the Fresh Open Source Software Archive

Member "usbutils-015/usbhid-dump/src/misc.h" (22 Feb 2021, 1481 Bytes) of package /linux/misc/usbutils-015.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "misc.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 013_vs_014.

    1 // SPDX-License-Identifier: GPL-2.0-or-later
    2 /*
    3  * usbhid-dump - miscellaneous declarations
    4  *
    5  * Copyright (C) 2010 Nikolai Kondrashov <spbnick@gmail.com>
    6  */
    7 
    8 #ifndef __UHD_MISC_H__
    9 #define __UHD_MISC_H__
   10 
   11 #include <stdint.h>
   12 
   13 #ifdef __cplusplus
   14 extern "C" {
   15 #endif
   16 
   17 #pragma pack(1)
   18 
   19 /** HID extra descriptor record */
   20 typedef struct uhd_hid_descriptor_extra uhd_hid_descriptor_extra;
   21 
   22 struct uhd_hid_descriptor_extra {
   23     uint8_t     bDescriptorType;
   24     uint16_t    wDescriptorLength;
   25 };
   26 
   27 /** HID class-specific descriptor */
   28 typedef struct uhd_hid_descriptor uhd_hid_descriptor;
   29 
   30 struct uhd_hid_descriptor {
   31     uint8_t                     bLength;
   32     uint8_t                     bDescriptorType;
   33     uint16_t                    bcdHID;
   34     uint8_t                     bCountryCode;
   35     uint8_t                     bNumDescriptors;
   36     uhd_hid_descriptor_extra    extra[1];
   37 };
   38 
   39 #pragma pack()
   40 
   41 /**
   42  * Maximum descriptor size.
   43  *
   44  * @note 4096 here is maximum control buffer length.
   45  */
   46 #define UHD_MAX_DESCRIPTOR_SIZE 4096
   47 
   48 /** Generic USB I/O timeout, ms */
   49 #define UHD_IO_TIMEOUT      1000
   50 
   51 /** Wildcard bus number */
   52 #define UHD_BUS_NUM_ANY     0
   53 
   54 /** Wildcard device address */
   55 #define UHD_DEV_ADDR_ANY    0
   56 
   57 /** Wildcard vendor ID */
   58 #define UHD_VID_ANY         0
   59 
   60 /** Wildcard product ID */
   61 #define UHD_PID_ANY         0
   62 
   63 /** Wildcard interface number */
   64 #define UHD_IFACE_NUM_ANY   UINT8_MAX
   65 
   66 #ifdef __cplusplus
   67 } /* extern "C" */
   68 #endif
   69 
   70 #endif /* __UHD_MISC_H__ */