summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_freebsd.h
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2012-06-17 21:39:40 +0000
committermjacob <mjacob@FreeBSD.org>2012-06-17 21:39:40 +0000
commit7d8c797417eb7311f4b225492e224770c214e9c8 (patch)
tree30dc205475a6a53b266d8114b1a736d1af717ef3 /sys/dev/isp/isp_freebsd.h
parent0118c8606277dc863307564505e6b7a9e2400e79 (diff)
downloadFreeBSD-src-7d8c797417eb7311f4b225492e224770c214e9c8.zip
FreeBSD-src-7d8c797417eb7311f4b225492e224770c214e9c8.tar.gz
Prepare for FC-Tape support. This involved doing a lot of little cleanups
and crosschecks against firmware documentation. We now check and report FC firmware attributes and at least are now prepared for the upper 48 bits of f/w attributes (which are probably for the 8100 or later cards). This involed changing how inbits and outbits are calculated for varios commands, hopefully clearer and cleaner. This also caused me to clean up the actual mailbox register usage. Finally, we are now unconditionally using a CRN for initiator mode. A longstanding issue with the 2400/2500 is that they do *not* support a "Prefer PTP followed by loop", which explains why enabling that caused the f/w to crash. A slightly more invasive change is to let the firmware load entirely drive whether multi_id support is enabled or not. Sponsored by: Spectralogic MFC after: 1 week
Diffstat (limited to 'sys/dev/isp/isp_freebsd.h')
-rw-r--r--sys/dev/isp/isp_freebsd.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h
index 457f9f2..52bd787 100644
--- a/sys/dev/isp/isp_freebsd.h
+++ b/sys/dev/isp/isp_freebsd.h
@@ -153,6 +153,7 @@ struct isp_pcmd {
bus_dmamap_t dmap; /* dma map for this command */
struct ispsoftc * isp; /* containing isp */
struct callout wdog; /* watchdog timer */
+ uint8_t crn; /* command reference number */
};
#define ISP_PCMD(ccb) (ccb)->ccb_h.spriv_ptr1
#define PISP_PCMD(ccb) ((struct isp_pcmd *)ISP_PCMD(ccb))
@@ -201,6 +202,7 @@ struct isp_fc {
struct proc * target_proc;
#endif
#endif
+ uint8_t crnseed; /* next command reference number */
};
struct isp_spi {
@@ -263,7 +265,6 @@ struct isposinfo {
#else
: 2,
#endif
- forcemulti : 1,
timer_active : 1,
autoconf : 1,
ehook_active : 1,
@@ -316,6 +317,16 @@ struct isposinfo {
ISP_FC_PC(isp, chan)-> tag = val; \
}
+#define FCP_NEXT_CRN(isp, cmd, rslt, chan, tgt, lun) \
+ if ((isp)->isp_osinfo.pc.fc[(chan)].crnseed == 0) { \
+ (isp)->isp_osinfo.pc.fc[(chan)].crnseed = 1; \
+ } \
+ if (cmd) { \
+ PISP_PCMD(cmd)->crn = (isp)->isp_osinfo.pc.fc[(chan)].crnseed; \
+ } \
+ (rslt) = (isp)->isp_osinfo.pc.fc[(chan)].crnseed++
+
+
#define isp_lock isp_osinfo.lock
#define isp_bus_tag isp_osinfo.bus_tag
#define isp_bus_handle isp_osinfo.bus_handle
@@ -639,7 +650,6 @@ extern int isp_autoconfig;
#define XS_CMD_C_WPEND(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_WPEND
#define XS_CMD_WPEND_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_WPEND)
-
#define XS_CMD_S_CLEAR(sccb) (sccb)->ccb_h.spriv_field0 = 0
/*
OpenPOWER on IntegriCloud