/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* FCP mdb module
*/
#include <sys/mdb_modapi.h>
/*
*/
static int
{
mdb_warn("failed to read 'fcp_port_head'");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_DONE);
}
wsp->walk_cbdata);
return (status);
}
/*
* The walker's fini function is invoked at the end of each walk.
*/
static void
{
}
static int
{
if (argc != 0) {
return (DCMD_USAGE);
}
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("failed to walk 'fcp_port_head'");
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*
* For each port, we just need to read the fc_fca_port_t struct, read
* the port_handle
*/
sizeof (struct fcp_port)) {
return (DCMD_OK);
}
mdb_printf(" port wwn : "
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
mdb_printf(" node wwn : "
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
mdb_printf(" cmds_aborted : 0x%-08x\n",
mdb_printf(" cmds_dma_flags : 0x%-08x\n",
mdb_printf(" data_dma_attr : 0x%-08x\n",
mdb_printf(" cmd_dma_attr : 0x%-08x\n",
mdb_printf(" resp_dma_attr : 0x%-08x\n",
mdb_printf(" dma_acc_attr : 0x%-08x\n",
mdb_printf(" reset_notify_listf: 0x%p\n",
mdb_printf("\n");
return (DCMD_OK);
}
/*
*/
static int
{
mdb_warn("Can not perform global walk");
return (WALK_ERR);
}
/*
* Input should be a fcp_lun, so read it to get the fcp_pkt
* lists's head
*/
sizeof (struct fcp_lun)) {
mdb_warn("Unable to read in the fcp_lun structure address\n");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_DONE);
}
wsp->walk_cbdata);
return (status);
}
/*
* The walker's fini function is invoked at the end of each walk.
*/
static void
{
}
/*
*/
static int
{
mdb_warn("Can not perform global walk");
return (WALK_ERR);
}
/*
* Input should be a fcp_tgt, so read it to get the fcp_lun
* lists's head
*/
sizeof (struct fcp_tgt)) {
mdb_warn("Unable to read in the fcp_tgt structure address\n");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_DONE);
}
wsp->walk_cbdata);
return (status);
}
/*
* The walker's fini function is invoked at the end of each walk.
*/
static void
{
}
/*
*/
static int
{
mdb_warn("Can not perform global walk\n");
return (WALK_ERR);
}
/*
* Input should be a fcp_port, so read it to get the port_tgt
* table's head
*/
sizeof (struct fcp_port)) {
mdb_warn("Unable to read in the port structure address\n");
return (WALK_ERR);
}
tgt_hash_index = 0;
(tgt_hash_index < FCP_NUM_HASH)) {
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
}
return (WALK_DONE);
}
wsp->walk_cbdata);
/*
* locate the next hash list
*/
(tgt_hash_index < FCP_NUM_HASH)) {
}
if (tgt_hash_index == FCP_NUM_HASH) {
/* You're done */
return (status);
}
}
return (status);
}
/*
* The walker's fini function is invoked at the end of each walk.
*/
static void
{
}
/*
*/
static int
{
mdb_warn("The address of a fcp_port"
" structure must be given\n");
return (WALK_ERR);
}
/*
* Input should be a fcp_port, so read it to get the ipkt
* list's head
*/
sizeof (struct fcp_port)) {
mdb_warn("Failed to read in the fcp_port"
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
mdb_warn("Failed to read in the fcp_ipkt"
return (WALK_DONE);
}
wsp->walk_cbdata);
return (status);
}
/*
* The walker's fini function is invoked at the end of each walk.
*/
static void
{
}
/*
*/
static int
{
mdb_warn("The address of a fcp_port"
" structure must be given\n");
return (WALK_ERR);
}
/*
* Input should be an fcp_port, so read it to get the pkt
* list's head
*/
sizeof (struct fcp_port)) {
mdb_warn("Failed to read in the fcp_port"
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
mdb_warn("Failed to read in the fcp_pkt"
return (WALK_DONE);
}
wsp->walk_cbdata);
return (status);
}
/*
* The walker's fini function is invoked at the end of each walk.
*/
static void
{
}
/*
* MDB module linkage information:
*
* We declare a list of structures describing our dcmds, a list of structures
* describing our walkers, and a function named _mdb_init to return a pointer
* to our module information.
*/
{ NULL }
};
{ "fcp", "Walk list of Leadville fcp instances",
{ "cmds", "Walk list of SCSI commands in fcp's per-lun queue",
{ "luns", "Walk list of LUNs in an fcp target",
{ "targets", "Walk list of fcp targets attached to the local port",
{ "fcp_ipkt", "Walk list of internal packets queued on a local port",
{ "fcp_pkt", "Walk list of packets queued on a local port",
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}