a) clean up some declaration stuff (i.e., make more modern with respect

to getting rid u_int for uint and so on).

b) Turn back on 64 bit DAC support. Cheeze it a bit in that we have two
DMA callback functions- one when we have bus_addr_t > 4 bits in width and
the other which should be normal. Even Cheezier in that we turn off setting
up DMA maps to be BUS_SPACE_MAXADDR if we're in ISP_TARGET_MODE. More work
on this in a week or so.

c) Tested under amd64 and 1MB DFLTPHYS, sparc64, i386 (PAE, but insufficient
memory to really test > 4GB). LINT check under amd64.

MFC after:	1 month
This commit is contained in:
Matt Jacob 2006-02-15 00:31:48 +00:00
parent b3babfdc25
commit 1dae40eb49
14 changed files with 1139 additions and 1132 deletions

View File

@ -32,17 +32,18 @@
* (qlogicisp.c) and Dave Miller's SBus version of same (qlogicisp.c). Some
* ideas dredged from the Solaris driver.
*/
#ifdef __FreeBSD__
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#endif
/*
* Include header file appropriate for platform we're building on.
*/
#ifdef __NetBSD__
#include <dev/ic/isp_netbsd.h>
#endif
#ifdef __FreeBSD__
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <dev/isp/isp_freebsd.h>
#endif
#ifdef __OpenBSD__
@ -113,12 +114,12 @@ static const char bun[] =
/*
* Local function prototypes.
*/
static int isp_parse_async(struct ispsoftc *, u_int16_t);
static int isp_parse_async(struct ispsoftc *, uint16_t);
static int isp_handle_other_response(struct ispsoftc *, int, isphdr_t *,
u_int16_t *);
uint16_t *);
static void
isp_parse_status(struct ispsoftc *, ispstatusreq_t *, XS_T *);
static void isp_fastpost_complete(struct ispsoftc *, u_int16_t);
static void isp_fastpost_complete(struct ispsoftc *, uint16_t);
static int isp_mbox_continue(struct ispsoftc *);
static void isp_scsi_init(struct ispsoftc *);
static void isp_scsi_channel_init(struct ispsoftc *, int);
@ -126,7 +127,7 @@ static void isp_fibre_init(struct ispsoftc *);
static void isp_mark_getpdb_all(struct ispsoftc *);
static int isp_getmap(struct ispsoftc *, fcpos_map_t *);
static int isp_getpdb(struct ispsoftc *, int, isp_pdb_t *);
static u_int64_t isp_get_portname(struct ispsoftc *, int, int);
static uint64_t isp_get_portname(struct ispsoftc *, int, int);
static int isp_fclink_test(struct ispsoftc *, int);
static char *isp2100_fw_statename(int);
static int isp_pdb_sync(struct ispsoftc *);
@ -142,11 +143,11 @@ static void isp_update(struct ispsoftc *);
static void isp_update_bus(struct ispsoftc *, int);
static void isp_setdfltparm(struct ispsoftc *, int);
static int isp_read_nvram(struct ispsoftc *);
static void isp_rdnvram_word(struct ispsoftc *, int, u_int16_t *);
static void isp_parse_nvram_1020(struct ispsoftc *, u_int8_t *);
static void isp_parse_nvram_1080(struct ispsoftc *, int, u_int8_t *);
static void isp_parse_nvram_12160(struct ispsoftc *, int, u_int8_t *);
static void isp_parse_nvram_2100(struct ispsoftc *, u_int8_t *);
static void isp_rdnvram_word(struct ispsoftc *, int, uint16_t *);
static void isp_parse_nvram_1020(struct ispsoftc *, uint8_t *);
static void isp_parse_nvram_1080(struct ispsoftc *, int, uint8_t *);
static void isp_parse_nvram_12160(struct ispsoftc *, int, uint8_t *);
static void isp_parse_nvram_2100(struct ispsoftc *, uint8_t *);
/*
* Reset Hardware.
@ -160,7 +161,7 @@ void
isp_reset(struct ispsoftc *isp)
{
mbreg_t mbs;
u_int16_t code_org;
uint16_t code_org;
int loops, i, dodnld = 1;
char *btype = "????";
@ -282,7 +283,7 @@ isp_reset(struct ispsoftc *isp)
*/
} else if (IS_ULTRA2(isp)) {
static const char m[] = "bus %d is in %s Mode";
u_int16_t l;
uint16_t l;
sdparam *sdp = isp->isp_param;
isp->isp_clock = 100;
@ -524,7 +525,7 @@ isp_reset(struct ispsoftc *isp)
* be done later after fetching from NVRAM.
*/
if (IS_SCSI(isp)) {
u_int16_t tmp = isp->isp_mdvec->dv_conf1;
uint16_t tmp = isp->isp_mdvec->dv_conf1;
/*
* Busted FIFO. Turn off all but burst enables.
*/
@ -1037,7 +1038,7 @@ isp_scsi_init(struct ispsoftc *isp)
#endif
#endif
if (mbs.param[1] != 0) {
u_int16_t sfeat = mbs.param[1];
uint16_t sfeat = mbs.param[1];
isp_mboxcmd(isp, &mbs, MBLOGALL);
if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
isp_prt(isp, ISP_LOGINFO,
@ -1080,7 +1081,7 @@ isp_scsi_channel_init(struct ispsoftc *isp, int channel)
*/
for (tgt = 0; tgt < MAX_TARGETS; tgt++) {
int lun;
u_int16_t sdf;
uint16_t sdf;
if (sdp->isp_devparam[tgt].dev_enable == 0) {
continue;
@ -1179,7 +1180,7 @@ isp_fibre_init(struct ispsoftc *isp)
isp_icb_t local, *icbp = &local;
mbreg_t mbs;
int loopid;
u_int64_t nwwn, pwwn;
uint64_t nwwn, pwwn;
fcp = isp->isp_param;
@ -1406,10 +1407,10 @@ isp_fibre_init(struct ispsoftc *isp)
MAKE_NODE_NAME_FROM_WWN(icbp->icb_portname, pwwn);
isp_prt(isp, ISP_LOGDEBUG1,
"Setting ICB Node 0x%08x%08x Port 0x%08x%08x",
((u_int32_t) (nwwn >> 32)),
((u_int32_t) (nwwn & 0xffffffff)),
((u_int32_t) (pwwn >> 32)),
((u_int32_t) (pwwn & 0xffffffff)));
((uint32_t) (nwwn >> 32)),
((uint32_t) (nwwn & 0xffffffff)),
((uint32_t) (pwwn >> 32)),
((uint32_t) (pwwn & 0xffffffff)));
} else {
isp_prt(isp, ISP_LOGDEBUG1, "Not using any WWNs");
icbp->icb_fwoptions &= ~(ICBOPT_BOTH_WWNS|ICBOPT_FULL_LOGIN);
@ -1548,10 +1549,10 @@ isp_getpdb(struct ispsoftc *isp, int id, isp_pdb_t *pdbp)
return (-1);
}
static u_int64_t
static uint64_t
isp_get_portname(struct ispsoftc *isp, int loopid, int nodename)
{
u_int64_t wwn = 0;
uint64_t wwn = 0;
mbreg_t mbs;
MEMZERO(&mbs, sizeof (mbs));
@ -1569,14 +1570,14 @@ isp_get_portname(struct ispsoftc *isp, int loopid, int nodename)
isp_mboxcmd(isp, &mbs, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR);
if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
wwn =
(((u_int64_t)(mbs.param[2] & 0xff)) << 56) |
(((u_int64_t)(mbs.param[2] >> 8)) << 48) |
(((u_int64_t)(mbs.param[3] & 0xff)) << 40) |
(((u_int64_t)(mbs.param[3] >> 8)) << 32) |
(((u_int64_t)(mbs.param[6] & 0xff)) << 24) |
(((u_int64_t)(mbs.param[6] >> 8)) << 16) |
(((u_int64_t)(mbs.param[7] & 0xff)) << 8) |
(((u_int64_t)(mbs.param[7] >> 8)));
(((uint64_t)(mbs.param[2] & 0xff)) << 56) |
(((uint64_t)(mbs.param[2] >> 8)) << 48) |
(((uint64_t)(mbs.param[3] & 0xff)) << 40) |
(((uint64_t)(mbs.param[3] >> 8)) << 32) |
(((uint64_t)(mbs.param[6] & 0xff)) << 24) |
(((uint64_t)(mbs.param[6] >> 8)) << 16) |
(((uint64_t)(mbs.param[7] & 0xff)) << 8) |
(((uint64_t)(mbs.param[7] >> 8)));
}
return (wwn);
}
@ -1597,7 +1598,7 @@ isp_fclink_test(struct ispsoftc *isp, int usdelay)
};
mbreg_t mbs;
int count, check_for_fabric;
u_int8_t lwfs;
uint8_t lwfs;
fcparam *fcp;
struct lportdb *lp;
isp_pdb_t pdb;
@ -1614,8 +1615,8 @@ isp_fclink_test(struct ispsoftc *isp, int usdelay)
lwfs = FW_CONFIG_WAIT;
count = 0;
while (count < usdelay) {
u_int64_t enano;
u_int32_t wrk;
uint64_t enano;
uint32_t wrk;
NANOTIME_T hra, hrb;
GET_NANOTIME(&hra);
@ -1640,7 +1641,7 @@ isp_fclink_test(struct ispsoftc *isp, int usdelay)
isp_prt(isp, ISP_LOGDEBUG1,
"usec%d: 0x%lx->0x%lx enano 0x%x%08x",
count, (long) GET_NANOSEC(&hra), (long) GET_NANOSEC(&hrb),
(u_int32_t)(enano >> 32), (u_int32_t)(enano & 0xffffffff));
(uint32_t)(enano >> 32), (uint32_t)(enano & 0xffffffff));
/*
* If the elapsed time is less than 1 millisecond,
@ -1648,23 +1649,23 @@ isp_fclink_test(struct ispsoftc *isp, int usdelay)
* waiting.
*
* This peculiar code is an attempt to try and avoid
* invoking u_int64_t math support functions for some
* invoking uint64_t math support functions for some
* platforms where linkage is a problem.
*/
if (enano < (1000 * 1000)) {
count += 1000;
enano = (1000 * 1000) - enano;
while (enano > (u_int64_t) 4000000000U) {
while (enano > (uint64_t) 4000000000U) {
USEC_SLEEP(isp, 4000000);
enano -= (u_int64_t) 4000000000U;
enano -= (uint64_t) 4000000000U;
}
wrk = enano;
wrk /= 1000;
USEC_SLEEP(isp, wrk);
} else {
while (enano > (u_int64_t) 4000000000U) {
while (enano > (uint64_t) 4000000000U) {
count += 4000000;
enano -= (u_int64_t) 4000000000U;
enano -= (uint64_t) 4000000000U;
}
wrk = enano;
count += (wrk / 1000);
@ -1751,23 +1752,23 @@ isp_fclink_test(struct ispsoftc *isp, int usdelay)
*/
lp = &fcp->portdb[loopid];
lp->node_wwn =
(((u_int64_t)pdb.pdb_nodename[0]) << 56) |
(((u_int64_t)pdb.pdb_nodename[1]) << 48) |
(((u_int64_t)pdb.pdb_nodename[2]) << 40) |
(((u_int64_t)pdb.pdb_nodename[3]) << 32) |
(((u_int64_t)pdb.pdb_nodename[4]) << 24) |
(((u_int64_t)pdb.pdb_nodename[5]) << 16) |
(((u_int64_t)pdb.pdb_nodename[6]) << 8) |
(((u_int64_t)pdb.pdb_nodename[7]));
(((uint64_t)pdb.pdb_nodename[0]) << 56) |
(((uint64_t)pdb.pdb_nodename[1]) << 48) |
(((uint64_t)pdb.pdb_nodename[2]) << 40) |
(((uint64_t)pdb.pdb_nodename[3]) << 32) |
(((uint64_t)pdb.pdb_nodename[4]) << 24) |
(((uint64_t)pdb.pdb_nodename[5]) << 16) |
(((uint64_t)pdb.pdb_nodename[6]) << 8) |
(((uint64_t)pdb.pdb_nodename[7]));
lp->port_wwn =
(((u_int64_t)pdb.pdb_portname[0]) << 56) |
(((u_int64_t)pdb.pdb_portname[1]) << 48) |
(((u_int64_t)pdb.pdb_portname[2]) << 40) |
(((u_int64_t)pdb.pdb_portname[3]) << 32) |
(((u_int64_t)pdb.pdb_portname[4]) << 24) |
(((u_int64_t)pdb.pdb_portname[5]) << 16) |
(((u_int64_t)pdb.pdb_portname[6]) << 8) |
(((u_int64_t)pdb.pdb_portname[7]));
(((uint64_t)pdb.pdb_portname[0]) << 56) |
(((uint64_t)pdb.pdb_portname[1]) << 48) |
(((uint64_t)pdb.pdb_portname[2]) << 40) |
(((uint64_t)pdb.pdb_portname[3]) << 32) |
(((uint64_t)pdb.pdb_portname[4]) << 24) |
(((uint64_t)pdb.pdb_portname[5]) << 16) |
(((uint64_t)pdb.pdb_portname[6]) << 8) |
(((uint64_t)pdb.pdb_portname[7]));
lp->roles =
(pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT;
lp->portid = BITS2WORD(pdb.pdb_portid_bits);
@ -1931,7 +1932,7 @@ isp_pdb_sync(struct ispsoftc *isp)
* for the moment.
*/
for (lp = &fcp->portdb[base]; lp < &fcp->portdb[lim]; lp++) {
u_int32_t portid;
uint32_t portid;
mbreg_t mbs;
loopid = lp - fcp->portdb;
@ -1966,29 +1967,29 @@ isp_pdb_sync(struct ispsoftc *isp)
if (lp->loggedin && lp->force_logout == 0 &&
isp_getpdb(isp, lp->loopid, &pdb) == 0) {
int nrole;
u_int64_t nwwnn, nwwpn;
uint64_t nwwnn, nwwpn;
nwwnn =
(((u_int64_t)pdb.pdb_nodename[0]) << 56) |
(((u_int64_t)pdb.pdb_nodename[1]) << 48) |
(((u_int64_t)pdb.pdb_nodename[2]) << 40) |
(((u_int64_t)pdb.pdb_nodename[3]) << 32) |
(((u_int64_t)pdb.pdb_nodename[4]) << 24) |
(((u_int64_t)pdb.pdb_nodename[5]) << 16) |
(((u_int64_t)pdb.pdb_nodename[6]) << 8) |
(((u_int64_t)pdb.pdb_nodename[7]));
(((uint64_t)pdb.pdb_nodename[0]) << 56) |
(((uint64_t)pdb.pdb_nodename[1]) << 48) |
(((uint64_t)pdb.pdb_nodename[2]) << 40) |
(((uint64_t)pdb.pdb_nodename[3]) << 32) |
(((uint64_t)pdb.pdb_nodename[4]) << 24) |
(((uint64_t)pdb.pdb_nodename[5]) << 16) |
(((uint64_t)pdb.pdb_nodename[6]) << 8) |
(((uint64_t)pdb.pdb_nodename[7]));
nwwpn =
(((u_int64_t)pdb.pdb_portname[0]) << 56) |
(((u_int64_t)pdb.pdb_portname[1]) << 48) |
(((u_int64_t)pdb.pdb_portname[2]) << 40) |
(((u_int64_t)pdb.pdb_portname[3]) << 32) |
(((u_int64_t)pdb.pdb_portname[4]) << 24) |
(((u_int64_t)pdb.pdb_portname[5]) << 16) |
(((u_int64_t)pdb.pdb_portname[6]) << 8) |
(((u_int64_t)pdb.pdb_portname[7]));
(((uint64_t)pdb.pdb_portname[0]) << 56) |
(((uint64_t)pdb.pdb_portname[1]) << 48) |
(((uint64_t)pdb.pdb_portname[2]) << 40) |
(((uint64_t)pdb.pdb_portname[3]) << 32) |
(((uint64_t)pdb.pdb_portname[4]) << 24) |
(((uint64_t)pdb.pdb_portname[5]) << 16) |
(((uint64_t)pdb.pdb_portname[6]) << 8) |
(((uint64_t)pdb.pdb_portname[7]));
nrole = (pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >>
SVC3_ROLE_SHIFT;
if (pdb.pdb_loopid == lp->loopid && lp->portid ==
(u_int32_t) BITS2WORD(pdb.pdb_portid_bits) &&
(uint32_t) BITS2WORD(pdb.pdb_portid_bits) &&
nwwnn == lp->node_wwn && nwwpn == lp->port_wwn &&
lp->roles == nrole && lp->force_logout == 0) {
lp->loggedin = lp->valid = 1;
@ -2125,7 +2126,7 @@ isp_pdb_sync(struct ispsoftc *isp)
goto dump_em;
}
if (lp->portid != (u_int32_t) BITS2WORD(pdb.pdb_portid_bits)) {
if (lp->portid != (uint32_t) BITS2WORD(pdb.pdb_portid_bits)) {
isp_prt(isp, ISP_LOGWARN, pdbmfail2,
lp->portid, BITS2WORD(pdb.pdb_portid_bits));
goto dump_em;
@ -2134,23 +2135,23 @@ isp_pdb_sync(struct ispsoftc *isp)
lp->roles =
(pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT;
lp->node_wwn =
(((u_int64_t)pdb.pdb_nodename[0]) << 56) |
(((u_int64_t)pdb.pdb_nodename[1]) << 48) |
(((u_int64_t)pdb.pdb_nodename[2]) << 40) |
(((u_int64_t)pdb.pdb_nodename[3]) << 32) |
(((u_int64_t)pdb.pdb_nodename[4]) << 24) |
(((u_int64_t)pdb.pdb_nodename[5]) << 16) |
(((u_int64_t)pdb.pdb_nodename[6]) << 8) |
(((u_int64_t)pdb.pdb_nodename[7]));
(((uint64_t)pdb.pdb_nodename[0]) << 56) |
(((uint64_t)pdb.pdb_nodename[1]) << 48) |
(((uint64_t)pdb.pdb_nodename[2]) << 40) |
(((uint64_t)pdb.pdb_nodename[3]) << 32) |
(((uint64_t)pdb.pdb_nodename[4]) << 24) |
(((uint64_t)pdb.pdb_nodename[5]) << 16) |
(((uint64_t)pdb.pdb_nodename[6]) << 8) |
(((uint64_t)pdb.pdb_nodename[7]));
lp->port_wwn =
(((u_int64_t)pdb.pdb_portname[0]) << 56) |
(((u_int64_t)pdb.pdb_portname[1]) << 48) |
(((u_int64_t)pdb.pdb_portname[2]) << 40) |
(((u_int64_t)pdb.pdb_portname[3]) << 32) |
(((u_int64_t)pdb.pdb_portname[4]) << 24) |
(((u_int64_t)pdb.pdb_portname[5]) << 16) |
(((u_int64_t)pdb.pdb_portname[6]) << 8) |
(((u_int64_t)pdb.pdb_portname[7]));
(((uint64_t)pdb.pdb_portname[0]) << 56) |
(((uint64_t)pdb.pdb_portname[1]) << 48) |
(((uint64_t)pdb.pdb_portname[2]) << 40) |
(((uint64_t)pdb.pdb_portname[3]) << 32) |
(((uint64_t)pdb.pdb_portname[4]) << 24) |
(((uint64_t)pdb.pdb_portname[5]) << 16) |
(((uint64_t)pdb.pdb_portname[6]) << 8) |
(((uint64_t)pdb.pdb_portname[7]));
/*
* Check to make sure this all makes sense.
*/
@ -2277,23 +2278,23 @@ isp_scan_loop(struct ispsoftc *isp)
* Save the pertinent info locally.
*/
lp->node_wwn =
(((u_int64_t)pdb.pdb_nodename[0]) << 56) |
(((u_int64_t)pdb.pdb_nodename[1]) << 48) |
(((u_int64_t)pdb.pdb_nodename[2]) << 40) |
(((u_int64_t)pdb.pdb_nodename[3]) << 32) |
(((u_int64_t)pdb.pdb_nodename[4]) << 24) |
(((u_int64_t)pdb.pdb_nodename[5]) << 16) |
(((u_int64_t)pdb.pdb_nodename[6]) << 8) |
(((u_int64_t)pdb.pdb_nodename[7]));
(((uint64_t)pdb.pdb_nodename[0]) << 56) |
(((uint64_t)pdb.pdb_nodename[1]) << 48) |
(((uint64_t)pdb.pdb_nodename[2]) << 40) |
(((uint64_t)pdb.pdb_nodename[3]) << 32) |
(((uint64_t)pdb.pdb_nodename[4]) << 24) |
(((uint64_t)pdb.pdb_nodename[5]) << 16) |
(((uint64_t)pdb.pdb_nodename[6]) << 8) |
(((uint64_t)pdb.pdb_nodename[7]));
lp->port_wwn =
(((u_int64_t)pdb.pdb_portname[0]) << 56) |
(((u_int64_t)pdb.pdb_portname[1]) << 48) |
(((u_int64_t)pdb.pdb_portname[2]) << 40) |
(((u_int64_t)pdb.pdb_portname[3]) << 32) |
(((u_int64_t)pdb.pdb_portname[4]) << 24) |
(((u_int64_t)pdb.pdb_portname[5]) << 16) |
(((u_int64_t)pdb.pdb_portname[6]) << 8) |
(((u_int64_t)pdb.pdb_portname[7]));
(((uint64_t)pdb.pdb_portname[0]) << 56) |
(((uint64_t)pdb.pdb_portname[1]) << 48) |
(((uint64_t)pdb.pdb_portname[2]) << 40) |
(((uint64_t)pdb.pdb_portname[3]) << 32) |
(((uint64_t)pdb.pdb_portname[4]) << 24) |
(((uint64_t)pdb.pdb_portname[5]) << 16) |
(((uint64_t)pdb.pdb_portname[6]) << 8) |
(((uint64_t)pdb.pdb_portname[7]));
lp->roles =
(pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT;
lp->portid = BITS2WORD(pdb.pdb_portid_bits);
@ -2513,7 +2514,7 @@ static int
isp_scan_fabric(struct ispsoftc *isp, int ftype)
{
fcparam *fcp = isp->isp_param;
u_int32_t portid, first_portid, last_portid;
uint32_t portid, first_portid, last_portid;
int hicap, last_port_same;
if (fcp->isp_onfabric == 0) {
@ -2537,7 +2538,7 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
sns_screq_t *rq;
sns_ga_nxt_rsp_t *rs0, *rs1;
struct lportdb lcl;
u_int8_t sc[SNS_GA_NXT_RESP_SIZE];
uint8_t sc[SNS_GA_NXT_RESP_SIZE];
rq = (sns_screq_t *)sc;
MEMZERO((void *) rq, SNS_GA_NXT_REQ_SIZE);
@ -2571,7 +2572,7 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
}
MEMORYBARRIER(isp, SYNC_SFORCPU, 0x100, SNS_GA_NXT_RESP_SIZE);
rs1 = (sns_ga_nxt_rsp_t *) sc;
rs0 = (sns_ga_nxt_rsp_t *) ((u_int8_t *)fcp->isp_scratch+0x100);
rs0 = (sns_ga_nxt_rsp_t *) ((uint8_t *)fcp->isp_scratch+0x100);
isp_get_ga_nxt_response(isp, rs0, rs1);
if (rs1->snscb_cthdr.ct_response != FS_ACC) {
int level;
@ -2588,9 +2589,9 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
return (0);
}
portid =
(((u_int32_t) rs1->snscb_port_id[0]) << 16) |
(((u_int32_t) rs1->snscb_port_id[1]) << 8) |
(((u_int32_t) rs1->snscb_port_id[2]));
(((uint32_t) rs1->snscb_port_id[0]) << 16) |
(((uint32_t) rs1->snscb_port_id[1]) << 8) |
(((uint32_t) rs1->snscb_port_id[2]));
/*
* XXX: We should check to make sure that this entry
@ -2609,23 +2610,23 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
lcl.fc4_type = ftype;
lcl.portid = portid;
lcl.node_wwn =
(((u_int64_t)rs1->snscb_nodename[0]) << 56) |
(((u_int64_t)rs1->snscb_nodename[1]) << 48) |
(((u_int64_t)rs1->snscb_nodename[2]) << 40) |
(((u_int64_t)rs1->snscb_nodename[3]) << 32) |
(((u_int64_t)rs1->snscb_nodename[4]) << 24) |
(((u_int64_t)rs1->snscb_nodename[5]) << 16) |
(((u_int64_t)rs1->snscb_nodename[6]) << 8) |
(((u_int64_t)rs1->snscb_nodename[7]));
(((uint64_t)rs1->snscb_nodename[0]) << 56) |
(((uint64_t)rs1->snscb_nodename[1]) << 48) |
(((uint64_t)rs1->snscb_nodename[2]) << 40) |
(((uint64_t)rs1->snscb_nodename[3]) << 32) |
(((uint64_t)rs1->snscb_nodename[4]) << 24) |
(((uint64_t)rs1->snscb_nodename[5]) << 16) |
(((uint64_t)rs1->snscb_nodename[6]) << 8) |
(((uint64_t)rs1->snscb_nodename[7]));
lcl.port_wwn =
(((u_int64_t)rs1->snscb_portname[0]) << 56) |
(((u_int64_t)rs1->snscb_portname[1]) << 48) |
(((u_int64_t)rs1->snscb_portname[2]) << 40) |
(((u_int64_t)rs1->snscb_portname[3]) << 32) |
(((u_int64_t)rs1->snscb_portname[4]) << 24) |
(((u_int64_t)rs1->snscb_portname[5]) << 16) |
(((u_int64_t)rs1->snscb_portname[6]) << 8) |
(((u_int64_t)rs1->snscb_portname[7]));
(((uint64_t)rs1->snscb_portname[0]) << 56) |
(((uint64_t)rs1->snscb_portname[1]) << 48) |
(((uint64_t)rs1->snscb_portname[2]) << 40) |
(((uint64_t)rs1->snscb_portname[3]) << 32) |
(((uint64_t)rs1->snscb_portname[4]) << 24) |
(((uint64_t)rs1->snscb_portname[5]) << 16) |
(((uint64_t)rs1->snscb_portname[6]) << 8) |
(((uint64_t)rs1->snscb_portname[7]));
/*
* Does this fabric object support the type we want?
@ -2727,7 +2728,7 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
}
MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN);
rs1 = (sns_gid_ft_rsp_t *) fcp->tport;
rs0 = (sns_gid_ft_rsp_t *) ((u_int8_t *)fcp->isp_scratch+IGPOFF);
rs0 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+IGPOFF);
isp_get_gid_ft_response(isp, rs0, rs1, NGENT);
if (rs1->snscb_cthdr.ct_response != FS_ACC) {
int level;
@ -2765,9 +2766,9 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
MEMZERO(&lcl, sizeof (lcl));
lcl.fc4_type = ftype;
lcl.portid =
(((u_int32_t) rs1->snscb_ports[i].portid[0]) << 16) |
(((u_int32_t) rs1->snscb_ports[i].portid[1]) << 8) |
(((u_int32_t) rs1->snscb_ports[i].portid[2]));
(((uint32_t) rs1->snscb_ports[i].portid[0]) << 16) |
(((uint32_t) rs1->snscb_ports[i].portid[1]) << 8) |
(((uint32_t) rs1->snscb_ports[i].portid[2]));
MEMZERO((void *) gq, sizeof (sns_gxn_id_req_t));
gq->snscb_rblen = SNS_GXN_ID_RESP_SIZE >> 1;
@ -2803,7 +2804,7 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
return (-1);
}
MEMORYBARRIER(isp, SYNC_SFORCPU, GXOFF, SNS_GXN_ID_RESP_SIZE);
gs0 = (sns_gxn_id_rsp_t *) ((u_int8_t *)fcp->isp_scratch+GXOFF);
gs0 = (sns_gxn_id_rsp_t *) ((uint8_t *)fcp->isp_scratch+GXOFF);
isp_get_gxn_id_response(isp, gs0, gs1);
if (gs1->snscb_cthdr.ct_response != FS_ACC) {
isp_prt(isp, ISP_LOGWARN, swrej, "GPN_ID",
@ -2816,14 +2817,14 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
continue;
}
lcl.port_wwn =
(((u_int64_t)gs1->snscb_wwn[0]) << 56) |
(((u_int64_t)gs1->snscb_wwn[1]) << 48) |
(((u_int64_t)gs1->snscb_wwn[2]) << 40) |
(((u_int64_t)gs1->snscb_wwn[3]) << 32) |
(((u_int64_t)gs1->snscb_wwn[4]) << 24) |
(((u_int64_t)gs1->snscb_wwn[5]) << 16) |
(((u_int64_t)gs1->snscb_wwn[6]) << 8) |
(((u_int64_t)gs1->snscb_wwn[7]));
(((uint64_t)gs1->snscb_wwn[0]) << 56) |
(((uint64_t)gs1->snscb_wwn[1]) << 48) |
(((uint64_t)gs1->snscb_wwn[2]) << 40) |
(((uint64_t)gs1->snscb_wwn[3]) << 32) |
(((uint64_t)gs1->snscb_wwn[4]) << 24) |
(((uint64_t)gs1->snscb_wwn[5]) << 16) |
(((uint64_t)gs1->snscb_wwn[6]) << 8) |
(((uint64_t)gs1->snscb_wwn[7]));
MEMZERO((void *) gq, sizeof (sns_gxn_id_req_t));
gq->snscb_rblen = SNS_GXN_ID_RESP_SIZE >> 1;
@ -2859,7 +2860,7 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
return (-1);
}
MEMORYBARRIER(isp, SYNC_SFORCPU, GXOFF, SNS_GXN_ID_RESP_SIZE);
gs0 = (sns_gxn_id_rsp_t *) ((u_int8_t *)fcp->isp_scratch+GXOFF);
gs0 = (sns_gxn_id_rsp_t *) ((uint8_t *)fcp->isp_scratch+GXOFF);
isp_get_gxn_id_response(isp, gs0, gs1);
if (gs1->snscb_cthdr.ct_response != FS_ACC) {
isp_prt(isp, ISP_LOGWARN, swrej, "GNN_ID",
@ -2872,14 +2873,14 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
continue;
}
lcl.node_wwn =
(((u_int64_t)gs1->snscb_wwn[0]) << 56) |
(((u_int64_t)gs1->snscb_wwn[1]) << 48) |
(((u_int64_t)gs1->snscb_wwn[2]) << 40) |
(((u_int64_t)gs1->snscb_wwn[3]) << 32) |
(((u_int64_t)gs1->snscb_wwn[4]) << 24) |
(((u_int64_t)gs1->snscb_wwn[5]) << 16) |
(((u_int64_t)gs1->snscb_wwn[6]) << 8) |
(((u_int64_t)gs1->snscb_wwn[7]));
(((uint64_t)gs1->snscb_wwn[0]) << 56) |
(((uint64_t)gs1->snscb_wwn[1]) << 48) |
(((uint64_t)gs1->snscb_wwn[2]) << 40) |
(((uint64_t)gs1->snscb_wwn[3]) << 32) |
(((uint64_t)gs1->snscb_wwn[4]) << 24) |
(((uint64_t)gs1->snscb_wwn[5]) << 16) |
(((uint64_t)gs1->snscb_wwn[6]) << 8) |
(((uint64_t)gs1->snscb_wwn[7]));
/*
* The QLogic f/w is bouncing this with a parameter error.
@ -2923,7 +2924,7 @@ isp_scan_fabric(struct ispsoftc *isp, int ftype)
return (-1);
}
MEMORYBARRIER(isp, SYNC_SFORCPU, GXOFF, SNS_GFF_ID_RESP_SIZE);
fs0 = (sns_gff_id_rsp_t *) ((u_int8_t *)fcp->isp_scratch+GXOFF);
fs0 = (sns_gff_id_rsp_t *) ((uint8_t *)fcp->isp_scratch+GXOFF);
isp_get_gff_id_response(isp, fs0, fs1);
if (fs1->snscb_cthdr.ct_response != FS_ACC) {
isp_prt(isp, /* ISP_LOGDEBUG0 */ ISP_LOGWARN,
@ -2983,7 +2984,7 @@ static void
isp_register_fc4_type(struct ispsoftc *isp)
{
fcparam *fcp = isp->isp_param;
u_int8_t local[SNS_RFT_ID_REQ_SIZE];
uint8_t local[SNS_RFT_ID_REQ_SIZE];
sns_screq_t *reqp = (sns_screq_t *) local;
mbreg_t mbs;
@ -3028,8 +3029,8 @@ int
isp_start(XS_T *xs)
{
struct ispsoftc *isp;
u_int16_t nxti, optr, handle;
u_int8_t local[QENTRY_LEN];
uint16_t nxti, optr, handle;
uint8_t local[QENTRY_LEN];
ispreq_t *reqp, *qep;
int target, i;
@ -3275,7 +3276,7 @@ isp_start(XS_T *xs)
*/
reqp = (ispreq_t *) local;
if (isp->isp_sendmarker) {
u_int8_t n = (IS_DUALBUS(isp)? 2: 1);
uint8_t n = (IS_DUALBUS(isp)? 2: 1);
/*
* Check ports to send markers for...
*/
@ -3405,7 +3406,7 @@ isp_control(struct ispsoftc *isp, ispctl_t ctl, void *arg)
XS_T *xs;
mbreg_t mbs;
int bus, tgt;
u_int16_t handle;
uint16_t handle;
MEMZERO(&mbs, sizeof (mbs));
@ -3613,10 +3614,10 @@ isp_control(struct ispsoftc *isp, ispctl_t ctl, void *arg)
#endif
void
isp_intr(struct ispsoftc *isp, u_int16_t isr, u_int16_t sema, u_int16_t mbox)
isp_intr(struct ispsoftc *isp, uint16_t isr, uint16_t sema, uint16_t mbox)
{
XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs;
u_int16_t iptr, optr, junk;
uint16_t iptr, optr, junk;
int i, nlooked = 0, ndone = 0;
again:
@ -3765,7 +3766,7 @@ isp_intr(struct ispsoftc *isp, u_int16_t isr, u_int16_t sema, u_int16_t mbox)
ispstatusreq_t local, *sp = &local;
isphdr_t *hp;
int type;
u_int16_t oop;
uint16_t oop;
int buddaboom = 0;
hp = (isphdr_t *) ISP_QUEUE_ENTRY(isp->isp_result, optr);
@ -3876,7 +3877,7 @@ isp_intr(struct ispsoftc *isp, u_int16_t isr, u_int16_t sema, u_int16_t mbox)
}
xs = isp_find_xs(isp, sp->req_handle);
if (xs == NULL) {
u_int8_t ts = sp->req_completion_status & 0xff;
uint8_t ts = sp->req_completion_status & 0xff;
MEMZERO(hp, QENTRY_LEN); /* PERF */
/*
* Only whine if this isn't the expected fallout of
@ -4058,7 +4059,7 @@ isp_intr(struct ispsoftc *isp, u_int16_t isr, u_int16_t sema, u_int16_t mbox)
*/
static int
isp_parse_async(struct ispsoftc *isp, u_int16_t mbox)
isp_parse_async(struct ispsoftc *isp, uint16_t mbox)
{
int rval = 0;
int bus;
@ -4385,7 +4386,7 @@ isp_parse_async(struct ispsoftc *isp, u_int16_t mbox)
if (bus & 0x100) {
int i, nh;
u_int16_t handles[16];
uint16_t handles[16];
for (nh = 0, i = 1; i < MAX_MAILBOX(isp); i++) {
if ((bus & (1 << i)) == 0) {
@ -4414,7 +4415,7 @@ isp_parse_async(struct ispsoftc *isp, u_int16_t mbox)
static int
isp_handle_other_response(struct ispsoftc *isp, int type,
isphdr_t *hp, u_int16_t *optrp)
isphdr_t *hp, uint16_t *optrp)
{
switch (type) {
case RQSTYPE_STATUS_CONT:
@ -4847,7 +4848,7 @@ isp_parse_status(struct ispsoftc *isp, ispstatusreq_t *sp, XS_T *xs)
}
static void
isp_fastpost_complete(struct ispsoftc *isp, u_int16_t fph)
isp_fastpost_complete(struct ispsoftc *isp, uint16_t fph)
{
XS_T *xs;
@ -4883,7 +4884,7 @@ static int
isp_mbox_continue(struct ispsoftc *isp)
{
mbreg_t mbs;
u_int16_t *ptr;
uint16_t *ptr;
switch (isp->isp_lastmbxcmd) {
case MBOX_WRITE_RAM_WORD:
@ -4931,7 +4932,7 @@ isp_mbox_continue(struct ispsoftc *isp)
#define HIWRD(x) ((x) >> 16)
#define LOWRD(x) ((x) & 0xffff)
#define ISPOPMAP(a, b) (((a) << 16) | (b))
static const u_int32_t mbpscsi[] = {
static const uint32_t mbpscsi[] = {
ISPOPMAP(0x01, 0x01), /* 0x00: MBOX_NO_OP */
ISPOPMAP(0x1f, 0x01), /* 0x01: MBOX_LOAD_RAM */
ISPOPMAP(0x03, 0x01), /* 0x02: MBOX_EXEC_FIRMWARE */
@ -5127,7 +5128,7 @@ static char *scsi_mbcmd_names[] = {
};
#endif
static const u_int32_t mbpfc[] = {
static const uint32_t mbpfc[] = {
ISPOPMAP(0x01, 0x01), /* 0x00: MBOX_NO_OP */
ISPOPMAP(0x1f, 0x01), /* 0x01: MBOX_LOAD_RAM */
ISPOPMAP(0x03, 0x01), /* 0x02: MBOX_EXEC_FIRMWARE */
@ -5400,7 +5401,7 @@ static void
isp_mboxcmd_qnw(struct ispsoftc *isp, mbreg_t *mbp, int nodelay)
{
unsigned int ibits, obits, box, opcode;
const u_int32_t *mcp;
const uint32_t *mcp;
if (IS_FC(isp)) {
mcp = mbpfc;
@ -5441,7 +5442,7 @@ isp_mboxcmd(struct ispsoftc *isp, mbreg_t *mbp, int logmask)
{
char *cname, *xname, tname[16], mname[16];
unsigned int lim, ibits, obits, box, opcode;
const u_int32_t *mcp;
const uint32_t *mcp;
if (IS_FC(isp)) {
mcp = mbpfc;
@ -5632,7 +5633,7 @@ isp_update_bus(struct ispsoftc *isp, int bus)
MEMZERO(&mbs, sizeof (mbs));
for (tgt = 0; tgt < MAX_TARGETS; tgt++) {
u_int16_t flags, period, offset;
uint16_t flags, period, offset;
int get;
if (sdp->isp_devparam[tgt].dev_enable == 0) {
@ -5802,8 +5803,8 @@ isp_setdfltparm(struct ispsoftc *isp, int channel)
}
if (isp->isp_confopts & ISP_CFG_OWNWWNN) {
isp_prt(isp, ISP_LOGCONFIG, "Using Node WWN 0x%08x%08x",
(u_int32_t) (DEFAULT_NODEWWN(isp) >> 32),
(u_int32_t) (DEFAULT_NODEWWN(isp) & 0xffffffff));
(uint32_t) (DEFAULT_NODEWWN(isp) >> 32),
(uint32_t) (DEFAULT_NODEWWN(isp) & 0xffffffff));
ISP_NODEWWN(isp) = DEFAULT_NODEWWN(isp);
} else {
/*
@ -5814,8 +5815,8 @@ isp_setdfltparm(struct ispsoftc *isp, int channel)
}
if (isp->isp_confopts & ISP_CFG_OWNWWPN) {
isp_prt(isp, ISP_LOGCONFIG, "Using Port WWN 0x%08x%08x",
(u_int32_t) (DEFAULT_PORTWWN(isp) >> 32),
(u_int32_t) (DEFAULT_PORTWWN(isp) & 0xffffffff));
(uint32_t) (DEFAULT_PORTWWN(isp) >> 32),
(uint32_t) (DEFAULT_PORTWWN(isp) & 0xffffffff));
ISP_PORTWWN(isp) = DEFAULT_PORTWWN(isp);
} else {
/*
@ -5912,7 +5913,7 @@ isp_setdfltparm(struct ispsoftc *isp, int channel)
* the default to the SAFE default state- that's not the goal state.
*/
for (tgt = 0; tgt < MAX_TARGETS; tgt++) {
u_int8_t off, per;
uint8_t off, per;
sdp->isp_devparam[tgt].actv_offset = 0;
sdp->isp_devparam[tgt].actv_period = 0;
sdp->isp_devparam[tgt].actv_flags = 0;
@ -5990,7 +5991,7 @@ isp_reinit(struct ispsoftc *isp)
isp->isp_nactive = 0;
for (i = 0; i < isp->isp_maxcmds; i++) {
u_int16_t handle;
uint16_t handle;
xs = isp->isp_xflist[i];
if (xs == NULL) {
continue;
@ -6015,10 +6016,10 @@ static int
isp_read_nvram(struct ispsoftc *isp)
{
int i, amt;
u_int8_t csum, minversion;
uint8_t csum, minversion;
union {
u_int8_t _x[ISP2100_NVRAM_SIZE];
u_int16_t _s[ISP2100_NVRAM_SIZE>>1];
uint8_t _x[ISP2100_NVRAM_SIZE];
uint16_t _s[ISP2100_NVRAM_SIZE>>1];
} _n;
#define nvram_data _n._x
#define nvram_words _n._s
@ -6086,10 +6087,10 @@ isp_read_nvram(struct ispsoftc *isp)
}
static void
isp_rdnvram_word(struct ispsoftc *isp, int wo, u_int16_t *rp)
isp_rdnvram_word(struct ispsoftc *isp, int wo, uint16_t *rp)
{
int i, cbits;
u_int16_t bit, rqst;
uint16_t bit, rqst;
ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT);
USEC_DELAY(2);
@ -6134,7 +6135,7 @@ isp_rdnvram_word(struct ispsoftc *isp, int wo, u_int16_t *rp)
*/
*rp = 0;
for (i = 0; i < 16; i++) {
u_int16_t rv;
uint16_t rv;
*rp <<= 1;
ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT|BIU_NVRAM_CLOCK);
USEC_DELAY(2);
@ -6152,7 +6153,7 @@ isp_rdnvram_word(struct ispsoftc *isp, int wo, u_int16_t *rp)
}
static void
isp_parse_nvram_1020(struct ispsoftc *isp, u_int8_t *nvram_data)
isp_parse_nvram_1020(struct ispsoftc *isp, uint8_t *nvram_data)
{
sdparam *sdp = (sdparam *) isp->isp_param;
int tgt;
@ -6278,7 +6279,7 @@ isp_parse_nvram_1020(struct ispsoftc *isp, u_int8_t *nvram_data)
}
static void
isp_parse_nvram_1080(struct ispsoftc *isp, int bus, u_int8_t *nvram_data)
isp_parse_nvram_1080(struct ispsoftc *isp, int bus, uint8_t *nvram_data)
{
sdparam *sdp = (sdparam *) isp->isp_param;
int tgt;
@ -6370,7 +6371,7 @@ isp_parse_nvram_1080(struct ispsoftc *isp, int bus, u_int8_t *nvram_data)
}
static void
isp_parse_nvram_12160(struct ispsoftc *isp, int bus, u_int8_t *nvram_data)
isp_parse_nvram_12160(struct ispsoftc *isp, int bus, uint8_t *nvram_data)
{
sdparam *sdp = (sdparam *) isp->isp_param;
int tgt;
@ -6461,10 +6462,10 @@ isp_parse_nvram_12160(struct ispsoftc *isp, int bus, u_int8_t *nvram_data)
}
static void
isp_parse_nvram_2100(struct ispsoftc *isp, u_int8_t *nvram_data)
isp_parse_nvram_2100(struct ispsoftc *isp, uint8_t *nvram_data)
{
fcparam *fcp = (fcparam *) isp->isp_param;
u_int64_t wwn;
uint64_t wwn;
/*
* There is NVRAM storage for both Port and Node entities-
@ -6480,9 +6481,9 @@ isp_parse_nvram_2100(struct ispsoftc *isp, u_int8_t *nvram_data)
wwn = ISP2100_NVRAM_PORT_NAME(nvram_data);
if (wwn) {
isp_prt(isp, ISP_LOGCONFIG, "NVRAM Port WWN 0x%08x%08x",
(u_int32_t) (wwn >> 32), (u_int32_t) (wwn & 0xffffffff));
(uint32_t) (wwn >> 32), (uint32_t) (wwn & 0xffffffff));
if ((wwn >> 60) == 0) {
wwn |= (((u_int64_t) 2)<< 60);
wwn |= (((uint64_t) 2)<< 60);
}
}
fcp->isp_portwwn = wwn;
@ -6490,14 +6491,14 @@ isp_parse_nvram_2100(struct ispsoftc *isp, u_int8_t *nvram_data)
wwn = ISP2200_NVRAM_NODE_NAME(nvram_data);
if (wwn) {
isp_prt(isp, ISP_LOGCONFIG, "NVRAM Node WWN 0x%08x%08x",
(u_int32_t) (wwn >> 32),
(u_int32_t) (wwn & 0xffffffff));
(uint32_t) (wwn >> 32),
(uint32_t) (wwn & 0xffffffff));
if ((wwn >> 60) == 0) {
wwn |= (((u_int64_t) 2)<< 60);
wwn |= (((uint64_t) 2)<< 60);
}
}
} else {
wwn &= ~((u_int64_t) 0xfff << 48);
wwn &= ~((uint64_t) 0xfff << 48);
}
fcp->isp_nodewwn = wwn;
@ -6517,13 +6518,13 @@ isp_parse_nvram_2100(struct ispsoftc *isp, u_int8_t *nvram_data)
* for the Port WWN.
*/
if (fcp->isp_nodewwn && fcp->isp_portwwn) {
if ((fcp->isp_nodewwn & (((u_int64_t) 0xfff) << 48)) != 0 &&
if ((fcp->isp_nodewwn & (((uint64_t) 0xfff) << 48)) != 0 &&
(fcp->isp_nodewwn >> 60) == 2) {
fcp->isp_nodewwn &= ~((u_int64_t) 0xfff << 48);
fcp->isp_nodewwn &= ~((uint64_t) 0xfff << 48);
}
if ((fcp->isp_portwwn & (((u_int64_t) 0xfff) << 48)) == 0 &&
if ((fcp->isp_portwwn & (((uint64_t) 0xfff) << 48)) == 0 &&
(fcp->isp_portwwn >> 60) == 2) {
fcp->isp_portwwn |= ((u_int64_t) 1 << 56);
fcp->isp_portwwn |= ((uint64_t) 1 << 56);
}
}
@ -6561,7 +6562,7 @@ isp2200_fw_dump(struct ispsoftc *isp)
{
int i, j;
mbreg_t mbs;
u_int16_t *ptr;
uint16_t *ptr;
MEMZERO(&mbs, sizeof (mbs));
ptr = FCPARAM(isp)->isp_dump_data;
@ -6706,7 +6707,7 @@ isp2300_fw_dump(struct ispsoftc *isp)
{
int i, j;
mbreg_t mbs;
u_int16_t *ptr;
uint16_t *ptr;
MEMZERO(&mbs, sizeof (mbs));
ptr = FCPARAM(isp)->isp_dump_data;

View File

@ -46,7 +46,7 @@ ispfwfunc *isp_get_firmware_p = NULL;
static d_ioctl_t ispioctl;
static void isp_intr_enable(void *);
static void isp_cam_async(void *, u_int32_t, struct cam_path *, void *);
static void isp_cam_async(void *, uint32_t, struct cam_path *, void *);
static void isp_poll(struct cam_sim *);
static timeout_t isp_watchdog;
static void isp_kthread(void *);
@ -258,7 +258,7 @@ ispioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *t
#ifdef ISP_FW_CRASH_DUMP
case ISP_GET_FW_CRASH_DUMP:
{
u_int16_t *ptr = FCPARAM(isp)->isp_dump_data;
uint16_t *ptr = FCPARAM(isp)->isp_dump_data;
size_t sz;
retval = 0;
@ -452,7 +452,7 @@ ispioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *t
case ISP_SET_FC_PARAM:
{
struct isp_fc_param *f = (struct isp_fc_param *) addr;
u_int32_t param = f->parameter;
uint32_t param = f->parameter;
if (!IS_FC(isp)) {
retval = EINVAL;
@ -508,7 +508,7 @@ ispioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *t
{
int needmarker;
struct isp_fc_tsk_mgmt *fct = (struct isp_fc_tsk_mgmt *) addr;
u_int16_t loopid;
uint16_t loopid;
mbreg_t mbs;
if (IS_SCSI(isp)) {
@ -783,7 +783,7 @@ isp_en_lun(struct ispsoftc *isp, union ccb *ccb)
{
struct ccb_en_lun *cel = &ccb->cel;
tstate_t *tptr;
u_int32_t seq;
uint32_t seq;
int bus, cmd, av, wildcard, tm_on;
lun_id_t lun;
target_id_t tgt;
@ -1026,7 +1026,7 @@ isp_ledone(struct ispsoftc *isp, lun_entry_t *lep)
{
const char lfmt[] = "lun %d now %sabled for target mode on channel %d";
union ccb *ccb;
u_int32_t seq;
uint32_t seq;
tstate_t *tptr;
int av;
struct ccb_en_lun *cel;
@ -1201,9 +1201,9 @@ isp_target_start_ctio(struct ispsoftc *isp, union ccb *ccb)
{
void *qe;
struct ccb_scsiio *cso = &ccb->csio;
u_int16_t *hp, save_handle;
u_int16_t nxti, optr;
u_int8_t local[QENTRY_LEN];
uint16_t *hp, save_handle;
uint16_t nxti, optr;
uint8_t local[QENTRY_LEN];
if (isp_getrqentry(isp, &nxti, &optr, &qe)) {
@ -1311,7 +1311,7 @@ isp_target_start_ctio(struct ispsoftc *isp, union ccb *ccb)
cto->ct_lun = ccb->ccb_h.target_lun;
cto->ct_fwhandle = AT_GET_HANDLE(cso->tag_id);
if (AT_HAS_TAG(cso->tag_id)) {
cto->ct_tag_val = (u_int8_t) AT_GET_TAG(cso->tag_id);
cto->ct_tag_val = (uint8_t) AT_GET_TAG(cso->tag_id);
cto->ct_flags |= CT_TQAE;
}
if (ccb->ccb_h.flags & CAM_DIS_DISCONNECT) {
@ -1385,7 +1385,7 @@ isp_target_putback_atio(union ccb *ccb)
{
struct ispsoftc *isp;
struct ccb_scsiio *cso;
u_int16_t nxti, optr;
uint16_t nxti, optr;
void *qe;
isp = XS_ISP(ccb);
@ -1697,7 +1697,7 @@ isp_handle_platform_ctio(struct ispsoftc *isp, void *arg)
{
union ccb *ccb;
int sentstatus, ok, notify_cam, resid = 0;
u_int16_t tval;
uint16_t tval;
/*
* CTIO and CTIO2 are close enough....
@ -1868,7 +1868,7 @@ isp_handle_platform_notify_fc(struct ispsoftc *isp, in_fcentry_t *inp)
#endif
static void
isp_cam_async(void *cbarg, u_int32_t code, struct cam_path *path, void *arg)
isp_cam_async(void *cbarg, uint32_t code, struct cam_path *path, void *arg)
{
struct cam_sim *sim;
struct ispsoftc *isp;
@ -1878,7 +1878,7 @@ isp_cam_async(void *cbarg, u_int32_t code, struct cam_path *path, void *arg)
switch (code) {
case AC_LOST_DEVICE:
if (IS_SCSI(isp)) {
u_int16_t oflags, nflags;
uint16_t oflags, nflags;
sdparam *sdp = isp->isp_param;
int tgt;
@ -1916,7 +1916,7 @@ static void
isp_poll(struct cam_sim *sim)
{
struct ispsoftc *isp = cam_sim_softc(sim);
u_int16_t isr, sema, mbox;
uint16_t isr, sema, mbox;
ISP_LOCK(isp);
if (ISP_READ_ISR(isp, &isr, &sema, &mbox)) {
@ -1931,7 +1931,7 @@ isp_watchdog(void *arg)
{
XS_T *xs = arg;
struct ispsoftc *isp = XS_ISP(xs);
u_int32_t handle;
uint32_t handle;
int iok;
/*
@ -1944,7 +1944,7 @@ isp_watchdog(void *arg)
isp->isp_osinfo.intsok = 0;
handle = isp_find_handle(isp, xs);
if (handle) {
u_int16_t isr, sema, mbox;
uint16_t isr, sema, mbox;
if (XS_CMD_DONE_P(xs)) {
isp_prt(isp, ISP_LOGDEBUG1,
@ -1989,7 +1989,7 @@ isp_watchdog(void *arg)
XS_CMD_C_WDOG(xs);
isp_done(xs);
} else {
u_int16_t nxti, optr;
uint16_t nxti, optr;
ispreq_t local, *mp= &local, *qe;
XS_CMD_C_WDOG(xs);
@ -2137,7 +2137,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
case CMD_QUEUED:
ccb->ccb_h.status |= CAM_SIM_QUEUED;
if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) {
u_int64_t ticks = (u_int64_t) hz;
uint64_t ticks = (uint64_t) hz;
if (ccb->ccb_h.timeout == CAM_TIME_DEFAULT)
ticks = 60 * 1000 * ticks;
else
@ -2211,7 +2211,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
break;
}
for (i = 0; isp->isp_osinfo.leact[seq] && i < 30 * 1000; i++) {
u_int16_t isr, sema, mbox;
uint16_t isr, sema, mbox;
if (ISP_READ_ISR(isp, &isr, &sema, &mbox)) {
isp_intr(isp, isr, sema, mbox);
}
@ -2345,7 +2345,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
if (IS_SCSI(isp)) {
#ifndef CAM_NEW_TRAN_CODE
sdparam *sdp = isp->isp_param;
u_int16_t *dptr;
uint16_t *dptr;
bus = cam_sim_bus(xpt_path_sim(cts->ccb_h.path));
@ -2408,7 +2408,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
struct ccb_trans_settings_spi *spi =
&cts->xport_specific.spi;
sdparam *sdp = isp->isp_param;
u_int16_t *dptr;
uint16_t *dptr;
bus = cam_sim_bus(xpt_path_sim(cts->ccb_h.path));
sdp += bus;
@ -2522,7 +2522,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
#endif
sdparam *sdp = isp->isp_param;
int bus = cam_sim_bus(xpt_path_sim(cts->ccb_h.path));
u_int16_t dval, pval, oval;
uint16_t dval, pval, oval;
sdp += bus;
@ -2920,10 +2920,10 @@ isp_async(struct ispsoftc *isp, ispasync_t cmd, void *arg)
isp_prt(isp, ISP_LOGINFO, fmt, tgt, lp->loopid, lp->portid,
roles[lp->roles & 0x3],
(lp->valid)? "Arrived" : "Departed",
(u_int32_t) (lp->port_wwn >> 32),
(u_int32_t) (lp->port_wwn & 0xffffffffLL),
(u_int32_t) (lp->node_wwn >> 32),
(u_int32_t) (lp->node_wwn & 0xffffffffLL));
(uint32_t) (lp->port_wwn >> 32),
(uint32_t) (lp->port_wwn & 0xffffffffLL),
(uint32_t) (lp->node_wwn >> 32),
(uint32_t) (lp->node_wwn & 0xffffffffLL));
ISPLOCK_2_CAMLOCK(isp);
if (xpt_create_path(&tmppath, NULL, cam_sim_path(isp->isp_sim),
@ -3114,7 +3114,7 @@ isp_async(struct ispsoftc *isp, ispasync_t cmd, void *arg)
#endif
case ISPASYNC_FW_CRASH:
{
u_int16_t mbox1, mbox6;
uint16_t mbox1, mbox6;
mbox1 = ISP_READ(isp, OUTMAILBOX1);
if (IS_DUALBUS(isp)) {
mbox6 = ISP_READ(isp, OUTMAILBOX6);

View File

@ -61,9 +61,6 @@
#include "opt_ddb.h"
#include "opt_isp.h"
/* disabled until done correctly */
/* #define ISP_DAC_SUPPORTED 1 */
/*
* Efficiency- get rid of SBus code && tests unless we need them.
*/
@ -82,16 +79,16 @@
#define ISP_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY
#endif
typedef void ispfwfunc(int, int, int, u_int16_t **);
typedef void ispfwfunc(int, int, int, uint16_t **);
#ifdef ISP_TARGET_MODE
#define ISP_TARGET_FUNCTIONS 1
#define ATPDPSIZE 256
typedef struct {
u_int32_t orig_datalen;
u_int32_t bytes_xfered;
u_int32_t last_xframt;
u_int32_t tag : 16,
uint32_t orig_datalen;
uint32_t bytes_xfered;
uint32_t last_xframt;
uint32_t tag : 16,
lun : 13, /* not enough */
state : 3;
} atio_private_data_t;
@ -109,7 +106,7 @@ typedef struct tstate {
struct ccb_hdr_slist inots;
lun_id_t lun;
int bus;
u_int32_t hold;
uint32_t hold;
int atio_count;
int inot_count;
} tstate_t;
@ -123,16 +120,16 @@ typedef struct tstate {
struct isposinfo {
struct ispsoftc * next;
u_int64_t default_port_wwn;
u_int64_t default_node_wwn;
u_int32_t default_id;
uint64_t default_port_wwn;
uint64_t default_node_wwn;
uint32_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 : 1,
uint8_t : 1,
fcbsy : 1,
ktmature : 1,
mboxwaiting : 1,
@ -148,7 +145,7 @@ struct isposinfo {
#ifdef ISP_TARGET_MODE
#define TM_WILDCARD_ENABLED 0x02
#define TM_TMODE_ENABLED 0x01
u_int8_t tmflags[2]; /* two busses */
uint8_t tmflags[2]; /* two busses */
#define NLEACT 4
union ccb * leact[NLEACT];
tstate_t tsdflt[2]; /* two busses */
@ -249,6 +246,7 @@ default: \
#endif
#define XS_T struct ccb_scsiio
#define XS_DMA_ADDR_T bus_addr_t
#define XS_ISP(ccb) ((struct ispsoftc *) (ccb)->ccb_h.spriv_ptr1)
#define XS_CHANNEL(ccb) cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))
#define XS_TGT(ccb) (ccb)->ccb_h.target_id
@ -323,20 +321,20 @@ default: \
*(d) = (isp->isp_bustype == ISP_BT_SBUS)? s : bswap16(s)
#define ISP_IOXPUT_32(isp, s, d) \
*(d) = (isp->isp_bustype == ISP_BT_SBUS)? s : bswap32(s)
#define ISP_IOXGET_8(isp, s, d) d = (*((u_int8_t *)s))
#define ISP_IOXGET_8(isp, s, d) d = (*((uint8_t *)s))
#define ISP_IOXGET_16(isp, s, d) \
d = (isp->isp_bustype == ISP_BT_SBUS)? \
*((u_int16_t *)s) : bswap16(*((u_int16_t *)s))
*((uint16_t *)s) : bswap16(*((uint16_t *)s))
#define ISP_IOXGET_32(isp, s, d) \
d = (isp->isp_bustype == ISP_BT_SBUS)? \
*((u_int32_t *)s) : bswap32(*((u_int32_t *)s))
*((uint32_t *)s) : bswap32(*((uint32_t *)s))
#else
#define ISP_IOXPUT_8(isp, s, d) *(d) = s
#define ISP_IOXPUT_16(isp, s, d) *(d) = bswap16(s)
#define ISP_IOXPUT_32(isp, s, d) *(d) = bswap32(s)
#define ISP_IOXGET_8(isp, s, d) d = (*((u_int8_t *)s))
#define ISP_IOXGET_16(isp, s, d) d = bswap16(*((u_int16_t *)s))
#define ISP_IOXGET_32(isp, s, d) d = bswap32(*((u_int32_t *)s))
#define ISP_IOXGET_8(isp, s, d) d = (*((uint8_t *)s))
#define ISP_IOXGET_16(isp, s, d) d = bswap16(*((uint16_t *)s))
#define ISP_IOXGET_32(isp, s, d) d = bswap32(*((uint32_t *)s))
#endif
#define ISP_SWIZZLE_NVRAM_WORD(isp, rp) *rp = bswap16(*rp)
#else
@ -357,6 +355,10 @@ default: \
#include <dev/isp/ispvar.h>
#include <dev/isp/ispmbox.h>
#ifdef ISP_TARGET_MODE
#include <dev/isp/isp_tpublic.h>
#endif
void isp_prt(struct ispsoftc *, int level, const char *, ...)
__printflike(3, 4);
/*
@ -434,7 +436,7 @@ isp_mbox_wait_complete(struct ispsoftc *isp)
int lim = ((isp->isp_mbxwrk0)? 240 : 60) * 10000;
int j;
for (j = 0; j < lim; j++) {
u_int16_t isr, sema, mbox;
uint16_t isr, sema, mbox;
if (isp->isp_mboxbsy == 0) {
break;
}
@ -454,11 +456,11 @@ isp_mbox_wait_complete(struct ispsoftc *isp)
}
}
static __inline u_int64_t nanotime_sub(struct timespec *, struct timespec *);
static __inline u_int64_t
static __inline uint64_t nanotime_sub(struct timespec *, struct timespec *);
static __inline uint64_t
nanotime_sub(struct timespec *b, struct timespec *a)
{
u_int64_t elapsed;
uint64_t elapsed;
struct timespec x = *b;
timespecsub(&x, a);
elapsed = GET_NANOSEC(&x);

View File

@ -75,11 +75,11 @@
*/
#define ISP_STATS_VERSION 0
typedef struct {
u_int8_t isp_stat_version;
u_int8_t isp_type; /* (ro) reflects chip type */
u_int8_t isp_revision; /* (ro) reflects chip version */
u_int8_t unused1;
u_int32_t unused2;
uint8_t isp_stat_version;
uint8_t isp_type; /* (ro) reflects chip type */
uint8_t isp_revision; /* (ro) reflects chip version */
uint8_t unused1;
uint32_t unused2;
/*
* Statistics Counters
*/
@ -92,7 +92,7 @@ typedef struct {
#define ISP_FPHCCMCPLT 5
#define ISP_RSCCHIWAT 6
#define ISP_FPCCHIWAT 7
u_int64_t isp_stats[ISP_NSTATS];
uint64_t isp_stats[ISP_NSTATS];
} isp_stats_t;
#define ISP_GET_STATS _IOR(ISP_IOC, 6, isp_stats_t)
@ -110,12 +110,12 @@ typedef struct {
* only), 24 bit Port ID and Node and Port WWNs.
*/
struct isp_fc_device {
u_int32_t loopid; /* 0..255 */
u_int32_t : 6,
uint32_t loopid; /* 0..255 */
uint32_t : 6,
role : 2,
portid : 24; /* 24 bit Port ID */
u_int64_t node_wwn;
u_int64_t port_wwn;
uint64_t node_wwn;
uint64_t port_wwn;
};
#define ISP_FC_GETDINFO _IOWR(ISP_IOC, 9, struct isp_fc_device)
@ -130,7 +130,7 @@ struct isp_fc_device {
* topology and capabilities.
*/
struct isp_hba_device {
u_int32_t
uint32_t
: 8,
: 4,
fc_speed : 4, /* Gbps */
@ -140,14 +140,14 @@ struct isp_hba_device {
fc_scsi_supported : 1,
fc_topology : 3,
fc_loopid : 8;
u_int8_t fc_fw_major;
u_int8_t fc_fw_minor;
u_int8_t fc_fw_micro;
u_int8_t reserved;
u_int64_t nvram_node_wwn;
u_int64_t nvram_port_wwn;
u_int64_t active_node_wwn;
u_int64_t active_port_wwn;
uint8_t fc_fw_major;
uint8_t fc_fw_minor;
uint8_t fc_fw_micro;
uint8_t reserved;
uint64_t nvram_node_wwn;
uint64_t nvram_port_wwn;
uint64_t active_node_wwn;
uint64_t active_port_wwn;
};
#define ISP_TOPO_UNKNOWN 0 /* connection topology unknown */
@ -175,7 +175,7 @@ struct isp_hba_device {
struct isp_fc_param {
char param_name[16]; /* null terminated */
u_int32_t parameter;
uint32_t parameter;
};
#define ISP_GET_FC_PARAM _IOWR(ISP_IOC, 98, struct isp_fc_param)
@ -185,8 +185,8 @@ struct isp_fc_param {
* Various Reset Goodies
*/
struct isp_fc_tsk_mgmt {
u_int32_t loopid; /* 0..255 */
u_int32_t lun;
uint32_t loopid; /* 0..255 */
uint32_t lun;
enum {
CLEAR_ACA, TARGET_RESET, LUN_RESET, CLEAR_TASK_SET, ABORT_TASK_SET
} action;

View File

@ -26,12 +26,29 @@
* SUCH DAMAGE.
*
*/
#ifdef __FreeBSD__
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#endif
#ifdef __NetBSD__
#include <dev/ic/isp_netbsd.h>
#endif
#ifdef __FreeBSD__
#include <dev/isp/isp_freebsd.h>
#endif
#ifdef __OpenBSD__
#include <dev/ic/isp_openbsd.h>
#endif
#ifdef __linux__
#include "isp_linux.h"
#endif
#ifdef __svr4__
#include "isp_solaris.h"
#endif
int
isp_save_xs(struct ispsoftc *isp, XS_T *xs, u_int16_t *handlep)
isp_save_xs(ispsoftc_t *isp, XS_T *xs, uint16_t *handlep)
{
int i, j;
@ -50,28 +67,28 @@ isp_save_xs(struct ispsoftc *isp, XS_T *xs, u_int16_t *handlep)
*handlep = j+1;
if (++j == isp->isp_maxcmds)
j = 0;
isp->isp_lasthdls = (u_int16_t)j;
isp->isp_lasthdls = (uint16_t)j;
return (0);
}
XS_T *
isp_find_xs(struct ispsoftc *isp, u_int16_t handle)
isp_find_xs(ispsoftc_t *isp, uint16_t handle)
{
if (handle < 1 || handle > (u_int16_t) isp->isp_maxcmds) {
if (handle < 1 || handle > (uint16_t) isp->isp_maxcmds) {
return (NULL);
} else {
return (isp->isp_xflist[handle - 1]);
}
}
u_int16_t
isp_find_handle(struct ispsoftc *isp, XS_T *xs)
uint16_t
isp_find_handle(ispsoftc_t *isp, XS_T *xs)
{
int i;
if (xs != NULL) {
for (i = 0; i < isp->isp_maxcmds; i++) {
if (isp->isp_xflist[i] == xs) {
return ((u_int16_t) i+1);
return ((uint16_t) i+1);
}
}
}
@ -79,30 +96,30 @@ isp_find_handle(struct ispsoftc *isp, XS_T *xs)
}
int
isp_handle_index(u_int16_t handle)
isp_handle_index(uint16_t handle)
{
return (handle-1);
}
u_int16_t
uint16_t
isp_index_handle(int index)
{
return (index+1);
}
void
isp_destroy_handle(struct ispsoftc *isp, u_int16_t handle)
isp_destroy_handle(ispsoftc_t *isp, uint16_t handle)
{
if (handle > 0 && handle <= (u_int16_t) isp->isp_maxcmds) {
if (handle > 0 && handle <= (uint16_t) isp->isp_maxcmds) {
isp->isp_xflist[handle - 1] = NULL;
}
}
int
isp_getrqentry(struct ispsoftc *isp, u_int16_t *iptrp,
u_int16_t *optrp, void **resultp)
isp_getrqentry(ispsoftc_t *isp, uint16_t *iptrp,
uint16_t *optrp, void **resultp)
{
volatile u_int16_t iptr, optr;
volatile uint16_t iptr, optr;
optr = isp->isp_reqodx = READ_REQUEST_QUEUE_OUT_POINTER(isp);
iptr = isp->isp_reqidx;
@ -120,11 +137,11 @@ isp_getrqentry(struct ispsoftc *isp, u_int16_t *iptrp,
#define TBA (4 * (((QENTRY_LEN >> 2) * 3) + 1) + 1)
void
isp_print_qentry(struct ispsoftc *isp, char *msg, int idx, void *arg)
isp_print_qentry(ispsoftc_t *isp, char *msg, int idx, void *arg)
{
char buf[TBA];
int amt, i, j;
u_int8_t *ptr = arg;
uint8_t *ptr = arg;
isp_prt(isp, ISP_LOGALL, "%s index %d=>", msg, idx);
for (buf[0] = 0, amt = i = 0; i < 4; i++) {
@ -138,10 +155,10 @@ isp_print_qentry(struct ispsoftc *isp, char *msg, int idx, void *arg)
}
void
isp_print_bytes(struct ispsoftc *isp, char *msg, int amt, void *arg)
isp_print_bytes(ispsoftc_t *isp, char *msg, int amt, void *arg)
{
char buf[128];
u_int8_t *ptr = arg;
uint8_t *ptr = arg;
int off;
if (msg)
@ -178,7 +195,7 @@ isp_print_bytes(struct ispsoftc *isp, char *msg, int amt, void *arg)
*/
int
isp_fc_runstate(struct ispsoftc *isp, int tval)
isp_fc_runstate(ispsoftc_t *isp, int tval)
{
fcparam *fcp;
int *tptr;
@ -229,7 +246,7 @@ isp_fc_runstate(struct ispsoftc *isp, int tval)
* Swizzle/Copy Functions
*/
void
isp_copy_out_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst)
isp_copy_out_hdr(ispsoftc_t *isp, isphdr_t *hpsrc, isphdr_t *hpdst)
{
if (ISP_IS_SBUS(isp)) {
ISP_IOXPUT_8(isp, hpsrc->rqs_entry_type,
@ -253,7 +270,7 @@ isp_copy_out_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst)
}
void
isp_copy_in_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst)
isp_copy_in_hdr(ispsoftc_t *isp, isphdr_t *hpsrc, isphdr_t *hpdst)
{
if (ISP_IS_SBUS(isp)) {
ISP_IOXGET_8(isp, &hpsrc->rqs_entry_type,
@ -277,9 +294,9 @@ isp_copy_in_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst)
}
int
isp_get_response_type(struct ispsoftc *isp, isphdr_t *hp)
isp_get_response_type(ispsoftc_t *isp, isphdr_t *hp)
{
u_int8_t type;
uint8_t type;
if (ISP_IS_SBUS(isp)) {
ISP_IOXGET_8(isp, &hp->rqs_entry_count, type);
} else {
@ -289,7 +306,7 @@ isp_get_response_type(struct ispsoftc *isp, isphdr_t *hp)
}
void
isp_put_request(struct ispsoftc *isp, ispreq_t *rqsrc, ispreq_t *rqdst)
isp_put_request(ispsoftc_t *isp, ispreq_t *rqsrc, ispreq_t *rqdst)
{
int i;
isp_copy_out_hdr(isp, &rqsrc->req_header, &rqdst->req_header);
@ -317,7 +334,7 @@ isp_put_request(struct ispsoftc *isp, ispreq_t *rqsrc, ispreq_t *rqdst)
}
void
isp_put_request_t2(struct ispsoftc *isp, ispreqt2_t *tqsrc, ispreqt2_t *tqdst)
isp_put_request_t2(ispsoftc_t *isp, ispreqt2_t *tqsrc, ispreqt2_t *tqdst)
{
int i;
isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header);
@ -342,7 +359,7 @@ isp_put_request_t2(struct ispsoftc *isp, ispreqt2_t *tqsrc, ispreqt2_t *tqdst)
}
void
isp_put_request_t2e(struct ispsoftc *isp, ispreqt2e_t *tqsrc, ispreqt2e_t *tqdst)
isp_put_request_t2e(ispsoftc_t *isp, ispreqt2e_t *tqsrc, ispreqt2e_t *tqdst)
{
int i;
isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header);
@ -366,7 +383,7 @@ isp_put_request_t2e(struct ispsoftc *isp, ispreqt2e_t *tqsrc, ispreqt2e_t *tqdst
}
void
isp_put_request_t3(struct ispsoftc *isp, ispreqt3_t *tqsrc, ispreqt3_t *tqdst)
isp_put_request_t3(ispsoftc_t *isp, ispreqt3_t *tqsrc, ispreqt3_t *tqdst)
{
int i;
isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header);
@ -393,7 +410,7 @@ isp_put_request_t3(struct ispsoftc *isp, ispreqt3_t *tqsrc, ispreqt3_t *tqdst)
}
void
isp_put_request_t3e(struct ispsoftc *isp, ispreqt3e_t *tqsrc, ispreqt3e_t *tqdst)
isp_put_request_t3e(ispsoftc_t *isp, ispreqt3e_t *tqsrc, ispreqt3e_t *tqdst)
{
int i;
isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header);
@ -419,7 +436,7 @@ isp_put_request_t3e(struct ispsoftc *isp, ispreqt3e_t *tqsrc, ispreqt3e_t *tqdst
}
void
isp_put_extended_request(struct ispsoftc *isp, ispextreq_t *xqsrc,
isp_put_extended_request(ispsoftc_t *isp, ispextreq_t *xqsrc,
ispextreq_t *xqdst)
{
int i;
@ -442,7 +459,7 @@ isp_put_extended_request(struct ispsoftc *isp, ispextreq_t *xqsrc,
}
void
isp_put_cont_req(struct ispsoftc *isp, ispcontreq_t *cqsrc, ispcontreq_t *cqdst)
isp_put_cont_req(ispsoftc_t *isp, ispcontreq_t *cqsrc, ispcontreq_t *cqdst)
{
int i;
isp_copy_out_hdr(isp, &cqsrc->req_header, &cqdst->req_header);
@ -455,7 +472,7 @@ isp_put_cont_req(struct ispsoftc *isp, ispcontreq_t *cqsrc, ispcontreq_t *cqdst)
}
void
isp_put_cont64_req(struct ispsoftc *isp, ispcontreq64_t *cqsrc,
isp_put_cont64_req(ispsoftc_t *isp, ispcontreq64_t *cqsrc,
ispcontreq64_t *cqdst)
{
int i;
@ -471,7 +488,7 @@ isp_put_cont64_req(struct ispsoftc *isp, ispcontreq64_t *cqsrc,
}
void
isp_get_response(struct ispsoftc *isp, ispstatusreq_t *spsrc,
isp_get_response(ispsoftc_t *isp, ispstatusreq_t *spsrc,
ispstatusreq_t *spdst)
{
int i;
@ -496,7 +513,7 @@ isp_get_response(struct ispsoftc *isp, ispstatusreq_t *spsrc,
}
void
isp_get_response_x(struct ispsoftc *isp, ispstatus_cont_t *cpsrc,
isp_get_response_x(ispsoftc_t *isp, ispstatus_cont_t *cpsrc,
ispstatus_cont_t *cpdst)
{
int i;
@ -508,7 +525,7 @@ isp_get_response_x(struct ispsoftc *isp, ispstatus_cont_t *cpsrc,
}
void
isp_get_rio2(struct ispsoftc *isp, isp_rio2_t *r2src, isp_rio2_t *r2dst)
isp_get_rio2(ispsoftc_t *isp, isp_rio2_t *r2src, isp_rio2_t *r2dst)
{
int i;
isp_copy_in_hdr(isp, &r2src->req_header, &r2dst->req_header);
@ -524,7 +541,7 @@ isp_get_rio2(struct ispsoftc *isp, isp_rio2_t *r2src, isp_rio2_t *r2dst)
}
void
isp_put_icb(struct ispsoftc *isp, isp_icb_t *Is, isp_icb_t *Id)
isp_put_icb(ispsoftc_t *isp, isp_icb_t *Is, isp_icb_t *Id)
{
int i;
if (ISP_IS_SBUS(isp)) {
@ -590,7 +607,7 @@ isp_put_icb(struct ispsoftc *isp, isp_icb_t *Is, isp_icb_t *Id)
}
void
isp_get_pdb(struct ispsoftc *isp, isp_pdb_t *src, isp_pdb_t *dst)
isp_get_pdb(ispsoftc_t *isp, isp_pdb_t *src, isp_pdb_t *dst)
{
int i;
ISP_IOXGET_16(isp, &src->pdb_options, dst->pdb_options);
@ -648,7 +665,7 @@ isp_get_pdb(struct ispsoftc *isp, isp_pdb_t *src, isp_pdb_t *dst)
* CT_HDR canonicalization- only needed for SNS responses
*/
void
isp_get_ct_hdr(struct ispsoftc *isp, ct_hdr_t *src, ct_hdr_t *dst)
isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *src, ct_hdr_t *dst)
{
ISP_IOXGET_8(isp, &src->ct_revision, dst->ct_revision);
ISP_IOXGET_8(isp, &src->ct_portid[0], dst->ct_portid[0]);
@ -673,7 +690,7 @@ isp_get_ct_hdr(struct ispsoftc *isp, ct_hdr_t *src, ct_hdr_t *dst)
* isn't always 16 bit words.
*/
void
isp_put_sns_request(struct ispsoftc *isp, sns_screq_t *src, sns_screq_t *dst)
isp_put_sns_request(ispsoftc_t *isp, sns_screq_t *src, sns_screq_t *dst)
{
int i, nw = (int) src->snscb_sblen;
ISP_IOXPUT_16(isp, src->snscb_rblen, &dst->snscb_rblen);
@ -688,7 +705,7 @@ isp_put_sns_request(struct ispsoftc *isp, sns_screq_t *src, sns_screq_t *dst)
}
void
isp_put_gid_ft_request(struct ispsoftc *isp, sns_gid_ft_req_t *src,
isp_put_gid_ft_request(ispsoftc_t *isp, sns_gid_ft_req_t *src,
sns_gid_ft_req_t *dst)
{
ISP_IOXPUT_16(isp, src->snscb_rblen, &dst->snscb_rblen);
@ -706,7 +723,7 @@ isp_put_gid_ft_request(struct ispsoftc *isp, sns_gid_ft_req_t *src,
}
void
isp_put_gxn_id_request(struct ispsoftc *isp, sns_gxn_id_req_t *src,
isp_put_gxn_id_request(ispsoftc_t *isp, sns_gxn_id_req_t *src,
sns_gxn_id_req_t *dst)
{
ISP_IOXPUT_16(isp, src->snscb_rblen, &dst->snscb_rblen);
@ -728,7 +745,7 @@ isp_put_gxn_id_request(struct ispsoftc *isp, sns_gxn_id_req_t *src,
* isn't always 16 bit words.
*/
void
isp_get_sns_response(struct ispsoftc *isp, sns_scrsp_t *src,
isp_get_sns_response(ispsoftc_t *isp, sns_scrsp_t *src,
sns_scrsp_t *dst, int nwords)
{
int i;
@ -748,7 +765,7 @@ isp_get_sns_response(struct ispsoftc *isp, sns_scrsp_t *src,
}
void
isp_get_gid_ft_response(struct ispsoftc *isp, sns_gid_ft_rsp_t *src,
isp_get_gid_ft_response(ispsoftc_t *isp, sns_gid_ft_rsp_t *src,
sns_gid_ft_rsp_t *dst, int nwords)
{
int i;
@ -770,7 +787,7 @@ isp_get_gid_ft_response(struct ispsoftc *isp, sns_gid_ft_rsp_t *src,
}
void
isp_get_gxn_id_response(struct ispsoftc *isp, sns_gxn_id_rsp_t *src,
isp_get_gxn_id_response(ispsoftc_t *isp, sns_gxn_id_rsp_t *src,
sns_gxn_id_rsp_t *dst)
{
int i;
@ -780,7 +797,7 @@ isp_get_gxn_id_response(struct ispsoftc *isp, sns_gxn_id_rsp_t *src,
}
void
isp_get_gff_id_response(struct ispsoftc *isp, sns_gff_id_rsp_t *src,
isp_get_gff_id_response(ispsoftc_t *isp, sns_gff_id_rsp_t *src,
sns_gff_id_rsp_t *dst)
{
int i;
@ -792,7 +809,7 @@ isp_get_gff_id_response(struct ispsoftc *isp, sns_gff_id_rsp_t *src,
}
void
isp_get_ga_nxt_response(struct ispsoftc *isp, sns_ga_nxt_rsp_t *src,
isp_get_ga_nxt_response(ispsoftc_t *isp, sns_ga_nxt_rsp_t *src,
sns_ga_nxt_rsp_t *dst)
{
int i;
@ -846,7 +863,7 @@ isp_get_ga_nxt_response(struct ispsoftc *isp, sns_ga_nxt_rsp_t *src,
#ifdef ISP_TARGET_MODE
int
isp_save_xs_tgt(struct ispsoftc *isp, void *xs, u_int16_t *handlep)
isp_save_xs_tgt(ispsoftc_t *isp, void *xs, uint16_t *handlep)
{
int i;
@ -864,23 +881,23 @@ isp_save_xs_tgt(struct ispsoftc *isp, void *xs, u_int16_t *handlep)
}
void *
isp_find_xs_tgt(struct ispsoftc *isp, u_int16_t handle)
isp_find_xs_tgt(ispsoftc_t *isp, uint16_t handle)
{
if (handle < 1 || handle > (u_int16_t) isp->isp_maxcmds) {
if (handle < 1 || handle > (uint16_t) isp->isp_maxcmds) {
return (NULL);
} else {
return (isp->isp_tgtlist[handle - 1]);
}
}
u_int16_t
isp_find_tgt_handle(struct ispsoftc *isp, void *xs)
uint16_t
isp_find_tgt_handle(ispsoftc_t *isp, void *xs)
{
int i;
if (xs != NULL) {
for (i = 0; i < isp->isp_maxcmds; i++) {
if (isp->isp_tgtlist[i] == xs) {
return ((u_int16_t) i+1);
return ((uint16_t) i+1);
}
}
}
@ -888,14 +905,14 @@ isp_find_tgt_handle(struct ispsoftc *isp, void *xs)
}
void
isp_destroy_tgt_handle(struct ispsoftc *isp, u_int16_t handle)
isp_destroy_tgt_handle(ispsoftc_t *isp, uint16_t handle)
{
if (handle > 0 && handle <= (u_int16_t) isp->isp_maxcmds) {
if (handle > 0 && handle <= (uint16_t) isp->isp_maxcmds) {
isp->isp_tgtlist[handle - 1] = NULL;
}
}
void
isp_put_atio(struct ispsoftc *isp, at_entry_t *atsrc, at_entry_t *atdst)
isp_put_atio(ispsoftc_t *isp, at_entry_t *atsrc, at_entry_t *atdst)
{
int i;
isp_copy_out_hdr(isp, &atsrc->at_header, &atdst->at_header);
@ -931,7 +948,7 @@ isp_put_atio(struct ispsoftc *isp, at_entry_t *atsrc, at_entry_t *atdst)
}
void
isp_get_atio(struct ispsoftc *isp, at_entry_t *atsrc, at_entry_t *atdst)
isp_get_atio(ispsoftc_t *isp, at_entry_t *atsrc, at_entry_t *atdst)
{
int i;
isp_copy_in_hdr(isp, &atsrc->at_header, &atdst->at_header);
@ -967,7 +984,7 @@ isp_get_atio(struct ispsoftc *isp, at_entry_t *atsrc, at_entry_t *atdst)
}
void
isp_put_atio2(struct ispsoftc *isp, at2_entry_t *atsrc, at2_entry_t *atdst)
isp_put_atio2(ispsoftc_t *isp, at2_entry_t *atsrc, at2_entry_t *atdst)
{
int i;
isp_copy_out_hdr(isp, &atsrc->at_header, &atdst->at_header);
@ -997,7 +1014,7 @@ isp_put_atio2(struct ispsoftc *isp, at2_entry_t *atsrc, at2_entry_t *atdst)
}
void
isp_put_atio2e(struct ispsoftc *isp, at2e_entry_t *atsrc, at2e_entry_t *atdst)
isp_put_atio2e(ispsoftc_t *isp, at2e_entry_t *atsrc, at2e_entry_t *atdst)
{
int i;
isp_copy_out_hdr(isp, &atsrc->at_header, &atdst->at_header);
@ -1026,7 +1043,7 @@ isp_put_atio2e(struct ispsoftc *isp, at2e_entry_t *atsrc, at2e_entry_t *atdst)
}
void
isp_get_atio2(struct ispsoftc *isp, at2_entry_t *atsrc, at2_entry_t *atdst)
isp_get_atio2(ispsoftc_t *isp, at2_entry_t *atsrc, at2_entry_t *atdst)
{
int i;
isp_copy_in_hdr(isp, &atsrc->at_header, &atdst->at_header);
@ -1056,7 +1073,7 @@ isp_get_atio2(struct ispsoftc *isp, at2_entry_t *atsrc, at2_entry_t *atdst)
}
void
isp_get_atio2e(struct ispsoftc *isp, at2e_entry_t *atsrc, at2e_entry_t *atdst)
isp_get_atio2e(ispsoftc_t *isp, at2e_entry_t *atsrc, at2e_entry_t *atdst)
{
int i;
isp_copy_in_hdr(isp, &atsrc->at_header, &atdst->at_header);
@ -1085,7 +1102,7 @@ isp_get_atio2e(struct ispsoftc *isp, at2e_entry_t *atsrc, at2e_entry_t *atdst)
}
void
isp_put_ctio(struct ispsoftc *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst)
isp_put_ctio(ispsoftc_t *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst)
{
int i;
isp_copy_out_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
@ -1125,7 +1142,7 @@ isp_put_ctio(struct ispsoftc *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst)
}
void
isp_get_ctio(struct ispsoftc *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst)
isp_get_ctio(ispsoftc_t *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst)
{
int i;
isp_copy_in_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
@ -1167,7 +1184,7 @@ isp_get_ctio(struct ispsoftc *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst)
}
void
isp_put_ctio2(struct ispsoftc *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst)
isp_put_ctio2(ispsoftc_t *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst)
{
int i;
isp_copy_out_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
@ -1251,7 +1268,7 @@ isp_put_ctio2(struct ispsoftc *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst)
}
void
isp_put_ctio2e(struct ispsoftc *isp, ct2e_entry_t *ctsrc, ct2e_entry_t *ctdst)
isp_put_ctio2e(ispsoftc_t *isp, ct2e_entry_t *ctsrc, ct2e_entry_t *ctdst)
{
int i;
isp_copy_out_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
@ -1334,7 +1351,7 @@ isp_put_ctio2e(struct ispsoftc *isp, ct2e_entry_t *ctsrc, ct2e_entry_t *ctdst)
}
void
isp_get_ctio2(struct ispsoftc *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst)
isp_get_ctio2(ispsoftc_t *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst)
{
isp_copy_in_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
ISP_IOXGET_16(isp, &ctsrc->ct_reserved, ctdst->ct_reserved);
@ -1351,7 +1368,7 @@ isp_get_ctio2(struct ispsoftc *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst)
}
void
isp_get_ctio2e(struct ispsoftc *isp, ct2e_entry_t *ctsrc, ct2e_entry_t *ctdst)
isp_get_ctio2e(ispsoftc_t *isp, ct2e_entry_t *ctsrc, ct2e_entry_t *ctdst)
{
isp_copy_in_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
ISP_IOXGET_16(isp, &ctsrc->ct_reserved, ctdst->ct_reserved);
@ -1367,7 +1384,7 @@ isp_get_ctio2e(struct ispsoftc *isp, ct2e_entry_t *ctsrc, ct2e_entry_t *ctdst)
}
void
isp_put_enable_lun(struct ispsoftc *isp, lun_entry_t *lesrc, lun_entry_t *ledst)
isp_put_enable_lun(ispsoftc_t *isp, lun_entry_t *lesrc, lun_entry_t *ledst)
{
int i;
isp_copy_out_hdr(isp, &lesrc->le_header, &ledst->le_header);
@ -1404,7 +1421,7 @@ isp_put_enable_lun(struct ispsoftc *isp, lun_entry_t *lesrc, lun_entry_t *ledst)
}
void
isp_get_enable_lun(struct ispsoftc *isp, lun_entry_t *lesrc, lun_entry_t *ledst)
isp_get_enable_lun(ispsoftc_t *isp, lun_entry_t *lesrc, lun_entry_t *ledst)
{
int i;
isp_copy_in_hdr(isp, &lesrc->le_header, &ledst->le_header);
@ -1441,7 +1458,7 @@ isp_get_enable_lun(struct ispsoftc *isp, lun_entry_t *lesrc, lun_entry_t *ledst)
}
void
isp_put_notify(struct ispsoftc *isp, in_entry_t *insrc, in_entry_t *indst)
isp_put_notify(ispsoftc_t *isp, in_entry_t *insrc, in_entry_t *indst)
{
int i;
isp_copy_out_hdr(isp, &insrc->in_header, &indst->in_header);
@ -1481,7 +1498,7 @@ isp_put_notify(struct ispsoftc *isp, in_entry_t *insrc, in_entry_t *indst)
}
void
isp_get_notify(struct ispsoftc *isp, in_entry_t *insrc, in_entry_t *indst)
isp_get_notify(ispsoftc_t *isp, in_entry_t *insrc, in_entry_t *indst)
{
int i;
isp_copy_in_hdr(isp, &insrc->in_header, &indst->in_header);
@ -1521,7 +1538,7 @@ isp_get_notify(struct ispsoftc *isp, in_entry_t *insrc, in_entry_t *indst)
}
void
isp_put_notify_fc(struct ispsoftc *isp, in_fcentry_t *insrc,
isp_put_notify_fc(ispsoftc_t *isp, in_fcentry_t *insrc,
in_fcentry_t *indst)
{
isp_copy_out_hdr(isp, &insrc->in_header, &indst->in_header);
@ -1536,7 +1553,7 @@ isp_put_notify_fc(struct ispsoftc *isp, in_fcentry_t *insrc,
}
void
isp_put_notify_fc_e(struct ispsoftc *isp, in_fcentry_e_t *insrc,
isp_put_notify_fc_e(ispsoftc_t *isp, in_fcentry_e_t *insrc,
in_fcentry_e_t *indst)
{
isp_copy_out_hdr(isp, &insrc->in_header, &indst->in_header);
@ -1550,7 +1567,7 @@ isp_put_notify_fc_e(struct ispsoftc *isp, in_fcentry_e_t *insrc,
}
void
isp_get_notify_fc(struct ispsoftc *isp, in_fcentry_t *insrc,
isp_get_notify_fc(ispsoftc_t *isp, in_fcentry_t *insrc,
in_fcentry_t *indst)
{
isp_copy_in_hdr(isp, &insrc->in_header, &indst->in_header);
@ -1565,7 +1582,7 @@ isp_get_notify_fc(struct ispsoftc *isp, in_fcentry_t *insrc,
}
void
isp_get_notify_fc_e(struct ispsoftc *isp, in_fcentry_e_t *insrc,
isp_get_notify_fc_e(ispsoftc_t *isp, in_fcentry_e_t *insrc,
in_fcentry_e_t *indst)
{
isp_copy_in_hdr(isp, &insrc->in_header, &indst->in_header);
@ -1579,7 +1596,7 @@ isp_get_notify_fc_e(struct ispsoftc *isp, in_fcentry_e_t *insrc,
}
void
isp_put_notify_ack(struct ispsoftc *isp, na_entry_t *nasrc, na_entry_t *nadst)
isp_put_notify_ack(ispsoftc_t *isp, na_entry_t *nasrc, na_entry_t *nadst)
{
int i;
isp_copy_out_hdr(isp, &nasrc->na_header, &nadst->na_header);
@ -1603,7 +1620,7 @@ isp_put_notify_ack(struct ispsoftc *isp, na_entry_t *nasrc, na_entry_t *nadst)
}
void
isp_get_notify_ack(struct ispsoftc *isp, na_entry_t *nasrc, na_entry_t *nadst)
isp_get_notify_ack(ispsoftc_t *isp, na_entry_t *nasrc, na_entry_t *nadst)
{
int i;
isp_copy_in_hdr(isp, &nasrc->na_header, &nadst->na_header);
@ -1627,7 +1644,7 @@ isp_get_notify_ack(struct ispsoftc *isp, na_entry_t *nasrc, na_entry_t *nadst)
}
void
isp_put_notify_ack_fc(struct ispsoftc *isp, na_fcentry_t *nasrc,
isp_put_notify_ack_fc(ispsoftc_t *isp, na_fcentry_t *nasrc,
na_fcentry_t *nadst)
{
int i;
@ -1648,7 +1665,7 @@ isp_put_notify_ack_fc(struct ispsoftc *isp, na_fcentry_t *nasrc,
}
void
isp_put_notify_ack_fc_e(struct ispsoftc *isp, na_fcentry_e_t *nasrc,
isp_put_notify_ack_fc_e(ispsoftc_t *isp, na_fcentry_e_t *nasrc,
na_fcentry_e_t *nadst)
{
int i;
@ -1668,7 +1685,7 @@ isp_put_notify_ack_fc_e(struct ispsoftc *isp, na_fcentry_e_t *nasrc,
}
void
isp_get_notify_ack_fc(struct ispsoftc *isp, na_fcentry_t *nasrc,
isp_get_notify_ack_fc(ispsoftc_t *isp, na_fcentry_t *nasrc,
na_fcentry_t *nadst)
{
int i;
@ -1689,7 +1706,7 @@ isp_get_notify_ack_fc(struct ispsoftc *isp, na_fcentry_t *nasrc,
}
void
isp_get_notify_ack_fc_e(struct ispsoftc *isp, na_fcentry_e_t *nasrc,
isp_get_notify_ack_fc_e(ispsoftc_t *isp, na_fcentry_e_t *nasrc,
na_fcentry_e_t *nadst)
{
int i;

View File

@ -30,13 +30,13 @@
#ifndef _ISP_LIBRARY_H
#define _ISP_LIBRARY_H
extern int isp_save_xs(ispsoftc_t *, XS_T *, u_int16_t *);
extern XS_T *isp_find_xs(ispsoftc_t *, u_int16_t);
extern u_int16_t isp_find_handle(ispsoftc_t *, XS_T *);
extern int isp_handle_index(u_int16_t);
extern u_int16_t isp_index_handle(int);
extern void isp_destroy_handle(ispsoftc_t *, u_int16_t);
extern int isp_getrqentry(ispsoftc_t *, u_int16_t *, u_int16_t *, void **);
extern int isp_save_xs(ispsoftc_t *, XS_T *, uint16_t *);
extern XS_T *isp_find_xs(ispsoftc_t *, uint16_t);
extern uint16_t isp_find_handle(ispsoftc_t *, XS_T *);
extern int isp_handle_index(uint16_t);
extern uint16_t isp_index_handle(int);
extern void isp_destroy_handle(ispsoftc_t *, uint16_t);
extern int isp_getrqentry(ispsoftc_t *, uint16_t *, uint16_t *, void **);
extern void isp_print_qentry (ispsoftc_t *, char *, int, void *);
extern void isp_print_bytes(ispsoftc_t *, char *, int, void *);
extern int isp_fc_runstate(ispsoftc_t *, int);
@ -95,12 +95,18 @@ isp_get_ga_nxt_response(ispsoftc_t *, sns_ga_nxt_rsp_t *,
sns_ga_nxt_rsp_t *);
#ifdef ISP_TARGET_MODE
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <dev/ic/isp_target.h>
#elif defined(__FreeBSD__)
#include <dev/isp/isp_target.h>
#else
#include "isp_target.h"
#endif
extern int isp_save_xs_tgt(ispsoftc_t *, void *, u_int16_t *);
extern void *isp_find_xs_tgt(ispsoftc_t *, u_int16_t);
extern u_int16_t isp_find_tgt_handle(ispsoftc_t *, void *);
extern void isp_destroy_tgt_handle(ispsoftc_t *, u_int16_t);
extern int isp_save_xs_tgt(ispsoftc_t *, void *, uint16_t *);
extern void *isp_find_xs_tgt(ispsoftc_t *, uint16_t);
extern uint16_t isp_find_tgt_handle(ispsoftc_t *, void *);
extern void isp_destroy_tgt_handle(ispsoftc_t *, uint16_t);
extern void
isp_put_atio(ispsoftc_t *, at_entry_t *, at_entry_t *);

View File

@ -48,19 +48,19 @@ __FBSDID("$FreeBSD$");
#include <dev/isp/isp_freebsd.h>
static u_int16_t isp_pci_rd_reg(struct ispsoftc *, int);
static void isp_pci_wr_reg(struct ispsoftc *, int, u_int16_t);
static u_int16_t isp_pci_rd_reg_1080(struct ispsoftc *, int);
static void isp_pci_wr_reg_1080(struct ispsoftc *, int, u_int16_t);
static uint16_t isp_pci_rd_reg(struct ispsoftc *, int);
static void isp_pci_wr_reg(struct ispsoftc *, int, uint16_t);
static uint16_t isp_pci_rd_reg_1080(struct ispsoftc *, int);
static void isp_pci_wr_reg_1080(struct ispsoftc *, int, uint16_t);
static int
isp_pci_rd_isr(struct ispsoftc *, u_int16_t *, u_int16_t *, u_int16_t *);
isp_pci_rd_isr(struct ispsoftc *, uint16_t *, uint16_t *, uint16_t *);
static int
isp_pci_rd_isr_2300(struct ispsoftc *, u_int16_t *, u_int16_t *, u_int16_t *);
isp_pci_rd_isr_2300(struct ispsoftc *, uint16_t *, uint16_t *, uint16_t *);
static int isp_pci_mbxdma(struct ispsoftc *);
static int
isp_pci_dmasetup(struct ispsoftc *, XS_T *, ispreq_t *, u_int16_t *, u_int16_t);
isp_pci_dmasetup(struct ispsoftc *, XS_T *, ispreq_t *, uint16_t *, uint16_t);
static void
isp_pci_dmateardown(struct ispsoftc *, XS_T *, u_int16_t);
isp_pci_dmateardown(struct ispsoftc *, XS_T *, uint16_t);
static void isp_pci_reset1(struct ispsoftc *);
static void isp_pci_dumpregs(struct ispsoftc *, const char *);
@ -377,7 +377,7 @@ isp_pci_attach(device_t dev)
{
struct resource *regs, *irq;
int tval, rtp, rgd, iqd, m1, m2, isp_debug, role;
u_int32_t data, cmd, linesz, psize, basetype;
uint32_t data, cmd, linesz, psize, basetype;
struct isp_pcisoftc *pcs;
struct ispsoftc *isp = NULL;
struct ispmdvec *mdvp;
@ -845,7 +845,7 @@ static void
isp_pci_intr(void *arg)
{
struct ispsoftc *isp = arg;
u_int16_t isr, sema, mbox;
uint16_t isr, sema, mbox;
ISP_LOCK(isp);
isp->isp_intcnt++;
@ -872,10 +872,10 @@ isp_pci_intr(void *arg)
static __inline int
isp_pci_rd_debounced(struct ispsoftc *isp, int off, u_int16_t *rp)
isp_pci_rd_debounced(struct ispsoftc *isp, int off, uint16_t *rp)
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
u_int16_t val0, val1;
uint16_t val0, val1;
int i = 0;
do {
@ -890,11 +890,11 @@ isp_pci_rd_debounced(struct ispsoftc *isp, int off, u_int16_t *rp)
}
static int
isp_pci_rd_isr(struct ispsoftc *isp, u_int16_t *isrp,
u_int16_t *semap, u_int16_t *mbp)
isp_pci_rd_isr(struct ispsoftc *isp, uint16_t *isrp,
uint16_t *semap, uint16_t *mbp)
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
u_int16_t isr, sema;
uint16_t isr, sema;
if (IS_2100(isp)) {
if (isp_pci_rd_debounced(isp, BIU_ISR, &isr)) {
@ -927,11 +927,11 @@ isp_pci_rd_isr(struct ispsoftc *isp, u_int16_t *isrp,
}
static int
isp_pci_rd_isr_2300(struct ispsoftc *isp, u_int16_t *isrp,
u_int16_t *semap, u_int16_t *mbox0p)
isp_pci_rd_isr_2300(struct ispsoftc *isp, uint16_t *isrp,
uint16_t *semap, uint16_t *mbox0p)
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
u_int32_t r2hisr;
uint32_t r2hisr;
if (!(BXR2(pcs, IspVirt2Off(isp, BIU_ISR) & BIU2100_ISR_RISC_INT))) {
*isrp = 0;
@ -979,10 +979,10 @@ isp_pci_rd_isr_2300(struct ispsoftc *isp, u_int16_t *isrp,
}
}
static u_int16_t
static uint16_t
isp_pci_rd_reg(struct ispsoftc *isp, int regoff)
{
u_int16_t rv;
uint16_t rv;
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
int oldconf = 0;
@ -1002,7 +1002,7 @@ isp_pci_rd_reg(struct ispsoftc *isp, int regoff)
}
static void
isp_pci_wr_reg(struct ispsoftc *isp, int regoff, u_int16_t val)
isp_pci_wr_reg(struct ispsoftc *isp, int regoff, uint16_t val)
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
int oldconf = 0;
@ -1021,15 +1021,15 @@ isp_pci_wr_reg(struct ispsoftc *isp, int regoff, u_int16_t val)
}
}
static u_int16_t
static uint16_t
isp_pci_rd_reg_1080(struct ispsoftc *isp, int regoff)
{
u_int16_t rv, oc = 0;
uint16_t rv, oc = 0;
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
if ((regoff & _BLK_REG_MASK) == SXP_BLOCK ||
(regoff & _BLK_REG_MASK) == (SXP_BLOCK|SXP_BANK1_SELECT)) {
u_int16_t tc;
uint16_t tc;
/*
* We will assume that someone has paused the RISC processor.
*/
@ -1053,14 +1053,14 @@ isp_pci_rd_reg_1080(struct ispsoftc *isp, int regoff)
}
static void
isp_pci_wr_reg_1080(struct ispsoftc *isp, int regoff, u_int16_t val)
isp_pci_wr_reg_1080(struct ispsoftc *isp, int regoff, uint16_t val)
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
int oc = 0;
if ((regoff & _BLK_REG_MASK) == SXP_BLOCK ||
(regoff & _BLK_REG_MASK) == (SXP_BLOCK|SXP_BANK1_SELECT)) {
u_int16_t tc;
uint16_t tc;
/*
* We will assume that someone has paused the RISC processor.
*/
@ -1120,7 +1120,7 @@ isp_pci_mbxdma(struct ispsoftc *isp)
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
caddr_t base;
u_int32_t len;
uint32_t len;
int i, error, ns;
bus_size_t slim; /* segment size */
bus_addr_t llim; /* low limit of unavailable dma */
@ -1134,15 +1134,19 @@ isp_pci_mbxdma(struct ispsoftc *isp)
return (0);
}
#ifdef ISP_DAC_SUPPORTED
llim = hlim = BUS_SPACE_MAXADDR;
#else
llim = BUS_SPACE_MAXADDR_32BIT;
hlim = BUS_SPACE_MAXADDR;
#endif
if (IS_ULTRA2(isp) || IS_FC(isp) || IS_1240(isp)) {
slim = (bus_size_t) (1ULL << 32);
#ifdef ISP_TARGET_MODE
/*
* XXX: Until Fixed Soon
*/
llim = BUS_SPACE_MAXADDR_32BIT;
#else
llim = BUS_SPACE_MAXADDR;
#endif
} else {
llim = BUS_SPACE_MAXADDR_32BIT;
slim = (1 << 24);
}
@ -1274,9 +1278,9 @@ typedef struct {
struct ispsoftc *isp;
void *cmd_token;
void *rq;
u_int16_t *nxtip;
u_int16_t optr;
u_int error;
uint16_t *nxtip;
uint16_t optr;
int error;
} mush_t;
#define MUSHERR_NOQENTRIES -2
@ -1312,9 +1316,9 @@ tdma_mk(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
struct isp_pcisoftc *pcs;
bus_dmamap_t *dp;
ct_entry_t *cto, *qe;
u_int8_t scsi_status;
u_int16_t curi, nxti, handle;
u_int32_t sflags;
uint8_t scsi_status;
uint16_t curi, nxti, handle;
uint32_t sflags;
int32_t resid;
int nth_ctio, nctios, send_status;
@ -1553,7 +1557,7 @@ tdma_mkfc(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
struct ccb_scsiio *csio;
struct ispsoftc *isp;
ct2_entry_t *cto, *qe;
u_int16_t curi, nxti;
uint16_t curi, nxti;
int segcnt;
mp = (mush_t *) arg;
@ -1623,7 +1627,7 @@ tdma_mkfc(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
while (segcnt < nseg) {
u_int16_t curip;
uint16_t curip;
int seg;
ispcontreq_t local, *crq = &local, *qep;
@ -1673,14 +1677,11 @@ tdma_mkfc(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
#endif
static void dma2_a64(void *, bus_dma_segment_t *, int, int);
static void dma2(void *, bus_dma_segment_t *, int, int);
#if defined(ISP_DAC_SUPPORTED) && (ISP_64BIT_CORRECTLY_DONE)
#define LOWD(x) ((uint32_t) x)
#define HIWD(x) ((uint32_t) (x >> 32))
static void
dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
dma2_a64(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
{
mush_t *mp;
struct ispsoftc *isp;
@ -1690,7 +1691,7 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
bus_dma_segment_t *eseg;
ispreq64_t *rq;
int seglim, datalen;
u_int16_t nxti;
uint16_t nxti;
mp = (mush_t *) arg;
if (error) {
@ -1756,16 +1757,16 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
if (IS_FC(isp)) {
ispreqt3_t *rq3 = (ispreqt3_t *)rq;
rq3->req_dataseg[rq3->req_seg_count].ds_base =
LOWD(dm_segs->ds_addr);
DMA_LO32(dm_segs->ds_addr);
rq3->req_dataseg[rq3->req_seg_count].ds_basehi =
HIWD(dm_segs->ds_addr);
DMA_HI32(dm_segs->ds_addr);
rq3->req_dataseg[rq3->req_seg_count].ds_count =
dm_segs->ds_len;
} else {
rq->req_dataseg[rq->req_seg_count].ds_base =
LOWD(dm_segs->ds_addr);
DMA_LO32(dm_segs->ds_addr);
rq->req_dataseg[rq->req_seg_count].ds_basehi =
HIWD(dm_segs->ds_addr);
DMA_HI32(dm_segs->ds_addr);
rq->req_dataseg[rq->req_seg_count].ds_count =
dm_segs->ds_len;
}
@ -1775,7 +1776,7 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
while (datalen > 0 && dm_segs != eseg) {
u_int16_t onxti;
uint16_t onxti;
ispcontreq64_t local, *crq = &local, *cqe;
cqe = (ispcontreq64_t *) ISP_QUEUE_ENTRY(isp->isp_rquest, nxti);
@ -1794,9 +1795,9 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
seglim = 0;
while (datalen > 0 && seglim < ISP_CDSEG64 && dm_segs != eseg) {
crq->req_dataseg[seglim].ds_base =
LOWD(dm_segs->ds_addr);
DMA_LO32(dm_segs->ds_addr);
crq->req_dataseg[seglim].ds_basehi =
HIWD(dm_segs->ds_addr);
DMA_HI32(dm_segs->ds_addr);
crq->req_dataseg[seglim].ds_count =
dm_segs->ds_len;
rq->req_seg_count++;
@ -1809,7 +1810,7 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
*mp->nxtip = nxti;
}
#else
static void
dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
{
@ -1821,7 +1822,7 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
bus_dma_segment_t *eseg;
ispreq_t *rq;
int seglim, datalen;
u_int16_t nxti;
uint16_t nxti;
mp = (mush_t *) arg;
if (error) {
@ -1886,12 +1887,12 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
if (IS_FC(isp)) {
ispreqt2_t *rq2 = (ispreqt2_t *)rq;
rq2->req_dataseg[rq2->req_seg_count].ds_base =
dm_segs->ds_addr;
DMA_LO32(dm_segs->ds_addr);
rq2->req_dataseg[rq2->req_seg_count].ds_count =
dm_segs->ds_len;
} else {
rq->req_dataseg[rq->req_seg_count].ds_base =
dm_segs->ds_addr;
DMA_LO32(dm_segs->ds_addr);
rq->req_dataseg[rq->req_seg_count].ds_count =
dm_segs->ds_len;
}
@ -1901,7 +1902,7 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
while (datalen > 0 && dm_segs != eseg) {
u_int16_t onxti;
uint16_t onxti;
ispcontreq_t local, *crq = &local, *cqe;
cqe = (ispcontreq_t *) ISP_QUEUE_ENTRY(isp->isp_rquest, nxti);
@ -1920,7 +1921,7 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
seglim = 0;
while (datalen > 0 && seglim < ISP_CDSEG && dm_segs != eseg) {
crq->req_dataseg[seglim].ds_base =
dm_segs->ds_addr;
DMA_LO32(dm_segs->ds_addr);
crq->req_dataseg[seglim].ds_count =
dm_segs->ds_len;
rq->req_seg_count++;
@ -1933,11 +1934,10 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
*mp->nxtip = nxti;
}
#endif
static int
isp_pci_dmasetup(struct ispsoftc *isp, struct ccb_scsiio *csio, ispreq_t *rq,
u_int16_t *nxtip, u_int16_t optr)
uint16_t *nxtip, uint16_t optr)
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
ispreq_t *qep;
@ -1967,7 +1967,11 @@ isp_pci_dmasetup(struct ispsoftc *isp, struct ccb_scsiio *csio, ispreq_t *rq,
}
} else
#endif
eptr = dma2;
if (sizeof (bus_addr_t) > 4) {
eptr = dma2_a64;
} else {
eptr = dma2;
}
if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE ||
@ -2066,7 +2070,7 @@ isp_pci_dmasetup(struct ispsoftc *isp, struct ccb_scsiio *csio, ispreq_t *rq,
}
static void
isp_pci_dmateardown(struct ispsoftc *isp, XS_T *xs, u_int16_t handle)
isp_pci_dmateardown(struct ispsoftc *isp, XS_T *xs, uint16_t handle)
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
bus_dmamap_t *dp = &pcs->dmaps[isp_handle_index(handle)];

View File

@ -46,15 +46,15 @@ __FBSDID("$FreeBSD$");
#include <dev/isp/isp_freebsd.h>
static u_int16_t isp_sbus_rd_reg(struct ispsoftc *, int);
static void isp_sbus_wr_reg(struct ispsoftc *, int, u_int16_t);
static uint16_t isp_sbus_rd_reg(struct ispsoftc *, int);
static void isp_sbus_wr_reg(struct ispsoftc *, int, uint16_t);
static int
isp_sbus_rd_isr(struct ispsoftc *, u_int16_t *, u_int16_t *, u_int16_t *);
isp_sbus_rd_isr(struct ispsoftc *, uint16_t *, uint16_t *, uint16_t *);
static int isp_sbus_mbxdma(struct ispsoftc *);
static int
isp_sbus_dmasetup(struct ispsoftc *, XS_T *, ispreq_t *, u_int16_t *, u_int16_t);
isp_sbus_dmasetup(struct ispsoftc *, XS_T *, ispreq_t *, uint16_t *, uint16_t);
static void
isp_sbus_dmateardown(struct ispsoftc *, XS_T *, u_int16_t);
isp_sbus_dmateardown(struct ispsoftc *, XS_T *, uint16_t);
static void isp_sbus_reset1(struct ispsoftc *);
static void isp_sbus_dumpregs(struct ispsoftc *, const char *);
@ -374,7 +374,7 @@ static void
isp_sbus_intr(void *arg)
{
struct ispsoftc *isp = arg;
u_int16_t isr, sema, mbox;
uint16_t isr, sema, mbox;
ISP_LOCK(isp);
isp->isp_intcnt++;
@ -397,11 +397,11 @@ isp_sbus_intr(void *arg)
bus_space_read_2(sbc->sbus_st, sbc->sbus_sh, off)
static int
isp_sbus_rd_isr(struct ispsoftc *isp, u_int16_t *isrp,
u_int16_t *semap, u_int16_t *mbp)
isp_sbus_rd_isr(struct ispsoftc *isp, uint16_t *isrp,
uint16_t *semap, uint16_t *mbp)
{
struct isp_sbussoftc *sbc = (struct isp_sbussoftc *) isp;
u_int16_t isr, sema;
uint16_t isr, sema;
isr = BXR2(sbc, IspVirt2Off(isp, BIU_ISR));
sema = BXR2(sbc, IspVirt2Off(isp, BIU_SEMA));
@ -418,10 +418,10 @@ isp_sbus_rd_isr(struct ispsoftc *isp, u_int16_t *isrp,
return (1);
}
static u_int16_t
static uint16_t
isp_sbus_rd_reg(struct ispsoftc *isp, int regoff)
{
u_int16_t rval;
uint16_t rval;
struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp;
int offset = sbs->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT];
offset += (regoff & 0xff);
@ -432,7 +432,7 @@ isp_sbus_rd_reg(struct ispsoftc *isp, int regoff)
}
static void
isp_sbus_wr_reg(struct ispsoftc *isp, int regoff, u_int16_t val)
isp_sbus_wr_reg(struct ispsoftc *isp, int regoff, uint16_t val)
{
struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp;
int offset = sbs->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT];
@ -475,7 +475,7 @@ isp_sbus_mbxdma(struct ispsoftc *isp)
{
struct isp_sbussoftc *sbs = (struct isp_sbussoftc *)isp;
caddr_t base;
u_int32_t len;
uint32_t len;
int i, error, ns;
struct imush im;
@ -585,9 +585,9 @@ typedef struct {
struct ispsoftc *isp;
void *cmd_token;
void *rq;
u_int16_t *nxtip;
u_int16_t optr;
u_int error;
uint16_t *nxtip;
uint16_t optr;
int error;
} mush_t;
#define MUSHERR_NOQENTRIES -2
@ -606,7 +606,7 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
bus_dma_segment_t *eseg;
ispreq_t *rq;
int seglim, datalen;
u_int16_t nxti;
uint16_t nxti;
mp = (mush_t *) arg;
if (error) {
@ -666,7 +666,7 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
while (datalen > 0 && dm_segs != eseg) {
u_int16_t onxti;
uint16_t onxti;
ispcontreq_t local, *crq = &local, *cqe;
cqe = (ispcontreq_t *) ISP_QUEUE_ENTRY(isp->isp_rquest, nxti);
@ -701,7 +701,7 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
static int
isp_sbus_dmasetup(struct ispsoftc *isp, struct ccb_scsiio *csio, ispreq_t *rq,
u_int16_t *nxtip, u_int16_t optr)
uint16_t *nxtip, uint16_t optr)
{
struct isp_sbussoftc *sbs = (struct isp_sbussoftc *)isp;
ispreq_t *qep;
@ -802,7 +802,7 @@ isp_sbus_dmasetup(struct ispsoftc *isp, struct ccb_scsiio *csio, ispreq_t *rq,
}
static void
isp_sbus_dmateardown(struct ispsoftc *isp, XS_T *xs, u_int16_t handle)
isp_sbus_dmateardown(struct ispsoftc *isp, XS_T *xs, uint16_t handle)
{
struct isp_sbussoftc *sbs = (struct isp_sbussoftc *)isp;
bus_dmamap_t *dp = &sbs->dmaps[isp_handle_index(handle)];

View File

@ -25,6 +25,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifdef __FreeBSD__
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#endif
/*
* Bug fixes gratefully acknowledged from:
@ -38,9 +42,6 @@
#include <dev/ic/isp_netbsd.h>
#endif
#ifdef __FreeBSD__
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <dev/isp/isp_freebsd.h>
#endif
#ifdef __OpenBSD__
@ -112,9 +113,9 @@ static void isp_handle_ctio2(struct ispsoftc *, ct2_entry_t *);
*/
int
isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
isp_target_notify(struct ispsoftc *isp, void *vptr, uint16_t *optrp)
{
u_int16_t status, seqid;
uint16_t status, seqid;
union {
at_entry_t *atiop;
at2_entry_t *at2iop;
@ -146,7 +147,7 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
#define nacke_fcp unp.nacke_fcp
#define hdrp unp.hp
} unp;
u_int8_t local[QENTRY_LEN];
uint8_t local[QENTRY_LEN];
int bus, type, rval = 1;
type = isp_get_response_type(isp, (isphdr_t *)vptr);
@ -303,10 +304,10 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
*/
int
isp_lun_cmd(struct ispsoftc *isp, int cmd, int bus, int tgt, int lun,
int cmd_cnt, int inot_cnt, u_int32_t opaque)
int cmd_cnt, int inot_cnt, uint32_t opaque)
{
lun_entry_t el;
u_int16_t nxti, optr;
uint16_t nxti, optr;
void *outp;
@ -359,8 +360,8 @@ int
isp_target_put_entry(struct ispsoftc *isp, void *ap)
{
void *outp;
u_int16_t nxti, optr;
u_int8_t etype = ((isphdr_t *) ap)->rqs_entry_type;
uint16_t nxti, optr;
uint8_t etype = ((isphdr_t *) ap)->rqs_entry_type;
if (isp_getrqentry(isp, &nxti, &optr, &outp)) {
isp_prt(isp, ISP_LOGWARN,
@ -406,9 +407,9 @@ isp_target_put_atio(struct ispsoftc *isp, void *arg)
atun._atio2.at_header.rqs_entry_type = RQSTYPE_ATIO2;
atun._atio2.at_header.rqs_entry_count = 1;
if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) {
atun._atio2.at_scclun = (u_int16_t) aep->at_scclun;
atun._atio2.at_scclun = (uint16_t) aep->at_scclun;
} else {
atun._atio2.at_lun = (u_int8_t) aep->at_lun;
atun._atio2.at_lun = (uint8_t) aep->at_lun;
}
if (IS_2KLOGIN(isp)) {
atun._atio2e.at_iid = ((at2e_entry_t *)aep)->at_iid;
@ -452,7 +453,7 @@ isp_target_put_atio(struct ispsoftc *isp, void *arg)
*/
int
isp_endcmd(struct ispsoftc *isp, void *arg, u_int32_t code, u_int16_t hdl)
isp_endcmd(struct ispsoftc *isp, void *arg, uint32_t code, uint16_t hdl)
{
int sts;
union {
@ -609,7 +610,7 @@ static void
isp_got_msg(struct ispsoftc *isp, in_entry_t *inp)
{
tmd_notify_t nt;
u_int8_t status = inp->in_status & ~QLTM_SVALID;
uint8_t status = inp->in_status & ~QLTM_SVALID;
MEMZERO(&nt, sizeof (nt));
nt.nt_hba = isp;
@ -689,7 +690,7 @@ isp_got_msg_fc(struct ispsoftc *isp, in_fcentry_t *inp)
if (inp->in_status != IN_MSG_RECEIVED) {
isp_prt(isp, ISP_LOGINFO, f2, "immediate notify status",
inp->in_status, nt.nt_lun, (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid,
inp->in_status, nt.nt_lun, (uint32_t) (nt.nt_iid >> 32), (uint32_t) nt.nt_iid,
inp->in_task_flags, inp->in_seqid);
isp_notify_ack(isp, inp);
return;
@ -697,27 +698,27 @@ isp_got_msg_fc(struct ispsoftc *isp, in_fcentry_t *inp)
if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK_SET) {
isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET",
(u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
(uint32_t) (nt.nt_iid >> 32), (uint32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
nt.nt_ncode = NT_ABORT_TASK_SET;
} else if (inp->in_task_flags & TASK_FLAGS_CLEAR_TASK_SET) {
isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET",
(u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
(uint32_t) (nt.nt_iid >> 32), (uint32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
nt.nt_ncode = NT_CLEAR_TASK_SET;
} else if (inp->in_task_flags & TASK_FLAGS_LUN_RESET) {
isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET",
(u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
(uint32_t) (nt.nt_iid >> 32), (uint32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
nt.nt_ncode = NT_LUN_RESET;
} else if (inp->in_task_flags & TASK_FLAGS_TARGET_RESET) {
isp_prt(isp, ISP_LOGINFO, f1, "TARGET RESET",
(u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
(uint32_t) (nt.nt_iid >> 32), (uint32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
nt.nt_ncode = NT_TARGET_RESET;
} else if (inp->in_task_flags & TASK_FLAGS_CLEAR_ACA) {
isp_prt(isp, ISP_LOGINFO, f1, "CLEAR ACA",
(u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
(uint32_t) (nt.nt_iid >> 32), (uint32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
nt.nt_ncode = NT_CLEAR_ACA;
} else {
isp_prt(isp, ISP_LOGWARN, f2, "task flag",
inp->in_status, nt.nt_lun, (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid,
inp->in_status, nt.nt_lun, (uint32_t) (nt.nt_iid >> 32), (uint32_t) nt.nt_iid,
inp->in_task_flags, inp->in_seqid);
isp_notify_ack(isp, inp);
return;
@ -729,7 +730,7 @@ void
isp_notify_ack(struct ispsoftc *isp, void *arg)
{
char storage[QENTRY_LEN];
u_int16_t nxti, optr;
uint16_t nxti, optr;
void *outp;
if (isp_getrqentry(isp, &nxti, &optr, &outp)) {

View File

@ -43,20 +43,20 @@
*/
typedef struct {
isphdr_t le_header;
u_int32_t le_reserved;
u_int8_t le_lun;
u_int8_t le_rsvd;
u_int8_t le_ops; /* Modify LUN only */
u_int8_t le_tgt; /* Not for FC */
u_int32_t le_flags; /* Not for FC */
u_int8_t le_status;
u_int8_t le_reserved2;
u_int8_t le_cmd_count;
u_int8_t le_in_count;
u_int8_t le_cdb6len; /* Not for FC */
u_int8_t le_cdb7len; /* Not for FC */
u_int16_t le_timeout;
u_int16_t le_reserved3[20];
uint32_t le_reserved;
uint8_t le_lun;
uint8_t le_rsvd;
uint8_t le_ops; /* Modify LUN only */
uint8_t le_tgt; /* Not for FC */
uint32_t le_flags; /* Not for FC */
uint8_t le_status;
uint8_t le_reserved2;
uint8_t le_cmd_count;
uint8_t le_in_count;
uint8_t le_cdb6len; /* Not for FC */
uint8_t le_cdb7len; /* Not for FC */
uint16_t le_timeout;
uint16_t le_reserved3[20];
} lun_entry_t;
/*
@ -91,43 +91,43 @@ typedef struct {
#define IN_RSVDLEN 8 /* 8 words */
typedef struct {
isphdr_t in_header;
u_int32_t in_reserved;
u_int8_t in_lun; /* lun */
u_int8_t in_iid; /* initiator */
u_int8_t in_reserved2;
u_int8_t in_tgt; /* target */
u_int32_t in_flags;
u_int8_t in_status;
u_int8_t in_rsvd2;
u_int8_t in_tag_val; /* tag value */
u_int8_t in_tag_type; /* tag type */
u_int16_t in_seqid; /* sequence id */
u_int8_t in_msg[IN_MSGLEN]; /* SCSI message bytes */
u_int16_t in_reserved3[IN_RSVDLEN];
u_int8_t in_sense[QLTM_SENSELEN];/* suggested sense data */
uint32_t in_reserved;
uint8_t in_lun; /* lun */
uint8_t in_iid; /* initiator */
uint8_t in_reserved2;
uint8_t in_tgt; /* target */
uint32_t in_flags;
uint8_t in_status;
uint8_t in_rsvd2;
uint8_t in_tag_val; /* tag value */
uint8_t in_tag_type; /* tag type */
uint16_t in_seqid; /* sequence id */
uint8_t in_msg[IN_MSGLEN]; /* SCSI message bytes */
uint16_t in_reserved3[IN_RSVDLEN];
uint8_t in_sense[QLTM_SENSELEN];/* suggested sense data */
} in_entry_t;
typedef struct {
isphdr_t in_header;
u_int32_t in_reserved;
u_int8_t in_lun; /* lun */
u_int8_t in_iid; /* initiator */
u_int16_t in_scclun;
u_int32_t in_reserved2;
u_int16_t in_status;
u_int16_t in_task_flags;
u_int16_t in_seqid; /* sequence id */
uint32_t in_reserved;
uint8_t in_lun; /* lun */
uint8_t in_iid; /* initiator */
uint16_t in_scclun;
uint32_t in_reserved2;
uint16_t in_status;
uint16_t in_task_flags;
uint16_t in_seqid; /* sequence id */
} in_fcentry_t;
typedef struct {
isphdr_t in_header;
u_int32_t in_reserved;
u_int16_t in_iid; /* initiator */
u_int16_t in_scclun;
u_int32_t in_reserved2;
u_int16_t in_status;
u_int16_t in_task_flags;
u_int16_t in_seqid; /* sequence id */
uint32_t in_reserved;
uint16_t in_iid; /* initiator */
uint16_t in_scclun;
uint32_t in_reserved2;
uint16_t in_status;
uint16_t in_task_flags;
uint16_t in_seqid; /* sequence id */
} in_fcentry_e_t;
/*
@ -182,16 +182,16 @@ typedef struct {
#define NA_RSVDLEN 22
typedef struct {
isphdr_t na_header;
u_int32_t na_reserved;
u_int8_t na_lun; /* lun */
u_int8_t na_iid; /* initiator */
u_int8_t na_reserved2;
u_int8_t na_tgt; /* target */
u_int32_t na_flags;
u_int8_t na_status;
u_int8_t na_event;
u_int16_t na_seqid; /* sequence id */
u_int16_t na_reserved3[NA_RSVDLEN];
uint32_t na_reserved;
uint8_t na_lun; /* lun */
uint8_t na_iid; /* initiator */
uint8_t na_reserved2;
uint8_t na_tgt; /* target */
uint32_t na_flags;
uint8_t na_status;
uint8_t na_event;
uint16_t na_seqid; /* sequence id */
uint16_t na_reserved3[NA_RSVDLEN];
} na_entry_t;
/*
@ -204,29 +204,29 @@ typedef struct {
#define NA2_RSVDLEN 21
typedef struct {
isphdr_t na_header;
u_int32_t na_reserved;
u_int8_t na_lun; /* lun */
u_int8_t na_iid; /* initiator */
u_int16_t na_scclun;
u_int16_t na_flags;
u_int16_t na_reserved2;
u_int16_t na_status;
u_int16_t na_task_flags;
u_int16_t na_seqid; /* sequence id */
u_int16_t na_reserved3[NA2_RSVDLEN];
uint32_t na_reserved;
uint8_t na_lun; /* lun */
uint8_t na_iid; /* initiator */
uint16_t na_scclun;
uint16_t na_flags;
uint16_t na_reserved2;
uint16_t na_status;
uint16_t na_task_flags;
uint16_t na_seqid; /* sequence id */
uint16_t na_reserved3[NA2_RSVDLEN];
} na_fcentry_t;
typedef struct {
isphdr_t na_header;
u_int32_t na_reserved;
u_int16_t na_iid; /* initiator */
u_int16_t na_scclun;
u_int16_t na_flags;
u_int16_t na_reserved2;
u_int16_t na_status;
u_int16_t na_task_flags;
u_int16_t na_seqid; /* sequence id */
u_int16_t na_reserved3[NA2_RSVDLEN];
uint32_t na_reserved;
uint16_t na_iid; /* initiator */
uint16_t na_scclun;
uint16_t na_flags;
uint16_t na_reserved2;
uint16_t na_status;
uint16_t na_task_flags;
uint16_t na_seqid; /* sequence id */
uint16_t na_reserved3[NA2_RSVDLEN];
} na_fcentry_e_t;
#define NAFC_RCOUNT 0x80 /* increment resource count */
@ -238,19 +238,19 @@ typedef struct {
typedef struct {
isphdr_t at_header;
u_int16_t at_reserved;
u_int16_t at_handle;
u_int8_t at_lun; /* lun */
u_int8_t at_iid; /* initiator */
u_int8_t at_cdblen; /* cdb length */
u_int8_t at_tgt; /* target */
u_int32_t at_flags;
u_int8_t at_status; /* firmware status */
u_int8_t at_scsi_status; /* scsi status */
u_int8_t at_tag_val; /* tag value */
u_int8_t at_tag_type; /* tag type */
u_int8_t at_cdb[ATIO_CDBLEN]; /* received CDB */
u_int8_t at_sense[QLTM_SENSELEN];/* suggested sense data */
uint16_t at_reserved;
uint16_t at_handle;
uint8_t at_lun; /* lun */
uint8_t at_iid; /* initiator */
uint8_t at_cdblen; /* cdb length */
uint8_t at_tgt; /* target */
uint32_t at_flags;
uint8_t at_status; /* firmware status */
uint8_t at_scsi_status; /* scsi status */
uint8_t at_tag_val; /* tag value */
uint8_t at_tag_type; /* tag type */
uint8_t at_cdb[ATIO_CDBLEN]; /* received CDB */
uint8_t at_sense[QLTM_SENSELEN];/* suggested sense data */
} at_entry_t;
/*
@ -318,41 +318,41 @@ typedef struct {
typedef struct {
isphdr_t at_header;
u_int32_t at_reserved;
u_int8_t at_lun; /* lun or reserved */
u_int8_t at_iid; /* initiator */
u_int16_t at_rxid; /* response ID */
u_int16_t at_flags;
u_int16_t at_status; /* firmware status */
u_int8_t at_crn; /* command reference number */
u_int8_t at_taskcodes;
u_int8_t at_taskflags;
u_int8_t at_execodes;
u_int8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
u_int32_t at_datalen; /* allocated data len */
u_int16_t at_scclun; /* SCC Lun or reserved */
u_int16_t at_wwpn[4]; /* WWPN of initiator */
u_int16_t at_reserved2[6];
u_int16_t at_oxid;
uint32_t at_reserved;
uint8_t at_lun; /* lun or reserved */
uint8_t at_iid; /* initiator */
uint16_t at_rxid; /* response ID */
uint16_t at_flags;
uint16_t at_status; /* firmware status */
uint8_t at_crn; /* command reference number */
uint8_t at_taskcodes;
uint8_t at_taskflags;
uint8_t at_execodes;
uint8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
uint32_t at_datalen; /* allocated data len */
uint16_t at_scclun; /* SCC Lun or reserved */
uint16_t at_wwpn[4]; /* WWPN of initiator */
uint16_t at_reserved2[6];
uint16_t at_oxid;
} at2_entry_t;
typedef struct {
isphdr_t at_header;
u_int32_t at_reserved;
u_int16_t at_iid; /* initiator */
u_int16_t at_rxid; /* response ID */
u_int16_t at_flags;
u_int16_t at_status; /* firmware status */
u_int8_t at_crn; /* command reference number */
u_int8_t at_taskcodes;
u_int8_t at_taskflags;
u_int8_t at_execodes;
u_int8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
u_int32_t at_datalen; /* allocated data len */
u_int16_t at_scclun; /* SCC Lun or reserved */
u_int16_t at_wwpn[4]; /* WWPN of initiator */
u_int16_t at_reserved2[6];
u_int16_t at_oxid;
uint32_t at_reserved;
uint16_t at_iid; /* initiator */
uint16_t at_rxid; /* response ID */
uint16_t at_flags;
uint16_t at_status; /* firmware status */
uint8_t at_crn; /* command reference number */
uint8_t at_taskcodes;
uint8_t at_taskflags;
uint8_t at_execodes;
uint8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
uint32_t at_datalen; /* allocated data len */
uint16_t at_scclun; /* SCC Lun or reserved */
uint16_t at_wwpn[4]; /* WWPN of initiator */
uint16_t at_reserved2[6];
uint16_t at_oxid;
} at2e_entry_t;
#define ATIO2_WWPN_OFFSET 0x2A
@ -406,22 +406,22 @@ typedef struct {
*/
typedef struct {
isphdr_t ct_header;
u_int16_t ct_reserved;
uint16_t ct_reserved;
#define ct_syshandle ct_reserved /* we use this */
u_int16_t ct_fwhandle; /* required by f/w */
u_int8_t ct_lun; /* lun */
u_int8_t ct_iid; /* initiator id */
u_int8_t ct_reserved2;
u_int8_t ct_tgt; /* our target id */
u_int32_t ct_flags;
u_int8_t ct_status; /* isp status */
u_int8_t ct_scsi_status; /* scsi status */
u_int8_t ct_tag_val; /* tag value */
u_int8_t ct_tag_type; /* tag type */
u_int32_t ct_xfrlen; /* transfer length */
u_int32_t ct_resid; /* residual length */
u_int16_t ct_timeout;
u_int16_t ct_seg_count;
uint16_t ct_fwhandle; /* required by f/w */
uint8_t ct_lun; /* lun */
uint8_t ct_iid; /* initiator id */
uint8_t ct_reserved2;
uint8_t ct_tgt; /* our target id */
uint32_t ct_flags;
uint8_t ct_status; /* isp status */
uint8_t ct_scsi_status; /* scsi status */
uint8_t ct_tag_val; /* tag value */
uint8_t ct_tag_type; /* tag type */
uint32_t ct_xfrlen; /* transfer length */
uint32_t ct_resid; /* residual length */
uint16_t ct_timeout;
uint16_t ct_seg_count;
/*
* This is so we can share tag name space with
* CTIO{2,3,4} with the minimum of pain.
@ -502,7 +502,7 @@ typedef struct {
* Entry length in u_longs. All entries are the same size so
* any one will do as the numerator.
*/
#define UINT32_ENTRY_SIZE (sizeof(at_entry_t)/sizeof(u_int32_t))
#define UINT32_ENTRY_SIZE (sizeof(at_entry_t)/sizeof(uint32_t))
/*
* QLA2100 CTIO (type 2) entry
@ -510,16 +510,16 @@ typedef struct {
#define MAXRESPLEN 26
typedef struct {
isphdr_t ct_header;
u_int16_t ct_reserved;
u_int16_t ct_fwhandle; /* just to match CTIO */
u_int8_t ct_lun; /* lun */
u_int8_t ct_iid; /* initiator id */
u_int16_t ct_rxid; /* response ID */
u_int16_t ct_flags;
u_int16_t ct_status; /* isp status */
u_int16_t ct_timeout;
u_int16_t ct_seg_count;
u_int32_t ct_reloff; /* relative offset */
uint16_t ct_reserved;
uint16_t ct_fwhandle; /* just to match CTIO */
uint8_t ct_lun; /* lun */
uint8_t ct_iid; /* initiator id */
uint16_t ct_rxid; /* response ID */
uint16_t ct_flags;
uint16_t ct_status; /* isp status */
uint16_t ct_timeout;
uint16_t ct_seg_count;
uint32_t ct_reloff; /* relative offset */
int32_t ct_resid; /* residual length */
union {
/*
@ -536,10 +536,10 @@ typedef struct {
* in system memory as located by the isp_dataseg.
*/
struct {
u_int32_t _reserved;
u_int16_t _reserved2;
u_int16_t ct_scsi_status;
u_int32_t ct_xfrlen;
uint32_t _reserved;
uint16_t _reserved2;
uint16_t ct_scsi_status;
uint32_t ct_xfrlen;
union {
ispds_t ct_a[ISP_RQDSEG_T2]; /* CTIO2 */
ispds64_t ct_b[ISP_RQDSEG_T3]; /* CTIO3 */
@ -550,18 +550,18 @@ typedef struct {
#define ct_dslist _u.ct_c
} m0;
struct {
u_int16_t _reserved;
u_int16_t _reserved2;
u_int16_t ct_senselen;
u_int16_t ct_scsi_status;
u_int16_t ct_resplen;
u_int8_t ct_resp[MAXRESPLEN];
uint16_t _reserved;
uint16_t _reserved2;
uint16_t ct_senselen;
uint16_t ct_scsi_status;
uint16_t ct_resplen;
uint8_t ct_resp[MAXRESPLEN];
} m1;
struct {
u_int32_t _reserved;
u_int16_t _reserved2;
u_int16_t _reserved3;
u_int32_t ct_datalen;
uint32_t _reserved;
uint16_t _reserved2;
uint16_t _reserved3;
uint32_t ct_datalen;
ispds_t ct_fcp_rsp_iudata;
} m2;
} rsp;
@ -569,22 +569,22 @@ typedef struct {
typedef struct {
isphdr_t ct_header;
u_int16_t ct_reserved;
u_int16_t ct_fwhandle; /* just to match CTIO */
u_int16_t ct_iid; /* initiator id */
u_int16_t ct_rxid; /* response ID */
u_int16_t ct_flags;
u_int16_t ct_status; /* isp status */
u_int16_t ct_timeout;
u_int16_t ct_seg_count;
u_int32_t ct_reloff; /* relative offset */
uint16_t ct_reserved;
uint16_t ct_fwhandle; /* just to match CTIO */
uint16_t ct_iid; /* initiator id */
uint16_t ct_rxid; /* response ID */
uint16_t ct_flags;
uint16_t ct_status; /* isp status */
uint16_t ct_timeout;
uint16_t ct_seg_count;
uint32_t ct_reloff; /* relative offset */
int32_t ct_resid; /* residual length */
union {
struct {
u_int32_t _reserved;
u_int16_t _reserved2;
u_int16_t ct_scsi_status;
u_int32_t ct_xfrlen;
uint32_t _reserved;
uint16_t _reserved2;
uint16_t ct_scsi_status;
uint32_t ct_xfrlen;
union {
ispds_t ct_a[ISP_RQDSEG_T2]; /* CTIO2 */
ispds64_t ct_b[ISP_RQDSEG_T3]; /* CTIO3 */
@ -592,18 +592,18 @@ typedef struct {
} _u;
} m0;
struct {
u_int16_t _reserved;
u_int16_t _reserved2;
u_int16_t ct_senselen;
u_int16_t ct_scsi_status;
u_int16_t ct_resplen;
u_int8_t ct_resp[MAXRESPLEN];
uint16_t _reserved;
uint16_t _reserved2;
uint16_t ct_senselen;
uint16_t ct_scsi_status;
uint16_t ct_resplen;
uint8_t ct_resp[MAXRESPLEN];
} m1;
struct {
u_int32_t _reserved;
u_int16_t _reserved2;
u_int16_t _reserved3;
u_int32_t ct_datalen;
uint32_t _reserved;
uint16_t _reserved2;
uint16_t _reserved3;
uint32_t ct_datalen;
ispds_t ct_fcp_rsp_iudata;
} m2;
} rsp;
@ -654,13 +654,13 @@ typedef struct {
/*
* This function handles new response queue entry appropriate for target mode.
*/
int isp_target_notify(struct ispsoftc *, void *, u_int16_t *);
int isp_target_notify(ispsoftc_t *, void *, uint16_t *);
/*
* This function externalizes the ability to acknowledge an Immediate Notify
* request.
*/
void isp_notify_ack(struct ispsoftc *, void *);
void isp_notify_ack(ispsoftc_t *, void *);
/*
* Enable/Disable/Modify a logical unit.
@ -668,12 +668,12 @@ void isp_notify_ack(struct ispsoftc *, void *);
*/
#define DFLT_CMND_CNT 0xfe /* unmonitored */
#define DFLT_INOT_CNT 16
int isp_lun_cmd(struct ispsoftc *, int, int, int, int, int, int, u_int32_t);
int isp_lun_cmd(ispsoftc_t *, int, int, int, int, int, int, uint32_t);
/*
* General request queue 'put' routine for target mode entries.
*/
int isp_target_put_entry(struct ispsoftc *isp, void *);
int isp_target_put_entry(ispsoftc_t *isp, void *);
/*
* General routine to put back an ATIO entry-
@ -681,13 +681,13 @@ int isp_target_put_entry(struct ispsoftc *isp, void *);
* The argument is a pointer to a source ATIO
* or ATIO2.
*/
int isp_target_put_atio(struct ispsoftc *, void *);
int isp_target_put_atio(ispsoftc_t *, void *);
/*
* General routine to send a final CTIO for a command- used mostly for
* local responses.
*/
int isp_endcmd(struct ispsoftc *, void *, u_int32_t, u_int16_t);
int isp_endcmd(ispsoftc_t *, void *, uint32_t, uint16_t);
#define ECMD_SVALID 0x100
/*
@ -695,6 +695,6 @@ int isp_endcmd(struct ispsoftc *, void *, u_int32_t, u_int16_t);
*
* Return nonzero if the interrupt that generated this event has been dismissed.
*/
int isp_target_async(struct ispsoftc *, int, int);
int isp_target_async(ispsoftc_t *, int, int);
#endif /* _ISP_TARGET_H */

View File

@ -133,10 +133,10 @@ typedef struct tmd_notify {
typedef struct {
void * en_private; /* for outer layer usage */
void * en_hba; /* HBA tag */
u_int64_t en_iid; /* initiator ID */
u_int64_t en_tgt; /* target id */
u_int64_t en_lun; /* logical unit */
u_int8_t en_chan; /* channel on card */
uint64_t en_iid; /* initiator ID */
uint64_t en_tgt; /* target id */
uint64_t en_lun; /* logical unit */
uint8_t en_chan; /* channel on card */
int32_t en_error;
} enadis_t;
@ -278,32 +278,32 @@ typedef struct tmd_cmd {
void * cd_private; /* private data pointer */
void * cd_hba; /* HBA tag */
void * cd_data; /* 'pointer' to data */
u_int64_t cd_iid; /* initiator ID */
u_int64_t cd_tgt; /* target id */
u_int64_t cd_lun; /* logical unit */
u_int32_t cd_tagval; /* tag value */
u_int32_t cd_lflags; /* flags lower level sets */
u_int32_t cd_hflags; /* flags higher level sets */
u_int32_t cd_totlen; /* total data requirement */
u_int32_t cd_resid; /* total data residual */
u_int32_t cd_xfrlen; /* current data requirement */
uint64_t cd_iid; /* initiator ID */
uint64_t cd_tgt; /* target id */
uint64_t cd_lun; /* logical unit */
uint32_t cd_tagval; /* tag value */
uint32_t cd_lflags; /* flags lower level sets */
uint32_t cd_hflags; /* flags higher level sets */
uint32_t cd_totlen; /* total data requirement */
uint32_t cd_resid; /* total data residual */
uint32_t cd_xfrlen; /* current data requirement */
int32_t cd_error; /* current error */
u_int32_t
uint32_t
cd_scsi_status : 16, /* closing SCSI status */
: 7,
cd_chan : 1, /* channel on card */
: 2,
cd_tagtype : 6; /* tag type */
u_int8_t cd_senselen;
u_int8_t cd_cdblen;
u_int8_t cd_sense[TMD_SENSELEN];
u_int8_t cd_cdb[TMD_CDBLEN]; /* Command */
uint8_t cd_senselen;
uint8_t cd_cdblen;
uint8_t cd_sense[TMD_SENSELEN];
uint8_t cd_cdb[TMD_CDBLEN]; /* Command */
union {
void * ptrs[QCDS / sizeof (void *)];
u_int64_t llongs[QCDS / sizeof (u_int64_t)];
u_int32_t longs[QCDS / sizeof (u_int32_t)];
u_int16_t shorts[QCDS / sizeof (u_int16_t)];
u_int8_t bytes[QCDS];
uint64_t llongs[QCDS / sizeof (uint64_t)];
uint32_t longs[QCDS / sizeof (uint32_t)];
uint16_t shorts[QCDS / sizeof (uint16_t)];
uint8_t bytes[QCDS];
} cd_lreserved[2], cd_hreserved[2];
} tmd_cmd_t;

View File

@ -248,22 +248,22 @@
*/
typedef struct {
u_int32_t ds_base;
u_int32_t ds_count;
uint32_t ds_base;
uint32_t ds_count;
} ispds_t;
typedef struct {
u_int32_t ds_base;
u_int32_t ds_basehi;
u_int32_t ds_count;
uint32_t ds_base;
uint32_t ds_basehi;
uint32_t ds_count;
} ispds64_t;
#define DSTYPE_32BIT 0
#define DSTYPE_64BIT 1
typedef struct {
u_int16_t ds_type; /* 0-> ispds_t, 1-> ispds64_t */
u_int32_t ds_segment; /* unused */
u_int32_t ds_base; /* 32 bit address of DSD list */
uint16_t ds_type; /* 0-> ispds_t, 1-> ispds64_t */
uint32_t ds_segment; /* unused */
uint32_t ds_base; /* 32 bit address of DSD list */
} ispdslist_t;
@ -271,16 +271,16 @@ typedef struct {
* These elements get swizzled around for SBus instances.
*/
#define ISP_SWAP8(a, b) { \
u_int8_t tmp; \
uint8_t tmp; \
tmp = a; \
a = b; \
b = tmp; \
}
typedef struct {
u_int8_t rqs_entry_type;
u_int8_t rqs_entry_count;
u_int8_t rqs_seqno;
u_int8_t rqs_flags;
uint8_t rqs_entry_type;
uint8_t rqs_entry_count;
uint8_t rqs_seqno;
uint8_t rqs_flags;
} isphdr_t;
/* RQS Flag definitions */
@ -325,16 +325,16 @@ typedef struct {
#define ISP_RQDSEG 4
typedef struct {
isphdr_t req_header;
u_int32_t req_handle;
u_int8_t req_lun_trn;
u_int8_t req_target;
u_int16_t req_cdblen;
uint32_t req_handle;
uint8_t req_lun_trn;
uint8_t req_target;
uint16_t req_cdblen;
#define req_modifier req_cdblen /* marker packet */
u_int16_t req_flags;
u_int16_t req_reserved;
u_int16_t req_time;
u_int16_t req_seg_count;
u_int8_t req_cdb[12];
uint16_t req_flags;
uint16_t req_reserved;
uint16_t req_time;
uint16_t req_seg_count;
uint8_t req_cdb[12];
ispds_t req_dataseg[ISP_RQDSEG];
} ispreq_t;
@ -352,60 +352,60 @@ typedef struct {
#define ISP_RQDSEG_T2 3
typedef struct {
isphdr_t req_header;
u_int32_t req_handle;
u_int8_t req_lun_trn;
u_int8_t req_target;
u_int16_t req_scclun;
u_int16_t req_flags;
u_int16_t _res2;
u_int16_t req_time;
u_int16_t req_seg_count;
u_int8_t req_cdb[16];
u_int32_t req_totalcnt;
uint32_t req_handle;
uint8_t req_lun_trn;
uint8_t req_target;
uint16_t req_scclun;
uint16_t req_flags;
uint16_t _res2;
uint16_t req_time;
uint16_t req_seg_count;
uint8_t req_cdb[16];
uint32_t req_totalcnt;
ispds_t req_dataseg[ISP_RQDSEG_T2];
} ispreqt2_t;
typedef struct {
isphdr_t req_header;
u_int32_t req_handle;
u_int16_t req_target;
u_int16_t req_scclun;
u_int16_t req_flags;
u_int16_t _res2;
u_int16_t req_time;
u_int16_t req_seg_count;
u_int8_t req_cdb[16];
u_int32_t req_totalcnt;
uint32_t req_handle;
uint16_t req_target;
uint16_t req_scclun;
uint16_t req_flags;
uint16_t _res2;
uint16_t req_time;
uint16_t req_seg_count;
uint8_t req_cdb[16];
uint32_t req_totalcnt;
ispds_t req_dataseg[ISP_RQDSEG_T2];
} ispreqt2e_t;
#define ISP_RQDSEG_T3 2
typedef struct {
isphdr_t req_header;
u_int32_t req_handle;
u_int8_t req_lun_trn;
u_int8_t req_target;
u_int16_t req_scclun;
u_int16_t req_flags;
u_int16_t _res2;
u_int16_t req_time;
u_int16_t req_seg_count;
u_int8_t req_cdb[16];
u_int32_t req_totalcnt;
uint32_t req_handle;
uint8_t req_lun_trn;
uint8_t req_target;
uint16_t req_scclun;
uint16_t req_flags;
uint16_t _res2;
uint16_t req_time;
uint16_t req_seg_count;
uint8_t req_cdb[16];
uint32_t req_totalcnt;
ispds64_t req_dataseg[ISP_RQDSEG_T3];
} ispreqt3_t;
typedef struct {
isphdr_t req_header;
u_int32_t req_handle;
u_int16_t req_target;
u_int16_t req_scclun;
u_int16_t req_flags;
u_int16_t _res2;
u_int16_t req_time;
u_int16_t req_seg_count;
u_int8_t req_cdb[16];
u_int32_t req_totalcnt;
uint32_t req_handle;
uint16_t req_target;
uint16_t req_scclun;
uint16_t req_flags;
uint16_t _res2;
uint16_t req_time;
uint16_t req_seg_count;
uint8_t req_cdb[16];
uint32_t req_totalcnt;
ispds64_t req_dataseg[ISP_RQDSEG_T3];
} ispreqt3e_t;
@ -432,21 +432,21 @@ typedef struct {
typedef struct {
isphdr_t req_header;
u_int32_t req_handle;
u_int8_t req_lun_trn;
u_int8_t req_target;
u_int16_t req_cdblen;
u_int16_t req_flags;
u_int16_t _res1;
u_int16_t req_time;
u_int16_t req_seg_count;
u_int8_t req_cdb[44];
uint32_t req_handle;
uint8_t req_lun_trn;
uint8_t req_target;
uint16_t req_cdblen;
uint16_t req_flags;
uint16_t _res1;
uint16_t req_time;
uint16_t req_seg_count;
uint8_t req_cdb[44];
} ispextreq_t;
#define ISP_CDSEG 7
typedef struct {
isphdr_t req_header;
u_int32_t _res1;
uint32_t _res1;
ispds_t req_dataseg[ISP_CDSEG];
} ispcontreq_t;
@ -458,22 +458,22 @@ typedef struct {
typedef struct {
isphdr_t req_header;
u_int32_t req_handle;
u_int16_t req_scsi_status;
u_int16_t req_completion_status;
u_int16_t req_state_flags;
u_int16_t req_status_flags;
u_int16_t req_time;
uint32_t req_handle;
uint16_t req_scsi_status;
uint16_t req_completion_status;
uint16_t req_state_flags;
uint16_t req_status_flags;
uint16_t req_time;
#define req_response_len req_time /* FC only */
u_int16_t req_sense_len;
u_int32_t req_resid;
u_int8_t req_response[8]; /* FC only */
u_int8_t req_sense_data[32];
uint16_t req_sense_len;
uint32_t req_resid;
uint8_t req_response[8]; /* FC only */
uint8_t req_sense_data[32];
} ispstatusreq_t;
typedef struct {
isphdr_t req_header;
u_int8_t req_sense_data[60];
uint8_t req_sense_data[60];
} ispstatus_cont_t;
/*
@ -607,12 +607,12 @@ typedef struct {
typedef struct {
isphdr_t req_header;
u_int32_t req_handles[15];
uint32_t req_handles[15];
} isp_rio1_t;
typedef struct {
isphdr_t req_header;
u_int16_t req_handles[30];
uint16_t req_handles[30];
} isp_rio2_t;
/*
@ -625,35 +625,35 @@ typedef struct {
* Version One (prime) format.
*/
typedef struct isp_icb {
u_int8_t icb_version;
u_int8_t _reserved0;
u_int16_t icb_fwoptions;
u_int16_t icb_maxfrmlen;
u_int16_t icb_maxalloc;
u_int16_t icb_execthrottle;
u_int8_t icb_retry_count;
u_int8_t icb_retry_delay;
u_int8_t icb_portname[8];
u_int16_t icb_hardaddr;
u_int8_t icb_iqdevtype;
u_int8_t icb_logintime;
u_int8_t icb_nodename[8];
u_int16_t icb_rqstout;
u_int16_t icb_rspnsin;
u_int16_t icb_rqstqlen;
u_int16_t icb_rsltqlen;
u_int16_t icb_rqstaddr[4];
u_int16_t icb_respaddr[4];
u_int16_t icb_lunenables;
u_int8_t icb_ccnt;
u_int8_t icb_icnt;
u_int16_t icb_lunetimeout;
u_int16_t _reserved1;
u_int16_t icb_xfwoptions;
u_int8_t icb_racctimer;
u_int8_t icb_idelaytimer;
u_int16_t icb_zfwoptions;
u_int16_t _reserved2[13];
uint8_t icb_version;
uint8_t _reserved0;
uint16_t icb_fwoptions;
uint16_t icb_maxfrmlen;
uint16_t icb_maxalloc;
uint16_t icb_execthrottle;
uint8_t icb_retry_count;
uint8_t icb_retry_delay;
uint8_t icb_portname[8];
uint16_t icb_hardaddr;
uint8_t icb_iqdevtype;
uint8_t icb_logintime;
uint8_t icb_nodename[8];
uint16_t icb_rqstout;
uint16_t icb_rspnsin;
uint16_t icb_rqstqlen;
uint16_t icb_rsltqlen;
uint16_t icb_rqstaddr[4];
uint16_t icb_respaddr[4];
uint16_t icb_lunenables;
uint8_t icb_ccnt;
uint8_t icb_icnt;
uint16_t icb_lunetimeout;
uint16_t _reserved1;
uint16_t icb_xfwoptions;
uint8_t icb_racctimer;
uint8_t icb_idelaytimer;
uint16_t icb_zfwoptions;
uint16_t _reserved2[13];
} isp_icb_t;
#define ICB_VERSION1 1
@ -725,24 +725,24 @@ typedef struct isp_icb {
#define ICB_NNM7 0
#define MAKE_NODE_NAME_FROM_WWN(array, wwn) \
array[ICB_NNM0] = (u_int8_t) ((wwn >> 0) & 0xff), \
array[ICB_NNM1] = (u_int8_t) ((wwn >> 8) & 0xff), \
array[ICB_NNM2] = (u_int8_t) ((wwn >> 16) & 0xff), \
array[ICB_NNM3] = (u_int8_t) ((wwn >> 24) & 0xff), \
array[ICB_NNM4] = (u_int8_t) ((wwn >> 32) & 0xff), \
array[ICB_NNM5] = (u_int8_t) ((wwn >> 40) & 0xff), \
array[ICB_NNM6] = (u_int8_t) ((wwn >> 48) & 0xff), \
array[ICB_NNM7] = (u_int8_t) ((wwn >> 56) & 0xff)
array[ICB_NNM0] = (uint8_t) ((wwn >> 0) & 0xff), \
array[ICB_NNM1] = (uint8_t) ((wwn >> 8) & 0xff), \
array[ICB_NNM2] = (uint8_t) ((wwn >> 16) & 0xff), \
array[ICB_NNM3] = (uint8_t) ((wwn >> 24) & 0xff), \
array[ICB_NNM4] = (uint8_t) ((wwn >> 32) & 0xff), \
array[ICB_NNM5] = (uint8_t) ((wwn >> 40) & 0xff), \
array[ICB_NNM6] = (uint8_t) ((wwn >> 48) & 0xff), \
array[ICB_NNM7] = (uint8_t) ((wwn >> 56) & 0xff)
#define MAKE_WWN_FROM_NODE_NAME(wwn, array) \
wwn = ((u_int64_t) array[ICB_NNM0]) | \
((u_int64_t) array[ICB_NNM1] << 8) | \
((u_int64_t) array[ICB_NNM2] << 16) | \
((u_int64_t) array[ICB_NNM3] << 24) | \
((u_int64_t) array[ICB_NNM4] << 32) | \
((u_int64_t) array[ICB_NNM5] << 40) | \
((u_int64_t) array[ICB_NNM6] << 48) | \
((u_int64_t) array[ICB_NNM7] << 56)
wwn = ((uint64_t) array[ICB_NNM0]) | \
((uint64_t) array[ICB_NNM1] << 8) | \
((uint64_t) array[ICB_NNM2] << 16) | \
((uint64_t) array[ICB_NNM3] << 24) | \
((uint64_t) array[ICB_NNM4] << 32) | \
((uint64_t) array[ICB_NNM5] << 40) | \
((uint64_t) array[ICB_NNM6] << 48) | \
((uint64_t) array[ICB_NNM7] << 56)
/*
* FC-AL Position Map
@ -755,9 +755,9 @@ typedef struct isp_icb {
* f/w generated map.
*/
typedef struct {
u_int8_t fwmap : 1,
uint8_t fwmap : 1,
count : 7;
u_int8_t map[127];
uint8_t map[127];
} fcpos_map_t;
/*
@ -765,45 +765,45 @@ typedef struct {
*/
typedef struct {
u_int16_t pdb_options;
u_int8_t pdb_mstate;
u_int8_t pdb_sstate;
uint16_t pdb_options;
uint8_t pdb_mstate;
uint8_t pdb_sstate;
#define BITS2WORD(x) ((x)[0] << 16 | (x)[3] << 8 | (x)[2])
u_int8_t pdb_hardaddr_bits[4];
u_int8_t pdb_portid_bits[4];
u_int8_t pdb_nodename[8];
u_int8_t pdb_portname[8];
u_int16_t pdb_execthrottle;
u_int16_t pdb_exec_count;
u_int8_t pdb_retry_count;
u_int8_t pdb_retry_delay;
u_int16_t pdb_resalloc;
u_int16_t pdb_curalloc;
u_int16_t pdb_qhead;
u_int16_t pdb_qtail;
u_int16_t pdb_tl_next;
u_int16_t pdb_tl_last;
u_int16_t pdb_features; /* PLOGI, Common Service */
u_int16_t pdb_pconcurrnt; /* PLOGI, Common Service */
u_int16_t pdb_roi; /* PLOGI, Common Service */
u_int8_t pdb_target;
u_int8_t pdb_initiator; /* PLOGI, Class 3 Control Flags */
u_int16_t pdb_rdsiz; /* PLOGI, Class 3 */
u_int16_t pdb_ncseq; /* PLOGI, Class 3 */
u_int16_t pdb_noseq; /* PLOGI, Class 3 */
u_int16_t pdb_labrtflg;
u_int16_t pdb_lstopflg;
u_int16_t pdb_sqhead;
u_int16_t pdb_sqtail;
u_int16_t pdb_ptimer;
u_int16_t pdb_nxt_seqid;
u_int16_t pdb_fcount;
u_int16_t pdb_prli_len;
u_int16_t pdb_prli_svc0;
u_int16_t pdb_prli_svc3;
u_int16_t pdb_loopid;
u_int16_t pdb_il_ptr;
u_int16_t pdb_sl_ptr;
uint8_t pdb_hardaddr_bits[4];
uint8_t pdb_portid_bits[4];
uint8_t pdb_nodename[8];
uint8_t pdb_portname[8];
uint16_t pdb_execthrottle;
uint16_t pdb_exec_count;
uint8_t pdb_retry_count;
uint8_t pdb_retry_delay;
uint16_t pdb_resalloc;
uint16_t pdb_curalloc;
uint16_t pdb_qhead;
uint16_t pdb_qtail;
uint16_t pdb_tl_next;
uint16_t pdb_tl_last;
uint16_t pdb_features; /* PLOGI, Common Service */
uint16_t pdb_pconcurrnt; /* PLOGI, Common Service */
uint16_t pdb_roi; /* PLOGI, Common Service */
uint8_t pdb_target;
uint8_t pdb_initiator; /* PLOGI, Class 3 Control Flags */
uint16_t pdb_rdsiz; /* PLOGI, Class 3 */
uint16_t pdb_ncseq; /* PLOGI, Class 3 */
uint16_t pdb_noseq; /* PLOGI, Class 3 */
uint16_t pdb_labrtflg;
uint16_t pdb_lstopflg;
uint16_t pdb_sqhead;
uint16_t pdb_sqtail;
uint16_t pdb_ptimer;
uint16_t pdb_nxt_seqid;
uint16_t pdb_fcount;
uint16_t pdb_prli_len;
uint16_t pdb_prli_svc0;
uint16_t pdb_prli_svc3;
uint16_t pdb_loopid;
uint16_t pdb_il_ptr;
uint16_t pdb_sl_ptr;
} isp_pdb_t;
#define PDB_OPTIONS_XMITTING (1<<11)
@ -838,18 +838,18 @@ typedef struct {
*/
typedef struct {
u_int8_t ct_revision;
u_int8_t ct_portid[3];
u_int8_t ct_fcs_type;
u_int8_t ct_fcs_subtype;
u_int8_t ct_options;
u_int8_t ct_res0;
u_int16_t ct_response;
u_int16_t ct_resid;
u_int8_t ct_res1;
u_int8_t ct_reason;
u_int8_t ct_explanation;
u_int8_t ct_vunique;
uint8_t ct_revision;
uint8_t ct_portid[3];
uint8_t ct_fcs_type;
uint8_t ct_fcs_subtype;
uint8_t ct_options;
uint8_t ct_res0;
uint16_t ct_response;
uint16_t ct_resid;
uint8_t ct_res1;
uint8_t ct_reason;
uint8_t ct_explanation;
uint8_t ct_vunique;
} ct_hdr_t;
#define FS_ACC 0x8002
#define FS_RJT 0x8001
@ -865,112 +865,112 @@ typedef struct {
#define SNS_GID_FT 0x171
#define SNS_RFT_ID 0x217
typedef struct {
u_int16_t snscb_rblen; /* response buffer length (words) */
u_int16_t snscb_res0;
u_int16_t snscb_addr[4]; /* response buffer address */
u_int16_t snscb_sblen; /* subcommand buffer length (words) */
u_int16_t snscb_res1;
u_int16_t snscb_data[1]; /* variable data */
uint16_t snscb_rblen; /* response buffer length (words) */
uint16_t snscb_res0;
uint16_t snscb_addr[4]; /* response buffer address */
uint16_t snscb_sblen; /* subcommand buffer length (words) */
uint16_t snscb_res1;
uint16_t snscb_data[1]; /* variable data */
} sns_screq_t; /* Subcommand Request Structure */
typedef struct {
u_int16_t snscb_rblen; /* response buffer length (words) */
u_int16_t snscb_res0;
u_int16_t snscb_addr[4]; /* response buffer address */
u_int16_t snscb_sblen; /* subcommand buffer length (words) */
u_int16_t snscb_res1;
u_int16_t snscb_cmd;
u_int16_t snscb_res2;
u_int32_t snscb_res3;
u_int32_t snscb_port;
uint16_t snscb_rblen; /* response buffer length (words) */
uint16_t snscb_res0;
uint16_t snscb_addr[4]; /* response buffer address */
uint16_t snscb_sblen; /* subcommand buffer length (words) */
uint16_t snscb_res1;
uint16_t snscb_cmd;
uint16_t snscb_res2;
uint32_t snscb_res3;
uint32_t snscb_port;
} sns_ga_nxt_req_t;
#define SNS_GA_NXT_REQ_SIZE (sizeof (sns_ga_nxt_req_t))
typedef struct {
u_int16_t snscb_rblen; /* response buffer length (words) */
u_int16_t snscb_res0;
u_int16_t snscb_addr[4]; /* response buffer address */
u_int16_t snscb_sblen; /* subcommand buffer length (words) */
u_int16_t snscb_res1;
u_int16_t snscb_cmd;
u_int16_t snscb_res2;
u_int32_t snscb_res3;
u_int32_t snscb_portid;
uint16_t snscb_rblen; /* response buffer length (words) */
uint16_t snscb_res0;
uint16_t snscb_addr[4]; /* response buffer address */
uint16_t snscb_sblen; /* subcommand buffer length (words) */
uint16_t snscb_res1;
uint16_t snscb_cmd;
uint16_t snscb_res2;
uint32_t snscb_res3;
uint32_t snscb_portid;
} sns_gxn_id_req_t;
#define SNS_GXN_ID_REQ_SIZE (sizeof (sns_gxn_id_req_t))
typedef struct {
u_int16_t snscb_rblen; /* response buffer length (words) */
u_int16_t snscb_res0;
u_int16_t snscb_addr[4]; /* response buffer address */
u_int16_t snscb_sblen; /* subcommand buffer length (words) */
u_int16_t snscb_res1;
u_int16_t snscb_cmd;
u_int16_t snscb_mword_div_2;
u_int32_t snscb_res3;
u_int32_t snscb_fc4_type;
uint16_t snscb_rblen; /* response buffer length (words) */
uint16_t snscb_res0;
uint16_t snscb_addr[4]; /* response buffer address */
uint16_t snscb_sblen; /* subcommand buffer length (words) */
uint16_t snscb_res1;
uint16_t snscb_cmd;
uint16_t snscb_mword_div_2;
uint32_t snscb_res3;
uint32_t snscb_fc4_type;
} sns_gid_ft_req_t;
#define SNS_GID_FT_REQ_SIZE (sizeof (sns_gid_ft_req_t))
typedef struct {
u_int16_t snscb_rblen; /* response buffer length (words) */
u_int16_t snscb_res0;
u_int16_t snscb_addr[4]; /* response buffer address */
u_int16_t snscb_sblen; /* subcommand buffer length (words) */
u_int16_t snscb_res1;
u_int16_t snscb_cmd;
u_int16_t snscb_res2;
u_int32_t snscb_res3;
u_int32_t snscb_port;
u_int32_t snscb_fc4_types[8];
uint16_t snscb_rblen; /* response buffer length (words) */
uint16_t snscb_res0;
uint16_t snscb_addr[4]; /* response buffer address */
uint16_t snscb_sblen; /* subcommand buffer length (words) */
uint16_t snscb_res1;
uint16_t snscb_cmd;
uint16_t snscb_res2;
uint32_t snscb_res3;
uint32_t snscb_port;
uint32_t snscb_fc4_types[8];
} sns_rft_id_req_t;
#define SNS_RFT_ID_REQ_SIZE (sizeof (sns_rft_id_req_t))
typedef struct {
ct_hdr_t snscb_cthdr;
u_int8_t snscb_port_type;
u_int8_t snscb_port_id[3];
u_int8_t snscb_portname[8];
u_int16_t snscb_data[1]; /* variable data */
uint8_t snscb_port_type;
uint8_t snscb_port_id[3];
uint8_t snscb_portname[8];
uint16_t snscb_data[1]; /* variable data */
} sns_scrsp_t; /* Subcommand Response Structure */
typedef struct {
ct_hdr_t snscb_cthdr;
u_int8_t snscb_port_type;
u_int8_t snscb_port_id[3];
u_int8_t snscb_portname[8];
u_int8_t snscb_pnlen; /* symbolic port name length */
u_int8_t snscb_pname[255]; /* symbolic port name */
u_int8_t snscb_nodename[8];
u_int8_t snscb_nnlen; /* symbolic node name length */
u_int8_t snscb_nname[255]; /* symbolic node name */
u_int8_t snscb_ipassoc[8];
u_int8_t snscb_ipaddr[16];
u_int8_t snscb_svc_class[4];
u_int8_t snscb_fc4_types[32];
u_int8_t snscb_fpname[8];
u_int8_t snscb_reserved;
u_int8_t snscb_hardaddr[3];
uint8_t snscb_port_type;
uint8_t snscb_port_id[3];
uint8_t snscb_portname[8];
uint8_t snscb_pnlen; /* symbolic port name length */
uint8_t snscb_pname[255]; /* symbolic port name */
uint8_t snscb_nodename[8];
uint8_t snscb_nnlen; /* symbolic node name length */
uint8_t snscb_nname[255]; /* symbolic node name */
uint8_t snscb_ipassoc[8];
uint8_t snscb_ipaddr[16];
uint8_t snscb_svc_class[4];
uint8_t snscb_fc4_types[32];
uint8_t snscb_fpname[8];
uint8_t snscb_reserved;
uint8_t snscb_hardaddr[3];
} sns_ga_nxt_rsp_t; /* Subcommand Response Structure */
#define SNS_GA_NXT_RESP_SIZE (sizeof (sns_ga_nxt_rsp_t))
typedef struct {
ct_hdr_t snscb_cthdr;
u_int8_t snscb_wwn[8];
uint8_t snscb_wwn[8];
} sns_gxn_id_rsp_t;
#define SNS_GXN_ID_RESP_SIZE (sizeof (sns_gxn_id_rsp_t))
typedef struct {
ct_hdr_t snscb_cthdr;
u_int32_t snscb_fc4_features[32];
uint32_t snscb_fc4_features[32];
} sns_gff_id_rsp_t;
#define SNS_GFF_ID_RESP_SIZE (sizeof (sns_gff_id_rsp_t))
typedef struct {
ct_hdr_t snscb_cthdr;
struct {
u_int8_t control;
u_int8_t portid[3];
uint8_t control;
uint8_t portid[3];
} snscb_ports[1];
} sns_gid_ft_rsp_t;
#define SNS_GID_FT_RESP_SIZE(x) ((sizeof (sns_gid_ft_rsp_t)) + ((x - 1) << 2))

View File

@ -388,8 +388,8 @@
#define MAX_MAILBOX(isp) ((IS_FC(isp))? 12 : 8)
#define MAILBOX_STORAGE 12
typedef struct {
u_int16_t param[MAILBOX_STORAGE];
u_int16_t ibits, obits;
uint16_t param[MAILBOX_STORAGE];
uint16_t ibits, obits;
} mbreg_t;
/*
@ -766,26 +766,26 @@ typedef struct {
/* Offset 5 */
/*
u_int8_t bios_configuration_mode :2;
u_int8_t bios_disable :1;
u_int8_t selectable_scsi_boot_enable :1;
u_int8_t cd_rom_boot_enable :1;
u_int8_t disable_loading_risc_code :1;
u_int8_t enable_64bit_addressing :1;
u_int8_t unused_7 :1;
uint8_t bios_configuration_mode :2;
uint8_t bios_disable :1;
uint8_t selectable_scsi_boot_enable :1;
uint8_t cd_rom_boot_enable :1;
uint8_t disable_loading_risc_code :1;
uint8_t enable_64bit_addressing :1;
uint8_t unused_7 :1;
*/
/* Offsets 6, 7 */
/*
u_int8_t boot_lun_number :5;
u_int8_t scsi_bus_number :1;
u_int8_t unused_6 :1;
u_int8_t unused_7 :1;
u_int8_t boot_target_number :4;
u_int8_t unused_12 :1;
u_int8_t unused_13 :1;
u_int8_t unused_14 :1;
u_int8_t unused_15 :1;
uint8_t boot_lun_number :5;
uint8_t scsi_bus_number :1;
uint8_t unused_6 :1;
uint8_t unused_7 :1;
uint8_t boot_target_number :4;
uint8_t unused_12 :1;
uint8_t unused_13 :1;
uint8_t unused_14 :1;
uint8_t unused_15 :1;
*/
#define ISP1080_NVRAM_HBA_ENABLE(c) ISPBSMX(c, 16, 3, 0x01)
@ -955,26 +955,26 @@ typedef struct {
#define ISP2100_NVRAM_RETRY_DELAY(c) (c)[17]
#define ISP2100_NVRAM_PORT_NAME(c) (\
(((u_int64_t)(c)[18]) << 56) | \
(((u_int64_t)(c)[19]) << 48) | \
(((u_int64_t)(c)[20]) << 40) | \
(((u_int64_t)(c)[21]) << 32) | \
(((u_int64_t)(c)[22]) << 24) | \
(((u_int64_t)(c)[23]) << 16) | \
(((u_int64_t)(c)[24]) << 8) | \
(((u_int64_t)(c)[25]) << 0))
(((uint64_t)(c)[18]) << 56) | \
(((uint64_t)(c)[19]) << 48) | \
(((uint64_t)(c)[20]) << 40) | \
(((uint64_t)(c)[21]) << 32) | \
(((uint64_t)(c)[22]) << 24) | \
(((uint64_t)(c)[23]) << 16) | \
(((uint64_t)(c)[24]) << 8) | \
(((uint64_t)(c)[25]) << 0))
#define ISP2100_NVRAM_HARDLOOPID(c) (c)[26]
#define ISP2200_NVRAM_NODE_NAME(c) (\
(((u_int64_t)(c)[30]) << 56) | \
(((u_int64_t)(c)[31]) << 48) | \
(((u_int64_t)(c)[32]) << 40) | \
(((u_int64_t)(c)[33]) << 32) | \
(((u_int64_t)(c)[34]) << 24) | \
(((u_int64_t)(c)[35]) << 16) | \
(((u_int64_t)(c)[36]) << 8) | \
(((u_int64_t)(c)[37]) << 0))
(((uint64_t)(c)[30]) << 56) | \
(((uint64_t)(c)[31]) << 48) | \
(((uint64_t)(c)[32]) << 40) | \
(((uint64_t)(c)[33]) << 32) | \
(((uint64_t)(c)[34]) << 24) | \
(((uint64_t)(c)[35]) << 16) | \
(((uint64_t)(c)[36]) << 8) | \
(((uint64_t)(c)[37]) << 0))
#define ISP2100_NVRAM_HBA_OPTIONS(c) (c)[70]
#define ISP2100_NVRAM_HBA_DISABLE(c) ISPBSMX(c, 70, 0, 0x01)
@ -985,14 +985,14 @@ typedef struct {
#define ISP2100_NVRAM_SET_CACHELINESZ(c) ISPBSMX(c, 70, 5, 0x01)
#define ISP2100_NVRAM_BOOT_NODE_NAME(c) (\
(((u_int64_t)(c)[72]) << 56) | \
(((u_int64_t)(c)[73]) << 48) | \
(((u_int64_t)(c)[74]) << 40) | \
(((u_int64_t)(c)[75]) << 32) | \
(((u_int64_t)(c)[76]) << 24) | \
(((u_int64_t)(c)[77]) << 16) | \
(((u_int64_t)(c)[78]) << 8) | \
(((u_int64_t)(c)[79]) << 0))
(((uint64_t)(c)[72]) << 56) | \
(((uint64_t)(c)[73]) << 48) | \
(((uint64_t)(c)[74]) << 40) | \
(((uint64_t)(c)[75]) << 32) | \
(((uint64_t)(c)[76]) << 24) | \
(((uint64_t)(c)[77]) << 16) | \
(((uint64_t)(c)[78]) << 8) | \
(((uint64_t)(c)[79]) << 0))
#define ISP2100_NVRAM_BOOT_LUN(c) (c)[80]
@ -1008,15 +1008,15 @@ typedef struct {
*/
#define QLA2200_RISC_IMAGE_DUMP_SIZE \
(1 * sizeof (u_int16_t)) + /* 'used' flag (also HBA type) */ \
(352 * sizeof (u_int16_t)) + /* RISC registers */ \
(61440 * sizeof (u_int16_t)) /* RISC SRAM (offset 0x1000..0xffff) */
(1 * sizeof (uint16_t)) + /* 'used' flag (also HBA type) */ \
(352 * sizeof (uint16_t)) + /* RISC registers */ \
(61440 * sizeof (uint16_t)) /* RISC SRAM (offset 0x1000..0xffff) */
#define QLA2300_RISC_IMAGE_DUMP_SIZE \
(1 * sizeof (u_int16_t)) + /* 'used' flag (also HBA type) */ \
(464 * sizeof (u_int16_t)) + /* RISC registers */ \
(63488 * sizeof (u_int16_t)) + /* RISC SRAM (0x0800..0xffff) */ \
(4096 * sizeof (u_int16_t)) + /* RISC SRAM (0x10000..0x10FFF) */ \
(61440 * sizeof (u_int16_t)) /* RISC SRAM (0x11000..0x1FFFF) */
(1 * sizeof (uint16_t)) + /* 'used' flag (also HBA type) */ \
(464 * sizeof (uint16_t)) + /* RISC registers */ \
(63488 * sizeof (uint16_t)) + /* RISC SRAM (0x0800..0xffff) */ \
(4096 * sizeof (uint16_t)) + /* RISC SRAM (0x10000..0x10FFF) */ \
(61440 * sizeof (uint16_t)) /* RISC SRAM (0x11000..0x1FFFF) */
/* the larger of the two */
#define ISP_CRASH_IMAGE_SIZE QLA2300_RISC_IMAGE_DUMP_SIZE
#endif /* _ISPREG_H */

View File

@ -32,49 +32,39 @@
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <dev/ic/ispmbox.h>
#ifdef ISP_TARGET_MODE
#include <dev/ic/isp_target.h>
#include <dev/ic/isp_tpublic.h>
#endif
#endif
#ifdef __FreeBSD__
#include <dev/isp/ispmbox.h>
#ifdef ISP_TARGET_MODE
#include <dev/isp/isp_target.h>
#include <dev/isp/isp_tpublic.h>
#endif
#endif
#ifdef __linux__
#include "ispmbox.h"
#ifdef ISP_TARGET_MODE
#include "isp_target.h"
#include "isp_tpublic.h"
#endif
#ifdef __svr4__
#include "ispmbox.h"
#endif
#define ISP_CORE_VERSION_MAJOR 2
#define ISP_CORE_VERSION_MINOR 10
#define ISP_CORE_VERSION_MINOR 11
/*
* Vector for bus specific code to provide specific services.
*/
struct ispsoftc;
typedef struct ispsoftc ispsoftc_t;
struct ispmdvec {
int (*dv_rd_isr)
(struct ispsoftc *, u_int16_t *, u_int16_t *, u_int16_t *);
u_int16_t (*dv_rd_reg) (struct ispsoftc *, int);
void (*dv_wr_reg) (struct ispsoftc *, int, u_int16_t);
int (*dv_mbxdma) (struct ispsoftc *);
int (*dv_dmaset) (struct ispsoftc *,
XS_T *, ispreq_t *, u_int16_t *, u_int16_t);
void (*dv_dmaclr)
(struct ispsoftc *, XS_T *, u_int16_t);
void (*dv_reset0) (struct ispsoftc *);
void (*dv_reset1) (struct ispsoftc *);
void (*dv_dregs) (struct ispsoftc *, const char *);
u_int16_t *dv_ispfw; /* ptr to f/w */
u_int16_t dv_conf1;
u_int16_t dv_clock; /* clock frequency */
(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *);
uint16_t (*dv_rd_reg) (ispsoftc_t *, int);
void (*dv_wr_reg) (ispsoftc_t *, int, uint16_t);
int (*dv_mbxdma) (ispsoftc_t *);
int (*dv_dmaset)
(ispsoftc_t *, XS_T *, ispreq_t *, uint16_t *, uint16_t);
void (*dv_dmaclr) (ispsoftc_t *, XS_T *, uint16_t);
void (*dv_reset0) (ispsoftc_t *);
void (*dv_reset1) (ispsoftc_t *);
void (*dv_dregs) (ispsoftc_t *, const char *);
uint16_t *dv_ispfw; /* ptr to f/w */
uint16_t dv_conf1;
uint16_t dv_clock; /* clock frequency */
};
/*
@ -85,15 +75,6 @@ struct ispmdvec {
#define ISP_MAX_TARGETS(isp) (IS_FC(isp)? MAX_FC_TARG : MAX_TARGETS)
#define ISP_MAX_LUNS(isp) (isp)->isp_maxluns
/*
* 'Types'
*/
#ifdef ISP_DAC_SUPPORTED
typedef u_int64_t isp_dma_addr_t;
#else
typedef u_int32_t isp_dma_addr_t;
#endif
/*
* Macros to access ISP registers through bus specific layers-
* mostly wrappers to vector through the mdvec structure.
@ -113,8 +94,8 @@ typedef u_int32_t isp_dma_addr_t;
#define ISP_DMASETUP(isp, xs, req, iptrp, optr) \
(*(isp)->isp_mdvec->dv_dmaset)((isp), (xs), (req), (iptrp), (optr))
#define ISP_DMAFREE(isp, xs, hndl) \
if ((isp)->isp_mdvec->dv_dmaclr) \
#define ISP_DMAFREE(isp, xs, hndl) \
if ((isp)->isp_mdvec->dv_dmaclr) \
(*(isp)->isp_mdvec->dv_dmaclr)((isp), (xs), (hndl))
#define ISP_RESET0(isp) \
@ -156,7 +137,7 @@ typedef u_int32_t isp_dma_addr_t;
#define RESULT_QUEUE_LEN(x) \
(((MAXISPREQUEST(x) >> 2) < 64)? 64 : MAXISPREQUEST(x) >> 2)
#endif
#define ISP_QUEUE_ENTRY(q, idx) ((q) + ((idx) * QENTRY_LEN))
#define ISP_QUEUE_ENTRY(q, idx) (((uint8_t *)q) + ((idx) * QENTRY_LEN))
#define ISP_QUEUE_SIZE(n) ((n) * QENTRY_LEN)
#define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1))
#define ISP_QFREE(in, out, qlen) \
@ -174,7 +155,7 @@ typedef u_int32_t isp_dma_addr_t;
* SCSI Specific Host Adapter Parameters- per bus, per target
*/
typedef struct {
u_int isp_gotdparms : 1,
uint32_t isp_gotdparms : 1,
isp_req_ack_active_neg : 1,
isp_data_line_active_neg: 1,
isp_cmd_dma_burst_enable: 1,
@ -186,14 +167,14 @@ typedef struct {
isp_fast_mttr : 1, /* fast sram */
isp_initiator_id : 4,
isp_async_data_setup : 4;
u_int16_t isp_selection_timeout;
u_int16_t isp_max_queue_depth;
u_int8_t isp_tag_aging;
u_int8_t isp_bus_reset_delay;
u_int8_t isp_retry_count;
u_int8_t isp_retry_delay;
uint16_t isp_selection_timeout;
uint16_t isp_max_queue_depth;
uint8_t isp_tag_aging;
uint8_t isp_bus_reset_delay;
uint8_t isp_retry_count;
uint8_t isp_retry_delay;
struct {
u_int32_t
uint32_t
exc_throttle : 8,
: 1,
dev_enable : 1, /* ignored */
@ -202,12 +183,12 @@ typedef struct {
actv_offset : 4,
goal_offset : 4,
nvrm_offset : 4;
u_int8_t actv_period; /* current sync period */
u_int8_t goal_period; /* goal sync period */
u_int8_t nvrm_period; /* nvram sync period */
u_int16_t actv_flags; /* current device flags */
u_int16_t goal_flags; /* goal device flags */
u_int16_t nvrm_flags; /* nvram device flags */
uint8_t actv_period; /* current sync period */
uint8_t goal_period; /* goal sync period */
uint8_t nvrm_period; /* nvram sync period */
uint16_t actv_flags; /* current device flags */
uint16_t goal_flags; /* goal device flags */
uint16_t nvrm_flags; /* nvram device flags */
} isp_devparam[MAX_TARGETS];
} sdparam;
@ -251,7 +232,7 @@ typedef struct {
#endif
typedef struct {
u_int32_t : 13,
uint32_t : 13,
isp_gbspeed : 3,
: 2,
isp_iid_set : 1,
@ -261,20 +242,20 @@ typedef struct {
isp_gotdparms : 1,
isp_topo : 3,
isp_onfabric : 1;
u_int32_t : 8,
uint32_t : 8,
isp_portid : 24; /* S_ID */
u_int16_t isp_fwoptions;
u_int16_t isp_iid; /* 'initiator' id */
u_int16_t isp_loopid; /* hard loop id */
u_int16_t isp_fwattr; /* firmware attributes */
u_int8_t isp_execthrottle;
u_int8_t isp_retry_delay;
u_int8_t isp_retry_count;
u_int8_t isp_reserved;
u_int16_t isp_maxalloc;
u_int16_t isp_maxfrmlen;
u_int64_t isp_nodewwn;
u_int64_t isp_portwwn;
uint16_t isp_fwoptions;
uint16_t isp_iid; /* 'initiator' id */
uint16_t isp_loopid; /* hard loop id */
uint16_t isp_fwattr; /* firmware attributes */
uint8_t isp_execthrottle;
uint8_t isp_retry_delay;
uint8_t isp_retry_count;
uint8_t isp_reserved;
uint16_t isp_maxalloc;
uint16_t isp_maxfrmlen;
uint64_t isp_nodewwn;
uint64_t isp_portwwn;
/*
* Port Data Base. This is indexed by 'target', which is invariate.
* However, elements within can move around due to loop changes,
@ -285,7 +266,7 @@ typedef struct {
* to move around.
*/
struct lportdb {
u_int32_t loopid : 16,
uint32_t loopid : 16,
: 2,
fc4_type : 4,
last_fabric_dev : 1,
@ -297,19 +278,19 @@ typedef struct {
roles : 2,
tvalid : 1,
valid : 1;
u_int32_t port_type : 8,
uint32_t port_type : 8,
portid : 24;
u_int64_t node_wwn;
u_int64_t port_wwn;
uint64_t node_wwn;
uint64_t port_wwn;
} portdb[MAX_FC_TARG], tport[FC_PORT_ID];
/*
* Scratch DMA mapped in area to fetch Port Database stuff, etc.
*/
caddr_t isp_scratch;
isp_dma_addr_t isp_scdma;
void * isp_scratch;
XS_DMA_ADDR_T isp_scdma;
#ifdef ISP_FW_CRASH_DUMP
u_int16_t *isp_dump_data;
uint16_t * isp_dump_data;
#endif
} fcparam;
@ -341,7 +322,7 @@ typedef struct {
/*
* Soft Structure per host adapter
*/
typedef struct ispsoftc {
struct ispsoftc {
/*
* Platform (OS) specific data
*/
@ -358,14 +339,14 @@ typedef struct ispsoftc {
*/
void * isp_param; /* type specific */
u_int16_t isp_fwrev[3]; /* Loaded F/W revision */
u_int16_t isp_romfw_rev[3]; /* PROM F/W revision */
u_int16_t isp_maxcmds; /* max possible I/O cmds */
u_int8_t isp_type; /* HBA Chip Type */
u_int8_t isp_revision; /* HBA Chip H/W Revision */
u_int32_t isp_maxluns; /* maximum luns supported */
uint16_t isp_fwrev[3]; /* Loaded F/W revision */
uint16_t isp_romfw_rev[3]; /* PROM F/W revision */
uint16_t isp_maxcmds; /* max possible I/O cmds */
uint8_t isp_type; /* HBA Chip Type */
uint8_t isp_revision; /* HBA Chip H/W Revision */
uint32_t isp_maxluns; /* maximum luns supported */
u_int32_t isp_clock : 8, /* input clock */
uint32_t isp_clock : 8, /* input clock */
: 4,
isp_port : 1, /* 23XX only */
isp_failed : 1, /* board failed */
@ -376,47 +357,47 @@ typedef struct ispsoftc {
isp_role : 2, /* roles supported */
isp_dblev : 12; /* debug log mask */
u_int32_t isp_confopts; /* config options */
uint32_t isp_confopts; /* config options */
u_int16_t isp_rqstinrp; /* register for REQINP */
u_int16_t isp_rqstoutrp; /* register for REQOUTP */
u_int16_t isp_respinrp; /* register for RESINP */
u_int16_t isp_respoutrp; /* register for RESOUTP */
uint16_t isp_rqstinrp; /* register for REQINP */
uint16_t isp_rqstoutrp; /* register for REQOUTP */
uint16_t isp_respinrp; /* register for RESINP */
uint16_t isp_respoutrp; /* register for RESOUTP */
/*
* Instrumentation
*/
u_int64_t isp_intcnt; /* total int count */
u_int64_t isp_intbogus; /* spurious int count */
u_int64_t isp_intmboxc; /* mbox completions */
u_int64_t isp_intoasync; /* other async */
u_int64_t isp_rsltccmplt; /* CMDs on result q */
u_int64_t isp_fphccmplt; /* CMDs via fastpost */
u_int16_t isp_rscchiwater;
u_int16_t isp_fpcchiwater;
uint64_t isp_intcnt; /* total int count */
uint64_t isp_intbogus; /* spurious int count */
uint64_t isp_intmboxc; /* mbox completions */
uint64_t isp_intoasync; /* other async */
uint64_t isp_rsltccmplt; /* CMDs on result q */
uint64_t isp_fphccmplt; /* CMDs via fastpost */
uint16_t isp_rscchiwater;
uint16_t isp_fpcchiwater;
/*
* Volatile state
*/
volatile u_int32_t
volatile uint32_t
isp_obits : 8, /* mailbox command output */
isp_mboxbsy : 1, /* mailbox command active */
isp_state : 3,
isp_sendmarker : 2, /* send a marker entry */
isp_update : 2, /* update parameters */
isp_nactive : 16; /* how many commands active */
volatile u_int16_t isp_reqodx; /* index of last ISP pickup */
volatile u_int16_t isp_reqidx; /* index of next request */
volatile u_int16_t isp_residx; /* index of next result */
volatile u_int16_t isp_resodx; /* index of next result */
volatile u_int16_t isp_rspbsy;
volatile u_int16_t isp_lasthdls; /* last handle seed */
volatile u_int16_t isp_mboxtmp[MAILBOX_STORAGE];
volatile u_int16_t isp_lastmbxcmd; /* last mbox command sent */
volatile u_int16_t isp_mbxwrk0;
volatile u_int16_t isp_mbxwrk1;
volatile u_int16_t isp_mbxwrk2;
volatile uint16_t isp_reqodx; /* index of last ISP pickup */
volatile uint16_t isp_reqidx; /* index of next request */
volatile uint16_t isp_residx; /* index of next result */
volatile uint16_t isp_resodx; /* index of next result */
volatile uint16_t isp_rspbsy;
volatile uint16_t isp_lasthdls; /* last handle seed */
volatile uint16_t isp_mboxtmp[MAILBOX_STORAGE];
volatile uint16_t isp_lastmbxcmd; /* last mbox command sent */
volatile uint16_t isp_mbxwrk0;
volatile uint16_t isp_mbxwrk1;
volatile uint16_t isp_mbxwrk2;
void * isp_mbxworkp;
/*
@ -434,11 +415,11 @@ typedef struct ispsoftc {
/*
* request/result queue pointers and DMA handles for them.
*/
caddr_t isp_rquest;
caddr_t isp_result;
isp_dma_addr_t isp_rquest_dma;
isp_dma_addr_t isp_result_dma;
} ispsoftc_t;
void * isp_rquest;
void * isp_result;
XS_DMA_ADDR_T isp_rquest_dma;
XS_DMA_ADDR_T isp_result_dma;
};
#define SDPARAM(isp) ((sdparam *) (isp)->isp_param)
#define FCPARAM(isp) ((fcparam *) (isp)->isp_param)
@ -579,18 +560,16 @@ typedef struct ispsoftc {
#define IS_24XX(isp) ((isp)->isp_type >= ISP_HA_FC_2400)
/*
* DMA cookie macros
* DMA related macros
*/
#ifdef ISP_DAC_SUPPORTRED
#define DMA_WD3(x) (((x) >> 48) & 0xffff)
#define DMA_WD2(x) (((x) >> 32) & 0xffff)
#else
#define DMA_WD3(x) 0
#define DMA_WD2(x) 0
#endif
#define DMA_WD3(x) ((((uint64_t)x) >> 48) & 0xffff)
#define DMA_WD2(x) ((((uint64_t)x) >> 32) & 0xffff)
#define DMA_WD1(x) (((x) >> 16) & 0xffff)
#define DMA_WD0(x) (((x) & 0xffff))
#define DMA_LO32(x) ((uint32_t) (x))
#define DMA_HI32(x) ((uint32_t)(((uint64_t)x) >> 32))
/*
* Core System Function Prototypes
*/
@ -599,23 +578,23 @@ typedef struct ispsoftc {
* Reset Hardware. Totally. Assumes that you'll follow this with
* a call to isp_init.
*/
void isp_reset(struct ispsoftc *);
void isp_reset(ispsoftc_t *);
/*
* Initialize Hardware to known state
*/
void isp_init(struct ispsoftc *);
void isp_init(ispsoftc_t *);
/*
* Reset the ISP and call completion for any orphaned commands.
*/
void isp_reinit(struct ispsoftc *);
void isp_reinit(ispsoftc_t *);
#ifdef ISP_FW_CRASH_DUMP
/*
* Dump firmware entry point.
*/
void isp_fw_dump(struct ispsoftc *isp);
void isp_fw_dump(ispsoftc_t *isp);
#endif
/*
@ -625,13 +604,14 @@ void isp_fw_dump(struct ispsoftc *isp);
* semaphore register and first mailbox register (if appropriate). This also
* means that most spurious/bogus interrupts not for us can be filtered first.
*/
void isp_intr(struct ispsoftc *, u_int16_t, u_int16_t, u_int16_t);
void isp_intr(ispsoftc_t *, uint16_t, uint16_t, uint16_t);
/*
* Command Entry Point- Platform Dependent layers call into this
*/
int isp_start(XS_T *);
/* these values are what isp_start returns */
#define CMD_COMPLETE 101 /* command completed */
#define CMD_EAGAIN 102 /* busy- maybe retry later */
@ -692,7 +672,7 @@ typedef enum {
ISPCTL_TOGGLE_TMODE, /* toggle target mode */
ISPCTL_GET_PDB /* get a single port database entry */
} ispctl_t;
int isp_control(struct ispsoftc *, ispctl_t, void *);
int isp_control(ispsoftc_t *, ispctl_t, void *);
/*
@ -753,7 +733,7 @@ typedef enum {
ISPASYNC_FW_DUMPED, /* Firmware crashdump taken */
ISPASYNC_FW_RESTARTED /* Firmware has been restarted */
} ispasync_t;
int isp_async(struct ispsoftc *, ispasync_t, void *);
int isp_async(ispsoftc_t *, ispasync_t, void *);
#define ISPASYNC_CHANGE_PDB ((void *) 0)
#define ISPASYNC_CHANGE_SNS ((void *) 1)
@ -764,7 +744,7 @@ int isp_async(struct ispsoftc *, ispasync_t, void *);
*
* Generally this is:
*
* void isp_prt(struct ispsoftc *, int level, const char *, ...)
* void isp_prt(ispsoftc_t *, int level, const char *, ...)
*
* but due to compiler differences on different platforms this won't be
* formally done here. Instead, it goes in each platform definition file.
@ -791,11 +771,6 @@ int isp_async(struct ispsoftc *, ispasync_t, void *);
* Each platform must also provide the following macros/defines:
*
*
* ISP_DAC_SUPPORTED - Is DAC (Dual Address Cycle) is supported?
* Basically means whether or not DMA for PCI
* PCI cards (Ultra2 or better or FC) works
* above 4GB.
*
* ISP2100_SCRLEN - length for the Fibre Channel scratch DMA area
*
* MEMZERO(dst, src) platform zeroing function
@ -808,28 +783,28 @@ int isp_async(struct ispsoftc *, ispasync_t, void *);
*
* GET_NANOTIME(NANOTIME_T *) get current nanotime.
*
* GET_NANOSEC(NANOTIME_T *) get u_int64_t from NANOTIME_T
* GET_NANOSEC(NANOTIME_T *) get uint64_t from NANOTIME_T
*
* NANOTIME_SUB(NANOTIME_T *, NANOTIME_T *)
* subtract two NANOTIME_T values
*
*
* MAXISPREQUEST(struct ispsoftc *) maximum request queue size
* MAXISPREQUEST(ispsoftc_t *) maximum request queue size
* for this particular board type
*
* MEMORYBARRIER(struct ispsoftc *, barrier_type, offset, size)
* MEMORYBARRIER(ispsoftc_t *, barrier_type, offset, size)
*
* Function/Macro the provides memory synchronization on
* various objects so that the ISP's and the system's view
* of the same object is consistent.
*
* MBOX_ACQUIRE(struct ispsoftc *) acquire lock on mailbox regs
* MBOX_WAIT_COMPLETE(struct ispsoftc *) wait for mailbox cmd to be done
* MBOX_NOTIFY_COMPLETE(struct ispsoftc *) notification of mbox cmd donee
* MBOX_RELEASE(struct ispsoftc *) release lock on mailbox regs
* MBOX_ACQUIRE(ispsoftc_t *) acquire lock on mailbox regs
* MBOX_WAIT_COMPLETE(ispsoftc_t *) wait for mailbox cmd to be done
* MBOX_NOTIFY_COMPLETE(ispsoftc_t *) notification of mbox cmd donee
* MBOX_RELEASE(ispsoftc_t *) release lock on mailbox regs
*
* FC_SCRATCH_ACQUIRE(struct ispsoftc *) acquire lock on FC scratch area
* FC_SCRATCH_RELEASE(struct ispsoftc *) acquire lock on FC scratch area
* FC_SCRATCH_ACQUIRE(ispsoftc_t *) acquire lock on FC scratch area
* FC_SCRATCH_RELEASE(ispsoftc_t *) acquire lock on FC scratch area
*
* SCSI_GOOD SCSI 'Good' Status
* SCSI_CHECK SCSI 'Check Condition' Status
@ -837,6 +812,7 @@ int isp_async(struct ispsoftc *, ispasync_t, void *);
* SCSI_QFULL SCSI 'Queue Full' Status
*
* XS_T Platform SCSI transaction type (i.e., command for HBA)
* XS_DMA_ADDR_T Platform PCI DMA Address Type
* XS_ISP(xs) gets an instance out of an XS_T
* XS_CHANNEL(xs) gets the channel (bus # for DUALBUS cards) ""
* XS_TGT(xs) gets the target ""
@ -874,18 +850,18 @@ int isp_async(struct ispsoftc *, ispasync_t, void *);
* response queue entry status bits
*
*
* DEFAULT_IID(struct ispsoftc *) Default SCSI initiator ID
* DEFAULT_LOOPID(struct ispsoftc *) Default FC Loop ID
* DEFAULT_NODEWWN(struct ispsoftc *) Default Node WWN
* DEFAULT_PORTWWN(struct ispsoftc *) Default Port WWN
* DEFAULT_FRAMESIZE(struct ispsoftc *) Default Frame Size
* DEFAULT_EXEC_THROTTLE(struct ispsoftc *) Default Execution Throttle
* DEFAULT_IID(ispsoftc_t *) Default SCSI initiator ID
* DEFAULT_LOOPID(ispsoftc_t *) Default FC Loop ID
* DEFAULT_NODEWWN(ispsoftc_t *) Default Node WWN
* DEFAULT_PORTWWN(ispsoftc_t *) Default Port WWN
* DEFAULT_FRAMESIZE(ispsoftc_t *) Default Frame Size
* DEFAULT_EXEC_THROTTLE(ispsoftc_t *) Default Execution Throttle
* These establish reasonable defaults for each platform.
* These must be available independent of card NVRAM and are
* to be used should NVRAM not be readable.
*
* ISP_NODEWWN(struct ispsoftc *) FC Node WWN to use
* ISP_PORTWWN(struct ispsoftc *) FC Port WWN to use
* ISP_NODEWWN(ispsoftc_t *) FC Node WWN to use
* ISP_PORTWWN(ispsoftc_t *) FC Port WWN to use
*
* These are to be used after NVRAM is read. The tags
* in fcparam.isp_{node,port}wwn reflect the values
@ -897,15 +873,15 @@ int isp_async(struct ispsoftc *, ispasync_t, void *);
*
* (XXX these do endian specific transformations- in transition XXX)
*
* ISP_IOXPUT_8(struct ispsoftc *, u_int8_t srcval, u_int8_t *dstptr)
* ISP_IOXPUT_16(struct ispsoftc *, u_int16_t srcval, u_int16_t *dstptr)
* ISP_IOXPUT_32(struct ispsoftc *, u_int32_t srcval, u_int32_t *dstptr)
* ISP_IOXPUT_8(ispsoftc_t *, uint8_t srcval, uint8_t *dstptr)
* ISP_IOXPUT_16(ispsoftc_t *, uint16_t srcval, uint16_t *dstptr)
* ISP_IOXPUT_32(ispsoftc_t *, uint32_t srcval, uint32_t *dstptr)
*
* ISP_IOXGET_8(struct ispsoftc *, u_int8_t *srcptr, u_int8_t dstrval)
* ISP_IOXGET_16(struct ispsoftc *, u_int16_t *srcptr, u_int16_t dstrval)
* ISP_IOXGET_32(struct ispsoftc *, u_int32_t *srcptr, u_int32_t dstrval)
* ISP_IOXGET_8(ispsoftc_t *, uint8_t *srcptr, uint8_t dstrval)
* ISP_IOXGET_16(ispsoftc_t *, uint16_t *srcptr, uint16_t dstrval)
* ISP_IOXGET_32(ispsoftc_t *, uint32_t *srcptr, uint32_t dstrval)
*
* ISP_SWIZZLE_NVRAM_WORD(struct ispsoftc *, u_int16_t *)
* ISP_SWIZZLE_NVRAM_WORD(ispsoftc_t *, uint16_t *)
*/
#endif /* _ISPVAR_H */