net: remove NET_NOINTS
authorEunBong Song <eunb.song@samsung.com>
Mon, 3 Apr 2017 06:23:00 +0000 (15:23 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 18 Apr 2017 03:02:06 +0000 (12:02 +0900)
NET_NOINTS is a Nuttx uIP legacy knob which determines which
synchronization method is used for network layer. If it is disabled,
interrupts are masked when synchronization is needed. Otherwise,
semaphore is used.

However, in the current implementation, network related function could
not be called in the interrupt context. This means that NET_NOINTS
should be '=y'.

This patch removes NET_NOINTS, and enables it always, so that only
semaphore is used for network layer syncrhonization.

Change-Id: I1dbab2216bd3c1c62b20fc70c653e9129742a163
Signed-off-by: EunBong Song <eunb.song@samsung.com>
build/configs/artik053/nettest/defconfig
build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig
os/drivers/net/enc28j60.c
os/include/tinyara/net/net.h
os/net/Kconfig
os/net/utils/Make.defs
os/net/utils/net_lock.c
os/net/utils/utils.h

index e51d80e..2808514 100644 (file)
@@ -708,7 +708,6 @@ CONFIG_NET_LWIP_STATS_SYS=y
 CONFIG_NSOCKET_DESCRIPTORS=16
 CONFIG_NET_SECURITY_TLS=y
 # CONFIG_TLS_WITH_SSS is not set
-CONFIG_NET_NOINTS=y
 
 #
 # Driver buffer configuration
index 1fdff47..c483387 100755 (executable)
@@ -709,7 +709,6 @@ CONFIG_NET_LWIP_STATS_SYS=y
 CONFIG_NSOCKET_DESCRIPTORS=16
 CONFIG_NET_SECURITY_TLS=y
 # CONFIG_TLS_WITH_SSS is not set
-CONFIG_NET_NOINTS=y
 
 #
 # Driver buffer configuration
index 2ed5422..513ba25 100644 (file)
 #define enc_dumppacket(m, a, n)
 #endif
 
-/* The ENC28J60 will not do interrupt level processing */
-
-#ifndef CONFIG_NET_NOINTS
-#warrning "CONFIG_NET_NOINTS should be set"
-#endif
 
 /* Low-level register debug */
 
index 4d6b2dc..e15a3fd 100644 (file)
@@ -142,7 +142,6 @@ struct socketlist {
 struct netif;                                  /* Forward reference. Defined in tinyara/net/lwip/src/include/lwip/netif.h */
 typedef int (*netdev_callback_t)(FAR struct netif *dev, void *arg);
 
-#ifdef CONFIG_NET_NOINTS
 /* Semaphore based locking for non-interrupt based logic.
  *
  * net_lock_t -- Not used.  Only for compatibility
@@ -150,16 +149,6 @@ typedef int (*netdev_callback_t)(FAR struct netif *dev, void *arg);
 
 typedef uint8_t net_lock_t;            /* Not really used */
 
-#else
-
-/* Enable/disable locking for interrupt based logic:
- *
- * net_lock_t -- The processor specific representation of interrupt state.
- */
-
-#define net_lock_t        irqstate_t
-#endif
-
 /****************************************************************************
  * Public Data
  ****************************************************************************/
@@ -212,26 +201,13 @@ extern "C" {
  ****************************************************************************/
 
 /****************************************************************************
- * Critical section management.  The TinyAra configuration setting
- * CONFIG_NET_NOINT indicates that uIP not called from the interrupt level.
- * If CONFIG_NET_NOINTS is defined, then these will map to semaphore
- * controls.  Otherwise, it assumed that uIP will be called from interrupt
- * level handling and these will map to interrupt enable/disable controls.
- *
- *
- * If CONFIG_NET_NOINTS is defined, then semaphore based locking is used:
+ * Critical section management.
  *
  *   net_lock()          - Takes the semaphore().  Implements a re-entrant mutex.
  *   net_unlock()        - Gives the semaphore().
  *   net_lockedwait()    - Like pthread_cond_wait(); releases the semaphore
  *                         momentarily to wait on another semaphore()
  *
- * Otherwise, interrupt based locking is used:
- *
- *   net_lock()          - Disables interrupts.
- *   net_unlock()        - Conditionally restores interrupts.
- *   net_lockedwait()    - Just wait for the semaphore.
- *
  ****************************************************************************/
 
 /****************************************************************************
@@ -242,11 +218,7 @@ extern "C" {
  *
  ****************************************************************************/
 
-#ifdef CONFIG_NET_NOINTS
 net_lock_t net_lock(void);
-#else
-#define net_lock() irqsave()
-#endif
 
 /****************************************************************************
  * Function: net_unlock
@@ -256,11 +228,7 @@ net_lock_t net_lock(void);
  *
  ****************************************************************************/
 
-#ifdef CONFIG_NET_NOINTS
 void net_unlock(net_lock_t flags);
-#else
-#define net_unlock(f) irqrestore(f)
-#endif
 
 /****************************************************************************
  * Function: net_timedwait
@@ -280,12 +248,8 @@ void net_unlock(net_lock_t flags);
  *
  ****************************************************************************/
 
-#ifdef CONFIG_NET_NOINTS
 struct timespec;
 int net_timedwait(sem_t *sem, FAR const struct timespec *abstime);
-#else
-#define net_timedwait(s, t) sem_timedwait(s, t)
-#endif
 
 /****************************************************************************
  * Function: net_lockedwait
@@ -303,11 +267,7 @@ int net_timedwait(sem_t *sem, FAR const struct timespec *abstime);
  *
  ****************************************************************************/
 
-#ifdef CONFIG_NET_NOINTS
 int net_lockedwait(sem_t *sem);
-#else
-#define net_lockedwait(s) sem_wait(s)
-#endif
 
 /****************************************************************************
  * Function: net_setipid
index 7aac0d9..4961074 100644 (file)
@@ -47,15 +47,6 @@ if NET_SECURITY_TLS
 source net/tls/Kconfig
 endif #NET_SECURITY_TLS
 
-config NET_NOINTS
-       bool "Not interrupt driven"
-       default n
-       ---help---
-               NET_NOINT indicates that uIP is not called from the interrupt level.
-               If NET_NOINTS is defined, critical sections will be managed with semaphores;
-               Otherwise, it assumed that uIP will be called from interrupt level handling
-               and critical sections will be managed by enabling and disabling interrupts.
-
 menu "Driver buffer configuration"
 
 config NET_MULTIBUFFER
index d0c2a95..a77efc6 100644 (file)
 # Common utilities
 
 NET_CSRCS += net_dsec2tick.c net_dsec2timeval.c net_timeval2dsec.c
-
-# Non-interrupt level support required?
-
-ifeq ($(CONFIG_NET_NOINTS),y)
 NET_CSRCS += net_lock.c
-endif
 
 # Include utility build support
 
index 86ef19d..31f5e55 100644 (file)
@@ -68,7 +68,7 @@
 
 #include "utils/utils.h"
 
-#if defined(CONFIG_NET) && defined(CONFIG_NET_NOINTS)
+#ifdef CONFIG_NET
 
 /****************************************************************************
  * Pre-processor Definitions
index 683aeed..2ee7f22 100644 (file)
@@ -95,11 +95,7 @@ struct timeval;                                      /* Forward reference */
  *
  ****************************************************************************/
 
-#ifdef CONFIG_NET_NOINTS
 void net_lockinitialize(void);
-#else
-#define net_lockinitialize()
-#endif
 
 /****************************************************************************
  * Function: net_dsec2timeval