Skip Navigation Links | |
Exit Print View | |
![]() |
man pages section 9: DDI and DKI Kernel Functions Oracle Solaris 10 8/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)
scsi_get_device_type_scsi_options(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)
- Get and set alternate interface values
#include <sys/usb/usba.h> int usb_get_alt_if(dev_info_t *dip, uint_t interface_number, uint_t *alternate_number, usb_flags_t flags);
int usb_set_alt_if(dev_info_t *dip, uint_t interface_number, uint_t *alternate_number, usb_flags_t flags, void (*callback)(usb_pipe_handle_t pipe_handle, usb_opaque_t callback_arg, int rval, usb_cb_flags_t flags), usb_opaque_t callback_arg);
int usb_get_if_number(dev_info_t *dip);
boolean_t usb_owns_device(dev_info_t *dip);
Solaris DDI specific (Solaris DDI)
For usb_get_alt_if():
Pointer to device's dev_info structure.
Interface of the desired alternate.
Address where current alternate setting is returned.
No flags are recognized. Reserved for future expansion.
For usb_set_alt_if():
Pointer to device's dev_info structure.
Interface of the desired alternate.
Alternate interface number to be set.
Only USB_FLAGS_SLEEP is recognized. Wait for completion and do not call callback.
Callback handler to notify of asynchronous completion.
Second argument passed to callback handler.
For usb_get_if_number():
Pointer to device's dev_info structure.
For usb_owns_device():
Pointer to device's dev_info structure.
USB devices can have multiple configurations, each with many interfaces. Within interfaces are alternate settings, and within alternate settings are endpoints.
Each interface within a configuration may be represented by the kernel as a device node. Only one set of device nodes (interfaces as determined by the configuration) can be active at one time.
Alternates to an interface represent different ways the kernel sees a device node. Only one alternate setting within an interface can be active (or selected) at one time. The functions presented in this manpage get or set interface or alternate setting information.
The usb_get_alt_if() function requests the device to return the current alternate setting of the given interface. This function ignores the flags argument and always blocks.
The usb_set_alt_if() function requests the device to set the interface and its alternate setting as specified. Because this call changes the current device's interface and sets the new interface's mode of operation as seen by the system, the driver must insure that all pipes other than the default control pipe are closed and quiescent. To avoid contending with another driver for a different part of the device, the driver must be bound to the entire device.
If USB_FLAGS_SLEEP is set in flags, usb_set_alt_if() blocks until completed. Otherwise, usb_set_alt_if() returns immediately and calls the callback handler when completed.
callback is the asynchronous callback handler and takes the following arguments:
Handle of the default control pipe used to perform the request.
Callback_arg specified to usb_set_alt_if().
Request status.
Status of the queueing operation. Can be:
USB_CB_NO_INFO - Callback was uneventful.
USB_CB_ASYNC_REQ_FAILED - Error queueing request.
USB_CB_NO_RESOURCES - Error allocating resources.
The usb_get_if_number() function returns the interface number, or USB_COMBINED_NODE or USB_DEVICE_NODE node indicating that the driver is bound to the entire device. (See Return Values below.)
The usb_owns_device() function returns B_TRUE if the driver of the dip argument owns the entire device, or B_FALSE if it owns just a particular interface.
For usb_get_alt_if():
Interface's alternate setting was successfully obtained.
Pointer to alternate_number and/or dip are NULL.
Called from interrupt context.
The interface number is invalid.
An access error occurred.
For usb_set_alt_if():
Alternate interface was successfully set.
dip is NULL. USB_FLAGS_SLEEP is clear and callback is NULL.
dip does not own the interface to be set.
Called from interrupt context with USB_FLAGS_SLEEP specified.
Pipe handle is NULL, invalid, or refers to a pipe that is closing or closed.
The interface number and/or alternate setting are invalid.
Pipes were open.
An access error occurred.
For usb_get_if_number():
USB_COMBINED_NODE if the driver is responsible for the entire active device configuration. The dip doesn't correspond to an entire physical device.
USB_DEVICE_NODE if the driver is responsible for the entire device. The dip corresponds to an entire physical device.
interface number: otherwise.
For usb_owns_device():
Driver of the dip argument owns the entire device.
Driver of the dip argument owns only the current interface.
The usb_get_if_number() and usb_owns_device() functions may be called from user or kernel context.
The usb_set_alt_if() function may always be called from user or kernel context. It may be called from interrupt context only if USB_FLAGS_SLEEP is not set in flags. If the USB_CB_ASYNC_REQ_FAILED bit is clear in usb_cb_flags_t, the callback, if supplied, can block because it is executing in kernel context. Otherwise the callback cannot block. Please see usb_callback_flags(9S) for more information on callbacks.
The usb_get_alt_if() function may be called from user or kernel context.
/* Change alternate setting of interface 0. Wait for completion. */ if (usb_set_alt_if( dip, 0, new_alternate_setting_num, USB_FLAGS_SLEEP, NULL, 0) != USB_SUCCESS) { cmn_err (CE_WARN, "%s%d: Error setting alternate setting on pipe", ddi_driver_name(dip), ddi_get_instance(dip)); } }
See attributes(5) for descriptions of the following attributes:
|
attributes(5), usb_pipe_ctrl_xfer(9F), usb_get_dev_data(9F), usb_get_string_descr(9F), usb_get_cfg(9F)