/*
* 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.
*/
/*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
#include <limits.h>
#include <sys/mdb_modapi.h>
#include "mr_sas.h"
int
{
struct dev_info d;
mdb_warn("couldn't read dev_info");
return (DCMD_ERR);
}
if (d.devi_parent) {
(uintptr_t)d.devi_node_name);
}
return (DCMD_OK);
}
void
{
int tgt;
if (verbose) {
*device_path = 0;
}
}
mdb_printf("\n");
if (verbose)
mdb_printf("Physical/Logical Target\n");
mdb_printf("-----------------------\n");
== -1 ||
== -1) {
mdb_warn("can't read list of disks");
return;
}
}
}
}
}
mdb_printf("\n");
}
void
{
mdb_printf("\n");
mdb_printf("vendor_id device_id subsysvid subsysid");
mdb_printf("\n");
mdb_printf("--------------------------------------");
mdb_printf("\n");
mdb_printf(" 0x%x 0x%x 0x%x 0x%x",
mdb_printf("\n");
}
static int
{
struct mrsas_instance m;
int instance;
void *mrsas_state;
if (!(flags & DCMD_ADDRSPEC)) {
mrsas_state = NULL;
mdb_warn("can't read mrsas_state");
return (DCMD_ERR);
}
mdb_warn("mdb_pwalk_dcmd failed");
return (DCMD_ERR);
}
return (DCMD_OK);
}
return (DCMD_USAGE);
return (DCMD_ERR);
}
/* cmd slot info */
ncmds = m.max_fw_cmds;
/* processing completed */
(flags & DCMD_LOOPFIRST)) {
mdb_printf("\n");
mdb_printf(" mrsas_t inst max_fw_cmds intr_type");
mdb_printf("\n");
mdb_printf("===========================================");
mdb_printf("\n");
}
switch (m.intr_type) {
case DDI_INTR_TYPE_MSIX:
mdb_printf("MSI-X");
break;
case DDI_INTR_TYPE_MSI:
mdb_printf("MSI");
break;
case DDI_INTR_TYPE_FIXED:
mdb_printf("FIXED");
break;
default:
mdb_printf("INVALD");
}
mdb_printf("\n");
if (target_info)
display_targets(&m, verbose);
if (device_info)
display_deviceinfo(&m);
return (rv);
}
void
mr_sas_help(void)
{
mdb_printf("Prints summary information about each mr_sas instance, "
"Without the address of a \"struct mrsas_instance\", prints every "
"instance.\n\n"
"Switches:\n"
" -t includes information about targets\n"
" -d includes information about the hardware\n"
" -v displays extra information for some options\n");
}
mr_sas_help },
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}