Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mps/mps.c
Context not available. | |||||
rd.u.high = cm->cm_desc.Words.High; | rd.u.high = cm->cm_desc.Words.High; | ||||
rd.word = htole64(rd.word); | rd.word = htole64(rd.word); | ||||
KASSERT(cm->cm_state == MPS_CM_STATE_BUSY, ("command not busy\n")); | KASSERT(cm->cm_state == MPS_CM_STATE_BUSY, | ||||
("command not busy, state = %u\n", cm->cm_state)); | |||||
cm->cm_state = MPS_CM_STATE_INQUEUE; | cm->cm_state = MPS_CM_STATE_INQUEUE; | ||||
/* TODO-We may need to make below regwrite atomic */ | /* TODO-We may need to make below regwrite atomic */ | ||||
Context not available. | |||||
sc, 0, mps_dump_reqs, "I", "Dump Active Requests"); | sc, 0, mps_dump_reqs, "I", "Dump Active Requests"); | ||||
SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), | SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), | ||||
OID_AUTO, "dump_reqs_alltypes", CTLFLAG_RW, | |||||
&sc->dump_reqs_alltypes, 0, | |||||
"dump all request types not just inqueue"); | |||||
SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), | |||||
OID_AUTO, "use_phy_num", CTLFLAG_RD, &sc->use_phynum, 0, | OID_AUTO, "use_phy_num", CTLFLAG_RD, &sc->use_phynum, 0, | ||||
"Use the phy number for enumeration"); | "Use the phy number for enumeration"); | ||||
} | } | ||||
Context not available. | |||||
/* Best effort, no locking */ | /* Best effort, no locking */ | ||||
for (i = smid; i < numreqs; i++) { | for (i = smid; i < numreqs; i++) { | ||||
cm = &sc->commands[i]; | cm = &sc->commands[i]; | ||||
if (cm->cm_state != state) | if ((sc->dump_reqs_alltypes == 0) && (cm->cm_state != state)) | ||||
continue; | continue; | ||||
hdr.smid = i; | hdr.smid = i; | ||||
hdr.state = cm->cm_state; | hdr.state = cm->cm_state; | ||||
Context not available. | |||||
return; | return; | ||||
} | } | ||||
KASSERT(cm->cm_state == MPS_CM_STATE_INQUEUE, | |||||
("command not inqueue, state = %u\n", cm->cm_state)); | |||||
cm->cm_state = MPS_CM_STATE_BUSY; | |||||
if (cm->cm_flags & MPS_CM_FLAGS_POLLED) | if (cm->cm_flags & MPS_CM_FLAGS_POLLED) | ||||
cm->cm_flags |= MPS_CM_FLAGS_COMPLETE; | cm->cm_flags |= MPS_CM_FLAGS_COMPLETE; | ||||
Context not available. | |||||
switch (flags) { | switch (flags) { | ||||
case MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS: | case MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS: | ||||
cm = &sc->commands[le16toh(desc->SCSIIOSuccess.SMID)]; | cm = &sc->commands[le16toh(desc->SCSIIOSuccess.SMID)]; | ||||
KASSERT(cm->cm_state == MPS_CM_STATE_INQUEUE, | |||||
("command not inqueue\n")); | |||||
cm->cm_state = MPS_CM_STATE_BUSY; | |||||
cm->cm_reply = NULL; | cm->cm_reply = NULL; | ||||
break; | break; | ||||
case MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY: | case MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY: | ||||
Context not available. | |||||
cm = &sc->commands[ | cm = &sc->commands[ | ||||
le16toh(desc->AddressReply.SMID)]; | le16toh(desc->AddressReply.SMID)]; | ||||
if (cm->cm_state == MPS_CM_STATE_INQUEUE) { | if (cm->cm_state == MPS_CM_STATE_INQUEUE) { | ||||
cm->cm_state = MPS_CM_STATE_BUSY; | |||||
cm->cm_reply = reply; | cm->cm_reply = reply; | ||||
cm->cm_reply_data = le32toh( | cm->cm_reply_data = le32toh( | ||||
desc->AddressReply.ReplyFrameAddress); | desc->AddressReply.ReplyFrameAddress); | ||||
Context not available. |