ispvar.h (92893) | ispvar.h (93706) |
---|---|
1/* $FreeBSD: head/sys/dev/isp/ispvar.h 92893 2002-03-21 21:10:16Z mjacob $ */ | 1/* $FreeBSD: head/sys/dev/isp/ispvar.h 93706 2002-04-02 23:36:14Z mjacob $ */ |
2/* 3 * Soft Definitions for for Qlogic ISP SCSI adapters. 4 * 5 * Copyright (c) 1997, 1998, 1999, 2000 by Matthew Jacob 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 134 unchanged lines hidden (view full) --- 144/* 145 * Request/Response Queue defines and macros. 146 * The maximum is defined per platform (and can be based on board type). 147 */ 148/* This is the size of a queue entry (request and response) */ 149#define QENTRY_LEN 64 150/* Both request and result queue length must be a power of two */ 151#define RQUEST_QUEUE_LEN(x) MAXISPREQUEST(x) | 2/* 3 * Soft Definitions for for Qlogic ISP SCSI adapters. 4 * 5 * Copyright (c) 1997, 1998, 1999, 2000 by Matthew Jacob 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 134 unchanged lines hidden (view full) --- 144/* 145 * Request/Response Queue defines and macros. 146 * The maximum is defined per platform (and can be based on board type). 147 */ 148/* This is the size of a queue entry (request and response) */ 149#define QENTRY_LEN 64 150/* Both request and result queue length must be a power of two */ 151#define RQUEST_QUEUE_LEN(x) MAXISPREQUEST(x) |
152#ifdef ISP_TARGET_MODE 153#define RESULT_QUEUE_LEN(x) MAXISPREQUEST(x) 154#else |
|
152#define RESULT_QUEUE_LEN(x) \ 153 (((MAXISPREQUEST(x) >> 2) < 64)? 64 : MAXISPREQUEST(x) >> 2) | 155#define RESULT_QUEUE_LEN(x) \ 156 (((MAXISPREQUEST(x) >> 2) < 64)? 64 : MAXISPREQUEST(x) >> 2) |
157#endif |
|
154#define ISP_QUEUE_ENTRY(q, idx) ((q) + ((idx) * QENTRY_LEN)) 155#define ISP_QUEUE_SIZE(n) ((n) * QENTRY_LEN) 156#define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1)) 157#define ISP_QFREE(in, out, qlen) \ 158 ((in == out)? (qlen - 1) : ((in > out)? \ 159 ((qlen - 1) - (in - out)) : (out - in - 1))) 160#define ISP_QAVAIL(isp) \ 161 ISP_QFREE(isp->isp_reqidx, isp->isp_reqodx, RQUEST_QUEUE_LEN(isp)) --- 710 unchanged lines hidden --- | 158#define ISP_QUEUE_ENTRY(q, idx) ((q) + ((idx) * QENTRY_LEN)) 159#define ISP_QUEUE_SIZE(n) ((n) * QENTRY_LEN) 160#define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1)) 161#define ISP_QFREE(in, out, qlen) \ 162 ((in == out)? (qlen - 1) : ((in > out)? \ 163 ((qlen - 1) - (in - out)) : (out - in - 1))) 164#define ISP_QAVAIL(isp) \ 165 ISP_QFREE(isp->isp_reqidx, isp->isp_reqodx, RQUEST_QUEUE_LEN(isp)) --- 710 unchanged lines hidden --- |