Commit Graph

3675 Commits

Author SHA1 Message Date
Kazuya Hioki
075334cfcc drivers: wireless: Fix buffer overrun in gs2200m.c
Warning ID: 85719.12039200

Reviewed-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Signed-off-by: Kazuya Hioki <Kazuya.Hioki@sony.com>
2020-05-26 15:38:43 +08:00
Xiang Xiao
8b20b97d26 build: Remove the dummy drivers folder under boards
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao
23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao
edb0ce2d5a build: Don't need use $(DELIM) in include statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao
dd61d3d9f9 build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 18:00:40 +01:00
Masayuki Ishikawa
287b9f9c38 drivers: wireless: Add WPA2-PSK in AP mode for gs2200m
NOTE: By default, WPA2-PSK is used instead of WEP

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>>
2020-05-22 10:20:07 +02:00
Masayuki Ishikawa
65e81a6159 drivers: wireless: Add do packet flow cotrol in gs2200m_ioctl_close()
NOTE: active close now works during http audio streaming

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-21 12:46:10 +02:00
Xiang Xiao
1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Masayuki Ishikawa
3c622db780 drivers: wireless: Fix pkt_q_cnt overflow in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-20 13:59:12 +02:00
Xiang Xiao
5eae32577e build: Move INCDIROPT to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Xiang Xiao
bd656888f2 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Gregory Nutt
57bc329aac Run nxstyle all .c and .h files modified by PR. 2020-05-17 14:01:00 -03:00
Gregory Nutt
a569006fd8 sched/: Make more naming consistent
Rename various functions per the quidelines of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions

    nxsem_setprotocol -> nxsem_set_protocol
    nxsem_getprotocol -> nxsem_get_protocol
    nxsem_getvalue -> nxsem_get_value
2020-05-17 14:01:00 -03:00
Masayuki Ishikawa
60b404e076 drivers: wireless: Apply max payload size to gs2200m.c
Also, remove unnecessary initialization for tx packet.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-15 06:49:02 -06:00
Masayuki Ishikawa
3ead63c353 drivers: wireless: Fix to bind() with port=0 in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-14 14:17:47 +02:00
Masayuki Ishikawa
21c588b126 drivers: wireless: Add support for getsockname() to gs2200m
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-14 14:17:47 +02:00
Matias Nitsche
e0d21275df fix all remaining nxstyle errors 2020-05-14 08:32:48 +02:00
Matias Nitsche
5fd9bd5837 stm32: moved all remaining sensor initialization to common board logic 2020-05-14 08:32:48 +02:00
Masayuki Ishikawa
ef169b7ebf drivers: wireless: Handle multiple incoming packets in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-13 13:11:08 +02:00
Juha Niskanen
d666aa623f drivers/mtd/filemtd.c: fix build error 2020-05-11 09:25:45 -04:00
Xiang Xiao
517974787f Rename clock_systime[r|spec] to clock_systime_[ticks|timespec]
follow up the new naming convention:
https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-10 14:35:50 -06:00
Xiang Xiao
b7d922960f Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-08 07:20:49 -06:00
Tobias Johansson
f2c957144a cxd56: Add input support to Spresense audio driver
Add recording support to the Nuttx audio driver for Spresense.
- Supports 16 bit data with 48 kHz sample rate only for now.
- Supports 1 (dual mono) 2 or 4 channels.
- Only analog mics have been tested so digital is considered
  unsupported.
2020-05-08 07:18:22 -06:00
Xiang Xiao
3e00d182d2 Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-06 20:53:11 -06:00
Xiang Xiao
94bb2e05bb syslog: Code outside libc shouldn't call nx_vsyslog directly
since nx_vsyslog is the implementation detail

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-06 20:53:11 -06:00
Pelle
b525218b55 Changed headers for apache 2.0 license 2020-05-05 12:20:53 -06:00
Pelle
59fcd9a3ee hdc1008: minor fixes to comments. 2020-05-05 12:20:53 -06:00
Pelle
8a0b2bc14e Added driver for the hdc1008 temperature/humidity sensor. 2020-05-05 12:20:53 -06:00
Xiang Xiao
d9d2fc0d0a debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-05 08:27:58 -06:00
Xiang Xiao
32b79b22ec Rename pipe2/mkfifo2 to nx_pipe/nx_mkfifo
and don't modify errno anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-04 07:20:02 -06:00
Xiang Xiao
f8a809eb5b Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
Masayuki Ishikawa
350ffb20ad drivers: wireless: Improve packet receiving performance in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-04-30 09:09:17 +02:00
Masayuki Ishikawa
a5e4f0435d drivers: wireless: Fix packet queue overflow in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-04-30 09:09:17 +02:00
Ouss4
d0bb7c137a Use NuttX's signal set functions inside the OS. 2020-04-29 16:40:27 -06:00
liuhaitao
bd924bf7fb syslog: correct to #ifdef CONFIG_SYSLOG_RPMSG to call syslog_rpmsg_init
Same as syslog/Make.defs to use #ifdef CONFIG_SYSLOG_RPMSG to build syslog_rpmsg.c
in which syslog_rpmsg_init defined.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-29 07:08:25 -06:00
Xiang Xiao
972033a61f syslog: Check sc_flush in't NULL before invocation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-27 13:48:56 +08:00
Xiang Xiao
e9773addfa syslog/rpmsg: Fix warning: ‘syslog_rpmsg_write’ defined but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-27 13:48:56 +08:00
zhongan
927cb00f5e fix nxstyle warning
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-26 19:53:43 -06:00
zhongan
546e35fc98 drivers/rptun: replace 'rxbuf_size' and 'txbuf_size' to 'buf_size' in struct 'rptun_rsc_s'.
Change-Id: I7c9da4bd985712a3fde4c56999901434740b33f7
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-26 19:53:43 -06:00
Tobias Johansson
79589eca1a cxd56: replace Sony return values
- Replace Sony error codes with standard ones where possible
- Unify error message and remove some unnecessary info prints
2020-04-21 17:19:52 -06:00
Tobias Johansson
ecc4939453 cxd56: fix volume setting and improve volume range
- Setting volume now works except when in paused state
- Volume range decreased to be a little more sane
2020-04-21 17:19:52 -06:00
Tobias Johansson
36e756a915 cxd56: add support for pause and resume
Implements pause and resume functionality
2020-04-21 17:19:52 -06:00
Tobias Johansson
7a83177419 cxd56: disable unused audio effects
Disables audio effects that are not currently in use.
Also fixes some minor indentation issues.
2020-04-21 17:19:52 -06:00
Alin Jerpelea
d9d720b296 audio: nxstyle fixes for core and drivers
nxstyle fixes for the audio core and drivers

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-04-21 17:19:52 -06:00
Xiang Xiao
6ad91aeb05 Kconfig: change the stack size default to DEFAULT_TASK_STACKSIZE
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-18 07:17:38 -06:00
Tobias Johansson
57e8f0451a cxd56: add initial Nuttx audio driver
Adds an initial Nuttx audio driver supporting the Spresense CXD56.
Being a work in progress the driver has a number of limitations:
- Audio playback only, no recording yet.
- Only 16 bit stereo playback is supported.
- In practice only 48kHz playback is supported due to missing SRC.
- Configure driver in "Device Drivers --> Audio Device Support".
2020-04-16 12:50:05 -06:00
Nathan Hartman
3c829226f9 Fix typos and nxstyle complaints.
arch/x86_64/src/intel64/intel64_tickless.c:
boards/x86_64/intel64/qemu-intel64/src/qemu_freq.c:
drivers/modem/altair/altmdm.c:

    * Fix typos and nxstyle complaints.
