Add an isp_handle_index function- this is prepatory to loading more into
the handle (i.e., generation number), so we will now need a function that will take a handle and return a flat index [ 0 .. maxhandles-1 ] for auxillary routines that need an index to get at buddy store values (like dma maps or xflist pointers).
This commit is contained in:
parent
1b27bb998b
commit
4e3ffc160e
@ -171,6 +171,9 @@ isp_find_xs __P((struct ispsoftc *, u_int32_t));
|
||||
static INLINE u_int32_t
|
||||
isp_find_handle __P((struct ispsoftc *, ISP_SCSI_XFER_T *));
|
||||
|
||||
static INLINE int
|
||||
isp_handle_index __P((u_int32_t));
|
||||
|
||||
static INLINE void
|
||||
isp_destroy_handle __P((struct ispsoftc *, u_int32_t));
|
||||
|
||||
@ -232,13 +235,20 @@ isp_find_handle(isp, xs)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static INLINE int
|
||||
isp_handle_index(handle)
|
||||
u_int32_t handle;
|
||||
{
|
||||
return (handle-1);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
isp_destroy_handle(isp, handle)
|
||||
struct ispsoftc *isp;
|
||||
u_int32_t handle;
|
||||
{
|
||||
if (handle > 0 && handle <= (u_int32_t) isp->isp_maxcmds) {
|
||||
isp->isp_xflist[handle - 1] = NULL;
|
||||
isp->isp_xflist[isp_handle_index(handle)] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,8 +279,10 @@ isp_getrqentry(isp, iptrp, optrp, resultp)
|
||||
if (iptr == optr) {
|
||||
return (1);
|
||||
}
|
||||
*optrp = optr;
|
||||
*iptrp = iptr;
|
||||
if (optrp)
|
||||
*optrp = optr;
|
||||
if (iptrp)
|
||||
*iptrp = iptr;
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user