mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Add support for multicast MAC addresses
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2784 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -137,6 +137,10 @@ static void cs89x0_txtimeout(int argc, uint32_t arg, ...);
|
||||
static int cs89x0_ifup(struct uip_driver_s *dev);
|
||||
static int cs89x0_ifdown(struct uip_driver_s *dev);
|
||||
static int cs89x0_txavail(struct uip_driver_s *dev);
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int cs89x0_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac);
|
||||
static int cs89x0_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@@ -814,6 +818,66 @@ static int cs89x0_txavail(struct uip_driver_s *dev)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: cs89x0_addmac
|
||||
*
|
||||
* Description:
|
||||
* NuttX Callback: Add the specified MAC address to the hardware multicast
|
||||
* address filtering
|
||||
*
|
||||
* Parameters:
|
||||
* dev - Reference to the NuttX driver state structure
|
||||
* mac - The MAC address to be added
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int cs89x0_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
|
||||
{
|
||||
FAR struct cs89x0_driver_s *priv = (FAR struct cs89x0_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
#warning "Multicast MAC support not implemented"
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: cs89x0_rmmac
|
||||
*
|
||||
* Description:
|
||||
* NuttX Callback: Remove the specified MAC address from the hardware multicast
|
||||
* address filtering
|
||||
*
|
||||
* Parameters:
|
||||
* dev - Reference to the NuttX driver state structure
|
||||
* mac - The MAC address to be removed
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int cs89x0_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
|
||||
{
|
||||
FAR struct cs89x0_driver_s *priv = (FAR struct cs89x0_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
#warning "Multicast MAC support not implemented"
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -872,6 +936,10 @@ int cs89x0_initialize(FAR const cs89x0_driver_s *cs89x0, int devno)
|
||||
cs89x0->cs_dev.d_ifup = cs89x0_ifup; /* I/F down callback */
|
||||
cs89x0->cs_dev.d_ifdown = cs89x0_ifdown; /* I/F up (new IP address) callback */
|
||||
cs89x0->cs_dev.d_txavail = cs89x0_txavail; /* New TX data callback */
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
cs89x0->cs_dev.d_addmac = cs89x0_addmac; /* Add multicast MAC address */
|
||||
cs89x0->cs_dev.d_rmmac = cs89x0_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
cs89x0->cs_dev.d_private = (void*)cs89x0; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
|
||||
+69
-1
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* drivers/net/dm9x.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* References: Davicom data sheets (DM9000-DS-F03-041906.pdf,
|
||||
@@ -398,6 +398,10 @@ static void dm9x_txtimeout(int argc, uint32_t arg, ...);
|
||||
static int dm9x_ifup(struct uip_driver_s *dev);
|
||||
static int dm9x_ifdown(struct uip_driver_s *dev);
|
||||
static int dm9x_txavail(struct uip_driver_s *dev);
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int dm9x_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac);
|
||||
static int dm9x_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
/* Initialization functions */
|
||||
|
||||
@@ -1506,6 +1510,66 @@ static int dm9x_txavail(struct uip_driver_s *dev)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: dm9x_addmac
|
||||
*
|
||||
* Description:
|
||||
* NuttX Callback: Add the specified MAC address to the hardware multicast
|
||||
* address filtering
|
||||
*
|
||||
* Parameters:
|
||||
* dev - Reference to the NuttX driver state structure
|
||||
* mac - The MAC address to be added
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int dm9x_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
|
||||
{
|
||||
FAR struct dm9x_driver_s *priv = (FAR struct dm9x_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
#warning "Multicast MAC support not implemented"
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: dm9x_rmmac
|
||||
*
|
||||
* Description:
|
||||
* NuttX Callback: Remove the specified MAC address from the hardware multicast
|
||||
* address filtering
|
||||
*
|
||||
* Parameters:
|
||||
* dev - Reference to the NuttX driver state structure
|
||||
* mac - The MAC address to be removed
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int dm9x_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
|
||||
{
|
||||
FAR struct dm9x_driver_s *priv = (FAR struct dm9x_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
#warning "Multicast MAC support not implemented"
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: dm9x_bringup
|
||||
*
|
||||
@@ -1719,6 +1783,10 @@ int dm9x_initialize(void)
|
||||
g_dm9x[0].dm_dev.d_ifup = dm9x_ifup; /* I/F down callback */
|
||||
g_dm9x[0].dm_dev.d_ifdown = dm9x_ifdown; /* I/F up (new IP address) callback */
|
||||
g_dm9x[0].dm_dev.d_txavail = dm9x_txavail; /* New TX data callback */
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
g_dm9x[0].dm_dev.d_addmac = dm9x_addmac; /* Add multicast MAC address */
|
||||
g_dm9x[0].dm_dev.d_rmmac = dm9x_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
g_dm9x[0].dm_dev.d_private = (void*)g_dm9x; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
|
||||
@@ -278,6 +278,10 @@ static void enc_txtimeout(int argc, uint32_t arg, ...);
|
||||
static int enc_ifup(struct uip_driver_s *dev);
|
||||
static int enc_ifdown(struct uip_driver_s *dev);
|
||||
static int enc_txavail(struct uip_driver_s *dev);
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int enc_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac);
|
||||
static int enc_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
/* Initialization */
|
||||
|
||||
@@ -1754,6 +1758,66 @@ static int enc_txavail(struct uip_driver_s *dev)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: enc_addmac
|
||||
*
|
||||
* Description:
|
||||
* NuttX Callback: Add the specified MAC address to the hardware multicast
|
||||
* address filtering
|
||||
*
|
||||
* Parameters:
|
||||
* dev - Reference to the NuttX driver state structure
|
||||
* mac - The MAC address to be added
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int enc_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
|
||||
{
|
||||
FAR struct enc_driver_s *priv = (FAR struct enc_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
#warning "Multicast MAC support not implemented"
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: enc_rmmac
|
||||
*
|
||||
* Description:
|
||||
* NuttX Callback: Remove the specified MAC address from the hardware multicast
|
||||
* address filtering
|
||||
*
|
||||
* Parameters:
|
||||
* dev - Reference to the NuttX driver state structure
|
||||
* mac - The MAC address to be removed
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int enc_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
|
||||
{
|
||||
FAR struct enc_driver_s *priv = (FAR struct enc_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
#warning "Multicast MAC support not implemented"
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: enc_pwrsave
|
||||
*
|
||||
@@ -2079,6 +2143,10 @@ int enc_initialize(FAR struct spi_dev_s *spi, unsigned int devno, unsigned int i
|
||||
priv->dev.d_ifup = enc_ifup; /* I/F down callback */
|
||||
priv->dev.d_ifdown = enc_ifdown; /* I/F up (new IP address) callback */
|
||||
priv->dev.d_txavail = enc_txavail; /* New TX data callback */
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
priv->dev.d_addmac = enc_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = enc_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
priv->dev.d_private = priv; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
|
||||
@@ -130,6 +130,10 @@ static void skel_txtimeout(int argc, uint32_t arg, ...);
|
||||
static int skel_ifup(struct uip_driver_s *dev);
|
||||
static int skel_ifdown(struct uip_driver_s *dev);
|
||||
static int skel_txavail(struct uip_driver_s *dev);
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int skel_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac);
|
||||
static int skel_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@@ -542,6 +546,64 @@ static int skel_txavail(struct uip_driver_s *dev)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: skel_addmac
|
||||
*
|
||||
* Description:
|
||||
* NuttX Callback: Add the specified MAC address to the hardware multicast
|
||||
* address filtering
|
||||
*
|
||||
* Parameters:
|
||||
* dev - Reference to the NuttX driver state structure
|
||||
* mac - The MAC address to be added
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int skel_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
|
||||
{
|
||||
FAR struct skel_driver_s *skel = (FAR struct skel_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: skel_rmmac
|
||||
*
|
||||
* Description:
|
||||
* NuttX Callback: Remove the specified MAC address from the hardware multicast
|
||||
* address filtering
|
||||
*
|
||||
* Parameters:
|
||||
* dev - Reference to the NuttX driver state structure
|
||||
* mac - The MAC address to be removed
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int skel_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
|
||||
{
|
||||
FAR struct skel_driver_s *skel = (FAR struct skel_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -583,6 +645,10 @@ int skel_initialize(void)
|
||||
g_skel[0].sk_dev.d_ifup = skel_ifup; /* I/F down callback */
|
||||
g_skel[0].sk_dev.d_ifdown = skel_ifdown; /* I/F up (new IP address) callback */
|
||||
g_skel[0].sk_dev.d_txavail = skel_txavail; /* New TX data callback */
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
g_skel[0].sk_dev.d_addmac = skel_addmac; /* Add multicast MAC address */
|
||||
g_skel[0].sk_dev.d_rmmac = skel_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
g_skel[0].sk_dev.d_private = (void*)g_skel; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
|
||||
Reference in New Issue
Block a user