Changeset 8e9becf6 in mainline for uspace/lib/usb/include
- Timestamp:
- 2011-03-08T20:00:47Z (14 years ago)
- 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. - 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 31 31 */ 32 32 /** @file 33 * @brief USB device classes and subclasses.33 * USB device classes (generic constants and functions). 34 34 */ 35 35 #ifndef LIBUSB_CLASSES_H_ -
uspace/lib/usb/include/usb/debug.h
r0588062e r8e9becf6 31 31 */ 32 32 /** @file 33 * @briefDebugging related functions.33 * Debugging related functions. 34 34 */ 35 35 #ifndef LIBUSB_DEBUG_H_ … … 39 39 #include <assert.h> 40 40 41 void usb_dprintf(const char *tag, int level, const char *format, ...);42 void usb_dprintf_enable(const char *tag, int level);43 44 41 void usb_dump_standard_descriptor(FILE *, const char *, const char *, 45 42 const uint8_t *, size_t); … … 47 44 /** Logging level. */ 48 45 typedef enum { 46 /** Fatal, unrecoverable, error. 47 * Such error prevents the driver from working at all. 48 */ 49 49 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 */ 50 55 USB_LOG_LEVEL_ERROR, 56 57 /** Warning. 58 * Problems from which the driver is able to recover gracefully. 59 */ 51 60 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 */ 52 69 USB_LOG_LEVEL_INFO, 70 71 /** Debugging message. */ 53 72 USB_LOG_LEVEL_DEBUG, 73 74 /** More detailed debugging message. */ 54 75 USB_LOG_LEVEL_DEBUG2, 76 77 /** Terminating constant for logging levels. */ 55 78 USB_LOG_LEVEL_MAX 56 79 } usb_log_level_t; … … 61 84 void usb_log_printf(usb_log_level_t, const char *, ...); 62 85 86 /** Log fatal error. */ 63 87 #define usb_log_fatal(format, ...) \ 64 88 usb_log_printf(USB_LOG_LEVEL_FATAL, format, ##__VA_ARGS__) 65 89 90 /** Log normal (recoverable) error. */ 66 91 #define usb_log_error(format, ...) \ 67 92 usb_log_printf(USB_LOG_LEVEL_ERROR, format, ##__VA_ARGS__) 68 93 94 /** Log warning. */ 69 95 #define usb_log_warning(format, ...) \ 70 96 usb_log_printf(USB_LOG_LEVEL_WARNING, format, ##__VA_ARGS__) 71 97 98 /** Log informational message. */ 72 99 #define usb_log_info(format, ...) \ 73 100 usb_log_printf(USB_LOG_LEVEL_INFO, format, ##__VA_ARGS__) 74 101 102 /** Log debugging message. */ 75 103 #define usb_log_debug(format, ...) \ 76 104 usb_log_printf(USB_LOG_LEVEL_DEBUG, format, ##__VA_ARGS__) 77 105 106 /** Log verbose debugging message. */ 78 107 #define usb_log_debug2(format, ...) \ 79 108 usb_log_printf(USB_LOG_LEVEL_DEBUG2, format, ##__VA_ARGS__) 80 109 110 const char *usb_debug_str_buffer(const uint8_t *, size_t, size_t); 81 111 82 112 -
uspace/lib/usb/include/usb/descriptor.h
r0588062e r8e9becf6 31 31 */ 32 32 /** @file 33 * @briefStandard USB descriptors.33 * Standard USB descriptors. 34 34 */ 35 35 #ifndef LIBUSB_DESCRIPTOR_H_ … … 83 83 /** Product descriptor index. */ 84 84 uint8_t str_product; 85 /** Device serial number des riptor index. */85 /** Device serial number descriptor index. */ 86 86 uint8_t str_serial_number; 87 87 /** Number of possible configurations. */ … … 167 167 } __attribute__ ((packed)) usb_standard_endpoint_descriptor_t; 168 168 169 170 /* TODO: string descriptors. */171 172 169 #endif 173 170 /** -
uspace/lib/usb/include/usb/dp.h
r0588062e r8e9becf6 31 31 */ 32 32 /** @file 33 * @briefUSB descriptor parser.33 * USB descriptor parser. 34 34 */ 35 35 #ifndef LIBUSB_DP_H_ … … 40 40 #include <usb/descriptor.h> 41 41 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 */ 42 49 typedef struct { 50 /** Child descriptor id. */ 43 51 int child; 52 /** Parent descriptor id. */ 44 53 int parent; 45 54 } usb_dp_descriptor_nesting_t; … … 47 56 extern usb_dp_descriptor_nesting_t usb_dp_standard_descriptor_nesting[]; 48 57 58 /** Descriptor parser structure. */ 49 59 typedef struct { 60 /** Used descriptor nesting. */ 50 61 usb_dp_descriptor_nesting_t *nesting; 51 62 } usb_dp_parser_t; 52 63 64 /** Descriptor parser data. */ 53 65 typedef struct { 66 /** Data to be parsed. */ 54 67 uint8_t *data; 68 /** Size of input data in bytes. */ 55 69 size_t size; 70 /** Custom argument. */ 56 71 void *arg; 57 72 } usb_dp_parser_data_t; -
uspace/lib/usb/include/usb/hub.h
r0588062e r8e9becf6 32 32 /** @file 33 33 * Functions needed by hub drivers. 34 * 35 * For class specific requests, see usb/classes/hub.h. 34 36 */ 35 37 #ifndef LIBUSB_HUB_H_ -
uspace/lib/usb/include/usb/pipes.h
r0588062e r8e9becf6 43 43 #include <ddf/driver.h> 44 44 45 /** 46 * Abstraction of a physical connection to the device. 45 /** Abstraction of a physical connection to the device. 47 46 * This type is an abstraction of the USB wire that connects the host and 48 47 * the function (device). … … 55 54 } usb_device_connection_t; 56 55 57 /** 58 * Abstraction of a logical connection to USB device endpoint. 56 /** Abstraction of a logical connection to USB device endpoint. 59 57 * It encapsulates endpoint attributes (transfer type etc.) as well 60 58 * as information about currently running sessions. … … 111 109 /** Found descriptor fitting the description. */ 112 110 usb_standard_endpoint_descriptor_t *descriptor; 113 /** Interface the endpoint belongs to. */111 /** Interface descriptor the endpoint belongs to. */ 114 112 usb_standard_interface_descriptor_t *interface; 115 113 /** Whether the endpoint was actually found. */ -
uspace/lib/usb/include/usb/request.h
r0588062e r8e9becf6 72 72 union { 73 73 uint16_t value; 74 /* FIXME: add #ifdefs according to host endian ess */74 /* FIXME: add #ifdefs according to host endianness */ 75 75 struct { 76 76 uint8_t value_low; -
uspace/lib/usb/include/usb/usb.h
r0588062e r8e9becf6 31 31 */ 32 32 /** @file 33 * @brief Base USB types.33 * Common USB types and functions. 34 34 */ 35 35 #ifndef LIBUSB_USB_H_ … … 121 121 } usb_target_t; 122 122 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 */ 123 129 static inline int usb_target_same(usb_target_t a, usb_target_t b) 124 130 {
Note:
See TracChangeset
for help on using the changeset viewer.