diff options
author | mav <mav@FreeBSD.org> | 2015-12-30 11:49:48 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-12-30 11:49:48 +0000 |
commit | a4b1c16e98e75f90d54e9dbd7a1fdb698da68539 (patch) | |
tree | 0fcf27a59b01a01e813ba2caf1be603f648ddbb9 /sys/dev/isp/isp.c | |
parent | d4b9f20402a6d7261e6e6d8ea2ea402a189c08d8 (diff) | |
download | FreeBSD-src-a4b1c16e98e75f90d54e9dbd7a1fdb698da68539.zip FreeBSD-src-a4b1c16e98e75f90d54e9dbd7a1fdb698da68539.tar.gz |
MFC r292725: Unify handles allocation for initiator and target IOCBs.
I am not sure why this was split long ago, but I see no reason for it.
At this point this unification just slightly reduces memory usage, but
as next step I plan to reuse shared handle space for other IOCB types.
Diffstat (limited to 'sys/dev/isp/isp.c')
-rw-r--r-- | sys/dev/isp/isp.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c index 4f29cb0..66eff1e 100644 --- a/sys/dev/isp/isp.c +++ b/sys/dev/isp/isp.c @@ -4269,7 +4269,7 @@ int isp_start(XS_T *xs) { ispsoftc_t *isp; - uint32_t handle, cdblen; + uint32_t cdblen; uint8_t local[QENTRY_LEN]; ispreq_t *reqp; void *cdbp, *qep; @@ -4565,13 +4565,13 @@ isp_start(XS_T *xs) *tptr = 0x1999; } - if (isp_allocate_xs(isp, xs, &handle)) { + /* Whew. Thankfully the same for type 7 requests */ + reqp->req_handle = isp_allocate_handle(isp, xs, ISP_HANDLE_INITIATOR); + if (reqp->req_handle == 0) { isp_prt(isp, ISP_LOG_WARN1, "out of xflist pointers"); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); } - /* Whew. Thankfully the same for type 7 requests */ - reqp->req_handle = handle; /* * Set up DMA and/or do any platform dependent swizzling of the request entry @@ -4581,7 +4581,7 @@ isp_start(XS_T *xs) */ dmaresult = ISP_DMASETUP(isp, xs, reqp); if (dmaresult != CMD_QUEUED) { - isp_destroy_handle(isp, handle); + isp_destroy_handle(isp, reqp->req_handle); /* * dmasetup sets actual error in packet, and * return what we were given to return. @@ -5310,12 +5310,6 @@ again: } } - if (!ISP_VALID_HANDLE(isp, sp->req_handle)) { - isp_prt(isp, ISP_LOGERR, "bad request handle 0x%x (iocb type 0x%x)", sp->req_handle, etype); - ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ - last_etype = etype; - continue; - } xs = isp_find_xs(isp, sp->req_handle); if (xs == NULL) { uint8_t ts = completion_status & 0xff; |