forked from Imagelibrary/rtems
2011-03-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
* shared/lpc/network/lpc-ethernet.c: Support multicast.
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
bsp_reset().
|
bsp_reset().
|
||||||
* shared/startup/linkcmds.base: Move unsupported sections into
|
* shared/startup/linkcmds.base: Move unsupported sections into
|
||||||
read-only section. Changed barrier sections.
|
read-only section. Changed barrier sections.
|
||||||
|
* shared/lpc/network/lpc-ethernet.c: Support multicast.
|
||||||
|
|
||||||
2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
|
2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009
|
* Copyright (c) 2009-2011 embedded brains GmbH. All rights reserved.
|
||||||
|
*
|
||||||
* embedded brains GmbH
|
* embedded brains GmbH
|
||||||
* Obere Lagerstr. 30
|
* Obere Lagerstr. 30
|
||||||
* D-82178 Puchheim
|
* 82178 Puchheim
|
||||||
* Germany
|
* Germany
|
||||||
* <rtems@embedded-brains.de>
|
* <rtems@embedded-brains.de>
|
||||||
*
|
*
|
||||||
@@ -354,12 +355,12 @@ static inline uint32_t lpc_eth_increment(
|
|||||||
static void lpc_eth_enable_promiscous_mode(bool enable)
|
static void lpc_eth_enable_promiscous_mode(bool enable)
|
||||||
{
|
{
|
||||||
if (enable) {
|
if (enable) {
|
||||||
lpc_eth->rxfilterctrl = ETH_RX_FIL_CTRL_ACCEPT_PERFECT
|
lpc_eth->rxfilterctrl = ETH_RX_FIL_CTRL_ACCEPT_UNICAST
|
||||||
| ETH_RX_FIL_CTRL_ACCEPT_UNICAST
|
|
||||||
| ETH_RX_FIL_CTRL_ACCEPT_MULTICAST
|
| ETH_RX_FIL_CTRL_ACCEPT_MULTICAST
|
||||||
| ETH_RX_FIL_CTRL_ACCEPT_BROADCAST;
|
| ETH_RX_FIL_CTRL_ACCEPT_BROADCAST;
|
||||||
} else {
|
} else {
|
||||||
lpc_eth->rxfilterctrl = ETH_RX_FIL_CTRL_ACCEPT_PERFECT
|
lpc_eth->rxfilterctrl = ETH_RX_FIL_CTRL_ACCEPT_PERFECT
|
||||||
|
| ETH_RX_FIL_CTRL_ACCEPT_MULTICAST
|
||||||
| ETH_RX_FIL_CTRL_ACCEPT_BROADCAST;
|
| ETH_RX_FIL_CTRL_ACCEPT_BROADCAST;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1291,7 +1292,8 @@ static int lpc_eth_interface_ioctl(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
lpc_eth_driver_entry *e = (lpc_eth_driver_entry *) ifp->if_softc;
|
lpc_eth_driver_entry *e = (lpc_eth_driver_entry *) ifp->if_softc;
|
||||||
int rv = 0;
|
struct ifreq *ifr = (struct ifreq *) data;
|
||||||
|
int eno = 0;
|
||||||
|
|
||||||
LPC_ETH_PRINTF("%s\n", __func__);
|
LPC_ETH_PRINTF("%s\n", __func__);
|
||||||
|
|
||||||
@@ -1313,15 +1315,25 @@ static int lpc_eth_interface_ioctl(
|
|||||||
/* TODO: init */
|
/* TODO: init */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SIOCADDMULTI:
|
||||||
|
case SIOCDELMULTI: {
|
||||||
|
eno = (command == SIOCADDMULTI) ? ether_addmulti(ifr, &e->arpcom)
|
||||||
|
: ether_delmulti(ifr, &e->arpcom);
|
||||||
|
if (eno == ENETRESET) {
|
||||||
|
/* TODO: Use imperfect hash filter */
|
||||||
|
eno = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case SIO_RTEMS_SHOW_STATS:
|
case SIO_RTEMS_SHOW_STATS:
|
||||||
lpc_eth_interface_stats(e);
|
lpc_eth_interface_stats(e);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
rv = EINVAL;
|
eno = EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return eno;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lpc_eth_interface_start(struct ifnet *ifp)
|
static void lpc_eth_interface_start(struct ifnet *ifp)
|
||||||
@@ -1504,7 +1516,7 @@ static int lpc_eth_attach(struct rtems_bsdnet_ifconfig *config)
|
|||||||
ifp->if_start = lpc_eth_interface_start;
|
ifp->if_start = lpc_eth_interface_start;
|
||||||
ifp->if_output = ether_output;
|
ifp->if_output = ether_output;
|
||||||
ifp->if_watchdog = lpc_eth_interface_watchdog;
|
ifp->if_watchdog = lpc_eth_interface_watchdog;
|
||||||
ifp->if_flags = config->ignore_broadcast ? 0 : IFF_BROADCAST;
|
ifp->if_flags = IFF_MULTICAST | IFF_BROADCAST | IFF_SIMPLEX;
|
||||||
ifp->if_snd.ifq_maxlen = ifqmaxlen;
|
ifp->if_snd.ifq_maxlen = ifqmaxlen;
|
||||||
ifp->if_timer = 0;
|
ifp->if_timer = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user