Lines Matching +full:usb +full:- +full:valid
113 The Universal Serial Bus (USB) driver programming interface provides
115 controlling and communicating with USB peripherals.
117 .Nm usb
118 module supports both USB Host and USB Device side mode.
119 .Sh USB TRANSFER MANAGEMENT FUNCTIONS
120 The USB standard defines four types of USB transfers.
130 This function will allocate memory for and initialise an array of USB
141 is a pointer to an array of USB transfer pointers that are initialized
142 to NULL, and then pointed to allocated USB transfers.
144 is a pointer to an array of USB config structures.
146 is a number telling the USB system how many USB transfers should be
150 "xfer->priv_sc".
154 This pointer is used to initialize "xfer->priv_mtx".
156 A non-zero return value indicates failure.
161 This function will release the given USB transfers and all allocated
162 resources associated with these USB transfers.
164 is a pointer to an array of USB transfer pointers, that may be NULL,
165 that should be freed by the USB system.
167 is a number telling the USB system how many USB transfers should be
170 This function can sleep waiting for USB transfers to complete.
172 This function is NULL safe with regard to the USB transfer structure
175 It is not allowed to call this function from the USB transfer
181 This function will start the USB transfer pointed to by
185 This function is always non-blocking and must be called with the
186 so-called private USB mutex locked.
188 This function is NULL safe with regard to the USB transfer structure
194 This function will stop the USB transfer pointed to by
198 This function is always non-blocking and must be called with the
199 so-called private USB mutex locked.
201 This function can return before the USB callback has been called.
203 This function is NULL safe with regard to the USB transfer structure
212 This function will stop an USB transfer, if not already stopped and
213 wait for any additional USB hardware operations to complete.
218 This function can block the caller and will not return before the USB
221 This function is NULL safe with regard to the USB transfer structure
224 .Sh USB TRANSFER CALLBACK
226 The USB callback has three states.
234 The USB callback should not restart the USB transfer in case the error
237 The USB callback is protected from recursion.
251 This function should only be called from within the USB callback and
252 is used to start the USB hardware.
254 An USB transfer can have multiple frames consisting of one or more USB
255 packets making up an I/O vector for all USB transfer types.
257 .Bd -literal -offset indent
275 * Read usb frame data, if any.
290 * USB mutex locked.
296 .Sh USB CONTROL TRANSFERS
297 An USB control transfer has three parts.
307 If an USB control transfer has no DATA stage,
312 .Bd -literal -offset indent
325 Example3: SETUP + DATA + STATUS - split
338 Example4: SETUP + STATUS - split
352 .Sh USB TRANSFER CONFIG
354 .Nm usb
355 module defines a USB config structure where it is possible to specify
357 .Bd -literal -offset indent
375 field selects the USB pipe type.
377 Valid values are: UE_INTERRUPT, UE_CONTROL, UE_BULK,
386 field selects the USB endpoint number.
388 A value of 0xFF, "-1" or "UE_ADDR_ANY" will select the first matching
395 field selects the USB endpoint direction.
399 Else valid values are: "UE_DIR_IN" and "UE_DIR_OUT".
419 .Bl -tag -width "UE_ISOCHRONOUS"
428 "0" no transfer pre-delay.
434 pre-delay has elapsed!
439 field, if non-zero, will set the transfer timeout in milliseconds.
447 .Bl -tag -width "UE_INTERRUPT"
449 xfer->nframes = 1;
451 xfer->nframes = 1;
453 xfer->nframes = 2;
468 be used when setting up the given USB transfer.
473 flags an USB transfer.
474 Valid flags are:
475 .Bl -tag -width "force_short_xfer"
477 This flag forces the last transmitted USB packet to be short.
478 A short packet has a length of less than "xfer->max_packet_size", which
482 This flag allows the received transfer length, "xfer->actlen" to be
483 less than "xfer->sumlen" upon completion of a transfer.
486 This flag allows the reception of multiple short USB frames.
492 This flag causes a failing USB transfer to remain first in the PIPE
493 queue except in the case of "xfer->error" equal to
495 No other USB transfers in the affected PIPE queue
497 .Bl -tag -width "X"
499 The failing USB transfer is stopped using "usbd_transfer_stop()".
501 The failing USB transfer performs a successful transfer.
504 queued for execution on an USB endpoint, and the first executing
508 In this case this flag is used to prevent the following USB transfers
509 from being executed at the same time the clear-stall command is
510 executed on the USB control endpoint.
516 NOTE: This flag should be set on all BULK and INTERRUPT USB transfers
524 The maximum data length of any USB transfer is always stored in the
525 "xfer->max_data_length".
527 For control transfers the USB kernel will allocate additional space
528 for the 8-bytes of SETUP header.
530 These 8-bytes are not counted by the "xfer->max_data_length"
540 Instead the USB client must supply a data buffer.
546 Setting this flag prevents an USB STATUS stage to be appended to the
547 end of the USB control transfer.
551 Else an error will be returned to the USB callback.
553 This flag is mostly useful for the USB device side.
564 .Bl -tag -width "Device Side Mode"
569 The transfer is started at the moment the host issues a clear-stall
574 Setting this flag will cause a clear-stall control request to be
575 executed on the endpoint before the USB transfer is started.
578 If this flag is changed outside the USB callback function you have to
604 pointer sets the USB callback.
608 .Sh USB LINUX COMPAT LAYER
610 .Nm usb
611 module supports the Linux USB API.
616 .Xr usb 4 ,
620 .Nm usb
621 module complies with the USB 2.0 standard.
624 .Nm usb
625 module has been inspired by the NetBSD USB stack initially written by
628 .Nm usb