summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-17 05:59:13 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-17 05:59:13 -0600
commitaf30b21775df6fcf7671b9bb798c5e2279405eac (patch)
tree27251770aa409907b946a083f12e0c6da7369c8e /nuttx
parent8ce635d3d971bb6968ca52c1194427dc8c026fdd (diff)
downloadpx4-nuttx-af30b21775df6fcf7671b9bb798c5e2279405eac.tar.gz
px4-nuttx-af30b21775df6fcf7671b9bb798c5e2279405eac.tar.bz2
px4-nuttx-af30b21775df6fcf7671b9bb798c5e2279405eac.zip
Networking: Remove field d_sndata from the device structure. It is the same as d_appdata and unnecessary
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/include/nuttx/net/netdev.h10
-rw-r--r--nuttx/net/arp/arp_poll.c2
-rw-r--r--nuttx/net/devif/devif_iobsend.c4
-rw-r--r--nuttx/net/devif/devif_pktsend.c2
-rw-r--r--nuttx/net/devif/devif_send.c2
-rw-r--r--nuttx/net/icmp/icmp_poll.c2
-rw-r--r--nuttx/net/icmpv6/icmpv6_poll.c2
-rw-r--r--nuttx/net/igmp/igmp_poll.c2
-rw-r--r--nuttx/net/pkt/pkt_input.c1
-rw-r--r--nuttx/net/pkt/pkt_poll.c2
-rw-r--r--nuttx/net/socket/net_sendfile.c2
-rw-r--r--nuttx/net/socket/sendto.c2
-rw-r--r--nuttx/net/tcp/tcp_appsend.c2
-rw-r--r--nuttx/net/tcp/tcp_input.c1
-rw-r--r--nuttx/net/tcp/tcp_poll.c2
-rw-r--r--nuttx/net/tcp/tcp_timer.c1
-rw-r--r--nuttx/net/udp/udp_input.c1
-rw-r--r--nuttx/net/udp/udp_poll.c2
18 files changed, 8 insertions, 34 deletions
diff --git a/nuttx/include/nuttx/net/netdev.h b/nuttx/include/nuttx/net/netdev.h
index e66c378d5..f6785996e 100644
--- a/nuttx/include/nuttx/net/netdev.h
+++ b/nuttx/include/nuttx/net/netdev.h
@@ -146,17 +146,11 @@ struct net_driver_s
#endif
/* d_appdata points to the location where application data can be read from
- * or written into a packet.
+ * or written to in the the packet buffer.
*/
uint8_t *d_appdata;
- /* This is a pointer into d_buf where a user application may append
- * data to be sent.
- */
-
- uint8_t *d_snddata;
-
#ifdef CONFIG_NET_TCPURGDATA
/* This pointer points to any urgent TCP data that has been received. Only
* present if compiled with support for urgent data (CONFIG_NET_TCPURGDATA).
@@ -185,7 +179,7 @@ struct net_driver_s
uint16_t d_len;
/* When d_buf contains outgoing xmit data, d_sndlen is non-zero and represents
- * the amount of application data after d_snddata
+ * the amount of application data after d_appdata
*/
uint16_t d_sndlen;
diff --git a/nuttx/net/arp/arp_poll.c b/nuttx/net/arp/arp_poll.c
index 111547b31..854fce929 100644
--- a/nuttx/net/arp/arp_poll.c
+++ b/nuttx/net/arp/arp_poll.c
@@ -82,8 +82,6 @@ int arp_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
/* Setup for the ARP callback (most of these do not apply) */
dev->d_appdata = NULL;
- dev->d_snddata = NULL;
-
dev->d_len = 0;
dev->d_sndlen = 0;
diff --git a/nuttx/net/devif/devif_iobsend.c b/nuttx/net/devif/devif_iobsend.c
index 27e1adcbc..f1f0248b6 100644
--- a/nuttx/net/devif/devif_iobsend.c
+++ b/nuttx/net/devif/devif_iobsend.c
@@ -103,13 +103,13 @@ void devif_iob_send(FAR struct net_driver_s *dev, FAR struct iob_s *iob,
/* Copy the data from the I/O buffer chain to the device buffer */
- iob_copyout(dev->d_snddata, iob, len, offset);
+ iob_copyout(dev->d_appdata, iob, len, offset);
dev->d_sndlen = len;
#ifdef CONFIG_NET_TCP_WRBUFFER_DUMP
/* Dump the outgoing device buffer */
- lib_dumpbuffer("devif_iob_send", dev->d_snddata, len);
+ lib_dumpbuffer("devif_iob_send", dev->d_appdata, len);
#endif
}
diff --git a/nuttx/net/devif/devif_pktsend.c b/nuttx/net/devif/devif_pktsend.c
index 1dc1a41a6..d03548eda 100644
--- a/nuttx/net/devif/devif_pktsend.c
+++ b/nuttx/net/devif/devif_pktsend.c
@@ -87,7 +87,7 @@
* an xmit or poll request from the the network interface driver.
*
* This is almost identical to calling devif_send() except that the data to
- * be sent is copied into dev->d_buf (vs. dev->d_snddata), since there is
+ * be sent is copied into dev->d_buf (vs. dev->d_appdata), since there is
* no header on the data.
*
* Assumptions:
diff --git a/nuttx/net/devif/devif_send.c b/nuttx/net/devif/devif_send.c
index 1738c28e5..0409ba3da 100644
--- a/nuttx/net/devif/devif_send.c
+++ b/nuttx/net/devif/devif_send.c
@@ -96,6 +96,6 @@ void devif_send(struct net_driver_s *dev, const void *buf, int len)
{
DEBUGASSERT(dev && len > 0 && len < NET_DEV_MTU(dev));
- memcpy(dev->d_snddata, buf, len);
+ memcpy(dev->d_appdata, buf, len);
dev->d_sndlen = len;
}
diff --git a/nuttx/net/icmp/icmp_poll.c b/nuttx/net/icmp/icmp_poll.c
index 6c3f63b26..4f99464dd 100644
--- a/nuttx/net/icmp/icmp_poll.c
+++ b/nuttx/net/icmp/icmp_poll.c
@@ -91,8 +91,6 @@ void icmp_poll(FAR struct net_driver_s *dev)
/* Setup for the application callback */
dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPICMP_HDRLEN];
- dev->d_snddata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPICMP_HDRLEN];
-
dev->d_len = 0;
dev->d_sndlen = 0;
diff --git a/nuttx/net/icmpv6/icmpv6_poll.c b/nuttx/net/icmpv6/icmpv6_poll.c
index 8c06b53d2..20ca9210c 100644
--- a/nuttx/net/icmpv6/icmpv6_poll.c
+++ b/nuttx/net/icmpv6/icmpv6_poll.c
@@ -91,8 +91,6 @@ void icmpv6_poll(FAR struct net_driver_s *dev)
/* Setup for the application callback */
dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPICMPv6_HDRLEN];
- dev->d_snddata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPICMPv6_HDRLEN];
-
dev->d_len = 0;
dev->d_sndlen = 0;
diff --git a/nuttx/net/igmp/igmp_poll.c b/nuttx/net/igmp/igmp_poll.c
index 7cc1cfb9c..6beb8a31e 100644
--- a/nuttx/net/igmp/igmp_poll.c
+++ b/nuttx/net/igmp/igmp_poll.c
@@ -152,8 +152,6 @@ void igmp_poll(FAR struct net_driver_s *dev)
/* Setup the poll operation */
dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPIGMP_HDRLEN];
- dev->d_snddata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPIGMP_HDRLEN];
-
dev->d_len = 0;
dev->d_sndlen = 0;
diff --git a/nuttx/net/pkt/pkt_input.c b/nuttx/net/pkt/pkt_input.c
index 9f0ce783e..733da5596 100644
--- a/nuttx/net/pkt/pkt_input.c
+++ b/nuttx/net/pkt/pkt_input.c
@@ -109,7 +109,6 @@ int pkt_input(struct net_driver_s *dev)
/* Setup for the application callback */
dev->d_appdata = dev->d_buf;
- dev->d_snddata = dev->d_buf;
dev->d_sndlen = 0;
/* Perform the application callback */
diff --git a/nuttx/net/pkt/pkt_poll.c b/nuttx/net/pkt/pkt_poll.c
index e3db35b56..701ce0117 100644
--- a/nuttx/net/pkt/pkt_poll.c
+++ b/nuttx/net/pkt/pkt_poll.c
@@ -103,8 +103,6 @@ void pkt_poll(FAR struct net_driver_s *dev, FAR struct pkt_conn_s *conn)
/* Setup for the application callback */
dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPv4UDP_HDRLEN];
- dev->d_snddata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPv4UDP_HDRLEN];
-
dev->d_len = 0;
dev->d_sndlen = 0;
diff --git a/nuttx/net/socket/net_sendfile.c b/nuttx/net/socket/net_sendfile.c
index 17f7b5478..5274eb4ed 100644
--- a/nuttx/net/socket/net_sendfile.c
+++ b/nuttx/net/socket/net_sendfile.c
@@ -289,7 +289,7 @@ static uint16_t sendfile_interrupt(FAR struct net_driver_s *dev, FAR void *pvcon
goto end_wait;
}
- ret = file_read(pstate->snd_file, dev->d_snddata, sndlen);
+ ret = file_read(pstate->snd_file, dev->d_appdata, sndlen);
if (ret < 0)
{
int errcode = errno;
diff --git a/nuttx/net/socket/sendto.c b/nuttx/net/socket/sendto.c
index 7576d7427..1bd9495cf 100644
--- a/nuttx/net/socket/sendto.c
+++ b/nuttx/net/socket/sendto.c
@@ -207,7 +207,7 @@ static uint16_t sendto_interrupt(struct net_driver_s *dev, void *conn,
else
{
- /* Copy the user data into d_snddata and send it */
+ /* Copy the user data into d_appdata and send it */
devif_send(dev, pstate->st_buffer, pstate->st_buflen);
pstate->st_sndlen = pstate->st_buflen;
diff --git a/nuttx/net/tcp/tcp_appsend.c b/nuttx/net/tcp/tcp_appsend.c
index 339e2f255..ad4d43afb 100644
--- a/nuttx/net/tcp/tcp_appsend.c
+++ b/nuttx/net/tcp/tcp_appsend.c
@@ -188,8 +188,6 @@ void tcp_rexmit(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
nllvdbg("result: %04x d_sndlen: %d conn->unacked: %d\n",
result, dev->d_sndlen, conn->unacked);
- dev->d_appdata = dev->d_snddata;
-
/* If the application has data to be sent, or if the incoming packet had
* new data in it, we must send out a packet.
*/
diff --git a/nuttx/net/tcp/tcp_input.c b/nuttx/net/tcp/tcp_input.c
index f851c67ea..f382e2cc8 100644
--- a/nuttx/net/tcp/tcp_input.c
+++ b/nuttx/net/tcp/tcp_input.c
@@ -130,7 +130,6 @@ static void tcp_input(FAR struct net_driver_s *dev, unsigned int iplen)
/* Initialize for tcp_send() */
- dev->d_snddata = &dev->d_buf[hdrlen];
dev->d_appdata = &dev->d_buf[hdrlen];
/* Start of TCP input header processing code. */
diff --git a/nuttx/net/tcp/tcp_poll.c b/nuttx/net/tcp/tcp_poll.c
index 0f6175638..637ac99ac 100644
--- a/nuttx/net/tcp/tcp_poll.c
+++ b/nuttx/net/tcp/tcp_poll.c
@@ -107,10 +107,8 @@ void tcp_poll(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn)
*/
#if defined(CONFIG_NET_IPv4)
- dev->d_snddata = &dev->d_buf[IPv4TCP_HDRLEN + NET_LL_HDRLEN(dev)];
dev->d_appdata = &dev->d_buf[IPv4TCP_HDRLEN + NET_LL_HDRLEN(dev)];
#else /* if defined(CONFIG_NET_IPv6) */
- dev->d_snddata = &dev->d_buf[IPv6TCP_HDRLEN + NET_LL_HDRLEN(dev)];
dev->d_appdata = &dev->d_buf[IPv6TCP_HDRLEN + NET_LL_HDRLEN(dev)];
#endif
diff --git a/nuttx/net/tcp/tcp_timer.c b/nuttx/net/tcp/tcp_timer.c
index 5ed9c8d10..2d1590b7c 100644
--- a/nuttx/net/tcp/tcp_timer.c
+++ b/nuttx/net/tcp/tcp_timer.c
@@ -100,7 +100,6 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
{
uint8_t result;
- dev->d_snddata = &dev->d_buf[IPv4TCP_HDRLEN + NET_LL_HDRLEN(dev)];
dev->d_appdata = &dev->d_buf[IPv4TCP_HDRLEN + NET_LL_HDRLEN(dev)];
/* Increase the TCP sequence number */
diff --git a/nuttx/net/udp/udp_input.c b/nuttx/net/udp/udp_input.c
index 9062b6dd5..d21d47e1b 100644
--- a/nuttx/net/udp/udp_input.c
+++ b/nuttx/net/udp/udp_input.c
@@ -167,7 +167,6 @@ static int udp_input(FAR struct net_driver_s *dev, unsigned int iplen)
/* Set-up for the application callback */
dev->d_appdata = &dev->d_buf[hdrlen];
- dev->d_snddata = &dev->d_buf[hdrlen];
dev->d_sndlen = 0;
/* Perform the application callback */
diff --git a/nuttx/net/udp/udp_poll.c b/nuttx/net/udp/udp_poll.c
index 43ea3e8cc..a734cf93d 100644
--- a/nuttx/net/udp/udp_poll.c
+++ b/nuttx/net/udp/udp_poll.c
@@ -105,10 +105,8 @@ void udp_poll(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn)
#if defined(CONFIG_NET_IPv4)
dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPv4UDP_HDRLEN];
- dev->d_snddata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPv4UDP_HDRLEN];
#else /* if defined(CONFIG_NET_IPv6) */
dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPv6UDP_HDRLEN];
- dev->d_snddata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPv6UDP_HDRLEN];
#endif
dev->d_len = 0;