Commit Graph

3941 Commits

Author SHA1 Message Date
Petteri Aimonen d0c6104efb USBDEV RNDIS: Fix style and printf issues 2021-03-24 14:44:23 -03:00
Petteri Aimonen 94480305a7 USBDEV RNDIS: Improve error recovery
Gracefully handle output queue full conditions. This shouldn't happen
in practice as the host is supposed to limit the number of commands
simultaneously in execution.

Reset the response queue on RNDIS_RESET_MSG. This way communication
can recover even if host and device get out of sync.
2021-03-24 14:44:23 -03:00
Petteri Aimonen 4f66624ea3 USBDEV RNDIS: Fix occasional disconnections due to race condition
Sometimes Windows would send RNDIS_KEEPALIVE_MSG and RNDIS_QUERY_MSG close
to each other. This would cause the latter command to overwrite the reply for
the prior command. This in turn will cause Windows to drop the connection after
a 20 second timeout.

Easy way to reproduce the issue is to open the Windows "Adapter Status" dialog that
shows the realtime TX/RX byte counts. This causes multiple RNDIS_QUERY_MSGs per
second, and the connection will drop in less than an hour.

This commit fixes this issue, and other potential race conditions (such as USB
descriptor read in middle on RNDIS query) by using a separate queue for the reply
packets.
2021-03-24 14:44:23 -03:00
Fotis Panagiotopoulos f13adbe4bb Added support for multiple syslog channels. 2021-03-23 21:35:22 -07:00
Roberto Bucher 9a2cb311a3 File for the integration of pysimCoder with NUTTX 2021-03-23 20:37:56 -03:00
Alin Jerpelea da7dfd06b3 drivers: Author David Sidrane: update licenses to Apache
David Sidrane has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea 8dd660ecd4 nuttx: Author David S. Alessio: update licenses to Apache
David S. Alessio has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea 0abc1017ab drivers: nxstyle fixes
nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-20 19:22:58 -07:00
Alin Jerpelea c798076084 drivers: Author Sebastien Lorquet: update licenses to Apache
Sebastien Lorquet has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-20 19:22:58 -07:00
Nathan Hartman 9eca886f26 drivers/sensors/qencoder.c - Remove bad sninfo() format string
drivers/sensors/qencoder.c:

    * qe_close(): Call to sninfo() contained extraneous "%d"
      format specifier. Removing it, as it appears there was
      never a matching argument.
2021-03-19 23:00:37 -07:00
Jaroslav Beran 7c96a25ec1 can: prevent integer overflow in can_write
Because buflen is size_t (unsigned) and nsent is ssize_t (signed)
of the same size, (buflen - nsent) results in unsigned and
overflows if nsent > buflen.

