2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A/* Global Definition */ 2N/A/* Static Definition */ 2N/A/* Topo pluggin enum entry */ 2N/A/* Topo pluggin enum ops struct */ 2N/A /* LINTED E_BAD_PTR_CAST_ALIGN */ 2N/A * Get uint property from di_node_t 2N/A * Add a host controller to the global list. 2N/A /* search for the most recent PCI bridge upward */ 2N/A /* append the host controller to the global list */ 2N/A * Use BDF information to find the corresponding HC in host controller list. 2N/A * Traverse the ue_devs list. ue_devs is the header 2N/A * node, search starts from the next 2N/A * Callback entry for di_walk_node 2N/A * If the node is a USB host controllers, put it onto 2N/A * the host controller list. 2N/A * To collect all the host controllers in the system 2N/A /* Get the devinfo tree */ 2N/A "topo_mod_devinfo() failed");
2N/A /* walk the devinfo snapshot looking for host controller nodes */ 2N/A * Use the parent's FRU as the FRU of host controllers enumerated from PCI 2N/A * When USB is enumerated from a Map file or x86pi, USB enumerator 2N/A * will create 'usb-bus' topo nodes for all the host controllers that 2N/A * have no PCI('pcifn' or 'pciexfn') nodes. 2N/A "can't find the parent FMRI");
2N/A /* Enumerated from the host controller we gathered */ 2N/A /* If it was enumerated from PCI before, skip to next */ 2N/A "usb_process_host_controllers: %s enumed before" 2N/A * we will not use device instance number here, because 2N/A * different host controller may have the same instance #. 2N/A /* Set it as enumerated */ 2N/A /* create node range for devices under the root hub */ 2N/A " can't create range");
2N/A /* Also create node range for hubs under root hub */ 2N/A " can't create range");
2N/A /* walk and instantiate each child node of the root hub */ 2N/A " fail to instantiate children");
2N/A * Create necessary information for a host controller which is enumerated 2N/A * by PCI enumerator. Also create topology nodes for all the devices connected 2N/A * to this controller. 2N/A "can't find the parent FMRI");
2N/A /* Parent topo_node need provide di_node from its specific data */ 2N/A "Parent %s node missing private data.\n" 2N/A "Unable to proceed with %s enumeration.",
2N/A * The 'usb-bus' node was ever created to represent 'roothub'. However, 2N/A * cause mess for diagnosis engine. To avoid such confusion, the 2N/A * 'usb-bus' node is no longer created for the devices which are 2N/A * enumerated from PCI parent. 2N/A * To avoid PCI, map file or x86pi enumerating the same host controller, 2N/A * we first check to see if other enumerator has processed this HC. If 2N/A * not, we'll process it and mark it as enumerated. 2N/A "fail to search host node for %s",
2N/A * Check if HC has children device. If so, enumerate the children 2N/A * to generate the topo nodes. 2N/A /* create node range for devices under the root hub */ 2N/A " can't create range");
2N/A /* Also create node range for hubs under root hub */ 2N/A " can't create range");
2N/A /* walk and instantiate each child node of the root hub */ 2N/A " fail to instantiate children");
2N/A * USB topo enum entry 2N/A * Check to make sure we're being invoked sensibly, and that we're not 2N/A * being invoked as part of a post-processing step. 2N/A * Normally, USB enumeration starts from parent PCI enumerator or from 2N/A * Maps. But, there are cases where the system has both on-chip(built 2N/A * in southbridge) USB host controllers and non-on-chip pci USB hosts. 2N/A * In this case, some of the host controllers will be enumerated by 2N/A * the parent PCI nodes, while others need to be enumerated by XML(from 2N/A /* Enum from hostbridge, all HCs enumerated together */ 2N/A /* Enum from PCI, here only one HC enumerated each time */ 2N/A * Traverse the ue_devs list. ue_devs is the header 2N/A * node, search starts from the next 2N/A * Turn on module debugging output 2N/A "%s registration failed: %s",
2N/A * Gather all host controllers in system 2N/A /* Avoid duplicate mem free */ 2N/A * Get Part value in HC scheme 2N/A * Part is composed of Pid-Vid value pair 2N/A "get_usb_vpid: root-hub");
2N/A "get_usb_vpid: can't get host vid: %s\n");
2N/A "get_usb_vpid: can't get host pid\n");
2N/A "get_usb_vpid: fail to get vid: %s\n");
2N/A "usb-product-id", &
pid) < 0) {
2N/A "get_usb_vpid: fail to get pid\n");
2N/A "get_usb_vpid: fail to get vid: %s\n");
2N/A "get_usb_vpid: fail to get pid\n");
2N/A "get_usb_vpid: fail to get vid: %s\n");
2N/A "get_usb_vpid: fail to get pid\n");
2N/A * Get serial no from usb-vendor-id 2N/A "usb-serialno", &s);
2N/A "Unable to make nvlist for %s bind.%s\n",
name,
2N/A /* Bind the fmri to topo_node */ 2N/A "topo_node_bind (%s%d/%s%d) failed for %s: %s\n",
2N/A "usb_set_asru: fail to create dev scheme for %s: %s\n",
2N/A "usb_set_asru: fail to set ASRU for %s\n",
devpath);
2N/A * if the dnode is bound to an interface, we have to find 2N/A * its parent device. The parent device can be set as FRU. 2N/A /* Only device node has "vendor-id" property */ 2N/A * some of the properties can only be retrieved from PROM, 2N/A * specifically on SPARC provided by OBP. 2N/A /* LINTED E_BAD_PTR_CAST_ALIGN */ 2N/A * set properties of a tnode 2N/A * tn - the topology node 2N/A * dn - the corresponding device node 2N/A "usb_populate_prop: fail to create io pgroup: %s\n",
2N/A "usb_populate_prop: fail to create usb pgroup: %s\n",
2N/A "usb_populate_prop: root-hub \n");
2N/A /* if this is an interface node, do not try to get vid/pid */ 2N/A * these properties are not present on SPARC 2N/A * and may be optional on X86 2N/A "usb_populate_prop: can't get host vid: %s\n",
2N/A "usb_populate_prop: can't get host pid\n");
2N/A "usb_populate_prop: can't get host model\n");
2N/A /* set usb group properties */ 2N/A "usb_populate_prop: fail to get vid: %s\n",
2N/A "usb_populate_prop: fail to get pid\n");
2N/A /* vendor name possibly present only for USB devices */ 2N/A /* product name possibly present only for USB devices */ 2N/A /* serial no possibly present only for USB devices */ 2N/A /* set dev group properties */ 2N/A "usb_populate_prop: fail to set driver, %s\n",
2N/A "usb_populate_prop: fail to set instance, %s\n",
2N/A "usb_populate_prop: fail to set devtype, %s\n",
2N/A "usb_populate_prop: fail to set devtype, %s\n",
2N/A "usb_populate_prop: fail to set dev path %s, %s\n",
2N/A * pnode -- parent tnode 2N/A * pdn -- the device node which we're to create tnode for 2N/A * skip scsa2usb children, the disk(sd), since 2N/A * they're not handled by USB stack. 2N/A if ((n ==
1) || ((n >
1) && (
data[
1] ==
1))) {
2N/A * n=1, the port number 2N/A * n>1, data[0] is the interface # and data[1] is the cfg # 2N/A /* Need verify if config is not 1 */ 2N/A /* if this is an interface node, do not try to get vid/pid */ 2N/A * if we don't have child, return. Otherwise, process each child. 2N/A * interface of this IA 2N/A /* instantiate each child sequencely */ 2N/A * instantiate every child 2N/A * pnode - parent tnode 2N/A "usb_children_instantiate: root hub %s\n",
2N/A "usb_children_instantiate: declare %s\n",