A little slight cleanup.

This commit is contained in:
thorpej 2001-05-22 00:27:01 +00:00
parent 6a9d72f10a
commit 611e112566
3 changed files with 16 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82557.c,v 1.50 2001/05/21 23:58:44 thorpej Exp $ */
/* $NetBSD: i82557.c,v 1.51 2001/05/22 00:27:01 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@ -322,8 +322,8 @@ fxp_attach(struct fxp_softc *sc)
/* Initialize MAC address and media structures. */
fxp_get_info(sc, enaddr);
printf("%s: Ethernet address %s, %s Mb/s\n", sc->sc_dev.dv_xname,
ether_sprintf(enaddr), sc->phy_10Mbps_only ? "10" : "10/100");
printf("%s: Ethernet address %s\n", sc->sc_dev.dv_xname,
ether_sprintf(enaddr));
ifp = &sc->sc_ethercom.ec_if;
@ -530,9 +530,8 @@ fxp_get_info(struct fxp_softc *sc, u_int8_t *enaddr)
* Get info about the primary PHY
*/
fxp_read_eeprom(sc, &data, 6, 1);
sc->phy_primary_addr = data & 0xff;
sc->phy_primary_device = (data >> 8) & 0x3f;
sc->phy_10Mbps_only = data >> 15;
sc->phy_primary_device =
(data & FXP_PHY_DEVICE_MASK) >> FXP_PHY_DEVICE_SHIFT;
/*
* Read MAC address.
@ -1369,7 +1368,8 @@ fxp_init(struct ifnet *ifp)
cbp->save_bf = save_bf;/* save bad frames */
cbp->disc_short_rx = !prm; /* discard short packets */
cbp->underrun_retry = 1; /* retry mode (1) on DMA underrun */
cbp->mediatype = !sc->phy_10Mbps_only; /* interface mode */
/* interface mode */
cbp->mediatype = (sc->sc_flags & FXPF_MII) ? 1 : 0;
cbp->nsai = 1; /* (don't) disable source addr insert */
cbp->preamble_length = 2; /* (7 byte) preamble */
cbp->loopback = 0; /* (don't) loopback */

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82557reg.h,v 1.5 2001/05/22 00:07:32 thorpej Exp $ */
/* $NetBSD: i82557reg.h,v 1.6 2001/05/22 00:27:01 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -120,6 +120,8 @@
#define FXP_SCB_INTMASK_FR 0x40
#define FXP_SCB_INTMASK_CXTNO 0x80
#define FXP_SCB_STATACK_FCP 0x01 /* flow control pause */
#define FXP_SCB_STATACK_ER 0x02 /* early receive */
#define FXP_SCB_STATACK_SWI 0x04
#define FXP_SCB_STATACK_MDI 0x08
#define FXP_SCB_STATACK_RNR 0x10
@ -370,6 +372,10 @@ struct fxp_stats {
/*
* PHY device types (from EEPROM)
*/
#define FXP_PHY_DEVICE_MASK 0x3f00
#define FXP_PHY_DEVICE_SHIFT 8
#define FXP_PHY_DEVADDR_MASK 0x00ff
#define FXP_PHY_SERIAL_ONLY 0x8000
#define FXP_PHY_NONE 0
#define FXP_PHY_82553A 1
#define FXP_PHY_82553C 2
@ -379,3 +385,4 @@ struct fxp_stats {
#define FXP_PHY_80C24 6
#define FXP_PHY_82555 7
#define FXP_PHY_DP83840A 10
#define FXP_PHY_DP82555B 11

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82557var.h,v 1.20 2001/05/21 23:58:44 thorpej Exp $ */
/* $NetBSD: i82557var.h,v 1.21 2001/05/22 00:27:01 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@ -203,9 +203,7 @@ struct fxp_softc {
int sc_txdirty; /* first dirty TX descriptor */
int sc_txlast; /* last used TX descriptor */
int phy_primary_addr; /* address of primary PHY */
int phy_primary_device; /* device type of primary PHY */
int phy_10Mbps_only; /* PHY is 10Mbps-only device */
int sc_enabled; /* boolean; power enabled on interface */
int (*sc_enable)(struct fxp_softc *);