/*
* 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/dditypes.h>
#include <sys/mdb_modapi.h>
#include <sys/sysmacros.h>
#include <srp.h>
#include <srpt_impl.h>
/*
* byteswap macros since ntohl not available in kernel mdb
*/
#if defined(_LITTLE_ENDIAN)
((uint32_t)(x) >> 24))
#else
#define SRPT_BSWAP_32(x) (x)
#define SRPT_BSWAP_16(x) (x)
#endif /* _LITTLE_ENDIAN */
/*
* Walker to list the addresses of all the active I/O Controllers
*/
static int
{
mdb_warn("failed to read srpt soft state");
return (WALK_ERR);
}
mdb_warn("list walk failed");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
return (WALK_DONE);
}
wsp->walk_cbdata));
}
/*
* Walker to list the target services per I/O Controller. The I/O Controller is
* provided as input.
*/
static int
{
/*
* Input should be a srpt_ioc_t, read it to get the
* srpt_target_port_t
*/
mdb_warn("<srpt_ioc_t addr>::walk srpt_target\n");
return (WALK_ERR);
}
mdb_warn("failed to read in the srpt_ioc\n ");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
return (WALK_DONE);
}
wsp->walk_cbdata);
/* Currently there is only one target per IOC */
return (WALK_DONE);
}
static void
{
}
/*
* Walker to list the channels per SRP target service. The target port is
* provided as input.
*/
static int
{
/*
* Input should be a srpt_target_port_t, read it to get the
* list of channels
*/
mdb_warn("<srpt_target_port_t addr>::walk srpt_channel\n");
return (WALK_ERR);
}
mdb_warn("Could not walk tp_ch_list");
return (WALK_ERR);
}
return (WALK_NEXT);
}
/*
* Walker to list the SCSI sessions per target. The target is
* provided as input.
*/
static int
{
/*
* Input should be a srpt_target_port_t, read it to get the
* srpt_session_t
*/
mdb_warn("<srpt_target_port_t addr>::walk srpt_scsi_session\n");
return (WALK_ERR);
}
mdb_warn("target session list walk failed");
return (WALK_ERR);
}
return (WALK_NEXT);
}
/*
* Walker to list the tasks in a session. The session is
* provided as input.
*/
static int
{
mdb_warn("<srpt_session_t addr>::walk srpt_tasks\n");
return (WALK_ERR);
}
mdb_warn("session task list walk failed");
return (WALK_ERR);
}
return (WALK_NEXT);
}
/* ARGSUSED */
static int
{
int i;
mdb_warn("address of srpt_ioc should be specified\n");
return (DCMD_ERR);
}
return (DCMD_ERR);
}
mdb_printf(" profile send qdepth: %d\n",
mdb_printf(" profile rmda read qdepth: %d\n",
mdb_printf(" profile send msg size: %d\n",
mdb_printf(" profile rmda xfer size: %d\n",
for (i = 0; i < 8; i++) {
mask[i] = 'x';
} else {
mask[i] = '-';
}
}
mask[i] = '\0';
return (DCMD_OK);
}
{ "srpt_print_ioc", ":", "Print information about an SRPT IOC",
{ NULL }
};
{ "srpt_ioc", "Walk active IO controllers",
{ "srpt_tgt", "Walk the targets",
{ "srpt_channel", "Walk the channels",
{ "srpt_scsi_session", "Walk the scsi sessions",
{ "srpt_tasks", "Walk the tasks in a scsi session",
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}