2020-04-15 17:04:58 +01:00
zhongan
b4a50a9192 fix nxstyle warning.
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-15 12:30:50 -03:00
zhongan
987472d3bb syslog/rpmsg: remove unused local variable 'g_syslog_rpmsg_channel' which would cause build break.
Change-Id: Ie02ef9202ec2a9ecade62c47e4f8956adb96673f
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-15 12:30:50 -03:00
zhongan
ab566de77a syslog/rpmsg: fix the naming conflict of function 'syslog_rpmsg_putc'.
Change-Id: I3f89bfed71edb85bc3006446c1f9141e95202b5c
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-15 12:30:50 -03:00
Gregory Nutt
6548b41cab drivers/usbdev/usbmsc.c: Run nxstyle; fix complaints. 2020-04-15 12:30:08 -03:00
Juha Niskanen
c2ecdaecf7 drivers/usbdev/usbmsc.c: Fix build error with DEBUGASSERT 2020-04-15 12:30:08 -03:00
Masayuki Ishikawa
6725a29b60 drivers: wireless: Add support for UDP connect in gs2200m.c
NOTE: gs2200m_main.c needs to be updated as well

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-04-14 13:07:17 +02:00
Xiang Xiao
d3c4879113 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-13 12:01:39 -06:00
Xiang Xiao
b22e3b9e28 nuttx: Fix the nightly build warning
lpc2148_spi1.c:142:24: warning: initialization of 'uint32_t (*)(struct spi_dev_s *, uint32_t)' {aka 'unsigned int (*)(struct spi_dev_s *, unsigned int)'} from incompatible pointer type 'uint16_t (*)(struct spi_dev_s *, uint16_t)' {aka 'short unsigned int (*)(struct spi_dev_s *, short unsigned int)'} [-Wincompatible-pointer-types]
  142 |   .send              = spi_send,
      |                        ^~~~~~~~
lpc2148_spi1.c:142:24: note: (near initialization for 'g_spiops.send')

In file included from ieee802154/mac802154_bind.c:49:
ieee802154/mac802154_internal.h: In function 'mac802154_setdevmode':
ieee802154/mac802154_internal.h:788:42: warning: converting a packed 'enum ieee802154_devmode_e' pointer (alignment 1) to a 'const union ieee802154_attr_u' pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  788 |                         (FAR const union ieee802154_attr_u *)&mode);
      |                                          ^~~~~~~~~~~~~~~~~

chip/stm32_hciuart.c: In function 'hciuart_read':
chip/stm32_hciuart.c:2104:30: warning: statement with no effect [-Wunused-value]
 2104 |                       ntotal == (ssize_t)ret;
      |                       ~~~~~~~^~~~~~~~~~~~~~~

wireless/ieee80211/bcm43xxx/bcmf_driver.c: In function 'bcmf_wl_auth_event_handler':
wireless/ieee80211/bcm43xxx/bcmf_driver.c:579:23: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  579 |   type = bcmf_getle32(&event->type);
      |                       ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/bcmf_driver.c:580:25: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  580 |   status = bcmf_getle32(&event->status);
      |                         ^~~~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/bcmf_driver.c: In function 'bcmf_wl_scan_event_handler':
wireless/ieee80211/bcm43xxx/bcmf_driver.c:619:25: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  619 |   status = bcmf_getle32(&event->status);
      |                         ^~~~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/bcmf_driver.c:620:35: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  620 |   escan_result_len = bcmf_getle32(&event->len);
      |                                   ^~~~~~~~~~~
wireless/ieee80211/bcm43xxx/bcmf_bdc.c: In function 'bcmf_bdc_process_event_frame':
wireless/ieee80211/bcm43xxx/bcmf_bdc.c:166:27: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  166 |   event_id = bcmf_getle32(&event_msg->event.type);
      |                           ^~~~~~~~~~~~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c: In function 'sdio_io_rw_direct':
wireless/ieee80211/bcm43xxx/mmc_sdio.c:157:3: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  157 |   ret = SDIO_RECVR5(dev, SD_ACMD52, (uint32_t *)&resp);
      |   ^~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c: In function 'sdio_io_rw_extended':
wireless/ieee80211/bcm43xxx/mmc_sdio.c:239:11: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  239 |           ret = SDIO_RECVR5(dev, SD_ACMD53, (uint32_t *)&resp);
      |           ^~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:244:11: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  244 |           ret = SDIO_RECVR5(dev, SD_ACMD53, (uint32_t *)&resp);
      |           ^~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:257:7: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  257 |       ret = SDIO_RECVR5(dev, SD_ACMD53, (uint32_t *)&resp);
      |       ^~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:265:3: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  265 |   SDIO_RECVR1(dev, SD_ACMD52ABRT, (uint32_t *)&resp);
      |   ^~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~

chip/stm32_adc.c: In function 'adc_reset':
chip/stm32_adc.c:2860:7: warning: unused variable 'ret' [-Wunused-variable]
 2860 |   int ret;
      |       ^~~
chip/stm32_adc.c: In function 'adc_shutdown':
chip/stm32_adc.c:3044:7: warning: unused variable 'ret' [-Wunused-variable]
 3044 |   int ret;
      |       ^~~

