Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic pick up FreeBSD changes



details:   https://anonhg.NetBSD.org/src/rev/ff83273fff4e
branches:  trunk
changeset: 494353:ff83273fff4e
user:      mjacob <mjacob%NetBSD.org@localhost>
date:      Wed Jul 05 22:25:34 2000 +0000

description:
pick up FreeBSD changes

diffstat:

 sys/dev/ic/isp_target.c |  56 ++++++++++++++++++++++++------------------------
 sys/dev/ic/isp_target.h |   3 +-
 2 files changed, 30 insertions(+), 29 deletions(-)

diffs (130 lines):

diff -r e89521f3bc9d -r ff83273fff4e sys/dev/ic/isp_target.c
--- a/sys/dev/ic/isp_target.c   Wed Jul 05 22:25:06 2000 +0000
+++ b/sys/dev/ic/isp_target.c   Wed Jul 05 22:25:34 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_target.c,v 1.4 2000/05/13 16:53:04 he Exp $ */
+/* $NetBSD: isp_target.c,v 1.5 2000/07/05 22:25:34 mjacob Exp $ */
 /*
  * Machine and OS Independent Target Mode Code for the Qlogic SCSI/FC adapters.
  *
@@ -285,7 +285,7 @@
        el.le_in_count = DFLT_INOTIFY;
        if (cmd == RQSTYPE_ENABLE_LUN) {
                if (IS_SCSI(isp)) {
-                       el.le_flags = LUN_TQAE;
+                       el.le_flags = LUN_TQAE|LUN_DISAD;
                        el.le_cdb6len = 12;
                        el.le_cdb7len = 12;
                }
@@ -305,10 +305,8 @@
        if (IS_SCSI(isp)) {
                el.le_tgt = tgt;
                el.le_lun = lun;
-#ifndef        ISP2100_SCCLUN
-       } else {
+       } else if (isp->isp_maxluns <= 16) {
                el.le_lun = lun;
-#endif
        }
 
        if (isp_getrqentry(isp, &iptr, &optr, &outp)) {
@@ -380,11 +378,11 @@
        if (IS_FC(isp)) {
                atun._atio2.at_header.rqs_entry_type = RQSTYPE_ATIO2;
                atun._atio2.at_header.rqs_entry_count = 1;
-#ifdef ISP2100_SCCLUN
-               atun._atio2.at_scclun = (uint16_t) lun;
-#else
-               atun._atio2.at_lun = (uint8_t) lun;
-#endif
+               if (isp->isp_maxluns > 16) {
+                       atun._atio2.at_scclun = (u_int16_t) lun;
+               } else {
+                       atun._atio2.at_lun = (u_int8_t) lun;
+               }
                atun._atio2.at_status = CT_OK;
        } else {
                atun._atio.at_header.rqs_entry_type = RQSTYPE_ATIO;
@@ -436,9 +434,9 @@
                cto->ct_header.rqs_entry_type = RQSTYPE_CTIO2;
                cto->ct_header.rqs_entry_count = 1;
                cto->ct_iid = aep->at_iid;
-#ifndef        ISP2100_SCCLUN
-               cto->ct_lun = aep->at_lun;
-#endif
+               if (isp->isp_maxluns <= 16) {
+                       cto->ct_lun = aep->at_lun;
+               }
                cto->ct_rxid = aep->at_rxid;
                cto->rsp.m1.ct_scsi_status = sts & 0xff;
                cto->ct_flags = CT2_SENDSTATUS | CT2_NO_DATA | CT2_FLAG_MODE1;
@@ -596,11 +594,11 @@
                MEMZERO(&msg, sizeof (msg));
                msg.nt_bus = bus;
                msg.nt_iid = inp->in_iid;
-#ifdef ISP2100_SCCLUN
-               msg.nt_lun = inp->in_scclun;
-#else
-               msg.nt_lun = inp->in_lun;
-#endif
+               if (isp->isp_maxluns > 16) {
+                       msg.nt_lun = inp->in_scclun;
+               } else {
+                       msg.nt_lun = inp->in_lun;
+               }
                msg.nt_tagval = inp->in_seqid;
 
                if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK) {
@@ -658,11 +656,11 @@
                        in_fcentry_t *inp = arg;
                        MEMCPY(storage, arg, sizeof (isphdr_t));
                        na->na_iid = inp->in_iid;
-#ifdef ISP2100_SCCLUN
-                       na->na_lun = inp->in_scclun;
-#else
-                       na->na_lun = inp->in_lun;
-#endif
+                       if (isp->isp_maxluns > 16) {
+                               na->na_lun = inp->in_scclun;
+                       } else {
+                               na->na_lun = inp->in_lun;
+                       }
                        na->na_task_flags = inp->in_task_flags;
                        na->na_seqid = inp->in_seqid;
                        na->na_flags = NAFC_RCOUNT;
@@ -788,11 +786,13 @@
        at2_entry_t *aep;
 {
        int lun;
-#ifdef ISP2100_SCCLUN
-       lun = aep->at_scclun;
-#else
-       lun = aep->at_lun;
-#endif
+
+       if (isp->isp_maxluns > 16) {
+               lun = aep->at_scclun;
+       } else {
+               lun = aep->at_lun;
+       }
+
        /*
         * The firmware status (except for the QLTM_SVALID bit) indicates
         * why this ATIO was sent to us.
diff -r e89521f3bc9d -r ff83273fff4e sys/dev/ic/isp_target.h
--- a/sys/dev/ic/isp_target.h   Wed Jul 05 22:25:06 2000 +0000
+++ b/sys/dev/ic/isp_target.h   Wed Jul 05 22:25:34 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_target.h,v 1.4 2000/05/13 16:53:04 he Exp $ */
+/* $NetBSD: isp_target.h,v 1.5 2000/07/05 22:25:34 mjacob Exp $ */
 /*
  * Qlogic Target Mode Structure and Flag Definitions
  *
@@ -71,6 +71,7 @@
  */
 #define LUN_TQAE       0x00000001      /* bit1  Tagged Queue Action Enable */
 #define LUN_DSSM       0x01000000      /* bit24 Disable Sending SDP Message */
+#define        LUN_DISAD       0x02000000      /* bit25 Disable autodisconnect */
 #define LUN_DM         0x40000000      /* bit30 Disconnects Mandatory */
 
 /*



Home | Main Index | Thread Index | Old Index