Synopsis
void designware_emac_v2_init_mac_driver(CTL_NET_INTERFACE_t *self,
                                        void *emac,
                                        void *mem,
                                        int tx_descriptor_count,
                                        int rx_descriptor_count,
                                        unsigned clock,
                                        int interruptSource);
Description

designware_emac_v2_init_mac_driver initializes the network interface self but does not start it. The DesignWare 10/100 EMAC register interface is specified in emac and the memory required to hold the transmit and receive descriptors is specified in mem.

The number of transmit and receive descriptors are passed in tx_descriptor_count and rx_descriptor_count. At least two transmit descriptors are required, and transmit performance of the TCP/IP library will scale with the number of descriptors allocated. At least one receive descriptor is required, and receive performance of the TCP/IP library will scale with the number of descriptors allocated.

The clock provided to the module is passed in clock, in Hertz. The driver automatically configures the MAC to divide the module clock in order to clock the management interface at a maximum of 2.5 MHz.

The interrupt source associated with the MAC is passed in interruptSource.

Note

mem must be accessible by the DMA engine of the Ethernet MAC. Please ensure that you pass an appropriate address for the descriptors by consulting the user manual of your device.