diff --git a/net/Makefile b/net/Makefile index 3d9bfebda37..70d83b93844 100644 --- a/net/Makefile +++ b/net/Makefile @@ -82,15 +82,9 @@ endif # Support for operations on network devices NETDEV_ASRCS = -NETDEV_CSRCS = netdev_register.c netdev_ioctl.c net_poll.c netdev_txnotify.c \ - netdev_findbyname.c netdev_findbyaddr.c netdev_count.c \ - netdev_foreach.c netdev_unregister.c netdev_sem.c \ - netdev_carrier.c - -ifeq ($(CONFIG_NET_RXAVAIL),y) -NETDEV_CSRCS += netdev_rxnotify.c -endif +NETDEV_CSRCS = +include netdev/Make.defs include iob/Make.defs include arp/Make.defs include icmp/Make.defs diff --git a/net/arp/arp_inout.c b/net/arp/arp_inout.c index 9cb4d6b15ef..d4fb1e0f934 100644 --- a/net/arp/arp_inout.c +++ b/net/arp/arp_inout.c @@ -67,6 +67,7 @@ #include #include +#include "netdev/netdev.h" #include "route/route.h" #ifdef CONFIG_NET_ARP diff --git a/net/bind.c b/net/bind.c index 12063a97558..1d55846b11f 100644 --- a/net/bind.c +++ b/net/bind.c @@ -54,6 +54,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "tcp/tcp.h" #include "udp/udp.h" diff --git a/net/getsockname.c b/net/getsockname.c index aff79ce90ee..7d39f2cb819 100644 --- a/net/getsockname.c +++ b/net/getsockname.c @@ -51,6 +51,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #ifdef CONFIG_NET diff --git a/net/icmp/icmp_ping.c b/net/icmp/icmp_ping.c index 006086ef3d8..5e46f76ceaa 100644 --- a/net/icmp/icmp_ping.c +++ b/net/icmp/icmp_ping.c @@ -54,6 +54,7 @@ #include #include +#include "netdev/netdev.h" #include "uip/uip.h" #include "icmp/icmp.h" diff --git a/net/net.h b/net/net.h index 8ff311aaedd..c5990d491a7 100644 --- a/net/net.h +++ b/net/net.h @@ -148,12 +148,6 @@ extern "C" #define EXTERN extern #endif -/* List of registered ethernet device drivers */ - -#if CONFIG_NSOCKET_DESCRIPTORS > 0 -EXTERN struct uip_driver_s *g_netdevices; -#endif - /**************************************************************************** * Public Function Prototypes ****************************************************************************/ @@ -186,46 +180,6 @@ int net_timeo(uint32_t start_time, socktimeo_t timeo); socktimeo_t net_timeval2dsec(FAR struct timeval *tv); #endif -/* net_register.c ************************************************************/ - -#if CONFIG_NSOCKET_DESCRIPTORS > 0 -void netdev_seminit(void); -void netdev_semtake(void); -void netdev_semgive(void); -#endif - -/* net_findbyname.c **********************************************************/ - -#if CONFIG_NSOCKET_DESCRIPTORS > 0 -FAR struct uip_driver_s *netdev_findbyname(FAR const char *ifname); -#endif - -/* net_findbyaddr.c **********************************************************/ - -#if CONFIG_NSOCKET_DESCRIPTORS > 0 -FAR struct uip_driver_s *netdev_findbyaddr(const uip_ipaddr_t addr); -#endif - -/* net_txnotify.c ************************************************************/ - -#if CONFIG_NSOCKET_DESCRIPTORS > 0 -void netdev_txnotify(const uip_ipaddr_t addr); -#endif - -/* net_rxnotify.c ************************************************************/ - -#if CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET_RXAVAIL) -void netdev_rxnotify(const uip_ipaddr_t addr); -#else -# define netdev_rxnotify(addr) -#endif - -/* net_count.c ***************************************************************/ - -#if CONFIG_NSOCKET_DESCRIPTORS > 0 -int netdev_count(void); -#endif - /* send.c ********************************************************************/ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len, diff --git a/net/net_close.c b/net/net_close.c index f74a4119fce..5f5e3d7103a 100644 --- a/net/net_close.c +++ b/net/net_close.c @@ -58,6 +58,7 @@ #endif #include "net.h" +#include "netdev/netdev.h" #include "uip/uip.h" #include "pkt/pkt.h" diff --git a/net/net_initialize.c b/net/net_initialize.c index db39e90b06e..80366bc114e 100644 --- a/net/net_initialize.c +++ b/net/net_initialize.c @@ -47,6 +47,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "tcp/tcp.h" #include "udp/udp.h" #include "pkt/pkt.h" diff --git a/net/net_sendfile.c b/net/net_sendfile.c index b023b9dac36..6d6a4a7e448 100644 --- a/net/net_sendfile.c +++ b/net/net_sendfile.c @@ -62,6 +62,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "uip/uip.h" /**************************************************************************** diff --git a/net/netdev_carrier.c b/net/netdev/netdev_carrier.c similarity index 98% rename from net/netdev_carrier.c rename to net/netdev/netdev_carrier.c index d74ce46c278..07589a64a58 100644 --- a/net/netdev_carrier.c +++ b/net/netdev/netdev_carrier.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_carrier.c + * net/netdev/netdev_carrier.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Max Holtzberg @@ -53,9 +53,10 @@ #include #include "net.h" +#include "netdev/netdev.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** diff --git a/net/netdev_count.c b/net/netdev/netdev_count.c similarity index 98% rename from net/netdev_count.c rename to net/netdev/netdev_count.c index c185c142886..23aac4c99f2 100644 --- a/net/netdev_count.c +++ b/net/netdev/netdev_count.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_count.c + * net/netdev/netdev_count.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,13 +46,14 @@ #include #include "net.h" +#include "netdev/netdev.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** - * Priviate Types + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/net/netdev_findbyaddr.c b/net/netdev/netdev_findbyaddr.c similarity index 99% rename from net/netdev_findbyaddr.c rename to net/netdev/netdev_findbyaddr.c index 7915f4a8335..0abda865c55 100644 --- a/net/netdev_findbyaddr.c +++ b/net/netdev/netdev_findbyaddr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_findbyaddr.c + * net/netdev/netdev_findbyaddr.c * * Copyright (C) 2007-2009, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -48,6 +48,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "route/route.h" /**************************************************************************** diff --git a/net/netdev_findbyname.c b/net/netdev/netdev_findbyname.c similarity index 98% rename from net/netdev_findbyname.c rename to net/netdev/netdev_findbyname.c index 281fadcb72c..de351404c58 100644 --- a/net/netdev_findbyname.c +++ b/net/netdev/netdev_findbyname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_findbyname.c + * net/netdev/netdev_findbyname.c * * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,13 +46,14 @@ #include #include "net.h" +#include "netdev/netdev.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** - * Priviate Types + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/net/netdev_foreach.c b/net/netdev/netdev_foreach.c similarity index 98% rename from net/netdev_foreach.c rename to net/netdev/netdev_foreach.c index 47597d522e2..ccec0180020 100644 --- a/net/netdev_foreach.c +++ b/net/netdev/netdev_foreach.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_foreach.c + * net/netdev/netdev_foreach.c * * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -45,13 +45,14 @@ #include #include "net.h" +#include "netdev/netdev.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** - * Priviate Types + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/net/netdev_ioctl.c b/net/netdev/netdev_ioctl.c similarity index 99% rename from net/netdev_ioctl.c rename to net/netdev/netdev_ioctl.c index 1505e668feb..6d742701da3 100644 --- a/net/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_ioctl.c + * net/netdev/netdev_ioctl.c * * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -64,6 +64,7 @@ #endif #include "net.h" +#include "netdev/netdev.h" #include "route/route.h" /**************************************************************************** diff --git a/net/netdev_register.c b/net/netdev/netdev_register.c similarity index 97% rename from net/netdev_register.c rename to net/netdev/netdev_register.c index 844586f0f65..da48bf7a3ac 100644 --- a/net/netdev_register.c +++ b/net/netdev/netdev_register.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_register.c + * net/netdev/netdev_register.c * * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -53,9 +53,10 @@ #include #include "net.h" +#include "netdev/netdev.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ #ifdef CONFIG_NET_SLIP @@ -65,7 +66,7 @@ #endif /**************************************************************************** - * Priviate Types + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/net/netdev_rxnotify.c b/net/netdev/netdev_rxnotify.c similarity index 98% rename from net/netdev_rxnotify.c rename to net/netdev/netdev_rxnotify.c index 67830258dd5..1187cd0d652 100644 --- a/net/netdev_rxnotify.c +++ b/net/netdev/netdev_rxnotify.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_rxnotify.c + * net/netdev/netdev_rxnotify.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -48,13 +48,14 @@ #include #include "net.h" +#include "netdev/netdev.h" /**************************************************************************** * Definitions ****************************************************************************/ /**************************************************************************** - * Priviate Types + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/net/netdev_sem.c b/net/netdev/netdev_sem.c similarity index 99% rename from net/netdev_sem.c rename to net/netdev/netdev_sem.c index f07ad536746..cf6557999c4 100644 --- a/net/netdev_sem.c +++ b/net/netdev/netdev_sem.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_sem.c + * net/netdev/netdev_sem.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -49,6 +49,7 @@ #include #include "net.h" +#include "netdev/netdev.h" /**************************************************************************** * Definitions diff --git a/net/netdev_txnotify.c b/net/netdev/netdev_txnotify.c similarity index 98% rename from net/netdev_txnotify.c rename to net/netdev/netdev_txnotify.c index 760fe329183..d6aea425a22 100644 --- a/net/netdev_txnotify.c +++ b/net/netdev/netdev_txnotify.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_txnotify.c + * net/netdev/netdev_txnotify.c * * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -48,6 +48,7 @@ #include #include "net.h" +#include "netdev/netdev.h" /**************************************************************************** * Definitions diff --git a/net/netdev_unregister.c b/net/netdev/netdev_unregister.c similarity index 98% rename from net/netdev_unregister.c rename to net/netdev/netdev_unregister.c index e8dd7623824..35108ba9810 100644 --- a/net/netdev_unregister.c +++ b/net/netdev/netdev_unregister.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev_unregister.c + * net/netdev/netdev_unregister.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -53,6 +53,7 @@ #include #include "net.h" +#include "netdev/netdev.h" /**************************************************************************** * Definitions diff --git a/net/pkt/pkt_send.c b/net/pkt/pkt_send.c index 7dbbd83e89a..f063dc87a80 100644 --- a/net/pkt/pkt_send.c +++ b/net/pkt/pkt_send.c @@ -56,6 +56,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "uip/uip.h" #include "pkt/pkt.h" diff --git a/net/recvfrom.c b/net/recvfrom.c index 824b360e979..65f8183ab7c 100644 --- a/net/recvfrom.c +++ b/net/recvfrom.c @@ -61,6 +61,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "uip/uip.h" #include "tcp/tcp.h" #include "udp/udp.h" diff --git a/net/route/netdev_router.c b/net/route/netdev_router.c index 9074d733c17..81d091ba2ee 100644 --- a/net/route/netdev_router.c +++ b/net/route/netdev_router.c @@ -46,6 +46,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "route/route.h" #if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) diff --git a/net/sendto.c b/net/sendto.c index a38a09f25ec..b51e29874cc 100644 --- a/net/sendto.c +++ b/net/sendto.c @@ -53,6 +53,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "uip/uip.h" #include "udp/udp.h" diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index bf4c3ec6abb..37359406f27 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -69,6 +69,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "tcp/tcp.h" #include "uip/uip.h" diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index a8ffaa0af43..0736b220c14 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -57,6 +57,7 @@ #include #include "net.h" +#include "netdev/netdev.h" #include "uip/uip.h" #include "tcp/tcp.h"