diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-12-11 14:28:16 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-12-11 14:28:16 +0000 |
commit | 5aa10a765807c59b4ba7e8bc546723125992eacc (patch) | |
tree | 37f83fc854c9a8e5330849b89cda2bf06ce76edf /nuttx | |
parent | b01a17e3235e9cbe98a11ff3095e6792b8e6eb9c (diff) | |
download | px4-nuttx-5aa10a765807c59b4ba7e8bc546723125992eacc.tar.gz px4-nuttx-5aa10a765807c59b4ba7e8bc546723125992eacc.tar.bz2 px4-nuttx-5aa10a765807c59b4ba7e8bc546723125992eacc.zip |
Moved MAC and ethernet definitions to include/net/ethernet.h
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@443 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/ChangeLog | 5 | ||||
-rw-r--r-- | nuttx/Documentation/NuttX.html | 9 | ||||
-rw-r--r-- | nuttx/arch/arm/src/c5471/c5471_ethernet.c | 3 | ||||
-rw-r--r-- | nuttx/arch/sim/src/up_uipdriver.c | 7 | ||||
-rw-r--r-- | nuttx/configs/README.txt | 8 | ||||
-rw-r--r-- | nuttx/drivers/net/dm90x0.c | 5 | ||||
-rw-r--r-- | nuttx/drivers/net/skeleton.c | 2 | ||||
-rw-r--r-- | nuttx/include/net/ethernet.h | 71 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-arch.h | 3 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-arp.h | 3 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip.h | 7 | ||||
-rw-r--r-- | nuttx/net/netdev-ioctl.c | 5 | ||||
-rw-r--r-- | nuttx/net/netdev-register.c | 6 | ||||
-rw-r--r-- | nuttx/net/uip/uip-arp.c | 38 | ||||
-rw-r--r-- | nuttx/net/uip/uip-neighbor.c | 14 | ||||
-rw-r--r-- | nuttx/net/uip/uip-neighbor.h | 3 |
16 files changed, 137 insertions, 52 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index a270f8252..53bc8b4b3 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -272,3 +272,8 @@ * Found and fixed several problems in uIP when compiled for ARM with optimization. 0.3.5 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> + + * Added inet_ntoa() and ether_ntoa() + * Added netdev_foreach() to support traversal of registered network devices + * Added support for 'ifconfig' command to NSH (examples/nsh) + * Moved MAC and ethernet definitions to net/ethernet.h diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 8edba79e9..39a9bd32f 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -8,7 +8,7 @@ <tr align="center" bgcolor="#e4e4e4"> <td> <h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1> - <p>Last Updated: December 10, 2007</p> + <p>Last Updated: December 11, 2007</p> </td> </tr> </table> @@ -471,7 +471,7 @@ <td><br></td> <td> <p> - <b>TI TMS320C5471</b> (also called a <b>C5471</b> or <b>TMS320DM180</b>). + <b>TI TMS320C5471</b> (also called <b>C5471</b> or <b>TMS320DA180</b> or <b>DA180</a>). NuttX operates on the ARM7 of this dual core processor. This port uses the <a href="http://www.spectrumdigital.com/">Spectrum Digital</a> evaluation board with a GNU arm-elf toolchain*. @@ -966,6 +966,11 @@ Other memory: <pre><ul> 0.3.5 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> + + * Added inet_ntoa() and ether_ntoa() + * Added netdev_foreach() to support traversal of registered network devices + * Added support for 'ifconfig' command to NSH (examples/nsh) + * Moved MAC and ethernet definitions to net/ethernet.h </pre></ul> <table width ="100%"> diff --git a/nuttx/arch/arm/src/c5471/c5471_ethernet.c b/nuttx/arch/arm/src/c5471/c5471_ethernet.c index a36b51908..76a565fcd 100644 --- a/nuttx/arch/arm/src/c5471/c5471_ethernet.c +++ b/nuttx/arch/arm/src/c5471/c5471_ethernet.c @@ -57,6 +57,7 @@ #include <nuttx/irq.h> #include <nuttx/arch.h> +#include <net/ethernet.h> #include <net/uip/uip.h> #include <net/uip/uip-arp.h> #include <net/uip/uip-arch.h> @@ -2054,7 +2055,7 @@ static void c5471_reset(struct c5471_driver_s *c5471) static void c5471_macassign(struct c5471_driver_s *c5471) { struct uip_driver_s *dev = &c5471->c_dev; - uint8 *mptr = dev->d_mac.addr; + uint8 *mptr = dev->d_mac.ether_addr_octet; register uint32 tmp; ndbg("MAC: %0x:%0x:%0x:%0x:%0x:%0x\n", diff --git a/nuttx/arch/sim/src/up_uipdriver.c b/nuttx/arch/sim/src/up_uipdriver.c index dbc78f9c0..d5d2ecbfc 100644 --- a/nuttx/arch/sim/src/up_uipdriver.c +++ b/nuttx/arch/sim/src/up_uipdriver.c @@ -50,6 +50,7 @@ #include <sched.h> #include <nuttx/net.h> +#include <net/ethernet.h> #include <net/uip/uip.h> #include <net/uip/uip-arch.h> #include <net/uip/uip-arp.h> @@ -106,9 +107,9 @@ void timer_reset(struct timer *t) #ifdef CONFIG_NET_PROMISCUOUS # define up_comparemac(a,b) (0) #else -static inline int up_comparemac(struct uip_eth_addr *paddr1, struct uip_eth_addr *paddr2) +static inline int up_comparemac(struct ether_addr *paddr1, struct ether_addr *paddr2) { - return memcmp(paddr1, paddr2, sizeof(struct uip_eth_addr)); + return memcmp(paddr1, paddr2, sizeof(struct ether_addr)); } #endif @@ -212,7 +213,7 @@ int uipdriver_init(void) timer_set(&g_periodic_timer, 500); tapdev_init(); - (void)tapdev_getmacaddr(g_sim_dev.d_mac.addr); + (void)tapdev_getmacaddr(g_sim_dev.d_mac.ether_addr_octet); /* Register the device with the OS so that socket IOCTLs can be performed */ diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index 88f6291b6..23ac94036 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -283,10 +283,10 @@ configs/sim configs/c5471evm This is a port to the Spectrum Digital C5471 evaluation board. The - C5471 is a dual core processor from TI with an ARM7TDMI general purpose - processor and a c54 SDP. NuttX runs on the ARM core and is built with - with a GNU arm-elf toolchain*. This port is complete, verified, and - included in the NuttX release. + TMS320C5471 is a dual core processor from TI with an ARM7TDMI general + purpose processor and a c54 DSP. It is also known as TMS320DA180 or just DA180. + NuttX runs on the ARM core and is built with with a GNU arm-elf toolchain*. + This port is complete, verified, and included in the NuttX release. configs/mcu123-lpc214x This is a port to the mcu123.com lpc214x development board. diff --git a/nuttx/drivers/net/dm90x0.c b/nuttx/drivers/net/dm90x0.c index 676fb3b89..3fbb0f1f4 100644 --- a/nuttx/drivers/net/dm90x0.c +++ b/nuttx/drivers/net/dm90x0.c @@ -61,6 +61,7 @@ #include <nuttx/irq.h> #include <nuttx/arch.h> +#include <net/ethernet.h> #include <net/uip/uip.h> #include <net/uip/uip-arp.h> #include <net/uip/uip-arch.h> @@ -1725,8 +1726,8 @@ int dm9x_initialize(void) /* Read the MAC address */ - mptr = g_dm9x[0].dm_dev.d_mac.addr; - for (i = 0, j = DM9X_PAB0; i < 6; i++, j++) + mptr = g_dm9x[0].dm_dev.d_mac.ether_addr_octet; + for (i = 0, j = DM9X_PAB0; i < ETHER_ADDR_LEN; i++, j++) { mptr[i] = getreg(j); } diff --git a/nuttx/drivers/net/skeleton.c b/nuttx/drivers/net/skeleton.c index 7dfb0f95a..1108a9405 100644 --- a/nuttx/drivers/net/skeleton.c +++ b/nuttx/drivers/net/skeleton.c @@ -581,7 +581,7 @@ int skel_initialize(void) g_skel[0].sk_txpoll = wd_create(); /* Create periodic poll timer */ g_skel[0].sk_txtimeout = wd_create(); /* Create TX timeout timer */ - /* Read the MAC address from the hardware into g_skel[0].sk_dev.d_mac.addr */ + /* Read the MAC address from the hardware into g_skel[0].sk_dev.d_mac.ether_addr_octet */ /* Register the device with the OS so that socket IOCTLs can be performed */ diff --git a/nuttx/include/net/ethernet.h b/nuttx/include/net/ethernet.h new file mode 100644 index 000000000..116f1c516 --- /dev/null +++ b/nuttx/include/net/ethernet.h @@ -0,0 +1,71 @@ +/**************************************************************************** + * net/ethernet.h + * + * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __NET_ETHERNET_H +#define __NET_ETHERNET_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <sys/types.h> + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +#define ETHER_ADDR_LEN 6 + +/**************************************************************************** + * Type Definitions + ****************************************************************************/ + +struct ether_addr +{ + uint8 ether_addr_octet[6]; /* 48-bit Ethernet address */ +}; + +struct ether_header +{ + uint8 ether_dhost[ETHER_ADDR_LEN]; /* Destination Ethernet address */ + uint8 ether_shost[ETHER_ADDR_LEN]; /* Source Ethernet address */ + uint16 ether_type; /* Ethernet packet type*/ +}; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#endif /* __NET_ETHERNET_H */ diff --git a/nuttx/include/net/uip/uip-arch.h b/nuttx/include/net/uip/uip-arch.h index 9de911e00..1f96f2d10 100644 --- a/nuttx/include/net/uip/uip-arch.h +++ b/nuttx/include/net/uip/uip-arch.h @@ -53,6 +53,7 @@ ****************************************************************************/ #include <net/uip/uipopt.h> +#include <net/ethernet.h> /**************************************************************************** * Definitions @@ -86,7 +87,7 @@ struct uip_driver_s /* Device identitity */ - struct uip_eth_addr d_mac; /* Device MAC address */ + struct ether_addr d_mac; /* Device MAC address */ /* Network identity */ diff --git a/nuttx/include/net/uip/uip-arp.h b/nuttx/include/net/uip/uip-arp.h index f45ae074c..52f742508 100644 --- a/nuttx/include/net/uip/uip-arp.h +++ b/nuttx/include/net/uip/uip-arp.h @@ -36,10 +36,11 @@ #include <sys/types.h> #include <nuttx/compiler.h> +#include <net/ethernet.h> #include <net/uip/uip.h> /* The Ethernet header -- 14 bytes. The first two fields are type 'struct - * uip_eth_addr but are represented as a simple byte array here because + * ether_addr but are represented as a simple byte array here because * some compilers refuse to pack 6 byte structures. */ diff --git a/nuttx/include/net/uip/uip.h b/nuttx/include/net/uip/uip.h index e42460a2a..7a78226c9 100644 --- a/nuttx/include/net/uip/uip.h +++ b/nuttx/include/net/uip/uip.h @@ -210,13 +210,6 @@ struct uip_stats }; #endif /* CONFIG_NET_STATISTICS */ -/* Representation of a 48-bit Ethernet address */ - -struct uip_eth_addr -{ - uint8 addr[6]; -}; - /**************************************************************************** * Public Data ****************************************************************************/ diff --git a/nuttx/net/netdev-ioctl.c b/nuttx/net/netdev-ioctl.c index 81cfce689..00ddd6e31 100644 --- a/nuttx/net/netdev-ioctl.c +++ b/nuttx/net/netdev-ioctl.c @@ -51,6 +51,7 @@ #include <nuttx/net.h> #include <net/if.h> +#include <net/ethernet.h> #include <net/uip/uip-arch.h> #include <net/uip/uip.h> @@ -221,12 +222,12 @@ int netdev_ioctl(int sockfd, int cmd, struct ifreq *req) case SIOCGIFHWADDR: /* Get hardware address */ req->ifr_hwaddr.sa_family = AF_INETX; - memcpy(req->ifr_hwaddr.sa_data, dev->d_mac.addr, IFHWADDRLEN); + memcpy(req->ifr_hwaddr.sa_data, dev->d_mac.ether_addr_octet, IFHWADDRLEN); break; case SIOCSIFHWADDR: /* Set hardware address */ req->ifr_hwaddr.sa_family = AF_INETX; - memcpy(dev->d_mac.addr, req->ifr_hwaddr.sa_data, IFHWADDRLEN); + memcpy(dev->d_mac.ether_addr_octet, req->ifr_hwaddr.sa_data, IFHWADDRLEN); break; case SIOCDIFADDR: /* Delete IP address */ diff --git a/nuttx/net/netdev-register.c b/nuttx/net/netdev-register.c index b1ab57a44..5f06b665b 100644 --- a/nuttx/net/netdev-register.c +++ b/nuttx/net/netdev-register.c @@ -50,6 +50,7 @@ #include <debug.h> #include <net/if.h> +#include <net/ethernet.h> #include <net/uip/uip-arch.h> #include "net-internal.h" @@ -143,8 +144,9 @@ int netdev_register(FAR struct uip_driver_s *dev) netdev_semgive(); nlldbg("Registered MAC: %02x:%02x:%02x:%02x:%02x:%02x as dev: %s\n", - dev->d_mac.addr[0], dev->d_mac.addr[1], dev->d_mac.addr[2], - dev->d_mac.addr[3], dev->d_mac.addr[4], dev->d_mac.addr[5], + dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1], + dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3], + dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5], dev->d_ifname); return OK; diff --git a/nuttx/net/uip/uip-arp.c b/nuttx/net/uip/uip-arp.c index 838d99b72..0c33eabfe 100644 --- a/nuttx/net/uip/uip-arp.c +++ b/nuttx/net/uip/uip-arp.c @@ -62,7 +62,7 @@ #include <debug.h> #include <netinet/in.h> -#include <net/if.h> +#include <net/ethernet.h> #include <net/uip/uip-arch.h> #include <net/uip/uip-arp.h> @@ -117,16 +117,16 @@ struct ethip_hdr struct arp_entry { - in_addr_t at_ipaddr; - struct uip_eth_addr at_ethaddr; - uint8 at_time; + in_addr_t at_ipaddr; + struct ether_addr at_ethaddr; + uint8 at_time; }; /**************************************************************************** * Private Data ****************************************************************************/ -static const struct uip_eth_addr broadcast_ethaddr = +static const struct ether_addr broadcast_ethaddr = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}; static const uint16 broadcast_ipaddr[2] = {0xffff, 0xffff}; @@ -186,7 +186,7 @@ static void uip_arp_update(uint16 *pipaddr, uint8 *ethaddr) if (uip_ipaddr_cmp(ipaddr, tabptr->at_ipaddr)) { /* An old entry found, update this and return. */ - memcpy(tabptr->at_ethaddr.addr, ethaddr, IFHWADDRLEN); + memcpy(tabptr->at_ethaddr.ether_addr_octet, ethaddr, ETHER_ADDR_LEN); tabptr->at_time = g_arptime; return; @@ -234,7 +234,7 @@ static void uip_arp_update(uint16 *pipaddr, uint8 *ethaddr) */ tabptr->at_ipaddr = ipaddr; - memcpy(tabptr->at_ethaddr.addr, ethaddr, IFHWADDRLEN); + memcpy(tabptr->at_ethaddr.ether_addr_octet, ethaddr, ETHER_ADDR_LEN); tabptr->at_time = g_arptime; } @@ -327,10 +327,10 @@ void uip_arp_arpin(struct uip_driver_s *dev) ARPBUF->ah_opcode = HTONS(2); - memcpy(ARPBUF->ah_dhwaddr, ARPBUF->ah_shwaddr, IFHWADDRLEN); - memcpy(ARPBUF->ah_shwaddr, dev->d_mac.addr, IFHWADDRLEN); - memcpy(ETHBUF->src, dev->d_mac.addr, IFHWADDRLEN); - memcpy(ETHBUF->dest, ARPBUF->ah_dhwaddr, IFHWADDRLEN); + memcpy(ARPBUF->ah_dhwaddr, ARPBUF->ah_shwaddr, ETHER_ADDR_LEN); + memcpy(ARPBUF->ah_shwaddr, dev->d_mac.ether_addr_octet, ETHER_ADDR_LEN); + memcpy(ETHBUF->src, dev->d_mac.ether_addr_octet, ETHER_ADDR_LEN); + memcpy(ETHBUF->dest, ARPBUF->ah_dhwaddr, ETHER_ADDR_LEN); ARPBUF->ah_dipaddr[0] = ARPBUF->ah_sipaddr[0]; ARPBUF->ah_dipaddr[1] = ARPBUF->ah_sipaddr[1]; @@ -399,7 +399,7 @@ void uip_arp_out(struct uip_driver_s *dev) if (uiphdr_ipaddr_cmp(IPBUF->eh_destipaddr, broadcast_ipaddr)) { - memcpy(ETHBUF->dest, broadcast_ethaddr.addr, IFHWADDRLEN); + memcpy(ETHBUF->dest, broadcast_ethaddr.ether_addr_octet, ETHER_ADDR_LEN); } else { @@ -439,10 +439,10 @@ void uip_arp_out(struct uip_driver_s *dev) * overwrite the IP packet with an ARP request. */ - memset(ETHBUF->dest, 0xff, IFHWADDRLEN); - memset(ARPBUF->ah_dhwaddr, 0x00, IFHWADDRLEN); - memcpy(ETHBUF->src, dev->d_mac.addr, IFHWADDRLEN); - memcpy(ARPBUF->ah_shwaddr, dev->d_mac.addr, IFHWADDRLEN); + memset(ETHBUF->dest, 0xff, ETHER_ADDR_LEN); + memset(ARPBUF->ah_dhwaddr, 0x00, ETHER_ADDR_LEN); + memcpy(ETHBUF->src, dev->d_mac.ether_addr_octet, ETHER_ADDR_LEN); + memcpy(ARPBUF->ah_shwaddr, dev->d_mac.ether_addr_octet, ETHER_ADDR_LEN); uiphdr_ipaddr_copy(ARPBUF->ah_dipaddr, &ipaddr); uiphdr_ipaddr_copy(ARPBUF->ah_sipaddr, &dev->d_ipaddr); @@ -450,7 +450,7 @@ void uip_arp_out(struct uip_driver_s *dev) ARPBUF->ah_opcode = HTONS(ARP_REQUEST); ARPBUF->ah_hwtype = HTONS(ARP_HWTYPE_ETH); ARPBUF->ah_protocol = HTONS(UIP_ETHTYPE_IP); - ARPBUF->ah_hwlen = IFHWADDRLEN; + ARPBUF->ah_hwlen = ETHER_ADDR_LEN; ARPBUF->ah_protolen = 4; uip_arp_dump(ARPBUF); @@ -461,12 +461,12 @@ void uip_arp_out(struct uip_driver_s *dev) /* Build an ethernet header. */ - memcpy(ETHBUF->dest, tabptr->at_ethaddr.addr, IFHWADDRLEN); + memcpy(ETHBUF->dest, tabptr->at_ethaddr.ether_addr_octet, ETHER_ADDR_LEN); } /* Finish populating the ethernet header */ - memcpy(ETHBUF->src, dev->d_mac.addr, IFHWADDRLEN); + memcpy(ETHBUF->src, dev->d_mac.ether_addr_octet, ETHER_ADDR_LEN); ETHBUF->type = HTONS(UIP_ETHTYPE_IP); dev->d_len += UIP_LLH_LEN; } diff --git a/nuttx/net/uip/uip-neighbor.c b/nuttx/net/uip/uip-neighbor.c index 353fd11cf..a864178b4 100644 --- a/nuttx/net/uip/uip-neighbor.c +++ b/nuttx/net/uip/uip-neighbor.c @@ -32,11 +32,11 @@ * SUCH DAMAGE. */ -#include "uip-neighbor.h" - #include <string.h> #include <debug.h> +#include "uip-neighbor.h" + #define MAX_TIME 128 #ifdef UIP_NEIGHBOR_CONF_ENTRIES @@ -82,8 +82,9 @@ void uip_neighbor_add(uip_ipaddr_t ipaddr, struct uip_neighbor_addr *addr) uint8 oldest_time; ndbg("Add neighbor: %02x:%02x:%02x:%02x:%02x:%02x\n", - addr->addr.addr[0], addr->addr.addr[1], addr->addr.addr[2], - addr->addr.addr[3], addr->addr.addr[4], addr->addr.addr[5]); + addr->addr.ether_addr_octet[0], addr->addr.ether_addr_octet[1], + addr->addr.ether_addr_octet[2], addr->addr.ether_addr_octet[3], + addr->addr.ether_addr_octet[4], addr->addr.ether_addr_octet[5]); /* Find the first unused entry or the oldest used entry. */ @@ -150,8 +151,9 @@ struct uip_neighbor_addr *uip_neighbor_lookup(uip_ipaddr_t ipaddr) if (e != NULL) { ndbg("Lookup neighbor: %02x:%02x:%02x:%02x:%02x:%02x\n", - e->addr.addr.addr[0], e->addr.addr.addr[1], e->addr.addr.addr[2], - e->addr.addr.addr[3], e->addr.addr.addr[4], e->addr.addr.addr[5]); + e->addr.addr.ether_addr_octet[0], e->addr.addr.ether_addr_octet[1], + e->addr.addr.ether_addr_octet[2], e->addr.addr.ether_addr_octet[3], + e->addr.addr.ether_addr_octet[4], e->addr.addr.ether_addr_octet[5]); return &e->addr; } diff --git a/nuttx/net/uip/uip-neighbor.h b/nuttx/net/uip/uip-neighbor.h index 277b5f848..f939b1710 100644 --- a/nuttx/net/uip/uip-neighbor.h +++ b/nuttx/net/uip/uip-neighbor.h @@ -35,13 +35,14 @@ #define __UIP_NEIGHBOR_H__ #include <net/uip/uip.h> +#include <net/ethernet.h> struct uip_neighbor_addr { #if UIP_NEIGHBOR_CONF_ADDRTYPE UIP_NEIGHBOR_CONF_ADDRTYPE addr; #else - struct uip_eth_addr addr; + struct ether_addr addr; #endif }; |