Networking: Remove field d_sndata from the device structure. It is the same as d_appdata and unnecessary
This commit is contained in:
parent
66f5fd1096
commit
88a0e82934
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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. */
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user