From 2e37a126e1bacd2fb2459da5bb80c95e1124885e Mon Sep 17 00:00:00 2001 From: mjacob Date: Mon, 23 Sep 2002 05:14:02 +0000 Subject: 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 --- sys/dev/mpt/mpt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev') 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; -- cgit v1.1