Merged patacongo/nuttx into master

This commit is contained in:
Paul Patience 2015-08-07 09:51:17 -04:00
commit 01c2f6c806
9 changed files with 141 additions and 61 deletions

View File

@ -10784,4 +10784,8 @@
definitions to manage CAN message filtering (2015-08-05)
* drivers/Kconfig and can.c: Add configuration to support DLC to byte
conversions needed for CAN FD mode (2015-08-05).
* arch/arm/src/samv7: Add an MCAN driver for the SAMV7 platform
(2015-08-06).
* drivers/sensors/lm92.c and include/nuttx/sensors/lm92.h: Add a driver
for the LM92 temperature sensor. Contributed by Paul Patience
(2015-08-06).

2
arch

@ -1 +1 @@
Subproject commit 084d00887dc6443c060be6103a6757563f00f7ce
Subproject commit 5102f815891b899f87a718ab85d3913015a015ea

@ -1 +1 @@
Subproject commit 639546480f11f4438ab84aef4a51a82ab937c716
Subproject commit abab21dfa553656a0ce40423931a2af2c61f3466

View File

@ -52,7 +52,7 @@ config NET_DUMPPACKET
comment "External Ethernet MAC Device Support"
config NET_DM90x0
menuconfig NET_DM90x0
bool "Davicom dm9000/dm9010 support"
default n
---help---
@ -132,7 +132,7 @@ config NET_CS89x0
---help---
Under construction -- do not use
config ENC28J60
menuconfig ENC28J60
bool "Microchip ENC28J60 support"
default n
select SPI
@ -142,6 +142,7 @@ config ENC28J60
DS39662C, 2008 Microchip Technology Inc.
if ENC28J60
config ENC28J60_NINTERFACES
int "Number of physical ENC28J60"
default 1
@ -192,9 +193,9 @@ config ENC28J60_REGDEBUG
---help---
Enable very low-level register access debug. Depends on DEBUG and DEBUG_NET.
endif
endif # ENC28J60
config ENCX24J600
menuconfig ENCX24J600
bool "Microchip ENCX24J600 support"
default n
select SPI
@ -205,6 +206,7 @@ config ENCX24J600
with SPI or Parallel Interface DS39935B, 2009 Microchip Technology Inc.
if ENCX24J600
config ENC28J60_NINTERFACES
int "Number of physical ENCX24J600"
default 1
@ -258,9 +260,9 @@ config ENCX24J600_REGDEBUG
---help---
Enable very low-level register access debug. Depends on DEBUG and DEBUG_NET.
endif
endif # ENCX24J600
config NET_E1000
menuconfig NET_E1000
bool "E1000 support"
default n
@ -280,13 +282,52 @@ config E1000_BUFF_SIZE
endif # NET_E1000
config NET_SLIP
menuconfig NET_SLIP
bool "SLIP (serial line) support"
default n
---help---
Reference: RFC 1055
config NET_FTMAC100
if NET_SLIP
config NET_SLIP_STACKSIZE
int "Daemon stack size"
default 2048
---help---
Provides the stack size for SLIP RX and TX.
config NET_SLIP_DEFPRIO
int "Daemon priority"
default 128
---help---
Provides the priority for SLIP RX and TX threads.
config NET_SLIP_MTU
int "Packet size (MTU)"
default 296
---help---
Provides the size of the SLIP packet buffers.
The Linux slip module hard-codes its MTU size to 296 (40 bytes for
the IP+TPC headers plus 256 bytes of data). So you might as well
set CONFIG_NET_SLIP_MTU to 296 as well.
There may be an issue with this setting, however. I see that Linux
uses a MTU of 296 and window of 256, but actually only sends 168
bytes of data: 40 + 128. I believe that is to allow for the 2x
worst cast packet expansion. Ideally we would like to advertise the
256 MSS, but restrict transfers to 128 bytes (possibly by modifying
the tcp_mss() macro).
config NET_SLIP_NINTERFACES
int "Number of SLIP interfaces"
default 1
---help---
Determines the number of physical interfaces that will be supported.
endif
menuconfig NET_FTMAC100
bool "Faraday 10/100 Ethernet"
default n
---help---
@ -316,7 +357,7 @@ config FTMAC100_MAC0_ENV_ADDR
endif # NET_FTMAC100
config NET_VNET
menuconfig NET_VNET
bool "VNET support"
default n

