summaryrefslogtreecommitdiffstats
path: root/bsps/sparc/include/bsp/greth.h
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2018-06-15 14:28:36 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2018-08-24 15:51:39 +0200
commit243ddb52b3765e01b1a9335a2f2c15ebff99c479 (patch)
treece063a0162157afaa3152fdadddcf474854122f4 /bsps/sparc/include/bsp/greth.h
parentleon, greth: 10/100 MAC enable TX BD interrupt (diff)
downloadrtems-243ddb52b3765e01b1a9335a2f2c15ebff99c479.tar.bz2
leon,greth: enable MAC filtering (promiscous mode, multicast)
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.
Diffstat (limited to 'bsps/sparc/include/bsp/greth.h')
-rw-r--r--bsps/sparc/include/bsp/greth.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/bsps/sparc/include/bsp/greth.h b/bsps/sparc/include/bsp/greth.h
index 9209d823e3..1c42c99ddc 100644
--- a/bsps/sparc/include/bsp/greth.h
+++ b/bsps/sparc/include/bsp/greth.h
@@ -24,6 +24,9 @@ typedef struct _greth_regs {
volatile uint32_t mdio_ctrl; /* MDIO control and status */
volatile uint32_t txdesc; /* Transmit descriptor pointer */
volatile uint32_t rxdesc; /* Receive descriptor pointer */
+ volatile uint32_t edcl; /* EDCL IP register */
+ volatile uint32_t ht_msb; /* Multicast MSB hash */
+ volatile uint32_t ht_lsb; /* Multicast LSB hash */
} greth_regs;
#define GRETH_TOTAL_BD 128
@@ -83,8 +86,12 @@ typedef struct _greth_regs {
#define GRETH_CTRL_RST 0x00000040 /* Reset MAC */
#define GRETH_CTRL_SP 0x00000080 /* 100MBit speed mode */
#define GRETH_CTRL_GB 0x00000100 /* 1GBit speed mode */
+#define GRETH_CTRL_MCE 0x00000800 /* Multicast Enable */
#define GRETH_CTRL_DD 0x00001000 /* Disable EDCL Duplex Detection */
#define GRETH_CTRL_ED 0x00004000 /* EDCL Disable */
+#define GRETH_CTRL_MC 0x02000000 /* Multicast available */
+#define GRETH_CTRL_ME 0x04000000 /* MDIO interrupts enabled */
+#define GRETH_CTRL_GA 0x08000000 /* Gigabit MAC available */
/* Status Register */
#define GRETH_STATUS_RXERR 0x00000001 /* Receive Error */