Merge remote-tracking branch 'origin/master' into st25fl1

This commit is contained in:
Gregory Nutt 2015-08-26 07:20:36 -06:00
commit 044f5d38ac
7 changed files with 37 additions and 13 deletions

View File

@ -10882,9 +10882,11 @@
* networking: Correct return value from psock_tcp_accept(). From
SaeHie Park (2015-08-25).
* drivers/mtd/st25fl1.c: Add a driver for ST25L1*K QuadSPI parts
(2015-08-15).
(2015-08-25).
* include/nuttx/spi/qspi.h: Develop a new interface for QSPI, at
least the way that QSPI is implemented on the SAMV71. Originally
planned to use the SPI interface, but it is just now compatible
with the SAMV71 QSPI hardware (2015-08-15).
with the SAMV71 QSPI hardware (2015-08-25).
* drivers/rwbuffer.c: Fix some logic errors. From Dmitry Nikolaev
via Juha Niskanen (2015-08-26).

2
arch

@ -1 +1 @@
Subproject commit 463d5c9af87cb0e749f7400ae1a1dfe0d56517fc
Subproject commit 5336c646386607424e3426fb488d73241abb5f08

View File

@ -49,6 +49,7 @@
#include <debug.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
@ -532,13 +533,16 @@ int localhost_initialize(void)
net_ipv4addr_copy(priv->lo_dev.d_draddr, g_lo_ipv4addr);
net_ipv4addr_copy(priv->lo_dev.d_netmask, g_lo_ipv4mask);
#endif
#ifdef CONFIG_NET_IPv6
net_ipv6addr_copy(priv->lo_dev.d_ipv6addr, g_lo_ipv6addr);
net_ipv6addr_copy(priv->lo_dev.d_ipv6draddr, g_lo_ipv6addr);
net_ipv6addr_copy(priv->lo_dev.d_ipv6netmask, g_ipv6_alloneaddr);
#endif
/* Put the network in the UP state */
priv->lo_dev.d_flags = IFF_UP;
return lo_ifup(&priv->lo_dev);
}

View File

@ -96,7 +96,7 @@ static void rwb_semtake(sem_t *sem)
while (sem_wait(sem) != 0)
{
/* The only case that an error should occr here is if
/* The only case that an error should occur here is if
* the wait was awakened by a signal.
*/
@ -117,8 +117,8 @@ static void rwb_semtake(sem_t *sem)
static inline bool rwb_overlap(off_t blockstart1, size_t nblocks1,
off_t blockstart2, size_t nblocks2)
{
off_t blockend1 = blockstart1 + nblocks1;
off_t blockend2 = blockstart2 + nblocks2;
off_t blockend1 = blockstart1 + nblocks1 - 1;
off_t blockend2 = blockstart2 + nblocks2 - 1;
/* If the buffer 1 is wholly outside of buffer 2, return false */
@ -257,7 +257,7 @@ static ssize_t rwb_writebuffer(FAR struct rwbuffer_s *rwb,
/* Flush the write buffer */
ret = rwb->wrflush(rwb, rwb->wrbuffer, rwb->wrblockstart, rwb->wrnblocks);
ret = rwb->wrflush(rwb->dev, rwb->wrbuffer, rwb->wrblockstart, rwb->wrnblocks);
if (ret < 0)
{
fdbg("ERROR: Error writing multiple from cache: %d\n", -ret);
@ -842,7 +842,7 @@ int rwb_read(FAR struct rwbuffer_s *rwb, off_t startblock, uint32_t nblocks,
* the user buffer.
*/
ret = rwb->rhreload(rwb->dev, startblock, nblocks, rdbuffer);
ret = rwb->rhreload(rwb->dev, rdbuffer, startblock, nblocks);
}
#endif

View File

@ -49,6 +49,7 @@
#include <nuttx/clock.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/net.h>
#include <nuttx/semaphore.h>
#include <arch/irq.h>
@ -326,8 +327,6 @@ int file_poll(int fd, FAR struct pollfd *fds, bool setup)
int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
{
struct timespec abstime;
irqstate_t flags;
sem_t sem;
int count = 0;
int ret;

View File

@ -257,16 +257,35 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
dev->d_conncb = NULL;
dev->d_devcb = NULL;
/* Get the next available device number and sssign a device name to
/* Get the next available device number and assign a device name to
* the interface
*/
save = net_lock();
#ifdef CONFIG_NET_MULTILINK
devnum = find_devnum(devfmt);
# ifdef CONFIG_NET_LOOPBACK
/* The local loopback device is a special case: There can be only one
* local loopback device so it is unnumbered.
*/
if (lltype == NET_LL_LOOPBACK)
{
devnum = 0;
}
else
# endif
{
devnum = find_devnum(devfmt);
}
#else
/* There is only a single link type. Finding the next network device
* number is simple.
*/
devnum = g_next_devnum++;
#endif
#ifdef CONFIG_NET_USER_DEVFMT
if (*dev->d_ifname)
{

View File

@ -172,7 +172,7 @@ void tcp_appsend(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
else
{
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
DEBUGASSERT(dev->d_sndlen >= 0 && dev->d_sndlen <= conn->mss);
DEBUGASSERT(dev->d_sndlen <= conn->mss);
#else
/* If d_sndlen > 0, the application has data to be sent. */