3 * Qlogic Host Adapter Inline Functions
5 * Copyright (c) 1999, 2000, 2001 by Matthew Jacob
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice immediately at the beginning of the file, without modification,
15 * this list of conditions, and the following disclaimer.
16 * 2. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * For each outstanding command there will be a non-zero handle.
38 * There will be at most isp_maxcmds handles, and isp_lasthdls
39 * will be a seed for the last handled allocated.
42 static INLINE int isp_save_xs(struct ispsoftc *, XS_T *, u_int16_t *);
43 static INLINE XS_T *isp_find_xs(struct ispsoftc *, u_int16_t);
44 static INLINE u_int16_t isp_find_handle(struct ispsoftc *, XS_T *);
45 static INLINE int isp_handle_index(u_int16_t);
46 static INLINE u_int16_t isp_index_handle(int);
47 static INLINE void isp_destroy_handle(struct ispsoftc *, u_int16_t);
50 isp_save_xs(struct ispsoftc *isp, XS_T *xs, u_int16_t *handlep)
54 for (j = isp->isp_lasthdls, i = 0; i < (int) isp->isp_maxcmds; i++) {
55 if (isp->isp_xflist[j] == NULL) {
58 if (++j == isp->isp_maxcmds) {
62 if (i == isp->isp_maxcmds) {
65 isp->isp_xflist[j] = xs;
67 if (++j == isp->isp_maxcmds)
69 isp->isp_lasthdls = (u_int16_t)j;
74 isp_find_xs(struct ispsoftc *isp, u_int16_t handle)
76 if (handle < 1 || handle > (u_int16_t) isp->isp_maxcmds) {
79 return (isp->isp_xflist[handle - 1]);
83 static INLINE u_int16_t
84 isp_find_handle(struct ispsoftc *isp, XS_T *xs)
88 for (i = 0; i < isp->isp_maxcmds; i++) {
89 if (isp->isp_xflist[i] == xs) {
90 return ((u_int16_t) i+1);
98 isp_handle_index(u_int16_t handle)
103 static INLINE u_int16_t
104 isp_index_handle(int index)
110 isp_destroy_handle(struct ispsoftc *isp, u_int16_t handle)
112 if (handle > 0 && handle <= (u_int16_t) isp->isp_maxcmds) {
113 isp->isp_xflist[handle - 1] = NULL;
117 #ifdef ISP_TARGET_MODE
118 static INLINE int isp_save_xs_tgt(struct ispsoftc *, void *, u_int16_t *);
119 static INLINE void *isp_find_xs_tgt(struct ispsoftc *, u_int16_t);
120 static INLINE void isp_destroy_tgt_handle(struct ispsoftc *, u_int16_t);
123 isp_save_xs_tgt(struct ispsoftc *isp, void *xs, u_int16_t *handlep)
127 for (i = 0; i < (int) isp->isp_maxcmds; i++) {
128 if (isp->isp_tgtlist[i] == NULL) {
132 if (i == isp->isp_maxcmds) {
135 isp->isp_tgtlist[i] = xs;
141 isp_find_xs_tgt(struct ispsoftc *isp, u_int16_t handle)
143 if (handle < 1 || handle > (u_int16_t) isp->isp_maxcmds) {
146 return (isp->isp_tgtlist[handle - 1]);
150 static INLINE u_int16_t
151 isp_find_tgt_handle(struct ispsoftc *isp, void *xs)
155 for (i = 0; i < isp->isp_maxcmds; i++) {
156 if (isp->isp_tgtlist[i] == xs) {
157 return ((u_int16_t) i+1);
165 isp_destroy_tgt_handle(struct ispsoftc *isp, u_int16_t handle)
167 if (handle > 0 && handle <= (u_int16_t) isp->isp_maxcmds) {
168 isp->isp_tgtlist[handle - 1] = NULL;
175 isp_getrqentry(struct ispsoftc *, u_int16_t *, u_int16_t *, void **);
178 isp_getrqentry(struct ispsoftc *isp, u_int16_t *iptrp,
179 u_int16_t *optrp, void **resultp)
181 volatile u_int16_t iptr, optr;
183 optr = isp->isp_reqodx = READ_REQUEST_QUEUE_OUT_POINTER(isp);
184 iptr = isp->isp_reqidx;
185 *resultp = ISP_QUEUE_ENTRY(isp->isp_rquest, iptr);
186 iptr = ISP_NXT_QENTRY(iptr, RQUEST_QUEUE_LEN(isp));
197 static INLINE void isp_print_qentry (struct ispsoftc *, char *, int, void *);
200 #define TBA (4 * (((QENTRY_LEN >> 2) * 3) + 1) + 1)
202 isp_print_qentry(struct ispsoftc *isp, char *msg, int idx, void *arg)
208 isp_prt(isp, ISP_LOGALL, "%s index %d=>", msg, idx);
209 for (buf[0] = 0, amt = i = 0; i < 4; i++) {
211 SNPRINTF(buf, TBA, " ");
212 for (j = 0; j < (QENTRY_LEN >> 2); j++) {
213 SNPRINTF(buf, TBA, "%s %02x", buf, ptr[amt++] & 0xff);
215 isp_prt(isp, ISP_LOGALL, buf);
219 static INLINE void isp_print_bytes(struct ispsoftc *, char *, int, void *);
222 isp_print_bytes(struct ispsoftc *isp, char *msg, int amt, void *arg)
229 isp_prt(isp, ISP_LOGALL, "%s:", msg);
235 for (j = 0; j < 16; j++) {
236 SNPRINTF(buf, 128, "%s %02x", buf, ptr[off++] & 0xff);
240 isp_prt(isp, ISP_LOGALL, "0x%08x:%s", to, buf);
246 * Do the common path to try and ensure that link is up, we've scanned
247 * the fabric (if we're on a fabric), and that we've synchronized this
248 * all with our own database and done the appropriate logins.
250 * We repeatedly check for firmware state and loop state after each
251 * action because things may have changed while we were doing this.
252 * Any failure or change of state causes us to return a nonzero value.
254 * We honor HBA roles in that if we're not in Initiator mode, we don't
255 * attempt to sync up the database (that's for somebody else to do,
258 * We assume we enter here with any locks held.
261 static INLINE int isp_fc_runstate(struct ispsoftc *, int);
264 isp_fc_runstate(struct ispsoftc *isp, int tval)
272 tptr = tval? &tval : NULL;
273 if (isp_control(isp, ISPCTL_FCLINK_TEST, tptr) != 0) {
277 if (fcp->isp_fwstate != FW_READY || fcp->isp_loopstate < LOOP_PDB_RCVD)
279 if (isp_control(isp, ISPCTL_SCAN_FABRIC, NULL) != 0) {
282 if (isp_control(isp, ISPCTL_SCAN_LOOP, NULL) != 0) {
285 if ((isp->isp_role & ISP_ROLE_INITIATOR) == 0) {
288 if (isp_control(isp, ISPCTL_PDB_SYNC, NULL) != 0) {
291 if (fcp->isp_fwstate != FW_READY || fcp->isp_loopstate != LOOP_READY) {
298 * Functions to move stuff to a form that the QLogic RISC engine understands
299 * and functions to move stuff back to a form the processor understands.
301 * Each platform is required to provide the 8, 16 and 32 bit
302 * swizzle and unswizzle macros (ISP_IOX{PUT|GET}_{8,16,32})
304 * The assumption is that swizzling and unswizzling is mostly done 'in place'
305 * (with a few exceptions for efficiency).
308 static INLINE void isp_copy_out_hdr(struct ispsoftc *, isphdr_t *, isphdr_t *);
309 static INLINE void isp_copy_in_hdr(struct ispsoftc *, isphdr_t *, isphdr_t *);
310 static INLINE int isp_get_response_type(struct ispsoftc *, isphdr_t *);
313 isp_put_request(struct ispsoftc *, ispreq_t *, ispreq_t *);
315 isp_put_request_t2(struct ispsoftc *, ispreqt2_t *, ispreqt2_t *);
317 isp_put_request_t3(struct ispsoftc *, ispreqt3_t *, ispreqt3_t *);
319 isp_put_extended_request(struct ispsoftc *, ispextreq_t *, ispextreq_t *);
321 isp_put_cont_req(struct ispsoftc *, ispcontreq_t *, ispcontreq_t *);
323 isp_put_cont64_req(struct ispsoftc *, ispcontreq64_t *, ispcontreq64_t *);
325 isp_get_response(struct ispsoftc *, ispstatusreq_t *, ispstatusreq_t *);
327 isp_get_response_x(struct ispsoftc *, ispstatus_cont_t *, ispstatus_cont_t *);
329 isp_get_rio2(struct ispsoftc *, isp_rio2_t *, isp_rio2_t *);
331 isp_put_icb(struct ispsoftc *, isp_icb_t *, isp_icb_t *);
333 isp_get_pdb(struct ispsoftc *, isp_pdb_t *, isp_pdb_t *);
335 isp_get_ct_hdr(struct ispsoftc *isp, ct_hdr_t *, ct_hdr_t *);
337 isp_put_sns_request(struct ispsoftc *, sns_screq_t *, sns_screq_t *);
339 isp_put_gid_ft_request(struct ispsoftc *, sns_gid_ft_req_t *,
342 isp_put_gxn_id_request(struct ispsoftc *, sns_gxn_id_req_t *,
345 isp_get_sns_response(struct ispsoftc *, sns_scrsp_t *, sns_scrsp_t *, int);
347 isp_get_gid_ft_response(struct ispsoftc *, sns_gid_ft_rsp_t *,
348 sns_gid_ft_rsp_t *, int);
350 isp_get_gxn_id_response(struct ispsoftc *, sns_gxn_id_rsp_t *,
353 isp_get_gff_id_response(struct ispsoftc *, sns_gff_id_rsp_t *,
356 isp_get_ga_nxt_response(struct ispsoftc *, sns_ga_nxt_rsp_t *,
358 #ifdef ISP_TARGET_MODE
359 #ifndef _ISP_TARGET_H
360 #include "isp_target.h"
363 isp_put_atio(struct ispsoftc *, at_entry_t *, at_entry_t *);
365 isp_get_atio(struct ispsoftc *, at_entry_t *, at_entry_t *);
367 isp_put_atio2(struct ispsoftc *, at2_entry_t *, at2_entry_t *);
369 isp_get_atio2(struct ispsoftc *, at2_entry_t *, at2_entry_t *);
371 isp_put_ctio(struct ispsoftc *, ct_entry_t *, ct_entry_t *);
373 isp_get_ctio(struct ispsoftc *, ct_entry_t *, ct_entry_t *);
375 isp_put_ctio2(struct ispsoftc *, ct2_entry_t *, ct2_entry_t *);
377 isp_get_ctio2(struct ispsoftc *, ct2_entry_t *, ct2_entry_t *);
379 isp_put_enable_lun(struct ispsoftc *, lun_entry_t *, lun_entry_t *);
381 isp_get_enable_lun(struct ispsoftc *, lun_entry_t *, lun_entry_t *);
383 isp_put_notify(struct ispsoftc *, in_entry_t *, in_entry_t *);
385 isp_get_notify(struct ispsoftc *, in_entry_t *, in_entry_t *);
387 isp_put_notify_fc(struct ispsoftc *, in_fcentry_t *, in_fcentry_t *);
389 isp_get_notify_fc(struct ispsoftc *, in_fcentry_t *, in_fcentry_t *);
391 isp_put_notify_ack(struct ispsoftc *, na_entry_t *, na_entry_t *);
393 isp_get_notify_ack(struct ispsoftc *, na_entry_t *, na_entry_t *);
395 isp_put_notify_ack_fc(struct ispsoftc *, na_fcentry_t *, na_fcentry_t *);
397 isp_get_notify_ack_fc(struct ispsoftc *, na_fcentry_t *, na_fcentry_t *);
400 #define ISP_IS_SBUS(isp) \
401 (ISP_SBUS_SUPPORTED && (isp)->isp_bustype == ISP_BT_SBUS)
404 * Swizzle/Copy Functions
407 isp_copy_out_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst)
409 if (ISP_IS_SBUS(isp)) {
410 ISP_IOXPUT_8(isp, hpsrc->rqs_entry_type,
411 &hpdst->rqs_entry_count);
412 ISP_IOXPUT_8(isp, hpsrc->rqs_entry_count,
413 &hpdst->rqs_entry_type);
414 ISP_IOXPUT_8(isp, hpsrc->rqs_seqno,
416 ISP_IOXPUT_8(isp, hpsrc->rqs_flags,
419 ISP_IOXPUT_8(isp, hpsrc->rqs_entry_type,
420 &hpdst->rqs_entry_type);
421 ISP_IOXPUT_8(isp, hpsrc->rqs_entry_count,
422 &hpdst->rqs_entry_count);
423 ISP_IOXPUT_8(isp, hpsrc->rqs_seqno,
425 ISP_IOXPUT_8(isp, hpsrc->rqs_flags,
431 isp_copy_in_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst)
433 if (ISP_IS_SBUS(isp)) {
434 ISP_IOXGET_8(isp, &hpsrc->rqs_entry_type,
435 hpdst->rqs_entry_count);
436 ISP_IOXGET_8(isp, &hpsrc->rqs_entry_count,
437 hpdst->rqs_entry_type);
438 ISP_IOXGET_8(isp, &hpsrc->rqs_seqno,
440 ISP_IOXGET_8(isp, &hpsrc->rqs_flags,
443 ISP_IOXGET_8(isp, &hpsrc->rqs_entry_type,
444 hpdst->rqs_entry_type);
445 ISP_IOXGET_8(isp, &hpsrc->rqs_entry_count,
446 hpdst->rqs_entry_count);
447 ISP_IOXGET_8(isp, &hpsrc->rqs_seqno,
449 ISP_IOXGET_8(isp, &hpsrc->rqs_flags,
455 isp_get_response_type(struct ispsoftc *isp, isphdr_t *hp)
458 if (ISP_IS_SBUS(isp)) {
459 ISP_IOXGET_8(isp, &hp->rqs_entry_count, type);
461 ISP_IOXGET_8(isp, &hp->rqs_entry_type, type);
467 isp_put_request(struct ispsoftc *isp, ispreq_t *rqsrc, ispreq_t *rqdst)
470 isp_copy_out_hdr(isp, &rqsrc->req_header, &rqdst->req_header);
471 ISP_IOXPUT_32(isp, rqsrc->req_handle, &rqdst->req_handle);
472 if (ISP_IS_SBUS(isp)) {
473 ISP_IOXPUT_8(isp, rqsrc->req_lun_trn, &rqdst->req_target);
474 ISP_IOXPUT_8(isp, rqsrc->req_target, &rqdst->req_lun_trn);
476 ISP_IOXPUT_8(isp, rqsrc->req_lun_trn, &rqdst->req_lun_trn);
477 ISP_IOXPUT_8(isp, rqsrc->req_target, &rqdst->req_target);
479 ISP_IOXPUT_16(isp, rqsrc->req_cdblen, &rqdst->req_cdblen);
480 ISP_IOXPUT_16(isp, rqsrc->req_flags, &rqdst->req_flags);
481 ISP_IOXPUT_16(isp, rqsrc->req_time, &rqdst->req_time);
482 ISP_IOXPUT_16(isp, rqsrc->req_seg_count, &rqdst->req_seg_count);
483 for (i = 0; i < 12; i++) {
484 ISP_IOXPUT_8(isp, rqsrc->req_cdb[i], &rqdst->req_cdb[i]);
486 for (i = 0; i < ISP_RQDSEG; i++) {
487 ISP_IOXPUT_32(isp, rqsrc->req_dataseg[i].ds_base,
488 &rqdst->req_dataseg[i].ds_base);
489 ISP_IOXPUT_32(isp, rqsrc->req_dataseg[i].ds_count,
490 &rqdst->req_dataseg[i].ds_count);
495 isp_put_request_t2(struct ispsoftc *isp, ispreqt2_t *tqsrc, ispreqt2_t *tqdst)
498 isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header);
499 ISP_IOXPUT_32(isp, tqsrc->req_handle, &tqdst->req_handle);
500 ISP_IOXPUT_8(isp, tqsrc->req_lun_trn, &tqdst->req_lun_trn);
501 ISP_IOXPUT_8(isp, tqsrc->req_target, &tqdst->req_target);
502 ISP_IOXPUT_16(isp, tqsrc->req_scclun, &tqdst->req_scclun);
503 ISP_IOXPUT_16(isp, tqsrc->req_flags, &tqdst->req_flags);
504 ISP_IOXPUT_16(isp, tqsrc->_res2, &tqdst->_res2);
505 ISP_IOXPUT_16(isp, tqsrc->req_time, &tqdst->req_time);
506 ISP_IOXPUT_16(isp, tqsrc->req_seg_count, &tqdst->req_seg_count);
507 for (i = 0; i < 16; i++) {
508 ISP_IOXPUT_8(isp, tqsrc->req_cdb[i], &tqdst->req_cdb[i]);
510 ISP_IOXPUT_32(isp, tqsrc->req_totalcnt, &tqdst->req_totalcnt);
511 for (i = 0; i < ISP_RQDSEG_T2; i++) {
512 ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_base,
513 &tqdst->req_dataseg[i].ds_base);
514 ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_count,
515 &tqdst->req_dataseg[i].ds_count);
520 isp_put_request_t3(struct ispsoftc *isp, ispreqt3_t *tqsrc, ispreqt3_t *tqdst)
523 isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header);
524 ISP_IOXPUT_32(isp, tqsrc->req_handle, &tqdst->req_handle);
525 ISP_IOXPUT_8(isp, tqsrc->req_lun_trn, &tqdst->req_lun_trn);
526 ISP_IOXPUT_8(isp, tqsrc->req_target, &tqdst->req_target);
527 ISP_IOXPUT_16(isp, tqsrc->req_scclun, &tqdst->req_scclun);
528 ISP_IOXPUT_16(isp, tqsrc->req_flags, &tqdst->req_flags);
529 ISP_IOXPUT_16(isp, tqsrc->_res2, &tqdst->_res2);
530 ISP_IOXPUT_16(isp, tqsrc->req_time, &tqdst->req_time);
531 ISP_IOXPUT_16(isp, tqsrc->req_seg_count, &tqdst->req_seg_count);
532 for (i = 0; i < 16; i++) {
533 ISP_IOXPUT_8(isp, tqsrc->req_cdb[i], &tqdst->req_cdb[i]);
535 ISP_IOXPUT_32(isp, tqsrc->req_totalcnt, &tqdst->req_totalcnt);
536 for (i = 0; i < ISP_RQDSEG_T3; i++) {
537 ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_base,
538 &tqdst->req_dataseg[i].ds_base);
539 ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_basehi,
540 &tqdst->req_dataseg[i].ds_basehi);
541 ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_count,
542 &tqdst->req_dataseg[i].ds_count);
547 isp_put_extended_request(struct ispsoftc *isp, ispextreq_t *xqsrc,
551 isp_copy_out_hdr(isp, &xqsrc->req_header, &xqdst->req_header);
552 ISP_IOXPUT_32(isp, xqsrc->req_handle, &xqdst->req_handle);
553 if (ISP_IS_SBUS(isp)) {
554 ISP_IOXPUT_8(isp, xqsrc->req_lun_trn, &xqdst->req_target);
555 ISP_IOXPUT_8(isp, xqsrc->req_target, &xqdst->req_lun_trn);
557 ISP_IOXPUT_8(isp, xqsrc->req_lun_trn, &xqdst->req_lun_trn);
558 ISP_IOXPUT_8(isp, xqsrc->req_target, &xqdst->req_target);
560 ISP_IOXPUT_16(isp, xqsrc->req_cdblen, &xqdst->req_cdblen);
561 ISP_IOXPUT_16(isp, xqsrc->req_flags, &xqdst->req_flags);
562 ISP_IOXPUT_16(isp, xqsrc->req_time, &xqdst->req_time);
563 ISP_IOXPUT_16(isp, xqsrc->req_seg_count, &xqdst->req_seg_count);
564 for (i = 0; i < 44; i++) {
565 ISP_IOXPUT_8(isp, xqsrc->req_cdb[i], &xqdst->req_cdb[i]);
570 isp_put_cont_req(struct ispsoftc *isp, ispcontreq_t *cqsrc, ispcontreq_t *cqdst)
573 isp_copy_out_hdr(isp, &cqsrc->req_header, &cqdst->req_header);
574 for (i = 0; i < ISP_CDSEG; i++) {
575 ISP_IOXPUT_32(isp, cqsrc->req_dataseg[i].ds_base,
576 &cqdst->req_dataseg[i].ds_base);
577 ISP_IOXPUT_32(isp, cqsrc->req_dataseg[i].ds_count,
578 &cqdst->req_dataseg[i].ds_count);
583 isp_put_cont64_req(struct ispsoftc *isp, ispcontreq64_t *cqsrc,
584 ispcontreq64_t *cqdst)
587 isp_copy_out_hdr(isp, &cqsrc->req_header, &cqdst->req_header);
588 for (i = 0; i < ISP_CDSEG64; i++) {
589 ISP_IOXPUT_32(isp, cqsrc->req_dataseg[i].ds_base,
590 &cqdst->req_dataseg[i].ds_base);
591 ISP_IOXPUT_32(isp, cqsrc->req_dataseg[i].ds_basehi,
592 &cqdst->req_dataseg[i].ds_basehi);
593 ISP_IOXPUT_32(isp, cqsrc->req_dataseg[i].ds_count,
594 &cqdst->req_dataseg[i].ds_count);
599 isp_get_response(struct ispsoftc *isp, ispstatusreq_t *spsrc,
600 ispstatusreq_t *spdst)
603 isp_copy_in_hdr(isp, &spsrc->req_header, &spdst->req_header);
604 ISP_IOXGET_32(isp, &spsrc->req_handle, spdst->req_handle);
605 ISP_IOXGET_16(isp, &spsrc->req_scsi_status, spdst->req_scsi_status);
606 ISP_IOXGET_16(isp, &spsrc->req_completion_status,
607 spdst->req_completion_status);
608 ISP_IOXGET_16(isp, &spsrc->req_state_flags, spdst->req_state_flags);
609 ISP_IOXGET_16(isp, &spsrc->req_status_flags, spdst->req_status_flags);
610 ISP_IOXGET_16(isp, &spsrc->req_time, spdst->req_time);
611 ISP_IOXGET_16(isp, &spsrc->req_sense_len, spdst->req_sense_len);
612 ISP_IOXGET_32(isp, &spsrc->req_resid, spdst->req_resid);
613 for (i = 0; i < 8; i++) {
614 ISP_IOXGET_8(isp, &spsrc->req_response[i],
615 spdst->req_response[i]);
617 for (i = 0; i < 32; i++) {
618 ISP_IOXGET_8(isp, &spsrc->req_sense_data[i],
619 spdst->req_sense_data[i]);
624 isp_get_response_x(struct ispsoftc *isp, ispstatus_cont_t *cpsrc,
625 ispstatus_cont_t *cpdst)
628 isp_copy_in_hdr(isp, &cpsrc->req_header, &cpdst->req_header);
629 for (i = 0; i < 60; i++) {
630 ISP_IOXGET_8(isp, &cpsrc->req_sense_data[i],
631 cpdst->req_sense_data[i]);
636 isp_get_rio2(struct ispsoftc *isp, isp_rio2_t *r2src, isp_rio2_t *r2dst)
639 isp_copy_in_hdr(isp, &r2src->req_header, &r2dst->req_header);
640 if (r2dst->req_header.rqs_seqno > 30)
641 r2dst->req_header.rqs_seqno = 30;
642 for (i = 0; i < r2dst->req_header.rqs_seqno; i++) {
643 ISP_IOXGET_16(isp, &r2src->req_handles[i],
644 r2dst->req_handles[i]);
647 r2dst->req_handles[i++] = 0;
652 isp_put_icb(struct ispsoftc *isp, isp_icb_t *Is, isp_icb_t *Id)
655 ISP_SWAP8(Is->icb_version, Is->_reserved0);
656 ISP_IOXPUT_8(isp, Is->icb_version, &Id->icb_version);
657 ISP_IOXPUT_8(isp, Is->_reserved0, &Id->_reserved0);
658 ISP_IOXPUT_16(isp, Is->icb_fwoptions, &Id->icb_fwoptions);
659 ISP_IOXPUT_16(isp, Is->icb_maxfrmlen, &Id->icb_maxfrmlen);
660 ISP_IOXPUT_16(isp, Is->icb_maxalloc, &Id->icb_maxalloc);
661 ISP_IOXPUT_16(isp, Is->icb_execthrottle, &Id->icb_execthrottle);
662 ISP_SWAP8(Is->icb_retry_count, Is->icb_retry_delay);
663 ISP_IOXPUT_8(isp, Is->icb_retry_count, &Id->icb_retry_count);
664 ISP_IOXPUT_8(isp, Is->icb_retry_delay, &Id->icb_retry_delay);
665 for (i = 0; i < 8; i++) {
666 ISP_IOXPUT_8(isp, Is->icb_portname[i], &Id->icb_portname[i]);
668 ISP_IOXPUT_16(isp, Is->icb_hardaddr, &Id->icb_hardaddr);
669 ISP_SWAP8(Is->icb_iqdevtype, Is->icb_logintime);
670 ISP_IOXPUT_8(isp, Is->icb_iqdevtype, &Id->icb_iqdevtype);
671 ISP_IOXPUT_8(isp, Is->icb_logintime, &Id->icb_logintime);
672 for (i = 0; i < 8; i++) {
673 ISP_IOXPUT_8(isp, Is->icb_nodename[i], &Id->icb_nodename[i]);
675 ISP_IOXPUT_16(isp, Is->icb_rqstout, &Id->icb_rqstout);
676 ISP_IOXPUT_16(isp, Is->icb_rspnsin, &Id->icb_rspnsin);
677 ISP_IOXPUT_16(isp, Is->icb_rqstqlen, &Id->icb_rqstqlen);
678 ISP_IOXPUT_16(isp, Is->icb_rsltqlen, &Id->icb_rsltqlen);
679 for (i = 0; i < 4; i++) {
680 ISP_IOXPUT_16(isp, Is->icb_rqstaddr[i], &Id->icb_rqstaddr[i]);
682 for (i = 0; i < 4; i++) {
683 ISP_IOXPUT_16(isp, Is->icb_respaddr[i], &Id->icb_respaddr[i]);
685 ISP_IOXPUT_16(isp, Is->icb_lunenables, &Id->icb_lunenables);
686 ISP_SWAP8(Is->icb_ccnt, Is->icb_icnt);
687 ISP_IOXPUT_8(isp, Is->icb_ccnt, &Id->icb_ccnt);
688 ISP_IOXPUT_8(isp, Is->icb_icnt, &Id->icb_icnt);
689 ISP_IOXPUT_16(isp, Is->icb_lunetimeout, &Id->icb_lunetimeout);
690 ISP_IOXPUT_16(isp, Is->icb_xfwoptions, &Id->icb_xfwoptions);
691 ISP_SWAP8(Is->icb_racctimer, Is->icb_idelaytimer);
692 ISP_IOXPUT_8(isp, Is->icb_racctimer, &Id->icb_racctimer);
693 ISP_IOXPUT_8(isp, Is->icb_idelaytimer, &Id->icb_idelaytimer);
694 ISP_IOXPUT_16(isp, Is->icb_zfwoptions, &Id->icb_zfwoptions);
698 isp_get_pdb(struct ispsoftc *isp, isp_pdb_t *src, isp_pdb_t *dst)
701 ISP_IOXGET_16(isp, &src->pdb_options, dst->pdb_options);
702 ISP_IOXGET_8(isp, &src->pdb_mstate, dst->pdb_mstate);
703 ISP_IOXGET_8(isp, &src->pdb_sstate, dst->pdb_sstate);
704 for (i = 0; i < 4; i++) {
705 ISP_IOXGET_8(isp, &src->pdb_hardaddr_bits[i],
706 dst->pdb_hardaddr_bits[i]);
708 for (i = 0; i < 4; i++) {
709 ISP_IOXGET_8(isp, &src->pdb_portid_bits[i],
710 dst->pdb_portid_bits[i]);
712 for (i = 0; i < 8; i++) {
713 ISP_IOXGET_8(isp, &src->pdb_nodename[i], dst->pdb_nodename[i]);
715 for (i = 0; i < 8; i++) {
716 ISP_IOXGET_8(isp, &src->pdb_portname[i], dst->pdb_portname[i]);
718 ISP_IOXGET_16(isp, &src->pdb_execthrottle, dst->pdb_execthrottle);
719 ISP_IOXGET_16(isp, &src->pdb_exec_count, dst->pdb_exec_count);
720 ISP_IOXGET_8(isp, &src->pdb_retry_count, dst->pdb_retry_count);
721 ISP_IOXGET_8(isp, &src->pdb_retry_delay, dst->pdb_retry_delay);
722 ISP_IOXGET_16(isp, &src->pdb_resalloc, dst->pdb_resalloc);
723 ISP_IOXGET_16(isp, &src->pdb_curalloc, dst->pdb_curalloc);
724 ISP_IOXGET_16(isp, &src->pdb_qhead, dst->pdb_qhead);
725 ISP_IOXGET_16(isp, &src->pdb_qtail, dst->pdb_qtail);
726 ISP_IOXGET_16(isp, &src->pdb_tl_next, dst->pdb_tl_next);
727 ISP_IOXGET_16(isp, &src->pdb_tl_last, dst->pdb_tl_last);
728 ISP_IOXGET_16(isp, &src->pdb_features, dst->pdb_features);
729 ISP_IOXGET_16(isp, &src->pdb_pconcurrnt, dst->pdb_pconcurrnt);
730 ISP_IOXGET_16(isp, &src->pdb_roi, dst->pdb_roi);
731 ISP_IOXGET_8(isp, &src->pdb_target, dst->pdb_target);
732 ISP_IOXGET_8(isp, &src->pdb_initiator, dst->pdb_initiator);
733 ISP_IOXGET_16(isp, &src->pdb_rdsiz, dst->pdb_rdsiz);
734 ISP_IOXGET_16(isp, &src->pdb_ncseq, dst->pdb_ncseq);
735 ISP_IOXGET_16(isp, &src->pdb_noseq, dst->pdb_noseq);
736 ISP_IOXGET_16(isp, &src->pdb_labrtflg, dst->pdb_labrtflg);
737 ISP_IOXGET_16(isp, &src->pdb_lstopflg, dst->pdb_lstopflg);
738 ISP_IOXGET_16(isp, &src->pdb_sqhead, dst->pdb_sqhead);
739 ISP_IOXGET_16(isp, &src->pdb_sqtail, dst->pdb_sqtail);
740 ISP_IOXGET_16(isp, &src->pdb_ptimer, dst->pdb_ptimer);
741 ISP_IOXGET_16(isp, &src->pdb_nxt_seqid, dst->pdb_nxt_seqid);
742 ISP_IOXGET_16(isp, &src->pdb_fcount, dst->pdb_fcount);
743 ISP_IOXGET_16(isp, &src->pdb_prli_len, dst->pdb_prli_len);
744 ISP_IOXGET_16(isp, &src->pdb_prli_svc0, dst->pdb_prli_svc0);
745 ISP_IOXGET_16(isp, &src->pdb_prli_svc3, dst->pdb_prli_svc3);
746 ISP_IOXGET_16(isp, &src->pdb_loopid, dst->pdb_loopid);
747 ISP_IOXGET_16(isp, &src->pdb_il_ptr, dst->pdb_il_ptr);
748 ISP_IOXGET_16(isp, &src->pdb_sl_ptr, dst->pdb_sl_ptr);
753 * CT_HDR canonicalization- only needed for SNS responses
756 isp_get_ct_hdr(struct ispsoftc *isp, ct_hdr_t *src, ct_hdr_t *dst)
758 ISP_IOXGET_8(isp, &src->ct_revision, dst->ct_revision);
759 ISP_IOXGET_8(isp, &src->ct_portid[0], dst->ct_portid[0]);
760 ISP_IOXGET_8(isp, &src->ct_portid[1], dst->ct_portid[1]);
761 ISP_IOXGET_8(isp, &src->ct_portid[2], dst->ct_portid[2]);
762 ISP_IOXGET_8(isp, &src->ct_fcs_type, dst->ct_fcs_type);
763 ISP_IOXGET_8(isp, &src->ct_fcs_subtype, dst->ct_fcs_subtype);
764 ISP_IOXGET_8(isp, &src->ct_options, dst->ct_options);
765 ISP_IOXGET_8(isp, &src->ct_res0, dst->ct_res0);
766 ISP_IOXGET_16(isp, &src->ct_response, dst->ct_response);
767 dst->ct_response = (dst->ct_response << 8) | (dst->ct_response >> 8);
768 ISP_IOXGET_16(isp, &src->ct_resid, dst->ct_resid);
769 dst->ct_resid = (dst->ct_resid << 8) | (dst->ct_resid >> 8);
770 ISP_IOXGET_8(isp, &src->ct_res1, dst->ct_res1);
771 ISP_IOXGET_8(isp, &src->ct_reason, dst->ct_reason);
772 ISP_IOXGET_8(isp, &src->ct_explanation, dst->ct_explanation);
773 ISP_IOXGET_8(isp, &src->ct_vunique, dst->ct_vunique);
777 * Generic SNS request - not particularly useful since the per-command data
778 * isn't always 16 bit words.
781 isp_put_sns_request(struct ispsoftc *isp, sns_screq_t *src, sns_screq_t *dst)
783 int i, nw = (int) src->snscb_sblen;
784 ISP_IOXPUT_16(isp, src->snscb_rblen, &dst->snscb_rblen);
785 for (i = 0; i < 4; i++) {
786 ISP_IOXPUT_16(isp, src->snscb_addr[i], &dst->snscb_addr[i]);
788 ISP_IOXPUT_16(isp, src->snscb_sblen, &dst->snscb_sblen);
789 for (i = 0; i < nw; i++) {
790 ISP_IOXPUT_16(isp, src->snscb_data[i], &dst->snscb_data[i]);
796 isp_put_gid_ft_request(struct ispsoftc *isp, sns_gid_ft_req_t *src,
797 sns_gid_ft_req_t *dst)
799 ISP_IOXPUT_16(isp, src->snscb_rblen, &dst->snscb_rblen);
800 ISP_IOXPUT_16(isp, src->snscb_res0, &dst->snscb_res0);
801 ISP_IOXPUT_16(isp, src->snscb_addr[0], &dst->snscb_addr[0]);
802 ISP_IOXPUT_16(isp, src->snscb_addr[1], &dst->snscb_addr[1]);
803 ISP_IOXPUT_16(isp, src->snscb_addr[2], &dst->snscb_addr[2]);
804 ISP_IOXPUT_16(isp, src->snscb_addr[3], &dst->snscb_addr[3]);
805 ISP_IOXPUT_16(isp, src->snscb_sblen, &dst->snscb_sblen);
806 ISP_IOXPUT_16(isp, src->snscb_res1, &dst->snscb_res1);
807 ISP_IOXPUT_16(isp, src->snscb_cmd, &dst->snscb_cmd);
808 ISP_IOXPUT_16(isp, src->snscb_mword_div_2, &dst->snscb_mword_div_2);
809 ISP_IOXPUT_32(isp, src->snscb_res3, &dst->snscb_res3);
810 ISP_IOXPUT_32(isp, src->snscb_fc4_type, &dst->snscb_fc4_type);
814 isp_put_gxn_id_request(struct ispsoftc *isp, sns_gxn_id_req_t *src,
815 sns_gxn_id_req_t *dst)
817 ISP_IOXPUT_16(isp, src->snscb_rblen, &dst->snscb_rblen);
818 ISP_IOXPUT_16(isp, src->snscb_res0, &dst->snscb_res0);
819 ISP_IOXPUT_16(isp, src->snscb_addr[0], &dst->snscb_addr[0]);
820 ISP_IOXPUT_16(isp, src->snscb_addr[1], &dst->snscb_addr[1]);
821 ISP_IOXPUT_16(isp, src->snscb_addr[2], &dst->snscb_addr[2]);
822 ISP_IOXPUT_16(isp, src->snscb_addr[3], &dst->snscb_addr[3]);
823 ISP_IOXPUT_16(isp, src->snscb_sblen, &dst->snscb_sblen);
824 ISP_IOXPUT_16(isp, src->snscb_res1, &dst->snscb_res1);
825 ISP_IOXPUT_16(isp, src->snscb_cmd, &dst->snscb_cmd);
826 ISP_IOXPUT_16(isp, src->snscb_res2, &dst->snscb_res2);
827 ISP_IOXPUT_32(isp, src->snscb_res3, &dst->snscb_res3);
828 ISP_IOXPUT_32(isp, src->snscb_portid, &dst->snscb_portid);
832 * Generic SNS response - not particularly useful since the per-command data
833 * isn't always 16 bit words.
836 isp_get_sns_response(struct ispsoftc *isp, sns_scrsp_t *src,
837 sns_scrsp_t *dst, int nwords)
840 isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr);
841 ISP_IOXGET_8(isp, &src->snscb_port_type, dst->snscb_port_type);
842 for (i = 0; i < 3; i++) {
843 ISP_IOXGET_8(isp, &src->snscb_port_id[i],
844 dst->snscb_port_id[i]);
846 for (i = 0; i < 8; i++) {
847 ISP_IOXGET_8(isp, &src->snscb_portname[i],
848 dst->snscb_portname[i]);
850 for (i = 0; i < nwords; i++) {
851 ISP_IOXGET_16(isp, &src->snscb_data[i], dst->snscb_data[i]);
856 isp_get_gid_ft_response(struct ispsoftc *isp, sns_gid_ft_rsp_t *src,
857 sns_gid_ft_rsp_t *dst, int nwords)
860 isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr);
861 for (i = 0; i < nwords; i++) {
864 &src->snscb_ports[i].control,
865 dst->snscb_ports[i].control);
866 for (j = 0; j < 3; j++) {
868 &src->snscb_ports[i].portid[j],
869 dst->snscb_ports[i].portid[j]);
871 if (dst->snscb_ports[i].control & 0x80) {
878 isp_get_gxn_id_response(struct ispsoftc *isp, sns_gxn_id_rsp_t *src,
879 sns_gxn_id_rsp_t *dst)
882 isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr);
883 for (i = 0; i < 8; i++)
884 ISP_IOXGET_8(isp, &src->snscb_wwn[i], dst->snscb_wwn[i]);
888 isp_get_gff_id_response(struct ispsoftc *isp, sns_gff_id_rsp_t *src,
889 sns_gff_id_rsp_t *dst)
892 isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr);
893 for (i = 0; i < 32; i++) {
894 ISP_IOXGET_32(isp, &src->snscb_fc4_features[i],
895 dst->snscb_fc4_features[i]);
900 isp_get_ga_nxt_response(struct ispsoftc *isp, sns_ga_nxt_rsp_t *src,
901 sns_ga_nxt_rsp_t *dst)
904 isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr);
905 ISP_IOXGET_8(isp, &src->snscb_port_type, dst->snscb_port_type);
906 for (i = 0; i < 3; i++) {
907 ISP_IOXGET_8(isp, &src->snscb_port_id[i],
908 dst->snscb_port_id[i]);
910 for (i = 0; i < 8; i++) {
911 ISP_IOXGET_8(isp, &src->snscb_portname[i],
912 dst->snscb_portname[i]);
914 ISP_IOXGET_8(isp, &src->snscb_pnlen, dst->snscb_pnlen);
915 for (i = 0; i < 255; i++) {
916 ISP_IOXGET_8(isp, &src->snscb_pname[i], dst->snscb_pname[i]);
918 for (i = 0; i < 8; i++) {
919 ISP_IOXGET_8(isp, &src->snscb_nodename[i],
920 dst->snscb_nodename[i]);
922 ISP_IOXGET_8(isp, &src->snscb_nnlen, dst->snscb_nnlen);
923 for (i = 0; i < 255; i++) {
924 ISP_IOXGET_8(isp, &src->snscb_nname[i], dst->snscb_nname[i]);
926 for (i = 0; i < 8; i++) {
927 ISP_IOXGET_8(isp, &src->snscb_ipassoc[i],
928 dst->snscb_ipassoc[i]);
930 for (i = 0; i < 16; i++) {
931 ISP_IOXGET_8(isp, &src->snscb_ipaddr[i], dst->snscb_ipaddr[i]);
933 for (i = 0; i < 4; i++) {
934 ISP_IOXGET_8(isp, &src->snscb_svc_class[i],
935 dst->snscb_svc_class[i]);
937 for (i = 0; i < 32; i++) {
938 ISP_IOXGET_8(isp, &src->snscb_fc4_types[i],
939 dst->snscb_fc4_types[i]);
941 for (i = 0; i < 8; i++) {
942 ISP_IOXGET_8(isp, &src->snscb_fpname[i], dst->snscb_fpname[i]);
944 ISP_IOXGET_8(isp, &src->snscb_reserved, dst->snscb_reserved);
945 for (i = 0; i < 3; i++) {
946 ISP_IOXGET_8(isp, &src->snscb_hardaddr[i],
947 dst->snscb_hardaddr[i]);
951 #ifdef ISP_TARGET_MODE
953 isp_put_atio(struct ispsoftc *isp, at_entry_t *atsrc, at_entry_t *atdst)
956 isp_copy_out_hdr(isp, &atsrc->at_header, &atdst->at_header);
957 ISP_IOXPUT_16(isp, atsrc->at_reserved, &atdst->at_reserved);
958 ISP_IOXPUT_16(isp, atsrc->at_handle, &atdst->at_handle);
959 if (ISP_IS_SBUS(isp)) {
960 ISP_IOXPUT_8(isp, atsrc->at_lun, &atdst->at_iid);
961 ISP_IOXPUT_8(isp, atsrc->at_iid, &atdst->at_lun);
962 ISP_IOXPUT_8(isp, atsrc->at_cdblen, &atdst->at_tgt);
963 ISP_IOXPUT_8(isp, atsrc->at_tgt, &atdst->at_cdblen);
964 ISP_IOXPUT_8(isp, atsrc->at_status, &atdst->at_scsi_status);
965 ISP_IOXPUT_8(isp, atsrc->at_scsi_status, &atdst->at_status);
966 ISP_IOXPUT_8(isp, atsrc->at_tag_val, &atdst->at_tag_type);
967 ISP_IOXPUT_8(isp, atsrc->at_tag_type, &atdst->at_tag_val);
969 ISP_IOXPUT_8(isp, atsrc->at_lun, &atdst->at_lun);
970 ISP_IOXPUT_8(isp, atsrc->at_iid, &atdst->at_iid);
971 ISP_IOXPUT_8(isp, atsrc->at_cdblen, &atdst->at_cdblen);
972 ISP_IOXPUT_8(isp, atsrc->at_tgt, &atdst->at_tgt);
973 ISP_IOXPUT_8(isp, atsrc->at_status, &atdst->at_status);
974 ISP_IOXPUT_8(isp, atsrc->at_scsi_status,
975 &atdst->at_scsi_status);
976 ISP_IOXPUT_8(isp, atsrc->at_tag_val, &atdst->at_tag_val);
977 ISP_IOXPUT_8(isp, atsrc->at_tag_type, &atdst->at_tag_type);
979 ISP_IOXPUT_32(isp, atsrc->at_flags, &atdst->at_flags);
980 for (i = 0; i < ATIO_CDBLEN; i++) {
981 ISP_IOXPUT_8(isp, atsrc->at_cdb[i], &atdst->at_cdb[i]);
983 for (i = 0; i < QLTM_SENSELEN; i++) {
984 ISP_IOXPUT_8(isp, atsrc->at_sense[i], &atdst->at_sense[i]);
989 isp_get_atio(struct ispsoftc *isp, at_entry_t *atsrc, at_entry_t *atdst)
992 isp_copy_in_hdr(isp, &atsrc->at_header, &atdst->at_header);
993 ISP_IOXGET_16(isp, &atsrc->at_reserved, atdst->at_reserved);
994 ISP_IOXGET_16(isp, &atsrc->at_handle, atdst->at_handle);
995 if (ISP_IS_SBUS(isp)) {
996 ISP_IOXGET_8(isp, &atsrc->at_lun, atdst->at_iid);
997 ISP_IOXGET_8(isp, &atsrc->at_iid, atdst->at_lun);
998 ISP_IOXGET_8(isp, &atsrc->at_cdblen, atdst->at_tgt);
999 ISP_IOXGET_8(isp, &atsrc->at_tgt, atdst->at_cdblen);
1000 ISP_IOXGET_8(isp, &atsrc->at_status, atdst->at_scsi_status);
1001 ISP_IOXGET_8(isp, &atsrc->at_scsi_status, atdst->at_status);
1002 ISP_IOXGET_8(isp, &atsrc->at_tag_val, atdst->at_tag_type);
1003 ISP_IOXGET_8(isp, &atsrc->at_tag_type, atdst->at_tag_val);
1005 ISP_IOXGET_8(isp, &atsrc->at_lun, atdst->at_lun);
1006 ISP_IOXGET_8(isp, &atsrc->at_iid, atdst->at_iid);
1007 ISP_IOXGET_8(isp, &atsrc->at_cdblen, atdst->at_cdblen);
1008 ISP_IOXGET_8(isp, &atsrc->at_tgt, atdst->at_tgt);
1009 ISP_IOXGET_8(isp, &atsrc->at_status, atdst->at_status);
1010 ISP_IOXGET_8(isp, &atsrc->at_scsi_status,
1011 atdst->at_scsi_status);
1012 ISP_IOXGET_8(isp, &atsrc->at_tag_val, atdst->at_tag_val);
1013 ISP_IOXGET_8(isp, &atsrc->at_tag_type, atdst->at_tag_type);
1015 ISP_IOXGET_32(isp, &atsrc->at_flags, atdst->at_flags);
1016 for (i = 0; i < ATIO_CDBLEN; i++) {
1017 ISP_IOXGET_8(isp, &atsrc->at_cdb[i], atdst->at_cdb[i]);
1019 for (i = 0; i < QLTM_SENSELEN; i++) {
1020 ISP_IOXGET_8(isp, &atsrc->at_sense[i], atdst->at_sense[i]);
1025 isp_put_atio2(struct ispsoftc *isp, at2_entry_t *atsrc, at2_entry_t *atdst)
1028 isp_copy_out_hdr(isp, &atsrc->at_header, &atdst->at_header);
1029 ISP_IOXPUT_32(isp, atsrc->at_reserved, &atdst->at_reserved);
1030 ISP_IOXPUT_8(isp, atsrc->at_lun, &atdst->at_lun);
1031 ISP_IOXPUT_8(isp, atsrc->at_iid, &atdst->at_iid);
1032 ISP_IOXPUT_16(isp, atsrc->at_rxid, &atdst->at_rxid);
1033 ISP_IOXPUT_16(isp, atsrc->at_flags, &atdst->at_flags);
1034 ISP_IOXPUT_16(isp, atsrc->at_status, &atdst->at_status);
1035 ISP_IOXPUT_8(isp, atsrc->at_crn, &atdst->at_crn);
1036 ISP_IOXPUT_8(isp, atsrc->at_taskcodes, &atdst->at_taskcodes);
1037 ISP_IOXPUT_8(isp, atsrc->at_taskflags, &atdst->at_taskflags);
1038 ISP_IOXPUT_8(isp, atsrc->at_execodes, &atdst->at_execodes);
1039 for (i = 0; i < ATIO2_CDBLEN; i++) {
1040 ISP_IOXPUT_8(isp, atsrc->at_cdb[i], &atdst->at_cdb[i]);
1042 ISP_IOXPUT_32(isp, atsrc->at_datalen, &atdst->at_datalen);
1043 ISP_IOXPUT_16(isp, atsrc->at_scclun, &atdst->at_scclun);
1044 for (i = 0; i < 4; i++) {
1045 ISP_IOXPUT_16(isp, atsrc->at_wwpn[i], &atdst->at_wwpn[i]);
1047 for (i = 0; i < 6; i++) {
1048 ISP_IOXPUT_16(isp, atsrc->at_reserved2[i],
1049 &atdst->at_reserved2[i]);
1051 ISP_IOXPUT_16(isp, atsrc->at_oxid, &atdst->at_oxid);
1055 isp_get_atio2(struct ispsoftc *isp, at2_entry_t *atsrc, at2_entry_t *atdst)
1058 isp_copy_in_hdr(isp, &atsrc->at_header, &atdst->at_header);
1059 ISP_IOXGET_32(isp, &atsrc->at_reserved, atdst->at_reserved);
1060 ISP_IOXGET_8(isp, &atsrc->at_lun, atdst->at_lun);
1061 ISP_IOXGET_8(isp, &atsrc->at_iid, atdst->at_iid);
1062 ISP_IOXGET_16(isp, &atsrc->at_rxid, atdst->at_rxid);
1063 ISP_IOXGET_16(isp, &atsrc->at_flags, atdst->at_flags);
1064 ISP_IOXGET_16(isp, &atsrc->at_status, atdst->at_status);
1065 ISP_IOXGET_8(isp, &atsrc->at_crn, atdst->at_crn);
1066 ISP_IOXGET_8(isp, &atsrc->at_taskcodes, atdst->at_taskcodes);
1067 ISP_IOXGET_8(isp, &atsrc->at_taskflags, atdst->at_taskflags);
1068 ISP_IOXGET_8(isp, &atsrc->at_execodes, atdst->at_execodes);
1069 for (i = 0; i < ATIO2_CDBLEN; i++) {
1070 ISP_IOXGET_8(isp, &atsrc->at_cdb[i], atdst->at_cdb[i]);
1072 ISP_IOXGET_32(isp, &atsrc->at_datalen, atdst->at_datalen);
1073 ISP_IOXGET_16(isp, &atsrc->at_scclun, atdst->at_scclun);
1074 for (i = 0; i < 4; i++) {
1075 ISP_IOXGET_16(isp, &atsrc->at_wwpn[i], atdst->at_wwpn[i]);
1077 for (i = 0; i < 6; i++) {
1078 ISP_IOXGET_16(isp, &atsrc->at_reserved2[i],
1079 atdst->at_reserved2[i]);
1081 ISP_IOXGET_16(isp, &atsrc->at_oxid, atdst->at_oxid);
1085 isp_put_ctio(struct ispsoftc *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst)
1088 isp_copy_out_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
1089 ISP_IOXPUT_16(isp, ctsrc->ct_reserved, &ctdst->ct_reserved);
1090 ISP_IOXPUT_16(isp, ctsrc->ct_fwhandle, &ctdst->ct_fwhandle);
1091 if (ISP_IS_SBUS(isp)) {
1092 ISP_IOXPUT_8(isp, ctsrc->ct_iid, &ctdst->ct_lun);
1093 ISP_IOXPUT_8(isp, ctsrc->ct_lun, &ctdst->ct_iid);
1094 ISP_IOXPUT_8(isp, ctsrc->ct_tgt, &ctdst->ct_reserved2);
1095 ISP_IOXPUT_8(isp, ctsrc->ct_reserved2, &ctdst->ct_tgt);
1096 ISP_IOXPUT_8(isp, ctsrc->ct_status, &ctdst->ct_scsi_status);
1097 ISP_IOXPUT_8(isp, ctsrc->ct_scsi_status, &ctdst->ct_status);
1098 ISP_IOXPUT_8(isp, ctsrc->ct_tag_type, &ctdst->ct_tag_val);
1099 ISP_IOXPUT_8(isp, ctsrc->ct_tag_val, &ctdst->ct_tag_type);
1101 ISP_IOXPUT_8(isp, ctsrc->ct_iid, &ctdst->ct_iid);
1102 ISP_IOXPUT_8(isp, ctsrc->ct_lun, &ctdst->ct_lun);
1103 ISP_IOXPUT_8(isp, ctsrc->ct_tgt, &ctdst->ct_tgt);
1104 ISP_IOXPUT_8(isp, ctsrc->ct_reserved2, &ctdst->ct_reserved2);
1105 ISP_IOXPUT_8(isp, ctsrc->ct_scsi_status,
1106 &ctdst->ct_scsi_status);
1107 ISP_IOXPUT_8(isp, ctsrc->ct_status, &ctdst->ct_status);
1108 ISP_IOXPUT_8(isp, ctsrc->ct_tag_type, &ctdst->ct_tag_type);
1109 ISP_IOXPUT_8(isp, ctsrc->ct_tag_val, &ctdst->ct_tag_val);
1111 ISP_IOXPUT_32(isp, ctsrc->ct_flags, &ctdst->ct_flags);
1112 ISP_IOXPUT_32(isp, ctsrc->ct_xfrlen, &ctdst->ct_xfrlen);
1113 ISP_IOXPUT_32(isp, ctsrc->ct_resid, &ctdst->ct_resid);
1114 ISP_IOXPUT_16(isp, ctsrc->ct_timeout, &ctdst->ct_timeout);
1115 ISP_IOXPUT_16(isp, ctsrc->ct_seg_count, &ctdst->ct_seg_count);
1116 for (i = 0; i < ISP_RQDSEG; i++) {
1117 ISP_IOXPUT_32(isp, ctsrc->ct_dataseg[i].ds_base,
1118 &ctdst->ct_dataseg[i].ds_base);
1119 ISP_IOXPUT_32(isp, ctsrc->ct_dataseg[i].ds_count,
1120 &ctdst->ct_dataseg[i].ds_count);
1125 isp_get_ctio(struct ispsoftc *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst)
1128 isp_copy_in_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
1129 ISP_IOXGET_16(isp, &ctsrc->ct_reserved, ctdst->ct_reserved);
1130 ISP_IOXGET_16(isp, &ctsrc->ct_fwhandle, ctdst->ct_fwhandle);
1131 if (ISP_IS_SBUS(isp)) {
1132 ISP_IOXGET_8(isp, &ctsrc->ct_lun, ctdst->ct_iid);
1133 ISP_IOXGET_8(isp, &ctsrc->ct_iid, ctdst->ct_lun);
1134 ISP_IOXGET_8(isp, &ctsrc->ct_reserved2, ctdst->ct_tgt);
1135 ISP_IOXGET_8(isp, &ctsrc->ct_tgt, ctdst->ct_reserved2);
1136 ISP_IOXGET_8(isp, &ctsrc->ct_status, ctdst->ct_scsi_status);
1137 ISP_IOXGET_8(isp, &ctsrc->ct_scsi_status, ctdst->ct_status);
1138 ISP_IOXGET_8(isp, &ctsrc->ct_tag_val, ctdst->ct_tag_type);
1139 ISP_IOXGET_8(isp, &ctsrc->ct_tag_type, ctdst->ct_tag_val);
1141 ISP_IOXGET_8(isp, &ctsrc->ct_lun, ctdst->ct_lun);
1142 ISP_IOXGET_8(isp, &ctsrc->ct_iid, ctdst->ct_iid);
1143 ISP_IOXGET_8(isp, &ctsrc->ct_reserved2, ctdst->ct_reserved2);
1144 ISP_IOXGET_8(isp, &ctsrc->ct_tgt, ctdst->ct_tgt);
1145 ISP_IOXGET_8(isp, &ctsrc->ct_status, ctdst->ct_status);
1146 ISP_IOXGET_8(isp, &ctsrc->ct_scsi_status,
1147 ctdst->ct_scsi_status);
1148 ISP_IOXGET_8(isp, &ctsrc->ct_tag_val, ctdst->ct_tag_val);
1149 ISP_IOXGET_8(isp, &ctsrc->ct_tag_type, ctdst->ct_tag_type);
1151 ISP_IOXGET_32(isp, &ctsrc->ct_flags, ctdst->ct_flags);
1152 ISP_IOXGET_32(isp, &ctsrc->ct_xfrlen, ctdst->ct_xfrlen);
1153 ISP_IOXGET_32(isp, &ctsrc->ct_resid, ctdst->ct_resid);
1154 ISP_IOXGET_16(isp, &ctsrc->ct_timeout, ctdst->ct_timeout);
1155 ISP_IOXGET_16(isp, &ctsrc->ct_seg_count, ctdst->ct_seg_count);
1156 for (i = 0; i < ISP_RQDSEG; i++) {
1158 &ctsrc->ct_dataseg[i].ds_base,
1159 ctdst->ct_dataseg[i].ds_base);
1161 &ctsrc->ct_dataseg[i].ds_count,
1162 ctdst->ct_dataseg[i].ds_count);
1167 isp_put_ctio2(struct ispsoftc *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst)
1170 isp_copy_out_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
1171 ISP_IOXPUT_16(isp, ctsrc->ct_reserved, &ctdst->ct_reserved);
1172 ISP_IOXPUT_16(isp, ctsrc->ct_fwhandle, &ctdst->ct_fwhandle);
1173 ISP_IOXPUT_8(isp, ctsrc->ct_lun, &ctdst->ct_lun);
1174 ISP_IOXPUT_8(isp, ctsrc->ct_iid, &ctdst->ct_iid);
1175 ISP_IOXPUT_16(isp, ctsrc->ct_rxid, &ctdst->ct_rxid);
1176 ISP_IOXPUT_16(isp, ctsrc->ct_flags, &ctdst->ct_flags);
1177 ISP_IOXPUT_16(isp, ctsrc->ct_timeout, &ctdst->ct_timeout);
1178 ISP_IOXPUT_16(isp, ctsrc->ct_seg_count, &ctdst->ct_seg_count);
1179 ISP_IOXPUT_32(isp, ctsrc->ct_resid, &ctdst->ct_resid);
1180 ISP_IOXPUT_32(isp, ctsrc->ct_reloff, &ctdst->ct_reloff);
1181 if ((ctsrc->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE0) {
1182 ISP_IOXPUT_32(isp, ctsrc->rsp.m0._reserved,
1183 &ctdst->rsp.m0._reserved);
1184 ISP_IOXPUT_16(isp, ctsrc->rsp.m0._reserved2,
1185 &ctdst->rsp.m0._reserved2);
1186 ISP_IOXPUT_16(isp, ctsrc->rsp.m0.ct_scsi_status,
1187 &ctdst->rsp.m0.ct_scsi_status);
1188 ISP_IOXPUT_32(isp, ctsrc->rsp.m0.ct_xfrlen,
1189 &ctdst->rsp.m0.ct_xfrlen);
1190 if (ctsrc->ct_header.rqs_entry_type == RQSTYPE_CTIO2) {
1191 for (i = 0; i < ISP_RQDSEG_T2; i++) {
1193 ctsrc->rsp.m0.ct_dataseg[i].ds_base,
1194 &ctdst->rsp.m0.ct_dataseg[i].ds_base);
1196 ctsrc->rsp.m0.ct_dataseg[i].ds_count,
1197 &ctdst->rsp.m0.ct_dataseg[i].ds_count);
1199 } else if (ctsrc->ct_header.rqs_entry_type == RQSTYPE_CTIO3) {
1200 for (i = 0; i < ISP_RQDSEG_T3; i++) {
1202 ctsrc->rsp.m0.ct_dataseg64[i].ds_base,
1203 &ctdst->rsp.m0.ct_dataseg64[i].ds_base);
1205 ctsrc->rsp.m0.ct_dataseg64[i].ds_basehi,
1206 &ctdst->rsp.m0.ct_dataseg64[i].ds_basehi);
1208 ctsrc->rsp.m0.ct_dataseg64[i].ds_count,
1209 &ctdst->rsp.m0.ct_dataseg64[i].ds_count);
1211 } else if (ctsrc->ct_header.rqs_entry_type == RQSTYPE_CTIO4) {
1212 ISP_IOXPUT_16(isp, ctsrc->rsp.m0.ct_dslist.ds_type,
1213 &ctdst->rsp.m0.ct_dslist.ds_type);
1214 ISP_IOXPUT_32(isp, ctsrc->rsp.m0.ct_dslist.ds_segment,
1215 &ctdst->rsp.m0.ct_dslist.ds_segment);
1216 ISP_IOXPUT_32(isp, ctsrc->rsp.m0.ct_dslist.ds_base,
1217 &ctdst->rsp.m0.ct_dslist.ds_base);
1219 } else if ((ctsrc->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE1) {
1220 ISP_IOXPUT_16(isp, ctsrc->rsp.m1._reserved,
1221 &ctdst->rsp.m1._reserved);
1222 ISP_IOXPUT_16(isp, ctsrc->rsp.m1._reserved2,
1223 &ctdst->rsp.m1._reserved2);
1224 ISP_IOXPUT_16(isp, ctsrc->rsp.m1.ct_senselen,
1225 &ctdst->rsp.m1.ct_senselen);
1226 ISP_IOXPUT_16(isp, ctsrc->rsp.m1.ct_scsi_status,
1227 &ctdst->rsp.m1.ct_scsi_status);
1228 ISP_IOXPUT_16(isp, ctsrc->rsp.m1.ct_resplen,
1229 &ctdst->rsp.m1.ct_resplen);
1230 for (i = 0; i < MAXRESPLEN; i++) {
1231 ISP_IOXPUT_8(isp, ctsrc->rsp.m1.ct_resp[i],
1232 &ctdst->rsp.m1.ct_resp[i]);
1235 ISP_IOXPUT_32(isp, ctsrc->rsp.m2._reserved,
1236 &ctdst->rsp.m2._reserved);
1237 ISP_IOXPUT_16(isp, ctsrc->rsp.m2._reserved2,
1238 &ctdst->rsp.m2._reserved2);
1239 ISP_IOXPUT_16(isp, ctsrc->rsp.m2._reserved3,
1240 &ctdst->rsp.m2._reserved3);
1241 ISP_IOXPUT_32(isp, ctsrc->rsp.m2.ct_datalen,
1242 &ctdst->rsp.m2.ct_datalen);
1243 ISP_IOXPUT_32(isp, ctsrc->rsp.m2.ct_fcp_rsp_iudata.ds_base,
1244 &ctdst->rsp.m2.ct_fcp_rsp_iudata.ds_base);
1245 ISP_IOXPUT_32(isp, ctsrc->rsp.m2.ct_fcp_rsp_iudata.ds_count,
1246 &ctdst->rsp.m2.ct_fcp_rsp_iudata.ds_count);
1251 isp_get_ctio2(struct ispsoftc *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst)
1253 isp_copy_in_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header);
1254 ISP_IOXGET_16(isp, &ctsrc->ct_reserved, ctdst->ct_reserved);
1255 ISP_IOXGET_16(isp, &ctsrc->ct_fwhandle, ctdst->ct_fwhandle);
1256 ISP_IOXGET_8(isp, &ctsrc->ct_lun, ctdst->ct_lun);
1257 ISP_IOXGET_8(isp, &ctsrc->ct_iid, ctdst->ct_iid);
1258 ISP_IOXGET_16(isp, &ctsrc->ct_rxid, ctdst->ct_rxid);
1259 ISP_IOXGET_16(isp, &ctsrc->ct_flags, ctdst->ct_flags);
1260 ISP_IOXGET_16(isp, &ctsrc->ct_status, ctdst->ct_status);
1261 ISP_IOXGET_16(isp, &ctsrc->ct_timeout, ctdst->ct_timeout);
1262 ISP_IOXGET_16(isp, &ctsrc->ct_seg_count, ctdst->ct_seg_count);
1263 ISP_IOXGET_32(isp, &ctsrc->ct_reloff, ctdst->ct_reloff);
1264 ISP_IOXGET_32(isp, &ctsrc->ct_resid, ctdst->ct_resid);
1268 isp_put_enable_lun(struct ispsoftc *isp, lun_entry_t *lesrc, lun_entry_t *ledst)
1271 isp_copy_out_hdr(isp, &lesrc->le_header, &ledst->le_header);
1272 ISP_IOXPUT_32(isp, lesrc->le_reserved, &ledst->le_reserved);
1273 if (ISP_IS_SBUS(isp)) {
1274 ISP_IOXPUT_8(isp, lesrc->le_lun, &ledst->le_rsvd);
1275 ISP_IOXPUT_8(isp, lesrc->le_rsvd, &ledst->le_lun);
1276 ISP_IOXPUT_8(isp, lesrc->le_ops, &ledst->le_tgt);
1277 ISP_IOXPUT_8(isp, lesrc->le_tgt, &ledst->le_ops);
1278 ISP_IOXPUT_8(isp, lesrc->le_status, &ledst->le_reserved2);
1279 ISP_IOXPUT_8(isp, lesrc->le_reserved2, &ledst->le_status);
1280 ISP_IOXPUT_8(isp, lesrc->le_cmd_count, &ledst->le_in_count);
1281 ISP_IOXPUT_8(isp, lesrc->le_in_count, &ledst->le_cmd_count);
1282 ISP_IOXPUT_8(isp, lesrc->le_cdb6len, &ledst->le_cdb7len);
1283 ISP_IOXPUT_8(isp, lesrc->le_cdb7len, &ledst->le_cdb6len);
1285 ISP_IOXPUT_8(isp, lesrc->le_lun, &ledst->le_lun);
1286 ISP_IOXPUT_8(isp, lesrc->le_rsvd, &ledst->le_rsvd);
1287 ISP_IOXPUT_8(isp, lesrc->le_ops, &ledst->le_ops);
1288 ISP_IOXPUT_8(isp, lesrc->le_tgt, &ledst->le_tgt);
1289 ISP_IOXPUT_8(isp, lesrc->le_status, &ledst->le_status);
1290 ISP_IOXPUT_8(isp, lesrc->le_reserved2, &ledst->le_reserved2);
1291 ISP_IOXPUT_8(isp, lesrc->le_cmd_count, &ledst->le_cmd_count);
1292 ISP_IOXPUT_8(isp, lesrc->le_in_count, &ledst->le_in_count);
1293 ISP_IOXPUT_8(isp, lesrc->le_cdb6len, &ledst->le_cdb6len);
1294 ISP_IOXPUT_8(isp, lesrc->le_cdb7len, &ledst->le_cdb7len);
1296 ISP_IOXPUT_32(isp, lesrc->le_flags, &ledst->le_flags);
1297 ISP_IOXPUT_16(isp, lesrc->le_timeout, &ledst->le_timeout);
1298 for (i = 0; i < 20; i++) {
1299 ISP_IOXPUT_8(isp, lesrc->le_reserved3[i],
1300 &ledst->le_reserved3[i]);
1305 isp_get_enable_lun(struct ispsoftc *isp, lun_entry_t *lesrc, lun_entry_t *ledst)
1308 isp_copy_in_hdr(isp, &lesrc->le_header, &ledst->le_header);
1309 ISP_IOXGET_32(isp, &lesrc->le_reserved, ledst->le_reserved);
1310 if (ISP_IS_SBUS(isp)) {
1311 ISP_IOXGET_8(isp, &lesrc->le_lun, ledst->le_rsvd);
1312 ISP_IOXGET_8(isp, &lesrc->le_rsvd, ledst->le_lun);
1313 ISP_IOXGET_8(isp, &lesrc->le_ops, ledst->le_tgt);
1314 ISP_IOXGET_8(isp, &lesrc->le_tgt, ledst->le_ops);
1315 ISP_IOXGET_8(isp, &lesrc->le_status, ledst->le_reserved2);
1316 ISP_IOXGET_8(isp, &lesrc->le_reserved2, ledst->le_status);
1317 ISP_IOXGET_8(isp, &lesrc->le_cmd_count, ledst->le_in_count);
1318 ISP_IOXGET_8(isp, &lesrc->le_in_count, ledst->le_cmd_count);
1319 ISP_IOXGET_8(isp, &lesrc->le_cdb6len, ledst->le_cdb7len);
1320 ISP_IOXGET_8(isp, &lesrc->le_cdb7len, ledst->le_cdb6len);
1322 ISP_IOXGET_8(isp, &lesrc->le_lun, ledst->le_lun);
1323 ISP_IOXGET_8(isp, &lesrc->le_rsvd, ledst->le_rsvd);
1324 ISP_IOXGET_8(isp, &lesrc->le_ops, ledst->le_ops);
1325 ISP_IOXGET_8(isp, &lesrc->le_tgt, ledst->le_tgt);
1326 ISP_IOXGET_8(isp, &lesrc->le_status, ledst->le_status);
1327 ISP_IOXGET_8(isp, &lesrc->le_reserved2, ledst->le_reserved2);
1328 ISP_IOXGET_8(isp, &lesrc->le_cmd_count, ledst->le_cmd_count);
1329 ISP_IOXGET_8(isp, &lesrc->le_in_count, ledst->le_in_count);
1330 ISP_IOXGET_8(isp, &lesrc->le_cdb6len, ledst->le_cdb6len);
1331 ISP_IOXGET_8(isp, &lesrc->le_cdb7len, ledst->le_cdb7len);
1333 ISP_IOXGET_32(isp, &lesrc->le_flags, ledst->le_flags);
1334 ISP_IOXGET_16(isp, &lesrc->le_timeout, ledst->le_timeout);
1335 for (i = 0; i < 20; i++) {
1336 ISP_IOXGET_8(isp, &lesrc->le_reserved3[i],
1337 ledst->le_reserved3[i]);
1342 isp_put_notify(struct ispsoftc *isp, in_entry_t *insrc, in_entry_t *indst)
1345 isp_copy_out_hdr(isp, &insrc->in_header, &indst->in_header);
1346 ISP_IOXPUT_32(isp, insrc->in_reserved, &indst->in_reserved);
1347 if (ISP_IS_SBUS(isp)) {
1348 ISP_IOXPUT_8(isp, insrc->in_lun, &indst->in_iid);
1349 ISP_IOXPUT_8(isp, insrc->in_iid, &indst->in_lun);
1350 ISP_IOXPUT_8(isp, insrc->in_reserved2, &indst->in_tgt);
1351 ISP_IOXPUT_8(isp, insrc->in_tgt, &indst->in_reserved2);
1352 ISP_IOXPUT_8(isp, insrc->in_status, &indst->in_rsvd2);
1353 ISP_IOXPUT_8(isp, insrc->in_rsvd2, &indst->in_status);
1354 ISP_IOXPUT_8(isp, insrc->in_tag_val, &indst->in_tag_type);
1355 ISP_IOXPUT_8(isp, insrc->in_tag_type, &indst->in_tag_val);
1357 ISP_IOXPUT_8(isp, insrc->in_lun, &indst->in_lun);
1358 ISP_IOXPUT_8(isp, insrc->in_iid, &indst->in_iid);
1359 ISP_IOXPUT_8(isp, insrc->in_reserved2, &indst->in_reserved2);
1360 ISP_IOXPUT_8(isp, insrc->in_tgt, &indst->in_tgt);
1361 ISP_IOXPUT_8(isp, insrc->in_status, &indst->in_status);
1362 ISP_IOXPUT_8(isp, insrc->in_rsvd2, &indst->in_rsvd2);
1363 ISP_IOXPUT_8(isp, insrc->in_tag_val, &indst->in_tag_val);
1364 ISP_IOXPUT_8(isp, insrc->in_tag_type, &indst->in_tag_type);
1366 ISP_IOXPUT_32(isp, insrc->in_flags, &indst->in_flags);
1367 ISP_IOXPUT_16(isp, insrc->in_seqid, &indst->in_seqid);
1368 for (i = 0; i < IN_MSGLEN; i++) {
1369 ISP_IOXPUT_8(isp, insrc->in_msg[i], &indst->in_msg[i]);
1371 for (i = 0; i < IN_RSVDLEN; i++) {
1372 ISP_IOXPUT_8(isp, insrc->in_reserved3[i],
1373 &indst->in_reserved3[i]);
1375 for (i = 0; i < QLTM_SENSELEN; i++) {
1376 ISP_IOXPUT_8(isp, insrc->in_sense[i],
1377 &indst->in_sense[i]);
1382 isp_get_notify(struct ispsoftc *isp, in_entry_t *insrc, in_entry_t *indst)
1385 isp_copy_in_hdr(isp, &insrc->in_header, &indst->in_header);
1386 ISP_IOXGET_32(isp, &insrc->in_reserved, indst->in_reserved);
1387 if (ISP_IS_SBUS(isp)) {
1388 ISP_IOXGET_8(isp, &insrc->in_lun, indst->in_iid);
1389 ISP_IOXGET_8(isp, &insrc->in_iid, indst->in_lun);
1390 ISP_IOXGET_8(isp, &insrc->in_reserved2, indst->in_tgt);
1391 ISP_IOXGET_8(isp, &insrc->in_tgt, indst->in_reserved2);
1392 ISP_IOXGET_8(isp, &insrc->in_status, indst->in_rsvd2);
1393 ISP_IOXGET_8(isp, &insrc->in_rsvd2, indst->in_status);
1394 ISP_IOXGET_8(isp, &insrc->in_tag_val, indst->in_tag_type);
1395 ISP_IOXGET_8(isp, &insrc->in_tag_type, indst->in_tag_val);
1397 ISP_IOXGET_8(isp, &insrc->in_lun, indst->in_lun);
1398 ISP_IOXGET_8(isp, &insrc->in_iid, indst->in_iid);
1399 ISP_IOXGET_8(isp, &insrc->in_reserved2, indst->in_reserved2);
1400 ISP_IOXGET_8(isp, &insrc->in_tgt, indst->in_tgt);
1401 ISP_IOXGET_8(isp, &insrc->in_status, indst->in_status);
1402 ISP_IOXGET_8(isp, &insrc->in_rsvd2, indst->in_rsvd2);
1403 ISP_IOXGET_8(isp, &insrc->in_tag_val, indst->in_tag_val);
1404 ISP_IOXGET_8(isp, &insrc->in_tag_type, indst->in_tag_type);
1406 ISP_IOXGET_32(isp, &insrc->in_flags, indst->in_flags);
1407 ISP_IOXGET_16(isp, &insrc->in_seqid, indst->in_seqid);
1408 for (i = 0; i < IN_MSGLEN; i++) {
1409 ISP_IOXGET_8(isp, &insrc->in_msg[i], indst->in_msg[i]);
1411 for (i = 0; i < IN_RSVDLEN; i++) {
1412 ISP_IOXGET_8(isp, &insrc->in_reserved3[i],
1413 indst->in_reserved3[i]);
1415 for (i = 0; i < QLTM_SENSELEN; i++) {
1416 ISP_IOXGET_8(isp, &insrc->in_sense[i],
1417 indst->in_sense[i]);
1422 isp_put_notify_fc(struct ispsoftc *isp, in_fcentry_t *insrc,
1423 in_fcentry_t *indst)
1425 isp_copy_out_hdr(isp, &insrc->in_header, &indst->in_header);
1426 ISP_IOXPUT_32(isp, insrc->in_reserved, &indst->in_reserved);
1427 ISP_IOXPUT_8(isp, insrc->in_lun, &indst->in_lun);
1428 ISP_IOXPUT_8(isp, insrc->in_iid, &indst->in_iid);
1429 ISP_IOXPUT_16(isp, insrc->in_scclun, &indst->in_scclun);
1430 ISP_IOXPUT_32(isp, insrc->in_reserved2, &indst->in_reserved2);
1431 ISP_IOXPUT_16(isp, insrc->in_status, &indst->in_status);
1432 ISP_IOXPUT_16(isp, insrc->in_task_flags, &indst->in_task_flags);
1433 ISP_IOXPUT_16(isp, insrc->in_seqid, &indst->in_seqid);
1437 isp_get_notify_fc(struct ispsoftc *isp, in_fcentry_t *insrc,
1438 in_fcentry_t *indst)
1440 isp_copy_in_hdr(isp, &insrc->in_header, &indst->in_header);
1441 ISP_IOXGET_32(isp, &insrc->in_reserved, indst->in_reserved);
1442 ISP_IOXGET_8(isp, &insrc->in_lun, indst->in_lun);
1443 ISP_IOXGET_8(isp, &insrc->in_iid, indst->in_iid);
1444 ISP_IOXGET_16(isp, &insrc->in_scclun, indst->in_scclun);
1445 ISP_IOXGET_32(isp, &insrc->in_reserved2, indst->in_reserved2);
1446 ISP_IOXGET_16(isp, &insrc->in_status, indst->in_status);
1447 ISP_IOXGET_16(isp, &insrc->in_task_flags, indst->in_task_flags);
1448 ISP_IOXGET_16(isp, &insrc->in_seqid, indst->in_seqid);
1452 isp_put_notify_ack(struct ispsoftc *isp, na_entry_t *nasrc, na_entry_t *nadst)
1455 isp_copy_out_hdr(isp, &nasrc->na_header, &nadst->na_header);
1456 ISP_IOXPUT_32(isp, nasrc->na_reserved, &nadst->na_reserved);
1457 if (ISP_IS_SBUS(isp)) {
1458 ISP_IOXPUT_8(isp, nasrc->na_lun, &nadst->na_iid);
1459 ISP_IOXPUT_8(isp, nasrc->na_iid, &nadst->na_lun);
1460 ISP_IOXPUT_8(isp, nasrc->na_status, &nadst->na_event);
1461 ISP_IOXPUT_8(isp, nasrc->na_event, &nadst->na_status);
1463 ISP_IOXPUT_8(isp, nasrc->na_lun, &nadst->na_lun);
1464 ISP_IOXPUT_8(isp, nasrc->na_iid, &nadst->na_iid);
1465 ISP_IOXPUT_8(isp, nasrc->na_status, &nadst->na_status);
1466 ISP_IOXPUT_8(isp, nasrc->na_event, &nadst->na_event);
1468 ISP_IOXPUT_32(isp, nasrc->na_flags, &nadst->na_flags);
1469 for (i = 0; i < NA_RSVDLEN; i++) {
1470 ISP_IOXPUT_16(isp, nasrc->na_reserved3[i],
1471 &nadst->na_reserved3[i]);
1476 isp_get_notify_ack(struct ispsoftc *isp, na_entry_t *nasrc, na_entry_t *nadst)
1479 isp_copy_in_hdr(isp, &nasrc->na_header, &nadst->na_header);
1480 ISP_IOXGET_32(isp, &nasrc->na_reserved, nadst->na_reserved);
1481 if (ISP_IS_SBUS(isp)) {
1482 ISP_IOXGET_8(isp, &nasrc->na_lun, nadst->na_iid);
1483 ISP_IOXGET_8(isp, &nasrc->na_iid, nadst->na_lun);
1484 ISP_IOXGET_8(isp, &nasrc->na_status, nadst->na_event);
1485 ISP_IOXGET_8(isp, &nasrc->na_event, nadst->na_status);
1487 ISP_IOXGET_8(isp, &nasrc->na_lun, nadst->na_lun);
1488 ISP_IOXGET_8(isp, &nasrc->na_iid, nadst->na_iid);
1489 ISP_IOXGET_8(isp, &nasrc->na_status, nadst->na_status);
1490 ISP_IOXGET_8(isp, &nasrc->na_event, nadst->na_event);
1492 ISP_IOXGET_32(isp, &nasrc->na_flags, nadst->na_flags);
1493 for (i = 0; i < NA_RSVDLEN; i++) {
1494 ISP_IOXGET_16(isp, &nasrc->na_reserved3[i],
1495 nadst->na_reserved3[i]);
1500 isp_put_notify_ack_fc(struct ispsoftc *isp, na_fcentry_t *nasrc,
1501 na_fcentry_t *nadst)
1504 isp_copy_out_hdr(isp, &nasrc->na_header, &nadst->na_header);
1505 ISP_IOXPUT_32(isp, nasrc->na_reserved, &nadst->na_reserved);
1506 ISP_IOXPUT_8(isp, nasrc->na_lun, &nadst->na_lun);
1507 ISP_IOXPUT_8(isp, nasrc->na_iid, &nadst->na_iid);
1508 ISP_IOXPUT_16(isp, nasrc->na_scclun, &nadst->na_scclun);
1509 ISP_IOXPUT_16(isp, nasrc->na_flags, &nadst->na_flags);
1510 ISP_IOXPUT_16(isp, nasrc->na_reserved2, &nadst->na_reserved2);
1511 ISP_IOXPUT_16(isp, nasrc->na_status, &nadst->na_status);
1512 ISP_IOXPUT_16(isp, nasrc->na_task_flags, &nadst->na_task_flags);
1513 ISP_IOXPUT_16(isp, nasrc->na_seqid, &nadst->na_seqid);
1514 for (i = 0; i < NA2_RSVDLEN; i++) {
1515 ISP_IOXPUT_16(isp, nasrc->na_reserved3[i],
1516 &nadst->na_reserved3[i]);
1521 isp_get_notify_ack_fc(struct ispsoftc *isp, na_fcentry_t *nasrc,
1522 na_fcentry_t *nadst)
1525 isp_copy_in_hdr(isp, &nasrc->na_header, &nadst->na_header);
1526 ISP_IOXGET_32(isp, &nasrc->na_reserved, nadst->na_reserved);
1527 ISP_IOXGET_8(isp, &nasrc->na_lun, nadst->na_lun);
1528 ISP_IOXGET_8(isp, &nasrc->na_iid, nadst->na_iid);
1529 ISP_IOXGET_16(isp, &nasrc->na_scclun, nadst->na_scclun);
1530 ISP_IOXGET_16(isp, &nasrc->na_flags, nadst->na_flags);
1531 ISP_IOXGET_16(isp, &nasrc->na_reserved2, nadst->na_reserved2);
1532 ISP_IOXGET_16(isp, &nasrc->na_status, nadst->na_status);
1533 ISP_IOXGET_16(isp, &nasrc->na_task_flags, nadst->na_task_flags);
1534 ISP_IOXGET_16(isp, &nasrc->na_seqid, nadst->na_seqid);
1535 for (i = 0; i < NA2_RSVDLEN; i++) {
1536 ISP_IOXGET_16(isp, &nasrc->na_reserved3[i],
1537 nadst->na_reserved3[i]);
1541 #endif /* _ISP_INLINE_H */