1 / 23

Ethernet Driver Enhancements

Ethernet Driver Enhancements. Ethernet Driver Enhancements. Support for multiple protocol stacks Packet filters New APIs and data types. NET+OS 5 and 5.1 Drivers. All packets sent to TCP/IP stack Did not check frame type Did not check protocol ID No way to support other protocols.

braima
Télécharger la présentation

Ethernet Driver Enhancements

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ethernet Driver Enhancements

  2. Ethernet Driver Enhancements • Support for multiple protocol stacks • Packet filters • New APIs and data types

  3. NET+OS 5 and 5.1 Drivers • All packets sent to TCP/IP stack • Did not check frame type • Did not check protocol ID • No way to support other protocols

  4. Support for other Protocols • NET+OS 6 driver associates a frame type and protocol ID with a protocol stack • Only packets with the correct frame type and protocol ID are sent to the stack • Unwanted packets are discarded • All Ethernet frame types are supported

  5. Packet Filter • Application can tell driver to discard some packets that match certain criteria, even if they are directed to a protocol stack • Useful for discarding unwanted broadcast and/or multicast packets

  6. NAEthAddPacketType() • Int NAEthAddPacketType(ethPacketType *newPacketType) • Used to add a new protocol stack • Specifies fram type and protocol ID • Passed a pointer to the stack's receive function • Also specifies optional packet filters

  7. TCP/IP Registered with this code result = NAEthAddPacketType(&ipType); result |= NAEthAddPacketType(&arpType); result |= NAEthAddPacketType(&rarpType); • And error checking code

  8. EthPacketType Typedef struct { ethLinkProtocolType linkProtocolType; WORD16 protocolId; ethReceiveFnType recvFn; ethFilterType filter[ETH_MAX_FILTERS]; unsigned filterCount; } ethPacketType;

  9. EthFilterType Typedef struct { ethMatchType match[ETH_MAX_MATCHES]; int matchCount; BOOLEAN applyToMulticastOnly; BOOLEAN applyToBroadcastOnly; } ethFilterType;

  10. EthMatchType typedef struct { BYTE compareData[ETH_MAX_COMPARE_DATA]; unsigned length; unsigned offset; BOOLEAN wantInverseMatch; } ethMatchType

  11. Ethernet API • NABlockUDPBroadcasts() • NAEthAddPacketType() • NAEthMsgAllocate() • NAEthMsgFree() • NAEthRegisterUnclaimedPacket() • NAEthTransmit() • na_eth_send()

  12. Enable Interrupts During Transmit • #define ETH_DISABLE_INTS_DURING_TRANSMIT 0 • Defined in eth.h, allows interrupts to remain enabled while setting up DMA buffer descriptors for a transmit packet. • If defined as 0, eth0_init() uses: FUSION_DRV_TXCOMPLETE_NOTIFY_NOCOPY_TX_NORMAL • If defined as 1, eth0_init() uses: FUSION_DRV_TXCOMPLETE_NOTIFY_NOCOPY

  13. Enable Interrupts During Transmit (2) • Fusion does not queue the packet before the call to eth_start(). • Instead, eth_start() queues the packet when it reserves an entry of the transmit DMA buffer descriptor ring.

  14. Transmit Lockup Reset • Detection in the transmit ISR and in eth_watchdog() on a timer, every 100ms for 100BaseT, every 1 sec for 10BaseT. • Detection is based on a head of transmit queue and a count of transmitted DMA buffers.

  15. Changes to MII Driver….

  16. Summary of Changes • Moved to platform directory • API functions renamed to customizeMIIxxx format • Added Ethernet link monitoring using PHY interrupt or timer • Added support for link partner that does not support autonegotiation

  17. Ethernet Link Monitoring • BSP_USE_PHY_INTERRUPT (defined in bsp.h) determines implementation • TRUE: Ethernet link is monitored using MII interrupt • FALSE: Link is monitored using timer • MII interrupt is supported on Net+50 platforms (not on 7520)

  18. MII Interrupt Support • customizeEnableMiiInterrupt() installs the MII interrupt • customizeLinkChangeIsr () is the interrupt service routine • Both functions are in mii.c

  19. Link Monitoring using Timer • Uses 500-msec ThreadX timer "Eth Link Timer“ • Monitoring is performed in eth_check_link() function in eth_init.c

  20. Actions on Link Up • Checks speed and duplex to save correct values • Resets duplex bit in EGCR and MAC configuration registers • (7520 only) Changes Back-to-Back IPG Gap Timer depending on duplex

  21. Support for Link Partner without Autonegotiation • Board parameter defaultDuplexLevel can be set to value bpDefaultDuplex, bpHalfDuplex, or bpFullDuplex. • bpDefaultDuplex means autonegotiation is always enabled and is not restarted after link down/up. The value returned by mii_check_duplex is used. • bpHalfDuplex/bpFullDuplex means autonegotiation is enabled if it is supported by the link partner. If not, autonegotiation is disabled and the specified duplex level is forced. If the link goes down, the MII is reset and autonegotiation is restarted.

  22. API Summary

  23. API Summary (2)

More Related