util.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "main.h"
/*
* Print the flag name by comparing flags to the mask variable.
*/
void
{
unsigned long long mask = 1;
for (i = 0; i < 64; i++) {
break;
if (!first) {
mdb_printf(" | ");
} else {
first = 0;
}
/* make output pretty */
if (linel > 80) {
mdb_printf("\n\t");
}
}
mask <<= 1;
}
mdb_printf("\n");
}
void
{
}
void
{
}
/*
* dump_states()
*
* Print the state information for vhci_states().
*/
int
{
int i;
int array_size;
struct i_ddi_soft_state *ss;
} else {
}
mdb_warn("Cannot read softstate struct (Invalid pointer?).\n");
return (DCMD_ERR);
}
mdb_warn("Corrupted softstate struct.\n");
return (DCMD_ERR);
}
return (DCMD_OK);
if (verbose) {
/*
* ss->size is of type size_t which is 4 bytes and 8 bytes
* on 32-bit and 64-bit systems respectively.
*/
#ifdef _LP64
mdb_printf("Softstate size is %lld(0x%llx) bytes.\n\n",
#else
mdb_printf("Softstate size is %ld(0x%lx) bytes.\n\n",
#endif
mdb_printf("state pointer\t\t\t\t\tinstance\n");
mdb_printf("=============\t\t\t\t\t========\n");
}
continue;
!= sizeof (vhci)) {
mdb_warn("Corrupted softstate struct.\n");
return (DCMD_ERR);
}
if (verbose) {
mdb_printf("%l#r::print struct scsi_vhci\t\t %d\n",
mdb_printf("\nvhci_conf_flags: %d\n",
if (vhci.vhci_conf_flags) {
mdb_printf("\t");
dump_flags((unsigned long long)
}
} else {
}
}
return (DCMD_OK);
}
int
{
return (1);
}
return (0);
}
void
{
char string_val[MAXNAMELEN];
return;
}
}
void
{
}
void
{
}
/* VHCI UTILS */
/*
* i_vhci_states()
*
* Internal routine for vhci_states() to check for -v arg and then
* print state info.
*/
/* ARGSUSED */
int
struct i_ddi_soft_state *sp)
{
int verbose = 0;
mdb_warn("vhci driver variable vhci_softstate not found.\n");
mdb_warn("Is the driver loaded ?\n");
return (DCMD_ERR);
}
return (DCMD_USAGE);
}
}
}
/* ARGSUSED */
int
{
return (0);
}
/*
* i_vhcilun()
*
* Internal routine for vhciguid() to print client info.
*/
int
{
struct dev_info dev_info_value;
char string_val[MAXNAMELEN];
int found = 0;
struct mdi_client ct_value;
do {
sizeof (scsi_vhci_lun_t)) {
return (DCMD_ERR);
}
if (display_single_guid) {
found = 1;
} else continue;
}
}
mdb_warn("svl_dip: Failed read on %l#r",
return (DCMD_ERR);
}
string_val)) {
}
} else {
mdb_printf(" No active pclass");
}
if (display_single_guid) {
}
mdb_printf("\n%t%l#r::print struct mdi_client",
mdb_printf("\t");
} else {
mdb_printf("\n");
}
if (found) {
DCMD_ADDRSPEC, 0, 0);
} else {
sizeof (struct mdi_client)) {
mdb_warn("mdiclient: Failed read on %l#r",
return (DCMD_ERR);
}
mdb_printf("\t");
dump_flags((unsigned long long)
}
mdb_printf("%t");
mdb_printf("\n");
}
return (DCMD_OK);
}