---
name: "config_ep_by_speed"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/config_ep_by_speed"
---

# config\_ep\_by\_speed(9)

configures the given endpoint according to gadget speed.

## NAME

config\_ep\_by\_speed - configures the given endpoint according to gadget speed.

## SYNOPSIS

**int config\_ep\_by\_speed(struct usb\_gadget \*** *g***, struct usb\_function \*** *f***, struct usb\_ep \*** *\_ep***);**

## ARGUMENTS

*g*

pointer to the gadget

*f*

usb function

*\_ep*

the endpoint to configure

## RETURN

error code, 0 on success

This function chooses the right descriptors for a given endpoint according to gadget speed and saves it in the endpoint desc field. If the endpoint already has a descriptor assigned to it - overwrites it with currently corresponding descriptor. The endpoint maxpacket field is updated according to the chosen descriptor.

## NOTE

the supplied function should hold all the descriptors for supported speeds

## AUTHOR

**David Brownell** \<dbrownell@users.sourceforge.net\>

Author.

## COPYRIGHT
