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
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
****************************************************************************/
****************************************************************************/
/****************************************************************************
- * 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.
- *
****************************************************************************/
/****************************************************************************
*
****************************************************************************/
-#ifdef CONFIG_NET_NOINTS
net_lock_t net_lock(void);
-#else
-#define net_lock() irqsave()
-#endif
/****************************************************************************
* Function: net_unlock
*
****************************************************************************/
-#ifdef CONFIG_NET_NOINTS
void net_unlock(net_lock_t flags);
-#else
-#define net_unlock(f) irqrestore(f)
-#endif
/****************************************************************************
* Function: net_timedwait
*
****************************************************************************/
-#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
*
****************************************************************************/
-#ifdef CONFIG_NET_NOINTS
int net_lockedwait(sem_t *sem);
-#else
-#define net_lockedwait(s) sem_wait(s)
-#endif
/****************************************************************************
* Function: net_setipid