beautypg.com

8 phy link status change, Phy link status change – Maxim Integrated 78Q8430 Software Driver User Manual

Page 42

background image

78Q8430 Software Driver Development Guidelines

UG_8430_004

7.8 PHY Link Status Change

The behavior of the MAC in half duplex mode is not the same as its behavior in full duplex mode. It is
critical for proper operation of the MAC that it be kept up to date as to the duplex nature of the currently
established link on the PHY at all times. To ensure this, the driver must respond to all link change
interrupts from the PHY and update the MAC duplex mode based on the nature of the new link.

Use the following procedure to handle a link status change interrupt from the PHY:

STEP 1: Enable link status change interrupts in the PHY.
Set the Link Status Change Interrupt Enable bit in the MR17 register to enable the interrupt.

STEP 2: Enable the PHY interrupt.
Set the HIMR PHY bit to enable PHY interrupts to the driver.

STEP 3: Wait for a link status change interrupt.
The interrupt service routine should identify interrupts from the PHY by reading the MR17 register.
The MR17 Link Status Change Interrupt bit confirms that a link status change has occurred. Reading
MR17 also clears the interrupt.

STEP 4: Get the status of the new link.
Read the MR1 Link Status bit to determine the link status. If the Link Status bit is clear, there is no
link and the driver should disable the MAC to prevent frames being sent to the PHY. In this case, no
further action is required.

STEP 5: Get the mode of the new link.
Read the MR18 register to determine the actual status of the current link. The MR18 Duplex
Indication bit will be set for full duplex and clear for half duplex.

STEP 6: Set the MCR FullDup bit to the value contained in the MR18 Duplex Indication bit.

The value of the MR0 Duplex Mode bit is not an accurate indication of the state of the current link. When
auto-negotiation is used, only the MR18 register contains the state of the current link.




42

Rev.

1.0