summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2002-09-23 05:14:02 +0000
committermjacob <mjacob@FreeBSD.org>2002-09-23 05:14:02 +0000
commit2e37a126e1bacd2fb2459da5bb80c95e1124885e (patch)
treef4163c7687d0686d5b68f1aadf9a948da0dc131c /sys/dev
parentfaa33a651885e5fdfb349cbdddc454131448135b (diff)
downloadFreeBSD-src-2e37a126e1bacd2fb2459da5bb80c95e1124885e.zip
FreeBSD-src-2e37a126e1bacd2fb2459da5bb80c95e1124885e.tar.gz
When freeing a request, zero out the sequence number.
Define the CFG_DAGA_OFF offset as 128 bytes instead of 40- gives us a more reasonable headroom. When reading a config page, zero out the entire request area- not just the length of the request. This is because we cleverly (cheezily) return configuration data back into the allocated request area, so it's nice to make sure we start with a clean area to write on. MFC after: 1 week
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/mpt/mpt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/mpt/mpt.c b/sys/dev/mpt/mpt.c
index 7009a36..925fef6 100644
--- a/sys/dev/mpt/mpt.c
+++ b/sys/dev/mpt/mpt.c
@@ -231,6 +231,7 @@ mpt_free_request(mpt_softc_t *mpt, request_t *req)
panic("mpt_free_request bad req ptr\n");
return;
}
+ req->sequence = 0;
req->ccb = NULL;
req->debug = REQ_FREE;
SLIST_INSERT_HEAD(&mpt->request_free_list, req, link);
@@ -559,7 +560,7 @@ mpt_read_cfg_header(mpt_softc_t *mpt, int PageType, int PageNumber,
return (0);
}
-#define CFG_DATA_OFF 40
+#define CFG_DATA_OFF 128
int
mpt_read_cfg_page(mpt_softc_t *mpt, int PageAddress, fCONFIG_PAGE_HEADER *hdr)
@@ -575,7 +576,7 @@ mpt_read_cfg_page(mpt_softc_t *mpt, int PageAddress, fCONFIG_PAGE_HEADER *hdr)
cfgp = req->req_vbuf;
amt = (cfgp->Header.PageLength * sizeof (uint32_t));
- bzero(cfgp, sizeof *cfgp);
+ bzero(cfgp, MPT_REQUEST_AREA);
cfgp->Action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
cfgp->Function = MPI_FUNCTION_CONFIG;
cfgp->Header = *hdr;
OpenPOWER on IntegriCloud