Changes in / [18e9eeb:a7e2f0d] in mainline
- Files:
-
- 1 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r18e9eeb ra7e2f0d 77 77 ./uspace/dist/srv/* 78 78 ./uspace/drv/root/root 79 ./uspace/drv/ehci-hcd/ehci-hcd80 79 ./uspace/drv/isa/isa 81 80 ./uspace/drv/ns8250/ns8250 -
boot/arch/mips32/src/asm.S
r18e9eeb ra7e2f0d 41 41 42 42 start: 43 /* 44 * Setup the CP0 configuration 45 * - Disable 64-bit kernel addressing mode 46 * - DIsable 64-bit supervisor adressing mode 47 * - Disable 64-bit user addressing mode 48 */ 49 mfc0 $a0, $status 50 la $a1, 0xffffff1f 51 and $a0, $a1, $a0 52 mtc0 $a0, $status 53 54 /* 55 * Setup CPU map (on msim this code 56 * is executed in parallel on all CPUs, 57 * but it not an issue). 58 */ 43 /* Setup CPU map (on msim this code 44 is executed in parallel on all CPUs, 45 but it not an issue) */ 59 46 la $a0, PA2KA(CPUMAP_OFFSET) 60 47 … … 107 94 lw $k1, ($k0) 108 95 109 /* 110 * If we are not running on BSP 111 * then end in an infinite loop. 112 */ 96 /* If we are not running on BSP 97 then end in an infinite loop */ 113 98 beq $k1, $zero, bsp 114 99 nop … … 142 127 143 128 jump_to_kernel: 144 /* 145 * TODO: 146 * 147 * Make sure that the I-cache, D-cache and memory are mutually 148 * coherent before passing control to the copied code. 149 */ 129 # 130 # TODO: 131 # Make sure that the I-cache, D-cache and memory are mutually coherent 132 # before passing control to the copied code. 133 # 150 134 j $a0 151 135 nop -
uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
r18e9eeb ra7e2f0d 125 125 126 126 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 127 c = getopt_long(argc, argv, " s:h", long_options, &opt_ind);127 c = getopt_long(argc, argv, "pvhVfm:", long_options, &opt_ind); 128 128 switch (c) { 129 129 case 'h': -
uspace/drv/usbmid/main.c
r18e9eeb ra7e2f0d 44 44 #include "usbmid.h" 45 45 46 /** Callback when new MID device is attached to the host.47 *48 * @param gen_dev Generic DDF device representing the new device.49 * @return Error code.50 */51 46 static int usbmid_add_device(ddf_dev_t *gen_dev) 52 47 { … … 91 86 } 92 87 93 /** USB MID driver ops. */94 88 static driver_ops_t mid_driver_ops = { 95 89 .add_device = usbmid_add_device, 96 90 }; 97 91 98 /** USB MID driver. */99 92 static driver_t mid_driver = { 100 93 .name = NAME, -
uspace/drv/usbmid/usbmid.c
r18e9eeb ra7e2f0d 67 67 } 68 68 69 /** DDF interface of the child - interface function. */70 69 static usb_iface_t child_usb_iface = { 71 70 .get_hc_handle = usb_iface_get_hc_handle_hub_child_impl, … … 74 73 }; 75 74 76 /** Operations for children - interface functions. */ 75 77 76 static ddf_dev_ops_t child_device_ops = { 78 77 .interfaces[USB_DEV_IFACE] = &child_usb_iface 79 78 }; 80 79 81 /** Operations of the device itself. */82 80 static ddf_dev_ops_t mid_device_ops = { 83 81 .interfaces[USB_DEV_IFACE] = &usb_iface_hub_impl -
uspace/drv/usbmid/usbmid.h
r18e9eeb ra7e2f0d 44 44 #define NAME "usbmid" 45 45 46 /** USB MID device container. */47 46 typedef struct { 48 47 /** Device container. */ … … 55 54 } usbmid_device_t; 56 55 57 58 /** Container for single interface in a MID device. */59 56 typedef struct { 60 57 /** Function container. */ -
uspace/drv/usbmouse/init.c
r18e9eeb ra7e2f0d 101 101 102 102 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 103 /** Device ops for USB mouse. */104 103 static ddf_dev_ops_t mouse_ops = { 105 104 .default_handler = default_connection_handler … … 136 135 } 137 136 138 /** Create USB mouse device. 139 * 140 * The mouse device is stored into <code>dev->driver_data</code>. 141 * 142 * @param dev Generic device. 143 * @return Error code. 144 */ 137 145 138 int usb_mouse_create(ddf_dev_t *dev) 146 139 { -
uspace/drv/usbmouse/main.c
r18e9eeb ra7e2f0d 39 39 #include <str_error.h> 40 40 41 /** Callback when new mouse device is attached and recognised by DDF.42 *43 * @param dev Representation of a generic DDF device.44 * @return Error code.45 */46 41 static int usbmouse_add_device(ddf_dev_t *dev) 47 42 { … … 68 63 } 69 64 70 /** USB mouse driver ops. */71 65 static driver_ops_t mouse_driver_ops = { 72 66 .add_device = usbmouse_add_device, 73 67 }; 74 68 75 /** USB mouse driver. */76 69 static driver_t mouse_driver = { 77 70 .name = NAME, … … 81 74 int main(int argc, char *argv[]) 82 75 { 83 usb_log_enable(USB_LOG_LEVEL_DEBUG , NAME);76 usb_log_enable(USB_LOG_LEVEL_DEBUG2, NAME); 84 77 85 78 return ddf_driver_main(&mouse_driver); -
uspace/drv/usbmouse/mouse.c
r18e9eeb ra7e2f0d 40 40 #include <ipc/mouse.h> 41 41 42 /** Fibril function for polling the mouse device.43 *44 * This function shall not terminate unless the device breaks and fails45 * to send data (e.g. stalls on data request).46 *47 * @param arg ddf_dev_t type representing the mouse device.48 * @return EOK Always.49 */50 42 int usb_mouse_polling_fibril(void *arg) 51 43 { -
uspace/drv/usbmouse/mouse.h
r18e9eeb ra7e2f0d 43 43 #define NAME "usbmouse" 44 44 45 /** Container for USB mouse device. */46 45 typedef struct { 47 /** Generic device container. */48 46 ddf_dev_t *device; 49 /** Function representing the device. */50 47 ddf_fun_t *mouse_fun; 51 /** Representation of connection to the device. */52 48 usb_device_connection_t wire; 53 /** Default (zero) control pipe. */54 49 usb_endpoint_pipe_t ctrl_pipe; 55 /** Polling (in) pipe. */56 50 usb_endpoint_pipe_t poll_pipe; 57 /** Polling interval in microseconds. */58 51 suseconds_t poll_interval_us; 59 /** IPC phone to console (consumer). */60 52 int console_phone; 61 53 } usb_mouse_t; -
uspace/lib/usb/include/usb/classes/classes.h
r18e9eeb ra7e2f0d 31 31 */ 32 32 /** @file 33 * USB device classes (generic constants and functions).33 * @brief USB device classes and subclasses. 34 34 */ 35 35 #ifndef LIBUSB_CLASSES_H_ -
uspace/lib/usb/include/usb/debug.h
r18e9eeb ra7e2f0d 31 31 */ 32 32 /** @file 33 * Debugging related functions.33 * @brief 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 41 44 void usb_dump_standard_descriptor(FILE *, const char *, const char *, 42 45 const uint8_t *, size_t); … … 44 47 /** Logging level. */ 45 48 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 error52 * Shall be used for errors fatal for single device but not for53 * driver itself.54 */55 50 USB_LOG_LEVEL_ERROR, 56 57 /** Warning.58 * Problems from which the driver is able to recover gracefully.59 */60 51 USB_LOG_LEVEL_WARNING, 61 62 /** Information message.63 * This should be the last level that is printed by default to64 * the screen.65 * Typical usage is to inform that new device was found and what66 * are its capabilities.67 * Do not use for repetitive actions (such as device polling).68 */69 52 USB_LOG_LEVEL_INFO, 70 71 /** Debugging message. */72 53 USB_LOG_LEVEL_DEBUG, 73 74 /** More detailed debugging message. */75 54 USB_LOG_LEVEL_DEBUG2, 76 77 /** Terminating constant for logging levels. */78 55 USB_LOG_LEVEL_MAX 79 56 } usb_log_level_t; … … 84 61 void usb_log_printf(usb_log_level_t, const char *, ...); 85 62 86 /** Log fatal error. */87 63 #define usb_log_fatal(format, ...) \ 88 64 usb_log_printf(USB_LOG_LEVEL_FATAL, format, ##__VA_ARGS__) 89 65 90 /** Log normal (recoverable) error. */91 66 #define usb_log_error(format, ...) \ 92 67 usb_log_printf(USB_LOG_LEVEL_ERROR, format, ##__VA_ARGS__) 93 68 94 /** Log warning. */95 69 #define usb_log_warning(format, ...) \ 96 70 usb_log_printf(USB_LOG_LEVEL_WARNING, format, ##__VA_ARGS__) 97 71 98 /** Log informational message. */99 72 #define usb_log_info(format, ...) \ 100 73 usb_log_printf(USB_LOG_LEVEL_INFO, format, ##__VA_ARGS__) 101 74 102 /** Log debugging message. */103 75 #define usb_log_debug(format, ...) \ 104 76 usb_log_printf(USB_LOG_LEVEL_DEBUG, format, ##__VA_ARGS__) 105 77 106 /** Log verbose debugging message. */107 78 #define usb_log_debug2(format, ...) \ 108 79 usb_log_printf(USB_LOG_LEVEL_DEBUG2, format, ##__VA_ARGS__) -
uspace/lib/usb/include/usb/descriptor.h
r18e9eeb ra7e2f0d 31 31 */ 32 32 /** @file 33 * Standard USB descriptors.33 * @brief 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 criptor index. */85 /** Device serial number desriptor 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 169 172 #endif 170 173 /** -
uspace/lib/usb/include/usb/dp.h
r18e9eeb ra7e2f0d 31 31 */ 32 32 /** @file 33 * USB descriptor parser.33 * @brief 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 form44 * (e.g. that endpoint descriptor belongs to interface or that45 * interface belongs to configuration).46 *47 * See usb_descriptor_type_t for descriptor constants.48 */49 42 typedef struct { 50 /** Child descriptor id. */51 43 int child; 52 /** Parent descriptor id. */53 44 int parent; 54 45 } usb_dp_descriptor_nesting_t; … … 56 47 extern usb_dp_descriptor_nesting_t usb_dp_standard_descriptor_nesting[]; 57 48 58 /** Descriptor parser structure. */59 49 typedef struct { 60 /** Used descriptor nesting. */61 50 usb_dp_descriptor_nesting_t *nesting; 62 51 } usb_dp_parser_t; 63 52 64 /** Descriptor parser data. */65 53 typedef struct { 66 /** Data to be parsed. */67 54 uint8_t *data; 68 /** Size of input data in bytes. */69 55 size_t size; 70 /** Custom argument. */71 56 void *arg; 72 57 } usb_dp_parser_data_t; -
uspace/lib/usb/include/usb/hub.h
r18e9eeb ra7e2f0d 32 32 /** @file 33 33 * Functions needed by hub drivers. 34 *35 * For class specific requests, see usb/classes/hub.h.36 34 */ 37 35 #ifndef LIBUSB_HUB_H_ -
uspace/lib/usb/include/usb/pipes.h
r18e9eeb ra7e2f0d 43 43 #include <ddf/driver.h> 44 44 45 /** Abstraction of a physical connection to the device. 45 /** 46 * Abstraction of a physical connection to the device. 46 47 * This type is an abstraction of the USB wire that connects the host and 47 48 * the function (device). … … 54 55 } usb_device_connection_t; 55 56 56 /** Abstraction of a logical connection to USB device endpoint. 57 /** 58 * Abstraction of a logical connection to USB device endpoint. 57 59 * It encapsulates endpoint attributes (transfer type etc.) as well 58 60 * as information about currently running sessions. … … 109 111 /** Found descriptor fitting the description. */ 110 112 usb_standard_endpoint_descriptor_t *descriptor; 111 /** Interface descriptorthe endpoint belongs to. */113 /** Interface the endpoint belongs to. */ 112 114 usb_standard_interface_descriptor_t *interface; 113 115 /** Whether the endpoint was actually found. */ -
uspace/lib/usb/include/usb/request.h
r18e9eeb ra7e2f0d 72 72 union { 73 73 uint16_t value; 74 /* FIXME: add #ifdefs according to host endian ness */74 /* FIXME: add #ifdefs according to host endianess */ 75 75 struct { 76 76 uint8_t value_low; -
uspace/lib/usb/include/usb/usb.h
r18e9eeb ra7e2f0d 31 31 */ 32 32 /** @file 33 * Common USB types and functions.33 * @brief Base USB types. 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 */129 123 static inline int usb_target_same(usb_target_t a, usb_target_t b) 130 124 { -
uspace/lib/usb/src/ddfiface.c
r18e9eeb ra7e2f0d 88 88 IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &hc_handle); 89 89 90 async_hangup(parent_phone);91 92 90 if (rc != EOK) { 93 91 return rc; -
uspace/lib/usb/src/debug.c
r18e9eeb ra7e2f0d 31 31 */ 32 32 /** @file 33 * Debugging and logging support.33 * @brief Debugging support. 34 34 */ 35 35 #include <adt/list.h> … … 40 40 #include <usb/debug.h> 41 41 42 /** Debugging tag. */ 43 typedef struct { 44 /** Linked list member. */ 45 link_t link; 46 /** Tag name. 47 * We always have a private copy of the name. 48 */ 49 char *tag; 50 /** Enabled level of debugging. */ 51 int level; 52 } usb_debug_tag_t; 53 54 /** Get instance of usb_debug_tag_t from link_t. */ 55 #define USB_DEBUG_TAG_INSTANCE(iterator) \ 56 list_get_instance(iterator, usb_debug_tag_t, link) 57 58 /** List of all known tags. */ 59 static LIST_INITIALIZE(tag_list); 60 /** Mutex guard for the list of all tags. */ 61 static FIBRIL_MUTEX_INITIALIZE(tag_list_guard); 62 42 63 /** Level of logging messages. */ 43 64 static usb_log_level_t log_level = USB_LOG_LEVEL_WARNING; 44 45 65 /** Prefix for logging messages. */ 46 66 static const char *log_prefix = "usb"; 47 48 67 /** Serialization mutex for logging functions. */ 49 68 static FIBRIL_MUTEX_INITIALIZE(log_serializer); 50 51 /** File where to store the log. */52 69 static FILE *log_stream = NULL; 53 70 71 /** Find or create new tag with given name. 72 * 73 * @param tagname Tag name. 74 * @return Debug tag structure. 75 * @retval NULL Out of memory. 76 */ 77 static usb_debug_tag_t *get_tag(const char *tagname) 78 { 79 link_t *link; 80 for (link = tag_list.next; \ 81 link != &tag_list; \ 82 link = link->next) { 83 usb_debug_tag_t *tag = USB_DEBUG_TAG_INSTANCE(link); 84 if (str_cmp(tag->tag, tagname) == 0) { 85 return tag; 86 } 87 } 88 89 /* 90 * Tag not found, we will create a new one. 91 */ 92 usb_debug_tag_t *new_tag = malloc(sizeof(usb_debug_tag_t)); 93 int rc = asprintf(&new_tag->tag, "%s", tagname); 94 if (rc < 0) { 95 free(new_tag); 96 return NULL; 97 } 98 list_initialize(&new_tag->link); 99 new_tag->level = 1; 100 101 /* 102 * Append it to the end of known tags. 103 */ 104 list_append(&new_tag->link, &tag_list); 105 106 return new_tag; 107 } 108 109 /** Print debugging information. 110 * If the tag is used for the first time, its structures are automatically 111 * created and initial verbosity level is set to 1. 112 * 113 * @param tagname Tag name. 114 * @param level Level (verbosity) of the message. 115 * @param format Formatting string for printf(). 116 */ 117 void usb_dprintf(const char *tagname, int level, const char *format, ...) 118 { 119 fibril_mutex_lock(&tag_list_guard); 120 usb_debug_tag_t *tag = get_tag(tagname); 121 if (tag == NULL) { 122 printf("USB debug: FATAL ERROR - failed to create tag.\n"); 123 goto leave; 124 } 125 126 if (tag->level < level) { 127 goto leave; 128 } 129 130 va_list args; 131 va_start(args, format); 132 133 printf("[%s:%d]: ", tagname, level); 134 vprintf(format, args); 135 136 va_end(args); 137 138 leave: 139 fibril_mutex_unlock(&tag_list_guard); 140 } 141 142 /** Enable debugging prints for given tag. 143 * 144 * Setting level to <i>n</i> will cause that only printing messages 145 * with level lower or equal to <i>n</i> will be printed. 146 * 147 * @param tagname Tag name. 148 * @param level Enabled level. 149 */ 150 void usb_dprintf_enable(const char *tagname, int level) 151 { 152 fibril_mutex_lock(&tag_list_guard); 153 usb_debug_tag_t *tag = get_tag(tagname); 154 if (tag == NULL) { 155 printf("USB debug: FATAL ERROR - failed to create tag.\n"); 156 goto leave; 157 } 158 159 tag->level = level; 160 161 leave: 162 fibril_mutex_unlock(&tag_list_guard); 163 } 54 164 55 165 /** Enable logging. … … 72 182 } 73 183 74 /** Get log level name prefix. 75 * 76 * @param level Log level. 77 * @return String prefix for the message. 78 */ 184 79 185 static const char *log_level_name(usb_log_level_t level) 80 186 { … … 150 256 /* string + terminator + number width (enough for 4GB)*/ 151 257 #define REMAINDER_STR_LEN (5 + 1 + 10) 152 153 /** How many bytes to group together. */154 258 #define BUFFER_DUMP_GROUP_SIZE 4 155 156 /** Size of the string for buffer dumps. */157 259 #define BUFFER_DUMP_LEN 240 /* Ought to be enough for everybody ;-). */ 158 159 /** Fibril local storage for the dumped buffer. */160 260 static fibril_local char buffer_dump[BUFFER_DUMP_LEN]; 161 261 … … 165 265 * in a static fibril local string. 166 266 * That means that you do not have to deallocate the string (actually, you 167 * can not do that) and you do not have to guard it againstconcurrent267 * can not do that) and you do not have to save it agains concurrent 168 268 * calls to it. 169 269 * The only limitation is that each call rewrites the buffer again. -
uspace/lib/usb/src/dp.c
r18e9eeb ra7e2f0d 32 32 /** 33 33 * @file 34 * USB descriptor parser (implementation). 35 * 36 * The descriptor parser is a generic parser for structure, where individual 37 * items are stored in single buffer and each item begins with length followed 38 * by type. These types are organized into tree hierarchy. 39 * 40 * The parser is able of only two actions: find first child and find next 41 * sibling. 34 * @brief USB descriptor parser (implementation). 42 35 */ 43 36 #include <stdio.h> -
uspace/lib/usb/src/dump.c
r18e9eeb ra7e2f0d 31 31 */ 32 32 /** @file 33 * Descriptor dumping.33 * @brief Descriptor dumping. 34 34 */ 35 35 #include <adt/list.h> … … 43 43 #include <usb/classes/hid.h> 44 44 45 /** Mapping between descriptor id and dumping function. */46 45 typedef struct { 47 /** Descriptor id. */48 46 int id; 49 /** Dumping function. */50 47 void (*dump)(FILE *, const char *, const char *, 51 48 const uint8_t *, size_t); … … 69 66 const uint8_t *, size_t); 70 67 71 /** Descriptor dumpers mapping. */72 68 static descriptor_dump_t descriptor_dumpers[] = { 73 69 { USB_DESCTYPE_DEVICE, usb_dump_descriptor_device }, … … 277 273 const uint8_t *descriptor, size_t descriptor_length) 278 274 { 279 /* TODO */280 275 } 281 276 … … 284 279 const uint8_t *descriptor, size_t descriptor_length) 285 280 { 286 /* TODO */287 281 } 288 282 -
uspace/lib/usb/src/hub.c
r18e9eeb ra7e2f0d 144 144 /** Wrapper for registering attached device to the hub. 145 145 * 146 * The @p enable_port function is expected to enable si gnaling on given146 * The @p enable_port function is expected to enable singalling on given 147 147 * port. 148 148 * The two arguments to it can have arbitrary meaning … … 152 152 * 153 153 * If the @p enable_port fails (i.e. does not return EOK), the device 154 * addition is cancel ed.154 * addition is cancelled. 155 155 * The return value is then returned (it is good idea to use different 156 156 * error codes than those listed as return codes by this function itself). … … 159 159 * @param connection Opened connection to host controller. 160 160 * @param dev_speed New device speed. 161 * @param enable_port Function for enabling signal ing through the port the161 * @param enable_port Function for enabling signalling through the port the 162 162 * device is attached to. 163 163 * @param port_no Port number (passed through to @p enable_port). … … 201 201 202 202 /* 203 * Enable the port (i.e. allow signal ing through this port).203 * Enable the port (i.e. allow signalling through this port). 204 204 */ 205 205 rc = enable_port(port_no, arg); -
uspace/lib/usb/src/pipesio.c
r18e9eeb ra7e2f0d 115 115 116 116 if (data_request_rc != EOK) { 117 /* Prefer the return code of the opening request. */ 118 if (opening_request_rc != EOK) { 119 return (int) opening_request_rc; 120 } else { 121 return (int) data_request_rc; 122 } 117 return (int) data_request_rc; 123 118 } 124 119 if (opening_request_rc != EOK) { … … 336 331 337 332 if (data_request_rc != EOK) { 338 /* Prefer the return code of the opening request. */ 339 if (opening_request_rc != EOK) { 340 return (int) opening_request_rc; 341 } else { 342 return (int) data_request_rc; 343 } 333 return (int) data_request_rc; 344 334 } 345 335 if (opening_request_rc != EOK) { -
uspace/lib/usb/src/recognise.c
r18e9eeb ra7e2f0d 31 31 */ 32 32 /** @file 33 * Functions for recognitionof attached devices.33 * @brief Functions for recognising kind of attached devices. 34 34 */ 35 35 #include <sys/types.h> … … 44 44 #include <assert.h> 45 45 46 /** Index to append after device name for uniqueness. */47 46 static size_t device_name_index = 0; 48 /** Mutex guard for device_name_index. */49 47 static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex); 50 48 51 /** DDF operations of child devices. */52 49 ddf_dev_ops_t child_ops = { 53 50 .interfaces[USB_DEV_IFACE] = &usb_iface_hub_child_impl 54 51 }; 55 52 56 /** Get integer part from BCD coded number. */57 53 #define BCD_INT(a) (((unsigned int)(a)) / 256) 58 /** Get fraction part from BCD coded number (as an integer, no less). */59 54 #define BCD_FRAC(a) (((unsigned int)(a)) % 256) 60 55 61 /** Format for BCD coded number to be used in printf. */62 56 #define BCD_FMT "%x.%x" 63 /** Arguments to printf for BCD coded number. */64 57 #define BCD_ARGS(a) BCD_INT((a)), BCD_FRAC((a)) 65 58 … … 120 113 } 121 114 122 /** Add match id to list or return with error code.123 *124 * @param match_ids List of match ids.125 * @param score Match id score.126 * @param format Format of the matching string127 * @param ... Arguments for the format.128 */129 115 #define ADD_MATCHID_OR_RETURN(match_ids, score, format, ...) \ 130 116 do { \ -
uspace/lib/usb/src/request.c
r18e9eeb ra7e2f0d 110 110 * (must be in USB endianness). 111 111 * @param data Buffer where to store data accepted during the DATA stage. 112 * (they will come in USB endian ness).112 * (they will come in USB endianess). 113 113 * @param data_size Size of the @p data buffer 114 114 * (in native endianness). … … 161 161 * the new address. 162 162 * 163 * @see usb_drv_reserve_default_address 164 * @see usb_drv_release_default_address 165 * @see usb_drv_request_address 166 * @see usb_drv_release_address 167 * @see usb_drv_bind_address 168 * 163 169 * @param pipe Control endpoint pipe (session must be already started). 164 170 * @param new_address New USB address to be set (in native endianness). … … 522 528 return EEMPTY; 523 529 } 524 /* Sub tract first 2 bytes (length and descriptor type). */530 /* Substract first 2 bytes (length and descriptor type). */ 525 531 string_descriptor_size -= 2; 526 532 … … 542 548 size_t i; 543 549 for (i = 0; i < langs_count; i++) { 544 /* Language code from the descriptor is in USB endian ness. */550 /* Language code from the descriptor is in USB endianess. */ 545 551 /* FIXME: is this really correct? */ 546 552 uint16_t lang_code = (string_descriptor[2 + 2 * i + 1] << 8) … … 563 569 * 564 570 * @param[in] pipe Control endpoint pipe (session must be already started). 565 * @param[in] index String index (in native endian ness),571 * @param[in] index String index (in native endianess), 566 572 * first index has number 1 (index from descriptors can be used directly). 567 * @param[in] lang String language (in native endian ness).573 * @param[in] lang String language (in native endianess). 568 574 * @param[out] string_ptr Where to store allocated string in native encoding. 569 575 * @return Error code. … … 607 613 goto leave; 608 614 } 609 /* Sub tract first 2 bytes (length and descriptor type). */615 /* Substract first 2 bytes (length and descriptor type). */ 610 616 string_size -= 2; 611 617 -
uspace/lib/usb/src/usb.c
r18e9eeb ra7e2f0d 31 31 */ 32 32 /** @file 33 * Common USB functions.33 * @brief Base USB types. 34 34 */ 35 35 #include <usb/usb.h> … … 37 37 38 38 39 /** String representation for USB transfer type. 40 * 41 * @param t Transfer type. 42 * @return Transfer type as a string (in English). 43 */ 39 /** String representation for USB transfer type. */ 44 40 const char * usb_str_transfer_type(usb_transfer_type_t t) 45 41 {
Note:
See TracChangeset
for help on using the changeset viewer.