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

This commit is contained in:
Gregory Nutt 2017-03-15 13:11:13 -06:00
commit fbc6415ca7
19 changed files with 97 additions and 36 deletions

View File

@ -118,6 +118,12 @@ ifeq ($(CONFIG_WIRELESS),y)
NUTTXLIBS += lib$(DELIM)libwireless$(LIBEXT)
endif
# Add C++ library
ifeq ($(CONFIG_HAVE_CXX),y)
NUTTXLIBS += lib$(DELIM)libcxx$(LIBEXT)
endif
# Export all libraries
EXPORTLIBS = $(NUTTXLIBS)

View File

@ -113,6 +113,12 @@ ifeq ($(CONFIG_WIRELESS),y)
NUTTXLIBS += lib$(DELIM)libwireless$(LIBEXT)
endif
# Add C++ library
ifeq ($(CONFIG_HAVE_CXX),y)
NUTTXLIBS += lib$(DELIM)libcxx$(LIBEXT)
endif
# Export only the user libraries
EXPORTLIBS = $(USERLIBS)

View File

@ -123,6 +123,12 @@ ifeq ($(CONFIG_WIRELESS),y)
NUTTXLIBS += lib$(DELIM)libwireless$(LIBEXT)
endif
# Add C++ library
ifeq ($(CONFIG_HAVE_CXX),y)
NUTTXLIBS += lib$(DELIM)libcxx$(LIBEXT)
endif
# Export only the user libraries
EXPORTLIBS = $(USERLIBS)

18
TODO
View File

@ -1,4 +1,4 @@
NuttX TODO List (Last updated March 7, 2017)
NuttX TODO List (Last updated March 14, 2017)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This file summarizes known NuttX bugs, limitations, inconsistencies with
@ -19,7 +19,7 @@ nuttx/:
(8) Kernel/Protected Build
(3) C++ Support
(6) Binary loaders (binfmt/)
(13) Network (net/, drivers/net)
(14) Network (net/, drivers/net)
(4) USB (drivers/usbdev, drivers/usbhost)
(0) Other drivers (drivers/)
(12) Libraries (libc/, libm/)
@ -1065,6 +1065,20 @@ o Network (net/, drivers/net)
Status: Open
Priority: High if you happen to be using Ethernet in this configuration.
Title: REPARTITION DRIVER FUNCTIONALITY
Description: Every network driver performs the first level of packet decoding.
It examines the packet header and calls ipv4_input(), ipv6_input().
icmp_input(), etc. as appropriate. This is a maintenance problem
because it means that any changes to the network input interfaces
affects all drivers.
A better, more maintainable solution would use a single net_input()
function that would receive all incoming packets. This function
would then perform that common packet decoding logic that is
currently implemented in every network driver.
Status: Open
Priority: Low. Really just as aesthetic maintainability issue.
o USB (drivers/usbdev, drivers/usbhost)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -323,7 +323,7 @@ exception_common:
.global g_intstackbase
.align 8
g_intstackalloc:
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~7)
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase:
.size g_intstackalloc, .-g_intstackalloc
#endif

View File

@ -235,7 +235,7 @@ exception_common:
*
* Here:
* r0 = Address of the register save area
*
* NOTE: It is a requirement that up_restorefpu() preserve the value of
* r0!
*/
@ -355,7 +355,7 @@ exception_common:
.global g_intstackbase
.align 8
g_intstackalloc:
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~7)
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase:
.size g_intstackalloc, .-g_intstackalloc
#endif

View File

@ -106,7 +106,7 @@ static inline void up_color_intstack(void)
uint32_t *ptr = (uint32_t *)&g_intstackalloc;
ssize_t size;
for (size = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
for (size = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
size > 0;
size -= sizeof(uint32_t))
{

View File

@ -52,7 +52,7 @@
/* If the common ARMv7-M vector handling logic is used, then it expects the
* following definition in this file that provides the number of supported external
* interrupts which, for this architecture, is provided in the arch/stm32f7/chip.h
* interrupts which, for this architecture, is provided in the arch/kinetis/chip.h
* header file.
*/

View File

@ -1,6 +1,5 @@
/****************************************************************************
* arch/arm/src/kinetis/kinetis_clrpend.c
* arch/arm/src/chip/kinetis_clrpend.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>

View File

@ -1,6 +1,5 @@
/****************************************************************************
* arch/arm/src/kinetis/kinetis_start.c
* arch/arm/src/chip/kinetis_start.c
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -327,6 +326,7 @@ void __start(void)
* can get debug output as soon as possible (This depends on clock
* configuration).
*/
kinetis_fpuconfig();
kinetis_lowsetup();
#ifdef USE_EARLYSERIALINIT

View File

@ -484,7 +484,7 @@ exception_common:
.global g_intstackbase
.align 8
g_intstackalloc:
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~7)
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase:
.size g_intstackalloc, .-g_intstackalloc
#endif

View File

@ -348,7 +348,7 @@ exception_common:
*
* Here:
* r0 = Address of the register save area
*
* NOTE: It is a requirement that up_restorefpu() preserve the value of
* r0!
*/
@ -468,7 +468,7 @@ exception_common:
.global g_intstackbase
.align 8
g_intstackalloc:
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~7)
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase:
.size g_intstackalloc, .-g_intstackalloc
#endif

