summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/ispreg.h
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2013-07-13 21:24:25 +0000
committermjacob <mjacob@FreeBSD.org>2013-07-13 21:24:25 +0000
commit2bf9d2e61f167a0b4ed757d24e5cbf4be712bce4 (patch)
treef97b066524ed568a6fc95766be53be42ddfd4b8b /sys/dev/isp/ispreg.h
parentb39f8344132db7671f6bb0129eca537f84d0cdcd (diff)
downloadFreeBSD-src-2bf9d2e61f167a0b4ed757d24e5cbf4be712bce4.zip
FreeBSD-src-2bf9d2e61f167a0b4ed757d24e5cbf4be712bce4.tar.gz
When fiddling with options of which registers to copy out for
a mailbox command and which registers to copy back in when the command completes, the bits being set need to not only specify what bits you want to add from the default from the table but also what bits you want *subtract* (mask) from the default from the table. A failing ISP2200 command pointed this out. Much appreciation to: marius, who persisted and narrowed down what the failure delta was, and shamed me into actually fixing it. MFC after: 1 week
Diffstat (limited to 'sys/dev/isp/ispreg.h')
-rw-r--r--sys/dev/isp/ispreg.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/isp/ispreg.h b/sys/dev/isp/ispreg.h
index 3460d24..1fe12fb 100644
--- a/sys/dev/isp/ispreg.h
+++ b/sys/dev/isp/ispreg.h
@@ -464,8 +464,10 @@
#define MBCMD_DEFAULT_TIMEOUT 100000 /* 100 ms */
typedef struct {
uint16_t param[MAX_MAILBOX];
- uint32_t ibits;
- uint32_t obits;
+ uint32_t ibits; /* bits to add for register copyin */
+ uint32_t obits; /* bits to add for register copyout */
+ uint32_t ibitm; /* bits to mask for register copyin */
+ uint32_t obitm; /* bits to mask for register copyout */
uint32_t
lineno : 16,
: 12,
@@ -475,6 +477,8 @@ typedef struct {
} mbreg_t;
#define MBSINIT(mbxp, code, loglev, timo) \
ISP_MEMZERO((mbxp), sizeof (mbreg_t)); \
+ (mbxp)->ibitm = ~0; \
+ (mbxp)->obitm = ~0; \
(mbxp)->param[0] = code; \
(mbxp)->lineno = __LINE__; \
(mbxp)->func = __func__; \
OpenPOWER on IntegriCloud