This happens when sending CAN FD frame with DLC > 8 and a user
gets the buflen parameter as a result of CAN_MSGLEN(len)
where `len' is the size of data which is less then a size
for some extended DLC  (e.g. 26 bytes is sent in a message with
DLC 0xD, which has 32 bytes of data).

The correct buflen value should be rather
  CAN_MSGLEN(can_dlc2bytes(can_bytes2dlc(len)))

Signed-off-by: Jaroslav Beran <jara.beran@gmail.com>
2021-03-19 23:00:07 -07:00
Jiuzhu Dong 59eb4fa8d6 fs: delete NFILE_DESCRIPTORS for allocating dynamically
Change-Id: Id06d215063796d222b9792d25ab2d6742167729f
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-17 06:46:42 -07:00
YAMAMOTO Takashi ed305ccc64 drivers/bch/bchlib_cache.c: Fix build with CONFIG_BCH_ENCRYPTION
It seems no one has built this since 2014.

I only build-tested this with esp32-devkitc:wapi +
CONFIG_BCH_ENCRYPTION + CONFIG_ESP32_AES_ACCELERATOR.
2021-03-17 01:25:16 -07:00
YAMAMOTO Takashi 39b3998149 bch: Enable with CONFIG_BCH, instead of !CONFIG_DISABLE_MOUNTPOINT
BCH can be used without mount points.
Mount points can be used without BCH.
They are independent each other.
2021-03-17 01:25:16 -07:00
Yuichi Nakamura aa718dcbac lcd/st7789: X/Y offset and screen orientation support 2021-03-16 06:35:04 -03:00
Alan C. Assis a06aa8e512 lcd/backpack: Enable backlight if CONFIG_SLCD_CONSOLE 2021-03-14 20:14:40 -07:00
Alan C. Assis ffc43c2d31 lcd/st7789: Make X/Y Resolution configurable 2021-03-14 20:05:33 -07:00
Alin Jerpelea d66d881b87 nxstyle fixes
nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-13 05:56:43 -08:00
Alin Jerpelea 5e6d58dd03 drivers: Alan Carvalho de Assis: update licenses to Apache
Alan Carvalho de Assis has submitted the SGA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-13 05:56:43 -08:00
David Sidrane 0c57351f78 mmcsd:Stuck in 1-bit mode, Removed CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT
mmcsd:Remove CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT
   stm32h7:sdmmc remove CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT
   stm32f7:sdmmc remove CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT
   stm32f7:sdmmc WRITE COMPLETE prevent false triggers
   stm32h7:sdmmc WRITE COMPLETE prevent false triggers

   While testing PR #2989 on the H7 I noticed that the cards
   were staying in 1-bit mode. The root cause was that the
   scr read path was using DMA without an invlidate.

   This was caused by CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT,
   but the sdmmc driver, did not use the delayed invalidate
   nor would it work on 8 bytes.

   The driver fully supported dcache mgt on runt buffers, but
   the #ifdef CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT blocked it.

   Reviewing the PR that added CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT
   it may have been valid at the time. But after the dcache operations
   we fixed. It is not necessary and offers no benefit.
2021-03-12 16:42:16 -03:00
Matias N cf8521e6de syslog: add option to prefix process name 2021-03-11 19:40:48 -03:00
buyuer 097df2669c drivers/sensor: fakesensor support batch.
Signed-off-by: buyuer <dingddding@163.com>
2021-03-10 14:16:38 +08:00
Gustavo Henrique Nihei 330eff36d7 sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Gustavo Henrique Nihei 47cb41c92f makefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
ligd 24cc83e46f serial/serial_dma.c: fix warnnings
serial/serial_dma.c: In function ‘uart_recvchars_done’:
serial/serial_dma.c:407:7: warning: implicit declaration of function ‘nxsig_kill’ [-Wimplicit-function-declaration]
  407 |       nxsig_kill(dev->pid, signo);
      |       ^~~~~~~~~~

Change-Id: I9e1c0341ecce3033889d11fff9ec2b9e3dfe303b
2021-03-07 01:45:51 -08:00
ligd 64708ddc7a drivers/serial/Kconfig: fix configure warnning
user should select the default action by self:
warning: (TTY_SIGINT) selects SIG_SIGKILL_ACTION which has unmet direct dependencies (SIG_DEFAULT)

Change-Id: Ied9899d18156742ce4998b40d53a481262dcd84a
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-07 01:45:51 -08:00
Alin Jerpelea ccff570e6f drivers: nxstyle fixes
nxstyle fixes to pass the CI.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-04 18:32:27 -08:00
Alin Jerpelea e5b6305f4a drivers: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-04 18:32:27 -08:00
Jiuzhu Dong 48493dac5b telnet: fix crash about telnet client connect
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-05 06:55:17 +09:00
ligd 0d24582fe0 syslog_rpmsg: fix system crash when open CONFIG_SCHED_HAVE_PARENT
Reason:
nx_start use syslog at every early time event the idle thread not
full setup, then syslog_rpmsg -> work_queue -> work_signal ->
nxsig_kill -> rtcb is NULL -> crash

Fix:
sched work_queue after is_rpmsg_ept_ready() is true

Change-Id: I225469ff2526e4b810bf3e23473b55d57e64a1ff
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-03 19:08:15 -08:00
Jiuzhu Dong 4d5a964f29 net: unify socket into file descriptor
Change-Id: I9bcd21564e6c97d3edbb38aed1748c114160ea36
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-03 19:01:41 -08:00
Xiang Xiao c8d4a4c76a mtd/progmem: Add up_progmem_read callback guarded by ARCH_HAVE_PROGMEM_READ
since sometime platform code need do some special action during memcpy

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id108ef4232376feab3e37e9b3aee9a7927a03bd4
2021-03-03 13:47:59 -08:00
Xiang Xiao 0aa78ccc81 mtd/progmem: Let MTD_PROGMEM depend on ARCH_HAVE_PROGMEM
and remove the reference of CONFIG_ARCH_HAVE_PROGMEM from code

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I89a73f138d54718ee8bc9345958675d7a2a34ba8
2021-03-03 13:47:59 -08:00
Xiang Xiao 151cf49562 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-01 09:23:09 +09:00
Xiang Xiao 9473434587 Ensure the kernel component don't call userspace API
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-01 09:23:09 +09:00
Gustavo Henrique Nihei c76e201ebd drivers/i2s: Fix nxstyle issues 2021-02-25 18:57:18 -08:00
Gustavo Henrique Nihei 55d66f60a3 drivers: Fix typos reported by codespell 2021-02-25 18:57:18 -08:00
Jiuzhu Dong 936ce77d21 driver/sensor: gets the capacity of the hardware fifo
to hold the number of events

Change-Id: I58a9ad07913c7b189e1fd229ab22e91e220e01f6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-24 15:26:15 -03:00
Jiuzhu Dong 46ea549630 driver/sensor: Fetch(with O_NONBLOCK) will directly return.
when sensor is disable.

Change-Id: I02c02aa447ee0b0d681082b4209ecd36e10f2547
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-24 15:26:15 -03:00
Jiuzhu Dong 54ea96da6b driver/sensor: replace lower->buffer_size with lower->buffer_number
more efficient

Change-Id: I0823b10248caf75e4dd6a5086ad230ba4a7298f6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-24 15:26:15 -03:00
Alin Jerpelea 26e1f1f249 tools: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-19 08:07:47 -08:00
Byron Ellacott 9a1b726bae fs: change geometry types from `size_t` to `blkcnt_t` and `blksize_t`
This change reflects that the geometry isn't related to the largest
allocatable unit on the platform.

Calls to read and write block devices are also affected and have
been updated.
2021-02-18 20:38:22 -08:00
Masayuki Ishikawa 1dc77c2ec5 drivers: audio: Introduce a driver-specific spinlock to cxd56.c
Summary:
- This commit introduces a driver-specific spinlock to cxd56.c
  to improve performance in SMP mode.

Impact:
- cxd56.c in SMP mode only

Testing:
- Tested with nxplayer and nxrecorder with the following configs
- spresense:wifi, spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-02-15 01:54:44 -08:00
buyuer a2c79bed20 Add fakesensor driver.
This driver can read sensor data from csv file.

Signed-off-by: buyuer <dingddding@163.com>
2021-02-11 09:28:55 -08:00
Masayuki Ishikawa d87f350831 arch, boards, drivers, include, sched, wireless: Change spinlock APIs.
Summary:
- This commit changes spinlock APIs (spin_lock_irqsave/spin_unlock_irqrestore)
- In the previous implementation, the global spinlock (i.e. g_irq_spin) was used.
- This commit allows to use caller specific spinlock but also supports to use
  g_irq_spin for backword compatibility (In this case, NULL must be specified)

Impact:
- None

Testing:
- Tested with the following configurations
- spresnse:wifi, spresense:wifi_smp
- esp32-devkitc:smp (QEMU), sabre6-quad:smp (QEMU)
- maxi-bit:smp (QEMU), sim:smp
- stm32f4discovery:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-02-07 21:28:56 -08:00
Alexander Vasiljev dbec1cf694 drivers:mtd:smart.c: entryname is declared and should be under ifdef 2021-02-04 10:05:59 -08:00
Alexander Vasiljev 9146878dad drivers:mtd:w25qxxxjv.c: use different protect bits and address lengths for different chips 2021-02-04 10:05:59 -08:00
Masayuki Ishikawa 0c68ddb760 drivers: wireless: Change retry condition in gs2200m_hal_write()
Summary:
- During Wi-Fi stress test, I noticed that ASSERT() happened
  in gs2200m_hal_write(). Actually, this happens in 20-40 hours.
- In this case, resp[1] was always 0x0 which is not defined
  in the spec.
- In the previous implementation, retry was only done in case of
  WR_RESP_NOK. (0x13)
- This commit changes this condition and it reties in case of
  0x0 as well

Impact:
- gs2200m driver

Testing:
- Tested with spresense:wifi_smp and stm32f4discovery:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-02-03 10:29:05 +01:00
Jukka Laitinen b8dc64ffed drivers/net/encx24j600.c: Correct setting of ifstate
The ifstate is already set in
  enc_ifup -> enc_reset -> enc_linkstatus

The ifstate after this call is either ENCSTATE_RUNNING or ENCSTATE_UP

If ifstate is ENCSTATE_RUNNING, it would be wrong to set it to ENCSTATE_UP;
this would lead to enc_txavail never invoking the driver callback, causing
very long latencies in sending.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-01-29 09:52:04 -08:00
Alexander Vasiljev 96cbd1d8a1 drivers: mtd: w25qxxxjv.c : W25Q256's sector count is 8192 2021-01-29 06:47:03 -08:00