View File

@ -83,12 +83,12 @@
# warning "CONFIG_NET_MULTIBUFFER must be set"
#endif
#ifndef CONFIG_SLIP_STACKSIZE
# define CONFIG_SLIP_STACKSIZE 2048
#ifndef CONFIG_NET_SLIP_STACKSIZE
# define CONFIG_NET_SLIP_STACKSIZE 2048
#endif
#ifndef CONFIG_SLIP_DEFPRIO
# define CONFIG_SLIP_DEFPRIO 128
#ifndef CONFIG_NET_SLIP_DEFPRIO
# define CONFIG_NET_SLIP_DEFPRIO 128
#endif
/* The Linux slip module hard-codes its MTU size to 296 (40 bytes for the
@ -99,7 +99,7 @@
* a MTU of 296 and window of 256, but actually only sends 168 bytes of data:
* 40 + 128. I believe that is to allow for the 2x worst cast packet
* expansion. Ideally we would like to advertise the 256 MSS, but restrict
* uIP to 128 bytes (possibly by modifying the tcp_mss() macro).
* transfers to 128 bytes (possibly by modifying the tcp_mss() macro).
*/
#if CONFIG_NET_SLIP_MTU < 296
@ -108,12 +108,12 @@
# warning "CONFIG_NET_SLIP_MTU == 296 is optimal"
#endif
/* CONFIG_SLIP_NINTERFACES determines the number of physical interfaces
/* CONFIG_NET_SLIP_NINTERFACES determines the number of physical interfaces
* that will be supported.
*/
#ifndef CONFIG_SLIP_NINTERFACES
# define CONFIG_SLIP_NINTERFACES 1
#ifndef CONFIG_NET_SLIP_NINTERFACES
# define CONFIG_NET_SLIP_NINTERFACES 1
#endif
/* SLIP special character codes *******************************************/
@ -183,11 +183,11 @@ struct slip_driver_s
* Private Data
****************************************************************************/
/* We really should get rid of CONFIG_SLIP_NINTERFACES and, instead,
/* We really should get rid of CONFIG_NET_SLIP_NINTERFACES and, instead,
* kmm_malloc() new interface instances as needed.
*/
static struct slip_driver_s g_slip[CONFIG_SLIP_NINTERFACES];
static struct slip_driver_s g_slip[CONFIG_NET_SLIP_NINTERFACES];
/****************************************************************************
* Private Function Prototypes
@ -250,7 +250,7 @@ static void slip_semtake(FAR struct slip_driver_s *priv)
* Description:
* Just an inline wrapper around fwrite with error checking.
*
* Parameters:
* Input Parameters:
* priv - Reference to the driver state structure
* buffer - Buffer data to send
* len - Buffer length in bytes
@ -274,7 +274,7 @@ static inline void slip_write(FAR struct slip_driver_s *priv,
* Description:
* Just an inline wrapper around putc with error checking.
*
* Parameters:
* Input Parameters:
* priv - Reference to the driver state structure
* ch - The character to send
*
@ -293,7 +293,7 @@ static inline void slip_putc(FAR struct slip_driver_s *priv, int ch)
* Start hardware transmission. Called either from the txdone interrupt
* handling or from watchdog based polling.
*
* Parameters:
* Input Parameters:
* priv - Reference to the driver state structure
*
* Returned Value:
@ -407,7 +407,7 @@ static int slip_transmit(FAR struct slip_driver_s *priv)
* 1. When the preceding TX packet send is complete, or
* 2. During normal periodic polling
*
* Parameters:
* Input Parameters:
* dev - Reference to the NuttX driver state structure
*
* Returned Value:
@ -444,7 +444,7 @@ static int slip_txpoll(FAR struct net_driver_s *dev)
* Description:
* Polling and transmission is performed on tx thread.
*
* Parameters:
* Input Parameters:
* arg - Reference to the NuttX driver state structure
*
* Returned Value:
@ -462,7 +462,7 @@ static void slip_txtask(int argc, FAR char *argv[])
unsigned int hsec;
ndbg("index: %d\n", index);
DEBUGASSERT(index < CONFIG_SLIP_NINTERFACES);
DEBUGASSERT(index < CONFIG_NET_SLIP_NINTERFACES);
/* Get our private data structure instance and wake up the waiting
* initialization logic.
@ -535,7 +535,7 @@ static void slip_txtask(int argc, FAR char *argv[])
* Description:
* Get one byte from the serial input.
*
* Parameters:
* Input Parameters:
* priv - Reference to the driver state structure
*
* Returned Value:
@ -561,7 +561,7 @@ static inline int slip_getc(FAR struct slip_driver_s *priv)
* Description:
* Read a packet from the serial input
*
* Parameters:
* Input Parameters:
* priv - Reference to the driver state structure
*
* Returned Value:
@ -666,7 +666,7 @@ static inline void slip_receive(FAR struct slip_driver_s *priv)
* Description:
* Wait for incoming data.
*
* Parameters:
* Input Parameters:
* argc
* argv
*
@ -685,7 +685,7 @@ static int slip_rxtask(int argc, FAR char *argv[])
int ch;
ndbg("index: %d\n", index);
DEBUGASSERT(index < CONFIG_SLIP_NINTERFACES);
DEBUGASSERT(index < CONFIG_NET_SLIP_NINTERFACES);
/* Get our private data structure instance and wake up the waiting
* initialization logic.
@ -786,7 +786,7 @@ static int slip_rxtask(int argc, FAR char *argv[])
* NuttX Callback: Bring up the Ethernet interface when an IP address is
* provided
*
* Parameters:
* Input Parameters:
* dev - Reference to the NuttX driver state structure
*
* Returned Value:
@ -816,7 +816,7 @@ static int slip_ifup(FAR struct net_driver_s *dev)
* Description:
* NuttX Callback: Stop the interface.
*
* Parameters:
* Input Parameters:
* dev - Reference to the NuttX driver state structure
*
* Returned Value:
@ -844,7 +844,7 @@ static int slip_ifdown(FAR struct net_driver_s *dev)
* stimulus perform an out-of-cycle poll and, thereby, reduce the TX
* latency.
*
* Parameters:
* Input Parameters:
* dev - Reference to the NuttX driver state structure
*
* Returned Value:
@ -876,7 +876,7 @@ static int slip_txavail(FAR struct net_driver_s *dev)
* NuttX Callback: Add the specified MAC address to the hardware multicast
* address filtering
*
* Parameters:
* Input Parameters:
* dev - Reference to the NuttX driver state structure
* mac - The MAC address to be added
*
@ -905,7 +905,7 @@ static int slip_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
* NuttX Callback: Remove the specified MAC address from the hardware multicast
* address filtering
*
* Parameters:
* Input Parameters:
* dev - Reference to the NuttX driver state structure
* mac - The MAC address to be removed
*
@ -937,10 +937,12 @@ static int slip_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
* Description:
* Instantiate a SLIP network interface.
*
* Parameters:
* intf - In the case where there are multiple SLIP interfaces, this value
* identifies which is to be initialized. The network name will be,
* for example, "/dev/slip5" for intf == 5
* Input Parameters:
* intf - In the case where there are multiple SLIP interfaces, this
* value identifies which is to be initialized. The number of
* possible SLIP interfaces is determined by
* devname - This is the path to the serial device that will support SLIP.
* For example, this might be "/dev/ttyS1"
*
* Returned Value:
* OK on success; Negated errno on failure.
@ -957,7 +959,7 @@ int slip_initialize(int intf, FAR const char *devname)
/* Get the interface structure associated with this interface number. */
DEBUGASSERT(intf < CONFIG_SLIP_NINTERFACES);
DEBUGASSERT(intf < CONFIG_NET_SLIP_NINTERFACES);
priv = &g_slip[intf];
/* Initialize the driver structure */
@ -997,8 +999,8 @@ int slip_initialize(int intf, FAR const char *devname)
argv[0] = buffer;
argv[1] = NULL;
priv->rxpid = task_create("rxslip", CONFIG_SLIP_DEFPRIO,
CONFIG_SLIP_STACKSIZE, (main_t)slip_rxtask,
priv->rxpid = task_create("rxslip", CONFIG_NET_SLIP_DEFPRIO,
CONFIG_NET_SLIP_STACKSIZE, (main_t)slip_rxtask,
(FAR char * const *)argv);
if (priv->rxpid < 0)
{
@ -1012,8 +1014,8 @@ int slip_initialize(int intf, FAR const char *devname)
/* Start the SLIP transmitter task */
priv->txpid = task_create("txslip", CONFIG_SLIP_DEFPRIO,
CONFIG_SLIP_STACKSIZE, (main_t)slip_txtask,
priv->txpid = task_create("txslip", CONFIG_NET_SLIP_DEFPRIO,
CONFIG_NET_SLIP_STACKSIZE, (main_t)slip_txtask,
(FAR char * const *)argv);
if (priv->txpid < 0)
{

View File

@ -64,6 +64,7 @@ endif
ifeq ($(CONFIG_LM92),y)
CSRCS += lm92.c
endif
endif # CONFIG_I2C
# These drivers depend on SPI support

View File

@ -129,7 +129,7 @@
* Dependencies: Requires CONFIG_CAN_EXID *not* defined
*
* CANIOC_ADD_EXTFILTER:
* Description: Add an address filter for a extended 28 bit address.
* Description: Add an address filter for a extended 29 bit address.
* Argument: A reference to struct canioc_extfilter_s
* Returned Value: A non-negative filter ID is returned on success.
* Otherwise -1 (ERROR) is returned with the errno
@ -146,7 +146,7 @@
* Dependencies: Requires CONFIG_CAN_EXID *not* defined
*
* CANIOC_DEL_EXTFILTER:
* Description: Remove an address filter for a standard 28 bit address.
* Description: Remove an address filter for a standard 29 bit address.
* Argument: The filter index previously returned by the
* CANIOC_ADD_EXTFILTER command
* Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
@ -350,8 +350,8 @@ struct canioc_rtr_s
#ifdef CONFIG_CAN_EXTID
struct canioc_extfilter_s
{
uint32_t xf_id; /* 28-bit ID (4-bits unused) */
uint32_t xf_mask; /* 28-bit address mask (4-bits unused) */
uint32_t xf_id; /* 29-bit ID (3-bits unused) */
uint32_t xf_mask; /* 29-bit address mask (3-bits unused) */
};
#else
struct canioc_stdfilter_s

View File

@ -48,8 +48,38 @@
#ifdef CONFIG_NET_SLIP
/****************************************************************************
* Public Type Definitions
* Pre-processor Definitions
****************************************************************************/
/* Configuration ***********************************************************/
/* Dependencies:
*
* CONFIG_NET_NOINTS - Required.
* CONFIG_NET_MULTIBUFFER - Required.
*
* SLIP Configuration:
*
* CONFIG_NET_SLIP - Enables building of the SLIP driver
* CONFIG_NET_SLIP_STACKSIZE - Provides the stack size for SLIP RX and TX
* threads. Default: 2048
* CONFIG_NET_SLIP_DEFPRIO - Provides the priority for SLIP RX and TX
* threads. Default 128.
* CONFIG_NET_NET_SLIP_MTU - Provides the size of the SLIP packet buffers.
* Default 296
*
* The Linux slip module hard-codes its MTU size to 296 (40 bytes for the
* IP+TPC headers plus 256 bytes of data). So you might as well set
* CONFIG_NET_SLIP_MTU to 296 as well.
*
* There may be an issue with this setting, however. I see that Linux
* uses a MTU of 296 and window of 256, but actually only sends 168 bytes
* of data: 40 + 128. I believe that is to allow for the 2x worst cast
* packet expansion. Ideally we would like to advertise the 256 MSS,
* but restrict transfers to 128 bytes (possibly by modifying the
* tcp_mss() macro).
*
* CONFIG_NET_SLIP_NINTERFACES determines the number of physical interfaces
* that will be supported.
*/
/****************************************************************************
* Public Data
@ -73,10 +103,12 @@ extern "C"
* Description:
* Instantiate a SLIP network interface.
*
* Parameters:
* intf - In the case where there are multiple SLIP interfaces, this value
* identifies which is to be initialized. The network name will be,
* for example, "/dev/slip5" for intf == 5
* Input Parameters:
* intf - In the case where there are multiple SLIP interfaces, this
* value identifies which is to be initialized. The number of
* possible SLIP interfaces is determined by
* devname - This is the path to the serial device that will support SLIP.
* For example, this might be "/dev/ttyS1"
*
* Returned Value:
* OK on success; Negated errno on failure.