pmcs.c revision f7aef0b0ce0e9a2c3da9c2e3aa9122f3642c1459
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * We need use this to pass the settings when display_iport
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct per_iport_setting {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t pis_dtc_info; /* -d: device tree children: dev_info/path_info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MDB_RD(a, b, c) mdb_vread(a, b, (uintptr_t)c)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NOREAD(a, b) mdb_warn("could not read " #a " at 0x%p", b)
static int target_idx;
int idx;
int msec_per_tick;
msec_per_tick = 0;
if (msec_per_tick == 0) {
sizeof (struct pmcs_phy)) {
return (DCMD_ERR);
sizeof (struct dev_info)) {
return (rval);
return (rval);
return (rval);
return (rval);
return (rval);
return (rval);
return (rval);
return (rval);
sizeof (struct dev_info)) {
return (DCMD_ERR);
return (DCMD_OK);
sizeof (struct mdi_pathinfo)) {
return (DCMD_ERR);
return (DCMD_OK);
sizeof (struct dev_info)) {
return (rval);
goto skip_di;
return (rval);
return (rval);
return (rval);
char *ua_state;
sizeof (struct pmcs_iport)) {
return (DCMD_ERR);
case UA_INACTIVE:
case UA_PEND_ACTIVATE:
case UA_ACTIVE:
case UA_PEND_DEACTIVATE:
if (m.iports_attached) {
(void *)addr);
return (DCMD_ERR);
case SAS:
case SATA:
case EXPANDER:
while (ccbp) {
!= sizeof (pmcwork_t)) {
char *fwsupport;
case PMCS_FW_TYPE_RELEASED:
case PMCS_FW_TYPE_DEVELOPMENT:
case PMCS_FW_TYPE_ALPHA:
case PMCS_FW_TYPE_BETA:
if (m.fwlog == 0) {
char *dtype;
if (!totals_only) {
case NOTHING:
case SATA:
sata_targets++;
case SAS:
sas_targets++;
case EXPANDER:
smp_targets++;
if (totals_only) {
if (verbose) {
if (!totals_only) {
char *state_string;
switch (state) {
case PMCS_WORK_STATE_NIL:
case PMCS_WORK_STATE_READY:
case PMCS_WORK_STATE_ONCHIP:
case PMCS_WORK_STATE_INTR:
case PMCS_WORK_STATE_IOCOMPQ:
case PMCS_WORK_STATE_ABORTED:
return (state_string);
char *path;
int tgt;
if (verbose) {
if (verbose) {
int idx;
if (verbose) {
if (verbose) {
if (printhdr) {
if (verbose) {
if (verbose) {
sizeof (struct scsi_pkt)) {
int first, i;
while (sp) {
if (first) {
first = 0;
while (sp) {
if (first) {
first = 0;
for (i = 0; i < max_dev; i++) {
while (sp) {
if (first) {
first = 0;
while (sp) {
if (first) {
first = 0;
while (sp) {
if (first) {
first = 0;
switch (qnum) {
case PMCS_OQ_IODONE:
case PMCS_OQ_GENERAL:
case PMCS_OQ_EVENTS:
switch (cat) {
case PMCS_IOMB_CAT_NET:
case PMCS_IOMB_CAT_FC:
case PMCS_IOMB_CAT_SAS:
case PMCS_IOMB_CAT_SCSI:
switch (opcode) {
case PMCIN_ECHO:
case PMCIN_GET_INFO:
case PMCIN_GET_VPD:
case PMCIN_PHY_START:
case PMCIN_PHY_STOP:
case PMCIN_SSP_INI_IO_START:
case PMCIN_SSP_INI_TM_START:
case PMCIN_SSP_TGT_IO_START:
case PMCIN_SSP_ABORT:
case PMCIN_GET_DEVICE_HANDLE:
case PMCIN_SMP_REQUEST:
case PMCIN_SMP_RESPONSE:
case PMCIN_SMP_ABORT:
case PMCIN_ASSISTED_DISCOVERY:
case PMCIN_REGISTER_DEVICE:
case PMCIN_SATA_HOST_IO_START:
case PMCIN_SATA_ABORT:
case PMCIN_LOCAL_PHY_CONTROL:
case PMCIN_GET_DEVICE_INFO:
case PMCIN_TWI:
case PMCIN_FW_FLASH_UPDATE:
case PMCIN_SET_VPD:
case PMCIN_GPIO:
case PMCIN_SAS_DIAG_EXECUTE:
case PMCIN_SAW_HW_EVENT_ACK:
case PMCIN_GET_TIME_STAMP:
case PMCIN_PORT_CONTROL:
case PMCIN_GET_NVMD_DATA:
case PMCIN_SET_NVMD_DATA:
case PMCIN_SET_DEVICE_STATE:
case PMCIN_GET_DEVICE_STATE:
switch (opcode) {
case PMCOUT_ECHO:
case PMCOUT_GET_INFO:
case PMCOUT_GET_VPD:
case PMCOUT_SAS_HW_EVENT:
case PMCOUT_SSP_COMPLETION:
case PMCOUT_SMP_COMPLETION:
case PMCOUT_LOCAL_PHY_CONTROL:
case PMCOUT_GET_DEVICE_HANDLE:
case PMCOUT_SATA_COMPLETION:
case PMCOUT_SATA_EVENT:
case PMCOUT_SSP_EVENT:
case PMCOUT_DEVICE_INFO:
case PMCOUT_FW_FLASH_UPDATE:
case PMCOUT_SET_VPD:
case PMCOUT_GPIO:
case PMCOUT_GPIO_EVENT:
case PMCOUT_GENERAL_EVENT:
case PMCOUT_TWI:
case PMCOUT_SSP_ABORT:
case PMCOUT_SATA_ABORT:
case PMCOUT_SAS_DIAG_EXECUTE:
case PMCOUT_GET_TIME_STAMP:
case PMCOUT_PORT_CONTROL:
case PMCOUT_SKIP_ENTRIES:
case PMCOUT_SMP_ABORT:
case PMCOUT_GET_NVMD_DATA:
case PMCOUT_SET_NVMD_DATA:
case PMCOUT_SET_DEVICE_STATE:
case PMCOUT_GET_DEVICE_STATE:
case PMCOUT_SET_DEVICE_INFO:
int qeidx;
qidx);
if (!verbose) {
last_consumed)));
int qeidx;
qidx);
if (iqci == 0) {
if (!verbose) {
last_consumed)));
case NOTHING:
case SATA:
++sata_phys;
case SAS:
++sas_phys;
case EXPANDER:
++exp_phys;
empty_phys++;
if (totals_only) {
case SAS_LINK_RATE_1_5GBIT:
case SAS_LINK_RATE_3GBIT:
case SAS_LINK_RATE_6GBIT:
if (verbose) {
int totals_only)
if (level == 0) {
sas_phys = 0;
sata_phys = 0;
exp_phys = 0;
num_expanders = 0;
empty_phys = 0;
if (!totals_only) {
if (level == 0) {
if (verbose) {
while (pphy) {
if (!totals_only) {
if (level == 0) {
if (verbose) {
char *bufp;
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
#if defined(_LITTLE_ENDIAN)
if (wrap) {
start_idx = 0;
while (elems_to_print != 0) {
return (DCMD_ERR);
if (filter) {
bufp++;
ei_idx = 0;
bufp++;
PMCS_TBUF_UA_MAX_SIZE) == 0) {
if (sas_address != 0) {
if (!elem_filtered) {
idx = 0;
return (DCMD_OK);
return (WALK_ERR);
sizeof (pmcs_hw_t)) {
return (WALK_ERR);
return (WALK_ERR);
target_idx = 0;
return (WALK_NEXT);
int status;
return (WALK_DONE);
return (WALK_DONE);
return (WALK_DONE);
return (status);
static pmcs_phy_t *
return (NULL);
return (NULL);
return (WALK_ERR);
sizeof (pmcs_hw_t)) {
return (WALK_ERR);
return (WALK_NEXT);
int status;
return (WALK_DONE);
return (WALK_DONE);
return (status);
int idx;
char *match_type;
switch (tag_type) {
case PMCS_TAG_TYPE_NONE:
case PMCS_TAG_TYPE_CBACK:
case PMCS_TAG_TYPE_WAIT:
if (tag_type) {
if (!printed_header) {
int args = 0;
void *pmcs_state;
char *state_str;
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_USAGE);
args++;
return (DCMD_USAGE);
args++;
switch (tag_type) {
case PMCS_TAG_TYPE_NONE:
case PMCS_TAG_TYPE_CBACK:
case PMCS_TAG_TYPE_WAIT:
return (DCMD_USAGE);
args++;
return (DCMD_USAGE);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_ERR);
case STATE_NIL:
case STATE_PROBING:
case STATE_RUNNING:
case STATE_UNPROBING:
case STATE_DEAD:
return (DCMD_OK);
void *pmcs_state;
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
void *pmcs_state;
char *state_str;
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_ERR);
unconfigured) {
case STATE_NIL:
case STATE_PROBING:
case STATE_RUNNING:
case STATE_UNPROBING:
case STATE_DEAD:
if (waitqs_info)
if (hw_info)
if (work_info)
if (ic_info)
if (ibq)
if (obq)
if (iport_info)
if (compq)
if (unconfigured)
return (rv);
{ NULL }
{ NULL }
const mdb_modinfo_t *
_mdb_init(void)
return (&modinfo);