handle broadcast packets
[unix-history] / usr / src / sys / vax / if / if_uba.c
index dcf6914..8b01de6 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_uba.c        4.5     81/12/09        */
+/*     if_uba.c        4.9     82/02/03        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -64,8 +64,8 @@ bad:
 
 /*
  * Setup either a ifrw structure by allocating UNIBUS map registers,
 
 /*
  * Setup either a ifrw structure by allocating UNIBUS map registers,
- * a buffered data path, and initializing the fields of the ifrw structure
- * to minimize run-time overhead.
+ * possibly a buffered data path, and initializing the fields of
+ * the ifrw structure to minimize run-time overhead.
  */
 static
 if_ubaalloc(ifu, ifrw, nmr)
  */
 static
 if_ubaalloc(ifu, ifrw, nmr)
@@ -78,7 +78,7 @@ if_ubaalloc(ifu, ifrw, nmr)
 COUNT(IF_UBAALLOC);
        info =
            uballoc(ifu->ifu_uban, ifrw->ifrw_addr, nmr*NBPG + ifu->ifu_hlen,
 COUNT(IF_UBAALLOC);
        info =
            uballoc(ifu->ifu_uban, ifrw->ifrw_addr, nmr*NBPG + ifu->ifu_hlen,
-               UBA_NEED16|UBA_NEEDBDP);
+               ifu->ifu_flags);
        if (info == 0)
                return (0);
        ifrw->ifrw_info = info;
        if (info == 0)
                return (0);
        ifrw->ifrw_info = info;
@@ -109,7 +109,6 @@ if_rubaget(ifu, totlen, off0)
 
 COUNT(IF_RUBAGET);
 
 
 COUNT(IF_RUBAGET);
 
-printf("if_rubaget totlen %d off0 %d cp %x\n", totlen, off0, cp);
        top = 0;
        mp = ⊤
        while (totlen > 0) {
        top = 0;
        mp = ⊤
        while (totlen > 0) {
@@ -121,7 +120,6 @@ printf("if_rubaget totlen %d off0 %d cp %x\n", totlen, off0, cp);
                        cp = ifu->ifu_r.ifrw_addr + ifu->ifu_hlen + off;
                } else
                        len = totlen;
                        cp = ifu->ifu_r.ifrw_addr + ifu->ifu_hlen + off;
                } else
                        len = totlen;
-printf("m %x len %d off %d cp %x\n", m, len, off, cp);
                if (len >= CLBYTES) {
                        struct mbuf *p;
                        struct pte *cpte, *ppte;
                if (len >= CLBYTES) {
                        struct mbuf *p;
                        struct pte *cpte, *ppte;
@@ -158,9 +156,7 @@ printf("m %x len %d off %d cp %x\n", m, len, off, cp);
 nopage:
                m->m_len = MIN(MLEN, len);
                m->m_off = MMINOFF;
 nopage:
                m->m_len = MIN(MLEN, len);
                m->m_off = MMINOFF;
-printf("nopage m->m_len %d, m %x\n", m->m_len, len);
 copy:
 copy:
-printf("copy %d from %x to %x", m->m_len, cp, mtod(m, caddr_t));
                bcopy(cp, mtod(m, caddr_t), (unsigned)m->m_len);
                cp += m->m_len;
 nocopy:
                bcopy(cp, mtod(m, caddr_t), (unsigned)m->m_len);
                cp += m->m_len;
 nocopy:
@@ -175,7 +171,7 @@ nocopy:
                                totlen = off0;
                        }
                } else
                                totlen = off0;
                        }
                } else
-                       totlen -= len;
+                       totlen -= m->m_len;
        }
        return (top);
 bad:
        }
        return (top);
 bad:
@@ -201,7 +197,6 @@ if_wubaput(ifu, m)
        int x, cc;
 
 COUNT(IF_WUBAPUT);
        int x, cc;
 
 COUNT(IF_WUBAPUT);
-       ifu->ifu_xswapd = 0;
        cp = ifu->ifu_w.ifrw_addr;
        while (m) {
                dp = mtod(m, char *);
        cp = ifu->ifu_w.ifrw_addr;
        while (m) {
                dp = mtod(m, char *);