iPXE
Functions
cdc.c File Reference

USB Communications Device Class (CDC) More...

#include <stddef.h>
#include <ipxe/usb.h>
#include <ipxe/cdc.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
struct cdc_union_descriptorcdc_union_descriptor (struct usb_configuration_descriptor *config, struct usb_interface_descriptor *interface)
 Locate CDC union functional descriptor. More...
 

Detailed Description

USB Communications Device Class (CDC)

Definition in file cdc.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ cdc_union_descriptor()

Locate CDC union functional descriptor.

Parameters
configConfiguration descriptor
interfaceInterface descriptor
Return values
descUnion functional descriptor, or NULL if not found

Definition at line 44 of file cdc.c.

45  {
46  struct cdc_union_descriptor *desc;
47 
48  for_each_interface_descriptor ( desc, config, interface ) {
49  if ( ( desc->header.type == USB_CS_INTERFACE_DESCRIPTOR ) &&
50  ( desc->subtype == CDC_SUBTYPE_UNION ) )
51  return desc;
52  }
53  return NULL;
54 }
#define CDC_SUBTYPE_UNION
Union functional descriptor subtype.
Definition: cdc.h:38
#define for_each_interface_descriptor(desc, config, interface)
Iterate over all configuration descriptors within an interface descriptor.
Definition: usb.h:379
An object interface.
Definition: interface.h:109
struct usb_descriptor_header header
Descriptor header.
Definition: cdc.h:30
Union functional descriptor.
Definition: cdc.h:28
uint8_t subtype
Descriptor subtype.
Definition: cdc.h:32
#define USB_CS_INTERFACE_DESCRIPTOR
A class-specific interface descriptor.
Definition: usb.h:331
uint8_t type
Descriptor type.
Definition: usb.h:162
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References CDC_SUBTYPE_UNION, for_each_interface_descriptor, cdc_union_descriptor::header, NULL, cdc_union_descriptor::subtype, usb_descriptor_header::type, and USB_CS_INTERFACE_DESCRIPTOR.