/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/mdb_modapi.h>
#include "devinfo.h"
static char *
{
switch (state) {
case DDI_HP_CN_STATE_EMPTY:
return ("Empty");
case DDI_HP_CN_STATE_PRESENT:
return ("Present");
case DDI_HP_CN_STATE_POWERED:
return ("Powered");
case DDI_HP_CN_STATE_ENABLED:
return ("Enabled");
return ("Port_Empty");
return ("Port_Present");
case DDI_HP_CN_STATE_OFFLINE:
return ("Offline");
case DDI_HP_CN_STATE_ATTACHED:
return ("Attached");
return ("Maintenance");
case DDI_HP_CN_STATE_ONLINE:
return ("Online");
default:
return ("Unknown");
}
}
/*ARGSUSED*/
static int
{
while (hdlp) {
mdb_warn("Failed to read hdlp!\n");
return (DCMD_ERR);
}
mdb_warn("Failed to read cn_type!\n");
return (DCMD_ERR);
}
mdb_warn("Failed to read cn_name!\n");
return (DCMD_ERR);
}
}
};
return (WALK_NEXT);
}
void
hotplug_help(void)
{
mdb_printf("Switches:\n"
" -p only print the physical hotplug connectors\n");
}
int
{
int status;
!= argc)
return (DCMD_USAGE);
if (DCMD_HDRSPEC(flags)) {
mdb_printf("%<u>%?s %?s %-12s %-15s %-15s%</u>\n",
"PARENT_DEVINFO", "HANDLE", "STATE", "TYPE", "CN_NAME");
}
if ((flags & DCMD_ADDRSPEC) == 0) {
mdb_warn("failed to read 'top_devinfo'");
return (NULL);
}
&data, devinfo_root);
if (status == -1) {
mdb_warn("couldn't walk devinfo tree");
return (DCMD_ERR);
}
return (DCMD_OK);
}
== -1) {
mdb_warn("Failed to read hdlp!\n");
return (DCMD_ERR);
}
mdb_warn("Failed to read cn_type!\n");
return (DCMD_ERR);
}
mdb_warn("Failed to read cn_name!\n");
return (DCMD_ERR);
}
return (DCMD_OK);
}