CDP & LLDP send works, but can't receive ethernet packets (uboot)

      CDP & LLDP send works, but can't receive ethernet packets (uboot)


      I tried to use the CDP command in UBOOT and also implemented a LLDP command. Both commands send CDP or LLDP messages. The problem for me is that UBOOT does not receive any multicast (CDP, LLDP) Ethernet packets. This seems similar to this thread:…ve-data-uboot/td-p/681131
      Other protocols/commands works tftp, ping…and so on.

      Where is the function that receives the Ethernet frames for the efusA9X defined? Is it "drivers/net/fec_mxc.{c,h}"?

      How can I test this problem more in detail…like registers or tcpdump in uboot??
      Attached there is a zip with examples for a CDP and a LLDP message.



      Yes, fec_mxc.c is the right file. As far as I understand the code, this driver in U-Boot is not prepared for multicast packets, yet. All multicast addresses are switched off, see function fec_init(), where gaddr1 and gaddr2 are set to zero. And the receive function does not handle any multicast packets, too. See fec_recv().

      So I believe you have to enhance the driver to work with multicast packets. First you have to set the gaddr registers to accept the packets. The controller seems to compute a 6 bit hash number from all bypassing MAC addresses. This value between 0 and 63 addresses one of 64 bits in the gaddr registers. If the corresponding bit is set, then the packet is accepted, otherwise ignored. And then you have to implement the processing of these packets in fec_recv(). First of all you have to make sure that you really want to accept this packet, because the hash matches more than one address. So you actually have to compare the MAC address against your real address mask. And only if this test passes, you can forward the packet data to the NetReceive() function.

      Maybe you can also have a look at the Linux driver to see how it is done there. There it is in drivers/net/ethernet/freescale/fec_main.c. Of course there the code is considerably more complex to handle more cases.

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.