Commit Graph

3391 Commits

Author SHA1 Message Date
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