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

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

Diff for /src/sys/dev/ic/com.c between version 1.76 and 1.77

version 1.76, 1996/03/17 00:53:10 version 1.77, 1996/03/17 13:38:14
Line 68 
Line 68 
 #endif  #endif
 #define com_lcr com_cfcr  #define com_lcr com_cfcr
   
   #include "com.h"
   
 #define COM_IBUFSIZE    (2 * 512)  #define COM_IBUFSIZE    (2 * 512)
 #define COM_IHIGHWATER  ((3 * COM_IBUFSIZE) / 4)  #define COM_IHIGHWATER  ((3 * COM_IBUFSIZE) / 4)
   
Line 108  struct com_softc {
Line 110  struct com_softc {
         u_char sc_ibufs[2][COM_IBUFSIZE];          u_char sc_ibufs[2][COM_IBUFSIZE];
 };  };
   
 int comprobe __P((struct device *, void *, void *));  
 #ifdef COM_HAYESP  #ifdef COM_HAYESP
 int comprobeHAYESP __P((bus_io_handle_t hayespioh, struct com_softc *sc));  int comprobeHAYESP __P((bus_io_handle_t hayespioh, struct com_softc *sc));
 #endif  #endif
 void comattach __P((struct device *, struct device *, void *));  
 int comopen __P((dev_t, int, int, struct proc *));  int comopen __P((dev_t, int, int, struct proc *));
 int comclose __P((dev_t, int, int, struct proc *));  int comclose __P((dev_t, int, int, struct proc *));
 void comdiag __P((void *));  void comdiag __P((void *));
Line 125  void comstart __P((struct tty *));
Line 125  void comstart __P((struct tty *));
  * XXX the following two cfattach structs should be different, and possibly   * XXX the following two cfattach structs should be different, and possibly
  * XXX elsewhere.   * XXX elsewhere.
  */   */
   int comprobe __P((struct device *, void *, void *));
   void comattach __P((struct device *, struct device *, void *));
   
   #if NCOM_ISA
 struct cfattach com_isa_ca = {  struct cfattach com_isa_ca = {
         sizeof(struct com_softc), comprobe, comattach          sizeof(struct com_softc), comprobe, comattach
 };  };
   #endif
   
 struct cfattach com_multi_ca = {  #if NCOM_COMMULTI
   struct cfattach com_commulti_ca = {
         sizeof(struct com_softc), comprobe, comattach          sizeof(struct com_softc), comprobe, comattach
 };  };
   #endif
   
 struct cfdriver com_cd = {  struct cfdriver com_cd = {
         NULL, "com", DV_TTY          NULL, "com", DV_TTY
Line 290  comprobe(parent, match, aux)
Line 297  comprobe(parent, match, aux)
          * XXX for commulti probe, with a helper function that contains           * XXX for commulti probe, with a helper function that contains
          * XXX most of the interesting stuff.           * XXX most of the interesting stuff.
          */           */
   #if NCOM_ISA
         if (!strcmp(parent->dv_cfdata->cf_driver->cd_name, "isa")) {          if (!strcmp(parent->dv_cfdata->cf_driver->cd_name, "isa")) {
                 struct isa_attach_args *ia = aux;                  struct isa_attach_args *ia = aux;
   
                 bc = ia->ia_bc;                  bc = ia->ia_bc;
                 iobase = ia->ia_iobase;                  iobase = ia->ia_iobase;
                 needioh = 1;                  needioh = 1;
         } else {          } else
   #endif
   #if NCOM_COMMULTI
           if (1) {
                 struct commulti_attach_args *ca = aux;                  struct commulti_attach_args *ca = aux;
   
                 if (cf->cf_loc[0] != -1 && cf->cf_loc[0] != ca->ca_slave)                  if (cf->cf_loc[0] != -1 && cf->cf_loc[0] != ca->ca_slave)
Line 306  comprobe(parent, match, aux)
Line 317  comprobe(parent, match, aux)
                 iobase = ca->ca_iobase;                  iobase = ca->ca_iobase;
                 ioh = ca->ca_ioh;                  ioh = ca->ca_ioh;
                 needioh = 0;                  needioh = 0;
         }          } else
   #endif
                   return(0);                      /* This cannot happen */
   
         /* if it's in use as console, it's there. */          /* if it's in use as console, it's there. */
         if (iobase == comconsaddr && !comconsattached)          if (iobase == comconsaddr && !comconsattached)
Line 321  comprobe(parent, match, aux)
Line 334  comprobe(parent, match, aux)
                 bus_io_unmap(bc, ioh, COM_NPORTS);                  bus_io_unmap(bc, ioh, COM_NPORTS);
   
 out:  out:
   #if NCOM_ISA
         if (rv && !strcmp(parent->dv_cfdata->cf_driver->cd_name, "isa")) {          if (rv && !strcmp(parent->dv_cfdata->cf_driver->cd_name, "isa")) {
                 struct isa_attach_args *ia = aux;                  struct isa_attach_args *ia = aux;
   
                 ia->ia_iosize = COM_NPORTS;                  ia->ia_iosize = COM_NPORTS;
                 ia->ia_msize = 0;                  ia->ia_msize = 0;
         }          }
   #endif
         return (rv);          return (rv);
 }  }
   
Line 353  comattach(parent, self, aux)
Line 368  comattach(parent, self, aux)
          */           */
         sc->sc_hwflags = 0;          sc->sc_hwflags = 0;
         sc->sc_swflags = 0;          sc->sc_swflags = 0;
   #if NCOM_ISA
         if (!strcmp(parent->dv_cfdata->cf_driver->cd_name, "isa")) {          if (!strcmp(parent->dv_cfdata->cf_driver->cd_name, "isa")) {
                 struct isa_attach_args *ia = aux;                  struct isa_attach_args *ia = aux;
   
Line 367  comattach(parent, self, aux)
Line 383  comattach(parent, self, aux)
                 } else                  } else
                         ioh = comconsioh;                          ioh = comconsioh;
                 irq = ia->ia_irq;                  irq = ia->ia_irq;
         } else {          } else
   #endif
   #if NCOM_COMMULTI
           if (1) {
                 struct commulti_attach_args *ca = aux;                  struct commulti_attach_args *ca = aux;
   
                 /*                  /*
Line 380  comattach(parent, self, aux)
Line 399  comattach(parent, self, aux)
   
                 if (ca->ca_noien)                  if (ca->ca_noien)
                         sc->sc_hwflags |= COM_HW_NOIEN;                          sc->sc_hwflags |= COM_HW_NOIEN;
         }          } else
   #endif
                   panic("comattach: impossible");
   
         sc->sc_bc = bc;          sc->sc_bc = bc;
         sc->sc_ioh = ioh;          sc->sc_ioh = ioh;

Legend:
Removed from v.1.76  
changed lines
  Added in v.1.77

CVSweb <webmaster@jp.NetBSD.org>