diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index 54628c6f15..8220d606b1 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -270,7 +270,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)c5471->c_dev.d_buf) +#define BUF ((struct eth_hdr_s *)c5471->c_dev.d_buf) /**************************************************************************** * Private Types diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 51bf26ff10..6b5a7ef009 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -140,7 +140,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)priv->dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->dev.d_buf) /**************************************************************************** * Private Types diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index 31f3269957..f52ba65727 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -152,7 +152,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)priv->lp_dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->lp_dev.d_buf) /* This is the number of ethernet GPIO pins that must be configured */ diff --git a/arch/arm/src/sam34/sam_emac.c b/arch/arm/src/sam34/sam_emac.c index 31da83f29d..e5d527b074 100644 --- a/arch/arm/src/sam34/sam_emac.c +++ b/arch/arm/src/sam34/sam_emac.c @@ -243,7 +243,7 @@ * header */ -#define BUF ((struct uip_eth_hdr *)priv->dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->dev.d_buf) /**************************************************************************** * Private Types diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index 09564ddaab..77d1fc742c 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -248,7 +248,7 @@ * header */ -#define BUF ((struct uip_eth_hdr *)priv->dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->dev.d_buf) /**************************************************************************** * Private Types diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 318a61f00c..7df889bad1 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -308,7 +308,7 @@ * header */ -#define BUF ((struct uip_eth_hdr *)priv->dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->dev.d_buf) /**************************************************************************** * Private Types diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index 0818357786..f30b527261 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -174,7 +174,7 @@ * header */ -#define BUF ((struct uip_eth_hdr *)priv->dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->dev.d_buf) /**************************************************************************** * Private Types diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index f16f740760..b89086309d 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -552,7 +552,7 @@ * header */ -#define BUF ((struct uip_eth_hdr *)priv->dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->dev.d_buf) /**************************************************************************** * Private Types diff --git a/arch/arm/src/tiva/tiva_ethernet.c b/arch/arm/src/tiva/tiva_ethernet.c index b605360f62..adb9a8312e 100644 --- a/arch/arm/src/tiva/tiva_ethernet.c +++ b/arch/arm/src/tiva/tiva_ethernet.c @@ -151,7 +151,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define ETHBUF ((struct uip_eth_hdr *)priv->ld_dev.d_buf) +#define ETHBUF ((struct eth_hdr_s *)priv->ld_dev.d_buf) #define TIVA_MAX_MDCCLK 2500000 diff --git a/arch/hc/src/m9s12/m9s12_ethernet.c b/arch/hc/src/m9s12/m9s12_ethernet.c index 14e49a5714..759c2819db 100644 --- a/arch/hc/src/m9s12/m9s12_ethernet.c +++ b/arch/hc/src/m9s12/m9s12_ethernet.c @@ -78,7 +78,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)priv->d_dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->d_dev.d_buf) /**************************************************************************** * Private Types diff --git a/arch/mips/src/pic32mx/pic32mx-ethernet.c b/arch/mips/src/pic32mx/pic32mx-ethernet.c index 45ebbe599b..6288e6b527 100644 --- a/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -213,7 +213,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)priv->pd_dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->pd_dev.d_buf) /* PHYs *********************************************************************/ /* Select PHY-specific values. Add more PHYs as needed. */ diff --git a/arch/sim/src/up_wpcap.c b/arch/sim/src/up_wpcap.c index 62f0b6ad03..633789a3b7 100644 --- a/arch/sim/src/up_wpcap.c +++ b/arch/sim/src/up_wpcap.c @@ -60,7 +60,7 @@ extern int uipdriver_setmacaddr(unsigned char *macaddr); * Pre-processor Definitions ****************************************************************************/ -#define BUF ((struct uip_eth_hdr *)&uip_buf[0]) +#define BUF ((struct eth_hdr_s *)&uip_buf[0]) #ifndef CONFIG_EXAMPLES_UIP_DHCPC # define UIP_IPADDR (10 << 24 | 0 << 16 | 0 << 8 | 1) diff --git a/arch/z80/src/ez80/ez80_emac.c b/arch/z80/src/ez80/ez80_emac.c index 3967b38e72..8b343c5c00 100644 --- a/arch/z80/src/ez80/ez80_emac.c +++ b/arch/z80/src/ez80/ez80_emac.c @@ -233,7 +233,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define ETHBUF ((struct uip_eth_hdr *)priv->dev.d_buf) +#define ETHBUF ((struct eth_hdr_s *)priv->dev.d_buf) /**************************************************************************** * Private Types diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index 59a09f3947..b588f71670 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c @@ -80,7 +80,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)cs89x0->cs_dev.d_buf) +#define BUF ((struct eth_hdr_s *)cs89x0->cs_dev.d_buf) /* If there is only one CS89x0 instance, then mapping the CS89x0 IRQ to * a driver state instance is trivial. diff --git a/drivers/net/dm90x0.c b/drivers/net/dm90x0.c index 9bceaa429b..48ec70a5e0 100644 --- a/drivers/net/dm90x0.c +++ b/drivers/net/dm90x0.c @@ -270,7 +270,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)dm9x->dm_dev.d_buf) +#define BUF ((struct eth_hdr_s *)dm9x->dm_dev.d_buf) /**************************************************************************** * Private Types diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index fd4f0c940b..87f993ba3d 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -81,7 +81,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)e1000->uip_dev.d_buf) +#define BUF ((struct eth_hdr_s *)e1000->uip_dev.d_buf) /**************************************************************************** * Private Types diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index e5c4e033b1..5162194876 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -186,7 +186,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)priv->dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->dev.d_buf) /* Debug ********************************************************************/ diff --git a/drivers/net/encx24j600.c b/drivers/net/encx24j600.c index a67d7453d4..db3260e395 100644 --- a/drivers/net/encx24j600.c +++ b/drivers/net/encx24j600.c @@ -178,7 +178,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)priv->dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->dev.d_buf) /* Debug ********************************************************************/ diff --git a/drivers/net/skeleton.c b/drivers/net/skeleton.c index bbe5a96738..a8283f0fd6 100644 --- a/drivers/net/skeleton.c +++ b/drivers/net/skeleton.c @@ -78,7 +78,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)skel->sk_dev.d_buf) +#define BUF ((struct eth_hdr_s *)skel->sk_dev.d_buf) /**************************************************************************** * Private Types diff --git a/drivers/net/vnet.c b/drivers/net/vnet.c index a106c1a388..3770533b40 100644 --- a/drivers/net/vnet.c +++ b/drivers/net/vnet.c @@ -85,7 +85,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct uip_eth_hdr *)vnet->sk_dev.d_buf) +#define BUF ((struct eth_hdr_s *)vnet->sk_dev.d_buf) /**************************************************************************** * Private Types diff --git a/include/nuttx/net/arp.h b/include/nuttx/net/arp.h index 524490bb42..2a257b8bd1 100644 --- a/include/nuttx/net/arp.h +++ b/include/nuttx/net/arp.h @@ -77,7 +77,7 @@ * some compilers refuse to pack 6 byte structures. */ -struct uip_eth_hdr +struct eth_hdr_s { uint8_t dest[6]; /* Ethernet destination address (6 bytes) */ uint8_t src[6]; /* Ethernet source address (6 bytes) */ @@ -99,7 +99,8 @@ struct arp_entry #ifdef __cplusplus #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif diff --git a/include/nuttx/net/netdev.h b/include/nuttx/net/netdev.h index 7d9f6051e8..0537587381 100644 --- a/include/nuttx/net/netdev.h +++ b/include/nuttx/net/netdev.h @@ -236,7 +236,7 @@ struct uip_driver_s * Ethernet, you will need to call the uIP ARP code before calling * this function: * - * #define BUF ((struct uip_eth_hdr *)&dev->d_buf[0]) + * #define BUF ((struct eth_hdr_s *)&dev->d_buf[0]) * dev->d_len = ethernet_devicedrver_poll(); * if (dev->d_len > 0) * { diff --git a/net/arp/arp_inout.c b/net/arp/arp_inout.c index 0cf05063d7..35355063b4 100644 --- a/net/arp/arp_inout.c +++ b/net/arp/arp_inout.c @@ -80,7 +80,7 @@ #define RASIZE 4 /* Size of ROUTER ALERT */ -#define ETHBUF ((struct uip_eth_hdr *)&dev->d_buf[0]) +#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) #define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[UIP_LLH_LEN]) #define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) @@ -253,7 +253,7 @@ void arp_arpin(struct uip_driver_s *dev) if (uip_ipaddr_cmp(ipaddr, dev->d_ipaddr)) { - struct uip_eth_hdr *peth = ETHBUF; + struct eth_hdr_s *peth = ETHBUF; /* First, we register the one who made the request in our ARP * table, since it is likely that we will do more communication @@ -322,7 +322,7 @@ void arp_out(struct uip_driver_s *dev) { const struct arp_entry *tabptr = NULL; struct arp_hdr_s *parp = ARPBUF; - struct uip_eth_hdr *peth = ETHBUF; + struct eth_hdr_s *peth = ETHBUF; struct arp_iphdr_s *pip = IPBUF; in_addr_t ipaddr; in_addr_t destipaddr; diff --git a/net/pkt/pkt_conn.c b/net/pkt/pkt_conn.c index b49d4811b9..5b8ab87e8c 100644 --- a/net/pkt/pkt_conn.c +++ b/net/pkt/pkt_conn.c @@ -207,7 +207,7 @@ void uip_pktfree(struct uip_pkt_conn *conn) * ****************************************************************************/ -struct uip_pkt_conn *uip_pktactive(struct uip_eth_hdr *buf) +struct uip_pkt_conn *uip_pktactive(struct eth_hdr_s *buf) { #define uip_ethaddr_cmp(addr1, addr2) \ ((addr1[0] == addr2[0]) && (addr1[1] == addr2[1]) && \ diff --git a/net/pkt/pkt_input.c b/net/pkt/pkt_input.c index 916deb5643..6b803cb200 100644 --- a/net/pkt/pkt_input.c +++ b/net/pkt/pkt_input.c @@ -58,7 +58,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define PKTBUF ((struct uip_eth_hdr *)&dev->d_buf) +#define PKTBUF ((struct eth_hdr_s *)&dev->d_buf) /**************************************************************************** * Public Variables @@ -98,7 +98,7 @@ int uip_pktinput(struct uip_driver_s *dev) { struct uip_pkt_conn *conn; - struct uip_eth_hdr *pbuf = (struct uip_eth_hdr *)dev->d_buf; + struct eth_hdr_s *pbuf = (struct eth_hdr_s *)dev->d_buf; int ret = OK; conn = uip_pktactive(pbuf); diff --git a/net/uip/uip.h b/net/uip/uip.h index 13de26b59b..ad612d186e 100644 --- a/net/uip/uip.h +++ b/net/uip/uip.h @@ -110,7 +110,7 @@ uint16_t uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn, void uip_pktinit(void); struct uip_pkt_conn *uip_pktalloc(void); void uip_pktfree(struct uip_pkt_conn *conn); -struct uip_pkt_conn *uip_pktactive(struct uip_eth_hdr *buf); +struct uip_pkt_conn *uip_pktactive(struct eth_hdr_s *buf); struct uip_pkt_conn *uip_nextpktconn(struct uip_pkt_conn *conn); /* Defined in uip_pktcallback.c *********************************************/