chip/stm32_i2c.c:722:12: warning: 'stm32_i2c_sem_wait_noncancelable' defined but not used [-Wunused-function]
  722 | static int stm32_i2c_sem_wait_noncancelable(FAR struct i2c_master_s *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

wireless/gs2200m.c: In function 'gs2200m_read':
wireless/gs2200m.c:727:20: warning: passing argument 1 of 'nxsem_wait' from incompatible pointer type [-Wincompatible-pointer-types]
  727 |   ret = nxsem_wait(dev);
      |                    ^~~
      |                    |
      |                    struct gs2200m_dev_s *

.config:1207:warning: symbol value '' invalid for TESTING_OSTEST_FPUSIZE

platform/audio/cxd56_audio_analog.c:69:13: warning: inline function 'cxd56_audio_clock_is_enabled' declared but never defined
   69 | inline bool cxd56_audio_clock_is_enabled(void);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
platform/audio/cxd56_audio_analog.c:68:13: warning: inline function 'cxd56_audio_clock_disable' declared but never defined
   68 | inline void cxd56_audio_clock_disable(void);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
platform/audio/cxd56_audio_analog.c:67:13: warning: inline function 'cxd56_audio_clock_enable' declared but never defined
   67 | inline void cxd56_audio_clock_enable(uint32_t clk, uint32_t div);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~

chip/stm32_adc.c: In function 'adc_reset':
chip/stm32_adc.c:1348:7: warning: unused variable 'ret' [-Wunused-variable]
 1348 |   int ret;
      |       ^~~
chip/stm32_adc.c: In function 'adc_shutdown':
chip/stm32_adc.c:1496:7: warning: unused variable 'ret' [-Wunused-variable]
 1496 |   int ret;
      |       ^~~

chip/stm32_i2c.c:729:12: warning: 'stm32_i2c_sem_wait_uninterruptble' defined but not used [-Wunused-function]
  729 | static int stm32_i2c_sem_wait_uninterruptble(FAR struct i2c_master_s *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

wireless/lpwan/sx127x/sx127x.c:147:52: warning: missing terminating ' character
  147 | #  warning OOK support is not complete, RX+TX doesn't work yet!
      |                                                    ^

str71_spi.c:435:24: warning: initialization of 'uint32_t (*)(struct spi_dev_s *, uint32_t)' {aka 'unsigned int (*)(struct spi_dev_s *, unsigned int)'} from incompatible pointer type
                                               'uint16_t (*)(struct spi_dev_s *, uint16_t)' {aka 'short unsigned int (*)(struct spi_dev_s *, short unsigned int)'} [-Wincompatible-pointer-types]
  435 |   .send              = spi_send,
      |                        ^~~~~~~~
str71_spi.c:435:24: note: (near initialization for 'g_spiops.send')

chip/pic32mx-lowconsole.c:147:24: warning: 'pic32mx_getreg' defined but not used [-Wunused-function]
 static inline uint32_t pic32mx_getreg(uintptr_t uart_base,
                        ^
chip/pic32mx-gpio.c:113:20: warning: 'pic32mx_value' defined but not used [-Wunused-function]
 static inline bool pic32mx_value(uint16_t pinset)
                    ^
chip/pic32mz-gpio.c:124:20: warning: 'pic32mz_value' defined but not used [-Wunused-function]
 static inline bool pic32mz_value(pinset_t pinset)
                    ^
chip/pic32mx-usbdev.c:3065:1: warning: 'pic32mx_epreserved' defined but not used [-Wunused-function]
 pic32mx_epreserved(struct pic32mx_usbdev_s *priv, int epno)
 ^

mmcsd/mmcsd_spi.c: In function 'mmcsd_mediachanged':
mmcsd/mmcsd_spi.c:1938:7: warning: 'return' with a value, in function returning void
       return ret;
       ^

In file included from partition/fs_partition.c:42:0:
partition/partition.h:66:19: warning: 'read_partition_block' defined but not used [-Wunused-function]
 static inline int read_partition_block(FAR struct partition_state_s *state,
                   ^

local/local_netpoll.c: In function 'local_pollsetup':
local/local_netpoll.c:305:1: warning: label 'pollerr' defined but not used [-Wunused-label]
 pollerr:
 ^~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: If3ea8f32b878aa218072130f7c3018f0d3c1aca5
2020-04-13 12:01:39 -06:00
Gregory Nutt
759d8c1bfa Run nxstyle against files modified in previous commit. 2020-04-13 02:09:34 +08:00
Gregory Nutt
ca2b0a3657 Fix more warnings noted in PR checks
arp/arp_notify.c:132:43: warning: for loop has empty body [-Wempty-body]
           prev = curr, curr = curr->nt_flink);
                                              ^

    sixlowpan/sixlowpan_tcpsend.c:806:31: warning: implicit conversion from 'unsigned int' to 'uint16_t' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Wconstant-conversion]
                                  _SO_TIMEOUT(psock->s_sndtimeo));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Numerous warnings like:

    ieee802154_getreq.c:93:3: warning: implicit declaration of function 'memcpy' is invalid in C99 [-Wimplicit-function-declaration]
      IEEE802154_EADDRCOPY(eaddr, req.attrval.mac.eaddr);
      ^

    nxfonts/nxfonts_cache.c:839:35: warning: for loop has empty body [-Wempty-body]
               fcache = fcache->flink);

    bluetooth/bluetooth_finddev.c💯11: warning: implicit declaration of function 'memcmp' is invalid in C99 [-Wimplicit-function-declaration]
          if (BLUETOOTH_ADDRCMP(dev->d_mac.radio.nv_addr, match->bf_addr))
              ^

    rwbuffer.c:559:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (rwb->rhmaxblocks > 0 && rwb->rhnblocks > 0)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-04-13 02:09:34 +08:00
Gregory Nutt
2aabf76815 Run nxstyle against modified files in PR 2020-04-13 02:09:34 +08:00
Gregory Nutt
62c1389825 Fix warnings noted in PR build checks:
net/telnet.c:1317:40: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
                      if (priv->td_pending < CONFIG_TELNET_RXBUFFER_SIZE)
                          ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    time/lib_localtime.c:569:32: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [33]' [-Wsizeof-array-decay]
              sizeof(lsp->fullname - 1) <= strlen(p) + strlen(name))
                     ~~~~~~~~~~~~~ ^
2020-04-13 02:09:34 +08:00
ligd
cbf31bca5c global change: fix tools/checkpatch.sh warnnings
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
ligd
231ad202ee global change: repace sched_xfree() to kxmm_free()
Changes:
sched_xfree() => kxmm_free()
remove garbage related APIs
remove ARCH_HAVE_GARBAGE

Cause garbage feature move to mm_heap, then don't need
garbage anymore.

