FreeBSD kernel usb device Code
usb_parse.c File Reference
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#include <dev/usb/usb_core.h>
#include <dev/usb/usb_debug.h>
Include dependency graph for usb_parse.c:

Go to the source code of this file.

Macros

#define USB_DEBUG_VAR   usb_debug
 

Functions

struct usb_descriptorusb_desc_foreach (struct usb_config_descriptor *cd, struct usb_descriptor *_desc)
 
struct usb_interface_descriptorusb_idesc_foreach (struct usb_config_descriptor *cd, struct usb_idesc_parse_state *ps)
 
struct usb_endpoint_descriptorusb_edesc_foreach (struct usb_config_descriptor *cd, struct usb_endpoint_descriptor *ped)
 
struct usb_endpoint_ss_comp_descriptorusb_ed_comp_foreach (struct usb_config_descriptor *cd, struct usb_endpoint_ss_comp_descriptor *ped)
 
uint8_t usbd_get_no_descriptors (struct usb_config_descriptor *cd, uint8_t type)
 
uint8_t usbd_get_no_alts (struct usb_config_descriptor *cd, struct usb_interface_descriptor *id)
 

Macro Definition Documentation

◆ USB_DEBUG_VAR

#define USB_DEBUG_VAR   usb_debug

Definition at line 55 of file usb_parse.c.

Function Documentation

◆ usb_desc_foreach()

◆ usb_ed_comp_foreach()

struct usb_endpoint_ss_comp_descriptor * usb_ed_comp_foreach ( struct usb_config_descriptor cd,
struct usb_endpoint_ss_comp_descriptor ped 
)

Definition at line 234 of file usb_parse.c.

References usb_endpoint_descriptor::bDescriptorType, usb_endpoint_descriptor::bLength, desc, UDESC_ENDPOINT, UDESC_ENDPOINT_SS_COMP, UDESC_INTERFACE, and usb_desc_foreach().

Referenced by usb_config_parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_edesc_foreach()

struct usb_endpoint_descriptor * usb_edesc_foreach ( struct usb_config_descriptor cd,
struct usb_endpoint_descriptor ped 
)

Definition at line 199 of file usb_parse.c.

References usb_endpoint_descriptor::bDescriptorType, usb_endpoint_descriptor::bLength, desc, UDESC_ENDPOINT, UDESC_INTERFACE, and usb_desc_foreach().

Referenced by usb_config_parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_idesc_foreach()

struct usb_interface_descriptor * usb_idesc_foreach ( struct usb_config_descriptor cd,
struct usb_idesc_parse_state ps 
)

Definition at line 126 of file usb_parse.c.

References usb_idesc_parse_state::desc, DPRINTF, id, usb_idesc_parse_state::iface_index, usb_idesc_parse_state::iface_index_alt, usb_idesc_parse_state::iface_no_last, UDESC_INTERFACE, usb_desc_foreach(), and USB_IFACE_MAX.

Referenced by usb_config_parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usbd_get_no_alts()

uint8_t usbd_get_no_alts ( struct usb_config_descriptor cd,
struct usb_interface_descriptor id 
)

Definition at line 288 of file usb_parse.c.

References usb_endpoint_descriptor::bDescriptorType, usb_endpoint_descriptor::bLength, desc, id, n, UDESC_INTERFACE, and usb_desc_foreach().

Referenced by usb_check_alt_setting().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usbd_get_no_descriptors()

uint8_t usbd_get_no_descriptors ( struct usb_config_descriptor cd,
uint8_t  type 
)

Definition at line 264 of file usb_parse.c.

References usb_endpoint_descriptor::bDescriptorType, count, desc, type, and usb_desc_foreach().

Referenced by usb_alloc_device().

Here is the call graph for this function:
Here is the caller graph for this function: