Print this page
5832 EOF wireless usb (aka UWB)
Reviewed by: TBD
Reviewed by: TBD
Approved by: TBD
@@ -19,10 +19,12 @@
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2014 Garrett D'Amore <garrett@damore.org>
*/
/*
* USBA: Solaris USB Architecture support
*
@@ -110,18 +112,16 @@
uint_t usbai_register_errlevel = USB_LOG_L2;
uint_t usbai_register_dump_errlevel = USB_LOG_L2;
uint_t usbai_register_errmask = (uint_t)-1;
/* Function prototypes */
-static int usba_build_bos(usba_device_t *, usb_client_dev_data_t *);
static int usba_build_descr_tree(dev_info_t *, usba_device_t *,
usb_client_dev_data_t *);
static void usba_process_cfg_descr(usba_reg_state_t *);
static int usba_process_if_descr(usba_reg_state_t *, boolean_t *);
static int usba_process_ep_descr(usba_reg_state_t *);
static int usba_process_cv_descr(usba_reg_state_t *);
-static int usba_process_ep_comp_descr(usba_reg_state_t *);
static int usba_set_parse_values(dev_info_t *dip, usba_device_t *usba_device,
usba_reg_state_t *state);
static void* usba_kmem_realloc(void *, int, int);
static void usba_augment_array(void **, uint_t, uint_t);
static void usba_make_alts_sparse(usb_alt_if_data_t **, uint_t *);
@@ -425,20 +425,10 @@
kmem_free(usb_reg, sizeof (usb_client_dev_data_t));
return (USB_FAILURE);
}
- /* get parsed bos for wusb device */
- if (usba_device->usb_is_wireless) {
- if ((rval = usba_build_bos(usba_device, usb_reg)) !=
- USB_SUCCESS) {
- kmem_free(usb_reg, sizeof (usb_client_dev_data_t));
-
- return (rval);
- }
- }
-
usb_reg->dev_iblock_cookie = usba_hcdi_get_hcdi(
usba_device->usb_root_hub_dip)->hcdi_soft_iblock_cookie;
USB_DPRINTF_L4(DPRINT_MASK_REGISTER, usbai_reg_log_handle,
"cookie = 0x%p", (void *)usb_reg->dev_iblock_cookie);
@@ -593,14 +583,10 @@
/* Free config tree under reg->dev_cfg. */
if (reg->dev_cfg != NULL) {
usb_free_descr_tree(dip, reg);
}
- if (reg->dev_bos != NULL) {
- kmem_free(reg->dev_bos, sizeof (usb_bos_data_t));
- }
-
mutex_enter(&usba_device->usb_mutex);
prev = &usba_device->usb_client_dev_data_list;
entry = usba_device->usb_client_dev_data_list.cddl_next;
/* free the entries in usb_client_data_list */
@@ -645,44 +631,10 @@
USB_DPRINTF_L4(DPRINT_MASK_REGISTER, usbai_reg_log_handle,
"usb_free_dev_data done");
}
/*
- * This builds the BOS descriptors for WUSB device
- */
-static int
-usba_build_bos(usba_device_t *usba_device, usb_client_dev_data_t *usb_reg)
-{
- uint8_t *buf;
- size_t size, buflen;
-
- buf = usba_device->usb_wireless_data->wusb_bos;
- buflen = usba_device->usb_wireless_data->wusb_bos_length;
-
- usb_reg->dev_bos = kmem_zalloc(sizeof (usb_bos_data_t),
- KM_SLEEP);
- size = usb_parse_bos_descr(buf, buflen, &usb_reg->dev_bos->bos_descr,
- sizeof (usb_bos_descr_t));
- if (size != USB_BOS_DESCR_SIZE) {
- kmem_free(usb_reg->dev_bos, sizeof (usb_bos_data_t));
-
- return (USB_FAILURE);
- }
-
- size = usb_parse_uwb_bos_descr(buf, buflen,
- &usb_reg->dev_bos->bos_uwb_cap, sizeof (usb_uwb_cap_descr_t));
- if (size != USB_UWB_CAP_DESCR_SIZE) {
- kmem_free(usb_reg->dev_bos, sizeof (usb_bos_data_t));
-
- return (USB_FAILURE);
- }
-
- return (USB_SUCCESS);
-}
-
-
-/*
* usba_build_descr_tree:
* This builds the descriptor tree. See module header comment for tree
* description.
*
* Arguments:
@@ -845,22 +797,10 @@
state.st_last_processed_descr_type =
USB_DESCR_TYPE_EP;
}
break;
- case USB_DESCR_TYPE_WIRELESS_EP_COMP:
- /* for WUSB devices */
- if (process_this_if_tree &&
- state.st_build_ep_comp) {
- if (usba_process_ep_comp_descr(
- &state) != USB_SUCCESS) {
-
- return (USB_FAILURE);
- }
- }
-
- break;
case USB_DESCR_TYPE_STRING:
USB_DPRINTF_L2(DPRINT_MASK_ALL,
usbai_reg_log_handle,
"usb_get_dev_data: "
"Found unexpected str descr at addr 0x%p",
@@ -1105,34 +1045,10 @@
return (USB_SUCCESS);
}
-static int
-usba_process_ep_comp_descr(usba_reg_state_t *state)
-{
- USB_DPRINTF_L4(DPRINT_MASK_REGISTER, usbai_reg_log_handle,
- "usba_process_ep_comp_descr starting");
-
- /* No endpoint descr preceeds this descr */
- if (state->st_curr_ep == NULL) {
- USB_DPRINTF_L2(DPRINT_MASK_REGISTER, usbai_reg_log_handle,
- "usba_process_ep_comp_descr: no endpt before the descr");
-
- return (USB_FAILURE);
- }
-
- (void) usb_parse_data("ccccsscc", state->st_curr_raw_descr,
- state->st_curr_raw_descr_len,
- &state->st_curr_ep->ep_comp_descr,
- sizeof (usb_ep_comp_descr_t));
- USB_DPRINTF_L4(DPRINT_MASK_REGISTER, usbai_reg_log_handle,
- "usba_process_ep_comp_descr done");
-
- return (USB_SUCCESS);
-}
-
/*
* usba_process_cv_descr:
* This processes a raw endpoint descriptor, and sets up an analogous
* endpoint descriptor in the descriptor tree. C/Vs are associated with
* other descriptors they follow in the raw data.
@@ -1225,11 +1141,10 @@
usba_reg_state_t *state)
{
/* Default to *all* in case configuration# prop not set. */
mutex_enter(&usba_device->usb_mutex);
state->st_cfg_to_build = usba_device->usb_active_cfg_ndx;
- state->st_build_ep_comp = usba_device->usb_is_wireless;
mutex_exit(&usba_device->usb_mutex);
if (state->st_cfg_to_build == USBA_DEV_CONFIG_INDEX_UNDEFINED) {
state->st_cfg_to_build = USBA_ALL;
}
state->st_if_to_build = usb_get_if_number(dip);