diff options
author | imp <imp@FreeBSD.org> | 2005-09-07 03:34:24 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-09-07 03:34:24 +0000 |
commit | 07f3583b5aef67917ec3d47190b797f3298a09f6 (patch) | |
tree | d7364fd6705161c0cf91f07aecf3d948c09f475f /sys | |
parent | 1c4b0b9c5f599f3fe4e9d2ff620d41826faa8b67 (diff) | |
download | FreeBSD-src-07f3583b5aef67917ec3d47190b797f3298a09f6.zip FreeBSD-src-07f3583b5aef67917ec3d47190b797f3298a09f6.tar.gz |
Consistancy is the hobgoblin of small minds:
o DLINK -> DL100XX
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ed/if_ed_pccard.c | 62 | ||||
-rw-r--r-- | sys/dev/ed/if_edreg.h | 16 |
2 files changed, 39 insertions, 39 deletions
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c index 78275bc..0489cec 100644 --- a/sys/dev/ed/if_ed_pccard.c +++ b/sys/dev/ed/if_ed_pccard.c @@ -186,9 +186,9 @@ static int ed_pccard_memwrite(device_t dev, off_t offset, u_char byte); static int ed_pccard_dl100xx(device_t dev, const struct ed_product *); #ifndef ED_NO_MIIBUS -static void ed_pccard_dlink_mii_reset(struct ed_softc *sc); -static u_int ed_pccard_dlink_mii_readbits(struct ed_softc *sc, int nbits); -static void ed_pccard_dlink_mii_writebits(struct ed_softc *sc, u_int val, +static void ed_pccard_dl10xx_mii_reset(struct ed_softc *sc); +static u_int ed_pccard_dl10xx_mii_readbits(struct ed_softc *sc, int nbits); +static void ed_pccard_dl10xx_mii_writebits(struct ed_softc *sc, u_int val, int nbits); #endif @@ -377,9 +377,9 @@ ed_pccard_attach(device_t dev) if (sc->chip_type == ED_CHIP_TYPE_DL10019 || sc->chip_type == ED_CHIP_TYPE_DL10022) { /* Probe for an MII bus, but ignore errors. */ - ed_pccard_dlink_mii_reset(sc); - sc->mii_readbits = ed_pccard_dlink_mii_readbits; - sc->mii_writebits = ed_pccard_dlink_mii_writebits; + ed_pccard_dl10xx_mii_reset(sc); + sc->mii_readbits = ed_pccard_dl10xx_mii_readbits; + sc->mii_writebits = ed_pccard_dl10xx_mii_writebits; mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, ed_ifmedia_sts); } @@ -486,71 +486,71 @@ ed_pccard_dl100xx(device_t dev, const struct ed_product *pp) #ifndef ED_NO_MIIBUS /* MII bit-twiddling routines for cards using Dlink chipset */ -#define DLINK_MIISET(sc, x) ed_asic_outb(sc, ED_DLINK_MIIBUS, \ - ed_asic_inb(sc, ED_DLINK_MIIBUS) | (x)) -#define DLINK_MIICLR(sc, x) ed_asic_outb(sc, ED_DLINK_MIIBUS, \ - ed_asic_inb(sc, ED_DLINK_MIIBUS) & ~(x)) +#define DL10XX_MIISET(sc, x) ed_asic_outb(sc, ED_DL10XX_MIIBUS, \ + ed_asic_inb(sc, ED_DL10XX_MIIBUS) | (x)) +#define DL10XX_MIICLR(sc, x) ed_asic_outb(sc, ED_DL10XX_MIIBUS, \ + ed_asic_inb(sc, ED_DL10XX_MIIBUS) & ~(x)) static void -ed_pccard_dlink_mii_reset(struct ed_softc *sc) +ed_pccard_dl10xx_mii_reset(struct ed_softc *sc) { if (sc->chip_type != ED_CHIP_TYPE_DL10022) return; - ed_asic_outb(sc, ED_DLINK_MIIBUS, ED_DLINK_MII_RESET2); + ed_asic_outb(sc, ED_DL10XX_MIIBUS, ED_DL10XX_MII_RESET2); DELAY(10); - ed_asic_outb(sc, ED_DLINK_MIIBUS, - ED_DLINK_MII_RESET2 | ED_DLINK_MII_RESET1); + ed_asic_outb(sc, ED_DL10XX_MIIBUS, + ED_DL10XX_MII_RESET2 | ED_DL10XX_MII_RESET1); DELAY(10); - ed_asic_outb(sc, ED_DLINK_MIIBUS, ED_DLINK_MII_RESET2); + ed_asic_outb(sc, ED_DL10XX_MIIBUS, ED_DL10XX_MII_RESET2); DELAY(10); - ed_asic_outb(sc, ED_DLINK_MIIBUS, - ED_DLINK_MII_RESET2 | ED_DLINK_MII_RESET1); + ed_asic_outb(sc, ED_DL10XX_MIIBUS, + ED_DL10XX_MII_RESET2 | ED_DL10XX_MII_RESET1); DELAY(10); - ed_asic_outb(sc, ED_DLINK_MIIBUS, 0); + ed_asic_outb(sc, ED_DL10XX_MIIBUS, 0); } static void -ed_pccard_dlink_mii_writebits(struct ed_softc *sc, u_int val, int nbits) +ed_pccard_dl10xx_mii_writebits(struct ed_softc *sc, u_int val, int nbits) { int i; if (sc->chip_type == ED_CHIP_TYPE_DL10022) - DLINK_MIISET(sc, ED_DLINK_MII_DIROUT_22); + DL10XX_MIISET(sc, ED_DL10XX_MII_DIROUT_22); else - DLINK_MIISET(sc, ED_DLINK_MII_DIROUT_19); + DL10XX_MIISET(sc, ED_DL10XX_MII_DIROUT_19); for (i = nbits - 1; i >= 0; i--) { if ((val >> i) & 1) - DLINK_MIISET(sc, ED_DLINK_MII_DATAOUT); + DL10XX_MIISET(sc, ED_DL10XX_MII_DATAOUT); else - DLINK_MIICLR(sc, ED_DLINK_MII_DATAOUT); + DL10XX_MIICLR(sc, ED_DL10XX_MII_DATAOUT); DELAY(10); - DLINK_MIISET(sc, ED_DLINK_MII_CLK); + DL10XX_MIISET(sc, ED_DL10XX_MII_CLK); DELAY(10); - DLINK_MIICLR(sc, ED_DLINK_MII_CLK); + DL10XX_MIICLR(sc, ED_DL10XX_MII_CLK); DELAY(10); } } static u_int -ed_pccard_dlink_mii_readbits(struct ed_softc *sc, int nbits) +ed_pccard_dl10xx_mii_readbits(struct ed_softc *sc, int nbits) { int i; u_int val = 0; if (sc->chip_type == ED_CHIP_TYPE_DL10022) - DLINK_MIICLR(sc, ED_DLINK_MII_DIROUT_22); + DL10XX_MIICLR(sc, ED_DL10XX_MII_DIROUT_22); else - DLINK_MIICLR(sc, ED_DLINK_MII_DIROUT_19); + DL10XX_MIICLR(sc, ED_DL10XX_MII_DIROUT_19); for (i = nbits - 1; i >= 0; i--) { - DLINK_MIISET(sc, ED_DLINK_MII_CLK); + DL10XX_MIISET(sc, ED_DL10XX_MII_CLK); DELAY(10); val <<= 1; - if (ed_asic_inb(sc, ED_DLINK_MIIBUS) & ED_DLINK_MII_DATATIN) + if (ed_asic_inb(sc, ED_DL10XX_MIIBUS) & ED_DL10XX_MII_DATATIN) val++; - DLINK_MIICLR(sc, ED_DLINK_MII_CLK); + DL10XX_MIICLR(sc, ED_DL10XX_MII_CLK); DELAY(10); } return val; diff --git a/sys/dev/ed/if_edreg.h b/sys/dev/ed/if_edreg.h index 685cbd6..6ad86f8 100644 --- a/sys/dev/ed/if_edreg.h +++ b/sys/dev/ed/if_edreg.h @@ -1108,13 +1108,13 @@ struct ed_ring { #define ED_MII_IDLE_BITS 1 /* Dlink chipset used on some Netgear and Dlink PCMCIA cards */ -#define ED_DLINK_MIIBUS 0x0c /* MII bus register on ASIC */ +#define ED_DL10XX_MIIBUS 0x0c /* MII bus register on ASIC */ -#define ED_DLINK_MII_RESET1 0x04 -#define ED_DLINK_MII_RESET2 0x08 +#define ED_DL10XX_MII_RESET1 0x04 +#define ED_DL10XX_MII_RESET2 0x08 -#define ED_DLINK_MII_DATATIN 0x10 -#define ED_DLINK_MII_DIROUT_22 0x20 -#define ED_DLINK_MII_DIROUT_19 0x10 -#define ED_DLINK_MII_DATAOUT 0x40 -#define ED_DLINK_MII_CLK 0x80 +#define ED_DL10XX_MII_DATATIN 0x10 +#define ED_DL10XX_MII_DIROUT_22 0x20 +#define ED_DL10XX_MII_DIROUT_19 0x10 +#define ED_DL10XX_MII_DATAOUT 0x40 +#define ED_DL10XX_MII_CLK 0x80 |