Lines Matching defs:index

80 	int value, int index, char *data, int size);
85 usb_dev_handle_info_t *info, int index, int interface, int alternate);
89 static int usb_parse_config(usb_dev_handle_impl_t *hdl, uint_t index);
90 static void usb_free_config(usb_device_t *device, uint_t index);
91 static int usb_parse_interface(usb_dev_handle_impl_t *hdl, uint_t index,
93 static void usb_free_interface(usb_device_t *device, uint_t index,
95 static int usb_parse_alternate(usb_dev_handle_impl_t *hdl, uint_t index,
97 static void usb_free_alternate(usb_device_t *device, uint_t index,
99 static int usb_parse_endpoint(usb_dev_handle_impl_t *hdl, int index,
441 int value, int index, char *data, int size, int timeout)
463 requesttype, request, value, index, data, size);
678 usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf,
682 * We can't use usb_get_descriptor() because it's lacking the index
686 "usb_get_string(): index=%d langid=0x%x len=%d\n",
687 index, langid, buflen);
698 USB_REQ_GET_DESCRIPTOR, (USB_DT_STRING << 8) + index,
709 usb_get_string_simple(usb_dev_handle *dev, int index, char *buf,
715 usb_dprintf(DEBUG_FUNCTIONS, "usb_get_string_simple(): index=%d\n",
716 index);
728 * Asking for the zero'th index is special - it returns a string
735 ret = usb_get_string(dev, index, 0, tbuf, sizeof (tbuf));
746 ret = usb_get_string(dev, index, langid, tbuf, sizeof (tbuf));
787 uchar_t type, uchar_t index, void *buf, int size)
801 (type << 8) + index, 0, buf, size, 1000));
806 uchar_t index, void *buf, int size)
819 (type << 8) + index, 0, buf, size, 1000));
837 int index, iface, err;
882 /* find the conf index */
883 for (index = 0; index < hdl->device->descriptor.bNumConfigurations;
884 index++) {
886 hdl->device->config[index].bConfigurationValue) {
892 "cfg value=%d index=%d, iface=%d, alt=%d #alts=%d\n",
893 info->configuration_value, index, iface, alt,
894 hdl->device->config[index].interface[iface].num_altsetting);
897 config[index].interface[iface].num_altsetting)) {
904 usb_set_ep_iface_alts(hdl, info, index, iface, alt);
923 int index, i;
936 /* find the conf index */
937 for (index = 0; index < hdl->device->descriptor.bNumConfigurations;
938 index++) {
940 hdl->device->config[index].bConfigurationValue) {
945 if (index >= hdl->device->descriptor.bNumConfigurations) {
954 info->configuration_index = index;
979 int index = usb_ep_index(ep);
993 usb_dprintf(DEBUG_DETAILED, "index=0x%x, ep_intf=%d\n",
994 index, info->ep_interface[index]);
996 if (info->ep_interface[index] == -1) {
1033 int index;
1048 index = 0;
1050 /* find the conf index */
1051 for (index = 0;
1052 index < hdl->device->descriptor.bNumConfigurations;
1053 index++) {
1055 hdl->device->config[index].bConfigurationValue) {
1061 hdl->device->config[index].bConfigurationValue;
1062 info->configuration_index = index;
1064 usb_dprintf(DEBUG_DETAILED, "configuration_value=%d, index=%d\n",
1065 info->configuration_value, index);
1069 (interface >= hdl->device->config[index].bNumInterfaces)) {
1100 usb_set_ep_iface_alts(hdl, info, index, interface, 0);
1201 int index, char *data, int size)
1212 requesttype, request, value, index, size);
1218 req[4] = (uint8_t)index;
1219 req[5] = (uint8_t)(index >> 8);
1332 int index, int interface, int alternate)
1347 if_descr = &hdl->device->config[index].interface[interface].
1355 ep_descr = &hdl->device->config[index].interface[interface].
1383 int fd, fdstat, index, rval;
1385 index = usb_ep_index(ep);
1389 "ep=0x%x mode=%d index=%d\n", ep, mode, index);
1396 if ((index < 0) || (index > 31)) {
1402 info->claimed_interface, info->ep_interface[index]);
1404 if (info->claimed_interface != info->ep_interface[index]) {
1409 if ((info->ep_fd[index] > 0) && (info->ep_status_fd[index] > 0)) {
1450 cfg_num, info->ep_interface[index],
1522 info->ep_fd[index] = fd;
1523 info->ep_status_fd[index] = fdstat;
1531 * creates an index from endpoint address that can
1532 * be used to index into endpoint lists
1534 * Returns: ep index (a number between 0 and 31)
1681 uint_t index;
1725 for (index = 0; index < hdl->device->descriptor.bNumConfigurations;
1726 index++) {
1727 if ((rval = usb_parse_config(hdl, index)) != 0) {
1743 uint_t index;
1750 for (index = 0; index < dev->descriptor.bNumConfigurations;
1751 index++) {
1752 usb_free_config(dev, index);
1766 usb_parse_config(usb_dev_handle_impl_t *hdl, uint_t index)
1775 usb_dprintf(DEBUG_FUNCTIONS, "usb_parse_config(): index=%d\n",
1776 index);
1780 USB_REQ_GET_DESCRIPTOR, USB_DESCR_TYPE_SETUP_CFG | index,
1792 (usb_cfg_descr_t *)&hdl->device->config[index],
1804 "cfg%d: len=%d type=%d total=%d #if=%d cf=%d\n", index,
1805 hdl->device->config[index].bLength,
1806 hdl->device->config[index].bDescriptorType,
1807 hdl->device->config[index].wTotalLength,
1808 hdl->device->config[index].bNumInterfaces,
1809 hdl->device->config[index].bConfigurationValue);
1811 if ((cloud = malloc(hdl->device->config[index].wTotalLength)) ==
1820 USB_REQ_GET_DESCRIPTOR, USB_DESCR_TYPE_SETUP_CFG | index,
1822 hdl->device->config[index].wTotalLength, 0);
1824 if (rval != hdl->device->config[index].wTotalLength) {
1832 hdl->device->config[index].wTotalLength,
1833 (usb_cfg_descr_t *)&hdl->device->config[index],
1839 index, extralen);
1842 if ((hdl->device->config[index].extra =
1849 (void) memcpy(hdl->device->config[index].extra, extra,
1851 hdl->device->config[index].extralen = extralen;
1855 len = hdl->device->config[index].bNumInterfaces *
1857 if ((hdl->device->config[index].interface = calloc(len, 1)) ==
1864 for (iface = 0; iface < hdl->device->config[index].bNumInterfaces;
1866 rval = usb_parse_interface(hdl, index, iface, cloud);
1883 usb_free_config(usb_device_t *device, uint_t index)
1887 usb_dprintf(DEBUG_FUNCTIONS, "usb_free_config(): index=%d\n",
1888 index);
1890 if (device->config[index].interface) {
1891 for (iface = 0; iface < device->config[index].bNumInterfaces;
1893 usb_free_interface(device, index, iface);
1895 if (device->config[index].extralen) {
1896 free(device->config[index].extra);
1898 free(device->config[index].interface);
1909 usb_parse_interface(usb_dev_handle_impl_t *hdl, uint_t index, uint_t iface,
1919 "index=%d, iface=%d\n", index, iface);
1924 hdl->device->config[index].wTotalLength,
1944 if ((hdl->device->config[index].interface[iface].altsetting =
1949 hdl->device->config[index].interface[iface].num_altsetting =
1952 rval = usb_parse_alternate(hdl, index, iface, alt, cloud);
1969 usb_free_interface(usb_device_t *device, uint_t index, uint_t iface)
1974 "index=%d, iface=%d\n", index, iface);
1976 if (device->config[index].interface[iface].altsetting) {
1977 max_alt = device->config[index].interface[iface].
1980 usb_free_alternate(device, index, iface, alt);
1982 free(device->config[index].interface[iface].altsetting);
1993 usb_parse_alternate(usb_dev_handle_impl_t *hdl, uint_t index, uint_t iface,
2003 "index=%d, iface=%d, alt=%d\n", index, iface, alt);
2006 hdl->device->config[index].wTotalLength,
2018 " sc=%d p=%d i=%d\n", index, iface, alt,
2030 &hdl->device->config[index].interface[iface].altsetting[alt],
2035 "cfg%d.if%d.%d: extralen=%d:\n", index, iface, alt,
2039 if ((hdl->device->config[index].interface[iface].
2045 hdl->device->config[index].interface[iface].
2047 hdl->device->config[index].interface[iface].
2059 if ((hdl->device->config[index].interface[iface].altsetting[alt].
2066 rval = usb_parse_endpoint(hdl, index, iface, alt, ep, cloud);
2082 usb_free_alternate(usb_device_t *device, uint_t index, uint_t iface,
2086 "index=%d, iface=%d, alt=%d\n", index, iface, alt);
2088 if (device->config[index].interface[iface].altsetting[alt].
2092 &device->config[index].
2101 if (device->config[index].interface[iface].altsetting[alt].
2103 free(device->config[index].interface[iface].
2106 free(device->config[index].interface[iface].altsetting[alt].
2118 usb_parse_endpoint(usb_dev_handle_impl_t *hdl, int index, int iface,
2127 "index=%d, iface=%d, alt=%d, ep=0x%x\n",
2128 index, iface, alt, ep);
2131 hdl->device->config[index].wTotalLength,
2149 config[index].interface[iface].altsetting[alt].endpoint[ep],
2155 index, iface, alt, ep, extralen);
2158 if ((hdl->device->config[index].interface[iface].
2164 (void) memcpy(hdl->device->config[index].interface[iface].
2166 hdl->device->config[index].interface[iface].
2827 * the endpoint index is relative to the interface. index 0 is