[BACK]Return to mscp_subr.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / dev / mscp

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/dev/mscp/mscp_subr.c between version 1.28 and 1.28.2.1

version 1.28, 2005/06/27 11:05:24 version 1.28.2.1, 2006/06/21 15:05:02
Line 166  mscp_attach(parent, self, aux)
Line 166  mscp_attach(parent, self, aux)
         void *aux;          void *aux;
 {  {
         struct  mscp_attach_args *ma = aux;          struct  mscp_attach_args *ma = aux;
         struct  mscp_softc *mi = (void *)self;          struct  mscp_softc *mi = device_private(self);
         struct mscp *mp2;          struct mscp *mp2;
         volatile struct mscp *mp;          volatile struct mscp *mp;
         volatile int i;          volatile int i;
Line 196  mscp_attach(parent, self, aux)
Line 196  mscp_attach(parent, self, aux)
         mi->mi_rsp.mri_size = NRSP;          mi->mi_rsp.mri_size = NRSP;
         mi->mi_rsp.mri_desc = mi->mi_uda->mp_ca.ca_rspdsc;          mi->mi_rsp.mri_desc = mi->mi_uda->mp_ca.ca_rspdsc;
         mi->mi_rsp.mri_ring = mi->mi_uda->mp_rsp;          mi->mi_rsp.mri_ring = mi->mi_uda->mp_rsp;
         bufq_alloc(&mi->mi_resq, BUFQ_FCFS);          bufq_alloc(&mi->mi_resq, "fcfs", 0);
   
         if (mscp_init(mi)) {          if (mscp_init(mi)) {
                 printf("%s: can't init, controller hung\n",                  printf("%s: can't init, controller hung\n",
Line 354  mscp_init(mi)
Line 354  mscp_init(mi)
         if (status == 0)          if (status == 0)
                 return 1; /* Init failed */                  return 1; /* Init failed */
         if (READ_SA & MP_ERR) {          if (READ_SA & MP_ERR) {
                 (*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);                  (*mi->mi_mc->mc_saerror)(device_parent(&mi->mi_dev), 0);
                 return 1;                  return 1;
         }          }
   
Line 363  mscp_init(mi)
Line 363  mscp_init(mi)
             MP_IE | (mi->mi_ivec >> 2));              MP_IE | (mi->mi_ivec >> 2));
         status = mscp_waitstep(mi, STEP1MASK, STEP1GOOD);          status = mscp_waitstep(mi, STEP1MASK, STEP1GOOD);
         if (status == 0) {          if (status == 0) {
                 (*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);                  (*mi->mi_mc->mc_saerror)(device_parent(&mi->mi_dev), 0);
                 return 1;                  return 1;
         }          }
   
Line 373  mscp_init(mi)
Line 373  mscp_init(mi)
             (vax_cputype == VAX_780 || vax_cputype == VAX_8600 ? MP_PI : 0));              (vax_cputype == VAX_780 || vax_cputype == VAX_8600 ? MP_PI : 0));
         status = mscp_waitstep(mi, STEP2MASK, STEP2GOOD(mi->mi_ivec >> 2));          status = mscp_waitstep(mi, STEP2MASK, STEP2GOOD(mi->mi_ivec >> 2));
         if (status == 0) {          if (status == 0) {
                 (*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);                  (*mi->mi_mc->mc_saerror)(device_parent(&mi->mi_dev), 0);
                 return 1;                  return 1;
         }          }
   
Line 381  mscp_init(mi)
Line 381  mscp_init(mi)
         WRITE_SW((mi->mi_dmam->dm_segs[0].ds_addr >> 16));          WRITE_SW((mi->mi_dmam->dm_segs[0].ds_addr >> 16));
         status = mscp_waitstep(mi, STEP3MASK, STEP3GOOD);          status = mscp_waitstep(mi, STEP3MASK, STEP3GOOD);
         if (status == 0) {          if (status == 0) {
                 (*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);                  (*mi->mi_mc->mc_saerror)(device_parent(&mi->mi_dev), 0);
                 return 1;                  return 1;
         }          }
         i = READ_SA & 0377;          i = READ_SA & 0377;
Line 487  mscp_intr(mi)
Line 487  mscp_intr(mi)
         /*          /*
          * If there are any not-yet-handled request, try them now.           * If there are any not-yet-handled request, try them now.
          */           */
         if (BUFQ_PEEK(&mi->mi_resq))          if (BUFQ_PEEK(mi->mi_resq))
                 mscp_kickaway(mi);                  mscp_kickaway(mi);
 }  }
   
Line 522  mscp_strategy(bp, usc)
Line 522  mscp_strategy(bp, usc)
         struct  mscp_softc *mi = (void *)usc;          struct  mscp_softc *mi = (void *)usc;
         int s = spluba();          int s = spluba();
   
         BUFQ_PUT(&mi->mi_resq, bp);          BUFQ_PUT(mi->mi_resq, bp);
         mscp_kickaway(mi);          mscp_kickaway(mi);
         splx(s);          splx(s);
 }  }
Line 536  mscp_kickaway(mi)
Line 536  mscp_kickaway(mi)
         struct  mscp *mp;          struct  mscp *mp;
         int next;          int next;
   
         while ((bp = BUFQ_PEEK(&mi->mi_resq)) != NULL) {          while ((bp = BUFQ_PEEK(mi->mi_resq)) != NULL) {
                 /*                  /*
                  * Ok; we are ready to try to start a xfer. Get a MSCP packet                   * Ok; we are ready to try to start a xfer. Get a MSCP packet
                  * and try to start...                   * and try to start...
Line 544  mscp_kickaway(mi)
Line 544  mscp_kickaway(mi)
                 if ((mp = mscp_getcp(mi, MSCP_DONTWAIT)) == NULL) {                  if ((mp = mscp_getcp(mi, MSCP_DONTWAIT)) == NULL) {
                         if (mi->mi_credits > MSCP_MINCREDITS)                          if (mi->mi_credits > MSCP_MINCREDITS)
                                 printf("%s: command ring too small\n",                                  printf("%s: command ring too small\n",
                                     mi->mi_dev.dv_parent->dv_xname);                                      device_parent(&mi->mi_dev)->dv_xname);
                         /*                          /*
                          * By some (strange) reason we didn't get a MSCP packet.                           * By some (strange) reason we didn't get a MSCP packet.
                          * Just return and wait for free packets.                           * Just return and wait for free packets.
Line 568  mscp_kickaway(mi)
Line 568  mscp_kickaway(mi)
                 mi->mi_xi[next].mxi_inuse = 1;                  mi->mi_xi[next].mxi_inuse = 1;
                 bp->b_resid = next;                  bp->b_resid = next;
                 (*mi->mi_me->me_fillin)(bp, mp);                  (*mi->mi_me->me_fillin)(bp, mp);
                 (*mi->mi_mc->mc_go)(mi->mi_dev.dv_parent, &mi->mi_xi[next]);                  (*mi->mi_mc->mc_go)(device_parent(&mi->mi_dev),
                 (void)BUFQ_GET(&mi->mi_resq);                      &mi->mi_xi[next]);
                   (void)BUFQ_GET(mi->mi_resq);
         }          }
 }  }
   

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.28.2.1

CVSweb <webmaster@jp.NetBSD.org>