Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
Networking and Ethernet devices
ST Logo
  Contents   Next

STMMAC 10/100/1000 Ethernet

This is the driver for the MAC 10/100/1000 on-chip Ethernet controllers (Synopsys IP blocks); it has been released starting from the STLinux-2.3 distribution.
This network device driver is for all ST embedded MACs (7109/7200/71x1 platform based).

Driver introduction
Receive process

When one or more packets are received, an interrupt happens. The interrupts are not queued so the driver has to scan all the descriptors in the ring during the receive process.
This is based on NAPI so the interrupt handler only signals there is work to be done, and exits.
Then the poll method will be scheduled at some future point.
The incoming packets are stored, by the DMA, in a list of pre-allocated socket buffers in order to avoid, for big packet, the memcpy operation (zero-copy mechanism).

Transmit process

The xmit method is invoked when the kernel needs to transmit a packet; it sets the descriptors in the ring and informs the DMA engine that there is a packet ready to be transmitted.
Once the controller has finished transmitting the packet, an interrupt is triggered; So the driver will be able to releases the socket buffers.
By default, the driver sets the NETIF_F_SG bit in the features field of the net_device structure enabling the scatter/gather feature.

NOTE: scatter-gather can be enabled/disabled by using ethtool:

ethtool -K  sg on/off

Kernel Configuration

The kernel configuration option is STMMAC_ETH:

Device Drivers ---> Network device support ---> Ethernet (1000 Mbit) ---> MAC 10/100/1000 Ethernet driver (STMMAC_ETH)
Kernel command line arguments

stmmaceth=msglvl:<debug_msg_level>, phyaddr:<phy_address>, watchdog:<watchdog_value>,minrx:<rx_copybreak>, txsize:<dma_tx_size_param>, rxsize:<dma_rx_size_param>,flow_ctrl:<flow_ctrl>, pause:<pause>,tc:<threshold_ctrl>, txmit:<tx_aggregation>,rxmit:<rx_irq_mitigation>,

where:

  • debug_msg_level: message level (0: no output, 16: all).
  • phy_address: physical Address number.
  • watchdog: transmit timeout (in milliseconds).
  • rx_copybreak: copy only tiny-frames (rx zero-copy).
  • dma_tx_size_param: DMA tx ring size.
  • dma_rx_size_param: DMA rx ring size.
  • flow_ctrl: Flow control ability [on/off]
  • pause: Flow Control Pause Time.
  • threshold_ctrl: Threshold ctrl (if the driver doesn't us SF mode.
  • tx_aggregation: to mitigate the number of tx interrupts.
  • rx_aggregation: to mitigate the number of rx interrupts (timer opt.).
Notes
  • MAC address must be provided by using nwhwconf support.
  Contents   Next
Valid HTML 4.01! Last updated: 2008/06/27 07:18:21
© Copyright STMicroelectronics Limited, 2005
Printer