Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
#include <sys/usb/usba.h> int usb_pipe_bulk_xfer(usb_pipe_handle_t pipe_handle, usb_bulk_req_t *request, usb_flags_t flags);
Bulk pipe handle on which request is made.
Pointer to bulk transfer request.
USB_FLAGS_SLEEP is the only flag recognized. Wait for request to complete.
Requests for bulk transfers must have mblks attached to store data. Allocate an mblk for data when a request is allocated via usb_alloc_bulk_req(9F) by passing a non-negative value for the len argument.
Transfer was successful.
Request is NULL.
Called from interrupt context with the USB_FLAGS_SLEEP flag set.
The request has been freed or otherwise invalidated. A set of conflicting attributes were specified. See usb_bulk_request(9S). The normal and/or exception callback was NULL and USB_FLAGS_SLEEP was not set. Data space is not provided to a non-zero length bulk request:
(bulk_data == NULL and bulk_len != 0)
Pipe handle is NULL or invalid. Pipe is closing or closed.
Pipe handle refers to a pipe which is in the USB_PIPE_STATE_ERROR state.
Memory, descriptors or other resources are unavailable.
Host controller is in error state.
An asynchronous transfer failed or an internal error occurred. A bulk request requested too much data:
(length > usb_get_max_bulk_xfer size())The pipe is in a unsuitable state (error, busy, not ready).
Additional status information may be available in the bulk_completion_reason and bulk_cb_flags fields of the request. Please see usb_completion_reason(9S) and usb_callback_flags(9S) for more information.
/* Allocate, initialize and issue a synchronous bulk request. */ usb_bulk_req_t bulk_req; mblk_t *mblk; bulk_req = usb_alloc_bulk_req(dip, bp->b_bcount, USB_FLAGS_SLEEP); bulk_req->bulk_attributes = USB_ATTRS_AUTOCLEARING; mblk = bulk_req->bulk_data; bcopy(buffer, mblk->b_wptr, bp->b_bcount); mblk->b_wptr += bp->b_bcount; if ((rval = usb_pipe_bulk_xfer(pipe, bulk_req, USB_FLAGS_SLEEP)) != USB_SUCCESS) { cmn_err (CE_WARN, "%s%d: Error writing bulk data.", ddi_driver_name(dip), ddi_get_instance(dip)); }
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Architecture PCI-based systems |
Interface stability Committed |