JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 9: DDI and DKI Properties and Data Structures     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

Data Structures for Drivers

aio_req(9S)

audio_engine_ops(9S)

blksize(9P)

buf(9S)

cb_ops(9S)

copyreq(9S)

copyresp(9S)

datab(9S)

dblk(9S)

ddi_device_acc_attr(9S)

ddi_dma_attr(9S)

ddi_dma_cookie(9S)

ddi_dmae_req(9S)

ddi_dma_lim(9S)

ddi_dma_lim_sparc(9S)

ddi_dma_lim_x86(9S)

ddi_dma_req(9S)

ddi_fm_error(9S)

ddi-forceattach(9P)

ddi_idevice_cookie(9S)

ddi-no-autodetach(9P)

ddi-no-modunload(9P)

device-blksize(9P)

device-nblocks(9P)

device-pblksize(9P)

devmap_callback_ctl(9S)

dev_ops(9S)

fmodsw(9S)

free_rtn(9S)

gld_mac_info(9S)

gld_stats(9S)

hook_nic_event(9S)

hook_pkt_event(9S)

hook_t(9S)

inquiry-device-type(9P)

inquiry-product-id(9P)

inquiry-revision-id(9P)

inquiry-serial-no(9P)

inquiry-vendor-id(9P)

iocblk(9S)

iovec(9S)

kstat(9S)

kstat_intr(9S)

kstat_io(9S)

kstat_named(9S)

linkblk(9S)

lso_basic_tcp_ipv4(9S)

mac_callbacks(9S)

mac_capab_lso(9S)

mac_capab_rings(9S)

mac_group_info(9S)

mac_register(9S)

mac_ring_info(9S)

mblk(9S)

modldrv(9S)

modlinkage(9S)

modlmisc(9S)

modlstrmod(9S)

module_info(9S)

msgb(9S)

Nblock(9P)

net_inject_t(9S)

net_instance_t(9S)

no-involuntary-power-cycles(9P)

pblksize(9P)

pm(9P)

pm-components(9P)

qband(9S)

qinit(9S)

queclass(9S)

queue(9S)

removable-media(9P)

scsi_address(9S)

scsi_arq_status(9S)

scsi_asc_key_strings(9S)

scsi_device(9S)

scsi_extended_sense(9S)

scsi_hba_tran(9S)

scsi_inquiry(9S)

scsi_pkt(9S)

scsi_status(9S)

size(9P)

sof_ops(9S)

streamtab(9S)

stroptions(9S)

tuple(9S)

uio(9S)

usb_bulk_request(9S)

usb_callback_flags(9S)

usb_cfg_descr(9S)

usb_client_dev_data(9S)

usb_completion_reason(9S)

usb_ctrl_request(9S)

usb_dev_descr(9S)

usb_dev_qlf_descr(9S)

usb_ep_descr(9S)

usb_if_descr(9S)

usb_intr_request(9S)

usb_isoc_request(9S)

usb_other_speed_cfg_descr(9S)

usb_request_attributes(9S)

usb_string_descr(9S)

usb_request_attributes

- Definition of USB request attributes

Synopsis

#include  <sys/usb/usba.h>

Interface Level

Solaris DDI specific (Solaris DDI)

Description

Request attributes specify how the USBA framework handles request execution. Request attributes are specified in the request's *_attributes field and belong to the enumerated type usb_req_attrs_t.

Supported request attributes are:

USB_ATTRS_SHORT_XFER_OK

Use this attribute when the maximum transfer size is known, but it is possible for the request to receive a smaller amount of data. This attribute tells the USBA framework to accept without error transfers which are shorter than expected.

USB_ATTRS_PIPE_RESET

Have the USB framework reset the pipe automatically if an error occurs during the transfer. Do not attempt to clear any stall. The USB_CB_RESET_PIPE callback flag is passed to the client driver's exception handler to show the pipe has been reset. Pending requests on pipes which are reset are flushed unless the pipe is the default pipe.

USB_ATTRS_AUTOCLEARING

