SCCS-vsn: sys/vax/if/if_acc.c 4.30
SCCS-vsn: sys/vax/if/if_dmc.c 4.21
SCCS-vsn: sys/vax/if/if_ec.c 4.29
SCCS-vsn: sys/vax/if/if_en.c 4.72
SCCS-vsn: sys/vax/if/if_il.c 4.14
SCCS-vsn: sys/vax/if/if_il.h 4.3
SCCS-vsn: sys/vax/if/if_ilreg.h 4.3
-/* if_acc.c 4.29 82/10/24 */
+/* if_acc.c 4.30 82/11/13 */
#include "acc.h"
#ifdef NACC > 0
#include "acc.h"
#ifdef NACC > 0
struct impcb ifimp_impcb;
} *ifimp;
struct impcb ifimp_impcb;
} *ifimp;
- if ((ifimp = (struct ifimpcb *)impattacch(ui, acreset)) == 0)
+ if ((ifimp = (struct ifimpcb *)impattacch(ui, accreset)) == 0)
panic("accattach");
sc->acc_if = &ifimp->ifimp_if;
ip = &ifimp->ifimp_impcb;
panic("accattach");
sc->acc_if = &ifimp->ifimp_if;
ip = &ifimp->ifimp_impcb;
-/* if_dmc.c 4.20 82/10/31 */
+/* if_dmc.c 4.21 82/11/13 */
#include "dmc.h"
#if NDMC > 0
#include "dmc.h"
#if NDMC > 0
#include <errno.h>
#include "../net/if.h"
#include <errno.h>
#include "../net/if.h"
+#include "../net/netisr.h"
#include "../net/route.h"
#include "../netinet/in.h"
#include "../netinet/in_systm.h"
#include "../net/route.h"
#include "../netinet/in.h"
#include "../netinet/in_systm.h"
goto setup;
if (IF_QFULL(inq)) {
IF_DROP(inq);
goto setup;
if (IF_QFULL(inq)) {
IF_DROP(inq);
} else
IF_ENQUEUE(inq, m);
} else
IF_ENQUEUE(inq, m);
sc->sc_if.if_opackets++;
sc->sc_oactive = 0;
if (sc->sc_ifuba.ifu_xtofree) {
sc->sc_if.if_opackets++;
sc->sc_oactive = 0;
if (sc->sc_ifuba.ifu_xtofree) {
- (void) m_freem(sc->sc_ifuba.ifu_xtofree);
+ m_freem(sc->sc_ifuba.ifu_xtofree);
sc->sc_ifuba.ifu_xtofree = 0;
}
if (sc->sc_if.if_snd.ifq_head == 0)
sc->sc_ifuba.ifu_xtofree = 0;
}
if (sc->sc_if.if_snd.ifq_head == 0)
printd("dmcoutput\n");
if (dst->sa_family != (ui->ui_flags & DMC_AF)) {
printd("dmcoutput\n");
if (dst->sa_family != (ui->ui_flags & DMC_AF)) {
- printf("dmc%d: af%d not supported\n", ifp->if_unit, pf);
+ printf("dmc%d: af%d not supported\n", ifp->if_unit,
+ dst->sa_family);
m_freem(m);
return (EAFNOSUPPORT);
}
m_freem(m);
return (EAFNOSUPPORT);
}
-/* if_ec.c 4.28 82/10/31 */
+/* if_ec.c 4.29 82/11/13 */
#include "../vaxuba/ubavar.h"
#define ECMTU 1500
#include "../vaxuba/ubavar.h"
#define ECMTU 1500
#define ECMEM 0000000
int ecprobe(), ecattach(), ecrint(), ecxint(), eccollide();
#define ECMEM 0000000
int ecprobe(), ecattach(), ecrint(), ecxint(), eccollide();
- * Routine to copy from mbuf chain to transmitter
+ * Routine to copy from mbuf chain to transmit
* buffer in UNIBUS memory.
* buffer in UNIBUS memory.
+ * If packet size is less than the minimum legal size,
+ * the buffer is expanded. We probably should zero out the extra
+ * bytes for security, but that would slow things down.
*/
ecput(ecbuf, m)
u_char *ecbuf;
*/
ecput(ecbuf, m)
u_char *ecbuf;
for (off = 2048, mp = m; mp; mp = mp->m_next)
off -= mp->m_len;
for (off = 2048, mp = m; mp; mp = mp->m_next)
off -= mp->m_len;
+ if (2048 - off < ECMIN + sizeof (struct ec_header))
+ off = 2048 - ECMIN - sizeof (struct ec_header);
*(u_short *)ecbuf = off;
bp = (u_char *)(ecbuf + off);
for (mp = m; mp; mp = mp->m_next) {
*(u_short *)ecbuf = off;
bp = (u_char *)(ecbuf + off);
for (mp = m; mp; mp = mp->m_next) {
-/* if_en.c 4.71 82/10/31 */
+/* if_en.c 4.72 82/11/13 */
#ifdef INET
case AF_INET:
dest = ((struct sockaddr_in *)dst)->sin_addr.s_addr;
#ifdef INET
case AF_INET:
dest = ((struct sockaddr_in *)dst)->sin_addr.s_addr;
- if (dest & 0x00ffff00) {
+ if (in_lnaof(*((struct in_addr *)&dest)) >= 0x100) {
error = EPERM; /* ??? */
goto bad;
}
error = EPERM; /* ??? */
goto bad;
}
-/* if_il.c 4.13 82/10/31 */
+/* if_il.c 4.14 82/11/13 */
#include "../vaxuba/ubavar.h"
#define ILMTU 1500
#include "../vaxuba/ubavar.h"
#define ILMTU 1500
int ilprobe(), ilattach(), ilrint(), ilcint();
struct uba_device *ilinfo[NIL];
int ilprobe(), ilattach(), ilrint(), ilcint();
struct uba_device *ilinfo[NIL];
#ifdef lint
br = 0; cvec = br; br = cvec;
#ifdef lint
br = 0; cvec = br; br = cvec;
- ilrint(0); ilcint(0); ilwatch(0);
+ i = 0; ilrint(i); ilcint(i); ilwatch(i);
#endif
addr->il_csr = ILC_OFFLINE|IL_CIE;
#endif
addr->il_csr = ILC_OFFLINE|IL_CIE;
printf("il%d: reset failed, csr=%b\n", ui->ui_unit,
addr->il_csr, IL_BITS);
printf("il%d: reset failed, csr=%b\n", ui->ui_unit,
addr->il_csr, IL_BITS);
- is->is_ubaddr = uballoc(ui->ui_ubanum, &is->is_stats,
+ is->is_ubaddr = uballoc(ui->ui_ubanum, (caddr_t)&is->is_stats,
sizeof (struct il_stats), 0);
addr->il_bar = is->is_ubaddr & 0xffff;
addr->il_bcr = sizeof (struct il_stats);
sizeof (struct il_stats), 0);
addr->il_bar = is->is_ubaddr & 0xffff;
addr->il_bcr = sizeof (struct il_stats);
is->is_if.if_flags &= ~IFF_UP;
return;
}
is->is_if.if_flags &= ~IFF_UP;
return;
}
- is->is_ubaddr = uballoc(ui->ui_ubanum, &is->is_stats,
+ is->is_ubaddr = uballoc(ui->ui_ubanum, (caddr_t)&is->is_stats,
sizeof (struct il_stats), 0);
addr = (struct ildevice *)ui->ui_addr;
sizeof (struct il_stats), 0);
addr = (struct ildevice *)ui->ui_addr;
+ /*
+ * Turn off source address insertion (it's faster this way),
+ * and set board online.
+ */
+ s = splimp();
+ addr->il_csr = ILC_CISA;
+ while ((addr->il_csr & IL_CDONE) == 0)
+ ;
+ addr->il_csr = ILC_ONLINE;
+ while ((addr->il_csr & IL_CDONE) == 0)
+ ;
/*
* Set board online.
* Hang receive buffer and start any pending
/*
* Set board online.
* Hang receive buffer and start any pending
ilstart(dev)
dev_t dev;
{
ilstart(dev)
dev_t dev;
{
- int unit = ILUNIT(dev), dest, len;
+ int unit = ILUNIT(dev), len;
struct uba_device *ui = ilinfo[unit];
register struct il_softc *is = &il_softc[unit];
register struct ildevice *addr;
struct uba_device *ui = ilinfo[unit];
register struct il_softc *is = &il_softc[unit];
register struct ildevice *addr;
if (m == 0) {
if ((is->is_flags & ILF_STATPENDING) == 0)
return;
if (m == 0) {
if ((is->is_flags & ILF_STATPENDING) == 0)
return;
- addr->il_bar = is->is_ubaddr & 0xfff;
+ addr->il_bar = is->is_ubaddr & 0xffff;
addr->il_bcr = sizeof (struct il_stats);
csr = ((is->is_ubaddr >> 2) & IL_EUA)|ILC_STAT|IL_RIE|IL_CIE;
is->is_flags &= ~ILF_STATPENDING;
goto startcmd;
}
len = if_wubaput(&is->is_ifuba, m);
addr->il_bcr = sizeof (struct il_stats);
csr = ((is->is_ubaddr >> 2) & IL_EUA)|ILC_STAT|IL_RIE|IL_CIE;
is->is_flags &= ~ILF_STATPENDING;
goto startcmd;
}
len = if_wubaput(&is->is_ifuba, m);
+ /*
+ * Ensure minimum packet length.
+ * This makes the safe assumtion that there are no virtual holes
+ * after the data.
+ * For security, it might be wise to zero out the added bytes,
+ * but we're mainly interested in speed at the moment.
+ */
+ if (len - sizeof(struct il_xheader) < ILMIN)
+ len = ILMIN + sizeof(struct il_xheader);
if (is->is_ifuba.ifu_flags & UBA_NEEDBDP)
UBAPURGE(is->is_ifuba.ifu_uba, is->is_ifuba.ifu_w.ifrw_bdp);
addr->il_bar = is->is_ifuba.ifu_w.ifrw_info & 0xffff;
if (is->is_ifuba.ifu_flags & UBA_NEEDBDP)
UBAPURGE(is->is_ifuba.ifu_uba, is->is_ifuba.ifu_w.ifrw_bdp);
addr->il_bar = is->is_ifuba.ifu_w.ifrw_info & 0xffff;
register struct il_softc *is = &il_softc[ifp->if_unit];
register struct mbuf *m = m0;
register struct il_xheader *il;
register struct il_softc *is = &il_softc[ifp->if_unit];
register struct mbuf *m = m0;
register struct il_xheader *il;
switch (dst->sa_family) {
switch (dst->sa_family) {
}
il = mtod(m, struct il_xheader *);
if ((dest &~ 0xff) == 0)
}
il = mtod(m, struct il_xheader *);
if ((dest &~ 0xff) == 0)
- bcopy(ilbroadcastaddr, il->ilx_dhost, 6);
+ bcopy((caddr_t)ilbroadcastaddr, (caddr_t)il->ilx_dhost, 6);
else {
u_char *to = dest & 0x8000 ? is->is_stats.ils_addr : il_ectop;
else {
u_char *to = dest & 0x8000 ? is->is_stats.ils_addr : il_ectop;
- bcopy(to, il->ilx_dhost, 3);
+ bcopy((caddr_t)to, (caddr_t)il->ilx_dhost, 3);
il->ilx_dhost[3] = (dest>>8) & 0x7f;
il->ilx_dhost[4] = (dest>>16) & 0xff;
il->ilx_dhost[5] = (dest>>24) & 0xff;
}
il->ilx_dhost[3] = (dest>>8) & 0x7f;
il->ilx_dhost[4] = (dest>>16) & 0xff;
il->ilx_dhost[5] = (dest>>24) & 0xff;
}
+ bcopy((caddr_t)is->is_stats.ils_addr, (caddr_t)il->ilx_shost, 6);
-/* if_il.h 4.2 82/06/23 */
+/* if_il.h 4.3 82/11/13 */
/*
* Structure of an Ethernet header -- transmit format
/*
* Structure of an Ethernet header -- transmit format
+ * (source address insertion disabled)
*/
struct il_xheader {
u_char ilx_dhost[6]; /* Destination Host */
*/
struct il_xheader {
u_char ilx_dhost[6]; /* Destination Host */
+ u_char ilx_shost[6]; /* Source Host */
u_short ilx_type; /* Type of packet */
};
u_short ilx_type; /* Type of packet */
};
-/* if_ilreg.h 4.2 82/06/23 */
+/* if_ilreg.h 4.3 82/11/13 */
/*
* Interlan Ethernet Communications Controller interface
/*
* Interlan Ethernet Communications Controller interface
#define ILC_OFFLINE 0x0800 /* Go Offline */
#define ILC_ONLINE 0x0900 /* Go Online */
#define ILC_DIAG 0x0a00 /* Run On-board Diagnostics */
#define ILC_OFFLINE 0x0800 /* Go Offline */
#define ILC_ONLINE 0x0900 /* Go Online */
#define ILC_DIAG 0x0a00 /* Run On-board Diagnostics */
+#define ILC_ISA 0x0d00 /* Set Insert Source Address Mode */
+#define ILC_CISA 0x0e00 /* Clear Insert Source Address Mode */
+#define ILC_DEFPA 0x0f00 /* Set Physical Address to Default */
+#define ILC_ALLMC 0x1000 /* Set Receive All Multicast Packets */
+#define ILC_CALLMC 0x1100 /* Clear Receive All Multicast */
#define ILC_STAT 0x1800 /* Report and Reset Statistics */
#define ILC_DELAYS 0x1900 /* Report Collision Delay Times */
#define ILC_RCV 0x2000 /* Supply Receive Buffer */
#define ILC_STAT 0x1800 /* Report and Reset Statistics */
#define ILC_DELAYS 0x1900 /* Report Collision Delay Times */
#define ILC_RCV 0x2000 /* Supply Receive Buffer */
#define ILC_XMIT 0x2900 /* Load Transmit Data and Send */
#define ILC_LDGRPS 0x2a00 /* Load Group Addresses */
#define ILC_RMGRPS 0x2b00 /* Delete Group Addresses */
#define ILC_XMIT 0x2900 /* Load Transmit Data and Send */
#define ILC_LDGRPS 0x2a00 /* Load Group Addresses */
#define ILC_RMGRPS 0x2b00 /* Delete Group Addresses */
+#define ILC_LDPA 0x2c00 /* Load Physical Address */
#define ILC_FLUSH 0x3000 /* Flush Receive BAR/BCR Queue */
#define ILC_RESET 0x3f00 /* Reset */
#define ILC_FLUSH 0x3000 /* Flush Receive BAR/BCR Queue */
#define ILC_RESET 0x3f00 /* Reset */