From d1fc0040d7fcc1ed4e64fecfb48df6d0bceaa263 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 27 Apr 2017 17:44:07 -0600 Subject: [PATCH 1/7] STM32F103-Mininum: Rename an incorrectly named file. --- configs/stm32f103-minimum/src/Makefile | 2 +- .../src/{stm32_cc3000.c => stm32_nrf24l01.c} | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) rename configs/stm32f103-minimum/src/{stm32_cc3000.c => stm32_nrf24l01.c} (95%) diff --git a/configs/stm32f103-minimum/src/Makefile b/configs/stm32f103-minimum/src/Makefile index 75b6cb2953..8402e553ea 100644 --- a/configs/stm32f103-minimum/src/Makefile +++ b/configs/stm32f103-minimum/src/Makefile @@ -86,7 +86,7 @@ CSRCS += stm32_veml6070.c endif ifeq ($(CONFIG_WL_NRF24L01),y) -CSRCS += stm32_cc3000.c +CSRCS += stm32_nrf24l01.c endif ifeq ($(CONFIG_USBDEV),y) diff --git a/configs/stm32f103-minimum/src/stm32_cc3000.c b/configs/stm32f103-minimum/src/stm32_nrf24l01.c similarity index 95% rename from configs/stm32f103-minimum/src/stm32_cc3000.c rename to configs/stm32f103-minimum/src/stm32_nrf24l01.c index 23b1144ef5..6edecba0e0 100644 --- a/configs/stm32f103-minimum/src/stm32_cc3000.c +++ b/configs/stm32f103-minimum/src/stm32_nrf24l01.c @@ -1,5 +1,5 @@ /************************************************************************************ - * configs/stm32f103-minimum//src/stm32_cc3000.c + * configs/stm32f103-minimum//src/stm32_nrf24l01.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Laurent Latil @@ -82,7 +82,7 @@ static FAR void *g_arg; static int stm32tiny_wl_irq_attach(xcpt_t isr, FAR void *arg) { - winfo("Attach IRQ\n"); + wlinfo("Attach IRQ\n"); g_isr = isr; g_arg = arg; (void)stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr, g_arg); @@ -91,7 +91,7 @@ static int stm32tiny_wl_irq_attach(xcpt_t isr, FAR void *arg) static void stm32tiny_wl_chip_enable(bool enable) { - winfo("CE:%d\n", enable); + wlinfo("CE:%d\n", enable); stm32_gpiowrite(GPIO_NRF24L01_CE, enable); } @@ -132,14 +132,14 @@ void stm32_wlinitialize(void) spidev = stm32_spibus_initialize(1); if (!spidev) { - werr("ERROR: Failed to initialize SPI bus\n"); + wlerr("ERROR: Failed to initialize SPI bus\n"); return; } result = nrf24l01_register(spidev, &nrf_cfg); if (result != OK) { - werr("ERROR: Failed to register initialize SPI bus\n"); + wlerr("ERROR: Failed to register initialize SPI bus\n"); return; } } From d928b4271dda8268292763f33f3c45bbe39878fa Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Fri, 28 Apr 2017 08:00:36 -0600 Subject: [PATCH 2/7] net/socket: fix cloning of local and raw sockets --- net/socket/net_clone.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/net/socket/net_clone.c b/net/socket/net_clone.c index a08c236329..d720eb8731 100644 --- a/net/socket/net_clone.c +++ b/net/socket/net_clone.c @@ -50,6 +50,8 @@ #include "tcp/tcp.h" #include "udp/udp.h" +#include "pkt/pkt.h" +#include "local/local.h" #include "socket/socket.h" #include "usrsock/usrsock.h" @@ -97,6 +99,24 @@ int net_clone(FAR struct socket *psock1, FAR struct socket *psock2) DEBUGASSERT(psock2->s_conn); psock2->s_crefs = 1; /* One reference on the new socket itself */ +#ifdef CONFIG_NET_LOCAL + if (psock2->s_domain == PF_LOCAL) + { + FAR struct local_conn_s *conn = psock2->s_conn; + DEBUGASSERT(conn->lc_crefs > 0 && conn->lc_crefs < 255); + conn->lc_crefs++; + } + else +#endif +#ifdef CONFIG_NET_PKT + if (psock2->s_type == SOCK_RAW) + { + FAR struct pkt_conn_s *conn = psock2->s_conn; + DEBUGASSERT(conn->crefs > 0 && conn->crefs < 255); + conn->crefs++; + } + else +#endif #ifdef NET_TCP_HAVE_STACK if (psock2->s_type == SOCK_STREAM) { From b4d2651ca9e5866da10c3d0aa8be92c9692af5fd Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Fri, 28 Apr 2017 08:09:16 -0600 Subject: [PATCH 3/7] STM32L4: stm32l4_i2c: add I2C4 code --- arch/arm/include/stm32l4/stm32l4x6xx_irq.h | 4 +- arch/arm/src/stm32l4/README.txt | 4 +- arch/arm/src/stm32l4/stm32l4_i2c.c | 60 ++++++++++++++++++++-- 3 files changed, 61 insertions(+), 7 deletions(-) diff --git a/arch/arm/include/stm32l4/stm32l4x6xx_irq.h b/arch/arm/include/stm32l4/stm32l4x6xx_irq.h index 23d5ec4247..b675e786bb 100644 --- a/arch/arm/include/stm32l4/stm32l4x6xx_irq.h +++ b/arch/arm/include/stm32l4/stm32l4x6xx_irq.h @@ -149,8 +149,8 @@ /* STM32L496xx/4A6xx only: */ #define STM32L4_IRQ_HASH_CRS (STM32L4_IRQ_FIRST+82) /* 82: HASH and CRS global interrupt */ -#define STM32L4_IRQ_I2C4_EV (STM32L4_IRQ_FIRST+83) /* 83: I2C4 event interrupt */ -#define STM32L4_IRQ_I2C4_ER (STM32L4_IRQ_FIRST+84) /* 84: I2C4 error interrupt */ +#define STM32L4_IRQ_I2C4EV (STM32L4_IRQ_FIRST+83) /* 83: I2C4 event interrupt */ +#define STM32L4_IRQ_I2C4ER (STM32L4_IRQ_FIRST+84) /* 84: I2C4 error interrupt */ #define STM32L4_IRQ_DCMI (STM32L4_IRQ_FIRST+85) /* 85: DCMI global interrupt */ #define STM32L4_IRQ_CAN2TX (STM32L4_IRQ_FIRST+86) /* 86: CAN2 TX interrupts */ #define STM32L4_IRQ_CAN2RX0 (STM32L4_IRQ_FIRST+87) /* 87: CAN2 RX0 interrupts */ diff --git a/arch/arm/src/stm32l4/README.txt b/arch/arm/src/stm32l4/README.txt index 944be02c29..9124d966a7 100644 --- a/arch/arm/src/stm32l4/README.txt +++ b/arch/arm/src/stm32l4/README.txt @@ -26,7 +26,7 @@ SRAM2 : OK; can be included in MM region or left separate for special app : purposes FIREWALL : Code written, to be tested, requires support from ldscript SPI : OK, tested (Including DMA) -I2C : Code written, to be tested (I2C4 missing) +I2C : Code written, to be tested RTC : works QSPI : works in polling, interrupt, DMA, and also memory-mapped modes CAN : OK, tested @@ -57,7 +57,7 @@ SWP : TODO (Single wire protocol master, to connect with NFC enabled LPUART : TODO (Low power UART working with LSE at low baud rates) LPTIMER : TODO (Low power TIMER) OPAMP : TODO (Analog operational amplifier) -COMP : TODO (Analog comparators) +COMP : There is some code (Analog comparators) DFSDM : TODO (Digital Filter and Sigma-Delta Modulator) LCD : TODO (Segment LCD controller) SAIPLL : works (PLL For Digital Audio interfaces, and other things) diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 3468af22be..6df49e444f 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -96,7 +96,8 @@ /* At least one I2C peripheral must be enabled */ -#if defined(CONFIG_STM32L4_I2C1) || defined(CONFIG_STM32L4_I2C2) || defined(CONFIG_STM32L4_I2C3) +#if defined(CONFIG_STM32L4_I2C1) || defined(CONFIG_STM32L4_I2C2) || \ + defined(CONFIG_STM32L4_I2C3) || defined(CONFIG_STM32L4_I2C4) /************************************************************************************ * Pre-processor Definitions @@ -300,6 +301,9 @@ static int stm32l4_i2c2_isr(int irq, void *context, FAR void *arg); #ifdef CONFIG_STM32L4_I2C3 static int stm32l4_i2c3_isr(int irq, void *context, FAR void *arg); #endif +#ifdef CONFIG_STM32L4_I2C4 +static int stm32l4_i2c4_isr(int irq, void *context, FAR void *arg); +#endif #endif static int stm32l4_i2c_init(FAR struct stm32l4_i2c_priv_s *priv); static int stm32l4_i2c_deinit(FAR struct stm32l4_i2c_priv_s *priv); @@ -413,6 +417,36 @@ struct stm32l4_i2c_priv_s stm32l4_i2c3_priv = }; #endif +#ifdef CONFIG_STM32L4_I2C4 +static const struct stm32l4_i2c_config_s stm32l4_i2c4_config = +{ + .base = STM32L4_I2C4_BASE, + .clk_bit = RCC_APB1ENR2_I2C4EN, + .reset_bit = RCC_APB1RSTR2_I2C4RST, + .scl_pin = GPIO_I2C4_SCL, + .sda_pin = GPIO_I2C4_SDA, +#ifndef CONFIG_I2C_POLLED + .isr = stm32l4_i2c4_isr, + .ev_irq = STM32L4_IRQ_I2C4EV, + .er_irq = STM32L4_IRQ_I2C4ER +#endif +}; + +struct stm32l4_i2c_priv_s stm32l4_i2c4_priv = +{ + .ops = &stm32l4_i2c_ops, + .config = &stm32l4_i2c4_config, + .refs = 0, + .intstate = INTSTATE_IDLE, + .msgc = 0, + .msgv = NULL, + .ptr = NULL, + .dcnt = 0, + .flags = 0, + .status = 0 +}; +#endif + /************************************************************************************ * Private Functions ************************************************************************************/ @@ -1541,7 +1575,7 @@ static int stm32l4_i2c2_isr(int irq, void *context, FAR void *arg) * Name: stm32l4_i2c3_isr * * Description: - * I2C2 interrupt service routine + * I2C3 interrupt service routine * ************************************************************************************/ @@ -1551,7 +1585,22 @@ static int stm32l4_i2c3_isr(int irq, void *context, FAR void *arg) return stm32l4_i2c_isr(&stm32l4_i2c3_priv); } #endif + +/************************************************************************************ + * Name: stm32l4_i2c4_isr + * + * Description: + * I2C4 interrupt service routine + * + ************************************************************************************/ + +#ifdef CONFIG_STM32L4_I2C4 +static int stm32l4_i2c4_isr(int irq, void *context, FAR void *arg) +{ + return stm32l4_i2c_isr(&stm32l4_i2c4_priv); +} #endif +#endif /* !CONFIG_I2C_POLLED */ /************************************************************************************ * Private Initialization and Deinitialization @@ -2009,6 +2058,11 @@ FAR struct i2c_master_s *stm32l4_i2cbus_initialize(int port) case 3: priv = (struct stm32l4_i2c_priv_s *)&stm32l4_i2c3_priv; break; +#endif +#ifdef CONFIG_STM32L4_I2C4 + case 4: + priv = (struct stm32l4_i2c_priv_s *)&stm32l4_i2c4_priv; + break; #endif default: return NULL; @@ -2072,5 +2126,5 @@ int stm32l4_i2cbus_uninitialize(FAR struct i2c_master_s * dev) return OK; } -#endif /* CONFIG_STM32L4_I2C1 || CONFIG_STM32L4_I2C2 || CONFIG_STM32L4_I2C3 */ +#endif /* CONFIG_STM32L4_I2C1 || CONFIG_STM32L4_I2C2 || CONFIG_STM32L4_I2C3 || CONFIG_STM32L4_I2C4 */ From 9431fb1d912713e4ae156635752b422476ca5350 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 28 Apr 2017 08:21:02 -0600 Subject: [PATCH 4/7] STM32L4: I2C was not using current interrupt handling parameter passing logic. --- arch/arm/src/stm32l4/stm32l4_i2c.c | 96 +++++------------------------- 1 file changed, 16 insertions(+), 80 deletions(-) diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 6df49e444f..9be4419de4 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -215,7 +215,6 @@ struct stm32l4_i2c_config_s uint32_t scl_pin; /* GPIO configuration for SCL as SCL */ uint32_t sda_pin; /* GPIO configuration for SDA as SDA */ #ifndef CONFIG_I2C_POLLED - int (*isr)(int, void *, void *); /* Interrupt handler */ uint32_t ev_irq; /* Event IRQ */ uint32_t er_irq; /* Error IRQ */ #endif @@ -290,20 +289,9 @@ static inline void stm32l4_i2c_sendstart(FAR struct stm32l4_i2c_priv_s *priv); static inline void stm32l4_i2c_clrstart(FAR struct stm32l4_i2c_priv_s *priv); static inline void stm32l4_i2c_sendstop(FAR struct stm32l4_i2c_priv_s *priv); static inline uint32_t stm32l4_i2c_getstatus(FAR struct stm32l4_i2c_priv_s *priv); -static int stm32l4_i2c_isr(struct stm32l4_i2c_priv_s * priv); +static int stm32l4_i2c_isr_process(struct stm32l4_i2c_priv_s *priv); #ifndef CONFIG_I2C_POLLED -#ifdef CONFIG_STM32L4_I2C1 -static int stm32l4_i2c1_isr(int irq, void *context, FAR void *arg); -#endif -#ifdef CONFIG_STM32L4_I2C2 -static int stm32l4_i2c2_isr(int irq, void *context, FAR void *arg); -#endif -#ifdef CONFIG_STM32L4_I2C3 -static int stm32l4_i2c3_isr(int irq, void *context, FAR void *arg); -#endif -#ifdef CONFIG_STM32L4_I2C4 -static int stm32l4_i2c4_isr(int irq, void *context, FAR void *arg); -#endif +static int stm32l4_i2c_isr(int irq, void *context, FAR void *arg); #endif static int stm32l4_i2c_init(FAR struct stm32l4_i2c_priv_s *priv); static int stm32l4_i2c_deinit(FAR struct stm32l4_i2c_priv_s *priv); @@ -336,7 +324,6 @@ static const struct stm32l4_i2c_config_s stm32l4_i2c1_config = .scl_pin = GPIO_I2C1_SCL, .sda_pin = GPIO_I2C1_SDA, #ifndef CONFIG_I2C_POLLED - .isr = stm32l4_i2c1_isr, .ev_irq = STM32L4_IRQ_I2C1EV, .er_irq = STM32L4_IRQ_I2C1ER #endif @@ -366,7 +353,6 @@ static const struct stm32l4_i2c_config_s stm32l4_i2c2_config = .scl_pin = GPIO_I2C2_SCL, .sda_pin = GPIO_I2C2_SDA, #ifndef CONFIG_I2C_POLLED - .isr = stm32l4_i2c2_isr, .ev_irq = STM32L4_IRQ_I2C2EV, .er_irq = STM32L4_IRQ_I2C2ER #endif @@ -396,7 +382,6 @@ static const struct stm32l4_i2c_config_s stm32l4_i2c3_config = .scl_pin = GPIO_I2C3_SCL, .sda_pin = GPIO_I2C3_SDA, #ifndef CONFIG_I2C_POLLED - .isr = stm32l4_i2c3_isr, .ev_irq = STM32L4_IRQ_I2C3EV, .er_irq = STM32L4_IRQ_I2C3ER #endif @@ -426,7 +411,6 @@ static const struct stm32l4_i2c_config_s stm32l4_i2c4_config = .scl_pin = GPIO_I2C4_SCL, .sda_pin = GPIO_I2C4_SDA, #ifndef CONFIG_I2C_POLLED - .isr = stm32l4_i2c4_isr, .ev_irq = STM32L4_IRQ_I2C4EV, .er_irq = STM32L4_IRQ_I2C4ER #endif @@ -690,7 +674,7 @@ static inline int stm32l4_i2c_sem_waitdone(FAR struct stm32l4_i2c_priv_s *priv) * reports that it is done. */ - stm32l4_i2c_isr(priv); + stm32l4_i2c_isr_process(priv); } /* Loop until the transfer is complete. */ @@ -1299,7 +1283,7 @@ static inline uint32_t stm32l4_i2c_getstatus(FAR struct stm32l4_i2c_priv_s *priv } /************************************************************************************ - * Name: stm32l4_i2c_isr + * Name: stm32l4_i2c_isr_startmessage * * Description: * Common logic when a message is started. Just adds the even to the trace buffer @@ -1332,14 +1316,14 @@ static inline void stm32l4_i2c_clearinterrupts(struct stm32l4_i2c_priv_s *priv) } /************************************************************************************ - * Name: stm32l4_i2c_isr + * Name: stm32l4_i2c_isr_process * * Description: - * Common Interrupt Service Routine + * I2C processing logic common to polled and non-polled operation. * ************************************************************************************/ -static int stm32l4_i2c_isr(struct stm32l4_i2c_priv_s *priv) +static int stm32l4_i2c_isr_process(struct stm32l4_i2c_priv_s *priv) { uint32_t status = stm32l4_i2c_getstatus(priv); @@ -1541,71 +1525,23 @@ static int stm32l4_i2c_isr(struct stm32l4_i2c_priv_s *priv) } /************************************************************************************ - * Name: stm32l4_i2c1_isr + * Name: stm32l4_i2c_isr * * Description: - * I2C1 interrupt service routine - * - ************************************************************************************/ - -#ifndef CONFIG_I2C_POLLED -#ifdef CONFIG_STM32L4_I2C1 -static int stm32l4_i2c1_isr(int irq, void *context, FAR void *arg) -{ - return stm32l4_i2c_isr(&stm32l4_i2c1_priv); -} -#endif - -/************************************************************************************ - * Name: stm32l4_i2c2_isr - * - * Description: - * I2C2 interrupt service routine + * I2C interrupt service routine * ************************************************************************************/ #ifdef CONFIG_STM32L4_I2C2 -static int stm32l4_i2c2_isr(int irq, void *context, FAR void *arg) +static int stm32l4_i2c_isr(int irq, void *context, FAR void *arg) { - return stm32l4_i2c_isr(&stm32l4_i2c2_priv); + struct stm32l4_i2c_priv_s *priv = (struct stm32l4_i2c_priv_s *priv)arg; + + DEBUGASSERT(priv != NULL); + return stm32l4_i2c_isr_process(priv); } #endif -/************************************************************************************ - * Name: stm32l4_i2c3_isr - * - * Description: - * I2C3 interrupt service routine - * - ************************************************************************************/ - -#ifdef CONFIG_STM32L4_I2C3 -static int stm32l4_i2c3_isr(int irq, void *context, FAR void *arg) -{ - return stm32l4_i2c_isr(&stm32l4_i2c3_priv); -} -#endif - -/************************************************************************************ - * Name: stm32l4_i2c4_isr - * - * Description: - * I2C4 interrupt service routine - * - ************************************************************************************/ - -#ifdef CONFIG_STM32L4_I2C4 -static int stm32l4_i2c4_isr(int irq, void *context, FAR void *arg) -{ - return stm32l4_i2c_isr(&stm32l4_i2c4_priv); -} -#endif -#endif /* !CONFIG_I2C_POLLED */ - -/************************************************************************************ - * Private Initialization and Deinitialization - ************************************************************************************/ - /************************************************************************************ * Name: stm32l4_i2c_init * @@ -1640,8 +1576,8 @@ static int stm32l4_i2c_init(FAR struct stm32l4_i2c_priv_s *priv) /* Attach ISRs */ #ifndef CONFIG_I2C_POLLED - irq_attach(priv->config->ev_irq, priv->config->isr, NULL); - irq_attach(priv->config->er_irq, priv->config->isr, NULL); + irq_attach(priv->config->ev_irq, stm32l4_i2c_isr, priv); + irq_attach(priv->config->er_irq, stm32l4_i2c_isr, priv); up_enable_irq(priv->config->ev_irq); up_enable_irq(priv->config->er_irq); #endif From 37ca797d1cd2d72519fd1511823ca6dd9c65860c Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Fri, 28 Apr 2017 08:42:37 -0600 Subject: [PATCH 5/7] vfs/poll: round timeout up to next full tick. Calling poll() with timeout less than half tick (thus MSEC2TICK(timeout) => 0) caused returning error with EAGAIN. Instead of rounding timeout down, value should be rounded up. Open Group spec for poll says: "Implementations may place limitations on the granularity of timeout intervals. If the requested timeout interval requires a finer granularity than the implementation supports, the actual timeout interval will be rounded up to the next supported value." --- fs/vfs/fs_poll.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c index 168c393dd0..c828890210 100644 --- a/fs/vfs/fs_poll.c +++ b/fs/vfs/fs_poll.c @@ -388,6 +388,25 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout) } else if (timeout > 0) { + systime_t ticks; + + /* "Implementations may place limitations on the granularity of + * timeout intervals. If the requested timeout interval requires + * a finer granularity than the implementation supports, the + * actual timeout interval will be rounded up to the next + * supported value." -- opengroup.org + * + * Round timeout up to next full tick. + */ + +#if (MSEC_PER_TICK * USEC_PER_MSEC) != USEC_PER_TICK && \ + defined(CONFIG_HAVE_LONG_LONG) + ticks = ((long long)timeout * USEC_PER_MSEC) + (USEC_PER_TICK - 1) / + USEC_PER_TICK; +#else + ticks = (timeout + (MSEC_PER_TICK - 1)) / MSEC_PER_TICK; +#endif + /* Either wait for either a poll event(s), for a signal to occur, * or for the specified timeout to elapse with no event. * @@ -396,7 +415,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout) * immediately. */ - ret = sem_tickwait(&sem, clock_systimer(), MSEC2TICK(timeout)); + ret = sem_tickwait(&sem, clock_systimer(), ticks); if (ret < 0) { if (ret == -ETIMEDOUT) From e3d865f6c2401e2d12a437dbff2ca72511dc46d1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 28 Apr 2017 11:02:54 -0600 Subject: [PATCH 6/7] In last changed to poll(),cConverted timeout to unsigned to eliminate the possibility of overflow of signed overflow. --- fs/vfs/fs_poll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c index c828890210..55160d7faa 100644 --- a/fs/vfs/fs_poll.c +++ b/fs/vfs/fs_poll.c @@ -401,10 +401,10 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout) #if (MSEC_PER_TICK * USEC_PER_MSEC) != USEC_PER_TICK && \ defined(CONFIG_HAVE_LONG_LONG) - ticks = ((long long)timeout * USEC_PER_MSEC) + (USEC_PER_TICK - 1) / + ticks = ((unsigned long long)timeout * USEC_PER_MSEC) + (USEC_PER_TICK - 1) / USEC_PER_TICK; #else - ticks = (timeout + (MSEC_PER_TICK - 1)) / MSEC_PER_TICK; + ticks = ((unsigned int)timeout + (MSEC_PER_TICK - 1)) / MSEC_PER_TICK; #endif /* Either wait for either a poll event(s), for a signal to occur, From 5f5c82aa11851c0e24587c0c6512e3bc28aa8baf Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 28 Apr 2017 12:32:03 -0600 Subject: [PATCH 7/7] Add all network IOCTLs to include/sys/ioctl.h --- include/sys/ioctl.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h index 985ca1357b..acbcc1d3e6 100644 --- a/include/sys/ioctl.h +++ b/include/sys/ioctl.h @@ -45,11 +45,25 @@ #include #include -/* Include network ioctls info */ +#if CONFIG_NSOCKET_DESCRIPTORS > 0 +#ifdef CONFIG_NET +/* Include network IOCTL definitions */ -#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 -# include +# include + +#ifdef CONFIG_NETDEV_WIRELESS_IOCTL +/* Include wireless network IOCTL definitions */ + +# include #endif +#endif /* CONFIG_NET */ + +#ifdef CONFIG_DRIVERS_WIRELESS +/* Include wireless character driver IOCTL definitions */ + +# include +#endif +#endif /* CONFIG_NSOCKET_DESCRIPTORS > 0 */ /**************************************************************************** * Pre-processor Definitions