summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/mii.h
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2010-10-14 22:01:40 +0000
committermarius <marius@FreeBSD.org>2010-10-14 22:01:40 +0000
commit28e02ade01c18f957e893cb5e62b5519d89e312b (patch)
treeab370198c75c435d50cc4cef48c18ef793c3cd98 /sys/dev/mii/mii.h
parentdb788fc15d82837c059428a54dc35ccf6e76190c (diff)
downloadFreeBSD-src-28e02ade01c18f957e893cb5e62b5519d89e312b.zip
FreeBSD-src-28e02ade01c18f957e893cb5e62b5519d89e312b.tar.gz
Add a NetBSD-compatible mii_attach(), which is intended to eventually
replace mii_phy_probe() altogether. Compared to the latter the advantages of mii_attach() are: - intended to be called multiple times in order to attach PHYs in multiple passes (f.e. in order to only use sub-ranges of the 0 to MII_NPHY - 1 range) - being able to pass along the capability mask from the NIC to the PHY drivers - being able to specify at which address (phyloc) to probe for a PHY (instead of always probing at all addresses from 0 to MII_NPHY - 1) - being able to specify which PHY instance (offloc) to attach - being able to pass along MIIF_* flags from the NIC to the PHY drivers (f.e. as required to indicated to the PHY drivers that flow control is supported by the NIC driver, which actually is the motivation for this change). While at it, I used the opportunity to get rid of some hacks in mii(4) like miibus_probe() generally doing work besides sheer probing and the "EVIL HACK" (which will vanish entirely along with mii_phy_probe()) by passing the struct ifnet pointer via an argument of mii_attach() as well as to fix some resource leaks in mii(4) in case something fails. Commits which will update the PHY drivers to honor the MII flags passed down from the NIC drivers and take advantage of mii_attach() to get rid of certain types of hacks in NIC and PHY drivers as well as a conversion of the remaining uses of mii_phy_probe() will follow shortly. Reviewed by: jhb, yongari Obtained from: NetBSD (partially)
Diffstat (limited to 'sys/dev/mii/mii.h')
-rw-r--r--sys/dev/mii/mii.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/mii/mii.h b/sys/dev/mii/mii.h
index c84c767..b7e0a05 100644
--- a/sys/dev/mii/mii.h
+++ b/sys/dev/mii/mii.h
@@ -1,5 +1,5 @@
/* $NetBSD: mii.h,v 1.9 2001/05/31 03:07:14 thorpej Exp $ */
-
+
/*-
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.
*
@@ -47,7 +47,7 @@
#define MII_COMMAND_WRITE 0x01
#define MII_COMMAND_ACK 0x02
-#define MII_BMCR 0x00 /* Basic mode control register (rw) */
+#define MII_BMCR 0x00 /* Basic mode control register (rw) */
#define BMCR_RESET 0x8000 /* reset */
#define BMCR_LOOP 0x4000 /* loopback */
#define BMCR_SPEED0 0x2000 /* speed selection (LSB) */
@@ -82,6 +82,8 @@
#define BMSR_JABBER 0x0002 /* Jabber detected */
#define BMSR_EXTCAP 0x0001 /* Extended capability */
+#define BMSR_DEFCAPMASK 0xffffffff
+
/*
* Note that the EXTSTAT bit indicates that there is extended status
* info available in register 15, but 802.3 section 22.2.4.3 also
OpenPOWER on IntegriCloud