---
name: "usb_ep_alloc_buffer"
section: "9"
platform: "linux"
package: "linux-manual-2.6.18"
version: "2.6.18.dfsg.1-26etch2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/usb_ep_alloc_buffer"
---

# usb\_ep\_alloc\_buffer(9)

allocate an I/O buffer

## NAME

usb\_ep\_alloc\_buffer - allocate an I/O buffer

## SYNOPSIS

**void \* usb\_ep\_alloc\_buffer(struct usb\_ep \*** *ep***, unsigned** *len***, dma\_addr\_t \*** *dma***, gfp\_t** *gfp\_flags***);**

## ARGUMENTS

*ep*

the endpoint associated with the buffer

*len*

length of the desired buffer

*dma*

pointer to the buffer's DMA address; must be valid

*gfp\_flags*

GFP\_\* flags to use

## DESCRIPTION

Returns a new buffer, or null if one could not be allocated. The buffer is suitably aligned for dma, if that endpoint uses DMA, and the caller won't have to care about dma-inconsistency or any hidden “bounce buffer” mechanism. No additional per-request DMA mapping will be required for such buffers. Free it later with **usb\_ep\_free\_buffer**.

You don't need to use this call to allocate I/O buffers unless you want to make sure drivers don't incur costs for such “bounce buffer” copies or per-request DMA mappings.

## AUTHOR

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

-

  Author.

## COPYRIGHT
