summaryrefslogtreecommitdiffstats
path: root/sys/dev/mps/mps_table.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2012-08-01 17:31:31 +0000
committermav <mav@FreeBSD.org>2012-08-01 17:31:31 +0000
commitd35997f97e5bca6ac7e1dffebc4f7bc0bf4a168e (patch)
tree79e17377a681fc12123cfa9b9acf9d7ba8fdaf18 /sys/dev/mps/mps_table.c
parent58f7ae85c74dabb278901c6e1c4afae9578733f2 (diff)
downloadFreeBSD-src-d35997f97e5bca6ac7e1dffebc4f7bc0bf4a168e.zip
FreeBSD-src-d35997f97e5bca6ac7e1dffebc4f7bc0bf4a168e.tar.gz
Several fixes to allow firmware/BIOS flash access from user-level:
- remove special handling of zero length transfers in mpi_pre_fw_upload(); - add missing MPS_CM_FLAGS_DATAIN flag in mpi_pre_fw_upload(); - move mps_user_setup_request() call into proper place; - increase user command timeout from 30 to 60 seconds; - avoid NULL dereference panic in case of firmware crash. Set max DMA segment size to 24bit, as MPI SGE supports it. Use mps_add_dmaseg() to add empty SGE instead of custom code. Tune endianness safety. Reviewed by: Desai, Kashyap <Kashyap.Desai@lsi.com> Sponsored by: iXsystems, Inc.
Diffstat (limited to 'sys/dev/mps/mps_table.c')
-rw-r--r--sys/dev/mps/mps_table.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/mps/mps_table.c b/sys/dev/mps/mps_table.c
index c9acefe..e004f8d 100644
--- a/sys/dev/mps/mps_table.c
+++ b/sys/dev/mps/mps_table.c
@@ -463,10 +463,12 @@ mps_print_sgl(struct mps_softc *sc, struct mps_command *cm, int offset)
sge = (MPI2_SGE_SIMPLE64 *)&frame[offset * 4];
printf("SGL for command %p\n", cm);
+ hexdump(frame, 128, NULL, 0);
while (frame != NULL) {
- flags = sge->FlagsLength >> MPI2_SGE_FLAGS_SHIFT;
- printf("seg%d flags=0x%x len=0x%x addr=0x%jx\n", i, flags,
- sge->FlagsLength & 0xffffff, mps_to_u64(&sge->Address));
+ flags = le32toh(sge->FlagsLength) >> MPI2_SGE_FLAGS_SHIFT;
+ printf("seg%d flags=0x%02x len=0x%06x addr=0x%016jx\n",
+ i, flags, le32toh(sge->FlagsLength) & 0xffffff,
+ mps_to_u64(&sge->Address));
if (flags & (MPI2_SGE_FLAGS_END_OF_LIST |
MPI2_SGE_FLAGS_END_OF_BUFFER))
break;
@@ -475,8 +477,8 @@ mps_print_sgl(struct mps_softc *sc, struct mps_command *cm, int offset)
if (flags & MPI2_SGE_FLAGS_LAST_ELEMENT) {
sgc = (MPI2_SGE_CHAIN32 *)sge;
printf("chain flags=0x%x len=0x%x Offset=0x%x "
- "Address=0x%x\n", sgc->Flags, sgc->Length,
- sgc->NextChainOffset, sgc->Address);
+ "Address=0x%x\n", sgc->Flags, le16toh(sgc->Length),
+ sgc->NextChainOffset, le32toh(sgc->Address));
if (chain == NULL)
chain = TAILQ_FIRST(&cm->cm_chain_list);
else
OpenPOWER on IntegriCloud