Commit Graph

456 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Xiang Xiao
3a32937b9b drivers/wireless/ieee80211/bcm43xxx: Move drivers/wireless/ieee80211/ to drivers/wireless/ieee80211/bcm43xxx/
since the directory only contains only BCM43362 and BCM43438 related code.
2019-11-05 15:38:01 -06:00
Gregory Nutt
e3665c1fb4 drivers/wireless/ieee80211: Add tools/nxstyle to all of the C files in this directory. 2019-10-29 16:56:24 -06:00
Gregory Nutt
2a22a64f36 drivers/wireless/ieee80211/mmc_sdio.c: In sdio_io_rw_extended(), the behavior of the DMA setup differs, depending on the hardware capability SDIO_CAPS_DMABEFOREWRITE. If this capability is set, then the DMA setup much be done before the transfer setup. Dave Marples modified this file for the i.MXRT USDHC which does have the SDIO_CAPS_DMABEFOREWRITE (commit 970295d0fe). Xiao Xiang reports that this change breaks the Wifi on the Photon which does not report the SDIO_CAPS_DMABEFOREWRITE and suggests reverting the change. In reality both changes are correct but must be conditioned on the DMA capability of the underlying SDIO device. 2019-10-29 16:02:33 -06:00
Xiang Xiao
824666db9a drivers/wireless/ieee80211/bcmf_chip_43362.c: Fix bcmf_chip_43362 compile error. 2019-10-29 08:01:55 -06:00
Gregory Nutt
ca14affc46 Fix a trivial typo introduced in the last commit. 2019-10-22 17:47:49 -06:00
Gregory Nutt
88de97a926 drivers/usbhost: Remove all traces of support for the installable GPL RTL8187 USB host driver. 2019-10-22 17:44:16 -06:00
Masayuki Ishikawa
7389f86561 Merged in masayuki2009/nuttx.nuttx/stm32f4dis_with_gs2200m (pull request #1057)
stm32f4dis with gs2200m

* drivers: wireless: Add SPI_SELECT() to _read/write_data() in gs2200m.c

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* boards: stm32f4discovery: Add support for gs2200m

    NOTE: GS2200M for Spresense works with mikroe STM32F4 Discovery Shield (slot3)

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-10-22 13:38:41 +00:00
Masayuki Ishikawa
2c16d756cc Merged in masayuki2009/nuttx.nuttx/gs2200m_with_reset (pull request #1050)
Gs2200m with reset

* include: wireless: Add reset handler to struct gs2200m_lower_s

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* drivers: wireless: Add reset and unreset sequence in gs2200m.c

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* boards: cxd56xx: Add reset handler to cxd56_gs2200m.c

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-10-15 21:03:33 +00:00
Dave Marples
83e458873f drivers/wireless/bluetooth/bt_uart_bcm4343x.c: Fix small a small bug
found during testing.
drivers/wireless/bluetooth/bt_uart_shim.c:  Change the task tname for
the HCI receiver task to bring it into line with the transmitter task.
2019-10-08 07:55:47 -06:00
Dave Marples
de70e689cd drivers/wireless/bluetooth/bt_uart_bcm4343x.c: BCM4343x HCIUART support. 2019-10-04 09:29:51 -06:00
Gregory Nutt
d9e47a17b8 Fix a typo introduced with 0dbb22f61c. 2019-10-02 15:31:07 -06:00
Gregory Nutt
0dbb22f61c drivers/wireless/ieee802154/mrf24j40/mrf24j40.c: Correct erroneous isolation of address mode field and subsequent bad comparison. 2019-10-02 12:50:43 -06:00
Dave Marples
05bbbec3e1 Add support for the BCM43438A1 Bluetooth capability. It also adds a serial 'shim' to allow any regular serial port that can support a Bluetooth H4 interface (i.e. it has RTS/CTS) to be used to drive a Bluetooth device (Get a handle to it via hci_uart_getdevice("/dev/xxx") and then pass it to the btuart_register function.
Most of the bluetooth and wifi chips appear to need external firmware, and the 43438 is no exception. Fortunately, since Cypress got involved, these are much more straightforward to obtain and are shipped as part of their SDK, which is downloadable from their website.  Those firmwares are already provided as C arrays, so their names just need updating to;

const unsigned char bt_firmware_hcd -> The bt firmware array.

const int bt_firmware_len = sizeof(bt_firmware_hcd);
2019-09-21 07:16:37 -06:00
Masayuki Ishikawa
2154a02fa1 Merged in masayuki2009/nuttx.nuttx/fix_comments_in_gs2200m (pull request #1032)
drivers/wireless/gs2200m.c: Fix comments

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-09-18 11:34:00 +00:00
Gregory Nutt
57bd46d931 Fix some typos in the ChangeLog. 2019-09-13 19:01:05 -06:00
Masayuki Ishikawa
fc250074b3 Merged in masayuki2009/nuttx.nuttx/gs2200m_supports_SIOCGIFHWADDR (pull request #1027)
gs2200m supports SIOCGIFHWADDR

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-09-02 13:08:34 +00:00
Anthony Merlino
c184d8fca3 Merged in antmerlino/nuttx/xbee-iobuser-fix (pull request #1010)
xbee: Fixes one instance of the use of IOBUSER_WIRELESS_MAC802154 which isn't available without the software MAC layer. Instead we use IOBUSER_WIRELESS_RAD802154 throughout the whole driver since it is always available when IEEE 802.15.4 support is enable

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-19 22:50:21 +00:00
Anthony Merlino
c024a1f569 Merged in antmerlino/nuttx/xbee-prefix (pull request #1009)
drivers/ieee802154/xbee: Add configuration option for setting the default prefix to use when bringing up the network and setting the IP address.

# Conflicts:
#	drivers/wireless/ieee802154/xbee/xbee_netdev.c

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-19 22:24:32 +00:00
Anthony Merlino
70404ed0dc Merged in antmerlino/nuttx/iobinstrumentation (pull request #1001)
Iobinstrumentation

* mm/iob: Introduces producer/consumer id to every iob call. This is so that the calls can be instrumented to monitor the IOB resources.

* iob instrumentation - Merges producer/consumer enumeration for simpler IOB user.

* fs/procfs: Starts adding support for /proc/iobinfo

* fs/procfs: Finishes first pass of simple IOB user stastics and /proc/iobinfo entry

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-16 22:42:25 +00:00
Anthony Merlino
b4c103053d drivers/wireless/ieee802154/xbee: Detect lockup and reset XBee in xbee_req_data 2019-08-16 16:24:14 -04:00
Anthony Merlino
3529be7d9b drivers/wireless/ieee802154/xbee: Cancel query timeout upon receiving the expected response. Add protection for race condition that can cause association timeout to continue firing repeatedly 2019-08-16 16:23:27 -04:00
Anthony Merlino
bc60397e48 drivers/wireless/ieee802154/xbee: Adds CONFIG_XBEE_LOCKUP_WORKAROUND option and corresponding logic to workaround an issue where the XBee locks up and stops responding.
This typically happens when there is a lot of data being received over the link. When the XBee stops responding, many times, querying the XBee kicks it out of this state. However, occasionally the XBee is completely locked up and the XBee has to be reset. This change handles these conditions by periodically (if not naturally occuring) querying the XBee. If during any query, the XBee does not respond within a certain number of attempts, the XBee is reset.
2019-08-16 16:23:12 -04:00
Anthony Merlino
8fc7ee9cec drivers/wireless/iee802154/xbee: Support "WR" AT command for writing parameters to non-volatile memory. 2019-08-16 16:21:31 -04:00
Anthony Merlino
aad2fae1a1 drivers/wireless/ieee802154/xbee: Initialize the short address to the unspecified address and query for the extended address on init. 2019-08-16 16:21:31 -04:00
Anthony Merlino
0be02688af drivers/wireless/ieee802154/xbee: Change assumption about destination address mode for incoming frames. If a short address has been assigned to our radio, then assume we were addressed using that. Otherwise we were addressed using our extended address. 2019-08-16 16:21:31 -04:00
Anthony Merlino
77dca3d821 drivers/wireless/ieee802154/xbee: Fix logic to prevent deadlock scenario when there are no available IOBs 2019-08-16 16:17:01 -04:00
Anthony Merlino
fc1780d63e Merged in antmerlino/nuttx/sixlowpan-removeconversions (pull request #997)
ieee802154/sixlowpan: Removes unnecessary conversions that were happening due to a misunderstanding of byte ordering with EUI-64

# Conflicts:
#	drivers/wireless/ieee802154/xbee/xbee_netdev.c

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-16 01:26:44 +00:00
Anthony Merlino
cc16b40462 Merged in antmerlino/nuttx/xbee_buildfix (pull request #987)
drivers/wireless/ieee802154/xbee: Fixes missing semicolon introduced in recent commit.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-10 18:29:58 +00:00
Anthony Merlino
535db0140a Merged in antmerlino/nuttx/wirelessnetdev (pull request #984)
wireless network devices: Attach radio to d_buf before registering device to handle forwarding case.

When CONFIG_NET_IPFORWARD is enabled, and CONFIG_NET_6LOWPAN is being used, a packet that attempts to get forwarded on the 6LoWPAN interface will require that the radio's buffer be attached to d_buf. Otherwise the below exception will be hit.

~line 542 of sixlowpan_framelist.c

```
      /* Recover the reassembly buffer from the driver d_buf. */

      reass = (FAR struct sixlowpan_reassbuf_s *)radio->r_dev.d_buf;
      DEBUGASSERT(reass != NULL);
```

The underlying "radio" in this case is the mac802154_netdev.

This behavior has probably not been observed because the buffer is normally attached in the periodic txpoll worker. However, in my case, the 6LoWPAN interace was not UP yet, and therefore the worker hadn't run yet.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-10 18:22:39 +00:00