Commit Graph

343 Commits

Author SHA1 Message Date
YAMAMOTO Takashi afe3c2cdb5 drivers/usbdev/rndis.c: Fix syslog formats 2020-11-27 05:18:57 -06:00
YAMAMOTO Takashi aad25bc4c8 drivers/usbdev/cdcecm.c: Fix a syslog format 2020-11-25 05:11:26 -08:00
YAMAMOTO Takashi 4b740fa13a drivers/usbdev/cdcecm.c: Fix an undefined variable in a syslog call 2020-11-25 05:11:26 -08:00
Simon Piriou da70eb5c56 usbdev: adb: fix missing break 2020-11-12 21:35:07 -08:00
Juha Niskanen ca7a7ccbeb Fix some typos in comments
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-11-08 18:58:20 +01:00
Simon Piriou b405722276 usbdev: add Android Debug Bridge driver 2020-10-26 08:28:48 -03:00
Xiang Xiao acca9fcc3b sched/wdog: Remove MAX_WDOGPARMS and related stuff
since the variable arguments are error prone and seldom used.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-14 08:19:50 -06:00
Xiang Xiao a0ce81d659 sched/wdog: Don't dynamically allocate wdog_s
to save the preserved space(1KB) and also avoid the heap overhead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
2020-08-11 12:28:55 -06:00
Xiang Xiao f618de9c97 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Xiang Xiao 4c706771c3 sched/wdog: Replace all callback argument from uint32_t to wdparm_t
and alwasy cast the argument of wd_start to wdparm_t

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Masayuki Ishikawa 3b76666a1e drivers: usbdev: Fix default value for RNDIS_NWRREQS
Summary:
- Change default value for RNDIS_NWRREQS based on NET_TCP_WRITE_BUFFERS

Impact:
- This commit affects RNDIS use cases

Testing:
- spresense:rndis with CONFIG_NET_TCP_WRITE_BUFFERS=y

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-08 05:36:07 -05:00
Johanne Schock 8792ade0fe Several USB improvements.
Kinetis: Reworked USB driver for setup out data phase.
Freedom K28: New config nshsdusb, with RNDIS support
PL2303: Try to avoid clone detection.
General: various nxstyle fixes
General: license changed
2020-07-24 13:24:53 -03: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
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
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
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
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
hartmannathan bfc153ca27
Fix typos in comments and documentation (#750)
* Fix typos in comments and documentation
2020-04-08 06:45:35 -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
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
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
Juha Niskanen f3490e42c3 Fix typos in comments 2020-03-03 09:11:57 -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 bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -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
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 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 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
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 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 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
Gregory Nutt 244437257b drivers/: Within the OS, nxisg_usleep() should be used instead of usleep(). usleep() is a cancellation point and sets the errno value. Neither of which should be done inside the OS. 2019-11-29 17:37:39 -06:00
Juha Niskanen b4f6a3a878 drivers/usbdev/cdcacm.c: Fix memory leak of RX failsafe timer. 2019-10-08 08:01:30 -06:00
Nathan Hartman 366053e464 Fix typos, 1 in a #define, others in comments. This changes one definition: _MQ_TIMEDRECIEVE is changed to _MQ_TIMEDRECEIVE. It appears this symbol is not used anywhere. 2019-09-11 08:56:56 -06:00
Gregory Nutt cc694e9862 Fix some new warnings found in build testing. 2019-09-10 08:20:53 -06:00
Gregory Nutt 46d435fc65 Various cosmetic changes. 2019-09-09 14:47:47 -06:00
Anthony Merlino 1e3a60155e Merged in antmerlino/nuttx/rndis (pull request #980)
drivers/usbdev/rndis: Expose option to change number of write requests that can be in flight.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-10 17:52:19 +00:00
Anthony Merlino 9fa5bd8df4 drivers/usbdev/rndis.c: Fixes copy/paste error introduced in last rndis change. 2019-07-23 17:59:53 -06:00
Anthony Merlino 7a0a032cd9 drivers/usbdev/rndis: Fixes issue with DEBUGASSERT when using composite device and endpoint numbers not being the default. 2019-07-23 16:12:50 -06:00
Alin Jerpelea 5dc1618982 Merged in alinjerpelea/nuttx (pull request #924)
drivers: usbdev: usbmsc: fix usbmsc_exportluns declaration

* drivers: usbdev: usbmsc: fix usbmsc_exportluns declaration

    fixes the following error
    apps/system/usbmsc/usbmsc_main.c:567:
    undefined reference to `usbmsc_exportluns'

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

* configs: spresense: nsh: register the procfs

    this is a configuration change in sync with the other ones

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

* configs: spresense: enable READLINE_CMD_HISTORY

    we are following the default spresense board configuration
    regarding CMD HISTORY configuration

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

* configs: spresense: enable by default SPI 4 and 5

    we are following the default spresense board configuration
    regarding SPI configuration

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

* configs: spresense: add I2C configuration

    in sync with the default spresense board configuration

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

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-07-01 11:45:56 +00:00
Gregory Nutt 0d203fd535 drivers/serial: The upper half serial driver configuration CONFIG_SERIAL_DMA used to enable DMA on both RX and TX streams. This was replaced with CONFIG_SERIAL_RXDMA and CONFIG_SERIAKL_TXDMA which will permit supporting DMA on only one or both streams. 2019-04-24 12:11:40 -06:00
Ramtin Amin 7d2bd2371f arch/arm/src/stm32f7: USB High speed for STM32F7 series 2019-04-07 19:05:06 -06:00
Matias N a9d8b705cc drivers/usbdev/cdcacm.c: This fixes a problem where the host sent a "get descriptor" message of type "standard" with a recipient of type "interface". Since the composite driver would only pass messages to the child interfaces when a message was not "standard", this message was not handled. I changed the condition so that the composite driver checks not only if this is a "standard" message but if it is also directed to the device. Otherwise, the handling is delegated to the children of the composite device. 2019-03-26 21:54:01 -06:00
raiden00pl 2caf135d05 Merged in raiden00/nuttx_h7 (pull request #837)
Initial OTG support for STM32H7 and some minor improvements

arch/arm/src/stm32h7/stm32h7x3xx_rcc.c: add support for HSI48 clock

configs/nucleo-f207zg: add support for USB and initialize CDCACM if configured

configs/nucleo-h743zi: add support for USB and initialize CDCACM if configured

drivers/usbdev/Kconfig: fix type for USBDEV_TRACE_INITIALIDSET

configs/teensy-3.x/usbnsh/defconfig: update config according to change in USBDEV_TRACE_INITIALIDSET

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-03-10 13:24:58 +00:00