Change-Id: If310790a3208155ca8ab319e8d038cb6ff92c518
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
hartmannathan
bfc153ca27
Fix typos in comments and documentation (#750)
* Fix typos in comments and documentation
2020-04-08 06:45:35 -06:00
Nakamura, Yuuichi
9029e4daee Fix nxstyle issues 2020-04-07 06:23:15 -06:00
Nakamura, Yuuichi
776e469b02 Remove type casting to wdentry_t (drivers/) 2020-04-07 06:23:15 -06:00
Gregory Nutt
a6e69a82ad SDIO: Make interface field names conform to standard.
The SDIO interface structure includes fields with names like recvR1 and others.  These cause "Mixed case identifier" errors from nxstyle in all places they are uses.
This change performs a mass substition of recvR with recv_r to correct this coding standard violation.
2020-04-04 18:15:25 +01:00
Ouss4
f438220555 drivers/1wire/1wire.c: Fix a typo that caused a build failure. 2020-04-02 19:42:07 -06:00
Gregory Nutt
9ff1795760 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for rwbuffer.c and those files under drivers/serial, drivers/timers, and drivers/usbdev.

This commit completes that step for all of the files under drivers/.  Still remaining:  All of the files under arch/.
2020-04-01 14:20:04 -03:00
Pelle Windestam
f26dda88d1 drivers/i2c: fixed nxstyle warnings 2020-04-01 08:03:50 +02:00
Pelle Windestam
2b9bdc04cc drivers/can: fixed nxstyle warnings 2020-04-01 08:03:50 +02:00
Gregory Nutt
92eae74340 drivers/rwbuffer.c: Back out unfinished changes
This file is a work in progress and was accidentally committed with some other files.  This PR backs out those changes until I can better verify the changes.
2020-03-31 22:52:39 +01:00
Ouss4
997d4fabb0 Check return from nxsem_wait_uninterruptible
This commit is only for those files under drivers/1wire, drivers/bch,
drivers/can and drivers/mmcsd.
2020-03-31 14:58:09 -06:00
Gregory Nutt
986e594563 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under drivers/pipes and drivers/wireless.
2020-03-31 21:52:50 +01:00
Gregory Nutt
5b74974919 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under drivers/audio, drivers/net, and drivers/lcd.
2020-03-31 20:12:21 +01:00
Alan Carvalho de Assis
c6b01c321c
Check return from nxsem_wait_initialize() (#661)
* Check return from nxsem_wait_initialize()

Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.

This commit is only for those files under drivers/eeprom.
2020-03-30 20:59:47 -06:00
Gregory Nutt
4829c3d2ab Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under drivers/input.
2020-03-31 00:05:57 +01:00
Gregory Nutt
d9b42cebe7 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under drivers/usbhost.
2020-03-30 21:53:12 +01:00
Ouss4
2d13ea7477 drivers/: Check return from nxsem_wait_uninterruptible. 2020-03-30 14:40:01 -06:00
Gregory Nutt
0558aa0a78 "Uninterruptible" semaphore waits must return when canceled.
nxsem_timedwait_uninterruptible() must return -ECANCELED if the thread is canceled:

        include/nuttx/semaphore.h:  Return if nxsem_wait() returns ECANCELED meaning that the thread waiting for the semaphore has been canceled.
        sched/semaphore/sem_timedwait.c:  Same change (the inline version is in semaphore.h, the non-inlined version is in sem_tickwait.c).
        drivers/sensors/lps25h.c and drivers/wireless/bluetooth/bt_uart_bcm4343x.c:  Make sure that the caller deals correctly with the -ECANCELED return value.

    Refer to issue 619.
2020-03-29 11:58:28 -03:00
YAMAMOTO Takashi
f8077022bd Introduce CONFIG_DEFAULT_TASK_STACKSIZE
* The appropriate size of stack varies among archs.
  E.g. for 64-bit sim, 2048 is way too small, especially when the task
  happens to use host OS functionalities.
  I plan to allow an arch provide its own default.

* I plan to use this to replace hardcoded "STACKSIZE = 2048" in APPDIR.
2020-03-26 22:30:13 -05:00
Gregory Nutt
5c0e8e88b1 Revert "Makefile: move INCDIROPT to common place (#625)"
This reverts commit b9ace36fcc.

This change was added by PR 625 but has a serious logic flaw.  It removes all occurrences of INCDIROPT and replaces it with a definition in tools/Config.mk:

    else ifeq ($(WINTOOL),y)
      DEFINE = "$(TOPDIR)/tools/define.sh"
      INCDIR = "$(TOPDIR)/tools/incdir.sh" -w

This logic flaw is the Config.mk is included in all Make.defs files BEFORE WINTOOL is defined.  As a result, the definition is wrong in many places when building under Cygwin with a Windows native toolchain.
2020-03-26 08:50:29 -07:00
Xiang Xiao
b9ace36fcc
Makefile: move INCDIROPT to common place (#625) 2020-03-26 08:09:59 -06:00
YAMAMOTO Takashi
1ffa009c8b Revert "Don't generate .depend anymore"
This reverts commit 79af7fbf4e.

Because:

* btashton reported some issues in local builds:

  https://github.com/apache/incubator-nuttx/pull/603#issuecomment-602264860

* this might be related to the current CI breakage:

  > /bin/sh: 1: /__w/incubator-nuttx/incubator-nuttx/nuttx/tools/mkdeps: not found
2020-03-22 23:07:29 -05:00
Xiang Xiao
79af7fbf4e
Don't generate .depend anymore 2020-03-22 18:15:29 +00:00
Gregory Nutt
547a3cb3d9 Run all .c and .h files in previous commits through nxstyle. 2020-03-22 08:24:07 -05:00
Gregory Nutt
431286532c drivers/: Remove support for CONFIG_FS_READABLE 2020-03-22 08:24:07 -05:00
Gregory Nutt
66ab039b89 drivers/: Remove support for CONFIG_FS_WRITABLE 2020-03-22 08:24:07 -05:00
Gregory Nutt
1ab71814c2 drivers/lcd/pcf8574_lcd_backpack.c: Fix nxstyle issues. 2020-03-18 11:24:59 -06:00
Pierre-Olivier Vauboin
b9b7af1001 drivers/lcd/pcf8574_lcd_backpack.c: increase delay for HOME and CLEAR instructions
Some LCD1602 require at least 1.52 ms wait time after "Clear display" and
"Return home" instructions. Make sure we wait enough.
2020-03-18 11:24:45 -06:00
Nathan Hartman
a5e643b0cd Fix typos in comments and documentation. 2020-03-16 20:01:11 -06:00
Gregory Nutt
98b2949e3b z20x: Improve usability of bootloader
boards/z80/ez80/z20x/configs/w25boot/defconfig:  Increase size of serial Tx buffer.

boards/z80/ez80/z20x/src/w25_main.c:  Add some fflush() in necessary places.  Greatly improves the usability of the UI.

boards/z80/ez80/z20x/README.txt:  Trival update to README

drivers/serial/serial.c and tcdrain.c:  Correct some typos.
2020-03-14 14:07:45 -03:00
Pelle Windestam
fc2d2e2a5e drivers/loop: fix nxstyle issues 2020-03-11 01:25:42 -05:00
Pelle Windestam
5afee5cbd1 drivers/bch: fix nxstyle errors 2020-03-11 01:25:42 -05:00
Pelle Windestam
b6fd522699 drivers/analog: fix nxstyle warnings 2020-03-10 07:20:38 -06:00
Pelle Windestam
8390a66a03 fix nxstyle warnings for drivers/analog/lmp92001.c 2020-03-10 03:53:42 -05:00
Pelle Windestam
633e539362 fix nxstyle warnings for drivers/analog/adc.c 2020-03-10 03:53:42 -05:00
Petro Karashchenko
3fa6baec98 spi: change spi_send() interface to support of 32-bit word transfer
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2020-03-09 08:03:35 -06:00
anjana-tel
655fcf18d0 Fixed RTC periodic callback issue
alarminfo->active = false will kill the signal which will disable the interrupt.
In effect, periodic interrupt will behave like alarm interrupt.

So, removed alarminfo->active = false from rtc_periodic_callback() function

Update rtc.c
2020-03-09 06:21:21 -05:00
Gregory Nutt
0efed95115 drivers/net/tun.c: Eliminate unused function.
Eliminated unused function tun_ipv6multicast().  This eliminates a warning from the build test:

net/tun.c:1061:13: warning: 'tun_ipv6multicast' defined but not used [-Wunused-function]
 static void tun_ipv6multicast(FAR struct tun_device_s *priv)
             ^~~~~~~~~~~~~~~~~
2020-03-08 08:40:05 -05:00
Alan Carvalho de Assis
953a1fafae Fixed compilation issue with poll fds notification
Author: Alan Carvalho de Assis <acassis@gmail.com>
    Fix all nxstyle reported issues

Author: Robin Raymond <robin@opticaltone.com>
    Fixed compilation issue with poll fds notification.
    https://github.com/apache/incubator-nuttx/issues/483
2020-03-07 19:18:50 -03:00
Gregory Nutt
c8b39b48bb z20x: w25boot configuration nees CONFIG_FS_WRITABLE
boards/z80/ez80/z20x/configs/w25boot/defconfig:  needs CONFIG_FS_WRITABLE=y

Style cleanup / Correct file header

  drivers/bch/bchdev_register.c, drivers/mtd/ftl.c, and fs/driver/fs_findblockdriver.c:
  Run through nxstyle; replace BSD-3 license with Apache 2.0
2020-03-07 16:59:38 -03:00
Xiang Xiao
553585a000 net: phy_notify_subscribe call phy_notify_unsubscribe if sigev_notify equals SIGEV_NONE 2020-03-07 12:59:47 -06:00
Gregory Nutt
3a7bf78c56 drivers/mtd/w25.c: Add support for work-alike AMIC parts
Verified with 8Mbit AMIC A25L080 part.
2020-03-07 12:12:50 -06:00
Gregory Nutt
ee9949a724 z20x: Fix some SPI/W25/Timer issues.
arch/z80/src/ez80/ez80_spi.c:  Do not configure SPI chip select pin.  It is not used by the driver and configuring it just clobbers other usage of that pin.  Add some additional debug outputs; correct some exiting debug outputs.

drivers/mtd/w25.c:  Add some debug output.

boards/z80/ez80/z20x/src/ez80_w25.c:  Correct SPI bus number used in initialization.  Only SPI1 is supported.

arch/z80/src/ez80/ez80_timerisr.c:  Some initial timer configuration fixes.
2020-03-06 21:09:14 +01:00
Alin Jerpelea
34f274f9c0 cxd56: move ISX012 camera sensor driver
This sensor driver needs rework to match the needed layout for standar NuttX driver.
In the meantime it is moved to board specific sensors to fix the violation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-03-06 08:58:57 -06:00
Juha Niskanen
83b6953624 drivers/sensors/sgp30.c: Reset I2C in case init msg takes too long
We have experimentally found out that this change helps with somewhat quirky CO2/VOC-sensor.
2020-03-05 08:01:43 -06:00
GAEHWILER Reto
85e461c59c STM32H7/STM32F30: Typos, register correction and extension
* Correction in stm32h7x3xx_rcc
* Adding GPIO_TIM2_CH1OUT_1 to stm32f30xxx_pinmap
* Comment typo fix in drivers/mmcsd/mmcsd_spi.c
2020-03-03 09:20:58 -06:00
Juha Niskanen
f3490e42c3 Fix typos in comments 2020-03-03 09:11:57 -06:00
macman88
43dfbdb348 Battery monitor support (#404)
* Adding support for BQ769x0 Battery Monitor IC (Work In Progress)
* Additional changes to support BQ769x0
* Store cell count and chip type when setting up
* Added shutdown, limits, charge/discharge switch, and clear faults operations
* Added support for current measurement; some cleanup
* Updated temperature reporting.  Fixed negative current reporting.
* When setting safety limits, update limit structure with actual values used.
* Added note on battery limit structure
* Updates to BQ769x0.  Re-ordered fault reporting, added fault cache, added ordered fault clearing
2020-02-28 18:18:50 -06:00
macman88
922e67c7cc MCP9844 shutdown mode support (#403)
* Added shutdown support to the MCP9844 sensor driver.
* Clean up debug messages
* Clean up comments and formatting
2020-02-28 16:21:56 -06:00
Xiang Xiao
c161dc07a9 syslog/file: Remove syslog_dev_uninitialize return value
To simplify the initializition process
2020-02-27 08:02:50 -06:00
Xiang Xiao
3e41e82942 drivers/serial: Remove the nonexistent CMSDK_UART option 2020-02-24 08:47:36 -06:00
Xiang Xiao
1d339eb80c syslog: Make g_default_channel as static 2020-02-24 08:47:27 -06:00
Xiang Xiao
46e22d7fd9 syslog/rpmsg: Don't overwrite up_putc
Hook into syslog subsystem like ramlog approach
2020-02-24 08:47:13 -06:00
Xiang Xiao
cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Xiang Xiao
ebdfc93ee3 drivers/syslog: Rename SYSLOG_NONE to SYSLOG_DEFAULT
Since syslog still output if ARCH_LOWPUTC == y and select the default syslog device by ARCH_LOWPUTC
2020-02-23 09:11:22 -06:00
Xiang Xiao
bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Nicholas Chin
0f284c3025 driver/ioexpander: adds driver for the PCA9538 I2C ioexpander 2020-02-19 11:53:08 -06:00
Xiang Xiao
892290f76b syslog: Call syslog_rpmsg_init inside syslog_initialize like other syslog driver 2020-02-19 07:19:34 -06:00
Xiang Xiao
553f12b4e8 syslog: Remove SYSLOG_SERIAL_CONSOLE which isn't really used 2020-02-19 07:19:20 -06:00
Nicholas Chin
85caee63b4 drivers/analog: Adds driver for the ADS7828 I2C analog to digital converter 2020-02-18 14:19:40 -06:00
Xiang Xiao
51a2171c71 ramlog: Remove g_ramlog_syslog_channel since it's same as g_default_channel
And remove syslog_init_e because all initialization is later now and we don't
distinguish the initialition phase anymore after ramlog don't need special
initialize.
2020-02-18 13:04:45 -06:00
Xiang Xiao
dcaaf2d912 ramlog: Remove all ramlog_consoleinit related code
Because we can get the same function by CONSOLE_SYSLOG/syslog_console_init.
BTW, it isn't a good choice to use g_ramlogfops as /dev/console since nsh
will read back what it send out which will surprise most people.
2020-02-18 12:57:43 -06:00
Xiang Xiao
f982ee43db drivers/serial: Remove the lowconsole driver
Replace with the syslog console driver which has more capability than lowconsole
2020-02-18 12:51:09 -06:00
Gregory Nutt
21aef0dd68 drivers/*/Kconfig: Consolidate driver Kconfig Files.
This commit does two things:

1. First, it reorganizes the driver Kconfig files so that each is self contained.  Before, a part of the driver configuration was in drivers/Kconfig and the rest was in in drivers/xyz/Konfig.  Now, all of the driver configuration is consolitated in the latter.

2. Second, this commit correct numerous serious errors introduced in a previous reorganization of the driver Kconfig files.  This was first noted by Nicholas Chin in PR270 for the case of the drivers/i2c/Kconfig but some examination indicates that the error was introduced into several other Kconfig files as well.

The nature of the introduced error was basically this:

- Nothing must intervene between the menuconfig selection and the following conditional configuration otpions.
- A previous PR erroneously introduced unconditional options between the menuconfig and the following confditional logic, thus corrupting the driver menus.

This error was easy to make because the driver Kconfig files were not well modularized.  Making them fully self-contained should eliminate this kind of error in the future.
2020-02-15 15:19:11 +01:00
Gregory Nutt
f5e0bb2d30 Run all files modified by PR274 through nxstyle. 2020-02-15 07:17:22 -06:00
Xiang Xiao
20a9a62fdf Make compare_timespec public so timer driver could reuse it 2020-02-15 07:17:07 -06:00
Nicholas Chin
ddc8f52202 drivers/eeprom/i2c_xx24xx.c: increase number of retries in ee24xx_waitwritecomplete 2020-02-14 09:20:33 -06:00
Juha Niskanen
15b78abccf Fix typos in comments 2020-02-14 08:50:45 -06:00
Gregory Nutt
3c0b49448a Network Loopback Driver: A configuration option to control packet size.
Historically, the loopback driver used the largest packet size of all enabled link layer protocols.  This permitted packets to be forward via the loopbak device with no major loss of performance.  However, in experimenting with configurations where no other link layer protocols were enabled, this means the loopback packet size was set to the smallest possible size, to the SLIP minimum of 296 bytes.  This resulted in terrible loopback performance.

    This commit adds an option to increase the loopback packet size with the option CONFIG_NET_LOOPBACK_PACKETSIZE.

    The loopback driver packet buffer should be quite large.  The larger the loopback packet buffer, the better will be TCP performance of the loopback transfers.  The Linux loopback device historically used packet buffers of size 16Kb, but that was increased in recent Linux versions to 64Kb.  Those sizes may be excessive for resource constrained MCUs, however.

    The network still enforces the lower limit that is the maximum packet size of all enabled link layer protocols.  But this new option permits the loopback packet size to be increased from that.

    * net/Kconfig:  Adds CONFIG_NET_LOOPBACK_PKTSIZE option
    * include/nuttx/net/netconfig.h:  Assures that the packet size that is used is at least as large as the largest packet size of other link layer protocols.
    * drivers/net/loopback.c:  Use that larger packet size.
    * boards/sim/sim/sim/configs/tcploop/defconfig:  Set the loopback packet size to 1500
2020-02-10 22:17:32 -03:00
Xiang Xiao
d68693f74c drivers/telnet: Stop the loop if SIGSTP char is match and SIGINT not enabled
Change-Id: I78510616e68330b0171230ca0e081c0d702a6f42
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-10 09:21:34 -06:00
Gregory Nutt
d09af3b7f3 Run .c and .h files modified by PR241 through nxstyle. 2020-02-10 08:57:20 -06:00
liuhaitao
bbd102808d drivers/net/telnet.c: correct typo error to fix build break
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-02-10 10:12:10 -03:00
Gregory Nutt
10721c0826 Kconfig: Move the ARCH_PHY_INTERRUPT option to net/Kconfig and make it
unconditionally selectable.
2020-02-09 00:55:41 +00:00
Xiang Xiao
3cb259daa6 drivers/Kconfig: Move if/endif to subfolder Kconfig
Move if/endif to subfolder Kconfig and make ARCH_HAVE_XXX option always selectable by moving out of if/endif
2020-02-08 08:04:05 -06:00
Xiang Xiao
a8de37fbec Ensure all source code end with one and only one newline
by this command:
git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
2020-02-08 07:25:56 -06:00
Gregory Nutt
b35bf20824 drivers/net/telnet.c: Run file changed in last PR through nxstyle. 2020-02-07 07:25:57 -06:00
Xiang Xiao
652c763a32 drivers/net/telnet.c: Unify the coding style in telnet driver
Unify th ecoding style in the telenet driver and ensure kernel version API used in all place and remove the unused stuff
2020-02-07 07:24:43 -06:00
Xiang Xiao
6be0b2f1b8 drivers/net/telnet.c: Trigger SGA and ECHO proactively in the character mode
Trigger SGA and ECHO proactively in character mode otherwise Ubuntu bultin telnet can't enter this mode

Change-Id: I8aa2ab2b31c35007077c701c264b3971152435f0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-07 07:23:45 -06:00
Xiang Xiao
ed2a002ee5 drivers/net/telnet.c: Remove g_telnet_common global variable
Remove g_telnet_common global variable; we can reuse g_clients_sem as the lock guard

Change-Id: Ic3af9f2116f70523a4249b29c65bd1fb83ca4da2
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-07 07:21:54 -06:00
Xiang Xiao
70786fa758 drivers/net/telnet.c: telnet driver should return -EAGAIN if O_NONBLOCK
Telnet driver should return -EAGAIN is O_NONBLOCK is active also should report -EPIPE first

Change-Id: I7ad2df15377c7bec8e22d0f5d1b54f7ce33eb0db
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-07 07:20:54 -06:00
Xiang Xiao
350d25c855 driverts/net/telnet.c: Refine Ctrl+C handling in telnet driver
Refine Ctrl-C handling in telnet driver to avoid issue the kill more than once

Change-Id: I9fcec5d861ea85258170f379d741d2bb8e4d9b9e
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-07 07:19:58 -06:00
Xiang Xiao
3c425a8d82 drivers/net/telnet.c Remove the unnecessary '\0' terminator from telnet driver 2020-02-07 07:19:21 -06:00
Xiang Xiao
b216d915e1 drivers/net/telnet.c: Split common_ioctl to telnet_ioctl and factory_ioctl
Splict common_ioctl into telnet_ioctl and factoral_ioctl.  Rmove the wrong telnet_poll from g_factory_fops

Change-Id: I39f278763ff279d464c5be6728b9936c6cab16eb
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-07 07:17:18 -06:00
Peter van der Perk
499607d68f
S32K add support for Nxp drone boards (#224)
* S32K add support for Nxp drone boards

* Update arch/arm/src/s32k1xx/hardware/s32k1xx_rtc.h codestyle

Co-Authored-By: David Sidrane <David.Sidrane@Nscdg.com>

Co-authored-by: Jari van Ewijk <jari.vanewijk@nxp.com>
Co-authored-by: David Sidrane <David.Sidrane@Nscdg.com>
2020-02-07 04:53:40 -08:00
David Sidrane
cabd6927bc
Merge pull request #223 from han1raaijmakers/KinetisTJA110X
Kinetis renamed TJA1100 to TJA110X registers
2020-02-07 04:08:41 -08:00
Peter van der Perk
513475c11c Kinetis renamed TJA1100 to TJA110X registers 2020-02-07 10:04:48 +01:00
Xiang Xiao
ac2aec96e0 Refine Kconfig under drivers folder
1.Move subsystem config into sub folder
2.Remove the duplicated if/endif

Change-Id: I0b96ac0570ee1ba62bbb95586381f5410b90bcf0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-06 08:47:30 -03:00
YAMAMOTO Takashi
d4e5736712 Improvements to gs2200m
gs2200m: Make CHECK_VERSION use Kconfig

    gs2200m: Add a config to set log level
2020-02-05 18:32:33 -03:00
YAMAMOTO Takashi
85617c05fc gs2200m: Add a comment to mention the referred document
Many of existing comments in this file refer to the document.
Like "NOTE: See 3.2.2.3 Annexure - HI Frame Format (From Host)"
2020-02-05 09:01:44 +01:00
Xiang Xiao
1321c34022 drivers/net/phy_notify.c: Use IFNAMSIZ for interface name size
Replace CONFIG_PHY_NOTIFICATION_MAXINTFLEN with IFNAMSIZ
2020-02-02 11:02:39 -06:00
Xiang Xiao
0159726da5 drivers/net/slip.c: It's enough to only hold the net lock in SLIP driver 2020-02-02 08:27:33 -06:00
Xiang Xiao
ca8191ad41 drivers/net/slip.c: Don't use fd related operation in SLIP kernel thread 2020-02-02 08:26:30 -06:00
Xiang Xiao
c5b1554d84 Remove NETDEV_LOOPBACK option, NET_LOOPBACK is enough 2020-02-02 08:25:06 -06:00
Xiang Xiao
2d7c072723 Remove duplicated NET_SLIP option from drivers/net/Kconfig 2020-02-02 08:24:50 -06:00
Xiang Xiao
e9bc32cdbc Improve tun (#198)
* Remove the code duplication in tun_net_receive_tap and remove the unused filep field
  * Shouldn't return -EBUSY in tun_write.  Let the caller wait until the write buffer free
  * Handle that write buffer is ready first correctly in tun_read
  * Remove the unused tun_ipv6multicast
2020-02-02 08:02:17 -06:00
Xiang Xiao
5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao
0b860726db Ensure psock_socket and psock_accept initialize s_crefs to 1
This simplifies the caller usage
2020-01-31 13:45:14 -06:00
Xiang Xiao
9f9566c0eb Rename net_clone/net_dupsd[2] to psock_dup2/net_dup[2] like vfs 2020-01-31 13:45:14 -06:00
Xiang Xiao
80277d1630
Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
Xiang Xiao
68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Gregory Nutt
f27152a1af Fix several coding standard issues in the generic SPI LCD driver. 2020-01-28 12:00:02 -03:00
Dave Marples
e99a8d192d Generic SPI interface for controlling an LCD display 2020-01-28 11:32:35 -03:00
Masayuki Ishikawa
6ad906488e drivers: wireless: Return OK with 0 bytes in gs2200m_send_bulk() when device is busy.
Also, change max retry count and interval in driver layer.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-01-28 09:18:50 +01:00
YAMAMOTO Takashi
83354983c3 Fix "with with" typos
In many cases, remove one of them.
In a few places, it looks like a typo of "width" actually.
2020-01-27 08:46:46 +01:00
patacongo
ecb2f99dfb drivers/rwbuffer.c: Fix coding style issues. (#164)
Run .c and .h files affected by PR163 through nxstyle and fix all coding style complaints.

Co-authored-by: Gregory Nutt <gnutt@nuttx.org>
2020-01-25 15:26:42 +01:00
Satoshi Togawa
aad1ab2574 Fix assertion occurrence in rwb_invalidate_writebuffer() 2020-01-25 07:48:34 -06:00
Gregory Nutt
211c6dcaa7 Remove unused configuration option CONFIG_RAMDISK 2020-01-23 17:42:56 -03:00
Xiang Xiao
1e3f457c9e Remove TIME_EXTENDED option to more conform C standard
Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h files modified in this PR through nxstyle and correct all coding standard problems.

Xiang Xiao <xiaoxiang@xiaomi.com>

    Remove TIME_EXTENDED option to more conform C standard

    Note: the code/data size increment is small
2020-01-23 08:17:22 -06:00
Xiang Xiao
9a8ff07716 Change boards/renesas/m32262f8 to boards/hc/m16c
to fix the follow error:
Refresh skp16c26/ostest
LN: include/arch/board to /workspace/mirtos/nuttx/boards/renesas/m32262f8/skp16c26/include
LN: include/arch/chip to arch/renesas/include/m32262f8
2020-01-22 20:44:18 -06:00
Oleg
41efa2ae72 drivers/can/can.c: Fix errors with pointers when using internal OS interface (#118)
Author: Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h files in last PR through tools/nxstyle and correct all coding standard complaints.

Author: Oleg <ev.mipt@gmail.com>

    * Fix CAN driver to work with internal OS interfaces.  Store internal file pointer in f_priv and use it then to distinct readers (See issue #111)
    * Store reader pointer in f_priv instead of filep
    * Don't need in filep in can_reader_s
2020-01-17 09:46:39 -06:00
raiden00pl
e23d58e86d drivers/sensors/lsm303agr: fix compilation warnings and run through nxstyle; drivers/sensors/lsm6dsl: run through nxstyle 2020-01-16 12:27:18 -03:00
Alan Carvalho de Assis
29f480f57f boards/arm/stm32/stm32f4discovery/: Add board support to external LoRa NiceRF module 2020-01-12 10:59:30 -06:00
Masayuki Ishikawa
784408e617 drivers: serial: Fix a wrong variable in serial.c in SMP mode. 2020-01-10 09:38:51 -06:00
Alin Jerpelea
275f4baf9f Fix USB issues
Author: Alan Carvalho de Assis <acassis@gmail.com>

    Run nxstyle on .c and .h files and fix it

Author: Alin Jerpelea <alin.jerpelea@sony.com>

    drivers: usbdev: minor fix

    drivers: usbdev: usbmsc full speed not available

      Change transfer size to be based on maxpacket size.

    drivers: usbdev: Fix string ID calculation

      For *_STRBASE defines, it already unnecessary because composite device setup
      has been changed, it would be calculated by *_composite.c in board sources.

    drivers: usbdev: Fix invalid/unsupported command processing

      Mass Storage Class shall stall when invalid or unsupported commands
      has been recieved.

    drivers: usbdev: Remove unnecessary reset logic

    drivers: usbdev: Flags comparison fix

    drivers: usbdev: Descriptor type mismatch fix when dual speed is enabled
2020-01-10 12:09:05 -03:00
Adam Feuer
237c0cca09 CDC ECM Ethernet over USB High Speed for SAMA5D36-Xplained #68
Author: Alan Carvalho de Assis <acassis@gmail.com>

    Run nxstyle against .c .h files and fix it

Author: Adam Feuer <adam@starcat.io>

Summary

    Adds CDC ECM Ethernet over USB High Speed for SAMA5D36-Xplained
      (and maybe other boards) (most of the code was there already,
      but didn't work out of the box for the SAMA5D36-Xplained)
    Only SAMA5D36-Xplained has been tested so far

Impact

    None if you don't use the CDC ECM Ethernet driver
    On SAMA5D36-Xplained, this adds high-speed Internet connectivity
      over USB 2.0 High Speed. via the USB CDC ECM Gadget driver.
    It may work on other boards too.
    This also fixed full-speed (low-speed) mode for the board too.

Limitations

    Hasn't been tested on anything other than SAMA5D36-Xplained board.

TODO

    Ideally this would include a composite RNDIS device so it would
      also work seamlessly on Windows. That is for a future PR
    Ideally this would include software to help configuration via
      mDNS/DNS-SD for plug and play compatibility with Linux and macOS.
      That is for a future PR.

Detail

    Only a few lines of C driver code needed to be changed, since the
      capability was there already. The rest is config and documentation.
    Changes the SAMA5D3-Xplained board bringup to match the SAMA5D3-EK
      board bringup
    A helper script to configure Linux routing and iptables NAT is also
      provided, along with documentation on how to use it.

Testing

    Manual, on a Ubuntu Linux 19.10 system and MacOS 10.14.6 Mojave
      MacBook Pro.

How To Verify

    Follow the new CDC ECM Ethernet over USB instructions in the board
      README.txt file

Commits:

    remove non-UTF-8 chars in comment and reformat

    removed unneeded comment markers

    instructions for using the defconfigs

    removed EMAC from config

    - to prove this example only needs the CDC ECM Ethernet over USB to work

    added CDC-ECM Ethernet over USB info to README

    added U-Boot image

    added netusb helper script

    - this can configure the Linux network interface and routes
      so you can ping or access the NuttX system via TCP/IP.

    renamed defconfig dirs to be ethernet-over-usb

    - was usb-over-ethernet which is not right

    added USB DMA to defconfigs

    updated readme with autoboot and debugging info

    bringing ethernet-over-usb examples into parity

    added cdc ecm ethernet over usb with telnetd config

    added defconfig

    only use phy interrupt if netdevices is ethernet

    - because now netdevice could be CDC ECM ethernet over usb
      which has no PHY interrupt

    add bringup to Makefile

    add bringup

    app init cleanup

    init cdc ecm driver and rndis driver; some cleanup

    fixed some typos and odd characters

    usb over ethernet working over usb 2.0 hs
2020-01-10 07:13:37 -03:00
Xiang Xiao
fbad85000f Fix the incorrect return value handling in bt_hcicore.c/hc_sr04.c introduced by 6a3c2ade
Report by juniskane

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-09 15:30:01 -03:00
Alin Jerpelea
ecfdd6e056 smartfs improvements #66
Author: Alan Carvalho de Assis <acassis@gmail.com>

    Run nxstyle on all .c and .h and fix all issues

Author: Alin Jerpelea <alin.jerpelea@sony.com>

    drivers: mtd: smart: Add smartfs fsck feature

    Support fsck to check and repair the smartfs file system. If the power
    loss occurs during writing into the flash, the dead space are created
    in flash after the next power cycle. To avoid this problem, introduce
    fsck and keep the consistency of file system in initializing smartfs.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

commit 60927c5fb6a353994341601f55071c618e97682b
Author: Alin Jerpelea <alin.jerpelea@sony.com>
Date:   Thu Dec 28 18:27:21 2017 +0900

    drivers: mtd: smart: Fix duplicate sector selection in SmartFS

    Add care for 16-bit sequence without CRC.

    drivers: mtd: smart: Check CRC of duplicate sectors

    In the illegal case by power-loss, when the multiple logical sectors are
    duplicated, we compare the sequence number of each sector and select the newer
    sector. Just in case, add CRC check for the newer sector. If the newer sector
    has CRC error, then we use the older sector.

    drivers: mtd: smart: SPI-Flash recovery from the initial error state

    The FLASH may be not erased in the initial delivery state.
    Just in case for the recovery of this fatal situation,
    after once erasing the sector, return the sector as a free sector.

    drivers: mtd: smart: Fix error handling in smartfs mtd driver

    Add error handling in relocate sector.

    drivers: mtd: smart: Fix initialize sector sequence value in smartfs

    Fix initialization of sequence value into sector header and also avoid
    unaligned memory access when CONFIG_MTD_SMART_ENABLE_CRC=n.

    drivers: mtd: smart: Fix handling of duplicate sector in smartfs

    In smartfs scan, if duplicate logical sector is found on the device,
    then smartfs selects the winner sector by comparing sequence number,
    and the loser sector is soon released. Fix a bug this loser sector
    is registered into logical-to-physical sector mapping table.
2020-01-09 10:14:39 -03:00
liuzhao
dc5d8f7c44 Add Quectel EC20 4G LTE Module USB CDC/ACM support
Author: Alan Carvalho de Assis <acassis@gmail.com>

    Run nxstyle to check .c and .h files and fix reported issues

Author: liuzhao <happypapa@yeah.net>

    Add Quectel EC20 4G LTE Module USB CDC/ACM support
2020-01-09 08:00:05 -03:00
Gregory Nutt
9d5d60fee1 Run all .c and .h files in last PR49 through nxstyle. 2020-01-07 09:54:35 -06:00
Alin Jerpelea
a8d63c0cec various fixes (#49)
* libs: libc: math: Fix tanh() math functions
* drivers: mtd: smart: Fix trivial debug message in smartfs
* binfmt: libelf: Fix fd not closed on error
* binfmt: Fix stack memory leak on error
* fs: romfs: Fix private data not free on error
* sched: group: Fix reference after free memory
* sched: clock: Fix clock sync

Fix clock sync when CONFIG_RTC_HIRES is enabled
2020-01-07 09:06:02 -06:00
Xiang Xiao
926a41feba bcm43xxx: correct typo error to fix build break in photon board (#45)
Change-Id: I340b8d6d939b5049d25789d04c4a334bc97b1067
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-01-07 07:12:08 -03:00
Mateusz Szafoni
d644567dff sx127x: fix some coding standard problems (#36) 2020-01-04 08:58:47 -03:00
Xiang Xiao
d612fd3dc5 Squashed commit of the following:
Author: Alan Carvalho de Assis <acassis@gmail.com>

    Run all .h and .c files modified in last PR through nxstyle.

Author: Xiang Xiao <xiaoxiang@xiaomi.com>

    Fix stm32l4_otgfshost.c: error: 'ret' undeclared (#32)

    result by commit 6a3c2aded6

    Change-Id: I68ba79417d8da102da8d91c74496961aef242dd9
    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-03 11:38:02 -03:00
raiden00pl
9b2fa8152c drivers/sensors/lsm6dsl.c: fix various compiler warnings 2020-01-03 08:09:26 -06:00
Xiang Xiao
91d483591d drivers/modem/altair/altmdm_sys.c: Fix modem/altair semaphore related compiler warning 2020-01-02 20:37:48 -06:00
Xiang Xiao
6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Xiang Xiao
3187dde36c fix sim:bluetooth compiler error (#18)
wireless/bluetooth/bt_null.c:274:10: warning: implicit declaration of function 'bt_driver_register'; did you mean 'bt_netdev_register'? [-Wimplicit-function-declaration]

   return bt_driver_register(&g_bt_null);

sim_bringup.c:324:9: error: too few arguments to function 'bt_netdev_register'

   ret = bt_netdev_register();
2019-12-31 09:30:44 -06:00
Xiang Xiao
87cf5c58ae Correct some problems with network timed events when there are multiple network devices in the configuration.
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>

    Ran nxstyle against many of the affected files.  But this job was too big for today.  Many of the network drivers under arch are highly non-compiant and generate many, many faults from nxstyle.  Those will have to be visited again another day.

Author: Xiang Xiao <xiaoxiang@xiaomi.com>

    This effects all network drivers as well as timing related portions of net/: devif_poll_tcp_timer shouldn't be skipped in the multiple card case.  devif_timer will be called multiple time in one period if the multiple card exist, the elapsed time calculated for the first callback is right, but the flowing callback in the same period is wrong(very short) because the global variable g_polltimer is used in the calculation.  So let's pass the delay time to devif_timer and remove g_polltimer.
2019-12-24 10:37:30 -06:00
chao.an
5875f07a21 drivers/wireless/ieee80211/bcm43xxx/: Correct parameters passed to wd_start() in all calls. 2019-12-13 08:08:13 -06:00
Nathan Hartman
9655730ef8 Fix various typos and spelling errors. 2019-12-12 07:41:51 -06:00
Juha Niskanen
abdafaeccc drivers/power: Fix PM build failure with CONFIG_PM_GOVERNOR_MEMORY==1 2019-12-10 07:34:59 -06:00
Gregory Nutt
9e4602a2f4 drivers/mtd: Apply tools/nxstyle to a few files. Lots more to check. 2019-12-07 08:25:16 -06:00
Gregory Nutt
2761279839 drivers/bch, pipes, timers: Run drivers through tools/nxstyle, correcting as many complaints as possible. 2019-12-06 23:36:33 -06:00
Gregory Nutt
d1584d60a2 drivers/sensors: Run all sensor drivers through tools/nxstyle, correcting as many complaints as possible. 2019-12-06 19:07:34 -06:00
Gregory Nutt
715383adc7 Minor addition to commit cbde36e406 2019-12-05 15:20:48 -06:00
Gregory Nutt
cbde36e406 drivers/analog: Run all wireless drivers through tools/nxstyle, correcting as many complaints as possible. 2019-12-05 15:13:55 -06:00
Gregory Nutt
2a83c0808c drivers/net: Run all wireless drivers through tools/nxstyle, correcting as many complaints as possible. 2019-12-05 14:54:50 -06:00
Gregory Nutt
504b0e8b5b drivers/wireless: Run all wireless drivers through tools/nxstyle, correcting as many complaints as possible. 2019-12-05 11:49:12 -06:00
David Sidrane
f822107efb drivers/serial/Kconfig: Split serial Rx/Tx DMA. 2019-12-03 07:06:30 -06:00
Gregory Nutt
4e2b2e8ce7 Coding standard corrections in last PR. 2019-12-02 08:42:50 -06:00