Motorola MPC5200 用户手册

下载
页码 28
KwikNet MPC5200 FEC Device Driver
KADAK
13
Mode 2: Periodic Sampling
By default, the MPC5200 FEC device driver is configured to use a third, preferred
method of operation.  The driver uses a 
KwikNet
 timer to periodically sample the PHY,
watching for the auto-negotiation to complete.  The sampling period, the wait interval
and an additional post-negotiation delay are all configurable parameters.  By default, the
driver samples at the 
KwikNet
 clock frequency for up to 3 seconds, with no additional
delay.
The device driver reports the success or failure of the auto-negotiation process to the
Ethernet network driver.  If a link has been established, the network driver completes the
opening process and declares the network interface operational.  If necessary, IP address
negotiation will then be initiated using either DHCP or AutoIP according to your network
interface definition.
If the PHY auto-negotiation fails, the Ethernet network driver will declare that the
network interface cannot be opened for use.
Choosing the Mode of Operation
To alter the MPC5200 FEC device driver's PHY initialization strategy, you must edit the
device driver header file 
M5200E.H
.  Define symbol 
DD_WAITANC
 to be 
DD_NOWAIT
 for no
delay, 
DD_POLLING
 for continuous polling and 
DD_SAMPLING
 (the default) for periodic
sampling.  The timeout interval(s) and sampling interval can be defined as described in
the file.
Event Callback Notification
When the periodic sampling method is used (
DD_WAITANC
 is 
DD_SAMPLING
), the device
driver generates a network event to signal the success (
KN_EV_DVCUP
) or failure
(
KN_EV_DVCFAIL
) of the PHY auto negotiation.
If you implement the 
KwikNet
 event notification function 
kn_netevent()
 as described in
Chapter 4.5 of the 
KwikNet
 TCP/IP Stack User's Guide, your function will be called
whenever either of these network events is generated.  Note that your function will be
called again when the network is subsequently declared open (up) or closed (down).