Have the USB framework reset the pipe and clear functional stalls automatically if an error occurs during the transfer. The callback flags passed to the client driver's exception handler show the status after the attempt to clear the stall.

USB_CB_FUNCTIONAL_STALL is set in the callback flags to indicate that a functional stall occurred. USB_CB_STALL_CLEARED is also set if the stall is cleared. The default pipe never shows a functional stall if the USB_ATTRS_AUTOCLEARING attribute is set. If USB_CB_FUNCTIONAL_STALL is seen when autoclearing is enabled, the device has a fatal error.

USB_CB_PROTOCOL_STALL is set without USB_CB_STALL_CLEARED in the callback flags to indicate that a protocol stall was seen but was not explicitly cleared. Protocol stalls are cleared automatically when a subsequent command is issued.

Autoclearing a stalled default pipe is not allowed. The USB_CB_PROTOCOL_STALL callback flag is set in the callback flags to indicate the default pipe is stalled.

Autoclearing is not allowed when the request is USB_REQ_GET_STATUS on the default pipe.

USB_ATTRS_ONE_XFER

Applies only to interrupt-IN requests. Without this flag, interrupt-IN requests start periodic polling of the interrupt pipe. This flag specifies to perform only a single transfer. Do not start periodic transfers with this request.

USB_ATTRS_ISOC_START_FRAME

Applies only to isochronous requests and specifies that a request be started at a given frame number. The starting frame number is provided in the isoc_frame_no field of the usb_isoc_req_t. Please see usb_isoc_request(9S) for more information about isochronous requests.

USB_ATTRS_ISOC_START_FRAME can be used to delay a transfer by a few frames, allowing transfers to an endpoint to sync up with another source. (For example, synching up audio endpoints to a video source.) The number of a suitable starting frame in the near future can be found by adding an offset number of frames (usually between four and ten) to the current frame number returned from usb_get_current_frame_number(9F). Note that requests with starting frames which have passed are rejected.

USB_ATTRS_ISOC_XFER_ASAP

Applies only to isochronous requests and specifies that a request start as soon as possible. The host controller driver picks a starting frame number which immediately follows the last frame of the last queued request. The isoc_frame_no of the usb_isoc_req_t is ignored. Please see usb_isoc_request(9S) for more information about isochronous requests.

Examples

    /*
     * Allocate, initialize and issue a synchronous bulk-IN request.
     * Allow for short transfers.
     */

    struct buf *bp;
    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 | USB_ATTRS_SHORT_XFER_OK;

    if ((rval = usb_pipe_bulk_xfer(pipe, bulk_req, USB_FLAGS_SLEEP)) !=
        USB_SUCCESS) {
            cmn_err (CE_WARN, "%s%d: Error reading bulk data.",
                ddi_driver_name(dip), ddi_get_instance(dip));
    }

    mblk = bulk_req->bulk_data;
    bcopy(mblk->rptr, buf->b_un.b_addr, mblk->wptr - mblk->rptr);
    bp->b_resid = bp->b_count - (mblk->wptr = mblk->rptr);
    ...
    ...

    ----

    usb_pipe_handle_t handle;
    usb_frame_number_t offset = 10;
    usb_isoc_req_t *isoc_req;

    isoc_req = usb_alloc_isoc_req(...);
      ...
      ...
    isoc_req->isoc_frame_no = usb_get_current_frame_number(dip) + offset;
    isoc_req->isoc_attributes = USB_ATTRS_ISOC_START_FRAME;
      ...
      ...
    if (usb_pipe_isoc_xfer(handle, isoc_req, 0) != USB_SUCCESS) {
      ...
    }

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Architecture
PCI-based systems
Interface Stability
Committed
Availability
driver/usb, driver/usbu

See Also

usb_alloc_request(9F), usb_get_current_frame_number(9F), usb_pipe_bulk_xfer(9F), usb_pipe_ctrl_xfer(9F), usb_pipe_intr_xfer(9F), usb_pipe_isoc_xfer(9F), usb_bulk_request(9S), usb_callback_flags(9S), usb_ctrl_request(9S), usb_intr_request(9S), usb_isoc_request(9S), usb_completion_reason(9S)