forked from Imagelibrary/rtems
It enabled promiscous mode or sets the multicast filter according to the configuration and parameters to ioctl(SIOCSIFFLAGS), ioctl(SIOCADDMULTI) and ioctl(SIOCDELMULTI). On SIOCADDMULTI/SIOCDELMULTI requests the greth ioctl calls the Ethernet helper functions ether_addmulti()/ether_delmulti() which tells the greth driver when its required to update the MAC multicast filtering. The interface notifies support for multicast by setting IFF_MULTICAST. The GRETH has two registers which contains a bit-mask of allowed MAC addresses. The incomming MAC address is CRC:ed and the CRC is used as an index into the bit-mask to determine to allow or drop the frame.
A non Driver Manager GRETH driver is located in libchip/network/greth.c. This version requires the driver manager. network_interface_add is used to assign IP/NETMASK and MAC address to GRETH interfaces dynamically according to in which order devices are registered. The function takes the settings from the user defined interface_configs[] array, defined in the project configuration.