libusb.3 (5b40d9601c72fbb04f32437d529dbf51252dc31e) libusb.3 (37d0636aac290cc86ec7149a55167f6c21ad480f)
1.\"
2.\" Copyright (c) 2009 Sylvestre Gallon
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 362 unchanged lines hidden (view full) ---

371On success the pointer to resulting descriptor is stored at the location given by
372.Fa ep_comp .
373Returns zero on success and a LIBUSB_ERROR code on failure.
374On success the parsed USB 3.0 endpoint companion descriptor must be
375freed using the libusb_free_ss_endpoint_comp function.
376.Pp
377.Ft void
378.Fn libusb_free_ss_endpoint_comp "libusb_ss_endpoint_companion_descriptor *ep_comp"
1.\"
2.\" Copyright (c) 2009 Sylvestre Gallon
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 362 unchanged lines hidden (view full) ---

371On success the pointer to resulting descriptor is stored at the location given by
372.Fa ep_comp .
373Returns zero on success and a LIBUSB_ERROR code on failure.
374On success the parsed USB 3.0 endpoint companion descriptor must be
375freed using the libusb_free_ss_endpoint_comp function.
376.Pp
377.Ft void
378.Fn libusb_free_ss_endpoint_comp "libusb_ss_endpoint_companion_descriptor *ep_comp"
379This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor.
379This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor given by
380.Fa ep_comp .
380.Pp
381.Ft int
381.Pp
382.Ft int
383.Fn libusb_get_ss_endpoint_companion_descriptor "struct libusb_context *ctx" "const struct libusb_endpoint_descriptor *endpoint" "struct libusb_ss_endpoint_companion_descriptor **ep_comp"
384This function finds and parses the USB 3.0 endpoint companion descriptor given by
385.Fa endpoint .
386Returns zero on success and a LIBUSB_ERROR code on failure.
387On success the parsed USB 3.0 endpoint companion descriptor must be
388freed using the libusb_free_ss_endpoint_companion_descriptor function.
389.Pp
390.Ft void
391.Fn libusb_free_ss_endpoint_companion_descriptor "struct libusb_ss_endpoint_companion_descriptor *ep_comp"
392This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor given by
393.Fa ep_comp .
394.Pp
395.Ft int
396.Fn libusb_get_bos_descriptor "libusb_device_handle *handle" "struct libusb_bos_descriptor **bos"
397This function queries the USB device given by
398.Fa handle
399and stores a pointer to a parsed BOS descriptor into
400.Fa bos .
401Returns zero on success and a LIBUSB_ERROR code on failure.
402On success the parsed BOS descriptor must be
403freed using the libusb_free_bos_descriptor function.
404.Pp
405.Ft int
382.Fn libusb_parse_bos_descriptor "const void *buf" "int len" "libusb_bos_descriptor **bos"
383This function parses a Binary Object Store, BOS, descriptor into host endian format pointed to by
384.Fa buf
385and having a length of
386.Fa len .
387On success the pointer to resulting descriptor is stored at the location given by
388.Fa bos .
389Returns zero on success and a LIBUSB_ERROR code on failure.
390On success the parsed BOS descriptor must be freed using the
391libusb_free_bos_descriptor function.
392.Pp
393.Ft void
394.Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos"
406.Fn libusb_parse_bos_descriptor "const void *buf" "int len" "libusb_bos_descriptor **bos"
407This function parses a Binary Object Store, BOS, descriptor into host endian format pointed to by
408.Fa buf
409and having a length of
410.Fa len .
411On success the pointer to resulting descriptor is stored at the location given by
412.Fa bos .
413Returns zero on success and a LIBUSB_ERROR code on failure.
414On success the parsed BOS descriptor must be freed using the
415libusb_free_bos_descriptor function.
416.Pp
417.Ft void
418.Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos"
395This function is NULL safe and frees a parsed BOS descriptor.
419This function is NULL safe and frees a parsed BOS descriptor given by
420.Fa bos .
421.Pp
422.Ft int
423.Fn libusb_get_usb_2_0_extension_descriptor "struct libusb_context *ctx" "struct libusb_bos_dev_capability_descriptor *dev_cap" "struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension"
424This function parses the USB 2.0 extension descriptor from the descriptor given by
425.Fa dev_cap
426and stores a pointer to the parsed descriptor into
427.Fa usb_2_0_extension .
428Returns zero on success and a LIBUSB_ERROR code on failure.
429On success the parsed USB 2.0 extension descriptor must be freed using the
430libusb_free_usb_2_0_extension_descriptor function.
431.Pp
432.Ft void
433.Fn libusb_free_usb_2_0_extension_descriptor "struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension"
434This function is NULL safe and frees a parsed USB 2.0 extension descriptor given by
435.Fa usb_2_0_extension .
436.Pp
437.Ft int
438.Fn libusb_get_ss_usb_device_capability_descriptor "struct libusb_context *ctx" "struct libusb_bos_dev_capability_descriptor *dev_cap" "struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_capability"
439This function parses the SuperSpeed device capability descriptor from the descriptor given by
440.Fa dev_cap
441and stores a pointer to the parsed descriptor into
442.Fa ss_usb_device_capability .
443Returns zero on success and a LIBUSB_ERROR code on failure.
444On success the parsed SuperSpeed device capability descriptor must be freed using the
445libusb_free_ss_usb_device_capability_descriptor function.
446.Pp
447.Ft void
448.Fn libusb_free_ss_usb_device_capability_descriptor "struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_capability"
449This function is NULL safe and frees a parsed SuperSpeed device capability descriptor given by
450.Fa ss_usb_device_capability .
451.Pp
452.Ft int
453.Fn libusb_get_container_id_descriptor "struct libusb_context *ctx" "struct libusb_bos_dev_capability_descriptor *dev_cap" "struct libusb_container_id_descriptor **container_id"
454This function parses the container ID descriptor from the descriptor given by
455.Fa dev_cap
456and stores a pointer to the parsed descriptor into
457.Fa container_id .
458Returns zero on success and a LIBUSB_ERROR code on failure.
459On success the parsed container ID descriptor must be freed using the
460libusb_free_container_id_descriptor function.
461.Pp
462.Ft void
463.Fn libusb_free_container_id_descriptor "struct libusb_container_id_descriptor *container_id"
464This function is NULL safe and frees a parsed container ID descriptor given by
465.Fa container_id .
396.Sh USB ASYNCHRONOUS I/O
397.Ft struct libusb_transfer *
398.Fn libusb_alloc_transfer "int iso_packets"
399Allocate a transfer with the number of isochronous packet descriptors
400specified by
401.Fa iso_packets .
402Returns NULL on error.
403.Pp

--- 217 unchanged lines hidden ---
466.Sh USB ASYNCHRONOUS I/O
467.Ft struct libusb_transfer *
468.Fn libusb_alloc_transfer "int iso_packets"
469Allocate a transfer with the number of isochronous packet descriptors
470specified by
471.Fa iso_packets .
472Returns NULL on error.
473.Pp

--- 217 unchanged lines hidden ---