handled):
- export bge(4) and bnx(4) CHIP ID and PHY flags to brgphy(4). Move to
"unsigned int" rather than "int", and reuse the same softc members for
chipid and phyflags (behavior controlled by the sc_isbge/isbnx boolean).
- apply bug fix for revisions A and B, so that autonegotiation can
complete (from OpenBSD).
Bug reported by Rivo Nurges via private mail, patch tested and
confirmed working by him (with thanks!)
as found in the vortex86 SoCs (http://www.vortex86dx.com).
Ported from freebsd.
Not added to amd64's GENERIC because this CPU is 32bit only.
thanks to DM&P Electronics, Inc for providing documentation and sample
devices for this work.
- Fix register address in ale_phy_reset(). from linux
- Fix mask value in ale_stop_mac().
- Fix multicast handling. from openbsd
- Fix phy reset handling.
From FreeBSD, via OpenBSD, with some minor adaptations.
No comments, no objections on tech-kern@.
The driver was tested on a Dell M710. Access was kindly provided by
Uwe Toenjes, whom I thank for this.
See also http://mail-index.netbsd.org/tech-kern/2010/12/01/msg009478.html
Reason is that ifm_data does not store BMCR data but a media index
that gets poked into the BMCR register.
Setting the BMCR and ANAR registers is correctly handled by the
generic function mii_phy_setmedia.
The et(4) driver supports PCI Express Ethernet adapters based on
the Agere/LSI ET1310/ET1301 integrated MAC/PHY.
The et(4) driver was written by Sepherosa Ziehau for DragonFlyBSD,
ported to OpenBSD by Jonathan Gray and subsequently ported to NetBSD
by Kaspar Brand.
by defining 'options MIIVERBOSE' in the kernel config file (no change
from current behavior), or it can be loaded at boot time on those
architectures that support the boot loader's "load" command.
- wm_enable_wakeup() is disabled by default. If you want to use WOL with
the Magic Packet, define WM_WOL.
- Add the following flags:
WM_F_ASF_FIRMWARE_PRESENT
WM_F_ARC_SUBSYSTEM_VALID
WM_F_HAS_AMT
WM_F_HAS_MANAGE
WM_F_WOL
- Add wm_suspend() and wm_resume(). Give/get the control to/from the
firmware.
- Need more work for PCH. See wm_enable_phy_wakeup().
- Enable wm_get_hw_control() for 82574 and 82583.
- Add Yet another workaround for ICH8.
- Add wm_igp3_phy_powerdown_workaround_ich8lan() for power down problem
on D3.
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
- Add dspcode for igp3 and use it when the EEPROM isn't available.
- Add some delays.
- Stop the PHY transmitter before patching the DSP code and restart it after wrote.
- Save and restore register 0x2f5b.
- Patch for the DSP code is only for 8254[17] and we have to apply the
different patches between rev. 1 and rev. 2.
- The workaround for analog fuse is only for 82547 rev. 1.
- The workaround for smartspeed is only for 8254[17]
see http://mail-index.netbsd.org/tech-net/2009/08/05/msg001546.html
10Mb; it appears that the SmartSpeed workaround and dspcode in this PHY are
aimed at earlier generation IGPs. Remove reference to 82566s, allowing
them to fall through to choose other PHYs.
Both if_bge* and brgphy.[ch]:
Check the parent's MAC and use the quirk code for the bug like OpenBSD and
FreeBSD. Some bugs can't identify the PHY ID. For example, 5704 Ax has the
ADC bug, but 5704 A3 and 5704 B0 have the same PHY ID and revision. Add
BGE_PHY_CRC_BUG, BGE_PHY_ADC_BUG, BGE_PHY_5704_A0_BUG, BGE_PHY_JITTER_BUG,
BGE_PHY_ADJUST_TRIM and BGE_PHY_BER_BUG for this flag. Some of the DSP
patches are newly taken from OpenBSD and FreeBSD.
if_bge*:
Remove duplicated BGE_CHIPID_BCM5714_A0 entry in the known CHIPID table.
Fix obsolete comments.
brgphy.[ch]:
Add some PHY IDs.
TODO:
Add more three quirk code into bge and brgphy (the brgphy side's are
currently #if0'ed).
Add support for bnx into brgphy (currently #if0'ed)
Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.
Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks. For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.
Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown. Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags. Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).
Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.
Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag. The default for kern.detachall is 0. SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.
This is a work in progress. In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.
Also commit some changes that are not easily untangled from the rest:
(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.
(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs. Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
This should fix establishment of 10/100Mbps link on L1E.
Helpful to reduce watchdog timeout problems on L1 (age(4)) reported by Jochen Kunz.
From FreeBSD via OpenBSD.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
IEEE 802.3 Annex 28B.3 specifies the following relative
priorities of the technologies supported by
802.3 Selector Field value:
1000BASE-T full duplex
1000BASE-T
100BASE-T2 full duplex
100BASE-TX full duplex
100BASE-T2
100BASE-T4
100BASE-TX
10BASE-T full duplex
10BAST-T
Our drivers give 100BASE-T4 a higher priority than
100BASE-TX full duplex.
Fix this. This patch is based on changes in FreeBSD and OpenBSD.
Patch presented on tech-kern and tech-net:
http://mail-index.netbsd.org/tech-kern/2009/02/15/msg004397.htmlhttp://mail-index.netbsd.org/tech-net/2009/02/15/msg001064.html
got no comments, no objections.
ID pair. Misuse of the revision numbers was causing some of the chip
features to be disabled on some integrated Intel chips. So, move the
determination of the features into the bus frontend, where the
vendor/product ID is known. (Note: sc_rev should be removed. The
microcode patch stuff is also busted and needs to be fixed.) Also,
poll the actual flow control status in inphy, rather than making
assumptions.
contributed anonymously.
- reset autonegotation timer if media option is not IFM_AUTO or we got a invalid link.
- Announce link loss right after it happens.
- Autonegotiation is retried every mii_anegticks seconds.
- Report link state changes right after setting autonegotiation.
- use rgephy_reset consistently
- change rgephy_reset to use mii_phy_reset and rgephy_load_dspcode.
These changes give me a speedup from 6.5MB/s to 9.1MB/s on a 100MBit link.
This delay cause 500us loops under splnet() per linkdown port per mii_tick.
It causes periodically drop packets. It's not acceptable for other devices.
Move gphyter and nsphyter specific delay(500) into the drivers from
mii_physubr.c.
-- r1.15
Add some DSP init code for BCM5221's.
Values derived from Apple's GMAC driver, same init
code also exists in Linux's sungem_phy driver.
tested by miod@ pedro@ and otto@ on a few systems.
-- r1.16
Always explicitly set IFM_HDX for half-duplex.
From brad@
--
ether_mediachange() to their own module that we compile only if
the kernel configuration demands support for both MII buses and
ethernet. Thanks to Tom Spindler for suggesting that these routines
move to dev/mii/.
service routine. Add a wrapper for PHY_SERVICE(), called phy_service(),
and check device_is_active() there. Make the mii_*() routines call
the PHY service routines thorugh phy_service() instead of PHY_SERVICE().
In mii_phy_resume(), restore a PHY's state after resetting it by
sending a MII_MEDIACHG command. This change makes bnx(4) resume
more reliably and more quickly; it should help other NICs to resume,
too, if they attach PHYs through MII.
This makes autonegotiation on rlphy(4) at re(4)
on landisk (8139C+) select 100baseTX full-duplex
at boot time (before first ifconfig) properly,
and there is no bad side effect on rlphy(4) at nfe(4).
This may also fix PR kern/34109.
> - Don't set MIIF_NOISOLATE so rgephy(4) can be used in configurations
> with multiple PHYs and un-comment case IFM_NONE in case MII_MEDIACHG
> rgephy_service(). There doesn't seem to be a problem with isolating
> RTL8169S and their internal PHY.
and rev 1.12:
> - Fix some spelling in comments.
> - Remove superfluous returns at the end of void functions.
> - Remove unused static global rgephy_mii_model.
- remove #ifdef'ed out code whcih has also been removed in FreeBSD
- some style cosmetics
- set RGEPHY_1000CTL_AHD in rge_reset()
- reset RGEPHY_MII_BMCR register in rge_reset() too
While here, use proper macro rather than magic numbers for
ANAR and BMCR registers there.
Revision 1.9:
> Make the rgephy driver advertise both 1000_FD and 1000_HD bits in
> autoneg mode. A couple of the devices don't autoneg correctly unless
> configured this way.
Revision 1.11:
> Due to the poor PHY documentation from RealTek I can't sure but I
> think the RealTek PHY needs driver to set RGEPHY_BMCR_AUTOEN bit of
> RGEPHY_MII_BMCR register and proper ANAR register setting for manual
> media type selection.
> This fixes long standing manual media type selection bug in rgephy(4).
newer server chipsets) to wm(4), from the FreeBSD em(4) driver.
While there, add a few other Intel Ethernet controller that should work as
is.
Properly update the RX error and TX collision counters.
Add ikphy(4), a driver for the Intel i82563 Kumeran 10/100/1000 Ethernet PHYs