View File

@ -362,7 +362,7 @@ exception_common:
*
* Here:
* r0 = Address of the register save area
*
* NOTE: It is a requirement that up_restorefpu() preserve the value of
* r0!
*/
@ -482,7 +482,7 @@ exception_common:
.global g_intstackbase
.align 8
g_intstackalloc:
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~7)
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase:
.size g_intstackalloc, .-g_intstackalloc
#endif

View File

@ -497,7 +497,7 @@ exception_common:
.global g_intstackbase
.align 8
g_intstackalloc:
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~7)
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase:
.size g_intstackalloc, .-g_intstackalloc
#endif

View File

@ -1055,7 +1055,7 @@ l5:
.global g_intstackbase
.align 8
g_intstackalloc:
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~7)
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase:
.size g_intstackalloc, .-g_intstackalloc
#endif

View File

@ -339,7 +339,7 @@ exception_common:
*
* Here:
* r0 = Address of the register save area
*
* NOTE: It is a requirement that up_restorefpu() preserve the value of
* r0!
*/
@ -459,7 +459,7 @@ exception_common:
.global g_intstackbase
.align 8
g_intstackalloc:
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~7)
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase:
.size g_intstackalloc, .-g_intstackalloc
#endif

View File

@ -59,6 +59,10 @@
************************************************************************************/
/* Network Driver IOCTL Commands ****************************************************/
/* Use of these IOCTL commands requires a socket descriptor created by the socket()
* interface.
*/
/* Wireless identification */
#define SIOCSIWCOMMIT _WLIOC(0x0001) /* Commit pending changes to driver */
@ -149,19 +153,27 @@
#define SIOCSIWPMKSA _WLIOC(0x0032) /* PMKSA cache operation */
#define WL_FIRSTCHAR 0x0033
#define WL_NNETCMDS 0x0032
/* Character Driver IOCTL commands *************************************************/
/* Non-compatible, NuttX only IOCTL definitions for use with low-level wireless
* drivers that are accessed via a character device.
* drivers that are accessed via a character device. Use of these IOCTL commands
* requires a file descriptor created by the open() interface.
*/
#define WLIOC_SETRADIOFREQ _WLIOC(0x0033) /* arg: Pointer to uint32_t, frequency value (in Mhz) */
#define WLIOC_GETRADIOFREQ _WLIOC(0x0034) /* arg: Pointer to uint32_t, frequency value (in Mhz) */
#define WLIOC_SETADDR _WLIOC(0x0035) /* arg: Pointer to address value, format of the address is driver specific */
#define WLIOC_GETADDR _WLIOC(0x0036) /* arg: Pointer to address value, format of the address is driver specific */
#define WLIOC_SETTXPOWER _WLIOC(0x0037) /* arg: Pointer to int32_t, output power (in dBm) */
#define WLIOC_GETTXPOWER _WLIOC(0x0038) /* arg: Pointer to int32_t, output power (in dBm) */
#define WLIOC_SETRADIOFREQ _WLIOC(0x0033) /* arg: Pointer to uint32_t, frequency
* value (in Mhz) */
#define WLIOC_GETRADIOFREQ _WLIOC(0x0034) /* arg: Pointer to uint32_t, frequency
* value (in Mhz) */
#define WLIOC_SETADDR _WLIOC(0x0035) /* arg: Pointer to address value, format
* of the address is driver specific */
#define WLIOC_GETADDR _WLIOC(0x0036) /* arg: Pointer to address value, format
* of the address is driver specific */
#define WLIOC_SETTXPOWER _WLIOC(0x0037) /* arg: Pointer to int32_t, output power
* (in dBm) */
#define WLIOC_GETTXPOWER _WLIOC(0x0038) /* arg: Pointer to int32_t, output power
* (in dBm) */
/* Device-specific IOCTL commands **************************************************/
@ -185,7 +197,7 @@
#define NRF24L01_FIRST (CC3000_FIRST + CC3000_NCMDS)
#define NRF24L01_NCMDS 14
/* Other Definitions ****************************************************************/
/* Other Common Wireless Definitions ***********************************************/
/* Maximum size of the ESSID and NICKN strings */
@ -195,6 +207,7 @@
* Public Types
************************************************************************************/
/* TODO:
*
* - Add types for statistics (struct iw_statistics and related)
* - Add struct iw_range for use with IOCTL commands that need exchange mode data
* that could not fit in iwreq.
@ -203,6 +216,8 @@
* - WPA support.
* - Wireless events.
* - Various flag definitions.
*
* These future additions will all need to be compatible with BSD/Linux definitions.
*/
/* Generic format for most parameters that fit in a int32_t */
@ -280,17 +295,17 @@ union iwreq_data
struct iw_param param; /* Other small parameters */
struct iw_point data; /* Other large parameters */
};
};
/* This is the structure used to exchange data in wireless IOCTLs. This structure
* is the same as 'struct ifreq', but defined for use with wireless IOCTLs.
*/
/* This is the structure used to exchange data in wireless IOCTLs. This structure
* is the same as 'struct ifreq', but defined for use with wireless IOCTLs.
*/
struct iwreq
{
char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "eth0" */
union iwreq_data u; /* Data payload */
};
};
#endif /* CONFIG_DRIVERS_WIRELESS */
#endif /* __INCLUDE_NUTTX_WIRELESS_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* net/netdev/netdev_ioctl.c
*
* Copyright (C) 2007-2012, 2015-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2012, 2015-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -1260,7 +1260,7 @@ void netdev_ifup(FAR struct net_driver_s *dev)
{
/* Make sure that the device supports the d_ifup() method */
if (dev->d_ifup)
if (dev->d_ifup != NULL)
{
/* Is the interface already up? */
@ -1282,7 +1282,7 @@ void netdev_ifdown(FAR struct net_driver_s *dev)
{
/* Check sure that the device supports the d_ifdown() method */
if (dev->d_ifdown)
if (dev->d_ifdown != NULL)
{
/* Is the interface already down? */

View File

@ -125,6 +125,7 @@ static inline FAR struct semholder_s *sem_allocholder(sem_t *sem)
pholder = NULL;
}
DEBUGASSERT(pholder != NULL);
return pholder;
}
@ -153,6 +154,7 @@ static FAR struct semholder_s *sem_findholder(sem_t *sem,
}
#else
int i;
pholder = NULL;
/* We have two hard-allocated holder structuse in sem_t */
@ -318,6 +320,7 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder,
if (!sched_verifytcb(htcb))
{
serr("ERROR: TCB 0x%08x is a stale handle, counts lost\n", htcb);
DEBUGASSERT(!sched_verifytcb(htcb));
sem_freeholder(sem, pholder);
}
@ -355,6 +358,7 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder,
else
{
serr("ERROR: CONFIG_SEM_NNESTPRIO exceeded\n");
DEBUGASSERT(htcb->npend_reprio < CONFIG_SEM_NNESTPRIO);
}
}
@ -375,8 +379,16 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder,
* saved priority and not to the base priority.
*/
htcb->pend_reprios[htcb->npend_reprio] = rtcb->sched_priority;
htcb->npend_reprio++;
if (htcb->npend_reprio < CONFIG_SEM_NNESTPRIO)
{
htcb->pend_reprios[htcb->npend_reprio] = rtcb->sched_priority;
htcb->npend_reprio++;
}
else
{
serr("ERROR: CONFIG_SEM_NNESTPRIO exceeded\n");
DEBUGASSERT(htcb->npend_reprio < CONFIG_SEM_NNESTPRIO);
}
}
}
@ -468,6 +480,7 @@ static int sem_restoreholderprio(FAR struct semholder_s *pholder,
if (!sched_verifytcb(htcb))
{
serr("ERROR: TCB 0x%08x is a stale handle, counts lost\n", htcb);
DEBUGASSERT(!sched_verifytcb(htcb));
sem_freeholder(sem, pholder);
}
@ -853,11 +866,13 @@ void sem_destroyholder(FAR sem_t *sem)
if (sem->hhead != NULL)
{
serr("ERROR: Semaphore destroyed with holders\n");
DEBUGASSERT(sem->hhead != NULL);
(void)sem_foreachholder(sem, sem_recoverholders, NULL);
}
#else
if (sem->holder[0].htcb != NULL || sem->holder[0].htcb != NULL)
{
DEBUGASSERT(sem->holder[0].htcb != NULL || sem->holder[0].htcb != NULL);
serr("ERROR: Semaphore destroyed with holder\n");
}