diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index b7563aa054..62fe06eb0f 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -279,6 +279,10 @@ * Private Types ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + /* The c5471_driver_s encapsulates all state information for a single c5471 * hardware interface */ @@ -2248,6 +2252,7 @@ void up_netinitialize(void) /* Initialize the driver structure */ memset(g_c5471, 0, CONFIG_C5471_NET_NINTERFACES*sizeof(struct c5471_driver_s)); + g_c5471[0].c_dev.d_buf = g_pktbuf; /* Single packet buffer */ g_c5471[0].c_dev.d_ifup = c5471_ifup; /* I/F down callback */ g_c5471[0].c_dev.d_ifdown = c5471_ifdown; /* I/F up (new IP address) callback */ g_c5471[0].c_dev.d_txavail = c5471_txavail; /* New TX data callback */ diff --git a/arch/arm/src/kinetis/Kconfig b/arch/arm/src/kinetis/Kconfig index cf781ade5e..a585a57fe4 100644 --- a/arch/arm/src/kinetis/Kconfig +++ b/arch/arm/src/kinetis/Kconfig @@ -254,7 +254,6 @@ config KINETIS_ENET select ARCH_HAVE_NETDEV_STATISTICS select NET select NETDEVICES - select NET_MULTIBUFFER ---help--- Support Ethernet (K6x only) diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index a546103d36..e83c3fcc94 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -119,10 +119,6 @@ #define NENET_NBUFFERS \ (CONFIG_KINETIS_ENETNTXBUFFERS+CONFIG_KINETIS_ENETNRXBUFFERS) -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER is required in the configuration" -#endif - /* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per * second. */ diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index d5ff009fd6..150602b1e5 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -138,6 +138,8 @@ # define CONFIG_NET_PRIORITY NVIC_SYSH_PRIORITY_DEFAULT #endif +#define PKTBUF_SIZE (MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE) + /* Debug Configuration *****************************************************/ /* Register debug -- can only happen of CONFIG_DEBUG_NET_INFO is selected */ @@ -290,6 +292,10 @@ struct lpc17_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer per interface is used */ + +static uint8_t g_pktbuf[PKTBUF_SIZE * CONFIG_LPC17_NINTERFACES]; + /* Array of ethernet driver status structures */ static struct lpc17_driver_s g_ethdrvr[CONFIG_LPC17_NINTERFACES]; @@ -3206,6 +3212,7 @@ static inline int lpc17_ethinitialize(int intf) #endif { struct lpc17_driver_s *priv; + uint8_t *pktbuf; uint32_t regval; int ret; int i; @@ -3225,11 +3232,17 @@ static inline int lpc17_ethinitialize(int intf) { (void)lpc17_configgpio(g_enetpins[i]); } + lpc17_showpins(); + /* Select the packet buffer */ + + pktbuf = &g_pktbuf[PKTBUF_SIZE * intf]; + /* Initialize the driver structure */ memset(priv, 0, sizeof(struct lpc17_driver_s)); + priv->lp_dev.d_buf = pktbuf; /* Single packet buffer */ priv->lp_dev.d_ifup = lpc17_ifup; /* I/F down callback */ priv->lp_dev.d_ifdown = lpc17_ifdown; /* I/F up (new IP address) callback */ priv->lp_dev.d_txavail = lpc17_txavail; /* New TX data callback */ @@ -3237,7 +3250,7 @@ static inline int lpc17_ethinitialize(int intf) priv->lp_dev.d_addmac = lpc17_addmac; /* Add multicast MAC address */ priv->lp_dev.d_rmmac = lpc17_rmmac; /* Remove multicast MAC address */ #endif - priv->lp_dev.d_private = (void *)priv; /* Used to recover private state from dev */ + priv->lp_dev.d_private = (void *)priv; /* Used to recover private state from dev */ #if CONFIG_LPC17_NINTERFACES > 1 # error "A mechanism to associate base address an IRQ with an interface is needed" diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index c96f1a7551..35d9926b52 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -164,12 +164,6 @@ #undef CONFIG_LPC43_ETH_ENHANCEDDESC #undef CONFIG_LPC43_ETH_HWCHECKSUM -/* Ethernet buffer sizes, number of buffers, and number of descriptors */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER is required" -#endif - /* Add 4 to the configured buffer size to account for the 2 byte checksum * memory needed at the end of the maximum size packet. Buffer sizes must * be an even multiple of 4, 8, or 16 bytes (depending on buswidth). We diff --git a/arch/arm/src/sam34/sam_emac.c b/arch/arm/src/sam34/sam_emac.c index 15e7b1b4ba..6f234cebcb 100644 --- a/arch/arm/src/sam34/sam_emac.c +++ b/arch/arm/src/sam34/sam_emac.c @@ -313,7 +313,6 @@ struct sam_emac_s static struct sam_emac_s g_emac; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -324,7 +323,6 @@ static struct sam_emac_s g_emac; */ static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif #ifdef CONFIG_SAM34_EMAC_PREALLOCATE /* Preallocated data */ @@ -3820,9 +3818,7 @@ void up_netinitialize(void) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct sam_emac_s)); -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index 672a3efc7f..67715ee204 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -290,7 +290,6 @@ struct sam_emac_s static struct sam_emac_s g_emac; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -301,7 +300,6 @@ static struct sam_emac_s g_emac; */ static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif #ifdef CONFIG_SAMA5_EMACA_PREALLOCATE /* Preallocated data */ @@ -3486,9 +3484,7 @@ int sam_emac_initialize(void) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct sam_emac_s)); -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 3d9f282ce9..6eb3dd2108 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -710,7 +710,6 @@ static const struct sam_emacattr_s g_emac0_attr = #endif }; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -721,7 +720,6 @@ static const struct sam_emacattr_s g_emac0_attr = */ static uint8_t g_pktbuf0[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* EMAC0 peripheral state */ @@ -793,7 +791,6 @@ static const struct sam_emacattr_s g_emac1_attr = #endif }; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -804,7 +801,6 @@ static const struct sam_emacattr_s g_emac1_attr = */ static uint8_t g_pktbuf1[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* EMAC1 peripheral state */ @@ -4546,9 +4542,7 @@ int sam_emac_initialize(int intf) { struct sam_emac_s *priv; const struct sam_emacattr_s *attr; -#ifdef CONFIG_NET_MULTIBUFFER uint8_t *pktbuf; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) uint8_t phytype; #endif @@ -4559,10 +4553,7 @@ int sam_emac_initialize(int intf) { priv = &g_emac0; attr = &g_emac0_attr; - -#ifdef CONFIG_NET_MULTIBUFFER pktbuf = g_pktbuf0; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) phytype = SAMA5_EMAC0_PHY_TYPE; @@ -4575,10 +4566,7 @@ int sam_emac_initialize(int intf) { priv = &g_emac1; attr = &g_emac1_attr; - -#ifdef CONFIG_NET_MULTIBUFFER pktbuf = g_pktbuf1; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) phytype = SAMA5_EMAC1_PHY_TYPE; @@ -4595,9 +4583,7 @@ int sam_emac_initialize(int intf) memset(priv, 0, sizeof(struct sam_emac_s)); priv->attr = attr; /* Save the constant attributes */ -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index 5442920ee0..d264282117 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -216,7 +216,6 @@ struct sam_gmac_s static struct sam_gmac_s g_gmac; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -227,7 +226,6 @@ static struct sam_gmac_s g_gmac; */ static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif #ifdef CONFIG_SAMA5_GMAC_PREALLOCATE /* Preallocated data */ @@ -3558,9 +3556,7 @@ int sam_gmac_initialize(void) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct sam_gmac_s)); -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index 2eefdcefa7..8c9c9e0827 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -856,7 +856,6 @@ static const struct sam_emacattr_s g_emac0_attr = #endif }; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -867,7 +866,6 @@ static const struct sam_emacattr_s g_emac0_attr = */ static uint8_t g_pktbuf0[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* EMAC0 peripheral state */ @@ -939,7 +937,6 @@ static const struct sam_emacattr_s g_emac1_attr = #endif }; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -950,7 +947,6 @@ static const struct sam_emacattr_s g_emac1_attr = */ static uint8_t g_pktbuf1[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* EMAC1 peripheral state */ @@ -5112,9 +5108,7 @@ int sam_emac_initialize(int intf) { struct sam_emac_s *priv; const struct sam_emacattr_s *attr; -#ifdef CONFIG_NET_MULTIBUFFER uint8_t *pktbuf; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) uint8_t phytype; #endif @@ -5125,10 +5119,7 @@ int sam_emac_initialize(int intf) { priv = &g_emac0; attr = &g_emac0_attr; - -#ifdef CONFIG_NET_MULTIBUFFER pktbuf = g_pktbuf0; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) phytype = SAMV7_EMAC0_PHY_TYPE; @@ -5141,10 +5132,7 @@ int sam_emac_initialize(int intf) { priv = &g_emac1; attr = &g_emac1_attr; - -#ifdef CONFIG_NET_MULTIBUFFER pktbuf = g_pktbuf1; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) phytype = SAMV7_EMAC1_PHY_TYPE; @@ -5161,9 +5149,7 @@ int sam_emac_initialize(int intf) memset(priv, 0, sizeof(struct sam_emac_s)); priv->attr = attr; /* Save the constant attributes */ -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 635940ac95..8bb121237a 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -207,12 +207,6 @@ #undef CONFIG_STM32_ETH_ENHANCEDDESC #undef CONFIG_STM32_ETH_HWCHECKSUM -/* Ethernet buffer sizes, number of buffers, and number of descriptors */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER is required" -#endif - /* Add 4 to the configured buffer size to account for the 2 byte checksum * memory needed at the end of the maximum size packet. Buffer sizes must * be an even multiple of 4, 8, or 16 bytes (depending on buswidth). We diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index eccf15b348..8301f80e5b 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -194,12 +194,6 @@ #undef CONFIG_STM32F7_ETH_ENHANCEDDESC #undef CONFIG_STM32F7_ETH_HWCHECKSUM -/* Ethernet buffer sizes, number of buffers, and number of descriptors */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER is required" -#endif - /* Add 4 to the configured buffer size to account for the 2 byte checksum * memory needed at the end of the maximum size packet. Buffer sizes must * be an even multiple of 4, 8, or 16 bytes (depending on buswidth). We diff --git a/arch/arm/src/tiva/lm3s_ethernet.c b/arch/arm/src/tiva/lm3s_ethernet.c index cbdf0dac53..852c19a0d3 100644 --- a/arch/arm/src/tiva/lm3s_ethernet.c +++ b/arch/arm/src/tiva/lm3s_ethernet.c @@ -191,11 +191,9 @@ struct tiva_driver_s * Private Data ****************************************************************************/ -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used */ static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* Ethernet peripheral state */ @@ -1472,9 +1470,7 @@ static inline int tiva_ethinitialize(int intf) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct tiva_driver_s)); -#ifdef CONFIG_NET_MULTIBUFFER priv->ld_dev.d_buf = g_pktbuf; /* Single packet buffer */ -#endif priv->ld_dev.d_ifup = tiva_ifup; /* I/F down callback */ priv->ld_dev.d_ifdown = tiva_ifdown; /* I/F up (new IP address) callback */ priv->ld_dev.d_txavail = tiva_txavail; /* New TX data callback */ diff --git a/arch/arm/src/tiva/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c_ethernet.c index 3882a95db3..e00bf6ef31 100644 --- a/arch/arm/src/tiva/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c_ethernet.c @@ -219,10 +219,6 @@ /* Ethernet buffer sizes, number of buffers, and number of descriptors */ -#ifndef CONFIG_NET_MULTIBUFFER -# error CONFIG_NET_MULTIBUFFER is required -#endif - #ifndef CONFIG_TIVA_EMAC_NRXDESC # define CONFIG_TIVA_EMAC_NRXDESC 8 #endif diff --git a/arch/hc/src/m9s12/m9s12_ethernet.c b/arch/hc/src/m9s12/m9s12_ethernet.c index fe2656e97a..3a85446e6d 100644 --- a/arch/hc/src/m9s12/m9s12_ethernet.c +++ b/arch/hc/src/m9s12/m9s12_ethernet.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/hc/src/m9s12/m9s12_ethernet.c * - * Copyright (C) 2011, 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -106,6 +106,12 @@ struct emac_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Driver state structure */ + static struct emac_driver_s g_emac[CONFIG_HCS12_NINTERFACES]; /**************************************************************************** @@ -756,6 +762,7 @@ int emac_initialize(int intf) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct emac_driver_s)); + priv->d_dev.d_buf = g_pktbuf; /* Single packet buffer */ priv->d_dev.d_ifup = emac_ifup; /* I/F down callback */ priv->d_dev.d_ifdown = emac_ifdown; /* I/F up (new IP address) callback */ priv->d_dev.d_txavail = emac_txavail; /* New TX data callback */ @@ -767,8 +774,8 @@ int emac_initialize(int intf) /* Create a watchdog for timing polling for and timing of transmisstions */ - priv->d_txpoll = wd_create(); /* Create periodic poll timer */ - priv->d_txtimeout = wd_create(); /* Create TX timeout timer */ + priv->d_txpoll = wd_create(); /* Create periodic poll timer */ + priv->d_txtimeout = wd_create(); /* Create TX timeout timer */ /* Put the interface in the down state. This usually amounts to resetting * the device and/or calling emac_ifdown(). diff --git a/arch/mips/src/pic32mx/pic32mx-ethernet.c b/arch/mips/src/pic32mx/pic32mx-ethernet.c index 8a1bc08482..1b1ebcb6fc 100644 --- a/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -102,12 +102,6 @@ # define CONFIG_PIC32MX_NINTERFACES 1 #endif -/* CONFIG_NET_MULTIBUFFER is required */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER=y is required" -#endif - /* If IGMP is enabled, then accept multi-cast frames. */ #if defined(CONFIG_NET_IGMP) && !defined(CONFIG_PIC32MX_MULTICAST) diff --git a/arch/mips/src/pic32mz/pic32mz-ethernet.c b/arch/mips/src/pic32mz/pic32mz-ethernet.c index b2df365449..fe245e5a74 100644 --- a/arch/mips/src/pic32mz/pic32mz-ethernet.c +++ b/arch/mips/src/pic32mz/pic32mz-ethernet.c @@ -102,12 +102,6 @@ # define CONFIG_PIC32MZ_NINTERFACES 1 #endif -/* CONFIG_NET_MULTIBUFFER is required */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER=y is required" -#endif - /* If IGMP is enabled, then accept multi-cast frames. */ #if defined(CONFIG_NET_IGMP) && !defined(CONFIG_PIC32MZ_MULTICAST) diff --git a/arch/misoc/src/common/misoc_net.c b/arch/misoc/src/common/misoc_net.c index 7b4b84c2f0..8854616266 100644 --- a/arch/misoc/src/common/misoc_net.c +++ b/arch/misoc/src/common/misoc_net.c @@ -140,6 +140,12 @@ struct misoc_net_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Driver state structur */ + static struct misoc_net_driver_s g_misoc_net[CONFIG_MISOC_NET_NINTERFACES]; /**************************************************************************** @@ -1333,6 +1339,7 @@ int misoc_net_initialize(int intf) priv->tx_buf = priv->tx0_buf; priv->tx_slot=0; + priv->misoc_net_dev.d_buf = g_pktbuf; /* Single packet buffer */ priv->misoc_net_dev.d_ifup = misoc_net_ifup; /* I/F up (new IP address) callback */ priv->misoc_net_dev.d_ifdown = misoc_net_ifdown; /* I/F down callback */ priv->misoc_net_dev.d_txavail = misoc_net_txavail; /* New TX data callback */ diff --git a/arch/sim/src/up_netdriver.c b/arch/sim/src/up_netdriver.c index 1e7ef5345c..d9c12ae339 100644 --- a/arch/sim/src/up_netdriver.c +++ b/arch/sim/src/up_netdriver.c @@ -78,15 +78,18 @@ struct timer uint32_t start; }; -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ static struct timer g_periodic_timer; + +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Ethernet peripheral state */ + static struct net_driver_s g_sim_dev; /**************************************************************************** @@ -340,6 +343,7 @@ int netdriver_init(void) /* Set callbacks */ + g_sim_dev.d_buf = g_pktbuf; /* Single packet buffer */ g_sim_dev.d_ifup = netdriver_ifup; g_sim_dev.d_ifdown = netdriver_ifdown; diff --git a/arch/z80/src/ez80/ez80_emac.c b/arch/z80/src/ez80/ez80_emac.c index d4e56bf04f..0020991551 100644 --- a/arch/z80/src/ez80/ez80_emac.c +++ b/arch/z80/src/ez80/ez80_emac.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/ez80/ez80_emac.c * - * Copyright (C) 2009-2010, 2012, 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2012, 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: @@ -334,6 +334,10 @@ struct ez80emac_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + /* There is only a single instance of driver private data (because there is * only one EMAC interface. */ @@ -2224,6 +2228,7 @@ int up_netinitialize(void) /* Initialize the driver structure */ memset(&g_emac, 0, sizeof(struct ez80emac_driver_s)); + priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ priv->dev.d_ifup = ez80emac_ifup; /* I/F down callback */ priv->dev.d_ifdown = ez80emac_ifdown; /* I/F up (new IP address) callback */ priv->dev.d_txavail = ez80emac_txavail; /* New TX data callback */