From 5203dcae225c10f69afcacaa218ace8d94e28363 Mon Sep 17 00:00:00 2001 From: niklas Date: Mon, 24 Apr 2000 21:10:09 +0000 Subject: [PATCH] Fix promiscuous mode (from martin@crt.se). Style nits. Do not look at instance numbers in mii matching --- sys/dev/pcmcia/if_xe.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/dev/pcmcia/if_xe.c b/sys/dev/pcmcia/if_xe.c index 899472d030e..8fb195cb8e7 100644 --- a/sys/dev/pcmcia/if_xe.c +++ b/sys/dev/pcmcia/if_xe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xe.c,v 1.12 2000/04/24 19:43:36 niklas Exp $ */ +/* $OpenBSD: if_xe.c,v 1.13 2000/04/24 21:10:09 niklas Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist, C Stone, Job de Haas @@ -404,7 +404,7 @@ xe_pcmcia_attach(parent, self, aux) sc->sc_mii.mii_readreg = xe_mdi_read; sc->sc_mii.mii_writereg = xe_mdi_write; sc->sc_mii.mii_statchg = xe_statchg; - ifmedia_init(&sc->sc_mii.mii_media, 0, xe_mediachange, + ifmedia_init(&sc->sc_mii.mii_media, IFM_IMASK, xe_mediachange, xe_mediastatus); DPRINTF(XED_MII | XED_CONFIG, ("bmsr %x\n", xe_mdi_read(&sc->sc_dev, 0, 1))); @@ -946,7 +946,7 @@ xe_mdi_pulse_bits(sc, data, len) u_int32_t mask; for (mask = 1 << (len - 1); mask; mask >>= 1) - xe_mdi_pulse (sc, data & mask); + xe_mdi_pulse(sc, data & mask); } /* Read a PHY register. */ @@ -1278,7 +1278,6 @@ xe_ioctl(ifp, command, data) * such as IFF_PROMISC are handled. */ if (ifp->if_flags & IFF_UP) { - xe_full_reset(sc); xe_init(sc); } else { if (ifp->if_flags & IFF_RUNNING) @@ -1360,7 +1359,7 @@ xe_set_address(sc) for (page = 0x50, num = arp->ac_multicnt; num > 0 && enm; num--) { if (bcmp(enm->enm_addrlo, enm->enm_addrhi, - sizeof (enm->enm_addrlo)) != 0) { + sizeof(enm->enm_addrlo)) != 0) { /* * The multicast address is really a range; * it's easier just to accept all multicasts. @@ -1387,7 +1386,7 @@ xe_set_address(sc) } void -xe_cycle_power (sc) +xe_cycle_power(sc) struct xe_softc *sc; { bus_space_tag_t bst = sc->sc_bst; @@ -1407,7 +1406,7 @@ xe_cycle_power (sc) } void -xe_full_reset (sc) +xe_full_reset(sc) struct xe_softc *sc; { bus_space_tag_t bst = sc->sc_bst; @@ -1415,7 +1414,7 @@ xe_full_reset (sc) bus_addr_t offset = sc->sc_offset; /* Do an as extensive reset as possible on all functions. */ - xe_cycle_power (sc); + xe_cycle_power(sc); bus_space_write_1(bst, bsh, offset + CR, SOFT_RESET); DELAY(20000); bus_space_write_1(bst, bsh, offset + CR, 0); @@ -1559,7 +1558,7 @@ xe_full_reset (sc) #ifdef XEDEBUG void -xe_reg_dump (sc) +xe_reg_dump(sc) struct xe_softc *sc; { int page, i; -- 2.20.1