isp.c (155206) | isp.c (155704) |
---|---|
1/*- 2 * Machine and OS Independent (well, as best as possible) 3 * code for the Qlogic ISP SCSI adapters. 4 * 5 * Copyright (c) 1997-2006 by Matthew Jacob 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * SUCH DAMAGE. 28 */ 29 30/* 31 * Inspiration and ideas about this driver are from Erik Moe's Linux driver 32 * (qlogicisp.c) and Dave Miller's SBus version of same (qlogicisp.c). Some 33 * ideas dredged from the Solaris driver. 34 */ | 1/*- 2 * Machine and OS Independent (well, as best as possible) 3 * code for the Qlogic ISP SCSI adapters. 4 * 5 * Copyright (c) 1997-2006 by Matthew Jacob 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * SUCH DAMAGE. 28 */ 29 30/* 31 * Inspiration and ideas about this driver are from Erik Moe's Linux driver 32 * (qlogicisp.c) and Dave Miller's SBus version of same (qlogicisp.c). Some 33 * ideas dredged from the Solaris driver. 34 */ |
35#ifdef __FreeBSD__ 36#include <sys/cdefs.h> 37__FBSDID("$FreeBSD: head/sys/dev/isp/isp.c 155704 2006-02-15 00:31:48Z mjacob $"); 38#endif |
|
35 36/* 37 * Include header file appropriate for platform we're building on. 38 */ | 39 40/* 41 * Include header file appropriate for platform we're building on. 42 */ |
39 | |
40#ifdef __NetBSD__ 41#include <dev/ic/isp_netbsd.h> 42#endif 43#ifdef __FreeBSD__ | 43#ifdef __NetBSD__ 44#include <dev/ic/isp_netbsd.h> 45#endif 46#ifdef __FreeBSD__ |
44#include <sys/cdefs.h> 45__FBSDID("$FreeBSD: head/sys/dev/isp/isp.c 155206 2006-02-02 09:02:16Z mjacob $"); | |
46#include <dev/isp/isp_freebsd.h> 47#endif 48#ifdef __OpenBSD__ 49#include <dev/ic/isp_openbsd.h> 50#endif 51#ifdef __linux__ 52#include "isp_linux.h" 53#endif --- 54 unchanged lines hidden (view full) --- 108static const char sc3[] = "Generated"; 109static const char sc4[] = "NVRAM"; 110static const char bun[] = 111 "bad underrun for %d.%d (count %d, resid %d, status %s)"; 112 113/* 114 * Local function prototypes. 115 */ | 47#include <dev/isp/isp_freebsd.h> 48#endif 49#ifdef __OpenBSD__ 50#include <dev/ic/isp_openbsd.h> 51#endif 52#ifdef __linux__ 53#include "isp_linux.h" 54#endif --- 54 unchanged lines hidden (view full) --- 109static const char sc3[] = "Generated"; 110static const char sc4[] = "NVRAM"; 111static const char bun[] = 112 "bad underrun for %d.%d (count %d, resid %d, status %s)"; 113 114/* 115 * Local function prototypes. 116 */ |
116static int isp_parse_async(struct ispsoftc *, u_int16_t); | 117static int isp_parse_async(struct ispsoftc *, uint16_t); |
117static int isp_handle_other_response(struct ispsoftc *, int, isphdr_t *, | 118static int isp_handle_other_response(struct ispsoftc *, int, isphdr_t *, |
118 u_int16_t *); | 119 uint16_t *); |
119static void 120isp_parse_status(struct ispsoftc *, ispstatusreq_t *, XS_T *); | 120static void 121isp_parse_status(struct ispsoftc *, ispstatusreq_t *, XS_T *); |
121static void isp_fastpost_complete(struct ispsoftc *, u_int16_t); | 122static void isp_fastpost_complete(struct ispsoftc *, uint16_t); |
122static int isp_mbox_continue(struct ispsoftc *); 123static void isp_scsi_init(struct ispsoftc *); 124static void isp_scsi_channel_init(struct ispsoftc *, int); 125static void isp_fibre_init(struct ispsoftc *); 126static void isp_mark_getpdb_all(struct ispsoftc *); 127static int isp_getmap(struct ispsoftc *, fcpos_map_t *); 128static int isp_getpdb(struct ispsoftc *, int, isp_pdb_t *); | 123static int isp_mbox_continue(struct ispsoftc *); 124static void isp_scsi_init(struct ispsoftc *); 125static void isp_scsi_channel_init(struct ispsoftc *, int); 126static void isp_fibre_init(struct ispsoftc *); 127static void isp_mark_getpdb_all(struct ispsoftc *); 128static int isp_getmap(struct ispsoftc *, fcpos_map_t *); 129static int isp_getpdb(struct ispsoftc *, int, isp_pdb_t *); |
129static u_int64_t isp_get_portname(struct ispsoftc *, int, int); | 130static uint64_t isp_get_portname(struct ispsoftc *, int, int); |
130static int isp_fclink_test(struct ispsoftc *, int); 131static char *isp2100_fw_statename(int); 132static int isp_pdb_sync(struct ispsoftc *); 133static int isp_scan_loop(struct ispsoftc *); 134static int isp_fabric_mbox_cmd(struct ispsoftc *, mbreg_t *); 135static int isp_scan_fabric(struct ispsoftc *, int); 136static void isp_register_fc4_type(struct ispsoftc *); 137static void isp_fw_state(struct ispsoftc *); 138static void isp_mboxcmd_qnw(struct ispsoftc *, mbreg_t *, int); 139static void isp_mboxcmd(struct ispsoftc *, mbreg_t *, int); 140 141static void isp_update(struct ispsoftc *); 142static void isp_update_bus(struct ispsoftc *, int); 143static void isp_setdfltparm(struct ispsoftc *, int); 144static int isp_read_nvram(struct ispsoftc *); | 131static int isp_fclink_test(struct ispsoftc *, int); 132static char *isp2100_fw_statename(int); 133static int isp_pdb_sync(struct ispsoftc *); 134static int isp_scan_loop(struct ispsoftc *); 135static int isp_fabric_mbox_cmd(struct ispsoftc *, mbreg_t *); 136static int isp_scan_fabric(struct ispsoftc *, int); 137static void isp_register_fc4_type(struct ispsoftc *); 138static void isp_fw_state(struct ispsoftc *); 139static void isp_mboxcmd_qnw(struct ispsoftc *, mbreg_t *, int); 140static void isp_mboxcmd(struct ispsoftc *, mbreg_t *, int); 141 142static void isp_update(struct ispsoftc *); 143static void isp_update_bus(struct ispsoftc *, int); 144static void isp_setdfltparm(struct ispsoftc *, int); 145static int isp_read_nvram(struct ispsoftc *); |
145static void isp_rdnvram_word(struct ispsoftc *, int, u_int16_t *); 146static void isp_parse_nvram_1020(struct ispsoftc *, u_int8_t *); 147static void isp_parse_nvram_1080(struct ispsoftc *, int, u_int8_t *); 148static void isp_parse_nvram_12160(struct ispsoftc *, int, u_int8_t *); 149static void isp_parse_nvram_2100(struct ispsoftc *, u_int8_t *); | 146static void isp_rdnvram_word(struct ispsoftc *, int, uint16_t *); 147static void isp_parse_nvram_1020(struct ispsoftc *, uint8_t *); 148static void isp_parse_nvram_1080(struct ispsoftc *, int, uint8_t *); 149static void isp_parse_nvram_12160(struct ispsoftc *, int, uint8_t *); 150static void isp_parse_nvram_2100(struct ispsoftc *, uint8_t *); |
150 151/* 152 * Reset Hardware. 153 * 154 * Hit the chip over the head, download new f/w if available and set it running. 155 * 156 * Locking done elsewhere. 157 */ 158 159void 160isp_reset(struct ispsoftc *isp) 161{ 162 mbreg_t mbs; | 151 152/* 153 * Reset Hardware. 154 * 155 * Hit the chip over the head, download new f/w if available and set it running. 156 * 157 * Locking done elsewhere. 158 */ 159 160void 161isp_reset(struct ispsoftc *isp) 162{ 163 mbreg_t mbs; |
163 u_int16_t code_org; | 164 uint16_t code_org; |
164 int loops, i, dodnld = 1; 165 char *btype = "????"; 166 167 isp->isp_state = ISP_NILSTATE; 168 MEMZERO(&mbs, sizeof (mbs)); 169 170 /* 171 * Basic types (SCSI, FibreChannel and PCI or SBus) --- 105 unchanged lines hidden (view full) --- 277 sdp->isp_ultramode = 1; 278 sdp++; 279 sdp->isp_ultramode = 1; 280 /* 281 * XXX: Should probably do some bus sensing. 282 */ 283 } else if (IS_ULTRA2(isp)) { 284 static const char m[] = "bus %d is in %s Mode"; | 165 int loops, i, dodnld = 1; 166 char *btype = "????"; 167 168 isp->isp_state = ISP_NILSTATE; 169 MEMZERO(&mbs, sizeof (mbs)); 170 171 /* 172 * Basic types (SCSI, FibreChannel and PCI or SBus) --- 105 unchanged lines hidden (view full) --- 278 sdp->isp_ultramode = 1; 279 sdp++; 280 sdp->isp_ultramode = 1; 281 /* 282 * XXX: Should probably do some bus sensing. 283 */ 284 } else if (IS_ULTRA2(isp)) { 285 static const char m[] = "bus %d is in %s Mode"; |
285 u_int16_t l; | 286 uint16_t l; |
286 sdparam *sdp = isp->isp_param; 287 288 isp->isp_clock = 100; 289 290 if (IS_1280(isp)) 291 btype = "1280"; 292 else if (IS_1080(isp)) 293 btype = "1080"; --- 225 unchanged lines hidden (view full) --- 519 ISP_WRITE(isp, BIU_SEMA, 0); 520 521 /* 522 * Establish some initial burst rate stuff. 523 * (only for the 1XX0 boards). This really should 524 * be done later after fetching from NVRAM. 525 */ 526 if (IS_SCSI(isp)) { | 287 sdparam *sdp = isp->isp_param; 288 289 isp->isp_clock = 100; 290 291 if (IS_1280(isp)) 292 btype = "1280"; 293 else if (IS_1080(isp)) 294 btype = "1080"; --- 225 unchanged lines hidden (view full) --- 520 ISP_WRITE(isp, BIU_SEMA, 0); 521 522 /* 523 * Establish some initial burst rate stuff. 524 * (only for the 1XX0 boards). This really should 525 * be done later after fetching from NVRAM. 526 */ 527 if (IS_SCSI(isp)) { |
527 u_int16_t tmp = isp->isp_mdvec->dv_conf1; | 528 uint16_t tmp = isp->isp_mdvec->dv_conf1; |
528 /* 529 * Busted FIFO. Turn off all but burst enables. 530 */ 531 if (isp->isp_type == ISP_HA_SCSI_1040A) { 532 tmp &= BIU_BURST_ENABLE; 533 } 534 ISP_SETBITS(isp, BIU_CONF1, tmp); 535 if (tmp & BIU_BURST_ENABLE) { --- 496 unchanged lines hidden (view full) --- 1032 mbs.param[1] |= FW_FEATURE_RIO_16BIT; 1033#else 1034#ifndef ISP_NO_FASTPOST 1035 if (IS_ULTRA2(isp) || IS_1240(isp)) 1036 mbs.param[1] |= FW_FEATURE_FAST_POST; 1037#endif 1038#endif 1039 if (mbs.param[1] != 0) { | 529 /* 530 * Busted FIFO. Turn off all but burst enables. 531 */ 532 if (isp->isp_type == ISP_HA_SCSI_1040A) { 533 tmp &= BIU_BURST_ENABLE; 534 } 535 ISP_SETBITS(isp, BIU_CONF1, tmp); 536 if (tmp & BIU_BURST_ENABLE) { --- 496 unchanged lines hidden (view full) --- 1033 mbs.param[1] |= FW_FEATURE_RIO_16BIT; 1034#else 1035#ifndef ISP_NO_FASTPOST 1036 if (IS_ULTRA2(isp) || IS_1240(isp)) 1037 mbs.param[1] |= FW_FEATURE_FAST_POST; 1038#endif 1039#endif 1040 if (mbs.param[1] != 0) { |
1040 u_int16_t sfeat = mbs.param[1]; | 1041 uint16_t sfeat = mbs.param[1]; |
1041 isp_mboxcmd(isp, &mbs, MBLOGALL); 1042 if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { 1043 isp_prt(isp, ISP_LOGINFO, 1044 "Enabled FW features (0x%x)", sfeat); 1045 } 1046 } 1047 1048 /* --- 26 unchanged lines hidden (view full) --- 1075 sdp->isp_initiator_id, channel); 1076 1077 1078 /* 1079 * Set current per-target parameters to an initial safe minimum. 1080 */ 1081 for (tgt = 0; tgt < MAX_TARGETS; tgt++) { 1082 int lun; | 1042 isp_mboxcmd(isp, &mbs, MBLOGALL); 1043 if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { 1044 isp_prt(isp, ISP_LOGINFO, 1045 "Enabled FW features (0x%x)", sfeat); 1046 } 1047 } 1048 1049 /* --- 26 unchanged lines hidden (view full) --- 1076 sdp->isp_initiator_id, channel); 1077 1078 1079 /* 1080 * Set current per-target parameters to an initial safe minimum. 1081 */ 1082 for (tgt = 0; tgt < MAX_TARGETS; tgt++) { 1083 int lun; |
1083 u_int16_t sdf; | 1084 uint16_t sdf; |
1084 1085 if (sdp->isp_devparam[tgt].dev_enable == 0) { 1086 continue; 1087 } 1088#ifndef ISP_TARGET_MODE 1089 sdf = sdp->isp_devparam[tgt].goal_flags; 1090 sdf &= DPARM_SAFE_DFLT; 1091 /* --- 82 unchanged lines hidden (view full) --- 1174 */ 1175static void 1176isp_fibre_init(struct ispsoftc *isp) 1177{ 1178 fcparam *fcp; 1179 isp_icb_t local, *icbp = &local; 1180 mbreg_t mbs; 1181 int loopid; | 1085 1086 if (sdp->isp_devparam[tgt].dev_enable == 0) { 1087 continue; 1088 } 1089#ifndef ISP_TARGET_MODE 1090 sdf = sdp->isp_devparam[tgt].goal_flags; 1091 sdf &= DPARM_SAFE_DFLT; 1092 /* --- 82 unchanged lines hidden (view full) --- 1175 */ 1176static void 1177isp_fibre_init(struct ispsoftc *isp) 1178{ 1179 fcparam *fcp; 1180 isp_icb_t local, *icbp = &local; 1181 mbreg_t mbs; 1182 int loopid; |
1182 u_int64_t nwwn, pwwn; | 1183 uint64_t nwwn, pwwn; |
1183 1184 fcp = isp->isp_param; 1185 1186 /* 1187 * Do this *before* initializing the firmware. 1188 */ 1189 isp_mark_getpdb_all(isp); 1190 fcp->isp_fwstate = FW_CONFIG_WAIT; --- 210 unchanged lines hidden (view full) --- 1401 nwwn = ISP_NODEWWN(isp); 1402 pwwn = ISP_PORTWWN(isp); 1403 if (nwwn && pwwn) { 1404 icbp->icb_fwoptions |= ICBOPT_BOTH_WWNS; 1405 MAKE_NODE_NAME_FROM_WWN(icbp->icb_nodename, nwwn); 1406 MAKE_NODE_NAME_FROM_WWN(icbp->icb_portname, pwwn); 1407 isp_prt(isp, ISP_LOGDEBUG1, 1408 "Setting ICB Node 0x%08x%08x Port 0x%08x%08x", | 1184 1185 fcp = isp->isp_param; 1186 1187 /* 1188 * Do this *before* initializing the firmware. 1189 */ 1190 isp_mark_getpdb_all(isp); 1191 fcp->isp_fwstate = FW_CONFIG_WAIT; --- 210 unchanged lines hidden (view full) --- 1402 nwwn = ISP_NODEWWN(isp); 1403 pwwn = ISP_PORTWWN(isp); 1404 if (nwwn && pwwn) { 1405 icbp->icb_fwoptions |= ICBOPT_BOTH_WWNS; 1406 MAKE_NODE_NAME_FROM_WWN(icbp->icb_nodename, nwwn); 1407 MAKE_NODE_NAME_FROM_WWN(icbp->icb_portname, pwwn); 1408 isp_prt(isp, ISP_LOGDEBUG1, 1409 "Setting ICB Node 0x%08x%08x Port 0x%08x%08x", |
1409 ((u_int32_t) (nwwn >> 32)), 1410 ((u_int32_t) (nwwn & 0xffffffff)), 1411 ((u_int32_t) (pwwn >> 32)), 1412 ((u_int32_t) (pwwn & 0xffffffff))); | 1410 ((uint32_t) (nwwn >> 32)), 1411 ((uint32_t) (nwwn & 0xffffffff)), 1412 ((uint32_t) (pwwn >> 32)), 1413 ((uint32_t) (pwwn & 0xffffffff))); |
1413 } else { 1414 isp_prt(isp, ISP_LOGDEBUG1, "Not using any WWNs"); 1415 icbp->icb_fwoptions &= ~(ICBOPT_BOTH_WWNS|ICBOPT_FULL_LOGIN); 1416 } 1417 icbp->icb_rqstqlen = RQUEST_QUEUE_LEN(isp); 1418 if (icbp->icb_rqstqlen < 1) { 1419 isp_prt(isp, ISP_LOGERR, "bad request queue length"); 1420 } --- 122 unchanged lines hidden (view full) --- 1543 isp_get_pdb(isp, (isp_pdb_t *)fcp->isp_scratch, pdbp); 1544 FC_SCRATCH_RELEASE(isp); 1545 return (0); 1546 } 1547 FC_SCRATCH_RELEASE(isp); 1548 return (-1); 1549} 1550 | 1414 } else { 1415 isp_prt(isp, ISP_LOGDEBUG1, "Not using any WWNs"); 1416 icbp->icb_fwoptions &= ~(ICBOPT_BOTH_WWNS|ICBOPT_FULL_LOGIN); 1417 } 1418 icbp->icb_rqstqlen = RQUEST_QUEUE_LEN(isp); 1419 if (icbp->icb_rqstqlen < 1) { 1420 isp_prt(isp, ISP_LOGERR, "bad request queue length"); 1421 } --- 122 unchanged lines hidden (view full) --- 1544 isp_get_pdb(isp, (isp_pdb_t *)fcp->isp_scratch, pdbp); 1545 FC_SCRATCH_RELEASE(isp); 1546 return (0); 1547 } 1548 FC_SCRATCH_RELEASE(isp); 1549 return (-1); 1550} 1551 |
1551static u_int64_t | 1552static uint64_t |
1552isp_get_portname(struct ispsoftc *isp, int loopid, int nodename) 1553{ | 1553isp_get_portname(struct ispsoftc *isp, int loopid, int nodename) 1554{ |
1554 u_int64_t wwn = 0; | 1555 uint64_t wwn = 0; |
1555 mbreg_t mbs; 1556 1557 MEMZERO(&mbs, sizeof (mbs)); 1558 mbs.param[0] = MBOX_GET_PORT_NAME; 1559 if (IS_2KLOGIN(isp)) { 1560 mbs.param[1] = loopid; 1561 if (nodename) 1562 mbs.param[10] = 1; 1563 mbs.obits |= (1 << 10); 1564 } else { 1565 mbs.param[1] = loopid << 8; 1566 if (nodename) 1567 mbs.param[1] |= 1; 1568 } 1569 isp_mboxcmd(isp, &mbs, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR); 1570 if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { 1571 wwn = | 1556 mbreg_t mbs; 1557 1558 MEMZERO(&mbs, sizeof (mbs)); 1559 mbs.param[0] = MBOX_GET_PORT_NAME; 1560 if (IS_2KLOGIN(isp)) { 1561 mbs.param[1] = loopid; 1562 if (nodename) 1563 mbs.param[10] = 1; 1564 mbs.obits |= (1 << 10); 1565 } else { 1566 mbs.param[1] = loopid << 8; 1567 if (nodename) 1568 mbs.param[1] |= 1; 1569 } 1570 isp_mboxcmd(isp, &mbs, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR); 1571 if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { 1572 wwn = |
1572 (((u_int64_t)(mbs.param[2] & 0xff)) << 56) | 1573 (((u_int64_t)(mbs.param[2] >> 8)) << 48) | 1574 (((u_int64_t)(mbs.param[3] & 0xff)) << 40) | 1575 (((u_int64_t)(mbs.param[3] >> 8)) << 32) | 1576 (((u_int64_t)(mbs.param[6] & 0xff)) << 24) | 1577 (((u_int64_t)(mbs.param[6] >> 8)) << 16) | 1578 (((u_int64_t)(mbs.param[7] & 0xff)) << 8) | 1579 (((u_int64_t)(mbs.param[7] >> 8))); | 1573 (((uint64_t)(mbs.param[2] & 0xff)) << 56) | 1574 (((uint64_t)(mbs.param[2] >> 8)) << 48) | 1575 (((uint64_t)(mbs.param[3] & 0xff)) << 40) | 1576 (((uint64_t)(mbs.param[3] >> 8)) << 32) | 1577 (((uint64_t)(mbs.param[6] & 0xff)) << 24) | 1578 (((uint64_t)(mbs.param[6] >> 8)) << 16) | 1579 (((uint64_t)(mbs.param[7] & 0xff)) << 8) | 1580 (((uint64_t)(mbs.param[7] >> 8))); |
1580 } 1581 return (wwn); 1582} 1583 1584/* 1585 * Make sure we have good FC link and know our Loop ID. 1586 */ 1587 --- 4 unchanged lines hidden (view full) --- 1592 "Private Loop", 1593 "FL Port", 1594 "N-Port to N-Port", 1595 "F Port", 1596 "F Port (no FLOGI_ACC response)" 1597 }; 1598 mbreg_t mbs; 1599 int count, check_for_fabric; | 1581 } 1582 return (wwn); 1583} 1584 1585/* 1586 * Make sure we have good FC link and know our Loop ID. 1587 */ 1588 --- 4 unchanged lines hidden (view full) --- 1593 "Private Loop", 1594 "FL Port", 1595 "N-Port to N-Port", 1596 "F Port", 1597 "F Port (no FLOGI_ACC response)" 1598 }; 1599 mbreg_t mbs; 1600 int count, check_for_fabric; |
1600 u_int8_t lwfs; | 1601 uint8_t lwfs; |
1601 fcparam *fcp; 1602 struct lportdb *lp; 1603 isp_pdb_t pdb; 1604 1605 fcp = isp->isp_param; 1606 1607 /* 1608 * XXX: Here is where we would start a 'loop dead' timeout 1609 */ 1610 1611 /* 1612 * Wait up to N microseconds for F/W to go to a ready state. 1613 */ 1614 lwfs = FW_CONFIG_WAIT; 1615 count = 0; 1616 while (count < usdelay) { | 1602 fcparam *fcp; 1603 struct lportdb *lp; 1604 isp_pdb_t pdb; 1605 1606 fcp = isp->isp_param; 1607 1608 /* 1609 * XXX: Here is where we would start a 'loop dead' timeout 1610 */ 1611 1612 /* 1613 * Wait up to N microseconds for F/W to go to a ready state. 1614 */ 1615 lwfs = FW_CONFIG_WAIT; 1616 count = 0; 1617 while (count < usdelay) { |
1617 u_int64_t enano; 1618 u_int32_t wrk; | 1618 uint64_t enano; 1619 uint32_t wrk; |
1619 NANOTIME_T hra, hrb; 1620 1621 GET_NANOTIME(&hra); 1622 isp_fw_state(isp); 1623 if (lwfs != fcp->isp_fwstate) { 1624 isp_prt(isp, ISP_LOGINFO, "Firmware State <%s->%s>", 1625 isp2100_fw_statename((int)lwfs), 1626 isp2100_fw_statename((int)fcp->isp_fwstate)); --- 8 unchanged lines hidden (view full) --- 1635 * Get the elapsed time in nanoseconds. 1636 * Always guaranteed to be non-zero. 1637 */ 1638 enano = NANOTIME_SUB(&hrb, &hra); 1639 1640 isp_prt(isp, ISP_LOGDEBUG1, 1641 "usec%d: 0x%lx->0x%lx enano 0x%x%08x", 1642 count, (long) GET_NANOSEC(&hra), (long) GET_NANOSEC(&hrb), | 1620 NANOTIME_T hra, hrb; 1621 1622 GET_NANOTIME(&hra); 1623 isp_fw_state(isp); 1624 if (lwfs != fcp->isp_fwstate) { 1625 isp_prt(isp, ISP_LOGINFO, "Firmware State <%s->%s>", 1626 isp2100_fw_statename((int)lwfs), 1627 isp2100_fw_statename((int)fcp->isp_fwstate)); --- 8 unchanged lines hidden (view full) --- 1636 * Get the elapsed time in nanoseconds. 1637 * Always guaranteed to be non-zero. 1638 */ 1639 enano = NANOTIME_SUB(&hrb, &hra); 1640 1641 isp_prt(isp, ISP_LOGDEBUG1, 1642 "usec%d: 0x%lx->0x%lx enano 0x%x%08x", 1643 count, (long) GET_NANOSEC(&hra), (long) GET_NANOSEC(&hrb), |
1643 (u_int32_t)(enano >> 32), (u_int32_t)(enano & 0xffffffff)); | 1644 (uint32_t)(enano >> 32), (uint32_t)(enano & 0xffffffff)); |
1644 1645 /* 1646 * If the elapsed time is less than 1 millisecond, 1647 * delay a period of time up to that millisecond of 1648 * waiting. 1649 * 1650 * This peculiar code is an attempt to try and avoid | 1645 1646 /* 1647 * If the elapsed time is less than 1 millisecond, 1648 * delay a period of time up to that millisecond of 1649 * waiting. 1650 * 1651 * This peculiar code is an attempt to try and avoid |
1651 * invoking u_int64_t math support functions for some | 1652 * invoking uint64_t math support functions for some |
1652 * platforms where linkage is a problem. 1653 */ 1654 if (enano < (1000 * 1000)) { 1655 count += 1000; 1656 enano = (1000 * 1000) - enano; | 1653 * platforms where linkage is a problem. 1654 */ 1655 if (enano < (1000 * 1000)) { 1656 count += 1000; 1657 enano = (1000 * 1000) - enano; |
1657 while (enano > (u_int64_t) 4000000000U) { | 1658 while (enano > (uint64_t) 4000000000U) { |
1658 USEC_SLEEP(isp, 4000000); | 1659 USEC_SLEEP(isp, 4000000); |
1659 enano -= (u_int64_t) 4000000000U; | 1660 enano -= (uint64_t) 4000000000U; |
1660 } 1661 wrk = enano; 1662 wrk /= 1000; 1663 USEC_SLEEP(isp, wrk); 1664 } else { | 1661 } 1662 wrk = enano; 1663 wrk /= 1000; 1664 USEC_SLEEP(isp, wrk); 1665 } else { |
1665 while (enano > (u_int64_t) 4000000000U) { | 1666 while (enano > (uint64_t) 4000000000U) { |
1666 count += 4000000; | 1667 count += 4000000; |
1667 enano -= (u_int64_t) 4000000000U; | 1668 enano -= (uint64_t) 4000000000U; |
1668 } 1669 wrk = enano; 1670 count += (wrk / 1000); 1671 } 1672 } 1673 1674 /* 1675 * If we haven't gone to 'ready' state, return. --- 70 unchanged lines hidden (view full) --- 1746 } 1747 fcp->isp_portid = mbs.param[2] | ((int) mbs.param[3] << 16); 1748 1749 /* 1750 * Save the Fabric controller's port database entry. 1751 */ 1752 lp = &fcp->portdb[loopid]; 1753 lp->node_wwn = | 1669 } 1670 wrk = enano; 1671 count += (wrk / 1000); 1672 } 1673 } 1674 1675 /* 1676 * If we haven't gone to 'ready' state, return. --- 70 unchanged lines hidden (view full) --- 1747 } 1748 fcp->isp_portid = mbs.param[2] | ((int) mbs.param[3] << 16); 1749 1750 /* 1751 * Save the Fabric controller's port database entry. 1752 */ 1753 lp = &fcp->portdb[loopid]; 1754 lp->node_wwn = |
1754 (((u_int64_t)pdb.pdb_nodename[0]) << 56) | 1755 (((u_int64_t)pdb.pdb_nodename[1]) << 48) | 1756 (((u_int64_t)pdb.pdb_nodename[2]) << 40) | 1757 (((u_int64_t)pdb.pdb_nodename[3]) << 32) | 1758 (((u_int64_t)pdb.pdb_nodename[4]) << 24) | 1759 (((u_int64_t)pdb.pdb_nodename[5]) << 16) | 1760 (((u_int64_t)pdb.pdb_nodename[6]) << 8) | 1761 (((u_int64_t)pdb.pdb_nodename[7])); | 1755 (((uint64_t)pdb.pdb_nodename[0]) << 56) | 1756 (((uint64_t)pdb.pdb_nodename[1]) << 48) | 1757 (((uint64_t)pdb.pdb_nodename[2]) << 40) | 1758 (((uint64_t)pdb.pdb_nodename[3]) << 32) | 1759 (((uint64_t)pdb.pdb_nodename[4]) << 24) | 1760 (((uint64_t)pdb.pdb_nodename[5]) << 16) | 1761 (((uint64_t)pdb.pdb_nodename[6]) << 8) | 1762 (((uint64_t)pdb.pdb_nodename[7])); |
1762 lp->port_wwn = | 1763 lp->port_wwn = |
1763 (((u_int64_t)pdb.pdb_portname[0]) << 56) | 1764 (((u_int64_t)pdb.pdb_portname[1]) << 48) | 1765 (((u_int64_t)pdb.pdb_portname[2]) << 40) | 1766 (((u_int64_t)pdb.pdb_portname[3]) << 32) | 1767 (((u_int64_t)pdb.pdb_portname[4]) << 24) | 1768 (((u_int64_t)pdb.pdb_portname[5]) << 16) | 1769 (((u_int64_t)pdb.pdb_portname[6]) << 8) | 1770 (((u_int64_t)pdb.pdb_portname[7])); | 1764 (((uint64_t)pdb.pdb_portname[0]) << 56) | 1765 (((uint64_t)pdb.pdb_portname[1]) << 48) | 1766 (((uint64_t)pdb.pdb_portname[2]) << 40) | 1767 (((uint64_t)pdb.pdb_portname[3]) << 32) | 1768 (((uint64_t)pdb.pdb_portname[4]) << 24) | 1769 (((uint64_t)pdb.pdb_portname[5]) << 16) | 1770 (((uint64_t)pdb.pdb_portname[6]) << 8) | 1771 (((uint64_t)pdb.pdb_portname[7])); |
1771 lp->roles = 1772 (pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; 1773 lp->portid = BITS2WORD(pdb.pdb_portid_bits); 1774 lp->loopid = pdb.pdb_loopid; 1775 lp->loggedin = lp->valid = 1; 1776 fcp->isp_onfabric = 1; 1777 (void) isp_async(isp, ISPASYNC_PROMENADE, &loopid); 1778 isp_register_fc4_type(isp); --- 147 unchanged lines hidden (view full) --- 1926 lim = MAX_FC_TARG; 1927 1928 /* 1929 * Now log in any fabric devices that the outer layer has 1930 * left for us to see. This seems the most sane policy 1931 * for the moment. 1932 */ 1933 for (lp = &fcp->portdb[base]; lp < &fcp->portdb[lim]; lp++) { | 1772 lp->roles = 1773 (pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; 1774 lp->portid = BITS2WORD(pdb.pdb_portid_bits); 1775 lp->loopid = pdb.pdb_loopid; 1776 lp->loggedin = lp->valid = 1; 1777 fcp->isp_onfabric = 1; 1778 (void) isp_async(isp, ISPASYNC_PROMENADE, &loopid); 1779 isp_register_fc4_type(isp); --- 147 unchanged lines hidden (view full) --- 1927 lim = MAX_FC_TARG; 1928 1929 /* 1930 * Now log in any fabric devices that the outer layer has 1931 * left for us to see. This seems the most sane policy 1932 * for the moment. 1933 */ 1934 for (lp = &fcp->portdb[base]; lp < &fcp->portdb[lim]; lp++) { |
1934 u_int32_t portid; | 1935 uint32_t portid; |
1935 mbreg_t mbs; 1936 1937 loopid = lp - fcp->portdb; 1938 if (loopid >= FL_PORT_ID && loopid <= FC_SNS_ID) { 1939 continue; 1940 } 1941 1942 /* --- 18 unchanged lines hidden (view full) --- 1961 * Unfortunately, our charming Qlogic f/w has decided to 1962 * return a valid port database entry for a fabric device 1963 * that has, in fact, gone away. And it hangs trying to 1964 * log it out. 1965 */ 1966 if (lp->loggedin && lp->force_logout == 0 && 1967 isp_getpdb(isp, lp->loopid, &pdb) == 0) { 1968 int nrole; | 1936 mbreg_t mbs; 1937 1938 loopid = lp - fcp->portdb; 1939 if (loopid >= FL_PORT_ID && loopid <= FC_SNS_ID) { 1940 continue; 1941 } 1942 1943 /* --- 18 unchanged lines hidden (view full) --- 1962 * Unfortunately, our charming Qlogic f/w has decided to 1963 * return a valid port database entry for a fabric device 1964 * that has, in fact, gone away. And it hangs trying to 1965 * log it out. 1966 */ 1967 if (lp->loggedin && lp->force_logout == 0 && 1968 isp_getpdb(isp, lp->loopid, &pdb) == 0) { 1969 int nrole; |
1969 u_int64_t nwwnn, nwwpn; | 1970 uint64_t nwwnn, nwwpn; |
1970 nwwnn = | 1971 nwwnn = |
1971 (((u_int64_t)pdb.pdb_nodename[0]) << 56) | 1972 (((u_int64_t)pdb.pdb_nodename[1]) << 48) | 1973 (((u_int64_t)pdb.pdb_nodename[2]) << 40) | 1974 (((u_int64_t)pdb.pdb_nodename[3]) << 32) | 1975 (((u_int64_t)pdb.pdb_nodename[4]) << 24) | 1976 (((u_int64_t)pdb.pdb_nodename[5]) << 16) | 1977 (((u_int64_t)pdb.pdb_nodename[6]) << 8) | 1978 (((u_int64_t)pdb.pdb_nodename[7])); | 1972 (((uint64_t)pdb.pdb_nodename[0]) << 56) | 1973 (((uint64_t)pdb.pdb_nodename[1]) << 48) | 1974 (((uint64_t)pdb.pdb_nodename[2]) << 40) | 1975 (((uint64_t)pdb.pdb_nodename[3]) << 32) | 1976 (((uint64_t)pdb.pdb_nodename[4]) << 24) | 1977 (((uint64_t)pdb.pdb_nodename[5]) << 16) | 1978 (((uint64_t)pdb.pdb_nodename[6]) << 8) | 1979 (((uint64_t)pdb.pdb_nodename[7])); |
1979 nwwpn = | 1980 nwwpn = |
1980 (((u_int64_t)pdb.pdb_portname[0]) << 56) | 1981 (((u_int64_t)pdb.pdb_portname[1]) << 48) | 1982 (((u_int64_t)pdb.pdb_portname[2]) << 40) | 1983 (((u_int64_t)pdb.pdb_portname[3]) << 32) | 1984 (((u_int64_t)pdb.pdb_portname[4]) << 24) | 1985 (((u_int64_t)pdb.pdb_portname[5]) << 16) | 1986 (((u_int64_t)pdb.pdb_portname[6]) << 8) | 1987 (((u_int64_t)pdb.pdb_portname[7])); | 1981 (((uint64_t)pdb.pdb_portname[0]) << 56) | 1982 (((uint64_t)pdb.pdb_portname[1]) << 48) | 1983 (((uint64_t)pdb.pdb_portname[2]) << 40) | 1984 (((uint64_t)pdb.pdb_portname[3]) << 32) | 1985 (((uint64_t)pdb.pdb_portname[4]) << 24) | 1986 (((uint64_t)pdb.pdb_portname[5]) << 16) | 1987 (((uint64_t)pdb.pdb_portname[6]) << 8) | 1988 (((uint64_t)pdb.pdb_portname[7])); |
1988 nrole = (pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> 1989 SVC3_ROLE_SHIFT; 1990 if (pdb.pdb_loopid == lp->loopid && lp->portid == | 1989 nrole = (pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> 1990 SVC3_ROLE_SHIFT; 1991 if (pdb.pdb_loopid == lp->loopid && lp->portid == |
1991 (u_int32_t) BITS2WORD(pdb.pdb_portid_bits) && | 1992 (uint32_t) BITS2WORD(pdb.pdb_portid_bits) && |
1992 nwwnn == lp->node_wwn && nwwpn == lp->port_wwn && 1993 lp->roles == nrole && lp->force_logout == 0) { 1994 lp->loggedin = lp->valid = 1; 1995 isp_prt(isp, ISP_LOGCONFIG, lretained, 1996 (int) (lp - fcp->portdb), 1997 (int) lp->loopid, lp->portid); 1998 continue; 1999 } --- 120 unchanged lines hidden (view full) --- 2120 } 2121 2122 if (pdb.pdb_loopid != lp->loopid) { 2123 isp_prt(isp, ISP_LOGWARN, pdbmfail1, 2124 lp->portid, pdb.pdb_loopid); 2125 goto dump_em; 2126 } 2127 | 1993 nwwnn == lp->node_wwn && nwwpn == lp->port_wwn && 1994 lp->roles == nrole && lp->force_logout == 0) { 1995 lp->loggedin = lp->valid = 1; 1996 isp_prt(isp, ISP_LOGCONFIG, lretained, 1997 (int) (lp - fcp->portdb), 1998 (int) lp->loopid, lp->portid); 1999 continue; 2000 } --- 120 unchanged lines hidden (view full) --- 2121 } 2122 2123 if (pdb.pdb_loopid != lp->loopid) { 2124 isp_prt(isp, ISP_LOGWARN, pdbmfail1, 2125 lp->portid, pdb.pdb_loopid); 2126 goto dump_em; 2127 } 2128 |
2128 if (lp->portid != (u_int32_t) BITS2WORD(pdb.pdb_portid_bits)) { | 2129 if (lp->portid != (uint32_t) BITS2WORD(pdb.pdb_portid_bits)) { |
2129 isp_prt(isp, ISP_LOGWARN, pdbmfail2, 2130 lp->portid, BITS2WORD(pdb.pdb_portid_bits)); 2131 goto dump_em; 2132 } 2133 2134 lp->roles = 2135 (pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; 2136 lp->node_wwn = | 2130 isp_prt(isp, ISP_LOGWARN, pdbmfail2, 2131 lp->portid, BITS2WORD(pdb.pdb_portid_bits)); 2132 goto dump_em; 2133 } 2134 2135 lp->roles = 2136 (pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; 2137 lp->node_wwn = |
2137 (((u_int64_t)pdb.pdb_nodename[0]) << 56) | 2138 (((u_int64_t)pdb.pdb_nodename[1]) << 48) | 2139 (((u_int64_t)pdb.pdb_nodename[2]) << 40) | 2140 (((u_int64_t)pdb.pdb_nodename[3]) << 32) | 2141 (((u_int64_t)pdb.pdb_nodename[4]) << 24) | 2142 (((u_int64_t)pdb.pdb_nodename[5]) << 16) | 2143 (((u_int64_t)pdb.pdb_nodename[6]) << 8) | 2144 (((u_int64_t)pdb.pdb_nodename[7])); | 2138 (((uint64_t)pdb.pdb_nodename[0]) << 56) | 2139 (((uint64_t)pdb.pdb_nodename[1]) << 48) | 2140 (((uint64_t)pdb.pdb_nodename[2]) << 40) | 2141 (((uint64_t)pdb.pdb_nodename[3]) << 32) | 2142 (((uint64_t)pdb.pdb_nodename[4]) << 24) | 2143 (((uint64_t)pdb.pdb_nodename[5]) << 16) | 2144 (((uint64_t)pdb.pdb_nodename[6]) << 8) | 2145 (((uint64_t)pdb.pdb_nodename[7])); |
2145 lp->port_wwn = | 2146 lp->port_wwn = |
2146 (((u_int64_t)pdb.pdb_portname[0]) << 56) | 2147 (((u_int64_t)pdb.pdb_portname[1]) << 48) | 2148 (((u_int64_t)pdb.pdb_portname[2]) << 40) | 2149 (((u_int64_t)pdb.pdb_portname[3]) << 32) | 2150 (((u_int64_t)pdb.pdb_portname[4]) << 24) | 2151 (((u_int64_t)pdb.pdb_portname[5]) << 16) | 2152 (((u_int64_t)pdb.pdb_portname[6]) << 8) | 2153 (((u_int64_t)pdb.pdb_portname[7])); | 2147 (((uint64_t)pdb.pdb_portname[0]) << 56) | 2148 (((uint64_t)pdb.pdb_portname[1]) << 48) | 2149 (((uint64_t)pdb.pdb_portname[2]) << 40) | 2150 (((uint64_t)pdb.pdb_portname[3]) << 32) | 2151 (((uint64_t)pdb.pdb_portname[4]) << 24) | 2152 (((uint64_t)pdb.pdb_portname[5]) << 16) | 2153 (((uint64_t)pdb.pdb_portname[6]) << 8) | 2154 (((uint64_t)pdb.pdb_portname[7])); |
2154 /* 2155 * Check to make sure this all makes sense. 2156 */ 2157 if (lp->node_wwn && lp->port_wwn) { 2158 lp->valid = 1; 2159 loopid = lp - fcp->portdb; 2160 (void) isp_async(isp, ISPASYNC_PROMENADE, &loopid); 2161 continue; --- 110 unchanged lines hidden (view full) --- 2272 "giving up on synchronizing the port database"); 2273 return (-1); 2274 } 2275 2276 /* 2277 * Save the pertinent info locally. 2278 */ 2279 lp->node_wwn = | 2155 /* 2156 * Check to make sure this all makes sense. 2157 */ 2158 if (lp->node_wwn && lp->port_wwn) { 2159 lp->valid = 1; 2160 loopid = lp - fcp->portdb; 2161 (void) isp_async(isp, ISPASYNC_PROMENADE, &loopid); 2162 continue; --- 110 unchanged lines hidden (view full) --- 2273 "giving up on synchronizing the port database"); 2274 return (-1); 2275 } 2276 2277 /* 2278 * Save the pertinent info locally. 2279 */ 2280 lp->node_wwn = |
2280 (((u_int64_t)pdb.pdb_nodename[0]) << 56) | 2281 (((u_int64_t)pdb.pdb_nodename[1]) << 48) | 2282 (((u_int64_t)pdb.pdb_nodename[2]) << 40) | 2283 (((u_int64_t)pdb.pdb_nodename[3]) << 32) | 2284 (((u_int64_t)pdb.pdb_nodename[4]) << 24) | 2285 (((u_int64_t)pdb.pdb_nodename[5]) << 16) | 2286 (((u_int64_t)pdb.pdb_nodename[6]) << 8) | 2287 (((u_int64_t)pdb.pdb_nodename[7])); | 2281 (((uint64_t)pdb.pdb_nodename[0]) << 56) | 2282 (((uint64_t)pdb.pdb_nodename[1]) << 48) | 2283 (((uint64_t)pdb.pdb_nodename[2]) << 40) | 2284 (((uint64_t)pdb.pdb_nodename[3]) << 32) | 2285 (((uint64_t)pdb.pdb_nodename[4]) << 24) | 2286 (((uint64_t)pdb.pdb_nodename[5]) << 16) | 2287 (((uint64_t)pdb.pdb_nodename[6]) << 8) | 2288 (((uint64_t)pdb.pdb_nodename[7])); |
2288 lp->port_wwn = | 2289 lp->port_wwn = |
2289 (((u_int64_t)pdb.pdb_portname[0]) << 56) | 2290 (((u_int64_t)pdb.pdb_portname[1]) << 48) | 2291 (((u_int64_t)pdb.pdb_portname[2]) << 40) | 2292 (((u_int64_t)pdb.pdb_portname[3]) << 32) | 2293 (((u_int64_t)pdb.pdb_portname[4]) << 24) | 2294 (((u_int64_t)pdb.pdb_portname[5]) << 16) | 2295 (((u_int64_t)pdb.pdb_portname[6]) << 8) | 2296 (((u_int64_t)pdb.pdb_portname[7])); | 2290 (((uint64_t)pdb.pdb_portname[0]) << 56) | 2291 (((uint64_t)pdb.pdb_portname[1]) << 48) | 2292 (((uint64_t)pdb.pdb_portname[2]) << 40) | 2293 (((uint64_t)pdb.pdb_portname[3]) << 32) | 2294 (((uint64_t)pdb.pdb_portname[4]) << 24) | 2295 (((uint64_t)pdb.pdb_portname[5]) << 16) | 2296 (((uint64_t)pdb.pdb_portname[6]) << 8) | 2297 (((uint64_t)pdb.pdb_portname[7])); |
2297 lp->roles = 2298 (pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; 2299 lp->portid = BITS2WORD(pdb.pdb_portid_bits); 2300 lp->loopid = pdb.pdb_loopid; 2301 } 2302 2303 /* 2304 * Mark all of the permanent local loop database entries as invalid --- 203 unchanged lines hidden (view full) --- 2508 return(0); 2509} 2510 2511#ifdef ISP_USE_GA_NXT 2512static int 2513isp_scan_fabric(struct ispsoftc *isp, int ftype) 2514{ 2515 fcparam *fcp = isp->isp_param; | 2298 lp->roles = 2299 (pdb.pdb_prli_svc3 & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; 2300 lp->portid = BITS2WORD(pdb.pdb_portid_bits); 2301 lp->loopid = pdb.pdb_loopid; 2302 } 2303 2304 /* 2305 * Mark all of the permanent local loop database entries as invalid --- 203 unchanged lines hidden (view full) --- 2509 return(0); 2510} 2511 2512#ifdef ISP_USE_GA_NXT 2513static int 2514isp_scan_fabric(struct ispsoftc *isp, int ftype) 2515{ 2516 fcparam *fcp = isp->isp_param; |
2516 u_int32_t portid, first_portid, last_portid; | 2517 uint32_t portid, first_portid, last_portid; |
2517 int hicap, last_port_same; 2518 2519 if (fcp->isp_onfabric == 0) { 2520 fcp->isp_loopstate = LOOP_FSCAN_DONE; 2521 return (0); 2522 } 2523 2524 FC_SCRATCH_ACQUIRE(isp); --- 7 unchanged lines hidden (view full) --- 2532 first_portid = portid = fcp->isp_portid; 2533 fcp->isp_loopstate = LOOP_SCANNING_FABRIC; 2534 2535 for (hicap = 0; hicap < GA_NXT_MAX; hicap++) { 2536 mbreg_t mbs; 2537 sns_screq_t *rq; 2538 sns_ga_nxt_rsp_t *rs0, *rs1; 2539 struct lportdb lcl; | 2518 int hicap, last_port_same; 2519 2520 if (fcp->isp_onfabric == 0) { 2521 fcp->isp_loopstate = LOOP_FSCAN_DONE; 2522 return (0); 2523 } 2524 2525 FC_SCRATCH_ACQUIRE(isp); --- 7 unchanged lines hidden (view full) --- 2533 first_portid = portid = fcp->isp_portid; 2534 fcp->isp_loopstate = LOOP_SCANNING_FABRIC; 2535 2536 for (hicap = 0; hicap < GA_NXT_MAX; hicap++) { 2537 mbreg_t mbs; 2538 sns_screq_t *rq; 2539 sns_ga_nxt_rsp_t *rs0, *rs1; 2540 struct lportdb lcl; |
2540 u_int8_t sc[SNS_GA_NXT_RESP_SIZE]; | 2541 uint8_t sc[SNS_GA_NXT_RESP_SIZE]; |
2541 2542 rq = (sns_screq_t *)sc; 2543 MEMZERO((void *) rq, SNS_GA_NXT_REQ_SIZE); 2544 rq->snscb_rblen = SNS_GA_NXT_RESP_SIZE >> 1; 2545 rq->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma+0x100); 2546 rq->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma+0x100); 2547 rq->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma+0x100); 2548 rq->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma+0x100); --- 17 unchanged lines hidden (view full) --- 2566 if (fcp->isp_loopstate >= LOOP_SCANNING_FABRIC) { 2567 fcp->isp_loopstate = LOOP_PDB_RCVD; 2568 } 2569 FC_SCRATCH_RELEASE(isp); 2570 return (-1); 2571 } 2572 MEMORYBARRIER(isp, SYNC_SFORCPU, 0x100, SNS_GA_NXT_RESP_SIZE); 2573 rs1 = (sns_ga_nxt_rsp_t *) sc; | 2542 2543 rq = (sns_screq_t *)sc; 2544 MEMZERO((void *) rq, SNS_GA_NXT_REQ_SIZE); 2545 rq->snscb_rblen = SNS_GA_NXT_RESP_SIZE >> 1; 2546 rq->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma+0x100); 2547 rq->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma+0x100); 2548 rq->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma+0x100); 2549 rq->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma+0x100); --- 17 unchanged lines hidden (view full) --- 2567 if (fcp->isp_loopstate >= LOOP_SCANNING_FABRIC) { 2568 fcp->isp_loopstate = LOOP_PDB_RCVD; 2569 } 2570 FC_SCRATCH_RELEASE(isp); 2571 return (-1); 2572 } 2573 MEMORYBARRIER(isp, SYNC_SFORCPU, 0x100, SNS_GA_NXT_RESP_SIZE); 2574 rs1 = (sns_ga_nxt_rsp_t *) sc; |
2574 rs0 = (sns_ga_nxt_rsp_t *) ((u_int8_t *)fcp->isp_scratch+0x100); | 2575 rs0 = (sns_ga_nxt_rsp_t *) ((uint8_t *)fcp->isp_scratch+0x100); |
2575 isp_get_ga_nxt_response(isp, rs0, rs1); 2576 if (rs1->snscb_cthdr.ct_response != FS_ACC) { 2577 int level; 2578 if (rs1->snscb_cthdr.ct_reason == 9 && 2579 rs1->snscb_cthdr.ct_explanation == 7) 2580 level = ISP_LOGDEBUG0; 2581 else 2582 level = ISP_LOGWARN; 2583 isp_prt(isp, level, swrej, "GA_NXT", 2584 rs1->snscb_cthdr.ct_reason, 2585 rs1->snscb_cthdr.ct_explanation, portid); 2586 FC_SCRATCH_RELEASE(isp); 2587 fcp->isp_loopstate = LOOP_FSCAN_DONE; 2588 return (0); 2589 } 2590 portid = | 2576 isp_get_ga_nxt_response(isp, rs0, rs1); 2577 if (rs1->snscb_cthdr.ct_response != FS_ACC) { 2578 int level; 2579 if (rs1->snscb_cthdr.ct_reason == 9 && 2580 rs1->snscb_cthdr.ct_explanation == 7) 2581 level = ISP_LOGDEBUG0; 2582 else 2583 level = ISP_LOGWARN; 2584 isp_prt(isp, level, swrej, "GA_NXT", 2585 rs1->snscb_cthdr.ct_reason, 2586 rs1->snscb_cthdr.ct_explanation, portid); 2587 FC_SCRATCH_RELEASE(isp); 2588 fcp->isp_loopstate = LOOP_FSCAN_DONE; 2589 return (0); 2590 } 2591 portid = |
2591 (((u_int32_t) rs1->snscb_port_id[0]) << 16) | 2592 (((u_int32_t) rs1->snscb_port_id[1]) << 8) | 2593 (((u_int32_t) rs1->snscb_port_id[2])); | 2592 (((uint32_t) rs1->snscb_port_id[0]) << 16) | 2593 (((uint32_t) rs1->snscb_port_id[1]) << 8) | 2594 (((uint32_t) rs1->snscb_port_id[2])); |
2594 2595 /* 2596 * XXX: We should check to make sure that this entry 2597 * XXX: supports the type(s) we are interested in. 2598 */ 2599 /* 2600 * Okay, we now have information about a fabric object. 2601 * If it is the type we're interested in, tell the outer layers 2602 * about it. The outer layer needs to know: Port ID, WWNN, 2603 * WWPN, FC4 type, and port type. 2604 * 2605 * The lportdb structure is adequate for this. 2606 */ 2607 MEMZERO(&lcl, sizeof (lcl)); 2608 lcl.port_type = rs1->snscb_port_type; 2609 lcl.fc4_type = ftype; 2610 lcl.portid = portid; 2611 lcl.node_wwn = | 2595 2596 /* 2597 * XXX: We should check to make sure that this entry 2598 * XXX: supports the type(s) we are interested in. 2599 */ 2600 /* 2601 * Okay, we now have information about a fabric object. 2602 * If it is the type we're interested in, tell the outer layers 2603 * about it. The outer layer needs to know: Port ID, WWNN, 2604 * WWPN, FC4 type, and port type. 2605 * 2606 * The lportdb structure is adequate for this. 2607 */ 2608 MEMZERO(&lcl, sizeof (lcl)); 2609 lcl.port_type = rs1->snscb_port_type; 2610 lcl.fc4_type = ftype; 2611 lcl.portid = portid; 2612 lcl.node_wwn = |
2612 (((u_int64_t)rs1->snscb_nodename[0]) << 56) | 2613 (((u_int64_t)rs1->snscb_nodename[1]) << 48) | 2614 (((u_int64_t)rs1->snscb_nodename[2]) << 40) | 2615 (((u_int64_t)rs1->snscb_nodename[3]) << 32) | 2616 (((u_int64_t)rs1->snscb_nodename[4]) << 24) | 2617 (((u_int64_t)rs1->snscb_nodename[5]) << 16) | 2618 (((u_int64_t)rs1->snscb_nodename[6]) << 8) | 2619 (((u_int64_t)rs1->snscb_nodename[7])); | 2613 (((uint64_t)rs1->snscb_nodename[0]) << 56) | 2614 (((uint64_t)rs1->snscb_nodename[1]) << 48) | 2615 (((uint64_t)rs1->snscb_nodename[2]) << 40) | 2616 (((uint64_t)rs1->snscb_nodename[3]) << 32) | 2617 (((uint64_t)rs1->snscb_nodename[4]) << 24) | 2618 (((uint64_t)rs1->snscb_nodename[5]) << 16) | 2619 (((uint64_t)rs1->snscb_nodename[6]) << 8) | 2620 (((uint64_t)rs1->snscb_nodename[7])); |
2620 lcl.port_wwn = | 2621 lcl.port_wwn = |
2621 (((u_int64_t)rs1->snscb_portname[0]) << 56) | 2622 (((u_int64_t)rs1->snscb_portname[1]) << 48) | 2623 (((u_int64_t)rs1->snscb_portname[2]) << 40) | 2624 (((u_int64_t)rs1->snscb_portname[3]) << 32) | 2625 (((u_int64_t)rs1->snscb_portname[4]) << 24) | 2626 (((u_int64_t)rs1->snscb_portname[5]) << 16) | 2627 (((u_int64_t)rs1->snscb_portname[6]) << 8) | 2628 (((u_int64_t)rs1->snscb_portname[7])); | 2622 (((uint64_t)rs1->snscb_portname[0]) << 56) | 2623 (((uint64_t)rs1->snscb_portname[1]) << 48) | 2624 (((uint64_t)rs1->snscb_portname[2]) << 40) | 2625 (((uint64_t)rs1->snscb_portname[3]) << 32) | 2626 (((uint64_t)rs1->snscb_portname[4]) << 24) | 2627 (((uint64_t)rs1->snscb_portname[5]) << 16) | 2628 (((uint64_t)rs1->snscb_portname[6]) << 8) | 2629 (((uint64_t)rs1->snscb_portname[7])); |
2629 2630 /* 2631 * Does this fabric object support the type we want? 2632 * If not, skip it. 2633 */ 2634 if (rs1->snscb_fc4_types[ftype >> 5] & (1 << (ftype & 0x1f))) { 2635 if (first_portid == portid) { 2636 lcl.last_fabric_dev = 1; --- 85 unchanged lines hidden (view full) --- 2722 return (-1); 2723 } 2724 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2725 FC_SCRATCH_RELEASE(isp); 2726 return (-1); 2727 } 2728 MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN); 2729 rs1 = (sns_gid_ft_rsp_t *) fcp->tport; | 2630 2631 /* 2632 * Does this fabric object support the type we want? 2633 * If not, skip it. 2634 */ 2635 if (rs1->snscb_fc4_types[ftype >> 5] & (1 << (ftype & 0x1f))) { 2636 if (first_portid == portid) { 2637 lcl.last_fabric_dev = 1; --- 85 unchanged lines hidden (view full) --- 2723 return (-1); 2724 } 2725 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2726 FC_SCRATCH_RELEASE(isp); 2727 return (-1); 2728 } 2729 MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN); 2730 rs1 = (sns_gid_ft_rsp_t *) fcp->tport; |
2730 rs0 = (sns_gid_ft_rsp_t *) ((u_int8_t *)fcp->isp_scratch+IGPOFF); | 2731 rs0 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+IGPOFF); |
2731 isp_get_gid_ft_response(isp, rs0, rs1, NGENT); 2732 if (rs1->snscb_cthdr.ct_response != FS_ACC) { 2733 int level; 2734 if (rs1->snscb_cthdr.ct_reason == 9 && 2735 rs1->snscb_cthdr.ct_explanation == 7) 2736 level = ISP_LOGDEBUG0; 2737 else 2738 level = ISP_LOGWARN; --- 21 unchanged lines hidden (view full) --- 2760#if 0 2761 sns_gff_id_rsp_t *fs0, ffsbuf, *fs1 = &ffsbuf; 2762#endif 2763 2764 i++; 2765 MEMZERO(&lcl, sizeof (lcl)); 2766 lcl.fc4_type = ftype; 2767 lcl.portid = | 2732 isp_get_gid_ft_response(isp, rs0, rs1, NGENT); 2733 if (rs1->snscb_cthdr.ct_response != FS_ACC) { 2734 int level; 2735 if (rs1->snscb_cthdr.ct_reason == 9 && 2736 rs1->snscb_cthdr.ct_explanation == 7) 2737 level = ISP_LOGDEBUG0; 2738 else 2739 level = ISP_LOGWARN; --- 21 unchanged lines hidden (view full) --- 2761#if 0 2762 sns_gff_id_rsp_t *fs0, ffsbuf, *fs1 = &ffsbuf; 2763#endif 2764 2765 i++; 2766 MEMZERO(&lcl, sizeof (lcl)); 2767 lcl.fc4_type = ftype; 2768 lcl.portid = |
2768 (((u_int32_t) rs1->snscb_ports[i].portid[0]) << 16) | 2769 (((u_int32_t) rs1->snscb_ports[i].portid[1]) << 8) | 2770 (((u_int32_t) rs1->snscb_ports[i].portid[2])); | 2769 (((uint32_t) rs1->snscb_ports[i].portid[0]) << 16) | 2770 (((uint32_t) rs1->snscb_ports[i].portid[1]) << 8) | 2771 (((uint32_t) rs1->snscb_ports[i].portid[2])); |
2771 2772 MEMZERO((void *) gq, sizeof (sns_gxn_id_req_t)); 2773 gq->snscb_rblen = SNS_GXN_ID_RESP_SIZE >> 1; 2774 gq->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma+GXOFF); 2775 gq->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma+GXOFF); 2776 gq->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma+GXOFF); 2777 gq->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma+GXOFF); 2778 gq->snscb_sblen = 6; --- 19 unchanged lines hidden (view full) --- 2798 FC_SCRATCH_RELEASE(isp); 2799 return (-1); 2800 } 2801 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2802 FC_SCRATCH_RELEASE(isp); 2803 return (-1); 2804 } 2805 MEMORYBARRIER(isp, SYNC_SFORCPU, GXOFF, SNS_GXN_ID_RESP_SIZE); | 2772 2773 MEMZERO((void *) gq, sizeof (sns_gxn_id_req_t)); 2774 gq->snscb_rblen = SNS_GXN_ID_RESP_SIZE >> 1; 2775 gq->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma+GXOFF); 2776 gq->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma+GXOFF); 2777 gq->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma+GXOFF); 2778 gq->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma+GXOFF); 2779 gq->snscb_sblen = 6; --- 19 unchanged lines hidden (view full) --- 2799 FC_SCRATCH_RELEASE(isp); 2800 return (-1); 2801 } 2802 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2803 FC_SCRATCH_RELEASE(isp); 2804 return (-1); 2805 } 2806 MEMORYBARRIER(isp, SYNC_SFORCPU, GXOFF, SNS_GXN_ID_RESP_SIZE); |
2806 gs0 = (sns_gxn_id_rsp_t *) ((u_int8_t *)fcp->isp_scratch+GXOFF); | 2807 gs0 = (sns_gxn_id_rsp_t *) ((uint8_t *)fcp->isp_scratch+GXOFF); |
2807 isp_get_gxn_id_response(isp, gs0, gs1); 2808 if (gs1->snscb_cthdr.ct_response != FS_ACC) { 2809 isp_prt(isp, ISP_LOGWARN, swrej, "GPN_ID", 2810 gs1->snscb_cthdr.ct_reason, 2811 gs1->snscb_cthdr.ct_explanation, lcl.portid); 2812 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2813 FC_SCRATCH_RELEASE(isp); 2814 return (-1); 2815 } 2816 continue; 2817 } 2818 lcl.port_wwn = | 2808 isp_get_gxn_id_response(isp, gs0, gs1); 2809 if (gs1->snscb_cthdr.ct_response != FS_ACC) { 2810 isp_prt(isp, ISP_LOGWARN, swrej, "GPN_ID", 2811 gs1->snscb_cthdr.ct_reason, 2812 gs1->snscb_cthdr.ct_explanation, lcl.portid); 2813 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2814 FC_SCRATCH_RELEASE(isp); 2815 return (-1); 2816 } 2817 continue; 2818 } 2819 lcl.port_wwn = |
2819 (((u_int64_t)gs1->snscb_wwn[0]) << 56) | 2820 (((u_int64_t)gs1->snscb_wwn[1]) << 48) | 2821 (((u_int64_t)gs1->snscb_wwn[2]) << 40) | 2822 (((u_int64_t)gs1->snscb_wwn[3]) << 32) | 2823 (((u_int64_t)gs1->snscb_wwn[4]) << 24) | 2824 (((u_int64_t)gs1->snscb_wwn[5]) << 16) | 2825 (((u_int64_t)gs1->snscb_wwn[6]) << 8) | 2826 (((u_int64_t)gs1->snscb_wwn[7])); | 2820 (((uint64_t)gs1->snscb_wwn[0]) << 56) | 2821 (((uint64_t)gs1->snscb_wwn[1]) << 48) | 2822 (((uint64_t)gs1->snscb_wwn[2]) << 40) | 2823 (((uint64_t)gs1->snscb_wwn[3]) << 32) | 2824 (((uint64_t)gs1->snscb_wwn[4]) << 24) | 2825 (((uint64_t)gs1->snscb_wwn[5]) << 16) | 2826 (((uint64_t)gs1->snscb_wwn[6]) << 8) | 2827 (((uint64_t)gs1->snscb_wwn[7])); |
2827 2828 MEMZERO((void *) gq, sizeof (sns_gxn_id_req_t)); 2829 gq->snscb_rblen = SNS_GXN_ID_RESP_SIZE >> 1; 2830 gq->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma+GXOFF); 2831 gq->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma+GXOFF); 2832 gq->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma+GXOFF); 2833 gq->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma+GXOFF); 2834 gq->snscb_sblen = 6; --- 19 unchanged lines hidden (view full) --- 2854 FC_SCRATCH_RELEASE(isp); 2855 return (-1); 2856 } 2857 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2858 FC_SCRATCH_RELEASE(isp); 2859 return (-1); 2860 } 2861 MEMORYBARRIER(isp, SYNC_SFORCPU, GXOFF, SNS_GXN_ID_RESP_SIZE); | 2828 2829 MEMZERO((void *) gq, sizeof (sns_gxn_id_req_t)); 2830 gq->snscb_rblen = SNS_GXN_ID_RESP_SIZE >> 1; 2831 gq->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma+GXOFF); 2832 gq->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma+GXOFF); 2833 gq->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma+GXOFF); 2834 gq->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma+GXOFF); 2835 gq->snscb_sblen = 6; --- 19 unchanged lines hidden (view full) --- 2855 FC_SCRATCH_RELEASE(isp); 2856 return (-1); 2857 } 2858 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2859 FC_SCRATCH_RELEASE(isp); 2860 return (-1); 2861 } 2862 MEMORYBARRIER(isp, SYNC_SFORCPU, GXOFF, SNS_GXN_ID_RESP_SIZE); |
2862 gs0 = (sns_gxn_id_rsp_t *) ((u_int8_t *)fcp->isp_scratch+GXOFF); | 2863 gs0 = (sns_gxn_id_rsp_t *) ((uint8_t *)fcp->isp_scratch+GXOFF); |
2863 isp_get_gxn_id_response(isp, gs0, gs1); 2864 if (gs1->snscb_cthdr.ct_response != FS_ACC) { 2865 isp_prt(isp, ISP_LOGWARN, swrej, "GNN_ID", 2866 gs1->snscb_cthdr.ct_reason, 2867 gs1->snscb_cthdr.ct_explanation, lcl.portid); 2868 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2869 FC_SCRATCH_RELEASE(isp); 2870 return (-1); 2871 } 2872 continue; 2873 } 2874 lcl.node_wwn = | 2864 isp_get_gxn_id_response(isp, gs0, gs1); 2865 if (gs1->snscb_cthdr.ct_response != FS_ACC) { 2866 isp_prt(isp, ISP_LOGWARN, swrej, "GNN_ID", 2867 gs1->snscb_cthdr.ct_reason, 2868 gs1->snscb_cthdr.ct_explanation, lcl.portid); 2869 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2870 FC_SCRATCH_RELEASE(isp); 2871 return (-1); 2872 } 2873 continue; 2874 } 2875 lcl.node_wwn = |
2875 (((u_int64_t)gs1->snscb_wwn[0]) << 56) | 2876 (((u_int64_t)gs1->snscb_wwn[1]) << 48) | 2877 (((u_int64_t)gs1->snscb_wwn[2]) << 40) | 2878 (((u_int64_t)gs1->snscb_wwn[3]) << 32) | 2879 (((u_int64_t)gs1->snscb_wwn[4]) << 24) | 2880 (((u_int64_t)gs1->snscb_wwn[5]) << 16) | 2881 (((u_int64_t)gs1->snscb_wwn[6]) << 8) | 2882 (((u_int64_t)gs1->snscb_wwn[7])); | 2876 (((uint64_t)gs1->snscb_wwn[0]) << 56) | 2877 (((uint64_t)gs1->snscb_wwn[1]) << 48) | 2878 (((uint64_t)gs1->snscb_wwn[2]) << 40) | 2879 (((uint64_t)gs1->snscb_wwn[3]) << 32) | 2880 (((uint64_t)gs1->snscb_wwn[4]) << 24) | 2881 (((uint64_t)gs1->snscb_wwn[5]) << 16) | 2882 (((uint64_t)gs1->snscb_wwn[6]) << 8) | 2883 (((uint64_t)gs1->snscb_wwn[7])); |
2883 2884 /* 2885 * The QLogic f/w is bouncing this with a parameter error. 2886 */ 2887#if 0 2888 /* 2889 * Try and get FC4 Features (FC-GS-3 only). 2890 * We can use the sns_gxn_id_req_t for this request. --- 27 unchanged lines hidden (view full) --- 2918 FC_SCRATCH_RELEASE(isp); 2919 return (-1); 2920 } 2921 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2922 FC_SCRATCH_RELEASE(isp); 2923 return (-1); 2924 } 2925 MEMORYBARRIER(isp, SYNC_SFORCPU, GXOFF, SNS_GFF_ID_RESP_SIZE); | 2884 2885 /* 2886 * The QLogic f/w is bouncing this with a parameter error. 2887 */ 2888#if 0 2889 /* 2890 * Try and get FC4 Features (FC-GS-3 only). 2891 * We can use the sns_gxn_id_req_t for this request. --- 27 unchanged lines hidden (view full) --- 2919 FC_SCRATCH_RELEASE(isp); 2920 return (-1); 2921 } 2922 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2923 FC_SCRATCH_RELEASE(isp); 2924 return (-1); 2925 } 2926 MEMORYBARRIER(isp, SYNC_SFORCPU, GXOFF, SNS_GFF_ID_RESP_SIZE); |
2926 fs0 = (sns_gff_id_rsp_t *) ((u_int8_t *)fcp->isp_scratch+GXOFF); | 2927 fs0 = (sns_gff_id_rsp_t *) ((uint8_t *)fcp->isp_scratch+GXOFF); |
2927 isp_get_gff_id_response(isp, fs0, fs1); 2928 if (fs1->snscb_cthdr.ct_response != FS_ACC) { 2929 isp_prt(isp, /* ISP_LOGDEBUG0 */ ISP_LOGWARN, 2930 swrej, "GFF_ID", 2931 fs1->snscb_cthdr.ct_reason, 2932 fs1->snscb_cthdr.ct_explanation, lcl.portid); 2933 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2934 FC_SCRATCH_RELEASE(isp); --- 43 unchanged lines hidden (view full) --- 2978 return (0); 2979} 2980#endif 2981 2982static void 2983isp_register_fc4_type(struct ispsoftc *isp) 2984{ 2985 fcparam *fcp = isp->isp_param; | 2928 isp_get_gff_id_response(isp, fs0, fs1); 2929 if (fs1->snscb_cthdr.ct_response != FS_ACC) { 2930 isp_prt(isp, /* ISP_LOGDEBUG0 */ ISP_LOGWARN, 2931 swrej, "GFF_ID", 2932 fs1->snscb_cthdr.ct_reason, 2933 fs1->snscb_cthdr.ct_explanation, lcl.portid); 2934 if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { 2935 FC_SCRATCH_RELEASE(isp); --- 43 unchanged lines hidden (view full) --- 2979 return (0); 2980} 2981#endif 2982 2983static void 2984isp_register_fc4_type(struct ispsoftc *isp) 2985{ 2986 fcparam *fcp = isp->isp_param; |
2986 u_int8_t local[SNS_RFT_ID_REQ_SIZE]; | 2987 uint8_t local[SNS_RFT_ID_REQ_SIZE]; |
2987 sns_screq_t *reqp = (sns_screq_t *) local; 2988 mbreg_t mbs; 2989 2990 MEMZERO((void *) reqp, SNS_RFT_ID_REQ_SIZE); 2991 reqp->snscb_rblen = SNS_RFT_ID_RESP_SIZE >> 1; 2992 reqp->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma + 0x100); 2993 reqp->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma + 0x100); 2994 reqp->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma + 0x100); --- 28 unchanged lines hidden (view full) --- 3023/* 3024 * Start a command. Locking is assumed done in the caller. 3025 */ 3026 3027int 3028isp_start(XS_T *xs) 3029{ 3030 struct ispsoftc *isp; | 2988 sns_screq_t *reqp = (sns_screq_t *) local; 2989 mbreg_t mbs; 2990 2991 MEMZERO((void *) reqp, SNS_RFT_ID_REQ_SIZE); 2992 reqp->snscb_rblen = SNS_RFT_ID_RESP_SIZE >> 1; 2993 reqp->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma + 0x100); 2994 reqp->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma + 0x100); 2995 reqp->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma + 0x100); --- 28 unchanged lines hidden (view full) --- 3024/* 3025 * Start a command. Locking is assumed done in the caller. 3026 */ 3027 3028int 3029isp_start(XS_T *xs) 3030{ 3031 struct ispsoftc *isp; |
3031 u_int16_t nxti, optr, handle; 3032 u_int8_t local[QENTRY_LEN]; | 3032 uint16_t nxti, optr, handle; 3033 uint8_t local[QENTRY_LEN]; |
3033 ispreq_t *reqp, *qep; 3034 int target, i; 3035 3036 XS_INITERR(xs); 3037 isp = XS_ISP(xs); 3038 3039 /* 3040 * Check to make sure we're supporting initiator role. --- 229 unchanged lines hidden (view full) --- 3270 3271 /* 3272 * Now see if we need to synchronize the ISP with respect to anything. 3273 * We do dual duty here (cough) for synchronizing for busses other 3274 * than which we got here to send a command to. 3275 */ 3276 reqp = (ispreq_t *) local; 3277 if (isp->isp_sendmarker) { | 3034 ispreq_t *reqp, *qep; 3035 int target, i; 3036 3037 XS_INITERR(xs); 3038 isp = XS_ISP(xs); 3039 3040 /* 3041 * Check to make sure we're supporting initiator role. --- 229 unchanged lines hidden (view full) --- 3271 3272 /* 3273 * Now see if we need to synchronize the ISP with respect to anything. 3274 * We do dual duty here (cough) for synchronizing for busses other 3275 * than which we got here to send a command to. 3276 */ 3277 reqp = (ispreq_t *) local; 3278 if (isp->isp_sendmarker) { |
3278 u_int8_t n = (IS_DUALBUS(isp)? 2: 1); | 3279 uint8_t n = (IS_DUALBUS(isp)? 2: 1); |
3279 /* 3280 * Check ports to send markers for... 3281 */ 3282 for (i = 0; i < n; i++) { 3283 if ((isp->isp_sendmarker & (1 << i)) == 0) { 3284 continue; 3285 } 3286 MEMZERO((void *) reqp, QENTRY_LEN); --- 113 unchanged lines hidden (view full) --- 3400 */ 3401 3402int 3403isp_control(struct ispsoftc *isp, ispctl_t ctl, void *arg) 3404{ 3405 XS_T *xs; 3406 mbreg_t mbs; 3407 int bus, tgt; | 3280 /* 3281 * Check ports to send markers for... 3282 */ 3283 for (i = 0; i < n; i++) { 3284 if ((isp->isp_sendmarker & (1 << i)) == 0) { 3285 continue; 3286 } 3287 MEMZERO((void *) reqp, QENTRY_LEN); --- 113 unchanged lines hidden (view full) --- 3401 */ 3402 3403int 3404isp_control(struct ispsoftc *isp, ispctl_t ctl, void *arg) 3405{ 3406 XS_T *xs; 3407 mbreg_t mbs; 3408 int bus, tgt; |
3408 u_int16_t handle; | 3409 uint16_t handle; |
3409 3410 MEMZERO(&mbs, sizeof (mbs)); 3411 3412 switch (ctl) { 3413 default: 3414 isp_prt(isp, ISP_LOGERR, "Unknown Control Opcode 0x%x", ctl); 3415 break; 3416 --- 191 unchanged lines hidden (view full) --- 3608 * Limit our stack depth by sticking with the max likely number 3609 * of completions on a request queue at any one time. 3610 */ 3611#ifndef MAX_REQUESTQ_COMPLETIONS 3612#define MAX_REQUESTQ_COMPLETIONS 64 3613#endif 3614 3615void | 3410 3411 MEMZERO(&mbs, sizeof (mbs)); 3412 3413 switch (ctl) { 3414 default: 3415 isp_prt(isp, ISP_LOGERR, "Unknown Control Opcode 0x%x", ctl); 3416 break; 3417 --- 191 unchanged lines hidden (view full) --- 3609 * Limit our stack depth by sticking with the max likely number 3610 * of completions on a request queue at any one time. 3611 */ 3612#ifndef MAX_REQUESTQ_COMPLETIONS 3613#define MAX_REQUESTQ_COMPLETIONS 64 3614#endif 3615 3616void |
3616isp_intr(struct ispsoftc *isp, u_int16_t isr, u_int16_t sema, u_int16_t mbox) | 3617isp_intr(struct ispsoftc *isp, uint16_t isr, uint16_t sema, uint16_t mbox) |
3617{ 3618 XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs; | 3618{ 3619 XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs; |
3619 u_int16_t iptr, optr, junk; | 3620 uint16_t iptr, optr, junk; |
3620 int i, nlooked = 0, ndone = 0; 3621 3622again: 3623 /* 3624 * Is this a mailbox related interrupt? 3625 * The mailbox semaphore will be nonzero if so. 3626 */ 3627 if (sema) { --- 132 unchanged lines hidden (view full) --- 3760 return; 3761 } 3762 isp->isp_rspbsy = 1; 3763 3764 while (optr != iptr) { 3765 ispstatusreq_t local, *sp = &local; 3766 isphdr_t *hp; 3767 int type; | 3621 int i, nlooked = 0, ndone = 0; 3622 3623again: 3624 /* 3625 * Is this a mailbox related interrupt? 3626 * The mailbox semaphore will be nonzero if so. 3627 */ 3628 if (sema) { --- 132 unchanged lines hidden (view full) --- 3761 return; 3762 } 3763 isp->isp_rspbsy = 1; 3764 3765 while (optr != iptr) { 3766 ispstatusreq_t local, *sp = &local; 3767 isphdr_t *hp; 3768 int type; |
3768 u_int16_t oop; | 3769 uint16_t oop; |
3769 int buddaboom = 0; 3770 3771 hp = (isphdr_t *) ISP_QUEUE_ENTRY(isp->isp_result, optr); 3772 oop = optr; 3773 optr = ISP_NXT_QENTRY(optr, RESULT_QUEUE_LEN(isp)); 3774 nlooked++; 3775 read_again: 3776 /* --- 94 unchanged lines hidden (view full) --- 3871 "bad request handle %d (type 0x%x, flags 0x%x)", 3872 sp->req_handle, sp->req_header.rqs_entry_type, 3873 sp->req_header.rqs_flags); 3874 WRITE_RESPONSE_QUEUE_OUT_POINTER(isp, optr); 3875 continue; 3876 } 3877 xs = isp_find_xs(isp, sp->req_handle); 3878 if (xs == NULL) { | 3770 int buddaboom = 0; 3771 3772 hp = (isphdr_t *) ISP_QUEUE_ENTRY(isp->isp_result, optr); 3773 oop = optr; 3774 optr = ISP_NXT_QENTRY(optr, RESULT_QUEUE_LEN(isp)); 3775 nlooked++; 3776 read_again: 3777 /* --- 94 unchanged lines hidden (view full) --- 3872 "bad request handle %d (type 0x%x, flags 0x%x)", 3873 sp->req_handle, sp->req_header.rqs_entry_type, 3874 sp->req_header.rqs_flags); 3875 WRITE_RESPONSE_QUEUE_OUT_POINTER(isp, optr); 3876 continue; 3877 } 3878 xs = isp_find_xs(isp, sp->req_handle); 3879 if (xs == NULL) { |
3879 u_int8_t ts = sp->req_completion_status & 0xff; | 3880 uint8_t ts = sp->req_completion_status & 0xff; |
3880 MEMZERO(hp, QENTRY_LEN); /* PERF */ 3881 /* 3882 * Only whine if this isn't the expected fallout of 3883 * aborting the command. 3884 */ 3885 if (sp->req_header.rqs_entry_type != RQSTYPE_RESPONSE) { 3886 isp_prt(isp, ISP_LOGERR, 3887 "cannot find handle 0x%x (type 0x%x)", --- 165 unchanged lines hidden (view full) --- 4053 } 4054} 4055 4056/* 4057 * Support routines. 4058 */ 4059 4060static int | 3881 MEMZERO(hp, QENTRY_LEN); /* PERF */ 3882 /* 3883 * Only whine if this isn't the expected fallout of 3884 * aborting the command. 3885 */ 3886 if (sp->req_header.rqs_entry_type != RQSTYPE_RESPONSE) { 3887 isp_prt(isp, ISP_LOGERR, 3888 "cannot find handle 0x%x (type 0x%x)", --- 165 unchanged lines hidden (view full) --- 4054 } 4055} 4056 4057/* 4058 * Support routines. 4059 */ 4060 4061static int |
4061isp_parse_async(struct ispsoftc *isp, u_int16_t mbox) | 4062isp_parse_async(struct ispsoftc *isp, uint16_t mbox) |
4062{ 4063 int rval = 0; 4064 int bus; 4065 4066 if (IS_DUALBUS(isp)) { 4067 bus = ISP_READ(isp, OUTMAILBOX6); 4068 } else { 4069 bus = 0; --- 310 unchanged lines hidden (view full) --- 4380 4381 default: 4382 isp_prt(isp, ISP_LOGWARN, "Unknown Async Code 0x%x", mbox); 4383 break; 4384 } 4385 4386 if (bus & 0x100) { 4387 int i, nh; | 4063{ 4064 int rval = 0; 4065 int bus; 4066 4067 if (IS_DUALBUS(isp)) { 4068 bus = ISP_READ(isp, OUTMAILBOX6); 4069 } else { 4070 bus = 0; --- 310 unchanged lines hidden (view full) --- 4381 4382 default: 4383 isp_prt(isp, ISP_LOGWARN, "Unknown Async Code 0x%x", mbox); 4384 break; 4385 } 4386 4387 if (bus & 0x100) { 4388 int i, nh; |
4388 u_int16_t handles[16]; | 4389 uint16_t handles[16]; |
4389 4390 for (nh = 0, i = 1; i < MAX_MAILBOX(isp); i++) { 4391 if ((bus & (1 << i)) == 0) { 4392 continue; 4393 } 4394 handles[nh++] = ISP_READ(isp, MBOX_OFF(i)); 4395 } 4396 for (i = 0; i < nh; i++) { --- 12 unchanged lines hidden (view full) --- 4409/* 4410 * Handle other response entries. A pointer to the request queue output 4411 * index is here in case we want to eat several entries at once, although 4412 * this is not used currently. 4413 */ 4414 4415static int 4416isp_handle_other_response(struct ispsoftc *isp, int type, | 4390 4391 for (nh = 0, i = 1; i < MAX_MAILBOX(isp); i++) { 4392 if ((bus & (1 << i)) == 0) { 4393 continue; 4394 } 4395 handles[nh++] = ISP_READ(isp, MBOX_OFF(i)); 4396 } 4397 for (i = 0; i < nh; i++) { --- 12 unchanged lines hidden (view full) --- 4410/* 4411 * Handle other response entries. A pointer to the request queue output 4412 * index is here in case we want to eat several entries at once, although 4413 * this is not used currently. 4414 */ 4415 4416static int 4417isp_handle_other_response(struct ispsoftc *isp, int type, |
4417 isphdr_t *hp, u_int16_t *optrp) | 4418 isphdr_t *hp, uint16_t *optrp) |
4418{ 4419 switch (type) { 4420 case RQSTYPE_STATUS_CONT: 4421 isp_prt(isp, ISP_LOGINFO, "Ignored Continuation Response"); 4422 return (1); 4423 case RQSTYPE_ATIO: 4424 case RQSTYPE_CTIO: 4425 case RQSTYPE_ENABLE_LUN: --- 416 unchanged lines hidden (view full) --- 4842 break; 4843 } 4844 if (XS_NOERR(xs)) { 4845 XS_SETERR(xs, HBA_BOTCH); 4846 } 4847} 4848 4849static void | 4419{ 4420 switch (type) { 4421 case RQSTYPE_STATUS_CONT: 4422 isp_prt(isp, ISP_LOGINFO, "Ignored Continuation Response"); 4423 return (1); 4424 case RQSTYPE_ATIO: 4425 case RQSTYPE_CTIO: 4426 case RQSTYPE_ENABLE_LUN: --- 416 unchanged lines hidden (view full) --- 4843 break; 4844 } 4845 if (XS_NOERR(xs)) { 4846 XS_SETERR(xs, HBA_BOTCH); 4847 } 4848} 4849 4850static void |
4850isp_fastpost_complete(struct ispsoftc *isp, u_int16_t fph) | 4851isp_fastpost_complete(struct ispsoftc *isp, uint16_t fph) |
4851{ 4852 XS_T *xs; 4853 4854 if (fph == 0) { 4855 return; 4856 } 4857 xs = isp_find_xs(isp, fph); 4858 if (xs == NULL) { --- 19 unchanged lines hidden (view full) --- 4878 isp->isp_fphccmplt++; 4879 isp_done(xs); 4880} 4881 4882static int 4883isp_mbox_continue(struct ispsoftc *isp) 4884{ 4885 mbreg_t mbs; | 4852{ 4853 XS_T *xs; 4854 4855 if (fph == 0) { 4856 return; 4857 } 4858 xs = isp_find_xs(isp, fph); 4859 if (xs == NULL) { --- 19 unchanged lines hidden (view full) --- 4879 isp->isp_fphccmplt++; 4880 isp_done(xs); 4881} 4882 4883static int 4884isp_mbox_continue(struct ispsoftc *isp) 4885{ 4886 mbreg_t mbs; |
4886 u_int16_t *ptr; | 4887 uint16_t *ptr; |
4887 4888 switch (isp->isp_lastmbxcmd) { 4889 case MBOX_WRITE_RAM_WORD: 4890 case MBOX_READ_RAM_WORD: 4891 case MBOX_READ_RAM_WORD_EXTENDED: 4892 break; 4893 default: 4894 return (1); --- 31 unchanged lines hidden (view full) --- 4926 isp_mboxcmd_qnw(isp, &mbs, 0); 4927 return (0); 4928} 4929 4930 4931#define HIWRD(x) ((x) >> 16) 4932#define LOWRD(x) ((x) & 0xffff) 4933#define ISPOPMAP(a, b) (((a) << 16) | (b)) | 4888 4889 switch (isp->isp_lastmbxcmd) { 4890 case MBOX_WRITE_RAM_WORD: 4891 case MBOX_READ_RAM_WORD: 4892 case MBOX_READ_RAM_WORD_EXTENDED: 4893 break; 4894 default: 4895 return (1); --- 31 unchanged lines hidden (view full) --- 4927 isp_mboxcmd_qnw(isp, &mbs, 0); 4928 return (0); 4929} 4930 4931 4932#define HIWRD(x) ((x) >> 16) 4933#define LOWRD(x) ((x) & 0xffff) 4934#define ISPOPMAP(a, b) (((a) << 16) | (b)) |
4934static const u_int32_t mbpscsi[] = { | 4935static const uint32_t mbpscsi[] = { |
4935 ISPOPMAP(0x01, 0x01), /* 0x00: MBOX_NO_OP */ 4936 ISPOPMAP(0x1f, 0x01), /* 0x01: MBOX_LOAD_RAM */ 4937 ISPOPMAP(0x03, 0x01), /* 0x02: MBOX_EXEC_FIRMWARE */ 4938 ISPOPMAP(0x1f, 0x01), /* 0x03: MBOX_DUMP_RAM */ 4939 ISPOPMAP(0x07, 0x07), /* 0x04: MBOX_WRITE_RAM_WORD */ 4940 ISPOPMAP(0x03, 0x07), /* 0x05: MBOX_READ_RAM_WORD */ 4941 ISPOPMAP(0x3f, 0x3f), /* 0x06: MBOX_MAILBOX_REG_TEST */ 4942 ISPOPMAP(0x03, 0x07), /* 0x07: MBOX_VERIFY_CHECKSUM */ --- 179 unchanged lines hidden (view full) --- 5122 NULL, 5123 "SET DATA OVERRUN RECOVERY MODE", 5124 "GET DATA OVERRUN RECOVERY MODE", 5125 "SET HOST DATA", 5126 "GET NOST DATA", 5127}; 5128#endif 5129 | 4936 ISPOPMAP(0x01, 0x01), /* 0x00: MBOX_NO_OP */ 4937 ISPOPMAP(0x1f, 0x01), /* 0x01: MBOX_LOAD_RAM */ 4938 ISPOPMAP(0x03, 0x01), /* 0x02: MBOX_EXEC_FIRMWARE */ 4939 ISPOPMAP(0x1f, 0x01), /* 0x03: MBOX_DUMP_RAM */ 4940 ISPOPMAP(0x07, 0x07), /* 0x04: MBOX_WRITE_RAM_WORD */ 4941 ISPOPMAP(0x03, 0x07), /* 0x05: MBOX_READ_RAM_WORD */ 4942 ISPOPMAP(0x3f, 0x3f), /* 0x06: MBOX_MAILBOX_REG_TEST */ 4943 ISPOPMAP(0x03, 0x07), /* 0x07: MBOX_VERIFY_CHECKSUM */ --- 179 unchanged lines hidden (view full) --- 5123 NULL, 5124 "SET DATA OVERRUN RECOVERY MODE", 5125 "GET DATA OVERRUN RECOVERY MODE", 5126 "SET HOST DATA", 5127 "GET NOST DATA", 5128}; 5129#endif 5130 |
5130static const u_int32_t mbpfc[] = { | 5131static const uint32_t mbpfc[] = { |
5131 ISPOPMAP(0x01, 0x01), /* 0x00: MBOX_NO_OP */ 5132 ISPOPMAP(0x1f, 0x01), /* 0x01: MBOX_LOAD_RAM */ 5133 ISPOPMAP(0x03, 0x01), /* 0x02: MBOX_EXEC_FIRMWARE */ 5134 ISPOPMAP(0xdf, 0x01), /* 0x03: MBOX_DUMP_RAM */ 5135 ISPOPMAP(0x07, 0x07), /* 0x04: MBOX_WRITE_RAM_WORD */ 5136 ISPOPMAP(0x03, 0x07), /* 0x05: MBOX_READ_RAM_WORD */ 5137 ISPOPMAP(0xff, 0xff), /* 0x06: MBOX_MAILBOX_REG_TEST */ 5138 ISPOPMAP(0x03, 0x05), /* 0x07: MBOX_VERIFY_CHECKSUM */ --- 256 unchanged lines hidden (view full) --- 5395 "Lun RESET" 5396}; 5397#endif 5398 5399static void 5400isp_mboxcmd_qnw(struct ispsoftc *isp, mbreg_t *mbp, int nodelay) 5401{ 5402 unsigned int ibits, obits, box, opcode; | 5132 ISPOPMAP(0x01, 0x01), /* 0x00: MBOX_NO_OP */ 5133 ISPOPMAP(0x1f, 0x01), /* 0x01: MBOX_LOAD_RAM */ 5134 ISPOPMAP(0x03, 0x01), /* 0x02: MBOX_EXEC_FIRMWARE */ 5135 ISPOPMAP(0xdf, 0x01), /* 0x03: MBOX_DUMP_RAM */ 5136 ISPOPMAP(0x07, 0x07), /* 0x04: MBOX_WRITE_RAM_WORD */ 5137 ISPOPMAP(0x03, 0x07), /* 0x05: MBOX_READ_RAM_WORD */ 5138 ISPOPMAP(0xff, 0xff), /* 0x06: MBOX_MAILBOX_REG_TEST */ 5139 ISPOPMAP(0x03, 0x05), /* 0x07: MBOX_VERIFY_CHECKSUM */ --- 256 unchanged lines hidden (view full) --- 5396 "Lun RESET" 5397}; 5398#endif 5399 5400static void 5401isp_mboxcmd_qnw(struct ispsoftc *isp, mbreg_t *mbp, int nodelay) 5402{ 5403 unsigned int ibits, obits, box, opcode; |
5403 const u_int32_t *mcp; | 5404 const uint32_t *mcp; |
5404 5405 if (IS_FC(isp)) { 5406 mcp = mbpfc; 5407 } else { 5408 mcp = mbpscsi; 5409 } 5410 opcode = mbp->param[0]; 5411 ibits = HIWRD(mcp[opcode]) & NMBOX_BMASK(isp); --- 24 unchanged lines hidden (view full) --- 5436 } 5437} 5438 5439static void 5440isp_mboxcmd(struct ispsoftc *isp, mbreg_t *mbp, int logmask) 5441{ 5442 char *cname, *xname, tname[16], mname[16]; 5443 unsigned int lim, ibits, obits, box, opcode; | 5405 5406 if (IS_FC(isp)) { 5407 mcp = mbpfc; 5408 } else { 5409 mcp = mbpscsi; 5410 } 5411 opcode = mbp->param[0]; 5412 ibits = HIWRD(mcp[opcode]) & NMBOX_BMASK(isp); --- 24 unchanged lines hidden (view full) --- 5437 } 5438} 5439 5440static void 5441isp_mboxcmd(struct ispsoftc *isp, mbreg_t *mbp, int logmask) 5442{ 5443 char *cname, *xname, tname[16], mname[16]; 5444 unsigned int lim, ibits, obits, box, opcode; |
5444 const u_int32_t *mcp; | 5445 const uint32_t *mcp; |
5445 5446 if (IS_FC(isp)) { 5447 mcp = mbpfc; 5448 lim = (sizeof (mbpfc) / sizeof (mbpfc[0])); 5449 } else { 5450 mcp = mbpscsi; 5451 lim = (sizeof (mbpscsi) / sizeof (mbpscsi[0])); 5452 } --- 174 unchanged lines hidden (view full) --- 5627 */ 5628 return; 5629 } 5630 sdp = isp->isp_param; 5631 sdp += bus; 5632 MEMZERO(&mbs, sizeof (mbs)); 5633 5634 for (tgt = 0; tgt < MAX_TARGETS; tgt++) { | 5446 5447 if (IS_FC(isp)) { 5448 mcp = mbpfc; 5449 lim = (sizeof (mbpfc) / sizeof (mbpfc[0])); 5450 } else { 5451 mcp = mbpscsi; 5452 lim = (sizeof (mbpscsi) / sizeof (mbpscsi[0])); 5453 } --- 174 unchanged lines hidden (view full) --- 5628 */ 5629 return; 5630 } 5631 sdp = isp->isp_param; 5632 sdp += bus; 5633 MEMZERO(&mbs, sizeof (mbs)); 5634 5635 for (tgt = 0; tgt < MAX_TARGETS; tgt++) { |
5635 u_int16_t flags, period, offset; | 5636 uint16_t flags, period, offset; |
5636 int get; 5637 5638 if (sdp->isp_devparam[tgt].dev_enable == 0) { 5639 sdp->isp_devparam[tgt].dev_update = 0; 5640 sdp->isp_devparam[tgt].dev_refresh = 0; 5641 isp_prt(isp, ISP_LOGDEBUG0, 5642 "skipping target %d bus %d update", tgt, bus); 5643 continue; --- 153 unchanged lines hidden (view full) --- 5797 * or the platform code wants to use what had been 5798 * set in the defaults. 5799 */ 5800 if (nvfail) { 5801 isp->isp_confopts |= ISP_CFG_OWNWWPN|ISP_CFG_OWNWWNN; 5802 } 5803 if (isp->isp_confopts & ISP_CFG_OWNWWNN) { 5804 isp_prt(isp, ISP_LOGCONFIG, "Using Node WWN 0x%08x%08x", | 5637 int get; 5638 5639 if (sdp->isp_devparam[tgt].dev_enable == 0) { 5640 sdp->isp_devparam[tgt].dev_update = 0; 5641 sdp->isp_devparam[tgt].dev_refresh = 0; 5642 isp_prt(isp, ISP_LOGDEBUG0, 5643 "skipping target %d bus %d update", tgt, bus); 5644 continue; --- 153 unchanged lines hidden (view full) --- 5798 * or the platform code wants to use what had been 5799 * set in the defaults. 5800 */ 5801 if (nvfail) { 5802 isp->isp_confopts |= ISP_CFG_OWNWWPN|ISP_CFG_OWNWWNN; 5803 } 5804 if (isp->isp_confopts & ISP_CFG_OWNWWNN) { 5805 isp_prt(isp, ISP_LOGCONFIG, "Using Node WWN 0x%08x%08x", |
5805 (u_int32_t) (DEFAULT_NODEWWN(isp) >> 32), 5806 (u_int32_t) (DEFAULT_NODEWWN(isp) & 0xffffffff)); | 5806 (uint32_t) (DEFAULT_NODEWWN(isp) >> 32), 5807 (uint32_t) (DEFAULT_NODEWWN(isp) & 0xffffffff)); |
5807 ISP_NODEWWN(isp) = DEFAULT_NODEWWN(isp); 5808 } else { 5809 /* 5810 * We always start out with values derived 5811 * from NVRAM or our platform default. 5812 */ 5813 ISP_NODEWWN(isp) = fcp->isp_nodewwn; 5814 } 5815 if (isp->isp_confopts & ISP_CFG_OWNWWPN) { 5816 isp_prt(isp, ISP_LOGCONFIG, "Using Port WWN 0x%08x%08x", | 5808 ISP_NODEWWN(isp) = DEFAULT_NODEWWN(isp); 5809 } else { 5810 /* 5811 * We always start out with values derived 5812 * from NVRAM or our platform default. 5813 */ 5814 ISP_NODEWWN(isp) = fcp->isp_nodewwn; 5815 } 5816 if (isp->isp_confopts & ISP_CFG_OWNWWPN) { 5817 isp_prt(isp, ISP_LOGCONFIG, "Using Port WWN 0x%08x%08x", |
5817 (u_int32_t) (DEFAULT_PORTWWN(isp) >> 32), 5818 (u_int32_t) (DEFAULT_PORTWWN(isp) & 0xffffffff)); | 5818 (uint32_t) (DEFAULT_PORTWWN(isp) >> 32), 5819 (uint32_t) (DEFAULT_PORTWWN(isp) & 0xffffffff)); |
5819 ISP_PORTWWN(isp) = DEFAULT_PORTWWN(isp); 5820 } else { 5821 /* 5822 * We always start out with values derived 5823 * from NVRAM or our platform default. 5824 */ 5825 ISP_PORTWWN(isp) = fcp->isp_portwwn; 5826 } --- 80 unchanged lines hidden (view full) --- 5907 5908 /* 5909 * The trick here is to establish a default for the default (honk!) 5910 * state (goal_flags). Then try and get the current status from 5911 * the card to fill in the current state. We don't, in fact, set 5912 * the default to the SAFE default state- that's not the goal state. 5913 */ 5914 for (tgt = 0; tgt < MAX_TARGETS; tgt++) { | 5820 ISP_PORTWWN(isp) = DEFAULT_PORTWWN(isp); 5821 } else { 5822 /* 5823 * We always start out with values derived 5824 * from NVRAM or our platform default. 5825 */ 5826 ISP_PORTWWN(isp) = fcp->isp_portwwn; 5827 } --- 80 unchanged lines hidden (view full) --- 5908 5909 /* 5910 * The trick here is to establish a default for the default (honk!) 5911 * state (goal_flags). Then try and get the current status from 5912 * the card to fill in the current state. We don't, in fact, set 5913 * the default to the SAFE default state- that's not the goal state. 5914 */ 5915 for (tgt = 0; tgt < MAX_TARGETS; tgt++) { |
5915 u_int8_t off, per; | 5916 uint8_t off, per; |
5916 sdp->isp_devparam[tgt].actv_offset = 0; 5917 sdp->isp_devparam[tgt].actv_period = 0; 5918 sdp->isp_devparam[tgt].actv_flags = 0; 5919 5920 sdp->isp_devparam[tgt].goal_flags = 5921 sdp->isp_devparam[tgt].nvrm_flags = DPARM_DEFAULT; 5922 5923 /* --- 61 unchanged lines hidden (view full) --- 5985 if (isp->isp_state != ISP_RUNSTATE) { 5986 isp_prt(isp, ISP_LOGERR, 5987 "isp_reinit cannot restart card"); 5988 } 5989 } 5990 isp->isp_nactive = 0; 5991 5992 for (i = 0; i < isp->isp_maxcmds; i++) { | 5917 sdp->isp_devparam[tgt].actv_offset = 0; 5918 sdp->isp_devparam[tgt].actv_period = 0; 5919 sdp->isp_devparam[tgt].actv_flags = 0; 5920 5921 sdp->isp_devparam[tgt].goal_flags = 5922 sdp->isp_devparam[tgt].nvrm_flags = DPARM_DEFAULT; 5923 5924 /* --- 61 unchanged lines hidden (view full) --- 5986 if (isp->isp_state != ISP_RUNSTATE) { 5987 isp_prt(isp, ISP_LOGERR, 5988 "isp_reinit cannot restart card"); 5989 } 5990 } 5991 isp->isp_nactive = 0; 5992 5993 for (i = 0; i < isp->isp_maxcmds; i++) { |
5993 u_int16_t handle; | 5994 uint16_t handle; |
5994 xs = isp->isp_xflist[i]; 5995 if (xs == NULL) { 5996 continue; 5997 } 5998 handle = isp_index_handle(i); 5999 isp_destroy_handle(isp, handle); 6000 if (XS_XFRLEN(xs)) { 6001 ISP_DMAFREE(isp, xs, handle); --- 8 unchanged lines hidden (view full) --- 6010 6011/* 6012 * NVRAM Routines 6013 */ 6014static int 6015isp_read_nvram(struct ispsoftc *isp) 6016{ 6017 int i, amt; | 5995 xs = isp->isp_xflist[i]; 5996 if (xs == NULL) { 5997 continue; 5998 } 5999 handle = isp_index_handle(i); 6000 isp_destroy_handle(isp, handle); 6001 if (XS_XFRLEN(xs)) { 6002 ISP_DMAFREE(isp, xs, handle); --- 8 unchanged lines hidden (view full) --- 6011 6012/* 6013 * NVRAM Routines 6014 */ 6015static int 6016isp_read_nvram(struct ispsoftc *isp) 6017{ 6018 int i, amt; |
6018 u_int8_t csum, minversion; | 6019 uint8_t csum, minversion; |
6019 union { | 6020 union { |
6020 u_int8_t _x[ISP2100_NVRAM_SIZE]; 6021 u_int16_t _s[ISP2100_NVRAM_SIZE>>1]; | 6021 uint8_t _x[ISP2100_NVRAM_SIZE]; 6022 uint16_t _s[ISP2100_NVRAM_SIZE>>1]; |
6022 } _n; 6023#define nvram_data _n._x 6024#define nvram_words _n._s 6025 6026 if (IS_FC(isp)) { 6027 amt = ISP2100_NVRAM_SIZE; 6028 minversion = 1; 6029 } else if (IS_ULTRA2(isp)) { --- 51 unchanged lines hidden (view full) --- 6081 isp_parse_nvram_2100(isp, nvram_data); 6082 } 6083 return (0); 6084#undef nvram_data 6085#undef nvram_words 6086} 6087 6088static void | 6023 } _n; 6024#define nvram_data _n._x 6025#define nvram_words _n._s 6026 6027 if (IS_FC(isp)) { 6028 amt = ISP2100_NVRAM_SIZE; 6029 minversion = 1; 6030 } else if (IS_ULTRA2(isp)) { --- 51 unchanged lines hidden (view full) --- 6082 isp_parse_nvram_2100(isp, nvram_data); 6083 } 6084 return (0); 6085#undef nvram_data 6086#undef nvram_words 6087} 6088 6089static void |
6089isp_rdnvram_word(struct ispsoftc *isp, int wo, u_int16_t *rp) | 6090isp_rdnvram_word(struct ispsoftc *isp, int wo, uint16_t *rp) |
6090{ 6091 int i, cbits; | 6091{ 6092 int i, cbits; |
6092 u_int16_t bit, rqst; | 6093 uint16_t bit, rqst; |
6093 6094 ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT); 6095 USEC_DELAY(2); 6096 ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT|BIU_NVRAM_CLOCK); 6097 USEC_DELAY(2); 6098 6099 if (IS_FC(isp)) { 6100 wo &= ((ISP2100_NVRAM_SIZE >> 1) - 1); --- 28 unchanged lines hidden (view full) --- 6129 ISP_WRITE(isp, BIU_NVRAM, bit); 6130 USEC_DELAY(2); 6131 } 6132 /* 6133 * Now read the result back in (bits come back in MSB format). 6134 */ 6135 *rp = 0; 6136 for (i = 0; i < 16; i++) { | 6094 6095 ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT); 6096 USEC_DELAY(2); 6097 ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT|BIU_NVRAM_CLOCK); 6098 USEC_DELAY(2); 6099 6100 if (IS_FC(isp)) { 6101 wo &= ((ISP2100_NVRAM_SIZE >> 1) - 1); --- 28 unchanged lines hidden (view full) --- 6130 ISP_WRITE(isp, BIU_NVRAM, bit); 6131 USEC_DELAY(2); 6132 } 6133 /* 6134 * Now read the result back in (bits come back in MSB format). 6135 */ 6136 *rp = 0; 6137 for (i = 0; i < 16; i++) { |
6137 u_int16_t rv; | 6138 uint16_t rv; |
6138 *rp <<= 1; 6139 ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT|BIU_NVRAM_CLOCK); 6140 USEC_DELAY(2); 6141 rv = ISP_READ(isp, BIU_NVRAM); 6142 if (rv & BIU_NVRAM_DATAIN) { 6143 *rp |= 1; 6144 } 6145 USEC_DELAY(2); 6146 ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT); 6147 USEC_DELAY(2); 6148 } 6149 ISP_WRITE(isp, BIU_NVRAM, 0); 6150 USEC_DELAY(2); 6151 ISP_SWIZZLE_NVRAM_WORD(isp, rp); 6152} 6153 6154static void | 6139 *rp <<= 1; 6140 ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT|BIU_NVRAM_CLOCK); 6141 USEC_DELAY(2); 6142 rv = ISP_READ(isp, BIU_NVRAM); 6143 if (rv & BIU_NVRAM_DATAIN) { 6144 *rp |= 1; 6145 } 6146 USEC_DELAY(2); 6147 ISP_WRITE(isp, BIU_NVRAM, BIU_NVRAM_SELECT); 6148 USEC_DELAY(2); 6149 } 6150 ISP_WRITE(isp, BIU_NVRAM, 0); 6151 USEC_DELAY(2); 6152 ISP_SWIZZLE_NVRAM_WORD(isp, rp); 6153} 6154 6155static void |
6155isp_parse_nvram_1020(struct ispsoftc *isp, u_int8_t *nvram_data) | 6156isp_parse_nvram_1020(struct ispsoftc *isp, uint8_t *nvram_data) |
6156{ 6157 sdparam *sdp = (sdparam *) isp->isp_param; 6158 int tgt; 6159 6160 sdp->isp_fifo_threshold = 6161 ISP_NVRAM_FIFO_THRESHOLD(nvram_data) | 6162 (ISP_NVRAM_FIFO_THRESHOLD_128(nvram_data) << 2); 6163 --- 109 unchanged lines hidden (view full) --- 6273 sdp->isp_devparam[tgt].goal_period = 6274 sdp->isp_devparam[tgt].nvrm_period; 6275 sdp->isp_devparam[tgt].goal_flags = 6276 sdp->isp_devparam[tgt].nvrm_flags; 6277 } 6278} 6279 6280static void | 6157{ 6158 sdparam *sdp = (sdparam *) isp->isp_param; 6159 int tgt; 6160 6161 sdp->isp_fifo_threshold = 6162 ISP_NVRAM_FIFO_THRESHOLD(nvram_data) | 6163 (ISP_NVRAM_FIFO_THRESHOLD_128(nvram_data) << 2); 6164 --- 109 unchanged lines hidden (view full) --- 6274 sdp->isp_devparam[tgt].goal_period = 6275 sdp->isp_devparam[tgt].nvrm_period; 6276 sdp->isp_devparam[tgt].goal_flags = 6277 sdp->isp_devparam[tgt].nvrm_flags; 6278 } 6279} 6280 6281static void |
6281isp_parse_nvram_1080(struct ispsoftc *isp, int bus, u_int8_t *nvram_data) | 6282isp_parse_nvram_1080(struct ispsoftc *isp, int bus, uint8_t *nvram_data) |
6282{ 6283 sdparam *sdp = (sdparam *) isp->isp_param; 6284 int tgt; 6285 6286 sdp += bus; 6287 6288 sdp->isp_fifo_threshold = 6289 ISP1080_NVRAM_FIFO_THRESHOLD(nvram_data); --- 75 unchanged lines hidden (view full) --- 6365 sdp->isp_devparam[tgt].goal_period = 6366 sdp->isp_devparam[tgt].nvrm_period; 6367 sdp->isp_devparam[tgt].goal_flags = 6368 sdp->isp_devparam[tgt].nvrm_flags; 6369 } 6370} 6371 6372static void | 6283{ 6284 sdparam *sdp = (sdparam *) isp->isp_param; 6285 int tgt; 6286 6287 sdp += bus; 6288 6289 sdp->isp_fifo_threshold = 6290 ISP1080_NVRAM_FIFO_THRESHOLD(nvram_data); --- 75 unchanged lines hidden (view full) --- 6366 sdp->isp_devparam[tgt].goal_period = 6367 sdp->isp_devparam[tgt].nvrm_period; 6368 sdp->isp_devparam[tgt].goal_flags = 6369 sdp->isp_devparam[tgt].nvrm_flags; 6370 } 6371} 6372 6373static void |
6373isp_parse_nvram_12160(struct ispsoftc *isp, int bus, u_int8_t *nvram_data) | 6374isp_parse_nvram_12160(struct ispsoftc *isp, int bus, uint8_t *nvram_data) |
6374{ 6375 sdparam *sdp = (sdparam *) isp->isp_param; 6376 int tgt; 6377 6378 sdp += bus; 6379 6380 sdp->isp_fifo_threshold = 6381 ISP12160_NVRAM_FIFO_THRESHOLD(nvram_data); --- 74 unchanged lines hidden (view full) --- 6456 sdp->isp_devparam[tgt].goal_period = 6457 sdp->isp_devparam[tgt].nvrm_period; 6458 sdp->isp_devparam[tgt].goal_flags = 6459 sdp->isp_devparam[tgt].nvrm_flags; 6460 } 6461} 6462 6463static void | 6375{ 6376 sdparam *sdp = (sdparam *) isp->isp_param; 6377 int tgt; 6378 6379 sdp += bus; 6380 6381 sdp->isp_fifo_threshold = 6382 ISP12160_NVRAM_FIFO_THRESHOLD(nvram_data); --- 74 unchanged lines hidden (view full) --- 6457 sdp->isp_devparam[tgt].goal_period = 6458 sdp->isp_devparam[tgt].nvrm_period; 6459 sdp->isp_devparam[tgt].goal_flags = 6460 sdp->isp_devparam[tgt].nvrm_flags; 6461 } 6462} 6463 6464static void |
6464isp_parse_nvram_2100(struct ispsoftc *isp, u_int8_t *nvram_data) | 6465isp_parse_nvram_2100(struct ispsoftc *isp, uint8_t *nvram_data) |
6465{ 6466 fcparam *fcp = (fcparam *) isp->isp_param; | 6466{ 6467 fcparam *fcp = (fcparam *) isp->isp_param; |
6467 u_int64_t wwn; | 6468 uint64_t wwn; |
6468 6469 /* 6470 * There is NVRAM storage for both Port and Node entities- 6471 * but the Node entity appears to be unused on all the cards 6472 * I can find. However, we should account for this being set 6473 * at some point in the future. 6474 * 6475 * Qlogic WWNs have an NAA of 2, but usually nothing shows up in 6476 * bits 48..60. In the case of the 2202, it appears that they do 6477 * use bit 48 to distinguish between the two instances on the card. 6478 * The 2204, which I've never seen, *probably* extends this method. 6479 */ 6480 wwn = ISP2100_NVRAM_PORT_NAME(nvram_data); 6481 if (wwn) { 6482 isp_prt(isp, ISP_LOGCONFIG, "NVRAM Port WWN 0x%08x%08x", | 6469 6470 /* 6471 * There is NVRAM storage for both Port and Node entities- 6472 * but the Node entity appears to be unused on all the cards 6473 * I can find. However, we should account for this being set 6474 * at some point in the future. 6475 * 6476 * Qlogic WWNs have an NAA of 2, but usually nothing shows up in 6477 * bits 48..60. In the case of the 2202, it appears that they do 6478 * use bit 48 to distinguish between the two instances on the card. 6479 * The 2204, which I've never seen, *probably* extends this method. 6480 */ 6481 wwn = ISP2100_NVRAM_PORT_NAME(nvram_data); 6482 if (wwn) { 6483 isp_prt(isp, ISP_LOGCONFIG, "NVRAM Port WWN 0x%08x%08x", |
6483 (u_int32_t) (wwn >> 32), (u_int32_t) (wwn & 0xffffffff)); | 6484 (uint32_t) (wwn >> 32), (uint32_t) (wwn & 0xffffffff)); |
6484 if ((wwn >> 60) == 0) { | 6485 if ((wwn >> 60) == 0) { |
6485 wwn |= (((u_int64_t) 2)<< 60); | 6486 wwn |= (((uint64_t) 2)<< 60); |
6486 } 6487 } 6488 fcp->isp_portwwn = wwn; 6489 if (IS_2200(isp) || IS_23XX(isp)) { 6490 wwn = ISP2200_NVRAM_NODE_NAME(nvram_data); 6491 if (wwn) { 6492 isp_prt(isp, ISP_LOGCONFIG, "NVRAM Node WWN 0x%08x%08x", | 6487 } 6488 } 6489 fcp->isp_portwwn = wwn; 6490 if (IS_2200(isp) || IS_23XX(isp)) { 6491 wwn = ISP2200_NVRAM_NODE_NAME(nvram_data); 6492 if (wwn) { 6493 isp_prt(isp, ISP_LOGCONFIG, "NVRAM Node WWN 0x%08x%08x", |
6493 (u_int32_t) (wwn >> 32), 6494 (u_int32_t) (wwn & 0xffffffff)); | 6494 (uint32_t) (wwn >> 32), 6495 (uint32_t) (wwn & 0xffffffff)); |
6495 if ((wwn >> 60) == 0) { | 6496 if ((wwn >> 60) == 0) { |
6496 wwn |= (((u_int64_t) 2)<< 60); | 6497 wwn |= (((uint64_t) 2)<< 60); |
6497 } 6498 } 6499 } else { | 6498 } 6499 } 6500 } else { |
6500 wwn &= ~((u_int64_t) 0xfff << 48); | 6501 wwn &= ~((uint64_t) 0xfff << 48); |
6501 } 6502 fcp->isp_nodewwn = wwn; 6503 6504 /* 6505 * Make sure we have both Node and Port as non-zero values. 6506 */ 6507 if (fcp->isp_nodewwn != 0 && fcp->isp_portwwn == 0) { 6508 fcp->isp_portwwn = fcp->isp_nodewwn; 6509 } else if (fcp->isp_nodewwn == 0 && fcp->isp_portwwn != 0) { 6510 fcp->isp_nodewwn = fcp->isp_portwwn; 6511 } 6512 6513 /* 6514 * Make the Node and Port values sane if they're NAA == 2. 6515 * This means to clear bits 48..56 for the Node WWN and 6516 * make sure that there's some non-zero value in 48..56 6517 * for the Port WWN. 6518 */ 6519 if (fcp->isp_nodewwn && fcp->isp_portwwn) { | 6502 } 6503 fcp->isp_nodewwn = wwn; 6504 6505 /* 6506 * Make sure we have both Node and Port as non-zero values. 6507 */ 6508 if (fcp->isp_nodewwn != 0 && fcp->isp_portwwn == 0) { 6509 fcp->isp_portwwn = fcp->isp_nodewwn; 6510 } else if (fcp->isp_nodewwn == 0 && fcp->isp_portwwn != 0) { 6511 fcp->isp_nodewwn = fcp->isp_portwwn; 6512 } 6513 6514 /* 6515 * Make the Node and Port values sane if they're NAA == 2. 6516 * This means to clear bits 48..56 for the Node WWN and 6517 * make sure that there's some non-zero value in 48..56 6518 * for the Port WWN. 6519 */ 6520 if (fcp->isp_nodewwn && fcp->isp_portwwn) { |
6520 if ((fcp->isp_nodewwn & (((u_int64_t) 0xfff) << 48)) != 0 && | 6521 if ((fcp->isp_nodewwn & (((uint64_t) 0xfff) << 48)) != 0 && |
6521 (fcp->isp_nodewwn >> 60) == 2) { | 6522 (fcp->isp_nodewwn >> 60) == 2) { |
6522 fcp->isp_nodewwn &= ~((u_int64_t) 0xfff << 48); | 6523 fcp->isp_nodewwn &= ~((uint64_t) 0xfff << 48); |
6523 } | 6524 } |
6524 if ((fcp->isp_portwwn & (((u_int64_t) 0xfff) << 48)) == 0 && | 6525 if ((fcp->isp_portwwn & (((uint64_t) 0xfff) << 48)) == 0 && |
6525 (fcp->isp_portwwn >> 60) == 2) { | 6526 (fcp->isp_portwwn >> 60) == 2) { |
6526 fcp->isp_portwwn |= ((u_int64_t) 1 << 56); | 6527 fcp->isp_portwwn |= ((uint64_t) 1 << 56); |
6527 } 6528 } 6529 6530 isp_prt(isp, ISP_LOGDEBUG0, 6531 "NVRAM: maxfrmlen %d execthrottle %d fwoptions 0x%x loopid %x", 6532 ISP2100_NVRAM_MAXFRAMELENGTH(nvram_data), 6533 ISP2100_NVRAM_EXECUTION_THROTTLE(nvram_data), 6534 ISP2100_NVRAM_OPTIONS(nvram_data), --- 21 unchanged lines hidden (view full) --- 6556static void isp2200_fw_dump(struct ispsoftc *); 6557static void isp2300_fw_dump(struct ispsoftc *); 6558 6559static void 6560isp2200_fw_dump(struct ispsoftc *isp) 6561{ 6562 int i, j; 6563 mbreg_t mbs; | 6528 } 6529 } 6530 6531 isp_prt(isp, ISP_LOGDEBUG0, 6532 "NVRAM: maxfrmlen %d execthrottle %d fwoptions 0x%x loopid %x", 6533 ISP2100_NVRAM_MAXFRAMELENGTH(nvram_data), 6534 ISP2100_NVRAM_EXECUTION_THROTTLE(nvram_data), 6535 ISP2100_NVRAM_OPTIONS(nvram_data), --- 21 unchanged lines hidden (view full) --- 6557static void isp2200_fw_dump(struct ispsoftc *); 6558static void isp2300_fw_dump(struct ispsoftc *); 6559 6560static void 6561isp2200_fw_dump(struct ispsoftc *isp) 6562{ 6563 int i, j; 6564 mbreg_t mbs; |
6564 u_int16_t *ptr; | 6565 uint16_t *ptr; |
6565 6566 MEMZERO(&mbs, sizeof (mbs)); 6567 ptr = FCPARAM(isp)->isp_dump_data; 6568 if (ptr == NULL) { 6569 isp_prt(isp, ISP_LOGERR, 6570 "No place to dump RISC registers and SRAM"); 6571 return; 6572 } --- 128 unchanged lines hidden (view full) --- 6701 (void) isp_async(isp, ISPASYNC_FW_DUMPED, 0); 6702} 6703 6704static void 6705isp2300_fw_dump(struct ispsoftc *isp) 6706{ 6707 int i, j; 6708 mbreg_t mbs; | 6566 6567 MEMZERO(&mbs, sizeof (mbs)); 6568 ptr = FCPARAM(isp)->isp_dump_data; 6569 if (ptr == NULL) { 6570 isp_prt(isp, ISP_LOGERR, 6571 "No place to dump RISC registers and SRAM"); 6572 return; 6573 } --- 128 unchanged lines hidden (view full) --- 6702 (void) isp_async(isp, ISPASYNC_FW_DUMPED, 0); 6703} 6704 6705static void 6706isp2300_fw_dump(struct ispsoftc *isp) 6707{ 6708 int i, j; 6709 mbreg_t mbs; |
6709 u_int16_t *ptr; | 6710 uint16_t *ptr; |
6710 6711 MEMZERO(&mbs, sizeof (mbs)); 6712 ptr = FCPARAM(isp)->isp_dump_data; 6713 if (ptr == NULL) { 6714 isp_prt(isp, ISP_LOGERR, 6715 "No place to dump RISC registers and SRAM"); 6716 return; 6717 } --- 159 unchanged lines hidden --- | 6711 6712 MEMZERO(&mbs, sizeof (mbs)); 6713 ptr = FCPARAM(isp)->isp_dump_data; 6714 if (ptr == NULL) { 6715 isp_prt(isp, ISP_LOGERR, 6716 "No place to dump RISC registers and SRAM"); 6717 return; 6718 } --- 159 unchanged lines hidden --- |