...
Anchor
NetDev_Start()
is called once each time an interface is started. It performs the following actions:Anchor 1041710 1041710 Call theNetOS_Dev_CfgTxRdySignal()
function to configure the transmit ready semaphore count. This function call is optional and is performed if the hardware device supports queuing multiple transmit frames. By default, the semaphore count is initialized to one. However, DMA devices should set the semaphore count equal to the number of configured transmit descriptors for optimal performance. Non-DMA devices that support queuing more than one transmit frame may also benefit from a non-default value.Anchor 1041711 1041711 - Initialize the device MAC address, if applicable. For Ethernet devices, this step is mandatory. The MAC address data may come from one of three sources and should be set using the following priority scheme:
...
...
- Configure the MAC address using the string found within the device configuration structure. This is a form of static MAC address configuration and may be performed by calling
NetASCII_Str_to_MAC()
andNetIF_AddrHW_SetHandler()
. If the device configuration string has been left empty, or is specified as all 0’s, an error will be returned and the next method should be attempted.
- Configure the MAC address using the string found within the device configuration structure. This is a form of static MAC address configuration and may be performed by calling
...
- Check if the application developer has called
NetIF_AddrHW_Set()
by making a call toNetIF_AddrHW_GetHandler()
andNetIF_AddrHW_IsValidHandler()
in order to check if the specified MAC address is valid. This method may be used as a static method for configuring the MAC address during run-time, or a dynamic method should a pre-programmed external memory device exist. If the acquired MAC address does not pass the check function, then:
- Check if the application developer has called
...
- Call
NetIF_AddrHW_SetHandler()
using the data found within the individual MAC address registers. If an auto-loading EEPROM is attached to the MAC, the registers will contain valid data. If not, then a configuration error has occurred. This method is often used with a production process where the MAC supports automatically loading individual address registers from a serial EEPROM. When using this method, you should specify an empty string for the MAC address within the device configuration, and refrain from callingNetIF_AddrHW_Set()
from within the application.
- Call
...
Anchor 1041715 1041715- Initialize additional MAC registers required by the MAC for proper operation.
Anchor 1041716 1041716 - Clear all interrupt flags.anchor
1041717 1041717 - Locally enable interrupts on the hardware device. The host interrupt controller should have already been configured within the device driver
NetDev_Init()
function.anchor 1041718 1041718 Enable the receiver and transmitter.Anchor 1041719 1041719- Set perr equal to
NET_DEV_ERR_NONE
if no errors have occurred. Otherwise, set perr to an appropriate network device error code