aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mfi
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2006-03-28 23:59:07 +0000
committerScott Long <scottl@FreeBSD.org>2006-03-28 23:59:07 +0000
commitaab582690e98ea305ee08e6bcd5727bc0cffcd61 (patch)
treea28b38e001b629c826194e7a5dba7a1f81bbdefc /sys/dev/mfi
parent6b2c15da6a35c2af09e7e753ffc3f527d402a2cf (diff)
Notes
Diffstat (limited to 'sys/dev/mfi')
-rw-r--r--sys/dev/mfi/mfi.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index 064252ea8be2..073a0f5d62d9 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -250,7 +250,7 @@ mfi_attach(struct mfi_softc *sc)
sc->mfi_sgsize = sizeof(struct mfi_sg64);
sc->mfi_flags |= MFI_FLAGS_SG64;
} else {
- sc->mfi_sgsize = sizeof(struct mfi_sg64);
+ sc->mfi_sgsize = sizeof(struct mfi_sg32);
}
frames = (sc->mfi_sgsize * sc->mfi_total_sgl + MFI_FRAME_SIZE - 1) /
MFI_FRAME_SIZE + 1;
@@ -1074,6 +1074,7 @@ mfi_data_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
{
struct mfi_frame_header *hdr;
struct mfi_command *cm;
+ union mfi_sgl *sgl;
struct mfi_softc *sc;
int i, dir;
@@ -1082,17 +1083,20 @@ mfi_data_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
cm = (struct mfi_command *)arg;
sc = cm->cm_sc;
- hdr = (struct mfi_frame_header *)cm->cm_frame;
+ hdr = &cm->cm_frame->header;
+ sgl = cm->cm_sg;
- for (i = 0; i < nsegs; i++) {
- if ((cm->cm_flags & MFI_FLAGS_SG64) == 0) {
- cm->cm_sg->sg32[i].addr = segs[i].ds_addr;
- cm->cm_sg->sg32[i].len = segs[i].ds_len;
- } else {
- cm->cm_sg->sg64[i].addr = segs[i].ds_addr;
- cm->cm_sg->sg64[i].len = segs[i].ds_len;
- hdr->flags |= MFI_FRAME_SGL64;
+ if ((sc->mfi_flags & MFI_FLAGS_SG64) == 0) {
+ for (i = 0; i < nsegs; i++) {
+ sgl->sg32[i].addr = segs[i].ds_addr;
+ sgl->sg32[i].len = segs[i].ds_len;
+ }
+ } else {
+ for (i = 0; i < nsegs; i++) {
+ sgl->sg64[i].addr = segs[i].ds_addr;
+ sgl->sg64[i].len = segs[i].ds_len;
}
+ hdr->flags |= MFI_FRAME_SGL64;
}
hdr->sg_count = nsegs;