mpxio_dcmds.c revision 5e3986cb9bc07bde1dfa1a7028d5ad3e501abae4
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "main.h"
/*
* mdiclient()
*
* Dump mdi_client_t info and list all paths.
*/
/* ARGSUSED */
int
{
struct mdi_client value;
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("mdiclient: requires an address");
return (DCMD_ERR);
}
!= sizeof (struct mdi_client)) {
return (DCMD_ERR);
}
mdb_printf("\n");
mdb_printf("ct_hnext: %26l#r::print struct mdi_client\n",
mdb_printf("ct_hprev: %26l#r::print struct mdi_client\n",
mdb_printf("\nct_path_head: %22l#r::print struct mdi_pathinfo\n",
mdb_printf("ct_path_tail: %22l#r::print struct mdi_pathinfo\n",
mdb_printf("ct_path_last: %22l#r::print struct mdi_pathfinfo\n",
mdb_printf("List of paths:\n");
mdb_printf("\n");
}
mdb_printf("\n");
;
;
return (DCMD_OK);
}
/*
* mdipi()
*
* Given a path, dump mdi_pathinfo struct and detailed pi_prop list.
*/
/* ARGSUSED */
int
{
struct mdi_pathinfo value;
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("mdipi: requires an address");
return (DCMD_ERR);
}
sizeof (struct mdi_pathinfo)) {
return (DCMD_ERR);
}
mdb_printf("\n");
mdb_printf("pi_client: %25l#r::print struct mdi_client\n",
mdb_printf("pi_client_link: %20l#r::print struct mdi_pathinfo\n",
mdb_printf("pi_phci_link: %22l#r::print struct mdi_pathinfo\n",
mdb_printf("\n");
dump_state_str("Pathinfo State (pi_state) ",
if (MDI_PI_IS_TRANSIENT(&value)) {
mdb_printf("Pathinfo State is TRANSIENT\n");
}
if (MDI_PI_EXT_STATE(&value)) {
mdb_printf(" Extended (pi_state) : ");
/*
* Need to shift right 20 bits to match mdi_pathinfo_ext_states
* array.
*/
}
dump_state_str("Old Pathinfo State (pi_old_state)",
if (MDI_PI_OLD_EXT_STATE(&value)) {
mdb_printf(" Extended (pi_old_state) : ");
/*
* Need to shift right 20 bits to match mdi_pathinfo_ext_states
* array.
*/
>> 20, mdi_pathinfo_ext_states);
}
mdb_printf("\n");
mdb_printf("\n");
mdb_printf("pi_kstats: %25l#r::print struct mdi_pi_kstats\n",
return (DCMD_OK);
}
/*
* mdiprops()
*
* Given a pi_prop, dump the pi_prop list.
*/
/* ARGSUSED */
int
{
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("mdiprops: requires an address");
return (DCMD_ERR);
}
mdb_printf("\n");
return (DCMD_OK);
}
/*
* mdiphci()
*
* Given a phci, dump mdi_phci struct.
*/
/* ARGSUSED */
int
{
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("mdiphci: requires an address");
return (DCMD_ERR);
}
sizeof (struct mdi_phci)) {
return (DCMD_ERR);
}
mdb_printf("\nph_path_head: %22l#r::print struct mdi_pathinfo\n",
mdb_printf("ph_path_tail: %22l#r::print struct mdi_pathinfo\n",
mdb_printf("List of paths:\n");
mdb_printf("\n");
}
"Paths in transient state (ph_unstable_cv)");
return (DCMD_OK);
}
/*
* mdivhci()
*
* Given a vhci, dump mdi_vhci struct and list all phcis.
*/
/* ARGSUSED */
int
{
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("mdivhci: requires an address");
return (DCMD_ERR);
}
sizeof (struct mdi_vhci)) {
return (DCMD_ERR);
}
mdb_printf("vh_ops: %28l#r::print struct mdi_vhci_ops\n",
mdb_printf("\nvh_phci_head: %22l#r::print struct mdi_phci\n",
mdb_printf("vh_phci_tail: %22l#r::print struct mdi_phci\n",
mdb_printf("vh_client_table: %19l#r::print struct client_hash\n",
mdb_printf("List of pHCIs:\n");
mdb_printf("\n");
return (DCMD_OK);
}
/*
* vhcilun()
*
* Get client info given a guid.
*/
/* ARGSUSED */
int
{
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("sv_lun: requires an address");
return (DCMD_ERR);
}
}
/*
* vhciguid()
*
* List all the clients.
*/
/* ARGSUSED */
int
{
struct i_ddi_soft_state ss;
int i;
struct client_hash *ct_hash_val;
struct client_hash *ct_hash_table_val;
int mdi_vhci_len = sizeof (*mdi_vhci_value);
int mdi_client_len = sizeof (*mdi_client_value);
int ct_hash_len = sizeof (*ct_hash_val);
int ct_hash_count = 0;
char *class;
int found = 0;
if (flags & DCMD_ADDRSPEC)
mdb_warn("This command doesn't use an address\n");
return (DCMD_ERR);
mdb_warn("mdi driver variable mdi_vhci_head not found.\n");
mdb_warn("Is the driver loaded ?\n");
return (DCMD_ERR);
}
return (DCMD_ERR);
}
!= strlen(MDI_HCI_CLASS_SCSI)) {
mdb_warn("vhciguid: Failed read of class %l#r\n",
return (DCMD_ERR);
}
while (class) {
found = 1;
break;
}
break;
}
!= mdi_vhci_len) {
mdb_warn("vhciguid: Failed read on vh->next %l#r\n",
break;
}
mdb_warn("vhciguid: Failed read on vh->next %l#r\n",
break;
}
}
if (found == 0) {
mdb_warn("vhciguid: No scsi_vhci class found");
return (DCMD_ERR);
}
mdb_printf("----- Number of devices found %d ----------\n",
for (i = 0; i < CLIENT_HASH_TABLE_SIZE; i++) {
if (ct_hash_table_val == NULL)
continue;
/* Read client_hash structure */
mdb_warn("Failed read on hash %l#r\n",
break;
}
mdb_printf("----hash[%d] %l#r: devices mapped = %d --\n",
if (ct_hash_val->ct_hash_count == 0) {
continue;
}
/* Read mdi_client structures */
!= mdi_client_len) {
mdb_warn("Failed read on client %l#r\n",
break;
}
mdb_printf("mdi_client %l#r %l#r ------\n",
DCMD_ADDRSPEC, 0, 0);
while (--ct_hash_count) {
temp) != mdi_client_len) {
mdb_warn("Failed read on client %l#r\n",
break;
}
DCMD_ADDRSPEC, 0, 0);
}
}
mdb_printf("----------done----------\n");
return (DCMD_OK);
}
/* ARGSUSED */
int
{
}