'\" t .\" Title: usb_sg_init .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: USB Core APIs .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "USB_SG_INIT" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "USB Core APIs" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" usb_sg_init \- initializes scatterlist\-based bulk/interrupt I/O request .SH "SYNOPSIS" .HP \w'int\ usb_sg_init('u .BI "int usb_sg_init(struct\ usb_sg_request\ *\ " "io" ", struct\ usb_device\ *\ " "dev" ", unsigned\ " "pipe" ", unsigned\ " "period" ", struct\ scatterlist\ *\ " "sg" ", int\ " "nents" ", size_t\ " "length" ", gfp_t\ " "mem_flags" ");" .SH "ARGUMENTS" .PP \fIio\fR .RS 4 request block being initialized\&. until \fBusb_sg_wait\fR returns, treat this as a pointer to an opaque block of memory, .RE .PP \fIdev\fR .RS 4 the usb device that will send or receive the data .RE .PP \fIpipe\fR .RS 4 endpoint \(lqpipe\(rq used to transfer the data .RE .PP \fIperiod\fR .RS 4 polling rate for interrupt endpoints, in frames or (for high speed endpoints) microframes; ignored for bulk .RE .PP \fIsg\fR .RS 4 scatterlist entries .RE .PP \fInents\fR .RS 4 how many entries in the scatterlist .RE .PP \fIlength\fR .RS 4 how many bytes to send from the scatterlist, or zero to send every byte identified in the list\&. .RE .PP \fImem_flags\fR .RS 4 SLAB_* flags affecting memory allocations in this call .RE .SH "DESCRIPTION" .PP This initializes a scatter/gather request, allocating resources such as I/O mappings and urb memory (except maybe memory used by USB controller drivers)\&. .PP The request must be issued using \fBusb_sg_wait\fR, which waits for the I/O to complete (or to be canceled) and then cleans up all resources allocated by \fBusb_sg_init\fR\&. .PP The request may be canceled with \fBusb_sg_cancel\fR, either before or after \fBusb_sg_wait\fR is called\&. .SH "RETURN" .PP Zero for success, else a negative errno value\&. .SH "COPYRIGHT" .br