More pre-lite2 support zapped and some more tidy-up.

This commit is contained in:
Peter Wemm 1999-08-09 13:24:55 +00:00
parent 48cadfb15e
commit ac6b4b7c14
4 changed files with 2 additions and 148 deletions

View File

@ -141,10 +141,8 @@ static void tulip_mii_writereg(tulip_softc_t * const sc, unsigned devaddr, unsig
static int tulip_mii_map_abilities(tulip_softc_t * const sc, unsigned abilities);
static tulip_media_t tulip_mii_phy_readspecific(tulip_softc_t * const sc);
static int tulip_srom_decode(tulip_softc_t * const sc);
#if defined(IFM_ETHER)
static int tulip_ifmedia_change(struct ifnet * const ifp);
static void tulip_ifmedia_status(struct ifnet * const ifp, struct ifmediareq *req);
#endif
/* static void tulip_21140_map_media(tulip_softc_t *sc); */
static void
@ -2957,7 +2955,6 @@ tulip_read_macaddr(
return 0;
}
#if defined(IFM_ETHER)
static void
tulip_ifmedia_add(
tulip_softc_t * const sc)
@ -3032,7 +3029,6 @@ tulip_ifmedia_status(
req->ifm_active = tulip_media_to_ifmedia[sc->tulip_media];
}
#endif
static void
tulip_addr_filter(
@ -4681,33 +4677,6 @@ tulip_ifioctl(
}
case SIOCSIFFLAGS: {
#if !defined(IFM_ETHER)
int flags = 0;
if (ifp->if_flags & IFF_LINK0) flags |= 1;
if (ifp->if_flags & IFF_LINK1) flags |= 2;
if (ifp->if_flags & IFF_LINK2) flags |= 4;
if (flags == 7) {
ifp->if_flags &= ~(IFF_LINK0|IFF_LINK1|IFF_LINK2);
sc->tulip_media = TULIP_MEDIA_UNKNOWN;
sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
sc->tulip_flags &= ~(TULIP_WANTRXACT|TULIP_LINKUP|TULIP_NOAUTOSENSE);
tulip_reset(sc);
} else if (flags) {
tulip_media_t media;
for (media = TULIP_MEDIA_UNKNOWN; media < TULIP_MEDIA_MAX; media++) {
if (sc->tulip_mediums[media] != NULL && --flags == 0) {
sc->tulip_flags |= TULIP_NOAUTOSENSE;
if (sc->tulip_media != media || (sc->tulip_flags & TULIP_DIDNWAY)) {
sc->tulip_flags &= ~TULIP_DIDNWAY;
tulip_linkup(sc, media);
}
break;
}
}
if (flags)
printf(TULIP_PRINTF_FMT ": ignored invalid media request\n", TULIP_PRINTF_ARGS);
}
#endif
tulip_addr_filter(sc); /* reinit multicast filter */
tulip_init(sc);
break;
@ -4958,33 +4927,11 @@ tulip_attach(
#endif
(*sc->tulip_boardsw->bd_media_probe)(sc);
#if defined(IFM_ETHER)
ifmedia_init(&sc->tulip_ifmedia, 0,
tulip_ifmedia_change,
tulip_ifmedia_status);
#else
{
tulip_media_t media;
int cnt;
printf(TULIP_PRINTF_FMT ": media:", TULIP_PRINTF_ARGS);
for (media = TULIP_MEDIA_UNKNOWN, cnt = 1; cnt < 7 && media < TULIP_MEDIA_MAX; media++) {
if (sc->tulip_mediums[media] != NULL) {
printf(" %d=\"%s\"", cnt, tulip_mediums[media]);
cnt++;
}
}
if (cnt == 1) {
sc->tulip_features |= TULIP_HAVE_NOMEDIA;
printf(" none\n");
} else {
printf("\n");
}
}
#endif
sc->tulip_flags &= ~TULIP_DEVICEPROBE;
#if defined(IFM_ETHER)
tulip_ifmedia_add(sc);
#endif
tulip_reset(sc);

View File

@ -455,7 +455,7 @@ typedef struct {
*
*/
struct _tulip_softc_t {
#if !defined(tulip_ifmedia) && defined(IFM_ETHER)
#if !defined(tulip_ifmedia)
struct ifmedia tulip_ifmedia;
#endif
#if defined(TULIP_BUS_DMA)
@ -644,11 +644,7 @@ struct _tulip_softc_t {
tulip_desc_t *tulip_txdescs;
};
#if defined(IFM_ETHER)
#define TULIP_DO_AUTOSENSE(sc) (IFM_SUBTYPE((sc)->tulip_ifmedia.ifm_media) == IFM_AUTO)
#else
#define TULIP_DO_AUTOSENSE(sc) (((sc)->tulip_flags & TULIP_NOAUTOSENSE) == 0)
#endif
#if defined(TULIP_HDR_DATA)
@ -681,7 +677,6 @@ static const char * const tulip_mediums[] = {
"Full Duplex 100baseFX", /* TULIP_MEDIA_100BASEFX_FD */
};
#if defined(IFM_ETHER)
static const int tulip_media_to_ifmedia[] = {
IFM_ETHER | IFM_NONE, /* TULIP_MEDIA_UNKNOWN */
IFM_ETHER | IFM_10_T, /* TULIP_MEDIA_10BASET */
@ -696,7 +691,6 @@ static const int tulip_media_to_ifmedia[] = {
IFM_ETHER | IFM_100_FX, /* TULIP_MEDIA_100BASEFX */
IFM_ETHER | IFM_100_FX | IFM_FDX, /* TULIP_MEDIA_100BASEFX_FD */
};
#endif /* defined(IFM_ETHER) */
static const char * const tulip_system_errors[] = {
"parity error",
@ -878,7 +872,6 @@ typedef u_long ioctl_cmd_t;
#if defined(TULIP_HDR_DATA)
static tulip_softc_t *tulips[TULIP_MAX_DEVICES];
#endif
#if BSD >= 199506
#define TULIP_IFP_TO_SOFTC(ifp) ((tulip_softc_t *)((ifp)->if_softc))
#if NBPF > 0
#define TULIP_BPF_MTAP(sc, m) bpf_mtap(&(sc)->tulip_if, m)
@ -894,12 +887,6 @@ static tulip_softc_t *tulips[TULIP_MAX_DEVICES];
#endif
#define TULIP_EADDR_FMT "%6D"
#define TULIP_EADDR_ARGS(addr) addr, ":"
#else
extern int bootverbose;
#define TULIP_IFP_TO_SOFTC(ifp) (TULIP_UNIT_TO_SOFTC((ifp)->if_unit))
#include <sys/devconf.h>
#define TULIP_DEVCONF
#endif
#if defined(TULIP_USE_SOFTINTR)
NETISR_SET(NETISR_DE, tulip_softintr);
#endif
@ -972,10 +959,6 @@ NETISR_SET(NETISR_DE, tulip_softintr);
#define TULIP_RESTORESPL(s) splx(s)
#endif
/*
* While I think FreeBSD's 2.2 change to the bpf is a nice simplification,
* it does add yet more conditional code to this driver. Sigh.
*/
#if !defined(TULIP_BPF_MTAP) && NBPF > 0
#define TULIP_BPF_MTAP(sc, m) bpf_mtap((sc)->tulip_bpf, m)
#define TULIP_BPF_TAP(sc, p, l) bpf_tap((sc)->tulip_bpf, p, l)
@ -1023,9 +1006,6 @@ TULIP_PERFREAD(
#define TULIP_PERFMERGE(s,n) do { } while (0)
#endif /* TULIP_PERFSTATS */
/*
* However, this change to FreeBSD I am much less enamored with.
*/
#if !defined(TULIP_EADDR_FMT)
#define TULIP_EADDR_FMT "%s"
#define TULIP_EADDR_ARGS(addr) ether_sprintf(addr)

View File

@ -141,10 +141,8 @@ static void tulip_mii_writereg(tulip_softc_t * const sc, unsigned devaddr, unsig
static int tulip_mii_map_abilities(tulip_softc_t * const sc, unsigned abilities);
static tulip_media_t tulip_mii_phy_readspecific(tulip_softc_t * const sc);
static int tulip_srom_decode(tulip_softc_t * const sc);
#if defined(IFM_ETHER)
static int tulip_ifmedia_change(struct ifnet * const ifp);
static void tulip_ifmedia_status(struct ifnet * const ifp, struct ifmediareq *req);
#endif
/* static void tulip_21140_map_media(tulip_softc_t *sc); */
static void
@ -2957,7 +2955,6 @@ tulip_read_macaddr(
return 0;
}
#if defined(IFM_ETHER)
static void
tulip_ifmedia_add(
tulip_softc_t * const sc)
@ -3032,7 +3029,6 @@ tulip_ifmedia_status(
req->ifm_active = tulip_media_to_ifmedia[sc->tulip_media];
}
#endif
static void
tulip_addr_filter(
@ -4681,33 +4677,6 @@ tulip_ifioctl(
}
case SIOCSIFFLAGS: {
#if !defined(IFM_ETHER)
int flags = 0;
if (ifp->if_flags & IFF_LINK0) flags |= 1;
if (ifp->if_flags & IFF_LINK1) flags |= 2;
if (ifp->if_flags & IFF_LINK2) flags |= 4;
if (flags == 7) {
ifp->if_flags &= ~(IFF_LINK0|IFF_LINK1|IFF_LINK2);
sc->tulip_media = TULIP_MEDIA_UNKNOWN;
sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
sc->tulip_flags &= ~(TULIP_WANTRXACT|TULIP_LINKUP|TULIP_NOAUTOSENSE);
tulip_reset(sc);
} else if (flags) {
tulip_media_t media;
for (media = TULIP_MEDIA_UNKNOWN; media < TULIP_MEDIA_MAX; media++) {
if (sc->tulip_mediums[media] != NULL && --flags == 0) {
sc->tulip_flags |= TULIP_NOAUTOSENSE;
if (sc->tulip_media != media || (sc->tulip_flags & TULIP_DIDNWAY)) {
sc->tulip_flags &= ~TULIP_DIDNWAY;
tulip_linkup(sc, media);
}
break;
}
}
if (flags)
printf(TULIP_PRINTF_FMT ": ignored invalid media request\n", TULIP_PRINTF_ARGS);
}
#endif
tulip_addr_filter(sc); /* reinit multicast filter */
tulip_init(sc);
break;
@ -4958,33 +4927,11 @@ tulip_attach(
#endif
(*sc->tulip_boardsw->bd_media_probe)(sc);
#if defined(IFM_ETHER)
ifmedia_init(&sc->tulip_ifmedia, 0,
tulip_ifmedia_change,
tulip_ifmedia_status);
#else
{
tulip_media_t media;
int cnt;
printf(TULIP_PRINTF_FMT ": media:", TULIP_PRINTF_ARGS);
for (media = TULIP_MEDIA_UNKNOWN, cnt = 1; cnt < 7 && media < TULIP_MEDIA_MAX; media++) {
if (sc->tulip_mediums[media] != NULL) {
printf(" %d=\"%s\"", cnt, tulip_mediums[media]);
cnt++;
}
}
if (cnt == 1) {
sc->tulip_features |= TULIP_HAVE_NOMEDIA;
printf(" none\n");
} else {
printf("\n");
}
}
#endif
sc->tulip_flags &= ~TULIP_DEVICEPROBE;
#if defined(IFM_ETHER)
tulip_ifmedia_add(sc);
#endif
tulip_reset(sc);

View File

@ -455,7 +455,7 @@ typedef struct {
*
*/
struct _tulip_softc_t {
#if !defined(tulip_ifmedia) && defined(IFM_ETHER)
#if !defined(tulip_ifmedia)
struct ifmedia tulip_ifmedia;
#endif
#if defined(TULIP_BUS_DMA)
@ -644,11 +644,7 @@ struct _tulip_softc_t {
tulip_desc_t *tulip_txdescs;
};
#if defined(IFM_ETHER)
#define TULIP_DO_AUTOSENSE(sc) (IFM_SUBTYPE((sc)->tulip_ifmedia.ifm_media) == IFM_AUTO)
#else
#define TULIP_DO_AUTOSENSE(sc) (((sc)->tulip_flags & TULIP_NOAUTOSENSE) == 0)
#endif
#if defined(TULIP_HDR_DATA)
@ -681,7 +677,6 @@ static const char * const tulip_mediums[] = {
"Full Duplex 100baseFX", /* TULIP_MEDIA_100BASEFX_FD */
};
#if defined(IFM_ETHER)
static const int tulip_media_to_ifmedia[] = {
IFM_ETHER | IFM_NONE, /* TULIP_MEDIA_UNKNOWN */
IFM_ETHER | IFM_10_T, /* TULIP_MEDIA_10BASET */
@ -696,7 +691,6 @@ static const int tulip_media_to_ifmedia[] = {
IFM_ETHER | IFM_100_FX, /* TULIP_MEDIA_100BASEFX */
IFM_ETHER | IFM_100_FX | IFM_FDX, /* TULIP_MEDIA_100BASEFX_FD */
};
#endif /* defined(IFM_ETHER) */
static const char * const tulip_system_errors[] = {
"parity error",
@ -878,7 +872,6 @@ typedef u_long ioctl_cmd_t;
#if defined(TULIP_HDR_DATA)
static tulip_softc_t *tulips[TULIP_MAX_DEVICES];
#endif
#if BSD >= 199506
#define TULIP_IFP_TO_SOFTC(ifp) ((tulip_softc_t *)((ifp)->if_softc))
#if NBPF > 0
#define TULIP_BPF_MTAP(sc, m) bpf_mtap(&(sc)->tulip_if, m)
@ -894,12 +887,6 @@ static tulip_softc_t *tulips[TULIP_MAX_DEVICES];
#endif
#define TULIP_EADDR_FMT "%6D"
#define TULIP_EADDR_ARGS(addr) addr, ":"
#else
extern int bootverbose;
#define TULIP_IFP_TO_SOFTC(ifp) (TULIP_UNIT_TO_SOFTC((ifp)->if_unit))
#include <sys/devconf.h>
#define TULIP_DEVCONF
#endif
#if defined(TULIP_USE_SOFTINTR)
NETISR_SET(NETISR_DE, tulip_softintr);
#endif
@ -972,10 +959,6 @@ NETISR_SET(NETISR_DE, tulip_softintr);
#define TULIP_RESTORESPL(s) splx(s)
#endif
/*
* While I think FreeBSD's 2.2 change to the bpf is a nice simplification,
* it does add yet more conditional code to this driver. Sigh.
*/
#if !defined(TULIP_BPF_MTAP) && NBPF > 0
#define TULIP_BPF_MTAP(sc, m) bpf_mtap((sc)->tulip_bpf, m)
#define TULIP_BPF_TAP(sc, p, l) bpf_tap((sc)->tulip_bpf, p, l)
@ -1023,9 +1006,6 @@ TULIP_PERFREAD(
#define TULIP_PERFMERGE(s,n) do { } while (0)
#endif /* TULIP_PERFSTATS */
/*
* However, this change to FreeBSD I am much less enamored with.
*/
#if !defined(TULIP_EADDR_FMT)
#define TULIP_EADDR_FMT "%s"
#define TULIP_EADDR_ARGS(addr) ether_sprintf(addr)