Rework the debug print API. Event printing no longer gets special handling.
All of the printing from the tables file now has wrappers so that the handling is cleaner and it's possible to print something out (say, during development) without having to fight the global debug flags. This re-org will also make it easier to have the tables be compiled out at build time if desired. Other than fixing some minor bugs, there are no user-visible changes from this change Sponsored by: Netflix, Inc. Differential Revision: D9238
This commit is contained in:
parent
538ee0d74e
commit
c11c484f15
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312437
@ -349,7 +349,7 @@ mprsas_log_command(struct mpr_command *cm, u_int level, const char *fmt, ...)
|
||||
sbuf_printf(&sb, "SMID %u ", cm->cm_desc.Default.SMID);
|
||||
sbuf_vprintf(&sb, fmt, ap);
|
||||
sbuf_finish(&sb);
|
||||
mpr_dprint_field(cm->cm_sc, level, "%s", sbuf_data(&sb));
|
||||
mpr_print_field(cm->cm_sc, "%s", sbuf_data(&sb));
|
||||
|
||||
va_end(ap);
|
||||
}
|
||||
|
@ -197,27 +197,26 @@ mpr_describe_devinfo(uint32_t devinfo, char *string, int len)
|
||||
}
|
||||
|
||||
void
|
||||
mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
_mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
{
|
||||
|
||||
MPR_PRINTFIELD_START(sc, "IOCFacts");
|
||||
MPR_PRINTFIELD(sc, facts, MsgVersion, 0x%x);
|
||||
MPR_PRINTFIELD(sc, facts, HeaderVersion, 0x%x);
|
||||
MPR_PRINTFIELD(sc, facts, IOCNumber, %d);
|
||||
MPR_PRINTFIELD(sc, facts, IOCExceptions, 0x%x);
|
||||
MPR_PRINTFIELD(sc, facts, MaxChainDepth, %d);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "WhoInit: %s\n",
|
||||
mpr_print_field(sc, "WhoInit: %s\n",
|
||||
mpr_describe_table(mpr_whoinit_names, facts->WhoInit));
|
||||
MPR_PRINTFIELD(sc, facts, NumberOfPorts, %d);
|
||||
MPR_PRINTFIELD(sc, facts, MaxMSIxVectors, %d);
|
||||
MPR_PRINTFIELD(sc, facts, RequestCredit, %d);
|
||||
MPR_PRINTFIELD(sc, facts, ProductID, 0x%x);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "IOCCapabilities: %b\n",
|
||||
mpr_print_field(sc, "IOCCapabilities: %b\n",
|
||||
facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace"
|
||||
"\5SnapBuf" "\6ExtBuf" "\7EEDP" "\10BiDirTarg" "\11Multicast"
|
||||
"\14TransRetry" "\15IR" "\16EventReplay" "\17RaidAccel"
|
||||
"\20MSIXIndex" "\21HostDisc");
|
||||
mpr_dprint_field(sc, MPR_XINFO, "FWVersion= %d-%d-%d-%d\n",
|
||||
mpr_print_field(sc, "FWVersion= %d-%d-%d-%d\n",
|
||||
facts->FWVersion.Struct.Major,
|
||||
facts->FWVersion.Struct.Minor,
|
||||
facts->FWVersion.Struct.Unit,
|
||||
@ -227,7 +226,7 @@ mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
MPR_PRINTFIELD(sc, facts, MaxTargets, %d);
|
||||
MPR_PRINTFIELD(sc, facts, MaxSasExpanders, %d);
|
||||
MPR_PRINTFIELD(sc, facts, MaxEnclosures, %d);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "ProtocolFlags: %b\n",
|
||||
mpr_print_field(sc, "ProtocolFlags: %b\n",
|
||||
facts->ProtocolFlags, "\20" "\1ScsiTarg" "\2ScsiInit");
|
||||
MPR_PRINTFIELD(sc, facts, HighPriorityCredit, %d);
|
||||
MPR_PRINTFIELD(sc, facts, MaxReplyDescriptorPostQueueDepth, %d);
|
||||
@ -238,7 +237,7 @@ mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
}
|
||||
|
||||
void
|
||||
mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
|
||||
_mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
|
||||
{
|
||||
|
||||
MPR_PRINTFIELD_START(sc, "PortFacts");
|
||||
@ -248,24 +247,24 @@ mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
|
||||
}
|
||||
|
||||
void
|
||||
mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
_mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
{
|
||||
|
||||
MPR_EVENTFIELD_START(sc, "EventReply");
|
||||
MPR_EVENTFIELD(sc, event, EventDataLength, %d);
|
||||
MPR_EVENTFIELD(sc, event, AckRequired, %d);
|
||||
mpr_dprint_field(sc, MPR_EVENT, "Event: %s (0x%x)\n",
|
||||
MPR_PRINTFIELD_START(sc, "EventReply");
|
||||
MPR_PRINTFIELD(sc, event, EventDataLength, %d);
|
||||
MPR_PRINTFIELD(sc, event, AckRequired, %d);
|
||||
mpr_print_field(sc, "Event: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_event_names, event->Event), event->Event);
|
||||
MPR_EVENTFIELD(sc, event, EventContext, 0x%x);
|
||||
MPR_PRINTFIELD(sc, event, EventContext, 0x%x);
|
||||
}
|
||||
|
||||
void
|
||||
mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
_mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
{
|
||||
MPR_PRINTFIELD_START(sc, "SAS Device Page 0");
|
||||
MPR_PRINTFIELD(sc, buf, Slot, %d);
|
||||
MPR_PRINTFIELD(sc, buf, EnclosureHandle, 0x%x);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "SASAddress: 0x%jx\n",
|
||||
mpr_print_field(sc, "SASAddress: 0x%jx\n",
|
||||
mpr_to_u64(&buf->SASAddress));
|
||||
MPR_PRINTFIELD(sc, buf, ParentDevHandle, 0x%x);
|
||||
MPR_PRINTFIELD(sc, buf, PhyNum, %d);
|
||||
@ -273,7 +272,7 @@ mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
MPR_PRINTFIELD(sc, buf, DevHandle, 0x%x);
|
||||
MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x);
|
||||
MPR_PRINTFIELD(sc, buf, ZoneGroup, %d);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
|
||||
mpr_print_field(sc, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
|
||||
"\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit"
|
||||
"\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct"
|
||||
"\15LsiDev" "\16AtapiDev" "\17SepDev",
|
||||
@ -281,7 +280,7 @@ mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
MPR_PRINTFIELD(sc, buf, Flags, 0x%x);
|
||||
MPR_PRINTFIELD(sc, buf, PhysicalPort, %d);
|
||||
MPR_PRINTFIELD(sc, buf, MaxPortConnections, %d);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "DeviceName: 0x%jx\n",
|
||||
mpr_print_field(sc, "DeviceName: 0x%jx\n",
|
||||
mpr_to_u64(&buf->DeviceName));
|
||||
MPR_PRINTFIELD(sc, buf, PortGroups, %d);
|
||||
MPR_PRINTFIELD(sc, buf, DmaGroup, %d);
|
||||
@ -289,10 +288,10 @@ mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
}
|
||||
|
||||
void
|
||||
mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
_mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
{
|
||||
|
||||
mpr_print_event(sc, event);
|
||||
_mpr_print_event(sc, event);
|
||||
|
||||
switch(event->Event) {
|
||||
case MPI2_EVENT_SAS_DISCOVERY:
|
||||
@ -300,12 +299,12 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
MPI2_EVENT_DATA_SAS_DISCOVERY *data;
|
||||
|
||||
data = (MPI2_EVENT_DATA_SAS_DISCOVERY *)&event->EventData;
|
||||
mpr_dprint_field(sc, MPR_EVENT, "Flags: %b\n", data->Flags,
|
||||
mpr_print_field(sc, "Flags: %b\n", data->Flags,
|
||||
"\20" "\1InProgress" "\2DeviceChange");
|
||||
mpr_dprint_field(sc, MPR_EVENT, "ReasonCode: %s\n",
|
||||
mpr_print_field(sc, "ReasonCode: %s\n",
|
||||
mpr_describe_table(mpr_sasdisc_reason, data->ReasonCode));
|
||||
MPR_EVENTFIELD(sc, data, PhysicalPort, %d);
|
||||
mpr_dprint_field(sc, MPR_EVENT, "DiscoveryStatus: %b\n",
|
||||
MPR_PRINTFIELD(sc, data, PhysicalPort, %d);
|
||||
mpr_print_field(sc, "DiscoveryStatus: %b\n",
|
||||
data->DiscoveryStatus, "\20"
|
||||
"\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout"
|
||||
"\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed"
|
||||
@ -324,26 +323,26 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
|
||||
data = (MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST *)
|
||||
&event->EventData;
|
||||
MPR_EVENTFIELD(sc, data, EnclosureHandle, 0x%x);
|
||||
MPR_EVENTFIELD(sc, data, ExpanderDevHandle, 0x%x);
|
||||
MPR_EVENTFIELD(sc, data, NumPhys, %d);
|
||||
MPR_EVENTFIELD(sc, data, NumEntries, %d);
|
||||
MPR_EVENTFIELD(sc, data, StartPhyNum, %d);
|
||||
mpr_dprint_field(sc, MPR_EVENT, "ExpStatus: %s (0x%x)\n",
|
||||
MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x);
|
||||
MPR_PRINTFIELD(sc, data, ExpanderDevHandle, 0x%x);
|
||||
MPR_PRINTFIELD(sc, data, NumPhys, %d);
|
||||
MPR_PRINTFIELD(sc, data, NumEntries, %d);
|
||||
MPR_PRINTFIELD(sc, data, StartPhyNum, %d);
|
||||
mpr_print_field(sc, "ExpStatus: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_sastopo_exp, data->ExpStatus),
|
||||
data->ExpStatus);
|
||||
MPR_EVENTFIELD(sc, data, PhysicalPort, %d);
|
||||
MPR_PRINTFIELD(sc, data, PhysicalPort, %d);
|
||||
for (i = 0; i < data->NumEntries; i++) {
|
||||
phy = &data->PHY[i];
|
||||
phynum = data->StartPhyNum + i;
|
||||
mpr_dprint_field(sc, MPR_EVENT,
|
||||
mpr_print_field(sc,
|
||||
"PHY[%d].AttachedDevHandle: 0x%04x\n", phynum,
|
||||
phy->AttachedDevHandle);
|
||||
mpr_dprint_field(sc, MPR_EVENT,
|
||||
mpr_print_field(sc,
|
||||
"PHY[%d].LinkRate: %s (0x%x)\n", phynum,
|
||||
mpr_describe_table(mpr_linkrate_names,
|
||||
(phy->LinkRate >> 4) & 0xf), phy->LinkRate);
|
||||
mpr_dprint_field(sc,MPR_EVENT,"PHY[%d].PhyStatus: %s\n",
|
||||
mpr_print_field(sc, "PHY[%d].PhyStatus: %s\n",
|
||||
phynum, mpr_describe_table(mpr_phystatus_names,
|
||||
phy->PhyStatus));
|
||||
}
|
||||
@ -355,13 +354,13 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
|
||||
data = (MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE *)
|
||||
&event->EventData;
|
||||
MPR_EVENTFIELD(sc, data, EnclosureHandle, 0x%x);
|
||||
mpr_dprint_field(sc, MPR_EVENT, "ReasonCode: %s\n",
|
||||
MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x);
|
||||
mpr_print_field(sc, "ReasonCode: %s\n",
|
||||
mpr_describe_table(mpr_sastopo_exp, data->ReasonCode));
|
||||
MPR_EVENTFIELD(sc, data, PhysicalPort, %d);
|
||||
MPR_EVENTFIELD(sc, data, NumSlots, %d);
|
||||
MPR_EVENTFIELD(sc, data, StartSlot, %d);
|
||||
MPR_EVENTFIELD(sc, data, PhyBits, 0x%x);
|
||||
MPR_PRINTFIELD(sc, data, PhysicalPort, %d);
|
||||
MPR_PRINTFIELD(sc, data, NumSlots, %d);
|
||||
MPR_PRINTFIELD(sc, data, StartSlot, %d);
|
||||
MPR_PRINTFIELD(sc, data, PhyBits, 0x%x);
|
||||
break;
|
||||
}
|
||||
case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE:
|
||||
@ -370,13 +369,13 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
|
||||
data = (MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *)
|
||||
&event->EventData;
|
||||
MPR_EVENTFIELD(sc, data, TaskTag, 0x%x);
|
||||
mpr_dprint_field(sc, MPR_EVENT, "ReasonCode: %s\n",
|
||||
MPR_PRINTFIELD(sc, data, TaskTag, 0x%x);
|
||||
mpr_print_field(sc, "ReasonCode: %s\n",
|
||||
mpr_describe_table(mpr_sasdev_reason, data->ReasonCode));
|
||||
MPR_EVENTFIELD(sc, data, ASC, 0x%x);
|
||||
MPR_EVENTFIELD(sc, data, ASCQ, 0x%x);
|
||||
MPR_EVENTFIELD(sc, data, DevHandle, 0x%x);
|
||||
mpr_dprint_field(sc, MPR_EVENT, "SASAddress: 0x%jx\n",
|
||||
MPR_PRINTFIELD(sc, data, ASC, 0x%x);
|
||||
MPR_PRINTFIELD(sc, data, ASCQ, 0x%x);
|
||||
MPR_PRINTFIELD(sc, data, DevHandle, 0x%x);
|
||||
mpr_print_field(sc, "SASAddress: 0x%jx\n",
|
||||
mpr_to_u64(&data->SASAddress));
|
||||
}
|
||||
default:
|
||||
@ -385,24 +384,24 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
}
|
||||
|
||||
void
|
||||
mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
_mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
{
|
||||
MPR_PRINTFIELD_START(sc, "SAS Expander Page 1 #%d", buf->Phy);
|
||||
MPR_PRINTFIELD(sc, buf, PhysicalPort, %d);
|
||||
MPR_PRINTFIELD(sc, buf, NumPhys, %d);
|
||||
MPR_PRINTFIELD(sc, buf, Phy, %d);
|
||||
MPR_PRINTFIELD(sc, buf, NumTableEntriesProgrammed, %d);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "ProgrammedLinkRate: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_linkrate_names,
|
||||
(buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "HwLinkRate: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "HwLinkRate: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_linkrate_names,
|
||||
(buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate);
|
||||
MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "PhyInfo Reason: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_phyinfo_reason_names,
|
||||
(buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "AttachedDeviceInfo: %b,%s\n",
|
||||
mpr_print_field(sc, "AttachedDeviceInfo: %b,%s\n",
|
||||
buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit"
|
||||
"\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg"
|
||||
"\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev",
|
||||
@ -410,14 +409,14 @@ mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
buf->AttachedDeviceInfo & 0x03));
|
||||
MPR_PRINTFIELD(sc, buf, ExpanderDevHandle, 0x%04x);
|
||||
MPR_PRINTFIELD(sc, buf, ChangeCount, %d);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "NegotiatedLinkRate: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_linkrate_names,
|
||||
buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate);
|
||||
MPR_PRINTFIELD(sc, buf, PhyIdentifier, %d);
|
||||
MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
|
||||
MPR_PRINTFIELD(sc, buf, DiscoveryInfo, 0x%x);
|
||||
MPR_PRINTFIELD(sc, buf, AttachedPhyInfo, 0x%x);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_phyinfo_reason_names,
|
||||
buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
|
||||
MPR_PRINTFIELD(sc, buf, ZoneGroup, %d);
|
||||
@ -425,27 +424,27 @@ mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
}
|
||||
|
||||
void
|
||||
mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
|
||||
_mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
|
||||
{
|
||||
MPR_PRINTFIELD_START(sc, "SAS PHY Page 0");
|
||||
MPR_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x);
|
||||
MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x);
|
||||
MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_phyinfo_reason_names,
|
||||
buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "ProgrammedLinkRate: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_linkrate_names,
|
||||
(buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "HwLinkRate: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "HwLinkRate: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_linkrate_names,
|
||||
(buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate);
|
||||
MPR_PRINTFIELD(sc, buf, ChangeCount, %d);
|
||||
MPR_PRINTFIELD(sc, buf, Flags, 0x%x);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "PhyInfo Reason: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_phyinfo_reason_names,
|
||||
(buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
|
||||
mpr_dprint_field(sc, MPR_XINFO, "NegotiatedLinkRate: %s (0x%x)\n",
|
||||
mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n",
|
||||
mpr_describe_table(mpr_linkrate_names,
|
||||
buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate);
|
||||
}
|
||||
|
@ -41,13 +41,63 @@ extern struct mpr_table_lookup mpr_event_names[];
|
||||
extern struct mpr_table_lookup mpr_phystatus_names[];
|
||||
extern struct mpr_table_lookup mpr_linkrate_names[];
|
||||
|
||||
void mpr_print_iocfacts(struct mpr_softc *, MPI2_IOC_FACTS_REPLY *);
|
||||
void mpr_print_portfacts(struct mpr_softc *, MPI2_PORT_FACTS_REPLY *);
|
||||
void mpr_print_event(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
|
||||
void mpr_print_sasdev0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *);
|
||||
void mpr_print_evt_sas(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
|
||||
void mpr_print_expander1(struct mpr_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *);
|
||||
void mpr_print_sasphy0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *);
|
||||
void _mpr_print_iocfacts(struct mpr_softc *, MPI2_IOC_FACTS_REPLY *);
|
||||
void _mpr_print_portfacts(struct mpr_softc *, MPI2_PORT_FACTS_REPLY *);
|
||||
void _mpr_print_event(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
|
||||
void _mpr_print_sasdev0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *);
|
||||
void _mpr_print_evt_sas(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
|
||||
void _mpr_print_expander1(struct mpr_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *);
|
||||
void _mpr_print_sasphy0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *);
|
||||
void mpr_print_sgl(struct mpr_softc *, struct mpr_command *, int);
|
||||
void mpr_print_scsiio_cmd(struct mpr_softc *, struct mpr_command *);
|
||||
|
||||
static __inline void
|
||||
mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
{
|
||||
if (sc->mpr_debug & MPR_XINFO)
|
||||
_mpr_print_iocfacts(sc, facts);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
|
||||
{
|
||||
if (sc->mpr_debug & MPR_XINFO)
|
||||
_mpr_print_portfacts(sc, facts);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
{
|
||||
if (sc->mpr_debug & MPR_EVENT)
|
||||
_mpr_print_event(sc, event);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
{
|
||||
if (sc->mpr_debug & MPR_EVENT)
|
||||
_mpr_print_evt_sas(sc, event);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
{
|
||||
if (sc->mpr_debug & MPR_XINFO)
|
||||
_mpr_print_sasdev0(sc, buf);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
{
|
||||
if (sc->mpr_debug & MPR_XINFO)
|
||||
_mpr_print_expander1(sc, buf);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
|
||||
{
|
||||
if (sc->mpr_debug & MPR_XINFO)
|
||||
_mpr_print_sasphy0(sc, buf);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -584,6 +584,9 @@ mpr_unlock(struct mpr_softc *sc)
|
||||
#define mpr_printf(sc, args...) \
|
||||
device_printf((sc)->mpr_dev, ##args)
|
||||
|
||||
#define mpr_print_field(sc, msg, args...) \
|
||||
printf("\t" msg, ##args)
|
||||
|
||||
#define mpr_vprintf(sc, args...) \
|
||||
do { \
|
||||
if (bootverbose) \
|
||||
@ -596,25 +599,13 @@ do { \
|
||||
device_printf((sc)->mpr_dev, msg, ##args); \
|
||||
} while (0)
|
||||
|
||||
#define mpr_dprint_field(sc, level, msg, args...) \
|
||||
do { \
|
||||
if ((sc)->mpr_debug & (level)) \
|
||||
printf("\t" msg, ##args); \
|
||||
} while (0)
|
||||
|
||||
#define MPR_PRINTFIELD_START(sc, tag...) \
|
||||
mpr_dprint((sc), MPR_INFO, ##tag); \
|
||||
mpr_dprint_field((sc), MPR_INFO, ":\n")
|
||||
mpr_printf((sc), ##tag); \
|
||||
mpr_print_field((sc), ":\n")
|
||||
#define MPR_PRINTFIELD_END(sc, tag) \
|
||||
mpr_dprint((sc), MPR_INFO, tag "\n")
|
||||
mpr_printf((sc), tag "\n")
|
||||
#define MPR_PRINTFIELD(sc, facts, attr, fmt) \
|
||||
mpr_dprint_field((sc), MPR_INFO, #attr ": " #fmt "\n", (facts)->attr)
|
||||
|
||||
#define MPR_EVENTFIELD_START(sc, tag...) \
|
||||
mpr_dprint((sc), MPR_EVENT, ##tag); \
|
||||
mpr_dprint_field((sc), MPR_EVENT, ":\n")
|
||||
#define MPR_EVENTFIELD(sc, facts, attr, fmt) \
|
||||
mpr_dprint_field((sc), MPR_EVENT, #attr ": " #fmt "\n", (facts)->attr)
|
||||
mpr_print_field((sc), #attr ": " #fmt "\n", (facts)->attr)
|
||||
|
||||
static __inline void
|
||||
mpr_from_u64(uint64_t data, U64 *mpr)
|
||||
|
@ -347,7 +347,7 @@ mpssas_log_command(struct mps_command *cm, u_int level, const char *fmt, ...)
|
||||
sbuf_printf(&sb, "SMID %u ", cm->cm_desc.Default.SMID);
|
||||
sbuf_vprintf(&sb, fmt, ap);
|
||||
sbuf_finish(&sb);
|
||||
mps_dprint_field(cm->cm_sc, level, "%s", sbuf_data(&sb));
|
||||
mps_print_field(cm->cm_sc, "%s", sbuf_data(&sb));
|
||||
|
||||
va_end(ap);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ mps_describe_devinfo(uint32_t devinfo, char *string, int len)
|
||||
}
|
||||
|
||||
void
|
||||
mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
_mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
{
|
||||
|
||||
MPS_PRINTFIELD_START(sc, "IOCFacts");
|
||||
@ -205,18 +205,18 @@ mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
MPS_PRINTFIELD(sc, facts, IOCNumber, %d);
|
||||
MPS_PRINTFIELD(sc, facts, IOCExceptions, 0x%x);
|
||||
MPS_PRINTFIELD(sc, facts, MaxChainDepth, %d);
|
||||
mps_dprint_field(sc, MPS_XINFO, "WhoInit: %s\n",
|
||||
mps_print_field(sc, "WhoInit: %s\n",
|
||||
mps_describe_table(mps_whoinit_names, facts->WhoInit));
|
||||
MPS_PRINTFIELD(sc, facts, NumberOfPorts, %d);
|
||||
MPS_PRINTFIELD(sc, facts, MaxMSIxVectors, %d);
|
||||
MPS_PRINTFIELD(sc, facts, RequestCredit, %d);
|
||||
MPS_PRINTFIELD(sc, facts, ProductID, 0x%x);
|
||||
mps_dprint_field(sc, MPS_XINFO, "IOCCapabilities: %b\n",
|
||||
mps_print_field(sc, "IOCCapabilities: %b\n",
|
||||
facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace"
|
||||
"\5SnapBuf" "\6ExtBuf" "\7EEDP" "\10BiDirTarg" "\11Multicast"
|
||||
"\14TransRetry" "\15IR" "\16EventReplay" "\17RaidAccel"
|
||||
"\20MSIXIndex" "\21HostDisc");
|
||||
mps_dprint_field(sc, MPS_XINFO, "FWVersion= %d-%d-%d-%d\n",
|
||||
mps_print_field(sc, "FWVersion= %d-%d-%d-%d\n",
|
||||
facts->FWVersion.Struct.Major,
|
||||
facts->FWVersion.Struct.Minor,
|
||||
facts->FWVersion.Struct.Unit,
|
||||
@ -226,7 +226,7 @@ mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
MPS_PRINTFIELD(sc, facts, MaxTargets, %d);
|
||||
MPS_PRINTFIELD(sc, facts, MaxSasExpanders, %d);
|
||||
MPS_PRINTFIELD(sc, facts, MaxEnclosures, %d);
|
||||
mps_dprint_field(sc, MPS_XINFO, "ProtocolFlags: %b\n",
|
||||
mps_print_field(sc, "ProtocolFlags: %b\n",
|
||||
facts->ProtocolFlags, "\20" "\1ScsiTarg" "\2ScsiInit");
|
||||
MPS_PRINTFIELD(sc, facts, HighPriorityCredit, %d);
|
||||
MPS_PRINTFIELD(sc, facts, MaxReplyDescriptorPostQueueDepth, %d);
|
||||
@ -237,7 +237,7 @@ mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
}
|
||||
|
||||
void
|
||||
mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
|
||||
_mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
|
||||
{
|
||||
|
||||
MPS_PRINTFIELD_START(sc, "PortFacts");
|
||||
@ -247,24 +247,24 @@ mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
|
||||
}
|
||||
|
||||
void
|
||||
mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
_mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
{
|
||||
|
||||
MPS_EVENTFIELD_START(sc, "EventReply");
|
||||
MPS_EVENTFIELD(sc, event, EventDataLength, %d);
|
||||
MPS_EVENTFIELD(sc, event, AckRequired, %d);
|
||||
mps_dprint_field(sc, MPS_EVENT, "Event: %s (0x%x)\n",
|
||||
MPS_PRINTFIELD_START(sc, "EventReply");
|
||||
MPS_PRINTFIELD(sc, event, EventDataLength, %d);
|
||||
MPS_PRINTFIELD(sc, event, AckRequired, %d);
|
||||
mps_print_field(sc, "Event: %s (0x%x)\n",
|
||||
mps_describe_table(mps_event_names, event->Event), event->Event);
|
||||
MPS_EVENTFIELD(sc, event, EventContext, 0x%x);
|
||||
MPS_PRINTFIELD(sc, event, EventContext, 0x%x);
|
||||
}
|
||||
|
||||
void
|
||||
mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
_mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
{
|
||||
MPS_PRINTFIELD_START(sc, "SAS Device Page 0");
|
||||
MPS_PRINTFIELD(sc, buf, Slot, %d);
|
||||
MPS_PRINTFIELD(sc, buf, EnclosureHandle, 0x%x);
|
||||
mps_dprint_field(sc, MPS_XINFO, "SASAddress: 0x%jx\n",
|
||||
mps_print_field(sc, "SASAddress: 0x%jx\n",
|
||||
mps_to_u64(&buf->SASAddress));
|
||||
MPS_PRINTFIELD(sc, buf, ParentDevHandle, 0x%x);
|
||||
MPS_PRINTFIELD(sc, buf, PhyNum, %d);
|
||||
@ -272,7 +272,7 @@ mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
MPS_PRINTFIELD(sc, buf, DevHandle, 0x%x);
|
||||
MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x);
|
||||
MPS_PRINTFIELD(sc, buf, ZoneGroup, %d);
|
||||
mps_dprint_field(sc, MPS_XINFO, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
|
||||
mps_print_field(sc, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
|
||||
"\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit"
|
||||
"\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct"
|
||||
"\15LsiDev" "\16AtapiDev" "\17SepDev",
|
||||
@ -280,7 +280,7 @@ mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
MPS_PRINTFIELD(sc, buf, Flags, 0x%x);
|
||||
MPS_PRINTFIELD(sc, buf, PhysicalPort, %d);
|
||||
MPS_PRINTFIELD(sc, buf, MaxPortConnections, %d);
|
||||
mps_dprint_field(sc, MPS_XINFO, "DeviceName: 0x%jx\n",
|
||||
mps_print_field(sc, "DeviceName: 0x%jx\n",
|
||||
mps_to_u64(&buf->DeviceName));
|
||||
MPS_PRINTFIELD(sc, buf, PortGroups, %d);
|
||||
MPS_PRINTFIELD(sc, buf, DmaGroup, %d);
|
||||
@ -288,10 +288,10 @@ mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
}
|
||||
|
||||
void
|
||||
mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
_mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
{
|
||||
|
||||
mps_print_event(sc, event);
|
||||
_mps_print_event(sc, event);
|
||||
|
||||
switch(event->Event) {
|
||||
case MPI2_EVENT_SAS_DISCOVERY:
|
||||
@ -299,12 +299,12 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
MPI2_EVENT_DATA_SAS_DISCOVERY *data;
|
||||
|
||||
data = (MPI2_EVENT_DATA_SAS_DISCOVERY *)&event->EventData;
|
||||
mps_dprint_field(sc, MPS_EVENT, "Flags: %b\n", data->Flags,
|
||||
mps_print_field(sc, "Flags: %b\n", data->Flags,
|
||||
"\20" "\1InProgress" "\2DeviceChange");
|
||||
mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n",
|
||||
mps_print_field(sc, "ReasonCode: %s\n",
|
||||
mps_describe_table(mps_sasdisc_reason, data->ReasonCode));
|
||||
MPS_EVENTFIELD(sc, data, PhysicalPort, %d);
|
||||
mps_dprint_field(sc, MPS_EVENT, "DiscoveryStatus: %b\n",
|
||||
MPS_PRINTFIELD(sc, data, PhysicalPort, %d);
|
||||
mps_print_field(sc, "DiscoveryStatus: %b\n",
|
||||
data->DiscoveryStatus, "\20"
|
||||
"\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout"
|
||||
"\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed"
|
||||
@ -323,26 +323,26 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
|
||||
data = (MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST *)
|
||||
&event->EventData;
|
||||
MPS_EVENTFIELD(sc, data, EnclosureHandle, 0x%x);
|
||||
MPS_EVENTFIELD(sc, data, ExpanderDevHandle, 0x%x);
|
||||
MPS_EVENTFIELD(sc, data, NumPhys, %d);
|
||||
MPS_EVENTFIELD(sc, data, NumEntries, %d);
|
||||
MPS_EVENTFIELD(sc, data, StartPhyNum, %d);
|
||||
mps_dprint_field(sc, MPS_EVENT, "ExpStatus: %s (0x%x)\n",
|
||||
MPS_PRINTFIELD(sc, data, EnclosureHandle, 0x%x);
|
||||
MPS_PRINTFIELD(sc, data, ExpanderDevHandle, 0x%x);
|
||||
MPS_PRINTFIELD(sc, data, NumPhys, %d);
|
||||
MPS_PRINTFIELD(sc, data, NumEntries, %d);
|
||||
MPS_PRINTFIELD(sc, data, StartPhyNum, %d);
|
||||
mps_print_field(sc, "ExpStatus: %s (0x%x)\n",
|
||||
mps_describe_table(mps_sastopo_exp, data->ExpStatus),
|
||||
data->ExpStatus);
|
||||
MPS_EVENTFIELD(sc, data, PhysicalPort, %d);
|
||||
MPS_PRINTFIELD(sc, data, PhysicalPort, %d);
|
||||
for (i = 0; i < data->NumEntries; i++) {
|
||||
phy = &data->PHY[i];
|
||||
phynum = data->StartPhyNum + i;
|
||||
mps_dprint_field(sc, MPS_EVENT,
|
||||
mps_print_field(sc,
|
||||
"PHY[%d].AttachedDevHandle: 0x%04x\n", phynum,
|
||||
phy->AttachedDevHandle);
|
||||
mps_dprint_field(sc, MPS_EVENT,
|
||||
mps_print_field(sc,
|
||||
"PHY[%d].LinkRate: %s (0x%x)\n", phynum,
|
||||
mps_describe_table(mps_linkrate_names,
|
||||
(phy->LinkRate >> 4) & 0xf), phy->LinkRate);
|
||||
mps_dprint_field(sc,MPS_EVENT,"PHY[%d].PhyStatus: %s\n",
|
||||
mps_print_field(sc, "PHY[%d].PhyStatus: %s\n",
|
||||
phynum, mps_describe_table(mps_phystatus_names,
|
||||
phy->PhyStatus));
|
||||
}
|
||||
@ -354,13 +354,13 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
|
||||
data = (MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE *)
|
||||
&event->EventData;
|
||||
MPS_EVENTFIELD(sc, data, EnclosureHandle, 0x%x);
|
||||
mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n",
|
||||
MPS_PRINTFIELD(sc, data, EnclosureHandle, 0x%x);
|
||||
mps_print_field(sc, "ReasonCode: %s\n",
|
||||
mps_describe_table(mps_sastopo_exp, data->ReasonCode));
|
||||
MPS_EVENTFIELD(sc, data, PhysicalPort, %d);
|
||||
MPS_EVENTFIELD(sc, data, NumSlots, %d);
|
||||
MPS_EVENTFIELD(sc, data, StartSlot, %d);
|
||||
MPS_EVENTFIELD(sc, data, PhyBits, 0x%x);
|
||||
MPS_PRINTFIELD(sc, data, PhysicalPort, %d);
|
||||
MPS_PRINTFIELD(sc, data, NumSlots, %d);
|
||||
MPS_PRINTFIELD(sc, data, StartSlot, %d);
|
||||
MPS_PRINTFIELD(sc, data, PhyBits, 0x%x);
|
||||
break;
|
||||
}
|
||||
case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE:
|
||||
@ -369,13 +369,13 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
|
||||
data = (MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *)
|
||||
&event->EventData;
|
||||
MPS_EVENTFIELD(sc, data, TaskTag, 0x%x);
|
||||
mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n",
|
||||
MPS_PRINTFIELD(sc, data, TaskTag, 0x%x);
|
||||
mps_print_field(sc, "ReasonCode: %s\n",
|
||||
mps_describe_table(mps_sasdev_reason, data->ReasonCode));
|
||||
MPS_EVENTFIELD(sc, data, ASC, 0x%x);
|
||||
MPS_EVENTFIELD(sc, data, ASCQ, 0x%x);
|
||||
MPS_EVENTFIELD(sc, data, DevHandle, 0x%x);
|
||||
mps_dprint_field(sc, MPS_EVENT, "SASAddress: 0x%jx\n",
|
||||
MPS_PRINTFIELD(sc, data, ASC, 0x%x);
|
||||
MPS_PRINTFIELD(sc, data, ASCQ, 0x%x);
|
||||
MPS_PRINTFIELD(sc, data, DevHandle, 0x%x);
|
||||
mps_print_field(sc, "SASAddress: 0x%jx\n",
|
||||
mps_to_u64(&data->SASAddress));
|
||||
}
|
||||
default:
|
||||
@ -384,24 +384,24 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
}
|
||||
|
||||
void
|
||||
mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
_mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
{
|
||||
MPS_PRINTFIELD_START(sc, "SAS Expander Page 1 #%d", buf->Phy);
|
||||
MPS_PRINTFIELD(sc, buf, PhysicalPort, %d);
|
||||
MPS_PRINTFIELD(sc, buf, NumPhys, %d);
|
||||
MPS_PRINTFIELD(sc, buf, Phy, %d);
|
||||
MPS_PRINTFIELD(sc, buf, NumTableEntriesProgrammed, %d);
|
||||
mps_dprint_field(sc, MPS_XINFO, "ProgrammedLinkRate: %s (0x%x)\n",
|
||||
mps_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n",
|
||||
mps_describe_table(mps_linkrate_names,
|
||||
(buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate);
|
||||
mps_dprint_field(sc, MPS_XINFO, "HwLinkRate: %s (0x%x)\n",
|
||||
mps_print_field(sc, "HwLinkRate: %s (0x%x)\n",
|
||||
mps_describe_table(mps_linkrate_names,
|
||||
(buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate);
|
||||
MPS_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x);
|
||||
mps_dprint_field(sc, MPS_XINFO, "PhyInfo Reason: %s (0x%x)\n",
|
||||
mps_print_field(sc, "PhyInfo Reason: %s (0x%x)\n",
|
||||
mps_describe_table(mps_phyinfo_reason_names,
|
||||
(buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
|
||||
mps_dprint_field(sc, MPS_XINFO, "AttachedDeviceInfo: %b,%s\n",
|
||||
mps_print_field(sc, "AttachedDeviceInfo: %b,%s\n",
|
||||
buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit"
|
||||
"\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg"
|
||||
"\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev",
|
||||
@ -409,14 +409,14 @@ mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
buf->AttachedDeviceInfo & 0x03));
|
||||
MPS_PRINTFIELD(sc, buf, ExpanderDevHandle, 0x%04x);
|
||||
MPS_PRINTFIELD(sc, buf, ChangeCount, %d);
|
||||
mps_dprint_field(sc, MPS_XINFO, "NegotiatedLinkRate: %s (0x%x)\n",
|
||||
mps_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n",
|
||||
mps_describe_table(mps_linkrate_names,
|
||||
buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate);
|
||||
MPS_PRINTFIELD(sc, buf, PhyIdentifier, %d);
|
||||
MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
|
||||
MPS_PRINTFIELD(sc, buf, DiscoveryInfo, 0x%x);
|
||||
MPS_PRINTFIELD(sc, buf, AttachedPhyInfo, 0x%x);
|
||||
mps_dprint_field(sc, MPS_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
|
||||
mps_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n",
|
||||
mps_describe_table(mps_phyinfo_reason_names,
|
||||
buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
|
||||
MPS_PRINTFIELD(sc, buf, ZoneGroup, %d);
|
||||
@ -424,27 +424,27 @@ mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
}
|
||||
|
||||
void
|
||||
mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
|
||||
_mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
|
||||
{
|
||||
MPS_PRINTFIELD_START(sc, "SAS PHY Page 0");
|
||||
MPS_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x);
|
||||
MPS_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x);
|
||||
MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
|
||||
mps_dprint_field(sc, MPS_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
|
||||
mps_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n",
|
||||
mps_describe_table(mps_phyinfo_reason_names,
|
||||
buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
|
||||
mps_dprint_field(sc, MPS_XINFO, "ProgrammedLinkRate: %s (0x%x)\n",
|
||||
mps_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n",
|
||||
mps_describe_table(mps_linkrate_names,
|
||||
(buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate);
|
||||
mps_dprint_field(sc, MPS_XINFO, "HwLinkRate: %s (0x%x)\n",
|
||||
mps_print_field(sc, "HwLinkRate: %s (0x%x)\n",
|
||||
mps_describe_table(mps_linkrate_names,
|
||||
(buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate);
|
||||
MPS_PRINTFIELD(sc, buf, ChangeCount, %d);
|
||||
MPS_PRINTFIELD(sc, buf, Flags, 0x%x);
|
||||
mps_dprint_field(sc, MPS_XINFO, "PhyInfo Reason: %s (0x%x)\n",
|
||||
mps_print_field(sc, "PhyInfo Reason: %s (0x%x)\n",
|
||||
mps_describe_table(mps_phyinfo_reason_names,
|
||||
(buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
|
||||
mps_dprint_field(sc, MPS_XINFO, "NegotiatedLinkRate: %s (0x%x)\n",
|
||||
mps_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n",
|
||||
mps_describe_table(mps_linkrate_names,
|
||||
buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate);
|
||||
}
|
||||
|
@ -41,13 +41,63 @@ extern struct mps_table_lookup mps_event_names[];
|
||||
extern struct mps_table_lookup mps_phystatus_names[];
|
||||
extern struct mps_table_lookup mps_linkrate_names[];
|
||||
|
||||
void mps_print_iocfacts(struct mps_softc *, MPI2_IOC_FACTS_REPLY *);
|
||||
void mps_print_portfacts(struct mps_softc *, MPI2_PORT_FACTS_REPLY *);
|
||||
void mps_print_event(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
|
||||
void mps_print_sasdev0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *);
|
||||
void mps_print_evt_sas(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
|
||||
void mps_print_expander1(struct mps_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *);
|
||||
void mps_print_sasphy0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *);
|
||||
void _mps_print_iocfacts(struct mps_softc *, MPI2_IOC_FACTS_REPLY *);
|
||||
void _mps_print_portfacts(struct mps_softc *, MPI2_PORT_FACTS_REPLY *);
|
||||
void _mps_print_event(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
|
||||
void _mps_print_sasdev0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *);
|
||||
void _mps_print_evt_sas(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
|
||||
void _mps_print_expander1(struct mps_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *);
|
||||
void _mps_print_sasphy0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *);
|
||||
void mps_print_sgl(struct mps_softc *, struct mps_command *, int);
|
||||
void mps_print_scsiio_cmd(struct mps_softc *, struct mps_command *);
|
||||
|
||||
static __inline void
|
||||
mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
|
||||
{
|
||||
if (sc->mps_debug & MPS_XINFO)
|
||||
_mps_print_iocfacts(sc, facts);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
|
||||
{
|
||||
if (sc->mps_debug & MPS_XINFO)
|
||||
_mps_print_portfacts(sc, facts);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
{
|
||||
if (sc->mps_debug & MPS_EVENT)
|
||||
_mps_print_event(sc, event);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
|
||||
{
|
||||
if (sc->mps_debug & MPS_XINFO)
|
||||
_mps_print_sasdev0(sc, buf);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
|
||||
{
|
||||
if (sc->mps_debug & MPS_EVENT)
|
||||
_mps_print_evt_sas(sc, event);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
|
||||
{
|
||||
if (sc->mps_debug & MPS_XINFO)
|
||||
_mps_print_expander1(sc, buf);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
|
||||
{
|
||||
if (sc->mps_debug & MPS_XINFO)
|
||||
_mps_print_sasphy0(sc, buf);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -609,6 +609,9 @@ mps_unlock(struct mps_softc *sc)
|
||||
#define mps_printf(sc, args...) \
|
||||
device_printf((sc)->mps_dev, ##args)
|
||||
|
||||
#define mps_print_field(sc, msg, args...) \
|
||||
printf("\t" msg, ##args)
|
||||
|
||||
#define mps_vprintf(sc, args...) \
|
||||
do { \
|
||||
if (bootverbose) \
|
||||
@ -621,25 +624,13 @@ do { \
|
||||
device_printf((sc)->mps_dev, msg, ##args); \
|
||||
} while (0)
|
||||
|
||||
#define mps_dprint_field(sc, level, msg, args...) \
|
||||
do { \
|
||||
if ((sc)->mps_debug & (level)) \
|
||||
printf("\t" msg, ##args); \
|
||||
} while (0)
|
||||
|
||||
#define MPS_PRINTFIELD_START(sc, tag...) \
|
||||
mps_dprint((sc), MPS_XINFO, ##tag); \
|
||||
mps_dprint_field((sc), MPS_XINFO, ":\n")
|
||||
mps_printf((sc), ##tag); \
|
||||
mps_print_field((sc), ":\n")
|
||||
#define MPS_PRINTFIELD_END(sc, tag) \
|
||||
mps_dprint((sc), MPS_XINFO, tag "\n")
|
||||
mps_printf((sc), tag "\n")
|
||||
#define MPS_PRINTFIELD(sc, facts, attr, fmt) \
|
||||
mps_dprint_field((sc), MPS_XINFO, #attr ": " #fmt "\n", (facts)->attr)
|
||||
|
||||
#define MPS_EVENTFIELD_START(sc, tag...) \
|
||||
mps_dprint((sc), MPS_EVENT, ##tag); \
|
||||
mps_dprint_field((sc), MPS_EVENT, ":\n")
|
||||
#define MPS_EVENTFIELD(sc, facts, attr, fmt) \
|
||||
mps_dprint_field((sc), MPS_EVENT, #attr ": " #fmt "\n", (facts)->attr)
|
||||
mps_print_field((sc), #attr ": " #fmt "\n", (facts)->attr)
|
||||
|
||||
#define MPS_FUNCTRACE(sc) \
|
||||
mps_dprint((sc), MPS_TRACE, "%s\n", __func__)
|
||||
|
Loading…
Reference in New Issue
Block a user