summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_freebsd.h
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2002-07-08 17:42:47 +0000
committermjacob <mjacob@FreeBSD.org>2002-07-08 17:42:47 +0000
commit7f6b47ac1c653b5baa754573215667de7e29a82f (patch)
tree88c8e0758724683d755a45b6720f0427dc53d249 /sys/dev/isp/isp_freebsd.h
parent890e899899b74f5cd32d29b42135bf0489595d7e (diff)
downloadFreeBSD-src-7f6b47ac1c653b5baa754573215667de7e29a82f.zip
FreeBSD-src-7f6b47ac1c653b5baa754573215667de7e29a82f.tar.gz
Add get/set param ioctl support.
Remove sim queue freezes for resource shortages. I've had too many strange race conditions where I freeze on a resource shortage but never get unfrozen. Consolidate the remaining sim queue freeze condition (for loopdown) into an inline with debug messages that allows us to track problems at ISP_LOGDEBUG0 level easier. Change a bunch of debug messages about loop down/up conditions to ISP_LOGDEBUG0 level. Remove dead isp_relsim code. Change some internal flag stuff for efficiency. Complain vociferously if we try and use our FC scratch area while it's busy being used already (I mean, if we don't have solaris' ability to sleep as an interrupt thread which would allow us to just use a p/v semaphore, at least *say* when you've just borked yourself). Add infrastructure to allow overrides of hard loopid && initiator id from boot variables. Fix the usual quota of silly bugs: + 'ktmature' needs to be per-instance. Argh. + When entering isp_watchdog, set intsok to zero, preserving old value to restore later. It's not nice to try and sleep from splsoftclock. + Fix tick overflow buglet in checking timeout value. MFC after: 1 week
Diffstat (limited to 'sys/dev/isp/isp_freebsd.h')
-rw-r--r--sys/dev/isp/isp_freebsd.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h
index 903df0f..22943f6 100644
--- a/sys/dev/isp/isp_freebsd.h
+++ b/sys/dev/isp/isp_freebsd.h
@@ -113,16 +113,19 @@ struct isposinfo {
struct ispsoftc * next;
u_int64_t default_port_wwn;
u_int64_t default_node_wwn;
+ u_int32_t default_id;
device_t dev;
struct cam_sim *sim;
struct cam_path *path;
struct cam_sim *sim2;
struct cam_path *path2;
struct intr_config_hook ehook;
- u_int8_t mboxwaiting;
- u_int8_t simqfrozen;
- u_int8_t drain;
- u_int8_t intsok;
+ u_int8_t : 1,
+ fcbsy : 1,
+ ktmature : 1,
+ mboxwaiting : 1,
+ intsok : 1,
+ simqfrozen : 3;
struct mtx lock;
struct cv kthread_cv;
struct proc *kproc;
@@ -184,7 +187,7 @@ struct isposinfo {
#define GET_NANOSEC(x) ((x)->tv_sec * 1000000000 + (x)->tv_nsec)
#define NANOTIME_SUB nanotime_sub
-#define MAXISPREQUEST(isp) 256
+#define MAXISPREQUEST(isp) ((IS_FC(isp) || IS_ULTRA2(isp))? 1024 : 256)
#define MEMORYBARRIER(isp, type, offset, size) \
switch (type) { \
@@ -207,13 +210,18 @@ default: \
#define MBOX_NOTIFY_COMPLETE(isp) \
if (isp->isp_osinfo.mboxwaiting) { \
isp->isp_osinfo.mboxwaiting = 0; \
- wakeup(&isp->isp_osinfo.mboxwaiting); \
+ wakeup(&isp->isp_mbxworkp); \
} \
isp->isp_mboxbsy = 0
#define MBOX_RELEASE(isp)
-#define FC_SCRATCH_ACQUIRE(isp)
-#define FC_SCRATCH_RELEASE(isp)
+#define FC_SCRATCH_ACQUIRE(isp) \
+ if (isp->isp_osinfo.fcbsy) { \
+ isp_prt(isp, ISP_LOGWARN, \
+ "FC scratch area busy (line %d)!", __LINE__); \
+ } else \
+ isp->isp_osinfo.fcbsy = 1
+#define FC_SCRATCH_RELEASE(isp) isp->isp_osinfo.fcbsy = 0
#ifndef SCSI_GOOD
#define SCSI_GOOD SCSI_STATUS_OK
@@ -289,8 +297,8 @@ default: \
#define XS_SET_STATE_STAT(a, b, c)
-#define DEFAULT_IID(x) 7
-#define DEFAULT_LOOPID(x) 109
+#define DEFAULT_IID(x) (isp)->isp_osinfo.default_id
+#define DEFAULT_LOOPID(x) (isp)->isp_osinfo.default_id
#define DEFAULT_NODEWWN(isp) (isp)->isp_osinfo.default_node_wwn
#define DEFAULT_PORTWWN(isp) (isp)->isp_osinfo.default_port_wwn
#define ISP_NODEWWN(isp) FCPARAM(isp)->isp_nodewwn
@@ -388,7 +396,7 @@ isp_mbox_wait_complete(struct ispsoftc *isp)
if (isp->isp_osinfo.intsok) {
int lim = ((isp->isp_mbxwrk0)? 120 : 20) * hz;
isp->isp_osinfo.mboxwaiting = 1;
- (void) msleep(&isp->isp_osinfo.mboxwaiting,
+ (void) msleep(&isp->isp_mbxworkp,
&isp->isp_lock, PRIBIO, "isp_mboxwaiting", lim);
if (isp->isp_mboxbsy != 0) {
isp_prt(isp, ISP_LOGWARN,
OpenPOWER on IntegriCloud