summaryrefslogtreecommitdiff
path: root/nuttx/drivers/net/dm90x0.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-20 15:14:29 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-20 15:14:29 -0600
commite1d8c89b89c93e5ff71f276c6ec7035a80766a09 (patch)
treebe6ffa4cb6f6c31e6122160effdff06155b5bb62 /nuttx/drivers/net/dm90x0.c
parent8f957faf84b9aa8de2881361e116943b78ec2dd4 (diff)
downloadpx4-nuttx-e1d8c89b89c93e5ff71f276c6ec7035a80766a09.tar.gz
px4-nuttx-e1d8c89b89c93e5ff71f276c6ec7035a80766a09.tar.bz2
px4-nuttx-e1d8c89b89c93e5ff71f276c6ec7035a80766a09.zip
Networking: Add missing raw/packet socket support to all Ethernet drivers
Diffstat (limited to 'nuttx/drivers/net/dm90x0.c')
-rw-r--r--nuttx/drivers/net/dm90x0.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/nuttx/drivers/net/dm90x0.c b/nuttx/drivers/net/dm90x0.c
index 1b2afdbb3..729cc3baa 100644
--- a/nuttx/drivers/net/dm90x0.c
+++ b/nuttx/drivers/net/dm90x0.c
@@ -68,6 +68,10 @@
#include <nuttx/net/arp.h>
#include <nuttx/net/netdev.h>
+#ifdef CONFIG_NET_PKT
+# include <nuttx/net/pkt.h>
+#endif
+
/****************************************************************************
* Definitions
****************************************************************************/
@@ -978,6 +982,12 @@ static void dm9x_receive(struct dm9x_driver_s *dm9x)
dm9x->dm_dev.d_len = rx.desc.rx_len;
dm9x->dm_read(dm9x->dm_dev.d_buf, rx.desc.rx_len);
+#ifdef CONFIG_NET_PKT
+ /* When packet sockets are enabled, feed the frame into the packet tap */
+
+ pkt_input(&dm9x->dm_dev);
+#endif
+
/* We only accept IP packets of the configured type and ARP packets */
#ifdef CONFIG_NET_IPv4
@@ -1001,7 +1011,7 @@ static void dm9x_receive(struct dm9x_driver_s *dm9x)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
- if (BUF->type == HTONS(ETHTYPE_IP))
+ if (IFF_IS_IPv4(dm9x->dm_dev.d_flags))
#endif
{
arp_out(&dm9x->dm_dev);
@@ -1032,7 +1042,7 @@ static void dm9x_receive(struct dm9x_driver_s *dm9x)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
- if (BUF->type == HTONS(ETHTYPE_IP))
+ if (IFF_IS_IPv4(dm9x->dm_dev.d_flags))
{
arp_out(&dm9x->dm_dev);
}