Skip Navigation Links | |
Exit Print View | |
man pages section 9: DDI and DKI Kernel Functions Oracle Solaris 11 Information Library |
csx_AccessConfigurationRegister(9F)
csx_Parse_CISTPL_BYTEORDER(9F)
csx_Parse_CISTPL_CFTABLE_ENTRY(9F)
csx_Parse_CISTPL_DEVICEGEO(9F)
csx_Parse_CISTPL_DEVICEGEO_A(9F)
csx_Parse_CISTPL_DEVICE_OA(9F)
csx_Parse_CISTPL_DEVICE_OC(9F)
csx_Parse_CISTPL_LINKTARGET(9F)
csx_Parse_CISTPL_LONGLINK_A(9F)
csx_Parse_CISTPL_LONGLINK_C(9F)
csx_Parse_CISTPL_LONGLINK_MFC(9F)
ddi_get_soft_iblock_cookie(9F)
ddi_intr_get_supported_types(9F)
ddi_prop_lookup_byte_array(9F)
ddi_prop_lookup_int64_array(9F)
ddi_prop_lookup_string_array(9F)
ddi_prop_update_byte_array(9F)
ddi_prop_update_int64_array(9F)
ddi_prop_update_string_array(9F)
ldi_prop_lookup_byte_array(9F)
ldi_prop_lookup_int64_array(9F)
ldi_prop_lookup_string_array(9F)
mac_prop_info_set_default_link_flowctrl(9F)
mac_prop_info_set_default_str(9F)
mac_prop_info_set_default_uint8(9F)
mac_prop_info_set_range_uint32(9F)
net_event_notify_unregister(9F)
net_instance_notify_register(9F)
net_instance_notify_unregister(9F)
net_instance_protocol_unregister(9F)
net_protocol_notify_register(9F)
nvlist_lookup_boolean_array(9F)
nvlist_lookup_boolean_value(9F)
nvlist_lookup_nvlist_array(9F)
nvlist_lookup_string_array(9F)
nvlist_lookup_uint16_array(9F)
nvlist_lookup_uint32_array(9F)
nvlist_lookup_uint64_array(9F)
nvpair_value_boolean_array(9F)
pci_plist_lookup_int16_array(9F)
pci_plist_lookup_int32_array(9F)
pci_plist_lookup_int64_array(9F)
pci_plist_lookup_int8_array(9F)
pci_plist_lookup_string_array(9F)
pci_plist_lookup_uint16_array(9F)
pci_plist_lookup_uint32_array(9F)
pci_plist_lookup_uint64_array(9F)
pci_plist_lookup_uint8_array(9F)
scsi_get_device_type_scsi_options(9F)
scsi_get_device_type_string(9F)
scsi_sense_cmdspecific_uint64(9F)
usb_get_current_frame_number(9F)
usb_get_max_pkts_per_isoc_request(9F)
usb_pipe_get_max_bulk_transfer_size(9F)
usb_pipe_stop_intr_polling(9F)
usb_pipe_stop_isoc_polling(9F)
- Allocate and free USB transfer requests
#include <sys/usb/usba.h> usb_ctrl_req_t *usb_alloc_ctrl_req(dev_info_t *dip, size_t len, usb_flags_t flags);
void usb_free_ctrl_req(usb_ctrl_req_t *request);
usb_bulk_req_t *usb_alloc_bulk_req(dev_info_t dip, size_t len, usb_flags_t flags);
void usb_free_bulk_req(usb_bulk_req_t *request);
usb_intr_req_t *usb_alloc_intr_req(dev_info_t *dip, size_t len, usb_flags_t flags);
void usb_free_intr_req(usb_intr_req_t *request);
usb_isoc_req_t *usb_alloc_isoc_req(dev_info_t *dip, uint_t isoc_pkts_count, size_t len, usb_flags_t flags);
void usb_free_isoc_req(usb_isoc_req_t *request);
Solaris DDI specific (Solaris DDI)
For usb_alloc_ctrl_req(), usb_alloc_bulk_req() and usb_alloc_intr_req():
Pointer to the device's dev_info structure.
Length of data for this request.
Only USB_FLAGS_SLEEP is recognized. Wait for resources if not immediately available.
For usb_alloc_isoc_req():
Pointer to the device's dev_info structure.
Number of isochronous packet descriptors to associate with this request. Must be greater than zero.
Length of data for this isochronous request.
Only USB_FLAGS_SLEEP is recognized. Wait for resources if not immediately available.
For usb_free_ctrl_req(), usb_free_bulk_req(), usb_free_intr_req() and usb_free_isoc_req():
Pointer to the request structure to be freed. Can be NULL.
The usb_alloc_ctrl_req(), usb_alloc_bulk_req(), usb_alloc_intr_req(), and usb_alloc_isoc_req() functions allocate control, bulk, interrupt, or isochronous requests. Optionally, these functions can also allocate an mblk of the specified length to pass data associated with the request. (For guidelines on mblk data allocation, see the manpage for the relevant transfer function).
The usb_alloc_isoc_req() function also allocates a number of isochronous packet descriptors (usb_isoc_pkt_descr_t) specified by isoc_pkts_count to the end of the request proper (usb_isoc_req_t). See usb_isoc_request(9S) for more information on isochronous packet descriptors.
These functions always succeed when the USB_FLAGS_SLEEP flag is set, provided that they are given valid args and are not called from interrupt context.
The usb_free_ctrl_req(), usb_free_bulk_req(), usb_free_intr_req(), and usb_free_isoc_req() functions free their corresponding request. If the request's data block pointer is non-zero, the data block is also freed. For isoc requests, the array of packet descriptors is freed.
For usb_alloc_ctrl_req(), usb_alloc_bulk_req(), usb_alloc_intr_req() and usb_alloc_isoc_req():
On success: returns a pointer to the appropriate usb_xxx_request_t.
On failure: returns NULL. Fails because the dip argument is invalid, USB_FLAGS_SLEEP is not set and memory is not available or because USB_FLAGS_SLEEP is set but the call was made in interrupt context.
For usb_free_ctrl_req(), usb_free_bulk_req(), usb_free_intr_req() and usb_free_isoc_req(): None.
The allocation routines can always be called from kernel and user context. They may be called from interrupt context only if USB_FLAGS_SLEEP is not specified.
The free routines may be called from kernel, user, and interrupt context.
/* This allocates and initializes an asynchronous control * request which will pass no data. Asynchronous requests * are used when they cannot block the calling thread. */ usb_ctrl_req_t *ctrl_req; if ((ctrl_req = usb_alloc_ctrl_req(dip, 0, 0)) == NULL) { return (FAILURE); } /* Now initialize. */ ctrl_req->ctrl_bmRequestType = USB_DEV_REQ_DEV_TO_HOST | USB_DEV_REQ_STANDARD | USB_DEV_REQ_RCPT_DEV; ctrl_req->ctrl_bRequest = (uint8_t)USB_REQ_GET_STATUS; ... ... ctrl_req->ctrl_callback = normal_callback; ctrl_req->ctrl_exc_callback = exception_callback; ... ...
See attributes(5) for descriptions of the following attributes:
|
attributes(5), usb_get_current_frame_number(9F), usb_get_max_pkts_per_isoc_request(9F), usb_pipe_get_max_bulk_transfer_size(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_ctrl_request(9S), usb_intr_request(9S), usb_isoc_request(9S)