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)
- Tokenize and align the bytes of raw variable-format data
#include <sys/usb/usba.h> size_t usb_parse_data(char *format, uchar_t *data, size_t datalen, void *structure, size_t structlen);
Solaris DDI specific (Solaris DDI)
Null terminated string describing the format of the data structure for general-purpose byte swapping. The letters “c,” “s,” “l,” and “L” represent 1, 2, 4 and 8 byte quantities, respectively. A descriptor that consists of a short and two bytes would be described by “scc.” A number preceding a letter serves as a multiplier of that letter. A format equivalent to “scc” is “s2c.”
Raw descriptor data to parse.
Length, in bytes, of the raw descriptor data buffer.
Destination data buffer where parsed data is returned.
Length, in bytes, of the destination data buffer. Parsed result length will not exceed this value.
The usb_parse_data function parses data such as a variable-format class- or vendor-specific descriptor. The function also tokenizes and aligns the bytes of raw descriptor data into fields of a variable-format descriptor.
While the USBA framework can parse the endpoint, interface, configuration, and string descriptors defined by the USB 2.0 specification, the format of class- or vendor-specific descriptors cannot be explicitly defined by the specification and will be unique for each. The format argument defines how to parse such a descriptor.
While the USB specification defines bit ordering as little-endian, this routine (like the entire API), converts the data to the endianness of the host.
The structlen parameter defines the size of the destination data buffer. Data is truncated to this size if the destination data buffer is too small.
On success: Returns the size (in bytes) of the parsed data result.
On failure: Returns 0. (Same as USB_PARSE_ERROR).
May be called from user, kernel or interrupt context.
/* * Parse raw descriptor data in buf, putting result into ret_descr. * ret_buf_len holds the size of ret_descr buf; routine returns * number of resulting bytes. * * Descriptor being parsed has 2 chars, followed by one short, * 3 chars and one more short. */ size_t size_of_returned_descr; xxx_descr_t ret_descr; size_of_returned_descr = usb_parse_data("ccscccs", buf, sizeof(buf), (void *)ret_descr, (sizeof)xxx_descr_t)); if (size_of_returned_descr < (sizeof (xxx_descr_t))) { /* Data truncated. */ } or: size_of_returned_descr = usb_parse_data("2cs3cs", buf, sizeof(buf), (void *)ret_descr, (sizeof)xxx_descr_t)); if (size_of_returned_descr < (sizeof (xxx_descr_t))) { /* Data truncated. */ }
See attributes(5) for descriptions of the following attributes:
|
attributes(5), usb_get_dev_data(9F), usb_get_string_descr(9F), usb_get_cfg(9F)