.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "USB_SG_INIT" "" "06 October 2005" "" ""
.SH NAME
usb_sg_init \- initializes scatterlist-based bulk/interrupt I/O request
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
int usb_sg_init (struct usb_sg_request * \fIio\fB, struct usb_device * \fIdev\fB, unsigned \fIpipe\fB, unsigned \fIperiod\fB, struct scatterlist * \fIsg\fB, int \fInents\fB, size_t \fIlength\fB, int \fImem_flags\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIio\fB\fR
request block being initialized. until \fBusb_sg_wait\fR returns,
treat this as a pointer to an opaque block of memory,
.TP
\fB\fIdev\fB\fR
the usb device that will send or receive the data
.TP
\fB\fIpipe\fB\fR
endpoint ``pipe'' used to transfer the data
.TP
\fB\fIperiod\fB\fR
polling rate for interrupt endpoints, in frames or
(for high speed endpoints) microframes; ignored for bulk
.TP
\fB\fIsg\fB\fR
scatterlist entries
.TP
\fB\fInents\fB\fR
how many entries in the scatterlist
.TP
\fB\fIlength\fB\fR
how many bytes to send from the scatterlist, or zero to
send every byte identified in the list.
.TP
\fB\fImem_flags\fB\fR
SLAB_* flags affecting memory allocations in this call
.SH "DESCRIPTION"
.PP
Returns zero for success, else a negative errno value. 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.