Source-Changes-HG archive

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

[src/thorpej_scsipi]: src/sys/dev Update for:



details:   https://anonhg.NetBSD.org/src/rev/2d8f1a2147c5
branches:  thorpej_scsipi
changeset: 477304:2d8f1a2147c5
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Oct 26 23:10:14 1999 +0000

description:
Update for:

  Deal a little more gracefully with the fact that xfer mode parameters
  are for the I_T Nexus, and make all xfer mode updates `async events'.

diffstat:

 sys/dev/eisa/ahb.c      |    6 +-
 sys/dev/ic/adv.c        |   32 +++++-----
 sys/dev/ic/adw.c        |    6 +-
 sys/dev/ic/aha.c        |    8 +-
 sys/dev/ic/aic6360.c    |   90 ++++++++++++++++++-------------
 sys/dev/ic/aic7xxx.c    |  132 ++++++++++++++++++++++++++++-------------------
 sys/dev/ic/bha.c        |   45 +++++++--------
 sys/dev/ic/dpt.c        |    8 +--
 sys/dev/ic/isp_netbsd.c |   75 +++++++++++---------------
 sys/dev/ic/ncr5380sbc.c |   17 +++--
 sys/dev/ic/ncr53c9x.c   |   67 +++++++++++++++--------
 sys/dev/ic/uha.c        |   13 ++--
 sys/dev/isa/seagate.c   |   20 +++---
 sys/dev/isa/wds.c       |    6 +-
 sys/dev/pci/ncr.c       |    7 +-
 sys/dev/usb/umass.c     |    3 +-
 16 files changed, 279 insertions(+), 256 deletions(-)

diffs (truncated from 1034 to 300 lines):

diff -r 9aceab0bd313 -r 2d8f1a2147c5 sys/dev/eisa/ahb.c
--- a/sys/dev/eisa/ahb.c        Tue Oct 26 23:08:05 1999 +0000
+++ b/sys/dev/eisa/ahb.c        Tue Oct 26 23:10:14 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahb.c,v 1.28.2.2 1999/10/20 20:42:42 thorpej Exp $     */
+/*     $NetBSD: ahb.c,v 1.28.2.3 1999/10/26 23:10:14 thorpej Exp $     */
 
 #include "opt_ddb.h"
 
@@ -983,10 +983,6 @@
        case ADAPTER_REQ_SET_XFER_MODE:
                /* XXX How do we do this? */
                return;
-
-       case ADAPTER_REQ_GET_XFER_MODE:
-               /* XXX How do we do this? */
-               return;
        }
 }
 
diff -r 9aceab0bd313 -r 2d8f1a2147c5 sys/dev/ic/adv.c
--- a/sys/dev/ic/adv.c  Tue Oct 26 23:08:05 1999 +0000
+++ b/sys/dev/ic/adv.c  Tue Oct 26 23:10:14 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adv.c,v 1.14.2.3 1999/10/20 20:40:51 thorpej Exp $     */
+/*     $NetBSD: adv.c,v 1.14.2.4 1999/10/26 23:10:14 thorpej Exp $     */
 
 /*
  * Generic driver for the Advanced Systems Inc. Narrow SCSI controllers
@@ -679,34 +679,34 @@
                return;
 
        case ADAPTER_REQ_SET_XFER_MODE:
-               /* XXX XXX XXX */
-               return;
-
-       case ADAPTER_REQ_GET_XFER_MODE:
            {
+               /*
+                * We can't really set the mode, but we know how to
+                * query what the firmware negotiated.
+                */
+               struct scsipi_xfer_mode *xm = arg;
                u_int8_t sdtr_data;
                ASC_SCSI_BIT_ID_TYPE tid_bit;
 
-               periph = arg;
-               tid_bit = ASC_TIX_TO_TARGET_ID(periph->periph_target);
+               tid_bit = ASC_TIX_TO_TARGET_ID(xm->xm_target);
 
-               periph->periph_mode = 0;
-               periph->periph_period = 0;
-               periph->periph_offset = 0;
+               xm->xm_mode = 0;
+               xm->xm_period = 0;
+               xm->xm_offset = 0;
 
                if (sc->init_sdtr & tid_bit) {
-                       periph->periph_mode |= PERIPH_CAP_SYNC;
-                       sdtr_data = sc->sdtr_data[periph->periph_target];
-                       periph->periph_period =
+                       xm->xm_mode |= PERIPH_CAP_SYNC;
+                       sdtr_data = sc->sdtr_data[xm->xm_target];
+                       xm->xm_period =
                            sc->sdtr_period_tbl[(sdtr_data >> 4) &
                            (sc->max_sdtr_index - 1)];
-                       periph->periph_offset = sdtr_data & ASC_SYN_MAX_OFFSET;
+                       xm->xm_offset = sdtr_data & ASC_SYN_MAX_OFFSET;
                }
 
                if (sc->use_tagged_qng & tid_bit)
-                       periph->periph_mode |= PERIPH_CAP_TQING;
+                       xm->xm_mode |= PERIPH_CAP_TQING;
 
-               periph->periph_flags |= PERIPH_MODE_VALID;
+               scsipi_async_event(chan, ASYNC_EVENT_XFER_MODE, xm);
                return;
            }
        }
diff -r 9aceab0bd313 -r 2d8f1a2147c5 sys/dev/ic/adw.c
--- a/sys/dev/ic/adw.c  Tue Oct 26 23:08:05 1999 +0000
+++ b/sys/dev/ic/adw.c  Tue Oct 26 23:10:14 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adw.c,v 1.12.2.3 1999/10/20 20:40:51 thorpej Exp $  */
+/* $NetBSD: adw.c,v 1.12.2.4 1999/10/26 23:10:14 thorpej Exp $  */
 
 /*
  * Generic driver for the Advanced Systems Inc. SCSI controllers
@@ -524,10 +524,6 @@
        case ADAPTER_REQ_SET_XFER_MODE:
                /* XXX XXX XXX */
                return;
-
-       case ADAPTER_REQ_GET_XFER_MODE:
-               /* XXX XXX XXX */
-               return;
        }
 }
 
diff -r 9aceab0bd313 -r 2d8f1a2147c5 sys/dev/ic/aha.c
--- a/sys/dev/ic/aha.c  Tue Oct 26 23:08:05 1999 +0000
+++ b/sys/dev/ic/aha.c  Tue Oct 26 23:10:14 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aha.c,v 1.24.2.3 1999/10/20 20:40:51 thorpej Exp $     */
+/*     $NetBSD: aha.c,v 1.24.2.4 1999/10/26 23:10:14 thorpej Exp $     */
 
 #include "opt_ddb.h"
 
@@ -1291,11 +1291,9 @@
        case ADAPTER_REQ_SET_XFER_MODE:
                /*
                 * Can't really do this on the Adaptec; it has
-                * its own config mechanism.
+                * its own config mechanism, but we do know how
+                * to query what the firmware negotiated.
                 */
-               return;
-
-       case ADAPTER_REQ_GET_XFER_MODE:
                /* XXX XXX XXX */
                return;
        }
diff -r 9aceab0bd313 -r 2d8f1a2147c5 sys/dev/ic/aic6360.c
--- a/sys/dev/ic/aic6360.c      Tue Oct 26 23:08:05 1999 +0000
+++ b/sys/dev/ic/aic6360.c      Tue Oct 26 23:10:14 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic6360.c,v 1.63.2.3 1999/10/20 22:06:14 thorpej Exp $ */
+/*     $NetBSD: aic6360.c,v 1.63.2.4 1999/10/26 23:10:15 thorpej Exp $ */
 
 #include "opt_ddb.h"
 #ifdef DDB
@@ -175,6 +175,7 @@
 void   aic_msgout      __P((struct aic_softc *));
 int    aic_dataout_pio __P((struct aic_softc *, u_char *, int));
 int    aic_datain_pio  __P((struct aic_softc *, u_char *, int));
+void   aic_update_xfer_mode __P((struct aic_softc *, int));
 #if AIC_DEBUG
 void   aic_print_acb   __P((struct aic_acb *));
 void   aic_dump_driver __P((struct aic_softc *));
@@ -595,53 +596,65 @@
        case ADAPTER_REQ_SET_XFER_MODE:
            {
                struct aic_tinfo *ti;
-               periph = arg;
-               ti = &sc->sc_tinfo[periph->periph_target];
+               struct scsipi_xfer_mode *xm = arg;
+
+               ti = &sc->sc_tinfo[xm->xm_target];
+               ti->flags &= ~(DO_SYNC|DO_WIDE);
+               ti->period = 0;
+               ti->offset = 0;
+
 #if AIC_USE_SYNCHRONOUS
-               if (periph->periph_cap & PERIPH_CAP_SYNC) {
+               if (xm->xm_mode & PERIPH_CAP_SYNC) {
                        ti->flags |= DO_SYNC;
                        ti->period = sc->sc_minsync;
                        ti->offset = AIC_SYNC_REQ_ACK_OFS;
                }
 #endif
 #if AIC_USE_WIDE
-               if (periph->periph_cap & PERIPH_CAP_WIDE16) {
+               if (xm->xm_mode & PERIPH_CAP_WIDE16) {
                        ti->flags |= DO_WIDE;
                        ti->width = AIC_MAX_WIDTH;
                }
 #endif
+               /*
+                * If we're not going to negotiate, send the notification
+                * now, since it won't happen later.
+                */
+               if ((ti->flags & (DO_SYNC|DO_WIDE)) == 0)
+                       aic_update_xfer_mode(sc, xm->xm_target);
                return;
            }
+       }
+}
 
-       case ADAPTER_REQ_GET_XFER_MODE:
-           {
-               struct aic_tinfo *ti;
-               periph = arg;
-               ti = &sc->sc_tinfo[periph->periph_target];
+void
+aic_update_xfer_mode(sc, target)
+       struct aic_softc *sc;
+       int target;
+{
+       struct scsipi_xfer_mode xm;
+       struct aic_tinfo *ti = &sc->sc_tinfo[target];
 
-               periph->periph_mode = 0;
-               periph->periph_period = 0;
-               periph->periph_offset = 0;
+       xm.xm_target = target;
+       xm.xm_mode = 0;
+       xm.xm_period = 0;
+       xm.xm_offset = 0;
 
-               if (ti->offset != 0) {
-                       periph->periph_mode |= PERIPH_CAP_SYNC;
-                       periph->periph_period = ti->period;
-                       periph->periph_offset = ti->offset;
-               }
-               switch (ti->width) {
-               case 2:
-                       periph->periph_mode |= PERIPH_CAP_WIDE32;
-                       break;
-               case 1:
-                       periph->periph_mode |= PERIPH_CAP_WIDE16;
-                       break;
-               }
+       if (ti->offset != 0) {
+               xm.xm_mode |= PERIPH_CAP_SYNC;
+               xm.xm_period = ti->period;
+               xm.xm_offset = ti->offset;
+       }
+       switch (ti->width) {
+       case 2:
+               xm.xm_mode |= PERIPH_CAP_WIDE32;
+               break;
+       case 1:
+               xm.xm_mode |= PERIPH_CAP_WIDE16;
+               break;
+       }
 
-               periph->periph_flags |= PERIPH_MODE_VALID;
-               return;
-           }
-       
-       }
+       scsipi_async_event(&sc->sc_channel, ASYNC_EVENT_XFER_MODE, &xm);
 }
 
 /*
@@ -1137,12 +1150,16 @@
                                ti->flags &= ~DO_SYNC;
                                ti->period = ti->offset = 0;
                                aic_setsync(sc, ti);
+                               aic_update_xfer_mode(sc,
+                                   acb->xs->xs_periph->periph_target);
                                break;
 #endif
 #if AIC_USE_WIDE
                        case SEND_WDTR:
                                ti->flags &= ~DO_WIDE;
                                ti->width = 0;
+                               aic_update_xfer_mode(sc,
+                                   acb->xs->xs_periph->periph_target);
                                break;
 #endif
                        case SEND_INIT_DET_ERR:
@@ -1187,10 +1204,8 @@
                                        ti->period = ti->offset = 0;
                                        aic_sched_msgout(sc, SEND_SDTR);
                                } else {
-                                       scsipi_printaddr(acb->xs->xs_periph);
-                                       printf("sync, offset %d, "
-                                           "period %dnsec\n",
-                                           ti->offset, ti->period * 4);
+                                       aic_update_xfer_mode(sc,
+                                           acb->xs->xs_periph->periph_target);
                                }
                                aic_setsync(sc, ti);
                                break;
@@ -1207,9 +1222,8 @@
                                        ti->width = 0;
                                        aic_sched_msgout(sc, SEND_WDTR);
                                } else {
-                                       scsipi_printaddr(acb->xs->xs_periph);
-                                       printf("wide, width %d\n",
-                                           1 << (3 + ti->width));
+                                       aic_update_xfer_mode(sc,
+                                           acb->xs->xs_periph->periph_target);
                                }
                                break;
 #endif
diff -r 9aceab0bd313 -r 2d8f1a2147c5 sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c      Tue Oct 26 23:08:05 1999 +0000
+++ b/sys/dev/ic/aic7xxx.c      Tue Oct 26 23:10:14 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic7xxx.c,v 1.37.2.3 1999/10/20 20:40:51 thorpej Exp $ */
+/*     $NetBSD: aic7xxx.c,v 1.37.2.4 1999/10/26 23:10:15 thorpej Exp $ */
 
 /*
  * Generic driver for the aic7xxx based adaptec SCSI controllers
@@ -307,6 +307,8 @@
                                        u_int8_t period, u_int8_t offset));  
 static void    ahc_construct_wdtr __P((struct ahc_data *ahc, int start_byte,
                                        u_int8_t bus_width));
+static void    ahc_update_xfer_mode __P((struct ahc_data *ahc, int channel,
+                   int target));
 
 #if defined(__FreeBSD__)
 
@@ -550,7 +552,9 @@
                                          | (*offset & 0x0f);
                                *period = ahc_syncrates[i].period;
 
-#if 0



Home | Main Index | Thread Index | Old Index