Changeset 8e9becf6 in mainline for uspace/lib/usb/include


Ignore:
Timestamp:
2011-03-08T20:00:47Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
021351c
Parents:
0588062e (diff), d2fc1c2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged branch lelian/hidd

Location:
uspace/lib/usb/include/usb
Files:
1 deleted
8 edited

Legend:

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

    r0588062e r8e9becf6  
    3131 */
    3232/** @file
    33  * @brief USB device classes and subclasses.
     33 * USB device classes (generic constants and functions).
    3434 */
    3535#ifndef LIBUSB_CLASSES_H_
  • uspace/lib/usb/include/usb/debug.h

    r0588062e r8e9becf6  
    3131 */
    3232/** @file
    33  * @brief Debugging related functions.
     33 * Debugging related functions.
    3434 */
    3535#ifndef LIBUSB_DEBUG_H_
     
    3939#include <assert.h>
    4040
    41 void usb_dprintf(const char *tag, int level, const char *format, ...);
    42 void usb_dprintf_enable(const char *tag, int level);
    43 
    4441void usb_dump_standard_descriptor(FILE *, const char *, const char *,
    4542    const uint8_t *, size_t);
     
    4744/** Logging level. */
    4845typedef enum {
     46        /** Fatal, unrecoverable, error.
     47         * Such error prevents the driver from working at all.
     48         */
    4949        USB_LOG_LEVEL_FATAL,
     50
     51        /** Serious but recoverable error
     52         * Shall be used for errors fatal for single device but not for
     53         * driver itself.
     54         */
    5055        USB_LOG_LEVEL_ERROR,
     56
     57        /** Warning.
     58         * Problems from which the driver is able to recover gracefully.
     59         */
    5160        USB_LOG_LEVEL_WARNING,
     61
     62        /** Information message.
     63         * This should be the last level that is printed by default to
     64         * the screen.
     65         * Typical usage is to inform that new device was found and what
     66         * are its capabilities.
     67         * Do not use for repetitive actions (such as device polling).
     68         */
    5269        USB_LOG_LEVEL_INFO,
     70
     71        /** Debugging message. */
    5372        USB_LOG_LEVEL_DEBUG,
     73
     74        /** More detailed debugging message. */
    5475        USB_LOG_LEVEL_DEBUG2,
     76
     77        /** Terminating constant for logging levels. */
    5578        USB_LOG_LEVEL_MAX
    5679} usb_log_level_t;
     
    6184void usb_log_printf(usb_log_level_t, const char *, ...);
    6285
     86/** Log fatal error. */
    6387#define usb_log_fatal(format, ...) \
    6488        usb_log_printf(USB_LOG_LEVEL_FATAL, format, ##__VA_ARGS__)
    6589
     90/** Log normal (recoverable) error. */
    6691#define usb_log_error(format, ...) \
    6792        usb_log_printf(USB_LOG_LEVEL_ERROR, format, ##__VA_ARGS__)
    6893
     94/** Log warning. */
    6995#define usb_log_warning(format, ...) \
    7096        usb_log_printf(USB_LOG_LEVEL_WARNING, format, ##__VA_ARGS__)
    7197
     98/** Log informational message. */
    7299#define usb_log_info(format, ...) \
    73100        usb_log_printf(USB_LOG_LEVEL_INFO, format, ##__VA_ARGS__)
    74101
     102/** Log debugging message. */
    75103#define usb_log_debug(format, ...) \
    76104        usb_log_printf(USB_LOG_LEVEL_DEBUG, format, ##__VA_ARGS__)
    77105
     106/** Log verbose debugging message. */
    78107#define usb_log_debug2(format, ...) \
    79108        usb_log_printf(USB_LOG_LEVEL_DEBUG2, format, ##__VA_ARGS__)
    80109
     110const char *usb_debug_str_buffer(const uint8_t *, size_t, size_t);
    81111
    82112
  • uspace/lib/usb/include/usb/descriptor.h

    r0588062e r8e9becf6  
    3131 */
    3232/** @file
    33  * @brief Standard USB descriptors.
     33 * Standard USB descriptors.
    3434 */
    3535#ifndef LIBUSB_DESCRIPTOR_H_
     
    8383        /** Product descriptor index. */
    8484        uint8_t str_product;
    85         /** Device serial number desriptor index. */
     85        /** Device serial number descriptor index. */
    8686        uint8_t str_serial_number;
    8787        /** Number of possible configurations. */
     
    167167} __attribute__ ((packed)) usb_standard_endpoint_descriptor_t;
    168168
    169 
    170 /* TODO: string descriptors. */
    171 
    172169#endif
    173170/**
  • uspace/lib/usb/include/usb/dp.h

    r0588062e r8e9becf6  
    3131 */
    3232/** @file
    33  * @brief USB descriptor parser.
     33 * USB descriptor parser.
    3434 */
    3535#ifndef LIBUSB_DP_H_
     
    4040#include <usb/descriptor.h>
    4141
     42/** USB descriptors nesting.
     43 * The nesting describes the logical tree USB descriptors form
     44 * (e.g. that endpoint descriptor belongs to interface or that
     45 * interface belongs to configuration).
     46 *
     47 * See usb_descriptor_type_t for descriptor constants.
     48 */
    4249typedef struct {
     50        /** Child descriptor id. */
    4351        int child;
     52        /** Parent descriptor id. */
    4453        int parent;
    4554} usb_dp_descriptor_nesting_t;
     
    4756extern usb_dp_descriptor_nesting_t usb_dp_standard_descriptor_nesting[];
    4857
     58/** Descriptor parser structure. */
    4959typedef struct {
     60        /** Used descriptor nesting. */
    5061        usb_dp_descriptor_nesting_t *nesting;
    5162} usb_dp_parser_t;
    5263
     64/** Descriptor parser data. */
    5365typedef struct {
     66        /** Data to be parsed. */
    5467        uint8_t *data;
     68        /** Size of input data in bytes. */
    5569        size_t size;
     70        /** Custom argument. */
    5671        void *arg;
    5772} usb_dp_parser_data_t;
  • uspace/lib/usb/include/usb/hub.h

    r0588062e r8e9becf6  
    3232/** @file
    3333 * Functions needed by hub drivers.
     34 *
     35 * For class specific requests, see usb/classes/hub.h.
    3436 */
    3537#ifndef LIBUSB_HUB_H_
  • uspace/lib/usb/include/usb/pipes.h

    r0588062e r8e9becf6  
    4343#include <ddf/driver.h>
    4444
    45 /**
    46  * Abstraction of a physical connection to the device.
     45/** Abstraction of a physical connection to the device.
    4746 * This type is an abstraction of the USB wire that connects the host and
    4847 * the function (device).
     
    5554} usb_device_connection_t;
    5655
    57 /**
    58  * Abstraction of a logical connection to USB device endpoint.
     56/** Abstraction of a logical connection to USB device endpoint.
    5957 * It encapsulates endpoint attributes (transfer type etc.) as well
    6058 * as information about currently running sessions.
     
    111109        /** Found descriptor fitting the description. */
    112110        usb_standard_endpoint_descriptor_t *descriptor;
    113         /** Interface the endpoint belongs to. */
     111        /** Interface descriptor the endpoint belongs to. */
    114112        usb_standard_interface_descriptor_t *interface;
    115113        /** Whether the endpoint was actually found. */
  • uspace/lib/usb/include/usb/request.h

    r0588062e r8e9becf6  
    7272        union {
    7373                uint16_t value;
    74                 /* FIXME: add #ifdefs according to host endianess */
     74                /* FIXME: add #ifdefs according to host endianness */
    7575                struct {
    7676                        uint8_t value_low;
  • uspace/lib/usb/include/usb/usb.h

    r0588062e r8e9becf6  
    3131 */
    3232/** @file
    33  * @brief Base USB types.
     33 * Common USB types and functions.
    3434 */
    3535#ifndef LIBUSB_USB_H_
     
    121121} usb_target_t;
    122122
     123/** Compare USB targets (addresses and endpoints).
     124 *
     125 * @param a First target.
     126 * @param b Second target.
     127 * @return Whether @p a and @p b points to the same pipe on the same device.
     128 */
    123129static inline int usb_target_same(usb_target_t a, usb_target_t b)
    124130{
Note: See TracChangeset for help on using the changeset viewer.