One such device worked fine provided that there was a little ethernet switch between the laptop machine and the target, but a direct connection between the laptop machine and target device only worked about half the time. Even the little switch sometimes could not connect.
MAC, PHY, MAGAn ethernet interface device consists of three main parts: The Media Access Controller (MAC), the Physical Interface (PHY) and a set of transformers - the Magnetics. When you plug a cable in, the PHY sends out little pulses to figure out what is going on and then swaps the wires around internally and changes the speed and duplex settings to make the interface work.
The trouble was that the target only supports 100 Mbps, while the laptop machine wanted to run at 1 Gbps and the two just could not reach agreement.
EthtoolThe ethtool program can be used to configure the ethernet interface device manually:
# ifconfig em0 up
# ethtool em0
# ethtool -s em0 speed 100 duplex full autoneg off
# ethtool em0
# ifconfig em0 192.168.111.1 netmask 255.255.255.0
That forced the laptop machine to the correct speed and duplex settings, turned the broken auto negotiation off and then life was good.
Shortly after writing the above, I ran into a case where the embedded system works better with a 100 Mbps half duplex connection, but the auto-negotiation usually resulted in a full duplex connection.
# ethtool -s em0 speed 100 duplex half autoneg off
These weird issues are usually due to a bad board layout around the ethernet chip set.
ReferenceMore information here: