-/* $OpenBSD: dma.c,v 1.29 2014/05/09 20:15:06 miod Exp $ */
+/* $OpenBSD: dma.c,v 1.30 2014/07/28 18:31:39 miod Exp $ */
/* $NetBSD: dma.c,v 1.46 1997/08/27 11:24:16 bouyer Exp $ */
/*
#include <sys/kernel.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
+#include <sys/socket.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sparc/sparc/cpuvar.h>
+#include <net/if.h>
+#include <net/if_media.h>
+
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
char *cabletype = getpropstring(devnode, "cable-selection");
if (strcmp(cabletype, "tpe") == 0) {
sc->sc_regs->csr |= E_TP_AUI;
+ sc->sc_defaultmedia = IFM_ETHER | IFM_10_T;
} else if (strcmp(cabletype, "aui") == 0) {
sc->sc_regs->csr &= ~E_TP_AUI;
+ sc->sc_defaultmedia = IFM_ETHER | IFM_10_5;
} else {
/* assume TP if nothing there */
sc->sc_regs->csr |= E_TP_AUI;
+ sc->sc_defaultmedia = IFM_ETHER | IFM_AUTO;
}
delay(20000); /* manual says we need 20ms delay */
}
-/* $OpenBSD: dmavar.h,v 1.7 2006/06/02 20:00:54 miod Exp $ */
+/* $OpenBSD: dmavar.h,v 1.8 2014/07/28 18:31:39 miod Exp $ */
/* $NetBSD: dmavar.h,v 1.11 1996/11/27 21:49:53 pk Exp $ */
/*
struct dma_softc {
struct device sc_dev; /* us as a device */
struct esp_softc *sc_esp; /* my scsi */
- struct le_softc *sc_le; /* my ethernet */
+ struct le_softc *sc_le; /* my Ethernet */
struct dma_regs *sc_regs; /* the registers */
int sc_active; /* DMA active ? */
u_int sc_rev; /* revision */
int (*setup)(struct dma_softc *, caddr_t *, size_t *, int, size_t *);
void (*go)(struct dma_softc *);
u_int sc_dmactl;
+ int sc_defaultmedia; /* default Ethernet media */
};
#define DMACSR(sc) (sc->sc_regs->csr)
-/* $OpenBSD: if_le.c,v 1.34 2013/09/24 20:10:49 miod Exp $ */
+/* $OpenBSD: if_le.c,v 1.35 2014/07/28 18:31:39 miod Exp $ */
/* $NetBSD: if_le.c,v 1.50 1997/09/09 20:54:48 pk Exp $ */
/*-
if (lebufchild) {
sc->sc_supmedia = lebufmedia;
sc->sc_nsupmedia = nitems(lebufmedia);
+ sc->sc_defaultmedia = sc->sc_supmedia[sc->sc_nsupmedia - 1];
} else
#endif
#if defined(SUN4M)
if (CPU_ISSUN4M && lesc->sc_dma) {
sc->sc_supmedia = ledmamedia;
sc->sc_nsupmedia = nitems(ledmamedia);
+ sc->sc_defaultmedia = lesc->sc_dma->sc_defaultmedia;
} else
#endif
{
sc->sc_supmedia = lebaremedia;
sc->sc_nsupmedia = nitems(lebaremedia);
+ sc->sc_defaultmedia = sc->sc_supmedia[sc->sc_nsupmedia - 1];
}
- sc->sc_defaultmedia = sc->sc_supmedia[sc->sc_nsupmedia - 1];
am7990_config(&lesc->sc_am7990);