2 * Copyright (c) 1997-2009 by Matthew Jacob
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * $FreeBSD: src/sys/dev/isp/isp_library.c,v 1.24 2011/02/14 21:50:51 marius Exp $
30 * Qlogic Host Adapter Internal Library Functions
32 #include <dev/disk/isp/isp_freebsd.h>
34 const char *isp_class3_roles
[4] = {
35 "None", "Target", "Initiator", "Target/Initiator"
39 * Command shipping- finish off first queue entry and do dma mapping and additional segments as needed.
41 * Called with the first queue entry at least partially filled out.
44 isp_send_cmd(ispsoftc_t
*isp
, void *fqe
, void *segp
, uint32_t nsegs
, uint32_t totalcnt
, isp_ddir_t ddir
)
46 uint8_t storage
[QENTRY_LEN
];
48 uint32_t seg
, curseg
, seglim
, nxt
, nxtnxt
, ddf
;
50 ispds64_t
*dsp64
= NULL
;
53 qe0
= isp_getrqentry(isp
);
57 nxt
= ISP_NXT_QENTRY(isp
->isp_reqidx
, RQUEST_QUEUE_LEN(isp
));
59 type
= ((isphdr_t
*)fqe
)->rqs_entry_type
;
63 * If we have no data to transmit, just copy the first IOCB and start it up.
65 if (ddir
== ISP_NOXFR
) {
66 if (type
== RQSTYPE_T2RQS
|| type
== RQSTYPE_T3RQS
) {
75 * First figure out how many pieces of data to transfer and what kind and how many we can put into the first queue entry.
79 ddf
= (ddir
== ISP_TO_DEVICE
)? REQFLAG_DATA_OUT
: REQFLAG_DATA_IN
;
80 dsp
= ((ispreq_t
*)fqe
)->req_dataseg
;
84 ddf
= (ddir
== ISP_TO_DEVICE
)? REQFLAG_DATA_OUT
: REQFLAG_DATA_IN
;
88 ddf
= (ddir
== ISP_TO_DEVICE
)? REQFLAG_DATA_OUT
: REQFLAG_DATA_IN
;
89 dsp
= ((ispreqt2_t
*)fqe
)->req_dataseg
;
90 seglim
= ISP_RQDSEG_T2
;
93 ddf
= (ddir
== ISP_TO_DEVICE
)? REQFLAG_DATA_OUT
: REQFLAG_DATA_IN
;
94 dsp64
= ((ispreqt3_t
*)fqe
)->req_dataseg
;
95 seglim
= ISP_RQDSEG_T3
;
98 ddf
= (ddir
== ISP_TO_DEVICE
)? REQFLAG_DATA_OUT
: REQFLAG_DATA_IN
;
99 dsp64
= ((ispreqt3_t
*)fqe
)->req_dataseg
;
100 seglim
= ISP_RQDSEG_T3
;
103 ddf
= (ddir
== ISP_TO_DEVICE
)? FCP_CMND_DATA_WRITE
: FCP_CMND_DATA_READ
;
104 dsp64
= &((ispreqt7_t
*)fqe
)->req_dataseg
;
108 return (CMD_COMPLETE
);
111 if (seglim
> nsegs
) {
115 for (seg
= curseg
= 0; curseg
< seglim
; curseg
++) {
117 XS_GET_DMA64_SEG(dsp64
++, segp
, seg
++);
119 XS_GET_DMA_SEG(dsp
++, segp
, seg
++);
125 * Second, start building additional continuation segments as needed.
127 while (seg
< nsegs
) {
128 nxtnxt
= ISP_NXT_QENTRY(nxt
, RQUEST_QUEUE_LEN(isp
));
129 if (nxtnxt
== isp
->isp_reqodx
) {
132 ISP_MEMZERO(storage
, QENTRY_LEN
);
133 qe1
= ISP_QUEUE_ENTRY(isp
->isp_rquest
, nxt
);
136 ispcontreq64_t
*crq
= (ispcontreq64_t
*) storage
;
137 seglim
= ISP_CDSEG64
;
138 crq
->req_header
.rqs_entry_type
= RQSTYPE_A64_CONT
;
139 crq
->req_header
.rqs_entry_count
= 1;
140 dsp64
= crq
->req_dataseg
;
142 ispcontreq_t
*crq
= (ispcontreq_t
*) storage
;
144 crq
->req_header
.rqs_entry_type
= RQSTYPE_DATASEG
;
145 crq
->req_header
.rqs_entry_count
= 1;
146 dsp
= crq
->req_dataseg
;
148 if (seg
+ seglim
> nsegs
) {
149 seglim
= nsegs
- seg
;
151 for (curseg
= 0; curseg
< seglim
; curseg
++) {
153 XS_GET_DMA64_SEG(dsp64
++, segp
, seg
++);
155 XS_GET_DMA_SEG(dsp
++, segp
, seg
++);
159 isp_put_cont64_req(isp
, (ispcontreq64_t
*)storage
, qe1
);
161 isp_put_cont_req(isp
, (ispcontreq_t
*)storage
, qe1
);
163 if (isp
->isp_dblev
& ISP_LOGDEBUG1
) {
164 isp_print_bytes(isp
, "additional queue entry", QENTRY_LEN
, storage
);
170 ((isphdr_t
*)fqe
)->rqs_entry_count
= nqe
;
172 case RQSTYPE_REQUEST
:
173 ((ispreq_t
*)fqe
)->req_flags
|= ddf
;
175 * This is historical and not clear whether really needed.
180 ((ispreq_t
*)fqe
)->req_seg_count
= nsegs
;
181 isp_put_request(isp
, fqe
, qe0
);
183 case RQSTYPE_CMDONLY
:
184 ((ispreq_t
*)fqe
)->req_flags
|= ddf
;
186 * This is historical and not clear whether really needed.
191 ((ispextreq_t
*)fqe
)->req_seg_count
= nsegs
;
192 isp_put_extended_request(isp
, fqe
, qe0
);
195 ((ispreqt2_t
*)fqe
)->req_flags
|= ddf
;
196 ((ispreqt2_t
*)fqe
)->req_seg_count
= nsegs
;
197 ((ispreqt2_t
*)fqe
)->req_totalcnt
= totalcnt
;
198 if (ISP_CAP_2KLOGIN(isp
)) {
199 isp_put_request_t2e(isp
, fqe
, qe0
);
201 isp_put_request_t2(isp
, fqe
, qe0
);
206 ((ispreqt3_t
*)fqe
)->req_flags
|= ddf
;
207 ((ispreqt3_t
*)fqe
)->req_seg_count
= nsegs
;
208 ((ispreqt3_t
*)fqe
)->req_totalcnt
= totalcnt
;
209 if (ISP_CAP_2KLOGIN(isp
)) {
210 isp_put_request_t3e(isp
, fqe
, qe0
);
212 isp_put_request_t3(isp
, fqe
, qe0
);
216 ((ispreqt7_t
*)fqe
)->req_alen_datadir
= ddf
;
217 ((ispreqt7_t
*)fqe
)->req_seg_count
= nsegs
;
218 ((ispreqt7_t
*)fqe
)->req_dl
= totalcnt
;
219 isp_put_request_t7(isp
, fqe
, qe0
);
222 return (CMD_COMPLETE
);
224 if (isp
->isp_dblev
& ISP_LOGDEBUG1
) {
225 isp_print_bytes(isp
, "first queue entry", QENTRY_LEN
, fqe
);
227 ISP_ADD_REQUEST(isp
, nxt
);
232 isp_allocate_xs(ispsoftc_t
*isp
, XS_T
*xs
, uint32_t *handlep
)
236 hdp
= isp
->isp_xffree
;
240 isp
->isp_xffree
= hdp
->cmd
;
242 hdp
->handle
= (hdp
- isp
->isp_xflist
);
243 hdp
->handle
|= (ISP_HANDLE_INITIATOR
<< ISP_HANDLE_USAGE_SHIFT
);
244 hdp
->handle
|= (isp
->isp_seqno
++ << ISP_HANDLE_SEQ_SHIFT
);
245 *handlep
= hdp
->handle
;
250 isp_find_xs(ispsoftc_t
*isp
, uint32_t handle
)
252 if (!ISP_VALID_INI_HANDLE(isp
, handle
)) {
253 isp_prt(isp
, ISP_LOGERR
, "%s: bad handle 0x%x", __func__
, handle
);
256 return (isp
->isp_xflist
[(handle
& ISP_HANDLE_CMD_MASK
)].cmd
);
260 isp_find_handle(ispsoftc_t
*isp
, XS_T
*xs
)
262 uint32_t i
, foundhdl
= ISP_HANDLE_FREE
;
265 for (i
= 0; i
< isp
->isp_maxcmds
; i
++) {
266 if (isp
->isp_xflist
[i
].cmd
!= xs
) {
269 foundhdl
= isp
->isp_xflist
[i
].handle
;
277 isp_handle_index(ispsoftc_t
*isp
, uint32_t handle
)
279 if (!ISP_VALID_HANDLE(isp
, handle
)) {
280 isp_prt(isp
, ISP_LOGERR
, "%s: bad handle 0x%x", __func__
, handle
);
281 return (ISP_BAD_HANDLE_INDEX
);
283 return (handle
& ISP_HANDLE_CMD_MASK
);
288 isp_destroy_handle(ispsoftc_t
*isp
, uint32_t handle
)
290 if (!ISP_VALID_INI_HANDLE(isp
, handle
)) {
291 isp_prt(isp
, ISP_LOGERR
, "%s: bad handle 0x%x", __func__
, handle
);
293 isp
->isp_xflist
[(handle
& ISP_HANDLE_CMD_MASK
)].handle
= ISP_HANDLE_FREE
;
294 isp
->isp_xflist
[(handle
& ISP_HANDLE_CMD_MASK
)].cmd
= isp
->isp_xffree
;
295 isp
->isp_xffree
= &isp
->isp_xflist
[(handle
& ISP_HANDLE_CMD_MASK
)];
300 * Make sure we have space to put something on the request queue.
301 * Return a pointer to that entry if we do. A side effect of this
302 * function is to update the output index. The input index
306 isp_getrqentry(ispsoftc_t
*isp
)
308 isp
->isp_reqodx
= ISP_READ(isp
, isp
->isp_rqstoutrp
);
309 if (ISP_NXT_QENTRY(isp
->isp_reqidx
, RQUEST_QUEUE_LEN(isp
)) == isp
->isp_reqodx
) {
312 return (ISP_QUEUE_ENTRY(isp
->isp_rquest
, isp
->isp_reqidx
));
315 #define TBA (4 * (((QENTRY_LEN >> 2) * 3) + 1) + 1)
317 isp_print_qentry(ispsoftc_t
*isp
, const char *msg
, int idx
, void *arg
)
323 isp_prt(isp
, ISP_LOGALL
, "%s index %d=>", msg
, idx
);
324 for (buf
[0] = 0, amt
= i
= 0; i
< 4; i
++) {
326 ISP_SNPRINTF(buf
, TBA
, " ");
327 for (j
= 0; j
< (QENTRY_LEN
>> 2); j
++) {
328 ISP_SNPRINTF(buf
, TBA
, "%s %02x", buf
, ptr
[amt
++] & 0xff);
330 isp_prt(isp
, ISP_LOGALL
, "%s", buf
);
335 isp_print_bytes(ispsoftc_t
*isp
, const char *msg
, int amt
, void *arg
)
342 isp_prt(isp
, ISP_LOGALL
, "%s:", msg
);
348 for (j
= 0; j
< 16; j
++) {
349 ISP_SNPRINTF(buf
, 128, "%s %02x", buf
, ptr
[off
++] & 0xff);
354 isp_prt(isp
, ISP_LOGALL
, "0x%08x:%s", to
, buf
);
360 * Do the common path to try and ensure that link is up, we've scanned
361 * the fabric (if we're on a fabric), and that we've synchronized this
362 * all with our own database and done the appropriate logins.
364 * We repeatedly check for firmware state and loop state after each
365 * action because things may have changed while we were doing this.
366 * Any failure or change of state causes us to return a nonzero value.
368 * We assume we enter here with any locks held.
372 isp_fc_runstate(ispsoftc_t
*isp
, int chan
, int tval
)
376 fcp
= FCPARAM(isp
, chan
);
377 if (fcp
->role
== ISP_ROLE_NONE
) {
380 if (fcp
->isp_fwstate
< FW_READY
|| fcp
->isp_loopstate
< LOOP_PDB_RCVD
) {
381 if (isp_control(isp
, ISPCTL_FCLINK_TEST
, chan
, tval
) != 0) {
382 isp_prt(isp
, ISP_LOGSANCFG
, "isp_fc_runstate: linktest failed for channel %d", chan
);
385 if (fcp
->isp_fwstate
!= FW_READY
|| fcp
->isp_loopstate
< LOOP_PDB_RCVD
) {
386 isp_prt(isp
, ISP_LOGSANCFG
, "isp_fc_runstate: f/w not ready for channel %d", chan
);
391 if ((fcp
->role
& ISP_ROLE_INITIATOR
) == 0) {
395 if (isp_control(isp
, ISPCTL_SCAN_LOOP
, chan
) != 0) {
396 isp_prt(isp
, ISP_LOGSANCFG
, "isp_fc_runstate: scan loop fails on channel %d", chan
);
397 return (LOOP_PDB_RCVD
);
399 if (isp_control(isp
, ISPCTL_SCAN_FABRIC
, chan
) != 0) {
400 isp_prt(isp
, ISP_LOGSANCFG
, "isp_fc_runstate: scan fabric fails on channel %d", chan
);
401 return (LOOP_LSCAN_DONE
);
403 if (isp_control(isp
, ISPCTL_PDB_SYNC
, chan
) != 0) {
404 isp_prt(isp
, ISP_LOGSANCFG
, "isp_fc_runstate: pdb_sync fails on channel %d", chan
);
405 return (LOOP_FSCAN_DONE
);
407 if (fcp
->isp_fwstate
!= FW_READY
|| fcp
->isp_loopstate
!= LOOP_READY
) {
408 isp_prt(isp
, ISP_LOGSANCFG
, "isp_fc_runstate: f/w not ready again on channel %d", chan
);
415 * Fibre Channel Support routines
418 isp_dump_portdb(ispsoftc_t
*isp
, int chan
)
420 fcparam
*fcp
= FCPARAM(isp
, chan
);
423 for (i
= 0; i
< MAX_FC_TARG
; i
++) {
425 const char *dbs
[8] = {
435 const char *roles
[4] = {
436 " UNK", " TGT", " INI", "TINI"
438 fcportdb_t
*lp
= &fcp
->portdb
[i
];
440 if (lp
->state
== FC_PORTDB_STATE_NIL
&& lp
->target_mode
== 0) {
443 if (lp
->dev_map_idx
) {
444 ISP_SNPRINTF(mb
, sizeof (mb
), "%3d", ((int) lp
->dev_map_idx
) - 1);
446 ISP_SNPRINTF(mb
, sizeof (mb
), "---");
448 isp_prt(isp
, ISP_LOGALL
, "Chan %d [%d]: hdl 0x%x %s al%d tgt %s %s 0x%06x =>%s 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x",
449 chan
, i
, lp
->handle
, dbs
[lp
->state
], lp
->autologin
, mb
, roles
[lp
->roles
], lp
->portid
, roles
[lp
->new_roles
], lp
->new_portid
,
450 (uint32_t) (lp
->node_wwn
>> 32), (uint32_t) (lp
->node_wwn
), (uint32_t) (lp
->port_wwn
>> 32), (uint32_t) (lp
->port_wwn
));
455 isp_fc_fw_statename(int state
)
458 case FW_CONFIG_WAIT
: return "Config Wait";
459 case FW_WAIT_AL_PA
: return "Waiting for AL_PA";
460 case FW_WAIT_LOGIN
: return "Wait Login";
461 case FW_READY
: return "Ready";
462 case FW_LOSS_OF_SYNC
: return "Loss Of Sync";
463 case FW_ERROR
: return "Error";
464 case FW_REINIT
: return "Re-Init";
465 case FW_NON_PART
: return "Nonparticipating";
466 default: return "?????";
471 isp_fc_loop_statename(int state
)
474 case LOOP_NIL
: return "NIL";
475 case LOOP_LIP_RCVD
: return "LIP Received";
476 case LOOP_PDB_RCVD
: return "PDB Received";
477 case LOOP_SCANNING_LOOP
: return "Scanning";
478 case LOOP_LSCAN_DONE
: return "Loop Scan Done";
479 case LOOP_SCANNING_FABRIC
: return "Scanning Fabric";
480 case LOOP_FSCAN_DONE
: return "Fabric Scan Done";
481 case LOOP_SYNCING_PDB
: return "Syncing PDB";
482 case LOOP_READY
: return "Ready";
483 default: return "?????";
488 isp_fc_toponame(fcparam
*fcp
)
491 if (fcp
->isp_fwstate
!= FW_READY
) {
492 return "Unavailable";
494 switch (fcp
->isp_topo
) {
495 case TOPO_NL_PORT
: return "Private Loop";
496 case TOPO_FL_PORT
: return "FL Port";
497 case TOPO_N_PORT
: return "N-Port to N-Port";
498 case TOPO_F_PORT
: return "F Port";
499 case TOPO_PTP_STUB
: return "F Port (no FLOGI_ACC response)";
500 default: return "?????";
508 isp_fc_change_role(ispsoftc_t
*isp
, int chan
, int new_role
)
510 fcparam
*fcp
= FCPARAM(isp
, chan
);
512 if (chan
>= isp
->isp_nchan
) {
513 isp_prt(isp
, ISP_LOGWARN
, "%s: bad channel %d", __func__
, chan
);
517 #ifdef ISP_TARGET_MODE
518 isp_del_all_wwn_entries(isp
, chan
);
520 isp_clear_commands(isp
);
523 if (isp
->isp_state
!= ISP_RESETSTATE
) {
524 isp_prt(isp
, ISP_LOGERR
, "%s: cannot reset card", __func__
);
527 fcp
->role
= new_role
;
529 if (isp
->isp_state
!= ISP_INITSTATE
) {
530 isp_prt(isp
, ISP_LOGERR
, "%s: cannot init card", __func__
);
533 isp
->isp_state
= ISP_RUNSTATE
;
535 } else if (ISP_CAP_MULTI_ID(isp
)) {
538 uint8_t qe
[QENTRY_LEN
], *scp
;
540 ISP_MEMZERO(qe
, QENTRY_LEN
);
541 /* Acquire Scratch */
543 if (FC_SCRATCH_ACQUIRE(isp
, chan
)) {
546 scp
= fcp
->isp_scratch
;
549 * Build a VP MODIFY command in memory
551 vp
= (vp_modify_t
*) qe
;
552 vp
->vp_mod_hdr
.rqs_entry_type
= RQSTYPE_VP_MODIFY
;
553 vp
->vp_mod_hdr
.rqs_entry_count
= 1;
555 vp
->vp_mod_idx0
= chan
;
556 vp
->vp_mod_cmd
= VP_MODIFY_ENA
;
557 vp
->vp_mod_ports
[0].options
= ICB2400_VPOPT_ENABLED
;
558 if (new_role
& ISP_ROLE_INITIATOR
) {
559 vp
->vp_mod_ports
[0].options
|= ICB2400_VPOPT_INI_ENABLE
;
561 if ((new_role
& ISP_ROLE_TARGET
) == 0) {
562 vp
->vp_mod_ports
[0].options
|= ICB2400_VPOPT_TGT_DISABLE
;
564 MAKE_NODE_NAME_FROM_WWN(vp
->vp_mod_ports
[0].wwpn
, fcp
->isp_wwpn
);
565 MAKE_NODE_NAME_FROM_WWN(vp
->vp_mod_ports
[0].wwnn
, fcp
->isp_wwnn
);
566 isp_put_vp_modify(isp
, vp
, (vp_modify_t
*) scp
);
569 * Build a EXEC IOCB A64 command that points to the VP MODIFY command
571 MBSINIT(&mbs
, MBOX_EXEC_COMMAND_IOCB_A64
, MBLOGALL
, 0);
572 mbs
.param
[1] = QENTRY_LEN
;
573 mbs
.param
[2] = DMA_WD1(fcp
->isp_scdma
);
574 mbs
.param
[3] = DMA_WD0(fcp
->isp_scdma
);
575 mbs
.param
[6] = DMA_WD3(fcp
->isp_scdma
);
576 mbs
.param
[7] = DMA_WD2(fcp
->isp_scdma
);
577 MEMORYBARRIER(isp
, SYNC_SFORDEV
, 0, 2 * QENTRY_LEN
, chan
);
578 isp_control(isp
, ISPCTL_RUN_MBOXCMD
, &mbs
);
579 if (mbs
.param
[0] != MBOX_COMMAND_COMPLETE
) {
580 FC_SCRATCH_RELEASE(isp
, chan
);
583 MEMORYBARRIER(isp
, SYNC_SFORCPU
, QENTRY_LEN
, QENTRY_LEN
, chan
);
584 isp_get_vp_modify(isp
, (vp_modify_t
*)&scp
[QENTRY_LEN
], vp
);
586 #ifdef ISP_TARGET_MODE
587 isp_del_all_wwn_entries(isp
, chan
);
592 FC_SCRATCH_RELEASE(isp
, chan
);
594 if (vp
->vp_mod_status
!= VP_STS_OK
) {
595 isp_prt(isp
, ISP_LOGERR
, "%s: VP_MODIFY of Chan %d failed with status %d", __func__
, chan
, vp
->vp_mod_status
);
598 fcp
->role
= new_role
;
606 isp_clear_commands(ispsoftc_t
*isp
)
610 #ifdef ISP_TARGET_MODE
614 for (tmp
= 0; isp
->isp_xflist
&& tmp
< isp
->isp_maxcmds
; tmp
++) {
617 hdp
= &isp
->isp_xflist
[tmp
];
618 if (hdp
->handle
== ISP_HANDLE_FREE
) {
623 ISP_DMAFREE(isp
, xs
, hdp
->handle
);
624 XS_SET_RESID(xs
, XS_XFRLEN(xs
));
630 XS_SETERR(xs
, HBA_BUSRESET
);
633 #ifdef ISP_TARGET_MODE
634 for (tmp
= 0; isp
->isp_tgtlist
&& tmp
< isp
->isp_maxcmds
; tmp
++) {
635 uint8_t local
[QENTRY_LEN
];
636 hdp
= &isp
->isp_tgtlist
[tmp
];
637 if (hdp
->handle
== ISP_HANDLE_FREE
) {
640 ISP_DMAFREE(isp
, hdp
->cmd
, hdp
->handle
);
641 ISP_MEMZERO(local
, QENTRY_LEN
);
643 ct7_entry_t
*ctio
= (ct7_entry_t
*) local
;
644 ctio
->ct_syshandle
= hdp
->handle
;
645 ctio
->ct_nphdl
= CT_HBA_RESET
;
646 ctio
->ct_header
.rqs_entry_type
= RQSTYPE_CTIO7
;
647 } else if (IS_FC(isp
)) {
648 ct2_entry_t
*ctio
= (ct2_entry_t
*) local
;
649 ctio
->ct_syshandle
= hdp
->handle
;
650 ctio
->ct_status
= CT_HBA_RESET
;
651 ctio
->ct_header
.rqs_entry_type
= RQSTYPE_CTIO2
;
653 ct_entry_t
*ctio
= (ct_entry_t
*) local
;
654 ctio
->ct_syshandle
= hdp
->handle
;
655 ctio
->ct_status
= CT_HBA_RESET
& 0xff;
656 ctio
->ct_header
.rqs_entry_type
= RQSTYPE_CTIO
;
658 isp_async(isp
, ISPASYNC_TARGET_ACTION
, local
);
660 for (tmp
= 0; tmp
< isp
->isp_nchan
; tmp
++) {
661 ISP_MEMZERO(¬ify
, sizeof (isp_notify_t
));
662 notify
.nt_ncode
= NT_HBA_RESET
;
664 notify
.nt_wwn
= INI_ANY
;
665 notify
.nt_nphdl
= NIL_HANDLE
;
666 notify
.nt_sid
= PORT_ANY
;
667 notify
.nt_did
= PORT_ANY
;
668 notify
.nt_tgt
= TGT_ANY
;
669 notify
.nt_channel
= tmp
;
670 notify
.nt_lun
= LUN_ANY
;
671 notify
.nt_tagval
= TAG_ANY
;
672 isp_async(isp
, ISPASYNC_TARGET_NOTIFY
, ¬ify
);
678 isp_shutdown(ispsoftc_t
*isp
)
682 ISP_WRITE(isp
, BIU2400_ICR
, 0);
683 ISP_WRITE(isp
, BIU2400_HCCR
, HCCR_2400_CMD_PAUSE
);
685 ISP_WRITE(isp
, BIU_ICR
, 0);
686 ISP_WRITE(isp
, HCCR
, HCCR_CMD_PAUSE
);
687 ISP_WRITE(isp
, BIU2100_CSR
, BIU2100_FPM0_REGS
);
688 ISP_WRITE(isp
, FPM_DIAG_CONFIG
, FPM_SOFT_RESET
);
689 ISP_WRITE(isp
, BIU2100_CSR
, BIU2100_FB_REGS
);
690 ISP_WRITE(isp
, FBM_CMD
, FBMCMD_FIFO_RESET_ALL
);
691 ISP_WRITE(isp
, BIU2100_CSR
, BIU2100_RISC_REGS
);
694 ISP_WRITE(isp
, BIU_ICR
, 0);
695 ISP_WRITE(isp
, HCCR
, HCCR_CMD_PAUSE
);
700 * Functions to move stuff to a form that the QLogic RISC engine understands
701 * and functions to move stuff back to a form the processor understands.
703 * Each platform is required to provide the 8, 16 and 32 bit
704 * swizzle and unswizzle macros (ISP_IOX{PUT|GET}_{8,16,32})
706 * The assumption is that swizzling and unswizzling is mostly done 'in place'
707 * (with a few exceptions for efficiency).
710 #define ISP_IS_SBUS(isp) (ISP_SBUS_SUPPORTED && (isp)->isp_bustype == ISP_BT_SBUS)
712 #define ASIZE(x) (sizeof (x) / sizeof (x[0]))
714 * Swizzle/Copy Functions
717 isp_put_hdr(ispsoftc_t
*isp
, isphdr_t
*hpsrc
, isphdr_t
*hpdst
)
719 if (ISP_IS_SBUS(isp
)) {
720 ISP_IOXPUT_8(isp
, hpsrc
->rqs_entry_type
, &hpdst
->rqs_entry_count
);
721 ISP_IOXPUT_8(isp
, hpsrc
->rqs_entry_count
, &hpdst
->rqs_entry_type
);
722 ISP_IOXPUT_8(isp
, hpsrc
->rqs_seqno
, &hpdst
->rqs_flags
);
723 ISP_IOXPUT_8(isp
, hpsrc
->rqs_flags
, &hpdst
->rqs_seqno
);
725 ISP_IOXPUT_8(isp
, hpsrc
->rqs_entry_type
, &hpdst
->rqs_entry_type
);
726 ISP_IOXPUT_8(isp
, hpsrc
->rqs_entry_count
, &hpdst
->rqs_entry_count
);
727 ISP_IOXPUT_8(isp
, hpsrc
->rqs_seqno
, &hpdst
->rqs_seqno
);
728 ISP_IOXPUT_8(isp
, hpsrc
->rqs_flags
, &hpdst
->rqs_flags
);
733 isp_get_hdr(ispsoftc_t
*isp
, isphdr_t
*hpsrc
, isphdr_t
*hpdst
)
735 if (ISP_IS_SBUS(isp
)) {
736 ISP_IOXGET_8(isp
, &hpsrc
->rqs_entry_type
, hpdst
->rqs_entry_count
);
737 ISP_IOXGET_8(isp
, &hpsrc
->rqs_entry_count
, hpdst
->rqs_entry_type
);
738 ISP_IOXGET_8(isp
, &hpsrc
->rqs_seqno
, hpdst
->rqs_flags
);
739 ISP_IOXGET_8(isp
, &hpsrc
->rqs_flags
, hpdst
->rqs_seqno
);
741 ISP_IOXGET_8(isp
, &hpsrc
->rqs_entry_type
, hpdst
->rqs_entry_type
);
742 ISP_IOXGET_8(isp
, &hpsrc
->rqs_entry_count
, hpdst
->rqs_entry_count
);
743 ISP_IOXGET_8(isp
, &hpsrc
->rqs_seqno
, hpdst
->rqs_seqno
);
744 ISP_IOXGET_8(isp
, &hpsrc
->rqs_flags
, hpdst
->rqs_flags
);
749 isp_get_response_type(ispsoftc_t
*isp
, isphdr_t
*hp
)
752 if (ISP_IS_SBUS(isp
)) {
753 ISP_IOXGET_8(isp
, &hp
->rqs_entry_count
, type
);
755 ISP_IOXGET_8(isp
, &hp
->rqs_entry_type
, type
);
761 isp_put_request(ispsoftc_t
*isp
, ispreq_t
*rqsrc
, ispreq_t
*rqdst
)
764 isp_put_hdr(isp
, &rqsrc
->req_header
, &rqdst
->req_header
);
765 ISP_IOXPUT_32(isp
, rqsrc
->req_handle
, &rqdst
->req_handle
);
766 if (ISP_IS_SBUS(isp
)) {
767 ISP_IOXPUT_8(isp
, rqsrc
->req_lun_trn
, &rqdst
->req_target
);
768 ISP_IOXPUT_8(isp
, rqsrc
->req_target
, &rqdst
->req_lun_trn
);
770 ISP_IOXPUT_8(isp
, rqsrc
->req_lun_trn
, &rqdst
->req_lun_trn
);
771 ISP_IOXPUT_8(isp
, rqsrc
->req_target
, &rqdst
->req_target
);
773 ISP_IOXPUT_16(isp
, rqsrc
->req_cdblen
, &rqdst
->req_cdblen
);
774 ISP_IOXPUT_16(isp
, rqsrc
->req_flags
, &rqdst
->req_flags
);
775 ISP_IOXPUT_16(isp
, rqsrc
->req_time
, &rqdst
->req_time
);
776 ISP_IOXPUT_16(isp
, rqsrc
->req_seg_count
, &rqdst
->req_seg_count
);
777 for (i
= 0; i
< ASIZE(rqsrc
->req_cdb
); i
++) {
778 ISP_IOXPUT_8(isp
, rqsrc
->req_cdb
[i
], &rqdst
->req_cdb
[i
]);
780 for (i
= 0; i
< ISP_RQDSEG
; i
++) {
781 ISP_IOXPUT_32(isp
, rqsrc
->req_dataseg
[i
].ds_base
, &rqdst
->req_dataseg
[i
].ds_base
);
782 ISP_IOXPUT_32(isp
, rqsrc
->req_dataseg
[i
].ds_count
, &rqdst
->req_dataseg
[i
].ds_count
);
787 isp_put_marker(ispsoftc_t
*isp
, isp_marker_t
*src
, isp_marker_t
*dst
)
790 isp_put_hdr(isp
, &src
->mrk_header
, &dst
->mrk_header
);
791 ISP_IOXPUT_32(isp
, src
->mrk_handle
, &dst
->mrk_handle
);
792 if (ISP_IS_SBUS(isp
)) {
793 ISP_IOXPUT_8(isp
, src
->mrk_reserved0
, &dst
->mrk_target
);
794 ISP_IOXPUT_8(isp
, src
->mrk_target
, &dst
->mrk_reserved0
);
796 ISP_IOXPUT_8(isp
, src
->mrk_reserved0
, &dst
->mrk_reserved0
);
797 ISP_IOXPUT_8(isp
, src
->mrk_target
, &dst
->mrk_target
);
799 ISP_IOXPUT_16(isp
, src
->mrk_modifier
, &dst
->mrk_modifier
);
800 ISP_IOXPUT_16(isp
, src
->mrk_flags
, &dst
->mrk_flags
);
801 ISP_IOXPUT_16(isp
, src
->mrk_lun
, &dst
->mrk_lun
);
802 for (i
= 0; i
< ASIZE(src
->mrk_reserved1
); i
++) {
803 ISP_IOXPUT_8(isp
, src
->mrk_reserved1
[i
], &dst
->mrk_reserved1
[i
]);
808 isp_put_marker_24xx(ispsoftc_t
*isp
, isp_marker_24xx_t
*src
, isp_marker_24xx_t
*dst
)
811 isp_put_hdr(isp
, &src
->mrk_header
, &dst
->mrk_header
);
812 ISP_IOXPUT_32(isp
, src
->mrk_handle
, &dst
->mrk_handle
);
813 ISP_IOXPUT_16(isp
, src
->mrk_nphdl
, &dst
->mrk_nphdl
);
814 ISP_IOXPUT_8(isp
, src
->mrk_modifier
, &dst
->mrk_modifier
);
815 ISP_IOXPUT_8(isp
, src
->mrk_reserved0
, &dst
->mrk_reserved0
);
816 ISP_IOXPUT_8(isp
, src
->mrk_reserved1
, &dst
->mrk_reserved1
);
817 ISP_IOXPUT_8(isp
, src
->mrk_vphdl
, &dst
->mrk_vphdl
);
818 ISP_IOXPUT_8(isp
, src
->mrk_reserved2
, &dst
->mrk_reserved2
);
819 for (i
= 0; i
< ASIZE(src
->mrk_lun
); i
++) {
820 ISP_IOXPUT_8(isp
, src
->mrk_lun
[i
], &dst
->mrk_lun
[i
]);
822 for (i
= 0; i
< ASIZE(src
->mrk_reserved3
); i
++) {
823 ISP_IOXPUT_8(isp
, src
->mrk_reserved3
[i
], &dst
->mrk_reserved3
[i
]);
828 isp_put_request_t2(ispsoftc_t
*isp
, ispreqt2_t
*src
, ispreqt2_t
*dst
)
831 isp_put_hdr(isp
, &src
->req_header
, &dst
->req_header
);
832 ISP_IOXPUT_32(isp
, src
->req_handle
, &dst
->req_handle
);
833 ISP_IOXPUT_8(isp
, src
->req_lun_trn
, &dst
->req_lun_trn
);
834 ISP_IOXPUT_8(isp
, src
->req_target
, &dst
->req_target
);
835 ISP_IOXPUT_16(isp
, src
->req_scclun
, &dst
->req_scclun
);
836 ISP_IOXPUT_16(isp
, src
->req_flags
, &dst
->req_flags
);
837 ISP_IOXPUT_16(isp
, src
->req_reserved
, &dst
->req_reserved
);
838 ISP_IOXPUT_16(isp
, src
->req_time
, &dst
->req_time
);
839 ISP_IOXPUT_16(isp
, src
->req_seg_count
, &dst
->req_seg_count
);
840 for (i
= 0; i
< ASIZE(src
->req_cdb
); i
++) {
841 ISP_IOXPUT_8(isp
, src
->req_cdb
[i
], &dst
->req_cdb
[i
]);
843 ISP_IOXPUT_32(isp
, src
->req_totalcnt
, &dst
->req_totalcnt
);
844 for (i
= 0; i
< ISP_RQDSEG_T2
; i
++) {
845 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_base
, &dst
->req_dataseg
[i
].ds_base
);
846 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_count
, &dst
->req_dataseg
[i
].ds_count
);
851 isp_put_request_t2e(ispsoftc_t
*isp
, ispreqt2e_t
*src
, ispreqt2e_t
*dst
)
854 isp_put_hdr(isp
, &src
->req_header
, &dst
->req_header
);
855 ISP_IOXPUT_32(isp
, src
->req_handle
, &dst
->req_handle
);
856 ISP_IOXPUT_16(isp
, src
->req_target
, &dst
->req_target
);
857 ISP_IOXPUT_16(isp
, src
->req_scclun
, &dst
->req_scclun
);
858 ISP_IOXPUT_16(isp
, src
->req_flags
, &dst
->req_flags
);
859 ISP_IOXPUT_16(isp
, src
->req_reserved
, &dst
->req_reserved
);
860 ISP_IOXPUT_16(isp
, src
->req_time
, &dst
->req_time
);
861 ISP_IOXPUT_16(isp
, src
->req_seg_count
, &dst
->req_seg_count
);
862 for (i
= 0; i
< ASIZE(src
->req_cdb
); i
++) {
863 ISP_IOXPUT_8(isp
, src
->req_cdb
[i
], &dst
->req_cdb
[i
]);
865 ISP_IOXPUT_32(isp
, src
->req_totalcnt
, &dst
->req_totalcnt
);
866 for (i
= 0; i
< ISP_RQDSEG_T2
; i
++) {
867 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_base
, &dst
->req_dataseg
[i
].ds_base
);
868 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_count
, &dst
->req_dataseg
[i
].ds_count
);
873 isp_put_request_t3(ispsoftc_t
*isp
, ispreqt3_t
*src
, ispreqt3_t
*dst
)
876 isp_put_hdr(isp
, &src
->req_header
, &dst
->req_header
);
877 ISP_IOXPUT_32(isp
, src
->req_handle
, &dst
->req_handle
);
878 ISP_IOXPUT_8(isp
, src
->req_lun_trn
, &dst
->req_lun_trn
);
879 ISP_IOXPUT_8(isp
, src
->req_target
, &dst
->req_target
);
880 ISP_IOXPUT_16(isp
, src
->req_scclun
, &dst
->req_scclun
);
881 ISP_IOXPUT_16(isp
, src
->req_flags
, &dst
->req_flags
);
882 ISP_IOXPUT_16(isp
, src
->req_reserved
, &dst
->req_reserved
);
883 ISP_IOXPUT_16(isp
, src
->req_time
, &dst
->req_time
);
884 ISP_IOXPUT_16(isp
, src
->req_seg_count
, &dst
->req_seg_count
);
885 for (i
= 0; i
< ASIZE(src
->req_cdb
); i
++) {
886 ISP_IOXPUT_8(isp
, src
->req_cdb
[i
], &dst
->req_cdb
[i
]);
888 ISP_IOXPUT_32(isp
, src
->req_totalcnt
, &dst
->req_totalcnt
);
889 for (i
= 0; i
< ISP_RQDSEG_T3
; i
++) {
890 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_base
, &dst
->req_dataseg
[i
].ds_base
);
891 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_basehi
, &dst
->req_dataseg
[i
].ds_basehi
);
892 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_count
, &dst
->req_dataseg
[i
].ds_count
);
897 isp_put_request_t3e(ispsoftc_t
*isp
, ispreqt3e_t
*src
, ispreqt3e_t
*dst
)
900 isp_put_hdr(isp
, &src
->req_header
, &dst
->req_header
);
901 ISP_IOXPUT_32(isp
, src
->req_handle
, &dst
->req_handle
);
902 ISP_IOXPUT_16(isp
, src
->req_target
, &dst
->req_target
);
903 ISP_IOXPUT_16(isp
, src
->req_scclun
, &dst
->req_scclun
);
904 ISP_IOXPUT_16(isp
, src
->req_flags
, &dst
->req_flags
);
905 ISP_IOXPUT_16(isp
, src
->req_reserved
, &dst
->req_reserved
);
906 ISP_IOXPUT_16(isp
, src
->req_time
, &dst
->req_time
);
907 ISP_IOXPUT_16(isp
, src
->req_seg_count
, &dst
->req_seg_count
);
908 for (i
= 0; i
< ASIZE(src
->req_cdb
); i
++) {
909 ISP_IOXPUT_8(isp
, src
->req_cdb
[i
], &dst
->req_cdb
[i
]);
911 ISP_IOXPUT_32(isp
, src
->req_totalcnt
, &dst
->req_totalcnt
);
912 for (i
= 0; i
< ISP_RQDSEG_T3
; i
++) {
913 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_base
, &dst
->req_dataseg
[i
].ds_base
);
914 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_basehi
, &dst
->req_dataseg
[i
].ds_basehi
);
915 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_count
, &dst
->req_dataseg
[i
].ds_count
);
920 isp_put_extended_request(ispsoftc_t
*isp
, ispextreq_t
*src
, ispextreq_t
*dst
)
923 isp_put_hdr(isp
, &src
->req_header
, &dst
->req_header
);
924 ISP_IOXPUT_32(isp
, src
->req_handle
, &dst
->req_handle
);
925 if (ISP_IS_SBUS(isp
)) {
926 ISP_IOXPUT_8(isp
, src
->req_lun_trn
, &dst
->req_target
);
927 ISP_IOXPUT_8(isp
, src
->req_target
, &dst
->req_lun_trn
);
929 ISP_IOXPUT_8(isp
, src
->req_lun_trn
, &dst
->req_lun_trn
);
930 ISP_IOXPUT_8(isp
, src
->req_target
, &dst
->req_target
);
932 ISP_IOXPUT_16(isp
, src
->req_cdblen
, &dst
->req_cdblen
);
933 ISP_IOXPUT_16(isp
, src
->req_flags
, &dst
->req_flags
);
934 ISP_IOXPUT_16(isp
, src
->req_time
, &dst
->req_time
);
935 ISP_IOXPUT_16(isp
, src
->req_seg_count
, &dst
->req_seg_count
);
936 for (i
= 0; i
< ASIZE(src
->req_cdb
); i
++) {
937 ISP_IOXPUT_8(isp
, src
->req_cdb
[i
], &dst
->req_cdb
[i
]);
942 isp_put_request_t7(ispsoftc_t
*isp
, ispreqt7_t
*src
, ispreqt7_t
*dst
)
947 isp_put_hdr(isp
, &src
->req_header
, &dst
->req_header
);
948 ISP_IOXPUT_32(isp
, src
->req_handle
, &dst
->req_handle
);
949 ISP_IOXPUT_16(isp
, src
->req_nphdl
, &dst
->req_nphdl
);
950 ISP_IOXPUT_16(isp
, src
->req_time
, &dst
->req_time
);
951 ISP_IOXPUT_16(isp
, src
->req_seg_count
, &dst
->req_seg_count
);
952 ISP_IOXPUT_16(isp
, src
->req_reserved
, &dst
->req_reserved
);
953 a
= (uint32_t *) src
->req_lun
;
954 b
= (uint32_t *) dst
->req_lun
;
955 for (i
= 0; i
< (ASIZE(src
->req_lun
) >> 2); i
++ ) {
956 *b
++ = ISP_SWAP32(isp
, *a
++);
958 ISP_IOXPUT_8(isp
, src
->req_alen_datadir
, &dst
->req_alen_datadir
);
959 ISP_IOXPUT_8(isp
, src
->req_task_management
, &dst
->req_task_management
);
960 ISP_IOXPUT_8(isp
, src
->req_task_attribute
, &dst
->req_task_attribute
);
961 ISP_IOXPUT_8(isp
, src
->req_crn
, &dst
->req_crn
);
962 a
= (uint32_t *) src
->req_cdb
;
963 b
= (uint32_t *) dst
->req_cdb
;
964 for (i
= 0; i
< (ASIZE(src
->req_cdb
) >> 2); i
++) {
965 *b
++ = ISP_SWAP32(isp
, *a
++);
967 ISP_IOXPUT_32(isp
, src
->req_dl
, &dst
->req_dl
);
968 ISP_IOXPUT_16(isp
, src
->req_tidlo
, &dst
->req_tidlo
);
969 ISP_IOXPUT_8(isp
, src
->req_tidhi
, &dst
->req_tidhi
);
970 ISP_IOXPUT_8(isp
, src
->req_vpidx
, &dst
->req_vpidx
);
971 ISP_IOXPUT_32(isp
, src
->req_dataseg
.ds_base
, &dst
->req_dataseg
.ds_base
);
972 ISP_IOXPUT_32(isp
, src
->req_dataseg
.ds_basehi
, &dst
->req_dataseg
.ds_basehi
);
973 ISP_IOXPUT_32(isp
, src
->req_dataseg
.ds_count
, &dst
->req_dataseg
.ds_count
);
977 isp_put_24xx_tmf(ispsoftc_t
*isp
, isp24xx_tmf_t
*src
, isp24xx_tmf_t
*dst
)
982 isp_put_hdr(isp
, &src
->tmf_header
, &dst
->tmf_header
);
983 ISP_IOXPUT_32(isp
, src
->tmf_handle
, &dst
->tmf_handle
);
984 ISP_IOXPUT_16(isp
, src
->tmf_nphdl
, &dst
->tmf_nphdl
);
985 ISP_IOXPUT_16(isp
, src
->tmf_delay
, &dst
->tmf_delay
);
986 ISP_IOXPUT_16(isp
, src
->tmf_timeout
, &dst
->tmf_timeout
);
987 for (i
= 0; i
< ASIZE(src
->tmf_reserved0
); i
++) {
988 ISP_IOXPUT_8(isp
, src
->tmf_reserved0
[i
], &dst
->tmf_reserved0
[i
]);
990 a
= (uint32_t *) src
->tmf_lun
;
991 b
= (uint32_t *) dst
->tmf_lun
;
992 for (i
= 0; i
< (ASIZE(src
->tmf_lun
) >> 2); i
++ ) {
993 *b
++ = ISP_SWAP32(isp
, *a
++);
995 ISP_IOXPUT_32(isp
, src
->tmf_flags
, &dst
->tmf_flags
);
996 for (i
= 0; i
< ASIZE(src
->tmf_reserved1
); i
++) {
997 ISP_IOXPUT_8(isp
, src
->tmf_reserved1
[i
], &dst
->tmf_reserved1
[i
]);
999 ISP_IOXPUT_16(isp
, src
->tmf_tidlo
, &dst
->tmf_tidlo
);
1000 ISP_IOXPUT_8(isp
, src
->tmf_tidhi
, &dst
->tmf_tidhi
);
1001 ISP_IOXPUT_8(isp
, src
->tmf_vpidx
, &dst
->tmf_vpidx
);
1002 for (i
= 0; i
< ASIZE(src
->tmf_reserved2
); i
++) {
1003 ISP_IOXPUT_8(isp
, src
->tmf_reserved2
[i
], &dst
->tmf_reserved2
[i
]);
1008 isp_put_24xx_abrt(ispsoftc_t
*isp
, isp24xx_abrt_t
*src
, isp24xx_abrt_t
*dst
)
1011 isp_put_hdr(isp
, &src
->abrt_header
, &dst
->abrt_header
);
1012 ISP_IOXPUT_32(isp
, src
->abrt_handle
, &dst
->abrt_handle
);
1013 ISP_IOXPUT_16(isp
, src
->abrt_nphdl
, &dst
->abrt_nphdl
);
1014 ISP_IOXPUT_16(isp
, src
->abrt_options
, &dst
->abrt_options
);
1015 ISP_IOXPUT_32(isp
, src
->abrt_cmd_handle
, &dst
->abrt_cmd_handle
);
1016 for (i
= 0; i
< ASIZE(src
->abrt_reserved
); i
++) {
1017 ISP_IOXPUT_8(isp
, src
->abrt_reserved
[i
], &dst
->abrt_reserved
[i
]);
1019 ISP_IOXPUT_16(isp
, src
->abrt_tidlo
, &dst
->abrt_tidlo
);
1020 ISP_IOXPUT_8(isp
, src
->abrt_tidhi
, &dst
->abrt_tidhi
);
1021 ISP_IOXPUT_8(isp
, src
->abrt_vpidx
, &dst
->abrt_vpidx
);
1022 for (i
= 0; i
< ASIZE(src
->abrt_reserved1
); i
++) {
1023 ISP_IOXPUT_8(isp
, src
->abrt_reserved1
[i
], &dst
->abrt_reserved1
[i
]);
1028 isp_put_cont_req(ispsoftc_t
*isp
, ispcontreq_t
*src
, ispcontreq_t
*dst
)
1031 isp_put_hdr(isp
, &src
->req_header
, &dst
->req_header
);
1032 for (i
= 0; i
< ISP_CDSEG
; i
++) {
1033 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_base
, &dst
->req_dataseg
[i
].ds_base
);
1034 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_count
, &dst
->req_dataseg
[i
].ds_count
);
1039 isp_put_cont64_req(ispsoftc_t
*isp
, ispcontreq64_t
*src
, ispcontreq64_t
*dst
)
1042 isp_put_hdr(isp
, &src
->req_header
, &dst
->req_header
);
1043 for (i
= 0; i
< ISP_CDSEG64
; i
++) {
1044 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_base
, &dst
->req_dataseg
[i
].ds_base
);
1045 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_basehi
, &dst
->req_dataseg
[i
].ds_basehi
);
1046 ISP_IOXPUT_32(isp
, src
->req_dataseg
[i
].ds_count
, &dst
->req_dataseg
[i
].ds_count
);
1051 isp_get_response(ispsoftc_t
*isp
, ispstatusreq_t
*src
, ispstatusreq_t
*dst
)
1054 isp_get_hdr(isp
, &src
->req_header
, &dst
->req_header
);
1055 ISP_IOXGET_32(isp
, &src
->req_handle
, dst
->req_handle
);
1056 ISP_IOXGET_16(isp
, &src
->req_scsi_status
, dst
->req_scsi_status
);
1057 ISP_IOXGET_16(isp
, &src
->req_completion_status
, dst
->req_completion_status
);
1058 ISP_IOXGET_16(isp
, &src
->req_state_flags
, dst
->req_state_flags
);
1059 ISP_IOXGET_16(isp
, &src
->req_status_flags
, dst
->req_status_flags
);
1060 ISP_IOXGET_16(isp
, &src
->req_time
, dst
->req_time
);
1061 ISP_IOXGET_16(isp
, &src
->req_sense_len
, dst
->req_sense_len
);
1062 ISP_IOXGET_32(isp
, &src
->req_resid
, dst
->req_resid
);
1063 for (i
= 0; i
< 8; i
++) {
1064 ISP_IOXGET_8(isp
, &src
->req_response
[i
], dst
->req_response
[i
]);
1066 for (i
= 0; i
< 32; i
++) {
1067 ISP_IOXGET_8(isp
, &src
->req_sense_data
[i
], dst
->req_sense_data
[i
]);
1072 isp_get_24xx_response(ispsoftc_t
*isp
, isp24xx_statusreq_t
*src
, isp24xx_statusreq_t
*dst
)
1077 isp_get_hdr(isp
, &src
->req_header
, &dst
->req_header
);
1078 ISP_IOXGET_32(isp
, &src
->req_handle
, dst
->req_handle
);
1079 ISP_IOXGET_16(isp
, &src
->req_completion_status
, dst
->req_completion_status
);
1080 ISP_IOXGET_16(isp
, &src
->req_oxid
, dst
->req_oxid
);
1081 ISP_IOXGET_32(isp
, &src
->req_resid
, dst
->req_resid
);
1082 ISP_IOXGET_16(isp
, &src
->req_reserved0
, dst
->req_reserved0
);
1083 ISP_IOXGET_16(isp
, &src
->req_state_flags
, dst
->req_state_flags
);
1084 ISP_IOXGET_16(isp
, &src
->req_reserved1
, dst
->req_reserved1
);
1085 ISP_IOXGET_16(isp
, &src
->req_scsi_status
, dst
->req_scsi_status
);
1086 ISP_IOXGET_32(isp
, &src
->req_fcp_residual
, dst
->req_fcp_residual
);
1087 ISP_IOXGET_32(isp
, &src
->req_sense_len
, dst
->req_sense_len
);
1088 ISP_IOXGET_32(isp
, &src
->req_response_len
, dst
->req_response_len
);
1089 s
= (uint32_t *)src
->req_rsp_sense
;
1090 d
= (uint32_t *)dst
->req_rsp_sense
;
1091 for (i
= 0; i
< (ASIZE(src
->req_rsp_sense
) >> 2); i
++) {
1092 d
[i
] = ISP_SWAP32(isp
, s
[i
]);
1097 isp_get_24xx_abrt(ispsoftc_t
*isp
, isp24xx_abrt_t
*src
, isp24xx_abrt_t
*dst
)
1100 isp_get_hdr(isp
, &src
->abrt_header
, &dst
->abrt_header
);
1101 ISP_IOXGET_32(isp
, &src
->abrt_handle
, dst
->abrt_handle
);
1102 ISP_IOXGET_16(isp
, &src
->abrt_nphdl
, dst
->abrt_nphdl
);
1103 ISP_IOXGET_16(isp
, &src
->abrt_options
, dst
->abrt_options
);
1104 ISP_IOXGET_32(isp
, &src
->abrt_cmd_handle
, dst
->abrt_cmd_handle
);
1105 for (i
= 0; i
< ASIZE(src
->abrt_reserved
); i
++) {
1106 ISP_IOXGET_8(isp
, &src
->abrt_reserved
[i
], dst
->abrt_reserved
[i
]);
1108 ISP_IOXGET_16(isp
, &src
->abrt_tidlo
, dst
->abrt_tidlo
);
1109 ISP_IOXGET_8(isp
, &src
->abrt_tidhi
, dst
->abrt_tidhi
);
1110 ISP_IOXGET_8(isp
, &src
->abrt_vpidx
, dst
->abrt_vpidx
);
1111 for (i
= 0; i
< ASIZE(src
->abrt_reserved1
); i
++) {
1112 ISP_IOXGET_8(isp
, &src
->abrt_reserved1
[i
], dst
->abrt_reserved1
[i
]);
1118 isp_get_rio1(ispsoftc_t
*isp
, isp_rio1_t
*r1src
, isp_rio1_t
*r1dst
)
1120 const int lim
= sizeof (r1dst
->req_handles
) / sizeof (r1dst
->req_handles
[0]);
1122 isp_get_hdr(isp
, &r1src
->req_header
, &r1dst
->req_header
);
1123 if (r1dst
->req_header
.rqs_seqno
> lim
) {
1124 r1dst
->req_header
.rqs_seqno
= lim
;
1126 for (i
= 0; i
< r1dst
->req_header
.rqs_seqno
; i
++) {
1127 ISP_IOXGET_32(isp
, &r1src
->req_handles
[i
], r1dst
->req_handles
[i
]);
1130 r1dst
->req_handles
[i
++] = 0;
1135 isp_get_rio2(ispsoftc_t
*isp
, isp_rio2_t
*r2src
, isp_rio2_t
*r2dst
)
1137 const int lim
= sizeof (r2dst
->req_handles
) / sizeof (r2dst
->req_handles
[0]);
1140 isp_get_hdr(isp
, &r2src
->req_header
, &r2dst
->req_header
);
1141 if (r2dst
->req_header
.rqs_seqno
> lim
) {
1142 r2dst
->req_header
.rqs_seqno
= lim
;
1144 for (i
= 0; i
< r2dst
->req_header
.rqs_seqno
; i
++) {
1145 ISP_IOXGET_16(isp
, &r2src
->req_handles
[i
], r2dst
->req_handles
[i
]);
1148 r2dst
->req_handles
[i
++] = 0;
1153 isp_put_icb(ispsoftc_t
*isp
, isp_icb_t
*src
, isp_icb_t
*dst
)
1156 if (ISP_IS_SBUS(isp
)) {
1157 ISP_IOXPUT_8(isp
, src
->icb_version
, &dst
->icb_reserved0
);
1158 ISP_IOXPUT_8(isp
, src
->icb_reserved0
, &dst
->icb_version
);
1160 ISP_IOXPUT_8(isp
, src
->icb_version
, &dst
->icb_version
);
1161 ISP_IOXPUT_8(isp
, src
->icb_reserved0
, &dst
->icb_reserved0
);
1163 ISP_IOXPUT_16(isp
, src
->icb_fwoptions
, &dst
->icb_fwoptions
);
1164 ISP_IOXPUT_16(isp
, src
->icb_maxfrmlen
, &dst
->icb_maxfrmlen
);
1165 ISP_IOXPUT_16(isp
, src
->icb_maxalloc
, &dst
->icb_maxalloc
);
1166 ISP_IOXPUT_16(isp
, src
->icb_execthrottle
, &dst
->icb_execthrottle
);
1167 if (ISP_IS_SBUS(isp
)) {
1168 ISP_IOXPUT_8(isp
, src
->icb_retry_count
, &dst
->icb_retry_delay
);
1169 ISP_IOXPUT_8(isp
, src
->icb_retry_delay
, &dst
->icb_retry_count
);
1171 ISP_IOXPUT_8(isp
, src
->icb_retry_count
, &dst
->icb_retry_count
);
1172 ISP_IOXPUT_8(isp
, src
->icb_retry_delay
, &dst
->icb_retry_delay
);
1174 for (i
= 0; i
< 8; i
++) {
1175 ISP_IOXPUT_8(isp
, src
->icb_portname
[i
], &dst
->icb_portname
[i
]);
1177 ISP_IOXPUT_16(isp
, src
->icb_hardaddr
, &dst
->icb_hardaddr
);
1178 if (ISP_IS_SBUS(isp
)) {
1179 ISP_IOXPUT_8(isp
, src
->icb_iqdevtype
, &dst
->icb_logintime
);
1180 ISP_IOXPUT_8(isp
, src
->icb_logintime
, &dst
->icb_iqdevtype
);
1182 ISP_IOXPUT_8(isp
, src
->icb_iqdevtype
, &dst
->icb_iqdevtype
);
1183 ISP_IOXPUT_8(isp
, src
->icb_logintime
, &dst
->icb_logintime
);
1185 for (i
= 0; i
< 8; i
++) {
1186 ISP_IOXPUT_8(isp
, src
->icb_nodename
[i
], &dst
->icb_nodename
[i
]);
1188 ISP_IOXPUT_16(isp
, src
->icb_rqstout
, &dst
->icb_rqstout
);
1189 ISP_IOXPUT_16(isp
, src
->icb_rspnsin
, &dst
->icb_rspnsin
);
1190 ISP_IOXPUT_16(isp
, src
->icb_rqstqlen
, &dst
->icb_rqstqlen
);
1191 ISP_IOXPUT_16(isp
, src
->icb_rsltqlen
, &dst
->icb_rsltqlen
);
1192 for (i
= 0; i
< 4; i
++) {
1193 ISP_IOXPUT_16(isp
, src
->icb_rqstaddr
[i
], &dst
->icb_rqstaddr
[i
]);
1195 for (i
= 0; i
< 4; i
++) {
1196 ISP_IOXPUT_16(isp
, src
->icb_respaddr
[i
], &dst
->icb_respaddr
[i
]);
1198 ISP_IOXPUT_16(isp
, src
->icb_lunenables
, &dst
->icb_lunenables
);
1199 if (ISP_IS_SBUS(isp
)) {
1200 ISP_IOXPUT_8(isp
, src
->icb_ccnt
, &dst
->icb_icnt
);
1201 ISP_IOXPUT_8(isp
, src
->icb_icnt
, &dst
->icb_ccnt
);
1203 ISP_IOXPUT_8(isp
, src
->icb_ccnt
, &dst
->icb_ccnt
);
1204 ISP_IOXPUT_8(isp
, src
->icb_icnt
, &dst
->icb_icnt
);
1206 ISP_IOXPUT_16(isp
, src
->icb_lunetimeout
, &dst
->icb_lunetimeout
);
1207 ISP_IOXPUT_16(isp
, src
->icb_reserved1
, &dst
->icb_reserved1
);
1208 ISP_IOXPUT_16(isp
, src
->icb_xfwoptions
, &dst
->icb_xfwoptions
);
1209 if (ISP_IS_SBUS(isp
)) {
1210 ISP_IOXPUT_8(isp
, src
->icb_racctimer
, &dst
->icb_idelaytimer
);
1211 ISP_IOXPUT_8(isp
, src
->icb_idelaytimer
, &dst
->icb_racctimer
);
1213 ISP_IOXPUT_8(isp
, src
->icb_racctimer
, &dst
->icb_racctimer
);
1214 ISP_IOXPUT_8(isp
, src
->icb_idelaytimer
, &dst
->icb_idelaytimer
);
1216 ISP_IOXPUT_16(isp
, src
->icb_zfwoptions
, &dst
->icb_zfwoptions
);
1220 isp_put_icb_2400(ispsoftc_t
*isp
, isp_icb_2400_t
*src
, isp_icb_2400_t
*dst
)
1223 ISP_IOXPUT_16(isp
, src
->icb_version
, &dst
->icb_version
);
1224 ISP_IOXPUT_16(isp
, src
->icb_reserved0
, &dst
->icb_reserved0
);
1225 ISP_IOXPUT_16(isp
, src
->icb_maxfrmlen
, &dst
->icb_maxfrmlen
);
1226 ISP_IOXPUT_16(isp
, src
->icb_execthrottle
, &dst
->icb_execthrottle
);
1227 ISP_IOXPUT_16(isp
, src
->icb_xchgcnt
, &dst
->icb_xchgcnt
);
1228 ISP_IOXPUT_16(isp
, src
->icb_hardaddr
, &dst
->icb_hardaddr
);
1229 for (i
= 0; i
< 8; i
++) {
1230 ISP_IOXPUT_8(isp
, src
->icb_portname
[i
], &dst
->icb_portname
[i
]);
1232 for (i
= 0; i
< 8; i
++) {
1233 ISP_IOXPUT_8(isp
, src
->icb_nodename
[i
], &dst
->icb_nodename
[i
]);
1235 ISP_IOXPUT_16(isp
, src
->icb_rspnsin
, &dst
->icb_rspnsin
);
1236 ISP_IOXPUT_16(isp
, src
->icb_rqstout
, &dst
->icb_rqstout
);
1237 ISP_IOXPUT_16(isp
, src
->icb_retry_count
, &dst
->icb_retry_count
);
1238 ISP_IOXPUT_16(isp
, src
->icb_priout
, &dst
->icb_priout
);
1239 ISP_IOXPUT_16(isp
, src
->icb_rsltqlen
, &dst
->icb_rsltqlen
);
1240 ISP_IOXPUT_16(isp
, src
->icb_rqstqlen
, &dst
->icb_rqstqlen
);
1241 ISP_IOXPUT_16(isp
, src
->icb_ldn_nols
, &dst
->icb_ldn_nols
);
1242 ISP_IOXPUT_16(isp
, src
->icb_prqstqlen
, &dst
->icb_prqstqlen
);
1243 for (i
= 0; i
< 4; i
++) {
1244 ISP_IOXPUT_16(isp
, src
->icb_rqstaddr
[i
], &dst
->icb_rqstaddr
[i
]);
1246 for (i
= 0; i
< 4; i
++) {
1247 ISP_IOXPUT_16(isp
, src
->icb_respaddr
[i
], &dst
->icb_respaddr
[i
]);
1249 for (i
= 0; i
< 4; i
++) {
1250 ISP_IOXPUT_16(isp
, src
->icb_priaddr
[i
], &dst
->icb_priaddr
[i
]);
1252 for (i
= 0; i
< 4; i
++) {
1253 ISP_IOXPUT_16(isp
, src
->icb_reserved1
[i
], &dst
->icb_reserved1
[i
]);
1255 ISP_IOXPUT_16(isp
, src
->icb_atio_in
, &dst
->icb_atio_in
);
1256 ISP_IOXPUT_16(isp
, src
->icb_atioqlen
, &dst
->icb_atioqlen
);
1257 for (i
= 0; i
< 4; i
++) {
1258 ISP_IOXPUT_16(isp
, src
->icb_atioqaddr
[i
], &dst
->icb_atioqaddr
[i
]);
1260 ISP_IOXPUT_16(isp
, src
->icb_idelaytimer
, &dst
->icb_idelaytimer
);
1261 ISP_IOXPUT_16(isp
, src
->icb_logintime
, &dst
->icb_logintime
);
1262 ISP_IOXPUT_32(isp
, src
->icb_fwoptions1
, &dst
->icb_fwoptions1
);
1263 ISP_IOXPUT_32(isp
, src
->icb_fwoptions2
, &dst
->icb_fwoptions2
);
1264 ISP_IOXPUT_32(isp
, src
->icb_fwoptions3
, &dst
->icb_fwoptions3
);
1265 for (i
= 0; i
< 12; i
++) {
1266 ISP_IOXPUT_16(isp
, src
->icb_reserved2
[i
], &dst
->icb_reserved2
[i
]);
1271 isp_put_icb_2400_vpinfo(ispsoftc_t
*isp
, isp_icb_2400_vpinfo_t
*src
, isp_icb_2400_vpinfo_t
*dst
)
1273 ISP_IOXPUT_16(isp
, src
->vp_count
, &dst
->vp_count
);
1274 ISP_IOXPUT_16(isp
, src
->vp_global_options
, &dst
->vp_global_options
);
1278 isp_put_vp_port_info(ispsoftc_t
*isp
, vp_port_info_t
*src
, vp_port_info_t
*dst
)
1281 ISP_IOXPUT_16(isp
, src
->vp_port_status
, &dst
->vp_port_status
);
1282 ISP_IOXPUT_8(isp
, src
->vp_port_options
, &dst
->vp_port_options
);
1283 ISP_IOXPUT_8(isp
, src
->vp_port_loopid
, &dst
->vp_port_loopid
);
1284 for (i
= 0; i
< 8; i
++) {
1285 ISP_IOXPUT_8(isp
, src
->vp_port_portname
[i
], &dst
->vp_port_portname
[i
]);
1287 for (i
= 0; i
< 8; i
++) {
1288 ISP_IOXPUT_8(isp
, src
->vp_port_nodename
[i
], &dst
->vp_port_nodename
[i
]);
1290 /* we never *put* portid_lo/portid_hi */
1294 isp_get_vp_port_info(ispsoftc_t
*isp
, vp_port_info_t
*src
, vp_port_info_t
*dst
)
1297 ISP_IOXGET_16(isp
, &src
->vp_port_status
, dst
->vp_port_status
);
1298 ISP_IOXGET_8(isp
, &src
->vp_port_options
, dst
->vp_port_options
);
1299 ISP_IOXGET_8(isp
, &src
->vp_port_loopid
, dst
->vp_port_loopid
);
1300 for (i
= 0; i
< ASIZE(src
->vp_port_portname
); i
++) {
1301 ISP_IOXGET_8(isp
, &src
->vp_port_portname
[i
], dst
->vp_port_portname
[i
]);
1303 for (i
= 0; i
< ASIZE(src
->vp_port_nodename
); i
++) {
1304 ISP_IOXGET_8(isp
, &src
->vp_port_nodename
[i
], dst
->vp_port_nodename
[i
]);
1306 ISP_IOXGET_16(isp
, &src
->vp_port_portid_lo
, dst
->vp_port_portid_lo
);
1307 ISP_IOXGET_16(isp
, &src
->vp_port_portid_hi
, dst
->vp_port_portid_hi
);
1311 isp_put_vp_ctrl_info(ispsoftc_t
*isp
, vp_ctrl_info_t
*src
, vp_ctrl_info_t
*dst
)
1314 isp_put_hdr(isp
, &src
->vp_ctrl_hdr
, &dst
->vp_ctrl_hdr
);
1315 ISP_IOXPUT_32(isp
, src
->vp_ctrl_handle
, &dst
->vp_ctrl_handle
);
1316 ISP_IOXPUT_16(isp
, src
->vp_ctrl_index_fail
, &dst
->vp_ctrl_index_fail
);
1317 ISP_IOXPUT_16(isp
, src
->vp_ctrl_status
, &dst
->vp_ctrl_status
);
1318 ISP_IOXPUT_16(isp
, src
->vp_ctrl_command
, &dst
->vp_ctrl_command
);
1319 ISP_IOXPUT_16(isp
, src
->vp_ctrl_vp_count
, &dst
->vp_ctrl_vp_count
);
1320 for (i
= 0; i
< ASIZE(src
->vp_ctrl_idmap
); i
++) {
1321 ISP_IOXPUT_16(isp
, src
->vp_ctrl_idmap
[i
], &dst
->vp_ctrl_idmap
[i
]);
1323 for (i
= 0; i
< ASIZE(src
->vp_ctrl_reserved
); i
++) {
1324 ISP_IOXPUT_8(isp
, src
->vp_ctrl_reserved
[i
], &dst
->vp_ctrl_reserved
[i
]);
1329 isp_get_vp_ctrl_info(ispsoftc_t
*isp
, vp_ctrl_info_t
*src
, vp_ctrl_info_t
*dst
)
1332 isp_get_hdr(isp
, &src
->vp_ctrl_hdr
, &dst
->vp_ctrl_hdr
);
1333 ISP_IOXGET_32(isp
, &src
->vp_ctrl_handle
, dst
->vp_ctrl_handle
);
1334 ISP_IOXGET_16(isp
, &src
->vp_ctrl_index_fail
, dst
->vp_ctrl_index_fail
);
1335 ISP_IOXGET_16(isp
, &src
->vp_ctrl_status
, dst
->vp_ctrl_status
);
1336 ISP_IOXGET_16(isp
, &src
->vp_ctrl_command
, dst
->vp_ctrl_command
);
1337 ISP_IOXGET_16(isp
, &src
->vp_ctrl_vp_count
, dst
->vp_ctrl_vp_count
);
1338 for (i
= 0; i
< ASIZE(src
->vp_ctrl_idmap
); i
++) {
1339 ISP_IOXGET_16(isp
, &src
->vp_ctrl_idmap
[i
], dst
->vp_ctrl_idmap
[i
]);
1341 for (i
= 0; i
< ASIZE(src
->vp_ctrl_reserved
); i
++) {
1342 ISP_IOXGET_8(isp
, &src
->vp_ctrl_reserved
[i
], dst
->vp_ctrl_reserved
[i
]);
1347 isp_put_vp_modify(ispsoftc_t
*isp
, vp_modify_t
*src
, vp_modify_t
*dst
)
1350 isp_put_hdr(isp
, &src
->vp_mod_hdr
, &dst
->vp_mod_hdr
);
1351 ISP_IOXPUT_32(isp
, src
->vp_mod_hdl
, &dst
->vp_mod_hdl
);
1352 ISP_IOXPUT_16(isp
, src
->vp_mod_reserved0
, &dst
->vp_mod_reserved0
);
1353 ISP_IOXPUT_16(isp
, src
->vp_mod_status
, &dst
->vp_mod_status
);
1354 ISP_IOXPUT_8(isp
, src
->vp_mod_cmd
, &dst
->vp_mod_cmd
);
1355 ISP_IOXPUT_8(isp
, src
->vp_mod_cnt
, &dst
->vp_mod_cnt
);
1356 ISP_IOXPUT_8(isp
, src
->vp_mod_idx0
, &dst
->vp_mod_idx0
);
1357 ISP_IOXPUT_8(isp
, src
->vp_mod_idx1
, &dst
->vp_mod_idx1
);
1358 for (i
= 0; i
< ASIZE(src
->vp_mod_ports
); i
++) {
1359 ISP_IOXPUT_8(isp
, src
->vp_mod_ports
[i
].options
, &dst
->vp_mod_ports
[i
].options
);
1360 ISP_IOXPUT_8(isp
, src
->vp_mod_ports
[i
].loopid
, &dst
->vp_mod_ports
[i
].loopid
);
1361 ISP_IOXPUT_16(isp
, src
->vp_mod_ports
[i
].reserved1
, &dst
->vp_mod_ports
[i
].reserved1
);
1362 for (j
= 0; j
< ASIZE(src
->vp_mod_ports
[i
].wwpn
); j
++) {
1363 ISP_IOXPUT_8(isp
, src
->vp_mod_ports
[i
].wwpn
[j
], &dst
->vp_mod_ports
[i
].wwpn
[j
]);
1365 for (j
= 0; j
< ASIZE(src
->vp_mod_ports
[i
].wwnn
); j
++) {
1366 ISP_IOXPUT_8(isp
, src
->vp_mod_ports
[i
].wwnn
[j
], &dst
->vp_mod_ports
[i
].wwnn
[j
]);
1369 for (i
= 0; i
< ASIZE(src
->vp_mod_reserved2
); i
++) {
1370 ISP_IOXPUT_8(isp
, src
->vp_mod_reserved2
[i
], &dst
->vp_mod_reserved2
[i
]);
1375 isp_get_vp_modify(ispsoftc_t
*isp
, vp_modify_t
*src
, vp_modify_t
*dst
)
1378 isp_get_hdr(isp
, &src
->vp_mod_hdr
, &dst
->vp_mod_hdr
);
1379 ISP_IOXGET_32(isp
, &src
->vp_mod_hdl
, dst
->vp_mod_hdl
);
1380 ISP_IOXGET_16(isp
, &src
->vp_mod_reserved0
, dst
->vp_mod_reserved0
);
1381 ISP_IOXGET_16(isp
, &src
->vp_mod_status
, dst
->vp_mod_status
);
1382 ISP_IOXGET_8(isp
, &src
->vp_mod_cmd
, dst
->vp_mod_cmd
);
1383 ISP_IOXGET_8(isp
, &src
->vp_mod_cnt
, dst
->vp_mod_cnt
);
1384 ISP_IOXGET_8(isp
, &src
->vp_mod_idx0
, dst
->vp_mod_idx0
);
1385 ISP_IOXGET_8(isp
, &src
->vp_mod_idx1
, dst
->vp_mod_idx1
);
1386 for (i
= 0; i
< ASIZE(src
->vp_mod_ports
); i
++) {
1387 ISP_IOXGET_8(isp
, &src
->vp_mod_ports
[i
].options
, dst
->vp_mod_ports
[i
].options
);
1388 ISP_IOXGET_8(isp
, &src
->vp_mod_ports
[i
].loopid
, dst
->vp_mod_ports
[i
].loopid
);
1389 ISP_IOXGET_16(isp
, &src
->vp_mod_ports
[i
].reserved1
, dst
->vp_mod_ports
[i
].reserved1
);
1390 for (j
= 0; j
< ASIZE(src
->vp_mod_ports
[i
].wwpn
); j
++) {
1391 ISP_IOXGET_8(isp
, &src
->vp_mod_ports
[i
].wwpn
[j
], dst
->vp_mod_ports
[i
].wwpn
[j
]);
1393 for (j
= 0; j
< ASIZE(src
->vp_mod_ports
[i
].wwnn
); j
++) {
1394 ISP_IOXGET_8(isp
, &src
->vp_mod_ports
[i
].wwnn
[j
], dst
->vp_mod_ports
[i
].wwnn
[j
]);
1397 for (i
= 0; i
< ASIZE(src
->vp_mod_reserved2
); i
++) {
1398 ISP_IOXGET_8(isp
, &src
->vp_mod_reserved2
[i
], dst
->vp_mod_reserved2
[i
]);
1403 isp_get_pdb_21xx(ispsoftc_t
*isp
, isp_pdb_21xx_t
*src
, isp_pdb_21xx_t
*dst
)
1406 ISP_IOXGET_16(isp
, &src
->pdb_options
, dst
->pdb_options
);
1407 ISP_IOXGET_8(isp
, &src
->pdb_mstate
, dst
->pdb_mstate
);
1408 ISP_IOXGET_8(isp
, &src
->pdb_sstate
, dst
->pdb_sstate
);
1409 for (i
= 0; i
< 4; i
++) {
1410 ISP_IOXGET_8(isp
, &src
->pdb_hardaddr_bits
[i
], dst
->pdb_hardaddr_bits
[i
]);
1412 for (i
= 0; i
< 4; i
++) {
1413 ISP_IOXGET_8(isp
, &src
->pdb_portid_bits
[i
], dst
->pdb_portid_bits
[i
]);
1415 for (i
= 0; i
< 8; i
++) {
1416 ISP_IOXGET_8(isp
, &src
->pdb_nodename
[i
], dst
->pdb_nodename
[i
]);
1418 for (i
= 0; i
< 8; i
++) {
1419 ISP_IOXGET_8(isp
, &src
->pdb_portname
[i
], dst
->pdb_portname
[i
]);
1421 ISP_IOXGET_16(isp
, &src
->pdb_execthrottle
, dst
->pdb_execthrottle
);
1422 ISP_IOXGET_16(isp
, &src
->pdb_exec_count
, dst
->pdb_exec_count
);
1423 ISP_IOXGET_8(isp
, &src
->pdb_retry_count
, dst
->pdb_retry_count
);
1424 ISP_IOXGET_8(isp
, &src
->pdb_retry_delay
, dst
->pdb_retry_delay
);
1425 ISP_IOXGET_16(isp
, &src
->pdb_resalloc
, dst
->pdb_resalloc
);
1426 ISP_IOXGET_16(isp
, &src
->pdb_curalloc
, dst
->pdb_curalloc
);
1427 ISP_IOXGET_16(isp
, &src
->pdb_qhead
, dst
->pdb_qhead
);
1428 ISP_IOXGET_16(isp
, &src
->pdb_qtail
, dst
->pdb_qtail
);
1429 ISP_IOXGET_16(isp
, &src
->pdb_tl_next
, dst
->pdb_tl_next
);
1430 ISP_IOXGET_16(isp
, &src
->pdb_tl_last
, dst
->pdb_tl_last
);
1431 ISP_IOXGET_16(isp
, &src
->pdb_features
, dst
->pdb_features
);
1432 ISP_IOXGET_16(isp
, &src
->pdb_pconcurrnt
, dst
->pdb_pconcurrnt
);
1433 ISP_IOXGET_16(isp
, &src
->pdb_roi
, dst
->pdb_roi
);
1434 ISP_IOXGET_8(isp
, &src
->pdb_target
, dst
->pdb_target
);
1435 ISP_IOXGET_8(isp
, &src
->pdb_initiator
, dst
->pdb_initiator
);
1436 ISP_IOXGET_16(isp
, &src
->pdb_rdsiz
, dst
->pdb_rdsiz
);
1437 ISP_IOXGET_16(isp
, &src
->pdb_ncseq
, dst
->pdb_ncseq
);
1438 ISP_IOXGET_16(isp
, &src
->pdb_noseq
, dst
->pdb_noseq
);
1439 ISP_IOXGET_16(isp
, &src
->pdb_labrtflg
, dst
->pdb_labrtflg
);
1440 ISP_IOXGET_16(isp
, &src
->pdb_lstopflg
, dst
->pdb_lstopflg
);
1441 ISP_IOXGET_16(isp
, &src
->pdb_sqhead
, dst
->pdb_sqhead
);
1442 ISP_IOXGET_16(isp
, &src
->pdb_sqtail
, dst
->pdb_sqtail
);
1443 ISP_IOXGET_16(isp
, &src
->pdb_ptimer
, dst
->pdb_ptimer
);
1444 ISP_IOXGET_16(isp
, &src
->pdb_nxt_seqid
, dst
->pdb_nxt_seqid
);
1445 ISP_IOXGET_16(isp
, &src
->pdb_fcount
, dst
->pdb_fcount
);
1446 ISP_IOXGET_16(isp
, &src
->pdb_prli_len
, dst
->pdb_prli_len
);
1447 ISP_IOXGET_16(isp
, &src
->pdb_prli_svc0
, dst
->pdb_prli_svc0
);
1448 ISP_IOXGET_16(isp
, &src
->pdb_prli_svc3
, dst
->pdb_prli_svc3
);
1449 ISP_IOXGET_16(isp
, &src
->pdb_loopid
, dst
->pdb_loopid
);
1450 ISP_IOXGET_16(isp
, &src
->pdb_il_ptr
, dst
->pdb_il_ptr
);
1451 ISP_IOXGET_16(isp
, &src
->pdb_sl_ptr
, dst
->pdb_sl_ptr
);
1455 isp_get_pdb_24xx(ispsoftc_t
*isp
, isp_pdb_24xx_t
*src
, isp_pdb_24xx_t
*dst
)
1458 ISP_IOXGET_16(isp
, &src
->pdb_flags
, dst
->pdb_flags
);
1459 ISP_IOXGET_8(isp
, &src
->pdb_curstate
, dst
->pdb_curstate
);
1460 ISP_IOXGET_8(isp
, &src
->pdb_laststate
, dst
->pdb_laststate
);
1461 for (i
= 0; i
< 4; i
++) {
1462 ISP_IOXGET_8(isp
, &src
->pdb_hardaddr_bits
[i
], dst
->pdb_hardaddr_bits
[i
]);
1464 for (i
= 0; i
< 4; i
++) {
1465 ISP_IOXGET_8(isp
, &src
->pdb_portid_bits
[i
], dst
->pdb_portid_bits
[i
]);
1467 ISP_IOXGET_16(isp
, &src
->pdb_retry_timer
, dst
->pdb_retry_timer
);
1468 ISP_IOXGET_16(isp
, &src
->pdb_handle
, dst
->pdb_handle
);
1469 ISP_IOXGET_16(isp
, &src
->pdb_rcv_dsize
, dst
->pdb_rcv_dsize
);
1470 ISP_IOXGET_16(isp
, &src
->pdb_reserved0
, dst
->pdb_reserved0
);
1471 ISP_IOXGET_16(isp
, &src
->pdb_prli_svc0
, dst
->pdb_prli_svc0
);
1472 ISP_IOXGET_16(isp
, &src
->pdb_prli_svc3
, dst
->pdb_prli_svc3
);
1473 for (i
= 0; i
< 8; i
++) {
1474 ISP_IOXGET_8(isp
, &src
->pdb_nodename
[i
], dst
->pdb_nodename
[i
]);
1476 for (i
= 0; i
< 8; i
++) {
1477 ISP_IOXGET_8(isp
, &src
->pdb_portname
[i
], dst
->pdb_portname
[i
]);
1479 for (i
= 0; i
< 24; i
++) {
1480 ISP_IOXGET_8(isp
, &src
->pdb_reserved1
[i
], dst
->pdb_reserved1
[i
]);
1485 * PLOGI/LOGO IOCB canonicalization
1489 isp_get_plogx(ispsoftc_t
*isp
, isp_plogx_t
*src
, isp_plogx_t
*dst
)
1492 isp_get_hdr(isp
, &src
->plogx_header
, &dst
->plogx_header
);
1493 ISP_IOXGET_32(isp
, &src
->plogx_handle
, dst
->plogx_handle
);
1494 ISP_IOXGET_16(isp
, &src
->plogx_status
, dst
->plogx_status
);
1495 ISP_IOXGET_16(isp
, &src
->plogx_nphdl
, dst
->plogx_nphdl
);
1496 ISP_IOXGET_16(isp
, &src
->plogx_flags
, dst
->plogx_flags
);
1497 ISP_IOXGET_16(isp
, &src
->plogx_vphdl
, dst
->plogx_vphdl
);
1498 ISP_IOXGET_16(isp
, &src
->plogx_portlo
, dst
->plogx_portlo
);
1499 ISP_IOXGET_16(isp
, &src
->plogx_rspsz_porthi
, dst
->plogx_rspsz_porthi
);
1500 for (i
= 0; i
< 11; i
++) {
1501 ISP_IOXGET_16(isp
, &src
->plogx_ioparm
[i
].lo16
, dst
->plogx_ioparm
[i
].lo16
);
1502 ISP_IOXGET_16(isp
, &src
->plogx_ioparm
[i
].hi16
, dst
->plogx_ioparm
[i
].hi16
);
1507 isp_put_plogx(ispsoftc_t
*isp
, isp_plogx_t
*src
, isp_plogx_t
*dst
)
1510 isp_put_hdr(isp
, &src
->plogx_header
, &dst
->plogx_header
);
1511 ISP_IOXPUT_32(isp
, src
->plogx_handle
, &dst
->plogx_handle
);
1512 ISP_IOXPUT_16(isp
, src
->plogx_status
, &dst
->plogx_status
);
1513 ISP_IOXPUT_16(isp
, src
->plogx_nphdl
, &dst
->plogx_nphdl
);
1514 ISP_IOXPUT_16(isp
, src
->plogx_flags
, &dst
->plogx_flags
);
1515 ISP_IOXPUT_16(isp
, src
->plogx_vphdl
, &dst
->plogx_vphdl
);
1516 ISP_IOXPUT_16(isp
, src
->plogx_portlo
, &dst
->plogx_portlo
);
1517 ISP_IOXPUT_16(isp
, src
->plogx_rspsz_porthi
, &dst
->plogx_rspsz_porthi
);
1518 for (i
= 0; i
< 11; i
++) {
1519 ISP_IOXPUT_16(isp
, src
->plogx_ioparm
[i
].lo16
, &dst
->plogx_ioparm
[i
].lo16
);
1520 ISP_IOXPUT_16(isp
, src
->plogx_ioparm
[i
].hi16
, &dst
->plogx_ioparm
[i
].hi16
);
1525 * Report ID canonicalization
1528 isp_get_ridacq(ispsoftc_t
*isp
, isp_ridacq_t
*src
, isp_ridacq_t
*dst
)
1531 isp_get_hdr(isp
, &src
->ridacq_hdr
, &dst
->ridacq_hdr
);
1532 ISP_IOXGET_32(isp
, &src
->ridacq_handle
, dst
->ridacq_handle
);
1533 ISP_IOXGET_16(isp
, &src
->ridacq_vp_port_lo
, dst
->ridacq_vp_port_lo
);
1534 ISP_IOXGET_8(isp
, &src
->ridacq_vp_port_hi
, dst
->ridacq_vp_port_hi
);
1535 ISP_IOXGET_8(isp
, &src
->ridacq_format
, dst
->ridacq_format
);
1536 for (i
= 0; i
< sizeof (src
->ridacq_map
) / sizeof (src
->ridacq_map
[0]); i
++) {
1537 ISP_IOXGET_16(isp
, &src
->ridacq_map
[i
], dst
->ridacq_map
[i
]);
1539 for (i
= 0; i
< sizeof (src
->ridacq_reserved1
) / sizeof (src
->ridacq_reserved1
[0]); i
++) {
1540 ISP_IOXGET_16(isp
, &src
->ridacq_reserved1
[i
], dst
->ridacq_reserved1
[i
]);
1542 if (dst
->ridacq_format
== 0) {
1543 ISP_IOXGET_8(isp
, &src
->un
.type0
.ridacq_vp_acquired
, dst
->un
.type0
.ridacq_vp_acquired
);
1544 ISP_IOXGET_8(isp
, &src
->un
.type0
.ridacq_vp_setup
, dst
->un
.type0
.ridacq_vp_setup
);
1545 ISP_IOXGET_16(isp
, &src
->un
.type0
.ridacq_reserved0
, dst
->un
.type0
.ridacq_reserved0
);
1546 } else if (dst
->ridacq_format
== 1) {
1547 ISP_IOXGET_16(isp
, &src
->un
.type1
.ridacq_vp_count
, dst
->un
.type1
.ridacq_vp_count
);
1548 ISP_IOXGET_8(isp
, &src
->un
.type1
.ridacq_vp_index
, dst
->un
.type1
.ridacq_vp_index
);
1549 ISP_IOXGET_8(isp
, &src
->un
.type1
.ridacq_vp_status
, dst
->un
.type1
.ridacq_vp_status
);
1551 ISP_MEMZERO(&dst
->un
, sizeof (dst
->un
));
1557 * CT Passthru canonicalization
1560 isp_get_ct_pt(ispsoftc_t
*isp
, isp_ct_pt_t
*src
, isp_ct_pt_t
*dst
)
1564 isp_get_hdr(isp
, &src
->ctp_header
, &dst
->ctp_header
);
1565 ISP_IOXGET_32(isp
, &src
->ctp_handle
, dst
->ctp_handle
);
1566 ISP_IOXGET_16(isp
, &src
->ctp_status
, dst
->ctp_status
);
1567 ISP_IOXGET_16(isp
, &src
->ctp_nphdl
, dst
->ctp_nphdl
);
1568 ISP_IOXGET_16(isp
, &src
->ctp_cmd_cnt
, dst
->ctp_cmd_cnt
);
1569 ISP_IOXGET_8(isp
, &src
->ctp_vpidx
, dst
->ctp_vpidx
);
1570 ISP_IOXGET_8(isp
, &src
->ctp_reserved0
, dst
->ctp_reserved0
);
1571 ISP_IOXGET_16(isp
, &src
->ctp_time
, dst
->ctp_time
);
1572 ISP_IOXGET_16(isp
, &src
->ctp_reserved1
, dst
->ctp_reserved1
);
1573 ISP_IOXGET_16(isp
, &src
->ctp_rsp_cnt
, dst
->ctp_rsp_cnt
);
1574 for (i
= 0; i
< 5; i
++) {
1575 ISP_IOXGET_16(isp
, &src
->ctp_reserved2
[i
], dst
->ctp_reserved2
[i
]);
1577 ISP_IOXGET_32(isp
, &src
->ctp_rsp_bcnt
, dst
->ctp_rsp_bcnt
);
1578 ISP_IOXGET_32(isp
, &src
->ctp_cmd_bcnt
, dst
->ctp_cmd_bcnt
);
1579 for (i
= 0; i
< 2; i
++) {
1580 ISP_IOXGET_32(isp
, &src
->ctp_dataseg
[i
].ds_base
, dst
->ctp_dataseg
[i
].ds_base
);
1581 ISP_IOXGET_32(isp
, &src
->ctp_dataseg
[i
].ds_basehi
, dst
->ctp_dataseg
[i
].ds_basehi
);
1582 ISP_IOXGET_32(isp
, &src
->ctp_dataseg
[i
].ds_count
, dst
->ctp_dataseg
[i
].ds_count
);
1587 isp_get_ms(ispsoftc_t
*isp
, isp_ms_t
*src
, isp_ms_t
*dst
)
1591 isp_get_hdr(isp
, &src
->ms_header
, &dst
->ms_header
);
1592 ISP_IOXGET_32(isp
, &src
->ms_handle
, dst
->ms_handle
);
1593 ISP_IOXGET_16(isp
, &src
->ms_nphdl
, dst
->ms_nphdl
);
1594 ISP_IOXGET_16(isp
, &src
->ms_status
, dst
->ms_status
);
1595 ISP_IOXGET_16(isp
, &src
->ms_flags
, dst
->ms_flags
);
1596 ISP_IOXGET_16(isp
, &src
->ms_reserved1
, dst
->ms_reserved1
);
1597 ISP_IOXGET_16(isp
, &src
->ms_time
, dst
->ms_time
);
1598 ISP_IOXGET_16(isp
, &src
->ms_cmd_cnt
, dst
->ms_cmd_cnt
);
1599 ISP_IOXGET_16(isp
, &src
->ms_tot_cnt
, dst
->ms_tot_cnt
);
1600 ISP_IOXGET_8(isp
, &src
->ms_type
, dst
->ms_type
);
1601 ISP_IOXGET_8(isp
, &src
->ms_r_ctl
, dst
->ms_r_ctl
);
1602 ISP_IOXGET_16(isp
, &src
->ms_rxid
, dst
->ms_rxid
);
1603 ISP_IOXGET_16(isp
, &src
->ms_reserved2
, dst
->ms_reserved2
);
1604 ISP_IOXGET_32(isp
, &src
->ms_rsp_bcnt
, dst
->ms_rsp_bcnt
);
1605 ISP_IOXGET_32(isp
, &src
->ms_cmd_bcnt
, dst
->ms_cmd_bcnt
);
1606 for (i
= 0; i
< 2; i
++) {
1607 ISP_IOXGET_32(isp
, &src
->ms_dataseg
[i
].ds_base
, dst
->ms_dataseg
[i
].ds_base
);
1608 ISP_IOXGET_32(isp
, &src
->ms_dataseg
[i
].ds_basehi
, dst
->ms_dataseg
[i
].ds_basehi
);
1609 ISP_IOXGET_32(isp
, &src
->ms_dataseg
[i
].ds_count
, dst
->ms_dataseg
[i
].ds_count
);
1614 isp_put_ct_pt(ispsoftc_t
*isp
, isp_ct_pt_t
*src
, isp_ct_pt_t
*dst
)
1618 isp_put_hdr(isp
, &src
->ctp_header
, &dst
->ctp_header
);
1619 ISP_IOXPUT_32(isp
, src
->ctp_handle
, &dst
->ctp_handle
);
1620 ISP_IOXPUT_16(isp
, src
->ctp_status
, &dst
->ctp_status
);
1621 ISP_IOXPUT_16(isp
, src
->ctp_nphdl
, &dst
->ctp_nphdl
);
1622 ISP_IOXPUT_16(isp
, src
->ctp_cmd_cnt
, &dst
->ctp_cmd_cnt
);
1623 ISP_IOXPUT_8(isp
, src
->ctp_vpidx
, &dst
->ctp_vpidx
);
1624 ISP_IOXPUT_8(isp
, src
->ctp_reserved0
, &dst
->ctp_reserved0
);
1625 ISP_IOXPUT_16(isp
, src
->ctp_time
, &dst
->ctp_time
);
1626 ISP_IOXPUT_16(isp
, src
->ctp_reserved1
, &dst
->ctp_reserved1
);
1627 ISP_IOXPUT_16(isp
, src
->ctp_rsp_cnt
, &dst
->ctp_rsp_cnt
);
1628 for (i
= 0; i
< 5; i
++) {
1629 ISP_IOXPUT_16(isp
, src
->ctp_reserved2
[i
], &dst
->ctp_reserved2
[i
]);
1631 ISP_IOXPUT_32(isp
, src
->ctp_rsp_bcnt
, &dst
->ctp_rsp_bcnt
);
1632 ISP_IOXPUT_32(isp
, src
->ctp_cmd_bcnt
, &dst
->ctp_cmd_bcnt
);
1633 for (i
= 0; i
< 2; i
++) {
1634 ISP_IOXPUT_32(isp
, src
->ctp_dataseg
[i
].ds_base
, &dst
->ctp_dataseg
[i
].ds_base
);
1635 ISP_IOXPUT_32(isp
, src
->ctp_dataseg
[i
].ds_basehi
, &dst
->ctp_dataseg
[i
].ds_basehi
);
1636 ISP_IOXPUT_32(isp
, src
->ctp_dataseg
[i
].ds_count
, &dst
->ctp_dataseg
[i
].ds_count
);
1641 isp_put_ms(ispsoftc_t
*isp
, isp_ms_t
*src
, isp_ms_t
*dst
)
1645 isp_put_hdr(isp
, &src
->ms_header
, &dst
->ms_header
);
1646 ISP_IOXPUT_32(isp
, src
->ms_handle
, &dst
->ms_handle
);
1647 ISP_IOXPUT_16(isp
, src
->ms_nphdl
, &dst
->ms_nphdl
);
1648 ISP_IOXPUT_16(isp
, src
->ms_status
, &dst
->ms_status
);
1649 ISP_IOXPUT_16(isp
, src
->ms_flags
, &dst
->ms_flags
);
1650 ISP_IOXPUT_16(isp
, src
->ms_reserved1
, &dst
->ms_reserved1
);
1651 ISP_IOXPUT_16(isp
, src
->ms_time
, &dst
->ms_time
);
1652 ISP_IOXPUT_16(isp
, src
->ms_cmd_cnt
, &dst
->ms_cmd_cnt
);
1653 ISP_IOXPUT_16(isp
, src
->ms_tot_cnt
, &dst
->ms_tot_cnt
);
1654 ISP_IOXPUT_8(isp
, src
->ms_type
, &dst
->ms_type
);
1655 ISP_IOXPUT_8(isp
, src
->ms_r_ctl
, &dst
->ms_r_ctl
);
1656 ISP_IOXPUT_16(isp
, src
->ms_rxid
, &dst
->ms_rxid
);
1657 ISP_IOXPUT_16(isp
, src
->ms_reserved2
, &dst
->ms_reserved2
);
1658 ISP_IOXPUT_32(isp
, src
->ms_rsp_bcnt
, &dst
->ms_rsp_bcnt
);
1659 ISP_IOXPUT_32(isp
, src
->ms_cmd_bcnt
, &dst
->ms_cmd_bcnt
);
1660 for (i
= 0; i
< 2; i
++) {
1661 ISP_IOXPUT_32(isp
, src
->ms_dataseg
[i
].ds_base
, &dst
->ms_dataseg
[i
].ds_base
);
1662 ISP_IOXPUT_32(isp
, src
->ms_dataseg
[i
].ds_basehi
, &dst
->ms_dataseg
[i
].ds_basehi
);
1663 ISP_IOXPUT_32(isp
, src
->ms_dataseg
[i
].ds_count
, &dst
->ms_dataseg
[i
].ds_count
);
1668 * Generic SNS request - not particularly useful since the per-command data
1669 * isn't always 16 bit words.
1672 isp_put_sns_request(ispsoftc_t
*isp
, sns_screq_t
*src
, sns_screq_t
*dst
)
1674 int i
, nw
= (int) src
->snscb_sblen
;
1675 ISP_IOXPUT_16(isp
, src
->snscb_rblen
, &dst
->snscb_rblen
);
1676 for (i
= 0; i
< 4; i
++) {
1677 ISP_IOXPUT_16(isp
, src
->snscb_addr
[i
], &dst
->snscb_addr
[i
]);
1679 ISP_IOXPUT_16(isp
, src
->snscb_sblen
, &dst
->snscb_sblen
);
1680 for (i
= 0; i
< nw
; i
++) {
1681 ISP_IOXPUT_16(isp
, src
->snscb_data
[i
], &dst
->snscb_data
[i
]);
1686 isp_put_gid_ft_request(ispsoftc_t
*isp
, sns_gid_ft_req_t
*src
, sns_gid_ft_req_t
*dst
)
1688 ISP_IOXPUT_16(isp
, src
->snscb_rblen
, &dst
->snscb_rblen
);
1689 ISP_IOXPUT_16(isp
, src
->snscb_reserved0
, &dst
->snscb_reserved0
);
1690 ISP_IOXPUT_16(isp
, src
->snscb_addr
[0], &dst
->snscb_addr
[0]);
1691 ISP_IOXPUT_16(isp
, src
->snscb_addr
[1], &dst
->snscb_addr
[1]);
1692 ISP_IOXPUT_16(isp
, src
->snscb_addr
[2], &dst
->snscb_addr
[2]);
1693 ISP_IOXPUT_16(isp
, src
->snscb_addr
[3], &dst
->snscb_addr
[3]);
1694 ISP_IOXPUT_16(isp
, src
->snscb_sblen
, &dst
->snscb_sblen
);
1695 ISP_IOXPUT_16(isp
, src
->snscb_reserved1
, &dst
->snscb_reserved1
);
1696 ISP_IOXPUT_16(isp
, src
->snscb_cmd
, &dst
->snscb_cmd
);
1697 ISP_IOXPUT_16(isp
, src
->snscb_mword_div_2
, &dst
->snscb_mword_div_2
);
1698 ISP_IOXPUT_32(isp
, src
->snscb_reserved3
, &dst
->snscb_reserved3
);
1699 ISP_IOXPUT_32(isp
, src
->snscb_fc4_type
, &dst
->snscb_fc4_type
);
1703 isp_put_gxn_id_request(ispsoftc_t
*isp
, sns_gxn_id_req_t
*src
, sns_gxn_id_req_t
*dst
)
1705 ISP_IOXPUT_16(isp
, src
->snscb_rblen
, &dst
->snscb_rblen
);
1706 ISP_IOXPUT_16(isp
, src
->snscb_reserved0
, &dst
->snscb_reserved0
);
1707 ISP_IOXPUT_16(isp
, src
->snscb_addr
[0], &dst
->snscb_addr
[0]);
1708 ISP_IOXPUT_16(isp
, src
->snscb_addr
[1], &dst
->snscb_addr
[1]);
1709 ISP_IOXPUT_16(isp
, src
->snscb_addr
[2], &dst
->snscb_addr
[2]);
1710 ISP_IOXPUT_16(isp
, src
->snscb_addr
[3], &dst
->snscb_addr
[3]);
1711 ISP_IOXPUT_16(isp
, src
->snscb_sblen
, &dst
->snscb_sblen
);
1712 ISP_IOXPUT_16(isp
, src
->snscb_reserved1
, &dst
->snscb_reserved1
);
1713 ISP_IOXPUT_16(isp
, src
->snscb_cmd
, &dst
->snscb_cmd
);
1714 ISP_IOXPUT_16(isp
, src
->snscb_reserved2
, &dst
->snscb_reserved2
);
1715 ISP_IOXPUT_32(isp
, src
->snscb_reserved3
, &dst
->snscb_reserved3
);
1716 ISP_IOXPUT_32(isp
, src
->snscb_portid
, &dst
->snscb_portid
);
1720 * Generic SNS response - not particularly useful since the per-command data
1721 * isn't always 16 bit words.
1724 isp_get_sns_response(ispsoftc_t
*isp
, sns_scrsp_t
*src
, sns_scrsp_t
*dst
, int nwords
)
1727 isp_get_ct_hdr(isp
, &src
->snscb_cthdr
, &dst
->snscb_cthdr
);
1728 ISP_IOXGET_8(isp
, &src
->snscb_port_type
, dst
->snscb_port_type
);
1729 for (i
= 0; i
< 3; i
++) {
1730 ISP_IOXGET_8(isp
, &src
->snscb_port_id
[i
],
1731 dst
->snscb_port_id
[i
]);
1733 for (i
= 0; i
< 8; i
++) {
1734 ISP_IOXGET_8(isp
, &src
->snscb_portname
[i
],
1735 dst
->snscb_portname
[i
]);
1737 for (i
= 0; i
< nwords
; i
++) {
1738 ISP_IOXGET_16(isp
, &src
->snscb_data
[i
], dst
->snscb_data
[i
]);
1743 isp_get_gid_ft_response(ispsoftc_t
*isp
, sns_gid_ft_rsp_t
*src
, sns_gid_ft_rsp_t
*dst
, int nwords
)
1746 isp_get_ct_hdr(isp
, &src
->snscb_cthdr
, &dst
->snscb_cthdr
);
1747 for (i
= 0; i
< nwords
; i
++) {
1749 ISP_IOXGET_8(isp
, &src
->snscb_ports
[i
].control
, dst
->snscb_ports
[i
].control
);
1750 for (j
= 0; j
< 3; j
++) {
1751 ISP_IOXGET_8(isp
, &src
->snscb_ports
[i
].portid
[j
], dst
->snscb_ports
[i
].portid
[j
]);
1753 if (dst
->snscb_ports
[i
].control
& 0x80) {
1760 isp_get_gxn_id_response(ispsoftc_t
*isp
, sns_gxn_id_rsp_t
*src
, sns_gxn_id_rsp_t
*dst
)
1763 isp_get_ct_hdr(isp
, &src
->snscb_cthdr
, &dst
->snscb_cthdr
);
1764 for (i
= 0; i
< 8; i
++) {
1765 ISP_IOXGET_8(isp
, &src
->snscb_wwn
[i
], dst
->snscb_wwn
[i
]);
1770 isp_get_gff_id_response(ispsoftc_t
*isp
, sns_gff_id_rsp_t
*src
, sns_gff_id_rsp_t
*dst
)
1773 isp_get_ct_hdr(isp
, &src
->snscb_cthdr
, &dst
->snscb_cthdr
);
1774 for (i
= 0; i
< 32; i
++) {
1775 ISP_IOXGET_32(isp
, &src
->snscb_fc4_features
[i
], dst
->snscb_fc4_features
[i
]);
1780 isp_get_ga_nxt_response(ispsoftc_t
*isp
, sns_ga_nxt_rsp_t
*src
, sns_ga_nxt_rsp_t
*dst
)
1783 isp_get_ct_hdr(isp
, &src
->snscb_cthdr
, &dst
->snscb_cthdr
);
1784 ISP_IOXGET_8(isp
, &src
->snscb_port_type
, dst
->snscb_port_type
);
1785 for (i
= 0; i
< 3; i
++) {
1786 ISP_IOXGET_8(isp
, &src
->snscb_port_id
[i
], dst
->snscb_port_id
[i
]);
1788 for (i
= 0; i
< 8; i
++) {
1789 ISP_IOXGET_8(isp
, &src
->snscb_portname
[i
], dst
->snscb_portname
[i
]);
1791 ISP_IOXGET_8(isp
, &src
->snscb_pnlen
, dst
->snscb_pnlen
);
1792 for (i
= 0; i
< 255; i
++) {
1793 ISP_IOXGET_8(isp
, &src
->snscb_pname
[i
], dst
->snscb_pname
[i
]);
1795 for (i
= 0; i
< 8; i
++) {
1796 ISP_IOXGET_8(isp
, &src
->snscb_nodename
[i
], dst
->snscb_nodename
[i
]);
1798 ISP_IOXGET_8(isp
, &src
->snscb_nnlen
, dst
->snscb_nnlen
);
1799 for (i
= 0; i
< 255; i
++) {
1800 ISP_IOXGET_8(isp
, &src
->snscb_nname
[i
], dst
->snscb_nname
[i
]);
1802 for (i
= 0; i
< 8; i
++) {
1803 ISP_IOXGET_8(isp
, &src
->snscb_ipassoc
[i
], dst
->snscb_ipassoc
[i
]);
1805 for (i
= 0; i
< 16; i
++) {
1806 ISP_IOXGET_8(isp
, &src
->snscb_ipaddr
[i
], dst
->snscb_ipaddr
[i
]);
1808 for (i
= 0; i
< 4; i
++) {
1809 ISP_IOXGET_8(isp
, &src
->snscb_svc_class
[i
], dst
->snscb_svc_class
[i
]);
1811 for (i
= 0; i
< 32; i
++) {
1812 ISP_IOXGET_8(isp
, &src
->snscb_fc4_types
[i
], dst
->snscb_fc4_types
[i
]);
1814 for (i
= 0; i
< 8; i
++) {
1815 ISP_IOXGET_8(isp
, &src
->snscb_fpname
[i
], dst
->snscb_fpname
[i
]);
1817 ISP_IOXGET_8(isp
, &src
->snscb_reserved
, dst
->snscb_reserved
);
1818 for (i
= 0; i
< 3; i
++) {
1819 ISP_IOXGET_8(isp
, &src
->snscb_hardaddr
[i
], dst
->snscb_hardaddr
[i
]);
1824 isp_get_els(ispsoftc_t
*isp
, els_t
*src
, els_t
*dst
)
1828 isp_get_hdr(isp
, &src
->els_hdr
, &dst
->els_hdr
);
1829 ISP_IOXGET_32(isp
, &src
->els_handle
, dst
->els_handle
);
1830 ISP_IOXGET_16(isp
, &src
->els_status
, dst
->els_status
);
1831 ISP_IOXGET_16(isp
, &src
->els_nphdl
, dst
->els_nphdl
);
1832 ISP_IOXGET_16(isp
, &src
->els_xmit_dsd_count
, dst
->els_xmit_dsd_count
);
1833 ISP_IOXGET_8(isp
, &src
->els_vphdl
, dst
->els_vphdl
);
1834 ISP_IOXGET_8(isp
, &src
->els_sof
, dst
->els_sof
);
1835 ISP_IOXGET_32(isp
, &src
->els_rxid
, dst
->els_rxid
);
1836 ISP_IOXGET_16(isp
, &src
->els_recv_dsd_count
, dst
->els_recv_dsd_count
);
1837 ISP_IOXGET_8(isp
, &src
->els_opcode
, dst
->els_opcode
);
1838 ISP_IOXGET_8(isp
, &src
->els_reserved2
, dst
->els_reserved1
);
1839 ISP_IOXGET_8(isp
, &src
->els_did_lo
, dst
->els_did_lo
);
1840 ISP_IOXGET_8(isp
, &src
->els_did_mid
, dst
->els_did_mid
);
1841 ISP_IOXGET_8(isp
, &src
->els_did_hi
, dst
->els_did_hi
);
1842 ISP_IOXGET_8(isp
, &src
->els_reserved2
, dst
->els_reserved2
);
1843 ISP_IOXGET_16(isp
, &src
->els_reserved3
, dst
->els_reserved3
);
1844 ISP_IOXGET_16(isp
, &src
->els_ctl_flags
, dst
->els_ctl_flags
);
1845 ISP_IOXGET_32(isp
, &src
->els_bytecnt
, dst
->els_bytecnt
);
1846 ISP_IOXGET_32(isp
, &src
->els_subcode1
, dst
->els_subcode1
);
1847 ISP_IOXGET_32(isp
, &src
->els_subcode2
, dst
->els_subcode2
);
1848 for (i
= 0; i
< 20; i
++) {
1849 ISP_IOXGET_8(isp
, &src
->els_reserved4
[i
], dst
->els_reserved4
[i
]);
1854 isp_put_els(ispsoftc_t
*isp
, els_t
*src
, els_t
*dst
)
1856 isp_put_hdr(isp
, &src
->els_hdr
, &dst
->els_hdr
);
1857 ISP_IOXPUT_32(isp
, src
->els_handle
, &dst
->els_handle
);
1858 ISP_IOXPUT_16(isp
, src
->els_status
, &dst
->els_status
);
1859 ISP_IOXPUT_16(isp
, src
->els_nphdl
, &dst
->els_nphdl
);
1860 ISP_IOXPUT_16(isp
, src
->els_xmit_dsd_count
, &dst
->els_xmit_dsd_count
);
1861 ISP_IOXPUT_8(isp
, src
->els_vphdl
, &dst
->els_vphdl
);
1862 ISP_IOXPUT_8(isp
, src
->els_sof
, &dst
->els_sof
);
1863 ISP_IOXPUT_32(isp
, src
->els_rxid
, &dst
->els_rxid
);
1864 ISP_IOXPUT_16(isp
, src
->els_recv_dsd_count
, &dst
->els_recv_dsd_count
);
1865 ISP_IOXPUT_8(isp
, src
->els_opcode
, &dst
->els_opcode
);
1866 ISP_IOXPUT_8(isp
, src
->els_reserved2
, &dst
->els_reserved1
);
1867 ISP_IOXPUT_8(isp
, src
->els_did_lo
, &dst
->els_did_lo
);
1868 ISP_IOXPUT_8(isp
, src
->els_did_mid
, &dst
->els_did_mid
);
1869 ISP_IOXPUT_8(isp
, src
->els_did_hi
, &dst
->els_did_hi
);
1870 ISP_IOXPUT_8(isp
, src
->els_reserved2
, &dst
->els_reserved2
);
1871 ISP_IOXPUT_16(isp
, src
->els_reserved3
, &dst
->els_reserved3
);
1872 ISP_IOXPUT_16(isp
, src
->els_ctl_flags
, &dst
->els_ctl_flags
);
1873 ISP_IOXPUT_32(isp
, src
->els_recv_bytecnt
, &dst
->els_recv_bytecnt
);
1874 ISP_IOXPUT_32(isp
, src
->els_xmit_bytecnt
, &dst
->els_xmit_bytecnt
);
1875 ISP_IOXPUT_32(isp
, src
->els_xmit_dsd_length
, &dst
->els_xmit_dsd_length
);
1876 ISP_IOXPUT_16(isp
, src
->els_xmit_dsd_a1500
, &dst
->els_xmit_dsd_a1500
);
1877 ISP_IOXPUT_16(isp
, src
->els_xmit_dsd_a3116
, &dst
->els_xmit_dsd_a3116
);
1878 ISP_IOXPUT_16(isp
, src
->els_xmit_dsd_a4732
, &dst
->els_xmit_dsd_a4732
);
1879 ISP_IOXPUT_16(isp
, src
->els_xmit_dsd_a6348
, &dst
->els_xmit_dsd_a6348
);
1880 ISP_IOXPUT_32(isp
, src
->els_recv_dsd_length
, &dst
->els_recv_dsd_length
);
1881 ISP_IOXPUT_16(isp
, src
->els_recv_dsd_a1500
, &dst
->els_recv_dsd_a1500
);
1882 ISP_IOXPUT_16(isp
, src
->els_recv_dsd_a3116
, &dst
->els_recv_dsd_a3116
);
1883 ISP_IOXPUT_16(isp
, src
->els_recv_dsd_a4732
, &dst
->els_recv_dsd_a4732
);
1884 ISP_IOXPUT_16(isp
, src
->els_recv_dsd_a6348
, &dst
->els_recv_dsd_a6348
);
1888 * FC Structure Canonicalization
1892 isp_get_fc_hdr(ispsoftc_t
*isp
, fc_hdr_t
*src
, fc_hdr_t
*dst
)
1894 ISP_IOZGET_8(isp
, &src
->r_ctl
, dst
->r_ctl
);
1895 ISP_IOZGET_8(isp
, &src
->d_id
[0], dst
->d_id
[0]);
1896 ISP_IOZGET_8(isp
, &src
->d_id
[1], dst
->d_id
[1]);
1897 ISP_IOZGET_8(isp
, &src
->d_id
[2], dst
->d_id
[2]);
1898 ISP_IOZGET_8(isp
, &src
->cs_ctl
, dst
->cs_ctl
);
1899 ISP_IOZGET_8(isp
, &src
->s_id
[0], dst
->s_id
[0]);
1900 ISP_IOZGET_8(isp
, &src
->s_id
[1], dst
->s_id
[1]);
1901 ISP_IOZGET_8(isp
, &src
->s_id
[2], dst
->s_id
[2]);
1902 ISP_IOZGET_8(isp
, &src
->type
, dst
->type
);
1903 ISP_IOZGET_8(isp
, &src
->f_ctl
[0], dst
->f_ctl
[0]);
1904 ISP_IOZGET_8(isp
, &src
->f_ctl
[1], dst
->f_ctl
[1]);
1905 ISP_IOZGET_8(isp
, &src
->f_ctl
[2], dst
->f_ctl
[2]);
1906 ISP_IOZGET_8(isp
, &src
->seq_id
, dst
->seq_id
);
1907 ISP_IOZGET_8(isp
, &src
->df_ctl
, dst
->df_ctl
);
1908 ISP_IOZGET_16(isp
, &src
->seq_cnt
, dst
->seq_cnt
);
1909 ISP_IOZGET_16(isp
, &src
->ox_id
, dst
->ox_id
);
1910 ISP_IOZGET_16(isp
, &src
->rx_id
, dst
->rx_id
);
1911 ISP_IOZGET_32(isp
, &src
->parameter
, dst
->parameter
);
1915 isp_get_fcp_cmnd_iu(ispsoftc_t
*isp
, fcp_cmnd_iu_t
*src
, fcp_cmnd_iu_t
*dst
)
1919 for (i
= 0; i
< 8; i
++) {
1920 ISP_IOZGET_8(isp
, &src
->fcp_cmnd_lun
[i
], dst
->fcp_cmnd_lun
[i
]);
1922 ISP_IOZGET_8(isp
, &src
->fcp_cmnd_crn
, dst
->fcp_cmnd_crn
);
1923 ISP_IOZGET_8(isp
, &src
->fcp_cmnd_task_attribute
, dst
->fcp_cmnd_task_attribute
);
1924 ISP_IOZGET_8(isp
, &src
->fcp_cmnd_task_management
, dst
->fcp_cmnd_task_management
);
1925 ISP_IOZGET_8(isp
, &src
->fcp_cmnd_alen_datadir
, dst
->fcp_cmnd_alen_datadir
);
1926 for (i
= 0; i
< 16; i
++) {
1927 ISP_IOZGET_8(isp
, &src
->cdb_dl
.sf
.fcp_cmnd_cdb
[i
], dst
->cdb_dl
.sf
.fcp_cmnd_cdb
[i
]);
1929 ISP_IOZGET_32(isp
, &src
->cdb_dl
.sf
.fcp_cmnd_dl
, dst
->cdb_dl
.sf
.fcp_cmnd_dl
);
1933 isp_put_rft_id(ispsoftc_t
*isp
, rft_id_t
*src
, rft_id_t
*dst
)
1936 isp_put_ct_hdr(isp
, &src
->rftid_hdr
, &dst
->rftid_hdr
);
1937 ISP_IOZPUT_8(isp
, src
->rftid_reserved
, &dst
->rftid_reserved
);
1938 for (i
= 0; i
< 3; i
++) {
1939 ISP_IOZPUT_8(isp
, src
->rftid_portid
[i
], &dst
->rftid_portid
[i
]);
1941 for (i
= 0; i
< 8; i
++) {
1942 ISP_IOZPUT_32(isp
, src
->rftid_fc4types
[i
], &dst
->rftid_fc4types
[i
]);
1947 isp_get_ct_hdr(ispsoftc_t
*isp
, ct_hdr_t
*src
, ct_hdr_t
*dst
)
1949 ISP_IOZGET_8(isp
, &src
->ct_revision
, dst
->ct_revision
);
1950 ISP_IOZGET_8(isp
, &src
->ct_in_id
[0], dst
->ct_in_id
[0]);
1951 ISP_IOZGET_8(isp
, &src
->ct_in_id
[1], dst
->ct_in_id
[1]);
1952 ISP_IOZGET_8(isp
, &src
->ct_in_id
[2], dst
->ct_in_id
[2]);
1953 ISP_IOZGET_8(isp
, &src
->ct_fcs_type
, dst
->ct_fcs_type
);
1954 ISP_IOZGET_8(isp
, &src
->ct_fcs_subtype
, dst
->ct_fcs_subtype
);
1955 ISP_IOZGET_8(isp
, &src
->ct_options
, dst
->ct_options
);
1956 ISP_IOZGET_8(isp
, &src
->ct_reserved0
, dst
->ct_reserved0
);
1957 ISP_IOZGET_16(isp
, &src
->ct_cmd_resp
, dst
->ct_cmd_resp
);
1958 ISP_IOZGET_16(isp
, &src
->ct_bcnt_resid
, dst
->ct_bcnt_resid
);
1959 ISP_IOZGET_8(isp
, &src
->ct_reserved1
, dst
->ct_reserved1
);
1960 ISP_IOZGET_8(isp
, &src
->ct_reason
, dst
->ct_reason
);
1961 ISP_IOZGET_8(isp
, &src
->ct_explanation
, dst
->ct_explanation
);
1962 ISP_IOZGET_8(isp
, &src
->ct_vunique
, dst
->ct_vunique
);
1966 isp_put_ct_hdr(ispsoftc_t
*isp
, ct_hdr_t
*src
, ct_hdr_t
*dst
)
1968 ISP_IOZPUT_8(isp
, src
->ct_revision
, &dst
->ct_revision
);
1969 ISP_IOZPUT_8(isp
, src
->ct_in_id
[0], &dst
->ct_in_id
[0]);
1970 ISP_IOZPUT_8(isp
, src
->ct_in_id
[1], &dst
->ct_in_id
[1]);
1971 ISP_IOZPUT_8(isp
, src
->ct_in_id
[2], &dst
->ct_in_id
[2]);
1972 ISP_IOZPUT_8(isp
, src
->ct_fcs_type
, &dst
->ct_fcs_type
);
1973 ISP_IOZPUT_8(isp
, src
->ct_fcs_subtype
, &dst
->ct_fcs_subtype
);
1974 ISP_IOZPUT_8(isp
, src
->ct_options
, &dst
->ct_options
);
1975 ISP_IOZPUT_8(isp
, src
->ct_reserved0
, &dst
->ct_reserved0
);
1976 ISP_IOZPUT_16(isp
, src
->ct_cmd_resp
, &dst
->ct_cmd_resp
);
1977 ISP_IOZPUT_16(isp
, src
->ct_bcnt_resid
, &dst
->ct_bcnt_resid
);
1978 ISP_IOZPUT_8(isp
, src
->ct_reserved1
, &dst
->ct_reserved1
);
1979 ISP_IOZPUT_8(isp
, src
->ct_reason
, &dst
->ct_reason
);
1980 ISP_IOZPUT_8(isp
, src
->ct_explanation
, &dst
->ct_explanation
);
1981 ISP_IOZPUT_8(isp
, src
->ct_vunique
, &dst
->ct_vunique
);
1984 #ifdef ISP_TARGET_MODE
1987 * Command shipping- finish off first queue entry and do dma mapping and
1988 * additional segments as needed.
1990 * Called with the first queue entry at least partially filled out.
1993 isp_send_tgt_cmd(ispsoftc_t
*isp
, void *fqe
, void *segp
, uint32_t nsegs
, uint32_t totalcnt
, isp_ddir_t ddir
, void *snsptr
, uint32_t snslen
)
1995 uint8_t storage
[QENTRY_LEN
], storage2
[QENTRY_LEN
];
1997 uint32_t seg
, curseg
, seglim
, nxt
, nxtnxt
;
1998 ispds_t
*dsp
= NULL
;
1999 ispds64_t
*dsp64
= NULL
;
2000 void *qe0
, *qe1
, *sqe
= NULL
;
2002 qe0
= isp_getrqentry(isp
);
2004 return (CMD_EAGAIN
);
2006 nxt
= ISP_NXT_QENTRY(isp
->isp_reqidx
, RQUEST_QUEUE_LEN(isp
));
2008 type
= ((isphdr_t
*)fqe
)->rqs_entry_type
;
2013 * If we have no data to transmit, just copy the first IOCB and start it up.
2015 if (ddir
!= ISP_NOXFR
) {
2017 * First, figure out how many pieces of data to transfer and what kind and how many we can put into the first queue entry.
2021 dsp
= ((ct_entry_t
*)fqe
)->ct_dataseg
;
2022 seglim
= ISP_RQDSEG
;
2027 ct2_entry_t
*ct
= fqe
, *ct2
= (ct2_entry_t
*) storage2
;
2028 uint16_t swd
= ct
->rsp
.m0
.ct_scsi_status
& 0xff;
2030 if ((ct
->ct_flags
& CT2_SENDSTATUS
) && (swd
|| ct
->ct_resid
)) {
2031 memcpy(ct2
, ct
, QENTRY_LEN
);
2033 * Clear fields from first CTIO2 that now need to be cleared
2035 ct
->ct_header
.rqs_seqno
= 0;
2036 ct
->ct_flags
&= ~(CT2_SENDSTATUS
|CT2_CCINCR
|CT2_FASTPOST
);
2038 ct
->ct_syshandle
= 0;
2039 ct
->rsp
.m0
.ct_scsi_status
= 0;
2042 * Reset fields in the second CTIO2 as appropriate.
2044 ct2
->ct_flags
&= ~(CT2_FLAG_MMASK
|CT2_DATAMASK
|CT2_FASTPOST
);
2045 ct2
->ct_flags
|= CT2_NO_DATA
|CT2_FLAG_MODE1
;
2046 ct2
->ct_seg_count
= 0;
2048 memset(&ct2
->rsp
, 0, sizeof (ct2
->rsp
));
2049 if (swd
== SCSI_CHECK
&& snsptr
&& snslen
) {
2050 ct2
->rsp
.m1
.ct_senselen
= min(snslen
, MAXRESPLEN
);
2051 memcpy(ct2
->rsp
.m1
.ct_resp
, snsptr
, ct2
->rsp
.m1
.ct_senselen
);
2052 swd
|= CT2_SNSLEN_VALID
;
2054 if (ct2
->ct_resid
> 0) {
2055 swd
|= CT2_DATA_UNDER
;
2056 } else if (ct2
->ct_resid
< 0) {
2057 swd
|= CT2_DATA_OVER
;
2059 ct2
->rsp
.m1
.ct_scsi_status
= swd
;
2062 if (type
== RQSTYPE_CTIO2
) {
2063 dsp
= ct
->rsp
.m0
.u
.ct_dataseg
;
2064 seglim
= ISP_RQDSEG_T2
;
2066 dsp64
= ct
->rsp
.m0
.u
.ct_dataseg64
;
2067 seglim
= ISP_RQDSEG_T3
;
2073 ct7_entry_t
*ct
= fqe
, *ct2
= (ct7_entry_t
*)storage2
;
2074 uint16_t swd
= ct
->ct_scsi_status
& 0xff;
2076 dsp64
= &ct
->rsp
.m0
.ds
;
2078 if ((ct
->ct_flags
& CT7_SENDSTATUS
) && (swd
|| ct
->ct_resid
)) {
2079 memcpy(ct2
, ct
, sizeof (ct7_entry_t
));
2082 * Clear fields from first CTIO7 that now need to be cleared
2084 ct
->ct_header
.rqs_seqno
= 0;
2085 ct
->ct_flags
&= ~CT7_SENDSTATUS
;
2087 ct
->ct_syshandle
= 0;
2088 ct
->ct_scsi_status
= 0;
2091 * Reset fields in the second CTIO7 as appropriate.
2093 ct2
->ct_flags
&= ~(CT7_FLAG_MMASK
|CT7_DATAMASK
);
2094 ct2
->ct_flags
|= CT7_NO_DATA
|CT7_NO_DATA
|CT7_FLAG_MODE1
;
2095 ct2
->ct_seg_count
= 0;
2096 memset(&ct2
->rsp
, 0, sizeof (ct2
->rsp
));
2097 if (swd
== SCSI_CHECK
&& snsptr
&& snslen
) {
2098 ct2
->rsp
.m1
.ct_resplen
= min(snslen
, MAXRESPLEN_24XX
);
2099 memcpy(ct2
->rsp
.m1
.ct_resp
, snsptr
, ct2
->rsp
.m1
.ct_resplen
);
2100 swd
|= (FCP_SNSLEN_VALID
<< 8);
2102 if (ct2
->ct_resid
< 0) {
2103 swd
|= (FCP_RESID_OVERFLOW
<< 8);
2104 } else if (ct2
->ct_resid
> 0) {
2105 swd
|= (FCP_RESID_UNDERFLOW
<< 8);
2107 ct2
->ct_scsi_status
= swd
;
2113 return (CMD_COMPLETE
);
2118 * Fill out the data transfer stuff in the first queue entry
2120 if (seglim
> nsegs
) {
2124 for (seg
= curseg
= 0; curseg
< seglim
; curseg
++) {
2126 XS_GET_DMA64_SEG(dsp64
++, segp
, seg
++);
2128 XS_GET_DMA_SEG(dsp
++, segp
, seg
++);
2133 * First, if we are sending status with data and we have a non-zero
2134 * status or non-zero residual, we have to make a synthetic extra CTIO
2135 * that contains the status that we'll ship separately (FC cards only).
2139 * Second, start building additional continuation segments as needed.
2141 while (seg
< nsegs
) {
2142 nxtnxt
= ISP_NXT_QENTRY(nxt
, RQUEST_QUEUE_LEN(isp
));
2143 if (nxtnxt
== isp
->isp_reqodx
) {
2144 return (CMD_EAGAIN
);
2146 ISP_MEMZERO(storage
, QENTRY_LEN
);
2147 qe1
= ISP_QUEUE_ENTRY(isp
->isp_rquest
, nxt
);
2150 ispcontreq64_t
*crq
= (ispcontreq64_t
*) storage
;
2151 seglim
= ISP_CDSEG64
;
2152 crq
->req_header
.rqs_entry_type
= RQSTYPE_A64_CONT
;
2153 crq
->req_header
.rqs_entry_count
= 1;
2154 dsp64
= crq
->req_dataseg
;
2156 ispcontreq_t
*crq
= (ispcontreq_t
*) storage
;
2158 crq
->req_header
.rqs_entry_type
= RQSTYPE_DATASEG
;
2159 crq
->req_header
.rqs_entry_count
= 1;
2160 dsp
= crq
->req_dataseg
;
2162 if (seg
+ seglim
> nsegs
) {
2163 seglim
= nsegs
- seg
;
2165 for (curseg
= 0; curseg
< seglim
; curseg
++) {
2167 XS_GET_DMA64_SEG(dsp64
++, segp
, seg
++);
2169 XS_GET_DMA_SEG(dsp
++, segp
, seg
++);
2173 isp_put_cont64_req(isp
, (ispcontreq64_t
*)storage
, qe1
);
2175 isp_put_cont_req(isp
, (ispcontreq_t
*)storage
, qe1
);
2177 if (isp
->isp_dblev
& ISP_LOGTDEBUG1
) {
2178 isp_print_bytes(isp
, "additional queue entry", QENTRY_LEN
, storage
);
2184 * If we have a synthetic queue entry to complete things, do it here.
2187 nxtnxt
= ISP_NXT_QENTRY(nxt
, RQUEST_QUEUE_LEN(isp
));
2188 if (nxtnxt
== isp
->isp_reqodx
) {
2189 return (CMD_EAGAIN
);
2191 qe1
= ISP_QUEUE_ENTRY(isp
->isp_rquest
, nxt
);
2193 if (type
== RQSTYPE_CTIO7
) {
2194 isp_put_ctio7(isp
, sqe
, qe1
);
2196 isp_put_ctio2(isp
, sqe
, qe1
);
2198 if (isp
->isp_dblev
& ISP_LOGTDEBUG1
) {
2199 isp_print_bytes(isp
, "synthetic final queue entry", QENTRY_LEN
, storage2
);
2203 ((isphdr_t
*)fqe
)->rqs_entry_count
= nqe
;
2206 ((ct_entry_t
*)fqe
)->ct_seg_count
= nsegs
;
2207 isp_put_ctio(isp
, fqe
, qe0
);
2211 ((ct2_entry_t
*)fqe
)->ct_seg_count
= nsegs
;
2212 if (ISP_CAP_2KLOGIN(isp
)) {
2213 isp_put_ctio2e(isp
, fqe
, qe0
);
2215 isp_put_ctio2(isp
, fqe
, qe0
);
2219 ((ct7_entry_t
*)fqe
)->ct_seg_count
= nsegs
;
2220 isp_put_ctio7(isp
, fqe
, qe0
);
2223 return (CMD_COMPLETE
);
2225 if (isp
->isp_dblev
& ISP_LOGTDEBUG1
) {
2226 isp_print_bytes(isp
, "first queue entry", QENTRY_LEN
, fqe
);
2228 ISP_ADD_REQUEST(isp
, nxt
);
2229 return (CMD_QUEUED
);
2233 isp_allocate_xs_tgt(ispsoftc_t
*isp
, void *xs
, uint32_t *handlep
)
2237 hdp
= isp
->isp_tgtfree
;
2241 isp
->isp_tgtfree
= hdp
->cmd
;
2243 hdp
->handle
= (hdp
- isp
->isp_tgtlist
);
2244 hdp
->handle
|= (ISP_HANDLE_TARGET
<< ISP_HANDLE_USAGE_SHIFT
);
2246 * Target handles for SCSI cards are only 16 bits, so
2247 * sequence number protection will be ommitted.
2250 hdp
->handle
|= (isp
->isp_seqno
++ << ISP_HANDLE_SEQ_SHIFT
);
2252 *handlep
= hdp
->handle
;
2257 isp_find_xs_tgt(ispsoftc_t
*isp
, uint32_t handle
)
2259 if (!ISP_VALID_TGT_HANDLE(isp
, handle
)) {
2260 isp_prt(isp
, ISP_LOGERR
, "%s: bad handle 0x%x", __func__
, handle
);
2263 return (isp
->isp_tgtlist
[(handle
& ISP_HANDLE_CMD_MASK
)].cmd
);
2267 isp_find_tgt_handle(ispsoftc_t
*isp
, void *xs
)
2269 uint32_t i
, foundhdl
= ISP_HANDLE_FREE
;
2272 for (i
= 0; i
< isp
->isp_maxcmds
; i
++) {
2273 if (isp
->isp_tgtlist
[i
].cmd
!= xs
) {
2276 foundhdl
= isp
->isp_tgtlist
[i
].handle
;
2284 isp_destroy_tgt_handle(ispsoftc_t
*isp
, uint32_t handle
)
2286 if (!ISP_VALID_TGT_HANDLE(isp
, handle
)) {
2287 isp_prt(isp
, ISP_LOGERR
, "%s: bad handle 0x%x", __func__
, handle
);
2289 isp
->isp_tgtlist
[(handle
& ISP_HANDLE_CMD_MASK
)].handle
= ISP_HANDLE_FREE
;
2290 isp
->isp_tgtlist
[(handle
& ISP_HANDLE_CMD_MASK
)].cmd
= isp
->isp_tgtfree
;
2291 isp
->isp_tgtfree
= &isp
->isp_tgtlist
[(handle
& ISP_HANDLE_CMD_MASK
)];
2296 * Find target mode entries
2299 isp_find_pdb_by_wwn(ispsoftc_t
*isp
, int chan
, uint64_t wwn
, fcportdb_t
**lptr
)
2304 if (chan
< isp
->isp_nchan
) {
2305 fcp
= FCPARAM(isp
, chan
);
2306 for (i
= 0; i
< MAX_FC_TARG
; i
++) {
2307 fcportdb_t
*lp
= &fcp
->portdb
[i
];
2309 if (lp
->target_mode
== 0) {
2312 if (lp
->port_wwn
== wwn
) {
2322 isp_find_pdb_by_loopid(ispsoftc_t
*isp
, int chan
, uint32_t loopid
, fcportdb_t
**lptr
)
2327 if (chan
< isp
->isp_nchan
) {
2328 fcp
= FCPARAM(isp
, chan
);
2329 for (i
= 0; i
< MAX_FC_TARG
; i
++) {
2330 fcportdb_t
*lp
= &fcp
->portdb
[i
];
2332 if (lp
->target_mode
== 0) {
2335 if (lp
->handle
== loopid
) {
2345 isp_find_pdb_by_sid(ispsoftc_t
*isp
, int chan
, uint32_t sid
, fcportdb_t
**lptr
)
2350 if (chan
>= isp
->isp_nchan
) {
2354 fcp
= FCPARAM(isp
, chan
);
2355 for (i
= 0; i
< MAX_FC_TARG
; i
++) {
2356 fcportdb_t
*lp
= &fcp
->portdb
[i
];
2358 if (lp
->target_mode
== 0) {
2361 if (lp
->portid
== sid
) {
2370 isp_find_chan_by_did(ispsoftc_t
*isp
, uint32_t did
, uint16_t *cp
)
2375 for (chan
= 0; chan
< isp
->isp_nchan
; chan
++) {
2376 fcparam
*fcp
= FCPARAM(isp
, chan
);
2377 if ((fcp
->role
& ISP_ROLE_TARGET
) == 0 || fcp
->isp_fwstate
!= FW_READY
|| fcp
->isp_loopstate
< LOOP_PDB_RCVD
) {
2380 if (fcp
->isp_portid
== did
) {
2388 * Add an initiator device to the port database
2391 isp_add_wwn_entry(ispsoftc_t
*isp
, int chan
, uint64_t ini
, uint16_t nphdl
, uint32_t s_id
)
2398 fcp
= FCPARAM(isp
, chan
);
2400 if (nphdl
>= MAX_NPORT_HANDLE
) {
2401 isp_prt(isp
, ISP_LOGWARN
, "%s: Chan %d IID 0x%016llx bad N-Port handle 0x%04x Port ID 0x%06x",
2402 __func__
, chan
, (unsigned long long) ini
, nphdl
, s_id
);
2407 if (fcp
->isp_tgt_map
[nphdl
]) {
2408 lp
= &fcp
->portdb
[fcp
->isp_tgt_map
[nphdl
] - 1];
2411 * Make sure the addition of a new target mode entry doesn't duplicate entries
2412 * with the same N-Port handles, the same portids or the same Port WWN.
2414 for (i
= 0; i
< MAX_FC_TARG
; i
++) {
2415 lp
= &fcp
->portdb
[i
];
2416 if (lp
->target_mode
== 0) {
2420 if (lp
->handle
== nphdl
) {
2423 if (s_id
!= PORT_ANY
&& lp
->portid
== s_id
) {
2426 if (VALID_INI(ini
) && lp
->port_wwn
== ini
) {
2436 if (lp
->handle
!= nphdl
) {
2437 isp_prt(isp
, ISP_LOGWARN
, "%s: Chan %d attempt to re-enter N-port handle 0x%04x IID 0x%016llx Port ID 0x%06x finds IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x",
2438 __func__
, chan
, nphdl
, (unsigned long long)ini
, s_id
, (unsigned long long) lp
->port_wwn
, lp
->handle
, lp
->portid
);
2439 isp_dump_portdb(isp
, chan
);
2442 if (s_id
!= PORT_NONE
) {
2443 if (lp
->portid
== PORT_NONE
) {
2445 isp_prt(isp
, ISP_LOGTINFO
, "%s: Chan %d N-port handle 0x%04x gets Port ID 0x%06x", __func__
, chan
, nphdl
, s_id
);
2447 } else if (lp
->portid
!= s_id
) {
2448 isp_prt(isp
, ISP_LOGTINFO
, "%s: Chan %d N-port handle 0x%04x tries to change Port ID 0x%06x to 0x%06x", __func__
, chan
, nphdl
,
2450 isp_dump_portdb(isp
, chan
);
2454 if (VALID_INI(ini
)) {
2455 if (!VALID_INI(lp
->port_wwn
)) {
2457 isp_prt(isp
, ISP_LOGTINFO
, "%s: Chan %d N-port handle 0x%04x gets WWN 0x%016llxx", __func__
, chan
, nphdl
, (unsigned long long) ini
);
2459 } else if (lp
->port_wwn
!= ini
) {
2460 isp_prt(isp
, ISP_LOGWARN
, "%s: Chan %d N-port handle 0x%04x tries to change WWN 0x%016llx to 0x%016llx", __func__
, chan
, nphdl
,
2461 (unsigned long long) lp
->port_wwn
, (unsigned long long) ini
);
2462 isp_dump_portdb(isp
, chan
);
2468 isp_prt(isp
, ISP_LOGWARN
, "%s: Chan %d IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x reentered", __func__
, chan
,
2469 (unsigned long long) lp
->port_wwn
, lp
->handle
, lp
->portid
);
2477 for (i
= MAX_FC_TARG
- 1; i
>= 0; i
--) {
2478 if (fcp
->portdb
[i
].target_mode
== 1) {
2481 if (fcp
->portdb
[i
].state
== FC_PORTDB_STATE_NIL
) {
2486 isp_prt(isp
, ISP_LOGWARN
, "%s: Chan %d IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x- no room in port database",
2487 __func__
, chan
, (unsigned long long) ini
, nphdl
, s_id
);
2491 lp
= &fcp
->portdb
[i
];
2492 ISP_MEMZERO(lp
, sizeof (fcportdb_t
));
2493 lp
->target_mode
= 1;
2497 fcp
->isp_tgt_map
[nphdl
] = i
+ 1;
2499 isp_prt(isp
, ISP_LOGTINFO
, "%s: Chan %d IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x vtgt %d added", __func__
, chan
, (unsigned long long) ini
, nphdl
, s_id
, fcp
->isp_tgt_map
[nphdl
] - 1);
2501 ISP_MEMZERO(&nt
, sizeof (nt
));
2504 nt
.nt_tgt
= FCPARAM(isp
, chan
)->isp_wwpn
;
2506 nt
.nt_did
= FCPARAM(isp
, chan
)->isp_portid
;
2507 nt
.nt_nphdl
= nphdl
;
2508 nt
.nt_channel
= chan
;
2509 nt
.nt_ncode
= NT_ARRIVED
;
2510 isp_async(isp
, ISPASYNC_TARGET_NOTIFY
, &nt
);
2514 * Remove a target device to the port database
2517 isp_del_wwn_entry(ispsoftc_t
*isp
, int chan
, uint64_t ini
, uint16_t nphdl
, uint32_t s_id
)
2523 if (nphdl
>= MAX_NPORT_HANDLE
) {
2524 isp_prt(isp
, ISP_LOGWARN
, "%s: Chan %d IID 0x%016llx bad N-Port handle 0x%04x Port ID 0x%06x",
2525 __func__
, chan
, (unsigned long long) ini
, nphdl
, s_id
);
2529 fcp
= FCPARAM(isp
, chan
);
2530 if (fcp
->isp_tgt_map
[nphdl
] == 0) {
2533 lp
= &fcp
->portdb
[fcp
->isp_tgt_map
[nphdl
] - 1];
2534 if (lp
->target_mode
== 0) {
2539 isp_prt(isp
, ISP_LOGWARN
, "%s: Chan %d IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x cannot be found to be cleared",
2540 __func__
, chan
, (unsigned long long) ini
, nphdl
, s_id
);
2541 isp_dump_portdb(isp
, chan
);
2544 isp_prt(isp
, ISP_LOGTINFO
, "%s: Chan %d IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x vtgt %d cleared",
2545 __func__
, chan
, (unsigned long long) lp
->port_wwn
, nphdl
, lp
->portid
, fcp
->isp_tgt_map
[nphdl
] - 1);
2546 fcp
->isp_tgt_map
[nphdl
] = 0;
2548 ISP_MEMZERO(&nt
, sizeof (nt
));
2550 nt
.nt_wwn
= lp
->port_wwn
;
2551 nt
.nt_tgt
= FCPARAM(isp
, chan
)->isp_wwpn
;
2552 nt
.nt_sid
= lp
->portid
;
2553 nt
.nt_did
= FCPARAM(isp
, chan
)->isp_portid
;
2554 nt
.nt_nphdl
= nphdl
;
2555 nt
.nt_channel
= chan
;
2556 nt
.nt_ncode
= NT_DEPARTED
;
2557 isp_async(isp
, ISPASYNC_TARGET_NOTIFY
, &nt
);
2561 isp_del_all_wwn_entries(ispsoftc_t
*isp
, int chan
)
2571 * Handle iterations over all channels via recursion
2573 if (chan
== ISP_NOCHAN
) {
2574 for (chan
= 0; chan
< isp
->isp_nchan
; chan
++) {
2575 isp_del_all_wwn_entries(isp
, chan
);
2580 if (chan
> isp
->isp_nchan
) {
2584 fcp
= FCPARAM(isp
, chan
);
2588 for (i
= 0; i
< MAX_NPORT_HANDLE
; i
++) {
2589 if (fcp
->isp_tgt_map
[i
]) {
2590 fcportdb_t
*lp
= &fcp
->portdb
[fcp
->isp_tgt_map
[i
] - 1];
2591 isp_del_wwn_entry(isp
, chan
, lp
->port_wwn
, lp
->handle
, lp
->portid
);
2597 isp_del_wwn_entries(ispsoftc_t
*isp
, isp_notify_t
*mp
)
2602 * Handle iterations over all channels via recursion
2604 if (mp
->nt_channel
== ISP_NOCHAN
) {
2605 for (mp
->nt_channel
= 0; mp
->nt_channel
< isp
->isp_nchan
; mp
->nt_channel
++) {
2606 isp_del_wwn_entries(isp
, mp
);
2608 mp
->nt_channel
= ISP_NOCHAN
;
2613 * We have an entry which is only partially identified.
2615 * It's only known by WWN, N-Port handle, or Port ID.
2616 * We need to find the actual entry so we can delete it.
2618 if (mp
->nt_nphdl
!= NIL_HANDLE
) {
2619 if (isp_find_pdb_by_loopid(isp
, mp
->nt_channel
, mp
->nt_nphdl
, &lp
)) {
2620 isp_del_wwn_entry(isp
, mp
->nt_channel
, lp
->port_wwn
, lp
->handle
, lp
->portid
);
2624 if (mp
->nt_wwn
!= INI_ANY
) {
2625 if (isp_find_pdb_by_wwn(isp
, mp
->nt_channel
, mp
->nt_wwn
, &lp
)) {
2626 isp_del_wwn_entry(isp
, mp
->nt_channel
, lp
->port_wwn
, lp
->handle
, lp
->portid
);
2630 if (mp
->nt_sid
!= PORT_ANY
&& mp
->nt_sid
!= PORT_NONE
) {
2631 if (isp_find_pdb_by_sid(isp
, mp
->nt_channel
, mp
->nt_sid
, &lp
)) {
2632 isp_del_wwn_entry(isp
, mp
->nt_channel
, lp
->port_wwn
, lp
->handle
, lp
->portid
);
2636 isp_prt(isp
, ISP_LOGWARN
, "%s: Chan %d unable to find entry to delete N-port handle 0x%04x initiator WWN 0x%016llx Port ID 0x%06x", __func__
,
2637 mp
->nt_channel
, mp
->nt_nphdl
, (unsigned long long) mp
->nt_wwn
, mp
->nt_sid
);
2641 isp_put_atio(ispsoftc_t
*isp
, at_entry_t
*src
, at_entry_t
*dst
)
2644 isp_put_hdr(isp
, &src
->at_header
, &dst
->at_header
);
2645 ISP_IOXPUT_16(isp
, src
->at_reserved
, &dst
->at_reserved
);
2646 ISP_IOXPUT_16(isp
, src
->at_handle
, &dst
->at_handle
);
2647 if (ISP_IS_SBUS(isp
)) {
2648 ISP_IOXPUT_8(isp
, src
->at_lun
, &dst
->at_iid
);
2649 ISP_IOXPUT_8(isp
, src
->at_iid
, &dst
->at_lun
);
2650 ISP_IOXPUT_8(isp
, src
->at_cdblen
, &dst
->at_tgt
);
2651 ISP_IOXPUT_8(isp
, src
->at_tgt
, &dst
->at_cdblen
);
2652 ISP_IOXPUT_8(isp
, src
->at_status
, &dst
->at_scsi_status
);
2653 ISP_IOXPUT_8(isp
, src
->at_scsi_status
, &dst
->at_status
);
2654 ISP_IOXPUT_8(isp
, src
->at_tag_val
, &dst
->at_tag_type
);
2655 ISP_IOXPUT_8(isp
, src
->at_tag_type
, &dst
->at_tag_val
);
2657 ISP_IOXPUT_8(isp
, src
->at_lun
, &dst
->at_lun
);
2658 ISP_IOXPUT_8(isp
, src
->at_iid
, &dst
->at_iid
);
2659 ISP_IOXPUT_8(isp
, src
->at_cdblen
, &dst
->at_cdblen
);
2660 ISP_IOXPUT_8(isp
, src
->at_tgt
, &dst
->at_tgt
);
2661 ISP_IOXPUT_8(isp
, src
->at_status
, &dst
->at_status
);
2662 ISP_IOXPUT_8(isp
, src
->at_scsi_status
, &dst
->at_scsi_status
);
2663 ISP_IOXPUT_8(isp
, src
->at_tag_val
, &dst
->at_tag_val
);
2664 ISP_IOXPUT_8(isp
, src
->at_tag_type
, &dst
->at_tag_type
);
2666 ISP_IOXPUT_32(isp
, src
->at_flags
, &dst
->at_flags
);
2667 for (i
= 0; i
< ATIO_CDBLEN
; i
++) {
2668 ISP_IOXPUT_8(isp
, src
->at_cdb
[i
], &dst
->at_cdb
[i
]);
2670 for (i
= 0; i
< QLTM_SENSELEN
; i
++) {
2671 ISP_IOXPUT_8(isp
, src
->at_sense
[i
], &dst
->at_sense
[i
]);
2676 isp_get_atio(ispsoftc_t
*isp
, at_entry_t
*src
, at_entry_t
*dst
)
2679 isp_get_hdr(isp
, &src
->at_header
, &dst
->at_header
);
2680 ISP_IOXGET_16(isp
, &src
->at_reserved
, dst
->at_reserved
);
2681 ISP_IOXGET_16(isp
, &src
->at_handle
, dst
->at_handle
);
2682 if (ISP_IS_SBUS(isp
)) {
2683 ISP_IOXGET_8(isp
, &src
->at_lun
, dst
->at_iid
);
2684 ISP_IOXGET_8(isp
, &src
->at_iid
, dst
->at_lun
);
2685 ISP_IOXGET_8(isp
, &src
->at_cdblen
, dst
->at_tgt
);
2686 ISP_IOXGET_8(isp
, &src
->at_tgt
, dst
->at_cdblen
);
2687 ISP_IOXGET_8(isp
, &src
->at_status
, dst
->at_scsi_status
);
2688 ISP_IOXGET_8(isp
, &src
->at_scsi_status
, dst
->at_status
);
2689 ISP_IOXGET_8(isp
, &src
->at_tag_val
, dst
->at_tag_type
);
2690 ISP_IOXGET_8(isp
, &src
->at_tag_type
, dst
->at_tag_val
);
2692 ISP_IOXGET_8(isp
, &src
->at_lun
, dst
->at_lun
);
2693 ISP_IOXGET_8(isp
, &src
->at_iid
, dst
->at_iid
);
2694 ISP_IOXGET_8(isp
, &src
->at_cdblen
, dst
->at_cdblen
);
2695 ISP_IOXGET_8(isp
, &src
->at_tgt
, dst
->at_tgt
);
2696 ISP_IOXGET_8(isp
, &src
->at_status
, dst
->at_status
);
2697 ISP_IOXGET_8(isp
, &src
->at_scsi_status
, dst
->at_scsi_status
);
2698 ISP_IOXGET_8(isp
, &src
->at_tag_val
, dst
->at_tag_val
);
2699 ISP_IOXGET_8(isp
, &src
->at_tag_type
, dst
->at_tag_type
);
2701 ISP_IOXGET_32(isp
, &src
->at_flags
, dst
->at_flags
);
2702 for (i
= 0; i
< ATIO_CDBLEN
; i
++) {
2703 ISP_IOXGET_8(isp
, &src
->at_cdb
[i
], dst
->at_cdb
[i
]);
2705 for (i
= 0; i
< QLTM_SENSELEN
; i
++) {
2706 ISP_IOXGET_8(isp
, &src
->at_sense
[i
], dst
->at_sense
[i
]);
2711 isp_put_atio2(ispsoftc_t
*isp
, at2_entry_t
*src
, at2_entry_t
*dst
)
2714 isp_put_hdr(isp
, &src
->at_header
, &dst
->at_header
);
2715 ISP_IOXPUT_32(isp
, src
->at_reserved
, &dst
->at_reserved
);
2716 ISP_IOXPUT_8(isp
, src
->at_lun
, &dst
->at_lun
);
2717 ISP_IOXPUT_8(isp
, src
->at_iid
, &dst
->at_iid
);
2718 ISP_IOXPUT_16(isp
, src
->at_rxid
, &dst
->at_rxid
);
2719 ISP_IOXPUT_16(isp
, src
->at_flags
, &dst
->at_flags
);
2720 ISP_IOXPUT_16(isp
, src
->at_status
, &dst
->at_status
);
2721 ISP_IOXPUT_8(isp
, src
->at_crn
, &dst
->at_crn
);
2722 ISP_IOXPUT_8(isp
, src
->at_taskcodes
, &dst
->at_taskcodes
);
2723 ISP_IOXPUT_8(isp
, src
->at_taskflags
, &dst
->at_taskflags
);
2724 ISP_IOXPUT_8(isp
, src
->at_execodes
, &dst
->at_execodes
);
2725 for (i
= 0; i
< ATIO2_CDBLEN
; i
++) {
2726 ISP_IOXPUT_8(isp
, src
->at_cdb
[i
], &dst
->at_cdb
[i
]);
2728 ISP_IOXPUT_32(isp
, src
->at_datalen
, &dst
->at_datalen
);
2729 ISP_IOXPUT_16(isp
, src
->at_scclun
, &dst
->at_scclun
);
2730 for (i
= 0; i
< 4; i
++) {
2731 ISP_IOXPUT_16(isp
, src
->at_wwpn
[i
], &dst
->at_wwpn
[i
]);
2733 for (i
= 0; i
< 6; i
++) {
2734 ISP_IOXPUT_16(isp
, src
->at_reserved2
[i
], &dst
->at_reserved2
[i
]);
2736 ISP_IOXPUT_16(isp
, src
->at_oxid
, &dst
->at_oxid
);
2740 isp_put_atio2e(ispsoftc_t
*isp
, at2e_entry_t
*src
, at2e_entry_t
*dst
)
2743 isp_put_hdr(isp
, &src
->at_header
, &dst
->at_header
);
2744 ISP_IOXPUT_32(isp
, src
->at_reserved
, &dst
->at_reserved
);
2745 ISP_IOXPUT_16(isp
, src
->at_iid
, &dst
->at_iid
);
2746 ISP_IOXPUT_16(isp
, src
->at_rxid
, &dst
->at_rxid
);
2747 ISP_IOXPUT_16(isp
, src
->at_flags
, &dst
->at_flags
);
2748 ISP_IOXPUT_16(isp
, src
->at_status
, &dst
->at_status
);
2749 ISP_IOXPUT_8(isp
, src
->at_crn
, &dst
->at_crn
);
2750 ISP_IOXPUT_8(isp
, src
->at_taskcodes
, &dst
->at_taskcodes
);
2751 ISP_IOXPUT_8(isp
, src
->at_taskflags
, &dst
->at_taskflags
);
2752 ISP_IOXPUT_8(isp
, src
->at_execodes
, &dst
->at_execodes
);
2753 for (i
= 0; i
< ATIO2_CDBLEN
; i
++) {
2754 ISP_IOXPUT_8(isp
, src
->at_cdb
[i
], &dst
->at_cdb
[i
]);
2756 ISP_IOXPUT_32(isp
, src
->at_datalen
, &dst
->at_datalen
);
2757 ISP_IOXPUT_16(isp
, src
->at_scclun
, &dst
->at_scclun
);
2758 for (i
= 0; i
< 4; i
++) {
2759 ISP_IOXPUT_16(isp
, src
->at_wwpn
[i
], &dst
->at_wwpn
[i
]);
2761 for (i
= 0; i
< 6; i
++) {
2762 ISP_IOXPUT_16(isp
, src
->at_reserved2
[i
], &dst
->at_reserved2
[i
]);
2764 ISP_IOXPUT_16(isp
, src
->at_oxid
, &dst
->at_oxid
);
2768 isp_get_atio2(ispsoftc_t
*isp
, at2_entry_t
*src
, at2_entry_t
*dst
)
2771 isp_get_hdr(isp
, &src
->at_header
, &dst
->at_header
);
2772 ISP_IOXGET_32(isp
, &src
->at_reserved
, dst
->at_reserved
);
2773 ISP_IOXGET_8(isp
, &src
->at_lun
, dst
->at_lun
);
2774 ISP_IOXGET_8(isp
, &src
->at_iid
, dst
->at_iid
);
2775 ISP_IOXGET_16(isp
, &src
->at_rxid
, dst
->at_rxid
);
2776 ISP_IOXGET_16(isp
, &src
->at_flags
, dst
->at_flags
);
2777 ISP_IOXGET_16(isp
, &src
->at_status
, dst
->at_status
);
2778 ISP_IOXGET_8(isp
, &src
->at_crn
, dst
->at_crn
);
2779 ISP_IOXGET_8(isp
, &src
->at_taskcodes
, dst
->at_taskcodes
);
2780 ISP_IOXGET_8(isp
, &src
->at_taskflags
, dst
->at_taskflags
);
2781 ISP_IOXGET_8(isp
, &src
->at_execodes
, dst
->at_execodes
);
2782 for (i
= 0; i
< ATIO2_CDBLEN
; i
++) {
2783 ISP_IOXGET_8(isp
, &src
->at_cdb
[i
], dst
->at_cdb
[i
]);
2785 ISP_IOXGET_32(isp
, &src
->at_datalen
, dst
->at_datalen
);
2786 ISP_IOXGET_16(isp
, &src
->at_scclun
, dst
->at_scclun
);
2787 for (i
= 0; i
< 4; i
++) {
2788 ISP_IOXGET_16(isp
, &src
->at_wwpn
[i
], dst
->at_wwpn
[i
]);
2790 for (i
= 0; i
< 6; i
++) {
2791 ISP_IOXGET_16(isp
, &src
->at_reserved2
[i
], dst
->at_reserved2
[i
]);
2793 ISP_IOXGET_16(isp
, &src
->at_oxid
, dst
->at_oxid
);
2797 isp_get_atio2e(ispsoftc_t
*isp
, at2e_entry_t
*src
, at2e_entry_t
*dst
)
2800 isp_get_hdr(isp
, &src
->at_header
, &dst
->at_header
);
2801 ISP_IOXGET_32(isp
, &src
->at_reserved
, dst
->at_reserved
);
2802 ISP_IOXGET_16(isp
, &src
->at_iid
, dst
->at_iid
);
2803 ISP_IOXGET_16(isp
, &src
->at_rxid
, dst
->at_rxid
);
2804 ISP_IOXGET_16(isp
, &src
->at_flags
, dst
->at_flags
);
2805 ISP_IOXGET_16(isp
, &src
->at_status
, dst
->at_status
);
2806 ISP_IOXGET_8(isp
, &src
->at_crn
, dst
->at_crn
);
2807 ISP_IOXGET_8(isp
, &src
->at_taskcodes
, dst
->at_taskcodes
);
2808 ISP_IOXGET_8(isp
, &src
->at_taskflags
, dst
->at_taskflags
);
2809 ISP_IOXGET_8(isp
, &src
->at_execodes
, dst
->at_execodes
);
2810 for (i
= 0; i
< ATIO2_CDBLEN
; i
++) {
2811 ISP_IOXGET_8(isp
, &src
->at_cdb
[i
], dst
->at_cdb
[i
]);
2813 ISP_IOXGET_32(isp
, &src
->at_datalen
, dst
->at_datalen
);
2814 ISP_IOXGET_16(isp
, &src
->at_scclun
, dst
->at_scclun
);
2815 for (i
= 0; i
< 4; i
++) {
2816 ISP_IOXGET_16(isp
, &src
->at_wwpn
[i
], dst
->at_wwpn
[i
]);
2818 for (i
= 0; i
< 6; i
++) {
2819 ISP_IOXGET_16(isp
, &src
->at_reserved2
[i
], dst
->at_reserved2
[i
]);
2821 ISP_IOXGET_16(isp
, &src
->at_oxid
, dst
->at_oxid
);
2825 isp_get_atio7(ispsoftc_t
*isp
, at7_entry_t
*src
, at7_entry_t
*dst
)
2827 ISP_IOXGET_8(isp
, &src
->at_type
, dst
->at_type
);
2828 ISP_IOXGET_8(isp
, &src
->at_count
, dst
->at_count
);
2829 ISP_IOXGET_16(isp
, &src
->at_ta_len
, dst
->at_ta_len
);
2830 ISP_IOXGET_32(isp
, &src
->at_rxid
, dst
->at_rxid
);
2831 isp_get_fc_hdr(isp
, &src
->at_hdr
, &dst
->at_hdr
);
2832 isp_get_fcp_cmnd_iu(isp
, &src
->at_cmnd
, &dst
->at_cmnd
);
2836 isp_put_ctio(ispsoftc_t
*isp
, ct_entry_t
*src
, ct_entry_t
*dst
)
2839 isp_put_hdr(isp
, &src
->ct_header
, &dst
->ct_header
);
2840 ISP_IOXPUT_16(isp
, src
->ct_syshandle
, &dst
->ct_syshandle
);
2841 ISP_IOXPUT_16(isp
, src
->ct_fwhandle
, &dst
->ct_fwhandle
);
2842 if (ISP_IS_SBUS(isp
)) {
2843 ISP_IOXPUT_8(isp
, src
->ct_iid
, &dst
->ct_lun
);
2844 ISP_IOXPUT_8(isp
, src
->ct_lun
, &dst
->ct_iid
);
2845 ISP_IOXPUT_8(isp
, src
->ct_tgt
, &dst
->ct_reserved2
);
2846 ISP_IOXPUT_8(isp
, src
->ct_reserved2
, &dst
->ct_tgt
);
2847 ISP_IOXPUT_8(isp
, src
->ct_status
, &dst
->ct_scsi_status
);
2848 ISP_IOXPUT_8(isp
, src
->ct_scsi_status
, &dst
->ct_status
);
2849 ISP_IOXPUT_8(isp
, src
->ct_tag_type
, &dst
->ct_tag_val
);
2850 ISP_IOXPUT_8(isp
, src
->ct_tag_val
, &dst
->ct_tag_type
);
2852 ISP_IOXPUT_8(isp
, src
->ct_iid
, &dst
->ct_iid
);
2853 ISP_IOXPUT_8(isp
, src
->ct_lun
, &dst
->ct_lun
);
2854 ISP_IOXPUT_8(isp
, src
->ct_tgt
, &dst
->ct_tgt
);
2855 ISP_IOXPUT_8(isp
, src
->ct_reserved2
, &dst
->ct_reserved2
);
2856 ISP_IOXPUT_8(isp
, src
->ct_scsi_status
,
2857 &dst
->ct_scsi_status
);
2858 ISP_IOXPUT_8(isp
, src
->ct_status
, &dst
->ct_status
);
2859 ISP_IOXPUT_8(isp
, src
->ct_tag_type
, &dst
->ct_tag_type
);
2860 ISP_IOXPUT_8(isp
, src
->ct_tag_val
, &dst
->ct_tag_val
);
2862 ISP_IOXPUT_32(isp
, src
->ct_flags
, &dst
->ct_flags
);
2863 ISP_IOXPUT_32(isp
, src
->ct_xfrlen
, &dst
->ct_xfrlen
);
2864 ISP_IOXPUT_32(isp
, src
->ct_resid
, &dst
->ct_resid
);
2865 ISP_IOXPUT_16(isp
, src
->ct_timeout
, &dst
->ct_timeout
);
2866 ISP_IOXPUT_16(isp
, src
->ct_seg_count
, &dst
->ct_seg_count
);
2867 for (i
= 0; i
< ISP_RQDSEG
; i
++) {
2868 ISP_IOXPUT_32(isp
, src
->ct_dataseg
[i
].ds_base
, &dst
->ct_dataseg
[i
].ds_base
);
2869 ISP_IOXPUT_32(isp
, src
->ct_dataseg
[i
].ds_count
, &dst
->ct_dataseg
[i
].ds_count
);
2874 isp_get_ctio(ispsoftc_t
*isp
, ct_entry_t
*src
, ct_entry_t
*dst
)
2877 isp_get_hdr(isp
, &src
->ct_header
, &dst
->ct_header
);
2878 ISP_IOXGET_16(isp
, &src
->ct_syshandle
, dst
->ct_syshandle
);
2879 ISP_IOXGET_16(isp
, &src
->ct_fwhandle
, dst
->ct_fwhandle
);
2880 if (ISP_IS_SBUS(isp
)) {
2881 ISP_IOXGET_8(isp
, &src
->ct_lun
, dst
->ct_iid
);
2882 ISP_IOXGET_8(isp
, &src
->ct_iid
, dst
->ct_lun
);
2883 ISP_IOXGET_8(isp
, &src
->ct_reserved2
, dst
->ct_tgt
);
2884 ISP_IOXGET_8(isp
, &src
->ct_tgt
, dst
->ct_reserved2
);
2885 ISP_IOXGET_8(isp
, &src
->ct_status
, dst
->ct_scsi_status
);
2886 ISP_IOXGET_8(isp
, &src
->ct_scsi_status
, dst
->ct_status
);
2887 ISP_IOXGET_8(isp
, &src
->ct_tag_val
, dst
->ct_tag_type
);
2888 ISP_IOXGET_8(isp
, &src
->ct_tag_type
, dst
->ct_tag_val
);
2890 ISP_IOXGET_8(isp
, &src
->ct_lun
, dst
->ct_lun
);
2891 ISP_IOXGET_8(isp
, &src
->ct_iid
, dst
->ct_iid
);
2892 ISP_IOXGET_8(isp
, &src
->ct_reserved2
, dst
->ct_reserved2
);
2893 ISP_IOXGET_8(isp
, &src
->ct_tgt
, dst
->ct_tgt
);
2894 ISP_IOXGET_8(isp
, &src
->ct_status
, dst
->ct_status
);
2895 ISP_IOXGET_8(isp
, &src
->ct_scsi_status
, dst
->ct_scsi_status
);
2896 ISP_IOXGET_8(isp
, &src
->ct_tag_val
, dst
->ct_tag_val
);
2897 ISP_IOXGET_8(isp
, &src
->ct_tag_type
, dst
->ct_tag_type
);
2899 ISP_IOXGET_32(isp
, &src
->ct_flags
, dst
->ct_flags
);
2900 ISP_IOXGET_32(isp
, &src
->ct_xfrlen
, dst
->ct_xfrlen
);
2901 ISP_IOXGET_32(isp
, &src
->ct_resid
, dst
->ct_resid
);
2902 ISP_IOXGET_16(isp
, &src
->ct_timeout
, dst
->ct_timeout
);
2903 ISP_IOXGET_16(isp
, &src
->ct_seg_count
, dst
->ct_seg_count
);
2904 for (i
= 0; i
< ISP_RQDSEG
; i
++) {
2905 ISP_IOXGET_32(isp
, &src
->ct_dataseg
[i
].ds_base
, dst
->ct_dataseg
[i
].ds_base
);
2906 ISP_IOXGET_32(isp
, &src
->ct_dataseg
[i
].ds_count
, dst
->ct_dataseg
[i
].ds_count
);
2911 isp_put_ctio2(ispsoftc_t
*isp
, ct2_entry_t
*src
, ct2_entry_t
*dst
)
2914 isp_put_hdr(isp
, &src
->ct_header
, &dst
->ct_header
);
2915 ISP_IOXPUT_32(isp
, src
->ct_syshandle
, &dst
->ct_syshandle
);
2916 ISP_IOXPUT_8(isp
, src
->ct_lun
, &dst
->ct_lun
);
2917 ISP_IOXPUT_8(isp
, src
->ct_iid
, &dst
->ct_iid
);
2918 ISP_IOXPUT_16(isp
, src
->ct_rxid
, &dst
->ct_rxid
);
2919 ISP_IOXPUT_16(isp
, src
->ct_flags
, &dst
->ct_flags
);
2920 ISP_IOXPUT_16(isp
, src
->ct_timeout
, &dst
->ct_timeout
);
2921 ISP_IOXPUT_16(isp
, src
->ct_seg_count
, &dst
->ct_seg_count
);
2922 ISP_IOXPUT_32(isp
, src
->ct_resid
, &dst
->ct_resid
);
2923 ISP_IOXPUT_32(isp
, src
->ct_reloff
, &dst
->ct_reloff
);
2924 if ((src
->ct_flags
& CT2_FLAG_MMASK
) == CT2_FLAG_MODE0
) {
2925 ISP_IOXPUT_32(isp
, src
->rsp
.m0
._reserved
, &dst
->rsp
.m0
._reserved
);
2926 ISP_IOXPUT_16(isp
, src
->rsp
.m0
._reserved2
, &dst
->rsp
.m0
._reserved2
);
2927 ISP_IOXPUT_16(isp
, src
->rsp
.m0
.ct_scsi_status
, &dst
->rsp
.m0
.ct_scsi_status
);
2928 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.ct_xfrlen
, &dst
->rsp
.m0
.ct_xfrlen
);
2929 if (src
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO2
) {
2930 for (i
= 0; i
< ISP_RQDSEG_T2
; i
++) {
2931 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg
[i
].ds_base
, &dst
->rsp
.m0
.u
.ct_dataseg
[i
].ds_base
);
2932 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg
[i
].ds_count
, &dst
->rsp
.m0
.u
.ct_dataseg
[i
].ds_count
);
2934 } else if (src
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO3
) {
2935 for (i
= 0; i
< ISP_RQDSEG_T3
; i
++) {
2936 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_base
, &dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_base
);
2937 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_basehi
, &dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_basehi
);
2938 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_count
, &dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_count
);
2940 } else if (src
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO4
) {
2941 ISP_IOXPUT_16(isp
, src
->rsp
.m0
.u
.ct_dslist
.ds_type
, &dst
->rsp
.m0
.u
.ct_dslist
.ds_type
); ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dslist
.ds_segment
,
2942 &dst
->rsp
.m0
.u
.ct_dslist
.ds_segment
);
2943 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dslist
.ds_base
, &dst
->rsp
.m0
.u
.ct_dslist
.ds_base
);
2945 } else if ((src
->ct_flags
& CT2_FLAG_MMASK
) == CT2_FLAG_MODE1
) {
2946 ISP_IOXPUT_16(isp
, src
->rsp
.m1
._reserved
, &dst
->rsp
.m1
._reserved
);
2947 ISP_IOXPUT_16(isp
, src
->rsp
.m1
._reserved2
, &dst
->rsp
.m1
._reserved2
);
2948 ISP_IOXPUT_16(isp
, src
->rsp
.m1
.ct_senselen
, &dst
->rsp
.m1
.ct_senselen
);
2949 ISP_IOXPUT_16(isp
, src
->rsp
.m1
.ct_scsi_status
, &dst
->rsp
.m1
.ct_scsi_status
);
2950 ISP_IOXPUT_16(isp
, src
->rsp
.m1
.ct_resplen
, &dst
->rsp
.m1
.ct_resplen
);
2951 for (i
= 0; i
< MAXRESPLEN
; i
++) {
2952 ISP_IOXPUT_8(isp
, src
->rsp
.m1
.ct_resp
[i
], &dst
->rsp
.m1
.ct_resp
[i
]);
2955 ISP_IOXPUT_32(isp
, src
->rsp
.m2
._reserved
, &dst
->rsp
.m2
._reserved
);
2956 ISP_IOXPUT_16(isp
, src
->rsp
.m2
._reserved2
, &dst
->rsp
.m2
._reserved2
);
2957 ISP_IOXPUT_16(isp
, src
->rsp
.m2
._reserved3
, &dst
->rsp
.m2
._reserved3
);
2958 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_datalen
, &dst
->rsp
.m2
.ct_datalen
);
2959 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
, &dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
);
2960 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
, &dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
);
2965 isp_put_ctio2e(ispsoftc_t
*isp
, ct2e_entry_t
*src
, ct2e_entry_t
*dst
)
2968 isp_put_hdr(isp
, &src
->ct_header
, &dst
->ct_header
);
2969 ISP_IOXPUT_32(isp
, src
->ct_syshandle
, &dst
->ct_syshandle
);
2970 ISP_IOXPUT_16(isp
, src
->ct_iid
, &dst
->ct_iid
);
2971 ISP_IOXPUT_16(isp
, src
->ct_rxid
, &dst
->ct_rxid
);
2972 ISP_IOXPUT_16(isp
, src
->ct_flags
, &dst
->ct_flags
);
2973 ISP_IOXPUT_16(isp
, src
->ct_timeout
, &dst
->ct_timeout
);
2974 ISP_IOXPUT_16(isp
, src
->ct_seg_count
, &dst
->ct_seg_count
);
2975 ISP_IOXPUT_32(isp
, src
->ct_resid
, &dst
->ct_resid
);
2976 ISP_IOXPUT_32(isp
, src
->ct_reloff
, &dst
->ct_reloff
);
2977 if ((src
->ct_flags
& CT2_FLAG_MMASK
) == CT2_FLAG_MODE0
) {
2978 ISP_IOXPUT_32(isp
, src
->rsp
.m0
._reserved
, &dst
->rsp
.m0
._reserved
);
2979 ISP_IOXPUT_16(isp
, src
->rsp
.m0
._reserved2
, &dst
->rsp
.m0
._reserved2
);
2980 ISP_IOXPUT_16(isp
, src
->rsp
.m0
.ct_scsi_status
, &dst
->rsp
.m0
.ct_scsi_status
);
2981 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.ct_xfrlen
, &dst
->rsp
.m0
.ct_xfrlen
);
2982 if (src
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO2
) {
2983 for (i
= 0; i
< ISP_RQDSEG_T2
; i
++) {
2984 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg
[i
].ds_base
, &dst
->rsp
.m0
.u
.ct_dataseg
[i
].ds_base
);
2985 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg
[i
].ds_count
, &dst
->rsp
.m0
.u
.ct_dataseg
[i
].ds_count
);
2987 } else if (src
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO3
) {
2988 for (i
= 0; i
< ISP_RQDSEG_T3
; i
++) {
2989 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_base
, &dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_base
);
2990 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_basehi
, &dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_basehi
);
2991 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_count
, &dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_count
);
2993 } else if (src
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO4
) {
2994 ISP_IOXPUT_16(isp
, src
->rsp
.m0
.u
.ct_dslist
.ds_type
, &dst
->rsp
.m0
.u
.ct_dslist
.ds_type
);
2995 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dslist
.ds_segment
, &dst
->rsp
.m0
.u
.ct_dslist
.ds_segment
);
2996 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.u
.ct_dslist
.ds_base
, &dst
->rsp
.m0
.u
.ct_dslist
.ds_base
);
2998 } else if ((src
->ct_flags
& CT2_FLAG_MMASK
) == CT2_FLAG_MODE1
) {
2999 ISP_IOXPUT_16(isp
, src
->rsp
.m1
._reserved
, &dst
->rsp
.m1
._reserved
);
3000 ISP_IOXPUT_16(isp
, src
->rsp
.m1
._reserved2
, &dst
->rsp
.m1
._reserved2
);
3001 ISP_IOXPUT_16(isp
, src
->rsp
.m1
.ct_senselen
, &dst
->rsp
.m1
.ct_senselen
);
3002 ISP_IOXPUT_16(isp
, src
->rsp
.m1
.ct_scsi_status
, &dst
->rsp
.m1
.ct_scsi_status
);
3003 ISP_IOXPUT_16(isp
, src
->rsp
.m1
.ct_resplen
, &dst
->rsp
.m1
.ct_resplen
);
3004 for (i
= 0; i
< MAXRESPLEN
; i
++) {
3005 ISP_IOXPUT_8(isp
, src
->rsp
.m1
.ct_resp
[i
], &dst
->rsp
.m1
.ct_resp
[i
]);
3008 ISP_IOXPUT_32(isp
, src
->rsp
.m2
._reserved
, &dst
->rsp
.m2
._reserved
);
3009 ISP_IOXPUT_16(isp
, src
->rsp
.m2
._reserved2
, &dst
->rsp
.m2
._reserved2
);
3010 ISP_IOXPUT_16(isp
, src
->rsp
.m2
._reserved3
, &dst
->rsp
.m2
._reserved3
);
3011 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_datalen
, &dst
->rsp
.m2
.ct_datalen
);
3012 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
, &dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
);
3013 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
, &dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
);
3018 isp_put_ctio7(ispsoftc_t
*isp
, ct7_entry_t
*src
, ct7_entry_t
*dst
)
3022 isp_put_hdr(isp
, &src
->ct_header
, &dst
->ct_header
);
3023 ISP_IOXPUT_32(isp
, src
->ct_syshandle
, &dst
->ct_syshandle
);
3024 ISP_IOXPUT_16(isp
, src
->ct_nphdl
, &dst
->ct_nphdl
);
3025 ISP_IOXPUT_16(isp
, src
->ct_timeout
, &dst
->ct_timeout
);
3026 ISP_IOXPUT_16(isp
, src
->ct_seg_count
, &dst
->ct_seg_count
);
3027 ISP_IOXPUT_8(isp
, src
->ct_vpidx
, &dst
->ct_vpidx
);
3028 ISP_IOXPUT_8(isp
, src
->ct_xflags
, &dst
->ct_xflags
);
3029 ISP_IOXPUT_16(isp
, src
->ct_iid_lo
, &dst
->ct_iid_lo
);
3030 ISP_IOXPUT_8(isp
, src
->ct_iid_hi
, &dst
->ct_iid_hi
);
3031 ISP_IOXPUT_8(isp
, src
->ct_reserved
, &dst
->ct_reserved
);
3032 ISP_IOXPUT_32(isp
, src
->ct_rxid
, &dst
->ct_rxid
);
3033 ISP_IOXPUT_16(isp
, src
->ct_senselen
, &dst
->ct_senselen
);
3034 ISP_IOXPUT_16(isp
, src
->ct_flags
, &dst
->ct_flags
);
3035 ISP_IOXPUT_32(isp
, src
->ct_resid
, &dst
->ct_resid
);
3036 ISP_IOXPUT_16(isp
, src
->ct_oxid
, &dst
->ct_oxid
);
3037 ISP_IOXPUT_16(isp
, src
->ct_scsi_status
, &dst
->ct_scsi_status
);
3038 if ((dst
->ct_flags
& CT7_FLAG_MMASK
) == CT7_FLAG_MODE0
) {
3039 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.reloff
, &dst
->rsp
.m0
.reloff
);
3040 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.reserved0
, &dst
->rsp
.m0
.reserved0
);
3041 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.ct_xfrlen
, &dst
->rsp
.m0
.ct_xfrlen
);
3042 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.reserved1
, &dst
->rsp
.m0
.reserved1
);
3043 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.ds
.ds_base
, &dst
->rsp
.m0
.ds
.ds_base
);
3044 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.ds
.ds_basehi
, &dst
->rsp
.m0
.ds
.ds_basehi
);
3045 ISP_IOXPUT_32(isp
, src
->rsp
.m0
.ds
.ds_count
, &dst
->rsp
.m0
.ds
.ds_count
);
3046 } else if ((dst
->ct_flags
& CT7_FLAG_MMASK
) == CT7_FLAG_MODE1
) {
3049 ISP_IOXPUT_16(isp
, src
->rsp
.m1
.ct_resplen
, &dst
->rsp
.m1
.ct_resplen
);
3050 ISP_IOXPUT_16(isp
, src
->rsp
.m1
.reserved
, &dst
->rsp
.m1
.reserved
);
3051 a
= (uint32_t *) src
->rsp
.m1
.ct_resp
;
3052 b
= (uint32_t *) dst
->rsp
.m1
.ct_resp
;
3053 for (i
= 0; i
< (ASIZE(src
->rsp
.m1
.ct_resp
) >> 2); i
++) {
3054 *b
++ = ISP_SWAP32(isp
, *a
++);
3057 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.reserved0
, &dst
->rsp
.m2
.reserved0
);
3058 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_datalen
, &dst
->rsp
.m2
.ct_datalen
);
3059 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.reserved1
, &dst
->rsp
.m2
.reserved1
);
3060 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
, &dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
);
3061 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_basehi
, &dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_basehi
);
3062 ISP_IOXPUT_32(isp
, src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
, &dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
);
3068 isp_get_ctio2(ispsoftc_t
*isp
, ct2_entry_t
*src
, ct2_entry_t
*dst
)
3072 isp_get_hdr(isp
, &src
->ct_header
, &dst
->ct_header
);
3073 ISP_IOXGET_32(isp
, &src
->ct_syshandle
, dst
->ct_syshandle
);
3074 ISP_IOXGET_8(isp
, &src
->ct_lun
, dst
->ct_lun
);
3075 ISP_IOXGET_8(isp
, &src
->ct_iid
, dst
->ct_iid
);
3076 ISP_IOXGET_16(isp
, &src
->ct_rxid
, dst
->ct_rxid
);
3077 ISP_IOXGET_16(isp
, &src
->ct_flags
, dst
->ct_flags
);
3078 ISP_IOXGET_16(isp
, &src
->ct_status
, dst
->ct_status
);
3079 ISP_IOXGET_16(isp
, &src
->ct_timeout
, dst
->ct_timeout
);
3080 ISP_IOXGET_16(isp
, &src
->ct_seg_count
, dst
->ct_seg_count
);
3081 ISP_IOXGET_32(isp
, &src
->ct_reloff
, dst
->ct_reloff
);
3082 ISP_IOXGET_32(isp
, &src
->ct_resid
, dst
->ct_resid
);
3083 if ((dst
->ct_flags
& CT2_FLAG_MMASK
) == CT2_FLAG_MODE0
) {
3084 ISP_IOXGET_32(isp
, &src
->rsp
.m0
._reserved
, dst
->rsp
.m0
._reserved
);
3085 ISP_IOXGET_16(isp
, &src
->rsp
.m0
._reserved2
, dst
->rsp
.m0
._reserved2
);
3086 ISP_IOXGET_16(isp
, &src
->rsp
.m0
.ct_scsi_status
, dst
->rsp
.m0
.ct_scsi_status
);
3087 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.ct_xfrlen
, dst
->rsp
.m0
.ct_xfrlen
);
3088 if (dst
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO2
) {
3089 for (i
= 0; i
< ISP_RQDSEG_T2
; i
++) {
3090 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg
[i
].ds_base
, dst
->rsp
.m0
.u
.ct_dataseg
[i
].ds_base
);
3091 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg
[i
].ds_count
, dst
->rsp
.m0
.u
.ct_dataseg
[i
].ds_count
);
3093 } else if (dst
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO3
) {
3094 for (i
= 0; i
< ISP_RQDSEG_T3
; i
++) {
3095 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_base
, dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_base
);
3096 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_basehi
, dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_basehi
);
3097 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_count
, dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_count
);
3099 } else if (dst
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO4
) {
3100 ISP_IOXGET_16(isp
, &src
->rsp
.m0
.u
.ct_dslist
.ds_type
, dst
->rsp
.m0
.u
.ct_dslist
.ds_type
);
3101 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dslist
.ds_segment
, dst
->rsp
.m0
.u
.ct_dslist
.ds_segment
);
3102 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dslist
.ds_base
, dst
->rsp
.m0
.u
.ct_dslist
.ds_base
);
3104 } else if ((dst
->ct_flags
& CT2_FLAG_MMASK
) == CT2_FLAG_MODE1
) {
3105 ISP_IOXGET_16(isp
, &src
->rsp
.m1
._reserved
, dst
->rsp
.m1
._reserved
);
3106 ISP_IOXGET_16(isp
, &src
->rsp
.m1
._reserved2
, dst
->rsp
.m1
._reserved2
);
3107 ISP_IOXGET_16(isp
, &src
->rsp
.m1
.ct_senselen
, dst
->rsp
.m1
.ct_senselen
);
3108 ISP_IOXGET_16(isp
, &src
->rsp
.m1
.ct_scsi_status
, dst
->rsp
.m1
.ct_scsi_status
);
3109 ISP_IOXGET_16(isp
, &src
->rsp
.m1
.ct_resplen
, dst
->rsp
.m1
.ct_resplen
);
3110 for (i
= 0; i
< MAXRESPLEN
; i
++) {
3111 ISP_IOXGET_8(isp
, &src
->rsp
.m1
.ct_resp
[i
], dst
->rsp
.m1
.ct_resp
[i
]);
3114 ISP_IOXGET_32(isp
, &src
->rsp
.m2
._reserved
, dst
->rsp
.m2
._reserved
);
3115 ISP_IOXGET_16(isp
, &src
->rsp
.m2
._reserved2
, dst
->rsp
.m2
._reserved2
);
3116 ISP_IOXGET_16(isp
, &src
->rsp
.m2
._reserved3
, dst
->rsp
.m2
._reserved3
);
3117 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_datalen
, dst
->rsp
.m2
.ct_datalen
);
3118 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
, dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
);
3119 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
, dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
);
3124 isp_get_ctio2e(ispsoftc_t
*isp
, ct2e_entry_t
*src
, ct2e_entry_t
*dst
)
3128 isp_get_hdr(isp
, &src
->ct_header
, &dst
->ct_header
);
3129 ISP_IOXGET_32(isp
, &src
->ct_syshandle
, dst
->ct_syshandle
);
3130 ISP_IOXGET_16(isp
, &src
->ct_iid
, dst
->ct_iid
);
3131 ISP_IOXGET_16(isp
, &src
->ct_rxid
, dst
->ct_rxid
);
3132 ISP_IOXGET_16(isp
, &src
->ct_flags
, dst
->ct_flags
);
3133 ISP_IOXGET_16(isp
, &src
->ct_status
, dst
->ct_status
);
3134 ISP_IOXGET_16(isp
, &src
->ct_timeout
, dst
->ct_timeout
);
3135 ISP_IOXGET_16(isp
, &src
->ct_seg_count
, dst
->ct_seg_count
);
3136 ISP_IOXGET_32(isp
, &src
->ct_reloff
, dst
->ct_reloff
);
3137 ISP_IOXGET_32(isp
, &src
->ct_resid
, dst
->ct_resid
);
3138 if ((dst
->ct_flags
& CT2_FLAG_MMASK
) == CT2_FLAG_MODE0
) {
3139 ISP_IOXGET_32(isp
, &src
->rsp
.m0
._reserved
, dst
->rsp
.m0
._reserved
);
3140 ISP_IOXGET_16(isp
, &src
->rsp
.m0
._reserved2
, dst
->rsp
.m0
._reserved2
);
3141 ISP_IOXGET_16(isp
, &src
->rsp
.m0
.ct_scsi_status
, dst
->rsp
.m0
.ct_scsi_status
);
3142 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.ct_xfrlen
, dst
->rsp
.m0
.ct_xfrlen
);
3143 if (src
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO2
) {
3144 for (i
= 0; i
< ISP_RQDSEG_T2
; i
++) {
3145 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg
[i
].ds_base
, dst
->rsp
.m0
.u
.ct_dataseg
[i
].ds_base
);
3146 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg
[i
].ds_count
, dst
->rsp
.m0
.u
.ct_dataseg
[i
].ds_count
);
3148 } else if (dst
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO3
) {
3149 for (i
= 0; i
< ISP_RQDSEG_T3
; i
++) {
3150 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_base
, dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_base
);
3151 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_basehi
, dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_basehi
);
3152 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_count
, dst
->rsp
.m0
.u
.ct_dataseg64
[i
].ds_count
);
3154 } else if (dst
->ct_header
.rqs_entry_type
== RQSTYPE_CTIO4
) {
3155 ISP_IOXGET_16(isp
, &src
->rsp
.m0
.u
.ct_dslist
.ds_type
, dst
->rsp
.m0
.u
.ct_dslist
.ds_type
);
3156 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dslist
.ds_segment
, dst
->rsp
.m0
.u
.ct_dslist
.ds_segment
);
3157 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.u
.ct_dslist
.ds_base
, dst
->rsp
.m0
.u
.ct_dslist
.ds_base
);
3159 } else if ((dst
->ct_flags
& CT2_FLAG_MMASK
) == CT2_FLAG_MODE1
) {
3160 ISP_IOXGET_16(isp
, &src
->rsp
.m1
._reserved
, dst
->rsp
.m1
._reserved
);
3161 ISP_IOXGET_16(isp
, &src
->rsp
.m1
._reserved2
, dst
->rsp
.m1
._reserved2
);
3162 ISP_IOXGET_16(isp
, &src
->rsp
.m1
.ct_senselen
, dst
->rsp
.m1
.ct_senselen
);
3163 ISP_IOXGET_16(isp
, &src
->rsp
.m1
.ct_scsi_status
, dst
->rsp
.m1
.ct_scsi_status
);
3164 ISP_IOXGET_16(isp
, &src
->rsp
.m1
.ct_resplen
, dst
->rsp
.m1
.ct_resplen
);
3165 for (i
= 0; i
< MAXRESPLEN
; i
++) {
3166 ISP_IOXGET_8(isp
, &src
->rsp
.m1
.ct_resp
[i
], dst
->rsp
.m1
.ct_resp
[i
]);
3169 ISP_IOXGET_32(isp
, &src
->rsp
.m2
._reserved
, dst
->rsp
.m2
._reserved
);
3170 ISP_IOXGET_16(isp
, &src
->rsp
.m2
._reserved2
, dst
->rsp
.m2
._reserved2
);
3171 ISP_IOXGET_16(isp
, &src
->rsp
.m2
._reserved3
, dst
->rsp
.m2
._reserved3
);
3172 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_datalen
, dst
->rsp
.m2
.ct_datalen
);
3173 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
, dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
);
3174 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
, dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
);
3179 isp_get_ctio7(ispsoftc_t
*isp
, ct7_entry_t
*src
, ct7_entry_t
*dst
)
3183 isp_get_hdr(isp
, &src
->ct_header
, &dst
->ct_header
);
3184 ISP_IOXGET_32(isp
, &src
->ct_syshandle
, dst
->ct_syshandle
);
3185 ISP_IOXGET_16(isp
, &src
->ct_nphdl
, dst
->ct_nphdl
);
3186 ISP_IOXGET_16(isp
, &src
->ct_timeout
, dst
->ct_timeout
);
3187 ISP_IOXGET_16(isp
, &src
->ct_seg_count
, dst
->ct_seg_count
);
3188 ISP_IOXGET_8(isp
, &src
->ct_vpidx
, dst
->ct_vpidx
);
3189 ISP_IOXGET_8(isp
, &src
->ct_xflags
, dst
->ct_xflags
);
3190 ISP_IOXGET_16(isp
, &src
->ct_iid_lo
, dst
->ct_iid_lo
);
3191 ISP_IOXGET_8(isp
, &src
->ct_iid_hi
, dst
->ct_iid_hi
);
3192 ISP_IOXGET_8(isp
, &src
->ct_reserved
, dst
->ct_reserved
);
3193 ISP_IOXGET_32(isp
, &src
->ct_rxid
, dst
->ct_rxid
);
3194 ISP_IOXGET_16(isp
, &src
->ct_senselen
, dst
->ct_senselen
);
3195 ISP_IOXGET_16(isp
, &src
->ct_flags
, dst
->ct_flags
);
3196 ISP_IOXGET_32(isp
, &src
->ct_resid
, dst
->ct_resid
);
3197 ISP_IOXGET_16(isp
, &src
->ct_oxid
, dst
->ct_oxid
);
3198 ISP_IOXGET_16(isp
, &src
->ct_scsi_status
, dst
->ct_scsi_status
);
3199 if ((dst
->ct_flags
& CT7_FLAG_MMASK
) == CT7_FLAG_MODE0
) {
3200 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.reloff
, dst
->rsp
.m0
.reloff
);
3201 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.reserved0
, dst
->rsp
.m0
.reserved0
);
3202 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.ct_xfrlen
, dst
->rsp
.m0
.ct_xfrlen
);
3203 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.reserved1
, dst
->rsp
.m0
.reserved1
);
3204 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.ds
.ds_base
, dst
->rsp
.m0
.ds
.ds_base
);
3205 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.ds
.ds_basehi
, dst
->rsp
.m0
.ds
.ds_basehi
);
3206 ISP_IOXGET_32(isp
, &src
->rsp
.m0
.ds
.ds_count
, dst
->rsp
.m0
.ds
.ds_count
);
3207 } else if ((dst
->ct_flags
& CT7_FLAG_MMASK
) == CT7_FLAG_MODE1
) {
3210 ISP_IOXGET_16(isp
, &src
->rsp
.m1
.ct_resplen
, dst
->rsp
.m1
.ct_resplen
);
3211 ISP_IOXGET_16(isp
, &src
->rsp
.m1
.reserved
, dst
->rsp
.m1
.reserved
);
3212 a
= (uint32_t *) src
->rsp
.m1
.ct_resp
;
3213 b
= (uint32_t *) dst
->rsp
.m1
.ct_resp
;
3214 for (i
= 0; i
< MAXRESPLEN_24XX
; i
++) {
3215 ISP_IOXGET_8(isp
, &src
->rsp
.m1
.ct_resp
[i
], dst
->rsp
.m1
.ct_resp
[i
]);
3217 for (i
= 0; i
< (ASIZE(src
->rsp
.m1
.ct_resp
) >> 2); i
++) {
3218 *b
++ = ISP_SWAP32(isp
, *a
++);
3221 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.reserved0
, dst
->rsp
.m2
.reserved0
);
3222 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_datalen
, dst
->rsp
.m2
.ct_datalen
);
3223 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.reserved1
, dst
->rsp
.m2
.reserved1
);
3224 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
, dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_base
);
3225 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_basehi
, dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_basehi
);
3226 ISP_IOXGET_32(isp
, &src
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
, dst
->rsp
.m2
.ct_fcp_rsp_iudata
.ds_count
);
3231 isp_put_enable_lun(ispsoftc_t
*isp
, lun_entry_t
*lesrc
, lun_entry_t
*ledst
)
3234 isp_put_hdr(isp
, &lesrc
->le_header
, &ledst
->le_header
);
3235 ISP_IOXPUT_32(isp
, lesrc
->le_reserved
, &ledst
->le_reserved
);
3236 if (ISP_IS_SBUS(isp
)) {
3237 ISP_IOXPUT_8(isp
, lesrc
->le_lun
, &ledst
->le_rsvd
);
3238 ISP_IOXPUT_8(isp
, lesrc
->le_rsvd
, &ledst
->le_lun
);
3239 ISP_IOXPUT_8(isp
, lesrc
->le_ops
, &ledst
->le_tgt
);
3240 ISP_IOXPUT_8(isp
, lesrc
->le_tgt
, &ledst
->le_ops
);
3241 ISP_IOXPUT_8(isp
, lesrc
->le_status
, &ledst
->le_reserved2
);
3242 ISP_IOXPUT_8(isp
, lesrc
->le_reserved2
, &ledst
->le_status
);
3243 ISP_IOXPUT_8(isp
, lesrc
->le_cmd_count
, &ledst
->le_in_count
);
3244 ISP_IOXPUT_8(isp
, lesrc
->le_in_count
, &ledst
->le_cmd_count
);
3245 ISP_IOXPUT_8(isp
, lesrc
->le_cdb6len
, &ledst
->le_cdb7len
);
3246 ISP_IOXPUT_8(isp
, lesrc
->le_cdb7len
, &ledst
->le_cdb6len
);
3248 ISP_IOXPUT_8(isp
, lesrc
->le_lun
, &ledst
->le_lun
);
3249 ISP_IOXPUT_8(isp
, lesrc
->le_rsvd
, &ledst
->le_rsvd
);
3250 ISP_IOXPUT_8(isp
, lesrc
->le_ops
, &ledst
->le_ops
);
3251 ISP_IOXPUT_8(isp
, lesrc
->le_tgt
, &ledst
->le_tgt
);
3252 ISP_IOXPUT_8(isp
, lesrc
->le_status
, &ledst
->le_status
);
3253 ISP_IOXPUT_8(isp
, lesrc
->le_reserved2
, &ledst
->le_reserved2
);
3254 ISP_IOXPUT_8(isp
, lesrc
->le_cmd_count
, &ledst
->le_cmd_count
);
3255 ISP_IOXPUT_8(isp
, lesrc
->le_in_count
, &ledst
->le_in_count
);
3256 ISP_IOXPUT_8(isp
, lesrc
->le_cdb6len
, &ledst
->le_cdb6len
);
3257 ISP_IOXPUT_8(isp
, lesrc
->le_cdb7len
, &ledst
->le_cdb7len
);
3259 ISP_IOXPUT_32(isp
, lesrc
->le_flags
, &ledst
->le_flags
);
3260 ISP_IOXPUT_16(isp
, lesrc
->le_timeout
, &ledst
->le_timeout
);
3261 for (i
= 0; i
< 20; i
++) {
3262 ISP_IOXPUT_8(isp
, lesrc
->le_reserved3
[i
], &ledst
->le_reserved3
[i
]);
3267 isp_get_enable_lun(ispsoftc_t
*isp
, lun_entry_t
*lesrc
, lun_entry_t
*ledst
)
3270 isp_get_hdr(isp
, &lesrc
->le_header
, &ledst
->le_header
);
3271 ISP_IOXGET_32(isp
, &lesrc
->le_reserved
, ledst
->le_reserved
);
3272 if (ISP_IS_SBUS(isp
)) {
3273 ISP_IOXGET_8(isp
, &lesrc
->le_lun
, ledst
->le_rsvd
);
3274 ISP_IOXGET_8(isp
, &lesrc
->le_rsvd
, ledst
->le_lun
);
3275 ISP_IOXGET_8(isp
, &lesrc
->le_ops
, ledst
->le_tgt
);
3276 ISP_IOXGET_8(isp
, &lesrc
->le_tgt
, ledst
->le_ops
);
3277 ISP_IOXGET_8(isp
, &lesrc
->le_status
, ledst
->le_reserved2
);
3278 ISP_IOXGET_8(isp
, &lesrc
->le_reserved2
, ledst
->le_status
);
3279 ISP_IOXGET_8(isp
, &lesrc
->le_cmd_count
, ledst
->le_in_count
);
3280 ISP_IOXGET_8(isp
, &lesrc
->le_in_count
, ledst
->le_cmd_count
);
3281 ISP_IOXGET_8(isp
, &lesrc
->le_cdb6len
, ledst
->le_cdb7len
);
3282 ISP_IOXGET_8(isp
, &lesrc
->le_cdb7len
, ledst
->le_cdb6len
);
3284 ISP_IOXGET_8(isp
, &lesrc
->le_lun
, ledst
->le_lun
);
3285 ISP_IOXGET_8(isp
, &lesrc
->le_rsvd
, ledst
->le_rsvd
);
3286 ISP_IOXGET_8(isp
, &lesrc
->le_ops
, ledst
->le_ops
);
3287 ISP_IOXGET_8(isp
, &lesrc
->le_tgt
, ledst
->le_tgt
);
3288 ISP_IOXGET_8(isp
, &lesrc
->le_status
, ledst
->le_status
);
3289 ISP_IOXGET_8(isp
, &lesrc
->le_reserved2
, ledst
->le_reserved2
);
3290 ISP_IOXGET_8(isp
, &lesrc
->le_cmd_count
, ledst
->le_cmd_count
);
3291 ISP_IOXGET_8(isp
, &lesrc
->le_in_count
, ledst
->le_in_count
);
3292 ISP_IOXGET_8(isp
, &lesrc
->le_cdb6len
, ledst
->le_cdb6len
);
3293 ISP_IOXGET_8(isp
, &lesrc
->le_cdb7len
, ledst
->le_cdb7len
);
3295 ISP_IOXGET_32(isp
, &lesrc
->le_flags
, ledst
->le_flags
);
3296 ISP_IOXGET_16(isp
, &lesrc
->le_timeout
, ledst
->le_timeout
);
3297 for (i
= 0; i
< 20; i
++) {
3298 ISP_IOXGET_8(isp
, &lesrc
->le_reserved3
[i
], ledst
->le_reserved3
[i
]);
3303 isp_put_notify(ispsoftc_t
*isp
, in_entry_t
*src
, in_entry_t
*dst
)
3306 isp_put_hdr(isp
, &src
->in_header
, &dst
->in_header
);
3307 ISP_IOXPUT_32(isp
, src
->in_reserved
, &dst
->in_reserved
);
3308 if (ISP_IS_SBUS(isp
)) {
3309 ISP_IOXPUT_8(isp
, src
->in_lun
, &dst
->in_iid
);
3310 ISP_IOXPUT_8(isp
, src
->in_iid
, &dst
->in_lun
);
3311 ISP_IOXPUT_8(isp
, src
->in_reserved2
, &dst
->in_tgt
);
3312 ISP_IOXPUT_8(isp
, src
->in_tgt
, &dst
->in_reserved2
);
3313 ISP_IOXPUT_8(isp
, src
->in_status
, &dst
->in_rsvd2
);
3314 ISP_IOXPUT_8(isp
, src
->in_rsvd2
, &dst
->in_status
);
3315 ISP_IOXPUT_8(isp
, src
->in_tag_val
, &dst
->in_tag_type
);
3316 ISP_IOXPUT_8(isp
, src
->in_tag_type
, &dst
->in_tag_val
);
3318 ISP_IOXPUT_8(isp
, src
->in_lun
, &dst
->in_lun
);
3319 ISP_IOXPUT_8(isp
, src
->in_iid
, &dst
->in_iid
);
3320 ISP_IOXPUT_8(isp
, src
->in_reserved2
, &dst
->in_reserved2
);
3321 ISP_IOXPUT_8(isp
, src
->in_tgt
, &dst
->in_tgt
);
3322 ISP_IOXPUT_8(isp
, src
->in_status
, &dst
->in_status
);
3323 ISP_IOXPUT_8(isp
, src
->in_rsvd2
, &dst
->in_rsvd2
);
3324 ISP_IOXPUT_8(isp
, src
->in_tag_val
, &dst
->in_tag_val
);
3325 ISP_IOXPUT_8(isp
, src
->in_tag_type
, &dst
->in_tag_type
);
3327 ISP_IOXPUT_32(isp
, src
->in_flags
, &dst
->in_flags
);
3328 ISP_IOXPUT_16(isp
, src
->in_seqid
, &dst
->in_seqid
);
3329 for (i
= 0; i
< IN_MSGLEN
; i
++) {
3330 ISP_IOXPUT_8(isp
, src
->in_msg
[i
], &dst
->in_msg
[i
]);
3332 for (i
= 0; i
< IN_RSVDLEN
; i
++) {
3333 ISP_IOXPUT_8(isp
, src
->in_reserved3
[i
], &dst
->in_reserved3
[i
]);
3335 for (i
= 0; i
< QLTM_SENSELEN
; i
++) {
3336 ISP_IOXPUT_8(isp
, src
->in_sense
[i
], &dst
->in_sense
[i
]);
3341 isp_get_notify(ispsoftc_t
*isp
, in_entry_t
*src
, in_entry_t
*dst
)
3344 isp_get_hdr(isp
, &src
->in_header
, &dst
->in_header
);
3345 ISP_IOXGET_32(isp
, &src
->in_reserved
, dst
->in_reserved
);
3346 if (ISP_IS_SBUS(isp
)) {
3347 ISP_IOXGET_8(isp
, &src
->in_lun
, dst
->in_iid
);
3348 ISP_IOXGET_8(isp
, &src
->in_iid
, dst
->in_lun
);
3349 ISP_IOXGET_8(isp
, &src
->in_reserved2
, dst
->in_tgt
);
3350 ISP_IOXGET_8(isp
, &src
->in_tgt
, dst
->in_reserved2
);
3351 ISP_IOXGET_8(isp
, &src
->in_status
, dst
->in_rsvd2
);
3352 ISP_IOXGET_8(isp
, &src
->in_rsvd2
, dst
->in_status
);
3353 ISP_IOXGET_8(isp
, &src
->in_tag_val
, dst
->in_tag_type
);
3354 ISP_IOXGET_8(isp
, &src
->in_tag_type
, dst
->in_tag_val
);
3356 ISP_IOXGET_8(isp
, &src
->in_lun
, dst
->in_lun
);
3357 ISP_IOXGET_8(isp
, &src
->in_iid
, dst
->in_iid
);
3358 ISP_IOXGET_8(isp
, &src
->in_reserved2
, dst
->in_reserved2
);
3359 ISP_IOXGET_8(isp
, &src
->in_tgt
, dst
->in_tgt
);
3360 ISP_IOXGET_8(isp
, &src
->in_status
, dst
->in_status
);
3361 ISP_IOXGET_8(isp
, &src
->in_rsvd2
, dst
->in_rsvd2
);
3362 ISP_IOXGET_8(isp
, &src
->in_tag_val
, dst
->in_tag_val
);
3363 ISP_IOXGET_8(isp
, &src
->in_tag_type
, dst
->in_tag_type
);
3365 ISP_IOXGET_32(isp
, &src
->in_flags
, dst
->in_flags
);
3366 ISP_IOXGET_16(isp
, &src
->in_seqid
, dst
->in_seqid
);
3367 for (i
= 0; i
< IN_MSGLEN
; i
++) {
3368 ISP_IOXGET_8(isp
, &src
->in_msg
[i
], dst
->in_msg
[i
]);
3370 for (i
= 0; i
< IN_RSVDLEN
; i
++) {
3371 ISP_IOXGET_8(isp
, &src
->in_reserved3
[i
], dst
->in_reserved3
[i
]);
3373 for (i
= 0; i
< QLTM_SENSELEN
; i
++) {
3374 ISP_IOXGET_8(isp
, &src
->in_sense
[i
], dst
->in_sense
[i
]);
3379 isp_put_notify_fc(ispsoftc_t
*isp
, in_fcentry_t
*src
, in_fcentry_t
*dst
)
3381 isp_put_hdr(isp
, &src
->in_header
, &dst
->in_header
);
3382 ISP_IOXPUT_32(isp
, src
->in_reserved
, &dst
->in_reserved
);
3383 ISP_IOXPUT_8(isp
, src
->in_lun
, &dst
->in_lun
);
3384 ISP_IOXPUT_8(isp
, src
->in_iid
, &dst
->in_iid
);
3385 ISP_IOXPUT_16(isp
, src
->in_scclun
, &dst
->in_scclun
);
3386 ISP_IOXPUT_32(isp
, src
->in_reserved2
, &dst
->in_reserved2
);
3387 ISP_IOXPUT_16(isp
, src
->in_status
, &dst
->in_status
);
3388 ISP_IOXPUT_16(isp
, src
->in_task_flags
, &dst
->in_task_flags
);
3389 ISP_IOXPUT_16(isp
, src
->in_seqid
, &dst
->in_seqid
);
3393 isp_put_notify_fc_e(ispsoftc_t
*isp
, in_fcentry_e_t
*src
, in_fcentry_e_t
*dst
)
3395 isp_put_hdr(isp
, &src
->in_header
, &dst
->in_header
);
3396 ISP_IOXPUT_32(isp
, src
->in_reserved
, &dst
->in_reserved
);
3397 ISP_IOXPUT_16(isp
, src
->in_iid
, &dst
->in_iid
);
3398 ISP_IOXPUT_16(isp
, src
->in_scclun
, &dst
->in_scclun
);
3399 ISP_IOXPUT_32(isp
, src
->in_reserved2
, &dst
->in_reserved2
);
3400 ISP_IOXPUT_16(isp
, src
->in_status
, &dst
->in_status
);
3401 ISP_IOXPUT_16(isp
, src
->in_task_flags
, &dst
->in_task_flags
);
3402 ISP_IOXPUT_16(isp
, src
->in_seqid
, &dst
->in_seqid
);
3406 isp_put_notify_24xx(ispsoftc_t
*isp
, in_fcentry_24xx_t
*src
, in_fcentry_24xx_t
*dst
)
3410 isp_put_hdr(isp
, &src
->in_header
, &dst
->in_header
);
3411 ISP_IOXPUT_32(isp
, src
->in_reserved
, &dst
->in_reserved
);
3412 ISP_IOXPUT_16(isp
, src
->in_nphdl
, &dst
->in_nphdl
);
3413 ISP_IOXPUT_16(isp
, src
->in_reserved1
, &dst
->in_reserved1
);
3414 ISP_IOXPUT_16(isp
, src
->in_flags
, &dst
->in_flags
);
3415 ISP_IOXPUT_16(isp
, src
->in_srr_rxid
, &dst
->in_srr_rxid
);
3416 ISP_IOXPUT_16(isp
, src
->in_status
, &dst
->in_status
);
3417 ISP_IOXPUT_8(isp
, src
->in_status_subcode
, &dst
->in_status_subcode
);
3418 ISP_IOXPUT_16(isp
, src
->in_reserved2
, &dst
->in_reserved2
);
3419 ISP_IOXPUT_32(isp
, src
->in_rxid
, &dst
->in_rxid
);
3420 ISP_IOXPUT_16(isp
, src
->in_srr_reloff_hi
, &dst
->in_srr_reloff_hi
);
3421 ISP_IOXPUT_16(isp
, src
->in_srr_reloff_lo
, &dst
->in_srr_reloff_lo
);
3422 ISP_IOXPUT_16(isp
, src
->in_srr_iu
, &dst
->in_srr_iu
);
3423 ISP_IOXPUT_16(isp
, src
->in_srr_oxid
, &dst
->in_srr_oxid
);
3424 ISP_IOXPUT_16(isp
, src
->in_nport_id_hi
, &dst
->in_nport_id_hi
);
3425 ISP_IOXPUT_8(isp
, src
->in_nport_id_lo
, &dst
->in_nport_id_lo
);
3426 ISP_IOXPUT_8(isp
, src
->in_reserved3
, &dst
->in_reserved3
);
3427 ISP_IOXPUT_16(isp
, src
->in_np_handle
, &dst
->in_np_handle
);
3428 for (i
= 0; i
< ASIZE(src
->in_reserved4
); i
++) {
3429 ISP_IOXPUT_8(isp
, src
->in_reserved4
[i
], &dst
->in_reserved4
[i
]);
3431 ISP_IOXPUT_8(isp
, src
->in_reserved5
, &dst
->in_reserved5
);
3432 ISP_IOXPUT_8(isp
, src
->in_vpidx
, &dst
->in_vpidx
);
3433 ISP_IOXPUT_32(isp
, src
->in_reserved6
, &dst
->in_reserved6
);
3434 ISP_IOXPUT_16(isp
, src
->in_portid_lo
, &dst
->in_portid_lo
);
3435 ISP_IOXPUT_8(isp
, src
->in_portid_hi
, &dst
->in_portid_hi
);
3436 ISP_IOXPUT_8(isp
, src
->in_reserved7
, &dst
->in_reserved7
);
3437 ISP_IOXPUT_16(isp
, src
->in_reserved8
, &dst
->in_reserved8
);
3438 ISP_IOXPUT_16(isp
, src
->in_oxid
, &dst
->in_oxid
);
3442 isp_get_notify_fc(ispsoftc_t
*isp
, in_fcentry_t
*src
, in_fcentry_t
*dst
)
3444 isp_get_hdr(isp
, &src
->in_header
, &dst
->in_header
);
3445 ISP_IOXGET_32(isp
, &src
->in_reserved
, dst
->in_reserved
);
3446 ISP_IOXGET_8(isp
, &src
->in_lun
, dst
->in_lun
);
3447 ISP_IOXGET_8(isp
, &src
->in_iid
, dst
->in_iid
);
3448 ISP_IOXGET_16(isp
, &src
->in_scclun
, dst
->in_scclun
);
3449 ISP_IOXGET_32(isp
, &src
->in_reserved2
, dst
->in_reserved2
);
3450 ISP_IOXGET_16(isp
, &src
->in_status
, dst
->in_status
);
3451 ISP_IOXGET_16(isp
, &src
->in_task_flags
, dst
->in_task_flags
);
3452 ISP_IOXGET_16(isp
, &src
->in_seqid
, dst
->in_seqid
);
3456 isp_get_notify_fc_e(ispsoftc_t
*isp
, in_fcentry_e_t
*src
, in_fcentry_e_t
*dst
)
3458 isp_get_hdr(isp
, &src
->in_header
, &dst
->in_header
);
3459 ISP_IOXGET_32(isp
, &src
->in_reserved
, dst
->in_reserved
);
3460 ISP_IOXGET_16(isp
, &src
->in_iid
, dst
->in_iid
);
3461 ISP_IOXGET_16(isp
, &src
->in_scclun
, dst
->in_scclun
);
3462 ISP_IOXGET_32(isp
, &src
->in_reserved2
, dst
->in_reserved2
);
3463 ISP_IOXGET_16(isp
, &src
->in_status
, dst
->in_status
);
3464 ISP_IOXGET_16(isp
, &src
->in_task_flags
, dst
->in_task_flags
);
3465 ISP_IOXGET_16(isp
, &src
->in_seqid
, dst
->in_seqid
);
3469 isp_get_notify_24xx(ispsoftc_t
*isp
, in_fcentry_24xx_t
*src
, in_fcentry_24xx_t
*dst
)
3473 isp_get_hdr(isp
, &src
->in_header
, &dst
->in_header
);
3474 ISP_IOXGET_32(isp
, &src
->in_reserved
, dst
->in_reserved
);
3475 ISP_IOXGET_16(isp
, &src
->in_nphdl
, dst
->in_nphdl
);
3476 ISP_IOXGET_16(isp
, &src
->in_reserved1
, dst
->in_reserved1
);
3477 ISP_IOXGET_16(isp
, &src
->in_flags
, dst
->in_flags
);
3478 ISP_IOXGET_16(isp
, &src
->in_srr_rxid
, dst
->in_srr_rxid
);
3479 ISP_IOXGET_16(isp
, &src
->in_status
, dst
->in_status
);
3480 ISP_IOXGET_8(isp
, &src
->in_status_subcode
, dst
->in_status_subcode
);
3481 ISP_IOXGET_16(isp
, &src
->in_reserved2
, dst
->in_reserved2
);
3482 ISP_IOXGET_32(isp
, &src
->in_rxid
, dst
->in_rxid
);
3483 ISP_IOXGET_16(isp
, &src
->in_srr_reloff_hi
, dst
->in_srr_reloff_hi
);
3484 ISP_IOXGET_16(isp
, &src
->in_srr_reloff_lo
, dst
->in_srr_reloff_lo
);
3485 ISP_IOXGET_16(isp
, &src
->in_srr_iu
, dst
->in_srr_iu
);
3486 ISP_IOXGET_16(isp
, &src
->in_srr_oxid
, dst
->in_srr_oxid
);
3487 ISP_IOXGET_16(isp
, &src
->in_nport_id_hi
, dst
->in_nport_id_hi
);
3488 ISP_IOXGET_8(isp
, &src
->in_nport_id_lo
, dst
->in_nport_id_lo
);
3489 ISP_IOXGET_8(isp
, &src
->in_reserved3
, dst
->in_reserved3
);
3490 ISP_IOXGET_16(isp
, &src
->in_np_handle
, dst
->in_np_handle
);
3491 for (i
= 0; i
< ASIZE(src
->in_reserved4
); i
++) {
3492 ISP_IOXGET_8(isp
, &src
->in_reserved4
[i
], dst
->in_reserved4
[i
]);
3494 ISP_IOXGET_8(isp
, &src
->in_reserved5
, dst
->in_reserved5
);
3495 ISP_IOXGET_8(isp
, &src
->in_vpidx
, dst
->in_vpidx
);
3496 ISP_IOXGET_32(isp
, &src
->in_reserved6
, dst
->in_reserved6
);
3497 ISP_IOXGET_16(isp
, &src
->in_portid_lo
, dst
->in_portid_lo
);
3498 ISP_IOXGET_8(isp
, &src
->in_portid_hi
, dst
->in_portid_hi
);
3499 ISP_IOXGET_8(isp
, &src
->in_reserved7
, dst
->in_reserved7
);
3500 ISP_IOXGET_16(isp
, &src
->in_reserved8
, dst
->in_reserved8
);
3501 ISP_IOXGET_16(isp
, &src
->in_oxid
, dst
->in_oxid
);
3505 isp_put_notify_ack(ispsoftc_t
*isp
, na_entry_t
*src
, na_entry_t
*dst
)
3508 isp_put_hdr(isp
, &src
->na_header
, &dst
->na_header
);
3509 ISP_IOXPUT_32(isp
, src
->na_reserved
, &dst
->na_reserved
);
3510 if (ISP_IS_SBUS(isp
)) {
3511 ISP_IOXPUT_8(isp
, src
->na_lun
, &dst
->na_iid
);
3512 ISP_IOXPUT_8(isp
, src
->na_iid
, &dst
->na_lun
);
3513 ISP_IOXPUT_8(isp
, src
->na_status
, &dst
->na_event
);
3514 ISP_IOXPUT_8(isp
, src
->na_event
, &dst
->na_status
);
3516 ISP_IOXPUT_8(isp
, src
->na_lun
, &dst
->na_lun
);
3517 ISP_IOXPUT_8(isp
, src
->na_iid
, &dst
->na_iid
);
3518 ISP_IOXPUT_8(isp
, src
->na_status
, &dst
->na_status
);
3519 ISP_IOXPUT_8(isp
, src
->na_event
, &dst
->na_event
);
3521 ISP_IOXPUT_32(isp
, src
->na_flags
, &dst
->na_flags
);
3522 for (i
= 0; i
< NA_RSVDLEN
; i
++) {
3523 ISP_IOXPUT_16(isp
, src
->na_reserved3
[i
], &dst
->na_reserved3
[i
]);
3528 isp_get_notify_ack(ispsoftc_t
*isp
, na_entry_t
*src
, na_entry_t
*dst
)
3531 isp_get_hdr(isp
, &src
->na_header
, &dst
->na_header
);
3532 ISP_IOXGET_32(isp
, &src
->na_reserved
, dst
->na_reserved
);
3533 if (ISP_IS_SBUS(isp
)) {
3534 ISP_IOXGET_8(isp
, &src
->na_lun
, dst
->na_iid
);
3535 ISP_IOXGET_8(isp
, &src
->na_iid
, dst
->na_lun
);
3536 ISP_IOXGET_8(isp
, &src
->na_status
, dst
->na_event
);
3537 ISP_IOXGET_8(isp
, &src
->na_event
, dst
->na_status
);
3539 ISP_IOXGET_8(isp
, &src
->na_lun
, dst
->na_lun
);
3540 ISP_IOXGET_8(isp
, &src
->na_iid
, dst
->na_iid
);
3541 ISP_IOXGET_8(isp
, &src
->na_status
, dst
->na_status
);
3542 ISP_IOXGET_8(isp
, &src
->na_event
, dst
->na_event
);
3544 ISP_IOXGET_32(isp
, &src
->na_flags
, dst
->na_flags
);
3545 for (i
= 0; i
< NA_RSVDLEN
; i
++) {
3546 ISP_IOXGET_16(isp
, &src
->na_reserved3
[i
], dst
->na_reserved3
[i
]);
3551 isp_put_notify_ack_fc(ispsoftc_t
*isp
, na_fcentry_t
*src
, na_fcentry_t
*dst
)
3554 isp_put_hdr(isp
, &src
->na_header
, &dst
->na_header
);
3555 ISP_IOXPUT_32(isp
, src
->na_reserved
, &dst
->na_reserved
);
3556 ISP_IOXPUT_8(isp
, src
->na_reserved1
, &dst
->na_reserved1
);
3557 ISP_IOXPUT_8(isp
, src
->na_iid
, &dst
->na_iid
);
3558 ISP_IOXPUT_16(isp
, src
->na_response
, &dst
->na_response
);
3559 ISP_IOXPUT_16(isp
, src
->na_flags
, &dst
->na_flags
);
3560 ISP_IOXPUT_16(isp
, src
->na_reserved2
, &dst
->na_reserved2
);
3561 ISP_IOXPUT_16(isp
, src
->na_status
, &dst
->na_status
);
3562 ISP_IOXPUT_16(isp
, src
->na_task_flags
, &dst
->na_task_flags
);
3563 ISP_IOXPUT_16(isp
, src
->na_seqid
, &dst
->na_seqid
);
3564 for (i
= 0; i
< NA2_RSVDLEN
; i
++) {
3565 ISP_IOXPUT_16(isp
, src
->na_reserved3
[i
], &dst
->na_reserved3
[i
]);
3570 isp_put_notify_ack_fc_e(ispsoftc_t
*isp
, na_fcentry_e_t
*src
, na_fcentry_e_t
*dst
)
3573 isp_put_hdr(isp
, &src
->na_header
, &dst
->na_header
);
3574 ISP_IOXPUT_32(isp
, src
->na_reserved
, &dst
->na_reserved
);
3575 ISP_IOXPUT_16(isp
, src
->na_iid
, &dst
->na_iid
);
3576 ISP_IOXPUT_16(isp
, src
->na_response
, &dst
->na_response
);
3577 ISP_IOXPUT_16(isp
, src
->na_flags
, &dst
->na_flags
);
3578 ISP_IOXPUT_16(isp
, src
->na_reserved2
, &dst
->na_reserved2
);
3579 ISP_IOXPUT_16(isp
, src
->na_status
, &dst
->na_status
);
3580 ISP_IOXPUT_16(isp
, src
->na_task_flags
, &dst
->na_task_flags
);
3581 ISP_IOXPUT_16(isp
, src
->na_seqid
, &dst
->na_seqid
);
3582 for (i
= 0; i
< NA2_RSVDLEN
; i
++) {
3583 ISP_IOXPUT_16(isp
, src
->na_reserved3
[i
], &dst
->na_reserved3
[i
]);
3588 isp_put_notify_24xx_ack(ispsoftc_t
*isp
, na_fcentry_24xx_t
*src
, na_fcentry_24xx_t
*dst
)
3592 isp_put_hdr(isp
, &src
->na_header
, &dst
->na_header
);
3593 ISP_IOXPUT_32(isp
, src
->na_handle
, &dst
->na_handle
);
3594 ISP_IOXPUT_16(isp
, src
->na_nphdl
, &dst
->na_nphdl
);
3595 ISP_IOXPUT_16(isp
, src
->na_reserved1
, &dst
->na_reserved1
);
3596 ISP_IOXPUT_16(isp
, src
->na_flags
, &dst
->na_flags
);
3597 ISP_IOXPUT_16(isp
, src
->na_srr_rxid
, &dst
->na_srr_rxid
);
3598 ISP_IOXPUT_16(isp
, src
->na_status
, &dst
->na_status
);
3599 ISP_IOXPUT_8(isp
, src
->na_status_subcode
, &dst
->na_status_subcode
);
3600 ISP_IOXPUT_16(isp
, src
->na_reserved2
, &dst
->na_reserved2
);
3601 ISP_IOXPUT_32(isp
, src
->na_rxid
, &dst
->na_rxid
);
3602 ISP_IOXPUT_16(isp
, src
->na_srr_reloff_hi
, &dst
->na_srr_reloff_hi
);
3603 ISP_IOXPUT_16(isp
, src
->na_srr_reloff_lo
, &dst
->na_srr_reloff_lo
);
3604 ISP_IOXPUT_16(isp
, src
->na_srr_iu
, &dst
->na_srr_iu
);
3605 ISP_IOXPUT_16(isp
, src
->na_srr_flags
, &dst
->na_srr_flags
);
3606 for (i
= 0; i
< 18; i
++) {
3607 ISP_IOXPUT_8(isp
, src
->na_reserved3
[i
], &dst
->na_reserved3
[i
]);
3609 ISP_IOXPUT_8(isp
, src
->na_reserved4
, &dst
->na_reserved4
);
3610 ISP_IOXPUT_8(isp
, src
->na_vpidx
, &dst
->na_vpidx
);
3611 ISP_IOXPUT_8(isp
, src
->na_srr_reject_vunique
, &dst
->na_srr_reject_vunique
);
3612 ISP_IOXPUT_8(isp
, src
->na_srr_reject_explanation
, &dst
->na_srr_reject_explanation
);
3613 ISP_IOXPUT_8(isp
, src
->na_srr_reject_code
, &dst
->na_srr_reject_code
);
3614 ISP_IOXPUT_8(isp
, src
->na_reserved5
, &dst
->na_reserved5
);
3615 for (i
= 0; i
< 6; i
++) {
3616 ISP_IOXPUT_8(isp
, src
->na_reserved6
[i
], &dst
->na_reserved6
[i
]);
3618 ISP_IOXPUT_16(isp
, src
->na_oxid
, &dst
->na_oxid
);
3622 isp_get_notify_ack_fc(ispsoftc_t
*isp
, na_fcentry_t
*src
, na_fcentry_t
*dst
)
3625 isp_get_hdr(isp
, &src
->na_header
, &dst
->na_header
);
3626 ISP_IOXGET_32(isp
, &src
->na_reserved
, dst
->na_reserved
);
3627 ISP_IOXGET_8(isp
, &src
->na_reserved1
, dst
->na_reserved1
);
3628 ISP_IOXGET_8(isp
, &src
->na_iid
, dst
->na_iid
);
3629 ISP_IOXGET_16(isp
, &src
->na_response
, dst
->na_response
);
3630 ISP_IOXGET_16(isp
, &src
->na_flags
, dst
->na_flags
);
3631 ISP_IOXGET_16(isp
, &src
->na_reserved2
, dst
->na_reserved2
);
3632 ISP_IOXGET_16(isp
, &src
->na_status
, dst
->na_status
);
3633 ISP_IOXGET_16(isp
, &src
->na_task_flags
, dst
->na_task_flags
);
3634 ISP_IOXGET_16(isp
, &src
->na_seqid
, dst
->na_seqid
);
3635 for (i
= 0; i
< NA2_RSVDLEN
; i
++) {
3636 ISP_IOXGET_16(isp
, &src
->na_reserved3
[i
], dst
->na_reserved3
[i
]);
3641 isp_get_notify_ack_fc_e(ispsoftc_t
*isp
, na_fcentry_e_t
*src
, na_fcentry_e_t
*dst
)
3644 isp_get_hdr(isp
, &src
->na_header
, &dst
->na_header
);
3645 ISP_IOXGET_32(isp
, &src
->na_reserved
, dst
->na_reserved
);
3646 ISP_IOXGET_16(isp
, &src
->na_iid
, dst
->na_iid
);
3647 ISP_IOXGET_16(isp
, &src
->na_response
, dst
->na_response
);
3648 ISP_IOXGET_16(isp
, &src
->na_flags
, dst
->na_flags
);
3649 ISP_IOXGET_16(isp
, &src
->na_reserved2
, dst
->na_reserved2
);
3650 ISP_IOXGET_16(isp
, &src
->na_status
, dst
->na_status
);
3651 ISP_IOXGET_16(isp
, &src
->na_task_flags
, dst
->na_task_flags
);
3652 ISP_IOXGET_16(isp
, &src
->na_seqid
, dst
->na_seqid
);
3653 for (i
= 0; i
< NA2_RSVDLEN
; i
++) {
3654 ISP_IOXGET_16(isp
, &src
->na_reserved3
[i
], dst
->na_reserved3
[i
]);
3659 isp_get_notify_ack_24xx(ispsoftc_t
*isp
, na_fcentry_24xx_t
*src
, na_fcentry_24xx_t
*dst
)
3663 isp_get_hdr(isp
, &src
->na_header
, &dst
->na_header
);
3664 ISP_IOXGET_32(isp
, &src
->na_handle
, dst
->na_handle
);
3665 ISP_IOXGET_16(isp
, &src
->na_nphdl
, dst
->na_nphdl
);
3666 ISP_IOXGET_16(isp
, &src
->na_reserved1
, dst
->na_reserved1
);
3667 ISP_IOXGET_16(isp
, &src
->na_flags
, dst
->na_flags
);
3668 ISP_IOXGET_16(isp
, &src
->na_srr_rxid
, dst
->na_srr_rxid
);
3669 ISP_IOXGET_16(isp
, &src
->na_status
, dst
->na_status
);
3670 ISP_IOXGET_8(isp
, &src
->na_status_subcode
, dst
->na_status_subcode
);
3671 ISP_IOXGET_16(isp
, &src
->na_reserved2
, dst
->na_reserved2
);
3672 ISP_IOXGET_32(isp
, &src
->na_rxid
, dst
->na_rxid
);
3673 ISP_IOXGET_16(isp
, &src
->na_srr_reloff_hi
, dst
->na_srr_reloff_hi
);
3674 ISP_IOXGET_16(isp
, &src
->na_srr_reloff_lo
, dst
->na_srr_reloff_lo
);
3675 ISP_IOXGET_16(isp
, &src
->na_srr_iu
, dst
->na_srr_iu
);
3676 ISP_IOXGET_16(isp
, &src
->na_srr_flags
, dst
->na_srr_flags
);
3677 for (i
= 0; i
< 18; i
++) {
3678 ISP_IOXGET_8(isp
, &src
->na_reserved3
[i
], dst
->na_reserved3
[i
]);
3680 ISP_IOXGET_8(isp
, &src
->na_reserved4
, dst
->na_reserved4
);
3681 ISP_IOXGET_8(isp
, &src
->na_vpidx
, dst
->na_vpidx
);
3682 ISP_IOXGET_8(isp
, &src
->na_srr_reject_vunique
, dst
->na_srr_reject_vunique
);
3683 ISP_IOXGET_8(isp
, &src
->na_srr_reject_explanation
, dst
->na_srr_reject_explanation
);
3684 ISP_IOXGET_8(isp
, &src
->na_srr_reject_code
, dst
->na_srr_reject_code
);
3685 ISP_IOXGET_8(isp
, &src
->na_reserved5
, dst
->na_reserved5
);
3686 for (i
= 0; i
< 6; i
++) {
3687 ISP_IOXGET_8(isp
, &src
->na_reserved6
[i
], dst
->na_reserved6
[i
]);
3689 ISP_IOXGET_16(isp
, &src
->na_oxid
, dst
->na_oxid
);
3693 isp_get_abts(ispsoftc_t
*isp
, abts_t
*src
, abts_t
*dst
)
3697 isp_get_hdr(isp
, &src
->abts_header
, &dst
->abts_header
);
3698 for (i
= 0; i
< 6; i
++) {
3699 ISP_IOXGET_8(isp
, &src
->abts_reserved0
[i
], dst
->abts_reserved0
[i
]);
3701 ISP_IOXGET_16(isp
, &src
->abts_nphdl
, dst
->abts_nphdl
);
3702 ISP_IOXGET_16(isp
, &src
->abts_reserved1
, dst
->abts_reserved1
);
3703 ISP_IOXGET_16(isp
, &src
->abts_sof
, dst
->abts_sof
);
3704 ISP_IOXGET_32(isp
, &src
->abts_rxid_abts
, dst
->abts_rxid_abts
);
3705 ISP_IOXGET_16(isp
, &src
->abts_did_lo
, dst
->abts_did_lo
);
3706 ISP_IOXGET_8(isp
, &src
->abts_did_hi
, dst
->abts_did_hi
);
3707 ISP_IOXGET_8(isp
, &src
->abts_r_ctl
, dst
->abts_r_ctl
);
3708 ISP_IOXGET_16(isp
, &src
->abts_sid_lo
, dst
->abts_sid_lo
);
3709 ISP_IOXGET_8(isp
, &src
->abts_sid_hi
, dst
->abts_sid_hi
);
3710 ISP_IOXGET_8(isp
, &src
->abts_cs_ctl
, dst
->abts_cs_ctl
);
3711 ISP_IOXGET_16(isp
, &src
->abts_fs_ctl
, dst
->abts_fs_ctl
);
3712 ISP_IOXGET_8(isp
, &src
->abts_f_ctl
, dst
->abts_f_ctl
);
3713 ISP_IOXGET_8(isp
, &src
->abts_type
, dst
->abts_type
);
3714 ISP_IOXGET_16(isp
, &src
->abts_seq_cnt
, dst
->abts_seq_cnt
);
3715 ISP_IOXGET_8(isp
, &src
->abts_df_ctl
, dst
->abts_df_ctl
);
3716 ISP_IOXGET_8(isp
, &src
->abts_seq_id
, dst
->abts_seq_id
);
3717 ISP_IOXGET_16(isp
, &src
->abts_rx_id
, dst
->abts_rx_id
);
3718 ISP_IOXGET_16(isp
, &src
->abts_ox_id
, dst
->abts_ox_id
);
3719 ISP_IOXGET_32(isp
, &src
->abts_param
, dst
->abts_param
);
3720 for (i
= 0; i
< 16; i
++) {
3721 ISP_IOXGET_8(isp
, &src
->abts_reserved2
[i
], dst
->abts_reserved2
[i
]);
3723 ISP_IOXGET_32(isp
, &src
->abts_rxid_task
, dst
->abts_rxid_task
);
3727 isp_put_abts_rsp(ispsoftc_t
*isp
, abts_rsp_t
*src
, abts_rsp_t
*dst
)
3731 isp_put_hdr(isp
, &src
->abts_rsp_header
, &dst
->abts_rsp_header
);
3732 ISP_IOXPUT_32(isp
, src
->abts_rsp_handle
, &dst
->abts_rsp_handle
);
3733 ISP_IOXPUT_16(isp
, src
->abts_rsp_status
, &dst
->abts_rsp_status
);
3734 ISP_IOXPUT_16(isp
, src
->abts_rsp_nphdl
, &dst
->abts_rsp_nphdl
);
3735 ISP_IOXPUT_16(isp
, src
->abts_rsp_ctl_flags
, &dst
->abts_rsp_ctl_flags
);
3736 ISP_IOXPUT_16(isp
, src
->abts_rsp_sof
, &dst
->abts_rsp_sof
);
3737 ISP_IOXPUT_32(isp
, src
->abts_rsp_rxid_abts
, &dst
->abts_rsp_rxid_abts
);
3738 ISP_IOXPUT_16(isp
, src
->abts_rsp_did_lo
, &dst
->abts_rsp_did_lo
);
3739 ISP_IOXPUT_8(isp
, src
->abts_rsp_did_hi
, &dst
->abts_rsp_did_hi
);
3740 ISP_IOXPUT_8(isp
, src
->abts_rsp_r_ctl
, &dst
->abts_rsp_r_ctl
);
3741 ISP_IOXPUT_16(isp
, src
->abts_rsp_sid_lo
, &dst
->abts_rsp_sid_lo
);
3742 ISP_IOXPUT_8(isp
, src
->abts_rsp_sid_hi
, &dst
->abts_rsp_sid_hi
);
3743 ISP_IOXPUT_8(isp
, src
->abts_rsp_cs_ctl
, &dst
->abts_rsp_cs_ctl
);
3744 ISP_IOXPUT_16(isp
, src
->abts_rsp_f_ctl_lo
, &dst
->abts_rsp_f_ctl_lo
);
3745 ISP_IOXPUT_8(isp
, src
->abts_rsp_f_ctl_hi
, &dst
->abts_rsp_f_ctl_hi
);
3746 ISP_IOXPUT_8(isp
, src
->abts_rsp_type
, &dst
->abts_rsp_type
);
3747 ISP_IOXPUT_16(isp
, src
->abts_rsp_seq_cnt
, &dst
->abts_rsp_seq_cnt
);
3748 ISP_IOXPUT_8(isp
, src
->abts_rsp_df_ctl
, &dst
->abts_rsp_df_ctl
);
3749 ISP_IOXPUT_8(isp
, src
->abts_rsp_seq_id
, &dst
->abts_rsp_seq_id
);
3750 ISP_IOXPUT_16(isp
, src
->abts_rsp_rx_id
, &dst
->abts_rsp_rx_id
);
3751 ISP_IOXPUT_16(isp
, src
->abts_rsp_ox_id
, &dst
->abts_rsp_ox_id
);
3752 ISP_IOXPUT_32(isp
, src
->abts_rsp_param
, &dst
->abts_rsp_param
);
3753 if (src
->abts_rsp_r_ctl
== BA_ACC
) {
3754 ISP_IOXPUT_16(isp
, src
->abts_rsp_payload
.ba_acc
.reserved
, &dst
->abts_rsp_payload
.ba_acc
.reserved
);
3755 ISP_IOXPUT_8(isp
, src
->abts_rsp_payload
.ba_acc
.last_seq_id
, &dst
->abts_rsp_payload
.ba_acc
.last_seq_id
);
3756 ISP_IOXPUT_8(isp
, src
->abts_rsp_payload
.ba_acc
.seq_id_valid
, &dst
->abts_rsp_payload
.ba_acc
.seq_id_valid
);
3757 ISP_IOXPUT_16(isp
, src
->abts_rsp_payload
.ba_acc
.aborted_rx_id
, &dst
->abts_rsp_payload
.ba_acc
.aborted_rx_id
);
3758 ISP_IOXPUT_16(isp
, src
->abts_rsp_payload
.ba_acc
.aborted_ox_id
, &dst
->abts_rsp_payload
.ba_acc
.aborted_ox_id
);
3759 ISP_IOXPUT_16(isp
, src
->abts_rsp_payload
.ba_acc
.high_seq_cnt
, &dst
->abts_rsp_payload
.ba_acc
.high_seq_cnt
);
3760 ISP_IOXPUT_16(isp
, src
->abts_rsp_payload
.ba_acc
.low_seq_cnt
, &dst
->abts_rsp_payload
.ba_acc
.low_seq_cnt
);
3761 for (i
= 0; i
< 4; i
++) {
3762 ISP_IOXPUT_16(isp
, src
->abts_rsp_payload
.ba_acc
.reserved2
[i
], &dst
->abts_rsp_payload
.ba_acc
.reserved2
[i
]);
3764 } else if (src
->abts_rsp_r_ctl
== BA_RJT
) {
3765 ISP_IOXPUT_8(isp
, src
->abts_rsp_payload
.ba_rjt
.vendor_unique
, &dst
->abts_rsp_payload
.ba_rjt
.vendor_unique
);
3766 ISP_IOXPUT_8(isp
, src
->abts_rsp_payload
.ba_rjt
.explanation
, &dst
->abts_rsp_payload
.ba_rjt
.explanation
);
3767 ISP_IOXPUT_8(isp
, src
->abts_rsp_payload
.ba_rjt
.reason
, &dst
->abts_rsp_payload
.ba_rjt
.reason
);
3768 ISP_IOXPUT_8(isp
, src
->abts_rsp_payload
.ba_rjt
.reserved
, &dst
->abts_rsp_payload
.ba_rjt
.reserved
);
3769 for (i
= 0; i
< 12; i
++) {
3770 ISP_IOXPUT_16(isp
, src
->abts_rsp_payload
.ba_rjt
.reserved2
[i
], &dst
->abts_rsp_payload
.ba_rjt
.reserved2
[i
]);
3773 for (i
= 0; i
< 16; i
++) {
3774 ISP_IOXPUT_8(isp
, src
->abts_rsp_payload
.reserved
[i
], &dst
->abts_rsp_payload
.reserved
[i
]);
3777 ISP_IOXPUT_32(isp
, src
->abts_rsp_rxid_task
, &dst
->abts_rsp_rxid_task
);
3781 isp_get_abts_rsp(ispsoftc_t
*isp
, abts_rsp_t
*src
, abts_rsp_t
*dst
)
3785 isp_get_hdr(isp
, &src
->abts_rsp_header
, &dst
->abts_rsp_header
);
3786 ISP_IOXGET_32(isp
, &src
->abts_rsp_handle
, dst
->abts_rsp_handle
);
3787 ISP_IOXGET_16(isp
, &src
->abts_rsp_status
, dst
->abts_rsp_status
);
3788 ISP_IOXGET_16(isp
, &src
->abts_rsp_nphdl
, dst
->abts_rsp_nphdl
);
3789 ISP_IOXGET_16(isp
, &src
->abts_rsp_ctl_flags
, dst
->abts_rsp_ctl_flags
);
3790 ISP_IOXGET_16(isp
, &src
->abts_rsp_sof
, dst
->abts_rsp_sof
);
3791 ISP_IOXGET_32(isp
, &src
->abts_rsp_rxid_abts
, dst
->abts_rsp_rxid_abts
);
3792 ISP_IOXGET_16(isp
, &src
->abts_rsp_did_lo
, dst
->abts_rsp_did_lo
);
3793 ISP_IOXGET_8(isp
, &src
->abts_rsp_did_hi
, dst
->abts_rsp_did_hi
);
3794 ISP_IOXGET_8(isp
, &src
->abts_rsp_r_ctl
, dst
->abts_rsp_r_ctl
);
3795 ISP_IOXGET_16(isp
, &src
->abts_rsp_sid_lo
, dst
->abts_rsp_sid_lo
);
3796 ISP_IOXGET_8(isp
, &src
->abts_rsp_sid_hi
, dst
->abts_rsp_sid_hi
);
3797 ISP_IOXGET_8(isp
, &src
->abts_rsp_cs_ctl
, dst
->abts_rsp_cs_ctl
);
3798 ISP_IOXGET_16(isp
, &src
->abts_rsp_f_ctl_lo
, dst
->abts_rsp_f_ctl_lo
);
3799 ISP_IOXGET_8(isp
, &src
->abts_rsp_f_ctl_hi
, dst
->abts_rsp_f_ctl_hi
);
3800 ISP_IOXGET_8(isp
, &src
->abts_rsp_type
, dst
->abts_rsp_type
);
3801 ISP_IOXGET_16(isp
, &src
->abts_rsp_seq_cnt
, dst
->abts_rsp_seq_cnt
);
3802 ISP_IOXGET_8(isp
, &src
->abts_rsp_df_ctl
, dst
->abts_rsp_df_ctl
);
3803 ISP_IOXGET_8(isp
, &src
->abts_rsp_seq_id
, dst
->abts_rsp_seq_id
);
3804 ISP_IOXGET_16(isp
, &src
->abts_rsp_rx_id
, dst
->abts_rsp_rx_id
);
3805 ISP_IOXGET_16(isp
, &src
->abts_rsp_ox_id
, dst
->abts_rsp_ox_id
);
3806 ISP_IOXGET_32(isp
, &src
->abts_rsp_param
, dst
->abts_rsp_param
);
3807 for (i
= 0; i
< 8; i
++) {
3808 ISP_IOXGET_8(isp
, &src
->abts_rsp_payload
.rsp
.reserved
[i
], dst
->abts_rsp_payload
.rsp
.reserved
[i
]);
3810 ISP_IOXGET_32(isp
, &src
->abts_rsp_payload
.rsp
.subcode1
, dst
->abts_rsp_payload
.rsp
.subcode1
);
3811 ISP_IOXGET_32(isp
, &src
->abts_rsp_payload
.rsp
.subcode2
, dst
->abts_rsp_payload
.rsp
.subcode2
);
3812 ISP_IOXGET_32(isp
, &src
->abts_rsp_rxid_task
, dst
->abts_rsp_rxid_task
);
3814 #endif /* ISP_TARGET_MODE */