Subject: What Apple does with GMAC
To: None <bkorb@allegronetworks.com, port-macppc@netbsd.org>
From: Louis Gerbarg <gerbal@cs.rpi.edu>
List: port-macppc
Date: 04/22/2001 13:07:46
Basicly, Apple has a timeout routine, and in the timeout routine they
check if it is wedged and they restart. Below is an excerpt of the timeout
routine. This is part of the AppleGMACEthernet project in the Darwin CVS
repository. If you want more details about the symbolic constants and such
you can look at that.

Louis

    if ( rxWDInterrupts == 0 )
    {
        UInt32 rxMACStatus;

        switch ( rxWDCount )
        {
            case 0:
            case 1:
                rxWDCount++;    // Extend timeout
                break;

            default:
                // We could be less conservative here and restart the
                // receiver unconditionally.

                rxMACStatus = READ_REGISTER( RxMACStatus );

                if ( rxMACStatus & kRX_MAC_Status_Rx_Overflow )
                {
                    // Bad news, the receiver may be deaf as a result of
this
                    // condition, and if so, a RX MAC reset is needed.
Note
                    // that reading this register will clear all bits.

                    restartReceiver();

                                        NETWORK_STAT_ADD( inputErrors );
                                        ETHERNET_STAT_ADD(
dot3RxExtraEntry.watchdogTimeouts );
                }
                rxWDCount = 0;
                break;
        }
    }