Skip Navigation Links | |
Exit Print View | |
man pages section 9: DDI and DKI Kernel Functions Oracle Solaris 11.1 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)
- Get and set current USB device configuration
#include <sys/usb/usba.h> int usb_get_cfg(dev_info_t *dip, uint_t cfgval, usb_flags_t flags);
int usb_set_cfg(dev_info_t *dip, uint_t cfg_index, 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);
Solaris DDI specific (Solaris DDI)
For usb_get_cfg():
Pointer to device's dev_info structure.
Pointer to returned configuration value.
Not used. Always waits for completion.
For usb_set_cfg():
Pointer to device's dev_info structure.
Desired device configuration index. Set to USB_DEV_DEFAULT_CONFIG_INDEX to restore default configuration.
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.
The usb_get_cfg() function retrieves the current configuration. It ignores the flags argument and always blocks while contacting the device.
The usb_set_cfg() function sets a new configuration. Because this call changes the device's mode of operation, the device must be quiescent and have all pipes, with the exception of the default control pipe, closed. The driver must have control over the entire device and cannot own just a single interface on a composite device. Additionally, its device node must not be a parent to other device nodes that can be operated by other drivers. The driver must own the device exclusively, otherwise drivers managing other parts of the device would be affected without their knowledge or control.
This call updates all internal USBA framework data structures, whereas issuing a raw USB_REQ_SET_CFG device request does not. The usb_set_cfg() function is the only supported programmatic way to change device configuration.
This call blocks if USB_FLAGS_SLEEP is set in flags. It returns immediately and calls the callback on completion if USB_FLAGS_SLEEP is not set.
For usb_get_cfg():
New configuration is retrieved.
cfgval or dip is NULL.
Configuration cannot be retrieved.
For usb_set_cfg():
New configuration is set.
dip is NULL.
USB_FLAGS_SLEEP is clear and callback is NULL.
Called from interrupt context with USB_FLAGS_SLEEP specified.
Caller does not own entire device or device is a parent to child devices.
One or more pipes other than the default control pipe are open on the device.
Pipe handle is NULL or invalid, or pipe is closing or closed.
An illegal configuration is specified.
One or more pipes other than the default control pipe are open on the device.
The usb_get_cfg() function may be called from user or kernel context.
The usb_set_cfg() function may be called from user or kernel context always. 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.
Setting the configuration to the one at index 1 (in the array of usb_cfg_data_t configuration nodes as returned by usb_get_dev_data()), and verifying what the configuration is at that index. (See usb_get_dev_data(9F)). uint_t cfg_index = 1; /* * Assume all pipes other than the default control pipe * are closed and make sure all requests to the default * control pipe have completed. / */ if (usb_set_cfg(dip, cfg_index, USB_FLAGS_SLEEP, NULL, 0) != USB_SUCCESS) { cmn_err (CE_WARN, "%s%d: Error setting USB device to configuration #%d", ddi_driver_name(dip), ddi_get_instance(dip), cfg_index); } if (usb_get_cfg(dip, &bConfigurationValue, 0) == USB_SUCCESS) { cmn_err (CE_WARN, "%s%d: USB device active configuration is %d", ddi_driver_name(dip), ddi_get_instance(dip), bConfigurationValue); } else { ... ... }
See attributes(5) for descriptions of the following attributes:
|
attributes(5), usb_get_alt_if(9F), usb_get_dev_data(9F), usb_get_string_descr(9F), usb_pipe_open(9F), usb_callback_flags(9S), usb_cfg_descr(9S), usb_ep_descr(9S), usb_if_descr(9S)