From 5d7015a82888b1446c34ec7b770b823b71616558 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Fri, 30 Nov 2018 14:07:56 +0100 Subject: [PATCH 001/501] [nrf noup] ci: NCS-specific CI tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Necessary changes for NCS CI. - compliance: Add an additional check for sauce tags. Also, since, in the code, we refer to Kconfig symbols that are defined in the sdk-nrf repository, the Kconfig check will not pass. Use KconfigBasic instead, which will not grep the code for instances of CONFIG_. - Add a Jenkinsfile. - Extend the max commit line lengths for Gitlint. - A shortlog that looks like "[nrf noup]: foo: bar" has shown up in real life and should fail this compliance test, but it doesn't. Fix that by checking for an explicit space after the closing "]" in a sauce tag. Signed-off-by: Carles Cufi Signed-off-by: Dominik Ermel Signed-off-by: Martí Bolívar (cherry picked from commit b80e59506d9af617131deb4faff72156e23a79e8) --- .github/workflows/compliance.yml | 4 +++- .gitlint | 4 ++-- Jenkinsfile | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 Jenkinsfile diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index d14c9d2103e..76e53ef7c5e 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -53,6 +53,8 @@ jobs: git config --global user.email "you@example.com" git config --global user.name "Your Name" git remote -v + # Sauce tag checks before rebasing + git log --oneline --first-parent origin/${BASE_REF}..HEAD | grep -E -v "\[nrf (mergeup|fromtree|fromlist|noup)\][ ]" && { echo 'Sauce tag missing or invalid, format is "[nrf ] "'; exit 1; } git rebase origin/${BASE_REF} # debug git log --pretty=oneline | head -n 10 @@ -69,7 +71,7 @@ jobs: # debug ls -la git log --pretty=oneline | head -n 10 - ./scripts/ci/check_compliance.py -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m Kconfig -c origin/${BASE_REF}.. + ./scripts/ci/check_compliance.py -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m KconfigBasic -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@master diff --git a/.gitlint b/.gitlint index b8d25ce49b9..8a33f140b2a 100644 --- a/.gitlint +++ b/.gitlint @@ -16,7 +16,7 @@ debug = false extra-path=scripts/gitlint [title-max-length-no-revert] -line-length=75 +line-length=120 [body-min-line-count] min-line-count=1 @@ -42,7 +42,7 @@ words=wip [max-line-length-with-exceptions] # B1 = body-max-line-length -line-length=75 +line-length=120 [body-min-length] min-length=3 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000000..3b9cf002239 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,5 @@ +@Library("CI_LIB") _ + +def pipeline = new ncs.sdk_zephyr.Main() + +pipeline.run(JOB_NAME) From 051066416e82a3c5bb0e1aa44dfa4eac55451558 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 26 Jan 2021 15:43:08 +0100 Subject: [PATCH 002/501] [nrf noup] ci: set `ZEPHYR__KCONFIG` for NCS modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit sets `ZEPHYR__KCONFIG` variable for each Kconfig file discovered in `nrf/modules//Kconfig`. This is not meant as a permanent solution; we should do more careful consideration on the optimal approach forward that will allow compliance_check.py to be used downstream with custom module_ext_roots, and at the same time keep current flexibility for module glue code handling intact. Signed-off-by: Torsten Rasmussen Signed-off-by: Martí Bolívar (cherry picked from commit 44b93770c2da457b2bbd2e90691eb69747840a52) --- scripts/ci/check_compliance.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 581b2e291cc..0201312117e 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -259,6 +259,13 @@ def get_modules(self, modules_file): modules = [name for name in os.listdir(modules_dir) if os.path.exists(os.path.join(modules_dir, name, 'Kconfig'))] + nrf_modules_dir = ZEPHYR_BASE + '/../nrf/modules' + nrf_modules = [] + if os.path.exists(nrf_modules_dir): + nrf_modules = [name for name in os.listdir(nrf_modules_dir) if + os.path.exists(os.path.join(nrf_modules_dir, name, + 'Kconfig'))] + with open(modules_file, 'r') as fp_module_file: content = fp_module_file.read() @@ -268,6 +275,15 @@ def get_modules(self, modules_file): re.sub('[^a-zA-Z0-9]', '_', module).upper(), modules_dir + '/' + module + '/Kconfig' )) + for module in nrf_modules: + fp_module_file.write("ZEPHYR_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + nrf_modules_dir + '/' + module + '/Kconfig' + )) + fp_module_file.write("NCS_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + modules_dir + '/' + module + '/Kconfig' + )) fp_module_file.write(content) def get_kconfig_dts(self, kconfig_dts_file): From b1bc6c6994d68e0e8f83ca36e933c1a382110613 Mon Sep 17 00:00:00 2001 From: Sebastian Wezel Date: Tue, 15 Mar 2022 13:12:25 +0100 Subject: [PATCH 003/501] [nrf noup] ci: add .github/test-spec.yml This file is used for NCS-specific testing configuration based on modifications to files in this repository. Signed-off-by: Alperen Sener Signed-off-by: Dominik Ermel Signed-off-by: Dominik Ermel Signed-off-by: Elisabeth Solheim Klakken Signed-off-by: Mariusz Poslinski Signed-off-by: Markus Swarowsky Signed-off-by: Robert Lubos Signed-off-by: Sebastian Wezel Signed-off-by: Tomasz Tyzenhauz (cherry picked from commit 882f5bdb52740e8ca283f668fab1bb490f3fd202) --- .github/test-spec.yml | 106 ++++++++++++++++++++++++++++++++++++++++++ CODEOWNERS | 1 + 2 files changed, 107 insertions(+) create mode 100644 .github/test-spec.yml diff --git a/.github/test-spec.yml b/.github/test-spec.yml new file mode 100644 index 00000000000..e29e7d1dbc2 --- /dev/null +++ b/.github/test-spec.yml @@ -0,0 +1,106 @@ +# This is the Jenkins ci variant of the .github/labler.yaml +"CI-iot-samples-test": + - "boards/arm/nrf9160dk_nrf9160/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/**/*" + - "subsys/net/lib/**/*" + +"CI-iot-libraries-test": + - "boards/arm/nrf9160dk_nrf9160/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/socket_ncs.h" + - "subsys/testsuite/ztest/**/*" + +"CI-lwm2m-test": + - "**/*" + +"CI-boot-dfu-test": + - "subsys/mgmt/mcumgr/**/*" + - "subsys/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/dfu/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + +"CI-tfm-test": + - "**/*" + +"CI-ble-test": + - "**/*" + +"CI-mesh-test": + - "subsys/bluetooth/mesh/**/*" + - "include/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh_demo/**/*" + - "samples/bluetooth/mesh_provisioner/**/*" + - "tests/bluetooth/mesh/**/*" + - "tests/bluetooth/mesh_shell/**/*" + +"CI-zigbee-test": + - "subsys/mgmt/mcumgr/**/*" + - "subsys/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/dfu/**/*" + +"CI-thingy91-test": + - "**/*" + +"CI-desktop-test": + - "**/*" + +"CI-crypto-test": + - "**/*" + +"CI-rs-test": + - "**/*" + +"CI-homekit-test": + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "soc/arm/nordic_nrf/**/*" + - "subsys/dfu/**/*" + - "subsys/settings/**/*" + - "subsys/net/lib/openthread/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "samples/hci_rpmsg/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + +"CI-thread-test": + - "**/*" + +"CI-nfc-test": + - "**/*" + +"CI-matter-test": + - "**/*" + +"CI-find-my-test": + - "**/*" + +"CI-gazell-test": + - "**/*" + +"CI-rpc-test": + - "**/*" + +"CI-modemshell-test": + - "include/net/**/*" + - "include/posix/**/*" + - "include/shell/**/*" + - "drivers/net/**/*" + - "drivers/serial/**/*" + - "drivers/wifi/**/*" + - "subsys/shell/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-positioning-test": + - "include/net/**/*" + - "include/posix/**/*" + - "drivers/net/**/*" + - "drivers/wifi/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" diff --git a/CODEOWNERS b/CODEOWNERS index 667a4a4573a..e476662df04 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -14,6 +14,7 @@ # * @galak @nashif /.github/ @nashif @stephanosio +/.github/test-spec.yml @nrfconnect/ncs-test-leads /.github/workflows/ @galak @nashif /MAINTAINERS.yml @MaureenHelm /arch/arc/ @abrodkin @ruuddw @evgeniy-paltsev From 37160d6e3bd733e42b403aeb8016def5806b6458 Mon Sep 17 00:00:00 2001 From: Maciej Perkowski Date: Wed, 26 Jan 2022 13:43:55 +0100 Subject: [PATCH 004/501] [nrf noup] ci: workflows: set the name of checkout repo to zephyr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NOTE TO NEXT NCS UPMERGE ENGINEER: This patch should be reverted during the next upmerge. It should no longer be necessary as of west 0.13.0. West update cannot import submanifests because the repo is checked out as "sdk-zephyr". This patch sets the checkout dir to "zephyr" in a variety of places where that's required for NCS. Signed-off-by: Maciej Perkowski Signed-off-by: Martí Bolívar Signed-off-by: Gerard Marull-Paretas Signed-off-by: Dominik Ermel (cherry picked from commit 0e33137e8c44e4d46088c1c983e3c9ad70c1e320) --- .github/workflows/bluetooth-tests.yaml | 7 ++++--- .github/workflows/clang.yaml | 11 +++++++++-- .github/workflows/compliance.yml | 8 +++++++- .github/workflows/doc-build.yml | 22 ++++++++++++++++------ .github/workflows/twister_tests.yml | 3 +++ 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/.github/workflows/bluetooth-tests.yaml b/.github/workflows/bluetooth-tests.yaml index 2f714c06e3d..06027836a9a 100644 --- a/.github/workflows/bluetooth-tests.yaml +++ b/.github/workflows/bluetooth-tests.yaml @@ -49,11 +49,13 @@ jobs: - name: checkout uses: actions/checkout@v2 with: + path: ./zephyr fetch-depth: 0 - name: west setup env: BASE_REF: ${{ github.base_ref }} + working-directory: ./zephyr run: | git config --global user.email "you@example.com" git config --global user.name "Your Name" @@ -64,6 +66,7 @@ jobs: west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log - name: Run Bluetooth Tests with BSIM + working-directory: ./zephyr run: | export ZEPHYR_BASE=${PWD} WORK_DIR=${ZEPHYR_BASE}/bsim_bt_out tests/bluetooth/bsim_bt/compile.sh @@ -75,9 +78,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: bluetooth-test-results - path: | - ./bsim_bt_out/bsim_results.xml - ${{ github.event_path }} + path: ./zephyr/bsim_bt_out/bsim_results.xml - name: Upload Event Details if: always() diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index df4a8c3536f..6e36e19d76c 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -11,7 +11,7 @@ jobs: with: access_token: ${{ github.token }} clang-build: - runs-on: zephyr_runner + runs-on: ubuntu-latest needs: clang-build-prep container: image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 @@ -48,8 +48,10 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 persist-credentials: false + path: ./zephyr - name: Environment Setup + working-directory: ./zephyr run: | echo "$HOME/.local/bin" >> $GITHUB_PATH git config --global user.email "bot@zephyrproject.org" @@ -67,6 +69,7 @@ jobs: west update --path-cache /github/cache/zephyrproject 2>&1 1> west.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west2.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject) - name: Check Environment + working-directory: ./zephyr run: | cmake --version ${CLANG_ROOT_DIR}/bin/clang --version @@ -74,6 +77,7 @@ jobs: ls -la - name: Prepare ccache timestamp/data + working-directory: ./zephyr id: ccache_cache_timestamp shell: cmake -P {0} run: | @@ -93,11 +97,13 @@ jobs: aws-region: us-east-2 - name: ccache stats initial + working-directory: ./zephyr run: | test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache ccache -M 10G -s - name: Run Tests with Twister + working-directory: ./zephyr id: twister run: | export ZEPHYR_BASE=${PWD} @@ -117,6 +123,7 @@ jobs: fi - name: ccache stats post + working-directory: ./zephyr run: | ccache -s @@ -125,7 +132,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: Unit Test Results (Subset ${{ matrix.platform }}) - path: twister-out/twister.xml + path: zephyr/twister-out/twister.xml clang-build-results: name: "Publish Unit Tests Results" diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 76e53ef7c5e..30274b27714 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -12,7 +12,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 + path: ./zephyr - name: Run Maintainers Script + working-directory: ./zephyr id: maintainer env: BASE_REF: ${{ github.base_ref }} @@ -32,6 +34,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 + path: ./zephyr - name: cache-pip uses: actions/cache@v1 @@ -47,6 +50,7 @@ jobs: pip3 install west - name: west setup + working-directory: ./zephyr env: BASE_REF: ${{ github.base_ref }} run: | @@ -62,6 +66,7 @@ jobs: west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log - name: Run Compliance Tests + working-directory: ./zephyr continue-on-error: true id: compliance env: @@ -78,9 +83,10 @@ jobs: continue-on-error: True with: name: compliance.xml - path: compliance.xml + path: zephyr/compliance.xml - name: check-warns + working-directory: ./zephyr run: | if [[ ! -s "compliance.xml" ]]; then exit 1; diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 57ca2d5f42e..383ad6aaa09 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -44,8 +44,11 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 + with: + path: ./zephyr - name: install-pkgs + working-directory: ./zephyr run: | sudo apt-get update sudo apt-get install -y ninja-build graphviz libclang1-9 libclang-cpp9 @@ -57,20 +60,22 @@ jobs: uses: actions/cache@v1 with: path: ~/.cache/pip - key: pip-${{ hashFiles('scripts/requirements-doc.txt') }} + key: pip-${{ hashFiles('zephyr/scripts/requirements-doc.txt') }} - name: install-pip run: | sudo pip3 install -U setuptools wheel pip - pip3 install -r scripts/requirements-doc.txt + pip3 install -r zephyr/scripts/requirements-doc.txt pip3 install west==${WEST_VERSION} pip3 install cmake==${CMAKE_VERSION} - name: west setup + working-directory: ./zephyr run: | west init -l . - name: build-docs + working-directory: ./zephyr run: | if [[ "$GITHUB_REF" =~ "refs/tags/v" ]]; then DOC_TAG="release" @@ -87,6 +92,7 @@ jobs: DOC_TAG=${DOC_TAG} SPHINXOPTS="-q -W -t publish" make -C doc ${DOC_TARGET} - name: compress-docs + working-directory: ./zephyr run: | tar cfJ html-output.tar.xz --directory=doc/_build html @@ -94,7 +100,7 @@ jobs: uses: actions/upload-artifact@master with: name: html-output - path: html-output.tar.xz + path: zephyr/html-output.tar.xz - name: process-pr if: github.event_name == 'pull_request' @@ -125,6 +131,8 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 + with: + path: ./zephyr - name: install-pkgs run: | @@ -135,20 +143,22 @@ jobs: uses: actions/cache@v1 with: path: ~/.cache/pip - key: pip-${{ hashFiles('scripts/requirements-doc.txt') }} + key: pip-${{ hashFiles('zephyr/scripts/requirements-doc.txt') }} - name: install-pip run: | pip3 install -U setuptools wheel pip - pip3 install -r scripts/requirements-doc.txt + pip3 install -r zephyr/scripts/requirements-doc.txt pip3 install west==${WEST_VERSION} pip3 install cmake==${CMAKE_VERSION} - name: west setup + working-directory: ./zephyr run: | west init -l . - name: build-docs + working-directory: ./zephyr run: | if [[ "$GITHUB_REF" =~ "refs/tags/v" ]]; then DOC_TAG="release" @@ -162,4 +172,4 @@ jobs: uses: actions/upload-artifact@master with: name: pdf-output - path: doc/_build/latex/zephyr.pdf + path: zephyr/doc/_build/latex/zephyr.pdf diff --git a/.github/workflows/twister_tests.yml b/.github/workflows/twister_tests.yml index 4f96520e0dc..0fb39af0a81 100644 --- a/.github/workflows/twister_tests.yml +++ b/.github/workflows/twister_tests.yml @@ -28,6 +28,8 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 + with: + path: ./zephyr - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: @@ -44,6 +46,7 @@ jobs: run: | pip3 install pytest colorama pyyaml ply mock pykwalify - name: Run pytest + working-directory: ./zephyr env: ZEPHYR_BASE: ./ ZEPHYR_TOOLCHAIN_VARIANT: zephyr From 290b37a47e2a3304aecf6675f964e9b17ff7ba0e Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 3 Mar 2022 15:28:16 +0100 Subject: [PATCH 005/501] [nrf noup] doc: remove Kconfig search Kconfig search is handled in a separate docset in NCS, so remove the page. This is a long-term noup patch. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 6958289790a9cc26f338b4bc87f38ac6226d6473) --- doc/build/kconfig/setting.rst | 6 ++---- doc/develop/application/index.rst | 5 ++--- doc/kconfig.rst | 8 -------- 3 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 doc/kconfig.rst diff --git a/doc/build/kconfig/setting.rst b/doc/build/kconfig/setting.rst index 2df44a8f501..8015308ea0f 100644 --- a/doc/build/kconfig/setting.rst +++ b/doc/build/kconfig/setting.rst @@ -7,8 +7,7 @@ The :ref:`menuconfig and guiconfig interfaces ` can be used to test out configurations during application development. This page explains how to make settings permanent. -All Kconfig options can be searched in the :ref:`Kconfig search page -`. +All Kconfig options can be searched in the Kconfig search page. .. note:: @@ -115,8 +114,7 @@ Assignments in configuration files are only respected if the dependencies for the symbol are satisfied. A warning is printed otherwise. To figure out what the dependencies of a symbol are, use one of the :ref:`interactive configuration interfaces ` (you can jump directly to a symbol with -:kbd:`/`), or look up the symbol in the :ref:`Kconfig search page -`. +:kbd:`/`), or look up the symbol in the Kconfig search page. .. _initial-conf: diff --git a/doc/develop/application/index.rst b/doc/develop/application/index.rst index abedbeee283..f56acfb3a74 100644 --- a/doc/develop/application/index.rst +++ b/doc/develop/application/index.rst @@ -507,9 +507,8 @@ started. See :ref:`setting_configuration_values` for detailed documentation on setting Kconfig configuration values. The :ref:`initial-conf` section on the same page -explains how the initial configuration is derived. See :ref:`kconfig-search` -for a complete list of configuration options. -See :ref:`hardening` for security information related with Kconfig options. +explains how the initial configuration is derived. See :ref:`hardening` for +security information related with Kconfig options. The other pages in the :ref:`Kconfig section of the manual ` are also worth going through, especially if you planning to add new configuration diff --git a/doc/kconfig.rst b/doc/kconfig.rst deleted file mode 100644 index 1123de2adbd..00000000000 --- a/doc/kconfig.rst +++ /dev/null @@ -1,8 +0,0 @@ -:orphan: - -.. _kconfig-search: - -Kconfig Search -============== - -.. kconfig:search:: From e4d9fea961e5a3297a915e2bd700409cbdfc6760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20R=C3=B8nningstad?= Date: Tue, 1 Jun 2021 19:01:00 +0200 Subject: [PATCH 006/501] [nrf noup] kconfig: Disallow FPU for SPM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add depends on !IS_SPM in config FPU. depends on !FPU gives a Kconfig dependency loop. This is not meant as a permanent solution. Signed-off-by: Øyvind Rønningstad (cherry picked from commit e398dff25f032e438b9a4516aa259fad97d86806) --- arch/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/Kconfig b/arch/Kconfig index 9c7cd589fd6..e2f8f1494e9 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -750,6 +750,7 @@ menu "Floating Point Options" config FPU bool "Floating point unit (FPU)" depends on CPU_HAS_FPU + depends on !IS_SPM help This option enables the hardware Floating Point Unit (FPU), in order to support using the floating point registers and instructions. From e968e0f89ceb98766946e99cdb13c601011c8049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Tue, 30 Nov 2021 09:41:05 +0100 Subject: [PATCH 007/501] [nrf noup] modules: mbedtls: add PSA configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Adds Kconfig.psa -Add standardized algorithms, curve types etc as Kconfig variables -Add configurations for internal logic to see if a feature is enabled by PSA_WANTS_XXX ref: NCSDK-11689 Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit b04192739afde7ffb9ddf4fe3816a5d6124ce9a8) --- modules/mbedtls/Kconfig | 4 +- modules/mbedtls/Kconfig.psa | 445 ++++++++++++++++++++++++++++++++++++ 2 files changed, 448 insertions(+), 1 deletion(-) create mode 100644 modules/mbedtls/Kconfig.psa diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index 9ec47a72da3..736ff47a1db 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -13,7 +13,6 @@ config MBEDTLS_PROMPTLESS mbed TLS menu prompt and instead handle the selection of MBEDTLS from dependent sub-configurations and thus prevent stuck symbol behavior. - menuconfig MBEDTLS bool "mbed TLS Support" if !MBEDTLS_PROMPTLESS help @@ -167,4 +166,7 @@ config APP_LINK_WITH_MBEDTLS disabled if the include paths for MBEDTLS are causing aliasing issues for 'app'. +# Add PSA configurations +rsource "Kconfig.psa" + endif # MBEDTLS diff --git a/modules/mbedtls/Kconfig.psa b/modules/mbedtls/Kconfig.psa new file mode 100644 index 00000000000..7da962f17e9 --- /dev/null +++ b/modules/mbedtls/Kconfig.psa @@ -0,0 +1,445 @@ +# +# Copyright (c) 2022 Nordic Semiconductor +# +# SPDX-License-Identifier: Apache-2.0 +# +menu "PSA RNG support" + +config PSA_WANT_ALG_CTR_DRBG + bool + prompt "PSA RNG using CTR_DRBG" + help + Provide CTR_DRBG as the random number generator. + Note: This configuration is currently not described and has no effect. + +config PSA_WANT_ALG_HMAC_DRBG + bool + prompt "PSA RNG using HMAC_DRBG" + help + Provide HMAC_DRBG as the random number generator. + Note: This configuration is currently not described and has no effect. + +endmenu # RNG support + +menu "PSA Key support" + +config PSA_HAS_KEY_SUPPORT + bool + default y + depends on PSA_WANT_KEY_TYPE_DERIVE || \ + PSA_WANT_KEY_TYPE_HMAC || \ + PSA_WANT_KEY_TYPE_AES || \ + PSA_WANT_KEY_TYPE_ARIA || \ + PSA_WANT_KEY_TYPE_CAMELLIA || \ + PSA_WANT_KEY_TYPE_CHACHA20 || \ + PSA_WANT_KEY_TYPE_DES || \ + PSA_WANT_KEY_TYPE_ECC_KEY_PAIR || \ + PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY || \ + PSA_WANT_KEY_TYPE_RSA_KEY_PAIR || \ + PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY + +config PSA_WANT_KEY_TYPE_DERIVE + bool + prompt "PSA Key derivation support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_KEY_TYPE_HMAC + bool + prompt "PSA Key type HMAC support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + depends on PSA_HAS_MAC_SUPPORT + +config PSA_WANT_KEY_TYPE_AES + bool + prompt "PSA Key Type AES support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + depends on PSA_HAS_CIPHER_SUPPORT || PSA_HAS_AEAD_SUPPORT + +config PSA_WANT_KEY_TYPE_ARIA + bool + default y if !PSA_DEFAULT_OFF + help + Currently not supported + +config PSA_WANT_KEY_TYPE_CAMELLIA + bool + depends on PSA_HAS_CIPHER_SUPPORT + help + Currently not supported + +config PSA_WANT_KEY_TYPE_CHACHA20 + bool + prompt "PSA Key type Chacha20 support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + depends on PSA_WANT_ALG_CHACHA20_POLY1305 + +config PSA_WANT_KEY_TYPE_DES + bool + depends on PSA_HAS_CIPHER_SUPPORT + help + Currently not supported + +config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR + bool + prompt "PSA Key type ECC key pair support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + depends on PSA_HAS_ECC_SUPPORT + +config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + bool + prompt "PSA Key type ECC public key support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + depends on PSA_HAS_ECC_SUPPORT + +config PSA_WANT_KEY_TYPE_RAW_DATA + bool + prompt "PSA Key type RAW key support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR + bool + prompt "PSA Key type RSA key pair support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + depends on PSA_HAS_RSA_SUPPORT + +config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY + bool + prompt "PSA Key type RSA Public key support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + depends on PSA_HAS_RSA_SUPPORT + +endmenu # PSA_KEY_DERIVATION + +menu "PSA AEAD support" + +config PSA_HAS_AEAD_SUPPORT + bool + default y + depends on PSA_WANT_ALG_CCM || \ + PSA_WANT_ALG_GCM || \ + PSA_WANT_ALG_CHACHA20_POLY1305 + +config PSA_WANT_ALG_CCM + bool + prompt "PSA AES CCM support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_GCM + bool + prompt "PSA AES GCM support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_CHACHA20_POLY1305 + bool + prompt "PSA ChaCha20/Poly1305 support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +endmenu # PSA AEAD support + + +menu "PSA Mac support" + +config PSA_HAS_MAC_SUPPORT + bool + default y + depends on PSA_WANT_ALG_CBC_MAC || \ + PSA_WANT_ALG_CMAC || \ + PSA_WANT_ALG_HMAC + help + Prompt-less configuration that states the PSA APIs enables + a configuration that adds the PSA mac module. + +config PSA_WANT_ALG_CBC_MAC + bool + help + CBC-MAC is not yet supported via the PSA API in Mbed TLS. + +config PSA_WANT_ALG_CMAC + bool + prompt "PSA AES CMAC support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_HMAC + bool + prompt "PSA HMAC support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +endmenu # PSA Mac support + + +menu "PSA Hash support" + +config PSA_HAS_HASH_SUPPORT + bool + default y + depends on PSA_WANT_ALG_SHA_1 || \ + PSA_WANT_ALG_SHA_224 || \ + PSA_WANT_ALG_SHA_256 || \ + PSA_WANT_ALG_SHA_384 || \ + PSA_WANT_ALG_SHA_512 || \ + PSA_WANT_ALG_RIPEMD160 || \ + PSA_WANT_ALG_MD5 + +config PSA_WANT_ALG_SHA_1 + bool + prompt "PSA SHA1 support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_SHA_224 + bool + prompt "PSA SHA-224 support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_SHA_256 + bool + prompt "PSA SSH-256 support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_SHA_384 + bool + prompt "PSA SHA-384 support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_SHA_512 + bool + prompt "PSA SHA-512 support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_RIPEMD160 + bool + prompt "PSA RIPEMD160 support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_MD5 + bool + prompt "PSA MD5 support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +endmenu # PSA Hash support + +menu "PSA Cipher support" + +config PSA_HAS_CIPHER_SUPPORT + bool + default y + depends on PSA_WANT_ALG_ECB_NO_PADDING || \ + PSA_WANT_ALG_CBC_NO_PADDING || \ + PSA_WANT_ALG_CBC_PKCS7 || \ + PSA_WANT_ALG_CFB || \ + PSA_WANT_ALG_CTR || \ + PSA_WANT_ALG_OFB || \ + PSA_WANT_ALG_CTR || \ + PSA_WANT_ALG_XTS + help + Prompt-less configuration that states the PSA APIs enables + a configuration that adds the PSA Cipher module. + +config PSA_WANT_ALG_ECB_NO_PADDING + bool + prompt "PSA AES ECB (no padding)" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_CBC_NO_PADDING + bool + prompt "PSA CBC support (without padding)" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_CBC_PKCS7 + bool + prompt "PSA CBC support (padded with PKCS#7)" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_CFB + bool + prompt "PSA AES CFB support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_CTR + bool + prompt "PSA AES CTR mode support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_OFB + bool + prompt "PSA AES OFB mode support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_XTS + bool + help + AES XTS is currently not supported + +endmenu # PSA Cipher Support + + +menu "PSA Key derivation support" + +config PSA_HAS_KEY_DERIVATION + bool + default y + depends on PSA_WANT_ALG_HKDF || \ + PSA_WANT_ALG_PBKDF2_HMAC || \ + PSA_WANT_ALG_TLS12_PRF || \ + PSA_WANT_ALG_TLS12_PSK_TO_MS + help + Prompt-less configuration that states the PSA APIs enables + a configuration that adds the PSA key derivation module. + +config PSA_WANT_ALG_HKDF + bool + prompt "PSA HKFD support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + depends on PSA_WANT_ALG_HMAC + +config PSA_WANT_ALG_PBKDF2_HMAC + bool + depends on PSA_WANT_ALG_HMAC + help + PBKDF2-HMAC is not yet supported via the PSA APIs in Mbed TLS. + +config PSA_WANT_ALG_TLS12_PRF + bool + prompt "PSA PRF support (TLS1.2)" if !PSA_PROMPTLESS + +config PSA_WANT_ALG_TLS12_PSK_TO_MS + bool + prompt "PSA TLS 1.2 PSK to MS support" if !PSA_PROMPTLESS + +endmenu # PSA Key derivation support + + +menu "PSA Assymetric support" + +config PSA_HAS_ASYM_ENCRYPT_SUPPORT + bool + default y + depends on PSA_WANT_ALG_RSA_OAEP || \ + PSA_WANT_ALG_RSA_PKCS1V15_CRYPT + help + Prompt-less configuration that states the PSA APIs enables + a configuration that adds the PSA Assymetric encrypt module. + + +config PSA_HAS_ASYM_SIGN_SUPPORT + bool + default y + depends on PSA_WANT_ALG_ECDSA || \ + PSA_WANT_ALG_RSA_PKCS1V15_SIGN || \ + PSA_WANT_ALG_RSA_PSS + + help + Prompt-less configuration that states the PSA APIs enables + a configuration that adds the PSA Assymetric sign module. + +config PSA_HAS_ECC_SUPPORT + bool + depends on PSA_WANT_ALG_ECDH || PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + default y + help + Prompt-less configuration that states the PSA APIs enables + a configuration that adds the PSA encrypt/sign module for ECC. + +config PSA_WANT_ALG_ECDH + bool + prompt "PSA ECDH support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_ECDSA + bool + prompt "PSA ECDSA support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ALG_DETERMINISTIC_ECDSA + bool + prompt "PSA ECDSA support (deterministic mode)" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +menu "Elliptic Curve type support" + depends on PSA_HAS_ECC_SUPPORT + +config PSA_WANT_ECC_BRAINPOOL_P_R1_256 + bool + prompt "PSA ECC Brainpool256r1 support" + +config PSA_WANT_ECC_BRAINPOOL_P_R1_384 + bool "PSA ECC Brainpool384r1 support" + +config PSA_WANT_ECC_BRAINPOOL_P_R1_512 + bool "PSA ECC Brainpool512r1 support" + +config PSA_WANT_ECC_MONTGOMERY_255 + bool "PSA ECC Curve25519 support" + +config PSA_WANT_ECC_MONTGOMERY_448 + bool "PSA ECC Curve448 support" + default n + +config PSA_WANT_ECC_SECP_K1_192 + bool "PSA ECC secp192k1 support" + +config PSA_WANT_ECC_SECP_K1_224 + bool + help + SECP224K1 is buggy via the PSA API in Mbed TLS + See https://github.com/ARMmbed/mbedtls/issues/3541 + +config PSA_WANT_ECC_SECP_K1_256 + bool + prompt "PSA ECC secp256k1 support" if !PSA_PROMPTLESS + +config PSA_WANT_ECC_SECP_R1_192 + bool + prompt "PSA ECC secp192r1" if !PSA_PROMPTLESS + +config PSA_WANT_ECC_SECP_R1_224 + bool + prompt "PSA ECC secp224r1" if !PSA_PROMPTLESS + +config PSA_WANT_ECC_SECP_R1_256 + bool + prompt "PSA ECC secp256r1" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF + +config PSA_WANT_ECC_SECP_R1_384 + bool + prompt "PSA ECC secp384r1" if !PSA_PROMPTLESS + +config PSA_WANT_ECC_SECP_R1_521 + bool + prompt "PSA ECC secp521r1" if !PSA_PROMPTLESS + +endmenu # Elliptic Curve type support + +config PSA_HAS_RSA_SUPPORT + bool + depends on PSA_WANT_ALG_RSA_OAEP || \ + PSA_WANT_ALG_RSA_PKCS1V15_CRYPT || \ + PSA_WANT_ALG_RSA_PKCS1V15_SIGN || \ + PSA_WANT_ALG_RSA_PSS + default y + help + Prompt-less configuration that states the PSA APIs enables + a configuration that adds the PSA encrypt/sign module for RSA. + +config PSA_WANT_ALG_RSA_OAEP + bool + prompt "PSA RSA OAEP support" if !PSA_PROMPTLESS + +config PSA_WANT_ALG_RSA_PKCS1V15_CRYPT + bool + prompt "PSA RSA crypt support (PKCS1V15 mode)" if !PSA_PROMPTLESS + +config PSA_WANT_ALG_RSA_PKCS1V15_SIGN + bool + prompt "PSA RSA signature support (PKCS1V15 mode)" if !PSA_PROMPTLESS + +config PSA_WANT_ALG_RSA_PSS + bool + prompt "PSA RSA (PSS mode)" if !PSA_PROMPTLESS + +endmenu # PSA_ASSYMETRIC_SUPPORT + +config PSA_WANT_ALG_STREAM_CIPHER + bool + prompt "PSA stream cipher support" if !PSA_PROMPTLESS + default y if !PSA_DEFAULT_OFF From 6c1dc7c07ccc16de7ebd934c5075141f3c296e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Mon, 31 Jan 2022 03:48:11 +0100 Subject: [PATCH 008/501] [nrf noup] modules: mbedtls: Disable configurations in Kconfig.tls-generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit prevents legacy mbed TLS configurations from being in conflict with PSA Configurations while using nrf_security -Removing use of unsupported TLS protocols (TLS 1.0, 1.1) -Required configurations are duplicated inside nrf_security Kconfig -Ensured that mbedtls_platform_zeroize is not duplicated when CONFIG_NRF_CC3XX_PLATFORM is set ref: NCSDK-13503 Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit c15455b6b2f4aec6241edd0898f15662c37a390c) --- modules/mbedtls/Kconfig.tls-generic | 35 ++++++++++++++++++++ modules/mbedtls/configs/config-tls-generic.h | 4 +++ 2 files changed, 39 insertions(+) diff --git a/modules/mbedtls/Kconfig.tls-generic b/modules/mbedtls/Kconfig.tls-generic index 183ec0a07b3..7196b70f217 100644 --- a/modules/mbedtls/Kconfig.tls-generic +++ b/modules/mbedtls/Kconfig.tls-generic @@ -9,6 +9,8 @@ menu "TLS configuration" menu "Supported TLS version" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_TLS_VERSION_1_0 bool "Support for TLS 1.0" select MBEDTLS_CIPHER @@ -33,6 +35,8 @@ config MBEDTLS_DTLS bool "Support for DTLS" depends on MBEDTLS_TLS_VERSION_1_1 || MBEDTLS_TLS_VERSION_1_2 +endif + config MBEDTLS_SSL_EXPORT_KEYS bool "Support for exporting SSL key block and master secret" depends on MBEDTLS_TLS_VERSION_1_0 || MBEDTLS_TLS_VERSION_1_1 || MBEDTLS_TLS_VERSION_1_2 @@ -47,6 +51,8 @@ menu "Ciphersuite configuration" comment "Supported key exchange modes" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED bool "All available ciphersuite modes" select MBEDTLS_KEY_EXCHANGE_PSK_ENABLED @@ -80,6 +86,8 @@ config MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED || \ MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED +endif + config MBEDTLS_PSK_MAX_LEN int "Max size of TLS pre-shared keys" default 32 @@ -87,6 +95,8 @@ config MBEDTLS_PSK_MAX_LEN help Max size of TLS pre-shared keys, in bytes. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED bool "RSA-only based ciphersuite modes" default y if !NET_L2_OPENTHREAD @@ -119,8 +129,12 @@ if MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED || \ MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED || \ MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED +endif + comment "Supported elliptic curves" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ECP_ALL_ENABLED bool "All available elliptic curves" select MBEDTLS_ECP_DP_SECP192R1_ENABLED @@ -182,6 +196,7 @@ config MBEDTLS_ECP_NIST_OPTIM bool "NSIT curves optimization" endif +endif comment "Supported hash" @@ -206,6 +221,8 @@ config MBEDTLS_HASH_SHA512_ENABLED comment "Supported cipher modes" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CIPHER_ALL_ENABLED bool "All available ciphers" select MBEDTLS_CIPHER_AES_ENABLED @@ -269,8 +286,12 @@ config MBEDTLS_CHACHAPOLY_AEAD_ENABLED bool "ChaCha20-Poly1305 AEAD algorithm" depends on MBEDTLS_CIPHER_CHACHA20_ENABLED || MBEDTLS_MAC_POLY1305_ENABLED +endif + comment "Supported message authentication methods" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_MAC_ALL_ENABLED bool "All available MAC methods" select MBEDTLS_MAC_MD4_ENABLED @@ -319,10 +340,14 @@ config MBEDTLS_MAC_CMAC_ENABLED bool "CMAC (Cipher-based Message Authentication Code) mode for block ciphers." depends on MBEDTLS_CIPHER_AES_ENABLED || MBEDTLS_CIPHER_DES_ENABLED +endif + endmenu comment "Random number generators" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CTR_DRBG_ENABLED bool "CTR_DRBG AES-256-based random generator" depends on MBEDTLS_CIPHER_AES_ENABLED @@ -332,14 +357,20 @@ config MBEDTLS_HMAC_DRBG_ENABLED bool "HMAC_DRBG random generator" select MBEDTLS_MD +endif + comment "Other configurations" config MBEDTLS_CIPHER bool "generic cipher layer." +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_MD bool "generic message digest layer." +endif + config MBEDTLS_GENPRIME_ENABLED bool "prime-number generation code." @@ -357,10 +388,14 @@ config MBEDTLS_HAVE_ASM of asymmetric cryptography, however this might have an impact on the code size. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ENTROPY_ENABLED bool "MbedTLS generic entropy pool" depends on MBEDTLS_MAC_SHA256_ENABLED || MBEDTLS_MAC_SHA384_ENABLED || MBEDTLS_MAC_SHA512_ENABLED +endif + config MBEDTLS_OPENTHREAD_OPTIMIZATIONS_ENABLED bool "MbedTLS optimizations for OpenThread" depends on NET_L2_OPENTHREAD diff --git a/modules/mbedtls/configs/config-tls-generic.h b/modules/mbedtls/configs/config-tls-generic.h index 93ddfbbd1ad..b69fe914781 100644 --- a/modules/mbedtls/configs/config-tls-generic.h +++ b/modules/mbedtls/configs/config-tls-generic.h @@ -455,6 +455,10 @@ #include CONFIG_MBEDTLS_USER_CONFIG_FILE #endif +#if defined(CONFIG_NRF_CC3XX_PLATFORM) +#define MBEDTLS_PLATFORM_ZEROIZE_ALT +#endif + #include "mbedtls/check_config.h" #endif /* MBEDTLS_CONFIG_H */ From 39a18d728179d545ac88ff1e26bd7d46eabfcc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Sat, 29 Jan 2022 13:03:08 +0100 Subject: [PATCH 009/501] [nrf noup] modules: mbedtls: Allow MBEDTLS_BUILTIN to be deselected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Out-of-tree crypto subsystems need to deselect MBEDTLS_BUILTIN, but deselection is not supported. It is however supported to select a dependency in a ! expression. Signed-off-by: Sebastian Bøe (cherry picked from commit 33eac6a3ed09fd9ba0dfc86dea07e1dbadb8024e) --- modules/mbedtls/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index 736ff47a1db..36da7d46b1b 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -26,6 +26,7 @@ choice MBEDTLS_IMPLEMENTATION config MBEDTLS_BUILTIN bool "Use Zephyr in-tree mbedTLS version" + depends on ! DISABLE_MBEDTLS_BUILTIN help Link with mbedTLS sources included with Zephyr distribution. Included mbedTLS version is well integrated with and supported @@ -39,6 +40,11 @@ config MBEDTLS_LIBRARY endchoice +# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select +# DISABLE_MBEDTLS_BUILTIN. +config DISABLE_MBEDTLS_BUILTIN + bool + config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" help From c094977296140c2a90ed0361cdbb782dfa66cfe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 13 Jan 2022 11:37:18 +0100 Subject: [PATCH 010/501] [nrf noup] modules: tf-m: use of PSA_HAS_XXXX_SUPPORT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This allows configurations enabled by PSA_WANTS_ALG_XXXX to be used to control which TF-M module is enabled -If the TF-M image doesn't support e.g. the MAC APIs, then the MAC interface is not enabled Note: This functionality requires that nrf_security is enabled ref: NCSDK-11689 Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 62f9b97d268b0a94b34505fbcfd0a6cd1e821999) --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 1b4f7e1b17a..eb33b9101bd 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -17,6 +17,7 @@ config TFM_CRYPTO_RNG_MODULE_ENABLED config TFM_CRYPTO_KEY_MODULE_ENABLED bool "KEY crypto module" default y + depends on PSA_HAS_KEY_SUPPORT && NRF_SECURITY help Enables the KEY crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key.c' @@ -25,6 +26,7 @@ config TFM_CRYPTO_KEY_MODULE_ENABLED config TFM_CRYPTO_AEAD_MODULE_ENABLED bool "AEAD crypto module" default y + depends on PSA_HAS_AEAD_SUPPORT && NRF_SECURITY help Enables the AEAD crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_aead.c' @@ -33,6 +35,7 @@ config TFM_CRYPTO_AEAD_MODULE_ENABLED config TFM_CRYPTO_MAC_MODULE_ENABLED bool "MAC crypto module" default y + depends on PSA_HAS_MAC_SUPPORT && NRF_SECURITY help Enables the MAC crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_mac.c' @@ -41,6 +44,7 @@ config TFM_CRYPTO_MAC_MODULE_ENABLED config TFM_CRYPTO_HASH_MODULE_ENABLED bool "HASH crypto module" default y + depends on PSA_HAS_HASH_SUPPORT && NRF_SECURITY help Enables the HASH crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_hash.c' @@ -49,6 +53,7 @@ config TFM_CRYPTO_HASH_MODULE_ENABLED config TFM_CRYPTO_CIPHER_MODULE_ENABLED bool "CIPHER crypto module" default y + depends on PSA_HAS_CIPHER_SUPPORT && NRF_SECURITY help Enables the CIPHER crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_cipher.c' @@ -57,6 +62,7 @@ config TFM_CRYPTO_CIPHER_MODULE_ENABLED config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED bool "ASYM ENCRYPT crypto module" default y + depends on PSA_HAS_ASYM_ENCRYPT_SUPPORT && NRF_SECURITY help Enables the ASYM ENCRYPT crypto module within the crypto partition. Unset this option if the encrypt functionality provided by 'crypto_asymmetric.c' @@ -65,6 +71,7 @@ config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED bool "ASYM SIGN crypto module" default y + depends on PSA_HAS_ASYM_SIGN_SUPPORT && NRF_SECURITY help Enables the ASYM SIGN crypto module within the crypto partition. Unset this option if the sign functionality provided by 'crypto_asymmetric.c' @@ -73,6 +80,7 @@ config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED bool "KEY DERIVATION crypto module" default y + depends on PSA_HAS_KEY_DERIVATION && NRF_SECURITY help Enables the KEY_DERIVATION crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_derivation.c' From 037d8974f2bb9797a9645200663a39d21157acb8 Mon Sep 17 00:00:00 2001 From: Jan Tore Guggedal Date: Mon, 18 May 2020 20:50:13 +0200 Subject: [PATCH 011/501] [nrf noup] net: mqtt: Provide option to enable TLS session caching Provides an option to enable TLS session caching for an MQTT client's secure socket. Signed-off-by: Jan Tore Guggedal Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Johann Fischer (cherry picked from commit 33569110b58e7f6a99102b3dd4d825eceb9c8b6b) --- include/zephyr/net/mqtt.h | 3 +++ subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index 8282092c9e3..58e7addd4ee 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -350,6 +350,9 @@ struct mqtt_sec_config { /** Indicates the list of security tags to be used for the session. */ sec_tag_t *sec_tag_list; + /** Indicates the preference for enabling TLS session caching. */ + int session_cache; + /** Peer hostname for ceritificate verification. * May be NULL to skip hostname verification. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 59b11a5b7ed..ab1d7d2f28b 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -78,6 +78,16 @@ int mqtt_client_tls_connect(struct mqtt_client *client) } } + if (tls_config->session_cache == TLS_SESSION_CACHE_ENABLED) { + ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, + TLS_SESSION_CACHE, + &tls_config->session_cache, + sizeof(tls_config->session_cache)); + if (ret < 0) { + goto error; + } + } + if (tls_config->cert_nocopy != TLS_CERT_NOCOPY_NONE) { ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, TLS_CERT_NOCOPY, &tls_config->cert_nocopy, From 890d32b05c575e52c9e6fc03830e47e992b6005d Mon Sep 17 00:00:00 2001 From: Mirko Covizzi Date: Thu, 10 Mar 2022 00:25:50 -0800 Subject: [PATCH 012/501] [nrf noup] net: mqtt: add native TLS support This commit adds an extra parameter in the configuration structure to configure native TLS support at runtime. Signed-off-by: Mirko Covizzi (cherry picked from commit a5543228b307e7326369578782c7441d8fc82ebf) --- doc/connectivity/networking/api/mqtt.rst | 3 +++ include/zephyr/net/mqtt.h | 3 +++ subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/connectivity/networking/api/mqtt.rst b/doc/connectivity/networking/api/mqtt.rst index b1090c8d394..dcc71e3320b 100644 --- a/doc/connectivity/networking/api/mqtt.rst +++ b/doc/connectivity/networking/api/mqtt.rst @@ -149,6 +149,7 @@ additional configuration information: tls_config->sec_tag_list = m_sec_tags; tls_config->sec_tag_count = ARRAY_SIZE(m_sec_tags); tls_config->hostname = MQTT_BROKER_HOSTNAME; + tls_config->set_native_tls = true; In this sample code, the ``m_sec_tags`` array holds a list of tags, referencing TLS credentials that the MQTT library should use for authentication. We do not specify @@ -161,6 +162,8 @@ Note, that TLS credentials referenced by the ``m_sec_tags`` array must be registered in the system first. For more information on how to do that, refer to :ref:`secure sockets documentation `. +Finally, ``set_native_tls`` can be optionally set to enable native TLS support instead of offloading TLS operations to the modem. + An example of how to use TLS with MQTT is also present in :ref:`mqtt-publisher-sample`. diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index 58e7addd4ee..79f7402acd9 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -360,6 +360,9 @@ struct mqtt_sec_config { /** Indicates the preference for copying certificates to the heap. */ int cert_nocopy; + + /** Set socket to native TLS */ + bool set_native_tls; }; /** @brief MQTT transport type. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index ab1d7d2f28b..b5bd419307d 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -22,10 +22,15 @@ int mqtt_client_tls_connect(struct mqtt_client *client) { const struct sockaddr *broker = client->broker; struct mqtt_sec_config *tls_config = &client->transport.tls.config; + int type = SOCK_STREAM; int ret; + if (tls_config->set_native_tls) { + type |= SOCK_NATIVE_TLS; + } + client->transport.tls.sock = zsock_socket(broker->sa_family, - SOCK_STREAM, IPPROTO_TLS_1_2); + type, IPPROTO_TLS_1_2); if (client->transport.tls.sock < 0) { return -errno; } From 8a92760d58c953337e489cc330c86f6ce2f376fd Mon Sep 17 00:00:00 2001 From: Sigvart Hovland Date: Fri, 3 May 2019 14:21:52 +0200 Subject: [PATCH 013/501] [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partition Manager (PM) is a component of the nRF Connect SDK (NCS) which uses yaml files to resolve flash partition placement with a holistic view of the entire device, including each firmware image present on the flash device, and various subsystems, such as settings and NFFS. When this NCS extension is used, various source files which would use partition information from devicetree in "vanilla" zephyr instead use defines generated by PM instead. This commit removes support for HEX_FILES_TO_MERGE, as it conflicts with PM. The settings subsystem pm.yml defines a partition 'settings_storage'. The nffs subsystem pm.yml defines 'nffs_storage'. Leverage label translation to avoid patching partition names. Refer to the NCS documentation page for this feature for more details. This is a long-running out of tree patch which has been worked on by several people. The following sign-offs are in alphabetical order by first name. Signed-off-by: Andrzej Głąbek Signed-off-by: Andrzej Puzdrowski Signed-off-by: Dominik Ermel Signed-off-by: Håkon Øye Amundsen Signed-off-by: Ioannis Glaropoulos Signed-off-by: Joakim Andersson Signed-off-by: Johann Fischer Signed-off-by: Martí Bolívar Signed-off-by: Ole Sæther Signed-off-by: Robert Lubos Signed-off-by: Sebastian Bøe Signed-off-by: Sigvart Hovland Signed-off-by: Thomas Stenersen Signed-off-by: Torsten Rasmussen Signed-off-by: Øyvind Rønningstad Signed-off-by: Trond Einar Snekvik Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 04254e149f229305e5f2e28b6a01247a2db120dd) (cherry picked from commit 5b202e4a29e41c6927b2128a34d772794018ffbe) --- Kconfig.zephyr | 4 +- cmake/modules/kernel.cmake | 4 ++ drivers/flash/soc_flash_nrf.c | 11 +++++ .../arm/aarch32/cortex_m/scripts/linker.ld | 46 +++++++++++++++++++ include/zephyr/storage/flash_map.h | 7 +++ soc/arm/common/cortex_m/arm_mpu_regions.c | 13 ++++++ subsys/fs/littlefs_fs.c | 12 ++++- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 +++++++++++ 8 files changed, 120 insertions(+), 4 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 0bdf18d2d91..49299304055 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -120,9 +120,7 @@ config FLASH_LOAD_SIZE endif # HAS_FLASH_LOAD_OFFSET config ROM_START_OFFSET - hex - prompt "ROM start offset" if !BOOTLOADER_MCUBOOT - default 0x200 if BOOTLOADER_MCUBOOT + hex "ROM start offset" default 0 help If the application is built for chain-loading by a bootloader this diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 461072cfe0b..c0a45cb0df5 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -239,3 +239,7 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() + +if(ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) +endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 2b81f5e9c99..bc414d1fc74 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,6 +37,11 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -137,6 +142,12 @@ static int flash_nrf_read(const struct device *dev, off_t addr, return 0; } +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld index eec04a05222..98a8566ed02 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -27,6 +27,35 @@ #define RAMABLE_REGION SRAM #endif +#if USE_PARTITION_MANAGER + +#include + +#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) +/* We are linking against S1, create symbol containing the flash ID of S0. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S0_ID; + +#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ + +#ifdef PM_S1_ID +/* We are linking against S0, create symbol containing the flash ID of S1. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S1_ID; +#endif /* PM_S1_ID */ + +#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ + +#define ROM_ADDR PM_ADDRESS +#define ROM_SIZE PM_SIZE + +#define RAM_SIZE PM_SRAM_SIZE +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -53,6 +82,23 @@ #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS #endif +#endif /* USE_PARTITION_MANAGER */ + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) +#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) +#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) +#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) +#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) +#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) +#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) +#endif + #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index a0ea8ba4fb1..794d4d13ec9 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -254,6 +254,10 @@ const struct device *flash_area_get_device(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); +#if USE_PARTITION_MANAGER +#include +#else + #define FLASH_AREA_LABEL_EXISTS(label) \ DT_HAS_FIXED_PARTITION_LABEL(label) @@ -279,6 +283,9 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); #define FLASH_AREA_DEVICE(label) \ DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODE_BY_FIXED_PARTITION_LABEL(label))) + +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/soc/arm/common/cortex_m/arm_mpu_regions.c b/soc/arm/common/cortex_m/arm_mpu_regions.c index 477dc30566c..d44c2ee05b3 100644 --- a/soc/arm/common/cortex_m/arm_mpu_regions.c +++ b/soc/arm/common/cortex_m/arm_mpu_regions.c @@ -9,6 +9,9 @@ #include #include "arm_mpu_mem_cfg.h" +#if USE_PARTITION_MANAGER +#include +#endif static const struct arm_mpu_region mpu_regions[] = { /* Region 0 */ @@ -22,6 +25,14 @@ static const struct arm_mpu_region mpu_regions[] = { #endif /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", +#if USE_PARTITION_MANAGER + PM_SRAM_ADDRESS, +#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) + REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), +#else + REGION_RAM_ATTR(REGION_SRAM_SIZE)), +#endif +#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -30,6 +41,8 @@ static const struct arm_mpu_region mpu_regions[] = { REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif +#endif /* USE_PARTITION_MANAGER */ + /* DT-defined regions */ LINKER_DT_REGION_MPU(ARM_MPU_REGION_INIT) }; diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index eba34b6abf4..db871c519a0 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -902,6 +902,12 @@ static const struct fs_file_system_t littlefs_fs = { .statvfs = littlefs_statvfs, }; +#ifdef USE_PARTITION_MANAGER +#define _LFS_USE_NCS_PM 1 +#else +#define _LFS_USE_NCS_PM 0 +#endif + #define DT_DRV_COMPAT zephyr_fstab_littlefs #define FS_PARTITION(inst) DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), partition, 0) #define FS_PARTITION_LABEL(inst) DT_STRING_TOKEN(FS_PARTITION(inst), label) @@ -937,7 +943,11 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = DT_INST_PROP(inst, mount_point), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *)FLASH_AREA_ID(FS_PARTITION_LABEL(inst)), \ + .storage_dev = (void *) (_LFS_USE_NCS_PM ?\ + COND_CODE_1(FLASH_AREA_LABEL_EXISTS(littlefs_storage), \ + (FLASH_AREA_ID(littlefs_storage)), \ + (FLASH_AREA_ID(storage))) :\ + FLASH_AREA_ID(FS_PARTITION_LABEL(inst))), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index ab5df7c4297..b4adec43445 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,8 +13,35 @@ extern "C" { #endif +#if CONFIG_PARTITION_MANAGER_ENABLED + +#include "pm_config.h" + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) +#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE +#else +/* The current image is a child image in a different domain than the image + * which defined the required values. To reach the values of the parent domain + * we use the 'PM__' variant of the define. + */ +#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ + +#else #define VDEV_START_ADDR CONFIG_RPMSG_SERVICE_SHM_BASE_ADDRESS #define VDEV_SIZE CONFIG_RPMSG_SERVICE_SHM_SIZE +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ + +#else + +#define VDEV_START_ADDR CONFIG_RPMSG_SERVICE_SHM_BASE_ADDRESS +#define VDEV_SIZE CONFIG_RPMSG_SERVICE_SHM_SIZE + +#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From d62225e7c6caa8cb7a946bf1a02482c82bde66f3 Mon Sep 17 00:00:00 2001 From: Kamil Piszczek Date: Fri, 18 Mar 2022 14:46:42 +0100 Subject: [PATCH 014/501] [nrf noup] ipc: backends: rpmsg: initialize shared memory to zero Added a code for initializing shared memory to zero. This operation normalizes the memory state so that the IPC service is no longer prone to reading status bits from the previous reset session. Signed-off-by: Kamil Piszczek Signed-off-by: Dominik Ermel (cherry picked from commit 93c50f309b0edbe51ea5a98c040adc087dab31ac) --- .../backends/ipc_rpmsg_static_vrings.c | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/subsys/ipc/ipc_service/backends/ipc_rpmsg_static_vrings.c b/subsys/ipc/ipc_service/backends/ipc_rpmsg_static_vrings.c index 7d89366764a..5ef914bf1e9 100644 --- a/subsys/ipc/ipc_service/backends/ipc_rpmsg_static_vrings.c +++ b/subsys/ipc/ipc_service/backends/ipc_rpmsg_static_vrings.c @@ -637,8 +637,8 @@ static int backend_init(const struct device *instance) return 0; } -#define DEFINE_BACKEND_DEVICE(i) \ - static struct backend_config_t backend_config_##i = { \ +#define BACKEND_CONFIG_POPULATE(i) \ + { \ .role = DT_ENUM_IDX_OR(DT_DRV_INST(i), role, ROLE_HOST), \ .shm_size = DT_REG_SIZE(DT_INST_PHANDLE(i, memory_region)), \ .shm_addr = DT_REG_ADDR(DT_INST_PHANDLE(i, memory_region)), \ @@ -653,8 +653,10 @@ static int backend_init(const struct device *instance) .buffer_size = DT_INST_PROP_OR(i, zephyr_buffer_size, \ RPMSG_BUFFER_SIZE), \ .id = i, \ - }; \ - \ + } + +#define BACKEND_DEVICE_DEFINE(i) \ + static struct backend_config_t backend_config_##i = BACKEND_CONFIG_POPULATE(i); \ static struct backend_data_t backend_data_##i; \ \ DEVICE_DT_INST_DEFINE(i, \ @@ -666,20 +668,23 @@ static int backend_init(const struct device *instance) CONFIG_IPC_SERVICE_REG_BACKEND_PRIORITY, \ &backend_ops); -DT_INST_FOREACH_STATUS_OKAY(DEFINE_BACKEND_DEVICE) +DT_INST_FOREACH_STATUS_OKAY(BACKEND_DEVICE_DEFINE) -#define BACKEND_CONFIG_INIT(n) &backend_config_##n, +#define BACKEND_CONFIG_DEFINE(i) BACKEND_CONFIG_POPULATE(i), #if defined(CONFIG_IPC_SERVICE_BACKEND_RPMSG_SHMEM_RESET) static int shared_memory_prepare(const struct device *arg) { - static const struct backend_config_t *config[] = { - DT_INST_FOREACH_STATUS_OKAY(BACKEND_CONFIG_INIT) + const struct backend_config_t *backend_config; + const struct backend_config_t backend_configs[] = { + DT_INST_FOREACH_STATUS_OKAY(BACKEND_CONFIG_DEFINE) }; - for (int i = 0; i < DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT); i++) { - if (config[i]->role == ROLE_HOST) { - memset((void *) config[i]->shm_addr, 0, VDEV_STATUS_SIZE); + for (backend_config = backend_configs; + backend_config < backend_configs + ARRAY_SIZE(backend_configs); + backend_config++) { + if (backend_config->role == ROLE_HOST) { + memset((void *) backend_config->shm_addr, 0, VDEV_STATUS_SIZE); } } From f4b7179a95a7cb605819490f22aa728bcb72bb83 Mon Sep 17 00:00:00 2001 From: Azizah Ibrahim Date: Wed, 7 Apr 2021 13:03:19 +0100 Subject: [PATCH 015/501] [nrf noup] samples: bluetooth: hci_pwr_ctrl: add dynamic control Enable dynamic power control in hci_pwr_ctrl sample for platforms using hci_rpmsg as controller Signed-off-by: Azizah Ibrahim Signed-off-by: Trond Einar Snekvik (cherry picked from commit fd1531b9ce42fbd5c92bc983138736e6109cd9f1) --- samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf diff --git a/samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf new file mode 100644 index 00000000000..e6749ae6399 --- /dev/null +++ b/samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf @@ -0,0 +1 @@ +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y From 2ed6b3d244b8302bf1f5d3ceb4274d7d714f8f32 Mon Sep 17 00:00:00 2001 From: Kamil Piszczek Date: Mon, 20 Jun 2022 10:14:39 +0200 Subject: [PATCH 016/501] [nrf noup] samples: mgmt: mcumgr: add hci_rpmsg child image config Added a configuration file for the HCI RPMsg child image that is necessary for multi-core targets. Signed-off-by: Kamil Piszczek (cherry picked from commit d6cd4fc1ceec4bb41c217709c373e5b9ffd05e51) --- .../mgmt/mcumgr/smp_svr/child_image/hci_rpmsg.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 samples/subsys/mgmt/mcumgr/smp_svr/child_image/hci_rpmsg.conf diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/child_image/hci_rpmsg.conf b/samples/subsys/mgmt/mcumgr/smp_svr/child_image/hci_rpmsg.conf new file mode 100644 index 00000000000..98260877332 --- /dev/null +++ b/samples/subsys/mgmt/mcumgr/smp_svr/child_image/hci_rpmsg.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2022 Nordic Semiconductor +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_BT_MAX_CONN=2 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=502 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 From 914d890a5e871e234a7093fa31b65e694c516559 Mon Sep 17 00:00:00 2001 From: Maciej Perkowski Date: Fri, 28 Jan 2022 12:02:58 +0100 Subject: [PATCH 017/501] [nrf noup] ci: clang: parallel execution Bring back parallel execution to the clang action. In the upstream they went to use a single dedicated powerfull agent to run this. We need to keep this as we have to base on agents available in github's cloud. Signed-off-by: Maciej Perkowski Signed-off-by: Gerard Marull-Paretas Signed-off-by: Dominik Ermel Signed-off-by: Torsten Rasmussen Signed-off-by: Maciej Perkowski (cherry picked from commit 74a52c1ad956c0098d82cb11c907df0f7eae15a8) (cherry picked from commit 2d9b66ba1ed656ffe790e0ef52db1c48318028f8) --- .github/workflows/clang.yaml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 6e36e19d76c..8dd72dedf33 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -22,11 +22,13 @@ jobs: fail-fast: false matrix: platform: ["native_posix"] + subset: [1, 2, 3, 4, 5] env: ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 CLANG_ROOT_DIR: /usr/lib/llvm-12 COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} + MATRIX_SIZE: 5 outputs: report_needed: ${{ steps.twister.outputs.report_needed }} steps: @@ -89,7 +91,7 @@ jobs: id: cache-ccache uses: zephyrproject-rtos/action-s3-cache@v1 with: - key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.platform }}-ccache + key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.subset }}-ccache path: /github/home/.ccache aws-s3-bucket: ccache.zephyrproject.org aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }} @@ -102,6 +104,17 @@ jobs: test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache ccache -M 10G -s + - name: Build test plan with Twister + working-directory: ./zephyr + id: twister_test_plan + run: | + export ZEPHYR_BASE=${PWD} + export ZEPHYR_TOOLCHAIN_VARIANT=llvm + + # check if we need to run a full twister or not based on files changed + python3 ./scripts/ci/test_plan.py -p native_posix -c origin/${BASE_REF}.. + + - name: Run Tests with Twister working-directory: ./zephyr id: twister @@ -116,7 +129,7 @@ jobs: if [ -s testplan.json ]; then echo "::set-output name=report_needed::1"; # Full twister but with options based on changes - ./scripts/twister --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 + ./scripts/twister --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 --subset ${{matrix.subset}}/${MATRIX_SIZE} else # if nothing is run, skip reporting step echo "::set-output name=report_needed::0"; @@ -131,7 +144,7 @@ jobs: if: always() && steps.twister.outputs.report_needed != 0 uses: actions/upload-artifact@v2 with: - name: Unit Test Results (Subset ${{ matrix.platform }}) + name: Unit Test Results (Subset ${{ matrix.subset }}) path: zephyr/twister-out/twister.xml clang-build-results: From 9b5c88d0ad4ba3fba5040d953cf1fc1d1a17478e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Fri, 24 Apr 2020 16:20:07 -0700 Subject: [PATCH 018/501] [nrf noup] dts: choose cryptocell for entropy when available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a long-term noup patch because driver support is NCS-only. Add compatibles for CC310 and CC312 NS access. These downstream-only compatibles allow accessing the cryptocell from non-secure code. Use these, as well as pre-existing nodes for accessing the hardware directly from the secure world, in the relevant .dtsi files. Set HAS_HW_NRF_CC3XX when cryptocell-sw is present. Signed-off-by: Martí Bolívar Signed-off-by: Joakim Andersson Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Ioannis Glaropoulos Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Torsten Rasmussen (cherry picked from commit 31663ded5bc0185f522414fa7c7c938cd2ee2bf3) --- dts/arm/nordic/nrf52840.dtsi | 2 +- dts/arm/nordic/nrf5340_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf5340_cpuappns.dtsi | 10 +++++++++- dts/arm/nordic/nrf9160.dtsi | 1 + dts/arm/nordic/nrf9160ns.dtsi | 17 +++++++++++++++++ dts/bindings/crypto/nordic,nrf-cc310-sw.yaml | 17 +++++++++++++++++ dts/bindings/crypto/nordic,nrf-cc312-sw.yaml | 17 +++++++++++++++++ modules/hal_nordic/Kconfig.dt | 2 ++ soc/arm/nordic_nrf/Kconfig.peripherals | 4 ++-- 9 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 dts/bindings/crypto/nordic,nrf-cc310-sw.yaml create mode 100644 dts/bindings/crypto/nordic,nrf-cc312-sw.yaml diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index ab6651542df..5e53a59d3f2 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -5,7 +5,7 @@ / { chosen { - zephyr,entropy = &rng; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index 7a32c5398db..1294203f00a 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -33,7 +33,7 @@ }; chosen { - zephyr,entropy = &rng_hci; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf5340_cpuappns.dtsi b/dts/arm/nordic/nrf5340_cpuappns.dtsi index e7393b3a900..75f3a191607 100644 --- a/dts/arm/nordic/nrf5340_cpuappns.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns.dtsi @@ -29,7 +29,7 @@ }; chosen { - zephyr,entropy = &rng_hci; + zephyr,entropy = &cryptocell_sw; zephyr,flash-controller = &flash_controller; }; @@ -54,6 +54,14 @@ ipc { #include "nrf5340_cpuapp_ipc.dtsi" }; + + /* For cryptocell access via platform library; see above */ + cryptocell_sw: cryptocell-sw { + compatible = "nordic,nrf-cc312-sw"; + #address-cells = <0>; + label = "CRYPTOCELL_SW"; + status = "okay"; + }; }; &nvic { diff --git a/dts/arm/nordic/nrf9160.dtsi b/dts/arm/nordic/nrf9160.dtsi index 39b3df32ad6..8d54777f9f5 100644 --- a/dts/arm/nordic/nrf9160.dtsi +++ b/dts/arm/nordic/nrf9160.dtsi @@ -28,6 +28,7 @@ }; chosen { + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf9160ns.dtsi b/dts/arm/nordic/nrf9160ns.dtsi index 81d318a43e4..366de073436 100644 --- a/dts/arm/nordic/nrf9160ns.dtsi +++ b/dts/arm/nordic/nrf9160ns.dtsi @@ -29,6 +29,15 @@ chosen { zephyr,flash-controller = &flash_controller; + + /* + * By default, system entropy comes from the entropy_cc310.c + * driver in the nrf repository. This is devicetree glue + * needed to make the system aware of that fact. Individual + * applications can override this by changing this property + * value. + */ + zephyr,entropy = &cryptocell_sw; }; soc { @@ -53,6 +62,14 @@ status = "disabled"; }; }; + + + /* For cryptocell access via platform library; see above */ + cryptocell_sw: cryptocell-sw { + compatible = "nordic,nrf-cc310-sw"; + label = "CRYPTOCELL_SW"; + status = "okay"; + }; }; &nvic { diff --git a/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml b/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml new file mode 100644 index 00000000000..a0724a45938 --- /dev/null +++ b/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2020, Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Stub access to cryptocell via platform driver + + Non-secure configurations can use this compatible to declare + devicetree nodes which access the CC310 via callbacks into secure + code. + +compatible: "nordic,nrf-cc310-sw" + +include: base.yaml + +properties: + label: + required: true diff --git a/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml b/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml new file mode 100644 index 00000000000..9c3f936bf20 --- /dev/null +++ b/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2021, Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Stub access to cryptocell via platform driver + + Non-secure configurations can use this compatible to declare + devicetree nodes which access the CC312 via callbacks into secure + code. + +compatible: "nordic,nrf-cc312-sw" + +include: base.yaml + +properties: + label: + required: true diff --git a/modules/hal_nordic/Kconfig.dt b/modules/hal_nordic/Kconfig.dt index 1ace20ac4a6..49ea9861fbc 100644 --- a/modules/hal_nordic/Kconfig.dt +++ b/modules/hal_nordic/Kconfig.dt @@ -8,7 +8,9 @@ DT_COMPAT_NORDIC_NRF_ACL := nordic,nrf-acl DT_COMPAT_NORDIC_NRF_ADC := nordic,nrf-adc DT_COMPAT_NORDIC_NRF_BPROT := nordic,nrf-bprot DT_COMPAT_NORDIC_NRF_CC310 := nordic,nrf-cc310 +DT_COMPAT_NORDIC_NRF_CC310_SW := nordic,nrf-cc310-sw DT_COMPAT_NORDIC_NRF_CC312 := nordic,nrf-cc312 +DT_COMPAT_NORDIC_NRF_CC312_SW := nordic,nrf-cc312-sw DT_COMPAT_NORDIC_NRF_CCM := nordic,nrf-ccm DT_COMPAT_NORDIC_NRF_CLOCK := nordic,nrf-clock DT_COMPAT_NORDIC_NRF_COMP := nordic,nrf-comp diff --git a/soc/arm/nordic_nrf/Kconfig.peripherals b/soc/arm/nordic_nrf/Kconfig.peripherals index f5ae9041b6e..3b2c3c438ee 100644 --- a/soc/arm/nordic_nrf/Kconfig.peripherals +++ b/soc/arm/nordic_nrf/Kconfig.peripherals @@ -13,10 +13,10 @@ config HAS_HW_NRF_BPROT def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT)) config HAS_HW_NRF_CC310 - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310)) || $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310_SW)) config HAS_HW_NRF_CC312 - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312)) || $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312_SW)) config HAS_HW_NRF_CCM def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM)) From 191a8d69823695cd418004ce916253504fa41a98 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 1 Oct 2018 10:27:32 +0200 Subject: [PATCH 019/501] [nrf noup] include: net: add NCS extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add some socket options and address family extensions to Zephyr headers, which will be useful for nRF Connect SDK. The "author" of this commit is a contact person; various people with s-o-b lines following here have contributed to the maintenance of this patch. Signed-off-by: Andreas Moltumyr Signed-off-by: Andrzej Głąbek Signed-off-by: Christopher Métrailler Signed-off-by: Dominik Ermel Signed-off-by: Emanuele Di Santo Signed-off-by: Glenn Ruben Bakke Signed-off-by: Håkon Alseth Signed-off-by: Ioannis Glaropoulos Signed-off-by: Jan Tore Guggedal Signed-off-by: Joakim Andersson Signed-off-by: Martí Bolívar Signed-off-by: Mirko Covizzi Signed-off-by: Petri Honkala Signed-off-by: Robert Lubos Signed-off-by: Tommi Mammela Signed-off-by: Trond Einar Snekvik Signed-off-by: Torsten Rasmussen Signed-off-by: Mirko Covizzi (cherry picked from commit ef87d64245e68b802fac975fc3ec4d7e7c60b273) (cherry picked from commit c5689f8516fa094c34ee6c0f36d51b7115c2ea3f) --- include/zephyr/net/socket.h | 2 + include/zephyr/net/socket_ncs.h | 101 ++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 include/zephyr/net/socket_ncs.h diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index ae6218b3b92..5ea9ac7977b 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #ifdef __cplusplus @@ -138,6 +139,7 @@ struct zsock_pollfd { */ #define TLS_DTLS_HANDSHAKE_TIMEOUT_MIN 8 #define TLS_DTLS_HANDSHAKE_TIMEOUT_MAX 9 + /** Socket option for preventing certificates from being copied to the mbedTLS * heap if possible. The option is only effective for DER certificates and is * ignored for PEM certificates. diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h new file mode 100644 index 00000000000..62e95e2015b --- /dev/null +++ b/include/zephyr/net/socket_ncs.h @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ +#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ + +/** + * @file + * @brief NCS specific additions to the BSD sockets API definitions + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence + * when creating a new socket. Combine this flag with a socket type when + * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE). + * If it's desired to create a native TLS socket, but still offload the + * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS. + */ +#define SOCK_NATIVE 0x80000000 +#define SOCK_NATIVE_TLS 0x40000000 + +/* NCS specific TLS options */ + +/** Socket option to set DTLS handshake timeout, specifically for nRF sockets. + * The option accepts an integer, indicating the total handshake timeout, + * including retransmissions, in seconds. + * Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123. + */ +#define TLS_DTLS_HANDSHAKE_TIMEO 14 + +/* Valid values for TLS_SESSION_CACHE option */ +#define TLS_SESSION_CACHE_DISABLED 0 /**< Disable TLS session caching. */ +#define TLS_SESSION_CACHE_ENABLED 1 /**< Enable TLS session caching. */ + +/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */ +#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */ +#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 /**< 1s + 2s + 4s + 8s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 /**< 1s + 2s + 4s + 8s + 16s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */ + +/* NCS specific socket options */ + +/** sockopt: disable all replies to unexpected traffics */ +#define SO_SILENCE_ALL 30 +/** sockopt: disable IPv4 ICMP replies */ +#define SO_IP_ECHO_REPLY 31 +/** sockopt: disable IPv6 ICMP replies */ +#define SO_IPV6_ECHO_REPLY 32 +/** sockopt: Release Assistance Indication feature: This will indicate that the + * application will not send any more data. + */ +#define SO_RAI_NO_DATA 50 +/** sockopt: Release Assistance Indication feature: This will indicate that the + * next call to send/sendto will be the last one for some time. + */ +#define SO_RAI_LAST 51 +/** sockopt: Release Assistance Indication feature: This will indicate that + * after the next call to send/sendto, the application is expecting to receive + * one more data packet before this socket will not be used again for some time. + */ +#define SO_RAI_ONE_RESP 52 +/** sockopt: Release Assistance Indication feature: If a client application + * expects to use the socket more it can indicate that by setting this socket + * option before the next send call which will keep the network up longer. + */ +#define SO_RAI_ONGOING 53 +/** sockopt: Release Assistance Indication feature: If a server application + * expects to use the socket more it can indicate that by setting this socket + * option before the next send call. + */ +#define SO_RAI_WAIT_MORE 54 +/** sockopt: Configurable TCP server session timeout in minutes. + * Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout). + */ +#define SO_TCP_SRV_SESSTIMEO 55 + +/* NCS specific gettaddrinfo() flags */ + +/** Assume `service` contains a Packet Data Network (PDN) ID. + * When specified together with the AI_NUMERICSERV flag, + * `service` shall be formatted as follows: "port:pdn_id" + * where "port" is the port number and "pdn_id" is the PDN ID. + * Example: "8080:1", port 8080 PDN ID 1. + * Example: "42:0", port 42 PDN ID 0. + */ +#define AI_PDNSERV 0x1000 + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */ From 6324c86bb8cce91efa0a36b9d0e4d49c39b386b7 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 20 Nov 2020 14:44:03 +0100 Subject: [PATCH 020/501] [nrf noup] Bluetooth: update experimental for qualification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Kconfig options for qualification: - Remove experimental on qualified feature. - Add experimental on unqualified feature. - BT_L2CAP_ECRED is not marked as experimental upstream and we qualify it downstream. Signed-off-by: Joakim Andersson Signed-off-by: Trond Einar Snekvik Signed-off-by: Martí Bolívar Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Ingar Kulbrandstad Signed-off-by: Torsten Rasmussen (cherry picked from commit 1e8c632358761d97cf2d659eb9fdc316b4558547) Signed-off-by: Herman Berget (cherry picked from commit 42d8f92abdd10df8229ae4d5aabc8fbbe4b1aef9) --- subsys/bluetooth/Kconfig.adv | 3 +-- subsys/bluetooth/controller/Kconfig | 3 ++- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/Kconfig.adv b/subsys/bluetooth/Kconfig.adv index 5033b4d755c..7523742a204 100644 --- a/subsys/bluetooth/Kconfig.adv +++ b/subsys/bluetooth/Kconfig.adv @@ -5,9 +5,8 @@ # SPDX-License-Identifier: Apache-2.0 config BT_EXT_ADV - bool "Extended Advertising and Scanning support [EXPERIMENTAL]" + bool "Extended Advertising and Scanning support" depends on !BT_CTLR || BT_CTLR_ADV_EXT_SUPPORT - select EXPERIMENTAL help Select this to enable Extended Advertising API support. This enables support for advertising with multiple advertising sets, diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 0dbd9357042..f0bca487b8f 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -95,7 +95,8 @@ choice BT_LL_CHOICE Select the Bluetooth Link Layer to compile. config BT_LL_SW_SPLIT - bool "Software-based BLE Link Layer" + bool "Software-based BLE Link Layer [EXPERIMENTAL]" + select EXPERIMENTAL select ENTROPY_GENERATOR select NRF_HW_TIMER0_RESERVED select NRF_HW_RTC0_RESERVED diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index baaac75903e..c9521672fbf 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -48,7 +48,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support" + bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From 05688726d76e9d8656d4dca4480447c424b417c1 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 23 Jun 2022 14:10:01 +0000 Subject: [PATCH 021/501] [nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1 The commit adds bootutil hook, for nrf5340, to allow it handling the non-accessible image-1/primary slot. Signed-off-by: Dominik Ermel (cherry picked from commit 482dcc7865f7d3a458f061a1d8276c5801eed1e4) --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 ++++++ subsys/mgmt/mcumgr/Kconfig | 1 + .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 27 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index 03dd7d8ed71..c6594f00838 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -22,3 +22,11 @@ if (CONFIG_FS_MGMT_CHECKSUM_HASH AND CONFIG_FS_MGMT_HASH_SHA256) zephyr_link_libraries(mbedTLS) endif() endif() + +if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 20649f87b65..ea0ad6612bb 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,6 +6,7 @@ menuconfig MCUMGR bool "mcumgr Support" select NET_BUF select ZCBOR + select BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP_QKAA help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c new file mode 100644 index 00000000000..9971a4e0843 --- /dev/null +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "bootutil/bootutil_public.h" + +int boot_read_swap_state_primary_slot_hook(int image_index, + struct boot_swap_state *state) +{ + if (image_index == 1) { + /* Pretend that primary slot of image 1 unpopulated */ + state->magic = BOOT_MAGIC_UNSET; + state->swap_type = BOOT_SWAP_TYPE_NONE; + state->image_num = image_index; + state->copy_done = BOOT_FLAG_UNSET; + state->image_ok = BOOT_FLAG_UNSET; + + /* Prevent bootutil from trying to obtain true info */ + return 0; + } + + return BOOT_HOOK_REGULAR; +} From cb225d2ca91473f4808f2d4781ca4c60793926c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=85s?= Date: Mon, 30 May 2022 23:41:42 +0200 Subject: [PATCH 022/501] [nrf noup] ci: Add Zephyr lwm2m test spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update test spec. Signed-off-by: Fredrik Ås (cherry picked from commit c857601bbbd0bbac5cca84936d0692049ba5fefd) --- .github/test-spec.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index e29e7d1dbc2..7a172f4bfdf 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -1,4 +1,13 @@ # This is the Jenkins ci variant of the .github/labler.yaml +"CI-iot-zephyr-lwm2m-test": + - "drivers/console/**/*" + - "drivers/flash/**/*" + - "subsys/dfu/boot/**/*" + - "subsys/net/ip/**/*" + - "subsys/net/lib/http/**/*" + - "subsys/net/lib/lwm2m//**/*" + - "subsys/net/**/*" + "CI-iot-samples-test": - "boards/arm/nrf9160dk_nrf9160/**/*" - "dts/arm/nordic/nrf9160*" From a05e795eb591a8acc913b08f029f430e9de393ad Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 5 Aug 2022 09:23:10 +0100 Subject: [PATCH 023/501] [nrf noup] Revert "kconfig: default to LEGACY_INCLUDE_PATH=n" This reverts commit 855216f582d2e10f65159c70f104579d0c6235b0. Signed-off-by: Jamie McCrae (cherry picked from commit 5224dd53d8c577808c41b8acbf9869e94fc48136) --- Kconfig.zephyr | 1 + 1 file changed, 1 insertion(+) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 49299304055..7a2b45d2cf9 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -843,6 +843,7 @@ endmenu config LEGACY_INCLUDE_PATH bool "Allow for the legacy include paths (without the zephyr/ prefix)" + default y help Allow applications and libraries to use the Zephyr legacy include path which does not use the zephyr/ prefix. For example, the From bb403269b6b397ce6f200a1c449370c4b2c7f4ef Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Mon, 14 Mar 2022 12:56:40 +0100 Subject: [PATCH 024/501] [nrf fromlist] cmake: fix improper use of separate_arguments PR: https://github.com/zephyrproject-rtos/zephyr/pull/43761 The use of `separate_arguments()` in extra_flags.cmake and unittest.cmake prevents the use of proper CMake lists. A CMake list can be specified on command line as: `-DMY_LIST="itemA;itemB;itemC"` Users are expected to be able to provide extra compile flags using CMake lists, like `-DEXTRA_CFLAGS="--flag1;--flag2"` but also using space separated lists, like: `-DEXTRA_CFLAGS="--flag1 --flag2"`. Instead of using `separate_arguments(...)` for this purposes, then it is better to simply replace spaces with `;` to create a proper CMake list, regardless of the input form used by the user. This is same principle that is used for CONF_FILE, DTC_OVERLAY_FILE, and other settings. Signed-off-by: Torsten Rasmussen (cherry picked from commit ce095eabc385346021a8bc4ca83cc46bea888097) --- cmake/extra_flags.cmake | 10 +++++----- cmake/modules/unittest.cmake | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/extra_flags.cmake b/cmake/extra_flags.cmake index fa03a87fcc9..f60c0b67ce0 100644 --- a/cmake/extra_flags.cmake +++ b/cmake/extra_flags.cmake @@ -1,10 +1,10 @@ # SPDX-License-Identifier: Apache-2.0 -separate_arguments(EXTRA_CPPFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CPPFLAGS}) -separate_arguments(EXTRA_LDFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_LDFLAGS}) -separate_arguments(EXTRA_CFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CFLAGS}) -separate_arguments(EXTRA_CXXFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CXXFLAGS}) -separate_arguments(EXTRA_AFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_AFLAGS}) +string(REPLACE " " ";" EXTRA_CPPFLAGS_AS_LIST "${EXTRA_CPPFLAGS}") +string(REPLACE " " ";" EXTRA_LDFLAGS_AS_LIST "${EXTRA_LDFLAGS}") +string(REPLACE " " ";" EXTRA_CFLAGS_AS_LIST "${EXTRA_CFLAGS}") +string(REPLACE " " ";" EXTRA_CXXFLAGS_AS_LIST "${EXTRA_CXXFLAGS}") +string(REPLACE " " ";" EXTRA_AFLAGS_AS_LIST "${EXTRA_AFLAGS}") if(EXTRA_CPPFLAGS) zephyr_compile_options(${EXTRA_CPPFLAGS_AS_LIST}) diff --git a/cmake/modules/unittest.cmake b/cmake/modules/unittest.cmake index c2d97cebbb4..9f185297447 100644 --- a/cmake/modules/unittest.cmake +++ b/cmake/modules/unittest.cmake @@ -8,11 +8,11 @@ enable_language(C CXX ASM) # SOURCES: list of source files, default main.c # INCLUDE: list of additional include paths relative to ZEPHYR_BASE -separate_arguments( EXTRA_CFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CFLAGS}) -separate_arguments( EXTRA_AFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_AFLAGS}) -separate_arguments(EXTRA_CPPFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CPPFLAGS}) -separate_arguments(EXTRA_CXXFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CXXFLAGS}) -separate_arguments(EXTRA_LDFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_LDFLAGS}) +string(REPLACE " " ";" EXTRA_CFLAGS_AS_LIST "${EXTRA_CFLAGS}") +string(REPLACE " " ";" EXTRA_AFLAGS_AS_LIST "${EXTRA_AFLAGS}") +string(REPLACE " " ";" EXTRA_CPPFLAGS_AS_LIST "${EXTRA_CPPFLAGS}") +string(REPLACE " " ";" EXTRA_CXXFLAGS_AS_LIST "${EXTRA_CXXFLAGS}") +string(REPLACE " " ";" EXTRA_LDFLAGS_AS_LIST "${EXTRA_LDFLAGS}") set(ENV_ZEPHYR_BASE $ENV{ZEPHYR_BASE}) # This add support for old style boilerplate include. From 5f36de7a8fd8a95ce5d93f656080651ccbfed4b0 Mon Sep 17 00:00:00 2001 From: Kamil Gawor Date: Mon, 11 Jul 2022 15:30:20 +0200 Subject: [PATCH 025/501] [nrf fromlist] boards: nrf5340dk_nrf5340_cpuapp: Add BT_HCI_VS explicit enable. Add explicit BT_HCI_VS enable for nRF5340 application core. It does not have Bluetooth Controller so dependecies will not be solved automatically. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/47635 Signed-off-by: Kamil Gawor Signed-off-by: Torsten Rasmussen (cherry picked from commit 35357799b464e03a9fe78e9dbba9fcd539597f3c) --- boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig b/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig index 7f34a0ca4b5..611c3f3976c 100644 --- a/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig +++ b/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig @@ -128,6 +128,11 @@ endchoice config HEAP_MEM_POOL_SIZE default 4096 if BT_RPMSG +# Application core does not have dependencies to the Controller. +# BT_HCI_VS must be explicitly enabled. +config BT_HCI_VS + default y if BT + endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS if BOARD_NRF5340DK_NRF5340_CPUNET From 4a1d2adb4417e0131c14aaf0d31745632d2078b0 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Thu, 4 Aug 2022 10:45:38 +0200 Subject: [PATCH 026/501] [nrf fromtree] west: adding --domain to west build synopsis Adding `--domain DOMAIN` to the west build synopsis. Signed-off-by: Torsten Rasmussen (cherry picked from commit 6ec66435e874fe170d2c371c09bc6c9ba3578cd8) --- scripts/west_commands/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index c4d0e09b851..0c62213d679 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -26,7 +26,7 @@ west build [-h] [-b BOARD[@REV]]] [-d BUILD_DIR] [-t TARGET] [-p {auto, always, never}] [-c] [--cmake-only] [-n] [-o BUILD_OPT] [-f] - [--sysbuild | --no-sysbuild] + [--sysbuild | --no-sysbuild] [--domain DOMAIN] [source_dir] -- [cmake_opt [cmake_opt ...]] ''' From 4d330a278b2c560b2840443d4ef2cf90ece1598f Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 3 Aug 2022 19:25:20 +0200 Subject: [PATCH 027/501] [nrf fromtree] modules: openthread: Fix building with picolibc The OpenThread module should not explicitly link with libc in case of minimal libc or picolibc. Signed-off-by: Pieter De Gendt (cherry picked from commit fb6d094aab05a638cdb52050ee4c43db98311f08) --- modules/openthread/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/openthread/CMakeLists.txt b/modules/openthread/CMakeLists.txt index e19db58debd..96c35edbce8 100644 --- a/modules/openthread/CMakeLists.txt +++ b/modules/openthread/CMakeLists.txt @@ -433,9 +433,11 @@ target_compile_options(ot-config INTERFACE # errno_private.h is generated as part of ${SYSCALL_LIST_H_TARGET} target. add_dependencies(ot-config ${SYSCALL_LIST_H_TARGET}) -# Make sure C library is linked after OpenThread libraries (to prevent linker -# errors) -target_link_libraries(ot-config INTERFACE -lc) +# Make sure C library, in case of newlib, is linked after OpenThread libraries +# (to prevent linker errors) +if(CONFIG_NEWLIB_LIBC) + target_link_libraries(ot-config INTERFACE -lc) +endif() # Include OpenThread headers zephyr_system_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}/include) From 184038f7b2ee6cf3a54d32759f4e35aa70cd1742 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 4 Aug 2022 15:13:08 +0200 Subject: [PATCH 028/501] [nrf fromtree] scripts: build: elf_parser: use node name for Graphviz diagrams The elf_parser library now generates a dot file with device dependencies that can be later rendered using Graphviz. Each node in the diagram contains the device label (taken from DT node). In some cases the label property can be None, leading to build failures like: ``` line 273, in device_dependency_graph text = '{:s}\\nOrdinal: {:d} | Handle: {:d}\\n{:s}'.format( TypeError: unsupported format string passed to NoneType.__format__ ``` This patch switches to node name instead, which will always be set to some value. This value is actually what devices get now as a name if they do not have a label set. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 81c5b6e765b3657efe6a3573f3d0385b3550cd6a) --- scripts/build/elf_parser.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/build/elf_parser.py b/scripts/build/elf_parser.py index 533c6489df1..c156e41939d 100644 --- a/scripts/build/elf_parser.py +++ b/scripts/build/elf_parser.py @@ -268,9 +268,8 @@ def device_dependency_graph(self, title, comment): text = '{:s}\\nHandle: {:d}'.format(dev.sym.name, dev.handle) else: n = self.edt.dep_ord2node[dev.ordinal] - label = n.labels[0] if n.labels else n.label text = '{:s}\\nOrdinal: {:d} | Handle: {:d}\\n{:s}'.format( - label, dev.ordinal, dev.handle, n.path + n.name, dev.ordinal, dev.handle, n.path ) dot.node(str(dev.ordinal), text) for dev in self.devices: From 10313a4d059495c54071bd87c796bbe45199a26d Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 4 Aug 2022 10:55:31 -0500 Subject: [PATCH 029/501] [nrf fromtree] drivers: sensor: Convert Kconfig bus 'depends on' to 'select' This change in pattern is meant to address a misconfiguration issue that can occur for sensors that support being on multiple busses like I2C & SPI. For example, you can have a configuration in which such a sensor is on the I2C bus in the devicetree and the sensor is enabled. However the application configuration enables CONFIG_SPI=y and CONFIG_I2C=n and this will cause the sensor driver to be built by default, however since we don't have the I2C bus enabled the driver will not compile correctly. Previously we had been adding to board Kconfig.defconfig something like: config I2C default y if SENSOR This pattern doesn't scale well and may differ from what an application specific need/use is. So instead move to a pattern in which we leave the default enablement up to the devicetree "status" property for the sensor. We then have the Kconfig move from 'depends on ' to 'select ' and in the case of drivers that support multiple busses we have the Kconfig be: 'select if $(dt_compat_on_bus,$(),) for each bus type the sensor supports. This removes the need to add Kconfig logic to each board and enables the bus subsystem and bus controller driver if the sensor requires it by default in the build system. Fixes: #48518 Signed-off-by: Kumar Gala (cherry picked from commit 550a80a214b8c018e3a54a35e90a625339db747d) --- drivers/sensor/adt7420/Kconfig | 2 +- drivers/sensor/adxl345/Kconfig | 3 ++- drivers/sensor/adxl362/Kconfig | 2 +- drivers/sensor/adxl372/Kconfig | 3 ++- drivers/sensor/ak8975/Kconfig | 2 +- drivers/sensor/amg88xx/Kconfig | 2 +- drivers/sensor/ams_iAQcore/Kconfig | 2 +- drivers/sensor/apds9960/Kconfig | 2 +- drivers/sensor/bma280/Kconfig | 2 +- drivers/sensor/bmc150_magn/Kconfig | 2 +- drivers/sensor/bme280/Kconfig | 3 ++- drivers/sensor/bme680/Kconfig | 3 ++- drivers/sensor/bmg160/Kconfig | 2 +- drivers/sensor/bmi160/Kconfig | 3 ++- drivers/sensor/bmi270/Kconfig | 2 +- drivers/sensor/bmm150/Kconfig | 2 +- drivers/sensor/bmp388/Kconfig | 3 ++- drivers/sensor/bq274xx/Kconfig | 2 +- drivers/sensor/ccs811/Kconfig | 2 +- drivers/sensor/dps310/Kconfig | 2 +- drivers/sensor/ens210/Kconfig | 2 +- drivers/sensor/fdc2x1x/Kconfig | 3 ++- drivers/sensor/fxas21002/Kconfig | 2 +- drivers/sensor/fxos8700/Kconfig | 2 +- drivers/sensor/hmc5883l/Kconfig | 2 +- drivers/sensor/hp206c/Kconfig | 2 +- drivers/sensor/hts221/Kconfig | 3 ++- drivers/sensor/i3g4250d/Kconfig | 2 +- drivers/sensor/icm42605/Kconfig | 2 +- drivers/sensor/icm42670/Kconfig | 2 +- drivers/sensor/iis2dh/Kconfig | 3 ++- drivers/sensor/iis2dlpc/Kconfig | 3 ++- drivers/sensor/iis2iclx/Kconfig | 3 ++- drivers/sensor/iis2mdc/Kconfig | 3 ++- drivers/sensor/iis3dhhc/Kconfig | 2 +- drivers/sensor/ina219/Kconfig | 2 +- drivers/sensor/ina23x/Kconfig | 2 +- drivers/sensor/isl29035/Kconfig | 2 +- drivers/sensor/ism330dhcx/Kconfig | 3 ++- drivers/sensor/lis2dh/Kconfig | 3 ++- drivers/sensor/lis2ds12/Kconfig | 3 ++- drivers/sensor/lis2dw12/Kconfig | 3 ++- drivers/sensor/lis2mdl/Kconfig | 3 ++- drivers/sensor/lis3mdl/Kconfig | 2 +- drivers/sensor/lm75/Kconfig | 2 +- drivers/sensor/lm77/Kconfig | 2 +- drivers/sensor/lps22hb/Kconfig | 2 +- drivers/sensor/lps22hh/Kconfig | 3 ++- drivers/sensor/lps25hb/Kconfig | 2 +- drivers/sensor/lsm303dlhc_magn/Kconfig | 2 +- drivers/sensor/lsm6ds0/Kconfig | 2 +- drivers/sensor/lsm6dsl/Kconfig | 3 ++- drivers/sensor/lsm6dso/Kconfig | 3 ++- drivers/sensor/lsm9ds0_gyro/Kconfig | 2 +- drivers/sensor/lsm9ds0_mfd/Kconfig | 2 +- drivers/sensor/max17055/Kconfig | 2 +- drivers/sensor/max17262/Kconfig | 2 +- drivers/sensor/max30101/Kconfig | 2 +- drivers/sensor/max31875/Kconfig | 2 +- drivers/sensor/max44009/Kconfig | 2 +- drivers/sensor/max6675/Kconfig | 2 +- drivers/sensor/mcp9808/Kconfig | 2 +- drivers/sensor/mpr/Kconfig | 2 +- drivers/sensor/mpu6050/Kconfig | 2 +- drivers/sensor/mpu9250/Kconfig | 2 +- drivers/sensor/ms5607/Kconfig | 3 ++- drivers/sensor/ms5837/Kconfig | 2 +- drivers/sensor/opt3001/Kconfig | 2 +- drivers/sensor/sbs_gauge/Kconfig | 2 +- drivers/sensor/sgp40/Kconfig | 2 +- drivers/sensor/sht3xd/Kconfig | 2 +- drivers/sensor/sht4x/Kconfig | 2 +- drivers/sensor/shtcx/Kconfig | 2 +- drivers/sensor/si7006/Kconfig | 2 +- drivers/sensor/si7055/Kconfig | 2 +- drivers/sensor/si7060/Kconfig | 2 +- drivers/sensor/si7210/Kconfig | 2 +- drivers/sensor/stts751/Kconfig | 2 +- drivers/sensor/sx9500/Kconfig | 2 +- drivers/sensor/th02/Kconfig | 2 +- drivers/sensor/ti_hdc/Kconfig | 2 +- drivers/sensor/ti_hdc20xx/Kconfig | 2 +- drivers/sensor/tmp007/Kconfig | 2 +- drivers/sensor/tmp108/Kconfig | 2 +- drivers/sensor/tmp112/Kconfig | 2 +- drivers/sensor/tmp116/Kconfig | 2 +- drivers/sensor/vcnl4040/Kconfig | 2 +- drivers/sensor/vl53l0x/Kconfig | 2 +- drivers/sensor/wsen_itds/Kconfig | 2 +- 89 files changed, 110 insertions(+), 89 deletions(-) diff --git a/drivers/sensor/adt7420/Kconfig b/drivers/sensor/adt7420/Kconfig index 611ec5faebc..f8dd4add457 100644 --- a/drivers/sensor/adt7420/Kconfig +++ b/drivers/sensor/adt7420/Kconfig @@ -7,7 +7,7 @@ menuconfig ADT7420 bool "ADT7420 Temperature Sensor" default y depends on DT_HAS_ADI_ADT7420_ENABLED - depends on I2C + select I2C help Enable the driver for Analog Devices ADT7420 High-Accuracy 16-bit Digital I2C Temperature Sensors. diff --git a/drivers/sensor/adxl345/Kconfig b/drivers/sensor/adxl345/Kconfig index eebd598e70e..210164269b7 100644 --- a/drivers/sensor/adxl345/Kconfig +++ b/drivers/sensor/adxl345/Kconfig @@ -7,6 +7,7 @@ config ADXL345 bool "ADXL345 Three Axis accelerometer" default y depends on DT_HAS_ADI_ADXL345_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL345),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL345),spi) help Enable driver for ADXL345 Three-Axis Digital Accelerometer. diff --git a/drivers/sensor/adxl362/Kconfig b/drivers/sensor/adxl362/Kconfig index 81ceb36b207..3ab0621bb6a 100644 --- a/drivers/sensor/adxl362/Kconfig +++ b/drivers/sensor/adxl362/Kconfig @@ -7,7 +7,7 @@ menuconfig ADXL362 bool "ADXL362 sensor" default y depends on DT_HAS_ADI_ADXL362_ENABLED - depends on SPI + select SPI help Enable driver for ADXL362 Three-Axis Digital Accelerometers. diff --git a/drivers/sensor/adxl372/Kconfig b/drivers/sensor/adxl372/Kconfig index 00bc1fb1c12..629a9c5e242 100644 --- a/drivers/sensor/adxl372/Kconfig +++ b/drivers/sensor/adxl372/Kconfig @@ -7,7 +7,8 @@ menuconfig ADXL372 bool "ADXL372 Three Axis High-g I2C/SPI accelerometer" default y depends on DT_HAS_ADI_ADXL372_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),spi) help Enable driver for ADXL372 Three-Axis Digital Accelerometers. diff --git a/drivers/sensor/ak8975/Kconfig b/drivers/sensor/ak8975/Kconfig index 88336b55d6e..a6457adddff 100644 --- a/drivers/sensor/ak8975/Kconfig +++ b/drivers/sensor/ak8975/Kconfig @@ -7,6 +7,6 @@ config AK8975 bool "AK8975 Magnetometer" default y depends on DT_HAS_ASAHI_KASEI_AK8975_ENABLED - depends on I2C + select I2C help Enable driver for AK8975 magnetometer. diff --git a/drivers/sensor/amg88xx/Kconfig b/drivers/sensor/amg88xx/Kconfig index 5c6949e144e..0b5ce00b659 100644 --- a/drivers/sensor/amg88xx/Kconfig +++ b/drivers/sensor/amg88xx/Kconfig @@ -7,7 +7,7 @@ menuconfig AMG88XX bool "AMG88XX Infrared Thermopile Sensor" default y depends on DT_HAS_PANASONIC_AMG88XX_ENABLED - depends on I2C + select I2C help Enable driver for AMG88XX infrared thermopile sensor. diff --git a/drivers/sensor/ams_iAQcore/Kconfig b/drivers/sensor/ams_iAQcore/Kconfig index 56ea523436b..153bd0dcd2c 100644 --- a/drivers/sensor/ams_iAQcore/Kconfig +++ b/drivers/sensor/ams_iAQcore/Kconfig @@ -7,7 +7,7 @@ menuconfig AMS_IAQ_CORE bool "iAQ-core Digital VOC sensor" default y depends on DT_HAS_AMS_IAQCORE_ENABLED - depends on I2C + select I2C help Enable driver for iAQ-core Digital VOC sensor. diff --git a/drivers/sensor/apds9960/Kconfig b/drivers/sensor/apds9960/Kconfig index 6f89ad9de7d..9007137a183 100644 --- a/drivers/sensor/apds9960/Kconfig +++ b/drivers/sensor/apds9960/Kconfig @@ -6,7 +6,7 @@ menuconfig APDS9960 bool "APDS9960 Sensor" default y depends on DT_HAS_AVAGO_APDS9960_ENABLED - depends on I2C + select I2C help Enable driver for APDS9960 sensors. diff --git a/drivers/sensor/bma280/Kconfig b/drivers/sensor/bma280/Kconfig index c28dbac820b..5e76c4063b0 100644 --- a/drivers/sensor/bma280/Kconfig +++ b/drivers/sensor/bma280/Kconfig @@ -7,7 +7,7 @@ menuconfig BMA280 bool "BMA280 Three Axis Accelerometer Family" default y depends on DT_HAS_BOSCH_BMA280_ENABLED - depends on I2C + select I2C help Enable driver for BMA280 I2C-based triaxial accelerometer sensor family. diff --git a/drivers/sensor/bmc150_magn/Kconfig b/drivers/sensor/bmc150_magn/Kconfig index 0f9a883ac82..87238677294 100644 --- a/drivers/sensor/bmc150_magn/Kconfig +++ b/drivers/sensor/bmc150_magn/Kconfig @@ -7,7 +7,7 @@ menuconfig BMC150_MAGN bool "BMC150_MAGN I2C Magnetometer Chip" default y depends on DT_HAS_BOSCH_BMC150_MAGN_ENABLED - depends on I2C + select I2C help Enable driver for BMC150 I2C-based magnetometer sensor. diff --git a/drivers/sensor/bme280/Kconfig b/drivers/sensor/bme280/Kconfig index a018af13512..05e42a47359 100644 --- a/drivers/sensor/bme280/Kconfig +++ b/drivers/sensor/bme280/Kconfig @@ -8,7 +8,8 @@ menuconfig BME280 bool "BME280/BMP280 sensor" default y depends on DT_HAS_BOSCH_BME280_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BME280),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BME280),spi) help Enable driver for BME280 I2C-based or SPI-based temperature and pressure sensor. diff --git a/drivers/sensor/bme680/Kconfig b/drivers/sensor/bme680/Kconfig index bc4d747033c..6f3343dc86f 100644 --- a/drivers/sensor/bme680/Kconfig +++ b/drivers/sensor/bme680/Kconfig @@ -9,7 +9,8 @@ menuconfig BME680 bool "BME680 sensor" default y depends on DT_HAS_BOSCH_BME680_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BME680),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BME680),spi) help Enable driver for BME680 I2C- or SPI- based temperature, pressure, humidity and gas sensor. diff --git a/drivers/sensor/bmg160/Kconfig b/drivers/sensor/bmg160/Kconfig index 23116d260a5..108d2021e70 100644 --- a/drivers/sensor/bmg160/Kconfig +++ b/drivers/sensor/bmg160/Kconfig @@ -7,7 +7,7 @@ menuconfig BMG160 bool "Bosch BMG160 gyroscope support" default y depends on DT_HAS_BOSCH_BMG160_ENABLED - depends on I2C + select I2C help Enable Bosch BMG160 gyroscope support. diff --git a/drivers/sensor/bmi160/Kconfig b/drivers/sensor/bmi160/Kconfig index 3c23e7e141f..29ee0c1423f 100644 --- a/drivers/sensor/bmi160/Kconfig +++ b/drivers/sensor/bmi160/Kconfig @@ -7,7 +7,8 @@ menuconfig BMI160 bool "Bosch BMI160 inertial measurement unit" default y depends on DT_HAS_BOSCH_BMI160_ENABLED - depends on SPI || I2C + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI160),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI160),spi) help Enable Bosch BMI160 inertial measurement unit that provides acceleration and angular rate measurements. diff --git a/drivers/sensor/bmi270/Kconfig b/drivers/sensor/bmi270/Kconfig index 10c0da5883a..90bbe131b8b 100644 --- a/drivers/sensor/bmi270/Kconfig +++ b/drivers/sensor/bmi270/Kconfig @@ -7,6 +7,6 @@ config BMI270 bool "BMI270 Inertial measurement unit" default y depends on DT_HAS_BOSCH_BMI270_ENABLED - depends on I2C + select I2C help Enable driver for BMI270 I2C-based imu sensor diff --git a/drivers/sensor/bmm150/Kconfig b/drivers/sensor/bmm150/Kconfig index 9a0bb2df3ad..54cf97456d3 100644 --- a/drivers/sensor/bmm150/Kconfig +++ b/drivers/sensor/bmm150/Kconfig @@ -7,7 +7,7 @@ menuconfig BMM150 bool "BMM150 I2C Geomagnetic Chip" default y depends on DT_HAS_BOSCH_BMM150_ENABLED - depends on I2C + select I2C help Enable driver for BMM150 I2C-based Geomagnetic sensor. if BMM150 diff --git a/drivers/sensor/bmp388/Kconfig b/drivers/sensor/bmp388/Kconfig index 9d860d88848..3f46b196c40 100644 --- a/drivers/sensor/bmp388/Kconfig +++ b/drivers/sensor/bmp388/Kconfig @@ -5,7 +5,8 @@ menuconfig BMP388 bool "Bosch BMP388 pressure sensor" default y depends on DT_HAS_BOSCH_BMP388_ENABLED - depends on SPI || I2C + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMP388),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMP388),spi) help Enable driver for the Bosch BMP388 pressure sensor diff --git a/drivers/sensor/bq274xx/Kconfig b/drivers/sensor/bq274xx/Kconfig index 58a176d593a..6b7ad66b0e6 100644 --- a/drivers/sensor/bq274xx/Kconfig +++ b/drivers/sensor/bq274xx/Kconfig @@ -6,6 +6,6 @@ config BQ274XX bool "BQ274xx Fuel Gauge" default y depends on DT_HAS_TI_BQ274XX_ENABLED - depends on I2C + select I2C help Enable I2C-based driver for BQ274xx Fuel Gauge. diff --git a/drivers/sensor/ccs811/Kconfig b/drivers/sensor/ccs811/Kconfig index c364c900a7c..5a660805fa2 100644 --- a/drivers/sensor/ccs811/Kconfig +++ b/drivers/sensor/ccs811/Kconfig @@ -9,7 +9,7 @@ menuconfig CCS811 bool "CCS811 Digital Gas Sensor" default y depends on DT_HAS_AMS_CCS811_ENABLED - depends on I2C + select I2C help Enable driver for CCS811 Gas sensors. diff --git a/drivers/sensor/dps310/Kconfig b/drivers/sensor/dps310/Kconfig index 95452979b76..878d8f28bc8 100644 --- a/drivers/sensor/dps310/Kconfig +++ b/drivers/sensor/dps310/Kconfig @@ -7,7 +7,7 @@ menuconfig DPS310 bool "DPS310 sensor" default y depends on DT_HAS_INFINEON_DPS310_ENABLED - depends on I2C + select I2C help Enable driver for DPS310 I2C-based temperature and pressure sensor. diff --git a/drivers/sensor/ens210/Kconfig b/drivers/sensor/ens210/Kconfig index 1627a5cc6c9..5287f88ad10 100644 --- a/drivers/sensor/ens210/Kconfig +++ b/drivers/sensor/ens210/Kconfig @@ -7,7 +7,7 @@ menuconfig ENS210 bool "ENS210 Digital Temperature and Humidity sensor" default y depends on DT_HAS_AMS_ENS210_ENABLED - depends on I2C + select I2C help Enable driver for ENS210 Digital Temperature and Humidity sensor. if ENS210 diff --git a/drivers/sensor/fdc2x1x/Kconfig b/drivers/sensor/fdc2x1x/Kconfig index c952d313c07..33894acb17f 100644 --- a/drivers/sensor/fdc2x1x/Kconfig +++ b/drivers/sensor/fdc2x1x/Kconfig @@ -7,7 +7,8 @@ menuconfig FDC2X1X bool "FDC2X1X Capacitance-to-Digital Converter" default y depends on DT_HAS_TI_FDC2X1X_ENABLED - depends on I2C && NEWLIB_LIBC + depends on NEWLIB_LIBC + select I2C help Enable driver for FDC2X1X Capacitance-to-Digital Converter. diff --git a/drivers/sensor/fxas21002/Kconfig b/drivers/sensor/fxas21002/Kconfig index 421c6ecc50b..591de55510c 100644 --- a/drivers/sensor/fxas21002/Kconfig +++ b/drivers/sensor/fxas21002/Kconfig @@ -7,7 +7,7 @@ menuconfig FXAS21002 bool "FXAS21002 gyroscope driver" default y depends on DT_HAS_NXP_FXAS21002_ENABLED - depends on I2C + select I2C help Enable driver for the FXAS21002 gyroscope diff --git a/drivers/sensor/fxos8700/Kconfig b/drivers/sensor/fxos8700/Kconfig index 9504b96a8f5..9fcd7b1a871 100644 --- a/drivers/sensor/fxos8700/Kconfig +++ b/drivers/sensor/fxos8700/Kconfig @@ -7,7 +7,7 @@ menuconfig FXOS8700 bool "FXOS8700 accelerometer/magnetometer driver" default y depends on DT_HAS_NXP_FXOS8700_ENABLED - depends on I2C + select I2C help Enable driver for the FXOS8700 accelerometer/magnetometer. The driver also supports MMA8451Q, MMA8652FC and MMA8653FC diff --git a/drivers/sensor/hmc5883l/Kconfig b/drivers/sensor/hmc5883l/Kconfig index 61196f097b6..3218336bb8c 100644 --- a/drivers/sensor/hmc5883l/Kconfig +++ b/drivers/sensor/hmc5883l/Kconfig @@ -5,7 +5,7 @@ menuconfig HMC5883L bool "HMC5883L magnetometer" default y depends on DT_HAS_HONEYWELL_HMC5883L_ENABLED - depends on I2C + select I2C help Enable driver for HMC5883L I2C-based magnetometer. diff --git a/drivers/sensor/hp206c/Kconfig b/drivers/sensor/hp206c/Kconfig index cb1fe8f6f1b..b646c14bd60 100644 --- a/drivers/sensor/hp206c/Kconfig +++ b/drivers/sensor/hp206c/Kconfig @@ -8,7 +8,7 @@ menuconfig HP206C bool "HopeRF HP206C precision barometer and altimeter sensor" default y depends on DT_HAS_HOPERF_HP206C_ENABLED - depends on I2C + select I2C help Enable HopeRF HP206C barometer and altimeter support. diff --git a/drivers/sensor/hts221/Kconfig b/drivers/sensor/hts221/Kconfig index 2ad1873780a..5c3ff69273a 100644 --- a/drivers/sensor/hts221/Kconfig +++ b/drivers/sensor/hts221/Kconfig @@ -5,7 +5,8 @@ menuconfig HTS221 bool "HTS221 temperature and humidity sensor" default y depends on DT_HAS_ST_HTS221_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_HTS221),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_HTS221),spi) select HAS_STMEMSC select USE_STDC_HTS221 help diff --git a/drivers/sensor/i3g4250d/Kconfig b/drivers/sensor/i3g4250d/Kconfig index 60b70d2ed54..4a9d5b80fd6 100644 --- a/drivers/sensor/i3g4250d/Kconfig +++ b/drivers/sensor/i3g4250d/Kconfig @@ -7,7 +7,7 @@ config I3G4250D bool "I3G4250D three-axis digital output gyroscope" default y depends on DT_HAS_ST_I3G4250D_ENABLED - depends on SPI + select SPI select HAS_STMEMSC select USE_STDC_I3G4250D help diff --git a/drivers/sensor/icm42605/Kconfig b/drivers/sensor/icm42605/Kconfig index 7b9f9a699a3..961967de8c5 100644 --- a/drivers/sensor/icm42605/Kconfig +++ b/drivers/sensor/icm42605/Kconfig @@ -7,7 +7,7 @@ menuconfig ICM42605 bool "ICM42605 Six-Axis Motion Tracking Device" default y depends on DT_HAS_INVENSENSE_ICM42605_ENABLED - depends on SPI + select SPI help Enable driver for ICM42605 SPI-based six-axis motion tracking device. diff --git a/drivers/sensor/icm42670/Kconfig b/drivers/sensor/icm42670/Kconfig index 25d9a5d9104..7548f5ed6a6 100644 --- a/drivers/sensor/icm42670/Kconfig +++ b/drivers/sensor/icm42670/Kconfig @@ -9,7 +9,7 @@ menuconfig ICM42670 bool "ICM42670 Six-Axis Motion Tracking Device" default y depends on DT_HAS_INVENSENSE_ICM42670_ENABLED - depends on SPI + select SPI help Enable driver for ICM42670 SPI-based six-axis motion tracking device. diff --git a/drivers/sensor/iis2dh/Kconfig b/drivers/sensor/iis2dh/Kconfig index 237cdc1fe99..5067b283ead 100644 --- a/drivers/sensor/iis2dh/Kconfig +++ b/drivers/sensor/iis2dh/Kconfig @@ -7,7 +7,8 @@ menuconfig IIS2DH bool "IIS2DH I2C/SPI accelerometer sensor driver" default y depends on DT_HAS_ST_IIS2DH_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DH),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DH),spi) select HAS_STMEMSC select USE_STDC_IIS2DH help diff --git a/drivers/sensor/iis2dlpc/Kconfig b/drivers/sensor/iis2dlpc/Kconfig index f60ba3ec770..d1dc0e5881a 100644 --- a/drivers/sensor/iis2dlpc/Kconfig +++ b/drivers/sensor/iis2dlpc/Kconfig @@ -7,7 +7,8 @@ menuconfig IIS2DLPC bool "IIS2DLPC I2C/SPI accelerometer sensor driver" default y depends on DT_HAS_ST_IIS2DLPC_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DLPC),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DLPC),spi) select HAS_STMEMSC select USE_STDC_IIS2DLPC help diff --git a/drivers/sensor/iis2iclx/Kconfig b/drivers/sensor/iis2iclx/Kconfig index fe6326d8aec..030fc0bbd96 100644 --- a/drivers/sensor/iis2iclx/Kconfig +++ b/drivers/sensor/iis2iclx/Kconfig @@ -7,7 +7,8 @@ menuconfig IIS2ICLX bool "IIS2ICLX I2C/SPI accelerometer Chip" default y depends on DT_HAS_ST_IIS2ICLX_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2ICLX),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2ICLX),spi) select HAS_STMEMSC select USE_STDC_IIS2ICLX help diff --git a/drivers/sensor/iis2mdc/Kconfig b/drivers/sensor/iis2mdc/Kconfig index 7e9f17c230a..2215c778c28 100644 --- a/drivers/sensor/iis2mdc/Kconfig +++ b/drivers/sensor/iis2mdc/Kconfig @@ -5,7 +5,8 @@ menuconfig IIS2MDC bool "IIS2MDC Magnetometer" default y depends on DT_HAS_ST_IIS2MDC_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2MDC),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2MDC),spi) select HAS_STMEMSC select USE_STDC_IIS2MDC help diff --git a/drivers/sensor/iis3dhhc/Kconfig b/drivers/sensor/iis3dhhc/Kconfig index be3e33506d8..ecd112aa928 100644 --- a/drivers/sensor/iis3dhhc/Kconfig +++ b/drivers/sensor/iis3dhhc/Kconfig @@ -7,7 +7,7 @@ menuconfig IIS3DHHC bool "IIS3DHHC accelerometer sensor" default y depends on DT_HAS_ST_IIS3DHHC_ENABLED - depends on SPI + select SPI select HAS_STMEMSC select USE_STDC_IIS3DHHC help diff --git a/drivers/sensor/ina219/Kconfig b/drivers/sensor/ina219/Kconfig index 0c6b44e2dff..ce3f755c21e 100644 --- a/drivers/sensor/ina219/Kconfig +++ b/drivers/sensor/ina219/Kconfig @@ -7,6 +7,6 @@ config INA219 bool "INA219 Current/Power Monitor" default y depends on DT_HAS_TI_INA219_ENABLED - depends on I2C + select I2C help Enable driver for INA219 Bidirectional Current/Power Monitor. diff --git a/drivers/sensor/ina23x/Kconfig b/drivers/sensor/ina23x/Kconfig index 2cfa19fc3c5..5624620b63d 100644 --- a/drivers/sensor/ina23x/Kconfig +++ b/drivers/sensor/ina23x/Kconfig @@ -6,7 +6,7 @@ config INA23X bool "INA23X Current and Power Monitor" default y depends on DT_HAS_TI_INA230_ENABLED || DT_HAS_TI_INA237_ENABLED - depends on I2C + select I2C help Enable driver for INA23X Current and Power Monitor. diff --git a/drivers/sensor/isl29035/Kconfig b/drivers/sensor/isl29035/Kconfig index fec6a4eb426..36ff481302b 100644 --- a/drivers/sensor/isl29035/Kconfig +++ b/drivers/sensor/isl29035/Kconfig @@ -7,7 +7,7 @@ menuconfig ISL29035 bool "ISL29035 light sensor" default y depends on DT_HAS_ISIL_ISL29035_ENABLED - depends on I2C + select I2C help Enable driver for the ISL29035 light sensor. diff --git a/drivers/sensor/ism330dhcx/Kconfig b/drivers/sensor/ism330dhcx/Kconfig index baa995753d5..75eb6d9fec9 100644 --- a/drivers/sensor/ism330dhcx/Kconfig +++ b/drivers/sensor/ism330dhcx/Kconfig @@ -7,7 +7,8 @@ menuconfig ISM330DHCX bool "ISM330DHCX I2C/SPI accelerometer and gyroscope Chip" default y depends on DT_HAS_ST_ISM330DHCX_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_ISM330DHCX),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_ISM330DHCX),spi) select HAS_STMEMSC select USE_STDC_ISM330DHCX help diff --git a/drivers/sensor/lis2dh/Kconfig b/drivers/sensor/lis2dh/Kconfig index adfa62e323d..4edc22cfb19 100644 --- a/drivers/sensor/lis2dh/Kconfig +++ b/drivers/sensor/lis2dh/Kconfig @@ -7,7 +7,8 @@ menuconfig LIS2DH bool "LIS2DH Three Axis Accelerometer" default y depends on DT_HAS_ST_LIS2DH_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DH),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DH),spi) help Enable SPI/I2C-based driver for LIS2DH, LIS3DH, LSM303DLHC, LIS2DH12, LSM303AGR triaxial accelerometer sensors. diff --git a/drivers/sensor/lis2ds12/Kconfig b/drivers/sensor/lis2ds12/Kconfig index d3a8b427943..14b063bd8ec 100644 --- a/drivers/sensor/lis2ds12/Kconfig +++ b/drivers/sensor/lis2ds12/Kconfig @@ -7,7 +7,8 @@ menuconfig LIS2DS12 bool "LIS2DS12 I2C/SPI accelerometer sensor driver" default y depends on DT_HAS_ST_LIS2DS12_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DS12),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DS12),spi) select HAS_STMEMSC select USE_STDC_LIS2DS12 help diff --git a/drivers/sensor/lis2dw12/Kconfig b/drivers/sensor/lis2dw12/Kconfig index df31fb92fcd..85fc6feb711 100644 --- a/drivers/sensor/lis2dw12/Kconfig +++ b/drivers/sensor/lis2dw12/Kconfig @@ -7,7 +7,8 @@ menuconfig LIS2DW12 bool "LIS2DW12 I2C/SPI accelerometer sensor driver" default y depends on DT_HAS_ST_LIS2DW12_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DW12),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DW12),spi) select HAS_STMEMSC select USE_STDC_LIS2DW12 help diff --git a/drivers/sensor/lis2mdl/Kconfig b/drivers/sensor/lis2mdl/Kconfig index 24aa28fa9c8..6970a60555d 100644 --- a/drivers/sensor/lis2mdl/Kconfig +++ b/drivers/sensor/lis2mdl/Kconfig @@ -5,7 +5,8 @@ menuconfig LIS2MDL bool "LIS2MDL Magnetometer" default y depends on DT_HAS_ST_LIS2MDL_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2MDL),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2MDL),spi) select HAS_STMEMSC select USE_STDC_LIS2MDL help diff --git a/drivers/sensor/lis3mdl/Kconfig b/drivers/sensor/lis3mdl/Kconfig index 47e1f2eb168..e7f504b33bc 100644 --- a/drivers/sensor/lis3mdl/Kconfig +++ b/drivers/sensor/lis3mdl/Kconfig @@ -5,7 +5,7 @@ menuconfig LIS3MDL bool "LIS3MDL magnetometer" default y depends on DT_HAS_ST_LIS3MDL_MAGN_ENABLED - depends on I2C + select I2C help Enable driver for LIS3MDL I2C-based magnetometer. diff --git a/drivers/sensor/lm75/Kconfig b/drivers/sensor/lm75/Kconfig index d362cd17ca7..9dd6425c9c0 100644 --- a/drivers/sensor/lm75/Kconfig +++ b/drivers/sensor/lm75/Kconfig @@ -7,7 +7,7 @@ config LM75 bool "LM75 Temperature Sensor" default y depends on DT_HAS_LM75_ENABLED - depends on I2C + select I2C help Enable the driver for the LM75 digital temperature Sensor with 2-wire interface. Thermal Watchdog is not implemented diff --git a/drivers/sensor/lm77/Kconfig b/drivers/sensor/lm77/Kconfig index 5e11ba512ed..554fe00cdc3 100644 --- a/drivers/sensor/lm77/Kconfig +++ b/drivers/sensor/lm77/Kconfig @@ -8,7 +8,7 @@ menuconfig LM77 default y depends on DT_HAS_LM77_ENABLED default $(dt_compat_enabled,lm77) - depends on I2C + select I2C help Enable driver for the LM77 digital temperature sensor with 2-wire interface. diff --git a/drivers/sensor/lps22hb/Kconfig b/drivers/sensor/lps22hb/Kconfig index 55d6aba57ba..2ac1dc4ddd5 100644 --- a/drivers/sensor/lps22hb/Kconfig +++ b/drivers/sensor/lps22hb/Kconfig @@ -5,7 +5,7 @@ menuconfig LPS22HB bool "LPS22HB pressure and temperature" default y depends on DT_HAS_ST_LPS22HB_PRESS_ENABLED - depends on I2C + select I2C help Enable driver for LPS22HB I2C-based pressure and temperature sensor. diff --git a/drivers/sensor/lps22hh/Kconfig b/drivers/sensor/lps22hh/Kconfig index b5b3fc5e9ec..79f29a5212c 100644 --- a/drivers/sensor/lps22hh/Kconfig +++ b/drivers/sensor/lps22hh/Kconfig @@ -7,7 +7,8 @@ menuconfig LPS22HH bool "LPS22HH pressure and temperature" default y depends on DT_HAS_ST_LPS22HH_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LPS22HH),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LPS22HH),spi) select HAS_STMEMSC select USE_STDC_LPS22HH help diff --git a/drivers/sensor/lps25hb/Kconfig b/drivers/sensor/lps25hb/Kconfig index 5c66ec50efd..696e599382f 100644 --- a/drivers/sensor/lps25hb/Kconfig +++ b/drivers/sensor/lps25hb/Kconfig @@ -5,7 +5,7 @@ menuconfig LPS25HB bool "LPS25HB pressure and temperature" default y depends on DT_HAS_ST_LPS25HB_PRESS_ENABLED - depends on I2C + select I2C help Enable driver for LPS25HB I2C-based pressure and temperature sensor. diff --git a/drivers/sensor/lsm303dlhc_magn/Kconfig b/drivers/sensor/lsm303dlhc_magn/Kconfig index c522dac9861..ad7071ea8db 100644 --- a/drivers/sensor/lsm303dlhc_magn/Kconfig +++ b/drivers/sensor/lsm303dlhc_magn/Kconfig @@ -7,7 +7,7 @@ menuconfig LSM303DLHC_MAGN bool "LSM303DLHC Three Axis Magnetometer" default y depends on DT_HAS_ST_LSM303DLHC_MAGN_ENABLED - depends on I2C + select I2C help Enable driver for LSM303DLHC I2C-based triaxial magnetometer sensor. diff --git a/drivers/sensor/lsm6ds0/Kconfig b/drivers/sensor/lsm6ds0/Kconfig index d282b1de07e..80d81e1884b 100644 --- a/drivers/sensor/lsm6ds0/Kconfig +++ b/drivers/sensor/lsm6ds0/Kconfig @@ -8,7 +8,7 @@ menuconfig LSM6DS0 bool "LSM6DS0 I2C accelerometer and gyroscope Chip" default y depends on DT_HAS_ST_LSM6DS0_ENABLED - depends on I2C + select I2C help Enable driver for LSM6DS0 I2C-based accelerometer and gyroscope sensor. diff --git a/drivers/sensor/lsm6dsl/Kconfig b/drivers/sensor/lsm6dsl/Kconfig index 0f726143680..f3be1d335f2 100644 --- a/drivers/sensor/lsm6dsl/Kconfig +++ b/drivers/sensor/lsm6dsl/Kconfig @@ -8,7 +8,8 @@ menuconfig LSM6DSL bool "LSM6DSL I2C/SPI accelerometer and gyroscope Chip" default y depends on DT_HAS_ST_LSM6DSL_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSL),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSL),spi) help Enable driver for LSM6DSL accelerometer and gyroscope sensor. diff --git a/drivers/sensor/lsm6dso/Kconfig b/drivers/sensor/lsm6dso/Kconfig index 75684af0357..f1948a9769e 100644 --- a/drivers/sensor/lsm6dso/Kconfig +++ b/drivers/sensor/lsm6dso/Kconfig @@ -7,7 +7,8 @@ menuconfig LSM6DSO bool "LSM6DSO I2C/SPI accelerometer and gyroscope Chip" default y depends on DT_HAS_ST_LSM6DSO_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSO),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSO),spi) select HAS_STMEMSC select USE_STDC_LSM6DSO help diff --git a/drivers/sensor/lsm9ds0_gyro/Kconfig b/drivers/sensor/lsm9ds0_gyro/Kconfig index 10ab69531f3..46d2d931ab7 100644 --- a/drivers/sensor/lsm9ds0_gyro/Kconfig +++ b/drivers/sensor/lsm9ds0_gyro/Kconfig @@ -7,7 +7,7 @@ menuconfig LSM9DS0_GYRO bool "LSM9DS0 I2C gyroscope Chip" default y depends on DT_HAS_ST_LSM9DS0_GYRO_ENABLED - depends on I2C + select I2C help Enable driver for LSM9DS0 I2C-based gyroscope sensor. diff --git a/drivers/sensor/lsm9ds0_mfd/Kconfig b/drivers/sensor/lsm9ds0_mfd/Kconfig index 0205cdfe87c..173a970d845 100644 --- a/drivers/sensor/lsm9ds0_mfd/Kconfig +++ b/drivers/sensor/lsm9ds0_mfd/Kconfig @@ -7,7 +7,7 @@ menuconfig LSM9DS0_MFD bool "LSM9DS0 I2C accelerometer, magnetometer and temperature sensor chip" default y depends on DT_HAS_ST_LSM9DS0_MFD_ENABLED - depends on I2C + select I2C help Enable driver for LSM9DS0 I2C-based MFD sensor. diff --git a/drivers/sensor/max17055/Kconfig b/drivers/sensor/max17055/Kconfig index 415ebf1c245..9d91029340a 100644 --- a/drivers/sensor/max17055/Kconfig +++ b/drivers/sensor/max17055/Kconfig @@ -6,7 +6,7 @@ config MAX17055 bool "MAX17055 Fuel Gauge" default y depends on DT_HAS_MAXIM_MAX17055_ENABLED - depends on I2C + select I2C help Enable I2C-based driver for MAX17055 Fuel Gauge. This driver supports reading various sensor settings including charge level percentage, diff --git a/drivers/sensor/max17262/Kconfig b/drivers/sensor/max17262/Kconfig index 4457fd0e932..b3bdeb180c0 100644 --- a/drivers/sensor/max17262/Kconfig +++ b/drivers/sensor/max17262/Kconfig @@ -6,7 +6,7 @@ config MAX17262 bool "MAX17262 Fuel Gauge" default y depends on DT_HAS_MAXIM_MAX17262_ENABLED - depends on I2C + select I2C help Enable I2C-based driver for MAX17262 Fuel Gauge. This driver supports reading various sensor settings including voltage, current, temperature, diff --git a/drivers/sensor/max30101/Kconfig b/drivers/sensor/max30101/Kconfig index 8a5b73106e2..725460e58c3 100644 --- a/drivers/sensor/max30101/Kconfig +++ b/drivers/sensor/max30101/Kconfig @@ -7,7 +7,7 @@ menuconfig MAX30101 bool "MAX30101 Pulse Oximeter and Heart Rate Sensor" default y depends on DT_HAS_MAXIM_MAX30101_ENABLED - depends on I2C + select I2C if MAX30101 diff --git a/drivers/sensor/max31875/Kconfig b/drivers/sensor/max31875/Kconfig index 8c712afc755..15b39de8c1b 100644 --- a/drivers/sensor/max31875/Kconfig +++ b/drivers/sensor/max31875/Kconfig @@ -7,6 +7,6 @@ config MAX31875 bool "MAX31875 Temperature Sensor" default y depends on DT_HAS_MAXIM_MAX31875_ENABLED - depends on I2C + select I2C help Enable the driver for Maxim MAX31875 Low-Power I2C Temperature Sensors. diff --git a/drivers/sensor/max44009/Kconfig b/drivers/sensor/max44009/Kconfig index d9efe897647..a06b99e295a 100644 --- a/drivers/sensor/max44009/Kconfig +++ b/drivers/sensor/max44009/Kconfig @@ -7,6 +7,6 @@ config MAX44009 bool "MAX44009 Light Sensor" default y depends on DT_HAS_MAXIM_MAX44009_ENABLED - depends on I2C + select I2C help Enable driver for MAX44009 light sensors. diff --git a/drivers/sensor/max6675/Kconfig b/drivers/sensor/max6675/Kconfig index 3c53dde2b48..d091a43dc1e 100644 --- a/drivers/sensor/max6675/Kconfig +++ b/drivers/sensor/max6675/Kconfig @@ -5,7 +5,7 @@ config MAX6675 bool "MAX6675 K-thermocouple to digital converter" default y depends on DT_HAS_MAXIM_MAX6675_ENABLED - depends on SPI + select SPI help Enable MAX6675 cold-junction-compensated K-thermocouple to digital converter. diff --git a/drivers/sensor/mcp9808/Kconfig b/drivers/sensor/mcp9808/Kconfig index 1a1ce4aeaaf..c487dd0b160 100644 --- a/drivers/sensor/mcp9808/Kconfig +++ b/drivers/sensor/mcp9808/Kconfig @@ -7,7 +7,7 @@ menuconfig MCP9808 bool "MCP9808 temperature sensor" default y depends on DT_HAS_MICROCHIP_MCP9808_ENABLED - depends on I2C + select I2C help Enable driver for MCP9808 temperature sensor. diff --git a/drivers/sensor/mpr/Kconfig b/drivers/sensor/mpr/Kconfig index 239247d3327..6ff57c2b651 100644 --- a/drivers/sensor/mpr/Kconfig +++ b/drivers/sensor/mpr/Kconfig @@ -7,7 +7,7 @@ menuconfig MPR bool "MPR pressure sensor" default y depends on DT_HAS_HONEYWELL_MPR_ENABLED - depends on I2C + select I2C help Enable driver for MPR pressure sensor. diff --git a/drivers/sensor/mpu6050/Kconfig b/drivers/sensor/mpu6050/Kconfig index b2b29eb0b31..8fc3aec67ec 100644 --- a/drivers/sensor/mpu6050/Kconfig +++ b/drivers/sensor/mpu6050/Kconfig @@ -7,7 +7,7 @@ menuconfig MPU6050 bool "MPU6050 Six-Axis Motion Tracking Device" default y depends on DT_HAS_INVENSENSE_MPU6050_ENABLED - depends on I2C + select I2C help Enable driver for MPU6050 I2C-based six-axis motion tracking device. diff --git a/drivers/sensor/mpu9250/Kconfig b/drivers/sensor/mpu9250/Kconfig index 7a4c3172374..a7cf942bed1 100644 --- a/drivers/sensor/mpu9250/Kconfig +++ b/drivers/sensor/mpu9250/Kconfig @@ -7,7 +7,7 @@ menuconfig MPU9250 bool "MPU9250 Nine-Axis Motion Tracking Device" default y depends on DT_HAS_INVENSENSE_MPU9250_ENABLED - depends on I2C + select I2C help Enable driver for MPU9250 I2C-based nine-axis motion tracking device. diff --git a/drivers/sensor/ms5607/Kconfig b/drivers/sensor/ms5607/Kconfig index a4e328de821..b467d7af05f 100644 --- a/drivers/sensor/ms5607/Kconfig +++ b/drivers/sensor/ms5607/Kconfig @@ -7,7 +7,8 @@ menuconfig MS5607 bool "MS5607 pressure and temperature sensor" default y depends on DT_HAS_MEAS_MS5607_ENABLED - depends on I2C || SPI + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_MEAS_MS5607),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_MEAS_MS5607),spi) help Enable driver for MS5607 pressure and temperature sensor. diff --git a/drivers/sensor/ms5837/Kconfig b/drivers/sensor/ms5837/Kconfig index 730be670158..d758d5970a0 100644 --- a/drivers/sensor/ms5837/Kconfig +++ b/drivers/sensor/ms5837/Kconfig @@ -7,6 +7,6 @@ config MS5837 bool "MS5837 pressure and temperature sensor" default y depends on DT_HAS_MEAS_MS5837_ENABLED - depends on I2C + select I2C help Enable driver for MS5837 pressure and temperature sensor. diff --git a/drivers/sensor/opt3001/Kconfig b/drivers/sensor/opt3001/Kconfig index ca8523b6c08..6151eb24b55 100644 --- a/drivers/sensor/opt3001/Kconfig +++ b/drivers/sensor/opt3001/Kconfig @@ -7,6 +7,6 @@ config OPT3001 bool "OPT3001 Light Sensor" default y depends on DT_HAS_TI_OPT3001_ENABLED - depends on I2C + select I2C help Enable driver for OPT3001 light sensors. diff --git a/drivers/sensor/sbs_gauge/Kconfig b/drivers/sensor/sbs_gauge/Kconfig index 097ae9ada4e..51d4bed6f70 100644 --- a/drivers/sensor/sbs_gauge/Kconfig +++ b/drivers/sensor/sbs_gauge/Kconfig @@ -5,6 +5,6 @@ config SBS_GAUGE bool "Smart Battery Fuel Gauge" default y depends on DT_HAS_SBS_SBS_GAUGE_ENABLED - depends on I2C + select I2C help Enable I2C-based/SMBus-based driver for a Smart Battery Fuel Gauge. diff --git a/drivers/sensor/sgp40/Kconfig b/drivers/sensor/sgp40/Kconfig index b0dfb14bb0b..2ec50212430 100644 --- a/drivers/sensor/sgp40/Kconfig +++ b/drivers/sensor/sgp40/Kconfig @@ -7,6 +7,6 @@ config SGP40 bool "SGP40 Multipixel Gas Sensor" default y depends on DT_HAS_SENSIRION_SGP40_ENABLED - depends on I2C + select I2C help Enable driver for SGP40 Multipixel Gas Sensor. diff --git a/drivers/sensor/sht3xd/Kconfig b/drivers/sensor/sht3xd/Kconfig index 8019ebcd672..7bb04f2f9fa 100644 --- a/drivers/sensor/sht3xd/Kconfig +++ b/drivers/sensor/sht3xd/Kconfig @@ -7,7 +7,7 @@ menuconfig SHT3XD bool "SHT3xD Temperature and Humidity Sensor" default y depends on DT_HAS_SENSIRION_SHT3XD_ENABLED - depends on I2C + select I2C help Enable driver for SHT3xD temperature and humidity sensors. diff --git a/drivers/sensor/sht4x/Kconfig b/drivers/sensor/sht4x/Kconfig index 382604f5658..f906a7bab77 100644 --- a/drivers/sensor/sht4x/Kconfig +++ b/drivers/sensor/sht4x/Kconfig @@ -7,6 +7,6 @@ config SHT4X bool "SHT4x Temperature and Humidity Sensor" default y depends on DT_HAS_SENSIRION_SHT4X_ENABLED - depends on I2C + select I2C help Enable driver for SHT4x temperature and humidity sensors. diff --git a/drivers/sensor/shtcx/Kconfig b/drivers/sensor/shtcx/Kconfig index 8ba81bebbb8..826f740fc6c 100644 --- a/drivers/sensor/shtcx/Kconfig +++ b/drivers/sensor/shtcx/Kconfig @@ -7,6 +7,6 @@ config SHTCX bool "SHTCX: SHTC1 and SHTC3 Temperature and Humidity Sensor" default y depends on DT_HAS_SENSIRION_SHTCX_ENABLED - depends on I2C + select I2C help Enable driver for SHTC1 and SHTC3 temperature and humidity sensors. diff --git a/drivers/sensor/si7006/Kconfig b/drivers/sensor/si7006/Kconfig index f286f9e93e0..c45914c4364 100644 --- a/drivers/sensor/si7006/Kconfig +++ b/drivers/sensor/si7006/Kconfig @@ -5,6 +5,6 @@ config SI7006 bool "Si7006 Temperature and Humidity Sensor" default y depends on DT_HAS_SILABS_SI7006_ENABLED - depends on I2C + select I2C help Enable I2C-based driver for Si7006 Temperature and Humidity Sensor. diff --git a/drivers/sensor/si7055/Kconfig b/drivers/sensor/si7055/Kconfig index 7d26eb4fc48..caec6e4505c 100644 --- a/drivers/sensor/si7055/Kconfig +++ b/drivers/sensor/si7055/Kconfig @@ -6,7 +6,7 @@ menuconfig SI7055 bool "Si7055 Temperature Sensor" default y depends on DT_HAS_SILABS_SI7055_ENABLED - depends on I2C + select I2C help Enable I2C-based driver for Si7055 Temperature Sensor. diff --git a/drivers/sensor/si7060/Kconfig b/drivers/sensor/si7060/Kconfig index ce42d08400f..d7b7cf4507f 100644 --- a/drivers/sensor/si7060/Kconfig +++ b/drivers/sensor/si7060/Kconfig @@ -7,6 +7,6 @@ config SI7060 bool "SI7060 Temperature Sensor" default y depends on DT_HAS_SILABS_SI7060_ENABLED - depends on I2C + select I2C help Enable driver for SI7060 temperature sensors. diff --git a/drivers/sensor/si7210/Kconfig b/drivers/sensor/si7210/Kconfig index 7fc47cbfa58..ea60036e50d 100644 --- a/drivers/sensor/si7210/Kconfig +++ b/drivers/sensor/si7210/Kconfig @@ -6,6 +6,6 @@ config SI7210 bool "Si7210 Hall Effect Magnetic Position and Temperature Sensor" default y depends on DT_HAS_SILABS_SI7210_ENABLED - depends on I2C + select I2C help Enable driver for Si7210 Hall Effect Magnetic Position and Temperature Sensor. diff --git a/drivers/sensor/stts751/Kconfig b/drivers/sensor/stts751/Kconfig index 0f9cb502b75..d048e117e10 100644 --- a/drivers/sensor/stts751/Kconfig +++ b/drivers/sensor/stts751/Kconfig @@ -7,7 +7,7 @@ menuconfig STTS751 bool "STTS751 temperature sensor" default y depends on DT_HAS_ST_STTS751_ENABLED - depends on I2C + select I2C select HAS_STMEMSC select USE_STDC_STTS751 help diff --git a/drivers/sensor/sx9500/Kconfig b/drivers/sensor/sx9500/Kconfig index 044742ee6ef..2e1363a58e0 100644 --- a/drivers/sensor/sx9500/Kconfig +++ b/drivers/sensor/sx9500/Kconfig @@ -7,7 +7,7 @@ menuconfig SX9500 bool "SX9500 I2C SAR Proximity Chip" default y depends on DT_HAS_SEMTECH_SX9500_ENABLED - depends on I2C + select I2C help Enable driver for SX9500 I2C-based SAR proximity sensor. diff --git a/drivers/sensor/th02/Kconfig b/drivers/sensor/th02/Kconfig index 9f24d0d2fef..e62f3333a15 100644 --- a/drivers/sensor/th02/Kconfig +++ b/drivers/sensor/th02/Kconfig @@ -5,6 +5,6 @@ config TH02 bool "TH02 Temperature Sensor" default y depends on DT_HAS_HOPERF_TH02_ENABLED - depends on I2C + select I2C help Enable driver for the TH02 temperature sensor. diff --git a/drivers/sensor/ti_hdc/Kconfig b/drivers/sensor/ti_hdc/Kconfig index e379e8a2928..ff23a2cc5e0 100644 --- a/drivers/sensor/ti_hdc/Kconfig +++ b/drivers/sensor/ti_hdc/Kconfig @@ -7,6 +7,6 @@ config TI_HDC bool "Texas Instruments Temperature and Humidity Sensor (e.g. HDC1008)" default y depends on DT_HAS_TI_HDC_ENABLED - depends on I2C + select I2C help Enable driver for TI temperature and humidity sensors. diff --git a/drivers/sensor/ti_hdc20xx/Kconfig b/drivers/sensor/ti_hdc20xx/Kconfig index 2e1f88a5dd7..629b17c5a50 100644 --- a/drivers/sensor/ti_hdc20xx/Kconfig +++ b/drivers/sensor/ti_hdc20xx/Kconfig @@ -8,7 +8,7 @@ config TI_HDC20XX default y depends on DT_HAS_TI_HDC2010_ENABLED || DT_HAS_TI_HDC2021_ENABLED || \ DT_HAS_TI_HDC2022_ENABLED || DT_HAS_TI_HDC2080_ENABLED - depends on I2C + select I2C help Enable driver for TI HDC20XX temperature and humidity sensors (e.g. HDC2010, HDC2021, HDC2022, HDC2080). diff --git a/drivers/sensor/tmp007/Kconfig b/drivers/sensor/tmp007/Kconfig index a58fb3bbdf7..0588215692e 100644 --- a/drivers/sensor/tmp007/Kconfig +++ b/drivers/sensor/tmp007/Kconfig @@ -7,7 +7,7 @@ menuconfig TMP007 bool "TMP007 Infrared Thermopile Sensor" default y depends on DT_HAS_TI_TMP007_ENABLED - depends on I2C + select I2C help Enable driver for TMP007 infrared thermopile sensors. diff --git a/drivers/sensor/tmp108/Kconfig b/drivers/sensor/tmp108/Kconfig index 2034f959c0e..d7fe6ba3d3f 100644 --- a/drivers/sensor/tmp108/Kconfig +++ b/drivers/sensor/tmp108/Kconfig @@ -7,7 +7,7 @@ menuconfig TMP108 bool "TMP108 Temperature Sensor" default y depends on DT_HAS_TI_TMP108_ENABLED - depends on I2C + select I2C help Enable driver for the TMP108 temperature sensor. diff --git a/drivers/sensor/tmp112/Kconfig b/drivers/sensor/tmp112/Kconfig index c588a912b18..19baeade7dc 100644 --- a/drivers/sensor/tmp112/Kconfig +++ b/drivers/sensor/tmp112/Kconfig @@ -7,7 +7,7 @@ config TMP112 bool "TMP112 Temperature Sensor" default y depends on DT_HAS_TI_TMP112_ENABLED - depends on I2C + select I2C help Enable the driver for Texas Instruments TMP112 High-Accuracy Digital Temperature Sensors. diff --git a/drivers/sensor/tmp116/Kconfig b/drivers/sensor/tmp116/Kconfig index e1d641f08c3..37a5d60ed77 100644 --- a/drivers/sensor/tmp116/Kconfig +++ b/drivers/sensor/tmp116/Kconfig @@ -7,6 +7,6 @@ config TMP116 bool "TMP116 and TMP117 Temperature Sensors" default y depends on DT_HAS_TI_TMP116_ENABLED - depends on I2C + select I2C help Enable driver for TMP116 and TMP117 temperature sensors. diff --git a/drivers/sensor/vcnl4040/Kconfig b/drivers/sensor/vcnl4040/Kconfig index bea4fc15d95..5973316ca6a 100644 --- a/drivers/sensor/vcnl4040/Kconfig +++ b/drivers/sensor/vcnl4040/Kconfig @@ -7,7 +7,7 @@ menuconfig VCNL4040 bool "VCNL4040 Proximity and Ambient Light Sensor" default y depends on DT_HAS_VISHAY_VCNL4040_ENABLED - depends on I2C + select I2C help Enable driver for VCNL4040 sensors. diff --git a/drivers/sensor/vl53l0x/Kconfig b/drivers/sensor/vl53l0x/Kconfig index 8f101df0453..936ef923c87 100644 --- a/drivers/sensor/vl53l0x/Kconfig +++ b/drivers/sensor/vl53l0x/Kconfig @@ -7,7 +7,7 @@ menuconfig VL53L0X bool "VL53L0X time of flight sensor" default y depends on DT_HAS_ST_VL53L0X_ENABLED - depends on I2C + select I2C select HAS_STLIB help Enable driver for VL53L0X I2C-based time of flight sensor. diff --git a/drivers/sensor/wsen_itds/Kconfig b/drivers/sensor/wsen_itds/Kconfig index 7c6e28e1bad..17493a4e698 100644 --- a/drivers/sensor/wsen_itds/Kconfig +++ b/drivers/sensor/wsen_itds/Kconfig @@ -6,7 +6,7 @@ config ITDS bool "WSEN-ITDS 3-axis accel sensor" default y depends on DT_HAS_WE_WSEN_ITDS_ENABLED - depends on I2C + select I2C help Enable Wurth Elektronik WSEN-ITDS 3-axis acceleration sensor provides acceleration and die temperature measurement. From a516f77f13f543527aca1a5f6f739ee607880a02 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 4 Aug 2022 12:25:55 +0200 Subject: [PATCH 030/501] [nrf fromtree] scripts: west_commands: runners: jlink: support pylink >= 0.14 pylink 0.14.0 changed the class variable where JLink DLL library name (libjlinkarm) is stored. This patch adds support for new pylink libraries while keeping backwards compatibility. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit d937b22e20ca9a3c042aa9acc97852ac40e764e5) --- scripts/west_commands/runners/jlink.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/west_commands/runners/jlink.py b/scripts/west_commands/runners/jlink.py index 878cd745217..173ad64435c 100644 --- a/scripts/west_commands/runners/jlink.py +++ b/scripts/west_commands/runners/jlink.py @@ -8,6 +8,7 @@ from functools import partial import logging import os +from packaging.version import Version from pathlib import Path import shlex import subprocess @@ -17,6 +18,7 @@ from runners.core import ZephyrBinaryRunner, RunnerCaps, depr_action try: + import pylink from pylink.library import Library MISSING_REQUIREMENTS = False except ImportError: @@ -150,16 +152,23 @@ def jlink_version(self): # to load the shared library distributed with the tools, which # provides an API call for getting the version. if not hasattr(self, '_jlink_version'): + # pylink >= 0.14.0 exposes JLink SDK DLL (libjlinkarm) in + # JLINK_SDK_STARTS_WITH, while previous versions use JLINK_SDK_NAME + if Version(pylink.__version__) >= Version('0.14.0'): + sdk = Library.JLINK_SDK_STARTS_WITH + else: + sdk = Library.JLINK_SDK_NAME + plat = sys.platform if plat.startswith('win32'): libname = Library.get_appropriate_windows_sdk_name() + '.dll' elif plat.startswith('linux'): - libname = Library.JLINK_SDK_NAME + '.so' + libname = sdk + '.so' elif plat.startswith('darwin'): - libname = Library.JLINK_SDK_NAME + '.dylib' + libname = sdk + '.dylib' else: self.logger.warning(f'unknown platform {plat}; assuming UNIX') - libname = Library.JLINK_SDK_NAME + '.so' + libname = sdk + '.so' lib = Library(dllpath=os.fspath(Path(self.commander).parent / libname)) From 75402705e5578a281785c6d93789f44d87431f1f Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 2 Aug 2022 16:15:44 +0300 Subject: [PATCH 031/501] [nrf fromtree] net: lwm2m: Allow string and opaque data types to be empty When string and opaque types are uninitialized, we should allow their data length to be zero. However, most content formatters seem to calculate the string length separately so replace the pointer of empty data into a static string that is guaranteed to be empty. Signed-off-by: Seppo Takalo (cherry picked from commit 0b808350dd9f3f2c9e2f1e64ce26e04b388c8b2b) --- subsys/net/lib/lwm2m/lwm2m_message_handling.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_message_handling.c b/subsys/net/lib/lwm2m/lwm2m_message_handling.c index 02fea2d69cd..fd339ff4c21 100644 --- a/subsys/net/lib/lwm2m/lwm2m_message_handling.c +++ b/subsys/net/lib/lwm2m/lwm2m_message_handling.c @@ -1032,10 +1032,22 @@ static int lwm2m_read_handler(struct lwm2m_engine_obj_inst *obj_inst, struct lwm res->res_instances[i].res_inst_id, &data_len); } - if (!data_ptr || data_len == 0) { + if (!data_ptr && data_len) { return -ENOENT; } + if (!data_len) { + if (obj_field->data_type != LWM2M_RES_TYPE_OPAQUE && + obj_field->data_type != LWM2M_RES_TYPE_STRING) { + return -ENOENT; + } + /* Only opaque and string types can be empty, and when + * empty, we should not give pointer to potentially uninitialized + * data to a content formatter. Give pointer to empty string instead. + */ + data_ptr = ""; + } + switch (obj_field->data_type) { case LWM2M_RES_TYPE_OPAQUE: From 089738b3d810f5b2e21079fe1ae8f5c9865ce37f Mon Sep 17 00:00:00 2001 From: Juha Heiskanen Date: Wed, 3 Aug 2022 14:26:43 +0300 Subject: [PATCH 032/501] [nrf fromtree] samples: net: lwm2m_client: Updated RD client event handler Added missed LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED event handler Signed-off-by: Juha Heiskanen (cherry picked from commit d117ad9eb7ccd475c1462403b3a467db1490b7b3) --- samples/net/lwm2m_client/src/lwm2m-client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/net/lwm2m_client/src/lwm2m-client.c b/samples/net/lwm2m_client/src/lwm2m-client.c index b5be655437a..2897167d569 100644 --- a/samples/net/lwm2m_client/src/lwm2m-client.c +++ b/samples/net/lwm2m_client/src/lwm2m-client.c @@ -466,6 +466,10 @@ static void rd_client_event(struct lwm2m_ctx *client, LOG_DBG("Queue mode RX window closed"); break; + case LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED: + LOG_DBG("LwM2M engine suspended"); + break; + case LWM2M_RD_CLIENT_EVENT_NETWORK_ERROR: LOG_ERR("LwM2M engine reported a network error."); lwm2m_rd_client_stop(client, rd_client_event, true); From 656129521472e097645a8a052044f18d27ce4159 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Tue, 9 Aug 2022 12:11:08 +0200 Subject: [PATCH 033/501] [nrf fromtree] doc: extensions: kconfig: improve search capabilities This patch modifies the Kconfig search _algorithm_ so that it aligns with how menuconfig search works: - Input is splitted into multiple search terms (space based split) - Both Kconfig option name and prompt are used - Regex search is used instead of match, it is less efficient but will search the whole string, leading to more results. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 31cfd9e1d9f0a4d7135d5a5ba701b4ac9ca8b263) --- .../zephyr/kconfig/static/kconfig.mjs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/static/kconfig.mjs b/doc/_extensions/zephyr/kconfig/static/kconfig.mjs index 06d05f53842..7c1d7df5985 100644 --- a/doc/_extensions/zephyr/kconfig/static/kconfig.mjs +++ b/doc/_extensions/zephyr/kconfig/static/kconfig.mjs @@ -289,11 +289,23 @@ function doSearch() { } /* perform search */ - let pattern = new RegExp(input.value, 'i'); + const regexes = input.value.trim().split(/\s+/).map( + element => new RegExp(element.toLowerCase()) + ); let count = 0; const searchResults = db.filter(entry => { - if (entry.name.match(pattern)) { + let matches = 0; + const name = entry.name.toLowerCase(); + const prompt = entry.prompt ? entry.prompt.toLowerCase() : ""; + + regexes.forEach(regex => { + if (name.search(regex) >= 0 || prompt.search(regex) >= 0) { + matches++; + } + }); + + if (matches === regexes.length) { count++; if (count > searchOffset && count <= (searchOffset + MAX_RESULTS)) { return true; From 676596e794bab4ceeffa021670cf09b9382cf0bf Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Tue, 9 Aug 2022 12:10:18 +0200 Subject: [PATCH 034/501] [nrf fromtree] doc: extensions: kconfig: sort database entries Sort database entries so that search results appear in alphabetical order based on the given input. This mimics the behavior of menuconfig search functionality. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 0dc3baddacfdef8df7288ac2a4e3760753e42969) --- doc/_extensions/zephyr/kconfig/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index fab8eefe2a2..f95d7f68ab5 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -253,7 +253,10 @@ def kconfig_build_resources(app: Sphinx) -> None: kconfig, module_paths = kconfig_load(app) db = list() - for sc in chain(kconfig.unique_defined_syms, kconfig.unique_choices): + for sc in sorted( + chain(kconfig.unique_defined_syms, kconfig.unique_choices), + key=lambda sc: sc.name if sc.name else "", + ): # skip nameless symbols if not sc.name: continue From 294b5adfd1ff135ccdf23e4e79044e83f24dbacc Mon Sep 17 00:00:00 2001 From: Juha Heiskanen Date: Wed, 3 Aug 2022 12:48:44 +0300 Subject: [PATCH 035/501] [nrf fromtree] net: lwm2m: Shell helper for pause and resume Helper commit for test pause and resume. Signed-off-by: Juha Heiskanen (cherry picked from commit c76f047c2b2d81c985054c94b77ab2847d444216) --- subsys/net/lib/lwm2m/lwm2m_shell.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/subsys/net/lib/lwm2m/lwm2m_shell.c b/subsys/net/lib/lwm2m/lwm2m_shell.c index 0c83494fb15..3c85b1603a6 100644 --- a/subsys/net/lib/lwm2m/lwm2m_shell.c +++ b/subsys/net/lib/lwm2m/lwm2m_shell.c @@ -45,6 +45,8 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define LWM2M_HELP_STOP "Stop the LwM2M RD (De-register) Client\nstop [OPTIONS]\n" \ "-f \tForce close the connection\n" #define LWM2M_HELP_UPDATE "Trigger Registration Update of the LwM2M RD Client\n" +#define LWM2M_HELP_PAUSE "LwM2M engine thread pause" +#define LWM2M_HELP_RESUME "LwM2M engine thread resume" static int cmd_send(const struct shell *sh, size_t argc, char **argv) { @@ -433,6 +435,24 @@ static int cmd_update(const struct shell *sh, size_t argc, char **argv) return 0; } +static int cmd_pause(const struct shell *sh, size_t argc, char **argv) +{ + ARG_UNUSED(sh); + ARG_UNUSED(argc); + ARG_UNUSED(argv); + + return lwm2m_engine_pause(); +} + +static int cmd_resume(const struct shell *sh, size_t argc, char **argv) +{ + ARG_UNUSED(sh); + ARG_UNUSED(argc); + ARG_UNUSED(argv); + + return lwm2m_engine_resume(); +} + SHELL_STATIC_SUBCMD_SET_CREATE( sub_lwm2m, SHELL_COND_CMD_ARG(CONFIG_LWM2M_VERSION_1_1, send, NULL, @@ -443,6 +463,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE( SHELL_CMD_ARG(start, NULL, LWM2M_HELP_START, cmd_start, 2, 2), SHELL_CMD_ARG(stop, NULL, LWM2M_HELP_STOP, cmd_stop, 1, 1), SHELL_CMD_ARG(update, NULL, LWM2M_HELP_UPDATE, cmd_update, 1, 0), + SHELL_CMD_ARG(pause, NULL, LWM2M_HELP_PAUSE, cmd_pause, 1, 0), + SHELL_CMD_ARG(resume, NULL, LWM2M_HELP_RESUME, cmd_resume, 1, 0), SHELL_SUBCMD_SET_END); SHELL_COND_CMD_ARG_REGISTER(CONFIG_LWM2M_SHELL, lwm2m, &sub_lwm2m, LWM2M_HELP_CMD, NULL, 1, 0); From 21e551b6bcd653470c709c7f849ff586cfd2af35 Mon Sep 17 00:00:00 2001 From: Juha Heiskanen Date: Wed, 3 Aug 2022 12:34:36 +0300 Subject: [PATCH 036/501] [nrf fromtree] net: lwm2m: LwM2M Pause and resume support New API for suspend and resume LwM2M engine. New event LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED for indicate application that engine is suspended. Simplify stack suspend and resume state same time for queue mode. New CONFIG_LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE for enable skip socket close at RX_OFF_IDDLE state that socket is only suspended and close is called only when connection is resumed. Signed-off-by: Juha Heiskanen (cherry picked from commit 1cdbfcf0d7df42da77328798ea6cc6cce9517248) --- include/zephyr/net/lwm2m.h | 26 +- subsys/net/lib/lwm2m/Kconfig | 6 + subsys/net/lib/lwm2m/lwm2m_engine.c | 225 +++++++++++++----- subsys/net/lib/lwm2m/lwm2m_engine.h | 6 +- subsys/net/lib/lwm2m/lwm2m_message_handling.c | 5 +- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 99 +++++++- subsys/net/lib/lwm2m/lwm2m_rd_client.h | 4 +- 7 files changed, 289 insertions(+), 82 deletions(-) diff --git a/include/zephyr/net/lwm2m.h b/include/zephyr/net/lwm2m.h index 651b3089f82..ee071985e1b 100644 --- a/include/zephyr/net/lwm2m.h +++ b/include/zephyr/net/lwm2m.h @@ -168,13 +168,13 @@ struct lwm2m_ctx { */ bool use_dtls; -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) /** * Flag to indicate that the socket connection is suspended. * With queue mode, this will tell if there is a need to reconnect. */ bool connection_suspended; +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) /** * Flag to indicate that the client is buffering Notifications and Send messages. * True value buffer Notifications and Send messages. @@ -1229,6 +1229,7 @@ enum lwm2m_rd_client_event { LWM2M_RD_CLIENT_EVENT_DEREGISTER_FAILURE, LWM2M_RD_CLIENT_EVENT_DISCONNECT, LWM2M_RD_CLIENT_EVENT_QUEUE_MODE_RX_OFF, + LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED, LWM2M_RD_CLIENT_EVENT_NETWORK_ERROR, }; @@ -1284,6 +1285,29 @@ int lwm2m_rd_client_start(struct lwm2m_ctx *client_ctx, const char *ep_name, int lwm2m_rd_client_stop(struct lwm2m_ctx *client_ctx, lwm2m_ctx_event_cb_t event_cb, bool deregister); +/** + * @brief Suspend the LwM2M engine Thread + * + * Suspend LwM2M engine. Use case could be when network connection is down. + * LwM2M Engine indicate before it suspend by + * LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED event. + * + * @return 0 for success or negative in case of error. + */ +int lwm2m_engine_pause(void); + +/** + * @brief Resume the LwM2M engine thread + * + * Resume suspended LwM2M engine. After successful resume call engine will do + * full registration or registration update based on suspended time. + * Event's LWM2M_RD_CLIENT_EVENT_REGISTRATION_COMPLETE or WM2M_RD_CLIENT_EVENT_REG_UPDATE_COMPLETE + * indicate that client is connected to server. + * + * @return 0 for success or negative in case of error. + */ +int lwm2m_engine_resume(void); + /** * @brief Trigger a Registration Update of the LwM2M RD Client */ diff --git a/subsys/net/lib/lwm2m/Kconfig b/subsys/net/lib/lwm2m/Kconfig index 5f5bdb9f9c0..6cd008470b1 100644 --- a/subsys/net/lib/lwm2m/Kconfig +++ b/subsys/net/lib/lwm2m/Kconfig @@ -191,6 +191,12 @@ config LWM2M_TLS_SESSION_CACHING help Enabling this only when feature is supported in TLS library. +config LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE + bool "Socket close is skipped at RX_ON_IDLE state" + depends on LWM2M_RD_CLIENT_SUPPORT + help + This config suspend socket handler which skip socket polling process. + config LWM2M_RD_CLIENT_SUPPORT bool "support for LWM2M client bootstrap/registration state machine" default y diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index 5f4618eb0c7..b6cadb13dac 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -80,6 +80,9 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); static struct lwm2m_obj_path_list observe_paths[LWM2M_ENGINE_MAX_OBSERVER_PATH]; #define MAX_PERIODIC_SERVICE 10 +static k_tid_t engine_thread_id; +static bool suspend_engine_thread; + struct service_node { sys_snode_t node; k_work_handler_t service_work; @@ -109,6 +112,8 @@ int lwm2m_sock_nfds(void) { return sock_nfds; } struct lwm2m_block_context *lwm2m_block1_context(void) { return block1_contexts; } +static void lwm2m_socket_update(struct lwm2m_ctx *ctx); + /* for debugging: to print IP addresses */ char *lwm2m_sprint_ip_addr(const struct sockaddr *addr) { @@ -161,26 +166,101 @@ char *sprint_token(const uint8_t *token, uint8_t tkl) /* utility functions */ +int lwm2m_open_socket(struct lwm2m_ctx *client_ctx) +{ + if (client_ctx->sock_fd < 0) { + /* open socket */ + + if (IS_ENABLED(CONFIG_LWM2M_DTLS_SUPPORT) && client_ctx->use_dtls) { + client_ctx->sock_fd = socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, + IPPROTO_DTLS_1_2); + } else { + client_ctx->sock_fd = + socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, IPPROTO_UDP); + } + + if (client_ctx->sock_fd < 0) { + LOG_ERR("Failed to create socket: %d", errno); + return -errno; + } + + lwm2m_socket_update(client_ctx); + } + + return 0; +} + +int lwm2m_close_socket(struct lwm2m_ctx *client_ctx) +{ + int ret = 0; + + if (client_ctx->sock_fd >= 0) { + ret = close(client_ctx->sock_fd); + if (ret) { + LOG_ERR("Failed to close socket: %d", errno); + ret = -errno; + return ret; + } + + client_ctx->sock_fd = -1; + client_ctx->connection_suspended = true; #if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) -int lwm2m_engine_connection_resume(struct lwm2m_ctx *client_ctx) + /* Enable Queue mode buffer store */ + client_ctx->buffer_client_messages = true; +#endif + lwm2m_socket_update(client_ctx); + } + + return ret; +} + + +int lwm2m_socket_suspend(struct lwm2m_ctx *client_ctx) { -#ifdef CONFIG_LWM2M_DTLS_SUPPORT - if (!client_ctx->use_dtls) { - return 0; + int ret = 0; + + if (client_ctx->sock_fd >= 0 && !client_ctx->connection_suspended) { + int socket_temp_id = client_ctx->sock_fd; + + client_ctx->sock_fd = -1; + client_ctx->connection_suspended = true; +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) + /* Enable Queue mode buffer store */ + client_ctx->buffer_client_messages = true; +#endif + lwm2m_socket_update(client_ctx); + client_ctx->sock_fd = socket_temp_id; } + return ret; +} + +int lwm2m_engine_connection_resume(struct lwm2m_ctx *client_ctx) +{ + int ret; + if (client_ctx->connection_suspended) { + lwm2m_close_socket(client_ctx); client_ctx->connection_suspended = false; + ret = lwm2m_open_socket(client_ctx); + if (ret) { + return ret; + } + + if (!client_ctx->use_dtls) { + return 0; + } + LOG_DBG("Resume suspended connection"); return lwm2m_socket_start(client_ctx); } -#endif + return 0; } -#endif -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) + int lwm2m_push_queued_buffers(struct lwm2m_ctx *client_ctx) { +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) client_ctx->buffer_client_messages = false; while (!sys_slist_is_empty(&client_ctx->queued_messages)) { sys_snode_t *msg_node = sys_slist_get(&client_ctx->queued_messages); @@ -192,9 +272,9 @@ int lwm2m_push_queued_buffers(struct lwm2m_ctx *client_ctx) msg = SYS_SLIST_CONTAINER(msg_node, msg, node); sys_slist_append(&msg->ctx->pending_sends, &msg->node); } +#endif return 0; } -#endif bool lwm2m_engine_bootstrap_override(struct lwm2m_ctx *client_ctx, struct lwm2m_obj_path *path) { @@ -434,43 +514,6 @@ static int32_t lwm2m_engine_service(const int64_t timestamp) return engine_next_service_timeout_ms(ENGINE_UPDATE_INTERVAL_MS, timestamp); } -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) - -int lwm2m_engine_close_socket_connection(struct lwm2m_ctx *client_ctx) -{ - int ret = 0; - /* Enable Queue mode buffer store */ - client_ctx->buffer_client_messages = true; - -#ifdef CONFIG_LWM2M_DTLS_SUPPORT - if (!client_ctx->use_dtls) { - return 0; - } - - if (client_ctx->sock_fd >= 0) { - ret = close(client_ctx->sock_fd); - if (ret) { - LOG_ERR("Failed to close socket: %d", errno); - ret = -errno; - return ret; - } - client_ctx->sock_fd = -1; - client_ctx->connection_suspended = true; - } - - /* Open socket again that Observation and re-send functionality works */ - client_ctx->sock_fd = - socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, IPPROTO_DTLS_1_2); - - if (client_ctx->sock_fd < 0) { - LOG_ERR("Failed to create socket: %d", errno); - return -errno; - } -#endif - return ret; -} -#endif - /* LwM2M Socket Integration */ int lwm2m_socket_add(struct lwm2m_ctx *ctx) @@ -487,6 +530,17 @@ int lwm2m_socket_add(struct lwm2m_ctx *ctx) return 0; } +static void lwm2m_socket_update(struct lwm2m_ctx *ctx) +{ + for (int i = 0; i < sock_nfds; i++) { + if (sock_ctx[i] != ctx) { + continue; + } + sock_fds[i].fd = ctx->sock_fd; + return; + } +} + void lwm2m_socket_del(struct lwm2m_ctx *ctx) { for (int i = 0; i < sock_nfds; i++) { @@ -519,8 +573,8 @@ static void check_notifications(struct lwm2m_ctx *ctx, const int64_t timestamp) if (!obs->event_timestamp || timestamp < obs->event_timestamp) { continue; } - /* Check That There is not pending process and client is registred */ - if (obs->active_tx_operation || !lwm2m_rd_client_is_registred(ctx)) { + /* Check That There is not pending process*/ + if (obs->active_tx_operation) { continue; } @@ -602,6 +656,18 @@ static void socket_loop(void) int32_t timeout, next_retransmit; while (1) { + /* Check is Thread Suspend Requested */ + if (suspend_engine_thread) { +#if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT) + lwm2m_rd_client_pause(); +#endif + suspend_engine_thread = false; + k_thread_suspend(engine_thread_id); +#if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT) + lwm2m_rd_client_resume(); +#endif + } + timestamp = k_uptime_get(); timeout = lwm2m_engine_service(timestamp); @@ -618,7 +684,8 @@ static void socket_loop(void) timeout = next_retransmit; } } - if (sys_slist_is_empty(&sock_ctx[i]->pending_sends)) { + if (sys_slist_is_empty(&sock_ctx[i]->pending_sends) && + lwm2m_rd_client_is_registred(sock_ctx[i])) { check_notifications(sock_ctx[i], timestamp); } } @@ -638,6 +705,11 @@ static void socket_loop(void) } for (i = 0; i < sock_nfds; i++) { + + if (sock_ctx[i]->sock_fd < 0) { + continue; + } + if ((sock_fds[i].revents & POLLERR) || (sock_fds[i].revents & POLLNVAL) || (sock_fds[i].revents & POLLHUP)) { LOG_ERR("Poll reported a socket error, %02x.", sock_fds[i].revents); @@ -732,23 +804,12 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) if (client_ctx->sock_fd < 0) { allocate_socket = true; -#if defined(CONFIG_LWM2M_DTLS_SUPPORT) - if (client_ctx->use_dtls) { - client_ctx->sock_fd = socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, - IPPROTO_DTLS_1_2); - } else -#endif /* CONFIG_LWM2M_DTLS_SUPPORT */ - { - client_ctx->sock_fd = - socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, IPPROTO_UDP); + ret = lwm2m_open_socket(client_ctx); + if (ret) { + return ret; } } - if (client_ctx->sock_fd < 0) { - LOG_ERR("Failed to create socket: %d", errno); - return -errno; - } - #if defined(CONFIG_LWM2M_DTLS_SUPPORT) if (client_ctx->use_dtls) { sec_tag_t tls_tag_list[] = { @@ -859,6 +920,44 @@ int lwm2m_engine_start(struct lwm2m_ctx *client_ctx) return lwm2m_socket_start(client_ctx); } +int lwm2m_engine_pause(void) +{ + char buffer[32]; + const char *str; + + str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); + if (suspend_engine_thread || !strcmp(str, "suspended")) { + LOG_WRN("Engine thread already suspended"); + return 0; + } + + suspend_engine_thread = true; + + while (strcmp(str, "suspended")) { + k_msleep(10); + str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); + } + LOG_INF("LWM2M engine thread paused (%s) ", str); + return 0; +} + +int lwm2m_engine_resume(void) +{ + char buffer[32]; + const char *str; + + str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); + if (strcmp(str, "suspended")) { + LOG_WRN("LWM2M engine thread state not ok for resume %s", str); + return -EPERM; + } + + k_thread_resume(engine_thread_id); + str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); + LOG_INF("LWM2M engine thread resume (%s)", str); + return 0; +} + static int lwm2m_engine_init(const struct device *dev) { int i; @@ -870,7 +969,7 @@ static int lwm2m_engine_init(const struct device *dev) (void)memset(block1_contexts, 0, sizeof(block1_contexts)); /* start sock receive thread */ - k_thread_create(&engine_thread_data, &engine_thread_stack[0], + engine_thread_id = k_thread_create(&engine_thread_data, &engine_thread_stack[0], K_KERNEL_STACK_SIZEOF(engine_thread_stack), (k_thread_entry_t)socket_loop, NULL, NULL, NULL, THREAD_PRIORITY, 0, K_NO_WAIT); k_thread_name_set(&engine_thread_data, "lwm2m-sock-recv"); diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.h b/subsys/net/lib/lwm2m/lwm2m_engine.h index 34edf9c73c2..02ae3dc0326 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.h +++ b/subsys/net/lib/lwm2m/lwm2m_engine.h @@ -83,11 +83,11 @@ uint8_t lwm2m_firmware_get_update_result(void); int lwm2m_socket_add(struct lwm2m_ctx *ctx); void lwm2m_socket_del(struct lwm2m_ctx *ctx); int lwm2m_socket_start(struct lwm2m_ctx *client_ctx); -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) -int lwm2m_engine_close_socket_connection(struct lwm2m_ctx *client_ctx); int lwm2m_engine_connection_resume(struct lwm2m_ctx *client_ctx); +int lwm2m_open_socket(struct lwm2m_ctx *client_ctx); +int lwm2m_close_socket(struct lwm2m_ctx *client_ctx); +int lwm2m_socket_suspend(struct lwm2m_ctx *client_ctx); int lwm2m_push_queued_buffers(struct lwm2m_ctx *client_ctx); -#endif /* Resources */ struct lwm2m_ctx **lwm2m_sock_ctx(void); diff --git a/subsys/net/lib/lwm2m/lwm2m_message_handling.c b/subsys/net/lib/lwm2m/lwm2m_message_handling.c index fd339ff4c21..4d1d02f37c9 100644 --- a/subsys/net/lib/lwm2m/lwm2m_message_handling.c +++ b/subsys/net/lib/lwm2m/lwm2m_message_handling.c @@ -196,8 +196,9 @@ int lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx) coap_pendings_clear(client_ctx->pendings, ARRAY_SIZE(client_ctx->pendings)); coap_replies_clear(client_ctx->replies, ARRAY_SIZE(client_ctx->replies)); -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) + client_ctx->connection_suspended = false; +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) client_ctx->buffer_client_messages = true; #endif lwm2m_socket_del(client_ctx); @@ -213,9 +214,9 @@ void lwm2m_engine_context_init(struct lwm2m_ctx *client_ctx) { sys_slist_init(&client_ctx->pending_sends); sys_slist_init(&client_ctx->observer); + client_ctx->connection_suspended = false; #if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) client_ctx->buffer_client_messages = true; - client_ctx->connection_suspended = false; sys_slist_init(&client_ctx->queued_messages); #endif } diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 10faa2a1dbc..e5b846b1a1e 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -55,9 +55,11 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include #include +#include #include "lwm2m_object.h" #include "lwm2m_engine.h" +#include "lwm2m_rd_client.h" #include "lwm2m_rw_link_format.h" #define LWM2M_RD_CLIENT_URI "rd" @@ -92,6 +94,7 @@ enum sm_engine_state { ENGINE_REGISTRATION_DONE, ENGINE_REGISTRATION_DONE_RX_OFF, ENGINE_UPDATE_SENT, + ENGINE_SUSPENDED, ENGINE_DEREGISTER, ENGINE_DEREGISTER_SENT, ENGINE_DEREGISTERED, @@ -125,6 +128,7 @@ struct lwm2m_rd_client_info { * documented in the LwM2M specification. */ static char query_buffer[MAX(32, sizeof("ep=") + CLIENT_EP_LEN)]; +static enum sm_engine_state suspended_client_state; static struct lwm2m_message *rd_get_message(void) { @@ -166,20 +170,13 @@ static void set_sm_state(uint8_t sm_state) if (client.engine_state == ENGINE_UPDATE_SENT && (sm_state == ENGINE_REGISTRATION_DONE || sm_state == ENGINE_REGISTRATION_DONE_RX_OFF)) { -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) lwm2m_push_queued_buffers(client.ctx); -#endif event = LWM2M_RD_CLIENT_EVENT_REG_UPDATE_COMPLETE; } else if (sm_state == ENGINE_REGISTRATION_DONE) { -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) lwm2m_push_queued_buffers(client.ctx); -#endif event = LWM2M_RD_CLIENT_EVENT_REGISTRATION_COMPLETE; } else if (sm_state == ENGINE_REGISTRATION_DONE_RX_OFF) { event = LWM2M_RD_CLIENT_EVENT_QUEUE_MODE_RX_OFF; -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) - lwm2m_engine_close_socket_connection(client.ctx); -#endif } else if ((sm_state == ENGINE_INIT || sm_state == ENGINE_DEREGISTERED) && (client.engine_state >= ENGINE_DO_REGISTRATION && @@ -201,6 +198,15 @@ static void set_sm_state(uint8_t sm_state) if (event > LWM2M_RD_CLIENT_EVENT_NONE && client.ctx->event_cb) { client.ctx->event_cb(client.ctx, event); } + + /* Suspend socket after Event callback */ + if (event == LWM2M_RD_CLIENT_EVENT_QUEUE_MODE_RX_OFF) { + if (IS_ENABLED(CONFIG_LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE)) { + lwm2m_socket_suspend(client.ctx); + } else { + lwm2m_close_socket(client.ctx); + } + } } static bool sm_is_registered(void) @@ -981,7 +987,7 @@ static int sm_registration_done(void) update_objects = client.update_objects; client.trigger_update = false; client.update_objects = false; -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) + ret = lwm2m_engine_connection_resume(client.ctx); if (ret) { lwm2m_engine_context_close(client.ctx); @@ -989,7 +995,6 @@ static int sm_registration_done(void) set_sm_state(ENGINE_DO_REGISTRATION); return ret; } -#endif ret = sm_send_registration(update_objects, do_update_reply_cb, @@ -1102,6 +1107,9 @@ static void lwm2m_rd_client_service(struct k_work *work) sm_do_init(); break; + case ENGINE_SUSPENDED: + break; + #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) case ENGINE_DO_BOOTSTRAP_REG: sm_do_bootstrap_reg(); @@ -1231,6 +1239,77 @@ int lwm2m_rd_client_stop(struct lwm2m_ctx *client_ctx, return 0; } +int lwm2m_rd_client_pause(void) +{ + enum lwm2m_rd_client_event event = LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED; + + k_mutex_lock(&client.mutex, K_FOREVER); + + if (!client.ctx) { + k_mutex_unlock(&client.mutex); + LOG_ERR("Cannot pause. No context"); + return -EPERM; + } else if (client.engine_state == ENGINE_SUSPENDED) { + k_mutex_unlock(&client.mutex); + LOG_ERR("LwM2M client already suspended"); + return 0; + } + + LOG_INF("Suspend client"); + if (!client.ctx->connection_suspended && client.ctx->event_cb) { + client.ctx->event_cb(client.ctx, event); + } + + suspended_client_state = get_sm_state(); + client.engine_state = ENGINE_SUSPENDED; + + k_mutex_unlock(&client.mutex); + + return 0; +} + +int lwm2m_rd_client_resume(void) +{ + int ret; + + k_mutex_lock(&client.mutex, K_FOREVER); + + if (!client.ctx) { + k_mutex_unlock(&client.mutex); + LOG_WRN("Cannot resume. No context"); + return -EPERM; + } + + if (client.engine_state != ENGINE_SUSPENDED) { + k_mutex_unlock(&client.mutex); + LOG_WRN("Cannot resume state is not Suspended"); + return -EPERM; + } + + LOG_INF("Resume Client state"); + lwm2m_close_socket(client.ctx); + client.engine_state = suspended_client_state; + + if (!sm_is_registered() || + (sm_is_registered() && + (client.lifetime <= (k_uptime_get() - client.last_update) / 1000))) { + client.engine_state = ENGINE_DO_REGISTRATION; + } else { + lwm2m_rd_client_connection_resume(client.ctx); + client.trigger_update = true; + } + + ret = lwm2m_open_socket(client.ctx); + if (ret) { + LOG_ERR("Socket Open Fail"); + client.engine_state = ENGINE_INIT; + } + + k_mutex_unlock(&client.mutex); + + return 0; +} + void lwm2m_rd_client_update(void) { engine_trigger_update(false); @@ -1241,7 +1320,6 @@ struct lwm2m_ctx *lwm2m_rd_client_ctx(void) return client.ctx; } -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx) { if (client.ctx != client_ctx) { @@ -1268,7 +1346,6 @@ int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx) return 0; } -#endif int lwm2m_rd_client_timeout(struct lwm2m_ctx *client_ctx) { diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.h b/subsys/net/lib/lwm2m/lwm2m_rd_client.h index 661efd1351c..fbab9af9136 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.h +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.h @@ -40,15 +40,15 @@ void engine_trigger_update(bool update_objects); int engine_trigger_bootstrap(void); +int lwm2m_rd_client_pause(void); +int lwm2m_rd_client_resume(void); int lwm2m_rd_client_timeout(struct lwm2m_ctx *client_ctx); bool lwm2m_rd_client_is_registred(struct lwm2m_ctx *client_ctx); #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) void engine_bootstrap_finish(void); #endif -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx); -#endif void engine_update_tx_time(void); struct lwm2m_message *lwm2m_get_ongoing_rd_msg(void); From e1ff1c64528c080e508d102ea62e548df447c3c5 Mon Sep 17 00:00:00 2001 From: Eduardo Montoya Date: Tue, 9 Aug 2022 09:40:57 +0200 Subject: [PATCH 037/501] [nrf fromtree] net: openthread: allow to configure `OPENTHREAD_MESSAGE_BUFFER_SIZE` Add `OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE` to Kconfig. Also set the number of children to minumum possible for MTD builds in order to save some resources (~512B of RAM). Signed-off-by: Eduardo Montoya (cherry picked from commit f0b1802dcb1e64a23e435a089f7a00b9946a16dd) --- modules/openthread/Kconfig.thread | 4 ++-- .../platform/openthread-core-zephyr-config.h | 10 ++++++++++ subsys/net/l2/openthread/Kconfig | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/openthread/Kconfig.thread b/modules/openthread/Kconfig.thread index 0a12ec4a233..5420d025f80 100644 --- a/modules/openthread/Kconfig.thread +++ b/modules/openthread/Kconfig.thread @@ -61,9 +61,9 @@ config OPENTHREAD_POLL_PERIOD config OPENTHREAD_MAX_CHILDREN int "The maximum number of children" - range 10 511 + range 1 511 + default 1 if OPENTHREAD_MTD default 32 - depends on OPENTHREAD_FTD config OPENTHREAD_MAX_IP_ADDR_PER_CHILD int "The maximum number of IPv6 address registrations per child" diff --git a/modules/openthread/platform/openthread-core-zephyr-config.h b/modules/openthread/platform/openthread-core-zephyr-config.h index c2679b19856..4c1362d1ee2 100644 --- a/modules/openthread/platform/openthread-core-zephyr-config.h +++ b/modules/openthread/platform/openthread-core-zephyr-config.h @@ -414,4 +414,14 @@ #define OPENTHREAD_CONFIG_PLATFORM_MAC_KEYS_EXPORTABLE_ENABLE 1 #endif +/** + * @def OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE + * + * The size of a message buffer in bytes. + * + */ +#ifdef CONFIG_OPENTHREAD_MESSAGE_BUFFER_SIZE +#define OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE CONFIG_OPENTHREAD_MESSAGE_BUFFER_SIZE +#endif + #endif /* OPENTHREAD_CORE_ZEPHYR_CONFIG_H_ */ diff --git a/subsys/net/l2/openthread/Kconfig b/subsys/net/l2/openthread/Kconfig index f42f2a2b120..5c9d6afebae 100644 --- a/subsys/net/l2/openthread/Kconfig +++ b/subsys/net/l2/openthread/Kconfig @@ -265,6 +265,12 @@ config OPENTHREAD_NUM_MESSAGE_BUFFERS help "The number of message buffers in the buffer pool." +config OPENTHREAD_MESSAGE_BUFFER_SIZE + int "The size of a message buffer in bytes" + default 128 + help + "The size of a message buffer in bytes" + config OPENTHREAD_MAX_STATECHANGE_HANDLERS int "The maximum number of state-changed callback handlers" default 2 From 0758a0f4ff832852a803ad8f7dc0ffe36f38ff15 Mon Sep 17 00:00:00 2001 From: Andreas Chmielewski Date: Mon, 20 Jun 2022 09:24:31 +0200 Subject: [PATCH 038/501] [nrf fromtree] net: lwm2m: Update registration only in good path Registration should only be updated if update of the registration was succesful. Signed-off-by: Andreas Chmielewski (cherry picked from commit ef42d0ac6a613c84ed9570cf9b49d69d02a81c9a) --- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index e5b846b1a1e..c3346186594 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -418,6 +418,9 @@ static int do_registration_reply_cb(const struct coap_packet *response, return -EINVAL; } + /* remember the last reg time */ + client.last_update = k_uptime_get(); + memcpy(client.server_ep, options[1].value, options[1].len); client.server_ep[options[1].len] = '\0'; @@ -459,6 +462,8 @@ static int do_update_reply_cb(const struct coap_packet *response, /* If NOT_FOUND just continue on */ if ((code == COAP_RESPONSE_CODE_CHANGED) || (code == COAP_RESPONSE_CODE_CREATED)) { + /* remember the last reg time */ + client.last_update = k_uptime_get(); set_sm_state(ENGINE_REGISTRATION_DONE); LOG_INF("Update Done"); return 0; @@ -622,6 +627,7 @@ static int sm_do_init(void) client.trigger_update = false; client.lifetime = 0U; client.retries = 0U; + client.last_update = 0U; /* Do bootstrap or registration */ #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) @@ -775,9 +781,6 @@ static int sm_send_registration(bool send_obj_support_data, return -ENOMEM; } - /* remember the last reg time */ - client.last_update = k_uptime_get(); - msg->type = COAP_TYPE_CON; msg->code = COAP_METHOD_POST; msg->mid = coap_next_id(); From e54a684013d1fe781d005608f067e747c90970f8 Mon Sep 17 00:00:00 2001 From: Andreas Chmielewski Date: Tue, 2 Aug 2022 16:40:31 +0200 Subject: [PATCH 039/501] [nrf fromtree] net: lwm2m: separate closing context from closing socket Separate closing lwm2m context from closing socket. This patch is required for the rd client to take more control over lwm2m context and the socket. The goal is to close the socket and to keep the lwm2m context if this is needed. Signed-off-by: Andreas Chmielewski (cherry picked from commit 2afcf2323a569ce48aa5d4c00256e8c4a057ebff) --- include/zephyr/net/lwm2m.h | 13 ++++++++++ subsys/net/lib/lwm2m/lwm2m_engine.c | 24 +++++++++++++++++-- subsys/net/lib/lwm2m/lwm2m_engine.h | 3 ++- subsys/net/lib/lwm2m/lwm2m_message_handling.c | 10 +------- subsys/net/lib/lwm2m/lwm2m_pull_context.c | 2 +- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 24 +++++++++---------- 6 files changed, 51 insertions(+), 25 deletions(-) diff --git a/include/zephyr/net/lwm2m.h b/include/zephyr/net/lwm2m.h index ee071985e1b..0d3c7bacde5 100644 --- a/include/zephyr/net/lwm2m.h +++ b/include/zephyr/net/lwm2m.h @@ -1185,6 +1185,19 @@ int lwm2m_update_device_service_period(uint32_t period_ms); */ bool lwm2m_engine_path_is_observed(const char *pathstr); +/** + * @brief Stop the LwM2M engine + * + * LwM2M clients normally do not need to call this function as it is called + * within lwm2m_rd_client. However, if the client does not use the RD + * client implementation, it will need to be called manually. + * + * @param[in] client_ctx LwM2M context + * + * @return 0 for success or negative in case of error. + */ +int lwm2m_engine_stop(struct lwm2m_ctx *client_ctx); + /** * @brief Start the LwM2M engine * diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index b6cadb13dac..c81db1f5e79 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -862,7 +862,7 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) } else if ((client_ctx->remote_addr).sa_family == AF_INET6) { addr_len = sizeof(struct sockaddr_in6); } else { - lwm2m_engine_context_close(client_ctx); + lwm2m_engine_stop(client_ctx); return -EPROTONOSUPPORT; } @@ -891,10 +891,30 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) } return 0; error: - lwm2m_engine_context_close(client_ctx); + lwm2m_engine_stop(client_ctx); return ret; } +int lwm2m_socket_close(struct lwm2m_ctx *client_ctx) +{ + int sock_fd = client_ctx->sock_fd; + + lwm2m_socket_del(client_ctx); + client_ctx->sock_fd = -1; + if (sock_fd >= 0) { + return close(sock_fd); + } + + return 0; +} + +int lwm2m_engine_stop(struct lwm2m_ctx *client_ctx) +{ + lwm2m_engine_context_close(client_ctx); + + return lwm2m_socket_close(client_ctx); +} + int lwm2m_engine_start(struct lwm2m_ctx *client_ctx) { char pathstr[MAX_RESOURCE_LEN]; diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.h b/subsys/net/lib/lwm2m/lwm2m_engine.h index 02ae3dc0326..427af9598d5 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.h +++ b/subsys/net/lib/lwm2m/lwm2m_engine.h @@ -38,7 +38,7 @@ int lwm2m_engine_validate_write_access(struct lwm2m_message *msg, struct lwm2m_engine_obj_field **obj_field); /* LwM2M context functions */ -int lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx); +void lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx); void lwm2m_engine_context_init(struct lwm2m_ctx *client_ctx); /* Message buffer functions */ @@ -82,6 +82,7 @@ uint8_t lwm2m_firmware_get_update_result(void); /* Network Layer */ int lwm2m_socket_add(struct lwm2m_ctx *ctx); void lwm2m_socket_del(struct lwm2m_ctx *ctx); +int lwm2m_socket_close(struct lwm2m_ctx *client_ctx); int lwm2m_socket_start(struct lwm2m_ctx *client_ctx); int lwm2m_engine_connection_resume(struct lwm2m_ctx *client_ctx); int lwm2m_open_socket(struct lwm2m_ctx *client_ctx); diff --git a/subsys/net/lib/lwm2m/lwm2m_message_handling.c b/subsys/net/lib/lwm2m/lwm2m_message_handling.c index 4d1d02f37c9..a1511e645e1 100644 --- a/subsys/net/lib/lwm2m/lwm2m_message_handling.c +++ b/subsys/net/lib/lwm2m/lwm2m_message_handling.c @@ -172,9 +172,8 @@ static void free_block_ctx(struct lwm2m_block_context *ctx) ctx->tkl = 0U; } -int lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx) +void lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx) { - int sock_fd = client_ctx->sock_fd; struct lwm2m_message *msg; sys_snode_t *obs_node; struct observe_node *obs; @@ -201,13 +200,6 @@ int lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx) #if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) client_ctx->buffer_client_messages = true; #endif - lwm2m_socket_del(client_ctx); - client_ctx->sock_fd = -1; - if (sock_fd >= 0) { - return close(sock_fd); - } else { - return 0; - } } void lwm2m_engine_context_init(struct lwm2m_ctx *client_ctx) diff --git a/subsys/net/lib/lwm2m/lwm2m_pull_context.c b/subsys/net/lib/lwm2m/lwm2m_pull_context.c index f4879ce181a..1d663eb6125 100644 --- a/subsys/net/lib/lwm2m/lwm2m_pull_context.c +++ b/subsys/net/lib/lwm2m/lwm2m_pull_context.c @@ -54,7 +54,7 @@ static void do_transmit_timeout_cb(struct lwm2m_message *msg); */ static void cleanup_context(void) { - lwm2m_engine_context_close(&context.firmware_ctx); + lwm2m_engine_stop(&context.firmware_ctx); k_sem_give(&lwm2m_pull_sem); } diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index c3346186594..3864d212301 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -183,7 +183,7 @@ static void set_sm_state(uint8_t sm_state) client.engine_state <= ENGINE_DEREGISTER_SENT)) { event = LWM2M_RD_CLIENT_EVENT_DISCONNECT; } else if (sm_state == ENGINE_NETWORK_ERROR) { - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); client.retry_delay = 1 << client.retries; client.retries++; if (client.retries > CONFIG_LWM2M_RD_CLIENT_MAX_RETRIES) { @@ -268,7 +268,7 @@ static void sm_handle_failure_state(enum sm_engine_state sm_state) event = LWM2M_RD_CLIENT_EVENT_DEREGISTER_FAILURE; } - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); set_sm_state(sm_state); if (event > LWM2M_RD_CLIENT_EVENT_NONE && client.ctx->event_cb) { @@ -281,7 +281,7 @@ static void socket_fault_cb(int error) { LOG_ERR("RD Client socket error: %d", error); - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); client.ctx->sec_obj_inst = -1; @@ -621,7 +621,7 @@ static int sm_select_security_inst(bool bootstrap_server, int *sec_obj_inst) static int sm_do_init(void) { - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); client.ctx->sec_obj_inst = -1; client.ctx->srv_obj_inst = -1; client.trigger_update = false; @@ -711,7 +711,7 @@ static int sm_do_bootstrap_reg(void) /* clear out existing connection data */ if (client.ctx->sock_fd > -1) { - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); } client.ctx->bootstrap_mode = true; @@ -754,7 +754,7 @@ void engine_bootstrap_finish(void) static int sm_bootstrap_trans_done(void) { /* close down context resources */ - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); /* reset security object instance */ client.ctx->sec_obj_inst = -1; @@ -930,7 +930,7 @@ static int sm_do_registration(void) /* clear out existing connection data */ if (client.ctx->sock_fd > -1) { - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); } client.ctx->bootstrap_mode = false; @@ -993,7 +993,7 @@ static int sm_registration_done(void) ret = lwm2m_engine_connection_resume(client.ctx); if (ret) { - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); /* perform full registration */ set_sm_state(ENGINE_DO_REGISTRATION); return ret; @@ -1006,7 +1006,7 @@ static int sm_registration_done(void) set_sm_state(ENGINE_UPDATE_SENT); } else { LOG_ERR("Registration update err: %d", ret); - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); /* perform full registration */ set_sm_state(ENGINE_DO_REGISTRATION); } @@ -1073,7 +1073,7 @@ static int sm_do_deregister(void) cleanup: lwm2m_reset_message(msg, true); close_ctx: - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); set_sm_state(ENGINE_DEREGISTERED); return ret; } @@ -1102,7 +1102,7 @@ static void lwm2m_rd_client_service(struct k_work *work) switch (get_sm_state()) { case ENGINE_IDLE: if (client.ctx->sock_fd > -1) { - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); } break; @@ -1157,7 +1157,7 @@ static void lwm2m_rd_client_service(struct k_work *work) break; case ENGINE_DEREGISTERED: - lwm2m_engine_context_close(client.ctx); + lwm2m_engine_stop(client.ctx); set_sm_state(ENGINE_IDLE); break; From 049ddd4865381287e374c423a0873c7ec01f9d04 Mon Sep 17 00:00:00 2001 From: Andreas Chmielewski Date: Tue, 21 Jun 2022 11:47:59 +0200 Subject: [PATCH 040/501] [nrf fromtree] net: lwm2m: Try to reuse registration in case of a network error For most of the times it is not necessary to do a full registration once a connection is established after a network error. This is in particular not needed if lifetime is not yet expired and the server does not refuse a registration update. Signed-off-by: Andreas Chmielewski (cherry picked from commit 0c6bf35d0395b205ece3e5285b3fea3eba6d86d1) --- .../api/images/lwm2m_engine_state_machine.png | Bin 110577 -> 139424 bytes subsys/net/lib/lwm2m/lwm2m_rd_client.c | 121 +++++++++++++----- 2 files changed, 88 insertions(+), 33 deletions(-) diff --git a/doc/connectivity/networking/api/images/lwm2m_engine_state_machine.png b/doc/connectivity/networking/api/images/lwm2m_engine_state_machine.png index b219717d9b15f3a99079f8dc808188138a36670f..92c844a5549ec4def374c678da3e54e6682a7dda 100644 GIT binary patch literal 139424 zcmeFYiCWo4;lX|riLq~^P+=k9)fpYQW0ynT*%Je;%7-fORQt+lST+7L`3Oq?)t zf`Ng-#J~U?-N3-a(!ju|*W3(Ti8$f!41O7^=mf06se1c&1_m~h)%Y;AR2L(X@C}?{ ze!tJ0Js?7vO6?58IeU0;<#P9E5m%t(N>%Q0d^NZPzL(0PMKL0N^zVB-ARZoW5VRWv z76OGi!+bqZ-~$SAMA~uSWAVA|9BFhcgThWc(jt zf?MLaV2Zzl91P^+_Mf+k{v%Yl2MUehqEK#J54eXL+5?SpL-IY)ZWvxPnims|@ZckV zy$Xg$F`?0XqymZ8z@cGkc7RqBEnzu(U}0QXRJ_oER5{Q?C+Apy}*cts#PBrq{Zn~3({`uT$IB?*|A02~Dq6U6dB6XIxi8b^r6 zaYJanG%QVwi-BQ-I2fG>sgUz{!G3CwXrkN$hLeH8A;Cm{o>WO!qp$+1f(^zJB0{7h z4Kg$;hzEtrgiJ;hGDgFvVxVeNY#bykI!5Xn7f6XkM9I-4hz29l@rVi!Q6NDV42JU! zQ0qcS2sIZjCSnj|BqqiWlgNqZ#e(m`cpm;}j+Dh@xcsmF;<|1DEO>^#AqfjfD=syGsQ-eDI|XgHUu9VM!^%Je8~c6G*w8I@B?FG zC3|^h6#FN!XihmT7?;+6g z=m`M?5rrm03geOFFajRI5#rcTbuc43o*a_EVv1sj3gKR17m9h9(RJAb?dURCGB+6DH%Rw943cvOt7pGh!s* zd2V2sjwi(g07c~sXi^P@DfbW|AaE5H0iH|H5SeNsgGZA1X_zvJQY023$T}zz&I;nw zbbh{EG>J$P0vNyw1JI;kh>RZ-M+_yhMYKQ#gCBr`#>2@Rl9WT^$e1L&KbI~=tEtHN zI0%Z7Ae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Mc!9}%Or3(OUF5H|i5YaB|d?Xpu zV>47IkmJsHpDXP-4Z;zdKwkMKxU3O>*m?{qsJ#K_$_Iq^e2YXaNkV=BxXJlI0em&x zL=6VxuL<#m?LN2k_q6LkkC~o;NOQ6E7+#k6lo_GE2rc7 z9p#1ASy>#x=Ge0JD_56RmAeG zSxpYa*-n}F&KW@FK=09`N7`B**mYCDg)OX<{{JL`eSpUcplE&pwM=JLEV=v6<==@n zBYckAtzjYuuA2&N1E<@P;TOP*v?&j7-_X0Mb={!Y;x*U*pb%8Jk6Y9OX#C?J5&`Uu z#r9E;4pAYYKG7j`O_AVO3D@+FW#HzcCQJj|wG3Gwc*Ud{Nugn0*6X!Og`$`iqS~42 z61iyt_&NQ(O?OBhS&PYrpJQa@Dl)Bbdp)v9NPnJ3Y;XHFsRP@bhZme$mWu`|$g<^V z5sA(s{%95>hKc7|c*V>%eqIT6A@9P`>4**P1WyGOxvO!LWW=#dg{|oRJk!E?x&|uI z5%iR=auP6Pb!xEFWa38~sm1RzkvvpppMG{)mGm5_Nr*8Ll`w~-A7mT;8mS2$B!Tuf z&4xZtjIxck2hPCt-&B(#kF97wRGArt<7a-U)#);n8oawm9V*gf((Io!crU-RFzO(I z_7|Lnw4T%nSAY=#>U>D_A8LT;7xZ|EPIh!i#3mbt&_R(V#%$JB%Sc*o^v;?*ii~}V zwZ3Mwf1^&J`)`^AcBdc}9R3{ft|fltvzi|hnKe!N$KA9+fBAW`{+&6S7|N#9E(TT6 zQfXAVcFczLvr}I=dz0~&AGiaC?_&%WhP0_9@BcG0I<1L6L_;6r)7fV@uMoi>O;v4` JB8*ko{{dhS#Wer` diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 3864d212301..4f3717b7794 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -93,6 +93,7 @@ enum sm_engine_state { ENGINE_REGISTRATION_SENT, ENGINE_REGISTRATION_DONE, ENGINE_REGISTRATION_DONE_RX_OFF, + ENGINE_UPDATE_REGISTRATION, ENGINE_UPDATE_SENT, ENGINE_SUSPENDED, ENGINE_DEREGISTER, @@ -183,7 +184,7 @@ static void set_sm_state(uint8_t sm_state) client.engine_state <= ENGINE_DEREGISTER_SENT)) { event = LWM2M_RD_CLIENT_EVENT_DISCONNECT; } else if (sm_state == ENGINE_NETWORK_ERROR) { - lwm2m_engine_stop(client.ctx); + lwm2m_socket_close(client.ctx); client.retry_delay = 1 << client.retries; client.retries++; if (client.retries > CONFIG_LWM2M_RD_CLIENT_MAX_RETRIES) { @@ -209,6 +210,16 @@ static void set_sm_state(uint8_t sm_state) } } +static bool sm_is_bootstrap(void) +{ +#if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) + return (client.engine_state >= ENGINE_DO_BOOTSTRAP_REG && + client.engine_state <= ENGINE_BOOTSTRAP_TRANS_DONE); +#else + return false; +#endif +} + static bool sm_is_registered(void) { return (client.engine_state >= ENGINE_REGISTRATION_DONE && @@ -281,15 +292,15 @@ static void socket_fault_cb(int error) { LOG_ERR("RD Client socket error: %d", error); - lwm2m_engine_stop(client.ctx); + if (sm_is_bootstrap()) { + client.ctx->sec_obj_inst = -1; + /* force full registration */ + client.last_update = 0; + } - client.ctx->sec_obj_inst = -1; + lwm2m_socket_close(client.ctx); - /* Jump directly to the registration phase. In case there is no valid - * security object for the LWM2M server, it will fall back to the - * bootstrap procedure. - */ - set_sm_state(ENGINE_DO_REGISTRATION); + set_sm_state(ENGINE_NETWORK_ERROR); } /* force re-update with remote peer */ @@ -977,7 +988,6 @@ static int sm_do_registration(void) static int sm_registration_done(void) { int ret = 0; - bool update_objects; /* * check for lifetime seconds - SECONDS_TO_UPDATE_EARLY @@ -987,29 +997,7 @@ static int sm_registration_done(void) (client.trigger_update || ((client.lifetime - SECONDS_TO_UPDATE_EARLY) <= (k_uptime_get() - client.last_update) / 1000))) { - update_objects = client.update_objects; - client.trigger_update = false; - client.update_objects = false; - - ret = lwm2m_engine_connection_resume(client.ctx); - if (ret) { - lwm2m_engine_stop(client.ctx); - /* perform full registration */ - set_sm_state(ENGINE_DO_REGISTRATION); - return ret; - } - - ret = sm_send_registration(update_objects, - do_update_reply_cb, - do_update_timeout_cb); - if (!ret) { - set_sm_state(ENGINE_UPDATE_SENT); - } else { - LOG_ERR("Registration update err: %d", ret); - lwm2m_engine_stop(client.ctx); - /* perform full registration */ - set_sm_state(ENGINE_DO_REGISTRATION); - } + set_sm_state(ENGINE_UPDATE_REGISTRATION); } if (IS_ENABLED(CONFIG_LWM2M_QUEUE_MODE_ENABLED) && @@ -1022,6 +1010,50 @@ static int sm_registration_done(void) return ret; } +static int update_registration(void) +{ + int ret; + bool update_objects; + + update_objects = client.update_objects; + client.trigger_update = false; + client.update_objects = false; + + ret = lwm2m_engine_connection_resume(client.ctx); + if (ret) { + return ret; + } + + ret = sm_send_registration(update_objects, + do_update_reply_cb, + do_update_timeout_cb); + if (ret) { + LOG_ERR("Registration update err: %d", ret); + return ret; + } + + return 0; +} + +static int sm_update_registration(void) +{ + int ret; + + ret = update_registration(); + if (ret) { + LOG_ERR("Failed to update registration. Falling back to full registration"); + + lwm2m_engine_stop(client.ctx); + /* perform full registration */ + set_sm_state(ENGINE_DO_REGISTRATION); + return ret; + } + + set_sm_state(ENGINE_UPDATE_SENT); + + return 0; +} + static int sm_do_deregister(void) { struct lwm2m_message *msg; @@ -1080,6 +1112,8 @@ static int sm_do_deregister(void) static void sm_do_network_error(void) { + int err; + if (--client.retry_delay > 0) { return; } @@ -1091,7 +1125,24 @@ static void sm_do_network_error(void) } #endif - set_sm_state(ENGINE_DO_REGISTRATION); + if (!client.last_update || (k_uptime_get() - client.last_update) / 1000 > client.lifetime) { + /* do full registration as there is no active registration or lifetime exceeded */ + set_sm_state(ENGINE_DO_REGISTRATION); + return; + } + + err = lwm2m_socket_start(client.ctx); + if (err) { + LOG_ERR("Failed to start socket %d", err); + /* + * keep this state until lifetime/retry count exceeds. Renew + * sm state to set retry_delay etc ... + */ + set_sm_state(ENGINE_NETWORK_ERROR); + return; + } + + set_sm_state(ENGINE_UPDATE_REGISTRATION); } static void lwm2m_rd_client_service(struct k_work *work) @@ -1144,6 +1195,10 @@ static void lwm2m_rd_client_service(struct k_work *work) sm_registration_done(); break; + case ENGINE_UPDATE_REGISTRATION: + sm_update_registration(); + break; + case ENGINE_UPDATE_SENT: /* wait update to be done or abort */ break; From de407aa23b3fb98b2230de82ebf5e57a5a0f5cc9 Mon Sep 17 00:00:00 2001 From: Nahal Farhi Date: Wed, 2 Mar 2022 19:40:10 -0800 Subject: [PATCH 041/501] [nrf fromtree] fs: fat_fs: Changing mkfs options to create FAT32 on larger storage Changing mkfs options from FM_FAT to FM_ANY so that on larger storage FAT32 instead of FAT16 is automatically created. Signed-off-by: Nahal Farhi (cherry picked from commit d98c6cc6233656bb0532d0ed6982c1a5f43cc27c) --- subsys/fs/fat_fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/fs/fat_fs.c b/subsys/fs/fat_fs.c index 41ab9b3bbb4..67ee297c697 100644 --- a/subsys/fs/fat_fs.c +++ b/subsys/fs/fat_fs.c @@ -426,7 +426,7 @@ static int fatfs_mount(struct fs_mount_t *mountp) (mountp->flags & FS_MOUNT_FLAG_NO_FORMAT) == 0) { uint8_t work[FF_MAX_SS]; MKFS_PARM mkfs_opt = { - .fmt = FM_FAT | FM_SFD, /* Any suitable FAT */ + .fmt = FM_ANY | FM_SFD, /* Any suitable FAT */ .n_fat = 1, /* One FAT fs table */ .align = 0, /* Get sector size via diskio query */ .n_root = CONFIG_FS_FATFS_MAX_ROOT_ENTRIES, From 7d6313cd6163f4dc1fc04da24bfdfc1b97e708a3 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Wed, 10 Aug 2022 14:08:25 +0200 Subject: [PATCH 042/501] [nrf fromtree] bluetooth: gatt: Fix value returned by db_hash_commit Change fixes value returned by db_hash_commit. Returning positive value leads to settings load failure. Signed-off-by: Marek Pieta (cherry picked from commit 1cbaed0e331757f0ac31493e02f412ae0d9e5b74) --- subsys/bluetooth/host/gatt.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index eacb520bae2..fd9861f8e3f 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -5826,16 +5826,28 @@ static int db_hash_set(const char *name, size_t len_rd, static int db_hash_commit(void) { + int err; + atomic_set_bit(gatt_sc.flags, DB_HASH_LOAD); /* Reschedule work to calculate and compare against the Hash value * loaded from flash. */ if (IS_ENABLED(CONFIG_BT_LONG_WQ)) { - return bt_long_wq_reschedule(&db_hash.work, K_NO_WAIT); + err = bt_long_wq_reschedule(&db_hash.work, K_NO_WAIT); } else { - return k_work_reschedule(&db_hash.work, K_NO_WAIT); + err = k_work_reschedule(&db_hash.work, K_NO_WAIT); + } + + /* Settings commit uses non-zero value to indicate failure. */ + if (err > 0) { + err = 0; } + if (err) { + BT_ERR("Unable to reschedule database hash process (err %d)", err); + } + + return err; } SETTINGS_STATIC_HANDLER_DEFINE(bt_hash, "bt/hash", NULL, db_hash_set, From 053c9f6eecfb445b0419af92dbbf97b660237494 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 11 Aug 2022 11:59:32 +0200 Subject: [PATCH 043/501] [nrf fromtree] doc: kconfig: add option to select number of results per page When searching for a certain group of Kconfig options, e.g. CONFIG_BT* it may be useful to view more than 10 options at the same time. This patch adds a new combo box that allows to increase the number of results per page (10, 25 or 50). Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 9ea97a842b1e91645d05a58bad2412aaf706f8c2) --- .../zephyr/kconfig/static/kconfig.css | 18 +++++- .../zephyr/kconfig/static/kconfig.mjs | 63 +++++++++++++++---- 2 files changed, 68 insertions(+), 13 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/static/kconfig.css b/doc/_extensions/zephyr/kconfig/static/kconfig.css index 1d78c2ef45a..f5a1d165307 100644 --- a/doc/_extensions/zephyr/kconfig/static/kconfig.css +++ b/doc/_extensions/zephyr/kconfig/static/kconfig.css @@ -15,10 +15,26 @@ width: 100%; } -#__kconfig-search .search-summary { +#__kconfig-search select { + border-radius: 5px; + border: 1px solid rgba(149, 157, 165, 0.2); + box-shadow: unset; +} + +#__kconfig-search .search-tools { + display: flex; + flex-direction: row; margin: 0.25rem 0.1rem 1.5rem; } +#__kconfig-search .results-per-page-container { + margin-left: auto; +} + +#__kconfig-search .results-per-page-title { + padding-right: 1rem; +} + #__kconfig-search .search-nav { display: flex; justify-content: center; diff --git a/doc/_extensions/zephyr/kconfig/static/kconfig.mjs b/doc/_extensions/zephyr/kconfig/static/kconfig.mjs index 7c1d7df5985..0875d52b729 100644 --- a/doc/_extensions/zephyr/kconfig/static/kconfig.mjs +++ b/doc/_extensions/zephyr/kconfig/static/kconfig.mjs @@ -4,14 +4,16 @@ */ const DB_FILE = 'kconfig.json'; -const MAX_RESULTS = 10; +const RESULTS_PER_PAGE_OPTIONS = [10, 25, 50]; /* search state */ let db; let searchOffset; +let maxResults = RESULTS_PER_PAGE_OPTIONS[0]; /* elements */ let input; +let searchTools; let summaryText; let results; let navigation; @@ -282,9 +284,9 @@ function doSearch() { /* nothing to search for */ if (!input.value) { - summaryText.nodeValue = ''; results.replaceChildren(); navigation.style.visibility = 'hidden'; + searchTools.style.visibility = 'hidden'; return; } @@ -307,7 +309,7 @@ function doSearch() { if (matches === regexes.length) { count++; - if (count > searchOffset && count <= (searchOffset + MAX_RESULTS)) { + if (count > searchOffset && count <= (searchOffset + maxResults)) { return true; } } @@ -315,16 +317,17 @@ function doSearch() { return false; }); - /* show results count */ + /* show results count and search tools */ summaryText.nodeValue = `${count} options match your search.`; + searchTools.style.visibility = 'visible'; /* update navigation */ navigation.style.visibility = 'visible'; - navigationPrev.disabled = searchOffset - MAX_RESULTS < 0; - navigationNext.disabled = searchOffset + MAX_RESULTS > count; + navigationPrev.disabled = searchOffset - maxResults < 0; + navigationNext.disabled = searchOffset + maxResults > count; - const currentPage = Math.floor(searchOffset / MAX_RESULTS) + 1; - const totalPages = Math.floor(count / MAX_RESULTS) + 1; + const currentPage = Math.floor(searchOffset / maxResults) + 1; + const totalPages = Math.floor(count / maxResults) + 1; navigationPagesText.nodeValue = `Page ${currentPage} of ${totalPages}`; /* render Kconfig entries */ @@ -362,14 +365,50 @@ function setupKconfigSearch() { input.type = 'text'; container.appendChild(input); + /* create search tools container */ + searchTools = document.createElement('div'); + searchTools.className = 'search-tools'; + searchTools.style.visibility = 'hidden'; + container.appendChild(searchTools); + /* create search summary */ + const searchSummaryContainer = document.createElement('div'); + searchTools.appendChild(searchSummaryContainer); + const searchSummary = document.createElement('p'); - searchSummary.className = 'search-summary'; - container.appendChild(searchSummary); + searchSummaryContainer.appendChild(searchSummary); summaryText = document.createTextNode(''); searchSummary.appendChild(summaryText); + /* create results per page selector */ + const resultsPerPageContainer = document.createElement('div'); + resultsPerPageContainer.className = 'results-per-page-container'; + searchTools.appendChild(resultsPerPageContainer); + + const resultsPerPageTitle = document.createElement('span'); + resultsPerPageTitle.className = 'results-per-page-title'; + resultsPerPageContainer.appendChild(resultsPerPageTitle); + + const resultsPerPageTitleText = document.createTextNode('Results per page:'); + resultsPerPageTitle.appendChild(resultsPerPageTitleText); + + const resultsPerPageSelect = document.createElement('select'); + resultsPerPageSelect.onchange = (event) => { + maxResults = parseInt(event.target.value); + searchOffset = 0; + doSearch(); + } + resultsPerPageContainer.appendChild(resultsPerPageSelect); + + RESULTS_PER_PAGE_OPTIONS.forEach((value, index) => { + const option = document.createElement('option'); + option.value = value; + option.text = value; + option.selected = index === 0; + resultsPerPageSelect.appendChild(option); + }); + /* create search results container */ results = document.createElement('div'); container.appendChild(results); @@ -384,7 +423,7 @@ function setupKconfigSearch() { navigationPrev.className = 'btn'; navigationPrev.disabled = true; navigationPrev.onclick = () => { - searchOffset -= MAX_RESULTS; + searchOffset -= maxResults; doSearch(); window.scroll(0, 0); } @@ -403,7 +442,7 @@ function setupKconfigSearch() { navigationNext.className = 'btn'; navigationNext.disabled = true; navigationNext.onclick = () => { - searchOffset += MAX_RESULTS; + searchOffset += maxResults; doSearch(); window.scroll(0, 0); } From f7485eb5471a157f07286d4fa2dfa3a598f8c5f1 Mon Sep 17 00:00:00 2001 From: Juha Heiskanen Date: Tue, 9 Aug 2022 13:37:10 +0300 Subject: [PATCH 044/501] [nrf fromtree] net: lwm2m: Fix Queued data buffer send at wakeup from idle Queue mode without TLS cache was loosing buffered messages at wake-up process from idle state. Now client context linked list are initialized at rd client start process only 1 time. Signed-off-by: Juha Heiskanen (cherry picked from commit d12a4236798c2a9724926e986e4d4a8d72d669a0) --- subsys/net/lib/lwm2m/lwm2m_engine.c | 1 - subsys/net/lib/lwm2m/lwm2m_rd_client.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index c81db1f5e79..ab2b12d60f1 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -936,7 +936,6 @@ int lwm2m_engine_start(struct lwm2m_ctx *client_ctx) return ret; } - lwm2m_engine_context_init(client_ctx); return lwm2m_socket_start(client_ctx); } diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 4f3717b7794..6aa4658a23e 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -1252,6 +1252,9 @@ int lwm2m_rd_client_start(struct lwm2m_ctx *client_ctx, const char *ep_name, return -EINPROGRESS; } + /* Init Context */ + lwm2m_engine_context_init(client_ctx); + client.ctx = client_ctx; client.ctx->sock_fd = -1; client.ctx->fault_cb = socket_fault_cb; From 3509cf90d0a1ef6287dcf623a686bea19eb342a3 Mon Sep 17 00:00:00 2001 From: Juha Heiskanen Date: Tue, 9 Aug 2022 13:42:07 +0300 Subject: [PATCH 045/501] [nrf fromtree] net: lwm2m: Fix Update registration issue Client Registration update process may be reject by server and this commit fix a case that it will jump to new state which send registration message. Earlier RD client try allocate message before only possible one was released. Signed-off-by: Juha Heiskanen (cherry picked from commit 3f8403ba1955df844b7f89cb8f861de77d897c4a) --- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 97 +++++++++++++++----------- 1 file changed, 57 insertions(+), 40 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 6aa4658a23e..130c9d69e08 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -73,6 +73,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define CLIENT_QUEUE_LEN sizeof("Q") static void sm_handle_registration_update_failure(void); +static int sm_send_registration_msg(void); /* The states for the RD client state machine */ /* @@ -90,6 +91,7 @@ enum sm_engine_state { ENGINE_BOOTSTRAP_TRANS_DONE, #endif ENGINE_DO_REGISTRATION, + ENGINE_SEND_REGISTRATION, ENGINE_REGISTRATION_SENT, ENGINE_REGISTRATION_DONE, ENGINE_REGISTRATION_DONE_RX_OFF, @@ -921,67 +923,77 @@ static int sm_send_registration(bool send_obj_support_data, } static void sm_handle_registration_update_failure(void) +{ + LOG_WRN("Registration Update fail -> trigger full registration"); + client.engine_state = ENGINE_SEND_REGISTRATION; +} + +static int sm_send_registration_msg(void) { int ret; - LOG_WRN("Registration Update fail -> trigger full registration"); - client.engine_state = ENGINE_DO_REGISTRATION; - ret = sm_send_registration(true, do_registration_reply_cb, do_registration_timeout_cb); + ret = sm_send_registration(true, + do_registration_reply_cb, + do_registration_timeout_cb); if (!ret) { set_sm_state(ENGINE_REGISTRATION_SENT); } else { LOG_ERR("Registration err: %d", ret); set_sm_state(ENGINE_NETWORK_ERROR); } + + return ret; } static int sm_do_registration(void) { int ret = 0; - /* clear out existing connection data */ - if (client.ctx->sock_fd > -1) { - lwm2m_engine_stop(client.ctx); - } + if (client.ctx->connection_suspended) { + if (lwm2m_engine_connection_resume(client.ctx)) { + lwm2m_engine_context_close(client.ctx); + /* perform full registration */ + set_sm_state(ENGINE_DO_REGISTRATION); + return 0; + } - client.ctx->bootstrap_mode = false; - ret = sm_select_security_inst(client.ctx->bootstrap_mode, - &client.ctx->sec_obj_inst); - if (ret < 0) { - LOG_ERR("Unable to find a valid security instance."); - set_sm_state(ENGINE_INIT); - return -EINVAL; - } + } else { + /* clear out existing connection data */ + if (client.ctx->sock_fd > -1) { + lwm2m_engine_context_close(client.ctx); + } - ret = sm_select_server_inst(client.ctx->sec_obj_inst, - &client.ctx->srv_obj_inst, - &client.lifetime); - if (ret < 0) { - LOG_ERR("Unable to find a valid server instance."); - set_sm_state(ENGINE_INIT); - return -EINVAL; - } + client.ctx->bootstrap_mode = false; + ret = sm_select_security_inst(client.ctx->bootstrap_mode, + &client.ctx->sec_obj_inst); + if (ret < 0) { + LOG_ERR("Unable to find a valid security instance."); + set_sm_state(ENGINE_INIT); + return -EINVAL; + } - LOG_INF("RD Client started with endpoint '%s' with client lifetime %d", - client.ep_name, client.lifetime); + ret = sm_select_server_inst(client.ctx->sec_obj_inst, + &client.ctx->srv_obj_inst, + &client.lifetime); + if (ret < 0) { + LOG_ERR("Unable to find a valid server instance."); + set_sm_state(ENGINE_INIT); + return -EINVAL; + } - ret = lwm2m_engine_start(client.ctx); - if (ret < 0) { - LOG_ERR("Cannot init LWM2M engine (%d)", ret); - set_sm_state(ENGINE_NETWORK_ERROR); - return ret; - } + LOG_INF("RD Client started with endpoint '%s' with client lifetime %d", + client.ep_name, client.lifetime); - ret = sm_send_registration(true, - do_registration_reply_cb, - do_registration_timeout_cb); - if (!ret) { - set_sm_state(ENGINE_REGISTRATION_SENT); - } else { - LOG_ERR("Registration err: %d", ret); - set_sm_state(ENGINE_NETWORK_ERROR); + ret = lwm2m_engine_start(client.ctx); + if (ret < 0) { + LOG_ERR("Cannot init LWM2M engine (%d)", ret); + set_sm_state(ENGINE_NETWORK_ERROR); + return ret; + } } + ret = sm_send_registration_msg(); + return ret; } @@ -1186,6 +1198,10 @@ static void lwm2m_rd_client_service(struct k_work *work) sm_do_registration(); break; + case ENGINE_SEND_REGISTRATION: + sm_send_registration_msg(); + break; + case ENGINE_REGISTRATION_SENT: /* wait registration to be done or timeout */ break; @@ -1396,13 +1412,14 @@ int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx) */ if (IS_ENABLED(CONFIG_LWM2M_TLS_SESSION_CACHING)) { client.engine_state = ENGINE_REGISTRATION_DONE; + client.trigger_update = true; } else { client.engine_state = ENGINE_DO_REGISTRATION; } #else client.engine_state = ENGINE_REGISTRATION_DONE; -#endif client.trigger_update = true; +#endif } return 0; From e807e4745725cc5a13ed245a7e00f90b0788c39b Mon Sep 17 00:00:00 2001 From: Juha Heiskanen Date: Tue, 9 Aug 2022 13:45:56 +0300 Subject: [PATCH 046/501] [nrf fromlist] net: lwm2m: Fix to Queue update process triggering Fix that broken Queue client for stop looping "ENGINE_REGISTRATION_DONE_RX_OFF" state. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/48870 Signed-off-by: Juha Heiskanen (cherry picked from commit 7b357dd1e2d690f73b9c857a50be9c55e4916553) --- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 130c9d69e08..0ba5429ae29 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -1010,9 +1010,7 @@ static int sm_registration_done(void) ((client.lifetime - SECONDS_TO_UPDATE_EARLY) <= (k_uptime_get() - client.last_update) / 1000))) { set_sm_state(ENGINE_UPDATE_REGISTRATION); - } - - if (IS_ENABLED(CONFIG_LWM2M_QUEUE_MODE_ENABLED) && + } else if (IS_ENABLED(CONFIG_LWM2M_QUEUE_MODE_ENABLED) && (client.engine_state != ENGINE_REGISTRATION_DONE_RX_OFF) && (((k_uptime_get() - client.last_tx) / 1000) >= CONFIG_LWM2M_QUEUE_MODE_UPTIME)) { From e04e60266991ca63acd4d599e3e310b8678f3761 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Fri, 22 Jul 2022 01:36:19 +0900 Subject: [PATCH 047/501] [nrf fromtree] boards: Configure I2C/SPI default for boards with accelerometer For boards with an accelerometer, configure the appropriate bus (I2C or SPI) default to be enabled if the sensor driver class was enabled. This change makes no need to add a bunch of board-specific configuration overlays to the application. Signed-off-by: TOKITA Hiroshi (cherry picked from commit fb1bea437bd736eb0c5d8253699af7a4bc89ca86) --- boards/arm/96b_argonkey/Kconfig.defconfig | 10 ++++++++++ boards/arm/96b_wistrio/Kconfig.defconfig | 3 +++ boards/arm/actinius_icarus/Kconfig.defconfig | 7 +++++++ boards/arm/actinius_icarus_bee/Kconfig.defconfig | 7 +++++++ boards/arm/actinius_icarus_som/Kconfig.defconfig | 7 +++++++ boards/arm/b_l4s5i_iot01a/Kconfig.defconfig | 7 +++++++ .../blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig | 3 +++ boards/arm/bt510/Kconfig.defconfig | 3 +++ boards/arm/cc1352r_sensortag/Kconfig.defconfig | 3 +++ .../arm/circuitdojo_feather_nrf9160/Kconfig.defconfig | 7 +++++++ boards/arm/decawave_dwm1001_dev/Kconfig.defconfig | 3 +++ boards/arm/disco_l475_iot1/Kconfig.defconfig | 7 +++++++ boards/arm/frdm_kl25z/Kconfig.defconfig | 7 +++++++ boards/arm/lpcxpresso55s28/Kconfig.defconfig | 7 +++++++ boards/arm/lpcxpresso55s69/Kconfig.defconfig | 7 +++++++ boards/arm/nrf9160_innblue21/Kconfig.defconfig | 3 +++ boards/arm/nrf9160_innblue22/Kconfig.defconfig | 3 +++ boards/arm/rak5010_nrf52840/Kconfig.defconfig | 3 +++ .../arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig | 7 +++++++ boards/arm/stm32l562e_dk/Kconfig.defconfig | 7 +++++++ boards/shields/boostxl_ulpsense/Kconfig.defconfig | 10 ++++++++++ boards/shields/x_nucleo_iks01a2/Kconfig.defconfig | 10 ++++++++++ boards/shields/x_nucleo_iks02a1/Kconfig.defconfig | 7 +++++++ 23 files changed, 138 insertions(+) create mode 100644 boards/shields/boostxl_ulpsense/Kconfig.defconfig create mode 100644 boards/shields/x_nucleo_iks01a2/Kconfig.defconfig diff --git a/boards/arm/96b_argonkey/Kconfig.defconfig b/boards/arm/96b_argonkey/Kconfig.defconfig index e9c35748996..1a34fcd375d 100644 --- a/boards/arm/96b_argonkey/Kconfig.defconfig +++ b/boards/arm/96b_argonkey/Kconfig.defconfig @@ -40,4 +40,14 @@ endchoice endif # LSM6DSL +if SENSOR + +config I2C + default y + +config SPI + default y + +endif # SENSOR + endif # BOARD_96B_ARGONKEY diff --git a/boards/arm/96b_wistrio/Kconfig.defconfig b/boards/arm/96b_wistrio/Kconfig.defconfig index 0bb9b83220d..0cf2f9c74b5 100644 --- a/boards/arm/96b_wistrio/Kconfig.defconfig +++ b/boards/arm/96b_wistrio/Kconfig.defconfig @@ -11,4 +11,7 @@ config BOARD config REGULATOR default y if LORA +config I2C + default y if SENSOR + endif # BOARD_96B_WISTRIO diff --git a/boards/arm/actinius_icarus/Kconfig.defconfig b/boards/arm/actinius_icarus/Kconfig.defconfig index 9d81e1a511a..a202839ac2c 100644 --- a/boards/arm/actinius_icarus/Kconfig.defconfig +++ b/boards/arm/actinius_icarus/Kconfig.defconfig @@ -8,6 +8,13 @@ if BOARD_ACTINIUS_ICARUS || BOARD_ACTINIUS_ICARUS_NS config BOARD default "actinius_icarus" +if SENSOR + +config I2C + default y + +endif # SENSOR + # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/actinius_icarus_bee/Kconfig.defconfig b/boards/arm/actinius_icarus_bee/Kconfig.defconfig index 40900311774..01d5e9ca6da 100644 --- a/boards/arm/actinius_icarus_bee/Kconfig.defconfig +++ b/boards/arm/actinius_icarus_bee/Kconfig.defconfig @@ -8,6 +8,13 @@ if BOARD_ACTINIUS_ICARUS_BEE || BOARD_ACTINIUS_ICARUS_BEE_NS config BOARD default "actinius_icarus_bee" +if SENSOR + +config I2C + default y + +endif # SENSOR + # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/actinius_icarus_som/Kconfig.defconfig b/boards/arm/actinius_icarus_som/Kconfig.defconfig index 185d8f0758d..fa1eaf9363a 100644 --- a/boards/arm/actinius_icarus_som/Kconfig.defconfig +++ b/boards/arm/actinius_icarus_som/Kconfig.defconfig @@ -8,6 +8,13 @@ if BOARD_ACTINIUS_ICARUS_SOM || BOARD_ACTINIUS_ICARUS_SOM_NS config BOARD default "actinius_icarus_som" +if SENSOR + +config I2C + default y + +endif # SENSOR + # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig b/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig index c46e35d5fc3..b1ca1c3253e 100644 --- a/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig +++ b/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig @@ -25,6 +25,13 @@ choice LSM6DSL_TRIGGER_MODE depends on LSM6DSL endchoice +if SENSOR + +config I2C + default y + +endif # SENSOR + if BT config SPI diff --git a/boards/arm/blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig b/boards/arm/blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig index dd088779710..d1d96ca9fb0 100644 --- a/boards/arm/blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig +++ b/boards/arm/blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig @@ -11,4 +11,7 @@ config BOARD config BT_CTLR default BT +config I2C + default SENSOR + endif # BOARD_BLUECLOVER_PLT_DEMO_V2_NRF52832 diff --git a/boards/arm/bt510/Kconfig.defconfig b/boards/arm/bt510/Kconfig.defconfig index 576afb00df9..c32224b8dd7 100644 --- a/boards/arm/bt510/Kconfig.defconfig +++ b/boards/arm/bt510/Kconfig.defconfig @@ -15,4 +15,7 @@ config IEEE802154_NRF5 config BT_CTLR default BT +config I2C + default SENSOR + endif # BOARD_BT510 diff --git a/boards/arm/cc1352r_sensortag/Kconfig.defconfig b/boards/arm/cc1352r_sensortag/Kconfig.defconfig index 409dd174d27..41bf913bb99 100644 --- a/boards/arm/cc1352r_sensortag/Kconfig.defconfig +++ b/boards/arm/cc1352r_sensortag/Kconfig.defconfig @@ -9,4 +9,7 @@ if BOARD_CC1352R_SENSORTAG config BOARD default "cc1352r_sensortag" +config SPI + default SENSOR + endif # BOARD_CC1352R_SENSORTAG diff --git a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig index 73648be3ef1..40e77a236ca 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig +++ b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig @@ -9,6 +9,13 @@ if BOARD_CIRCUITDOJO_FEATHER_NRF9160 || BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS config BOARD default "circuitdojo_feather_nrf9160" +if SENSOR + +config I2C + default y + +endif # SENSOR + # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/decawave_dwm1001_dev/Kconfig.defconfig b/boards/arm/decawave_dwm1001_dev/Kconfig.defconfig index 0279de180ab..825b2d3acff 100644 --- a/boards/arm/decawave_dwm1001_dev/Kconfig.defconfig +++ b/boards/arm/decawave_dwm1001_dev/Kconfig.defconfig @@ -11,6 +11,9 @@ config BOARD config BT_CTLR default BT +config I2C + default SENSOR + config SPI default y depends on IEEE802154 diff --git a/boards/arm/disco_l475_iot1/Kconfig.defconfig b/boards/arm/disco_l475_iot1/Kconfig.defconfig index 6c614431b98..fbee69ba336 100644 --- a/boards/arm/disco_l475_iot1/Kconfig.defconfig +++ b/boards/arm/disco_l475_iot1/Kconfig.defconfig @@ -30,6 +30,13 @@ choice LSM6DSL_TRIGGER_MODE depends on LSM6DSL endchoice +if SENSOR + +config I2C + default y + +endif # SENSOR + if BT config SPI diff --git a/boards/arm/frdm_kl25z/Kconfig.defconfig b/boards/arm/frdm_kl25z/Kconfig.defconfig index c759787a219..b2c4c76fff7 100644 --- a/boards/arm/frdm_kl25z/Kconfig.defconfig +++ b/boards/arm/frdm_kl25z/Kconfig.defconfig @@ -23,6 +23,13 @@ config MCG_FRDIV config MCG_FCRDIV default 0 +if SENSOR + +config I2C + default y + +endif # SENSOR + if FXOS8700 choice FXOS8700_MODE diff --git a/boards/arm/lpcxpresso55s28/Kconfig.defconfig b/boards/arm/lpcxpresso55s28/Kconfig.defconfig index 62b78f42eec..1df703fc52b 100644 --- a/boards/arm/lpcxpresso55s28/Kconfig.defconfig +++ b/boards/arm/lpcxpresso55s28/Kconfig.defconfig @@ -8,6 +8,13 @@ if BOARD_LPCXPRESSO55S28 config BOARD default "lpcxpresso55S28" +if SENSOR + +config I2C + default y + +endif # SENSOR + if FXOS8700 choice FXOS8700_MODE diff --git a/boards/arm/lpcxpresso55s69/Kconfig.defconfig b/boards/arm/lpcxpresso55s69/Kconfig.defconfig index ff70c42bf43..3a62fec23cb 100644 --- a/boards/arm/lpcxpresso55s69/Kconfig.defconfig +++ b/boards/arm/lpcxpresso55s69/Kconfig.defconfig @@ -9,6 +9,13 @@ config BOARD default "lpcxpresso55S69_cpu0" if BOARD_LPCXPRESSO55S69_CPU0 default "lpcxpresso55S69_cpu1" if BOARD_LPCXPRESSO55S69_CPU1 +if SENSOR + +config I2C + default y + +endif # SENSOR + if FXOS8700 choice FXOS8700_MODE diff --git a/boards/arm/nrf9160_innblue21/Kconfig.defconfig b/boards/arm/nrf9160_innblue21/Kconfig.defconfig index 08d0409c9af..b397824cde3 100644 --- a/boards/arm/nrf9160_innblue21/Kconfig.defconfig +++ b/boards/arm/nrf9160_innblue21/Kconfig.defconfig @@ -45,4 +45,7 @@ config BT_HCI_VS config REGULATOR default y if SENSOR +config I2C + default y if SENSOR + endif # BOARD_NRF9160_INNBLUE21 || BOARD_NRF9160_INNBLUE21_NS diff --git a/boards/arm/nrf9160_innblue22/Kconfig.defconfig b/boards/arm/nrf9160_innblue22/Kconfig.defconfig index d50bdcc9d97..5e8b32e30a9 100644 --- a/boards/arm/nrf9160_innblue22/Kconfig.defconfig +++ b/boards/arm/nrf9160_innblue22/Kconfig.defconfig @@ -45,4 +45,7 @@ config BT_HCI_VS config REGULATOR default y if SENSOR +config I2C + default y if SENSOR + endif # BOARD_NRF9160_INNBLUE22 || BOARD_NRF9160_INNBLUE22_NS diff --git a/boards/arm/rak5010_nrf52840/Kconfig.defconfig b/boards/arm/rak5010_nrf52840/Kconfig.defconfig index 502e1d8b7f6..cea7af6facc 100644 --- a/boards/arm/rak5010_nrf52840/Kconfig.defconfig +++ b/boards/arm/rak5010_nrf52840/Kconfig.defconfig @@ -14,4 +14,7 @@ config MODEM_QUECTEL_BG9X config BT_CTLR default BT +config I2C + default SENSOR + endif # BOARD_RAK5010_NRF52840 diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig index 8ae5b832d89..824ad975cce 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig +++ b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig @@ -26,6 +26,13 @@ config FLASH_LOAD_SIZE default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) depends on BOARD_SPARKFUN_THING_PLUS_NRF9160 && TRUSTED_EXECUTION_SECURE +if SENSOR + +config I2C + default y + +endif # SENSOR + if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS config FLASH_LOAD_OFFSET diff --git a/boards/arm/stm32l562e_dk/Kconfig.defconfig b/boards/arm/stm32l562e_dk/Kconfig.defconfig index a5f146d51e2..650a8d7524e 100644 --- a/boards/arm/stm32l562e_dk/Kconfig.defconfig +++ b/boards/arm/stm32l562e_dk/Kconfig.defconfig @@ -13,6 +13,13 @@ choice STM32_LPTIM_CLOCK depends on STM32_LPTIM_TIMER endchoice +if SENSOR + +config I2C + default y + +endif # SENSOR + if BT config SPI diff --git a/boards/shields/boostxl_ulpsense/Kconfig.defconfig b/boards/shields/boostxl_ulpsense/Kconfig.defconfig new file mode 100644 index 00000000000..520ea7c896a --- /dev/null +++ b/boards/shields/boostxl_ulpsense/Kconfig.defconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2022 TOKITA Hiroshi +# +# SPDX-License-Identifier: Apache-2.0 + +if SHIELD_BOOSTXL_ULPSENSE + +config SPI + default y if SENSOR + +endif # SHIELD_BOOSTXL_ULPSENSE diff --git a/boards/shields/x_nucleo_iks01a2/Kconfig.defconfig b/boards/shields/x_nucleo_iks01a2/Kconfig.defconfig new file mode 100644 index 00000000000..006a8d64ecf --- /dev/null +++ b/boards/shields/x_nucleo_iks01a2/Kconfig.defconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2022 TOKITA Hiroshi +# +# SPDX-License-Identifier: Apache-2.0 + +if SHIELD_X_NUCLEO_IKS01A2 + +config I2C + default y if SENSOR + +endif # SHIELD_X_NUCLEO_IKS01A2 diff --git a/boards/shields/x_nucleo_iks02a1/Kconfig.defconfig b/boards/shields/x_nucleo_iks02a1/Kconfig.defconfig index 49309d9adff..ce1897f0a42 100644 --- a/boards/shields/x_nucleo_iks02a1/Kconfig.defconfig +++ b/boards/shields/x_nucleo_iks02a1/Kconfig.defconfig @@ -2,4 +2,11 @@ # # SPDX-License-Identifier: Apache-2.0 +if SHIELD_X_NUCLEO_IKS02A1 + +config I2C + default y if SENSOR + +endif # SHIELD_X_NUCLEO_IKS02A1 + rsource "boards/*.defconfig" From 1c41252cb3efe2cc4cc66a96e7766978633bd5e1 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Fri, 22 Jul 2022 08:09:41 +0900 Subject: [PATCH 048/501] [nrf fromtree] boards: Set devicetree alias for ST IIS2DLPC nodes Set accel0 alias for all boards with the IIS2DLPC accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit c3221c19c0c7d0a87980046811295fa3d8252b67) --- boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay | 8 +++++++- .../x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay index 782a7086119..c2c3700c234 100644 --- a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay +++ b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay @@ -13,9 +13,15 @@ * ISM330DHCX, IIS2MDC and IIS2DLPC sensors are accessible from the main board mcu. */ +/ { + aliases { + accel0 = &iis2dlpc; + }; +}; + &arduino_i2c { - iis2dlpc@19 { + iis2dlpc: iis2dlpc@19 { compatible = "st,iis2dlpc"; reg = <0x19>; drdy-gpios = <&arduino_header 4 GPIO_ACTIVE_HIGH>; /* A4 - INT2 */ diff --git a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay index 799ceeb12b0..ac33eeeea53 100644 --- a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay +++ b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay @@ -15,9 +15,15 @@ * declared in DTS file. */ +/ { + aliases { + accel0 = &iis2dlpc; + }; +}; + &arduino_i2c { - iis2dlpc@19 { + iis2dlpc: iis2dlpc@19 { compatible = "st,iis2dlpc"; reg = <0x19>; drdy-gpios = <&arduino_header 4 GPIO_ACTIVE_HIGH>; /* A4 - INT2 */ From 5cc24f9d95482ef27371a15f3815dd4ece4d9fdd Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Fri, 22 Jul 2022 00:53:34 +0900 Subject: [PATCH 049/501] [nrf fromtree] boards: Set devicetree alias for Analog Devices ADXL362 nodes Set accel0 alias for all boards with the ADXL362 accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 5f7ed1c751d71c51f8b4a565d81359ec3300aabd) --- boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts | 1 + boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 1 + boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts b/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts index 580071607b0..046fda77a3b 100644 --- a/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts +++ b/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts @@ -26,6 +26,7 @@ sensor0 = &sensor0; sensor1 = &sensor1; sensor2 = &sensor2; + accel0 = &sensor1; }; chosen { diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 4c0131e766e..295b1e982f4 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -116,6 +116,7 @@ pwm-led2 = &blue_led_pwm; magn0 = &bmm150; watchdog0 = &wdt0; + accel0 = &adxl362; }; }; diff --git a/boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay b/boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay index 058364c04c0..6a0684f6c52 100644 --- a/boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay +++ b/boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay @@ -4,9 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ +/ { + aliases { + accel0 = &adxl362; + }; +}; + &boosterpack_spi { - adxl362@0 { + adxl362: adxl362@0 { compatible = "adi,adxl362"; reg = <0>; spi-max-frequency = <8000000>; From f2bcdd2f1838efadc25e7897ce2c3f825a3312c9 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Fri, 22 Jul 2022 00:45:23 +0900 Subject: [PATCH 050/501] [nrf fromtree] boards: Set devicetree alias for NXP FXOS8700 and compatible nodes Set accel0 alias for all boards with the FXOS8700 and compatible accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 0c5432c369440a5cb3ae1acb31134300b7356dd8) --- boards/arm/bbc_microbit/bbc_microbit.dts | 3 ++- boards/arm/frdm_k22f/frdm_k22f.dts | 1 + boards/arm/frdm_k64f/frdm_k64f.dts | 1 + boards/arm/frdm_k82f/frdm_k82f.dts | 1 + boards/arm/frdm_kl25z/Kconfig.defconfig | 6 +----- boards/arm/frdm_kl25z/frdm_kl25z.dts | 3 ++- boards/arm/frdm_kw41z/frdm_kw41z.dts | 1 + boards/arm/hexiwear_k64/hexiwear_k64.dts | 1 + boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi | 1 + boards/arm/lpcxpresso55s28/Kconfig.defconfig | 6 +----- boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts | 1 + boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi | 3 ++- boards/arm/lpcxpresso55s69/Kconfig.defconfig | 6 +----- boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi | 2 +- boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts | 1 + boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts | 1 + boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts | 1 + boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts | 1 + boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi | 1 + boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi | 1 + boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts | 1 + boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts | 1 + boards/arm/reel_board/dts/reel_board.dtsi | 3 ++- boards/arm/twr_ke18f/twr_ke18f.dts | 1 + boards/arm/twr_kv58f220m/twr_kv58f220m.dts | 1 + boards/arm/warp7_m4/warp7_m4.dts | 1 + boards/riscv/rv32m1_vega/rv32m1_vega.dtsi | 1 + boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay | 1 + 28 files changed, 32 insertions(+), 20 deletions(-) diff --git a/boards/arm/bbc_microbit/bbc_microbit.dts b/boards/arm/bbc_microbit/bbc_microbit.dts index 2d547f8138e..52e90c220d2 100644 --- a/boards/arm/bbc_microbit/bbc_microbit.dts +++ b/boards/arm/bbc_microbit/bbc_microbit.dts @@ -17,6 +17,7 @@ sw0 = &buttonA; sw1 = &buttonB; magn0 = &lsm303agr_magn; + accel0 = &mma8653fc; watchdog0 = &wdt0; }; @@ -131,7 +132,7 @@ pinctrl-0 = <&i2c0_default>; pinctrl-1 = <&i2c0_sleep>; pinctrl-names = "default", "sleep"; - mma8653fc@1d { + mma8653fc: mma8653fc@1d { compatible = "nxp,fxos8700", "nxp,mma8653fc"; status = "okay"; reg = <0x1d>; diff --git a/boards/arm/frdm_k22f/frdm_k22f.dts b/boards/arm/frdm_k22f/frdm_k22f.dts index f55baaa4654..315b5b711dd 100644 --- a/boards/arm/frdm_k22f/frdm_k22f.dts +++ b/boards/arm/frdm_k22f/frdm_k22f.dts @@ -25,6 +25,7 @@ blue-pwm-led = &blue_pwm_led; red-pwm-led = &red_pwm_led; magn0 = &fxos8700; + accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/frdm_k64f/frdm_k64f.dts b/boards/arm/frdm_k64f/frdm_k64f.dts index 9d17402d8f0..34f628dc6f7 100644 --- a/boards/arm/frdm_k64f/frdm_k64f.dts +++ b/boards/arm/frdm_k64f/frdm_k64f.dts @@ -16,6 +16,7 @@ sw0 = &user_button_3; sw1 = &user_button_2; magn0 = &fxos8700; + accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/frdm_k82f/frdm_k82f.dts b/boards/arm/frdm_k82f/frdm_k82f.dts index 06ee17925dc..9e9ee38c2ae 100644 --- a/boards/arm/frdm_k82f/frdm_k82f.dts +++ b/boards/arm/frdm_k82f/frdm_k82f.dts @@ -25,6 +25,7 @@ sw0 = &user_button_0; sw1 = &user_button_1; magn0 = &fxos8700; + accel0 = &fxos8700; spi-flash0 = &mx25u32; }; diff --git a/boards/arm/frdm_kl25z/Kconfig.defconfig b/boards/arm/frdm_kl25z/Kconfig.defconfig index b2c4c76fff7..c35f63c04d8 100644 --- a/boards/arm/frdm_kl25z/Kconfig.defconfig +++ b/boards/arm/frdm_kl25z/Kconfig.defconfig @@ -23,12 +23,8 @@ config MCG_FRDIV config MCG_FCRDIV default 0 -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR if FXOS8700 diff --git a/boards/arm/frdm_kl25z/frdm_kl25z.dts b/boards/arm/frdm_kl25z/frdm_kl25z.dts index f15690d483c..e0f5c6c2f8e 100644 --- a/boards/arm/frdm_kl25z/frdm_kl25z.dts +++ b/boards/arm/frdm_kl25z/frdm_kl25z.dts @@ -15,6 +15,7 @@ led2 = &red_led; sw0 = &user_button_0; sw1 = &user_button_1; + accel0 = &mma8451q; }; chosen { @@ -102,7 +103,7 @@ pinctrl-0 = <&i2c0_default>; pinctrl-names = "default"; - mma8451q@1d { + mma8451q: mma8451q@1d { compatible = "nxp,fxos8700","nxp,mma8451q"; reg = <0x1d>; label = "MMA8451Q"; diff --git a/boards/arm/frdm_kw41z/frdm_kw41z.dts b/boards/arm/frdm_kw41z/frdm_kw41z.dts index 8a21f0bcddb..cc2ebbe9d3a 100644 --- a/boards/arm/frdm_kw41z/frdm_kw41z.dts +++ b/boards/arm/frdm_kw41z/frdm_kw41z.dts @@ -22,6 +22,7 @@ green-pwm-led = &green_pwm_led; red-pwm-led = &red_pwm_led; magn0 = &fxos8700; + accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/hexiwear_k64/hexiwear_k64.dts b/boards/arm/hexiwear_k64/hexiwear_k64.dts index b383cc757bc..87140dc9f40 100644 --- a/boards/arm/hexiwear_k64/hexiwear_k64.dts +++ b/boards/arm/hexiwear_k64/hexiwear_k64.dts @@ -19,6 +19,7 @@ green-pwm-led = &green_pwm_led; blue-pwm-led = &blue_pwm_led; magn0 = &fxos8700; + accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi b/boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi index 991c5144b9d..b01f3fc1284 100644 --- a/boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi +++ b/boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi @@ -26,6 +26,7 @@ sw2 = &btn_isp; usart-0 = &flexcomm0; magn0 = &fxos8700; + accel0 = &fxos8700; }; leds { diff --git a/boards/arm/lpcxpresso55s28/Kconfig.defconfig b/boards/arm/lpcxpresso55s28/Kconfig.defconfig index 1df703fc52b..bf144f06bb3 100644 --- a/boards/arm/lpcxpresso55s28/Kconfig.defconfig +++ b/boards/arm/lpcxpresso55s28/Kconfig.defconfig @@ -8,12 +8,8 @@ if BOARD_LPCXPRESSO55S28 config BOARD default "lpcxpresso55S28" -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR if FXOS8700 diff --git a/boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts b/boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts index 003b31a43e7..229e4996bf7 100644 --- a/boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts +++ b/boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts @@ -18,6 +18,7 @@ sw1 = &user_button_2; sw2 = &user_button_3; watchdog0 = &wwdt0; + accel0 = &mma8652fc; }; chosen { diff --git a/boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi b/boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi index 75d3589ad25..80399fe2ad3 100644 --- a/boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi +++ b/boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi @@ -13,6 +13,7 @@ led2 = &blue_led; spi-8 = &hs_lspi; usart-0 = &flexcomm0; + accel0 = &mma8652fc; }; leds { @@ -102,7 +103,7 @@ arduino_i2c: &flexcomm4 { pinctrl-0 = <&pinmux_flexcomm4_i2c>; pinctrl-names = "default"; - mma8652fc@1d { + mma8652fc: mma8652fc@1d { compatible = "nxp,fxos8700","nxp,mma8652fc"; reg = <0x1d>; label = "MMA8652FC"; diff --git a/boards/arm/lpcxpresso55s69/Kconfig.defconfig b/boards/arm/lpcxpresso55s69/Kconfig.defconfig index 3a62fec23cb..c40b16b719f 100644 --- a/boards/arm/lpcxpresso55s69/Kconfig.defconfig +++ b/boards/arm/lpcxpresso55s69/Kconfig.defconfig @@ -9,12 +9,8 @@ config BOARD default "lpcxpresso55S69_cpu0" if BOARD_LPCXPRESSO55S69_CPU0 default "lpcxpresso55S69_cpu1" if BOARD_LPCXPRESSO55S69_CPU1 -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR if FXOS8700 diff --git a/boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi b/boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi index f5eb0927844..4e876b92450 100644 --- a/boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi +++ b/boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi @@ -155,7 +155,7 @@ arduino_i2c: &flexcomm4 { #address-cells = <1>; #size-cells = <0>; - mma8652fc@1d { + mma8652fc: mma8652fc@1d { compatible = "nxp,fxos8700","nxp,mma8652fc"; reg = <0x1d>; label = "MMA8652FC"; diff --git a/boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts b/boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts index 8dda6e66c05..016a85a3246 100644 --- a/boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts +++ b/boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts @@ -28,6 +28,7 @@ pwm-led0 = &red_pwm_led; red-pwm-led = &red_pwm_led; sdhc0 = &sdhc0; + accel0 = &mma8652fc; }; chosen { diff --git a/boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts b/boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts index ad87af908f0..cdca9f26d5f 100644 --- a/boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts +++ b/boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts @@ -22,6 +22,7 @@ sw1 = &user_button_2; sw2 = &user_button_3; watchdog0 = &wwdt0; + accel0 = &mma8652fc; }; chosen { diff --git a/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts b/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts index 668a88be0f3..6f6ee90956b 100644 --- a/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts +++ b/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts @@ -18,6 +18,7 @@ sw0 = &user_button; watchdog0 = &wdog0; magn0 = &fxos8700; + accel0 = &fxos8700; sdhc0 = &usdhc1; }; diff --git a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts index 9eaaa61d924..248cf58f5af 100644 --- a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts +++ b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts @@ -19,6 +19,7 @@ kscan0 = &touch_controller; watchdog0 = &wdog0; magn0 = &fxos8700; + accel0 = &fxos8700; sdhc0 = &usdhc1; }; diff --git a/boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi b/boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi index dad7c59eb88..3849b426ff7 100644 --- a/boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi +++ b/boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi @@ -11,6 +11,7 @@ led0 = &green_led; sw0 = &user_button; magn0 = &fxos8700; + accel0 = &fxos8700; sdhc0 = &usdhc1; }; diff --git a/boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi b/boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi index a3b7e3e69bc..2a4e840d3a2 100644 --- a/boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi +++ b/boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi @@ -11,6 +11,7 @@ led0 = &green_led; sw0 = &user_button; magn0 = &fxos8700; + accel0 = &fxos8700; sdhc0 = &usdhc1; }; diff --git a/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts b/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts index c4c9424a55f..06b08bf49c5 100644 --- a/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts +++ b/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts @@ -23,6 +23,7 @@ usart-0 = &flexcomm0; watchdog0 = &wwdt0; magn0 = &fxos8700; + accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts b/boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts index b7f1a747b9f..7fa8532ea7b 100644 --- a/boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts +++ b/boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts @@ -31,6 +31,7 @@ red-pwm-led = &red_pwm_led; watchdog0 = &wwdt0; magn0 = &fxos8700; + accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/reel_board/dts/reel_board.dtsi b/boards/arm/reel_board/dts/reel_board.dtsi index a3ee58fd0ee..0ed5d04ec4d 100644 --- a/boards/arm/reel_board/dts/reel_board.dtsi +++ b/boards/arm/reel_board/dts/reel_board.dtsi @@ -84,6 +84,7 @@ green-pwm-led = &green_pwm_led; blue-pwm-led = &blue_pwm_led; sw0 = &user_button; + accel0 = &mma8642fc; }; }; @@ -124,7 +125,7 @@ arduino_i2c: &i2c0 { pinctrl-0 = <&i2c0_default>; pinctrl-1 = <&i2c0_sleep>; pinctrl-names = "default", "sleep"; - mma8652fc@1d { + mma8642fc: mma8652fc@1d { compatible = "nxp,fxos8700","nxp,mma8652fc"; reg = <0x1d>; label = "MMA8652FC"; diff --git a/boards/arm/twr_ke18f/twr_ke18f.dts b/boards/arm/twr_ke18f/twr_ke18f.dts index dcb91ac3867..297b9e7acf3 100644 --- a/boards/arm/twr_ke18f/twr_ke18f.dts +++ b/boards/arm/twr_ke18f/twr_ke18f.dts @@ -33,6 +33,7 @@ sw0 = &user_button_3; sw1 = &user_button_2; magn0 = &fxos8700; + accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/twr_kv58f220m/twr_kv58f220m.dts b/boards/arm/twr_kv58f220m/twr_kv58f220m.dts index 326d3ed9365..8f57587eab3 100644 --- a/boards/arm/twr_kv58f220m/twr_kv58f220m.dts +++ b/boards/arm/twr_kv58f220m/twr_kv58f220m.dts @@ -23,6 +23,7 @@ sw2 = &user_button_2; sw3 = &user_button_3; magn0 = &fxos8700; + accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/warp7_m4/warp7_m4.dts b/boards/arm/warp7_m4/warp7_m4.dts index 76494d6eda3..0aca644aafd 100644 --- a/boards/arm/warp7_m4/warp7_m4.dts +++ b/boards/arm/warp7_m4/warp7_m4.dts @@ -16,6 +16,7 @@ aliases { sw0 = &user_switch_1; magn0 = &fxos8700; + accel0 = &fxos8700; }; chosen { diff --git a/boards/riscv/rv32m1_vega/rv32m1_vega.dtsi b/boards/riscv/rv32m1_vega/rv32m1_vega.dtsi index 0034dc92d63..8568c34b556 100644 --- a/boards/riscv/rv32m1_vega/rv32m1_vega.dtsi +++ b/boards/riscv/rv32m1_vega/rv32m1_vega.dtsi @@ -22,6 +22,7 @@ sw2 = &user_button_4; sw3 = &user_button_5; magn0 = &fxos8700; + accel0 = &fxos8700; }; leds { diff --git a/boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay b/boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay index 1d52ed49388..7e32e2f9658 100644 --- a/boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay +++ b/boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay @@ -6,6 +6,7 @@ / { aliases { magn0 = &fxos8700; + accel0 = &fxos8700; }; }; From 84dc40438068b7910c9490969ca3112ba637f5ba Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Fri, 22 Jul 2022 08:10:04 +0900 Subject: [PATCH 051/501] [nrf fromtree] boards: Set devicetree alias for ST LIS2DW12 nodes Set accel0 alias for all boards with the LIS2DW12 accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 3bc117c24f1823e82c77e70d9306a7fab938ad5a) --- boards/arm/sensortile_box/sensortile_box.dts | 3 ++- boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay | 3 ++- .../x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/boards/arm/sensortile_box/sensortile_box.dts b/boards/arm/sensortile_box/sensortile_box.dts index 39ec15409fc..61e166ca0dc 100644 --- a/boards/arm/sensortile_box/sensortile_box.dts +++ b/boards/arm/sensortile_box/sensortile_box.dts @@ -45,6 +45,7 @@ led1 = &green_led; sw0 = &user_button; magn0 = &lis2mdl; + accel0 = &lis2dw12; }; }; @@ -128,7 +129,7 @@ cs-gpios = <&gpioe 11 GPIO_ACTIVE_LOW>, <&gpioe 12 GPIO_ACTIVE_LOW>, <&gpioe 10 GPIO_ACTIVE_LOW>; - lis2dw12@0 { + lis2dw12: lis2dw12@0 { compatible = "st,lis2dw12"; spi-max-frequency = <1000000>; reg = <0>; diff --git a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay index 29b8677158e..4cbbeb3585a 100644 --- a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay +++ b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay @@ -7,6 +7,7 @@ / { aliases { magn0 = &lis2mdl; + accel0 = &lis2dw12; }; }; @@ -35,7 +36,7 @@ irq-gpios = <&arduino_header 2 GPIO_ACTIVE_HIGH>; /* A2 */ }; - lis2dw12@19 { + lis2dw12: lis2dw12@19 { compatible = "st,lis2dw12"; reg = <0x19>; irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ diff --git a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay index 5ef7c596a63..e4fd760a10b 100644 --- a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay +++ b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay @@ -4,9 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ +/ { + aliases { + accel0 = &lis2dw12; + }; +}; + &arduino_i2c { - lis2dw12@19 { + lis2dw12: lis2dw12@19 { compatible = "st,lis2dw12"; reg = <0x19>; irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ From 198435b92c6b96ef3470c7e72aa81ef38219abdc Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sat, 23 Jul 2022 20:48:29 +0900 Subject: [PATCH 052/501] [nrf fromtree] boards: Set devicetree alias for ST LIS2DH and compatible nodes Set accel0 alias for all boards with the LIS2DH and compatible accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 6a177421e2514720866ea91ee65df6ad40fcf586) --- boards/arm/actinius_icarus/Kconfig.defconfig | 6 +----- boards/arm/actinius_icarus/actinius_icarus_common.dts | 3 ++- boards/arm/actinius_icarus_bee/Kconfig.defconfig | 6 +----- .../actinius_icarus_bee/actinius_icarus_bee_common.dts | 3 ++- boards/arm/actinius_icarus_som/Kconfig.defconfig | 6 +----- .../actinius_icarus_som/actinius_icarus_som_common.dts | 3 ++- boards/arm/bbc_microbit/bbc_microbit.dts | 2 +- boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts | 3 ++- boards/arm/bt510/bt510.dts | 3 ++- boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig | 6 +----- .../circuitdojo_feather_nrf9160_common.dts | 3 ++- boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts | 1 + boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts | 3 ++- boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts | 3 ++- boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts | 1 + boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig | 6 +----- .../sparkfun_thing_plus_nrf9160_common.dts | 3 ++- boards/arm/stm32f3_disco/stm32f3_disco.dts | 3 ++- boards/arm/stm32f3_disco/stm32f3_disco_E.overlay | 3 ++- boards/arm/stm32f411e_disco/stm32f411e_disco.dts | 3 ++- boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay | 8 +++++++- boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts | 1 + boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay | 3 ++- 23 files changed, 42 insertions(+), 40 deletions(-) diff --git a/boards/arm/actinius_icarus/Kconfig.defconfig b/boards/arm/actinius_icarus/Kconfig.defconfig index a202839ac2c..81d8526f3a7 100644 --- a/boards/arm/actinius_icarus/Kconfig.defconfig +++ b/boards/arm/actinius_icarus/Kconfig.defconfig @@ -8,12 +8,8 @@ if BOARD_ACTINIUS_ICARUS || BOARD_ACTINIUS_ICARUS_NS config BOARD default "actinius_icarus" -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index 18e0e5fe8cb..fb31f00703c 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -77,6 +77,7 @@ mcuboot-button0 = &button0; mcuboot-led0 = &green_pwm_led; watchdog0 = &wdt0; + accel0 = &lis2dh12_accel; }; vbatt { @@ -139,7 +140,7 @@ pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12-accel@19 { + lis2dh12_accel: lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/actinius_icarus_bee/Kconfig.defconfig b/boards/arm/actinius_icarus_bee/Kconfig.defconfig index 01d5e9ca6da..a29c91ee7e0 100644 --- a/boards/arm/actinius_icarus_bee/Kconfig.defconfig +++ b/boards/arm/actinius_icarus_bee/Kconfig.defconfig @@ -8,12 +8,8 @@ if BOARD_ACTINIUS_ICARUS_BEE || BOARD_ACTINIUS_ICARUS_BEE_NS config BOARD default "actinius_icarus_bee" -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 2456179f803..f2c65919f67 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -78,6 +78,7 @@ mcuboot-led0 = &green_pwm_led; watchdog0 = &wdt0; spi-flash0 = &w25q64; + accel0 = &lis2dh12_accel; }; sim_select: sim-select { @@ -117,7 +118,7 @@ pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12-accel@19 { + lis2dh12_accel: lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/actinius_icarus_som/Kconfig.defconfig b/boards/arm/actinius_icarus_som/Kconfig.defconfig index fa1eaf9363a..c21f2cecfe2 100644 --- a/boards/arm/actinius_icarus_som/Kconfig.defconfig +++ b/boards/arm/actinius_icarus_som/Kconfig.defconfig @@ -8,12 +8,8 @@ if BOARD_ACTINIUS_ICARUS_SOM || BOARD_ACTINIUS_ICARUS_SOM_NS config BOARD default "actinius_icarus_som" -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index 4a26af6d65b..91487876709 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -17,6 +17,7 @@ aliases { watchdog0 = &wdt0; + accel0 = &lis2dh12_accel; }; sim_select: sim-select { @@ -56,7 +57,7 @@ pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12-accel@19 { + lis2dh12_accel: lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/bbc_microbit/bbc_microbit.dts b/boards/arm/bbc_microbit/bbc_microbit.dts index 52e90c220d2..3398b47ccb9 100644 --- a/boards/arm/bbc_microbit/bbc_microbit.dts +++ b/boards/arm/bbc_microbit/bbc_microbit.dts @@ -150,7 +150,7 @@ irq-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm303agr-accel@19 { + lsm303agr_accel: lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "disabled"; reg = <0x19>; diff --git a/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts b/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts index 5e61c4f9a64..c6190aa14fa 100644 --- a/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts +++ b/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts @@ -17,6 +17,7 @@ sw0 = &buttonA; sw1 = &buttonB; magn0 = &lsm303agr_magn; + accel0 = &lsm303agr_accel; watchdog0 = &wdt0; }; @@ -137,7 +138,7 @@ irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm303agr-accel@19 { + lsm303agr_accel: lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "okay"; reg = <0x19>; diff --git a/boards/arm/bt510/bt510.dts b/boards/arm/bt510/bt510.dts index b62a0432b8d..a397a6b2ce4 100644 --- a/boards/arm/bt510/bt510.dts +++ b/boards/arm/bt510/bt510.dts @@ -84,6 +84,7 @@ mcuboot-button0 = &button0; mcuboot-led0 = &led1a; watchdog0 = &wdt0; + accel0 = &lis2dh12; }; }; @@ -119,7 +120,7 @@ pinctrl-0 = <&i2c0_default>; pinctrl-1 = <&i2c0_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12@18 { + lis2dh12: lis2dh12@18 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x18>; irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig index 40e77a236ca..92465481d65 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig +++ b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig @@ -9,12 +9,8 @@ if BOARD_CIRCUITDOJO_FEATHER_NRF9160 || BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS config BOARD default "circuitdojo_feather_nrf9160" -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to diff --git a/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts b/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts index 4e02a1610ce..d6c10ef14cc 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts +++ b/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts @@ -49,6 +49,7 @@ mcuboot-led0 = &blue_led; watchdog0 = &wdt0; spi-flash0 = &w25q32jv; + accel0 = &lis2dh; }; /* Used for accessing other pins */ @@ -135,7 +136,7 @@ reg = <0x51>; }; - lis2dh@18 { + lis2dh: lis2dh@18 { compatible = "st,lis2dh"; label = "LIS2DH"; reg = <0x18>; diff --git a/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts b/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts index c2dfc016984..c36e9f96843 100644 --- a/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts +++ b/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts @@ -72,6 +72,7 @@ led3-blue = &led3_blue; pwm-led0 = &pwm_led0_red; watchdog0 = &wdt0; + accel0 = &lis2dh12; }; }; diff --git a/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts b/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts index b95af4fe338..63e0594996e 100644 --- a/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts +++ b/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts @@ -73,6 +73,7 @@ rgb-pwm = &pwm0; mode-pwm = &pwm1; watchdog0 = &wdt0; + accel0 = &lis2dh12_accel; }; }; @@ -116,7 +117,7 @@ pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12-accel@19 { + lis2dh12_accel: lis2dh12-accel@19 { compatible = "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 0 0>, <&gpio0 1 0>; diff --git a/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts b/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts index 7d2f8772b6e..f23c134b323 100644 --- a/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts +++ b/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts @@ -64,6 +64,7 @@ rgb-pwm = &pwm0; mode-pwm = &pwm1; watchdog0 = &wdt0; + accel0 = &lis2dh12_accel; }; }; @@ -119,7 +120,7 @@ terminate-voltage = <3000>; }; - lis2dh12-accel@19 { + lis2dh12_accel: lis2dh12-accel@19 { compatible = "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 1 GPIO_ACTIVE_HIGH>; diff --git a/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts b/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts index 676f18eb287..efce24bedce 100644 --- a/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts +++ b/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts @@ -29,6 +29,7 @@ led1 = &led1; sw0 = &button0; watchdog0 = &wdt0; + accel0 = &lis2dh12; }; leds { diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig index 824ad975cce..f9bc9b207a2 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig +++ b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig @@ -26,12 +26,8 @@ config FLASH_LOAD_SIZE default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) depends on BOARD_SPARKFUN_THING_PLUS_NRF9160 && TRUSTED_EXECUTION_SECURE -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts b/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts index 6c542ed7b12..b3db04e13e4 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts +++ b/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts @@ -48,6 +48,7 @@ mcuboot-button0 = &button0; mcuboot-led0 = &blue_led; watchdog0 = &wdt0; + accel0 = &lis2dh; }; /* Used for accessing other pins */ @@ -126,7 +127,7 @@ reg = <0x51>; }; - lis2dh@18 { + lis2dh: lis2dh@18 { compatible = "st,lis2dh"; label = "LIS2DH"; reg = <0x18>; diff --git a/boards/arm/stm32f3_disco/stm32f3_disco.dts b/boards/arm/stm32f3_disco/stm32f3_disco.dts index aa3ec053b45..2b46380f829 100644 --- a/boards/arm/stm32f3_disco/stm32f3_disco.dts +++ b/boards/arm/stm32f3_disco/stm32f3_disco.dts @@ -70,6 +70,7 @@ sw0 = &user_button; magn0 = &lsm303dlhc_magn; watchdog0 = &iwdg; + accel0 = &lsm303dlhc_accel; }; }; @@ -127,7 +128,7 @@ label = "LSM303DLHC-MAGN"; }; - lsm303dlhc-accel@19 { + lsm303dlhc_accel: lsm303dlhc-accel@19 { compatible = "st,lis2dh", "st,lsm303dlhc-accel"; reg = <0x19>; irq-gpios = <&gpioe 4 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/stm32f3_disco/stm32f3_disco_E.overlay b/boards/arm/stm32f3_disco/stm32f3_disco_E.overlay index d319408ee2a..bafd944653e 100644 --- a/boards/arm/stm32f3_disco/stm32f3_disco_E.overlay +++ b/boards/arm/stm32f3_disco/stm32f3_disco_E.overlay @@ -7,6 +7,7 @@ / { aliases { magn0 = &lsm303agr_magn; + accel0 = &lsm303agr_accel; }; }; @@ -20,7 +21,7 @@ label = "LSM303AGR-MAGN"; }; - lsm303agr-accel@19 { + lsm303agr_accel: lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; reg = <0x19>; irq-gpios = <&gpioe 4 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/stm32f411e_disco/stm32f411e_disco.dts b/boards/arm/stm32f411e_disco/stm32f411e_disco.dts index b977d11a5a9..a0c5722d60f 100644 --- a/boards/arm/stm32f411e_disco/stm32f411e_disco.dts +++ b/boards/arm/stm32f411e_disco/stm32f411e_disco.dts @@ -74,6 +74,7 @@ pwm-led2 = &red_pwm_led; pwm-led3 = &blue_pwm_led; magn0 = &lsm303agr_magn; + accel0 = &lsm303agr_accel; }; }; @@ -127,7 +128,7 @@ label = "LSM303AGR-MAGN"; }; - lsm303agr-accel@19 { + lsm303agr_accel: lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "okay"; reg = <0x19>; diff --git a/boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay b/boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay index 316f31c4fe6..99ee0640fc8 100644 --- a/boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay +++ b/boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay @@ -4,6 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ +/ { + aliases { + accel0 = &lsm303dlhc_accel; + }; +}; + &i2c1 { /delete-node/ lsm303agr-magn@1e; /delete-node/ lsm303agr-accel@19; @@ -15,7 +21,7 @@ label = "LSM303DLHC-MAGN"; }; - lsm303dlhc-accel@19 { + lsm303dlhc_accel: lsm303dlhc-accel@19 { compatible = "st,lis2dh", "st,lsm303dlhc-accel"; status = "okay"; reg = <0x19>; diff --git a/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts b/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts index 37c500d1fdc..8d12416444a 100644 --- a/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts +++ b/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts @@ -31,6 +31,7 @@ led2 = &led2; sw0 = &button0; watchdog0 = &wdt0; + accel0 = &lis2dh12; }; leds { diff --git a/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay b/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay index 0d86deddc0c..a8ba562eaa0 100644 --- a/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay +++ b/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay @@ -8,6 +8,7 @@ / { aliases { magn0 = &lsm303agr_magn; + accel0 = &lsm303agr_accel; }; }; @@ -35,7 +36,7 @@ irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm303agr-accel@19 { + lsm303agr_accel: lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; reg = <0x19>; irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ From b9960058a9b9b6b5a12e1c9e0fcbc4beafd1ea09 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sat, 23 Jul 2022 15:21:23 +0900 Subject: [PATCH 053/501] [nrf fromtree] boards: Set devicetree alias for ST LIS3DH nodes Set accel0 alias for all boards with the LIS3DH accelerometer to use by the accel_polling sample. Add "st,lis2dh" compatibility to resolve dependency to 96b_wistrio and rak5010_nrf52840. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 266e635553205a153e3aabc623fe8d9e7ce0bf18) --- boards/arm/96b_wistrio/96b_wistrio.dts | 5 +++-- boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts | 3 ++- boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/boards/arm/96b_wistrio/96b_wistrio.dts b/boards/arm/96b_wistrio/96b_wistrio.dts index d3ba0b1b7fe..611a01b0898 100644 --- a/boards/arm/96b_wistrio/96b_wistrio.dts +++ b/boards/arm/96b_wistrio/96b_wistrio.dts @@ -36,6 +36,7 @@ led0 = &green_led_0; eeprom-0 = &eeprom; lora0 = &lora; + accel0 = &lis3dh; }; rf_switch: rf-switch { @@ -93,8 +94,8 @@ pinctrl-names = "default"; status = "okay"; - lis3dh@32 { - compatible = "st,lis3dh"; + lis3dh: lis3dh@32 { + compatible = "st,lis3dh", "st,lis2dh"; reg = <0x32>; label = "LIS3DH"; }; diff --git a/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts b/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts index ac7b7f87d1f..3ccb69c48c5 100644 --- a/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts +++ b/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts @@ -88,6 +88,7 @@ mcuboot-led0 = &led1; sdhc0 = &sdhc0; watchdog0 = &wdt0; + accel0 = &lis3dh; }; }; @@ -124,7 +125,7 @@ timeout = <10>; }; - lis3dh@18 { + lis3dh: lis3dh@18 { compatible = "st,lis2dh"; label = "LIS3DH"; reg = <0x18>; diff --git a/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts b/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts index 812b6c07bbb..9500fbefa6a 100644 --- a/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts +++ b/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts @@ -35,6 +35,7 @@ aliases { led0 = &led0; watchdog0 = &wdt0; + accel0 = &lis3dh; }; }; @@ -97,8 +98,8 @@ }; /* ST Microelectronics LIS3DH motion sensor */ - lis3dh@19 { - compatible = "st,lis3dh"; + lis3dh: lis3dh@19 { + compatible = "st,lis3dh", "st,lis2dh"; label = "LIS3DH"; reg = <0x19>; irq-gpios = <&gpio0 15 0>; From ea23c11ba7340e232311cd39b6e34385d31c670c Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Fri, 22 Jul 2022 00:51:46 +0900 Subject: [PATCH 054/501] [nrf fromtree] boards: Set devicetree alias for Bosch BMI270 nodes Set accel0 alias for all boards with the BMI270 accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 9cabb67d30028f9842ab33d3c6bb4344ae31c273) --- .../blueclover_plt_demo_v2_nrf52832.dts | 3 ++- boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts b/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts index 667f2f19566..7de13528795 100644 --- a/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts +++ b/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts @@ -41,6 +41,7 @@ sw1 = &button1; pwm-buzzer = &pwm0; watchdog0 = &wdt0; + accel0 = &bmi270; }; }; @@ -74,7 +75,7 @@ label = "SHT3XD"; }; - bmi270@68 { + bmi270: bmi270@68 { compatible = "bosch,bmi270"; reg = <0x68>; label = "BMI270"; diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 295b1e982f4..34fa27b1f48 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -117,6 +117,7 @@ magn0 = &bmm150; watchdog0 = &wdt0; accel0 = &adxl362; + accel1 = &bmi270; }; }; From 3e188e308c8452e1a0b7623436ad27fcebf308bd Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Fri, 22 Jul 2022 08:20:17 +0900 Subject: [PATCH 055/501] [nrf fromtree] boards: Set devicetree alias for ST ISM330DHCX nodes Set accel0 alias for all boards with the ISM330DHCX accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 7cab32efd212f8f106726d1df94334d39d7c0319) --- boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay | 3 ++- boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay index c2c3700c234..ca2a8b2e806 100644 --- a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay +++ b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay @@ -16,6 +16,7 @@ / { aliases { accel0 = &iis2dlpc; + accel1 = &ism330dhcx; }; }; @@ -34,7 +35,7 @@ drdy-gpios = <&arduino_header 2 GPIO_ACTIVE_HIGH>; /* A2 */ }; - ism330dhcx@6b { + ism330dhcx: ism330dhcx@6b { compatible = "st,ism330dhcx"; reg = <0x6b>; drdy-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 - INT2 */ diff --git a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay index ac33eeeea53..4b80426302d 100644 --- a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay +++ b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay @@ -18,6 +18,7 @@ / { aliases { accel0 = &iis2dlpc; + accel1 = &ism330dhcx; }; }; @@ -30,7 +31,7 @@ drdy-int = <2>; }; - ism330dhcx@6b { + ism330dhcx: ism330dhcx@6b { compatible = "st,ism330dhcx"; reg = <0x6b>; drdy-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 - INT2 */ From 73892037538bff0cf06e209fdd8c63cbf846a0ef Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sat, 23 Jul 2022 14:58:54 +0900 Subject: [PATCH 056/501] [nrf fromtree] boards: Set devicetree alias for ST LSM6DSL nodes Set accel0 alias for all boards with the LSM6DSL accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 7e3cf8d275735a3159c0d28d851184ffdefc123d) --- boards/arm/96b_argonkey/96b_argonkey.dts | 3 ++- boards/arm/96b_argonkey/Kconfig.defconfig | 8 ++------ boards/arm/b_l4s5i_iot01a/Kconfig.defconfig | 6 +----- boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts | 3 ++- boards/arm/disco_l475_iot1/Kconfig.defconfig | 6 +----- boards/arm/disco_l475_iot1/disco_l475_iot1.dts | 3 ++- boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay | 3 ++- 7 files changed, 12 insertions(+), 20 deletions(-) diff --git a/boards/arm/96b_argonkey/96b_argonkey.dts b/boards/arm/96b_argonkey/96b_argonkey.dts index ee33f0db7d2..e03e17c620b 100644 --- a/boards/arm/96b_argonkey/96b_argonkey.dts +++ b/boards/arm/96b_argonkey/96b_argonkey.dts @@ -43,6 +43,7 @@ led0 = &green_led_0; led1 = &green_led_1; sw0 = &user_button; + accel0 = &lsm6dsl; }; }; @@ -94,7 +95,7 @@ status = "okay"; /* ST Microelectronics LSM6DSL accel/gyro sensor */ - lsm6dsl@1 { + lsm6dsl: lsm6dsl@1 { compatible = "st,lsm6dsl"; reg = <1>; spi-max-frequency = <1000000>; diff --git a/boards/arm/96b_argonkey/Kconfig.defconfig b/boards/arm/96b_argonkey/Kconfig.defconfig index 1a34fcd375d..dd463a089c7 100644 --- a/boards/arm/96b_argonkey/Kconfig.defconfig +++ b/boards/arm/96b_argonkey/Kconfig.defconfig @@ -40,14 +40,10 @@ endchoice endif # LSM6DSL -if SENSOR - config I2C - default y + default y if SENSOR config SPI - default y - -endif # SENSOR + default y if SENSOR endif # BOARD_96B_ARGONKEY diff --git a/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig b/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig index b1ca1c3253e..59036c87581 100644 --- a/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig +++ b/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig @@ -25,12 +25,8 @@ choice LSM6DSL_TRIGGER_MODE depends on LSM6DSL endchoice -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR if BT diff --git a/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts b/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts index c5b56e6707f..a8cb3cf0e9e 100644 --- a/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts +++ b/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts @@ -44,6 +44,7 @@ led0 = &green_led_1; sw0 = &user_button; watchdog0 = &iwdg; + accel0 = &lsm6dsl; }; }; @@ -112,7 +113,7 @@ label = "LPS22HB"; }; - lsm6dsl@6a { + lsm6dsl: lsm6dsl@6a { compatible = "st,lsm6dsl"; reg = <0x6a>; irq-gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>; diff --git a/boards/arm/disco_l475_iot1/Kconfig.defconfig b/boards/arm/disco_l475_iot1/Kconfig.defconfig index fbee69ba336..54f0173c7d4 100644 --- a/boards/arm/disco_l475_iot1/Kconfig.defconfig +++ b/boards/arm/disco_l475_iot1/Kconfig.defconfig @@ -30,12 +30,8 @@ choice LSM6DSL_TRIGGER_MODE depends on LSM6DSL endchoice -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR if BT diff --git a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts index 15af45399b1..844f6563f3e 100644 --- a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts +++ b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts @@ -49,6 +49,7 @@ eswifi0 = &wifi0; watchdog0 = &iwdg; spi-flash0 = &mx25r6435f; + accel0 = &lsm6dsl; }; }; @@ -119,7 +120,7 @@ label = "LPS22HB"; }; - lsm6dsl@6a { + lsm6dsl: lsm6dsl@6a { compatible = "st,lsm6dsl"; reg = <0x6a>; irq-gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>; diff --git a/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay b/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay index a8ba562eaa0..20284a9c228 100644 --- a/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay +++ b/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay @@ -9,6 +9,7 @@ aliases { magn0 = &lsm303agr_magn; accel0 = &lsm303agr_accel; + accel1 = &lsm6dsl; }; }; @@ -24,7 +25,7 @@ reg = <0x5d>; }; - lsm6dsl@6b { + lsm6dsl: lsm6dsl@6b { compatible = "st,lsm6dsl"; reg = <0x6b>; irq-gpios = <&arduino_header 10 GPIO_ACTIVE_HIGH>; /* D4 */ From b71e1d10c8c55876974b67d54854024c7c4b1eca Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sat, 23 Jul 2022 14:58:51 +0900 Subject: [PATCH 057/501] [nrf fromtree] boards: Set devicetree alias for ST LSM6DSO nodes Set accel0 alias for all boards with the LSM6DSO accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit b79448013aa676d8fa411ac92ba44cd34401518f) --- boards/arm/sensortile_box/sensortile_box.dts | 3 ++- boards/arm/stm32l562e_dk/Kconfig.defconfig | 6 +----- boards/arm/stm32l562e_dk/stm32l562e_dk.dts | 1 + boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi | 2 +- boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay | 3 ++- .../shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay | 3 ++- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/boards/arm/sensortile_box/sensortile_box.dts b/boards/arm/sensortile_box/sensortile_box.dts index 61e166ca0dc..ff07b53b8e8 100644 --- a/boards/arm/sensortile_box/sensortile_box.dts +++ b/boards/arm/sensortile_box/sensortile_box.dts @@ -46,6 +46,7 @@ sw0 = &user_button; magn0 = &lis2mdl; accel0 = &lis2dw12; + accel1 = &lsm6dso; }; }; @@ -137,7 +138,7 @@ label = "LIS2DW12"; }; - lsm6dso@1 { + lsm6dso: lsm6dso@1 { compatible = "st,lsm6dso"; spi-max-frequency = <1000000>; reg = <1>; diff --git a/boards/arm/stm32l562e_dk/Kconfig.defconfig b/boards/arm/stm32l562e_dk/Kconfig.defconfig index 650a8d7524e..110cae6e1aa 100644 --- a/boards/arm/stm32l562e_dk/Kconfig.defconfig +++ b/boards/arm/stm32l562e_dk/Kconfig.defconfig @@ -13,12 +13,8 @@ choice STM32_LPTIM_CLOCK depends on STM32_LPTIM_TIMER endchoice -if SENSOR - config I2C - default y - -endif # SENSOR + default y if SENSOR if BT diff --git a/boards/arm/stm32l562e_dk/stm32l562e_dk.dts b/boards/arm/stm32l562e_dk/stm32l562e_dk.dts index c773993e361..194fbe2eddc 100644 --- a/boards/arm/stm32l562e_dk/stm32l562e_dk.dts +++ b/boards/arm/stm32l562e_dk/stm32l562e_dk.dts @@ -25,6 +25,7 @@ led0 = &green_led_10; sw0 = &user_button; watchdog0 = &iwdg; + accel0 = &lsm6dso; }; }; diff --git a/boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi b/boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi index 9b713d5243c..34d4086c452 100644 --- a/boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi +++ b/boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi @@ -103,7 +103,7 @@ status = "okay"; clock-frequency = ; - lsm6dso@6a { + lsm6dso: lsm6dso@6a { compatible = "st,lsm6dso"; reg = <0x6a>; irq-gpios = <&gpiof 3 GPIO_ACTIVE_HIGH>; diff --git a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay index 4cbbeb3585a..fb7dae59e01 100644 --- a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay +++ b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay @@ -8,6 +8,7 @@ aliases { magn0 = &lis2mdl; accel0 = &lis2dw12; + accel1 = &lsm6dso; }; }; @@ -42,7 +43,7 @@ irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm6dso@6b { + lsm6dso: lsm6dso@6b { compatible = "st,lsm6dso"; reg = <0x6b>; irq-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 */ diff --git a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay index e4fd760a10b..3045e846860 100644 --- a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay +++ b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay @@ -7,6 +7,7 @@ / { aliases { accel0 = &lis2dw12; + accel1 = &lsm6dso; }; }; @@ -18,7 +19,7 @@ irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm6dso@6b { + lsm6dso: lsm6dso@6b { compatible = "st,lsm6dso"; reg = <0x6b>; irq-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 */ From 59b6b0cf4d7dcc38b35d5c097acc3b909b58d5bf Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Fri, 22 Jul 2022 08:23:19 +0900 Subject: [PATCH 058/501] [nrf fromtree] boards: Set devicetree alias for ST IIS3DHHC nodes Set accel0 alias for all boards with the IIS3DHHC accelerometer to use by the accel_polling sample. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 53ca4b4bd3407d5c202f52f0128133097c1a2c87) --- boards/arm/sensortile_box/sensortile_box.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boards/arm/sensortile_box/sensortile_box.dts b/boards/arm/sensortile_box/sensortile_box.dts index ff07b53b8e8..ed31cbff89a 100644 --- a/boards/arm/sensortile_box/sensortile_box.dts +++ b/boards/arm/sensortile_box/sensortile_box.dts @@ -47,6 +47,7 @@ magn0 = &lis2mdl; accel0 = &lis2dw12; accel1 = &lsm6dso; + accel2 = &iis3dhhc; }; }; @@ -147,7 +148,7 @@ int-pin = <1>; }; - iis3dhhc@2 { + iis3dhhc: iis3dhhc@2 { compatible = "st,iis3dhhc"; spi-max-frequency = <1000000>; reg = <2>; From c03ec4e878172d808fbef07388b6f72ae82fa642 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Thu, 21 Apr 2022 00:07:28 -0700 Subject: [PATCH 059/501] [nrf fromtree] samples: sensor: Add 3-Axis accelerometer polling sample Add a polling sample for 3-Axis accelerometers. This sample demonstrates how to data fetch and print to the console. Signed-off-by: TOKITA Hiroshi (cherry picked from commit 41e9349cd63b600193c0d64a8868d61498312a0d) --- samples/sensor/accel_polling/CMakeLists.txt | 9 +++ samples/sensor/accel_polling/README.rst | 46 +++++++++++++ samples/sensor/accel_polling/prj.conf | 3 + samples/sensor/accel_polling/sample.yaml | 26 ++++++++ samples/sensor/accel_polling/src/main.c | 74 +++++++++++++++++++++ 5 files changed, 158 insertions(+) create mode 100644 samples/sensor/accel_polling/CMakeLists.txt create mode 100644 samples/sensor/accel_polling/README.rst create mode 100644 samples/sensor/accel_polling/prj.conf create mode 100644 samples/sensor/accel_polling/sample.yaml create mode 100644 samples/sensor/accel_polling/src/main.c diff --git a/samples/sensor/accel_polling/CMakeLists.txt b/samples/sensor/accel_polling/CMakeLists.txt new file mode 100644 index 00000000000..7fb7a11af3f --- /dev/null +++ b/samples/sensor/accel_polling/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2022 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(accel_polling) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/samples/sensor/accel_polling/README.rst b/samples/sensor/accel_polling/README.rst new file mode 100644 index 00000000000..15260817f06 --- /dev/null +++ b/samples/sensor/accel_polling/README.rst @@ -0,0 +1,46 @@ +.. _accel_polling: + +Generic 3-Axis accelerometer polling sample +########################################### + +Overview +******** + +This sample application demonstrates how to use 3-Axis accelerometers. + +Building and Running +******************** + +This sample supports up to 10 3-Axis accelerometers. Each accelerometer needs +to be aliased as ``accelN`` where ``N`` goes from ``0`` to ``9``. For example: + +.. code-block:: devicetree + + / { + aliases { + accel0 = &lis2dh; + }; + }; + +Make sure the aliases are in devicetree, then build and run with: + +.. zephyr-app-commands:: + :zephyr-app: samples/sensor/accel_polling + :board: + :goals: build flash + :compact: + +Sample Output +============= + +.. code-block:: console + + lis2dh@19 [m/s^2]: ( -6.013728, -3.064320, 7.277760) + lis2dh@19 [m/s^2]: ( -6.128640, -3.026016, 7.201152) + lis2dh@19 [m/s^2]: ( -6.090336, -3.064320, 7.162848) + lis2dh@19 [m/s^2]: ( -6.128640, -3.026016, 7.354368) + lis2dh@19 [m/s^2]: ( -6.166944, -3.102624, 7.277760) + lis2dh@19 [m/s^2]: ( -6.128640, -2.987712, 7.277760) + lis2dh@19 [m/s^2]: ( -6.052032, -2.987712, 7.277760) + lis2dh@19 [m/s^2]: ( -6.166944, -2.987712, 7.239456) + lis2dh@19 [m/s^2]: ( -6.090336, -3.026016, 7.201152) diff --git a/samples/sensor/accel_polling/prj.conf b/samples/sensor/accel_polling/prj.conf new file mode 100644 index 00000000000..fb14ccba74f --- /dev/null +++ b/samples/sensor/accel_polling/prj.conf @@ -0,0 +1,3 @@ +CONFIG_STDOUT_CONSOLE=y +CONFIG_SENSOR=y +CONFIG_CBPRINTF_FP_SUPPORT=y diff --git a/samples/sensor/accel_polling/sample.yaml b/samples/sensor/accel_polling/sample.yaml new file mode 100644 index 00000000000..e83795e986d --- /dev/null +++ b/samples/sensor/accel_polling/sample.yaml @@ -0,0 +1,26 @@ +sample: + name: Accelerometer polling sample +tests: + sample.sensor.accel_polling: + harness: console + tags: sensors + filter: dt_alias_exists("accel0") + harness_config: + type: one_line + regex: + - "^\\s*[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]* \\[m\/s\\^2\\]: \\(\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*\\)$" + integration_platforms: + - cc1352r_sensortag # adxl362 + - blueclover_plt_demo_v2_nrf52832 # bmi270 + - frdm_kl25z # mma8451q + - lpcxpresso55s28 # mma8652fc + - bbc_microbit # mmc8653fc + - frdm_k64f # fxos8700 + - sparkfun_thing_plus_nrf9160 # lis2dh + - thingy52_nrf52832 # lis2dh12 + - stm32f411e_disco # lsm303agr_accel + - stm32f3_disco # lsm303dlhc_accel + - bl5340_dvk # lis3dh + - b_l4s5i_iot01a # lsm6dsl + - sensortile_box # lis2dw12, lsm6dso, iisdhhc + - thingy53_nrf5340_cpuapp # adxl362, bmi270 diff --git a/samples/sensor/accel_polling/src/main.c b/samples/sensor/accel_polling/src/main.c new file mode 100644 index 00000000000..902d40738c7 --- /dev/null +++ b/samples/sensor/accel_polling/src/main.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 TOKITA Hiroshi +#include + +#include +#include +#include +#include + +#define ACCEL_ALIAS(i) DT_ALIAS(_CONCAT(accel, i)) +#define ACCELEROMETER_DEVICE(i, _) \ + IF_ENABLED(DT_NODE_EXISTS(ACCEL_ALIAS(i)), (DEVICE_DT_GET(ACCEL_ALIAS(i)),)) + +/* support up to 10 accelerometer sensors */ +static const struct device *sensors[] = {LISTIFY(10, ACCELEROMETER_DEVICE, ())}; + +static const enum sensor_channel channels[] = { + SENSOR_CHAN_ACCEL_X, + SENSOR_CHAN_ACCEL_Y, + SENSOR_CHAN_ACCEL_Z, +}; + +static int print_accels(const struct device *dev) +{ + int ret; + struct sensor_value accel[3]; + + ret = sensor_sample_fetch(dev); + if (ret < 0) { + printk("%s: sensor_sample_fetch() failed: %d\n", dev->name, ret); + return ret; + } + + for (size_t i = 0; i < ARRAY_SIZE(channels); i++) { + ret = sensor_channel_get(dev, channels[i], &accel[i]); + if (ret < 0) { + printk("%s: sensor_channel_get(%c) failed: %d\n", dev->name, 'X' + i, ret); + return ret; + } + } + + printk("%16s [m/s^2]: (%12.6f, %12.6f, %12.6f)\n", dev->name, + sensor_value_to_double(&accel[0]), sensor_value_to_double(&accel[1]), + sensor_value_to_double(&accel[2])); + + return 0; +} + +void main(void) +{ + int ret; + + for (size_t i = 0; i < ARRAY_SIZE(sensors); i++) { + if (!device_is_ready(sensors[i])) { + printk("sensor: device %s not ready.\n", sensors[i]->name); + return; + } + } + + while (1) { + for (size_t i = 0; i < ARRAY_SIZE(sensors); i++) { + ret = print_accels(sensors[i]); + if (ret < 0) { + return; + } + } + k_msleep(1000); + } +} From 2ede29c77a7a240aca62a06831504961136c27d3 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Thu, 5 May 2022 12:04:26 +0200 Subject: [PATCH 060/501] [nrf noup] boards: Enable TF-M by default for nordic SoC NS boards Enable TF-M by default for nordic nRF5340 and nrf9160 SoC boards. NCSDK-14811 Signed-off-by: Joakim Andersson Signed-off-by: Jamie McCrae (cherry picked from commit 42f1db3263c7be0a95e3157b95be4e3ad264af78) --- .../circuitdojo_feather_nrf9160/Kconfig.defconfig | 15 +++++++++++++++ .../sparkfun_thing_plus_nrf9160/Kconfig.defconfig | 15 +++++++++++++++ boards/arm/thingy53_nrf5340/Kconfig.defconfig | 15 +++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig index 92465481d65..ac86c23088d 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig +++ b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig @@ -9,6 +9,21 @@ if BOARD_CIRCUITDOJO_FEATHER_NRF9160 || BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS config BOARD default "circuitdojo_feather_nrf9160" +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + config I2C default y if SENSOR diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig index f9bc9b207a2..f9618c7d975 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig +++ b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig @@ -9,6 +9,21 @@ if BOARD_SPARKFUN_THING_PLUS_NRF9160 || BOARD_SPARKFUN_THING_PLUS_NRF9160_NS config BOARD default "sparkfun_thing_plus_nrf9160" +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/thingy53_nrf5340/Kconfig.defconfig b/boards/arm/thingy53_nrf5340/Kconfig.defconfig index c5ae7da4c3b..aafabf0e9c9 100644 --- a/boards/arm/thingy53_nrf5340/Kconfig.defconfig +++ b/boards/arm/thingy53_nrf5340/Kconfig.defconfig @@ -8,6 +8,21 @@ if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config BOARD default "thingy53_nrf5340_cpuapp" +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_THINGY53_NRF5340_CPUAPP_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + # Code Partition: # # For the secure version of the board the firmware is linked at the beginning From 39ffe17c3b53ef0b2c4f55331c0ba0a67c301f1e Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 3 Aug 2022 12:29:41 -0500 Subject: [PATCH 061/501] [nrf fromtree] boards: arm: nordic: Remove label property from devicetree The label property isn't needed in devicetree so remove it. Signed-off-by: Kumar Gala (cherry picked from commit 6b5017586b7bc309608ef11b804a1df147c9ac14) --- boards/arm/actinius_icarus/actinius_icarus_common.dts | 1 - .../actinius_icarus_bee/actinius_icarus_bee_common.dts | 2 -- .../actinius_icarus_som/actinius_icarus_som_common.dts | 1 - .../adafruit_feather_nrf52840.dts | 1 - .../arduino_nano_33_ble-common.dtsi | 1 - .../arduino_nano_33_ble/arduino_nano_33_ble_sense.dts | 4 ---- boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts | 5 ----- .../arduino_nicla_sense_me/arduino_nicla_sense_me.dts | 1 - boards/arm/bbc_microbit/bbc_microbit.dts | 4 ---- boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts | 3 --- boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts | 10 ---------- boards/arm/bl652_dvk/bl652_dvk.dts | 1 - boards/arm/bl653_dvk/bl653_dvk.dts | 1 - boards/arm/bl654_dvk/bl654_dvk.dts | 2 -- boards/arm/bl654_sensor_board/bl654_sensor_board.dts | 1 - boards/arm/bl654_usb/bl654_usb.dts | 1 - .../blueclover_plt_demo_v2_nrf52832.dts | 3 --- boards/arm/bt510/bt510.dts | 3 --- boards/arm/bt610/bt610.dts | 3 --- .../circuitdojo_feather_nrf9160_common.dts | 4 ---- .../contextualelectronics_abc.dts | 1 - .../arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts | 2 -- boards/arm/degu_evk/degu_evk.dts | 3 --- boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts | 1 - boards/arm/nrf52840_mdk/nrf52840_mdk.dts | 1 - boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts | 1 - boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts | 1 - .../arm/nrf9160_innblue21/nrf9160_innblue21_common.dts | 7 ------- .../arm/nrf9160_innblue22/nrf9160_innblue22_common.dts | 7 ------- boards/arm/particle_argon/dts/mesh_feather.dtsi | 1 - boards/arm/particle_boron/dts/mesh_feather.dtsi | 1 - boards/arm/particle_boron/particle_boron.dts | 1 - boards/arm/particle_xenon/dts/mesh_feather.dtsi | 1 - boards/arm/pinetime_devkit0/pinetime_devkit0.dts | 6 ------ boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts | 3 --- boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts | 1 - boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts | 5 ----- boards/arm/reel_board/dts/reel_board.dtsi | 3 --- boards/arm/reel_board/reel_board.dts | 1 - boards/arm/reel_board/reel_board_v2.dts | 1 - boards/arm/rm1xx_dvk/rm1xx_dvk.dts | 2 -- boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts | 2 -- .../sparkfun_thing_plus_nrf9160_common.dts | 3 --- boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts | 10 ---------- .../arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 9 --------- .../ubx_bmd340eval_nrf52840.dts | 1 - .../ubx_bmd345eval_nrf52840.dts | 1 - .../ubx_bmd380eval_nrf52840.dts | 1 - boards/arm/xiao_ble/xiao_ble.dts | 2 -- 49 files changed, 131 deletions(-) diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index fb31f00703c..784c96cf262 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -145,7 +145,6 @@ reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, <&gpio0 29 GPIO_ACTIVE_HIGH>; - label = "LIS2DH12-ACCEL"; }; }; diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index f2c65919f67..53a4b4bac95 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -123,7 +123,6 @@ reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, <&gpio0 29 GPIO_ACTIVE_HIGH>; - label = "LIS2DH12-ACCEL"; }; }; @@ -140,7 +139,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <80000000>; - label = "W25Q64"; jedec-id = [ef 40 17]; size = <0x4000000>; has-dpd; diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index 91487876709..6c574899289 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -62,7 +62,6 @@ reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, <&gpio0 29 GPIO_ACTIVE_HIGH>; - label = "LIS2DH12-ACCEL"; }; }; diff --git a/boards/arm/adafruit_feather_nrf52840/adafruit_feather_nrf52840.dts b/boards/arm/adafruit_feather_nrf52840/adafruit_feather_nrf52840.dts index c1d805d4d62..96aa9538d51 100644 --- a/boards/arm/adafruit_feather_nrf52840/adafruit_feather_nrf52840.dts +++ b/boards/arm/adafruit_feather_nrf52840/adafruit_feather_nrf52840.dts @@ -106,7 +106,6 @@ writeoc = "pp4o"; readoc = "read4io"; sck-frequency = <16000000>; - label = "GD25Q16"; jedec-id = [c8 40 15]; size = <16777216>; has-dpd; diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble-common.dtsi b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble-common.dtsi index 8031726695c..02ef21e0e10 100644 --- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble-common.dtsi +++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble-common.dtsi @@ -75,7 +75,6 @@ vdd_env: vdd-env { compatible = "regulator-fixed"; - label = "vdd_env"; regulator-name = "vdd_env"; enable-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; regulator-boot-on; diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_sense.dts b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_sense.dts index 7cc1e54c946..11ba59bcbc7 100644 --- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_sense.dts +++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_sense.dts @@ -15,7 +15,6 @@ mic_pwr: mic_pwr { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "mic_pwr"; regulator-name = "mic_pwr"; enable-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -27,21 +26,18 @@ compatible = "st,hts221"; status = "okay"; reg = <0x5f>; - label = "HTS221"; }; lps22hb: lps22hb-press@5c { compatible = "st,lps22hb-press"; status = "okay"; reg = <0x5c>; - label = "LPS22HB"; }; apds9960: apds9960@39 { compatible = "avago,apds9960"; status = "okay"; reg = <0x39>; - label = "APDS9960"; int-gpios = <&gpio0 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; }; }; diff --git a/boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts b/boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts index ad7b3dff850..732084dab3e 100644 --- a/boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts +++ b/boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts @@ -62,7 +62,6 @@ &sercom2 { status = "okay"; compatible = "atmel,sam0-spi"; - label = "NINA_SPI"; dipo = <1>; dopo = <3>; #address-cells = <1>; @@ -76,7 +75,6 @@ nina_w102@0 { compatible = "u-blox,nina"; reg = <0>; - label = "NINA_W102"; spi-max-frequency = <8000000>; ready-gpios = <&porta 28 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; reset-gpios = <&porta 8 GPIO_ACTIVE_LOW>; @@ -96,7 +94,6 @@ nina_prog { compatible = "espressif,esp-at"; - label = "NINA_PROG"; reset-gpios = <&porta 8 GPIO_ACTIVE_LOW>; }; }; @@ -114,13 +111,11 @@ lsm6ds3@6a { compatible = "st,lsm6ds3"; reg = <0x6a>; - label = "LSM6DS3"; }; atecc608a@15 { compatible = "atmel,atecc608"; reg = <0x6a>; - label = "ATECC608A"; }; }; diff --git a/boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts b/boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts index 09edae4af25..c4b08c7107e 100644 --- a/boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts +++ b/boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts @@ -102,7 +102,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <80000000>; - label = "MX25R16"; jedec-id = [c2 28 15]; size = ; has-dpd; diff --git a/boards/arm/bbc_microbit/bbc_microbit.dts b/boards/arm/bbc_microbit/bbc_microbit.dts index 3398b47ccb9..1f0e3cb248a 100644 --- a/boards/arm/bbc_microbit/bbc_microbit.dts +++ b/boards/arm/bbc_microbit/bbc_microbit.dts @@ -48,7 +48,6 @@ led_matrix: led_matrix { compatible = "nordic,nrf-led-matrix"; status = "okay"; - label = "LED_MATRIX"; width = <5>; height = <5>; pixel-mapping = [00 13 01 14 02 @@ -136,7 +135,6 @@ compatible = "nxp,fxos8700", "nxp,mma8653fc"; status = "okay"; reg = <0x1d>; - label = "MMA8653FC"; int1-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; int2-gpios = <&gpio0 27 GPIO_ACTIVE_LOW>; }; @@ -146,7 +144,6 @@ compatible = "st,lis2mdl", "st,lsm303agr-magn"; status = "disabled"; reg = <0x1e>; - label = "LSM303AGR-MAGN"; irq-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; /* A3 */ }; @@ -154,7 +151,6 @@ compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "disabled"; reg = <0x19>; - label = "LSM303AGR-ACCEL"; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; }; }; diff --git a/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts b/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts index c6190aa14fa..111486a90a8 100644 --- a/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts +++ b/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts @@ -48,7 +48,6 @@ led_matrix: led_matrix { compatible = "nordic,nrf-led-matrix"; status = "okay"; - label = "LED_MATRIX"; width = <5>; height = <5>; pixel-mapping = [00 01 02 03 04 @@ -134,7 +133,6 @@ compatible = "st,lis2mdl", "st,lsm303agr-magn"; status = "okay"; reg = <0x1e>; - label = "LSM303AGR-MAGN"; irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; /* A3 */ }; @@ -142,7 +140,6 @@ compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "okay"; reg = <0x19>; - label = "LSM303AGR-ACCEL"; irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; }; }; diff --git a/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts b/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts index 3ccb69c48c5..8e31713cce8 100644 --- a/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts +++ b/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts @@ -118,7 +118,6 @@ at24c256@50 { compatible = "atmel,at24"; reg = <0x50>; - label = "EEPROM"; size = <32768>; pagesize = <64>; address-width = <16>; @@ -127,7 +126,6 @@ lis3dh: lis3dh@18 { compatible = "st,lis2dh"; - label = "LIS3DH"; reg = <0x18>; irq-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>, <&gpio0 24 GPIO_ACTIVE_HIGH>; }; @@ -135,33 +133,28 @@ ft5336@38 { compatible = "focaltech,ft5336"; reg = <0x38>; - label = "TOUCH"; int-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; }; bme680@76 { compatible = "bosch,bme680"; reg = <0x76>; - label = "BME680"; }; dac0: mcp4725@60 { compatible = "microchip,mcp4725"; reg = <0x60>; - label = "dac0"; #io-channel-cells = <1>; }; extrtc0: mcp7940n@6f { compatible = "microchip,mcp7940n"; reg = <0x6f>; - label = "mcp7940n"; }; gpio_exp0: tca9538@70 { compatible = "ti,tca9538"; reg = <0x70>; - label = "tca9538"; gpio-controller; #gpio-cells = <2>; ngpios = <8>; @@ -181,7 +174,6 @@ compatible = "microchip,enc424j600"; reg = <0>; spi-max-frequency = <8000000>; - label = "ETHERNET"; int-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; }; }; @@ -218,7 +210,6 @@ compatible = "ilitek,ili9340"; reg = <0>; spi-max-frequency = <32000000>; - label = "DISPLAY"; reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; cmd-data-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; rotation = <270>; @@ -267,7 +258,6 @@ /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/bl652_dvk/bl652_dvk.dts b/boards/arm/bl652_dvk/bl652_dvk.dts index 913484a0886..69da64646aa 100644 --- a/boards/arm/bl652_dvk/bl652_dvk.dts +++ b/boards/arm/bl652_dvk/bl652_dvk.dts @@ -91,7 +91,6 @@ /* MCP4725 not populated at factory */ compatible = "microchip,mcp4725"; reg = <0x60>; - label = "MCP4725"; #io-channel-cells = <1>; status = "disabled"; }; diff --git a/boards/arm/bl653_dvk/bl653_dvk.dts b/boards/arm/bl653_dvk/bl653_dvk.dts index df9eab933bd..0c712242458 100644 --- a/boards/arm/bl653_dvk/bl653_dvk.dts +++ b/boards/arm/bl653_dvk/bl653_dvk.dts @@ -115,7 +115,6 @@ /* MCP4725 not populated at factory */ compatible = "microchip,mcp4725"; reg = <0x60>; - label = "MCP4725"; #io-channel-cells = <1>; status = "disabled"; }; diff --git a/boards/arm/bl654_dvk/bl654_dvk.dts b/boards/arm/bl654_dvk/bl654_dvk.dts index 7e4f339f65b..5605a434cdc 100644 --- a/boards/arm/bl654_dvk/bl654_dvk.dts +++ b/boards/arm/bl654_dvk/bl654_dvk.dts @@ -115,7 +115,6 @@ /* MCP4725 not populated at factory */ compatible = "microchip,mcp4725"; reg = <0x60>; - label = "MCP4725"; #io-channel-cells = <1>; status = "disabled"; }; @@ -149,7 +148,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <80000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; size = <67108864>; wp-gpios = <&gpio0 22 0>; diff --git a/boards/arm/bl654_sensor_board/bl654_sensor_board.dts b/boards/arm/bl654_sensor_board/bl654_sensor_board.dts index d84ae442b31..4981def53dc 100644 --- a/boards/arm/bl654_sensor_board/bl654_sensor_board.dts +++ b/boards/arm/bl654_sensor_board/bl654_sensor_board.dts @@ -84,7 +84,6 @@ bme280@76 { compatible = "bosch,bme280"; status = "okay"; - label = "BME280"; reg = <0x76>; }; }; diff --git a/boards/arm/bl654_usb/bl654_usb.dts b/boards/arm/bl654_usb/bl654_usb.dts index 54d77245d0b..5164ac28e17 100644 --- a/boards/arm/bl654_usb/bl654_usb.dts +++ b/boards/arm/bl654_usb/bl654_usb.dts @@ -107,6 +107,5 @@ zephyr_udc0: &usbd { bl654_cdc_acm_uart: bl654_cdc_acm_uart { compatible = "zephyr,cdc-acm-uart"; - label = "CDC_ACM_0"; }; }; diff --git a/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts b/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts index 7de13528795..9dfdbc33a25 100644 --- a/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts +++ b/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts @@ -72,13 +72,11 @@ sht3xd@44 { compatible = "sensirion,sht3xd"; reg = <0x44>; - label = "SHT3XD"; }; bmi270: bmi270@68 { compatible = "bosch,bmi270"; reg = <0x68>; - label = "BMI270"; }; }; @@ -101,7 +99,6 @@ compatible = "apa,apa102"; reg = <0>; spi-max-frequency = <5250000>; - label = "APA102"; }; }; diff --git a/boards/arm/bt510/bt510.dts b/boards/arm/bt510/bt510.dts index a397a6b2ce4..51139ffc594 100644 --- a/boards/arm/bt510/bt510.dts +++ b/boards/arm/bt510/bt510.dts @@ -72,7 +72,6 @@ mag0: mag_0 { compatible = "honeywell,sm351lt"; gpios = <&gpio1 14 0>; - label = "SM351LT_0"; }; }; @@ -125,14 +124,12 @@ reg = <0x18>; irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>, <&gpio1 12 GPIO_ACTIVE_HIGH>; - label = "LIS2DH12"; disconnect-sdo-sa0-pull-up; }; si7055@40 { compatible = "silabs,si7055"; reg = <0x40>; - label = "SI7055"; }; }; diff --git a/boards/arm/bt610/bt610.dts b/boards/arm/bt610/bt610.dts index 6ce5f38096a..2b6a54b94f4 100644 --- a/boards/arm/bt610/bt610.dts +++ b/boards/arm/bt610/bt610.dts @@ -62,7 +62,6 @@ mag1: mag_1 { compatible = "honeywell,sm351lt"; gpios = <&gpio1 15 0>; - label = "SM3531LT_0"; }; }; @@ -257,7 +256,6 @@ gpio_exp0: tca9538@70 { compatible = "ti,tca9538"; reg = <0x70>; - label = "tca9538"; gpio-controller; #gpio-cells = <2>; ngpios = <8>; @@ -286,7 +284,6 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts b/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts index d6c10ef14cc..95faa637ac2 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts +++ b/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts @@ -83,7 +83,6 @@ nrf-ps-en { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "nrf_ps_en"; regulator-name = "nrf_ps_en"; enable-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -132,13 +131,11 @@ pinctrl-names = "default", "sleep"; pcf85063a@51 { compatible = "nxp,pcf85063a"; - label = "PCF85063A"; reg = <0x51>; }; lis2dh: lis2dh@18 { compatible = "st,lis2dh"; - label = "LIS2DH"; reg = <0x18>; irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; disconnect-sdo-sa0-pull-up; @@ -162,7 +159,6 @@ pinctrl-names = "default", "sleep"; w25q32jv: w25q32jv@0 { compatible = "jedec,spi-nor"; - label = "W25Q32JV"; reg = < 0 >; spi-max-frequency = < 40000000 >; wp-gpios = < &gpio0 8 GPIO_ACTIVE_LOW >; diff --git a/boards/arm/contextualelectronics_abc/contextualelectronics_abc.dts b/boards/arm/contextualelectronics_abc/contextualelectronics_abc.dts index 8216e8fe7c1..ebc866afeff 100644 --- a/boards/arm/contextualelectronics_abc/contextualelectronics_abc.dts +++ b/boards/arm/contextualelectronics_abc/contextualelectronics_abc.dts @@ -62,7 +62,6 @@ arduino_serial: &uart1 { pinctrl-names = "default", "sleep"; quectel_bg9x { compatible = "quectel,bg9x"; - label = "quectel-bg9x"; status = "okay"; mdm-power-gpios = <&gpio1 5 0>; diff --git a/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts b/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts index c36e9f96843..fe31442107a 100644 --- a/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts +++ b/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts @@ -110,7 +110,6 @@ compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; - label = "LIS2DH12-ACCEL"; }; }; @@ -137,7 +136,6 @@ int-gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; /* P0.19 */ reset-gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; /* P0.24 */ status = "okay"; - label = "DW1000"; reg = <0>; }; }; diff --git a/boards/arm/degu_evk/degu_evk.dts b/boards/arm/degu_evk/degu_evk.dts index 714e841db4b..32a95fda9ae 100644 --- a/boards/arm/degu_evk/degu_evk.dts +++ b/boards/arm/degu_evk/degu_evk.dts @@ -58,7 +58,6 @@ en-3v3-switch { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "en_3v3_switch"; regulator-name = "en_3v3_switch"; enable-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -66,7 +65,6 @@ en-vin1-moni { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "en_vin1_moni"; regulator-name = "en_vin1_moni"; enable-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -161,6 +159,5 @@ zephyr_udc0: &usbd { degu_cdc_acm_uart: degu_cdc_acm_uart { compatible = "zephyr,cdc-acm-uart"; - label = "CDC_ACM_0"; }; }; diff --git a/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts b/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts index c618484c522..3c8d999e594 100644 --- a/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts +++ b/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts @@ -232,7 +232,6 @@ fem_spi: &spi3 { compatible = "nordic,nrf21540-fem-spi"; status = "okay"; reg = <0>; - label = "FEM_SPI_IF"; spi-max-frequency = <8000000>; }; }; diff --git a/boards/arm/nrf52840_mdk/nrf52840_mdk.dts b/boards/arm/nrf52840_mdk/nrf52840_mdk.dts index 28a9d03b55d..86447b3ee7f 100644 --- a/boards/arm/nrf52840_mdk/nrf52840_mdk.dts +++ b/boards/arm/nrf52840_mdk/nrf52840_mdk.dts @@ -142,7 +142,6 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts index c5c40f9fb2c..d7594bcf160 100644 --- a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts +++ b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts @@ -224,7 +224,6 @@ arduino_i2c: &i2c0 { /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts index 0169bb3206b..77da12d8116 100644 --- a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts +++ b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts @@ -182,7 +182,6 @@ /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts b/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts index 63e0594996e..71db4a88f48 100644 --- a/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts +++ b/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts @@ -47,7 +47,6 @@ en_3v3_sensor: enable-3v3-sensor { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "ENABLE_3V3_SENSOR"; regulator-name = "en_3v3_sensor"; enable-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; startup-delay-us = <10000>; @@ -56,7 +55,6 @@ en_5v0_boost: enable-5v0-boost { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "ENABLE_5V0_BOOST"; regulator-name = "en_5v0_boost"; enable-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; startup-delay-us = <10000>; @@ -121,31 +119,26 @@ compatible = "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 0 0>, <&gpio0 1 0>; - label = "LIS2DH12-ACCEL"; }; hts221@5f { compatible = "st,hts221"; reg = <0x5f>; drdy-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; - label = "HTS221"; }; lps22hb-press@5c { compatible = "st,lps22hb-press"; reg = <0x5c>; - label = "LPS22HB"; }; ccs811: ccs811@5a { compatible = "ams,ccs811"; reg = <0x5a>; - label = "CCS811"; }; bme680@76 { compatible = "bosch,bme680"; - label = "BME680"; reg = <0x76>; }; }; diff --git a/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts b/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts index f23c134b323..860c1d8a87f 100644 --- a/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts +++ b/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts @@ -47,7 +47,6 @@ en_5v0_boost: enable-5v0-boost { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "ENABLE_5V0_BOOST"; regulator-name = "en_5v0_boost"; enable-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; startup-delay-us = <10000>; @@ -112,7 +111,6 @@ pinctrl-names = "default", "sleep"; bq27421@55 { compatible = "ti,bq274xx"; - label = "BQ274XX"; reg = <0x55>; design-voltage = <3700>; design-capacity = <1800>; @@ -124,31 +122,26 @@ compatible = "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 1 GPIO_ACTIVE_HIGH>; - label = "LIS2DH12-ACCEL"; }; hts221@5f { compatible = "st,hts221"; reg = <0x5f>; drdy-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; - label = "HTS221"; }; lps22hb-press@5c { compatible = "st,lps22hb-press"; reg = <0x5c>; - label = "LPS22HB"; }; ccs811: ccs811@5a { compatible = "ams,ccs811"; reg = <0x5a>; - label = "CCS811"; }; bme680@76 { compatible = "bosch,bme680"; - label = "BME680"; reg = <0x76>; }; }; diff --git a/boards/arm/particle_argon/dts/mesh_feather.dtsi b/boards/arm/particle_argon/dts/mesh_feather.dtsi index 86e270df303..2d04f02d030 100644 --- a/boards/arm/particle_argon/dts/mesh_feather.dtsi +++ b/boards/arm/particle_argon/dts/mesh_feather.dtsi @@ -199,7 +199,6 @@ feather_i2c: &i2c0 { }; pinctrl-names = "default", "sleep"; mx25l32: mx25l3233f@0 { compatible = "jedec,spi-nor"; - label = "MX25L3233F"; reg = <0>; spi-max-frequency = <80000000>; wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/particle_boron/dts/mesh_feather.dtsi b/boards/arm/particle_boron/dts/mesh_feather.dtsi index 86e270df303..2d04f02d030 100644 --- a/boards/arm/particle_boron/dts/mesh_feather.dtsi +++ b/boards/arm/particle_boron/dts/mesh_feather.dtsi @@ -199,7 +199,6 @@ feather_i2c: &i2c0 { }; pinctrl-names = "default", "sleep"; mx25l32: mx25l3233f@0 { compatible = "jedec,spi-nor"; - label = "MX25L3233F"; reg = <0>; spi-max-frequency = <80000000>; wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/particle_boron/particle_boron.dts b/boards/arm/particle_boron/particle_boron.dts index 9b49a9792f9..e59853bf809 100644 --- a/boards/arm/particle_boron/particle_boron.dts +++ b/boards/arm/particle_boron/particle_boron.dts @@ -49,7 +49,6 @@ pinctrl-names = "default", "sleep"; sara_r4 { compatible = "u-blox,sara-r4"; - label = "ublox-sara-r4"; status = "okay"; mdm-power-gpios = <&gpio0 16 0>; diff --git a/boards/arm/particle_xenon/dts/mesh_feather.dtsi b/boards/arm/particle_xenon/dts/mesh_feather.dtsi index 52a42b060c5..99d14532a44 100644 --- a/boards/arm/particle_xenon/dts/mesh_feather.dtsi +++ b/boards/arm/particle_xenon/dts/mesh_feather.dtsi @@ -198,7 +198,6 @@ feather_i2c: &i2c0 { }; pinctrl-names = "default", "sleep"; mx25l32: mx25l3233f@0 { compatible = "jedec,spi-nor"; - label = "MX25L3233F"; reg = <0>; spi-max-frequency = <80000000>; wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/pinetime_devkit0/pinetime_devkit0.dts b/boards/arm/pinetime_devkit0/pinetime_devkit0.dts index a002236c2ee..46d54e436ca 100644 --- a/boards/arm/pinetime_devkit0/pinetime_devkit0.dts +++ b/boards/arm/pinetime_devkit0/pinetime_devkit0.dts @@ -67,7 +67,6 @@ key_out { compatible = "pine64,pinetime-key-out"; gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; - label = "Key out"; }; vbatt { @@ -111,7 +110,6 @@ bma421: bma421@18 { compatible = "bosch,bma4xx"; reg = <0x18>; - label = "BMA421"; int1-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; }; @@ -119,14 +117,12 @@ hrs3300: hrs3300@44 { compatible = "tian-yi-he-xin-hrs3300"; reg = <0x44>; - label = "HRS3300"; }; /* Hynitron CST816S Capacitive Touch Controller (400KHz) */ cst816s: cst816s@15 { compatible = "hynitron,cst816s"; reg = <0x15>; - label = "CST816S"; irq-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; rst-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; }; @@ -145,7 +141,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <8000000>; /* 8MHz */ - label = "XT25FB32"; jedec-id = [0b 40 16]; size = ; @@ -173,7 +168,6 @@ compatible = "sitronix,st7789v"; reg = <1>; spi-max-frequency = <8000000>; /* 8MHz */ - label = "ST7789V"; cmd-data-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; /* DET */ reset-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; /* RESX reset */ width = <240>; diff --git a/boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts b/boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts index d6ef6e67864..b0271831764 100644 --- a/boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts +++ b/boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts @@ -113,7 +113,6 @@ hl7800 { compatible = "swir,hl7800"; status = "okay"; - label = "hl7800"; mdm-reset-gpios = <&gpio1 15 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>; mdm-wake-gpios = <&gpio1 13 (GPIO_OPEN_SOURCE | GPIO_ACTIVE_HIGH)>; mdm-pwr-on-gpios = <&gpio1 2 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>; @@ -135,7 +134,6 @@ bme680@76 { compatible = "bosch,bme680"; status = "okay"; - label = "BME680"; reg = <0x76>; }; }; @@ -168,7 +166,6 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; size = <67108864>; has-dpd; diff --git a/boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts b/boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts index b9168c3024e..7041f42182e 100644 --- a/boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts +++ b/boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts @@ -106,7 +106,6 @@ lora: lora@0 { compatible = "semtech,sx1262"; reg = <0>; - label = "sx1262"; reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; busy-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; tx-enable-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts b/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts index 9500fbefa6a..083839a9710 100644 --- a/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts +++ b/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts @@ -66,7 +66,6 @@ pinctrl-names = "default", "sleep"; quectel_bg9x: quectel_bg9x { compatible = "quectel,bg9x"; - label = "quectel,bg9x"; mdm-power-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; mdm-reset-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; mdm-dtr-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; @@ -93,14 +92,12 @@ pinctrl-names = "default", "sleep"; opt3001@44 { compatible = "ti,opt3001"; - label = "OPT3001"; reg = <0x44>; }; /* ST Microelectronics LIS3DH motion sensor */ lis3dh: lis3dh@19 { compatible = "st,lis3dh", "st,lis2dh"; - label = "LIS3DH"; reg = <0x19>; irq-gpios = <&gpio0 15 0>; }; @@ -109,7 +106,6 @@ lps22hb-press@5c { compatible = "st,lps22hb-press"; reg = <0x5c>; - label = "LPS22HB"; }; }; @@ -124,7 +120,6 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <16000000>; - label = "IS25WP064A"; jedec-id = [9d 70 17]; size = <67108864>; has-dpd; diff --git a/boards/arm/reel_board/dts/reel_board.dtsi b/boards/arm/reel_board/dts/reel_board.dtsi index 0ed5d04ec4d..9a0c504b9ee 100644 --- a/boards/arm/reel_board/dts/reel_board.dtsi +++ b/boards/arm/reel_board/dts/reel_board.dtsi @@ -128,7 +128,6 @@ arduino_i2c: &i2c0 { mma8642fc: mma8652fc@1d { compatible = "nxp,fxos8700","nxp,mma8652fc"; reg = <0x1d>; - label = "MMA8652FC"; int1-gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; int2-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; }; @@ -136,14 +135,12 @@ arduino_i2c: &i2c0 { ti_hdc@43 { compatible = "ti,hdc","ti,hdc1010"; reg = <0x43>; - label = "HDC1010"; drdy-gpios = <&gpio0 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; }; apds9960@39 { compatible = "avago,apds9960"; reg = <0x39>; - label = "APDS9960"; int-gpios = <&gpio0 23 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; }; }; diff --git a/boards/arm/reel_board/reel_board.dts b/boards/arm/reel_board/reel_board.dts index 6c533cbf595..0080d514617 100644 --- a/boards/arm/reel_board/reel_board.dts +++ b/boards/arm/reel_board/reel_board.dts @@ -58,7 +58,6 @@ pinctrl-names = "default", "sleep"; ssd16xx: ssd16xxfb@0 { compatible = "gooddisplay,gdeh0213b1", "solomon,ssd1673", "solomon,ssd16xxfb"; - label = "SSD16XX"; spi-max-frequency = <4000000>; reg = <0>; width = <250>; diff --git a/boards/arm/reel_board/reel_board_v2.dts b/boards/arm/reel_board/reel_board_v2.dts index 9e7f65d5ffa..81f4accc37c 100644 --- a/boards/arm/reel_board/reel_board_v2.dts +++ b/boards/arm/reel_board/reel_board_v2.dts @@ -41,7 +41,6 @@ pinctrl-names = "default", "sleep"; ssd16xx: ssd16xxfb@0 { compatible = "gooddisplay,gdeh0213b72", "solomon,ssd1675a", "solomon,ssd16xxfb"; - label = "SSD16XX"; spi-max-frequency = <4000000>; reg = <0>; width = <250>; diff --git a/boards/arm/rm1xx_dvk/rm1xx_dvk.dts b/boards/arm/rm1xx_dvk/rm1xx_dvk.dts index f95b7c352e0..3ff2cd54ae7 100644 --- a/boards/arm/rm1xx_dvk/rm1xx_dvk.dts +++ b/boards/arm/rm1xx_dvk/rm1xx_dvk.dts @@ -78,7 +78,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <1000000>; - label = "at25df04"; jedec-id = [1f 44 02]; size = <0x400000>; has-lock = <0xbc>; @@ -90,7 +89,6 @@ lora0: lora@1 { compatible = "semtech,sx1272"; reg = <1>; - label = "sx1272"; reset-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; dio-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>, <&gpio0 13 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts b/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts index efce24bedce..a07831aef1a 100644 --- a/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts +++ b/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts @@ -86,7 +86,6 @@ compatible = "bosch,bme280"; reg = <0>; spi-max-frequency = <10000000>; - label= "BME280"; }; lis2dh12: lis2dh12@1 { @@ -94,7 +93,6 @@ reg = <1>; spi-max-frequency = <10000000>; irq-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>, <&gpio0 6 GPIO_ACTIVE_HIGH>; - label = "LIS2DH12-ACCEL"; }; }; diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts b/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts index b3db04e13e4..79f44d03bf1 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts +++ b/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts @@ -123,13 +123,11 @@ pinctrl-names = "default", "sleep"; pcf85063a@51 { compatible = "nxp,pcf85063a"; - label = "PCF85063A"; reg = <0x51>; }; lis2dh: lis2dh@18 { compatible = "st,lis2dh"; - label = "LIS2DH"; reg = <0x18>; irq-gpios = <&gpio0 29 0>; }; @@ -152,7 +150,6 @@ pinctrl-names = "default", "sleep"; w25q32jv: w25q32jv@0 { compatible = "jedec,spi-nor"; - label = "W25Q32JV"; reg = <0>; spi-max-frequency = <40000000>; wp-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts b/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts index 8d12416444a..d958a24d78e 100644 --- a/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts +++ b/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts @@ -73,7 +73,6 @@ vdd_pwr: vdd-pwr-ctrl { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "vdd-pwr-ctrl"; regulator-name = "vdd-pwr-ctrl"; enable-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -81,28 +80,24 @@ spk_pwr: spk-pwr-ctrl { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "spk-pwr-ctrl"; regulator-name = "spk-pwr-ctrl"; enable-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; }; mpu_pwr: mpu-pwr-ctrl { compatible = "regulator-fixed"; - label = "mpu-pwr-ctrl"; regulator-name = "mpu-pwr-ctrl"; enable-gpios = <&sx1509b 8 GPIO_ACTIVE_HIGH>; }; mic_pwr: mic-pwr-ctrl { compatible = "regulator-fixed"; - label = "mic-pwr-ctrl"; regulator-name = "mic-pwr-ctrl"; enable-gpios = <&sx1509b 9 GPIO_ACTIVE_HIGH>; }; ccs_pwr: ccs-pwr-ctrl { compatible = "regulator-fixed"; - label = "ccs-pwr-ctrl"; regulator-name = "ccs-pwr-ctrl"; enable-gpios = <&sx1509b 10 GPIO_ACTIVE_HIGH>; }; @@ -140,7 +135,6 @@ sx1509b: sx1509b@3e { compatible = "semtech,sx1509b"; reg = <0x3e>; - label = "GPIO_P0"; vin-supply = <&vdd_pwr>; gpio-controller; #gpio-cells = <2>; @@ -153,14 +147,12 @@ lps22hb_press: lps22hb_press@5c { compatible = "st,lps22hb-press"; reg = <0x5c>; - label = "LPS22HB"; vin-supply = <&vdd_pwr>; }; hts221: hts221@5f { compatible = "st,hts221"; reg = <0x5f>; - label = "HTS221"; vin-supply = <&vdd_pwr>; drdy-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>; }; @@ -168,7 +160,6 @@ ccs811: ccs811@5a { compatible = "ams,ccs811"; reg = <0x5a>; - label = "CCS811"; vin-supply = <&ccs_pwr>; irq-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; reset-gpios = <&sx1509b 11 GPIO_ACTIVE_LOW>; @@ -188,7 +179,6 @@ compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; - label = "LIS2DH12-ACCEL"; }; }; diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 34fa27b1f48..03a872fdf67 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -63,7 +63,6 @@ npm1100_force_pwm_mode: npm1100_force_pwm_mode { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "npm1100_force_pwm_mode"; regulator-name = "npm1100_force_pwm_mode"; enable-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; status = "disabled"; @@ -80,7 +79,6 @@ regulator_3v3: regulator-3v3-ctrl { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "vsys-3v3-ctrl"; regulator-name = "ncp114"; enable-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; regulator-boot-on; @@ -88,7 +86,6 @@ sensor_pwr_ctrl: sensor-pwr-ctrl { compatible = "regulator-fixed-sync", "regulator-fixed"; - label = "sens-pwr-ctrl"; regulator-name = "tck106ag"; enable-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -163,13 +160,11 @@ pinctrl-names = "default", "sleep"; bmm150: bmm150@10 { compatible = "bosch,bmm150"; - label = "BMM150"; reg = <0x10>; }; bh1749@38 { compatible = "rohm,bh1749"; - label = "BH1749"; reg = <0x38>; int-gpios = <&gpio1 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; }; @@ -187,7 +182,6 @@ pinctrl-names = "default", "sleep"; adxl362: spi-dev-adxl362@0 { compatible = "adi,adxl362"; - label = "ADXL362"; spi-max-frequency = <8000000>; reg = <0>; int1-gpios = <&gpio0 19 0>; @@ -195,7 +189,6 @@ bmi270: spi-dev-bmi270@1 { compatible = "bosch,bmi270"; - label = "BMI270"; spi-max-frequency = <8000000>; reg = <1>; int1-gpios = <&gpio0 23 0>; @@ -205,7 +198,6 @@ compatible = "nordic,nrf21540-fem-spi"; status = "disabled"; reg = <2>; - label = "FEM_SPI_IF"; spi-max-frequency = <8000000>; }; }; @@ -234,7 +226,6 @@ /* Thingy:53 supports only fastread and read2io options */ readoc = "read2io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/ubx_bmd340eval_nrf52840/ubx_bmd340eval_nrf52840.dts b/boards/arm/ubx_bmd340eval_nrf52840/ubx_bmd340eval_nrf52840.dts index dbaa7a47ca2..f770d071cdd 100644 --- a/boards/arm/ubx_bmd340eval_nrf52840/ubx_bmd340eval_nrf52840.dts +++ b/boards/arm/ubx_bmd340eval_nrf52840/ubx_bmd340eval_nrf52840.dts @@ -225,7 +225,6 @@ arduino_i2c: &i2c0 { /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 diff --git a/boards/arm/ubx_bmd345eval_nrf52840/ubx_bmd345eval_nrf52840.dts b/boards/arm/ubx_bmd345eval_nrf52840/ubx_bmd345eval_nrf52840.dts index 96342e394e5..df2e692c5a8 100644 --- a/boards/arm/ubx_bmd345eval_nrf52840/ubx_bmd345eval_nrf52840.dts +++ b/boards/arm/ubx_bmd345eval_nrf52840/ubx_bmd345eval_nrf52840.dts @@ -241,7 +241,6 @@ arduino_spi: &spi3 { /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 diff --git a/boards/arm/ubx_bmd380eval_nrf52840/ubx_bmd380eval_nrf52840.dts b/boards/arm/ubx_bmd380eval_nrf52840/ubx_bmd380eval_nrf52840.dts index 4f392567cf4..d2606dad2b9 100644 --- a/boards/arm/ubx_bmd380eval_nrf52840/ubx_bmd380eval_nrf52840.dts +++ b/boards/arm/ubx_bmd380eval_nrf52840/ubx_bmd380eval_nrf52840.dts @@ -168,7 +168,6 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <8000000>; - label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 diff --git a/boards/arm/xiao_ble/xiao_ble.dts b/boards/arm/xiao_ble/xiao_ble.dts index 1849fece4b4..5497a253dc4 100644 --- a/boards/arm/xiao_ble/xiao_ble.dts +++ b/boards/arm/xiao_ble/xiao_ble.dts @@ -123,7 +123,6 @@ wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; hold-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; spi-max-frequency = <104000000>; - label = "P25Q16H"; jedec-id = [85 60 15]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 00 44 eb 08 6b 08 3b 80 bb @@ -178,6 +177,5 @@ zephyr_udc0: &usbd { usb_cdc_acm_uart: cdc-acm-uart { compatible = "zephyr,cdc-acm-uart"; - label = "CDC_ACM_0"; }; }; From 3ab3ad52dfc682386fa76caa327cb7a3fc3bd912 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Thu, 11 Aug 2022 12:14:03 +0200 Subject: [PATCH 062/501] [nrf fromtree] boards: thingy53_nrf5340: Disable BMI270 in DTS Change disables BMI270 sensor in board DTS. The BMI270 sensor driver in Zephyr does not support sensor connected over SPI. Signed-off-by: Marek Pieta (cherry picked from commit 3fcc0f808acafedbc1a47d4e8d6dfe733320a02e) --- boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 03a872fdf67..f6a120d2f34 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -114,7 +114,6 @@ magn0 = &bmm150; watchdog0 = &wdt0; accel0 = &adxl362; - accel1 = &bmi270; }; }; @@ -189,6 +188,7 @@ bmi270: spi-dev-bmi270@1 { compatible = "bosch,bmi270"; + status = "disabled"; spi-max-frequency = <8000000>; reg = <1>; int1-gpios = <&gpio0 23 0>; From d6c5799f82d2730446174277b45b06fcbba7f159 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 13 Jun 2022 11:40:38 +0200 Subject: [PATCH 063/501] [nrf fromtree] bluetooth: smp: Add authentication callbacks per connection Change introduces authentication callbacks used only for specified BLE connection. The feature can be used by devices that require reporting specific bonding capabilities only when pairing using vendor-specific procedures. If per-connection authentication callbacks are defined for given connection, they are used instead of global authentication callbacks. SMP latches authentication callbacks during the first access to prevent updating the callbacks while pairing. Fixes: #38336 Signed-off-by: Marek Pieta (cherry picked from commit 4d8eab7c6f054e0960140985b84411bb5024dd48) --- doc/releases/release-notes-3.2.rst | 2 + include/zephyr/bluetooth/conn.h | 16 +++ subsys/bluetooth/host/conn.c | 78 +++++++------ subsys/bluetooth/host/smp.c | 173 +++++++++++++++++++---------- subsys/bluetooth/host/smp.h | 1 + 5 files changed, 177 insertions(+), 93 deletions(-) diff --git a/doc/releases/release-notes-3.2.rst b/doc/releases/release-notes-3.2.rst index 2c61b12f5ff..ee23cd43fdc 100644 --- a/doc/releases/release-notes-3.2.rst +++ b/doc/releases/release-notes-3.2.rst @@ -96,6 +96,8 @@ Bluetooth * Host + * Added :c:func:`bt_conn_auth_cb_overlay` to overlay authentication callbacks for a Bluetooth LE connection. + * Mesh * Controller diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index abe1afacc4c..379fba2e7e6 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1363,6 +1363,22 @@ struct bt_conn_auth_info_cb { */ int bt_conn_auth_cb_register(const struct bt_conn_auth_cb *cb); +/** @brief Overlay authentication callbacks used for a given connection. + * + * This function can be used only for Bluetooth LE connections. + * The @kconfig{CONFIG_BT_SMP} must be enabled for this function. + * + * The authentication callbacks for a given connection cannot be overlaid if + * security procedures in the SMP module have already started. This function + * can be called only once per connection. + * + * @param conn Connection object. + * @param cb Callback struct. + * + * @return Zero on success or negative error code otherwise + */ +int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb); + /** @brief Register authentication information callbacks. * * Register callbacks to get authenticated pairing information. Multiple diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 1077a02088d..95a0ae56153 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2860,6 +2860,26 @@ int bt_conn_auth_cb_register(const struct bt_conn_auth_cb *cb) return 0; } +#if defined(CONFIG_BT_SMP) +int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb) +{ + /* The cancel callback must always be provided if the app provides + * interactive callbacks. + */ + if (!cb->cancel && + (cb->passkey_display || cb->passkey_entry || cb->passkey_confirm || + cb->pairing_confirm)) { + return -EINVAL; + } + + if (conn->type == BT_CONN_TYPE_LE) { + return bt_smp_auth_cb_overlay(conn, cb); + } + + return -ENOTSUP; +} +#endif + int bt_conn_auth_info_cb_register(struct bt_conn_auth_info_cb *cb) { CHECKIF(cb == NULL) { @@ -2886,16 +2906,15 @@ int bt_conn_auth_info_cb_unregister(struct bt_conn_auth_info_cb *cb) int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) { - if (!bt_auth) { - return -EINVAL; - } - if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { - bt_smp_auth_passkey_entry(conn, passkey); - return 0; + return bt_smp_auth_passkey_entry(conn, passkey); } if (IS_ENABLED(CONFIG_BT_BREDR) && conn->type == BT_CONN_TYPE_BR) { + if (!bt_auth) { + return -EINVAL; + } + return bt_ssp_auth_passkey_entry(conn, passkey); } @@ -2904,17 +2923,15 @@ int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) int bt_conn_auth_passkey_confirm(struct bt_conn *conn) { - if (!bt_auth) { - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_SMP) && - conn->type == BT_CONN_TYPE_LE) { + if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { return bt_smp_auth_passkey_confirm(conn); } - if (IS_ENABLED(CONFIG_BT_BREDR) && - conn->type == BT_CONN_TYPE_BR) { + if (IS_ENABLED(CONFIG_BT_BREDR) && conn->type == BT_CONN_TYPE_BR) { + if (!bt_auth) { + return -EINVAL; + } + return bt_ssp_auth_passkey_confirm(conn); } @@ -2923,41 +2940,36 @@ int bt_conn_auth_passkey_confirm(struct bt_conn *conn) int bt_conn_auth_cancel(struct bt_conn *conn) { - if (!bt_auth) { - return -EINVAL; - } - if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { return bt_smp_auth_cancel(conn); } -#if defined(CONFIG_BT_BREDR) - if (conn->type == BT_CONN_TYPE_BR) { + if (IS_ENABLED(CONFIG_BT_BREDR) && conn->type == BT_CONN_TYPE_BR) { + if (!bt_auth) { + return -EINVAL; + } + return bt_ssp_auth_cancel(conn); } -#endif /* CONFIG_BT_BREDR */ return -EINVAL; } int bt_conn_auth_pairing_confirm(struct bt_conn *conn) { - if (!bt_auth) { - return -EINVAL; + if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { + return bt_smp_auth_pairing_confirm(conn); } - switch (conn->type) { -#if defined(CONFIG_BT_SMP) - case BT_CONN_TYPE_LE: - return bt_smp_auth_pairing_confirm(conn); -#endif /* CONFIG_BT_SMP */ -#if defined(CONFIG_BT_BREDR) - case BT_CONN_TYPE_BR: + if (IS_ENABLED(CONFIG_BT_BREDR) && conn->type == BT_CONN_TYPE_BR) { + if (!bt_auth) { + return -EINVAL; + } + return bt_ssp_auth_pairing_confirm(conn); -#endif /* CONFIG_BT_BREDR */ - default: - return -EINVAL; } + + return -EINVAL; } #endif /* CONFIG_BT_SMP || CONFIG_BT_BREDR */ diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 5132ad74950..9e6298f1260 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -204,6 +204,9 @@ struct bt_smp { /* Delayed work for timeout handling */ struct k_work_delayable work; + + /* Used Bluetooth authentication callbacks. */ + atomic_ptr_t auth_cb; }; static unsigned int fixed_passkey = BT_PASSKEY_INVALID; @@ -277,6 +280,11 @@ static bool sc_supported; static const uint8_t *sc_public_key; static K_SEM_DEFINE(sc_local_pkey_ready, 0, 1); +/* Pointer to internal data is used to mark that callbacks of given SMP channel are not initialized. + * Value of NULL represents no authenticaiton capabilities and cannot be used for that purpose. + */ +#define BT_SMP_AUTH_CB_UNINITIALIZED ((atomic_ptr_val_t)bt_smp_pool) + static bool le_sc_supported(void) { /* @@ -292,25 +300,34 @@ static bool le_sc_supported(void) BT_CMD_TEST(bt_dev.supported_commands, 34, 2); } -static uint8_t get_io_capa(void) +static const struct bt_conn_auth_cb *latch_auth_cb(struct bt_smp *smp) +{ + atomic_ptr_cas(&smp->auth_cb, BT_SMP_AUTH_CB_UNINITIALIZED, (atomic_ptr_val_t)bt_auth); + + return atomic_ptr_get(&smp->auth_cb); +} + +static uint8_t get_io_capa(struct bt_smp *smp) { - if (!bt_auth) { + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); + + if (!smp_auth_cb) { goto no_callbacks; } /* Passkey Confirmation is valid only for LE SC */ - if (bt_auth->passkey_display && bt_auth->passkey_entry && - (bt_auth->passkey_confirm || !sc_supported)) { + if (smp_auth_cb->passkey_display && smp_auth_cb->passkey_entry && + (smp_auth_cb->passkey_confirm || !sc_supported)) { return BT_SMP_IO_KEYBOARD_DISPLAY; } /* DisplayYesNo is useful only for LE SC */ - if (sc_supported && bt_auth->passkey_display && - bt_auth->passkey_confirm) { + if (sc_supported && smp_auth_cb->passkey_display && + smp_auth_cb->passkey_confirm) { return BT_SMP_IO_DISPLAY_YESNO; } - if (bt_auth->passkey_entry) { + if (smp_auth_cb->passkey_entry) { if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_INVALID) { return BT_SMP_IO_KEYBOARD_DISPLAY; @@ -319,7 +336,7 @@ static uint8_t get_io_capa(void) } } - if (bt_auth->passkey_display) { + if (smp_auth_cb->passkey_display) { return BT_SMP_IO_DISPLAY_ONLY; } @@ -402,7 +419,7 @@ static uint8_t get_pair_method(struct bt_smp *smp, uint8_t remote_io) return JUST_WORKS; } - return gen_method_sc[remote_io][get_io_capa()]; + return gen_method_sc[remote_io][get_io_capa(smp)]; #else return JUST_WORKS; #endif @@ -2286,11 +2303,13 @@ static uint8_t send_pairing_rsp(struct bt_smp *smp) } #endif /* CONFIG_BT_PERIPHERAL */ -static uint8_t smp_pairing_accept_query(struct bt_conn *conn, - struct bt_smp_pairing *pairing) +static uint8_t smp_pairing_accept_query(struct bt_smp *smp, struct bt_smp_pairing *pairing) { #if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT) - if (bt_auth && bt_auth->pairing_accept) { + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); + struct bt_conn *conn = smp->chan.chan.conn; + + if (smp_auth_cb && smp_auth_cb->pairing_accept) { const struct bt_conn_pairing_feat feat = { .io_capability = pairing->io_capability, .oob_data_flag = pairing->oob_flag, @@ -2300,7 +2319,7 @@ static uint8_t smp_pairing_accept_query(struct bt_conn *conn, .resp_key_dist = pairing->resp_key_dist }; - return smp_err_get(bt_auth->pairing_accept(conn, &feat)); + return smp_err_get(smp_auth_cb->pairing_accept(conn, &feat)); } #endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */ return 0; @@ -2347,7 +2366,7 @@ static uint8_t legacy_get_pair_method(struct bt_smp *smp, uint8_t remote_io) return JUST_WORKS; } - method = gen_method_legacy[remote_io][get_io_capa()]; + method = gen_method_legacy[remote_io][get_io_capa(smp)]; /* if both sides have KeyboardDisplay capabilities, initiator displays * and responder inputs @@ -2366,6 +2385,7 @@ static uint8_t legacy_get_pair_method(struct bt_smp *smp, uint8_t remote_io) static uint8_t legacy_request_tk(struct bt_smp *smp) { struct bt_conn *conn = smp->chan.chan.conn; + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_keys *keys; uint32_t passkey; @@ -2383,13 +2403,13 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) switch (smp->method) { case LEGACY_OOB: - if (bt_auth && bt_auth->oob_data_request) { + if (smp_auth_cb && smp_auth_cb->oob_data_request) { struct bt_conn_oob_info info = { .type = BT_CONN_OOB_LE_LEGACY, }; atomic_set_bit(smp->flags, SMP_FLAG_USER); - bt_auth->oob_data_request(smp->chan.chan.conn, &info); + smp_auth_cb->oob_data_request(smp->chan.chan.conn, &info); } else { return BT_SMP_ERR_OOB_NOT_AVAIL; } @@ -2411,9 +2431,9 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) BT_INFO("Legacy passkey %u", passkey); } - if (bt_auth && bt_auth->passkey_display) { + if (smp_auth_cb && smp_auth_cb->passkey_display) { atomic_set_bit(smp->flags, SMP_FLAG_DISPLAY); - bt_auth->passkey_display(conn, passkey); + smp_auth_cb->passkey_display(conn, passkey); } sys_put_le32(passkey, smp->tk); @@ -2421,7 +2441,7 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) break; case PASSKEY_INPUT: atomic_set_bit(smp->flags, SMP_FLAG_USER); - bt_auth->passkey_entry(conn); + smp_auth_cb->passkey_entry(conn); break; case JUST_WORKS: break; @@ -2462,6 +2482,7 @@ static uint8_t legacy_send_pairing_confirm(struct bt_smp *smp) #if defined(CONFIG_BT_PERIPHERAL) static uint8_t legacy_pairing_req(struct bt_smp *smp) { + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); uint8_t ret; BT_DBG(""); @@ -2474,9 +2495,9 @@ static uint8_t legacy_pairing_req(struct bt_smp *smp) /* ask for consent if pairing is not due to sending SecReq*/ if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && !atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && - bt_auth && bt_auth->pairing_confirm) { + smp_auth_cb && smp_auth_cb->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); - bt_auth->pairing_confirm(smp->chan.chan.conn); + smp_auth_cb->pairing_confirm(smp->chan.chan.conn); return 0; } @@ -2690,6 +2711,7 @@ static uint8_t smp_central_ident(struct bt_smp *smp, struct net_buf *buf) #if defined(CONFIG_BT_CENTRAL) static uint8_t legacy_pairing_rsp(struct bt_smp *smp) { + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); uint8_t ret; BT_DBG(""); @@ -2702,9 +2724,9 @@ static uint8_t legacy_pairing_rsp(struct bt_smp *smp) /* ask for consent if this is due to received SecReq */ if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && - bt_auth && bt_auth->pairing_confirm) { + smp_auth_cb && smp_auth_cb->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); - bt_auth->pairing_confirm(smp->chan.chan.conn); + smp_auth_cb->pairing_confirm(smp->chan.chan.conn); return 0; } @@ -2764,15 +2786,17 @@ void bt_set_oob_data_flag(bool enable) oobd_present = enable; } -static uint8_t get_auth(struct bt_conn *conn, uint8_t auth) +static uint8_t get_auth(struct bt_smp *smp, uint8_t auth) { + struct bt_conn *conn = smp->chan.chan.conn; + if (sc_supported) { auth &= BT_SMP_AUTH_MASK_SC; } else { auth &= BT_SMP_AUTH_MASK; } - if ((get_io_capa() == BT_SMP_IO_NO_INPUT_OUTPUT) || + if ((get_io_capa(smp) == BT_SMP_IO_NO_INPUT_OUTPUT) || (!IS_ENABLED(CONFIG_BT_SMP_ENFORCE_MITM) && (conn->required_sec_level < BT_SECURITY_L3))) { auth &= ~(BT_SMP_AUTH_MITM); @@ -2825,18 +2849,20 @@ static uint8_t remote_sec_level_reachable(struct bt_smp *smp) } } -static bool sec_level_reachable(struct bt_conn *conn) +static bool sec_level_reachable(struct bt_smp *smp) { - switch (conn->required_sec_level) { + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); + + switch (smp->chan.chan.conn->required_sec_level) { case BT_SECURITY_L1: case BT_SECURITY_L2: return true; case BT_SECURITY_L3: - return get_io_capa() != BT_SMP_IO_NO_INPUT_OUTPUT || - (bt_auth && bt_auth->oob_data_request); + return get_io_capa(smp) != BT_SMP_IO_NO_INPUT_OUTPUT || + (smp_auth_cb && smp_auth_cb->oob_data_request); case BT_SECURITY_L4: - return (get_io_capa() != BT_SMP_IO_NO_INPUT_OUTPUT || - (bt_auth && bt_auth->oob_data_request)) && sc_supported; + return (get_io_capa(smp) != BT_SMP_IO_NO_INPUT_OUTPUT || + (smp_auth_cb && smp_auth_cb->oob_data_request)) && sc_supported; default: return false; } @@ -2969,7 +2995,7 @@ static int smp_send_security_req(struct bt_conn *conn) } /* early verify if required sec level if reachable */ - if (!(sec_level_reachable(conn) || smp_keys_check(conn))) { + if (!(sec_level_reachable(smp) || smp_keys_check(conn))) { return -EINVAL; } @@ -2991,7 +3017,7 @@ static int smp_send_security_req(struct bt_conn *conn) } req = net_buf_add(req_buf, sizeof(*req)); - req->auth_req = get_auth(conn, BT_SMP_AUTH_DEFAULT); + req->auth_req = get_auth(smp, BT_SMP_AUTH_DEFAULT); /* SMP timer is not restarted for SecRequest so don't use smp_send */ err = bt_l2cap_send(conn, BT_L2CAP_CID_SMP, req_buf); @@ -3009,6 +3035,8 @@ static int smp_send_security_req(struct bt_conn *conn) static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) { struct bt_conn *conn = smp->chan.chan.conn; + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); + struct bt_smp_pairing *req = (void *)buf->data; struct bt_smp_pairing *rsp; uint8_t err; @@ -3048,8 +3076,8 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) smp->prsp[0] = BT_SMP_CMD_PAIRING_RSP; rsp = (struct bt_smp_pairing *)&smp->prsp[1]; - rsp->auth_req = get_auth(conn, req->auth_req); - rsp->io_capability = get_io_capa(); + rsp->auth_req = get_auth(smp, req->auth_req); + rsp->io_capability = get_io_capa(smp); rsp->oob_flag = oobd_present ? BT_SMP_OOB_PRESENT : BT_SMP_OOB_NOT_PRESENT; rsp->max_key_size = BT_SMP_MAX_ENC_KEY_SIZE; @@ -3099,7 +3127,7 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) return BT_SMP_ERR_AUTH_REQUIREMENTS; #else if (IS_ENABLED(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)) { - err = smp_pairing_accept_query(conn, req); + err = smp_pairing_accept_query(smp, req); if (err) { return err; } @@ -3110,7 +3138,7 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) } if (IS_ENABLED(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)) { - err = smp_pairing_accept_query(conn, req); + err = smp_pairing_accept_query(smp, req); if (err) { return err; } @@ -3118,9 +3146,9 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && !atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && - bt_auth && bt_auth->pairing_confirm) { + smp_auth_cb && smp_auth_cb->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); - bt_auth->pairing_confirm(conn); + smp_auth_cb->pairing_confirm(conn); return 0; } @@ -3195,7 +3223,7 @@ static int smp_send_pairing_req(struct bt_conn *conn) } /* early verify if required sec level if reachable */ - if (!sec_level_reachable(conn)) { + if (!sec_level_reachable(smp)) { return -EINVAL; } @@ -3217,8 +3245,8 @@ static int smp_send_pairing_req(struct bt_conn *conn) req = net_buf_add(req_buf, sizeof(*req)); - req->auth_req = get_auth(conn, BT_SMP_AUTH_DEFAULT); - req->io_capability = get_io_capa(); + req->auth_req = get_auth(smp, BT_SMP_AUTH_DEFAULT); + req->io_capability = get_io_capa(smp); req->oob_flag = oobd_present ? BT_SMP_OOB_PRESENT : BT_SMP_OOB_NOT_PRESENT; req->max_key_size = BT_SMP_MAX_ENC_KEY_SIZE; @@ -3244,6 +3272,7 @@ static int smp_send_pairing_req(struct bt_conn *conn) static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) { struct bt_conn *conn = smp->chan.chan.conn; + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_smp_pairing *rsp = (void *)buf->data; struct bt_smp_pairing *req = (struct bt_smp_pairing *)&smp->preq[1]; uint8_t err; @@ -3297,7 +3326,7 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) return BT_SMP_ERR_AUTH_REQUIREMENTS; #else if (IS_ENABLED(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)) { - err = smp_pairing_accept_query(conn, rsp); + err = smp_pairing_accept_query(smp, rsp); if (err) { return err; } @@ -3311,7 +3340,7 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) smp->remote_dist &= RECV_KEYS_SC; if (IS_ENABLED(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)) { - err = smp_pairing_accept_query(conn, rsp); + err = smp_pairing_accept_query(smp, rsp); if (err) { return err; } @@ -3319,9 +3348,9 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && - bt_auth && bt_auth->pairing_confirm) { + smp_auth_cb && smp_auth_cb->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); - bt_auth->pairing_confirm(conn); + smp_auth_cb->pairing_confirm(conn); return 0; } @@ -3711,6 +3740,7 @@ static void le_sc_oob_config_set(struct bt_smp *smp, static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) { + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_smp_pairing_random *req = (void *)buf->data; uint32_t passkey; uint8_t err; @@ -3742,7 +3772,7 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) atomic_set_bit(smp->flags, SMP_FLAG_USER); atomic_set_bit(smp->flags, SMP_FLAG_DHKEY_SEND); - bt_auth->passkey_confirm(smp->chan.chan.conn, passkey); + smp_auth_cb->passkey_confirm(smp->chan.chan.conn, passkey); return 0; case JUST_WORKS: break; @@ -3786,7 +3816,7 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) } atomic_set_bit(smp->flags, SMP_FLAG_USER); - bt_auth->passkey_confirm(smp->chan.chan.conn, passkey); + smp_auth_cb->passkey_confirm(smp->chan.chan.conn, passkey); break; case JUST_WORKS: break; @@ -3822,7 +3852,7 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) return BT_SMP_ERR_UNSPECIFIED; } - if (bt_auth && bt_auth->oob_data_request) { + if (smp_auth_cb && smp_auth_cb->oob_data_request) { struct bt_conn_oob_info info = { .type = BT_CONN_OOB_LE_SC, .lesc.oob_config = BT_CONN_OOB_NO_DATA, @@ -3834,7 +3864,7 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) smp->oobd_remote = NULL; atomic_set_bit(smp->flags, SMP_FLAG_OOB_PENDING); - bt_auth->oob_data_request(smp->chan.chan.conn, &info); + smp_auth_cb->oob_data_request(smp->chan.chan.conn, &info); return 0; } else { @@ -3856,14 +3886,15 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) static uint8_t smp_pairing_failed(struct bt_smp *smp, struct net_buf *buf) { struct bt_conn *conn = smp->chan.chan.conn; + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_smp_pairing_fail *req = (void *)buf->data; BT_ERR("reason 0x%x", req->reason); if (atomic_test_and_clear_bit(smp->flags, SMP_FLAG_USER) || atomic_test_and_clear_bit(smp->flags, SMP_FLAG_DISPLAY)) { - if (bt_auth && bt_auth->cancel) { - bt_auth->cancel(conn); + if (smp_auth_cb && smp_auth_cb->cancel) { + smp_auth_cb->cancel(conn); } } @@ -4102,7 +4133,7 @@ static uint8_t smp_security_request(struct bt_smp *smp, struct net_buf *buf) /* if MITM required key must be authenticated */ if ((auth & BT_SMP_AUTH_MITM) && !(conn->le.keys->flags & BT_KEYS_AUTHENTICATED)) { - if (get_io_capa() != BT_SMP_IO_NO_INPUT_OUTPUT) { + if (get_io_capa(smp) != BT_SMP_IO_NO_INPUT_OUTPUT) { BT_INFO("New auth requirements: 0x%x, repairing", auth); goto pair; @@ -4163,6 +4194,9 @@ static uint8_t generate_dhkey(struct bt_smp *smp) static uint8_t display_passkey(struct bt_smp *smp) { + struct bt_conn *conn = smp->chan.chan.conn; + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); + if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_INVALID) { smp->passkey = fixed_passkey; @@ -4176,9 +4210,9 @@ static uint8_t display_passkey(struct bt_smp *smp) smp->passkey_round = 0U; - if (bt_auth && bt_auth->passkey_display) { + if (smp_auth_cb && smp_auth_cb->passkey_display) { atomic_set_bit(smp->flags, SMP_FLAG_DISPLAY); - bt_auth->passkey_display(smp->chan.chan.conn, smp->passkey); + smp_auth_cb->passkey_display(conn, smp->passkey); } smp->passkey = sys_cpu_to_le32(smp->passkey); @@ -4189,6 +4223,7 @@ static uint8_t display_passkey(struct bt_smp *smp) #if defined(CONFIG_BT_PERIPHERAL) static uint8_t smp_public_key_periph(struct bt_smp *smp) { + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); uint8_t err; if (!atomic_test_bit(smp->flags, SMP_FLAG_SC_DEBUG_KEY) && @@ -4228,7 +4263,7 @@ static uint8_t smp_public_key_periph(struct bt_smp *smp) atomic_set_bit(smp->allowed_cmds, BT_SMP_CMD_PAIRING_CONFIRM); atomic_set_bit(smp->allowed_cmds, BT_SMP_KEYPRESS_NOTIFICATION); atomic_set_bit(smp->flags, SMP_FLAG_USER); - bt_auth->passkey_entry(smp->chan.chan.conn); + smp_auth_cb->passkey_entry(smp->chan.chan.conn); break; case LE_SC_OOB: atomic_set_bit(smp->allowed_cmds, BT_SMP_CMD_PAIRING_RANDOM); @@ -4244,6 +4279,7 @@ static uint8_t smp_public_key_periph(struct bt_smp *smp) static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) { + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_smp_public_key *req = (void *)buf->data; uint8_t err; @@ -4301,7 +4337,7 @@ static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) break; case PASSKEY_INPUT: atomic_set_bit(smp->flags, SMP_FLAG_USER); - bt_auth->passkey_entry(smp->chan.chan.conn); + smp_auth_cb->passkey_entry(smp->chan.chan.conn); atomic_set_bit(smp->allowed_cmds, BT_SMP_KEYPRESS_NOTIFICATION); @@ -4313,7 +4349,7 @@ static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) return BT_SMP_ERR_UNSPECIFIED; } - if (bt_auth && bt_auth->oob_data_request) { + if (smp_auth_cb && smp_auth_cb->oob_data_request) { struct bt_conn_oob_info info = { .type = BT_CONN_OOB_LE_SC, .lesc.oob_config = BT_CONN_OOB_NO_DATA, @@ -4326,8 +4362,7 @@ static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) atomic_set_bit(smp->flags, SMP_FLAG_OOB_PENDING); - bt_auth->oob_data_request(smp->chan.chan.conn, - &info); + smp_auth_cb->oob_data_request(smp->chan.chan.conn, &info); } else { return BT_SMP_ERR_OOB_NOT_AVAIL; } @@ -4597,6 +4632,8 @@ static void bt_smp_connected(struct bt_l2cap_chan *chan) k_work_init_delayable(&smp->work, smp_timeout); smp_reset(smp); + + atomic_ptr_set(&smp->auth_cb, BT_SMP_AUTH_CB_UNINITIALIZED); } static void bt_smp_disconnected(struct bt_l2cap_chan *chan) @@ -5284,6 +5321,22 @@ static inline int smp_self_test(void) } #endif +int bt_smp_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb) +{ + struct bt_smp *smp; + + smp = smp_chan_get(conn); + if (!smp) { + return -EINVAL; + } + + if (atomic_ptr_cas(&smp->auth_cb, BT_SMP_AUTH_CB_UNINITIALIZED, (atomic_ptr_val_t)cb)) { + return 0; + } else { + return -EALREADY; + } +} + int bt_smp_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) { struct bt_smp *smp; diff --git a/subsys/bluetooth/host/smp.h b/subsys/bluetooth/host/smp.h index e1f20094bc4..83d2b570f6c 100644 --- a/subsys/bluetooth/host/smp.h +++ b/subsys/bluetooth/host/smp.h @@ -141,6 +141,7 @@ int bt_smp_br_send_pairing_req(struct bt_conn *conn); int bt_smp_init(void); +int bt_smp_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb); int bt_smp_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey); int bt_smp_auth_passkey_confirm(struct bt_conn *conn); int bt_smp_auth_pairing_confirm(struct bt_conn *conn); From d3631f504dd968d7e6442b8cb33ba084096c5d90 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Wed, 10 Aug 2022 13:48:55 +0200 Subject: [PATCH 064/501] [nrf fromtree] bluetooth: host: Increase long workqueue stack size Change increases long workqueue stack size to prevent stack overflows while processing GATT database hash. CONFIG_BT_HCI_ECC_STACK_SIZE is removed, because the configured stack was removed. Signed-off-by: Marek Pieta (cherry picked from commit 13e3d392bc9127c41f6f072ba687387bd38a99ca) --- doc/releases/release-notes-3.2.rst | 2 ++ subsys/bluetooth/host/Kconfig | 13 ++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/doc/releases/release-notes-3.2.rst b/doc/releases/release-notes-3.2.rst index ee23cd43fdc..0adebbe54d3 100644 --- a/doc/releases/release-notes-3.2.rst +++ b/doc/releases/release-notes-3.2.rst @@ -97,6 +97,8 @@ Bluetooth * Host * Added :c:func:`bt_conn_auth_cb_overlay` to overlay authentication callbacks for a Bluetooth LE connection. + * Removed ``CONFIG_BT_HCI_ECC_STACK_SIZE``. + The Bluetooth long workqueue (:kconfig:option:`CONFIG_BT_LONG_WQ`) is used for processing ECC commands instead of the dedicated thread. * Mesh diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 54461917fa3..3fb0c552a8f 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -15,7 +15,8 @@ config BT_LONG_WQ_STACK_SIZE # Hidden: Long workqueue stack size. Should be derived from system # requirements. int - default BT_HCI_ECC_STACK_SIZE if BT_TINYCRYPT_ECC + default 1300 if BT_GATT_CACHING + default 1140 if BT_TINYCRYPT_ECC default 1024 config BT_LONG_WQ_PRIO @@ -59,16 +60,6 @@ config BT_HCI_TX_STACK_SIZE config BT_HCI_TX_STACK_SIZE_WITH_PROMPT bool "Override HCI Tx thread stack size" -config BT_HCI_ECC_STACK_SIZE - # NOTE: This value is derived from other symbols and should only be - # changed if required by architecture - int "HCI ECC thread stack size" - depends on BT_TINYCRYPT_ECC - default 1140 - help - NOTE: This is an advanced setting and should not be changed unless - absolutely necessary - config BT_HCI_TX_PRIO # Hidden option for Co-Operative Tx thread priority int From dcca10b33968fb4638860d63b41ba2fd75e1195e Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Mon, 14 Mar 2022 23:24:58 +0100 Subject: [PATCH 065/501] [nrf fromtree] doc: extend application sphinx extension to support west arguments This commit allows documentation examples that uses `west` to specify `west` arguments. Signed-off-by: Torsten Rasmussen (cherry picked from commit c89a58b7ff9eacc08748c579fd0a0f2042a4f30a) --- doc/_extensions/zephyr/application.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/_extensions/zephyr/application.py b/doc/_extensions/zephyr/application.py index f68238dc31f..9369fb7becf 100644 --- a/doc/_extensions/zephyr/application.py +++ b/doc/_extensions/zephyr/application.py @@ -89,6 +89,9 @@ class ZephyrAppCommandsDirective(Directive): if set, the generated output is a single code block with no additional comment lines + \:west-args: + if set, additional arguments to the west invocation (ignored for CMake) + ''' has_content = False required_arguments = 0 @@ -109,7 +112,8 @@ class ZephyrAppCommandsDirective(Directive): 'build-dir': directives.unchanged, 'goals': directives.unchanged_required, 'maybe-skip-config': directives.flag, - 'compact': directives.flag + 'compact': directives.flag, + 'west-args': directives.unchanged, } TOOLS = ['cmake', 'west', 'all'] @@ -138,6 +142,7 @@ def run(self): goals = self.options.get('goals').split() skip_config = 'maybe-skip-config' in self.options compact = 'compact' in self.options + west_args = self.options.get('west-args', None) if tool not in self.TOOLS: raise self.error('Unknown tool {}; choose from: {}'.format( @@ -188,7 +193,8 @@ def run(self): 'goals': goals, 'compact': compact, 'skip_config': skip_config, - 'generator': generator + 'generator': generator, + 'west_args': west_args } if 'west' in tools: @@ -237,11 +243,13 @@ def _generate_west(self, **kwargs): cd_into = kwargs['cd_into'] build_dir = kwargs['build_dir'] compact = kwargs['compact'] + west_args = kwargs['west_args'] kwargs['board'] = None # west always defaults to ninja gen_arg = ' -G\'Unix Makefiles\'' if generator == 'make' else '' cmake_args = gen_arg + self._cmake_args(**kwargs) cmake_args = ' --{}'.format(cmake_args) if cmake_args != '' else '' + west_args = ' {}'.format(west_args) if west_args else '' # ignore zephyr_app since west needs to run within # the installation. Instead rely on relative path. src = ' {}'.format(app) if app and not cd_into else '' @@ -263,8 +271,8 @@ def _generate_west(self, **kwargs): # defaulting to west. # # For now, this keeps the resulting commands working. - content.append('west build -b {}{}{}{}'. - format(board, dst, src, cmake_args)) + content.append('west build -b {}{}{}{}{}'. + format(board, west_args, dst, src, cmake_args)) # If we're signing, we want to do that next, so that flashing # etc. commands can use the signed file which must be created From d9eb4294486f8945e000f23a718c1a343187aab6 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Mon, 14 Mar 2022 23:27:07 +0100 Subject: [PATCH 066/501] [nrf fromtree] doc: sysbuild documentation guide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is this initial sysbuild guide on what sysbuild is and how to build a sample using sysbuild. It provides an architectural overview of sysbuild. Descriptions on how to use `west build` or `cmake` + `ninja` to build projects with the sysbuild infrastructure. Flashing is described through the use of `west flash`. Extending sysbuild with additional Zephyr based applications are described, and reference to CMake documentation for including non-Zephyr based applications are provided. Signed-off-by: Torsten Rasmussen Signed-off-by: Martí Bolívar (cherry picked from commit 4bb3ed19ad84ec6b0f345176e4a14c81b3f45ebd) --- doc/build/index.rst | 1 + doc/build/sysbuild/index.rst | 503 +++++++++++++++++++++++++ doc/build/sysbuild/sysbuild.svg | 4 + doc/develop/west/build-flash-debug.rst | 93 +++++ scripts/ci/check_compliance.py | 1 + 5 files changed, 602 insertions(+) create mode 100644 doc/build/sysbuild/index.rst create mode 100644 doc/build/sysbuild/sysbuild.svg diff --git a/doc/build/index.rst b/doc/build/index.rst index 05c0c2b630f..dc0c6bceffd 100644 --- a/doc/build/index.rst +++ b/doc/build/index.rst @@ -12,3 +12,4 @@ Build and Configuration Systems dts/index kconfig/index.rst zephyr_cmake_package.rst + sysbuild/index.rst diff --git a/doc/build/sysbuild/index.rst b/doc/build/sysbuild/index.rst new file mode 100644 index 00000000000..2b76e398c39 --- /dev/null +++ b/doc/build/sysbuild/index.rst @@ -0,0 +1,503 @@ +.. _sysbuild: + +Sysbuild (System build) +####################### + +Sysbuild is a higher-level build system that can be used to combine multiple +other build systems together. It is a higher-level layer that combines one +or more Zephyr build systems and optional additional build systems +into a hierarchical build system. + +For example, you can use sysbuild to build a Zephyr application together +with the MCUboot bootloader, flash them both onto your device, and +debug the results. + +Sysbuild works by configuring and building at least a Zephyr application and, optionally, as many +additional projects as you want. The additional projects can be either Zephyr applications +or other types of builds you want to run. + +Like Zephyr's :ref:`build system `, sysbuild is written in +CMake and uses :ref:`Kconfig `. + +Definitions +*********** + +The following are some key concepts used in this document: + +Single-image build + When sysbuild is used to create and manage just one Zephyr application's + build system. + +Multi-image build + When sysbuild is used to manage multiple build systems. + The word "image" is used because your main goal is usually to generate the binaries of the firmware + application images from each build system. + +Domain + Every Zephyr CMake build system managed by sysbuild. + +Multi-domain + When more than one Zephyr CMake build system (domain) is managed by sysbuild. + +Architectural Overview +********************** + +This figure is an overview of sysbuild's inputs, outputs, and user interfaces: + +.. figure:: sysbuild.svg + :align: center + :alt: Sysbuild architectural overview + :figclass: align-center + :width: 80% + +The following are some key sysbuild features indicated in this figure: + +- You can run sysbuild either with :ref:`west build + ` or directly via ``cmake``. + +- You can use sysbuild to generate application images from each build system, + shown above as ELF, BIN, and HEX files. + +- You can configure sysbuild or any of the build systems it manages using + various configuration variables. These variables are namespaced so that + sysbuild can direct them to the right build system. In some cases, such as + the ``BOARD`` variable, these are shared among multiple build systems. + +- Sysbuild itself is also configured using Kconfig. For example, you can + instruct sysbuild to build the MCUboot bootloader, as well as to build and + link your main Zephyr application as an MCUboot child image, using sysbuild's + Kconfig files. + +- Sysbuild integrates with west's :ref:`west-build-flash-debug` commands. It + does this by managing the :ref:`west-runner`, and specifically the + :file:`runners.yaml` files that each Zephyr build system will contain. These + are packaged into a global view of how to flash and debug each build system + in a :file:`domains.yaml` file generated and managed by sysbuild. + +Building with sysbuild +********************** + +As mentioned above, you can run sysbuild via ``west build`` or ``cmake``. + +.. tabs:: + + .. group-tab:: ``west build`` + + Here is an example. For details, see :ref:`west-multi-domain-builds` in + the ``west build documentation``. + + .. zephyr-app-commands:: + :tool: west + :app: samples/hello_world + :board: reel_board + :goals: build + :west-args: --sysbuild + :compact: + + .. tip:: + + To configure ``west build`` to use ``--sysbuild`` by default from now on, + run:: + + west config build.sysbuild True + + Since sysbuild supports both single- and multi-image builds, this lets you + use sysbuild all the time, without worrying about what type of build you are + running. + + To turn this off, run this before generating your build system:: + + west config build.sysbuild False + + To turn this off for just one ``west build`` command, run:: + + west build --no-sysbuild ... + + .. group-tab:: ``cmake`` + + Here is an example using CMake and Ninja. + + .. zephyr-app-commands:: + :tool: cmake + :app: share/sysbuild + :board: reel_board + :goals: build + :gen-args: -DAPP_DIR=samples/hello_world + :compact: + + To use sysbuild directly with CMake, you must specify the sysbuild + project as the source folder, and give ``-DAPP_DIR=`` as + an extra CMake argument. ``APP_DIR`` is the path to the main Zephyr + application managed by sysbuild. + +Configuration namespacing +************************* + +When building a single Zephyr application without sysbuild, all CMake cache +settings and Kconfig build options given on the command line as +``-D=`` or ``-DCONFIG_=`` are handled by the Zephyr +build system. + +However, when sysbuild combines multiple Zephyr build systems, there could be +Kconfig settings exclusive to sysbuild (and not used by any of the applications). +To handle this, sysbuild has namespaces for configuration variables. You can use these +namespaces to direct settings either to sysbuild itself or to a specific Zephyr +application managed by sysbuild using the information in these sections. + +The following example shows how to build :ref:`hello_world` with MCUboot enabled, +applying to both images debug optimizations: + +.. tabs:: + + .. group-tab:: ``west build`` + + .. zephyr-app-commands:: + :tool: west + :app: samples/hello_world + :board: reel_board + :goals: build + :west-args: --sysbuild + :gen-args: -DSB_CONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_DEBUG_OPTIMIZATIONS=y -Dmcuboot_DEBUG_OPTIMIZATIONS=y + :compact: + + .. group-tab:: ``cmake`` + + .. zephyr-app-commands:: + :tool: cmake + :app: share/sysbuild + :board: reel_board + :goals: build + :gen-args: -DAPP_DIR=samples/hello_world -DSB_CONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_DEBUG_OPTIMIZATIONS=y -Dmcuboot_DEBUG_OPTIMIZATIONS=y + :compact: + +See the following subsections for more information. + +.. _sysbuild_cmake_namespace: + +CMake variable namespacing +========================== + +CMake variable settings can be passed to CMake using ``-D=`` on the +command line. You can also set Kconfig options via CMake as +``-DCONFIG_=`` or ``-D_CONFIG_=``. + +Since sysbuild is the entry point for the build system, and sysbuild is written +in CMake, all CMake variables are first processed by sysbuild. + +Sysbuild creates a namespace for each domain. The namespace prefix is the +domain's application name. See :ref:`sysbuild_zephyr_application` for more +information. + +To set the variable ```` in the namespace ````, use this syntax:: + + -D_= + +For example, to set the CMake variable ``FOO`` in the ``my_sample`` application +build system to the value ``BAR``, run the following commands: + +.. tabs:: + + .. group-tab:: ``west build`` + + :: + + west build --sysbuild ... -- -Dmy_sample_FOO=BAR + + .. group-tab:: ``cmake`` + + :: + + cmake -Dmy_sample_FOO=BAR ... + +.. _sysbuild_kconfig_namespacing: + +Kconfig namespacing +=================== + +To set the sysbuild Kconfig option ```` to the value ````, use this syntax:: + + -DSB_CONFIG_= + +In the previous example, ``SB_CONFIG`` is the namespace prefix for sysbuild's Kconfig +options. + +To set a Zephyr application's Kconfig option instead, use this syntax:: + + -D_CONFIG_= + +In the previous example, ```` is the application name discussed above in +:ref:`sysbuild_cmake_namespace`. + +For example, to set the Kconfig option ``FOO`` in the ``my_sample`` application +build system to the value ``BAR``, run the following commands: + +.. tabs:: + + .. group-tab:: ``west build`` + + :: + + west build --sysbuild ... -- -Dmy_sample_CONFIG_FOO=BAR + + .. group-tab:: ``cmake`` + + :: + + cmake -Dmy_sample_CONFIG_FOO=BAR ... + +.. tip:: + When no ```` is used, the Kconfig setting is passed to the main + Zephyr application ``my_sample``. + + This means that passing ``-DCONFIG_=`` and + ``-Dmy_sample_CONFIG_=`` are equivalent. + + This allows you to build the same application with or without sysbuild using + the same syntax for setting Kconfig values at CMake time. + For example, the following commands will work in the same way: + + :: + + west build -b my_sample -- -DCONFIG_FOO=BAR + + :: + + west build -b --sysbuild my_sample -- -DCONFIG_FOO=BAR + +Sysbuild flashing using ``west flash`` +************************************** + +You can use :ref:`west flash ` to flash applications with +sysbuild. + +When invoking ``west flash`` on a build consisting of multiple images, each +image is flashed in sequence. Extra arguments such as ``--runner jlink`` are +passed to each invocation. + +For more details, see :ref:`west-multi-domain-flashing`. + +Sysbuild debugging using ``west debug`` +*************************************** + +You can use ``west debug`` to debug the main application, whether you are using sysbuild or not. +Just follow the existing :ref:`west debug ` guide to debug the main sample. + +To debug a different domain (Zephyr application), such as ``mcuboot``, use +the ``--domain`` argument, as follows:: + + west debug --domain mcuboot + +For more details, see :ref:`west-multi-domain-debugging`. + +Building a sample with MCUboot +****************************** + +Sysbuild supports MCUboot natively. + +To build a sample like ``hello_world`` with MCUboot, +enable MCUboot and build and flash the sample as follows: + +.. tabs:: + + .. group-tab:: ``west build`` + + .. zephyr-app-commands:: + :tool: west + :app: samples/hello_world + :board: reel_board + :goals: build + :west-args: --sysbuild + :gen-args: -DSB_CONFIG_BOOTLOADER_MCUBOOT=y + :compact: + + .. group-tab:: ``cmake`` + + .. zephyr-app-commands:: + :tool: cmake + :app: share/sysbuild + :board: reel_board + :goals: build + :gen-args: -DAPP_DIR=samples/hello_world -DSB_CONFIG_BOOTLOADER_MCUBOOT=y + :compact: + +This builds ``hello_world`` and ``mcuboot`` for the ``reel_board``, and then +flashes both the ``mcuboot`` and ``hello_world`` application images to the +board. + +More detailed information regarding the use of MCUboot with Zephyr can be found +in the `MCUboot with Zephyr`_ documentation page on the MCUboot website. + +.. note:: + + MCUBoot default configuration will perform a full chip erase when flashed. + This can be controlled through the MCUBoot Kconfig option + ``CONFIG_ZEPHYR_TRY_MASS_ERASE``. If this option is enabled, then flashing + only MCUBoot, for example using ``west flash --domain mcuboot``, may erase + the entire flash, including the main application image. + +Sysbuild Kconfig file +********************* + +You can set sysbuild's Kconfig options for a single application using +configuration files. By default, sysbuild looks for a configuration file named +``sysbuild.conf`` in the application top-level directory. + +In the following example, there is a :file:`sysbuild.conf` file that enables building and flashing with +MCUboot whenever sysbuild is used: + +.. code-block:: none + + /application + ├── CMakeLists.txt + ├── prj.conf + └── sysbuild.conf + + +.. code-block:: none + + SB_CONFIG_BOOTLOADER_MCUBOOT=y + +You can set a configuration file to use with the +``-DSB_CONF_FILE=`` CMake build setting. + +For example, you can create ``sysbuild-mcuboot.conf`` and then +specify this file when building with sysbuild, as follows: + +.. tabs:: + + .. group-tab:: ``west build`` + + .. zephyr-app-commands:: + :tool: west + :app: samples/hello_world + :board: reel_board + :goals: build + :west-args: --sysbuild + :gen-args: -DSB_CONF_FILE=sysbuild-mcuboot.conf + :compact: + + .. group-tab:: ``cmake`` + + .. zephyr-app-commands:: + :tool: cmake + :app: share/sysbuild + :board: reel_board + :goals: build + :gen-args: -DAPP_DIR=samples/hello_world -DSB_CONF_FILE=sysbuild-mcuboot.conf + :compact: + +.. _sysbuild_zephyr_application: + +Adding Zephyr applications to sysbuild +************************************** + +You can use the ``ExternalZephyrProject_Add()`` function to add Zephyr +applications as sysbuild domains. Call this CMake function from your main +:file:`CMakeLists.txt` file, or any other CMake file you know will run. + +Targeting the same board +======================== + +To include ``my_sample`` as another sysbuild domain, targeting the same board +as the main image, use this example: + +.. code-block:: cmake + + ExternalZephyrProject_Add( + APPLICATION my_sample + SOURCE_DIR /my_sample + BUILD_ALWAYS True + ) + +This could be useful, for example, if your board requires you to build and flash an +SoC-specific bootloader along with your main application. + +Targeting a different board +=========================== + +In sysbuild and Zephyr CMake build system a board may refer to: + +* A physical board with a single core SoC. +* A specific core on a physical board with a multi-core SoC, such as + :ref:`nrf5340dk_nrf5340`. +* A specific SoC on a physical board with multiple SoCs, such as + :ref:`nrf9160dk_nrf9160` and :ref:`nrf9160dk_nrf52840`. + +If your main application, for example, is built for ``mps2_an521``, and your +helper application must target the ``mps2_an521_remote`` board (cpu1), add +a CMake function call that is structured as follows: + +.. code-block:: cmake + + ExternalZephyrProject_Add( + APPLICATION my_sample + SOURCE_DIR /my_sample + BOARD mps2_an521_remote + BUILD_ALWAYS True + ) + +This could be useful, for example, if your main application requires another +helper Zephyr application to be built and flashed alongside it, but the helper +runs on another core in your SoC. + +Targeting conditionally using Kconfig +===================================== + +You can control whether extra applications are included as sysbuild domains +using Kconfig. + +If the extra application image is specific to the board or an application, +you can create two additional files: :file:`sysbuild.cmake` and :file:`Kconfig.sysbuild`. + +For an application, this would look like this: + +.. code-block:: none + + /application + ├── CMakeLists.txt + ├── prj.conf + ├── Kconfig.sysbuild + └── sysbuild.cmake + +In the previous example, :file:`sysbuild.cmake` would be structured as follows: + +.. code-block:: cmake + + if(SB_CONFIG_SECOND_SAMPLE) + ExternalZephyrProject_Add( + APPLICATION second_sample + SOURCE_DIR /second_sample + BUILD_ALWAYS True + ) + endif() + +:file:`Kconfig.sysbuild` would be structured as follows: + +.. code-block:: kconfig + + source "sysbuild/Kconfig" + + config SECOND_SAMPLE + bool "Second sample" + default y + +This will include ``second_sample`` by default, while still allowing you to +disable it using the Kconfig option ``SECOND_SAMPLE``. + +For more information on setting sysbuild Kconfig options, +see :ref:`sysbuild_kconfig_namespacing`. + +Adding non-Zephyr applications to sysbuild +****************************************** + +You can include non-Zephyr applications in a multi-image build using the +standard CMake module `ExternalProject`_. Please refer to the CMake +documentation for usage details. + +When using ``ExternalProject``, the non-Zephyr application will be built as +part of the sysbuild build invocation, but ``west flash`` or ``west debug`` +will not be aware of the application. Instead, you must manually flash and +debug the application. + +.. _MCUboot with Zephyr: https://mcuboot.com/documentation/readme-zephyr/ +.. _ExternalProject: https://cmake.org/cmake/help/latest/module/ExternalProject.html diff --git a/doc/build/sysbuild/sysbuild.svg b/doc/build/sysbuild/sysbuild.svg new file mode 100644 index 00000000000..6c2292e0b84 --- /dev/null +++ b/doc/build/sysbuild/sysbuild.svg @@ -0,0 +1,4 @@ + + + +
west build
 / cmake
west build...
Sysbuild CMake (share/sysbuild/CMakeLists.txt)
Sysbuild CMake (share/sysbuild/CMakeLists.txt)
<app> CMake build
<app> CMake build
MCUboot build
MCUboot build
BOARD
CONF_FILE
<app> settings
Bootloader settings
Other settings
BOARD...
BOARD
mcuboot settings
Bootloader settings
Other settings
BOARD...
MCUboot
MCUboot
enabled
enabled
runners.yaml
runners.yaml
elf, bin, hex,
....
elf, bin, hex,...
runners.yaml
runners.yaml
elf, bin, hex,
....
elf, bin, hex,...
Actor
Actor
BOARD
CONF_FILE
CONFIG_<SETTING>
<app>_CONFIG_SETTING
mcuboot_CONFIG_SETTING
BOARD...
Kconfig
Kconfig
SB_CONF_FILE
SB_CONF_FILE
domains.yaml
domains.yaml
Board specific build
Sample specific build
Board specific build...
BOARD
mcuboot settings
Bootloader settings
Other settings
BOARD...
enabled
enabled
elf, bin, hex,
....
elf, bin, hex,...
runners.yaml
runners.yaml
Board / sample Kconfig
Board / sample Kconfig
Extra image
Extra image
Board / sample CMake
Board / sample CMake
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/develop/west/build-flash-debug.rst b/doc/develop/west/build-flash-debug.rst index f741b847d73..289817706b0 100644 --- a/doc/develop/west/build-flash-debug.rst +++ b/doc/develop/west/build-flash-debug.rst @@ -67,6 +67,32 @@ build directory; ``west build`` can figure out the board from the CMake cache. For new builds, the ``--board`` option, :envvar:`BOARD` environment variable, or ``build.board`` configuration option are checked (in that order). +.. _west-multi-domain-builds: + +Sysbuild (multi-domain builds) +============================== + +:ref:`sysbuild` can be used to create a multi-domain build system combining +multiple images for a single or multiple boards. + +Use ``--sysbuild`` to select the :ref:`sysbuild` build infrastructure with +``west build`` to build multiple domains. + +More detailed information regarding the use of sysbuild can be found in the +:ref:`sysbuild` guide. + +.. tip:: + + The ``build.sysbuild`` configuration option can be enabled to tell + ``west build`` to default build using sysbuild. + ``--no-sysbuild`` can be used to disable sysbuild for a specific build. + +``west build`` will build all domains through the top-level build folder of the +domains specified by sysbuild. + +A single domain from a multi-domain project can be built by using ``--domain`` +argument. + Examples ======== @@ -311,6 +337,19 @@ For example, to build with 4 cores:: The ``-o`` option is described further in the previous section. +Build a single domain +--------------------- + +In a multi-domain build with :ref:`hello_world` and `MCUboot`_, you can use +``--domain hello_world`` to only build this domain:: + + west build --sysbuild --domain hello_world + +The ``--domain`` argument can be combined with the ``--target`` argument to +build the specific target for the target, for example:: + + west build --sysbuild --domain hello_world --target help + .. _west-building-config: Configuration Options @@ -374,6 +413,9 @@ You can :ref:`configure ` ``west build`` using these options. directory). - ``always``: Always make the build folder pristine before building, if a build system is present. + * - ``build.sysbuild`` + - Boolean, default ``false``. If ``true``, build application using the + sysbuild infrastructure. .. _west-flashing: @@ -476,6 +518,23 @@ For example, to print usage information about the ``jlink`` runner:: west flash -H -r jlink +.. _west-multi-domain-flashing: + +Multi-domain flashing +===================== + +When a :ref:`west-multi-domain-builds` folder is detected, then ``west flash`` +will flash all domains in the order defined by sysbuild. + +It is possible to flash the image from a single domain in a multi-domain project +by using ``--domain``. + +For example, in a multi-domain build with :ref:`hello_world` and +`MCUboot`_, you can use the ``--domain hello_world`` domain to only flash +only the image from this domain:: + + west flash --domain hello_world + .. _west-debugging: Debugging: ``west debug``, ``west debugserver`` @@ -576,6 +635,38 @@ For example, to print usage information about the ``jlink`` runner:: west debug -H -r jlink +.. _west-multi-domain-debugging: + +Multi-domain debugging +====================== + +``west debug`` can only debug a single domain at a time. When a +:ref:`west-multi-domain-builds` folder is detected, ``west debug`` +will debug the ``default`` domain specified by sysbuild. + +The default domain will be the application given as the source directory. +See the following example:: + + west build --sysbuild path/to/source/directory + +For example, when building ``hello_world`` with `MCUboot`_ using sysbuild, +``hello_world`` becomes the default domain:: + + west build --sysbuild samples/hello_world + +So to debug ``hello_world`` you can do:: + + west debug + +or:: + + west debug --domain hello_world + +If you wish to debug MCUboot, you must explicitly specify MCUboot as the domain +to debug:: + + west debug --domain mcuboot + .. _west-runner: Flash and debug runners @@ -648,3 +739,5 @@ commands do it). .. _CMake Generator: https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html + +.. _MCUboot: https://mcuboot.com/ diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 0201312117e..168fb193ab1 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -622,6 +622,7 @@ def get_defined_syms(kconf): "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "MODVERSIONS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "SECURITY_LOADPIN", # Linux, in boards/xtensa/intel_adsp_cavs25/doc + "ZEPHYR_TRY_MASS_ERASE", # MCUBoot setting described in sysbuild documentation } class KconfigBasicCheck(KconfigCheck, ComplianceTest): From 9b7fe6e030df20069ac9f0248440e50a218e2799 Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 20:47:52 +0200 Subject: [PATCH 067/501] [nrf fromtree] boards: actinius_icarus_*: only include `board.c` in non-secure targets Refrain from including `board.c` in secure targets as a workaround for SPM having the GPIO driver disabled. Signed-off-by: Alex Tsamakos (cherry picked from commit 415525715a25db7fc144bff1b59c5889baac42df) --- boards/arm/actinius_icarus/CMakeLists.txt | 7 +++++-- boards/arm/actinius_icarus_bee/CMakeLists.txt | 7 +++++-- boards/arm/actinius_icarus_som/CMakeLists.txt | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/boards/arm/actinius_icarus/CMakeLists.txt b/boards/arm/actinius_icarus/CMakeLists.txt index 7c3d5dcfe15..5682578f59c 100644 --- a/boards/arm/actinius_icarus/CMakeLists.txt +++ b/boards/arm/actinius_icarus/CMakeLists.txt @@ -1,7 +1,10 @@ # -# Copyright (c) 2019 Actinius +# Copyright (c) 2019-2022 Actinius # # SPDX-License-Identifier: Apache-2.0 zephyr_library() -zephyr_library_sources(board.c) + +if (CONFIG_BOARD_ACTINIUS_ICARUS_NS) + zephyr_library_sources(board.c) +endif() diff --git a/boards/arm/actinius_icarus_bee/CMakeLists.txt b/boards/arm/actinius_icarus_bee/CMakeLists.txt index eb960d65665..c825edf00fd 100644 --- a/boards/arm/actinius_icarus_bee/CMakeLists.txt +++ b/boards/arm/actinius_icarus_bee/CMakeLists.txt @@ -1,7 +1,10 @@ # -# Copyright (c) 2021 Actinius +# Copyright (c) 2021-2022 Actinius # # SPDX-License-Identifier: Apache-2.0 zephyr_library() -zephyr_library_sources(board.c) + +if (CONFIG_BOARD_ACTINIUS_ICARUS_BEE_NS) + zephyr_library_sources(board.c) +endif() diff --git a/boards/arm/actinius_icarus_som/CMakeLists.txt b/boards/arm/actinius_icarus_som/CMakeLists.txt index eb960d65665..af50b08c869 100644 --- a/boards/arm/actinius_icarus_som/CMakeLists.txt +++ b/boards/arm/actinius_icarus_som/CMakeLists.txt @@ -1,7 +1,10 @@ # -# Copyright (c) 2021 Actinius +# Copyright (c) 2021-2022 Actinius # # SPDX-License-Identifier: Apache-2.0 zephyr_library() -zephyr_library_sources(board.c) + +if (CONFIG_BOARD_ACTINIUS_ICARUS_SOM_NS) + zephyr_library_sources(board.c) +endif() From 4730d7ab976be6a232aa1116b2b82d5e6cc6d080 Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 20:54:03 +0200 Subject: [PATCH 068/501] [nrf fromtree] boards: actinius_icarus_*: board.c: fix pin initialization Revert back to using `GPIO_OUTPUT_*` instead of `GPIO_OUTPUT_INIT_*` as the later does not including enabling the GPIO output. Signed-off-by: Alex Tsamakos (cherry picked from commit 9bb59080d7539e832b38b4b21cf073cdf37402c7) --- boards/arm/actinius_icarus/board.c | 8 +++++--- boards/arm/actinius_icarus_bee/board.c | 8 +++++--- boards/arm/actinius_icarus_som/board.c | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/boards/arm/actinius_icarus/board.c b/boards/arm/actinius_icarus/board.c index 7c9c17abbea..270dd550d50 100644 --- a/boards/arm/actinius_icarus/board.c +++ b/boards/arm/actinius_icarus/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Actinius + * Copyright (c) 2019-2022 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -19,14 +19,16 @@ static int board_actinius_icarus_init(const struct device *dev) ARG_UNUSED(dev); if (!device_is_ready(sim.port)) { + LOG_ERR("The SIM Select Pin port is not ready"); + return -ENODEV; } if (DT_ENUM_IDX(DT_NODELABEL(sim_select), sim) == 0) { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_HIGH); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_HIGH); LOG_INF("eSIM is selected"); } else { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_LOW); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_LOW); LOG_INF("External SIM is selected"); } diff --git a/boards/arm/actinius_icarus_bee/board.c b/boards/arm/actinius_icarus_bee/board.c index 6245f3d30b9..e127cf7866b 100644 --- a/boards/arm/actinius_icarus_bee/board.c +++ b/boards/arm/actinius_icarus_bee/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Actinius + * Copyright (c) 2021-2022 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -19,14 +19,16 @@ static int board_actinius_icarus_bee_init(const struct device *dev) ARG_UNUSED(dev); if (!device_is_ready(sim.port)) { + LOG_ERR("The SIM Select Pin port is not ready"); + return -ENODEV; } if (DT_ENUM_IDX(DT_NODELABEL(sim_select), sim) == 0) { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_HIGH); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_HIGH); LOG_INF("eSIM is selected"); } else { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_LOW); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_LOW); LOG_INF("External SIM is selected"); } diff --git a/boards/arm/actinius_icarus_som/board.c b/boards/arm/actinius_icarus_som/board.c index 0246d51d13b..fe19ae60bf0 100644 --- a/boards/arm/actinius_icarus_som/board.c +++ b/boards/arm/actinius_icarus_som/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Actinius + * Copyright (c) 2021-2022 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -19,14 +19,16 @@ static int board_actinius_icarus_som_init(const struct device *dev) ARG_UNUSED(dev); if (!device_is_ready(sim.port)) { + LOG_ERR("The SIM Select Pin port is not ready"); + return -ENODEV; } if (DT_ENUM_IDX(DT_NODELABEL(sim_select), sim) == 0) { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_HIGH); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_HIGH); LOG_INF("eSIM is selected"); } else { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_LOW); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_LOW); LOG_INF("External SIM is selected"); } From 31ac219c742dcda41889a330e34d231a320d71f8 Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 20:59:31 +0200 Subject: [PATCH 069/501] [nrf fromtree] boards: actinius_icarus_*: fix `sim-select` binding docs about enum use Change the documentation of the `sim-select` DT binding to explain the proper use of the configuration property using enum values. Signed-off-by: Alex Tsamakos (cherry picked from commit 667f268ff797d3e2fe2b9850d01457ba0732dbdf) --- boards/arm/actinius_icarus/dts/bindings/sim-select.yaml | 4 ++-- boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml | 4 ++-- boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml b/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml index 36687b8775d..f750f57c736 100644 --- a/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml +++ b/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml @@ -4,8 +4,8 @@ description: | The Icarus boards provide the user with 2 options regarding SIM usage for LTE-M/NB-IoT communication. Either using the on-board eSIM or using an - external nano-SIM. The SIM can be selected using the SIM select pin given by - the sim-gpios property by setting it to 0 (eSIM) or to 1 (external nano-SIM). + external nano-SIM. The SIM can be selected by changing the `sim` property + of the `sim_select` dt node to `esim` or `external`. compatible: "sim-select" diff --git a/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml b/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml index 36687b8775d..f750f57c736 100644 --- a/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml +++ b/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml @@ -4,8 +4,8 @@ description: | The Icarus boards provide the user with 2 options regarding SIM usage for LTE-M/NB-IoT communication. Either using the on-board eSIM or using an - external nano-SIM. The SIM can be selected using the SIM select pin given by - the sim-gpios property by setting it to 0 (eSIM) or to 1 (external nano-SIM). + external nano-SIM. The SIM can be selected by changing the `sim` property + of the `sim_select` dt node to `esim` or `external`. compatible: "sim-select" diff --git a/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml b/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml index 36687b8775d..f750f57c736 100644 --- a/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml +++ b/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml @@ -4,8 +4,8 @@ description: | The Icarus boards provide the user with 2 options regarding SIM usage for LTE-M/NB-IoT communication. Either using the on-board eSIM or using an - external nano-SIM. The SIM can be selected using the SIM select pin given by - the sim-gpios property by setting it to 0 (eSIM) or to 1 (external nano-SIM). + external nano-SIM. The SIM can be selected by changing the `sim` property + of the `sim_select` dt node to `esim` or `external`. compatible: "sim-select" From 158aa37b1d21e3c19d54a9507b344fc924dc61dd Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 21:05:38 +0200 Subject: [PATCH 070/501] [nrf fromtree] boards: actinius_icarus_bee: fix incorrect `sim-select` gpio Fix the pin number of the `sim-select` gpio to the correct one for the Icarus Bee. Signed-off-by: Alex Tsamakos (cherry picked from commit a6b87a2806d01e8b5901ecdd9576388a5ae623db) --- boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 53a4b4bac95..2af4a9242c0 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -83,7 +83,7 @@ sim_select: sim-select { compatible = "sim-select"; - sim-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; + sim-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; sim = "esim"; }; }; From cfa302df6cf516adf4dc6e7125b85c25e1ab419a Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 21:06:40 +0200 Subject: [PATCH 071/501] [nrf fromtree] boards: actinius_icarus_som: fix incorrect `sim-select` gpio Fix the pin number of the `sim-select` gpio to the correct one for the Icarus SoM. Signed-off-by: Alex Tsamakos (cherry picked from commit 110d355861ff2231e61ee172a149a5dbe12cd5a6) --- boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index 6c574899289..f62cde05f78 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -22,7 +22,7 @@ sim_select: sim-select { compatible = "sim-select"; - sim-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; + sim-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; sim = "esim"; }; }; From d683e1b17fcf46250a7db1d316735a62d1d40f96 Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 21:12:12 +0200 Subject: [PATCH 072/501] [nrf fromtree] boards: actinius_icarus_som: fix accelerometer INT pins Update the DT with the correct order of the INT1 and INT2 pins of the accelerometer. Signed-off-by: Alex Tsamakos (cherry picked from commit 86236d1cc162844c569fcb293a1388fc7e1d6104) --- boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index f62cde05f78..02bad1a0838 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -60,8 +60,8 @@ lis2dh12_accel: lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; - irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, - <&gpio0 29 GPIO_ACTIVE_HIGH>; + irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>, + <&gpio0 28 GPIO_ACTIVE_HIGH>; }; }; From 991cd231f5a1c0b7c414a4b7394e5bade92ef8a3 Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 21:13:02 +0200 Subject: [PATCH 073/501] [nrf fromtree] boards: actinius_icarus_bee: fix accelerometer INT pins Update the DT with the correct order of the INT1 and INT2 pins of the accelerometer. Signed-off-by: Alex Tsamakos (cherry picked from commit d0f4366fd3e211f012956e9e1d28926d902a64d3) --- boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 2af4a9242c0..a10eb420c47 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -121,8 +121,8 @@ lis2dh12_accel: lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; - irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, - <&gpio0 29 GPIO_ACTIVE_HIGH>; + irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>, + <&gpio0 28 GPIO_ACTIVE_HIGH>; }; }; From 13c5953037ef6486cc05109e54a6ad7fc5262336 Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 21:32:07 +0200 Subject: [PATCH 074/501] [nrf fromtree] boards: actinius_icarus_*: align def RAM plan with that of the nRF9160DK Align the default RAM allocation to be according to that of the nRF9160DK by reducing the reserved SRAM for the modem lib. Signed-off-by: Alex Tsamakos (cherry picked from commit 49d4e30a62fda7a4d3c4ff5159ccabcd45f3315a) --- boards/arm/actinius_icarus/actinius_icarus.yaml | 2 +- boards/arm/actinius_icarus/actinius_icarus_common.dts | 4 ++-- .../actinius_icarus/actinius_icarus_partition_conf.dts | 10 +++++----- .../arm/actinius_icarus_bee/actinius_icarus_bee.yaml | 2 +- .../actinius_icarus_bee/actinius_icarus_bee_common.dts | 4 ++-- .../actinius_icarus_bee_partition_conf.dts | 10 +++++----- .../arm/actinius_icarus_som/actinius_icarus_som.yaml | 2 +- .../actinius_icarus_som/actinius_icarus_som_common.dts | 6 +++--- .../actinius_icarus_som_partition_conf.dts | 10 +++++----- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/boards/arm/actinius_icarus/actinius_icarus.yaml b/boards/arm/actinius_icarus/actinius_icarus.yaml index 7e910822371..960c1c9704e 100644 --- a/boards/arm/actinius_icarus/actinius_icarus.yaml +++ b/boards/arm/actinius_icarus/actinius_icarus.yaml @@ -6,7 +6,7 @@ toolchain: - gnuarmemb - xtools - zephyr -ram: 64 +ram: 88 flash: 256 supported: - gpio diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index 784c96cf262..9cb859051d1 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Actinius + * Copyright (c) 2019-2022 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -220,7 +220,7 @@ /* Secure image memory */ }; - sram0_modem: image_modem@20010000 { + sram0_modem: image_modem@20016000 { /* Modem (shared) memory */ }; diff --git a/boards/arm/actinius_icarus/actinius_icarus_partition_conf.dts b/boards/arm/actinius_icarus/actinius_icarus_partition_conf.dts index 0dbe8fa7b2b..10025e29d02 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_partition_conf.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_partition_conf.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Actinius + * Copyright (c) 2019-2022 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -39,18 +39,18 @@ /* Default SRAM planning when building for nRF9160 with * ARM TrustZone-M support - * - Lowest 64 kB SRAM allocated to Secure image (sram0_s). - * - 64 kB SRAM reserved for and used by the modem library + * - Lowest 88 kB SRAM allocated to Secure image (sram0_s). + * - 40 kB SRAM reserved for and used by the modem library * (sram0_modem). This memory is Non-Secure. * - Upper 128 kB allocated to Non-Secure image (sram0_ns). */ &sram0_s { - reg = <0x20000000 DT_SIZE_K(64)>; + reg = <0x20000000 DT_SIZE_K(88)>; }; &sram0_modem { - reg = <0x20010000 DT_SIZE_K(64)>; + reg = <0x20016000 DT_SIZE_K(40)>; }; &sram0_ns { diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee.yaml b/boards/arm/actinius_icarus_bee/actinius_icarus_bee.yaml index 955c92c9790..be2865ea3ac 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee.yaml +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee.yaml @@ -6,7 +6,7 @@ toolchain: - gnuarmemb - xtools - zephyr -ram: 64 +ram: 88 flash: 256 supported: - gpio diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index a10eb420c47..6778d2bae3b 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Actinius + * Copyright (c) 2021-2022 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -211,7 +211,7 @@ /* Secure image memory */ }; - sram0_modem: image_modem@20010000 { + sram0_modem: image_modem@20016000 { /* Modem (shared) memory */ }; diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_partition_conf.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_partition_conf.dts index f26de60fe85..7f0713fab2f 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_partition_conf.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_partition_conf.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Actinius + * Copyright (c) 2021-2022 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -39,18 +39,18 @@ /* Default SRAM planning when building for nRF9160 with * ARM TrustZone-M support - * - Lowest 64 kB SRAM allocated to Secure image (sram0_s). - * - 64 kB SRAM reserved for and used by the modem library + * - Lowest 88 kB SRAM allocated to Secure image (sram0_s). + * - 40 kB SRAM reserved for and used by the modem library * (sram0_modem). This memory is Non-Secure. * - Upper 128 kB allocated to Non-Secure image (sram0_ns). */ &sram0_s { - reg = <0x20000000 DT_SIZE_K(64)>; + reg = <0x20000000 DT_SIZE_K(88)>; }; &sram0_modem { - reg = <0x20010000 DT_SIZE_K(64)>; + reg = <0x20016000 DT_SIZE_K(40)>; }; &sram0_ns { diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som.yaml b/boards/arm/actinius_icarus_som/actinius_icarus_som.yaml index 39f839afb7d..e2d4a2b1903 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som.yaml +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som.yaml @@ -6,7 +6,7 @@ toolchain: - gnuarmemb - xtools - zephyr -ram: 64 +ram: 88 flash: 256 supported: - gpio diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index 02bad1a0838..a581373e95c 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Actinius + * Copyright (c) 2021-2022 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -121,8 +121,8 @@ /* Secure image memory */ }; - sram0_modem: image_modem@20010000 { - /* BSD (shared) memory */ + sram0_modem: image_modem@20016000 { + /* Modem (shared) memory */ }; sram0_ns: image_ns@20020000 { diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_partition_conf.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_partition_conf.dts index 213a9162e76..69340365b03 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_partition_conf.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_partition_conf.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Actinius + * Copyright (c) 2021-2022 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -39,18 +39,18 @@ /* Default SRAM planning when building for nRF9160 with * ARM TrustZone-M support - * - Lowest 64 kB SRAM allocated to Secure image (sram0_s). - * - 64 kB SRAM reserved for and used by the modem library + * - Lowest 88 kB SRAM allocated to Secure image (sram0_s). + * - 40 kB SRAM reserved for and used by the modem library * (sram0_modem). This memory is Non-Secure. * - Upper 128 kB allocated to Non-Secure image (sram0_ns). */ &sram0_s { - reg = <0x20000000 DT_SIZE_K(64)>; + reg = <0x20000000 DT_SIZE_K(88)>; }; &sram0_modem { - reg = <0x20010000 DT_SIZE_K(64)>; + reg = <0x20016000 DT_SIZE_K(40)>; }; &sram0_ns { From 0628350e6bb7d95375b8eadcd0a324cafbd1dff2 Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 23:15:06 +0200 Subject: [PATCH 075/501] [nrf fromtree] boards: actinius_icarus: change bootloader/mcuboot LED to blue Change the DT properties related to the bootloader/mcuboot to set the LED to blue. Signed-off-by: Alex Tsamakos (cherry picked from commit f37201e61e5f48ed04d56b335cc11eed0e4e247b) --- boards/arm/actinius_icarus/actinius_icarus_common.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index 9cb859051d1..98170d80ac4 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -73,9 +73,9 @@ green-pwm-led = &green_pwm_led; blue-pwm-led = &blue_pwm_led; sw0 = &button0; - bootloader-led0 = &green_pwm_led; + bootloader-led0 = &blue_led; mcuboot-button0 = &button0; - mcuboot-led0 = &green_pwm_led; + mcuboot-led0 = &blue_led; watchdog0 = &wdt0; accel0 = &lis2dh12_accel; }; From d36e7473a5f0198fcdbd70daba0503b080e2514d Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Fri, 1 Jul 2022 23:15:30 +0200 Subject: [PATCH 076/501] [nrf fromtree] boards: actinius_icarus_bee: change bootloader/mcuboot LED to blue Change the DT properties related to the bootloader/mcuboot to set the LED to blue. Signed-off-by: Alex Tsamakos (cherry picked from commit 62fd4c68255b36411140e3136a457dfe8c3a7b41) --- boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 6778d2bae3b..20ea0c970d6 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -73,9 +73,9 @@ green-pwm-led = &green_pwm_led; blue-pwm-led = &blue_pwm_led; sw0 = &button0; - bootloader-led0 = &green_pwm_led; + bootloader-led0 = &blue_led; mcuboot-button0 = &button0; - mcuboot-led0 = &green_pwm_led; + mcuboot-led0 = &blue_led; watchdog0 = &wdt0; spi-flash0 = &w25q64; accel0 = &lis2dh12_accel; From bc9397961e625db4503ecd5343a10abbe0ce9ccb Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Thu, 11 Aug 2022 20:14:06 +0200 Subject: [PATCH 077/501] [nrf fromtree] boards: actinius_icarus: add support for hardware version v2.0 Add support for the new hardware version of the Icarus IoT Board. Signed-off-by: Alex Tsamakos (cherry picked from commit 73680a2581bede7183fb503c6d588afdcae5c60e) --- .../actinius_icarus_2_0_0.overlay | 7 + .../actinius_icarus_common.dts | 2 +- .../actinius_icarus_common_2_0_0.dtsi | 60 +++++++++ .../actinius_icarus_ns_2_0_0.overlay | 7 + boards/arm/actinius_icarus/board.c | 55 +++++++- .../doc/img/Icarus_internal_pinouts.png | Bin 9371 -> 0 bytes boards/arm/actinius_icarus/doc/index.rst | 124 ++++++++++++++++-- .../dts/bindings/actinius-charger-enable.yaml | 26 ++++ ...m-select.yaml => actinius-sim-select.yaml} | 4 +- boards/arm/actinius_icarus/revision.cmake | 8 ++ dts/bindings/vendor-prefixes.txt | 1 + 11 files changed, 273 insertions(+), 21 deletions(-) create mode 100644 boards/arm/actinius_icarus/actinius_icarus_2_0_0.overlay create mode 100644 boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi create mode 100644 boards/arm/actinius_icarus/actinius_icarus_ns_2_0_0.overlay delete mode 100644 boards/arm/actinius_icarus/doc/img/Icarus_internal_pinouts.png create mode 100644 boards/arm/actinius_icarus/dts/bindings/actinius-charger-enable.yaml rename boards/arm/actinius_icarus/dts/bindings/{sim-select.yaml => actinius-sim-select.yaml} (87%) create mode 100644 boards/arm/actinius_icarus/revision.cmake diff --git a/boards/arm/actinius_icarus/actinius_icarus_2_0_0.overlay b/boards/arm/actinius_icarus/actinius_icarus_2_0_0.overlay new file mode 100644 index 00000000000..79e7c3ff28d --- /dev/null +++ b/boards/arm/actinius_icarus/actinius_icarus_2_0_0.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2022 Actinius + * + * SPDX-License-Identifier: Apache-2.0 + */ + + #include "actinius_icarus_common_2_0_0.dtsi" diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index 98170d80ac4..a98231ace4d 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -88,7 +88,7 @@ }; sim_select: sim-select { - compatible = "sim-select"; + compatible = "actinius-sim-select"; sim-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; sim = "esim"; }; diff --git a/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi b/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi new file mode 100644 index 00000000000..5fb6e405456 --- /dev/null +++ b/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2022 Actinius + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart0_default_v2: uart0_default_v2 { + group1 { + psels = , + ; + }; + }; + + uart0_sleep_v2: uart0_sleep_v2 { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&uart0 { + status = "okay"; + + current-speed = <115200>; + pinctrl-0 = <&uart0_default_v2>; + pinctrl-1 = <&uart0_sleep_v2>; + pinctrl-names = "default", "sleep"; +}; + +&spi3 { + status = "okay"; + + cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; + + w25q64: w25q64jv@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <80000000>; + jedec-id = [ef 40 17]; + size = <0x4000000>; + has-dpd; + t-enter-dpd = <3500>; + t-exit-dpd = <3500>; + }; +}; + +/ { + aliases { + spi-flash0 = &w25q64; + }; + + charger_enable: charger-enable { + compatible = "actinius-charger-enable"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + charger = "auto"; + }; +}; diff --git a/boards/arm/actinius_icarus/actinius_icarus_ns_2_0_0.overlay b/boards/arm/actinius_icarus/actinius_icarus_ns_2_0_0.overlay new file mode 100644 index 00000000000..79e7c3ff28d --- /dev/null +++ b/boards/arm/actinius_icarus/actinius_icarus_ns_2_0_0.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2022 Actinius + * + * SPDX-License-Identifier: Apache-2.0 + */ + + #include "actinius_icarus_common_2_0_0.dtsi" diff --git a/boards/arm/actinius_icarus/board.c b/boards/arm/actinius_icarus/board.c index 270dd550d50..b5b5b3621bd 100644 --- a/boards/arm/actinius_icarus/board.c +++ b/boards/arm/actinius_icarus/board.c @@ -11,16 +11,15 @@ #include LOG_MODULE_REGISTER(board_control, CONFIG_BOARD_ICARUS_LOG_LEVEL); -static int board_actinius_icarus_init(const struct device *dev) +#define CHARGER_ENABLE_NODE DT_NODELABEL(charger_enable) + +static int set_sim_select_pin(void) { const struct gpio_dt_spec sim = GPIO_DT_SPEC_GET(DT_NODELABEL(sim_select), sim_gpios); - ARG_UNUSED(dev); - if (!device_is_ready(sim.port)) { LOG_ERR("The SIM Select Pin port is not ready"); - return -ENODEV; } @@ -35,5 +34,53 @@ static int board_actinius_icarus_init(const struct device *dev) return 0; } +#if DT_NODE_EXISTS(CHARGER_ENABLE_NODE) + +static int set_charger_enable_pin(void) +{ + const struct gpio_dt_spec charger_en = + GPIO_DT_SPEC_GET(CHARGER_ENABLE_NODE, gpios); + + if (!device_is_ready(charger_en.port)) { + LOG_ERR("The Charger Enable Pin port is not ready"); + return -ENODEV; + } + + if (DT_ENUM_IDX(CHARGER_ENABLE_NODE, charger) == 0) { + (void)gpio_pin_configure_dt(&charger_en, GPIO_OUTPUT_LOW); + LOG_INF("Charger is set to auto"); + } else { + (void)gpio_pin_configure_dt(&charger_en, GPIO_OUTPUT_HIGH); + LOG_INF("Charger is disabled"); + } + + return 0; +} + +#endif /* DT_NODE_EXISTS(CHARGER_ENABLE_NODE) */ + +static int board_actinius_icarus_init(const struct device *dev) +{ + ARG_UNUSED(dev); + + int result; + + result = set_sim_select_pin(); + if (result < 0) { + LOG_ERR("Failed to set the SIM Select Pin (error: %d)", result); + /* do not return so that the rest of the init process is attempted */ + } + +#if DT_NODE_EXISTS(CHARGER_ENABLE_NODE) + result = set_charger_enable_pin(); + if (result < 0) { + LOG_ERR("Failed to set the Charger Enable Pin (error: %d)", result); + /* do not return so that the rest of the init process is attempted */ + } +#endif /* DT_NODE_EXISTS(CHARGER_ENABLE_NODE) */ + + return result; +} + /* Needs to happen after GPIO driver init */ SYS_INIT(board_actinius_icarus_init, POST_KERNEL, 99); diff --git a/boards/arm/actinius_icarus/doc/img/Icarus_internal_pinouts.png b/boards/arm/actinius_icarus/doc/img/Icarus_internal_pinouts.png deleted file mode 100644 index 9e99646b75791f4c37bfc3b3f6c2ae31af66183d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9371 zcmaKRcUTkA(sz&m2{nY?0}=#jp-Phu(xeK6DggvklqS6hA)!mJf^;cT44@Pdlt>5Z zQl$45I?~k_@4er@-|lRg*_q$WnVEB*eRiV__3u%UvyuY<04i-Qbz=a42yuPvgNUys zjNiX`0{}O84D}vpT(iUsa>R^sU^eAIR>x}!WpgB^m%YA`9a@ncUR566ksV&SmISak z$PBF<{5qFVdALD1+&et2YwoJ9|28x}hkO)5$|S!!zh(bCLR#IPflrG-IFi?P(ll`k z<$3HDki>FZ?_KSe=;XJ>E?GI|ube!h$=Q^4_fDF=_6K5LPt2}h6AE<9y|_dSKSow> z?;QtmIK6n88XEJ4Pui@1WI9zF)6zaTv#^n@9y-`C7%kzmxw6~VJ?e|jNKgr(=2HFg zx*5&?jFwvi#Bz6jWNDzTzo5LSdtfrB_{042md5BBuCb#!;O+9p?$rERPes?OjIx@S zW$)bcRP>*Oz?}Qu_Xx-!17-<7rk8$v{ZZ*%*bs~R5MJTx7auF@FRWlW@_B?;;=$I& zzU%Z>gs3M%$%aSFSZQRnHN7#jpw__3=j-;d{P4=#>dyxY>69qY-B$KG+>J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v_Cqm?wUi%Lc%17-ylwfm4_wpgsNisHDDOB$HWBD4Z^4C=hZb*4N6 zv?%z(aLH~xp}L7}+=EH9M|425Lp7xt=*lzCW(;MZNNQ+lTW=1&%)ASL7FN-Tn{!xn z1T2S&0Trks+)hTfR?b+J%i!G(xzFrT%q?PnnP=7*fk9ODQ|o`~o+O)P7o@|2Tm3Ux zzkUu}qbXUDxDJ={mptt`-!4kzdccENn|_W4?Rs6vClZ60Z!Mf5^e@21K{Xa(*OTVD zI-t$F!5joq4!!F+C9Hz^0Hn3JT-Lu(ena^Chx(eZ@t=>G$r Cw~N*Q diff --git a/boards/arm/actinius_icarus/doc/index.rst b/boards/arm/actinius_icarus/doc/index.rst index 05c2f0555f6..a9ce297fbad 100644 --- a/boards/arm/actinius_icarus/doc/index.rst +++ b/boards/arm/actinius_icarus/doc/index.rst @@ -37,6 +37,11 @@ following devices (provided directly by Nordic): * :abbr:`WDT (Watchdog Timer)` * :abbr:`IDAU (Implementation Defined Attribution Unit)` +Hardware +******** + +The detailed information about the on-board hardware can be found at the `Icarus Product Website`_. + .. figure:: img/Icarus_pinouts.png :width: 450px :align: center @@ -44,17 +49,102 @@ following devices (provided directly by Nordic): Icarus IoT Dev Board w/ Pinouts -.. figure:: img/Icarus_internal_pinouts.png - :width: 200px - :align: center - :alt: Icarus IoT Dev Board - - Internal Pinouts - -Hardware -******** - -The detailed information about the on-board hardware can be found at the `Icarus Product Website`_. +Pin description +=============== + +External Pins available to user: + ++------------+----------------------------+----------------------------------------------+------------------+ +| Icarus pin | Function | Description | Device-tree node | ++============+============================+==============================================+==================+ +| RST | Reset | Active low reset with internal pullup | - | ++------------+----------------------------+----------------------------------------------+------------------+ +| 3.3V | Power output | Main 3.3 V supply | - | ++------------+----------------------------+----------------------------------------------+------------------+ +| NC | - | Not connected | - | ++------------+----------------------------+----------------------------------------------+------------------+ +| GND | Power output | Ground | - | ++------------+----------------------------+----------------------------------------------+------------------+ +| 14 / A1 | GPIO / Analog in | nRF9160 P0.14 / AIN1 | gpio0 / adc_1 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 15 / A2 | GPIO / Analog in | nRF9160 P0.15 / AIN2 | gpio0 / adc_2 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 16 / A3 | GPIO / Analog in | nRF9160 P0.16 / AIN3 | gpio0 / adc_3 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 17 / A4 | GPIO / Analog in | nRF9160 P0.17 / AIN4 | gpio0 / adc_4 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 18 / A5 | GPIO / Analog in | nRF9160 P0.18 / AIN5 | gpio0 / adc_5 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 19 / A6 | GPIO / Analog in | nRF9160 P0.19 / AIN6 | gpio0 / adc_6 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 20 / SCK | GPIO / SPI pin | nRF9160 P0.20 / SPI SCK pin | gpio0 / spi3 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 21 / MOSI | GPIO / SPI pin | nRF9160 P0.21 / SPI MOSI pin | gpio0 / spi3 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 22 / MISO | GPIO / SPI pin | nRF9160 P0.22 / SPI MISO pin | gpio0 / spi3 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 23 / RX | GPIO / UART pin | nRF9160 P0.23 / UART RX pin | gpio0 / uart1 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 24 / TX | GPIO / UART pin | nRF9160 P0.24 / UART TX pin | gpio0 / uart1 | ++------------+----------------------------+----------------------------------------------+------------------+ +| VIN | Power input | Voltage input (maximum 10.2 V) | - | ++------------+----------------------------+----------------------------------------------+------------------+ +| VBAT | Power input | Battery voltage input | - | ++------------+----------------------------+----------------------------------------------+------------------+ +| EN | Power enable | Power enable pin (pull low to disable power) | - | ++------------+----------------------------+----------------------------------------------+------------------+ +| USB | Power input | USB voltage input | gpio0 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 4 | GPIO | nRF9160 P0.04 | gpio0 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 3 | GPIO | nRF9160 P0.03 | gpio0 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 2 | GPIO | nRF9160 P0.02 | gpio0 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 1 | GPIO | nRF9160 P0.01 | gpio0 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 0 | GPIO | nRF9160 P0.00 | gpio0 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 30 | GPIO | nRF9160 P0.30 | gpio0 | ++------------+----------------------------+----------------------------------------------+------------------+ +| 31 | GPIO | nRF9160 P0.31 | gpio0 | ++------------+----------------------------+----------------------------------------------+------------------+ +| SCL | GPIO / I2C pin | nRF9160 P0.26 / I2C SCL pin | gpio0 / i2c2 | ++------------+----------------------------+----------------------------------------------+------------------+ +| SDA | GPIO / I2C pin | nRF9160 P0.27 / I2C SDA pin | gpio0 / i2c2 | ++------------+----------------------------+----------------------------------------------+------------------+ + +nRF9160 pins connected internally: + ++--------------+---------------------------------------+----------------------+ +| nRF9160 pin | Function | Device-tree node | ++==============+=======================================+======================+ +| P0.05 | User button | button0 | ++--------------+---------------------------------------+----------------------+ +| P0.10 | Red LED | led0 / pwm-led0 | ++--------------+---------------------------------------+----------------------+ +| P0.11 | Green LED | led1 / pwm-led1 | ++--------------+---------------------------------------+----------------------+ +| P0.12 | Blue LED | led2 / pwm-led2 | ++--------------+---------------------------------------+----------------------+ +| P0.28 | Accelerometer Interrupt 1 | lis2dh12-accel | ++--------------+---------------------------------------+----------------------+ +| P0.29 | Accelerometer Interrupt 2 | lis2dh12-accel | ++--------------+---------------------------------------+----------------------+ +| P0.08 | SIM select pin | gpio0 | ++--------------+---------------------------------------+----------------------+ +| P0.13 / AIN0 | Battery voltage measurement | adc_0 | ++--------------+---------------------------------------+----------------------+ +| P0.06 | USB - FTDI serial RX | uart0 | ++--------------+---------------------------------------+----------------------+ +| P0.09 | USB - FTDI serial TX | uart0 | ++--------------+---------------------------------------+----------------------+ +| P0.07 | USB - FTDI serial RTS | uart0 | +| | Charger enable pin (Icarus v2.0) | gpio0 (Icarus v2.0) | ++--------------+---------------------------------------+----------------------+ +| P0.25 | USB - FTDI serial CTS | uart0 | +| | FLASH memory SPI CS pin (Icarus v2.0) | gpio0 (Icarus v2.0) | ++--------------+---------------------------------------+----------------------+ Supported Features ================== @@ -90,12 +180,18 @@ hardware features: | ACCEL | st | lis2dh | +-----------+------------+----------------------+ -SIM selection -************* +SIM Selection +============= -The sim choice (eSIM or nano-SIM) can be configured in Devicetree by adjusting +The SIM choice (eSIM or nano-SIM) can be configured in Devicetree by adjusting the ``sim`` property in the ``sim_select`` node. +Charger Enable/Disable +====================== + +Since hardware version 2.0 the charger can be disabled by adjusting the ``charger`` +property of the ``charger_enable`` device tree node. + Security components =================== diff --git a/boards/arm/actinius_icarus/dts/bindings/actinius-charger-enable.yaml b/boards/arm/actinius_icarus/dts/bindings/actinius-charger-enable.yaml new file mode 100644 index 00000000000..08c525dee7c --- /dev/null +++ b/boards/arm/actinius_icarus/dts/bindings/actinius-charger-enable.yaml @@ -0,0 +1,26 @@ +# Copyright (c) 2022 Actinius B.V. +# SPDX-License-Identifier: Apache-2.0 + +description: | + The Icarus IoT Board v2 provides the user with an option to disable the + charger or to leave it on auto. The option can be changed by changing + the `charger` property in the associated dt node to `auto` + or `disabled`. + +compatible: "actinius-charger-enable" + +include: base.yaml + +properties: + gpios: + type: phandle-array + required: true + description: Pin used to enable/disable the charger + + charger: + type: string + required: true + enum: + - "auto" + - "disabled" + description: Charger enable choice (auto or disabled) diff --git a/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml b/boards/arm/actinius_icarus/dts/bindings/actinius-sim-select.yaml similarity index 87% rename from boards/arm/actinius_icarus/dts/bindings/sim-select.yaml rename to boards/arm/actinius_icarus/dts/bindings/actinius-sim-select.yaml index f750f57c736..3caf569f299 100644 --- a/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml +++ b/boards/arm/actinius_icarus/dts/bindings/actinius-sim-select.yaml @@ -5,9 +5,9 @@ description: | The Icarus boards provide the user with 2 options regarding SIM usage for LTE-M/NB-IoT communication. Either using the on-board eSIM or using an external nano-SIM. The SIM can be selected by changing the `sim` property - of the `sim_select` dt node to `esim` or `external`. + of the associated dt node to `esim` or `external`. -compatible: "sim-select" +compatible: "actinius-sim-select" include: base.yaml diff --git a/boards/arm/actinius_icarus/revision.cmake b/boards/arm/actinius_icarus/revision.cmake new file mode 100644 index 00000000000..d63947b74bf --- /dev/null +++ b/boards/arm/actinius_icarus/revision.cmake @@ -0,0 +1,8 @@ +# Copyright (c) 2022 Actinius +# SPDX-License-Identifier: Apache-2.0 + +board_check_revision( + FORMAT MAJOR.MINOR.PATCH + DEFAULT_REVISION 2.0.0 + VALID_REVISIONS 1.4.0 2.0.0 +) diff --git a/dts/bindings/vendor-prefixes.txt b/dts/bindings/vendor-prefixes.txt index 454c698b6fb..de3cc047f28 100644 --- a/dts/bindings/vendor-prefixes.txt +++ b/dts/bindings/vendor-prefixes.txt @@ -18,6 +18,7 @@ acer Acer Inc. acme Acme Systems srl actions Actions Semiconductor Co., Ltd. active-semi Active-Semi International Inc +actinius Actinius B.V. ad Avionic Design GmbH adafruit Adafruit Industries, LLC adapteva Adapteva, Inc. From 9109fd61a2140017d535e761bfdbdbb6f0c36069 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 13 Jul 2022 11:10:59 +0200 Subject: [PATCH 078/501] [nrf fromtree] boards: arm: actinius_icarus: split non-common pinctrl entries actinius_icarus_common-pinctrl.dtsi contained entries for uart0 that are not common for all revisions. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 6e9346a1c34ec63266bc95e6aa1d743634e48710) --- .../actinius_icarus_1_4_0.overlay | 7 +++++ .../actinius_icarus_common-pinctrl.dtsi | 19 -------------- .../actinius_icarus_common_1_4_0.dtsi | 26 +++++++++++++++++++ .../actinius_icarus_common_2_0_0.dtsi | 13 ++-------- .../actinius_icarus_ns_1_4_0.overlay | 7 +++++ 5 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 boards/arm/actinius_icarus/actinius_icarus_1_4_0.overlay create mode 100644 boards/arm/actinius_icarus/actinius_icarus_common_1_4_0.dtsi create mode 100644 boards/arm/actinius_icarus/actinius_icarus_ns_1_4_0.overlay diff --git a/boards/arm/actinius_icarus/actinius_icarus_1_4_0.overlay b/boards/arm/actinius_icarus/actinius_icarus_1_4_0.overlay new file mode 100644 index 00000000000..07190f7553f --- /dev/null +++ b/boards/arm/actinius_icarus/actinius_icarus_1_4_0.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2022 Actinius + * + * SPDX-License-Identifier: Apache-2.0 + */ + + #include "actinius_icarus_common_1_4_0.dtsi" diff --git a/boards/arm/actinius_icarus/actinius_icarus_common-pinctrl.dtsi b/boards/arm/actinius_icarus/actinius_icarus_common-pinctrl.dtsi index 450d79cc163..c4bf5200844 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common-pinctrl.dtsi +++ b/boards/arm/actinius_icarus/actinius_icarus_common-pinctrl.dtsi @@ -4,25 +4,6 @@ */ &pinctrl { - uart0_default: uart0_default { - group1 { - psels = , - , - , - ; - }; - }; - - uart0_sleep: uart0_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; - uart1_default: uart1_default { group1 { psels = , diff --git a/boards/arm/actinius_icarus/actinius_icarus_common_1_4_0.dtsi b/boards/arm/actinius_icarus/actinius_icarus_common_1_4_0.dtsi new file mode 100644 index 00000000000..7f1f4aa7d96 --- /dev/null +++ b/boards/arm/actinius_icarus/actinius_icarus_common_1_4_0.dtsi @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Actinius + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + psels = , + , + , + ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; diff --git a/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi b/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi index 5fb6e405456..9c63a8de335 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi +++ b/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi @@ -5,14 +5,14 @@ */ &pinctrl { - uart0_default_v2: uart0_default_v2 { + uart0_default: uart0_default { group1 { psels = , ; }; }; - uart0_sleep_v2: uart0_sleep_v2 { + uart0_sleep: uart0_sleep { group1 { psels = , ; @@ -21,15 +21,6 @@ }; }; -&uart0 { - status = "okay"; - - current-speed = <115200>; - pinctrl-0 = <&uart0_default_v2>; - pinctrl-1 = <&uart0_sleep_v2>; - pinctrl-names = "default", "sleep"; -}; - &spi3 { status = "okay"; diff --git a/boards/arm/actinius_icarus/actinius_icarus_ns_1_4_0.overlay b/boards/arm/actinius_icarus/actinius_icarus_ns_1_4_0.overlay new file mode 100644 index 00000000000..07190f7553f --- /dev/null +++ b/boards/arm/actinius_icarus/actinius_icarus_ns_1_4_0.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2022 Actinius + * + * SPDX-License-Identifier: Apache-2.0 + */ + + #include "actinius_icarus_common_1_4_0.dtsi" From 0362c7d8529f02cdffcbd004f55a58c1f473eaa5 Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Thu, 11 Aug 2022 19:28:29 +0200 Subject: [PATCH 079/501] [nrf fromtree] boards: actinius_icarus_bee: rename sim-select to actinius-sim-select This renames the `sim-select` binding to `actinius-sim-select`. Signed-off-by: Alex Tsamakos (cherry picked from commit 38e62f4a9d78c7e55e64b16c04016dbba62d6e94) --- boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts | 2 +- .../dts/bindings/{sim-select.yaml => actinius-sim-select.yaml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename boards/arm/actinius_icarus_bee/dts/bindings/{sim-select.yaml => actinius-sim-select.yaml} (95%) diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 20ea0c970d6..6934b1bb8da 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -82,7 +82,7 @@ }; sim_select: sim-select { - compatible = "sim-select"; + compatible = "actinius-sim-select"; sim-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; sim = "esim"; }; diff --git a/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml b/boards/arm/actinius_icarus_bee/dts/bindings/actinius-sim-select.yaml similarity index 95% rename from boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml rename to boards/arm/actinius_icarus_bee/dts/bindings/actinius-sim-select.yaml index f750f57c736..fc1580d2065 100644 --- a/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml +++ b/boards/arm/actinius_icarus_bee/dts/bindings/actinius-sim-select.yaml @@ -7,7 +7,7 @@ description: | external nano-SIM. The SIM can be selected by changing the `sim` property of the `sim_select` dt node to `esim` or `external`. -compatible: "sim-select" +compatible: "actinius-sim-select" include: base.yaml From b1e0278455ab92dbfd06b940a22d838954600a51 Mon Sep 17 00:00:00 2001 From: Alex Tsamakos Date: Thu, 11 Aug 2022 19:30:37 +0200 Subject: [PATCH 080/501] [nrf fromtree] boards: actinius_icarus_som: rename sim-select to actinius-sim-select This renames the `sim-select` binding to `actinius-sim-select`. Signed-off-by: Alex Tsamakos (cherry picked from commit f1dd9b5a23e1a7e8d85f61ac1ccd60fbfe1086fb) --- boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts | 2 +- .../dts/bindings/{sim-select.yaml => actinius-sim-select.yaml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename boards/arm/actinius_icarus_som/dts/bindings/{sim-select.yaml => actinius-sim-select.yaml} (95%) diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index a581373e95c..14240fca8fa 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -21,7 +21,7 @@ }; sim_select: sim-select { - compatible = "sim-select"; + compatible = "actinius-sim-select"; sim-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; sim = "esim"; }; diff --git a/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml b/boards/arm/actinius_icarus_som/dts/bindings/actinius-sim-select.yaml similarity index 95% rename from boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml rename to boards/arm/actinius_icarus_som/dts/bindings/actinius-sim-select.yaml index f750f57c736..fc1580d2065 100644 --- a/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml +++ b/boards/arm/actinius_icarus_som/dts/bindings/actinius-sim-select.yaml @@ -7,7 +7,7 @@ description: | external nano-SIM. The SIM can be selected by changing the `sim` property of the `sim_select` dt node to `esim` or `external`. -compatible: "sim-select" +compatible: "actinius-sim-select" include: base.yaml From 55d188cc2301cf19143275758c1b8e67ecb544fd Mon Sep 17 00:00:00 2001 From: Matthias Hauser Date: Thu, 11 Aug 2022 12:00:53 +0200 Subject: [PATCH 081/501] [nrf fromtree] Bluetooth: writing appearance to settings avoid saving appearance in flash if it did not change Signed-off-by: Matthias Hauser (cherry picked from commit 9f3767445c0ba063af604d687758ada7debc3932) --- subsys/bluetooth/host/hci_core.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index cd2ca5e4e07..9b1554d027f 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3809,16 +3809,19 @@ uint16_t bt_get_appearance(void) #if defined(CONFIG_BT_DEVICE_APPEARANCE_DYNAMIC) int bt_set_appearance(uint16_t appearance) { - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { - int err = settings_save_one("bt/appearance", &appearance, sizeof(appearance)); - - if (err) { - BT_ERR("Unable to save setting 'bt/appearance' (err %d).", err); - return err; + if (bt_dev.appearance != appearance) { + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { + int err = settings_save_one("bt/appearance", &appearance, + sizeof(appearance)); + + if (err) { + BT_ERR("Unable to save setting 'bt/appearance' (err %d).", err); + return err; + } } - } - bt_dev.appearance = appearance; + bt_dev.appearance = appearance; + } return 0; } From 2abee9c80bd199a14276b3c0879be66e1c492081 Mon Sep 17 00:00:00 2001 From: Jonathan Rico Date: Thu, 11 Aug 2022 09:53:29 +0200 Subject: [PATCH 082/501] [nrf fromtree] Bluetooth: gatt: support having the CCCD in any location Per spec, the CCCD doesn't necessarily have to be located immediately after the characteristic value. This commit fixes that assumption when checking for subscriptions. Fixes #48880. Signed-off-by: Jonathan Rico (cherry picked from commit 1542dc6d396217a0f3749ec68ddbf0f36169f4c6) --- subsys/bluetooth/host/gatt.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index fd9861f8e3f..aa134b25fab 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -3145,7 +3145,18 @@ bool bt_gatt_is_subscribed(struct bt_conn *conn, __ASSERT(attr, "No more attributes\n"); } - /* Check if the attribute is the CCC Descriptor */ + /* Find the CCC Descriptor */ + while (bt_uuid_cmp(attr->uuid, BT_UUID_GATT_CCC) && + /* Also stop if we leave the current characteristic definition */ + bt_uuid_cmp(attr->uuid, BT_UUID_GATT_CHRC) && + bt_uuid_cmp(attr->uuid, BT_UUID_GATT_PRIMARY) && + bt_uuid_cmp(attr->uuid, BT_UUID_GATT_SECONDARY)) { + attr = bt_gatt_attr_next(attr); + if (!attr) { + return false; + } + } + if (bt_uuid_cmp(attr->uuid, BT_UUID_GATT_CCC) != 0) { return false; } From 69a0a5d77461ef1cfbb671550d82b889a1d3c66c Mon Sep 17 00:00:00 2001 From: Ivan Herrera Olivares Date: Thu, 11 Aug 2022 15:29:40 +0200 Subject: [PATCH 083/501] [nrf fromtree] Bluetooth: L2CAP: Add check to see if device is not disconnected Currently, if a bluetooth peripheral sends a connection parameter update request to a Zephyr central while the central is in the process of disconnecting and has sent a connection terminate command in the same connection interval, the central will try to reply, resulting in an error being printed in the console. This commit adds a check in le_conn_param_update_req that catches this state before the central considers this request, preventing the unneeded error being printed. Fixes #48813 Signed-off-by: Ivan Herrera Olivares (cherry picked from commit c507ff4f736b59e44576d13345b2d06610541b83) --- subsys/bluetooth/host/l2cap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 6426fbd46ce..e0a9bed3ca6 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -701,6 +701,11 @@ static void le_conn_param_update_req(struct bt_l2cap *l2cap, uint8_t ident, return; } + if (conn->state != BT_CONN_CONNECTED) { + BT_WARN("Not connected"); + return; + } + if (conn->role != BT_HCI_ROLE_CENTRAL) { l2cap_send_reject(conn, ident, BT_L2CAP_REJ_NOT_UNDERSTOOD, NULL, 0); From 8ea48c4648ae31f38ded8ea4f2cd0b574e4b9306 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 12 Aug 2022 13:57:00 +0100 Subject: [PATCH 084/501] [nrf fromtree] drivers: sensor: adxl372: Fix default bus issue The adxl372 device does not select the correct bus that it is on, which causes undefined operation (usually a fault). This driver should not be using Kconfig to determine which bus to use, that should be done by dts, however this works as a quick fix in the interim until the driver can be fixed properly. Signed-off-by: Jamie McCrae (cherry picked from commit 5345ef24b8c014fb17becedf36f88bc8dbd907fe) --- drivers/sensor/adxl372/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/sensor/adxl372/Kconfig b/drivers/sensor/adxl372/Kconfig index 629a9c5e242..680ef4ebb89 100644 --- a/drivers/sensor/adxl372/Kconfig +++ b/drivers/sensor/adxl372/Kconfig @@ -16,6 +16,8 @@ if ADXL372 choice ADXL372_BUS_TYPE prompt "Interface type" + default ADXL372_I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),i2c) + default ADXL372_SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),spi) help Select interface the digital interface type for the ADXL372 From 4eed3ea39dba262d1a178392b333800e8b0c63fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 3 Aug 2022 16:35:12 +0200 Subject: [PATCH 085/501] [nrf fromtree] boards: nrf: Activate pull-up on QSPI CSN line in "sleep" state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When there is no external pull-up on the CSN line and the line is put into the low-power mode (input direction and disconnected buffer), after some time its level falls to low and some flash chips, like for example MX25R64, exit the Deep Power-down mode when that happens. To prevent this, activate the GPIO internal pull-up for this line in boards that do not have the external pull-up on it. Signed-off-by: Andrzej Głąbek (cherry picked from commit adce25e09ce2d5bfaedeac2fe9b230f44cd5e26f) --- boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi | 8 ++++++-- .../nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi | 8 ++++++-- .../nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi | 8 ++++++-- .../thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi | 8 ++++++-- tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay | 8 ++++++-- 5 files changed, 30 insertions(+), 10 deletions(-) diff --git a/boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi b/boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi index 11c7bbb845c..270d64081e2 100644 --- a/boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi +++ b/boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi @@ -88,9 +88,13 @@ , , , - , - ; + ; + low-power-enable; + }; + group2 { + psels = ; low-power-enable; + bias-pull-up; }; }; diff --git a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi index 60a01eff758..397eca2cd86 100644 --- a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi +++ b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi @@ -156,9 +156,13 @@ , , , - , - ; + ; + low-power-enable; + }; + group2 { + psels = ; low-power-enable; + bias-pull-up; }; }; diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi index c7974a443a8..e2dfe9d5d84 100644 --- a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi +++ b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi @@ -71,9 +71,13 @@ , , , - , - ; + ; + low-power-enable; + }; + group2 { + psels = ; low-power-enable; + bias-pull-up; }; }; diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi index 6947a20237f..6f3e5631de9 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi @@ -98,9 +98,13 @@ group1 { psels = , , - , - ; + ; + low-power-enable; + }; + group2 { + psels = ; low-power-enable; + bias-pull-up; }; }; diff --git a/tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay b/tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay index 9acee0e2481..1b39dd94d1e 100644 --- a/tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay +++ b/tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay @@ -29,9 +29,13 @@ , , , - , - ; + ; + low-power-enable; + }; + group2 { + psels = ; low-power-enable; + bias-pull-up; }; }; }; From c173e608d99492515ff71fa20e5ecfc5619ee105 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Mon, 8 Aug 2022 10:57:30 +0200 Subject: [PATCH 086/501] [nrf fromtree] tests: arm: Increase main stack size with no optimizations If the test is run with the config NO_OPTIMIZATIONS enabled then the stack size usage increases by around 80% for ARM platforms. Increase the stack size used in test cases that enables building with no optimizations for ARM. Update description on TEST_ARM_CORTEX_M since it was outdated and said it was only used for a single purpose. Fixes: #47930 Fixes: #47929 Fixes: #47855 Signed-off-by: Joakim Andersson (cherry picked from commit 457cdd50d2dcda07ab931d0bf524250ecc2f9abc) --- subsys/testsuite/Kconfig | 5 ++++- tests/arch/arm/arm_interrupt/testcase.yaml | 2 +- tests/arch/arm/arm_thread_swap/testcase.yaml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/subsys/testsuite/Kconfig b/subsys/testsuite/Kconfig index de29e6d3d4b..49cb02a6d57 100644 --- a/subsys/testsuite/Kconfig +++ b/subsys/testsuite/Kconfig @@ -139,7 +139,10 @@ config TEST_ARM_CORTEX_M help ARM Cortex-M configuration required when testing. - Currently, this option is only utilized, to force routing + This option is used to select stack sizes and enable features for + testing. + + This option is also used to force routing BusFault, HardFault, and NMI exceptions to Secure State, when building a Secure ARMv8-M firmware. This will allow the testing suite to utilize these exceptions, in tests. diff --git a/tests/arch/arm/arm_interrupt/testcase.yaml b/tests/arch/arm/arm_interrupt/testcase.yaml index 9b8b81b7bbd..f91b64c7660 100644 --- a/tests/arch/arm/arm_interrupt/testcase.yaml +++ b/tests/arch/arm/arm_interrupt/testcase.yaml @@ -10,7 +10,7 @@ tests: extra_configs: - CONFIG_NO_OPTIMIZATIONS=y - CONFIG_IDLE_STACK_SIZE=512 - - CONFIG_MAIN_STACK_SIZE=1024 + - CONFIG_MAIN_STACK_SIZE=2048 arch.interrupt.extra_exception_info: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: diff --git a/tests/arch/arm/arm_thread_swap/testcase.yaml b/tests/arch/arm/arm_thread_swap/testcase.yaml index 3d9ae8d0df6..b90e82270d1 100644 --- a/tests/arch/arm/arm_thread_swap/testcase.yaml +++ b/tests/arch/arm/arm_thread_swap/testcase.yaml @@ -10,6 +10,7 @@ tests: extra_configs: - CONFIG_NO_OPTIMIZATIONS=y - CONFIG_IDLE_STACK_SIZE=512 + - CONFIG_MAIN_STACK_SIZE=2048 min_flash: 192 arch.arm.swap.common.fpu_sharing: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_ARMV7_M_ARMV8_M_FP @@ -23,4 +24,5 @@ tests: - CONFIG_FPU_SHARING=y - CONFIG_NO_OPTIMIZATIONS=y - CONFIG_IDLE_STACK_SIZE=512 + - CONFIG_MAIN_STACK_SIZE=2048 min_flash: 192 From 1e1358220095f99f5ab7b5bf4353c3b12110e5a9 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Wed, 10 Aug 2022 16:06:38 +0200 Subject: [PATCH 087/501] [nrf fromtree] tests: portability: cmsis_rtos_v2: Inrease timeout Increase timer timeout. 5ms timeout was too short for some devices (e.g. with slow and blocking uart output). Signed-off-by: Krzysztof Chruscinski (cherry picked from commit b2fbd4d2d8b58210fc61d68b27d10315c25627c1) --- tests/subsys/portability/cmsis_rtos_v2/src/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/subsys/portability/cmsis_rtos_v2/src/timer.c b/tests/subsys/portability/cmsis_rtos_v2/src/timer.c index dbc7137b3ce..84682dec7d6 100644 --- a/tests/subsys/portability/cmsis_rtos_v2/src/timer.c +++ b/tests/subsys/portability/cmsis_rtos_v2/src/timer.c @@ -8,7 +8,7 @@ #include #define ONESHOT_TIME_TICKS 100 -#define PERIOD_TICKS MAX(50, k_ms_to_ticks_ceil32(5)) +#define PERIOD_TICKS MAX(50, k_ms_to_ticks_ceil32(10)) #define NUM_PERIODS 5 uint32_t num_oneshots_executed; From ba99d0a75e1720d92908a962b867bea0cecfc759 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Wed, 10 Aug 2022 16:08:32 +0200 Subject: [PATCH 088/501] [nrf fromtree] tests: arch: arm: arm_interrupt: Increase stack size Increase stack size for test thread. With no optimization default stack size may not be enough. Signed-off-by: Krzysztof Chruscinski (cherry picked from commit d6db5e03fbd209fb7c42aed86ca7945908212dbc) --- tests/arch/arm/arm_interrupt/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/arch/arm/arm_interrupt/testcase.yaml b/tests/arch/arm/arm_interrupt/testcase.yaml index f91b64c7660..f154981c10e 100644 --- a/tests/arch/arm/arm_interrupt/testcase.yaml +++ b/tests/arch/arm/arm_interrupt/testcase.yaml @@ -11,6 +11,7 @@ tests: - CONFIG_NO_OPTIMIZATIONS=y - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 + - CONFIG_TEST_EXTRA_STACK_SIZE=1024 arch.interrupt.extra_exception_info: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: From 3dbe5ae3c66998409fd2f126e24a5f8331305eff Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Wed, 10 Aug 2022 16:09:41 +0200 Subject: [PATCH 089/501] [nrf fromtree] drivers: serial: nrf: Tweak default values for workaround Relax a bit default values used for DK serial workaround. Signed-off-by: Krzysztof Chruscinski (cherry picked from commit f4d199623aa968fa3c7382cf4718fdabed81c779) --- drivers/serial/Kconfig.nrfx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 23b8e5ef0fa..c5a7884a2ca 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -41,13 +41,13 @@ if UART_NRF_DK_SERIAL_WORKAROUND config UART_NRF_DK_SERIAL_WORKAROUND_COUNT int - default 32 + default 64 help Number of bytes transferred after which a busy wait is added. config UART_NRF_DK_SERIAL_WORKAROUND_WAIT_MS int - default 10 + default 7 help Busy wait time (in milliseconds). endif From bf61af0f6ccef33d2d408e31776cd92bab333a51 Mon Sep 17 00:00:00 2001 From: Carlo Caione Date: Wed, 17 Aug 2022 12:10:22 +0200 Subject: [PATCH 090/501] [nrf fromtree] s2ram: Deal with system off failure Some platforms have the possibility to cancel the powering off until the very latest moment (for example if an IRQ is received). Deal with this kind of failures. Signed-off-by: Carlo Caione (cherry picked from commit a52b151e02f1c3a48fa72f53279ac5682da07deb) --- arch/arm/core/aarch32/cortex_m/pm_s2ram.S | 24 +++++++++++++++++++---- include/zephyr/arch/common/pm_s2ram.h | 14 ++++++++++--- samples/boards/nrf/s2ram/src/main.c | 18 +++++++++++++---- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/arch/arm/core/aarch32/cortex_m/pm_s2ram.S b/arch/arm/core/aarch32/cortex_m/pm_s2ram.S index 9dd77bb8aa2..aa715c8bbb9 100644 --- a/arch/arm/core/aarch32/cortex_m/pm_s2ram.S +++ b/arch/arm/core/aarch32/cortex_m/pm_s2ram.S @@ -27,7 +27,7 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend) * * r0: address of the system_off function */ - push {r4-r12, r14} + push {r4-r12, lr} ldr r1, =_cpu_context mrs r2, msp @@ -71,9 +71,25 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend) str r2, [r1] /* - * Call the system_off function passed as parameter + * Call the system_off function passed as parameter. This should never + * return. */ - bx r0 + blx r0 + + /* + * The system_off function returns here only when the powering off was + * not successful (in r0 the return value). + */ + + /* + * Reset the marker + */ + ldr r1, =marker + mov r2, #0x0 + str r2, [r1] + + pop {r4-r12, lr} + bx lr GTEXT(arch_pm_s2ram_resume) SECTION_FUNC(TEXT, arch_pm_s2ram_resume) @@ -134,7 +150,7 @@ resume: msr control, r1 isb - pop {r4-r12, r14} + pop {r4-r12, lr} /* * Set the return value and return diff --git a/include/zephyr/arch/common/pm_s2ram.h b/include/zephyr/arch/common/pm_s2ram.h index 18247261340..fff51f7350b 100644 --- a/include/zephyr/arch/common/pm_s2ram.h +++ b/include/zephyr/arch/common/pm_s2ram.h @@ -25,10 +25,17 @@ extern "C" { * @brief System off function * * This function is passed as argument and called by @ref arch_pm_s2ram_suspend - * to power the system off after the CPU context has been saved. This function - * never returns. + * to power the system off after the CPU context has been saved. + * + * This function never returns if the system is powered off. If the operation + * cannot be performed a proper value is returned and the code must take care + * of restoring the system in a fully operational state before returning. + * + * @retval none The system is powered off. + * @retval -EBUSY The system is busy and cannot be powered off at this time. + * @retval -errno Other error codes. */ -typedef void (*pm_s2ram_system_off_fn_t)(void); +typedef int (*pm_s2ram_system_off_fn_t)(void); /** * @brief Save CPU context on suspend @@ -44,6 +51,7 @@ typedef void (*pm_s2ram_system_off_fn_t)(void); * @param system_off Function to power off the system. * * @retval 0 The CPU context was successfully saved and restored. + * @retval -EBUSY The system is busy and cannot be suspended at this time. * @retval -errno Negative errno code in case of failure. */ int arch_pm_s2ram_suspend(pm_s2ram_system_off_fn_t system_off); diff --git a/samples/boards/nrf/s2ram/src/main.c b/samples/boards/nrf/s2ram/src/main.c index dea82e652db..cd04cd0addf 100644 --- a/samples/boards/nrf/s2ram/src/main.c +++ b/samples/boards/nrf/s2ram/src/main.c @@ -15,24 +15,34 @@ #include #include -static void system_off(void) +static int system_off(void) { nrf_regulators_system_off(NRF_REGULATORS); + + /* + * We should never reach this point if the system is powered off. If we + * do, return -EBUSY. + */ + return -EBUSY; } static void do_suspend(void) { - irq_lock(); + int ret; /* * Save the CPU context (including the return address),set the SRAM * marker and power off the system. */ - arch_pm_s2ram_suspend(system_off); + ret = arch_pm_s2ram_suspend(system_off); /* - * XXX: On resuming we return exactly *HERE* + * XXX: On resuming or error we return exactly *HERE* */ + + if (ret != 0) { + printk("Something went wrong during suspend"); + } } void main(void) From 1378f668d7f6e0ce57cb218fa05a7f25b0041f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 3 Aug 2022 10:08:22 +0200 Subject: [PATCH 091/501] [nrf fromtree] boards: nrf9160dk_nrf9160: Correct arduino_spi definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit 854129902057ad236acc8ff3b091ededc86f922c. The arduino_spi definition introduced in the above commit is incorrect because the spi1 MOSI and MISO pins are swapped and spi1 uses the same pins (P0.13, P0.12, and P0.11) that are assigned to spi3 when building for board revision 0.14.0 and above. This commit actually reverts the changes made to dts files in the commit mentioned above and instead it adds the arduino_spi label to spi3 and assigns the proper pins to this instance in the default dts file. And in the overlay for revision 0.14.0 it just adds another CS line to spi3 (the SPIM pins are by default configured correctly) so that this instance can be used for communication with the exernal flash. Signed-off-by: Andrzej Głąbek (cherry picked from commit fe2144211daef6983c4154b6771b7bdc8775e918) --- .../nrf9160dk_nrf9160_common-pinctrl.dtsi | 29 ++++-------------- .../nrf9160dk_nrf9160_common.dts | 13 ++------ .../nrf9160dk_nrf9160_common_0_14_0.dtsi | 30 +++---------------- 3 files changed, 13 insertions(+), 59 deletions(-) diff --git a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common-pinctrl.dtsi b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common-pinctrl.dtsi index 09b511281d9..0bc5fa63ce8 100644 --- a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common-pinctrl.dtsi +++ b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common-pinctrl.dtsi @@ -91,36 +91,19 @@ }; }; - spi1_default: spi1_default { - group1 { - psels = , - , - ; - }; - }; - - spi1_sleep: spi1_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - spi3_default: spi3_default { group1 { - psels = , - , - ; + psels = , + , + ; }; }; spi3_sleep: spi3_sleep { group1 { - psels = , - , - ; + psels = , + , + ; low-power-enable; }; }; diff --git a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common.dts b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common.dts index ad8f6a3e094..a1d72bb1b08 100644 --- a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common.dts +++ b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common.dts @@ -174,7 +174,7 @@ }; arduino_serial: &uart1 { - /* Cannot be used together with spi1, hence disabled by default. */ + status = "okay"; current-speed = <115200>; pinctrl-0 = <&uart1_default>; pinctrl-1 = <&uart1_sleep>; @@ -202,17 +202,10 @@ arduino_i2c: &i2c2 { pinctrl-names = "default", "sleep"; }; -arduino_spi: &spi1 { - /* Cannot be used together with uart1, hence disabled by default. */ - cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ - pinctrl-0 = <&spi1_default>; - pinctrl-1 = <&spi1_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&spi3 { +arduino_spi: &spi3 { compatible = "nordic,nrf-spim"; status = "okay"; + cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ pinctrl-0 = <&spi3_default>; pinctrl-1 = <&spi3_sleep>; pinctrl-names = "default", "sleep"; diff --git a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common_0_14_0.dtsi b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common_0_14_0.dtsi index d8d521261dd..e5b62be419f 100644 --- a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common_0_14_0.dtsi +++ b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common_0_14_0.dtsi @@ -37,34 +37,12 @@ }; }; -&pinctrl { - spi3_default_v14: spi3_default_v14 { - group1 { - psels = , - , - ; - }; - }; - - spi3_sleep_v14: spi3_sleep_v14 { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; - &spi3 { - status = "okay"; - pinctrl-0 = <&spi3_default_v14>; - pinctrl-1 = <&spi3_sleep_v14>; - pinctrl-names = "default", "sleep"; - cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; - mx25r64: mx25r6435f@0 { + cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>, /* D10 */ + <&gpio0 25 GPIO_ACTIVE_LOW>; + mx25r64: mx25r6435f@1 { compatible = "jedec,spi-nor"; - reg = <0>; + reg = <1>; spi-max-frequency = <8000000>; label = "MX25R64"; jedec-id = [c2 28 17]; From 8f222f950977b5d080a64a85d359920460a9ff0d Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 5 Aug 2022 13:28:00 +0200 Subject: [PATCH 092/501] [nrf fromtree] board: nrf53: Fix build error for thingy53_nrf5340 when MPU is disabled Fix build error for thingy53_nrf5340 board when built CONFIG_ARM_MPU=n. In this configuration soc.h is not included from board.c, which leaves NRF_SPU and NRF_RESET undefined. Remove unused header soc_secure.h from nrf5340dk_nrf5340 board. The GPIO configuration that used soc_secure.h has been moved out of this file. Signed-off-by: Joakim Andersson (cherry picked from commit 8088d5b0aa98b14fe9a80f46907dbd6bc8c79f6a) --- boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c | 1 - boards/arm/thingy53_nrf5340/board.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c index 8bd92729a7f..9f96095d836 100644 --- a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c +++ b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c @@ -9,7 +9,6 @@ #include #include -#include LOG_MODULE_REGISTER(nrf5340dk_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL); diff --git a/boards/arm/thingy53_nrf5340/board.c b/boards/arm/thingy53_nrf5340/board.c index a77f31ee9d8..5852b53e9d9 100644 --- a/boards/arm/thingy53_nrf5340/board.c +++ b/boards/arm/thingy53_nrf5340/board.c @@ -5,8 +5,10 @@ */ #include - #include + +#include + LOG_MODULE_REGISTER(thingy53_board_init); /* Initialization chain of Thingy:53 board requires some delays before on board sensors From 9bf6d09981bdc8dbb60b7f895af107f0a9497e49 Mon Sep 17 00:00:00 2001 From: Adam Zelik Date: Thu, 11 Aug 2022 12:34:48 +0200 Subject: [PATCH 093/501] [nrf fromtree] drivers: timer: Increase default user-allocable channel count to 3 Increase the default user-allocable number of RTC channels to meet the nrf_802154 driver requirements. Signed-off-by: Adam Zelik (cherry picked from commit 879f99416ec8e493d10b11ab856d3c081bd27000) --- drivers/timer/Kconfig.nrf_rtc | 2 +- soc/arm/nordic_nrf/nrf53/Kconfig.soc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index d9df59049bf..fe6f2ffd97a 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -18,7 +18,7 @@ if NRF_RTC_TIMER config NRF_RTC_TIMER_USER_CHAN_COUNT int "Additional channels that can be used" - default 2 if NRF_802154_RADIO_DRIVER + default 3 if NRF_802154_RADIO_DRIVER default 0 help Use nrf_rtc_timer.h API. Driver is not managing allocation of channels. diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index 68c2ec0928e..a27f807ee2e 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -148,6 +148,7 @@ config NRF53_SYNC_RTC_INIT_PRIORITY nRF53 Synchronized RTC initialization priority. config NRF_RTC_TIMER_USER_CHAN_COUNT + default 3 if NRF_802154_RADIO_DRIVER default 1 config NRF53_SYNC_RTC_LOG_TIMESTAMP From 50ef049c16e36ed65b16dfa3b74b2e416655b278 Mon Sep 17 00:00:00 2001 From: Adam Zelik Date: Thu, 18 Aug 2022 15:02:12 +0200 Subject: [PATCH 094/501] [nrf fromtree] samples: boards: nrf: ieee802154: Remove RTC user channel count setting Setting CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT here is unnecessary as the value needed is equal to the default. Signed-off-by: Adam Zelik (cherry picked from commit 0d8d5c4b658bcae6684e808ac23341433987c5e0) --- samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf b/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf index cb9fa8607e4..09500232667 100644 --- a/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf +++ b/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf @@ -5,4 +5,3 @@ CONFIG_UART_CONSOLE=n CONFIG_LOG=n CONFIG_NRF_802154_SER_RADIO=y -CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=2 From 2efb5b89b0b82360fec2ff5cd9f6c2ef111418f6 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Fri, 19 Aug 2022 11:12:55 +0200 Subject: [PATCH 095/501] [nrf fromtree] scripts: west_commands: runners: jlink: support pylink >= 0.14.2 It looks like the latest release, 0.14.2, changed the contents of JLINK_SDK_NAME as it was before 0.14.0 release. That means that the previous fix is only applicable to a couple of releases: 0.14.0/0.14.1. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit f7b06162027da4421bd7df097137b601a21ceb8d) --- scripts/west_commands/runners/jlink.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/west_commands/runners/jlink.py b/scripts/west_commands/runners/jlink.py index 173ad64435c..d67ba491d9b 100644 --- a/scripts/west_commands/runners/jlink.py +++ b/scripts/west_commands/runners/jlink.py @@ -8,7 +8,6 @@ from functools import partial import logging import os -from packaging.version import Version from pathlib import Path import shlex import subprocess @@ -152,9 +151,9 @@ def jlink_version(self): # to load the shared library distributed with the tools, which # provides an API call for getting the version. if not hasattr(self, '_jlink_version'): - # pylink >= 0.14.0 exposes JLink SDK DLL (libjlinkarm) in - # JLINK_SDK_STARTS_WITH, while previous versions use JLINK_SDK_NAME - if Version(pylink.__version__) >= Version('0.14.0'): + # pylink 0.14.0/0.14.1 exposes JLink SDK DLL (libjlinkarm) in + # JLINK_SDK_STARTS_WITH, while other versions use JLINK_SDK_NAME + if pylink.__version__ in ('0.14.0', '0.14.1'): sdk = Library.JLINK_SDK_STARTS_WITH else: sdk = Library.JLINK_SDK_NAME From 03fb23a27534a5de9b43c7e11048f26b2350ba09 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Fri, 12 Aug 2022 01:20:56 +0530 Subject: [PATCH 096/501] [nrf fromtree] wifi_mgmt: Add PSK with SHA256 support This is a variant of standard PSK which uses KDF instead of PRF for key generation, see section Table 9-151 in [1]. [1] - https://standards.ieee.org/ieee/802.11/7028/ Signed-off-by: Krishna T (cherry picked from commit 3166e286e6fa78d726ee04252c7459bbc5029ce6) --- include/zephyr/net/wifi.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index 2df112c1b95..f5d13426011 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -15,6 +15,7 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_NONE = 0, WIFI_SECURITY_TYPE_PSK, + WIFI_SECURITY_TYPE_PSK_SHA256, }; #define WIFI_SSID_MAX_LEN 32 From 08c668568ca1cc16da5cf261fbf312f01759a61b Mon Sep 17 00:00:00 2001 From: Krishna T Date: Fri, 12 Aug 2022 01:20:56 +0530 Subject: [PATCH 097/501] [nrf fromtree] wifi_mgmt: Add WPA3-SAE support SAE password is similar to WPA2 password but without any length restrictions, so, add a separate optional field, if this is not given we can fallback to WPA2 password (psk). Signed-off-by: Krishna T (cherry picked from commit 34d0e45fa0640eea22a8c9a5a0fb01f6d4af08c4) --- include/zephyr/net/wifi.h | 1 + include/zephyr/net/wifi_mgmt.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index f5d13426011..6c3bf497c96 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -16,6 +16,7 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_NONE = 0, WIFI_SECURITY_TYPE_PSK, WIFI_SECURITY_TYPE_PSK_SHA256, + WIFI_SECURITY_TYPE_SAE }; #define WIFI_SSID_MAX_LEN 32 diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 8e7d7c3e7d1..0f0987701b4 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -103,6 +103,9 @@ struct wifi_connect_req_params { uint8_t *psk; uint8_t psk_length; /* Min 8 - Max 64 */ + uint8_t *sae_password; /* Optional with fallback to psk */ + uint8_t sae_password_length; /* No length restrictions */ + uint8_t channel; enum wifi_security_type security; }; From cdd5fdd89561f3b94578a5438b5ba9129f8041b1 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Fri, 12 Aug 2022 01:20:56 +0530 Subject: [PATCH 098/501] [nrf fromtree] wifi_mgmt: Add support for MFP MFP (Management frame protection) a.k.a PMF (protected management frames) is now a mandatory feature for certification esp. for WPA3. Support is added for both scan and connect similar to security type. Signed-off-by: Krishna T (cherry picked from commit 1aa34e686803360a1f1bbe7db7a741555ceeef3c) --- include/zephyr/net/wifi.h | 7 +++++++ include/zephyr/net/wifi_mgmt.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index 6c3bf497c96..06ea698d99d 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -19,6 +19,13 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_SAE }; +/* Management frame protection (IEEE 802.11w) options */ +enum wifi_mfp_options { + WIFI_MFP_DISABLE = 0, + WIFI_MFP_OPTIONAL, + WIFI_MFP_REQUIRED +}; + #define WIFI_SSID_MAX_LEN 32 #define WIFI_PSK_MAX_LEN 64 #define WIFI_MAC_ADDR_LEN 6 diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 0f0987701b4..9fc87f57742 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -90,6 +90,7 @@ struct wifi_scan_result { uint8_t channel; enum wifi_security_type security; + enum wifi_mfp_options mfp; int8_t rssi; uint8_t mac[WIFI_MAC_ADDR_LEN]; @@ -108,6 +109,7 @@ struct wifi_connect_req_params { uint8_t channel; enum wifi_security_type security; + enum wifi_mfp_options mfp; }; struct wifi_status { From a99f27541b0c03438bd67f597674c00c39046432 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Fri, 12 Aug 2022 01:20:56 +0530 Subject: [PATCH 099/501] [nrf fromtree] wifi_mgmt: Add support for frequency bands Channels are not unique across bands, they need to be interpreted along with frequency band. Add a separate band parameter that supports 2.4, 5 and 6 GHz bands. Also, 6GHz has maximum channel of 233 (as of now), so, change the maximum channel to that, this is a global maximum, per-band channel validation is left to the offload driver as that depends on regulatory rules (not a simple maximum check). Signed-off-by: Krishna T (cherry picked from commit 3ecff14cd004a0e39603d40b04843ea71f460ea4) --- include/zephyr/net/wifi.h | 8 +++++++- include/zephyr/net/wifi_mgmt.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index 06ea698d99d..cc8224763be 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -26,11 +26,17 @@ enum wifi_mfp_options { WIFI_MFP_REQUIRED }; +enum wifi_frequency_bands { + WIFI_FREQ_BAND_2_4_GHZ = 0, + WIFI_FREQ_BAND_5_GHZ, + WIFI_FREQ_BAND_6_GHZ +}; + #define WIFI_SSID_MAX_LEN 32 #define WIFI_PSK_MAX_LEN 64 #define WIFI_MAC_ADDR_LEN 6 -#define WIFI_CHANNEL_MAX 14 +#define WIFI_CHANNEL_MAX 233 #define WIFI_CHANNEL_ANY 255 #endif /* ZEPHYR_INCLUDE_NET_WIFI_H_ */ diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 9fc87f57742..efe3b6e9b01 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -88,6 +88,7 @@ struct wifi_scan_result { uint8_t ssid[WIFI_SSID_MAX_LEN]; uint8_t ssid_length; + uint8_t band; uint8_t channel; enum wifi_security_type security; enum wifi_mfp_options mfp; @@ -107,6 +108,7 @@ struct wifi_connect_req_params { uint8_t *sae_password; /* Optional with fallback to psk */ uint8_t sae_password_length; /* No length restrictions */ + uint8_t band; uint8_t channel; enum wifi_security_type security; enum wifi_mfp_options mfp; From b9d4768cda1ef2e391f985d28a88d115d779669b Mon Sep 17 00:00:00 2001 From: Jonathan Rico Date: Wed, 17 Aug 2022 15:14:16 +0200 Subject: [PATCH 100/501] [nrf fromtree] Bluetooth: host: gatt: Properly check subscription status We had two bugs: - we didn't check the subscription, only the fact that the passed chrc can be subscribed to. - that check only worked if we passed the chrc descriptor handle, not its value handle. Signed-off-by: Jonathan Rico (cherry picked from commit 5518fd79258508457ad662765ee32179b8a644d7) --- subsys/bluetooth/host/gatt.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index aa134b25fab..23f71fae8a5 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -2707,6 +2707,13 @@ static int gatt_notify_multiple_verify_params(struct bt_conn *conn, if (!bt_gatt_attr_get_handle(params[i].attr)) { return -EINVAL; } + + /* Check if the characteristic is subscribed. */ + if (!bt_gatt_is_subscribed(conn, params[i].attr, + BT_GATT_CCC_NOTIFY)) { + BT_WARN("Device is not subscribed to characteristic"); + return -EINVAL; + } } /* PDU length is specified with a 16-bit value. */ @@ -2763,11 +2770,9 @@ int bt_gatt_notify_multiple(struct bt_conn *conn, for (uint16_t i = 0; i < num_params; i++) { struct notify_data data; - const struct bt_gatt_chrc *chrc; data.attr = params[i].attr; data.handle = bt_gatt_attr_get_handle(data.attr); - chrc = data.attr->user_data; /* Check if attribute is a characteristic then adjust the * handle @@ -2776,14 +2781,6 @@ int bt_gatt_notify_multiple(struct bt_conn *conn, data.handle = bt_gatt_attr_value_handle(data.attr); } - /* Check if notifications are supported for that chrc. */ - if (!(chrc->properties & BT_GATT_CHRC_NOTIFY)) { - bt_att_free_tx_meta_data(buf); - net_buf_unref(buf); - - return -EINVAL; - } - /* Add handle and data to the command buffer. */ gatt_add_nfy_to_buf(buf, data.handle, ¶ms[i]); } From 73bb6caefdd916e5292a320aea0b04fbbd93a041 Mon Sep 17 00:00:00 2001 From: Lang Xie Date: Thu, 18 Aug 2022 08:31:26 +0200 Subject: [PATCH 101/501] [nrf fromtree] Bluetooth: Host: Add bsim test for GATT multi notify Checks that bt_gatt_notify_multiple works as expected. Signed-off-by: Lang Xie (cherry picked from commit c208066b1b4e9a31c3e5d7213c5f7ccb94a8b624) --- .../bsim_test_notify_multiple/CMakeLists.txt | 21 + .../bsim_test_notify_multiple/prj.conf | 18 + .../bsim_test_notify_multiple/src/common.c | 20 + .../bsim_test_notify_multiple/src/common.h | 74 ++++ .../src/gatt_client_test.c | 378 ++++++++++++++++++ .../src/gatt_server_test.c | 195 +++++++++ .../bsim_test_notify_multiple/src/main.c | 21 + .../test_scripts/_notify-debug.sh | 42 ++ .../test_scripts/notify.sh | 37 ++ tests/bluetooth/bsim_bt/compile.sh | 1 + 10 files changed, 807 insertions(+) create mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/CMakeLists.txt create mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/prj.conf create mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.c create mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.h create mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_client_test.c create mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_server_test.c create mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/main.c create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/_notify-debug.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/notify.sh diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/CMakeLists.txt b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/CMakeLists.txt new file mode 100644 index 00000000000..9743672c17c --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/CMakeLists.txt @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +if (NOT DEFINED ENV{BSIM_COMPONENTS_PATH}) + message(FATAL_ERROR "This test requires the BabbleSim simulator. Please set\ + the environment variable BSIM_COMPONENTS_PATH to point to its components \ + folder. More information can be found in\ + https://babblesim.github.io/folder_structure_and_env.html") +endif() + +find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) +project(bsim_test_gatt) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources} ) + +zephyr_include_directories( + $ENV{BSIM_COMPONENTS_PATH}/libUtilv1/src/ + $ENV{BSIM_COMPONENTS_PATH}/libPhyComv1/src/ + ) diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/prj.conf b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/prj.conf new file mode 100644 index 00000000000..4fd7e8952fc --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/prj.conf @@ -0,0 +1,18 @@ +CONFIG_BT=y +CONFIG_BT_DEVICE_NAME="GATT tester" +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_GATT_CLIENT=y + +CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y + +CONFIG_BT_SMP=y +CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y +CONFIG_BT_L2CAP_ECRED=y +CONFIG_BT_EATT=y +CONFIG_BT_EATT_MAX=5 +CONFIG_BT_GATT_NOTIFY_MULTIPLE=y + +CONFIG_ASSERT=y +CONFIG_BT_TESTING=y +CONFIG_BT_DEBUG_LOG=y diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.c b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.c new file mode 100644 index 00000000000..df438607c5f --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "common.h" + +void test_tick(bs_time_t HW_device_time) +{ + if (bst_result != Passed) { + FAIL("test failed (not passed after %i seconds)\n", WAIT_TIME); + } +} + +void test_init(void) +{ + bst_ticker_set_next_tick_absolute(WAIT_TIME); + bst_result = In_progress; +} diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.h b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.h new file mode 100644 index 00000000000..56ca219497b --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.h @@ -0,0 +1,74 @@ +/** + * Common functions and helpers for BSIM GATT tests + * + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include "bs_types.h" +#include "bs_tracing.h" +#include "time_machine.h" +#include "bstests.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +extern enum bst_result_t bst_result; + +#define WAIT_TIME (60 * 1e6) /*seconds*/ + +#define CREATE_FLAG(flag) static atomic_t flag = (atomic_t)false +#define FORCE_FLAG(flag, val) (void)atomic_set(&flag, (atomic_t)val) +#define SET_FLAG(flag) (void)atomic_set(&flag, (atomic_t)true) +#define UNSET_FLAG(flag) (void)atomic_set(&flag, (atomic_t)false) +#define WAIT_FOR_FLAG(flag) \ + while (!(bool)atomic_get(&flag)) { \ + (void)k_sleep(K_MSEC(1)); \ + } +#define WAIT_FOR_FLAG_UNSET(flag) \ + while ((bool)atomic_get(&flag)) { \ + (void)k_sleep(K_MSEC(1)); \ + } + +#define FAIL(...) \ + do { \ + bst_result = Failed; \ + bs_trace_error_time_line(__VA_ARGS__); \ + } while (0) + +#define PASS(...) \ + do { \ + bst_result = Passed; \ + bs_trace_info_time(1, __VA_ARGS__); \ + } while (0) + +#define CHRC_SIZE 10 +#define LONG_CHRC_SIZE 40 + +#define TEST_SERVICE_UUID \ + BT_UUID_DECLARE_128(0x01, 0x23, 0x45, 0x67, 0x89, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, \ + 0x07, 0x08, 0x09, 0x00, 0x00) + +#define TEST_CHRC_UUID \ + BT_UUID_DECLARE_128(0x01, 0x23, 0x45, 0x67, 0x89, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, \ + 0x07, 0x08, 0x09, 0xFF, 0x00) + +#define TEST_LONG_CHRC_UUID \ + BT_UUID_DECLARE_128(0x01, 0x23, 0x45, 0x67, 0x89, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, \ + 0x07, 0x08, 0x09, 0xFF, 0x11) + +void test_tick(bs_time_t HW_device_time); +void test_init(void); + +#define NOTIFICATION_COUNT 10 +BUILD_ASSERT(NOTIFICATION_COUNT % 2 == 0); diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_client_test.c new file mode 100644 index 00000000000..7266fe98ed2 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_client_test.c @@ -0,0 +1,378 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#include "common.h" + +CREATE_FLAG(flag_is_connected); +CREATE_FLAG(flag_is_encrypted); +CREATE_FLAG(flag_discover_complete); +CREATE_FLAG(flag_write_complete); +CREATE_FLAG(flag_subscribed_short); +CREATE_FLAG(flag_subscribed_long); + +static struct bt_conn *g_conn; +static uint16_t chrc_handle; +static uint16_t long_chrc_handle; +static uint16_t csf_handle; +static struct bt_uuid *test_svc_uuid = TEST_SERVICE_UUID; + +static void exchange_func(struct bt_conn *conn, uint8_t err, struct bt_gatt_exchange_params *params) +{ + if (!err) { + printk("MTU exchange done\n"); + } else { + printk("MTU exchange failed (err %" PRIu8 ")\n", err); + } +} + +static void connected(struct bt_conn *conn, uint8_t err) +{ + char addr[BT_ADDR_LE_STR_LEN]; + static struct bt_gatt_exchange_params exchange_params; + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + if (err != 0) { + FAIL("Failed to connect to %s (%u)\n", addr, err); + return; + } + + printk("Connected to %s\n", addr); + + SET_FLAG(flag_is_connected); + + exchange_params.func = exchange_func; + err = bt_gatt_exchange_mtu(conn, &exchange_params); + if (err) { + printk("MTU exchange failed (err %d)", err); + } +} + +static void disconnected(struct bt_conn *conn, uint8_t reason) +{ + char addr[BT_ADDR_LE_STR_LEN]; + + if (conn != g_conn) { + return; + } + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + printk("Disconnected: %s (reason 0x%02x)\n", addr, reason); + + bt_conn_unref(g_conn); + + g_conn = NULL; + UNSET_FLAG(flag_is_connected); +} + +void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_security_err err) +{ + if (err) { + FAIL("Encryption failer (%d)\n", err); + } else if (level < BT_SECURITY_L2) { + FAIL("Insufficient sec level (%d)\n", level); + } else { + SET_FLAG(flag_is_encrypted); + } +} + +BT_CONN_CB_DEFINE(conn_callbacks) = { + .connected = connected, + .disconnected = disconnected, + .security_changed = security_changed, +}; + +void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, struct net_buf_simple *ad) +{ + char addr_str[BT_ADDR_LE_STR_LEN]; + int err; + + if (g_conn != NULL) { + return; + } + + /* We're only interested in connectable events */ + if (type != BT_HCI_ADV_IND && type != BT_HCI_ADV_DIRECT_IND) { + return; + } + + bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); + printk("Device found: %s (RSSI %d)\n", addr_str, rssi); + + printk("Stopping scan\n"); + err = bt_le_scan_stop(); + if (err != 0) { + FAIL("Could not stop scan: %d"); + return; + } + + err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN, BT_LE_CONN_PARAM_DEFAULT, &g_conn); + if (err != 0) { + FAIL("Could not connect to peer: %d", err); + } +} + +static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *attr, + struct bt_gatt_discover_params *params) +{ + int err; + + if (attr == NULL) { + if (chrc_handle == 0 || long_chrc_handle == 0) { + FAIL("Did not discover chrc (%x) or long_chrc (%x)", chrc_handle, + long_chrc_handle); + } + + (void)memset(params, 0, sizeof(*params)); + + SET_FLAG(flag_discover_complete); + + return BT_GATT_ITER_STOP; + } + + printk("[ATTRIBUTE] handle %u\n", attr->handle); + + if (params->type == BT_GATT_DISCOVER_PRIMARY && + bt_uuid_cmp(params->uuid, TEST_SERVICE_UUID) == 0) { + printk("Found test service\n"); + params->uuid = NULL; + params->start_handle = attr->handle + 1; + params->type = BT_GATT_DISCOVER_CHARACTERISTIC; + + err = bt_gatt_discover(conn, params); + if (err != 0) { + FAIL("Discover failed (err %d)\n", err); + } + + return BT_GATT_ITER_STOP; + } else if (params->type == BT_GATT_DISCOVER_CHARACTERISTIC) { + const struct bt_gatt_chrc *chrc = (struct bt_gatt_chrc *)attr->user_data; + + if (bt_uuid_cmp(chrc->uuid, TEST_CHRC_UUID) == 0) { + printk("Found chrc\n"); + chrc_handle = chrc->value_handle; + } else if (bt_uuid_cmp(chrc->uuid, TEST_LONG_CHRC_UUID) == 0) { + printk("Found long_chrc\n"); + long_chrc_handle = chrc->value_handle; + } else if (bt_uuid_cmp(chrc->uuid, BT_UUID_GATT_CLIENT_FEATURES) == 0) { + printk("Found csf\n"); + csf_handle = chrc->value_handle; + } + } + + return BT_GATT_ITER_CONTINUE; +} + +static void gatt_discover(const struct bt_uuid *uuid, uint8_t type) +{ + static struct bt_gatt_discover_params discover_params; + int err; + + printk("Discovering services and characteristics\n"); + + discover_params.uuid = uuid; + discover_params.func = discover_func; + discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; + discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; + discover_params.type = type; + + UNSET_FLAG(flag_discover_complete); + + err = bt_gatt_discover(g_conn, &discover_params); + if (err != 0) { + FAIL("Discover failed(err %d)\n", err); + } + + WAIT_FOR_FLAG(flag_discover_complete); + printk("Discover complete\n"); +} + +static void test_subscribed(struct bt_conn *conn, + uint8_t err, + struct bt_gatt_subscribe_params *params) +{ + if (err) { + FAIL("Subscribe failed (err %d)\n", err); + } + + if (!params) { + FAIL("params NULL\n"); + } + + if (params->value_handle == chrc_handle) { + FORCE_FLAG(flag_subscribed_short, (bool)params->value); + printk("Subscribed to short characteristic\n"); + } else if (params->value_handle == long_chrc_handle) { + FORCE_FLAG(flag_subscribed_long, (bool)params->value); + printk("Subscribed to long characteristic\n"); + } else { + FAIL("Unknown handle %d\n", params->value_handle); + } +} + +static volatile size_t num_notifications; +uint8_t test_notify(struct bt_conn *conn, struct bt_gatt_subscribe_params *params, const void *data, + uint16_t length) +{ + printk("Received notification #%u with length %d\n", num_notifications++, length); + + return BT_GATT_ITER_CONTINUE; +} + +static struct bt_gatt_discover_params disc_params_short; +static struct bt_gatt_subscribe_params sub_params_short = { + .notify = test_notify, + .subscribe = test_subscribed, + .ccc_handle = 0, /* Auto-discover CCC*/ + .disc_params = &disc_params_short, /* Auto-discover CCC */ + .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, + .value = BT_GATT_CCC_NOTIFY, +}; +static struct bt_gatt_discover_params disc_params_long; +static struct bt_gatt_subscribe_params sub_params_long = { + .notify = test_notify, + .subscribe = test_subscribed, + .ccc_handle = 0, /* Auto-discover CCC*/ + .disc_params = &disc_params_long, /* Auto-discover CCC */ + .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, + .value = BT_GATT_CCC_NOTIFY, +}; + +static void write_cb(struct bt_conn *conn, uint8_t err, struct bt_gatt_write_params *params) +{ + if (err != BT_ATT_ERR_SUCCESS) { + FAIL("Write failed: 0x%02X\n", err); + } + + SET_FLAG(flag_write_complete); +} + +static void write_csf(void) +{ + /* Client Supported Features Characteristic Value + * Bit 0: Robust Caching + * Bit 1: EATT + * Bit 2: Multiple Handle Value Notifications + */ + static const uint8_t csf[] = { BIT(2) }; + static struct bt_gatt_write_params write_params = { + .func = write_cb, + .offset = 0, + .data = csf, + .length = sizeof(csf), + }; + int err; + + printk("Writing to Client Supported Features Characteristic\n"); + + write_params.handle = csf_handle; + UNSET_FLAG(flag_write_complete); + + err = bt_gatt_write(g_conn, &write_params); + if (err) { + FAIL("bt_gatt_write failed (err %d)\n", err); + } + + WAIT_FOR_FLAG(flag_write_complete); + printk("Success\n"); +} + +static void subscribe(struct bt_gatt_subscribe_params *params, bool subscribe) +{ + int err; + + if (subscribe) { + err = bt_gatt_subscribe(g_conn, params); + } else { + err = bt_gatt_unsubscribe(g_conn, params); + } + + if (err < 0) { + FAIL("Failed to %ssubscribe (err %d)\n", subscribe ? "un":"", err); + } else { + printk("%ssubscribe request sent\n", subscribe ? "un":""); + } + +} + +static void test_main(void) +{ + int err; + + err = bt_enable(NULL); + if (err != 0) { + FAIL("Bluetooth discover failed (err %d)\n", err); + } + + err = bt_le_scan_start(BT_LE_SCAN_PASSIVE, device_found); + if (err != 0) { + FAIL("Scanning failed to start (err %d)\n", err); + } + + printk("Scanning successfully started\n"); + + WAIT_FOR_FLAG(flag_is_connected); + + err = bt_conn_set_security(g_conn, BT_SECURITY_L2); + if (err) { + FAIL("Starting encryption procedure failed (%d)\n", err); + } + + WAIT_FOR_FLAG(flag_is_encrypted); + + while (bt_eatt_count(g_conn) < CONFIG_BT_EATT_MAX) { + k_sleep(K_MSEC(10)); + } + + printk("EATT connected\n"); + + gatt_discover(test_svc_uuid, BT_GATT_DISCOVER_PRIMARY); + gatt_discover(BT_UUID_GATT_CLIENT_FEATURES, BT_GATT_DISCOVER_CHARACTERISTIC); + write_csf(); + + sub_params_short.value_handle = chrc_handle; + sub_params_long.value_handle = long_chrc_handle; + + subscribe(&sub_params_short, true); + subscribe(&sub_params_long, true); + WAIT_FOR_FLAG(flag_subscribed_short); + WAIT_FOR_FLAG(flag_subscribed_long); + + printk("Subscribed\n"); + + while (num_notifications < NOTIFICATION_COUNT) { + k_sleep(K_MSEC(100)); + } + + subscribe(&sub_params_short, false); + subscribe(&sub_params_long, false); + WAIT_FOR_FLAG_UNSET(flag_subscribed_short); + WAIT_FOR_FLAG_UNSET(flag_subscribed_long); + + + printk("Unsubscribed\n"); + + PASS("GATT client Passed\n"); +} + +static const struct bst_test_instance test_vcs[] = { + { + .test_id = "gatt_client", + .test_post_init_f = test_init, + .test_tick_f = test_tick, + .test_main_f = test_main, + }, + BSTEST_END_MARKER, +}; + +struct bst_test_list *test_gatt_client_install(struct bst_test_list *tests) +{ + return bst_add_tests(tests, test_vcs); +} diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_server_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_server_test.c new file mode 100644 index 00000000000..f002da041c7 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_server_test.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "common.h" + +extern enum bst_result_t bst_result; + +CREATE_FLAG(flag_is_connected); +CREATE_FLAG(flag_short_subscribe); +CREATE_FLAG(flag_long_subscribe); + +static struct bt_conn *g_conn; + +#define ARRAY_ITEM(i, _) i +const uint8_t chrc_data[] = { LISTIFY(CHRC_SIZE, ARRAY_ITEM, (,)) }; /* 1, 2, 3 ... */ +const uint8_t long_chrc_data[] = { LISTIFY(LONG_CHRC_SIZE, ARRAY_ITEM, (,)) }; /* 1, 2, 3 ... */ + +static void connected(struct bt_conn *conn, uint8_t err) +{ + char addr[BT_ADDR_LE_STR_LEN]; + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + if (err != 0) { + FAIL("Failed to connect to %s (%u)\n", addr, err); + return; + } + + printk("Connected to %s\n", addr); + + g_conn = bt_conn_ref(conn); + SET_FLAG(flag_is_connected); +} + +static void disconnected(struct bt_conn *conn, uint8_t reason) +{ + char addr[BT_ADDR_LE_STR_LEN]; + + if (conn != g_conn) { + return; + } + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + printk("Disconnected: %s (reason 0x%02x)\n", addr, reason); + + bt_conn_unref(g_conn); + + g_conn = NULL; + UNSET_FLAG(flag_is_connected); +} + +BT_CONN_CB_DEFINE(conn_callbacks) = { + .connected = connected, + .disconnected = disconnected, +}; + +static void short_subscribe(const struct bt_gatt_attr *attr, uint16_t value) +{ + const bool notif_enabled = (value == BT_GATT_CCC_NOTIFY); + + if (notif_enabled) { + SET_FLAG(flag_short_subscribe); + } + + printk("Short notifications %s\n", notif_enabled ? "enabled" : "disabled"); +} + +static void long_subscribe(const struct bt_gatt_attr *attr, uint16_t value) +{ + const bool notif_enabled = (value == BT_GATT_CCC_NOTIFY); + + if (notif_enabled) { + SET_FLAG(flag_long_subscribe); + } + + printk("Long notifications %s\n", notif_enabled ? "enabled" : "disabled"); +} + +BT_GATT_SERVICE_DEFINE(test_svc, BT_GATT_PRIMARY_SERVICE(TEST_SERVICE_UUID), + BT_GATT_CHARACTERISTIC(TEST_CHRC_UUID, + BT_GATT_CHRC_NOTIFY | BT_GATT_CHRC_READ, + BT_GATT_PERM_READ, NULL, NULL, NULL), + BT_GATT_CUD("Short test_svc format description", BT_GATT_PERM_READ), + BT_GATT_CCC(short_subscribe, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE), + BT_GATT_CHARACTERISTIC(TEST_LONG_CHRC_UUID, + BT_GATT_CHRC_NOTIFY | BT_GATT_CHRC_READ, + BT_GATT_PERM_READ, NULL, NULL, NULL), + BT_GATT_CCC(long_subscribe, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE)); + +static volatile size_t num_notifications_sent; + +static void notification_sent(struct bt_conn *conn, void *user_data) +{ + printk("Sent notification #%u\n", num_notifications_sent++); +} + +static inline void multiple_notify(const struct bt_gatt_attr *attrs[2]) +{ + int err; + static struct bt_gatt_notify_params params[] = { + { + .data = long_chrc_data, + .len = LONG_CHRC_SIZE, + .func = notification_sent, + .uuid = NULL, + }, + { + .data = chrc_data, + .len = CHRC_SIZE, + .func = notification_sent, + .uuid = NULL, + }, + }; + params[0].attr = attrs[0]; + params[1].attr = attrs[1]; + + do { + err = bt_gatt_notify_multiple(g_conn, ARRAY_SIZE(params), params); + + if (err == -ENOMEM) { + k_sleep(K_MSEC(10)); + } else if (err) { + FAIL("multiple notify failed (err %d)\n", err); + } + } while (err); +} + +static void test_main(void) +{ + int err; + const struct bt_gatt_attr *attrs[2]; + const struct bt_data ad[] = { + BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), + }; + + err = bt_enable(NULL); + if (err != 0) { + FAIL("Bluetooth init failed (err %d)\n", err); + return; + } + + printk("Bluetooth initialized\n"); + + err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0); + if (err != 0) { + FAIL("Advertising failed to start (err %d)\n", err); + return; + } + + printk("Advertising successfully started\n"); + + WAIT_FOR_FLAG(flag_is_connected); + WAIT_FOR_FLAG(flag_short_subscribe); + WAIT_FOR_FLAG(flag_long_subscribe); + + /* Long characteristic [attr=value] */ + attrs[0] = bt_gatt_find_by_uuid(NULL, 0, TEST_LONG_CHRC_UUID); + /* Short characteristic [attr=descriptor] */ + attrs[1] = &attr_test_svc[1]; + + for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { + multiple_notify(attrs); + } + + while (num_notifications_sent < NOTIFICATION_COUNT / 2) { + k_sleep(K_MSEC(100)); + } + + k_sleep(K_MSEC(1000)); + + if (num_notifications_sent > NOTIFICATION_COUNT) { + FAIL("The notify callback is called more than expected\n"); + } + + PASS("GATT server passed\n"); +} + +static const struct bst_test_instance test_gatt_server[] = { + { + .test_id = "gatt_server", + .test_post_init_f = test_init, + .test_tick_f = test_tick, + .test_main_f = test_main, + }, + BSTEST_END_MARKER, +}; + +struct bst_test_list *test_gatt_server_install(struct bst_test_list *tests) +{ + return bst_add_tests(tests, test_gatt_server); +} diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/main.c b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/main.c new file mode 100644 index 00000000000..7e2806a0702 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/main.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "bstests.h" + +extern struct bst_test_list *test_gatt_server_install(struct bst_test_list *tests); +extern struct bst_test_list *test_gatt_client_install(struct bst_test_list *tests); + +bst_test_install_t test_installers[] = { + test_gatt_server_install, + test_gatt_client_install, + NULL +}; + +void main(void) +{ + bst_main(); +} diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/_notify-debug.sh b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/_notify-debug.sh new file mode 100755 index 00000000000..f01b9bc2006 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/_notify-debug.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Usage: +# one script instance per device, e.g. to run gdb on the client: +# `_notify-debug.sh client debug` +# `_notify-debug.sh server` +# `_notify-debug.sh` +# +# GDB can be run on the two devices at the same time without issues, just append +# `debug` when running the script. + + +simulation_id="notify_multiple" +verbosity_level=2 +process_ids=""; exit_code=0 + +: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" + +#Give a default value to BOARD if it does not have one yet: +BOARD="${BOARD:-nrf52_bsim}" + +cd ${BSIM_OUT_PATH}/bin + +if [[ $2 == "debug" ]]; then + GDB_P="gdb --args " +fi + +if [[ $1 == "client" ]]; then +$GDB_P ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_multiple_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=gatt_client + +elif [[ $1 == "server" ]]; then +$GDB_P ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_multiple_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=gatt_server + +else +./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ + -D=2 -sim_length=60e6 $@ + +fi diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/notify.sh b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/notify.sh new file mode 100755 index 00000000000..e3997dd6213 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/notify.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="notify_multiple" +verbosity_level=2 +process_ids=""; exit_code=0 + +function Execute(){ + if [ ! -f $1 ]; then + echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\ + compile it?)\e[39m" + exit 1 + fi + timeout 120 $@ & process_ids="$process_ids $!" +} + +: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" + +#Give a default value to BOARD if it does not have one yet: +BOARD="${BOARD:-nrf52_bsim}" + +cd ${BSIM_OUT_PATH}/bin + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_multiple_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=gatt_client + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_multiple_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=gatt_server + +Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ + -D=2 -sim_length=60e6 $@ + +for process_id in $process_ids; do + wait $process_id || let "exit_code=$?" +done +exit $exit_code #the last exit code != 0 diff --git a/tests/bluetooth/bsim_bt/compile.sh b/tests/bluetooth/bsim_bt/compile.sh index 326a226258c..5ab59c5554f 100755 --- a/tests/bluetooth/bsim_bt/compile.sh +++ b/tests/bluetooth/bsim_bt/compile.sh @@ -21,6 +21,7 @@ mkdir -p ${WORK_DIR} source ${ZEPHYR_BASE}/tests/bluetooth/bsim_bt/compile.source app=tests/bluetooth/bsim_bt/bsim_test_notify compile +app=tests/bluetooth/bsim_bt/bsim_test_notify_multiple compile app=tests/bluetooth/bsim_bt/bsim_test_eatt_notif conf_file=prj.conf compile app=tests/bluetooth/bsim_bt/bsim_test_gatt_caching compile app=tests/bluetooth/bsim_bt/bsim_test_eatt conf_file=prj_collision.conf compile From 96cd073417e6f90b55a7bf73a1a31d8c0b4425a0 Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Tue, 8 Feb 2022 16:03:42 +0100 Subject: [PATCH 102/501] [nrf fromtree] Bluetooth: Host: Add option to use GATT over EATT A channel option field has been added to the bt_gatt_*_params structs. This allows the application to choose wether Unenhanced ATT, Enhanced ATT, or Any ATT channel shall be used for the request/command/indication/notification. Signed-off-by: Herman Berget (cherry picked from commit b436706711de8c039716a20d2b2d1d2d95fab6ce) --- include/zephyr/bluetooth/att.h | 13 +++++ include/zephyr/bluetooth/gatt.h | 24 ++++++++ subsys/bluetooth/host/att.c | 37 +++++++++++-- subsys/bluetooth/host/att_internal.h | 12 +++- subsys/bluetooth/host/gatt.c | 70 ++++++++++++++++-------- subsys/bluetooth/services/ots/ots_olcp.c | 3 + 6 files changed, 127 insertions(+), 32 deletions(-) diff --git a/include/zephyr/bluetooth/att.h b/include/zephyr/bluetooth/att.h index b41c2067039..0c4e3c693e8 100644 --- a/include/zephyr/bluetooth/att.h +++ b/include/zephyr/bluetooth/att.h @@ -94,6 +94,19 @@ size_t bt_eatt_count(struct bt_conn *conn); #endif /* CONFIG_BT_EATT */ +/** @brief ATT channel option bit field values. + * @note @ref BT_ATT_CHAN_OPT_UNENHANCED_ONLY and @ref BT_ATT_CHAN_OPT_ENHANCED_ONLY are mutually + * exclusive and both bits may not be set. + */ +enum bt_att_chan_opt { + /** Both Enhanced and Unenhanced channels can be used */ + BT_ATT_CHAN_OPT_NONE = 0x0, + /** Only Unenhanced channels will be used */ + BT_ATT_CHAN_OPT_UNENHANCED_ONLY = BIT(0), + /** Only Enhanced channels will be used */ + BT_ATT_CHAN_OPT_ENHANCED_ONLY = BIT(1), +}; + #ifdef __cplusplus } #endif diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index b2d5994f10f..3172a0d00f0 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -1014,6 +1014,9 @@ struct bt_gatt_notify_params { bt_gatt_complete_func_t func; /** Notification Value callback user data */ void *user_data; +#if defined(CONFIG_BT_EATT) + enum bt_att_chan_opt chan_opt; +#endif /* CONFIG_BT_EATT */ }; /** @brief Notify attribute value change. @@ -1125,6 +1128,9 @@ static inline int bt_gatt_notify(struct bt_conn *conn, params.attr = attr; params.data = data; params.len = len; +#if defined(CONFIG_BT_EATT) + params.chan_opt = BT_ATT_CHAN_OPT_NONE; +#endif /* CONFIG_BT_EATT */ return bt_gatt_notify_cb(conn, ¶ms); } @@ -1161,6 +1167,9 @@ static inline int bt_gatt_notify_uuid(struct bt_conn *conn, params.attr = attr; params.data = data; params.len = len; +#if defined(CONFIG_BT_EATT) + params.chan_opt = BT_ATT_CHAN_OPT_NONE; +#endif /* CONFIG_BT_EATT */ return bt_gatt_notify_cb(conn, ¶ms); } @@ -1206,6 +1215,9 @@ struct bt_gatt_indicate_params { uint16_t len; /** Private reference counter */ uint8_t _ref; +#if defined(CONFIG_BT_EATT) + enum bt_att_chan_opt chan_opt; +#endif /* CONFIG_BT_EATT */ }; /** @brief Indicate attribute value change. @@ -1434,6 +1446,9 @@ struct bt_gatt_discover_params { /** Only for stack-internal use, used for automatic discovery. */ struct bt_gatt_subscribe_params *sub_params; #endif /* defined(CONFIG_BT_GATT_AUTO_DISCOVER_CCC) */ +#if defined(CONFIG_BT_EATT) + enum bt_att_chan_opt chan_opt; +#endif /* CONFIG_BT_EATT */ }; /** @brief GATT Discover function @@ -1534,6 +1549,9 @@ struct bt_gatt_read_params { const struct bt_uuid *uuid; } by_uuid; }; +#if defined(CONFIG_BT_EATT) + enum bt_att_chan_opt chan_opt; +#endif /* CONFIG_BT_EATT */ }; /** @brief Read Attribute Value by handle @@ -1592,6 +1610,9 @@ struct bt_gatt_write_params { const void *data; /** Length of the data */ uint16_t length; +#if defined(CONFIG_BT_EATT) + enum bt_att_chan_opt chan_opt; +#endif /* CONFIG_BT_EATT */ }; /** @brief Write Attribute Value by handle @@ -1790,6 +1811,9 @@ struct bt_gatt_subscribe_params { ATOMIC_DEFINE(flags, BT_GATT_SUBSCRIBE_NUM_FLAGS); sys_snode_t node; +#if defined(CONFIG_BT_EATT) + enum bt_att_chan_opt chan_opt; +#endif /* CONFIG_BT_EATT */ }; /** @brief Subscribe Attribute Value Notification diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 47d3ee6a3fa..eaee5e4c9c3 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -142,6 +142,7 @@ struct bt_att_tx_meta_data { uint16_t attr_count; bt_gatt_complete_func_t func; void *user_data; + enum bt_att_chan_opt chan_opt; }; struct bt_att_tx_meta { @@ -166,6 +167,7 @@ static inline void tx_meta_data_free(struct bt_att_tx_meta_data *data) k_fifo_put(&free_att_tx_meta_data, data); } +static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf); static bt_conn_tx_cb_t chan_cb(const struct net_buf *buf); static bt_conn_tx_cb_t att_cb(const struct net_buf *buf); @@ -274,6 +276,21 @@ static int chan_send(struct bt_att_chan *chan, struct net_buf *buf) return err; } +static bool att_chan_matches_chan_opt(struct bt_att_chan *chan, enum bt_att_chan_opt chan_opt) +{ + __ASSERT_NO_MSG(chan_opt <= BT_ATT_CHAN_OPT_ENHANCED_ONLY); + + if (chan_opt == BT_ATT_CHAN_OPT_NONE) { + return true; + } + + if (atomic_test_bit(chan->flags, ATT_ENHANCED)) { + return (chan_opt & BT_ATT_CHAN_OPT_ENHANCED_ONLY); + } else { + return (chan_opt & BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + } +} + static int process_queue(struct bt_att_chan *chan, struct k_fifo *queue) { struct net_buf *buf; @@ -281,7 +298,7 @@ static int process_queue(struct bt_att_chan *chan, struct k_fifo *queue) buf = net_buf_get(queue, K_NO_WAIT); if (buf) { - err = chan_send(chan, buf); + err = bt_att_chan_send(chan, buf); if (err) { /* Push it back if it could not be send */ k_queue_prepend(&queue->_queue, buf); @@ -313,7 +330,7 @@ static int chan_req_send(struct bt_att_chan *chan, struct bt_att_req *req) buf = req->buf; req->buf = NULL; - err = chan_send(chan, buf); + err = bt_att_chan_send(chan, buf); if (err) { /* We still have the ownership of the buffer */ req->buf = buf; @@ -570,6 +587,11 @@ static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf) BT_DBG("chan %p flags %lu code 0x%02x", chan, atomic_get(chan->flags), ((struct bt_att_hdr *)buf->data)->code); + if (IS_ENABLED(CONFIG_BT_EATT) && + !att_chan_matches_chan_opt(chan, bt_att_tx_meta_data(buf)->chan_opt)) { + return -EINVAL; + } + return chan_send(chan, buf); } @@ -601,7 +623,7 @@ static void bt_att_chan_send_rsp(struct bt_att_chan *chan, struct net_buf *buf) { int err; - err = bt_att_chan_send(chan, buf); + err = chan_send(chan, buf); if (err) { /* Responses need to be sent back using the same channel */ net_buf_put(&chan->tx_queue, buf); @@ -3752,13 +3774,15 @@ bool bt_att_out_of_sync_sent_on_fixed(struct bt_conn *conn) return atomic_test_bit(att_chan->flags, ATT_OUT_OF_SYNC_SENT); } -void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func, void *user_data) +void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func, void *user_data, + enum bt_att_chan_opt chan_opt) { struct bt_att_tx_meta_data *data = bt_att_tx_meta_data(buf); data->func = func; data->user_data = user_data; data->attr_count = 1; + data->chan_opt = chan_opt; } void bt_att_increment_tx_meta_data_attr_count(struct net_buf *buf, uint16_t attr_count) @@ -3769,10 +3793,11 @@ void bt_att_increment_tx_meta_data_attr_count(struct net_buf *buf, uint16_t attr } bool bt_att_tx_meta_data_match(const struct net_buf *buf, bt_gatt_complete_func_t func, - const void *user_data) + const void *user_data, enum bt_att_chan_opt chan_opt) { return ((bt_att_tx_meta_data(buf)->func == func) && - (bt_att_tx_meta_data(buf)->user_data == user_data)); + (bt_att_tx_meta_data(buf)->user_data == user_data) && + (bt_att_tx_meta_data(buf)->chan_opt == chan_opt)); } void bt_att_free_tx_meta_data(const struct net_buf *buf) diff --git a/subsys/bluetooth/host/att_internal.h b/subsys/bluetooth/host/att_internal.h index 512da52dc18..e3fbb44a245 100644 --- a/subsys/bluetooth/host/att_internal.h +++ b/subsys/bluetooth/host/att_internal.h @@ -317,12 +317,18 @@ void bt_att_clear_out_of_sync_sent(struct bt_conn *conn); /* Check if BT_ATT_ERR_DB_OUT_OF_SYNC has been sent on the fixed ATT channel */ bool bt_att_out_of_sync_sent_on_fixed(struct bt_conn *conn); - typedef void (*bt_gatt_complete_func_t) (struct bt_conn *conn, void *user_data); -void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func, void *user_data); +void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func, void *user_data, + enum bt_att_chan_opt chan_opt); void bt_att_increment_tx_meta_data_attr_count(struct net_buf *buf, uint16_t attr_count); bool bt_att_tx_meta_data_match(const struct net_buf *buf, bt_gatt_complete_func_t func, - const void *user_data); + const void *user_data, enum bt_att_chan_opt chan_opt); void bt_att_free_tx_meta_data(const struct net_buf *buf); + +#if defined(CONFIG_BT_EATT) +#define BT_ATT_CHAN_OPT(_params) (_params)->chan_opt +#else +#define BT_ATT_CHAN_OPT(_params) BT_ATT_CHAN_OPT_UNENHANCED_ONLY +#endif /* CONFIG_BT_EATT */ diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 23f71fae8a5..48ae5ffdc41 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -1197,6 +1197,9 @@ static void sc_process(struct k_work *work) sc->params.func = sc_indicate_rsp; sc->params.data = &sc_range[0]; sc->params.len = sizeof(sc_range); +#if defined(CONFIG_BT_EATT) + sc->params.chan_opt = BT_ATT_CHAN_OPT_NONE; +#endif /* CONFIG_BT_EATT */ if (bt_gatt_indicate(NULL, &sc->params)) { /* No connections to indicate */ @@ -2178,7 +2181,8 @@ static int gatt_notify_mult(struct bt_conn *conn, uint16_t handle, * the existing buffer and proceed to create a new one */ if (*buf && ((net_buf_tailroom(*buf) < sizeof(struct bt_att_notify_mult) + params->len) || - !bt_att_tx_meta_data_match(*buf, params->func, params->user_data))) { + !bt_att_tx_meta_data_match(*buf, params->func, params->user_data, + BT_ATT_CHAN_OPT(params)))) { int ret; ret = gatt_notify_mult_send(conn, *buf); @@ -2195,7 +2199,8 @@ static int gatt_notify_mult(struct bt_conn *conn, uint16_t handle, return -ENOMEM; } - bt_att_set_tx_meta_data(*buf, params->func, params->user_data); + bt_att_set_tx_meta_data(*buf, params->func, params->user_data, + BT_ATT_CHAN_OPT(params)); } else { /* Increment the number of handles, ensuring the notify callback * gets called once for every attribute. @@ -2272,7 +2277,7 @@ static int gatt_notify(struct bt_conn *conn, uint16_t handle, net_buf_add(buf, params->len); memcpy(nfy->value, params->data, params->len); - bt_att_set_tx_meta_data(buf, params->func, params->user_data); + bt_att_set_tx_meta_data(buf, params->func, params->user_data, BT_ATT_CHAN_OPT(params)); return bt_att_send(conn, buf); } @@ -2317,7 +2322,8 @@ static struct bt_att_req *gatt_req_alloc(bt_att_func_t func, void *params, #ifdef CONFIG_BT_GATT_CLIENT static int gatt_req_send(struct bt_conn *conn, bt_att_func_t func, void *params, - bt_att_encode_t encode, uint8_t op, size_t len) + bt_att_encode_t encode, uint8_t op, size_t len, + enum bt_att_chan_opt chan_opt) { struct bt_att_req *req; @@ -2335,6 +2341,8 @@ static int gatt_req_send(struct bt_conn *conn, bt_att_func_t func, void *params, return -ENOMEM; } + bt_att_set_tx_meta_data(buf, NULL, NULL, chan_opt); + req->buf = buf; err = encode(buf, len, params); @@ -2404,6 +2412,8 @@ static int gatt_indicate(struct bt_conn *conn, uint16_t handle, return -ENOMEM; } + bt_att_set_tx_meta_data(buf, NULL, NULL, BT_ATT_CHAN_OPT(params)); + ind = net_buf_add(buf, sizeof(*ind)); ind->handle = sys_cpu_to_le16(handle); @@ -2765,7 +2775,7 @@ int bt_gatt_notify_multiple(struct bt_conn *conn, } /* Register the callback. It will be called num_params times. */ - bt_att_set_tx_meta_data(buf, params->func, params->user_data); + bt_att_set_tx_meta_data(buf, params->func, params->user_data, BT_ATT_CHAN_OPT(params)); bt_att_increment_tx_meta_data_attr_count(buf, num_params - 1); for (uint16_t i = 0; i < num_params; i++) { @@ -3433,7 +3443,8 @@ int bt_gatt_exchange_mtu(struct bt_conn *conn, err = gatt_req_send(conn, gatt_mtu_rsp, params, gatt_exchange_mtu_encode, BT_ATT_OP_MTU_REQ, - sizeof(struct bt_att_exchange_mtu_req)); + sizeof(struct bt_att_exchange_mtu_req), + BT_ATT_CHAN_OPT_UNENHANCED_ONLY); if (err) { atomic_clear_bit(conn->flags, BT_CONN_ATT_MTU_EXCHANGED); } @@ -3584,7 +3595,7 @@ static int gatt_find_type(struct bt_conn *conn, return gatt_req_send(conn, gatt_find_type_rsp, params, gatt_find_type_encode, BT_ATT_OP_FIND_TYPE_REQ, - len); + len, BT_ATT_CHAN_OPT(params)); } static void read_included_uuid_cb(struct bt_conn *conn, uint8_t err, @@ -3656,7 +3667,7 @@ static int read_included_uuid(struct bt_conn *conn, return gatt_req_send(conn, read_included_uuid_cb, params, read_included_uuid_encode, BT_ATT_OP_READ_REQ, - sizeof(struct bt_att_read_req)); + sizeof(struct bt_att_read_req), BT_ATT_CHAN_OPT(params)); } static uint16_t parse_include(struct bt_conn *conn, const void *pdu, @@ -3974,7 +3985,7 @@ static int gatt_read_type(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_type_rsp, params, gatt_read_type_encode, BT_ATT_OP_READ_TYPE_REQ, - sizeof(struct bt_att_read_type_req)); + sizeof(struct bt_att_read_type_req), BT_ATT_CHAN_OPT(params)); } static uint16_t parse_service(struct bt_conn *conn, const void *pdu, @@ -4112,7 +4123,8 @@ static int gatt_read_group(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_group_rsp, params, gatt_read_group_encode, BT_ATT_OP_READ_GROUP_REQ, - sizeof(struct bt_att_read_group_req)); + sizeof(struct bt_att_read_group_req), + BT_ATT_CHAN_OPT(params)); } static void gatt_find_info_rsp(struct bt_conn *conn, uint8_t err, @@ -4251,7 +4263,8 @@ static int gatt_find_info(struct bt_conn *conn, return gatt_req_send(conn, gatt_find_info_rsp, params, gatt_find_info_encode, BT_ATT_OP_FIND_INFO_REQ, - sizeof(struct bt_att_find_info_req)); + sizeof(struct bt_att_find_info_req), + BT_ATT_CHAN_OPT(params)); } int bt_gatt_discover(struct bt_conn *conn, @@ -4421,7 +4434,8 @@ static int gatt_read_blob(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_rsp, params, gatt_read_blob_encode, BT_ATT_OP_READ_BLOB_REQ, - sizeof(struct bt_att_read_blob_req)); + sizeof(struct bt_att_read_blob_req), + BT_ATT_CHAN_OPT(params)); } static int gatt_read_uuid_encode(struct net_buf *buf, size_t len, @@ -4452,7 +4466,8 @@ static int gatt_read_uuid(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_rsp, params, gatt_read_uuid_encode, BT_ATT_OP_READ_TYPE_REQ, - sizeof(struct bt_att_read_type_req)); + sizeof(struct bt_att_read_type_req), + BT_ATT_CHAN_OPT(params)); } #if defined(CONFIG_BT_GATT_READ_MULTIPLE) @@ -4494,7 +4509,8 @@ static int gatt_read_mult(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_mult_rsp, params, gatt_read_mult_encode, BT_ATT_OP_READ_MULT_REQ, - params->handle_count * sizeof(uint16_t)); + params->handle_count * sizeof(uint16_t), + BT_ATT_CHAN_OPT(params)); } #else @@ -4567,7 +4583,8 @@ static int gatt_read_mult_vl(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_mult_vl_rsp, params, gatt_read_mult_vl_encode, BT_ATT_OP_READ_MULT_VL_REQ, - params->handle_count * sizeof(uint16_t)); + params->handle_count * sizeof(uint16_t), + BT_ATT_CHAN_OPT(params)); } #else @@ -4617,8 +4634,8 @@ int bt_gatt_read(struct bt_conn *conn, struct bt_gatt_read_params *params) BT_DBG("handle 0x%04x", params->single.handle); return gatt_req_send(conn, gatt_read_rsp, params, gatt_read_encode, - BT_ATT_OP_READ_REQ, - sizeof(struct bt_att_read_req)); + BT_ATT_OP_READ_REQ, sizeof(struct bt_att_read_req), + BT_ATT_CHAN_OPT(params)); } static void gatt_write_rsp(struct bt_conn *conn, uint8_t err, const void *pdu, @@ -4678,7 +4695,7 @@ int bt_gatt_write_without_response_cb(struct bt_conn *conn, uint16_t handle, BT_DBG("handle 0x%04x length %u", handle, length); - bt_att_set_tx_meta_data(buf, func, user_data); + bt_att_set_tx_meta_data(buf, func, user_data, BT_ATT_CHAN_OPT_NONE); return bt_att_send(conn, buf); } @@ -4700,7 +4717,8 @@ static int gatt_exec_write(struct bt_conn *conn, return gatt_req_send(conn, gatt_write_rsp, params, gatt_exec_encode, BT_ATT_OP_EXEC_WRITE_REQ, - sizeof(struct bt_att_exec_write_req)); + sizeof(struct bt_att_exec_write_req), + BT_ATT_CHAN_OPT(params)); } static int gatt_cancel_encode(struct net_buf *buf, size_t len, void *user_data) @@ -4720,7 +4738,8 @@ static int gatt_cancel_all_writes(struct bt_conn *conn, return gatt_req_send(conn, gatt_write_rsp, params, gatt_cancel_encode, BT_ATT_OP_EXEC_WRITE_REQ, - sizeof(struct bt_att_exec_write_req)); + sizeof(struct bt_att_exec_write_req), + BT_ATT_CHAN_OPT(params)); } static void gatt_prepare_write_rsp(struct bt_conn *conn, uint8_t err, @@ -4819,7 +4838,8 @@ static int gatt_prepare_write(struct bt_conn *conn, return gatt_req_send(conn, gatt_prepare_write_rsp, params, gatt_prepare_write_encode, - BT_ATT_OP_PREPARE_WRITE_REQ, len); + BT_ATT_OP_PREPARE_WRITE_REQ, len, + BT_ATT_CHAN_OPT(params)); } static int gatt_write_encode(struct net_buf *buf, size_t len, void *user_data) @@ -4862,7 +4882,7 @@ int bt_gatt_write(struct bt_conn *conn, struct bt_gatt_write_params *params) BT_DBG("handle 0x%04x length %u", params->handle, params->length); return gatt_req_send(conn, gatt_write_rsp, params, gatt_write_encode, - BT_ATT_OP_WRITE_REQ, len); + BT_ATT_OP_WRITE_REQ, len, BT_ATT_CHAN_OPT(params)); } static void gatt_write_ccc_rsp(struct bt_conn *conn, uint8_t err, @@ -4928,7 +4948,8 @@ static int gatt_write_ccc(struct bt_conn *conn, BT_DBG("handle 0x%04x value 0x%04x", params->ccc_handle, params->value); return gatt_req_send(conn, gatt_write_ccc_rsp, params, - gatt_write_ccc_buf, BT_ATT_OP_WRITE_REQ, len); + gatt_write_ccc_buf, BT_ATT_OP_WRITE_REQ, len, + BT_ATT_CHAN_OPT(params)); } #if defined(CONFIG_BT_GATT_AUTO_DISCOVER_CCC) @@ -4976,6 +4997,9 @@ static int gatt_ccc_discover(struct bt_conn *conn, params->disc_params->start_handle = params->value_handle; params->disc_params->end_handle = params->end_handle; params->disc_params->func = gatt_ccc_discover_cb; +#if defined(CONFIG_BT_EATT) + params->disc_params->chan_opt = params->chan_opt; +#endif /* CONFIG_BT_EATT */ err = bt_gatt_discover(conn, params->disc_params); if (err) { diff --git a/subsys/bluetooth/services/ots/ots_olcp.c b/subsys/bluetooth/services/ots/ots_olcp.c index a172b3a1eb5..e4163e0ebd2 100644 --- a/subsys/bluetooth/services/ots/ots_olcp.c +++ b/subsys/bluetooth/services/ots/ots_olcp.c @@ -219,6 +219,9 @@ static int olcp_ind_send(const struct bt_gatt_attr *olcp_attr, ots->olcp_ind.params.func = olcp_ind_cb; ots->olcp_ind.params.data = olcp_res; ots->olcp_ind.params.len = olcp_res_len; +#if defined(CONFIG_BT_EATT) + ots->olcp_ind.params.chan_opt = BT_ATT_CHAN_OPT_NONE; +#endif /* CONFIG_BT_EATT */ LOG_DBG("Sending OLCP indication"); From ff718893dd6867167c9887c25b927bfb104b07d4 Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Tue, 3 May 2022 14:28:26 +0200 Subject: [PATCH 103/501] [nrf fromtree] Bluetooth: Shell: Use chan_opt BT_ATT_CHAN_ANY The chan_opt field of GATT parameter structs must be set. Signed-off-by: Herman Berget (cherry picked from commit 081e8fb3a6268d6f2debd073f579443cf8a0e015) --- subsys/bluetooth/shell/gatt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/subsys/bluetooth/shell/gatt.c b/subsys/bluetooth/shell/gatt.c index 1d7653912ab..127f2b38b58 100644 --- a/subsys/bluetooth/shell/gatt.c +++ b/subsys/bluetooth/shell/gatt.c @@ -66,6 +66,12 @@ static void update_write_stats(uint16_t len) } } +#if defined(CONFIG_BT_EATT) +#define SET_CHAN_OPT_ANY(params) (params).chan_opt = BT_ATT_CHAN_OPT_NONE +#else +#define SET_CHAN_OPT_ANY(params) +#endif /* CONFIG_BT_EATT */ + static void print_write_stats(void) { shell_print(ctx_shell, "Write #%u: %u bytes (%u bps)", @@ -222,6 +228,7 @@ static int cmd_discover(const struct shell *sh, size_t argc, char *argv[]) discover_params.func = discover_func; discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; + SET_CHAN_OPT_ANY(discover_params); if (argc > 1) { /* Only set the UUID if the value is valid (non zero) */ @@ -298,6 +305,7 @@ static int cmd_read(const struct shell *sh, size_t argc, char *argv[]) read_params.handle_count = 1; read_params.single.handle = strtoul(argv[1], NULL, 16); read_params.single.offset = 0U; + SET_CHAN_OPT_ANY(read_params); if (argc > 2) { read_params.single.offset = strtoul(argv[2], NULL, 16); @@ -343,6 +351,7 @@ static int cmd_mread(const struct shell *sh, size_t argc, char *argv[]) read_params.handle_count = i; read_params.multiple.handles = h; read_params.multiple.variable = true; + SET_CHAN_OPT_ANY(read_params); err = bt_gatt_read(default_conn, &read_params); if (err) { @@ -371,6 +380,7 @@ static int cmd_read_uuid(const struct shell *sh, size_t argc, char *argv[]) read_params.handle_count = 0; read_params.by_uuid.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; read_params.by_uuid.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; + SET_CHAN_OPT_ANY(read_params); if (argc > 1) { uuid.val = strtoul(argv[1], NULL, 16); @@ -437,6 +447,7 @@ static int cmd_write(const struct shell *sh, size_t argc, char *argv[]) write_params.handle = handle; write_params.offset = offset; write_params.func = write_func; + SET_CHAN_OPT_ANY(write_params); err = bt_gatt_write(default_conn, &write_params); if (err) { @@ -558,6 +569,7 @@ static int cmd_subscribe(const struct shell *sh, size_t argc, char *argv[]) subscribe_params.value_handle = strtoul(argv[2], NULL, 16); subscribe_params.value = BT_GATT_CCC_NOTIFY; subscribe_params.notify = notify_func; + SET_CHAN_OPT_ANY(subscribe_params); #if defined(CONFIG_BT_GATT_AUTO_DISCOVER_CCC) if (subscribe_params.ccc_handle == 0) { @@ -606,6 +618,7 @@ static int cmd_resubscribe(const struct shell *sh, size_t argc, subscribe_params.value_handle = strtoul(argv[4], NULL, 16); subscribe_params.value = BT_GATT_CCC_NOTIFY; subscribe_params.notify = notify_func; + SET_CHAN_OPT_ANY(subscribe_params); if (argc > 5 && !strcmp(argv[5], "ind")) { subscribe_params.value = BT_GATT_CCC_INDICATE; @@ -946,6 +959,7 @@ static int cmd_notify(const struct shell *sh, size_t argc, char *argv[]) params.len = sizeof(data); params.func = notify_cb; params.user_data = (void *)sh; + SET_CHAN_OPT_ANY(params); bt_gatt_notify_cb(NULL, ¶ms); From 93025b9d98a2c49f6f3645ffbf6f6c107022d905 Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Tue, 3 May 2022 14:29:59 +0200 Subject: [PATCH 104/501] [nrf fromtree] Bluetooth: Tests: Use chan_opt BT_ATT_CHAN_ANY The chan_opt field of GATT parameter structs must be set. Signed-off-by: Herman Berget (cherry picked from commit b8f172182d13e5afad7af28273f89f5db4ddd19c) --- .../bsim_test_eatt_notif/src/client_test.c | 1 + .../bsim_test_gatt_caching/src/gatt_client_test.c | 5 +++++ .../bsim_test_notify/src/gatt_client_test.c | 3 +++ .../bsim_test_notify/src/gatt_server_test.c | 2 ++ tests/bluetooth/tester/src/gatt.c | 15 +++++++++++++++ 5 files changed, 26 insertions(+) diff --git a/tests/bluetooth/bsim_bt/bsim_test_eatt_notif/src/client_test.c b/tests/bluetooth/bsim_bt/bsim_test_eatt_notif/src/client_test.c index d092e18d1ff..8b399c1c4c3 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_eatt_notif/src/client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_eatt_notif/src/client_test.c @@ -153,6 +153,7 @@ static void gatt_discover(void) discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; err = bt_gatt_discover(g_conn, &discover_params); if (err != 0) { diff --git a/tests/bluetooth/bsim_bt/bsim_test_gatt_caching/src/gatt_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_gatt_caching/src/gatt_client_test.c index 2493fc08a22..f9932b62cf3 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_gatt_caching/src/gatt_client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_gatt_caching/src/gatt_client_test.c @@ -165,6 +165,7 @@ static void gatt_discover(const struct bt_uuid *uuid, uint8_t type) discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = type; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; UNSET_FLAG(flag_discover_complete); @@ -182,6 +183,7 @@ static struct bt_gatt_read_params chan_1_read = { .handle = 0, /* Will be set later */ .offset = 0, }, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static struct bt_gatt_read_params chan_2_read = { .handle_count = 1, @@ -189,6 +191,7 @@ static struct bt_gatt_read_params chan_2_read = { .handle = 0, /* Will be set later */ .offset = 0, }, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static struct bt_gatt_read_params db_hash_read = { .handle_count = 0, @@ -197,6 +200,7 @@ static struct bt_gatt_read_params db_hash_read = { .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .uuid = BT_UUID_GATT_DB_HASH, }, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; void expect_status(uint8_t err, uint8_t status) @@ -295,6 +299,7 @@ static void enable_robust_caching(void) .offset = 0, .data = csf, .length = sizeof(csf), + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c index 749d3bd31bd..30432f1f141 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c @@ -160,6 +160,7 @@ static void gatt_discover(void) discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; err = bt_gatt_discover(g_conn, &discover_params); if (err != 0) { @@ -209,6 +210,7 @@ static struct bt_gatt_subscribe_params sub_params_short = { .disc_params = &disc_params_short, /* Auto-discover CCC */ .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .value = BT_GATT_CCC_NOTIFY, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static struct bt_gatt_discover_params disc_params_long; static struct bt_gatt_subscribe_params sub_params_long = { @@ -218,6 +220,7 @@ static struct bt_gatt_subscribe_params sub_params_long = { .disc_params = &disc_params_long, /* Auto-discover CCC */ .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .value = BT_GATT_CCC_NOTIFY, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static void gatt_subscribe_short(void) diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c index 6923d26f67b..760e3185592 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c @@ -125,6 +125,7 @@ static inline void short_notify(void) .func = notification_sent, .user_data = &length, .uuid = NULL, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; @@ -149,6 +150,7 @@ static inline void long_notify(void) .func = notification_sent, .user_data = &length, .uuid = NULL, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; diff --git a/tests/bluetooth/tester/src/gatt.c b/tests/bluetooth/tester/src/gatt.c index 1dbdd21dfd4..2d460378549 100644 --- a/tests/bluetooth/tester/src/gatt.c +++ b/tests/bluetooth/tester/src/gatt.c @@ -795,6 +795,7 @@ static uint8_t alloc_value(struct bt_gatt_attr *attr, struct set_value *data) indicate_params.len = value->len; indicate_params.func = indicate_cb; indicate_params.destroy = NULL; + indicate_params.chan_opt = BT_ATT_CHAN_OPT_NONE; bt_gatt_indicate(NULL, &indicate_params); } @@ -1006,6 +1007,7 @@ static void disc_all_prim(uint8_t *data, uint16_t len) discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; discover_params.func = disc_prim_cb; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; btp_opcode = GATT_DISC_ALL_PRIM; @@ -1049,6 +1051,7 @@ static void disc_prim_uuid(uint8_t *data, uint16_t len) discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; discover_params.func = disc_prim_cb; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; btp_opcode = GATT_DISC_PRIM_UUID; @@ -1134,6 +1137,7 @@ static void find_included(uint8_t *data, uint16_t len) discover_params.end_handle = sys_le16_to_cpu(cmd->end_handle); discover_params.type = BT_GATT_DISCOVER_INCLUDE; discover_params.func = find_included_cb; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_discover(conn, &discover_params) < 0) { discover_destroy(&discover_params); @@ -1216,6 +1220,7 @@ static void disc_all_chrc(uint8_t *data, uint16_t len) discover_params.end_handle = sys_le16_to_cpu(cmd->end_handle); discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC; discover_params.func = disc_chrc_cb; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = GATT_DISC_ALL_CHRC; @@ -1260,6 +1265,7 @@ static void disc_chrc_uuid(uint8_t *data, uint16_t len) discover_params.end_handle = sys_le16_to_cpu(cmd->end_handle); discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC; discover_params.func = disc_chrc_cb; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = GATT_DISC_CHRC_UUID; @@ -1341,6 +1347,7 @@ static void disc_all_desc(uint8_t *data, uint16_t len) discover_params.end_handle = sys_le16_to_cpu(cmd->end_handle); discover_params.type = BT_GATT_DISCOVER_DESCRIPTOR; discover_params.func = disc_all_desc_cb; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_discover(conn, &discover_params) < 0) { discover_destroy(&discover_params); @@ -1461,6 +1468,7 @@ static void read_data(uint8_t *data, uint16_t len) read_params.single.handle = sys_le16_to_cpu(cmd->handle); read_params.single.offset = 0x0000; read_params.func = read_cb; + read_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = GATT_READ; @@ -1505,6 +1513,7 @@ static void read_uuid(uint8_t *data, uint16_t len) read_params.by_uuid.start_handle = sys_le16_to_cpu(cmd->start_handle); read_params.by_uuid.end_handle = sys_le16_to_cpu(cmd->end_handle); read_params.func = read_uuid_cb; + read_params.chan_opt = BT_ATT_CHAN_OPT_NONE; btp_opcode = GATT_READ_UUID; @@ -1543,6 +1552,7 @@ static void read_long(uint8_t *data, uint16_t len) read_params.single.handle = sys_le16_to_cpu(cmd->handle); read_params.single.offset = sys_le16_to_cpu(cmd->offset); read_params.func = read_cb; + read_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = GATT_READ_LONG; @@ -1588,6 +1598,7 @@ static void read_multiple(uint8_t *data, uint16_t len, uint8_t opcode) read_params.handle_count = i; read_params.multiple.handles = handles; /* not used in read func */ read_params.multiple.variable = (opcode == GATT_READ_MULTIPLE_VAR); + read_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = opcode; @@ -1657,6 +1668,7 @@ static void write_data(uint8_t *data, uint16_t len) write_params.offset = 0U; write_params.data = cmd->data; write_params.length = sys_le16_to_cpu(cmd->data_length); + write_params.chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_write(conn, &write_params) < 0) { bt_conn_unref(conn); @@ -1693,6 +1705,7 @@ static void write_long(uint8_t *data, uint16_t len) write_params.offset = cmd->offset; write_params.data = cmd->data; write_params.length = sys_le16_to_cpu(cmd->data_length); + write_params.chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_write(conn, &write_params) < 0) { bt_conn_unref(conn); @@ -1769,6 +1782,7 @@ static void discover_complete(struct bt_conn *conn, goto fail; } + subscription->chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_subscribe(conn, subscription) < 0) { status = BTP_STATUS_FAILED; goto fail; @@ -1833,6 +1847,7 @@ static int enable_subscription(struct bt_conn *conn, uint16_t ccc_handle, discover_params.end_handle = ccc_handle; discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC; discover_params.func = discover_func; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; subscription->ccc_handle = ccc_handle; subscription->value = value; From edbb80a14ceceeae96164bc56cffda91644bf538 Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Tue, 3 May 2022 16:20:29 +0200 Subject: [PATCH 105/501] [nrf fromtree] Bluetooth: Host: Check if channel option is valid Disallow trying to send requests or notifications on only EATT channels if no EATT channels are connected or the link is not encrypted. In these cases the operation will always fail, so it should not be queued. Signed-off-by: Herman Berget (cherry picked from commit 4514a3c7bf1561a47933b53f12e01c3228f229cf) --- subsys/bluetooth/host/att.c | 17 +++++++++++++++++ subsys/bluetooth/host/att_internal.h | 2 ++ subsys/bluetooth/host/gatt.c | 15 +++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index eaee5e4c9c3..8e724ef3b91 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -3804,3 +3804,20 @@ void bt_att_free_tx_meta_data(const struct net_buf *buf) { tx_meta_data_free(bt_att_tx_meta_data(buf)); } + +bool bt_att_chan_opt_valid(struct bt_conn *conn, enum bt_att_chan_opt chan_opt) +{ + if ((chan_opt & (BT_ATT_CHAN_OPT_ENHANCED_ONLY | BT_ATT_CHAN_OPT_UNENHANCED_ONLY)) == + (BT_ATT_CHAN_OPT_ENHANCED_ONLY | BT_ATT_CHAN_OPT_UNENHANCED_ONLY)) { + /* Enhanced and Unenhanced are mutually exclusive */ + return false; + } + + /* Choosing EATT requires EATT channels connected and encryption enabled */ + if (chan_opt & BT_ATT_CHAN_OPT_ENHANCED_ONLY) { + return (bt_conn_get_security(conn) > BT_SECURITY_L1) && + !bt_att_fixed_chan_only(conn); + } + + return true; +} diff --git a/subsys/bluetooth/host/att_internal.h b/subsys/bluetooth/host/att_internal.h index e3fbb44a245..4afb65b5acc 100644 --- a/subsys/bluetooth/host/att_internal.h +++ b/subsys/bluetooth/host/att_internal.h @@ -332,3 +332,5 @@ void bt_att_free_tx_meta_data(const struct net_buf *buf); #else #define BT_ATT_CHAN_OPT(_params) BT_ATT_CHAN_OPT_UNENHANCED_ONLY #endif /* CONFIG_BT_EATT */ + +bool bt_att_chan_opt_valid(struct bt_conn *conn, enum bt_att_chan_opt chan_opt); diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 48ae5ffdc41..515b35cccff 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -2256,6 +2256,11 @@ static int gatt_notify(struct bt_conn *conn, uint16_t handle, return -EINVAL; } + if (IS_ENABLED(CONFIG_BT_EATT) && + !bt_att_chan_opt_valid(conn, BT_ATT_CHAN_OPT(params))) { + return -EINVAL; + } + #if defined(CONFIG_BT_GATT_NOTIFY_MULTIPLE) && (CONFIG_BT_GATT_NOTIFY_MULTIPLE_FLUSH_MS != 0) if (gatt_cf_notify_multi(conn)) { return gatt_notify_mult(conn, handle, params); @@ -2330,6 +2335,11 @@ static int gatt_req_send(struct bt_conn *conn, bt_att_func_t func, void *params, struct net_buf *buf; int err; + if (IS_ENABLED(CONFIG_BT_EATT) && + !bt_att_chan_opt_valid(conn, chan_opt)) { + return -EINVAL; + } + req = gatt_req_alloc(func, params, encode, op, len); if (!req) { return -ENOMEM; @@ -2397,6 +2407,11 @@ static int gatt_indicate(struct bt_conn *conn, uint16_t handle, return -EINVAL; } + if (IS_ENABLED(CONFIG_BT_EATT) && + !bt_att_chan_opt_valid(conn, BT_ATT_CHAN_OPT(params))) { + return -EINVAL; + } + len = sizeof(*ind) + params->len; req = gatt_req_alloc(gatt_indicate_rsp, params, NULL, From 03d3d8c8645afab96d6d8dd7e2ded947447ff5e0 Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Thu, 5 May 2022 15:23:35 +0200 Subject: [PATCH 106/501] [nrf fromtree] doc: release-notes: Document Bluetooth EATT API change A field was added to the `bt_gatt__params` structs when `CONFIG_BT_EATT` is enabled. This changes the experimental API for EATT. Signed-off-by: Herman Berget (cherry picked from commit 2099d7e07b9ef5340e0e715050785fcaacaebd7b) --- doc/releases/release-notes-3.1.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/releases/release-notes-3.1.rst b/doc/releases/release-notes-3.1.rst index 2e3d8acbc50..517ef1c6e3c 100644 --- a/doc/releases/release-notes-3.1.rst +++ b/doc/releases/release-notes-3.1.rst @@ -25,6 +25,9 @@ Changes in this release * LoRaWAN: The message type parameter in :c:func:`lorawan_send` was changed from ``uint8_t`` to ``enum lorawan_message_type``. If ``0`` was passed for unconfirmed message, this has to be changed to ``LORAWAN_MSG_UNCONFIRMED``. +* Bluetooth: Applications where :kconfig:option:`CONFIG_BT_EATT` is enabled + must set the :c:member:`chan_opt` field on the GATT parameter structs. + To keep the old behavior use :c:enumerator:`BT_ATT_CHAN_OPT_NONE`. * Disk Subsystem: SPI mode SD cards now use the SD subsystem to communicate with SD cards. See :ref:`the disk access api ` for an From 2631573f2fd530733338a2cb1cd9da180c55e95c Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Tue, 21 Jun 2022 13:53:58 +0200 Subject: [PATCH 107/501] [nrf fromtree] Bluetooth: Host: Fix bt_eatt_connect returning -EINVAL if conn is NULL bt_eatt_connect was documented to return -EINVAL if conn is NULL, but this was not the case. Instead it lead to undefined behavior. Signed-off-by: Herman Berget (cherry picked from commit 321746efc16a4770f97e899420396afd03b2f3af) --- include/zephyr/bluetooth/att.h | 3 +-- subsys/bluetooth/host/att.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/zephyr/bluetooth/att.h b/include/zephyr/bluetooth/att.h index 0c4e3c693e8..9b94a4f2031 100644 --- a/include/zephyr/bluetooth/att.h +++ b/include/zephyr/bluetooth/att.h @@ -76,8 +76,7 @@ int bt_eatt_reconfigure(struct bt_conn *conn, uint16_t mtu); * Must be in the range 1 - @kconfig{CONFIG_BT_EATT_MAX}, inclusive. * * @return 0 in case of success or negative value in case of error. - * @retval -EINVAL if @p num_channels is not in the allowed range. - * @retval -EINVAL if @p conn is NULL. + * @retval -EINVAL if @p num_channels is not in the allowed range or @p conn is NULL. * @retval -ENOMEM if less than @p num_channels are allocated. * @retval 0 in case of success */ diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 8e724ef3b91..69d8547c947 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -3344,8 +3344,8 @@ static void ecred_connect_rsp_cb(struct bt_conn *conn, uint16_t result, int bt_eatt_connect(struct bt_conn *conn, size_t num_channels) { - struct bt_att_chan *att_chan = att_get_fixed_chan(conn); - struct bt_att *att = att_chan->att; + struct bt_att_chan *att_chan; + struct bt_att *att; struct bt_l2cap_chan *chan[CONFIG_BT_EATT_MAX + 1] = {}; size_t offset = 0; size_t i = 0; @@ -3363,6 +3363,13 @@ int bt_eatt_connect(struct bt_conn *conn, size_t num_channels) return -EINVAL; } + if (!conn) { + return -EINVAL; + } + + att_chan = att_get_fixed_chan(conn); + att = att_chan->att; + while (num_channels--) { att_chan = att_chan_new(att, BIT(ATT_ENHANCED)); if (!att_chan) { From cc958fddbb0912a8b940b9412d42967d8f43a527 Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Tue, 21 Jun 2022 13:55:52 +0200 Subject: [PATCH 108/501] [nrf fromtree] doc: Bluetooth: Add ATT section in docs There was no API reference for the ATT APIs. Signed-off-by: Herman Berget (cherry picked from commit ef2c6500389d900396788532218e61f3bb2e1fbc) --- doc/connectivity/bluetooth/api/att.rst | 9 +++++++++ doc/connectivity/bluetooth/api/index.rst | 1 + doc/zephyr.doxyfile.in | 1 + include/zephyr/bluetooth/att.h | 11 +++++++++++ 4 files changed, 22 insertions(+) create mode 100644 doc/connectivity/bluetooth/api/att.rst diff --git a/doc/connectivity/bluetooth/api/att.rst b/doc/connectivity/bluetooth/api/att.rst new file mode 100644 index 00000000000..bc663e2c108 --- /dev/null +++ b/doc/connectivity/bluetooth/api/att.rst @@ -0,0 +1,9 @@ +.. _bt_att: + +Attribute Protocol (ATT) +######################## + +API Reference +************* + +.. doxygengroup:: bt_att diff --git a/doc/connectivity/bluetooth/api/index.rst b/doc/connectivity/bluetooth/api/index.rst index 9ab9bb31961..c0473b9f1ae 100644 --- a/doc/connectivity/bluetooth/api/index.rst +++ b/doc/connectivity/bluetooth/api/index.rst @@ -6,6 +6,7 @@ Bluetooth APIs .. toctree:: :maxdepth: 1 + att.rst audio.rst connection_mgmt.rst controller.rst diff --git a/doc/zephyr.doxyfile.in b/doc/zephyr.doxyfile.in index 82039d46c86..561a840007c 100644 --- a/doc/zephyr.doxyfile.in +++ b/doc/zephyr.doxyfile.in @@ -2256,6 +2256,7 @@ PREDEFINED = __DOXYGEN__ \ CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT \ CONFIG_ARCH_HAS_CUSTOM_SWAP_TO_MAIN \ CONFIG_BT_BREDR \ + CONFIG_BT_EATT \ CONFIG_BT_MESH_MODEL_EXTENSIONS \ CONFIG_BT_REMOTE_INFO \ CONFIG_BT_USER_DATA_LEN_UPDATE \ diff --git a/include/zephyr/bluetooth/att.h b/include/zephyr/bluetooth/att.h index 9b94a4f2031..64046c5b490 100644 --- a/include/zephyr/bluetooth/att.h +++ b/include/zephyr/bluetooth/att.h @@ -10,6 +10,13 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ #define ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ +/** + * @brief Attribute Protocol (ATT) + * @defgroup bt_att Attribute Protocol (ATT) + * @ingroup bluetooth + * @{ + */ + #include #include @@ -110,4 +117,8 @@ enum bt_att_chan_opt { } #endif +/** + * @} + */ + #endif /* ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ */ From 6b0ea239a474f714b69bb1ce91e5a087f7d8f0ce Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Fri, 29 Jul 2022 13:55:19 +0200 Subject: [PATCH 109/501] [nrf fromtree] Bluetooth: Host: Move all sending from tx_queue to process_queue Similar functionality was implemented in two places. Signed-off-by: Herman Berget (cherry picked from commit 0650c486153742ec4d5a11dfc58408805ea817c2) --- subsys/bluetooth/host/att.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 69d8547c947..e57e5ca79a9 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -598,25 +598,18 @@ static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf) static void att_send_process(struct bt_att *att) { struct bt_att_chan *chan, *tmp; - struct net_buf *buf; - int err = -ENOENT; - - buf = net_buf_get(&att->tx_queue, K_NO_WAIT); - if (!buf) { - return; - } + int err; SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&att->chans, chan, tmp, node) { - err = bt_att_chan_send(chan, buf); - if (err >= 0) { - break; + err = process_queue(chan, &att->tx_queue); + if (!err) { + /* Success */ + return; + } else if (err == -ENOENT) { + /* Nothing to send */ + return; } } - - if (err < 0) { - /* Push it back if it could not be send */ - k_queue_prepend(&att->tx_queue._queue, buf); - } } static void bt_att_chan_send_rsp(struct bt_att_chan *chan, struct net_buf *buf) From 20f5577ac16994708926f85396cb649b88cf6ebd Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Mon, 1 Aug 2022 13:25:43 +0200 Subject: [PATCH 110/501] [nrf fromtree] Bluetooth: Host: Get first packet matching channel When sending an ATT packet, do not just try to send the first packet in the queue, but find the first one that can be sent using the channel. This makes sure that eg. packets that shall be sent on an unenhanced ATT channel are not blocked by packets that shall be sent on enhanced ATT channels. Signed-off-by: Herman Berget (cherry picked from commit 66c74457f486386cc7c4cdf88a5fe872140b7e97) --- subsys/bluetooth/host/att.c | 131 +++++++++++++++++++++++++++++------- 1 file changed, 108 insertions(+), 23 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index e57e5ca79a9..df2f1c8e324 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -291,12 +291,76 @@ static bool att_chan_matches_chan_opt(struct bt_att_chan *chan, enum bt_att_chan } } +static struct net_buf *get_first_buf_matching_chan(struct k_fifo *fifo, struct bt_att_chan *chan) +{ + if (IS_ENABLED(CONFIG_BT_EATT)) { + struct k_fifo skipped; + struct net_buf *buf; + struct net_buf *ret = NULL; + + k_fifo_init(&skipped); + + while ((buf = net_buf_get(fifo, K_NO_WAIT))) { + if (!ret && + att_chan_matches_chan_opt(chan, bt_att_tx_meta_data(buf)->chan_opt)) { + ret = buf; + } else { + net_buf_put(&skipped, buf); + } + } + + __ASSERT_NO_MSG(k_fifo_is_empty(fifo)); + + while ((buf = net_buf_get(&skipped, K_NO_WAIT))) { + net_buf_put(fifo, buf); + } + + __ASSERT_NO_MSG(k_fifo_is_empty(&skipped)); + + return ret; + } else { + return net_buf_get(fifo, K_NO_WAIT); + } +} + +static struct bt_att_req *get_first_req_matching_chan(sys_slist_t *reqs, struct bt_att_chan *chan) +{ + if (IS_ENABLED(CONFIG_BT_EATT)) { + sys_snode_t *curr, *prev = NULL; + + SYS_SLIST_FOR_EACH_NODE(reqs, curr) { + if (att_chan_matches_chan_opt( + chan, bt_att_tx_meta_data(ATT_REQ(curr)->buf)->chan_opt)) { + break; + } + + prev = curr; + } + + if (curr) { + sys_slist_remove(reqs, prev, curr); + + return ATT_REQ(curr); + } + + return NULL; + } + + sys_snode_t *node = sys_slist_get(reqs); + + if (node) { + return ATT_REQ(node); + } else { + return NULL; + } +} + static int process_queue(struct bt_att_chan *chan, struct k_fifo *queue) { struct net_buf *buf; int err; - buf = net_buf_get(queue, K_NO_WAIT); + buf = get_first_buf_matching_chan(queue, chan); if (buf) { err = bt_att_chan_send(chan, buf); if (err) { @@ -597,18 +661,27 @@ static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf) static void att_send_process(struct bt_att *att) { - struct bt_att_chan *chan, *tmp; - int err; + struct bt_att_chan *chan, *tmp, *prev = NULL; + int err = 0; SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&att->chans, chan, tmp, node) { + if (err == -ENOENT && prev && + (atomic_test_bit(chan->flags, ATT_ENHANCED) == + atomic_test_bit(prev->flags, ATT_ENHANCED))) { + /* If there was nothing to send for the previous channel and the current + * channel has the same "enhancedness", there will be nothing to send for + * this channel either. + */ + continue; + } + err = process_queue(chan, &att->tx_queue); if (!err) { /* Success */ return; - } else if (err == -ENOENT) { - /* Nothing to send */ - return; } + + prev = chan; } } @@ -727,28 +800,40 @@ static int bt_att_chan_req_send(struct bt_att_chan *chan, static void att_req_send_process(struct bt_att *att) { - sys_snode_t *node; - struct bt_att_chan *chan, *tmp; + struct bt_att_req *req = NULL; + struct bt_att_chan *chan, *tmp, *prev = NULL; - /* Pull next request from the list */ - node = sys_slist_get(&att->reqs); - if (!node) { - return; - } + SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&att->chans, chan, tmp, node) { + /* If there is an ongoing transaction, do not use the channel */ + if (chan->req) { + continue; + } + + if (!req && prev && + (atomic_test_bit(chan->flags, ATT_ENHANCED) == + atomic_test_bit(prev->flags, ATT_ENHANCED))) { + /* If there was nothing to send for the previous channel and the current + * channel has the same "enhancedness", there will be nothing to send for + * this channel either. + */ + continue; + } - BT_DBG("req %p", ATT_REQ(node)); + prev = chan; - SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&att->chans, chan, tmp, node) { - /* If there is nothing pending use the channel */ - if (!chan->req) { - if (bt_att_chan_req_send(chan, ATT_REQ(node)) >= 0) { - return; - } + /* Pull next request from the list */ + req = get_first_req_matching_chan(&att->reqs, chan); + if (!req) { + continue; } - } - /* Prepend back to the list as it could not be sent */ - sys_slist_prepend(&att->reqs, node); + if (bt_att_chan_req_send(chan, req) >= 0) { + return; + } + + /* Prepend back to the list as it could not be sent */ + sys_slist_prepend(&att->reqs, &req->node); + } } static uint8_t att_handle_rsp(struct bt_att_chan *chan, void *pdu, uint16_t len, From 012beee9df305c1c1b51b615a11331b0a56cac01 Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Mon, 8 Aug 2022 13:49:13 +0200 Subject: [PATCH 111/501] [nrf fromtree] Bluetooth: Tests: Add tests for EATT flag API Checks that both notifications and requests work using the different channel options. Signed-off-by: Herman Berget (cherry picked from commit de226532f2a123f7c49a285919bf62574c57ca74) --- .../bsim_test_notify/src/gatt_client_test.c | 179 +++++++++++++++--- .../bsim_test_notify/src/gatt_server_test.c | 91 ++++++++- .../test_scripts/_run_test.sh | 38 ++++ .../gatt_notify_enhanced_enhanced.sh | 10 + .../gatt_notify_enhanced_mixed.sh | 10 + .../test_scripts/gatt_notify_enhanced_none.sh | 10 + .../gatt_notify_enhanced_unenhanced.sh | 10 + .../gatt_notify_mixed_enhanced.sh | 10 + .../test_scripts/gatt_notify_mixed_mixed.sh | 10 + .../test_scripts/gatt_notify_mixed_none.sh | 10 + .../gatt_notify_mixed_unenhanced.sh | 10 + .../test_scripts/gatt_notify_none_enhanced.sh | 10 + .../test_scripts/gatt_notify_none_mixed.sh | 10 + .../test_scripts/gatt_notify_none_none.sh | 10 + .../gatt_notify_none_unenhanced.sh | 10 + .../gatt_notify_unenhanced_enhanced.sh | 10 + .../gatt_notify_unenhanced_mixed.sh | 10 + .../gatt_notify_unenhanced_none.sh | 10 + .../gatt_notify_unenhanced_unenhanced.sh | 10 + .../bsim_test_notify/test_scripts/notify.sh | 40 ---- 20 files changed, 431 insertions(+), 77 deletions(-) create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/_run_test.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_enhanced.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_mixed.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_none.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_unenhanced.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_enhanced.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_mixed.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_none.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_unenhanced.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_enhanced.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_mixed.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_none.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_unenhanced.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_enhanced.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_mixed.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_none.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_unenhanced.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/notify.sh diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c index 30432f1f141..e31c275e62e 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c @@ -12,7 +12,8 @@ CREATE_FLAG(flag_is_connected); CREATE_FLAG(flag_is_encrypted); CREATE_FLAG(flag_discover_complete); -CREATE_FLAG(flag_subscribed); +CREATE_FLAG(flag_short_subscribed); +CREATE_FLAG(flag_long_subscribed); static struct bt_conn *g_conn; static uint16_t chrc_handle; @@ -148,7 +149,7 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at return BT_GATT_ITER_CONTINUE; } -static void gatt_discover(void) +static void gatt_discover(enum bt_att_chan_opt opt) { static struct bt_gatt_discover_params discover_params; int err; @@ -160,7 +161,7 @@ static void gatt_discover(void) discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; + discover_params.chan_opt = opt; err = bt_gatt_discover(g_conn, &discover_params); if (err != 0) { @@ -171,13 +172,14 @@ static void gatt_discover(void) printk("Discover complete\n"); } -static void test_subscribed(struct bt_conn *conn, uint8_t err, struct bt_gatt_write_params *params) +static void test_short_subscribed(struct bt_conn *conn, uint8_t err, + struct bt_gatt_write_params *params) { if (err) { FAIL("Subscribe failed (err %d)\n", err); } - SET_FLAG(flag_subscribed); + SET_FLAG(flag_short_subscribed); if (!params) { printk("params NULL\n"); @@ -186,7 +188,26 @@ static void test_subscribed(struct bt_conn *conn, uint8_t err, struct bt_gatt_wr if (params->handle == chrc_handle) { printk("Subscribed to short characteristic\n"); - } else if (params->handle == long_chrc_handle) { + } else { + FAIL("Unknown handle %d\n", params->handle); + } +} + +static void test_long_subscribed(struct bt_conn *conn, uint8_t err, + struct bt_gatt_write_params *params) +{ + if (err) { + FAIL("Subscribe failed (err %d)\n", err); + } + + SET_FLAG(flag_long_subscribed); + + if (!params) { + printk("params NULL\n"); + return; + } + + if (params->handle == long_chrc_handle) { printk("Subscribed to long characteristic\n"); } else { FAIL("Unknown handle %d\n", params->handle); @@ -205,83 +226,81 @@ uint8_t test_notify(struct bt_conn *conn, struct bt_gatt_subscribe_params *param static struct bt_gatt_discover_params disc_params_short; static struct bt_gatt_subscribe_params sub_params_short = { .notify = test_notify, - .write = test_subscribed, + .write = test_short_subscribed, .ccc_handle = 0, /* Auto-discover CCC*/ .disc_params = &disc_params_short, /* Auto-discover CCC */ .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .value = BT_GATT_CCC_NOTIFY, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static struct bt_gatt_discover_params disc_params_long; static struct bt_gatt_subscribe_params sub_params_long = { .notify = test_notify, - .write = test_subscribed, + .write = test_long_subscribed, .ccc_handle = 0, /* Auto-discover CCC*/ .disc_params = &disc_params_long, /* Auto-discover CCC */ .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .value = BT_GATT_CCC_NOTIFY, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; -static void gatt_subscribe_short(void) +static void gatt_subscribe_short(enum bt_att_chan_opt opt) { int err; sub_params_short.value_handle = chrc_handle; + sub_params_short.chan_opt = opt; err = bt_gatt_subscribe(g_conn, &sub_params_short); if (err < 0) { FAIL("Failed to subscribe\n"); } else { printk("Subscribe request sent\n"); } - WAIT_FOR_FLAG(flag_subscribed); } -static void gatt_unsubscribe_short(void) +static void gatt_unsubscribe_short(enum bt_att_chan_opt opt) { int err; sub_params_short.value_handle = chrc_handle; + sub_params_short.chan_opt = opt; err = bt_gatt_unsubscribe(g_conn, &sub_params_short); if (err < 0) { FAIL("Failed to unsubscribe\n"); } else { printk("Unsubscribe request sent\n"); } - WAIT_FOR_FLAG(flag_subscribed); } -static void gatt_subscribe_long(void) +static void gatt_subscribe_long(enum bt_att_chan_opt opt) { int err; - UNSET_FLAG(flag_subscribed); + UNSET_FLAG(flag_long_subscribed); sub_params_long.value_handle = long_chrc_handle; + sub_params_long.chan_opt = opt; err = bt_gatt_subscribe(g_conn, &sub_params_long); if (err < 0) { FAIL("Failed to subscribe\n"); } else { printk("Subscribe request sent\n"); } - WAIT_FOR_FLAG(flag_subscribed); } -static void gatt_unsubscribe_long(void) +static void gatt_unsubscribe_long(enum bt_att_chan_opt opt) { int err; - UNSET_FLAG(flag_subscribed); + UNSET_FLAG(flag_long_subscribed); sub_params_long.value_handle = long_chrc_handle; + sub_params_long.chan_opt = opt; err = bt_gatt_unsubscribe(g_conn, &sub_params_long); if (err < 0) { FAIL("Failed to unsubscribe\n"); } else { printk("Unsubscribe request sent\n"); } - WAIT_FOR_FLAG(flag_subscribed); } -static void test_main(void) +static void setup(void) { int err; @@ -311,10 +330,42 @@ static void test_main(void) } printk("EATT connected\n"); +} + +static void test_main_none(void) +{ + setup(); - gatt_discover(); - gatt_subscribe_short(); - gatt_subscribe_long(); + gatt_discover(BT_ATT_CHAN_OPT_NONE); + gatt_subscribe_short(BT_ATT_CHAN_OPT_NONE); + gatt_subscribe_long(BT_ATT_CHAN_OPT_NONE); + WAIT_FOR_FLAG(flag_short_subscribed); + WAIT_FOR_FLAG(flag_long_subscribed); + printk("Subscribed\n"); + + while (num_notifications < NOTIFICATION_COUNT) { + k_sleep(K_MSEC(100)); + } + + gatt_unsubscribe_short(BT_ATT_CHAN_OPT_NONE); + gatt_unsubscribe_long(BT_ATT_CHAN_OPT_NONE); + WAIT_FOR_FLAG(flag_short_subscribed); + WAIT_FOR_FLAG(flag_long_subscribed); + + printk("Unsubscribed\n"); + + PASS("GATT client Passed\n"); +} + +static void test_main_unenhanced(void) +{ + setup(); + + gatt_discover(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + gatt_subscribe_short(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + gatt_subscribe_long(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + WAIT_FOR_FLAG(flag_short_subscribed); + WAIT_FOR_FLAG(flag_long_subscribed); printk("Subscribed\n"); @@ -322,8 +373,62 @@ static void test_main(void) k_sleep(K_MSEC(100)); } - gatt_unsubscribe_short(); - gatt_unsubscribe_long(); + gatt_unsubscribe_short(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + gatt_unsubscribe_long(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + WAIT_FOR_FLAG(flag_short_subscribed); + WAIT_FOR_FLAG(flag_long_subscribed); + + printk("Unsubscribed\n"); + + PASS("GATT client Passed\n"); +} + +static void test_main_enhanced(void) +{ + setup(); + + gatt_discover(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + gatt_subscribe_short(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + gatt_subscribe_long(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + WAIT_FOR_FLAG(flag_short_subscribed); + WAIT_FOR_FLAG(flag_long_subscribed); + + printk("Subscribed\n"); + + while (num_notifications < NOTIFICATION_COUNT) { + k_sleep(K_MSEC(100)); + } + + gatt_unsubscribe_short(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + gatt_unsubscribe_long(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + WAIT_FOR_FLAG(flag_short_subscribed); + WAIT_FOR_FLAG(flag_long_subscribed); + + printk("Unsubscribed\n"); + + PASS("GATT client Passed\n"); +} + +static void test_main_mixed(void) +{ + setup(); + + gatt_discover(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + gatt_subscribe_short(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + gatt_subscribe_long(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + WAIT_FOR_FLAG(flag_short_subscribed); + WAIT_FOR_FLAG(flag_long_subscribed); + + printk("Subscribed\n"); + + while (num_notifications < NOTIFICATION_COUNT) { + k_sleep(K_MSEC(100)); + } + + gatt_unsubscribe_short(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + gatt_unsubscribe_long(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + WAIT_FOR_FLAG(flag_short_subscribed); + WAIT_FOR_FLAG(flag_long_subscribed); printk("Unsubscribed\n"); @@ -332,10 +437,28 @@ static void test_main(void) static const struct bst_test_instance test_vcs[] = { { - .test_id = "gatt_client", + .test_id = "gatt_client_none", + .test_post_init_f = test_init, + .test_tick_f = test_tick, + .test_main_f = test_main_none, + }, + { + .test_id = "gatt_client_unenhanced", + .test_post_init_f = test_init, + .test_tick_f = test_tick, + .test_main_f = test_main_unenhanced, + }, + { + .test_id = "gatt_client_enhanced", + .test_post_init_f = test_init, + .test_tick_f = test_tick, + .test_main_f = test_main_enhanced, + }, + { + .test_id = "gatt_client_mixed", .test_post_init_f = test_init, .test_tick_f = test_tick, - .test_main_f = test_main, + .test_main_f = test_main_mixed, }, BSTEST_END_MARKER, }; diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c index 760e3185592..d514376c717 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c @@ -115,7 +115,7 @@ static void notification_sent(struct bt_conn *conn, void *user_data) printk("Sent notification #%u with length %d\n", num_notifications_sent++, *length); } -static inline void short_notify(void) +static void short_notify(enum bt_att_chan_opt opt) { static size_t length = CHRC_SIZE; static struct bt_gatt_notify_params params = { @@ -125,10 +125,11 @@ static inline void short_notify(void) .func = notification_sent, .user_data = &length, .uuid = NULL, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; + params.chan_opt = opt; + do { err = bt_gatt_notify_cb(g_conn, ¶ms); @@ -140,7 +141,7 @@ static inline void short_notify(void) } while (err); } -static inline void long_notify(void) +static void long_notify(enum bt_att_chan_opt opt) { static size_t length = LONG_CHRC_SIZE; static struct bt_gatt_notify_params params = { @@ -150,10 +151,11 @@ static inline void long_notify(void) .func = notification_sent, .user_data = &length, .uuid = NULL, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; + params.chan_opt = opt; + do { err = bt_gatt_notify_cb(g_conn, ¶ms); @@ -165,7 +167,7 @@ static inline void long_notify(void) } while (err); } -static void test_main(void) +static void setup(void) { int err; const struct bt_data ad[] = { @@ -197,10 +199,63 @@ static void test_main(void) WAIT_FOR_FLAG(flag_short_subscribe); WAIT_FOR_FLAG(flag_long_subscribe); +} + +static void test_main_none(void) +{ + setup(); for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { - short_notify(); - long_notify(); + short_notify(BT_ATT_CHAN_OPT_NONE); + long_notify(BT_ATT_CHAN_OPT_NONE); + } + + while (num_notifications_sent < NOTIFICATION_COUNT) { + k_sleep(K_MSEC(100)); + } + + PASS("GATT server passed\n"); +} + +static void test_main_enhanced(void) +{ + setup(); + + for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { + short_notify(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + long_notify(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + } + + while (num_notifications_sent < NOTIFICATION_COUNT) { + k_sleep(K_MSEC(100)); + } + + PASS("GATT server passed\n"); +} + +static void test_main_unenhanced(void) +{ + setup(); + + for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { + short_notify(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + long_notify(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + } + + while (num_notifications_sent < NOTIFICATION_COUNT) { + k_sleep(K_MSEC(100)); + } + + PASS("GATT server passed\n"); +} + +static void test_main_mixed(void) +{ + setup(); + + for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { + short_notify(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + long_notify(BT_ATT_CHAN_OPT_ENHANCED_ONLY); } while (num_notifications_sent < NOTIFICATION_COUNT) { @@ -212,10 +267,28 @@ static void test_main(void) static const struct bst_test_instance test_gatt_server[] = { { - .test_id = "gatt_server", + .test_id = "gatt_server_none", + .test_post_init_f = test_init, + .test_tick_f = test_tick, + .test_main_f = test_main_none, + }, + { + .test_id = "gatt_server_unenhanced", + .test_post_init_f = test_init, + .test_tick_f = test_tick, + .test_main_f = test_main_unenhanced, + }, + { + .test_id = "gatt_server_enhanced", + .test_post_init_f = test_init, + .test_tick_f = test_tick, + .test_main_f = test_main_enhanced, + }, + { + .test_id = "gatt_server_mixed", .test_post_init_f = test_init, .test_tick_f = test_tick, - .test_main_f = test_main, + .test_main_f = test_main_mixed, }, BSTEST_END_MARKER, }; diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/_run_test.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/_run_test.sh new file mode 100755 index 00000000000..14d93c0bf27 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/_run_test.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +verbosity_level=2 +process_ids="" +exit_code=0 + +function Execute() { + if [ ! -f $1 ]; then + echo -e " \e[91m$(pwd)/$(basename $1) cannot be found (did you forget to\ + compile it?)\e[39m" + exit 1 + fi + timeout 30 $@ & + process_ids="$process_ids $!" +} + +: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" + +#Give a default value to BOARD if it does not have one yet: +BOARD="${BOARD:-nrf52_bsim}" + +cd ${BSIM_OUT_PATH}/bin + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=${client_id} + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=${server_id} + +Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ + -D=2 -sim_length=60e6 $@ + +for process_id in $process_ids; do + wait $process_id || let "exit_code=$?" +done +exit $exit_code #the last exit code != 0 diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_enhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_enhanced.sh new file mode 100755 index 00000000000..68cf9409994 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_enhanced.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_enhanced_enhanced" \ + server_id="gatt_server_enhanced" \ + client_id="gatt_client_enhanced" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_mixed.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_mixed.sh new file mode 100755 index 00000000000..75a4b9d83c9 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_mixed.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_enhanced_mixed" \ + server_id="gatt_server_enhanced" \ + client_id="gatt_client_mixed" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_none.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_none.sh new file mode 100755 index 00000000000..e89b16ca20e --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_none.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_enhanced_none" \ + server_id="gatt_server_enhanced" \ + client_id="gatt_client_none" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_unenhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_unenhanced.sh new file mode 100755 index 00000000000..5cc85731633 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_unenhanced.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_enhanced_unenhanced" \ + server_id="gatt_server_enhanced" \ + client_id="gatt_client_unenhanced" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_enhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_enhanced.sh new file mode 100755 index 00000000000..a4ecf9d429b --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_enhanced.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_mixed_enhanced" \ + server_id="gatt_server_mixed" \ + client_id="gatt_client_enhanced" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_mixed.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_mixed.sh new file mode 100755 index 00000000000..a9f38d8f37f --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_mixed.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_mixed_mixed" \ + server_id="gatt_server_mixed" \ + client_id="gatt_client_mixed" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_none.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_none.sh new file mode 100755 index 00000000000..80afe822cfd --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_none.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_mixed_none" \ + server_id="gatt_server_mixed" \ + client_id="gatt_client_none" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_unenhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_unenhanced.sh new file mode 100755 index 00000000000..9ff73b2de4b --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_unenhanced.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_mixed_unenhanced" \ + server_id="gatt_server_mixed" \ + client_id="gatt_client_unenhanced" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_enhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_enhanced.sh new file mode 100755 index 00000000000..74eedd15ddc --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_enhanced.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_none_enhanced" \ + server_id="gatt_server_none" \ + client_id="gatt_client_enhanced" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_mixed.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_mixed.sh new file mode 100755 index 00000000000..02541c6db74 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_mixed.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_none_mixed" \ + server_id="gatt_server_none" \ + client_id="gatt_client_mixed" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_none.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_none.sh new file mode 100755 index 00000000000..6642f8ed2b5 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_none.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_none_none" \ + server_id="gatt_server_none" \ + client_id="gatt_client_none" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_unenhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_unenhanced.sh new file mode 100755 index 00000000000..2f2764186c7 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_unenhanced.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_none_unenhanced" \ + server_id="gatt_server_none" \ + client_id="gatt_client_unenhanced" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_enhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_enhanced.sh new file mode 100755 index 00000000000..ab91b23437d --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_enhanced.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_unenhanced_enhanced" \ + server_id="gatt_server_unenhanced" \ + client_id="gatt_client_enhanced" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_mixed.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_mixed.sh new file mode 100755 index 00000000000..57063ac272b --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_mixed.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_unenhanced_mixed" \ + server_id="gatt_server_unenhanced" \ + client_id="gatt_client_mixed" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_none.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_none.sh new file mode 100755 index 00000000000..df360db4e5e --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_none.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_unenhanced_none" \ + server_id="gatt_server_unenhanced" \ + client_id="gatt_client_none" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_unenhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_unenhanced.sh new file mode 100755 index 00000000000..7b624969d5d --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_unenhanced.sh @@ -0,0 +1,10 @@ + +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +simulation_id="gatt_notify_unenhanced_unenhanced" \ + server_id="gatt_server_unenhanced" \ + client_id="gatt_client_unenhanced" \ + $(dirname "${BASH_SOURCE[0]}")/_run_test.sh + diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/notify.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/notify.sh deleted file mode 100755 index 973f0ae3baf..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/notify.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Basic GATT test: A central acting as a GATT client scans for and connects -# to a peripheral acting as a GATT server. The GATT client will then attempt -# to write and read to and from a few GATT characteristics. -simulation_id="notify_cb" -verbosity_level=2 -process_ids=""; exit_code=0 - -function Execute(){ - if [ ! -f $1 ]; then - echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\ - compile it?)\e[39m" - exit 1 - fi - timeout 120 $@ & process_ids="$process_ids $!" -} - -: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" - -#Give a default value to BOARD if it does not have one yet: -BOARD="${BOARD:-nrf52_bsim}" - -cd ${BSIM_OUT_PATH}/bin - -Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=gatt_client - -Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=gatt_server - -Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ - -D=2 -sim_length=60e6 $@ - -for process_id in $process_ids; do - wait $process_id || let "exit_code=$?" -done -exit $exit_code #the last exit code != 0 From db63e67bcbf1b9b9b32d90678863ffceab71e333 Mon Sep 17 00:00:00 2001 From: Jonathan Rico Date: Thu, 11 Aug 2022 10:04:40 +0200 Subject: [PATCH 112/501] [nrf fromtree] Bluetooth: gatt: allow disabling subscription enforcement This introduces a new option that allows the user to disable the subscription checking when notifying or indicating. Some users might have use-cases where they would like to send notifications or indications without the peer having to go through the subscription process, as that is allowed by the Bluetooth specification. Signed-off-by: Jonathan Rico (cherry picked from commit 480d24a7a84f36e930ebc7b20e0a466a23507897) --- subsys/bluetooth/host/Kconfig.gatt | 8 ++++++++ subsys/bluetooth/host/gatt.c | 32 +++++++++++++++++------------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index a265d2ed42c..b2d75d23b4e 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -146,6 +146,14 @@ config BT_GATT_ENFORCE_CHANGE_UNAWARE endif # BT_GATT_CACHING +config BT_GATT_ENFORCE_SUBSCRIPTION + bool "GATT Enforce characteristic subscription" + default y + help + When enabled, this option will make the server block sending + notifications and indications to a device which has not subscribed to + the supplied characteristic. + config BT_GATT_CLIENT bool "GATT client support" help diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 515b35cccff..dbf908224fe 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -2247,13 +2247,15 @@ static int gatt_notify(struct bt_conn *conn, uint16_t handle, return -EPERM; } - /* Check if client has subscribed before sending notifications. - * This is not really required in the Bluetooth specification, but - * follows its spirit. - */ - if (!bt_gatt_is_subscribed(conn, params->attr, BT_GATT_CCC_NOTIFY)) { - BT_WARN("Device is not subscribed to characteristic"); - return -EINVAL; + if (IS_ENABLED(CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION)) { + /* Check if client has subscribed before sending notifications. + * This is not really required in the Bluetooth specification, + * but follows its spirit. + */ + if (!bt_gatt_is_subscribed(conn, params->attr, BT_GATT_CCC_NOTIFY)) { + BT_WARN("Device is not subscribed to characteristic"); + return -EINVAL; + } } if (IS_ENABLED(CONFIG_BT_EATT) && @@ -2398,13 +2400,15 @@ static int gatt_indicate(struct bt_conn *conn, uint16_t handle, return -EPERM; } - /* Check if client has subscribed before sending notifications. - * This is not really required in the Bluetooth specification, but - * follows its spirit. - */ - if (!bt_gatt_is_subscribed(conn, params->attr, BT_GATT_CCC_INDICATE)) { - BT_WARN("Device is not subscribed to characteristic"); - return -EINVAL; + if (IS_ENABLED(CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION)) { + /* Check if client has subscribed before sending notifications. + * This is not really required in the Bluetooth specification, + * but follows its spirit. + */ + if (!bt_gatt_is_subscribed(conn, params->attr, BT_GATT_CCC_INDICATE)) { + BT_WARN("Device is not subscribed to characteristic"); + return -EINVAL; + } } if (IS_ENABLED(CONFIG_BT_EATT) && From 5ea1da38a8a40802541fb391644a9f61180a4e46 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Mon, 22 Aug 2022 10:11:32 +0200 Subject: [PATCH 113/501] [nrf fromtree] Bluetooth: Mesh: Use mesh settings API only if setting... s are enabled Don't call bt_mesh_settings_store_pending if CONFIG_BT_SETTINGS is not enabled. Signed-off-by: Pavel Vasilyev (cherry picked from commit 4d2b3ee7b562638bf8725d1f47100f6f0da5c307) --- subsys/bluetooth/mesh/cdb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/cdb.c b/subsys/bluetooth/mesh/cdb.c index ddde3d9f483..6159667597f 100644 --- a/subsys/bluetooth/mesh/cdb.c +++ b/subsys/bluetooth/mesh/cdb.c @@ -728,9 +728,8 @@ void bt_mesh_cdb_clear(void) if (IS_ENABLED(CONFIG_BT_SETTINGS)) { update_cdb_net_settings(); + bt_mesh_settings_store_pending(); } - - bt_mesh_settings_store_pending(); } void bt_mesh_cdb_iv_update(uint32_t iv_index, bool iv_update) From 0179c5349b12704b973bbd6e830ac349dda70fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 18 Aug 2022 18:59:45 +0200 Subject: [PATCH 114/501] [nrf fromtree] drivers: pinctrl_nrf: Fix nrf_pin_configure() implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit fd0767557439d04c4a220a9857e901d8d71498db. The above commit was supposed to introduce overriding of the S0S1 drive setting with S0D1 for TWI/TWIM peripherals, but since it did not properly update the `nrf_pin_configure()` function (the `drive` parameter was only added in the function signature, but then it was not used...), the drive setting was in fact not overridden. This commit corrects this embarrassing oversight. Signed-off-by: Andrzej Głąbek (cherry picked from commit 7b8a7f423dc838d874d2489f3c3f88280df83ba4) --- drivers/pinctrl/pinctrl_nrf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 924dc2517f3..f172c344004 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -95,8 +95,8 @@ __unused static void nrf_pin_configure(pinctrl_soc_pin_t pin, input = NRF_GPIO_PIN_INPUT_DISCONNECT; } - nrf_gpio_cfg(NRF_GET_PIN(pin), dir, input, NRF_GET_PULL(pin), - NRF_GET_DRIVE(pin), NRF_GPIO_PIN_NOSENSE); + nrf_gpio_cfg(NRF_GET_PIN(pin), dir, input, NRF_GET_PULL(pin), drive, + NRF_GPIO_PIN_NOSENSE); } int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, From 2d65862410e7e4ff966865df14b006589e61f669 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 11 Aug 2022 14:36:29 +0200 Subject: [PATCH 115/501] [nrf fromtree] Bluetooth: Audio: Fix unicast_client avail ctx dir check The unicast_client_pacs_avail_ctx_notify_cb had a direction check that was a leftover copy from the location notification. However the context notification is always for both sink and source, and thus does not need any direction checks (in fact the dir variable was unused). Signed-off-by: Emil Gydesen (cherry picked from commit 3c9414c179f4dcf8500d2c86f1ce6d6a7681afce) --- subsys/bluetooth/audio/unicast_client.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/subsys/bluetooth/audio/unicast_client.c b/subsys/bluetooth/audio/unicast_client.c index f3edef798e5..4b9421399b3 100644 --- a/subsys/bluetooth/audio/unicast_client.c +++ b/subsys/bluetooth/audio/unicast_client.c @@ -1963,7 +1963,6 @@ static uint8_t unicast_client_pacs_avail_ctx_notify_cb(struct bt_conn *conn, { struct bt_pacs_context context; struct net_buf_simple buf; - enum bt_audio_dir dir; BT_DBG("conn %p len %u", conn, length); @@ -1986,16 +1985,6 @@ static uint8_t unicast_client_pacs_avail_ctx_notify_cb(struct bt_conn *conn, return BT_GATT_ITER_STOP; } - if (PART_OF_ARRAY(snk_loc_subscribe, params)) { - dir = BT_AUDIO_DIR_SINK; - } else if (PART_OF_ARRAY(src_loc_subscribe, params)) { - dir = BT_AUDIO_DIR_SOURCE; - } else { - BT_ERR("Invalid notification"); - - return BT_GATT_ITER_CONTINUE; - } - net_buf_simple_init_with_data(&buf, (void *)data, length); context.snk = net_buf_simple_pull_le16(&buf); context.src = net_buf_simple_pull_le16(&buf); From 24647b6a622f412768825dd8a0a977b301b14692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Storr=C3=B8?= Date: Wed, 17 Aug 2022 14:44:48 +0200 Subject: [PATCH 116/501] [nrf fromtree] Bluetooth: Mesh: Health_cli: Fix async cmd rsp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swaps response scheme for Fault_get & Fault_clear command so that it aligns with description of the documentation. Signed-off-by: Anders Storrø Signed-off-by: Alperen Sener (cherry picked from commit 0023f04e361fd4df3066e534a6307b5c7c3ae56e) --- subsys/bluetooth/mesh/health_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/health_cli.c b/subsys/bluetooth/mesh/health_cli.c index 9a060b21ce7..9fdb6ae63f4 100644 --- a/subsys/bluetooth/mesh/health_cli.c +++ b/subsys/bluetooth/mesh/health_cli.c @@ -487,7 +487,7 @@ int bt_mesh_health_cli_fault_clear(struct bt_mesh_health_cli *cli, struct bt_mes net_buf_simple_add_le16(&msg, cid); return model_ackd_send(cli->model, ctx, &msg, - (!test_id && (!faults || !fault_count)) ? &cli->ack_ctx : NULL, + (!test_id && (!faults || !fault_count)) ? NULL : &cli->ack_ctx, OP_HEALTH_FAULT_STATUS, ¶m); } @@ -518,7 +518,7 @@ int bt_mesh_health_cli_fault_get(struct bt_mesh_health_cli *cli, struct bt_mesh_ net_buf_simple_add_le16(&msg, cid); return model_ackd_send(cli->model, ctx, &msg, - (!test_id && (!faults || !fault_count)) ? &cli->ack_ctx : NULL, + (!test_id && (!faults || !fault_count)) ? NULL : &cli->ack_ctx, OP_HEALTH_FAULT_STATUS, ¶m); } From 2825f7ccf0bfe883243f880a3634a7b6255860b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Storr=C3=B8?= Date: Mon, 22 Aug 2022 16:56:28 +0200 Subject: [PATCH 117/501] [nrf fromtree] Bluetooth: Mesh: Health_cli: Fix fault test rsp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swaps response scheme for Fault_test command so that it aligns with description of the documentation. Signed-off-by: Anders Storrø Signed-off-by: Alperen Sener (cherry picked from commit 624271bddd622a4a0990d60b081da1e137950061) --- subsys/bluetooth/mesh/health_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/health_cli.c b/subsys/bluetooth/mesh/health_cli.c index 9fdb6ae63f4..a463546b004 100644 --- a/subsys/bluetooth/mesh/health_cli.c +++ b/subsys/bluetooth/mesh/health_cli.c @@ -455,7 +455,7 @@ int bt_mesh_health_cli_fault_test(struct bt_mesh_health_cli *cli, struct bt_mesh net_buf_simple_add_le16(&msg, cid); return model_ackd_send(cli->model, ctx, &msg, - (!faults || !fault_count) ? &cli->ack_ctx : NULL, + (!faults || !fault_count) ? NULL : &cli->ack_ctx, OP_HEALTH_FAULT_STATUS, ¶m); } From 3fc60fc18cf3074c9b66840b5aa2e742536a93b9 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 9 Mar 2022 10:43:34 +0100 Subject: [PATCH 118/501] [nrf fromtree] modules: tfm: Exclude non-secure TF-M application from build Exclude the non-secure TF-M application from being built by TF-M. This also stops the building of the tfm_ns_api library that we were linking against. This library is defined by the tf-m regression tests. Add the installed interface source files exported by the TF-M build system compile them in the zephyr build system. Signed-off-by: Joakim Andersson (cherry picked from commit d3b6b3c8c01a9feb97de957e4ca41084f22a652c) --- modules/trusted-firmware-m/CMakeLists.txt | 75 +++++++++++++++++-- modules/trusted-firmware-m/Kconfig.tfm | 34 ++++++++- samples/tfm_integration/tfm_psa_test/prj.conf | 1 + .../tfm_regression_test/prj.conf | 2 + west.yml | 2 +- 5 files changed, 102 insertions(+), 12 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 44f02673f2a..36e36c9f841 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -49,6 +49,11 @@ if (CONFIG_BUILD_WITH_TFM) else() list(APPEND TFM_CMAKE_ARGS -DBL2=FALSE) endif() + if (CONFIG_TFM_BUILD_NS) + list(APPEND TFM_CMAKE_ARGS -DNS=TRUE) + else() + list(APPEND TFM_CMAKE_ARGS -DNS=FALSE) + endif() if (CONFIG_TFM_ISOLATION_LEVEL) list(APPEND TFM_CMAKE_ARGS -DTFM_ISOLATION_LEVEL=${CONFIG_TFM_ISOLATION_LEVEL}) endif() @@ -148,8 +153,9 @@ if (CONFIG_BUILD_WITH_TFM) set(VENEERS_FILE ${TFM_BINARY_DIR}/secure_fw/s_veneers.o) set(TFM_API_NS_PATH ${TFM_BINARY_DIR}/tf-m-tests/app/libtfm_api_ns.a) - set(TFM_GENERATED_INCLUDES ${TFM_BINARY_DIR}/generated/interface/include) set(PLATFORM_NS_FILE ${TFM_BINARY_DIR}/platform/libplatform_ns.a) + set(TFM_GENERATED_INCLUDES ${TFM_BINARY_DIR}/generated/interface/include) + set(TFM_INTERFACE_SOURCE_DIR ${TFM_BINARY_DIR}/install/interface/src) if (TFM_PSA_TEST_SUITE) set(PSA_TEST_VAL_FILE ${TFM_BINARY_DIR}/tf-m-tests/app/psa_api_tests/val/val_nspe.a) @@ -195,6 +201,25 @@ if (CONFIG_BUILD_WITH_TFM) ${TFM_S_SIGNED_BIN_FILE} ${TFM_NS_SIGNED_BIN_FILE} ${TFM_S_NS_SIGNED_BIN_FILE} + + ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_ipc_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_ipc_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_ipc_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_ipc_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_ipc_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_ipc_api.c + + ${TFM_INTERFACE_SOURCE_DIR}/tfm_psa_ns_api.c + + ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_func_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_func_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_func_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_func_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_func_api.c + ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_func_api.c + + # Specific to nordic_nrf platform + ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c ) # Get the toolchain variant @@ -331,12 +356,51 @@ if (CONFIG_BUILD_WITH_TFM) src/zephyr_tfm_log.c interface/interface.c ) + # Non-Secure interface to request system reboot if (CONFIG_TFM_PARTITION_PLATFORM AND NOT CONFIG_TFM_PARTITION_PLATFORM_CUSTOM_REBOOT) zephyr_library_sources(src/reboot.c) endif() zephyr_library_sources_ifndef(CONFIG_TFM_PSA_TEST_NONE src/zephyr_tfm_psa_test.c) + if (TFM_PSA_TEST_SUITE) + zephyr_library_link_libraries( + ${PSA_TEST_VAL_FILE} + ${PSA_TEST_PAL_FILE} + ${PSA_TEST_COMBINE_FILE} + ) + endif() + + if(NOT CONFIG_TFM_BUILD_NS) + if(CONFIG_TFM_IPC) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_ipc_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_ipc_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_ipc_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_ipc_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_ipc_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_ipc_api.c) + + zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_psa_ns_api.c) + else() + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_func_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_func_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_func_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_func_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_func_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_func_api.c) + endif() + + if(CONFIG_SOC_FAMILY_NRF) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c) + endif() + + else() + zephyr_library_link_libraries( + ${TFM_API_NS_PATH} + ${PLATFORM_NS_FILE} + ) + endif() + zephyr_include_directories( ${TFM_GENERATED_INCLUDES} ) @@ -346,11 +410,6 @@ if (CONFIG_BUILD_WITH_TFM) ) zephyr_library_link_libraries( - ${PSA_TEST_VAL_FILE} - ${PSA_TEST_PAL_FILE} - ${PSA_TEST_COMBINE_FILE} - ${PLATFORM_NS_FILE} - ${TFM_API_NS_PATH} ${VENEERS_FILE} ) @@ -408,7 +467,7 @@ if (CONFIG_BUILD_WITH_TFM) set(NS_SIGNED_FILE ${CMAKE_BINARY_DIR}/zephyr_ns_signed.hex) set(S_SIGNED_FILE ${CMAKE_BINARY_DIR}/tfm_s_signed.hex) - if (CONFIG_TFM_REGRESSION_NS) + if (CONFIG_TFM_USE_NS_APP) # Use the TF-M NS binary as the Non-Secure application firmware image set(NS_APP_FILE $) else() @@ -453,7 +512,7 @@ if (CONFIG_BUILD_WITH_TFM) ) else() - if (CONFIG_TFM_REGRESSION_NS) + if (CONFIG_TFM_USE_NS_APP) tfm_sign(sign_cmd_ns NS TRUE ${NS_APP_FILE} ${NS_SIGNED_FILE}) else() tfm_sign(sign_cmd_ns NS FALSE ${NS_APP_FILE} ${NS_SIGNED_FILE}) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index cb7373b9cbe..eeb5cdef00f 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -206,6 +206,31 @@ config TFM_BL2 TFM is designed to run with MCUboot in a certain configuration. This config adds MCUboot to the build - built via TFM's build system. +config TFM_BUILD_NS + bool "Build the TF-M Non-Secure application and libraries" + help + Instruct the TF-M build system to build the TF-M Non-Secure + application and libraries. + + This option is intended for testing purposes only, since this is the + easiest way to build the TF-M regression tests application and test + support libraries in the zephyr build system. + +config TFM_USE_NS_APP + bool "Use the TF-M Non-Secure application" + depends on TFM_BUILD_NS + help + The TF-M build system can produce multiple executable files. + The main one is the TF-M secure firmware. Optionally the TF-M + non-secure application can be built. + Usually the TF-M non-secure application is not used since the + zephyr application is the non-secure application. + With this option enabled this is reversed and the TF-M non-secure + application is used instead of the Zephyr non-secure application. + + This option is intended for testing purposes only, since this is the + easiest way to integrate and run the TF-M regression tests in the + zephyr build system. if TFM_BL2 config TFM_MCUBOOT_IMAGE_NUMBER @@ -265,12 +290,15 @@ config TFM_REGRESSION_S help When enabled, this option signifies that the TF-M build includes the Secure domain regression tests. + The regression tests will be included in the TF-M secure firmware. config TFM_REGRESSION_NS - bool "Use the TF-M Non-Secure Regression test application" + bool "TF-M Non-Secure Regression tests" help - When this is enabled, the Zephyr application as a whole will be - replaced with the TF-M Non-Secure Regression test application. + When enabled, this option signifies that the TF-M build includes + the Non-Secure domain regression tests. + The regression tests will be included in the TF-M non-secure + application. choice TFM_PSA_TEST prompt "Enable a PSA test suite" diff --git a/samples/tfm_integration/tfm_psa_test/prj.conf b/samples/tfm_integration/tfm_psa_test/prj.conf index aa35a6c27db..3ceca574528 100644 --- a/samples/tfm_integration/tfm_psa_test/prj.conf +++ b/samples/tfm_integration/tfm_psa_test/prj.conf @@ -5,6 +5,7 @@ # CONFIG_BUILD_WITH_TFM=y +CONFIG_TFM_BUILD_NS=y CONFIG_TFM_PROFILE_TYPE_NOT_SET=y CONFIG_QEMU_ICOUNT_SHIFT=1 diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index a9200fa5c9e..d6e0b380013 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -6,6 +6,8 @@ CONFIG_BUILD_WITH_TFM=y CONFIG_TFM_PROFILE_TYPE_NOT_SET=y +CONFIG_TFM_BUILD_NS=y +CONFIG_TFM_USE_NS_APP=y CONFIG_TFM_REGRESSION_S=y CONFIG_TFM_REGRESSION_NS=y diff --git a/west.yml b/west.yml index 9cacd48aa11..7414a027e7e 100644 --- a/west.yml +++ b/west.yml @@ -225,7 +225,7 @@ manifest: groups: - debug - name: trusted-firmware-m - revision: 7c53a6e76130a85303f83b15d868a92fdcd5f5be + revision: f13209f1883232cbcb9f0c31fb4c63e7c242df0d path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 64b4dbd63d8364f7f427eacdeb1a8840c337ac95 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Mon, 18 Jul 2022 13:30:42 +0200 Subject: [PATCH 119/501] [nrf fromtree] arch: arm: Allow enabling FPU hard ABI with TF-M Allow enabling FPU with TF-M with the following limitations: - Only IPC mode is supported by TF-M. - Disallow FPU hard ABI when building the NS application, the TF-M build system does not pass the flags correctly to all dependencies. Signed-off-by: Joakim Andersson (cherry picked from commit b341c1ffbee9e1694f07a62f55b76b3f4947f603) --- arch/arm/core/aarch32/Kconfig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/core/aarch32/Kconfig b/arch/arm/core/aarch32/Kconfig index bdf9d0a41d8..436b47b77e4 100644 --- a/arch/arm/core/aarch32/Kconfig +++ b/arch/arm/core/aarch32/Kconfig @@ -255,14 +255,16 @@ choice config FP_HARDABI bool "Floating point Hard ABI" - depends on !BUILD_WITH_TFM + # TF-M build system does not build the NS app and libraries correctly with Hard ABI. + # This limitation should be removed in the next TF-M synchronization. + depends on !TFM_BUILD_NS + depends on !(BUILD_WITH_TFM && !TFM_IPC) help This option selects the Floating point ABI in which hardware floating point instructions are generated and uses FPU-specific calling conventions. - Note: the option is disabled for Zephyr builds with TF-M, as TF-M - does not currently support building with Hard ABI, hence linking - Zephyr with TF-M libraries would not be possible. + + Note: When building with TF-M enabled only the IPC mode is supported. config FP_SOFTABI bool "Floating point Soft ABI" From 1ead7ab0b243f43d03e280d81249dd9947400631 Mon Sep 17 00:00:00 2001 From: Veijo Pesonen Date: Wed, 24 Aug 2022 12:19:18 +0300 Subject: [PATCH 120/501] [nrf fromlist] net: lwm2m: Fixes FOTA update result code The update result is supposed to indicate success only after a firmware update has been applied. The bug here was that the success was reported already when the update image download was done. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/49460 Signed-off-by: Veijo Pesonen (cherry picked from commit a51b7f63b56289361cd8c2d319934e6f1326decc) --- subsys/net/lib/lwm2m/lwm2m_obj_firmware.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c b/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c index c782b0cbc18..fa4c6614cf7 100644 --- a/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c +++ b/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c @@ -99,16 +99,24 @@ void lwm2m_firmware_set_update_state_inst(uint16_t obj_inst_id, uint8_t state) bool error = false; char path[LWM2M_MAX_PATH_STR_LEN]; + snprintk(path, sizeof(path), "%" PRIu16 "/%" PRIu16 "/%" PRIu16, + LWM2M_OBJECT_FIRMWARE_ID, obj_inst_id, FIRMWARE_UPDATE_RESULT_ID); + /* Check LWM2M SPEC appendix E.6.1 */ switch (state) { case STATE_DOWNLOADING: - if (update_state[obj_inst_id] != STATE_IDLE) { + if (update_state[obj_inst_id] == STATE_IDLE) { + lwm2m_engine_set_u8(path, RESULT_DEFAULT); + } else { error = true; } break; case STATE_DOWNLOADED: - if (update_state[obj_inst_id] != STATE_DOWNLOADING && - update_state[obj_inst_id] != STATE_UPDATING) { + if (update_state[obj_inst_id] == STATE_DOWNLOADING) { + lwm2m_engine_set_u8(path, RESULT_DEFAULT); + } else if (update_state[obj_inst_id] == STATE_UPDATING) { + lwm2m_engine_set_u8(path, RESULT_UPDATE_FAILED); + } else { error = true; } break; From 1996edaf288c12aa9ec4ea9c9b2e4dd432dac2ac Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Wed, 24 Aug 2022 10:45:12 +0200 Subject: [PATCH 121/501] [nrf fromlist] shell: Fix dependency to log_output When shell was used as a log backend it did not enabled log_output module used for string formatting. Adding missing dependency. Signed-off-by: Krzysztof Chruscinski (cherry picked from commit 1837fc11d97745b2b29aadadf85318783acde49b) --- subsys/shell/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/shell/Kconfig b/subsys/shell/Kconfig index 5334cf1e0c3..f59106b9b46 100644 --- a/subsys/shell/Kconfig +++ b/subsys/shell/Kconfig @@ -228,6 +228,7 @@ config SHELL_LOG_BACKEND bool "Shell log backend" depends on LOG && !LOG_MODE_MINIMAL select MPSC_PBUF + select LOG_OUTPUT default y if LOG help When enabled, backend will use the shell for logging. From 79a27400e324d880ab6f709f684e599180bba753 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Wed, 24 Aug 2022 10:46:39 +0200 Subject: [PATCH 122/501] [nrf fromlist] logging: cleanup in CMakeLists.txt log_output.c was added in two places: unconditionally when logging is enabled and when CONFIG_LOG_OUTPUT is set. Cleaning up to add source file only when module is enabled. Signed-off-by: Krzysztof Chruscinski (cherry picked from commit d22ed58309b0ef5b415ff75a1cc12ea826a42e97) --- subsys/logging/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/logging/CMakeLists.txt b/subsys/logging/CMakeLists.txt index 786be31c2f1..9dec1c98faa 100644 --- a/subsys/logging/CMakeLists.txt +++ b/subsys/logging/CMakeLists.txt @@ -6,7 +6,6 @@ if(NOT CONFIG_LOG_MODE_MINIMAL) log_core.c log_mgmt.c log_msg.c - log_output.c ) zephyr_sources_ifdef( From c8c986a25ed1f4a1bcab7f6e1e49b207b0c6c7ae Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Wed, 13 Jul 2022 09:42:11 +0200 Subject: [PATCH 123/501] [nrf fromtree] net: zperf: Extract zperf into library Make a library out of the zperf shell sample. This makes to enable the module in any application, not only the dedicated sample. Signed-off-by: Robert Lubos (cherry picked from commit f03286347a06b27291f39871d0f047d59b95f5b7) --- doc/connectivity/networking/api/index.rst | 1 + doc/connectivity/networking/api/zperf.rst | 103 ++++++++++++++++++ samples/net/zperf/CMakeLists.txt | 11 -- samples/net/zperf/README.rst | 80 +------------- samples/net/zperf/prj.conf | 1 + subsys/net/lib/CMakeLists.txt | 1 + subsys/net/lib/Kconfig | 2 + subsys/net/lib/zperf/CMakeLists.txt | 17 +++ subsys/net/lib/zperf/Kconfig | 19 ++++ .../net/lib/zperf}/shell_utils.c | 1 - .../net/lib/zperf}/shell_utils.h | 0 .../src => subsys/net/lib/zperf}/zperf.h | 0 .../net/lib/zperf}/zperf_internal.h | 0 .../net/lib/zperf}/zperf_session.c | 6 +- .../net/lib/zperf}/zperf_session.h | 0 .../net/lib/zperf}/zperf_shell.c | 3 +- .../net/lib/zperf}/zperf_tcp_receiver.c | 4 +- .../net/lib/zperf}/zperf_tcp_uploader.c | 3 +- .../net/lib/zperf}/zperf_udp_receiver.c | 3 +- .../net/lib/zperf}/zperf_udp_uploader.c | 4 +- 20 files changed, 156 insertions(+), 103 deletions(-) create mode 100644 doc/connectivity/networking/api/zperf.rst create mode 100644 subsys/net/lib/zperf/CMakeLists.txt create mode 100644 subsys/net/lib/zperf/Kconfig rename {samples/net/zperf/src => subsys/net/lib/zperf}/shell_utils.c (97%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/shell_utils.h (100%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/zperf.h (100%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/zperf_internal.h (100%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/zperf_session.c (95%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/zperf_session.h (100%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/zperf_shell.c (99%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/zperf_tcp_receiver.c (99%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/zperf_tcp_uploader.c (96%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/zperf_udp_receiver.c (99%) rename {samples/net/zperf/src => subsys/net/lib/zperf}/zperf_udp_uploader.c (98%) diff --git a/doc/connectivity/networking/api/index.rst b/doc/connectivity/networking/api/index.rst index 59410af5ef1..2386a075460 100644 --- a/doc/connectivity/networking/api/index.rst +++ b/doc/connectivity/networking/api/index.rst @@ -13,3 +13,4 @@ Networking APIs system_mgmt.rst tsn.rst gsm_modem.rst + zperf.rst diff --git a/doc/connectivity/networking/api/zperf.rst b/doc/connectivity/networking/api/zperf.rst new file mode 100644 index 00000000000..4f6674679d2 --- /dev/null +++ b/doc/connectivity/networking/api/zperf.rst @@ -0,0 +1,103 @@ +.. _zperf: + +zperf: Network Traffic Generator +################################ + +.. contents:: + :local: + :depth: 2 + +Overview +******** + +zperf is a shell utility which allows to generate network traffic in Zephyr. The +tool may be used to evaluate network bandwidth. + +zperf is compatible with iPerf_2.0.5. Note that in newer iPerf versions, +an error message like this is printed and the server reported statistics +are missing. + +.. code-block:: console + + LAST PACKET NOT RECEIVED!!! + +zperf can be enabled in any application, a dedicated sample is also present +in Zephyr. See :ref:`zperf sample application ` for details. + +Sample Usage +************ + +If Zephyr acts as a client, iPerf must be executed in server mode. +For example, the following command line must be used for UDP testing: + +.. code-block:: console + + $ iperf -s -l 1K -u -V -B 2001:db8::2 + +For TCP testing, the command line would look like this: + +.. code-block:: console + + $ iperf -s -l 1K -V -B 2001:db8::2 + + +In the Zephyr console, zperf can be executed as follows: + +.. code-block:: console + + zperf udp upload 2001:db8::2 5001 10 1K 1M + + +For TCP the zperf command would look like this: + +.. code-block:: console + + zperf tcp upload 2001:db8::2 5001 10 1K 1M + + +If the IP addresses of Zephyr and the host machine are specified in the +config file, zperf can be started as follows: + +.. code-block:: console + + zperf udp upload2 v6 10 1K 1M + + +or like this if you want to test TCP: + +.. code-block:: console + + zperf tcp upload2 v6 10 1K 1M + + +If Zephyr is acting as a server, set the download mode as follows for UDP: + +.. code-block:: console + + zperf udp download 5001 + + +or like this for TCP: + +.. code-block:: console + + zperf tcp download 5001 + + +and in the host side, iPerf must be executed with the following +command line if you are testing UDP: + +.. code-block:: console + + $ iperf -l 1K -u -V -c 2001:db8::1 -p 5001 + + +and this if you are testing TCP: + +.. code-block:: console + + $ iperf -l 1K -V -c 2001:db8::1 -p 5001 + + +iPerf output can be limited by using the -b option if Zephyr is not +able to receive all the packets in orderly manner. diff --git a/samples/net/zperf/CMakeLists.txt b/samples/net/zperf/CMakeLists.txt index c9b12350383..ae9b46dadc0 100644 --- a/samples/net/zperf/CMakeLists.txt +++ b/samples/net/zperf/CMakeLists.txt @@ -7,15 +7,4 @@ project(zperf) target_sources(app PRIVATE src/main.c - src/shell_utils.c - src/zperf_session.c - src/zperf_shell.c - src/zperf_udp_receiver.c - src/zperf_udp_uploader.c - src/zperf_tcp_receiver.c - src/zperf_tcp_uploader.c - ) - -target_include_directories(app PRIVATE - ${ZEPHYR_BASE}/subsys/net/ip ) diff --git a/samples/net/zperf/README.rst b/samples/net/zperf/README.rst index d98bd66f042..dd968b3423b 100644 --- a/samples/net/zperf/README.rst +++ b/samples/net/zperf/README.rst @@ -6,8 +6,8 @@ zperf: Network Traffic Generator Description *********** -zperf is a network traffic generator for Zephyr that may be used to -evaluate network bandwidth. +The zperf sample demonstrates the :ref:`zperf shell utility `, which +allows to evaluate network bandwidth. Features ********* @@ -46,77 +46,5 @@ to setup the network environment. Usage ***** -If Zephyr acts as a client, iPerf must be executed in server mode. -For example, the following command line must be used for UDP testing: - -.. code-block:: console - - $ iperf -s -l 1K -u -V -B 2001:db8::2 - -For TCP testing, the command line would look like this: - -.. code-block:: console - - $ iperf -s -l 1K -V -B 2001:db8::2 - - -In the Zephyr console, zperf can be executed as follows: - -.. code-block:: console - - zperf udp upload 2001:db8::2 5001 10 1K 1M - - -For TCP the zperf command would look like this: - -.. code-block:: console - - zperf tcp upload 2001:db8::2 5001 10 1K 1M - - -If the IP addresses of Zephyr and the host machine are specified in the -config file, zperf can be started as follows: - -.. code-block:: console - - zperf udp upload2 v6 10 1K 1M - - -or like this if you want to test TCP: - -.. code-block:: console - - zperf tcp upload2 v6 10 1K 1M - - -If Zephyr is acting as a server, set the download mode as follows for UDP: - -.. code-block:: console - - zperf udp download 5001 - - -or like this for TCP: - -.. code-block:: console - - zperf tcp download 5001 - - -and in the host side, iPerf must be executed with the following -command line if you are testing UDP: - -.. code-block:: console - - $ iperf -l 1K -u -V -c 2001:db8::1 -p 5001 - - -and this if you are testing TCP: - -.. code-block:: console - - $ iperf -l 1K -V -c 2001:db8::1 -p 5001 - - -iPerf output can be limited by using the -b option if Zephyr is not -able to receive all the packets in orderly manner. +See :ref:`zperf library documentation ` for more information about +the library usage. diff --git a/samples/net/zperf/prj.conf b/samples/net/zperf/prj.conf index a2cd41ad847..f5149803b6f 100644 --- a/samples/net/zperf/prj.conf +++ b/samples/net/zperf/prj.conf @@ -1,4 +1,5 @@ CONFIG_NETWORKING=y +CONFIG_NET_ZPERF=y CONFIG_NET_LOG=y CONFIG_NET_IPV6=y CONFIG_NET_IPV4=y diff --git a/subsys/net/lib/CMakeLists.txt b/subsys/net/lib/CMakeLists.txt index 189c918e170..ca787566c25 100644 --- a/subsys/net/lib/CMakeLists.txt +++ b/subsys/net/lib/CMakeLists.txt @@ -12,6 +12,7 @@ add_subdirectory_ifdef(CONFIG_NET_SOCKETS sockets) add_subdirectory_ifdef(CONFIG_TLS_CREDENTIALS tls_credentials) add_subdirectory_ifdef(CONFIG_NET_CONNECTION_MANAGER conn_mgr) add_subdirectory_ifdef(CONFIG_NET_CAPTURE capture) +add_subdirectory_ifdef(CONFIG_NET_ZPERF zperf) if (CONFIG_DNS_RESOLVER OR CONFIG_MDNS_RESPONDER diff --git a/subsys/net/lib/Kconfig b/subsys/net/lib/Kconfig index 1e8e95fb057..3cdf56f6c7e 100644 --- a/subsys/net/lib/Kconfig +++ b/subsys/net/lib/Kconfig @@ -39,4 +39,6 @@ source "subsys/net/lib/conn_mgr/Kconfig" source "subsys/net/lib/capture/Kconfig" +source "subsys/net/lib/zperf/Kconfig" + endmenu diff --git a/subsys/net/lib/zperf/CMakeLists.txt b/subsys/net/lib/zperf/CMakeLists.txt new file mode 100644 index 00000000000..9994c617b2f --- /dev/null +++ b/subsys/net/lib/zperf/CMakeLists.txt @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_library_named(zperf) + +zephyr_library_sources( + shell_utils.c + zperf_session.c + zperf_shell.c + zperf_udp_receiver.c + zperf_udp_uploader.c + zperf_tcp_receiver.c + zperf_tcp_uploader.c +) + +zephyr_library_include_directories( + ${ZEPHYR_BASE}/subsys/net/ip +) diff --git a/subsys/net/lib/zperf/Kconfig b/subsys/net/lib/zperf/Kconfig new file mode 100644 index 00000000000..5ac5c5c6f5c --- /dev/null +++ b/subsys/net/lib/zperf/Kconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +menuconfig NET_ZPERF + bool "zperf shell utility" + depends on SHELL + help + This option enables zperf shell utility, which allows to generate + network traffic and evaluate network bandwidth. + +if NET_ZPERF + +module = NET_ZPERF +module-dep = NET_LOG +module-str = Log level for zperf +module-help = Enable debug message of zperf libray. +source "subsys/net/Kconfig.template.log_config.net" + +endif diff --git a/samples/net/zperf/src/shell_utils.c b/subsys/net/lib/zperf/shell_utils.c similarity index 97% rename from samples/net/zperf/src/shell_utils.c rename to subsys/net/lib/zperf/shell_utils.c index a9d11c2299d..988bd5dc443 100644 --- a/samples/net/zperf/src/shell_utils.c +++ b/subsys/net/lib/zperf/shell_utils.c @@ -5,7 +5,6 @@ */ #include -#include #include #include #include diff --git a/samples/net/zperf/src/shell_utils.h b/subsys/net/lib/zperf/shell_utils.h similarity index 100% rename from samples/net/zperf/src/shell_utils.h rename to subsys/net/lib/zperf/shell_utils.h diff --git a/samples/net/zperf/src/zperf.h b/subsys/net/lib/zperf/zperf.h similarity index 100% rename from samples/net/zperf/src/zperf.h rename to subsys/net/lib/zperf/zperf.h diff --git a/samples/net/zperf/src/zperf_internal.h b/subsys/net/lib/zperf/zperf_internal.h similarity index 100% rename from samples/net/zperf/src/zperf_internal.h rename to subsys/net/lib/zperf/zperf_internal.h diff --git a/samples/net/zperf/src/zperf_session.c b/subsys/net/lib/zperf/zperf_session.c similarity index 95% rename from samples/net/zperf/src/zperf_session.c rename to subsys/net/lib/zperf/zperf_session.c index bc643ec3c92..68e2a66bafd 100644 --- a/samples/net/zperf/src/zperf_session.c +++ b/subsys/net/lib/zperf/zperf_session.c @@ -5,7 +5,7 @@ */ #include -LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); +LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); #include @@ -29,7 +29,7 @@ struct session *get_session(const struct sockaddr *addr, const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr; if (proto != SESSION_TCP && proto != SESSION_UDP) { - printk("Error! unsupported proto.\n"); + NET_ERR("Error! unsupported proto.\n"); return NULL; } @@ -92,7 +92,7 @@ struct session *get_tcp_session(int sock) int i = 0; if (sock < 0) { - printk("Error! Invalid socket.\n"); + NET_ERR("Error! Invalid socket.\n"); return NULL; } diff --git a/samples/net/zperf/src/zperf_session.h b/subsys/net/lib/zperf/zperf_session.h similarity index 100% rename from samples/net/zperf/src/zperf_session.h rename to subsys/net/lib/zperf/zperf_session.h diff --git a/samples/net/zperf/src/zperf_shell.c b/subsys/net/lib/zperf/zperf_shell.c similarity index 99% rename from samples/net/zperf/src/zperf_shell.c rename to subsys/net/lib/zperf/zperf_shell.c index 9ce46c1cdd3..df79e956580 100644 --- a/samples/net/zperf/src/zperf_shell.c +++ b/subsys/net/lib/zperf/zperf_shell.c @@ -5,14 +5,13 @@ */ #include -LOG_MODULE_REGISTER(net_zperf_sample, LOG_LEVEL_DBG); +LOG_MODULE_REGISTER(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); #include #include #include #include -#include #include #include diff --git a/samples/net/zperf/src/zperf_tcp_receiver.c b/subsys/net/lib/zperf/zperf_tcp_receiver.c similarity index 99% rename from samples/net/zperf/src/zperf_tcp_receiver.c rename to subsys/net/lib/zperf/zperf_tcp_receiver.c index ad540a9a8f4..fea4f66a7cb 100644 --- a/samples/net/zperf/src/zperf_tcp_receiver.c +++ b/subsys/net/lib/zperf/zperf_tcp_receiver.c @@ -5,15 +5,13 @@ */ #include -LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); +LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); #include #include #include -#include - #include #include "zperf.h" diff --git a/samples/net/zperf/src/zperf_tcp_uploader.c b/subsys/net/lib/zperf/zperf_tcp_uploader.c similarity index 96% rename from samples/net/zperf/src/zperf_tcp_uploader.c rename to subsys/net/lib/zperf/zperf_tcp_uploader.c index 4b3c3a0ca8f..888b1ce06b3 100644 --- a/samples/net/zperf/src/zperf_tcp_uploader.c +++ b/subsys/net/lib/zperf/zperf_tcp_uploader.c @@ -5,12 +5,11 @@ */ #include -LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); +LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); #include #include -#include #include diff --git a/samples/net/zperf/src/zperf_udp_receiver.c b/subsys/net/lib/zperf/zperf_udp_receiver.c similarity index 99% rename from samples/net/zperf/src/zperf_udp_receiver.c rename to subsys/net/lib/zperf/zperf_udp_receiver.c index 4e05e31a139..623120e5de1 100644 --- a/samples/net/zperf/src/zperf_udp_receiver.c +++ b/subsys/net/lib/zperf/zperf_udp_receiver.c @@ -5,13 +5,12 @@ */ #include -LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); +LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); #include #include #include -#include #include diff --git a/samples/net/zperf/src/zperf_udp_uploader.c b/subsys/net/lib/zperf/zperf_udp_uploader.c similarity index 98% rename from samples/net/zperf/src/zperf_udp_uploader.c rename to subsys/net/lib/zperf/zperf_udp_uploader.c index d2f69438780..3abd22d8a22 100644 --- a/samples/net/zperf/src/zperf_udp_uploader.c +++ b/subsys/net/lib/zperf/zperf_udp_uploader.c @@ -5,12 +5,10 @@ */ #include -LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); +LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); #include -#include - #include #include "zperf.h" From 5d43da935652a10321d3e70b4b30ca588eff12f4 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 19 Jul 2022 16:46:48 +0200 Subject: [PATCH 124/501] [nrf fromtree] net: zperf: Use zsock_* API instead of POSIX socket API In order to make the zperf to work regardless of the POSIX configuration in the system, convert the socket API usage into Zephyr's native zsock_* API. Signed-off-by: Robert Lubos (cherry picked from commit 6fe8700083c2146148ee78a3bd58e6ab5226c6e5) --- subsys/net/lib/zperf/zperf_shell.c | 44 +++++++++---------- subsys/net/lib/zperf/zperf_tcp_receiver.c | 53 ++++++++++++----------- subsys/net/lib/zperf/zperf_tcp_uploader.c | 2 +- subsys/net/lib/zperf/zperf_udp_receiver.c | 46 ++++++++++---------- subsys/net/lib/zperf/zperf_udp_uploader.c | 12 ++--- 5 files changed, 80 insertions(+), 77 deletions(-) diff --git a/subsys/net/lib/zperf/zperf_shell.c b/subsys/net/lib/zperf/zperf_shell.c index df79e956580..4302469abf2 100644 --- a/subsys/net/lib/zperf/zperf_shell.c +++ b/subsys/net/lib/zperf/zperf_shell.c @@ -461,9 +461,9 @@ static int setup_upload_sockets(const struct shell *sh, char *argv0) { if (IS_ENABLED(CONFIG_NET_IPV6)) { - *sock6 = socket(AF_INET6, - is_udp ? SOCK_DGRAM : SOCK_STREAM, - is_udp ? IPPROTO_UDP : IPPROTO_TCP); + *sock6 = zsock_socket(AF_INET6, + is_udp ? SOCK_DGRAM : SOCK_STREAM, + is_udp ? IPPROTO_UDP : IPPROTO_TCP); if (*sock6 < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv6 network socket (%d)\n", @@ -476,9 +476,9 @@ static int setup_upload_sockets(const struct shell *sh, } if (IS_ENABLED(CONFIG_NET_IPV4)) { - *sock4 = socket(AF_INET, - is_udp ? SOCK_DGRAM : SOCK_STREAM, - is_udp ? IPPROTO_UDP : IPPROTO_TCP); + *sock4 = zsock_socket(AF_INET, + is_udp ? SOCK_DGRAM : SOCK_STREAM, + is_udp ? IPPROTO_UDP : IPPROTO_TCP); if (*sock4 < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv4 network socket (%d)\n", @@ -542,9 +542,9 @@ static int execute_upload(const struct shell *sh, shell_fprintf(sh, SHELL_NORMAL, "\n"); if (family == AF_INET6 && sock6 >= 0) { - ret = connect(sock6, - (struct sockaddr *)ipv6, - sizeof(*ipv6)); + ret = zsock_connect(sock6, + (struct sockaddr *)ipv6, + sizeof(*ipv6)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "IPv6 connect failed (%d)\n", @@ -558,9 +558,9 @@ static int execute_upload(const struct shell *sh, } if (family == AF_INET && sock4 >= 0) { - ret = connect(sock4, - (struct sockaddr *)ipv4, - sizeof(*ipv4)); + ret = zsock_connect(sock4, + (struct sockaddr *)ipv4, + sizeof(*ipv4)); if (ret < 0) { shell_fprintf(sh, SHELL_NORMAL, "IPv4 connect failed (%d)\n", @@ -581,9 +581,9 @@ static int execute_upload(const struct shell *sh, if (!is_udp && IS_ENABLED(CONFIG_NET_TCP)) { if (family == AF_INET6 && sock6 >= 0) { - ret = connect(sock6, - (struct sockaddr *)ipv6, - sizeof(*ipv6)); + ret = zsock_connect(sock6, + (struct sockaddr *)ipv6, + sizeof(*ipv6)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "IPv6 connect failed (%d)\n", @@ -595,7 +595,7 @@ static int execute_upload(const struct shell *sh, * the same time. */ if (IS_ENABLED(CONFIG_NET_IPV4) && sock4 >= 0) { - (void)close(sock4); + (void)zsock_close(sock4); sock4 = -1; } @@ -606,9 +606,9 @@ static int execute_upload(const struct shell *sh, } if (family == AF_INET && sock4 >= 0) { - ret = connect(sock4, - (struct sockaddr *)ipv4, - sizeof(*ipv4)); + ret = zsock_connect(sock4, + (struct sockaddr *)ipv4, + sizeof(*ipv4)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "IPv4 connect failed (%d)\n", @@ -617,7 +617,7 @@ static int execute_upload(const struct shell *sh, } if (IS_ENABLED(CONFIG_NET_IPV6) && sock6 >= 0) { - (void)close(sock6); + (void)zsock_close(sock6); sock6 = -1; } @@ -635,12 +635,12 @@ static int execute_upload(const struct shell *sh, out: if (IS_ENABLED(CONFIG_NET_IPV6) && sock6 >= 0) { - (void)close(sock6); + (void)zsock_close(sock6); sock6 = -1; } if (IS_ENABLED(CONFIG_NET_IPV4) && sock4 >= 0) { - (void)close(sock4); + (void)zsock_close(sock4); sock4 = -1; } diff --git a/subsys/net/lib/zperf/zperf_tcp_receiver.c b/subsys/net/lib/zperf/zperf_tcp_receiver.c index fea4f66a7cb..354c343daae 100644 --- a/subsys/net/lib/zperf/zperf_tcp_receiver.c +++ b/subsys/net/lib/zperf/zperf_tcp_receiver.c @@ -126,7 +126,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) static uint8_t buf[TCP_RECEIVER_BUF_SIZE]; const struct shell *sh = ptr1; int port = POINTER_TO_INT(ptr2); - struct pollfd fds[SOCK_ID_MAX] = { 0 }; + struct zsock_pollfd fds[SOCK_ID_MAX] = { 0 }; int ret; for (int i = 0; i < ARRAY_SIZE(fds); i++) { @@ -138,8 +138,8 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in4_addr_my = zperf_get_sin(); - fds[SOCK_ID_IPV4_LISTEN].fd = socket(AF_INET, SOCK_STREAM, - IPPROTO_TCP); + fds[SOCK_ID_IPV4_LISTEN].fd = zsock_socket(AF_INET, SOCK_STREAM, + IPPROTO_TCP); if (fds[SOCK_ID_IPV4_LISTEN].fd < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv4 network socket.\n"); @@ -173,9 +173,9 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) shell_fprintf(sh, SHELL_NORMAL, "Binding to %s\n", net_sprint_ipv4_addr(&in4_addr_my->sin_addr)); - ret = bind(fds[SOCK_ID_IPV4_LISTEN].fd, - (struct sockaddr *)in4_addr_my, - sizeof(struct sockaddr_in)); + ret = zsock_bind(fds[SOCK_ID_IPV4_LISTEN].fd, + (struct sockaddr *)in4_addr_my, + sizeof(struct sockaddr_in)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot bind IPv4 UDP port %d (%d)\n", @@ -184,14 +184,14 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - ret = listen(fds[SOCK_ID_IPV4_LISTEN].fd, 1); + ret = zsock_listen(fds[SOCK_ID_IPV4_LISTEN].fd, 1); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot listen IPv4 TCP (%d)", errno); goto cleanup; } - fds[SOCK_ID_IPV4_LISTEN].events = POLLIN; + fds[SOCK_ID_IPV4_LISTEN].events = ZSOCK_POLLIN; } if (IS_ENABLED(CONFIG_NET_IPV6)) { @@ -199,8 +199,8 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in6_addr_my = zperf_get_sin6(); - fds[SOCK_ID_IPV6_LISTEN].fd = socket(AF_INET6, SOCK_STREAM, - IPPROTO_TCP); + fds[SOCK_ID_IPV6_LISTEN].fd = zsock_socket(AF_INET6, SOCK_STREAM, + IPPROTO_TCP); if (fds[SOCK_ID_IPV6_LISTEN].fd < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv6 network socket.\n"); @@ -235,9 +235,9 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) shell_fprintf(sh, SHELL_NORMAL, "Binding to %s\n", net_sprint_ipv6_addr(&in6_addr_my->sin6_addr)); - ret = bind(fds[SOCK_ID_IPV6_LISTEN].fd, - (struct sockaddr *)in6_addr_my, - sizeof(struct sockaddr_in6)); + ret = zsock_bind(fds[SOCK_ID_IPV6_LISTEN].fd, + (struct sockaddr *)in6_addr_my, + sizeof(struct sockaddr_in6)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot bind IPv6 UDP port %d (%d)\n", @@ -246,14 +246,14 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - ret = listen(fds[SOCK_ID_IPV6_LISTEN].fd, 1); + ret = zsock_listen(fds[SOCK_ID_IPV6_LISTEN].fd, 1); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot listen IPv6 TCP (%d)", errno); goto cleanup; } - fds[SOCK_ID_IPV6_LISTEN].events = POLLIN; + fds[SOCK_ID_IPV6_LISTEN].events = ZSOCK_POLLIN; } shell_fprintf(sh, SHELL_NORMAL, @@ -264,7 +264,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) init_done = true; while (true) { - ret = poll(fds, ARRAY_SIZE(fds), -1); + ret = zsock_poll(fds, ARRAY_SIZE(fds), -1); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "TCP receiver poll error (%d)\n", @@ -276,8 +276,8 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) struct sockaddr addr; socklen_t addrlen = sizeof(addr); - if ((fds[i].revents & POLLERR) || - (fds[i].revents & POLLNVAL)) { + if ((fds[i].revents & ZSOCK_POLLERR) || + (fds[i].revents & ZSOCK_POLLNVAL)) { shell_fprintf( sh, SHELL_WARNING, "TCP receiver IPv%d socket error\n", @@ -285,14 +285,15 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - if (!(fds[i].revents & POLLIN)) { + if (!(fds[i].revents & ZSOCK_POLLIN)) { continue; } switch (i) { case SOCK_ID_IPV4_LISTEN: case SOCK_ID_IPV6_LISTEN:{ - int sock = accept(fds[i].fd, &addr, &addrlen); + int sock = zsock_accept(fds[i].fd, &addr, + &addrlen); if (sock < 0) { shell_fprintf( @@ -305,14 +306,14 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) if (i == SOCK_ID_IPV4_LISTEN && fds[SOCK_ID_IPV4_DATA].fd < 0) { fds[SOCK_ID_IPV4_DATA].fd = sock; - fds[SOCK_ID_IPV4_DATA].events = POLLIN; + fds[SOCK_ID_IPV4_DATA].events = ZSOCK_POLLIN; } else if (i == SOCK_ID_IPV6_LISTEN && fds[SOCK_ID_IPV6_DATA].fd < 0) { fds[SOCK_ID_IPV6_DATA].fd = sock; - fds[SOCK_ID_IPV6_DATA].events = POLLIN; + fds[SOCK_ID_IPV6_DATA].events = ZSOCK_POLLIN; } else { /* Too many connections. */ - close(sock); + zsock_close(sock); break; } @@ -321,7 +322,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) case SOCK_ID_IPV4_DATA: case SOCK_ID_IPV6_DATA: - ret = recv(fds[i].fd, buf, sizeof(buf), 0); + ret = zsock_recv(fds[i].fd, buf, sizeof(buf), 0); if (ret < 0) { shell_fprintf( sh, SHELL_WARNING, @@ -334,7 +335,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) tcp_received(sh, fds[i].fd, ret); if (ret == 0) { - close(fds[i].fd); + zsock_close(fds[i].fd); fds[i].fd = -1; } @@ -346,7 +347,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) cleanup: for (int i = 0; i < ARRAY_SIZE(fds); i++) { if (fds[i].fd >= 0) { - close(fds[i].fd); + zsock_close(fds[i].fd); } } } diff --git a/subsys/net/lib/zperf/zperf_tcp_uploader.c b/subsys/net/lib/zperf/zperf_tcp_uploader.c index 888b1ce06b3..82483e50739 100644 --- a/subsys/net/lib/zperf/zperf_tcp_uploader.c +++ b/subsys/net/lib/zperf/zperf_tcp_uploader.c @@ -55,7 +55,7 @@ void zperf_tcp_upload(const struct shell *sh, int ret = 0; /* Send the packet */ - ret = send(sock, sample_packet, packet_size, 0); + ret = zsock_send(sock, sample_packet, packet_size, 0); if (ret < 0) { if (nb_errors == 0 && ret != -ENOMEM) { shell_fprintf(sh, SHELL_WARNING, diff --git a/subsys/net/lib/zperf/zperf_udp_receiver.c b/subsys/net/lib/zperf/zperf_udp_receiver.c index 623120e5de1..a29c0c9d686 100644 --- a/subsys/net/lib/zperf/zperf_udp_receiver.c +++ b/subsys/net/lib/zperf/zperf_udp_receiver.c @@ -81,10 +81,10 @@ static int zperf_receiver_send_stat(const struct shell *sh, build_reply(hdr, stat, reply); - ret = sendto(sock, reply, sizeof(reply), 0, addr, - addr->sa_family == AF_INET6 ? - sizeof(struct sockaddr_in6) : - sizeof(struct sockaddr_in)); + ret = zsock_sendto(sock, reply, sizeof(reply), 0, addr, + addr->sa_family == AF_INET6 ? + sizeof(struct sockaddr_in6) : + sizeof(struct sockaddr_in)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, " Cannot send data to peer (%d)", errno); @@ -259,7 +259,7 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) static uint8_t buf[UDP_RECEIVER_BUF_SIZE]; const struct shell *sh = ptr1; int port = POINTER_TO_INT(ptr2); - struct pollfd fds[SOCK_ID_MAX] = { 0 }; + struct zsock_pollfd fds[SOCK_ID_MAX] = { 0 }; int ret; for (int i = 0; i < ARRAY_SIZE(fds); i++) { @@ -271,7 +271,8 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in4_addr_my = zperf_get_sin(); - fds[SOCK_ID_IPV4].fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + fds[SOCK_ID_IPV4].fd = zsock_socket(AF_INET, SOCK_DGRAM, + IPPROTO_UDP); if (fds[SOCK_ID_IPV4].fd < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv4 network socket.\n"); @@ -305,9 +306,9 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in4_addr_my->sin_port = htons(port); - ret = bind(fds[SOCK_ID_IPV4].fd, - (struct sockaddr *)in4_addr_my, - sizeof(struct sockaddr_in)); + ret = zsock_bind(fds[SOCK_ID_IPV4].fd, + (struct sockaddr *)in4_addr_my, + sizeof(struct sockaddr_in)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot bind IPv4 UDP port %d (%d)\n", @@ -316,7 +317,7 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - fds[SOCK_ID_IPV4].events = POLLIN; + fds[SOCK_ID_IPV4].events = ZSOCK_POLLIN; } if (IS_ENABLED(CONFIG_NET_IPV6)) { @@ -324,7 +325,8 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in6_addr_my = zperf_get_sin6(); - fds[SOCK_ID_IPV6].fd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + fds[SOCK_ID_IPV6].fd = zsock_socket(AF_INET6, SOCK_DGRAM, + IPPROTO_UDP); if (fds[SOCK_ID_IPV6].fd < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv4 network socket.\n"); @@ -359,9 +361,9 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in6_addr_my->sin6_port = htons(port); - ret = bind(fds[SOCK_ID_IPV6].fd, - (struct sockaddr *)in6_addr_my, - sizeof(struct sockaddr_in6)); + ret = zsock_bind(fds[SOCK_ID_IPV6].fd, + (struct sockaddr *)in6_addr_my, + sizeof(struct sockaddr_in6)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot bind IPv6 UDP port %d (%d)\n", @@ -370,14 +372,14 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - fds[SOCK_ID_IPV6].events = POLLIN; + fds[SOCK_ID_IPV6].events = ZSOCK_POLLIN; } shell_fprintf(sh, SHELL_NORMAL, "Listening on port %d\n", port); while (true) { - ret = poll(fds, ARRAY_SIZE(fds), -1); + ret = zsock_poll(fds, ARRAY_SIZE(fds), -1); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "UDP receiver poll error (%d)\n", @@ -389,8 +391,8 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) struct sockaddr addr; socklen_t addrlen = sizeof(addr); - if ((fds[i].revents & POLLERR) || - (fds[i].revents & POLLNVAL)) { + if ((fds[i].revents & ZSOCK_POLLERR) || + (fds[i].revents & ZSOCK_POLLNVAL)) { shell_fprintf( sh, SHELL_WARNING, "UDP receiver IPv%d socket error\n", @@ -398,12 +400,12 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - if (!(fds[i].revents & POLLIN)) { + if (!(fds[i].revents & ZSOCK_POLLIN)) { continue; } - ret = recvfrom(fds[i].fd, buf, sizeof(buf), 0, &addr, - &addrlen); + ret = zsock_recvfrom(fds[i].fd, buf, sizeof(buf), 0, + &addr, &addrlen); if (ret < 0) { shell_fprintf( sh, SHELL_WARNING, @@ -419,7 +421,7 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) cleanup: for (int i = 0; i < ARRAY_SIZE(fds); i++) { if (fds[i].fd >= 0) { - close(fds[i].fd); + zsock_close(fds[i].fd); } } } diff --git a/subsys/net/lib/zperf/zperf_udp_uploader.c b/subsys/net/lib/zperf/zperf_udp_uploader.c index 3abd22d8a22..7c75349806c 100644 --- a/subsys/net/lib/zperf/zperf_udp_uploader.c +++ b/subsys/net/lib/zperf/zperf_udp_uploader.c @@ -90,7 +90,7 @@ static inline void zperf_upload_fin(const struct shell *sh, hdr->num_of_bytes = htonl(packet_size); /* Send the packet */ - ret = send(sock, sample_packet, packet_size, 0); + ret = zsock_send(sock, sample_packet, packet_size, 0); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Failed to send the packet (%d)\n", @@ -99,8 +99,8 @@ static inline void zperf_upload_fin(const struct shell *sh, } /* Receive statistics */ - ret = setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &rcvtimeo, - sizeof(rcvtimeo)); + ret = zsock_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &rcvtimeo, + sizeof(rcvtimeo)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "setsockopt error (%d)\n", @@ -108,7 +108,7 @@ static inline void zperf_upload_fin(const struct shell *sh, continue; } - ret = recv(sock, stats, sizeof(stats), 0); + ret = zsock_recv(sock, stats, sizeof(stats), 0); if (ret == -EAGAIN) { shell_fprintf(sh, SHELL_WARNING, "Stats receive timeout\n"); @@ -126,7 +126,7 @@ static inline void zperf_upload_fin(const struct shell *sh, /* Drain RX */ while (true) { - ret = recv(sock, stats, sizeof(stats), MSG_DONTWAIT); + ret = zsock_recv(sock, stats, sizeof(stats), ZSOCK_MSG_DONTWAIT); if (ret < 0) { break; } @@ -236,7 +236,7 @@ void zperf_udp_upload(const struct shell *sh, hdr->num_of_bytes = htonl(packet_size); /* Send the packet */ - ret = send(sock, sample_packet, packet_size, 0); + ret = zsock_send(sock, sample_packet, packet_size, 0); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Failed to send the packet (%d)\n", From df734318174b829047eefac466c6247637c21ee7 Mon Sep 17 00:00:00 2001 From: Juha Heiskanen Date: Tue, 30 Aug 2022 12:42:35 +0300 Subject: [PATCH 125/501] [nrf fromlist] net: lwm2m: Fix LwM2M pause and resume Fixed unstable thread state read for detetect engine thread state. Fixed engine missing socket conrext add. lwm2m resume now do update also from network error state Signed-off-by: Juha Heiskanen (cherry picked from commit b7b20d0b4424bf8c6d58f5e54a7f012372bb2c26) --- subsys/net/lib/lwm2m/lwm2m_engine.c | 45 ++++++++++++-------------- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 4 +-- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index ab2b12d60f1..957e2207e70 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -82,6 +82,7 @@ static struct lwm2m_obj_path_list observe_paths[LWM2M_ENGINE_MAX_OBSERVER_PATH]; static k_tid_t engine_thread_id; static bool suspend_engine_thread; +static bool active_engine_thread; struct service_node { sys_snode_t node; @@ -112,7 +113,7 @@ int lwm2m_sock_nfds(void) { return sock_nfds; } struct lwm2m_block_context *lwm2m_block1_context(void) { return block1_contexts; } -static void lwm2m_socket_update(struct lwm2m_ctx *ctx); +static int lwm2m_socket_update(struct lwm2m_ctx *ctx); /* for debugging: to print IP addresses */ char *lwm2m_sprint_ip_addr(const struct sockaddr *addr) @@ -184,7 +185,9 @@ int lwm2m_open_socket(struct lwm2m_ctx *client_ctx) return -errno; } - lwm2m_socket_update(client_ctx); + if (lwm2m_socket_update(client_ctx)) { + return lwm2m_socket_add(client_ctx); + } } return 0; @@ -530,15 +533,16 @@ int lwm2m_socket_add(struct lwm2m_ctx *ctx) return 0; } -static void lwm2m_socket_update(struct lwm2m_ctx *ctx) +static int lwm2m_socket_update(struct lwm2m_ctx *ctx) { for (int i = 0; i < sock_nfds; i++) { if (sock_ctx[i] != ctx) { continue; } sock_fds[i].fd = ctx->sock_fd; - return; + return 0; } + return -1; } void lwm2m_socket_del(struct lwm2m_ctx *ctx) @@ -662,7 +666,9 @@ static void socket_loop(void) lwm2m_rd_client_pause(); #endif suspend_engine_thread = false; + active_engine_thread = false; k_thread_suspend(engine_thread_id); + active_engine_thread = true; #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT) lwm2m_rd_client_resume(); #endif @@ -776,7 +782,6 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) socklen_t addr_len; int flags; int ret; - bool allocate_socket = false; #if defined(CONFIG_LWM2M_DTLS_SUPPORT) uint8_t tmp; @@ -803,7 +808,6 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) #endif /* CONFIG_LWM2M_DTLS_SUPPORT */ if (client_ctx->sock_fd < 0) { - allocate_socket = true; ret = lwm2m_open_socket(client_ctx); if (ret) { return ret; @@ -886,9 +890,6 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) } LOG_INF("Connected, sock id %d", client_ctx->sock_fd); - if (allocate_socket) { - return lwm2m_socket_add(client_ctx); - } return 0; error: lwm2m_engine_stop(client_ctx); @@ -941,39 +942,32 @@ int lwm2m_engine_start(struct lwm2m_ctx *client_ctx) int lwm2m_engine_pause(void) { - char buffer[32]; - const char *str; - - str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); - if (suspend_engine_thread || !strcmp(str, "suspended")) { + if (suspend_engine_thread || !active_engine_thread) { LOG_WRN("Engine thread already suspended"); return 0; } suspend_engine_thread = true; - while (strcmp(str, "suspended")) { + while (active_engine_thread) { k_msleep(10); - str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); } - LOG_INF("LWM2M engine thread paused (%s) ", str); + LOG_INF("LWM2M engine thread paused"); return 0; } int lwm2m_engine_resume(void) { - char buffer[32]; - const char *str; - - str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); - if (strcmp(str, "suspended")) { - LOG_WRN("LWM2M engine thread state not ok for resume %s", str); + if (suspend_engine_thread || active_engine_thread) { + LOG_WRN("LWM2M engine thread state not ok for resume"); return -EPERM; } k_thread_resume(engine_thread_id); - str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); - LOG_INF("LWM2M engine thread resume (%s)", str); + while (!active_engine_thread) { + k_msleep(10); + } + LOG_INF("LWM2M engine thread resume"); return 0; } @@ -993,6 +987,7 @@ static int lwm2m_engine_init(const struct device *dev) NULL, NULL, NULL, THREAD_PRIORITY, 0, K_NO_WAIT); k_thread_name_set(&engine_thread_data, "lwm2m-sock-recv"); LOG_DBG("LWM2M engine socket receive thread started"); + active_engine_thread = true; return 0; } diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 0ba5429ae29..25fe374d920 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -1365,9 +1365,7 @@ int lwm2m_rd_client_resume(void) lwm2m_close_socket(client.ctx); client.engine_state = suspended_client_state; - if (!sm_is_registered() || - (sm_is_registered() && - (client.lifetime <= (k_uptime_get() - client.last_update) / 1000))) { + if ((client.lifetime <= (k_uptime_get() - client.last_update) / 1000)) { client.engine_state = ENGINE_DO_REGISTRATION; } else { lwm2m_rd_client_connection_resume(client.ctx); From 56ba9e17f89b490c394d6c550461a3186656c6c4 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Mon, 22 Aug 2022 21:45:08 -0500 Subject: [PATCH 126/501] [nrf fromtree] scripts/ci/check_compliance.py: Allow to run w/ZEPHYR_BASE Tweak check_compliance.py to allow user to run it w/o having ZEPHYR_BASE set. This is similar to what we do for twister. Signed-off-by: Kumar Gala (cherry picked from commit e97f6b97a2fe5bceb7ddf1b1ee93883e861f2cf3) --- scripts/ci/check_compliance.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 168fb193ab1..abd733a2553 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -27,6 +27,15 @@ # This ends up as None when we're not running in a Zephyr tree ZEPHYR_BASE = os.environ.get('ZEPHYR_BASE') +if not ZEPHYR_BASE: + # Let the user run this script as ./scripts/ci/check_compliance.py without + # making them set ZEPHYR_BASE. + ZEPHYR_BASE = str(Path(__file__).resolve().parents[2]) + + # Propagate this decision to child processes. + os.environ['ZEPHYR_BASE'] = ZEPHYR_BASE + + print(f'ZEPHYR_BASE unset, using "{ZEPHYR_BASE}"') def git(*args, cwd=None): From 0357614b6cbdbf35a864bb14107b1b32ae9ab78a Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 23 Aug 2022 14:40:42 +0200 Subject: [PATCH 127/501] [nrf fromtree] scripts: compliance: Remove unused variable EDIT_TIP has not been used for a while now, remove it. Signed-off-by: Carles Cufi (cherry picked from commit 84e137f6bfaf9b6e7c1113f327093855137725d6) --- scripts/ci/check_compliance.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index abd733a2553..240341ba315 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -18,11 +18,6 @@ import shlex from pathlib import Path -# '*' makes it italic -EDIT_TIP = "\n\n*Tip: The bot edits this comment instead of posting a new " \ - "one, so you can check the comment's history to see earlier " \ - "messages.*" - logger = None # This ends up as None when we're not running in a Zephyr tree From a4b4ccf32c9728c764828bf1c5c258b711c5fb90 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 23 Aug 2022 15:16:41 +0200 Subject: [PATCH 128/501] [nrf fromtree] scripts: compliance: Complete transition to junitparser v2 Follow-up to b187477fe764795e946418834a18905c8997c5fb. Signed-off-by: Carles Cufi (cherry picked from commit 36d71607aef9546ba066cf4aaa338a28e00d030b) --- scripts/ci/check_compliance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 240341ba315..1cf4d82b313 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -142,7 +142,7 @@ def skip(self, msg): if self.case.result: msg += "\n\nFailures before skip: " + self.case.result[0]._elem.text - self.case.result = Skipped(msg, "skipped") + self.case.result = [Skipped(msg, "skipped")] raise EndTest From 7e0e31f948387b85fd49f90c3d8fbab204c9d8f0 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 23 Aug 2022 15:27:08 +0200 Subject: [PATCH 129/501] [nrf fromtree] scripts: compliance: Clean up logging - Add a choice in the cmd-line param - Use the logger object everywhere - Remove stale todo Signed-off-by: Carles Cufi (cherry picked from commit 58e22444c6e7af187b54c335633188d766007b1a) --- scripts/ci/check_compliance.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 1cf4d82b313..5a2ca70ee2b 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -736,7 +736,7 @@ def run(self): # the entire tree. 2. run the former always. return - logging.info("If this takes too long then cleanup and try again") + logger.info("If this takes too long then cleanup and try again") patrn2files = self.ls_owned_files(codeowners) # The way git finds Renames and Copies is not "exact science", @@ -744,7 +744,7 @@ def run(self): # Addition instead. new_files = git("diff", "--name-only", "--diff-filter=ARC", COMMIT_RANGE).splitlines() - logging.debug("New files %s", new_files) + logger.debug("New files %s", new_files) # Convert to pathlib.Path string representation (e.g., # backslashes 'dir1\dir2\' on Windows) to be consistent @@ -756,10 +756,10 @@ def run(self): f_is_owned = False for git_pat, owned in patrn2files.items(): - logging.debug("Scanning %s for %s", git_pat, newf) + logger.debug("Scanning %s for %s", git_pat, newf) if newf in owned: - logging.info("%s matches new file %s", git_pat, newf) + logger.info("%s matches new file %s", git_pat, newf) f_is_owned = True # Unlike github, we don't care about finding any # more specific owner. @@ -1017,9 +1017,6 @@ def run(self): def init_logs(cli_arg): # Initializes logging - # TODO: there may be a shorter version thanks to: - # logging.basicConfig(...) - global logger level = os.environ.get('LOG_LEVEL', "WARN") @@ -1029,9 +1026,9 @@ def init_logs(cli_arg): logger = logging.getLogger('') logger.addHandler(console) - logger.setLevel(cli_arg if cli_arg else level) + logger.setLevel(cli_arg or level) - logging.info("Log init completed, level=%s", + logger.info("Log init completed, level=%s", logging.getLevelName(logger.getEffectiveLevel())) @@ -1054,7 +1051,9 @@ def parse_args(): parser.add_argument('-l', '--list', action="http://github.com/store_true", help="List all checks and exit") - parser.add_argument("-v", "--loglevel", help="python logging level") + parser.add_argument("-v", "--loglevel", choices=['DEBUG', 'INFO', 'WARNING', + 'ERROR', 'CRITICAL'], + help="python logging level") parser.add_argument('-m', '--module', action="http://github.com/append", default=[], help="Checks to run. All checks by default.") From d681f170b6d556dda3dc6b687891688dc3fd87d8 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 23 Aug 2022 15:35:20 +0200 Subject: [PATCH 130/501] [nrf fromtree] scripts: compliance: Tiny cleanup for -c Use a common source for default and doc. Signed-off-by: Carles Cufi (cherry picked from commit efb4ed7a9a27bf39dcabb0d6bee46506a88b847f) --- scripts/ci/check_compliance.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 5a2ca70ee2b..3d963e94b32 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1034,16 +1034,17 @@ def init_logs(cli_arg): def parse_args(): + + default_range = 'HEAD~1..HEAD' parser = argparse.ArgumentParser( description="Check for coding style and documentation warnings.") - parser.add_argument('-c', '--commits', default="HEAD~1..", - help='''Commit range in the form: a..[b], default is - HEAD~1..HEAD''') + parser.add_argument('-c', '--commits', default=default_range, + help=f'''Commit range in the form: a..[b], default is + {default_range}''') parser.add_argument('-r', '--repo', default=None, help="GitHub repository") parser.add_argument('-p', '--pull-request', default=0, type=int, help="Pull request number") - parser.add_argument('-S', '--sha', default=None, help="Commit SHA") parser.add_argument('-o', '--output', default="compliance.xml", help='''Name of outfile in JUnit format, default is ./compliance.xml''') From 1b9046e9c39676baa6592ac0bad9469583b56e13 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 23 Aug 2022 15:37:05 +0200 Subject: [PATCH 131/501] [nrf fromtree] scripts: compliance: Remove unused command-line args There were a bunch of old command-line arguments that haven't been used in a while, remove them. Signed-off-by: Carles Cufi (cherry picked from commit 9da8b1df206b5504585dedc325bcf211188f0566) --- scripts/ci/check_compliance.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 3d963e94b32..b84e2efccef 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1041,27 +1041,18 @@ def parse_args(): parser.add_argument('-c', '--commits', default=default_range, help=f'''Commit range in the form: a..[b], default is {default_range}''') - parser.add_argument('-r', '--repo', default=None, - help="GitHub repository") - parser.add_argument('-p', '--pull-request', default=0, type=int, - help="Pull request number") parser.add_argument('-o', '--output', default="compliance.xml", help='''Name of outfile in JUnit format, default is ./compliance.xml''') - parser.add_argument('-l', '--list', action="http://github.com/store_true", help="List all checks and exit") - parser.add_argument("-v", "--loglevel", choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help="python logging level") - parser.add_argument('-m', '--module', action="http://github.com/append", default=[], help="Checks to run. All checks by default.") - parser.add_argument('-e', '--exclude-module', action="http://github.com/append", default=[], help="Do not run the specified checks") - parser.add_argument('-j', '--previous-run', default=None, help='''Pre-load JUnit results in XML format from a previous run and combine with new results.''') From 67fde6e52a61455994c5d8c69c09a6f328541b92 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 23 Aug 2022 15:38:53 +0200 Subject: [PATCH 132/501] [nrf fromtree] scripts: compliance: Add commit range info output Log at the info level the commit range that the script is acting upon. Signed-off-by: Carles Cufi (cherry picked from commit af74fa5da141e8e385edaf4337572b2e14b8029e) --- scripts/ci/check_compliance.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index b84e2efccef..b871bf365f6 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1074,6 +1074,8 @@ def _main(args): init_logs(args.loglevel) + logger.info(f'Running tests on commit range {COMMIT_RANGE}') + if args.list: for testcase in ComplianceTest.__subclasses__(): print(testcase.name) From 7e4b34aa4b5a562e84cf9c944de62d6e4f02936b Mon Sep 17 00:00:00 2001 From: Sylvio Alves Date: Fri, 13 May 2022 08:18:42 -0300 Subject: [PATCH 133/501] [nrf fromtree] net: wifi: Allow to use offloaded wifi_mgmt API with native stack wifi drivers that depends on native ethernet stack cannot perform wifi API calls missing availability. This changes adds the ethernet_api interface in wifi_mgmt so that it becomes possible. Naming "offload" in "struct net_wifi_mgmt_offload" is kept because Zephyr still has no supplicant to handle a full non-offloaded driver. Signed-off-by: Sylvio Alves (cherry picked from commit be4619d816ac4260945b2b1309c78bedb7e18ae3) --- drivers/wifi/Kconfig | 6 ++++++ drivers/wifi/esp32/Kconfig.esp32 | 1 + drivers/wifi/esp32/src/esp_wifi_drv.c | 14 +++++++------- drivers/wifi/esp_at/esp.c | 2 +- drivers/wifi/eswifi/eswifi_core.c | 2 +- drivers/wifi/simplelink/simplelink.c | 2 +- drivers/wifi/winc1500/wifi_winc1500.c | 2 +- include/zephyr/net/wifi_mgmt.h | 13 +++++++------ 8 files changed, 25 insertions(+), 17 deletions(-) diff --git a/drivers/wifi/Kconfig b/drivers/wifi/Kconfig index 5e1975740aa..ea6245b33b1 100644 --- a/drivers/wifi/Kconfig +++ b/drivers/wifi/Kconfig @@ -29,6 +29,12 @@ config WIFI_OFFLOAD help Enable support for Full-MAC Wi-Fi devices. +config WIFI_USE_NATIVE_NETWORKING + bool + help + When selected, this hidden configuration enables Wi-Fi driver + to use native ethernet stack interface. + source "drivers/wifi/winc1500/Kconfig.winc1500" source "drivers/wifi/simplelink/Kconfig.simplelink" source "drivers/wifi/eswifi/Kconfig.eswifi" diff --git a/drivers/wifi/esp32/Kconfig.esp32 b/drivers/wifi/esp32/Kconfig.esp32 index 7434fde498f..65c544db048 100644 --- a/drivers/wifi/esp32/Kconfig.esp32 +++ b/drivers/wifi/esp32/Kconfig.esp32 @@ -4,6 +4,7 @@ menuconfig WIFI_ESP32 bool "ESP32 SoC WiFi support" depends on !SMP select THREAD_CUSTOM_DATA + select WIFI_USE_NATIVE_NETWORKING help Enable ESP32 SoC WiFi support. Only supported in single core mode because the network stack is not aware of SMP diff --git a/drivers/wifi/esp32/src/esp_wifi_drv.c b/drivers/wifi/esp32/src/esp_wifi_drv.c index 15af68ee360..cf3597befd5 100644 --- a/drivers/wifi/esp32/src/esp_wifi_drv.c +++ b/drivers/wifi/esp32/src/esp_wifi_drv.c @@ -12,6 +12,7 @@ LOG_MODULE_REGISTER(esp32_wifi, CONFIG_WIFI_LOG_LEVEL); #include #include #include +#include #include #include #include @@ -220,19 +221,18 @@ static int eth_esp32_dev_init(const struct device *dev) return ret; } - static struct esp32_wifi_runtime eth_data; -static const struct ethernet_api eth_esp32_apis = { - .iface_api.init = eth_esp32_init, - .send = eth_esp32_send, +static const struct net_wifi_mgmt_offload esp32_api = { + .wifi_iface.iface_api.init = eth_esp32_init, + .wifi_iface.send = eth_esp32_send, #if defined(CONFIG_NET_STATISTICS_ETHERNET) - .get_stats = eth_esp32_stats, -#endif + .wifi_iface.get_stats = eth_esp32_stats, + #endif }; NET_DEVICE_DT_INST_DEFINE(0, eth_esp32_dev_init, NULL, ð_data, NULL, CONFIG_ETH_INIT_PRIORITY, - ð_esp32_apis, ETHERNET_L2, + &esp32_api, ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU); diff --git a/drivers/wifi/esp_at/esp.c b/drivers/wifi/esp_at/esp.c index 84a394a9b2c..3987df6a33c 100644 --- a/drivers/wifi/esp_at/esp.c +++ b/drivers/wifi/esp_at/esp.c @@ -1088,7 +1088,7 @@ static void esp_iface_init(struct net_if *iface) } static const struct net_wifi_mgmt_offload esp_api = { - .iface_api.init = esp_iface_init, + .wifi_iface.init = esp_iface_init, .scan = esp_mgmt_scan, .connect = esp_mgmt_connect, .disconnect = esp_mgmt_disconnect, diff --git a/drivers/wifi/eswifi/eswifi_core.c b/drivers/wifi/eswifi/eswifi_core.c index 228aceda0b1..b6960ffd8cd 100644 --- a/drivers/wifi/eswifi/eswifi_core.c +++ b/drivers/wifi/eswifi/eswifi_core.c @@ -679,7 +679,7 @@ static int eswifi_init(const struct device *dev) } static const struct net_wifi_mgmt_offload eswifi_offload_api = { - .iface_api.init = eswifi_iface_init, + .wifi_iface.init = eswifi_iface_init, .scan = eswifi_mgmt_scan, .connect = eswifi_mgmt_connect, .disconnect = eswifi_mgmt_disconnect, diff --git a/drivers/wifi/simplelink/simplelink.c b/drivers/wifi/simplelink/simplelink.c index 26dd57034d4..a60ac990b63 100644 --- a/drivers/wifi/simplelink/simplelink.c +++ b/drivers/wifi/simplelink/simplelink.c @@ -264,7 +264,7 @@ static void simplelink_iface_init(struct net_if *iface) } static const struct net_wifi_mgmt_offload simplelink_api = { - .iface_api.init = simplelink_iface_init, + .wifi_iface.init = simplelink_iface_init, .scan = simplelink_mgmt_scan, .connect = simplelink_mgmt_connect, .disconnect = simplelink_mgmt_disconnect, diff --git a/drivers/wifi/winc1500/wifi_winc1500.c b/drivers/wifi/winc1500/wifi_winc1500.c index 404220e0e5a..94049a9ab6f 100644 --- a/drivers/wifi/winc1500/wifi_winc1500.c +++ b/drivers/wifi/winc1500/wifi_winc1500.c @@ -1100,7 +1100,7 @@ static void winc1500_iface_init(struct net_if *iface) } static const struct net_wifi_mgmt_offload winc1500_api = { - .iface_api.init = winc1500_iface_init, + .wifi_iface.init = winc1500_iface_init, .scan = winc1500_mgmt_scan, .connect = winc1500_mgmt_connect, .disconnect = winc1500_mgmt_disconnect, diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index efe3b6e9b01..d9325edc221 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -14,6 +14,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -130,7 +131,11 @@ struct net_wifi_mgmt_offload { * net_if_api structure. So we make current structure pointer * that can be casted to a net_if_api structure pointer. */ - struct net_if_api iface_api; +#ifdef CONFIG_WIFI_USE_NATIVE_NETWORKING + struct ethernet_api wifi_iface; +#else + struct net_if_api wifi_iface; +#endif /* cb parameter is the cb that should be called for each * result by the driver. The wifi mgmt part will take care of @@ -148,15 +153,11 @@ struct net_wifi_mgmt_offload { /* Make sure that the network interface API is properly setup inside * Wifi mgmt offload API struct (it is the first one). */ -BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, iface_api) == 0); - -#ifdef CONFIG_WIFI_OFFLOAD +BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, wifi_iface) == 0); void wifi_mgmt_raise_connect_result_event(struct net_if *iface, int status); void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status); -#endif /* CONFIG_WIFI_OFFLOAD */ - #ifdef __cplusplus } #endif From a4c7ed4c1f44164ac6a699c47dad8f86af5e233c Mon Sep 17 00:00:00 2001 From: Krishna T Date: Sun, 14 Aug 2022 02:22:44 +0530 Subject: [PATCH 134/501] [nrf fromlist] wifi_mgmt: Implement checks for new security types Extend checks for PSK-256 and SAE. Signed-off-by: Krishna T (cherry picked from commit 2bff4b0b71cbaefe1e78d1274b8bbc055e87d6b0) --- include/zephyr/net/wifi.h | 5 ++++- subsys/net/l2/wifi/wifi_mgmt.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index cc8224763be..1063b778d13 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -16,7 +16,10 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_NONE = 0, WIFI_SECURITY_TYPE_PSK, WIFI_SECURITY_TYPE_PSK_SHA256, - WIFI_SECURITY_TYPE_SAE + WIFI_SECURITY_TYPE_SAE, + + __WIFI_SECURITY_TYPE_AFTER_LAST, + WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1 }; /* Management frame protection (IEEE 802.11w) options */ diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index be358060b29..d2df054dc5e 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -28,14 +28,21 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, LOG_HEXDUMP_DBG(params->ssid, params->ssid_length, "ssid"); LOG_HEXDUMP_DBG(params->psk, params->psk_length, "psk"); + if (params->sae_password) { + LOG_HEXDUMP_DBG(params->sae_password, params->sae_password_length, "sae"); + } NET_DBG("ch %u sec %u", params->channel, params->security); - if ((params->security > WIFI_SECURITY_TYPE_PSK) || + if ((params->security > WIFI_SECURITY_TYPE_MAX) || (params->ssid_length > WIFI_SSID_MAX_LEN) || (params->ssid_length == 0U) || - ((params->security == WIFI_SECURITY_TYPE_PSK) && + ((params->security == WIFI_SECURITY_TYPE_PSK || + params->security == WIFI_SECURITY_TYPE_PSK_SHA256) && ((params->psk_length < 8) || (params->psk_length > 64) || (params->psk_length == 0U) || !params->psk)) || + ((params->security == WIFI_SECURITY_TYPE_SAE) && + ((params->psk_length == 0U) || !params->psk) && + ((params->sae_password_length == 0U) || !params->sae_password)) || ((params->channel != WIFI_CHANNEL_ANY) && (params->channel > WIFI_CHANNEL_MAX)) || !params->ssid) { From 28394e913a071a4c413a0a2c358ba88a0b910345 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Thu, 25 Aug 2022 11:02:18 +0530 Subject: [PATCH 135/501] [nrf fromlist] wifi_mgmt: Extend enumerations to include MAX and UNKNOWN This is handy to * Validate the input using MAX * Return UNKNOWN instead of int "-1" Signed-off-by: Krishna T (cherry picked from commit b9698bd0c42e419822e0b0716c953f1c4b6aee53) --- include/zephyr/net/wifi.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index 1063b778d13..cf55d803fc7 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -19,20 +19,29 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_SAE, __WIFI_SECURITY_TYPE_AFTER_LAST, - WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1 + WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1, + WIFI_SECURITY_TYPE_UNKNOWN }; /* Management frame protection (IEEE 802.11w) options */ enum wifi_mfp_options { WIFI_MFP_DISABLE = 0, WIFI_MFP_OPTIONAL, - WIFI_MFP_REQUIRED + WIFI_MFP_REQUIRED, + + __WIFI_MFP_AFTER_LAST, + WIFI_MFP_MAX = __WIFI_MFP_AFTER_LAST - 1, + WIFI_MFP_UNKNOWN }; enum wifi_frequency_bands { WIFI_FREQ_BAND_2_4_GHZ = 0, WIFI_FREQ_BAND_5_GHZ, - WIFI_FREQ_BAND_6_GHZ + WIFI_FREQ_BAND_6_GHZ, + + __WIFI_FREQ_BAND_AFTER_LAST, + WIFI_FREQ_BAND_MAX = __WIFI_FREQ_BAND_AFTER_LAST - 1, + WIFI_FREQ_BAND_UNKNOWN }; #define WIFI_SSID_MAX_LEN 32 From 4fe409646082c0f8c9c73703acc28f1e95ef08c8 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Sun, 14 Aug 2022 02:54:46 +0530 Subject: [PATCH 136/501] [nrf fromlist] wifi_mgmt: Add support for connection timeout This is handy for applications to control timeout and try multiple connections rather than relying on underlying implementation. Signed-off-by: Krishna T (cherry picked from commit 88815fe787e4aec8edfeb423e0884df1e2af1aa0) --- include/zephyr/net/wifi_mgmt.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index d9325edc221..84760820f6b 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -113,6 +113,7 @@ struct wifi_connect_req_params { uint8_t channel; enum wifi_security_type security; enum wifi_mfp_options mfp; + int timeout; /* SYS_FOREVER_MS for no timeout */ }; struct wifi_status { From a9f27789f0509bf41af0e57d944fd0c921f4c111 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Sun, 14 Aug 2022 02:57:47 +0530 Subject: [PATCH 137/501] [nrf fromlist] wifi_mgmt: Add a comment for legacy types As this was deliberate add a comment that we support and encourage only None/WPA2/WPA3. Signed-off-by: Krishna T (cherry picked from commit 6da99eec6ac417c33b066ea1b52147e3a68165a0) --- include/zephyr/net/wifi.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index cf55d803fc7..a58d41e17a9 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -12,6 +12,9 @@ #ifndef ZEPHYR_INCLUDE_NET_WIFI_H_ #define ZEPHYR_INCLUDE_NET_WIFI_H_ +/* Not having support for legacy types is deliberate to enforce + * higher security. + */ enum wifi_security_type { WIFI_SECURITY_TYPE_NONE = 0, WIFI_SECURITY_TYPE_PSK, From 7f08e4d8fd7da0e1a81ecce341134895e584df20 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Sun, 14 Aug 2022 02:50:49 +0530 Subject: [PATCH 138/501] [nrf fromlist] wifi_mgmt: Add new API for Wi-Fi status A new net_mgmt command and event are added for interface status, depending on the implementation the status can be returned when polled or an unsolicited event can be send by driver whenever there is a change in status. This is planned to be implemented only by upcoming wpa_supplicant, offload implementation is left for driver developers. Signed-off-by: Krishna T (cherry picked from commit 827915ab4f6f55441fcb087f45ac0125a53bb2bd) --- include/zephyr/net/wifi.h | 191 ++++++++++++++++++++++++++++++++ include/zephyr/net/wifi_mgmt.h | 28 ++++- subsys/net/l2/wifi/wifi_mgmt.c | 35 ++++++ subsys/net/l2/wifi/wifi_shell.c | 48 +++++++- 4 files changed, 300 insertions(+), 2 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index a58d41e17a9..e6107bef556 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -26,6 +26,26 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_UNKNOWN }; +/** + * wifi_security_txt - Get the security type as a text string + */ +static inline const char *wifi_security_txt(enum wifi_security_type security) +{ + switch (security) { + case WIFI_SECURITY_TYPE_NONE: + return "OPEN"; + case WIFI_SECURITY_TYPE_PSK: + return "WPA2-PSK"; + case WIFI_SECURITY_TYPE_PSK_SHA256: + return "WPA2-PSK-SHA256"; + case WIFI_SECURITY_TYPE_SAE: + return "WPA3-SAE"; + case WIFI_SECURITY_TYPE_UNKNOWN: + default: + return "UNKNOWN"; + } +} + /* Management frame protection (IEEE 802.11w) options */ enum wifi_mfp_options { WIFI_MFP_DISABLE = 0, @@ -37,6 +57,24 @@ enum wifi_mfp_options { WIFI_MFP_UNKNOWN }; +/** + * wifi_mfp_txt - Get the MFP as a text string + */ +static inline const char *wifi_mfp_txt(enum wifi_mfp_options mfp) +{ + switch (mfp) { + case WIFI_MFP_DISABLE: + return "Disable"; + case WIFI_MFP_OPTIONAL: + return "Optional"; + case WIFI_MFP_REQUIRED: + return "Required"; + case WIFI_MFP_UNKNOWN: + default: + return "UNKNOWN"; + } +} + enum wifi_frequency_bands { WIFI_FREQ_BAND_2_4_GHZ = 0, WIFI_FREQ_BAND_5_GHZ, @@ -47,6 +85,24 @@ enum wifi_frequency_bands { WIFI_FREQ_BAND_UNKNOWN }; +/** + * wifi_mode_txt - Get the interface mode type as a text string + */ +static inline const char *wifi_band_txt(enum wifi_frequency_bands band) +{ + switch (band) { + case WIFI_FREQ_BAND_2_4_GHZ: + return "2.4GHz"; + case WIFI_FREQ_BAND_5_GHZ: + return "5GHz"; + case WIFI_FREQ_BAND_6_GHZ: + return "6GHz"; + case WIFI_FREQ_BAND_UNKNOWN: + default: + return "UNKNOWN"; + } +} + #define WIFI_SSID_MAX_LEN 32 #define WIFI_PSK_MAX_LEN 64 #define WIFI_MAC_ADDR_LEN 6 @@ -54,4 +110,139 @@ enum wifi_frequency_bands { #define WIFI_CHANNEL_MAX 233 #define WIFI_CHANNEL_ANY 255 +/* Based on https://w1.fi/wpa_supplicant/devel/defs_8h.html#a4aeb27c1e4abd046df3064ea9756f0bc */ +enum wifi_iface_state { + WIFI_STATE_DISCONNECTED = 0, + WIFI_STATE_INTERFACE_DISABLED, + WIFI_STATE_INACTIVE, + WIFI_STATE_SCANNING, + WIFI_STATE_AUTHENTICATING, + WIFI_STATE_ASSOCIATING, + WIFI_STATE_ASSOCIATED, + WIFI_STATE_4WAY_HANDSHAKE, + WIFI_STATE_GROUP_HANDSHAKE, + WIFI_STATE_COMPLETED, + + __WIFI_STATE_AFTER_LAST, + WIFI_STATE_MAX = __WIFI_STATE_AFTER_LAST - 1, + WIFI_STATE_UNKNOWN +}; + +/** + * wifi_state_txt - Get the connection state name as a text string + */ +static inline const char *wifi_state_txt(enum wifi_iface_state state) +{ + switch (state) { + case WIFI_STATE_DISCONNECTED: + return "DISCONNECTED"; + case WIFI_STATE_INACTIVE: + return "INACTIVE"; + case WIFI_STATE_INTERFACE_DISABLED: + return "INTERFACE_DISABLED"; + case WIFI_STATE_SCANNING: + return "SCANNING"; + case WIFI_STATE_AUTHENTICATING: + return "AUTHENTICATING"; + case WIFI_STATE_ASSOCIATING: + return "ASSOCIATING"; + case WIFI_STATE_ASSOCIATED: + return "ASSOCIATED"; + case WIFI_STATE_4WAY_HANDSHAKE: + return "4WAY_HANDSHAKE"; + case WIFI_STATE_GROUP_HANDSHAKE: + return "GROUP_HANDSHAKE"; + case WIFI_STATE_COMPLETED: + return "COMPLETED"; + case WIFI_STATE_UNKNOWN: + default: + return "UNKNOWN"; + } +} + +/* Based on https://w1.fi/wpa_supplicant/devel/structwpa__ssid.html#a625821e2acfc9014f3b3de6e6593ffb7 */ +enum wifi_iface_mode { + WIFI_MODE_INFRA = 0, + WIFI_MODE_IBSS = 1, + WIFI_MODE_AP = 2, + WIFI_MODE_P2P_GO = 3, + WIFI_MODE_P2P_GROUP_FORMATION = 4, + WIFI_MODE_MESH = 5, + + __WIFI_MODE_AFTER_LAST, + WIFI_MODE_MAX = __WIFI_MODE_AFTER_LAST - 1, + WIFI_MODE_UNKNOWN +}; + +/** + * wifi_mode_txt - Get the interface mode type as a text string + */ +static inline const char *wifi_mode_txt(enum wifi_iface_mode mode) +{ + switch (mode) { + case WIFI_MODE_INFRA: + return "STATION"; + case WIFI_MODE_IBSS: + return "ADHOC"; + case WIFI_MODE_AP: + return "ACCESS POINT"; + case WIFI_MODE_P2P_GO: + return "P2P GROUP OWNER"; + case WIFI_MODE_P2P_GROUP_FORMATION: + return "P2P GROUP FORMATION"; + case WIFI_MODE_MESH: + return "MESH"; + case WIFI_MODE_UNKNOWN: + default: + return "UNKNOWN"; + } +} + +/* As per https://en.wikipedia.org/wiki/Wi-Fi#Versions_and_generations */ +enum wifi_link_mode { + WIFI_0 = 0, + WIFI_1, + WIFI_2, + WIFI_3, + WIFI_4, + WIFI_5, + WIFI_6, + WIFI_6E, + WIFI_7, + + __WIFI_LINK_MODE_AFTER_LAST, + WIFI_LINK_MODE_MAX = __WIFI_LINK_MODE_AFTER_LAST - 1, + WIFI_LINK_MODE_UNKNOWN +}; + +/** + * wifi_link_mode_txt - Get the link mode type as a text string + */ +static inline const char *wifi_link_mode_txt(enum wifi_link_mode link_mode) +{ + switch (link_mode) { + case WIFI_0: + return "WIFI 0 (802.11)"; + case WIFI_1: + return "WIFI 1 (802.11b)"; + case WIFI_2: + return "WIFI 2 (802.11a)"; + case WIFI_3: + return "WIFI 3 (802.11g)"; + case WIFI_4: + return "WIFI 4 (802.11n/HT)"; + case WIFI_5: + return "WIFI 5 (802.11ac/VHT)"; + case WIFI_6: + return "WIFI 6 (802.11ax/HE)"; + case WIFI_6E: + return "WIFI 6E (802.11ax 6GHz/HE)"; + case WIFI_7: + return "WIFI 7 (802.11be/EHT)"; + case WIFI_LINK_MODE_UNKNOWN: + default: + return "UNKNOWN"; + } +} + #endif /* ZEPHYR_INCLUDE_NET_WIFI_H_ */ diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 84760820f6b..3721ed08d3b 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -35,6 +35,7 @@ enum net_request_wifi_cmd { NET_REQUEST_WIFI_CMD_DISCONNECT, NET_REQUEST_WIFI_CMD_AP_ENABLE, NET_REQUEST_WIFI_CMD_AP_DISABLE, + NET_REQUEST_WIFI_CMD_IFACE_STATUS, }; #define NET_REQUEST_WIFI_SCAN \ @@ -62,11 +63,17 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_ENABLE); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE); +#define NET_REQUEST_WIFI_IFACE_STATUS \ + (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_IFACE_STATUS) + +NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS); + enum net_event_wifi_cmd { NET_EVENT_WIFI_CMD_SCAN_RESULT = 1, NET_EVENT_WIFI_CMD_SCAN_DONE, NET_EVENT_WIFI_CMD_CONNECT_RESULT, NET_EVENT_WIFI_CMD_DISCONNECT_RESULT, + NET_EVENT_WIFI_CMD_IFACE_STATUS, }; #define NET_EVENT_WIFI_SCAN_RESULT \ @@ -81,6 +88,9 @@ enum net_event_wifi_cmd { #define NET_EVENT_WIFI_DISCONNECT_RESULT \ (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_RESULT) +#define NET_EVENT_WIFI_IFACE_STATUS \ + (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_IFACE_STATUS) + /* Each result is provided to the net_mgmt_event_callback * via its info attribute (see net_mgmt.h) @@ -120,6 +130,20 @@ struct wifi_status { int status; }; +struct wifi_iface_status { + int state; /* enum wifi_iface_state */ + unsigned int ssid_len; + char ssid[WIFI_SSID_MAX_LEN]; + char bssid[WIFI_MAC_ADDR_LEN]; + enum wifi_frequency_bands band; + unsigned int channel; + enum wifi_iface_mode iface_mode; + enum wifi_link_mode link_mode; + enum wifi_security_type security; + enum wifi_mfp_options mfp; + int rssi; +}; + #include typedef void (*scan_result_cb_t)(struct net_if *iface, int status, @@ -149,6 +173,7 @@ struct net_wifi_mgmt_offload { int (*ap_enable)(const struct device *dev, struct wifi_connect_req_params *params); int (*ap_disable)(const struct device *dev); + int (*iface_status)(const struct device *dev, struct wifi_iface_status *status); }; /* Make sure that the network interface API is properly setup inside @@ -158,7 +183,8 @@ BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, wifi_iface) == 0); void wifi_mgmt_raise_connect_result_event(struct net_if *iface, int status); void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status); - +void wifi_mgmt_raise_iface_status_event(struct net_if *iface, + struct wifi_iface_status *iface_status); #ifdef __cplusplus } #endif diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index d2df054dc5e..3c21e9a527a 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -164,3 +164,38 @@ static int wifi_ap_disable(uint32_t mgmt_request, struct net_if *iface, } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE, wifi_ap_disable); + +static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface, + void *data, size_t len) +{ + int ret; + const struct device *dev = net_if_get_device(iface); + struct net_wifi_mgmt_offload *off_api = + (struct net_wifi_mgmt_offload *) dev->api; + struct wifi_iface_status *status = data; + + if (off_api == NULL || off_api->iface_status == NULL) { + return -ENOTSUP; + } + + if (!data || len != sizeof(*status)) { + return -EINVAL; + } + + ret = off_api->iface_status(dev, status); + + if (ret) { + return ret; + } + + return 0; +} +NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS, wifi_iface_status); + +void wifi_mgmt_raise_iface_status_event(struct net_if *iface, + struct wifi_iface_status *iface_status) +{ + net_mgmt_event_notify_with_info(NET_EVENT_WIFI_IFACE_STATUS, + iface, &iface_status, + sizeof(struct wifi_iface_status)); +} diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index c380ef2f46e..ce26a68f670 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -266,6 +266,51 @@ static int cmd_wifi_scan(const struct shell *shell, size_t argc, char *argv[]) return 0; } +static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = net_if_get_default(); + struct wifi_iface_status status = { 0 }; + + context.shell = sh; + + if (net_mgmt(NET_REQUEST_WIFI_IFACE_STATUS, iface, &status, + sizeof(struct wifi_iface_status))) { + shell_fprintf(sh, SHELL_WARNING, "Status request failed\n"); + + return -ENOEXEC; + } + + shell_fprintf(sh, SHELL_NORMAL, "Status: successful\n"); + shell_fprintf(sh, SHELL_NORMAL, "==================\n"); + shell_fprintf(sh, SHELL_NORMAL, "State: %s\n", wifi_state_txt(status.state)); + + if (status.state >= WIFI_STATE_ASSOCIATED) { + uint8_t mac_string_buf[sizeof("xx:xx:xx:xx:xx:xx")]; + + shell_fprintf(sh, SHELL_NORMAL, "Interface Mode: %s\n", + wifi_mode_txt(status.iface_mode)); + shell_fprintf(sh, SHELL_NORMAL, "Link Mode: %s\n", + wifi_link_mode_txt(status.link_mode)); + shell_fprintf(sh, SHELL_NORMAL, "SSID: %-32s\n", status.ssid); + shell_fprintf(sh, SHELL_NORMAL, "BSSID: %s\n", + status.bssid ? net_sprint_ll_addr_buf(status.bssid, + WIFI_MAC_ADDR_LEN, mac_string_buf, + sizeof(mac_string_buf)) : + ""); + shell_fprintf(sh, SHELL_NORMAL, "Band: %s\n", + wifi_band_txt(status.band)); + shell_fprintf(sh, SHELL_NORMAL, "Channel: %d\n", status.channel); + shell_fprintf(sh, SHELL_NORMAL, "Security: %s\n", + wifi_security_txt(status.security)); + shell_fprintf(sh, SHELL_NORMAL, "MFP: %s\n", + wifi_mfp_txt(status.mfp)); + shell_fprintf(sh, SHELL_NORMAL, "RSSI: %d\n", status.rssi); + } + + + return 0; +} + static int cmd_wifi_ap_enable(const struct shell *shell, size_t argc, char *argv[]) { @@ -319,11 +364,12 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, SHELL_CMD(connect, NULL, "\"\"\n\n" - "", + "" cmd_wifi_connect), SHELL_CMD(disconnect, NULL, "Disconnect from Wifi AP", cmd_wifi_disconnect), SHELL_CMD(scan, NULL, "Scan Wifi AP", cmd_wifi_scan), + SHELL_CMD(status, NULL, "Status of Wi-Fi interface", cmd_wifi_status), SHELL_CMD(ap, &wifi_cmd_ap, "Access Point mode commands", NULL), SHELL_SUBCMD_SET_END ); From 6f37d3654453b1484fcf9b3435c3159ac8f92784 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Thu, 25 Aug 2022 14:08:19 +0530 Subject: [PATCH 139/501] [nrf fromlist] wifi_shell: Add new security methods Add PSK_256, SAE and MFP settings. Signed-off-by: Krishna T (cherry picked from commit 39193b9d2235b756ca53f36b8b036d1a9d6c8ded) --- subsys/net/l2/wifi/wifi_shell.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index ce26a68f670..870266f70be 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -74,7 +74,7 @@ static void handle_wifi_scan_result(struct net_mgmt_event_callback *cb) print(context.shell, SHELL_NORMAL, "%-4d | %-32s %-5u | %-4u | %-4d | %-5s | %s\n", scan_result, entry->ssid, entry->ssid_length, entry->channel, entry->rssi, - (entry->security == WIFI_SECURITY_TYPE_PSK ? "WPA/WPA2" : "Open "), + wifi_security_txt(entry->security), ((entry->mac_length) ? net_sprint_ll_addr_buf(entry->mac, WIFI_MAC_ADDR_LEN, mac_string_buf, sizeof(mac_string_buf)) : "")); @@ -183,10 +183,32 @@ static int __wifi_args_to_params(size_t argc, char *argv[], params->psk = argv[idx]; params->psk_length = strlen(argv[idx]); params->security = WIFI_SECURITY_TYPE_PSK; + idx++; + + /* Security type (optional) */ + if (idx < argc) { + unsigned int security = strtol(argv[idx], &endptr, 10); + + if (security <= WIFI_SECURITY_TYPE_MAX) { + params->security = security; + } + idx++; + } } else { params->security = WIFI_SECURITY_TYPE_NONE; } + /* MFP (optional) */ + params->mfp = WIFI_MFP_OPTIONAL; + if (idx < argc) { + unsigned int mfp = strtol(argv[idx], &endptr, 10); + + if (mfp <= WIFI_MFP_REQUIRED) { + params->mfp = mfp; + } + idx++; + } + return 0; } @@ -365,6 +387,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, "\"\"\n\n" "" + "" + "0:None, 1:PSK, 2:PSK-256, 3:SAE" + " Date: Sun, 14 Aug 2022 16:39:55 +0530 Subject: [PATCH 140/501] [nrf fromlist] wifi_mgmt: Add new API for Wi-Fi statistics Networking statistics framework is used to define handler and the data structure, Wi-Fi management layer implements the handler and also adds a new offload API to get statistics from the Wi-Fi driver. Signed-off-by: Krishna T (cherry picked from commit 2040b861a8953f8ff3fdef46e9f85e1b5917ebd5) --- include/zephyr/net/net_stats.h | 33 +++++++++++++++++++++- include/zephyr/net/wifi_mgmt.h | 3 ++ subsys/net/ip/Kconfig.stats | 9 ++++++ subsys/net/l2/wifi/wifi_mgmt.c | 29 +++++++++++++++++++ subsys/net/l2/wifi/wifi_shell.c | 50 +++++++++++++++++++++++++++++++++ 5 files changed, 123 insertions(+), 1 deletion(-) diff --git a/include/zephyr/net/net_stats.h b/include/zephyr/net/net_stats.h index 7ef17cfb1ef..5344b246ac3 100644 --- a/include/zephyr/net/net_stats.h +++ b/include/zephyr/net/net_stats.h @@ -472,6 +472,29 @@ struct net_stats_ppp { net_stats_t chkerr; }; +/** + * @brief All Wi-Fi management statistics + */ +struct net_stats_sta_mgmt { + /** Number of received beacons */ + net_stats_t beacons_rx; + + /** Number of missed beacons */ + net_stats_t beacons_miss; +}; + +/** + * @brief All Wi-Fi specific statistics + */ +struct net_stats_wifi { + struct net_stats_sta_mgmt sta_mgmt; + struct net_stats_bytes bytes; + struct net_stats_pkts pkts; + struct net_stats_pkts broadcast; + struct net_stats_pkts multicast; + struct net_stats_pkts errors; +}; + #if defined(CONFIG_NET_STATISTICS_USER_API) /* Management part definitions */ @@ -493,7 +516,8 @@ enum net_request_stats_cmd { NET_REQUEST_STATS_CMD_GET_TCP, NET_REQUEST_STATS_CMD_GET_ETHERNET, NET_REQUEST_STATS_CMD_GET_PPP, - NET_REQUEST_STATS_CMD_GET_PM + NET_REQUEST_STATS_CMD_GET_PM, + NET_REQUEST_STATS_CMD_GET_WIFI, }; #define NET_REQUEST_STATS_GET_ALL \ @@ -581,6 +605,13 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_STATS_GET_PPP); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_STATS_GET_PM); #endif /* CONFIG_NET_STATISTICS_POWER_MANAGEMENT */ +#if defined(CONFIG_NET_STATISTICS_WIFI) +#define NET_REQUEST_STATS_GET_WIFI \ + (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_WIFI) + +NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI); +#endif /* CONFIG_NET_STATISTICS_WIFI */ + /** * @} */ diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 3721ed08d3b..ff42d7bfbf3 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -174,6 +174,9 @@ struct net_wifi_mgmt_offload { struct wifi_connect_req_params *params); int (*ap_disable)(const struct device *dev); int (*iface_status)(const struct device *dev, struct wifi_iface_status *status); +#ifdef CONFIG_NET_STATISTICS_WIFI + int (*get_stats)(const struct device *dev, struct net_stats_wifi *stats); +#endif /* CONFIG_NET_STATISTICS_WIFI */ }; /* Make sure that the network interface API is properly setup inside diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 0f96f05cebe..147b002d603 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -125,4 +125,13 @@ config NET_STATISTICS_POWER_MANAGEMENT This will provide how many time a network interface went suspended, for how long the last time and on average. +config NET_STATISTICS_WIFI + bool "Wi-Fi statistics" + depends on NET_L2_WIFI_MGMT + default y + help + Keep track of Wi-Fi related statistics. Note that this + requires support from the Wi-Fi driver. The driver needs + to collect the statistics. + endif # NET_STATISTICS diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 3c21e9a527a..db17f7f2521 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -199,3 +199,32 @@ void wifi_mgmt_raise_iface_status_event(struct net_if *iface, iface, &iface_status, sizeof(struct wifi_iface_status)); } + +#ifdef CONFIG_NET_STATISTICS_WIFI +static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, + void *data, size_t len) +{ + int ret; + const struct device *dev = net_if_get_device(iface); + struct net_wifi_mgmt_offload *off_api = + (struct net_wifi_mgmt_offload *) dev->api; + struct net_stats_wifi *stats = data; + + if (off_api == NULL || off_api->get_stats == NULL) { + return -ENOTSUP; + } + + if (!data || len != sizeof(*stats)) { + return -EINVAL; + } + + ret = off_api->get_stats(dev, stats); + + if (ret) { + return ret; + } + + return 0; +} +NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats); +#endif /* CONFIG_NET_STATISTICS_WIFI */ diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 870266f70be..b19277a0dae 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -333,6 +333,55 @@ static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) return 0; } + +#if defined(CONFIG_NET_STATISTICS_WIFI) && \ + defined(CONFIG_NET_STATISTICS_USER_API) +static void print_wifi_stats(struct net_if *iface, struct net_stats_wifi *data, + const struct shell *sh) +{ + shell_fprintf(sh, SHELL_NORMAL, "Statistics for Wi-Fi interface %p [%d]\n", iface, + net_if_get_by_iface(iface)); + + shell_fprintf(sh, SHELL_NORMAL, "Bytes received : %u\n", data->bytes.received); + shell_fprintf(sh, SHELL_NORMAL, "Bytes sent : %u\n", data->bytes.sent); + shell_fprintf(sh, SHELL_NORMAL, "Packets received : %u\n", data->pkts.rx); + shell_fprintf(sh, SHELL_NORMAL, "Packets sent : %u\n", data->pkts.tx); + shell_fprintf(sh, SHELL_NORMAL, "Bcast received : %u\n", data->broadcast.rx); + shell_fprintf(sh, SHELL_NORMAL, "Bcast sent : %u\n", data->broadcast.tx); + shell_fprintf(sh, SHELL_NORMAL, "Mcast received : %u\n", data->multicast.rx); + shell_fprintf(sh, SHELL_NORMAL, "Mcast sent : %u\n", data->multicast.tx); + shell_fprintf(sh, SHELL_NORMAL, "Beacons received : %u\n", data->sta_mgmt.beacons_rx); + shell_fprintf(sh, SHELL_NORMAL, "Beacons missed : %u\n", + data->sta_mgmt.beacons_miss); +} +#endif /* CONFIG_NET_STATISTICS_WIFI && CONFIG_NET_STATISTICS_USER_API */ + +static int cmd_wifi_stats(const struct shell *sh, size_t argc, char *argv[]) +{ +#if defined(CONFIG_NET_STATISTICS_WIFI) && \ + defined(CONFIG_NET_STATISTICS_USER_API) + struct net_if *iface = net_if_get_default(); + struct net_stats_wifi stats = { 0 }; + int ret; + + ret = net_mgmt(NET_REQUEST_STATS_GET_WIFI, iface, + &stats, sizeof(stats)); + if (!ret) { + print_wifi_stats(iface, &stats, sh); + } +#else + ARG_UNUSED(argc); + ARG_UNUSED(argv); + + shell_fprintf(sh, SHELL_INFO, "Set %s to enable %s support.\n", + "CONFIG_NET_STATISTICS_WIFI and CONFIG_NET_STATISTICS_USER_API", + "statistics"); +#endif /* CONFIG_NET_STATISTICS_WIFI && CONFIG_NET_STATISTICS_USER_API */ + + return 0; +} + + static int cmd_wifi_ap_enable(const struct shell *shell, size_t argc, char *argv[]) { @@ -395,6 +444,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, cmd_wifi_disconnect), SHELL_CMD(scan, NULL, "Scan Wifi AP", cmd_wifi_scan), SHELL_CMD(status, NULL, "Status of Wi-Fi interface", cmd_wifi_status), + SHELL_CMD(statistics, NULL, "Wi-Fi statistics", cmd_wifi_stats), SHELL_CMD(ap, &wifi_cmd_ap, "Access Point mode commands", NULL), SHELL_SUBCMD_SET_END ); From 15ede93de267614adcd91db4aa342104d9880eba Mon Sep 17 00:00:00 2001 From: Krishna T Date: Sun, 14 Aug 2022 22:51:37 +0530 Subject: [PATCH 141/501] [nrf fromlist] wifi_shell: Rename Wifi to Wi-Fi This is the standard. Signed-off-by: Krishna T (cherry picked from commit 2a6de8b895f616e50258ad70699c30bf841375cd) --- subsys/net/l2/wifi/wifi_shell.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index b19277a0dae..53836ecd24e 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -440,16 +440,16 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, "0:None, 1:PSK, 2:PSK-256, 3:SAE" " Date: Wed, 17 Aug 2022 14:59:28 +0530 Subject: [PATCH 142/501] [nrf fromlist] wifi_shell: Fix the duplicate tag CI warning Newly introduced Coverity scan throws a warning about duplicate tag as per MISRA coding standards, so, use a unique tag name in the existing code for "shell". Signed-off-by: Krishna T (cherry picked from commit e5ff5593aec822d2e478cae6a96cd7b00011aed2) --- subsys/net/l2/wifi/wifi_shell.c | 72 ++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 53836ecd24e..4db2bd0b939 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -32,7 +32,7 @@ LOG_MODULE_REGISTER(net_wifi_shell, LOG_LEVEL_INF); NET_EVENT_WIFI_DISCONNECT_RESULT) static struct { - const struct shell *shell; + const struct shell *sh; union { struct { @@ -49,10 +49,10 @@ static uint32_t scan_result; static struct net_mgmt_event_callback wifi_shell_mgmt_cb; -#define print(shell, level, fmt, ...) \ +#define print(sh, level, fmt, ...) \ do { \ - if (shell) { \ - shell_fprintf(shell, level, fmt, ##__VA_ARGS__); \ + if (sh) { \ + shell_fprintf(sh, level, fmt, ##__VA_ARGS__); \ } else { \ printk(fmt, ##__VA_ARGS__); \ } \ @@ -67,12 +67,12 @@ static void handle_wifi_scan_result(struct net_mgmt_event_callback *cb) scan_result++; if (scan_result == 1U) { - print(context.shell, SHELL_NORMAL, + print(context.sh, SHELL_NORMAL, "\n%-4s | %-32s %-5s | %-4s | %-4s | %-5s | %s\n", "Num", "SSID", "(len)", "Chan", "RSSI", "Sec", "MAC"); } - print(context.shell, SHELL_NORMAL, "%-4d | %-32s %-5u | %-4u | %-4d | %-5s | %s\n", + print(context.sh, SHELL_NORMAL, "%-4d | %-32s %-5u | %-4u | %-4d | %-5s | %s\n", scan_result, entry->ssid, entry->ssid_length, entry->channel, entry->rssi, wifi_security_txt(entry->security), ((entry->mac_length) ? @@ -86,10 +86,10 @@ static void handle_wifi_scan_done(struct net_mgmt_event_callback *cb) (const struct wifi_status *)cb->info; if (status->status) { - print(context.shell, SHELL_WARNING, + print(context.sh, SHELL_WARNING, "Scan request failed (%d)\n", status->status); } else { - print(context.shell, SHELL_NORMAL, "Scan request done\n"); + print(context.sh, SHELL_NORMAL, "Scan request done\n"); } scan_result = 0U; @@ -101,10 +101,10 @@ static void handle_wifi_connect_result(struct net_mgmt_event_callback *cb) (const struct wifi_status *) cb->info; if (status->status) { - print(context.shell, SHELL_WARNING, + print(context.sh, SHELL_WARNING, "Connection request failed (%d)\n", status->status); } else { - print(context.shell, SHELL_NORMAL, "Connected\n"); + print(context.sh, SHELL_NORMAL, "Connected\n"); } context.connecting = false; @@ -116,14 +116,14 @@ static void handle_wifi_disconnect_result(struct net_mgmt_event_callback *cb) (const struct wifi_status *) cb->info; if (context.disconnecting) { - print(context.shell, + print(context.sh, status->status ? SHELL_WARNING : SHELL_NORMAL, "Disconnection request %s (%d)\n", status->status ? "failed" : "done", status->status); context.disconnecting = false; } else { - print(context.shell, SHELL_NORMAL, "Disconnected\n"); + print(context.sh, SHELL_NORMAL, "Disconnected\n"); } } @@ -212,43 +212,43 @@ static int __wifi_args_to_params(size_t argc, char *argv[], return 0; } -static int cmd_wifi_connect(const struct shell *shell, size_t argc, +static int cmd_wifi_connect(const struct shell *sh, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); static struct wifi_connect_req_params cnx_params; if (__wifi_args_to_params(argc - 1, &argv[1], &cnx_params)) { - shell_help(shell); + shell_help(sh); return -ENOEXEC; } context.connecting = true; - context.shell = shell; + context.sh = sh; if (net_mgmt(NET_REQUEST_WIFI_CONNECT, iface, &cnx_params, sizeof(struct wifi_connect_req_params))) { - shell_fprintf(shell, SHELL_WARNING, + shell_fprintf(sh, SHELL_WARNING, "Connection request failed\n"); context.connecting = false; return -ENOEXEC; } else { - shell_fprintf(shell, SHELL_NORMAL, + shell_fprintf(sh, SHELL_NORMAL, "Connection requested\n"); } return 0; } -static int cmd_wifi_disconnect(const struct shell *shell, size_t argc, +static int cmd_wifi_disconnect(const struct shell *sh, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); int status; context.disconnecting = true; - context.shell = shell; + context.sh = sh; status = net_mgmt(NET_REQUEST_WIFI_DISCONNECT, iface, NULL, 0); @@ -256,33 +256,33 @@ static int cmd_wifi_disconnect(const struct shell *shell, size_t argc, context.disconnecting = false; if (status == -EALREADY) { - shell_fprintf(shell, SHELL_INFO, + shell_fprintf(sh, SHELL_INFO, "Already disconnected\n"); } else { - shell_fprintf(shell, SHELL_WARNING, + shell_fprintf(sh, SHELL_WARNING, "Disconnect request failed\n"); return -ENOEXEC; } } else { - shell_fprintf(shell, SHELL_NORMAL, + shell_fprintf(sh, SHELL_NORMAL, "Disconnect requested\n"); } return 0; } -static int cmd_wifi_scan(const struct shell *shell, size_t argc, char *argv[]) +static int cmd_wifi_scan(const struct shell *sh, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); - context.shell = shell; + context.sh = sh; if (net_mgmt(NET_REQUEST_WIFI_SCAN, iface, NULL, 0)) { - shell_fprintf(shell, SHELL_WARNING, "Scan request failed\n"); + shell_fprintf(sh, SHELL_WARNING, "Scan request failed\n"); return -ENOEXEC; } else { - shell_fprintf(shell, SHELL_NORMAL, "Scan requested\n"); + shell_fprintf(sh, SHELL_NORMAL, "Scan requested\n"); } return 0; @@ -293,7 +293,7 @@ static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) struct net_if *iface = net_if_get_default(); struct wifi_iface_status status = { 0 }; - context.shell = sh; + context.sh = sh; if (net_mgmt(NET_REQUEST_WIFI_IFACE_STATUS, iface, &status, sizeof(struct wifi_iface_status))) { @@ -382,41 +382,41 @@ static int cmd_wifi_stats(const struct shell *sh, size_t argc, char *argv[]) } -static int cmd_wifi_ap_enable(const struct shell *shell, size_t argc, +static int cmd_wifi_ap_enable(const struct shell *sh, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); static struct wifi_connect_req_params cnx_params; if (__wifi_args_to_params(argc - 1, &argv[1], &cnx_params)) { - shell_help(shell); + shell_help(sh); return -ENOEXEC; } - context.shell = shell; + context.sh = sh; if (net_mgmt(NET_REQUEST_WIFI_AP_ENABLE, iface, &cnx_params, sizeof(struct wifi_connect_req_params))) { - shell_fprintf(shell, SHELL_WARNING, "AP mode failed\n"); + shell_fprintf(sh, SHELL_WARNING, "AP mode failed\n"); return -ENOEXEC; } else { - shell_fprintf(shell, SHELL_NORMAL, "AP mode enabled\n"); + shell_fprintf(sh, SHELL_NORMAL, "AP mode enabled\n"); } return 0; } -static int cmd_wifi_ap_disable(const struct shell *shell, size_t argc, +static int cmd_wifi_ap_disable(const struct shell *sh, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); if (net_mgmt(NET_REQUEST_WIFI_AP_DISABLE, iface, NULL, 0)) { - shell_fprintf(shell, SHELL_WARNING, "AP mode disable failed\n"); + shell_fprintf(sh, SHELL_WARNING, "AP mode disable failed\n"); return -ENOEXEC; } else { - shell_fprintf(shell, SHELL_NORMAL, "AP mode disabled\n"); + shell_fprintf(sh, SHELL_NORMAL, "AP mode disabled\n"); } return 0; @@ -455,7 +455,7 @@ static int wifi_shell_init(const struct device *unused) { ARG_UNUSED(unused); - context.shell = NULL; + context.sh = NULL; context.all = 0U; scan_result = 0U; From c409ab44c11817bf260b61cc3796b39855906dc7 Mon Sep 17 00:00:00 2001 From: Mariusz Skamra Date: Mon, 22 Aug 2022 13:00:45 +0200 Subject: [PATCH 143/501] [nrf fromtree] Bluetooth: audio: ascs: Fix missing metadata reset before update The old metadata shall be reset (simply set the couynt to zero) before reuse or update. Signed-off-by: Mariusz Skamra (cherry picked from commit b1a7c6001eea1ea3494db2e1d696fd67554282da) --- subsys/bluetooth/audio/ascs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index 5ff747499e2..0f4a8f50a0d 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -1686,6 +1686,9 @@ int ascs_ep_set_metadata(struct bt_audio_ep *ep, return err; } + /* reset cached metadata */ + ep->codec.meta_count = 0; + /* store data contents */ bt_data_parse(&meta_ltv, ascs_codec_store_metadata, codec); From 28bc6ac6c7ae22ac58894f97d32bda3ab1e65914 Mon Sep 17 00:00:00 2001 From: Mariusz Skamra Date: Mon, 22 Aug 2022 12:55:02 +0200 Subject: [PATCH 144/501] [nrf fromtree] Bluetooth: audio: ascs: Remove invalid check This fixes invalid check, which is redundant in fact as the length is already checked in ascs_parse_metadata function. The check be test 'greater than' only, as 'equal' condition is valid. Moreover this fixes return value from ascs_verify_metadata function. Signed-off-by: Mariusz Skamra (cherry picked from commit 2b86c72404d376489a9a37cf6867a8710bdd5401) --- subsys/bluetooth/audio/ascs.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index 0f4a8f50a0d..20784cf7fa6 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -1646,12 +1646,7 @@ static int ascs_verify_metadata(const struct net_buf_simple *buf, return -EINVAL; } - if (result.count >= CONFIG_BT_CODEC_MAX_METADATA_COUNT) { - BT_ERR("No slot available for Codec Config Metadata"); - return -ENOMEM; - } - - return 0; + return result.err; } int ascs_ep_set_metadata(struct bt_audio_ep *ep, From 921e298da108373bc44e6a4edd360552ef0cafca Mon Sep 17 00:00:00 2001 From: Krishna T Date: Wed, 17 Aug 2022 16:02:47 +0530 Subject: [PATCH 145/501] [nrf fromlist] net: dhcp: Add support for restarting DHCP If a L2 link has been established, then the DHCP is taking too long as it has to go through its capped exponential backoff timers to trigger discover (The DHCP starts immediately during init, this is itself wrong, it should start on a link UP notification) that delays the DHCP for few seconds to a minute. And if we do stop and start DHCP then also it goes through the initial delays (though configurable), which is also not ideal. Add support for restarting DHCP without any delay, i.e., release and send discover immediately. This is also useful in case L2 switches to a different subnet, in this case Zephyr doesn't restart DHCP automatically, this API can be used by L2 apps/drivers to restart DHCP to get new subnet IP. Signed-off-by: Krishna T (cherry picked from commit 6e460c0847d437abb3b519bca048fafccbdd9411) --- include/zephyr/net/dhcpv4.h | 11 +++++++++++ samples/net/wifi/prj.conf | 1 + subsys/net/ip/dhcpv4.c | 33 ++++++++++++++++++++++----------- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/include/zephyr/net/dhcpv4.h b/include/zephyr/net/dhcpv4.h index d2bba5d92ff..38033eb1ace 100644 --- a/include/zephyr/net/dhcpv4.h +++ b/include/zephyr/net/dhcpv4.h @@ -66,6 +66,17 @@ void net_dhcpv4_start(struct net_if *iface); */ void net_dhcpv4_stop(struct net_if *iface); +/** + * @brief Restart DHCPv4 client on an iface + * + * @details Restart DHCPv4 client on a given interface. DHCPv4 client + * will restart the state machine without any of the initial delays + * used in start. + * + * @param iface A valid pointer on an interface + */ +void net_dhcpv4_restart(struct net_if *iface); + /** @cond INTERNAL_HIDDEN */ /** diff --git a/samples/net/wifi/prj.conf b/samples/net/wifi/prj.conf index a901a38623b..de7de625340 100644 --- a/samples/net/wifi/prj.conf +++ b/samples/net/wifi/prj.conf @@ -11,6 +11,7 @@ CONFIG_NET_PKT_TX_COUNT=10 CONFIG_NET_BUF_RX_COUNT=20 CONFIG_NET_BUF_TX_COUNT=20 CONFIG_NET_MAX_CONTEXTS=10 +CONFIG_NET_DHCPV4=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=n diff --git a/subsys/net/ip/dhcpv4.c b/subsys/net/ip/dhcpv4.c index 2188dd7461e..e4454184272 100644 --- a/subsys/net/ip/dhcpv4.c +++ b/subsys/net/ip/dhcpv4.c @@ -1139,10 +1139,10 @@ const char *net_dhcpv4_state_name(enum net_dhcpv4_state state) return name[state]; } -void net_dhcpv4_start(struct net_if *iface) +static void __net_dhcpv4_start(struct net_if *iface, bool first_start) { - uint32_t timeout; uint32_t entropy; + uint32_t timeout = 0; net_mgmt_event_notify(NET_EVENT_IPV4_DHCP_START, iface); @@ -1166,15 +1166,15 @@ void net_dhcpv4_start(struct net_if *iface) */ iface->config.dhcpv4.xid = entropy; - - /* RFC2131 4.1.1 requires we wait a random period - * between 1 and 10 seconds before sending the initial - * discover. - */ - timeout = entropy % - (CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX - - DHCPV4_INITIAL_DELAY_MIN) + - DHCPV4_INITIAL_DELAY_MIN; + /* Use default */ + if (first_start) { + /* RFC2131 4.1.1 requires we wait a random period + * between 1 and 10 seconds before sending the initial + * discover. + */ + timeout = entropy % (CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX - + DHCPV4_INITIAL_DELAY_MIN) + DHCPV4_INITIAL_DELAY_MIN; + } NET_DBG("wait timeout=%us", timeout); @@ -1200,6 +1200,11 @@ void net_dhcpv4_start(struct net_if *iface) k_mutex_unlock(&lock); } +void net_dhcpv4_start(struct net_if *iface) +{ + return __net_dhcpv4_start(iface, true); +} + void net_dhcpv4_stop(struct net_if *iface) { k_mutex_lock(&lock, K_FOREVER); @@ -1243,6 +1248,12 @@ void net_dhcpv4_stop(struct net_if *iface) k_mutex_unlock(&lock); } +void net_dhcpv4_restart(struct net_if *iface) +{ + net_dhcpv4_stop(iface); + __net_dhcpv4_start(iface, false); +} + int net_dhcpv4_init(void) { struct sockaddr local_addr; From b8de4358154d1ca5dae7429b9addb2d625858a2e Mon Sep 17 00:00:00 2001 From: Adam Wojasinski Date: Fri, 26 Aug 2022 14:17:03 +0200 Subject: [PATCH 146/501] [nrf fromlist] boards: arm: qemu_cortex_m0: Replace deprecated nrfx API This commit replaces API that became deprecated with the release of nrfx2.9 - see CHANGELOG in zephyrproject-rtos:hal_nordic repository Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/49581 Signed-off-by: Adam Wojasinski (cherry picked from commit a452c3433fef07d1d5cca94e8bff608eefba6930) --- boards/arm/qemu_cortex_m0/nrf_timer_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arm/qemu_cortex_m0/nrf_timer_timer.c b/boards/arm/qemu_cortex_m0/nrf_timer_timer.c index c727d75cd1d..e135fc5d5e5 100644 --- a/boards/arm/qemu_cortex_m0/nrf_timer_timer.c +++ b/boards/arm/qemu_cortex_m0/nrf_timer_timer.c @@ -236,7 +236,7 @@ static int sys_clock_driver_init(const struct device *dev) ARG_UNUSED(dev); /* FIXME switch to 1 MHz once this is fixed in QEMU */ - nrf_timer_frequency_set(TIMER, NRF_TIMER_FREQ_2MHz); + nrf_timer_prescaler_set(TIMER, NRF_TIMER_FREQ_2MHz); nrf_timer_bit_width_set(TIMER, NRF_TIMER_BIT_WIDTH_32); IRQ_CONNECT(TIMER0_IRQn, 1, timer0_nrf_isr, 0, 0); From d349844584709f1a955e9eb913695e650bd28937 Mon Sep 17 00:00:00 2001 From: Adam Wojasinski Date: Fri, 26 Aug 2022 14:19:48 +0200 Subject: [PATCH 147/501] [nrf fromlist] soc: arm: nordic_nrf: Replace deprecated nrfx API This commit replaces API that became deprecated with the release of nrfx2.9 - see CHANGELOG in zephyrproject-rtos:hal_nordic repository Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/49581 Signed-off-by: Adam Wojasinski (cherry picked from commit 5c349923c4ef4a65414d0f3c749270a282bfad27) --- soc/arm/nordic_nrf/common/soc_secure.c | 6 +++--- soc/arm/nordic_nrf/common/soc_secure.h | 12 ++++++------ soc/arm/nordic_nrf/nrf53/soc.c | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/soc/arm/nordic_nrf/common/soc_secure.c b/soc/arm/nordic_nrf/common/soc_secure.c index 4e087113f19..64d647f220a 100644 --- a/soc/arm/nordic_nrf/common/soc_secure.c +++ b/soc/arm/nordic_nrf/common/soc_secure.c @@ -12,8 +12,8 @@ #include "tfm_platform_api.h" #include "tfm_ioctl_api.h" -#if defined(GPIO_PIN_CNF_MCUSEL_Msk) -void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_mcusel_t mcu) +#if NRF_GPIO_HAS_SEL +void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_sel_t mcu) { uint32_t result; enum tfm_platform_err_t err; @@ -22,7 +22,7 @@ void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_mcusel_t m __ASSERT(err == TFM_PLATFORM_ERR_SUCCESS, "TFM platform error (%d)", err); __ASSERT(result == 0, "GPIO service error (%d)", result); } -#endif /* defined(GPIO_PIN_CNF_MCUSEL_Msk) */ +#endif /* NRF_GPIO_HAS_SEL */ int soc_secure_mem_read(void *dst, void *src, size_t len) { diff --git a/soc/arm/nordic_nrf/common/soc_secure.h b/soc/arm/nordic_nrf/common/soc_secure.h index 33a1db7ead8..948f38547aa 100644 --- a/soc/arm/nordic_nrf/common/soc_secure.h +++ b/soc/arm/nordic_nrf/common/soc_secure.h @@ -9,8 +9,8 @@ #include #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) -#if defined(GPIO_PIN_CNF_MCUSEL_Msk) -void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_mcusel_t mcu); +#if NRF_GPIO_HAS_SEL +void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_sel_t mcu); #endif int soc_secure_mem_read(void *dst, void *src, size_t len); @@ -48,13 +48,13 @@ static inline int soc_secure_mem_read(void *dst, void *src, size_t len) return 0; } -#if defined(GPIO_PIN_CNF_MCUSEL_Msk) +#if NRF_GPIO_HAS_SEL static inline void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, - nrf_gpio_pin_mcusel_t mcu) + nrf_gpio_pin_sel_t mcu) { - nrf_gpio_pin_mcu_select(pin_number, mcu); + nrf_gpio_pin_control_select(pin_number, mcu); } -#endif /* defined(GPIO_PIN_CNF_MCUSEL_Msk) */ +#endif /* NRF_GPIO_HAS_SEL */ #if defined(CONFIG_SOC_HFXO_CAP_INTERNAL) static inline uint32_t soc_secure_read_xosc32mtrim(void) diff --git a/soc/arm/nordic_nrf/nrf53/soc.c b/soc/arm/nordic_nrf/nrf53/soc.c index b3a04e0ce6d..28fdd56a343 100644 --- a/soc/arm/nordic_nrf/nrf53/soc.c +++ b/soc/arm/nordic_nrf/nrf53/soc.c @@ -133,8 +133,8 @@ static int nordicsemi_nrf53_init(const struct device *arg) * This is handled by the TF-M platform so we skip it when TF-M is * enabled. */ - nrf_gpio_pin_mcu_select(PIN_XL1, NRF_GPIO_PIN_MCUSEL_PERIPHERAL); - nrf_gpio_pin_mcu_select(PIN_XL2, NRF_GPIO_PIN_MCUSEL_PERIPHERAL); + nrf_gpio_pin_control_select(PIN_XL1, NRF_GPIO_PIN_SEL_PERIPHERAL); + nrf_gpio_pin_control_select(PIN_XL2, NRF_GPIO_PIN_SEL_PERIPHERAL); #endif /* !defined(CONFIG_BUILD_WITH_TFM) */ #endif /* defined(CONFIG_SOC_ENABLE_LFXO) */ #if defined(CONFIG_SOC_HFXO_CAP_INTERNAL) @@ -175,7 +175,7 @@ static int nordicsemi_nrf53_init(const struct device *arg) }; for (int i = 0; i < ARRAY_SIZE(forwarded_psels); i++) { - soc_secure_gpio_pin_mcu_select(forwarded_psels[i], NRF_GPIO_PIN_MCUSEL_NETWORK); + soc_secure_gpio_pin_mcu_select(forwarded_psels[i], NRF_GPIO_PIN_SEL_NETWORK); } #endif From 817eb16bf17459b7cb4a4e4b272fa70a9414c8e9 Mon Sep 17 00:00:00 2001 From: Adam Wojasinski Date: Fri, 26 Aug 2022 14:20:42 +0200 Subject: [PATCH 148/501] [nrf fromlist] Bluetooth: controller: Replace deprecated nrfx API This commit replaces API that became deprecated with the release of nrfx2.9 - see CHANGELOG in zephyrproject-rtos:hal_nordic repository Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/49581 Signed-off-by: Adam Wojasinski (cherry picked from commit 4e8293639aceedae0051fa78fe0d175f7130b7dc) --- .../controller/ll_sw/nordic/hal/nrf5/debug.h | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h index e1ee04b7e4c..4fa2e9d804a 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h @@ -35,16 +35,16 @@ (defined(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP_NS) && defined(CONFIG_BUILD_WITH_TFM)) #define DEBUG_SETUP() \ do { \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX0, NRF_GPIO_PIN_MCUSEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX1, NRF_GPIO_PIN_MCUSEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX2, NRF_GPIO_PIN_MCUSEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX3, NRF_GPIO_PIN_MCUSEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX4, NRF_GPIO_PIN_MCUSEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX5, NRF_GPIO_PIN_MCUSEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX6, NRF_GPIO_PIN_MCUSEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX7, NRF_GPIO_PIN_MCUSEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX8, NRF_GPIO_PIN_MCUSEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX9, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX0, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX1, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX2, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX3, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX4, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX5, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX6, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX7, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX8, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX9, NRF_GPIO_PIN_SEL_NETWORK); \ } while (0) #endif /* CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP */ #elif defined(CONFIG_BOARD_NRF52840DK_NRF52840) || \ From 53e1c84de8834d97a7e347b6e50631ff380b4c43 Mon Sep 17 00:00:00 2001 From: Adam Wojasinski Date: Fri, 26 Aug 2022 14:21:32 +0200 Subject: [PATCH 149/501] [nrf fromlist] drivers: Replace deprecated nrfx API This commit replaces API that became deprecated with the release of nrfx2.9 - see CHANGELOG in zephyrproject-rtos:hal_nordic repository Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/49581 Signed-off-by: Adam Wojasinski (cherry picked from commit 3a6c70b260c7a79a271c5dd45465168784ce9db6) --- drivers/counter/counter_nrfx_timer.c | 2 +- drivers/display/display_nrf_led_matrix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/counter/counter_nrfx_timer.c b/drivers/counter/counter_nrfx_timer.c index 72b7dfaf550..7668d90ff4b 100644 --- a/drivers/counter/counter_nrfx_timer.c +++ b/drivers/counter/counter_nrfx_timer.c @@ -291,7 +291,7 @@ static int init_timer(const struct device *dev, nrf_timer_bit_width_set(reg, config->bit_width); nrf_timer_mode_set(reg, config->mode); - nrf_timer_frequency_set(reg, config->freq); + nrf_timer_prescaler_set(reg, config->freq); nrf_timer_cc_set(reg, TOP_CH, counter_get_max_top_value(dev)); diff --git a/drivers/display/display_nrf_led_matrix.c b/drivers/display/display_nrf_led_matrix.c index 5ed40ef245e..6a65c280a2a 100644 --- a/drivers/display/display_nrf_led_matrix.c +++ b/drivers/display/display_nrf_led_matrix.c @@ -509,7 +509,7 @@ static int instance_init(const struct device *dev) } nrf_timer_bit_width_set(dev_config->timer, NRF_TIMER_BIT_WIDTH_16); - nrf_timer_frequency_set(dev_config->timer, TIMER_CLK_CONFIG); + nrf_timer_prescaler_set(dev_config->timer, TIMER_CLK_CONFIG); nrf_timer_cc_set(dev_config->timer, 0, PIXEL_PERIOD); nrf_timer_shorts_set(dev_config->timer, NRF_TIMER_SHORT_COMPARE0_STOP_MASK | From bba7a36d4d0cce0b3fbc575ffe6659410dec0e8f Mon Sep 17 00:00:00 2001 From: Adam Wojasinski Date: Fri, 26 Aug 2022 14:22:11 +0200 Subject: [PATCH 150/501] [nrf fromlist] tests: drivers: timer: Replace deprecated nrfx API This commit replaces API that became deprecated with the release of nrfx2.9 - see CHANGELOG in zephyrproject-rtos:hal_nordic repository Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/49581 Signed-off-by: Adam Wojasinski (cherry picked from commit df384c23a1a463623a6b0bb57ce1a726515a13ec) --- tests/drivers/timer/nrf_rtc_timer/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/timer/nrf_rtc_timer/src/main.c b/tests/drivers/timer/nrf_rtc_timer/src/main.c index 2d5c3dda20b..ab3adfc8cff 100644 --- a/tests/drivers/timer/nrf_rtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_rtc_timer/src/main.c @@ -31,7 +31,7 @@ static void init_zli_timer0(void) { nrf_timer_mode_set(NRF_TIMER0, NRF_TIMER_MODE_TIMER); nrf_timer_bit_width_set(NRF_TIMER0, NRF_TIMER_BIT_WIDTH_32); - nrf_timer_frequency_set(NRF_TIMER0, NRF_TIMER_FREQ_1MHz); + nrf_timer_prescaler_set(NRF_TIMER0, NRF_TIMER_FREQ_1MHz); nrf_timer_cc_set(NRF_TIMER0, 0, 100); nrf_timer_int_enable(NRF_TIMER0, NRF_TIMER_INT_COMPARE0_MASK); nrf_timer_shorts_enable(NRF_TIMER0, From 655cbc3444b3034dc86a19daaaf6d9003c579a60 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Mon, 4 Jul 2022 14:38:21 +0200 Subject: [PATCH 151/501] [nrf fromtree] samples: tfm_integration: tfm_regression_test Default to isol level 2 This defaults the TF-M regression tests to isolation level 2. It is set in order to showcase a more secure configuration by default. The default behavior of the sample is changed in the prj.conf file. The yaml file which includes the test cases enables testing for the three configurations: the library mode, the IPC mode isolation level 1 and the IPC mode isolation level 2. Signed-off-by: Georgios Vasilakis (cherry picked from commit 097ca1f24f26ca266141ac6b3317fe6c12c5c05b) --- samples/tfm_integration/tfm_regression_test/prj.conf | 4 ++++ .../tfm_integration/tfm_regression_test/sample.yaml | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index d6e0b380013..c579d1bc1b4 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -18,3 +18,7 @@ CONFIG_TFM_PARTITION_CRYPTO=y CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=y CONFIG_TFM_PARTITION_PLATFORM=y CONFIG_TFM_PARTITION_AUDIT_LOG=y + +# Enable IPC mode and isolation level 2 by default +CONFIG_TFM_IPC=y +CONFIG_TFM_ISOLATION_LEVEL=2 diff --git a/samples/tfm_integration/tfm_regression_test/sample.yaml b/samples/tfm_integration/tfm_regression_test/sample.yaml index 0297fb0907c..3383c91b544 100644 --- a/samples/tfm_integration/tfm_regression_test/sample.yaml +++ b/samples/tfm_integration/tfm_regression_test/sample.yaml @@ -14,9 +14,13 @@ sample: name: "TFM Regression Test" tests: - sample.tfm.regression: + sample.tfm.regression_lib_mode: + extra_args: CONFIG_TFM_IPC=n CONFIG_TFM_ISOLATION_LEVEL=1 timeout: 200 - sample.tfm.regression_ipc: - extra_args: CONFIG_TFM_IPC=y + sample.tfm.regression_ipc_lvl1: + extra_args: CONFIG_TFM_IPC=y CONFIG_TFM_ISOLATION_LEVEL=1 + timeout: 200 + + sample.tfm.regression_ipc_lvl2: timeout: 200 From cd53492175092c172156add03026c700f03fb61e Mon Sep 17 00:00:00 2001 From: Krishna T Date: Mon, 15 Aug 2022 02:45:06 +0530 Subject: [PATCH 152/501] [nrf noup] wifi_stats: Add nRF Wi-Fi management Until we merge with Zephyr's Wi-Fi management, add nRF Wi-Fi management support for Wi-Fi stats. Signed-off-by: Krishna T (cherry picked from commit 23230b9351940e3ed12cb5457437fa7699e96dca) --- subsys/net/ip/Kconfig.stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 147b002d603..639685e420d 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -127,7 +127,7 @@ config NET_STATISTICS_POWER_MANAGEMENT config NET_STATISTICS_WIFI bool "Wi-Fi statistics" - depends on NET_L2_WIFI_MGMT + depends on NET_L2_WIFI_MGMT || NET_L2_NRF_WIFI_MGMT default y help Keep track of Wi-Fi related statistics. Note that this From 17ebc6f04a4cd6d6e7eee79c09f55b4bf615874a Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Thu, 21 Jul 2022 14:52:18 +0200 Subject: [PATCH 153/501] [nrf fromtree] Bluetooth: hci: Add VS IQ samples report using 16 bit sign integer sampl Add vendor specific IQ samples report that holds IQ data in 16 bits signed integer format. Thanks to that we preserve complete accuracy of IQ samples provided by Nordic Direction Finding Extension in Radio peripheral. That helps to maintain better accuracy of evaluated angles with use of reported IQ samples. Signed-off-by: Piotr Pryga Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 700846d9dc2c8cdb8c4befe8523571ad0b178487) --- doc/connectivity/bluetooth/api/hci.txt | 371 ++++++++++++++++++++++++- include/zephyr/bluetooth/hci_vs.h | 42 +++ subsys/bluetooth/common/Kconfig | 7 + subsys/bluetooth/controller/Kconfig.df | 24 ++ subsys/bluetooth/controller/hci/hci.c | 188 ++++++++++++- 5 files changed, 628 insertions(+), 4 deletions(-) diff --git a/doc/connectivity/bluetooth/api/hci.txt b/doc/connectivity/bluetooth/api/hci.txt index 2522e635796..ee75f0799f9 100644 --- a/doc/connectivity/bluetooth/api/hci.txt +++ b/doc/connectivity/bluetooth/api/hci.txt @@ -88,8 +88,8 @@ the controller. By default no vendor events are reported. | | 1 | Fatal Error | | | 2 | Trace Information Event | | | 3 | Scan Request Received Event | - | | 4 | Reserved | - | | 5 | Reserved | + | | 4 | Connectionless IQ Report Event | + | | 5 | Connection IQ Report Event | | | 6 | Reserved | | | 7 | Reserved | +-------+------+--------------------------------------------+ @@ -1325,7 +1325,372 @@ advertising sets, this event shall not be generated. The event is only reported when unmasked by Set_Event_Mask command. -Zephyr Vendor Diagnostic Channel +Zephyr LE Connectionless IQ Report Event +======================================== + +This event indicates that periodic advertising PDU including Constant Tone +Extension was received and sampled. + ++-------------------------------+------------+-------------------------------+ +| Event | Event Code | Event Parameters | ++-------------------------------+------------+-------------------------------+ +| LE_Connectionless_IQ_Report | 0xFF | Subevent_Code, | +| | | Sync_Handle, | +| | | Channel_Index, | +| | | RSSI, | +| | | RSSI_Antenna_ID, | +| | | CTE_Type, | +| | | Slot_Durations, | +| | | Packet_Status, | +| | | Periodic_Event_Counter, | +| | | Sample_Count, | +| | | I_Sample[i], | +| | | Q_Sample[i] | ++-------------------------------+------------+-------------------------------+ + + The event provides collected IQ samples that are stored as 16 bit signed + integers. It is an extension to LE Connectionless IQ Report Event provided + by Bluetooth Core 5.3 Vol 4, Part E section 7.7.65.21. The BT Core defined + counterpart provides IQ samples that are 8 bit signed integers. + + Subevent_Code: Size: 1 Octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x05 | Subevent code for LE Connectionless | + | | IQ Report event | + +--------------------+--------------------------------------+ + + Sync_Handle: Size: 2 octets (12 bits meaningful) + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0xXXXX | Sync_Handle identifying the periodic | + | | advertising train. | + | | Range: 0x0000 to 0x0EFF | + +--------------------+--------------------------------------+ + | 0x0FFF | Receiver Test. | + +--------------------+--------------------------------------+ + + Channel_Index: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x00 to 0x27 | The index of the channel on which the| + | | packet was received. Note: 0x25 to | + | | 0x27 can be used only for packets | + | | generated during test modes. | + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + RSSI: Size: 2 octets + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0xXXXX | RSSI of the packet | + | | Range: -1270 to +200 | + | | Units: 0.1 dBm | + +--------------------+--------------------------------------+ + + + RSSI_Antenna_ID: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0xXX | Antenna ID | + +--------------------+--------------------------------------+ + + CTE_Type: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x00 | AoA Constant Tone Extension | + +--------------------+--------------------------------------+ + | 0x01 | AoD Constant Tone Extension with | + | | 1 us slots | + +--------------------+--------------------------------------+ + | 0x02 | AoD Constant Tone Extension with | + | | 2 us slots | + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + + Slot_Durations: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x01 | Switching and sampling slots are | + | | 1 µs each | + +--------------------+--------------------------------------+ + | 0x02 | Switching and sampling slots are | + | | 2 µs each | + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + Packet_Status: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x00 | Packet_Status | + +--------------------+--------------------------------------+ + | 0x01 | CRC was incorrect and the Length and | + | | CTETime fields of the packet were | + | | used to determine sampling points | + +--------------------+--------------------------------------+ + | 0x02 | CRC was incorrect but the Controller | + | | has determined the position and | + | | length of the Constant Tone Extension| + | | in some other way | + +--------------------+--------------------------------------+ + | 0xFF | Insufficient resources to sample | + | | (Channel_Index, CTE_Type, and | + | | Slot_Durations invalid). | + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + Periodic_Event_Counter: Size: 2 octets + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0xXXXX | The value of paEventCounter (see | + | | [Vol 6] Part B, Section 4.4.2.1) for | + | | the reported AUX_SYNC_IND PDU | + +--------------------+--------------------------------------+ + + Sample_Count: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x00 | No samples provided (only permitted | + | | if Packet_Status is 0xFF). | + +--------------------+--------------------------------------+ + | 0x09 to 0x52 | Total number of sample pairs (there | + | | shall be the same number of I samples| + | | and Q samples). | + | | Note: This number is dependent on the| + | | switch and sample slot durations used| + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + I_Sample[i]: Size: Sample_count x 2 octets + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x8000 | No valid sample available or sample | + | | is saturated | + +--------------------+--------------------------------------+ + | All other values | I sample for the reported packet | + | | (signed integer). | + | | The list in the order of the sampling| + | | points within the packet. | + +--------------------+--------------------------------------+ + + Q_Sample[i]: Size: Sample_count x 2 octets + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x8000 | No valid sample available or sample | + | | is saturated | + +--------------------+--------------------------------------+ + | All other values | Q sample for the reported packet | + | | (signed integer). | + | | The list in the order of the sampling| + | | points within the packet. | + +--------------------+--------------------------------------+ + +Zephyr LE Connection IQ Report Event +==================================== + +This event indicates that there was received and sampled a PDU including +Constant Tone Extension associated with a given connection. + ++-------------------------------+------------+-------------------------------+ +| Event | Event Code | Event Parameters | ++-------------------------------+------------+-------------------------------+ +| LE_Connection_IQ_Report | 0xFF | Subevent_Code, | +| | | Connection_Handle, | +| | | RF_PHY, | +| | | Data_Channel_Index, | +| | | RSSI, | +| | | RSSI_Antenna_ID, | +| | | CTE_Type, | +| | | Slot_Durations, | +| | | Packet_Status, | +| | | Connection_Event_Counter, | +| | | Sample_Count, | +| | | I_Sample[i], | +| | | Q_Sample[i] | ++-------------------------------+------------+-------------------------------+ + + The event provides collected IQ samples that are stored as 16 bit signed + integers. It is an extension to LE Connection IQ Report Event provided + by Bluetooth Core 5.3 Vol 4, Part E section 7.7.65.22. The BT Core defined + counterpart provides IQ samples that are 8 bit signed integers. + + Subevent_Code: Size: 1 Octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x06 | Subevent code for LE Connection IQ | + | | Report event | + +--------------------+--------------------------------------+ + + Connection_Handle: Size: 2 octets (12 bits meaningful) + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0xXXXX | Connection_Handle identifying the | + | | connection. | + | | Range: 0x0000 to 0x0EFF | + +--------------------+--------------------------------------+ + + RF_PHY: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x01 | The receiver PHY for the connection | + | | is LE 1M | + +--------------------+--------------------------------------+ + | 0x02 | The receiver PHY for the connection | + | | is LE 2M | + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + Data_Channel_Index: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x00 to 0x24 | The index of the data channel on | + | | which the Data Physical Channel PDU | + | | was received. | + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + RSSI: Size: 2 octets + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0xXXXX | RSSI of the packet | + | | Range: -1270 to +200 | + | | Units: 0.1 dBm | + +--------------------+--------------------------------------+ + + RSSI_Antenna_ID: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0xXX | Antenna ID | + +--------------------+--------------------------------------+ + + CTE_Type: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x00 | AoA Constant Tone Extension | + +--------------------+--------------------------------------+ + | 0x01 | AoD Constant Tone Extension with | + | | 1 us slots | + +--------------------+--------------------------------------+ + | 0x02 | AoD Constant Tone Extension with | + | | 2 us slots | + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + Slot_Durations: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x01 | Switching and sampling slots are | + | | 1 µs each | + +--------------------+--------------------------------------+ + | 0x02 | Switching and sampling slots are | + | | 2 µs each | + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + Packet_Status: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x00 | Packet_Status | + +--------------------+--------------------------------------+ + | 0x01 | CRC was incorrect and the Length and | + | | CTETime fields of the packet were | + | | used to determine sampling points | + +--------------------+--------------------------------------+ + | 0x02 | CRC was incorrect but the Controller | + | | has determined the position and | + | | length of the Constant Tone Extension| + | | in some other way | + +--------------------+--------------------------------------+ + | 0xFF | Insufficient resources to sample | + | | (Channel_Index, CTE_Type, and | + | | Slot_Durations invalid). | + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + Connection_Event_Counter: Size: 2 octets + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0xXXXX | The value of connEventCounter (see | + | | [Vol 6] Part B, Section 4.5.1) for | + | | the reported PDU | + +--------------------+--------------------------------------+ + + Sample_Count: Size: 1 octet + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x00 | No samples provided (only permitted | + | | if Packet_Status is 0xFF). | + +--------------------+--------------------------------------+ + | 0x09 to 0x52 | Total number of sample pairs (there | + | | shall be the same number of I samples| + | | and Q samples). | + | | Note: This number is dependent on the| + | | switch and sample slot durations used| + +--------------------+--------------------------------------+ + | All other values | Reserved for future use | + +--------------------+--------------------------------------+ + + I_Sample[i]: Size: Sample_count x 2 octets + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x8000 | No valid sample available or sample | + | | is saturated | + +--------------------+--------------------------------------+ + | All other values | I sample for the reported packet | + | | (signed integer). | + | | The list in the order of the sampling| + | | points within the packet. | + +--------------------+--------------------------------------+ + + Q_Sample[i]: Size: Sample_count x 2 octets + +--------------------+--------------------------------------+ + | Value | Parameter Description | + +--------------------+--------------------------------------+ + | 0x8000 | No valid sample available or sample | + | | is saturated | + +--------------------+--------------------------------------+ + | All other values | Q sample for the reported packet | + | | (signed integer). | + | | The list in the order of the sampling| + | | points within the packet. | + +--------------------+--------------------------------------+ + + Zephyr Vendor Diagnostic Channel ================================ The vendor diagnostic channel allows for an independent side channel to provide diff --git a/include/zephyr/bluetooth/hci_vs.h b/include/zephyr/bluetooth/hci_vs.h index 5df7a66f68f..483e9610a77 100644 --- a/include/zephyr/bluetooth/hci_vs.h +++ b/include/zephyr/bluetooth/hci_vs.h @@ -263,11 +263,53 @@ struct bt_hci_evt_vs_scan_req_rx { int8_t rssi; } __packed; +struct bt_hci_le_iq_sample16 { + int16_t i; + int16_t q; +} __packed; + +#define BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT 0x5 +#define BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE 0x8000 +struct bt_hci_evt_vs_le_connectionless_iq_report { + uint16_t sync_handle; + uint8_t chan_idx; + int16_t rssi; + uint8_t rssi_ant_id; + uint8_t cte_type; + uint8_t slot_durations; + uint8_t packet_status; + uint16_t per_evt_counter; + uint8_t sample_count; + struct bt_hci_le_iq_sample16 sample[0]; +} __packed; + +#define BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT 0x6 +struct bt_hci_evt_vs_le_connection_iq_report { + uint16_t conn_handle; + uint8_t rx_phy; + uint8_t data_chan_idx; + int16_t rssi; + uint8_t rssi_ant_id; + uint8_t cte_type; + uint8_t slot_durations; + uint8_t packet_status; + uint16_t conn_evt_counter; + uint8_t sample_count; + struct bt_hci_le_iq_sample16 sample[0]; +} __packed; + /* Event mask bits */ #define BT_EVT_MASK_VS_FATAL_ERROR BT_EVT_BIT(1) #define BT_EVT_MASK_VS_TRACE_INFO BT_EVT_BIT(2) #define BT_EVT_MASK_VS_SCAN_REQ_RX BT_EVT_BIT(3) +#define BT_EVT_MASK_VS_LE_CONNECTIONLESS_IQ_REPORT BT_EVT_BIT(4) +#define BT_EVT_MASK_VS_LE_CONNECTION_IQ_REPORT BT_EVT_BIT(5) + +#define DEFAULT_VS_EVT_MASK \ + BT_EVT_MASK_VS_FATAL_ERROR | BT_EVT_MASK_VS_TRACE_INFO | BT_EVT_MASK_VS_SCAN_REQ_RX | \ + BT_EVT_MASK_VS_LE_CONNECTIONLESS_IQ_REPORT | \ + BT_EVT_MASK_VS_LE_CONNECTION_IQ_REPORT /* Mesh HCI commands */ #define BT_HCI_MESH_REVISION 0x01 diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 7fc4691a501..1d4e97648b7 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -214,6 +214,13 @@ config BT_HCI_VS_EXT Host and/or Controller. This enables Write BD_ADDR, Read Build Info, Read Static Addresses and Read Key Hierarchy Roots vendor commands. +config BT_HCI_VS_EVT + bool "Zephyr HCI Vendor-Specific Events" + depends on BT_HCI_VS_EXT + help + Enable support for the Zephyr HCI Vendor-Specific Events in the + Host and/or Controller. + config BT_HCI_VS_FATAL_ERROR bool "Allow vendor specific HCI event Zephyr Fatal Error" depends on BT_HCI_VS_EXT diff --git a/subsys/bluetooth/controller/Kconfig.df b/subsys/bluetooth/controller/Kconfig.df index 8a3334f7a01..e3f460c7f51 100644 --- a/subsys/bluetooth/controller/Kconfig.df +++ b/subsys/bluetooth/controller/Kconfig.df @@ -309,6 +309,30 @@ config BT_CTLR_DF_IQ_SAMPLES_CONVERT_USE_8_LSB endchoice +# Vendor specifici extensions configuration + +config BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES + bool "Use 16 bits signed integer IQ samples in connectionless IQ reports" + depends on BT_CTLR_DF_SCAN_CTE_RX && BT_HCI_VS_EXT + select BT_HCI_VS_EVT + help + Direction Finging connectionless IQ reports provide a set of IQ samples collected during + sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed + integer, see Vol 4, Part E section 7.7.65.21. This option enables a vendor specific + extenstion to HCI layer, so that connectionless IQ reports store samples in 16 bit signed + integer format. + +config BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES + bool "Use 16 bits signed integer IQ samples in connection IQ reports" + depends on BT_CTLR_DF_CONN_CTE_RX && BT_HCI_VS_EXT + select BT_HCI_VS_EVT + help + Direction Finging connection IQ reports provide a set of IQ samples collected during + sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed + integer, see Vol 4, Part E section 7.7.65.22. This option enables a vendor specific + extenstion to HCI layer, so that connection IQ reports store samples in 16 bit signed + integer format. + endif # BT_LL_SW_SPLIT endif # BT_CTLR_DF diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 21c2a05189d..bd11ba75577 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -209,6 +209,9 @@ static uint32_t cis_pending_count; static uint64_t event_mask = DEFAULT_EVENT_MASK; static uint64_t event_mask_page_2 = DEFAULT_EVENT_MASK_PAGE_2; static uint64_t le_event_mask = DEFAULT_LE_EVENT_MASK; +#if defined(CONFIG_BT_HCI_VS_EVT) +static uint64_t vs_events_mask = DEFAULT_VS_EVT_MASK; +#endif /* CONFIG_BT_HCI_VS_EVT */ static struct net_buf *cmd_complete_status(uint8_t status); @@ -334,6 +337,19 @@ static void *meta_evt(struct net_buf *buf, uint8_t subevt, uint8_t melen) return net_buf_add(buf, melen); } +#if defined(CONFIG_BT_HCI_VS_EVT) +static void *vs_event(struct net_buf *buf, uint8_t subevt, uint8_t evt_len) +{ + struct bt_hci_evt_vs *evt; + + hci_evt_create(buf, BT_HCI_EVT_VENDOR, sizeof(*evt) + evt_len); + evt = net_buf_add(buf, sizeof(*evt)); + evt->subevent = subevt; + + return net_buf_add(buf, evt_len); +} +#endif /* CONFIG_BT_HCI_VS_EVT */ + #if defined(CONFIG_BT_HCI_MESH_EXT) static void *mesh_evt(struct net_buf *buf, uint8_t subevt, uint8_t melen) { @@ -2924,7 +2940,7 @@ static void le_df_connectionless_iq_report(struct pdu_data *pdu_rx, * HCI event should inform about it by storing single octet with * special I_sample and Q_sample data. */ - samples_cnt = (!iq_report->sample_count ? 1 : iq_report->sample_count); + samples_cnt = MAX(1, iq_report->sample_count); sep = meta_evt(buf, BT_HCI_EVT_LE_CONNECTIONLESS_IQ_REPORT, (sizeof(*sep) + @@ -4974,6 +4990,168 @@ struct net_buf *hci_vs_err_assert(const char *file, uint32_t line) } #endif /* CONFIG_BT_HCI_VS_FATAL_ERROR */ +#if defined(CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) +static void vs_le_df_connectionless_iq_report(struct pdu_data *pdu_rx, struct node_rx_pdu *node_rx, + struct net_buf *buf) +{ + struct bt_hci_evt_vs_le_connectionless_iq_report *sep; + struct node_rx_iq_report *iq_report; + struct lll_sync *lll; + uint8_t samples_cnt; + int16_t rssi; + uint16_t sync_handle; + uint16_t per_evt_counter; + struct ll_sync_set *sync = NULL; + + iq_report = (struct node_rx_iq_report *)node_rx; + + if (!(vs_events_mask & BT_EVT_MASK_VS_LE_CONNECTIONLESS_IQ_REPORT)) { + return; + } + + lll = iq_report->hdr.rx_ftr.param; + + sync = HDR_LLL2ULL(lll); + + /* TX LL thread has higher priority than RX thread. It may happen that + * host successfully disables CTE sampling in the meantime. + * It should be verified here, to avoid reporting IQ samples after + * the functionality was disabled or if sync was lost. + */ + if (ull_df_sync_cfg_is_not_enabled(&lll->df_cfg) || !sync->timeout_reload) { + /* Drop further processing of the event. */ + return; + } + + /* Get the sync handle corresponding to the LLL context passed in the + * node rx footer field. + */ + sync_handle = ull_sync_handle_get(sync); + per_evt_counter = iq_report->event_counter; + + /* If there are no IQ samples due to insufficient resources + * HCI event should inform about it by storing single octet with + * special I_sample and Q_sample data. + */ + samples_cnt = MAX(1, iq_report->sample_count); + + sep = vs_event(buf, BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT, + (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample16)))); + + rssi = RSSI_DBM_TO_DECI_DBM(iq_report->hdr.rx_ftr.rssi); + + sep->sync_handle = sys_cpu_to_le16(sync_handle); + sep->rssi = sys_cpu_to_le16(rssi); + sep->rssi_ant_id = iq_report->rssi_ant_id; + sep->cte_type = iq_report->cte_info.type; + + sep->chan_idx = iq_report->chan_idx; + sep->per_evt_counter = sys_cpu_to_le16(per_evt_counter); + + if (sep->cte_type == BT_HCI_LE_AOA_CTE) { + sep->slot_durations = iq_report->local_slot_durations; + } else if (sep->cte_type == BT_HCI_LE_AOD_CTE_1US) { + sep->slot_durations = BT_HCI_LE_ANTENNA_SWITCHING_SLOT_1US; + } else { + sep->slot_durations = BT_HCI_LE_ANTENNA_SWITCHING_SLOT_2US; + } + + sep->packet_status = iq_report->packet_status; + + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + sep->sample[0].i = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample[0].q = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample_count = 0U; + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); + sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); + } + + sep->sample_count = samples_cnt; + } +} +#endif /* CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ + +#if defined(CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) +static void vs_le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct net_buf *buf) +{ + struct bt_hci_evt_vs_le_connection_iq_report *sep; + struct node_rx_iq_report *iq_report; + struct lll_conn *lll; + uint8_t samples_cnt; + uint8_t phy_rx; + int16_t rssi; + + iq_report = (struct node_rx_iq_report *)node_rx; + + if (!(vs_events_mask & BT_EVT_MASK_VS_LE_CONNECTION_IQ_REPORT)) { + return; + } + + lll = iq_report->hdr.rx_ftr.param; + +#if defined(CONFIG_BT_CTLR_PHY) + phy_rx = lll->phy_rx; + + /* Make sure the report is generated for connection on PHY UNCODED */ + LL_ASSERT(phy_rx != PHY_CODED); +#else + phy_rx = PHY_1M; +#endif /* CONFIG_BT_CTLR_PHY */ + + /* TX LL thread has higher priority than RX thread. It may happen that host succefully + * disables CTE sampling in the meantime. It should be verified here, to avoid reporing + * IQ samples after the functionality was disabled. + */ + if (ull_df_conn_cfg_is_not_enabled(&lll->df_rx_cfg)) { + /* Dropp further processing of the event. */ + return; + } + + /* If there are no IQ samples due to insufficient resources HCI event should inform about + * it by store single octet with special I_sample and Q_sample data. + */ + samples_cnt = MAX(1, iq_report->sample_count); + + sep = vs_event(buf, BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT, + (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample16)))); + + rssi = RSSI_DBM_TO_DECI_DBM(iq_report->hdr.rx_ftr.rssi); + + sep->conn_handle = sys_cpu_to_le16(iq_report->hdr.handle); + sep->rx_phy = phy_rx; + sep->rssi = sys_cpu_to_le16(rssi); + sep->rssi_ant_id = iq_report->rssi_ant_id; + sep->cte_type = iq_report->cte_info.type; + + sep->data_chan_idx = iq_report->chan_idx; + sep->conn_evt_counter = sys_cpu_to_le16(iq_report->event_counter); + + if (sep->cte_type == BT_HCI_LE_AOA_CTE) { + sep->slot_durations = iq_report->local_slot_durations; + } else if (sep->cte_type == BT_HCI_LE_AOD_CTE_1US) { + sep->slot_durations = BT_HCI_LE_ANTENNA_SWITCHING_SLOT_1US; + } else { + sep->slot_durations = BT_HCI_LE_ANTENNA_SWITCHING_SLOT_2US; + } + + sep->packet_status = iq_report->packet_status; + + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + sep->sample[0].i = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample[0].q = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample_count = 0U; + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); + sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); + } + sep->sample_count = samples_cnt; + } +} +#endif /* CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ + #endif /* CONFIG_BT_HCI_VS_EXT */ #if defined(CONFIG_BT_HCI_MESH_EXT) @@ -7874,7 +8052,11 @@ static void encode_control(struct node_rx_pdu *node_rx, #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT: +#if defined(CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) + vs_le_df_connectionless_iq_report(pdu_data, node_rx, buf); +#else le_df_connectionless_iq_report(pdu_data, node_rx, buf); +#endif /* CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ break; #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ @@ -7972,7 +8154,11 @@ static void encode_control(struct node_rx_pdu *node_rx, #if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX) case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT: +#if defined(CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) + vs_le_df_connection_iq_report(node_rx, buf); +#else le_df_connection_iq_report(node_rx, buf); +#endif /* CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ return; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */ #endif /* CONFIG_BT_CONN */ From dbcb042dd8fc7bcbe6d5b80fa78b6c94f43ce5c8 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Thu, 21 Jul 2022 14:56:51 +0200 Subject: [PATCH 154/501] [nrf fromtree] Bluetooth: Host: Add common handling of VS IQ report Bluetooth Controller has a vendor specific extensions that allows it to send IQ report events with IQ samples that are 8 bits or 16 bits signed integer. To use that functionality, there is added common handler of vendor specific events. Vendor specific events handling is prioritized to be done by user provided event handler. If that is not available, then Host generic implementation enters. Added vendor specific events that are handled by common Host code are BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT and BT_HCI_EVT_VS_LE- _CONNECTION_IQ_REPORT. The only difference between regular IQ report events is size of IQ samples, hence implementation of IQ report events is changed to use the same user callback. To avoid differentiation of user callbacks new member sample_type was added to bt_df_per_adv_sync_iq_samples- _report. Also sample member is changed to be a union, to allow easy access to IQ samples without type casting. Signed-off-by: Piotr Pryga Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 5f4ed96ba12d057333324336a42ddcfbdf6ce88e) --- include/zephyr/bluetooth/direction.h | 31 +++++-- subsys/bluetooth/host/Kconfig | 22 +++++ subsys/bluetooth/host/conn.c | 32 ++++++- subsys/bluetooth/host/direction.c | 102 +++++++++++++++++++++ subsys/bluetooth/host/direction_internal.h | 6 ++ subsys/bluetooth/host/hci_core.c | 63 ++++++++++--- subsys/bluetooth/host/hci_core.h | 2 + subsys/bluetooth/host/scan.c | 35 ++++++- 8 files changed, 268 insertions(+), 25 deletions(-) diff --git a/include/zephyr/bluetooth/direction.h b/include/zephyr/bluetooth/direction.h index c5cb2f1bf1e..7b24f7da88a 100644 --- a/include/zephyr/bluetooth/direction.h +++ b/include/zephyr/bluetooth/direction.h @@ -101,10 +101,19 @@ struct bt_df_per_adv_sync_cte_rx_param { const uint8_t *ant_ids; }; +enum bt_df_iq_sample { + /** Reported IQ samples have 8 bits signed integer format. Size defined in BT Core 5.3 + * Vol 4, Part E sections 7.7.65.21 and 7.7.65.22. + */ + BT_DF_IQ_SAMPLE_8_BITS_INT, + /** Reported IQ samples have 16 bits signed integer format. Vendor specific extension. */ + BT_DF_IQ_SAMPLE_16_BITS_INT, +}; + struct bt_df_per_adv_sync_iq_samples_report { /** Channel index used to receive PDU with CTE that was sampled. */ uint8_t chan_idx; - /** The RSSI of the PDU with CTE (excluding CTE). */ + /** The RSSI of the PDU with CTE (excluding CTE). Range: -1270 to +200. Units: 0.1 dBm. */ int16_t rssi; /** Id of antenna used to measure the RSSI. */ uint8_t rssi_ant_id; @@ -118,8 +127,13 @@ struct bt_df_per_adv_sync_iq_samples_report { uint16_t per_evt_counter; /** Number of IQ samples in report. */ uint8_t sample_count; - /** Pinter to IQ samples data. */ - struct bt_hci_le_iq_sample const *sample; + /** Type of IQ samples provided in a report. */ + enum bt_df_iq_sample sample_type; + /** Pointer to IQ samples data. */ + union { + struct bt_hci_le_iq_sample const *sample; + struct bt_hci_le_iq_sample16 const *sample16; + }; }; struct bt_df_conn_cte_rx_param { @@ -153,7 +167,7 @@ struct bt_df_conn_iq_samples_report { uint8_t rx_phy; /** Channel index used to receive PDU with CTE that was sampled. */ uint8_t chan_idx; - /** The RSSI of the PDU with CTE (excluding CTE). */ + /** The RSSI of the PDU with CTE (excluding CTE). Range: -1270 to +200. Units: 0.1 dBm. */ int16_t rssi; /** Id of antenna used to measure the RSSI. */ uint8_t rssi_ant_id; @@ -165,10 +179,15 @@ struct bt_df_conn_iq_samples_report { uint8_t packet_status; /** Value of connection event counter when the CTE was received and sampled. */ uint16_t conn_evt_counter; + /** Type of IQ samples provided in a report. */ + enum bt_df_iq_sample sample_type; /** Number of IQ samples in report. */ uint8_t sample_count; - /** Pinter to IQ samples data. */ - struct bt_hci_le_iq_sample const *sample; + /** Pointer to IQ samples data. */ + union { + struct bt_hci_le_iq_sample const *sample; + struct bt_hci_le_iq_sample16 const *sample16; + }; }; /** Constant Tone Extension parameters for CTE transmission in connected mode. */ struct bt_df_conn_cte_tx_param { diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 3fb0c552a8f..eaf8a8337fb 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -702,6 +702,28 @@ config BT_DF_CTE_TX_AOD Enable support for antenna switching during CTE transmission. Also known as Angle of Departure mode. +config BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES + bool "Use 16 bits signed integer IQ samples in connectionless IQ reports" + depends on BT_DF_CONNECTIONLESS_CTE_RX && BT_HCI_VS_EXT + select BT_HCI_VS_EVT + help + Direction Finging connectionless IQ reports provide a set of IQ samples collected during + sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed + integer, see Vol 4, Part E section 7.7.65.21. This option enables a vendor specific Host + extenstion to handle connectionless IQ reports with samples that are in 16 bit signed + integer format. + +config BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES + bool "Use 16 bits signed integer IQ samples in connection IQ reports" + depends on BT_DF_CONNECTION_CTE_RX && BT_HCI_VS_EXT + select BT_HCI_VS_EVT + help + Direction Finging connection IQ reports provide a set of IQ samples collected during + sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed + integer, see Vol 4, Part E sections 7.7.65.22. This option enables a vendor specific Host + extenstion to handle connection IQ report with samples that are in 16 bit signed integer + format. + config BT_DEBUG_DF bool "Bluetooth Direction Finding debug" help diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 95a0ae56153..46e7f50eb58 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -3026,16 +3026,28 @@ int bt_conn_init(void) } #if defined(CONFIG_BT_DF_CONNECTION_CTE_RX) -void bt_hci_le_df_connection_iq_report(struct net_buf *buf) +void bt_hci_le_df_connection_iq_report_common(uint8_t event, struct net_buf *buf) { struct bt_df_conn_iq_samples_report iq_report; struct bt_conn *conn; struct bt_conn_cb *cb; int err; - err = hci_df_prepare_connection_iq_report(buf, &iq_report, &conn); - if (err) { - BT_ERR("Prepare CTE conn IQ report failed %d", err); + if (event == BT_HCI_EVT_LE_CONNECTION_IQ_REPORT) { + err = hci_df_prepare_connection_iq_report(buf, &iq_report, &conn); + if (err) { + BT_ERR("Prepare CTE conn IQ report failed %d", err); + return; + } + } else if (IS_ENABLED(CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) && + event == BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT) { + err = hci_df_vs_prepare_connection_iq_report(buf, &iq_report, &conn); + if (err) { + BT_ERR("Prepare CTE conn IQ report failed %d", err); + return; + } + } else { + BT_ERR("Unhandled VS connection IQ report"); return; } @@ -3054,6 +3066,18 @@ void bt_hci_le_df_connection_iq_report(struct net_buf *buf) bt_conn_unref(conn); } + +void bt_hci_le_df_connection_iq_report(struct net_buf *buf) +{ + bt_hci_le_df_connection_iq_report_common(BT_HCI_EVT_LE_CONNECTION_IQ_REPORT, buf); +} + +#if defined(CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) +void bt_hci_le_vs_df_connection_iq_report(struct net_buf *buf) +{ + bt_hci_le_df_connection_iq_report_common(BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT, buf); +} +#endif /* CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ #endif /* CONFIG_BT_DF_CONNECTION_CTE_RX */ #if defined(CONFIG_BT_DF_CONNECTION_CTE_REQ) diff --git a/subsys/bluetooth/host/direction.c b/subsys/bluetooth/host/direction.c index dad6b9b2a60..495e3b4dbeb 100644 --- a/subsys/bluetooth/host/direction.c +++ b/subsys/bluetooth/host/direction.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "hci_core.h" @@ -407,6 +408,7 @@ int hci_df_prepare_connectionless_iq_report(struct net_buf *buf, report->packet_status = evt->packet_status; report->slot_durations = evt->slot_durations; report->per_evt_counter = sys_le16_to_cpu(evt->per_evt_counter); + report->sample_type = BT_DF_IQ_SAMPLE_8_BITS_INT; report->sample_count = evt->sample_count; report->sample = &evt->sample[0]; @@ -414,6 +416,54 @@ int hci_df_prepare_connectionless_iq_report(struct net_buf *buf, return 0; } + +int hci_df_vs_prepare_connectionless_iq_report(struct net_buf *buf, + struct bt_df_per_adv_sync_iq_samples_report *report, + struct bt_le_per_adv_sync **per_adv_sync_to_report) +{ + struct bt_hci_evt_vs_le_connectionless_iq_report *evt; + struct bt_le_per_adv_sync *per_adv_sync; + + if (buf->len < sizeof(*evt)) { + BT_ERR("Unexpected end of buffer"); + return -EINVAL; + } + + evt = net_buf_pull_mem(buf, sizeof(*evt)); + + per_adv_sync = bt_hci_get_per_adv_sync(sys_le16_to_cpu(evt->sync_handle)); + + if (!per_adv_sync) { + BT_ERR("Unknown handle 0x%04X for iq samples report", + sys_le16_to_cpu(evt->sync_handle)); + return -EINVAL; + } + + if (!atomic_test_bit(per_adv_sync->flags, BT_PER_ADV_SYNC_CTE_ENABLED)) { + BT_ERR("Received PA CTE report when CTE receive disabled"); + return -EINVAL; + } + + if (!(per_adv_sync->cte_types & BIT(evt->cte_type))) { + BT_DBG("CTE filtered out by cte_type: %u", evt->cte_type); + return -EINVAL; + } + + report->chan_idx = evt->chan_idx; + report->rssi = sys_le16_to_cpu(evt->rssi); + report->rssi_ant_id = evt->rssi_ant_id; + report->cte_type = BIT(evt->cte_type); + report->packet_status = evt->packet_status; + report->slot_durations = evt->slot_durations; + report->per_evt_counter = sys_le16_to_cpu(evt->per_evt_counter); + report->sample_count = evt->sample_count; + report->sample_type = BT_DF_IQ_SAMPLE_16_BITS_INT; + report->sample16 = &evt->sample[0]; + + *per_adv_sync_to_report = per_adv_sync; + + return 0; +} #endif /* CONFIG_BT_DF_CONNECTIONLESS_CTE_RX */ #if defined(CONFIG_BT_DF_CONNECTION_CTE_TX) @@ -657,6 +707,7 @@ int hci_df_prepare_connection_iq_report(struct net_buf *buf, report->packet_status = evt->packet_status; report->slot_durations = evt->slot_durations; report->conn_evt_counter = sys_le16_to_cpu(evt->conn_evt_counter); + report->sample_type = BT_DF_IQ_SAMPLE_8_BITS_INT; report->sample_count = evt->sample_count; report->sample = evt->sample; @@ -664,6 +715,57 @@ int hci_df_prepare_connection_iq_report(struct net_buf *buf, return 0; } + +int hci_df_vs_prepare_connection_iq_report(struct net_buf *buf, + struct bt_df_conn_iq_samples_report *report, + struct bt_conn **conn_to_report) +{ + struct bt_hci_evt_vs_le_connection_iq_report *evt; + struct bt_conn *conn; + + if (buf->len < sizeof(*evt)) { + BT_ERR("Unexpected end of buffer"); + return -EINVAL; + } + + evt = net_buf_pull_mem(buf, sizeof(*evt)); + + conn = bt_conn_lookup_handle(sys_le16_to_cpu(evt->conn_handle)); + if (!conn) { + BT_ERR("Unknown conn handle 0x%04X for iq samples report", + sys_le16_to_cpu(evt->conn_handle)); + return -EINVAL; + } + + if (!atomic_test_bit(conn->flags, BT_CONN_CTE_RX_ENABLED)) { + BT_ERR("Received conn CTE report when CTE receive disabled"); + return -EINVAL; + } + + if (!(conn->cte_types & BIT(evt->cte_type))) { + BT_DBG("CTE filtered out by cte_type: %u", evt->cte_type); + return -EINVAL; + } + + report->err = BT_DF_IQ_REPORT_ERR_SUCCESS; + report->chan_idx = evt->data_chan_idx; + report->rx_phy = evt->rx_phy; + report->chan_idx = evt->data_chan_idx; + report->rssi = evt->rssi; + report->rssi_ant_id = evt->rssi_ant_id; + report->cte_type = BIT(evt->cte_type); + report->packet_status = evt->packet_status; + report->slot_durations = evt->slot_durations; + report->conn_evt_counter = sys_le16_to_cpu(evt->conn_evt_counter); + report->sample_type = BT_DF_IQ_SAMPLE_16_BITS_INT; + report->sample_count = evt->sample_count; + report->sample16 = evt->sample; + + *conn_to_report = conn; + + return 0; +} + #endif /* CONFIG_BT_DF_CONNECTION_CTE_RX */ #if defined(CONFIG_BT_DF_CONNECTION_CTE_REQ) diff --git a/subsys/bluetooth/host/direction_internal.h b/subsys/bluetooth/host/direction_internal.h index 4e05a1ce500..30284f402d4 100644 --- a/subsys/bluetooth/host/direction_internal.h +++ b/subsys/bluetooth/host/direction_internal.h @@ -10,9 +10,15 @@ int le_df_init(void); int hci_df_prepare_connectionless_iq_report(struct net_buf *buf, struct bt_df_per_adv_sync_iq_samples_report *report, struct bt_le_per_adv_sync **per_adv_sync_to_report); +int hci_df_vs_prepare_connectionless_iq_report(struct net_buf *buf, + struct bt_df_per_adv_sync_iq_samples_report *report, + struct bt_le_per_adv_sync **per_adv_sync_to_report); int hci_df_prepare_connection_iq_report(struct net_buf *buf, struct bt_df_conn_iq_samples_report *report, struct bt_conn **conn_to_report); +int hci_df_vs_prepare_connection_iq_report(struct net_buf *buf, + struct bt_df_conn_iq_samples_report *report, + struct bt_conn **conn_to_report); int hci_df_prepare_conn_cte_req_failed(struct net_buf *buf, struct bt_df_conn_iq_samples_report *report, struct bt_conn **conn_to_report); diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 9b1554d027f..c9c61b529ee 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -140,9 +140,8 @@ struct event_handler { .min_len = _min_len, \ } -static inline void handle_event(uint8_t event, struct net_buf *buf, - const struct event_handler *handlers, - size_t num_handlers) +static int handle_event_common(uint8_t event, struct net_buf *buf, + const struct event_handler *handlers, size_t num_handlers) { size_t i; @@ -156,15 +155,41 @@ static inline void handle_event(uint8_t event, struct net_buf *buf, if (buf->len < handler->min_len) { BT_ERR("Too small (%u bytes) event 0x%02x", buf->len, event); - return; + return -EINVAL; } handler->handler(buf); - return; + return 0; + } + + return -EOPNOTSUPP; +} + +static void handle_event(uint8_t event, struct net_buf *buf, const struct event_handler *handlers, + size_t num_handlers) +{ + int err; + + err = handle_event_common(event, buf, handlers, num_handlers); + if (err == -EOPNOTSUPP) { + BT_WARN("Unhandled event 0x%02x len %u: %s", event, buf->len, + bt_hex(buf->data, buf->len)); + } + + /* Other possible errors are handled by handle_event_common function */ +} + +static void handle_vs_event(uint8_t event, struct net_buf *buf, + const struct event_handler *handlers, size_t num_handlers) +{ + int err; + + err = handle_event_common(event, buf, handlers, num_handlers); + if (err == -EOPNOTSUPP) { + BT_WARN("Unhandled vendor-specific event: %s", bt_hex(buf->data, buf->len)); } - BT_WARN("Unhandled event 0x%02x len %u: %s", event, - buf->len, bt_hex(buf->data, buf->len)); + /* Other possible errors are handled by handle_event_common function */ } #if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL) @@ -2129,6 +2154,18 @@ int bt_hci_register_vnd_evt_cb(bt_hci_vnd_evt_cb_t cb) } #endif /* CONFIG_BT_HCI_VS_EVT_USER */ +static const struct event_handler vs_events[] = { +#if defined(CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) + EVENT_HANDLER(BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT, + bt_hci_le_vs_df_connectionless_iq_report, + sizeof(struct bt_hci_evt_vs_le_connectionless_iq_report)), +#endif /* CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ +#if defined(CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) + EVENT_HANDLER(BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT, bt_hci_le_vs_df_connection_iq_report, + sizeof(struct bt_hci_evt_vs_le_connection_iq_report)), +#endif /* CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ +}; + static void hci_vendor_event(struct net_buf *buf) { bool handled = false; @@ -2145,10 +2182,14 @@ static void hci_vendor_event(struct net_buf *buf) } #endif /* CONFIG_BT_HCI_VS_EVT_USER */ - if (IS_ENABLED(CONFIG_BT_HCI_VS_EXT) && !handled) { - /* do nothing at present time */ - BT_WARN("Unhandled vendor-specific event: %s", - bt_hex(buf->data, buf->len)); + if (IS_ENABLED(CONFIG_BT_HCI_VS_EVT) && !handled) { + struct bt_hci_evt_vs *evt; + + evt = net_buf_pull_mem(buf, sizeof(*evt)); + + BT_DBG("subevent 0x%02x", evt->subevent); + + handle_vs_event(evt->subevent, buf, vs_events, ARRAY_SIZE(vs_events)); } } diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 68e757cd6c1..8890f76ce2a 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -458,6 +458,7 @@ void bt_hci_le_per_adv_report(struct net_buf *buf); void bt_hci_le_per_adv_sync_lost(struct net_buf *buf); void bt_hci_le_biginfo_adv_report(struct net_buf *buf); void bt_hci_le_df_connectionless_iq_report(struct net_buf *buf); +void bt_hci_le_vs_df_connectionless_iq_report(struct net_buf *buf); void bt_hci_le_past_received(struct net_buf *buf); /* Adv HCI event handlers */ @@ -480,4 +481,5 @@ void bt_hci_role_change(struct net_buf *buf); void bt_hci_synchronous_conn_complete(struct net_buf *buf); void bt_hci_le_df_connection_iq_report(struct net_buf *buf); +void bt_hci_le_vs_df_connection_iq_report(struct net_buf *buf); void bt_hci_le_df_cte_req_failed(struct net_buf *buf); diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index f0b465106ba..95901952ef7 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include "hci_core.h" #include "conn_internal.h" @@ -1099,7 +1101,7 @@ void bt_hci_le_biginfo_adv_report(struct net_buf *buf) } #endif /* CONFIG_BT_ISO_BROADCAST */ #if defined(CONFIG_BT_DF_CONNECTIONLESS_CTE_RX) -void bt_hci_le_df_connectionless_iq_report(struct net_buf *buf) +static void bt_hci_le_df_connectionless_iq_report_common(uint8_t event, struct net_buf *buf) { int err; @@ -1107,9 +1109,21 @@ void bt_hci_le_df_connectionless_iq_report(struct net_buf *buf) struct bt_le_per_adv_sync *per_adv_sync; struct bt_le_per_adv_sync_cb *listener; - err = hci_df_prepare_connectionless_iq_report(buf, &cte_report, &per_adv_sync); - if (err) { - BT_ERR("Prepare CTE conn IQ report failed %d", err); + if (event == BT_HCI_EVT_LE_CONNECTIONLESS_IQ_REPORT) { + err = hci_df_prepare_connectionless_iq_report(buf, &cte_report, &per_adv_sync); + if (err) { + BT_ERR("Prepare CTE conn IQ report failed %d", err); + return; + } + } else if (IS_ENABLED(CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) && + event == BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT) { + err = hci_df_vs_prepare_connectionless_iq_report(buf, &cte_report, &per_adv_sync); + if (err) { + BT_ERR("Prepare CTE conn IQ report failed %d", err); + return; + } + } else { + BT_ERR("Unhandled VS connectionless IQ report"); return; } @@ -1119,6 +1133,19 @@ void bt_hci_le_df_connectionless_iq_report(struct net_buf *buf) } } } + +void bt_hci_le_df_connectionless_iq_report(struct net_buf *buf) +{ + bt_hci_le_df_connectionless_iq_report_common(BT_HCI_EVT_LE_CONNECTIONLESS_IQ_REPORT, buf); +} + +#if defined(CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) +void bt_hci_le_vs_df_connectionless_iq_report(struct net_buf *buf) +{ + bt_hci_le_df_connectionless_iq_report_common(BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT, + buf); +} +#endif /* CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ #endif /* CONFIG_BT_DF_CONNECTIONLESS_CTE_RX */ #endif /* defined(CONFIG_BT_PER_ADV_SYNC) */ #endif /* defined(CONFIG_BT_EXT_ADV) */ From f3904cec2a7afd65751690df8b6309134c8749c1 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Thu, 21 Jul 2022 15:13:05 +0200 Subject: [PATCH 155/501] [nrf fromtree] samples: Bluetooth: df: Add use of 16 bits wide IQ sampels Change implementation of cte_recv_cb to print information about IQ samples type. The changed code is ready for use of 8 bits and 16 bits signed integer IQ samples. User has sample level option to enable printing IQ samples. Signed-off-by: Piotr Pryga Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 6c7ba54f36901613e9fac36742b2a0e188c18a18) --- .../direction_finding_central/Kconfig | 16 +++++++ .../direction_finding_central/src/main.c | 42 ++++++++++++++++--- .../Kconfig | 16 +++++++ .../src/main.c | 35 ++++++++++++++-- 4 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 samples/bluetooth/direction_finding_central/Kconfig create mode 100644 samples/bluetooth/direction_finding_connectionless_rx/Kconfig diff --git a/samples/bluetooth/direction_finding_central/Kconfig b/samples/bluetooth/direction_finding_central/Kconfig new file mode 100644 index 00000000000..51766a41bb0 --- /dev/null +++ b/samples/bluetooth/direction_finding_central/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +menu "Direction Finding Central" +config DF_CENTRAL_APP_IQ_REPORT_PRINT_IQ_SAMPLES + bool "Print IQ samples for received IQ reports" + help + The option enables printing of IQ samples for received IQ report. +endmenu + +menu "Zephyr Kernel" +source "Kconfig.zephyr" +endmenu diff --git a/samples/bluetooth/direction_finding_central/src/main.c b/samples/bluetooth/direction_finding_central/src/main.c index d57e623dd1d..d0a8dd5fd95 100644 --- a/samples/bluetooth/direction_finding_central/src/main.c +++ b/samples/bluetooth/direction_finding_central/src/main.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -16,7 +17,8 @@ #include #include #include -#include +#include +#include /* Latency set to zero, to enforce PDU exchange every connection event */ #define CONN_LATENCY 0U @@ -55,6 +57,18 @@ static const char *cte_type2str(uint8_t type) } } +static const char *sample_type2str(enum bt_df_iq_sample type) +{ + switch (type) { + case BT_DF_IQ_SAMPLE_8_BITS_INT: + return "8 bits int"; + case BT_DF_IQ_SAMPLE_16_BITS_INT: + return "16 bits int"; + default: + return "Unknown"; + } +} + static const char *packet_status2str(uint8_t status) { switch (status) { @@ -237,11 +251,27 @@ static void cte_recv_cb(struct bt_conn *conn, struct bt_df_conn_iq_samples_repor bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); if (report->err == BT_DF_IQ_REPORT_ERR_SUCCESS) { - printk("CTE[%s]: samples count %d, cte type %s, slot durations: %u [us], " - "packet status %s, RSSI %i\n", - addr, report->sample_count, cte_type2str(report->cte_type), - report->slot_durations, packet_status2str(report->packet_status), - report->rssi); + printk("CTE[%s]: samples type: %s, samples count %d, cte type %s, slot durations: " + "%u [us], packet status %s, RSSI %i\n", addr, + sample_type2str(report->sample_type), report->sample_count, + cte_type2str(report->cte_type), report->slot_durations, + packet_status2str(report->packet_status), report->rssi); + + if (IS_ENABLED(CONFIG_DF_CENTRAL_APP_IQ_REPORT_PRINT_IQ_SAMPLES)) { + for (uint8_t idx = 0; idx < report->sample_count; idx++) { + if (report->sample_type == BT_DF_IQ_SAMPLE_8_BITS_INT) { + printk(" IQ[%d]: %d, %d\n", idx, report->sample[idx].i, + report->sample[idx].q); + } else if (IS_ENABLED( + CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES)) { + printk(" IQ[%" PRIu8 "]: %d, %d\n", idx, + report->sample16[idx].i, report->sample16[idx].q); + } else { + printk("Unhandled vendor specific IQ samples type\n"); + break; + } + } + } } else { printk("CTE[%s]: request failed, err %u\n", addr, report->err); } diff --git a/samples/bluetooth/direction_finding_connectionless_rx/Kconfig b/samples/bluetooth/direction_finding_connectionless_rx/Kconfig new file mode 100644 index 00000000000..6045423f659 --- /dev/null +++ b/samples/bluetooth/direction_finding_connectionless_rx/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +menu "DF Connectionless Locator App" +config DF_LOCATOR_APP_IQ_REPORT_PRINT_IQ_SAMPLES + bool "Print IQ samples for received IQ reports" + help + The option enables printing of IQ samples for received IQ report. +endmenu + +menu "Zephyr Kernel" +source "Kconfig.zephyr" +endmenu diff --git a/samples/bluetooth/direction_finding_connectionless_rx/src/main.c b/samples/bluetooth/direction_finding_connectionless_rx/src/main.c index dbc8c818c09..90b83f52ee3 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/src/main.c +++ b/samples/bluetooth/direction_finding_connectionless_rx/src/main.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #define DEVICE_NAME CONFIG_BT_DEVICE_NAME #define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1) @@ -103,6 +105,18 @@ static const char *cte_type2str(uint8_t type) } } +static const char *sample_type2str(enum bt_df_iq_sample type) +{ + switch (type) { + case BT_DF_IQ_SAMPLE_8_BITS_INT: + return "8 bits int"; + case BT_DF_IQ_SAMPLE_16_BITS_INT: + return "16 bits int"; + default: + return "Unknown"; + } +} + static const char *pocket_status2str(uint8_t status) { switch (status) { @@ -183,11 +197,26 @@ static void recv_cb(struct bt_le_per_adv_sync *sync, static void cte_recv_cb(struct bt_le_per_adv_sync *sync, struct bt_df_per_adv_sync_iq_samples_report const *report) { - printk("CTE[%u]: samples count %d, cte type %s, slot durations: %u [us], " + printk("CTE[%u]: samples type: %s, samples count %d, cte type %s, slot durations: %u [us], " "packet status %s, RSSI %i\n", - bt_le_per_adv_sync_get_index(sync), report->sample_count, - cte_type2str(report->cte_type), report->slot_durations, + bt_le_per_adv_sync_get_index(sync), sample_type2str(report->sample_type), + report->sample_count, cte_type2str(report->cte_type), report->slot_durations, pocket_status2str(report->packet_status), report->rssi); + + if (IS_ENABLED(CONFIG_DF_LOCATOR_APP_IQ_REPORT_PRINT_IQ_SAMPLES)) { + for (uint8_t idx = 0; idx < report->sample_count; idx++) { + if (report->sample_type == BT_DF_IQ_SAMPLE_8_BITS_INT) { + printk(" IQ[%d]: %d, %d\n", idx, report->sample[idx].i, + report->sample[idx].q); + } else if (IS_ENABLED(CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES)) { + printk(" IQ[%" PRIu8 "]: %d, %d\n", idx, report->sample16[idx].i, + report->sample16[idx].q); + } else { + printk("Unhandled vendor specific IQ samples type\n"); + break; + } + } + } } static void scan_recv(const struct bt_le_scan_recv_info *info, From 3a5096e6b3747659f93bb3395d4c898d80dc45a5 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Wed, 17 Aug 2022 15:22:51 +0200 Subject: [PATCH 156/501] [nrf fromtree] Bluetooth: hci: df: Fix unnecessary IQ sample storage In case Controller reports to Host insufficient resources to store IQ samples, according to BT 5.3 Core spec. Vol 4, Part E, sections 7.7.65.21 and 7.7.65.22: 1) packet_status shall be set to BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES 2) sample_count shall be set to zero. That means there should be no IQ samples stored in IQ report. HCI implementation stored single IQ sample with value BT_HCI_LE_CTE- _REPORT_NO_VALID_SAMPLE. The commit fixes that. No additional memory is added to event buffer and no IQ sample is stored if sample_count is zero. Also there is added code that handles situation where ULL provides IQ report with packet_status indicating valid IQ samples report but sample_count is zero. In such case Host event stores single IQ sample with value BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE. In case of vendor specific counter part of the event the value is BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE. Signed-off-by: Piotr Pryga Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 88dba2e048394ad103a1b3bbb752c2776f66c2e9) --- subsys/bluetooth/controller/hci/hci.c | 133 ++++++++++++++++---------- 1 file changed, 81 insertions(+), 52 deletions(-) diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index bd11ba75577..86eab0a8dd6 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -2936,11 +2936,15 @@ static void le_df_connectionless_iq_report(struct pdu_data *pdu_rx, } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - /* If there are no IQ samples due to insufficient resources - * HCI event should inform about it by storing single octet with - * special I_sample and Q_sample data. + /* If packet status does not indicate insufficient resources for IQ samples and for + * some reason sample_count is zero, inform Host about lack of valid IQ samples by + * storing single I_sample and Q_sample with BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE value. */ - samples_cnt = MAX(1, iq_report->sample_count); + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + samples_cnt = 0U; + } else { + samples_cnt = MAX(1, iq_report->sample_count); + } sep = meta_evt(buf, BT_HCI_EVT_LE_CONNECTIONLESS_IQ_REPORT, (sizeof(*sep) + @@ -2967,18 +2971,21 @@ static void le_df_connectionless_iq_report(struct pdu_data *pdu_rx, sep->packet_status = iq_report->packet_status; - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - sep->sample[0].i = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample[0].q = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample_count = 0U; - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = iq_convert_12_to_8_bits(iq_report->sample[idx].i); - sep->sample[idx].q = iq_convert_12_to_8_bits(iq_report->sample[idx].q); + if (iq_report->packet_status != BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + if (iq_report->sample_count == 0U) { + sep->sample[0].i = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample[0].q = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = + iq_convert_12_to_8_bits(iq_report->sample[idx].i); + sep->sample[idx].q = + iq_convert_12_to_8_bits(iq_report->sample[idx].q); + } } - - sep->sample_count = samples_cnt; } + + sep->sample_count = samples_cnt; } #endif /* defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT) */ @@ -3061,10 +3068,15 @@ static void le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct net_b return; } - /* If there are no IQ samples due to insufficient resources HCI event should inform about - * it by store single octet with special I_sample and Q_sample data. + /* If packet status does not indicate insufficient resources for IQ samples and for + * some reason sample_count is zero, inform Host about lack of valid IQ samples by + * storing single I_sample and Q_sample with BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE value. */ - samples_cnt = MAX(1, iq_report->sample_count); + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + samples_cnt = 0; + } else { + samples_cnt = MAX(1, iq_report->sample_count); + } sep = meta_evt(buf, BT_HCI_EVT_LE_CONNECTION_IQ_REPORT, (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample)))); @@ -3090,17 +3102,21 @@ static void le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct net_b sep->packet_status = iq_report->packet_status; - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - sep->sample[0].i = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample[0].q = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample_count = 0U; - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = iq_convert_12_to_8_bits(iq_report->sample[idx].i); - sep->sample[idx].q = iq_convert_12_to_8_bits(iq_report->sample[idx].q); + if (iq_report->packet_status != BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + if (iq_report->sample_count == 0U) { + sep->sample[0].i = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample[0].q = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = + iq_convert_12_to_8_bits(iq_report->sample[idx].i); + sep->sample[idx].q = + iq_convert_12_to_8_bits(iq_report->sample[idx].q); + } } - sep->sample_count = samples_cnt; } + + sep->sample_count = samples_cnt; } #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */ @@ -5029,11 +5045,16 @@ static void vs_le_df_connectionless_iq_report(struct pdu_data *pdu_rx, struct no sync_handle = ull_sync_handle_get(sync); per_evt_counter = iq_report->event_counter; - /* If there are no IQ samples due to insufficient resources - * HCI event should inform about it by storing single octet with - * special I_sample and Q_sample data. + /* If packet status does not indicate insufficient resources for IQ samples and for + * some reason sample_count is zero, inform Host about lack of valid IQ samples by + * storing single I_sample and Q_sample with BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE + * value. */ - samples_cnt = MAX(1, iq_report->sample_count); + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + samples_cnt = 0U; + } else { + samples_cnt = MAX(1, iq_report->sample_count); + } sep = vs_event(buf, BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT, (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample16)))); @@ -5058,18 +5079,19 @@ static void vs_le_df_connectionless_iq_report(struct pdu_data *pdu_rx, struct no sep->packet_status = iq_report->packet_status; - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - sep->sample[0].i = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample[0].q = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample_count = 0U; - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); - sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); + if (iq_report->packet_status != BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + if (iq_report->sample_count == 0U) { + sep->sample[0].i = sys_cpu_to_le16(BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE); + sep->sample[0].q = sys_cpu_to_le16(BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE); + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); + sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); + } } - - sep->sample_count = samples_cnt; } + + sep->sample_count = samples_cnt; } #endif /* CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ @@ -5109,10 +5131,15 @@ static void vs_le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct ne return; } - /* If there are no IQ samples due to insufficient resources HCI event should inform about - * it by store single octet with special I_sample and Q_sample data. + /* If packet status does not indicate insufficient resources for IQ samples and for + * some reason sample_count is zero, inform Host about lack of valid IQ samples by + * storing single I_sample and Q_sample with BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE value. */ - samples_cnt = MAX(1, iq_report->sample_count); + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + samples_cnt = 0U; + } else { + samples_cnt = MAX(1, iq_report->sample_count); + } sep = vs_event(buf, BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT, (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample16)))); @@ -5138,17 +5165,19 @@ static void vs_le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct ne sep->packet_status = iq_report->packet_status; - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - sep->sample[0].i = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample[0].q = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample_count = 0U; - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); - sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); + if (iq_report->packet_status != BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + if (iq_report->sample_count == 0U) { + sep->sample[0].i = sys_cpu_to_le16(BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE); + sep->sample[0].q = sys_cpu_to_le16(BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE); + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); + sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); + } } - sep->sample_count = samples_cnt; } + + sep->sample_count = samples_cnt; } #endif /* CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ From b9728601003699ac9c980b55f58b14b8b28b0331 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Thu, 18 Aug 2022 09:52:09 +0200 Subject: [PATCH 157/501] [nrf fromtree] Bluetooth: Remove default n from common Kconfig The commit is a minor refactor of the common Host and Controller Kconfig. There were used "default n" that should be avoided. Signed-off-by: Piotr Pryga Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 360437a5397b1069d8e8ae1f054357ad8bbd7760) --- subsys/bluetooth/common/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 1d4e97648b7..12018059e15 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -224,10 +224,9 @@ config BT_HCI_VS_EVT config BT_HCI_VS_FATAL_ERROR bool "Allow vendor specific HCI event Zephyr Fatal Error" depends on BT_HCI_VS_EXT - default n help - Enable emiting HCI Vendor-Specific events for system and Controller error that are - unrecoverable. + Enable emiting HCI Vendor-Specific events for system and Controller + errors that are unrecoverable. config BT_HCI_VS_EXT_DETECT bool "Use heuristics to guess HCI vendor extensions support in advance" From 1537f3086f55af2a1959b5a6d06579a688f77c88 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 19 Aug 2022 05:19:12 +0530 Subject: [PATCH 158/501] [nrf fromtree] Bluetooth: Controller: Fix regression in adding ADI in scan rsp PDU Fix regression in adding ADI in scan response PDU introduced in implementation adding support for AD data fragment operation. Setting scan response data with ADI failed with too long data error. This was caused by a bug in calculating the offset to the overflow length returned back by the call to set_clear function. Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 156734c8b3a46f1dca51e6eb7bc9882c14b875aa) --- subsys/bluetooth/controller/ll_sw/ull_adv_aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index 1e158fae09a..f9093b1928e 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -818,7 +818,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, ad_len_offset = ULL_ADV_HDR_DATA_DATA_PTR_OFFSET + ULL_ADV_HDR_DATA_DATA_PTR_SIZE; if (hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADI) { - ad_len_offset = + ad_len_offset += ULL_ADV_HDR_DATA_ADI_PTR_OFFSET + ULL_ADV_HDR_DATA_ADI_PTR_SIZE; } From bafe4378602c35b83b0fe6ad91506eb1837671d5 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 4 Aug 2022 15:37:55 +0530 Subject: [PATCH 159/501] [nrf fromtree] Bluetooth: Controller: Use local variable for current PDU's flags Use local variable to update current PDU's Common Extended Header Format flags instead of updating it directly in the PDU buffer. This is required to be able to non-destructively be able to manipulate the PDU's header flags and contents many time before a final commit of the updated PDU. In order to calculate overflowed AD data length, PDU is manipulated couple of times to determine the overflow length and next to be able to add aux ptr field when chain PDU is appended. The changes are now consistent with how Periodic Advertising PDU's Common Extended Header Format is manipulated. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit b2755c66b88879c891b87b46eb3eea6bc97c2337) --- .../bluetooth/controller/ll_sw/ull_adv_aux.c | 177 ++++++++++-------- .../bluetooth/controller/ll_sw/ull_adv_sync.c | 46 +++-- 2 files changed, 126 insertions(+), 97 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index f9093b1928e..2618bcb8113 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -401,7 +401,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, struct pdu_adv_ext_hdr *hdr_chain; struct pdu_adv_aux_ptr *aux_ptr; struct pdu_adv *pdu_chain_prev; - struct pdu_adv_ext_hdr *hdr; + struct pdu_adv_ext_hdr hdr; struct pdu_adv *pdu_chain; uint8_t *dptr_chain; uint32_t offs_us; @@ -415,8 +415,12 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Get reference to flags in superior PDU */ com_hdr = &pdu->adv_ext_ind; - hdr = (void *)&com_hdr->ext_hdr_adv_data[0]; - dptr = (void *)hdr; + if (com_hdr->ext_hdr_len) { + hdr = com_hdr->ext_hdr; + } else { + *(uint8_t *)&hdr = 0U; + } + dptr = com_hdr->ext_hdr.data; /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); @@ -438,14 +442,11 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, *dptr_chain = 0U; /* ADI flag, mandatory if superior PDU has it */ - if (hdr->adi) { + if (hdr.adi) { hdr_chain->adi = 1U; } /* Proceed to next byte if any flags present */ - if (*dptr) { - dptr++; - } if (*dptr_chain) { dptr_chain++; } @@ -453,12 +454,12 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Start adding fields corresponding to flags here, if any */ /* AdvA flag */ - if (hdr->adv_addr) { + if (hdr.adv_addr) { dptr += BDADDR_SIZE; } /* TgtA flag */ - if (hdr->tgt_addr) { + if (hdr.tgt_addr) { dptr += BDADDR_SIZE; } @@ -473,10 +474,11 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, dptr_chain += sizeof(struct pdu_adv_adi); } - /* Finish Common ExtAdv Payload header */ + /* non-connectable non-scannable chain pdu */ com_hdr_chain->adv_mode = 0; - com_hdr_chain->ext_hdr_len = - dptr_chain - &com_hdr_chain->ext_hdr_adv_data[0]; + + /* Calc current chain PDU len */ + sec_len = ull_adv_aux_hdr_len_calc(com_hdr_chain, &dptr_chain); /* Prefix overflowed data to chain PDU and reduce the AD data in * in the current PDU. @@ -519,11 +521,9 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, len = ad_len_chain; } - /* PDU length so far */ - sec_len = dptr_chain - &pdu_chain->payload[0]; - /* Check AdvData overflow */ - if ((sec_len + len) > PDU_AC_PAYLOAD_SIZE_MAX) { + if ((sec_len + ad_len_overflow + len) > + PDU_AC_PAYLOAD_SIZE_MAX) { /* NOTE: latest PDU was not consumed by LLL and * as ull_adv_sync_pdu_alloc() has reverted back * the double buffer with the first PDU, and @@ -538,12 +538,13 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, return BT_HCI_ERR_PACKET_TOO_LONG; } + /* Fill the chain PDU length */ + ull_adv_aux_hdr_len_fill(com_hdr_chain, sec_len); + pdu_chain->len = sec_len + ad_len_overflow + len; + /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); - /* Fill the chain PDU length */ - pdu_chain->len = sec_len + len; - /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + @@ -1023,7 +1024,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, struct pdu_adv_ext_hdr *hdr_chain; struct pdu_adv_aux_ptr *aux_ptr; struct pdu_adv *pdu_chain_prev; - struct pdu_adv_ext_hdr *hdr; + struct pdu_adv_ext_hdr hdr; struct pdu_adv *pdu_chain; uint8_t aux_ptr_offset; uint8_t *dptr_chain; @@ -1042,8 +1043,12 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Get reference to flags in superior PDU */ com_hdr = &sr_pdu->adv_ext_ind; - hdr = (void *)&com_hdr->ext_hdr_adv_data[0]; - dptr = (void *)hdr; + if (com_hdr->ext_hdr_len) { + hdr = com_hdr->ext_hdr; + } else { + *(uint8_t *)&hdr = 0U; + } + dptr = com_hdr->ext_hdr.data; /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); @@ -1065,14 +1070,11 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, *dptr_chain = 0U; /* ADI flag, mandatory if superior PDU has it */ - if (hdr->adi) { + if (hdr.adi) { hdr_chain->adi = 1U; } /* Proceed to next byte if any flags present */ - if (*dptr) { - dptr++; - } if (*dptr_chain) { dptr_chain++; } @@ -1080,12 +1082,12 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Start adding fields corresponding to flags here, if any */ /* AdvA flag */ - if (hdr->adv_addr) { + if (hdr.adv_addr) { dptr += BDADDR_SIZE; } /* TgtA flag */ - if (hdr->tgt_addr) { + if (hdr.tgt_addr) { dptr += BDADDR_SIZE; } @@ -1100,10 +1102,11 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, dptr_chain += sizeof(struct pdu_adv_adi); } - /* Finish Common ExtAdv Payload header */ + /* non-connectable non-scannable chain pdu */ com_hdr_chain->adv_mode = 0; - com_hdr_chain->ext_hdr_len = - dptr_chain - &com_hdr_chain->ext_hdr_adv_data[0]; + + /* Calc current chain PDU len */ + sec_len = ull_adv_aux_hdr_len_calc(com_hdr_chain, &dptr_chain); /* Prefix overflowed data to chain PDU and reduce the AD data in * in the current PDU. @@ -1146,11 +1149,9 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, len = ad_len_chain; } - /* PDU length so far */ - sec_len = dptr_chain - &pdu_chain->payload[0]; - /* Check AdvData overflow */ - if ((sec_len + len) > PDU_AC_PAYLOAD_SIZE_MAX) { + if ((sec_len + ad_len_overflow + len) > + PDU_AC_PAYLOAD_SIZE_MAX) { /* NOTE: latest PDU was not consumed by LLL and * as ull_adv_sync_pdu_alloc() has reverted back * the double buffer with the first PDU, and @@ -1165,12 +1166,13 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, return BT_HCI_ERR_PACKET_TOO_LONG; } + /* Fill the chain PDU length */ + ull_adv_aux_hdr_len_fill(com_hdr_chain, sec_len); + pdu_chain->len = sec_len + ad_len_overflow + len; + /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); - /* Fill the chain PDU length */ - pdu_chain->len = sec_len + len; - /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(sr_pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + @@ -1385,8 +1387,8 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, { struct pdu_adv_com_ext_adv *pri_com_hdr, *pri_com_hdr_prev; struct pdu_adv_com_ext_adv *sec_com_hdr, *sec_com_hdr_prev; - struct pdu_adv_ext_hdr *pri_hdr, pri_hdr_prev; - struct pdu_adv_ext_hdr *sec_hdr, sec_hdr_prev; + struct pdu_adv_ext_hdr *hdr, pri_hdr, pri_hdr_prev; + struct pdu_adv_ext_hdr sec_hdr, sec_hdr_prev; struct pdu_adv *pri_pdu, *pri_pdu_prev; struct pdu_adv *sec_pdu_prev, *sec_pdu; struct pdu_adv_adi *pri_adi, *sec_adi; @@ -1428,13 +1430,13 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, } pri_com_hdr_prev = (void *)&pri_pdu_prev->adv_ext_ind; - pri_hdr = (void *)pri_com_hdr_prev->ext_hdr_adv_data; + hdr = (void *)pri_com_hdr_prev->ext_hdr_adv_data; if (pri_com_hdr_prev->ext_hdr_len) { - pri_hdr_prev = *pri_hdr; + pri_hdr_prev = *hdr; } else { *(uint8_t *)&pri_hdr_prev = 0U; } - pri_dptr_prev = pri_hdr->data; + pri_dptr_prev = hdr->data; /* Advertising data are not supported by scannable instances */ if ((sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AD_DATA) && @@ -1449,9 +1451,9 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, pri_pdu->chan_sel = 0U; pri_com_hdr = (void *)&pri_pdu->adv_ext_ind; pri_com_hdr->adv_mode = pri_com_hdr_prev->adv_mode; - pri_hdr = (void *)pri_com_hdr->ext_hdr_adv_data; - pri_dptr = pri_hdr->data; - *(uint8_t *)pri_hdr = 0U; + hdr = (void *)pri_com_hdr->ext_hdr_adv_data; + pri_dptr = hdr->data; + *(uint8_t *)&pri_hdr = 0U; /* Get the reference to aux instance */ lll_aux = lll->aux; @@ -1474,9 +1476,9 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* Get reference to previous secondary PDU data */ sec_pdu_prev = lll_adv_aux_data_peek(lll_aux); sec_com_hdr_prev = (void *)&sec_pdu_prev->adv_ext_ind; - sec_hdr = (void *)sec_com_hdr_prev->ext_hdr_adv_data; + hdr = (void *)sec_com_hdr_prev->ext_hdr_adv_data; if (!is_aux_new) { - sec_hdr_prev = *sec_hdr; + sec_hdr_prev = *hdr; } else { /* Initialize only those fields used to copy into new PDU * buffer. @@ -1484,9 +1486,10 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, sec_pdu_prev->tx_addr = 0U; sec_pdu_prev->rx_addr = 0U; sec_pdu_prev->len = PDU_AC_EXT_HEADER_SIZE_MIN; + *(uint8_t *)hdr = 0U; *(uint8_t *)&sec_hdr_prev = 0U; } - sec_dptr_prev = sec_hdr->data; + sec_dptr_prev = hdr->data; /* Get reference to new secondary PDU data buffer */ sec_pdu = lll_adv_aux_data_alloc(lll_aux, sec_idx); @@ -1499,9 +1502,9 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, sec_com_hdr = (void *)&sec_pdu->adv_ext_ind; sec_com_hdr->adv_mode = pri_com_hdr->adv_mode; - sec_hdr = (void *)sec_com_hdr->ext_hdr_adv_data; - sec_dptr = sec_hdr->data; - *(uint8_t *)sec_hdr = 0U; + hdr = (void *)sec_com_hdr->ext_hdr_adv_data; + sec_dptr = hdr->data; + *(uint8_t *)&sec_hdr = 0U; /* AdvA flag */ /* NOTE: as we will use auxiliary packet, we remove AdvA in primary @@ -1510,7 +1513,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, * set), can be copied from primary PDU (i.e. adding AD to existing set) * or can be copied from previous secondary PDU. */ - sec_hdr->adv_addr = 1; + sec_hdr.adv_addr = 1; if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADVA) { uint8_t own_addr_type = *(uint8_t *)hdr_data; @@ -1540,14 +1543,14 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, * Move from primary to secondary PDU, if present in primary PDU. */ if (pri_hdr_prev.tgt_addr) { - sec_hdr->tgt_addr = 1U; + sec_hdr.tgt_addr = 1U; sec_pdu->rx_addr = pri_pdu_prev->rx_addr; sec_dptr += BDADDR_SIZE; /* Retain the target address if present in the previous PDU */ } else if (!(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADVA) && sec_hdr_prev.tgt_addr) { - sec_hdr->tgt_addr = 1U; + sec_hdr.tgt_addr = 1U; sec_pdu->rx_addr = sec_pdu_prev->rx_addr; sec_dptr += BDADDR_SIZE; } @@ -1567,10 +1570,10 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (pri_hdr_prev.adi) { pri_dptr_prev += sizeof(struct pdu_adv_adi); } - pri_hdr->adi = 1; + pri_hdr.adi = 1; pri_dptr += sizeof(struct pdu_adv_adi); if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADI) { - sec_hdr->adi = 1U; + sec_hdr.adi = 1U; /* return the size of ADI structure */ *(uint8_t *)hdr_data = sizeof(struct pdu_adv_adi); hdr_data = (uint8_t *)hdr_data + sizeof(uint8_t); @@ -1581,7 +1584,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, hdr_data = (uint8_t *)hdr_data + sizeof(sec_dptr); sec_dptr += sizeof(struct pdu_adv_adi); } else { - sec_hdr->adi = 1; + sec_hdr.adi = 1; adi = NULL; sec_dptr += sizeof(struct pdu_adv_adi); } @@ -1593,11 +1596,11 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (pri_hdr_prev.aux_ptr) { pri_dptr_prev += sizeof(struct pdu_adv_aux_ptr); } - pri_hdr->aux_ptr = 1; + pri_hdr.aux_ptr = 1; pri_dptr += sizeof(struct pdu_adv_aux_ptr); if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AUX_PTR) { - sec_hdr->aux_ptr = 1; + sec_hdr.aux_ptr = 1; aux_ptr = NULL; /* return the size of aux pointer structure */ @@ -1611,7 +1614,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, hdr_data = (uint8_t *)hdr_data + sizeof(sec_dptr); } else if (!(sec_hdr_rem_fields & ULL_ADV_PDU_HDR_FIELD_AUX_PTR) && sec_hdr_prev.aux_ptr) { - sec_hdr->aux_ptr = 1; + sec_hdr.aux_ptr = 1; aux_ptr = (void *)sec_dptr_prev; } else { aux_ptr = NULL; @@ -1619,7 +1622,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (sec_hdr_prev.aux_ptr) { sec_dptr_prev += sizeof(struct pdu_adv_aux_ptr); } - if (sec_hdr->aux_ptr) { + if (sec_hdr.aux_ptr) { sec_dptr += sizeof(struct pdu_adv_aux_ptr); } @@ -1629,7 +1632,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* No SyncInfo flag in primary channel PDU */ /* Add/Remove SyncInfo flag in secondary channel PDU */ if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_SYNC_INFO) { - sec_hdr->sync_info = 1; + sec_hdr.sync_info = 1; sync_info = NULL; /* return the size of sync info structure */ @@ -1643,7 +1646,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, hdr_data = (uint8_t *)hdr_data + sizeof(sec_dptr); } else if (!(sec_hdr_rem_fields & ULL_ADV_PDU_HDR_FIELD_SYNC_INFO) && sec_hdr_prev.sync_info) { - sec_hdr->sync_info = 1; + sec_hdr.sync_info = 1; sync_info = (void *)sec_dptr_prev; } else { sync_info = NULL; @@ -1651,7 +1654,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (sec_hdr_prev.sync_info) { sec_dptr_prev += sizeof(*sync_info); } - if (sec_hdr->sync_info) { + if (sec_hdr.sync_info) { sec_dptr += sizeof(*sync_info); } #endif /* CONFIG_BT_CTLR_ADV_PERIODIC */ @@ -1664,18 +1667,18 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, * reserved for future use on the LE Coded PHY. */ if (lll->phy_p != PHY_CODED) { - pri_hdr->tx_pwr = 1; + pri_hdr.tx_pwr = 1; pri_dptr++; } else { - sec_hdr->tx_pwr = 1; + sec_hdr.tx_pwr = 1; } } if (sec_hdr_prev.tx_pwr) { sec_dptr_prev++; - sec_hdr->tx_pwr = 1; + sec_hdr.tx_pwr = 1; } - if (sec_hdr->tx_pwr) { + if (sec_hdr.tx_pwr) { sec_dptr++; } @@ -1684,10 +1687,6 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* Calc primary PDU len */ pri_len = ull_adv_aux_hdr_len_calc(pri_com_hdr, &pri_dptr); - ull_adv_aux_hdr_len_fill(pri_com_hdr, pri_len); - - /* set the primary PDU len */ - pri_pdu->len = pri_len; /* Calc previous secondary PDU len */ sec_len_prev = ull_adv_aux_hdr_len_calc(sec_com_hdr_prev, @@ -1702,7 +1701,6 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* Calc current secondary PDU len */ sec_len = ull_adv_aux_hdr_len_calc(sec_com_hdr, &sec_dptr); - ull_adv_aux_hdr_len_fill(sec_com_hdr, sec_len); /* AD Data, add or remove */ if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AD_DATA) { @@ -1762,7 +1760,12 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, return BT_HCI_ERR_PACKET_TOO_LONG; } + /* set the primary PDU len */ + ull_adv_aux_hdr_len_fill(pri_com_hdr, pri_len); + pri_pdu->len = pri_len; + /* set the secondary PDU len */ + ull_adv_aux_hdr_len_fill(sec_com_hdr, sec_len); sec_pdu->len = sec_len + ad_len; /* Start filling pri and sec PDU payload based on flags from here @@ -1782,9 +1785,9 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* TODO: Fill ACAD in secondary channel PDU */ /* Tx Power */ - if (pri_hdr->tx_pwr) { + if (pri_hdr.tx_pwr) { *--pri_dptr = *--pri_dptr_prev; - } else if (sec_hdr->tx_pwr) { + } else if (sec_hdr.tx_pwr) { *--sec_dptr = *--sec_dptr_prev; } @@ -1795,7 +1798,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, sec_dptr_prev -= sizeof(*sync_info); } - if (sec_hdr->sync_info) { + if (sec_hdr.sync_info) { sec_dptr -= sizeof(*sync_info); } @@ -1814,7 +1817,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (sec_hdr_prev.aux_ptr) { sec_dptr_prev -= sizeof(struct pdu_adv_aux_ptr); } - if (sec_hdr->aux_ptr) { + if (sec_hdr.aux_ptr) { sec_dptr -= sizeof(struct pdu_adv_aux_ptr); } @@ -1855,7 +1858,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* No TargetA non-conn non-scan advertising, but present in directed * advertising. */ - if (sec_hdr->tgt_addr) { + if (sec_hdr.tgt_addr) { void *bdaddr; if (sec_hdr_prev.tgt_addr) { @@ -1876,7 +1879,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* NOTE: AdvA in aux channel is also filled at enable and RPA * timeout */ - if (sec_hdr->adv_addr) { + if (sec_hdr.adv_addr) { void *bdaddr; if (sec_hdr_prev.adv_addr) { @@ -1892,6 +1895,20 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, (void)memcpy(sec_dptr, bdaddr, BDADDR_SIZE); } + /* Set the common extended header format flags in the current primary + * PDU + */ + if (pri_com_hdr->ext_hdr_len != 0) { + pri_com_hdr->ext_hdr = pri_hdr; + } + + /* Set the common extended header format flags in the current secondary + * PDU + */ + if (sec_com_hdr->ext_hdr_len != 0) { + sec_com_hdr->ext_hdr = sec_hdr; + } + #if defined(CONFIG_BT_CTLR_ADV_AUX_PDU_LINK) ull_adv_aux_chain_pdu_duplicate(sec_pdu_prev, sec_pdu, aux_ptr, adv->lll.phy_s, adv->lll.phy_flags, diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c index 20a45856bc0..66de0bdf350 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c @@ -466,7 +466,7 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, struct pdu_adv_ext_hdr *hdr_chain; struct pdu_adv_aux_ptr *aux_ptr; struct pdu_adv *pdu_chain_prev; - struct pdu_adv_ext_hdr *hdr; + struct pdu_adv_ext_hdr hdr; struct pdu_adv *pdu_chain; uint8_t *dptr_chain; uint32_t offs_us; @@ -480,8 +480,12 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, /* Get reference to flags in superior PDU */ com_hdr = &pdu->adv_ext_ind; - hdr = (void *)&com_hdr->ext_hdr_adv_data[0]; - dptr = (void *)hdr; + if (com_hdr->ext_hdr_len) { + hdr = com_hdr->ext_hdr; + } else { + *(uint8_t *)&hdr = 0U; + } + dptr = com_hdr->ext_hdr.data; /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); @@ -509,14 +513,11 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, */ /* ADI flag, mandatory if superior PDU has it */ - if (hdr->adi) { + if (hdr.adi) { hdr_chain->adi = 1U; } /* Proceed to next byte if any flags present */ - if (*dptr) { - dptr++; - } if (*dptr_chain) { dptr_chain++; } @@ -536,10 +537,11 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, dptr_chain += sizeof(struct pdu_adv_adi); } - /* Finish Common ExtAdv Payload header */ + /* non-connectable non-scannable chain pdu */ com_hdr_chain->adv_mode = 0; - com_hdr_chain->ext_hdr_len = - dptr_chain - &com_hdr_chain->ext_hdr_adv_data[0]; + + /* Calc current chain PDU len */ + ter_len = ull_adv_aux_hdr_len_calc(com_hdr_chain, &dptr_chain); /* Prefix overflowed data to chain PDU and reduce the AD data in * in the current PDU. @@ -583,20 +585,30 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, len = ad_len_chain; } - /* PDU length so far */ - ter_len = dptr_chain - &pdu_chain->payload[0]; - /* Check AdvData overflow */ - if ((ter_len + len) > PDU_AC_PAYLOAD_SIZE_MAX) { + if ((ter_len + ad_len_overflow + len) > + PDU_AC_PAYLOAD_SIZE_MAX) { + /* NOTE: latest PDU was not consumed by LLL and + * as ull_adv_sync_pdu_alloc() has reverted back + * the double buffer with the first PDU, and + * returned the latest PDU as the new PDU, we + * need to enqueue back the new PDU which is + * infact the latest PDU. + */ + if (pdu_prev == pdu) { + lll_adv_sync_data_enqueue(lll_sync, ter_idx); + } + return BT_HCI_ERR_PACKET_TOO_LONG; } + /* Fill the chain PDU length */ + ull_adv_aux_hdr_len_fill(com_hdr_chain, ter_len); + pdu_chain->len = ter_len + ad_len_overflow + len; + /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); - /* Fill the chain PDU length */ - pdu_chain->len = ter_len + len; - /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + From eed15a0fdce90dbfd7b08ff3c4d781475b895489 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 4 Aug 2022 15:46:29 +0530 Subject: [PATCH 160/501] [nrf fromtree] Bluetooth: Controller: Fix parent PDU's aux offset in aux ptr field Fix Extended Advertising and Periodic Advertising's parent PDU's aux ptr field to contain correct aux offset value to its chain PDU. Uninitialized pointer reference to aux ptr in the parent PDU was used before the pointer reference was returned by the function adding the aux ptr fields in the parent PDU. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 06085cb5b9b5045cb62a7e1c0618b9318fac716e) --- .../bluetooth/controller/ll_sw/ull_adv_aux.c | 28 +++++++++---------- .../bluetooth/controller/ll_sw/ull_adv_sync.c | 10 +++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index 2618bcb8113..a57467d8c7a 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -408,11 +408,6 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, uint16_t sec_len; uint8_t *dptr; - /* Get reference to aux ptr in superior PDU */ - (void)memcpy(&aux_ptr, - &hdr_data[ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET], - sizeof(aux_ptr)); - /* Get reference to flags in superior PDU */ com_hdr = &pdu->adv_ext_ind; if (com_hdr->ext_hdr_len) { @@ -545,6 +540,11 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); + /* Get reference to aux ptr in superior PDU */ + (void)memcpy(&aux_ptr, + &hdr_data[ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET], + sizeof(aux_ptr)); + /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + @@ -1032,15 +1032,6 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, uint16_t sec_len; uint8_t *dptr; - /* Get reference to aux ptr in superior PDU */ - aux_ptr_offset = ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET; - if (hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADI) { - aux_ptr_offset += ULL_ADV_HDR_DATA_ADI_PTR_OFFSET + - ULL_ADV_HDR_DATA_ADI_PTR_SIZE; - } - (void)memcpy(&aux_ptr, &hdr_data[aux_ptr_offset], - sizeof(aux_ptr)); - /* Get reference to flags in superior PDU */ com_hdr = &sr_pdu->adv_ext_ind; if (com_hdr->ext_hdr_len) { @@ -1173,6 +1164,15 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); + /* Get reference to aux ptr in superior PDU */ + aux_ptr_offset = ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET; + if (hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADI) { + aux_ptr_offset += ULL_ADV_HDR_DATA_ADI_PTR_OFFSET + + ULL_ADV_HDR_DATA_ADI_PTR_SIZE; + } + (void)memcpy(&aux_ptr, &hdr_data[aux_ptr_offset], + sizeof(aux_ptr)); + /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(sr_pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c index 66de0bdf350..50f0e283031 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c @@ -473,11 +473,6 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, uint16_t ter_len; uint8_t *dptr; - /* Get reference to aux ptr in superior PDU */ - (void)memcpy(&aux_ptr, - &hdr_data[ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET], - sizeof(aux_ptr)); - /* Get reference to flags in superior PDU */ com_hdr = &pdu->adv_ext_ind; if (com_hdr->ext_hdr_len) { @@ -609,6 +604,11 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); + /* Get reference to aux ptr in superior PDU */ + (void)memcpy(&aux_ptr, + &hdr_data[ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET], + sizeof(aux_ptr)); + /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + From 1e1272d15559a33df6b8350d1b5f7a2c331d0a31 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 23 Aug 2022 12:48:37 +0530 Subject: [PATCH 161/501] [nrf fromtree] Bluetooth: Controller: Enable back-to-back PDU chaining When AD data length of greater than 191 bytes support is enabled then default to using the back-to-back PDU chaining feature in the Controller. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 778b23f44a760eaf8332b5ab5f2b109718b278eb) --- subsys/bluetooth/controller/Kconfig.ll_sw_split | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 66f297c8a06..631ca84908e 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -207,6 +207,7 @@ config BT_CTLR_ADV_AUX_PDU_BACK2BACK bool "Back-to-back transmission of extended advertising trains" depends on BT_BROADCASTER && BT_CTLR_ADV_EXT select BT_CTLR_ADV_AUX_PDU_LINK + default y if BT_CTLR_ADV_DATA_LEN_MAX > 191 help Enables transmission of AUX_CHAIN_IND in extended advertising train by sending each AUX_CHAIN_IND one after another back-to-back. @@ -215,6 +216,7 @@ config BT_CTLR_ADV_AUX_PDU_BACK2BACK_AFS int "AUX Frame Space for back-to-back transmission of extended advertising trains" depends on BT_CTLR_ADV_AUX_PDU_BACK2BACK range 300 1000 + default 300 help Specific AUX Frame Space to be used for back-to-back transmission of extended advertising trains. Time specified in microseconds. From 55b50b851c576129fcc178e980e90ec5c3886092 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 4 Sep 2021 07:40:00 +0530 Subject: [PATCH 162/501] [nrf fromtree] samples: Bluetooth: Multiple Broadcaster Added Extended Advertising multiple advertising set broadcaster sample. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit d1c859b47f37e5b5710e15ee78edb239cd44f60e) --- .../broadcaster_multiple/CMakeLists.txt | 7 ++ .../bluetooth/broadcaster_multiple/README.rst | 36 ++++++ .../bluetooth/broadcaster_multiple/prj.conf | 23 ++++ .../broadcaster_multiple/sample.yaml | 7 ++ .../bluetooth/broadcaster_multiple/src/main.c | 115 ++++++++++++++++++ 5 files changed, 188 insertions(+) create mode 100644 samples/bluetooth/broadcaster_multiple/CMakeLists.txt create mode 100644 samples/bluetooth/broadcaster_multiple/README.rst create mode 100644 samples/bluetooth/broadcaster_multiple/prj.conf create mode 100644 samples/bluetooth/broadcaster_multiple/sample.yaml create mode 100644 samples/bluetooth/broadcaster_multiple/src/main.c diff --git a/samples/bluetooth/broadcaster_multiple/CMakeLists.txt b/samples/bluetooth/broadcaster_multiple/CMakeLists.txt new file mode 100644 index 00000000000..94ae548608b --- /dev/null +++ b/samples/bluetooth/broadcaster_multiple/CMakeLists.txt @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(broadcaster_multiple) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/bluetooth/broadcaster_multiple/README.rst b/samples/bluetooth/broadcaster_multiple/README.rst new file mode 100644 index 00000000000..fd0e9cf786f --- /dev/null +++ b/samples/bluetooth/broadcaster_multiple/README.rst @@ -0,0 +1,36 @@ +.. _bluetooth-broadcaster-multiple-sample: + +Bluetooth: Multiple Broadcaster +############################### + +Overview +******** + +A simple application demonstrating the Bluetooth Low Energy Broadcaster that +uses multiple advertising sets functionality. + +This sample advertises two non-connectable non-scannable advertising sets with +two different SID. Number of advertising sets can be increased by updating the +`CONFIG_BT_EXT_ADV_MAX_ADV_SET` value in the project configuration file. + +When building this sample combined with a Bluetooth LE Controller, the +advertising data length can be increased from the default 31 bytes by updating +the Controller's `CONFIG_BT_CTLR_ADV_DATA_LEN_MAX` value. The size of the +manufacturer data is calculated to maximize the use of supported AD data length. + +Requirements +************ + +* A board with Bluetooth Low Energy with Extended Advertising support. + +Building and Running +******************** + +This sample can be found under +:zephyr_file:`samples/bluetooth/broadcaster_multiple` in the Zephyr tree. + +To test this sample use the Observer sample with Extended Scanning enabled, +found under +:zephyr_file:`samples/bluetooth/observer` in the Zephyr tree. + +See :ref:`Bluetooth samples section ` for details. diff --git a/samples/bluetooth/broadcaster_multiple/prj.conf b/samples/bluetooth/broadcaster_multiple/prj.conf new file mode 100644 index 00000000000..efce4351c11 --- /dev/null +++ b/samples/bluetooth/broadcaster_multiple/prj.conf @@ -0,0 +1,23 @@ +CONFIG_BT=y +CONFIG_BT_BROADCASTER=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_EXT_ADV_MAX_ADV_SET=2 +CONFIG_BT_DEVICE_NAME="Broadcaster Multiple" + +CONFIG_BT_DEBUG_LOG=y + +# Zephyr Bluetooth LE Controller will need to use chain PDUs when AD data +# length > 191 bytes +# - 31 bytes will use 22 bytes for the default name in this sample plus 9 bytes +# for manufacturer data +# - 191 bytes will use 22 bytes for the default name in this sample plus 169 +# bytes for manufacturer data +# - 277 bytes will use 22 bytes for the default name in this sample plus 255 +# bytes for manufacturer data +# CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=192 + +# Increase Advertising PDU buffers to number of advertising sets times the +# number of chain PDUs per advertising set when using Zephyr Bluetooth LE +# Controller +# CONFIG_BT_CTLR_ADVANCED_FEATURES=y +# CONFIG_BT_CTLR_ADV_DATA_BUF_MAX=2 diff --git a/samples/bluetooth/broadcaster_multiple/sample.yaml b/samples/bluetooth/broadcaster_multiple/sample.yaml new file mode 100644 index 00000000000..16f9e007d66 --- /dev/null +++ b/samples/bluetooth/broadcaster_multiple/sample.yaml @@ -0,0 +1,7 @@ +sample: + name: Bluetooth Multiple Extended Advertising Broadcaster +tests: + sample.bluetooth.multiple_broadcast: + harness: bluetooth + platform_allow: qemu_cortex_m3 qemu_x86 nrf51dk_nrf51422 nrf52_bsim nrf52dk_nrf52832 + tags: bluetooth diff --git a/samples/bluetooth/broadcaster_multiple/src/main.c b/samples/bluetooth/broadcaster_multiple/src/main.c new file mode 100644 index 00000000000..984d8ac3aed --- /dev/null +++ b/samples/bluetooth/broadcaster_multiple/src/main.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +/* Maximum supported AD data length, use a value supported by the Controller, + * Bluetooth Core Specification define minimum of 31 bytes will be supported by + * all Controllers, can be a maximum of 1650 bytes when supported. + */ +#if defined(CONFIG_BT_CTLR_ADV_DATA_LEN_MAX) +#define BT_AD_DATA_LEN_MAX CONFIG_BT_CTLR_ADV_DATA_LEN_MAX +#else +#define BT_AD_DATA_LEN_MAX 31U +#endif + +/* Size of AD data format length field in octets */ +#define BT_AD_DATA_FORMAT_LEN_SIZE 1U + +/* Size of AD data format type field in octets */ +#define BT_AD_DATA_FORMAT_TYPE_SIZE 1U + +/* Maximum value of AD data format length field (8-bit) */ +#define BT_AD_DATA_FORMAT_LEN_MAX 255U + +/* Device name length, size minus one null character */ +#define BT_DEVICE_NAME_LEN (sizeof(CONFIG_BT_DEVICE_NAME) - 1U) + +/* Device name length in AD data format, 2 bytes for length and type overhead */ +#define BT_DEVICE_NAME_AD_DATA_LEN (BT_AD_DATA_FORMAT_LEN_SIZE + \ + BT_AD_DATA_FORMAT_TYPE_SIZE + \ + BT_DEVICE_NAME_LEN) + +/* Maximum manufacturer data length, considering ad data format overhead and + * the included device name in ad data format. + */ +#define BT_MFG_DATA_LEN_MAX (MIN((BT_AD_DATA_FORMAT_LEN_MAX - \ + BT_AD_DATA_FORMAT_TYPE_SIZE), \ + (BT_AD_DATA_LEN_MAX - \ + BT_AD_DATA_FORMAT_LEN_SIZE - \ + BT_AD_DATA_FORMAT_TYPE_SIZE))) +#define BT_MFG_DATA_LEN (MIN(BT_MFG_DATA_LEN_MAX, \ + (BT_AD_DATA_LEN_MAX - \ + BT_AD_DATA_FORMAT_LEN_SIZE - \ + BT_AD_DATA_FORMAT_TYPE_SIZE - \ + BT_DEVICE_NAME_AD_DATA_LEN))) + +static uint8_t mfg_data[BT_MFG_DATA_LEN] = { 0xFF, 0xFF, }; + +static const struct bt_data ad[] = { + BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)), +}; + +static struct bt_le_ext_adv *adv[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; + +void main(void) +{ + struct bt_le_adv_param adv_param = { + .id = BT_ID_DEFAULT, + .sid = 0U, /* Supply unique SID when creating advertising set */ + .secondary_max_skip = 0U, + .options = (BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME), + .interval_min = BT_GAP_ADV_FAST_INT_MIN_2, + .interval_max = BT_GAP_ADV_FAST_INT_MAX_2, + .peer = NULL, + }; + int err; + + printk("Starting Multiple Broadcaster Demo\n"); + + /* Initialize the Bluetooth Subsystem */ + err = bt_enable(NULL); + if (err) { + printk("Bluetooth init failed (err %d)\n", err); + return; + } + + for (int index = 0; index < CONFIG_BT_EXT_ADV_MAX_ADV_SET; index++) { + /* Use advertising set instance index as SID */ + adv_param.sid = index; + + /* Create a non-connectable non-scannable advertising set */ + err = bt_le_ext_adv_create(&adv_param, NULL, &adv[index]); + if (err) { + printk("Failed to create advertising set %d (err %d)\n", + index, err); + return; + } + + /* Set extended advertising data */ + err = bt_le_ext_adv_set_data(adv[index], ad, ARRAY_SIZE(ad), + NULL, 0); + if (err) { + printk("Failed to set advertising data for set %d " + "(err %d)\n", index, err); + return; + } + + /* Start extended advertising set */ + err = bt_le_ext_adv_start(adv[index], + BT_LE_EXT_ADV_START_DEFAULT); + if (err) { + printk("Failed to start extended advertising set %d " + "(err %d)\n", index, err); + return; + } + + printk("Started Extended Advertising Set %d.\n", index); + } + + printk("Exiting %s thread.\n", __func__); +} From b294d48ab9a10e04b9265b85e94854f5750c4778 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 5 Aug 2022 11:03:27 +0530 Subject: [PATCH 163/501] [nrf fromtree] samples: Bluetooth: Add Extended Scanning support to Observer sample Added implementation to Observer sample so that when Extended Advertising feature is enabled, it can receive Extended Advertising Reports, and hence receive long AD data from peer Extended Advertising Broadcaster Multiple sample. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit d9b3534507b7cf7e831d27d96740bf3cef7a1453) --- samples/bluetooth/observer/README.rst | 18 +++-- samples/bluetooth/observer/prj_extended.conf | 17 +++++ samples/bluetooth/observer/sample.yaml | 7 +- samples/bluetooth/observer/src/main.c | 80 +++++++++++++++++++- 4 files changed, 110 insertions(+), 12 deletions(-) create mode 100644 samples/bluetooth/observer/prj_extended.conf diff --git a/samples/bluetooth/observer/README.rst b/samples/bluetooth/observer/README.rst index bdec8f79d51..3eb171a691a 100644 --- a/samples/bluetooth/observer/README.rst +++ b/samples/bluetooth/observer/README.rst @@ -1,20 +1,24 @@ .. _bluetooth-observer-sample: Bluetooth: Observer -########################### +################### Overview ******** -A simple application demonstrating Bluetooth Low Energy Observer role functionality -The application will periodically scan for devices nearby. If any found, -prints the address of the device and the RSSI value to the UART terminal. +A simple application demonstrating Bluetooth Low Energy Observer role +functionality. The application will periodically scan for devices nearby. +If any found, prints the address of the device, the RSSI value, the Advertising +type, and the Advertising data length to the console. + +If the used Bluetooth Low Energy Controller supports Extended Scanning, you may +enable `CONFIG_BT_EXT_ADV` in the project configuration file. Refer to the +project configuration file for further details. Requirements ************ -* BlueZ running on the host, or -* A board with BLE support +* A board with Bluetooth Low Energy support Building and Running ******************** @@ -22,4 +26,4 @@ Building and Running This sample can be found under :zephyr_file:`samples/bluetooth/observer` in the Zephyr tree. -See :ref:`bluetooth samples section ` for details. +See :ref:`Bluetooth samples section ` for details. diff --git a/samples/bluetooth/observer/prj_extended.conf b/samples/bluetooth/observer/prj_extended.conf new file mode 100644 index 00000000000..cab86c38d14 --- /dev/null +++ b/samples/bluetooth/observer/prj_extended.conf @@ -0,0 +1,17 @@ +CONFIG_BT=y +CONFIG_BT_OBSERVER=y + +# Enable Extended Scanning +CONFIG_BT_EXT_ADV=y +CONFIG_BT_EXT_SCAN_BUF_SIZE=1650 + +# Zephyr Bluetooth LE Controller needs 16 event buffers to generate Extended +# Advertising Report for receiving the complete 1650 bytes of data +CONFIG_BT_BUF_EVT_RX_COUNT=16 + +# Set maximum scan data length for Extended Scanning in Bluetooth LE Controller +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=1650 + +# Increase Zephyr Bluetooth LE Controller Rx buffer to receive complete chain +# of PDUs +CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/observer/sample.yaml b/samples/bluetooth/observer/sample.yaml index cf0e9094e0a..4dadb09ff89 100644 --- a/samples/bluetooth/observer/sample.yaml +++ b/samples/bluetooth/observer/sample.yaml @@ -3,5 +3,10 @@ sample: tests: sample.bluetooth.observer: harness: bluetooth - platform_allow: qemu_cortex_m3 qemu_x86 + platform_allow: qemu_cortex_m3 qemu_x86 nrf52840dk_nrf52840 + tags: bluetooth + sample.bluetooth.observer.extended: + harness: bluetooth + extra_args: CONF_FILE="prj_extended.conf" + platform_allow: qemu_cortex_m3 qemu_x86 nrf52840dk_nrf52840 tags: bluetooth diff --git a/samples/bluetooth/observer/src/main.c b/samples/bluetooth/observer/src/main.c index 2bcd8cb28d4..10601ad55c8 100644 --- a/samples/bluetooth/observer/src/main.c +++ b/samples/bluetooth/observer/src/main.c @@ -14,15 +14,83 @@ #include #include +#define NAME_LEN 30 + static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, struct net_buf_simple *ad) { char addr_str[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); - printk("Device found: %s (RSSI %d)\n", addr_str, rssi); + printk("Device found: %s (RSSI %d), type %u, AD data len %u\n", + addr_str, rssi, type, ad->len); +} + +#if defined(CONFIG_BT_EXT_ADV) +static bool data_cb(struct bt_data *data, void *user_data) +{ + char *name = user_data; + uint8_t len; + + switch (data->type) { + case BT_DATA_NAME_SHORTENED: + case BT_DATA_NAME_COMPLETE: + len = MIN(data->data_len, NAME_LEN - 1); + (void)memcpy(name, data->data, len); + name[len] = '\0'; + return false; + default: + return true; + } +} + +static const char *phy2str(uint8_t phy) +{ + switch (phy) { + case BT_GAP_LE_PHY_NONE: return "No packets"; + case BT_GAP_LE_PHY_1M: return "LE 1M"; + case BT_GAP_LE_PHY_2M: return "LE 2M"; + case BT_GAP_LE_PHY_CODED: return "LE Coded"; + default: return "Unknown"; + } } +static void scan_recv(const struct bt_le_scan_recv_info *info, + struct net_buf_simple *buf) +{ + char le_addr[BT_ADDR_LE_STR_LEN]; + char name[NAME_LEN]; + uint8_t data_status; + uint16_t data_len; + + (void)memset(name, 0, sizeof(name)); + + data_len = buf->len; + bt_data_parse(buf, data_cb, name); + + data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(info->adv_props); + + bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); + printk("[DEVICE]: %s, AD evt type %u, Tx Pwr: %i, RSSI %i " + "Data status: %u, AD data len: %u Name: %s " + "C:%u S:%u D:%u SR:%u E:%u Pri PHY: %s, Sec PHY: %s, " + "Interval: 0x%04x (%u ms), SID: %u\n", + le_addr, info->adv_type, info->tx_power, info->rssi, + data_status, data_len, name, + (info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_SCANNABLE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_DIRECTED) != 0, + (info->adv_props & BT_GAP_ADV_PROP_SCAN_RESPONSE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0, + phy2str(info->primary_phy), phy2str(info->secondary_phy), + info->interval, info->interval * 5 / 4, info->sid); +} + +static struct bt_le_scan_cb scan_callbacks = { + .recv = scan_recv, +}; +#endif /* CONFIG_BT_EXT_ADV */ + void main(void) { struct bt_le_scan_param scan_param = { @@ -41,13 +109,17 @@ void main(void) printk("Bluetooth init failed (err %d)\n", err); return; } - printk("Bluetooth initialized\n"); +#if defined(CONFIG_BT_EXT_ADV) + bt_le_scan_cb_register(&scan_callbacks); + printk("Registered scan callbacks\n"); +#endif /* CONFIG_BT_EXT_ADV */ + err = bt_le_scan_start(&scan_param, device_found); - printk("\n"); if (err) { - printk("Starting scanning failed (err %d)\n", err); + printk("Start scanning failed (err %d)\n", err); return; } + printk("Scanning started, exiting %s thread.\n", __func__); } From cf85a34ab8dcb18f32b5a8bb8bc05978e6ef44d2 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 10 Aug 2022 11:47:28 +0530 Subject: [PATCH 164/501] [nrf fromtree] samples: Bluetooth: Refactor broadcaster multiple for bsim test reuse Refactor the broadcaster multiple sample so that it can be reused as bsim test to verify Extended advertisement chaining. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 04e064fd16c6cd993181cc8e0a5d6556283f4333) --- .../broadcaster_multiple/CMakeLists.txt | 5 +- .../src/broadcaster_multiple.c | 113 ++++++++++++++++++ .../bluetooth/broadcaster_multiple/src/main.c | 101 +--------------- 3 files changed, 119 insertions(+), 100 deletions(-) create mode 100644 samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c diff --git a/samples/bluetooth/broadcaster_multiple/CMakeLists.txt b/samples/bluetooth/broadcaster_multiple/CMakeLists.txt index 94ae548608b..eb0237e0486 100644 --- a/samples/bluetooth/broadcaster_multiple/CMakeLists.txt +++ b/samples/bluetooth/broadcaster_multiple/CMakeLists.txt @@ -4,4 +4,7 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(broadcaster_multiple) -target_sources(app PRIVATE src/main.c) +target_sources(app PRIVATE + src/main.c + src/broadcaster_multiple.c +) diff --git a/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c b/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c new file mode 100644 index 00000000000..56cc210de78 --- /dev/null +++ b/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +/* Maximum supported AD data length, use a value supported by the Controller, + * Bluetooth Core Specification define minimum of 31 bytes will be supported by + * all Controllers, can be a maximum of 1650 bytes when supported. + */ +#if defined(CONFIG_BT_CTLR_ADV_DATA_LEN_MAX) +#define BT_AD_DATA_LEN_MAX CONFIG_BT_CTLR_ADV_DATA_LEN_MAX +#else +#define BT_AD_DATA_LEN_MAX 31U +#endif + +/* Size of AD data format length field in octets */ +#define BT_AD_DATA_FORMAT_LEN_SIZE 1U + +/* Size of AD data format type field in octets */ +#define BT_AD_DATA_FORMAT_TYPE_SIZE 1U + +/* Maximum value of AD data format length field (8-bit) */ +#define BT_AD_DATA_FORMAT_LEN_MAX 255U + +/* Device name length, size minus one null character */ +#define BT_DEVICE_NAME_LEN (sizeof(CONFIG_BT_DEVICE_NAME) - 1U) + +/* Device name length in AD data format, 2 bytes for length and type overhead */ +#define BT_DEVICE_NAME_AD_DATA_LEN (BT_AD_DATA_FORMAT_LEN_SIZE + \ + BT_AD_DATA_FORMAT_TYPE_SIZE + \ + BT_DEVICE_NAME_LEN) + +/* Maximum manufacturer data length, considering ad data format overhead and + * the included device name in ad data format. + */ +#define BT_MFG_DATA_LEN_MAX (MIN((BT_AD_DATA_FORMAT_LEN_MAX - \ + BT_AD_DATA_FORMAT_TYPE_SIZE), \ + (BT_AD_DATA_LEN_MAX - \ + BT_AD_DATA_FORMAT_LEN_SIZE - \ + BT_AD_DATA_FORMAT_TYPE_SIZE))) +#define BT_MFG_DATA_LEN (MIN(BT_MFG_DATA_LEN_MAX, \ + (BT_AD_DATA_LEN_MAX - \ + BT_AD_DATA_FORMAT_LEN_SIZE - \ + BT_AD_DATA_FORMAT_TYPE_SIZE - \ + BT_DEVICE_NAME_AD_DATA_LEN))) + +static uint8_t mfg_data[BT_MFG_DATA_LEN] = { 0xFF, 0xFF, }; + +static const struct bt_data ad[] = { + BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)), +}; + +static struct bt_le_ext_adv *adv[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; + +int broadcaster_multiple(void) +{ + struct bt_le_adv_param adv_param = { + .id = BT_ID_DEFAULT, + .sid = 0U, /* Supply unique SID when creating advertising set */ + .secondary_max_skip = 0U, + .options = (BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME), + .interval_min = BT_GAP_ADV_FAST_INT_MIN_2, + .interval_max = BT_GAP_ADV_FAST_INT_MAX_2, + .peer = NULL, + }; + int err; + + /* Initialize the Bluetooth Subsystem */ + err = bt_enable(NULL); + if (err) { + printk("Bluetooth init failed (err %d)\n", err); + return err; + } + + for (int index = 0; index < CONFIG_BT_EXT_ADV_MAX_ADV_SET; index++) { + /* Use advertising set instance index as SID */ + adv_param.sid = index; + + /* Create a non-connectable non-scannable advertising set */ + err = bt_le_ext_adv_create(&adv_param, NULL, &adv[index]); + if (err) { + printk("Failed to create advertising set %d (err %d)\n", + index, err); + return err; + } + + /* Set extended advertising data */ + err = bt_le_ext_adv_set_data(adv[index], ad, ARRAY_SIZE(ad), + NULL, 0); + if (err) { + printk("Failed to set advertising data for set %d " + "(err %d)\n", index, err); + return err; + } + + /* Start extended advertising set */ + err = bt_le_ext_adv_start(adv[index], + BT_LE_EXT_ADV_START_DEFAULT); + if (err) { + printk("Failed to start extended advertising set %d " + "(err %d)\n", index, err); + return err; + } + + printk("Started Extended Advertising Set %d.\n", index); + } + + return 0; +} diff --git a/samples/bluetooth/broadcaster_multiple/src/main.c b/samples/bluetooth/broadcaster_multiple/src/main.c index 984d8ac3aed..e6641983083 100644 --- a/samples/bluetooth/broadcaster_multiple/src/main.c +++ b/samples/bluetooth/broadcaster_multiple/src/main.c @@ -5,111 +5,14 @@ */ #include -#include -/* Maximum supported AD data length, use a value supported by the Controller, - * Bluetooth Core Specification define minimum of 31 bytes will be supported by - * all Controllers, can be a maximum of 1650 bytes when supported. - */ -#if defined(CONFIG_BT_CTLR_ADV_DATA_LEN_MAX) -#define BT_AD_DATA_LEN_MAX CONFIG_BT_CTLR_ADV_DATA_LEN_MAX -#else -#define BT_AD_DATA_LEN_MAX 31U -#endif - -/* Size of AD data format length field in octets */ -#define BT_AD_DATA_FORMAT_LEN_SIZE 1U - -/* Size of AD data format type field in octets */ -#define BT_AD_DATA_FORMAT_TYPE_SIZE 1U - -/* Maximum value of AD data format length field (8-bit) */ -#define BT_AD_DATA_FORMAT_LEN_MAX 255U - -/* Device name length, size minus one null character */ -#define BT_DEVICE_NAME_LEN (sizeof(CONFIG_BT_DEVICE_NAME) - 1U) - -/* Device name length in AD data format, 2 bytes for length and type overhead */ -#define BT_DEVICE_NAME_AD_DATA_LEN (BT_AD_DATA_FORMAT_LEN_SIZE + \ - BT_AD_DATA_FORMAT_TYPE_SIZE + \ - BT_DEVICE_NAME_LEN) - -/* Maximum manufacturer data length, considering ad data format overhead and - * the included device name in ad data format. - */ -#define BT_MFG_DATA_LEN_MAX (MIN((BT_AD_DATA_FORMAT_LEN_MAX - \ - BT_AD_DATA_FORMAT_TYPE_SIZE), \ - (BT_AD_DATA_LEN_MAX - \ - BT_AD_DATA_FORMAT_LEN_SIZE - \ - BT_AD_DATA_FORMAT_TYPE_SIZE))) -#define BT_MFG_DATA_LEN (MIN(BT_MFG_DATA_LEN_MAX, \ - (BT_AD_DATA_LEN_MAX - \ - BT_AD_DATA_FORMAT_LEN_SIZE - \ - BT_AD_DATA_FORMAT_TYPE_SIZE - \ - BT_DEVICE_NAME_AD_DATA_LEN))) - -static uint8_t mfg_data[BT_MFG_DATA_LEN] = { 0xFF, 0xFF, }; - -static const struct bt_data ad[] = { - BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)), -}; - -static struct bt_le_ext_adv *adv[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; +int broadcaster_multiple(void); void main(void) { - struct bt_le_adv_param adv_param = { - .id = BT_ID_DEFAULT, - .sid = 0U, /* Supply unique SID when creating advertising set */ - .secondary_max_skip = 0U, - .options = (BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME), - .interval_min = BT_GAP_ADV_FAST_INT_MIN_2, - .interval_max = BT_GAP_ADV_FAST_INT_MAX_2, - .peer = NULL, - }; - int err; - printk("Starting Multiple Broadcaster Demo\n"); - /* Initialize the Bluetooth Subsystem */ - err = bt_enable(NULL); - if (err) { - printk("Bluetooth init failed (err %d)\n", err); - return; - } - - for (int index = 0; index < CONFIG_BT_EXT_ADV_MAX_ADV_SET; index++) { - /* Use advertising set instance index as SID */ - adv_param.sid = index; - - /* Create a non-connectable non-scannable advertising set */ - err = bt_le_ext_adv_create(&adv_param, NULL, &adv[index]); - if (err) { - printk("Failed to create advertising set %d (err %d)\n", - index, err); - return; - } - - /* Set extended advertising data */ - err = bt_le_ext_adv_set_data(adv[index], ad, ARRAY_SIZE(ad), - NULL, 0); - if (err) { - printk("Failed to set advertising data for set %d " - "(err %d)\n", index, err); - return; - } - - /* Start extended advertising set */ - err = bt_le_ext_adv_start(adv[index], - BT_LE_EXT_ADV_START_DEFAULT); - if (err) { - printk("Failed to start extended advertising set %d " - "(err %d)\n", index, err); - return; - } - - printk("Started Extended Advertising Set %d.\n", index); - } + (void)broadcaster_multiple(); printk("Exiting %s thread.\n", __func__); } From 9f6434f4452fe8777813d47587be3e440d3ffbd1 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 10 Aug 2022 11:47:28 +0530 Subject: [PATCH 165/501] [nrf fromtree] samples: Bluetooth: Refactor observer for bsim test reuse Refactor the observer sample so that it can be reused as bsim test to verify Extended advertisement chaining. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit b0f1ab0885d5c2057f226ab393a218e011fa6be1) --- samples/bluetooth/observer/CMakeLists.txt | 8 +- samples/bluetooth/observer/src/main.c | 107 +-------------------- samples/bluetooth/observer/src/observer.c | 112 ++++++++++++++++++++++ 3 files changed, 121 insertions(+), 106 deletions(-) create mode 100644 samples/bluetooth/observer/src/observer.c diff --git a/samples/bluetooth/observer/CMakeLists.txt b/samples/bluetooth/observer/CMakeLists.txt index 6009ce93a53..59d999d7052 100644 --- a/samples/bluetooth/observer/CMakeLists.txt +++ b/samples/bluetooth/observer/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(observer) -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) - -zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth) +target_sources(app PRIVATE + src/main.c + src/observer.c +) diff --git a/samples/bluetooth/observer/src/main.c b/samples/bluetooth/observer/src/main.c index 10601ad55c8..82958c9de69 100644 --- a/samples/bluetooth/observer/src/main.c +++ b/samples/bluetooth/observer/src/main.c @@ -1,107 +1,19 @@ -/* main.c - Application main entry point */ - /* - * Copyright (c) 2015-2016 Intel Corporation + * Copyright (c) 2022 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ -#include -#include #include -#include - #include -#include - -#define NAME_LEN 30 - -static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, - struct net_buf_simple *ad) -{ - char addr_str[BT_ADDR_LE_STR_LEN]; - - bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); - printk("Device found: %s (RSSI %d), type %u, AD data len %u\n", - addr_str, rssi, type, ad->len); -} - -#if defined(CONFIG_BT_EXT_ADV) -static bool data_cb(struct bt_data *data, void *user_data) -{ - char *name = user_data; - uint8_t len; - - switch (data->type) { - case BT_DATA_NAME_SHORTENED: - case BT_DATA_NAME_COMPLETE: - len = MIN(data->data_len, NAME_LEN - 1); - (void)memcpy(name, data->data, len); - name[len] = '\0'; - return false; - default: - return true; - } -} - -static const char *phy2str(uint8_t phy) -{ - switch (phy) { - case BT_GAP_LE_PHY_NONE: return "No packets"; - case BT_GAP_LE_PHY_1M: return "LE 1M"; - case BT_GAP_LE_PHY_2M: return "LE 2M"; - case BT_GAP_LE_PHY_CODED: return "LE Coded"; - default: return "Unknown"; - } -} - -static void scan_recv(const struct bt_le_scan_recv_info *info, - struct net_buf_simple *buf) -{ - char le_addr[BT_ADDR_LE_STR_LEN]; - char name[NAME_LEN]; - uint8_t data_status; - uint16_t data_len; - - (void)memset(name, 0, sizeof(name)); - - data_len = buf->len; - bt_data_parse(buf, data_cb, name); - data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(info->adv_props); - - bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); - printk("[DEVICE]: %s, AD evt type %u, Tx Pwr: %i, RSSI %i " - "Data status: %u, AD data len: %u Name: %s " - "C:%u S:%u D:%u SR:%u E:%u Pri PHY: %s, Sec PHY: %s, " - "Interval: 0x%04x (%u ms), SID: %u\n", - le_addr, info->adv_type, info->tx_power, info->rssi, - data_status, data_len, name, - (info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_SCANNABLE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_DIRECTED) != 0, - (info->adv_props & BT_GAP_ADV_PROP_SCAN_RESPONSE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0, - phy2str(info->primary_phy), phy2str(info->secondary_phy), - info->interval, info->interval * 5 / 4, info->sid); -} - -static struct bt_le_scan_cb scan_callbacks = { - .recv = scan_recv, -}; -#endif /* CONFIG_BT_EXT_ADV */ +int observer_start(void); void main(void) { - struct bt_le_scan_param scan_param = { - .type = BT_LE_SCAN_TYPE_PASSIVE, - .options = BT_LE_SCAN_OPT_FILTER_DUPLICATE, - .interval = BT_GAP_SCAN_FAST_INTERVAL, - .window = BT_GAP_SCAN_FAST_WINDOW, - }; int err; - printk("Starting Observer\n"); + printk("Starting Observer Demo\n"); /* Initialize the Bluetooth Subsystem */ err = bt_enable(NULL); @@ -109,17 +21,8 @@ void main(void) printk("Bluetooth init failed (err %d)\n", err); return; } - printk("Bluetooth initialized\n"); -#if defined(CONFIG_BT_EXT_ADV) - bt_le_scan_cb_register(&scan_callbacks); - printk("Registered scan callbacks\n"); -#endif /* CONFIG_BT_EXT_ADV */ + (void)observer_start(); - err = bt_le_scan_start(&scan_param, device_found); - if (err) { - printk("Start scanning failed (err %d)\n", err); - return; - } - printk("Scanning started, exiting %s thread.\n", __func__); + printk("Exiting %s thread.\n", __func__); } diff --git a/samples/bluetooth/observer/src/observer.c b/samples/bluetooth/observer/src/observer.c new file mode 100644 index 00000000000..12a6c5781b3 --- /dev/null +++ b/samples/bluetooth/observer/src/observer.c @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * Copyright (c) 2015-2016 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +#define NAME_LEN 30 + +static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, + struct net_buf_simple *ad) +{ + char addr_str[BT_ADDR_LE_STR_LEN]; + + bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); + printk("Device found: %s (RSSI %d), type %u, AD data len %u\n", + addr_str, rssi, type, ad->len); +} + +#if defined(CONFIG_BT_EXT_ADV) +static bool data_cb(struct bt_data *data, void *user_data) +{ + char *name = user_data; + uint8_t len; + + switch (data->type) { + case BT_DATA_NAME_SHORTENED: + case BT_DATA_NAME_COMPLETE: + len = MIN(data->data_len, NAME_LEN - 1); + (void)memcpy(name, data->data, len); + name[len] = '\0'; + return false; + default: + return true; + } +} + +static const char *phy2str(uint8_t phy) +{ + switch (phy) { + case BT_GAP_LE_PHY_NONE: return "No packets"; + case BT_GAP_LE_PHY_1M: return "LE 1M"; + case BT_GAP_LE_PHY_2M: return "LE 2M"; + case BT_GAP_LE_PHY_CODED: return "LE Coded"; + default: return "Unknown"; + } +} + +static void scan_recv(const struct bt_le_scan_recv_info *info, + struct net_buf_simple *buf) +{ + char le_addr[BT_ADDR_LE_STR_LEN]; + char name[NAME_LEN]; + uint8_t data_status; + uint16_t data_len; + + (void)memset(name, 0, sizeof(name)); + + data_len = buf->len; + bt_data_parse(buf, data_cb, name); + + data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(info->adv_props); + + bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); + printk("[DEVICE]: %s, AD evt type %u, Tx Pwr: %i, RSSI %i " + "Data status: %u, AD data len: %u Name: %s " + "C:%u S:%u D:%u SR:%u E:%u Pri PHY: %s, Sec PHY: %s, " + "Interval: 0x%04x (%u ms), SID: %u\n", + le_addr, info->adv_type, info->tx_power, info->rssi, + data_status, data_len, name, + (info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_SCANNABLE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_DIRECTED) != 0, + (info->adv_props & BT_GAP_ADV_PROP_SCAN_RESPONSE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0, + phy2str(info->primary_phy), phy2str(info->secondary_phy), + info->interval, info->interval * 5 / 4, info->sid); +} + +static struct bt_le_scan_cb scan_callbacks = { + .recv = scan_recv, +}; +#endif /* CONFIG_BT_EXT_ADV */ + +int observer_start(void) +{ + struct bt_le_scan_param scan_param = { + .type = BT_LE_SCAN_TYPE_PASSIVE, + .options = BT_LE_SCAN_OPT_FILTER_DUPLICATE, + .interval = BT_GAP_SCAN_FAST_INTERVAL, + .window = BT_GAP_SCAN_FAST_WINDOW, + }; + int err; + +#if defined(CONFIG_BT_EXT_ADV) + bt_le_scan_cb_register(&scan_callbacks); + printk("Registered scan callbacks\n"); +#endif /* CONFIG_BT_EXT_ADV */ + + err = bt_le_scan_start(&scan_param, device_found); + if (err) { + printk("Start scanning failed (err %d)\n", err); + return err; + } + printk("Started scanning...\n"); + + return 0; +} From b1066c83ee14eddf7c1db73361e9832419de7daf Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 10 Aug 2022 13:45:11 +0530 Subject: [PATCH 166/501] [nrf fromtree] tests: Bluetooth: bsim: Verify multiple broadcaster and chain PDU Added BabbleSim test to reuse the Broadcaster Multiple and Oberver samples to verify multiple advertising sets and transmission of Extended Advertising Chain PDU. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit dd8871b730817707cfad3dc44e6868ec1cef5bcd) --- .../bsim_test_adv_chain/CMakeLists.txt | 24 ++ .../bsim_bt/bsim_test_adv_chain/prj.conf | 36 +++ .../bsim_bt/bsim_test_adv_chain/src/main.c | 208 ++++++++++++++++++ .../tests_scripts/adv_chain.sh | 39 ++++ tests/bluetooth/bsim_bt/compile.sh | 1 + 5 files changed, 308 insertions(+) create mode 100644 tests/bluetooth/bsim_bt/bsim_test_adv_chain/CMakeLists.txt create mode 100644 tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf create mode 100644 tests/bluetooth/bsim_bt/bsim_test_adv_chain/src/main.c create mode 100755 tests/bluetooth/bsim_bt/bsim_test_adv_chain/tests_scripts/adv_chain.sh diff --git a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/CMakeLists.txt b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/CMakeLists.txt new file mode 100644 index 00000000000..d1478d5406e --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/CMakeLists.txt @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +if (NOT DEFINED ENV{BSIM_COMPONENTS_PATH}) + message(FATAL_ERROR "This test requires the BabbleSim simulator. Please set \ + the environment variable BSIM_COMPONENTS_PATH to point to its \ + components folder. More information can be found in \ + https://babblesim.github.io/folder_structure_and_env.html") +endif() + +find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) +project(bsim_test_adv_chain) + +target_sources(app PRIVATE + src/main.c + ${ZEPHYR_BASE}/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c + ${ZEPHYR_BASE}/samples/bluetooth/observer/src/observer.c +) + +zephyr_include_directories( + $ENV{BSIM_COMPONENTS_PATH}/libUtilv1/src/ + $ENV{BSIM_COMPONENTS_PATH}/libPhyComv1/src/ +) diff --git a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf new file mode 100644 index 00000000000..2566981c94c --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf @@ -0,0 +1,36 @@ +CONFIG_BT=y +CONFIG_BT_BROADCASTER=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_EXT_ADV_MAX_ADV_SET=2 +CONFIG_BT_DEVICE_NAME="Broadcaster Multiple" + +# Zephyr Bluetooth LE Controller will need to use chain PDUs when AD data +# length > 191 bytes +# - 31 bytes will use 22 bytes for the default name in this sample plus 9 bytes +# for manufacturer data +# - 191 bytes will use 22 bytes for the default name in this sample plus 169 +# bytes for manufacturer data +# - 277 bytes will use 22 bytes for the default name in this sample plus 255 +# bytes for manufacturer data +CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=1650 + +# Increase Advertising PDU buffers to number of advertising sets times the +# number of chain PDUs per advertising set when using Zephyr Bluetooth LE +# Controller +CONFIG_BT_CTLR_ADVANCED_FEATURES=y +CONFIG_BT_CTLR_ADV_DATA_BUF_MAX=2 + +# Maximum Extended Scanning buffer size +CONFIG_BT_EXT_SCAN_BUF_SIZE=1650 + +# Set maximum scan data length for Extended Scanning in Bluetooth LE Controller +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=1650 + +# Zephyr Bluetooth LE Controller needs 16 event buffers to generate Extended +# Advertising Report for receiving the complete 1650 bytes of data +CONFIG_BT_BUF_EVT_RX_COUNT=16 + +# Increase Zephyr Bluetooth LE Controller Rx buffer to receive complete chain +# of PDUs +CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/src/main.c b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/src/main.c new file mode 100644 index 00000000000..37ff8c29269 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/src/main.c @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include + +#include +#include + +#include +#include + +#include "bs_types.h" +#include "bs_tracing.h" +#include "time_machine.h" +#include "bstests.h" + +#define FAIL(...) \ + do { \ + bst_result = Failed; \ + bs_trace_error_time_line(__VA_ARGS__); \ + } while (0) + +#define PASS(...) \ + do { \ + bst_result = Passed; \ + bs_trace_info_time(1, __VA_ARGS__); \ + } while (0) + +#define NAME_LEN 30 +#define BT_AD_DATA_NAME_SIZE (sizeof(CONFIG_BT_DEVICE_NAME) - 1U + 2U) +#define BT_AD_DATA_MFG_DATA_SIZE (254U + 2U) +#define DATA_LEN MIN((BT_AD_DATA_NAME_SIZE + \ + BT_AD_DATA_MFG_DATA_SIZE), \ + CONFIG_BT_CTLR_ADV_DATA_LEN_MAX) + +static K_SEM_DEFINE(sem_recv, 0, 1); + +extern enum bst_result_t bst_result; + +static void test_adv_main(void) +{ + extern int broadcaster_multiple(void); + int err; + + err = broadcaster_multiple(); + if (err) { + FAIL("Adv tests failed\n"); + bs_trace_silent_exit(err); + return; + } + + /* Successfully started advertising multiple sets */ + PASS("Adv tests passed\n"); + + /* Let the scanner receive the reports */ + k_sleep(K_SECONDS(10)); +} + +static bool data_cb(struct bt_data *data, void *user_data) +{ + char *name = user_data; + uint8_t len; + + switch (data->type) { + case BT_DATA_NAME_SHORTENED: + case BT_DATA_NAME_COMPLETE: + len = MIN(data->data_len, NAME_LEN - 1); + (void)memcpy(name, data->data, len); + name[len] = '\0'; + return false; + default: + return true; + } +} + +static void scan_recv(const struct bt_le_scan_recv_info *info, + struct net_buf_simple *buf) +{ + static uint8_t sid[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; + static uint8_t sid_count; + char name[NAME_LEN]; + uint8_t data_status; + uint16_t data_len; + + data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(info->adv_props); + if (data_status) { + return; + } + + data_len = buf->len; + if (data_len != DATA_LEN) { + return; + } + + (void)memset(name, 0, sizeof(name)); + bt_data_parse(buf, data_cb, name); + + if (strcmp(name, CONFIG_BT_DEVICE_NAME)) { + return; + } + + for (uint8_t i = 0; i < sid_count; i++) { + if (sid[i] == info->sid) { + return; + } + } + + sid[sid_count++] = info->sid; + + if (sid_count < CONFIG_BT_EXT_ADV_MAX_ADV_SET) { + return; + } + + k_sem_give(&sem_recv); +} + +static struct bt_le_scan_cb scan_callbacks = { + .recv = scan_recv, +}; + +static void test_scan_main(void) +{ + extern int observer_start(void); + int err; + + err = bt_enable(NULL); + if (err) { + FAIL("Bluetooth init failed\n"); + + bs_trace_silent_exit(err); + return; + } + + bt_le_scan_cb_register(&scan_callbacks); + + err = observer_start(); + if (err) { + FAIL("Observer start failed\n"); + + bs_trace_silent_exit(err); + return; + } + + /* Let the recv callback verify the reports */ + k_sleep(K_SECONDS(10)); + + err = k_sem_take(&sem_recv, K_NO_WAIT); + if (err) { + FAIL("Scan receive failed\n"); + + bs_trace_silent_exit(err); + return; + } + + PASS("Scan tests passed\n"); + + bs_trace_silent_exit(0); +} + +static void test_adv_chain_init(void) +{ + bst_ticker_set_next_tick_absolute(60e6); + bst_result = In_progress; +} + +static void test_adv_chain_tick(bs_time_t HW_device_time) +{ + bst_result = Failed; + bs_trace_error_line("Test GATT Write finished.\n"); +} + +static const struct bst_test_instance test_def[] = { + { + .test_id = "adv", + .test_descr = "Central GATT Write", + .test_post_init_f = test_adv_chain_init, + .test_tick_f = test_adv_chain_tick, + .test_main_f = test_adv_main + }, + { + .test_id = "scan", + .test_descr = "Peripheral GATT Write", + .test_post_init_f = test_adv_chain_init, + .test_tick_f = test_adv_chain_tick, + .test_main_f = test_scan_main + }, + BSTEST_END_MARKER +}; + +struct bst_test_list *test_adv_chain_install(struct bst_test_list *tests) +{ + return bst_add_tests(tests, test_def); +} + +bst_test_install_t test_installers[] = { + test_adv_chain_install, + NULL +}; + +void main(void) +{ + bst_main(); +} diff --git a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/tests_scripts/adv_chain.sh b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/tests_scripts/adv_chain.sh new file mode 100755 index 00000000000..2e5b56660c8 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/tests_scripts/adv_chain.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Copyright 2018 Oticon A/S +# SPDX-License-Identifier: Apache-2.0 + +# Validate Extended Advertising AD Data fragment operation, PDU chaining and +# Extended Scanning of chain PDUs +simulation_id="adv_chain" +verbosity_level=2 +process_ids=""; exit_code=0 + +function Execute(){ + if [ ! -f $1 ]; then + echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\ + compile it?)\e[39m" + exit 1 + fi + timeout 10 $@ & process_ids="$process_ids $!" +} + +: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" + +#Give a default value to BOARD if it does not have one yet: +BOARD="${BOARD:-nrf52_bsim}" + +cd ${BSIM_OUT_PATH}/bin + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_adv_chain_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=adv + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_adv_chain_prj_conf\ + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=scan + +Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ + -D=2 -sim_length=10e6 $@ + +for process_id in $process_ids; do + wait $process_id || let "exit_code=$?" +done +exit $exit_code #the last exit code != 0 diff --git a/tests/bluetooth/bsim_bt/compile.sh b/tests/bluetooth/bsim_bt/compile.sh index 5ab59c5554f..b7dbce09664 100755 --- a/tests/bluetooth/bsim_bt/compile.sh +++ b/tests/bluetooth/bsim_bt/compile.sh @@ -35,6 +35,7 @@ app=tests/bluetooth/bsim_bt/bsim_test_app conf_file=prj_split_low_lat.conf \ compile app=tests/bluetooth/bsim_bt/bsim_test_multiple compile app=tests/bluetooth/bsim_bt/bsim_test_advx compile +app=tests/bluetooth/bsim_bt/bsim_test_adv_chain compile app=tests/bluetooth/bsim_bt/bsim_test_gatt compile app=tests/bluetooth/bsim_bt/bsim_test_gatt_write compile app=tests/bluetooth/bsim_bt/bsim_test_l2cap compile From 4c6f6645c891fd78ffddcc4154fa237d9384c278 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 16 Aug 2022 13:07:14 +0530 Subject: [PATCH 167/501] [nrf fromtree] Bluetooth: Controller: Fix regression in overlapping 1M and Coded Scan Fix regression in overlapping 1M and Coded PHY scan window by considering rounding margins when checking for same interval and same window durations. Relates to commit c14bde45b6b6 ("Bluetooth: Controller: Fix overlapping 1M and Coded PHY scannning"). Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 5abea6b528ea201592b93e6bfbb5fdd8d0cad14d) --- subsys/bluetooth/controller/ll_sw/ull_scan.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan.c b/subsys/bluetooth/controller/ll_sw/ull_scan.c index b656e25d4cd..99648f60797 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan.c @@ -445,19 +445,25 @@ uint8_t ull_scan_enable(struct ll_scan_set *scan) (lll->ticks_window != 0U)) { const struct lll_scan *lll_coded; uint32_t ticks_interval_coded; + uint32_t ticks_window_sum_min; + uint32_t ticks_window_sum_max; lll_coded = &scan_coded->lll; ticks_interval_coded = HAL_TICKER_US_TO_TICKS( (uint64_t)lll_coded->interval * SCAN_INT_UNIT_US); + ticks_window_sum_min = lll->ticks_window + + lll_coded->ticks_window; + ticks_window_sum_max = ticks_window_sum_min + + HAL_TICKER_US_TO_TICKS(EVENT_TICKER_RES_MARGIN_US << 1); /* Check if 1M and Coded PHY scanning use same interval * and the sum of the scan window duration equals their * interval then use continuous scanning and avoid time * reservation from overlapping. */ if ((ticks_interval == ticks_interval_coded) && - (ticks_interval == (lll->ticks_window + - lll_coded->ticks_window))) { + IN_RANGE(ticks_interval, ticks_window_sum_min, + ticks_window_sum_max)) { if (IS_ENABLED(CONFIG_BT_CTLR_SCAN_UNRESERVED)) { scan->ull.ticks_slot = 0U; } else { @@ -490,6 +496,8 @@ uint8_t ull_scan_enable(struct ll_scan_set *scan) scan_1m = ull_scan_set_get(SCAN_HANDLE_1M); if (IS_PHY_ENABLED(scan_1m, PHY_1M) && (lll->ticks_window != 0U)) { + uint32_t ticks_window_sum_min; + uint32_t ticks_window_sum_max; uint32_t ticks_interval_1m; struct lll_scan *lll_1m; @@ -497,14 +505,18 @@ uint8_t ull_scan_enable(struct ll_scan_set *scan) ticks_interval_1m = HAL_TICKER_US_TO_TICKS( (uint64_t)lll_1m->interval * SCAN_INT_UNIT_US); + ticks_window_sum_min = lll->ticks_window + + lll_1m->ticks_window; + ticks_window_sum_max = ticks_window_sum_min + + HAL_TICKER_US_TO_TICKS(EVENT_TICKER_RES_MARGIN_US << 1); /* Check if 1M and Coded PHY scanning use same interval * and the sum of the scan window duration equals their * interval then use continuous scanning and avoid time * reservation from overlapping. */ if ((ticks_interval == ticks_interval_1m) && - (ticks_interval == (lll->ticks_window + - lll_1m->ticks_window))) { + IN_RANGE(ticks_interval, ticks_window_sum_min, + ticks_window_sum_max)) { if (IS_ENABLED(CONFIG_BT_CTLR_SCAN_UNRESERVED)) { scan->ull.ticks_slot = 0U; } else { From 901964ebc29f847b0401f0630f08b5d9082067b0 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 19 Aug 2022 05:17:46 +0530 Subject: [PATCH 168/501] [nrf fromtree] Bluetooth: Controller: Fix uninitialized adv mode in scan rsp PDU Fix uninitialized adv mode value in the scan response PDU. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit dcfcdc29c4b8ad20d98ab93beb5f39d468579a34) --- subsys/bluetooth/controller/ll_sw/ull_adv_aux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index a57467d8c7a..7902bdecf5f 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -1204,6 +1204,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, sr_pdu->chan_sel = 0U; sr_pdu->rx_addr = 0U; if (sr_pdu->len) { + sr_pdu->adv_ext_ind.adv_mode = 0U; sr_pdu->tx_addr = sec_pdu_prev->tx_addr; (void)memcpy(&sr_pdu->adv_ext_ind.ext_hdr.data[ADVA_OFFSET], &sec_pdu_prev->adv_ext_ind.ext_hdr.data[ADVA_OFFSET], From ef8ee3d87c2b5e6504c1c752bc61cb5ce9956251 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 23 Aug 2022 21:36:38 +0530 Subject: [PATCH 169/501] [nrf fromtree] Bluetooth: Controller: Kconfig to permit periodic sync event skip When AUX_ADV_IND or AUX_CHAIN_IND auxiliary channel PDU scan radio event overlaps Periodic Sync radio event in unreserved time space, let the Periodic Sync radio event be aborted so that the auxiliary channel PDU can be received to generate Extended Advertising Reports. Added a new Kconfig to enable this. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 115787393e65ac0e83741495efd88058cc3fad52) --- .../bluetooth/controller/Kconfig.ll_sw_split | 21 +++++++++++++++++++ .../controller/ll_sw/nordic/lll/lll_sync.c | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 631ca84908e..9e4cde446e3 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -287,6 +287,27 @@ config BT_CTRL_ADV_ADI_IN_SCAN_RSP help Enable ADI field in AUX_SCAN_RSP PDU +config BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX + bool "Skip Periodic Sync event on overlap with Extended Scan Event" + depends on BT_CTLR_SYNC_PERIODIC + help + When AUX_ADV_IND or AUX_CHAIN_IND auxiliary channel PDU scan radio + event overlaps Periodic Sync radio event in unreserved time space, + let the Periodic Sync radio event be aborted so that the auxiliary + channel PDU can be received to generate Extended Advertising Reports. + + By default we want Periodic Advertising Sync Events to take priority + over any overlapping Extended Advertising Primary and Auxiliary + channel PDU reception in order to not skip Periodic Advertising Report + generation. + + But under simultaneous multiple Periodic Advertising Sync support with + small Periodic Advertising Intervals where there will be a lot of + overlapping Periodic Advertising Sync events, it is desirable to + permit Extended Advertising auxiliary PDU reception be allowed in a + round robin scheduling to skip the overlapping Periodic Advertising + Sync event. This permits new Periodic Advertising peers be discovered. + config BT_CTLR_SCAN_AUX_SET int "LE Extended Scanning Auxiliary Sets" depends on BT_OBSERVER && BT_CTLR_ADV_EXT diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index 3fffd128013..dcae61c8a5f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -474,7 +474,8 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) struct lll_scan_aux *lll_aux; lll_aux = ull_scan_aux_lll_is_valid_get(next); - if (!lll_aux) { + if (IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX) || + !lll_aux) { /* Abort current event as next event is not a * scan and not a scan aux event. */ From 39f93083f440033af7ace9761e1670e39d6278f3 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 11 Mar 2022 12:40:57 +0530 Subject: [PATCH 170/501] [nrf fromtree] Bluetooth: Controller: Add Kconfig for minimal time reservation Add Kconfig to use minimal time reservation for auxiliary and sync PDU reception. A peer device could be scheduling multiple advertising sets in a short duration with small PDUs hence using the minimal time reservation would avoid skipping closely scheduled reception of multiple auxiliary PDUs. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 3f4cf428be330f5a64bce73c658e91c3b8b64fb5) --- subsys/bluetooth/controller/Kconfig.ll_sw_split | 11 +++++++++++ subsys/bluetooth/controller/ll_sw/pdu.h | 8 ++++++++ subsys/bluetooth/controller/ll_sw/ull_scan_aux.c | 3 ++- subsys/bluetooth/controller/ll_sw/ull_sync.c | 3 ++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 9e4cde446e3..71094bab9e7 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -287,6 +287,17 @@ config BT_CTRL_ADV_ADI_IN_SCAN_RSP help Enable ADI field in AUX_SCAN_RSP PDU +config BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN + bool "Use minimal Scan Auxiliary and Periodic Sync PDU time reservation" + depends on (BT_OBSERVER && BT_CTLR_ADV_EXT) || BT_CTLR_SYNC_PERIODIC + default y + help + Use minimal time reservation for Auxiliary and Periodic Sync PDU + reception. A peer device could scheduling multiple advertising sets + in a short duration with small PDUs hence using the minimal time + reservation would avoid skipping closely scheduled reception of + multiple Auxiliary or Periodic Sync PDUs. + config BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX bool "Skip Periodic Sync event on overlap with Extended Scan Event" depends on BT_CTLR_SYNC_PERIODIC diff --git a/subsys/bluetooth/controller/ll_sw/pdu.h b/subsys/bluetooth/controller/ll_sw/pdu.h index f3f5dfc82c9..b1e02538105 100644 --- a/subsys/bluetooth/controller/ll_sw/pdu.h +++ b/subsys/bluetooth/controller/ll_sw/pdu.h @@ -41,6 +41,14 @@ /* Advertisement channel maximum payload size */ #if defined(CONFIG_BT_CTLR_ADV_EXT) + +/* Extended Scan and Periodic Sync Rx PDU time reservation */ +#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) +#define PDU_AC_EXT_PAYLOAD_RX_SIZE 0U +#else /* !CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ +#define PDU_AC_EXT_PAYLOAD_RX_SIZE PDU_AC_EXT_PAYLOAD_SIZE_MAX +#endif /* !CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ + #define PDU_AC_EXT_HEADER_SIZE_MIN offsetof(struct pdu_adv_com_ext_adv, \ ext_hdr_adv_data) #define PDU_AC_EXT_HEADER_SIZE_MAX 63 diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index df8d868c15b..454953bf5e0 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -654,7 +654,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx) aux->ull.ticks_slot = HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_START_US + ready_delay_us + - PDU_AC_MAX_US(0U, lll_aux->phy) + + PDU_AC_MAX_US(PDU_AC_EXT_PAYLOAD_RX_SIZE, + lll_aux->phy) + EVENT_OVERHEAD_END_US); ticks_slot_offset = MAX(aux->ull.ticks_active_to_start, diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c index 8304c47baaa..98197db94a1 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c @@ -761,7 +761,8 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux, sync->ull.ticks_slot = HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_START_US + ready_delay_us + - PDU_AC_MAX_US(0U, lll->phy) + + PDU_AC_MAX_US(PDU_AC_EXT_PAYLOAD_RX_SIZE, + lll->phy) + EVENT_OVERHEAD_END_US); ticks_slot_offset = MAX(sync->ull.ticks_active_to_start, From 6c8a3133bfa34765370fa84f65bb8f594885acd0 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 26 Aug 2022 13:00:58 +0530 Subject: [PATCH 171/501] [nrf fromtree] Bluetooth: Controller: Add abort fairness in overlapping Periodic Sync Add implementation in Periodic Sync LLL abort to use near fair scheduling to ensure overlapping multiple Periodic Sync set each get to use the radio and not lead to Sync Loss. The implementation is used when overlap in radio event happens in unreserved time space of the event. An abort count is maintain in each Periodic Sync instance and is used to decide whether the current event or the next event is to be aborted when they overlap. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 7524d350ae9e7399c5e1d620a4dd5affba5631aa) --- subsys/bluetooth/controller/ll_sw/lll_sync.h | 9 +++ .../controller/ll_sw/nordic/lll/lll_sync.c | 67 ++++++++++++++++--- subsys/bluetooth/controller/ll_sw/ull_sync.c | 18 +++++ 3 files changed, 84 insertions(+), 10 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/lll_sync.h b/subsys/bluetooth/controller/ll_sw/lll_sync.h index 4ad8832a90a..20ca0781d6d 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_sync.h +++ b/subsys/bluetooth/controller/ll_sw/lll_sync.h @@ -32,6 +32,14 @@ struct lll_sync { uint8_t sca:3; #endif /* CONFIG_BT_CTLR_SYNC_ISO */ +#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) + /* Counter used by LLL abort of event when in unreserved time space to + * provide near fair scheduling of overlapping multiple Periodic + * Sync sets. + */ + uint8_t abort_count; +#endif /* CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ + uint16_t skip_prepare; uint16_t skip_event; uint16_t event_counter; @@ -66,3 +74,4 @@ void lll_sync_prepare(void *param); enum sync_status lll_sync_cte_is_allowed(uint8_t cte_type_mask, uint8_t filter_policy, uint8_t rx_cte_time, uint8_t rx_cte_type); extern uint16_t ull_sync_lll_handle_get(struct lll_sync *lll); +extern struct lll_sync *ull_sync_lll_is_valid_get(struct lll_sync *lll); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index dcae61c8a5f..f1e43088e18 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -467,21 +467,60 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) /* Different radio event overlap */ if (next != curr) { + struct lll_scan_aux *lll_aux; struct lll_scan *lll; lll = ull_scan_lll_is_valid_get(next); - if (!lll) { - struct lll_scan_aux *lll_aux; - - lll_aux = ull_scan_aux_lll_is_valid_get(next); - if (IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX) || - !lll_aux) { - /* Abort current event as next event is not a - * scan and not a scan aux event. - */ - return -ECANCELED; + if (lll) { + /* Do not abort current periodic sync event as next + * event is a scan event. + */ + return 0; + } + + lll_aux = ull_scan_aux_lll_is_valid_get(next); + if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX) && + lll_aux) { + /* Do not abort current periodic sync event as next + * event is a scan aux event. + */ + return 0; + } + +#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) + struct lll_sync *lll_sync_next; + struct lll_sync *lll_sync_curr; + + lll_sync_next = ull_sync_lll_is_valid_get(next); + if (!lll_sync_next) { + /* Abort current event as next event is not a + * scan and not a scan aux event. + */ + return -ECANCELED; + } + + lll_sync_curr = curr; + if (lll_sync_curr->abort_count < lll_sync_next->abort_count) { + if (lll_sync_curr->abort_count < UINT8_MAX) { + lll_sync_curr->abort_count++; } + + /* Abort current event as next event has higher abort + * count. + */ + return -ECANCELED; + } + + if (lll_sync_next->abort_count < UINT8_MAX) { + lll_sync_next->abort_count++; } + +#else /* !CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ + /* Abort current event as next event is not a + * scan and not a scan aux event. + */ + return -ECANCELED; +#endif /* !CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ } /* Do not abort if current periodic sync event overlaps next interval @@ -1012,6 +1051,14 @@ static void isr_rx_done_cleanup(struct lll_sync *lll, uint8_t crc_ok, bool sync_ /* Reset window widening, as anchor point sync-ed */ lll->window_widening_event_us = 0U; lll->window_size_event_us = 0U; + +#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) + /* Reset LLL abort count as LLL event is gracefully done and + * was not aborted by any other event when current event could + * have been using unreserved time space. + */ + lll->abort_count = 0U; +#endif /* CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ } lll_isr_cleanup(lll); diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c index 98197db94a1..e64754cd43b 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c @@ -253,6 +253,11 @@ uint8_t ll_sync_create(uint8_t options, uint8_t sid, uint8_t adv_addr_type, ull_hdr_init(&sync->ull); lll_hdr_init(lll_sync, sync); +#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) + /* Initialise LLL abort count */ + lll_sync->abort_count = 0U; +#endif /* CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ + /* Enable scanner to create sync */ scan->periodic.sync = sync; @@ -529,6 +534,19 @@ struct ll_sync_set *ull_sync_is_valid_get(struct ll_sync_set *sync) return sync; } +struct lll_sync *ull_sync_lll_is_valid_get(struct lll_sync *lll) +{ + struct ll_sync_set *sync; + + sync = HDR_LLL2ULL(lll); + sync = ull_sync_is_valid_get(sync); + if (sync) { + return &sync->lll; + } + + return NULL; +} + uint16_t ull_sync_handle_get(struct ll_sync_set *sync) { return mem_index_get(sync, ll_sync_pool, sizeof(struct ll_sync_set)); From 07865533901e8c0ccc9d2ebf5eab0f86342a3e60 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 27 Aug 2022 11:22:58 +0530 Subject: [PATCH 172/501] [nrf fromtree] Bluetooth: Controller: Fix prepare pipeline preempt timeout stop Fix prepare pipeline preempt timeout stop from stopping a a prevously started timeout for the next in pipeline event. The preempt timeout started prior for the current event that has its prepare that is invoked is to be not explicitly stopped. If there is a next prepare event in pipeline, then the prior preempt timeout if started will be stopped before starting the new preempt timeout. Refer to implementation in preempt_ticker_start(). Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 2e5d710947a8d8b3fb2b1de8f50459fbd07418a0) --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index 7cb2679194a..57a4d0226dc 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -738,10 +738,13 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, #if !defined(CONFIG_BT_CTLR_LOW_LAT) uint32_t ret; - /* Stop any scheduled preempt ticker */ - ret = preempt_ticker_stop(); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + /* NOTE: preempt timeout started prior for the current event that has + * its prepare that is now invoked is not explicitly stopped here. + * If there is a next prepare event in pipeline, then the prior + * preempt timeout if started will be stopped before starting + * the new preempt timeout. Refer to implementation in + * preempt_ticker_start(). + */ /* Find next prepare needing preempt timeout to be setup */ do { From de7c4905d9495754c82531e211adf39725b10849 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 29 Jul 2022 15:28:39 +0200 Subject: [PATCH 173/501] [nrf fromlist] Bluetooth: df: Add ntf of insufficient resources for IQ samples According to Bluetooth 5.3 Vol 4, Part E section 7.7.65.21 the Controller should send an IQ report with Packet_Status set to 0xFF and Sample_Count to 0x0, to inform Host that it is not able to store IQ samples for all received Constant Tone Extensions and has failed to sample at least once. This commit adds handling of such situation for direction finding in connectionless mode in lower link layer. It includes: - lack of node_rx_iq_report to store IQ samples, - lack of free node_rx to report received advertising data (generates an advertising data report with indication "incomplete, no more to come" and cancels reception of chained PDUs, - cancellation of chained PDUs reception due to other scheduling reasons. In all of these situations CTE reception must be enabled and number of received CTEs is smaller than requested by Host. If there is not sufficient number of node_rx_iq_report nodes and report was generated, the CTE will not be samples in a given periodic advertising synchronization event. The CTE will be sampled again in next event if there are node_rx_iq_report available. End user applications may check periodic advertising sync event counter when use of the reports to be sure about sync event the received report is connected with. Signed-off-by: Piotr Pryga Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit b82f57d185a05d0c59bfb130f94febcec155efba) --- subsys/bluetooth/controller/ll_sw/lll.h | 2 + subsys/bluetooth/controller/ll_sw/lll_sync.h | 10 + .../controller/ll_sw/nordic/lll/lll_conn.c | 2 +- .../controller/ll_sw/nordic/lll/lll_df.c | 81 ++++- .../ll_sw/nordic/lll/lll_df_internal.h | 10 +- .../ll_sw/nordic/lll/lll_df_types.h | 4 + .../ll_sw/nordic/lll/lll_peripheral.c | 2 +- .../controller/ll_sw/nordic/lll/lll_sync.c | 330 +++++++++++++++--- subsys/bluetooth/controller/ll_sw/ull.c | 22 +- subsys/bluetooth/controller/ll_sw/ull_df.c | 32 +- .../bluetooth/controller/ll_sw/ull_scan_aux.c | 2 +- subsys/bluetooth/controller/ll_sw/ull_sync.c | 25 ++ 12 files changed, 448 insertions(+), 74 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/lll.h b/subsys/bluetooth/controller/ll_sw/lll.h index 5e57c99e198..8f53d99346f 100644 --- a/subsys/bluetooth/controller/ll_sw/lll.h +++ b/subsys/bluetooth/controller/ll_sw/lll.h @@ -309,6 +309,8 @@ enum node_rx_type { NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT, NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT, NODE_RX_TYPE_DTM_IQ_SAMPLE_REPORT, + NODE_RX_TYPE_IQ_SAMPLE_REPORT_ULL_RELEASE, + NODE_RX_TYPE_IQ_SAMPLE_REPORT_LLL_RELEASE, #if defined(CONFIG_BT_CTLR_USER_EXT) /* No entries shall be added after the NODE_RX_TYPE_USER_START/END */ diff --git a/subsys/bluetooth/controller/ll_sw/lll_sync.h b/subsys/bluetooth/controller/ll_sw/lll_sync.h index 20ca0781d6d..fb1a120331b 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_sync.h +++ b/subsys/bluetooth/controller/ll_sw/lll_sync.h @@ -64,6 +64,16 @@ struct lll_sync { #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) struct lll_df_sync df_cfg; + /* Member stores one additional IQ report rx node for notification of insufficient + * resources to sample all CTEs in currently pending synchronization event. + * The member is temporary storage used between prepare of an event and IQ data report + * generation. + */ + struct node_rx_iq_report *node_cte_incomplete; + /* Member sotres information if there were inssufficient IQ report rx nodes for all CTEs + * in pending synchronization event. + */ + bool is_cte_incomplete; #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ }; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c index 02eaa450067..34a1572b22b 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c @@ -517,7 +517,7 @@ void lll_conn_isr_tx(void *param) df_rx_params = dbuf_curr_get(&df_rx_cfg->hdr); if (df_rx_params->is_enabled) { - lll_df_conf_cte_rx_enable(df_rx_params->slot_durations, + (void)lll_df_conf_cte_rx_enable(df_rx_params->slot_durations, df_rx_params->ant_sw_len, df_rx_params->ant_ids, df_rx_cfg->chan, CTE_INFO_IN_S1_BYTE, lll->phy_rx); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c index 20e7d82b312..f1957d2b5dd 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c @@ -23,8 +23,9 @@ #include "lll_adv_types.h" #include "lll_adv.h" #include "lll_adv_pdu.h" -#include "lll_df.h" #include "lll_df_types.h" +#include "lll_sync.h" +#include "lll_df.h" #include "lll_df_internal.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) @@ -222,8 +223,8 @@ struct lll_df_sync_cfg *lll_df_sync_cfg_latest_get(struct lll_df_sync *df_cfg, * * In case of AoA mode ant_num and ant_ids parameters are not used. */ -void lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uint8_t *ant_ids, - uint8_t chan_idx, bool cte_info_in_s1, uint8_t phy) +int lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uint8_t *ant_ids, + uint8_t chan_idx, bool cte_info_in_s1, uint8_t phy) { struct node_rx_iq_report *node_rx; @@ -243,14 +244,86 @@ void lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uin radio_df_ant_switch_pattern_set(ant_ids, ant_num); #endif /* CONFIG_BT_CTLR_DF_ANT_SWITCH_RX */ + /* Could be moved up, if Radio setup is not needed if we are not going to report IQ data */ node_rx = ull_df_iq_report_alloc_peek(1); - LL_ASSERT(node_rx); + if (!node_rx) { + return -ENOMEM; + } radio_df_iq_data_packet_set(node_rx->pdu, IQ_SAMPLE_TOTAL_CNT); node_rx->chan_idx = chan_idx; + + return 0; } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX */ +#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) +/** + * @brief Function allocates additional IQ report node for Host notification about + * insufficient resources to sample all CTE in a periodic synchronization event. + * + * @param sync_lll Pointer to periodic synchronization object + * + * @return -ENOMEM in case there is no free node for IQ Data report + * @return -ENOBUFS in case there are no free nodes for report of insufficient resources as well as + * IQ data report + * @return zero in case of success + */ +int lll_df_iq_report_no_resources_prepare(struct lll_sync *sync_lll) +{ + struct node_rx_iq_report *cte_incomplete; + int err; + + /* Allocate additional node for a sync context only once. This is an additional node to + * report there is no more memory to store IQ data, hence some of CTEs are not going + * to be sampled. + */ + if (!sync_lll->node_cte_incomplete && !sync_lll->is_cte_incomplete) { + /* Check if there are free nodes for: + * - storage of IQ data collcted during a PDU reception + * - Host notification about insufficient resources for IQ data + */ + cte_incomplete = ull_df_iq_report_alloc_peek(2); + if (!cte_incomplete) { + /* Check if there is a free node to report insufficient resources only. + * There will be no IQ Data collection. + */ + cte_incomplete = ull_df_iq_report_alloc_peek(1); + if (!cte_incomplete) { + /* No free nodes at all */ + return -ENOBUFS; + } + + /* No memory for IQ data report */ + err = -ENOMEM; + } else { + err = 0; + } + + /* Do actual allocation and store the node for futher processing after a PDU + * reception, + */ + ull_df_iq_report_alloc(); + + /* Store the node in lll_sync object. This is a place where the node may be stored + * until processing afte reception of a PDU to report no IQ data or hand over + * to aux objects for usage in ULL. If there is not enough memory for IQ data + * there is no node to use for temporary storage as it is done for PDUs. + */ + sync_lll->node_cte_incomplete = cte_incomplete; + + /* Reset the state every time the prepare is called. IQ report node may be unchanged + * from former synchronization event. + */ + sync_lll->is_cte_incomplete = false; + } else { + err = 0; + } + + return err; +} +#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ + #if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX) /** * @brief Function initializes parsing of received PDU for CTEInfo. diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_internal.h b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_internal.h index 1766bdd4b2e..174aadef140 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_internal.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_internal.h @@ -6,6 +6,7 @@ /* Forward declaration to avoid unnecessary includes. */ struct lll_adv_sync; +struct lll_sync; /* Enables CTE transmission according to provided configuration */ void lll_df_cte_tx_enable(struct lll_adv_sync *lll_sync, const struct pdu_adv *pdu, @@ -56,8 +57,13 @@ static inline uint8_t lll_df_sync_cfg_is_modified(struct lll_df_sync *df_cfg) } /* Enables CTE reception according to provided configuration */ -void lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uint8_t *ant_ids, - uint8_t chan_idx, bool cte_info_in_s1, uint8_t phy); +int lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uint8_t *ant_ids, + uint8_t chan_idx, bool cte_info_in_s1, uint8_t phy); + +/* Function prepares memory for Host notification about insufficient resources to sample all CTE + * in a given periodic synchronization event. + */ +int lll_df_iq_report_no_resources_prepare(struct lll_sync *sync); /* Configure CTE transmission */ void lll_df_cte_tx_configure(uint8_t cte_type, uint8_t cte_length, uint8_t num_ant_ids, diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_types.h b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_types.h index e3efe8eefc4..4087b35d3bb 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_types.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_types.h @@ -96,6 +96,10 @@ struct iq_sample { /* Receive node aimed to report collected IQ samples during CTE receive */ struct node_rx_iq_report { + /* hdr member must be a first member of the structure. It can't be moved because + * it is expected to be in the beginning of a node memory for common handling of + * all node_rx_xxx types. + */ struct node_rx_hdr hdr; uint8_t sample_count; struct pdu_cte_info cte_info; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c index 598d7d3dacf..026ba1f9f35 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c @@ -225,7 +225,7 @@ static int prepare_cb(struct lll_prepare_param *p) df_rx_params = dbuf_latest_get(&df_rx_cfg->hdr, NULL); if (df_rx_params->is_enabled == true) { - lll_df_conf_cte_rx_enable(df_rx_params->slot_durations, + (void)lll_df_conf_cte_rx_enable(df_rx_params->slot_durations, df_rx_params->ant_sw_len, df_rx_params->ant_ids, data_chan_use, CTE_INFO_IN_S1_BYTE, lll->phy_rx); lll->df_rx_cfg.chan = data_chan_use; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index f1e43088e18..801fef64833 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -60,8 +60,10 @@ static void isr_rx_aux_chain(void *param); static void isr_rx_done_cleanup(struct lll_sync *lll, uint8_t crc_ok, bool sync_term); static void isr_done(void *param); #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) -static int create_iq_report(struct lll_sync *lll, uint8_t rssi_ready, - uint8_t packet_status); +static int iq_report_create_put(struct lll_sync *lll, uint8_t rssi_ready, + uint8_t packet_status); +static int iq_report_incomplete_create_put(struct lll_sync *lll); +static void iq_report_incomplete_release_put(struct lll_sync *lll); static bool is_max_cte_reached(uint8_t max_cte_count, uint8_t cte_count); #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ static uint8_t data_channel_calc(struct lll_sync *lll); @@ -172,9 +174,28 @@ void lll_sync_aux_prepare_cb(struct lll_sync *lll, cfg = lll_df_sync_cfg_latest_get(&lll->df_cfg, NULL); if (cfg->is_enabled) { - lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, cfg->ant_ids, - lll_aux->chan, CTE_INFO_IN_PAYLOAD, lll_aux->phy); + int err; + + /* Prepare additional node for reporting inssufficient memory for IQ samples + * reports. + */ + err = lll_df_iq_report_no_resources_prepare(lll); + if (!err) { + err = lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, + cfg->ant_ids, lll_aux->chan, + CTE_INFO_IN_PAYLOAD, lll_aux->phy); + if (err) { + lll->is_cte_incomplete = true; + } + } else { + lll->is_cte_incomplete = true; + } cfg->cte_count = 0; + } else { + /* If CTE reception is disabled, release additional node allocated to report + * insufficient memory for IQ samples. + */ + iq_report_incomplete_release_put(lll); } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ radio_switch_complete_and_disable(); @@ -279,13 +300,39 @@ static int create_prepare_cb(struct lll_prepare_param *p) if (false) { #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) } else if (cfg->is_enabled) { + int err; + + /* In case of call in create_prepare_cb, new sync event starts hence discard + * previous incomplete state. + */ + lll->is_cte_incomplete = false; + + /* Prepare additional node for reporting inssufficient IQ report nodes issue */ + err = lll_df_iq_report_no_resources_prepare(lll); + if (!err) { + err = lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, + cfg->ant_ids, chan_idx, CTE_INFO_IN_PAYLOAD, + lll->phy); + if (err) { + lll->is_cte_incomplete = true; + } + } else { + lll->is_cte_incomplete = true; + } - lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, cfg->ant_ids, - chan_idx, CTE_INFO_IN_PAYLOAD, lll->phy); cfg->cte_count = 0; + } else { + /* If CTE reception is disabled, release additional node allocated to report + * insufficient memory for IQ samples. + */ + iq_report_incomplete_release_put(lll); +#else + } else { #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - } else if (IS_ENABLED(CONFIG_BT_CTLR_DF_SUPPORT)) { - radio_df_cte_inline_set_enabled(false); + if (IS_ENABLED(CONFIG_BT_CTLR_DF_SUPPORT)) { + /* Disable CTE reception and sampling in Radio */ + radio_df_cte_inline_set_enabled(false); + } } radio_switch_complete_and_disable(); @@ -339,9 +386,31 @@ static int prepare_cb(struct lll_prepare_param *p) cfg = lll_df_sync_cfg_latest_get(&lll->df_cfg, NULL); if (cfg->is_enabled) { - lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, cfg->ant_ids, - chan_idx, CTE_INFO_IN_PAYLOAD, lll->phy); + int err; + + /* In case of call in prepare, new sync event starts hence discard previous + * incomplete state. + */ + lll->is_cte_incomplete = false; + + /* Prepare additional node for reporting inssufficient IQ report nodes issue */ + err = lll_df_iq_report_no_resources_prepare(lll); + if (!err) { + err = lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, + cfg->ant_ids, chan_idx, CTE_INFO_IN_PAYLOAD, + lll->phy); + if (err) { + lll->is_cte_incomplete = true; + } + } else { + lll->is_cte_incomplete = true; + } cfg->cte_count = 0; + } else { + /* If CTE reception is disabled, release additional node allocated to report + * insufficient memory for IQ samples. + */ + iq_report_incomplete_release_put(lll); } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ @@ -616,8 +685,27 @@ static void isr_aux_setup(void *param) cfg = lll_df_sync_cfg_latest_get(&lll->df_cfg, NULL); if (cfg->is_enabled && is_max_cte_reached(cfg->max_cte_count, cfg->cte_count)) { - lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, cfg->ant_ids, - aux_ptr->chan_idx, CTE_INFO_IN_PAYLOAD, aux_ptr->phy); + int err; + + /* Prepare additional node for reporting inssufficient memory for IQ samples + * reports. + */ + err = lll_df_iq_report_no_resources_prepare(lll); + if (!err) { + err = lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, + cfg->ant_ids, aux_ptr->chan_idx, + CTE_INFO_IN_PAYLOAD, aux_ptr->phy); + if (err) { + lll->is_cte_incomplete = true; + } + } else { + lll->is_cte_incomplete = true; + } + } else if (!cfg->is_enabled) { + /* If CTE reception is disabled, release additional node allocated to report + * insufficient memory for IQ samples. + */ + iq_report_incomplete_release_put(lll); } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ radio_switch_complete_and_disable(); @@ -735,7 +823,6 @@ static int isr_rx(struct lll_sync *lll, uint8_t node_type, uint8_t crc_ok, if (node_type != NODE_RX_TYPE_EXT_AUX_REPORT) { lll->is_aux_sched = 1U; } - err = -EBUSY; } else { err = 0; @@ -743,29 +830,37 @@ static int isr_rx(struct lll_sync *lll, uint8_t node_type, uint8_t crc_ok, ull_rx_put(node_rx->hdr.link, node_rx); - sched = true; - } else if (node_type == NODE_RX_TYPE_EXT_AUX_REPORT) { - err = -ENOMEM; - } else { - err = 0; - } - #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) - if (cte_ready) { - /* Retunred value is not checked because it does not matter if there - * is a IQ report to be send towards ULL. There is always periodic sync - * report to be send. - */ - (void)create_iq_report(lll, rssi_ready, BT_HCI_LE_CTE_CRC_OK); - sched = true; - } + if (cte_ready) { + /* If there is a periodic advertising report generate IQ data + * report with valid packet_status if there were free nodes for + * that. Or report insufficient resources for IQ data report. + * + * Retunred value is not checked because it does not matter if there + * is a IQ report to be send towards ULL. There is always periodic + * sync report to be send. + */ + (void)iq_report_create_put(lll, rssi_ready, BT_HCI_LE_CTE_CRC_OK); + } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ + sched = true; + } else { + if (node_type == NODE_RX_TYPE_EXT_AUX_REPORT) { + err = -ENOMEM; + } else { + err = 0; + } + } } else { #if defined(CONFIG_BT_CTLR_DF_SAMPLE_CTE_FOR_PDU_WITH_BAD_CRC) - if (cte_ready) { - err = create_iq_report(lll, rssi_ready, - BT_HCI_LE_CTE_CRC_ERR_CTE_BASED_TIME); + /* In case of reception of chained PDUs IQ samples report for a PDU with wrong + * CRC is handled by caller. It has to be that way to be sure the IQ report + * follows possible periodic advertising report. + */ + if (cte_ready && node_type != NODE_RX_TYPE_EXT_AUX_REPORT) { + err = iq_report_create_put(lll, rssi_ready, + BT_HCI_LE_CTE_CRC_ERR_CTE_BASED_TIME); if (!err) { sched = true; } @@ -824,6 +919,10 @@ static void isr_rx_adv_sync_estab(void *param) if (!trx_done) { /* TODO: Combine the early exit with above if-then-else block */ +#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) + LL_ASSERT(!lll->node_cte_incomplete); +#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ + goto isr_rx_done; } @@ -864,7 +963,6 @@ static void isr_rx_adv_sync_estab(void *param) ull_rx_sched(); } } - isr_rx_done: #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING) && \ defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT) @@ -953,6 +1051,8 @@ static void isr_rx_aux_chain(void *param) */ lll_isr_status_reset(); + rssi_ready = 0U; + cte_ready = 0U; crc_ok = 0U; err = 0; @@ -982,7 +1082,6 @@ static void isr_rx_aux_chain(void *param) if (!trx_done) { /* TODO: Combine the early exit with above if-then-else block */ - err = 0; goto isr_rx_aux_chain_done; @@ -994,7 +1093,6 @@ static void isr_rx_aux_chain(void *param) */ err = isr_rx(lll, NODE_RX_TYPE_EXT_AUX_REPORT, crc_ok, phy_flags_rx, cte_ready, rssi_ready, SYNC_STAT_READY); - if (err == -EBUSY) { return; } @@ -1015,6 +1113,23 @@ static void isr_rx_aux_chain(void *param) node_rx->hdr.rx_ftr.aux_failed = 1U; ull_rx_put(node_rx->hdr.link, node_rx); + + if (!crc_ok) { +#if defined(CONFIG_BT_CTLR_DF_SAMPLE_CTE_FOR_PDU_WITH_BAD_CRC) + if (cte_ready) { + (void)iq_report_create_put(lll, rssi_ready, + BT_HCI_LE_CTE_CRC_ERR_CTE_BASED_TIME); + } +#endif /* CONFIG_BT_CTLR_DF_SAMPLE_CTE_FOR_PDU_WITH_BAD_CRC */ + } else { +#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) + /* Report insufficient resurces for IQ data report and relese additional + * noder_rx_iq_data stored in lll_sync object, to vaoid buffers leakage. + */ + iq_report_incomplete_create_put(lll); +#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ + } + ull_rx_sched(); } @@ -1100,51 +1215,156 @@ static void isr_done(void *param) } #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) -static inline int create_iq_report(struct lll_sync *lll, uint8_t rssi_ready, - uint8_t packet_status) +static void iq_report_create(struct lll_sync *lll, uint8_t rssi_ready, uint8_t packet_status, + uint8_t slot_durations, struct node_rx_iq_report *iq_report) { - struct node_rx_iq_report *iq_report; - struct lll_df_sync_cfg *cfg; struct node_rx_ftr *ftr; uint8_t cte_info; uint8_t ant; + cte_info = radio_df_cte_status_get(); + ant = radio_df_pdu_antenna_switch_pattern_get(); + + iq_report->hdr.type = NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT; + iq_report->sample_count = radio_df_iq_samples_amount_get(); + iq_report->packet_status = packet_status; + iq_report->rssi_ant_id = ant; + iq_report->cte_info = *(struct pdu_cte_info *)&cte_info; + iq_report->local_slot_durations = slot_durations; + /* Event counter is updated to next value during event preparation, hence + * it has to be subtracted to store actual event counter value. + */ + iq_report->event_counter = lll->event_counter - 1; + + ftr = &iq_report->hdr.rx_ftr; + ftr->param = lll; + ftr->rssi = + ((rssi_ready) ? radio_rssi_get() : BT_HCI_LE_RSSI_NOT_AVAILABLE); +} + +static void iq_report_incomplete_create(struct lll_sync *lll, struct node_rx_iq_report *iq_report) +{ + struct node_rx_ftr *ftr; + + iq_report->hdr.type = NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT; + iq_report->sample_count = 0; + iq_report->packet_status = BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES; + /* Event counter is updated to next value during event preparation, + * hence it has to be subtracted to store actual event counter + * value. + */ + iq_report->event_counter = lll->event_counter - 1; + /* The PDU antenna is set in configuration, hence it is always + * available. BT 5.3 Core Spec. does not say if this field + * may be invalid in case of insufficient resources. + */ + iq_report->rssi_ant_id = radio_df_pdu_antenna_switch_pattern_get(); + /* Accodring to BT 5.3, Vol 4, Part E, section 7.7.65.21 below + * fields have invalid values in case of insufficient resources. + */ + iq_report->cte_info = + (struct pdu_cte_info){.time = 0, .rfu = 0, .type = 0}; + iq_report->local_slot_durations = 0; + + ftr = &iq_report->hdr.rx_ftr; + ftr->param = lll; + + ftr->rssi = BT_HCI_LE_RSSI_NOT_AVAILABLE; + ftr->extra = NULL; +} + +static int iq_report_create_put(struct lll_sync *lll, uint8_t rssi_ready, uint8_t packet_status) +{ + struct node_rx_iq_report *iq_report; + struct lll_df_sync_cfg *cfg; + int err; + cfg = lll_df_sync_cfg_curr_get(&lll->df_cfg); if (cfg->is_enabled) { - if (is_max_cte_reached(cfg->max_cte_count, cfg->cte_count)) { - cte_info = radio_df_cte_status_get(); - ant = radio_df_pdu_antenna_switch_pattern_get(); + if (!lll->is_cte_incomplete && + is_max_cte_reached(cfg->max_cte_count, cfg->cte_count)) { iq_report = ull_df_iq_report_alloc(); LL_ASSERT(iq_report); - iq_report->hdr.type = NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT; - iq_report->sample_count = radio_df_iq_samples_amount_get(); - iq_report->packet_status = packet_status; - iq_report->rssi_ant_id = ant; - iq_report->cte_info = *(struct pdu_cte_info *)&cte_info; - iq_report->local_slot_durations = cfg->slot_durations; - /* Event counter is updated to next value during event preparation, hence - * it has to be subtracted to store actual event counter value. + iq_report_create(lll, rssi_ready, packet_status, + cfg->slot_durations, iq_report); + err = 0; + } else if (lll->is_cte_incomplete && is_max_cte_reached(cfg->max_cte_count, + cfg->cte_count)) { + iq_report = lll->node_cte_incomplete; + + /* Reception of chained PDUs may be still in progress. Do not report + * insufficient resources multiple times. */ - iq_report->event_counter = lll->event_counter - 1; + if (iq_report) { + iq_report_incomplete_create(lll, iq_report); + lll->node_cte_incomplete = NULL; - ftr = &iq_report->hdr.rx_ftr; - ftr->param = lll; - ftr->rssi = - ((rssi_ready) ? radio_rssi_get() : BT_HCI_LE_RSSI_NOT_AVAILABLE); + /* Report ready to be send to ULL */ + err = 0; + } else { + /* Incomplete CTE was already reported */ + err = -ENODATA; + } + } else { + err = -ENODATA; + } + } else { + err = -ENODATA; + } + + if (!err) { + ull_rx_put(iq_report->hdr.link, iq_report); - cfg->cte_count += 1U; + cfg->cte_count += 1U; + } + + return err; +} + +static int iq_report_incomplete_create_put(struct lll_sync *lll) +{ + struct lll_df_sync_cfg *cfg; + cfg = lll_df_sync_cfg_curr_get(&lll->df_cfg); + + if (cfg->is_enabled) { + struct node_rx_iq_report *iq_report; + + iq_report = lll->node_cte_incomplete; + + /* Reception of chained PDUs may be still in progress. Do not report + * insufficient resources multiple times. + */ + if (iq_report) { + iq_report_incomplete_create(lll, iq_report); + + lll->node_cte_incomplete = NULL; ull_rx_put(iq_report->hdr.link, iq_report); return 0; + } else { + /* Incomplete CTE was already reported */ + return -ENODATA; } + } return -ENODATA; } +static void iq_report_incomplete_release_put(struct lll_sync *lll) +{ + if (lll->node_cte_incomplete) { + struct node_rx_iq_report *iq_report = lll->node_cte_incomplete; + + iq_report->hdr.type = NODE_RX_TYPE_IQ_SAMPLE_REPORT_LLL_RELEASE; + + ull_rx_put(iq_report->hdr.link, iq_report); + lll->node_cte_incomplete = NULL; + } +} static bool is_max_cte_reached(uint8_t max_cte_count, uint8_t cte_count) { return max_cte_count == BT_HCI_LE_SAMPLE_CTE_ALL || cte_count < max_cte_count; diff --git a/subsys/bluetooth/controller/ll_sw/ull.c b/subsys/bluetooth/controller/ll_sw/ull.c index ca4892bdaa2..86a979addcb 100644 --- a/subsys/bluetooth/controller/ll_sw/ull.c +++ b/subsys/bluetooth/controller/ll_sw/ull.c @@ -448,12 +448,10 @@ static struct { * happen due to supervision timeout and other reasons that dont have an * incoming Rx-ed PDU). */ -#define LINK_RX_POOL_SIZE \ - (sizeof(memq_link_t) * \ - (RX_CNT + 2 + BT_CTLR_MAX_CONN + BT_CTLR_ADV_SET + \ - (BT_CTLR_ADV_ISO_SET * 2) + (BT_CTLR_SCAN_SYNC_SET * 2) + \ - (BT_CTLR_SCAN_SYNC_ISO_SET * 2) + \ - (IQ_REPORT_CNT))) +#define LINK_RX_POOL_SIZE \ + (sizeof(memq_link_t) * \ + (RX_CNT + 2 + BT_CTLR_MAX_CONN + BT_CTLR_ADV_SET + (BT_CTLR_ADV_ISO_SET * 2) + \ + (BT_CTLR_SCAN_SYNC_SET * 2) + (BT_CTLR_SCAN_SYNC_ISO_SET * 2) + (IQ_REPORT_CNT))) static struct { uint16_t quota_pdu; /* Number of un-utilized buffers */ @@ -937,7 +935,18 @@ uint8_t ll_rx_get(void **node_rx, uint16_t *handle) #endif /* CONFIG_BT_CONN || * (CONFIG_BT_OBSERVER && CONFIG_BT_CTLR_ADV_EXT) */ +#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) + } else if (rx->type == NODE_RX_TYPE_IQ_SAMPLE_REPORT_LLL_RELEASE) { + const uint8_t report_cnt = 1U; + + (void)memq_dequeue(memq_ll_rx.tail, &memq_ll_rx.head, NULL); + ll_rx_link_release(link); + ull_iq_report_link_inc_quota(report_cnt); + ull_df_iq_report_mem_release(rx); + ull_df_rx_iq_report_alloc(report_cnt); + goto ll_rx_get_again; +#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ #if defined(CONFIG_BT_CTLR_ADV_PERIODIC) } else if (rx->type == NODE_RX_TYPE_SYNC_CHM_COMPLETE) { rx_link_dequeue_release_quota_inc(link); @@ -2654,6 +2663,7 @@ static inline int rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx) case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT: case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT: case NODE_RX_TYPE_DTM_IQ_SAMPLE_REPORT: + case NODE_RX_TYPE_IQ_SAMPLE_REPORT_LLL_RELEASE: { (void)memq_dequeue(memq_ull_rx.tail, &memq_ull_rx.head, NULL); ll_rx_put(link, rx); diff --git a/subsys/bluetooth/controller/ll_sw/ull_df.c b/subsys/bluetooth/controller/ll_sw/ull_df.c index 3f6813e5f30..d7de0e8ab81 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_df.c +++ b/subsys/bluetooth/controller/ll_sw/ull_df.c @@ -66,9 +66,10 @@ #define IQ_REPORT_STRUCT_OVERHEAD (IQ_REPORT_HEADER_SIZE) #define IQ_SAMPLE_SIZE (sizeof(struct iq_sample)) -#define IQ_REPORT_RX_NODE_POOL_ELEMENT_SIZE \ +#define IQ_REPORT_RX_NODE_POOL_ELEMENT_SIZE \ MROUND(IQ_REPORT_STRUCT_OVERHEAD + (IQ_SAMPLE_TOTAL_CNT * IQ_SAMPLE_SIZE)) -#define IQ_REPORT_POOL_SIZE (IQ_REPORT_RX_NODE_POOL_ELEMENT_SIZE * IQ_REPORT_CNT) +#define IQ_REPORT_POOL_SIZE \ + (IQ_REPORT_RX_NODE_POOL_ELEMENT_SIZE * IQ_REPORT_CNT) /* Memory pool to store IQ reports data */ static struct { @@ -76,11 +77,22 @@ static struct { uint8_t pool[IQ_REPORT_POOL_SIZE]; } mem_iq_report; -/* FIFO to store free IQ report norde_rx objects. */ +/* FIFO to store free IQ report norde_rx objects for LLL to ULL handover. */ static MFIFO_DEFINE(iq_report_free, sizeof(void *), IQ_REPORT_CNT); /* Number of available instance of linked list to be used for node_rx_iq_reports. */ static uint8_t mem_link_iq_report_quota_pdu; + +#if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) +/* Debug variable to store information about current number of allocated node_rx_iq_report. + * It supports verification if there is a resource leak. + * The variable may not be used when multiple + * advertising syncs are enabled. Checks may fail because CTE reception may be enabled/disabled + * in different moments, hence there may be allocated reports when it is expected not to. + */ +COND_CODE_1(CONFIG_BT_PER_ADV_SYNC_MAX, (static uint32_t iq_report_alloc_count;), (EMPTY)) +#define IF_SINGLE_ADV_SYNC_SET(code) COND_CODE_1(CONFIG_BT_PER_ADV_SYNC_MAX, (code), (EMPTY)) +#endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX*/ #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) @@ -437,6 +449,11 @@ uint8_t ll_df_set_cl_iq_sampling_enable(uint16_t handle, slot_minus_us = CTE_LEN_MAX_US; cfg->is_enabled = 0U; } else { +#if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) + /* When CTE is enabled there should be no iq report allocated */ + IF_SINGLE_ADV_SYNC_SET(LL_ASSERT(iq_report_alloc_count == 0)); +#endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ + /* Enable of already enabled CTE updates AoA configuration */ if (!((IS_ENABLED(CONFIG_BT_CTLR_DF_ANT_SWITCH_1US) && slot_durations == BT_HCI_LE_ANTENNA_SWITCHING_SLOT_1US) || @@ -517,6 +534,7 @@ bool ull_df_sync_cfg_is_not_enabled(struct lll_df_sync *df_cfg) return !cfg->is_enabled; } + #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX) || \ @@ -537,17 +555,23 @@ void *ull_df_iq_report_alloc_peek_iter(uint8_t *idx) void *ull_df_iq_report_alloc(void) { +#if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) + IF_SINGLE_ADV_SYNC_SET(iq_report_alloc_count++); +#endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ return MFIFO_DEQUEUE(iq_report_free); } void ull_df_iq_report_mem_release(struct node_rx_hdr *rx) { +#if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) + IF_SINGLE_ADV_SYNC_SET(iq_report_alloc_count--); +#endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ mem_release(rx, &mem_iq_report.free); } void ull_iq_report_link_inc_quota(int8_t delta) { - LL_ASSERT(delta <= 0 || mem_link_iq_report_quota_pdu < IQ_REPORT_CNT); + LL_ASSERT(delta <= 0 || mem_link_iq_report_quota_pdu < (IQ_REPORT_CNT)); mem_link_iq_report_quota_pdu += delta; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index 454953bf5e0..9147665455d 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -36,6 +36,7 @@ #include "ull_scan_internal.h" #include "ull_sync_internal.h" #include "ull_sync_iso_internal.h" +#include "ull_df_internal.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) #define LOG_MODULE_NAME bt_ctlr_ull_scan_aux @@ -524,7 +525,6 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx) aux->rx_incomplete = rx_incomplete; rx_incomplete = NULL; #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */ - } else { aux->data_len += data_len; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c index e64754cd43b..ae05876b178 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c @@ -247,6 +247,7 @@ uint8_t ll_sync_create(uint8_t options, uint8_t sid, uint8_t adv_addr_type, #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) ull_df_sync_cfg_init(&lll_sync->df_cfg); + LL_ASSERT(!lll_sync->node_cte_incomplete); #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ /* Initialise ULL and LLL headers */ @@ -559,6 +560,26 @@ uint16_t ull_sync_lll_handle_get(struct lll_sync *lll) void ull_sync_release(struct ll_sync_set *sync) { +#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) + struct lll_sync *lll = &sync->lll; + + if (lll->node_cte_incomplete) { + const uint8_t release_cnt = 1U; + struct node_rx_hdr *node_hdr; + memq_link_t *link; + + node_hdr = &lll->node_cte_incomplete->hdr; + link = node_hdr->link; + + ll_rx_link_release(link); + ull_iq_report_link_inc_quota(release_cnt); + ull_df_iq_report_mem_release(node_hdr); + ull_df_rx_iq_report_alloc(release_cnt); + + lll->node_cte_incomplete = NULL; + } +#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ + /* Mark the sync context as sync create cancelled */ if (IS_ENABLED(CONFIG_BT_CTLR_CHECK_SAME_PEER_SYNC)) { sync->timeout = 0U; @@ -722,6 +743,10 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux, lll->window_size_event_us = OFFS_UNIT_30_US; } +#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) + lll->node_cte_incomplete = NULL; +#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ + /* Set the state to sync create */ scan->periodic.state = LL_SYNC_STATE_CREATED; if (IS_ENABLED(CONFIG_BT_CTLR_PHY_CODED)) { From cba512c96bc1d1aab937d5eadfe24dc81591f221 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 2 Sep 2022 13:41:07 +0530 Subject: [PATCH 174/501] [nrf fromlist] Bluetooth: Controller: Fix periodic advertising re-enable assertion When periodic advertising with chaining is re-enabled after changing interval or just re-enabled then the chain PDUs where not duplicated causing the LLL to assert detecting the presence of aux pointer but no linked chain PDUs. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 300f3bdc8b1ef8dce2d6a7ac8afcaf02c070a374) --- .../bluetooth/controller/ll_sw/ull_adv_sync.c | 70 +++++++++++++++++-- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c index 50f0e283031..c9f1ce3451d 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c @@ -163,10 +163,45 @@ uint8_t ll_adv_sync_param_set(uint8_t handle, uint16_t interval, uint16_t flags) } #endif /* CONFIG_BT_CTLR_DF_ADV_CTE_TX */ - err = ull_adv_sync_pdu_set_clear(lll_sync, pdu_prev, pdu, 0, 0, NULL); - if (err) { - return err; - } +#if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) + /* Duplicate chain PDUs */ + do { + struct pdu_adv *pdu_chain; + +#endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK */ + err = ull_adv_sync_pdu_set_clear(lll_sync, pdu_prev, pdu, + 0U, 0U, NULL); + if (err) { + return err; + } + +#if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) + pdu_prev = lll_adv_pdu_linked_next_get(pdu_prev); + pdu_chain = lll_adv_pdu_linked_next_get(pdu); + + /* Allocate new chain PDU if required */ + if (pdu_prev) { + /* Prior PDU chain allocation valid */ + if (pdu_chain) { + pdu = pdu_chain; + + continue; + } + + /* Get a new chain PDU */ + pdu_chain = lll_adv_pdu_alloc_pdu_adv(); + if (!pdu_chain) { + return BT_HCI_ERR_INSUFFICIENT_RESOURCES; + } + + /* Link the chain PDU to parent PDU */ + lll_adv_pdu_linked_append(pdu_chain, pdu); + + /* continue back to update the new PDU */ + pdu = pdu_chain; + } + } while (pdu_prev); +#endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK */ lll_adv_sync_data_enqueue(lll_sync, ter_idx); @@ -751,7 +786,10 @@ uint8_t ll_adv_sync_enable(uint8_t handle, uint8_t enable) #endif /* CONFIG_BT_CTLR_DF_ADV_CTE_TX */ #if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) + /* Update ADI while duplicating chain PDUs */ do { + struct pdu_adv *pdu_chain; + #endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK */ err = ull_adv_sync_pdu_set_clear(lll_sync, pdu_prev, pdu, hdr_add_fields, @@ -763,9 +801,29 @@ uint8_t ll_adv_sync_enable(uint8_t handle, uint8_t enable) #if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) pdu_prev = lll_adv_pdu_linked_next_get(pdu_prev); - pdu = lll_adv_pdu_linked_next_get(pdu); + pdu_chain = lll_adv_pdu_linked_next_get(pdu); - LL_ASSERT((pdu_prev && pdu) || (!pdu_prev && !pdu)); + /* Allocate new chain PDU if required */ + if (pdu_prev) { + /* Prior PDU chain allocation valid */ + if (pdu_chain) { + pdu = pdu_chain; + + continue; + } + + /* Get a new chain PDU */ + pdu_chain = lll_adv_pdu_alloc_pdu_adv(); + if (!pdu_chain) { + return BT_HCI_ERR_INSUFFICIENT_RESOURCES; + } + + /* Link the chain PDU to parent PDU */ + lll_adv_pdu_linked_append(pdu_chain, pdu); + + /* continue back to update the new PDU */ + pdu = pdu_chain; + } } while (pdu_prev); #endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK */ } From 4a9575de2533c392749c5f2de41ee33c3adaf203 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 1 Sep 2022 11:42:13 +0530 Subject: [PATCH 175/501] [nrf fromlist] drivers: flash: nrf: Fix ticker stop synchronization Fix usage fault due to spurious ticker timeout expiry post enqueuing of ticker stop operation. Use ticker operation callback to handle completion of ticker stop operation and then give the semaphore to thread to notifying the completion of flash operation. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 011d88823942cf89f5363433ee12691b16cbee92) --- drivers/flash/soc_flash_nrf_ticker.c | 89 ++++++++++++++++++---------- 1 file changed, 59 insertions(+), 30 deletions(-) diff --git a/drivers/flash/soc_flash_nrf_ticker.c b/drivers/flash/soc_flash_nrf_ticker.c index c060e883bf3..1cdec5450a4 100644 --- a/drivers/flash/soc_flash_nrf_ticker.c +++ b/drivers/flash/soc_flash_nrf_ticker.c @@ -35,20 +35,37 @@ struct ticker_sync_context { static struct ticker_sync_context _ticker_sync_context; - /* semaphore for synchronization of flash operations */ static struct k_sem sem_sync; -static inline int _ticker_stop(uint8_t inst_idx, uint8_t u_id, uint8_t tic_id) +static void ticker_stop_work_cb(uint32_t status, void *param) { - int ret = ticker_stop(inst_idx, u_id, tic_id, NULL, NULL); + __ASSERT((status == TICKER_STATUS_SUCCESS || + status == TICKER_STATUS_FAILURE), + "Failed to stop work ticker, ticker job busy.\n"); - if (ret != TICKER_STATUS_SUCCESS && - ret != TICKER_STATUS_BUSY) { - __ASSERT(0, "Failed to stop ticker.\n"); - } + /* notify thread that data is available */ + k_sem_give(&sem_sync); +} + +static void ticker_stop_prepare_cb(uint32_t status, void *param) +{ + uint8_t instance_index; + uint8_t ticker_id; + uint32_t ret; + + __ASSERT(status == TICKER_STATUS_SUCCESS, + "Failed to stop prepare ticker.\n"); - return ret; + /* Get the ticker instance and ticker id for flash operations */ + ll_timeslice_ticker_id_get(&instance_index, &ticker_id); + + /* Stop the work ticker, from ULL_LOW context */ + ret = ticker_stop(instance_index, 2U, (ticker_id + 1U), + ticker_stop_work_cb, NULL); + __ASSERT((ret == TICKER_STATUS_SUCCESS || + ret == TICKER_STATUS_BUSY), + "Failed to request the work ticker to stop.\n"); } static void time_slot_callback_work(uint32_t ticks_at_expire, @@ -58,8 +75,6 @@ static void time_slot_callback_work(uint32_t ticks_at_expire, void *context) { struct flash_op_desc *op_desc; - uint8_t instance_index; - uint8_t ticker_id; int rc; __ASSERT(ll_radio_state_is_idle(), @@ -68,15 +83,21 @@ static void time_slot_callback_work(uint32_t ticks_at_expire, op_desc = context; rc = op_desc->handler(op_desc->context); if (rc != FLASH_OP_ONGOING) { + uint8_t instance_index; + uint8_t ticker_id; + uint32_t ret; + + /* Get the ticker instance and ticker id for flash operations */ ll_timeslice_ticker_id_get(&instance_index, &ticker_id); - /* Stop the time slot ticker */ - _ticker_stop(instance_index, 0, ticker_id); + /* Stop the prepare ticker, from ULL_HIGH context */ + ret = ticker_stop(instance_index, 0U, ticker_id, + ticker_stop_prepare_cb, NULL); + __ASSERT((ret == TICKER_STATUS_SUCCESS || + ret == TICKER_STATUS_BUSY), + "Failed to stop ticker.\n"); _ticker_sync_context.result = (rc == FLASH_OP_DONE) ? 0 : rc; - - /* notify thread that data is available */ - k_sem_give(&sem_sync); } } @@ -85,15 +106,16 @@ static void time_slot_delay(uint32_t ticks_at_expire, uint32_t ticks_delay, { uint8_t instance_index; uint8_t ticker_id; - int err; + uint32_t ret; + /* Get the ticker instance and ticker id for flash operations */ ll_timeslice_ticker_id_get(&instance_index, &ticker_id); - /* start a secondary one-shot ticker after ticks_delay, + /* Start a secondary one-shot ticker after ticks_delay, * this will let any radio role to gracefully abort and release the * Radio h/w. */ - err = ticker_start(instance_index, /* Radio instance ticker */ + ret = ticker_start(instance_index, /* Radio instance ticker */ 1, /* user id for link layer ULL_HIGH */ /* (MAYFLY_CALL_ID_WORKER) */ (ticker_id + 1), /* ticker_id */ @@ -109,14 +131,16 @@ static void time_slot_delay(uint32_t ticks_at_expire, uint32_t ticks_delay, NULL, /* no op callback */ NULL); - if (err != TICKER_STATUS_SUCCESS && err != TICKER_STATUS_BUSY) { + if (ret != TICKER_STATUS_SUCCESS && ret != TICKER_STATUS_BUSY) { + /* Failed to enqueue the ticker start operation request */ _ticker_sync_context.result = 0; - /* abort flash timeslots */ - _ticker_stop(instance_index, 0, ticker_id); - - /* notify thread that data is available */ - k_sem_give(&sem_sync); + /* Abort flash prepare ticker, from ULL_HIGH context */ + ret = ticker_stop(instance_index, 0U, ticker_id, + ticker_stop_prepare_cb, NULL); + __ASSERT((ret == TICKER_STATUS_SUCCESS || + ret == TICKER_STATUS_BUSY), + "Failed to stop ticker.\n"); } } @@ -159,7 +183,6 @@ int nrf_flash_sync_init(void) void nrf_flash_sync_set_context(uint32_t duration) { - /* FLASH_SYNC_SWITCHING_TIME is delay which is always added by * the slot calling mechanism */ @@ -171,12 +194,14 @@ int nrf_flash_sync_exe(struct flash_op_desc *op_desc) { uint8_t instance_index; uint8_t ticker_id; + uint32_t ret; int result; - uint32_t err; + /* Get the ticker instance and ticker id for flash operations */ ll_timeslice_ticker_id_get(&instance_index, &ticker_id); - err = ticker_start(instance_index, + /* Start periodic flash operation prepare time slots */ + ret = ticker_start(instance_index, 3, /* user id for thread mode */ /* (MAYFLY_CALL_ID_PROGRAM) */ ticker_id, /* flash ticker id */ @@ -194,11 +219,15 @@ int nrf_flash_sync_exe(struct flash_op_desc *op_desc) NULL, /* no op callback */ NULL); - if (err != TICKER_STATUS_SUCCESS && err != TICKER_STATUS_BUSY) { + if (ret != TICKER_STATUS_SUCCESS && ret != TICKER_STATUS_BUSY) { + /* Failed to enqueue the ticker start operation request */ result = -ECANCELED; } else if (k_sem_take(&sem_sync, K_MSEC(FLASH_TIMEOUT_MS)) != 0) { - /* Stop any scheduled jobs */ - _ticker_stop(instance_index, 3, ticker_id); + /* Stop any scheduled jobs, from thread context */ + ret = ticker_stop(instance_index, 3U, ticker_id, NULL, NULL); + __ASSERT((ret == TICKER_STATUS_SUCCESS || + ret == TICKER_STATUS_BUSY), + "Failed to stop ticker.\n"); /* wait for operation's complete overrun*/ result = -ETIMEDOUT; From e07198b46fca125989aefda3461cf8879e9fb819 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 1 Sep 2022 12:58:05 +0530 Subject: [PATCH 176/501] [nrf fromlist] drivers: flash: nrf: Fix ticker stop user id value Ticker stop callback are executing in ULL_HIGH priority, correct the value to 1U instead of 0U which is for LLL execution context of the Bluetooth Controller. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit c4cfa3b6d9dd9e18f69da0499339336aa46263c9) --- drivers/flash/soc_flash_nrf_ticker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/flash/soc_flash_nrf_ticker.c b/drivers/flash/soc_flash_nrf_ticker.c index 1cdec5450a4..989a163ca13 100644 --- a/drivers/flash/soc_flash_nrf_ticker.c +++ b/drivers/flash/soc_flash_nrf_ticker.c @@ -91,7 +91,7 @@ static void time_slot_callback_work(uint32_t ticks_at_expire, ll_timeslice_ticker_id_get(&instance_index, &ticker_id); /* Stop the prepare ticker, from ULL_HIGH context */ - ret = ticker_stop(instance_index, 0U, ticker_id, + ret = ticker_stop(instance_index, 1U, ticker_id, ticker_stop_prepare_cb, NULL); __ASSERT((ret == TICKER_STATUS_SUCCESS || ret == TICKER_STATUS_BUSY), @@ -136,7 +136,7 @@ static void time_slot_delay(uint32_t ticks_at_expire, uint32_t ticks_delay, _ticker_sync_context.result = 0; /* Abort flash prepare ticker, from ULL_HIGH context */ - ret = ticker_stop(instance_index, 0U, ticker_id, + ret = ticker_stop(instance_index, 1U, ticker_id, ticker_stop_prepare_cb, NULL); __ASSERT((ret == TICKER_STATUS_SUCCESS || ret == TICKER_STATUS_BUSY), From 8445e4296708e6a7cfb3f532262bfe54f97325c9 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 5 Aug 2022 10:52:19 +0300 Subject: [PATCH 177/501] [nrf fromtree] Bluetooth: host: Fix scan info dangling pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clear pointer to the le_adv_recv() stack frame before returning to the calling function. This fixes a potential compiler warning newer gcc versions. zephyr/subsys/bluetooth/host/scan.c: In function ‘le_adv_recv’: zephyr/subsys/bluetooth/host/scan.c:463:20: error: storing the address of local variable ‘id_addr’ in ‘*info.addr’ [-Werror=dangling-pointer=] 463 | info->addr = &id_addr; | ~~~~~~~~~~~^~~~~~~~~~ zephyr/subsys/bluetooth/host/scan.c:439:22: note: ‘id_addr’ declared here 439 | bt_addr_le_t id_addr; | ^~~~~~~ Fixes #48459 Signed-off-by: Johan Hedberg Signed-off-by: Herman Berget (cherry picked from commit 7e951d003ca6d93b0bf25c96df3d287a6c7e50ca) --- subsys/bluetooth/host/scan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index 95901952ef7..dddb4a217c7 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -462,8 +462,6 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, bt_lookup_id_addr(BT_ID_DEFAULT, addr)); } - info->addr = &id_addr; - if (scan_dev_found_cb) { net_buf_simple_save(buf, &state); @@ -473,6 +471,8 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, net_buf_simple_restore(buf, &state); } + info->addr = &id_addr; + SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&scan_cbs, listener, next, node) { if (listener->recv) { net_buf_simple_save(buf, &state); @@ -484,6 +484,9 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, } } + /* Clear pointer to this stack frame before returning to calling function */ + info->addr = NULL; + #if defined(CONFIG_BT_CENTRAL) check_pending_conn(&id_addr, addr, info->adv_props); #endif /* CONFIG_BT_CENTRAL */ From 90e2d6563144f7b106be9052fc6d43e1d0be71b0 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 5 Aug 2022 10:50:47 +0200 Subject: [PATCH 178/501] [nrf fromtree] Bluetooth: host: Fix SMP local keys check when starting encryption Fix SMP check of existing local keys when attempting to start security with required security mode 1 level 4. The logic for checking the conditions was wrong, leading to a situation where encryption would be attempted to be started by the central instead of initiating a new pairing procedure. This would fail when the connection was encrypted and the connection would be disconnected. Signed-off-by: Joakim Andersson Signed-off-by: Herman Berget (cherry picked from commit bdb4e006a6ddddfe4bc18ce24ef5e77b29fb924b) --- subsys/bluetooth/host/smp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 9e6298f1260..ff5d7659ad8 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -374,15 +374,15 @@ static bool smp_keys_check(struct bt_conn *conn) return false; } - if (conn->required_sec_level > BT_SECURITY_L2 && + if (conn->required_sec_level >= BT_SECURITY_L3 && !(conn->le.keys->flags & BT_KEYS_AUTHENTICATED)) { return false; } - if (conn->required_sec_level > BT_SECURITY_L3 && - !(conn->le.keys->flags & BT_KEYS_AUTHENTICATED) && - !(conn->le.keys->keys & BT_KEYS_LTK_P256) && - !(conn->le.keys->enc_size == BT_SMP_MAX_ENC_KEY_SIZE)) { + if (conn->required_sec_level >= BT_SECURITY_L4 && + !((conn->le.keys->flags & BT_KEYS_AUTHENTICATED) && + (conn->le.keys->keys & BT_KEYS_LTK_P256) && + (conn->le.keys->enc_size == BT_SMP_MAX_ENC_KEY_SIZE))) { return false; } From ef967e365f1972f85e7d2367f4acbe4421059968 Mon Sep 17 00:00:00 2001 From: Matthias Hauser Date: Thu, 11 Aug 2022 11:05:38 +0200 Subject: [PATCH 179/501] [nrf fromtree] Bluetooth: bugfix in applying appearance from settings The len parameter is the settings name length 'appearance' Signed-off-by: Matthias Hauser Signed-off-by: Herman Berget (cherry picked from commit 23323afb4d01c3c744511da14908952fb05d94bd) --- subsys/bluetooth/host/settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/settings.c b/subsys/bluetooth/host/settings.c index 284250a145d..2b99e22157e 100644 --- a/subsys/bluetooth/host/settings.c +++ b/subsys/bluetooth/host/settings.c @@ -186,7 +186,7 @@ static int set(const char *name, size_t len_rd, settings_read_cb read_cb, #if defined(CONFIG_BT_DEVICE_APPEARANCE_DYNAMIC) if (!strncmp(name, "appearance", len)) { - if (len != sizeof(bt_dev.appearance)) { + if (len_rd != sizeof(bt_dev.appearance)) { BT_ERR("Ignoring settings entry 'bt/appearance'. Wrong length."); return -EINVAL; } From 241c81cb21116485fe59f47496237958d4b5c094 Mon Sep 17 00:00:00 2001 From: Jakob Krantz Date: Thu, 25 Aug 2022 16:54:45 +0200 Subject: [PATCH 180/501] [nrf fromtree] Bluetooth: Host: Fix invalid sync term callback params When using periodic advertising list and receiving hci_le_per_adv_sync_established event from controller with an error code the bt_le_per_adv_sync_term_info would be incorrectly populated with le_addr and sid. This is because the current pending advertising sync object is not populated with any le_addr and sid from bt_le_per_adv_sync_create as those are not used when option BT_LE_PER_ADV_SYNC_OPT_USE_PER_ADV_LIST is set. Instead the bt_le_per_adv_sync_term_info shall be populated with the le_addr and sid coming in the event from controller. Signed-off-by: Jakob Krantz Signed-off-by: Herman Berget (cherry picked from commit b26dbbb01b14119612d2a7f37876a08dab937e1a) --- subsys/bluetooth/host/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index dddb4a217c7..814c12774f8 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -907,8 +907,8 @@ void bt_hci_le_per_adv_sync_established(struct net_buf *buf) struct bt_le_per_adv_sync_term_info term_info; /* Terminate the pending PA sync and notify app */ - term_info.addr = &pending_per_adv_sync->addr; - term_info.sid = pending_per_adv_sync->sid; + term_info.addr = &evt->adv_addr; + term_info.sid = evt->sid; term_info.reason = unexpected_evt ? BT_HCI_ERR_UNSPECIFIED : evt->status; /* Deleting before callback, so the caller will be able From 2b8b335dc1de04037e9c00a8e7e90b8472860234 Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Thu, 25 Aug 2022 15:13:00 +0200 Subject: [PATCH 181/501] [nrf fromtree] Bluetooth: Increase RX thread stack size Normal usage for Bluetooth applications are getting close to or already overflowing the default BT RX stack size of 1024. For example: - Discovery using the fixed ATT channel used 984 bytes. - Discovery using an enhanced ATT channel used 1048 bytes, which would lead to stack overflow using the default BT RX thread stack size. Signed-off-by: Herman Berget (cherry picked from commit 5ace0e83431210d12f075158a3f4b16952eb0794) --- subsys/bluetooth/host/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index eaf8a8337fb..86b128b1f96 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -129,7 +129,7 @@ config BT_RX_STACK_SIZE default 2200 if BT_MESH default 2048 if BT_AUDIO default 2200 if BT_SETTINGS - default 1024 + default 1200 help Size of the receiving thread stack. This is the context from which all event callbacks to the application occur. The From bda604e512a48ea042535b908025f5afeb79f05b Mon Sep 17 00:00:00 2001 From: Jonathan Rico Date: Tue, 30 Aug 2022 11:04:15 +0200 Subject: [PATCH 182/501] [nrf fromtree] Bluetooth: smp: Fix SC with fixed passkey passkey confirm should not be called when secure connections are enforced. Fixes #49599 Signed-off-by: Jonathan Rico Signed-off-by: Herman Berget (cherry picked from commit 7db25646b902ecf62799956aeb169e6c2adc2fc9) --- subsys/bluetooth/host/smp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index ff5d7659ad8..86d45793986 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -3144,7 +3144,8 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) } } - if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && + if (!IS_ENABLED(CONFIG_BT_SMP_SC_PAIR_ONLY) && + (DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && !atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && smp_auth_cb && smp_auth_cb->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); @@ -3346,7 +3347,8 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) } } - if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && + if (!IS_ENABLED(CONFIG_BT_SMP_SC_PAIR_ONLY) && + (DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && smp_auth_cb && smp_auth_cb->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); From 15cd94d6632f7e9b72acf25531e64f03a3419d44 Mon Sep 17 00:00:00 2001 From: Adam Augustyn Date: Tue, 26 Jul 2022 09:22:12 +0200 Subject: [PATCH 183/501] [nrf fromtree] Bluetooth: Host: Clear random address field in bt_dev in bt_disable() This commit clears cached random address in bt_dev when calling bt_disable(). This change makes future calls of set_random_address() function possible with previously used address value, after BLE stack re-initialization. Without this change no HCI command was sent, see this condition in set_random_address(): /* Do nothing if we already have the right address */ if (!bt_addr_cmp(addr, &bt_dev.random_addr.a)) { return 0; } Signed-off-by: Adam Augustyn Signed-off-by: Herman Berget (cherry picked from commit e82fb9be206b9268ed32c204c6950c8df27a563d) --- subsys/bluetooth/host/hci_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index c9c61b529ee..eb1e28819b5 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3765,6 +3765,9 @@ int bt_disable(void) /* Some functions rely on checking this bitfield */ memset(bt_dev.supported_commands, 0x00, sizeof(bt_dev.supported_commands)); + /* If random address was set up - clear it */ + bt_addr_le_copy(&bt_dev.random_addr, BT_ADDR_LE_ANY); + /* Abort TX thread */ k_thread_abort(&tx_thread_data); From 246feabcb3dd9f3354861cabd2f35b2188ee2faa Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Mon, 29 Aug 2022 15:46:10 +0200 Subject: [PATCH 184/501] [nrf fromtree] Bluetooth: Host: Clean up buffer user data in case of error `bt_l2cap_chan_send_cb()` overwrote the buffer user data for internal use. In the case where sending fails, this would be visible for the caller. If the caller relied on the buffer user data to be unchanged, this could cause unexpected behavior. L2CAP tx metadata was also not freed in the error case. Signed-off-by: Herman Berget Signed-off-by: Herman Berget (cherry picked from commit a3758a32a2800097e0b00ca402b119cefaf72d4d) --- subsys/bluetooth/host/l2cap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index e0a9bed3ca6..7691bcc2466 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -2952,6 +2952,7 @@ int bt_l2cap_chan_send_cb(struct bt_l2cap_chan *chan, struct net_buf *buf, bt_co { struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); struct l2cap_tx_meta_data *data; + void *old_user_data = l2cap_tx_meta_data(buf); int err; if (!buf) { @@ -3003,7 +3004,11 @@ int bt_l2cap_chan_send_cb(struct bt_l2cap_chan *chan, struct net_buf *buf, bt_co net_buf_put(&le_chan->tx_queue, buf); return l2cap_tx_meta_data(buf)->sent; } + BT_ERR("failed to send message %d", err); + + l2cap_tx_meta_data(buf) = old_user_data; + free_tx_meta_data(data); } return err; From d45f1363f72a81123b77f374114419b2e628364c Mon Sep 17 00:00:00 2001 From: Pierce Lowe Date: Thu, 18 Aug 2022 15:13:49 +0200 Subject: [PATCH 185/501] [nrf fromtree] doc: Updated documentation regarding Primary Service Discovery Now mentions "Discover All Primary Services" sub-procedure as well as the already mentioned "Discover Primary Service by UUID" sub-procedure. Signed-off-by: Pierce Lowe Signed-off-by: Herman Berget (cherry picked from commit c08b75b661f4cd6f08090ab1ad895ef56069503e) --- include/zephyr/bluetooth/gatt.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index 3172a0d00f0..eff08637518 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -1455,8 +1455,9 @@ struct bt_gatt_discover_params { * * This procedure is used by a client to discover attributes on a server. * - * Primary Service Discovery: Procedure allows to discover specific Primary - * Service based on UUID. + * Primary Service Discovery: Procedure allows to discover primary services + * either by Discover All Primary Services or + * Discover Primary Services by Service UUID. * Include Service Discovery: Procedure allows to discover all Include Services * within specified range. * Characteristic Discovery: Procedure allows to discover all characteristics From 644fe57ee9003af3cb2d8e12dc8776bddee77838 Mon Sep 17 00:00:00 2001 From: Pierce Lowe Date: Thu, 18 Aug 2022 15:18:32 +0200 Subject: [PATCH 186/501] [nrf fromtree] doc: Documenting value of bt_gatt_attr->perm after bt_gatt_discover() Permissions can't be discovered so attr->perm is always 0 when returned from bt_gatt_discover() Signed-off-by: Pierce Lowe Signed-off-by: Herman Berget (cherry picked from commit 8800c2bfe1cb17c2589753754da508086320f899) --- include/zephyr/bluetooth/gatt.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index eff08637518..f9e1750e061 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -172,7 +172,10 @@ struct bt_gatt_attr { void *user_data; /** Attribute handle */ uint16_t handle; - /** Attribute permissions */ + /** @brief Attribute permissions. + * + * Will be 0 if returned from bt_gatt_discover(). + */ uint16_t perm; }; From 3afbbacd2ea218f0f203a1c45cb55d5f0eba2820 Mon Sep 17 00:00:00 2001 From: Pierce Lowe Date: Thu, 18 Aug 2022 15:36:25 +0200 Subject: [PATCH 187/501] [nrf fromtree] doc: Added note regarding the intended use for secondary services Noting that secondary services should only be included in other services or higher level specification. Signed-off-by: Pierce Lowe Signed-off-by: Herman Berget (cherry picked from commit 3db330717c1ca3ec4fb133400bf3eb7156aa6cbd) --- include/zephyr/bluetooth/gatt.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index f9e1750e061..30a4ab37996 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -622,6 +622,9 @@ ssize_t bt_gatt_attr_read_service(struct bt_conn *conn, * * Helper macro to declare a secondary service attribute. * + * @note A secondary service is only intended to be included from a primary + * service or another secondary service or other higher layer specification. + * * @param _service Service attribute value. */ #define BT_GATT_SECONDARY_SERVICE(_service) \ From adbe09d60d49be7dcfa773280db501c241dc0074 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Mon, 12 Sep 2022 17:55:45 +0200 Subject: [PATCH 188/501] [nrf fromlist] boards/arm/thingy53_nrf5340: Add mcuboot's gpio aliases Added aliases for the button and LED gpio pin which might be used by the MCUboot. Signed-off-by: Andrzej Puzdrowski --- boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index f6a120d2f34..0d4042f18bf 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -114,6 +114,8 @@ magn0 = &bmm150; watchdog0 = &wdt0; accel0 = &adxl362; + mcuboot-button0 = &button1; + mcuboot-led0 = &blue_led; }; }; From 41567db7db42ef66d013717c638bbb8c5d366585 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Mon, 22 Aug 2022 14:25:46 +0200 Subject: [PATCH 189/501] [nrf fromtree] lib: os: spsc_pbuf: Fix miscalculation in the allocation Wrong value was used for free space calculation. Updating test which previously was hiding this bug. Signed-off-by: Krzysztof Chruscinski --- lib/os/spsc_pbuf.c | 2 +- tests/lib/spsc_pbuf/src/main.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/os/spsc_pbuf.c b/lib/os/spsc_pbuf.c index 967869fb2e8..afe8c206bf9 100644 --- a/lib/os/spsc_pbuf.c +++ b/lib/os/spsc_pbuf.c @@ -169,7 +169,7 @@ int spsc_pbuf_alloc(struct spsc_pbuf *pb, uint16_t len, char **buf) /* Packet will fit at the end */ free_space = remaining - ((rd_idx > 0) ? 0 : sizeof(uint32_t)); } else { - if (rd_idx > remaining) { + if (rd_idx > space) { /* Padding must be added. */ data_loc[wr_idx] = PADDING_MARK; __sync_synchronize(); diff --git a/tests/lib/spsc_pbuf/src/main.c b/tests/lib/spsc_pbuf/src/main.c index ba7a413a8a9..1e39ba94954 100644 --- a/tests/lib/spsc_pbuf/src/main.c +++ b/tests/lib/spsc_pbuf/src/main.c @@ -305,7 +305,7 @@ ZTEST(test_spsc_pbuf, test_0cpy_corner2) pb = spsc_pbuf_init(buffer, sizeof(buffer), 0); capacity = spsc_pbuf_capacity(pb); - /* Commit 5 byte packet. */ + /* Commit 16 byte packet. */ len1 = 16; PACKET_WRITE(pb, len1, len1, 0, len1); @@ -349,10 +349,10 @@ ZTEST(test_spsc_pbuf, test_largest_alloc) PACKET_WRITE(pb, len1, len1, 0, len1); PACKET_CONSUME(pb, len1, 0); - len2 = capacity - ROUND_UP(len1, sizeof(uint32_t)) - 2 * sizeof(uint32_t) - 10; + len2 = capacity - TLEN(len1) - TLEN(10); PACKET_WRITE(pb, len2, len2, 1, len2); - PACKET_WRITE(pb, SPSC_PBUF_MAX_LEN, 0, 1, 8); + PACKET_WRITE(pb, SPSC_PBUF_MAX_LEN, 0, 1, 12); PACKET_WRITE(pb, SPSC_PBUF_MAX_LEN - 1, 0, 1, 12); @@ -363,7 +363,7 @@ ZTEST(test_spsc_pbuf, test_largest_alloc) PACKET_WRITE(pb, len1, len1, 0, len1); PACKET_CONSUME(pb, len1, 0); - len2 = capacity - ROUND_UP(len1, sizeof(uint32_t)) - 2 * sizeof(uint16_t) - 8; + len2 = capacity - TLEN(len1) - TLEN(12); PACKET_WRITE(pb, len2, len2, 1, len2); PACKET_WRITE(pb, SPSC_PBUF_MAX_LEN - 1, 0, 1, 12); From d4ee429d6c524613bc2c13cb1bff948e19365e2a Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Mon, 22 Aug 2022 14:31:09 +0200 Subject: [PATCH 190/501] [nrf fromtree] lib: os: spsc_pbuf: Fix race condition Allocator is adding padding in 2 steps. First padding mark is written to the buffer and then write index is reset to 0. Consumer may interrupt this operation (another thread or core) and fail since it was only checking padding marker and that alone was enough to consume the padding. If that happen before write index got updated, buffer reading become corrupted. Fixing it by adding write index check when padding is found. Signed-off-by: Krzysztof Chruscinski --- lib/os/spsc_pbuf.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/os/spsc_pbuf.c b/lib/os/spsc_pbuf.c index afe8c206bf9..d79b15a63d1 100644 --- a/lib/os/spsc_pbuf.c +++ b/lib/os/spsc_pbuf.c @@ -278,8 +278,18 @@ uint16_t spsc_pbuf_claim(struct spsc_pbuf *pb, char **buf) cache_inv(&data_loc[rd_idx], LEN_SZ, flags); if (data_loc[rd_idx] == PADDING_MARK) { - rd_idx = 0; - *rd_idx_loc = rd_idx; + /* If padding is found we must check if we are interrupted + * padding injection procedure which has 2 steps (adding padding, + * changing write index). If padding is added but index is not + * yet changed, it indicates that there is no data after the + * padding (at the beginning of the buffer). + */ + cache_inv(wr_idx_loc, sizeof(*wr_idx_loc), flags); + if (rd_idx == *wr_idx_loc) { + return 0; + } + + *rd_idx_loc = rd_idx = 0; __sync_synchronize(); cache_wb(rd_idx_loc, sizeof(*rd_idx_loc), flags); /* After reading padding we may find out that buffer is empty. */ @@ -307,14 +317,26 @@ void spsc_pbuf_free(struct spsc_pbuf *pb, uint16_t len) const uint32_t pblen = pb->common.len; const uint32_t flags = pb->common.flags; uint32_t *rd_idx_loc = get_rd_idx_loc(pb, flags); + uint32_t *wr_idx_loc = get_wr_idx_loc(pb, flags); uint16_t rd_idx = *rd_idx_loc + len + LEN_SZ; uint8_t *data_loc = get_data_loc(pb, flags); rd_idx = ROUND_UP(rd_idx, sizeof(uint32_t)); cache_inv(&data_loc[rd_idx], sizeof(uint8_t), flags); /* Handle wrapping or the fact that next packet is a padding. */ - if (rd_idx == pblen || data_loc[rd_idx] == PADDING_MARK) { + if (rd_idx == pblen) { rd_idx = 0; + } else if (data_loc[rd_idx] == PADDING_MARK) { + cache_inv(wr_idx_loc, sizeof(*wr_idx_loc), flags); + /* We may hit the case when producer is in the middle of adding + * a padding (which happens in 2 steps: writing padding, resetting + * write index) and in that case we cannot consume this padding. + */ + if (rd_idx != *wr_idx_loc) { + rd_idx = 0; + } + } else { + /* empty */ } *rd_idx_loc = rd_idx; From ebc09db03f243a8427ffc4507de6793f5ce97991 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Mon, 22 Aug 2022 14:27:20 +0200 Subject: [PATCH 191/501] [nrf fromtree] tests: lib: spsc_pbuf: Improve stress test Improve stress tests to be more robust and demanding. Previous implementation did not reveal race condition. Signed-off-by: Krzysztof Chruscinski --- tests/lib/spsc_pbuf/src/main.c | 92 ++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/tests/lib/spsc_pbuf/src/main.c b/tests/lib/spsc_pbuf/src/main.c index 1e39ba94954..e35ca0b1945 100644 --- a/tests/lib/spsc_pbuf/src/main.c +++ b/tests/lib/spsc_pbuf/src/main.c @@ -11,6 +11,7 @@ #define HDR_LEN sizeof(uint32_t) #define TLEN(len) ROUND_UP(HDR_LEN + len, sizeof(uint32_t)) +#define STRESS_TIMEOUT_MS ((CONFIG_SYS_CLOCK_TICKS_PER_SEC < 10000) ? 1000 : 15000) /* The buffer size itself would be 199 bytes. * 212 - sizeof(struct spsc_pbuf) - 1 = 199. @@ -415,6 +416,7 @@ struct stress_data { uint32_t capacity; uint32_t write_cnt; uint32_t read_cnt; + uint32_t wr_err; }; bool stress_read(void *user_data, uint32_t cnt, bool last, int prio) @@ -422,20 +424,22 @@ bool stress_read(void *user_data, uint32_t cnt, bool last, int prio) struct stress_data *ctx = (struct stress_data *)user_data; char buf[128]; int len; + int rpt = (sys_rand32_get() & 3) + 1; - len = spsc_pbuf_read(ctx->pbuf, buf, (uint16_t)sizeof(buf)); + for (int i = 0; i < rpt; i++) { + len = spsc_pbuf_read(ctx->pbuf, buf, (uint16_t)sizeof(buf)); + if (len == 0) { + return true; + } - if (len == 0) { - return true; - } + if (len < 0) { + zassert_true(false, "Unexpected error: %d, cnt:%d", len, ctx->read_cnt); + } - if (len < 0) { - zassert_true(false, "Unexpected error: %d, cnt:%d", len, ctx->read_cnt); + check_buffer(buf, len, ctx->read_cnt); + ctx->read_cnt++; } - check_buffer(buf, len, ctx->read_cnt); - ctx->read_cnt++; - return true; } @@ -444,36 +448,41 @@ bool stress_write(void *user_data, uint32_t cnt, bool last, int prio) struct stress_data *ctx = (struct stress_data *)user_data; char buf[128]; uint16_t len = 1 + (sys_rand32_get() % (ctx->capacity / 4)); + int rpt = (sys_rand32_get() & 1) + 1; zassert_true(len < sizeof(buf), "len:%d %d", len, ctx->capacity); - memset(buf, (uint8_t)ctx->write_cnt, len); - if (spsc_pbuf_write(ctx->pbuf, buf, len) == 0) { - ctx->write_cnt++; + for (int i = 0; i < rpt; i++) { + memset(buf, (uint8_t)ctx->write_cnt, len); + if (spsc_pbuf_write(ctx->pbuf, buf, len) == len) { + ctx->write_cnt++; + } else { + ctx->wr_err++; + } } return true; } - - ZTEST(test_spsc_pbuf, test_stress) { static uint8_t buffer[128] __aligned(MAX(Z_SPSC_PBUF_DCACHE_LINE, 4)); - static struct stress_data ctx; + static struct stress_data ctx = {}; uint32_t repeat = 0; - ctx.write_cnt = 0; - ctx.read_cnt = 0; ctx.pbuf = spsc_pbuf_init(buffer, sizeof(buffer), 0); ctx.capacity = spsc_pbuf_capacity(ctx.pbuf); - ztress_set_timeout(K_MSEC(5000)); - ZTRESS_EXECUTE(ZTRESS_THREAD(stress_read, &ctx, repeat, 0, Z_TIMEOUT_TICKS(4)), - ZTRESS_THREAD(stress_write, &ctx, repeat, 1000, Z_TIMEOUT_TICKS(4))); + ztress_set_timeout(K_MSEC(STRESS_TIMEOUT_MS)); + TC_PRINT("Reading from an interrupt, writing from a thread\n"); + ZTRESS_EXECUTE(ZTRESS_TIMER(stress_read, &ctx, repeat, Z_TIMEOUT_TICKS(4)), + ZTRESS_THREAD(stress_write, &ctx, repeat, 2000, Z_TIMEOUT_TICKS(4))); + TC_PRINT("Writes:%d failures: %d\n", ctx.write_cnt, ctx.wr_err); - ZTRESS_EXECUTE(ZTRESS_THREAD(stress_write, &ctx, repeat, 0, Z_TIMEOUT_TICKS(4)), + TC_PRINT("Writing from an interrupt, reading from a thread\n"); + ZTRESS_EXECUTE(ZTRESS_TIMER(stress_write, &ctx, repeat, Z_TIMEOUT_TICKS(4)), ZTRESS_THREAD(stress_read, &ctx, repeat, 1000, Z_TIMEOUT_TICKS(4))); + TC_PRINT("Writes:%d failures: %d\n", ctx.write_cnt, ctx.wr_err); } bool stress_claim_free(void *user_data, uint32_t cnt, bool last, int prio) @@ -481,18 +490,21 @@ bool stress_claim_free(void *user_data, uint32_t cnt, bool last, int prio) struct stress_data *ctx = (struct stress_data *)user_data; char *buf; uint16_t len; + int rpt = sys_rand32_get() % 0x3; - len = spsc_pbuf_claim(ctx->pbuf, &buf); + for (int i = 0; i < rpt; i++) { + len = spsc_pbuf_claim(ctx->pbuf, &buf); - if (len == 0) { - return true; - } + if (len == 0) { + return true; + } - check_buffer(buf, len, ctx->read_cnt); + check_buffer(buf, len, ctx->read_cnt); - spsc_pbuf_free(ctx->pbuf, len); + spsc_pbuf_free(ctx->pbuf, len); - ctx->read_cnt++; + ctx->read_cnt++; + } return true; } @@ -500,20 +512,24 @@ bool stress_claim_free(void *user_data, uint32_t cnt, bool last, int prio) bool stress_alloc_commit(void *user_data, uint32_t cnt, bool last, int prio) { struct stress_data *ctx = (struct stress_data *)user_data; - uint16_t len = 1 + (sys_rand32_get() % (ctx->capacity / 4)); + uint32_t rnd = sys_rand32_get(); + uint16_t len = 1 + (rnd % (ctx->capacity / 4)); + int rpt = rnd % 0x3; char *buf; int err; - err = spsc_pbuf_alloc(ctx->pbuf, len, &buf); - zassert_true(err >= 0, NULL); - if (err != len) { - return true; - } + for (int i = 0; i < rpt; i++) { + err = spsc_pbuf_alloc(ctx->pbuf, len, &buf); + zassert_true(err >= 0, NULL); + if (err != len) { + return true; + } - memset(buf, (uint8_t)ctx->write_cnt, len); + memset(buf, (uint8_t)ctx->write_cnt, len); - spsc_pbuf_commit(ctx->pbuf, len); - ctx->write_cnt++; + spsc_pbuf_commit(ctx->pbuf, len); + ctx->write_cnt++; + } return true; } @@ -529,7 +545,7 @@ ZTEST(test_spsc_pbuf, test_stress_0cpy) ctx.pbuf = spsc_pbuf_init(buffer, sizeof(buffer), 0); ctx.capacity = spsc_pbuf_capacity(ctx.pbuf); - ztress_set_timeout(K_MSEC(5000)); + ztress_set_timeout(K_MSEC(STRESS_TIMEOUT_MS)); ZTRESS_EXECUTE(ZTRESS_THREAD(stress_claim_free, &ctx, repeat, 0, Z_TIMEOUT_TICKS(4)), ZTRESS_THREAD(stress_alloc_commit, &ctx, repeat, 1000, Z_TIMEOUT_TICKS(4))); From f76d97c850c92f76d0e8a73a9a9ee1eac5fa4425 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Tue, 23 Aug 2022 16:14:05 +0200 Subject: [PATCH 192/501] [nrf fromtree] lib: os: spsc_pbuf: Minor code cleanup Minor cleanup in allocation function. Using define instead of sizeof(uint32_t) to better explain the purpose. Adding few comments. Signed-off-by: Krzysztof Chruscinski --- lib/os/spsc_pbuf.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/os/spsc_pbuf.c b/lib/os/spsc_pbuf.c index d79b15a63d1..36413a2b35b 100644 --- a/lib/os/spsc_pbuf.c +++ b/lib/os/spsc_pbuf.c @@ -12,6 +12,9 @@ #include #define LEN_SZ sizeof(uint32_t) +/* Amount of data that is left unused to distinguish between empty and full. */ +#define FREE_SPACE_DISTANCE sizeof(uint32_t) + #define PADDING_MARK 0xFF #define GET_UTILIZATION(flags) \ @@ -165,26 +168,28 @@ int spsc_pbuf_alloc(struct spsc_pbuf *pb, uint16_t len, char **buf) space = LEN_SZ + 1; } - if (remaining >= space) { - /* Packet will fit at the end */ - free_space = remaining - ((rd_idx > 0) ? 0 : sizeof(uint32_t)); + if ((remaining >= space) || (rd_idx <= space)) { + /* Packet will fit at the end. Free space depends on + * presence of data at the beginning of the buffer since + * there must be one word not used to distinguish between + * empty and full state. + */ + free_space = remaining - ((rd_idx > 0) ? 0 : FREE_SPACE_DISTANCE); } else { - if (rd_idx > space) { - /* Padding must be added. */ - data_loc[wr_idx] = PADDING_MARK; - __sync_synchronize(); - cache_wb(&data_loc[wr_idx], sizeof(uint8_t), flags); - - wr_idx = 0; - *wr_idx_loc = wr_idx; - - free_space = rd_idx - sizeof(uint32_t); - } else { - free_space = remaining - (rd_idx > 0 ? 0 : sizeof(uint32_t)); - } + /* Padding must be added. */ + data_loc[wr_idx] = PADDING_MARK; + __sync_synchronize(); + cache_wb(&data_loc[wr_idx], sizeof(uint8_t), flags); + + wr_idx = 0; + *wr_idx_loc = wr_idx; + + /* Obligatory one word empty space. */ + free_space = rd_idx - FREE_SPACE_DISTANCE; } } else { - free_space = rd_idx - wr_idx - sizeof(uint32_t); + /* Obligatory one word empty space. */ + free_space = rd_idx - wr_idx - FREE_SPACE_DISTANCE; } len = MIN(len, MAX(free_space - (int32_t)LEN_SZ, 0)); From 0d3e7b142230e8028d9f198dba6f25033114135c Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Wed, 31 Aug 2022 08:52:07 +0200 Subject: [PATCH 193/501] [nrf fromtree] testsuite: ztress: First sys_rand_get32 from thread Added a workaround to call random generator once during the initialization. It is done to handle XOSHIRO generator limitation which performs initialization in the first sys_rand32_get call. And for some entropy generators it cannot be done from an interrupt context and it happens if k_timer context is used which expires first. Cherry-picked from f3ea32b01d. Signed-off-by: Krzysztof Chruscinski --- subsys/testsuite/ztest/src/ztress.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subsys/testsuite/ztest/src/ztress.c b/subsys/testsuite/ztest/src/ztress.c index 259a9d22844..2cc5a0f7590 100644 --- a/subsys/testsuite/ztest/src/ztress.c +++ b/subsys/testsuite/ztest/src/ztress.c @@ -466,6 +466,12 @@ static int ztress_cpu_clock_to_sys_clock_check(const struct device *unused) */ cpu_sys_clock_ok = t <= 12; + /* Read first random number. There are some generators which do not support + * reading first random number from an interrupt context (initialization + * is performed at the first read). + */ + (void)sys_rand32_get(); + return 0; } From 44ede1e459c061fb1f7b65431535d6b66654ec78 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Tue, 6 Sep 2022 12:50:10 +0200 Subject: [PATCH 194/501] [nrf fromtree] testsuite: ztress: Use XOSHIRO generator in ztress Use XOSHIRO random number generator if target has entropy generator. Some entropy generators may have limitations (e.g. only thread context) which would conflict with ztress usage. Added Kconfig.defconfig for testsuite. Cherry-picked from 2b19e7140b Signed-off-by: Krzysztof Chruscinski --- Kconfig.zephyr | 2 ++ subsys/testsuite/Kconfig.defconfig | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 subsys/testsuite/Kconfig.defconfig diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 7a2b45d2cf9..63096590bcf 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -27,6 +27,8 @@ osource "$(KCONFIG_BINARY_DIR)/Kconfig.soc.defconfig" osource "soc/$(ARCH)/*/Kconfig.defconfig" # This loads the toolchain defconfigs osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig.defconfig" +# This loads the testsuite defconfig +source "subsys/testsuite/Kconfig.defconfig" menu "Modules" diff --git a/subsys/testsuite/Kconfig.defconfig b/subsys/testsuite/Kconfig.defconfig new file mode 100644 index 00000000000..429def054dd --- /dev/null +++ b/subsys/testsuite/Kconfig.defconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if TEST + +choice RNG_GENERATOR_CHOICE + default XOSHIRO_RANDOM_GENERATOR if ZTRESS && ENTROPY_HAS_DRIVER +endchoice + +endif # TEST From 68f2461f35efe81c2ce3edecc8b1d56248dc483f Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 11 Aug 2022 18:01:47 +0200 Subject: [PATCH 195/501] [nrf fromtree] doc: add missing caption for extlinks Starting with Sphinx 6.0, extlinks caption with %s will be required. Sphinx 5.x already warns about this requirements, so fix it. Signed-off-by: Gerard Marull-Paretas --- doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 662cd2d7217..4c687e7cf9b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -280,8 +280,8 @@ # -- Linkcheck options ---------------------------------------------------- extlinks = { - "jira": ("https://jira.zephyrproject.org/browse/%s", ""), - "github": ("https://github.com/zephyrproject-rtos/zephyr/issues/%s", ""), + "jira": ("https://jira.zephyrproject.org/browse/%s", "JIRA #%s"), + "github": ("https://github.com/zephyrproject-rtos/zephyr/issues/%s", "GitHub #%s"), } linkcheck_timeout = 30 From 587a483ffa66852d27f505fd0cf81c15f28fd638 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 11 Aug 2022 17:55:42 +0200 Subject: [PATCH 196/501] [nrf fromtree] doc: update requirements Update to Sphinx 5.x, also update breathe since version 4.34 is the first to officially support Sphinx 5.x. Signed-off-by: Gerard Marull-Paretas Signed-off-by: Thomas Stilwell --- scripts/requirements-doc.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/requirements-doc.txt b/scripts/requirements-doc.txt index abc92e70412..e5bdac0a21a 100644 --- a/scripts/requirements-doc.txt +++ b/scripts/requirements-doc.txt @@ -1,7 +1,7 @@ # DOC: used to generate docs -breathe>=4.30,<4.33 # 4.33: disabled due to #803 and #805 issues -sphinx~=4.0 +breathe>=4.34 +sphinx~=5.0 sphinx_rtd_theme~=1.0 sphinx-tabs sphinxcontrib-svg2pdfconverter From 86893246053c50d34618f09ec6722cae8ba19472 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 11 Aug 2022 17:53:33 +0200 Subject: [PATCH 197/501] [nrf fromtree] drivers: spi: fix sample syntax Upcoming versions of breathe highlight code embedded in Doxygen blocks. In this case, the Devicetree fragment contained invalid syntax leading to Sphinx warnings. Signed-off-by: Gerard Marull-Paretas --- include/zephyr/drivers/spi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/zephyr/drivers/spi.h b/include/zephyr/drivers/spi.h index 34e23d7d830..acac793bd79 100644 --- a/include/zephyr/drivers/spi.h +++ b/include/zephyr/drivers/spi.h @@ -163,11 +163,11 @@ struct spi_cs_control { * Example devicetree fragment: * * @code{.devicetree} - * gpio1: gpio@... { ... }; + * gpio1: gpio@abcd0001 { ... }; * - * gpio2: gpio@... { ... }; + * gpio2: gpio@abcd0002 { ... }; * - * spi@... { + * spi@abcd0003 { * compatible = "vnd,spi"; * cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>, * <&gpio2 20 GPIO_ACTIVE_LOW>; From a1b281e16961fcfd04fbb6bb691dd1ee4d0123bf Mon Sep 17 00:00:00 2001 From: Piotr Golyzniak Date: Mon, 1 Aug 2022 13:06:01 +0200 Subject: [PATCH 198/501] [nrf noup] scripts: add quarantine file Add scripts/quarantine.yaml file, which will be used in CI. Signed-off-by: Piotr Golyzniak --- scripts/quarantine.yaml | 186 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 scripts/quarantine.yaml diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml new file mode 100644 index 00000000000..3befbe01e93 --- /dev/null +++ b/scripts/quarantine.yaml @@ -0,0 +1,186 @@ +# The configurations resulting as a product of scenarios and platforms +# will be skipped if quarantine is used. More details here: +# https://docs.zephyrproject.org/latest/guides/test/twister.html#quarantine + +- scenarios: + - drivers.modem.build + platforms: + - nrf52dk_nrf52832 + +- scenarios: + - sample.tfm.secure_partition + - sample.tfm.secure_partition.ipc + - drivers.hwinfo.api + platforms: + - nrf9160dk_nrf9160_ns + - nrf5340dk_nrf5340_cpuapp_ns + comment: "https://projecttools.nordicsemi.no/jira/browse/NCSDK-7558" + +- scenarios: + - libraries.libc.newlib.thread_safety.userspace.stress + - libraries.libc.newlib_nano.thread_safety.userspace.stress + platforms: + - nrf52dk_nrf52832 + - nrf9160dk_nrf9160_ns + - nrf9160dk_nrf9160 + - nrf52833dk_nrf52833 + comment: "Might be related: https://github.com/zephyrproject-rtos/zephyr/issues/38044" + +- scenarios: + - sample.psa_crypto + - sample.tfm.protected_storage + - sample.tfm_ipc + - sample.tfm.psa_internal_trusted_storage_test + - sample.tfm.psa_protected_storage_test + - sample.tfm.tfm_regression + - arch.arm.swap.tz + - arch.arm.swap.tz_off + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Upstream issue (imgtool version related): https://github.com/zephyrproject-rtos/zephyr/issues/40254" + +- scenarios: + - sample.drivers.crypto.mbedtls + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "MBEDTLS_BUILTIN not supported for TF-M builds" + +- scenarios: + - testing.ztest.busy_sim + - testing.ztest.busy_sim_nrf52840dk_pin + platforms: + - nrf52840dk_nrf52840 + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.unary_f64 + - libraries.libc.newlib.thread_safety.userspace.stress + - libraries.libc.newlib_nano.thread_safety.userspace.stress + platforms: + - nrf5340dk_nrf5340_cpunet + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_f16 + - libraries.cmsis_dsp.matrix.binary_f16.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_q15 + - libraries.cmsis_dsp.matrix.binary_q15.fpu + - libraries.cmsis_dsp.matrix.unary_f32 + - libraries.cmsis_dsp.matrix.unary_f32.fpu + - libraries.cmsis_dsp.matrix.unary_f64 + - libraries.cmsis_dsp.matrix.unary_f64.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Flash overflows" + +# Already fixed in Upstream by this commit: +# https://github.com/zephyrproject-rtos/zephyr/commit/20ff55e234cccea801717723146aa94458348586 +# should be introduced with upmerge Zephyr to version 3.1.0 (or later) +- scenarios: + - sample.bluetooth.central.multilink + - sample.bluetooth.peripheral_identity + platforms: + - qemu_cortex_m3 + comment: "Flash overflows. Already fixed in Upstream Zephyr." + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.unary_f64 + platforms: + - qemu_cortex_m3 + comment: "Flash overflows" + +# Already reported in this issue: +# https://github.com/zephyrproject-rtos/zephyr/issues/44948 +- scenarios: + - libraries.cmsis_dsp.transform.cf64.fpu + - libraries.cmsis_dsp.transform.rf64.fpu + platforms: + - mps2_an521_remote + comment: "Flash overflows" + +# libsdl2-dev package should be added into docker image +- scenarios: + - sample.boards.nrf.nrf_led_matrix + - sample.display.lvgl.gui + platforms: + - native_posix + comment: "libsdl2-dev package not available" + +# g++-multilib package should be added into docker image, already reported here: +# https://ci-help.nordicsemi.no/#ticket/zoom/1713 +- scenarios: + - cpp.main + - cpp.main.minimal + - sample.modules.chre + - libraries.cbprintf_package_cpp + - libraries.cbprintf_package_fp_align_offset_cpp + - libraries.cbprintf_package_fp_cpp + - libraries.cbprintf_package_long_double_align_offset_cpp + - libraries.cbprintf_package_long_double_cpp + - libraries.cbprintf_package_nano_cpp + - libraries.cbprintf_package_no_generic_cpp + - logging.log_api_deferred_64b_timestamp_cpp + - logging.log_api_deferred_64b_timestamp_cpp.tagged_args + - logging.log_api_deferred_func_prefix_cpp + - logging.log_api_deferred_func_prefix_cpp.tagged_args + - logging.log_api_deferred_no_overflow_cpp + - logging.log_api_deferred_no_overflow_cpp.tagged_args + - logging.log_api_deferred_overflow_cpp + - logging.log_api_deferred_overflow_cpp.tagged_args + - logging.log_api_deferred_overflow_rt_filter_cpp + - logging.log_api_deferred_overflow_rt_filter_cpp.tagged_args + - logging.log_api_deferred_printk_cpp + - logging.log_api_deferred_printk_cpp.tagged_args + - logging.log_api_deferred_static_filter_cpp + - logging.log_api_deferred_static_filter_cpp.tagged_args + - logging.log_api_frontend_cpp + - logging.log_api_frontend_dbg_cpp + - logging.log_api_frontend_immediate_cpp + - logging.log_api_frontend_no_backends_cpp + - logging.log_api_frontend_only_cpp + - logging.log_api_immediate_64b_timestamp_cpp + - logging.log_api_immediate_64b_timestamp_cpp.tagged_args + - logging.log_api_immediate_cpp + - logging.log_api_immediate_cpp.tagged_args + - logging.log_api_immediate_printk_cpp + - logging.log_api_immediate_printk_cpp.tagged_args + - logging.log_api_immediate_rt_filter_cpp + - logging.log_api_immediate_rt_filter_cpp.tagged_args + - logging.log_api_immediate_static_filter_cpp + - logging.log_api_immediate_static_filter_cpp.tagged_args + - testing.ztest.base.cpp + platforms: + - native_posix + comment: "g++-multilib package not available" + +- scenarios: + - sample.net.zperf.netusb_ecm + - sample.net.zperf.netusb_eem + - sample.net.zperf.netusb_rndis + platforms: + - nrf52833dk_nrf52833 + comment: "Ram overflows, also in the upstream" + +- scenarios: + - kernel.common.picolibc + - libraries.picolibc + - libraries.libc.picolibc.mem_alloc + - libraries.picolibc.sprintf_new + platforms: + - nrf52dk_nrf52832 + comment: "Ram overflows, also in the upstream" From e81870b779762f577ea0f3ba058d446d10eaf5ac Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Thu, 1 Sep 2022 12:17:17 +0200 Subject: [PATCH 199/501] [nrf fromlist] tests: logging: log_core_additional: Fix missing deps Add LOG_OUTPUT to the test configuration. Signed-off-by: Krzysztof Chruscinski --- tests/subsys/logging/log_core_additional/log_sync.conf | 1 + tests/subsys/logging/log_core_additional/log_user.conf | 1 + tests/subsys/logging/log_core_additional/prj.conf | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/subsys/logging/log_core_additional/log_sync.conf b/tests/subsys/logging/log_core_additional/log_sync.conf index f65e5f22bb3..2acc46202fe 100644 --- a/tests/subsys/logging/log_core_additional/log_sync.conf +++ b/tests/subsys/logging/log_core_additional/log_sync.conf @@ -2,5 +2,6 @@ CONFIG_MAIN_THREAD_PRIORITY=5 CONFIG_ZTEST=y CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG=y +CONFIG_LOG_OUTPUT=y CONFIG_LOG_BACKEND_UART=y CONFIG_LOG_MODE_IMMEDIATE=y diff --git a/tests/subsys/logging/log_core_additional/log_user.conf b/tests/subsys/logging/log_core_additional/log_user.conf index b2da7660295..c83b097b267 100644 --- a/tests/subsys/logging/log_core_additional/log_user.conf +++ b/tests/subsys/logging/log_core_additional/log_user.conf @@ -3,6 +3,7 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG=y +CONFIG_LOG_OUTPUT=y CONFIG_LOG_RUNTIME_FILTERING=y CONFIG_LOG_PROCESS_THREAD=n CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=1 diff --git a/tests/subsys/logging/log_core_additional/prj.conf b/tests/subsys/logging/log_core_additional/prj.conf index c4699d6616a..460ed7ebb28 100644 --- a/tests/subsys/logging/log_core_additional/prj.conf +++ b/tests/subsys/logging/log_core_additional/prj.conf @@ -2,6 +2,7 @@ CONFIG_MAIN_THREAD_PRIORITY=5 CONFIG_ZTEST=y CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG=y +CONFIG_LOG_OUTPUT=y CONFIG_LOG_PRINTK=n CONFIG_LOG_SPEED=y CONFIG_LOG_BUFFER_SIZE=1024 From 17c59d3e50fb6ea2f31c2124c99795e0e6e6d3c0 Mon Sep 17 00:00:00 2001 From: Artur Hadasz Date: Wed, 14 Sep 2022 10:30:14 +0200 Subject: [PATCH 200/501] [nrf fromtree] modules: hal_nordic: nrf_802154 serialization race condition fix Fixed a race condition resulting in a serialization error. Signed-off-by: Artur Hadasz (cherry picked from 2314d971e78ed099ecb14fc5aaf2b4fbce5edbf4) --- .../platform/nrf_802154_spinel_response_notifier.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/hal_nordic/nrf_802154/serialization/platform/nrf_802154_spinel_response_notifier.c b/modules/hal_nordic/nrf_802154/serialization/platform/nrf_802154_spinel_response_notifier.c index 036dd16c46f..6785d21982c 100644 --- a/modules/hal_nordic/nrf_802154/serialization/platform/nrf_802154_spinel_response_notifier.c +++ b/modules/hal_nordic/nrf_802154/serialization/platform/nrf_802154_spinel_response_notifier.c @@ -68,7 +68,6 @@ nrf_802154_spinel_notify_buff_t *nrf_802154_spinel_response_notifier_property_aw uint32_t timeout) { nrf_802154_spinel_notify_buff_t *result = NULL; - int ret; k_timeout_t k_timeout; @@ -86,11 +85,6 @@ nrf_802154_spinel_notify_buff_t *nrf_802154_spinel_response_notifier_property_aw LOG_ERR("No response within timeout %u", timeout); } - ret = k_mutex_unlock(&await_mutex); - assert(ret == 0); - (void)ret; - LOG_DBG("Unlocking response notifier"); - return result; } @@ -98,13 +92,20 @@ void nrf_802154_spinel_response_notifier_free(nrf_802154_spinel_notify_buff_t *p { struct spinel_notify_buff_internal *p_notify_buff_free; + int ret; p_notify_buff_free = CONTAINER_OF(p_notify, struct spinel_notify_buff_internal, buff); assert(p_notify_buff_free == ¬ify_buff); + LOG_DBG("Unlocking response notifier"); + p_notify_buff_free->free = true; + + ret = k_mutex_unlock(&await_mutex); + assert(ret == 0); + (void)ret; } void nrf_802154_spinel_response_notifier_property_notify(spinel_prop_key_t property, From 97c4a1a6d1bda83f0272d9bbf68b211efadc7b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20J=C3=B8lsgard?= Date: Fri, 18 Mar 2022 10:50:00 +0100 Subject: [PATCH 201/501] [nrf fromtree] scripts/Kconfig: add dt_node_array_prop Kconfig functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The motivation is to allow accessing array elements from device tree properties in Kconfig. * Add dt_node_array_prop and _node_array_prop functions to extract the array elements from properties. * Add 'dt_node_array_prop_int' and 'dt_node_array_prop_hex' keys to use in Kconfig. Signed-off-by: Eivind Jølsgard (cherry picked from commit 3865e08) --- scripts/kconfig/kconfigfunctions.py | 56 +++++++++++++++++++ tests/misc/kconfigoptions/CMakeLists.txt | 8 +++ tests/misc/kconfigoptions/Kconfig | 19 +++++++ .../misc/kconfigoptions/native_posix.overlay | 9 +++ tests/misc/kconfigoptions/prj.conf | 1 + tests/misc/kconfigoptions/src/main.c | 32 +++++++++++ tests/misc/kconfigoptions/testcase.yaml | 4 ++ 7 files changed, 129 insertions(+) create mode 100644 tests/misc/kconfigoptions/CMakeLists.txt create mode 100644 tests/misc/kconfigoptions/Kconfig create mode 100644 tests/misc/kconfigoptions/native_posix.overlay create mode 100644 tests/misc/kconfigoptions/prj.conf create mode 100644 tests/misc/kconfigoptions/src/main.c create mode 100644 tests/misc/kconfigoptions/testcase.yaml diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index fac2d425788..6bb4f931bb7 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -211,6 +211,32 @@ def _node_int_prop(node, prop, unit=None): return node.props[prop].val >> _dt_units_to_scale(unit) +def _node_array_prop(node, prop, index=0, unit=None): + """ + This function takes a 'node' and will look to see if that 'node' has a + property called 'prop' and if that 'prop' is an array type will return + the value of the property 'prop' at the given 'index' as either a string int + or string hex value. If the property 'prop' is not found or the given 'index' + is out of range it will return 0. + + The function will divide the value based on 'unit': + None No division + 'k' or 'K' divide by 1024 (1 << 10) + 'm' or 'M' divide by 1,048,576 (1 << 20) + 'g' or 'G' divide by 1,073,741,824 (1 << 30) + """ + if not node: + return 0 + + if prop not in node.props: + return 0 + if node.props[prop].type != "array": + return 0 + if int(index) >= len(node.props[prop].val): + return 0 + return node.props[prop].val[int(index)] >> _dt_units_to_scale(unit) + + def _dt_chosen_reg_addr(kconf, chosen, index=0, unit=None): """ This function takes a 'chosen' property and treats that property as a path @@ -448,6 +474,34 @@ def dt_node_int_prop(kconf, name, path, prop, unit=None): if name == "dt_node_int_prop_hex": return hex(_node_int_prop(node, prop, unit)) + +def dt_node_array_prop(kconf, name, path, prop, index, unit=None): + """ + This function takes a 'path', property name ('prop') and index ('index') + and looks for an EDT node at that path. If it finds an EDT node, it will + look to see if that node has a property called 'prop' and if that 'prop' + is an array type will return the value of the property 'prop' at the given + 'index' as either a string int or string hex value. If not found we return 0. + + The function will divide the value based on 'unit': + None No division + 'k' or 'K' divide by 1024 (1 << 10) + 'm' or 'M' divide by 1,048,576 (1 << 20) + 'g' or 'G' divide by 1,073,741,824 (1 << 30) + """ + if doc_mode or edt is None: + return "0" + + try: + node = edt.get_node(path) + except edtlib.EDTError: + return "0" + if name == "dt_node_array_prop_int": + return str(_node_array_prop(node, prop, index, unit)) + if name == "dt_node_array_prop_hex": + return hex(_node_array_prop(node, prop, index, unit)) + + def dt_node_str_prop_equals(kconf, _, path, prop, val): """ This function takes a 'path' and property name ('prop') looks for an EDT @@ -611,6 +665,8 @@ def shields_list_contains(kconf, _, shield): "dt_nodelabel_has_prop": (dt_nodelabel_has_prop, 2, 2), "dt_node_int_prop_int": (dt_node_int_prop, 2, 3), "dt_node_int_prop_hex": (dt_node_int_prop, 2, 3), + "dt_node_array_prop_int": (dt_node_array_prop, 3, 4), + "dt_node_array_prop_hex": (dt_node_array_prop, 3, 4), "dt_node_str_prop_equals": (dt_node_str_prop_equals, 3, 3), "dt_nodelabel_has_compat": (dt_nodelabel_has_compat, 2, 2), "dt_nodelabel_path": (dt_nodelabel_path, 1, 1), diff --git a/tests/misc/kconfigoptions/CMakeLists.txt b/tests/misc/kconfigoptions/CMakeLists.txt new file mode 100644 index 00000000000..ab614a65921 --- /dev/null +++ b/tests/misc/kconfigoptions/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.13.1) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(kconfigoptions) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/misc/kconfigoptions/Kconfig b/tests/misc/kconfigoptions/Kconfig new file mode 100644 index 00000000000..ed009c66376 --- /dev/null +++ b/tests/misc/kconfigoptions/Kconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2022 Nordic Semiconductor +# +# SPDX-License-Identifier: Apache-2.0 +# + +DT_FLASH_CONTROLLER := $(dt_nodelabel_path,flashcontroller0) + +config FLASH_CONTROLLER_ADDRESS + int + default $(dt_node_array_prop_int,$(DT_FLASH_CONTROLLER),reg,0) + +config FLASH_CONTROLLER_SIZE + int + default $(dt_node_array_prop_int,$(DT_FLASH_CONTROLLER),reg,1) + + +menu "Zephyr Kernel" +source "Kconfig.zephyr" +endmenu diff --git a/tests/misc/kconfigoptions/native_posix.overlay b/tests/misc/kconfigoptions/native_posix.overlay new file mode 100644 index 00000000000..1da8f728393 --- /dev/null +++ b/tests/misc/kconfigoptions/native_posix.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + + &flashcontroller0 { + reg = <0x00000001 4194304>; +}; diff --git a/tests/misc/kconfigoptions/prj.conf b/tests/misc/kconfigoptions/prj.conf new file mode 100644 index 00000000000..9467c292689 --- /dev/null +++ b/tests/misc/kconfigoptions/prj.conf @@ -0,0 +1 @@ +CONFIG_ZTEST=y diff --git a/tests/misc/kconfigoptions/src/main.c b/tests/misc/kconfigoptions/src/main.c new file mode 100644 index 00000000000..62de4e212be --- /dev/null +++ b/tests/misc/kconfigoptions/src/main.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/** + * @brief Test . + * + */ +void test_kconfigoptions_array_hex(void) +{ + zassert_equal(0x1, CONFIG_FLASH_CONTROLLER_ADDRESS, + "Unexpected flash controller address (%d)", CONFIG_FLASH_CONTROLLER_ADDRESS); +} + +void test_kconfigoptions_array_int(void) +{ + zassert_equal(4194304, CONFIG_FLASH_CONTROLLER_SIZE, + "Unexpected flash controller size (%d)", CONFIG_FLASH_CONTROLLER_SIZE); +} + +void test_main(void) +{ + ztest_test_suite(kconfigoptions, + ztest_unit_test(test_kconfigoptions_array_hex), + ztest_unit_test(test_kconfigoptions_array_int) + ); + ztest_run_test_suite(kconfigoptions); +} diff --git a/tests/misc/kconfigoptions/testcase.yaml b/tests/misc/kconfigoptions/testcase.yaml new file mode 100644 index 00000000000..fd492576198 --- /dev/null +++ b/tests/misc/kconfigoptions/testcase.yaml @@ -0,0 +1,4 @@ +tests: + misc.kconfigoptions: + tags: kconfigoptions + platform_allow: native_posix From 731d4be8bb86159cbe48ea19998ba7451e70cef9 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 27 Sep 2022 12:34:36 +0200 Subject: [PATCH 202/501] [nrf fromlist] linker: correct linker script _flash_used calculation Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/50711 Linker scripts contains a `.last_section` section that is placed in rom region as NOLOAD for the purpose of retrieve the actual number of bytes contained in the image. See d85efe0b10f1f8ed4b854717f994062a4bbffe26 However, a previous section may cause the location counter to be incremented for alignment purposes. This can result in the size of the image to be 0x10FA but location counter to be 0x1100 because it has been aligned for next section placement. Therefore, two new Kconfig settings are introduced. Those settings request the linker to will write a pattern in `.last_section`. Together with removing NOLOAD and writing a patten to the section then we ensure that data is written after alignment of location counter, and thereby forces the image size to be in sync with the location counter. The default pattern used will be 0xE015 (end of last section). Some systems may fill up the flash completely, or simply write data at the end of the flash, which in both cases can result in overflow. Therefore, the new settings can be disabled. Signed-off-by: Torsten Rasmussen --- Kconfig.zephyr | 25 +++++++++++++++++++ .../arm/aarch32/cortex_a_r/scripts/linker.ld | 9 +++++-- .../arm/aarch32/cortex_m/scripts/linker.ld | 9 +++++-- include/zephyr/arch/arm64/scripts/linker.ld | 9 +++++-- include/zephyr/arch/riscv/common/linker.ld | 9 +++++-- 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 63096590bcf..bded45f90ea 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -261,6 +261,31 @@ config LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT If unsure, say Y. +config LINKER_LAST_SECTION_ID + bool "Last section identifier" + default y + help + If enabled, the last section will contain an identifier. + This ensures that the '_flash_used' linker symbol will always be + correctly calculated, even in cases where the location counter may + have been incremented for alignment purposes but no data is placed + after alignment. + + Note: in cases where the flash is fully used, for example application + specific data is written at the end of the flash area, then writing a + last section identifier may cause rom region overflow. + In such cases this setting should be disabled. + +config LINKER_LAST_SECTION_ID_PATTERN + hex "Last section identifier pattern" + default "0xE015E015" + depends on LINKER_LAST_SECTION_ID + help + Pattern to fill into last section as identifier. + Default pattern is 0xE015 (end of last section), but any pattern can + be used. + The size of the pattern must not exceed 4 bytes. + endmenu # "Linker Sections" endmenu diff --git a/include/zephyr/arch/arm/aarch32/cortex_a_r/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_a_r/scripts/linker.ld index 6be96679436..a093d8e1aa3 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_a_r/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_a_r/scripts/linker.ld @@ -386,12 +386,17 @@ GROUP_END(OCM) LINKER_DT_SECTIONS() /* Must be last in romable region */ - SECTION_PROLOGUE(.last_section,(NOLOAD),) + SECTION_PROLOGUE(.last_section,,) { +#ifdef CONFIG_LINKER_LAST_SECTION_ID + /* Fill last section with a word to ensure location counter and actual rom + * region data usage match. */ + LONG(CONFIG_LINKER_LAST_SECTION_ID_PATTERN) +#endif } GROUP_LINK_IN(ROMABLE_REGION) /* To provide the image size as a const expression, * calculate this value here. */ - _flash_used = LOADADDR(.last_section) - __rom_region_start; + _flash_used = LOADADDR(.last_section) + SIZEOF(.last_section) - __rom_region_start; } diff --git a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld index 98a8566ed02..0493a99dd6b 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -486,12 +486,17 @@ GROUP_END(DTCM) LINKER_DT_SECTIONS() /* Must be last in romable region */ -SECTION_PROLOGUE(.last_section,(NOLOAD),) +SECTION_PROLOGUE(.last_section,,) { +#ifdef CONFIG_LINKER_LAST_SECTION_ID + /* Fill last section with a word to ensure location counter and actual rom + * region data usage match. */ + LONG(CONFIG_LINKER_LAST_SECTION_ID_PATTERN) +#endif } GROUP_LINK_IN(ROMABLE_REGION) /* To provide the image size as a const expression, * calculate this value here. */ -_flash_used = LOADADDR(.last_section) - __rom_region_start; +_flash_used = LOADADDR(.last_section) + SIZEOF(.last_section) - __rom_region_start; } diff --git a/include/zephyr/arch/arm64/scripts/linker.ld b/include/zephyr/arch/arm64/scripts/linker.ld index 0a60d90eb89..b4ea4214e7b 100644 --- a/include/zephyr/arch/arm64/scripts/linker.ld +++ b/include/zephyr/arch/arm64/scripts/linker.ld @@ -317,12 +317,17 @@ SECTIONS /* Must be last in romable region */ - SECTION_PROLOGUE(.last_section,(NOLOAD),) + SECTION_PROLOGUE(.last_section,,) { +#ifdef CONFIG_LINKER_LAST_SECTION_ID + /* Fill last section with a word to ensure location counter and actual rom + * region data usage match. */ + LONG(CONFIG_LINKER_LAST_SECTION_ID_PATTERN) +#endif } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) /* To provide the image size as a const expression, * calculate this value here. */ - _flash_used = LOADADDR(.last_section) - __rom_region_start; + _flash_used = LOADADDR(.last_section) + SIZEOF(.last_section) - __rom_region_start; } diff --git a/include/zephyr/arch/riscv/common/linker.ld b/include/zephyr/arch/riscv/common/linker.ld index 275464cf069..3e177360b13 100644 --- a/include/zephyr/arch/riscv/common/linker.ld +++ b/include/zephyr/arch/riscv/common/linker.ld @@ -392,13 +392,18 @@ GROUP_END(DTCM) */ #ifdef CONFIG_XIP /* Must be last in romable region */ -SECTION_PROLOGUE(.last_section,(NOLOAD),) +SECTION_PROLOGUE(.last_section,,) { +#ifdef CONFIG_LINKER_LAST_SECTION_ID + /* Fill last section with a word to ensure location counter and actual rom + * region data usage match. */ + LONG(CONFIG_LINKER_LAST_SECTION_ID_PATTERN) +#endif } GROUP_LINK_IN(ROMABLE_REGION) /* To provide the image size as a const expression, * calculate this value here. */ -__rom_region_end = LOADADDR(.last_section); +__rom_region_end = LOADADDR(.last_section) + SIZEOF(.last_section); __rom_region_size = __rom_region_end - __rom_region_start; #endif From 3aed7234e9bcfbc09178e3917073789d5cc7ea94 Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Tue, 23 Aug 2022 01:25:33 +0900 Subject: [PATCH 203/501] [nrf fromtree] ci: clang: Use Ubuntu 20.04 runner image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the Clang workflow to use a specific runner image version, ubuntu-20.04, instead of the latest version in order to prevent any potential breakages due to the 'latest' version change by GitHub. Signed-off-by: Stephanos Ioannidis Signed-off-by: Andrzej Głąbek (cherry picked from commit 9dc89221dcb0e01f7b8ccc3c6e4c5a030ce3a3c0) --- .github/workflows/clang.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 8dd72dedf33..700b56405f6 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -4,7 +4,7 @@ on: pull_request_target jobs: clang-build-prep: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.6.0 From dabe1c9d30037b63755dd13fefd8d042043bf520 Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Thu, 18 Aug 2022 19:05:36 +0900 Subject: [PATCH 204/501] [nrf fromtree] ci: Switch to CI image 0.24.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the CI workflows to use the CI image 0.24.2, in order to pull in the Zephyr SDK 0.15.0 release. Signed-off-by: Stephanos Ioannidis Signed-off-by: Andrzej Głąbek (cherry picked from commit e2fae191908d95d1974d9961a729063dd6ff4b28) --- .github/workflows/bluetooth-tests.yaml | 2 +- .github/workflows/clang.yaml | 2 +- .github/workflows/codecov.yaml | 2 +- .github/workflows/errno.yml | 2 +- .github/workflows/footprint-tracking.yml | 2 +- .github/workflows/footprint.yml | 2 +- .github/workflows/twister.yaml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bluetooth-tests.yaml b/.github/workflows/bluetooth-tests.yaml index 06027836a9a..b1652de59c3 100644 --- a/.github/workflows/bluetooth-tests.yaml +++ b/.github/workflows/bluetooth-tests.yaml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest needs: bluetooth-test-prep container: - image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 + image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 options: '--entrypoint /bin/bash' env: ZEPHYR_TOOLCHAIN_VARIANT: zephyr diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 700b56405f6..6e7b596f343 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest needs: clang-build-prep container: - image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 + image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 options: '--entrypoint /bin/bash' volumes: - /home/runners/zephyrproject:/github/cache/zephyrproject diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index e1338c1a937..e221f4a7c62 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -18,7 +18,7 @@ jobs: runs-on: zephyr_runner needs: codecov-prep container: - image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 + image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 options: '--entrypoint /bin/bash' strategy: fail-fast: false diff --git a/.github/workflows/errno.yml b/.github/workflows/errno.yml index b6ea43afe13..9c7402407ff 100644 --- a/.github/workflows/errno.yml +++ b/.github/workflows/errno.yml @@ -10,7 +10,7 @@ jobs: check-errno: runs-on: ubuntu-latest container: - image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 + image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 env: ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 diff --git a/.github/workflows/footprint-tracking.yml b/.github/workflows/footprint-tracking.yml index 5375d1bbf37..0f742d113cf 100644 --- a/.github/workflows/footprint-tracking.yml +++ b/.github/workflows/footprint-tracking.yml @@ -27,7 +27,7 @@ jobs: if: github.repository == 'zephyrproject-rtos/zephyr' needs: footprint-tracking-cancel container: - image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 + image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 options: '--entrypoint /bin/bash' strategy: fail-fast: false diff --git a/.github/workflows/footprint.yml b/.github/workflows/footprint.yml index aa3609d4e66..7872221e9e8 100644 --- a/.github/workflows/footprint.yml +++ b/.github/workflows/footprint.yml @@ -16,7 +16,7 @@ jobs: if: github.repository == 'zephyrproject-rtos/zephyr' needs: footprint-cancel container: - image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 + image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 options: '--entrypoint /bin/bash' strategy: fail-fast: false diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index ad61f012e10..7721b7c0764 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -27,7 +27,7 @@ jobs: runs-on: zephyr_runner needs: twister-build-cleanup container: - image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 + image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 options: '--entrypoint /bin/bash' volumes: - /home/runners/zephyrproject:/github/cache/zephyrproject @@ -120,7 +120,7 @@ jobs: needs: twister-build-prep if: needs.twister-build-prep.outputs.size != 0 container: - image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 + image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 options: '--entrypoint /bin/bash' volumes: - /home/runners/zephyrproject:/github/cache/zephyrproject From f252fac960bf2806bf66815f292b5586c38b9f34 Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Thu, 18 Aug 2022 19:07:38 +0900 Subject: [PATCH 205/501] [nrf fromtree] ci: Update to Zephyr SDK 0.15.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the CI workflows to use the Zephyr SDK 0.15.0 for building and testing Zephyr in the CI. Signed-off-by: Stephanos Ioannidis Signed-off-by: Andrzej Głąbek (cherry picked from commit 02f24e47d9031a2810f4f8186766d0270004e536) --- .github/workflows/bluetooth-tests.yaml | 2 +- .github/workflows/clang.yaml | 2 +- .github/workflows/codecov.yaml | 2 +- .github/workflows/errno.yml | 2 +- .github/workflows/footprint-tracking.yml | 2 +- .github/workflows/footprint.yml | 2 +- .github/workflows/twister.yaml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bluetooth-tests.yaml b/.github/workflows/bluetooth-tests.yaml index b1652de59c3..ddad489096b 100644 --- a/.github/workflows/bluetooth-tests.yaml +++ b/.github/workflows/bluetooth-tests.yaml @@ -27,7 +27,7 @@ jobs: options: '--entrypoint /bin/bash' env: ZEPHYR_TOOLCHAIN_VARIANT: zephyr - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 CLANG_ROOT_DIR: /usr/lib/llvm-12 BSIM_OUT_PATH: /opt/bsim/ BSIM_COMPONENTS_PATH: /opt/bsim/components diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 6e7b596f343..0e2b53a6c2f 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -24,7 +24,7 @@ jobs: platform: ["native_posix"] subset: [1, 2, 3, 4, 5] env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 CLANG_ROOT_DIR: /usr/lib/llvm-12 COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index e221f4a7c62..1e0c1e84498 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -25,7 +25,7 @@ jobs: matrix: platform: ["native_posix", "qemu_x86", "unit_testing"] env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 CLANG_ROOT_DIR: /usr/lib/llvm-12 steps: - name: Apply container owner mismatch workaround diff --git a/.github/workflows/errno.yml b/.github/workflows/errno.yml index 9c7402407ff..c72d6b8740e 100644 --- a/.github/workflows/errno.yml +++ b/.github/workflows/errno.yml @@ -12,7 +12,7 @@ jobs: container: image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 steps: - name: Apply container owner mismatch workaround diff --git a/.github/workflows/footprint-tracking.yml b/.github/workflows/footprint-tracking.yml index 0f742d113cf..e85fa63e589 100644 --- a/.github/workflows/footprint-tracking.yml +++ b/.github/workflows/footprint-tracking.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 CLANG_ROOT_DIR: /usr/lib/llvm-12 ZEPHYR_TOOLCHAIN_VARIANT: zephyr steps: diff --git a/.github/workflows/footprint.yml b/.github/workflows/footprint.yml index 7872221e9e8..ae57d04f6a6 100644 --- a/.github/workflows/footprint.yml +++ b/.github/workflows/footprint.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 CLANG_ROOT_DIR: /usr/lib/llvm-12 ZEPHYR_TOOLCHAIN_VARIANT: zephyr steps: diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index 7721b7c0764..ea41cb005ad 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -39,7 +39,7 @@ jobs: MATRIX_SIZE: 10 PUSH_MATRIX_SIZE: 15 DAILY_MATRIX_SIZE: 80 - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 CLANG_ROOT_DIR: /usr/lib/llvm-12 TESTS_PER_BUILDER: 700 COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} @@ -129,7 +129,7 @@ jobs: matrix: subset: ${{fromJSON(needs.twister-build-prep.outputs.subset)}} env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 CLANG_ROOT_DIR: /usr/lib/llvm-12 TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 ' DAILY_OPTIONS: ' -M --build-only --all' From 98bc3a7a6b3917ce5a058e7a7271d3036edffb88 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Wed, 28 Sep 2022 17:31:32 +0530 Subject: [PATCH 206/501] [nrf noup] net: ip: Fix nRF Wi-Fi management events When using nRF Wi-Fi management it uses the net management events with information, but the size of the events is not enough to hold the Wi-Fi events as the proper size is defined only for Zephyr's Wi-Fi management. Use the proper size for both nRF and Zephyr's Wi-Fi management. Note: If CONFIG_NET_DHCPV4 is enabled, then this works, as size is now large enough for Wi-Fi management events. Signed-off-by: Krishna T --- subsys/net/ip/net_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 867bcbee0fd..24ef97fbe4f 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -24,7 +24,7 @@ * NOTE: Update comments here and calculate which struct occupies max size. */ -#ifdef CONFIG_NET_L2_WIFI_MGMT +#if defined(CONFIG_NET_L2_WIFI_MGMT) || defined(CONFIG_NET_L2_NRF_WIFI_MGMT) #include #define NET_EVENT_INFO_MAX_SIZE sizeof(struct wifi_scan_result) From d4b8ac4db1ed463928126383281b1989d200653b Mon Sep 17 00:00:00 2001 From: Krishna T Date: Mon, 10 Oct 2022 16:21:21 +0530 Subject: [PATCH 207/501] [nrf noup] net: wifi: Add support for WPA supplicant If WPA supplicant is enabled at build time, then use the WPA supplicant APIs, else use offload driver APIs. Remove the unused macro NRF_WIFI_MGMT now. Signed-off-by: Krishna T --- subsys/net/ip/Kconfig.stats | 2 +- subsys/net/ip/net_private.h | 2 +- subsys/net/l2/wifi/wifi_mgmt.c | 45 +++++++++++++++++++--------------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 639685e420d..147b002d603 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -127,7 +127,7 @@ config NET_STATISTICS_POWER_MANAGEMENT config NET_STATISTICS_WIFI bool "Wi-Fi statistics" - depends on NET_L2_WIFI_MGMT || NET_L2_NRF_WIFI_MGMT + depends on NET_L2_WIFI_MGMT default y help Keep track of Wi-Fi related statistics. Note that this diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 24ef97fbe4f..5f1a00975ab 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -24,7 +24,7 @@ * NOTE: Update comments here and calculate which struct occupies max size. */ -#if defined(CONFIG_NET_L2_WIFI_MGMT) || defined(CONFIG_NET_L2_NRF_WIFI_MGMT) +#if defined(CONFIG_NET_L2_WIFI_MGMT) #include #define NET_EVENT_INFO_MAX_SIZE sizeof(struct wifi_scan_result) diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index db17f7f2521..1043b5f8bfa 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -12,6 +12,9 @@ LOG_MODULE_REGISTER(net_wifi_mgmt, CONFIG_NET_L2_WIFI_MGMT_LOG_LEVEL); #include #include #include +#ifdef CONFIG_WPA_SUPP +#include "supp_api.h" +#endif static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) @@ -19,12 +22,15 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, struct wifi_connect_req_params *params = (struct wifi_connect_req_params *)data; const struct device *dev = net_if_get_device(iface); +#ifndef CONFIG_WPA_SUPP struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; + if (off_api == NULL || off_api->connect == NULL) { return -ENOTSUP; } +#endif /* CONFIG_WPA_SUPP */ LOG_HEXDUMP_DBG(params->ssid, params->ssid_length, "ssid"); LOG_HEXDUMP_DBG(params->psk, params->psk_length, "psk"); @@ -48,8 +54,11 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, !params->ssid) { return -EINVAL; } - +#ifdef CONFIG_WPA_SUPP + return zephyr_supp_connect(dev, params); +#else return off_api->connect(dev, params); +#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_CONNECT, wifi_connect); @@ -97,6 +106,10 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); + +#ifdef CONFIG_WPA_SUPP + return zephyr_supp_disconnect(dev); +#else struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -105,6 +118,7 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, } return off_api->disconnect(dev); +#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_DISCONNECT, wifi_disconnect); @@ -168,27 +182,25 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE, wifi_ap_disable); static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { - int ret; const struct device *dev = net_if_get_device(iface); - struct net_wifi_mgmt_offload *off_api = - (struct net_wifi_mgmt_offload *) dev->api; struct wifi_iface_status *status = data; - if (off_api == NULL || off_api->iface_status == NULL) { - return -ENOTSUP; - } - if (!data || len != sizeof(*status)) { return -EINVAL; } - ret = off_api->iface_status(dev, status); +#ifdef CONFIG_WPA_SUPP + return zephyr_supp_status(dev, status); +#else + struct net_wifi_mgmt_offload *off_api = + (struct net_wifi_mgmt_offload *) dev->api; - if (ret) { - return ret; + if (off_api == NULL || off_api->iface_status == NULL) { + return -ENOTSUP; } - return 0; + return off_api->iface_status(dev, status); +#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS, wifi_iface_status); @@ -204,7 +216,6 @@ void wifi_mgmt_raise_iface_status_event(struct net_if *iface, static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { - int ret; const struct device *dev = net_if_get_device(iface); struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -218,13 +229,7 @@ static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, return -EINVAL; } - ret = off_api->get_stats(dev, stats); - - if (ret) { - return ret; - } - - return 0; + return off_api->get_stats(dev, stats); } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats); #endif /* CONFIG_NET_STATISTICS_WIFI */ From 8d7d653018f8437bc1bf4941fc8301dd9a63bcef Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 5 Oct 2022 15:36:28 +0200 Subject: [PATCH 208/501] [nrf fromtree] tfm: Update TF-M for fix to return error code with invalid params in NS Update TF-M to include fix that returns PSA_ERROR_PROGRAMMER_ERROR when the NS sends a request with malformed packet parameters for the NS APIs in library mode. This also changed the S APIs to return PSA_ERROR_PROGRAMMER_ERROR instead of PSA_ERROR_INVALID_ARGUMENT in library mode. Signed-off-by: Joakim Andersson (cherry picked from commit 2334402c9def4414bce0d719fef61f669063099d) --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index 7414a027e7e..33b450db955 100644 --- a/west.yml +++ b/west.yml @@ -225,12 +225,12 @@ manifest: groups: - debug - name: trusted-firmware-m - revision: f13209f1883232cbcb9f0c31fb4c63e7c242df0d + revision: d7c82cb813e283b96770ba19b68a50d6bcc9931f path: modules/tee/tf-m/trusted-firmware-m groups: - tee - name: tf-m-tests - revision: c99a86b295c4887520da9d8402566d7f225c974e + revision: bcb53bccccdc05c713aade707e7a8ddad35c210f path: modules/tee/tf-m/tf-m-tests groups: - tee From e152f035fe1ea06681aec31daad78c3b883d3d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 17 Oct 2022 13:59:13 +0200 Subject: [PATCH 209/501] Revert "[nrf fromtree] tfm: Update TF-M for fix to return error code with invalid params in NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8d7d653018f8437bc1bf4941fc8301dd9a63bcef. Signed-off-by: Andrzej Głąbek --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index 33b450db955..7414a027e7e 100644 --- a/west.yml +++ b/west.yml @@ -225,12 +225,12 @@ manifest: groups: - debug - name: trusted-firmware-m - revision: d7c82cb813e283b96770ba19b68a50d6bcc9931f + revision: f13209f1883232cbcb9f0c31fb4c63e7c242df0d path: modules/tee/tf-m/trusted-firmware-m groups: - tee - name: tf-m-tests - revision: bcb53bccccdc05c713aade707e7a8ddad35c210f + revision: c99a86b295c4887520da9d8402566d7f225c974e path: modules/tee/tf-m/tf-m-tests groups: - tee From a47315af846c4a801efb2fcb28714ea0ff4bffe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 210/501] Revert "[nrf noup] net: wifi: Add support for WPA supplicant" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d4b8ac4db1ed463928126383281b1989d200653b. Signed-off-by: Andrzej Głąbek --- subsys/net/ip/Kconfig.stats | 2 +- subsys/net/ip/net_private.h | 2 +- subsys/net/l2/wifi/wifi_mgmt.c | 45 +++++++++++++++------------------- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 147b002d603..639685e420d 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -127,7 +127,7 @@ config NET_STATISTICS_POWER_MANAGEMENT config NET_STATISTICS_WIFI bool "Wi-Fi statistics" - depends on NET_L2_WIFI_MGMT + depends on NET_L2_WIFI_MGMT || NET_L2_NRF_WIFI_MGMT default y help Keep track of Wi-Fi related statistics. Note that this diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 5f1a00975ab..24ef97fbe4f 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -24,7 +24,7 @@ * NOTE: Update comments here and calculate which struct occupies max size. */ -#if defined(CONFIG_NET_L2_WIFI_MGMT) +#if defined(CONFIG_NET_L2_WIFI_MGMT) || defined(CONFIG_NET_L2_NRF_WIFI_MGMT) #include #define NET_EVENT_INFO_MAX_SIZE sizeof(struct wifi_scan_result) diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 1043b5f8bfa..db17f7f2521 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -12,9 +12,6 @@ LOG_MODULE_REGISTER(net_wifi_mgmt, CONFIG_NET_L2_WIFI_MGMT_LOG_LEVEL); #include #include #include -#ifdef CONFIG_WPA_SUPP -#include "supp_api.h" -#endif static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) @@ -22,15 +19,12 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, struct wifi_connect_req_params *params = (struct wifi_connect_req_params *)data; const struct device *dev = net_if_get_device(iface); -#ifndef CONFIG_WPA_SUPP struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; - if (off_api == NULL || off_api->connect == NULL) { return -ENOTSUP; } -#endif /* CONFIG_WPA_SUPP */ LOG_HEXDUMP_DBG(params->ssid, params->ssid_length, "ssid"); LOG_HEXDUMP_DBG(params->psk, params->psk_length, "psk"); @@ -54,11 +48,8 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, !params->ssid) { return -EINVAL; } -#ifdef CONFIG_WPA_SUPP - return zephyr_supp_connect(dev, params); -#else + return off_api->connect(dev, params); -#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_CONNECT, wifi_connect); @@ -106,10 +97,6 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); - -#ifdef CONFIG_WPA_SUPP - return zephyr_supp_disconnect(dev); -#else struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -118,7 +105,6 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, } return off_api->disconnect(dev); -#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_DISCONNECT, wifi_disconnect); @@ -182,25 +168,27 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE, wifi_ap_disable); static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { + int ret; const struct device *dev = net_if_get_device(iface); + struct net_wifi_mgmt_offload *off_api = + (struct net_wifi_mgmt_offload *) dev->api; struct wifi_iface_status *status = data; + if (off_api == NULL || off_api->iface_status == NULL) { + return -ENOTSUP; + } + if (!data || len != sizeof(*status)) { return -EINVAL; } -#ifdef CONFIG_WPA_SUPP - return zephyr_supp_status(dev, status); -#else - struct net_wifi_mgmt_offload *off_api = - (struct net_wifi_mgmt_offload *) dev->api; + ret = off_api->iface_status(dev, status); - if (off_api == NULL || off_api->iface_status == NULL) { - return -ENOTSUP; + if (ret) { + return ret; } - return off_api->iface_status(dev, status); -#endif /* CONFIG_WPA_SUPP */ + return 0; } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS, wifi_iface_status); @@ -216,6 +204,7 @@ void wifi_mgmt_raise_iface_status_event(struct net_if *iface, static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { + int ret; const struct device *dev = net_if_get_device(iface); struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -229,7 +218,13 @@ static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, return -EINVAL; } - return off_api->get_stats(dev, stats); + ret = off_api->get_stats(dev, stats); + + if (ret) { + return ret; + } + + return 0; } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats); #endif /* CONFIG_NET_STATISTICS_WIFI */ From 8ad2405cfdaaeff241ae23b723b37a0ca4f67eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 211/501] Revert "[nrf fromtree] ci: Update to Zephyr SDK 0.15.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 54b057b603cf0e12f4128d33580523bd4cff1226. Signed-off-by: Andrzej Głąbek --- .github/workflows/bluetooth-tests.yaml | 2 +- .github/workflows/clang.yaml | 2 +- .github/workflows/codecov.yaml | 2 +- .github/workflows/errno.yml | 2 +- .github/workflows/footprint-tracking.yml | 2 +- .github/workflows/footprint.yml | 2 +- .github/workflows/twister.yaml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bluetooth-tests.yaml b/.github/workflows/bluetooth-tests.yaml index ddad489096b..b1652de59c3 100644 --- a/.github/workflows/bluetooth-tests.yaml +++ b/.github/workflows/bluetooth-tests.yaml @@ -27,7 +27,7 @@ jobs: options: '--entrypoint /bin/bash' env: ZEPHYR_TOOLCHAIN_VARIANT: zephyr - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 CLANG_ROOT_DIR: /usr/lib/llvm-12 BSIM_OUT_PATH: /opt/bsim/ BSIM_COMPONENTS_PATH: /opt/bsim/components diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 0e2b53a6c2f..6e7b596f343 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -24,7 +24,7 @@ jobs: platform: ["native_posix"] subset: [1, 2, 3, 4, 5] env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 CLANG_ROOT_DIR: /usr/lib/llvm-12 COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index 1e0c1e84498..e221f4a7c62 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -25,7 +25,7 @@ jobs: matrix: platform: ["native_posix", "qemu_x86", "unit_testing"] env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 CLANG_ROOT_DIR: /usr/lib/llvm-12 steps: - name: Apply container owner mismatch workaround diff --git a/.github/workflows/errno.yml b/.github/workflows/errno.yml index c72d6b8740e..9c7402407ff 100644 --- a/.github/workflows/errno.yml +++ b/.github/workflows/errno.yml @@ -12,7 +12,7 @@ jobs: container: image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 steps: - name: Apply container owner mismatch workaround diff --git a/.github/workflows/footprint-tracking.yml b/.github/workflows/footprint-tracking.yml index e85fa63e589..0f742d113cf 100644 --- a/.github/workflows/footprint-tracking.yml +++ b/.github/workflows/footprint-tracking.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 CLANG_ROOT_DIR: /usr/lib/llvm-12 ZEPHYR_TOOLCHAIN_VARIANT: zephyr steps: diff --git a/.github/workflows/footprint.yml b/.github/workflows/footprint.yml index ae57d04f6a6..7872221e9e8 100644 --- a/.github/workflows/footprint.yml +++ b/.github/workflows/footprint.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 CLANG_ROOT_DIR: /usr/lib/llvm-12 ZEPHYR_TOOLCHAIN_VARIANT: zephyr steps: diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index ea41cb005ad..7721b7c0764 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -39,7 +39,7 @@ jobs: MATRIX_SIZE: 10 PUSH_MATRIX_SIZE: 15 DAILY_MATRIX_SIZE: 80 - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 CLANG_ROOT_DIR: /usr/lib/llvm-12 TESTS_PER_BUILDER: 700 COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} @@ -129,7 +129,7 @@ jobs: matrix: subset: ${{fromJSON(needs.twister-build-prep.outputs.subset)}} env: - ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 CLANG_ROOT_DIR: /usr/lib/llvm-12 TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 ' DAILY_OPTIONS: ' -M --build-only --all' From f2d3703dcdf9eee67fb51934af7d5a3393a874a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 212/501] Revert "[nrf fromtree] ci: Switch to CI image 0.24.2" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dd18789b095584bca8e297cba79b775cea101c2b. Signed-off-by: Andrzej Głąbek --- .github/workflows/bluetooth-tests.yaml | 2 +- .github/workflows/clang.yaml | 2 +- .github/workflows/codecov.yaml | 2 +- .github/workflows/errno.yml | 2 +- .github/workflows/footprint-tracking.yml | 2 +- .github/workflows/footprint.yml | 2 +- .github/workflows/twister.yaml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bluetooth-tests.yaml b/.github/workflows/bluetooth-tests.yaml index b1652de59c3..06027836a9a 100644 --- a/.github/workflows/bluetooth-tests.yaml +++ b/.github/workflows/bluetooth-tests.yaml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest needs: bluetooth-test-prep container: - image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 + image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 options: '--entrypoint /bin/bash' env: ZEPHYR_TOOLCHAIN_VARIANT: zephyr diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 6e7b596f343..700b56405f6 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest needs: clang-build-prep container: - image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 + image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 options: '--entrypoint /bin/bash' volumes: - /home/runners/zephyrproject:/github/cache/zephyrproject diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index e221f4a7c62..e1338c1a937 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -18,7 +18,7 @@ jobs: runs-on: zephyr_runner needs: codecov-prep container: - image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 + image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 options: '--entrypoint /bin/bash' strategy: fail-fast: false diff --git a/.github/workflows/errno.yml b/.github/workflows/errno.yml index 9c7402407ff..b6ea43afe13 100644 --- a/.github/workflows/errno.yml +++ b/.github/workflows/errno.yml @@ -10,7 +10,7 @@ jobs: check-errno: runs-on: ubuntu-latest container: - image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 + image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 env: ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 diff --git a/.github/workflows/footprint-tracking.yml b/.github/workflows/footprint-tracking.yml index 0f742d113cf..5375d1bbf37 100644 --- a/.github/workflows/footprint-tracking.yml +++ b/.github/workflows/footprint-tracking.yml @@ -27,7 +27,7 @@ jobs: if: github.repository == 'zephyrproject-rtos/zephyr' needs: footprint-tracking-cancel container: - image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 + image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 options: '--entrypoint /bin/bash' strategy: fail-fast: false diff --git a/.github/workflows/footprint.yml b/.github/workflows/footprint.yml index 7872221e9e8..aa3609d4e66 100644 --- a/.github/workflows/footprint.yml +++ b/.github/workflows/footprint.yml @@ -16,7 +16,7 @@ jobs: if: github.repository == 'zephyrproject-rtos/zephyr' needs: footprint-cancel container: - image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 + image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 options: '--entrypoint /bin/bash' strategy: fail-fast: false diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index 7721b7c0764..ad61f012e10 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -27,7 +27,7 @@ jobs: runs-on: zephyr_runner needs: twister-build-cleanup container: - image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 + image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 options: '--entrypoint /bin/bash' volumes: - /home/runners/zephyrproject:/github/cache/zephyrproject @@ -120,7 +120,7 @@ jobs: needs: twister-build-prep if: needs.twister-build-prep.outputs.size != 0 container: - image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 + image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 options: '--entrypoint /bin/bash' volumes: - /home/runners/zephyrproject:/github/cache/zephyrproject From c50442438af65d19c85bdc29639b61ecc16cf953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 213/501] Revert "[nrf fromtree] ci: clang: Use Ubuntu 20.04 runner image" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d692aec3d12c73b895fc296966e031e426120e8a. Signed-off-by: Andrzej Głąbek --- .github/workflows/clang.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 700b56405f6..8dd72dedf33 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -4,7 +4,7 @@ on: pull_request_target jobs: clang-build-prep: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.6.0 From 0de34658ca96fa2f284e07afdde7f1f1e4db8192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 214/501] Revert "[nrf fromtree] scripts/Kconfig: add dt_node_array_prop Kconfig functions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 97c4a1a6d1bda83f0272d9bbf68b211efadc7b4a. Signed-off-by: Andrzej Głąbek --- scripts/kconfig/kconfigfunctions.py | 56 ------------------- tests/misc/kconfigoptions/CMakeLists.txt | 8 --- tests/misc/kconfigoptions/Kconfig | 19 ------- .../misc/kconfigoptions/native_posix.overlay | 9 --- tests/misc/kconfigoptions/prj.conf | 1 - tests/misc/kconfigoptions/src/main.c | 32 ----------- tests/misc/kconfigoptions/testcase.yaml | 4 -- 7 files changed, 129 deletions(-) delete mode 100644 tests/misc/kconfigoptions/CMakeLists.txt delete mode 100644 tests/misc/kconfigoptions/Kconfig delete mode 100644 tests/misc/kconfigoptions/native_posix.overlay delete mode 100644 tests/misc/kconfigoptions/prj.conf delete mode 100644 tests/misc/kconfigoptions/src/main.c delete mode 100644 tests/misc/kconfigoptions/testcase.yaml diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index 6bb4f931bb7..fac2d425788 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -211,32 +211,6 @@ def _node_int_prop(node, prop, unit=None): return node.props[prop].val >> _dt_units_to_scale(unit) -def _node_array_prop(node, prop, index=0, unit=None): - """ - This function takes a 'node' and will look to see if that 'node' has a - property called 'prop' and if that 'prop' is an array type will return - the value of the property 'prop' at the given 'index' as either a string int - or string hex value. If the property 'prop' is not found or the given 'index' - is out of range it will return 0. - - The function will divide the value based on 'unit': - None No division - 'k' or 'K' divide by 1024 (1 << 10) - 'm' or 'M' divide by 1,048,576 (1 << 20) - 'g' or 'G' divide by 1,073,741,824 (1 << 30) - """ - if not node: - return 0 - - if prop not in node.props: - return 0 - if node.props[prop].type != "array": - return 0 - if int(index) >= len(node.props[prop].val): - return 0 - return node.props[prop].val[int(index)] >> _dt_units_to_scale(unit) - - def _dt_chosen_reg_addr(kconf, chosen, index=0, unit=None): """ This function takes a 'chosen' property and treats that property as a path @@ -474,34 +448,6 @@ def dt_node_int_prop(kconf, name, path, prop, unit=None): if name == "dt_node_int_prop_hex": return hex(_node_int_prop(node, prop, unit)) - -def dt_node_array_prop(kconf, name, path, prop, index, unit=None): - """ - This function takes a 'path', property name ('prop') and index ('index') - and looks for an EDT node at that path. If it finds an EDT node, it will - look to see if that node has a property called 'prop' and if that 'prop' - is an array type will return the value of the property 'prop' at the given - 'index' as either a string int or string hex value. If not found we return 0. - - The function will divide the value based on 'unit': - None No division - 'k' or 'K' divide by 1024 (1 << 10) - 'm' or 'M' divide by 1,048,576 (1 << 20) - 'g' or 'G' divide by 1,073,741,824 (1 << 30) - """ - if doc_mode or edt is None: - return "0" - - try: - node = edt.get_node(path) - except edtlib.EDTError: - return "0" - if name == "dt_node_array_prop_int": - return str(_node_array_prop(node, prop, index, unit)) - if name == "dt_node_array_prop_hex": - return hex(_node_array_prop(node, prop, index, unit)) - - def dt_node_str_prop_equals(kconf, _, path, prop, val): """ This function takes a 'path' and property name ('prop') looks for an EDT @@ -665,8 +611,6 @@ def shields_list_contains(kconf, _, shield): "dt_nodelabel_has_prop": (dt_nodelabel_has_prop, 2, 2), "dt_node_int_prop_int": (dt_node_int_prop, 2, 3), "dt_node_int_prop_hex": (dt_node_int_prop, 2, 3), - "dt_node_array_prop_int": (dt_node_array_prop, 3, 4), - "dt_node_array_prop_hex": (dt_node_array_prop, 3, 4), "dt_node_str_prop_equals": (dt_node_str_prop_equals, 3, 3), "dt_nodelabel_has_compat": (dt_nodelabel_has_compat, 2, 2), "dt_nodelabel_path": (dt_nodelabel_path, 1, 1), diff --git a/tests/misc/kconfigoptions/CMakeLists.txt b/tests/misc/kconfigoptions/CMakeLists.txt deleted file mode 100644 index ab614a65921..00000000000 --- a/tests/misc/kconfigoptions/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.13.1) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(kconfigoptions) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/misc/kconfigoptions/Kconfig b/tests/misc/kconfigoptions/Kconfig deleted file mode 100644 index ed009c66376..00000000000 --- a/tests/misc/kconfigoptions/Kconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2022 Nordic Semiconductor -# -# SPDX-License-Identifier: Apache-2.0 -# - -DT_FLASH_CONTROLLER := $(dt_nodelabel_path,flashcontroller0) - -config FLASH_CONTROLLER_ADDRESS - int - default $(dt_node_array_prop_int,$(DT_FLASH_CONTROLLER),reg,0) - -config FLASH_CONTROLLER_SIZE - int - default $(dt_node_array_prop_int,$(DT_FLASH_CONTROLLER),reg,1) - - -menu "Zephyr Kernel" -source "Kconfig.zephyr" -endmenu diff --git a/tests/misc/kconfigoptions/native_posix.overlay b/tests/misc/kconfigoptions/native_posix.overlay deleted file mode 100644 index 1da8f728393..00000000000 --- a/tests/misc/kconfigoptions/native_posix.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - - &flashcontroller0 { - reg = <0x00000001 4194304>; -}; diff --git a/tests/misc/kconfigoptions/prj.conf b/tests/misc/kconfigoptions/prj.conf deleted file mode 100644 index 9467c292689..00000000000 --- a/tests/misc/kconfigoptions/prj.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_ZTEST=y diff --git a/tests/misc/kconfigoptions/src/main.c b/tests/misc/kconfigoptions/src/main.c deleted file mode 100644 index 62de4e212be..00000000000 --- a/tests/misc/kconfigoptions/src/main.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/** - * @brief Test . - * - */ -void test_kconfigoptions_array_hex(void) -{ - zassert_equal(0x1, CONFIG_FLASH_CONTROLLER_ADDRESS, - "Unexpected flash controller address (%d)", CONFIG_FLASH_CONTROLLER_ADDRESS); -} - -void test_kconfigoptions_array_int(void) -{ - zassert_equal(4194304, CONFIG_FLASH_CONTROLLER_SIZE, - "Unexpected flash controller size (%d)", CONFIG_FLASH_CONTROLLER_SIZE); -} - -void test_main(void) -{ - ztest_test_suite(kconfigoptions, - ztest_unit_test(test_kconfigoptions_array_hex), - ztest_unit_test(test_kconfigoptions_array_int) - ); - ztest_run_test_suite(kconfigoptions); -} diff --git a/tests/misc/kconfigoptions/testcase.yaml b/tests/misc/kconfigoptions/testcase.yaml deleted file mode 100644 index fd492576198..00000000000 --- a/tests/misc/kconfigoptions/testcase.yaml +++ /dev/null @@ -1,4 +0,0 @@ -tests: - misc.kconfigoptions: - tags: kconfigoptions - platform_allow: native_posix From a4d4501bd05187f7cd7fb27a072af01a5aeccf69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 215/501] Revert "[nrf fromtree] modules: hal_nordic: nrf_802154 serialization race condition fix" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 17c59d3e50fb6ea2f31c2124c99795e0e6e6d3c0. Signed-off-by: Andrzej Głąbek --- .../platform/nrf_802154_spinel_response_notifier.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/hal_nordic/nrf_802154/serialization/platform/nrf_802154_spinel_response_notifier.c b/modules/hal_nordic/nrf_802154/serialization/platform/nrf_802154_spinel_response_notifier.c index 6785d21982c..036dd16c46f 100644 --- a/modules/hal_nordic/nrf_802154/serialization/platform/nrf_802154_spinel_response_notifier.c +++ b/modules/hal_nordic/nrf_802154/serialization/platform/nrf_802154_spinel_response_notifier.c @@ -68,6 +68,7 @@ nrf_802154_spinel_notify_buff_t *nrf_802154_spinel_response_notifier_property_aw uint32_t timeout) { nrf_802154_spinel_notify_buff_t *result = NULL; + int ret; k_timeout_t k_timeout; @@ -85,6 +86,11 @@ nrf_802154_spinel_notify_buff_t *nrf_802154_spinel_response_notifier_property_aw LOG_ERR("No response within timeout %u", timeout); } + ret = k_mutex_unlock(&await_mutex); + assert(ret == 0); + (void)ret; + LOG_DBG("Unlocking response notifier"); + return result; } @@ -92,20 +98,13 @@ void nrf_802154_spinel_response_notifier_free(nrf_802154_spinel_notify_buff_t *p { struct spinel_notify_buff_internal *p_notify_buff_free; - int ret; p_notify_buff_free = CONTAINER_OF(p_notify, struct spinel_notify_buff_internal, buff); assert(p_notify_buff_free == ¬ify_buff); - LOG_DBG("Unlocking response notifier"); - p_notify_buff_free->free = true; - - ret = k_mutex_unlock(&await_mutex); - assert(ret == 0); - (void)ret; } void nrf_802154_spinel_response_notifier_property_notify(spinel_prop_key_t property, From 9b2fecc6a24db9de025f3bbb79a71e40354fc880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 216/501] Revert "[nrf fromlist] tests: logging: log_core_additional: Fix missing deps" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e81870b779762f577ea0f3ba058d446d10eaf5ac. Signed-off-by: Andrzej Głąbek --- tests/subsys/logging/log_core_additional/log_sync.conf | 1 - tests/subsys/logging/log_core_additional/log_user.conf | 1 - tests/subsys/logging/log_core_additional/prj.conf | 1 - 3 files changed, 3 deletions(-) diff --git a/tests/subsys/logging/log_core_additional/log_sync.conf b/tests/subsys/logging/log_core_additional/log_sync.conf index 2acc46202fe..f65e5f22bb3 100644 --- a/tests/subsys/logging/log_core_additional/log_sync.conf +++ b/tests/subsys/logging/log_core_additional/log_sync.conf @@ -2,6 +2,5 @@ CONFIG_MAIN_THREAD_PRIORITY=5 CONFIG_ZTEST=y CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG=y -CONFIG_LOG_OUTPUT=y CONFIG_LOG_BACKEND_UART=y CONFIG_LOG_MODE_IMMEDIATE=y diff --git a/tests/subsys/logging/log_core_additional/log_user.conf b/tests/subsys/logging/log_core_additional/log_user.conf index c83b097b267..b2da7660295 100644 --- a/tests/subsys/logging/log_core_additional/log_user.conf +++ b/tests/subsys/logging/log_core_additional/log_user.conf @@ -3,7 +3,6 @@ CONFIG_ZTEST=y CONFIG_TEST_USERSPACE=y CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG=y -CONFIG_LOG_OUTPUT=y CONFIG_LOG_RUNTIME_FILTERING=y CONFIG_LOG_PROCESS_THREAD=n CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=1 diff --git a/tests/subsys/logging/log_core_additional/prj.conf b/tests/subsys/logging/log_core_additional/prj.conf index 460ed7ebb28..c4699d6616a 100644 --- a/tests/subsys/logging/log_core_additional/prj.conf +++ b/tests/subsys/logging/log_core_additional/prj.conf @@ -2,7 +2,6 @@ CONFIG_MAIN_THREAD_PRIORITY=5 CONFIG_ZTEST=y CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG=y -CONFIG_LOG_OUTPUT=y CONFIG_LOG_PRINTK=n CONFIG_LOG_SPEED=y CONFIG_LOG_BUFFER_SIZE=1024 From 4719ed56a1ffb757eaf59866d5f35b99ee0a504f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 217/501] Revert "[nrf fromtree] drivers: spi: fix sample syntax" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 86893246053c50d34618f09ec6722cae8ba19472. Signed-off-by: Andrzej Głąbek --- include/zephyr/drivers/spi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/zephyr/drivers/spi.h b/include/zephyr/drivers/spi.h index acac793bd79..34e23d7d830 100644 --- a/include/zephyr/drivers/spi.h +++ b/include/zephyr/drivers/spi.h @@ -163,11 +163,11 @@ struct spi_cs_control { * Example devicetree fragment: * * @code{.devicetree} - * gpio1: gpio@abcd0001 { ... }; + * gpio1: gpio@... { ... }; * - * gpio2: gpio@abcd0002 { ... }; + * gpio2: gpio@... { ... }; * - * spi@abcd0003 { + * spi@... { * compatible = "vnd,spi"; * cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>, * <&gpio2 20 GPIO_ACTIVE_LOW>; From 390f142e6a37f94b3f966d1852bad7594f1b8c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 218/501] Revert "[nrf fromtree] doc: update requirements" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 587a483ffa66852d27f505fd0cf81c15f28fd638. Signed-off-by: Andrzej Głąbek --- scripts/requirements-doc.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/requirements-doc.txt b/scripts/requirements-doc.txt index e5bdac0a21a..abc92e70412 100644 --- a/scripts/requirements-doc.txt +++ b/scripts/requirements-doc.txt @@ -1,7 +1,7 @@ # DOC: used to generate docs -breathe>=4.34 -sphinx~=5.0 +breathe>=4.30,<4.33 # 4.33: disabled due to #803 and #805 issues +sphinx~=4.0 sphinx_rtd_theme~=1.0 sphinx-tabs sphinxcontrib-svg2pdfconverter From 369e0e7867420e526aa453dbc2888a8ba0645242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 219/501] Revert "[nrf fromtree] doc: add missing caption for extlinks" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 68f2461f35efe81c2ce3edecc8b1d56248dc483f. Signed-off-by: Andrzej Głąbek --- doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 4c687e7cf9b..662cd2d7217 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -280,8 +280,8 @@ # -- Linkcheck options ---------------------------------------------------- extlinks = { - "jira": ("https://jira.zephyrproject.org/browse/%s", "JIRA #%s"), - "github": ("https://github.com/zephyrproject-rtos/zephyr/issues/%s", "GitHub #%s"), + "jira": ("https://jira.zephyrproject.org/browse/%s", ""), + "github": ("https://github.com/zephyrproject-rtos/zephyr/issues/%s", ""), } linkcheck_timeout = 30 From 9565ef52aa9b1381778a51d70ec8ee67d6a2689b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 220/501] Revert "[nrf fromtree] testsuite: ztress: Use XOSHIRO generator in ztress" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 44ede1e459c061fb1f7b65431535d6b66654ec78. Signed-off-by: Andrzej Głąbek --- Kconfig.zephyr | 2 -- subsys/testsuite/Kconfig.defconfig | 10 ---------- 2 files changed, 12 deletions(-) delete mode 100644 subsys/testsuite/Kconfig.defconfig diff --git a/Kconfig.zephyr b/Kconfig.zephyr index bded45f90ea..7795521b40b 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -27,8 +27,6 @@ osource "$(KCONFIG_BINARY_DIR)/Kconfig.soc.defconfig" osource "soc/$(ARCH)/*/Kconfig.defconfig" # This loads the toolchain defconfigs osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig.defconfig" -# This loads the testsuite defconfig -source "subsys/testsuite/Kconfig.defconfig" menu "Modules" diff --git a/subsys/testsuite/Kconfig.defconfig b/subsys/testsuite/Kconfig.defconfig deleted file mode 100644 index 429def054dd..00000000000 --- a/subsys/testsuite/Kconfig.defconfig +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if TEST - -choice RNG_GENERATOR_CHOICE - default XOSHIRO_RANDOM_GENERATOR if ZTRESS && ENTROPY_HAS_DRIVER -endchoice - -endif # TEST From 90d923d847e3d00a40c42cda7992223cae85d6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 221/501] Revert "[nrf fromtree] testsuite: ztress: First sys_rand_get32 from thread" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0d3e7b142230e8028d9f198dba6f25033114135c. Signed-off-by: Andrzej Głąbek --- subsys/testsuite/ztest/src/ztress.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/subsys/testsuite/ztest/src/ztress.c b/subsys/testsuite/ztest/src/ztress.c index 2cc5a0f7590..259a9d22844 100644 --- a/subsys/testsuite/ztest/src/ztress.c +++ b/subsys/testsuite/ztest/src/ztress.c @@ -466,12 +466,6 @@ static int ztress_cpu_clock_to_sys_clock_check(const struct device *unused) */ cpu_sys_clock_ok = t <= 12; - /* Read first random number. There are some generators which do not support - * reading first random number from an interrupt context (initialization - * is performed at the first read). - */ - (void)sys_rand32_get(); - return 0; } From b96eabc4a9a4ac8af9dc126637d72525e9039d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 222/501] Revert "[nrf fromtree] lib: os: spsc_pbuf: Minor code cleanup" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f76d97c850c92f76d0e8a73a9a9ee1eac5fa4425. Signed-off-by: Andrzej Głąbek --- lib/os/spsc_pbuf.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/lib/os/spsc_pbuf.c b/lib/os/spsc_pbuf.c index 36413a2b35b..d79b15a63d1 100644 --- a/lib/os/spsc_pbuf.c +++ b/lib/os/spsc_pbuf.c @@ -12,9 +12,6 @@ #include #define LEN_SZ sizeof(uint32_t) -/* Amount of data that is left unused to distinguish between empty and full. */ -#define FREE_SPACE_DISTANCE sizeof(uint32_t) - #define PADDING_MARK 0xFF #define GET_UTILIZATION(flags) \ @@ -168,28 +165,26 @@ int spsc_pbuf_alloc(struct spsc_pbuf *pb, uint16_t len, char **buf) space = LEN_SZ + 1; } - if ((remaining >= space) || (rd_idx <= space)) { - /* Packet will fit at the end. Free space depends on - * presence of data at the beginning of the buffer since - * there must be one word not used to distinguish between - * empty and full state. - */ - free_space = remaining - ((rd_idx > 0) ? 0 : FREE_SPACE_DISTANCE); + if (remaining >= space) { + /* Packet will fit at the end */ + free_space = remaining - ((rd_idx > 0) ? 0 : sizeof(uint32_t)); } else { - /* Padding must be added. */ - data_loc[wr_idx] = PADDING_MARK; - __sync_synchronize(); - cache_wb(&data_loc[wr_idx], sizeof(uint8_t), flags); - - wr_idx = 0; - *wr_idx_loc = wr_idx; - - /* Obligatory one word empty space. */ - free_space = rd_idx - FREE_SPACE_DISTANCE; + if (rd_idx > space) { + /* Padding must be added. */ + data_loc[wr_idx] = PADDING_MARK; + __sync_synchronize(); + cache_wb(&data_loc[wr_idx], sizeof(uint8_t), flags); + + wr_idx = 0; + *wr_idx_loc = wr_idx; + + free_space = rd_idx - sizeof(uint32_t); + } else { + free_space = remaining - (rd_idx > 0 ? 0 : sizeof(uint32_t)); + } } } else { - /* Obligatory one word empty space. */ - free_space = rd_idx - wr_idx - FREE_SPACE_DISTANCE; + free_space = rd_idx - wr_idx - sizeof(uint32_t); } len = MIN(len, MAX(free_space - (int32_t)LEN_SZ, 0)); From 3b8b3a0a71e3e85f54d0ad4da004896de0fd7094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 223/501] Revert "[nrf fromtree] tests: lib: spsc_pbuf: Improve stress test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ebc09db03f243a8427ffc4507de6793f5ce97991. Signed-off-by: Andrzej Głąbek --- tests/lib/spsc_pbuf/src/main.c | 92 ++++++++++++++-------------------- 1 file changed, 38 insertions(+), 54 deletions(-) diff --git a/tests/lib/spsc_pbuf/src/main.c b/tests/lib/spsc_pbuf/src/main.c index e35ca0b1945..1e39ba94954 100644 --- a/tests/lib/spsc_pbuf/src/main.c +++ b/tests/lib/spsc_pbuf/src/main.c @@ -11,7 +11,6 @@ #define HDR_LEN sizeof(uint32_t) #define TLEN(len) ROUND_UP(HDR_LEN + len, sizeof(uint32_t)) -#define STRESS_TIMEOUT_MS ((CONFIG_SYS_CLOCK_TICKS_PER_SEC < 10000) ? 1000 : 15000) /* The buffer size itself would be 199 bytes. * 212 - sizeof(struct spsc_pbuf) - 1 = 199. @@ -416,7 +415,6 @@ struct stress_data { uint32_t capacity; uint32_t write_cnt; uint32_t read_cnt; - uint32_t wr_err; }; bool stress_read(void *user_data, uint32_t cnt, bool last, int prio) @@ -424,22 +422,20 @@ bool stress_read(void *user_data, uint32_t cnt, bool last, int prio) struct stress_data *ctx = (struct stress_data *)user_data; char buf[128]; int len; - int rpt = (sys_rand32_get() & 3) + 1; - for (int i = 0; i < rpt; i++) { - len = spsc_pbuf_read(ctx->pbuf, buf, (uint16_t)sizeof(buf)); - if (len == 0) { - return true; - } + len = spsc_pbuf_read(ctx->pbuf, buf, (uint16_t)sizeof(buf)); - if (len < 0) { - zassert_true(false, "Unexpected error: %d, cnt:%d", len, ctx->read_cnt); - } + if (len == 0) { + return true; + } - check_buffer(buf, len, ctx->read_cnt); - ctx->read_cnt++; + if (len < 0) { + zassert_true(false, "Unexpected error: %d, cnt:%d", len, ctx->read_cnt); } + check_buffer(buf, len, ctx->read_cnt); + ctx->read_cnt++; + return true; } @@ -448,41 +444,36 @@ bool stress_write(void *user_data, uint32_t cnt, bool last, int prio) struct stress_data *ctx = (struct stress_data *)user_data; char buf[128]; uint16_t len = 1 + (sys_rand32_get() % (ctx->capacity / 4)); - int rpt = (sys_rand32_get() & 1) + 1; zassert_true(len < sizeof(buf), "len:%d %d", len, ctx->capacity); - for (int i = 0; i < rpt; i++) { - memset(buf, (uint8_t)ctx->write_cnt, len); - if (spsc_pbuf_write(ctx->pbuf, buf, len) == len) { - ctx->write_cnt++; - } else { - ctx->wr_err++; - } + memset(buf, (uint8_t)ctx->write_cnt, len); + if (spsc_pbuf_write(ctx->pbuf, buf, len) == 0) { + ctx->write_cnt++; } return true; } + + ZTEST(test_spsc_pbuf, test_stress) { static uint8_t buffer[128] __aligned(MAX(Z_SPSC_PBUF_DCACHE_LINE, 4)); - static struct stress_data ctx = {}; + static struct stress_data ctx; uint32_t repeat = 0; + ctx.write_cnt = 0; + ctx.read_cnt = 0; ctx.pbuf = spsc_pbuf_init(buffer, sizeof(buffer), 0); ctx.capacity = spsc_pbuf_capacity(ctx.pbuf); - ztress_set_timeout(K_MSEC(STRESS_TIMEOUT_MS)); - TC_PRINT("Reading from an interrupt, writing from a thread\n"); - ZTRESS_EXECUTE(ZTRESS_TIMER(stress_read, &ctx, repeat, Z_TIMEOUT_TICKS(4)), - ZTRESS_THREAD(stress_write, &ctx, repeat, 2000, Z_TIMEOUT_TICKS(4))); - TC_PRINT("Writes:%d failures: %d\n", ctx.write_cnt, ctx.wr_err); + ztress_set_timeout(K_MSEC(5000)); + ZTRESS_EXECUTE(ZTRESS_THREAD(stress_read, &ctx, repeat, 0, Z_TIMEOUT_TICKS(4)), + ZTRESS_THREAD(stress_write, &ctx, repeat, 1000, Z_TIMEOUT_TICKS(4))); - TC_PRINT("Writing from an interrupt, reading from a thread\n"); - ZTRESS_EXECUTE(ZTRESS_TIMER(stress_write, &ctx, repeat, Z_TIMEOUT_TICKS(4)), + ZTRESS_EXECUTE(ZTRESS_THREAD(stress_write, &ctx, repeat, 0, Z_TIMEOUT_TICKS(4)), ZTRESS_THREAD(stress_read, &ctx, repeat, 1000, Z_TIMEOUT_TICKS(4))); - TC_PRINT("Writes:%d failures: %d\n", ctx.write_cnt, ctx.wr_err); } bool stress_claim_free(void *user_data, uint32_t cnt, bool last, int prio) @@ -490,21 +481,18 @@ bool stress_claim_free(void *user_data, uint32_t cnt, bool last, int prio) struct stress_data *ctx = (struct stress_data *)user_data; char *buf; uint16_t len; - int rpt = sys_rand32_get() % 0x3; - for (int i = 0; i < rpt; i++) { - len = spsc_pbuf_claim(ctx->pbuf, &buf); + len = spsc_pbuf_claim(ctx->pbuf, &buf); - if (len == 0) { - return true; - } + if (len == 0) { + return true; + } - check_buffer(buf, len, ctx->read_cnt); + check_buffer(buf, len, ctx->read_cnt); - spsc_pbuf_free(ctx->pbuf, len); + spsc_pbuf_free(ctx->pbuf, len); - ctx->read_cnt++; - } + ctx->read_cnt++; return true; } @@ -512,24 +500,20 @@ bool stress_claim_free(void *user_data, uint32_t cnt, bool last, int prio) bool stress_alloc_commit(void *user_data, uint32_t cnt, bool last, int prio) { struct stress_data *ctx = (struct stress_data *)user_data; - uint32_t rnd = sys_rand32_get(); - uint16_t len = 1 + (rnd % (ctx->capacity / 4)); - int rpt = rnd % 0x3; + uint16_t len = 1 + (sys_rand32_get() % (ctx->capacity / 4)); char *buf; int err; - for (int i = 0; i < rpt; i++) { - err = spsc_pbuf_alloc(ctx->pbuf, len, &buf); - zassert_true(err >= 0, NULL); - if (err != len) { - return true; - } + err = spsc_pbuf_alloc(ctx->pbuf, len, &buf); + zassert_true(err >= 0, NULL); + if (err != len) { + return true; + } - memset(buf, (uint8_t)ctx->write_cnt, len); + memset(buf, (uint8_t)ctx->write_cnt, len); - spsc_pbuf_commit(ctx->pbuf, len); - ctx->write_cnt++; - } + spsc_pbuf_commit(ctx->pbuf, len); + ctx->write_cnt++; return true; } @@ -545,7 +529,7 @@ ZTEST(test_spsc_pbuf, test_stress_0cpy) ctx.pbuf = spsc_pbuf_init(buffer, sizeof(buffer), 0); ctx.capacity = spsc_pbuf_capacity(ctx.pbuf); - ztress_set_timeout(K_MSEC(STRESS_TIMEOUT_MS)); + ztress_set_timeout(K_MSEC(5000)); ZTRESS_EXECUTE(ZTRESS_THREAD(stress_claim_free, &ctx, repeat, 0, Z_TIMEOUT_TICKS(4)), ZTRESS_THREAD(stress_alloc_commit, &ctx, repeat, 1000, Z_TIMEOUT_TICKS(4))); From f51ec54e134cf9325546a960151c53d765b84d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 224/501] Revert "[nrf fromtree] lib: os: spsc_pbuf: Fix race condition" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d4ee429d6c524613bc2c13cb1bff948e19365e2a. Signed-off-by: Andrzej Głąbek --- lib/os/spsc_pbuf.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/lib/os/spsc_pbuf.c b/lib/os/spsc_pbuf.c index d79b15a63d1..afe8c206bf9 100644 --- a/lib/os/spsc_pbuf.c +++ b/lib/os/spsc_pbuf.c @@ -278,18 +278,8 @@ uint16_t spsc_pbuf_claim(struct spsc_pbuf *pb, char **buf) cache_inv(&data_loc[rd_idx], LEN_SZ, flags); if (data_loc[rd_idx] == PADDING_MARK) { - /* If padding is found we must check if we are interrupted - * padding injection procedure which has 2 steps (adding padding, - * changing write index). If padding is added but index is not - * yet changed, it indicates that there is no data after the - * padding (at the beginning of the buffer). - */ - cache_inv(wr_idx_loc, sizeof(*wr_idx_loc), flags); - if (rd_idx == *wr_idx_loc) { - return 0; - } - - *rd_idx_loc = rd_idx = 0; + rd_idx = 0; + *rd_idx_loc = rd_idx; __sync_synchronize(); cache_wb(rd_idx_loc, sizeof(*rd_idx_loc), flags); /* After reading padding we may find out that buffer is empty. */ @@ -317,26 +307,14 @@ void spsc_pbuf_free(struct spsc_pbuf *pb, uint16_t len) const uint32_t pblen = pb->common.len; const uint32_t flags = pb->common.flags; uint32_t *rd_idx_loc = get_rd_idx_loc(pb, flags); - uint32_t *wr_idx_loc = get_wr_idx_loc(pb, flags); uint16_t rd_idx = *rd_idx_loc + len + LEN_SZ; uint8_t *data_loc = get_data_loc(pb, flags); rd_idx = ROUND_UP(rd_idx, sizeof(uint32_t)); cache_inv(&data_loc[rd_idx], sizeof(uint8_t), flags); /* Handle wrapping or the fact that next packet is a padding. */ - if (rd_idx == pblen) { + if (rd_idx == pblen || data_loc[rd_idx] == PADDING_MARK) { rd_idx = 0; - } else if (data_loc[rd_idx] == PADDING_MARK) { - cache_inv(wr_idx_loc, sizeof(*wr_idx_loc), flags); - /* We may hit the case when producer is in the middle of adding - * a padding (which happens in 2 steps: writing padding, resetting - * write index) and in that case we cannot consume this padding. - */ - if (rd_idx != *wr_idx_loc) { - rd_idx = 0; - } - } else { - /* empty */ } *rd_idx_loc = rd_idx; From 1d25b0bdca3eb696ee662b12ef341240d3a8b149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 225/501] Revert "[nrf fromtree] lib: os: spsc_pbuf: Fix miscalculation in the allocation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 41567db7db42ef66d013717c638bbb8c5d366585. Signed-off-by: Andrzej Głąbek --- lib/os/spsc_pbuf.c | 2 +- tests/lib/spsc_pbuf/src/main.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/os/spsc_pbuf.c b/lib/os/spsc_pbuf.c index afe8c206bf9..967869fb2e8 100644 --- a/lib/os/spsc_pbuf.c +++ b/lib/os/spsc_pbuf.c @@ -169,7 +169,7 @@ int spsc_pbuf_alloc(struct spsc_pbuf *pb, uint16_t len, char **buf) /* Packet will fit at the end */ free_space = remaining - ((rd_idx > 0) ? 0 : sizeof(uint32_t)); } else { - if (rd_idx > space) { + if (rd_idx > remaining) { /* Padding must be added. */ data_loc[wr_idx] = PADDING_MARK; __sync_synchronize(); diff --git a/tests/lib/spsc_pbuf/src/main.c b/tests/lib/spsc_pbuf/src/main.c index 1e39ba94954..ba7a413a8a9 100644 --- a/tests/lib/spsc_pbuf/src/main.c +++ b/tests/lib/spsc_pbuf/src/main.c @@ -305,7 +305,7 @@ ZTEST(test_spsc_pbuf, test_0cpy_corner2) pb = spsc_pbuf_init(buffer, sizeof(buffer), 0); capacity = spsc_pbuf_capacity(pb); - /* Commit 16 byte packet. */ + /* Commit 5 byte packet. */ len1 = 16; PACKET_WRITE(pb, len1, len1, 0, len1); @@ -349,10 +349,10 @@ ZTEST(test_spsc_pbuf, test_largest_alloc) PACKET_WRITE(pb, len1, len1, 0, len1); PACKET_CONSUME(pb, len1, 0); - len2 = capacity - TLEN(len1) - TLEN(10); + len2 = capacity - ROUND_UP(len1, sizeof(uint32_t)) - 2 * sizeof(uint32_t) - 10; PACKET_WRITE(pb, len2, len2, 1, len2); - PACKET_WRITE(pb, SPSC_PBUF_MAX_LEN, 0, 1, 12); + PACKET_WRITE(pb, SPSC_PBUF_MAX_LEN, 0, 1, 8); PACKET_WRITE(pb, SPSC_PBUF_MAX_LEN - 1, 0, 1, 12); @@ -363,7 +363,7 @@ ZTEST(test_spsc_pbuf, test_largest_alloc) PACKET_WRITE(pb, len1, len1, 0, len1); PACKET_CONSUME(pb, len1, 0); - len2 = capacity - TLEN(len1) - TLEN(12); + len2 = capacity - ROUND_UP(len1, sizeof(uint32_t)) - 2 * sizeof(uint16_t) - 8; PACKET_WRITE(pb, len2, len2, 1, len2); PACKET_WRITE(pb, SPSC_PBUF_MAX_LEN - 1, 0, 1, 12); From 69d1d04ba5caf6031548fd2d49f1e98e29ba5563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 226/501] Revert "[nrf fromlist] boards/arm/thingy53_nrf5340: Add mcuboot's gpio aliases" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit adbe09d60d49be7dcfa773280db501c241dc0074. Signed-off-by: Andrzej Głąbek --- boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 0d4042f18bf..f6a120d2f34 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -114,8 +114,6 @@ magn0 = &bmm150; watchdog0 = &wdt0; accel0 = &adxl362; - mcuboot-button0 = &button1; - mcuboot-led0 = &blue_led; }; }; From ecae627b9bafb1852be3f207eaa35d6fde2a1cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 227/501] Revert "[nrf fromtree] doc: Added note regarding the intended use for secondary services" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3afbbacd2ea218f0f203a1c45cb55d5f0eba2820. Signed-off-by: Andrzej Głąbek --- include/zephyr/bluetooth/gatt.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index 30a4ab37996..f9e1750e061 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -622,9 +622,6 @@ ssize_t bt_gatt_attr_read_service(struct bt_conn *conn, * * Helper macro to declare a secondary service attribute. * - * @note A secondary service is only intended to be included from a primary - * service or another secondary service or other higher layer specification. - * * @param _service Service attribute value. */ #define BT_GATT_SECONDARY_SERVICE(_service) \ From bde4f728704544eb7446adc01fd37ff88cb828a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 228/501] Revert "[nrf fromtree] doc: Documenting value of bt_gatt_attr->perm after bt_gatt_discover()" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 644fe57ee9003af3cb2d8e12dc8776bddee77838. Signed-off-by: Andrzej Głąbek --- include/zephyr/bluetooth/gatt.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index f9e1750e061..eff08637518 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -172,10 +172,7 @@ struct bt_gatt_attr { void *user_data; /** Attribute handle */ uint16_t handle; - /** @brief Attribute permissions. - * - * Will be 0 if returned from bt_gatt_discover(). - */ + /** Attribute permissions */ uint16_t perm; }; From ef5719797927a4eecb2869a57974ffcd99321017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 229/501] Revert "[nrf fromtree] doc: Updated documentation regarding Primary Service Discovery" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d45f1363f72a81123b77f374114419b2e628364c. Signed-off-by: Andrzej Głąbek --- include/zephyr/bluetooth/gatt.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index eff08637518..3172a0d00f0 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -1455,9 +1455,8 @@ struct bt_gatt_discover_params { * * This procedure is used by a client to discover attributes on a server. * - * Primary Service Discovery: Procedure allows to discover primary services - * either by Discover All Primary Services or - * Discover Primary Services by Service UUID. + * Primary Service Discovery: Procedure allows to discover specific Primary + * Service based on UUID. * Include Service Discovery: Procedure allows to discover all Include Services * within specified range. * Characteristic Discovery: Procedure allows to discover all characteristics From 3a3fcadfc7bdebee9c1e7e2b1441fca3b0e8bef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 230/501] Revert "[nrf fromtree] Bluetooth: Host: Clean up buffer user data in case of error" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 246feabcb3dd9f3354861cabd2f35b2188ee2faa. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/l2cap.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 7691bcc2466..e0a9bed3ca6 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -2952,7 +2952,6 @@ int bt_l2cap_chan_send_cb(struct bt_l2cap_chan *chan, struct net_buf *buf, bt_co { struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); struct l2cap_tx_meta_data *data; - void *old_user_data = l2cap_tx_meta_data(buf); int err; if (!buf) { @@ -3004,11 +3003,7 @@ int bt_l2cap_chan_send_cb(struct bt_l2cap_chan *chan, struct net_buf *buf, bt_co net_buf_put(&le_chan->tx_queue, buf); return l2cap_tx_meta_data(buf)->sent; } - BT_ERR("failed to send message %d", err); - - l2cap_tx_meta_data(buf) = old_user_data; - free_tx_meta_data(data); } return err; From 8da70e2e49dad0069b9a8d6c0948d3763e723855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 231/501] Revert "[nrf fromtree] Bluetooth: Host: Clear random address field in bt_dev in bt_disable()" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 15cd94d6632f7e9b72acf25531e64f03a3419d44. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/hci_core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index eb1e28819b5..c9c61b529ee 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3765,9 +3765,6 @@ int bt_disable(void) /* Some functions rely on checking this bitfield */ memset(bt_dev.supported_commands, 0x00, sizeof(bt_dev.supported_commands)); - /* If random address was set up - clear it */ - bt_addr_le_copy(&bt_dev.random_addr, BT_ADDR_LE_ANY); - /* Abort TX thread */ k_thread_abort(&tx_thread_data); From de2b771cf0f03aea3f45fa710dba2a15349df0f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 232/501] Revert "[nrf fromtree] Bluetooth: smp: Fix SC with fixed passkey" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bda604e512a48ea042535b908025f5afeb79f05b. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/smp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 86d45793986..ff5d7659ad8 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -3144,8 +3144,7 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) } } - if (!IS_ENABLED(CONFIG_BT_SMP_SC_PAIR_ONLY) && - (DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && + if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && !atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && smp_auth_cb && smp_auth_cb->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); @@ -3347,8 +3346,7 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) } } - if (!IS_ENABLED(CONFIG_BT_SMP_SC_PAIR_ONLY) && - (DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && + if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && smp_auth_cb && smp_auth_cb->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); From d80fd7afc199098a024812dd5feeae44f0c363e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 233/501] Revert "[nrf fromtree] Bluetooth: Increase RX thread stack size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2b8b335dc1de04037e9c00a8e7e90b8472860234. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 86b128b1f96..eaf8a8337fb 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -129,7 +129,7 @@ config BT_RX_STACK_SIZE default 2200 if BT_MESH default 2048 if BT_AUDIO default 2200 if BT_SETTINGS - default 1200 + default 1024 help Size of the receiving thread stack. This is the context from which all event callbacks to the application occur. The From 49e5ff9bfa86aae4bf76ac54c1bf66cb0ef53c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 234/501] Revert "[nrf fromtree] Bluetooth: Host: Fix invalid sync term callback params" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 241c81cb21116485fe59f47496237958d4b5c094. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index 814c12774f8..dddb4a217c7 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -907,8 +907,8 @@ void bt_hci_le_per_adv_sync_established(struct net_buf *buf) struct bt_le_per_adv_sync_term_info term_info; /* Terminate the pending PA sync and notify app */ - term_info.addr = &evt->adv_addr; - term_info.sid = evt->sid; + term_info.addr = &pending_per_adv_sync->addr; + term_info.sid = pending_per_adv_sync->sid; term_info.reason = unexpected_evt ? BT_HCI_ERR_UNSPECIFIED : evt->status; /* Deleting before callback, so the caller will be able From 6bb209c84f900ef2c79ac69113a5abd9844b3afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 235/501] Revert "[nrf fromtree] Bluetooth: bugfix in applying appearance from settings" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ef967e365f1972f85e7d2367f4acbe4421059968. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/settings.c b/subsys/bluetooth/host/settings.c index 2b99e22157e..284250a145d 100644 --- a/subsys/bluetooth/host/settings.c +++ b/subsys/bluetooth/host/settings.c @@ -186,7 +186,7 @@ static int set(const char *name, size_t len_rd, settings_read_cb read_cb, #if defined(CONFIG_BT_DEVICE_APPEARANCE_DYNAMIC) if (!strncmp(name, "appearance", len)) { - if (len_rd != sizeof(bt_dev.appearance)) { + if (len != sizeof(bt_dev.appearance)) { BT_ERR("Ignoring settings entry 'bt/appearance'. Wrong length."); return -EINVAL; } From 6967833ee6d375536dd28f09bc1b73595a9c7117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 236/501] Revert "[nrf fromtree] Bluetooth: host: Fix SMP local keys check when starting encryption" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 90e2d6563144f7b106be9052fc6d43e1d0be71b0. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/smp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index ff5d7659ad8..9e6298f1260 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -374,15 +374,15 @@ static bool smp_keys_check(struct bt_conn *conn) return false; } - if (conn->required_sec_level >= BT_SECURITY_L3 && + if (conn->required_sec_level > BT_SECURITY_L2 && !(conn->le.keys->flags & BT_KEYS_AUTHENTICATED)) { return false; } - if (conn->required_sec_level >= BT_SECURITY_L4 && - !((conn->le.keys->flags & BT_KEYS_AUTHENTICATED) && - (conn->le.keys->keys & BT_KEYS_LTK_P256) && - (conn->le.keys->enc_size == BT_SMP_MAX_ENC_KEY_SIZE))) { + if (conn->required_sec_level > BT_SECURITY_L3 && + !(conn->le.keys->flags & BT_KEYS_AUTHENTICATED) && + !(conn->le.keys->keys & BT_KEYS_LTK_P256) && + !(conn->le.keys->enc_size == BT_SMP_MAX_ENC_KEY_SIZE)) { return false; } From 9ab8b873d73740faf5b58ccf90a417ca1f414991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 237/501] Revert "[nrf fromtree] Bluetooth: host: Fix scan info dangling pointer" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8445e4296708e6a7cfb3f532262bfe54f97325c9. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/scan.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index dddb4a217c7..95901952ef7 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -462,6 +462,8 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, bt_lookup_id_addr(BT_ID_DEFAULT, addr)); } + info->addr = &id_addr; + if (scan_dev_found_cb) { net_buf_simple_save(buf, &state); @@ -471,8 +473,6 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, net_buf_simple_restore(buf, &state); } - info->addr = &id_addr; - SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&scan_cbs, listener, next, node) { if (listener->recv) { net_buf_simple_save(buf, &state); @@ -484,9 +484,6 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, } } - /* Clear pointer to this stack frame before returning to calling function */ - info->addr = NULL; - #if defined(CONFIG_BT_CENTRAL) check_pending_conn(&id_addr, addr, info->adv_props); #endif /* CONFIG_BT_CENTRAL */ From 820464e0be2bced1a038a84ac31eb05e97bfa825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 238/501] Revert "[nrf fromlist] drivers: flash: nrf: Fix ticker stop user id value" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e07198b46fca125989aefda3461cf8879e9fb819. Signed-off-by: Andrzej Głąbek --- drivers/flash/soc_flash_nrf_ticker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/flash/soc_flash_nrf_ticker.c b/drivers/flash/soc_flash_nrf_ticker.c index 989a163ca13..1cdec5450a4 100644 --- a/drivers/flash/soc_flash_nrf_ticker.c +++ b/drivers/flash/soc_flash_nrf_ticker.c @@ -91,7 +91,7 @@ static void time_slot_callback_work(uint32_t ticks_at_expire, ll_timeslice_ticker_id_get(&instance_index, &ticker_id); /* Stop the prepare ticker, from ULL_HIGH context */ - ret = ticker_stop(instance_index, 1U, ticker_id, + ret = ticker_stop(instance_index, 0U, ticker_id, ticker_stop_prepare_cb, NULL); __ASSERT((ret == TICKER_STATUS_SUCCESS || ret == TICKER_STATUS_BUSY), @@ -136,7 +136,7 @@ static void time_slot_delay(uint32_t ticks_at_expire, uint32_t ticks_delay, _ticker_sync_context.result = 0; /* Abort flash prepare ticker, from ULL_HIGH context */ - ret = ticker_stop(instance_index, 1U, ticker_id, + ret = ticker_stop(instance_index, 0U, ticker_id, ticker_stop_prepare_cb, NULL); __ASSERT((ret == TICKER_STATUS_SUCCESS || ret == TICKER_STATUS_BUSY), From 8e0ed418557fc357e6ac624f0ec1bff992484e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 239/501] Revert "[nrf fromlist] drivers: flash: nrf: Fix ticker stop synchronization" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4a9575de2533c392749c5f2de41ee33c3adaf203. Signed-off-by: Andrzej Głąbek --- drivers/flash/soc_flash_nrf_ticker.c | 89 ++++++++++------------------ 1 file changed, 30 insertions(+), 59 deletions(-) diff --git a/drivers/flash/soc_flash_nrf_ticker.c b/drivers/flash/soc_flash_nrf_ticker.c index 1cdec5450a4..c060e883bf3 100644 --- a/drivers/flash/soc_flash_nrf_ticker.c +++ b/drivers/flash/soc_flash_nrf_ticker.c @@ -35,37 +35,20 @@ struct ticker_sync_context { static struct ticker_sync_context _ticker_sync_context; + /* semaphore for synchronization of flash operations */ static struct k_sem sem_sync; -static void ticker_stop_work_cb(uint32_t status, void *param) -{ - __ASSERT((status == TICKER_STATUS_SUCCESS || - status == TICKER_STATUS_FAILURE), - "Failed to stop work ticker, ticker job busy.\n"); - - /* notify thread that data is available */ - k_sem_give(&sem_sync); -} - -static void ticker_stop_prepare_cb(uint32_t status, void *param) +static inline int _ticker_stop(uint8_t inst_idx, uint8_t u_id, uint8_t tic_id) { - uint8_t instance_index; - uint8_t ticker_id; - uint32_t ret; - - __ASSERT(status == TICKER_STATUS_SUCCESS, - "Failed to stop prepare ticker.\n"); + int ret = ticker_stop(inst_idx, u_id, tic_id, NULL, NULL); - /* Get the ticker instance and ticker id for flash operations */ - ll_timeslice_ticker_id_get(&instance_index, &ticker_id); + if (ret != TICKER_STATUS_SUCCESS && + ret != TICKER_STATUS_BUSY) { + __ASSERT(0, "Failed to stop ticker.\n"); + } - /* Stop the work ticker, from ULL_LOW context */ - ret = ticker_stop(instance_index, 2U, (ticker_id + 1U), - ticker_stop_work_cb, NULL); - __ASSERT((ret == TICKER_STATUS_SUCCESS || - ret == TICKER_STATUS_BUSY), - "Failed to request the work ticker to stop.\n"); + return ret; } static void time_slot_callback_work(uint32_t ticks_at_expire, @@ -75,6 +58,8 @@ static void time_slot_callback_work(uint32_t ticks_at_expire, void *context) { struct flash_op_desc *op_desc; + uint8_t instance_index; + uint8_t ticker_id; int rc; __ASSERT(ll_radio_state_is_idle(), @@ -83,21 +68,15 @@ static void time_slot_callback_work(uint32_t ticks_at_expire, op_desc = context; rc = op_desc->handler(op_desc->context); if (rc != FLASH_OP_ONGOING) { - uint8_t instance_index; - uint8_t ticker_id; - uint32_t ret; - - /* Get the ticker instance and ticker id for flash operations */ ll_timeslice_ticker_id_get(&instance_index, &ticker_id); - /* Stop the prepare ticker, from ULL_HIGH context */ - ret = ticker_stop(instance_index, 0U, ticker_id, - ticker_stop_prepare_cb, NULL); - __ASSERT((ret == TICKER_STATUS_SUCCESS || - ret == TICKER_STATUS_BUSY), - "Failed to stop ticker.\n"); + /* Stop the time slot ticker */ + _ticker_stop(instance_index, 0, ticker_id); _ticker_sync_context.result = (rc == FLASH_OP_DONE) ? 0 : rc; + + /* notify thread that data is available */ + k_sem_give(&sem_sync); } } @@ -106,16 +85,15 @@ static void time_slot_delay(uint32_t ticks_at_expire, uint32_t ticks_delay, { uint8_t instance_index; uint8_t ticker_id; - uint32_t ret; + int err; - /* Get the ticker instance and ticker id for flash operations */ ll_timeslice_ticker_id_get(&instance_index, &ticker_id); - /* Start a secondary one-shot ticker after ticks_delay, + /* start a secondary one-shot ticker after ticks_delay, * this will let any radio role to gracefully abort and release the * Radio h/w. */ - ret = ticker_start(instance_index, /* Radio instance ticker */ + err = ticker_start(instance_index, /* Radio instance ticker */ 1, /* user id for link layer ULL_HIGH */ /* (MAYFLY_CALL_ID_WORKER) */ (ticker_id + 1), /* ticker_id */ @@ -131,16 +109,14 @@ static void time_slot_delay(uint32_t ticks_at_expire, uint32_t ticks_delay, NULL, /* no op callback */ NULL); - if (ret != TICKER_STATUS_SUCCESS && ret != TICKER_STATUS_BUSY) { - /* Failed to enqueue the ticker start operation request */ + if (err != TICKER_STATUS_SUCCESS && err != TICKER_STATUS_BUSY) { _ticker_sync_context.result = 0; - /* Abort flash prepare ticker, from ULL_HIGH context */ - ret = ticker_stop(instance_index, 0U, ticker_id, - ticker_stop_prepare_cb, NULL); - __ASSERT((ret == TICKER_STATUS_SUCCESS || - ret == TICKER_STATUS_BUSY), - "Failed to stop ticker.\n"); + /* abort flash timeslots */ + _ticker_stop(instance_index, 0, ticker_id); + + /* notify thread that data is available */ + k_sem_give(&sem_sync); } } @@ -183,6 +159,7 @@ int nrf_flash_sync_init(void) void nrf_flash_sync_set_context(uint32_t duration) { + /* FLASH_SYNC_SWITCHING_TIME is delay which is always added by * the slot calling mechanism */ @@ -194,14 +171,12 @@ int nrf_flash_sync_exe(struct flash_op_desc *op_desc) { uint8_t instance_index; uint8_t ticker_id; - uint32_t ret; int result; + uint32_t err; - /* Get the ticker instance and ticker id for flash operations */ ll_timeslice_ticker_id_get(&instance_index, &ticker_id); - /* Start periodic flash operation prepare time slots */ - ret = ticker_start(instance_index, + err = ticker_start(instance_index, 3, /* user id for thread mode */ /* (MAYFLY_CALL_ID_PROGRAM) */ ticker_id, /* flash ticker id */ @@ -219,15 +194,11 @@ int nrf_flash_sync_exe(struct flash_op_desc *op_desc) NULL, /* no op callback */ NULL); - if (ret != TICKER_STATUS_SUCCESS && ret != TICKER_STATUS_BUSY) { - /* Failed to enqueue the ticker start operation request */ + if (err != TICKER_STATUS_SUCCESS && err != TICKER_STATUS_BUSY) { result = -ECANCELED; } else if (k_sem_take(&sem_sync, K_MSEC(FLASH_TIMEOUT_MS)) != 0) { - /* Stop any scheduled jobs, from thread context */ - ret = ticker_stop(instance_index, 3U, ticker_id, NULL, NULL); - __ASSERT((ret == TICKER_STATUS_SUCCESS || - ret == TICKER_STATUS_BUSY), - "Failed to stop ticker.\n"); + /* Stop any scheduled jobs */ + _ticker_stop(instance_index, 3, ticker_id); /* wait for operation's complete overrun*/ result = -ETIMEDOUT; From 47b6c05d3dc0adccd865e0fe5dc328b3bed6861c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 240/501] Revert "[nrf fromlist] Bluetooth: Controller: Fix periodic advertising re-enable assertion" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cba512c96bc1d1aab937d5eadfe24dc81591f221. Signed-off-by: Andrzej Głąbek --- .../bluetooth/controller/ll_sw/ull_adv_sync.c | 70 ++----------------- 1 file changed, 6 insertions(+), 64 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c index c9f1ce3451d..50f0e283031 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c @@ -163,45 +163,10 @@ uint8_t ll_adv_sync_param_set(uint8_t handle, uint16_t interval, uint16_t flags) } #endif /* CONFIG_BT_CTLR_DF_ADV_CTE_TX */ -#if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) - /* Duplicate chain PDUs */ - do { - struct pdu_adv *pdu_chain; - -#endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK */ - err = ull_adv_sync_pdu_set_clear(lll_sync, pdu_prev, pdu, - 0U, 0U, NULL); - if (err) { - return err; - } - -#if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) - pdu_prev = lll_adv_pdu_linked_next_get(pdu_prev); - pdu_chain = lll_adv_pdu_linked_next_get(pdu); - - /* Allocate new chain PDU if required */ - if (pdu_prev) { - /* Prior PDU chain allocation valid */ - if (pdu_chain) { - pdu = pdu_chain; - - continue; - } - - /* Get a new chain PDU */ - pdu_chain = lll_adv_pdu_alloc_pdu_adv(); - if (!pdu_chain) { - return BT_HCI_ERR_INSUFFICIENT_RESOURCES; - } - - /* Link the chain PDU to parent PDU */ - lll_adv_pdu_linked_append(pdu_chain, pdu); - - /* continue back to update the new PDU */ - pdu = pdu_chain; - } - } while (pdu_prev); -#endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK */ + err = ull_adv_sync_pdu_set_clear(lll_sync, pdu_prev, pdu, 0, 0, NULL); + if (err) { + return err; + } lll_adv_sync_data_enqueue(lll_sync, ter_idx); @@ -786,10 +751,7 @@ uint8_t ll_adv_sync_enable(uint8_t handle, uint8_t enable) #endif /* CONFIG_BT_CTLR_DF_ADV_CTE_TX */ #if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) - /* Update ADI while duplicating chain PDUs */ do { - struct pdu_adv *pdu_chain; - #endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK */ err = ull_adv_sync_pdu_set_clear(lll_sync, pdu_prev, pdu, hdr_add_fields, @@ -801,29 +763,9 @@ uint8_t ll_adv_sync_enable(uint8_t handle, uint8_t enable) #if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) pdu_prev = lll_adv_pdu_linked_next_get(pdu_prev); - pdu_chain = lll_adv_pdu_linked_next_get(pdu); + pdu = lll_adv_pdu_linked_next_get(pdu); - /* Allocate new chain PDU if required */ - if (pdu_prev) { - /* Prior PDU chain allocation valid */ - if (pdu_chain) { - pdu = pdu_chain; - - continue; - } - - /* Get a new chain PDU */ - pdu_chain = lll_adv_pdu_alloc_pdu_adv(); - if (!pdu_chain) { - return BT_HCI_ERR_INSUFFICIENT_RESOURCES; - } - - /* Link the chain PDU to parent PDU */ - lll_adv_pdu_linked_append(pdu_chain, pdu); - - /* continue back to update the new PDU */ - pdu = pdu_chain; - } + LL_ASSERT((pdu_prev && pdu) || (!pdu_prev && !pdu)); } while (pdu_prev); #endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK */ } From 023e727d6c4479fb7e79eb45742678e1229c0fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 241/501] Revert "[nrf fromlist] Bluetooth: df: Add ntf of insufficient resources for IQ samples" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit de7c4905d9495754c82531e211adf39725b10849. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/ll_sw/lll.h | 2 - subsys/bluetooth/controller/ll_sw/lll_sync.h | 10 - .../controller/ll_sw/nordic/lll/lll_conn.c | 2 +- .../controller/ll_sw/nordic/lll/lll_df.c | 81 +---- .../ll_sw/nordic/lll/lll_df_internal.h | 10 +- .../ll_sw/nordic/lll/lll_df_types.h | 4 - .../ll_sw/nordic/lll/lll_peripheral.c | 2 +- .../controller/ll_sw/nordic/lll/lll_sync.c | 330 +++--------------- subsys/bluetooth/controller/ll_sw/ull.c | 22 +- subsys/bluetooth/controller/ll_sw/ull_df.c | 32 +- .../bluetooth/controller/ll_sw/ull_scan_aux.c | 2 +- subsys/bluetooth/controller/ll_sw/ull_sync.c | 25 -- 12 files changed, 74 insertions(+), 448 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/lll.h b/subsys/bluetooth/controller/ll_sw/lll.h index 8f53d99346f..5e57c99e198 100644 --- a/subsys/bluetooth/controller/ll_sw/lll.h +++ b/subsys/bluetooth/controller/ll_sw/lll.h @@ -309,8 +309,6 @@ enum node_rx_type { NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT, NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT, NODE_RX_TYPE_DTM_IQ_SAMPLE_REPORT, - NODE_RX_TYPE_IQ_SAMPLE_REPORT_ULL_RELEASE, - NODE_RX_TYPE_IQ_SAMPLE_REPORT_LLL_RELEASE, #if defined(CONFIG_BT_CTLR_USER_EXT) /* No entries shall be added after the NODE_RX_TYPE_USER_START/END */ diff --git a/subsys/bluetooth/controller/ll_sw/lll_sync.h b/subsys/bluetooth/controller/ll_sw/lll_sync.h index fb1a120331b..20ca0781d6d 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_sync.h +++ b/subsys/bluetooth/controller/ll_sw/lll_sync.h @@ -64,16 +64,6 @@ struct lll_sync { #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) struct lll_df_sync df_cfg; - /* Member stores one additional IQ report rx node for notification of insufficient - * resources to sample all CTEs in currently pending synchronization event. - * The member is temporary storage used between prepare of an event and IQ data report - * generation. - */ - struct node_rx_iq_report *node_cte_incomplete; - /* Member sotres information if there were inssufficient IQ report rx nodes for all CTEs - * in pending synchronization event. - */ - bool is_cte_incomplete; #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ }; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c index 34a1572b22b..02eaa450067 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c @@ -517,7 +517,7 @@ void lll_conn_isr_tx(void *param) df_rx_params = dbuf_curr_get(&df_rx_cfg->hdr); if (df_rx_params->is_enabled) { - (void)lll_df_conf_cte_rx_enable(df_rx_params->slot_durations, + lll_df_conf_cte_rx_enable(df_rx_params->slot_durations, df_rx_params->ant_sw_len, df_rx_params->ant_ids, df_rx_cfg->chan, CTE_INFO_IN_S1_BYTE, lll->phy_rx); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c index f1957d2b5dd..20e7d82b312 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c @@ -23,9 +23,8 @@ #include "lll_adv_types.h" #include "lll_adv.h" #include "lll_adv_pdu.h" -#include "lll_df_types.h" -#include "lll_sync.h" #include "lll_df.h" +#include "lll_df_types.h" #include "lll_df_internal.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) @@ -223,8 +222,8 @@ struct lll_df_sync_cfg *lll_df_sync_cfg_latest_get(struct lll_df_sync *df_cfg, * * In case of AoA mode ant_num and ant_ids parameters are not used. */ -int lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uint8_t *ant_ids, - uint8_t chan_idx, bool cte_info_in_s1, uint8_t phy) +void lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uint8_t *ant_ids, + uint8_t chan_idx, bool cte_info_in_s1, uint8_t phy) { struct node_rx_iq_report *node_rx; @@ -244,86 +243,14 @@ int lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uint radio_df_ant_switch_pattern_set(ant_ids, ant_num); #endif /* CONFIG_BT_CTLR_DF_ANT_SWITCH_RX */ - /* Could be moved up, if Radio setup is not needed if we are not going to report IQ data */ node_rx = ull_df_iq_report_alloc_peek(1); - if (!node_rx) { - return -ENOMEM; - } + LL_ASSERT(node_rx); radio_df_iq_data_packet_set(node_rx->pdu, IQ_SAMPLE_TOTAL_CNT); node_rx->chan_idx = chan_idx; - - return 0; } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX */ -#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) -/** - * @brief Function allocates additional IQ report node for Host notification about - * insufficient resources to sample all CTE in a periodic synchronization event. - * - * @param sync_lll Pointer to periodic synchronization object - * - * @return -ENOMEM in case there is no free node for IQ Data report - * @return -ENOBUFS in case there are no free nodes for report of insufficient resources as well as - * IQ data report - * @return zero in case of success - */ -int lll_df_iq_report_no_resources_prepare(struct lll_sync *sync_lll) -{ - struct node_rx_iq_report *cte_incomplete; - int err; - - /* Allocate additional node for a sync context only once. This is an additional node to - * report there is no more memory to store IQ data, hence some of CTEs are not going - * to be sampled. - */ - if (!sync_lll->node_cte_incomplete && !sync_lll->is_cte_incomplete) { - /* Check if there are free nodes for: - * - storage of IQ data collcted during a PDU reception - * - Host notification about insufficient resources for IQ data - */ - cte_incomplete = ull_df_iq_report_alloc_peek(2); - if (!cte_incomplete) { - /* Check if there is a free node to report insufficient resources only. - * There will be no IQ Data collection. - */ - cte_incomplete = ull_df_iq_report_alloc_peek(1); - if (!cte_incomplete) { - /* No free nodes at all */ - return -ENOBUFS; - } - - /* No memory for IQ data report */ - err = -ENOMEM; - } else { - err = 0; - } - - /* Do actual allocation and store the node for futher processing after a PDU - * reception, - */ - ull_df_iq_report_alloc(); - - /* Store the node in lll_sync object. This is a place where the node may be stored - * until processing afte reception of a PDU to report no IQ data or hand over - * to aux objects for usage in ULL. If there is not enough memory for IQ data - * there is no node to use for temporary storage as it is done for PDUs. - */ - sync_lll->node_cte_incomplete = cte_incomplete; - - /* Reset the state every time the prepare is called. IQ report node may be unchanged - * from former synchronization event. - */ - sync_lll->is_cte_incomplete = false; - } else { - err = 0; - } - - return err; -} -#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - #if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX) /** * @brief Function initializes parsing of received PDU for CTEInfo. diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_internal.h b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_internal.h index 174aadef140..1766bdd4b2e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_internal.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_internal.h @@ -6,7 +6,6 @@ /* Forward declaration to avoid unnecessary includes. */ struct lll_adv_sync; -struct lll_sync; /* Enables CTE transmission according to provided configuration */ void lll_df_cte_tx_enable(struct lll_adv_sync *lll_sync, const struct pdu_adv *pdu, @@ -57,13 +56,8 @@ static inline uint8_t lll_df_sync_cfg_is_modified(struct lll_df_sync *df_cfg) } /* Enables CTE reception according to provided configuration */ -int lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uint8_t *ant_ids, - uint8_t chan_idx, bool cte_info_in_s1, uint8_t phy); - -/* Function prepares memory for Host notification about insufficient resources to sample all CTE - * in a given periodic synchronization event. - */ -int lll_df_iq_report_no_resources_prepare(struct lll_sync *sync); +void lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uint8_t *ant_ids, + uint8_t chan_idx, bool cte_info_in_s1, uint8_t phy); /* Configure CTE transmission */ void lll_df_cte_tx_configure(uint8_t cte_type, uint8_t cte_length, uint8_t num_ant_ids, diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_types.h b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_types.h index 4087b35d3bb..e3efe8eefc4 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_types.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df_types.h @@ -96,10 +96,6 @@ struct iq_sample { /* Receive node aimed to report collected IQ samples during CTE receive */ struct node_rx_iq_report { - /* hdr member must be a first member of the structure. It can't be moved because - * it is expected to be in the beginning of a node memory for common handling of - * all node_rx_xxx types. - */ struct node_rx_hdr hdr; uint8_t sample_count; struct pdu_cte_info cte_info; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c index 026ba1f9f35..598d7d3dacf 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c @@ -225,7 +225,7 @@ static int prepare_cb(struct lll_prepare_param *p) df_rx_params = dbuf_latest_get(&df_rx_cfg->hdr, NULL); if (df_rx_params->is_enabled == true) { - (void)lll_df_conf_cte_rx_enable(df_rx_params->slot_durations, + lll_df_conf_cte_rx_enable(df_rx_params->slot_durations, df_rx_params->ant_sw_len, df_rx_params->ant_ids, data_chan_use, CTE_INFO_IN_S1_BYTE, lll->phy_rx); lll->df_rx_cfg.chan = data_chan_use; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index 801fef64833..f1e43088e18 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -60,10 +60,8 @@ static void isr_rx_aux_chain(void *param); static void isr_rx_done_cleanup(struct lll_sync *lll, uint8_t crc_ok, bool sync_term); static void isr_done(void *param); #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) -static int iq_report_create_put(struct lll_sync *lll, uint8_t rssi_ready, - uint8_t packet_status); -static int iq_report_incomplete_create_put(struct lll_sync *lll); -static void iq_report_incomplete_release_put(struct lll_sync *lll); +static int create_iq_report(struct lll_sync *lll, uint8_t rssi_ready, + uint8_t packet_status); static bool is_max_cte_reached(uint8_t max_cte_count, uint8_t cte_count); #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ static uint8_t data_channel_calc(struct lll_sync *lll); @@ -174,28 +172,9 @@ void lll_sync_aux_prepare_cb(struct lll_sync *lll, cfg = lll_df_sync_cfg_latest_get(&lll->df_cfg, NULL); if (cfg->is_enabled) { - int err; - - /* Prepare additional node for reporting inssufficient memory for IQ samples - * reports. - */ - err = lll_df_iq_report_no_resources_prepare(lll); - if (!err) { - err = lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, - cfg->ant_ids, lll_aux->chan, - CTE_INFO_IN_PAYLOAD, lll_aux->phy); - if (err) { - lll->is_cte_incomplete = true; - } - } else { - lll->is_cte_incomplete = true; - } + lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, cfg->ant_ids, + lll_aux->chan, CTE_INFO_IN_PAYLOAD, lll_aux->phy); cfg->cte_count = 0; - } else { - /* If CTE reception is disabled, release additional node allocated to report - * insufficient memory for IQ samples. - */ - iq_report_incomplete_release_put(lll); } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ radio_switch_complete_and_disable(); @@ -300,39 +279,13 @@ static int create_prepare_cb(struct lll_prepare_param *p) if (false) { #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) } else if (cfg->is_enabled) { - int err; - - /* In case of call in create_prepare_cb, new sync event starts hence discard - * previous incomplete state. - */ - lll->is_cte_incomplete = false; - - /* Prepare additional node for reporting inssufficient IQ report nodes issue */ - err = lll_df_iq_report_no_resources_prepare(lll); - if (!err) { - err = lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, - cfg->ant_ids, chan_idx, CTE_INFO_IN_PAYLOAD, - lll->phy); - if (err) { - lll->is_cte_incomplete = true; - } - } else { - lll->is_cte_incomplete = true; - } + lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, cfg->ant_ids, + chan_idx, CTE_INFO_IN_PAYLOAD, lll->phy); cfg->cte_count = 0; - } else { - /* If CTE reception is disabled, release additional node allocated to report - * insufficient memory for IQ samples. - */ - iq_report_incomplete_release_put(lll); -#else - } else { #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - if (IS_ENABLED(CONFIG_BT_CTLR_DF_SUPPORT)) { - /* Disable CTE reception and sampling in Radio */ - radio_df_cte_inline_set_enabled(false); - } + } else if (IS_ENABLED(CONFIG_BT_CTLR_DF_SUPPORT)) { + radio_df_cte_inline_set_enabled(false); } radio_switch_complete_and_disable(); @@ -386,31 +339,9 @@ static int prepare_cb(struct lll_prepare_param *p) cfg = lll_df_sync_cfg_latest_get(&lll->df_cfg, NULL); if (cfg->is_enabled) { - int err; - - /* In case of call in prepare, new sync event starts hence discard previous - * incomplete state. - */ - lll->is_cte_incomplete = false; - - /* Prepare additional node for reporting inssufficient IQ report nodes issue */ - err = lll_df_iq_report_no_resources_prepare(lll); - if (!err) { - err = lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, - cfg->ant_ids, chan_idx, CTE_INFO_IN_PAYLOAD, - lll->phy); - if (err) { - lll->is_cte_incomplete = true; - } - } else { - lll->is_cte_incomplete = true; - } + lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, cfg->ant_ids, + chan_idx, CTE_INFO_IN_PAYLOAD, lll->phy); cfg->cte_count = 0; - } else { - /* If CTE reception is disabled, release additional node allocated to report - * insufficient memory for IQ samples. - */ - iq_report_incomplete_release_put(lll); } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ @@ -685,27 +616,8 @@ static void isr_aux_setup(void *param) cfg = lll_df_sync_cfg_latest_get(&lll->df_cfg, NULL); if (cfg->is_enabled && is_max_cte_reached(cfg->max_cte_count, cfg->cte_count)) { - int err; - - /* Prepare additional node for reporting inssufficient memory for IQ samples - * reports. - */ - err = lll_df_iq_report_no_resources_prepare(lll); - if (!err) { - err = lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, - cfg->ant_ids, aux_ptr->chan_idx, - CTE_INFO_IN_PAYLOAD, aux_ptr->phy); - if (err) { - lll->is_cte_incomplete = true; - } - } else { - lll->is_cte_incomplete = true; - } - } else if (!cfg->is_enabled) { - /* If CTE reception is disabled, release additional node allocated to report - * insufficient memory for IQ samples. - */ - iq_report_incomplete_release_put(lll); + lll_df_conf_cte_rx_enable(cfg->slot_durations, cfg->ant_sw_len, cfg->ant_ids, + aux_ptr->chan_idx, CTE_INFO_IN_PAYLOAD, aux_ptr->phy); } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ radio_switch_complete_and_disable(); @@ -823,6 +735,7 @@ static int isr_rx(struct lll_sync *lll, uint8_t node_type, uint8_t crc_ok, if (node_type != NODE_RX_TYPE_EXT_AUX_REPORT) { lll->is_aux_sched = 1U; } + err = -EBUSY; } else { err = 0; @@ -830,37 +743,29 @@ static int isr_rx(struct lll_sync *lll, uint8_t node_type, uint8_t crc_ok, ull_rx_put(node_rx->hdr.link, node_rx); -#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) - if (cte_ready) { - /* If there is a periodic advertising report generate IQ data - * report with valid packet_status if there were free nodes for - * that. Or report insufficient resources for IQ data report. - * - * Retunred value is not checked because it does not matter if there - * is a IQ report to be send towards ULL. There is always periodic - * sync report to be send. - */ - (void)iq_report_create_put(lll, rssi_ready, BT_HCI_LE_CTE_CRC_OK); - } -#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - sched = true; + } else if (node_type == NODE_RX_TYPE_EXT_AUX_REPORT) { + err = -ENOMEM; } else { - if (node_type == NODE_RX_TYPE_EXT_AUX_REPORT) { - err = -ENOMEM; - } else { - err = 0; - } + err = 0; + } + +#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) + if (cte_ready) { + /* Retunred value is not checked because it does not matter if there + * is a IQ report to be send towards ULL. There is always periodic sync + * report to be send. + */ + (void)create_iq_report(lll, rssi_ready, BT_HCI_LE_CTE_CRC_OK); + sched = true; } +#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ + } else { #if defined(CONFIG_BT_CTLR_DF_SAMPLE_CTE_FOR_PDU_WITH_BAD_CRC) - /* In case of reception of chained PDUs IQ samples report for a PDU with wrong - * CRC is handled by caller. It has to be that way to be sure the IQ report - * follows possible periodic advertising report. - */ - if (cte_ready && node_type != NODE_RX_TYPE_EXT_AUX_REPORT) { - err = iq_report_create_put(lll, rssi_ready, - BT_HCI_LE_CTE_CRC_ERR_CTE_BASED_TIME); + if (cte_ready) { + err = create_iq_report(lll, rssi_ready, + BT_HCI_LE_CTE_CRC_ERR_CTE_BASED_TIME); if (!err) { sched = true; } @@ -919,10 +824,6 @@ static void isr_rx_adv_sync_estab(void *param) if (!trx_done) { /* TODO: Combine the early exit with above if-then-else block */ -#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) - LL_ASSERT(!lll->node_cte_incomplete); -#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - goto isr_rx_done; } @@ -963,6 +864,7 @@ static void isr_rx_adv_sync_estab(void *param) ull_rx_sched(); } } + isr_rx_done: #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING) && \ defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT) @@ -1051,8 +953,6 @@ static void isr_rx_aux_chain(void *param) */ lll_isr_status_reset(); - rssi_ready = 0U; - cte_ready = 0U; crc_ok = 0U; err = 0; @@ -1082,6 +982,7 @@ static void isr_rx_aux_chain(void *param) if (!trx_done) { /* TODO: Combine the early exit with above if-then-else block */ + err = 0; goto isr_rx_aux_chain_done; @@ -1093,6 +994,7 @@ static void isr_rx_aux_chain(void *param) */ err = isr_rx(lll, NODE_RX_TYPE_EXT_AUX_REPORT, crc_ok, phy_flags_rx, cte_ready, rssi_ready, SYNC_STAT_READY); + if (err == -EBUSY) { return; } @@ -1113,23 +1015,6 @@ static void isr_rx_aux_chain(void *param) node_rx->hdr.rx_ftr.aux_failed = 1U; ull_rx_put(node_rx->hdr.link, node_rx); - - if (!crc_ok) { -#if defined(CONFIG_BT_CTLR_DF_SAMPLE_CTE_FOR_PDU_WITH_BAD_CRC) - if (cte_ready) { - (void)iq_report_create_put(lll, rssi_ready, - BT_HCI_LE_CTE_CRC_ERR_CTE_BASED_TIME); - } -#endif /* CONFIG_BT_CTLR_DF_SAMPLE_CTE_FOR_PDU_WITH_BAD_CRC */ - } else { -#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) - /* Report insufficient resurces for IQ data report and relese additional - * noder_rx_iq_data stored in lll_sync object, to vaoid buffers leakage. - */ - iq_report_incomplete_create_put(lll); -#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - } - ull_rx_sched(); } @@ -1215,156 +1100,51 @@ static void isr_done(void *param) } #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) -static void iq_report_create(struct lll_sync *lll, uint8_t rssi_ready, uint8_t packet_status, - uint8_t slot_durations, struct node_rx_iq_report *iq_report) +static inline int create_iq_report(struct lll_sync *lll, uint8_t rssi_ready, + uint8_t packet_status) { + struct node_rx_iq_report *iq_report; + struct lll_df_sync_cfg *cfg; struct node_rx_ftr *ftr; uint8_t cte_info; uint8_t ant; - cte_info = radio_df_cte_status_get(); - ant = radio_df_pdu_antenna_switch_pattern_get(); - - iq_report->hdr.type = NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT; - iq_report->sample_count = radio_df_iq_samples_amount_get(); - iq_report->packet_status = packet_status; - iq_report->rssi_ant_id = ant; - iq_report->cte_info = *(struct pdu_cte_info *)&cte_info; - iq_report->local_slot_durations = slot_durations; - /* Event counter is updated to next value during event preparation, hence - * it has to be subtracted to store actual event counter value. - */ - iq_report->event_counter = lll->event_counter - 1; - - ftr = &iq_report->hdr.rx_ftr; - ftr->param = lll; - ftr->rssi = - ((rssi_ready) ? radio_rssi_get() : BT_HCI_LE_RSSI_NOT_AVAILABLE); -} - -static void iq_report_incomplete_create(struct lll_sync *lll, struct node_rx_iq_report *iq_report) -{ - struct node_rx_ftr *ftr; - - iq_report->hdr.type = NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT; - iq_report->sample_count = 0; - iq_report->packet_status = BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES; - /* Event counter is updated to next value during event preparation, - * hence it has to be subtracted to store actual event counter - * value. - */ - iq_report->event_counter = lll->event_counter - 1; - /* The PDU antenna is set in configuration, hence it is always - * available. BT 5.3 Core Spec. does not say if this field - * may be invalid in case of insufficient resources. - */ - iq_report->rssi_ant_id = radio_df_pdu_antenna_switch_pattern_get(); - /* Accodring to BT 5.3, Vol 4, Part E, section 7.7.65.21 below - * fields have invalid values in case of insufficient resources. - */ - iq_report->cte_info = - (struct pdu_cte_info){.time = 0, .rfu = 0, .type = 0}; - iq_report->local_slot_durations = 0; - - ftr = &iq_report->hdr.rx_ftr; - ftr->param = lll; - - ftr->rssi = BT_HCI_LE_RSSI_NOT_AVAILABLE; - ftr->extra = NULL; -} - -static int iq_report_create_put(struct lll_sync *lll, uint8_t rssi_ready, uint8_t packet_status) -{ - struct node_rx_iq_report *iq_report; - struct lll_df_sync_cfg *cfg; - int err; - cfg = lll_df_sync_cfg_curr_get(&lll->df_cfg); if (cfg->is_enabled) { - if (!lll->is_cte_incomplete && - is_max_cte_reached(cfg->max_cte_count, cfg->cte_count)) { + if (is_max_cte_reached(cfg->max_cte_count, cfg->cte_count)) { + cte_info = radio_df_cte_status_get(); + ant = radio_df_pdu_antenna_switch_pattern_get(); iq_report = ull_df_iq_report_alloc(); LL_ASSERT(iq_report); - iq_report_create(lll, rssi_ready, packet_status, - cfg->slot_durations, iq_report); - err = 0; - } else if (lll->is_cte_incomplete && is_max_cte_reached(cfg->max_cte_count, - cfg->cte_count)) { - iq_report = lll->node_cte_incomplete; - - /* Reception of chained PDUs may be still in progress. Do not report - * insufficient resources multiple times. + iq_report->hdr.type = NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT; + iq_report->sample_count = radio_df_iq_samples_amount_get(); + iq_report->packet_status = packet_status; + iq_report->rssi_ant_id = ant; + iq_report->cte_info = *(struct pdu_cte_info *)&cte_info; + iq_report->local_slot_durations = cfg->slot_durations; + /* Event counter is updated to next value during event preparation, hence + * it has to be subtracted to store actual event counter value. */ - if (iq_report) { - iq_report_incomplete_create(lll, iq_report); - lll->node_cte_incomplete = NULL; - - /* Report ready to be send to ULL */ - err = 0; - } else { - /* Incomplete CTE was already reported */ - err = -ENODATA; - } - } else { - err = -ENODATA; - } - } else { - err = -ENODATA; - } - - if (!err) { - ull_rx_put(iq_report->hdr.link, iq_report); + iq_report->event_counter = lll->event_counter - 1; - cfg->cte_count += 1U; - } - - return err; -} - -static int iq_report_incomplete_create_put(struct lll_sync *lll) -{ - struct lll_df_sync_cfg *cfg; - - cfg = lll_df_sync_cfg_curr_get(&lll->df_cfg); - - if (cfg->is_enabled) { - struct node_rx_iq_report *iq_report; - - iq_report = lll->node_cte_incomplete; + ftr = &iq_report->hdr.rx_ftr; + ftr->param = lll; + ftr->rssi = + ((rssi_ready) ? radio_rssi_get() : BT_HCI_LE_RSSI_NOT_AVAILABLE); - /* Reception of chained PDUs may be still in progress. Do not report - * insufficient resources multiple times. - */ - if (iq_report) { - iq_report_incomplete_create(lll, iq_report); + cfg->cte_count += 1U; - lll->node_cte_incomplete = NULL; ull_rx_put(iq_report->hdr.link, iq_report); return 0; - } else { - /* Incomplete CTE was already reported */ - return -ENODATA; } - } return -ENODATA; } -static void iq_report_incomplete_release_put(struct lll_sync *lll) -{ - if (lll->node_cte_incomplete) { - struct node_rx_iq_report *iq_report = lll->node_cte_incomplete; - - iq_report->hdr.type = NODE_RX_TYPE_IQ_SAMPLE_REPORT_LLL_RELEASE; - - ull_rx_put(iq_report->hdr.link, iq_report); - lll->node_cte_incomplete = NULL; - } -} static bool is_max_cte_reached(uint8_t max_cte_count, uint8_t cte_count) { return max_cte_count == BT_HCI_LE_SAMPLE_CTE_ALL || cte_count < max_cte_count; diff --git a/subsys/bluetooth/controller/ll_sw/ull.c b/subsys/bluetooth/controller/ll_sw/ull.c index 86a979addcb..ca4892bdaa2 100644 --- a/subsys/bluetooth/controller/ll_sw/ull.c +++ b/subsys/bluetooth/controller/ll_sw/ull.c @@ -448,10 +448,12 @@ static struct { * happen due to supervision timeout and other reasons that dont have an * incoming Rx-ed PDU). */ -#define LINK_RX_POOL_SIZE \ - (sizeof(memq_link_t) * \ - (RX_CNT + 2 + BT_CTLR_MAX_CONN + BT_CTLR_ADV_SET + (BT_CTLR_ADV_ISO_SET * 2) + \ - (BT_CTLR_SCAN_SYNC_SET * 2) + (BT_CTLR_SCAN_SYNC_ISO_SET * 2) + (IQ_REPORT_CNT))) +#define LINK_RX_POOL_SIZE \ + (sizeof(memq_link_t) * \ + (RX_CNT + 2 + BT_CTLR_MAX_CONN + BT_CTLR_ADV_SET + \ + (BT_CTLR_ADV_ISO_SET * 2) + (BT_CTLR_SCAN_SYNC_SET * 2) + \ + (BT_CTLR_SCAN_SYNC_ISO_SET * 2) + \ + (IQ_REPORT_CNT))) static struct { uint16_t quota_pdu; /* Number of un-utilized buffers */ @@ -935,18 +937,7 @@ uint8_t ll_rx_get(void **node_rx, uint16_t *handle) #endif /* CONFIG_BT_CONN || * (CONFIG_BT_OBSERVER && CONFIG_BT_CTLR_ADV_EXT) */ -#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) - } else if (rx->type == NODE_RX_TYPE_IQ_SAMPLE_REPORT_LLL_RELEASE) { - const uint8_t report_cnt = 1U; - - (void)memq_dequeue(memq_ll_rx.tail, &memq_ll_rx.head, NULL); - ll_rx_link_release(link); - ull_iq_report_link_inc_quota(report_cnt); - ull_df_iq_report_mem_release(rx); - ull_df_rx_iq_report_alloc(report_cnt); - goto ll_rx_get_again; -#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ #if defined(CONFIG_BT_CTLR_ADV_PERIODIC) } else if (rx->type == NODE_RX_TYPE_SYNC_CHM_COMPLETE) { rx_link_dequeue_release_quota_inc(link); @@ -2663,7 +2654,6 @@ static inline int rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx) case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT: case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT: case NODE_RX_TYPE_DTM_IQ_SAMPLE_REPORT: - case NODE_RX_TYPE_IQ_SAMPLE_REPORT_LLL_RELEASE: { (void)memq_dequeue(memq_ull_rx.tail, &memq_ull_rx.head, NULL); ll_rx_put(link, rx); diff --git a/subsys/bluetooth/controller/ll_sw/ull_df.c b/subsys/bluetooth/controller/ll_sw/ull_df.c index d7de0e8ab81..3f6813e5f30 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_df.c +++ b/subsys/bluetooth/controller/ll_sw/ull_df.c @@ -66,10 +66,9 @@ #define IQ_REPORT_STRUCT_OVERHEAD (IQ_REPORT_HEADER_SIZE) #define IQ_SAMPLE_SIZE (sizeof(struct iq_sample)) -#define IQ_REPORT_RX_NODE_POOL_ELEMENT_SIZE \ +#define IQ_REPORT_RX_NODE_POOL_ELEMENT_SIZE \ MROUND(IQ_REPORT_STRUCT_OVERHEAD + (IQ_SAMPLE_TOTAL_CNT * IQ_SAMPLE_SIZE)) -#define IQ_REPORT_POOL_SIZE \ - (IQ_REPORT_RX_NODE_POOL_ELEMENT_SIZE * IQ_REPORT_CNT) +#define IQ_REPORT_POOL_SIZE (IQ_REPORT_RX_NODE_POOL_ELEMENT_SIZE * IQ_REPORT_CNT) /* Memory pool to store IQ reports data */ static struct { @@ -77,22 +76,11 @@ static struct { uint8_t pool[IQ_REPORT_POOL_SIZE]; } mem_iq_report; -/* FIFO to store free IQ report norde_rx objects for LLL to ULL handover. */ +/* FIFO to store free IQ report norde_rx objects. */ static MFIFO_DEFINE(iq_report_free, sizeof(void *), IQ_REPORT_CNT); /* Number of available instance of linked list to be used for node_rx_iq_reports. */ static uint8_t mem_link_iq_report_quota_pdu; - -#if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) -/* Debug variable to store information about current number of allocated node_rx_iq_report. - * It supports verification if there is a resource leak. - * The variable may not be used when multiple - * advertising syncs are enabled. Checks may fail because CTE reception may be enabled/disabled - * in different moments, hence there may be allocated reports when it is expected not to. - */ -COND_CODE_1(CONFIG_BT_PER_ADV_SYNC_MAX, (static uint32_t iq_report_alloc_count;), (EMPTY)) -#define IF_SINGLE_ADV_SYNC_SET(code) COND_CODE_1(CONFIG_BT_PER_ADV_SYNC_MAX, (code), (EMPTY)) -#endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX*/ #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) @@ -449,11 +437,6 @@ uint8_t ll_df_set_cl_iq_sampling_enable(uint16_t handle, slot_minus_us = CTE_LEN_MAX_US; cfg->is_enabled = 0U; } else { -#if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) - /* When CTE is enabled there should be no iq report allocated */ - IF_SINGLE_ADV_SYNC_SET(LL_ASSERT(iq_report_alloc_count == 0)); -#endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ - /* Enable of already enabled CTE updates AoA configuration */ if (!((IS_ENABLED(CONFIG_BT_CTLR_DF_ANT_SWITCH_1US) && slot_durations == BT_HCI_LE_ANTENNA_SWITCHING_SLOT_1US) || @@ -534,7 +517,6 @@ bool ull_df_sync_cfg_is_not_enabled(struct lll_df_sync *df_cfg) return !cfg->is_enabled; } - #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX) || \ @@ -555,23 +537,17 @@ void *ull_df_iq_report_alloc_peek_iter(uint8_t *idx) void *ull_df_iq_report_alloc(void) { -#if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) - IF_SINGLE_ADV_SYNC_SET(iq_report_alloc_count++); -#endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ return MFIFO_DEQUEUE(iq_report_free); } void ull_df_iq_report_mem_release(struct node_rx_hdr *rx) { -#if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) - IF_SINGLE_ADV_SYNC_SET(iq_report_alloc_count--); -#endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ mem_release(rx, &mem_iq_report.free); } void ull_iq_report_link_inc_quota(int8_t delta) { - LL_ASSERT(delta <= 0 || mem_link_iq_report_quota_pdu < (IQ_REPORT_CNT)); + LL_ASSERT(delta <= 0 || mem_link_iq_report_quota_pdu < IQ_REPORT_CNT); mem_link_iq_report_quota_pdu += delta; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index 9147665455d..454953bf5e0 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -36,7 +36,6 @@ #include "ull_scan_internal.h" #include "ull_sync_internal.h" #include "ull_sync_iso_internal.h" -#include "ull_df_internal.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) #define LOG_MODULE_NAME bt_ctlr_ull_scan_aux @@ -525,6 +524,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx) aux->rx_incomplete = rx_incomplete; rx_incomplete = NULL; #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */ + } else { aux->data_len += data_len; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c index ae05876b178..e64754cd43b 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c @@ -247,7 +247,6 @@ uint8_t ll_sync_create(uint8_t options, uint8_t sid, uint8_t adv_addr_type, #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) ull_df_sync_cfg_init(&lll_sync->df_cfg); - LL_ASSERT(!lll_sync->node_cte_incomplete); #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ /* Initialise ULL and LLL headers */ @@ -560,26 +559,6 @@ uint16_t ull_sync_lll_handle_get(struct lll_sync *lll) void ull_sync_release(struct ll_sync_set *sync) { -#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) - struct lll_sync *lll = &sync->lll; - - if (lll->node_cte_incomplete) { - const uint8_t release_cnt = 1U; - struct node_rx_hdr *node_hdr; - memq_link_t *link; - - node_hdr = &lll->node_cte_incomplete->hdr; - link = node_hdr->link; - - ll_rx_link_release(link); - ull_iq_report_link_inc_quota(release_cnt); - ull_df_iq_report_mem_release(node_hdr); - ull_df_rx_iq_report_alloc(release_cnt); - - lll->node_cte_incomplete = NULL; - } -#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - /* Mark the sync context as sync create cancelled */ if (IS_ENABLED(CONFIG_BT_CTLR_CHECK_SAME_PEER_SYNC)) { sync->timeout = 0U; @@ -743,10 +722,6 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux, lll->window_size_event_us = OFFS_UNIT_30_US; } -#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) - lll->node_cte_incomplete = NULL; -#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - /* Set the state to sync create */ scan->periodic.state = LL_SYNC_STATE_CREATED; if (IS_ENABLED(CONFIG_BT_CTLR_PHY_CODED)) { From 74a8b7ddeae0444bf73f10007c707ea5b373d178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 242/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix prepare pipeline preempt timeout stop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 07865533901e8c0ccc9d2ebf5eab0f86342a3e60. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index 57a4d0226dc..7cb2679194a 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -738,13 +738,10 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, #if !defined(CONFIG_BT_CTLR_LOW_LAT) uint32_t ret; - /* NOTE: preempt timeout started prior for the current event that has - * its prepare that is now invoked is not explicitly stopped here. - * If there is a next prepare event in pipeline, then the prior - * preempt timeout if started will be stopped before starting - * the new preempt timeout. Refer to implementation in - * preempt_ticker_start(). - */ + /* Stop any scheduled preempt ticker */ + ret = preempt_ticker_stop(); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); /* Find next prepare needing preempt timeout to be setup */ do { From 67793bfe14189882c542a4afb4d7936d91333573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 243/501] Revert "[nrf fromtree] Bluetooth: Controller: Add abort fairness in overlapping Periodic Sync" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6c8a3133bfa34765370fa84f65bb8f594885acd0. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/ll_sw/lll_sync.h | 9 --- .../controller/ll_sw/nordic/lll/lll_sync.c | 67 +++---------------- subsys/bluetooth/controller/ll_sw/ull_sync.c | 18 ----- 3 files changed, 10 insertions(+), 84 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/lll_sync.h b/subsys/bluetooth/controller/ll_sw/lll_sync.h index 20ca0781d6d..4ad8832a90a 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_sync.h +++ b/subsys/bluetooth/controller/ll_sw/lll_sync.h @@ -32,14 +32,6 @@ struct lll_sync { uint8_t sca:3; #endif /* CONFIG_BT_CTLR_SYNC_ISO */ -#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) - /* Counter used by LLL abort of event when in unreserved time space to - * provide near fair scheduling of overlapping multiple Periodic - * Sync sets. - */ - uint8_t abort_count; -#endif /* CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ - uint16_t skip_prepare; uint16_t skip_event; uint16_t event_counter; @@ -74,4 +66,3 @@ void lll_sync_prepare(void *param); enum sync_status lll_sync_cte_is_allowed(uint8_t cte_type_mask, uint8_t filter_policy, uint8_t rx_cte_time, uint8_t rx_cte_type); extern uint16_t ull_sync_lll_handle_get(struct lll_sync *lll); -extern struct lll_sync *ull_sync_lll_is_valid_get(struct lll_sync *lll); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index f1e43088e18..dcae61c8a5f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -467,60 +467,21 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) /* Different radio event overlap */ if (next != curr) { - struct lll_scan_aux *lll_aux; struct lll_scan *lll; lll = ull_scan_lll_is_valid_get(next); - if (lll) { - /* Do not abort current periodic sync event as next - * event is a scan event. - */ - return 0; - } - - lll_aux = ull_scan_aux_lll_is_valid_get(next); - if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX) && - lll_aux) { - /* Do not abort current periodic sync event as next - * event is a scan aux event. - */ - return 0; - } - -#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) - struct lll_sync *lll_sync_next; - struct lll_sync *lll_sync_curr; - - lll_sync_next = ull_sync_lll_is_valid_get(next); - if (!lll_sync_next) { - /* Abort current event as next event is not a - * scan and not a scan aux event. - */ - return -ECANCELED; - } - - lll_sync_curr = curr; - if (lll_sync_curr->abort_count < lll_sync_next->abort_count) { - if (lll_sync_curr->abort_count < UINT8_MAX) { - lll_sync_curr->abort_count++; + if (!lll) { + struct lll_scan_aux *lll_aux; + + lll_aux = ull_scan_aux_lll_is_valid_get(next); + if (IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX) || + !lll_aux) { + /* Abort current event as next event is not a + * scan and not a scan aux event. + */ + return -ECANCELED; } - - /* Abort current event as next event has higher abort - * count. - */ - return -ECANCELED; - } - - if (lll_sync_next->abort_count < UINT8_MAX) { - lll_sync_next->abort_count++; } - -#else /* !CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ - /* Abort current event as next event is not a - * scan and not a scan aux event. - */ - return -ECANCELED; -#endif /* !CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ } /* Do not abort if current periodic sync event overlaps next interval @@ -1051,14 +1012,6 @@ static void isr_rx_done_cleanup(struct lll_sync *lll, uint8_t crc_ok, bool sync_ /* Reset window widening, as anchor point sync-ed */ lll->window_widening_event_us = 0U; lll->window_size_event_us = 0U; - -#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) - /* Reset LLL abort count as LLL event is gracefully done and - * was not aborted by any other event when current event could - * have been using unreserved time space. - */ - lll->abort_count = 0U; -#endif /* CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ } lll_isr_cleanup(lll); diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c index e64754cd43b..98197db94a1 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c @@ -253,11 +253,6 @@ uint8_t ll_sync_create(uint8_t options, uint8_t sid, uint8_t adv_addr_type, ull_hdr_init(&sync->ull); lll_hdr_init(lll_sync, sync); -#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) - /* Initialise LLL abort count */ - lll_sync->abort_count = 0U; -#endif /* CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ - /* Enable scanner to create sync */ scan->periodic.sync = sync; @@ -534,19 +529,6 @@ struct ll_sync_set *ull_sync_is_valid_get(struct ll_sync_set *sync) return sync; } -struct lll_sync *ull_sync_lll_is_valid_get(struct lll_sync *lll) -{ - struct ll_sync_set *sync; - - sync = HDR_LLL2ULL(lll); - sync = ull_sync_is_valid_get(sync); - if (sync) { - return &sync->lll; - } - - return NULL; -} - uint16_t ull_sync_handle_get(struct ll_sync_set *sync) { return mem_index_get(sync, ll_sync_pool, sizeof(struct ll_sync_set)); From 4c199602c1fd5ac70e1e327302616193a611f3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 244/501] Revert "[nrf fromtree] Bluetooth: Controller: Add Kconfig for minimal time reservation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 39f93083f440033af7ace9761e1670e39d6278f3. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/Kconfig.ll_sw_split | 11 ----------- subsys/bluetooth/controller/ll_sw/pdu.h | 8 -------- subsys/bluetooth/controller/ll_sw/ull_scan_aux.c | 3 +-- subsys/bluetooth/controller/ll_sw/ull_sync.c | 3 +-- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 71094bab9e7..9e4cde446e3 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -287,17 +287,6 @@ config BT_CTRL_ADV_ADI_IN_SCAN_RSP help Enable ADI field in AUX_SCAN_RSP PDU -config BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN - bool "Use minimal Scan Auxiliary and Periodic Sync PDU time reservation" - depends on (BT_OBSERVER && BT_CTLR_ADV_EXT) || BT_CTLR_SYNC_PERIODIC - default y - help - Use minimal time reservation for Auxiliary and Periodic Sync PDU - reception. A peer device could scheduling multiple advertising sets - in a short duration with small PDUs hence using the minimal time - reservation would avoid skipping closely scheduled reception of - multiple Auxiliary or Periodic Sync PDUs. - config BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX bool "Skip Periodic Sync event on overlap with Extended Scan Event" depends on BT_CTLR_SYNC_PERIODIC diff --git a/subsys/bluetooth/controller/ll_sw/pdu.h b/subsys/bluetooth/controller/ll_sw/pdu.h index b1e02538105..f3f5dfc82c9 100644 --- a/subsys/bluetooth/controller/ll_sw/pdu.h +++ b/subsys/bluetooth/controller/ll_sw/pdu.h @@ -41,14 +41,6 @@ /* Advertisement channel maximum payload size */ #if defined(CONFIG_BT_CTLR_ADV_EXT) - -/* Extended Scan and Periodic Sync Rx PDU time reservation */ -#if defined(CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN) -#define PDU_AC_EXT_PAYLOAD_RX_SIZE 0U -#else /* !CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ -#define PDU_AC_EXT_PAYLOAD_RX_SIZE PDU_AC_EXT_PAYLOAD_SIZE_MAX -#endif /* !CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN */ - #define PDU_AC_EXT_HEADER_SIZE_MIN offsetof(struct pdu_adv_com_ext_adv, \ ext_hdr_adv_data) #define PDU_AC_EXT_HEADER_SIZE_MAX 63 diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index 454953bf5e0..df8d868c15b 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -654,8 +654,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx) aux->ull.ticks_slot = HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_START_US + ready_delay_us + - PDU_AC_MAX_US(PDU_AC_EXT_PAYLOAD_RX_SIZE, - lll_aux->phy) + + PDU_AC_MAX_US(0U, lll_aux->phy) + EVENT_OVERHEAD_END_US); ticks_slot_offset = MAX(aux->ull.ticks_active_to_start, diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c index 98197db94a1..8304c47baaa 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c @@ -761,8 +761,7 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux, sync->ull.ticks_slot = HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_START_US + ready_delay_us + - PDU_AC_MAX_US(PDU_AC_EXT_PAYLOAD_RX_SIZE, - lll->phy) + + PDU_AC_MAX_US(0U, lll->phy) + EVENT_OVERHEAD_END_US); ticks_slot_offset = MAX(sync->ull.ticks_active_to_start, From 15555555d97672ac8baafc34a9b6d9d8f22b0a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 245/501] Revert "[nrf fromtree] Bluetooth: Controller: Kconfig to permit periodic sync event skip" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ef8ee3d87c2b5e6504c1c752bc61cb5ce9956251. Signed-off-by: Andrzej Głąbek --- .../bluetooth/controller/Kconfig.ll_sw_split | 21 ------------------- .../controller/ll_sw/nordic/lll/lll_sync.c | 3 +-- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 9e4cde446e3..631ca84908e 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -287,27 +287,6 @@ config BT_CTRL_ADV_ADI_IN_SCAN_RSP help Enable ADI field in AUX_SCAN_RSP PDU -config BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX - bool "Skip Periodic Sync event on overlap with Extended Scan Event" - depends on BT_CTLR_SYNC_PERIODIC - help - When AUX_ADV_IND or AUX_CHAIN_IND auxiliary channel PDU scan radio - event overlaps Periodic Sync radio event in unreserved time space, - let the Periodic Sync radio event be aborted so that the auxiliary - channel PDU can be received to generate Extended Advertising Reports. - - By default we want Periodic Advertising Sync Events to take priority - over any overlapping Extended Advertising Primary and Auxiliary - channel PDU reception in order to not skip Periodic Advertising Report - generation. - - But under simultaneous multiple Periodic Advertising Sync support with - small Periodic Advertising Intervals where there will be a lot of - overlapping Periodic Advertising Sync events, it is desirable to - permit Extended Advertising auxiliary PDU reception be allowed in a - round robin scheduling to skip the overlapping Periodic Advertising - Sync event. This permits new Periodic Advertising peers be discovered. - config BT_CTLR_SCAN_AUX_SET int "LE Extended Scanning Auxiliary Sets" depends on BT_OBSERVER && BT_CTLR_ADV_EXT diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index dcae61c8a5f..3fffd128013 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -474,8 +474,7 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) struct lll_scan_aux *lll_aux; lll_aux = ull_scan_aux_lll_is_valid_get(next); - if (IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX) || - !lll_aux) { + if (!lll_aux) { /* Abort current event as next event is not a * scan and not a scan aux event. */ From 66e8a917c2796b7aaabc6058dc3442bedfef560f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 246/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix uninitialized adv mode in scan rsp PDU" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 901964ebc29f847b0401f0630f08b5d9082067b0. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/ll_sw/ull_adv_aux.c | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index 7902bdecf5f..a57467d8c7a 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -1204,7 +1204,6 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, sr_pdu->chan_sel = 0U; sr_pdu->rx_addr = 0U; if (sr_pdu->len) { - sr_pdu->adv_ext_ind.adv_mode = 0U; sr_pdu->tx_addr = sec_pdu_prev->tx_addr; (void)memcpy(&sr_pdu->adv_ext_ind.ext_hdr.data[ADVA_OFFSET], &sec_pdu_prev->adv_ext_ind.ext_hdr.data[ADVA_OFFSET], From a153fcf43aba690a336edcfbf1a071042c7d8ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 247/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix regression in overlapping 1M and Coded Scan" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4c6f6645c891fd78ffddcc4154fa237d9384c278. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/ll_sw/ull_scan.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan.c b/subsys/bluetooth/controller/ll_sw/ull_scan.c index 99648f60797..b656e25d4cd 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan.c @@ -445,25 +445,19 @@ uint8_t ull_scan_enable(struct ll_scan_set *scan) (lll->ticks_window != 0U)) { const struct lll_scan *lll_coded; uint32_t ticks_interval_coded; - uint32_t ticks_window_sum_min; - uint32_t ticks_window_sum_max; lll_coded = &scan_coded->lll; ticks_interval_coded = HAL_TICKER_US_TO_TICKS( (uint64_t)lll_coded->interval * SCAN_INT_UNIT_US); - ticks_window_sum_min = lll->ticks_window + - lll_coded->ticks_window; - ticks_window_sum_max = ticks_window_sum_min + - HAL_TICKER_US_TO_TICKS(EVENT_TICKER_RES_MARGIN_US << 1); /* Check if 1M and Coded PHY scanning use same interval * and the sum of the scan window duration equals their * interval then use continuous scanning and avoid time * reservation from overlapping. */ if ((ticks_interval == ticks_interval_coded) && - IN_RANGE(ticks_interval, ticks_window_sum_min, - ticks_window_sum_max)) { + (ticks_interval == (lll->ticks_window + + lll_coded->ticks_window))) { if (IS_ENABLED(CONFIG_BT_CTLR_SCAN_UNRESERVED)) { scan->ull.ticks_slot = 0U; } else { @@ -496,8 +490,6 @@ uint8_t ull_scan_enable(struct ll_scan_set *scan) scan_1m = ull_scan_set_get(SCAN_HANDLE_1M); if (IS_PHY_ENABLED(scan_1m, PHY_1M) && (lll->ticks_window != 0U)) { - uint32_t ticks_window_sum_min; - uint32_t ticks_window_sum_max; uint32_t ticks_interval_1m; struct lll_scan *lll_1m; @@ -505,18 +497,14 @@ uint8_t ull_scan_enable(struct ll_scan_set *scan) ticks_interval_1m = HAL_TICKER_US_TO_TICKS( (uint64_t)lll_1m->interval * SCAN_INT_UNIT_US); - ticks_window_sum_min = lll->ticks_window + - lll_1m->ticks_window; - ticks_window_sum_max = ticks_window_sum_min + - HAL_TICKER_US_TO_TICKS(EVENT_TICKER_RES_MARGIN_US << 1); /* Check if 1M and Coded PHY scanning use same interval * and the sum of the scan window duration equals their * interval then use continuous scanning and avoid time * reservation from overlapping. */ if ((ticks_interval == ticks_interval_1m) && - IN_RANGE(ticks_interval, ticks_window_sum_min, - ticks_window_sum_max)) { + (ticks_interval == (lll->ticks_window + + lll_1m->ticks_window))) { if (IS_ENABLED(CONFIG_BT_CTLR_SCAN_UNRESERVED)) { scan->ull.ticks_slot = 0U; } else { From e8f792294be5084f6cb764c81590e62ab6904cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 248/501] Revert "[nrf fromtree] tests: Bluetooth: bsim: Verify multiple broadcaster and chain PDU" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b1066c83ee14eddf7c1db73361e9832419de7daf. Signed-off-by: Andrzej Głąbek --- .../bsim_test_adv_chain/CMakeLists.txt | 24 -- .../bsim_bt/bsim_test_adv_chain/prj.conf | 36 --- .../bsim_bt/bsim_test_adv_chain/src/main.c | 208 ------------------ .../tests_scripts/adv_chain.sh | 39 ---- tests/bluetooth/bsim_bt/compile.sh | 1 - 5 files changed, 308 deletions(-) delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_adv_chain/CMakeLists.txt delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_adv_chain/src/main.c delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_adv_chain/tests_scripts/adv_chain.sh diff --git a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/CMakeLists.txt b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/CMakeLists.txt deleted file mode 100644 index d1478d5406e..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) - -if (NOT DEFINED ENV{BSIM_COMPONENTS_PATH}) - message(FATAL_ERROR "This test requires the BabbleSim simulator. Please set \ - the environment variable BSIM_COMPONENTS_PATH to point to its \ - components folder. More information can be found in \ - https://babblesim.github.io/folder_structure_and_env.html") -endif() - -find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) -project(bsim_test_adv_chain) - -target_sources(app PRIVATE - src/main.c - ${ZEPHYR_BASE}/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c - ${ZEPHYR_BASE}/samples/bluetooth/observer/src/observer.c -) - -zephyr_include_directories( - $ENV{BSIM_COMPONENTS_PATH}/libUtilv1/src/ - $ENV{BSIM_COMPONENTS_PATH}/libPhyComv1/src/ -) diff --git a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf deleted file mode 100644 index 2566981c94c..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf +++ /dev/null @@ -1,36 +0,0 @@ -CONFIG_BT=y -CONFIG_BT_BROADCASTER=y -CONFIG_BT_OBSERVER=y -CONFIG_BT_EXT_ADV=y -CONFIG_BT_EXT_ADV_MAX_ADV_SET=2 -CONFIG_BT_DEVICE_NAME="Broadcaster Multiple" - -# Zephyr Bluetooth LE Controller will need to use chain PDUs when AD data -# length > 191 bytes -# - 31 bytes will use 22 bytes for the default name in this sample plus 9 bytes -# for manufacturer data -# - 191 bytes will use 22 bytes for the default name in this sample plus 169 -# bytes for manufacturer data -# - 277 bytes will use 22 bytes for the default name in this sample plus 255 -# bytes for manufacturer data -CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=1650 - -# Increase Advertising PDU buffers to number of advertising sets times the -# number of chain PDUs per advertising set when using Zephyr Bluetooth LE -# Controller -CONFIG_BT_CTLR_ADVANCED_FEATURES=y -CONFIG_BT_CTLR_ADV_DATA_BUF_MAX=2 - -# Maximum Extended Scanning buffer size -CONFIG_BT_EXT_SCAN_BUF_SIZE=1650 - -# Set maximum scan data length for Extended Scanning in Bluetooth LE Controller -CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=1650 - -# Zephyr Bluetooth LE Controller needs 16 event buffers to generate Extended -# Advertising Report for receiving the complete 1650 bytes of data -CONFIG_BT_BUF_EVT_RX_COUNT=16 - -# Increase Zephyr Bluetooth LE Controller Rx buffer to receive complete chain -# of PDUs -CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/src/main.c b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/src/main.c deleted file mode 100644 index 37ff8c29269..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/src/main.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -#include - -#include -#include - -#include -#include - -#include "bs_types.h" -#include "bs_tracing.h" -#include "time_machine.h" -#include "bstests.h" - -#define FAIL(...) \ - do { \ - bst_result = Failed; \ - bs_trace_error_time_line(__VA_ARGS__); \ - } while (0) - -#define PASS(...) \ - do { \ - bst_result = Passed; \ - bs_trace_info_time(1, __VA_ARGS__); \ - } while (0) - -#define NAME_LEN 30 -#define BT_AD_DATA_NAME_SIZE (sizeof(CONFIG_BT_DEVICE_NAME) - 1U + 2U) -#define BT_AD_DATA_MFG_DATA_SIZE (254U + 2U) -#define DATA_LEN MIN((BT_AD_DATA_NAME_SIZE + \ - BT_AD_DATA_MFG_DATA_SIZE), \ - CONFIG_BT_CTLR_ADV_DATA_LEN_MAX) - -static K_SEM_DEFINE(sem_recv, 0, 1); - -extern enum bst_result_t bst_result; - -static void test_adv_main(void) -{ - extern int broadcaster_multiple(void); - int err; - - err = broadcaster_multiple(); - if (err) { - FAIL("Adv tests failed\n"); - bs_trace_silent_exit(err); - return; - } - - /* Successfully started advertising multiple sets */ - PASS("Adv tests passed\n"); - - /* Let the scanner receive the reports */ - k_sleep(K_SECONDS(10)); -} - -static bool data_cb(struct bt_data *data, void *user_data) -{ - char *name = user_data; - uint8_t len; - - switch (data->type) { - case BT_DATA_NAME_SHORTENED: - case BT_DATA_NAME_COMPLETE: - len = MIN(data->data_len, NAME_LEN - 1); - (void)memcpy(name, data->data, len); - name[len] = '\0'; - return false; - default: - return true; - } -} - -static void scan_recv(const struct bt_le_scan_recv_info *info, - struct net_buf_simple *buf) -{ - static uint8_t sid[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; - static uint8_t sid_count; - char name[NAME_LEN]; - uint8_t data_status; - uint16_t data_len; - - data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(info->adv_props); - if (data_status) { - return; - } - - data_len = buf->len; - if (data_len != DATA_LEN) { - return; - } - - (void)memset(name, 0, sizeof(name)); - bt_data_parse(buf, data_cb, name); - - if (strcmp(name, CONFIG_BT_DEVICE_NAME)) { - return; - } - - for (uint8_t i = 0; i < sid_count; i++) { - if (sid[i] == info->sid) { - return; - } - } - - sid[sid_count++] = info->sid; - - if (sid_count < CONFIG_BT_EXT_ADV_MAX_ADV_SET) { - return; - } - - k_sem_give(&sem_recv); -} - -static struct bt_le_scan_cb scan_callbacks = { - .recv = scan_recv, -}; - -static void test_scan_main(void) -{ - extern int observer_start(void); - int err; - - err = bt_enable(NULL); - if (err) { - FAIL("Bluetooth init failed\n"); - - bs_trace_silent_exit(err); - return; - } - - bt_le_scan_cb_register(&scan_callbacks); - - err = observer_start(); - if (err) { - FAIL("Observer start failed\n"); - - bs_trace_silent_exit(err); - return; - } - - /* Let the recv callback verify the reports */ - k_sleep(K_SECONDS(10)); - - err = k_sem_take(&sem_recv, K_NO_WAIT); - if (err) { - FAIL("Scan receive failed\n"); - - bs_trace_silent_exit(err); - return; - } - - PASS("Scan tests passed\n"); - - bs_trace_silent_exit(0); -} - -static void test_adv_chain_init(void) -{ - bst_ticker_set_next_tick_absolute(60e6); - bst_result = In_progress; -} - -static void test_adv_chain_tick(bs_time_t HW_device_time) -{ - bst_result = Failed; - bs_trace_error_line("Test GATT Write finished.\n"); -} - -static const struct bst_test_instance test_def[] = { - { - .test_id = "adv", - .test_descr = "Central GATT Write", - .test_post_init_f = test_adv_chain_init, - .test_tick_f = test_adv_chain_tick, - .test_main_f = test_adv_main - }, - { - .test_id = "scan", - .test_descr = "Peripheral GATT Write", - .test_post_init_f = test_adv_chain_init, - .test_tick_f = test_adv_chain_tick, - .test_main_f = test_scan_main - }, - BSTEST_END_MARKER -}; - -struct bst_test_list *test_adv_chain_install(struct bst_test_list *tests) -{ - return bst_add_tests(tests, test_def); -} - -bst_test_install_t test_installers[] = { - test_adv_chain_install, - NULL -}; - -void main(void) -{ - bst_main(); -} diff --git a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/tests_scripts/adv_chain.sh b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/tests_scripts/adv_chain.sh deleted file mode 100755 index 2e5b56660c8..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/tests_scripts/adv_chain.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2018 Oticon A/S -# SPDX-License-Identifier: Apache-2.0 - -# Validate Extended Advertising AD Data fragment operation, PDU chaining and -# Extended Scanning of chain PDUs -simulation_id="adv_chain" -verbosity_level=2 -process_ids=""; exit_code=0 - -function Execute(){ - if [ ! -f $1 ]; then - echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\ - compile it?)\e[39m" - exit 1 - fi - timeout 10 $@ & process_ids="$process_ids $!" -} - -: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" - -#Give a default value to BOARD if it does not have one yet: -BOARD="${BOARD:-nrf52_bsim}" - -cd ${BSIM_OUT_PATH}/bin - -Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_adv_chain_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=adv - -Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_adv_chain_prj_conf\ - -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=scan - -Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ - -D=2 -sim_length=10e6 $@ - -for process_id in $process_ids; do - wait $process_id || let "exit_code=$?" -done -exit $exit_code #the last exit code != 0 diff --git a/tests/bluetooth/bsim_bt/compile.sh b/tests/bluetooth/bsim_bt/compile.sh index b7dbce09664..5ab59c5554f 100755 --- a/tests/bluetooth/bsim_bt/compile.sh +++ b/tests/bluetooth/bsim_bt/compile.sh @@ -35,7 +35,6 @@ app=tests/bluetooth/bsim_bt/bsim_test_app conf_file=prj_split_low_lat.conf \ compile app=tests/bluetooth/bsim_bt/bsim_test_multiple compile app=tests/bluetooth/bsim_bt/bsim_test_advx compile -app=tests/bluetooth/bsim_bt/bsim_test_adv_chain compile app=tests/bluetooth/bsim_bt/bsim_test_gatt compile app=tests/bluetooth/bsim_bt/bsim_test_gatt_write compile app=tests/bluetooth/bsim_bt/bsim_test_l2cap compile From 2817598eb99ff3f97894733dccd9b9c4ebf3626c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:07 +0200 Subject: [PATCH 249/501] Revert "[nrf fromtree] samples: Bluetooth: Refactor observer for bsim test reuse" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9f6434f4452fe8777813d47587be3e440d3ffbd1. Signed-off-by: Andrzej Głąbek --- samples/bluetooth/observer/CMakeLists.txt | 8 +- samples/bluetooth/observer/src/main.c | 107 ++++++++++++++++++++- samples/bluetooth/observer/src/observer.c | 112 ---------------------- 3 files changed, 106 insertions(+), 121 deletions(-) delete mode 100644 samples/bluetooth/observer/src/observer.c diff --git a/samples/bluetooth/observer/CMakeLists.txt b/samples/bluetooth/observer/CMakeLists.txt index 59d999d7052..6009ce93a53 100644 --- a/samples/bluetooth/observer/CMakeLists.txt +++ b/samples/bluetooth/observer/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(observer) -target_sources(app PRIVATE - src/main.c - src/observer.c -) +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) + +zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth) diff --git a/samples/bluetooth/observer/src/main.c b/samples/bluetooth/observer/src/main.c index 82958c9de69..10601ad55c8 100644 --- a/samples/bluetooth/observer/src/main.c +++ b/samples/bluetooth/observer/src/main.c @@ -1,19 +1,107 @@ +/* main.c - Application main entry point */ + /* - * Copyright (c) 2022 Nordic Semiconductor ASA + * Copyright (c) 2015-2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include #include +#include + #include +#include + +#define NAME_LEN 30 + +static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, + struct net_buf_simple *ad) +{ + char addr_str[BT_ADDR_LE_STR_LEN]; + + bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); + printk("Device found: %s (RSSI %d), type %u, AD data len %u\n", + addr_str, rssi, type, ad->len); +} + +#if defined(CONFIG_BT_EXT_ADV) +static bool data_cb(struct bt_data *data, void *user_data) +{ + char *name = user_data; + uint8_t len; + + switch (data->type) { + case BT_DATA_NAME_SHORTENED: + case BT_DATA_NAME_COMPLETE: + len = MIN(data->data_len, NAME_LEN - 1); + (void)memcpy(name, data->data, len); + name[len] = '\0'; + return false; + default: + return true; + } +} + +static const char *phy2str(uint8_t phy) +{ + switch (phy) { + case BT_GAP_LE_PHY_NONE: return "No packets"; + case BT_GAP_LE_PHY_1M: return "LE 1M"; + case BT_GAP_LE_PHY_2M: return "LE 2M"; + case BT_GAP_LE_PHY_CODED: return "LE Coded"; + default: return "Unknown"; + } +} + +static void scan_recv(const struct bt_le_scan_recv_info *info, + struct net_buf_simple *buf) +{ + char le_addr[BT_ADDR_LE_STR_LEN]; + char name[NAME_LEN]; + uint8_t data_status; + uint16_t data_len; + + (void)memset(name, 0, sizeof(name)); + + data_len = buf->len; + bt_data_parse(buf, data_cb, name); -int observer_start(void); + data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(info->adv_props); + + bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); + printk("[DEVICE]: %s, AD evt type %u, Tx Pwr: %i, RSSI %i " + "Data status: %u, AD data len: %u Name: %s " + "C:%u S:%u D:%u SR:%u E:%u Pri PHY: %s, Sec PHY: %s, " + "Interval: 0x%04x (%u ms), SID: %u\n", + le_addr, info->adv_type, info->tx_power, info->rssi, + data_status, data_len, name, + (info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_SCANNABLE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_DIRECTED) != 0, + (info->adv_props & BT_GAP_ADV_PROP_SCAN_RESPONSE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0, + phy2str(info->primary_phy), phy2str(info->secondary_phy), + info->interval, info->interval * 5 / 4, info->sid); +} + +static struct bt_le_scan_cb scan_callbacks = { + .recv = scan_recv, +}; +#endif /* CONFIG_BT_EXT_ADV */ void main(void) { + struct bt_le_scan_param scan_param = { + .type = BT_LE_SCAN_TYPE_PASSIVE, + .options = BT_LE_SCAN_OPT_FILTER_DUPLICATE, + .interval = BT_GAP_SCAN_FAST_INTERVAL, + .window = BT_GAP_SCAN_FAST_WINDOW, + }; int err; - printk("Starting Observer Demo\n"); + printk("Starting Observer\n"); /* Initialize the Bluetooth Subsystem */ err = bt_enable(NULL); @@ -21,8 +109,17 @@ void main(void) printk("Bluetooth init failed (err %d)\n", err); return; } + printk("Bluetooth initialized\n"); - (void)observer_start(); +#if defined(CONFIG_BT_EXT_ADV) + bt_le_scan_cb_register(&scan_callbacks); + printk("Registered scan callbacks\n"); +#endif /* CONFIG_BT_EXT_ADV */ - printk("Exiting %s thread.\n", __func__); + err = bt_le_scan_start(&scan_param, device_found); + if (err) { + printk("Start scanning failed (err %d)\n", err); + return; + } + printk("Scanning started, exiting %s thread.\n", __func__); } diff --git a/samples/bluetooth/observer/src/observer.c b/samples/bluetooth/observer/src/observer.c deleted file mode 100644 index 12a6c5781b3..00000000000 --- a/samples/bluetooth/observer/src/observer.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * Copyright (c) 2015-2016 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -#define NAME_LEN 30 - -static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, - struct net_buf_simple *ad) -{ - char addr_str[BT_ADDR_LE_STR_LEN]; - - bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); - printk("Device found: %s (RSSI %d), type %u, AD data len %u\n", - addr_str, rssi, type, ad->len); -} - -#if defined(CONFIG_BT_EXT_ADV) -static bool data_cb(struct bt_data *data, void *user_data) -{ - char *name = user_data; - uint8_t len; - - switch (data->type) { - case BT_DATA_NAME_SHORTENED: - case BT_DATA_NAME_COMPLETE: - len = MIN(data->data_len, NAME_LEN - 1); - (void)memcpy(name, data->data, len); - name[len] = '\0'; - return false; - default: - return true; - } -} - -static const char *phy2str(uint8_t phy) -{ - switch (phy) { - case BT_GAP_LE_PHY_NONE: return "No packets"; - case BT_GAP_LE_PHY_1M: return "LE 1M"; - case BT_GAP_LE_PHY_2M: return "LE 2M"; - case BT_GAP_LE_PHY_CODED: return "LE Coded"; - default: return "Unknown"; - } -} - -static void scan_recv(const struct bt_le_scan_recv_info *info, - struct net_buf_simple *buf) -{ - char le_addr[BT_ADDR_LE_STR_LEN]; - char name[NAME_LEN]; - uint8_t data_status; - uint16_t data_len; - - (void)memset(name, 0, sizeof(name)); - - data_len = buf->len; - bt_data_parse(buf, data_cb, name); - - data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(info->adv_props); - - bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); - printk("[DEVICE]: %s, AD evt type %u, Tx Pwr: %i, RSSI %i " - "Data status: %u, AD data len: %u Name: %s " - "C:%u S:%u D:%u SR:%u E:%u Pri PHY: %s, Sec PHY: %s, " - "Interval: 0x%04x (%u ms), SID: %u\n", - le_addr, info->adv_type, info->tx_power, info->rssi, - data_status, data_len, name, - (info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_SCANNABLE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_DIRECTED) != 0, - (info->adv_props & BT_GAP_ADV_PROP_SCAN_RESPONSE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0, - phy2str(info->primary_phy), phy2str(info->secondary_phy), - info->interval, info->interval * 5 / 4, info->sid); -} - -static struct bt_le_scan_cb scan_callbacks = { - .recv = scan_recv, -}; -#endif /* CONFIG_BT_EXT_ADV */ - -int observer_start(void) -{ - struct bt_le_scan_param scan_param = { - .type = BT_LE_SCAN_TYPE_PASSIVE, - .options = BT_LE_SCAN_OPT_FILTER_DUPLICATE, - .interval = BT_GAP_SCAN_FAST_INTERVAL, - .window = BT_GAP_SCAN_FAST_WINDOW, - }; - int err; - -#if defined(CONFIG_BT_EXT_ADV) - bt_le_scan_cb_register(&scan_callbacks); - printk("Registered scan callbacks\n"); -#endif /* CONFIG_BT_EXT_ADV */ - - err = bt_le_scan_start(&scan_param, device_found); - if (err) { - printk("Start scanning failed (err %d)\n", err); - return err; - } - printk("Started scanning...\n"); - - return 0; -} From cc69d09df994cbecb03c4ac66af22d0e41df1f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 250/501] Revert "[nrf fromtree] samples: Bluetooth: Refactor broadcaster multiple for bsim test reuse" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cf85a34ab8dcb18f32b5a8bb8bc05978e6ef44d2. Signed-off-by: Andrzej Głąbek --- .../broadcaster_multiple/CMakeLists.txt | 5 +- .../src/broadcaster_multiple.c | 113 ------------------ .../bluetooth/broadcaster_multiple/src/main.c | 101 +++++++++++++++- 3 files changed, 100 insertions(+), 119 deletions(-) delete mode 100644 samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c diff --git a/samples/bluetooth/broadcaster_multiple/CMakeLists.txt b/samples/bluetooth/broadcaster_multiple/CMakeLists.txt index eb0237e0486..94ae548608b 100644 --- a/samples/bluetooth/broadcaster_multiple/CMakeLists.txt +++ b/samples/bluetooth/broadcaster_multiple/CMakeLists.txt @@ -4,7 +4,4 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(broadcaster_multiple) -target_sources(app PRIVATE - src/main.c - src/broadcaster_multiple.c -) +target_sources(app PRIVATE src/main.c) diff --git a/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c b/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c deleted file mode 100644 index 56cc210de78..00000000000 --- a/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -/* Maximum supported AD data length, use a value supported by the Controller, - * Bluetooth Core Specification define minimum of 31 bytes will be supported by - * all Controllers, can be a maximum of 1650 bytes when supported. - */ -#if defined(CONFIG_BT_CTLR_ADV_DATA_LEN_MAX) -#define BT_AD_DATA_LEN_MAX CONFIG_BT_CTLR_ADV_DATA_LEN_MAX -#else -#define BT_AD_DATA_LEN_MAX 31U -#endif - -/* Size of AD data format length field in octets */ -#define BT_AD_DATA_FORMAT_LEN_SIZE 1U - -/* Size of AD data format type field in octets */ -#define BT_AD_DATA_FORMAT_TYPE_SIZE 1U - -/* Maximum value of AD data format length field (8-bit) */ -#define BT_AD_DATA_FORMAT_LEN_MAX 255U - -/* Device name length, size minus one null character */ -#define BT_DEVICE_NAME_LEN (sizeof(CONFIG_BT_DEVICE_NAME) - 1U) - -/* Device name length in AD data format, 2 bytes for length and type overhead */ -#define BT_DEVICE_NAME_AD_DATA_LEN (BT_AD_DATA_FORMAT_LEN_SIZE + \ - BT_AD_DATA_FORMAT_TYPE_SIZE + \ - BT_DEVICE_NAME_LEN) - -/* Maximum manufacturer data length, considering ad data format overhead and - * the included device name in ad data format. - */ -#define BT_MFG_DATA_LEN_MAX (MIN((BT_AD_DATA_FORMAT_LEN_MAX - \ - BT_AD_DATA_FORMAT_TYPE_SIZE), \ - (BT_AD_DATA_LEN_MAX - \ - BT_AD_DATA_FORMAT_LEN_SIZE - \ - BT_AD_DATA_FORMAT_TYPE_SIZE))) -#define BT_MFG_DATA_LEN (MIN(BT_MFG_DATA_LEN_MAX, \ - (BT_AD_DATA_LEN_MAX - \ - BT_AD_DATA_FORMAT_LEN_SIZE - \ - BT_AD_DATA_FORMAT_TYPE_SIZE - \ - BT_DEVICE_NAME_AD_DATA_LEN))) - -static uint8_t mfg_data[BT_MFG_DATA_LEN] = { 0xFF, 0xFF, }; - -static const struct bt_data ad[] = { - BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)), -}; - -static struct bt_le_ext_adv *adv[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; - -int broadcaster_multiple(void) -{ - struct bt_le_adv_param adv_param = { - .id = BT_ID_DEFAULT, - .sid = 0U, /* Supply unique SID when creating advertising set */ - .secondary_max_skip = 0U, - .options = (BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME), - .interval_min = BT_GAP_ADV_FAST_INT_MIN_2, - .interval_max = BT_GAP_ADV_FAST_INT_MAX_2, - .peer = NULL, - }; - int err; - - /* Initialize the Bluetooth Subsystem */ - err = bt_enable(NULL); - if (err) { - printk("Bluetooth init failed (err %d)\n", err); - return err; - } - - for (int index = 0; index < CONFIG_BT_EXT_ADV_MAX_ADV_SET; index++) { - /* Use advertising set instance index as SID */ - adv_param.sid = index; - - /* Create a non-connectable non-scannable advertising set */ - err = bt_le_ext_adv_create(&adv_param, NULL, &adv[index]); - if (err) { - printk("Failed to create advertising set %d (err %d)\n", - index, err); - return err; - } - - /* Set extended advertising data */ - err = bt_le_ext_adv_set_data(adv[index], ad, ARRAY_SIZE(ad), - NULL, 0); - if (err) { - printk("Failed to set advertising data for set %d " - "(err %d)\n", index, err); - return err; - } - - /* Start extended advertising set */ - err = bt_le_ext_adv_start(adv[index], - BT_LE_EXT_ADV_START_DEFAULT); - if (err) { - printk("Failed to start extended advertising set %d " - "(err %d)\n", index, err); - return err; - } - - printk("Started Extended Advertising Set %d.\n", index); - } - - return 0; -} diff --git a/samples/bluetooth/broadcaster_multiple/src/main.c b/samples/bluetooth/broadcaster_multiple/src/main.c index e6641983083..984d8ac3aed 100644 --- a/samples/bluetooth/broadcaster_multiple/src/main.c +++ b/samples/bluetooth/broadcaster_multiple/src/main.c @@ -5,14 +5,111 @@ */ #include +#include -int broadcaster_multiple(void); +/* Maximum supported AD data length, use a value supported by the Controller, + * Bluetooth Core Specification define minimum of 31 bytes will be supported by + * all Controllers, can be a maximum of 1650 bytes when supported. + */ +#if defined(CONFIG_BT_CTLR_ADV_DATA_LEN_MAX) +#define BT_AD_DATA_LEN_MAX CONFIG_BT_CTLR_ADV_DATA_LEN_MAX +#else +#define BT_AD_DATA_LEN_MAX 31U +#endif + +/* Size of AD data format length field in octets */ +#define BT_AD_DATA_FORMAT_LEN_SIZE 1U + +/* Size of AD data format type field in octets */ +#define BT_AD_DATA_FORMAT_TYPE_SIZE 1U + +/* Maximum value of AD data format length field (8-bit) */ +#define BT_AD_DATA_FORMAT_LEN_MAX 255U + +/* Device name length, size minus one null character */ +#define BT_DEVICE_NAME_LEN (sizeof(CONFIG_BT_DEVICE_NAME) - 1U) + +/* Device name length in AD data format, 2 bytes for length and type overhead */ +#define BT_DEVICE_NAME_AD_DATA_LEN (BT_AD_DATA_FORMAT_LEN_SIZE + \ + BT_AD_DATA_FORMAT_TYPE_SIZE + \ + BT_DEVICE_NAME_LEN) + +/* Maximum manufacturer data length, considering ad data format overhead and + * the included device name in ad data format. + */ +#define BT_MFG_DATA_LEN_MAX (MIN((BT_AD_DATA_FORMAT_LEN_MAX - \ + BT_AD_DATA_FORMAT_TYPE_SIZE), \ + (BT_AD_DATA_LEN_MAX - \ + BT_AD_DATA_FORMAT_LEN_SIZE - \ + BT_AD_DATA_FORMAT_TYPE_SIZE))) +#define BT_MFG_DATA_LEN (MIN(BT_MFG_DATA_LEN_MAX, \ + (BT_AD_DATA_LEN_MAX - \ + BT_AD_DATA_FORMAT_LEN_SIZE - \ + BT_AD_DATA_FORMAT_TYPE_SIZE - \ + BT_DEVICE_NAME_AD_DATA_LEN))) + +static uint8_t mfg_data[BT_MFG_DATA_LEN] = { 0xFF, 0xFF, }; + +static const struct bt_data ad[] = { + BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)), +}; + +static struct bt_le_ext_adv *adv[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; void main(void) { + struct bt_le_adv_param adv_param = { + .id = BT_ID_DEFAULT, + .sid = 0U, /* Supply unique SID when creating advertising set */ + .secondary_max_skip = 0U, + .options = (BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME), + .interval_min = BT_GAP_ADV_FAST_INT_MIN_2, + .interval_max = BT_GAP_ADV_FAST_INT_MAX_2, + .peer = NULL, + }; + int err; + printk("Starting Multiple Broadcaster Demo\n"); - (void)broadcaster_multiple(); + /* Initialize the Bluetooth Subsystem */ + err = bt_enable(NULL); + if (err) { + printk("Bluetooth init failed (err %d)\n", err); + return; + } + + for (int index = 0; index < CONFIG_BT_EXT_ADV_MAX_ADV_SET; index++) { + /* Use advertising set instance index as SID */ + adv_param.sid = index; + + /* Create a non-connectable non-scannable advertising set */ + err = bt_le_ext_adv_create(&adv_param, NULL, &adv[index]); + if (err) { + printk("Failed to create advertising set %d (err %d)\n", + index, err); + return; + } + + /* Set extended advertising data */ + err = bt_le_ext_adv_set_data(adv[index], ad, ARRAY_SIZE(ad), + NULL, 0); + if (err) { + printk("Failed to set advertising data for set %d " + "(err %d)\n", index, err); + return; + } + + /* Start extended advertising set */ + err = bt_le_ext_adv_start(adv[index], + BT_LE_EXT_ADV_START_DEFAULT); + if (err) { + printk("Failed to start extended advertising set %d " + "(err %d)\n", index, err); + return; + } + + printk("Started Extended Advertising Set %d.\n", index); + } printk("Exiting %s thread.\n", __func__); } From 3cfe30abbf3591ef27ff6fb44a3d831ca447bd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 251/501] Revert "[nrf fromtree] samples: Bluetooth: Add Extended Scanning support to Observer sample" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b294d48ab9a10e04b9265b85e94854f5750c4778. Signed-off-by: Andrzej Głąbek --- samples/bluetooth/observer/README.rst | 18 ++--- samples/bluetooth/observer/prj_extended.conf | 17 ----- samples/bluetooth/observer/sample.yaml | 7 +- samples/bluetooth/observer/src/main.c | 80 +------------------- 4 files changed, 12 insertions(+), 110 deletions(-) delete mode 100644 samples/bluetooth/observer/prj_extended.conf diff --git a/samples/bluetooth/observer/README.rst b/samples/bluetooth/observer/README.rst index 3eb171a691a..bdec8f79d51 100644 --- a/samples/bluetooth/observer/README.rst +++ b/samples/bluetooth/observer/README.rst @@ -1,24 +1,20 @@ .. _bluetooth-observer-sample: Bluetooth: Observer -################### +########################### Overview ******** -A simple application demonstrating Bluetooth Low Energy Observer role -functionality. The application will periodically scan for devices nearby. -If any found, prints the address of the device, the RSSI value, the Advertising -type, and the Advertising data length to the console. - -If the used Bluetooth Low Energy Controller supports Extended Scanning, you may -enable `CONFIG_BT_EXT_ADV` in the project configuration file. Refer to the -project configuration file for further details. +A simple application demonstrating Bluetooth Low Energy Observer role functionality +The application will periodically scan for devices nearby. If any found, +prints the address of the device and the RSSI value to the UART terminal. Requirements ************ -* A board with Bluetooth Low Energy support +* BlueZ running on the host, or +* A board with BLE support Building and Running ******************** @@ -26,4 +22,4 @@ Building and Running This sample can be found under :zephyr_file:`samples/bluetooth/observer` in the Zephyr tree. -See :ref:`Bluetooth samples section ` for details. +See :ref:`bluetooth samples section ` for details. diff --git a/samples/bluetooth/observer/prj_extended.conf b/samples/bluetooth/observer/prj_extended.conf deleted file mode 100644 index cab86c38d14..00000000000 --- a/samples/bluetooth/observer/prj_extended.conf +++ /dev/null @@ -1,17 +0,0 @@ -CONFIG_BT=y -CONFIG_BT_OBSERVER=y - -# Enable Extended Scanning -CONFIG_BT_EXT_ADV=y -CONFIG_BT_EXT_SCAN_BUF_SIZE=1650 - -# Zephyr Bluetooth LE Controller needs 16 event buffers to generate Extended -# Advertising Report for receiving the complete 1650 bytes of data -CONFIG_BT_BUF_EVT_RX_COUNT=16 - -# Set maximum scan data length for Extended Scanning in Bluetooth LE Controller -CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=1650 - -# Increase Zephyr Bluetooth LE Controller Rx buffer to receive complete chain -# of PDUs -CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/observer/sample.yaml b/samples/bluetooth/observer/sample.yaml index 4dadb09ff89..cf0e9094e0a 100644 --- a/samples/bluetooth/observer/sample.yaml +++ b/samples/bluetooth/observer/sample.yaml @@ -3,10 +3,5 @@ sample: tests: sample.bluetooth.observer: harness: bluetooth - platform_allow: qemu_cortex_m3 qemu_x86 nrf52840dk_nrf52840 - tags: bluetooth - sample.bluetooth.observer.extended: - harness: bluetooth - extra_args: CONF_FILE="prj_extended.conf" - platform_allow: qemu_cortex_m3 qemu_x86 nrf52840dk_nrf52840 + platform_allow: qemu_cortex_m3 qemu_x86 tags: bluetooth diff --git a/samples/bluetooth/observer/src/main.c b/samples/bluetooth/observer/src/main.c index 10601ad55c8..2bcd8cb28d4 100644 --- a/samples/bluetooth/observer/src/main.c +++ b/samples/bluetooth/observer/src/main.c @@ -14,83 +14,15 @@ #include #include -#define NAME_LEN 30 - static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, struct net_buf_simple *ad) { char addr_str[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); - printk("Device found: %s (RSSI %d), type %u, AD data len %u\n", - addr_str, rssi, type, ad->len); -} - -#if defined(CONFIG_BT_EXT_ADV) -static bool data_cb(struct bt_data *data, void *user_data) -{ - char *name = user_data; - uint8_t len; - - switch (data->type) { - case BT_DATA_NAME_SHORTENED: - case BT_DATA_NAME_COMPLETE: - len = MIN(data->data_len, NAME_LEN - 1); - (void)memcpy(name, data->data, len); - name[len] = '\0'; - return false; - default: - return true; - } -} - -static const char *phy2str(uint8_t phy) -{ - switch (phy) { - case BT_GAP_LE_PHY_NONE: return "No packets"; - case BT_GAP_LE_PHY_1M: return "LE 1M"; - case BT_GAP_LE_PHY_2M: return "LE 2M"; - case BT_GAP_LE_PHY_CODED: return "LE Coded"; - default: return "Unknown"; - } + printk("Device found: %s (RSSI %d)\n", addr_str, rssi); } -static void scan_recv(const struct bt_le_scan_recv_info *info, - struct net_buf_simple *buf) -{ - char le_addr[BT_ADDR_LE_STR_LEN]; - char name[NAME_LEN]; - uint8_t data_status; - uint16_t data_len; - - (void)memset(name, 0, sizeof(name)); - - data_len = buf->len; - bt_data_parse(buf, data_cb, name); - - data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(info->adv_props); - - bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); - printk("[DEVICE]: %s, AD evt type %u, Tx Pwr: %i, RSSI %i " - "Data status: %u, AD data len: %u Name: %s " - "C:%u S:%u D:%u SR:%u E:%u Pri PHY: %s, Sec PHY: %s, " - "Interval: 0x%04x (%u ms), SID: %u\n", - le_addr, info->adv_type, info->tx_power, info->rssi, - data_status, data_len, name, - (info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_SCANNABLE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_DIRECTED) != 0, - (info->adv_props & BT_GAP_ADV_PROP_SCAN_RESPONSE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0, - phy2str(info->primary_phy), phy2str(info->secondary_phy), - info->interval, info->interval * 5 / 4, info->sid); -} - -static struct bt_le_scan_cb scan_callbacks = { - .recv = scan_recv, -}; -#endif /* CONFIG_BT_EXT_ADV */ - void main(void) { struct bt_le_scan_param scan_param = { @@ -109,17 +41,13 @@ void main(void) printk("Bluetooth init failed (err %d)\n", err); return; } - printk("Bluetooth initialized\n"); -#if defined(CONFIG_BT_EXT_ADV) - bt_le_scan_cb_register(&scan_callbacks); - printk("Registered scan callbacks\n"); -#endif /* CONFIG_BT_EXT_ADV */ + printk("Bluetooth initialized\n"); err = bt_le_scan_start(&scan_param, device_found); + printk("\n"); if (err) { - printk("Start scanning failed (err %d)\n", err); + printk("Starting scanning failed (err %d)\n", err); return; } - printk("Scanning started, exiting %s thread.\n", __func__); } From 2b00a3f90906e7c8d1cd5826fdf918399b9f2ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 252/501] Revert "[nrf fromtree] samples: Bluetooth: Multiple Broadcaster" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 55b50b851c576129fcc178e980e90ec5c3886092. Signed-off-by: Andrzej Głąbek --- .../broadcaster_multiple/CMakeLists.txt | 7 -- .../bluetooth/broadcaster_multiple/README.rst | 36 ------ .../bluetooth/broadcaster_multiple/prj.conf | 23 ---- .../broadcaster_multiple/sample.yaml | 7 -- .../bluetooth/broadcaster_multiple/src/main.c | 115 ------------------ 5 files changed, 188 deletions(-) delete mode 100644 samples/bluetooth/broadcaster_multiple/CMakeLists.txt delete mode 100644 samples/bluetooth/broadcaster_multiple/README.rst delete mode 100644 samples/bluetooth/broadcaster_multiple/prj.conf delete mode 100644 samples/bluetooth/broadcaster_multiple/sample.yaml delete mode 100644 samples/bluetooth/broadcaster_multiple/src/main.c diff --git a/samples/bluetooth/broadcaster_multiple/CMakeLists.txt b/samples/bluetooth/broadcaster_multiple/CMakeLists.txt deleted file mode 100644 index 94ae548608b..00000000000 --- a/samples/bluetooth/broadcaster_multiple/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(broadcaster_multiple) - -target_sources(app PRIVATE src/main.c) diff --git a/samples/bluetooth/broadcaster_multiple/README.rst b/samples/bluetooth/broadcaster_multiple/README.rst deleted file mode 100644 index fd0e9cf786f..00000000000 --- a/samples/bluetooth/broadcaster_multiple/README.rst +++ /dev/null @@ -1,36 +0,0 @@ -.. _bluetooth-broadcaster-multiple-sample: - -Bluetooth: Multiple Broadcaster -############################### - -Overview -******** - -A simple application demonstrating the Bluetooth Low Energy Broadcaster that -uses multiple advertising sets functionality. - -This sample advertises two non-connectable non-scannable advertising sets with -two different SID. Number of advertising sets can be increased by updating the -`CONFIG_BT_EXT_ADV_MAX_ADV_SET` value in the project configuration file. - -When building this sample combined with a Bluetooth LE Controller, the -advertising data length can be increased from the default 31 bytes by updating -the Controller's `CONFIG_BT_CTLR_ADV_DATA_LEN_MAX` value. The size of the -manufacturer data is calculated to maximize the use of supported AD data length. - -Requirements -************ - -* A board with Bluetooth Low Energy with Extended Advertising support. - -Building and Running -******************** - -This sample can be found under -:zephyr_file:`samples/bluetooth/broadcaster_multiple` in the Zephyr tree. - -To test this sample use the Observer sample with Extended Scanning enabled, -found under -:zephyr_file:`samples/bluetooth/observer` in the Zephyr tree. - -See :ref:`Bluetooth samples section ` for details. diff --git a/samples/bluetooth/broadcaster_multiple/prj.conf b/samples/bluetooth/broadcaster_multiple/prj.conf deleted file mode 100644 index efce4351c11..00000000000 --- a/samples/bluetooth/broadcaster_multiple/prj.conf +++ /dev/null @@ -1,23 +0,0 @@ -CONFIG_BT=y -CONFIG_BT_BROADCASTER=y -CONFIG_BT_EXT_ADV=y -CONFIG_BT_EXT_ADV_MAX_ADV_SET=2 -CONFIG_BT_DEVICE_NAME="Broadcaster Multiple" - -CONFIG_BT_DEBUG_LOG=y - -# Zephyr Bluetooth LE Controller will need to use chain PDUs when AD data -# length > 191 bytes -# - 31 bytes will use 22 bytes for the default name in this sample plus 9 bytes -# for manufacturer data -# - 191 bytes will use 22 bytes for the default name in this sample plus 169 -# bytes for manufacturer data -# - 277 bytes will use 22 bytes for the default name in this sample plus 255 -# bytes for manufacturer data -# CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=192 - -# Increase Advertising PDU buffers to number of advertising sets times the -# number of chain PDUs per advertising set when using Zephyr Bluetooth LE -# Controller -# CONFIG_BT_CTLR_ADVANCED_FEATURES=y -# CONFIG_BT_CTLR_ADV_DATA_BUF_MAX=2 diff --git a/samples/bluetooth/broadcaster_multiple/sample.yaml b/samples/bluetooth/broadcaster_multiple/sample.yaml deleted file mode 100644 index 16f9e007d66..00000000000 --- a/samples/bluetooth/broadcaster_multiple/sample.yaml +++ /dev/null @@ -1,7 +0,0 @@ -sample: - name: Bluetooth Multiple Extended Advertising Broadcaster -tests: - sample.bluetooth.multiple_broadcast: - harness: bluetooth - platform_allow: qemu_cortex_m3 qemu_x86 nrf51dk_nrf51422 nrf52_bsim nrf52dk_nrf52832 - tags: bluetooth diff --git a/samples/bluetooth/broadcaster_multiple/src/main.c b/samples/bluetooth/broadcaster_multiple/src/main.c deleted file mode 100644 index 984d8ac3aed..00000000000 --- a/samples/bluetooth/broadcaster_multiple/src/main.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -/* Maximum supported AD data length, use a value supported by the Controller, - * Bluetooth Core Specification define minimum of 31 bytes will be supported by - * all Controllers, can be a maximum of 1650 bytes when supported. - */ -#if defined(CONFIG_BT_CTLR_ADV_DATA_LEN_MAX) -#define BT_AD_DATA_LEN_MAX CONFIG_BT_CTLR_ADV_DATA_LEN_MAX -#else -#define BT_AD_DATA_LEN_MAX 31U -#endif - -/* Size of AD data format length field in octets */ -#define BT_AD_DATA_FORMAT_LEN_SIZE 1U - -/* Size of AD data format type field in octets */ -#define BT_AD_DATA_FORMAT_TYPE_SIZE 1U - -/* Maximum value of AD data format length field (8-bit) */ -#define BT_AD_DATA_FORMAT_LEN_MAX 255U - -/* Device name length, size minus one null character */ -#define BT_DEVICE_NAME_LEN (sizeof(CONFIG_BT_DEVICE_NAME) - 1U) - -/* Device name length in AD data format, 2 bytes for length and type overhead */ -#define BT_DEVICE_NAME_AD_DATA_LEN (BT_AD_DATA_FORMAT_LEN_SIZE + \ - BT_AD_DATA_FORMAT_TYPE_SIZE + \ - BT_DEVICE_NAME_LEN) - -/* Maximum manufacturer data length, considering ad data format overhead and - * the included device name in ad data format. - */ -#define BT_MFG_DATA_LEN_MAX (MIN((BT_AD_DATA_FORMAT_LEN_MAX - \ - BT_AD_DATA_FORMAT_TYPE_SIZE), \ - (BT_AD_DATA_LEN_MAX - \ - BT_AD_DATA_FORMAT_LEN_SIZE - \ - BT_AD_DATA_FORMAT_TYPE_SIZE))) -#define BT_MFG_DATA_LEN (MIN(BT_MFG_DATA_LEN_MAX, \ - (BT_AD_DATA_LEN_MAX - \ - BT_AD_DATA_FORMAT_LEN_SIZE - \ - BT_AD_DATA_FORMAT_TYPE_SIZE - \ - BT_DEVICE_NAME_AD_DATA_LEN))) - -static uint8_t mfg_data[BT_MFG_DATA_LEN] = { 0xFF, 0xFF, }; - -static const struct bt_data ad[] = { - BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)), -}; - -static struct bt_le_ext_adv *adv[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; - -void main(void) -{ - struct bt_le_adv_param adv_param = { - .id = BT_ID_DEFAULT, - .sid = 0U, /* Supply unique SID when creating advertising set */ - .secondary_max_skip = 0U, - .options = (BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME), - .interval_min = BT_GAP_ADV_FAST_INT_MIN_2, - .interval_max = BT_GAP_ADV_FAST_INT_MAX_2, - .peer = NULL, - }; - int err; - - printk("Starting Multiple Broadcaster Demo\n"); - - /* Initialize the Bluetooth Subsystem */ - err = bt_enable(NULL); - if (err) { - printk("Bluetooth init failed (err %d)\n", err); - return; - } - - for (int index = 0; index < CONFIG_BT_EXT_ADV_MAX_ADV_SET; index++) { - /* Use advertising set instance index as SID */ - adv_param.sid = index; - - /* Create a non-connectable non-scannable advertising set */ - err = bt_le_ext_adv_create(&adv_param, NULL, &adv[index]); - if (err) { - printk("Failed to create advertising set %d (err %d)\n", - index, err); - return; - } - - /* Set extended advertising data */ - err = bt_le_ext_adv_set_data(adv[index], ad, ARRAY_SIZE(ad), - NULL, 0); - if (err) { - printk("Failed to set advertising data for set %d " - "(err %d)\n", index, err); - return; - } - - /* Start extended advertising set */ - err = bt_le_ext_adv_start(adv[index], - BT_LE_EXT_ADV_START_DEFAULT); - if (err) { - printk("Failed to start extended advertising set %d " - "(err %d)\n", index, err); - return; - } - - printk("Started Extended Advertising Set %d.\n", index); - } - - printk("Exiting %s thread.\n", __func__); -} From e9d44c26abb17e9bdb7add3b255314c29b95b272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 253/501] Revert "[nrf fromtree] Bluetooth: Controller: Enable back-to-back PDU chaining" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1e1272d15559a33df6b8350d1b5f7a2c331d0a31. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/Kconfig.ll_sw_split | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 631ca84908e..66f297c8a06 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -207,7 +207,6 @@ config BT_CTLR_ADV_AUX_PDU_BACK2BACK bool "Back-to-back transmission of extended advertising trains" depends on BT_BROADCASTER && BT_CTLR_ADV_EXT select BT_CTLR_ADV_AUX_PDU_LINK - default y if BT_CTLR_ADV_DATA_LEN_MAX > 191 help Enables transmission of AUX_CHAIN_IND in extended advertising train by sending each AUX_CHAIN_IND one after another back-to-back. @@ -216,7 +215,6 @@ config BT_CTLR_ADV_AUX_PDU_BACK2BACK_AFS int "AUX Frame Space for back-to-back transmission of extended advertising trains" depends on BT_CTLR_ADV_AUX_PDU_BACK2BACK range 300 1000 - default 300 help Specific AUX Frame Space to be used for back-to-back transmission of extended advertising trains. Time specified in microseconds. From 632abca903c064457dbd610fd160953a51ed977c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 254/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix parent PDU's aux offset in aux ptr field" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit eed15a0fdce90dbfd7b08ff3c4d781475b895489. Signed-off-by: Andrzej Głąbek --- .../bluetooth/controller/ll_sw/ull_adv_aux.c | 28 +++++++++---------- .../bluetooth/controller/ll_sw/ull_adv_sync.c | 10 +++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index a57467d8c7a..2618bcb8113 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -408,6 +408,11 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, uint16_t sec_len; uint8_t *dptr; + /* Get reference to aux ptr in superior PDU */ + (void)memcpy(&aux_ptr, + &hdr_data[ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET], + sizeof(aux_ptr)); + /* Get reference to flags in superior PDU */ com_hdr = &pdu->adv_ext_ind; if (com_hdr->ext_hdr_len) { @@ -540,11 +545,6 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); - /* Get reference to aux ptr in superior PDU */ - (void)memcpy(&aux_ptr, - &hdr_data[ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET], - sizeof(aux_ptr)); - /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + @@ -1032,6 +1032,15 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, uint16_t sec_len; uint8_t *dptr; + /* Get reference to aux ptr in superior PDU */ + aux_ptr_offset = ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET; + if (hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADI) { + aux_ptr_offset += ULL_ADV_HDR_DATA_ADI_PTR_OFFSET + + ULL_ADV_HDR_DATA_ADI_PTR_SIZE; + } + (void)memcpy(&aux_ptr, &hdr_data[aux_ptr_offset], + sizeof(aux_ptr)); + /* Get reference to flags in superior PDU */ com_hdr = &sr_pdu->adv_ext_ind; if (com_hdr->ext_hdr_len) { @@ -1164,15 +1173,6 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); - /* Get reference to aux ptr in superior PDU */ - aux_ptr_offset = ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET; - if (hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADI) { - aux_ptr_offset += ULL_ADV_HDR_DATA_ADI_PTR_OFFSET + - ULL_ADV_HDR_DATA_ADI_PTR_SIZE; - } - (void)memcpy(&aux_ptr, &hdr_data[aux_ptr_offset], - sizeof(aux_ptr)); - /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(sr_pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c index 50f0e283031..66de0bdf350 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c @@ -473,6 +473,11 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, uint16_t ter_len; uint8_t *dptr; + /* Get reference to aux ptr in superior PDU */ + (void)memcpy(&aux_ptr, + &hdr_data[ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET], + sizeof(aux_ptr)); + /* Get reference to flags in superior PDU */ com_hdr = &pdu->adv_ext_ind; if (com_hdr->ext_hdr_len) { @@ -604,11 +609,6 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); - /* Get reference to aux ptr in superior PDU */ - (void)memcpy(&aux_ptr, - &hdr_data[ULL_ADV_HDR_DATA_AUX_PTR_PTR_OFFSET], - sizeof(aux_ptr)); - /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + From c8f40120930d54b0a6f995262da0c72f7247017a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 255/501] Revert "[nrf fromtree] Bluetooth: Controller: Use local variable for current PDU's flags" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bafe4378602c35b83b0fe6ad91506eb1837671d5. Signed-off-by: Andrzej Głąbek --- .../bluetooth/controller/ll_sw/ull_adv_aux.c | 177 ++++++++---------- .../bluetooth/controller/ll_sw/ull_adv_sync.c | 46 ++--- 2 files changed, 97 insertions(+), 126 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index 2618bcb8113..f9093b1928e 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -401,7 +401,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, struct pdu_adv_ext_hdr *hdr_chain; struct pdu_adv_aux_ptr *aux_ptr; struct pdu_adv *pdu_chain_prev; - struct pdu_adv_ext_hdr hdr; + struct pdu_adv_ext_hdr *hdr; struct pdu_adv *pdu_chain; uint8_t *dptr_chain; uint32_t offs_us; @@ -415,12 +415,8 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Get reference to flags in superior PDU */ com_hdr = &pdu->adv_ext_ind; - if (com_hdr->ext_hdr_len) { - hdr = com_hdr->ext_hdr; - } else { - *(uint8_t *)&hdr = 0U; - } - dptr = com_hdr->ext_hdr.data; + hdr = (void *)&com_hdr->ext_hdr_adv_data[0]; + dptr = (void *)hdr; /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); @@ -442,11 +438,14 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, *dptr_chain = 0U; /* ADI flag, mandatory if superior PDU has it */ - if (hdr.adi) { + if (hdr->adi) { hdr_chain->adi = 1U; } /* Proceed to next byte if any flags present */ + if (*dptr) { + dptr++; + } if (*dptr_chain) { dptr_chain++; } @@ -454,12 +453,12 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Start adding fields corresponding to flags here, if any */ /* AdvA flag */ - if (hdr.adv_addr) { + if (hdr->adv_addr) { dptr += BDADDR_SIZE; } /* TgtA flag */ - if (hdr.tgt_addr) { + if (hdr->tgt_addr) { dptr += BDADDR_SIZE; } @@ -474,11 +473,10 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, dptr_chain += sizeof(struct pdu_adv_adi); } - /* non-connectable non-scannable chain pdu */ + /* Finish Common ExtAdv Payload header */ com_hdr_chain->adv_mode = 0; - - /* Calc current chain PDU len */ - sec_len = ull_adv_aux_hdr_len_calc(com_hdr_chain, &dptr_chain); + com_hdr_chain->ext_hdr_len = + dptr_chain - &com_hdr_chain->ext_hdr_adv_data[0]; /* Prefix overflowed data to chain PDU and reduce the AD data in * in the current PDU. @@ -521,9 +519,11 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, len = ad_len_chain; } + /* PDU length so far */ + sec_len = dptr_chain - &pdu_chain->payload[0]; + /* Check AdvData overflow */ - if ((sec_len + ad_len_overflow + len) > - PDU_AC_PAYLOAD_SIZE_MAX) { + if ((sec_len + len) > PDU_AC_PAYLOAD_SIZE_MAX) { /* NOTE: latest PDU was not consumed by LLL and * as ull_adv_sync_pdu_alloc() has reverted back * the double buffer with the first PDU, and @@ -538,13 +538,12 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, return BT_HCI_ERR_PACKET_TOO_LONG; } - /* Fill the chain PDU length */ - ull_adv_aux_hdr_len_fill(com_hdr_chain, sec_len); - pdu_chain->len = sec_len + ad_len_overflow + len; - /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); + /* Fill the chain PDU length */ + pdu_chain->len = sec_len + len; + /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + @@ -1024,7 +1023,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, struct pdu_adv_ext_hdr *hdr_chain; struct pdu_adv_aux_ptr *aux_ptr; struct pdu_adv *pdu_chain_prev; - struct pdu_adv_ext_hdr hdr; + struct pdu_adv_ext_hdr *hdr; struct pdu_adv *pdu_chain; uint8_t aux_ptr_offset; uint8_t *dptr_chain; @@ -1043,12 +1042,8 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Get reference to flags in superior PDU */ com_hdr = &sr_pdu->adv_ext_ind; - if (com_hdr->ext_hdr_len) { - hdr = com_hdr->ext_hdr; - } else { - *(uint8_t *)&hdr = 0U; - } - dptr = com_hdr->ext_hdr.data; + hdr = (void *)&com_hdr->ext_hdr_adv_data[0]; + dptr = (void *)hdr; /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); @@ -1070,11 +1065,14 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, *dptr_chain = 0U; /* ADI flag, mandatory if superior PDU has it */ - if (hdr.adi) { + if (hdr->adi) { hdr_chain->adi = 1U; } /* Proceed to next byte if any flags present */ + if (*dptr) { + dptr++; + } if (*dptr_chain) { dptr_chain++; } @@ -1082,12 +1080,12 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Start adding fields corresponding to flags here, if any */ /* AdvA flag */ - if (hdr.adv_addr) { + if (hdr->adv_addr) { dptr += BDADDR_SIZE; } /* TgtA flag */ - if (hdr.tgt_addr) { + if (hdr->tgt_addr) { dptr += BDADDR_SIZE; } @@ -1102,11 +1100,10 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, dptr_chain += sizeof(struct pdu_adv_adi); } - /* non-connectable non-scannable chain pdu */ + /* Finish Common ExtAdv Payload header */ com_hdr_chain->adv_mode = 0; - - /* Calc current chain PDU len */ - sec_len = ull_adv_aux_hdr_len_calc(com_hdr_chain, &dptr_chain); + com_hdr_chain->ext_hdr_len = + dptr_chain - &com_hdr_chain->ext_hdr_adv_data[0]; /* Prefix overflowed data to chain PDU and reduce the AD data in * in the current PDU. @@ -1149,9 +1146,11 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, len = ad_len_chain; } + /* PDU length so far */ + sec_len = dptr_chain - &pdu_chain->payload[0]; + /* Check AdvData overflow */ - if ((sec_len + ad_len_overflow + len) > - PDU_AC_PAYLOAD_SIZE_MAX) { + if ((sec_len + len) > PDU_AC_PAYLOAD_SIZE_MAX) { /* NOTE: latest PDU was not consumed by LLL and * as ull_adv_sync_pdu_alloc() has reverted back * the double buffer with the first PDU, and @@ -1166,13 +1165,12 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, return BT_HCI_ERR_PACKET_TOO_LONG; } - /* Fill the chain PDU length */ - ull_adv_aux_hdr_len_fill(com_hdr_chain, sec_len); - pdu_chain->len = sec_len + ad_len_overflow + len; - /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); + /* Fill the chain PDU length */ + pdu_chain->len = sec_len + len; + /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(sr_pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + @@ -1387,8 +1385,8 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, { struct pdu_adv_com_ext_adv *pri_com_hdr, *pri_com_hdr_prev; struct pdu_adv_com_ext_adv *sec_com_hdr, *sec_com_hdr_prev; - struct pdu_adv_ext_hdr *hdr, pri_hdr, pri_hdr_prev; - struct pdu_adv_ext_hdr sec_hdr, sec_hdr_prev; + struct pdu_adv_ext_hdr *pri_hdr, pri_hdr_prev; + struct pdu_adv_ext_hdr *sec_hdr, sec_hdr_prev; struct pdu_adv *pri_pdu, *pri_pdu_prev; struct pdu_adv *sec_pdu_prev, *sec_pdu; struct pdu_adv_adi *pri_adi, *sec_adi; @@ -1430,13 +1428,13 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, } pri_com_hdr_prev = (void *)&pri_pdu_prev->adv_ext_ind; - hdr = (void *)pri_com_hdr_prev->ext_hdr_adv_data; + pri_hdr = (void *)pri_com_hdr_prev->ext_hdr_adv_data; if (pri_com_hdr_prev->ext_hdr_len) { - pri_hdr_prev = *hdr; + pri_hdr_prev = *pri_hdr; } else { *(uint8_t *)&pri_hdr_prev = 0U; } - pri_dptr_prev = hdr->data; + pri_dptr_prev = pri_hdr->data; /* Advertising data are not supported by scannable instances */ if ((sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AD_DATA) && @@ -1451,9 +1449,9 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, pri_pdu->chan_sel = 0U; pri_com_hdr = (void *)&pri_pdu->adv_ext_ind; pri_com_hdr->adv_mode = pri_com_hdr_prev->adv_mode; - hdr = (void *)pri_com_hdr->ext_hdr_adv_data; - pri_dptr = hdr->data; - *(uint8_t *)&pri_hdr = 0U; + pri_hdr = (void *)pri_com_hdr->ext_hdr_adv_data; + pri_dptr = pri_hdr->data; + *(uint8_t *)pri_hdr = 0U; /* Get the reference to aux instance */ lll_aux = lll->aux; @@ -1476,9 +1474,9 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* Get reference to previous secondary PDU data */ sec_pdu_prev = lll_adv_aux_data_peek(lll_aux); sec_com_hdr_prev = (void *)&sec_pdu_prev->adv_ext_ind; - hdr = (void *)sec_com_hdr_prev->ext_hdr_adv_data; + sec_hdr = (void *)sec_com_hdr_prev->ext_hdr_adv_data; if (!is_aux_new) { - sec_hdr_prev = *hdr; + sec_hdr_prev = *sec_hdr; } else { /* Initialize only those fields used to copy into new PDU * buffer. @@ -1486,10 +1484,9 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, sec_pdu_prev->tx_addr = 0U; sec_pdu_prev->rx_addr = 0U; sec_pdu_prev->len = PDU_AC_EXT_HEADER_SIZE_MIN; - *(uint8_t *)hdr = 0U; *(uint8_t *)&sec_hdr_prev = 0U; } - sec_dptr_prev = hdr->data; + sec_dptr_prev = sec_hdr->data; /* Get reference to new secondary PDU data buffer */ sec_pdu = lll_adv_aux_data_alloc(lll_aux, sec_idx); @@ -1502,9 +1499,9 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, sec_com_hdr = (void *)&sec_pdu->adv_ext_ind; sec_com_hdr->adv_mode = pri_com_hdr->adv_mode; - hdr = (void *)sec_com_hdr->ext_hdr_adv_data; - sec_dptr = hdr->data; - *(uint8_t *)&sec_hdr = 0U; + sec_hdr = (void *)sec_com_hdr->ext_hdr_adv_data; + sec_dptr = sec_hdr->data; + *(uint8_t *)sec_hdr = 0U; /* AdvA flag */ /* NOTE: as we will use auxiliary packet, we remove AdvA in primary @@ -1513,7 +1510,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, * set), can be copied from primary PDU (i.e. adding AD to existing set) * or can be copied from previous secondary PDU. */ - sec_hdr.adv_addr = 1; + sec_hdr->adv_addr = 1; if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADVA) { uint8_t own_addr_type = *(uint8_t *)hdr_data; @@ -1543,14 +1540,14 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, * Move from primary to secondary PDU, if present in primary PDU. */ if (pri_hdr_prev.tgt_addr) { - sec_hdr.tgt_addr = 1U; + sec_hdr->tgt_addr = 1U; sec_pdu->rx_addr = pri_pdu_prev->rx_addr; sec_dptr += BDADDR_SIZE; /* Retain the target address if present in the previous PDU */ } else if (!(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADVA) && sec_hdr_prev.tgt_addr) { - sec_hdr.tgt_addr = 1U; + sec_hdr->tgt_addr = 1U; sec_pdu->rx_addr = sec_pdu_prev->rx_addr; sec_dptr += BDADDR_SIZE; } @@ -1570,10 +1567,10 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (pri_hdr_prev.adi) { pri_dptr_prev += sizeof(struct pdu_adv_adi); } - pri_hdr.adi = 1; + pri_hdr->adi = 1; pri_dptr += sizeof(struct pdu_adv_adi); if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADI) { - sec_hdr.adi = 1U; + sec_hdr->adi = 1U; /* return the size of ADI structure */ *(uint8_t *)hdr_data = sizeof(struct pdu_adv_adi); hdr_data = (uint8_t *)hdr_data + sizeof(uint8_t); @@ -1584,7 +1581,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, hdr_data = (uint8_t *)hdr_data + sizeof(sec_dptr); sec_dptr += sizeof(struct pdu_adv_adi); } else { - sec_hdr.adi = 1; + sec_hdr->adi = 1; adi = NULL; sec_dptr += sizeof(struct pdu_adv_adi); } @@ -1596,11 +1593,11 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (pri_hdr_prev.aux_ptr) { pri_dptr_prev += sizeof(struct pdu_adv_aux_ptr); } - pri_hdr.aux_ptr = 1; + pri_hdr->aux_ptr = 1; pri_dptr += sizeof(struct pdu_adv_aux_ptr); if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AUX_PTR) { - sec_hdr.aux_ptr = 1; + sec_hdr->aux_ptr = 1; aux_ptr = NULL; /* return the size of aux pointer structure */ @@ -1614,7 +1611,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, hdr_data = (uint8_t *)hdr_data + sizeof(sec_dptr); } else if (!(sec_hdr_rem_fields & ULL_ADV_PDU_HDR_FIELD_AUX_PTR) && sec_hdr_prev.aux_ptr) { - sec_hdr.aux_ptr = 1; + sec_hdr->aux_ptr = 1; aux_ptr = (void *)sec_dptr_prev; } else { aux_ptr = NULL; @@ -1622,7 +1619,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (sec_hdr_prev.aux_ptr) { sec_dptr_prev += sizeof(struct pdu_adv_aux_ptr); } - if (sec_hdr.aux_ptr) { + if (sec_hdr->aux_ptr) { sec_dptr += sizeof(struct pdu_adv_aux_ptr); } @@ -1632,7 +1629,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* No SyncInfo flag in primary channel PDU */ /* Add/Remove SyncInfo flag in secondary channel PDU */ if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_SYNC_INFO) { - sec_hdr.sync_info = 1; + sec_hdr->sync_info = 1; sync_info = NULL; /* return the size of sync info structure */ @@ -1646,7 +1643,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, hdr_data = (uint8_t *)hdr_data + sizeof(sec_dptr); } else if (!(sec_hdr_rem_fields & ULL_ADV_PDU_HDR_FIELD_SYNC_INFO) && sec_hdr_prev.sync_info) { - sec_hdr.sync_info = 1; + sec_hdr->sync_info = 1; sync_info = (void *)sec_dptr_prev; } else { sync_info = NULL; @@ -1654,7 +1651,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (sec_hdr_prev.sync_info) { sec_dptr_prev += sizeof(*sync_info); } - if (sec_hdr.sync_info) { + if (sec_hdr->sync_info) { sec_dptr += sizeof(*sync_info); } #endif /* CONFIG_BT_CTLR_ADV_PERIODIC */ @@ -1667,18 +1664,18 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, * reserved for future use on the LE Coded PHY. */ if (lll->phy_p != PHY_CODED) { - pri_hdr.tx_pwr = 1; + pri_hdr->tx_pwr = 1; pri_dptr++; } else { - sec_hdr.tx_pwr = 1; + sec_hdr->tx_pwr = 1; } } if (sec_hdr_prev.tx_pwr) { sec_dptr_prev++; - sec_hdr.tx_pwr = 1; + sec_hdr->tx_pwr = 1; } - if (sec_hdr.tx_pwr) { + if (sec_hdr->tx_pwr) { sec_dptr++; } @@ -1687,6 +1684,10 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* Calc primary PDU len */ pri_len = ull_adv_aux_hdr_len_calc(pri_com_hdr, &pri_dptr); + ull_adv_aux_hdr_len_fill(pri_com_hdr, pri_len); + + /* set the primary PDU len */ + pri_pdu->len = pri_len; /* Calc previous secondary PDU len */ sec_len_prev = ull_adv_aux_hdr_len_calc(sec_com_hdr_prev, @@ -1701,6 +1702,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* Calc current secondary PDU len */ sec_len = ull_adv_aux_hdr_len_calc(sec_com_hdr, &sec_dptr); + ull_adv_aux_hdr_len_fill(sec_com_hdr, sec_len); /* AD Data, add or remove */ if (sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AD_DATA) { @@ -1760,12 +1762,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, return BT_HCI_ERR_PACKET_TOO_LONG; } - /* set the primary PDU len */ - ull_adv_aux_hdr_len_fill(pri_com_hdr, pri_len); - pri_pdu->len = pri_len; - /* set the secondary PDU len */ - ull_adv_aux_hdr_len_fill(sec_com_hdr, sec_len); sec_pdu->len = sec_len + ad_len; /* Start filling pri and sec PDU payload based on flags from here @@ -1785,9 +1782,9 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* TODO: Fill ACAD in secondary channel PDU */ /* Tx Power */ - if (pri_hdr.tx_pwr) { + if (pri_hdr->tx_pwr) { *--pri_dptr = *--pri_dptr_prev; - } else if (sec_hdr.tx_pwr) { + } else if (sec_hdr->tx_pwr) { *--sec_dptr = *--sec_dptr_prev; } @@ -1798,7 +1795,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, sec_dptr_prev -= sizeof(*sync_info); } - if (sec_hdr.sync_info) { + if (sec_hdr->sync_info) { sec_dptr -= sizeof(*sync_info); } @@ -1817,7 +1814,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (sec_hdr_prev.aux_ptr) { sec_dptr_prev -= sizeof(struct pdu_adv_aux_ptr); } - if (sec_hdr.aux_ptr) { + if (sec_hdr->aux_ptr) { sec_dptr -= sizeof(struct pdu_adv_aux_ptr); } @@ -1858,7 +1855,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* No TargetA non-conn non-scan advertising, but present in directed * advertising. */ - if (sec_hdr.tgt_addr) { + if (sec_hdr->tgt_addr) { void *bdaddr; if (sec_hdr_prev.tgt_addr) { @@ -1879,7 +1876,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, /* NOTE: AdvA in aux channel is also filled at enable and RPA * timeout */ - if (sec_hdr.adv_addr) { + if (sec_hdr->adv_addr) { void *bdaddr; if (sec_hdr_prev.adv_addr) { @@ -1895,20 +1892,6 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, (void)memcpy(sec_dptr, bdaddr, BDADDR_SIZE); } - /* Set the common extended header format flags in the current primary - * PDU - */ - if (pri_com_hdr->ext_hdr_len != 0) { - pri_com_hdr->ext_hdr = pri_hdr; - } - - /* Set the common extended header format flags in the current secondary - * PDU - */ - if (sec_com_hdr->ext_hdr_len != 0) { - sec_com_hdr->ext_hdr = sec_hdr; - } - #if defined(CONFIG_BT_CTLR_ADV_AUX_PDU_LINK) ull_adv_aux_chain_pdu_duplicate(sec_pdu_prev, sec_pdu, aux_ptr, adv->lll.phy_s, adv->lll.phy_flags, diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c index 66de0bdf350..20a45856bc0 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c @@ -466,7 +466,7 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, struct pdu_adv_ext_hdr *hdr_chain; struct pdu_adv_aux_ptr *aux_ptr; struct pdu_adv *pdu_chain_prev; - struct pdu_adv_ext_hdr hdr; + struct pdu_adv_ext_hdr *hdr; struct pdu_adv *pdu_chain; uint8_t *dptr_chain; uint32_t offs_us; @@ -480,12 +480,8 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, /* Get reference to flags in superior PDU */ com_hdr = &pdu->adv_ext_ind; - if (com_hdr->ext_hdr_len) { - hdr = com_hdr->ext_hdr; - } else { - *(uint8_t *)&hdr = 0U; - } - dptr = com_hdr->ext_hdr.data; + hdr = (void *)&com_hdr->ext_hdr_adv_data[0]; + dptr = (void *)hdr; /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); @@ -513,11 +509,14 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, */ /* ADI flag, mandatory if superior PDU has it */ - if (hdr.adi) { + if (hdr->adi) { hdr_chain->adi = 1U; } /* Proceed to next byte if any flags present */ + if (*dptr) { + dptr++; + } if (*dptr_chain) { dptr_chain++; } @@ -537,11 +536,10 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, dptr_chain += sizeof(struct pdu_adv_adi); } - /* non-connectable non-scannable chain pdu */ + /* Finish Common ExtAdv Payload header */ com_hdr_chain->adv_mode = 0; - - /* Calc current chain PDU len */ - ter_len = ull_adv_aux_hdr_len_calc(com_hdr_chain, &dptr_chain); + com_hdr_chain->ext_hdr_len = + dptr_chain - &com_hdr_chain->ext_hdr_adv_data[0]; /* Prefix overflowed data to chain PDU and reduce the AD data in * in the current PDU. @@ -585,30 +583,20 @@ uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, len = ad_len_chain; } - /* Check AdvData overflow */ - if ((ter_len + ad_len_overflow + len) > - PDU_AC_PAYLOAD_SIZE_MAX) { - /* NOTE: latest PDU was not consumed by LLL and - * as ull_adv_sync_pdu_alloc() has reverted back - * the double buffer with the first PDU, and - * returned the latest PDU as the new PDU, we - * need to enqueue back the new PDU which is - * infact the latest PDU. - */ - if (pdu_prev == pdu) { - lll_adv_sync_data_enqueue(lll_sync, ter_idx); - } + /* PDU length so far */ + ter_len = dptr_chain - &pdu_chain->payload[0]; + /* Check AdvData overflow */ + if ((ter_len + len) > PDU_AC_PAYLOAD_SIZE_MAX) { return BT_HCI_ERR_PACKET_TOO_LONG; } - /* Fill the chain PDU length */ - ull_adv_aux_hdr_len_fill(com_hdr_chain, ter_len); - pdu_chain->len = ter_len + ad_len_overflow + len; - /* Fill AD Data in chain PDU */ (void)memcpy(dptr_chain, data, len); + /* Fill the chain PDU length */ + pdu_chain->len = ter_len + len; + /* Fill the aux offset in the previous AUX_SYNC_IND PDU */ offs_us = PDU_AC_US(pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + From eb7469b5a321088fc5121ac07d4d7ed20961bc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 256/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix regression in adding ADI in scan rsp PDU" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1537f3086f55af2a1959b5a6d06579a688f77c88. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/ll_sw/ull_adv_aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index f9093b1928e..1e158fae09a 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -818,7 +818,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, ad_len_offset = ULL_ADV_HDR_DATA_DATA_PTR_OFFSET + ULL_ADV_HDR_DATA_DATA_PTR_SIZE; if (hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADI) { - ad_len_offset += + ad_len_offset = ULL_ADV_HDR_DATA_ADI_PTR_OFFSET + ULL_ADV_HDR_DATA_ADI_PTR_SIZE; } From a268aec6980f87fdfd8f74d00c5cd8c186beaaac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 257/501] Revert "[nrf fromtree] Bluetooth: Remove default n from common Kconfig" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b9728601003699ac9c980b55f58b14b8b28b0331. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/common/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 12018059e15..1d4e97648b7 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -224,9 +224,10 @@ config BT_HCI_VS_EVT config BT_HCI_VS_FATAL_ERROR bool "Allow vendor specific HCI event Zephyr Fatal Error" depends on BT_HCI_VS_EXT + default n help - Enable emiting HCI Vendor-Specific events for system and Controller - errors that are unrecoverable. + Enable emiting HCI Vendor-Specific events for system and Controller error that are + unrecoverable. config BT_HCI_VS_EXT_DETECT bool "Use heuristics to guess HCI vendor extensions support in advance" From defee8c13067f1e6267af081e58bf4b2c8a63bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 258/501] Revert "[nrf fromtree] Bluetooth: hci: df: Fix unnecessary IQ sample storage" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3a5096e6b3747659f93bb3395d4c898d80dc45a5. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/hci/hci.c | 133 ++++++++++---------------- 1 file changed, 52 insertions(+), 81 deletions(-) diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 86eab0a8dd6..bd11ba75577 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -2936,15 +2936,11 @@ static void le_df_connectionless_iq_report(struct pdu_data *pdu_rx, } #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ - /* If packet status does not indicate insufficient resources for IQ samples and for - * some reason sample_count is zero, inform Host about lack of valid IQ samples by - * storing single I_sample and Q_sample with BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE value. + /* If there are no IQ samples due to insufficient resources + * HCI event should inform about it by storing single octet with + * special I_sample and Q_sample data. */ - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - samples_cnt = 0U; - } else { - samples_cnt = MAX(1, iq_report->sample_count); - } + samples_cnt = MAX(1, iq_report->sample_count); sep = meta_evt(buf, BT_HCI_EVT_LE_CONNECTIONLESS_IQ_REPORT, (sizeof(*sep) + @@ -2971,21 +2967,18 @@ static void le_df_connectionless_iq_report(struct pdu_data *pdu_rx, sep->packet_status = iq_report->packet_status; - if (iq_report->packet_status != BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - if (iq_report->sample_count == 0U) { - sep->sample[0].i = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample[0].q = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = - iq_convert_12_to_8_bits(iq_report->sample[idx].i); - sep->sample[idx].q = - iq_convert_12_to_8_bits(iq_report->sample[idx].q); - } + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + sep->sample[0].i = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample[0].q = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample_count = 0U; + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = iq_convert_12_to_8_bits(iq_report->sample[idx].i); + sep->sample[idx].q = iq_convert_12_to_8_bits(iq_report->sample[idx].q); } - } - sep->sample_count = samples_cnt; + sep->sample_count = samples_cnt; + } } #endif /* defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT) */ @@ -3068,15 +3061,10 @@ static void le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct net_b return; } - /* If packet status does not indicate insufficient resources for IQ samples and for - * some reason sample_count is zero, inform Host about lack of valid IQ samples by - * storing single I_sample and Q_sample with BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE value. + /* If there are no IQ samples due to insufficient resources HCI event should inform about + * it by store single octet with special I_sample and Q_sample data. */ - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - samples_cnt = 0; - } else { - samples_cnt = MAX(1, iq_report->sample_count); - } + samples_cnt = MAX(1, iq_report->sample_count); sep = meta_evt(buf, BT_HCI_EVT_LE_CONNECTION_IQ_REPORT, (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample)))); @@ -3102,21 +3090,17 @@ static void le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct net_b sep->packet_status = iq_report->packet_status; - if (iq_report->packet_status != BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - if (iq_report->sample_count == 0U) { - sep->sample[0].i = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample[0].q = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = - iq_convert_12_to_8_bits(iq_report->sample[idx].i); - sep->sample[idx].q = - iq_convert_12_to_8_bits(iq_report->sample[idx].q); - } + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + sep->sample[0].i = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample[0].q = BT_HCI_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample_count = 0U; + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = iq_convert_12_to_8_bits(iq_report->sample[idx].i); + sep->sample[idx].q = iq_convert_12_to_8_bits(iq_report->sample[idx].q); } + sep->sample_count = samples_cnt; } - - sep->sample_count = samples_cnt; } #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */ @@ -5045,16 +5029,11 @@ static void vs_le_df_connectionless_iq_report(struct pdu_data *pdu_rx, struct no sync_handle = ull_sync_handle_get(sync); per_evt_counter = iq_report->event_counter; - /* If packet status does not indicate insufficient resources for IQ samples and for - * some reason sample_count is zero, inform Host about lack of valid IQ samples by - * storing single I_sample and Q_sample with BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE - * value. + /* If there are no IQ samples due to insufficient resources + * HCI event should inform about it by storing single octet with + * special I_sample and Q_sample data. */ - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - samples_cnt = 0U; - } else { - samples_cnt = MAX(1, iq_report->sample_count); - } + samples_cnt = MAX(1, iq_report->sample_count); sep = vs_event(buf, BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT, (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample16)))); @@ -5079,19 +5058,18 @@ static void vs_le_df_connectionless_iq_report(struct pdu_data *pdu_rx, struct no sep->packet_status = iq_report->packet_status; - if (iq_report->packet_status != BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - if (iq_report->sample_count == 0U) { - sep->sample[0].i = sys_cpu_to_le16(BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE); - sep->sample[0].q = sys_cpu_to_le16(BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE); - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); - sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); - } + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + sep->sample[0].i = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample[0].q = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample_count = 0U; + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); + sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); } - } - sep->sample_count = samples_cnt; + sep->sample_count = samples_cnt; + } } #endif /* CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ @@ -5131,15 +5109,10 @@ static void vs_le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct ne return; } - /* If packet status does not indicate insufficient resources for IQ samples and for - * some reason sample_count is zero, inform Host about lack of valid IQ samples by - * storing single I_sample and Q_sample with BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE value. + /* If there are no IQ samples due to insufficient resources HCI event should inform about + * it by store single octet with special I_sample and Q_sample data. */ - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - samples_cnt = 0U; - } else { - samples_cnt = MAX(1, iq_report->sample_count); - } + samples_cnt = MAX(1, iq_report->sample_count); sep = vs_event(buf, BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT, (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample16)))); @@ -5165,19 +5138,17 @@ static void vs_le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct ne sep->packet_status = iq_report->packet_status; - if (iq_report->packet_status != BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - if (iq_report->sample_count == 0U) { - sep->sample[0].i = sys_cpu_to_le16(BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE); - sep->sample[0].q = sys_cpu_to_le16(BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE); - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); - sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); - } + if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { + sep->sample[0].i = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample[0].q = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; + sep->sample_count = 0U; + } else { + for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { + sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); + sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); } + sep->sample_count = samples_cnt; } - - sep->sample_count = samples_cnt; } #endif /* CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ From 14c8413ac694db200be7dbe9fd2ea5fd5b540060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 259/501] Revert "[nrf fromtree] samples: Bluetooth: df: Add use of 16 bits wide IQ sampels" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f3904cec2a7afd65751690df8b6309134c8749c1. Signed-off-by: Andrzej Głąbek --- .../direction_finding_central/Kconfig | 16 ------- .../direction_finding_central/src/main.c | 42 +++---------------- .../Kconfig | 16 ------- .../src/main.c | 35 ++-------------- 4 files changed, 9 insertions(+), 100 deletions(-) delete mode 100644 samples/bluetooth/direction_finding_central/Kconfig delete mode 100644 samples/bluetooth/direction_finding_connectionless_rx/Kconfig diff --git a/samples/bluetooth/direction_finding_central/Kconfig b/samples/bluetooth/direction_finding_central/Kconfig deleted file mode 100644 index 51766a41bb0..00000000000 --- a/samples/bluetooth/direction_finding_central/Kconfig +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -menu "Direction Finding Central" -config DF_CENTRAL_APP_IQ_REPORT_PRINT_IQ_SAMPLES - bool "Print IQ samples for received IQ reports" - help - The option enables printing of IQ samples for received IQ report. -endmenu - -menu "Zephyr Kernel" -source "Kconfig.zephyr" -endmenu diff --git a/samples/bluetooth/direction_finding_central/src/main.c b/samples/bluetooth/direction_finding_central/src/main.c index d0a8dd5fd95..d57e623dd1d 100644 --- a/samples/bluetooth/direction_finding_central/src/main.c +++ b/samples/bluetooth/direction_finding_central/src/main.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -17,8 +16,7 @@ #include #include #include -#include -#include +#include /* Latency set to zero, to enforce PDU exchange every connection event */ #define CONN_LATENCY 0U @@ -57,18 +55,6 @@ static const char *cte_type2str(uint8_t type) } } -static const char *sample_type2str(enum bt_df_iq_sample type) -{ - switch (type) { - case BT_DF_IQ_SAMPLE_8_BITS_INT: - return "8 bits int"; - case BT_DF_IQ_SAMPLE_16_BITS_INT: - return "16 bits int"; - default: - return "Unknown"; - } -} - static const char *packet_status2str(uint8_t status) { switch (status) { @@ -251,27 +237,11 @@ static void cte_recv_cb(struct bt_conn *conn, struct bt_df_conn_iq_samples_repor bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); if (report->err == BT_DF_IQ_REPORT_ERR_SUCCESS) { - printk("CTE[%s]: samples type: %s, samples count %d, cte type %s, slot durations: " - "%u [us], packet status %s, RSSI %i\n", addr, - sample_type2str(report->sample_type), report->sample_count, - cte_type2str(report->cte_type), report->slot_durations, - packet_status2str(report->packet_status), report->rssi); - - if (IS_ENABLED(CONFIG_DF_CENTRAL_APP_IQ_REPORT_PRINT_IQ_SAMPLES)) { - for (uint8_t idx = 0; idx < report->sample_count; idx++) { - if (report->sample_type == BT_DF_IQ_SAMPLE_8_BITS_INT) { - printk(" IQ[%d]: %d, %d\n", idx, report->sample[idx].i, - report->sample[idx].q); - } else if (IS_ENABLED( - CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES)) { - printk(" IQ[%" PRIu8 "]: %d, %d\n", idx, - report->sample16[idx].i, report->sample16[idx].q); - } else { - printk("Unhandled vendor specific IQ samples type\n"); - break; - } - } - } + printk("CTE[%s]: samples count %d, cte type %s, slot durations: %u [us], " + "packet status %s, RSSI %i\n", + addr, report->sample_count, cte_type2str(report->cte_type), + report->slot_durations, packet_status2str(report->packet_status), + report->rssi); } else { printk("CTE[%s]: request failed, err %u\n", addr, report->err); } diff --git a/samples/bluetooth/direction_finding_connectionless_rx/Kconfig b/samples/bluetooth/direction_finding_connectionless_rx/Kconfig deleted file mode 100644 index 6045423f659..00000000000 --- a/samples/bluetooth/direction_finding_connectionless_rx/Kconfig +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -menu "DF Connectionless Locator App" -config DF_LOCATOR_APP_IQ_REPORT_PRINT_IQ_SAMPLES - bool "Print IQ samples for received IQ reports" - help - The option enables printing of IQ samples for received IQ report. -endmenu - -menu "Zephyr Kernel" -source "Kconfig.zephyr" -endmenu diff --git a/samples/bluetooth/direction_finding_connectionless_rx/src/main.c b/samples/bluetooth/direction_finding_connectionless_rx/src/main.c index 90b83f52ee3..dbc8c818c09 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/src/main.c +++ b/samples/bluetooth/direction_finding_connectionless_rx/src/main.c @@ -15,8 +15,6 @@ #include #include #include -#include -#include #define DEVICE_NAME CONFIG_BT_DEVICE_NAME #define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1) @@ -105,18 +103,6 @@ static const char *cte_type2str(uint8_t type) } } -static const char *sample_type2str(enum bt_df_iq_sample type) -{ - switch (type) { - case BT_DF_IQ_SAMPLE_8_BITS_INT: - return "8 bits int"; - case BT_DF_IQ_SAMPLE_16_BITS_INT: - return "16 bits int"; - default: - return "Unknown"; - } -} - static const char *pocket_status2str(uint8_t status) { switch (status) { @@ -197,26 +183,11 @@ static void recv_cb(struct bt_le_per_adv_sync *sync, static void cte_recv_cb(struct bt_le_per_adv_sync *sync, struct bt_df_per_adv_sync_iq_samples_report const *report) { - printk("CTE[%u]: samples type: %s, samples count %d, cte type %s, slot durations: %u [us], " + printk("CTE[%u]: samples count %d, cte type %s, slot durations: %u [us], " "packet status %s, RSSI %i\n", - bt_le_per_adv_sync_get_index(sync), sample_type2str(report->sample_type), - report->sample_count, cte_type2str(report->cte_type), report->slot_durations, + bt_le_per_adv_sync_get_index(sync), report->sample_count, + cte_type2str(report->cte_type), report->slot_durations, pocket_status2str(report->packet_status), report->rssi); - - if (IS_ENABLED(CONFIG_DF_LOCATOR_APP_IQ_REPORT_PRINT_IQ_SAMPLES)) { - for (uint8_t idx = 0; idx < report->sample_count; idx++) { - if (report->sample_type == BT_DF_IQ_SAMPLE_8_BITS_INT) { - printk(" IQ[%d]: %d, %d\n", idx, report->sample[idx].i, - report->sample[idx].q); - } else if (IS_ENABLED(CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES)) { - printk(" IQ[%" PRIu8 "]: %d, %d\n", idx, report->sample16[idx].i, - report->sample16[idx].q); - } else { - printk("Unhandled vendor specific IQ samples type\n"); - break; - } - } - } } static void scan_recv(const struct bt_le_scan_recv_info *info, From 4fa4cf722675191f737a220d874a802b03285535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 260/501] Revert "[nrf fromtree] Bluetooth: Host: Add common handling of VS IQ report" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dbcb042dd8fc7bcbe6d5b80fa78b6c94f43ce5c8. Signed-off-by: Andrzej Głąbek --- include/zephyr/bluetooth/direction.h | 31 ++----- subsys/bluetooth/host/Kconfig | 22 ----- subsys/bluetooth/host/conn.c | 32 +------ subsys/bluetooth/host/direction.c | 102 --------------------- subsys/bluetooth/host/direction_internal.h | 6 -- subsys/bluetooth/host/hci_core.c | 63 +++---------- subsys/bluetooth/host/hci_core.h | 2 - subsys/bluetooth/host/scan.c | 35 +------ 8 files changed, 25 insertions(+), 268 deletions(-) diff --git a/include/zephyr/bluetooth/direction.h b/include/zephyr/bluetooth/direction.h index 7b24f7da88a..c5cb2f1bf1e 100644 --- a/include/zephyr/bluetooth/direction.h +++ b/include/zephyr/bluetooth/direction.h @@ -101,19 +101,10 @@ struct bt_df_per_adv_sync_cte_rx_param { const uint8_t *ant_ids; }; -enum bt_df_iq_sample { - /** Reported IQ samples have 8 bits signed integer format. Size defined in BT Core 5.3 - * Vol 4, Part E sections 7.7.65.21 and 7.7.65.22. - */ - BT_DF_IQ_SAMPLE_8_BITS_INT, - /** Reported IQ samples have 16 bits signed integer format. Vendor specific extension. */ - BT_DF_IQ_SAMPLE_16_BITS_INT, -}; - struct bt_df_per_adv_sync_iq_samples_report { /** Channel index used to receive PDU with CTE that was sampled. */ uint8_t chan_idx; - /** The RSSI of the PDU with CTE (excluding CTE). Range: -1270 to +200. Units: 0.1 dBm. */ + /** The RSSI of the PDU with CTE (excluding CTE). */ int16_t rssi; /** Id of antenna used to measure the RSSI. */ uint8_t rssi_ant_id; @@ -127,13 +118,8 @@ struct bt_df_per_adv_sync_iq_samples_report { uint16_t per_evt_counter; /** Number of IQ samples in report. */ uint8_t sample_count; - /** Type of IQ samples provided in a report. */ - enum bt_df_iq_sample sample_type; - /** Pointer to IQ samples data. */ - union { - struct bt_hci_le_iq_sample const *sample; - struct bt_hci_le_iq_sample16 const *sample16; - }; + /** Pinter to IQ samples data. */ + struct bt_hci_le_iq_sample const *sample; }; struct bt_df_conn_cte_rx_param { @@ -167,7 +153,7 @@ struct bt_df_conn_iq_samples_report { uint8_t rx_phy; /** Channel index used to receive PDU with CTE that was sampled. */ uint8_t chan_idx; - /** The RSSI of the PDU with CTE (excluding CTE). Range: -1270 to +200. Units: 0.1 dBm. */ + /** The RSSI of the PDU with CTE (excluding CTE). */ int16_t rssi; /** Id of antenna used to measure the RSSI. */ uint8_t rssi_ant_id; @@ -179,15 +165,10 @@ struct bt_df_conn_iq_samples_report { uint8_t packet_status; /** Value of connection event counter when the CTE was received and sampled. */ uint16_t conn_evt_counter; - /** Type of IQ samples provided in a report. */ - enum bt_df_iq_sample sample_type; /** Number of IQ samples in report. */ uint8_t sample_count; - /** Pointer to IQ samples data. */ - union { - struct bt_hci_le_iq_sample const *sample; - struct bt_hci_le_iq_sample16 const *sample16; - }; + /** Pinter to IQ samples data. */ + struct bt_hci_le_iq_sample const *sample; }; /** Constant Tone Extension parameters for CTE transmission in connected mode. */ struct bt_df_conn_cte_tx_param { diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index eaf8a8337fb..3fb0c552a8f 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -702,28 +702,6 @@ config BT_DF_CTE_TX_AOD Enable support for antenna switching during CTE transmission. Also known as Angle of Departure mode. -config BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES - bool "Use 16 bits signed integer IQ samples in connectionless IQ reports" - depends on BT_DF_CONNECTIONLESS_CTE_RX && BT_HCI_VS_EXT - select BT_HCI_VS_EVT - help - Direction Finging connectionless IQ reports provide a set of IQ samples collected during - sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed - integer, see Vol 4, Part E section 7.7.65.21. This option enables a vendor specific Host - extenstion to handle connectionless IQ reports with samples that are in 16 bit signed - integer format. - -config BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES - bool "Use 16 bits signed integer IQ samples in connection IQ reports" - depends on BT_DF_CONNECTION_CTE_RX && BT_HCI_VS_EXT - select BT_HCI_VS_EVT - help - Direction Finging connection IQ reports provide a set of IQ samples collected during - sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed - integer, see Vol 4, Part E sections 7.7.65.22. This option enables a vendor specific Host - extenstion to handle connection IQ report with samples that are in 16 bit signed integer - format. - config BT_DEBUG_DF bool "Bluetooth Direction Finding debug" help diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 46e7f50eb58..95a0ae56153 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -3026,28 +3026,16 @@ int bt_conn_init(void) } #if defined(CONFIG_BT_DF_CONNECTION_CTE_RX) -void bt_hci_le_df_connection_iq_report_common(uint8_t event, struct net_buf *buf) +void bt_hci_le_df_connection_iq_report(struct net_buf *buf) { struct bt_df_conn_iq_samples_report iq_report; struct bt_conn *conn; struct bt_conn_cb *cb; int err; - if (event == BT_HCI_EVT_LE_CONNECTION_IQ_REPORT) { - err = hci_df_prepare_connection_iq_report(buf, &iq_report, &conn); - if (err) { - BT_ERR("Prepare CTE conn IQ report failed %d", err); - return; - } - } else if (IS_ENABLED(CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) && - event == BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT) { - err = hci_df_vs_prepare_connection_iq_report(buf, &iq_report, &conn); - if (err) { - BT_ERR("Prepare CTE conn IQ report failed %d", err); - return; - } - } else { - BT_ERR("Unhandled VS connection IQ report"); + err = hci_df_prepare_connection_iq_report(buf, &iq_report, &conn); + if (err) { + BT_ERR("Prepare CTE conn IQ report failed %d", err); return; } @@ -3066,18 +3054,6 @@ void bt_hci_le_df_connection_iq_report_common(uint8_t event, struct net_buf *buf bt_conn_unref(conn); } - -void bt_hci_le_df_connection_iq_report(struct net_buf *buf) -{ - bt_hci_le_df_connection_iq_report_common(BT_HCI_EVT_LE_CONNECTION_IQ_REPORT, buf); -} - -#if defined(CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) -void bt_hci_le_vs_df_connection_iq_report(struct net_buf *buf) -{ - bt_hci_le_df_connection_iq_report_common(BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT, buf); -} -#endif /* CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ #endif /* CONFIG_BT_DF_CONNECTION_CTE_RX */ #if defined(CONFIG_BT_DF_CONNECTION_CTE_REQ) diff --git a/subsys/bluetooth/host/direction.c b/subsys/bluetooth/host/direction.c index 495e3b4dbeb..dad6b9b2a60 100644 --- a/subsys/bluetooth/host/direction.c +++ b/subsys/bluetooth/host/direction.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include "hci_core.h" @@ -408,7 +407,6 @@ int hci_df_prepare_connectionless_iq_report(struct net_buf *buf, report->packet_status = evt->packet_status; report->slot_durations = evt->slot_durations; report->per_evt_counter = sys_le16_to_cpu(evt->per_evt_counter); - report->sample_type = BT_DF_IQ_SAMPLE_8_BITS_INT; report->sample_count = evt->sample_count; report->sample = &evt->sample[0]; @@ -416,54 +414,6 @@ int hci_df_prepare_connectionless_iq_report(struct net_buf *buf, return 0; } - -int hci_df_vs_prepare_connectionless_iq_report(struct net_buf *buf, - struct bt_df_per_adv_sync_iq_samples_report *report, - struct bt_le_per_adv_sync **per_adv_sync_to_report) -{ - struct bt_hci_evt_vs_le_connectionless_iq_report *evt; - struct bt_le_per_adv_sync *per_adv_sync; - - if (buf->len < sizeof(*evt)) { - BT_ERR("Unexpected end of buffer"); - return -EINVAL; - } - - evt = net_buf_pull_mem(buf, sizeof(*evt)); - - per_adv_sync = bt_hci_get_per_adv_sync(sys_le16_to_cpu(evt->sync_handle)); - - if (!per_adv_sync) { - BT_ERR("Unknown handle 0x%04X for iq samples report", - sys_le16_to_cpu(evt->sync_handle)); - return -EINVAL; - } - - if (!atomic_test_bit(per_adv_sync->flags, BT_PER_ADV_SYNC_CTE_ENABLED)) { - BT_ERR("Received PA CTE report when CTE receive disabled"); - return -EINVAL; - } - - if (!(per_adv_sync->cte_types & BIT(evt->cte_type))) { - BT_DBG("CTE filtered out by cte_type: %u", evt->cte_type); - return -EINVAL; - } - - report->chan_idx = evt->chan_idx; - report->rssi = sys_le16_to_cpu(evt->rssi); - report->rssi_ant_id = evt->rssi_ant_id; - report->cte_type = BIT(evt->cte_type); - report->packet_status = evt->packet_status; - report->slot_durations = evt->slot_durations; - report->per_evt_counter = sys_le16_to_cpu(evt->per_evt_counter); - report->sample_count = evt->sample_count; - report->sample_type = BT_DF_IQ_SAMPLE_16_BITS_INT; - report->sample16 = &evt->sample[0]; - - *per_adv_sync_to_report = per_adv_sync; - - return 0; -} #endif /* CONFIG_BT_DF_CONNECTIONLESS_CTE_RX */ #if defined(CONFIG_BT_DF_CONNECTION_CTE_TX) @@ -707,7 +657,6 @@ int hci_df_prepare_connection_iq_report(struct net_buf *buf, report->packet_status = evt->packet_status; report->slot_durations = evt->slot_durations; report->conn_evt_counter = sys_le16_to_cpu(evt->conn_evt_counter); - report->sample_type = BT_DF_IQ_SAMPLE_8_BITS_INT; report->sample_count = evt->sample_count; report->sample = evt->sample; @@ -715,57 +664,6 @@ int hci_df_prepare_connection_iq_report(struct net_buf *buf, return 0; } - -int hci_df_vs_prepare_connection_iq_report(struct net_buf *buf, - struct bt_df_conn_iq_samples_report *report, - struct bt_conn **conn_to_report) -{ - struct bt_hci_evt_vs_le_connection_iq_report *evt; - struct bt_conn *conn; - - if (buf->len < sizeof(*evt)) { - BT_ERR("Unexpected end of buffer"); - return -EINVAL; - } - - evt = net_buf_pull_mem(buf, sizeof(*evt)); - - conn = bt_conn_lookup_handle(sys_le16_to_cpu(evt->conn_handle)); - if (!conn) { - BT_ERR("Unknown conn handle 0x%04X for iq samples report", - sys_le16_to_cpu(evt->conn_handle)); - return -EINVAL; - } - - if (!atomic_test_bit(conn->flags, BT_CONN_CTE_RX_ENABLED)) { - BT_ERR("Received conn CTE report when CTE receive disabled"); - return -EINVAL; - } - - if (!(conn->cte_types & BIT(evt->cte_type))) { - BT_DBG("CTE filtered out by cte_type: %u", evt->cte_type); - return -EINVAL; - } - - report->err = BT_DF_IQ_REPORT_ERR_SUCCESS; - report->chan_idx = evt->data_chan_idx; - report->rx_phy = evt->rx_phy; - report->chan_idx = evt->data_chan_idx; - report->rssi = evt->rssi; - report->rssi_ant_id = evt->rssi_ant_id; - report->cte_type = BIT(evt->cte_type); - report->packet_status = evt->packet_status; - report->slot_durations = evt->slot_durations; - report->conn_evt_counter = sys_le16_to_cpu(evt->conn_evt_counter); - report->sample_type = BT_DF_IQ_SAMPLE_16_BITS_INT; - report->sample_count = evt->sample_count; - report->sample16 = evt->sample; - - *conn_to_report = conn; - - return 0; -} - #endif /* CONFIG_BT_DF_CONNECTION_CTE_RX */ #if defined(CONFIG_BT_DF_CONNECTION_CTE_REQ) diff --git a/subsys/bluetooth/host/direction_internal.h b/subsys/bluetooth/host/direction_internal.h index 30284f402d4..4e05a1ce500 100644 --- a/subsys/bluetooth/host/direction_internal.h +++ b/subsys/bluetooth/host/direction_internal.h @@ -10,15 +10,9 @@ int le_df_init(void); int hci_df_prepare_connectionless_iq_report(struct net_buf *buf, struct bt_df_per_adv_sync_iq_samples_report *report, struct bt_le_per_adv_sync **per_adv_sync_to_report); -int hci_df_vs_prepare_connectionless_iq_report(struct net_buf *buf, - struct bt_df_per_adv_sync_iq_samples_report *report, - struct bt_le_per_adv_sync **per_adv_sync_to_report); int hci_df_prepare_connection_iq_report(struct net_buf *buf, struct bt_df_conn_iq_samples_report *report, struct bt_conn **conn_to_report); -int hci_df_vs_prepare_connection_iq_report(struct net_buf *buf, - struct bt_df_conn_iq_samples_report *report, - struct bt_conn **conn_to_report); int hci_df_prepare_conn_cte_req_failed(struct net_buf *buf, struct bt_df_conn_iq_samples_report *report, struct bt_conn **conn_to_report); diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index c9c61b529ee..9b1554d027f 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -140,8 +140,9 @@ struct event_handler { .min_len = _min_len, \ } -static int handle_event_common(uint8_t event, struct net_buf *buf, - const struct event_handler *handlers, size_t num_handlers) +static inline void handle_event(uint8_t event, struct net_buf *buf, + const struct event_handler *handlers, + size_t num_handlers) { size_t i; @@ -155,41 +156,15 @@ static int handle_event_common(uint8_t event, struct net_buf *buf, if (buf->len < handler->min_len) { BT_ERR("Too small (%u bytes) event 0x%02x", buf->len, event); - return -EINVAL; + return; } handler->handler(buf); - return 0; - } - - return -EOPNOTSUPP; -} - -static void handle_event(uint8_t event, struct net_buf *buf, const struct event_handler *handlers, - size_t num_handlers) -{ - int err; - - err = handle_event_common(event, buf, handlers, num_handlers); - if (err == -EOPNOTSUPP) { - BT_WARN("Unhandled event 0x%02x len %u: %s", event, buf->len, - bt_hex(buf->data, buf->len)); - } - - /* Other possible errors are handled by handle_event_common function */ -} - -static void handle_vs_event(uint8_t event, struct net_buf *buf, - const struct event_handler *handlers, size_t num_handlers) -{ - int err; - - err = handle_event_common(event, buf, handlers, num_handlers); - if (err == -EOPNOTSUPP) { - BT_WARN("Unhandled vendor-specific event: %s", bt_hex(buf->data, buf->len)); + return; } - /* Other possible errors are handled by handle_event_common function */ + BT_WARN("Unhandled event 0x%02x len %u: %s", event, + buf->len, bt_hex(buf->data, buf->len)); } #if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL) @@ -2154,18 +2129,6 @@ int bt_hci_register_vnd_evt_cb(bt_hci_vnd_evt_cb_t cb) } #endif /* CONFIG_BT_HCI_VS_EVT_USER */ -static const struct event_handler vs_events[] = { -#if defined(CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) - EVENT_HANDLER(BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT, - bt_hci_le_vs_df_connectionless_iq_report, - sizeof(struct bt_hci_evt_vs_le_connectionless_iq_report)), -#endif /* CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ -#if defined(CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) - EVENT_HANDLER(BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT, bt_hci_le_vs_df_connection_iq_report, - sizeof(struct bt_hci_evt_vs_le_connection_iq_report)), -#endif /* CONFIG_BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ -}; - static void hci_vendor_event(struct net_buf *buf) { bool handled = false; @@ -2182,14 +2145,10 @@ static void hci_vendor_event(struct net_buf *buf) } #endif /* CONFIG_BT_HCI_VS_EVT_USER */ - if (IS_ENABLED(CONFIG_BT_HCI_VS_EVT) && !handled) { - struct bt_hci_evt_vs *evt; - - evt = net_buf_pull_mem(buf, sizeof(*evt)); - - BT_DBG("subevent 0x%02x", evt->subevent); - - handle_vs_event(evt->subevent, buf, vs_events, ARRAY_SIZE(vs_events)); + if (IS_ENABLED(CONFIG_BT_HCI_VS_EXT) && !handled) { + /* do nothing at present time */ + BT_WARN("Unhandled vendor-specific event: %s", + bt_hex(buf->data, buf->len)); } } diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 8890f76ce2a..68e757cd6c1 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -458,7 +458,6 @@ void bt_hci_le_per_adv_report(struct net_buf *buf); void bt_hci_le_per_adv_sync_lost(struct net_buf *buf); void bt_hci_le_biginfo_adv_report(struct net_buf *buf); void bt_hci_le_df_connectionless_iq_report(struct net_buf *buf); -void bt_hci_le_vs_df_connectionless_iq_report(struct net_buf *buf); void bt_hci_le_past_received(struct net_buf *buf); /* Adv HCI event handlers */ @@ -481,5 +480,4 @@ void bt_hci_role_change(struct net_buf *buf); void bt_hci_synchronous_conn_complete(struct net_buf *buf); void bt_hci_le_df_connection_iq_report(struct net_buf *buf); -void bt_hci_le_vs_df_connection_iq_report(struct net_buf *buf); void bt_hci_le_df_cte_req_failed(struct net_buf *buf); diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index 95901952ef7..f0b465106ba 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -14,8 +14,6 @@ #include #include #include -#include -#include #include "hci_core.h" #include "conn_internal.h" @@ -1101,7 +1099,7 @@ void bt_hci_le_biginfo_adv_report(struct net_buf *buf) } #endif /* CONFIG_BT_ISO_BROADCAST */ #if defined(CONFIG_BT_DF_CONNECTIONLESS_CTE_RX) -static void bt_hci_le_df_connectionless_iq_report_common(uint8_t event, struct net_buf *buf) +void bt_hci_le_df_connectionless_iq_report(struct net_buf *buf) { int err; @@ -1109,21 +1107,9 @@ static void bt_hci_le_df_connectionless_iq_report_common(uint8_t event, struct n struct bt_le_per_adv_sync *per_adv_sync; struct bt_le_per_adv_sync_cb *listener; - if (event == BT_HCI_EVT_LE_CONNECTIONLESS_IQ_REPORT) { - err = hci_df_prepare_connectionless_iq_report(buf, &cte_report, &per_adv_sync); - if (err) { - BT_ERR("Prepare CTE conn IQ report failed %d", err); - return; - } - } else if (IS_ENABLED(CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) && - event == BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT) { - err = hci_df_vs_prepare_connectionless_iq_report(buf, &cte_report, &per_adv_sync); - if (err) { - BT_ERR("Prepare CTE conn IQ report failed %d", err); - return; - } - } else { - BT_ERR("Unhandled VS connectionless IQ report"); + err = hci_df_prepare_connectionless_iq_report(buf, &cte_report, &per_adv_sync); + if (err) { + BT_ERR("Prepare CTE conn IQ report failed %d", err); return; } @@ -1133,19 +1119,6 @@ static void bt_hci_le_df_connectionless_iq_report_common(uint8_t event, struct n } } } - -void bt_hci_le_df_connectionless_iq_report(struct net_buf *buf) -{ - bt_hci_le_df_connectionless_iq_report_common(BT_HCI_EVT_LE_CONNECTIONLESS_IQ_REPORT, buf); -} - -#if defined(CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) -void bt_hci_le_vs_df_connectionless_iq_report(struct net_buf *buf) -{ - bt_hci_le_df_connectionless_iq_report_common(BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT, - buf); -} -#endif /* CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ #endif /* CONFIG_BT_DF_CONNECTIONLESS_CTE_RX */ #endif /* defined(CONFIG_BT_PER_ADV_SYNC) */ #endif /* defined(CONFIG_BT_EXT_ADV) */ From 34fb433806eefa7d107def19b4fd28978a9ce4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 261/501] Revert "[nrf fromtree] Bluetooth: hci: Add VS IQ samples report using 16 bit sign integer sampl" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 17ebc6f04a4cd6d6e7eee79c09f55b4bf615874a. Signed-off-by: Andrzej Głąbek --- doc/connectivity/bluetooth/api/hci.txt | 371 +------------------------ include/zephyr/bluetooth/hci_vs.h | 42 --- subsys/bluetooth/common/Kconfig | 7 - subsys/bluetooth/controller/Kconfig.df | 24 -- subsys/bluetooth/controller/hci/hci.c | 188 +------------ 5 files changed, 4 insertions(+), 628 deletions(-) diff --git a/doc/connectivity/bluetooth/api/hci.txt b/doc/connectivity/bluetooth/api/hci.txt index ee75f0799f9..2522e635796 100644 --- a/doc/connectivity/bluetooth/api/hci.txt +++ b/doc/connectivity/bluetooth/api/hci.txt @@ -88,8 +88,8 @@ the controller. By default no vendor events are reported. | | 1 | Fatal Error | | | 2 | Trace Information Event | | | 3 | Scan Request Received Event | - | | 4 | Connectionless IQ Report Event | - | | 5 | Connection IQ Report Event | + | | 4 | Reserved | + | | 5 | Reserved | | | 6 | Reserved | | | 7 | Reserved | +-------+------+--------------------------------------------+ @@ -1325,372 +1325,7 @@ advertising sets, this event shall not be generated. The event is only reported when unmasked by Set_Event_Mask command. -Zephyr LE Connectionless IQ Report Event -======================================== - -This event indicates that periodic advertising PDU including Constant Tone -Extension was received and sampled. - -+-------------------------------+------------+-------------------------------+ -| Event | Event Code | Event Parameters | -+-------------------------------+------------+-------------------------------+ -| LE_Connectionless_IQ_Report | 0xFF | Subevent_Code, | -| | | Sync_Handle, | -| | | Channel_Index, | -| | | RSSI, | -| | | RSSI_Antenna_ID, | -| | | CTE_Type, | -| | | Slot_Durations, | -| | | Packet_Status, | -| | | Periodic_Event_Counter, | -| | | Sample_Count, | -| | | I_Sample[i], | -| | | Q_Sample[i] | -+-------------------------------+------------+-------------------------------+ - - The event provides collected IQ samples that are stored as 16 bit signed - integers. It is an extension to LE Connectionless IQ Report Event provided - by Bluetooth Core 5.3 Vol 4, Part E section 7.7.65.21. The BT Core defined - counterpart provides IQ samples that are 8 bit signed integers. - - Subevent_Code: Size: 1 Octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x05 | Subevent code for LE Connectionless | - | | IQ Report event | - +--------------------+--------------------------------------+ - - Sync_Handle: Size: 2 octets (12 bits meaningful) - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0xXXXX | Sync_Handle identifying the periodic | - | | advertising train. | - | | Range: 0x0000 to 0x0EFF | - +--------------------+--------------------------------------+ - | 0x0FFF | Receiver Test. | - +--------------------+--------------------------------------+ - - Channel_Index: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x00 to 0x27 | The index of the channel on which the| - | | packet was received. Note: 0x25 to | - | | 0x27 can be used only for packets | - | | generated during test modes. | - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - RSSI: Size: 2 octets - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0xXXXX | RSSI of the packet | - | | Range: -1270 to +200 | - | | Units: 0.1 dBm | - +--------------------+--------------------------------------+ - - - RSSI_Antenna_ID: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0xXX | Antenna ID | - +--------------------+--------------------------------------+ - - CTE_Type: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x00 | AoA Constant Tone Extension | - +--------------------+--------------------------------------+ - | 0x01 | AoD Constant Tone Extension with | - | | 1 us slots | - +--------------------+--------------------------------------+ - | 0x02 | AoD Constant Tone Extension with | - | | 2 us slots | - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - - Slot_Durations: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x01 | Switching and sampling slots are | - | | 1 µs each | - +--------------------+--------------------------------------+ - | 0x02 | Switching and sampling slots are | - | | 2 µs each | - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - Packet_Status: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x00 | Packet_Status | - +--------------------+--------------------------------------+ - | 0x01 | CRC was incorrect and the Length and | - | | CTETime fields of the packet were | - | | used to determine sampling points | - +--------------------+--------------------------------------+ - | 0x02 | CRC was incorrect but the Controller | - | | has determined the position and | - | | length of the Constant Tone Extension| - | | in some other way | - +--------------------+--------------------------------------+ - | 0xFF | Insufficient resources to sample | - | | (Channel_Index, CTE_Type, and | - | | Slot_Durations invalid). | - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - Periodic_Event_Counter: Size: 2 octets - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0xXXXX | The value of paEventCounter (see | - | | [Vol 6] Part B, Section 4.4.2.1) for | - | | the reported AUX_SYNC_IND PDU | - +--------------------+--------------------------------------+ - - Sample_Count: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x00 | No samples provided (only permitted | - | | if Packet_Status is 0xFF). | - +--------------------+--------------------------------------+ - | 0x09 to 0x52 | Total number of sample pairs (there | - | | shall be the same number of I samples| - | | and Q samples). | - | | Note: This number is dependent on the| - | | switch and sample slot durations used| - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - I_Sample[i]: Size: Sample_count x 2 octets - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x8000 | No valid sample available or sample | - | | is saturated | - +--------------------+--------------------------------------+ - | All other values | I sample for the reported packet | - | | (signed integer). | - | | The list in the order of the sampling| - | | points within the packet. | - +--------------------+--------------------------------------+ - - Q_Sample[i]: Size: Sample_count x 2 octets - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x8000 | No valid sample available or sample | - | | is saturated | - +--------------------+--------------------------------------+ - | All other values | Q sample for the reported packet | - | | (signed integer). | - | | The list in the order of the sampling| - | | points within the packet. | - +--------------------+--------------------------------------+ - -Zephyr LE Connection IQ Report Event -==================================== - -This event indicates that there was received and sampled a PDU including -Constant Tone Extension associated with a given connection. - -+-------------------------------+------------+-------------------------------+ -| Event | Event Code | Event Parameters | -+-------------------------------+------------+-------------------------------+ -| LE_Connection_IQ_Report | 0xFF | Subevent_Code, | -| | | Connection_Handle, | -| | | RF_PHY, | -| | | Data_Channel_Index, | -| | | RSSI, | -| | | RSSI_Antenna_ID, | -| | | CTE_Type, | -| | | Slot_Durations, | -| | | Packet_Status, | -| | | Connection_Event_Counter, | -| | | Sample_Count, | -| | | I_Sample[i], | -| | | Q_Sample[i] | -+-------------------------------+------------+-------------------------------+ - - The event provides collected IQ samples that are stored as 16 bit signed - integers. It is an extension to LE Connection IQ Report Event provided - by Bluetooth Core 5.3 Vol 4, Part E section 7.7.65.22. The BT Core defined - counterpart provides IQ samples that are 8 bit signed integers. - - Subevent_Code: Size: 1 Octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x06 | Subevent code for LE Connection IQ | - | | Report event | - +--------------------+--------------------------------------+ - - Connection_Handle: Size: 2 octets (12 bits meaningful) - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0xXXXX | Connection_Handle identifying the | - | | connection. | - | | Range: 0x0000 to 0x0EFF | - +--------------------+--------------------------------------+ - - RF_PHY: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x01 | The receiver PHY for the connection | - | | is LE 1M | - +--------------------+--------------------------------------+ - | 0x02 | The receiver PHY for the connection | - | | is LE 2M | - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - Data_Channel_Index: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x00 to 0x24 | The index of the data channel on | - | | which the Data Physical Channel PDU | - | | was received. | - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - RSSI: Size: 2 octets - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0xXXXX | RSSI of the packet | - | | Range: -1270 to +200 | - | | Units: 0.1 dBm | - +--------------------+--------------------------------------+ - - RSSI_Antenna_ID: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0xXX | Antenna ID | - +--------------------+--------------------------------------+ - - CTE_Type: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x00 | AoA Constant Tone Extension | - +--------------------+--------------------------------------+ - | 0x01 | AoD Constant Tone Extension with | - | | 1 us slots | - +--------------------+--------------------------------------+ - | 0x02 | AoD Constant Tone Extension with | - | | 2 us slots | - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - Slot_Durations: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x01 | Switching and sampling slots are | - | | 1 µs each | - +--------------------+--------------------------------------+ - | 0x02 | Switching and sampling slots are | - | | 2 µs each | - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - Packet_Status: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x00 | Packet_Status | - +--------------------+--------------------------------------+ - | 0x01 | CRC was incorrect and the Length and | - | | CTETime fields of the packet were | - | | used to determine sampling points | - +--------------------+--------------------------------------+ - | 0x02 | CRC was incorrect but the Controller | - | | has determined the position and | - | | length of the Constant Tone Extension| - | | in some other way | - +--------------------+--------------------------------------+ - | 0xFF | Insufficient resources to sample | - | | (Channel_Index, CTE_Type, and | - | | Slot_Durations invalid). | - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - Connection_Event_Counter: Size: 2 octets - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0xXXXX | The value of connEventCounter (see | - | | [Vol 6] Part B, Section 4.5.1) for | - | | the reported PDU | - +--------------------+--------------------------------------+ - - Sample_Count: Size: 1 octet - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x00 | No samples provided (only permitted | - | | if Packet_Status is 0xFF). | - +--------------------+--------------------------------------+ - | 0x09 to 0x52 | Total number of sample pairs (there | - | | shall be the same number of I samples| - | | and Q samples). | - | | Note: This number is dependent on the| - | | switch and sample slot durations used| - +--------------------+--------------------------------------+ - | All other values | Reserved for future use | - +--------------------+--------------------------------------+ - - I_Sample[i]: Size: Sample_count x 2 octets - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x8000 | No valid sample available or sample | - | | is saturated | - +--------------------+--------------------------------------+ - | All other values | I sample for the reported packet | - | | (signed integer). | - | | The list in the order of the sampling| - | | points within the packet. | - +--------------------+--------------------------------------+ - - Q_Sample[i]: Size: Sample_count x 2 octets - +--------------------+--------------------------------------+ - | Value | Parameter Description | - +--------------------+--------------------------------------+ - | 0x8000 | No valid sample available or sample | - | | is saturated | - +--------------------+--------------------------------------+ - | All other values | Q sample for the reported packet | - | | (signed integer). | - | | The list in the order of the sampling| - | | points within the packet. | - +--------------------+--------------------------------------+ - - Zephyr Vendor Diagnostic Channel +Zephyr Vendor Diagnostic Channel ================================ The vendor diagnostic channel allows for an independent side channel to provide diff --git a/include/zephyr/bluetooth/hci_vs.h b/include/zephyr/bluetooth/hci_vs.h index 483e9610a77..5df7a66f68f 100644 --- a/include/zephyr/bluetooth/hci_vs.h +++ b/include/zephyr/bluetooth/hci_vs.h @@ -263,53 +263,11 @@ struct bt_hci_evt_vs_scan_req_rx { int8_t rssi; } __packed; -struct bt_hci_le_iq_sample16 { - int16_t i; - int16_t q; -} __packed; - -#define BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT 0x5 -#define BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE 0x8000 -struct bt_hci_evt_vs_le_connectionless_iq_report { - uint16_t sync_handle; - uint8_t chan_idx; - int16_t rssi; - uint8_t rssi_ant_id; - uint8_t cte_type; - uint8_t slot_durations; - uint8_t packet_status; - uint16_t per_evt_counter; - uint8_t sample_count; - struct bt_hci_le_iq_sample16 sample[0]; -} __packed; - -#define BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT 0x6 -struct bt_hci_evt_vs_le_connection_iq_report { - uint16_t conn_handle; - uint8_t rx_phy; - uint8_t data_chan_idx; - int16_t rssi; - uint8_t rssi_ant_id; - uint8_t cte_type; - uint8_t slot_durations; - uint8_t packet_status; - uint16_t conn_evt_counter; - uint8_t sample_count; - struct bt_hci_le_iq_sample16 sample[0]; -} __packed; - /* Event mask bits */ #define BT_EVT_MASK_VS_FATAL_ERROR BT_EVT_BIT(1) #define BT_EVT_MASK_VS_TRACE_INFO BT_EVT_BIT(2) #define BT_EVT_MASK_VS_SCAN_REQ_RX BT_EVT_BIT(3) -#define BT_EVT_MASK_VS_LE_CONNECTIONLESS_IQ_REPORT BT_EVT_BIT(4) -#define BT_EVT_MASK_VS_LE_CONNECTION_IQ_REPORT BT_EVT_BIT(5) - -#define DEFAULT_VS_EVT_MASK \ - BT_EVT_MASK_VS_FATAL_ERROR | BT_EVT_MASK_VS_TRACE_INFO | BT_EVT_MASK_VS_SCAN_REQ_RX | \ - BT_EVT_MASK_VS_LE_CONNECTIONLESS_IQ_REPORT | \ - BT_EVT_MASK_VS_LE_CONNECTION_IQ_REPORT /* Mesh HCI commands */ #define BT_HCI_MESH_REVISION 0x01 diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 1d4e97648b7..7fc4691a501 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -214,13 +214,6 @@ config BT_HCI_VS_EXT Host and/or Controller. This enables Write BD_ADDR, Read Build Info, Read Static Addresses and Read Key Hierarchy Roots vendor commands. -config BT_HCI_VS_EVT - bool "Zephyr HCI Vendor-Specific Events" - depends on BT_HCI_VS_EXT - help - Enable support for the Zephyr HCI Vendor-Specific Events in the - Host and/or Controller. - config BT_HCI_VS_FATAL_ERROR bool "Allow vendor specific HCI event Zephyr Fatal Error" depends on BT_HCI_VS_EXT diff --git a/subsys/bluetooth/controller/Kconfig.df b/subsys/bluetooth/controller/Kconfig.df index e3f460c7f51..8a3334f7a01 100644 --- a/subsys/bluetooth/controller/Kconfig.df +++ b/subsys/bluetooth/controller/Kconfig.df @@ -309,30 +309,6 @@ config BT_CTLR_DF_IQ_SAMPLES_CONVERT_USE_8_LSB endchoice -# Vendor specifici extensions configuration - -config BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES - bool "Use 16 bits signed integer IQ samples in connectionless IQ reports" - depends on BT_CTLR_DF_SCAN_CTE_RX && BT_HCI_VS_EXT - select BT_HCI_VS_EVT - help - Direction Finging connectionless IQ reports provide a set of IQ samples collected during - sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed - integer, see Vol 4, Part E section 7.7.65.21. This option enables a vendor specific - extenstion to HCI layer, so that connectionless IQ reports store samples in 16 bit signed - integer format. - -config BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES - bool "Use 16 bits signed integer IQ samples in connection IQ reports" - depends on BT_CTLR_DF_CONN_CTE_RX && BT_HCI_VS_EXT - select BT_HCI_VS_EVT - help - Direction Finging connection IQ reports provide a set of IQ samples collected during - sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed - integer, see Vol 4, Part E section 7.7.65.22. This option enables a vendor specific - extenstion to HCI layer, so that connection IQ reports store samples in 16 bit signed - integer format. - endif # BT_LL_SW_SPLIT endif # BT_CTLR_DF diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index bd11ba75577..21c2a05189d 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -209,9 +209,6 @@ static uint32_t cis_pending_count; static uint64_t event_mask = DEFAULT_EVENT_MASK; static uint64_t event_mask_page_2 = DEFAULT_EVENT_MASK_PAGE_2; static uint64_t le_event_mask = DEFAULT_LE_EVENT_MASK; -#if defined(CONFIG_BT_HCI_VS_EVT) -static uint64_t vs_events_mask = DEFAULT_VS_EVT_MASK; -#endif /* CONFIG_BT_HCI_VS_EVT */ static struct net_buf *cmd_complete_status(uint8_t status); @@ -337,19 +334,6 @@ static void *meta_evt(struct net_buf *buf, uint8_t subevt, uint8_t melen) return net_buf_add(buf, melen); } -#if defined(CONFIG_BT_HCI_VS_EVT) -static void *vs_event(struct net_buf *buf, uint8_t subevt, uint8_t evt_len) -{ - struct bt_hci_evt_vs *evt; - - hci_evt_create(buf, BT_HCI_EVT_VENDOR, sizeof(*evt) + evt_len); - evt = net_buf_add(buf, sizeof(*evt)); - evt->subevent = subevt; - - return net_buf_add(buf, evt_len); -} -#endif /* CONFIG_BT_HCI_VS_EVT */ - #if defined(CONFIG_BT_HCI_MESH_EXT) static void *mesh_evt(struct net_buf *buf, uint8_t subevt, uint8_t melen) { @@ -2940,7 +2924,7 @@ static void le_df_connectionless_iq_report(struct pdu_data *pdu_rx, * HCI event should inform about it by storing single octet with * special I_sample and Q_sample data. */ - samples_cnt = MAX(1, iq_report->sample_count); + samples_cnt = (!iq_report->sample_count ? 1 : iq_report->sample_count); sep = meta_evt(buf, BT_HCI_EVT_LE_CONNECTIONLESS_IQ_REPORT, (sizeof(*sep) + @@ -4990,168 +4974,6 @@ struct net_buf *hci_vs_err_assert(const char *file, uint32_t line) } #endif /* CONFIG_BT_HCI_VS_FATAL_ERROR */ -#if defined(CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) -static void vs_le_df_connectionless_iq_report(struct pdu_data *pdu_rx, struct node_rx_pdu *node_rx, - struct net_buf *buf) -{ - struct bt_hci_evt_vs_le_connectionless_iq_report *sep; - struct node_rx_iq_report *iq_report; - struct lll_sync *lll; - uint8_t samples_cnt; - int16_t rssi; - uint16_t sync_handle; - uint16_t per_evt_counter; - struct ll_sync_set *sync = NULL; - - iq_report = (struct node_rx_iq_report *)node_rx; - - if (!(vs_events_mask & BT_EVT_MASK_VS_LE_CONNECTIONLESS_IQ_REPORT)) { - return; - } - - lll = iq_report->hdr.rx_ftr.param; - - sync = HDR_LLL2ULL(lll); - - /* TX LL thread has higher priority than RX thread. It may happen that - * host successfully disables CTE sampling in the meantime. - * It should be verified here, to avoid reporting IQ samples after - * the functionality was disabled or if sync was lost. - */ - if (ull_df_sync_cfg_is_not_enabled(&lll->df_cfg) || !sync->timeout_reload) { - /* Drop further processing of the event. */ - return; - } - - /* Get the sync handle corresponding to the LLL context passed in the - * node rx footer field. - */ - sync_handle = ull_sync_handle_get(sync); - per_evt_counter = iq_report->event_counter; - - /* If there are no IQ samples due to insufficient resources - * HCI event should inform about it by storing single octet with - * special I_sample and Q_sample data. - */ - samples_cnt = MAX(1, iq_report->sample_count); - - sep = vs_event(buf, BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT, - (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample16)))); - - rssi = RSSI_DBM_TO_DECI_DBM(iq_report->hdr.rx_ftr.rssi); - - sep->sync_handle = sys_cpu_to_le16(sync_handle); - sep->rssi = sys_cpu_to_le16(rssi); - sep->rssi_ant_id = iq_report->rssi_ant_id; - sep->cte_type = iq_report->cte_info.type; - - sep->chan_idx = iq_report->chan_idx; - sep->per_evt_counter = sys_cpu_to_le16(per_evt_counter); - - if (sep->cte_type == BT_HCI_LE_AOA_CTE) { - sep->slot_durations = iq_report->local_slot_durations; - } else if (sep->cte_type == BT_HCI_LE_AOD_CTE_1US) { - sep->slot_durations = BT_HCI_LE_ANTENNA_SWITCHING_SLOT_1US; - } else { - sep->slot_durations = BT_HCI_LE_ANTENNA_SWITCHING_SLOT_2US; - } - - sep->packet_status = iq_report->packet_status; - - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - sep->sample[0].i = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample[0].q = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample_count = 0U; - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); - sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); - } - - sep->sample_count = samples_cnt; - } -} -#endif /* CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ - -#if defined(CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) -static void vs_le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct net_buf *buf) -{ - struct bt_hci_evt_vs_le_connection_iq_report *sep; - struct node_rx_iq_report *iq_report; - struct lll_conn *lll; - uint8_t samples_cnt; - uint8_t phy_rx; - int16_t rssi; - - iq_report = (struct node_rx_iq_report *)node_rx; - - if (!(vs_events_mask & BT_EVT_MASK_VS_LE_CONNECTION_IQ_REPORT)) { - return; - } - - lll = iq_report->hdr.rx_ftr.param; - -#if defined(CONFIG_BT_CTLR_PHY) - phy_rx = lll->phy_rx; - - /* Make sure the report is generated for connection on PHY UNCODED */ - LL_ASSERT(phy_rx != PHY_CODED); -#else - phy_rx = PHY_1M; -#endif /* CONFIG_BT_CTLR_PHY */ - - /* TX LL thread has higher priority than RX thread. It may happen that host succefully - * disables CTE sampling in the meantime. It should be verified here, to avoid reporing - * IQ samples after the functionality was disabled. - */ - if (ull_df_conn_cfg_is_not_enabled(&lll->df_rx_cfg)) { - /* Dropp further processing of the event. */ - return; - } - - /* If there are no IQ samples due to insufficient resources HCI event should inform about - * it by store single octet with special I_sample and Q_sample data. - */ - samples_cnt = MAX(1, iq_report->sample_count); - - sep = vs_event(buf, BT_HCI_EVT_VS_LE_CONNECTION_IQ_REPORT, - (sizeof(*sep) + (samples_cnt * sizeof(struct bt_hci_le_iq_sample16)))); - - rssi = RSSI_DBM_TO_DECI_DBM(iq_report->hdr.rx_ftr.rssi); - - sep->conn_handle = sys_cpu_to_le16(iq_report->hdr.handle); - sep->rx_phy = phy_rx; - sep->rssi = sys_cpu_to_le16(rssi); - sep->rssi_ant_id = iq_report->rssi_ant_id; - sep->cte_type = iq_report->cte_info.type; - - sep->data_chan_idx = iq_report->chan_idx; - sep->conn_evt_counter = sys_cpu_to_le16(iq_report->event_counter); - - if (sep->cte_type == BT_HCI_LE_AOA_CTE) { - sep->slot_durations = iq_report->local_slot_durations; - } else if (sep->cte_type == BT_HCI_LE_AOD_CTE_1US) { - sep->slot_durations = BT_HCI_LE_ANTENNA_SWITCHING_SLOT_1US; - } else { - sep->slot_durations = BT_HCI_LE_ANTENNA_SWITCHING_SLOT_2US; - } - - sep->packet_status = iq_report->packet_status; - - if (iq_report->packet_status == BT_HCI_LE_CTE_INSUFFICIENT_RESOURCES) { - sep->sample[0].i = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample[0].q = BT_HCI_VS_LE_CTE_REPORT_NO_VALID_SAMPLE; - sep->sample_count = 0U; - } else { - for (uint8_t idx = 0U; idx < samples_cnt; ++idx) { - sep->sample[idx].i = sys_cpu_to_le16(iq_report->sample[idx].i); - sep->sample[idx].q = sys_cpu_to_le16(iq_report->sample[idx].q); - } - sep->sample_count = samples_cnt; - } -} -#endif /* CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ - #endif /* CONFIG_BT_HCI_VS_EXT */ #if defined(CONFIG_BT_HCI_MESH_EXT) @@ -8052,11 +7874,7 @@ static void encode_control(struct node_rx_pdu *node_rx, #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT: -#if defined(CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) - vs_le_df_connectionless_iq_report(pdu_data, node_rx, buf); -#else le_df_connectionless_iq_report(pdu_data, node_rx, buf); -#endif /* CONFIG_BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES */ break; #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ @@ -8154,11 +7972,7 @@ static void encode_control(struct node_rx_pdu *node_rx, #if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX) case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT: -#if defined(CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES) - vs_le_df_connection_iq_report(node_rx, buf); -#else le_df_connection_iq_report(node_rx, buf); -#endif /* CONFIG_BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES */ return; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */ #endif /* CONFIG_BT_CONN */ From 4c093ea6db5f50814c760683f1e0680063b67a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 262/501] Revert "[nrf noup] wifi_stats: Add nRF Wi-Fi management" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cd53492175092c172156add03026c700f03fb61e. Signed-off-by: Andrzej Głąbek --- subsys/net/ip/Kconfig.stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 639685e420d..147b002d603 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -127,7 +127,7 @@ config NET_STATISTICS_POWER_MANAGEMENT config NET_STATISTICS_WIFI bool "Wi-Fi statistics" - depends on NET_L2_WIFI_MGMT || NET_L2_NRF_WIFI_MGMT + depends on NET_L2_WIFI_MGMT default y help Keep track of Wi-Fi related statistics. Note that this From 85edf42c83371f158265c78f84df92846a0185e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 263/501] Revert "[nrf fromtree] samples: tfm_integration: tfm_regression_test Default to isol level 2" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 655cbc3444b3034dc86a19daaaf6d9003c579a60. Signed-off-by: Andrzej Głąbek --- samples/tfm_integration/tfm_regression_test/prj.conf | 4 ---- .../tfm_integration/tfm_regression_test/sample.yaml | 10 +++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index c579d1bc1b4..d6e0b380013 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -18,7 +18,3 @@ CONFIG_TFM_PARTITION_CRYPTO=y CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=y CONFIG_TFM_PARTITION_PLATFORM=y CONFIG_TFM_PARTITION_AUDIT_LOG=y - -# Enable IPC mode and isolation level 2 by default -CONFIG_TFM_IPC=y -CONFIG_TFM_ISOLATION_LEVEL=2 diff --git a/samples/tfm_integration/tfm_regression_test/sample.yaml b/samples/tfm_integration/tfm_regression_test/sample.yaml index 3383c91b544..0297fb0907c 100644 --- a/samples/tfm_integration/tfm_regression_test/sample.yaml +++ b/samples/tfm_integration/tfm_regression_test/sample.yaml @@ -14,13 +14,9 @@ sample: name: "TFM Regression Test" tests: - sample.tfm.regression_lib_mode: - extra_args: CONFIG_TFM_IPC=n CONFIG_TFM_ISOLATION_LEVEL=1 + sample.tfm.regression: timeout: 200 - sample.tfm.regression_ipc_lvl1: - extra_args: CONFIG_TFM_IPC=y CONFIG_TFM_ISOLATION_LEVEL=1 - timeout: 200 - - sample.tfm.regression_ipc_lvl2: + sample.tfm.regression_ipc: + extra_args: CONFIG_TFM_IPC=y timeout: 200 From efdfe2345387ee73a1eacd36ad0f1d6e8f4e7fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 264/501] Revert "[nrf fromlist] tests: drivers: timer: Replace deprecated nrfx API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bba7a36d4d0cce0b3fbc575ffe6659410dec0e8f. Signed-off-by: Andrzej Głąbek --- tests/drivers/timer/nrf_rtc_timer/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/timer/nrf_rtc_timer/src/main.c b/tests/drivers/timer/nrf_rtc_timer/src/main.c index ab3adfc8cff..2d5c3dda20b 100644 --- a/tests/drivers/timer/nrf_rtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_rtc_timer/src/main.c @@ -31,7 +31,7 @@ static void init_zli_timer0(void) { nrf_timer_mode_set(NRF_TIMER0, NRF_TIMER_MODE_TIMER); nrf_timer_bit_width_set(NRF_TIMER0, NRF_TIMER_BIT_WIDTH_32); - nrf_timer_prescaler_set(NRF_TIMER0, NRF_TIMER_FREQ_1MHz); + nrf_timer_frequency_set(NRF_TIMER0, NRF_TIMER_FREQ_1MHz); nrf_timer_cc_set(NRF_TIMER0, 0, 100); nrf_timer_int_enable(NRF_TIMER0, NRF_TIMER_INT_COMPARE0_MASK); nrf_timer_shorts_enable(NRF_TIMER0, From b8875738bf7ed55722137f020671123e015d9360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 265/501] Revert "[nrf fromlist] drivers: Replace deprecated nrfx API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 53e1c84de8834d97a7e347b6e50631ff380b4c43. Signed-off-by: Andrzej Głąbek --- drivers/counter/counter_nrfx_timer.c | 2 +- drivers/display/display_nrf_led_matrix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/counter/counter_nrfx_timer.c b/drivers/counter/counter_nrfx_timer.c index 7668d90ff4b..72b7dfaf550 100644 --- a/drivers/counter/counter_nrfx_timer.c +++ b/drivers/counter/counter_nrfx_timer.c @@ -291,7 +291,7 @@ static int init_timer(const struct device *dev, nrf_timer_bit_width_set(reg, config->bit_width); nrf_timer_mode_set(reg, config->mode); - nrf_timer_prescaler_set(reg, config->freq); + nrf_timer_frequency_set(reg, config->freq); nrf_timer_cc_set(reg, TOP_CH, counter_get_max_top_value(dev)); diff --git a/drivers/display/display_nrf_led_matrix.c b/drivers/display/display_nrf_led_matrix.c index 6a65c280a2a..5ed40ef245e 100644 --- a/drivers/display/display_nrf_led_matrix.c +++ b/drivers/display/display_nrf_led_matrix.c @@ -509,7 +509,7 @@ static int instance_init(const struct device *dev) } nrf_timer_bit_width_set(dev_config->timer, NRF_TIMER_BIT_WIDTH_16); - nrf_timer_prescaler_set(dev_config->timer, TIMER_CLK_CONFIG); + nrf_timer_frequency_set(dev_config->timer, TIMER_CLK_CONFIG); nrf_timer_cc_set(dev_config->timer, 0, PIXEL_PERIOD); nrf_timer_shorts_set(dev_config->timer, NRF_TIMER_SHORT_COMPARE0_STOP_MASK | From 70b60688ec9ba98c2c38061a8c6891fe528fe367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 266/501] Revert "[nrf fromlist] Bluetooth: controller: Replace deprecated nrfx API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 817eb16bf17459b7cb4a4e4b272fa70a9414c8e9. Signed-off-by: Andrzej Głąbek --- .../controller/ll_sw/nordic/hal/nrf5/debug.h | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h index 4fa2e9d804a..e1ee04b7e4c 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h @@ -35,16 +35,16 @@ (defined(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP_NS) && defined(CONFIG_BUILD_WITH_TFM)) #define DEBUG_SETUP() \ do { \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX0, NRF_GPIO_PIN_SEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX1, NRF_GPIO_PIN_SEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX2, NRF_GPIO_PIN_SEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX3, NRF_GPIO_PIN_SEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX4, NRF_GPIO_PIN_SEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX5, NRF_GPIO_PIN_SEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX6, NRF_GPIO_PIN_SEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX7, NRF_GPIO_PIN_SEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX8, NRF_GPIO_PIN_SEL_NETWORK); \ - soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX9, NRF_GPIO_PIN_SEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX0, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX1, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX2, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX3, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX4, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX5, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX6, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX7, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX8, NRF_GPIO_PIN_MCUSEL_NETWORK); \ + soc_secure_gpio_pin_mcu_select(32 + DEBUG_PIN_IDX9, NRF_GPIO_PIN_MCUSEL_NETWORK); \ } while (0) #endif /* CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP */ #elif defined(CONFIG_BOARD_NRF52840DK_NRF52840) || \ From 86501c0bfcda7d9045b8bc2d97da186f5fb827d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 267/501] Revert "[nrf fromlist] soc: arm: nordic_nrf: Replace deprecated nrfx API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d349844584709f1a955e9eb913695e650bd28937. Signed-off-by: Andrzej Głąbek --- soc/arm/nordic_nrf/common/soc_secure.c | 6 +++--- soc/arm/nordic_nrf/common/soc_secure.h | 12 ++++++------ soc/arm/nordic_nrf/nrf53/soc.c | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/soc/arm/nordic_nrf/common/soc_secure.c b/soc/arm/nordic_nrf/common/soc_secure.c index 64d647f220a..4e087113f19 100644 --- a/soc/arm/nordic_nrf/common/soc_secure.c +++ b/soc/arm/nordic_nrf/common/soc_secure.c @@ -12,8 +12,8 @@ #include "tfm_platform_api.h" #include "tfm_ioctl_api.h" -#if NRF_GPIO_HAS_SEL -void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_sel_t mcu) +#if defined(GPIO_PIN_CNF_MCUSEL_Msk) +void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_mcusel_t mcu) { uint32_t result; enum tfm_platform_err_t err; @@ -22,7 +22,7 @@ void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_sel_t mcu) __ASSERT(err == TFM_PLATFORM_ERR_SUCCESS, "TFM platform error (%d)", err); __ASSERT(result == 0, "GPIO service error (%d)", result); } -#endif /* NRF_GPIO_HAS_SEL */ +#endif /* defined(GPIO_PIN_CNF_MCUSEL_Msk) */ int soc_secure_mem_read(void *dst, void *src, size_t len) { diff --git a/soc/arm/nordic_nrf/common/soc_secure.h b/soc/arm/nordic_nrf/common/soc_secure.h index 948f38547aa..33a1db7ead8 100644 --- a/soc/arm/nordic_nrf/common/soc_secure.h +++ b/soc/arm/nordic_nrf/common/soc_secure.h @@ -9,8 +9,8 @@ #include #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) -#if NRF_GPIO_HAS_SEL -void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_sel_t mcu); +#if defined(GPIO_PIN_CNF_MCUSEL_Msk) +void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, nrf_gpio_pin_mcusel_t mcu); #endif int soc_secure_mem_read(void *dst, void *src, size_t len); @@ -48,13 +48,13 @@ static inline int soc_secure_mem_read(void *dst, void *src, size_t len) return 0; } -#if NRF_GPIO_HAS_SEL +#if defined(GPIO_PIN_CNF_MCUSEL_Msk) static inline void soc_secure_gpio_pin_mcu_select(uint32_t pin_number, - nrf_gpio_pin_sel_t mcu) + nrf_gpio_pin_mcusel_t mcu) { - nrf_gpio_pin_control_select(pin_number, mcu); + nrf_gpio_pin_mcu_select(pin_number, mcu); } -#endif /* NRF_GPIO_HAS_SEL */ +#endif /* defined(GPIO_PIN_CNF_MCUSEL_Msk) */ #if defined(CONFIG_SOC_HFXO_CAP_INTERNAL) static inline uint32_t soc_secure_read_xosc32mtrim(void) diff --git a/soc/arm/nordic_nrf/nrf53/soc.c b/soc/arm/nordic_nrf/nrf53/soc.c index 28fdd56a343..b3a04e0ce6d 100644 --- a/soc/arm/nordic_nrf/nrf53/soc.c +++ b/soc/arm/nordic_nrf/nrf53/soc.c @@ -133,8 +133,8 @@ static int nordicsemi_nrf53_init(const struct device *arg) * This is handled by the TF-M platform so we skip it when TF-M is * enabled. */ - nrf_gpio_pin_control_select(PIN_XL1, NRF_GPIO_PIN_SEL_PERIPHERAL); - nrf_gpio_pin_control_select(PIN_XL2, NRF_GPIO_PIN_SEL_PERIPHERAL); + nrf_gpio_pin_mcu_select(PIN_XL1, NRF_GPIO_PIN_MCUSEL_PERIPHERAL); + nrf_gpio_pin_mcu_select(PIN_XL2, NRF_GPIO_PIN_MCUSEL_PERIPHERAL); #endif /* !defined(CONFIG_BUILD_WITH_TFM) */ #endif /* defined(CONFIG_SOC_ENABLE_LFXO) */ #if defined(CONFIG_SOC_HFXO_CAP_INTERNAL) @@ -175,7 +175,7 @@ static int nordicsemi_nrf53_init(const struct device *arg) }; for (int i = 0; i < ARRAY_SIZE(forwarded_psels); i++) { - soc_secure_gpio_pin_mcu_select(forwarded_psels[i], NRF_GPIO_PIN_SEL_NETWORK); + soc_secure_gpio_pin_mcu_select(forwarded_psels[i], NRF_GPIO_PIN_MCUSEL_NETWORK); } #endif From 0803d7b229bdcaf9097cd29927c1967c6ea08f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 268/501] Revert "[nrf fromlist] boards: arm: qemu_cortex_m0: Replace deprecated nrfx API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b8de4358154d1ca5dae7429b9addb2d625858a2e. Signed-off-by: Andrzej Głąbek --- boards/arm/qemu_cortex_m0/nrf_timer_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arm/qemu_cortex_m0/nrf_timer_timer.c b/boards/arm/qemu_cortex_m0/nrf_timer_timer.c index e135fc5d5e5..c727d75cd1d 100644 --- a/boards/arm/qemu_cortex_m0/nrf_timer_timer.c +++ b/boards/arm/qemu_cortex_m0/nrf_timer_timer.c @@ -236,7 +236,7 @@ static int sys_clock_driver_init(const struct device *dev) ARG_UNUSED(dev); /* FIXME switch to 1 MHz once this is fixed in QEMU */ - nrf_timer_prescaler_set(TIMER, NRF_TIMER_FREQ_2MHz); + nrf_timer_frequency_set(TIMER, NRF_TIMER_FREQ_2MHz); nrf_timer_bit_width_set(TIMER, NRF_TIMER_BIT_WIDTH_32); IRQ_CONNECT(TIMER0_IRQn, 1, timer0_nrf_isr, 0, 0); From 5526f2036ecf053c2b9581d6a2b4b8e28fda636e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 269/501] Revert "[nrf fromlist] net: dhcp: Add support for restarting DHCP" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 921e298da108373bc44e6a4edd360552ef0cafca. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/dhcpv4.h | 11 ----------- samples/net/wifi/prj.conf | 1 - subsys/net/ip/dhcpv4.c | 33 +++++++++++---------------------- 3 files changed, 11 insertions(+), 34 deletions(-) diff --git a/include/zephyr/net/dhcpv4.h b/include/zephyr/net/dhcpv4.h index 38033eb1ace..d2bba5d92ff 100644 --- a/include/zephyr/net/dhcpv4.h +++ b/include/zephyr/net/dhcpv4.h @@ -66,17 +66,6 @@ void net_dhcpv4_start(struct net_if *iface); */ void net_dhcpv4_stop(struct net_if *iface); -/** - * @brief Restart DHCPv4 client on an iface - * - * @details Restart DHCPv4 client on a given interface. DHCPv4 client - * will restart the state machine without any of the initial delays - * used in start. - * - * @param iface A valid pointer on an interface - */ -void net_dhcpv4_restart(struct net_if *iface); - /** @cond INTERNAL_HIDDEN */ /** diff --git a/samples/net/wifi/prj.conf b/samples/net/wifi/prj.conf index de7de625340..a901a38623b 100644 --- a/samples/net/wifi/prj.conf +++ b/samples/net/wifi/prj.conf @@ -11,7 +11,6 @@ CONFIG_NET_PKT_TX_COUNT=10 CONFIG_NET_BUF_RX_COUNT=20 CONFIG_NET_BUF_TX_COUNT=20 CONFIG_NET_MAX_CONTEXTS=10 -CONFIG_NET_DHCPV4=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=n diff --git a/subsys/net/ip/dhcpv4.c b/subsys/net/ip/dhcpv4.c index e4454184272..2188dd7461e 100644 --- a/subsys/net/ip/dhcpv4.c +++ b/subsys/net/ip/dhcpv4.c @@ -1139,10 +1139,10 @@ const char *net_dhcpv4_state_name(enum net_dhcpv4_state state) return name[state]; } -static void __net_dhcpv4_start(struct net_if *iface, bool first_start) +void net_dhcpv4_start(struct net_if *iface) { + uint32_t timeout; uint32_t entropy; - uint32_t timeout = 0; net_mgmt_event_notify(NET_EVENT_IPV4_DHCP_START, iface); @@ -1166,15 +1166,15 @@ static void __net_dhcpv4_start(struct net_if *iface, bool first_start) */ iface->config.dhcpv4.xid = entropy; - /* Use default */ - if (first_start) { - /* RFC2131 4.1.1 requires we wait a random period - * between 1 and 10 seconds before sending the initial - * discover. - */ - timeout = entropy % (CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX - - DHCPV4_INITIAL_DELAY_MIN) + DHCPV4_INITIAL_DELAY_MIN; - } + + /* RFC2131 4.1.1 requires we wait a random period + * between 1 and 10 seconds before sending the initial + * discover. + */ + timeout = entropy % + (CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX - + DHCPV4_INITIAL_DELAY_MIN) + + DHCPV4_INITIAL_DELAY_MIN; NET_DBG("wait timeout=%us", timeout); @@ -1200,11 +1200,6 @@ static void __net_dhcpv4_start(struct net_if *iface, bool first_start) k_mutex_unlock(&lock); } -void net_dhcpv4_start(struct net_if *iface) -{ - return __net_dhcpv4_start(iface, true); -} - void net_dhcpv4_stop(struct net_if *iface) { k_mutex_lock(&lock, K_FOREVER); @@ -1248,12 +1243,6 @@ void net_dhcpv4_stop(struct net_if *iface) k_mutex_unlock(&lock); } -void net_dhcpv4_restart(struct net_if *iface) -{ - net_dhcpv4_stop(iface); - __net_dhcpv4_start(iface, false); -} - int net_dhcpv4_init(void) { struct sockaddr local_addr; From 905322fafaa4a0266e1d07cb041d5d2825683192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 270/501] Revert "[nrf fromtree] Bluetooth: audio: ascs: Remove invalid check" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 28bc6ac6c7ae22ac58894f97d32bda3ab1e65914. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/audio/ascs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index 20784cf7fa6..0f4a8f50a0d 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -1646,7 +1646,12 @@ static int ascs_verify_metadata(const struct net_buf_simple *buf, return -EINVAL; } - return result.err; + if (result.count >= CONFIG_BT_CODEC_MAX_METADATA_COUNT) { + BT_ERR("No slot available for Codec Config Metadata"); + return -ENOMEM; + } + + return 0; } int ascs_ep_set_metadata(struct bt_audio_ep *ep, From 828bd62afe16d58e5641f56e4ec8c1214600c3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 271/501] Revert "[nrf fromtree] Bluetooth: audio: ascs: Fix missing metadata reset before update" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c409ab44c11817bf260b61cc3796b39855906dc7. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/audio/ascs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index 0f4a8f50a0d..5ff747499e2 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -1686,9 +1686,6 @@ int ascs_ep_set_metadata(struct bt_audio_ep *ep, return err; } - /* reset cached metadata */ - ep->codec.meta_count = 0; - /* store data contents */ bt_data_parse(&meta_ltv, ascs_codec_store_metadata, codec); From 3c59b32d07a147cdbf57e56b290dcc13d265319f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 272/501] Revert "[nrf fromlist] wifi_shell: Fix the duplicate tag CI warning" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 844626b2a458a07a1cdd3497fccf42d00a190ef7. Signed-off-by: Andrzej Głąbek --- subsys/net/l2/wifi/wifi_shell.c | 72 ++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 4db2bd0b939..53836ecd24e 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -32,7 +32,7 @@ LOG_MODULE_REGISTER(net_wifi_shell, LOG_LEVEL_INF); NET_EVENT_WIFI_DISCONNECT_RESULT) static struct { - const struct shell *sh; + const struct shell *shell; union { struct { @@ -49,10 +49,10 @@ static uint32_t scan_result; static struct net_mgmt_event_callback wifi_shell_mgmt_cb; -#define print(sh, level, fmt, ...) \ +#define print(shell, level, fmt, ...) \ do { \ - if (sh) { \ - shell_fprintf(sh, level, fmt, ##__VA_ARGS__); \ + if (shell) { \ + shell_fprintf(shell, level, fmt, ##__VA_ARGS__); \ } else { \ printk(fmt, ##__VA_ARGS__); \ } \ @@ -67,12 +67,12 @@ static void handle_wifi_scan_result(struct net_mgmt_event_callback *cb) scan_result++; if (scan_result == 1U) { - print(context.sh, SHELL_NORMAL, + print(context.shell, SHELL_NORMAL, "\n%-4s | %-32s %-5s | %-4s | %-4s | %-5s | %s\n", "Num", "SSID", "(len)", "Chan", "RSSI", "Sec", "MAC"); } - print(context.sh, SHELL_NORMAL, "%-4d | %-32s %-5u | %-4u | %-4d | %-5s | %s\n", + print(context.shell, SHELL_NORMAL, "%-4d | %-32s %-5u | %-4u | %-4d | %-5s | %s\n", scan_result, entry->ssid, entry->ssid_length, entry->channel, entry->rssi, wifi_security_txt(entry->security), ((entry->mac_length) ? @@ -86,10 +86,10 @@ static void handle_wifi_scan_done(struct net_mgmt_event_callback *cb) (const struct wifi_status *)cb->info; if (status->status) { - print(context.sh, SHELL_WARNING, + print(context.shell, SHELL_WARNING, "Scan request failed (%d)\n", status->status); } else { - print(context.sh, SHELL_NORMAL, "Scan request done\n"); + print(context.shell, SHELL_NORMAL, "Scan request done\n"); } scan_result = 0U; @@ -101,10 +101,10 @@ static void handle_wifi_connect_result(struct net_mgmt_event_callback *cb) (const struct wifi_status *) cb->info; if (status->status) { - print(context.sh, SHELL_WARNING, + print(context.shell, SHELL_WARNING, "Connection request failed (%d)\n", status->status); } else { - print(context.sh, SHELL_NORMAL, "Connected\n"); + print(context.shell, SHELL_NORMAL, "Connected\n"); } context.connecting = false; @@ -116,14 +116,14 @@ static void handle_wifi_disconnect_result(struct net_mgmt_event_callback *cb) (const struct wifi_status *) cb->info; if (context.disconnecting) { - print(context.sh, + print(context.shell, status->status ? SHELL_WARNING : SHELL_NORMAL, "Disconnection request %s (%d)\n", status->status ? "failed" : "done", status->status); context.disconnecting = false; } else { - print(context.sh, SHELL_NORMAL, "Disconnected\n"); + print(context.shell, SHELL_NORMAL, "Disconnected\n"); } } @@ -212,43 +212,43 @@ static int __wifi_args_to_params(size_t argc, char *argv[], return 0; } -static int cmd_wifi_connect(const struct shell *sh, size_t argc, +static int cmd_wifi_connect(const struct shell *shell, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); static struct wifi_connect_req_params cnx_params; if (__wifi_args_to_params(argc - 1, &argv[1], &cnx_params)) { - shell_help(sh); + shell_help(shell); return -ENOEXEC; } context.connecting = true; - context.sh = sh; + context.shell = shell; if (net_mgmt(NET_REQUEST_WIFI_CONNECT, iface, &cnx_params, sizeof(struct wifi_connect_req_params))) { - shell_fprintf(sh, SHELL_WARNING, + shell_fprintf(shell, SHELL_WARNING, "Connection request failed\n"); context.connecting = false; return -ENOEXEC; } else { - shell_fprintf(sh, SHELL_NORMAL, + shell_fprintf(shell, SHELL_NORMAL, "Connection requested\n"); } return 0; } -static int cmd_wifi_disconnect(const struct shell *sh, size_t argc, +static int cmd_wifi_disconnect(const struct shell *shell, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); int status; context.disconnecting = true; - context.sh = sh; + context.shell = shell; status = net_mgmt(NET_REQUEST_WIFI_DISCONNECT, iface, NULL, 0); @@ -256,33 +256,33 @@ static int cmd_wifi_disconnect(const struct shell *sh, size_t argc, context.disconnecting = false; if (status == -EALREADY) { - shell_fprintf(sh, SHELL_INFO, + shell_fprintf(shell, SHELL_INFO, "Already disconnected\n"); } else { - shell_fprintf(sh, SHELL_WARNING, + shell_fprintf(shell, SHELL_WARNING, "Disconnect request failed\n"); return -ENOEXEC; } } else { - shell_fprintf(sh, SHELL_NORMAL, + shell_fprintf(shell, SHELL_NORMAL, "Disconnect requested\n"); } return 0; } -static int cmd_wifi_scan(const struct shell *sh, size_t argc, char *argv[]) +static int cmd_wifi_scan(const struct shell *shell, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); - context.sh = sh; + context.shell = shell; if (net_mgmt(NET_REQUEST_WIFI_SCAN, iface, NULL, 0)) { - shell_fprintf(sh, SHELL_WARNING, "Scan request failed\n"); + shell_fprintf(shell, SHELL_WARNING, "Scan request failed\n"); return -ENOEXEC; } else { - shell_fprintf(sh, SHELL_NORMAL, "Scan requested\n"); + shell_fprintf(shell, SHELL_NORMAL, "Scan requested\n"); } return 0; @@ -293,7 +293,7 @@ static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) struct net_if *iface = net_if_get_default(); struct wifi_iface_status status = { 0 }; - context.sh = sh; + context.shell = sh; if (net_mgmt(NET_REQUEST_WIFI_IFACE_STATUS, iface, &status, sizeof(struct wifi_iface_status))) { @@ -382,41 +382,41 @@ static int cmd_wifi_stats(const struct shell *sh, size_t argc, char *argv[]) } -static int cmd_wifi_ap_enable(const struct shell *sh, size_t argc, +static int cmd_wifi_ap_enable(const struct shell *shell, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); static struct wifi_connect_req_params cnx_params; if (__wifi_args_to_params(argc - 1, &argv[1], &cnx_params)) { - shell_help(sh); + shell_help(shell); return -ENOEXEC; } - context.sh = sh; + context.shell = shell; if (net_mgmt(NET_REQUEST_WIFI_AP_ENABLE, iface, &cnx_params, sizeof(struct wifi_connect_req_params))) { - shell_fprintf(sh, SHELL_WARNING, "AP mode failed\n"); + shell_fprintf(shell, SHELL_WARNING, "AP mode failed\n"); return -ENOEXEC; } else { - shell_fprintf(sh, SHELL_NORMAL, "AP mode enabled\n"); + shell_fprintf(shell, SHELL_NORMAL, "AP mode enabled\n"); } return 0; } -static int cmd_wifi_ap_disable(const struct shell *sh, size_t argc, +static int cmd_wifi_ap_disable(const struct shell *shell, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_default(); if (net_mgmt(NET_REQUEST_WIFI_AP_DISABLE, iface, NULL, 0)) { - shell_fprintf(sh, SHELL_WARNING, "AP mode disable failed\n"); + shell_fprintf(shell, SHELL_WARNING, "AP mode disable failed\n"); return -ENOEXEC; } else { - shell_fprintf(sh, SHELL_NORMAL, "AP mode disabled\n"); + shell_fprintf(shell, SHELL_NORMAL, "AP mode disabled\n"); } return 0; @@ -455,7 +455,7 @@ static int wifi_shell_init(const struct device *unused) { ARG_UNUSED(unused); - context.sh = NULL; + context.shell = NULL; context.all = 0U; scan_result = 0U; From a6163c2ff0fb88d8497f7324e752ac95dba69eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 273/501] Revert "[nrf fromlist] wifi_shell: Rename Wifi to Wi-Fi" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 15ede93de267614adcd91db4aa342104d9880eba. Signed-off-by: Andrzej Głąbek --- subsys/net/l2/wifi/wifi_shell.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 53836ecd24e..b19277a0dae 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -440,16 +440,16 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, "0:None, 1:PSK, 2:PSK-256, 3:SAE" " Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 274/501] Revert "[nrf fromlist] wifi_mgmt: Add new API for Wi-Fi statistics" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6a2d869a06ce3eb990bfeb6333525b79023e105d. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/net_stats.h | 33 +--------------------- include/zephyr/net/wifi_mgmt.h | 3 -- subsys/net/ip/Kconfig.stats | 9 ------ subsys/net/l2/wifi/wifi_mgmt.c | 29 ------------------- subsys/net/l2/wifi/wifi_shell.c | 50 --------------------------------- 5 files changed, 1 insertion(+), 123 deletions(-) diff --git a/include/zephyr/net/net_stats.h b/include/zephyr/net/net_stats.h index 5344b246ac3..7ef17cfb1ef 100644 --- a/include/zephyr/net/net_stats.h +++ b/include/zephyr/net/net_stats.h @@ -472,29 +472,6 @@ struct net_stats_ppp { net_stats_t chkerr; }; -/** - * @brief All Wi-Fi management statistics - */ -struct net_stats_sta_mgmt { - /** Number of received beacons */ - net_stats_t beacons_rx; - - /** Number of missed beacons */ - net_stats_t beacons_miss; -}; - -/** - * @brief All Wi-Fi specific statistics - */ -struct net_stats_wifi { - struct net_stats_sta_mgmt sta_mgmt; - struct net_stats_bytes bytes; - struct net_stats_pkts pkts; - struct net_stats_pkts broadcast; - struct net_stats_pkts multicast; - struct net_stats_pkts errors; -}; - #if defined(CONFIG_NET_STATISTICS_USER_API) /* Management part definitions */ @@ -516,8 +493,7 @@ enum net_request_stats_cmd { NET_REQUEST_STATS_CMD_GET_TCP, NET_REQUEST_STATS_CMD_GET_ETHERNET, NET_REQUEST_STATS_CMD_GET_PPP, - NET_REQUEST_STATS_CMD_GET_PM, - NET_REQUEST_STATS_CMD_GET_WIFI, + NET_REQUEST_STATS_CMD_GET_PM }; #define NET_REQUEST_STATS_GET_ALL \ @@ -605,13 +581,6 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_STATS_GET_PPP); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_STATS_GET_PM); #endif /* CONFIG_NET_STATISTICS_POWER_MANAGEMENT */ -#if defined(CONFIG_NET_STATISTICS_WIFI) -#define NET_REQUEST_STATS_GET_WIFI \ - (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_WIFI) - -NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI); -#endif /* CONFIG_NET_STATISTICS_WIFI */ - /** * @} */ diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index ff42d7bfbf3..3721ed08d3b 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -174,9 +174,6 @@ struct net_wifi_mgmt_offload { struct wifi_connect_req_params *params); int (*ap_disable)(const struct device *dev); int (*iface_status)(const struct device *dev, struct wifi_iface_status *status); -#ifdef CONFIG_NET_STATISTICS_WIFI - int (*get_stats)(const struct device *dev, struct net_stats_wifi *stats); -#endif /* CONFIG_NET_STATISTICS_WIFI */ }; /* Make sure that the network interface API is properly setup inside diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 147b002d603..0f96f05cebe 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -125,13 +125,4 @@ config NET_STATISTICS_POWER_MANAGEMENT This will provide how many time a network interface went suspended, for how long the last time and on average. -config NET_STATISTICS_WIFI - bool "Wi-Fi statistics" - depends on NET_L2_WIFI_MGMT - default y - help - Keep track of Wi-Fi related statistics. Note that this - requires support from the Wi-Fi driver. The driver needs - to collect the statistics. - endif # NET_STATISTICS diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index db17f7f2521..3c21e9a527a 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -199,32 +199,3 @@ void wifi_mgmt_raise_iface_status_event(struct net_if *iface, iface, &iface_status, sizeof(struct wifi_iface_status)); } - -#ifdef CONFIG_NET_STATISTICS_WIFI -static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, - void *data, size_t len) -{ - int ret; - const struct device *dev = net_if_get_device(iface); - struct net_wifi_mgmt_offload *off_api = - (struct net_wifi_mgmt_offload *) dev->api; - struct net_stats_wifi *stats = data; - - if (off_api == NULL || off_api->get_stats == NULL) { - return -ENOTSUP; - } - - if (!data || len != sizeof(*stats)) { - return -EINVAL; - } - - ret = off_api->get_stats(dev, stats); - - if (ret) { - return ret; - } - - return 0; -} -NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats); -#endif /* CONFIG_NET_STATISTICS_WIFI */ diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index b19277a0dae..870266f70be 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -333,55 +333,6 @@ static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) return 0; } - -#if defined(CONFIG_NET_STATISTICS_WIFI) && \ - defined(CONFIG_NET_STATISTICS_USER_API) -static void print_wifi_stats(struct net_if *iface, struct net_stats_wifi *data, - const struct shell *sh) -{ - shell_fprintf(sh, SHELL_NORMAL, "Statistics for Wi-Fi interface %p [%d]\n", iface, - net_if_get_by_iface(iface)); - - shell_fprintf(sh, SHELL_NORMAL, "Bytes received : %u\n", data->bytes.received); - shell_fprintf(sh, SHELL_NORMAL, "Bytes sent : %u\n", data->bytes.sent); - shell_fprintf(sh, SHELL_NORMAL, "Packets received : %u\n", data->pkts.rx); - shell_fprintf(sh, SHELL_NORMAL, "Packets sent : %u\n", data->pkts.tx); - shell_fprintf(sh, SHELL_NORMAL, "Bcast received : %u\n", data->broadcast.rx); - shell_fprintf(sh, SHELL_NORMAL, "Bcast sent : %u\n", data->broadcast.tx); - shell_fprintf(sh, SHELL_NORMAL, "Mcast received : %u\n", data->multicast.rx); - shell_fprintf(sh, SHELL_NORMAL, "Mcast sent : %u\n", data->multicast.tx); - shell_fprintf(sh, SHELL_NORMAL, "Beacons received : %u\n", data->sta_mgmt.beacons_rx); - shell_fprintf(sh, SHELL_NORMAL, "Beacons missed : %u\n", - data->sta_mgmt.beacons_miss); -} -#endif /* CONFIG_NET_STATISTICS_WIFI && CONFIG_NET_STATISTICS_USER_API */ - -static int cmd_wifi_stats(const struct shell *sh, size_t argc, char *argv[]) -{ -#if defined(CONFIG_NET_STATISTICS_WIFI) && \ - defined(CONFIG_NET_STATISTICS_USER_API) - struct net_if *iface = net_if_get_default(); - struct net_stats_wifi stats = { 0 }; - int ret; - - ret = net_mgmt(NET_REQUEST_STATS_GET_WIFI, iface, - &stats, sizeof(stats)); - if (!ret) { - print_wifi_stats(iface, &stats, sh); - } -#else - ARG_UNUSED(argc); - ARG_UNUSED(argv); - - shell_fprintf(sh, SHELL_INFO, "Set %s to enable %s support.\n", - "CONFIG_NET_STATISTICS_WIFI and CONFIG_NET_STATISTICS_USER_API", - "statistics"); -#endif /* CONFIG_NET_STATISTICS_WIFI && CONFIG_NET_STATISTICS_USER_API */ - - return 0; -} - - static int cmd_wifi_ap_enable(const struct shell *shell, size_t argc, char *argv[]) { @@ -444,7 +395,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, cmd_wifi_disconnect), SHELL_CMD(scan, NULL, "Scan Wifi AP", cmd_wifi_scan), SHELL_CMD(status, NULL, "Status of Wi-Fi interface", cmd_wifi_status), - SHELL_CMD(statistics, NULL, "Wi-Fi statistics", cmd_wifi_stats), SHELL_CMD(ap, &wifi_cmd_ap, "Access Point mode commands", NULL), SHELL_SUBCMD_SET_END ); From aeb966202cad03033fd55b3f296f7da88504f556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 275/501] Revert "[nrf fromlist] wifi_shell: Add new security methods" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6f37d3654453b1484fcf9b3435c3159ac8f92784. Signed-off-by: Andrzej Głąbek --- subsys/net/l2/wifi/wifi_shell.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 870266f70be..ce26a68f670 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -74,7 +74,7 @@ static void handle_wifi_scan_result(struct net_mgmt_event_callback *cb) print(context.shell, SHELL_NORMAL, "%-4d | %-32s %-5u | %-4u | %-4d | %-5s | %s\n", scan_result, entry->ssid, entry->ssid_length, entry->channel, entry->rssi, - wifi_security_txt(entry->security), + (entry->security == WIFI_SECURITY_TYPE_PSK ? "WPA/WPA2" : "Open "), ((entry->mac_length) ? net_sprint_ll_addr_buf(entry->mac, WIFI_MAC_ADDR_LEN, mac_string_buf, sizeof(mac_string_buf)) : "")); @@ -183,32 +183,10 @@ static int __wifi_args_to_params(size_t argc, char *argv[], params->psk = argv[idx]; params->psk_length = strlen(argv[idx]); params->security = WIFI_SECURITY_TYPE_PSK; - idx++; - - /* Security type (optional) */ - if (idx < argc) { - unsigned int security = strtol(argv[idx], &endptr, 10); - - if (security <= WIFI_SECURITY_TYPE_MAX) { - params->security = security; - } - idx++; - } } else { params->security = WIFI_SECURITY_TYPE_NONE; } - /* MFP (optional) */ - params->mfp = WIFI_MFP_OPTIONAL; - if (idx < argc) { - unsigned int mfp = strtol(argv[idx], &endptr, 10); - - if (mfp <= WIFI_MFP_REQUIRED) { - params->mfp = mfp; - } - idx++; - } - return 0; } @@ -387,9 +365,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, "\"\"\n\n" "" - "" - "0:None, 1:PSK, 2:PSK-256, 3:SAE" - " Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 276/501] Revert "[nrf fromlist] wifi_mgmt: Add new API for Wi-Fi status" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7f08e4d8fd7da0e1a81ecce341134895e584df20. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/wifi.h | 191 -------------------------------- include/zephyr/net/wifi_mgmt.h | 28 +---- subsys/net/l2/wifi/wifi_mgmt.c | 35 ------ subsys/net/l2/wifi/wifi_shell.c | 48 +------- 4 files changed, 2 insertions(+), 300 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index e6107bef556..a58d41e17a9 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -26,26 +26,6 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_UNKNOWN }; -/** - * wifi_security_txt - Get the security type as a text string - */ -static inline const char *wifi_security_txt(enum wifi_security_type security) -{ - switch (security) { - case WIFI_SECURITY_TYPE_NONE: - return "OPEN"; - case WIFI_SECURITY_TYPE_PSK: - return "WPA2-PSK"; - case WIFI_SECURITY_TYPE_PSK_SHA256: - return "WPA2-PSK-SHA256"; - case WIFI_SECURITY_TYPE_SAE: - return "WPA3-SAE"; - case WIFI_SECURITY_TYPE_UNKNOWN: - default: - return "UNKNOWN"; - } -} - /* Management frame protection (IEEE 802.11w) options */ enum wifi_mfp_options { WIFI_MFP_DISABLE = 0, @@ -57,24 +37,6 @@ enum wifi_mfp_options { WIFI_MFP_UNKNOWN }; -/** - * wifi_mfp_txt - Get the MFP as a text string - */ -static inline const char *wifi_mfp_txt(enum wifi_mfp_options mfp) -{ - switch (mfp) { - case WIFI_MFP_DISABLE: - return "Disable"; - case WIFI_MFP_OPTIONAL: - return "Optional"; - case WIFI_MFP_REQUIRED: - return "Required"; - case WIFI_MFP_UNKNOWN: - default: - return "UNKNOWN"; - } -} - enum wifi_frequency_bands { WIFI_FREQ_BAND_2_4_GHZ = 0, WIFI_FREQ_BAND_5_GHZ, @@ -85,24 +47,6 @@ enum wifi_frequency_bands { WIFI_FREQ_BAND_UNKNOWN }; -/** - * wifi_mode_txt - Get the interface mode type as a text string - */ -static inline const char *wifi_band_txt(enum wifi_frequency_bands band) -{ - switch (band) { - case WIFI_FREQ_BAND_2_4_GHZ: - return "2.4GHz"; - case WIFI_FREQ_BAND_5_GHZ: - return "5GHz"; - case WIFI_FREQ_BAND_6_GHZ: - return "6GHz"; - case WIFI_FREQ_BAND_UNKNOWN: - default: - return "UNKNOWN"; - } -} - #define WIFI_SSID_MAX_LEN 32 #define WIFI_PSK_MAX_LEN 64 #define WIFI_MAC_ADDR_LEN 6 @@ -110,139 +54,4 @@ static inline const char *wifi_band_txt(enum wifi_frequency_bands band) #define WIFI_CHANNEL_MAX 233 #define WIFI_CHANNEL_ANY 255 -/* Based on https://w1.fi/wpa_supplicant/devel/defs_8h.html#a4aeb27c1e4abd046df3064ea9756f0bc */ -enum wifi_iface_state { - WIFI_STATE_DISCONNECTED = 0, - WIFI_STATE_INTERFACE_DISABLED, - WIFI_STATE_INACTIVE, - WIFI_STATE_SCANNING, - WIFI_STATE_AUTHENTICATING, - WIFI_STATE_ASSOCIATING, - WIFI_STATE_ASSOCIATED, - WIFI_STATE_4WAY_HANDSHAKE, - WIFI_STATE_GROUP_HANDSHAKE, - WIFI_STATE_COMPLETED, - - __WIFI_STATE_AFTER_LAST, - WIFI_STATE_MAX = __WIFI_STATE_AFTER_LAST - 1, - WIFI_STATE_UNKNOWN -}; - -/** - * wifi_state_txt - Get the connection state name as a text string - */ -static inline const char *wifi_state_txt(enum wifi_iface_state state) -{ - switch (state) { - case WIFI_STATE_DISCONNECTED: - return "DISCONNECTED"; - case WIFI_STATE_INACTIVE: - return "INACTIVE"; - case WIFI_STATE_INTERFACE_DISABLED: - return "INTERFACE_DISABLED"; - case WIFI_STATE_SCANNING: - return "SCANNING"; - case WIFI_STATE_AUTHENTICATING: - return "AUTHENTICATING"; - case WIFI_STATE_ASSOCIATING: - return "ASSOCIATING"; - case WIFI_STATE_ASSOCIATED: - return "ASSOCIATED"; - case WIFI_STATE_4WAY_HANDSHAKE: - return "4WAY_HANDSHAKE"; - case WIFI_STATE_GROUP_HANDSHAKE: - return "GROUP_HANDSHAKE"; - case WIFI_STATE_COMPLETED: - return "COMPLETED"; - case WIFI_STATE_UNKNOWN: - default: - return "UNKNOWN"; - } -} - -/* Based on https://w1.fi/wpa_supplicant/devel/structwpa__ssid.html#a625821e2acfc9014f3b3de6e6593ffb7 */ -enum wifi_iface_mode { - WIFI_MODE_INFRA = 0, - WIFI_MODE_IBSS = 1, - WIFI_MODE_AP = 2, - WIFI_MODE_P2P_GO = 3, - WIFI_MODE_P2P_GROUP_FORMATION = 4, - WIFI_MODE_MESH = 5, - - __WIFI_MODE_AFTER_LAST, - WIFI_MODE_MAX = __WIFI_MODE_AFTER_LAST - 1, - WIFI_MODE_UNKNOWN -}; - -/** - * wifi_mode_txt - Get the interface mode type as a text string - */ -static inline const char *wifi_mode_txt(enum wifi_iface_mode mode) -{ - switch (mode) { - case WIFI_MODE_INFRA: - return "STATION"; - case WIFI_MODE_IBSS: - return "ADHOC"; - case WIFI_MODE_AP: - return "ACCESS POINT"; - case WIFI_MODE_P2P_GO: - return "P2P GROUP OWNER"; - case WIFI_MODE_P2P_GROUP_FORMATION: - return "P2P GROUP FORMATION"; - case WIFI_MODE_MESH: - return "MESH"; - case WIFI_MODE_UNKNOWN: - default: - return "UNKNOWN"; - } -} - -/* As per https://en.wikipedia.org/wiki/Wi-Fi#Versions_and_generations */ -enum wifi_link_mode { - WIFI_0 = 0, - WIFI_1, - WIFI_2, - WIFI_3, - WIFI_4, - WIFI_5, - WIFI_6, - WIFI_6E, - WIFI_7, - - __WIFI_LINK_MODE_AFTER_LAST, - WIFI_LINK_MODE_MAX = __WIFI_LINK_MODE_AFTER_LAST - 1, - WIFI_LINK_MODE_UNKNOWN -}; - -/** - * wifi_link_mode_txt - Get the link mode type as a text string - */ -static inline const char *wifi_link_mode_txt(enum wifi_link_mode link_mode) -{ - switch (link_mode) { - case WIFI_0: - return "WIFI 0 (802.11)"; - case WIFI_1: - return "WIFI 1 (802.11b)"; - case WIFI_2: - return "WIFI 2 (802.11a)"; - case WIFI_3: - return "WIFI 3 (802.11g)"; - case WIFI_4: - return "WIFI 4 (802.11n/HT)"; - case WIFI_5: - return "WIFI 5 (802.11ac/VHT)"; - case WIFI_6: - return "WIFI 6 (802.11ax/HE)"; - case WIFI_6E: - return "WIFI 6E (802.11ax 6GHz/HE)"; - case WIFI_7: - return "WIFI 7 (802.11be/EHT)"; - case WIFI_LINK_MODE_UNKNOWN: - default: - return "UNKNOWN"; - } -} - #endif /* ZEPHYR_INCLUDE_NET_WIFI_H_ */ diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 3721ed08d3b..84760820f6b 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -35,7 +35,6 @@ enum net_request_wifi_cmd { NET_REQUEST_WIFI_CMD_DISCONNECT, NET_REQUEST_WIFI_CMD_AP_ENABLE, NET_REQUEST_WIFI_CMD_AP_DISABLE, - NET_REQUEST_WIFI_CMD_IFACE_STATUS, }; #define NET_REQUEST_WIFI_SCAN \ @@ -63,17 +62,11 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_ENABLE); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE); -#define NET_REQUEST_WIFI_IFACE_STATUS \ - (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_IFACE_STATUS) - -NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS); - enum net_event_wifi_cmd { NET_EVENT_WIFI_CMD_SCAN_RESULT = 1, NET_EVENT_WIFI_CMD_SCAN_DONE, NET_EVENT_WIFI_CMD_CONNECT_RESULT, NET_EVENT_WIFI_CMD_DISCONNECT_RESULT, - NET_EVENT_WIFI_CMD_IFACE_STATUS, }; #define NET_EVENT_WIFI_SCAN_RESULT \ @@ -88,9 +81,6 @@ enum net_event_wifi_cmd { #define NET_EVENT_WIFI_DISCONNECT_RESULT \ (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_RESULT) -#define NET_EVENT_WIFI_IFACE_STATUS \ - (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_IFACE_STATUS) - /* Each result is provided to the net_mgmt_event_callback * via its info attribute (see net_mgmt.h) @@ -130,20 +120,6 @@ struct wifi_status { int status; }; -struct wifi_iface_status { - int state; /* enum wifi_iface_state */ - unsigned int ssid_len; - char ssid[WIFI_SSID_MAX_LEN]; - char bssid[WIFI_MAC_ADDR_LEN]; - enum wifi_frequency_bands band; - unsigned int channel; - enum wifi_iface_mode iface_mode; - enum wifi_link_mode link_mode; - enum wifi_security_type security; - enum wifi_mfp_options mfp; - int rssi; -}; - #include typedef void (*scan_result_cb_t)(struct net_if *iface, int status, @@ -173,7 +149,6 @@ struct net_wifi_mgmt_offload { int (*ap_enable)(const struct device *dev, struct wifi_connect_req_params *params); int (*ap_disable)(const struct device *dev); - int (*iface_status)(const struct device *dev, struct wifi_iface_status *status); }; /* Make sure that the network interface API is properly setup inside @@ -183,8 +158,7 @@ BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, wifi_iface) == 0); void wifi_mgmt_raise_connect_result_event(struct net_if *iface, int status); void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status); -void wifi_mgmt_raise_iface_status_event(struct net_if *iface, - struct wifi_iface_status *iface_status); + #ifdef __cplusplus } #endif diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 3c21e9a527a..d2df054dc5e 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -164,38 +164,3 @@ static int wifi_ap_disable(uint32_t mgmt_request, struct net_if *iface, } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE, wifi_ap_disable); - -static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface, - void *data, size_t len) -{ - int ret; - const struct device *dev = net_if_get_device(iface); - struct net_wifi_mgmt_offload *off_api = - (struct net_wifi_mgmt_offload *) dev->api; - struct wifi_iface_status *status = data; - - if (off_api == NULL || off_api->iface_status == NULL) { - return -ENOTSUP; - } - - if (!data || len != sizeof(*status)) { - return -EINVAL; - } - - ret = off_api->iface_status(dev, status); - - if (ret) { - return ret; - } - - return 0; -} -NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS, wifi_iface_status); - -void wifi_mgmt_raise_iface_status_event(struct net_if *iface, - struct wifi_iface_status *iface_status) -{ - net_mgmt_event_notify_with_info(NET_EVENT_WIFI_IFACE_STATUS, - iface, &iface_status, - sizeof(struct wifi_iface_status)); -} diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index ce26a68f670..c380ef2f46e 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -266,51 +266,6 @@ static int cmd_wifi_scan(const struct shell *shell, size_t argc, char *argv[]) return 0; } -static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = net_if_get_default(); - struct wifi_iface_status status = { 0 }; - - context.shell = sh; - - if (net_mgmt(NET_REQUEST_WIFI_IFACE_STATUS, iface, &status, - sizeof(struct wifi_iface_status))) { - shell_fprintf(sh, SHELL_WARNING, "Status request failed\n"); - - return -ENOEXEC; - } - - shell_fprintf(sh, SHELL_NORMAL, "Status: successful\n"); - shell_fprintf(sh, SHELL_NORMAL, "==================\n"); - shell_fprintf(sh, SHELL_NORMAL, "State: %s\n", wifi_state_txt(status.state)); - - if (status.state >= WIFI_STATE_ASSOCIATED) { - uint8_t mac_string_buf[sizeof("xx:xx:xx:xx:xx:xx")]; - - shell_fprintf(sh, SHELL_NORMAL, "Interface Mode: %s\n", - wifi_mode_txt(status.iface_mode)); - shell_fprintf(sh, SHELL_NORMAL, "Link Mode: %s\n", - wifi_link_mode_txt(status.link_mode)); - shell_fprintf(sh, SHELL_NORMAL, "SSID: %-32s\n", status.ssid); - shell_fprintf(sh, SHELL_NORMAL, "BSSID: %s\n", - status.bssid ? net_sprint_ll_addr_buf(status.bssid, - WIFI_MAC_ADDR_LEN, mac_string_buf, - sizeof(mac_string_buf)) : - ""); - shell_fprintf(sh, SHELL_NORMAL, "Band: %s\n", - wifi_band_txt(status.band)); - shell_fprintf(sh, SHELL_NORMAL, "Channel: %d\n", status.channel); - shell_fprintf(sh, SHELL_NORMAL, "Security: %s\n", - wifi_security_txt(status.security)); - shell_fprintf(sh, SHELL_NORMAL, "MFP: %s\n", - wifi_mfp_txt(status.mfp)); - shell_fprintf(sh, SHELL_NORMAL, "RSSI: %d\n", status.rssi); - } - - - return 0; -} - static int cmd_wifi_ap_enable(const struct shell *shell, size_t argc, char *argv[]) { @@ -364,12 +319,11 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, SHELL_CMD(connect, NULL, "\"\"\n\n" - "" + "", cmd_wifi_connect), SHELL_CMD(disconnect, NULL, "Disconnect from Wifi AP", cmd_wifi_disconnect), SHELL_CMD(scan, NULL, "Scan Wifi AP", cmd_wifi_scan), - SHELL_CMD(status, NULL, "Status of Wi-Fi interface", cmd_wifi_status), SHELL_CMD(ap, &wifi_cmd_ap, "Access Point mode commands", NULL), SHELL_SUBCMD_SET_END ); From aaac0400e7860be65d09b26ac9f98c3212621209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 277/501] Revert "[nrf fromlist] wifi_mgmt: Add a comment for legacy types" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a9f27789f0509bf41af0e57d944fd0c921f4c111. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/wifi.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index a58d41e17a9..cf55d803fc7 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -12,9 +12,6 @@ #ifndef ZEPHYR_INCLUDE_NET_WIFI_H_ #define ZEPHYR_INCLUDE_NET_WIFI_H_ -/* Not having support for legacy types is deliberate to enforce - * higher security. - */ enum wifi_security_type { WIFI_SECURITY_TYPE_NONE = 0, WIFI_SECURITY_TYPE_PSK, From e9d8d51b83d879cc286357314d185db5b0ccc7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 278/501] Revert "[nrf fromlist] wifi_mgmt: Add support for connection timeout" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4fe409646082c0f8c9c73703acc28f1e95ef08c8. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/wifi_mgmt.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 84760820f6b..d9325edc221 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -113,7 +113,6 @@ struct wifi_connect_req_params { uint8_t channel; enum wifi_security_type security; enum wifi_mfp_options mfp; - int timeout; /* SYS_FOREVER_MS for no timeout */ }; struct wifi_status { From 8bdcf08e1c9f71c45e8c7cc3994388aaa6412248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 279/501] Revert "[nrf fromlist] wifi_mgmt: Extend enumerations to include MAX and UNKNOWN" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 28394e913a071a4c413a0a2c358ba88a0b910345. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/wifi.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index cf55d803fc7..1063b778d13 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -19,29 +19,20 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_SAE, __WIFI_SECURITY_TYPE_AFTER_LAST, - WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1, - WIFI_SECURITY_TYPE_UNKNOWN + WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1 }; /* Management frame protection (IEEE 802.11w) options */ enum wifi_mfp_options { WIFI_MFP_DISABLE = 0, WIFI_MFP_OPTIONAL, - WIFI_MFP_REQUIRED, - - __WIFI_MFP_AFTER_LAST, - WIFI_MFP_MAX = __WIFI_MFP_AFTER_LAST - 1, - WIFI_MFP_UNKNOWN + WIFI_MFP_REQUIRED }; enum wifi_frequency_bands { WIFI_FREQ_BAND_2_4_GHZ = 0, WIFI_FREQ_BAND_5_GHZ, - WIFI_FREQ_BAND_6_GHZ, - - __WIFI_FREQ_BAND_AFTER_LAST, - WIFI_FREQ_BAND_MAX = __WIFI_FREQ_BAND_AFTER_LAST - 1, - WIFI_FREQ_BAND_UNKNOWN + WIFI_FREQ_BAND_6_GHZ }; #define WIFI_SSID_MAX_LEN 32 From 10293ca9654cdeb0b73df8e63331e23a01a20c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 280/501] Revert "[nrf fromlist] wifi_mgmt: Implement checks for new security types" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a4c7ed4c1f44164ac6a699c47dad8f86af5e233c. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/wifi.h | 5 +---- subsys/net/l2/wifi/wifi_mgmt.c | 11 ++--------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index 1063b778d13..cc8224763be 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -16,10 +16,7 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_NONE = 0, WIFI_SECURITY_TYPE_PSK, WIFI_SECURITY_TYPE_PSK_SHA256, - WIFI_SECURITY_TYPE_SAE, - - __WIFI_SECURITY_TYPE_AFTER_LAST, - WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1 + WIFI_SECURITY_TYPE_SAE }; /* Management frame protection (IEEE 802.11w) options */ diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index d2df054dc5e..be358060b29 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -28,21 +28,14 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, LOG_HEXDUMP_DBG(params->ssid, params->ssid_length, "ssid"); LOG_HEXDUMP_DBG(params->psk, params->psk_length, "psk"); - if (params->sae_password) { - LOG_HEXDUMP_DBG(params->sae_password, params->sae_password_length, "sae"); - } NET_DBG("ch %u sec %u", params->channel, params->security); - if ((params->security > WIFI_SECURITY_TYPE_MAX) || + if ((params->security > WIFI_SECURITY_TYPE_PSK) || (params->ssid_length > WIFI_SSID_MAX_LEN) || (params->ssid_length == 0U) || - ((params->security == WIFI_SECURITY_TYPE_PSK || - params->security == WIFI_SECURITY_TYPE_PSK_SHA256) && + ((params->security == WIFI_SECURITY_TYPE_PSK) && ((params->psk_length < 8) || (params->psk_length > 64) || (params->psk_length == 0U) || !params->psk)) || - ((params->security == WIFI_SECURITY_TYPE_SAE) && - ((params->psk_length == 0U) || !params->psk) && - ((params->sae_password_length == 0U) || !params->sae_password)) || ((params->channel != WIFI_CHANNEL_ANY) && (params->channel > WIFI_CHANNEL_MAX)) || !params->ssid) { From b6d51c85151d1497fa9062ce7a60ef52d5dc7447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 281/501] Revert "[nrf fromtree] net: wifi: Allow to use offloaded wifi_mgmt API with native stack" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e4b34aa4b5a562e84cf9c944de62d6e4f02936b. Signed-off-by: Andrzej Głąbek --- drivers/wifi/Kconfig | 6 ------ drivers/wifi/esp32/Kconfig.esp32 | 1 - drivers/wifi/esp32/src/esp_wifi_drv.c | 14 +++++++------- drivers/wifi/esp_at/esp.c | 2 +- drivers/wifi/eswifi/eswifi_core.c | 2 +- drivers/wifi/simplelink/simplelink.c | 2 +- drivers/wifi/winc1500/wifi_winc1500.c | 2 +- include/zephyr/net/wifi_mgmt.h | 13 ++++++------- 8 files changed, 17 insertions(+), 25 deletions(-) diff --git a/drivers/wifi/Kconfig b/drivers/wifi/Kconfig index ea6245b33b1..5e1975740aa 100644 --- a/drivers/wifi/Kconfig +++ b/drivers/wifi/Kconfig @@ -29,12 +29,6 @@ config WIFI_OFFLOAD help Enable support for Full-MAC Wi-Fi devices. -config WIFI_USE_NATIVE_NETWORKING - bool - help - When selected, this hidden configuration enables Wi-Fi driver - to use native ethernet stack interface. - source "drivers/wifi/winc1500/Kconfig.winc1500" source "drivers/wifi/simplelink/Kconfig.simplelink" source "drivers/wifi/eswifi/Kconfig.eswifi" diff --git a/drivers/wifi/esp32/Kconfig.esp32 b/drivers/wifi/esp32/Kconfig.esp32 index 65c544db048..7434fde498f 100644 --- a/drivers/wifi/esp32/Kconfig.esp32 +++ b/drivers/wifi/esp32/Kconfig.esp32 @@ -4,7 +4,6 @@ menuconfig WIFI_ESP32 bool "ESP32 SoC WiFi support" depends on !SMP select THREAD_CUSTOM_DATA - select WIFI_USE_NATIVE_NETWORKING help Enable ESP32 SoC WiFi support. Only supported in single core mode because the network stack is not aware of SMP diff --git a/drivers/wifi/esp32/src/esp_wifi_drv.c b/drivers/wifi/esp32/src/esp_wifi_drv.c index cf3597befd5..15af68ee360 100644 --- a/drivers/wifi/esp32/src/esp_wifi_drv.c +++ b/drivers/wifi/esp32/src/esp_wifi_drv.c @@ -12,7 +12,6 @@ LOG_MODULE_REGISTER(esp32_wifi, CONFIG_WIFI_LOG_LEVEL); #include #include #include -#include #include #include #include @@ -221,18 +220,19 @@ static int eth_esp32_dev_init(const struct device *dev) return ret; } + static struct esp32_wifi_runtime eth_data; -static const struct net_wifi_mgmt_offload esp32_api = { - .wifi_iface.iface_api.init = eth_esp32_init, - .wifi_iface.send = eth_esp32_send, +static const struct ethernet_api eth_esp32_apis = { + .iface_api.init = eth_esp32_init, + .send = eth_esp32_send, #if defined(CONFIG_NET_STATISTICS_ETHERNET) - .wifi_iface.get_stats = eth_esp32_stats, - #endif + .get_stats = eth_esp32_stats, +#endif }; NET_DEVICE_DT_INST_DEFINE(0, eth_esp32_dev_init, NULL, ð_data, NULL, CONFIG_ETH_INIT_PRIORITY, - &esp32_api, ETHERNET_L2, + ð_esp32_apis, ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU); diff --git a/drivers/wifi/esp_at/esp.c b/drivers/wifi/esp_at/esp.c index 3987df6a33c..84a394a9b2c 100644 --- a/drivers/wifi/esp_at/esp.c +++ b/drivers/wifi/esp_at/esp.c @@ -1088,7 +1088,7 @@ static void esp_iface_init(struct net_if *iface) } static const struct net_wifi_mgmt_offload esp_api = { - .wifi_iface.init = esp_iface_init, + .iface_api.init = esp_iface_init, .scan = esp_mgmt_scan, .connect = esp_mgmt_connect, .disconnect = esp_mgmt_disconnect, diff --git a/drivers/wifi/eswifi/eswifi_core.c b/drivers/wifi/eswifi/eswifi_core.c index b6960ffd8cd..228aceda0b1 100644 --- a/drivers/wifi/eswifi/eswifi_core.c +++ b/drivers/wifi/eswifi/eswifi_core.c @@ -679,7 +679,7 @@ static int eswifi_init(const struct device *dev) } static const struct net_wifi_mgmt_offload eswifi_offload_api = { - .wifi_iface.init = eswifi_iface_init, + .iface_api.init = eswifi_iface_init, .scan = eswifi_mgmt_scan, .connect = eswifi_mgmt_connect, .disconnect = eswifi_mgmt_disconnect, diff --git a/drivers/wifi/simplelink/simplelink.c b/drivers/wifi/simplelink/simplelink.c index a60ac990b63..26dd57034d4 100644 --- a/drivers/wifi/simplelink/simplelink.c +++ b/drivers/wifi/simplelink/simplelink.c @@ -264,7 +264,7 @@ static void simplelink_iface_init(struct net_if *iface) } static const struct net_wifi_mgmt_offload simplelink_api = { - .wifi_iface.init = simplelink_iface_init, + .iface_api.init = simplelink_iface_init, .scan = simplelink_mgmt_scan, .connect = simplelink_mgmt_connect, .disconnect = simplelink_mgmt_disconnect, diff --git a/drivers/wifi/winc1500/wifi_winc1500.c b/drivers/wifi/winc1500/wifi_winc1500.c index 94049a9ab6f..404220e0e5a 100644 --- a/drivers/wifi/winc1500/wifi_winc1500.c +++ b/drivers/wifi/winc1500/wifi_winc1500.c @@ -1100,7 +1100,7 @@ static void winc1500_iface_init(struct net_if *iface) } static const struct net_wifi_mgmt_offload winc1500_api = { - .wifi_iface.init = winc1500_iface_init, + .iface_api.init = winc1500_iface_init, .scan = winc1500_mgmt_scan, .connect = winc1500_mgmt_connect, .disconnect = winc1500_mgmt_disconnect, diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index d9325edc221..efe3b6e9b01 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -14,7 +14,6 @@ #include #include -#include #ifdef __cplusplus extern "C" { @@ -131,11 +130,7 @@ struct net_wifi_mgmt_offload { * net_if_api structure. So we make current structure pointer * that can be casted to a net_if_api structure pointer. */ -#ifdef CONFIG_WIFI_USE_NATIVE_NETWORKING - struct ethernet_api wifi_iface; -#else - struct net_if_api wifi_iface; -#endif + struct net_if_api iface_api; /* cb parameter is the cb that should be called for each * result by the driver. The wifi mgmt part will take care of @@ -153,11 +148,15 @@ struct net_wifi_mgmt_offload { /* Make sure that the network interface API is properly setup inside * Wifi mgmt offload API struct (it is the first one). */ -BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, wifi_iface) == 0); +BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, iface_api) == 0); + +#ifdef CONFIG_WIFI_OFFLOAD void wifi_mgmt_raise_connect_result_event(struct net_if *iface, int status); void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status); +#endif /* CONFIG_WIFI_OFFLOAD */ + #ifdef __cplusplus } #endif From 763b92139c1ff0b0cf802bba8f439fecc02fa622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 282/501] Revert "[nrf fromtree] scripts: compliance: Add commit range info output" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 67fde6e52a61455994c5d8c69c09a6f328541b92. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index b871bf365f6..b84e2efccef 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1074,8 +1074,6 @@ def _main(args): init_logs(args.loglevel) - logger.info(f'Running tests on commit range {COMMIT_RANGE}') - if args.list: for testcase in ComplianceTest.__subclasses__(): print(testcase.name) From 6d151f432b079fd4208ce7827670c4cc227ba964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 283/501] Revert "[nrf fromtree] scripts: compliance: Remove unused command-line args" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1b9046e9c39676baa6592ac0bad9469583b56e13. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index b84e2efccef..3d963e94b32 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1041,18 +1041,27 @@ def parse_args(): parser.add_argument('-c', '--commits', default=default_range, help=f'''Commit range in the form: a..[b], default is {default_range}''') + parser.add_argument('-r', '--repo', default=None, + help="GitHub repository") + parser.add_argument('-p', '--pull-request', default=0, type=int, + help="Pull request number") parser.add_argument('-o', '--output', default="compliance.xml", help='''Name of outfile in JUnit format, default is ./compliance.xml''') + parser.add_argument('-l', '--list', action="http://github.com/store_true", help="List all checks and exit") + parser.add_argument("-v", "--loglevel", choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help="python logging level") + parser.add_argument('-m', '--module', action="http://github.com/append", default=[], help="Checks to run. All checks by default.") + parser.add_argument('-e', '--exclude-module', action="http://github.com/append", default=[], help="Do not run the specified checks") + parser.add_argument('-j', '--previous-run', default=None, help='''Pre-load JUnit results in XML format from a previous run and combine with new results.''') From b18a05e9b322b31f2947da32c2ffe5f10aa6606a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 284/501] Revert "[nrf fromtree] scripts: compliance: Tiny cleanup for -c" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d681f170b6d556dda3dc6b687891688dc3fd87d8. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 3d963e94b32..5a2ca70ee2b 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1034,17 +1034,16 @@ def init_logs(cli_arg): def parse_args(): - - default_range = 'HEAD~1..HEAD' parser = argparse.ArgumentParser( description="Check for coding style and documentation warnings.") - parser.add_argument('-c', '--commits', default=default_range, - help=f'''Commit range in the form: a..[b], default is - {default_range}''') + parser.add_argument('-c', '--commits', default="HEAD~1..", + help='''Commit range in the form: a..[b], default is + HEAD~1..HEAD''') parser.add_argument('-r', '--repo', default=None, help="GitHub repository") parser.add_argument('-p', '--pull-request', default=0, type=int, help="Pull request number") + parser.add_argument('-S', '--sha', default=None, help="Commit SHA") parser.add_argument('-o', '--output', default="compliance.xml", help='''Name of outfile in JUnit format, default is ./compliance.xml''') From 7c8b7ae7b22c3ec6681360f0286eba2eac375511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 285/501] Revert "[nrf fromtree] scripts: compliance: Clean up logging" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e0e31f948387b85fd49f90c3d8fbab204c9d8f0. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 5a2ca70ee2b..1cf4d82b313 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -736,7 +736,7 @@ def run(self): # the entire tree. 2. run the former always. return - logger.info("If this takes too long then cleanup and try again") + logging.info("If this takes too long then cleanup and try again") patrn2files = self.ls_owned_files(codeowners) # The way git finds Renames and Copies is not "exact science", @@ -744,7 +744,7 @@ def run(self): # Addition instead. new_files = git("diff", "--name-only", "--diff-filter=ARC", COMMIT_RANGE).splitlines() - logger.debug("New files %s", new_files) + logging.debug("New files %s", new_files) # Convert to pathlib.Path string representation (e.g., # backslashes 'dir1\dir2\' on Windows) to be consistent @@ -756,10 +756,10 @@ def run(self): f_is_owned = False for git_pat, owned in patrn2files.items(): - logger.debug("Scanning %s for %s", git_pat, newf) + logging.debug("Scanning %s for %s", git_pat, newf) if newf in owned: - logger.info("%s matches new file %s", git_pat, newf) + logging.info("%s matches new file %s", git_pat, newf) f_is_owned = True # Unlike github, we don't care about finding any # more specific owner. @@ -1017,6 +1017,9 @@ def run(self): def init_logs(cli_arg): # Initializes logging + # TODO: there may be a shorter version thanks to: + # logging.basicConfig(...) + global logger level = os.environ.get('LOG_LEVEL', "WARN") @@ -1026,9 +1029,9 @@ def init_logs(cli_arg): logger = logging.getLogger('') logger.addHandler(console) - logger.setLevel(cli_arg or level) + logger.setLevel(cli_arg if cli_arg else level) - logger.info("Log init completed, level=%s", + logging.info("Log init completed, level=%s", logging.getLevelName(logger.getEffectiveLevel())) @@ -1051,9 +1054,7 @@ def parse_args(): parser.add_argument('-l', '--list', action="http://github.com/store_true", help="List all checks and exit") - parser.add_argument("-v", "--loglevel", choices=['DEBUG', 'INFO', 'WARNING', - 'ERROR', 'CRITICAL'], - help="python logging level") + parser.add_argument("-v", "--loglevel", help="python logging level") parser.add_argument('-m', '--module', action="http://github.com/append", default=[], help="Checks to run. All checks by default.") From 21b470bf56db9fce3dd7424f1cd5d32512d350dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 286/501] Revert "[nrf fromtree] scripts: compliance: Complete transition to junitparser v2" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a4b4ccf32c9728c764828bf1c5c258b711c5fb90. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 1cf4d82b313..240341ba315 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -142,7 +142,7 @@ def skip(self, msg): if self.case.result: msg += "\n\nFailures before skip: " + self.case.result[0]._elem.text - self.case.result = [Skipped(msg, "skipped")] + self.case.result = Skipped(msg, "skipped") raise EndTest From 272b0306519307fad187cc1035ab2e967f280208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 287/501] Revert "[nrf fromtree] scripts: compliance: Remove unused variable" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0357614b6cbdbf35a864bb14107b1b32ae9ab78a. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 240341ba315..abd733a2553 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -18,6 +18,11 @@ import shlex from pathlib import Path +# '*' makes it italic +EDIT_TIP = "\n\n*Tip: The bot edits this comment instead of posting a new " \ + "one, so you can check the comment's history to see earlier " \ + "messages.*" + logger = None # This ends up as None when we're not running in a Zephyr tree From b0d60f946e0fbdf960fb2ef9f326a5ab8a63220a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 288/501] Revert "[nrf fromtree] scripts/ci/check_compliance.py: Allow to run w/ZEPHYR_BASE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 56ba9e17f89b490c394d6c550461a3186656c6c4. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index abd733a2553..168fb193ab1 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -27,15 +27,6 @@ # This ends up as None when we're not running in a Zephyr tree ZEPHYR_BASE = os.environ.get('ZEPHYR_BASE') -if not ZEPHYR_BASE: - # Let the user run this script as ./scripts/ci/check_compliance.py without - # making them set ZEPHYR_BASE. - ZEPHYR_BASE = str(Path(__file__).resolve().parents[2]) - - # Propagate this decision to child processes. - os.environ['ZEPHYR_BASE'] = ZEPHYR_BASE - - print(f'ZEPHYR_BASE unset, using "{ZEPHYR_BASE}"') def git(*args, cwd=None): From 4575cadcf8fb0f6cea25c5755d8a03699bcddd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 289/501] Revert "[nrf fromlist] net: lwm2m: Fix LwM2M pause and resume" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit df734318174b829047eefac466c6247637c21ee7. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/lwm2m/lwm2m_engine.c | 45 ++++++++++++++------------ subsys/net/lib/lwm2m/lwm2m_rd_client.c | 4 ++- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index 957e2207e70..ab2b12d60f1 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -82,7 +82,6 @@ static struct lwm2m_obj_path_list observe_paths[LWM2M_ENGINE_MAX_OBSERVER_PATH]; static k_tid_t engine_thread_id; static bool suspend_engine_thread; -static bool active_engine_thread; struct service_node { sys_snode_t node; @@ -113,7 +112,7 @@ int lwm2m_sock_nfds(void) { return sock_nfds; } struct lwm2m_block_context *lwm2m_block1_context(void) { return block1_contexts; } -static int lwm2m_socket_update(struct lwm2m_ctx *ctx); +static void lwm2m_socket_update(struct lwm2m_ctx *ctx); /* for debugging: to print IP addresses */ char *lwm2m_sprint_ip_addr(const struct sockaddr *addr) @@ -185,9 +184,7 @@ int lwm2m_open_socket(struct lwm2m_ctx *client_ctx) return -errno; } - if (lwm2m_socket_update(client_ctx)) { - return lwm2m_socket_add(client_ctx); - } + lwm2m_socket_update(client_ctx); } return 0; @@ -533,16 +530,15 @@ int lwm2m_socket_add(struct lwm2m_ctx *ctx) return 0; } -static int lwm2m_socket_update(struct lwm2m_ctx *ctx) +static void lwm2m_socket_update(struct lwm2m_ctx *ctx) { for (int i = 0; i < sock_nfds; i++) { if (sock_ctx[i] != ctx) { continue; } sock_fds[i].fd = ctx->sock_fd; - return 0; + return; } - return -1; } void lwm2m_socket_del(struct lwm2m_ctx *ctx) @@ -666,9 +662,7 @@ static void socket_loop(void) lwm2m_rd_client_pause(); #endif suspend_engine_thread = false; - active_engine_thread = false; k_thread_suspend(engine_thread_id); - active_engine_thread = true; #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT) lwm2m_rd_client_resume(); #endif @@ -782,6 +776,7 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) socklen_t addr_len; int flags; int ret; + bool allocate_socket = false; #if defined(CONFIG_LWM2M_DTLS_SUPPORT) uint8_t tmp; @@ -808,6 +803,7 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) #endif /* CONFIG_LWM2M_DTLS_SUPPORT */ if (client_ctx->sock_fd < 0) { + allocate_socket = true; ret = lwm2m_open_socket(client_ctx); if (ret) { return ret; @@ -890,6 +886,9 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) } LOG_INF("Connected, sock id %d", client_ctx->sock_fd); + if (allocate_socket) { + return lwm2m_socket_add(client_ctx); + } return 0; error: lwm2m_engine_stop(client_ctx); @@ -942,32 +941,39 @@ int lwm2m_engine_start(struct lwm2m_ctx *client_ctx) int lwm2m_engine_pause(void) { - if (suspend_engine_thread || !active_engine_thread) { + char buffer[32]; + const char *str; + + str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); + if (suspend_engine_thread || !strcmp(str, "suspended")) { LOG_WRN("Engine thread already suspended"); return 0; } suspend_engine_thread = true; - while (active_engine_thread) { + while (strcmp(str, "suspended")) { k_msleep(10); + str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); } - LOG_INF("LWM2M engine thread paused"); + LOG_INF("LWM2M engine thread paused (%s) ", str); return 0; } int lwm2m_engine_resume(void) { - if (suspend_engine_thread || active_engine_thread) { - LOG_WRN("LWM2M engine thread state not ok for resume"); + char buffer[32]; + const char *str; + + str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); + if (strcmp(str, "suspended")) { + LOG_WRN("LWM2M engine thread state not ok for resume %s", str); return -EPERM; } k_thread_resume(engine_thread_id); - while (!active_engine_thread) { - k_msleep(10); - } - LOG_INF("LWM2M engine thread resume"); + str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); + LOG_INF("LWM2M engine thread resume (%s)", str); return 0; } @@ -987,7 +993,6 @@ static int lwm2m_engine_init(const struct device *dev) NULL, NULL, NULL, THREAD_PRIORITY, 0, K_NO_WAIT); k_thread_name_set(&engine_thread_data, "lwm2m-sock-recv"); LOG_DBG("LWM2M engine socket receive thread started"); - active_engine_thread = true; return 0; } diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 25fe374d920..0ba5429ae29 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -1365,7 +1365,9 @@ int lwm2m_rd_client_resume(void) lwm2m_close_socket(client.ctx); client.engine_state = suspended_client_state; - if ((client.lifetime <= (k_uptime_get() - client.last_update) / 1000)) { + if (!sm_is_registered() || + (sm_is_registered() && + (client.lifetime <= (k_uptime_get() - client.last_update) / 1000))) { client.engine_state = ENGINE_DO_REGISTRATION; } else { lwm2m_rd_client_connection_resume(client.ctx); From 2d991fd0efb486a92f5f5ca95cc547ae6eefb0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 290/501] Revert "[nrf fromtree] net: zperf: Use zsock_* API instead of POSIX socket API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5d43da935652a10321d3e70b4b30ca588eff12f4. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/zperf/zperf_shell.c | 44 +++++++++---------- subsys/net/lib/zperf/zperf_tcp_receiver.c | 53 +++++++++++------------ subsys/net/lib/zperf/zperf_tcp_uploader.c | 2 +- subsys/net/lib/zperf/zperf_udp_receiver.c | 46 ++++++++++---------- subsys/net/lib/zperf/zperf_udp_uploader.c | 12 ++--- 5 files changed, 77 insertions(+), 80 deletions(-) diff --git a/subsys/net/lib/zperf/zperf_shell.c b/subsys/net/lib/zperf/zperf_shell.c index 4302469abf2..df79e956580 100644 --- a/subsys/net/lib/zperf/zperf_shell.c +++ b/subsys/net/lib/zperf/zperf_shell.c @@ -461,9 +461,9 @@ static int setup_upload_sockets(const struct shell *sh, char *argv0) { if (IS_ENABLED(CONFIG_NET_IPV6)) { - *sock6 = zsock_socket(AF_INET6, - is_udp ? SOCK_DGRAM : SOCK_STREAM, - is_udp ? IPPROTO_UDP : IPPROTO_TCP); + *sock6 = socket(AF_INET6, + is_udp ? SOCK_DGRAM : SOCK_STREAM, + is_udp ? IPPROTO_UDP : IPPROTO_TCP); if (*sock6 < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv6 network socket (%d)\n", @@ -476,9 +476,9 @@ static int setup_upload_sockets(const struct shell *sh, } if (IS_ENABLED(CONFIG_NET_IPV4)) { - *sock4 = zsock_socket(AF_INET, - is_udp ? SOCK_DGRAM : SOCK_STREAM, - is_udp ? IPPROTO_UDP : IPPROTO_TCP); + *sock4 = socket(AF_INET, + is_udp ? SOCK_DGRAM : SOCK_STREAM, + is_udp ? IPPROTO_UDP : IPPROTO_TCP); if (*sock4 < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv4 network socket (%d)\n", @@ -542,9 +542,9 @@ static int execute_upload(const struct shell *sh, shell_fprintf(sh, SHELL_NORMAL, "\n"); if (family == AF_INET6 && sock6 >= 0) { - ret = zsock_connect(sock6, - (struct sockaddr *)ipv6, - sizeof(*ipv6)); + ret = connect(sock6, + (struct sockaddr *)ipv6, + sizeof(*ipv6)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "IPv6 connect failed (%d)\n", @@ -558,9 +558,9 @@ static int execute_upload(const struct shell *sh, } if (family == AF_INET && sock4 >= 0) { - ret = zsock_connect(sock4, - (struct sockaddr *)ipv4, - sizeof(*ipv4)); + ret = connect(sock4, + (struct sockaddr *)ipv4, + sizeof(*ipv4)); if (ret < 0) { shell_fprintf(sh, SHELL_NORMAL, "IPv4 connect failed (%d)\n", @@ -581,9 +581,9 @@ static int execute_upload(const struct shell *sh, if (!is_udp && IS_ENABLED(CONFIG_NET_TCP)) { if (family == AF_INET6 && sock6 >= 0) { - ret = zsock_connect(sock6, - (struct sockaddr *)ipv6, - sizeof(*ipv6)); + ret = connect(sock6, + (struct sockaddr *)ipv6, + sizeof(*ipv6)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "IPv6 connect failed (%d)\n", @@ -595,7 +595,7 @@ static int execute_upload(const struct shell *sh, * the same time. */ if (IS_ENABLED(CONFIG_NET_IPV4) && sock4 >= 0) { - (void)zsock_close(sock4); + (void)close(sock4); sock4 = -1; } @@ -606,9 +606,9 @@ static int execute_upload(const struct shell *sh, } if (family == AF_INET && sock4 >= 0) { - ret = zsock_connect(sock4, - (struct sockaddr *)ipv4, - sizeof(*ipv4)); + ret = connect(sock4, + (struct sockaddr *)ipv4, + sizeof(*ipv4)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "IPv4 connect failed (%d)\n", @@ -617,7 +617,7 @@ static int execute_upload(const struct shell *sh, } if (IS_ENABLED(CONFIG_NET_IPV6) && sock6 >= 0) { - (void)zsock_close(sock6); + (void)close(sock6); sock6 = -1; } @@ -635,12 +635,12 @@ static int execute_upload(const struct shell *sh, out: if (IS_ENABLED(CONFIG_NET_IPV6) && sock6 >= 0) { - (void)zsock_close(sock6); + (void)close(sock6); sock6 = -1; } if (IS_ENABLED(CONFIG_NET_IPV4) && sock4 >= 0) { - (void)zsock_close(sock4); + (void)close(sock4); sock4 = -1; } diff --git a/subsys/net/lib/zperf/zperf_tcp_receiver.c b/subsys/net/lib/zperf/zperf_tcp_receiver.c index 354c343daae..fea4f66a7cb 100644 --- a/subsys/net/lib/zperf/zperf_tcp_receiver.c +++ b/subsys/net/lib/zperf/zperf_tcp_receiver.c @@ -126,7 +126,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) static uint8_t buf[TCP_RECEIVER_BUF_SIZE]; const struct shell *sh = ptr1; int port = POINTER_TO_INT(ptr2); - struct zsock_pollfd fds[SOCK_ID_MAX] = { 0 }; + struct pollfd fds[SOCK_ID_MAX] = { 0 }; int ret; for (int i = 0; i < ARRAY_SIZE(fds); i++) { @@ -138,8 +138,8 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in4_addr_my = zperf_get_sin(); - fds[SOCK_ID_IPV4_LISTEN].fd = zsock_socket(AF_INET, SOCK_STREAM, - IPPROTO_TCP); + fds[SOCK_ID_IPV4_LISTEN].fd = socket(AF_INET, SOCK_STREAM, + IPPROTO_TCP); if (fds[SOCK_ID_IPV4_LISTEN].fd < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv4 network socket.\n"); @@ -173,9 +173,9 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) shell_fprintf(sh, SHELL_NORMAL, "Binding to %s\n", net_sprint_ipv4_addr(&in4_addr_my->sin_addr)); - ret = zsock_bind(fds[SOCK_ID_IPV4_LISTEN].fd, - (struct sockaddr *)in4_addr_my, - sizeof(struct sockaddr_in)); + ret = bind(fds[SOCK_ID_IPV4_LISTEN].fd, + (struct sockaddr *)in4_addr_my, + sizeof(struct sockaddr_in)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot bind IPv4 UDP port %d (%d)\n", @@ -184,14 +184,14 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - ret = zsock_listen(fds[SOCK_ID_IPV4_LISTEN].fd, 1); + ret = listen(fds[SOCK_ID_IPV4_LISTEN].fd, 1); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot listen IPv4 TCP (%d)", errno); goto cleanup; } - fds[SOCK_ID_IPV4_LISTEN].events = ZSOCK_POLLIN; + fds[SOCK_ID_IPV4_LISTEN].events = POLLIN; } if (IS_ENABLED(CONFIG_NET_IPV6)) { @@ -199,8 +199,8 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in6_addr_my = zperf_get_sin6(); - fds[SOCK_ID_IPV6_LISTEN].fd = zsock_socket(AF_INET6, SOCK_STREAM, - IPPROTO_TCP); + fds[SOCK_ID_IPV6_LISTEN].fd = socket(AF_INET6, SOCK_STREAM, + IPPROTO_TCP); if (fds[SOCK_ID_IPV6_LISTEN].fd < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv6 network socket.\n"); @@ -235,9 +235,9 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) shell_fprintf(sh, SHELL_NORMAL, "Binding to %s\n", net_sprint_ipv6_addr(&in6_addr_my->sin6_addr)); - ret = zsock_bind(fds[SOCK_ID_IPV6_LISTEN].fd, - (struct sockaddr *)in6_addr_my, - sizeof(struct sockaddr_in6)); + ret = bind(fds[SOCK_ID_IPV6_LISTEN].fd, + (struct sockaddr *)in6_addr_my, + sizeof(struct sockaddr_in6)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot bind IPv6 UDP port %d (%d)\n", @@ -246,14 +246,14 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - ret = zsock_listen(fds[SOCK_ID_IPV6_LISTEN].fd, 1); + ret = listen(fds[SOCK_ID_IPV6_LISTEN].fd, 1); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot listen IPv6 TCP (%d)", errno); goto cleanup; } - fds[SOCK_ID_IPV6_LISTEN].events = ZSOCK_POLLIN; + fds[SOCK_ID_IPV6_LISTEN].events = POLLIN; } shell_fprintf(sh, SHELL_NORMAL, @@ -264,7 +264,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) init_done = true; while (true) { - ret = zsock_poll(fds, ARRAY_SIZE(fds), -1); + ret = poll(fds, ARRAY_SIZE(fds), -1); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "TCP receiver poll error (%d)\n", @@ -276,8 +276,8 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) struct sockaddr addr; socklen_t addrlen = sizeof(addr); - if ((fds[i].revents & ZSOCK_POLLERR) || - (fds[i].revents & ZSOCK_POLLNVAL)) { + if ((fds[i].revents & POLLERR) || + (fds[i].revents & POLLNVAL)) { shell_fprintf( sh, SHELL_WARNING, "TCP receiver IPv%d socket error\n", @@ -285,15 +285,14 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - if (!(fds[i].revents & ZSOCK_POLLIN)) { + if (!(fds[i].revents & POLLIN)) { continue; } switch (i) { case SOCK_ID_IPV4_LISTEN: case SOCK_ID_IPV6_LISTEN:{ - int sock = zsock_accept(fds[i].fd, &addr, - &addrlen); + int sock = accept(fds[i].fd, &addr, &addrlen); if (sock < 0) { shell_fprintf( @@ -306,14 +305,14 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) if (i == SOCK_ID_IPV4_LISTEN && fds[SOCK_ID_IPV4_DATA].fd < 0) { fds[SOCK_ID_IPV4_DATA].fd = sock; - fds[SOCK_ID_IPV4_DATA].events = ZSOCK_POLLIN; + fds[SOCK_ID_IPV4_DATA].events = POLLIN; } else if (i == SOCK_ID_IPV6_LISTEN && fds[SOCK_ID_IPV6_DATA].fd < 0) { fds[SOCK_ID_IPV6_DATA].fd = sock; - fds[SOCK_ID_IPV6_DATA].events = ZSOCK_POLLIN; + fds[SOCK_ID_IPV6_DATA].events = POLLIN; } else { /* Too many connections. */ - zsock_close(sock); + close(sock); break; } @@ -322,7 +321,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) case SOCK_ID_IPV4_DATA: case SOCK_ID_IPV6_DATA: - ret = zsock_recv(fds[i].fd, buf, sizeof(buf), 0); + ret = recv(fds[i].fd, buf, sizeof(buf), 0); if (ret < 0) { shell_fprintf( sh, SHELL_WARNING, @@ -335,7 +334,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) tcp_received(sh, fds[i].fd, ret); if (ret == 0) { - zsock_close(fds[i].fd); + close(fds[i].fd); fds[i].fd = -1; } @@ -347,7 +346,7 @@ void tcp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) cleanup: for (int i = 0; i < ARRAY_SIZE(fds); i++) { if (fds[i].fd >= 0) { - zsock_close(fds[i].fd); + close(fds[i].fd); } } } diff --git a/subsys/net/lib/zperf/zperf_tcp_uploader.c b/subsys/net/lib/zperf/zperf_tcp_uploader.c index 82483e50739..888b1ce06b3 100644 --- a/subsys/net/lib/zperf/zperf_tcp_uploader.c +++ b/subsys/net/lib/zperf/zperf_tcp_uploader.c @@ -55,7 +55,7 @@ void zperf_tcp_upload(const struct shell *sh, int ret = 0; /* Send the packet */ - ret = zsock_send(sock, sample_packet, packet_size, 0); + ret = send(sock, sample_packet, packet_size, 0); if (ret < 0) { if (nb_errors == 0 && ret != -ENOMEM) { shell_fprintf(sh, SHELL_WARNING, diff --git a/subsys/net/lib/zperf/zperf_udp_receiver.c b/subsys/net/lib/zperf/zperf_udp_receiver.c index a29c0c9d686..623120e5de1 100644 --- a/subsys/net/lib/zperf/zperf_udp_receiver.c +++ b/subsys/net/lib/zperf/zperf_udp_receiver.c @@ -81,10 +81,10 @@ static int zperf_receiver_send_stat(const struct shell *sh, build_reply(hdr, stat, reply); - ret = zsock_sendto(sock, reply, sizeof(reply), 0, addr, - addr->sa_family == AF_INET6 ? - sizeof(struct sockaddr_in6) : - sizeof(struct sockaddr_in)); + ret = sendto(sock, reply, sizeof(reply), 0, addr, + addr->sa_family == AF_INET6 ? + sizeof(struct sockaddr_in6) : + sizeof(struct sockaddr_in)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, " Cannot send data to peer (%d)", errno); @@ -259,7 +259,7 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) static uint8_t buf[UDP_RECEIVER_BUF_SIZE]; const struct shell *sh = ptr1; int port = POINTER_TO_INT(ptr2); - struct zsock_pollfd fds[SOCK_ID_MAX] = { 0 }; + struct pollfd fds[SOCK_ID_MAX] = { 0 }; int ret; for (int i = 0; i < ARRAY_SIZE(fds); i++) { @@ -271,8 +271,7 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in4_addr_my = zperf_get_sin(); - fds[SOCK_ID_IPV4].fd = zsock_socket(AF_INET, SOCK_DGRAM, - IPPROTO_UDP); + fds[SOCK_ID_IPV4].fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (fds[SOCK_ID_IPV4].fd < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv4 network socket.\n"); @@ -306,9 +305,9 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in4_addr_my->sin_port = htons(port); - ret = zsock_bind(fds[SOCK_ID_IPV4].fd, - (struct sockaddr *)in4_addr_my, - sizeof(struct sockaddr_in)); + ret = bind(fds[SOCK_ID_IPV4].fd, + (struct sockaddr *)in4_addr_my, + sizeof(struct sockaddr_in)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot bind IPv4 UDP port %d (%d)\n", @@ -317,7 +316,7 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - fds[SOCK_ID_IPV4].events = ZSOCK_POLLIN; + fds[SOCK_ID_IPV4].events = POLLIN; } if (IS_ENABLED(CONFIG_NET_IPV6)) { @@ -325,8 +324,7 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in6_addr_my = zperf_get_sin6(); - fds[SOCK_ID_IPV6].fd = zsock_socket(AF_INET6, SOCK_DGRAM, - IPPROTO_UDP); + fds[SOCK_ID_IPV6].fd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); if (fds[SOCK_ID_IPV6].fd < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot create IPv4 network socket.\n"); @@ -361,9 +359,9 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) in6_addr_my->sin6_port = htons(port); - ret = zsock_bind(fds[SOCK_ID_IPV6].fd, - (struct sockaddr *)in6_addr_my, - sizeof(struct sockaddr_in6)); + ret = bind(fds[SOCK_ID_IPV6].fd, + (struct sockaddr *)in6_addr_my, + sizeof(struct sockaddr_in6)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Cannot bind IPv6 UDP port %d (%d)\n", @@ -372,14 +370,14 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - fds[SOCK_ID_IPV6].events = ZSOCK_POLLIN; + fds[SOCK_ID_IPV6].events = POLLIN; } shell_fprintf(sh, SHELL_NORMAL, "Listening on port %d\n", port); while (true) { - ret = zsock_poll(fds, ARRAY_SIZE(fds), -1); + ret = poll(fds, ARRAY_SIZE(fds), -1); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "UDP receiver poll error (%d)\n", @@ -391,8 +389,8 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) struct sockaddr addr; socklen_t addrlen = sizeof(addr); - if ((fds[i].revents & ZSOCK_POLLERR) || - (fds[i].revents & ZSOCK_POLLNVAL)) { + if ((fds[i].revents & POLLERR) || + (fds[i].revents & POLLNVAL)) { shell_fprintf( sh, SHELL_WARNING, "UDP receiver IPv%d socket error\n", @@ -400,12 +398,12 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) goto cleanup; } - if (!(fds[i].revents & ZSOCK_POLLIN)) { + if (!(fds[i].revents & POLLIN)) { continue; } - ret = zsock_recvfrom(fds[i].fd, buf, sizeof(buf), 0, - &addr, &addrlen); + ret = recvfrom(fds[i].fd, buf, sizeof(buf), 0, &addr, + &addrlen); if (ret < 0) { shell_fprintf( sh, SHELL_WARNING, @@ -421,7 +419,7 @@ void udp_receiver_thread(void *ptr1, void *ptr2, void *ptr3) cleanup: for (int i = 0; i < ARRAY_SIZE(fds); i++) { if (fds[i].fd >= 0) { - zsock_close(fds[i].fd); + close(fds[i].fd); } } } diff --git a/subsys/net/lib/zperf/zperf_udp_uploader.c b/subsys/net/lib/zperf/zperf_udp_uploader.c index 7c75349806c..3abd22d8a22 100644 --- a/subsys/net/lib/zperf/zperf_udp_uploader.c +++ b/subsys/net/lib/zperf/zperf_udp_uploader.c @@ -90,7 +90,7 @@ static inline void zperf_upload_fin(const struct shell *sh, hdr->num_of_bytes = htonl(packet_size); /* Send the packet */ - ret = zsock_send(sock, sample_packet, packet_size, 0); + ret = send(sock, sample_packet, packet_size, 0); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Failed to send the packet (%d)\n", @@ -99,8 +99,8 @@ static inline void zperf_upload_fin(const struct shell *sh, } /* Receive statistics */ - ret = zsock_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &rcvtimeo, - sizeof(rcvtimeo)); + ret = setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &rcvtimeo, + sizeof(rcvtimeo)); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "setsockopt error (%d)\n", @@ -108,7 +108,7 @@ static inline void zperf_upload_fin(const struct shell *sh, continue; } - ret = zsock_recv(sock, stats, sizeof(stats), 0); + ret = recv(sock, stats, sizeof(stats), 0); if (ret == -EAGAIN) { shell_fprintf(sh, SHELL_WARNING, "Stats receive timeout\n"); @@ -126,7 +126,7 @@ static inline void zperf_upload_fin(const struct shell *sh, /* Drain RX */ while (true) { - ret = zsock_recv(sock, stats, sizeof(stats), ZSOCK_MSG_DONTWAIT); + ret = recv(sock, stats, sizeof(stats), MSG_DONTWAIT); if (ret < 0) { break; } @@ -236,7 +236,7 @@ void zperf_udp_upload(const struct shell *sh, hdr->num_of_bytes = htonl(packet_size); /* Send the packet */ - ret = zsock_send(sock, sample_packet, packet_size, 0); + ret = send(sock, sample_packet, packet_size, 0); if (ret < 0) { shell_fprintf(sh, SHELL_WARNING, "Failed to send the packet (%d)\n", From e8af75d5c2cc567028da348744efb946e802dc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 291/501] Revert "[nrf fromtree] net: zperf: Extract zperf into library" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c8c986a25ed1f4a1bcab7f6e1e49b207b0c6c7ae. Signed-off-by: Andrzej Głąbek --- doc/connectivity/networking/api/index.rst | 1 - doc/connectivity/networking/api/zperf.rst | 103 ------------------ samples/net/zperf/CMakeLists.txt | 11 ++ samples/net/zperf/README.rst | 80 +++++++++++++- samples/net/zperf/prj.conf | 1 - .../net/zperf/src}/shell_utils.c | 1 + .../net/zperf/src}/shell_utils.h | 0 .../zperf => samples/net/zperf/src}/zperf.h | 0 .../net/zperf/src}/zperf_internal.h | 0 .../net/zperf/src}/zperf_session.c | 6 +- .../net/zperf/src}/zperf_session.h | 0 .../net/zperf/src}/zperf_shell.c | 3 +- .../net/zperf/src}/zperf_tcp_receiver.c | 4 +- .../net/zperf/src}/zperf_tcp_uploader.c | 3 +- .../net/zperf/src}/zperf_udp_receiver.c | 3 +- .../net/zperf/src}/zperf_udp_uploader.c | 4 +- subsys/net/lib/CMakeLists.txt | 1 - subsys/net/lib/Kconfig | 2 - subsys/net/lib/zperf/CMakeLists.txt | 17 --- subsys/net/lib/zperf/Kconfig | 19 ---- 20 files changed, 103 insertions(+), 156 deletions(-) delete mode 100644 doc/connectivity/networking/api/zperf.rst rename {subsys/net/lib/zperf => samples/net/zperf/src}/shell_utils.c (97%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/shell_utils.h (100%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/zperf.h (100%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/zperf_internal.h (100%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/zperf_session.c (95%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/zperf_session.h (100%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/zperf_shell.c (99%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/zperf_tcp_receiver.c (99%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/zperf_tcp_uploader.c (96%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/zperf_udp_receiver.c (99%) rename {subsys/net/lib/zperf => samples/net/zperf/src}/zperf_udp_uploader.c (98%) delete mode 100644 subsys/net/lib/zperf/CMakeLists.txt delete mode 100644 subsys/net/lib/zperf/Kconfig diff --git a/doc/connectivity/networking/api/index.rst b/doc/connectivity/networking/api/index.rst index 2386a075460..59410af5ef1 100644 --- a/doc/connectivity/networking/api/index.rst +++ b/doc/connectivity/networking/api/index.rst @@ -13,4 +13,3 @@ Networking APIs system_mgmt.rst tsn.rst gsm_modem.rst - zperf.rst diff --git a/doc/connectivity/networking/api/zperf.rst b/doc/connectivity/networking/api/zperf.rst deleted file mode 100644 index 4f6674679d2..00000000000 --- a/doc/connectivity/networking/api/zperf.rst +++ /dev/null @@ -1,103 +0,0 @@ -.. _zperf: - -zperf: Network Traffic Generator -################################ - -.. contents:: - :local: - :depth: 2 - -Overview -******** - -zperf is a shell utility which allows to generate network traffic in Zephyr. The -tool may be used to evaluate network bandwidth. - -zperf is compatible with iPerf_2.0.5. Note that in newer iPerf versions, -an error message like this is printed and the server reported statistics -are missing. - -.. code-block:: console - - LAST PACKET NOT RECEIVED!!! - -zperf can be enabled in any application, a dedicated sample is also present -in Zephyr. See :ref:`zperf sample application ` for details. - -Sample Usage -************ - -If Zephyr acts as a client, iPerf must be executed in server mode. -For example, the following command line must be used for UDP testing: - -.. code-block:: console - - $ iperf -s -l 1K -u -V -B 2001:db8::2 - -For TCP testing, the command line would look like this: - -.. code-block:: console - - $ iperf -s -l 1K -V -B 2001:db8::2 - - -In the Zephyr console, zperf can be executed as follows: - -.. code-block:: console - - zperf udp upload 2001:db8::2 5001 10 1K 1M - - -For TCP the zperf command would look like this: - -.. code-block:: console - - zperf tcp upload 2001:db8::2 5001 10 1K 1M - - -If the IP addresses of Zephyr and the host machine are specified in the -config file, zperf can be started as follows: - -.. code-block:: console - - zperf udp upload2 v6 10 1K 1M - - -or like this if you want to test TCP: - -.. code-block:: console - - zperf tcp upload2 v6 10 1K 1M - - -If Zephyr is acting as a server, set the download mode as follows for UDP: - -.. code-block:: console - - zperf udp download 5001 - - -or like this for TCP: - -.. code-block:: console - - zperf tcp download 5001 - - -and in the host side, iPerf must be executed with the following -command line if you are testing UDP: - -.. code-block:: console - - $ iperf -l 1K -u -V -c 2001:db8::1 -p 5001 - - -and this if you are testing TCP: - -.. code-block:: console - - $ iperf -l 1K -V -c 2001:db8::1 -p 5001 - - -iPerf output can be limited by using the -b option if Zephyr is not -able to receive all the packets in orderly manner. diff --git a/samples/net/zperf/CMakeLists.txt b/samples/net/zperf/CMakeLists.txt index ae9b46dadc0..c9b12350383 100644 --- a/samples/net/zperf/CMakeLists.txt +++ b/samples/net/zperf/CMakeLists.txt @@ -7,4 +7,15 @@ project(zperf) target_sources(app PRIVATE src/main.c + src/shell_utils.c + src/zperf_session.c + src/zperf_shell.c + src/zperf_udp_receiver.c + src/zperf_udp_uploader.c + src/zperf_tcp_receiver.c + src/zperf_tcp_uploader.c + ) + +target_include_directories(app PRIVATE + ${ZEPHYR_BASE}/subsys/net/ip ) diff --git a/samples/net/zperf/README.rst b/samples/net/zperf/README.rst index dd968b3423b..d98bd66f042 100644 --- a/samples/net/zperf/README.rst +++ b/samples/net/zperf/README.rst @@ -6,8 +6,8 @@ zperf: Network Traffic Generator Description *********** -The zperf sample demonstrates the :ref:`zperf shell utility `, which -allows to evaluate network bandwidth. +zperf is a network traffic generator for Zephyr that may be used to +evaluate network bandwidth. Features ********* @@ -46,5 +46,77 @@ to setup the network environment. Usage ***** -See :ref:`zperf library documentation ` for more information about -the library usage. +If Zephyr acts as a client, iPerf must be executed in server mode. +For example, the following command line must be used for UDP testing: + +.. code-block:: console + + $ iperf -s -l 1K -u -V -B 2001:db8::2 + +For TCP testing, the command line would look like this: + +.. code-block:: console + + $ iperf -s -l 1K -V -B 2001:db8::2 + + +In the Zephyr console, zperf can be executed as follows: + +.. code-block:: console + + zperf udp upload 2001:db8::2 5001 10 1K 1M + + +For TCP the zperf command would look like this: + +.. code-block:: console + + zperf tcp upload 2001:db8::2 5001 10 1K 1M + + +If the IP addresses of Zephyr and the host machine are specified in the +config file, zperf can be started as follows: + +.. code-block:: console + + zperf udp upload2 v6 10 1K 1M + + +or like this if you want to test TCP: + +.. code-block:: console + + zperf tcp upload2 v6 10 1K 1M + + +If Zephyr is acting as a server, set the download mode as follows for UDP: + +.. code-block:: console + + zperf udp download 5001 + + +or like this for TCP: + +.. code-block:: console + + zperf tcp download 5001 + + +and in the host side, iPerf must be executed with the following +command line if you are testing UDP: + +.. code-block:: console + + $ iperf -l 1K -u -V -c 2001:db8::1 -p 5001 + + +and this if you are testing TCP: + +.. code-block:: console + + $ iperf -l 1K -V -c 2001:db8::1 -p 5001 + + +iPerf output can be limited by using the -b option if Zephyr is not +able to receive all the packets in orderly manner. diff --git a/samples/net/zperf/prj.conf b/samples/net/zperf/prj.conf index f5149803b6f..a2cd41ad847 100644 --- a/samples/net/zperf/prj.conf +++ b/samples/net/zperf/prj.conf @@ -1,5 +1,4 @@ CONFIG_NETWORKING=y -CONFIG_NET_ZPERF=y CONFIG_NET_LOG=y CONFIG_NET_IPV6=y CONFIG_NET_IPV4=y diff --git a/subsys/net/lib/zperf/shell_utils.c b/samples/net/zperf/src/shell_utils.c similarity index 97% rename from subsys/net/lib/zperf/shell_utils.c rename to samples/net/zperf/src/shell_utils.c index 988bd5dc443..a9d11c2299d 100644 --- a/subsys/net/lib/zperf/shell_utils.c +++ b/samples/net/zperf/src/shell_utils.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include diff --git a/subsys/net/lib/zperf/shell_utils.h b/samples/net/zperf/src/shell_utils.h similarity index 100% rename from subsys/net/lib/zperf/shell_utils.h rename to samples/net/zperf/src/shell_utils.h diff --git a/subsys/net/lib/zperf/zperf.h b/samples/net/zperf/src/zperf.h similarity index 100% rename from subsys/net/lib/zperf/zperf.h rename to samples/net/zperf/src/zperf.h diff --git a/subsys/net/lib/zperf/zperf_internal.h b/samples/net/zperf/src/zperf_internal.h similarity index 100% rename from subsys/net/lib/zperf/zperf_internal.h rename to samples/net/zperf/src/zperf_internal.h diff --git a/subsys/net/lib/zperf/zperf_session.c b/samples/net/zperf/src/zperf_session.c similarity index 95% rename from subsys/net/lib/zperf/zperf_session.c rename to samples/net/zperf/src/zperf_session.c index 68e2a66bafd..bc643ec3c92 100644 --- a/subsys/net/lib/zperf/zperf_session.c +++ b/samples/net/zperf/src/zperf_session.c @@ -5,7 +5,7 @@ */ #include -LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); +LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); #include @@ -29,7 +29,7 @@ struct session *get_session(const struct sockaddr *addr, const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr; if (proto != SESSION_TCP && proto != SESSION_UDP) { - NET_ERR("Error! unsupported proto.\n"); + printk("Error! unsupported proto.\n"); return NULL; } @@ -92,7 +92,7 @@ struct session *get_tcp_session(int sock) int i = 0; if (sock < 0) { - NET_ERR("Error! Invalid socket.\n"); + printk("Error! Invalid socket.\n"); return NULL; } diff --git a/subsys/net/lib/zperf/zperf_session.h b/samples/net/zperf/src/zperf_session.h similarity index 100% rename from subsys/net/lib/zperf/zperf_session.h rename to samples/net/zperf/src/zperf_session.h diff --git a/subsys/net/lib/zperf/zperf_shell.c b/samples/net/zperf/src/zperf_shell.c similarity index 99% rename from subsys/net/lib/zperf/zperf_shell.c rename to samples/net/zperf/src/zperf_shell.c index df79e956580..9ce46c1cdd3 100644 --- a/subsys/net/lib/zperf/zperf_shell.c +++ b/samples/net/zperf/src/zperf_shell.c @@ -5,13 +5,14 @@ */ #include -LOG_MODULE_REGISTER(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); +LOG_MODULE_REGISTER(net_zperf_sample, LOG_LEVEL_DBG); #include #include #include #include +#include #include #include diff --git a/subsys/net/lib/zperf/zperf_tcp_receiver.c b/samples/net/zperf/src/zperf_tcp_receiver.c similarity index 99% rename from subsys/net/lib/zperf/zperf_tcp_receiver.c rename to samples/net/zperf/src/zperf_tcp_receiver.c index fea4f66a7cb..ad540a9a8f4 100644 --- a/subsys/net/lib/zperf/zperf_tcp_receiver.c +++ b/samples/net/zperf/src/zperf_tcp_receiver.c @@ -5,13 +5,15 @@ */ #include -LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); +LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); #include #include #include +#include + #include #include "zperf.h" diff --git a/subsys/net/lib/zperf/zperf_tcp_uploader.c b/samples/net/zperf/src/zperf_tcp_uploader.c similarity index 96% rename from subsys/net/lib/zperf/zperf_tcp_uploader.c rename to samples/net/zperf/src/zperf_tcp_uploader.c index 888b1ce06b3..4b3c3a0ca8f 100644 --- a/subsys/net/lib/zperf/zperf_tcp_uploader.c +++ b/samples/net/zperf/src/zperf_tcp_uploader.c @@ -5,11 +5,12 @@ */ #include -LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); +LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); #include #include +#include #include diff --git a/subsys/net/lib/zperf/zperf_udp_receiver.c b/samples/net/zperf/src/zperf_udp_receiver.c similarity index 99% rename from subsys/net/lib/zperf/zperf_udp_receiver.c rename to samples/net/zperf/src/zperf_udp_receiver.c index 623120e5de1..4e05e31a139 100644 --- a/subsys/net/lib/zperf/zperf_udp_receiver.c +++ b/samples/net/zperf/src/zperf_udp_receiver.c @@ -5,12 +5,13 @@ */ #include -LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); +LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); #include #include #include +#include #include diff --git a/subsys/net/lib/zperf/zperf_udp_uploader.c b/samples/net/zperf/src/zperf_udp_uploader.c similarity index 98% rename from subsys/net/lib/zperf/zperf_udp_uploader.c rename to samples/net/zperf/src/zperf_udp_uploader.c index 3abd22d8a22..d2f69438780 100644 --- a/subsys/net/lib/zperf/zperf_udp_uploader.c +++ b/samples/net/zperf/src/zperf_udp_uploader.c @@ -5,10 +5,12 @@ */ #include -LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL); +LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG); #include +#include + #include #include "zperf.h" diff --git a/subsys/net/lib/CMakeLists.txt b/subsys/net/lib/CMakeLists.txt index ca787566c25..189c918e170 100644 --- a/subsys/net/lib/CMakeLists.txt +++ b/subsys/net/lib/CMakeLists.txt @@ -12,7 +12,6 @@ add_subdirectory_ifdef(CONFIG_NET_SOCKETS sockets) add_subdirectory_ifdef(CONFIG_TLS_CREDENTIALS tls_credentials) add_subdirectory_ifdef(CONFIG_NET_CONNECTION_MANAGER conn_mgr) add_subdirectory_ifdef(CONFIG_NET_CAPTURE capture) -add_subdirectory_ifdef(CONFIG_NET_ZPERF zperf) if (CONFIG_DNS_RESOLVER OR CONFIG_MDNS_RESPONDER diff --git a/subsys/net/lib/Kconfig b/subsys/net/lib/Kconfig index 3cdf56f6c7e..1e8e95fb057 100644 --- a/subsys/net/lib/Kconfig +++ b/subsys/net/lib/Kconfig @@ -39,6 +39,4 @@ source "subsys/net/lib/conn_mgr/Kconfig" source "subsys/net/lib/capture/Kconfig" -source "subsys/net/lib/zperf/Kconfig" - endmenu diff --git a/subsys/net/lib/zperf/CMakeLists.txt b/subsys/net/lib/zperf/CMakeLists.txt deleted file mode 100644 index 9994c617b2f..00000000000 --- a/subsys/net/lib/zperf/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -zephyr_library_named(zperf) - -zephyr_library_sources( - shell_utils.c - zperf_session.c - zperf_shell.c - zperf_udp_receiver.c - zperf_udp_uploader.c - zperf_tcp_receiver.c - zperf_tcp_uploader.c -) - -zephyr_library_include_directories( - ${ZEPHYR_BASE}/subsys/net/ip -) diff --git a/subsys/net/lib/zperf/Kconfig b/subsys/net/lib/zperf/Kconfig deleted file mode 100644 index 5ac5c5c6f5c..00000000000 --- a/subsys/net/lib/zperf/Kconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -menuconfig NET_ZPERF - bool "zperf shell utility" - depends on SHELL - help - This option enables zperf shell utility, which allows to generate - network traffic and evaluate network bandwidth. - -if NET_ZPERF - -module = NET_ZPERF -module-dep = NET_LOG -module-str = Log level for zperf -module-help = Enable debug message of zperf libray. -source "subsys/net/Kconfig.template.log_config.net" - -endif From 3e2206a00fd510c1d6fca0e33fdf47adcc2813af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 292/501] Revert "[nrf fromlist] logging: cleanup in CMakeLists.txt" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 79a27400e324d880ab6f709f684e599180bba753. Signed-off-by: Andrzej Głąbek --- subsys/logging/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/logging/CMakeLists.txt b/subsys/logging/CMakeLists.txt index 9dec1c98faa..786be31c2f1 100644 --- a/subsys/logging/CMakeLists.txt +++ b/subsys/logging/CMakeLists.txt @@ -6,6 +6,7 @@ if(NOT CONFIG_LOG_MODE_MINIMAL) log_core.c log_mgmt.c log_msg.c + log_output.c ) zephyr_sources_ifdef( From 023b1e91e2a55a3734fc2052c6e9ccf6db963929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 293/501] Revert "[nrf fromlist] shell: Fix dependency to log_output" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1996edaf288c12aa9ec4ea9c9b2e4dd432dac2ac. Signed-off-by: Andrzej Głąbek --- subsys/shell/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/shell/Kconfig b/subsys/shell/Kconfig index f59106b9b46..5334cf1e0c3 100644 --- a/subsys/shell/Kconfig +++ b/subsys/shell/Kconfig @@ -228,7 +228,6 @@ config SHELL_LOG_BACKEND bool "Shell log backend" depends on LOG && !LOG_MODE_MINIMAL select MPSC_PBUF - select LOG_OUTPUT default y if LOG help When enabled, backend will use the shell for logging. From ccd6f251f89d5f0afe5627bdd8d5e80fd9933b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 294/501] Revert "[nrf fromlist] net: lwm2m: Fixes FOTA update result code" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1ead7ab0b243f43d03e280d81249dd9947400631. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/lwm2m/lwm2m_obj_firmware.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c b/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c index fa4c6614cf7..c782b0cbc18 100644 --- a/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c +++ b/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c @@ -99,24 +99,16 @@ void lwm2m_firmware_set_update_state_inst(uint16_t obj_inst_id, uint8_t state) bool error = false; char path[LWM2M_MAX_PATH_STR_LEN]; - snprintk(path, sizeof(path), "%" PRIu16 "/%" PRIu16 "/%" PRIu16, - LWM2M_OBJECT_FIRMWARE_ID, obj_inst_id, FIRMWARE_UPDATE_RESULT_ID); - /* Check LWM2M SPEC appendix E.6.1 */ switch (state) { case STATE_DOWNLOADING: - if (update_state[obj_inst_id] == STATE_IDLE) { - lwm2m_engine_set_u8(path, RESULT_DEFAULT); - } else { + if (update_state[obj_inst_id] != STATE_IDLE) { error = true; } break; case STATE_DOWNLOADED: - if (update_state[obj_inst_id] == STATE_DOWNLOADING) { - lwm2m_engine_set_u8(path, RESULT_DEFAULT); - } else if (update_state[obj_inst_id] == STATE_UPDATING) { - lwm2m_engine_set_u8(path, RESULT_UPDATE_FAILED); - } else { + if (update_state[obj_inst_id] != STATE_DOWNLOADING && + update_state[obj_inst_id] != STATE_UPDATING) { error = true; } break; From 2cd700c5a9c5bd92e2f2acf1b89ec7c9d8b360f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:08 +0200 Subject: [PATCH 295/501] Revert "[nrf fromtree] arch: arm: Allow enabling FPU hard ABI with TF-M" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 64b4dbd63d8364f7f427eacdeb1a8840c337ac95. Signed-off-by: Andrzej Głąbek --- arch/arm/core/aarch32/Kconfig | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm/core/aarch32/Kconfig b/arch/arm/core/aarch32/Kconfig index 436b47b77e4..bdf9d0a41d8 100644 --- a/arch/arm/core/aarch32/Kconfig +++ b/arch/arm/core/aarch32/Kconfig @@ -255,16 +255,14 @@ choice config FP_HARDABI bool "Floating point Hard ABI" - # TF-M build system does not build the NS app and libraries correctly with Hard ABI. - # This limitation should be removed in the next TF-M synchronization. - depends on !TFM_BUILD_NS - depends on !(BUILD_WITH_TFM && !TFM_IPC) + depends on !BUILD_WITH_TFM help This option selects the Floating point ABI in which hardware floating point instructions are generated and uses FPU-specific calling conventions. - - Note: When building with TF-M enabled only the IPC mode is supported. + Note: the option is disabled for Zephyr builds with TF-M, as TF-M + does not currently support building with Hard ABI, hence linking + Zephyr with TF-M libraries would not be possible. config FP_SOFTABI bool "Floating point Soft ABI" From 64f541e30a805bd08266d96b2cf8e7b26002699a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 296/501] Revert "[nrf fromtree] modules: tfm: Exclude non-secure TF-M application from build" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3fc60fc18cf3074c9b66840b5aa2e742536a93b9. Signed-off-by: Andrzej Głąbek --- modules/trusted-firmware-m/CMakeLists.txt | 75 ++----------------- modules/trusted-firmware-m/Kconfig.tfm | 34 +-------- samples/tfm_integration/tfm_psa_test/prj.conf | 1 - .../tfm_regression_test/prj.conf | 2 - west.yml | 2 +- 5 files changed, 12 insertions(+), 102 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 36e36c9f841..44f02673f2a 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -49,11 +49,6 @@ if (CONFIG_BUILD_WITH_TFM) else() list(APPEND TFM_CMAKE_ARGS -DBL2=FALSE) endif() - if (CONFIG_TFM_BUILD_NS) - list(APPEND TFM_CMAKE_ARGS -DNS=TRUE) - else() - list(APPEND TFM_CMAKE_ARGS -DNS=FALSE) - endif() if (CONFIG_TFM_ISOLATION_LEVEL) list(APPEND TFM_CMAKE_ARGS -DTFM_ISOLATION_LEVEL=${CONFIG_TFM_ISOLATION_LEVEL}) endif() @@ -153,9 +148,8 @@ if (CONFIG_BUILD_WITH_TFM) set(VENEERS_FILE ${TFM_BINARY_DIR}/secure_fw/s_veneers.o) set(TFM_API_NS_PATH ${TFM_BINARY_DIR}/tf-m-tests/app/libtfm_api_ns.a) - set(PLATFORM_NS_FILE ${TFM_BINARY_DIR}/platform/libplatform_ns.a) set(TFM_GENERATED_INCLUDES ${TFM_BINARY_DIR}/generated/interface/include) - set(TFM_INTERFACE_SOURCE_DIR ${TFM_BINARY_DIR}/install/interface/src) + set(PLATFORM_NS_FILE ${TFM_BINARY_DIR}/platform/libplatform_ns.a) if (TFM_PSA_TEST_SUITE) set(PSA_TEST_VAL_FILE ${TFM_BINARY_DIR}/tf-m-tests/app/psa_api_tests/val/val_nspe.a) @@ -201,25 +195,6 @@ if (CONFIG_BUILD_WITH_TFM) ${TFM_S_SIGNED_BIN_FILE} ${TFM_NS_SIGNED_BIN_FILE} ${TFM_S_NS_SIGNED_BIN_FILE} - - ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_ipc_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_ipc_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_ipc_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_ipc_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_ipc_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_ipc_api.c - - ${TFM_INTERFACE_SOURCE_DIR}/tfm_psa_ns_api.c - - ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_func_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_func_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_func_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_func_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_func_api.c - ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_func_api.c - - # Specific to nordic_nrf platform - ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c ) # Get the toolchain variant @@ -356,51 +331,12 @@ if (CONFIG_BUILD_WITH_TFM) src/zephyr_tfm_log.c interface/interface.c ) - # Non-Secure interface to request system reboot if (CONFIG_TFM_PARTITION_PLATFORM AND NOT CONFIG_TFM_PARTITION_PLATFORM_CUSTOM_REBOOT) zephyr_library_sources(src/reboot.c) endif() zephyr_library_sources_ifndef(CONFIG_TFM_PSA_TEST_NONE src/zephyr_tfm_psa_test.c) - if (TFM_PSA_TEST_SUITE) - zephyr_library_link_libraries( - ${PSA_TEST_VAL_FILE} - ${PSA_TEST_PAL_FILE} - ${PSA_TEST_COMBINE_FILE} - ) - endif() - - if(NOT CONFIG_TFM_BUILD_NS) - if(CONFIG_TFM_IPC) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_ipc_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_ipc_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_ipc_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_ipc_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_ipc_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_ipc_api.c) - - zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_psa_ns_api.c) - else() - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_func_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_func_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_func_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_func_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_func_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_func_api.c) - endif() - - if(CONFIG_SOC_FAMILY_NRF) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c) - endif() - - else() - zephyr_library_link_libraries( - ${TFM_API_NS_PATH} - ${PLATFORM_NS_FILE} - ) - endif() - zephyr_include_directories( ${TFM_GENERATED_INCLUDES} ) @@ -410,6 +346,11 @@ if (CONFIG_BUILD_WITH_TFM) ) zephyr_library_link_libraries( + ${PSA_TEST_VAL_FILE} + ${PSA_TEST_PAL_FILE} + ${PSA_TEST_COMBINE_FILE} + ${PLATFORM_NS_FILE} + ${TFM_API_NS_PATH} ${VENEERS_FILE} ) @@ -467,7 +408,7 @@ if (CONFIG_BUILD_WITH_TFM) set(NS_SIGNED_FILE ${CMAKE_BINARY_DIR}/zephyr_ns_signed.hex) set(S_SIGNED_FILE ${CMAKE_BINARY_DIR}/tfm_s_signed.hex) - if (CONFIG_TFM_USE_NS_APP) + if (CONFIG_TFM_REGRESSION_NS) # Use the TF-M NS binary as the Non-Secure application firmware image set(NS_APP_FILE $) else() @@ -512,7 +453,7 @@ if (CONFIG_BUILD_WITH_TFM) ) else() - if (CONFIG_TFM_USE_NS_APP) + if (CONFIG_TFM_REGRESSION_NS) tfm_sign(sign_cmd_ns NS TRUE ${NS_APP_FILE} ${NS_SIGNED_FILE}) else() tfm_sign(sign_cmd_ns NS FALSE ${NS_APP_FILE} ${NS_SIGNED_FILE}) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index eeb5cdef00f..cb7373b9cbe 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -206,31 +206,6 @@ config TFM_BL2 TFM is designed to run with MCUboot in a certain configuration. This config adds MCUboot to the build - built via TFM's build system. -config TFM_BUILD_NS - bool "Build the TF-M Non-Secure application and libraries" - help - Instruct the TF-M build system to build the TF-M Non-Secure - application and libraries. - - This option is intended for testing purposes only, since this is the - easiest way to build the TF-M regression tests application and test - support libraries in the zephyr build system. - -config TFM_USE_NS_APP - bool "Use the TF-M Non-Secure application" - depends on TFM_BUILD_NS - help - The TF-M build system can produce multiple executable files. - The main one is the TF-M secure firmware. Optionally the TF-M - non-secure application can be built. - Usually the TF-M non-secure application is not used since the - zephyr application is the non-secure application. - With this option enabled this is reversed and the TF-M non-secure - application is used instead of the Zephyr non-secure application. - - This option is intended for testing purposes only, since this is the - easiest way to integrate and run the TF-M regression tests in the - zephyr build system. if TFM_BL2 config TFM_MCUBOOT_IMAGE_NUMBER @@ -290,15 +265,12 @@ config TFM_REGRESSION_S help When enabled, this option signifies that the TF-M build includes the Secure domain regression tests. - The regression tests will be included in the TF-M secure firmware. config TFM_REGRESSION_NS - bool "TF-M Non-Secure Regression tests" + bool "Use the TF-M Non-Secure Regression test application" help - When enabled, this option signifies that the TF-M build includes - the Non-Secure domain regression tests. - The regression tests will be included in the TF-M non-secure - application. + When this is enabled, the Zephyr application as a whole will be + replaced with the TF-M Non-Secure Regression test application. choice TFM_PSA_TEST prompt "Enable a PSA test suite" diff --git a/samples/tfm_integration/tfm_psa_test/prj.conf b/samples/tfm_integration/tfm_psa_test/prj.conf index 3ceca574528..aa35a6c27db 100644 --- a/samples/tfm_integration/tfm_psa_test/prj.conf +++ b/samples/tfm_integration/tfm_psa_test/prj.conf @@ -5,7 +5,6 @@ # CONFIG_BUILD_WITH_TFM=y -CONFIG_TFM_BUILD_NS=y CONFIG_TFM_PROFILE_TYPE_NOT_SET=y CONFIG_QEMU_ICOUNT_SHIFT=1 diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index d6e0b380013..a9200fa5c9e 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -6,8 +6,6 @@ CONFIG_BUILD_WITH_TFM=y CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -CONFIG_TFM_BUILD_NS=y -CONFIG_TFM_USE_NS_APP=y CONFIG_TFM_REGRESSION_S=y CONFIG_TFM_REGRESSION_NS=y diff --git a/west.yml b/west.yml index 7414a027e7e..9cacd48aa11 100644 --- a/west.yml +++ b/west.yml @@ -225,7 +225,7 @@ manifest: groups: - debug - name: trusted-firmware-m - revision: f13209f1883232cbcb9f0c31fb4c63e7c242df0d + revision: 7c53a6e76130a85303f83b15d868a92fdcd5f5be path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 07cdcaa4ca81e692aa36e197d5316217c0adda20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 297/501] Revert "[nrf fromtree] Bluetooth: Mesh: Health_cli: Fix fault test rsp" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2825f7ccf0bfe883243f880a3634a7b6255860b0. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/mesh/health_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/health_cli.c b/subsys/bluetooth/mesh/health_cli.c index a463546b004..9fdb6ae63f4 100644 --- a/subsys/bluetooth/mesh/health_cli.c +++ b/subsys/bluetooth/mesh/health_cli.c @@ -455,7 +455,7 @@ int bt_mesh_health_cli_fault_test(struct bt_mesh_health_cli *cli, struct bt_mesh net_buf_simple_add_le16(&msg, cid); return model_ackd_send(cli->model, ctx, &msg, - (!faults || !fault_count) ? NULL : &cli->ack_ctx, + (!faults || !fault_count) ? &cli->ack_ctx : NULL, OP_HEALTH_FAULT_STATUS, ¶m); } From 707e35ae5cf7626bbfd162372c142ab848d8f19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 298/501] Revert "[nrf fromtree] Bluetooth: Mesh: Health_cli: Fix async cmd rsp" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 24647b6a622f412768825dd8a0a977b301b14692. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/mesh/health_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/health_cli.c b/subsys/bluetooth/mesh/health_cli.c index 9fdb6ae63f4..9a060b21ce7 100644 --- a/subsys/bluetooth/mesh/health_cli.c +++ b/subsys/bluetooth/mesh/health_cli.c @@ -487,7 +487,7 @@ int bt_mesh_health_cli_fault_clear(struct bt_mesh_health_cli *cli, struct bt_mes net_buf_simple_add_le16(&msg, cid); return model_ackd_send(cli->model, ctx, &msg, - (!test_id && (!faults || !fault_count)) ? NULL : &cli->ack_ctx, + (!test_id && (!faults || !fault_count)) ? &cli->ack_ctx : NULL, OP_HEALTH_FAULT_STATUS, ¶m); } @@ -518,7 +518,7 @@ int bt_mesh_health_cli_fault_get(struct bt_mesh_health_cli *cli, struct bt_mesh_ net_buf_simple_add_le16(&msg, cid); return model_ackd_send(cli->model, ctx, &msg, - (!test_id && (!faults || !fault_count)) ? NULL : &cli->ack_ctx, + (!test_id && (!faults || !fault_count)) ? &cli->ack_ctx : NULL, OP_HEALTH_FAULT_STATUS, ¶m); } From a33c1ef71d7e544fd58f4ef747799fec1e7a8e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 299/501] Revert "[nrf fromtree] Bluetooth: Audio: Fix unicast_client avail ctx dir check" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2d65862410e7e4ff966865df14b006589e61f669. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/audio/unicast_client.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subsys/bluetooth/audio/unicast_client.c b/subsys/bluetooth/audio/unicast_client.c index 4b9421399b3..f3edef798e5 100644 --- a/subsys/bluetooth/audio/unicast_client.c +++ b/subsys/bluetooth/audio/unicast_client.c @@ -1963,6 +1963,7 @@ static uint8_t unicast_client_pacs_avail_ctx_notify_cb(struct bt_conn *conn, { struct bt_pacs_context context; struct net_buf_simple buf; + enum bt_audio_dir dir; BT_DBG("conn %p len %u", conn, length); @@ -1985,6 +1986,16 @@ static uint8_t unicast_client_pacs_avail_ctx_notify_cb(struct bt_conn *conn, return BT_GATT_ITER_STOP; } + if (PART_OF_ARRAY(snk_loc_subscribe, params)) { + dir = BT_AUDIO_DIR_SINK; + } else if (PART_OF_ARRAY(src_loc_subscribe, params)) { + dir = BT_AUDIO_DIR_SOURCE; + } else { + BT_ERR("Invalid notification"); + + return BT_GATT_ITER_CONTINUE; + } + net_buf_simple_init_with_data(&buf, (void *)data, length); context.snk = net_buf_simple_pull_le16(&buf); context.src = net_buf_simple_pull_le16(&buf); From 0f9cfd659b08378447b0ae8f56b05f1f1bdd1e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 300/501] Revert "[nrf fromtree] drivers: pinctrl_nrf: Fix nrf_pin_configure() implementation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0179c5349b12704b973bbd6e830ac349dda70fc5. Signed-off-by: Andrzej Głąbek --- drivers/pinctrl/pinctrl_nrf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index f172c344004..924dc2517f3 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -95,8 +95,8 @@ __unused static void nrf_pin_configure(pinctrl_soc_pin_t pin, input = NRF_GPIO_PIN_INPUT_DISCONNECT; } - nrf_gpio_cfg(NRF_GET_PIN(pin), dir, input, NRF_GET_PULL(pin), drive, - NRF_GPIO_PIN_NOSENSE); + nrf_gpio_cfg(NRF_GET_PIN(pin), dir, input, NRF_GET_PULL(pin), + NRF_GET_DRIVE(pin), NRF_GPIO_PIN_NOSENSE); } int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, From f519ca143a4c8453c6c9b9f7e3b2072b64c37e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 301/501] Revert "[nrf fromtree] Bluetooth: Mesh: Use mesh settings API only if setting..." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5ea1da38a8a40802541fb391644a9f61180a4e46. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/mesh/cdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/cdb.c b/subsys/bluetooth/mesh/cdb.c index 6159667597f..ddde3d9f483 100644 --- a/subsys/bluetooth/mesh/cdb.c +++ b/subsys/bluetooth/mesh/cdb.c @@ -728,8 +728,9 @@ void bt_mesh_cdb_clear(void) if (IS_ENABLED(CONFIG_BT_SETTINGS)) { update_cdb_net_settings(); - bt_mesh_settings_store_pending(); } + + bt_mesh_settings_store_pending(); } void bt_mesh_cdb_iv_update(uint32_t iv_index, bool iv_update) From 9e6a06e010a3f12ad2480d5de352314120afed35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 302/501] Revert "[nrf fromtree] Bluetooth: gatt: allow disabling subscription enforcement" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit db63e67bcbf1b9b9b32d90678863ffceab71e333. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/Kconfig.gatt | 8 -------- subsys/bluetooth/host/gatt.c | 32 +++++++++++++----------------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index b2d75d23b4e..a265d2ed42c 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -146,14 +146,6 @@ config BT_GATT_ENFORCE_CHANGE_UNAWARE endif # BT_GATT_CACHING -config BT_GATT_ENFORCE_SUBSCRIPTION - bool "GATT Enforce characteristic subscription" - default y - help - When enabled, this option will make the server block sending - notifications and indications to a device which has not subscribed to - the supplied characteristic. - config BT_GATT_CLIENT bool "GATT client support" help diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index dbf908224fe..515b35cccff 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -2247,15 +2247,13 @@ static int gatt_notify(struct bt_conn *conn, uint16_t handle, return -EPERM; } - if (IS_ENABLED(CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION)) { - /* Check if client has subscribed before sending notifications. - * This is not really required in the Bluetooth specification, - * but follows its spirit. - */ - if (!bt_gatt_is_subscribed(conn, params->attr, BT_GATT_CCC_NOTIFY)) { - BT_WARN("Device is not subscribed to characteristic"); - return -EINVAL; - } + /* Check if client has subscribed before sending notifications. + * This is not really required in the Bluetooth specification, but + * follows its spirit. + */ + if (!bt_gatt_is_subscribed(conn, params->attr, BT_GATT_CCC_NOTIFY)) { + BT_WARN("Device is not subscribed to characteristic"); + return -EINVAL; } if (IS_ENABLED(CONFIG_BT_EATT) && @@ -2400,15 +2398,13 @@ static int gatt_indicate(struct bt_conn *conn, uint16_t handle, return -EPERM; } - if (IS_ENABLED(CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION)) { - /* Check if client has subscribed before sending notifications. - * This is not really required in the Bluetooth specification, - * but follows its spirit. - */ - if (!bt_gatt_is_subscribed(conn, params->attr, BT_GATT_CCC_INDICATE)) { - BT_WARN("Device is not subscribed to characteristic"); - return -EINVAL; - } + /* Check if client has subscribed before sending notifications. + * This is not really required in the Bluetooth specification, but + * follows its spirit. + */ + if (!bt_gatt_is_subscribed(conn, params->attr, BT_GATT_CCC_INDICATE)) { + BT_WARN("Device is not subscribed to characteristic"); + return -EINVAL; } if (IS_ENABLED(CONFIG_BT_EATT) && From f2eb6ee4f01a41a8884f7896b5fbc210e9e64c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 303/501] Revert "[nrf fromtree] Bluetooth: Tests: Add tests for EATT flag API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 012beee9df305c1c1b51b615a11331b0a56cac01. Signed-off-by: Andrzej Głąbek --- .../bsim_test_notify/src/gatt_client_test.c | 179 +++--------------- .../bsim_test_notify/src/gatt_server_test.c | 91 +-------- .../test_scripts/_run_test.sh | 38 ---- .../gatt_notify_enhanced_enhanced.sh | 10 - .../gatt_notify_enhanced_mixed.sh | 10 - .../test_scripts/gatt_notify_enhanced_none.sh | 10 - .../gatt_notify_enhanced_unenhanced.sh | 10 - .../gatt_notify_mixed_enhanced.sh | 10 - .../test_scripts/gatt_notify_mixed_mixed.sh | 10 - .../test_scripts/gatt_notify_mixed_none.sh | 10 - .../gatt_notify_mixed_unenhanced.sh | 10 - .../test_scripts/gatt_notify_none_enhanced.sh | 10 - .../test_scripts/gatt_notify_none_mixed.sh | 10 - .../test_scripts/gatt_notify_none_none.sh | 10 - .../gatt_notify_none_unenhanced.sh | 10 - .../gatt_notify_unenhanced_enhanced.sh | 10 - .../gatt_notify_unenhanced_mixed.sh | 10 - .../gatt_notify_unenhanced_none.sh | 10 - .../gatt_notify_unenhanced_unenhanced.sh | 10 - .../bsim_test_notify/test_scripts/notify.sh | 40 ++++ 20 files changed, 77 insertions(+), 431 deletions(-) delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/_run_test.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_enhanced.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_mixed.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_none.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_unenhanced.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_enhanced.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_mixed.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_none.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_unenhanced.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_enhanced.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_mixed.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_none.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_unenhanced.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_enhanced.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_mixed.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_none.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_unenhanced.sh create mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/notify.sh diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c index e31c275e62e..30432f1f141 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c @@ -12,8 +12,7 @@ CREATE_FLAG(flag_is_connected); CREATE_FLAG(flag_is_encrypted); CREATE_FLAG(flag_discover_complete); -CREATE_FLAG(flag_short_subscribed); -CREATE_FLAG(flag_long_subscribed); +CREATE_FLAG(flag_subscribed); static struct bt_conn *g_conn; static uint16_t chrc_handle; @@ -149,7 +148,7 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at return BT_GATT_ITER_CONTINUE; } -static void gatt_discover(enum bt_att_chan_opt opt) +static void gatt_discover(void) { static struct bt_gatt_discover_params discover_params; int err; @@ -161,7 +160,7 @@ static void gatt_discover(enum bt_att_chan_opt opt) discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; - discover_params.chan_opt = opt; + discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; err = bt_gatt_discover(g_conn, &discover_params); if (err != 0) { @@ -172,14 +171,13 @@ static void gatt_discover(enum bt_att_chan_opt opt) printk("Discover complete\n"); } -static void test_short_subscribed(struct bt_conn *conn, uint8_t err, - struct bt_gatt_write_params *params) +static void test_subscribed(struct bt_conn *conn, uint8_t err, struct bt_gatt_write_params *params) { if (err) { FAIL("Subscribe failed (err %d)\n", err); } - SET_FLAG(flag_short_subscribed); + SET_FLAG(flag_subscribed); if (!params) { printk("params NULL\n"); @@ -188,26 +186,7 @@ static void test_short_subscribed(struct bt_conn *conn, uint8_t err, if (params->handle == chrc_handle) { printk("Subscribed to short characteristic\n"); - } else { - FAIL("Unknown handle %d\n", params->handle); - } -} - -static void test_long_subscribed(struct bt_conn *conn, uint8_t err, - struct bt_gatt_write_params *params) -{ - if (err) { - FAIL("Subscribe failed (err %d)\n", err); - } - - SET_FLAG(flag_long_subscribed); - - if (!params) { - printk("params NULL\n"); - return; - } - - if (params->handle == long_chrc_handle) { + } else if (params->handle == long_chrc_handle) { printk("Subscribed to long characteristic\n"); } else { FAIL("Unknown handle %d\n", params->handle); @@ -226,81 +205,83 @@ uint8_t test_notify(struct bt_conn *conn, struct bt_gatt_subscribe_params *param static struct bt_gatt_discover_params disc_params_short; static struct bt_gatt_subscribe_params sub_params_short = { .notify = test_notify, - .write = test_short_subscribed, + .write = test_subscribed, .ccc_handle = 0, /* Auto-discover CCC*/ .disc_params = &disc_params_short, /* Auto-discover CCC */ .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .value = BT_GATT_CCC_NOTIFY, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static struct bt_gatt_discover_params disc_params_long; static struct bt_gatt_subscribe_params sub_params_long = { .notify = test_notify, - .write = test_long_subscribed, + .write = test_subscribed, .ccc_handle = 0, /* Auto-discover CCC*/ .disc_params = &disc_params_long, /* Auto-discover CCC */ .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .value = BT_GATT_CCC_NOTIFY, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; -static void gatt_subscribe_short(enum bt_att_chan_opt opt) +static void gatt_subscribe_short(void) { int err; sub_params_short.value_handle = chrc_handle; - sub_params_short.chan_opt = opt; err = bt_gatt_subscribe(g_conn, &sub_params_short); if (err < 0) { FAIL("Failed to subscribe\n"); } else { printk("Subscribe request sent\n"); } + WAIT_FOR_FLAG(flag_subscribed); } -static void gatt_unsubscribe_short(enum bt_att_chan_opt opt) +static void gatt_unsubscribe_short(void) { int err; sub_params_short.value_handle = chrc_handle; - sub_params_short.chan_opt = opt; err = bt_gatt_unsubscribe(g_conn, &sub_params_short); if (err < 0) { FAIL("Failed to unsubscribe\n"); } else { printk("Unsubscribe request sent\n"); } + WAIT_FOR_FLAG(flag_subscribed); } -static void gatt_subscribe_long(enum bt_att_chan_opt opt) +static void gatt_subscribe_long(void) { int err; - UNSET_FLAG(flag_long_subscribed); + UNSET_FLAG(flag_subscribed); sub_params_long.value_handle = long_chrc_handle; - sub_params_long.chan_opt = opt; err = bt_gatt_subscribe(g_conn, &sub_params_long); if (err < 0) { FAIL("Failed to subscribe\n"); } else { printk("Subscribe request sent\n"); } + WAIT_FOR_FLAG(flag_subscribed); } -static void gatt_unsubscribe_long(enum bt_att_chan_opt opt) +static void gatt_unsubscribe_long(void) { int err; - UNSET_FLAG(flag_long_subscribed); + UNSET_FLAG(flag_subscribed); sub_params_long.value_handle = long_chrc_handle; - sub_params_long.chan_opt = opt; err = bt_gatt_unsubscribe(g_conn, &sub_params_long); if (err < 0) { FAIL("Failed to unsubscribe\n"); } else { printk("Unsubscribe request sent\n"); } + WAIT_FOR_FLAG(flag_subscribed); } -static void setup(void) +static void test_main(void) { int err; @@ -330,42 +311,10 @@ static void setup(void) } printk("EATT connected\n"); -} - -static void test_main_none(void) -{ - setup(); - gatt_discover(BT_ATT_CHAN_OPT_NONE); - gatt_subscribe_short(BT_ATT_CHAN_OPT_NONE); - gatt_subscribe_long(BT_ATT_CHAN_OPT_NONE); - WAIT_FOR_FLAG(flag_short_subscribed); - WAIT_FOR_FLAG(flag_long_subscribed); - printk("Subscribed\n"); - - while (num_notifications < NOTIFICATION_COUNT) { - k_sleep(K_MSEC(100)); - } - - gatt_unsubscribe_short(BT_ATT_CHAN_OPT_NONE); - gatt_unsubscribe_long(BT_ATT_CHAN_OPT_NONE); - WAIT_FOR_FLAG(flag_short_subscribed); - WAIT_FOR_FLAG(flag_long_subscribed); - - printk("Unsubscribed\n"); - - PASS("GATT client Passed\n"); -} - -static void test_main_unenhanced(void) -{ - setup(); - - gatt_discover(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - gatt_subscribe_short(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - gatt_subscribe_long(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - WAIT_FOR_FLAG(flag_short_subscribed); - WAIT_FOR_FLAG(flag_long_subscribed); + gatt_discover(); + gatt_subscribe_short(); + gatt_subscribe_long(); printk("Subscribed\n"); @@ -373,62 +322,8 @@ static void test_main_unenhanced(void) k_sleep(K_MSEC(100)); } - gatt_unsubscribe_short(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - gatt_unsubscribe_long(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - WAIT_FOR_FLAG(flag_short_subscribed); - WAIT_FOR_FLAG(flag_long_subscribed); - - printk("Unsubscribed\n"); - - PASS("GATT client Passed\n"); -} - -static void test_main_enhanced(void) -{ - setup(); - - gatt_discover(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - gatt_subscribe_short(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - gatt_subscribe_long(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - WAIT_FOR_FLAG(flag_short_subscribed); - WAIT_FOR_FLAG(flag_long_subscribed); - - printk("Subscribed\n"); - - while (num_notifications < NOTIFICATION_COUNT) { - k_sleep(K_MSEC(100)); - } - - gatt_unsubscribe_short(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - gatt_unsubscribe_long(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - WAIT_FOR_FLAG(flag_short_subscribed); - WAIT_FOR_FLAG(flag_long_subscribed); - - printk("Unsubscribed\n"); - - PASS("GATT client Passed\n"); -} - -static void test_main_mixed(void) -{ - setup(); - - gatt_discover(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - gatt_subscribe_short(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - gatt_subscribe_long(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - WAIT_FOR_FLAG(flag_short_subscribed); - WAIT_FOR_FLAG(flag_long_subscribed); - - printk("Subscribed\n"); - - while (num_notifications < NOTIFICATION_COUNT) { - k_sleep(K_MSEC(100)); - } - - gatt_unsubscribe_short(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - gatt_unsubscribe_long(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - WAIT_FOR_FLAG(flag_short_subscribed); - WAIT_FOR_FLAG(flag_long_subscribed); + gatt_unsubscribe_short(); + gatt_unsubscribe_long(); printk("Unsubscribed\n"); @@ -437,28 +332,10 @@ static void test_main_mixed(void) static const struct bst_test_instance test_vcs[] = { { - .test_id = "gatt_client_none", - .test_post_init_f = test_init, - .test_tick_f = test_tick, - .test_main_f = test_main_none, - }, - { - .test_id = "gatt_client_unenhanced", - .test_post_init_f = test_init, - .test_tick_f = test_tick, - .test_main_f = test_main_unenhanced, - }, - { - .test_id = "gatt_client_enhanced", - .test_post_init_f = test_init, - .test_tick_f = test_tick, - .test_main_f = test_main_enhanced, - }, - { - .test_id = "gatt_client_mixed", + .test_id = "gatt_client", .test_post_init_f = test_init, .test_tick_f = test_tick, - .test_main_f = test_main_mixed, + .test_main_f = test_main, }, BSTEST_END_MARKER, }; diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c index d514376c717..760e3185592 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c @@ -115,7 +115,7 @@ static void notification_sent(struct bt_conn *conn, void *user_data) printk("Sent notification #%u with length %d\n", num_notifications_sent++, *length); } -static void short_notify(enum bt_att_chan_opt opt) +static inline void short_notify(void) { static size_t length = CHRC_SIZE; static struct bt_gatt_notify_params params = { @@ -125,11 +125,10 @@ static void short_notify(enum bt_att_chan_opt opt) .func = notification_sent, .user_data = &length, .uuid = NULL, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; - params.chan_opt = opt; - do { err = bt_gatt_notify_cb(g_conn, ¶ms); @@ -141,7 +140,7 @@ static void short_notify(enum bt_att_chan_opt opt) } while (err); } -static void long_notify(enum bt_att_chan_opt opt) +static inline void long_notify(void) { static size_t length = LONG_CHRC_SIZE; static struct bt_gatt_notify_params params = { @@ -151,11 +150,10 @@ static void long_notify(enum bt_att_chan_opt opt) .func = notification_sent, .user_data = &length, .uuid = NULL, + .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; - params.chan_opt = opt; - do { err = bt_gatt_notify_cb(g_conn, ¶ms); @@ -167,7 +165,7 @@ static void long_notify(enum bt_att_chan_opt opt) } while (err); } -static void setup(void) +static void test_main(void) { int err; const struct bt_data ad[] = { @@ -199,63 +197,10 @@ static void setup(void) WAIT_FOR_FLAG(flag_short_subscribe); WAIT_FOR_FLAG(flag_long_subscribe); -} - -static void test_main_none(void) -{ - setup(); for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { - short_notify(BT_ATT_CHAN_OPT_NONE); - long_notify(BT_ATT_CHAN_OPT_NONE); - } - - while (num_notifications_sent < NOTIFICATION_COUNT) { - k_sleep(K_MSEC(100)); - } - - PASS("GATT server passed\n"); -} - -static void test_main_enhanced(void) -{ - setup(); - - for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { - short_notify(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - long_notify(BT_ATT_CHAN_OPT_ENHANCED_ONLY); - } - - while (num_notifications_sent < NOTIFICATION_COUNT) { - k_sleep(K_MSEC(100)); - } - - PASS("GATT server passed\n"); -} - -static void test_main_unenhanced(void) -{ - setup(); - - for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { - short_notify(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - long_notify(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - } - - while (num_notifications_sent < NOTIFICATION_COUNT) { - k_sleep(K_MSEC(100)); - } - - PASS("GATT server passed\n"); -} - -static void test_main_mixed(void) -{ - setup(); - - for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { - short_notify(BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - long_notify(BT_ATT_CHAN_OPT_ENHANCED_ONLY); + short_notify(); + long_notify(); } while (num_notifications_sent < NOTIFICATION_COUNT) { @@ -267,28 +212,10 @@ static void test_main_mixed(void) static const struct bst_test_instance test_gatt_server[] = { { - .test_id = "gatt_server_none", - .test_post_init_f = test_init, - .test_tick_f = test_tick, - .test_main_f = test_main_none, - }, - { - .test_id = "gatt_server_unenhanced", - .test_post_init_f = test_init, - .test_tick_f = test_tick, - .test_main_f = test_main_unenhanced, - }, - { - .test_id = "gatt_server_enhanced", - .test_post_init_f = test_init, - .test_tick_f = test_tick, - .test_main_f = test_main_enhanced, - }, - { - .test_id = "gatt_server_mixed", + .test_id = "gatt_server", .test_post_init_f = test_init, .test_tick_f = test_tick, - .test_main_f = test_main_mixed, + .test_main_f = test_main, }, BSTEST_END_MARKER, }; diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/_run_test.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/_run_test.sh deleted file mode 100755 index 14d93c0bf27..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/_run_test.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -verbosity_level=2 -process_ids="" -exit_code=0 - -function Execute() { - if [ ! -f $1 ]; then - echo -e " \e[91m$(pwd)/$(basename $1) cannot be found (did you forget to\ - compile it?)\e[39m" - exit 1 - fi - timeout 30 $@ & - process_ids="$process_ids $!" -} - -: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" - -#Give a default value to BOARD if it does not have one yet: -BOARD="${BOARD:-nrf52_bsim}" - -cd ${BSIM_OUT_PATH}/bin - -Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=${client_id} - -Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=${server_id} - -Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ - -D=2 -sim_length=60e6 $@ - -for process_id in $process_ids; do - wait $process_id || let "exit_code=$?" -done -exit $exit_code #the last exit code != 0 diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_enhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_enhanced.sh deleted file mode 100755 index 68cf9409994..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_enhanced.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_enhanced_enhanced" \ - server_id="gatt_server_enhanced" \ - client_id="gatt_client_enhanced" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_mixed.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_mixed.sh deleted file mode 100755 index 75a4b9d83c9..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_mixed.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_enhanced_mixed" \ - server_id="gatt_server_enhanced" \ - client_id="gatt_client_mixed" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_none.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_none.sh deleted file mode 100755 index e89b16ca20e..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_none.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_enhanced_none" \ - server_id="gatt_server_enhanced" \ - client_id="gatt_client_none" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_unenhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_unenhanced.sh deleted file mode 100755 index 5cc85731633..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_enhanced_unenhanced.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_enhanced_unenhanced" \ - server_id="gatt_server_enhanced" \ - client_id="gatt_client_unenhanced" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_enhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_enhanced.sh deleted file mode 100755 index a4ecf9d429b..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_enhanced.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_mixed_enhanced" \ - server_id="gatt_server_mixed" \ - client_id="gatt_client_enhanced" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_mixed.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_mixed.sh deleted file mode 100755 index a9f38d8f37f..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_mixed.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_mixed_mixed" \ - server_id="gatt_server_mixed" \ - client_id="gatt_client_mixed" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_none.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_none.sh deleted file mode 100755 index 80afe822cfd..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_none.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_mixed_none" \ - server_id="gatt_server_mixed" \ - client_id="gatt_client_none" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_unenhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_unenhanced.sh deleted file mode 100755 index 9ff73b2de4b..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_mixed_unenhanced.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_mixed_unenhanced" \ - server_id="gatt_server_mixed" \ - client_id="gatt_client_unenhanced" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_enhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_enhanced.sh deleted file mode 100755 index 74eedd15ddc..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_enhanced.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_none_enhanced" \ - server_id="gatt_server_none" \ - client_id="gatt_client_enhanced" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_mixed.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_mixed.sh deleted file mode 100755 index 02541c6db74..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_mixed.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_none_mixed" \ - server_id="gatt_server_none" \ - client_id="gatt_client_mixed" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_none.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_none.sh deleted file mode 100755 index 6642f8ed2b5..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_none.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_none_none" \ - server_id="gatt_server_none" \ - client_id="gatt_client_none" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_unenhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_unenhanced.sh deleted file mode 100755 index 2f2764186c7..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_none_unenhanced.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_none_unenhanced" \ - server_id="gatt_server_none" \ - client_id="gatt_client_unenhanced" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_enhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_enhanced.sh deleted file mode 100755 index ab91b23437d..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_enhanced.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_unenhanced_enhanced" \ - server_id="gatt_server_unenhanced" \ - client_id="gatt_client_enhanced" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_mixed.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_mixed.sh deleted file mode 100755 index 57063ac272b..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_mixed.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_unenhanced_mixed" \ - server_id="gatt_server_unenhanced" \ - client_id="gatt_client_mixed" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_none.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_none.sh deleted file mode 100755 index df360db4e5e..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_none.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_unenhanced_none" \ - server_id="gatt_server_unenhanced" \ - client_id="gatt_client_none" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_unenhanced.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_unenhanced.sh deleted file mode 100755 index 7b624969d5d..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/gatt_notify_unenhanced_unenhanced.sh +++ /dev/null @@ -1,10 +0,0 @@ - -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="gatt_notify_unenhanced_unenhanced" \ - server_id="gatt_server_unenhanced" \ - client_id="gatt_client_unenhanced" \ - $(dirname "${BASH_SOURCE[0]}")/_run_test.sh - diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/notify.sh b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/notify.sh new file mode 100755 index 00000000000..973f0ae3baf --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/test_scripts/notify.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# Copyright 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Basic GATT test: A central acting as a GATT client scans for and connects +# to a peripheral acting as a GATT server. The GATT client will then attempt +# to write and read to and from a few GATT characteristics. +simulation_id="notify_cb" +verbosity_level=2 +process_ids=""; exit_code=0 + +function Execute(){ + if [ ! -f $1 ]; then + echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\ + compile it?)\e[39m" + exit 1 + fi + timeout 120 $@ & process_ids="$process_ids $!" +} + +: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" + +#Give a default value to BOARD if it does not have one yet: +BOARD="${BOARD:-nrf52_bsim}" + +cd ${BSIM_OUT_PATH}/bin + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=gatt_client + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=gatt_server + +Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ + -D=2 -sim_length=60e6 $@ + +for process_id in $process_ids; do + wait $process_id || let "exit_code=$?" +done +exit $exit_code #the last exit code != 0 From 729614778af9c32127d3cebe6063260f589fea8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 304/501] Revert "[nrf fromtree] Bluetooth: Host: Get first packet matching channel" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 20f5577ac16994708926f85396cb649b88cf6ebd. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/att.c | 131 +++++++----------------------------- 1 file changed, 23 insertions(+), 108 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index df2f1c8e324..e57e5ca79a9 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -291,76 +291,12 @@ static bool att_chan_matches_chan_opt(struct bt_att_chan *chan, enum bt_att_chan } } -static struct net_buf *get_first_buf_matching_chan(struct k_fifo *fifo, struct bt_att_chan *chan) -{ - if (IS_ENABLED(CONFIG_BT_EATT)) { - struct k_fifo skipped; - struct net_buf *buf; - struct net_buf *ret = NULL; - - k_fifo_init(&skipped); - - while ((buf = net_buf_get(fifo, K_NO_WAIT))) { - if (!ret && - att_chan_matches_chan_opt(chan, bt_att_tx_meta_data(buf)->chan_opt)) { - ret = buf; - } else { - net_buf_put(&skipped, buf); - } - } - - __ASSERT_NO_MSG(k_fifo_is_empty(fifo)); - - while ((buf = net_buf_get(&skipped, K_NO_WAIT))) { - net_buf_put(fifo, buf); - } - - __ASSERT_NO_MSG(k_fifo_is_empty(&skipped)); - - return ret; - } else { - return net_buf_get(fifo, K_NO_WAIT); - } -} - -static struct bt_att_req *get_first_req_matching_chan(sys_slist_t *reqs, struct bt_att_chan *chan) -{ - if (IS_ENABLED(CONFIG_BT_EATT)) { - sys_snode_t *curr, *prev = NULL; - - SYS_SLIST_FOR_EACH_NODE(reqs, curr) { - if (att_chan_matches_chan_opt( - chan, bt_att_tx_meta_data(ATT_REQ(curr)->buf)->chan_opt)) { - break; - } - - prev = curr; - } - - if (curr) { - sys_slist_remove(reqs, prev, curr); - - return ATT_REQ(curr); - } - - return NULL; - } - - sys_snode_t *node = sys_slist_get(reqs); - - if (node) { - return ATT_REQ(node); - } else { - return NULL; - } -} - static int process_queue(struct bt_att_chan *chan, struct k_fifo *queue) { struct net_buf *buf; int err; - buf = get_first_buf_matching_chan(queue, chan); + buf = net_buf_get(queue, K_NO_WAIT); if (buf) { err = bt_att_chan_send(chan, buf); if (err) { @@ -661,27 +597,18 @@ static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf) static void att_send_process(struct bt_att *att) { - struct bt_att_chan *chan, *tmp, *prev = NULL; - int err = 0; + struct bt_att_chan *chan, *tmp; + int err; SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&att->chans, chan, tmp, node) { - if (err == -ENOENT && prev && - (atomic_test_bit(chan->flags, ATT_ENHANCED) == - atomic_test_bit(prev->flags, ATT_ENHANCED))) { - /* If there was nothing to send for the previous channel and the current - * channel has the same "enhancedness", there will be nothing to send for - * this channel either. - */ - continue; - } - err = process_queue(chan, &att->tx_queue); if (!err) { /* Success */ return; + } else if (err == -ENOENT) { + /* Nothing to send */ + return; } - - prev = chan; } } @@ -800,40 +727,28 @@ static int bt_att_chan_req_send(struct bt_att_chan *chan, static void att_req_send_process(struct bt_att *att) { - struct bt_att_req *req = NULL; - struct bt_att_chan *chan, *tmp, *prev = NULL; - - SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&att->chans, chan, tmp, node) { - /* If there is an ongoing transaction, do not use the channel */ - if (chan->req) { - continue; - } - - if (!req && prev && - (atomic_test_bit(chan->flags, ATT_ENHANCED) == - atomic_test_bit(prev->flags, ATT_ENHANCED))) { - /* If there was nothing to send for the previous channel and the current - * channel has the same "enhancedness", there will be nothing to send for - * this channel either. - */ - continue; - } + sys_snode_t *node; + struct bt_att_chan *chan, *tmp; - prev = chan; + /* Pull next request from the list */ + node = sys_slist_get(&att->reqs); + if (!node) { + return; + } - /* Pull next request from the list */ - req = get_first_req_matching_chan(&att->reqs, chan); - if (!req) { - continue; - } + BT_DBG("req %p", ATT_REQ(node)); - if (bt_att_chan_req_send(chan, req) >= 0) { - return; + SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&att->chans, chan, tmp, node) { + /* If there is nothing pending use the channel */ + if (!chan->req) { + if (bt_att_chan_req_send(chan, ATT_REQ(node)) >= 0) { + return; + } } - - /* Prepend back to the list as it could not be sent */ - sys_slist_prepend(&att->reqs, &req->node); } + + /* Prepend back to the list as it could not be sent */ + sys_slist_prepend(&att->reqs, node); } static uint8_t att_handle_rsp(struct bt_att_chan *chan, void *pdu, uint16_t len, From 343c3fa3368e735a12e83588fa701917d680c388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 305/501] Revert "[nrf fromtree] Bluetooth: Host: Move all sending from tx_queue to process_queue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6b0ea239a474f714b69bb1ce91e5a087f7d8f0ce. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/att.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index e57e5ca79a9..69d8547c947 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -598,18 +598,25 @@ static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf) static void att_send_process(struct bt_att *att) { struct bt_att_chan *chan, *tmp; - int err; + struct net_buf *buf; + int err = -ENOENT; + + buf = net_buf_get(&att->tx_queue, K_NO_WAIT); + if (!buf) { + return; + } SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&att->chans, chan, tmp, node) { - err = process_queue(chan, &att->tx_queue); - if (!err) { - /* Success */ - return; - } else if (err == -ENOENT) { - /* Nothing to send */ - return; + err = bt_att_chan_send(chan, buf); + if (err >= 0) { + break; } } + + if (err < 0) { + /* Push it back if it could not be send */ + k_queue_prepend(&att->tx_queue._queue, buf); + } } static void bt_att_chan_send_rsp(struct bt_att_chan *chan, struct net_buf *buf) From 32865629b3b5e0662a22511b7622f3f242ad8806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 306/501] Revert "[nrf fromtree] doc: Bluetooth: Add ATT section in docs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cc958fddbb0912a8b940b9412d42967d8f43a527. Signed-off-by: Andrzej Głąbek --- doc/connectivity/bluetooth/api/att.rst | 9 --------- doc/connectivity/bluetooth/api/index.rst | 1 - doc/zephyr.doxyfile.in | 1 - include/zephyr/bluetooth/att.h | 11 ----------- 4 files changed, 22 deletions(-) delete mode 100644 doc/connectivity/bluetooth/api/att.rst diff --git a/doc/connectivity/bluetooth/api/att.rst b/doc/connectivity/bluetooth/api/att.rst deleted file mode 100644 index bc663e2c108..00000000000 --- a/doc/connectivity/bluetooth/api/att.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. _bt_att: - -Attribute Protocol (ATT) -######################## - -API Reference -************* - -.. doxygengroup:: bt_att diff --git a/doc/connectivity/bluetooth/api/index.rst b/doc/connectivity/bluetooth/api/index.rst index c0473b9f1ae..9ab9bb31961 100644 --- a/doc/connectivity/bluetooth/api/index.rst +++ b/doc/connectivity/bluetooth/api/index.rst @@ -6,7 +6,6 @@ Bluetooth APIs .. toctree:: :maxdepth: 1 - att.rst audio.rst connection_mgmt.rst controller.rst diff --git a/doc/zephyr.doxyfile.in b/doc/zephyr.doxyfile.in index 561a840007c..82039d46c86 100644 --- a/doc/zephyr.doxyfile.in +++ b/doc/zephyr.doxyfile.in @@ -2256,7 +2256,6 @@ PREDEFINED = __DOXYGEN__ \ CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT \ CONFIG_ARCH_HAS_CUSTOM_SWAP_TO_MAIN \ CONFIG_BT_BREDR \ - CONFIG_BT_EATT \ CONFIG_BT_MESH_MODEL_EXTENSIONS \ CONFIG_BT_REMOTE_INFO \ CONFIG_BT_USER_DATA_LEN_UPDATE \ diff --git a/include/zephyr/bluetooth/att.h b/include/zephyr/bluetooth/att.h index 64046c5b490..9b94a4f2031 100644 --- a/include/zephyr/bluetooth/att.h +++ b/include/zephyr/bluetooth/att.h @@ -10,13 +10,6 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ #define ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ -/** - * @brief Attribute Protocol (ATT) - * @defgroup bt_att Attribute Protocol (ATT) - * @ingroup bluetooth - * @{ - */ - #include #include @@ -117,8 +110,4 @@ enum bt_att_chan_opt { } #endif -/** - * @} - */ - #endif /* ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ */ From 407927595e9cf586513bc79baa70ae626142bd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 307/501] Revert "[nrf fromtree] Bluetooth: Host: Fix bt_eatt_connect returning -EINVAL if conn is NULL" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2631573f2fd530733338a2cb1cd9da180c55e95c. Signed-off-by: Andrzej Głąbek --- include/zephyr/bluetooth/att.h | 3 ++- subsys/bluetooth/host/att.c | 11 ++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/zephyr/bluetooth/att.h b/include/zephyr/bluetooth/att.h index 9b94a4f2031..0c4e3c693e8 100644 --- a/include/zephyr/bluetooth/att.h +++ b/include/zephyr/bluetooth/att.h @@ -76,7 +76,8 @@ int bt_eatt_reconfigure(struct bt_conn *conn, uint16_t mtu); * Must be in the range 1 - @kconfig{CONFIG_BT_EATT_MAX}, inclusive. * * @return 0 in case of success or negative value in case of error. - * @retval -EINVAL if @p num_channels is not in the allowed range or @p conn is NULL. + * @retval -EINVAL if @p num_channels is not in the allowed range. + * @retval -EINVAL if @p conn is NULL. * @retval -ENOMEM if less than @p num_channels are allocated. * @retval 0 in case of success */ diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 69d8547c947..8e724ef3b91 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -3344,8 +3344,8 @@ static void ecred_connect_rsp_cb(struct bt_conn *conn, uint16_t result, int bt_eatt_connect(struct bt_conn *conn, size_t num_channels) { - struct bt_att_chan *att_chan; - struct bt_att *att; + struct bt_att_chan *att_chan = att_get_fixed_chan(conn); + struct bt_att *att = att_chan->att; struct bt_l2cap_chan *chan[CONFIG_BT_EATT_MAX + 1] = {}; size_t offset = 0; size_t i = 0; @@ -3363,13 +3363,6 @@ int bt_eatt_connect(struct bt_conn *conn, size_t num_channels) return -EINVAL; } - if (!conn) { - return -EINVAL; - } - - att_chan = att_get_fixed_chan(conn); - att = att_chan->att; - while (num_channels--) { att_chan = att_chan_new(att, BIT(ATT_ENHANCED)); if (!att_chan) { From d2093c74351d54324d1d9ec9d0fbaf4993f3ed31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 308/501] Revert "[nrf fromtree] doc: release-notes: Document Bluetooth EATT API change" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 03d3d8c8645afab96d6d8dd7e2ded947447ff5e0. Signed-off-by: Andrzej Głąbek --- doc/releases/release-notes-3.1.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/releases/release-notes-3.1.rst b/doc/releases/release-notes-3.1.rst index 517ef1c6e3c..2e3d8acbc50 100644 --- a/doc/releases/release-notes-3.1.rst +++ b/doc/releases/release-notes-3.1.rst @@ -25,9 +25,6 @@ Changes in this release * LoRaWAN: The message type parameter in :c:func:`lorawan_send` was changed from ``uint8_t`` to ``enum lorawan_message_type``. If ``0`` was passed for unconfirmed message, this has to be changed to ``LORAWAN_MSG_UNCONFIRMED``. -* Bluetooth: Applications where :kconfig:option:`CONFIG_BT_EATT` is enabled - must set the :c:member:`chan_opt` field on the GATT parameter structs. - To keep the old behavior use :c:enumerator:`BT_ATT_CHAN_OPT_NONE`. * Disk Subsystem: SPI mode SD cards now use the SD subsystem to communicate with SD cards. See :ref:`the disk access api ` for an From e3310806e269f644305f749d5c4935f45daba535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 309/501] Revert "[nrf fromtree] Bluetooth: Host: Check if channel option is valid" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit edbb80a14ceceeae96164bc56cffda91644bf538. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/att.c | 17 ----------------- subsys/bluetooth/host/att_internal.h | 2 -- subsys/bluetooth/host/gatt.c | 15 --------------- 3 files changed, 34 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 8e724ef3b91..eaee5e4c9c3 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -3804,20 +3804,3 @@ void bt_att_free_tx_meta_data(const struct net_buf *buf) { tx_meta_data_free(bt_att_tx_meta_data(buf)); } - -bool bt_att_chan_opt_valid(struct bt_conn *conn, enum bt_att_chan_opt chan_opt) -{ - if ((chan_opt & (BT_ATT_CHAN_OPT_ENHANCED_ONLY | BT_ATT_CHAN_OPT_UNENHANCED_ONLY)) == - (BT_ATT_CHAN_OPT_ENHANCED_ONLY | BT_ATT_CHAN_OPT_UNENHANCED_ONLY)) { - /* Enhanced and Unenhanced are mutually exclusive */ - return false; - } - - /* Choosing EATT requires EATT channels connected and encryption enabled */ - if (chan_opt & BT_ATT_CHAN_OPT_ENHANCED_ONLY) { - return (bt_conn_get_security(conn) > BT_SECURITY_L1) && - !bt_att_fixed_chan_only(conn); - } - - return true; -} diff --git a/subsys/bluetooth/host/att_internal.h b/subsys/bluetooth/host/att_internal.h index 4afb65b5acc..e3fbb44a245 100644 --- a/subsys/bluetooth/host/att_internal.h +++ b/subsys/bluetooth/host/att_internal.h @@ -332,5 +332,3 @@ void bt_att_free_tx_meta_data(const struct net_buf *buf); #else #define BT_ATT_CHAN_OPT(_params) BT_ATT_CHAN_OPT_UNENHANCED_ONLY #endif /* CONFIG_BT_EATT */ - -bool bt_att_chan_opt_valid(struct bt_conn *conn, enum bt_att_chan_opt chan_opt); diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 515b35cccff..48ae5ffdc41 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -2256,11 +2256,6 @@ static int gatt_notify(struct bt_conn *conn, uint16_t handle, return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_EATT) && - !bt_att_chan_opt_valid(conn, BT_ATT_CHAN_OPT(params))) { - return -EINVAL; - } - #if defined(CONFIG_BT_GATT_NOTIFY_MULTIPLE) && (CONFIG_BT_GATT_NOTIFY_MULTIPLE_FLUSH_MS != 0) if (gatt_cf_notify_multi(conn)) { return gatt_notify_mult(conn, handle, params); @@ -2335,11 +2330,6 @@ static int gatt_req_send(struct bt_conn *conn, bt_att_func_t func, void *params, struct net_buf *buf; int err; - if (IS_ENABLED(CONFIG_BT_EATT) && - !bt_att_chan_opt_valid(conn, chan_opt)) { - return -EINVAL; - } - req = gatt_req_alloc(func, params, encode, op, len); if (!req) { return -ENOMEM; @@ -2407,11 +2397,6 @@ static int gatt_indicate(struct bt_conn *conn, uint16_t handle, return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_EATT) && - !bt_att_chan_opt_valid(conn, BT_ATT_CHAN_OPT(params))) { - return -EINVAL; - } - len = sizeof(*ind) + params->len; req = gatt_req_alloc(gatt_indicate_rsp, params, NULL, From dfc84df0ffd30eeb6e66d84fcde37b668964b1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 310/501] Revert "[nrf fromtree] Bluetooth: Tests: Use chan_opt BT_ATT_CHAN_ANY" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 93025b9d98a2c49f6f3645ffbf6f6c107022d905. Signed-off-by: Andrzej Głąbek --- .../bsim_test_eatt_notif/src/client_test.c | 1 - .../bsim_test_gatt_caching/src/gatt_client_test.c | 5 ----- .../bsim_test_notify/src/gatt_client_test.c | 3 --- .../bsim_test_notify/src/gatt_server_test.c | 2 -- tests/bluetooth/tester/src/gatt.c | 15 --------------- 5 files changed, 26 deletions(-) diff --git a/tests/bluetooth/bsim_bt/bsim_test_eatt_notif/src/client_test.c b/tests/bluetooth/bsim_bt/bsim_test_eatt_notif/src/client_test.c index 8b399c1c4c3..d092e18d1ff 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_eatt_notif/src/client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_eatt_notif/src/client_test.c @@ -153,7 +153,6 @@ static void gatt_discover(void) discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; err = bt_gatt_discover(g_conn, &discover_params); if (err != 0) { diff --git a/tests/bluetooth/bsim_bt/bsim_test_gatt_caching/src/gatt_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_gatt_caching/src/gatt_client_test.c index f9932b62cf3..2493fc08a22 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_gatt_caching/src/gatt_client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_gatt_caching/src/gatt_client_test.c @@ -165,7 +165,6 @@ static void gatt_discover(const struct bt_uuid *uuid, uint8_t type) discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = type; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; UNSET_FLAG(flag_discover_complete); @@ -183,7 +182,6 @@ static struct bt_gatt_read_params chan_1_read = { .handle = 0, /* Will be set later */ .offset = 0, }, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static struct bt_gatt_read_params chan_2_read = { .handle_count = 1, @@ -191,7 +189,6 @@ static struct bt_gatt_read_params chan_2_read = { .handle = 0, /* Will be set later */ .offset = 0, }, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static struct bt_gatt_read_params db_hash_read = { .handle_count = 0, @@ -200,7 +197,6 @@ static struct bt_gatt_read_params db_hash_read = { .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .uuid = BT_UUID_GATT_DB_HASH, }, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; void expect_status(uint8_t err, uint8_t status) @@ -299,7 +295,6 @@ static void enable_robust_caching(void) .offset = 0, .data = csf, .length = sizeof(csf), - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c index 30432f1f141..749d3bd31bd 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_client_test.c @@ -160,7 +160,6 @@ static void gatt_discover(void) discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; err = bt_gatt_discover(g_conn, &discover_params); if (err != 0) { @@ -210,7 +209,6 @@ static struct bt_gatt_subscribe_params sub_params_short = { .disc_params = &disc_params_short, /* Auto-discover CCC */ .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .value = BT_GATT_CCC_NOTIFY, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static struct bt_gatt_discover_params disc_params_long; static struct bt_gatt_subscribe_params sub_params_long = { @@ -220,7 +218,6 @@ static struct bt_gatt_subscribe_params sub_params_long = { .disc_params = &disc_params_long, /* Auto-discover CCC */ .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, .value = BT_GATT_CCC_NOTIFY, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; static void gatt_subscribe_short(void) diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c index 760e3185592..6923d26f67b 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_notify/src/gatt_server_test.c @@ -125,7 +125,6 @@ static inline void short_notify(void) .func = notification_sent, .user_data = &length, .uuid = NULL, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; @@ -150,7 +149,6 @@ static inline void long_notify(void) .func = notification_sent, .user_data = &length, .uuid = NULL, - .chan_opt = BT_ATT_CHAN_OPT_NONE, }; int err; diff --git a/tests/bluetooth/tester/src/gatt.c b/tests/bluetooth/tester/src/gatt.c index 2d460378549..1dbdd21dfd4 100644 --- a/tests/bluetooth/tester/src/gatt.c +++ b/tests/bluetooth/tester/src/gatt.c @@ -795,7 +795,6 @@ static uint8_t alloc_value(struct bt_gatt_attr *attr, struct set_value *data) indicate_params.len = value->len; indicate_params.func = indicate_cb; indicate_params.destroy = NULL; - indicate_params.chan_opt = BT_ATT_CHAN_OPT_NONE; bt_gatt_indicate(NULL, &indicate_params); } @@ -1007,7 +1006,6 @@ static void disc_all_prim(uint8_t *data, uint16_t len) discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; discover_params.func = disc_prim_cb; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; btp_opcode = GATT_DISC_ALL_PRIM; @@ -1051,7 +1049,6 @@ static void disc_prim_uuid(uint8_t *data, uint16_t len) discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; discover_params.type = BT_GATT_DISCOVER_PRIMARY; discover_params.func = disc_prim_cb; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; btp_opcode = GATT_DISC_PRIM_UUID; @@ -1137,7 +1134,6 @@ static void find_included(uint8_t *data, uint16_t len) discover_params.end_handle = sys_le16_to_cpu(cmd->end_handle); discover_params.type = BT_GATT_DISCOVER_INCLUDE; discover_params.func = find_included_cb; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_discover(conn, &discover_params) < 0) { discover_destroy(&discover_params); @@ -1220,7 +1216,6 @@ static void disc_all_chrc(uint8_t *data, uint16_t len) discover_params.end_handle = sys_le16_to_cpu(cmd->end_handle); discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC; discover_params.func = disc_chrc_cb; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = GATT_DISC_ALL_CHRC; @@ -1265,7 +1260,6 @@ static void disc_chrc_uuid(uint8_t *data, uint16_t len) discover_params.end_handle = sys_le16_to_cpu(cmd->end_handle); discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC; discover_params.func = disc_chrc_cb; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = GATT_DISC_CHRC_UUID; @@ -1347,7 +1341,6 @@ static void disc_all_desc(uint8_t *data, uint16_t len) discover_params.end_handle = sys_le16_to_cpu(cmd->end_handle); discover_params.type = BT_GATT_DISCOVER_DESCRIPTOR; discover_params.func = disc_all_desc_cb; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_discover(conn, &discover_params) < 0) { discover_destroy(&discover_params); @@ -1468,7 +1461,6 @@ static void read_data(uint8_t *data, uint16_t len) read_params.single.handle = sys_le16_to_cpu(cmd->handle); read_params.single.offset = 0x0000; read_params.func = read_cb; - read_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = GATT_READ; @@ -1513,7 +1505,6 @@ static void read_uuid(uint8_t *data, uint16_t len) read_params.by_uuid.start_handle = sys_le16_to_cpu(cmd->start_handle); read_params.by_uuid.end_handle = sys_le16_to_cpu(cmd->end_handle); read_params.func = read_uuid_cb; - read_params.chan_opt = BT_ATT_CHAN_OPT_NONE; btp_opcode = GATT_READ_UUID; @@ -1552,7 +1543,6 @@ static void read_long(uint8_t *data, uint16_t len) read_params.single.handle = sys_le16_to_cpu(cmd->handle); read_params.single.offset = sys_le16_to_cpu(cmd->offset); read_params.func = read_cb; - read_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = GATT_READ_LONG; @@ -1598,7 +1588,6 @@ static void read_multiple(uint8_t *data, uint16_t len, uint8_t opcode) read_params.handle_count = i; read_params.multiple.handles = handles; /* not used in read func */ read_params.multiple.variable = (opcode == GATT_READ_MULTIPLE_VAR); - read_params.chan_opt = BT_ATT_CHAN_OPT_NONE; /* TODO should be handled as user_data via CONTAINER_OF macro */ btp_opcode = opcode; @@ -1668,7 +1657,6 @@ static void write_data(uint8_t *data, uint16_t len) write_params.offset = 0U; write_params.data = cmd->data; write_params.length = sys_le16_to_cpu(cmd->data_length); - write_params.chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_write(conn, &write_params) < 0) { bt_conn_unref(conn); @@ -1705,7 +1693,6 @@ static void write_long(uint8_t *data, uint16_t len) write_params.offset = cmd->offset; write_params.data = cmd->data; write_params.length = sys_le16_to_cpu(cmd->data_length); - write_params.chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_write(conn, &write_params) < 0) { bt_conn_unref(conn); @@ -1782,7 +1769,6 @@ static void discover_complete(struct bt_conn *conn, goto fail; } - subscription->chan_opt = BT_ATT_CHAN_OPT_NONE; if (bt_gatt_subscribe(conn, subscription) < 0) { status = BTP_STATUS_FAILED; goto fail; @@ -1847,7 +1833,6 @@ static int enable_subscription(struct bt_conn *conn, uint16_t ccc_handle, discover_params.end_handle = ccc_handle; discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC; discover_params.func = discover_func; - discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE; subscription->ccc_handle = ccc_handle; subscription->value = value; From 421e1a48b241725570baac4a3061244e4580a3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 311/501] Revert "[nrf fromtree] Bluetooth: Shell: Use chan_opt BT_ATT_CHAN_ANY" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ff718893dd6867167c9887c25b927bfb104b07d4. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/shell/gatt.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/subsys/bluetooth/shell/gatt.c b/subsys/bluetooth/shell/gatt.c index 127f2b38b58..1d7653912ab 100644 --- a/subsys/bluetooth/shell/gatt.c +++ b/subsys/bluetooth/shell/gatt.c @@ -66,12 +66,6 @@ static void update_write_stats(uint16_t len) } } -#if defined(CONFIG_BT_EATT) -#define SET_CHAN_OPT_ANY(params) (params).chan_opt = BT_ATT_CHAN_OPT_NONE -#else -#define SET_CHAN_OPT_ANY(params) -#endif /* CONFIG_BT_EATT */ - static void print_write_stats(void) { shell_print(ctx_shell, "Write #%u: %u bytes (%u bps)", @@ -228,7 +222,6 @@ static int cmd_discover(const struct shell *sh, size_t argc, char *argv[]) discover_params.func = discover_func; discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; - SET_CHAN_OPT_ANY(discover_params); if (argc > 1) { /* Only set the UUID if the value is valid (non zero) */ @@ -305,7 +298,6 @@ static int cmd_read(const struct shell *sh, size_t argc, char *argv[]) read_params.handle_count = 1; read_params.single.handle = strtoul(argv[1], NULL, 16); read_params.single.offset = 0U; - SET_CHAN_OPT_ANY(read_params); if (argc > 2) { read_params.single.offset = strtoul(argv[2], NULL, 16); @@ -351,7 +343,6 @@ static int cmd_mread(const struct shell *sh, size_t argc, char *argv[]) read_params.handle_count = i; read_params.multiple.handles = h; read_params.multiple.variable = true; - SET_CHAN_OPT_ANY(read_params); err = bt_gatt_read(default_conn, &read_params); if (err) { @@ -380,7 +371,6 @@ static int cmd_read_uuid(const struct shell *sh, size_t argc, char *argv[]) read_params.handle_count = 0; read_params.by_uuid.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; read_params.by_uuid.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; - SET_CHAN_OPT_ANY(read_params); if (argc > 1) { uuid.val = strtoul(argv[1], NULL, 16); @@ -447,7 +437,6 @@ static int cmd_write(const struct shell *sh, size_t argc, char *argv[]) write_params.handle = handle; write_params.offset = offset; write_params.func = write_func; - SET_CHAN_OPT_ANY(write_params); err = bt_gatt_write(default_conn, &write_params); if (err) { @@ -569,7 +558,6 @@ static int cmd_subscribe(const struct shell *sh, size_t argc, char *argv[]) subscribe_params.value_handle = strtoul(argv[2], NULL, 16); subscribe_params.value = BT_GATT_CCC_NOTIFY; subscribe_params.notify = notify_func; - SET_CHAN_OPT_ANY(subscribe_params); #if defined(CONFIG_BT_GATT_AUTO_DISCOVER_CCC) if (subscribe_params.ccc_handle == 0) { @@ -618,7 +606,6 @@ static int cmd_resubscribe(const struct shell *sh, size_t argc, subscribe_params.value_handle = strtoul(argv[4], NULL, 16); subscribe_params.value = BT_GATT_CCC_NOTIFY; subscribe_params.notify = notify_func; - SET_CHAN_OPT_ANY(subscribe_params); if (argc > 5 && !strcmp(argv[5], "ind")) { subscribe_params.value = BT_GATT_CCC_INDICATE; @@ -959,7 +946,6 @@ static int cmd_notify(const struct shell *sh, size_t argc, char *argv[]) params.len = sizeof(data); params.func = notify_cb; params.user_data = (void *)sh; - SET_CHAN_OPT_ANY(params); bt_gatt_notify_cb(NULL, ¶ms); From 1c51e3e4e4731eb0df177d6768a4960ca0717c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 312/501] Revert "[nrf fromtree] Bluetooth: Host: Add option to use GATT over EATT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 96cd073417e6f90b55a7bf73a1a31d8c0b4425a0. Signed-off-by: Andrzej Głąbek --- include/zephyr/bluetooth/att.h | 13 ----- include/zephyr/bluetooth/gatt.h | 24 -------- subsys/bluetooth/host/att.c | 37 ++----------- subsys/bluetooth/host/att_internal.h | 12 +--- subsys/bluetooth/host/gatt.c | 70 ++++++++---------------- subsys/bluetooth/services/ots/ots_olcp.c | 3 - 6 files changed, 32 insertions(+), 127 deletions(-) diff --git a/include/zephyr/bluetooth/att.h b/include/zephyr/bluetooth/att.h index 0c4e3c693e8..b41c2067039 100644 --- a/include/zephyr/bluetooth/att.h +++ b/include/zephyr/bluetooth/att.h @@ -94,19 +94,6 @@ size_t bt_eatt_count(struct bt_conn *conn); #endif /* CONFIG_BT_EATT */ -/** @brief ATT channel option bit field values. - * @note @ref BT_ATT_CHAN_OPT_UNENHANCED_ONLY and @ref BT_ATT_CHAN_OPT_ENHANCED_ONLY are mutually - * exclusive and both bits may not be set. - */ -enum bt_att_chan_opt { - /** Both Enhanced and Unenhanced channels can be used */ - BT_ATT_CHAN_OPT_NONE = 0x0, - /** Only Unenhanced channels will be used */ - BT_ATT_CHAN_OPT_UNENHANCED_ONLY = BIT(0), - /** Only Enhanced channels will be used */ - BT_ATT_CHAN_OPT_ENHANCED_ONLY = BIT(1), -}; - #ifdef __cplusplus } #endif diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index 3172a0d00f0..b2d5994f10f 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -1014,9 +1014,6 @@ struct bt_gatt_notify_params { bt_gatt_complete_func_t func; /** Notification Value callback user data */ void *user_data; -#if defined(CONFIG_BT_EATT) - enum bt_att_chan_opt chan_opt; -#endif /* CONFIG_BT_EATT */ }; /** @brief Notify attribute value change. @@ -1128,9 +1125,6 @@ static inline int bt_gatt_notify(struct bt_conn *conn, params.attr = attr; params.data = data; params.len = len; -#if defined(CONFIG_BT_EATT) - params.chan_opt = BT_ATT_CHAN_OPT_NONE; -#endif /* CONFIG_BT_EATT */ return bt_gatt_notify_cb(conn, ¶ms); } @@ -1167,9 +1161,6 @@ static inline int bt_gatt_notify_uuid(struct bt_conn *conn, params.attr = attr; params.data = data; params.len = len; -#if defined(CONFIG_BT_EATT) - params.chan_opt = BT_ATT_CHAN_OPT_NONE; -#endif /* CONFIG_BT_EATT */ return bt_gatt_notify_cb(conn, ¶ms); } @@ -1215,9 +1206,6 @@ struct bt_gatt_indicate_params { uint16_t len; /** Private reference counter */ uint8_t _ref; -#if defined(CONFIG_BT_EATT) - enum bt_att_chan_opt chan_opt; -#endif /* CONFIG_BT_EATT */ }; /** @brief Indicate attribute value change. @@ -1446,9 +1434,6 @@ struct bt_gatt_discover_params { /** Only for stack-internal use, used for automatic discovery. */ struct bt_gatt_subscribe_params *sub_params; #endif /* defined(CONFIG_BT_GATT_AUTO_DISCOVER_CCC) */ -#if defined(CONFIG_BT_EATT) - enum bt_att_chan_opt chan_opt; -#endif /* CONFIG_BT_EATT */ }; /** @brief GATT Discover function @@ -1549,9 +1534,6 @@ struct bt_gatt_read_params { const struct bt_uuid *uuid; } by_uuid; }; -#if defined(CONFIG_BT_EATT) - enum bt_att_chan_opt chan_opt; -#endif /* CONFIG_BT_EATT */ }; /** @brief Read Attribute Value by handle @@ -1610,9 +1592,6 @@ struct bt_gatt_write_params { const void *data; /** Length of the data */ uint16_t length; -#if defined(CONFIG_BT_EATT) - enum bt_att_chan_opt chan_opt; -#endif /* CONFIG_BT_EATT */ }; /** @brief Write Attribute Value by handle @@ -1811,9 +1790,6 @@ struct bt_gatt_subscribe_params { ATOMIC_DEFINE(flags, BT_GATT_SUBSCRIBE_NUM_FLAGS); sys_snode_t node; -#if defined(CONFIG_BT_EATT) - enum bt_att_chan_opt chan_opt; -#endif /* CONFIG_BT_EATT */ }; /** @brief Subscribe Attribute Value Notification diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index eaee5e4c9c3..47d3ee6a3fa 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -142,7 +142,6 @@ struct bt_att_tx_meta_data { uint16_t attr_count; bt_gatt_complete_func_t func; void *user_data; - enum bt_att_chan_opt chan_opt; }; struct bt_att_tx_meta { @@ -167,7 +166,6 @@ static inline void tx_meta_data_free(struct bt_att_tx_meta_data *data) k_fifo_put(&free_att_tx_meta_data, data); } -static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf); static bt_conn_tx_cb_t chan_cb(const struct net_buf *buf); static bt_conn_tx_cb_t att_cb(const struct net_buf *buf); @@ -276,21 +274,6 @@ static int chan_send(struct bt_att_chan *chan, struct net_buf *buf) return err; } -static bool att_chan_matches_chan_opt(struct bt_att_chan *chan, enum bt_att_chan_opt chan_opt) -{ - __ASSERT_NO_MSG(chan_opt <= BT_ATT_CHAN_OPT_ENHANCED_ONLY); - - if (chan_opt == BT_ATT_CHAN_OPT_NONE) { - return true; - } - - if (atomic_test_bit(chan->flags, ATT_ENHANCED)) { - return (chan_opt & BT_ATT_CHAN_OPT_ENHANCED_ONLY); - } else { - return (chan_opt & BT_ATT_CHAN_OPT_UNENHANCED_ONLY); - } -} - static int process_queue(struct bt_att_chan *chan, struct k_fifo *queue) { struct net_buf *buf; @@ -298,7 +281,7 @@ static int process_queue(struct bt_att_chan *chan, struct k_fifo *queue) buf = net_buf_get(queue, K_NO_WAIT); if (buf) { - err = bt_att_chan_send(chan, buf); + err = chan_send(chan, buf); if (err) { /* Push it back if it could not be send */ k_queue_prepend(&queue->_queue, buf); @@ -330,7 +313,7 @@ static int chan_req_send(struct bt_att_chan *chan, struct bt_att_req *req) buf = req->buf; req->buf = NULL; - err = bt_att_chan_send(chan, buf); + err = chan_send(chan, buf); if (err) { /* We still have the ownership of the buffer */ req->buf = buf; @@ -587,11 +570,6 @@ static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf) BT_DBG("chan %p flags %lu code 0x%02x", chan, atomic_get(chan->flags), ((struct bt_att_hdr *)buf->data)->code); - if (IS_ENABLED(CONFIG_BT_EATT) && - !att_chan_matches_chan_opt(chan, bt_att_tx_meta_data(buf)->chan_opt)) { - return -EINVAL; - } - return chan_send(chan, buf); } @@ -623,7 +601,7 @@ static void bt_att_chan_send_rsp(struct bt_att_chan *chan, struct net_buf *buf) { int err; - err = chan_send(chan, buf); + err = bt_att_chan_send(chan, buf); if (err) { /* Responses need to be sent back using the same channel */ net_buf_put(&chan->tx_queue, buf); @@ -3774,15 +3752,13 @@ bool bt_att_out_of_sync_sent_on_fixed(struct bt_conn *conn) return atomic_test_bit(att_chan->flags, ATT_OUT_OF_SYNC_SENT); } -void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func, void *user_data, - enum bt_att_chan_opt chan_opt) +void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func, void *user_data) { struct bt_att_tx_meta_data *data = bt_att_tx_meta_data(buf); data->func = func; data->user_data = user_data; data->attr_count = 1; - data->chan_opt = chan_opt; } void bt_att_increment_tx_meta_data_attr_count(struct net_buf *buf, uint16_t attr_count) @@ -3793,11 +3769,10 @@ void bt_att_increment_tx_meta_data_attr_count(struct net_buf *buf, uint16_t attr } bool bt_att_tx_meta_data_match(const struct net_buf *buf, bt_gatt_complete_func_t func, - const void *user_data, enum bt_att_chan_opt chan_opt) + const void *user_data) { return ((bt_att_tx_meta_data(buf)->func == func) && - (bt_att_tx_meta_data(buf)->user_data == user_data) && - (bt_att_tx_meta_data(buf)->chan_opt == chan_opt)); + (bt_att_tx_meta_data(buf)->user_data == user_data)); } void bt_att_free_tx_meta_data(const struct net_buf *buf) diff --git a/subsys/bluetooth/host/att_internal.h b/subsys/bluetooth/host/att_internal.h index e3fbb44a245..512da52dc18 100644 --- a/subsys/bluetooth/host/att_internal.h +++ b/subsys/bluetooth/host/att_internal.h @@ -317,18 +317,12 @@ void bt_att_clear_out_of_sync_sent(struct bt_conn *conn); /* Check if BT_ATT_ERR_DB_OUT_OF_SYNC has been sent on the fixed ATT channel */ bool bt_att_out_of_sync_sent_on_fixed(struct bt_conn *conn); + typedef void (*bt_gatt_complete_func_t) (struct bt_conn *conn, void *user_data); -void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func, void *user_data, - enum bt_att_chan_opt chan_opt); +void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func, void *user_data); void bt_att_increment_tx_meta_data_attr_count(struct net_buf *buf, uint16_t attr_count); bool bt_att_tx_meta_data_match(const struct net_buf *buf, bt_gatt_complete_func_t func, - const void *user_data, enum bt_att_chan_opt chan_opt); + const void *user_data); void bt_att_free_tx_meta_data(const struct net_buf *buf); - -#if defined(CONFIG_BT_EATT) -#define BT_ATT_CHAN_OPT(_params) (_params)->chan_opt -#else -#define BT_ATT_CHAN_OPT(_params) BT_ATT_CHAN_OPT_UNENHANCED_ONLY -#endif /* CONFIG_BT_EATT */ diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 48ae5ffdc41..23f71fae8a5 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -1197,9 +1197,6 @@ static void sc_process(struct k_work *work) sc->params.func = sc_indicate_rsp; sc->params.data = &sc_range[0]; sc->params.len = sizeof(sc_range); -#if defined(CONFIG_BT_EATT) - sc->params.chan_opt = BT_ATT_CHAN_OPT_NONE; -#endif /* CONFIG_BT_EATT */ if (bt_gatt_indicate(NULL, &sc->params)) { /* No connections to indicate */ @@ -2181,8 +2178,7 @@ static int gatt_notify_mult(struct bt_conn *conn, uint16_t handle, * the existing buffer and proceed to create a new one */ if (*buf && ((net_buf_tailroom(*buf) < sizeof(struct bt_att_notify_mult) + params->len) || - !bt_att_tx_meta_data_match(*buf, params->func, params->user_data, - BT_ATT_CHAN_OPT(params)))) { + !bt_att_tx_meta_data_match(*buf, params->func, params->user_data))) { int ret; ret = gatt_notify_mult_send(conn, *buf); @@ -2199,8 +2195,7 @@ static int gatt_notify_mult(struct bt_conn *conn, uint16_t handle, return -ENOMEM; } - bt_att_set_tx_meta_data(*buf, params->func, params->user_data, - BT_ATT_CHAN_OPT(params)); + bt_att_set_tx_meta_data(*buf, params->func, params->user_data); } else { /* Increment the number of handles, ensuring the notify callback * gets called once for every attribute. @@ -2277,7 +2272,7 @@ static int gatt_notify(struct bt_conn *conn, uint16_t handle, net_buf_add(buf, params->len); memcpy(nfy->value, params->data, params->len); - bt_att_set_tx_meta_data(buf, params->func, params->user_data, BT_ATT_CHAN_OPT(params)); + bt_att_set_tx_meta_data(buf, params->func, params->user_data); return bt_att_send(conn, buf); } @@ -2322,8 +2317,7 @@ static struct bt_att_req *gatt_req_alloc(bt_att_func_t func, void *params, #ifdef CONFIG_BT_GATT_CLIENT static int gatt_req_send(struct bt_conn *conn, bt_att_func_t func, void *params, - bt_att_encode_t encode, uint8_t op, size_t len, - enum bt_att_chan_opt chan_opt) + bt_att_encode_t encode, uint8_t op, size_t len) { struct bt_att_req *req; @@ -2341,8 +2335,6 @@ static int gatt_req_send(struct bt_conn *conn, bt_att_func_t func, void *params, return -ENOMEM; } - bt_att_set_tx_meta_data(buf, NULL, NULL, chan_opt); - req->buf = buf; err = encode(buf, len, params); @@ -2412,8 +2404,6 @@ static int gatt_indicate(struct bt_conn *conn, uint16_t handle, return -ENOMEM; } - bt_att_set_tx_meta_data(buf, NULL, NULL, BT_ATT_CHAN_OPT(params)); - ind = net_buf_add(buf, sizeof(*ind)); ind->handle = sys_cpu_to_le16(handle); @@ -2775,7 +2765,7 @@ int bt_gatt_notify_multiple(struct bt_conn *conn, } /* Register the callback. It will be called num_params times. */ - bt_att_set_tx_meta_data(buf, params->func, params->user_data, BT_ATT_CHAN_OPT(params)); + bt_att_set_tx_meta_data(buf, params->func, params->user_data); bt_att_increment_tx_meta_data_attr_count(buf, num_params - 1); for (uint16_t i = 0; i < num_params; i++) { @@ -3443,8 +3433,7 @@ int bt_gatt_exchange_mtu(struct bt_conn *conn, err = gatt_req_send(conn, gatt_mtu_rsp, params, gatt_exchange_mtu_encode, BT_ATT_OP_MTU_REQ, - sizeof(struct bt_att_exchange_mtu_req), - BT_ATT_CHAN_OPT_UNENHANCED_ONLY); + sizeof(struct bt_att_exchange_mtu_req)); if (err) { atomic_clear_bit(conn->flags, BT_CONN_ATT_MTU_EXCHANGED); } @@ -3595,7 +3584,7 @@ static int gatt_find_type(struct bt_conn *conn, return gatt_req_send(conn, gatt_find_type_rsp, params, gatt_find_type_encode, BT_ATT_OP_FIND_TYPE_REQ, - len, BT_ATT_CHAN_OPT(params)); + len); } static void read_included_uuid_cb(struct bt_conn *conn, uint8_t err, @@ -3667,7 +3656,7 @@ static int read_included_uuid(struct bt_conn *conn, return gatt_req_send(conn, read_included_uuid_cb, params, read_included_uuid_encode, BT_ATT_OP_READ_REQ, - sizeof(struct bt_att_read_req), BT_ATT_CHAN_OPT(params)); + sizeof(struct bt_att_read_req)); } static uint16_t parse_include(struct bt_conn *conn, const void *pdu, @@ -3985,7 +3974,7 @@ static int gatt_read_type(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_type_rsp, params, gatt_read_type_encode, BT_ATT_OP_READ_TYPE_REQ, - sizeof(struct bt_att_read_type_req), BT_ATT_CHAN_OPT(params)); + sizeof(struct bt_att_read_type_req)); } static uint16_t parse_service(struct bt_conn *conn, const void *pdu, @@ -4123,8 +4112,7 @@ static int gatt_read_group(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_group_rsp, params, gatt_read_group_encode, BT_ATT_OP_READ_GROUP_REQ, - sizeof(struct bt_att_read_group_req), - BT_ATT_CHAN_OPT(params)); + sizeof(struct bt_att_read_group_req)); } static void gatt_find_info_rsp(struct bt_conn *conn, uint8_t err, @@ -4263,8 +4251,7 @@ static int gatt_find_info(struct bt_conn *conn, return gatt_req_send(conn, gatt_find_info_rsp, params, gatt_find_info_encode, BT_ATT_OP_FIND_INFO_REQ, - sizeof(struct bt_att_find_info_req), - BT_ATT_CHAN_OPT(params)); + sizeof(struct bt_att_find_info_req)); } int bt_gatt_discover(struct bt_conn *conn, @@ -4434,8 +4421,7 @@ static int gatt_read_blob(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_rsp, params, gatt_read_blob_encode, BT_ATT_OP_READ_BLOB_REQ, - sizeof(struct bt_att_read_blob_req), - BT_ATT_CHAN_OPT(params)); + sizeof(struct bt_att_read_blob_req)); } static int gatt_read_uuid_encode(struct net_buf *buf, size_t len, @@ -4466,8 +4452,7 @@ static int gatt_read_uuid(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_rsp, params, gatt_read_uuid_encode, BT_ATT_OP_READ_TYPE_REQ, - sizeof(struct bt_att_read_type_req), - BT_ATT_CHAN_OPT(params)); + sizeof(struct bt_att_read_type_req)); } #if defined(CONFIG_BT_GATT_READ_MULTIPLE) @@ -4509,8 +4494,7 @@ static int gatt_read_mult(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_mult_rsp, params, gatt_read_mult_encode, BT_ATT_OP_READ_MULT_REQ, - params->handle_count * sizeof(uint16_t), - BT_ATT_CHAN_OPT(params)); + params->handle_count * sizeof(uint16_t)); } #else @@ -4583,8 +4567,7 @@ static int gatt_read_mult_vl(struct bt_conn *conn, return gatt_req_send(conn, gatt_read_mult_vl_rsp, params, gatt_read_mult_vl_encode, BT_ATT_OP_READ_MULT_VL_REQ, - params->handle_count * sizeof(uint16_t), - BT_ATT_CHAN_OPT(params)); + params->handle_count * sizeof(uint16_t)); } #else @@ -4634,8 +4617,8 @@ int bt_gatt_read(struct bt_conn *conn, struct bt_gatt_read_params *params) BT_DBG("handle 0x%04x", params->single.handle); return gatt_req_send(conn, gatt_read_rsp, params, gatt_read_encode, - BT_ATT_OP_READ_REQ, sizeof(struct bt_att_read_req), - BT_ATT_CHAN_OPT(params)); + BT_ATT_OP_READ_REQ, + sizeof(struct bt_att_read_req)); } static void gatt_write_rsp(struct bt_conn *conn, uint8_t err, const void *pdu, @@ -4695,7 +4678,7 @@ int bt_gatt_write_without_response_cb(struct bt_conn *conn, uint16_t handle, BT_DBG("handle 0x%04x length %u", handle, length); - bt_att_set_tx_meta_data(buf, func, user_data, BT_ATT_CHAN_OPT_NONE); + bt_att_set_tx_meta_data(buf, func, user_data); return bt_att_send(conn, buf); } @@ -4717,8 +4700,7 @@ static int gatt_exec_write(struct bt_conn *conn, return gatt_req_send(conn, gatt_write_rsp, params, gatt_exec_encode, BT_ATT_OP_EXEC_WRITE_REQ, - sizeof(struct bt_att_exec_write_req), - BT_ATT_CHAN_OPT(params)); + sizeof(struct bt_att_exec_write_req)); } static int gatt_cancel_encode(struct net_buf *buf, size_t len, void *user_data) @@ -4738,8 +4720,7 @@ static int gatt_cancel_all_writes(struct bt_conn *conn, return gatt_req_send(conn, gatt_write_rsp, params, gatt_cancel_encode, BT_ATT_OP_EXEC_WRITE_REQ, - sizeof(struct bt_att_exec_write_req), - BT_ATT_CHAN_OPT(params)); + sizeof(struct bt_att_exec_write_req)); } static void gatt_prepare_write_rsp(struct bt_conn *conn, uint8_t err, @@ -4838,8 +4819,7 @@ static int gatt_prepare_write(struct bt_conn *conn, return gatt_req_send(conn, gatt_prepare_write_rsp, params, gatt_prepare_write_encode, - BT_ATT_OP_PREPARE_WRITE_REQ, len, - BT_ATT_CHAN_OPT(params)); + BT_ATT_OP_PREPARE_WRITE_REQ, len); } static int gatt_write_encode(struct net_buf *buf, size_t len, void *user_data) @@ -4882,7 +4862,7 @@ int bt_gatt_write(struct bt_conn *conn, struct bt_gatt_write_params *params) BT_DBG("handle 0x%04x length %u", params->handle, params->length); return gatt_req_send(conn, gatt_write_rsp, params, gatt_write_encode, - BT_ATT_OP_WRITE_REQ, len, BT_ATT_CHAN_OPT(params)); + BT_ATT_OP_WRITE_REQ, len); } static void gatt_write_ccc_rsp(struct bt_conn *conn, uint8_t err, @@ -4948,8 +4928,7 @@ static int gatt_write_ccc(struct bt_conn *conn, BT_DBG("handle 0x%04x value 0x%04x", params->ccc_handle, params->value); return gatt_req_send(conn, gatt_write_ccc_rsp, params, - gatt_write_ccc_buf, BT_ATT_OP_WRITE_REQ, len, - BT_ATT_CHAN_OPT(params)); + gatt_write_ccc_buf, BT_ATT_OP_WRITE_REQ, len); } #if defined(CONFIG_BT_GATT_AUTO_DISCOVER_CCC) @@ -4997,9 +4976,6 @@ static int gatt_ccc_discover(struct bt_conn *conn, params->disc_params->start_handle = params->value_handle; params->disc_params->end_handle = params->end_handle; params->disc_params->func = gatt_ccc_discover_cb; -#if defined(CONFIG_BT_EATT) - params->disc_params->chan_opt = params->chan_opt; -#endif /* CONFIG_BT_EATT */ err = bt_gatt_discover(conn, params->disc_params); if (err) { diff --git a/subsys/bluetooth/services/ots/ots_olcp.c b/subsys/bluetooth/services/ots/ots_olcp.c index e4163e0ebd2..a172b3a1eb5 100644 --- a/subsys/bluetooth/services/ots/ots_olcp.c +++ b/subsys/bluetooth/services/ots/ots_olcp.c @@ -219,9 +219,6 @@ static int olcp_ind_send(const struct bt_gatt_attr *olcp_attr, ots->olcp_ind.params.func = olcp_ind_cb; ots->olcp_ind.params.data = olcp_res; ots->olcp_ind.params.len = olcp_res_len; -#if defined(CONFIG_BT_EATT) - ots->olcp_ind.params.chan_opt = BT_ATT_CHAN_OPT_NONE; -#endif /* CONFIG_BT_EATT */ LOG_DBG("Sending OLCP indication"); From b3000974e1dc4c9335bdf69a2e65c3fbf097c7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 313/501] Revert "[nrf fromtree] Bluetooth: Host: Add bsim test for GATT multi notify" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 73bb6caefdd916e5292a320aea0b04fbbd93a041. Signed-off-by: Andrzej Głąbek --- .../bsim_test_notify_multiple/CMakeLists.txt | 21 - .../bsim_test_notify_multiple/prj.conf | 18 - .../bsim_test_notify_multiple/src/common.c | 20 - .../bsim_test_notify_multiple/src/common.h | 74 ---- .../src/gatt_client_test.c | 378 ------------------ .../src/gatt_server_test.c | 195 --------- .../bsim_test_notify_multiple/src/main.c | 21 - .../test_scripts/_notify-debug.sh | 42 -- .../test_scripts/notify.sh | 37 -- tests/bluetooth/bsim_bt/compile.sh | 1 - 10 files changed, 807 deletions(-) delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/CMakeLists.txt delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/prj.conf delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.c delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.h delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_client_test.c delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_server_test.c delete mode 100644 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/main.c delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/_notify-debug.sh delete mode 100755 tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/notify.sh diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/CMakeLists.txt b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/CMakeLists.txt deleted file mode 100644 index 9743672c17c..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) - -if (NOT DEFINED ENV{BSIM_COMPONENTS_PATH}) - message(FATAL_ERROR "This test requires the BabbleSim simulator. Please set\ - the environment variable BSIM_COMPONENTS_PATH to point to its components \ - folder. More information can be found in\ - https://babblesim.github.io/folder_structure_and_env.html") -endif() - -find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) -project(bsim_test_gatt) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources} ) - -zephyr_include_directories( - $ENV{BSIM_COMPONENTS_PATH}/libUtilv1/src/ - $ENV{BSIM_COMPONENTS_PATH}/libPhyComv1/src/ - ) diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/prj.conf b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/prj.conf deleted file mode 100644 index 4fd7e8952fc..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/prj.conf +++ /dev/null @@ -1,18 +0,0 @@ -CONFIG_BT=y -CONFIG_BT_DEVICE_NAME="GATT tester" -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_GATT_CLIENT=y - -CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y - -CONFIG_BT_SMP=y -CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y -CONFIG_BT_L2CAP_ECRED=y -CONFIG_BT_EATT=y -CONFIG_BT_EATT_MAX=5 -CONFIG_BT_GATT_NOTIFY_MULTIPLE=y - -CONFIG_ASSERT=y -CONFIG_BT_TESTING=y -CONFIG_BT_DEBUG_LOG=y diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.c b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.c deleted file mode 100644 index df438607c5f..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "common.h" - -void test_tick(bs_time_t HW_device_time) -{ - if (bst_result != Passed) { - FAIL("test failed (not passed after %i seconds)\n", WAIT_TIME); - } -} - -void test_init(void) -{ - bst_ticker_set_next_tick_absolute(WAIT_TIME); - bst_result = In_progress; -} diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.h b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.h deleted file mode 100644 index 56ca219497b..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/common.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Common functions and helpers for BSIM GATT tests - * - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -#include "bs_types.h" -#include "bs_tracing.h" -#include "time_machine.h" -#include "bstests.h" - -#include -#include -#include - -#include -#include -#include -#include -#include - -extern enum bst_result_t bst_result; - -#define WAIT_TIME (60 * 1e6) /*seconds*/ - -#define CREATE_FLAG(flag) static atomic_t flag = (atomic_t)false -#define FORCE_FLAG(flag, val) (void)atomic_set(&flag, (atomic_t)val) -#define SET_FLAG(flag) (void)atomic_set(&flag, (atomic_t)true) -#define UNSET_FLAG(flag) (void)atomic_set(&flag, (atomic_t)false) -#define WAIT_FOR_FLAG(flag) \ - while (!(bool)atomic_get(&flag)) { \ - (void)k_sleep(K_MSEC(1)); \ - } -#define WAIT_FOR_FLAG_UNSET(flag) \ - while ((bool)atomic_get(&flag)) { \ - (void)k_sleep(K_MSEC(1)); \ - } - -#define FAIL(...) \ - do { \ - bst_result = Failed; \ - bs_trace_error_time_line(__VA_ARGS__); \ - } while (0) - -#define PASS(...) \ - do { \ - bst_result = Passed; \ - bs_trace_info_time(1, __VA_ARGS__); \ - } while (0) - -#define CHRC_SIZE 10 -#define LONG_CHRC_SIZE 40 - -#define TEST_SERVICE_UUID \ - BT_UUID_DECLARE_128(0x01, 0x23, 0x45, 0x67, 0x89, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, \ - 0x07, 0x08, 0x09, 0x00, 0x00) - -#define TEST_CHRC_UUID \ - BT_UUID_DECLARE_128(0x01, 0x23, 0x45, 0x67, 0x89, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, \ - 0x07, 0x08, 0x09, 0xFF, 0x00) - -#define TEST_LONG_CHRC_UUID \ - BT_UUID_DECLARE_128(0x01, 0x23, 0x45, 0x67, 0x89, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, \ - 0x07, 0x08, 0x09, 0xFF, 0x11) - -void test_tick(bs_time_t HW_device_time); -void test_init(void); - -#define NOTIFICATION_COUNT 10 -BUILD_ASSERT(NOTIFICATION_COUNT % 2 == 0); diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_client_test.c deleted file mode 100644 index 7266fe98ed2..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_client_test.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -#include "common.h" - -CREATE_FLAG(flag_is_connected); -CREATE_FLAG(flag_is_encrypted); -CREATE_FLAG(flag_discover_complete); -CREATE_FLAG(flag_write_complete); -CREATE_FLAG(flag_subscribed_short); -CREATE_FLAG(flag_subscribed_long); - -static struct bt_conn *g_conn; -static uint16_t chrc_handle; -static uint16_t long_chrc_handle; -static uint16_t csf_handle; -static struct bt_uuid *test_svc_uuid = TEST_SERVICE_UUID; - -static void exchange_func(struct bt_conn *conn, uint8_t err, struct bt_gatt_exchange_params *params) -{ - if (!err) { - printk("MTU exchange done\n"); - } else { - printk("MTU exchange failed (err %" PRIu8 ")\n", err); - } -} - -static void connected(struct bt_conn *conn, uint8_t err) -{ - char addr[BT_ADDR_LE_STR_LEN]; - static struct bt_gatt_exchange_params exchange_params; - - bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - - if (err != 0) { - FAIL("Failed to connect to %s (%u)\n", addr, err); - return; - } - - printk("Connected to %s\n", addr); - - SET_FLAG(flag_is_connected); - - exchange_params.func = exchange_func; - err = bt_gatt_exchange_mtu(conn, &exchange_params); - if (err) { - printk("MTU exchange failed (err %d)", err); - } -} - -static void disconnected(struct bt_conn *conn, uint8_t reason) -{ - char addr[BT_ADDR_LE_STR_LEN]; - - if (conn != g_conn) { - return; - } - - bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - - printk("Disconnected: %s (reason 0x%02x)\n", addr, reason); - - bt_conn_unref(g_conn); - - g_conn = NULL; - UNSET_FLAG(flag_is_connected); -} - -void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_security_err err) -{ - if (err) { - FAIL("Encryption failer (%d)\n", err); - } else if (level < BT_SECURITY_L2) { - FAIL("Insufficient sec level (%d)\n", level); - } else { - SET_FLAG(flag_is_encrypted); - } -} - -BT_CONN_CB_DEFINE(conn_callbacks) = { - .connected = connected, - .disconnected = disconnected, - .security_changed = security_changed, -}; - -void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, struct net_buf_simple *ad) -{ - char addr_str[BT_ADDR_LE_STR_LEN]; - int err; - - if (g_conn != NULL) { - return; - } - - /* We're only interested in connectable events */ - if (type != BT_HCI_ADV_IND && type != BT_HCI_ADV_DIRECT_IND) { - return; - } - - bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); - printk("Device found: %s (RSSI %d)\n", addr_str, rssi); - - printk("Stopping scan\n"); - err = bt_le_scan_stop(); - if (err != 0) { - FAIL("Could not stop scan: %d"); - return; - } - - err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN, BT_LE_CONN_PARAM_DEFAULT, &g_conn); - if (err != 0) { - FAIL("Could not connect to peer: %d", err); - } -} - -static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *attr, - struct bt_gatt_discover_params *params) -{ - int err; - - if (attr == NULL) { - if (chrc_handle == 0 || long_chrc_handle == 0) { - FAIL("Did not discover chrc (%x) or long_chrc (%x)", chrc_handle, - long_chrc_handle); - } - - (void)memset(params, 0, sizeof(*params)); - - SET_FLAG(flag_discover_complete); - - return BT_GATT_ITER_STOP; - } - - printk("[ATTRIBUTE] handle %u\n", attr->handle); - - if (params->type == BT_GATT_DISCOVER_PRIMARY && - bt_uuid_cmp(params->uuid, TEST_SERVICE_UUID) == 0) { - printk("Found test service\n"); - params->uuid = NULL; - params->start_handle = attr->handle + 1; - params->type = BT_GATT_DISCOVER_CHARACTERISTIC; - - err = bt_gatt_discover(conn, params); - if (err != 0) { - FAIL("Discover failed (err %d)\n", err); - } - - return BT_GATT_ITER_STOP; - } else if (params->type == BT_GATT_DISCOVER_CHARACTERISTIC) { - const struct bt_gatt_chrc *chrc = (struct bt_gatt_chrc *)attr->user_data; - - if (bt_uuid_cmp(chrc->uuid, TEST_CHRC_UUID) == 0) { - printk("Found chrc\n"); - chrc_handle = chrc->value_handle; - } else if (bt_uuid_cmp(chrc->uuid, TEST_LONG_CHRC_UUID) == 0) { - printk("Found long_chrc\n"); - long_chrc_handle = chrc->value_handle; - } else if (bt_uuid_cmp(chrc->uuid, BT_UUID_GATT_CLIENT_FEATURES) == 0) { - printk("Found csf\n"); - csf_handle = chrc->value_handle; - } - } - - return BT_GATT_ITER_CONTINUE; -} - -static void gatt_discover(const struct bt_uuid *uuid, uint8_t type) -{ - static struct bt_gatt_discover_params discover_params; - int err; - - printk("Discovering services and characteristics\n"); - - discover_params.uuid = uuid; - discover_params.func = discover_func; - discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; - discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; - discover_params.type = type; - - UNSET_FLAG(flag_discover_complete); - - err = bt_gatt_discover(g_conn, &discover_params); - if (err != 0) { - FAIL("Discover failed(err %d)\n", err); - } - - WAIT_FOR_FLAG(flag_discover_complete); - printk("Discover complete\n"); -} - -static void test_subscribed(struct bt_conn *conn, - uint8_t err, - struct bt_gatt_subscribe_params *params) -{ - if (err) { - FAIL("Subscribe failed (err %d)\n", err); - } - - if (!params) { - FAIL("params NULL\n"); - } - - if (params->value_handle == chrc_handle) { - FORCE_FLAG(flag_subscribed_short, (bool)params->value); - printk("Subscribed to short characteristic\n"); - } else if (params->value_handle == long_chrc_handle) { - FORCE_FLAG(flag_subscribed_long, (bool)params->value); - printk("Subscribed to long characteristic\n"); - } else { - FAIL("Unknown handle %d\n", params->value_handle); - } -} - -static volatile size_t num_notifications; -uint8_t test_notify(struct bt_conn *conn, struct bt_gatt_subscribe_params *params, const void *data, - uint16_t length) -{ - printk("Received notification #%u with length %d\n", num_notifications++, length); - - return BT_GATT_ITER_CONTINUE; -} - -static struct bt_gatt_discover_params disc_params_short; -static struct bt_gatt_subscribe_params sub_params_short = { - .notify = test_notify, - .subscribe = test_subscribed, - .ccc_handle = 0, /* Auto-discover CCC*/ - .disc_params = &disc_params_short, /* Auto-discover CCC */ - .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, - .value = BT_GATT_CCC_NOTIFY, -}; -static struct bt_gatt_discover_params disc_params_long; -static struct bt_gatt_subscribe_params sub_params_long = { - .notify = test_notify, - .subscribe = test_subscribed, - .ccc_handle = 0, /* Auto-discover CCC*/ - .disc_params = &disc_params_long, /* Auto-discover CCC */ - .end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE, - .value = BT_GATT_CCC_NOTIFY, -}; - -static void write_cb(struct bt_conn *conn, uint8_t err, struct bt_gatt_write_params *params) -{ - if (err != BT_ATT_ERR_SUCCESS) { - FAIL("Write failed: 0x%02X\n", err); - } - - SET_FLAG(flag_write_complete); -} - -static void write_csf(void) -{ - /* Client Supported Features Characteristic Value - * Bit 0: Robust Caching - * Bit 1: EATT - * Bit 2: Multiple Handle Value Notifications - */ - static const uint8_t csf[] = { BIT(2) }; - static struct bt_gatt_write_params write_params = { - .func = write_cb, - .offset = 0, - .data = csf, - .length = sizeof(csf), - }; - int err; - - printk("Writing to Client Supported Features Characteristic\n"); - - write_params.handle = csf_handle; - UNSET_FLAG(flag_write_complete); - - err = bt_gatt_write(g_conn, &write_params); - if (err) { - FAIL("bt_gatt_write failed (err %d)\n", err); - } - - WAIT_FOR_FLAG(flag_write_complete); - printk("Success\n"); -} - -static void subscribe(struct bt_gatt_subscribe_params *params, bool subscribe) -{ - int err; - - if (subscribe) { - err = bt_gatt_subscribe(g_conn, params); - } else { - err = bt_gatt_unsubscribe(g_conn, params); - } - - if (err < 0) { - FAIL("Failed to %ssubscribe (err %d)\n", subscribe ? "un":"", err); - } else { - printk("%ssubscribe request sent\n", subscribe ? "un":""); - } - -} - -static void test_main(void) -{ - int err; - - err = bt_enable(NULL); - if (err != 0) { - FAIL("Bluetooth discover failed (err %d)\n", err); - } - - err = bt_le_scan_start(BT_LE_SCAN_PASSIVE, device_found); - if (err != 0) { - FAIL("Scanning failed to start (err %d)\n", err); - } - - printk("Scanning successfully started\n"); - - WAIT_FOR_FLAG(flag_is_connected); - - err = bt_conn_set_security(g_conn, BT_SECURITY_L2); - if (err) { - FAIL("Starting encryption procedure failed (%d)\n", err); - } - - WAIT_FOR_FLAG(flag_is_encrypted); - - while (bt_eatt_count(g_conn) < CONFIG_BT_EATT_MAX) { - k_sleep(K_MSEC(10)); - } - - printk("EATT connected\n"); - - gatt_discover(test_svc_uuid, BT_GATT_DISCOVER_PRIMARY); - gatt_discover(BT_UUID_GATT_CLIENT_FEATURES, BT_GATT_DISCOVER_CHARACTERISTIC); - write_csf(); - - sub_params_short.value_handle = chrc_handle; - sub_params_long.value_handle = long_chrc_handle; - - subscribe(&sub_params_short, true); - subscribe(&sub_params_long, true); - WAIT_FOR_FLAG(flag_subscribed_short); - WAIT_FOR_FLAG(flag_subscribed_long); - - printk("Subscribed\n"); - - while (num_notifications < NOTIFICATION_COUNT) { - k_sleep(K_MSEC(100)); - } - - subscribe(&sub_params_short, false); - subscribe(&sub_params_long, false); - WAIT_FOR_FLAG_UNSET(flag_subscribed_short); - WAIT_FOR_FLAG_UNSET(flag_subscribed_long); - - - printk("Unsubscribed\n"); - - PASS("GATT client Passed\n"); -} - -static const struct bst_test_instance test_vcs[] = { - { - .test_id = "gatt_client", - .test_post_init_f = test_init, - .test_tick_f = test_tick, - .test_main_f = test_main, - }, - BSTEST_END_MARKER, -}; - -struct bst_test_list *test_gatt_client_install(struct bst_test_list *tests) -{ - return bst_add_tests(tests, test_vcs); -} diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_server_test.c b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_server_test.c deleted file mode 100644 index f002da041c7..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/gatt_server_test.c +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "common.h" - -extern enum bst_result_t bst_result; - -CREATE_FLAG(flag_is_connected); -CREATE_FLAG(flag_short_subscribe); -CREATE_FLAG(flag_long_subscribe); - -static struct bt_conn *g_conn; - -#define ARRAY_ITEM(i, _) i -const uint8_t chrc_data[] = { LISTIFY(CHRC_SIZE, ARRAY_ITEM, (,)) }; /* 1, 2, 3 ... */ -const uint8_t long_chrc_data[] = { LISTIFY(LONG_CHRC_SIZE, ARRAY_ITEM, (,)) }; /* 1, 2, 3 ... */ - -static void connected(struct bt_conn *conn, uint8_t err) -{ - char addr[BT_ADDR_LE_STR_LEN]; - - bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - - if (err != 0) { - FAIL("Failed to connect to %s (%u)\n", addr, err); - return; - } - - printk("Connected to %s\n", addr); - - g_conn = bt_conn_ref(conn); - SET_FLAG(flag_is_connected); -} - -static void disconnected(struct bt_conn *conn, uint8_t reason) -{ - char addr[BT_ADDR_LE_STR_LEN]; - - if (conn != g_conn) { - return; - } - - bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - - printk("Disconnected: %s (reason 0x%02x)\n", addr, reason); - - bt_conn_unref(g_conn); - - g_conn = NULL; - UNSET_FLAG(flag_is_connected); -} - -BT_CONN_CB_DEFINE(conn_callbacks) = { - .connected = connected, - .disconnected = disconnected, -}; - -static void short_subscribe(const struct bt_gatt_attr *attr, uint16_t value) -{ - const bool notif_enabled = (value == BT_GATT_CCC_NOTIFY); - - if (notif_enabled) { - SET_FLAG(flag_short_subscribe); - } - - printk("Short notifications %s\n", notif_enabled ? "enabled" : "disabled"); -} - -static void long_subscribe(const struct bt_gatt_attr *attr, uint16_t value) -{ - const bool notif_enabled = (value == BT_GATT_CCC_NOTIFY); - - if (notif_enabled) { - SET_FLAG(flag_long_subscribe); - } - - printk("Long notifications %s\n", notif_enabled ? "enabled" : "disabled"); -} - -BT_GATT_SERVICE_DEFINE(test_svc, BT_GATT_PRIMARY_SERVICE(TEST_SERVICE_UUID), - BT_GATT_CHARACTERISTIC(TEST_CHRC_UUID, - BT_GATT_CHRC_NOTIFY | BT_GATT_CHRC_READ, - BT_GATT_PERM_READ, NULL, NULL, NULL), - BT_GATT_CUD("Short test_svc format description", BT_GATT_PERM_READ), - BT_GATT_CCC(short_subscribe, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE), - BT_GATT_CHARACTERISTIC(TEST_LONG_CHRC_UUID, - BT_GATT_CHRC_NOTIFY | BT_GATT_CHRC_READ, - BT_GATT_PERM_READ, NULL, NULL, NULL), - BT_GATT_CCC(long_subscribe, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE)); - -static volatile size_t num_notifications_sent; - -static void notification_sent(struct bt_conn *conn, void *user_data) -{ - printk("Sent notification #%u\n", num_notifications_sent++); -} - -static inline void multiple_notify(const struct bt_gatt_attr *attrs[2]) -{ - int err; - static struct bt_gatt_notify_params params[] = { - { - .data = long_chrc_data, - .len = LONG_CHRC_SIZE, - .func = notification_sent, - .uuid = NULL, - }, - { - .data = chrc_data, - .len = CHRC_SIZE, - .func = notification_sent, - .uuid = NULL, - }, - }; - params[0].attr = attrs[0]; - params[1].attr = attrs[1]; - - do { - err = bt_gatt_notify_multiple(g_conn, ARRAY_SIZE(params), params); - - if (err == -ENOMEM) { - k_sleep(K_MSEC(10)); - } else if (err) { - FAIL("multiple notify failed (err %d)\n", err); - } - } while (err); -} - -static void test_main(void) -{ - int err; - const struct bt_gatt_attr *attrs[2]; - const struct bt_data ad[] = { - BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), - }; - - err = bt_enable(NULL); - if (err != 0) { - FAIL("Bluetooth init failed (err %d)\n", err); - return; - } - - printk("Bluetooth initialized\n"); - - err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0); - if (err != 0) { - FAIL("Advertising failed to start (err %d)\n", err); - return; - } - - printk("Advertising successfully started\n"); - - WAIT_FOR_FLAG(flag_is_connected); - WAIT_FOR_FLAG(flag_short_subscribe); - WAIT_FOR_FLAG(flag_long_subscribe); - - /* Long characteristic [attr=value] */ - attrs[0] = bt_gatt_find_by_uuid(NULL, 0, TEST_LONG_CHRC_UUID); - /* Short characteristic [attr=descriptor] */ - attrs[1] = &attr_test_svc[1]; - - for (int i = 0; i < NOTIFICATION_COUNT / 2; i++) { - multiple_notify(attrs); - } - - while (num_notifications_sent < NOTIFICATION_COUNT / 2) { - k_sleep(K_MSEC(100)); - } - - k_sleep(K_MSEC(1000)); - - if (num_notifications_sent > NOTIFICATION_COUNT) { - FAIL("The notify callback is called more than expected\n"); - } - - PASS("GATT server passed\n"); -} - -static const struct bst_test_instance test_gatt_server[] = { - { - .test_id = "gatt_server", - .test_post_init_f = test_init, - .test_tick_f = test_tick, - .test_main_f = test_main, - }, - BSTEST_END_MARKER, -}; - -struct bst_test_list *test_gatt_server_install(struct bst_test_list *tests) -{ - return bst_add_tests(tests, test_gatt_server); -} diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/main.c b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/main.c deleted file mode 100644 index 7e2806a0702..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/src/main.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "bstests.h" - -extern struct bst_test_list *test_gatt_server_install(struct bst_test_list *tests); -extern struct bst_test_list *test_gatt_client_install(struct bst_test_list *tests); - -bst_test_install_t test_installers[] = { - test_gatt_server_install, - test_gatt_client_install, - NULL -}; - -void main(void) -{ - bst_main(); -} diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/_notify-debug.sh b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/_notify-debug.sh deleted file mode 100755 index f01b9bc2006..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/_notify-debug.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Usage: -# one script instance per device, e.g. to run gdb on the client: -# `_notify-debug.sh client debug` -# `_notify-debug.sh server` -# `_notify-debug.sh` -# -# GDB can be run on the two devices at the same time without issues, just append -# `debug` when running the script. - - -simulation_id="notify_multiple" -verbosity_level=2 -process_ids=""; exit_code=0 - -: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" - -#Give a default value to BOARD if it does not have one yet: -BOARD="${BOARD:-nrf52_bsim}" - -cd ${BSIM_OUT_PATH}/bin - -if [[ $2 == "debug" ]]; then - GDB_P="gdb --args " -fi - -if [[ $1 == "client" ]]; then -$GDB_P ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_multiple_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=gatt_client - -elif [[ $1 == "server" ]]; then -$GDB_P ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_multiple_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=gatt_server - -else -./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ - -D=2 -sim_length=60e6 $@ - -fi diff --git a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/notify.sh b/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/notify.sh deleted file mode 100755 index e3997dd6213..00000000000 --- a/tests/bluetooth/bsim_bt/bsim_test_notify_multiple/test_scripts/notify.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -simulation_id="notify_multiple" -verbosity_level=2 -process_ids=""; exit_code=0 - -function Execute(){ - if [ ! -f $1 ]; then - echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\ - compile it?)\e[39m" - exit 1 - fi - timeout 120 $@ & process_ids="$process_ids $!" -} - -: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" - -#Give a default value to BOARD if it does not have one yet: -BOARD="${BOARD:-nrf52_bsim}" - -cd ${BSIM_OUT_PATH}/bin - -Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_multiple_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=gatt_client - -Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_notify_multiple_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=gatt_server - -Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ - -D=2 -sim_length=60e6 $@ - -for process_id in $process_ids; do - wait $process_id || let "exit_code=$?" -done -exit $exit_code #the last exit code != 0 diff --git a/tests/bluetooth/bsim_bt/compile.sh b/tests/bluetooth/bsim_bt/compile.sh index 5ab59c5554f..326a226258c 100755 --- a/tests/bluetooth/bsim_bt/compile.sh +++ b/tests/bluetooth/bsim_bt/compile.sh @@ -21,7 +21,6 @@ mkdir -p ${WORK_DIR} source ${ZEPHYR_BASE}/tests/bluetooth/bsim_bt/compile.source app=tests/bluetooth/bsim_bt/bsim_test_notify compile -app=tests/bluetooth/bsim_bt/bsim_test_notify_multiple compile app=tests/bluetooth/bsim_bt/bsim_test_eatt_notif conf_file=prj.conf compile app=tests/bluetooth/bsim_bt/bsim_test_gatt_caching compile app=tests/bluetooth/bsim_bt/bsim_test_eatt conf_file=prj_collision.conf compile From ae8417897ff8f3d723d09e72a3200851970918f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 314/501] Revert "[nrf fromtree] Bluetooth: host: gatt: Properly check subscription status" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b9d4768cda1ef2e391f985d28a88d115d779669b. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/gatt.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 23f71fae8a5..aa134b25fab 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -2707,13 +2707,6 @@ static int gatt_notify_multiple_verify_params(struct bt_conn *conn, if (!bt_gatt_attr_get_handle(params[i].attr)) { return -EINVAL; } - - /* Check if the characteristic is subscribed. */ - if (!bt_gatt_is_subscribed(conn, params[i].attr, - BT_GATT_CCC_NOTIFY)) { - BT_WARN("Device is not subscribed to characteristic"); - return -EINVAL; - } } /* PDU length is specified with a 16-bit value. */ @@ -2770,9 +2763,11 @@ int bt_gatt_notify_multiple(struct bt_conn *conn, for (uint16_t i = 0; i < num_params; i++) { struct notify_data data; + const struct bt_gatt_chrc *chrc; data.attr = params[i].attr; data.handle = bt_gatt_attr_get_handle(data.attr); + chrc = data.attr->user_data; /* Check if attribute is a characteristic then adjust the * handle @@ -2781,6 +2776,14 @@ int bt_gatt_notify_multiple(struct bt_conn *conn, data.handle = bt_gatt_attr_value_handle(data.attr); } + /* Check if notifications are supported for that chrc. */ + if (!(chrc->properties & BT_GATT_CHRC_NOTIFY)) { + bt_att_free_tx_meta_data(buf); + net_buf_unref(buf); + + return -EINVAL; + } + /* Add handle and data to the command buffer. */ gatt_add_nfy_to_buf(buf, data.handle, ¶ms[i]); } From 437174e5517fd25c4af9afb085e692340bb2bb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 315/501] Revert "[nrf fromtree] wifi_mgmt: Add support for frequency bands" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a99f27541b0c03438bd67f597674c00c39046432. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/wifi.h | 8 +------- include/zephyr/net/wifi_mgmt.h | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index cc8224763be..06ea698d99d 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -26,17 +26,11 @@ enum wifi_mfp_options { WIFI_MFP_REQUIRED }; -enum wifi_frequency_bands { - WIFI_FREQ_BAND_2_4_GHZ = 0, - WIFI_FREQ_BAND_5_GHZ, - WIFI_FREQ_BAND_6_GHZ -}; - #define WIFI_SSID_MAX_LEN 32 #define WIFI_PSK_MAX_LEN 64 #define WIFI_MAC_ADDR_LEN 6 -#define WIFI_CHANNEL_MAX 233 +#define WIFI_CHANNEL_MAX 14 #define WIFI_CHANNEL_ANY 255 #endif /* ZEPHYR_INCLUDE_NET_WIFI_H_ */ diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index efe3b6e9b01..9fc87f57742 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -88,7 +88,6 @@ struct wifi_scan_result { uint8_t ssid[WIFI_SSID_MAX_LEN]; uint8_t ssid_length; - uint8_t band; uint8_t channel; enum wifi_security_type security; enum wifi_mfp_options mfp; @@ -108,7 +107,6 @@ struct wifi_connect_req_params { uint8_t *sae_password; /* Optional with fallback to psk */ uint8_t sae_password_length; /* No length restrictions */ - uint8_t band; uint8_t channel; enum wifi_security_type security; enum wifi_mfp_options mfp; From 747cedbd314e5a2c430171e9159c7752aeb23429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 316/501] Revert "[nrf fromtree] wifi_mgmt: Add support for MFP" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cdd5fdd89561f3b94578a5438b5ba9129f8041b1. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/wifi.h | 7 ------- include/zephyr/net/wifi_mgmt.h | 2 -- 2 files changed, 9 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index 06ea698d99d..6c3bf497c96 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -19,13 +19,6 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_SAE }; -/* Management frame protection (IEEE 802.11w) options */ -enum wifi_mfp_options { - WIFI_MFP_DISABLE = 0, - WIFI_MFP_OPTIONAL, - WIFI_MFP_REQUIRED -}; - #define WIFI_SSID_MAX_LEN 32 #define WIFI_PSK_MAX_LEN 64 #define WIFI_MAC_ADDR_LEN 6 diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 9fc87f57742..0f0987701b4 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -90,7 +90,6 @@ struct wifi_scan_result { uint8_t channel; enum wifi_security_type security; - enum wifi_mfp_options mfp; int8_t rssi; uint8_t mac[WIFI_MAC_ADDR_LEN]; @@ -109,7 +108,6 @@ struct wifi_connect_req_params { uint8_t channel; enum wifi_security_type security; - enum wifi_mfp_options mfp; }; struct wifi_status { From e0209d6ebb0d212e5ddce35ae6b63e6abbb5c411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 317/501] Revert "[nrf fromtree] wifi_mgmt: Add WPA3-SAE support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 08c668568ca1cc16da5cf261fbf312f01759a61b. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/wifi.h | 1 - include/zephyr/net/wifi_mgmt.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index 6c3bf497c96..f5d13426011 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -16,7 +16,6 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_NONE = 0, WIFI_SECURITY_TYPE_PSK, WIFI_SECURITY_TYPE_PSK_SHA256, - WIFI_SECURITY_TYPE_SAE }; #define WIFI_SSID_MAX_LEN 32 diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 0f0987701b4..8e7d7c3e7d1 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -103,9 +103,6 @@ struct wifi_connect_req_params { uint8_t *psk; uint8_t psk_length; /* Min 8 - Max 64 */ - uint8_t *sae_password; /* Optional with fallback to psk */ - uint8_t sae_password_length; /* No length restrictions */ - uint8_t channel; enum wifi_security_type security; }; From ff37c0873e9ee1a6236f944aaed0a5c87f48cab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 318/501] Revert "[nrf fromtree] wifi_mgmt: Add PSK with SHA256 support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 03fb23a27534a5de9b43c7e11048f26b2350ba09. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/wifi.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index f5d13426011..2df112c1b95 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -15,7 +15,6 @@ enum wifi_security_type { WIFI_SECURITY_TYPE_NONE = 0, WIFI_SECURITY_TYPE_PSK, - WIFI_SECURITY_TYPE_PSK_SHA256, }; #define WIFI_SSID_MAX_LEN 32 From bfe993b5359d44c34110ec1c24b80e27199bf273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 319/501] Revert "[nrf fromtree] scripts: west_commands: runners: jlink: support pylink >= 0.14.2" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2efb5b89b0b82360fec2ff5cd9f6c2ef111418f6. Signed-off-by: Andrzej Głąbek --- scripts/west_commands/runners/jlink.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/west_commands/runners/jlink.py b/scripts/west_commands/runners/jlink.py index d67ba491d9b..173ad64435c 100644 --- a/scripts/west_commands/runners/jlink.py +++ b/scripts/west_commands/runners/jlink.py @@ -8,6 +8,7 @@ from functools import partial import logging import os +from packaging.version import Version from pathlib import Path import shlex import subprocess @@ -151,9 +152,9 @@ def jlink_version(self): # to load the shared library distributed with the tools, which # provides an API call for getting the version. if not hasattr(self, '_jlink_version'): - # pylink 0.14.0/0.14.1 exposes JLink SDK DLL (libjlinkarm) in - # JLINK_SDK_STARTS_WITH, while other versions use JLINK_SDK_NAME - if pylink.__version__ in ('0.14.0', '0.14.1'): + # pylink >= 0.14.0 exposes JLink SDK DLL (libjlinkarm) in + # JLINK_SDK_STARTS_WITH, while previous versions use JLINK_SDK_NAME + if Version(pylink.__version__) >= Version('0.14.0'): sdk = Library.JLINK_SDK_STARTS_WITH else: sdk = Library.JLINK_SDK_NAME From 8be0bfb00064d6a76bea3edeeba3d3dcdca86110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 320/501] Revert "[nrf fromtree] samples: boards: nrf: ieee802154: Remove RTC user channel count setting" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 50ef049c16e36ed65b16dfa3b74b2e416655b278. Signed-off-by: Andrzej Głąbek --- samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf b/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf index 09500232667..cb9fa8607e4 100644 --- a/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf +++ b/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf @@ -5,3 +5,4 @@ CONFIG_UART_CONSOLE=n CONFIG_LOG=n CONFIG_NRF_802154_SER_RADIO=y +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=2 From 002742ecfdb31695f9f087b781ed41008888152e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 321/501] Revert "[nrf fromtree] drivers: timer: Increase default user-allocable channel count to 3" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9bf6d09981bdc8dbb60b7f895af107f0a9497e49. Signed-off-by: Andrzej Głąbek --- drivers/timer/Kconfig.nrf_rtc | 2 +- soc/arm/nordic_nrf/nrf53/Kconfig.soc | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index fe6f2ffd97a..d9df59049bf 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -18,7 +18,7 @@ if NRF_RTC_TIMER config NRF_RTC_TIMER_USER_CHAN_COUNT int "Additional channels that can be used" - default 3 if NRF_802154_RADIO_DRIVER + default 2 if NRF_802154_RADIO_DRIVER default 0 help Use nrf_rtc_timer.h API. Driver is not managing allocation of channels. diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index a27f807ee2e..68c2ec0928e 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -148,7 +148,6 @@ config NRF53_SYNC_RTC_INIT_PRIORITY nRF53 Synchronized RTC initialization priority. config NRF_RTC_TIMER_USER_CHAN_COUNT - default 3 if NRF_802154_RADIO_DRIVER default 1 config NRF53_SYNC_RTC_LOG_TIMESTAMP From 9258d0ebdb1a17903bf209e763de761ef86c8aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 322/501] Revert "[nrf fromtree] board: nrf53: Fix build error for thingy53_nrf5340 when MPU is disabled" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8f222f950977b5d080a64a85d359920460a9ff0d. Signed-off-by: Andrzej Głąbek --- boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c | 1 + boards/arm/thingy53_nrf5340/board.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c index 9f96095d836..8bd92729a7f 100644 --- a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c +++ b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c @@ -9,6 +9,7 @@ #include #include +#include LOG_MODULE_REGISTER(nrf5340dk_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL); diff --git a/boards/arm/thingy53_nrf5340/board.c b/boards/arm/thingy53_nrf5340/board.c index 5852b53e9d9..a77f31ee9d8 100644 --- a/boards/arm/thingy53_nrf5340/board.c +++ b/boards/arm/thingy53_nrf5340/board.c @@ -5,10 +5,8 @@ */ #include -#include - -#include +#include LOG_MODULE_REGISTER(thingy53_board_init); /* Initialization chain of Thingy:53 board requires some delays before on board sensors From 9995e9c4eff8523f36798590d66f6d6ca03c0a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 323/501] Revert "[nrf fromtree] boards: nrf9160dk_nrf9160: Correct arduino_spi definition" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1378f668d7f6e0ce57cb218fa05a7f25b0041f09. Signed-off-by: Andrzej Głąbek --- .../nrf9160dk_nrf9160_common-pinctrl.dtsi | 29 ++++++++++++++---- .../nrf9160dk_nrf9160_common.dts | 13 ++++++-- .../nrf9160dk_nrf9160_common_0_14_0.dtsi | 30 ++++++++++++++++--- 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common-pinctrl.dtsi b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common-pinctrl.dtsi index 0bc5fa63ce8..09b511281d9 100644 --- a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common-pinctrl.dtsi +++ b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common-pinctrl.dtsi @@ -91,19 +91,36 @@ }; }; - spi3_default: spi3_default { + spi1_default: spi1_default { group1 { psels = , - , - ; + , + ; }; }; - spi3_sleep: spi3_sleep { + spi1_sleep: spi1_sleep { group1 { psels = , - , - ; + , + ; + low-power-enable; + }; + }; + + spi3_default: spi3_default { + group1 { + psels = , + , + ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = , + , + ; low-power-enable; }; }; diff --git a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common.dts b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common.dts index a1d72bb1b08..ad8f6a3e094 100644 --- a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common.dts +++ b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common.dts @@ -174,7 +174,7 @@ }; arduino_serial: &uart1 { - status = "okay"; + /* Cannot be used together with spi1, hence disabled by default. */ current-speed = <115200>; pinctrl-0 = <&uart1_default>; pinctrl-1 = <&uart1_sleep>; @@ -202,10 +202,17 @@ arduino_i2c: &i2c2 { pinctrl-names = "default", "sleep"; }; -arduino_spi: &spi3 { +arduino_spi: &spi1 { + /* Cannot be used together with uart1, hence disabled by default. */ + cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&spi3 { compatible = "nordic,nrf-spim"; status = "okay"; - cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ pinctrl-0 = <&spi3_default>; pinctrl-1 = <&spi3_sleep>; pinctrl-names = "default", "sleep"; diff --git a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common_0_14_0.dtsi b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common_0_14_0.dtsi index e5b62be419f..d8d521261dd 100644 --- a/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common_0_14_0.dtsi +++ b/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_common_0_14_0.dtsi @@ -37,12 +37,34 @@ }; }; +&pinctrl { + spi3_default_v14: spi3_default_v14 { + group1 { + psels = , + , + ; + }; + }; + + spi3_sleep_v14: spi3_sleep_v14 { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + &spi3 { - cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>, /* D10 */ - <&gpio0 25 GPIO_ACTIVE_LOW>; - mx25r64: mx25r6435f@1 { + status = "okay"; + pinctrl-0 = <&spi3_default_v14>; + pinctrl-1 = <&spi3_sleep_v14>; + pinctrl-names = "default", "sleep"; + cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; + mx25r64: mx25r6435f@0 { compatible = "jedec,spi-nor"; - reg = <1>; + reg = <0>; spi-max-frequency = <8000000>; label = "MX25R64"; jedec-id = [c2 28 17]; From cfeecbd8718310d4f443ab0022b205d3b5aeb3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 324/501] Revert "[nrf fromtree] s2ram: Deal with system off failure" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bf61af0f6ccef33d2d408e31776cd92bab333a51. Signed-off-by: Andrzej Głąbek --- arch/arm/core/aarch32/cortex_m/pm_s2ram.S | 24 ++++------------------- include/zephyr/arch/common/pm_s2ram.h | 14 +++---------- samples/boards/nrf/s2ram/src/main.c | 18 ++++------------- 3 files changed, 11 insertions(+), 45 deletions(-) diff --git a/arch/arm/core/aarch32/cortex_m/pm_s2ram.S b/arch/arm/core/aarch32/cortex_m/pm_s2ram.S index aa715c8bbb9..9dd77bb8aa2 100644 --- a/arch/arm/core/aarch32/cortex_m/pm_s2ram.S +++ b/arch/arm/core/aarch32/cortex_m/pm_s2ram.S @@ -27,7 +27,7 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend) * * r0: address of the system_off function */ - push {r4-r12, lr} + push {r4-r12, r14} ldr r1, =_cpu_context mrs r2, msp @@ -71,25 +71,9 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend) str r2, [r1] /* - * Call the system_off function passed as parameter. This should never - * return. + * Call the system_off function passed as parameter */ - blx r0 - - /* - * The system_off function returns here only when the powering off was - * not successful (in r0 the return value). - */ - - /* - * Reset the marker - */ - ldr r1, =marker - mov r2, #0x0 - str r2, [r1] - - pop {r4-r12, lr} - bx lr + bx r0 GTEXT(arch_pm_s2ram_resume) SECTION_FUNC(TEXT, arch_pm_s2ram_resume) @@ -150,7 +134,7 @@ resume: msr control, r1 isb - pop {r4-r12, lr} + pop {r4-r12, r14} /* * Set the return value and return diff --git a/include/zephyr/arch/common/pm_s2ram.h b/include/zephyr/arch/common/pm_s2ram.h index fff51f7350b..18247261340 100644 --- a/include/zephyr/arch/common/pm_s2ram.h +++ b/include/zephyr/arch/common/pm_s2ram.h @@ -25,17 +25,10 @@ extern "C" { * @brief System off function * * This function is passed as argument and called by @ref arch_pm_s2ram_suspend - * to power the system off after the CPU context has been saved. - * - * This function never returns if the system is powered off. If the operation - * cannot be performed a proper value is returned and the code must take care - * of restoring the system in a fully operational state before returning. - * - * @retval none The system is powered off. - * @retval -EBUSY The system is busy and cannot be powered off at this time. - * @retval -errno Other error codes. + * to power the system off after the CPU context has been saved. This function + * never returns. */ -typedef int (*pm_s2ram_system_off_fn_t)(void); +typedef void (*pm_s2ram_system_off_fn_t)(void); /** * @brief Save CPU context on suspend @@ -51,7 +44,6 @@ typedef int (*pm_s2ram_system_off_fn_t)(void); * @param system_off Function to power off the system. * * @retval 0 The CPU context was successfully saved and restored. - * @retval -EBUSY The system is busy and cannot be suspended at this time. * @retval -errno Negative errno code in case of failure. */ int arch_pm_s2ram_suspend(pm_s2ram_system_off_fn_t system_off); diff --git a/samples/boards/nrf/s2ram/src/main.c b/samples/boards/nrf/s2ram/src/main.c index cd04cd0addf..dea82e652db 100644 --- a/samples/boards/nrf/s2ram/src/main.c +++ b/samples/boards/nrf/s2ram/src/main.c @@ -15,34 +15,24 @@ #include #include -static int system_off(void) +static void system_off(void) { nrf_regulators_system_off(NRF_REGULATORS); - - /* - * We should never reach this point if the system is powered off. If we - * do, return -EBUSY. - */ - return -EBUSY; } static void do_suspend(void) { - int ret; + irq_lock(); /* * Save the CPU context (including the return address),set the SRAM * marker and power off the system. */ - ret = arch_pm_s2ram_suspend(system_off); + arch_pm_s2ram_suspend(system_off); /* - * XXX: On resuming or error we return exactly *HERE* + * XXX: On resuming we return exactly *HERE* */ - - if (ret != 0) { - printk("Something went wrong during suspend"); - } } void main(void) From 4429d777d436714936e74c3b12d4e933b24dde85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 325/501] Revert "[nrf fromtree] drivers: serial: nrf: Tweak default values for workaround" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3dbe5ae3c66998409fd2f126e24a5f8331305eff. Signed-off-by: Andrzej Głąbek --- drivers/serial/Kconfig.nrfx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index c5a7884a2ca..23b8e5ef0fa 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -41,13 +41,13 @@ if UART_NRF_DK_SERIAL_WORKAROUND config UART_NRF_DK_SERIAL_WORKAROUND_COUNT int - default 64 + default 32 help Number of bytes transferred after which a busy wait is added. config UART_NRF_DK_SERIAL_WORKAROUND_WAIT_MS int - default 7 + default 10 help Busy wait time (in milliseconds). endif From 591f61966af11695c0f8650d32bcbf9e3bd3435a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 326/501] Revert "[nrf fromtree] tests: arch: arm: arm_interrupt: Increase stack size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba99d0a75e1720d92908a962b867bea0cecfc759. Signed-off-by: Andrzej Głąbek --- tests/arch/arm/arm_interrupt/testcase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/arch/arm/arm_interrupt/testcase.yaml b/tests/arch/arm/arm_interrupt/testcase.yaml index f154981c10e..f91b64c7660 100644 --- a/tests/arch/arm/arm_interrupt/testcase.yaml +++ b/tests/arch/arm/arm_interrupt/testcase.yaml @@ -11,7 +11,6 @@ tests: - CONFIG_NO_OPTIMIZATIONS=y - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 - - CONFIG_TEST_EXTRA_STACK_SIZE=1024 arch.interrupt.extra_exception_info: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: From 3abe7da6450eeae260edd431e2a3748d7a1e11ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 327/501] Revert "[nrf fromtree] tests: portability: cmsis_rtos_v2: Inrease timeout" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1e1358220095f99f5ab7b5bf4353c3b12110e5a9. Signed-off-by: Andrzej Głąbek --- tests/subsys/portability/cmsis_rtos_v2/src/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/subsys/portability/cmsis_rtos_v2/src/timer.c b/tests/subsys/portability/cmsis_rtos_v2/src/timer.c index 84682dec7d6..dbc7137b3ce 100644 --- a/tests/subsys/portability/cmsis_rtos_v2/src/timer.c +++ b/tests/subsys/portability/cmsis_rtos_v2/src/timer.c @@ -8,7 +8,7 @@ #include #define ONESHOT_TIME_TICKS 100 -#define PERIOD_TICKS MAX(50, k_ms_to_ticks_ceil32(10)) +#define PERIOD_TICKS MAX(50, k_ms_to_ticks_ceil32(5)) #define NUM_PERIODS 5 uint32_t num_oneshots_executed; From e7de606592d6e63feb50240759aa8361faacb699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 328/501] Revert "[nrf fromtree] tests: arm: Increase main stack size with no optimizations" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c173e608d99492515ff71fa20e5ecfc5619ee105. Signed-off-by: Andrzej Głąbek --- subsys/testsuite/Kconfig | 5 +---- tests/arch/arm/arm_interrupt/testcase.yaml | 2 +- tests/arch/arm/arm_thread_swap/testcase.yaml | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/subsys/testsuite/Kconfig b/subsys/testsuite/Kconfig index 49cb02a6d57..de29e6d3d4b 100644 --- a/subsys/testsuite/Kconfig +++ b/subsys/testsuite/Kconfig @@ -139,10 +139,7 @@ config TEST_ARM_CORTEX_M help ARM Cortex-M configuration required when testing. - This option is used to select stack sizes and enable features for - testing. - - This option is also used to force routing + Currently, this option is only utilized, to force routing BusFault, HardFault, and NMI exceptions to Secure State, when building a Secure ARMv8-M firmware. This will allow the testing suite to utilize these exceptions, in tests. diff --git a/tests/arch/arm/arm_interrupt/testcase.yaml b/tests/arch/arm/arm_interrupt/testcase.yaml index f91b64c7660..9b8b81b7bbd 100644 --- a/tests/arch/arm/arm_interrupt/testcase.yaml +++ b/tests/arch/arm/arm_interrupt/testcase.yaml @@ -10,7 +10,7 @@ tests: extra_configs: - CONFIG_NO_OPTIMIZATIONS=y - CONFIG_IDLE_STACK_SIZE=512 - - CONFIG_MAIN_STACK_SIZE=2048 + - CONFIG_MAIN_STACK_SIZE=1024 arch.interrupt.extra_exception_info: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: diff --git a/tests/arch/arm/arm_thread_swap/testcase.yaml b/tests/arch/arm/arm_thread_swap/testcase.yaml index b90e82270d1..3d9ae8d0df6 100644 --- a/tests/arch/arm/arm_thread_swap/testcase.yaml +++ b/tests/arch/arm/arm_thread_swap/testcase.yaml @@ -10,7 +10,6 @@ tests: extra_configs: - CONFIG_NO_OPTIMIZATIONS=y - CONFIG_IDLE_STACK_SIZE=512 - - CONFIG_MAIN_STACK_SIZE=2048 min_flash: 192 arch.arm.swap.common.fpu_sharing: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_ARMV7_M_ARMV8_M_FP @@ -24,5 +23,4 @@ tests: - CONFIG_FPU_SHARING=y - CONFIG_NO_OPTIMIZATIONS=y - CONFIG_IDLE_STACK_SIZE=512 - - CONFIG_MAIN_STACK_SIZE=2048 min_flash: 192 From c6ac8bcbec9c60cf6137cf09929de58e49385e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 329/501] Revert "[nrf fromtree] boards: nrf: Activate pull-up on QSPI CSN line in "sleep" state" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4eed3ea39dba262d1a178392b333800e8b0c63fa. Signed-off-by: Andrzej Głąbek --- boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi | 8 ++------ .../nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi | 8 ++------ .../nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi | 8 ++------ .../thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi | 8 ++------ tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay | 8 ++------ 5 files changed, 10 insertions(+), 30 deletions(-) diff --git a/boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi b/boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi index 270d64081e2..11c7bbb845c 100644 --- a/boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi +++ b/boards/arm/nrf52840_mdk/nrf52840_mdk-pinctrl.dtsi @@ -88,13 +88,9 @@ , , , - ; - low-power-enable; - }; - group2 { - psels = ; + , + ; low-power-enable; - bias-pull-up; }; }; diff --git a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi index 397eca2cd86..60a01eff758 100644 --- a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi +++ b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi @@ -156,13 +156,9 @@ , , , - ; - low-power-enable; - }; - group2 { - psels = ; + , + ; low-power-enable; - bias-pull-up; }; }; diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi index e2dfe9d5d84..c7974a443a8 100644 --- a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi +++ b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi @@ -71,13 +71,9 @@ , , , - ; - low-power-enable; - }; - group2 { - psels = ; + , + ; low-power-enable; - bias-pull-up; }; }; diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi index 6f3e5631de9..6947a20237f 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common-pinctrl.dtsi @@ -98,13 +98,9 @@ group1 { psels = , , - ; - low-power-enable; - }; - group2 { - psels = ; + , + ; low-power-enable; - bias-pull-up; }; }; diff --git a/tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay b/tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay index 1b39dd94d1e..9acee0e2481 100644 --- a/tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay +++ b/tests/drivers/flash/boards/nrf52840dk_mx25l51245g.overlay @@ -29,13 +29,9 @@ , , , - ; - low-power-enable; - }; - group2 { - psels = ; + , + ; low-power-enable; - bias-pull-up; }; }; }; From 98532f36ffaa359bda20986f195cd5e1a3478dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 330/501] Revert "[nrf fromtree] drivers: sensor: adxl372: Fix default bus issue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8ea48c4648ae31f38ded8ea4f2cd0b574e4b9306. Signed-off-by: Andrzej Głąbek --- drivers/sensor/adxl372/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/sensor/adxl372/Kconfig b/drivers/sensor/adxl372/Kconfig index 680ef4ebb89..629a9c5e242 100644 --- a/drivers/sensor/adxl372/Kconfig +++ b/drivers/sensor/adxl372/Kconfig @@ -16,8 +16,6 @@ if ADXL372 choice ADXL372_BUS_TYPE prompt "Interface type" - default ADXL372_I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),i2c) - default ADXL372_SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),spi) help Select interface the digital interface type for the ADXL372 From e63916a058b8424384d5972535c9562ae4d8059a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 331/501] Revert "[nrf fromtree] Bluetooth: L2CAP: Add check to see if device is not disconnected" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 69a0a5d77461ef1cfbb671550d82b889a1d3c66c. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/l2cap.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index e0a9bed3ca6..6426fbd46ce 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -701,11 +701,6 @@ static void le_conn_param_update_req(struct bt_l2cap *l2cap, uint8_t ident, return; } - if (conn->state != BT_CONN_CONNECTED) { - BT_WARN("Not connected"); - return; - } - if (conn->role != BT_HCI_ROLE_CENTRAL) { l2cap_send_reject(conn, ident, BT_L2CAP_REJ_NOT_UNDERSTOOD, NULL, 0); From 5867c46ce1f0319e2e24cfd8de91b79a91efd42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 332/501] Revert "[nrf fromtree] Bluetooth: gatt: support having the CCCD in any location" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2abee9c80bd199a14276b3c0879be66e1c492081. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/gatt.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index aa134b25fab..fd9861f8e3f 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -3145,18 +3145,7 @@ bool bt_gatt_is_subscribed(struct bt_conn *conn, __ASSERT(attr, "No more attributes\n"); } - /* Find the CCC Descriptor */ - while (bt_uuid_cmp(attr->uuid, BT_UUID_GATT_CCC) && - /* Also stop if we leave the current characteristic definition */ - bt_uuid_cmp(attr->uuid, BT_UUID_GATT_CHRC) && - bt_uuid_cmp(attr->uuid, BT_UUID_GATT_PRIMARY) && - bt_uuid_cmp(attr->uuid, BT_UUID_GATT_SECONDARY)) { - attr = bt_gatt_attr_next(attr); - if (!attr) { - return false; - } - } - + /* Check if the attribute is the CCC Descriptor */ if (bt_uuid_cmp(attr->uuid, BT_UUID_GATT_CCC) != 0) { return false; } From 49e53f4d8f22fd7f95fb55372eafe2ae6fdca821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 333/501] Revert "[nrf fromtree] Bluetooth: writing appearance to settings" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 55d188cc2301cf19143275758c1b8e67ecb544fd. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/hci_core.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 9b1554d027f..cd2ca5e4e07 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3809,20 +3809,17 @@ uint16_t bt_get_appearance(void) #if defined(CONFIG_BT_DEVICE_APPEARANCE_DYNAMIC) int bt_set_appearance(uint16_t appearance) { - if (bt_dev.appearance != appearance) { - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { - int err = settings_save_one("bt/appearance", &appearance, - sizeof(appearance)); - - if (err) { - BT_ERR("Unable to save setting 'bt/appearance' (err %d).", err); - return err; - } - } + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { + int err = settings_save_one("bt/appearance", &appearance, sizeof(appearance)); - bt_dev.appearance = appearance; + if (err) { + BT_ERR("Unable to save setting 'bt/appearance' (err %d).", err); + return err; + } } + bt_dev.appearance = appearance; + return 0; } #endif From cc1cc7074291bc15721bcc24d982f38bf88e2ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 334/501] Revert "[nrf fromtree] boards: actinius_icarus_som: rename sim-select to actinius-sim-select" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b1e0278455ab92dbfd06b940a22d838954600a51. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts | 2 +- .../dts/bindings/{actinius-sim-select.yaml => sim-select.yaml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename boards/arm/actinius_icarus_som/dts/bindings/{actinius-sim-select.yaml => sim-select.yaml} (95%) diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index 14240fca8fa..a581373e95c 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -21,7 +21,7 @@ }; sim_select: sim-select { - compatible = "actinius-sim-select"; + compatible = "sim-select"; sim-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; sim = "esim"; }; diff --git a/boards/arm/actinius_icarus_som/dts/bindings/actinius-sim-select.yaml b/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml similarity index 95% rename from boards/arm/actinius_icarus_som/dts/bindings/actinius-sim-select.yaml rename to boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml index fc1580d2065..f750f57c736 100644 --- a/boards/arm/actinius_icarus_som/dts/bindings/actinius-sim-select.yaml +++ b/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml @@ -7,7 +7,7 @@ description: | external nano-SIM. The SIM can be selected by changing the `sim` property of the `sim_select` dt node to `esim` or `external`. -compatible: "actinius-sim-select" +compatible: "sim-select" include: base.yaml From f2e2c2e61dea357e6aea83ee97ebe06f6ffdc707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 335/501] Revert "[nrf fromtree] boards: actinius_icarus_bee: rename sim-select to actinius-sim-select" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0362c7d8529f02cdffcbd004f55a58c1f473eaa5. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts | 2 +- .../dts/bindings/{actinius-sim-select.yaml => sim-select.yaml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename boards/arm/actinius_icarus_bee/dts/bindings/{actinius-sim-select.yaml => sim-select.yaml} (95%) diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 6934b1bb8da..20ea0c970d6 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -82,7 +82,7 @@ }; sim_select: sim-select { - compatible = "actinius-sim-select"; + compatible = "sim-select"; sim-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; sim = "esim"; }; diff --git a/boards/arm/actinius_icarus_bee/dts/bindings/actinius-sim-select.yaml b/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml similarity index 95% rename from boards/arm/actinius_icarus_bee/dts/bindings/actinius-sim-select.yaml rename to boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml index fc1580d2065..f750f57c736 100644 --- a/boards/arm/actinius_icarus_bee/dts/bindings/actinius-sim-select.yaml +++ b/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml @@ -7,7 +7,7 @@ description: | external nano-SIM. The SIM can be selected by changing the `sim` property of the `sim_select` dt node to `esim` or `external`. -compatible: "actinius-sim-select" +compatible: "sim-select" include: base.yaml From d33fdf5141e2e1e3cfed5ef7d0a0b7a9b3728d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 336/501] Revert "[nrf fromtree] boards: arm: actinius_icarus: split non-common pinctrl entries" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9109fd61a2140017d535e761bfdbdbb6f0c36069. Signed-off-by: Andrzej Głąbek --- .../actinius_icarus_1_4_0.overlay | 7 ----- .../actinius_icarus_common-pinctrl.dtsi | 19 ++++++++++++++ .../actinius_icarus_common_1_4_0.dtsi | 26 ------------------- .../actinius_icarus_common_2_0_0.dtsi | 13 ++++++++-- .../actinius_icarus_ns_1_4_0.overlay | 7 ----- 5 files changed, 30 insertions(+), 42 deletions(-) delete mode 100644 boards/arm/actinius_icarus/actinius_icarus_1_4_0.overlay delete mode 100644 boards/arm/actinius_icarus/actinius_icarus_common_1_4_0.dtsi delete mode 100644 boards/arm/actinius_icarus/actinius_icarus_ns_1_4_0.overlay diff --git a/boards/arm/actinius_icarus/actinius_icarus_1_4_0.overlay b/boards/arm/actinius_icarus/actinius_icarus_1_4_0.overlay deleted file mode 100644 index 07190f7553f..00000000000 --- a/boards/arm/actinius_icarus/actinius_icarus_1_4_0.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2022 Actinius - * - * SPDX-License-Identifier: Apache-2.0 - */ - - #include "actinius_icarus_common_1_4_0.dtsi" diff --git a/boards/arm/actinius_icarus/actinius_icarus_common-pinctrl.dtsi b/boards/arm/actinius_icarus/actinius_icarus_common-pinctrl.dtsi index c4bf5200844..450d79cc163 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common-pinctrl.dtsi +++ b/boards/arm/actinius_icarus/actinius_icarus_common-pinctrl.dtsi @@ -4,6 +4,25 @@ */ &pinctrl { + uart0_default: uart0_default { + group1 { + psels = , + , + , + ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; + uart1_default: uart1_default { group1 { psels = , diff --git a/boards/arm/actinius_icarus/actinius_icarus_common_1_4_0.dtsi b/boards/arm/actinius_icarus/actinius_icarus_common_1_4_0.dtsi deleted file mode 100644 index 7f1f4aa7d96..00000000000 --- a/boards/arm/actinius_icarus/actinius_icarus_common_1_4_0.dtsi +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Actinius - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart0_default: uart0_default { - group1 { - psels = , - , - , - ; - }; - }; - - uart0_sleep: uart0_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; diff --git a/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi b/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi index 9c63a8de335..5fb6e405456 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi +++ b/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi @@ -5,14 +5,14 @@ */ &pinctrl { - uart0_default: uart0_default { + uart0_default_v2: uart0_default_v2 { group1 { psels = , ; }; }; - uart0_sleep: uart0_sleep { + uart0_sleep_v2: uart0_sleep_v2 { group1 { psels = , ; @@ -21,6 +21,15 @@ }; }; +&uart0 { + status = "okay"; + + current-speed = <115200>; + pinctrl-0 = <&uart0_default_v2>; + pinctrl-1 = <&uart0_sleep_v2>; + pinctrl-names = "default", "sleep"; +}; + &spi3 { status = "okay"; diff --git a/boards/arm/actinius_icarus/actinius_icarus_ns_1_4_0.overlay b/boards/arm/actinius_icarus/actinius_icarus_ns_1_4_0.overlay deleted file mode 100644 index 07190f7553f..00000000000 --- a/boards/arm/actinius_icarus/actinius_icarus_ns_1_4_0.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2022 Actinius - * - * SPDX-License-Identifier: Apache-2.0 - */ - - #include "actinius_icarus_common_1_4_0.dtsi" From 57856635ffbd61687e55a97bfef8ca015efb3ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 337/501] Revert "[nrf fromtree] boards: actinius_icarus: add support for hardware version v2.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bc9397961e625db4503ecd5343a10abbe0ce9ccb. Signed-off-by: Andrzej Głąbek --- .../actinius_icarus_2_0_0.overlay | 7 - .../actinius_icarus_common.dts | 2 +- .../actinius_icarus_common_2_0_0.dtsi | 60 --------- .../actinius_icarus_ns_2_0_0.overlay | 7 - boards/arm/actinius_icarus/board.c | 55 +------- .../doc/img/Icarus_internal_pinouts.png | Bin 0 -> 9371 bytes boards/arm/actinius_icarus/doc/index.rst | 124 ++---------------- .../dts/bindings/actinius-charger-enable.yaml | 26 ---- ...tinius-sim-select.yaml => sim-select.yaml} | 4 +- boards/arm/actinius_icarus/revision.cmake | 8 -- dts/bindings/vendor-prefixes.txt | 1 - 11 files changed, 21 insertions(+), 273 deletions(-) delete mode 100644 boards/arm/actinius_icarus/actinius_icarus_2_0_0.overlay delete mode 100644 boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi delete mode 100644 boards/arm/actinius_icarus/actinius_icarus_ns_2_0_0.overlay create mode 100644 boards/arm/actinius_icarus/doc/img/Icarus_internal_pinouts.png delete mode 100644 boards/arm/actinius_icarus/dts/bindings/actinius-charger-enable.yaml rename boards/arm/actinius_icarus/dts/bindings/{actinius-sim-select.yaml => sim-select.yaml} (87%) delete mode 100644 boards/arm/actinius_icarus/revision.cmake diff --git a/boards/arm/actinius_icarus/actinius_icarus_2_0_0.overlay b/boards/arm/actinius_icarus/actinius_icarus_2_0_0.overlay deleted file mode 100644 index 79e7c3ff28d..00000000000 --- a/boards/arm/actinius_icarus/actinius_icarus_2_0_0.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2022 Actinius - * - * SPDX-License-Identifier: Apache-2.0 - */ - - #include "actinius_icarus_common_2_0_0.dtsi" diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index a98231ace4d..98170d80ac4 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -88,7 +88,7 @@ }; sim_select: sim-select { - compatible = "actinius-sim-select"; + compatible = "sim-select"; sim-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; sim = "esim"; }; diff --git a/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi b/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi deleted file mode 100644 index 5fb6e405456..00000000000 --- a/boards/arm/actinius_icarus/actinius_icarus_common_2_0_0.dtsi +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2022 Actinius - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart0_default_v2: uart0_default_v2 { - group1 { - psels = , - ; - }; - }; - - uart0_sleep_v2: uart0_sleep_v2 { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&uart0 { - status = "okay"; - - current-speed = <115200>; - pinctrl-0 = <&uart0_default_v2>; - pinctrl-1 = <&uart0_sleep_v2>; - pinctrl-names = "default", "sleep"; -}; - -&spi3 { - status = "okay"; - - cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; - - w25q64: w25q64jv@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <80000000>; - jedec-id = [ef 40 17]; - size = <0x4000000>; - has-dpd; - t-enter-dpd = <3500>; - t-exit-dpd = <3500>; - }; -}; - -/ { - aliases { - spi-flash0 = &w25q64; - }; - - charger_enable: charger-enable { - compatible = "actinius-charger-enable"; - gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; - charger = "auto"; - }; -}; diff --git a/boards/arm/actinius_icarus/actinius_icarus_ns_2_0_0.overlay b/boards/arm/actinius_icarus/actinius_icarus_ns_2_0_0.overlay deleted file mode 100644 index 79e7c3ff28d..00000000000 --- a/boards/arm/actinius_icarus/actinius_icarus_ns_2_0_0.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2022 Actinius - * - * SPDX-License-Identifier: Apache-2.0 - */ - - #include "actinius_icarus_common_2_0_0.dtsi" diff --git a/boards/arm/actinius_icarus/board.c b/boards/arm/actinius_icarus/board.c index b5b5b3621bd..270dd550d50 100644 --- a/boards/arm/actinius_icarus/board.c +++ b/boards/arm/actinius_icarus/board.c @@ -11,15 +11,16 @@ #include LOG_MODULE_REGISTER(board_control, CONFIG_BOARD_ICARUS_LOG_LEVEL); -#define CHARGER_ENABLE_NODE DT_NODELABEL(charger_enable) - -static int set_sim_select_pin(void) +static int board_actinius_icarus_init(const struct device *dev) { const struct gpio_dt_spec sim = GPIO_DT_SPEC_GET(DT_NODELABEL(sim_select), sim_gpios); + ARG_UNUSED(dev); + if (!device_is_ready(sim.port)) { LOG_ERR("The SIM Select Pin port is not ready"); + return -ENODEV; } @@ -34,53 +35,5 @@ static int set_sim_select_pin(void) return 0; } -#if DT_NODE_EXISTS(CHARGER_ENABLE_NODE) - -static int set_charger_enable_pin(void) -{ - const struct gpio_dt_spec charger_en = - GPIO_DT_SPEC_GET(CHARGER_ENABLE_NODE, gpios); - - if (!device_is_ready(charger_en.port)) { - LOG_ERR("The Charger Enable Pin port is not ready"); - return -ENODEV; - } - - if (DT_ENUM_IDX(CHARGER_ENABLE_NODE, charger) == 0) { - (void)gpio_pin_configure_dt(&charger_en, GPIO_OUTPUT_LOW); - LOG_INF("Charger is set to auto"); - } else { - (void)gpio_pin_configure_dt(&charger_en, GPIO_OUTPUT_HIGH); - LOG_INF("Charger is disabled"); - } - - return 0; -} - -#endif /* DT_NODE_EXISTS(CHARGER_ENABLE_NODE) */ - -static int board_actinius_icarus_init(const struct device *dev) -{ - ARG_UNUSED(dev); - - int result; - - result = set_sim_select_pin(); - if (result < 0) { - LOG_ERR("Failed to set the SIM Select Pin (error: %d)", result); - /* do not return so that the rest of the init process is attempted */ - } - -#if DT_NODE_EXISTS(CHARGER_ENABLE_NODE) - result = set_charger_enable_pin(); - if (result < 0) { - LOG_ERR("Failed to set the Charger Enable Pin (error: %d)", result); - /* do not return so that the rest of the init process is attempted */ - } -#endif /* DT_NODE_EXISTS(CHARGER_ENABLE_NODE) */ - - return result; -} - /* Needs to happen after GPIO driver init */ SYS_INIT(board_actinius_icarus_init, POST_KERNEL, 99); diff --git a/boards/arm/actinius_icarus/doc/img/Icarus_internal_pinouts.png b/boards/arm/actinius_icarus/doc/img/Icarus_internal_pinouts.png new file mode 100644 index 0000000000000000000000000000000000000000..9e99646b75791f4c37bfc3b3f6c2ae31af66183d GIT binary patch literal 9371 zcmaKRcUTkA(sz&m2{nY?0}=#jp-Phu(xeK6DggvklqS6hA)!mJf^;cT44@Pdlt>5Z zQl$45I?~k_@4er@-|lRg*_q$WnVEB*eRiV__3u%UvyuY<04i-Qbz=a42yuPvgNUys zjNiX`0{}O84D}vpT(iUsa>R^sU^eAIR>x}!WpgB^m%YA`9a@ncUR566ksV&SmISak z$PBF<{5qFVdAL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+r@yNY1Z^_c!XPIzj};!VbX-bqdfWP3cv7~6tNe{gaW(k07QTP0nFG9s8NeC z>4S}(zL2r}Po!r3*9LMedPHphhfJ;C!U;FK@?!e)B1@c|P9km795JZ&R#;=(?Mp&l z=cOZ&89!X>m1*}mSHJD#r?!6a_pf=g>58u-lH)>l)|$NxTo2eN_)iUtEzws3a+%cE zQ)0~SqAWBt9j0oD?sft56vCs7bp+m~My129b!;*;0}h1q|6>!-^^1=~k8HFpieJp-GHiyO73Jr5nWA06H6ClUtyAX7qCI71H#6j#aFfAO~h-2 ziga(#8Hejv#<<}}B+8R;kW*y|mjl^#ohxd9xAvhc{J+5m!fl;JeG?2IKQ;m#nLA!Y zMNz!wrc?r9Vrv_Cqm?wUi%Lc%17-ylwfm4_wpgsNisHDDOB$HWBD4Z^4C=hZb*4N6 zv?%z(aLH~xp}L7}+=EH9M|425Lp7xt=*lzCW(;MZNNQ+lTW=1&%)ASL7FN-Tn{!xn z1T2S&0Trks+)hTfR?b+J%i!G(xzFrT%q?PnnP=7*fk9ODQ|o`~o+O)P7o@|2Tm3Ux zzkUu}qbXUDxDJ={mptt`-!4kzdccENn|_W4?Rs6vClZ60Z!Mf5^e@21K{Xa(*OTVD zI-t$F!5joq4!!F+C9Hz^0Hn3JT-Lu(ena^Chx(eZ@t=>G$r Cw~N*Q literal 0 HcmV?d00001 diff --git a/boards/arm/actinius_icarus/doc/index.rst b/boards/arm/actinius_icarus/doc/index.rst index a9ce297fbad..05c2f0555f6 100644 --- a/boards/arm/actinius_icarus/doc/index.rst +++ b/boards/arm/actinius_icarus/doc/index.rst @@ -37,11 +37,6 @@ following devices (provided directly by Nordic): * :abbr:`WDT (Watchdog Timer)` * :abbr:`IDAU (Implementation Defined Attribution Unit)` -Hardware -******** - -The detailed information about the on-board hardware can be found at the `Icarus Product Website`_. - .. figure:: img/Icarus_pinouts.png :width: 450px :align: center @@ -49,102 +44,17 @@ The detailed information about the on-board hardware can be found at the `Icarus Icarus IoT Dev Board w/ Pinouts -Pin description -=============== - -External Pins available to user: - -+------------+----------------------------+----------------------------------------------+------------------+ -| Icarus pin | Function | Description | Device-tree node | -+============+============================+==============================================+==================+ -| RST | Reset | Active low reset with internal pullup | - | -+------------+----------------------------+----------------------------------------------+------------------+ -| 3.3V | Power output | Main 3.3 V supply | - | -+------------+----------------------------+----------------------------------------------+------------------+ -| NC | - | Not connected | - | -+------------+----------------------------+----------------------------------------------+------------------+ -| GND | Power output | Ground | - | -+------------+----------------------------+----------------------------------------------+------------------+ -| 14 / A1 | GPIO / Analog in | nRF9160 P0.14 / AIN1 | gpio0 / adc_1 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 15 / A2 | GPIO / Analog in | nRF9160 P0.15 / AIN2 | gpio0 / adc_2 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 16 / A3 | GPIO / Analog in | nRF9160 P0.16 / AIN3 | gpio0 / adc_3 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 17 / A4 | GPIO / Analog in | nRF9160 P0.17 / AIN4 | gpio0 / adc_4 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 18 / A5 | GPIO / Analog in | nRF9160 P0.18 / AIN5 | gpio0 / adc_5 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 19 / A6 | GPIO / Analog in | nRF9160 P0.19 / AIN6 | gpio0 / adc_6 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 20 / SCK | GPIO / SPI pin | nRF9160 P0.20 / SPI SCK pin | gpio0 / spi3 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 21 / MOSI | GPIO / SPI pin | nRF9160 P0.21 / SPI MOSI pin | gpio0 / spi3 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 22 / MISO | GPIO / SPI pin | nRF9160 P0.22 / SPI MISO pin | gpio0 / spi3 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 23 / RX | GPIO / UART pin | nRF9160 P0.23 / UART RX pin | gpio0 / uart1 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 24 / TX | GPIO / UART pin | nRF9160 P0.24 / UART TX pin | gpio0 / uart1 | -+------------+----------------------------+----------------------------------------------+------------------+ -| VIN | Power input | Voltage input (maximum 10.2 V) | - | -+------------+----------------------------+----------------------------------------------+------------------+ -| VBAT | Power input | Battery voltage input | - | -+------------+----------------------------+----------------------------------------------+------------------+ -| EN | Power enable | Power enable pin (pull low to disable power) | - | -+------------+----------------------------+----------------------------------------------+------------------+ -| USB | Power input | USB voltage input | gpio0 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 4 | GPIO | nRF9160 P0.04 | gpio0 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 3 | GPIO | nRF9160 P0.03 | gpio0 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 2 | GPIO | nRF9160 P0.02 | gpio0 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 1 | GPIO | nRF9160 P0.01 | gpio0 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 0 | GPIO | nRF9160 P0.00 | gpio0 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 30 | GPIO | nRF9160 P0.30 | gpio0 | -+------------+----------------------------+----------------------------------------------+------------------+ -| 31 | GPIO | nRF9160 P0.31 | gpio0 | -+------------+----------------------------+----------------------------------------------+------------------+ -| SCL | GPIO / I2C pin | nRF9160 P0.26 / I2C SCL pin | gpio0 / i2c2 | -+------------+----------------------------+----------------------------------------------+------------------+ -| SDA | GPIO / I2C pin | nRF9160 P0.27 / I2C SDA pin | gpio0 / i2c2 | -+------------+----------------------------+----------------------------------------------+------------------+ - -nRF9160 pins connected internally: - -+--------------+---------------------------------------+----------------------+ -| nRF9160 pin | Function | Device-tree node | -+==============+=======================================+======================+ -| P0.05 | User button | button0 | -+--------------+---------------------------------------+----------------------+ -| P0.10 | Red LED | led0 / pwm-led0 | -+--------------+---------------------------------------+----------------------+ -| P0.11 | Green LED | led1 / pwm-led1 | -+--------------+---------------------------------------+----------------------+ -| P0.12 | Blue LED | led2 / pwm-led2 | -+--------------+---------------------------------------+----------------------+ -| P0.28 | Accelerometer Interrupt 1 | lis2dh12-accel | -+--------------+---------------------------------------+----------------------+ -| P0.29 | Accelerometer Interrupt 2 | lis2dh12-accel | -+--------------+---------------------------------------+----------------------+ -| P0.08 | SIM select pin | gpio0 | -+--------------+---------------------------------------+----------------------+ -| P0.13 / AIN0 | Battery voltage measurement | adc_0 | -+--------------+---------------------------------------+----------------------+ -| P0.06 | USB - FTDI serial RX | uart0 | -+--------------+---------------------------------------+----------------------+ -| P0.09 | USB - FTDI serial TX | uart0 | -+--------------+---------------------------------------+----------------------+ -| P0.07 | USB - FTDI serial RTS | uart0 | -| | Charger enable pin (Icarus v2.0) | gpio0 (Icarus v2.0) | -+--------------+---------------------------------------+----------------------+ -| P0.25 | USB - FTDI serial CTS | uart0 | -| | FLASH memory SPI CS pin (Icarus v2.0) | gpio0 (Icarus v2.0) | -+--------------+---------------------------------------+----------------------+ +.. figure:: img/Icarus_internal_pinouts.png + :width: 200px + :align: center + :alt: Icarus IoT Dev Board + + Internal Pinouts + +Hardware +******** + +The detailed information about the on-board hardware can be found at the `Icarus Product Website`_. Supported Features ================== @@ -180,18 +90,12 @@ hardware features: | ACCEL | st | lis2dh | +-----------+------------+----------------------+ -SIM Selection -============= +SIM selection +************* -The SIM choice (eSIM or nano-SIM) can be configured in Devicetree by adjusting +The sim choice (eSIM or nano-SIM) can be configured in Devicetree by adjusting the ``sim`` property in the ``sim_select`` node. -Charger Enable/Disable -====================== - -Since hardware version 2.0 the charger can be disabled by adjusting the ``charger`` -property of the ``charger_enable`` device tree node. - Security components =================== diff --git a/boards/arm/actinius_icarus/dts/bindings/actinius-charger-enable.yaml b/boards/arm/actinius_icarus/dts/bindings/actinius-charger-enable.yaml deleted file mode 100644 index 08c525dee7c..00000000000 --- a/boards/arm/actinius_icarus/dts/bindings/actinius-charger-enable.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2022 Actinius B.V. -# SPDX-License-Identifier: Apache-2.0 - -description: | - The Icarus IoT Board v2 provides the user with an option to disable the - charger or to leave it on auto. The option can be changed by changing - the `charger` property in the associated dt node to `auto` - or `disabled`. - -compatible: "actinius-charger-enable" - -include: base.yaml - -properties: - gpios: - type: phandle-array - required: true - description: Pin used to enable/disable the charger - - charger: - type: string - required: true - enum: - - "auto" - - "disabled" - description: Charger enable choice (auto or disabled) diff --git a/boards/arm/actinius_icarus/dts/bindings/actinius-sim-select.yaml b/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml similarity index 87% rename from boards/arm/actinius_icarus/dts/bindings/actinius-sim-select.yaml rename to boards/arm/actinius_icarus/dts/bindings/sim-select.yaml index 3caf569f299..f750f57c736 100644 --- a/boards/arm/actinius_icarus/dts/bindings/actinius-sim-select.yaml +++ b/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml @@ -5,9 +5,9 @@ description: | The Icarus boards provide the user with 2 options regarding SIM usage for LTE-M/NB-IoT communication. Either using the on-board eSIM or using an external nano-SIM. The SIM can be selected by changing the `sim` property - of the associated dt node to `esim` or `external`. + of the `sim_select` dt node to `esim` or `external`. -compatible: "actinius-sim-select" +compatible: "sim-select" include: base.yaml diff --git a/boards/arm/actinius_icarus/revision.cmake b/boards/arm/actinius_icarus/revision.cmake deleted file mode 100644 index d63947b74bf..00000000000 --- a/boards/arm/actinius_icarus/revision.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2022 Actinius -# SPDX-License-Identifier: Apache-2.0 - -board_check_revision( - FORMAT MAJOR.MINOR.PATCH - DEFAULT_REVISION 2.0.0 - VALID_REVISIONS 1.4.0 2.0.0 -) diff --git a/dts/bindings/vendor-prefixes.txt b/dts/bindings/vendor-prefixes.txt index de3cc047f28..454c698b6fb 100644 --- a/dts/bindings/vendor-prefixes.txt +++ b/dts/bindings/vendor-prefixes.txt @@ -18,7 +18,6 @@ acer Acer Inc. acme Acme Systems srl actions Actions Semiconductor Co., Ltd. active-semi Active-Semi International Inc -actinius Actinius B.V. ad Avionic Design GmbH adafruit Adafruit Industries, LLC adapteva Adapteva, Inc. From e15e48d03d13089d2d42dee740ae8c10144ac2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 338/501] Revert "[nrf fromtree] boards: actinius_icarus_bee: change bootloader/mcuboot LED to blue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d36e7473a5f0198fcdbd70daba0503b080e2514d. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 20ea0c970d6..6778d2bae3b 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -73,9 +73,9 @@ green-pwm-led = &green_pwm_led; blue-pwm-led = &blue_pwm_led; sw0 = &button0; - bootloader-led0 = &blue_led; + bootloader-led0 = &green_pwm_led; mcuboot-button0 = &button0; - mcuboot-led0 = &blue_led; + mcuboot-led0 = &green_pwm_led; watchdog0 = &wdt0; spi-flash0 = &w25q64; accel0 = &lis2dh12_accel; From 4f91fa45052915e1671cc4f455129483ccab4678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 339/501] Revert "[nrf fromtree] boards: actinius_icarus: change bootloader/mcuboot LED to blue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0628350e6bb7d95375b8eadcd0a324cafbd1dff2. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus/actinius_icarus_common.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index 98170d80ac4..9cb859051d1 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -73,9 +73,9 @@ green-pwm-led = &green_pwm_led; blue-pwm-led = &blue_pwm_led; sw0 = &button0; - bootloader-led0 = &blue_led; + bootloader-led0 = &green_pwm_led; mcuboot-button0 = &button0; - mcuboot-led0 = &blue_led; + mcuboot-led0 = &green_pwm_led; watchdog0 = &wdt0; accel0 = &lis2dh12_accel; }; From a452f333abd355489ea2d29a31efdf883a2018c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:09 +0200 Subject: [PATCH 340/501] Revert "[nrf fromtree] boards: actinius_icarus_*: align def RAM plan with that of the nRF9160DK" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 13c5953037ef6486cc05109e54a6ad7fc5262336. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus/actinius_icarus.yaml | 2 +- boards/arm/actinius_icarus/actinius_icarus_common.dts | 4 ++-- .../actinius_icarus/actinius_icarus_partition_conf.dts | 10 +++++----- .../arm/actinius_icarus_bee/actinius_icarus_bee.yaml | 2 +- .../actinius_icarus_bee/actinius_icarus_bee_common.dts | 4 ++-- .../actinius_icarus_bee_partition_conf.dts | 10 +++++----- .../arm/actinius_icarus_som/actinius_icarus_som.yaml | 2 +- .../actinius_icarus_som/actinius_icarus_som_common.dts | 6 +++--- .../actinius_icarus_som_partition_conf.dts | 10 +++++----- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/boards/arm/actinius_icarus/actinius_icarus.yaml b/boards/arm/actinius_icarus/actinius_icarus.yaml index 960c1c9704e..7e910822371 100644 --- a/boards/arm/actinius_icarus/actinius_icarus.yaml +++ b/boards/arm/actinius_icarus/actinius_icarus.yaml @@ -6,7 +6,7 @@ toolchain: - gnuarmemb - xtools - zephyr -ram: 88 +ram: 64 flash: 256 supported: - gpio diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index 9cb859051d1..784c96cf262 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022 Actinius + * Copyright (c) 2019-2020 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -220,7 +220,7 @@ /* Secure image memory */ }; - sram0_modem: image_modem@20016000 { + sram0_modem: image_modem@20010000 { /* Modem (shared) memory */ }; diff --git a/boards/arm/actinius_icarus/actinius_icarus_partition_conf.dts b/boards/arm/actinius_icarus/actinius_icarus_partition_conf.dts index 10025e29d02..0dbe8fa7b2b 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_partition_conf.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_partition_conf.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022 Actinius + * Copyright (c) 2019 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -39,18 +39,18 @@ /* Default SRAM planning when building for nRF9160 with * ARM TrustZone-M support - * - Lowest 88 kB SRAM allocated to Secure image (sram0_s). - * - 40 kB SRAM reserved for and used by the modem library + * - Lowest 64 kB SRAM allocated to Secure image (sram0_s). + * - 64 kB SRAM reserved for and used by the modem library * (sram0_modem). This memory is Non-Secure. * - Upper 128 kB allocated to Non-Secure image (sram0_ns). */ &sram0_s { - reg = <0x20000000 DT_SIZE_K(88)>; + reg = <0x20000000 DT_SIZE_K(64)>; }; &sram0_modem { - reg = <0x20016000 DT_SIZE_K(40)>; + reg = <0x20010000 DT_SIZE_K(64)>; }; &sram0_ns { diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee.yaml b/boards/arm/actinius_icarus_bee/actinius_icarus_bee.yaml index be2865ea3ac..955c92c9790 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee.yaml +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee.yaml @@ -6,7 +6,7 @@ toolchain: - gnuarmemb - xtools - zephyr -ram: 88 +ram: 64 flash: 256 supported: - gpio diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 6778d2bae3b..a10eb420c47 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Actinius + * Copyright (c) 2021 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -211,7 +211,7 @@ /* Secure image memory */ }; - sram0_modem: image_modem@20016000 { + sram0_modem: image_modem@20010000 { /* Modem (shared) memory */ }; diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_partition_conf.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_partition_conf.dts index 7f0713fab2f..f26de60fe85 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_partition_conf.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_partition_conf.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Actinius + * Copyright (c) 2021 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -39,18 +39,18 @@ /* Default SRAM planning when building for nRF9160 with * ARM TrustZone-M support - * - Lowest 88 kB SRAM allocated to Secure image (sram0_s). - * - 40 kB SRAM reserved for and used by the modem library + * - Lowest 64 kB SRAM allocated to Secure image (sram0_s). + * - 64 kB SRAM reserved for and used by the modem library * (sram0_modem). This memory is Non-Secure. * - Upper 128 kB allocated to Non-Secure image (sram0_ns). */ &sram0_s { - reg = <0x20000000 DT_SIZE_K(88)>; + reg = <0x20000000 DT_SIZE_K(64)>; }; &sram0_modem { - reg = <0x20016000 DT_SIZE_K(40)>; + reg = <0x20010000 DT_SIZE_K(64)>; }; &sram0_ns { diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som.yaml b/boards/arm/actinius_icarus_som/actinius_icarus_som.yaml index e2d4a2b1903..39f839afb7d 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som.yaml +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som.yaml @@ -6,7 +6,7 @@ toolchain: - gnuarmemb - xtools - zephyr -ram: 88 +ram: 64 flash: 256 supported: - gpio diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index a581373e95c..02bad1a0838 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Actinius + * Copyright (c) 2021 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -121,8 +121,8 @@ /* Secure image memory */ }; - sram0_modem: image_modem@20016000 { - /* Modem (shared) memory */ + sram0_modem: image_modem@20010000 { + /* BSD (shared) memory */ }; sram0_ns: image_ns@20020000 { diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_partition_conf.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_partition_conf.dts index 69340365b03..213a9162e76 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_partition_conf.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_partition_conf.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Actinius + * Copyright (c) 2021 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -39,18 +39,18 @@ /* Default SRAM planning when building for nRF9160 with * ARM TrustZone-M support - * - Lowest 88 kB SRAM allocated to Secure image (sram0_s). - * - 40 kB SRAM reserved for and used by the modem library + * - Lowest 64 kB SRAM allocated to Secure image (sram0_s). + * - 64 kB SRAM reserved for and used by the modem library * (sram0_modem). This memory is Non-Secure. * - Upper 128 kB allocated to Non-Secure image (sram0_ns). */ &sram0_s { - reg = <0x20000000 DT_SIZE_K(88)>; + reg = <0x20000000 DT_SIZE_K(64)>; }; &sram0_modem { - reg = <0x20016000 DT_SIZE_K(40)>; + reg = <0x20010000 DT_SIZE_K(64)>; }; &sram0_ns { From 94ef84d30fbce96914c02126034015f2f01c5dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 341/501] Revert "[nrf fromtree] boards: actinius_icarus_bee: fix accelerometer INT pins" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 991cd231f5a1c0b7c414a4b7394e5bade92ef8a3. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index a10eb420c47..2af4a9242c0 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -121,8 +121,8 @@ lis2dh12_accel: lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; - irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>, - <&gpio0 28 GPIO_ACTIVE_HIGH>; + irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, + <&gpio0 29 GPIO_ACTIVE_HIGH>; }; }; From ed04554dfc295a8e5777af69943b3219a4d4b331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 342/501] Revert "[nrf fromtree] boards: actinius_icarus_som: fix accelerometer INT pins" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d683e1b17fcf46250a7db1d316735a62d1d40f96. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index 02bad1a0838..f62cde05f78 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -60,8 +60,8 @@ lis2dh12_accel: lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; - irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>, - <&gpio0 28 GPIO_ACTIVE_HIGH>; + irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, + <&gpio0 29 GPIO_ACTIVE_HIGH>; }; }; From 9362b8f66a77e39ed3b3de932d2515d0f598c27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 343/501] Revert "[nrf fromtree] boards: actinius_icarus_som: fix incorrect `sim-select` gpio" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cfa302df6cf516adf4dc6e7125b85c25e1ab419a. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index f62cde05f78..6c574899289 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -22,7 +22,7 @@ sim_select: sim-select { compatible = "sim-select"; - sim-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + sim-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; sim = "esim"; }; }; From 5d830320b83501bf11cf2494f2fd2dd9278029e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 344/501] Revert "[nrf fromtree] boards: actinius_icarus_bee: fix incorrect `sim-select` gpio" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 158aa37b1d21e3c19d54a9507b344fc924dc61dd. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 2af4a9242c0..53a4b4bac95 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -83,7 +83,7 @@ sim_select: sim-select { compatible = "sim-select"; - sim-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + sim-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; sim = "esim"; }; }; From 95334a7b4839f4f9d94f34217a83ecbde459e6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 345/501] Revert "[nrf fromtree] boards: actinius_icarus_*: fix `sim-select` binding docs about enum use" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 31ac219c742dcda41889a330e34d231a320d71f8. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus/dts/bindings/sim-select.yaml | 4 ++-- boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml | 4 ++-- boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml b/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml index f750f57c736..36687b8775d 100644 --- a/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml +++ b/boards/arm/actinius_icarus/dts/bindings/sim-select.yaml @@ -4,8 +4,8 @@ description: | The Icarus boards provide the user with 2 options regarding SIM usage for LTE-M/NB-IoT communication. Either using the on-board eSIM or using an - external nano-SIM. The SIM can be selected by changing the `sim` property - of the `sim_select` dt node to `esim` or `external`. + external nano-SIM. The SIM can be selected using the SIM select pin given by + the sim-gpios property by setting it to 0 (eSIM) or to 1 (external nano-SIM). compatible: "sim-select" diff --git a/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml b/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml index f750f57c736..36687b8775d 100644 --- a/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml +++ b/boards/arm/actinius_icarus_bee/dts/bindings/sim-select.yaml @@ -4,8 +4,8 @@ description: | The Icarus boards provide the user with 2 options regarding SIM usage for LTE-M/NB-IoT communication. Either using the on-board eSIM or using an - external nano-SIM. The SIM can be selected by changing the `sim` property - of the `sim_select` dt node to `esim` or `external`. + external nano-SIM. The SIM can be selected using the SIM select pin given by + the sim-gpios property by setting it to 0 (eSIM) or to 1 (external nano-SIM). compatible: "sim-select" diff --git a/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml b/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml index f750f57c736..36687b8775d 100644 --- a/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml +++ b/boards/arm/actinius_icarus_som/dts/bindings/sim-select.yaml @@ -4,8 +4,8 @@ description: | The Icarus boards provide the user with 2 options regarding SIM usage for LTE-M/NB-IoT communication. Either using the on-board eSIM or using an - external nano-SIM. The SIM can be selected by changing the `sim` property - of the `sim_select` dt node to `esim` or `external`. + external nano-SIM. The SIM can be selected using the SIM select pin given by + the sim-gpios property by setting it to 0 (eSIM) or to 1 (external nano-SIM). compatible: "sim-select" From 603f035bbe83a30268cdda46c92256ac2d8807f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 346/501] Revert "[nrf fromtree] boards: actinius_icarus_*: board.c: fix pin initialization" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4730d7ab976be6a232aa1116b2b82d5e6cc6d080. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus/board.c | 8 +++----- boards/arm/actinius_icarus_bee/board.c | 8 +++----- boards/arm/actinius_icarus_som/board.c | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/boards/arm/actinius_icarus/board.c b/boards/arm/actinius_icarus/board.c index 270dd550d50..7c9c17abbea 100644 --- a/boards/arm/actinius_icarus/board.c +++ b/boards/arm/actinius_icarus/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022 Actinius + * Copyright (c) 2019 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -19,16 +19,14 @@ static int board_actinius_icarus_init(const struct device *dev) ARG_UNUSED(dev); if (!device_is_ready(sim.port)) { - LOG_ERR("The SIM Select Pin port is not ready"); - return -ENODEV; } if (DT_ENUM_IDX(DT_NODELABEL(sim_select), sim) == 0) { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_HIGH); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_HIGH); LOG_INF("eSIM is selected"); } else { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_LOW); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_LOW); LOG_INF("External SIM is selected"); } diff --git a/boards/arm/actinius_icarus_bee/board.c b/boards/arm/actinius_icarus_bee/board.c index e127cf7866b..6245f3d30b9 100644 --- a/boards/arm/actinius_icarus_bee/board.c +++ b/boards/arm/actinius_icarus_bee/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Actinius + * Copyright (c) 2021 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -19,16 +19,14 @@ static int board_actinius_icarus_bee_init(const struct device *dev) ARG_UNUSED(dev); if (!device_is_ready(sim.port)) { - LOG_ERR("The SIM Select Pin port is not ready"); - return -ENODEV; } if (DT_ENUM_IDX(DT_NODELABEL(sim_select), sim) == 0) { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_HIGH); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_HIGH); LOG_INF("eSIM is selected"); } else { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_LOW); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_LOW); LOG_INF("External SIM is selected"); } diff --git a/boards/arm/actinius_icarus_som/board.c b/boards/arm/actinius_icarus_som/board.c index fe19ae60bf0..0246d51d13b 100644 --- a/boards/arm/actinius_icarus_som/board.c +++ b/boards/arm/actinius_icarus_som/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Actinius + * Copyright (c) 2021 Actinius * * SPDX-License-Identifier: Apache-2.0 */ @@ -19,16 +19,14 @@ static int board_actinius_icarus_som_init(const struct device *dev) ARG_UNUSED(dev); if (!device_is_ready(sim.port)) { - LOG_ERR("The SIM Select Pin port is not ready"); - return -ENODEV; } if (DT_ENUM_IDX(DT_NODELABEL(sim_select), sim) == 0) { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_HIGH); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_HIGH); LOG_INF("eSIM is selected"); } else { - (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_LOW); + (void)gpio_pin_configure_dt(&sim, GPIO_OUTPUT_INIT_LOW); LOG_INF("External SIM is selected"); } From 5f53e8965cbff1d8066d99b2963e362fe45cf6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 347/501] Revert "[nrf fromtree] boards: actinius_icarus_*: only include `board.c` in non-secure targets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9b7fe6e030df20069ac9f0248440e50a218e2799. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus/CMakeLists.txt | 7 ++----- boards/arm/actinius_icarus_bee/CMakeLists.txt | 7 ++----- boards/arm/actinius_icarus_som/CMakeLists.txt | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/boards/arm/actinius_icarus/CMakeLists.txt b/boards/arm/actinius_icarus/CMakeLists.txt index 5682578f59c..7c3d5dcfe15 100644 --- a/boards/arm/actinius_icarus/CMakeLists.txt +++ b/boards/arm/actinius_icarus/CMakeLists.txt @@ -1,10 +1,7 @@ # -# Copyright (c) 2019-2022 Actinius +# Copyright (c) 2019 Actinius # # SPDX-License-Identifier: Apache-2.0 zephyr_library() - -if (CONFIG_BOARD_ACTINIUS_ICARUS_NS) - zephyr_library_sources(board.c) -endif() +zephyr_library_sources(board.c) diff --git a/boards/arm/actinius_icarus_bee/CMakeLists.txt b/boards/arm/actinius_icarus_bee/CMakeLists.txt index c825edf00fd..eb960d65665 100644 --- a/boards/arm/actinius_icarus_bee/CMakeLists.txt +++ b/boards/arm/actinius_icarus_bee/CMakeLists.txt @@ -1,10 +1,7 @@ # -# Copyright (c) 2021-2022 Actinius +# Copyright (c) 2021 Actinius # # SPDX-License-Identifier: Apache-2.0 zephyr_library() - -if (CONFIG_BOARD_ACTINIUS_ICARUS_BEE_NS) - zephyr_library_sources(board.c) -endif() +zephyr_library_sources(board.c) diff --git a/boards/arm/actinius_icarus_som/CMakeLists.txt b/boards/arm/actinius_icarus_som/CMakeLists.txt index af50b08c869..eb960d65665 100644 --- a/boards/arm/actinius_icarus_som/CMakeLists.txt +++ b/boards/arm/actinius_icarus_som/CMakeLists.txt @@ -1,10 +1,7 @@ # -# Copyright (c) 2021-2022 Actinius +# Copyright (c) 2021 Actinius # # SPDX-License-Identifier: Apache-2.0 zephyr_library() - -if (CONFIG_BOARD_ACTINIUS_ICARUS_SOM_NS) - zephyr_library_sources(board.c) -endif() +zephyr_library_sources(board.c) From a77f85d156f66247ae842d6f527eef0465ccb69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 348/501] Revert "[nrf fromtree] doc: sysbuild documentation guide" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d9eb4294486f8945e000f23a718c1a343187aab6. Signed-off-by: Andrzej Głąbek --- doc/build/index.rst | 1 - doc/build/sysbuild/index.rst | 503 ------------------------- doc/build/sysbuild/sysbuild.svg | 4 - doc/develop/west/build-flash-debug.rst | 93 ----- scripts/ci/check_compliance.py | 1 - 5 files changed, 602 deletions(-) delete mode 100644 doc/build/sysbuild/index.rst delete mode 100644 doc/build/sysbuild/sysbuild.svg diff --git a/doc/build/index.rst b/doc/build/index.rst index dc0c6bceffd..05c0c2b630f 100644 --- a/doc/build/index.rst +++ b/doc/build/index.rst @@ -12,4 +12,3 @@ Build and Configuration Systems dts/index kconfig/index.rst zephyr_cmake_package.rst - sysbuild/index.rst diff --git a/doc/build/sysbuild/index.rst b/doc/build/sysbuild/index.rst deleted file mode 100644 index 2b76e398c39..00000000000 --- a/doc/build/sysbuild/index.rst +++ /dev/null @@ -1,503 +0,0 @@ -.. _sysbuild: - -Sysbuild (System build) -####################### - -Sysbuild is a higher-level build system that can be used to combine multiple -other build systems together. It is a higher-level layer that combines one -or more Zephyr build systems and optional additional build systems -into a hierarchical build system. - -For example, you can use sysbuild to build a Zephyr application together -with the MCUboot bootloader, flash them both onto your device, and -debug the results. - -Sysbuild works by configuring and building at least a Zephyr application and, optionally, as many -additional projects as you want. The additional projects can be either Zephyr applications -or other types of builds you want to run. - -Like Zephyr's :ref:`build system `, sysbuild is written in -CMake and uses :ref:`Kconfig `. - -Definitions -*********** - -The following are some key concepts used in this document: - -Single-image build - When sysbuild is used to create and manage just one Zephyr application's - build system. - -Multi-image build - When sysbuild is used to manage multiple build systems. - The word "image" is used because your main goal is usually to generate the binaries of the firmware - application images from each build system. - -Domain - Every Zephyr CMake build system managed by sysbuild. - -Multi-domain - When more than one Zephyr CMake build system (domain) is managed by sysbuild. - -Architectural Overview -********************** - -This figure is an overview of sysbuild's inputs, outputs, and user interfaces: - -.. figure:: sysbuild.svg - :align: center - :alt: Sysbuild architectural overview - :figclass: align-center - :width: 80% - -The following are some key sysbuild features indicated in this figure: - -- You can run sysbuild either with :ref:`west build - ` or directly via ``cmake``. - -- You can use sysbuild to generate application images from each build system, - shown above as ELF, BIN, and HEX files. - -- You can configure sysbuild or any of the build systems it manages using - various configuration variables. These variables are namespaced so that - sysbuild can direct them to the right build system. In some cases, such as - the ``BOARD`` variable, these are shared among multiple build systems. - -- Sysbuild itself is also configured using Kconfig. For example, you can - instruct sysbuild to build the MCUboot bootloader, as well as to build and - link your main Zephyr application as an MCUboot child image, using sysbuild's - Kconfig files. - -- Sysbuild integrates with west's :ref:`west-build-flash-debug` commands. It - does this by managing the :ref:`west-runner`, and specifically the - :file:`runners.yaml` files that each Zephyr build system will contain. These - are packaged into a global view of how to flash and debug each build system - in a :file:`domains.yaml` file generated and managed by sysbuild. - -Building with sysbuild -********************** - -As mentioned above, you can run sysbuild via ``west build`` or ``cmake``. - -.. tabs:: - - .. group-tab:: ``west build`` - - Here is an example. For details, see :ref:`west-multi-domain-builds` in - the ``west build documentation``. - - .. zephyr-app-commands:: - :tool: west - :app: samples/hello_world - :board: reel_board - :goals: build - :west-args: --sysbuild - :compact: - - .. tip:: - - To configure ``west build`` to use ``--sysbuild`` by default from now on, - run:: - - west config build.sysbuild True - - Since sysbuild supports both single- and multi-image builds, this lets you - use sysbuild all the time, without worrying about what type of build you are - running. - - To turn this off, run this before generating your build system:: - - west config build.sysbuild False - - To turn this off for just one ``west build`` command, run:: - - west build --no-sysbuild ... - - .. group-tab:: ``cmake`` - - Here is an example using CMake and Ninja. - - .. zephyr-app-commands:: - :tool: cmake - :app: share/sysbuild - :board: reel_board - :goals: build - :gen-args: -DAPP_DIR=samples/hello_world - :compact: - - To use sysbuild directly with CMake, you must specify the sysbuild - project as the source folder, and give ``-DAPP_DIR=`` as - an extra CMake argument. ``APP_DIR`` is the path to the main Zephyr - application managed by sysbuild. - -Configuration namespacing -************************* - -When building a single Zephyr application without sysbuild, all CMake cache -settings and Kconfig build options given on the command line as -``-D=`` or ``-DCONFIG_=`` are handled by the Zephyr -build system. - -However, when sysbuild combines multiple Zephyr build systems, there could be -Kconfig settings exclusive to sysbuild (and not used by any of the applications). -To handle this, sysbuild has namespaces for configuration variables. You can use these -namespaces to direct settings either to sysbuild itself or to a specific Zephyr -application managed by sysbuild using the information in these sections. - -The following example shows how to build :ref:`hello_world` with MCUboot enabled, -applying to both images debug optimizations: - -.. tabs:: - - .. group-tab:: ``west build`` - - .. zephyr-app-commands:: - :tool: west - :app: samples/hello_world - :board: reel_board - :goals: build - :west-args: --sysbuild - :gen-args: -DSB_CONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_DEBUG_OPTIMIZATIONS=y -Dmcuboot_DEBUG_OPTIMIZATIONS=y - :compact: - - .. group-tab:: ``cmake`` - - .. zephyr-app-commands:: - :tool: cmake - :app: share/sysbuild - :board: reel_board - :goals: build - :gen-args: -DAPP_DIR=samples/hello_world -DSB_CONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_DEBUG_OPTIMIZATIONS=y -Dmcuboot_DEBUG_OPTIMIZATIONS=y - :compact: - -See the following subsections for more information. - -.. _sysbuild_cmake_namespace: - -CMake variable namespacing -========================== - -CMake variable settings can be passed to CMake using ``-D=`` on the -command line. You can also set Kconfig options via CMake as -``-DCONFIG_=`` or ``-D_CONFIG_=``. - -Since sysbuild is the entry point for the build system, and sysbuild is written -in CMake, all CMake variables are first processed by sysbuild. - -Sysbuild creates a namespace for each domain. The namespace prefix is the -domain's application name. See :ref:`sysbuild_zephyr_application` for more -information. - -To set the variable ```` in the namespace ````, use this syntax:: - - -D_= - -For example, to set the CMake variable ``FOO`` in the ``my_sample`` application -build system to the value ``BAR``, run the following commands: - -.. tabs:: - - .. group-tab:: ``west build`` - - :: - - west build --sysbuild ... -- -Dmy_sample_FOO=BAR - - .. group-tab:: ``cmake`` - - :: - - cmake -Dmy_sample_FOO=BAR ... - -.. _sysbuild_kconfig_namespacing: - -Kconfig namespacing -=================== - -To set the sysbuild Kconfig option ```` to the value ````, use this syntax:: - - -DSB_CONFIG_= - -In the previous example, ``SB_CONFIG`` is the namespace prefix for sysbuild's Kconfig -options. - -To set a Zephyr application's Kconfig option instead, use this syntax:: - - -D_CONFIG_= - -In the previous example, ```` is the application name discussed above in -:ref:`sysbuild_cmake_namespace`. - -For example, to set the Kconfig option ``FOO`` in the ``my_sample`` application -build system to the value ``BAR``, run the following commands: - -.. tabs:: - - .. group-tab:: ``west build`` - - :: - - west build --sysbuild ... -- -Dmy_sample_CONFIG_FOO=BAR - - .. group-tab:: ``cmake`` - - :: - - cmake -Dmy_sample_CONFIG_FOO=BAR ... - -.. tip:: - When no ```` is used, the Kconfig setting is passed to the main - Zephyr application ``my_sample``. - - This means that passing ``-DCONFIG_=`` and - ``-Dmy_sample_CONFIG_=`` are equivalent. - - This allows you to build the same application with or without sysbuild using - the same syntax for setting Kconfig values at CMake time. - For example, the following commands will work in the same way: - - :: - - west build -b my_sample -- -DCONFIG_FOO=BAR - - :: - - west build -b --sysbuild my_sample -- -DCONFIG_FOO=BAR - -Sysbuild flashing using ``west flash`` -************************************** - -You can use :ref:`west flash ` to flash applications with -sysbuild. - -When invoking ``west flash`` on a build consisting of multiple images, each -image is flashed in sequence. Extra arguments such as ``--runner jlink`` are -passed to each invocation. - -For more details, see :ref:`west-multi-domain-flashing`. - -Sysbuild debugging using ``west debug`` -*************************************** - -You can use ``west debug`` to debug the main application, whether you are using sysbuild or not. -Just follow the existing :ref:`west debug ` guide to debug the main sample. - -To debug a different domain (Zephyr application), such as ``mcuboot``, use -the ``--domain`` argument, as follows:: - - west debug --domain mcuboot - -For more details, see :ref:`west-multi-domain-debugging`. - -Building a sample with MCUboot -****************************** - -Sysbuild supports MCUboot natively. - -To build a sample like ``hello_world`` with MCUboot, -enable MCUboot and build and flash the sample as follows: - -.. tabs:: - - .. group-tab:: ``west build`` - - .. zephyr-app-commands:: - :tool: west - :app: samples/hello_world - :board: reel_board - :goals: build - :west-args: --sysbuild - :gen-args: -DSB_CONFIG_BOOTLOADER_MCUBOOT=y - :compact: - - .. group-tab:: ``cmake`` - - .. zephyr-app-commands:: - :tool: cmake - :app: share/sysbuild - :board: reel_board - :goals: build - :gen-args: -DAPP_DIR=samples/hello_world -DSB_CONFIG_BOOTLOADER_MCUBOOT=y - :compact: - -This builds ``hello_world`` and ``mcuboot`` for the ``reel_board``, and then -flashes both the ``mcuboot`` and ``hello_world`` application images to the -board. - -More detailed information regarding the use of MCUboot with Zephyr can be found -in the `MCUboot with Zephyr`_ documentation page on the MCUboot website. - -.. note:: - - MCUBoot default configuration will perform a full chip erase when flashed. - This can be controlled through the MCUBoot Kconfig option - ``CONFIG_ZEPHYR_TRY_MASS_ERASE``. If this option is enabled, then flashing - only MCUBoot, for example using ``west flash --domain mcuboot``, may erase - the entire flash, including the main application image. - -Sysbuild Kconfig file -********************* - -You can set sysbuild's Kconfig options for a single application using -configuration files. By default, sysbuild looks for a configuration file named -``sysbuild.conf`` in the application top-level directory. - -In the following example, there is a :file:`sysbuild.conf` file that enables building and flashing with -MCUboot whenever sysbuild is used: - -.. code-block:: none - - /application - ├── CMakeLists.txt - ├── prj.conf - └── sysbuild.conf - - -.. code-block:: none - - SB_CONFIG_BOOTLOADER_MCUBOOT=y - -You can set a configuration file to use with the -``-DSB_CONF_FILE=`` CMake build setting. - -For example, you can create ``sysbuild-mcuboot.conf`` and then -specify this file when building with sysbuild, as follows: - -.. tabs:: - - .. group-tab:: ``west build`` - - .. zephyr-app-commands:: - :tool: west - :app: samples/hello_world - :board: reel_board - :goals: build - :west-args: --sysbuild - :gen-args: -DSB_CONF_FILE=sysbuild-mcuboot.conf - :compact: - - .. group-tab:: ``cmake`` - - .. zephyr-app-commands:: - :tool: cmake - :app: share/sysbuild - :board: reel_board - :goals: build - :gen-args: -DAPP_DIR=samples/hello_world -DSB_CONF_FILE=sysbuild-mcuboot.conf - :compact: - -.. _sysbuild_zephyr_application: - -Adding Zephyr applications to sysbuild -************************************** - -You can use the ``ExternalZephyrProject_Add()`` function to add Zephyr -applications as sysbuild domains. Call this CMake function from your main -:file:`CMakeLists.txt` file, or any other CMake file you know will run. - -Targeting the same board -======================== - -To include ``my_sample`` as another sysbuild domain, targeting the same board -as the main image, use this example: - -.. code-block:: cmake - - ExternalZephyrProject_Add( - APPLICATION my_sample - SOURCE_DIR /my_sample - BUILD_ALWAYS True - ) - -This could be useful, for example, if your board requires you to build and flash an -SoC-specific bootloader along with your main application. - -Targeting a different board -=========================== - -In sysbuild and Zephyr CMake build system a board may refer to: - -* A physical board with a single core SoC. -* A specific core on a physical board with a multi-core SoC, such as - :ref:`nrf5340dk_nrf5340`. -* A specific SoC on a physical board with multiple SoCs, such as - :ref:`nrf9160dk_nrf9160` and :ref:`nrf9160dk_nrf52840`. - -If your main application, for example, is built for ``mps2_an521``, and your -helper application must target the ``mps2_an521_remote`` board (cpu1), add -a CMake function call that is structured as follows: - -.. code-block:: cmake - - ExternalZephyrProject_Add( - APPLICATION my_sample - SOURCE_DIR /my_sample - BOARD mps2_an521_remote - BUILD_ALWAYS True - ) - -This could be useful, for example, if your main application requires another -helper Zephyr application to be built and flashed alongside it, but the helper -runs on another core in your SoC. - -Targeting conditionally using Kconfig -===================================== - -You can control whether extra applications are included as sysbuild domains -using Kconfig. - -If the extra application image is specific to the board or an application, -you can create two additional files: :file:`sysbuild.cmake` and :file:`Kconfig.sysbuild`. - -For an application, this would look like this: - -.. code-block:: none - - /application - ├── CMakeLists.txt - ├── prj.conf - ├── Kconfig.sysbuild - └── sysbuild.cmake - -In the previous example, :file:`sysbuild.cmake` would be structured as follows: - -.. code-block:: cmake - - if(SB_CONFIG_SECOND_SAMPLE) - ExternalZephyrProject_Add( - APPLICATION second_sample - SOURCE_DIR /second_sample - BUILD_ALWAYS True - ) - endif() - -:file:`Kconfig.sysbuild` would be structured as follows: - -.. code-block:: kconfig - - source "sysbuild/Kconfig" - - config SECOND_SAMPLE - bool "Second sample" - default y - -This will include ``second_sample`` by default, while still allowing you to -disable it using the Kconfig option ``SECOND_SAMPLE``. - -For more information on setting sysbuild Kconfig options, -see :ref:`sysbuild_kconfig_namespacing`. - -Adding non-Zephyr applications to sysbuild -****************************************** - -You can include non-Zephyr applications in a multi-image build using the -standard CMake module `ExternalProject`_. Please refer to the CMake -documentation for usage details. - -When using ``ExternalProject``, the non-Zephyr application will be built as -part of the sysbuild build invocation, but ``west flash`` or ``west debug`` -will not be aware of the application. Instead, you must manually flash and -debug the application. - -.. _MCUboot with Zephyr: https://mcuboot.com/documentation/readme-zephyr/ -.. _ExternalProject: https://cmake.org/cmake/help/latest/module/ExternalProject.html diff --git a/doc/build/sysbuild/sysbuild.svg b/doc/build/sysbuild/sysbuild.svg deleted file mode 100644 index 6c2292e0b84..00000000000 --- a/doc/build/sysbuild/sysbuild.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
west build
 / cmake
west build...
Sysbuild CMake (share/sysbuild/CMakeLists.txt)
Sysbuild CMake (share/sysbuild/CMakeLists.txt)
<app> CMake build
<app> CMake build
MCUboot build
MCUboot build
BOARD
CONF_FILE
<app> settings
Bootloader settings
Other settings
BOARD...
BOARD
mcuboot settings
Bootloader settings
Other settings
BOARD...
MCUboot
MCUboot
enabled
enabled
runners.yaml
runners.yaml
elf, bin, hex,
....
elf, bin, hex,...
runners.yaml
runners.yaml
elf, bin, hex,
....
elf, bin, hex,...
Actor
Actor
BOARD
CONF_FILE
CONFIG_<SETTING>
<app>_CONFIG_SETTING
mcuboot_CONFIG_SETTING
BOARD...
Kconfig
Kconfig
SB_CONF_FILE
SB_CONF_FILE
domains.yaml
domains.yaml
Board specific build
Sample specific build
Board specific build...
BOARD
mcuboot settings
Bootloader settings
Other settings
BOARD...
enabled
enabled
elf, bin, hex,
....
elf, bin, hex,...
runners.yaml
runners.yaml
Board / sample Kconfig
Board / sample Kconfig
Extra image
Extra image
Board / sample CMake
Board / sample CMake
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/develop/west/build-flash-debug.rst b/doc/develop/west/build-flash-debug.rst index 289817706b0..f741b847d73 100644 --- a/doc/develop/west/build-flash-debug.rst +++ b/doc/develop/west/build-flash-debug.rst @@ -67,32 +67,6 @@ build directory; ``west build`` can figure out the board from the CMake cache. For new builds, the ``--board`` option, :envvar:`BOARD` environment variable, or ``build.board`` configuration option are checked (in that order). -.. _west-multi-domain-builds: - -Sysbuild (multi-domain builds) -============================== - -:ref:`sysbuild` can be used to create a multi-domain build system combining -multiple images for a single or multiple boards. - -Use ``--sysbuild`` to select the :ref:`sysbuild` build infrastructure with -``west build`` to build multiple domains. - -More detailed information regarding the use of sysbuild can be found in the -:ref:`sysbuild` guide. - -.. tip:: - - The ``build.sysbuild`` configuration option can be enabled to tell - ``west build`` to default build using sysbuild. - ``--no-sysbuild`` can be used to disable sysbuild for a specific build. - -``west build`` will build all domains through the top-level build folder of the -domains specified by sysbuild. - -A single domain from a multi-domain project can be built by using ``--domain`` -argument. - Examples ======== @@ -337,19 +311,6 @@ For example, to build with 4 cores:: The ``-o`` option is described further in the previous section. -Build a single domain ---------------------- - -In a multi-domain build with :ref:`hello_world` and `MCUboot`_, you can use -``--domain hello_world`` to only build this domain:: - - west build --sysbuild --domain hello_world - -The ``--domain`` argument can be combined with the ``--target`` argument to -build the specific target for the target, for example:: - - west build --sysbuild --domain hello_world --target help - .. _west-building-config: Configuration Options @@ -413,9 +374,6 @@ You can :ref:`configure ` ``west build`` using these options. directory). - ``always``: Always make the build folder pristine before building, if a build system is present. - * - ``build.sysbuild`` - - Boolean, default ``false``. If ``true``, build application using the - sysbuild infrastructure. .. _west-flashing: @@ -518,23 +476,6 @@ For example, to print usage information about the ``jlink`` runner:: west flash -H -r jlink -.. _west-multi-domain-flashing: - -Multi-domain flashing -===================== - -When a :ref:`west-multi-domain-builds` folder is detected, then ``west flash`` -will flash all domains in the order defined by sysbuild. - -It is possible to flash the image from a single domain in a multi-domain project -by using ``--domain``. - -For example, in a multi-domain build with :ref:`hello_world` and -`MCUboot`_, you can use the ``--domain hello_world`` domain to only flash -only the image from this domain:: - - west flash --domain hello_world - .. _west-debugging: Debugging: ``west debug``, ``west debugserver`` @@ -635,38 +576,6 @@ For example, to print usage information about the ``jlink`` runner:: west debug -H -r jlink -.. _west-multi-domain-debugging: - -Multi-domain debugging -====================== - -``west debug`` can only debug a single domain at a time. When a -:ref:`west-multi-domain-builds` folder is detected, ``west debug`` -will debug the ``default`` domain specified by sysbuild. - -The default domain will be the application given as the source directory. -See the following example:: - - west build --sysbuild path/to/source/directory - -For example, when building ``hello_world`` with `MCUboot`_ using sysbuild, -``hello_world`` becomes the default domain:: - - west build --sysbuild samples/hello_world - -So to debug ``hello_world`` you can do:: - - west debug - -or:: - - west debug --domain hello_world - -If you wish to debug MCUboot, you must explicitly specify MCUboot as the domain -to debug:: - - west debug --domain mcuboot - .. _west-runner: Flash and debug runners @@ -739,5 +648,3 @@ commands do it). .. _CMake Generator: https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html - -.. _MCUboot: https://mcuboot.com/ diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 168fb193ab1..0201312117e 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -622,7 +622,6 @@ def get_defined_syms(kconf): "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "MODVERSIONS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "SECURITY_LOADPIN", # Linux, in boards/xtensa/intel_adsp_cavs25/doc - "ZEPHYR_TRY_MASS_ERASE", # MCUBoot setting described in sysbuild documentation } class KconfigBasicCheck(KconfigCheck, ComplianceTest): From c5009ccfaffa950792b105cab34944a87e5b977c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 349/501] Revert "[nrf fromtree] doc: extend application sphinx extension to support west arguments" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dcca10b33968fb4638860d63b41ba2fd75e1195e. Signed-off-by: Andrzej Głąbek --- doc/_extensions/zephyr/application.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/doc/_extensions/zephyr/application.py b/doc/_extensions/zephyr/application.py index 9369fb7becf..f68238dc31f 100644 --- a/doc/_extensions/zephyr/application.py +++ b/doc/_extensions/zephyr/application.py @@ -89,9 +89,6 @@ class ZephyrAppCommandsDirective(Directive): if set, the generated output is a single code block with no additional comment lines - \:west-args: - if set, additional arguments to the west invocation (ignored for CMake) - ''' has_content = False required_arguments = 0 @@ -112,8 +109,7 @@ class ZephyrAppCommandsDirective(Directive): 'build-dir': directives.unchanged, 'goals': directives.unchanged_required, 'maybe-skip-config': directives.flag, - 'compact': directives.flag, - 'west-args': directives.unchanged, + 'compact': directives.flag } TOOLS = ['cmake', 'west', 'all'] @@ -142,7 +138,6 @@ def run(self): goals = self.options.get('goals').split() skip_config = 'maybe-skip-config' in self.options compact = 'compact' in self.options - west_args = self.options.get('west-args', None) if tool not in self.TOOLS: raise self.error('Unknown tool {}; choose from: {}'.format( @@ -193,8 +188,7 @@ def run(self): 'goals': goals, 'compact': compact, 'skip_config': skip_config, - 'generator': generator, - 'west_args': west_args + 'generator': generator } if 'west' in tools: @@ -243,13 +237,11 @@ def _generate_west(self, **kwargs): cd_into = kwargs['cd_into'] build_dir = kwargs['build_dir'] compact = kwargs['compact'] - west_args = kwargs['west_args'] kwargs['board'] = None # west always defaults to ninja gen_arg = ' -G\'Unix Makefiles\'' if generator == 'make' else '' cmake_args = gen_arg + self._cmake_args(**kwargs) cmake_args = ' --{}'.format(cmake_args) if cmake_args != '' else '' - west_args = ' {}'.format(west_args) if west_args else '' # ignore zephyr_app since west needs to run within # the installation. Instead rely on relative path. src = ' {}'.format(app) if app and not cd_into else '' @@ -271,8 +263,8 @@ def _generate_west(self, **kwargs): # defaulting to west. # # For now, this keeps the resulting commands working. - content.append('west build -b {}{}{}{}{}'. - format(board, west_args, dst, src, cmake_args)) + content.append('west build -b {}{}{}{}'. + format(board, dst, src, cmake_args)) # If we're signing, we want to do that next, so that flashing # etc. commands can use the signed file which must be created From c0ace2b7a5a5ee409f2bc9be9ffc6b50d9978ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 350/501] Revert "[nrf fromtree] bluetooth: host: Increase long workqueue stack size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d3631f504dd968d7e6442b8cb33ba084096c5d90. Signed-off-by: Andrzej Głąbek --- doc/releases/release-notes-3.2.rst | 2 -- subsys/bluetooth/host/Kconfig | 13 +++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/releases/release-notes-3.2.rst b/doc/releases/release-notes-3.2.rst index 0adebbe54d3..ee23cd43fdc 100644 --- a/doc/releases/release-notes-3.2.rst +++ b/doc/releases/release-notes-3.2.rst @@ -97,8 +97,6 @@ Bluetooth * Host * Added :c:func:`bt_conn_auth_cb_overlay` to overlay authentication callbacks for a Bluetooth LE connection. - * Removed ``CONFIG_BT_HCI_ECC_STACK_SIZE``. - The Bluetooth long workqueue (:kconfig:option:`CONFIG_BT_LONG_WQ`) is used for processing ECC commands instead of the dedicated thread. * Mesh diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 3fb0c552a8f..54461917fa3 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -15,8 +15,7 @@ config BT_LONG_WQ_STACK_SIZE # Hidden: Long workqueue stack size. Should be derived from system # requirements. int - default 1300 if BT_GATT_CACHING - default 1140 if BT_TINYCRYPT_ECC + default BT_HCI_ECC_STACK_SIZE if BT_TINYCRYPT_ECC default 1024 config BT_LONG_WQ_PRIO @@ -60,6 +59,16 @@ config BT_HCI_TX_STACK_SIZE config BT_HCI_TX_STACK_SIZE_WITH_PROMPT bool "Override HCI Tx thread stack size" +config BT_HCI_ECC_STACK_SIZE + # NOTE: This value is derived from other symbols and should only be + # changed if required by architecture + int "HCI ECC thread stack size" + depends on BT_TINYCRYPT_ECC + default 1140 + help + NOTE: This is an advanced setting and should not be changed unless + absolutely necessary + config BT_HCI_TX_PRIO # Hidden option for Co-Operative Tx thread priority int From 31cbc84194da65993efef157351cc5d6053cb967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 351/501] Revert "[nrf fromtree] bluetooth: smp: Add authentication callbacks per connection" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d6c5799f82d2730446174277b45b06fcbba7f159. Signed-off-by: Andrzej Głąbek --- doc/releases/release-notes-3.2.rst | 2 - include/zephyr/bluetooth/conn.h | 16 --- subsys/bluetooth/host/conn.c | 78 ++++++------- subsys/bluetooth/host/smp.c | 173 ++++++++++------------------- subsys/bluetooth/host/smp.h | 1 - 5 files changed, 93 insertions(+), 177 deletions(-) diff --git a/doc/releases/release-notes-3.2.rst b/doc/releases/release-notes-3.2.rst index ee23cd43fdc..2c61b12f5ff 100644 --- a/doc/releases/release-notes-3.2.rst +++ b/doc/releases/release-notes-3.2.rst @@ -96,8 +96,6 @@ Bluetooth * Host - * Added :c:func:`bt_conn_auth_cb_overlay` to overlay authentication callbacks for a Bluetooth LE connection. - * Mesh * Controller diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 379fba2e7e6..abe1afacc4c 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1363,22 +1363,6 @@ struct bt_conn_auth_info_cb { */ int bt_conn_auth_cb_register(const struct bt_conn_auth_cb *cb); -/** @brief Overlay authentication callbacks used for a given connection. - * - * This function can be used only for Bluetooth LE connections. - * The @kconfig{CONFIG_BT_SMP} must be enabled for this function. - * - * The authentication callbacks for a given connection cannot be overlaid if - * security procedures in the SMP module have already started. This function - * can be called only once per connection. - * - * @param conn Connection object. - * @param cb Callback struct. - * - * @return Zero on success or negative error code otherwise - */ -int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb); - /** @brief Register authentication information callbacks. * * Register callbacks to get authenticated pairing information. Multiple diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 95a0ae56153..1077a02088d 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2860,26 +2860,6 @@ int bt_conn_auth_cb_register(const struct bt_conn_auth_cb *cb) return 0; } -#if defined(CONFIG_BT_SMP) -int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb) -{ - /* The cancel callback must always be provided if the app provides - * interactive callbacks. - */ - if (!cb->cancel && - (cb->passkey_display || cb->passkey_entry || cb->passkey_confirm || - cb->pairing_confirm)) { - return -EINVAL; - } - - if (conn->type == BT_CONN_TYPE_LE) { - return bt_smp_auth_cb_overlay(conn, cb); - } - - return -ENOTSUP; -} -#endif - int bt_conn_auth_info_cb_register(struct bt_conn_auth_info_cb *cb) { CHECKIF(cb == NULL) { @@ -2906,15 +2886,16 @@ int bt_conn_auth_info_cb_unregister(struct bt_conn_auth_info_cb *cb) int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) { + if (!bt_auth) { + return -EINVAL; + } + if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { - return bt_smp_auth_passkey_entry(conn, passkey); + bt_smp_auth_passkey_entry(conn, passkey); + return 0; } if (IS_ENABLED(CONFIG_BT_BREDR) && conn->type == BT_CONN_TYPE_BR) { - if (!bt_auth) { - return -EINVAL; - } - return bt_ssp_auth_passkey_entry(conn, passkey); } @@ -2923,15 +2904,17 @@ int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) int bt_conn_auth_passkey_confirm(struct bt_conn *conn) { - if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { - return bt_smp_auth_passkey_confirm(conn); + if (!bt_auth) { + return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_BREDR) && conn->type == BT_CONN_TYPE_BR) { - if (!bt_auth) { - return -EINVAL; - } + if (IS_ENABLED(CONFIG_BT_SMP) && + conn->type == BT_CONN_TYPE_LE) { + return bt_smp_auth_passkey_confirm(conn); + } + if (IS_ENABLED(CONFIG_BT_BREDR) && + conn->type == BT_CONN_TYPE_BR) { return bt_ssp_auth_passkey_confirm(conn); } @@ -2940,36 +2923,41 @@ int bt_conn_auth_passkey_confirm(struct bt_conn *conn) int bt_conn_auth_cancel(struct bt_conn *conn) { + if (!bt_auth) { + return -EINVAL; + } + if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { return bt_smp_auth_cancel(conn); } - if (IS_ENABLED(CONFIG_BT_BREDR) && conn->type == BT_CONN_TYPE_BR) { - if (!bt_auth) { - return -EINVAL; - } - +#if defined(CONFIG_BT_BREDR) + if (conn->type == BT_CONN_TYPE_BR) { return bt_ssp_auth_cancel(conn); } +#endif /* CONFIG_BT_BREDR */ return -EINVAL; } int bt_conn_auth_pairing_confirm(struct bt_conn *conn) { - if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { - return bt_smp_auth_pairing_confirm(conn); + if (!bt_auth) { + return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_BREDR) && conn->type == BT_CONN_TYPE_BR) { - if (!bt_auth) { - return -EINVAL; - } - + switch (conn->type) { +#if defined(CONFIG_BT_SMP) + case BT_CONN_TYPE_LE: + return bt_smp_auth_pairing_confirm(conn); +#endif /* CONFIG_BT_SMP */ +#if defined(CONFIG_BT_BREDR) + case BT_CONN_TYPE_BR: return bt_ssp_auth_pairing_confirm(conn); +#endif /* CONFIG_BT_BREDR */ + default: + return -EINVAL; } - - return -EINVAL; } #endif /* CONFIG_BT_SMP || CONFIG_BT_BREDR */ diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 9e6298f1260..5132ad74950 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -204,9 +204,6 @@ struct bt_smp { /* Delayed work for timeout handling */ struct k_work_delayable work; - - /* Used Bluetooth authentication callbacks. */ - atomic_ptr_t auth_cb; }; static unsigned int fixed_passkey = BT_PASSKEY_INVALID; @@ -280,11 +277,6 @@ static bool sc_supported; static const uint8_t *sc_public_key; static K_SEM_DEFINE(sc_local_pkey_ready, 0, 1); -/* Pointer to internal data is used to mark that callbacks of given SMP channel are not initialized. - * Value of NULL represents no authenticaiton capabilities and cannot be used for that purpose. - */ -#define BT_SMP_AUTH_CB_UNINITIALIZED ((atomic_ptr_val_t)bt_smp_pool) - static bool le_sc_supported(void) { /* @@ -300,34 +292,25 @@ static bool le_sc_supported(void) BT_CMD_TEST(bt_dev.supported_commands, 34, 2); } -static const struct bt_conn_auth_cb *latch_auth_cb(struct bt_smp *smp) -{ - atomic_ptr_cas(&smp->auth_cb, BT_SMP_AUTH_CB_UNINITIALIZED, (atomic_ptr_val_t)bt_auth); - - return atomic_ptr_get(&smp->auth_cb); -} - -static uint8_t get_io_capa(struct bt_smp *smp) +static uint8_t get_io_capa(void) { - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); - - if (!smp_auth_cb) { + if (!bt_auth) { goto no_callbacks; } /* Passkey Confirmation is valid only for LE SC */ - if (smp_auth_cb->passkey_display && smp_auth_cb->passkey_entry && - (smp_auth_cb->passkey_confirm || !sc_supported)) { + if (bt_auth->passkey_display && bt_auth->passkey_entry && + (bt_auth->passkey_confirm || !sc_supported)) { return BT_SMP_IO_KEYBOARD_DISPLAY; } /* DisplayYesNo is useful only for LE SC */ - if (sc_supported && smp_auth_cb->passkey_display && - smp_auth_cb->passkey_confirm) { + if (sc_supported && bt_auth->passkey_display && + bt_auth->passkey_confirm) { return BT_SMP_IO_DISPLAY_YESNO; } - if (smp_auth_cb->passkey_entry) { + if (bt_auth->passkey_entry) { if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_INVALID) { return BT_SMP_IO_KEYBOARD_DISPLAY; @@ -336,7 +319,7 @@ static uint8_t get_io_capa(struct bt_smp *smp) } } - if (smp_auth_cb->passkey_display) { + if (bt_auth->passkey_display) { return BT_SMP_IO_DISPLAY_ONLY; } @@ -419,7 +402,7 @@ static uint8_t get_pair_method(struct bt_smp *smp, uint8_t remote_io) return JUST_WORKS; } - return gen_method_sc[remote_io][get_io_capa(smp)]; + return gen_method_sc[remote_io][get_io_capa()]; #else return JUST_WORKS; #endif @@ -2303,13 +2286,11 @@ static uint8_t send_pairing_rsp(struct bt_smp *smp) } #endif /* CONFIG_BT_PERIPHERAL */ -static uint8_t smp_pairing_accept_query(struct bt_smp *smp, struct bt_smp_pairing *pairing) +static uint8_t smp_pairing_accept_query(struct bt_conn *conn, + struct bt_smp_pairing *pairing) { #if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT) - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); - struct bt_conn *conn = smp->chan.chan.conn; - - if (smp_auth_cb && smp_auth_cb->pairing_accept) { + if (bt_auth && bt_auth->pairing_accept) { const struct bt_conn_pairing_feat feat = { .io_capability = pairing->io_capability, .oob_data_flag = pairing->oob_flag, @@ -2319,7 +2300,7 @@ static uint8_t smp_pairing_accept_query(struct bt_smp *smp, struct bt_smp_pairin .resp_key_dist = pairing->resp_key_dist }; - return smp_err_get(smp_auth_cb->pairing_accept(conn, &feat)); + return smp_err_get(bt_auth->pairing_accept(conn, &feat)); } #endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */ return 0; @@ -2366,7 +2347,7 @@ static uint8_t legacy_get_pair_method(struct bt_smp *smp, uint8_t remote_io) return JUST_WORKS; } - method = gen_method_legacy[remote_io][get_io_capa(smp)]; + method = gen_method_legacy[remote_io][get_io_capa()]; /* if both sides have KeyboardDisplay capabilities, initiator displays * and responder inputs @@ -2385,7 +2366,6 @@ static uint8_t legacy_get_pair_method(struct bt_smp *smp, uint8_t remote_io) static uint8_t legacy_request_tk(struct bt_smp *smp) { struct bt_conn *conn = smp->chan.chan.conn; - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_keys *keys; uint32_t passkey; @@ -2403,13 +2383,13 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) switch (smp->method) { case LEGACY_OOB: - if (smp_auth_cb && smp_auth_cb->oob_data_request) { + if (bt_auth && bt_auth->oob_data_request) { struct bt_conn_oob_info info = { .type = BT_CONN_OOB_LE_LEGACY, }; atomic_set_bit(smp->flags, SMP_FLAG_USER); - smp_auth_cb->oob_data_request(smp->chan.chan.conn, &info); + bt_auth->oob_data_request(smp->chan.chan.conn, &info); } else { return BT_SMP_ERR_OOB_NOT_AVAIL; } @@ -2431,9 +2411,9 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) BT_INFO("Legacy passkey %u", passkey); } - if (smp_auth_cb && smp_auth_cb->passkey_display) { + if (bt_auth && bt_auth->passkey_display) { atomic_set_bit(smp->flags, SMP_FLAG_DISPLAY); - smp_auth_cb->passkey_display(conn, passkey); + bt_auth->passkey_display(conn, passkey); } sys_put_le32(passkey, smp->tk); @@ -2441,7 +2421,7 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) break; case PASSKEY_INPUT: atomic_set_bit(smp->flags, SMP_FLAG_USER); - smp_auth_cb->passkey_entry(conn); + bt_auth->passkey_entry(conn); break; case JUST_WORKS: break; @@ -2482,7 +2462,6 @@ static uint8_t legacy_send_pairing_confirm(struct bt_smp *smp) #if defined(CONFIG_BT_PERIPHERAL) static uint8_t legacy_pairing_req(struct bt_smp *smp) { - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); uint8_t ret; BT_DBG(""); @@ -2495,9 +2474,9 @@ static uint8_t legacy_pairing_req(struct bt_smp *smp) /* ask for consent if pairing is not due to sending SecReq*/ if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && !atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && - smp_auth_cb && smp_auth_cb->pairing_confirm) { + bt_auth && bt_auth->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); - smp_auth_cb->pairing_confirm(smp->chan.chan.conn); + bt_auth->pairing_confirm(smp->chan.chan.conn); return 0; } @@ -2711,7 +2690,6 @@ static uint8_t smp_central_ident(struct bt_smp *smp, struct net_buf *buf) #if defined(CONFIG_BT_CENTRAL) static uint8_t legacy_pairing_rsp(struct bt_smp *smp) { - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); uint8_t ret; BT_DBG(""); @@ -2724,9 +2702,9 @@ static uint8_t legacy_pairing_rsp(struct bt_smp *smp) /* ask for consent if this is due to received SecReq */ if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && - smp_auth_cb && smp_auth_cb->pairing_confirm) { + bt_auth && bt_auth->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); - smp_auth_cb->pairing_confirm(smp->chan.chan.conn); + bt_auth->pairing_confirm(smp->chan.chan.conn); return 0; } @@ -2786,17 +2764,15 @@ void bt_set_oob_data_flag(bool enable) oobd_present = enable; } -static uint8_t get_auth(struct bt_smp *smp, uint8_t auth) +static uint8_t get_auth(struct bt_conn *conn, uint8_t auth) { - struct bt_conn *conn = smp->chan.chan.conn; - if (sc_supported) { auth &= BT_SMP_AUTH_MASK_SC; } else { auth &= BT_SMP_AUTH_MASK; } - if ((get_io_capa(smp) == BT_SMP_IO_NO_INPUT_OUTPUT) || + if ((get_io_capa() == BT_SMP_IO_NO_INPUT_OUTPUT) || (!IS_ENABLED(CONFIG_BT_SMP_ENFORCE_MITM) && (conn->required_sec_level < BT_SECURITY_L3))) { auth &= ~(BT_SMP_AUTH_MITM); @@ -2849,20 +2825,18 @@ static uint8_t remote_sec_level_reachable(struct bt_smp *smp) } } -static bool sec_level_reachable(struct bt_smp *smp) +static bool sec_level_reachable(struct bt_conn *conn) { - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); - - switch (smp->chan.chan.conn->required_sec_level) { + switch (conn->required_sec_level) { case BT_SECURITY_L1: case BT_SECURITY_L2: return true; case BT_SECURITY_L3: - return get_io_capa(smp) != BT_SMP_IO_NO_INPUT_OUTPUT || - (smp_auth_cb && smp_auth_cb->oob_data_request); + return get_io_capa() != BT_SMP_IO_NO_INPUT_OUTPUT || + (bt_auth && bt_auth->oob_data_request); case BT_SECURITY_L4: - return (get_io_capa(smp) != BT_SMP_IO_NO_INPUT_OUTPUT || - (smp_auth_cb && smp_auth_cb->oob_data_request)) && sc_supported; + return (get_io_capa() != BT_SMP_IO_NO_INPUT_OUTPUT || + (bt_auth && bt_auth->oob_data_request)) && sc_supported; default: return false; } @@ -2995,7 +2969,7 @@ static int smp_send_security_req(struct bt_conn *conn) } /* early verify if required sec level if reachable */ - if (!(sec_level_reachable(smp) || smp_keys_check(conn))) { + if (!(sec_level_reachable(conn) || smp_keys_check(conn))) { return -EINVAL; } @@ -3017,7 +2991,7 @@ static int smp_send_security_req(struct bt_conn *conn) } req = net_buf_add(req_buf, sizeof(*req)); - req->auth_req = get_auth(smp, BT_SMP_AUTH_DEFAULT); + req->auth_req = get_auth(conn, BT_SMP_AUTH_DEFAULT); /* SMP timer is not restarted for SecRequest so don't use smp_send */ err = bt_l2cap_send(conn, BT_L2CAP_CID_SMP, req_buf); @@ -3035,8 +3009,6 @@ static int smp_send_security_req(struct bt_conn *conn) static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) { struct bt_conn *conn = smp->chan.chan.conn; - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); - struct bt_smp_pairing *req = (void *)buf->data; struct bt_smp_pairing *rsp; uint8_t err; @@ -3076,8 +3048,8 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) smp->prsp[0] = BT_SMP_CMD_PAIRING_RSP; rsp = (struct bt_smp_pairing *)&smp->prsp[1]; - rsp->auth_req = get_auth(smp, req->auth_req); - rsp->io_capability = get_io_capa(smp); + rsp->auth_req = get_auth(conn, req->auth_req); + rsp->io_capability = get_io_capa(); rsp->oob_flag = oobd_present ? BT_SMP_OOB_PRESENT : BT_SMP_OOB_NOT_PRESENT; rsp->max_key_size = BT_SMP_MAX_ENC_KEY_SIZE; @@ -3127,7 +3099,7 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) return BT_SMP_ERR_AUTH_REQUIREMENTS; #else if (IS_ENABLED(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)) { - err = smp_pairing_accept_query(smp, req); + err = smp_pairing_accept_query(conn, req); if (err) { return err; } @@ -3138,7 +3110,7 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) } if (IS_ENABLED(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)) { - err = smp_pairing_accept_query(smp, req); + err = smp_pairing_accept_query(conn, req); if (err) { return err; } @@ -3146,9 +3118,9 @@ static uint8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf) if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && !atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && - smp_auth_cb && smp_auth_cb->pairing_confirm) { + bt_auth && bt_auth->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); - smp_auth_cb->pairing_confirm(conn); + bt_auth->pairing_confirm(conn); return 0; } @@ -3223,7 +3195,7 @@ static int smp_send_pairing_req(struct bt_conn *conn) } /* early verify if required sec level if reachable */ - if (!sec_level_reachable(smp)) { + if (!sec_level_reachable(conn)) { return -EINVAL; } @@ -3245,8 +3217,8 @@ static int smp_send_pairing_req(struct bt_conn *conn) req = net_buf_add(req_buf, sizeof(*req)); - req->auth_req = get_auth(smp, BT_SMP_AUTH_DEFAULT); - req->io_capability = get_io_capa(smp); + req->auth_req = get_auth(conn, BT_SMP_AUTH_DEFAULT); + req->io_capability = get_io_capa(); req->oob_flag = oobd_present ? BT_SMP_OOB_PRESENT : BT_SMP_OOB_NOT_PRESENT; req->max_key_size = BT_SMP_MAX_ENC_KEY_SIZE; @@ -3272,7 +3244,6 @@ static int smp_send_pairing_req(struct bt_conn *conn) static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) { struct bt_conn *conn = smp->chan.chan.conn; - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_smp_pairing *rsp = (void *)buf->data; struct bt_smp_pairing *req = (struct bt_smp_pairing *)&smp->preq[1]; uint8_t err; @@ -3326,7 +3297,7 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) return BT_SMP_ERR_AUTH_REQUIREMENTS; #else if (IS_ENABLED(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)) { - err = smp_pairing_accept_query(smp, rsp); + err = smp_pairing_accept_query(conn, rsp); if (err) { return err; } @@ -3340,7 +3311,7 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) smp->remote_dist &= RECV_KEYS_SC; if (IS_ENABLED(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)) { - err = smp_pairing_accept_query(smp, rsp); + err = smp_pairing_accept_query(conn, rsp); if (err) { return err; } @@ -3348,9 +3319,9 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) if ((DISPLAY_FIXED(smp) || smp->method == JUST_WORKS) && atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ) && - smp_auth_cb && smp_auth_cb->pairing_confirm) { + bt_auth && bt_auth->pairing_confirm) { atomic_set_bit(smp->flags, SMP_FLAG_USER); - smp_auth_cb->pairing_confirm(conn); + bt_auth->pairing_confirm(conn); return 0; } @@ -3740,7 +3711,6 @@ static void le_sc_oob_config_set(struct bt_smp *smp, static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) { - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_smp_pairing_random *req = (void *)buf->data; uint32_t passkey; uint8_t err; @@ -3772,7 +3742,7 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) atomic_set_bit(smp->flags, SMP_FLAG_USER); atomic_set_bit(smp->flags, SMP_FLAG_DHKEY_SEND); - smp_auth_cb->passkey_confirm(smp->chan.chan.conn, passkey); + bt_auth->passkey_confirm(smp->chan.chan.conn, passkey); return 0; case JUST_WORKS: break; @@ -3816,7 +3786,7 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) } atomic_set_bit(smp->flags, SMP_FLAG_USER); - smp_auth_cb->passkey_confirm(smp->chan.chan.conn, passkey); + bt_auth->passkey_confirm(smp->chan.chan.conn, passkey); break; case JUST_WORKS: break; @@ -3852,7 +3822,7 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) return BT_SMP_ERR_UNSPECIFIED; } - if (smp_auth_cb && smp_auth_cb->oob_data_request) { + if (bt_auth && bt_auth->oob_data_request) { struct bt_conn_oob_info info = { .type = BT_CONN_OOB_LE_SC, .lesc.oob_config = BT_CONN_OOB_NO_DATA, @@ -3864,7 +3834,7 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) smp->oobd_remote = NULL; atomic_set_bit(smp->flags, SMP_FLAG_OOB_PENDING); - smp_auth_cb->oob_data_request(smp->chan.chan.conn, &info); + bt_auth->oob_data_request(smp->chan.chan.conn, &info); return 0; } else { @@ -3886,15 +3856,14 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) static uint8_t smp_pairing_failed(struct bt_smp *smp, struct net_buf *buf) { struct bt_conn *conn = smp->chan.chan.conn; - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_smp_pairing_fail *req = (void *)buf->data; BT_ERR("reason 0x%x", req->reason); if (atomic_test_and_clear_bit(smp->flags, SMP_FLAG_USER) || atomic_test_and_clear_bit(smp->flags, SMP_FLAG_DISPLAY)) { - if (smp_auth_cb && smp_auth_cb->cancel) { - smp_auth_cb->cancel(conn); + if (bt_auth && bt_auth->cancel) { + bt_auth->cancel(conn); } } @@ -4133,7 +4102,7 @@ static uint8_t smp_security_request(struct bt_smp *smp, struct net_buf *buf) /* if MITM required key must be authenticated */ if ((auth & BT_SMP_AUTH_MITM) && !(conn->le.keys->flags & BT_KEYS_AUTHENTICATED)) { - if (get_io_capa(smp) != BT_SMP_IO_NO_INPUT_OUTPUT) { + if (get_io_capa() != BT_SMP_IO_NO_INPUT_OUTPUT) { BT_INFO("New auth requirements: 0x%x, repairing", auth); goto pair; @@ -4194,9 +4163,6 @@ static uint8_t generate_dhkey(struct bt_smp *smp) static uint8_t display_passkey(struct bt_smp *smp) { - struct bt_conn *conn = smp->chan.chan.conn; - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); - if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_INVALID) { smp->passkey = fixed_passkey; @@ -4210,9 +4176,9 @@ static uint8_t display_passkey(struct bt_smp *smp) smp->passkey_round = 0U; - if (smp_auth_cb && smp_auth_cb->passkey_display) { + if (bt_auth && bt_auth->passkey_display) { atomic_set_bit(smp->flags, SMP_FLAG_DISPLAY); - smp_auth_cb->passkey_display(conn, smp->passkey); + bt_auth->passkey_display(smp->chan.chan.conn, smp->passkey); } smp->passkey = sys_cpu_to_le32(smp->passkey); @@ -4223,7 +4189,6 @@ static uint8_t display_passkey(struct bt_smp *smp) #if defined(CONFIG_BT_PERIPHERAL) static uint8_t smp_public_key_periph(struct bt_smp *smp) { - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); uint8_t err; if (!atomic_test_bit(smp->flags, SMP_FLAG_SC_DEBUG_KEY) && @@ -4263,7 +4228,7 @@ static uint8_t smp_public_key_periph(struct bt_smp *smp) atomic_set_bit(smp->allowed_cmds, BT_SMP_CMD_PAIRING_CONFIRM); atomic_set_bit(smp->allowed_cmds, BT_SMP_KEYPRESS_NOTIFICATION); atomic_set_bit(smp->flags, SMP_FLAG_USER); - smp_auth_cb->passkey_entry(smp->chan.chan.conn); + bt_auth->passkey_entry(smp->chan.chan.conn); break; case LE_SC_OOB: atomic_set_bit(smp->allowed_cmds, BT_SMP_CMD_PAIRING_RANDOM); @@ -4279,7 +4244,6 @@ static uint8_t smp_public_key_periph(struct bt_smp *smp) static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) { - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_smp_public_key *req = (void *)buf->data; uint8_t err; @@ -4337,7 +4301,7 @@ static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) break; case PASSKEY_INPUT: atomic_set_bit(smp->flags, SMP_FLAG_USER); - smp_auth_cb->passkey_entry(smp->chan.chan.conn); + bt_auth->passkey_entry(smp->chan.chan.conn); atomic_set_bit(smp->allowed_cmds, BT_SMP_KEYPRESS_NOTIFICATION); @@ -4349,7 +4313,7 @@ static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) return BT_SMP_ERR_UNSPECIFIED; } - if (smp_auth_cb && smp_auth_cb->oob_data_request) { + if (bt_auth && bt_auth->oob_data_request) { struct bt_conn_oob_info info = { .type = BT_CONN_OOB_LE_SC, .lesc.oob_config = BT_CONN_OOB_NO_DATA, @@ -4362,7 +4326,8 @@ static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) atomic_set_bit(smp->flags, SMP_FLAG_OOB_PENDING); - smp_auth_cb->oob_data_request(smp->chan.chan.conn, &info); + bt_auth->oob_data_request(smp->chan.chan.conn, + &info); } else { return BT_SMP_ERR_OOB_NOT_AVAIL; } @@ -4632,8 +4597,6 @@ static void bt_smp_connected(struct bt_l2cap_chan *chan) k_work_init_delayable(&smp->work, smp_timeout); smp_reset(smp); - - atomic_ptr_set(&smp->auth_cb, BT_SMP_AUTH_CB_UNINITIALIZED); } static void bt_smp_disconnected(struct bt_l2cap_chan *chan) @@ -5321,22 +5284,6 @@ static inline int smp_self_test(void) } #endif -int bt_smp_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb) -{ - struct bt_smp *smp; - - smp = smp_chan_get(conn); - if (!smp) { - return -EINVAL; - } - - if (atomic_ptr_cas(&smp->auth_cb, BT_SMP_AUTH_CB_UNINITIALIZED, (atomic_ptr_val_t)cb)) { - return 0; - } else { - return -EALREADY; - } -} - int bt_smp_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) { struct bt_smp *smp; diff --git a/subsys/bluetooth/host/smp.h b/subsys/bluetooth/host/smp.h index 83d2b570f6c..e1f20094bc4 100644 --- a/subsys/bluetooth/host/smp.h +++ b/subsys/bluetooth/host/smp.h @@ -141,7 +141,6 @@ int bt_smp_br_send_pairing_req(struct bt_conn *conn); int bt_smp_init(void); -int bt_smp_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb); int bt_smp_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey); int bt_smp_auth_passkey_confirm(struct bt_conn *conn); int bt_smp_auth_pairing_confirm(struct bt_conn *conn); From bd110a3f74825a905cf5521437b3e0109407939a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 352/501] Revert "[nrf fromtree] boards: thingy53_nrf5340: Disable BMI270 in DTS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3ab3ad52dfc682386fa76caa327cb7a3fc3bd912. Signed-off-by: Andrzej Głąbek --- boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index f6a120d2f34..03a872fdf67 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -114,6 +114,7 @@ magn0 = &bmm150; watchdog0 = &wdt0; accel0 = &adxl362; + accel1 = &bmi270; }; }; @@ -188,7 +189,6 @@ bmi270: spi-dev-bmi270@1 { compatible = "bosch,bmi270"; - status = "disabled"; spi-max-frequency = <8000000>; reg = <1>; int1-gpios = <&gpio0 23 0>; From 9fd3c7f4f21b0475c2fe97c68871d85cd68fd938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 353/501] Revert "[nrf fromtree] boards: arm: nordic: Remove label property from devicetree" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 39ffe17c3b53ef0b2c4f55331c0ba0a67c301f1e. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus/actinius_icarus_common.dts | 1 + .../actinius_icarus_bee/actinius_icarus_bee_common.dts | 2 ++ .../actinius_icarus_som/actinius_icarus_som_common.dts | 1 + .../adafruit_feather_nrf52840.dts | 1 + .../arduino_nano_33_ble-common.dtsi | 1 + .../arduino_nano_33_ble/arduino_nano_33_ble_sense.dts | 4 ++++ boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts | 5 +++++ .../arduino_nicla_sense_me/arduino_nicla_sense_me.dts | 1 + boards/arm/bbc_microbit/bbc_microbit.dts | 4 ++++ boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts | 3 +++ boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts | 10 ++++++++++ boards/arm/bl652_dvk/bl652_dvk.dts | 1 + boards/arm/bl653_dvk/bl653_dvk.dts | 1 + boards/arm/bl654_dvk/bl654_dvk.dts | 2 ++ boards/arm/bl654_sensor_board/bl654_sensor_board.dts | 1 + boards/arm/bl654_usb/bl654_usb.dts | 1 + .../blueclover_plt_demo_v2_nrf52832.dts | 3 +++ boards/arm/bt510/bt510.dts | 3 +++ boards/arm/bt610/bt610.dts | 3 +++ .../circuitdojo_feather_nrf9160_common.dts | 4 ++++ .../contextualelectronics_abc.dts | 1 + .../arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts | 2 ++ boards/arm/degu_evk/degu_evk.dts | 3 +++ boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts | 1 + boards/arm/nrf52840_mdk/nrf52840_mdk.dts | 1 + boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts | 1 + boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts | 1 + .../arm/nrf9160_innblue21/nrf9160_innblue21_common.dts | 7 +++++++ .../arm/nrf9160_innblue22/nrf9160_innblue22_common.dts | 7 +++++++ boards/arm/particle_argon/dts/mesh_feather.dtsi | 1 + boards/arm/particle_boron/dts/mesh_feather.dtsi | 1 + boards/arm/particle_boron/particle_boron.dts | 1 + boards/arm/particle_xenon/dts/mesh_feather.dtsi | 1 + boards/arm/pinetime_devkit0/pinetime_devkit0.dts | 6 ++++++ boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts | 3 +++ boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts | 1 + boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts | 5 +++++ boards/arm/reel_board/dts/reel_board.dtsi | 3 +++ boards/arm/reel_board/reel_board.dts | 1 + boards/arm/reel_board/reel_board_v2.dts | 1 + boards/arm/rm1xx_dvk/rm1xx_dvk.dts | 2 ++ boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts | 2 ++ .../sparkfun_thing_plus_nrf9160_common.dts | 3 +++ boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts | 10 ++++++++++ .../arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 9 +++++++++ .../ubx_bmd340eval_nrf52840.dts | 1 + .../ubx_bmd345eval_nrf52840.dts | 1 + .../ubx_bmd380eval_nrf52840.dts | 1 + boards/arm/xiao_ble/xiao_ble.dts | 2 ++ 49 files changed, 131 insertions(+) diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index 784c96cf262..fb31f00703c 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -145,6 +145,7 @@ reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, <&gpio0 29 GPIO_ACTIVE_HIGH>; + label = "LIS2DH12-ACCEL"; }; }; diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index 53a4b4bac95..f2c65919f67 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -123,6 +123,7 @@ reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, <&gpio0 29 GPIO_ACTIVE_HIGH>; + label = "LIS2DH12-ACCEL"; }; }; @@ -139,6 +140,7 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <80000000>; + label = "W25Q64"; jedec-id = [ef 40 17]; size = <0x4000000>; has-dpd; diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index 6c574899289..91487876709 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -62,6 +62,7 @@ reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, <&gpio0 29 GPIO_ACTIVE_HIGH>; + label = "LIS2DH12-ACCEL"; }; }; diff --git a/boards/arm/adafruit_feather_nrf52840/adafruit_feather_nrf52840.dts b/boards/arm/adafruit_feather_nrf52840/adafruit_feather_nrf52840.dts index 96aa9538d51..c1d805d4d62 100644 --- a/boards/arm/adafruit_feather_nrf52840/adafruit_feather_nrf52840.dts +++ b/boards/arm/adafruit_feather_nrf52840/adafruit_feather_nrf52840.dts @@ -106,6 +106,7 @@ writeoc = "pp4o"; readoc = "read4io"; sck-frequency = <16000000>; + label = "GD25Q16"; jedec-id = [c8 40 15]; size = <16777216>; has-dpd; diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble-common.dtsi b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble-common.dtsi index 02ef21e0e10..8031726695c 100644 --- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble-common.dtsi +++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble-common.dtsi @@ -75,6 +75,7 @@ vdd_env: vdd-env { compatible = "regulator-fixed"; + label = "vdd_env"; regulator-name = "vdd_env"; enable-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; regulator-boot-on; diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_sense.dts b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_sense.dts index 11ba59bcbc7..7cc1e54c946 100644 --- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_sense.dts +++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_sense.dts @@ -15,6 +15,7 @@ mic_pwr: mic_pwr { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "mic_pwr"; regulator-name = "mic_pwr"; enable-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -26,18 +27,21 @@ compatible = "st,hts221"; status = "okay"; reg = <0x5f>; + label = "HTS221"; }; lps22hb: lps22hb-press@5c { compatible = "st,lps22hb-press"; status = "okay"; reg = <0x5c>; + label = "LPS22HB"; }; apds9960: apds9960@39 { compatible = "avago,apds9960"; status = "okay"; reg = <0x39>; + label = "APDS9960"; int-gpios = <&gpio0 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; }; }; diff --git a/boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts b/boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts index 732084dab3e..ad7b3dff850 100644 --- a/boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts +++ b/boards/arm/arduino_nano_33_iot/arduino_nano_33_iot.dts @@ -62,6 +62,7 @@ &sercom2 { status = "okay"; compatible = "atmel,sam0-spi"; + label = "NINA_SPI"; dipo = <1>; dopo = <3>; #address-cells = <1>; @@ -75,6 +76,7 @@ nina_w102@0 { compatible = "u-blox,nina"; reg = <0>; + label = "NINA_W102"; spi-max-frequency = <8000000>; ready-gpios = <&porta 28 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; reset-gpios = <&porta 8 GPIO_ACTIVE_LOW>; @@ -94,6 +96,7 @@ nina_prog { compatible = "espressif,esp-at"; + label = "NINA_PROG"; reset-gpios = <&porta 8 GPIO_ACTIVE_LOW>; }; }; @@ -111,11 +114,13 @@ lsm6ds3@6a { compatible = "st,lsm6ds3"; reg = <0x6a>; + label = "LSM6DS3"; }; atecc608a@15 { compatible = "atmel,atecc608"; reg = <0x6a>; + label = "ATECC608A"; }; }; diff --git a/boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts b/boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts index c4b08c7107e..09edae4af25 100644 --- a/boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts +++ b/boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts @@ -102,6 +102,7 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <80000000>; + label = "MX25R16"; jedec-id = [c2 28 15]; size = ; has-dpd; diff --git a/boards/arm/bbc_microbit/bbc_microbit.dts b/boards/arm/bbc_microbit/bbc_microbit.dts index 1f0e3cb248a..3398b47ccb9 100644 --- a/boards/arm/bbc_microbit/bbc_microbit.dts +++ b/boards/arm/bbc_microbit/bbc_microbit.dts @@ -48,6 +48,7 @@ led_matrix: led_matrix { compatible = "nordic,nrf-led-matrix"; status = "okay"; + label = "LED_MATRIX"; width = <5>; height = <5>; pixel-mapping = [00 13 01 14 02 @@ -135,6 +136,7 @@ compatible = "nxp,fxos8700", "nxp,mma8653fc"; status = "okay"; reg = <0x1d>; + label = "MMA8653FC"; int1-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; int2-gpios = <&gpio0 27 GPIO_ACTIVE_LOW>; }; @@ -144,6 +146,7 @@ compatible = "st,lis2mdl", "st,lsm303agr-magn"; status = "disabled"; reg = <0x1e>; + label = "LSM303AGR-MAGN"; irq-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; /* A3 */ }; @@ -151,6 +154,7 @@ compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "disabled"; reg = <0x19>; + label = "LSM303AGR-ACCEL"; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; }; }; diff --git a/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts b/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts index 111486a90a8..c6190aa14fa 100644 --- a/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts +++ b/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts @@ -48,6 +48,7 @@ led_matrix: led_matrix { compatible = "nordic,nrf-led-matrix"; status = "okay"; + label = "LED_MATRIX"; width = <5>; height = <5>; pixel-mapping = [00 01 02 03 04 @@ -133,6 +134,7 @@ compatible = "st,lis2mdl", "st,lsm303agr-magn"; status = "okay"; reg = <0x1e>; + label = "LSM303AGR-MAGN"; irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; /* A3 */ }; @@ -140,6 +142,7 @@ compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "okay"; reg = <0x19>; + label = "LSM303AGR-ACCEL"; irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; }; }; diff --git a/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts b/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts index 8e31713cce8..3ccb69c48c5 100644 --- a/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts +++ b/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts @@ -118,6 +118,7 @@ at24c256@50 { compatible = "atmel,at24"; reg = <0x50>; + label = "EEPROM"; size = <32768>; pagesize = <64>; address-width = <16>; @@ -126,6 +127,7 @@ lis3dh: lis3dh@18 { compatible = "st,lis2dh"; + label = "LIS3DH"; reg = <0x18>; irq-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>, <&gpio0 24 GPIO_ACTIVE_HIGH>; }; @@ -133,28 +135,33 @@ ft5336@38 { compatible = "focaltech,ft5336"; reg = <0x38>; + label = "TOUCH"; int-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; }; bme680@76 { compatible = "bosch,bme680"; reg = <0x76>; + label = "BME680"; }; dac0: mcp4725@60 { compatible = "microchip,mcp4725"; reg = <0x60>; + label = "dac0"; #io-channel-cells = <1>; }; extrtc0: mcp7940n@6f { compatible = "microchip,mcp7940n"; reg = <0x6f>; + label = "mcp7940n"; }; gpio_exp0: tca9538@70 { compatible = "ti,tca9538"; reg = <0x70>; + label = "tca9538"; gpio-controller; #gpio-cells = <2>; ngpios = <8>; @@ -174,6 +181,7 @@ compatible = "microchip,enc424j600"; reg = <0>; spi-max-frequency = <8000000>; + label = "ETHERNET"; int-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; }; }; @@ -210,6 +218,7 @@ compatible = "ilitek,ili9340"; reg = <0>; spi-max-frequency = <32000000>; + label = "DISPLAY"; reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; cmd-data-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; rotation = <270>; @@ -258,6 +267,7 @@ /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/bl652_dvk/bl652_dvk.dts b/boards/arm/bl652_dvk/bl652_dvk.dts index 69da64646aa..913484a0886 100644 --- a/boards/arm/bl652_dvk/bl652_dvk.dts +++ b/boards/arm/bl652_dvk/bl652_dvk.dts @@ -91,6 +91,7 @@ /* MCP4725 not populated at factory */ compatible = "microchip,mcp4725"; reg = <0x60>; + label = "MCP4725"; #io-channel-cells = <1>; status = "disabled"; }; diff --git a/boards/arm/bl653_dvk/bl653_dvk.dts b/boards/arm/bl653_dvk/bl653_dvk.dts index 0c712242458..df9eab933bd 100644 --- a/boards/arm/bl653_dvk/bl653_dvk.dts +++ b/boards/arm/bl653_dvk/bl653_dvk.dts @@ -115,6 +115,7 @@ /* MCP4725 not populated at factory */ compatible = "microchip,mcp4725"; reg = <0x60>; + label = "MCP4725"; #io-channel-cells = <1>; status = "disabled"; }; diff --git a/boards/arm/bl654_dvk/bl654_dvk.dts b/boards/arm/bl654_dvk/bl654_dvk.dts index 5605a434cdc..7e4f339f65b 100644 --- a/boards/arm/bl654_dvk/bl654_dvk.dts +++ b/boards/arm/bl654_dvk/bl654_dvk.dts @@ -115,6 +115,7 @@ /* MCP4725 not populated at factory */ compatible = "microchip,mcp4725"; reg = <0x60>; + label = "MCP4725"; #io-channel-cells = <1>; status = "disabled"; }; @@ -148,6 +149,7 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <80000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; size = <67108864>; wp-gpios = <&gpio0 22 0>; diff --git a/boards/arm/bl654_sensor_board/bl654_sensor_board.dts b/boards/arm/bl654_sensor_board/bl654_sensor_board.dts index 4981def53dc..d84ae442b31 100644 --- a/boards/arm/bl654_sensor_board/bl654_sensor_board.dts +++ b/boards/arm/bl654_sensor_board/bl654_sensor_board.dts @@ -84,6 +84,7 @@ bme280@76 { compatible = "bosch,bme280"; status = "okay"; + label = "BME280"; reg = <0x76>; }; }; diff --git a/boards/arm/bl654_usb/bl654_usb.dts b/boards/arm/bl654_usb/bl654_usb.dts index 5164ac28e17..54d77245d0b 100644 --- a/boards/arm/bl654_usb/bl654_usb.dts +++ b/boards/arm/bl654_usb/bl654_usb.dts @@ -107,5 +107,6 @@ zephyr_udc0: &usbd { bl654_cdc_acm_uart: bl654_cdc_acm_uart { compatible = "zephyr,cdc-acm-uart"; + label = "CDC_ACM_0"; }; }; diff --git a/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts b/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts index 9dfdbc33a25..7de13528795 100644 --- a/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts +++ b/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts @@ -72,11 +72,13 @@ sht3xd@44 { compatible = "sensirion,sht3xd"; reg = <0x44>; + label = "SHT3XD"; }; bmi270: bmi270@68 { compatible = "bosch,bmi270"; reg = <0x68>; + label = "BMI270"; }; }; @@ -99,6 +101,7 @@ compatible = "apa,apa102"; reg = <0>; spi-max-frequency = <5250000>; + label = "APA102"; }; }; diff --git a/boards/arm/bt510/bt510.dts b/boards/arm/bt510/bt510.dts index 51139ffc594..a397a6b2ce4 100644 --- a/boards/arm/bt510/bt510.dts +++ b/boards/arm/bt510/bt510.dts @@ -72,6 +72,7 @@ mag0: mag_0 { compatible = "honeywell,sm351lt"; gpios = <&gpio1 14 0>; + label = "SM351LT_0"; }; }; @@ -124,12 +125,14 @@ reg = <0x18>; irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>, <&gpio1 12 GPIO_ACTIVE_HIGH>; + label = "LIS2DH12"; disconnect-sdo-sa0-pull-up; }; si7055@40 { compatible = "silabs,si7055"; reg = <0x40>; + label = "SI7055"; }; }; diff --git a/boards/arm/bt610/bt610.dts b/boards/arm/bt610/bt610.dts index 2b6a54b94f4..6ce5f38096a 100644 --- a/boards/arm/bt610/bt610.dts +++ b/boards/arm/bt610/bt610.dts @@ -62,6 +62,7 @@ mag1: mag_1 { compatible = "honeywell,sm351lt"; gpios = <&gpio1 15 0>; + label = "SM3531LT_0"; }; }; @@ -256,6 +257,7 @@ gpio_exp0: tca9538@70 { compatible = "ti,tca9538"; reg = <0x70>; + label = "tca9538"; gpio-controller; #gpio-cells = <2>; ngpios = <8>; @@ -284,6 +286,7 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts b/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts index 95faa637ac2..d6c10ef14cc 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts +++ b/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts @@ -83,6 +83,7 @@ nrf-ps-en { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "nrf_ps_en"; regulator-name = "nrf_ps_en"; enable-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -131,11 +132,13 @@ pinctrl-names = "default", "sleep"; pcf85063a@51 { compatible = "nxp,pcf85063a"; + label = "PCF85063A"; reg = <0x51>; }; lis2dh: lis2dh@18 { compatible = "st,lis2dh"; + label = "LIS2DH"; reg = <0x18>; irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; disconnect-sdo-sa0-pull-up; @@ -159,6 +162,7 @@ pinctrl-names = "default", "sleep"; w25q32jv: w25q32jv@0 { compatible = "jedec,spi-nor"; + label = "W25Q32JV"; reg = < 0 >; spi-max-frequency = < 40000000 >; wp-gpios = < &gpio0 8 GPIO_ACTIVE_LOW >; diff --git a/boards/arm/contextualelectronics_abc/contextualelectronics_abc.dts b/boards/arm/contextualelectronics_abc/contextualelectronics_abc.dts index ebc866afeff..8216e8fe7c1 100644 --- a/boards/arm/contextualelectronics_abc/contextualelectronics_abc.dts +++ b/boards/arm/contextualelectronics_abc/contextualelectronics_abc.dts @@ -62,6 +62,7 @@ arduino_serial: &uart1 { pinctrl-names = "default", "sleep"; quectel_bg9x { compatible = "quectel,bg9x"; + label = "quectel-bg9x"; status = "okay"; mdm-power-gpios = <&gpio1 5 0>; diff --git a/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts b/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts index fe31442107a..c36e9f96843 100644 --- a/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts +++ b/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts @@ -110,6 +110,7 @@ compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; + label = "LIS2DH12-ACCEL"; }; }; @@ -136,6 +137,7 @@ int-gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; /* P0.19 */ reset-gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; /* P0.24 */ status = "okay"; + label = "DW1000"; reg = <0>; }; }; diff --git a/boards/arm/degu_evk/degu_evk.dts b/boards/arm/degu_evk/degu_evk.dts index 32a95fda9ae..714e841db4b 100644 --- a/boards/arm/degu_evk/degu_evk.dts +++ b/boards/arm/degu_evk/degu_evk.dts @@ -58,6 +58,7 @@ en-3v3-switch { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "en_3v3_switch"; regulator-name = "en_3v3_switch"; enable-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -65,6 +66,7 @@ en-vin1-moni { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "en_vin1_moni"; regulator-name = "en_vin1_moni"; enable-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -159,5 +161,6 @@ zephyr_udc0: &usbd { degu_cdc_acm_uart: degu_cdc_acm_uart { compatible = "zephyr,cdc-acm-uart"; + label = "CDC_ACM_0"; }; }; diff --git a/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts b/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts index 3c8d999e594..c618484c522 100644 --- a/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts +++ b/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts @@ -232,6 +232,7 @@ fem_spi: &spi3 { compatible = "nordic,nrf21540-fem-spi"; status = "okay"; reg = <0>; + label = "FEM_SPI_IF"; spi-max-frequency = <8000000>; }; }; diff --git a/boards/arm/nrf52840_mdk/nrf52840_mdk.dts b/boards/arm/nrf52840_mdk/nrf52840_mdk.dts index 86447b3ee7f..28a9d03b55d 100644 --- a/boards/arm/nrf52840_mdk/nrf52840_mdk.dts +++ b/boards/arm/nrf52840_mdk/nrf52840_mdk.dts @@ -142,6 +142,7 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts index d7594bcf160..c5c40f9fb2c 100644 --- a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts +++ b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts @@ -224,6 +224,7 @@ arduino_i2c: &i2c0 { /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts index 77da12d8116..0169bb3206b 100644 --- a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts +++ b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts @@ -182,6 +182,7 @@ /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts b/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts index 71db4a88f48..63e0594996e 100644 --- a/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts +++ b/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts @@ -47,6 +47,7 @@ en_3v3_sensor: enable-3v3-sensor { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "ENABLE_3V3_SENSOR"; regulator-name = "en_3v3_sensor"; enable-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; startup-delay-us = <10000>; @@ -55,6 +56,7 @@ en_5v0_boost: enable-5v0-boost { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "ENABLE_5V0_BOOST"; regulator-name = "en_5v0_boost"; enable-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; startup-delay-us = <10000>; @@ -119,26 +121,31 @@ compatible = "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 0 0>, <&gpio0 1 0>; + label = "LIS2DH12-ACCEL"; }; hts221@5f { compatible = "st,hts221"; reg = <0x5f>; drdy-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + label = "HTS221"; }; lps22hb-press@5c { compatible = "st,lps22hb-press"; reg = <0x5c>; + label = "LPS22HB"; }; ccs811: ccs811@5a { compatible = "ams,ccs811"; reg = <0x5a>; + label = "CCS811"; }; bme680@76 { compatible = "bosch,bme680"; + label = "BME680"; reg = <0x76>; }; }; diff --git a/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts b/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts index 860c1d8a87f..f23c134b323 100644 --- a/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts +++ b/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts @@ -47,6 +47,7 @@ en_5v0_boost: enable-5v0-boost { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "ENABLE_5V0_BOOST"; regulator-name = "en_5v0_boost"; enable-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; startup-delay-us = <10000>; @@ -111,6 +112,7 @@ pinctrl-names = "default", "sleep"; bq27421@55 { compatible = "ti,bq274xx"; + label = "BQ274XX"; reg = <0x55>; design-voltage = <3700>; design-capacity = <1800>; @@ -122,26 +124,31 @@ compatible = "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 1 GPIO_ACTIVE_HIGH>; + label = "LIS2DH12-ACCEL"; }; hts221@5f { compatible = "st,hts221"; reg = <0x5f>; drdy-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + label = "HTS221"; }; lps22hb-press@5c { compatible = "st,lps22hb-press"; reg = <0x5c>; + label = "LPS22HB"; }; ccs811: ccs811@5a { compatible = "ams,ccs811"; reg = <0x5a>; + label = "CCS811"; }; bme680@76 { compatible = "bosch,bme680"; + label = "BME680"; reg = <0x76>; }; }; diff --git a/boards/arm/particle_argon/dts/mesh_feather.dtsi b/boards/arm/particle_argon/dts/mesh_feather.dtsi index 2d04f02d030..86e270df303 100644 --- a/boards/arm/particle_argon/dts/mesh_feather.dtsi +++ b/boards/arm/particle_argon/dts/mesh_feather.dtsi @@ -199,6 +199,7 @@ feather_i2c: &i2c0 { }; pinctrl-names = "default", "sleep"; mx25l32: mx25l3233f@0 { compatible = "jedec,spi-nor"; + label = "MX25L3233F"; reg = <0>; spi-max-frequency = <80000000>; wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/particle_boron/dts/mesh_feather.dtsi b/boards/arm/particle_boron/dts/mesh_feather.dtsi index 2d04f02d030..86e270df303 100644 --- a/boards/arm/particle_boron/dts/mesh_feather.dtsi +++ b/boards/arm/particle_boron/dts/mesh_feather.dtsi @@ -199,6 +199,7 @@ feather_i2c: &i2c0 { }; pinctrl-names = "default", "sleep"; mx25l32: mx25l3233f@0 { compatible = "jedec,spi-nor"; + label = "MX25L3233F"; reg = <0>; spi-max-frequency = <80000000>; wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/particle_boron/particle_boron.dts b/boards/arm/particle_boron/particle_boron.dts index e59853bf809..9b49a9792f9 100644 --- a/boards/arm/particle_boron/particle_boron.dts +++ b/boards/arm/particle_boron/particle_boron.dts @@ -49,6 +49,7 @@ pinctrl-names = "default", "sleep"; sara_r4 { compatible = "u-blox,sara-r4"; + label = "ublox-sara-r4"; status = "okay"; mdm-power-gpios = <&gpio0 16 0>; diff --git a/boards/arm/particle_xenon/dts/mesh_feather.dtsi b/boards/arm/particle_xenon/dts/mesh_feather.dtsi index 99d14532a44..52a42b060c5 100644 --- a/boards/arm/particle_xenon/dts/mesh_feather.dtsi +++ b/boards/arm/particle_xenon/dts/mesh_feather.dtsi @@ -198,6 +198,7 @@ feather_i2c: &i2c0 { }; pinctrl-names = "default", "sleep"; mx25l32: mx25l3233f@0 { compatible = "jedec,spi-nor"; + label = "MX25L3233F"; reg = <0>; spi-max-frequency = <80000000>; wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/pinetime_devkit0/pinetime_devkit0.dts b/boards/arm/pinetime_devkit0/pinetime_devkit0.dts index 46d54e436ca..a002236c2ee 100644 --- a/boards/arm/pinetime_devkit0/pinetime_devkit0.dts +++ b/boards/arm/pinetime_devkit0/pinetime_devkit0.dts @@ -67,6 +67,7 @@ key_out { compatible = "pine64,pinetime-key-out"; gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + label = "Key out"; }; vbatt { @@ -110,6 +111,7 @@ bma421: bma421@18 { compatible = "bosch,bma4xx"; reg = <0x18>; + label = "BMA421"; int1-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; }; @@ -117,12 +119,14 @@ hrs3300: hrs3300@44 { compatible = "tian-yi-he-xin-hrs3300"; reg = <0x44>; + label = "HRS3300"; }; /* Hynitron CST816S Capacitive Touch Controller (400KHz) */ cst816s: cst816s@15 { compatible = "hynitron,cst816s"; reg = <0x15>; + label = "CST816S"; irq-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; rst-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; }; @@ -141,6 +145,7 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <8000000>; /* 8MHz */ + label = "XT25FB32"; jedec-id = [0b 40 16]; size = ; @@ -168,6 +173,7 @@ compatible = "sitronix,st7789v"; reg = <1>; spi-max-frequency = <8000000>; /* 8MHz */ + label = "ST7789V"; cmd-data-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; /* DET */ reset-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; /* RESX reset */ width = <240>; diff --git a/boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts b/boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts index b0271831764..d6ef6e67864 100644 --- a/boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts +++ b/boards/arm/pinnacle_100_dvk/pinnacle_100_dvk.dts @@ -113,6 +113,7 @@ hl7800 { compatible = "swir,hl7800"; status = "okay"; + label = "hl7800"; mdm-reset-gpios = <&gpio1 15 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>; mdm-wake-gpios = <&gpio1 13 (GPIO_OPEN_SOURCE | GPIO_ACTIVE_HIGH)>; mdm-pwr-on-gpios = <&gpio1 2 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>; @@ -134,6 +135,7 @@ bme680@76 { compatible = "bosch,bme680"; status = "okay"; + label = "BME680"; reg = <0x76>; }; }; @@ -166,6 +168,7 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; size = <67108864>; has-dpd; diff --git a/boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts b/boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts index 7041f42182e..b9168c3024e 100644 --- a/boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts +++ b/boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts @@ -106,6 +106,7 @@ lora: lora@0 { compatible = "semtech,sx1262"; reg = <0>; + label = "sx1262"; reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; busy-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; tx-enable-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts b/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts index 083839a9710..9500fbefa6a 100644 --- a/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts +++ b/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts @@ -66,6 +66,7 @@ pinctrl-names = "default", "sleep"; quectel_bg9x: quectel_bg9x { compatible = "quectel,bg9x"; + label = "quectel,bg9x"; mdm-power-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; mdm-reset-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; mdm-dtr-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; @@ -92,12 +93,14 @@ pinctrl-names = "default", "sleep"; opt3001@44 { compatible = "ti,opt3001"; + label = "OPT3001"; reg = <0x44>; }; /* ST Microelectronics LIS3DH motion sensor */ lis3dh: lis3dh@19 { compatible = "st,lis3dh", "st,lis2dh"; + label = "LIS3DH"; reg = <0x19>; irq-gpios = <&gpio0 15 0>; }; @@ -106,6 +109,7 @@ lps22hb-press@5c { compatible = "st,lps22hb-press"; reg = <0x5c>; + label = "LPS22HB"; }; }; @@ -120,6 +124,7 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <16000000>; + label = "IS25WP064A"; jedec-id = [9d 70 17]; size = <67108864>; has-dpd; diff --git a/boards/arm/reel_board/dts/reel_board.dtsi b/boards/arm/reel_board/dts/reel_board.dtsi index 9a0c504b9ee..0ed5d04ec4d 100644 --- a/boards/arm/reel_board/dts/reel_board.dtsi +++ b/boards/arm/reel_board/dts/reel_board.dtsi @@ -128,6 +128,7 @@ arduino_i2c: &i2c0 { mma8642fc: mma8652fc@1d { compatible = "nxp,fxos8700","nxp,mma8652fc"; reg = <0x1d>; + label = "MMA8652FC"; int1-gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; int2-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; }; @@ -135,12 +136,14 @@ arduino_i2c: &i2c0 { ti_hdc@43 { compatible = "ti,hdc","ti,hdc1010"; reg = <0x43>; + label = "HDC1010"; drdy-gpios = <&gpio0 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; }; apds9960@39 { compatible = "avago,apds9960"; reg = <0x39>; + label = "APDS9960"; int-gpios = <&gpio0 23 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; }; }; diff --git a/boards/arm/reel_board/reel_board.dts b/boards/arm/reel_board/reel_board.dts index 0080d514617..6c533cbf595 100644 --- a/boards/arm/reel_board/reel_board.dts +++ b/boards/arm/reel_board/reel_board.dts @@ -58,6 +58,7 @@ pinctrl-names = "default", "sleep"; ssd16xx: ssd16xxfb@0 { compatible = "gooddisplay,gdeh0213b1", "solomon,ssd1673", "solomon,ssd16xxfb"; + label = "SSD16XX"; spi-max-frequency = <4000000>; reg = <0>; width = <250>; diff --git a/boards/arm/reel_board/reel_board_v2.dts b/boards/arm/reel_board/reel_board_v2.dts index 81f4accc37c..9e7f65d5ffa 100644 --- a/boards/arm/reel_board/reel_board_v2.dts +++ b/boards/arm/reel_board/reel_board_v2.dts @@ -41,6 +41,7 @@ pinctrl-names = "default", "sleep"; ssd16xx: ssd16xxfb@0 { compatible = "gooddisplay,gdeh0213b72", "solomon,ssd1675a", "solomon,ssd16xxfb"; + label = "SSD16XX"; spi-max-frequency = <4000000>; reg = <0>; width = <250>; diff --git a/boards/arm/rm1xx_dvk/rm1xx_dvk.dts b/boards/arm/rm1xx_dvk/rm1xx_dvk.dts index 3ff2cd54ae7..f95b7c352e0 100644 --- a/boards/arm/rm1xx_dvk/rm1xx_dvk.dts +++ b/boards/arm/rm1xx_dvk/rm1xx_dvk.dts @@ -78,6 +78,7 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <1000000>; + label = "at25df04"; jedec-id = [1f 44 02]; size = <0x400000>; has-lock = <0xbc>; @@ -89,6 +90,7 @@ lora0: lora@1 { compatible = "semtech,sx1272"; reg = <1>; + label = "sx1272"; reset-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; dio-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>, <&gpio0 13 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts b/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts index a07831aef1a..efce24bedce 100644 --- a/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts +++ b/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts @@ -86,6 +86,7 @@ compatible = "bosch,bme280"; reg = <0>; spi-max-frequency = <10000000>; + label= "BME280"; }; lis2dh12: lis2dh12@1 { @@ -93,6 +94,7 @@ reg = <1>; spi-max-frequency = <10000000>; irq-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>, <&gpio0 6 GPIO_ACTIVE_HIGH>; + label = "LIS2DH12-ACCEL"; }; }; diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts b/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts index 79f44d03bf1..b3db04e13e4 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts +++ b/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts @@ -123,11 +123,13 @@ pinctrl-names = "default", "sleep"; pcf85063a@51 { compatible = "nxp,pcf85063a"; + label = "PCF85063A"; reg = <0x51>; }; lis2dh: lis2dh@18 { compatible = "st,lis2dh"; + label = "LIS2DH"; reg = <0x18>; irq-gpios = <&gpio0 29 0>; }; @@ -150,6 +152,7 @@ pinctrl-names = "default", "sleep"; w25q32jv: w25q32jv@0 { compatible = "jedec,spi-nor"; + label = "W25Q32JV"; reg = <0>; spi-max-frequency = <40000000>; wp-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts b/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts index d958a24d78e..8d12416444a 100644 --- a/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts +++ b/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts @@ -73,6 +73,7 @@ vdd_pwr: vdd-pwr-ctrl { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "vdd-pwr-ctrl"; regulator-name = "vdd-pwr-ctrl"; enable-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -80,24 +81,28 @@ spk_pwr: spk-pwr-ctrl { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "spk-pwr-ctrl"; regulator-name = "spk-pwr-ctrl"; enable-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; }; mpu_pwr: mpu-pwr-ctrl { compatible = "regulator-fixed"; + label = "mpu-pwr-ctrl"; regulator-name = "mpu-pwr-ctrl"; enable-gpios = <&sx1509b 8 GPIO_ACTIVE_HIGH>; }; mic_pwr: mic-pwr-ctrl { compatible = "regulator-fixed"; + label = "mic-pwr-ctrl"; regulator-name = "mic-pwr-ctrl"; enable-gpios = <&sx1509b 9 GPIO_ACTIVE_HIGH>; }; ccs_pwr: ccs-pwr-ctrl { compatible = "regulator-fixed"; + label = "ccs-pwr-ctrl"; regulator-name = "ccs-pwr-ctrl"; enable-gpios = <&sx1509b 10 GPIO_ACTIVE_HIGH>; }; @@ -135,6 +140,7 @@ sx1509b: sx1509b@3e { compatible = "semtech,sx1509b"; reg = <0x3e>; + label = "GPIO_P0"; vin-supply = <&vdd_pwr>; gpio-controller; #gpio-cells = <2>; @@ -147,12 +153,14 @@ lps22hb_press: lps22hb_press@5c { compatible = "st,lps22hb-press"; reg = <0x5c>; + label = "LPS22HB"; vin-supply = <&vdd_pwr>; }; hts221: hts221@5f { compatible = "st,hts221"; reg = <0x5f>; + label = "HTS221"; vin-supply = <&vdd_pwr>; drdy-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>; }; @@ -160,6 +168,7 @@ ccs811: ccs811@5a { compatible = "ams,ccs811"; reg = <0x5a>; + label = "CCS811"; vin-supply = <&ccs_pwr>; irq-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; reset-gpios = <&sx1509b 11 GPIO_ACTIVE_LOW>; @@ -179,6 +188,7 @@ compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + label = "LIS2DH12-ACCEL"; }; }; diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 03a872fdf67..34fa27b1f48 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -63,6 +63,7 @@ npm1100_force_pwm_mode: npm1100_force_pwm_mode { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "npm1100_force_pwm_mode"; regulator-name = "npm1100_force_pwm_mode"; enable-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; status = "disabled"; @@ -79,6 +80,7 @@ regulator_3v3: regulator-3v3-ctrl { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "vsys-3v3-ctrl"; regulator-name = "ncp114"; enable-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; regulator-boot-on; @@ -86,6 +88,7 @@ sensor_pwr_ctrl: sensor-pwr-ctrl { compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "sens-pwr-ctrl"; regulator-name = "tck106ag"; enable-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>; regulator-boot-on; @@ -160,11 +163,13 @@ pinctrl-names = "default", "sleep"; bmm150: bmm150@10 { compatible = "bosch,bmm150"; + label = "BMM150"; reg = <0x10>; }; bh1749@38 { compatible = "rohm,bh1749"; + label = "BH1749"; reg = <0x38>; int-gpios = <&gpio1 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; }; @@ -182,6 +187,7 @@ pinctrl-names = "default", "sleep"; adxl362: spi-dev-adxl362@0 { compatible = "adi,adxl362"; + label = "ADXL362"; spi-max-frequency = <8000000>; reg = <0>; int1-gpios = <&gpio0 19 0>; @@ -189,6 +195,7 @@ bmi270: spi-dev-bmi270@1 { compatible = "bosch,bmi270"; + label = "BMI270"; spi-max-frequency = <8000000>; reg = <1>; int1-gpios = <&gpio0 23 0>; @@ -198,6 +205,7 @@ compatible = "nordic,nrf21540-fem-spi"; status = "disabled"; reg = <2>; + label = "FEM_SPI_IF"; spi-max-frequency = <8000000>; }; }; @@ -226,6 +234,7 @@ /* Thingy:53 supports only fastread and read2io options */ readoc = "read2io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb diff --git a/boards/arm/ubx_bmd340eval_nrf52840/ubx_bmd340eval_nrf52840.dts b/boards/arm/ubx_bmd340eval_nrf52840/ubx_bmd340eval_nrf52840.dts index f770d071cdd..dbaa7a47ca2 100644 --- a/boards/arm/ubx_bmd340eval_nrf52840/ubx_bmd340eval_nrf52840.dts +++ b/boards/arm/ubx_bmd340eval_nrf52840/ubx_bmd340eval_nrf52840.dts @@ -225,6 +225,7 @@ arduino_i2c: &i2c0 { /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 diff --git a/boards/arm/ubx_bmd345eval_nrf52840/ubx_bmd345eval_nrf52840.dts b/boards/arm/ubx_bmd345eval_nrf52840/ubx_bmd345eval_nrf52840.dts index df2e692c5a8..96342e394e5 100644 --- a/boards/arm/ubx_bmd345eval_nrf52840/ubx_bmd345eval_nrf52840.dts +++ b/boards/arm/ubx_bmd345eval_nrf52840/ubx_bmd345eval_nrf52840.dts @@ -241,6 +241,7 @@ arduino_spi: &spi3 { /* MX25R64 supports all readoc options */ readoc = "read4io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 diff --git a/boards/arm/ubx_bmd380eval_nrf52840/ubx_bmd380eval_nrf52840.dts b/boards/arm/ubx_bmd380eval_nrf52840/ubx_bmd380eval_nrf52840.dts index d2606dad2b9..4f392567cf4 100644 --- a/boards/arm/ubx_bmd380eval_nrf52840/ubx_bmd380eval_nrf52840.dts +++ b/boards/arm/ubx_bmd380eval_nrf52840/ubx_bmd380eval_nrf52840.dts @@ -168,6 +168,7 @@ writeoc = "pp4io"; readoc = "read4io"; sck-frequency = <8000000>; + label = "MX25R64"; jedec-id = [c2 28 17]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 03 diff --git a/boards/arm/xiao_ble/xiao_ble.dts b/boards/arm/xiao_ble/xiao_ble.dts index 5497a253dc4..1849fece4b4 100644 --- a/boards/arm/xiao_ble/xiao_ble.dts +++ b/boards/arm/xiao_ble/xiao_ble.dts @@ -123,6 +123,7 @@ wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; hold-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; spi-max-frequency = <104000000>; + label = "P25Q16H"; jedec-id = [85 60 15]; sfdp-bfp = [ e5 20 f1 ff ff ff ff 00 44 eb 08 6b 08 3b 80 bb @@ -177,5 +178,6 @@ zephyr_udc0: &usbd { usb_cdc_acm_uart: cdc-acm-uart { compatible = "zephyr,cdc-acm-uart"; + label = "CDC_ACM_0"; }; }; From c10d5a88fbecab659cffbddf14da0cb1f414e3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 354/501] Revert "[nrf noup] boards: Enable TF-M by default for nordic SoC NS boards" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2ede29c77a7a240aca62a06831504961136c27d3. Signed-off-by: Andrzej Głąbek --- .../circuitdojo_feather_nrf9160/Kconfig.defconfig | 15 --------------- .../sparkfun_thing_plus_nrf9160/Kconfig.defconfig | 15 --------------- boards/arm/thingy53_nrf5340/Kconfig.defconfig | 15 --------------- 3 files changed, 45 deletions(-) diff --git a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig index ac86c23088d..92465481d65 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig +++ b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig @@ -9,21 +9,6 @@ if BOARD_CIRCUITDOJO_FEATHER_NRF9160 || BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS config BOARD default "circuitdojo_feather_nrf9160" -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - config I2C default y if SENSOR diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig index f9618c7d975..f9bc9b207a2 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig +++ b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig @@ -9,21 +9,6 @@ if BOARD_SPARKFUN_THING_PLUS_NRF9160 || BOARD_SPARKFUN_THING_PLUS_NRF9160_NS config BOARD default "sparkfun_thing_plus_nrf9160" -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/thingy53_nrf5340/Kconfig.defconfig b/boards/arm/thingy53_nrf5340/Kconfig.defconfig index aafabf0e9c9..c5ae7da4c3b 100644 --- a/boards/arm/thingy53_nrf5340/Kconfig.defconfig +++ b/boards/arm/thingy53_nrf5340/Kconfig.defconfig @@ -8,21 +8,6 @@ if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config BOARD default "thingy53_nrf5340_cpuapp" -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_THINGY53_NRF5340_CPUAPP_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - # Code Partition: # # For the secure version of the board the firmware is linked at the beginning From d44fc3578e83b7daf4943338a913cc4303cae62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 355/501] Revert "[nrf fromtree] samples: sensor: Add 3-Axis accelerometer polling sample" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c03ec4e878172d808fbef07388b6f72ae82fa642. Signed-off-by: Andrzej Głąbek --- samples/sensor/accel_polling/CMakeLists.txt | 9 --- samples/sensor/accel_polling/README.rst | 46 ------------- samples/sensor/accel_polling/prj.conf | 3 - samples/sensor/accel_polling/sample.yaml | 26 -------- samples/sensor/accel_polling/src/main.c | 74 --------------------- 5 files changed, 158 deletions(-) delete mode 100644 samples/sensor/accel_polling/CMakeLists.txt delete mode 100644 samples/sensor/accel_polling/README.rst delete mode 100644 samples/sensor/accel_polling/prj.conf delete mode 100644 samples/sensor/accel_polling/sample.yaml delete mode 100644 samples/sensor/accel_polling/src/main.c diff --git a/samples/sensor/accel_polling/CMakeLists.txt b/samples/sensor/accel_polling/CMakeLists.txt deleted file mode 100644 index 7fb7a11af3f..00000000000 --- a/samples/sensor/accel_polling/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2022 TOKITA Hiroshi -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(accel_polling) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/samples/sensor/accel_polling/README.rst b/samples/sensor/accel_polling/README.rst deleted file mode 100644 index 15260817f06..00000000000 --- a/samples/sensor/accel_polling/README.rst +++ /dev/null @@ -1,46 +0,0 @@ -.. _accel_polling: - -Generic 3-Axis accelerometer polling sample -########################################### - -Overview -******** - -This sample application demonstrates how to use 3-Axis accelerometers. - -Building and Running -******************** - -This sample supports up to 10 3-Axis accelerometers. Each accelerometer needs -to be aliased as ``accelN`` where ``N`` goes from ``0`` to ``9``. For example: - -.. code-block:: devicetree - - / { - aliases { - accel0 = &lis2dh; - }; - }; - -Make sure the aliases are in devicetree, then build and run with: - -.. zephyr-app-commands:: - :zephyr-app: samples/sensor/accel_polling - :board: - :goals: build flash - :compact: - -Sample Output -============= - -.. code-block:: console - - lis2dh@19 [m/s^2]: ( -6.013728, -3.064320, 7.277760) - lis2dh@19 [m/s^2]: ( -6.128640, -3.026016, 7.201152) - lis2dh@19 [m/s^2]: ( -6.090336, -3.064320, 7.162848) - lis2dh@19 [m/s^2]: ( -6.128640, -3.026016, 7.354368) - lis2dh@19 [m/s^2]: ( -6.166944, -3.102624, 7.277760) - lis2dh@19 [m/s^2]: ( -6.128640, -2.987712, 7.277760) - lis2dh@19 [m/s^2]: ( -6.052032, -2.987712, 7.277760) - lis2dh@19 [m/s^2]: ( -6.166944, -2.987712, 7.239456) - lis2dh@19 [m/s^2]: ( -6.090336, -3.026016, 7.201152) diff --git a/samples/sensor/accel_polling/prj.conf b/samples/sensor/accel_polling/prj.conf deleted file mode 100644 index fb14ccba74f..00000000000 --- a/samples/sensor/accel_polling/prj.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_STDOUT_CONSOLE=y -CONFIG_SENSOR=y -CONFIG_CBPRINTF_FP_SUPPORT=y diff --git a/samples/sensor/accel_polling/sample.yaml b/samples/sensor/accel_polling/sample.yaml deleted file mode 100644 index e83795e986d..00000000000 --- a/samples/sensor/accel_polling/sample.yaml +++ /dev/null @@ -1,26 +0,0 @@ -sample: - name: Accelerometer polling sample -tests: - sample.sensor.accel_polling: - harness: console - tags: sensors - filter: dt_alias_exists("accel0") - harness_config: - type: one_line - regex: - - "^\\s*[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]* \\[m\/s\\^2\\]: \\(\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*\\)$" - integration_platforms: - - cc1352r_sensortag # adxl362 - - blueclover_plt_demo_v2_nrf52832 # bmi270 - - frdm_kl25z # mma8451q - - lpcxpresso55s28 # mma8652fc - - bbc_microbit # mmc8653fc - - frdm_k64f # fxos8700 - - sparkfun_thing_plus_nrf9160 # lis2dh - - thingy52_nrf52832 # lis2dh12 - - stm32f411e_disco # lsm303agr_accel - - stm32f3_disco # lsm303dlhc_accel - - bl5340_dvk # lis3dh - - b_l4s5i_iot01a # lsm6dsl - - sensortile_box # lis2dw12, lsm6dso, iisdhhc - - thingy53_nrf5340_cpuapp # adxl362, bmi270 diff --git a/samples/sensor/accel_polling/src/main.c b/samples/sensor/accel_polling/src/main.c deleted file mode 100644 index 902d40738c7..00000000000 --- a/samples/sensor/accel_polling/src/main.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2022 TOKITA Hiroshi -#include - -#include -#include -#include -#include - -#define ACCEL_ALIAS(i) DT_ALIAS(_CONCAT(accel, i)) -#define ACCELEROMETER_DEVICE(i, _) \ - IF_ENABLED(DT_NODE_EXISTS(ACCEL_ALIAS(i)), (DEVICE_DT_GET(ACCEL_ALIAS(i)),)) - -/* support up to 10 accelerometer sensors */ -static const struct device *sensors[] = {LISTIFY(10, ACCELEROMETER_DEVICE, ())}; - -static const enum sensor_channel channels[] = { - SENSOR_CHAN_ACCEL_X, - SENSOR_CHAN_ACCEL_Y, - SENSOR_CHAN_ACCEL_Z, -}; - -static int print_accels(const struct device *dev) -{ - int ret; - struct sensor_value accel[3]; - - ret = sensor_sample_fetch(dev); - if (ret < 0) { - printk("%s: sensor_sample_fetch() failed: %d\n", dev->name, ret); - return ret; - } - - for (size_t i = 0; i < ARRAY_SIZE(channels); i++) { - ret = sensor_channel_get(dev, channels[i], &accel[i]); - if (ret < 0) { - printk("%s: sensor_channel_get(%c) failed: %d\n", dev->name, 'X' + i, ret); - return ret; - } - } - - printk("%16s [m/s^2]: (%12.6f, %12.6f, %12.6f)\n", dev->name, - sensor_value_to_double(&accel[0]), sensor_value_to_double(&accel[1]), - sensor_value_to_double(&accel[2])); - - return 0; -} - -void main(void) -{ - int ret; - - for (size_t i = 0; i < ARRAY_SIZE(sensors); i++) { - if (!device_is_ready(sensors[i])) { - printk("sensor: device %s not ready.\n", sensors[i]->name); - return; - } - } - - while (1) { - for (size_t i = 0; i < ARRAY_SIZE(sensors); i++) { - ret = print_accels(sensors[i]); - if (ret < 0) { - return; - } - } - k_msleep(1000); - } -} From 04021b38d233c9f9025209a22afd86f1f0f15d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 356/501] Revert "[nrf fromtree] boards: Set devicetree alias for ST IIS3DHHC nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 59b6b0cf4d7dcc38b35d5c097acc3b909b58d5bf. Signed-off-by: Andrzej Głąbek --- boards/arm/sensortile_box/sensortile_box.dts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/boards/arm/sensortile_box/sensortile_box.dts b/boards/arm/sensortile_box/sensortile_box.dts index ed31cbff89a..ff07b53b8e8 100644 --- a/boards/arm/sensortile_box/sensortile_box.dts +++ b/boards/arm/sensortile_box/sensortile_box.dts @@ -47,7 +47,6 @@ magn0 = &lis2mdl; accel0 = &lis2dw12; accel1 = &lsm6dso; - accel2 = &iis3dhhc; }; }; @@ -148,7 +147,7 @@ int-pin = <1>; }; - iis3dhhc: iis3dhhc@2 { + iis3dhhc@2 { compatible = "st,iis3dhhc"; spi-max-frequency = <1000000>; reg = <2>; From 62d51c6c6704822abd692758c340d7f871ef41e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 357/501] Revert "[nrf fromtree] boards: Set devicetree alias for ST LSM6DSO nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b71e1d10c8c55876974b67d54854024c7c4b1eca. Signed-off-by: Andrzej Głąbek --- boards/arm/sensortile_box/sensortile_box.dts | 3 +-- boards/arm/stm32l562e_dk/Kconfig.defconfig | 6 +++++- boards/arm/stm32l562e_dk/stm32l562e_dk.dts | 1 - boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi | 2 +- boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay | 3 +-- .../shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay | 3 +-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/boards/arm/sensortile_box/sensortile_box.dts b/boards/arm/sensortile_box/sensortile_box.dts index ff07b53b8e8..61e166ca0dc 100644 --- a/boards/arm/sensortile_box/sensortile_box.dts +++ b/boards/arm/sensortile_box/sensortile_box.dts @@ -46,7 +46,6 @@ sw0 = &user_button; magn0 = &lis2mdl; accel0 = &lis2dw12; - accel1 = &lsm6dso; }; }; @@ -138,7 +137,7 @@ label = "LIS2DW12"; }; - lsm6dso: lsm6dso@1 { + lsm6dso@1 { compatible = "st,lsm6dso"; spi-max-frequency = <1000000>; reg = <1>; diff --git a/boards/arm/stm32l562e_dk/Kconfig.defconfig b/boards/arm/stm32l562e_dk/Kconfig.defconfig index 110cae6e1aa..650a8d7524e 100644 --- a/boards/arm/stm32l562e_dk/Kconfig.defconfig +++ b/boards/arm/stm32l562e_dk/Kconfig.defconfig @@ -13,8 +13,12 @@ choice STM32_LPTIM_CLOCK depends on STM32_LPTIM_TIMER endchoice +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR if BT diff --git a/boards/arm/stm32l562e_dk/stm32l562e_dk.dts b/boards/arm/stm32l562e_dk/stm32l562e_dk.dts index 194fbe2eddc..c773993e361 100644 --- a/boards/arm/stm32l562e_dk/stm32l562e_dk.dts +++ b/boards/arm/stm32l562e_dk/stm32l562e_dk.dts @@ -25,7 +25,6 @@ led0 = &green_led_10; sw0 = &user_button; watchdog0 = &iwdg; - accel0 = &lsm6dso; }; }; diff --git a/boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi b/boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi index 34d4086c452..9b713d5243c 100644 --- a/boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi +++ b/boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi @@ -103,7 +103,7 @@ status = "okay"; clock-frequency = ; - lsm6dso: lsm6dso@6a { + lsm6dso@6a { compatible = "st,lsm6dso"; reg = <0x6a>; irq-gpios = <&gpiof 3 GPIO_ACTIVE_HIGH>; diff --git a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay index fb7dae59e01..4cbbeb3585a 100644 --- a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay +++ b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay @@ -8,7 +8,6 @@ aliases { magn0 = &lis2mdl; accel0 = &lis2dw12; - accel1 = &lsm6dso; }; }; @@ -43,7 +42,7 @@ irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm6dso: lsm6dso@6b { + lsm6dso@6b { compatible = "st,lsm6dso"; reg = <0x6b>; irq-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 */ diff --git a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay index 3045e846860..e4fd760a10b 100644 --- a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay +++ b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay @@ -7,7 +7,6 @@ / { aliases { accel0 = &lis2dw12; - accel1 = &lsm6dso; }; }; @@ -19,7 +18,7 @@ irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm6dso: lsm6dso@6b { + lsm6dso@6b { compatible = "st,lsm6dso"; reg = <0x6b>; irq-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 */ From 33b8c7fb5a691992d6be008d737be3102cdea92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 358/501] Revert "[nrf fromtree] boards: Set devicetree alias for ST LSM6DSL nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 73892037538bff0cf06e209fdd8c63cbf846a0ef. Signed-off-by: Andrzej Głąbek --- boards/arm/96b_argonkey/96b_argonkey.dts | 3 +-- boards/arm/96b_argonkey/Kconfig.defconfig | 8 ++++++-- boards/arm/b_l4s5i_iot01a/Kconfig.defconfig | 6 +++++- boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts | 3 +-- boards/arm/disco_l475_iot1/Kconfig.defconfig | 6 +++++- boards/arm/disco_l475_iot1/disco_l475_iot1.dts | 3 +-- boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay | 3 +-- 7 files changed, 20 insertions(+), 12 deletions(-) diff --git a/boards/arm/96b_argonkey/96b_argonkey.dts b/boards/arm/96b_argonkey/96b_argonkey.dts index e03e17c620b..ee33f0db7d2 100644 --- a/boards/arm/96b_argonkey/96b_argonkey.dts +++ b/boards/arm/96b_argonkey/96b_argonkey.dts @@ -43,7 +43,6 @@ led0 = &green_led_0; led1 = &green_led_1; sw0 = &user_button; - accel0 = &lsm6dsl; }; }; @@ -95,7 +94,7 @@ status = "okay"; /* ST Microelectronics LSM6DSL accel/gyro sensor */ - lsm6dsl: lsm6dsl@1 { + lsm6dsl@1 { compatible = "st,lsm6dsl"; reg = <1>; spi-max-frequency = <1000000>; diff --git a/boards/arm/96b_argonkey/Kconfig.defconfig b/boards/arm/96b_argonkey/Kconfig.defconfig index dd463a089c7..1a34fcd375d 100644 --- a/boards/arm/96b_argonkey/Kconfig.defconfig +++ b/boards/arm/96b_argonkey/Kconfig.defconfig @@ -40,10 +40,14 @@ endchoice endif # LSM6DSL +if SENSOR + config I2C - default y if SENSOR + default y config SPI - default y if SENSOR + default y + +endif # SENSOR endif # BOARD_96B_ARGONKEY diff --git a/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig b/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig index 59036c87581..b1ca1c3253e 100644 --- a/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig +++ b/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig @@ -25,8 +25,12 @@ choice LSM6DSL_TRIGGER_MODE depends on LSM6DSL endchoice +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR if BT diff --git a/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts b/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts index a8cb3cf0e9e..c5b56e6707f 100644 --- a/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts +++ b/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts @@ -44,7 +44,6 @@ led0 = &green_led_1; sw0 = &user_button; watchdog0 = &iwdg; - accel0 = &lsm6dsl; }; }; @@ -113,7 +112,7 @@ label = "LPS22HB"; }; - lsm6dsl: lsm6dsl@6a { + lsm6dsl@6a { compatible = "st,lsm6dsl"; reg = <0x6a>; irq-gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>; diff --git a/boards/arm/disco_l475_iot1/Kconfig.defconfig b/boards/arm/disco_l475_iot1/Kconfig.defconfig index 54f0173c7d4..fbee69ba336 100644 --- a/boards/arm/disco_l475_iot1/Kconfig.defconfig +++ b/boards/arm/disco_l475_iot1/Kconfig.defconfig @@ -30,8 +30,12 @@ choice LSM6DSL_TRIGGER_MODE depends on LSM6DSL endchoice +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR if BT diff --git a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts index 844f6563f3e..15af45399b1 100644 --- a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts +++ b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts @@ -49,7 +49,6 @@ eswifi0 = &wifi0; watchdog0 = &iwdg; spi-flash0 = &mx25r6435f; - accel0 = &lsm6dsl; }; }; @@ -120,7 +119,7 @@ label = "LPS22HB"; }; - lsm6dsl: lsm6dsl@6a { + lsm6dsl@6a { compatible = "st,lsm6dsl"; reg = <0x6a>; irq-gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>; diff --git a/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay b/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay index 20284a9c228..a8ba562eaa0 100644 --- a/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay +++ b/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay @@ -9,7 +9,6 @@ aliases { magn0 = &lsm303agr_magn; accel0 = &lsm303agr_accel; - accel1 = &lsm6dsl; }; }; @@ -25,7 +24,7 @@ reg = <0x5d>; }; - lsm6dsl: lsm6dsl@6b { + lsm6dsl@6b { compatible = "st,lsm6dsl"; reg = <0x6b>; irq-gpios = <&arduino_header 10 GPIO_ACTIVE_HIGH>; /* D4 */ From 8b3730bd7be3ce7592c685b7f204fa981412a129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 359/501] Revert "[nrf fromtree] boards: Set devicetree alias for ST ISM330DHCX nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3e188e308c8452e1a0b7623436ad27fcebf308bd. Signed-off-by: Andrzej Głąbek --- boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay | 3 +-- boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay index ca2a8b2e806..c2c3700c234 100644 --- a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay +++ b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay @@ -16,7 +16,6 @@ / { aliases { accel0 = &iis2dlpc; - accel1 = &ism330dhcx; }; }; @@ -35,7 +34,7 @@ drdy-gpios = <&arduino_header 2 GPIO_ACTIVE_HIGH>; /* A2 */ }; - ism330dhcx: ism330dhcx@6b { + ism330dhcx@6b { compatible = "st,ism330dhcx"; reg = <0x6b>; drdy-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 - INT2 */ diff --git a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay index 4b80426302d..ac33eeeea53 100644 --- a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay +++ b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay @@ -18,7 +18,6 @@ / { aliases { accel0 = &iis2dlpc; - accel1 = &ism330dhcx; }; }; @@ -31,7 +30,7 @@ drdy-int = <2>; }; - ism330dhcx: ism330dhcx@6b { + ism330dhcx@6b { compatible = "st,ism330dhcx"; reg = <0x6b>; drdy-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 - INT2 */ From a696ce7b23f9019f1f65745b3b658c53deaf0e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 360/501] Revert "[nrf fromtree] boards: Set devicetree alias for Bosch BMI270 nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ea23c11ba7340e232311cd39b6e34385d31c670c. Signed-off-by: Andrzej Głąbek --- .../blueclover_plt_demo_v2_nrf52832.dts | 3 +-- boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts b/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts index 7de13528795..667f2f19566 100644 --- a/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts +++ b/boards/arm/blueclover_plt_demo_v2_nrf52832/blueclover_plt_demo_v2_nrf52832.dts @@ -41,7 +41,6 @@ sw1 = &button1; pwm-buzzer = &pwm0; watchdog0 = &wdt0; - accel0 = &bmi270; }; }; @@ -75,7 +74,7 @@ label = "SHT3XD"; }; - bmi270: bmi270@68 { + bmi270@68 { compatible = "bosch,bmi270"; reg = <0x68>; label = "BMI270"; diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 34fa27b1f48..295b1e982f4 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -117,7 +117,6 @@ magn0 = &bmm150; watchdog0 = &wdt0; accel0 = &adxl362; - accel1 = &bmi270; }; }; From e910fe99789bd5c4750906721f3e11a03a7354a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 361/501] Revert "[nrf fromtree] boards: Set devicetree alias for ST LIS3DH nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b9960058a9b9b6b5a12e1c9e0fcbc4beafd1ea09. Signed-off-by: Andrzej Głąbek --- boards/arm/96b_wistrio/96b_wistrio.dts | 5 ++--- boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts | 3 +-- boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/boards/arm/96b_wistrio/96b_wistrio.dts b/boards/arm/96b_wistrio/96b_wistrio.dts index 611a01b0898..d3ba0b1b7fe 100644 --- a/boards/arm/96b_wistrio/96b_wistrio.dts +++ b/boards/arm/96b_wistrio/96b_wistrio.dts @@ -36,7 +36,6 @@ led0 = &green_led_0; eeprom-0 = &eeprom; lora0 = &lora; - accel0 = &lis3dh; }; rf_switch: rf-switch { @@ -94,8 +93,8 @@ pinctrl-names = "default"; status = "okay"; - lis3dh: lis3dh@32 { - compatible = "st,lis3dh", "st,lis2dh"; + lis3dh@32 { + compatible = "st,lis3dh"; reg = <0x32>; label = "LIS3DH"; }; diff --git a/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts b/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts index 3ccb69c48c5..ac7b7f87d1f 100644 --- a/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts +++ b/boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dts @@ -88,7 +88,6 @@ mcuboot-led0 = &led1; sdhc0 = &sdhc0; watchdog0 = &wdt0; - accel0 = &lis3dh; }; }; @@ -125,7 +124,7 @@ timeout = <10>; }; - lis3dh: lis3dh@18 { + lis3dh@18 { compatible = "st,lis2dh"; label = "LIS3DH"; reg = <0x18>; diff --git a/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts b/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts index 9500fbefa6a..812b6c07bbb 100644 --- a/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts +++ b/boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts @@ -35,7 +35,6 @@ aliases { led0 = &led0; watchdog0 = &wdt0; - accel0 = &lis3dh; }; }; @@ -98,8 +97,8 @@ }; /* ST Microelectronics LIS3DH motion sensor */ - lis3dh: lis3dh@19 { - compatible = "st,lis3dh", "st,lis2dh"; + lis3dh@19 { + compatible = "st,lis3dh"; label = "LIS3DH"; reg = <0x19>; irq-gpios = <&gpio0 15 0>; From 8e85b563cd9adccd2e7d825c1a608842fe1ef54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 362/501] Revert "[nrf fromtree] boards: Set devicetree alias for ST LIS2DH and compatible nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 198435b92c6b96ef3470c7e72aa81ef38219abdc. Signed-off-by: Andrzej Głąbek --- boards/arm/actinius_icarus/Kconfig.defconfig | 6 +++++- boards/arm/actinius_icarus/actinius_icarus_common.dts | 3 +-- boards/arm/actinius_icarus_bee/Kconfig.defconfig | 6 +++++- .../actinius_icarus_bee/actinius_icarus_bee_common.dts | 3 +-- boards/arm/actinius_icarus_som/Kconfig.defconfig | 6 +++++- .../actinius_icarus_som/actinius_icarus_som_common.dts | 3 +-- boards/arm/bbc_microbit/bbc_microbit.dts | 2 +- boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts | 3 +-- boards/arm/bt510/bt510.dts | 3 +-- boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig | 6 +++++- .../circuitdojo_feather_nrf9160_common.dts | 3 +-- boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts | 1 - boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts | 3 +-- boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts | 3 +-- boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts | 1 - boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig | 6 +++++- .../sparkfun_thing_plus_nrf9160_common.dts | 3 +-- boards/arm/stm32f3_disco/stm32f3_disco.dts | 3 +-- boards/arm/stm32f3_disco/stm32f3_disco_E.overlay | 3 +-- boards/arm/stm32f411e_disco/stm32f411e_disco.dts | 3 +-- boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay | 8 +------- boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts | 1 - boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay | 3 +-- 23 files changed, 40 insertions(+), 42 deletions(-) diff --git a/boards/arm/actinius_icarus/Kconfig.defconfig b/boards/arm/actinius_icarus/Kconfig.defconfig index 81d8526f3a7..a202839ac2c 100644 --- a/boards/arm/actinius_icarus/Kconfig.defconfig +++ b/boards/arm/actinius_icarus/Kconfig.defconfig @@ -8,8 +8,12 @@ if BOARD_ACTINIUS_ICARUS || BOARD_ACTINIUS_ICARUS_NS config BOARD default "actinius_icarus" +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index fb31f00703c..18e0e5fe8cb 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -77,7 +77,6 @@ mcuboot-button0 = &button0; mcuboot-led0 = &green_pwm_led; watchdog0 = &wdt0; - accel0 = &lis2dh12_accel; }; vbatt { @@ -140,7 +139,7 @@ pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12_accel: lis2dh12-accel@19 { + lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/actinius_icarus_bee/Kconfig.defconfig b/boards/arm/actinius_icarus_bee/Kconfig.defconfig index a29c91ee7e0..01d5e9ca6da 100644 --- a/boards/arm/actinius_icarus_bee/Kconfig.defconfig +++ b/boards/arm/actinius_icarus_bee/Kconfig.defconfig @@ -8,8 +8,12 @@ if BOARD_ACTINIUS_ICARUS_BEE || BOARD_ACTINIUS_ICARUS_BEE_NS config BOARD default "actinius_icarus_bee" +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to diff --git a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts index f2c65919f67..2456179f803 100644 --- a/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts +++ b/boards/arm/actinius_icarus_bee/actinius_icarus_bee_common.dts @@ -78,7 +78,6 @@ mcuboot-led0 = &green_pwm_led; watchdog0 = &wdt0; spi-flash0 = &w25q64; - accel0 = &lis2dh12_accel; }; sim_select: sim-select { @@ -118,7 +117,7 @@ pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12_accel: lis2dh12-accel@19 { + lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/actinius_icarus_som/Kconfig.defconfig b/boards/arm/actinius_icarus_som/Kconfig.defconfig index c21f2cecfe2..fa1eaf9363a 100644 --- a/boards/arm/actinius_icarus_som/Kconfig.defconfig +++ b/boards/arm/actinius_icarus_som/Kconfig.defconfig @@ -8,8 +8,12 @@ if BOARD_ACTINIUS_ICARUS_SOM || BOARD_ACTINIUS_ICARUS_SOM_NS config BOARD default "actinius_icarus_som" +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to diff --git a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts index 91487876709..4a26af6d65b 100644 --- a/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts +++ b/boards/arm/actinius_icarus_som/actinius_icarus_som_common.dts @@ -17,7 +17,6 @@ aliases { watchdog0 = &wdt0; - accel0 = &lis2dh12_accel; }; sim_select: sim-select { @@ -57,7 +56,7 @@ pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12_accel: lis2dh12-accel@19 { + lis2dh12-accel@19 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/bbc_microbit/bbc_microbit.dts b/boards/arm/bbc_microbit/bbc_microbit.dts index 3398b47ccb9..52e90c220d2 100644 --- a/boards/arm/bbc_microbit/bbc_microbit.dts +++ b/boards/arm/bbc_microbit/bbc_microbit.dts @@ -150,7 +150,7 @@ irq-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm303agr_accel: lsm303agr-accel@19 { + lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "disabled"; reg = <0x19>; diff --git a/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts b/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts index c6190aa14fa..5e61c4f9a64 100644 --- a/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts +++ b/boards/arm/bbc_microbit_v2/bbc_microbit_v2.dts @@ -17,7 +17,6 @@ sw0 = &buttonA; sw1 = &buttonB; magn0 = &lsm303agr_magn; - accel0 = &lsm303agr_accel; watchdog0 = &wdt0; }; @@ -138,7 +137,7 @@ irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm303agr_accel: lsm303agr-accel@19 { + lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "okay"; reg = <0x19>; diff --git a/boards/arm/bt510/bt510.dts b/boards/arm/bt510/bt510.dts index a397a6b2ce4..b62a0432b8d 100644 --- a/boards/arm/bt510/bt510.dts +++ b/boards/arm/bt510/bt510.dts @@ -84,7 +84,6 @@ mcuboot-button0 = &button0; mcuboot-led0 = &led1a; watchdog0 = &wdt0; - accel0 = &lis2dh12; }; }; @@ -120,7 +119,7 @@ pinctrl-0 = <&i2c0_default>; pinctrl-1 = <&i2c0_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12: lis2dh12@18 { + lis2dh12@18 { compatible = "st,lis2dh12", "st,lis2dh"; reg = <0x18>; irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig index 92465481d65..40e77a236ca 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig +++ b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig @@ -9,8 +9,12 @@ if BOARD_CIRCUITDOJO_FEATHER_NRF9160 || BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS config BOARD default "circuitdojo_feather_nrf9160" +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to diff --git a/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts b/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts index d6c10ef14cc..4e02a1610ce 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts +++ b/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts @@ -49,7 +49,6 @@ mcuboot-led0 = &blue_led; watchdog0 = &wdt0; spi-flash0 = &w25q32jv; - accel0 = &lis2dh; }; /* Used for accessing other pins */ @@ -136,7 +135,7 @@ reg = <0x51>; }; - lis2dh: lis2dh@18 { + lis2dh@18 { compatible = "st,lis2dh"; label = "LIS2DH"; reg = <0x18>; diff --git a/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts b/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts index c36e9f96843..c2dfc016984 100644 --- a/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts +++ b/boards/arm/decawave_dwm1001_dev/decawave_dwm1001_dev.dts @@ -72,7 +72,6 @@ led3-blue = &led3_blue; pwm-led0 = &pwm_led0_red; watchdog0 = &wdt0; - accel0 = &lis2dh12; }; }; diff --git a/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts b/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts index 63e0594996e..b95af4fe338 100644 --- a/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts +++ b/boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dts @@ -73,7 +73,6 @@ rgb-pwm = &pwm0; mode-pwm = &pwm1; watchdog0 = &wdt0; - accel0 = &lis2dh12_accel; }; }; @@ -117,7 +116,7 @@ pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; - lis2dh12_accel: lis2dh12-accel@19 { + lis2dh12-accel@19 { compatible = "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 0 0>, <&gpio0 1 0>; diff --git a/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts b/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts index f23c134b323..7d2f8772b6e 100644 --- a/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts +++ b/boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dts @@ -64,7 +64,6 @@ rgb-pwm = &pwm0; mode-pwm = &pwm1; watchdog0 = &wdt0; - accel0 = &lis2dh12_accel; }; }; @@ -120,7 +119,7 @@ terminate-voltage = <3000>; }; - lis2dh12_accel: lis2dh12-accel@19 { + lis2dh12-accel@19 { compatible = "st,lis2dh"; reg = <0x19>; irq-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 1 GPIO_ACTIVE_HIGH>; diff --git a/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts b/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts index efce24bedce..676f18eb287 100644 --- a/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts +++ b/boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts @@ -29,7 +29,6 @@ led1 = &led1; sw0 = &button0; watchdog0 = &wdt0; - accel0 = &lis2dh12; }; leds { diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig index f9bc9b207a2..824ad975cce 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig +++ b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig @@ -26,8 +26,12 @@ config FLASH_LOAD_SIZE default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) depends on BOARD_SPARKFUN_THING_PLUS_NRF9160 && TRUSTED_EXECUTION_SECURE +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts b/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts index b3db04e13e4..6c542ed7b12 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts +++ b/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_common.dts @@ -48,7 +48,6 @@ mcuboot-button0 = &button0; mcuboot-led0 = &blue_led; watchdog0 = &wdt0; - accel0 = &lis2dh; }; /* Used for accessing other pins */ @@ -127,7 +126,7 @@ reg = <0x51>; }; - lis2dh: lis2dh@18 { + lis2dh@18 { compatible = "st,lis2dh"; label = "LIS2DH"; reg = <0x18>; diff --git a/boards/arm/stm32f3_disco/stm32f3_disco.dts b/boards/arm/stm32f3_disco/stm32f3_disco.dts index 2b46380f829..aa3ec053b45 100644 --- a/boards/arm/stm32f3_disco/stm32f3_disco.dts +++ b/boards/arm/stm32f3_disco/stm32f3_disco.dts @@ -70,7 +70,6 @@ sw0 = &user_button; magn0 = &lsm303dlhc_magn; watchdog0 = &iwdg; - accel0 = &lsm303dlhc_accel; }; }; @@ -128,7 +127,7 @@ label = "LSM303DLHC-MAGN"; }; - lsm303dlhc_accel: lsm303dlhc-accel@19 { + lsm303dlhc-accel@19 { compatible = "st,lis2dh", "st,lsm303dlhc-accel"; reg = <0x19>; irq-gpios = <&gpioe 4 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/stm32f3_disco/stm32f3_disco_E.overlay b/boards/arm/stm32f3_disco/stm32f3_disco_E.overlay index bafd944653e..d319408ee2a 100644 --- a/boards/arm/stm32f3_disco/stm32f3_disco_E.overlay +++ b/boards/arm/stm32f3_disco/stm32f3_disco_E.overlay @@ -7,7 +7,6 @@ / { aliases { magn0 = &lsm303agr_magn; - accel0 = &lsm303agr_accel; }; }; @@ -21,7 +20,7 @@ label = "LSM303AGR-MAGN"; }; - lsm303agr_accel: lsm303agr-accel@19 { + lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; reg = <0x19>; irq-gpios = <&gpioe 4 GPIO_ACTIVE_HIGH>, diff --git a/boards/arm/stm32f411e_disco/stm32f411e_disco.dts b/boards/arm/stm32f411e_disco/stm32f411e_disco.dts index a0c5722d60f..b977d11a5a9 100644 --- a/boards/arm/stm32f411e_disco/stm32f411e_disco.dts +++ b/boards/arm/stm32f411e_disco/stm32f411e_disco.dts @@ -74,7 +74,6 @@ pwm-led2 = &red_pwm_led; pwm-led3 = &blue_pwm_led; magn0 = &lsm303agr_magn; - accel0 = &lsm303agr_accel; }; }; @@ -128,7 +127,7 @@ label = "LSM303AGR-MAGN"; }; - lsm303agr_accel: lsm303agr-accel@19 { + lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; status = "okay"; reg = <0x19>; diff --git a/boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay b/boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay index 99ee0640fc8..316f31c4fe6 100644 --- a/boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay +++ b/boards/arm/stm32f411e_disco/stm32f411e_disco_B.overlay @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/ { - aliases { - accel0 = &lsm303dlhc_accel; - }; -}; - &i2c1 { /delete-node/ lsm303agr-magn@1e; /delete-node/ lsm303agr-accel@19; @@ -21,7 +15,7 @@ label = "LSM303DLHC-MAGN"; }; - lsm303dlhc_accel: lsm303dlhc-accel@19 { + lsm303dlhc-accel@19 { compatible = "st,lis2dh", "st,lsm303dlhc-accel"; status = "okay"; reg = <0x19>; diff --git a/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts b/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts index 8d12416444a..37c500d1fdc 100644 --- a/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts +++ b/boards/arm/thingy52_nrf52832/thingy52_nrf52832.dts @@ -31,7 +31,6 @@ led2 = &led2; sw0 = &button0; watchdog0 = &wdt0; - accel0 = &lis2dh12; }; leds { diff --git a/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay b/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay index a8ba562eaa0..0d86deddc0c 100644 --- a/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay +++ b/boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay @@ -8,7 +8,6 @@ / { aliases { magn0 = &lsm303agr_magn; - accel0 = &lsm303agr_accel; }; }; @@ -36,7 +35,7 @@ irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ }; - lsm303agr_accel: lsm303agr-accel@19 { + lsm303agr-accel@19 { compatible = "st,lis2dh", "st,lsm303agr-accel"; reg = <0x19>; irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ From 0281457df260c92821223a42dc3f83a12d6b35c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 363/501] Revert "[nrf fromtree] boards: Set devicetree alias for ST LIS2DW12 nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 84dc40438068b7910c9490969ca3112ba637f5ba. Signed-off-by: Andrzej Głąbek --- boards/arm/sensortile_box/sensortile_box.dts | 3 +-- boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay | 3 +-- .../x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay | 8 +------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/boards/arm/sensortile_box/sensortile_box.dts b/boards/arm/sensortile_box/sensortile_box.dts index 61e166ca0dc..39ec15409fc 100644 --- a/boards/arm/sensortile_box/sensortile_box.dts +++ b/boards/arm/sensortile_box/sensortile_box.dts @@ -45,7 +45,6 @@ led1 = &green_led; sw0 = &user_button; magn0 = &lis2mdl; - accel0 = &lis2dw12; }; }; @@ -129,7 +128,7 @@ cs-gpios = <&gpioe 11 GPIO_ACTIVE_LOW>, <&gpioe 12 GPIO_ACTIVE_LOW>, <&gpioe 10 GPIO_ACTIVE_LOW>; - lis2dw12: lis2dw12@0 { + lis2dw12@0 { compatible = "st,lis2dw12"; spi-max-frequency = <1000000>; reg = <0>; diff --git a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay index 4cbbeb3585a..29b8677158e 100644 --- a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay +++ b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay @@ -7,7 +7,6 @@ / { aliases { magn0 = &lis2mdl; - accel0 = &lis2dw12; }; }; @@ -36,7 +35,7 @@ irq-gpios = <&arduino_header 2 GPIO_ACTIVE_HIGH>; /* A2 */ }; - lis2dw12: lis2dw12@19 { + lis2dw12@19 { compatible = "st,lis2dw12"; reg = <0x19>; irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ diff --git a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay index e4fd760a10b..5ef7c596a63 100644 --- a/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay +++ b/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3_shub.overlay @@ -4,15 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/ { - aliases { - accel0 = &lis2dw12; - }; -}; - &arduino_i2c { - lis2dw12: lis2dw12@19 { + lis2dw12@19 { compatible = "st,lis2dw12"; reg = <0x19>; irq-gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>; /* A3 */ From 2ffa91ad96aa50aedb67a2591b348067f084b42a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 364/501] Revert "[nrf fromtree] boards: Set devicetree alias for NXP FXOS8700 and compatible nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f2bcdd2f1838efadc25e7897ce2c3f825a3312c9. Signed-off-by: Andrzej Głąbek --- boards/arm/bbc_microbit/bbc_microbit.dts | 3 +-- boards/arm/frdm_k22f/frdm_k22f.dts | 1 - boards/arm/frdm_k64f/frdm_k64f.dts | 1 - boards/arm/frdm_k82f/frdm_k82f.dts | 1 - boards/arm/frdm_kl25z/Kconfig.defconfig | 6 +++++- boards/arm/frdm_kl25z/frdm_kl25z.dts | 3 +-- boards/arm/frdm_kw41z/frdm_kw41z.dts | 1 - boards/arm/hexiwear_k64/hexiwear_k64.dts | 1 - boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi | 1 - boards/arm/lpcxpresso55s28/Kconfig.defconfig | 6 +++++- boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts | 1 - boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi | 3 +-- boards/arm/lpcxpresso55s69/Kconfig.defconfig | 6 +++++- boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi | 2 +- boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts | 1 - boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts | 1 - boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts | 1 - boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts | 1 - boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi | 1 - boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi | 1 - boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts | 1 - boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts | 1 - boards/arm/reel_board/dts/reel_board.dtsi | 3 +-- boards/arm/twr_ke18f/twr_ke18f.dts | 1 - boards/arm/twr_kv58f220m/twr_kv58f220m.dts | 1 - boards/arm/warp7_m4/warp7_m4.dts | 1 - boards/riscv/rv32m1_vega/rv32m1_vega.dtsi | 1 - boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay | 1 - 28 files changed, 20 insertions(+), 32 deletions(-) diff --git a/boards/arm/bbc_microbit/bbc_microbit.dts b/boards/arm/bbc_microbit/bbc_microbit.dts index 52e90c220d2..2d547f8138e 100644 --- a/boards/arm/bbc_microbit/bbc_microbit.dts +++ b/boards/arm/bbc_microbit/bbc_microbit.dts @@ -17,7 +17,6 @@ sw0 = &buttonA; sw1 = &buttonB; magn0 = &lsm303agr_magn; - accel0 = &mma8653fc; watchdog0 = &wdt0; }; @@ -132,7 +131,7 @@ pinctrl-0 = <&i2c0_default>; pinctrl-1 = <&i2c0_sleep>; pinctrl-names = "default", "sleep"; - mma8653fc: mma8653fc@1d { + mma8653fc@1d { compatible = "nxp,fxos8700", "nxp,mma8653fc"; status = "okay"; reg = <0x1d>; diff --git a/boards/arm/frdm_k22f/frdm_k22f.dts b/boards/arm/frdm_k22f/frdm_k22f.dts index 315b5b711dd..f55baaa4654 100644 --- a/boards/arm/frdm_k22f/frdm_k22f.dts +++ b/boards/arm/frdm_k22f/frdm_k22f.dts @@ -25,7 +25,6 @@ blue-pwm-led = &blue_pwm_led; red-pwm-led = &red_pwm_led; magn0 = &fxos8700; - accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/frdm_k64f/frdm_k64f.dts b/boards/arm/frdm_k64f/frdm_k64f.dts index 34f628dc6f7..9d17402d8f0 100644 --- a/boards/arm/frdm_k64f/frdm_k64f.dts +++ b/boards/arm/frdm_k64f/frdm_k64f.dts @@ -16,7 +16,6 @@ sw0 = &user_button_3; sw1 = &user_button_2; magn0 = &fxos8700; - accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/frdm_k82f/frdm_k82f.dts b/boards/arm/frdm_k82f/frdm_k82f.dts index 9e9ee38c2ae..06ee17925dc 100644 --- a/boards/arm/frdm_k82f/frdm_k82f.dts +++ b/boards/arm/frdm_k82f/frdm_k82f.dts @@ -25,7 +25,6 @@ sw0 = &user_button_0; sw1 = &user_button_1; magn0 = &fxos8700; - accel0 = &fxos8700; spi-flash0 = &mx25u32; }; diff --git a/boards/arm/frdm_kl25z/Kconfig.defconfig b/boards/arm/frdm_kl25z/Kconfig.defconfig index c35f63c04d8..b2c4c76fff7 100644 --- a/boards/arm/frdm_kl25z/Kconfig.defconfig +++ b/boards/arm/frdm_kl25z/Kconfig.defconfig @@ -23,8 +23,12 @@ config MCG_FRDIV config MCG_FCRDIV default 0 +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR if FXOS8700 diff --git a/boards/arm/frdm_kl25z/frdm_kl25z.dts b/boards/arm/frdm_kl25z/frdm_kl25z.dts index e0f5c6c2f8e..f15690d483c 100644 --- a/boards/arm/frdm_kl25z/frdm_kl25z.dts +++ b/boards/arm/frdm_kl25z/frdm_kl25z.dts @@ -15,7 +15,6 @@ led2 = &red_led; sw0 = &user_button_0; sw1 = &user_button_1; - accel0 = &mma8451q; }; chosen { @@ -103,7 +102,7 @@ pinctrl-0 = <&i2c0_default>; pinctrl-names = "default"; - mma8451q: mma8451q@1d { + mma8451q@1d { compatible = "nxp,fxos8700","nxp,mma8451q"; reg = <0x1d>; label = "MMA8451Q"; diff --git a/boards/arm/frdm_kw41z/frdm_kw41z.dts b/boards/arm/frdm_kw41z/frdm_kw41z.dts index cc2ebbe9d3a..8a21f0bcddb 100644 --- a/boards/arm/frdm_kw41z/frdm_kw41z.dts +++ b/boards/arm/frdm_kw41z/frdm_kw41z.dts @@ -22,7 +22,6 @@ green-pwm-led = &green_pwm_led; red-pwm-led = &red_pwm_led; magn0 = &fxos8700; - accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/hexiwear_k64/hexiwear_k64.dts b/boards/arm/hexiwear_k64/hexiwear_k64.dts index 87140dc9f40..b383cc757bc 100644 --- a/boards/arm/hexiwear_k64/hexiwear_k64.dts +++ b/boards/arm/hexiwear_k64/hexiwear_k64.dts @@ -19,7 +19,6 @@ green-pwm-led = &green_pwm_led; blue-pwm-led = &blue_pwm_led; magn0 = &fxos8700; - accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi b/boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi index b01f3fc1284..991c5144b9d 100644 --- a/boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi +++ b/boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi @@ -26,7 +26,6 @@ sw2 = &btn_isp; usart-0 = &flexcomm0; magn0 = &fxos8700; - accel0 = &fxos8700; }; leds { diff --git a/boards/arm/lpcxpresso55s28/Kconfig.defconfig b/boards/arm/lpcxpresso55s28/Kconfig.defconfig index bf144f06bb3..1df703fc52b 100644 --- a/boards/arm/lpcxpresso55s28/Kconfig.defconfig +++ b/boards/arm/lpcxpresso55s28/Kconfig.defconfig @@ -8,8 +8,12 @@ if BOARD_LPCXPRESSO55S28 config BOARD default "lpcxpresso55S28" +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR if FXOS8700 diff --git a/boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts b/boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts index 229e4996bf7..003b31a43e7 100644 --- a/boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts +++ b/boards/arm/lpcxpresso55s28/lpcxpresso55s28.dts @@ -18,7 +18,6 @@ sw1 = &user_button_2; sw2 = &user_button_3; watchdog0 = &wwdt0; - accel0 = &mma8652fc; }; chosen { diff --git a/boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi b/boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi index 80399fe2ad3..75d3589ad25 100644 --- a/boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi +++ b/boards/arm/lpcxpresso55s28/lpcxpresso55s28_common.dtsi @@ -13,7 +13,6 @@ led2 = &blue_led; spi-8 = &hs_lspi; usart-0 = &flexcomm0; - accel0 = &mma8652fc; }; leds { @@ -103,7 +102,7 @@ arduino_i2c: &flexcomm4 { pinctrl-0 = <&pinmux_flexcomm4_i2c>; pinctrl-names = "default"; - mma8652fc: mma8652fc@1d { + mma8652fc@1d { compatible = "nxp,fxos8700","nxp,mma8652fc"; reg = <0x1d>; label = "MMA8652FC"; diff --git a/boards/arm/lpcxpresso55s69/Kconfig.defconfig b/boards/arm/lpcxpresso55s69/Kconfig.defconfig index c40b16b719f..3a62fec23cb 100644 --- a/boards/arm/lpcxpresso55s69/Kconfig.defconfig +++ b/boards/arm/lpcxpresso55s69/Kconfig.defconfig @@ -9,8 +9,12 @@ config BOARD default "lpcxpresso55S69_cpu0" if BOARD_LPCXPRESSO55S69_CPU0 default "lpcxpresso55S69_cpu1" if BOARD_LPCXPRESSO55S69_CPU1 +if SENSOR + config I2C - default y if SENSOR + default y + +endif # SENSOR if FXOS8700 diff --git a/boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi b/boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi index 4e876b92450..f5eb0927844 100644 --- a/boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi +++ b/boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi @@ -155,7 +155,7 @@ arduino_i2c: &flexcomm4 { #address-cells = <1>; #size-cells = <0>; - mma8652fc: mma8652fc@1d { + mma8652fc@1d { compatible = "nxp,fxos8700","nxp,mma8652fc"; reg = <0x1d>; label = "MMA8652FC"; diff --git a/boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts b/boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts index 016a85a3246..8dda6e66c05 100644 --- a/boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts +++ b/boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts @@ -28,7 +28,6 @@ pwm-led0 = &red_pwm_led; red-pwm-led = &red_pwm_led; sdhc0 = &sdhc0; - accel0 = &mma8652fc; }; chosen { diff --git a/boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts b/boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts index cdca9f26d5f..ad87af908f0 100644 --- a/boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts +++ b/boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts @@ -22,7 +22,6 @@ sw1 = &user_button_2; sw2 = &user_button_3; watchdog0 = &wwdt0; - accel0 = &mma8652fc; }; chosen { diff --git a/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts b/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts index 6f6ee90956b..668a88be0f3 100644 --- a/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts +++ b/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts @@ -18,7 +18,6 @@ sw0 = &user_button; watchdog0 = &wdog0; magn0 = &fxos8700; - accel0 = &fxos8700; sdhc0 = &usdhc1; }; diff --git a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts index 248cf58f5af..9eaaa61d924 100644 --- a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts +++ b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts @@ -19,7 +19,6 @@ kscan0 = &touch_controller; watchdog0 = &wdog0; magn0 = &fxos8700; - accel0 = &fxos8700; sdhc0 = &usdhc1; }; diff --git a/boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi b/boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi index 3849b426ff7..dad7c59eb88 100644 --- a/boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi +++ b/boards/arm/mimxrt1160_evk/mimxrt1160_evk.dtsi @@ -11,7 +11,6 @@ led0 = &green_led; sw0 = &user_button; magn0 = &fxos8700; - accel0 = &fxos8700; sdhc0 = &usdhc1; }; diff --git a/boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi b/boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi index 2a4e840d3a2..a3b7e3e69bc 100644 --- a/boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi +++ b/boards/arm/mimxrt1170_evk/mimxrt1170_evk.dtsi @@ -11,7 +11,6 @@ led0 = &green_led; sw0 = &user_button; magn0 = &fxos8700; - accel0 = &fxos8700; sdhc0 = &usdhc1; }; diff --git a/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts b/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts index 06b08bf49c5..c4c9424a55f 100644 --- a/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts +++ b/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts @@ -23,7 +23,6 @@ usart-0 = &flexcomm0; watchdog0 = &wwdt0; magn0 = &fxos8700; - accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts b/boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts index 7fa8532ea7b..b7f1a747b9f 100644 --- a/boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts +++ b/boards/arm/mimxrt685_evk/mimxrt685_evk_cm33.dts @@ -31,7 +31,6 @@ red-pwm-led = &red_pwm_led; watchdog0 = &wwdt0; magn0 = &fxos8700; - accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/reel_board/dts/reel_board.dtsi b/boards/arm/reel_board/dts/reel_board.dtsi index 0ed5d04ec4d..a3ee58fd0ee 100644 --- a/boards/arm/reel_board/dts/reel_board.dtsi +++ b/boards/arm/reel_board/dts/reel_board.dtsi @@ -84,7 +84,6 @@ green-pwm-led = &green_pwm_led; blue-pwm-led = &blue_pwm_led; sw0 = &user_button; - accel0 = &mma8642fc; }; }; @@ -125,7 +124,7 @@ arduino_i2c: &i2c0 { pinctrl-0 = <&i2c0_default>; pinctrl-1 = <&i2c0_sleep>; pinctrl-names = "default", "sleep"; - mma8642fc: mma8652fc@1d { + mma8652fc@1d { compatible = "nxp,fxos8700","nxp,mma8652fc"; reg = <0x1d>; label = "MMA8652FC"; diff --git a/boards/arm/twr_ke18f/twr_ke18f.dts b/boards/arm/twr_ke18f/twr_ke18f.dts index 297b9e7acf3..dcb91ac3867 100644 --- a/boards/arm/twr_ke18f/twr_ke18f.dts +++ b/boards/arm/twr_ke18f/twr_ke18f.dts @@ -33,7 +33,6 @@ sw0 = &user_button_3; sw1 = &user_button_2; magn0 = &fxos8700; - accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/twr_kv58f220m/twr_kv58f220m.dts b/boards/arm/twr_kv58f220m/twr_kv58f220m.dts index 8f57587eab3..326d3ed9365 100644 --- a/boards/arm/twr_kv58f220m/twr_kv58f220m.dts +++ b/boards/arm/twr_kv58f220m/twr_kv58f220m.dts @@ -23,7 +23,6 @@ sw2 = &user_button_2; sw3 = &user_button_3; magn0 = &fxos8700; - accel0 = &fxos8700; }; chosen { diff --git a/boards/arm/warp7_m4/warp7_m4.dts b/boards/arm/warp7_m4/warp7_m4.dts index 0aca644aafd..76494d6eda3 100644 --- a/boards/arm/warp7_m4/warp7_m4.dts +++ b/boards/arm/warp7_m4/warp7_m4.dts @@ -16,7 +16,6 @@ aliases { sw0 = &user_switch_1; magn0 = &fxos8700; - accel0 = &fxos8700; }; chosen { diff --git a/boards/riscv/rv32m1_vega/rv32m1_vega.dtsi b/boards/riscv/rv32m1_vega/rv32m1_vega.dtsi index 8568c34b556..0034dc92d63 100644 --- a/boards/riscv/rv32m1_vega/rv32m1_vega.dtsi +++ b/boards/riscv/rv32m1_vega/rv32m1_vega.dtsi @@ -22,7 +22,6 @@ sw2 = &user_button_4; sw3 = &user_button_5; magn0 = &fxos8700; - accel0 = &fxos8700; }; leds { diff --git a/boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay b/boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay index 7e32e2f9658..1d52ed49388 100644 --- a/boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay +++ b/boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay @@ -6,7 +6,6 @@ / { aliases { magn0 = &fxos8700; - accel0 = &fxos8700; }; }; From c77c772cc5073421d8a0478a8eece5d8149bc353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 365/501] Revert "[nrf fromtree] boards: Set devicetree alias for Analog Devices ADXL362 nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5cc24f9d95482ef27371a15f3815dd4ece4d9fdd. Signed-off-by: Andrzej Głąbek --- boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts | 1 - boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 1 - boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay | 8 +------- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts b/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts index 046fda77a3b..580071607b0 100644 --- a/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts +++ b/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts @@ -26,7 +26,6 @@ sensor0 = &sensor0; sensor1 = &sensor1; sensor2 = &sensor2; - accel0 = &sensor1; }; chosen { diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 295b1e982f4..4c0131e766e 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -116,7 +116,6 @@ pwm-led2 = &blue_led_pwm; magn0 = &bmm150; watchdog0 = &wdt0; - accel0 = &adxl362; }; }; diff --git a/boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay b/boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay index 6a0684f6c52..058364c04c0 100644 --- a/boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay +++ b/boards/shields/boostxl_ulpsense/boostxl_ulpsense.overlay @@ -4,15 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/ { - aliases { - accel0 = &adxl362; - }; -}; - &boosterpack_spi { - adxl362: adxl362@0 { + adxl362@0 { compatible = "adi,adxl362"; reg = <0>; spi-max-frequency = <8000000>; From 283cecf62de0066420e06534d0aa0427c6d34cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 366/501] Revert "[nrf fromtree] boards: Set devicetree alias for ST IIS2DLPC nodes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1c41252cb3efe2cc4cc66a96e7766978633bd5e1. Signed-off-by: Andrzej Głąbek --- boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay | 8 +------- .../x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay index c2c3700c234..782a7086119 100644 --- a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay +++ b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1.overlay @@ -13,15 +13,9 @@ * ISM330DHCX, IIS2MDC and IIS2DLPC sensors are accessible from the main board mcu. */ -/ { - aliases { - accel0 = &iis2dlpc; - }; -}; - &arduino_i2c { - iis2dlpc: iis2dlpc@19 { + iis2dlpc@19 { compatible = "st,iis2dlpc"; reg = <0x19>; drdy-gpios = <&arduino_header 4 GPIO_ACTIVE_HIGH>; /* A4 - INT2 */ diff --git a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay index ac33eeeea53..799ceeb12b0 100644 --- a/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay +++ b/boards/shields/x_nucleo_iks02a1/x_nucleo_iks02a1_shub.overlay @@ -15,15 +15,9 @@ * declared in DTS file. */ -/ { - aliases { - accel0 = &iis2dlpc; - }; -}; - &arduino_i2c { - iis2dlpc: iis2dlpc@19 { + iis2dlpc@19 { compatible = "st,iis2dlpc"; reg = <0x19>; drdy-gpios = <&arduino_header 4 GPIO_ACTIVE_HIGH>; /* A4 - INT2 */ From 1ca144c931923676d3ca4ee1fae3e96e0fb8a514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 367/501] Revert "[nrf fromtree] boards: Configure I2C/SPI default for boards with accelerometer" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e04e60266991ca63acd4d599e3e310b8678f3761. Signed-off-by: Andrzej Głąbek --- boards/arm/96b_argonkey/Kconfig.defconfig | 10 ---------- boards/arm/96b_wistrio/Kconfig.defconfig | 3 --- boards/arm/actinius_icarus/Kconfig.defconfig | 7 ------- boards/arm/actinius_icarus_bee/Kconfig.defconfig | 7 ------- boards/arm/actinius_icarus_som/Kconfig.defconfig | 7 ------- boards/arm/b_l4s5i_iot01a/Kconfig.defconfig | 7 ------- .../blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig | 3 --- boards/arm/bt510/Kconfig.defconfig | 3 --- boards/arm/cc1352r_sensortag/Kconfig.defconfig | 3 --- .../arm/circuitdojo_feather_nrf9160/Kconfig.defconfig | 7 ------- boards/arm/decawave_dwm1001_dev/Kconfig.defconfig | 3 --- boards/arm/disco_l475_iot1/Kconfig.defconfig | 7 ------- boards/arm/frdm_kl25z/Kconfig.defconfig | 7 ------- boards/arm/lpcxpresso55s28/Kconfig.defconfig | 7 ------- boards/arm/lpcxpresso55s69/Kconfig.defconfig | 7 ------- boards/arm/nrf9160_innblue21/Kconfig.defconfig | 3 --- boards/arm/nrf9160_innblue22/Kconfig.defconfig | 3 --- boards/arm/rak5010_nrf52840/Kconfig.defconfig | 3 --- .../arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig | 7 ------- boards/arm/stm32l562e_dk/Kconfig.defconfig | 7 ------- boards/shields/boostxl_ulpsense/Kconfig.defconfig | 10 ---------- boards/shields/x_nucleo_iks01a2/Kconfig.defconfig | 10 ---------- boards/shields/x_nucleo_iks02a1/Kconfig.defconfig | 7 ------- 23 files changed, 138 deletions(-) delete mode 100644 boards/shields/boostxl_ulpsense/Kconfig.defconfig delete mode 100644 boards/shields/x_nucleo_iks01a2/Kconfig.defconfig diff --git a/boards/arm/96b_argonkey/Kconfig.defconfig b/boards/arm/96b_argonkey/Kconfig.defconfig index 1a34fcd375d..e9c35748996 100644 --- a/boards/arm/96b_argonkey/Kconfig.defconfig +++ b/boards/arm/96b_argonkey/Kconfig.defconfig @@ -40,14 +40,4 @@ endchoice endif # LSM6DSL -if SENSOR - -config I2C - default y - -config SPI - default y - -endif # SENSOR - endif # BOARD_96B_ARGONKEY diff --git a/boards/arm/96b_wistrio/Kconfig.defconfig b/boards/arm/96b_wistrio/Kconfig.defconfig index 0cf2f9c74b5..0bb9b83220d 100644 --- a/boards/arm/96b_wistrio/Kconfig.defconfig +++ b/boards/arm/96b_wistrio/Kconfig.defconfig @@ -11,7 +11,4 @@ config BOARD config REGULATOR default y if LORA -config I2C - default y if SENSOR - endif # BOARD_96B_WISTRIO diff --git a/boards/arm/actinius_icarus/Kconfig.defconfig b/boards/arm/actinius_icarus/Kconfig.defconfig index a202839ac2c..9d81e1a511a 100644 --- a/boards/arm/actinius_icarus/Kconfig.defconfig +++ b/boards/arm/actinius_icarus/Kconfig.defconfig @@ -8,13 +8,6 @@ if BOARD_ACTINIUS_ICARUS || BOARD_ACTINIUS_ICARUS_NS config BOARD default "actinius_icarus" -if SENSOR - -config I2C - default y - -endif # SENSOR - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/actinius_icarus_bee/Kconfig.defconfig b/boards/arm/actinius_icarus_bee/Kconfig.defconfig index 01d5e9ca6da..40900311774 100644 --- a/boards/arm/actinius_icarus_bee/Kconfig.defconfig +++ b/boards/arm/actinius_icarus_bee/Kconfig.defconfig @@ -8,13 +8,6 @@ if BOARD_ACTINIUS_ICARUS_BEE || BOARD_ACTINIUS_ICARUS_BEE_NS config BOARD default "actinius_icarus_bee" -if SENSOR - -config I2C - default y - -endif # SENSOR - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/actinius_icarus_som/Kconfig.defconfig b/boards/arm/actinius_icarus_som/Kconfig.defconfig index fa1eaf9363a..185d8f0758d 100644 --- a/boards/arm/actinius_icarus_som/Kconfig.defconfig +++ b/boards/arm/actinius_icarus_som/Kconfig.defconfig @@ -8,13 +8,6 @@ if BOARD_ACTINIUS_ICARUS_SOM || BOARD_ACTINIUS_ICARUS_SOM_NS config BOARD default "actinius_icarus_som" -if SENSOR - -config I2C - default y - -endif # SENSOR - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig b/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig index b1ca1c3253e..c46e35d5fc3 100644 --- a/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig +++ b/boards/arm/b_l4s5i_iot01a/Kconfig.defconfig @@ -25,13 +25,6 @@ choice LSM6DSL_TRIGGER_MODE depends on LSM6DSL endchoice -if SENSOR - -config I2C - default y - -endif # SENSOR - if BT config SPI diff --git a/boards/arm/blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig b/boards/arm/blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig index d1d96ca9fb0..dd088779710 100644 --- a/boards/arm/blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig +++ b/boards/arm/blueclover_plt_demo_v2_nrf52832/Kconfig.defconfig @@ -11,7 +11,4 @@ config BOARD config BT_CTLR default BT -config I2C - default SENSOR - endif # BOARD_BLUECLOVER_PLT_DEMO_V2_NRF52832 diff --git a/boards/arm/bt510/Kconfig.defconfig b/boards/arm/bt510/Kconfig.defconfig index c32224b8dd7..576afb00df9 100644 --- a/boards/arm/bt510/Kconfig.defconfig +++ b/boards/arm/bt510/Kconfig.defconfig @@ -15,7 +15,4 @@ config IEEE802154_NRF5 config BT_CTLR default BT -config I2C - default SENSOR - endif # BOARD_BT510 diff --git a/boards/arm/cc1352r_sensortag/Kconfig.defconfig b/boards/arm/cc1352r_sensortag/Kconfig.defconfig index 41bf913bb99..409dd174d27 100644 --- a/boards/arm/cc1352r_sensortag/Kconfig.defconfig +++ b/boards/arm/cc1352r_sensortag/Kconfig.defconfig @@ -9,7 +9,4 @@ if BOARD_CC1352R_SENSORTAG config BOARD default "cc1352r_sensortag" -config SPI - default SENSOR - endif # BOARD_CC1352R_SENSORTAG diff --git a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig index 40e77a236ca..73648be3ef1 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig +++ b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig @@ -9,13 +9,6 @@ if BOARD_CIRCUITDOJO_FEATHER_NRF9160 || BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS config BOARD default "circuitdojo_feather_nrf9160" -if SENSOR - -config I2C - default y - -endif # SENSOR - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/decawave_dwm1001_dev/Kconfig.defconfig b/boards/arm/decawave_dwm1001_dev/Kconfig.defconfig index 825b2d3acff..0279de180ab 100644 --- a/boards/arm/decawave_dwm1001_dev/Kconfig.defconfig +++ b/boards/arm/decawave_dwm1001_dev/Kconfig.defconfig @@ -11,9 +11,6 @@ config BOARD config BT_CTLR default BT -config I2C - default SENSOR - config SPI default y depends on IEEE802154 diff --git a/boards/arm/disco_l475_iot1/Kconfig.defconfig b/boards/arm/disco_l475_iot1/Kconfig.defconfig index fbee69ba336..6c614431b98 100644 --- a/boards/arm/disco_l475_iot1/Kconfig.defconfig +++ b/boards/arm/disco_l475_iot1/Kconfig.defconfig @@ -30,13 +30,6 @@ choice LSM6DSL_TRIGGER_MODE depends on LSM6DSL endchoice -if SENSOR - -config I2C - default y - -endif # SENSOR - if BT config SPI diff --git a/boards/arm/frdm_kl25z/Kconfig.defconfig b/boards/arm/frdm_kl25z/Kconfig.defconfig index b2c4c76fff7..c759787a219 100644 --- a/boards/arm/frdm_kl25z/Kconfig.defconfig +++ b/boards/arm/frdm_kl25z/Kconfig.defconfig @@ -23,13 +23,6 @@ config MCG_FRDIV config MCG_FCRDIV default 0 -if SENSOR - -config I2C - default y - -endif # SENSOR - if FXOS8700 choice FXOS8700_MODE diff --git a/boards/arm/lpcxpresso55s28/Kconfig.defconfig b/boards/arm/lpcxpresso55s28/Kconfig.defconfig index 1df703fc52b..62b78f42eec 100644 --- a/boards/arm/lpcxpresso55s28/Kconfig.defconfig +++ b/boards/arm/lpcxpresso55s28/Kconfig.defconfig @@ -8,13 +8,6 @@ if BOARD_LPCXPRESSO55S28 config BOARD default "lpcxpresso55S28" -if SENSOR - -config I2C - default y - -endif # SENSOR - if FXOS8700 choice FXOS8700_MODE diff --git a/boards/arm/lpcxpresso55s69/Kconfig.defconfig b/boards/arm/lpcxpresso55s69/Kconfig.defconfig index 3a62fec23cb..ff70c42bf43 100644 --- a/boards/arm/lpcxpresso55s69/Kconfig.defconfig +++ b/boards/arm/lpcxpresso55s69/Kconfig.defconfig @@ -9,13 +9,6 @@ config BOARD default "lpcxpresso55S69_cpu0" if BOARD_LPCXPRESSO55S69_CPU0 default "lpcxpresso55S69_cpu1" if BOARD_LPCXPRESSO55S69_CPU1 -if SENSOR - -config I2C - default y - -endif # SENSOR - if FXOS8700 choice FXOS8700_MODE diff --git a/boards/arm/nrf9160_innblue21/Kconfig.defconfig b/boards/arm/nrf9160_innblue21/Kconfig.defconfig index b397824cde3..08d0409c9af 100644 --- a/boards/arm/nrf9160_innblue21/Kconfig.defconfig +++ b/boards/arm/nrf9160_innblue21/Kconfig.defconfig @@ -45,7 +45,4 @@ config BT_HCI_VS config REGULATOR default y if SENSOR -config I2C - default y if SENSOR - endif # BOARD_NRF9160_INNBLUE21 || BOARD_NRF9160_INNBLUE21_NS diff --git a/boards/arm/nrf9160_innblue22/Kconfig.defconfig b/boards/arm/nrf9160_innblue22/Kconfig.defconfig index 5e8b32e30a9..d50bdcc9d97 100644 --- a/boards/arm/nrf9160_innblue22/Kconfig.defconfig +++ b/boards/arm/nrf9160_innblue22/Kconfig.defconfig @@ -45,7 +45,4 @@ config BT_HCI_VS config REGULATOR default y if SENSOR -config I2C - default y if SENSOR - endif # BOARD_NRF9160_INNBLUE22 || BOARD_NRF9160_INNBLUE22_NS diff --git a/boards/arm/rak5010_nrf52840/Kconfig.defconfig b/boards/arm/rak5010_nrf52840/Kconfig.defconfig index cea7af6facc..502e1d8b7f6 100644 --- a/boards/arm/rak5010_nrf52840/Kconfig.defconfig +++ b/boards/arm/rak5010_nrf52840/Kconfig.defconfig @@ -14,7 +14,4 @@ config MODEM_QUECTEL_BG9X config BT_CTLR default BT -config I2C - default SENSOR - endif # BOARD_RAK5010_NRF52840 diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig index 824ad975cce..8ae5b832d89 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig +++ b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig @@ -26,13 +26,6 @@ config FLASH_LOAD_SIZE default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) depends on BOARD_SPARKFUN_THING_PLUS_NRF9160 && TRUSTED_EXECUTION_SECURE -if SENSOR - -config I2C - default y - -endif # SENSOR - if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS config FLASH_LOAD_OFFSET diff --git a/boards/arm/stm32l562e_dk/Kconfig.defconfig b/boards/arm/stm32l562e_dk/Kconfig.defconfig index 650a8d7524e..a5f146d51e2 100644 --- a/boards/arm/stm32l562e_dk/Kconfig.defconfig +++ b/boards/arm/stm32l562e_dk/Kconfig.defconfig @@ -13,13 +13,6 @@ choice STM32_LPTIM_CLOCK depends on STM32_LPTIM_TIMER endchoice -if SENSOR - -config I2C - default y - -endif # SENSOR - if BT config SPI diff --git a/boards/shields/boostxl_ulpsense/Kconfig.defconfig b/boards/shields/boostxl_ulpsense/Kconfig.defconfig deleted file mode 100644 index 520ea7c896a..00000000000 --- a/boards/shields/boostxl_ulpsense/Kconfig.defconfig +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2022 TOKITA Hiroshi -# -# SPDX-License-Identifier: Apache-2.0 - -if SHIELD_BOOSTXL_ULPSENSE - -config SPI - default y if SENSOR - -endif # SHIELD_BOOSTXL_ULPSENSE diff --git a/boards/shields/x_nucleo_iks01a2/Kconfig.defconfig b/boards/shields/x_nucleo_iks01a2/Kconfig.defconfig deleted file mode 100644 index 006a8d64ecf..00000000000 --- a/boards/shields/x_nucleo_iks01a2/Kconfig.defconfig +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2022 TOKITA Hiroshi -# -# SPDX-License-Identifier: Apache-2.0 - -if SHIELD_X_NUCLEO_IKS01A2 - -config I2C - default y if SENSOR - -endif # SHIELD_X_NUCLEO_IKS01A2 diff --git a/boards/shields/x_nucleo_iks02a1/Kconfig.defconfig b/boards/shields/x_nucleo_iks02a1/Kconfig.defconfig index ce1897f0a42..49309d9adff 100644 --- a/boards/shields/x_nucleo_iks02a1/Kconfig.defconfig +++ b/boards/shields/x_nucleo_iks02a1/Kconfig.defconfig @@ -2,11 +2,4 @@ # # SPDX-License-Identifier: Apache-2.0 -if SHIELD_X_NUCLEO_IKS02A1 - -config I2C - default y if SENSOR - -endif # SHIELD_X_NUCLEO_IKS02A1 - rsource "boards/*.defconfig" From 0c4cb90d2adaba3cb78b29d8f9f00aa28fd38ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 368/501] Revert "[nrf fromlist] net: lwm2m: Fix to Queue update process triggering" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e807e4745725cc5a13ed245a7e00f90b0788c39b. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 0ba5429ae29..130c9d69e08 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -1010,7 +1010,9 @@ static int sm_registration_done(void) ((client.lifetime - SECONDS_TO_UPDATE_EARLY) <= (k_uptime_get() - client.last_update) / 1000))) { set_sm_state(ENGINE_UPDATE_REGISTRATION); - } else if (IS_ENABLED(CONFIG_LWM2M_QUEUE_MODE_ENABLED) && + } + + if (IS_ENABLED(CONFIG_LWM2M_QUEUE_MODE_ENABLED) && (client.engine_state != ENGINE_REGISTRATION_DONE_RX_OFF) && (((k_uptime_get() - client.last_tx) / 1000) >= CONFIG_LWM2M_QUEUE_MODE_UPTIME)) { From 238733e78b6bc31eace4fa679024e1648fb62cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 369/501] Revert "[nrf fromtree] net: lwm2m: Fix Update registration issue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3509cf90d0a1ef6287dcf623a686bea19eb342a3. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 97 +++++++++++--------------- 1 file changed, 40 insertions(+), 57 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 130c9d69e08..6aa4658a23e 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -73,7 +73,6 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define CLIENT_QUEUE_LEN sizeof("Q") static void sm_handle_registration_update_failure(void); -static int sm_send_registration_msg(void); /* The states for the RD client state machine */ /* @@ -91,7 +90,6 @@ enum sm_engine_state { ENGINE_BOOTSTRAP_TRANS_DONE, #endif ENGINE_DO_REGISTRATION, - ENGINE_SEND_REGISTRATION, ENGINE_REGISTRATION_SENT, ENGINE_REGISTRATION_DONE, ENGINE_REGISTRATION_DONE_RX_OFF, @@ -923,76 +921,66 @@ static int sm_send_registration(bool send_obj_support_data, } static void sm_handle_registration_update_failure(void) -{ - LOG_WRN("Registration Update fail -> trigger full registration"); - client.engine_state = ENGINE_SEND_REGISTRATION; -} - -static int sm_send_registration_msg(void) { int ret; - ret = sm_send_registration(true, - do_registration_reply_cb, - do_registration_timeout_cb); + LOG_WRN("Registration Update fail -> trigger full registration"); + client.engine_state = ENGINE_DO_REGISTRATION; + ret = sm_send_registration(true, do_registration_reply_cb, do_registration_timeout_cb); if (!ret) { set_sm_state(ENGINE_REGISTRATION_SENT); } else { LOG_ERR("Registration err: %d", ret); set_sm_state(ENGINE_NETWORK_ERROR); } - - return ret; } static int sm_do_registration(void) { int ret = 0; - if (client.ctx->connection_suspended) { - if (lwm2m_engine_connection_resume(client.ctx)) { - lwm2m_engine_context_close(client.ctx); - /* perform full registration */ - set_sm_state(ENGINE_DO_REGISTRATION); - return 0; - } - - } else { - /* clear out existing connection data */ - if (client.ctx->sock_fd > -1) { - lwm2m_engine_context_close(client.ctx); - } + /* clear out existing connection data */ + if (client.ctx->sock_fd > -1) { + lwm2m_engine_stop(client.ctx); + } - client.ctx->bootstrap_mode = false; - ret = sm_select_security_inst(client.ctx->bootstrap_mode, - &client.ctx->sec_obj_inst); - if (ret < 0) { - LOG_ERR("Unable to find a valid security instance."); - set_sm_state(ENGINE_INIT); - return -EINVAL; - } + client.ctx->bootstrap_mode = false; + ret = sm_select_security_inst(client.ctx->bootstrap_mode, + &client.ctx->sec_obj_inst); + if (ret < 0) { + LOG_ERR("Unable to find a valid security instance."); + set_sm_state(ENGINE_INIT); + return -EINVAL; + } - ret = sm_select_server_inst(client.ctx->sec_obj_inst, - &client.ctx->srv_obj_inst, - &client.lifetime); - if (ret < 0) { - LOG_ERR("Unable to find a valid server instance."); - set_sm_state(ENGINE_INIT); - return -EINVAL; - } + ret = sm_select_server_inst(client.ctx->sec_obj_inst, + &client.ctx->srv_obj_inst, + &client.lifetime); + if (ret < 0) { + LOG_ERR("Unable to find a valid server instance."); + set_sm_state(ENGINE_INIT); + return -EINVAL; + } - LOG_INF("RD Client started with endpoint '%s' with client lifetime %d", - client.ep_name, client.lifetime); + LOG_INF("RD Client started with endpoint '%s' with client lifetime %d", + client.ep_name, client.lifetime); - ret = lwm2m_engine_start(client.ctx); - if (ret < 0) { - LOG_ERR("Cannot init LWM2M engine (%d)", ret); - set_sm_state(ENGINE_NETWORK_ERROR); - return ret; - } + ret = lwm2m_engine_start(client.ctx); + if (ret < 0) { + LOG_ERR("Cannot init LWM2M engine (%d)", ret); + set_sm_state(ENGINE_NETWORK_ERROR); + return ret; } - ret = sm_send_registration_msg(); + ret = sm_send_registration(true, + do_registration_reply_cb, + do_registration_timeout_cb); + if (!ret) { + set_sm_state(ENGINE_REGISTRATION_SENT); + } else { + LOG_ERR("Registration err: %d", ret); + set_sm_state(ENGINE_NETWORK_ERROR); + } return ret; } @@ -1198,10 +1186,6 @@ static void lwm2m_rd_client_service(struct k_work *work) sm_do_registration(); break; - case ENGINE_SEND_REGISTRATION: - sm_send_registration_msg(); - break; - case ENGINE_REGISTRATION_SENT: /* wait registration to be done or timeout */ break; @@ -1412,14 +1396,13 @@ int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx) */ if (IS_ENABLED(CONFIG_LWM2M_TLS_SESSION_CACHING)) { client.engine_state = ENGINE_REGISTRATION_DONE; - client.trigger_update = true; } else { client.engine_state = ENGINE_DO_REGISTRATION; } #else client.engine_state = ENGINE_REGISTRATION_DONE; - client.trigger_update = true; #endif + client.trigger_update = true; } return 0; From c894f9f92497406d3ad5a54c8adee95dc57f12f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 370/501] Revert "[nrf fromtree] net: lwm2m: Fix Queued data buffer send at wakeup from idle" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f7485eb5471a157f07286d4fa2dfa3a598f8c5f1. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/lwm2m/lwm2m_engine.c | 1 + subsys/net/lib/lwm2m/lwm2m_rd_client.c | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index ab2b12d60f1..c81db1f5e79 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -936,6 +936,7 @@ int lwm2m_engine_start(struct lwm2m_ctx *client_ctx) return ret; } + lwm2m_engine_context_init(client_ctx); return lwm2m_socket_start(client_ctx); } diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 6aa4658a23e..4f3717b7794 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -1252,9 +1252,6 @@ int lwm2m_rd_client_start(struct lwm2m_ctx *client_ctx, const char *ep_name, return -EINPROGRESS; } - /* Init Context */ - lwm2m_engine_context_init(client_ctx); - client.ctx = client_ctx; client.ctx->sock_fd = -1; client.ctx->fault_cb = socket_fault_cb; From c8b73af312078415a0d225157ba0c9c594fbf6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 371/501] Revert "[nrf fromtree] doc: kconfig: add option to select number of results per page" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 053c9f6eecfb445b0419af92dbbf97b660237494. Signed-off-by: Andrzej Głąbek --- .../zephyr/kconfig/static/kconfig.css | 18 +----- .../zephyr/kconfig/static/kconfig.mjs | 63 ++++--------------- 2 files changed, 13 insertions(+), 68 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/static/kconfig.css b/doc/_extensions/zephyr/kconfig/static/kconfig.css index f5a1d165307..1d78c2ef45a 100644 --- a/doc/_extensions/zephyr/kconfig/static/kconfig.css +++ b/doc/_extensions/zephyr/kconfig/static/kconfig.css @@ -15,26 +15,10 @@ width: 100%; } -#__kconfig-search select { - border-radius: 5px; - border: 1px solid rgba(149, 157, 165, 0.2); - box-shadow: unset; -} - -#__kconfig-search .search-tools { - display: flex; - flex-direction: row; +#__kconfig-search .search-summary { margin: 0.25rem 0.1rem 1.5rem; } -#__kconfig-search .results-per-page-container { - margin-left: auto; -} - -#__kconfig-search .results-per-page-title { - padding-right: 1rem; -} - #__kconfig-search .search-nav { display: flex; justify-content: center; diff --git a/doc/_extensions/zephyr/kconfig/static/kconfig.mjs b/doc/_extensions/zephyr/kconfig/static/kconfig.mjs index 0875d52b729..7c1d7df5985 100644 --- a/doc/_extensions/zephyr/kconfig/static/kconfig.mjs +++ b/doc/_extensions/zephyr/kconfig/static/kconfig.mjs @@ -4,16 +4,14 @@ */ const DB_FILE = 'kconfig.json'; -const RESULTS_PER_PAGE_OPTIONS = [10, 25, 50]; +const MAX_RESULTS = 10; /* search state */ let db; let searchOffset; -let maxResults = RESULTS_PER_PAGE_OPTIONS[0]; /* elements */ let input; -let searchTools; let summaryText; let results; let navigation; @@ -284,9 +282,9 @@ function doSearch() { /* nothing to search for */ if (!input.value) { + summaryText.nodeValue = ''; results.replaceChildren(); navigation.style.visibility = 'hidden'; - searchTools.style.visibility = 'hidden'; return; } @@ -309,7 +307,7 @@ function doSearch() { if (matches === regexes.length) { count++; - if (count > searchOffset && count <= (searchOffset + maxResults)) { + if (count > searchOffset && count <= (searchOffset + MAX_RESULTS)) { return true; } } @@ -317,17 +315,16 @@ function doSearch() { return false; }); - /* show results count and search tools */ + /* show results count */ summaryText.nodeValue = `${count} options match your search.`; - searchTools.style.visibility = 'visible'; /* update navigation */ navigation.style.visibility = 'visible'; - navigationPrev.disabled = searchOffset - maxResults < 0; - navigationNext.disabled = searchOffset + maxResults > count; + navigationPrev.disabled = searchOffset - MAX_RESULTS < 0; + navigationNext.disabled = searchOffset + MAX_RESULTS > count; - const currentPage = Math.floor(searchOffset / maxResults) + 1; - const totalPages = Math.floor(count / maxResults) + 1; + const currentPage = Math.floor(searchOffset / MAX_RESULTS) + 1; + const totalPages = Math.floor(count / MAX_RESULTS) + 1; navigationPagesText.nodeValue = `Page ${currentPage} of ${totalPages}`; /* render Kconfig entries */ @@ -365,50 +362,14 @@ function setupKconfigSearch() { input.type = 'text'; container.appendChild(input); - /* create search tools container */ - searchTools = document.createElement('div'); - searchTools.className = 'search-tools'; - searchTools.style.visibility = 'hidden'; - container.appendChild(searchTools); - /* create search summary */ - const searchSummaryContainer = document.createElement('div'); - searchTools.appendChild(searchSummaryContainer); - const searchSummary = document.createElement('p'); - searchSummaryContainer.appendChild(searchSummary); + searchSummary.className = 'search-summary'; + container.appendChild(searchSummary); summaryText = document.createTextNode(''); searchSummary.appendChild(summaryText); - /* create results per page selector */ - const resultsPerPageContainer = document.createElement('div'); - resultsPerPageContainer.className = 'results-per-page-container'; - searchTools.appendChild(resultsPerPageContainer); - - const resultsPerPageTitle = document.createElement('span'); - resultsPerPageTitle.className = 'results-per-page-title'; - resultsPerPageContainer.appendChild(resultsPerPageTitle); - - const resultsPerPageTitleText = document.createTextNode('Results per page:'); - resultsPerPageTitle.appendChild(resultsPerPageTitleText); - - const resultsPerPageSelect = document.createElement('select'); - resultsPerPageSelect.onchange = (event) => { - maxResults = parseInt(event.target.value); - searchOffset = 0; - doSearch(); - } - resultsPerPageContainer.appendChild(resultsPerPageSelect); - - RESULTS_PER_PAGE_OPTIONS.forEach((value, index) => { - const option = document.createElement('option'); - option.value = value; - option.text = value; - option.selected = index === 0; - resultsPerPageSelect.appendChild(option); - }); - /* create search results container */ results = document.createElement('div'); container.appendChild(results); @@ -423,7 +384,7 @@ function setupKconfigSearch() { navigationPrev.className = 'btn'; navigationPrev.disabled = true; navigationPrev.onclick = () => { - searchOffset -= maxResults; + searchOffset -= MAX_RESULTS; doSearch(); window.scroll(0, 0); } @@ -442,7 +403,7 @@ function setupKconfigSearch() { navigationNext.className = 'btn'; navigationNext.disabled = true; navigationNext.onclick = () => { - searchOffset += maxResults; + searchOffset += MAX_RESULTS; doSearch(); window.scroll(0, 0); } From 01e8a5abfb87a9b0d01df9079a86306e4843b319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 372/501] Revert "[nrf fromtree] bluetooth: gatt: Fix value returned by db_hash_commit" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7d6313cd6163f4dc1fc04da24bfdfc1b97e708a3. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/gatt.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index fd9861f8e3f..eacb520bae2 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -5826,28 +5826,16 @@ static int db_hash_set(const char *name, size_t len_rd, static int db_hash_commit(void) { - int err; - atomic_set_bit(gatt_sc.flags, DB_HASH_LOAD); /* Reschedule work to calculate and compare against the Hash value * loaded from flash. */ if (IS_ENABLED(CONFIG_BT_LONG_WQ)) { - err = bt_long_wq_reschedule(&db_hash.work, K_NO_WAIT); + return bt_long_wq_reschedule(&db_hash.work, K_NO_WAIT); } else { - err = k_work_reschedule(&db_hash.work, K_NO_WAIT); - } - - /* Settings commit uses non-zero value to indicate failure. */ - if (err > 0) { - err = 0; + return k_work_reschedule(&db_hash.work, K_NO_WAIT); } - if (err) { - BT_ERR("Unable to reschedule database hash process (err %d)", err); - } - - return err; } SETTINGS_STATIC_HANDLER_DEFINE(bt_hash, "bt/hash", NULL, db_hash_set, From e107304908d988175ca1245b7a3c58dee85554f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 373/501] Revert "[nrf fromtree] fs: fat_fs: Changing mkfs options to create FAT32 on larger storage" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit de407aa23b3fb98b2230de82ebf5e57a5a0f5cc9. Signed-off-by: Andrzej Głąbek --- subsys/fs/fat_fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/fs/fat_fs.c b/subsys/fs/fat_fs.c index 67ee297c697..41ab9b3bbb4 100644 --- a/subsys/fs/fat_fs.c +++ b/subsys/fs/fat_fs.c @@ -426,7 +426,7 @@ static int fatfs_mount(struct fs_mount_t *mountp) (mountp->flags & FS_MOUNT_FLAG_NO_FORMAT) == 0) { uint8_t work[FF_MAX_SS]; MKFS_PARM mkfs_opt = { - .fmt = FM_ANY | FM_SFD, /* Any suitable FAT */ + .fmt = FM_FAT | FM_SFD, /* Any suitable FAT */ .n_fat = 1, /* One FAT fs table */ .align = 0, /* Get sector size via diskio query */ .n_root = CONFIG_FS_FATFS_MAX_ROOT_ENTRIES, From 13727f5300e089acfe74a0cde019ae2fe9da7fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 374/501] Revert "[nrf fromtree] net: lwm2m: Try to reuse registration in case of a network error" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 049ddd4865381287e374c423a0873c7ec01f9d04. Signed-off-by: Andrzej Głąbek --- .../api/images/lwm2m_engine_state_machine.png | Bin 139424 -> 110577 bytes subsys/net/lib/lwm2m/lwm2m_rd_client.c | 121 +++++------------- 2 files changed, 33 insertions(+), 88 deletions(-) diff --git a/doc/connectivity/networking/api/images/lwm2m_engine_state_machine.png b/doc/connectivity/networking/api/images/lwm2m_engine_state_machine.png index 92c844a5549ec4def374c678da3e54e6682a7dda..b219717d9b15f3a99079f8dc808188138a36670f 100644 GIT binary patch literal 110577 zcmeFYc{r49_&+SEsDu_RB(k-N8MB3AhFQ#*F*BAy39}osm>FYcWNV{BO1miSdn#$6 zQX~p#k$s8w2rX1f?{!np^Zovw-@ots*LxguFf;eu*L_{*buORtbDq~`Un;?H;+%;( zIy#0Vq9;Q~XKa&>j&7U&c<_yXzwj0KH%7rAV0F&dn7`A}G5VzRVkyOHo-m55V++TP zzO#in3Zx39E!@)<1`C(T95}*ozC2v4aFB47;45%lEaeD!LM~_YH!w#SY^ft+sT17K z5n&7WKsZ5voE=~YMDXbE!}(mvp8*jLj$nWVfkFvK8mj@N_%^j>_!Pg7OL_Z&jEer?VM+rq-@Q=V{i=@ykIDuR$ z2H)VF9Gx5-9h@-;CkHSp%#j(+3zrN3$1u=pxXN(;=t{8CU`6V&|pw-Cv>w?Bjb*K%i*eoZ17N+E!+zT^N-ZPPbA@BE+f+P1%g=W zG1^LLw8! z))MeuUK9}*1w;U+fuAxdm>AC}bPNp@fpiX3Vg!T;K8A!5v3(;YQV$O=ktf0f1LTek zQbz=1MIs8zm!}A(!Ti{?NOY_sDl&k=jFAK@@H9G7AP}OY5x!)qlROBG@CZOCWj=5; zPX+D{bk?G1;k=kgiiAlJI4ix>tO%l$8b$QP`bvXD5lj@CAFM@?Boarumt%~|TOO!I ziG7`%P#Rwk42n!aYN%9EER)0G2XW-iz8oJfwbscQ8R)}Si+GesN0rD?#UsO`1ZcPu z3+u%4Bm1f-IA$c9?}d&=Mu_+@g_kQt~s;C*CVD%05)T*33GDn~7uj^GB9d>EdhC@EhR3zKu` zB9;e};^&E>(WO8xSb;!I)I`&?J~(d-1s$pKVhX@Gjv_D`)`#x|DHdB93HR6f2S*`b zV(`(E$Rg8Y$?WJT4=`8|CPppvj%9gsq*QMfBq}t?+mY)_j`W1ojRqqG_!6WrHc8H< zVSLzJg#^b$bI23{(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pE_MyZYem#;tDIOACE!<$Y{PS-enAZ~n@hJDT%nU7IbRTY60 z3RASV%i4QWbbN%#`wy}A)+(+>1#RZOQy4ilJ?A#BDk}z zIcFuE7H3)_mBz-SXuGRcs|T=kPMRj%U!{Xc7)4_=6sKItLN_?bH~t4uxQQPfuGiFb zU@Gg?BbZ#aPjUV7H-PA5O;3%bwCPl= zG1s$#p0`1r5*C+9_av42vUPj;R%!~@EOMLoq4;PVt$R@YTf?pNB|Kqkihg+et0|CJ zO8e+0F~7w;-G!*P3-S-QUg^7q9rPL}3h15+Jpby#!os99D5?2C8S651v)s^?7Ce3Y z_*!SgTU90N1nD{JE-RBmcJ%i!?o{bZQvnkIn$!!AM#WrtyJ#kr^*pCTp>KANOOooW zoTK8|n#{W4_|$YV96$v}yH%^=VzCp+@lBVI6XjtPkYp8XyL9QX6}Gm@PNc^3MfR{M z3P#`6o=Pb*1&{+jB)flL^SDQ>f#-P{`a{f(3)VU~K*NU$d73nKzS8uy_GQlRYuJRB00TYZk(wBYu`Vv$=!o8{RFV(=H?jNsm74`*@61fgAK9hvStv^<+0wj>wF(+tS@&siE#Qz&*QGjo%!HrM6cS5E!;QFP%P z_jw7L9a5bwuNy#g^X&Da4RXlEK5V8(yis4-ockQIlh~td!r@aRUn`J`BwMf2I?_#E zFWdSh6>xt{^ok$**&7th#NUoZq%kVjOukKCKW=>DXx~M1xA+6vnyKF=O%|6dpS6f& zopJu9qlNiay*<%^4Bf3-*4gcy3i=T2xc=>Dy@TlNLX8aG>yU>UL diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 4f3717b7794..3864d212301 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -93,7 +93,6 @@ enum sm_engine_state { ENGINE_REGISTRATION_SENT, ENGINE_REGISTRATION_DONE, ENGINE_REGISTRATION_DONE_RX_OFF, - ENGINE_UPDATE_REGISTRATION, ENGINE_UPDATE_SENT, ENGINE_SUSPENDED, ENGINE_DEREGISTER, @@ -184,7 +183,7 @@ static void set_sm_state(uint8_t sm_state) client.engine_state <= ENGINE_DEREGISTER_SENT)) { event = LWM2M_RD_CLIENT_EVENT_DISCONNECT; } else if (sm_state == ENGINE_NETWORK_ERROR) { - lwm2m_socket_close(client.ctx); + lwm2m_engine_stop(client.ctx); client.retry_delay = 1 << client.retries; client.retries++; if (client.retries > CONFIG_LWM2M_RD_CLIENT_MAX_RETRIES) { @@ -210,16 +209,6 @@ static void set_sm_state(uint8_t sm_state) } } -static bool sm_is_bootstrap(void) -{ -#if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) - return (client.engine_state >= ENGINE_DO_BOOTSTRAP_REG && - client.engine_state <= ENGINE_BOOTSTRAP_TRANS_DONE); -#else - return false; -#endif -} - static bool sm_is_registered(void) { return (client.engine_state >= ENGINE_REGISTRATION_DONE && @@ -292,15 +281,15 @@ static void socket_fault_cb(int error) { LOG_ERR("RD Client socket error: %d", error); - if (sm_is_bootstrap()) { - client.ctx->sec_obj_inst = -1; - /* force full registration */ - client.last_update = 0; - } + lwm2m_engine_stop(client.ctx); - lwm2m_socket_close(client.ctx); + client.ctx->sec_obj_inst = -1; - set_sm_state(ENGINE_NETWORK_ERROR); + /* Jump directly to the registration phase. In case there is no valid + * security object for the LWM2M server, it will fall back to the + * bootstrap procedure. + */ + set_sm_state(ENGINE_DO_REGISTRATION); } /* force re-update with remote peer */ @@ -988,6 +977,7 @@ static int sm_do_registration(void) static int sm_registration_done(void) { int ret = 0; + bool update_objects; /* * check for lifetime seconds - SECONDS_TO_UPDATE_EARLY @@ -997,7 +987,29 @@ static int sm_registration_done(void) (client.trigger_update || ((client.lifetime - SECONDS_TO_UPDATE_EARLY) <= (k_uptime_get() - client.last_update) / 1000))) { - set_sm_state(ENGINE_UPDATE_REGISTRATION); + update_objects = client.update_objects; + client.trigger_update = false; + client.update_objects = false; + + ret = lwm2m_engine_connection_resume(client.ctx); + if (ret) { + lwm2m_engine_stop(client.ctx); + /* perform full registration */ + set_sm_state(ENGINE_DO_REGISTRATION); + return ret; + } + + ret = sm_send_registration(update_objects, + do_update_reply_cb, + do_update_timeout_cb); + if (!ret) { + set_sm_state(ENGINE_UPDATE_SENT); + } else { + LOG_ERR("Registration update err: %d", ret); + lwm2m_engine_stop(client.ctx); + /* perform full registration */ + set_sm_state(ENGINE_DO_REGISTRATION); + } } if (IS_ENABLED(CONFIG_LWM2M_QUEUE_MODE_ENABLED) && @@ -1010,50 +1022,6 @@ static int sm_registration_done(void) return ret; } -static int update_registration(void) -{ - int ret; - bool update_objects; - - update_objects = client.update_objects; - client.trigger_update = false; - client.update_objects = false; - - ret = lwm2m_engine_connection_resume(client.ctx); - if (ret) { - return ret; - } - - ret = sm_send_registration(update_objects, - do_update_reply_cb, - do_update_timeout_cb); - if (ret) { - LOG_ERR("Registration update err: %d", ret); - return ret; - } - - return 0; -} - -static int sm_update_registration(void) -{ - int ret; - - ret = update_registration(); - if (ret) { - LOG_ERR("Failed to update registration. Falling back to full registration"); - - lwm2m_engine_stop(client.ctx); - /* perform full registration */ - set_sm_state(ENGINE_DO_REGISTRATION); - return ret; - } - - set_sm_state(ENGINE_UPDATE_SENT); - - return 0; -} - static int sm_do_deregister(void) { struct lwm2m_message *msg; @@ -1112,8 +1080,6 @@ static int sm_do_deregister(void) static void sm_do_network_error(void) { - int err; - if (--client.retry_delay > 0) { return; } @@ -1125,24 +1091,7 @@ static void sm_do_network_error(void) } #endif - if (!client.last_update || (k_uptime_get() - client.last_update) / 1000 > client.lifetime) { - /* do full registration as there is no active registration or lifetime exceeded */ - set_sm_state(ENGINE_DO_REGISTRATION); - return; - } - - err = lwm2m_socket_start(client.ctx); - if (err) { - LOG_ERR("Failed to start socket %d", err); - /* - * keep this state until lifetime/retry count exceeds. Renew - * sm state to set retry_delay etc ... - */ - set_sm_state(ENGINE_NETWORK_ERROR); - return; - } - - set_sm_state(ENGINE_UPDATE_REGISTRATION); + set_sm_state(ENGINE_DO_REGISTRATION); } static void lwm2m_rd_client_service(struct k_work *work) @@ -1195,10 +1144,6 @@ static void lwm2m_rd_client_service(struct k_work *work) sm_registration_done(); break; - case ENGINE_UPDATE_REGISTRATION: - sm_update_registration(); - break; - case ENGINE_UPDATE_SENT: /* wait update to be done or abort */ break; From 9fd2d4eaceac140e0b564456cbf1599027172667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 375/501] Revert "[nrf fromtree] net: lwm2m: separate closing context from closing socket" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e54a684013d1fe781d005608f067e747c90970f8. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/lwm2m.h | 13 ---------- subsys/net/lib/lwm2m/lwm2m_engine.c | 24 ++----------------- subsys/net/lib/lwm2m/lwm2m_engine.h | 3 +-- subsys/net/lib/lwm2m/lwm2m_message_handling.c | 10 +++++++- subsys/net/lib/lwm2m/lwm2m_pull_context.c | 2 +- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 24 +++++++++---------- 6 files changed, 25 insertions(+), 51 deletions(-) diff --git a/include/zephyr/net/lwm2m.h b/include/zephyr/net/lwm2m.h index 0d3c7bacde5..ee071985e1b 100644 --- a/include/zephyr/net/lwm2m.h +++ b/include/zephyr/net/lwm2m.h @@ -1185,19 +1185,6 @@ int lwm2m_update_device_service_period(uint32_t period_ms); */ bool lwm2m_engine_path_is_observed(const char *pathstr); -/** - * @brief Stop the LwM2M engine - * - * LwM2M clients normally do not need to call this function as it is called - * within lwm2m_rd_client. However, if the client does not use the RD - * client implementation, it will need to be called manually. - * - * @param[in] client_ctx LwM2M context - * - * @return 0 for success or negative in case of error. - */ -int lwm2m_engine_stop(struct lwm2m_ctx *client_ctx); - /** * @brief Start the LwM2M engine * diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index c81db1f5e79..b6cadb13dac 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -862,7 +862,7 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) } else if ((client_ctx->remote_addr).sa_family == AF_INET6) { addr_len = sizeof(struct sockaddr_in6); } else { - lwm2m_engine_stop(client_ctx); + lwm2m_engine_context_close(client_ctx); return -EPROTONOSUPPORT; } @@ -891,28 +891,8 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) } return 0; error: - lwm2m_engine_stop(client_ctx); - return ret; -} - -int lwm2m_socket_close(struct lwm2m_ctx *client_ctx) -{ - int sock_fd = client_ctx->sock_fd; - - lwm2m_socket_del(client_ctx); - client_ctx->sock_fd = -1; - if (sock_fd >= 0) { - return close(sock_fd); - } - - return 0; -} - -int lwm2m_engine_stop(struct lwm2m_ctx *client_ctx) -{ lwm2m_engine_context_close(client_ctx); - - return lwm2m_socket_close(client_ctx); + return ret; } int lwm2m_engine_start(struct lwm2m_ctx *client_ctx) diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.h b/subsys/net/lib/lwm2m/lwm2m_engine.h index 427af9598d5..02ae3dc0326 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.h +++ b/subsys/net/lib/lwm2m/lwm2m_engine.h @@ -38,7 +38,7 @@ int lwm2m_engine_validate_write_access(struct lwm2m_message *msg, struct lwm2m_engine_obj_field **obj_field); /* LwM2M context functions */ -void lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx); +int lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx); void lwm2m_engine_context_init(struct lwm2m_ctx *client_ctx); /* Message buffer functions */ @@ -82,7 +82,6 @@ uint8_t lwm2m_firmware_get_update_result(void); /* Network Layer */ int lwm2m_socket_add(struct lwm2m_ctx *ctx); void lwm2m_socket_del(struct lwm2m_ctx *ctx); -int lwm2m_socket_close(struct lwm2m_ctx *client_ctx); int lwm2m_socket_start(struct lwm2m_ctx *client_ctx); int lwm2m_engine_connection_resume(struct lwm2m_ctx *client_ctx); int lwm2m_open_socket(struct lwm2m_ctx *client_ctx); diff --git a/subsys/net/lib/lwm2m/lwm2m_message_handling.c b/subsys/net/lib/lwm2m/lwm2m_message_handling.c index a1511e645e1..4d1d02f37c9 100644 --- a/subsys/net/lib/lwm2m/lwm2m_message_handling.c +++ b/subsys/net/lib/lwm2m/lwm2m_message_handling.c @@ -172,8 +172,9 @@ static void free_block_ctx(struct lwm2m_block_context *ctx) ctx->tkl = 0U; } -void lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx) +int lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx) { + int sock_fd = client_ctx->sock_fd; struct lwm2m_message *msg; sys_snode_t *obs_node; struct observe_node *obs; @@ -200,6 +201,13 @@ void lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx) #if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) client_ctx->buffer_client_messages = true; #endif + lwm2m_socket_del(client_ctx); + client_ctx->sock_fd = -1; + if (sock_fd >= 0) { + return close(sock_fd); + } else { + return 0; + } } void lwm2m_engine_context_init(struct lwm2m_ctx *client_ctx) diff --git a/subsys/net/lib/lwm2m/lwm2m_pull_context.c b/subsys/net/lib/lwm2m/lwm2m_pull_context.c index 1d663eb6125..f4879ce181a 100644 --- a/subsys/net/lib/lwm2m/lwm2m_pull_context.c +++ b/subsys/net/lib/lwm2m/lwm2m_pull_context.c @@ -54,7 +54,7 @@ static void do_transmit_timeout_cb(struct lwm2m_message *msg); */ static void cleanup_context(void) { - lwm2m_engine_stop(&context.firmware_ctx); + lwm2m_engine_context_close(&context.firmware_ctx); k_sem_give(&lwm2m_pull_sem); } diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index 3864d212301..c3346186594 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -183,7 +183,7 @@ static void set_sm_state(uint8_t sm_state) client.engine_state <= ENGINE_DEREGISTER_SENT)) { event = LWM2M_RD_CLIENT_EVENT_DISCONNECT; } else if (sm_state == ENGINE_NETWORK_ERROR) { - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); client.retry_delay = 1 << client.retries; client.retries++; if (client.retries > CONFIG_LWM2M_RD_CLIENT_MAX_RETRIES) { @@ -268,7 +268,7 @@ static void sm_handle_failure_state(enum sm_engine_state sm_state) event = LWM2M_RD_CLIENT_EVENT_DEREGISTER_FAILURE; } - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); set_sm_state(sm_state); if (event > LWM2M_RD_CLIENT_EVENT_NONE && client.ctx->event_cb) { @@ -281,7 +281,7 @@ static void socket_fault_cb(int error) { LOG_ERR("RD Client socket error: %d", error); - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); client.ctx->sec_obj_inst = -1; @@ -621,7 +621,7 @@ static int sm_select_security_inst(bool bootstrap_server, int *sec_obj_inst) static int sm_do_init(void) { - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); client.ctx->sec_obj_inst = -1; client.ctx->srv_obj_inst = -1; client.trigger_update = false; @@ -711,7 +711,7 @@ static int sm_do_bootstrap_reg(void) /* clear out existing connection data */ if (client.ctx->sock_fd > -1) { - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); } client.ctx->bootstrap_mode = true; @@ -754,7 +754,7 @@ void engine_bootstrap_finish(void) static int sm_bootstrap_trans_done(void) { /* close down context resources */ - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); /* reset security object instance */ client.ctx->sec_obj_inst = -1; @@ -930,7 +930,7 @@ static int sm_do_registration(void) /* clear out existing connection data */ if (client.ctx->sock_fd > -1) { - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); } client.ctx->bootstrap_mode = false; @@ -993,7 +993,7 @@ static int sm_registration_done(void) ret = lwm2m_engine_connection_resume(client.ctx); if (ret) { - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); /* perform full registration */ set_sm_state(ENGINE_DO_REGISTRATION); return ret; @@ -1006,7 +1006,7 @@ static int sm_registration_done(void) set_sm_state(ENGINE_UPDATE_SENT); } else { LOG_ERR("Registration update err: %d", ret); - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); /* perform full registration */ set_sm_state(ENGINE_DO_REGISTRATION); } @@ -1073,7 +1073,7 @@ static int sm_do_deregister(void) cleanup: lwm2m_reset_message(msg, true); close_ctx: - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); set_sm_state(ENGINE_DEREGISTERED); return ret; } @@ -1102,7 +1102,7 @@ static void lwm2m_rd_client_service(struct k_work *work) switch (get_sm_state()) { case ENGINE_IDLE: if (client.ctx->sock_fd > -1) { - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); } break; @@ -1157,7 +1157,7 @@ static void lwm2m_rd_client_service(struct k_work *work) break; case ENGINE_DEREGISTERED: - lwm2m_engine_stop(client.ctx); + lwm2m_engine_context_close(client.ctx); set_sm_state(ENGINE_IDLE); break; From 1f9adcc638e525c6ebcca90f9e85b297006e8a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 376/501] Revert "[nrf fromtree] net: lwm2m: Update registration only in good path" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0758a0f4ff832852a803ad8f7dc0ffe36f38ff15. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index c3346186594..e5b846b1a1e 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -418,9 +418,6 @@ static int do_registration_reply_cb(const struct coap_packet *response, return -EINVAL; } - /* remember the last reg time */ - client.last_update = k_uptime_get(); - memcpy(client.server_ep, options[1].value, options[1].len); client.server_ep[options[1].len] = '\0'; @@ -462,8 +459,6 @@ static int do_update_reply_cb(const struct coap_packet *response, /* If NOT_FOUND just continue on */ if ((code == COAP_RESPONSE_CODE_CHANGED) || (code == COAP_RESPONSE_CODE_CREATED)) { - /* remember the last reg time */ - client.last_update = k_uptime_get(); set_sm_state(ENGINE_REGISTRATION_DONE); LOG_INF("Update Done"); return 0; @@ -627,7 +622,6 @@ static int sm_do_init(void) client.trigger_update = false; client.lifetime = 0U; client.retries = 0U; - client.last_update = 0U; /* Do bootstrap or registration */ #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) @@ -781,6 +775,9 @@ static int sm_send_registration(bool send_obj_support_data, return -ENOMEM; } + /* remember the last reg time */ + client.last_update = k_uptime_get(); + msg->type = COAP_TYPE_CON; msg->code = COAP_METHOD_POST; msg->mid = coap_next_id(); From 7891d8216186e715c038c2418679fa76e07b61f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 377/501] Revert "[nrf fromtree] net: openthread: allow to configure `OPENTHREAD_MESSAGE_BUFFER_SIZE`" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e1ff1c64528c080e508d102ea62e548df447c3c5. Signed-off-by: Andrzej Głąbek --- modules/openthread/Kconfig.thread | 4 ++-- .../platform/openthread-core-zephyr-config.h | 10 ---------- subsys/net/l2/openthread/Kconfig | 6 ------ 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/modules/openthread/Kconfig.thread b/modules/openthread/Kconfig.thread index 5420d025f80..0a12ec4a233 100644 --- a/modules/openthread/Kconfig.thread +++ b/modules/openthread/Kconfig.thread @@ -61,9 +61,9 @@ config OPENTHREAD_POLL_PERIOD config OPENTHREAD_MAX_CHILDREN int "The maximum number of children" - range 1 511 - default 1 if OPENTHREAD_MTD + range 10 511 default 32 + depends on OPENTHREAD_FTD config OPENTHREAD_MAX_IP_ADDR_PER_CHILD int "The maximum number of IPv6 address registrations per child" diff --git a/modules/openthread/platform/openthread-core-zephyr-config.h b/modules/openthread/platform/openthread-core-zephyr-config.h index 4c1362d1ee2..c2679b19856 100644 --- a/modules/openthread/platform/openthread-core-zephyr-config.h +++ b/modules/openthread/platform/openthread-core-zephyr-config.h @@ -414,14 +414,4 @@ #define OPENTHREAD_CONFIG_PLATFORM_MAC_KEYS_EXPORTABLE_ENABLE 1 #endif -/** - * @def OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE - * - * The size of a message buffer in bytes. - * - */ -#ifdef CONFIG_OPENTHREAD_MESSAGE_BUFFER_SIZE -#define OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE CONFIG_OPENTHREAD_MESSAGE_BUFFER_SIZE -#endif - #endif /* OPENTHREAD_CORE_ZEPHYR_CONFIG_H_ */ diff --git a/subsys/net/l2/openthread/Kconfig b/subsys/net/l2/openthread/Kconfig index 5c9d6afebae..f42f2a2b120 100644 --- a/subsys/net/l2/openthread/Kconfig +++ b/subsys/net/l2/openthread/Kconfig @@ -265,12 +265,6 @@ config OPENTHREAD_NUM_MESSAGE_BUFFERS help "The number of message buffers in the buffer pool." -config OPENTHREAD_MESSAGE_BUFFER_SIZE - int "The size of a message buffer in bytes" - default 128 - help - "The size of a message buffer in bytes" - config OPENTHREAD_MAX_STATECHANGE_HANDLERS int "The maximum number of state-changed callback handlers" default 2 From 46f19380f8df55b12d78f0235bc0b50d468ca4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 378/501] Revert "[nrf fromtree] net: lwm2m: LwM2M Pause and resume support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 21e551b6bcd653470c709c7f849ff586cfd2af35. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/lwm2m.h | 26 +- subsys/net/lib/lwm2m/Kconfig | 6 - subsys/net/lib/lwm2m/lwm2m_engine.c | 225 +++++------------- subsys/net/lib/lwm2m/lwm2m_engine.h | 6 +- subsys/net/lib/lwm2m/lwm2m_message_handling.c | 5 +- subsys/net/lib/lwm2m/lwm2m_rd_client.c | 99 +------- subsys/net/lib/lwm2m/lwm2m_rd_client.h | 4 +- 7 files changed, 82 insertions(+), 289 deletions(-) diff --git a/include/zephyr/net/lwm2m.h b/include/zephyr/net/lwm2m.h index ee071985e1b..651b3089f82 100644 --- a/include/zephyr/net/lwm2m.h +++ b/include/zephyr/net/lwm2m.h @@ -168,13 +168,13 @@ struct lwm2m_ctx { */ bool use_dtls; +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) /** * Flag to indicate that the socket connection is suspended. * With queue mode, this will tell if there is a need to reconnect. */ bool connection_suspended; -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) /** * Flag to indicate that the client is buffering Notifications and Send messages. * True value buffer Notifications and Send messages. @@ -1229,7 +1229,6 @@ enum lwm2m_rd_client_event { LWM2M_RD_CLIENT_EVENT_DEREGISTER_FAILURE, LWM2M_RD_CLIENT_EVENT_DISCONNECT, LWM2M_RD_CLIENT_EVENT_QUEUE_MODE_RX_OFF, - LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED, LWM2M_RD_CLIENT_EVENT_NETWORK_ERROR, }; @@ -1285,29 +1284,6 @@ int lwm2m_rd_client_start(struct lwm2m_ctx *client_ctx, const char *ep_name, int lwm2m_rd_client_stop(struct lwm2m_ctx *client_ctx, lwm2m_ctx_event_cb_t event_cb, bool deregister); -/** - * @brief Suspend the LwM2M engine Thread - * - * Suspend LwM2M engine. Use case could be when network connection is down. - * LwM2M Engine indicate before it suspend by - * LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED event. - * - * @return 0 for success or negative in case of error. - */ -int lwm2m_engine_pause(void); - -/** - * @brief Resume the LwM2M engine thread - * - * Resume suspended LwM2M engine. After successful resume call engine will do - * full registration or registration update based on suspended time. - * Event's LWM2M_RD_CLIENT_EVENT_REGISTRATION_COMPLETE or WM2M_RD_CLIENT_EVENT_REG_UPDATE_COMPLETE - * indicate that client is connected to server. - * - * @return 0 for success or negative in case of error. - */ -int lwm2m_engine_resume(void); - /** * @brief Trigger a Registration Update of the LwM2M RD Client */ diff --git a/subsys/net/lib/lwm2m/Kconfig b/subsys/net/lib/lwm2m/Kconfig index 6cd008470b1..5f5bdb9f9c0 100644 --- a/subsys/net/lib/lwm2m/Kconfig +++ b/subsys/net/lib/lwm2m/Kconfig @@ -191,12 +191,6 @@ config LWM2M_TLS_SESSION_CACHING help Enabling this only when feature is supported in TLS library. -config LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE - bool "Socket close is skipped at RX_ON_IDLE state" - depends on LWM2M_RD_CLIENT_SUPPORT - help - This config suspend socket handler which skip socket polling process. - config LWM2M_RD_CLIENT_SUPPORT bool "support for LWM2M client bootstrap/registration state machine" default y diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index b6cadb13dac..5f4618eb0c7 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -80,9 +80,6 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); static struct lwm2m_obj_path_list observe_paths[LWM2M_ENGINE_MAX_OBSERVER_PATH]; #define MAX_PERIODIC_SERVICE 10 -static k_tid_t engine_thread_id; -static bool suspend_engine_thread; - struct service_node { sys_snode_t node; k_work_handler_t service_work; @@ -112,8 +109,6 @@ int lwm2m_sock_nfds(void) { return sock_nfds; } struct lwm2m_block_context *lwm2m_block1_context(void) { return block1_contexts; } -static void lwm2m_socket_update(struct lwm2m_ctx *ctx); - /* for debugging: to print IP addresses */ char *lwm2m_sprint_ip_addr(const struct sockaddr *addr) { @@ -166,101 +161,26 @@ char *sprint_token(const uint8_t *token, uint8_t tkl) /* utility functions */ -int lwm2m_open_socket(struct lwm2m_ctx *client_ctx) -{ - if (client_ctx->sock_fd < 0) { - /* open socket */ - - if (IS_ENABLED(CONFIG_LWM2M_DTLS_SUPPORT) && client_ctx->use_dtls) { - client_ctx->sock_fd = socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, - IPPROTO_DTLS_1_2); - } else { - client_ctx->sock_fd = - socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, IPPROTO_UDP); - } - - if (client_ctx->sock_fd < 0) { - LOG_ERR("Failed to create socket: %d", errno); - return -errno; - } - - lwm2m_socket_update(client_ctx); - } - - return 0; -} - -int lwm2m_close_socket(struct lwm2m_ctx *client_ctx) -{ - int ret = 0; - - if (client_ctx->sock_fd >= 0) { - ret = close(client_ctx->sock_fd); - if (ret) { - LOG_ERR("Failed to close socket: %d", errno); - ret = -errno; - return ret; - } - - client_ctx->sock_fd = -1; - client_ctx->connection_suspended = true; #if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) - /* Enable Queue mode buffer store */ - client_ctx->buffer_client_messages = true; -#endif - lwm2m_socket_update(client_ctx); - } - - return ret; -} - - -int lwm2m_socket_suspend(struct lwm2m_ctx *client_ctx) -{ - int ret = 0; - - if (client_ctx->sock_fd >= 0 && !client_ctx->connection_suspended) { - int socket_temp_id = client_ctx->sock_fd; - - client_ctx->sock_fd = -1; - client_ctx->connection_suspended = true; -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) - /* Enable Queue mode buffer store */ - client_ctx->buffer_client_messages = true; -#endif - lwm2m_socket_update(client_ctx); - client_ctx->sock_fd = socket_temp_id; - } - - return ret; -} - int lwm2m_engine_connection_resume(struct lwm2m_ctx *client_ctx) { - int ret; +#ifdef CONFIG_LWM2M_DTLS_SUPPORT + if (!client_ctx->use_dtls) { + return 0; + } if (client_ctx->connection_suspended) { - lwm2m_close_socket(client_ctx); client_ctx->connection_suspended = false; - ret = lwm2m_open_socket(client_ctx); - if (ret) { - return ret; - } - - if (!client_ctx->use_dtls) { - return 0; - } - LOG_DBG("Resume suspended connection"); return lwm2m_socket_start(client_ctx); } - +#endif return 0; } - +#endif +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) int lwm2m_push_queued_buffers(struct lwm2m_ctx *client_ctx) { -#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) client_ctx->buffer_client_messages = false; while (!sys_slist_is_empty(&client_ctx->queued_messages)) { sys_snode_t *msg_node = sys_slist_get(&client_ctx->queued_messages); @@ -272,9 +192,9 @@ int lwm2m_push_queued_buffers(struct lwm2m_ctx *client_ctx) msg = SYS_SLIST_CONTAINER(msg_node, msg, node); sys_slist_append(&msg->ctx->pending_sends, &msg->node); } -#endif return 0; } +#endif bool lwm2m_engine_bootstrap_override(struct lwm2m_ctx *client_ctx, struct lwm2m_obj_path *path) { @@ -514,6 +434,43 @@ static int32_t lwm2m_engine_service(const int64_t timestamp) return engine_next_service_timeout_ms(ENGINE_UPDATE_INTERVAL_MS, timestamp); } +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) + +int lwm2m_engine_close_socket_connection(struct lwm2m_ctx *client_ctx) +{ + int ret = 0; + /* Enable Queue mode buffer store */ + client_ctx->buffer_client_messages = true; + +#ifdef CONFIG_LWM2M_DTLS_SUPPORT + if (!client_ctx->use_dtls) { + return 0; + } + + if (client_ctx->sock_fd >= 0) { + ret = close(client_ctx->sock_fd); + if (ret) { + LOG_ERR("Failed to close socket: %d", errno); + ret = -errno; + return ret; + } + client_ctx->sock_fd = -1; + client_ctx->connection_suspended = true; + } + + /* Open socket again that Observation and re-send functionality works */ + client_ctx->sock_fd = + socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, IPPROTO_DTLS_1_2); + + if (client_ctx->sock_fd < 0) { + LOG_ERR("Failed to create socket: %d", errno); + return -errno; + } +#endif + return ret; +} +#endif + /* LwM2M Socket Integration */ int lwm2m_socket_add(struct lwm2m_ctx *ctx) @@ -530,17 +487,6 @@ int lwm2m_socket_add(struct lwm2m_ctx *ctx) return 0; } -static void lwm2m_socket_update(struct lwm2m_ctx *ctx) -{ - for (int i = 0; i < sock_nfds; i++) { - if (sock_ctx[i] != ctx) { - continue; - } - sock_fds[i].fd = ctx->sock_fd; - return; - } -} - void lwm2m_socket_del(struct lwm2m_ctx *ctx) { for (int i = 0; i < sock_nfds; i++) { @@ -573,8 +519,8 @@ static void check_notifications(struct lwm2m_ctx *ctx, const int64_t timestamp) if (!obs->event_timestamp || timestamp < obs->event_timestamp) { continue; } - /* Check That There is not pending process*/ - if (obs->active_tx_operation) { + /* Check That There is not pending process and client is registred */ + if (obs->active_tx_operation || !lwm2m_rd_client_is_registred(ctx)) { continue; } @@ -656,18 +602,6 @@ static void socket_loop(void) int32_t timeout, next_retransmit; while (1) { - /* Check is Thread Suspend Requested */ - if (suspend_engine_thread) { -#if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT) - lwm2m_rd_client_pause(); -#endif - suspend_engine_thread = false; - k_thread_suspend(engine_thread_id); -#if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT) - lwm2m_rd_client_resume(); -#endif - } - timestamp = k_uptime_get(); timeout = lwm2m_engine_service(timestamp); @@ -684,8 +618,7 @@ static void socket_loop(void) timeout = next_retransmit; } } - if (sys_slist_is_empty(&sock_ctx[i]->pending_sends) && - lwm2m_rd_client_is_registred(sock_ctx[i])) { + if (sys_slist_is_empty(&sock_ctx[i]->pending_sends)) { check_notifications(sock_ctx[i], timestamp); } } @@ -705,11 +638,6 @@ static void socket_loop(void) } for (i = 0; i < sock_nfds; i++) { - - if (sock_ctx[i]->sock_fd < 0) { - continue; - } - if ((sock_fds[i].revents & POLLERR) || (sock_fds[i].revents & POLLNVAL) || (sock_fds[i].revents & POLLHUP)) { LOG_ERR("Poll reported a socket error, %02x.", sock_fds[i].revents); @@ -804,12 +732,23 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) if (client_ctx->sock_fd < 0) { allocate_socket = true; - ret = lwm2m_open_socket(client_ctx); - if (ret) { - return ret; +#if defined(CONFIG_LWM2M_DTLS_SUPPORT) + if (client_ctx->use_dtls) { + client_ctx->sock_fd = socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, + IPPROTO_DTLS_1_2); + } else +#endif /* CONFIG_LWM2M_DTLS_SUPPORT */ + { + client_ctx->sock_fd = + socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, IPPROTO_UDP); } } + if (client_ctx->sock_fd < 0) { + LOG_ERR("Failed to create socket: %d", errno); + return -errno; + } + #if defined(CONFIG_LWM2M_DTLS_SUPPORT) if (client_ctx->use_dtls) { sec_tag_t tls_tag_list[] = { @@ -920,44 +859,6 @@ int lwm2m_engine_start(struct lwm2m_ctx *client_ctx) return lwm2m_socket_start(client_ctx); } -int lwm2m_engine_pause(void) -{ - char buffer[32]; - const char *str; - - str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); - if (suspend_engine_thread || !strcmp(str, "suspended")) { - LOG_WRN("Engine thread already suspended"); - return 0; - } - - suspend_engine_thread = true; - - while (strcmp(str, "suspended")) { - k_msleep(10); - str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); - } - LOG_INF("LWM2M engine thread paused (%s) ", str); - return 0; -} - -int lwm2m_engine_resume(void) -{ - char buffer[32]; - const char *str; - - str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); - if (strcmp(str, "suspended")) { - LOG_WRN("LWM2M engine thread state not ok for resume %s", str); - return -EPERM; - } - - k_thread_resume(engine_thread_id); - str = k_thread_state_str(engine_thread_id, buffer, sizeof(buffer)); - LOG_INF("LWM2M engine thread resume (%s)", str); - return 0; -} - static int lwm2m_engine_init(const struct device *dev) { int i; @@ -969,7 +870,7 @@ static int lwm2m_engine_init(const struct device *dev) (void)memset(block1_contexts, 0, sizeof(block1_contexts)); /* start sock receive thread */ - engine_thread_id = k_thread_create(&engine_thread_data, &engine_thread_stack[0], + k_thread_create(&engine_thread_data, &engine_thread_stack[0], K_KERNEL_STACK_SIZEOF(engine_thread_stack), (k_thread_entry_t)socket_loop, NULL, NULL, NULL, THREAD_PRIORITY, 0, K_NO_WAIT); k_thread_name_set(&engine_thread_data, "lwm2m-sock-recv"); diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.h b/subsys/net/lib/lwm2m/lwm2m_engine.h index 02ae3dc0326..34edf9c73c2 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.h +++ b/subsys/net/lib/lwm2m/lwm2m_engine.h @@ -83,11 +83,11 @@ uint8_t lwm2m_firmware_get_update_result(void); int lwm2m_socket_add(struct lwm2m_ctx *ctx); void lwm2m_socket_del(struct lwm2m_ctx *ctx); int lwm2m_socket_start(struct lwm2m_ctx *client_ctx); +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) +int lwm2m_engine_close_socket_connection(struct lwm2m_ctx *client_ctx); int lwm2m_engine_connection_resume(struct lwm2m_ctx *client_ctx); -int lwm2m_open_socket(struct lwm2m_ctx *client_ctx); -int lwm2m_close_socket(struct lwm2m_ctx *client_ctx); -int lwm2m_socket_suspend(struct lwm2m_ctx *client_ctx); int lwm2m_push_queued_buffers(struct lwm2m_ctx *client_ctx); +#endif /* Resources */ struct lwm2m_ctx **lwm2m_sock_ctx(void); diff --git a/subsys/net/lib/lwm2m/lwm2m_message_handling.c b/subsys/net/lib/lwm2m/lwm2m_message_handling.c index 4d1d02f37c9..fd339ff4c21 100644 --- a/subsys/net/lib/lwm2m/lwm2m_message_handling.c +++ b/subsys/net/lib/lwm2m/lwm2m_message_handling.c @@ -196,9 +196,8 @@ int lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx) coap_pendings_clear(client_ctx->pendings, ARRAY_SIZE(client_ctx->pendings)); coap_replies_clear(client_ctx->replies, ARRAY_SIZE(client_ctx->replies)); - - client_ctx->connection_suspended = false; #if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) + client_ctx->connection_suspended = false; client_ctx->buffer_client_messages = true; #endif lwm2m_socket_del(client_ctx); @@ -214,9 +213,9 @@ void lwm2m_engine_context_init(struct lwm2m_ctx *client_ctx) { sys_slist_init(&client_ctx->pending_sends); sys_slist_init(&client_ctx->observer); - client_ctx->connection_suspended = false; #if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) client_ctx->buffer_client_messages = true; + client_ctx->connection_suspended = false; sys_slist_init(&client_ctx->queued_messages); #endif } diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.c b/subsys/net/lib/lwm2m/lwm2m_rd_client.c index e5b846b1a1e..10faa2a1dbc 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.c +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.c @@ -55,11 +55,9 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include #include -#include #include "lwm2m_object.h" #include "lwm2m_engine.h" -#include "lwm2m_rd_client.h" #include "lwm2m_rw_link_format.h" #define LWM2M_RD_CLIENT_URI "rd" @@ -94,7 +92,6 @@ enum sm_engine_state { ENGINE_REGISTRATION_DONE, ENGINE_REGISTRATION_DONE_RX_OFF, ENGINE_UPDATE_SENT, - ENGINE_SUSPENDED, ENGINE_DEREGISTER, ENGINE_DEREGISTER_SENT, ENGINE_DEREGISTERED, @@ -128,7 +125,6 @@ struct lwm2m_rd_client_info { * documented in the LwM2M specification. */ static char query_buffer[MAX(32, sizeof("ep=") + CLIENT_EP_LEN)]; -static enum sm_engine_state suspended_client_state; static struct lwm2m_message *rd_get_message(void) { @@ -170,13 +166,20 @@ static void set_sm_state(uint8_t sm_state) if (client.engine_state == ENGINE_UPDATE_SENT && (sm_state == ENGINE_REGISTRATION_DONE || sm_state == ENGINE_REGISTRATION_DONE_RX_OFF)) { +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) lwm2m_push_queued_buffers(client.ctx); +#endif event = LWM2M_RD_CLIENT_EVENT_REG_UPDATE_COMPLETE; } else if (sm_state == ENGINE_REGISTRATION_DONE) { +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) lwm2m_push_queued_buffers(client.ctx); +#endif event = LWM2M_RD_CLIENT_EVENT_REGISTRATION_COMPLETE; } else if (sm_state == ENGINE_REGISTRATION_DONE_RX_OFF) { event = LWM2M_RD_CLIENT_EVENT_QUEUE_MODE_RX_OFF; +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) + lwm2m_engine_close_socket_connection(client.ctx); +#endif } else if ((sm_state == ENGINE_INIT || sm_state == ENGINE_DEREGISTERED) && (client.engine_state >= ENGINE_DO_REGISTRATION && @@ -198,15 +201,6 @@ static void set_sm_state(uint8_t sm_state) if (event > LWM2M_RD_CLIENT_EVENT_NONE && client.ctx->event_cb) { client.ctx->event_cb(client.ctx, event); } - - /* Suspend socket after Event callback */ - if (event == LWM2M_RD_CLIENT_EVENT_QUEUE_MODE_RX_OFF) { - if (IS_ENABLED(CONFIG_LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE)) { - lwm2m_socket_suspend(client.ctx); - } else { - lwm2m_close_socket(client.ctx); - } - } } static bool sm_is_registered(void) @@ -987,7 +981,7 @@ static int sm_registration_done(void) update_objects = client.update_objects; client.trigger_update = false; client.update_objects = false; - +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) ret = lwm2m_engine_connection_resume(client.ctx); if (ret) { lwm2m_engine_context_close(client.ctx); @@ -995,6 +989,7 @@ static int sm_registration_done(void) set_sm_state(ENGINE_DO_REGISTRATION); return ret; } +#endif ret = sm_send_registration(update_objects, do_update_reply_cb, @@ -1107,9 +1102,6 @@ static void lwm2m_rd_client_service(struct k_work *work) sm_do_init(); break; - case ENGINE_SUSPENDED: - break; - #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) case ENGINE_DO_BOOTSTRAP_REG: sm_do_bootstrap_reg(); @@ -1239,77 +1231,6 @@ int lwm2m_rd_client_stop(struct lwm2m_ctx *client_ctx, return 0; } -int lwm2m_rd_client_pause(void) -{ - enum lwm2m_rd_client_event event = LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED; - - k_mutex_lock(&client.mutex, K_FOREVER); - - if (!client.ctx) { - k_mutex_unlock(&client.mutex); - LOG_ERR("Cannot pause. No context"); - return -EPERM; - } else if (client.engine_state == ENGINE_SUSPENDED) { - k_mutex_unlock(&client.mutex); - LOG_ERR("LwM2M client already suspended"); - return 0; - } - - LOG_INF("Suspend client"); - if (!client.ctx->connection_suspended && client.ctx->event_cb) { - client.ctx->event_cb(client.ctx, event); - } - - suspended_client_state = get_sm_state(); - client.engine_state = ENGINE_SUSPENDED; - - k_mutex_unlock(&client.mutex); - - return 0; -} - -int lwm2m_rd_client_resume(void) -{ - int ret; - - k_mutex_lock(&client.mutex, K_FOREVER); - - if (!client.ctx) { - k_mutex_unlock(&client.mutex); - LOG_WRN("Cannot resume. No context"); - return -EPERM; - } - - if (client.engine_state != ENGINE_SUSPENDED) { - k_mutex_unlock(&client.mutex); - LOG_WRN("Cannot resume state is not Suspended"); - return -EPERM; - } - - LOG_INF("Resume Client state"); - lwm2m_close_socket(client.ctx); - client.engine_state = suspended_client_state; - - if (!sm_is_registered() || - (sm_is_registered() && - (client.lifetime <= (k_uptime_get() - client.last_update) / 1000))) { - client.engine_state = ENGINE_DO_REGISTRATION; - } else { - lwm2m_rd_client_connection_resume(client.ctx); - client.trigger_update = true; - } - - ret = lwm2m_open_socket(client.ctx); - if (ret) { - LOG_ERR("Socket Open Fail"); - client.engine_state = ENGINE_INIT; - } - - k_mutex_unlock(&client.mutex); - - return 0; -} - void lwm2m_rd_client_update(void) { engine_trigger_update(false); @@ -1320,6 +1241,7 @@ struct lwm2m_ctx *lwm2m_rd_client_ctx(void) return client.ctx; } +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx) { if (client.ctx != client_ctx) { @@ -1346,6 +1268,7 @@ int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx) return 0; } +#endif int lwm2m_rd_client_timeout(struct lwm2m_ctx *client_ctx) { diff --git a/subsys/net/lib/lwm2m/lwm2m_rd_client.h b/subsys/net/lib/lwm2m/lwm2m_rd_client.h index fbab9af9136..661efd1351c 100644 --- a/subsys/net/lib/lwm2m/lwm2m_rd_client.h +++ b/subsys/net/lib/lwm2m/lwm2m_rd_client.h @@ -40,15 +40,15 @@ void engine_trigger_update(bool update_objects); int engine_trigger_bootstrap(void); -int lwm2m_rd_client_pause(void); -int lwm2m_rd_client_resume(void); int lwm2m_rd_client_timeout(struct lwm2m_ctx *client_ctx); bool lwm2m_rd_client_is_registred(struct lwm2m_ctx *client_ctx); #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) void engine_bootstrap_finish(void); #endif +#if defined(CONFIG_LWM2M_QUEUE_MODE_ENABLED) int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx); +#endif void engine_update_tx_time(void); struct lwm2m_message *lwm2m_get_ongoing_rd_msg(void); From 9cb690c23f67561eae1c630f2cb22c1c1464989d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 379/501] Revert "[nrf fromtree] net: lwm2m: Shell helper for pause and resume" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 294b5adfd1ff135ccdf23e4e79044e83f24dbacc. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/lwm2m/lwm2m_shell.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_shell.c b/subsys/net/lib/lwm2m/lwm2m_shell.c index 3c85b1603a6..0c83494fb15 100644 --- a/subsys/net/lib/lwm2m/lwm2m_shell.c +++ b/subsys/net/lib/lwm2m/lwm2m_shell.c @@ -45,8 +45,6 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define LWM2M_HELP_STOP "Stop the LwM2M RD (De-register) Client\nstop [OPTIONS]\n" \ "-f \tForce close the connection\n" #define LWM2M_HELP_UPDATE "Trigger Registration Update of the LwM2M RD Client\n" -#define LWM2M_HELP_PAUSE "LwM2M engine thread pause" -#define LWM2M_HELP_RESUME "LwM2M engine thread resume" static int cmd_send(const struct shell *sh, size_t argc, char **argv) { @@ -435,24 +433,6 @@ static int cmd_update(const struct shell *sh, size_t argc, char **argv) return 0; } -static int cmd_pause(const struct shell *sh, size_t argc, char **argv) -{ - ARG_UNUSED(sh); - ARG_UNUSED(argc); - ARG_UNUSED(argv); - - return lwm2m_engine_pause(); -} - -static int cmd_resume(const struct shell *sh, size_t argc, char **argv) -{ - ARG_UNUSED(sh); - ARG_UNUSED(argc); - ARG_UNUSED(argv); - - return lwm2m_engine_resume(); -} - SHELL_STATIC_SUBCMD_SET_CREATE( sub_lwm2m, SHELL_COND_CMD_ARG(CONFIG_LWM2M_VERSION_1_1, send, NULL, @@ -463,8 +443,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( SHELL_CMD_ARG(start, NULL, LWM2M_HELP_START, cmd_start, 2, 2), SHELL_CMD_ARG(stop, NULL, LWM2M_HELP_STOP, cmd_stop, 1, 1), SHELL_CMD_ARG(update, NULL, LWM2M_HELP_UPDATE, cmd_update, 1, 0), - SHELL_CMD_ARG(pause, NULL, LWM2M_HELP_PAUSE, cmd_pause, 1, 0), - SHELL_CMD_ARG(resume, NULL, LWM2M_HELP_RESUME, cmd_resume, 1, 0), SHELL_SUBCMD_SET_END); SHELL_COND_CMD_ARG_REGISTER(CONFIG_LWM2M_SHELL, lwm2m, &sub_lwm2m, LWM2M_HELP_CMD, NULL, 1, 0); From 1d7400125c818a82bdec39734198feb2120f323c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 380/501] Revert "[nrf fromtree] doc: extensions: kconfig: sort database entries" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 676596e794bab4ceeffa021670cf09b9382cf0bf. Signed-off-by: Andrzej Głąbek --- doc/_extensions/zephyr/kconfig/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index f95d7f68ab5..fab8eefe2a2 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -253,10 +253,7 @@ def kconfig_build_resources(app: Sphinx) -> None: kconfig, module_paths = kconfig_load(app) db = list() - for sc in sorted( - chain(kconfig.unique_defined_syms, kconfig.unique_choices), - key=lambda sc: sc.name if sc.name else "", - ): + for sc in chain(kconfig.unique_defined_syms, kconfig.unique_choices): # skip nameless symbols if not sc.name: continue From 549b08340cfc535103c2aa8eda41959ba666522a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 381/501] Revert "[nrf fromtree] doc: extensions: kconfig: improve search capabilities" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 656129521472e097645a8a052044f18d27ce4159. Signed-off-by: Andrzej Głąbek --- .../zephyr/kconfig/static/kconfig.mjs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/static/kconfig.mjs b/doc/_extensions/zephyr/kconfig/static/kconfig.mjs index 7c1d7df5985..06d05f53842 100644 --- a/doc/_extensions/zephyr/kconfig/static/kconfig.mjs +++ b/doc/_extensions/zephyr/kconfig/static/kconfig.mjs @@ -289,23 +289,11 @@ function doSearch() { } /* perform search */ - const regexes = input.value.trim().split(/\s+/).map( - element => new RegExp(element.toLowerCase()) - ); + let pattern = new RegExp(input.value, 'i'); let count = 0; const searchResults = db.filter(entry => { - let matches = 0; - const name = entry.name.toLowerCase(); - const prompt = entry.prompt ? entry.prompt.toLowerCase() : ""; - - regexes.forEach(regex => { - if (name.search(regex) >= 0 || prompt.search(regex) >= 0) { - matches++; - } - }); - - if (matches === regexes.length) { + if (entry.name.match(pattern)) { count++; if (count > searchOffset && count <= (searchOffset + MAX_RESULTS)) { return true; From 8969e7d57116018cb2fd8f84a2641c2c60da14e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 382/501] Revert "[nrf fromtree] samples: net: lwm2m_client: Updated RD client event handler" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 089738b3d810f5b2e21079fe1ae8f5c9865ce37f. Signed-off-by: Andrzej Głąbek --- samples/net/lwm2m_client/src/lwm2m-client.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/samples/net/lwm2m_client/src/lwm2m-client.c b/samples/net/lwm2m_client/src/lwm2m-client.c index 2897167d569..b5be655437a 100644 --- a/samples/net/lwm2m_client/src/lwm2m-client.c +++ b/samples/net/lwm2m_client/src/lwm2m-client.c @@ -466,10 +466,6 @@ static void rd_client_event(struct lwm2m_ctx *client, LOG_DBG("Queue mode RX window closed"); break; - case LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED: - LOG_DBG("LwM2M engine suspended"); - break; - case LWM2M_RD_CLIENT_EVENT_NETWORK_ERROR: LOG_ERR("LwM2M engine reported a network error."); lwm2m_rd_client_stop(client, rd_client_event, true); From 5ddf93e0354bc54aebc91d49db2e1e55c819d137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 383/501] Revert "[nrf fromtree] net: lwm2m: Allow string and opaque data types to be empty" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 75402705e5578a281785c6d93789f44d87431f1f. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/lwm2m/lwm2m_message_handling.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_message_handling.c b/subsys/net/lib/lwm2m/lwm2m_message_handling.c index fd339ff4c21..02fea2d69cd 100644 --- a/subsys/net/lib/lwm2m/lwm2m_message_handling.c +++ b/subsys/net/lib/lwm2m/lwm2m_message_handling.c @@ -1032,22 +1032,10 @@ static int lwm2m_read_handler(struct lwm2m_engine_obj_inst *obj_inst, struct lwm res->res_instances[i].res_inst_id, &data_len); } - if (!data_ptr && data_len) { + if (!data_ptr || data_len == 0) { return -ENOENT; } - if (!data_len) { - if (obj_field->data_type != LWM2M_RES_TYPE_OPAQUE && - obj_field->data_type != LWM2M_RES_TYPE_STRING) { - return -ENOENT; - } - /* Only opaque and string types can be empty, and when - * empty, we should not give pointer to potentially uninitialized - * data to a content formatter. Give pointer to empty string instead. - */ - data_ptr = ""; - } - switch (obj_field->data_type) { case LWM2M_RES_TYPE_OPAQUE: From 21052fcb3a2f46ab29fcd257e2febd8a18d8a1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 384/501] Revert "[nrf fromtree] scripts: west_commands: runners: jlink: support pylink >= 0.14" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a516f77f13f543527aca1a5f6f739ee607880a02. Signed-off-by: Andrzej Głąbek --- scripts/west_commands/runners/jlink.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/scripts/west_commands/runners/jlink.py b/scripts/west_commands/runners/jlink.py index 173ad64435c..878cd745217 100644 --- a/scripts/west_commands/runners/jlink.py +++ b/scripts/west_commands/runners/jlink.py @@ -8,7 +8,6 @@ from functools import partial import logging import os -from packaging.version import Version from pathlib import Path import shlex import subprocess @@ -18,7 +17,6 @@ from runners.core import ZephyrBinaryRunner, RunnerCaps, depr_action try: - import pylink from pylink.library import Library MISSING_REQUIREMENTS = False except ImportError: @@ -152,23 +150,16 @@ def jlink_version(self): # to load the shared library distributed with the tools, which # provides an API call for getting the version. if not hasattr(self, '_jlink_version'): - # pylink >= 0.14.0 exposes JLink SDK DLL (libjlinkarm) in - # JLINK_SDK_STARTS_WITH, while previous versions use JLINK_SDK_NAME - if Version(pylink.__version__) >= Version('0.14.0'): - sdk = Library.JLINK_SDK_STARTS_WITH - else: - sdk = Library.JLINK_SDK_NAME - plat = sys.platform if plat.startswith('win32'): libname = Library.get_appropriate_windows_sdk_name() + '.dll' elif plat.startswith('linux'): - libname = sdk + '.so' + libname = Library.JLINK_SDK_NAME + '.so' elif plat.startswith('darwin'): - libname = sdk + '.dylib' + libname = Library.JLINK_SDK_NAME + '.dylib' else: self.logger.warning(f'unknown platform {plat}; assuming UNIX') - libname = sdk + '.so' + libname = Library.JLINK_SDK_NAME + '.so' lib = Library(dllpath=os.fspath(Path(self.commander).parent / libname)) From 214243cf37195afd9645c496e80664e2079c1492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:10 +0200 Subject: [PATCH 385/501] Revert "[nrf fromtree] drivers: sensor: Convert Kconfig bus 'depends on' to 'select'" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 10313a4d059495c54071bd87c796bbe45199a26d. Signed-off-by: Andrzej Głąbek --- drivers/sensor/adt7420/Kconfig | 2 +- drivers/sensor/adxl345/Kconfig | 3 +-- drivers/sensor/adxl362/Kconfig | 2 +- drivers/sensor/adxl372/Kconfig | 3 +-- drivers/sensor/ak8975/Kconfig | 2 +- drivers/sensor/amg88xx/Kconfig | 2 +- drivers/sensor/ams_iAQcore/Kconfig | 2 +- drivers/sensor/apds9960/Kconfig | 2 +- drivers/sensor/bma280/Kconfig | 2 +- drivers/sensor/bmc150_magn/Kconfig | 2 +- drivers/sensor/bme280/Kconfig | 3 +-- drivers/sensor/bme680/Kconfig | 3 +-- drivers/sensor/bmg160/Kconfig | 2 +- drivers/sensor/bmi160/Kconfig | 3 +-- drivers/sensor/bmi270/Kconfig | 2 +- drivers/sensor/bmm150/Kconfig | 2 +- drivers/sensor/bmp388/Kconfig | 3 +-- drivers/sensor/bq274xx/Kconfig | 2 +- drivers/sensor/ccs811/Kconfig | 2 +- drivers/sensor/dps310/Kconfig | 2 +- drivers/sensor/ens210/Kconfig | 2 +- drivers/sensor/fdc2x1x/Kconfig | 3 +-- drivers/sensor/fxas21002/Kconfig | 2 +- drivers/sensor/fxos8700/Kconfig | 2 +- drivers/sensor/hmc5883l/Kconfig | 2 +- drivers/sensor/hp206c/Kconfig | 2 +- drivers/sensor/hts221/Kconfig | 3 +-- drivers/sensor/i3g4250d/Kconfig | 2 +- drivers/sensor/icm42605/Kconfig | 2 +- drivers/sensor/icm42670/Kconfig | 2 +- drivers/sensor/iis2dh/Kconfig | 3 +-- drivers/sensor/iis2dlpc/Kconfig | 3 +-- drivers/sensor/iis2iclx/Kconfig | 3 +-- drivers/sensor/iis2mdc/Kconfig | 3 +-- drivers/sensor/iis3dhhc/Kconfig | 2 +- drivers/sensor/ina219/Kconfig | 2 +- drivers/sensor/ina23x/Kconfig | 2 +- drivers/sensor/isl29035/Kconfig | 2 +- drivers/sensor/ism330dhcx/Kconfig | 3 +-- drivers/sensor/lis2dh/Kconfig | 3 +-- drivers/sensor/lis2ds12/Kconfig | 3 +-- drivers/sensor/lis2dw12/Kconfig | 3 +-- drivers/sensor/lis2mdl/Kconfig | 3 +-- drivers/sensor/lis3mdl/Kconfig | 2 +- drivers/sensor/lm75/Kconfig | 2 +- drivers/sensor/lm77/Kconfig | 2 +- drivers/sensor/lps22hb/Kconfig | 2 +- drivers/sensor/lps22hh/Kconfig | 3 +-- drivers/sensor/lps25hb/Kconfig | 2 +- drivers/sensor/lsm303dlhc_magn/Kconfig | 2 +- drivers/sensor/lsm6ds0/Kconfig | 2 +- drivers/sensor/lsm6dsl/Kconfig | 3 +-- drivers/sensor/lsm6dso/Kconfig | 3 +-- drivers/sensor/lsm9ds0_gyro/Kconfig | 2 +- drivers/sensor/lsm9ds0_mfd/Kconfig | 2 +- drivers/sensor/max17055/Kconfig | 2 +- drivers/sensor/max17262/Kconfig | 2 +- drivers/sensor/max30101/Kconfig | 2 +- drivers/sensor/max31875/Kconfig | 2 +- drivers/sensor/max44009/Kconfig | 2 +- drivers/sensor/max6675/Kconfig | 2 +- drivers/sensor/mcp9808/Kconfig | 2 +- drivers/sensor/mpr/Kconfig | 2 +- drivers/sensor/mpu6050/Kconfig | 2 +- drivers/sensor/mpu9250/Kconfig | 2 +- drivers/sensor/ms5607/Kconfig | 3 +-- drivers/sensor/ms5837/Kconfig | 2 +- drivers/sensor/opt3001/Kconfig | 2 +- drivers/sensor/sbs_gauge/Kconfig | 2 +- drivers/sensor/sgp40/Kconfig | 2 +- drivers/sensor/sht3xd/Kconfig | 2 +- drivers/sensor/sht4x/Kconfig | 2 +- drivers/sensor/shtcx/Kconfig | 2 +- drivers/sensor/si7006/Kconfig | 2 +- drivers/sensor/si7055/Kconfig | 2 +- drivers/sensor/si7060/Kconfig | 2 +- drivers/sensor/si7210/Kconfig | 2 +- drivers/sensor/stts751/Kconfig | 2 +- drivers/sensor/sx9500/Kconfig | 2 +- drivers/sensor/th02/Kconfig | 2 +- drivers/sensor/ti_hdc/Kconfig | 2 +- drivers/sensor/ti_hdc20xx/Kconfig | 2 +- drivers/sensor/tmp007/Kconfig | 2 +- drivers/sensor/tmp108/Kconfig | 2 +- drivers/sensor/tmp112/Kconfig | 2 +- drivers/sensor/tmp116/Kconfig | 2 +- drivers/sensor/vcnl4040/Kconfig | 2 +- drivers/sensor/vl53l0x/Kconfig | 2 +- drivers/sensor/wsen_itds/Kconfig | 2 +- 89 files changed, 89 insertions(+), 110 deletions(-) diff --git a/drivers/sensor/adt7420/Kconfig b/drivers/sensor/adt7420/Kconfig index f8dd4add457..611ec5faebc 100644 --- a/drivers/sensor/adt7420/Kconfig +++ b/drivers/sensor/adt7420/Kconfig @@ -7,7 +7,7 @@ menuconfig ADT7420 bool "ADT7420 Temperature Sensor" default y depends on DT_HAS_ADI_ADT7420_ENABLED - select I2C + depends on I2C help Enable the driver for Analog Devices ADT7420 High-Accuracy 16-bit Digital I2C Temperature Sensors. diff --git a/drivers/sensor/adxl345/Kconfig b/drivers/sensor/adxl345/Kconfig index 210164269b7..eebd598e70e 100644 --- a/drivers/sensor/adxl345/Kconfig +++ b/drivers/sensor/adxl345/Kconfig @@ -7,7 +7,6 @@ config ADXL345 bool "ADXL345 Three Axis accelerometer" default y depends on DT_HAS_ADI_ADXL345_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL345),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL345),spi) + depends on I2C || SPI help Enable driver for ADXL345 Three-Axis Digital Accelerometer. diff --git a/drivers/sensor/adxl362/Kconfig b/drivers/sensor/adxl362/Kconfig index 3ab0621bb6a..81ceb36b207 100644 --- a/drivers/sensor/adxl362/Kconfig +++ b/drivers/sensor/adxl362/Kconfig @@ -7,7 +7,7 @@ menuconfig ADXL362 bool "ADXL362 sensor" default y depends on DT_HAS_ADI_ADXL362_ENABLED - select SPI + depends on SPI help Enable driver for ADXL362 Three-Axis Digital Accelerometers. diff --git a/drivers/sensor/adxl372/Kconfig b/drivers/sensor/adxl372/Kconfig index 629a9c5e242..00bc1fb1c12 100644 --- a/drivers/sensor/adxl372/Kconfig +++ b/drivers/sensor/adxl372/Kconfig @@ -7,8 +7,7 @@ menuconfig ADXL372 bool "ADXL372 Three Axis High-g I2C/SPI accelerometer" default y depends on DT_HAS_ADI_ADXL372_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),spi) + depends on I2C || SPI help Enable driver for ADXL372 Three-Axis Digital Accelerometers. diff --git a/drivers/sensor/ak8975/Kconfig b/drivers/sensor/ak8975/Kconfig index a6457adddff..88336b55d6e 100644 --- a/drivers/sensor/ak8975/Kconfig +++ b/drivers/sensor/ak8975/Kconfig @@ -7,6 +7,6 @@ config AK8975 bool "AK8975 Magnetometer" default y depends on DT_HAS_ASAHI_KASEI_AK8975_ENABLED - select I2C + depends on I2C help Enable driver for AK8975 magnetometer. diff --git a/drivers/sensor/amg88xx/Kconfig b/drivers/sensor/amg88xx/Kconfig index 0b5ce00b659..5c6949e144e 100644 --- a/drivers/sensor/amg88xx/Kconfig +++ b/drivers/sensor/amg88xx/Kconfig @@ -7,7 +7,7 @@ menuconfig AMG88XX bool "AMG88XX Infrared Thermopile Sensor" default y depends on DT_HAS_PANASONIC_AMG88XX_ENABLED - select I2C + depends on I2C help Enable driver for AMG88XX infrared thermopile sensor. diff --git a/drivers/sensor/ams_iAQcore/Kconfig b/drivers/sensor/ams_iAQcore/Kconfig index 153bd0dcd2c..56ea523436b 100644 --- a/drivers/sensor/ams_iAQcore/Kconfig +++ b/drivers/sensor/ams_iAQcore/Kconfig @@ -7,7 +7,7 @@ menuconfig AMS_IAQ_CORE bool "iAQ-core Digital VOC sensor" default y depends on DT_HAS_AMS_IAQCORE_ENABLED - select I2C + depends on I2C help Enable driver for iAQ-core Digital VOC sensor. diff --git a/drivers/sensor/apds9960/Kconfig b/drivers/sensor/apds9960/Kconfig index 9007137a183..6f89ad9de7d 100644 --- a/drivers/sensor/apds9960/Kconfig +++ b/drivers/sensor/apds9960/Kconfig @@ -6,7 +6,7 @@ menuconfig APDS9960 bool "APDS9960 Sensor" default y depends on DT_HAS_AVAGO_APDS9960_ENABLED - select I2C + depends on I2C help Enable driver for APDS9960 sensors. diff --git a/drivers/sensor/bma280/Kconfig b/drivers/sensor/bma280/Kconfig index 5e76c4063b0..c28dbac820b 100644 --- a/drivers/sensor/bma280/Kconfig +++ b/drivers/sensor/bma280/Kconfig @@ -7,7 +7,7 @@ menuconfig BMA280 bool "BMA280 Three Axis Accelerometer Family" default y depends on DT_HAS_BOSCH_BMA280_ENABLED - select I2C + depends on I2C help Enable driver for BMA280 I2C-based triaxial accelerometer sensor family. diff --git a/drivers/sensor/bmc150_magn/Kconfig b/drivers/sensor/bmc150_magn/Kconfig index 87238677294..0f9a883ac82 100644 --- a/drivers/sensor/bmc150_magn/Kconfig +++ b/drivers/sensor/bmc150_magn/Kconfig @@ -7,7 +7,7 @@ menuconfig BMC150_MAGN bool "BMC150_MAGN I2C Magnetometer Chip" default y depends on DT_HAS_BOSCH_BMC150_MAGN_ENABLED - select I2C + depends on I2C help Enable driver for BMC150 I2C-based magnetometer sensor. diff --git a/drivers/sensor/bme280/Kconfig b/drivers/sensor/bme280/Kconfig index 05e42a47359..a018af13512 100644 --- a/drivers/sensor/bme280/Kconfig +++ b/drivers/sensor/bme280/Kconfig @@ -8,8 +8,7 @@ menuconfig BME280 bool "BME280/BMP280 sensor" default y depends on DT_HAS_BOSCH_BME280_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BME280),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BME280),spi) + depends on I2C || SPI help Enable driver for BME280 I2C-based or SPI-based temperature and pressure sensor. diff --git a/drivers/sensor/bme680/Kconfig b/drivers/sensor/bme680/Kconfig index 6f3343dc86f..bc4d747033c 100644 --- a/drivers/sensor/bme680/Kconfig +++ b/drivers/sensor/bme680/Kconfig @@ -9,8 +9,7 @@ menuconfig BME680 bool "BME680 sensor" default y depends on DT_HAS_BOSCH_BME680_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BME680),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BME680),spi) + depends on I2C || SPI help Enable driver for BME680 I2C- or SPI- based temperature, pressure, humidity and gas sensor. diff --git a/drivers/sensor/bmg160/Kconfig b/drivers/sensor/bmg160/Kconfig index 108d2021e70..23116d260a5 100644 --- a/drivers/sensor/bmg160/Kconfig +++ b/drivers/sensor/bmg160/Kconfig @@ -7,7 +7,7 @@ menuconfig BMG160 bool "Bosch BMG160 gyroscope support" default y depends on DT_HAS_BOSCH_BMG160_ENABLED - select I2C + depends on I2C help Enable Bosch BMG160 gyroscope support. diff --git a/drivers/sensor/bmi160/Kconfig b/drivers/sensor/bmi160/Kconfig index 29ee0c1423f..3c23e7e141f 100644 --- a/drivers/sensor/bmi160/Kconfig +++ b/drivers/sensor/bmi160/Kconfig @@ -7,8 +7,7 @@ menuconfig BMI160 bool "Bosch BMI160 inertial measurement unit" default y depends on DT_HAS_BOSCH_BMI160_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI160),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI160),spi) + depends on SPI || I2C help Enable Bosch BMI160 inertial measurement unit that provides acceleration and angular rate measurements. diff --git a/drivers/sensor/bmi270/Kconfig b/drivers/sensor/bmi270/Kconfig index 90bbe131b8b..10c0da5883a 100644 --- a/drivers/sensor/bmi270/Kconfig +++ b/drivers/sensor/bmi270/Kconfig @@ -7,6 +7,6 @@ config BMI270 bool "BMI270 Inertial measurement unit" default y depends on DT_HAS_BOSCH_BMI270_ENABLED - select I2C + depends on I2C help Enable driver for BMI270 I2C-based imu sensor diff --git a/drivers/sensor/bmm150/Kconfig b/drivers/sensor/bmm150/Kconfig index 54cf97456d3..9a0bb2df3ad 100644 --- a/drivers/sensor/bmm150/Kconfig +++ b/drivers/sensor/bmm150/Kconfig @@ -7,7 +7,7 @@ menuconfig BMM150 bool "BMM150 I2C Geomagnetic Chip" default y depends on DT_HAS_BOSCH_BMM150_ENABLED - select I2C + depends on I2C help Enable driver for BMM150 I2C-based Geomagnetic sensor. if BMM150 diff --git a/drivers/sensor/bmp388/Kconfig b/drivers/sensor/bmp388/Kconfig index 3f46b196c40..9d860d88848 100644 --- a/drivers/sensor/bmp388/Kconfig +++ b/drivers/sensor/bmp388/Kconfig @@ -5,8 +5,7 @@ menuconfig BMP388 bool "Bosch BMP388 pressure sensor" default y depends on DT_HAS_BOSCH_BMP388_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMP388),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMP388),spi) + depends on SPI || I2C help Enable driver for the Bosch BMP388 pressure sensor diff --git a/drivers/sensor/bq274xx/Kconfig b/drivers/sensor/bq274xx/Kconfig index 6b7ad66b0e6..58a176d593a 100644 --- a/drivers/sensor/bq274xx/Kconfig +++ b/drivers/sensor/bq274xx/Kconfig @@ -6,6 +6,6 @@ config BQ274XX bool "BQ274xx Fuel Gauge" default y depends on DT_HAS_TI_BQ274XX_ENABLED - select I2C + depends on I2C help Enable I2C-based driver for BQ274xx Fuel Gauge. diff --git a/drivers/sensor/ccs811/Kconfig b/drivers/sensor/ccs811/Kconfig index 5a660805fa2..c364c900a7c 100644 --- a/drivers/sensor/ccs811/Kconfig +++ b/drivers/sensor/ccs811/Kconfig @@ -9,7 +9,7 @@ menuconfig CCS811 bool "CCS811 Digital Gas Sensor" default y depends on DT_HAS_AMS_CCS811_ENABLED - select I2C + depends on I2C help Enable driver for CCS811 Gas sensors. diff --git a/drivers/sensor/dps310/Kconfig b/drivers/sensor/dps310/Kconfig index 878d8f28bc8..95452979b76 100644 --- a/drivers/sensor/dps310/Kconfig +++ b/drivers/sensor/dps310/Kconfig @@ -7,7 +7,7 @@ menuconfig DPS310 bool "DPS310 sensor" default y depends on DT_HAS_INFINEON_DPS310_ENABLED - select I2C + depends on I2C help Enable driver for DPS310 I2C-based temperature and pressure sensor. diff --git a/drivers/sensor/ens210/Kconfig b/drivers/sensor/ens210/Kconfig index 5287f88ad10..1627a5cc6c9 100644 --- a/drivers/sensor/ens210/Kconfig +++ b/drivers/sensor/ens210/Kconfig @@ -7,7 +7,7 @@ menuconfig ENS210 bool "ENS210 Digital Temperature and Humidity sensor" default y depends on DT_HAS_AMS_ENS210_ENABLED - select I2C + depends on I2C help Enable driver for ENS210 Digital Temperature and Humidity sensor. if ENS210 diff --git a/drivers/sensor/fdc2x1x/Kconfig b/drivers/sensor/fdc2x1x/Kconfig index 33894acb17f..c952d313c07 100644 --- a/drivers/sensor/fdc2x1x/Kconfig +++ b/drivers/sensor/fdc2x1x/Kconfig @@ -7,8 +7,7 @@ menuconfig FDC2X1X bool "FDC2X1X Capacitance-to-Digital Converter" default y depends on DT_HAS_TI_FDC2X1X_ENABLED - depends on NEWLIB_LIBC - select I2C + depends on I2C && NEWLIB_LIBC help Enable driver for FDC2X1X Capacitance-to-Digital Converter. diff --git a/drivers/sensor/fxas21002/Kconfig b/drivers/sensor/fxas21002/Kconfig index 591de55510c..421c6ecc50b 100644 --- a/drivers/sensor/fxas21002/Kconfig +++ b/drivers/sensor/fxas21002/Kconfig @@ -7,7 +7,7 @@ menuconfig FXAS21002 bool "FXAS21002 gyroscope driver" default y depends on DT_HAS_NXP_FXAS21002_ENABLED - select I2C + depends on I2C help Enable driver for the FXAS21002 gyroscope diff --git a/drivers/sensor/fxos8700/Kconfig b/drivers/sensor/fxos8700/Kconfig index 9fcd7b1a871..9504b96a8f5 100644 --- a/drivers/sensor/fxos8700/Kconfig +++ b/drivers/sensor/fxos8700/Kconfig @@ -7,7 +7,7 @@ menuconfig FXOS8700 bool "FXOS8700 accelerometer/magnetometer driver" default y depends on DT_HAS_NXP_FXOS8700_ENABLED - select I2C + depends on I2C help Enable driver for the FXOS8700 accelerometer/magnetometer. The driver also supports MMA8451Q, MMA8652FC and MMA8653FC diff --git a/drivers/sensor/hmc5883l/Kconfig b/drivers/sensor/hmc5883l/Kconfig index 3218336bb8c..61196f097b6 100644 --- a/drivers/sensor/hmc5883l/Kconfig +++ b/drivers/sensor/hmc5883l/Kconfig @@ -5,7 +5,7 @@ menuconfig HMC5883L bool "HMC5883L magnetometer" default y depends on DT_HAS_HONEYWELL_HMC5883L_ENABLED - select I2C + depends on I2C help Enable driver for HMC5883L I2C-based magnetometer. diff --git a/drivers/sensor/hp206c/Kconfig b/drivers/sensor/hp206c/Kconfig index b646c14bd60..cb1fe8f6f1b 100644 --- a/drivers/sensor/hp206c/Kconfig +++ b/drivers/sensor/hp206c/Kconfig @@ -8,7 +8,7 @@ menuconfig HP206C bool "HopeRF HP206C precision barometer and altimeter sensor" default y depends on DT_HAS_HOPERF_HP206C_ENABLED - select I2C + depends on I2C help Enable HopeRF HP206C barometer and altimeter support. diff --git a/drivers/sensor/hts221/Kconfig b/drivers/sensor/hts221/Kconfig index 5c3ff69273a..2ad1873780a 100644 --- a/drivers/sensor/hts221/Kconfig +++ b/drivers/sensor/hts221/Kconfig @@ -5,8 +5,7 @@ menuconfig HTS221 bool "HTS221 temperature and humidity sensor" default y depends on DT_HAS_ST_HTS221_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_HTS221),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_HTS221),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_HTS221 help diff --git a/drivers/sensor/i3g4250d/Kconfig b/drivers/sensor/i3g4250d/Kconfig index 4a9d5b80fd6..60b70d2ed54 100644 --- a/drivers/sensor/i3g4250d/Kconfig +++ b/drivers/sensor/i3g4250d/Kconfig @@ -7,7 +7,7 @@ config I3G4250D bool "I3G4250D three-axis digital output gyroscope" default y depends on DT_HAS_ST_I3G4250D_ENABLED - select SPI + depends on SPI select HAS_STMEMSC select USE_STDC_I3G4250D help diff --git a/drivers/sensor/icm42605/Kconfig b/drivers/sensor/icm42605/Kconfig index 961967de8c5..7b9f9a699a3 100644 --- a/drivers/sensor/icm42605/Kconfig +++ b/drivers/sensor/icm42605/Kconfig @@ -7,7 +7,7 @@ menuconfig ICM42605 bool "ICM42605 Six-Axis Motion Tracking Device" default y depends on DT_HAS_INVENSENSE_ICM42605_ENABLED - select SPI + depends on SPI help Enable driver for ICM42605 SPI-based six-axis motion tracking device. diff --git a/drivers/sensor/icm42670/Kconfig b/drivers/sensor/icm42670/Kconfig index 7548f5ed6a6..25d9a5d9104 100644 --- a/drivers/sensor/icm42670/Kconfig +++ b/drivers/sensor/icm42670/Kconfig @@ -9,7 +9,7 @@ menuconfig ICM42670 bool "ICM42670 Six-Axis Motion Tracking Device" default y depends on DT_HAS_INVENSENSE_ICM42670_ENABLED - select SPI + depends on SPI help Enable driver for ICM42670 SPI-based six-axis motion tracking device. diff --git a/drivers/sensor/iis2dh/Kconfig b/drivers/sensor/iis2dh/Kconfig index 5067b283ead..237cdc1fe99 100644 --- a/drivers/sensor/iis2dh/Kconfig +++ b/drivers/sensor/iis2dh/Kconfig @@ -7,8 +7,7 @@ menuconfig IIS2DH bool "IIS2DH I2C/SPI accelerometer sensor driver" default y depends on DT_HAS_ST_IIS2DH_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DH),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DH),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_IIS2DH help diff --git a/drivers/sensor/iis2dlpc/Kconfig b/drivers/sensor/iis2dlpc/Kconfig index d1dc0e5881a..f60ba3ec770 100644 --- a/drivers/sensor/iis2dlpc/Kconfig +++ b/drivers/sensor/iis2dlpc/Kconfig @@ -7,8 +7,7 @@ menuconfig IIS2DLPC bool "IIS2DLPC I2C/SPI accelerometer sensor driver" default y depends on DT_HAS_ST_IIS2DLPC_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DLPC),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DLPC),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_IIS2DLPC help diff --git a/drivers/sensor/iis2iclx/Kconfig b/drivers/sensor/iis2iclx/Kconfig index 030fc0bbd96..fe6326d8aec 100644 --- a/drivers/sensor/iis2iclx/Kconfig +++ b/drivers/sensor/iis2iclx/Kconfig @@ -7,8 +7,7 @@ menuconfig IIS2ICLX bool "IIS2ICLX I2C/SPI accelerometer Chip" default y depends on DT_HAS_ST_IIS2ICLX_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2ICLX),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2ICLX),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_IIS2ICLX help diff --git a/drivers/sensor/iis2mdc/Kconfig b/drivers/sensor/iis2mdc/Kconfig index 2215c778c28..7e9f17c230a 100644 --- a/drivers/sensor/iis2mdc/Kconfig +++ b/drivers/sensor/iis2mdc/Kconfig @@ -5,8 +5,7 @@ menuconfig IIS2MDC bool "IIS2MDC Magnetometer" default y depends on DT_HAS_ST_IIS2MDC_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2MDC),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2MDC),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_IIS2MDC help diff --git a/drivers/sensor/iis3dhhc/Kconfig b/drivers/sensor/iis3dhhc/Kconfig index ecd112aa928..be3e33506d8 100644 --- a/drivers/sensor/iis3dhhc/Kconfig +++ b/drivers/sensor/iis3dhhc/Kconfig @@ -7,7 +7,7 @@ menuconfig IIS3DHHC bool "IIS3DHHC accelerometer sensor" default y depends on DT_HAS_ST_IIS3DHHC_ENABLED - select SPI + depends on SPI select HAS_STMEMSC select USE_STDC_IIS3DHHC help diff --git a/drivers/sensor/ina219/Kconfig b/drivers/sensor/ina219/Kconfig index ce3f755c21e..0c6b44e2dff 100644 --- a/drivers/sensor/ina219/Kconfig +++ b/drivers/sensor/ina219/Kconfig @@ -7,6 +7,6 @@ config INA219 bool "INA219 Current/Power Monitor" default y depends on DT_HAS_TI_INA219_ENABLED - select I2C + depends on I2C help Enable driver for INA219 Bidirectional Current/Power Monitor. diff --git a/drivers/sensor/ina23x/Kconfig b/drivers/sensor/ina23x/Kconfig index 5624620b63d..2cfa19fc3c5 100644 --- a/drivers/sensor/ina23x/Kconfig +++ b/drivers/sensor/ina23x/Kconfig @@ -6,7 +6,7 @@ config INA23X bool "INA23X Current and Power Monitor" default y depends on DT_HAS_TI_INA230_ENABLED || DT_HAS_TI_INA237_ENABLED - select I2C + depends on I2C help Enable driver for INA23X Current and Power Monitor. diff --git a/drivers/sensor/isl29035/Kconfig b/drivers/sensor/isl29035/Kconfig index 36ff481302b..fec6a4eb426 100644 --- a/drivers/sensor/isl29035/Kconfig +++ b/drivers/sensor/isl29035/Kconfig @@ -7,7 +7,7 @@ menuconfig ISL29035 bool "ISL29035 light sensor" default y depends on DT_HAS_ISIL_ISL29035_ENABLED - select I2C + depends on I2C help Enable driver for the ISL29035 light sensor. diff --git a/drivers/sensor/ism330dhcx/Kconfig b/drivers/sensor/ism330dhcx/Kconfig index 75eb6d9fec9..baa995753d5 100644 --- a/drivers/sensor/ism330dhcx/Kconfig +++ b/drivers/sensor/ism330dhcx/Kconfig @@ -7,8 +7,7 @@ menuconfig ISM330DHCX bool "ISM330DHCX I2C/SPI accelerometer and gyroscope Chip" default y depends on DT_HAS_ST_ISM330DHCX_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_ISM330DHCX),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_ISM330DHCX),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_ISM330DHCX help diff --git a/drivers/sensor/lis2dh/Kconfig b/drivers/sensor/lis2dh/Kconfig index 4edc22cfb19..adfa62e323d 100644 --- a/drivers/sensor/lis2dh/Kconfig +++ b/drivers/sensor/lis2dh/Kconfig @@ -7,8 +7,7 @@ menuconfig LIS2DH bool "LIS2DH Three Axis Accelerometer" default y depends on DT_HAS_ST_LIS2DH_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DH),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DH),spi) + depends on I2C || SPI help Enable SPI/I2C-based driver for LIS2DH, LIS3DH, LSM303DLHC, LIS2DH12, LSM303AGR triaxial accelerometer sensors. diff --git a/drivers/sensor/lis2ds12/Kconfig b/drivers/sensor/lis2ds12/Kconfig index 14b063bd8ec..d3a8b427943 100644 --- a/drivers/sensor/lis2ds12/Kconfig +++ b/drivers/sensor/lis2ds12/Kconfig @@ -7,8 +7,7 @@ menuconfig LIS2DS12 bool "LIS2DS12 I2C/SPI accelerometer sensor driver" default y depends on DT_HAS_ST_LIS2DS12_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DS12),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DS12),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_LIS2DS12 help diff --git a/drivers/sensor/lis2dw12/Kconfig b/drivers/sensor/lis2dw12/Kconfig index 85fc6feb711..df31fb92fcd 100644 --- a/drivers/sensor/lis2dw12/Kconfig +++ b/drivers/sensor/lis2dw12/Kconfig @@ -7,8 +7,7 @@ menuconfig LIS2DW12 bool "LIS2DW12 I2C/SPI accelerometer sensor driver" default y depends on DT_HAS_ST_LIS2DW12_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DW12),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DW12),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_LIS2DW12 help diff --git a/drivers/sensor/lis2mdl/Kconfig b/drivers/sensor/lis2mdl/Kconfig index 6970a60555d..24aa28fa9c8 100644 --- a/drivers/sensor/lis2mdl/Kconfig +++ b/drivers/sensor/lis2mdl/Kconfig @@ -5,8 +5,7 @@ menuconfig LIS2MDL bool "LIS2MDL Magnetometer" default y depends on DT_HAS_ST_LIS2MDL_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2MDL),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2MDL),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_LIS2MDL help diff --git a/drivers/sensor/lis3mdl/Kconfig b/drivers/sensor/lis3mdl/Kconfig index e7f504b33bc..47e1f2eb168 100644 --- a/drivers/sensor/lis3mdl/Kconfig +++ b/drivers/sensor/lis3mdl/Kconfig @@ -5,7 +5,7 @@ menuconfig LIS3MDL bool "LIS3MDL magnetometer" default y depends on DT_HAS_ST_LIS3MDL_MAGN_ENABLED - select I2C + depends on I2C help Enable driver for LIS3MDL I2C-based magnetometer. diff --git a/drivers/sensor/lm75/Kconfig b/drivers/sensor/lm75/Kconfig index 9dd6425c9c0..d362cd17ca7 100644 --- a/drivers/sensor/lm75/Kconfig +++ b/drivers/sensor/lm75/Kconfig @@ -7,7 +7,7 @@ config LM75 bool "LM75 Temperature Sensor" default y depends on DT_HAS_LM75_ENABLED - select I2C + depends on I2C help Enable the driver for the LM75 digital temperature Sensor with 2-wire interface. Thermal Watchdog is not implemented diff --git a/drivers/sensor/lm77/Kconfig b/drivers/sensor/lm77/Kconfig index 554fe00cdc3..5e11ba512ed 100644 --- a/drivers/sensor/lm77/Kconfig +++ b/drivers/sensor/lm77/Kconfig @@ -8,7 +8,7 @@ menuconfig LM77 default y depends on DT_HAS_LM77_ENABLED default $(dt_compat_enabled,lm77) - select I2C + depends on I2C help Enable driver for the LM77 digital temperature sensor with 2-wire interface. diff --git a/drivers/sensor/lps22hb/Kconfig b/drivers/sensor/lps22hb/Kconfig index 2ac1dc4ddd5..55d6aba57ba 100644 --- a/drivers/sensor/lps22hb/Kconfig +++ b/drivers/sensor/lps22hb/Kconfig @@ -5,7 +5,7 @@ menuconfig LPS22HB bool "LPS22HB pressure and temperature" default y depends on DT_HAS_ST_LPS22HB_PRESS_ENABLED - select I2C + depends on I2C help Enable driver for LPS22HB I2C-based pressure and temperature sensor. diff --git a/drivers/sensor/lps22hh/Kconfig b/drivers/sensor/lps22hh/Kconfig index 79f29a5212c..b5b3fc5e9ec 100644 --- a/drivers/sensor/lps22hh/Kconfig +++ b/drivers/sensor/lps22hh/Kconfig @@ -7,8 +7,7 @@ menuconfig LPS22HH bool "LPS22HH pressure and temperature" default y depends on DT_HAS_ST_LPS22HH_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LPS22HH),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LPS22HH),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_LPS22HH help diff --git a/drivers/sensor/lps25hb/Kconfig b/drivers/sensor/lps25hb/Kconfig index 696e599382f..5c66ec50efd 100644 --- a/drivers/sensor/lps25hb/Kconfig +++ b/drivers/sensor/lps25hb/Kconfig @@ -5,7 +5,7 @@ menuconfig LPS25HB bool "LPS25HB pressure and temperature" default y depends on DT_HAS_ST_LPS25HB_PRESS_ENABLED - select I2C + depends on I2C help Enable driver for LPS25HB I2C-based pressure and temperature sensor. diff --git a/drivers/sensor/lsm303dlhc_magn/Kconfig b/drivers/sensor/lsm303dlhc_magn/Kconfig index ad7071ea8db..c522dac9861 100644 --- a/drivers/sensor/lsm303dlhc_magn/Kconfig +++ b/drivers/sensor/lsm303dlhc_magn/Kconfig @@ -7,7 +7,7 @@ menuconfig LSM303DLHC_MAGN bool "LSM303DLHC Three Axis Magnetometer" default y depends on DT_HAS_ST_LSM303DLHC_MAGN_ENABLED - select I2C + depends on I2C help Enable driver for LSM303DLHC I2C-based triaxial magnetometer sensor. diff --git a/drivers/sensor/lsm6ds0/Kconfig b/drivers/sensor/lsm6ds0/Kconfig index 80d81e1884b..d282b1de07e 100644 --- a/drivers/sensor/lsm6ds0/Kconfig +++ b/drivers/sensor/lsm6ds0/Kconfig @@ -8,7 +8,7 @@ menuconfig LSM6DS0 bool "LSM6DS0 I2C accelerometer and gyroscope Chip" default y depends on DT_HAS_ST_LSM6DS0_ENABLED - select I2C + depends on I2C help Enable driver for LSM6DS0 I2C-based accelerometer and gyroscope sensor. diff --git a/drivers/sensor/lsm6dsl/Kconfig b/drivers/sensor/lsm6dsl/Kconfig index f3be1d335f2..0f726143680 100644 --- a/drivers/sensor/lsm6dsl/Kconfig +++ b/drivers/sensor/lsm6dsl/Kconfig @@ -8,8 +8,7 @@ menuconfig LSM6DSL bool "LSM6DSL I2C/SPI accelerometer and gyroscope Chip" default y depends on DT_HAS_ST_LSM6DSL_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSL),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSL),spi) + depends on I2C || SPI help Enable driver for LSM6DSL accelerometer and gyroscope sensor. diff --git a/drivers/sensor/lsm6dso/Kconfig b/drivers/sensor/lsm6dso/Kconfig index f1948a9769e..75684af0357 100644 --- a/drivers/sensor/lsm6dso/Kconfig +++ b/drivers/sensor/lsm6dso/Kconfig @@ -7,8 +7,7 @@ menuconfig LSM6DSO bool "LSM6DSO I2C/SPI accelerometer and gyroscope Chip" default y depends on DT_HAS_ST_LSM6DSO_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSO),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSO),spi) + depends on I2C || SPI select HAS_STMEMSC select USE_STDC_LSM6DSO help diff --git a/drivers/sensor/lsm9ds0_gyro/Kconfig b/drivers/sensor/lsm9ds0_gyro/Kconfig index 46d2d931ab7..10ab69531f3 100644 --- a/drivers/sensor/lsm9ds0_gyro/Kconfig +++ b/drivers/sensor/lsm9ds0_gyro/Kconfig @@ -7,7 +7,7 @@ menuconfig LSM9DS0_GYRO bool "LSM9DS0 I2C gyroscope Chip" default y depends on DT_HAS_ST_LSM9DS0_GYRO_ENABLED - select I2C + depends on I2C help Enable driver for LSM9DS0 I2C-based gyroscope sensor. diff --git a/drivers/sensor/lsm9ds0_mfd/Kconfig b/drivers/sensor/lsm9ds0_mfd/Kconfig index 173a970d845..0205cdfe87c 100644 --- a/drivers/sensor/lsm9ds0_mfd/Kconfig +++ b/drivers/sensor/lsm9ds0_mfd/Kconfig @@ -7,7 +7,7 @@ menuconfig LSM9DS0_MFD bool "LSM9DS0 I2C accelerometer, magnetometer and temperature sensor chip" default y depends on DT_HAS_ST_LSM9DS0_MFD_ENABLED - select I2C + depends on I2C help Enable driver for LSM9DS0 I2C-based MFD sensor. diff --git a/drivers/sensor/max17055/Kconfig b/drivers/sensor/max17055/Kconfig index 9d91029340a..415ebf1c245 100644 --- a/drivers/sensor/max17055/Kconfig +++ b/drivers/sensor/max17055/Kconfig @@ -6,7 +6,7 @@ config MAX17055 bool "MAX17055 Fuel Gauge" default y depends on DT_HAS_MAXIM_MAX17055_ENABLED - select I2C + depends on I2C help Enable I2C-based driver for MAX17055 Fuel Gauge. This driver supports reading various sensor settings including charge level percentage, diff --git a/drivers/sensor/max17262/Kconfig b/drivers/sensor/max17262/Kconfig index b3bdeb180c0..4457fd0e932 100644 --- a/drivers/sensor/max17262/Kconfig +++ b/drivers/sensor/max17262/Kconfig @@ -6,7 +6,7 @@ config MAX17262 bool "MAX17262 Fuel Gauge" default y depends on DT_HAS_MAXIM_MAX17262_ENABLED - select I2C + depends on I2C help Enable I2C-based driver for MAX17262 Fuel Gauge. This driver supports reading various sensor settings including voltage, current, temperature, diff --git a/drivers/sensor/max30101/Kconfig b/drivers/sensor/max30101/Kconfig index 725460e58c3..8a5b73106e2 100644 --- a/drivers/sensor/max30101/Kconfig +++ b/drivers/sensor/max30101/Kconfig @@ -7,7 +7,7 @@ menuconfig MAX30101 bool "MAX30101 Pulse Oximeter and Heart Rate Sensor" default y depends on DT_HAS_MAXIM_MAX30101_ENABLED - select I2C + depends on I2C if MAX30101 diff --git a/drivers/sensor/max31875/Kconfig b/drivers/sensor/max31875/Kconfig index 15b39de8c1b..8c712afc755 100644 --- a/drivers/sensor/max31875/Kconfig +++ b/drivers/sensor/max31875/Kconfig @@ -7,6 +7,6 @@ config MAX31875 bool "MAX31875 Temperature Sensor" default y depends on DT_HAS_MAXIM_MAX31875_ENABLED - select I2C + depends on I2C help Enable the driver for Maxim MAX31875 Low-Power I2C Temperature Sensors. diff --git a/drivers/sensor/max44009/Kconfig b/drivers/sensor/max44009/Kconfig index a06b99e295a..d9efe897647 100644 --- a/drivers/sensor/max44009/Kconfig +++ b/drivers/sensor/max44009/Kconfig @@ -7,6 +7,6 @@ config MAX44009 bool "MAX44009 Light Sensor" default y depends on DT_HAS_MAXIM_MAX44009_ENABLED - select I2C + depends on I2C help Enable driver for MAX44009 light sensors. diff --git a/drivers/sensor/max6675/Kconfig b/drivers/sensor/max6675/Kconfig index d091a43dc1e..3c53dde2b48 100644 --- a/drivers/sensor/max6675/Kconfig +++ b/drivers/sensor/max6675/Kconfig @@ -5,7 +5,7 @@ config MAX6675 bool "MAX6675 K-thermocouple to digital converter" default y depends on DT_HAS_MAXIM_MAX6675_ENABLED - select SPI + depends on SPI help Enable MAX6675 cold-junction-compensated K-thermocouple to digital converter. diff --git a/drivers/sensor/mcp9808/Kconfig b/drivers/sensor/mcp9808/Kconfig index c487dd0b160..1a1ce4aeaaf 100644 --- a/drivers/sensor/mcp9808/Kconfig +++ b/drivers/sensor/mcp9808/Kconfig @@ -7,7 +7,7 @@ menuconfig MCP9808 bool "MCP9808 temperature sensor" default y depends on DT_HAS_MICROCHIP_MCP9808_ENABLED - select I2C + depends on I2C help Enable driver for MCP9808 temperature sensor. diff --git a/drivers/sensor/mpr/Kconfig b/drivers/sensor/mpr/Kconfig index 6ff57c2b651..239247d3327 100644 --- a/drivers/sensor/mpr/Kconfig +++ b/drivers/sensor/mpr/Kconfig @@ -7,7 +7,7 @@ menuconfig MPR bool "MPR pressure sensor" default y depends on DT_HAS_HONEYWELL_MPR_ENABLED - select I2C + depends on I2C help Enable driver for MPR pressure sensor. diff --git a/drivers/sensor/mpu6050/Kconfig b/drivers/sensor/mpu6050/Kconfig index 8fc3aec67ec..b2b29eb0b31 100644 --- a/drivers/sensor/mpu6050/Kconfig +++ b/drivers/sensor/mpu6050/Kconfig @@ -7,7 +7,7 @@ menuconfig MPU6050 bool "MPU6050 Six-Axis Motion Tracking Device" default y depends on DT_HAS_INVENSENSE_MPU6050_ENABLED - select I2C + depends on I2C help Enable driver for MPU6050 I2C-based six-axis motion tracking device. diff --git a/drivers/sensor/mpu9250/Kconfig b/drivers/sensor/mpu9250/Kconfig index a7cf942bed1..7a4c3172374 100644 --- a/drivers/sensor/mpu9250/Kconfig +++ b/drivers/sensor/mpu9250/Kconfig @@ -7,7 +7,7 @@ menuconfig MPU9250 bool "MPU9250 Nine-Axis Motion Tracking Device" default y depends on DT_HAS_INVENSENSE_MPU9250_ENABLED - select I2C + depends on I2C help Enable driver for MPU9250 I2C-based nine-axis motion tracking device. diff --git a/drivers/sensor/ms5607/Kconfig b/drivers/sensor/ms5607/Kconfig index b467d7af05f..a4e328de821 100644 --- a/drivers/sensor/ms5607/Kconfig +++ b/drivers/sensor/ms5607/Kconfig @@ -7,8 +7,7 @@ menuconfig MS5607 bool "MS5607 pressure and temperature sensor" default y depends on DT_HAS_MEAS_MS5607_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_MEAS_MS5607),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_MEAS_MS5607),spi) + depends on I2C || SPI help Enable driver for MS5607 pressure and temperature sensor. diff --git a/drivers/sensor/ms5837/Kconfig b/drivers/sensor/ms5837/Kconfig index d758d5970a0..730be670158 100644 --- a/drivers/sensor/ms5837/Kconfig +++ b/drivers/sensor/ms5837/Kconfig @@ -7,6 +7,6 @@ config MS5837 bool "MS5837 pressure and temperature sensor" default y depends on DT_HAS_MEAS_MS5837_ENABLED - select I2C + depends on I2C help Enable driver for MS5837 pressure and temperature sensor. diff --git a/drivers/sensor/opt3001/Kconfig b/drivers/sensor/opt3001/Kconfig index 6151eb24b55..ca8523b6c08 100644 --- a/drivers/sensor/opt3001/Kconfig +++ b/drivers/sensor/opt3001/Kconfig @@ -7,6 +7,6 @@ config OPT3001 bool "OPT3001 Light Sensor" default y depends on DT_HAS_TI_OPT3001_ENABLED - select I2C + depends on I2C help Enable driver for OPT3001 light sensors. diff --git a/drivers/sensor/sbs_gauge/Kconfig b/drivers/sensor/sbs_gauge/Kconfig index 51d4bed6f70..097ae9ada4e 100644 --- a/drivers/sensor/sbs_gauge/Kconfig +++ b/drivers/sensor/sbs_gauge/Kconfig @@ -5,6 +5,6 @@ config SBS_GAUGE bool "Smart Battery Fuel Gauge" default y depends on DT_HAS_SBS_SBS_GAUGE_ENABLED - select I2C + depends on I2C help Enable I2C-based/SMBus-based driver for a Smart Battery Fuel Gauge. diff --git a/drivers/sensor/sgp40/Kconfig b/drivers/sensor/sgp40/Kconfig index 2ec50212430..b0dfb14bb0b 100644 --- a/drivers/sensor/sgp40/Kconfig +++ b/drivers/sensor/sgp40/Kconfig @@ -7,6 +7,6 @@ config SGP40 bool "SGP40 Multipixel Gas Sensor" default y depends on DT_HAS_SENSIRION_SGP40_ENABLED - select I2C + depends on I2C help Enable driver for SGP40 Multipixel Gas Sensor. diff --git a/drivers/sensor/sht3xd/Kconfig b/drivers/sensor/sht3xd/Kconfig index 7bb04f2f9fa..8019ebcd672 100644 --- a/drivers/sensor/sht3xd/Kconfig +++ b/drivers/sensor/sht3xd/Kconfig @@ -7,7 +7,7 @@ menuconfig SHT3XD bool "SHT3xD Temperature and Humidity Sensor" default y depends on DT_HAS_SENSIRION_SHT3XD_ENABLED - select I2C + depends on I2C help Enable driver for SHT3xD temperature and humidity sensors. diff --git a/drivers/sensor/sht4x/Kconfig b/drivers/sensor/sht4x/Kconfig index f906a7bab77..382604f5658 100644 --- a/drivers/sensor/sht4x/Kconfig +++ b/drivers/sensor/sht4x/Kconfig @@ -7,6 +7,6 @@ config SHT4X bool "SHT4x Temperature and Humidity Sensor" default y depends on DT_HAS_SENSIRION_SHT4X_ENABLED - select I2C + depends on I2C help Enable driver for SHT4x temperature and humidity sensors. diff --git a/drivers/sensor/shtcx/Kconfig b/drivers/sensor/shtcx/Kconfig index 826f740fc6c..8ba81bebbb8 100644 --- a/drivers/sensor/shtcx/Kconfig +++ b/drivers/sensor/shtcx/Kconfig @@ -7,6 +7,6 @@ config SHTCX bool "SHTCX: SHTC1 and SHTC3 Temperature and Humidity Sensor" default y depends on DT_HAS_SENSIRION_SHTCX_ENABLED - select I2C + depends on I2C help Enable driver for SHTC1 and SHTC3 temperature and humidity sensors. diff --git a/drivers/sensor/si7006/Kconfig b/drivers/sensor/si7006/Kconfig index c45914c4364..f286f9e93e0 100644 --- a/drivers/sensor/si7006/Kconfig +++ b/drivers/sensor/si7006/Kconfig @@ -5,6 +5,6 @@ config SI7006 bool "Si7006 Temperature and Humidity Sensor" default y depends on DT_HAS_SILABS_SI7006_ENABLED - select I2C + depends on I2C help Enable I2C-based driver for Si7006 Temperature and Humidity Sensor. diff --git a/drivers/sensor/si7055/Kconfig b/drivers/sensor/si7055/Kconfig index caec6e4505c..7d26eb4fc48 100644 --- a/drivers/sensor/si7055/Kconfig +++ b/drivers/sensor/si7055/Kconfig @@ -6,7 +6,7 @@ menuconfig SI7055 bool "Si7055 Temperature Sensor" default y depends on DT_HAS_SILABS_SI7055_ENABLED - select I2C + depends on I2C help Enable I2C-based driver for Si7055 Temperature Sensor. diff --git a/drivers/sensor/si7060/Kconfig b/drivers/sensor/si7060/Kconfig index d7b7cf4507f..ce42d08400f 100644 --- a/drivers/sensor/si7060/Kconfig +++ b/drivers/sensor/si7060/Kconfig @@ -7,6 +7,6 @@ config SI7060 bool "SI7060 Temperature Sensor" default y depends on DT_HAS_SILABS_SI7060_ENABLED - select I2C + depends on I2C help Enable driver for SI7060 temperature sensors. diff --git a/drivers/sensor/si7210/Kconfig b/drivers/sensor/si7210/Kconfig index ea60036e50d..7fc47cbfa58 100644 --- a/drivers/sensor/si7210/Kconfig +++ b/drivers/sensor/si7210/Kconfig @@ -6,6 +6,6 @@ config SI7210 bool "Si7210 Hall Effect Magnetic Position and Temperature Sensor" default y depends on DT_HAS_SILABS_SI7210_ENABLED - select I2C + depends on I2C help Enable driver for Si7210 Hall Effect Magnetic Position and Temperature Sensor. diff --git a/drivers/sensor/stts751/Kconfig b/drivers/sensor/stts751/Kconfig index d048e117e10..0f9cb502b75 100644 --- a/drivers/sensor/stts751/Kconfig +++ b/drivers/sensor/stts751/Kconfig @@ -7,7 +7,7 @@ menuconfig STTS751 bool "STTS751 temperature sensor" default y depends on DT_HAS_ST_STTS751_ENABLED - select I2C + depends on I2C select HAS_STMEMSC select USE_STDC_STTS751 help diff --git a/drivers/sensor/sx9500/Kconfig b/drivers/sensor/sx9500/Kconfig index 2e1363a58e0..044742ee6ef 100644 --- a/drivers/sensor/sx9500/Kconfig +++ b/drivers/sensor/sx9500/Kconfig @@ -7,7 +7,7 @@ menuconfig SX9500 bool "SX9500 I2C SAR Proximity Chip" default y depends on DT_HAS_SEMTECH_SX9500_ENABLED - select I2C + depends on I2C help Enable driver for SX9500 I2C-based SAR proximity sensor. diff --git a/drivers/sensor/th02/Kconfig b/drivers/sensor/th02/Kconfig index e62f3333a15..9f24d0d2fef 100644 --- a/drivers/sensor/th02/Kconfig +++ b/drivers/sensor/th02/Kconfig @@ -5,6 +5,6 @@ config TH02 bool "TH02 Temperature Sensor" default y depends on DT_HAS_HOPERF_TH02_ENABLED - select I2C + depends on I2C help Enable driver for the TH02 temperature sensor. diff --git a/drivers/sensor/ti_hdc/Kconfig b/drivers/sensor/ti_hdc/Kconfig index ff23a2cc5e0..e379e8a2928 100644 --- a/drivers/sensor/ti_hdc/Kconfig +++ b/drivers/sensor/ti_hdc/Kconfig @@ -7,6 +7,6 @@ config TI_HDC bool "Texas Instruments Temperature and Humidity Sensor (e.g. HDC1008)" default y depends on DT_HAS_TI_HDC_ENABLED - select I2C + depends on I2C help Enable driver for TI temperature and humidity sensors. diff --git a/drivers/sensor/ti_hdc20xx/Kconfig b/drivers/sensor/ti_hdc20xx/Kconfig index 629b17c5a50..2e1f88a5dd7 100644 --- a/drivers/sensor/ti_hdc20xx/Kconfig +++ b/drivers/sensor/ti_hdc20xx/Kconfig @@ -8,7 +8,7 @@ config TI_HDC20XX default y depends on DT_HAS_TI_HDC2010_ENABLED || DT_HAS_TI_HDC2021_ENABLED || \ DT_HAS_TI_HDC2022_ENABLED || DT_HAS_TI_HDC2080_ENABLED - select I2C + depends on I2C help Enable driver for TI HDC20XX temperature and humidity sensors (e.g. HDC2010, HDC2021, HDC2022, HDC2080). diff --git a/drivers/sensor/tmp007/Kconfig b/drivers/sensor/tmp007/Kconfig index 0588215692e..a58fb3bbdf7 100644 --- a/drivers/sensor/tmp007/Kconfig +++ b/drivers/sensor/tmp007/Kconfig @@ -7,7 +7,7 @@ menuconfig TMP007 bool "TMP007 Infrared Thermopile Sensor" default y depends on DT_HAS_TI_TMP007_ENABLED - select I2C + depends on I2C help Enable driver for TMP007 infrared thermopile sensors. diff --git a/drivers/sensor/tmp108/Kconfig b/drivers/sensor/tmp108/Kconfig index d7fe6ba3d3f..2034f959c0e 100644 --- a/drivers/sensor/tmp108/Kconfig +++ b/drivers/sensor/tmp108/Kconfig @@ -7,7 +7,7 @@ menuconfig TMP108 bool "TMP108 Temperature Sensor" default y depends on DT_HAS_TI_TMP108_ENABLED - select I2C + depends on I2C help Enable driver for the TMP108 temperature sensor. diff --git a/drivers/sensor/tmp112/Kconfig b/drivers/sensor/tmp112/Kconfig index 19baeade7dc..c588a912b18 100644 --- a/drivers/sensor/tmp112/Kconfig +++ b/drivers/sensor/tmp112/Kconfig @@ -7,7 +7,7 @@ config TMP112 bool "TMP112 Temperature Sensor" default y depends on DT_HAS_TI_TMP112_ENABLED - select I2C + depends on I2C help Enable the driver for Texas Instruments TMP112 High-Accuracy Digital Temperature Sensors. diff --git a/drivers/sensor/tmp116/Kconfig b/drivers/sensor/tmp116/Kconfig index 37a5d60ed77..e1d641f08c3 100644 --- a/drivers/sensor/tmp116/Kconfig +++ b/drivers/sensor/tmp116/Kconfig @@ -7,6 +7,6 @@ config TMP116 bool "TMP116 and TMP117 Temperature Sensors" default y depends on DT_HAS_TI_TMP116_ENABLED - select I2C + depends on I2C help Enable driver for TMP116 and TMP117 temperature sensors. diff --git a/drivers/sensor/vcnl4040/Kconfig b/drivers/sensor/vcnl4040/Kconfig index 5973316ca6a..bea4fc15d95 100644 --- a/drivers/sensor/vcnl4040/Kconfig +++ b/drivers/sensor/vcnl4040/Kconfig @@ -7,7 +7,7 @@ menuconfig VCNL4040 bool "VCNL4040 Proximity and Ambient Light Sensor" default y depends on DT_HAS_VISHAY_VCNL4040_ENABLED - select I2C + depends on I2C help Enable driver for VCNL4040 sensors. diff --git a/drivers/sensor/vl53l0x/Kconfig b/drivers/sensor/vl53l0x/Kconfig index 936ef923c87..8f101df0453 100644 --- a/drivers/sensor/vl53l0x/Kconfig +++ b/drivers/sensor/vl53l0x/Kconfig @@ -7,7 +7,7 @@ menuconfig VL53L0X bool "VL53L0X time of flight sensor" default y depends on DT_HAS_ST_VL53L0X_ENABLED - select I2C + depends on I2C select HAS_STLIB help Enable driver for VL53L0X I2C-based time of flight sensor. diff --git a/drivers/sensor/wsen_itds/Kconfig b/drivers/sensor/wsen_itds/Kconfig index 17493a4e698..7c6e28e1bad 100644 --- a/drivers/sensor/wsen_itds/Kconfig +++ b/drivers/sensor/wsen_itds/Kconfig @@ -6,7 +6,7 @@ config ITDS bool "WSEN-ITDS 3-axis accel sensor" default y depends on DT_HAS_WE_WSEN_ITDS_ENABLED - select I2C + depends on I2C help Enable Wurth Elektronik WSEN-ITDS 3-axis acceleration sensor provides acceleration and die temperature measurement. From d51cd8f6c568239ab249297c1b07f213842c6a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 386/501] Revert "[nrf fromtree] scripts: build: elf_parser: use node name for Graphviz diagrams" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 184038f7b2ee6cf3a54d32759f4e35aa70cd1742. Signed-off-by: Andrzej Głąbek --- scripts/build/elf_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build/elf_parser.py b/scripts/build/elf_parser.py index c156e41939d..533c6489df1 100644 --- a/scripts/build/elf_parser.py +++ b/scripts/build/elf_parser.py @@ -268,8 +268,9 @@ def device_dependency_graph(self, title, comment): text = '{:s}\\nHandle: {:d}'.format(dev.sym.name, dev.handle) else: n = self.edt.dep_ord2node[dev.ordinal] + label = n.labels[0] if n.labels else n.label text = '{:s}\\nOrdinal: {:d} | Handle: {:d}\\n{:s}'.format( - n.name, dev.ordinal, dev.handle, n.path + label, dev.ordinal, dev.handle, n.path ) dot.node(str(dev.ordinal), text) for dev in self.devices: From cda085e34f2651f8133181fd191afd88225e0c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 387/501] Revert "[nrf fromtree] modules: openthread: Fix building with picolibc" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4d330a278b2c560b2840443d4ef2cf90ece1598f. Signed-off-by: Andrzej Głąbek --- modules/openthread/CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/openthread/CMakeLists.txt b/modules/openthread/CMakeLists.txt index 96c35edbce8..e19db58debd 100644 --- a/modules/openthread/CMakeLists.txt +++ b/modules/openthread/CMakeLists.txt @@ -433,11 +433,9 @@ target_compile_options(ot-config INTERFACE # errno_private.h is generated as part of ${SYSCALL_LIST_H_TARGET} target. add_dependencies(ot-config ${SYSCALL_LIST_H_TARGET}) -# Make sure C library, in case of newlib, is linked after OpenThread libraries -# (to prevent linker errors) -if(CONFIG_NEWLIB_LIBC) - target_link_libraries(ot-config INTERFACE -lc) -endif() +# Make sure C library is linked after OpenThread libraries (to prevent linker +# errors) +target_link_libraries(ot-config INTERFACE -lc) # Include OpenThread headers zephyr_system_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}/include) From 074145e13598683500b77d81d8723e77925f0b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 388/501] Revert "[nrf fromtree] west: adding --domain to west build synopsis" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4a1d2adb4417e0131c14aaf0d31745632d2078b0. Signed-off-by: Andrzej Głąbek --- scripts/west_commands/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index 0c62213d679..c4d0e09b851 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -26,7 +26,7 @@ west build [-h] [-b BOARD[@REV]]] [-d BUILD_DIR] [-t TARGET] [-p {auto, always, never}] [-c] [--cmake-only] [-n] [-o BUILD_OPT] [-f] - [--sysbuild | --no-sysbuild] [--domain DOMAIN] + [--sysbuild | --no-sysbuild] [source_dir] -- [cmake_opt [cmake_opt ...]] ''' From 9fc81c4ef4a45105b9443d9dbf450cb867f31c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 389/501] Revert "[nrf fromlist] boards: nrf5340dk_nrf5340_cpuapp: Add BT_HCI_VS explicit enable." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5f36de7a8fd8a95ce5d93f656080651ccbfed4b0. Signed-off-by: Andrzej Głąbek --- boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig b/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig index 611c3f3976c..7f34a0ca4b5 100644 --- a/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig +++ b/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig @@ -128,11 +128,6 @@ endchoice config HEAP_MEM_POOL_SIZE default 4096 if BT_RPMSG -# Application core does not have dependencies to the Controller. -# BT_HCI_VS must be explicitly enabled. -config BT_HCI_VS - default y if BT - endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS if BOARD_NRF5340DK_NRF5340_CPUNET From 1ad7c2b67ce9285fa82b680d3d876d4488a09b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 390/501] Revert "[nrf fromlist] cmake: fix improper use of separate_arguments" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bb403269b6b397ce6f200a1c449370c4b2c7f4ef. Signed-off-by: Andrzej Głąbek --- cmake/extra_flags.cmake | 10 +++++----- cmake/modules/unittest.cmake | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/extra_flags.cmake b/cmake/extra_flags.cmake index f60c0b67ce0..fa03a87fcc9 100644 --- a/cmake/extra_flags.cmake +++ b/cmake/extra_flags.cmake @@ -1,10 +1,10 @@ # SPDX-License-Identifier: Apache-2.0 -string(REPLACE " " ";" EXTRA_CPPFLAGS_AS_LIST "${EXTRA_CPPFLAGS}") -string(REPLACE " " ";" EXTRA_LDFLAGS_AS_LIST "${EXTRA_LDFLAGS}") -string(REPLACE " " ";" EXTRA_CFLAGS_AS_LIST "${EXTRA_CFLAGS}") -string(REPLACE " " ";" EXTRA_CXXFLAGS_AS_LIST "${EXTRA_CXXFLAGS}") -string(REPLACE " " ";" EXTRA_AFLAGS_AS_LIST "${EXTRA_AFLAGS}") +separate_arguments(EXTRA_CPPFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CPPFLAGS}) +separate_arguments(EXTRA_LDFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_LDFLAGS}) +separate_arguments(EXTRA_CFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CFLAGS}) +separate_arguments(EXTRA_CXXFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CXXFLAGS}) +separate_arguments(EXTRA_AFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_AFLAGS}) if(EXTRA_CPPFLAGS) zephyr_compile_options(${EXTRA_CPPFLAGS_AS_LIST}) diff --git a/cmake/modules/unittest.cmake b/cmake/modules/unittest.cmake index 9f185297447..c2d97cebbb4 100644 --- a/cmake/modules/unittest.cmake +++ b/cmake/modules/unittest.cmake @@ -8,11 +8,11 @@ enable_language(C CXX ASM) # SOURCES: list of source files, default main.c # INCLUDE: list of additional include paths relative to ZEPHYR_BASE -string(REPLACE " " ";" EXTRA_CFLAGS_AS_LIST "${EXTRA_CFLAGS}") -string(REPLACE " " ";" EXTRA_AFLAGS_AS_LIST "${EXTRA_AFLAGS}") -string(REPLACE " " ";" EXTRA_CPPFLAGS_AS_LIST "${EXTRA_CPPFLAGS}") -string(REPLACE " " ";" EXTRA_CXXFLAGS_AS_LIST "${EXTRA_CXXFLAGS}") -string(REPLACE " " ";" EXTRA_LDFLAGS_AS_LIST "${EXTRA_LDFLAGS}") +separate_arguments( EXTRA_CFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CFLAGS}) +separate_arguments( EXTRA_AFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_AFLAGS}) +separate_arguments(EXTRA_CPPFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CPPFLAGS}) +separate_arguments(EXTRA_CXXFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_CXXFLAGS}) +separate_arguments(EXTRA_LDFLAGS_AS_LIST UNIX_COMMAND ${EXTRA_LDFLAGS}) set(ENV_ZEPHYR_BASE $ENV{ZEPHYR_BASE}) # This add support for old style boilerplate include. From b4aae3bfc68a78d7acc581971859a61b504b7bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 391/501] Revert "[nrf noup] Revert "kconfig: default to LEGACY_INCLUDE_PATH=n"" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a05e795eb591a8acc913b08f029f430e9de393ad. Signed-off-by: Andrzej Głąbek --- Kconfig.zephyr | 1 - 1 file changed, 1 deletion(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 7795521b40b..4ea1af1713f 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -868,7 +868,6 @@ endmenu config LEGACY_INCLUDE_PATH bool "Allow for the legacy include paths (without the zephyr/ prefix)" - default y help Allow applications and libraries to use the Zephyr legacy include path which does not use the zephyr/ prefix. For example, the From 9f459ba29173545c65a1e7d50aeef333d38b645b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 392/501] Revert "[nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 05688726d76e9d8656d4dca4480447c424b417c1. Signed-off-by: Andrzej Głąbek --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 ------ subsys/mgmt/mcumgr/Kconfig | 1 - .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 27 ------------------- 3 files changed, 36 deletions(-) delete mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index c6594f00838..03dd7d8ed71 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -22,11 +22,3 @@ if (CONFIG_FS_MGMT_CHECKSUM_HASH AND CONFIG_FS_MGMT_HASH_SHA256) zephyr_link_libraries(mbedTLS) endif() endif() - -if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) -endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index ea0ad6612bb..20649f87b65 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,6 @@ menuconfig MCUMGR bool "mcumgr Support" select NET_BUF select ZCBOR - select BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP_QKAA help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c deleted file mode 100644 index 9971a4e0843..00000000000 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include "bootutil/bootutil_public.h" - -int boot_read_swap_state_primary_slot_hook(int image_index, - struct boot_swap_state *state) -{ - if (image_index == 1) { - /* Pretend that primary slot of image 1 unpopulated */ - state->magic = BOOT_MAGIC_UNSET; - state->swap_type = BOOT_SWAP_TYPE_NONE; - state->image_num = image_index; - state->copy_done = BOOT_FLAG_UNSET; - state->image_ok = BOOT_FLAG_UNSET; - - /* Prevent bootutil from trying to obtain true info */ - return 0; - } - - return BOOT_HOOK_REGULAR; -} From 5aeaeb7046b53efac8c828968e7506989ec19c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 393/501] Revert "[nrf noup] dts: choose cryptocell for entropy when available" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9b5c88d0ad4ba3fba5040d953cf1fc1d1a17478e. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf52840.dtsi | 2 +- dts/arm/nordic/nrf5340_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf5340_cpuappns.dtsi | 10 +--------- dts/arm/nordic/nrf9160.dtsi | 1 - dts/arm/nordic/nrf9160ns.dtsi | 17 ----------------- dts/bindings/crypto/nordic,nrf-cc310-sw.yaml | 17 ----------------- dts/bindings/crypto/nordic,nrf-cc312-sw.yaml | 17 ----------------- modules/hal_nordic/Kconfig.dt | 2 -- soc/arm/nordic_nrf/Kconfig.peripherals | 4 ++-- 9 files changed, 5 insertions(+), 67 deletions(-) delete mode 100644 dts/bindings/crypto/nordic,nrf-cc310-sw.yaml delete mode 100644 dts/bindings/crypto/nordic,nrf-cc312-sw.yaml diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 5e53a59d3f2..ab6651542df 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -5,7 +5,7 @@ / { chosen { - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index 1294203f00a..7a32c5398db 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -33,7 +33,7 @@ }; chosen { - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng_hci; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf5340_cpuappns.dtsi b/dts/arm/nordic/nrf5340_cpuappns.dtsi index 75f3a191607..e7393b3a900 100644 --- a/dts/arm/nordic/nrf5340_cpuappns.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns.dtsi @@ -29,7 +29,7 @@ }; chosen { - zephyr,entropy = &cryptocell_sw; + zephyr,entropy = &rng_hci; zephyr,flash-controller = &flash_controller; }; @@ -54,14 +54,6 @@ ipc { #include "nrf5340_cpuapp_ipc.dtsi" }; - - /* For cryptocell access via platform library; see above */ - cryptocell_sw: cryptocell-sw { - compatible = "nordic,nrf-cc312-sw"; - #address-cells = <0>; - label = "CRYPTOCELL_SW"; - status = "okay"; - }; }; &nvic { diff --git a/dts/arm/nordic/nrf9160.dtsi b/dts/arm/nordic/nrf9160.dtsi index 8d54777f9f5..39b3df32ad6 100644 --- a/dts/arm/nordic/nrf9160.dtsi +++ b/dts/arm/nordic/nrf9160.dtsi @@ -28,7 +28,6 @@ }; chosen { - zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf9160ns.dtsi b/dts/arm/nordic/nrf9160ns.dtsi index 366de073436..81d318a43e4 100644 --- a/dts/arm/nordic/nrf9160ns.dtsi +++ b/dts/arm/nordic/nrf9160ns.dtsi @@ -29,15 +29,6 @@ chosen { zephyr,flash-controller = &flash_controller; - - /* - * By default, system entropy comes from the entropy_cc310.c - * driver in the nrf repository. This is devicetree glue - * needed to make the system aware of that fact. Individual - * applications can override this by changing this property - * value. - */ - zephyr,entropy = &cryptocell_sw; }; soc { @@ -62,14 +53,6 @@ status = "disabled"; }; }; - - - /* For cryptocell access via platform library; see above */ - cryptocell_sw: cryptocell-sw { - compatible = "nordic,nrf-cc310-sw"; - label = "CRYPTOCELL_SW"; - status = "okay"; - }; }; &nvic { diff --git a/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml b/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml deleted file mode 100644 index a0724a45938..00000000000 --- a/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2020, Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Stub access to cryptocell via platform driver - - Non-secure configurations can use this compatible to declare - devicetree nodes which access the CC310 via callbacks into secure - code. - -compatible: "nordic,nrf-cc310-sw" - -include: base.yaml - -properties: - label: - required: true diff --git a/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml b/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml deleted file mode 100644 index 9c3f936bf20..00000000000 --- a/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2021, Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Stub access to cryptocell via platform driver - - Non-secure configurations can use this compatible to declare - devicetree nodes which access the CC312 via callbacks into secure - code. - -compatible: "nordic,nrf-cc312-sw" - -include: base.yaml - -properties: - label: - required: true diff --git a/modules/hal_nordic/Kconfig.dt b/modules/hal_nordic/Kconfig.dt index 49ea9861fbc..1ace20ac4a6 100644 --- a/modules/hal_nordic/Kconfig.dt +++ b/modules/hal_nordic/Kconfig.dt @@ -8,9 +8,7 @@ DT_COMPAT_NORDIC_NRF_ACL := nordic,nrf-acl DT_COMPAT_NORDIC_NRF_ADC := nordic,nrf-adc DT_COMPAT_NORDIC_NRF_BPROT := nordic,nrf-bprot DT_COMPAT_NORDIC_NRF_CC310 := nordic,nrf-cc310 -DT_COMPAT_NORDIC_NRF_CC310_SW := nordic,nrf-cc310-sw DT_COMPAT_NORDIC_NRF_CC312 := nordic,nrf-cc312 -DT_COMPAT_NORDIC_NRF_CC312_SW := nordic,nrf-cc312-sw DT_COMPAT_NORDIC_NRF_CCM := nordic,nrf-ccm DT_COMPAT_NORDIC_NRF_CLOCK := nordic,nrf-clock DT_COMPAT_NORDIC_NRF_COMP := nordic,nrf-comp diff --git a/soc/arm/nordic_nrf/Kconfig.peripherals b/soc/arm/nordic_nrf/Kconfig.peripherals index 3b2c3c438ee..f5ae9041b6e 100644 --- a/soc/arm/nordic_nrf/Kconfig.peripherals +++ b/soc/arm/nordic_nrf/Kconfig.peripherals @@ -13,10 +13,10 @@ config HAS_HW_NRF_BPROT def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT)) config HAS_HW_NRF_CC310 - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310)) || $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310_SW)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310)) config HAS_HW_NRF_CC312 - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312)) || $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312_SW)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312)) config HAS_HW_NRF_CCM def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM)) From 14279b4e54258d59fa62581ff6e5856128b26df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 394/501] Revert "[nrf noup] tree-wide: support NCS Partition Manager (PM) definitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8a92760d58c953337e489cc330c86f6ce2f376fd. Signed-off-by: Andrzej Głąbek --- Kconfig.zephyr | 4 +- cmake/modules/kernel.cmake | 4 -- drivers/flash/soc_flash_nrf.c | 11 ----- .../arm/aarch32/cortex_m/scripts/linker.ld | 46 ------------------- include/zephyr/storage/flash_map.h | 7 --- soc/arm/common/cortex_m/arm_mpu_regions.c | 13 ------ subsys/fs/littlefs_fs.c | 12 +---- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ----------- 8 files changed, 4 insertions(+), 120 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 4ea1af1713f..b0892a18fde 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -120,7 +120,9 @@ config FLASH_LOAD_SIZE endif # HAS_FLASH_LOAD_OFFSET config ROM_START_OFFSET - hex "ROM start offset" + hex + prompt "ROM start offset" if !BOOTLOADER_MCUBOOT + default 0x200 if BOOTLOADER_MCUBOOT default 0 help If the application is built for chain-loading by a bootloader this diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index c0a45cb0df5..461072cfe0b 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -239,7 +239,3 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() - -if(ZEPHYR_NRF_MODULE_DIR) - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) -endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index bc414d1fc74..2b81f5e9c99 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,11 +37,6 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -142,12 +137,6 @@ static int flash_nrf_read(const struct device *dev, off_t addr, return 0; } -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld index 0493a99dd6b..ba31e98a179 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -27,35 +27,6 @@ #define RAMABLE_REGION SRAM #endif -#if USE_PARTITION_MANAGER - -#include - -#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) -/* We are linking against S1, create symbol containing the flash ID of S0. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S0_ID; - -#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ - -#ifdef PM_S1_ID -/* We are linking against S0, create symbol containing the flash ID of S1. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S1_ID; -#endif /* PM_S1_ID */ - -#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ - -#define ROM_ADDR PM_ADDRESS -#define ROM_SIZE PM_SIZE - -#define RAM_SIZE PM_SRAM_SIZE -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -82,23 +53,6 @@ _image_1_primary_slot_id = PM_S1_ID; #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS #endif -#endif /* USE_PARTITION_MANAGER */ - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) -#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) -#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) -#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) -#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) -#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) -#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) -#endif - #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 794d4d13ec9..a0ea8ba4fb1 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -254,10 +254,6 @@ const struct device *flash_area_get_device(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); -#if USE_PARTITION_MANAGER -#include -#else - #define FLASH_AREA_LABEL_EXISTS(label) \ DT_HAS_FIXED_PARTITION_LABEL(label) @@ -283,9 +279,6 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); #define FLASH_AREA_DEVICE(label) \ DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODE_BY_FIXED_PARTITION_LABEL(label))) - -#endif /* USE_PARTITION_MANAGER */ - #ifdef __cplusplus } #endif diff --git a/soc/arm/common/cortex_m/arm_mpu_regions.c b/soc/arm/common/cortex_m/arm_mpu_regions.c index d44c2ee05b3..477dc30566c 100644 --- a/soc/arm/common/cortex_m/arm_mpu_regions.c +++ b/soc/arm/common/cortex_m/arm_mpu_regions.c @@ -9,9 +9,6 @@ #include #include "arm_mpu_mem_cfg.h" -#if USE_PARTITION_MANAGER -#include -#endif static const struct arm_mpu_region mpu_regions[] = { /* Region 0 */ @@ -25,14 +22,6 @@ static const struct arm_mpu_region mpu_regions[] = { #endif /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", -#if USE_PARTITION_MANAGER - PM_SRAM_ADDRESS, -#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) - REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), -#else - REGION_RAM_ATTR(REGION_SRAM_SIZE)), -#endif -#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -41,8 +30,6 @@ static const struct arm_mpu_region mpu_regions[] = { REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif -#endif /* USE_PARTITION_MANAGER */ - /* DT-defined regions */ LINKER_DT_REGION_MPU(ARM_MPU_REGION_INIT) }; diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index db871c519a0..eba34b6abf4 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -902,12 +902,6 @@ static const struct fs_file_system_t littlefs_fs = { .statvfs = littlefs_statvfs, }; -#ifdef USE_PARTITION_MANAGER -#define _LFS_USE_NCS_PM 1 -#else -#define _LFS_USE_NCS_PM 0 -#endif - #define DT_DRV_COMPAT zephyr_fstab_littlefs #define FS_PARTITION(inst) DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), partition, 0) #define FS_PARTITION_LABEL(inst) DT_STRING_TOKEN(FS_PARTITION(inst), label) @@ -943,11 +937,7 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = DT_INST_PROP(inst, mount_point), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *) (_LFS_USE_NCS_PM ?\ - COND_CODE_1(FLASH_AREA_LABEL_EXISTS(littlefs_storage), \ - (FLASH_AREA_ID(littlefs_storage)), \ - (FLASH_AREA_ID(storage))) :\ - FLASH_AREA_ID(FS_PARTITION_LABEL(inst))), \ + .storage_dev = (void *)FLASH_AREA_ID(FS_PARTITION_LABEL(inst)), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index b4adec43445..ab5df7c4297 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,35 +13,8 @@ extern "C" { #endif -#if CONFIG_PARTITION_MANAGER_ENABLED - -#include "pm_config.h" - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) -#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE -#else -/* The current image is a child image in a different domain than the image - * which defined the required values. To reach the values of the parent domain - * we use the 'PM__' variant of the define. - */ -#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ - -#else #define VDEV_START_ADDR CONFIG_RPMSG_SERVICE_SHM_BASE_ADDRESS #define VDEV_SIZE CONFIG_RPMSG_SERVICE_SHM_SIZE -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ - -#else - -#define VDEV_START_ADDR CONFIG_RPMSG_SERVICE_SHM_BASE_ADDRESS -#define VDEV_SIZE CONFIG_RPMSG_SERVICE_SHM_SIZE - -#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From a4e30945f78bce027069935187914b7f7a35dd38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 395/501] Revert "[nrf noup] ci: clang: parallel execution" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 914d890a5e871e234a7093fa31b65e694c516559. Signed-off-by: Andrzej Głąbek --- .github/workflows/clang.yaml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 8dd72dedf33..6e36e19d76c 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -22,13 +22,11 @@ jobs: fail-fast: false matrix: platform: ["native_posix"] - subset: [1, 2, 3, 4, 5] env: ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2 CLANG_ROOT_DIR: /usr/lib/llvm-12 COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} - MATRIX_SIZE: 5 outputs: report_needed: ${{ steps.twister.outputs.report_needed }} steps: @@ -91,7 +89,7 @@ jobs: id: cache-ccache uses: zephyrproject-rtos/action-s3-cache@v1 with: - key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.subset }}-ccache + key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.platform }}-ccache path: /github/home/.ccache aws-s3-bucket: ccache.zephyrproject.org aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }} @@ -104,17 +102,6 @@ jobs: test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache ccache -M 10G -s - - name: Build test plan with Twister - working-directory: ./zephyr - id: twister_test_plan - run: | - export ZEPHYR_BASE=${PWD} - export ZEPHYR_TOOLCHAIN_VARIANT=llvm - - # check if we need to run a full twister or not based on files changed - python3 ./scripts/ci/test_plan.py -p native_posix -c origin/${BASE_REF}.. - - - name: Run Tests with Twister working-directory: ./zephyr id: twister @@ -129,7 +116,7 @@ jobs: if [ -s testplan.json ]; then echo "::set-output name=report_needed::1"; # Full twister but with options based on changes - ./scripts/twister --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 --subset ${{matrix.subset}}/${MATRIX_SIZE} + ./scripts/twister --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 else # if nothing is run, skip reporting step echo "::set-output name=report_needed::0"; @@ -144,7 +131,7 @@ jobs: if: always() && steps.twister.outputs.report_needed != 0 uses: actions/upload-artifact@v2 with: - name: Unit Test Results (Subset ${{ matrix.subset }}) + name: Unit Test Results (Subset ${{ matrix.platform }}) path: zephyr/twister-out/twister.xml clang-build-results: From 7741bb7675473d290f3183e57132f8bc378fd84f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 396/501] Revert "[nrf noup] modules: mbedtls: Disable configurations in Kconfig.tls-generic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6c1dc7c07ccc16de7ebd934c5075141f3c296e9d. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/Kconfig.tls-generic | 35 -------------------- modules/mbedtls/configs/config-tls-generic.h | 4 --- 2 files changed, 39 deletions(-) diff --git a/modules/mbedtls/Kconfig.tls-generic b/modules/mbedtls/Kconfig.tls-generic index 7196b70f217..183ec0a07b3 100644 --- a/modules/mbedtls/Kconfig.tls-generic +++ b/modules/mbedtls/Kconfig.tls-generic @@ -9,8 +9,6 @@ menu "TLS configuration" menu "Supported TLS version" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_TLS_VERSION_1_0 bool "Support for TLS 1.0" select MBEDTLS_CIPHER @@ -35,8 +33,6 @@ config MBEDTLS_DTLS bool "Support for DTLS" depends on MBEDTLS_TLS_VERSION_1_1 || MBEDTLS_TLS_VERSION_1_2 -endif - config MBEDTLS_SSL_EXPORT_KEYS bool "Support for exporting SSL key block and master secret" depends on MBEDTLS_TLS_VERSION_1_0 || MBEDTLS_TLS_VERSION_1_1 || MBEDTLS_TLS_VERSION_1_2 @@ -51,8 +47,6 @@ menu "Ciphersuite configuration" comment "Supported key exchange modes" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED bool "All available ciphersuite modes" select MBEDTLS_KEY_EXCHANGE_PSK_ENABLED @@ -86,8 +80,6 @@ config MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED || \ MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -endif - config MBEDTLS_PSK_MAX_LEN int "Max size of TLS pre-shared keys" default 32 @@ -95,8 +87,6 @@ config MBEDTLS_PSK_MAX_LEN help Max size of TLS pre-shared keys, in bytes. -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED bool "RSA-only based ciphersuite modes" default y if !NET_L2_OPENTHREAD @@ -129,12 +119,8 @@ if MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED || \ MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED || \ MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED -endif - comment "Supported elliptic curves" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_ECP_ALL_ENABLED bool "All available elliptic curves" select MBEDTLS_ECP_DP_SECP192R1_ENABLED @@ -196,7 +182,6 @@ config MBEDTLS_ECP_NIST_OPTIM bool "NSIT curves optimization" endif -endif comment "Supported hash" @@ -221,8 +206,6 @@ config MBEDTLS_HASH_SHA512_ENABLED comment "Supported cipher modes" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_CIPHER_ALL_ENABLED bool "All available ciphers" select MBEDTLS_CIPHER_AES_ENABLED @@ -286,12 +269,8 @@ config MBEDTLS_CHACHAPOLY_AEAD_ENABLED bool "ChaCha20-Poly1305 AEAD algorithm" depends on MBEDTLS_CIPHER_CHACHA20_ENABLED || MBEDTLS_MAC_POLY1305_ENABLED -endif - comment "Supported message authentication methods" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_MAC_ALL_ENABLED bool "All available MAC methods" select MBEDTLS_MAC_MD4_ENABLED @@ -340,14 +319,10 @@ config MBEDTLS_MAC_CMAC_ENABLED bool "CMAC (Cipher-based Message Authentication Code) mode for block ciphers." depends on MBEDTLS_CIPHER_AES_ENABLED || MBEDTLS_CIPHER_DES_ENABLED -endif - endmenu comment "Random number generators" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_CTR_DRBG_ENABLED bool "CTR_DRBG AES-256-based random generator" depends on MBEDTLS_CIPHER_AES_ENABLED @@ -357,20 +332,14 @@ config MBEDTLS_HMAC_DRBG_ENABLED bool "HMAC_DRBG random generator" select MBEDTLS_MD -endif - comment "Other configurations" config MBEDTLS_CIPHER bool "generic cipher layer." -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_MD bool "generic message digest layer." -endif - config MBEDTLS_GENPRIME_ENABLED bool "prime-number generation code." @@ -388,14 +357,10 @@ config MBEDTLS_HAVE_ASM of asymmetric cryptography, however this might have an impact on the code size. -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_ENTROPY_ENABLED bool "MbedTLS generic entropy pool" depends on MBEDTLS_MAC_SHA256_ENABLED || MBEDTLS_MAC_SHA384_ENABLED || MBEDTLS_MAC_SHA512_ENABLED -endif - config MBEDTLS_OPENTHREAD_OPTIMIZATIONS_ENABLED bool "MbedTLS optimizations for OpenThread" depends on NET_L2_OPENTHREAD diff --git a/modules/mbedtls/configs/config-tls-generic.h b/modules/mbedtls/configs/config-tls-generic.h index b69fe914781..93ddfbbd1ad 100644 --- a/modules/mbedtls/configs/config-tls-generic.h +++ b/modules/mbedtls/configs/config-tls-generic.h @@ -455,10 +455,6 @@ #include CONFIG_MBEDTLS_USER_CONFIG_FILE #endif -#if defined(CONFIG_NRF_CC3XX_PLATFORM) -#define MBEDTLS_PLATFORM_ZEROIZE_ALT -#endif - #include "mbedtls/check_config.h" #endif /* MBEDTLS_CONFIG_H */ From cec61795f0946d0df409f923bca6a8659fe3ed9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 12 Oct 2022 12:29:11 +0200 Subject: [PATCH 397/501] Revert "[nrf noup] ci: workflows: set the name of checkout repo to zephyr" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 37160d6e3bd733e42b403aeb8016def5806b6458. Signed-off-by: Andrzej Głąbek --- .github/workflows/bluetooth-tests.yaml | 7 +++---- .github/workflows/clang.yaml | 11 ++--------- .github/workflows/compliance.yml | 8 +------- .github/workflows/doc-build.yml | 22 ++++++---------------- .github/workflows/twister_tests.yml | 3 --- 5 files changed, 12 insertions(+), 39 deletions(-) diff --git a/.github/workflows/bluetooth-tests.yaml b/.github/workflows/bluetooth-tests.yaml index 06027836a9a..2f714c06e3d 100644 --- a/.github/workflows/bluetooth-tests.yaml +++ b/.github/workflows/bluetooth-tests.yaml @@ -49,13 +49,11 @@ jobs: - name: checkout uses: actions/checkout@v2 with: - path: ./zephyr fetch-depth: 0 - name: west setup env: BASE_REF: ${{ github.base_ref }} - working-directory: ./zephyr run: | git config --global user.email "you@example.com" git config --global user.name "Your Name" @@ -66,7 +64,6 @@ jobs: west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log - name: Run Bluetooth Tests with BSIM - working-directory: ./zephyr run: | export ZEPHYR_BASE=${PWD} WORK_DIR=${ZEPHYR_BASE}/bsim_bt_out tests/bluetooth/bsim_bt/compile.sh @@ -78,7 +75,9 @@ jobs: uses: actions/upload-artifact@v2 with: name: bluetooth-test-results - path: ./zephyr/bsim_bt_out/bsim_results.xml + path: | + ./bsim_bt_out/bsim_results.xml + ${{ github.event_path }} - name: Upload Event Details if: always() diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 6e36e19d76c..df4a8c3536f 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -11,7 +11,7 @@ jobs: with: access_token: ${{ github.token }} clang-build: - runs-on: ubuntu-latest + runs-on: zephyr_runner needs: clang-build-prep container: image: ghcr.io/zephyrproject-rtos/ci:v0.23.3 @@ -48,10 +48,8 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 persist-credentials: false - path: ./zephyr - name: Environment Setup - working-directory: ./zephyr run: | echo "$HOME/.local/bin" >> $GITHUB_PATH git config --global user.email "bot@zephyrproject.org" @@ -69,7 +67,6 @@ jobs: west update --path-cache /github/cache/zephyrproject 2>&1 1> west.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west2.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject) - name: Check Environment - working-directory: ./zephyr run: | cmake --version ${CLANG_ROOT_DIR}/bin/clang --version @@ -77,7 +74,6 @@ jobs: ls -la - name: Prepare ccache timestamp/data - working-directory: ./zephyr id: ccache_cache_timestamp shell: cmake -P {0} run: | @@ -97,13 +93,11 @@ jobs: aws-region: us-east-2 - name: ccache stats initial - working-directory: ./zephyr run: | test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache ccache -M 10G -s - name: Run Tests with Twister - working-directory: ./zephyr id: twister run: | export ZEPHYR_BASE=${PWD} @@ -123,7 +117,6 @@ jobs: fi - name: ccache stats post - working-directory: ./zephyr run: | ccache -s @@ -132,7 +125,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: Unit Test Results (Subset ${{ matrix.platform }}) - path: zephyr/twister-out/twister.xml + path: twister-out/twister.xml clang-build-results: name: "Publish Unit Tests Results" diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 30274b27714..76e53ef7c5e 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -12,9 +12,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - path: ./zephyr - name: Run Maintainers Script - working-directory: ./zephyr id: maintainer env: BASE_REF: ${{ github.base_ref }} @@ -34,7 +32,6 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - path: ./zephyr - name: cache-pip uses: actions/cache@v1 @@ -50,7 +47,6 @@ jobs: pip3 install west - name: west setup - working-directory: ./zephyr env: BASE_REF: ${{ github.base_ref }} run: | @@ -66,7 +62,6 @@ jobs: west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log - name: Run Compliance Tests - working-directory: ./zephyr continue-on-error: true id: compliance env: @@ -83,10 +78,9 @@ jobs: continue-on-error: True with: name: compliance.xml - path: zephyr/compliance.xml + path: compliance.xml - name: check-warns - working-directory: ./zephyr run: | if [[ ! -s "compliance.xml" ]]; then exit 1; diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 383ad6aaa09..57ca2d5f42e 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -44,11 +44,8 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - with: - path: ./zephyr - name: install-pkgs - working-directory: ./zephyr run: | sudo apt-get update sudo apt-get install -y ninja-build graphviz libclang1-9 libclang-cpp9 @@ -60,22 +57,20 @@ jobs: uses: actions/cache@v1 with: path: ~/.cache/pip - key: pip-${{ hashFiles('zephyr/scripts/requirements-doc.txt') }} + key: pip-${{ hashFiles('scripts/requirements-doc.txt') }} - name: install-pip run: | sudo pip3 install -U setuptools wheel pip - pip3 install -r zephyr/scripts/requirements-doc.txt + pip3 install -r scripts/requirements-doc.txt pip3 install west==${WEST_VERSION} pip3 install cmake==${CMAKE_VERSION} - name: west setup - working-directory: ./zephyr run: | west init -l . - name: build-docs - working-directory: ./zephyr run: | if [[ "$GITHUB_REF" =~ "refs/tags/v" ]]; then DOC_TAG="release" @@ -92,7 +87,6 @@ jobs: DOC_TAG=${DOC_TAG} SPHINXOPTS="-q -W -t publish" make -C doc ${DOC_TARGET} - name: compress-docs - working-directory: ./zephyr run: | tar cfJ html-output.tar.xz --directory=doc/_build html @@ -100,7 +94,7 @@ jobs: uses: actions/upload-artifact@master with: name: html-output - path: zephyr/html-output.tar.xz + path: html-output.tar.xz - name: process-pr if: github.event_name == 'pull_request' @@ -131,8 +125,6 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - with: - path: ./zephyr - name: install-pkgs run: | @@ -143,22 +135,20 @@ jobs: uses: actions/cache@v1 with: path: ~/.cache/pip - key: pip-${{ hashFiles('zephyr/scripts/requirements-doc.txt') }} + key: pip-${{ hashFiles('scripts/requirements-doc.txt') }} - name: install-pip run: | pip3 install -U setuptools wheel pip - pip3 install -r zephyr/scripts/requirements-doc.txt + pip3 install -r scripts/requirements-doc.txt pip3 install west==${WEST_VERSION} pip3 install cmake==${CMAKE_VERSION} - name: west setup - working-directory: ./zephyr run: | west init -l . - name: build-docs - working-directory: ./zephyr run: | if [[ "$GITHUB_REF" =~ "refs/tags/v" ]]; then DOC_TAG="release" @@ -172,4 +162,4 @@ jobs: uses: actions/upload-artifact@master with: name: pdf-output - path: zephyr/doc/_build/latex/zephyr.pdf + path: doc/_build/latex/zephyr.pdf diff --git a/.github/workflows/twister_tests.yml b/.github/workflows/twister_tests.yml index 0fb39af0a81..4f96520e0dc 100644 --- a/.github/workflows/twister_tests.yml +++ b/.github/workflows/twister_tests.yml @@ -28,8 +28,6 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - with: - path: ./zephyr - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: @@ -46,7 +44,6 @@ jobs: run: | pip3 install pytest colorama pyyaml ply mock pykwalify - name: Run pytest - working-directory: ./zephyr env: ZEPHYR_BASE: ./ ZEPHYR_TOOLCHAIN_VARIANT: zephyr From 9fa98b8c9f291ac7cb1c893d3a4f42265c5477f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Mon, 31 Jan 2022 03:48:11 +0100 Subject: [PATCH 398/501] [nrf noup] modules: mbedtls: Disable configurations in Kconfig.tls-generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit prevents legacy mbed TLS configurations from being in conflict with PSA Configurations while using nrf_security -Removing use of unsupported TLS protocols (TLS 1.0, 1.1) -Required configurations are duplicated inside nrf_security Kconfig -Ensured that mbedtls_platform_zeroize is not duplicated when CONFIG_NRF_CC3XX_PLATFORM is set ref: NCSDK-13503 Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Andrzej Głąbek (cherry picked from commit 6c1dc7c07ccc16de7ebd934c5075141f3c296e9d) --- modules/mbedtls/Kconfig.tls-generic | 31 ++++++++++++++++++++ modules/mbedtls/configs/config-tls-generic.h | 4 +++ 2 files changed, 35 insertions(+) diff --git a/modules/mbedtls/Kconfig.tls-generic b/modules/mbedtls/Kconfig.tls-generic index 6475bd22c75..7b0f2fab837 100644 --- a/modules/mbedtls/Kconfig.tls-generic +++ b/modules/mbedtls/Kconfig.tls-generic @@ -9,6 +9,8 @@ menu "TLS configuration" menu "Supported TLS version" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_TLS_VERSION_1_0 bool "Support for TLS 1.0" select MBEDTLS_CIPHER @@ -33,6 +35,8 @@ config MBEDTLS_DTLS bool "Support for DTLS" depends on MBEDTLS_TLS_VERSION_1_1 || MBEDTLS_TLS_VERSION_1_2 +endif + config MBEDTLS_SSL_EXPORT_KEYS bool "Support for exporting SSL key block and master secret" depends on MBEDTLS_TLS_VERSION_1_0 || MBEDTLS_TLS_VERSION_1_1 || MBEDTLS_TLS_VERSION_1_2 @@ -47,6 +51,8 @@ menu "Ciphersuite configuration" comment "Supported key exchange modes" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED bool "All available ciphersuite modes" select MBEDTLS_KEY_EXCHANGE_PSK_ENABLED @@ -81,6 +87,8 @@ config MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED || \ MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED +endif + config MBEDTLS_PSK_MAX_LEN int "Max size of TLS pre-shared keys" default 32 @@ -88,6 +96,8 @@ config MBEDTLS_PSK_MAX_LEN help Max size of TLS pre-shared keys, in bytes. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED bool "RSA-only based ciphersuite modes" default y if !NET_L2_OPENTHREAD @@ -204,6 +214,7 @@ config MBEDTLS_ECP_NIST_OPTIM bool "NSIT curves optimization" endif +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) comment "Supported hash" @@ -228,6 +239,8 @@ config MBEDTLS_HASH_SHA512_ENABLED comment "Supported cipher modes" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CIPHER_ALL_ENABLED bool "All available ciphers" select MBEDTLS_CIPHER_AES_ENABLED @@ -292,8 +305,12 @@ config MBEDTLS_CHACHAPOLY_AEAD_ENABLED bool "ChaCha20-Poly1305 AEAD algorithm" depends on MBEDTLS_CIPHER_CHACHA20_ENABLED || MBEDTLS_MAC_POLY1305_ENABLED +endif + comment "Supported message authentication methods" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_MAC_ALL_ENABLED bool "All available MAC methods" select MBEDTLS_MAC_MD4_ENABLED @@ -342,10 +359,14 @@ config MBEDTLS_MAC_CMAC_ENABLED bool "CMAC (Cipher-based Message Authentication Code) mode for block ciphers." depends on MBEDTLS_CIPHER_AES_ENABLED || MBEDTLS_CIPHER_DES_ENABLED +endif + endmenu comment "Random number generators" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CTR_DRBG_ENABLED bool "CTR_DRBG AES-256-based random generator" depends on MBEDTLS_CIPHER_AES_ENABLED @@ -355,14 +376,20 @@ config MBEDTLS_HMAC_DRBG_ENABLED bool "HMAC_DRBG random generator" select MBEDTLS_MD +endif + comment "Other configurations" config MBEDTLS_CIPHER bool "generic cipher layer." +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_MD bool "generic message digest layer." +endif + config MBEDTLS_GENPRIME_ENABLED bool "prime-number generation code." @@ -380,11 +407,15 @@ config MBEDTLS_HAVE_ASM of asymmetric cryptography, however this might have an impact on the code size. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ENTROPY_ENABLED bool "MbedTLS generic entropy pool" depends on MBEDTLS_MAC_SHA256_ENABLED || MBEDTLS_MAC_SHA384_ENABLED || MBEDTLS_MAC_SHA512_ENABLED default y if MBEDTLS_ZEPHYR_ENTROPY +endif + config MBEDTLS_OPENTHREAD_OPTIMIZATIONS_ENABLED bool "MbedTLS optimizations for OpenThread" depends on NET_L2_OPENTHREAD diff --git a/modules/mbedtls/configs/config-tls-generic.h b/modules/mbedtls/configs/config-tls-generic.h index b012bad453a..4369d3ccbcb 100644 --- a/modules/mbedtls/configs/config-tls-generic.h +++ b/modules/mbedtls/configs/config-tls-generic.h @@ -460,6 +460,10 @@ #include CONFIG_MBEDTLS_USER_CONFIG_FILE #endif +#if defined(CONFIG_NRF_CC3XX_PLATFORM) +#define MBEDTLS_PLATFORM_ZEROIZE_ALT +#endif + #include "mbedtls/check_config.h" #endif /* MBEDTLS_CONFIG_H */ From ae483a6bad7ad9c46b243fdaa149d2f20e8617d6 Mon Sep 17 00:00:00 2001 From: Maciej Perkowski Date: Fri, 28 Jan 2022 12:02:58 +0100 Subject: [PATCH 399/501] [nrf noup] ci: clang: parallel execution Bring back parallel execution to the clang action. In the upstream they went to use a single dedicated powerfull agent to run this. We need to keep this as we have to base on agents available in github's cloud. Signed-off-by: Maciej Perkowski Signed-off-by: Gerard Marull-Paretas Signed-off-by: Dominik Ermel Signed-off-by: Torsten Rasmussen Signed-off-by: Maciej Perkowski (cherry picked from commit 914d890a5e871e234a7093fa31b65e694c516559) --- .github/workflows/clang.yaml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index d315d1daf49..6cf18f8e193 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -22,11 +22,13 @@ jobs: fail-fast: false matrix: platform: ["native_posix"] + subset: [1, 2, 3, 4, 5] env: ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 CLANG_ROOT_DIR: /usr/lib/llvm-12 COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} + MATRIX_SIZE: 5 outputs: report_needed: ${{ steps.twister.outputs.report_needed }} steps: @@ -85,7 +87,7 @@ jobs: id: cache-ccache uses: zephyrproject-rtos/action-s3-cache@v1 with: - key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.platform }}-ccache + key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.subset }}-ccache path: /github/home/.ccache aws-s3-bucket: ccache.zephyrproject.org aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }} @@ -97,6 +99,17 @@ jobs: test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache ccache -M 10G -s + - name: Build test plan with Twister + working-directory: ./zephyr + id: twister_test_plan + run: | + export ZEPHYR_BASE=${PWD} + export ZEPHYR_TOOLCHAIN_VARIANT=llvm + + # check if we need to run a full twister or not based on files changed + python3 ./scripts/ci/test_plan.py -p native_posix -c origin/${BASE_REF}.. + + - name: Run Tests with Twister id: twister run: | @@ -110,7 +123,7 @@ jobs: if [ -s testplan.json ]; then echo "::set-output name=report_needed::1"; # Full twister but with options based on changes - ./scripts/twister --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 + ./scripts/twister --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 --subset ${{matrix.subset}}/${MATRIX_SIZE} else # if nothing is run, skip reporting step echo "::set-output name=report_needed::0"; @@ -124,7 +137,7 @@ jobs: if: always() && steps.twister.outputs.report_needed != 0 uses: actions/upload-artifact@v2 with: - name: Unit Test Results (Subset ${{ matrix.platform }}) + name: Unit Test Results (Subset ${{ matrix.subset }}) path: twister-out/twister.xml clang-build-results: From 125f659cd77d0232e05e10dfc7c56a1065a1d091 Mon Sep 17 00:00:00 2001 From: Sigvart Hovland Date: Fri, 3 May 2019 14:21:52 +0200 Subject: [PATCH 400/501] [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partition Manager (PM) is a component of the nRF Connect SDK (NCS) which uses yaml files to resolve flash partition placement with a holistic view of the entire device, including each firmware image present on the flash device, and various subsystems, such as settings and NFFS. When this NCS extension is used, various source files which would use partition information from devicetree in "vanilla" zephyr instead use defines generated by PM instead. This commit removes support for HEX_FILES_TO_MERGE, as it conflicts with PM. The settings subsystem pm.yml defines a partition 'settings_storage'. The nffs subsystem pm.yml defines 'nffs_storage'. Leverage label translation to avoid patching partition names. Refer to the NCS documentation page for this feature for more details. This is a long-running out of tree patch which has been worked on by several people. The following sign-offs are in alphabetical order by first name. Signed-off-by: Andrzej Głąbek Signed-off-by: Andrzej Puzdrowski Signed-off-by: Dominik Ermel Signed-off-by: Håkon Øye Amundsen Signed-off-by: Ioannis Glaropoulos Signed-off-by: Joakim Andersson Signed-off-by: Johann Fischer Signed-off-by: Martí Bolívar Signed-off-by: Ole Sæther Signed-off-by: Robert Lubos Signed-off-by: Sebastian Bøe Signed-off-by: Sigvart Hovland Signed-off-by: Thomas Stenersen Signed-off-by: Torsten Rasmussen Signed-off-by: Øyvind Rønningstad Signed-off-by: Trond Einar Snekvik Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 8a92760d58c953337e489cc330c86f6ce2f376fd) --- Kconfig.zephyr | 4 +- cmake/modules/kernel.cmake | 4 ++ drivers/flash/soc_flash_nrf.c | 11 +++++ .../arm/aarch32/cortex_m/scripts/linker.ld | 46 +++++++++++++++++++ include/zephyr/storage/flash_map.h | 6 +++ soc/arm/common/cortex_m/arm_mpu_regions.c | 13 ++++++ subsys/fs/littlefs_fs.c | 7 ++- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 +++++++++++ 8 files changed, 114 insertions(+), 4 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index f60fc0d86b2..6f364c9d4c1 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -125,9 +125,7 @@ config FLASH_LOAD_SIZE endif # HAS_FLASH_LOAD_OFFSET config ROM_START_OFFSET - hex - prompt "ROM start offset" if !BOOTLOADER_MCUBOOT - default 0x200 if BOOTLOADER_MCUBOOT + hex "ROM start offset" default 0 help If the application is built for chain-loading by a bootloader this diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 10a4cdd8283..56eb1896b84 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -241,3 +241,7 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() + +if(ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) +endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 2b81f5e9c99..bc414d1fc74 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,6 +37,11 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -137,6 +142,12 @@ static int flash_nrf_read(const struct device *dev, off_t addr, return 0; } +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld index b9dc4806dc3..ce229d1d78c 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -27,6 +27,35 @@ #define RAMABLE_REGION SRAM #endif +#if USE_PARTITION_MANAGER + +#include + +#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) +/* We are linking against S1, create symbol containing the flash ID of S0. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S0_ID; + +#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ + +#ifdef PM_S1_ID +/* We are linking against S0, create symbol containing the flash ID of S1. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S1_ID; +#endif /* PM_S1_ID */ + +#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ + +#define ROM_ADDR PM_ADDRESS +#define ROM_SIZE PM_SIZE + +#define RAM_SIZE PM_SRAM_SIZE +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -53,6 +82,23 @@ #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS #endif +#endif /* USE_PARTITION_MANAGER */ + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) +#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) +#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) +#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) +#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) +#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) +#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) +#endif + #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index c765efde882..0d5e32fc83b 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -257,6 +257,10 @@ const struct device *flash_area_get_device(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); +#if USE_PARTITION_MANAGER +#include +#else + #define FLASH_AREA_LABEL_EXISTS(label) \ DT_HAS_FIXED_PARTITION_LABEL(label) @@ -329,6 +333,8 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); #define FIXED_PARTITION_DEVICE(label) \ DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label))) +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/soc/arm/common/cortex_m/arm_mpu_regions.c b/soc/arm/common/cortex_m/arm_mpu_regions.c index 477dc30566c..d44c2ee05b3 100644 --- a/soc/arm/common/cortex_m/arm_mpu_regions.c +++ b/soc/arm/common/cortex_m/arm_mpu_regions.c @@ -9,6 +9,9 @@ #include #include "arm_mpu_mem_cfg.h" +#if USE_PARTITION_MANAGER +#include +#endif static const struct arm_mpu_region mpu_regions[] = { /* Region 0 */ @@ -22,6 +25,14 @@ static const struct arm_mpu_region mpu_regions[] = { #endif /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", +#if USE_PARTITION_MANAGER + PM_SRAM_ADDRESS, +#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) + REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), +#else + REGION_RAM_ATTR(REGION_SRAM_SIZE)), +#endif +#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -30,6 +41,8 @@ static const struct arm_mpu_region mpu_regions[] = { REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif +#endif /* USE_PARTITION_MANAGER */ + /* DT-defined regions */ LINKER_DT_REGION_MPU(ARM_MPU_REGION_INIT) }; diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index e19c350e854..6bfdc0cb8a3 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -936,7 +936,12 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = DT_INST_PROP(inst, mount_point), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *)DT_FIXED_PARTITION_ID(FS_PARTITION(inst)), \ + .storage_dev = (void *) \ + COND_CODE_1(USE_PARTITION_MANAGER, \ + (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ + (FIXED_PARTITION_ID(littlefs_storage)), \ + (FIXED_PARTITION_ID(storage)))), \ + (DT_FIXED_PARTITION_ID(FS_PARTITION(inst)))), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index a74e46b8520..9996e1d74d9 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,8 +13,35 @@ extern "C" { #endif +#if CONFIG_PARTITION_MANAGER_ENABLED + +#include "pm_config.h" + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) +#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE +#else +/* The current image is a child image in a different domain than the image + * which defined the required values. To reach the values of the parent domain + * we use the 'PM__' variant of the define. + */ +#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ + +#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ + +#else + +#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) +#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) + +#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From 74b0843949fb8c520adf8df7ffc448457d01746f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Fri, 24 Apr 2020 16:20:07 -0700 Subject: [PATCH 401/501] [nrf noup] dts: choose cryptocell for entropy when available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a long-term noup patch because driver support is NCS-only. Add compatibles for CC310 and CC312 NS access. These downstream-only compatibles allow accessing the cryptocell from non-secure code. Use these, as well as pre-existing nodes for accessing the hardware directly from the secure world, in the relevant .dtsi files. Set HAS_HW_NRF_CC3XX when cryptocell-sw is present. Signed-off-by: Martí Bolívar Signed-off-by: Joakim Andersson Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Ioannis Glaropoulos Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Torsten Rasmussen Signed-off-by: Andrzej Głąbek (cherry picked from commit 9b5c88d0ad4ba3fba5040d953cf1fc1d1a17478e) --- dts/arm/nordic/nrf52840.dtsi | 2 +- dts/arm/nordic/nrf5340_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf5340_cpuappns.dtsi | 9 ++++++++- dts/arm/nordic/nrf9160.dtsi | 1 + dts/arm/nordic/nrf9160ns.dtsi | 16 ++++++++++++++++ dts/bindings/crypto/nordic,nrf-cc310-sw.yaml | 13 +++++++++++++ dts/bindings/crypto/nordic,nrf-cc312-sw.yaml | 13 +++++++++++++ soc/arm/nordic_nrf/Kconfig.peripherals | 4 ++-- 8 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 dts/bindings/crypto/nordic,nrf-cc310-sw.yaml create mode 100644 dts/bindings/crypto/nordic,nrf-cc312-sw.yaml diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 383a026f6a7..b49d126e446 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -5,7 +5,7 @@ / { chosen { - zephyr,entropy = &rng; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index 7a32c5398db..1294203f00a 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -33,7 +33,7 @@ }; chosen { - zephyr,entropy = &rng_hci; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf5340_cpuappns.dtsi b/dts/arm/nordic/nrf5340_cpuappns.dtsi index e7393b3a900..f7c77a4f4c6 100644 --- a/dts/arm/nordic/nrf5340_cpuappns.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns.dtsi @@ -29,7 +29,7 @@ }; chosen { - zephyr,entropy = &rng_hci; + zephyr,entropy = &cryptocell_sw; zephyr,flash-controller = &flash_controller; }; @@ -54,6 +54,13 @@ ipc { #include "nrf5340_cpuapp_ipc.dtsi" }; + + /* For cryptocell access via platform library; see above */ + cryptocell_sw: cryptocell-sw { + compatible = "nordic,nrf-cc312-sw"; + #address-cells = <0>; + status = "okay"; + }; }; &nvic { diff --git a/dts/arm/nordic/nrf9160.dtsi b/dts/arm/nordic/nrf9160.dtsi index 39b3df32ad6..8d54777f9f5 100644 --- a/dts/arm/nordic/nrf9160.dtsi +++ b/dts/arm/nordic/nrf9160.dtsi @@ -28,6 +28,7 @@ }; chosen { + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf9160ns.dtsi b/dts/arm/nordic/nrf9160ns.dtsi index 81d318a43e4..ce7251e7ee2 100644 --- a/dts/arm/nordic/nrf9160ns.dtsi +++ b/dts/arm/nordic/nrf9160ns.dtsi @@ -29,6 +29,15 @@ chosen { zephyr,flash-controller = &flash_controller; + + /* + * By default, system entropy comes from the entropy_cc310.c + * driver in the nrf repository. This is devicetree glue + * needed to make the system aware of that fact. Individual + * applications can override this by changing this property + * value. + */ + zephyr,entropy = &cryptocell_sw; }; soc { @@ -53,6 +62,13 @@ status = "disabled"; }; }; + + + /* For cryptocell access via platform library; see above */ + cryptocell_sw: cryptocell-sw { + compatible = "nordic,nrf-cc310-sw"; + status = "okay"; + }; }; &nvic { diff --git a/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml b/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml new file mode 100644 index 00000000000..51e46595ea1 --- /dev/null +++ b/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml @@ -0,0 +1,13 @@ +# Copyright (c) 2020, Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Stub access to cryptocell via platform driver + + Non-secure configurations can use this compatible to declare + devicetree nodes which access the CC310 via callbacks into secure + code. + +compatible: "nordic,nrf-cc310-sw" + +include: base.yaml diff --git a/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml b/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml new file mode 100644 index 00000000000..156aa84b7bf --- /dev/null +++ b/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml @@ -0,0 +1,13 @@ +# Copyright (c) 2021, Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Stub access to cryptocell via platform driver + + Non-secure configurations can use this compatible to declare + devicetree nodes which access the CC312 via callbacks into secure + code. + +compatible: "nordic,nrf-cc312-sw" + +include: base.yaml diff --git a/soc/arm/nordic_nrf/Kconfig.peripherals b/soc/arm/nordic_nrf/Kconfig.peripherals index f5ae9041b6e..3b2c3c438ee 100644 --- a/soc/arm/nordic_nrf/Kconfig.peripherals +++ b/soc/arm/nordic_nrf/Kconfig.peripherals @@ -13,10 +13,10 @@ config HAS_HW_NRF_BPROT def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT)) config HAS_HW_NRF_CC310 - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310)) || $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310_SW)) config HAS_HW_NRF_CC312 - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312)) || $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312_SW)) config HAS_HW_NRF_CCM def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM)) From 30c73ee610abd5d55c97e4ec94b9513984d57859 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 23 Jun 2022 14:10:01 +0000 Subject: [PATCH 402/501] [nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit adds bootutil hook, for nrf5340, to allow it handling the non-accessible image-1/primary slot. Signed-off-by: Dominik Ermel Signed-off-by: Andrzej Głąbek (cherry picked from commit 05688726d76e9d8656d4dca4480447c424b417c1) --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 ++++++ subsys/mgmt/mcumgr/Kconfig | 1 + .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 27 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index 47e6887cfda..b3c9b7cb099 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -9,3 +9,11 @@ zephyr_library_sources_ifdef(CONFIG_MCUMGR_SMP_REASSEMBLY smp_reassembly.c) add_subdirectory(lib) zephyr_library_link_libraries(MCUMGR) + +if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 29a67a54e9d..973f56e1de8 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,6 +6,7 @@ menuconfig MCUMGR bool "mcumgr Support" select NET_BUF select ZCBOR + select BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_CMD_IMG_MGMT) help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c new file mode 100644 index 00000000000..9971a4e0843 --- /dev/null +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "bootutil/bootutil_public.h" + +int boot_read_swap_state_primary_slot_hook(int image_index, + struct boot_swap_state *state) +{ + if (image_index == 1) { + /* Pretend that primary slot of image 1 unpopulated */ + state->magic = BOOT_MAGIC_UNSET; + state->swap_type = BOOT_SWAP_TYPE_NONE; + state->image_num = image_index; + state->copy_done = BOOT_FLAG_UNSET; + state->image_ok = BOOT_FLAG_UNSET; + + /* Prevent bootutil from trying to obtain true info */ + return 0; + } + + return BOOT_HOOK_REGULAR; +} From 68a515f0f32d369a8b0c63ad77c47a95e9a0d427 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Thu, 5 May 2022 12:04:26 +0200 Subject: [PATCH 403/501] [nrf noup] boards: Enable TF-M by default for nordic SoC NS boards Enable TF-M by default for nordic nRF5340 and nrf9160 SoC boards. NCSDK-14811 Signed-off-by: Joakim Andersson Signed-off-by: Jamie McCrae (cherry picked from commit 2ede29c77a7a240aca62a06831504961136c27d3) --- .../circuitdojo_feather_nrf9160/Kconfig.defconfig | 15 +++++++++++++++ .../sparkfun_thing_plus_nrf9160/Kconfig.defconfig | 15 +++++++++++++++ boards/arm/thingy53_nrf5340/Kconfig.defconfig | 15 +++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig index 73648be3ef1..f37bfbf84fb 100644 --- a/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig +++ b/boards/arm/circuitdojo_feather_nrf9160/Kconfig.defconfig @@ -9,6 +9,21 @@ if BOARD_CIRCUITDOJO_FEATHER_NRF9160 || BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS config BOARD default "circuitdojo_feather_nrf9160" +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig index 8ae5b832d89..3d98b1b4cb4 100644 --- a/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig +++ b/boards/arm/sparkfun_thing_plus_nrf9160/Kconfig.defconfig @@ -9,6 +9,21 @@ if BOARD_SPARKFUN_THING_PLUS_NRF9160 || BOARD_SPARKFUN_THING_PLUS_NRF9160_NS config BOARD default "sparkfun_thing_plus_nrf9160" +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- diff --git a/boards/arm/thingy53_nrf5340/Kconfig.defconfig b/boards/arm/thingy53_nrf5340/Kconfig.defconfig index c5ae7da4c3b..aafabf0e9c9 100644 --- a/boards/arm/thingy53_nrf5340/Kconfig.defconfig +++ b/boards/arm/thingy53_nrf5340/Kconfig.defconfig @@ -8,6 +8,21 @@ if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config BOARD default "thingy53_nrf5340_cpuapp" +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_THINGY53_NRF5340_CPUAPP_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + # Code Partition: # # For the secure version of the board the firmware is linked at the beginning From 768e5239e4ced2bbafaa482c070b797dd3443e86 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Mon, 15 Aug 2022 02:45:06 +0530 Subject: [PATCH 404/501] [nrf noup] wifi_stats: Add nRF Wi-Fi management Until we merge with Zephyr's Wi-Fi management, add nRF Wi-Fi management support for Wi-Fi stats. Signed-off-by: Krishna T (cherry picked from commit cd53492175092c172156add03026c700f03fb61e) --- subsys/net/ip/Kconfig.stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 147b002d603..639685e420d 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -127,7 +127,7 @@ config NET_STATISTICS_POWER_MANAGEMENT config NET_STATISTICS_WIFI bool "Wi-Fi statistics" - depends on NET_L2_WIFI_MGMT + depends on NET_L2_WIFI_MGMT || NET_L2_NRF_WIFI_MGMT default y help Keep track of Wi-Fi related statistics. Note that this From 0806a1a907b2659409d28141fe2e67d2316c8347 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Mon, 10 Oct 2022 16:21:21 +0530 Subject: [PATCH 405/501] [nrf noup] net: wifi: Add support for WPA supplicant If WPA supplicant is enabled at build time, then use the WPA supplicant APIs, else use offload driver APIs. Remove the unused macro NRF_WIFI_MGMT now. Signed-off-by: Krishna T (cherry picked from commit d4b8ac4db1ed463928126383281b1989d200653b) --- subsys/net/ip/Kconfig.stats | 2 +- subsys/net/ip/net_private.h | 2 +- subsys/net/l2/wifi/wifi_mgmt.c | 45 +++++++++++++++++++--------------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 639685e420d..147b002d603 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -127,7 +127,7 @@ config NET_STATISTICS_POWER_MANAGEMENT config NET_STATISTICS_WIFI bool "Wi-Fi statistics" - depends on NET_L2_WIFI_MGMT || NET_L2_NRF_WIFI_MGMT + depends on NET_L2_WIFI_MGMT default y help Keep track of Wi-Fi related statistics. Note that this diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 24ef97fbe4f..5f1a00975ab 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -24,7 +24,7 @@ * NOTE: Update comments here and calculate which struct occupies max size. */ -#if defined(CONFIG_NET_L2_WIFI_MGMT) || defined(CONFIG_NET_L2_NRF_WIFI_MGMT) +#if defined(CONFIG_NET_L2_WIFI_MGMT) #include #define NET_EVENT_INFO_MAX_SIZE sizeof(struct wifi_scan_result) diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 92aa47a9bbd..994cce913d5 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -12,6 +12,9 @@ LOG_MODULE_REGISTER(net_wifi_mgmt, CONFIG_NET_L2_WIFI_MGMT_LOG_LEVEL); #include #include #include +#ifdef CONFIG_WPA_SUPP +#include "supp_api.h" +#endif static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) @@ -19,12 +22,15 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, struct wifi_connect_req_params *params = (struct wifi_connect_req_params *)data; const struct device *dev = net_if_get_device(iface); +#ifndef CONFIG_WPA_SUPP struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; + if (off_api == NULL || off_api->connect == NULL) { return -ENOTSUP; } +#endif /* CONFIG_WPA_SUPP */ LOG_HEXDUMP_DBG(params->ssid, params->ssid_length, "ssid"); LOG_HEXDUMP_DBG(params->psk, params->psk_length, "psk"); @@ -48,8 +54,11 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, !params->ssid) { return -EINVAL; } - +#ifdef CONFIG_WPA_SUPP + return zephyr_supp_connect(dev, params); +#else return off_api->connect(dev, params); +#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_CONNECT, wifi_connect); @@ -97,6 +106,10 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); + +#ifdef CONFIG_WPA_SUPP + return zephyr_supp_disconnect(dev); +#else struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -105,6 +118,7 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, } return off_api->disconnect(dev); +#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_DISCONNECT, wifi_disconnect); @@ -168,27 +182,25 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE, wifi_ap_disable); static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { - int ret; const struct device *dev = net_if_get_device(iface); - struct net_wifi_mgmt_offload *off_api = - (struct net_wifi_mgmt_offload *) dev->api; struct wifi_iface_status *status = data; - if (off_api == NULL || off_api->iface_status == NULL) { - return -ENOTSUP; - } - if (!data || len != sizeof(*status)) { return -EINVAL; } - ret = off_api->iface_status(dev, status); +#ifdef CONFIG_WPA_SUPP + return zephyr_supp_status(dev, status); +#else + struct net_wifi_mgmt_offload *off_api = + (struct net_wifi_mgmt_offload *) dev->api; - if (ret) { - return ret; + if (off_api == NULL || off_api->iface_status == NULL) { + return -ENOTSUP; } - return 0; + return off_api->iface_status(dev, status); +#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS, wifi_iface_status); @@ -204,7 +216,6 @@ void wifi_mgmt_raise_iface_status_event(struct net_if *iface, static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { - int ret; const struct device *dev = net_if_get_device(iface); struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -218,13 +229,7 @@ static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, return -EINVAL; } - ret = off_api->get_stats(dev, stats); - - if (ret) { - return ret; - } - - return 0; + return off_api->get_stats(dev, stats); } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats); #endif /* CONFIG_NET_STATISTICS_WIFI */ From 9052fcbb7f5397f1f0dba9b5f9ca8c829e4f46d8 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 5 Oct 2022 15:36:28 +0200 Subject: [PATCH 406/501] [nrf fromtree] tfm: Update TF-M for fix to return error code with invalid params in NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update TF-M to include fix that returns PSA_ERROR_PROGRAMMER_ERROR when the NS sends a request with malformed packet parameters for the NS APIs in library mode. This also changed the S APIs to return PSA_ERROR_PROGRAMMER_ERROR instead of PSA_ERROR_INVALID_ARGUMENT in library mode. Signed-off-by: Joakim Andersson Signed-off-by: Andrzej Głąbek (cherry picked from commit 8d7d653018f8437bc1bf4941fc8301dd9a63bcef after resolving a conflict on the trusted-firmware-m project revision) --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index a03415bd475..d4044e23b8a 100644 --- a/west.yml +++ b/west.yml @@ -235,7 +235,7 @@ manifest: groups: - debug - name: trusted-firmware-m - revision: 4c984817d861512edaeca27b83308e9b9915a98a + revision: d7c82cb813e283b96770ba19b68a50d6bcc9931f path: modules/tee/tf-m/trusted-firmware-m groups: - tee @@ -245,7 +245,7 @@ manifest: groups: - tee - name: tf-m-tests - revision: c99a86b295c4887520da9d8402566d7f225c974e + revision: bcb53bccccdc05c713aade707e7a8ddad35c210f path: modules/tee/tf-m/tf-m-tests groups: - tee From 232951035e295219012c1006458cf3f59b3718f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 29 Sep 2022 13:26:12 +0200 Subject: [PATCH 407/501] [nrf fromtree] tests: kernel: timer_behavior: Fix building on targets with small SRAM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the default configuration of the test, with 10000 timer samples, the `periodic_data` array is too big to fit in SRAM on many targets. Use lower counts of samples for those, depending on their SRAM size, leaving at least 8 kB for other variables, buffers, stacks etc. Exclude the test for targets with less than 16 kB. Signed-off-by: Andrzej Głąbek (cherry picked from commit a30a65215d34a791f49e20567019bc00f8d8fddd) --- tests/kernel/timer/timer_behavior/Kconfig | 5 +++++ tests/kernel/timer/timer_behavior/testcase.yaml | 1 + 2 files changed, 6 insertions(+) diff --git a/tests/kernel/timer/timer_behavior/Kconfig b/tests/kernel/timer/timer_behavior/Kconfig index 9b211aee558..4ed23993aeb 100644 --- a/tests/kernel/timer/timer_behavior/Kconfig +++ b/tests/kernel/timer/timer_behavior/Kconfig @@ -7,6 +7,11 @@ source "Kconfig.zephyr" config TIMER_TEST_SAMPLES int "The number of timer samples to gather for statistics" + default 1000 if (SRAM_SIZE < 24) + default 2000 if (SRAM_SIZE < 32) + default 3000 if (SRAM_SIZE < 48) + default 5000 if (SRAM_SIZE < 64) + default 7000 if (SRAM_SIZE < 96) default 10000 config TIMER_TEST_PERIOD diff --git a/tests/kernel/timer/timer_behavior/testcase.yaml b/tests/kernel/timer/timer_behavior/testcase.yaml index 86a13d8159f..707bd7668de 100644 --- a/tests/kernel/timer/timer_behavior/testcase.yaml +++ b/tests/kernel/timer/timer_behavior/testcase.yaml @@ -1,6 +1,7 @@ tests: kernel.timer.timer: tags: kernel timer + min_ram: 16 platform_type: - mcu # Really want to exclude renode not the physical boards, but no good From 9b05bd73ca7c4675a5b753ac473839414da1a00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Fri, 30 Sep 2022 08:20:35 +0200 Subject: [PATCH 408/501] [nrf noup] scripts: Add new test cases to quarantine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit squash! [nrf noup] scripts: add quarantine file A few test cases that were added upstream fail to build due to the lack of the g++-multilib package in the currently used docker image. Add them to the related section in the quarantine file. Signed-off-by: Andrzej Głąbek --- scripts/quarantine.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml index 3befbe01e93..feaef842fbc 100644 --- a/scripts/quarantine.yaml +++ b/scripts/quarantine.yaml @@ -163,6 +163,12 @@ - logging.log_api_immediate_rt_filter_cpp.tagged_args - logging.log_api_immediate_static_filter_cpp - logging.log_api_immediate_static_filter_cpp.tagged_args + - testing.fail.zephyr.assert_after + - testing.fail.zephyr.assert_teardown + - testing.fail.zephyr.assume_after + - testing.fail.zephyr.assume_teardown + - testing.fail.zephyr.pass_after + - testing.fail.zephyr.pass_teardown - testing.ztest.base.cpp platforms: - native_posix From a5f2b0376836bbac711f702587f812a1444581d2 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 24 Sep 2022 16:17:36 +0530 Subject: [PATCH 409/501] [nrf fromtree] Bluetooth: Controller: Fix scan aux leak on periodic sync terminate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix scan aux context leak on Periodic Sync Terminate. On Periodic Sync Terminate the `is_stop` flag is set to prevent the ULL from assigning an aux context to the sync context, but the acquired aux context was neither assigned to sync context nor was being released back to the aux context pool. Fixed by releasing the aux context if not assigned to the sync context when `is_stop` flag is set. Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Andrzej Głąbek (cherry picked from commit ba6cbc57e17e89a6757d87ea330ce1f84a486abe) --- subsys/bluetooth/controller/ll_sw/ull_scan_aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index 9f39ac1582c..9a3794acbfc 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -737,7 +737,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx) ll_rx_sched(); sync = HDR_LLL2ULL(sync_lll); - if (unlikely(sync->is_stop)) { + if (unlikely(sync->is_stop && sync_lll->lll_aux)) { return; } } From 9926e3132909b916d578f1f769c9d71f2dadc218 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 28 Sep 2022 16:25:53 +0530 Subject: [PATCH 410/501] [nrf fromtree] Bluetooth: Controller: Fix node rx leak on extended scanning stop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If scan is being disabled, rx could already be enqueued before coming to ull_scan_aux_rx_flush. Check if node rx is not the last in the list of received PDUs then add it to the list, else do not add it to the list to avoid duplicate report generation, release and probable infinite loop processing of the list. It is possible that node rx has not be already added in case of last PDU in the chain, under this case when scan is being stopped add it to the list before auxiliary context is flushed. Add the node rx to aux context list of node rx if not already added when coming to ull_scan_aux_rx_flush. This is handling a race condition wherein the last PDU in chain is received and at the same time scan is being disabled. Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Andrzej Głąbek (cherry picked from commit 1de70b575aaf415cd915d0a202b5ca9873896ed1) --- .../bluetooth/controller/ll_sw/ull_scan_aux.c | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index 9a3794acbfc..db510e6a3d3 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -716,13 +716,26 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx) * immediately since we are in sync context. */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || aux->rx_last) { - /* If scan is being disabled, rx has already been - * enqueued before coming here, ull_scan_aux_rx_flush. - * Do not add it, to avoid duplicate report generation, - * release and probable infinite loop processing the - * list. + /* If scan is being disabled, rx could already be + * enqueued before coming here to ull_scan_aux_rx_flush. + * Check if rx not the last in the list of received PDUs + * then add it, else do not add it, to avoid duplicate + * report generation, release and probable infinite loop + * processing of the list. */ if (unlikely(scan->is_stop)) { + /* Add the node rx to aux context list of node + * rx if not already added when coming here to + * ull_scan_aux_rx_flush. This is handling a + * race condition where in the last PDU in + * chain is received and at the same time scan + * is being disabled. + */ + if (aux->rx_last != rx) { + aux->rx_last->rx_ftr.extra = rx; + aux->rx_last = rx; + } + return; } From 9861f23316d54c4d07c12703e485995023636e90 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 29 Sep 2022 11:05:56 +0530 Subject: [PATCH 411/501] [nrf fromtree] Bluetooth: Controller: Fix receiving spurious PDU in active scanning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix receiving spurious overlapping ADV_IND and SCAN_IND PDU when LLL state expects to receive SCAN_RSP PDU. Explicitly check that these PDUs are not processed when in active scanning and waiting for SCAN_RSP PDUs. Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Andrzej Głąbek (cherry picked from commit 0eec4344728bfec35a8c2b4459af2b481eed52bc) --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index 3f0113299cb..afafe9bdb01 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -1277,7 +1277,7 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, } else if (((pdu_adv_rx->type == PDU_ADV_TYPE_ADV_IND) || (pdu_adv_rx->type == PDU_ADV_TYPE_SCAN_IND)) && (pdu_adv_rx->len <= sizeof(struct pdu_adv_adv_ind)) && - lll->type && + lll->type && !lll->state && #if defined(CONFIG_BT_CENTRAL) !lll->conn) { #else /* !CONFIG_BT_CENTRAL */ From 571dea6a50d643042f74a928cd9447da503206ae Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 29 Sep 2022 11:03:16 +0530 Subject: [PATCH 412/501] [nrf fromtree] Bluetooth: Controller: Fix missing is_aux_sched flag being reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix missing is_aux_sched flag being reset before resuming to scan for new advertising PDU in the same scan window after having received an earlier primary channel PDU and auxiliary channel PDU using LLL scheduling. Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Andrzej Głąbek (cherry picked from commit 8b586ee5a4e5c02a7aaa47bd3e8b79163579bd1e) --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index afafe9bdb01..30f9d512d15 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -845,6 +845,7 @@ static void isr_common_done(void *param) #if defined(CONFIG_BT_CTLR_ADV_EXT) lll->is_adv_ind = 0U; + lll->is_aux_sched = 0U; #endif /* CONFIG_BT_CTLR_ADV_EXT */ /* setup tIFS switching */ From 61e57d10bdeeb1d72fe0312428d2a5547450c826 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 29 Sep 2022 10:53:26 +0530 Subject: [PATCH 413/501] [nrf fromtree] Bluetooth: Controller: Fix radio_tmr_start_us to be soft realtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix radio_tmr_start_us to be soft realtime, if the requested start in microseconds is in the past, setup the next earliest expiry. This is to prevent radio not being started and not let the LLL hanging. When setup to receive auxiliary PDU in LLL scheduling, is_aux_sched is set and if radio does not start and the window is requested to be pre-empted, then it is blocked from being preempted due to the is_aux_sched flag remaining to be set. This stalls the scanning infinitely until explicit scan disable. Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Andrzej Głąbek (cherry picked from commit 48c21fab93a3ebc5ad2389284f08749f36ba70a4) --- .../ll_sw/nordic/hal/nrf5/radio/radio.c | 47 ++++++++++--------- .../ll_sw/nordic/hal/nrf5/radio/radio.h | 2 +- .../ll_sw/nordic/lll/lll_scan_aux.c | 13 +++-- .../controller/ll_sw/nordic/lll/lll_sync.c | 13 +++-- .../ll_sw/nordic/lll/lll_sync_iso.c | 4 +- 5 files changed, 45 insertions(+), 34 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c index 88e7ad6da45..afe4648024d 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c @@ -1141,10 +1141,8 @@ uint32_t radio_tmr_start_tick(uint8_t trx, uint32_t tick) return remainder_us; } -void radio_tmr_start_us(uint8_t trx, uint32_t us) +uint32_t radio_tmr_start_us(uint8_t trx, uint32_t start_us) { - nrf_timer_cc_set(EVENT_TIMER, 0, us); - hal_radio_enable_on_tick_ppi_config_and_enable(trx); #if !defined(CONFIG_BT_CTLR_TIFS_HW) @@ -1166,11 +1164,31 @@ void radio_tmr_start_us(uint8_t trx, uint32_t us) hal_sw_switch_timer_clear_ppi_config(); #endif /* CONFIG_SOC_SERIES_NRF53X */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ + + /* start_us could be the current count in the timer */ + uint32_t now_us = start_us; + + /* Setup PPI while determining the latency in doing so */ + do { + /* Set start to be, now plus the determined latency */ + start_us = (now_us << 1) - start_us; + + /* Setup compare event with min. 1 us offset */ + EVENT_TIMER->EVENTS_COMPARE[0] = 0U; + nrf_timer_cc_set(EVENT_TIMER, 0, start_us + 1U); + + /* Capture the current time */ + nrf_timer_task_trigger(EVENT_TIMER, NRF_TIMER_TASK_CAPTURE1); + + now_us = EVENT_TIMER->CC[1]; + } while ((now_us > start_us) && (EVENT_TIMER->EVENTS_COMPARE[0] == 0U)); + + return start_us + 1U; } uint32_t radio_tmr_start_now(uint8_t trx) { - uint32_t now, start; + uint32_t start_us; hal_radio_enable_on_tick_ppi_config_and_enable(trx); @@ -1193,25 +1211,12 @@ uint32_t radio_tmr_start_now(uint8_t trx) /* Capture the current time */ nrf_timer_task_trigger(EVENT_TIMER, NRF_TIMER_TASK_CAPTURE1); - now = EVENT_TIMER->CC[1]; - start = now; - - /* Setup PPI while determining the latency in doing so */ - do { - /* Set start to be, now plus the determined latency */ - start = (now << 1) - start; - - /* Setup compare event with min. 1 us offset */ - EVENT_TIMER->EVENTS_COMPARE[0] = 0U; - nrf_timer_cc_set(EVENT_TIMER, 0, start + 1); - - /* Capture the current time */ - nrf_timer_task_trigger(EVENT_TIMER, NRF_TIMER_TASK_CAPTURE1); + start_us = EVENT_TIMER->CC[1]; - now = EVENT_TIMER->CC[1]; - } while ((now > start) && (EVENT_TIMER->EVENTS_COMPARE[0] == 0U)); + /* Setup radio start at current time */ + start_us = radio_tmr_start_us(trx, start_us); - return start + 1; + return start_us; } uint32_t radio_tmr_start_get(void) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h index 3e4e05a3b4e..a54f958711f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h @@ -127,7 +127,7 @@ void radio_tmr_status_reset(void); void radio_tmr_tifs_set(uint32_t tifs); uint32_t radio_tmr_start(uint8_t trx, uint32_t ticks_start, uint32_t remainder); uint32_t radio_tmr_start_tick(uint8_t trx, uint32_t tick); -void radio_tmr_start_us(uint8_t trx, uint32_t us); +uint32_t radio_tmr_start_us(uint8_t trx, uint32_t us); uint32_t radio_tmr_start_now(uint8_t trx); uint32_t radio_tmr_start_get(void); void radio_tmr_stop(void); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c index 6fe8582ffe6..2f1c150bdb4 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c @@ -252,6 +252,7 @@ void lll_scan_aux_isr_aux_setup(void *param) uint32_t aux_offset_us; uint32_t aux_start_us; struct lll_scan *lll; + uint32_t start_us; uint8_t phy_aux; uint32_t hcto; @@ -336,13 +337,15 @@ void lll_scan_aux_isr_aux_setup(void *param) aux_start_us -= lll_radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8); aux_start_us -= window_widening_us; aux_start_us -= EVENT_JITTER_US; - radio_tmr_start_us(0, aux_start_us); + + start_us = radio_tmr_start_us(0, aux_start_us); /* Setup header complete timeout */ - hcto = ftr->radio_end_us + aux_offset_us; - hcto += window_size_us; - hcto += window_widening_us; + hcto = start_us; hcto += EVENT_JITTER_US; + hcto += window_widening_us; + hcto += lll_radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8); + hcto += window_size_us; hcto += radio_rx_chain_delay_get(phy_aux, PHY_FLAGS_S8); hcto += addr_us_get(phy_aux); radio_tmr_hcto_configure(hcto); @@ -358,7 +361,7 @@ void lll_scan_aux_isr_aux_setup(void *param) #if defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) radio_gpio_lna_setup(); - radio_gpio_pa_lna_enable(aux_start_us + + radio_gpio_pa_lna_enable(start_us + radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8) - HAL_RADIO_GPIO_LNA_OFFSET); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index 801d539a11f..b962d77314c 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -654,6 +654,7 @@ static void isr_aux_setup(void *param) uint32_t aux_offset_us; uint32_t aux_start_us; struct lll_sync *lll; + uint32_t start_us; uint8_t phy_aux; uint32_t hcto; @@ -736,13 +737,15 @@ static void isr_aux_setup(void *param) aux_start_us -= lll_radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8); aux_start_us -= window_widening_us; aux_start_us -= EVENT_JITTER_US; - radio_tmr_start_us(0, aux_start_us); + + start_us = radio_tmr_start_us(0, aux_start_us); /* Setup header complete timeout */ - hcto = ftr->radio_end_us + aux_offset_us; - hcto += window_size_us; - hcto += window_widening_us; + hcto = start_us; hcto += EVENT_JITTER_US; + hcto += window_widening_us; + hcto += lll_radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8); + hcto += window_size_us; hcto += radio_rx_chain_delay_get(phy_aux, PHY_FLAGS_S8); hcto += addr_us_get(phy_aux); radio_tmr_hcto_configure(hcto); @@ -758,7 +761,7 @@ static void isr_aux_setup(void *param) #if defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) radio_gpio_lna_setup(); - radio_gpio_pa_lna_enable(aux_start_us + + radio_gpio_pa_lna_enable(start_us + radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8) - HAL_RADIO_GPIO_LNA_OFFSET); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c index a6d00f7396d..fe3e6ad8178 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c @@ -840,7 +840,7 @@ static void isr_rx(void *param) hcto -= (EVENT_CLOCK_JITTER_US << 1); start_us = hcto; - radio_tmr_start_us(0U, start_us); + hcto = radio_tmr_start_us(0U, start_us); /* Add 4 us + 4 us + (4 us * subevents so far), as radio * was setup to listen 4 us early and subevents could have @@ -858,7 +858,7 @@ static void isr_rx(void *param) hcto += radio_tmr_ready_restore(); start_us = hcto; - radio_tmr_start_us(0U, start_us); + hcto = radio_tmr_start_us(0U, start_us); hcto += ((EVENT_JITTER_US + EVENT_TICKER_RES_MARGIN_US + lll->window_widening_event_us) << 1) + From f396333eef2dcaf46d6898a6337a8231a5d4e4db Mon Sep 17 00:00:00 2001 From: Dominik Chat Date: Thu, 18 Aug 2022 14:22:10 +0200 Subject: [PATCH 414/501] [nrf fromtree] sensor: dts: Add SPI capability to bmi270 driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added SPI bus support for BMI270 gyroscope driver. Signed-off-by: Dominik Chat Signed-off-by: Andrzej Głąbek (cherry picked from commit 6cbb84c3eed97efa33375ae24d050abf49ee5b86) --- drivers/sensor/bmi270/CMakeLists.txt | 3 + drivers/sensor/bmi270/Kconfig | 20 ++- drivers/sensor/bmi270/bmi270.c | 179 ++++++++++++++-------- drivers/sensor/bmi270/bmi270.h | 39 ++++- drivers/sensor/bmi270/bmi270_i2c.c | 42 +++++ drivers/sensor/bmi270/bmi270_spi.c | 101 ++++++++++++ dts/bindings/sensor/bosch,bmi270-i2c.yaml | 7 +- dts/bindings/sensor/bosch,bmi270-spi.yaml | 6 + dts/bindings/sensor/bosch,bmi270.yaml | 9 ++ 9 files changed, 335 insertions(+), 71 deletions(-) create mode 100644 drivers/sensor/bmi270/bmi270_i2c.c create mode 100644 drivers/sensor/bmi270/bmi270_spi.c create mode 100644 dts/bindings/sensor/bosch,bmi270-spi.yaml create mode 100644 dts/bindings/sensor/bosch,bmi270.yaml diff --git a/drivers/sensor/bmi270/CMakeLists.txt b/drivers/sensor/bmi270/CMakeLists.txt index 29d278355c2..5f9b4bb2a60 100644 --- a/drivers/sensor/bmi270/CMakeLists.txt +++ b/drivers/sensor/bmi270/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2021 Bosch Sensortec GmbH +# Copyright (c) 2022 Nordic Semiconductor ASA # # SPDX-License-Identifier: Apache-2.0 # @@ -7,3 +8,5 @@ zephyr_library() zephyr_library_sources(bmi270.c) +zephyr_library_sources_ifdef(CONFIG_BMI270_BUS_I2C bmi270_i2c.c) +zephyr_library_sources_ifdef(CONFIG_BMI270_BUS_SPI bmi270_spi.c) diff --git a/drivers/sensor/bmi270/Kconfig b/drivers/sensor/bmi270/Kconfig index 90bbe131b8b..f8cd1ba2840 100644 --- a/drivers/sensor/bmi270/Kconfig +++ b/drivers/sensor/bmi270/Kconfig @@ -1,12 +1,28 @@ # BMI270 6 Axis IMU configuration # Copyright (c) 2021 Bosch Sensortec GmbH +# Copyright (c) 2022 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config BMI270 +menuconfig BMI270 bool "BMI270 Inertial measurement unit" default y depends on DT_HAS_BOSCH_BMI270_ENABLED - select I2C + select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),i2c) + select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),spi) help Enable driver for BMI270 I2C-based imu sensor + +if BMI270 + +config BMI270_BUS_I2C + bool + default y + depends on $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),i2c) + +config BMI270_BUS_SPI + bool + default y + depends on $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),spi) + +endif # BMI270 diff --git a/drivers/sensor/bmi270/bmi270.c b/drivers/sensor/bmi270/bmi270.c index 940168e4184..45077557923 100644 --- a/drivers/sensor/bmi270/bmi270.c +++ b/drivers/sensor/bmi270/bmi270.c @@ -1,12 +1,12 @@ /* * Copyright (c) 2021 Bosch Sensortec GmbH + * Copyright (c) 2022 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT bosch_bmi270 -#include #include #include #include @@ -23,26 +23,49 @@ LOG_MODULE_REGISTER(bmi270, CONFIG_SENSOR_LOG_LEVEL); #define BMI270_CONFIG_FILE_POLL_PERIOD_US 10000 #define BMI270_INTER_WRITE_DELAY_US 1000 -static int reg_read(const struct device *dev, uint8_t reg, uint8_t *data, uint16_t length) +struct bmi270_config { + union bmi270_bus bus; + const struct bmi270_bus_io *bus_io; +}; + +static inline int bmi270_bus_check(const struct device *dev) +{ + const struct bmi270_config *cfg = dev->config; + + return cfg->bus_io->check(&cfg->bus); +} + +static inline int bmi270_bus_init(const struct device *dev) { - const struct bmi270_dev_config *cfg = dev->config; + const struct bmi270_config *cfg = dev->config; - return i2c_burst_read_dt(&cfg->i2c, reg, data, length); + return cfg->bus_io->init(&cfg->bus); } -static int reg_write(const struct device *dev, uint8_t reg, const uint8_t *data, uint16_t length) +static int bmi270_reg_read(const struct device *dev, uint8_t reg, uint8_t *data, uint16_t length) { - const struct bmi270_dev_config *cfg = dev->config; + const struct bmi270_config *cfg = dev->config; - return i2c_burst_write_dt(&cfg->i2c, reg, data, length); + return cfg->bus_io->read(&cfg->bus, reg, data, length); } -static int reg_write_with_delay(const struct device *dev, uint8_t reg, const uint8_t *data, - uint16_t length, uint32_t delay_us) +static int bmi270_reg_write(const struct device *dev, uint8_t reg, + const uint8_t *data, uint16_t length) +{ + const struct bmi270_config *cfg = dev->config; + + return cfg->bus_io->write(&cfg->bus, reg, data, length); +} + +static int bmi270_reg_write_with_delay(const struct device *dev, + uint8_t reg, + const uint8_t *data, + uint16_t length, + uint32_t delay_us) { int ret = 0; - ret = reg_write(dev, reg, data, length); + ret = bmi270_reg_write(dev, reg, data, length); if (ret == 0) { k_usleep(delay_us); } @@ -125,12 +148,12 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value int ret = 0; if (odr || osr) { - ret = reg_read(dev, BMI270_REG_ACC_CONF, &acc_conf, 1); + ret = bmi270_reg_read(dev, BMI270_REG_ACC_CONF, &acc_conf, 1); if (ret != 0) { return ret; } - ret = reg_read(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1); + ret = bmi270_reg_read(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1); if (ret != 0) { return ret; } @@ -221,7 +244,7 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value } if (odr || osr) { - ret = reg_write(dev, BMI270_REG_ACC_CONF, &acc_conf, 1); + ret = bmi270_reg_write(dev, BMI270_REG_ACC_CONF, &acc_conf, 1); if (ret != 0) { return ret; } @@ -230,8 +253,9 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value k_usleep(BMI270_TRANSC_DELAY_SUSPEND); pwr_ctrl &= BMI270_PWR_CTRL_MSK; - ret = reg_write_with_delay(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = bmi270_reg_write_with_delay(dev, BMI270_REG_PWR_CTRL, + &pwr_ctrl, 1, + BMI270_INTER_WRITE_DELAY_US); } return ret; @@ -243,7 +267,7 @@ static int set_accel_range(const struct device *dev, const struct sensor_value * int ret = 0; uint8_t acc_range, reg; - ret = reg_read(dev, BMI270_REG_ACC_RANGE, &acc_range, 1); + ret = bmi270_reg_read(dev, BMI270_REG_ACC_RANGE, &acc_range, 1); if (ret != 0) { return ret; } @@ -272,8 +296,8 @@ static int set_accel_range(const struct device *dev, const struct sensor_value * acc_range = BMI270_SET_BITS_POS_0(acc_range, BMI270_ACC_RANGE, reg); - ret = reg_write_with_delay(dev, BMI270_REG_ACC_RANGE, &acc_range, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = bmi270_reg_write_with_delay(dev, BMI270_REG_ACC_RANGE, &acc_range, + 1, BMI270_INTER_WRITE_DELAY_US); return ret; } @@ -312,12 +336,12 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value int ret = 0; if (odr || osr) { - ret = reg_read(dev, BMI270_REG_GYR_CONF, &gyr_conf, 1); + ret = bmi270_reg_read(dev, BMI270_REG_GYR_CONF, &gyr_conf, 1); if (ret != 0) { return ret; } - ret = reg_read(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1); + ret = bmi270_reg_read(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1); if (ret != 0) { return ret; } @@ -379,7 +403,7 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value } if (odr || osr) { - ret = reg_write(dev, BMI270_REG_GYR_CONF, &gyr_conf, 1); + ret = bmi270_reg_write(dev, BMI270_REG_GYR_CONF, &gyr_conf, 1); if (ret != 0) { return ret; } @@ -388,8 +412,9 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value k_usleep(BMI270_TRANSC_DELAY_SUSPEND); pwr_ctrl &= BMI270_PWR_CTRL_MSK; - ret = reg_write_with_delay(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = bmi270_reg_write_with_delay(dev, BMI270_REG_PWR_CTRL, + &pwr_ctrl, 1, + BMI270_INTER_WRITE_DELAY_US); } return ret; @@ -401,7 +426,7 @@ static int set_gyro_range(const struct device *dev, const struct sensor_value *r int ret = 0; uint8_t gyr_range, reg; - ret = reg_read(dev, BMI270_REG_GYR_RANGE, &gyr_range, 1); + ret = bmi270_reg_read(dev, BMI270_REG_GYR_RANGE, &gyr_range, 1); if (ret != 0) { return ret; } @@ -433,8 +458,8 @@ static int set_gyro_range(const struct device *dev, const struct sensor_value *r } gyr_range = BMI270_SET_BITS_POS_0(gyr_range, BMI270_GYR_RANGE, reg); - ret = reg_write_with_delay(dev, BMI270_REG_GYR_RANGE, &gyr_range, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = bmi270_reg_write_with_delay(dev, BMI270_REG_GYR_RANGE, &gyr_range, + 1, BMI270_INTER_WRITE_DELAY_US); return ret; } @@ -454,13 +479,16 @@ static int8_t write_config_file(const struct device *dev) /* Store 4 to 11 bits of address in the second byte */ addr_array[1] = (uint8_t)((index / 2) >> 4); - ret = reg_write_with_delay(dev, BMI270_REG_INIT_ADDR_0, addr_array, 2, - BMI270_INTER_WRITE_DELAY_US); + ret = bmi270_reg_write_with_delay(dev, BMI270_REG_INIT_ADDR_0, + addr_array, 2, + BMI270_INTER_WRITE_DELAY_US); if (ret == 0) { - ret = reg_write_with_delay(dev, BMI270_REG_INIT_DATA, - (bmi270_config_file + index), - BMI270_WR_LEN, BMI270_INTER_WRITE_DELAY_US); + ret = bmi270_reg_write_with_delay(dev, + BMI270_REG_INIT_DATA, + (bmi270_config_file + index), + BMI270_WR_LEN, + BMI270_INTER_WRITE_DELAY_US); } } @@ -477,7 +505,7 @@ static int bmi270_sample_fetch(const struct device *dev, enum sensor_channel cha return -ENOTSUP; } - ret = reg_read(dev, BMI270_REG_ACC_X_LSB, data, 12); + ret = bmi270_reg_read(dev, BMI270_REG_ACC_X_LSB, data, 12); if (ret == 0) { drv_dev->ax = (int16_t)sys_get_le16(&data[0]); drv_dev->ay = (int16_t)sys_get_le16(&data[2]); @@ -584,7 +612,6 @@ static int bmi270_init(const struct device *dev) { int ret; struct bmi270_data *drv_dev = dev->data; - const struct bmi270_dev_config *cfg = dev->config; uint8_t chip_id; uint8_t soft_reset_cmd; uint8_t init_ctrl; @@ -592,9 +619,10 @@ static int bmi270_init(const struct device *dev) uint8_t tries; uint8_t adv_pwr_save; - if (!device_is_ready(cfg->i2c.bus)) { - LOG_ERR("I2C bus device not ready"); - return -ENODEV; + ret = bmi270_bus_check(dev); + if (ret < 0) { + LOG_ERR("Could not initialize bus"); + return ret; } drv_dev->acc_odr = BMI270_ACC_ODR_100_HZ; @@ -604,7 +632,13 @@ static int bmi270_init(const struct device *dev) k_usleep(BMI270_POWER_ON_TIME); - ret = reg_read(dev, BMI270_REG_CHIP_ID, &chip_id, 1); + ret = bmi270_bus_init(dev); + if (ret != 0) { + LOG_ERR("Could not initiate bus communication"); + return ret; + } + + ret = bmi270_reg_read(dev, BMI270_REG_CHIP_ID, &chip_id, 1); if (ret != 0) { return ret; } @@ -616,14 +650,14 @@ static int bmi270_init(const struct device *dev) } soft_reset_cmd = BMI270_CMD_SOFT_RESET; - ret = reg_write(dev, BMI270_REG_CMD, &soft_reset_cmd, 1); + ret = bmi270_reg_write(dev, BMI270_REG_CMD, &soft_reset_cmd, 1); if (ret != 0) { return ret; } k_usleep(BMI270_SOFT_RESET_TIME); - ret = reg_read(dev, BMI270_REG_PWR_CONF, &adv_pwr_save, 1); + ret = bmi270_reg_read(dev, BMI270_REG_PWR_CONF, &adv_pwr_save, 1); if (ret != 0) { return ret; } @@ -631,14 +665,15 @@ static int bmi270_init(const struct device *dev) adv_pwr_save = BMI270_SET_BITS_POS_0(adv_pwr_save, BMI270_PWR_CONF_ADV_PWR_SAVE, BMI270_PWR_CONF_ADV_PWR_SAVE_DIS); - ret = reg_write_with_delay(dev, BMI270_REG_PWR_CONF, &adv_pwr_save, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = bmi270_reg_write_with_delay(dev, BMI270_REG_PWR_CONF, + &adv_pwr_save, 1, + BMI270_INTER_WRITE_DELAY_US); if (ret != 0) { return ret; } init_ctrl = BMI270_PREPARE_CONFIG_LOAD; - ret = reg_write(dev, BMI270_REG_INIT_CTRL, &init_ctrl, 1); + ret = bmi270_reg_write(dev, BMI270_REG_INIT_CTRL, &init_ctrl, 1); if (ret != 0) { return ret; } @@ -650,18 +685,18 @@ static int bmi270_init(const struct device *dev) } init_ctrl = BMI270_COMPLETE_CONFIG_LOAD; - ret = reg_write(dev, BMI270_REG_INIT_CTRL, &init_ctrl, 1); + ret = bmi270_reg_write(dev, BMI270_REG_INIT_CTRL, &init_ctrl, 1); if (ret != 0) { return ret; } /* Timeout after BMI270_CONFIG_FILE_RETRIES x * BMI270_CONFIG_FILE_POLL_PERIOD_US microseconds. - * If tries is 0 by the end of the loop, + * If tries is BMI270_CONFIG_FILE_RETRIES by the end of the loop, * report an error */ for (tries = 0; tries <= BMI270_CONFIG_FILE_RETRIES; tries++) { - ret = reg_read(dev, BMI270_REG_INTERNAL_STATUS, &msg, 1); + ret = bmi270_reg_read(dev, BMI270_REG_INTERNAL_STATUS, &msg, 1); if (ret != 0) { return ret; } @@ -674,15 +709,16 @@ static int bmi270_init(const struct device *dev) k_usleep(BMI270_CONFIG_FILE_POLL_PERIOD_US); } - if (tries == 0) { + if (tries == BMI270_CONFIG_FILE_RETRIES) { return -EIO; } adv_pwr_save = BMI270_SET_BITS_POS_0(adv_pwr_save, BMI270_PWR_CONF_ADV_PWR_SAVE, BMI270_PWR_CONF_ADV_PWR_SAVE_EN); - ret = reg_write_with_delay(dev, BMI270_REG_PWR_CONF, &adv_pwr_save, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = bmi270_reg_write_with_delay(dev, BMI270_REG_PWR_CONF, + &adv_pwr_save, 1, + BMI270_INTER_WRITE_DELAY_US); return ret; } @@ -693,21 +729,38 @@ static const struct sensor_driver_api bmi270_driver_api = { .attr_set = bmi270_attr_set }; -#define BMI270_CREATE_INST(inst) \ - \ - static struct bmi270_data bmi270_drv_##inst; \ - \ - static const struct bmi270_dev_config bmi270_config_##inst = { \ - .i2c = I2C_DT_SPEC_INST_GET(inst), \ - }; \ - \ - DEVICE_DT_INST_DEFINE(inst, \ - bmi270_init, \ - NULL, \ - &bmi270_drv_##inst, \ - &bmi270_config_##inst, \ - POST_KERNEL, \ - CONFIG_SENSOR_INIT_PRIORITY, \ +/* Initializes a struct bmi270_config for an instance on a SPI bus. */ +#define BMI270_CONFIG_SPI(inst) \ + { \ + .bus.spi = SPI_DT_SPEC_INST_GET( \ + inst, BMI270_SPI_OPERATION, 0), \ + .bus_io = &bmi270_bus_io_spi, \ + } + +/* Initializes a struct bmi270_config for an instance on an I2C bus. */ +#define BMI270_CONFIG_I2C(inst) \ + { \ + .bus.i2c = I2C_DT_SPEC_INST_GET(inst), \ + .bus_io = &bmi270_bus_io_i2c, \ + } + + +#define BMI270_CREATE_INST(inst) \ + \ + static struct bmi270_data bmi270_drv_##inst; \ + \ + static const struct bmi270_config bmi270_config_##inst = \ + COND_CODE_1(DT_INST_ON_BUS(inst, spi), \ + (BMI270_CONFIG_SPI(inst)), \ + (BMI270_CONFIG_I2C(inst))); \ + \ + DEVICE_DT_INST_DEFINE(inst, \ + bmi270_init, \ + NULL, \ + &bmi270_drv_##inst, \ + &bmi270_config_##inst, \ + POST_KERNEL, \ + CONFIG_SENSOR_INIT_PRIORITY, \ &bmi270_driver_api); DT_INST_FOREACH_STATUS_OKAY(BMI270_CREATE_INST) diff --git a/drivers/sensor/bmi270/bmi270.h b/drivers/sensor/bmi270/bmi270.h index 51e9d387165..50605361844 100644 --- a/drivers/sensor/bmi270/bmi270.h +++ b/drivers/sensor/bmi270/bmi270.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Bosch Sensortec GmbH + * Copyright (c) 2022 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +12,9 @@ #include #include #include +#include #include +#include #define BMI270_REG_CHIP_ID 0x00 #define BMI270_REG_ERROR 0x02 @@ -67,6 +70,7 @@ #define BMI270_REG_PWR_CONF 0x7C #define BMI270_REG_PWR_CTRL 0x7D #define BMI270_REG_CMD 0x7E +#define BMI270_REG_MASK GENMASK(6, 0) #define BMI270_CHIP_ID 0x24 @@ -206,8 +210,41 @@ struct bmi270_data { uint16_t gyr_range; }; -struct bmi270_dev_config { +union bmi270_bus { +#if CONFIG_BMI270_BUS_SPI + struct spi_dt_spec spi; +#endif +#if CONFIG_BMI270_BUS_I2C struct i2c_dt_spec i2c; +#endif }; +typedef int (*bmi270_bus_check_fn)(const union bmi270_bus *bus); +typedef int (*bmi270_bus_init_fn)(const union bmi270_bus *bus); +typedef int (*bmi270_reg_read_fn)(const union bmi270_bus *bus, + uint8_t start, + uint8_t *data, + uint16_t len); +typedef int (*bmi270_reg_write_fn)(const union bmi270_bus *bus, + uint8_t start, + const uint8_t *data, + uint16_t len); + +struct bmi270_bus_io { + bmi270_bus_check_fn check; + bmi270_reg_read_fn read; + bmi270_reg_write_fn write; + bmi270_bus_init_fn init; +}; + +#if CONFIG_BMI270_BUS_SPI +#define BMI270_SPI_OPERATION (SPI_WORD_SET(8) | SPI_TRANSFER_MSB) +#define BMI270_SPI_ACC_DELAY_US 2 +extern const struct bmi270_bus_io bmi270_bus_io_spi; +#endif + +#if CONFIG_BMI270_BUS_I2C +extern const struct bmi270_bus_io bmi270_bus_io_i2c; +#endif + #endif /* ZEPHYR_DRIVERS_SENSOR_BMI270_BMI270_H_ */ diff --git a/drivers/sensor/bmi270/bmi270_i2c.c b/drivers/sensor/bmi270/bmi270_i2c.c new file mode 100644 index 00000000000..da80001907b --- /dev/null +++ b/drivers/sensor/bmi270/bmi270_i2c.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Bus-specific functionality for BMI270s accessed via I2C. + */ + +#include "bmi270.h" + +static int bmi270_bus_check_i2c(const union bmi270_bus *bus) +{ + return device_is_ready(bus->i2c.bus) ? 0 : -ENODEV; +} + +static int bmi270_reg_read_i2c(const union bmi270_bus *bus, + uint8_t start, uint8_t *data, uint16_t len) +{ + return i2c_burst_read_dt(&bus->i2c, start, data, len); +} + +static int bmi270_reg_write_i2c(const union bmi270_bus *bus, uint8_t start, + const uint8_t *data, uint16_t len) +{ + return i2c_burst_write_dt(&bus->i2c, start, data, len); +} + +static int bmi270_bus_init_i2c(const union bmi270_bus *bus) +{ + /* I2C is used by default + */ + return 0; +} + +const struct bmi270_bus_io bmi270_bus_io_i2c = { + .check = bmi270_bus_check_i2c, + .read = bmi270_reg_read_i2c, + .write = bmi270_reg_write_i2c, + .init = bmi270_bus_init_i2c, +}; diff --git a/drivers/sensor/bmi270/bmi270_spi.c b/drivers/sensor/bmi270/bmi270_spi.c new file mode 100644 index 00000000000..4f0a01ec4c7 --- /dev/null +++ b/drivers/sensor/bmi270/bmi270_spi.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Bus-specific functionality for BMI270s accessed via SPI. + */ + +#include +#include "bmi270.h" + +LOG_MODULE_DECLARE(bmi270, CONFIG_SENSOR_LOG_LEVEL); + +static int bmi270_bus_check_spi(const union bmi270_bus *bus) +{ + return spi_is_ready(&bus->spi) ? 0 : -ENODEV; +} + +static int bmi270_reg_read_spi(const union bmi270_bus *bus, + uint8_t start, uint8_t *data, uint16_t len) +{ + int ret; + uint8_t addr; + uint8_t tmp[2]; + int i; + const struct spi_buf tx_buf = { + .buf = &addr, + .len = 1 + }; + const struct spi_buf_set tx = { + .buffers = &tx_buf, + .count = 1 + }; + struct spi_buf rx_buf[2]; + const struct spi_buf_set rx = { + .buffers = rx_buf, + .count = ARRAY_SIZE(rx_buf) + }; + + rx_buf[0].buf = &tmp[0]; + rx_buf[0].len = 2; + rx_buf[1].len = 1; + + for (i = 0; i < len; i++) { + addr = (start + i) | 0x80; + rx_buf[1].buf = &data[i]; + + ret = spi_transceive_dt(&bus->spi, &tx, &rx); + if (ret < 0) { + LOG_DBG("spi_transceive failed %i", ret); + return ret; + } + } + + k_usleep(BMI270_SPI_ACC_DELAY_US); + return 0; +} + +static int bmi270_reg_write_spi(const union bmi270_bus *bus, uint8_t start, + const uint8_t *data, uint16_t len) +{ + int ret; + uint8_t addr; + const struct spi_buf tx_buf[2] = { + {.buf = &addr, .len = sizeof(addr)}, + {.buf = (uint8_t *)data, .len = len} + }; + const struct spi_buf_set tx = { + .buffers = tx_buf, + .count = ARRAY_SIZE(tx_buf) + }; + + addr = start & BMI270_REG_MASK; + + ret = spi_write_dt(&bus->spi, &tx); + if (ret < 0) { + LOG_ERR("spi_write_dt failed %i", ret); + return ret; + } + + k_usleep(BMI270_SPI_ACC_DELAY_US); + return 0; +} + +static int bmi270_bus_init_spi(const union bmi270_bus *bus) +{ + uint8_t tmp; + + /* Single read of SPI initializes the chip to SPI mode + */ + return bmi270_reg_read_spi(bus, BMI270_REG_CHIP_ID, &tmp, 1); +} + +const struct bmi270_bus_io bmi270_bus_io_spi = { + .check = bmi270_bus_check_spi, + .read = bmi270_reg_read_spi, + .write = bmi270_reg_write_spi, + .init = bmi270_bus_init_spi, +}; diff --git a/dts/bindings/sensor/bosch,bmi270-i2c.yaml b/dts/bindings/sensor/bosch,bmi270-i2c.yaml index 2e2ee307c04..ca21ba4f3ea 100644 --- a/dts/bindings/sensor/bosch,bmi270-i2c.yaml +++ b/dts/bindings/sensor/bosch,bmi270-i2c.yaml @@ -1,10 +1,7 @@ # Copyright (c) 2021, Bosch Sensortec GmbH +# Copyright (c) 2022, Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -description: | - The BMI270 is an inertial measurment unit. See more info at: - https://www.bosch-sensortec.com/products/motion-sensors/imus/bmi270.html - compatible: "bosch,bmi270" -include: i2c-device.yaml +include: [i2c-device.yaml, "bosch,bmi270.yaml"] diff --git a/dts/bindings/sensor/bosch,bmi270-spi.yaml b/dts/bindings/sensor/bosch,bmi270-spi.yaml new file mode 100644 index 00000000000..9c76cff2868 --- /dev/null +++ b/dts/bindings/sensor/bosch,bmi270-spi.yaml @@ -0,0 +1,6 @@ +# Copyright (c) 2022, Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +compatible: "bosch,bmi270" + +include: ["spi-device.yaml", "bosch,bmi270.yaml"] diff --git a/dts/bindings/sensor/bosch,bmi270.yaml b/dts/bindings/sensor/bosch,bmi270.yaml new file mode 100644 index 00000000000..90f4ef2ca1e --- /dev/null +++ b/dts/bindings/sensor/bosch,bmi270.yaml @@ -0,0 +1,9 @@ +# Copyright (c) 2021, Bosch Sensortec GmbH +# Copyright (c) 2022, Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + The BMI270 is an inertial measurement unit. See more info at: + https://www.bosch-sensortec.com/products/motion-sensors/imus/bmi270.html + +compatible: "bosch,bmi270" From fa1468b8dfeb567f5b72be69b4b8ff8b470ef255 Mon Sep 17 00:00:00 2001 From: Dominik Chat Date: Thu, 18 Aug 2022 14:27:42 +0200 Subject: [PATCH 415/501] [nrf fromtree] sensor: Refactor bmi270 driver data names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make driver data names consistent in code. Signed-off-by: Dominik Chat Signed-off-by: Andrzej Głąbek (cherry picked from commit 67c6f26c9358d2dce2af359722bfa72c2f655767) --- drivers/sensor/bmi270/bmi270.c | 110 ++++++++++++++++----------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/drivers/sensor/bmi270/bmi270.c b/drivers/sensor/bmi270/bmi270.c index 45077557923..ace3d81b902 100644 --- a/drivers/sensor/bmi270/bmi270.c +++ b/drivers/sensor/bmi270/bmi270.c @@ -143,7 +143,7 @@ static uint8_t acc_odr_to_reg(const struct sensor_value *val) static int set_accel_odr_osr(const struct device *dev, const struct sensor_value *odr, const struct sensor_value *osr) { - struct bmi270_data *drv_dev = dev->data; + struct bmi270_data *data = dev->data; uint8_t acc_conf, odr_bits, pwr_ctrl, osr_bits; int ret = 0; @@ -185,11 +185,11 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value BMI270_ACC_FILT_PWR_OPT); } - drv_dev->acc_odr = odr_bits; + data->acc_odr = odr_bits; } if (osr) { - if (drv_dev->acc_odr >= BMI270_ACC_ODR_100_HZ) { + if (data->acc_odr >= BMI270_ACC_ODR_100_HZ) { /* Performance mode */ /* osr->val2 should be unused */ switch (osr->val1) { @@ -263,7 +263,7 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value static int set_accel_range(const struct device *dev, const struct sensor_value *range) { - struct bmi270_data *drv_dev = dev->data; + struct bmi270_data *data = dev->data; int ret = 0; uint8_t acc_range, reg; @@ -276,19 +276,19 @@ static int set_accel_range(const struct device *dev, const struct sensor_value * switch (range->val1) { case 2: reg = BMI270_ACC_RANGE_2G; - drv_dev->acc_range = 2; + data->acc_range = 2; break; case 4: reg = BMI270_ACC_RANGE_4G; - drv_dev->acc_range = 4; + data->acc_range = 4; break; case 8: reg = BMI270_ACC_RANGE_8G; - drv_dev->acc_range = 8; + data->acc_range = 8; break; case 16: reg = BMI270_ACC_RANGE_16G; - drv_dev->acc_range = 16; + data->acc_range = 16; break; default: return -ENOTSUP; @@ -331,7 +331,7 @@ static uint8_t gyr_odr_to_reg(const struct sensor_value *val) static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value *odr, const struct sensor_value *osr) { - struct bmi270_data *drv_dev = dev->data; + struct bmi270_data *data = dev->data; uint8_t gyr_conf, odr_bits, pwr_ctrl, osr_bits; int ret = 0; @@ -381,7 +381,7 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value BMI270_GYR_FILT_NOISE_PWR); } - drv_dev->gyr_odr = odr_bits; + data->gyr_odr = odr_bits; } if (osr) { @@ -422,7 +422,7 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value static int set_gyro_range(const struct device *dev, const struct sensor_value *range) { - struct bmi270_data *drv_dev = dev->data; + struct bmi270_data *data = dev->data; int ret = 0; uint8_t gyr_range, reg; @@ -435,23 +435,23 @@ static int set_gyro_range(const struct device *dev, const struct sensor_value *r switch (range->val1) { case 125: reg = BMI270_GYR_RANGE_125DPS; - drv_dev->gyr_range = 125; + data->gyr_range = 125; break; case 250: reg = BMI270_GYR_RANGE_250DPS; - drv_dev->gyr_range = 250; + data->gyr_range = 250; break; case 500: reg = BMI270_GYR_RANGE_500DPS; - drv_dev->gyr_range = 500; + data->gyr_range = 500; break; case 1000: reg = BMI270_GYR_RANGE_1000DPS; - drv_dev->gyr_range = 1000; + data->gyr_range = 1000; break; case 2000: reg = BMI270_GYR_RANGE_2000DPS; - drv_dev->gyr_range = 2000; + data->gyr_range = 2000; break; default: return -ENOTSUP; @@ -497,29 +497,29 @@ static int8_t write_config_file(const struct device *dev) static int bmi270_sample_fetch(const struct device *dev, enum sensor_channel chan) { - struct bmi270_data *drv_dev = dev->data; - uint8_t data[12]; + struct bmi270_data *data = dev->data; + uint8_t buf[12]; int ret; if (chan != SENSOR_CHAN_ALL) { return -ENOTSUP; } - ret = bmi270_reg_read(dev, BMI270_REG_ACC_X_LSB, data, 12); + ret = bmi270_reg_read(dev, BMI270_REG_ACC_X_LSB, buf, 12); if (ret == 0) { - drv_dev->ax = (int16_t)sys_get_le16(&data[0]); - drv_dev->ay = (int16_t)sys_get_le16(&data[2]); - drv_dev->az = (int16_t)sys_get_le16(&data[4]); - drv_dev->gx = (int16_t)sys_get_le16(&data[6]); - drv_dev->gy = (int16_t)sys_get_le16(&data[8]); - drv_dev->gz = (int16_t)sys_get_le16(&data[10]); + data->ax = (int16_t)sys_get_le16(&buf[0]); + data->ay = (int16_t)sys_get_le16(&buf[2]); + data->az = (int16_t)sys_get_le16(&buf[4]); + data->gx = (int16_t)sys_get_le16(&buf[6]); + data->gy = (int16_t)sys_get_le16(&buf[8]); + data->gz = (int16_t)sys_get_le16(&buf[10]); } else { - drv_dev->ax = 0; - drv_dev->ay = 0; - drv_dev->az = 0; - drv_dev->gx = 0; - drv_dev->gy = 0; - drv_dev->gz = 0; + data->ax = 0; + data->ay = 0; + data->az = 0; + data->gx = 0; + data->gy = 0; + data->gz = 0; } return ret; @@ -528,34 +528,34 @@ static int bmi270_sample_fetch(const struct device *dev, enum sensor_channel cha static int bmi270_channel_get(const struct device *dev, enum sensor_channel chan, struct sensor_value *val) { - struct bmi270_data *drv_dev = dev->data; + struct bmi270_data *data = dev->data; if (chan == SENSOR_CHAN_ACCEL_X) { - channel_accel_convert(val, drv_dev->ax, drv_dev->acc_range); + channel_accel_convert(val, data->ax, data->acc_range); } else if (chan == SENSOR_CHAN_ACCEL_Y) { - channel_accel_convert(val, drv_dev->ay, drv_dev->acc_range); + channel_accel_convert(val, data->ay, data->acc_range); } else if (chan == SENSOR_CHAN_ACCEL_Z) { - channel_accel_convert(val, drv_dev->az, drv_dev->acc_range); + channel_accel_convert(val, data->az, data->acc_range); } else if (chan == SENSOR_CHAN_ACCEL_XYZ) { - channel_accel_convert(&val[0], drv_dev->ax, - drv_dev->acc_range); - channel_accel_convert(&val[1], drv_dev->ay, - drv_dev->acc_range); - channel_accel_convert(&val[2], drv_dev->az, - drv_dev->acc_range); + channel_accel_convert(&val[0], data->ax, + data->acc_range); + channel_accel_convert(&val[1], data->ay, + data->acc_range); + channel_accel_convert(&val[2], data->az, + data->acc_range); } else if (chan == SENSOR_CHAN_GYRO_X) { - channel_gyro_convert(val, drv_dev->gx, drv_dev->gyr_range); + channel_gyro_convert(val, data->gx, data->gyr_range); } else if (chan == SENSOR_CHAN_GYRO_Y) { - channel_gyro_convert(val, drv_dev->gy, drv_dev->gyr_range); + channel_gyro_convert(val, data->gy, data->gyr_range); } else if (chan == SENSOR_CHAN_GYRO_Z) { - channel_gyro_convert(val, drv_dev->gz, drv_dev->gyr_range); + channel_gyro_convert(val, data->gz, data->gyr_range); } else if (chan == SENSOR_CHAN_GYRO_XYZ) { - channel_gyro_convert(&val[0], drv_dev->gx, - drv_dev->gyr_range); - channel_gyro_convert(&val[1], drv_dev->gy, - drv_dev->gyr_range); - channel_gyro_convert(&val[2], drv_dev->gz, - drv_dev->gyr_range); + channel_gyro_convert(&val[0], data->gx, + data->gyr_range); + channel_gyro_convert(&val[1], data->gy, + data->gyr_range); + channel_gyro_convert(&val[2], data->gz, + data->gyr_range); } else { return -ENOTSUP; } @@ -611,7 +611,7 @@ static int bmi270_attr_set(const struct device *dev, enum sensor_channel chan, static int bmi270_init(const struct device *dev) { int ret; - struct bmi270_data *drv_dev = dev->data; + struct bmi270_data *data = dev->data; uint8_t chip_id; uint8_t soft_reset_cmd; uint8_t init_ctrl; @@ -625,10 +625,10 @@ static int bmi270_init(const struct device *dev) return ret; } - drv_dev->acc_odr = BMI270_ACC_ODR_100_HZ; - drv_dev->acc_range = 8; - drv_dev->gyr_odr = BMI270_GYR_ODR_200_HZ; - drv_dev->gyr_range = 2000; + data->acc_odr = BMI270_ACC_ODR_100_HZ; + data->acc_range = 8; + data->gyr_odr = BMI270_GYR_ODR_200_HZ; + data->gyr_range = 2000; k_usleep(BMI270_POWER_ON_TIME); From 28f678aeab3901801af1e3967cfbb8489a6875be Mon Sep 17 00:00:00 2001 From: Dominik Chat Date: Thu, 22 Sep 2022 16:20:46 +0200 Subject: [PATCH 416/501] [nrf fromtree] boards: Remove bmi270 int1-gpios form thingy:53 DTS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BMI270 driver does not support interrupts and int1-gpios property produces twister failures. Signed-off-by: Dominik Chat Signed-off-by: Andrzej Głąbek (cherry picked from commit f7785f4cad83fc7447cdfe1ba2b4ebeb0107e15f) --- boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 1 - 1 file changed, 1 deletion(-) diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 0034a4d71df..41cb2f05034 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -198,7 +198,6 @@ status = "disabled"; spi-max-frequency = <8000000>; reg = <1>; - int1-gpios = <&gpio0 23 0>; }; nrf_radio_fem_spi: fem_spi@2 { From ba0d5243877ececc0573cdabb45c6720a8c58f9d Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Wed, 5 Oct 2022 15:00:42 +0200 Subject: [PATCH 417/501] [nrf fromtree] modules: mbedtls: Replace select statement with depends on for EC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of using "select" on certain EC configurations, which is considered unsafe for various reasons, use a "depends on" and rely on the user to set a proper configuration in the config file. Update the respective project configurations to comply with the new configuration scheme. Signed-off-by: Robert Lubos Signed-off-by: Andrzej Głąbek (cherry picked from commit b76c35d8094241f8de1f7d4d7603928a98cd20b0) --- drivers/wifi/esp32/Kconfig.esp32 | 3 +++ modules/mbedtls/Kconfig.tls-generic | 20 +++++++++----------- subsys/net/l2/openthread/Kconfig | 5 +++++ tests/benchmarks/mbedtls/prj.conf | 4 ++++ 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/wifi/esp32/Kconfig.esp32 b/drivers/wifi/esp32/Kconfig.esp32 index 38688b987fa..ab12a027bc5 100644 --- a/drivers/wifi/esp32/Kconfig.esp32 +++ b/drivers/wifi/esp32/Kconfig.esp32 @@ -12,6 +12,9 @@ menuconfig WIFI_ESP32 select MBEDTLS_ENTROPY_ENABLED select MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED select MBEDTLS_ECP_ALL_ENABLED + select MBEDTLS_ECDH_C + select MBEDTLS_ECDSA_C + select MBEDTLS_ECP_C help Enable ESP32 SoC WiFi support. Only supported in single core mode because the network stack is not aware of SMP diff --git a/modules/mbedtls/Kconfig.tls-generic b/modules/mbedtls/Kconfig.tls-generic index 7b0f2fab837..b37e423fb75 100644 --- a/modules/mbedtls/Kconfig.tls-generic +++ b/modules/mbedtls/Kconfig.tls-generic @@ -75,7 +75,7 @@ config MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED bool "ECDHE-PSK based ciphersuite modes" - select MBEDTLS_ECDH_C + depends on MBEDTLS_ECDH_C config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED bool "RSA-PSK based ciphersuite modes" @@ -107,42 +107,40 @@ config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED bool "ECDHE-RSA based ciphersuite modes" - select MBEDTLS_ECDH_C + depends on MBEDTLS_ECDH_C config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED bool "ECDHE-ECDSA based ciphersuite modes" - select MBEDTLS_ECDH_C - select MBEDTLS_ECDSA_C + depends on MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED bool "ECDH-ECDSA based ciphersuite modes" - select MBEDTLS_ECDH_C - select MBEDTLS_ECDSA_C + depends on MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C config MBEDTLS_ECDSA_DETERMINISTIC bool "Deterministic ECDSA (RFC 6979)" config MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED bool "ECDH-RSA based ciphersuite modes" - select MBEDTLS_ECDH_C + depends on MBEDTLS_ECDH_C config MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED bool "ECJPAKE based ciphersuite modes" - select MBEDTLS_ECJPAKE_C + depends on MBEDTLS_ECJPAKE_C comment "Elliptic curve libraries" config MBEDTLS_ECDH_C bool "Elliptic curve Diffie-Hellman library" - select MBEDTLS_ECP_C + depends on MBEDTLS_ECP_C config MBEDTLS_ECDSA_C bool "Elliptic curve DSA library" - select MBEDTLS_ECP_C + depends on MBEDTLS_ECP_C config MBEDTLS_ECJPAKE_C bool "Elliptic curve J-PAKE library" - select MBEDTLS_ECP_C + depends on MBEDTLS_ECP_C config MBEDTLS_ECP_C bool "Elliptic curve over GF(p) library" diff --git a/subsys/net/l2/openthread/Kconfig b/subsys/net/l2/openthread/Kconfig index 5c9d6afebae..781787c1f4c 100644 --- a/subsys/net/l2/openthread/Kconfig +++ b/subsys/net/l2/openthread/Kconfig @@ -191,6 +191,7 @@ config OPENTHREAD_MBEDTLS select MBEDTLS_TLS_VERSION_1_2 if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER select MBEDTLS_DTLS if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER select MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER + select MBEDTLS_ECJPAKE_C if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER select MBEDTLS_ECP_DP_SECP256R1_ENABLED if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER || \ OPENTHREAD_SRP_CLIENT || OPENTHREAD_SRP_SERVER select MBEDTLS_ECP_NIST_OPTIM if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER @@ -199,8 +200,12 @@ config OPENTHREAD_MBEDTLS select MBEDTLS_HMAC_DRBG_ENABLED if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER || \ OPENTHREAD_SRP_CLIENT || OPENTHREAD_SRP_SERVER select MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED if OPENTHREAD_ECDSA + select MBEDTLS_ECDH_C if OPENTHREAD_ECDSA + select MBEDTLS_ECDSA_C if OPENTHREAD_ECDSA select MBEDTLS_ECDSA_DETERMINISTIC if OPENTHREAD_ECDSA select MBEDTLS_PK_WRITE_C if OPENTHREAD_ECDSA + select MBEDTLS_ECP_C if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER || OPENTHREAD_ECDSA + config OPENTHREAD_MBEDTLS_LIB_NAME string "mbedtls lib name" diff --git a/tests/benchmarks/mbedtls/prj.conf b/tests/benchmarks/mbedtls/prj.conf index cfb2a4545c5..6339cd45b17 100644 --- a/tests/benchmarks/mbedtls/prj.conf +++ b/tests/benchmarks/mbedtls/prj.conf @@ -24,3 +24,7 @@ CONFIG_MBEDTLS_ECP_ALL_ENABLED=y CONFIG_MBEDTLS_MAC_ALL_ENABLED=y CONFIG_MBEDTLS_GENPRIME_ENABLED=y CONFIG_MBEDTLS_HMAC_DRBG_ENABLED=y +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +CONFIG_MBEDTLS_ECJPAKE_C=y +CONFIG_MBEDTLS_ECP_C=y From 665bae2d8cf8c7f7ba3a8f247f3c142fb244dac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Fri, 7 Oct 2022 10:46:40 +0200 Subject: [PATCH 418/501] [nrf fromtree] net: lib: sockets_tls: Include zephyr_mbedtls_priv.h conditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit a418ad4bb4dda1a8add47084111c0362aa90a495. Since the path to zephyr_mbedtls_priv.h is added to include directories only when CONFIG_MBEDTLS_BUILTIN is enabled, the inclusion of the file needs to be done under the same condition. Otherwise, an error occurs when socket_tls.c is compiled without CONFIG_MBEDTLS_BUILTIN. Signed-off-by: Andrzej Głąbek (cherry picked from commit 916e04e0ef3c129ae9837cdc05c13ea427650a12) --- subsys/net/lib/sockets/sockets_tls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsys/net/lib/sockets/sockets_tls.c b/subsys/net/lib/sockets/sockets_tls.c index 773b1e4986f..85b7eb7bd73 100644 --- a/subsys/net/lib/sockets/sockets_tls.c +++ b/subsys/net/lib/sockets/sockets_tls.c @@ -52,7 +52,9 @@ LOG_MODULE_REGISTER(net_sock_tls, CONFIG_NET_SOCKETS_LOG_LEVEL); #include "sockets_internal.h" #include "tls_internal.h" -#include "zephyr_mbedtls_priv.h" +#if defined(CONFIG_MBEDTLS_BUILTIN) +#include +#endif #if defined(CONFIG_NET_SOCKETS_TLS_MAX_APP_PROTOCOLS) #define ALPN_MAX_PROTOCOLS (CONFIG_NET_SOCKETS_TLS_MAX_APP_PROTOCOLS + 1) From 32d3b4dccde842e8213c70d3787930819cb909d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 10 Oct 2022 13:00:42 +0200 Subject: [PATCH 419/501] [nrf fromtree] net: pkt: Allow compilation with custom IEEE 802.15.4 based L2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow up to commit bb86f8b967b2a7277379b87f8959c7ddd11c8402. Also custom IEEE 802.15.4 based L2 implementations may need to use packet handling without the IP layer. Add support for such cases. Signed-off-by: Andrzej Głąbek (cherry picked from commit 6ae66cc13dd0c2ec446e4af5a39a3865056ff695) --- subsys/net/ip/net_pkt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsys/net/ip/net_pkt.c b/subsys/net/ip/net_pkt.c index dd2e77ca4ca..f3298466177 100644 --- a/subsys/net/ip/net_pkt.c +++ b/subsys/net/ip/net_pkt.c @@ -55,7 +55,9 @@ LOG_MODULE_REGISTER(net_pkt, CONFIG_NET_PKT_LOG_LEVEL); */ #define MAX_IP_PROTO_LEN 8 #else -#if defined(CONFIG_NET_ETHERNET_BRIDGE) || defined(CONFIG_NET_L2_IEEE802154) +#if defined(CONFIG_NET_ETHERNET_BRIDGE) || \ + defined(CONFIG_NET_L2_IEEE802154) || \ + defined(CONFIG_NET_L2_CUSTOM_IEEE802154) #define MAX_IP_PROTO_LEN 0 #else #error "Some packet protocol (e.g. IPv6, IPv4, ETH, IEEE 802.15.4) needs to be selected." From 3ffd4564582375fa021298fc1bb44cd24919802f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Ciupis?= Date: Mon, 10 Oct 2022 12:56:45 +0200 Subject: [PATCH 420/501] [nrf fromlist] dts: arm: nordic: add ieee802154 node to nrf5340_cpuapp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds an ieee802154 node to the list of nRF5340 application core's peripherals. While it does not translate directly into a physical RADIO peripheral, it represents the capability to use the ieee802154 radio (indirectly, through the network core). Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/51123 Signed-off-by: Jędrzej Ciupis --- dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi index 5ff0d785822..181852da194 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi @@ -507,3 +507,7 @@ gpio1: gpio@842800 { status = "disabled"; port = <1>; }; + +ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; +}; From be2d3f17cccc4183d4e961886a0e28e32b80895e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Ciupis?= Date: Mon, 10 Oct 2022 13:02:46 +0200 Subject: [PATCH 421/501] [nrf fromlist] boards: arm: nordic: add ieee802154 to chosen for nrf5340_cpuapp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds ieee802154 node to chosen for boards based on nRF5340 application core. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/51123 Signed-off-by: Jędrzej Ciupis --- boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts | 1 + boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 1 + 2 files changed, 2 insertions(+) diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts index 77da12d8116..75f11986b11 100644 --- a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts +++ b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts @@ -14,6 +14,7 @@ zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; zephyr,bt-hci-rpmsg-ipc = &ipc0; + zephyr,ieee802154 = &ieee802154; }; leds { diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index 41cb2f05034..cb4def46984 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -13,6 +13,7 @@ zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; zephyr,bt-hci-rpmsg-ipc = &ipc0; + zephyr,ieee802154 = &ieee802154; }; buttons { From f4ca90eee30db7c7de6a9f99928a48b62c943d83 Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Wed, 28 Sep 2022 12:18:26 +0200 Subject: [PATCH 422/501] [nrf fromtree] net: ipv6: Allowed to add route to router's link local address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zephyr doesn't seem to allow on adding route to the device from which it received Router Advertisement without SLLAO field set (in particular device that doesn't include Link Layer address). Changes done: * Added creating new NBR without Link Layer address set on RA reception (LL is added only if SLLAO option is set, otherwise NBR doesn't have LL address, but exists in the table and has valid IPv6 link local address). * Removed two asserts preventing from adding route to the NBR that doesn't have Link Layer address set. Signed-off-by: Kamil Kasperczyk Signed-off-by: Andrzej Głąbek (cherry picked from commit 1475d20aff0b5e0413f8fa096012f33a1fc550c2) --- subsys/net/ip/ipv6_nbr.c | 14 +++++++++++--- subsys/net/ip/route.c | 24 ++++++------------------ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/subsys/net/ip/ipv6_nbr.c b/subsys/net/ip/ipv6_nbr.c index fddd0996132..61c817c0b7a 100644 --- a/subsys/net/ip/ipv6_nbr.c +++ b/subsys/net/ip/ipv6_nbr.c @@ -592,11 +592,11 @@ struct net_nbr *net_ipv6_nbr_add(struct net_if *iface, if (!nbr) { NET_ERR("Could not add router neighbor %s [%s]", net_sprint_ipv6_addr(addr), - net_sprint_ll_addr(lladdr->addr, lladdr->len)); + lladdr ? net_sprint_ll_addr(lladdr->addr, lladdr->len) : "unknown"); return NULL; } - if (net_nbr_link(nbr, iface, lladdr) == -EALREADY && + if (lladdr && net_nbr_link(nbr, iface, lladdr) == -EALREADY && net_ipv6_nbr_data(nbr)->state != NET_IPV6_NBR_STATE_STATIC) { /* Update the lladdr if the node was already known */ struct net_linkaddr_storage *cached_lladdr; @@ -629,7 +629,7 @@ struct net_nbr *net_ipv6_nbr_add(struct net_if *iface, NET_DBG("[%d] nbr %p state %d router %d IPv6 %s ll %s iface %p/%d", nbr->idx, nbr, state, is_router, net_sprint_ipv6_addr(addr), - net_sprint_ll_addr(lladdr->addr, lladdr->len), + lladdr ? net_sprint_ll_addr(lladdr->addr, lladdr->len) : "[unknown]", nbr->iface, net_if_get_by_iface(nbr->iface)); #if defined(CONFIG_NET_MGMT_EVENT_INFO) @@ -2393,11 +2393,19 @@ static enum net_verdict handle_ra_input(struct net_pkt *pkt, nd_opt_hdr = (struct net_icmpv6_nd_opt_hdr *) net_pkt_get_data(pkt, &nd_access); + + /* Add neighbor cache entry using link local address, regardless of link layer address + * presence in Router Advertisement. + */ + nbr = net_ipv6_nbr_add(net_pkt_iface(pkt), (struct in6_addr *)NET_IPV6_HDR(pkt)->src, NULL, + true, NET_IPV6_NBR_STATE_INCOMPLETE); + while (nd_opt_hdr) { net_pkt_acknowledge_data(pkt, &nd_access); switch (nd_opt_hdr->type) { case NET_ICMPV6_ND_OPT_SLLAO: + /* Update existing neighbor cache entry with link layer address. */ nbr = handle_ra_neighbor(pkt, nd_opt_hdr->len); if (!nbr) { goto drop; diff --git a/subsys/net/ip/route.c b/subsys/net/ip/route.c index 0da20d7df6b..a46c413633e 100644 --- a/subsys/net/ip/route.c +++ b/subsys/net/ip/route.c @@ -235,10 +235,6 @@ static struct net_nbr *nbr_nexthop_get(struct net_if *iface, return NULL; } - NET_ASSERT(nbr->idx != NET_NBR_LLADDR_UNKNOWN, - "Nexthop %s not in neighbor cache!", - net_sprint_ipv6_addr(addr)); - net_nbr_ref(nbr); NET_DBG("[%d] nbr %p iface %p IPv6 %s", @@ -367,14 +363,12 @@ struct net_route_entry *net_route_add(struct net_if *iface, goto exit; } - nexthop_lladdr = net_nbr_get_lladdr(nbr_nexthop->idx); - - NET_ASSERT(nexthop_lladdr); - - NET_DBG("Nexthop %s lladdr is %s", - net_sprint_ipv6_addr(nexthop), - net_sprint_ll_addr(nexthop_lladdr->addr, - nexthop_lladdr->len)); + if (nbr_nexthop && nbr_nexthop->idx != NET_NBR_LLADDR_UNKNOWN) { + nexthop_lladdr = net_nbr_get_lladdr(nbr_nexthop->idx); + NET_ASSERT(nexthop_lladdr); + NET_DBG("Nexthop %s lladdr is %s", net_sprint_ipv6_addr(nexthop), + net_sprint_ll_addr(nexthop_lladdr->addr, nexthop_lladdr->len)); + } route = net_route_lookup(iface, addr); if (route) { @@ -752,12 +746,6 @@ struct in6_addr *net_route_get_nexthop(struct net_route_entry *route) SYS_SLIST_FOR_EACH_CONTAINER(&route->nexthop, nexthop_route, node) { struct in6_addr *addr; - NET_ASSERT(nexthop_route->nbr->idx != NET_NBR_LLADDR_UNKNOWN); - - if (nexthop_route->nbr->idx == NET_NBR_LLADDR_UNKNOWN) { - continue; - } - ipv6_nbr_data = net_ipv6_nbr_data(nexthop_route->nbr); if (ipv6_nbr_data) { addr = &ipv6_nbr_data->addr; From 15e34e8a700fff8c080fef7c4333e1caf720a6bd Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Thu, 13 Oct 2022 09:54:15 +0200 Subject: [PATCH 423/501] [nrf fromtree] drivers: uart_native_posix: Fix reading file input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the read function returns value of zero, there is no more data in the file and the function should return value of -1. Signed-off-by: Marek Pieta Signed-off-by: Andrzej Głąbek (cherry picked from commit ea38e742b84605e9d99752c9a44bb3d29c249309) --- drivers/serial/uart_native_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/uart_native_posix.c b/drivers/serial/uart_native_posix.c index e6b1c1d2c83..fd211068c55 100644 --- a/drivers/serial/uart_native_posix.c +++ b/drivers/serial/uart_native_posix.c @@ -337,7 +337,7 @@ static int np_uart_stdin_poll_in(const struct device *dev, } n = read(in_f, p_char, 1); - if (n == -1) { + if ((n == -1) || (n == 0)) { return -1; } From 3858bda2373d4992f31a2af6543e72610f9de92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Tue, 18 Oct 2022 09:12:26 +0200 Subject: [PATCH 424/501] [nrf fromlist] modules: mbedtls: Provide `mbedtls_hardware_poll()` conditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/51362. This is a follow-up to commit c7327f5f707bfb367a78be05325469f2e950171a. Wrap implementation of the `mbedtls_hardware_poll()` function in `#if defined(CONFIG_MBEDTLS_ZEPHYR_ENTROPY)` so that the function is provided only when that option is activated. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/zephyr_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/mbedtls/zephyr_init.c b/modules/mbedtls/zephyr_init.c index f567a081703..5a929e4c608 100644 --- a/modules/mbedtls/zephyr_init.c +++ b/modules/mbedtls/zephyr_init.c @@ -45,6 +45,7 @@ static void init_heap(void) #define init_heap(...) #endif /* CONFIG_MBEDTLS_ENABLE_HEAP && MBEDTLS_MEMORY_BUFFER_ALLOC_C */ +#if defined(CONFIG_MBEDTLS_ZEPHYR_ENTROPY) static const struct device *const entropy_dev = DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_entropy)); @@ -80,6 +81,7 @@ int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len, return 0; } +#endif /* CONFIG_MBEDTLS_ZEPHYR_ENTROPY */ static int _mbedtls_init(const struct device *device) { From d9f99ed1951a973c691cd5d6bd70aecb597b2030 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 22 Sep 2022 11:21:33 +0000 Subject: [PATCH 425/501] [nrf fromtree] mgmt/mcumgr: Drop empty parameter from img_mgmt_flash_check_empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit drops empty parameter from img_mgmt_flash_check_empty and img_mgmt_flash_check_empty_inner and uses the return code instead. Both functions now use negative errno codes instead of MGMT_ERR_ type codes. Signed-off-by: Dominik Ermel Signed-off-by: Andrzej Głąbek (cherry picked from commit 84345a4ec05779e29735e300008b5bdc9bd6c18a) --- .../lib/cmd/img_mgmt/src/zephyr_img_mgmt.c | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/zephyr_img_mgmt.c b/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/zephyr_img_mgmt.c index 424390318e1..fc2c25f7fec 100644 --- a/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/zephyr_img_mgmt.c +++ b/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/zephyr_img_mgmt.c @@ -54,8 +54,12 @@ zephyr_img_mgmt_slot_to_image(int slot) /** * Determines if the specified area of flash is completely unwritten. + * + * @param fa pointer to flash area to scan + * + * @return 0 when not empty, 1 when empty, negative errno code on error. */ -static int img_mgmt_flash_check_empty_inner(const struct flash_area *fa, bool *out_empty) +static int img_mgmt_flash_check_empty_inner(const struct flash_area *fa) { uint32_t data[16]; off_t addr; @@ -80,37 +84,38 @@ static int img_mgmt_flash_check_empty_inner(const struct flash_area *fa, bool *o } rc = flash_area_read(fa, addr, data, bytes_to_read); - if (rc != 0) { - return MGMT_ERR_EUNKNOWN; + if (rc < 0) { + return rc; } for (i = 0; i < bytes_to_read / 4; i++) { if (data[i] != erased_val_32) { - *out_empty = false; return 0; } } } - *out_empty = true; - - return 0; + return 1; } #ifndef CONFIG_IMG_ERASE_PROGRESSIVELY -static int img_mgmt_flash_check_empty(uint8_t fa_id, bool *out_empty) +/* Check if area is empty + * + * @param fa_id ID of flash area to scan. + * + * @return 0 when not empty, 1 when empty, negative errno code on error. + */ +static int img_mgmt_flash_check_empty(uint8_t fa_id) { const struct flash_area *fa; int rc; rc = flash_area_open(fa_id, &fa); - if (rc != 0) { - return MGMT_ERR_EUNKNOWN; - } + if (rc == 0) { + rc = img_mgmt_flash_check_empty_inner(fa); - rc = img_mgmt_flash_check_empty_inner(fa, out_empty); - - flash_area_close(fa); + flash_area_close(fa); + } return rc; } @@ -259,7 +264,6 @@ img_mgmt_impl_erase_slot(int slot) const struct flash_area *fa; int rc; int area_id = zephyr_img_mgmt_flash_area_id(slot); - bool empty; if (area_id < 0) { return MGMT_ERR_EUNKNOWN; @@ -267,19 +271,19 @@ img_mgmt_impl_erase_slot(int slot) rc = flash_area_open(area_id, &fa); - if (rc != 0) { + if (rc < 0) { return MGMT_ERR_EUNKNOWN; } - rc = img_mgmt_flash_check_empty_inner(fa, &empty); + rc = img_mgmt_flash_check_empty_inner(fa); - if (!empty && rc == 0) { + if (rc == 0) { rc = flash_area_erase(fa, 0, fa->fa_size); } flash_area_close(fa); - return (rc == 0 ? MGMT_ERR_EOK : MGMT_ERR_EUNKNOWN); + return (rc >= 0 ? MGMT_ERR_EOK : MGMT_ERR_EUNKNOWN); } int @@ -529,9 +533,6 @@ img_mgmt_impl_upload_inspect(const struct img_mgmt_upload_req *req, const struct image_header *hdr; struct image_version cur_ver; int rc; -#ifndef CONFIG_IMG_ERASE_PROGRESSIVELY - bool empty; -#endif memset(action, 0, sizeof(*action)); @@ -625,12 +626,12 @@ img_mgmt_impl_upload_inspect(const struct img_mgmt_upload_req *req, } #ifndef CONFIG_IMG_ERASE_PROGRESSIVELY - rc = img_mgmt_flash_check_empty(action->area_id, &empty); - if (rc) { + rc = img_mgmt_flash_check_empty(action->area_id); + if (rc < 0) { return MGMT_ERR_EUNKNOWN; } - action->erase = !empty; + action->erase = (rc == 0); #endif } else { /* Continuation of upload. */ From 25352c55758e25eb00903df10d8ec2b964984461 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Wed, 12 Oct 2022 16:16:09 +0530 Subject: [PATCH 426/501] [nrf fromtree] net: ip: mgmt: Fix the maximum event size calculation Use a union to capture all big NET event structures with a default size of 32bytes, this makes maintenance easier. Signed-off-by: Krishna T --- subsys/net/ip/net_private.h | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 5f1a00975ab..affb1575f5b 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -19,27 +19,28 @@ #include -/* Maximum size of "struct net_event_ipv6_addr" or - * "struct net_event_ipv6_nbr" or "struct net_event_ipv6_route". - * NOTE: Update comments here and calculate which struct occupies max size. - */ +/* For struct wifi_scan_result */ +#include +#define DEFAULT_NET_EVENT_INFO_SIZE 32 +/* NOTE: Update this union with all *big* event info structs */ +union net_mgmt_events { +#if defined(CONFIG_NET_DHCPV4) + struct net_if_dhcpv4 dhcpv4; +#endif /* CONFIG_NET_DHCPV4 */ #if defined(CONFIG_NET_L2_WIFI_MGMT) + struct wifi_scan_result wifi_scan_result; +#endif /* CONFIG_NET_L2_WIFI_MGMT */ +#if defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV6_MLD) + struct net_event_ipv6_route ipv6_route; +#endif /* CONFIG_NET_IPV6 && CONFIG_NET_IPV6_MLD */ + char default_event[DEFAULT_NET_EVENT_INFO_SIZE]; +}; -#include -#define NET_EVENT_INFO_MAX_SIZE sizeof(struct wifi_scan_result) +#define NET_EVENT_INFO_MAX_SIZE sizeof(union net_mgmt_events) -#else - -#if defined(CONFIG_NET_DHCPV4) -#define NET_EVENT_INFO_MAX_SIZE sizeof(struct net_if_dhcpv4) -#else -#define NET_EVENT_INFO_MAX_SIZE sizeof(struct net_event_ipv6_route) #endif -#endif /* CONFIG_NET_L2_WIFI_MGMT */ -#endif /* CONFIG_NET_MGMT_EVENT_INFO */ - #include "connection.h" extern void net_if_init(void); From 0d30e42aa5ac675328ff372b7095ab2bcb2e5cef Mon Sep 17 00:00:00 2001 From: Krishna T Date: Tue, 18 Oct 2022 20:47:42 +0530 Subject: [PATCH 427/501] [nrf fromtree] net: ip: mgmt: Log the event ID for dropped events This helps debug and fix the maximum event size allocation. Signed-off-by: Krishna T --- subsys/net/ip/net_mgmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/net/ip/net_mgmt.c b/subsys/net/ip/net_mgmt.c index 9b0ad458cd4..956ecf27064 100644 --- a/subsys/net/ip/net_mgmt.c +++ b/subsys/net/ip/net_mgmt.c @@ -67,8 +67,8 @@ static inline void mgmt_push_event(uint32_t mgmt_event, struct net_if *iface, memcpy(events[i_idx].info, info, length); events[i_idx].info_length = length; } else { - NET_ERR("Event info length %zu > max size %zu", - length, NET_EVENT_INFO_MAX_SIZE); + NET_ERR("Event %u info length %zu > max size %zu", + mgmt_event, length, NET_EVENT_INFO_MAX_SIZE); (void)k_mutex_unlock(&net_mgmt_lock); return; From 95223721696ff4df5eb3cede605fd2cc16ba65d0 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 28 Sep 2022 15:33:52 +0200 Subject: [PATCH 428/501] [nrf fromtree] soc: nrf5340: Produce a Kconfig error when GPIO cannot be forwarded Make Kconfig produce an error when GPIOs cannot be forwarded in the current configuration instead of silently excluding the forwarding. Signed-off-by: Joakim Andersson (cherry picked from commit c08964afd5d7502792645f307b0649c33b9daf68) --- boards/arm/bl5340_dvk/Kconfig | 2 ++ boards/arm/nrf5340dk_nrf5340/Kconfig | 2 ++ boards/arm/thingy53_nrf5340/Kconfig | 2 ++ soc/arm/nordic_nrf/nrf53/Kconfig.soc | 6 ++++++ soc/arm/nordic_nrf/nrf53/soc.c | 10 ++-------- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/boards/arm/bl5340_dvk/Kconfig b/boards/arm/bl5340_dvk/Kconfig index 856e6a9d60b..473fceba7e3 100644 --- a/boards/arm/bl5340_dvk/Kconfig +++ b/boards/arm/bl5340_dvk/Kconfig @@ -39,6 +39,8 @@ config BT_HCI_VS config BOARD_ENABLE_CPUNET bool "NRF53 Network MCU" + select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ + $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) help This option enables releasing the Network 'force off' signal, which as a consequence will power up the Network MCU during system boot. diff --git a/boards/arm/nrf5340dk_nrf5340/Kconfig b/boards/arm/nrf5340dk_nrf5340/Kconfig index 170b13d88be..85190d7c890 100644 --- a/boards/arm/nrf5340dk_nrf5340/Kconfig +++ b/boards/arm/nrf5340dk_nrf5340/Kconfig @@ -22,6 +22,8 @@ config BOARD_ENABLE_DCDC_HV config BOARD_ENABLE_CPUNET bool "NRF53 Network MCU" + select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ + $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) help This option enables releasing the Network 'force off' signal, which as a consequence will power up the Network MCU during system boot. diff --git a/boards/arm/thingy53_nrf5340/Kconfig b/boards/arm/thingy53_nrf5340/Kconfig index 5ec954d5fbf..e8761b1667d 100644 --- a/boards/arm/thingy53_nrf5340/Kconfig +++ b/boards/arm/thingy53_nrf5340/Kconfig @@ -34,6 +34,8 @@ config BOARD_ENABLE_DCDC_HV config BOARD_ENABLE_CPUNET bool "NRF53 Network MCU" + select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ + $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) help This option enables releasing the Network 'force off' signal, which as a consequence will power up the Network MCU during system boot. diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index a27f807ee2e..97f307a1c14 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -45,6 +45,12 @@ config SOC_DCDC_NRF53X_HV help Enable nRF53 series System on Chip High Voltage DC/DC converter. +config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 + bool + depends on NRF_SOC_SECURE_SUPPORTED + help + hidden option for including the nRF GPIO pin forwarding + if !TRUSTED_EXECUTION_NONSECURE || BUILD_WITH_TFM config SOC_ENABLE_LFXO diff --git a/soc/arm/nordic_nrf/nrf53/soc.c b/soc/arm/nordic_nrf/nrf53/soc.c index 28fdd56a343..be318ca8fa4 100644 --- a/soc/arm/nordic_nrf/nrf53/soc.c +++ b/soc/arm/nordic_nrf/nrf53/soc.c @@ -51,13 +51,7 @@ extern void z_arm_nmi_init(void); #error "Unknown nRF53 SoC." #endif -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_gpio_forwarder) && \ - defined(CONFIG_BOARD_ENABLE_CPUNET) && \ - (!defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM)) -#define NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED -#endif - -#if defined(NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED) +#if defined(CONFIG_SOC_NRF_GPIO_FORWARDER_FOR_NRF5340) #define GPIOS_PSEL_BY_IDX(node_id, prop, idx) \ NRF_DT_GPIOS_TO_PSEL_BY_IDX(node_id, prop, idx), #define ALL_GPIOS_IN_NODE(node_id) \ @@ -169,7 +163,7 @@ static int nordicsemi_nrf53_init(const struct device *arg) nrf_regulators_dcdcen_vddh_set(NRF_REGULATORS, true); #endif -#if defined(NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED) +#if defined(CONFIG_SOC_NRF_GPIO_FORWARDER_FOR_NRF5340) static const uint8_t forwarded_psels[] = { DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio_forwarder, ALL_GPIOS_IN_FORWARDER) }; From 8a42298a52a855b3e977484230f253ec4e9db9cc Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Thu, 22 Sep 2022 16:51:25 +0200 Subject: [PATCH 429/501] [nrf fromtree] soc: nordic_nrf: Allow building with TF-M without platform partition Allow building for nRF non-secure and TF-M enabled without having the platform partition enabled. In this configuration the soc_secure functions have no valid implementation, leave it as a compilation error if the application includes the functions. Add missing dependency on soc_secure functions being available for SOC_HFXO_CAP_INTERNAL configuration. Signed-off-by: Joakim Andersson (cherry picked from commit 63e45c8c7b74286dbf38455b45f47d6b03180d8e) --- soc/arm/nordic_nrf/Kconfig | 2 +- soc/arm/nordic_nrf/common/CMakeLists.txt | 2 +- soc/arm/nordic_nrf/nrf53/Kconfig.soc | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/soc/arm/nordic_nrf/Kconfig b/soc/arm/nordic_nrf/Kconfig index aefe8ea0061..555043fdf6c 100644 --- a/soc/arm/nordic_nrf/Kconfig +++ b/soc/arm/nordic_nrf/Kconfig @@ -17,7 +17,7 @@ source "soc/arm/nordic_nrf/Kconfig.peripherals" source "soc/arm/nordic_nrf/*/Kconfig.soc" config NRF_SOC_SECURE_SUPPORTED - def_bool !TRUSTED_EXECUTION_NONSECURE || BUILD_WITH_TFM + def_bool !TRUSTED_EXECUTION_NONSECURE || (BUILD_WITH_TFM && TFM_PARTITION_PLATFORM) help Hidden function to indicate that that the soc_secure functions are available. diff --git a/soc/arm/nordic_nrf/common/CMakeLists.txt b/soc/arm/nordic_nrf/common/CMakeLists.txt index 3b7dff509a6..941ccaea039 100644 --- a/soc/arm/nordic_nrf/common/CMakeLists.txt +++ b/soc/arm/nordic_nrf/common/CMakeLists.txt @@ -4,7 +4,7 @@ zephyr_library_sources_ifdef(CONFIG_SOC_FAMILY_NRF soc_nrf_common.S) zephyr_include_directories(.) -if (CONFIG_BUILD_WITH_TFM) +if (CONFIG_TFM_PARTITION_PLATFORM) zephyr_sources(soc_secure.c) zephyr_library_include_directories( $/install/interface/include diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index 97f307a1c14..370fc735a5d 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -100,6 +100,7 @@ config SOC_HFXO_CAP_EXTERNAL config SOC_HFXO_CAP_INTERNAL bool "Use internal load capacitors" + depends on NRF_SOC_SECURE_SUPPORTED endchoice From c5340c156e0ce042b21ae716906b2746a7835343 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Thu, 22 Sep 2022 16:47:21 +0200 Subject: [PATCH 430/501] [nrf fromtree] tfm: Add option to enable the SFN model Add option to enable the SFN model when building TF-M. The SFN model will eventually replace the Library model. Change the default model to be IPC, which follows the default configuration of TF-M. Signed-off-by: Joakim Andersson (cherry picked from commit 3abcc19fd7dcdfd8754af7c4086bc37cf6e07fa6) --- modules/trusted-firmware-m/CMakeLists.txt | 13 +++-- modules/trusted-firmware-m/Kconfig.tfm | 48 ++++++++++++++++--- .../trusted-firmware-m/Kconfig.tfm.partitions | 9 +++- 3 files changed, 58 insertions(+), 12 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 36e36c9f841..9cb7f6967bc 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -31,12 +31,17 @@ set(TFM_CRYPTO_MODULES if (CONFIG_BUILD_WITH_TFM) - if (CONFIG_TFM_IPC) + if (CONFIG_TFM_LIBRARY) + list(APPEND TFM_CMAKE_ARGS -DTFM_LIB_MODEL=ON) + else() list(APPEND TFM_CMAKE_ARGS -DTFM_LIB_MODEL=OFF) # PSA API awareness for the Non-Secure application target_compile_definitions(app PRIVATE "TFM_PSA_API") - else() - list(APPEND TFM_CMAKE_ARGS -DTFM_LIB_MODEL=ON) + if (CONFIG_TFM_SFN) + list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="SFN") + else() # CONFIG_TFM_IPC + list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="IPC") + endif() endif() if (CONFIG_TFM_REGRESSION_S) list(APPEND TFM_CMAKE_ARGS -DTEST_S=ON) @@ -372,7 +377,7 @@ if (CONFIG_BUILD_WITH_TFM) endif() if(NOT CONFIG_TFM_BUILD_NS) - if(CONFIG_TFM_IPC) + if(CONFIG_TFM_IPC OR CONFIG_TFM_SFN) zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_ipc_api.c) zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_ipc_api.c) zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_ipc_api.c) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index eeb5cdef00f..39d42625c32 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -276,14 +276,50 @@ config TFM_MCUBOOT_DATA_SHARING endif # TFM_BL2 +choice TFM_MODEL + prompt "TF-M Firmware Framework model" + default TFM_IPC + help + The Firmware Framework M (FF-M) provides different programming models + for Secure Partitions. + +config TFM_LIBRARY + bool "Library Model" + help + Use the library model instead of PSA API. + + The library model conforms to the PSA Firmware Framework for M (FF-M) + v1.0. + + NOTE: The Library Model will be removed and replaced by the SFN model. + config TFM_IPC - bool "IPC" if TFM_PROFILE_TYPE_NOT_SET - default y if (TFM_PROFILE_TYPE_MEDIUM || TFM_PROFILE_TYPE_LARGE) + bool "IPC Model" help - When enabled, this option signifies that the TF-M build supports - the PSA API (IPC mode) instead of the secure library mode. When - TF-M Profile option is supplied, do not allow manual setting of - the IPC mode, as it is determined by the profile setting. + Use the IPC Model as the SPM backend for the PSA API. + The IPC model supports the IPC and SFN Partition models, and + isolation levels 1, 2 and 3. + + In this model each Secure Partition processes signals in any order, + and can defer responding to a message while continuing to process + other signals. + + The IPC model conforms to the PSA Firmware Framework for M (FF-M) + v1.1. + +config TFM_SFN + bool "SFN model" + help + Use the SFN Model as the SPM backend for the PSA API. + The SFN model supports the SFN Partition model, and isolation level 1. + + In this model each Secure Partition is made up of a collection of + callback functions which implement secure services. + + The SFN model conforms to the PSA Firmware Framework for M (FF-M) + v1.1. + +endchoice # TFM_MODEL config TFM_REGRESSION_S bool "TF-M Secure Regression tests" diff --git a/modules/trusted-firmware-m/Kconfig.tfm.partitions b/modules/trusted-firmware-m/Kconfig.tfm.partitions index 4eddc50a042..4e223416c50 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.partitions +++ b/modules/trusted-firmware-m/Kconfig.tfm.partitions @@ -7,6 +7,9 @@ if BUILD_WITH_TFM config TFM_PARTITION_PROTECTED_STORAGE bool "Secure partition 'Protected Storage'" + depends on TFM_PARTITION_PLATFORM # Specfically TFM_SP_PLATFORM_NV_COUNTER service + depends on TFM_PARTITION_INTERNAL_TRUSTED_STORAGE + depends on TFM_PARTITION_CRYPTO default y help Setting this option will cause '-DTFM_PARTITION_PROTECTED_STORAGE' @@ -40,6 +43,7 @@ config TFM_PARTITION_CRYPTO config TFM_PARTITION_INITIAL_ATTESTATION bool "Secure partition 'Initial Attestation'" + depends on TFM_PARTITION_CRYPTO default y help Setting this option will cause '-DTFM_PARTITION_INITIAL_ATTESTATION' @@ -52,6 +56,7 @@ config TFM_PARTITION_INITIAL_ATTESTATION config TFM_PARTITION_PLATFORM bool "Secure partition 'Platform'" default y + depends on !TFM_SFN # Currently using PSA Framework version 1.0 help Setting this option will cause '-DTFM_PARTITION_PLATFORM' to be passed to the TF-M build system. Look at 'config_default.cmake' @@ -61,8 +66,8 @@ config TFM_PARTITION_PLATFORM repository. config TFM_PARTITION_AUDIT_LOG - bool "Secure partition 'Audit Log'" if !TFM_IPC - depends on !TFM_IPC + bool "Secure partition 'Audit Log'" + depends on TFM_LIBRARY default y help Setting this option will cause '-DTFM_PARTITION_AUDIT_LOG' From a3c7869f348491ecd25fae687a8d4e4a5928302f Mon Sep 17 00:00:00 2001 From: Maciej Perkowski Date: Wed, 26 Oct 2022 12:22:13 +0200 Subject: [PATCH 431/501] [nrf noup] ci: clang: Use ubuntu-latest instead of zephyr_runner squash! [nrf noup] ci: clang: parallel execution zephyr_runner is upstream's proprietary agent inaccessible outside of upstream's CI. Use ubuntu-latest instead. Signed-off-by: Maciej Perkowski --- .github/workflows/clang.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 6cf18f8e193..925ec771219 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -11,7 +11,7 @@ jobs: with: access_token: ${{ github.token }} clang-build: - runs-on: zephyr_runner + runs-on: ubuntu-latest needs: clang-build-prep container: image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 From c8787bd14c99f2dcbdd26a9786e01ad6c8311c63 Mon Sep 17 00:00:00 2001 From: Maciej Perkowski Date: Wed, 26 Oct 2022 13:28:29 +0200 Subject: [PATCH 432/501] [nrf noup] ci: clang: Remove incorrect zephyr path squash! [nrf noup] ci: clang: parallel execution The fix for zephyr path is no longer needed after 37160d6e3bd733e42b403aeb8016def5806b6458 was reverted and is causing failures. Signed-off-by: Maciej Perkowski --- .github/workflows/clang.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 925ec771219..297678dcdb3 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -100,7 +100,6 @@ jobs: ccache -M 10G -s - name: Build test plan with Twister - working-directory: ./zephyr id: twister_test_plan run: | export ZEPHYR_BASE=${PWD} From f1d8f9e57c724b711c92f1ab1d9f2940f61e0de7 Mon Sep 17 00:00:00 2001 From: Piotr Golyzniak Date: Mon, 10 Oct 2022 16:14:35 +0200 Subject: [PATCH 433/501] [nrf noup] scripts: update quarantine squash! [nrf noup] scripts: add quarantine file Signed-off-by: Piotr Golyzniak --- scripts/quarantine.yaml | 128 +--------------------------------------- 1 file changed, 1 insertion(+), 127 deletions(-) diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml index feaef842fbc..8410aa0bd26 100644 --- a/scripts/quarantine.yaml +++ b/scripts/quarantine.yaml @@ -2,51 +2,6 @@ # will be skipped if quarantine is used. More details here: # https://docs.zephyrproject.org/latest/guides/test/twister.html#quarantine -- scenarios: - - drivers.modem.build - platforms: - - nrf52dk_nrf52832 - -- scenarios: - - sample.tfm.secure_partition - - sample.tfm.secure_partition.ipc - - drivers.hwinfo.api - platforms: - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp_ns - comment: "https://projecttools.nordicsemi.no/jira/browse/NCSDK-7558" - -- scenarios: - - libraries.libc.newlib.thread_safety.userspace.stress - - libraries.libc.newlib_nano.thread_safety.userspace.stress - platforms: - - nrf52dk_nrf52832 - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52833dk_nrf52833 - comment: "Might be related: https://github.com/zephyrproject-rtos/zephyr/issues/38044" - -- scenarios: - - sample.psa_crypto - - sample.tfm.protected_storage - - sample.tfm_ipc - - sample.tfm.psa_internal_trusted_storage_test - - sample.tfm.psa_protected_storage_test - - sample.tfm.tfm_regression - - arch.arm.swap.tz - - arch.arm.swap.tz_off - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Upstream issue (imgtool version related): https://github.com/zephyrproject-rtos/zephyr/issues/40254" - -- scenarios: - - sample.drivers.crypto.mbedtls - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "MBEDTLS_BUILTIN not supported for TF-M builds" - - scenarios: - testing.ztest.busy_sim - testing.ztest.busy_sim_nrf52840dk_pin @@ -57,10 +12,9 @@ # https://github.com/zephyrproject-rtos/zephyr/issues/44947 - scenarios: - libraries.cmsis_dsp.matrix.unary_f64 - - libraries.libc.newlib.thread_safety.userspace.stress - - libraries.libc.newlib_nano.thread_safety.userspace.stress platforms: - nrf5340dk_nrf5340_cpunet + - qemu_cortex_m3 comment: "Flash overflows" # Already reported, but will not be fixed (look at the discussion): @@ -86,33 +40,6 @@ - nrf9160dk_nrf9160_ns comment: "Flash overflows" -# Already fixed in Upstream by this commit: -# https://github.com/zephyrproject-rtos/zephyr/commit/20ff55e234cccea801717723146aa94458348586 -# should be introduced with upmerge Zephyr to version 3.1.0 (or later) -- scenarios: - - sample.bluetooth.central.multilink - - sample.bluetooth.peripheral_identity - platforms: - - qemu_cortex_m3 - comment: "Flash overflows. Already fixed in Upstream Zephyr." - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.unary_f64 - platforms: - - qemu_cortex_m3 - comment: "Flash overflows" - -# Already reported in this issue: -# https://github.com/zephyrproject-rtos/zephyr/issues/44948 -- scenarios: - - libraries.cmsis_dsp.transform.cf64.fpu - - libraries.cmsis_dsp.transform.rf64.fpu - platforms: - - mps2_an521_remote - comment: "Flash overflows" - # libsdl2-dev package should be added into docker image - scenarios: - sample.boards.nrf.nrf_led_matrix @@ -121,59 +48,6 @@ - native_posix comment: "libsdl2-dev package not available" -# g++-multilib package should be added into docker image, already reported here: -# https://ci-help.nordicsemi.no/#ticket/zoom/1713 -- scenarios: - - cpp.main - - cpp.main.minimal - - sample.modules.chre - - libraries.cbprintf_package_cpp - - libraries.cbprintf_package_fp_align_offset_cpp - - libraries.cbprintf_package_fp_cpp - - libraries.cbprintf_package_long_double_align_offset_cpp - - libraries.cbprintf_package_long_double_cpp - - libraries.cbprintf_package_nano_cpp - - libraries.cbprintf_package_no_generic_cpp - - logging.log_api_deferred_64b_timestamp_cpp - - logging.log_api_deferred_64b_timestamp_cpp.tagged_args - - logging.log_api_deferred_func_prefix_cpp - - logging.log_api_deferred_func_prefix_cpp.tagged_args - - logging.log_api_deferred_no_overflow_cpp - - logging.log_api_deferred_no_overflow_cpp.tagged_args - - logging.log_api_deferred_overflow_cpp - - logging.log_api_deferred_overflow_cpp.tagged_args - - logging.log_api_deferred_overflow_rt_filter_cpp - - logging.log_api_deferred_overflow_rt_filter_cpp.tagged_args - - logging.log_api_deferred_printk_cpp - - logging.log_api_deferred_printk_cpp.tagged_args - - logging.log_api_deferred_static_filter_cpp - - logging.log_api_deferred_static_filter_cpp.tagged_args - - logging.log_api_frontend_cpp - - logging.log_api_frontend_dbg_cpp - - logging.log_api_frontend_immediate_cpp - - logging.log_api_frontend_no_backends_cpp - - logging.log_api_frontend_only_cpp - - logging.log_api_immediate_64b_timestamp_cpp - - logging.log_api_immediate_64b_timestamp_cpp.tagged_args - - logging.log_api_immediate_cpp - - logging.log_api_immediate_cpp.tagged_args - - logging.log_api_immediate_printk_cpp - - logging.log_api_immediate_printk_cpp.tagged_args - - logging.log_api_immediate_rt_filter_cpp - - logging.log_api_immediate_rt_filter_cpp.tagged_args - - logging.log_api_immediate_static_filter_cpp - - logging.log_api_immediate_static_filter_cpp.tagged_args - - testing.fail.zephyr.assert_after - - testing.fail.zephyr.assert_teardown - - testing.fail.zephyr.assume_after - - testing.fail.zephyr.assume_teardown - - testing.fail.zephyr.pass_after - - testing.fail.zephyr.pass_teardown - - testing.ztest.base.cpp - platforms: - - native_posix - comment: "g++-multilib package not available" - - scenarios: - sample.net.zperf.netusb_ecm - sample.net.zperf.netusb_eem From 554f66b4f86bbadd36c87f64973fac61c80e66e0 Mon Sep 17 00:00:00 2001 From: Tommi Kangas Date: Mon, 24 Oct 2022 13:40:42 +0300 Subject: [PATCH 434/501] [nrf fromtree] net: lwm2m: use zsock_ functions Use Zephyr internal zsock_ calls to remove dependency to NET_SOCKETS_POSIX_NAMES. Signed-off-by: Tommi Kangas (cherry picked from commit c3ad5efa193c3f3f1c62166fa5049ace975d18d6) --- subsys/net/lib/lwm2m/Kconfig | 1 - subsys/net/lib/lwm2m/lwm2m_engine.c | 48 ++++++++++--------- subsys/net/lib/lwm2m/lwm2m_message_handling.c | 8 ++-- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/subsys/net/lib/lwm2m/Kconfig b/subsys/net/lib/lwm2m/Kconfig index 6cd008470b1..e76a715ca38 100644 --- a/subsys/net/lib/lwm2m/Kconfig +++ b/subsys/net/lib/lwm2m/Kconfig @@ -6,7 +6,6 @@ menuconfig LWM2M select COAP select HTTP_PARSER_URL select NET_SOCKETS - select NET_SOCKETS_POSIX_NAMES help This option adds logic for managing OMA LWM2M data diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index 554750dd67f..b333c4bdcc3 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -100,7 +100,7 @@ static struct k_thread engine_thread_data; #define MAX_POLL_FD CONFIG_NET_SOCKETS_POLL_MAX /* Resources */ -static struct pollfd sock_fds[MAX_POLL_FD]; +static struct zsock_pollfd sock_fds[MAX_POLL_FD]; static struct lwm2m_ctx *sock_ctx[MAX_POLL_FD]; static int sock_nfds; @@ -173,11 +173,12 @@ int lwm2m_open_socket(struct lwm2m_ctx *client_ctx) /* open socket */ if (IS_ENABLED(CONFIG_LWM2M_DTLS_SUPPORT) && client_ctx->use_dtls) { - client_ctx->sock_fd = socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, - IPPROTO_DTLS_1_2); + client_ctx->sock_fd = zsock_socket(client_ctx->remote_addr.sa_family, + SOCK_DGRAM, IPPROTO_DTLS_1_2); } else { client_ctx->sock_fd = - socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, IPPROTO_UDP); + zsock_socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, + IPPROTO_UDP); } if (client_ctx->sock_fd < 0) { @@ -198,7 +199,7 @@ int lwm2m_close_socket(struct lwm2m_ctx *client_ctx) int ret = 0; if (client_ctx->sock_fd >= 0) { - ret = close(client_ctx->sock_fd); + ret = zsock_close(client_ctx->sock_fd); if (ret) { LOG_ERR("Failed to close socket: %d", errno); ret = -errno; @@ -527,7 +528,7 @@ int lwm2m_socket_add(struct lwm2m_ctx *ctx) sock_ctx[sock_nfds] = ctx; sock_fds[sock_nfds].fd = ctx->sock_fd; - sock_fds[sock_nfds].events = POLLIN; + sock_fds[sock_nfds].events = ZSOCK_POLLIN; sock_nfds++; return 0; @@ -608,8 +609,8 @@ static int socket_recv_message(struct lwm2m_ctx *client_ctx) static struct sockaddr from_addr; from_addr_len = sizeof(from_addr); - len = recvfrom(client_ctx->sock_fd, in_buf, sizeof(in_buf) - 1, 0, &from_addr, - &from_addr_len); + len = zsock_recvfrom(client_ctx->sock_fd, in_buf, sizeof(in_buf) - 1, 0, &from_addr, + &from_addr_len); if (len < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) { @@ -650,7 +651,8 @@ static void socket_reset_pollfd_events(void) { for (int i = 0; i < sock_nfds; ++i) { sock_fds[i].events = - POLLIN | (sys_slist_is_empty(&sock_ctx[i]->pending_sends) ? 0 : POLLOUT); + ZSOCK_POLLIN | + (sys_slist_is_empty(&sock_ctx[i]->pending_sends) ? 0 : ZSOCK_POLLOUT); sock_fds[i].revents = 0; } } @@ -705,7 +707,7 @@ static void socket_loop(void) * FIXME: Currently we timeout and restart poll in case fds * were modified. */ - rc = poll(sock_fds, sock_nfds, timeout); + rc = zsock_poll(sock_fds, sock_nfds, timeout); if (rc < 0) { LOG_ERR("Error in poll:%d", errno); errno = 0; @@ -719,8 +721,9 @@ static void socket_loop(void) continue; } - if ((sock_fds[i].revents & POLLERR) || (sock_fds[i].revents & POLLNVAL) || - (sock_fds[i].revents & POLLHUP)) { + if ((sock_fds[i].revents & ZSOCK_POLLERR) || + (sock_fds[i].revents & ZSOCK_POLLNVAL) || + (sock_fds[i].revents & ZSOCK_POLLHUP)) { LOG_ERR("Poll reported a socket error, %02x.", sock_fds[i].revents); if (sock_ctx[i] != NULL && sock_ctx[i]->fault_cb != NULL) { sock_ctx[i]->fault_cb(EIO); @@ -728,7 +731,7 @@ static void socket_loop(void) continue; } - if (sock_fds[i].revents & POLLIN) { + if (sock_fds[i].revents & ZSOCK_POLLIN) { while (sock_ctx[i]) { rc = socket_recv_message(sock_ctx[i]); if (rc) { @@ -737,7 +740,7 @@ static void socket_loop(void) } } - if (sock_fds[i].revents & POLLOUT) { + if (sock_fds[i].revents & ZSOCK_POLLOUT) { socket_send_message(sock_ctx[i]); } } @@ -823,8 +826,8 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) client_ctx->tls_tag, }; - ret = setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_SEC_TAG_LIST, tls_tag_list, - sizeof(tls_tag_list)); + ret = zsock_setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_SEC_TAG_LIST, tls_tag_list, + sizeof(tls_tag_list)); if (ret < 0) { ret = -errno; LOG_ERR("Failed to set TLS_SEC_TAG_LIST option: %d", ret); @@ -834,8 +837,8 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) if (IS_ENABLED(CONFIG_LWM2M_TLS_SESSION_CACHING)) { int session_cache = TLS_SESSION_CACHE_ENABLED; - ret = setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_SESSION_CACHE, - &session_cache, sizeof(session_cache)); + ret = zsock_setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_SESSION_CACHE, + &session_cache, sizeof(session_cache)); if (ret < 0) { ret = -errno; LOG_ERR("Failed to set TLS_SESSION_CACHE option: %d", errno); @@ -851,8 +854,9 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) client_ctx->desthostname[client_ctx->desthostnamelen] = '\0'; /** mbedtls ignores length */ - ret = setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_HOSTNAME, - client_ctx->desthostname, client_ctx->desthostnamelen); + ret = zsock_setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_HOSTNAME, + client_ctx->desthostname, + client_ctx->desthostnamelen); /** restore character */ client_ctx->desthostname[client_ctx->desthostnamelen] = tmp; @@ -873,7 +877,7 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) return -EPROTONOSUPPORT; } - if (connect(client_ctx->sock_fd, &client_ctx->remote_addr, addr_len) < 0) { + if (zsock_connect(client_ctx->sock_fd, &client_ctx->remote_addr, addr_len) < 0) { ret = -errno; LOG_ERR("Cannot connect UDP (%d)", ret); goto error; @@ -906,7 +910,7 @@ int lwm2m_socket_close(struct lwm2m_ctx *client_ctx) lwm2m_socket_del(client_ctx); client_ctx->sock_fd = -1; if (sock_fd >= 0) { - return close(sock_fd); + return zsock_close(sock_fd); } return 0; diff --git a/subsys/net/lib/lwm2m/lwm2m_message_handling.c b/subsys/net/lib/lwm2m/lwm2m_message_handling.c index a18d0b4262f..7ef9f2a6d54 100644 --- a/subsys/net/lib/lwm2m/lwm2m_message_handling.c +++ b/subsys/net/lib/lwm2m/lwm2m_message_handling.c @@ -447,7 +447,7 @@ int lwm2m_send_message(struct lwm2m_message *msg) coap_pending_cycle(msg->pending); } - rc = send(msg->ctx->sock_fd, msg->cpkt.data, msg->cpkt.offset, 0); + rc = zsock_send(msg->ctx->sock_fd, msg->cpkt.data, msg->cpkt.offset, 0); if (rc < 0) { LOG_ERR("Failed to send packet, err %d", errno); @@ -2568,7 +2568,7 @@ int lwm2m_parse_peerinfo(char *url, struct lwm2m_ctx *client_ctx, bool is_firmwa { struct http_parser_url parser; #if defined(CONFIG_LWM2M_DNS_SUPPORT) - struct addrinfo *res, hints = {0}; + struct zsock_addrinfo *res, hints = {0}; #endif int ret; uint16_t off, len; @@ -2653,7 +2653,7 @@ int lwm2m_parse_peerinfo(char *url, struct lwm2m_ctx *client_ctx, bool is_firmwa hints.ai_family = AF_UNSPEC; #endif /* defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV4) */ hints.ai_socktype = SOCK_DGRAM; - ret = getaddrinfo(url + off, NULL, &hints, &res); + ret = zsock_getaddrinfo(url + off, NULL, &hints, &res); if (ret != 0) { LOG_ERR("Unable to resolve address"); /* DNS error codes don't align with normal errors */ @@ -2663,7 +2663,7 @@ int lwm2m_parse_peerinfo(char *url, struct lwm2m_ctx *client_ctx, bool is_firmwa memcpy(&client_ctx->remote_addr, res->ai_addr, sizeof(client_ctx->remote_addr)); client_ctx->remote_addr.sa_family = res->ai_family; - freeaddrinfo(res); + zsock_freeaddrinfo(res); #else goto cleanup; #endif /* CONFIG_LWM2M_DNS_SUPPORT */ From 3a27f80f6bed48c5a742f29aafd6c17cf2b18e81 Mon Sep 17 00:00:00 2001 From: Sjors Hettinga Date: Wed, 19 Oct 2022 13:34:14 +0200 Subject: [PATCH 435/501] [nrf fromtree] net: ip: Speed up the IP/UDP/TCP checksum calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of doing a 1-complement addition for every 16-bit word, process 32-bit words and handle the 1-complement addition at the end. This work is a colaboration with Diego Pino García. The algorithm is inspired by: https://blogs.igalia.com/dpino/2018/06/14/fast-checksum-computation/ Signed-off-by: Sjors Hettinga --- subsys/net/ip/net_private.h | 1 + subsys/net/ip/utils.c | 106 ++++++++++++++++++++++++++++++------ 2 files changed, 89 insertions(+), 18 deletions(-) diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index affb1575f5b..30d3a94dc48 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -143,6 +143,7 @@ extern const char *net_proto2str(int family, int proto); extern char *net_byte_to_hex(char *ptr, uint8_t byte, char base, bool pad); extern char *net_sprint_ll_addr_buf(const uint8_t *ll, uint8_t ll_len, char *buf, int buflen); +extern uint16_t calc_chksum(uint16_t sum_in, const uint8_t *data, size_t len); extern uint16_t net_calc_chksum(struct net_pkt *pkt, uint8_t proto); /** diff --git a/subsys/net/ip/utils.c b/subsys/net/ip/utils.c index dbff0964052..40e6e019f22 100644 --- a/subsys/net/ip/utils.c +++ b/subsys/net/ip/utils.c @@ -20,6 +20,7 @@ LOG_MODULE_REGISTER(net_utils, CONFIG_NET_UTILS_LOG_LEVEL); #include #include +#include #include #include #include @@ -486,32 +487,101 @@ int z_vrfy_net_addr_pton(sa_family_t family, const char *src, #include #endif /* CONFIG_USERSPACE */ -static uint16_t calc_chksum(uint16_t sum, const uint8_t *data, size_t len) + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define CHECKSUM_BIG_ENDIAN 0 +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define CHECKSUM_BIG_ENDIAN 1 +#else +#error "Unknown byte order" +#endif + +static uint16_t offset_based_swap8(const uint8_t *data) { - const uint8_t *end; - uint16_t tmp; + uint16_t data16 = (uint16_t)*data; - end = data + len - 1; + if (((uintptr_t)(data) & 1) == CHECKSUM_BIG_ENDIAN) { + return data16; + } else { + return data16 << 8; + } +} - while (data < end) { - tmp = (data[0] << 8) + data[1]; - sum += tmp; - if (sum < tmp) { - sum++; - } +/* Word based checksum calculation based on: + * https://blogs.igalia.com/dpino/2018/06/14/fast-checksum-computation/ + * It’s not necessary to add octets as 16-bit words. Due to the associative property of addition, + * it is possible to do parallel addition using larger word sizes such as 32-bit or 64-bit words. + * In those cases the variable that stores the accumulative sum has to be bigger too. + * Once the sum is computed a final step folds the sum to a 16-bit word (adding carry if any). + */ +uint16_t calc_chksum(uint16_t sum_in, const uint8_t *data, size_t len) +{ + uint64_t sum; + uint32_t *p; + size_t i = 0; + size_t pending = len; + int odd_start = ((uintptr_t)data & 0x01); + + /* Sum in is in host endiannes, working order endiannes is both dependent on endianness + * and the offset of starting + */ + if (odd_start == CHECKSUM_BIG_ENDIAN) { + sum = __bswap_16(sum_in); + } else { + sum = sum_in; + } - data += 2; + /* Process up to 3 data elements up front, so the data is aligned further down the line */ + if ((((uintptr_t)data & 0x01) != 0) && (pending >= 1)) { + sum += offset_based_swap8(data); + data++; + pending--; } + if ((((uintptr_t)data & 0x02) != 0) && (pending >= sizeof(uint16_t))) { + pending -= sizeof(uint16_t); + sum = sum + *((uint16_t *)data); + data += sizeof(uint16_t); + } + p = (uint32_t *)data; - if (data == end) { - tmp = data[0] << 8; - sum += tmp; - if (sum < tmp) { - sum++; - } + /* Do loop unrolling for the very large data sets */ + while (pending >= sizeof(uint32_t) * 4) { + uint64_t sum_a = p[i]; + uint64_t sum_b = p[i + 1]; + + pending -= sizeof(uint32_t) * 4; + sum_a += p[i + 2]; + sum_b += p[i + 3]; + i += 4; + sum += sum_a + sum_b; + } + while (pending >= sizeof(uint32_t)) { + pending -= sizeof(uint32_t); + sum = sum + p[i++]; + } + data = (uint8_t *)(p + i); + if (pending >= 2) { + pending -= sizeof(uint16_t); + sum = sum + *((uint16_t *)data); + data += sizeof(uint16_t); + } + if (pending == 1) { + sum += offset_based_swap8(data); } - return sum; + /* Fold sum into 16-bit word. */ + while (sum >> 16) { + sum = (sum & 0xffff) + (sum >> 16); + } + + /* Sum in is in host endiannes, working order endiannes is both dependent on endianness + * and the offset of starting + */ + if (odd_start == CHECKSUM_BIG_ENDIAN) { + return __bswap_16((uint16_t)sum); + } else { + return sum; + } } static inline uint16_t pkt_calc_chksum(struct net_pkt *pkt, uint16_t sum) From 5dd2862f8bbd812f7148c486ccfe9b934ceba69d Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 13 Sep 2022 16:32:00 +0200 Subject: [PATCH 436/501] [nrf fromtree] net: pkt: Add IP DSCP/ECN information to a packet structure Add new fields to the net_pkt structure, representing IP-specific Differentiated services code point (DSCP) and Explicit Congestion Notification (ECN) values. Those values are encoded in legacy Type of Service (IPv4) and Trafic Class (IPv6) header fields. Signed-off-by: Robert Lubos (cherry picked from commit c5096f4ca1e5cee4ef5ba67ac308e20c85a49257) --- include/zephyr/net/net_pkt.h | 40 ++++++++++++++++++++++++++++++++++++ subsys/net/ip/Kconfig | 8 ++++++++ subsys/net/ip/net_pkt.c | 2 ++ 3 files changed, 50 insertions(+) diff --git a/include/zephyr/net/net_pkt.h b/include/zephyr/net/net_pkt.h index d7d6dd70cdb..347e99900c3 100644 --- a/include/zephyr/net/net_pkt.h +++ b/include/zephyr/net/net_pkt.h @@ -252,6 +252,14 @@ struct net_pkt { uint8_t ipv6_next_hdr; /* What is the very first next header */ #endif /* CONFIG_NET_IPV6 */ +#if defined(CONFIG_NET_IP_DSCP_ECN) + /** IPv4/IPv6 Differentiated Services Code Point value. */ + uint8_t ip_dscp : 6; + + /** IPv4/IPv6 Explicit Congestion Notification value. */ + uint8_t ip_ecn : 2; +#endif /* CONFIG_NET_IP_DSCP_ECN */ + #if defined(CONFIG_IEEE802154) #if defined(CONFIG_IEEE802154_2015) uint32_t ieee802154_ack_fc; /* Frame counter set in the ACK */ @@ -410,6 +418,38 @@ static inline void net_pkt_set_ip_hdr_len(struct net_pkt *pkt, uint8_t len) #endif } +static inline uint8_t net_pkt_ip_dscp(struct net_pkt *pkt) +{ +#if defined(CONFIG_NET_IP_DSCP_ECN) + return pkt->ip_dscp; +#else + return 0; +#endif +} + +static inline void net_pkt_set_ip_dscp(struct net_pkt *pkt, uint8_t dscp) +{ +#if defined(CONFIG_NET_IP_DSCP_ECN) + pkt->ip_dscp = dscp; +#endif +} + +static inline uint8_t net_pkt_ip_ecn(struct net_pkt *pkt) +{ +#if defined(CONFIG_NET_IP_DSCP_ECN) + return pkt->ip_ecn; +#else + return 0; +#endif +} + +static inline void net_pkt_set_ip_ecn(struct net_pkt *pkt, uint8_t ecn) +{ +#if defined(CONFIG_NET_IP_DSCP_ECN) + pkt->ip_ecn = ecn; +#endif +} + static inline uint8_t net_pkt_sent(struct net_pkt *pkt) { return pkt->sent_or_eof; diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index 596011687f2..44332ca62fa 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -122,6 +122,14 @@ config NET_INIT_PRIO Network initialization priority level. This number tells how early in the boot the network stack is initialized. +config NET_IP_DSCP_ECN + bool "DSCP/ECN processing at IP layer" + depends on NET_IP + default y + help + Specify whether DSCP/ECN values are processed at IP layer. The values + are encoded within ToS field in IPv4 and TC field in IPv6. + source "subsys/net/ip/Kconfig.ipv6" source "subsys/net/ip/Kconfig.ipv4" diff --git a/subsys/net/ip/net_pkt.c b/subsys/net/ip/net_pkt.c index f3298466177..28d3bf9aded 100644 --- a/subsys/net/ip/net_pkt.c +++ b/subsys/net/ip/net_pkt.c @@ -1768,6 +1768,8 @@ static void clone_pkt_attributes(struct net_pkt *pkt, struct net_pkt *clone_pkt) net_pkt_set_family(clone_pkt, net_pkt_family(pkt)); net_pkt_set_context(clone_pkt, net_pkt_context(pkt)); net_pkt_set_ip_hdr_len(clone_pkt, net_pkt_ip_hdr_len(pkt)); + net_pkt_set_ip_dscp(clone_pkt, net_pkt_ip_dscp(pkt)); + net_pkt_set_ip_ecn(clone_pkt, net_pkt_ip_ecn(pkt)); net_pkt_set_vlan_tag(clone_pkt, net_pkt_vlan_tag(pkt)); net_pkt_set_timestamp(clone_pkt, net_pkt_timestamp(pkt)); net_pkt_set_priority(clone_pkt, net_pkt_priority(pkt)); From b6f4d56fcf067546caae4fb60ed1e36e368bf412 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 19 Sep 2022 14:22:41 +0200 Subject: [PATCH 437/501] [nrf fromtree] net: ipv4: Add support for setting/reading DSCP/ECN fields (ToS) Encode/decode recently added DSCP/ECN values into/from IPv4 header. Signed-off-by: Robert Lubos (cherry picked from commit 5c10f6f9d6f51a7990530556b0126e23ac104eea) --- subsys/net/ip/ipv4.c | 14 +++++++++++- subsys/net/ip/ipv4.h | 51 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/subsys/net/ip/ipv4.c b/subsys/net/ip/ipv4.c index e7c9062fbea..e0539d23e36 100644 --- a/subsys/net/ip/ipv4.c +++ b/subsys/net/ip/ipv4.c @@ -75,7 +75,14 @@ int net_ipv4_create(struct net_pkt *pkt, const struct in_addr *src, const struct in_addr *dst) { - return net_ipv4_create_full(pkt, src, dst, 0U, 0U, 0U, 0U, + uint8_t tos = 0; + + if (IS_ENABLED(CONFIG_NET_IP_DSCP_ECN)) { + net_ipv4_set_dscp(&tos, net_pkt_ip_dscp(pkt)); + net_ipv4_set_ecn(&tos, net_pkt_ip_ecn(pkt)); + } + + return net_ipv4_create_full(pkt, src, dst, tos, 0U, 0U, 0U, net_pkt_ipv4_ttl(pkt)); } @@ -248,6 +255,11 @@ enum net_verdict net_ipv4_input(struct net_pkt *pkt) net_pkt_set_ip_hdr_len(pkt, sizeof(struct net_ipv4_hdr)); + if (IS_ENABLED(CONFIG_NET_IP_DSCP_ECN)) { + net_pkt_set_ip_dscp(pkt, net_ipv4_get_dscp(hdr->tos)); + net_pkt_set_ip_ecn(pkt, net_ipv4_get_ecn(hdr->tos)); + } + opts_len = hdr_len - sizeof(struct net_ipv4_hdr); if (opts_len > NET_IPV4_HDR_OPTNS_MAX_LEN) { return -EINVAL; diff --git a/subsys/net/ip/ipv4.h b/subsys/net/ip/ipv4.h index e53ffab4df8..f9b28158a73 100644 --- a/subsys/net/ip/ipv4.h +++ b/subsys/net/ip/ipv4.h @@ -21,6 +21,9 @@ #include #define NET_IPV4_IHL_MASK 0x0F +#define NET_IPV4_DSCP_MASK 0xFC +#define NET_IPV4_DSCP_OFFSET 2 +#define NET_IPV4_ECN_MASK 0x03 /* IPv4 Options */ #define NET_IPV4_OPTS_EO 0 /* End of Options */ @@ -204,4 +207,52 @@ static inline int net_ipv4_parse_hdr_options(struct net_pkt *pkt, } #endif +/** + * @brief Decode DSCP value from ToS field. + * + * @param tos ToS field value from the IPv4 header. + * + * @return Decoded DSCP value. + */ +static inline uint8_t net_ipv4_get_dscp(uint8_t tos) +{ + return (tos & NET_IPV4_DSCP_MASK) >> NET_IPV4_DSCP_OFFSET; +} + +/** + * @brief Encode DSCP value into ToS field. + * + * @param tos A pointer to the ToS field. + * @param dscp DSCP value to set. + */ +static inline void net_ipv4_set_dscp(uint8_t *tos, uint8_t dscp) +{ + *tos &= ~NET_IPV4_DSCP_MASK; + *tos |= (dscp << NET_IPV4_DSCP_OFFSET) & NET_IPV4_DSCP_MASK; +} + +/** + * @brief Decode ECN value from ToS field. + * + * @param tos ToS field value from the IPv4 header. + * + * @return Decoded ECN value. + */ +static inline uint8_t net_ipv4_get_ecn(uint8_t tos) +{ + return tos & NET_IPV4_ECN_MASK; +} + +/** + * @brief Encode ECN value into ToS field. + * + * @param tos A pointer to the ToS field. + * @param ecn ECN value to set. + */ +static inline void net_ipv4_set_ecn(uint8_t *tos, uint8_t ecn) +{ + *tos &= ~NET_IPV4_ECN_MASK; + *tos |= ecn & NET_IPV4_ECN_MASK; +} + #endif /* __IPV4_H */ From 50250d901511b654b5e5b17d2e98c3f375fe59ca Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 19 Sep 2022 15:18:00 +0200 Subject: [PATCH 438/501] [nrf fromtree] net: ipv6: Add support for setting/reading DSCP/ECN fields (TC) Encode/decode recently added DSCP/ECN fields into/from IPv6 header. Signed-off-by: Robert Lubos (cherry picked from commit c7af28b9af06d0d8e8fb4524abcc732434600062) --- subsys/net/ip/ipv6.c | 19 ++++++++++++++-- subsys/net/ip/ipv6.h | 53 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/subsys/net/ip/ipv6.c b/subsys/net/ip/ipv6.c index 1d6857961a2..48165099759 100644 --- a/subsys/net/ip/ipv6.c +++ b/subsys/net/ip/ipv6.c @@ -56,14 +56,20 @@ int net_ipv6_create(struct net_pkt *pkt, { NET_PKT_DATA_ACCESS_CONTIGUOUS_DEFINE(ipv6_access, struct net_ipv6_hdr); struct net_ipv6_hdr *ipv6_hdr; + uint8_t tc = 0; ipv6_hdr = (struct net_ipv6_hdr *)net_pkt_get_data(pkt, &ipv6_access); if (!ipv6_hdr) { return -ENOBUFS; } - ipv6_hdr->vtc = 0x60; - ipv6_hdr->tcflow = 0U; + if (IS_ENABLED(CONFIG_NET_IP_DSCP_ECN)) { + net_ipv6_set_dscp(&tc, net_pkt_ip_dscp(pkt)); + net_ipv6_set_ecn(&tc, net_pkt_ip_ecn(pkt)); + } + + ipv6_hdr->vtc = 0x60 | ((tc >> 4) & 0x0F); + ipv6_hdr->tcflow = (tc << 4) & 0xF0; ipv6_hdr->flow = 0U; ipv6_hdr->len = 0U; ipv6_hdr->nexthdr = 0U; @@ -498,6 +504,15 @@ enum net_verdict net_ipv6_input(struct net_pkt *pkt, bool is_loopback) } } + /* Reconstruct TC field. */ + + if (IS_ENABLED(CONFIG_NET_IP_DSCP_ECN)) { + uint8_t tc = ((hdr->vtc << 4) & 0xF0) | ((hdr->tcflow >> 4) & 0x0F); + + net_pkt_set_ip_dscp(pkt, net_ipv6_get_dscp(tc)); + net_pkt_set_ip_ecn(pkt, net_ipv6_get_ecn(tc)); + } + /* Check extension headers */ net_pkt_set_ipv6_next_hdr(pkt, hdr->nexthdr); net_pkt_set_ipv6_ext_len(pkt, 0); diff --git a/subsys/net/ip/ipv6.h b/subsys/net/ip/ipv6.h index 0441bb7d83d..80543084744 100644 --- a/subsys/net/ip/ipv6.h +++ b/subsys/net/ip/ipv6.h @@ -30,6 +30,10 @@ #define NET_MAX_RS_COUNT 3 +#define NET_IPV6_DSCP_MASK 0xFC +#define NET_IPV6_DSCP_OFFSET 2 +#define NET_IPV6_ECN_MASK 0x03 + /** * @brief Bitmaps for IPv6 extension header processing * @@ -495,4 +499,53 @@ void net_ipv6_mld_init(void); #define net_ipv6_nbr_init(...) #endif +/** + * @brief Decode DSCP value from TC field. + * + * @param tc TC field value from the IPv6 header. + * + * @return Decoded DSCP value. + */ +static inline uint8_t net_ipv6_get_dscp(uint8_t tc) +{ + return (tc & NET_IPV6_DSCP_MASK) >> NET_IPV6_DSCP_OFFSET; +} + +/** + * @brief Encode DSCP value into TC field. + * + * @param tc A pointer to the TC field. + * @param dscp DSCP value to set. + */ +static inline void net_ipv6_set_dscp(uint8_t *tc, uint8_t dscp) +{ + *tc &= ~NET_IPV6_DSCP_MASK; + *tc |= (dscp << NET_IPV6_DSCP_OFFSET) & NET_IPV6_DSCP_MASK; +} + +/** + * @brief Decode ECN value from TC field. + * + * @param tc TC field value from the IPv6 header. + * + * @return Decoded ECN value. + */ +static inline uint8_t net_ipv6_get_ecn(uint8_t tc) +{ + return tc & NET_IPV6_ECN_MASK; +} + +/** + * @brief Encode ECN value into TC field. + * + * @param tc A pointer to the TC field. + * @param ecn ECN value to set. + */ +static inline void net_ipv6_set_ecn(uint8_t *tc, uint8_t ecn) +{ + *tc &= ~NET_IPV6_ECN_MASK; + *tc |= ecn & NET_IPV6_ECN_MASK; +} + + #endif /* __IPV6_H */ From fade63d45218659ecbcf52766b69d714669b9b18 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 20 Sep 2022 16:23:43 +0200 Subject: [PATCH 439/501] [nrf fromtree] net: context: Add DSCP/ECN support Add a new net_context option, which allows to set DSCP/ECN values on a net context. Those values are then encoded into outgoing packet IPv4/IPv6 header. Signed-off-by: Robert Lubos (cherry picked from commit c868018c3cdeae562d94517ccaa0b29ce62cdd76) --- include/zephyr/net/net_context.h | 4 +++ subsys/net/ip/Kconfig | 9 ++++++ subsys/net/ip/net_context.c | 52 ++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/include/zephyr/net/net_context.h b/include/zephyr/net/net_context.h index 69a96fa0b2b..8c18475d37b 100644 --- a/include/zephyr/net/net_context.h +++ b/include/zephyr/net/net_context.h @@ -318,6 +318,9 @@ __net_socket struct net_context { #endif #if defined(CONFIG_NET_CONTEXT_SNDBUF) uint16_t sndbuf; +#endif +#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) + uint8_t dscp_ecn; #endif } options; @@ -1068,6 +1071,7 @@ enum net_context_option { NET_OPT_SNDTIMEO = 5, NET_OPT_RCVBUF = 6, NET_OPT_SNDBUF = 7, + NET_OPT_DSCP_ECN = 8, }; /** diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index 44332ca62fa..11aaae35433 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -636,6 +636,15 @@ config NET_CONTEXT_SNDBUF For TCP sockets, the sndbuf will determine the total size of queued data in the TCP layer. +config NET_CONTEXT_DSCP_ECN + bool "Add support for setting DSCP/ECN IP properties on net_context" + depends on NET_IP_DSCP_ECN + default y + help + Allow to set Differentiated Services and Explicit Congestion + Notification values on net_context. Those values are then used in + IPv4/IPv6 header when sending packets over net_context. + config NET_TEST bool "Network Testing" help diff --git a/subsys/net/ip/net_context.c b/subsys/net/ip/net_context.c index a952a932935..4139fa95c65 100644 --- a/subsys/net/ip/net_context.c +++ b/subsys/net/ip/net_context.c @@ -907,6 +907,10 @@ int net_context_create_ipv4_new(struct net_context *context, } net_pkt_set_ipv4_ttl(pkt, net_context_get_ipv4_ttl(context)); +#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) + net_pkt_set_ip_dscp(pkt, net_ipv4_get_dscp(context->options.dscp_ecn)); + net_pkt_set_ip_ecn(pkt, net_ipv4_get_ecn(context->options.dscp_ecn)); +#endif return net_ipv4_create(pkt, src, dst); } @@ -933,6 +937,10 @@ int net_context_create_ipv6_new(struct net_context *context, net_pkt_set_ipv6_hop_limit(pkt, net_context_get_ipv6_hop_limit(context)); +#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) + net_pkt_set_ip_dscp(pkt, net_ipv6_get_dscp(context->options.dscp_ecn)); + net_pkt_set_ip_ecn(pkt, net_ipv6_get_ecn(context->options.dscp_ecn)); +#endif return net_ipv6_create(pkt, src, dst); } @@ -1278,6 +1286,22 @@ static int get_context_sndbuf(struct net_context *context, #endif } +static int get_context_dscp_ecn(struct net_context *context, + void *value, size_t *len) +{ +#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) + *((int *)value) = context->options.dscp_ecn; + + if (len) { + *len = sizeof(int); + } + + return 0; +#else + return -ENOTSUP; +#endif +} + /* If buf is not NULL, then use it. Otherwise read the data to be written * to net_pkt from msghdr. */ @@ -2299,6 +2323,28 @@ static int set_context_sndbuf(struct net_context *context, #endif } +static int set_context_dscp_ecn(struct net_context *context, + const void *value, size_t len) +{ +#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) + int dscp_ecn = *((int *)value); + + if (len != sizeof(int)) { + return -EINVAL; + } + + if ((dscp_ecn < 0) || (dscp_ecn > UINT8_MAX)) { + return -EINVAL; + } + + context->options.dscp_ecn = (uint8_t)dscp_ecn; + + return 0; +#else + return -ENOTSUP; +#endif +} + int net_context_set_option(struct net_context *context, enum net_context_option option, const void *value, size_t len) @@ -2335,6 +2381,9 @@ int net_context_set_option(struct net_context *context, case NET_OPT_SNDBUF: ret = set_context_sndbuf(context, value, len); break; + case NET_OPT_DSCP_ECN: + ret = set_context_dscp_ecn(context, value, len); + break; } k_mutex_unlock(&context->lock); @@ -2378,6 +2427,9 @@ int net_context_get_option(struct net_context *context, case NET_OPT_SNDBUF: ret = get_context_sndbuf(context, value, len); break; + case NET_OPT_DSCP_ECN: + ret = get_context_dscp_ecn(context, value, len); + break; } k_mutex_unlock(&context->lock); From e0f29743e650268cca17c4e68c5d99d7856fabed Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 20 Sep 2022 17:26:46 +0200 Subject: [PATCH 440/501] [nrf fromtree] net: sockets: Add missing break statement in setsockopt SOL_SOCKET and IPPROTO_TCP levels were missing the break statement at the end of their processing logic, which could cause unexpected fallthrough on unhandled optname value. Signed-off-by: Robert Lubos (cherry picked from commit d28a72ed9e607a7aaf7b95b4b754518c17a69843) --- subsys/net/lib/sockets/sockets.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c index ab2e54be826..04182f4bf68 100644 --- a/subsys/net/lib/sockets/sockets.c +++ b/subsys/net/lib/sockets/sockets.c @@ -1874,12 +1874,17 @@ int zsock_getsockopt_ctx(struct net_context *ctx, int level, int optname, } break; } + + break; + case IPPROTO_TCP: switch (optname) { case TCP_NODELAY: ret = net_tcp_get_option(ctx, TCP_OPT_NODELAY, optval, optlen); return ret; } + + break; } errno = ENOPROTOOPT; From ab4f8f163e3ec12aabd5249275f0d4523c2c4774 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 20 Sep 2022 17:15:50 +0200 Subject: [PATCH 441/501] [nrf fromtree] net: sockets: Add options to control DSCP/ECN value Add new socket options IP_TOS and IPV6_TCLASS which allows to set DSCP/ECN values on a socket for an outgoing packet IPv4/IPv6 headers. The options are compatible with Linux behaviour, where both DSCP and ECN are set with a single socket option. Signed-off-by: Robert Lubos (cherry picked from commit 618fa8d665c0e791911b6d0bae989085a401bd21) --- include/zephyr/net/socket.h | 7 +++ subsys/net/lib/sockets/sockets.c | 80 ++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index 5ea9ac7977b..b4c311a2679 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -985,10 +985,17 @@ struct ifreq { /** sockopt: Disable TCP buffering (ignored, for compatibility) */ #define TCP_NODELAY 1 +/* Socket options for IPPROTO_IP level */ +/** sockopt: Set or receive the Type-Of-Service value for an outgoing packet. */ +#define IP_TOS 1 + /* Socket options for IPPROTO_IPV6 level */ /** sockopt: Don't support IPv4 access (ignored, for compatibility) */ #define IPV6_V6ONLY 26 +/** sockopt: Set or receive the traffic class value for an outgoing packet. */ +#define IPV6_TCLASS 67 + /** sockopt: Socket priority */ #define SO_PRIORITY 12 diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c index 04182f4bf68..2a87a5f54e2 100644 --- a/subsys/net/lib/sockets/sockets.c +++ b/subsys/net/lib/sockets/sockets.c @@ -1884,6 +1884,48 @@ int zsock_getsockopt_ctx(struct net_context *ctx, int level, int optname, return ret; } + break; + + case IPPROTO_IP: + switch (optname) { + case IP_TOS: + if (IS_ENABLED(CONFIG_NET_CONTEXT_DSCP_ECN)) { + ret = net_context_get_option(ctx, + NET_OPT_DSCP_ECN, + optval, + optlen); + if (ret < 0) { + errno = -ret; + return -1; + } + + return 0; + } + + break; + } + + break; + + case IPPROTO_IPV6: + switch (optname) { + case IPV6_TCLASS: + if (IS_ENABLED(CONFIG_NET_CONTEXT_DSCP_ECN)) { + ret = net_context_get_option(ctx, + NET_OPT_DSCP_ECN, + optval, + optlen); + if (ret < 0) { + errno = -ret; + return -1; + } + + return 0; + } + + break; + } + break; } @@ -2138,6 +2180,27 @@ int zsock_setsockopt_ctx(struct net_context *ctx, int level, int optname, } break; + case IPPROTO_IP: + switch (optname) { + case IP_TOS: + if (IS_ENABLED(CONFIG_NET_CONTEXT_DSCP_ECN)) { + ret = net_context_set_option(ctx, + NET_OPT_DSCP_ECN, + optval, + optlen); + if (ret < 0) { + errno = -ret; + return -1; + } + + return 0; + } + + break; + } + + break; + case IPPROTO_IPV6: switch (optname) { case IPV6_V6ONLY: @@ -2145,7 +2208,24 @@ int zsock_setsockopt_ctx(struct net_context *ctx, int level, int optname, * existing apps. */ return 0; + + case IPV6_TCLASS: + if (IS_ENABLED(CONFIG_NET_CONTEXT_DSCP_ECN)) { + ret = net_context_set_option(ctx, + NET_OPT_DSCP_ECN, + optval, + optlen); + if (ret < 0) { + errno = -ret; + return -1; + } + + return 0; + } + + break; } + break; } From 67c136bd1c4e22c15581eee2d3dccb4424ba5174 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Wed, 21 Sep 2022 12:50:40 +0200 Subject: [PATCH 442/501] [nrf fromtree] net: icmpv4: Allow to specify DSCP and ECN values in ping Add support for setting DSCP/ECN values for an outgoing ping request. Additionally, copy DSCP/ECN values from an incoming ping request into the ping response, like Linux does. Signed-off-by: Robert Lubos (cherry picked from commit 38aff5496163a1a669a15e2b8423e7861b69e0bb) --- subsys/net/ip/icmpv4.c | 7 +++++++ subsys/net/ip/icmpv4.h | 5 +++++ subsys/net/ip/net_shell.c | 1 + 3 files changed, 13 insertions(+) diff --git a/subsys/net/ip/icmpv4.c b/subsys/net/ip/icmpv4.c index 65b5de53937..23d101e7254 100644 --- a/subsys/net/ip/icmpv4.c +++ b/subsys/net/ip/icmpv4.c @@ -457,6 +457,9 @@ static enum net_verdict icmpv4_handle_echo_request(struct net_pkt *pkt, src = (struct in_addr *)ip_hdr->dst; } + net_pkt_set_ip_dscp(reply, net_pkt_ip_dscp(pkt)); + net_pkt_set_ip_ecn(reply, net_pkt_ip_ecn(pkt)); + if (net_ipv4_create(reply, src, (struct in_addr *)ip_hdr->src)) { goto drop; } @@ -503,6 +506,7 @@ int net_icmpv4_send_echo_request(struct net_if *iface, struct in_addr *dst, uint16_t identifier, uint16_t sequence, + uint8_t tos, const void *data, size_t data_size) { @@ -533,6 +537,9 @@ int net_icmpv4_send_echo_request(struct net_if *iface, return -ENOMEM; } + net_pkt_set_ip_dscp(pkt, net_ipv4_get_dscp(tos)); + net_pkt_set_ip_ecn(pkt, net_ipv4_get_ecn(tos)); + if (net_ipv4_create(pkt, src, dst) || icmpv4_create(pkt, NET_ICMPV4_ECHO_REQUEST, 0)) { goto drop; diff --git a/subsys/net/ip/icmpv4.h b/subsys/net/ip/icmpv4.h index adde2d369ba..9b861fbf014 100644 --- a/subsys/net/ip/icmpv4.h +++ b/subsys/net/ip/icmpv4.h @@ -62,6 +62,8 @@ int net_icmpv4_send_error(struct net_pkt *pkt, uint8_t type, uint8_t code); * to this Echo Request. May be zero. * @param sequence A sequence number to aid in matching Echo Replies * to this Echo Request. May be zero. + * @param tos IPv4 Type-of-service field value. Represents combined DSCP and ECN + * values. * @param data Arbitrary payload data that will be included in the * Echo Reply verbatim. May be zero. * @param data_size Size of the Payload Data in bytes. May be zero. @@ -73,6 +75,7 @@ int net_icmpv4_send_echo_request(struct net_if *iface, struct in_addr *dst, uint16_t identifier, uint16_t sequence, + uint8_t tos, const void *data, size_t data_size); #else @@ -80,6 +83,7 @@ static inline int net_icmpv4_send_echo_request(struct net_if *iface, struct in_addr *dst, uint16_t identifier, uint16_t sequence, + uint8_t tos, const void *data, size_t data_size) { @@ -87,6 +91,7 @@ static inline int net_icmpv4_send_echo_request(struct net_if *iface, ARG_UNUSED(dst); ARG_UNUSED(identifier); ARG_UNUSED(sequence); + ARG_UNUSED(tos); ARG_UNUSED(data); ARG_UNUSED(data_size); diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index 96e882381df..7b643181470 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -4066,6 +4066,7 @@ static int ping_ipv4(const struct shell *shell, &ipv4_target, sys_rand32_get(), i, + 0, &time_stamp, sizeof(time_stamp)); if (ret) { From 9703e452791303f33197bd3953e1de35edabd143 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Wed, 21 Sep 2022 12:55:44 +0200 Subject: [PATCH 443/501] [nrf fromtree] net: icmpv6: Allow to specify DSCP and ECN values in ping Add support for setting DSCP/ECN values for an outgoing ping request. Additionally, copy DSCP/ECN values from an incoming ping request into the ping response, like Linux does. Signed-off-by: Robert Lubos (cherry picked from commit 45ce04760519729d5434c4099c0adeb924bed35b) --- subsys/net/ip/icmpv6.c | 7 +++++++ subsys/net/ip/icmpv6.h | 5 +++++ subsys/net/ip/net_shell.c | 1 + subsys/net/lib/zperf/zperf_shell.c | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/subsys/net/ip/icmpv6.c b/subsys/net/ip/icmpv6.c index 6919edc1741..8b81f3f6c40 100644 --- a/subsys/net/ip/icmpv6.c +++ b/subsys/net/ip/icmpv6.c @@ -149,6 +149,9 @@ enum net_verdict icmpv6_handle_echo_request(struct net_pkt *pkt, net_pkt_lladdr_dst(reply)->addr = NULL; net_pkt_lladdr_src(reply)->addr = NULL; + net_pkt_set_ip_dscp(reply, net_pkt_ip_dscp(pkt)); + net_pkt_set_ip_ecn(reply, net_pkt_ip_ecn(pkt)); + if (net_ipv6_create(reply, src, (struct in6_addr *)ip_hdr->src)) { NET_DBG("DROP: wrong buffer"); goto drop; @@ -337,6 +340,7 @@ int net_icmpv6_send_echo_request(struct net_if *iface, struct in6_addr *dst, uint16_t identifier, uint16_t sequence, + uint8_t tc, const void *data, size_t data_size) { @@ -358,6 +362,9 @@ int net_icmpv6_send_echo_request(struct net_if *iface, return -ENOMEM; } + net_pkt_set_ip_dscp(pkt, net_ipv6_get_dscp(tc)); + net_pkt_set_ip_ecn(pkt, net_ipv6_get_ecn(tc)); + if (net_ipv6_create(pkt, src, dst) || net_icmpv6_create(pkt, NET_ICMPV6_ECHO_REQUEST, 0)) { goto drop; diff --git a/subsys/net/ip/icmpv6.h b/subsys/net/ip/icmpv6.h index 48f9e349ae5..95a8eb01356 100644 --- a/subsys/net/ip/icmpv6.h +++ b/subsys/net/ip/icmpv6.h @@ -198,6 +198,8 @@ int net_icmpv6_send_error(struct net_pkt *pkt, uint8_t type, uint8_t code, * to this Echo Request. May be zero. * @param sequence A sequence number to aid in matching Echo Replies * to this Echo Request. May be zero. + * @param tc IPv6 Traffic Class field value. Represents combined DSCP and + * ECN values. * @param data Arbitrary payload data that will be included in the * Echo Reply verbatim. May be zero. * @param data_size Size of the Payload Data in bytes. May be zero. @@ -209,6 +211,7 @@ int net_icmpv6_send_echo_request(struct net_if *iface, struct in6_addr *dst, uint16_t identifier, uint16_t sequence, + uint8_t tc, const void *data, size_t data_size); #else @@ -216,6 +219,7 @@ static inline int net_icmpv6_send_echo_request(struct net_if *iface, struct in6_addr *dst, uint16_t identifier, uint16_t sequence, + uint8_t tc, const void *data, size_t data_size) { @@ -223,6 +227,7 @@ static inline int net_icmpv6_send_echo_request(struct net_if *iface, ARG_UNUSED(dst); ARG_UNUSED(identifier); ARG_UNUSED(sequence); + ARG_UNUSED(tc); ARG_UNUSED(data); ARG_UNUSED(data_size); diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index 7b643181470..6a119f93359 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -3957,6 +3957,7 @@ static int ping_ipv6(const struct shell *shell, &ipv6_target, sys_rand32_get(), i, + 0, &time_stamp, sizeof(time_stamp)); if (ret) { diff --git a/subsys/net/lib/zperf/zperf_shell.c b/subsys/net/lib/zperf/zperf_shell.c index 381a08e98a8..458b12462f9 100644 --- a/subsys/net/lib/zperf/zperf_shell.c +++ b/subsys/net/lib/zperf/zperf_shell.c @@ -531,7 +531,7 @@ static int execute_upload(const struct shell *sh, * some time and start the test after that. */ net_icmpv6_send_echo_request(net_if_get_default(), - &ipv6->sin6_addr, 0, 0, NULL, 0); + &ipv6->sin6_addr, 0, 0, 0, NULL, 0); k_sleep(K_SECONDS(1)); } From 1d433570a084046d8723746798823bcfc03879a0 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Wed, 21 Sep 2022 17:11:19 +0200 Subject: [PATCH 444/501] [nrf fromtree] net: shell: Add support for ping -Q parameter (Quality of Service) Add new option to the net shell ping command, which allows to specify the DSCP/ECN values for an outgoing ping request. The option is compatible with Linux ping command. Signed-off-by: Robert Lubos (cherry picked from commit 9e38a3ec483491ec39b8753f6fee2ec447b81eff) --- subsys/net/ip/net_shell.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index 6a119f93359..8f9b87d06d2 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -3912,6 +3912,7 @@ static int ping_ipv6(const struct shell *shell, char *host, unsigned int count, unsigned int interval, + uint8_t tos, int iface_idx) { struct net_if *iface = net_if_get_by_index(iface_idx); @@ -3957,7 +3958,7 @@ static int ping_ipv6(const struct shell *shell, &ipv6_target, sys_rand32_get(), i, - 0, + tos, &time_stamp, sizeof(time_stamp)); if (ret) { @@ -4042,6 +4043,7 @@ static int ping_ipv4(const struct shell *shell, char *host, unsigned int count, unsigned int interval, + uint8_t tos, int iface_idx) { struct in_addr ipv4_target; @@ -4067,7 +4069,7 @@ static int ping_ipv4(const struct shell *shell, &ipv4_target, sys_rand32_get(), i, - 0, + tos, &time_stamp, sizeof(time_stamp)); if (ret) { @@ -4127,6 +4129,7 @@ static int cmd_net_ping(const struct shell *shell, size_t argc, char *argv[]) int count = 3; int interval = 1000; int iface_idx = -1; + int tos = 0; for (size_t i = 1; i < argc; ++i) { @@ -4161,6 +4164,15 @@ static int cmd_net_ping(const struct shell *shell, size_t argc, char *argv[]) return -ENOEXEC; } break; + + case 'Q': + tos = parse_arg(&i, argc, argv); + if (tos < 0 || tos > UINT8_MAX) { + PR_WARNING("Parse error: %s\n", argv[i]); + return -ENOEXEC; + } + + break; default: PR_WARNING("Unrecognized argument: %s\n", argv[i]); return -ENOEXEC; @@ -4175,7 +4187,7 @@ static int cmd_net_ping(const struct shell *shell, size_t argc, char *argv[]) shell_for_ping = shell; if (IS_ENABLED(CONFIG_NET_IPV6)) { - ret = ping_ipv6(shell, host, count, interval, iface_idx); + ret = ping_ipv6(shell, host, count, interval, tos, iface_idx); if (!ret) { goto wait_reply; } else if (ret == -EIO) { @@ -4185,7 +4197,7 @@ static int cmd_net_ping(const struct shell *shell, size_t argc, char *argv[]) } if (IS_ENABLED(CONFIG_NET_IPV4)) { - ret = ping_ipv4(shell, host, count, interval, iface_idx); + ret = ping_ipv4(shell, host, count, interval, tos, iface_idx); if (ret) { if (ret == -EIO || ret == -ENETUNREACH) { PR_WARNING("Cannot send IPv4 ping\n"); @@ -5973,7 +5985,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE(net_cmd_vlan, SHELL_STATIC_SUBCMD_SET_CREATE(net_cmd_ping, SHELL_CMD(--help, NULL, - "'net ping [-c count] [-i interval ms] [-I ] ' " + "'net ping [-c count] [-i interval ms] [-I ] " + "[-Q tos] ' " "Send ICMPv4 or ICMPv6 Echo-Request to a network host.", cmd_net_ping), SHELL_SUBCMD_SET_END From df1a4bb12a9198e8dff9fb1039697567a4863413 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Wed, 21 Sep 2022 17:28:10 +0200 Subject: [PATCH 445/501] [nrf fromtree] net: shell: Allow for ping arguments to be specified in hex Improve the parse_arg() helper function used with shell ping command, by allowing to parse arguments provided in hex. Signed-off-by: Robert Lubos (cherry picked from commit d437f950db2cbfe1bb732e1ac5f92993d09e25bd) --- subsys/net/ip/net_shell.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index 8f9b87d06d2..250281252ee 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -4104,7 +4104,11 @@ static int parse_arg(size_t *i, size_t argc, char *argv[]) } errno = 0; - res = strtol(str, &endptr, 10); + if (strncmp(str, "0x", 2) == 0) { + res = strtol(str, &endptr, 16); + } else { + res = strtol(str, &endptr, 10); + } if (errno || (endptr == str)) { return -1; From 5cef595fdb172639d9c5730023e8517e250523bc Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Thu, 22 Sep 2022 16:34:58 +0200 Subject: [PATCH 446/501] [nrf fromtree] net: zperf: Add QoS support Improve the zperf upload/upload2 commands, by allowing to specify DSCP/ECP fields for outgoing packets. The introduced -S option is compatible with Linux iperf3 utility. Signed-off-by: Robert Lubos (cherry picked from commit c27a6af7128a433fca825c43a0efe2f9405892b5) --- subsys/net/lib/zperf/zperf_shell.c | 134 ++++++++++++++++++++++++++--- 1 file changed, 123 insertions(+), 11 deletions(-) diff --git a/subsys/net/lib/zperf/zperf_shell.c b/subsys/net/lib/zperf/zperf_shell.c index 458b12462f9..2705c37a706 100644 --- a/subsys/net/lib/zperf/zperf_shell.c +++ b/subsys/net/lib/zperf/zperf_shell.c @@ -457,8 +457,8 @@ static int setup_upload_sockets(const struct shell *sh, struct sockaddr_in6 *ipv6, struct sockaddr_in *ipv4, int port, - bool is_udp, - char *argv0) + int tos, + bool is_udp) { if (IS_ENABLED(CONFIG_NET_IPV6)) { *sock6 = zsock_socket(AF_INET6, @@ -471,6 +471,16 @@ static int setup_upload_sockets(const struct shell *sh, return -ENOEXEC; } + if (tos >= 0) { + if (zsock_setsockopt(*sock6, IPPROTO_IPV6, IPV6_TCLASS, + &tos, sizeof(tos)) != 0) { + shell_fprintf( + sh, SHELL_WARNING, + "Failed to set IPV6_TCLASS socket option. " + "Please enable CONFIG_NET_CONTEXT_DSCP_ECN.\n"); + } + } + ipv6->sin6_port = htons(port); ipv6->sin6_family = AF_INET6; } @@ -486,6 +496,16 @@ static int setup_upload_sockets(const struct shell *sh, return -ENOEXEC; } + if (tos >= 0) { + if (zsock_setsockopt(*sock4, IPPROTO_IP, IP_TOS, + &tos, sizeof(tos)) != 0) { + shell_fprintf( + sh, SHELL_WARNING, + "Failed to set IP_TOS socket option. " + "Please enable CONFIG_NET_CONTEXT_DSCP_ECN.\n"); + } + } + ipv4->sin_port = htons(port); ipv4->sin_family = AF_INET; } @@ -507,7 +527,6 @@ static int execute_upload(const struct shell *sh, struct sockaddr_in *ipv4, bool is_udp, int port, - char *argv0, unsigned int duration_in_ms, unsigned int packet_size, unsigned int rate_in_kbps) @@ -647,6 +666,35 @@ static int execute_upload(const struct shell *sh, return 0; } +static int parse_arg(size_t *i, size_t argc, char *argv[]) +{ + int res = -1; + const char *str = argv[*i] + 2; + char *endptr; + + if (*str == 0) { + if (*i + 1 >= argc) { + return -1; + } + + *i += 1; + str = argv[*i]; + } + + errno = 0; + if (strncmp(str, "0x", 2) == 0) { + res = strtol(str, &endptr, 16); + } else { + res = strtol(str, &endptr, 10); + } + + if (errno || (endptr == str)) { + return -1; + } + + return res; +} + static int shell_cmd_upload(const struct shell *sh, size_t argc, char *argv[], enum net_ip_protocol proto) { @@ -659,9 +707,39 @@ static int shell_cmd_upload(const struct shell *sh, size_t argc, uint16_t port; bool is_udp; int start = 0; + size_t opt_cnt = 0; + int tos = 0; is_udp = proto == IPPROTO_UDP; + /* Parse options */ + for (size_t i = 1; i < argc; ++i) { + if (*argv[i] != '-') { + break; + } + + switch (argv[i][1]) { + case 'S': + tos = parse_arg(&i, argc, argv); + if (tos < 0 || tos > UINT8_MAX) { + shell_fprintf(sh, SHELL_WARNING, + "Parse error: %s\n", argv[i]); + return -ENOEXEC; + } + + break; + default: + shell_fprintf(sh, SHELL_WARNING, + "Unrecognized argument: %s\n", argv[i]); + return -ENOEXEC; + } + + opt_cnt += 2; + } + + start += opt_cnt; + argc -= opt_cnt; + if (argc < 2) { shell_fprintf(sh, SHELL_WARNING, "Not enough parameters.\n"); @@ -747,7 +825,7 @@ static int shell_cmd_upload(const struct shell *sh, size_t argc, } if (setup_upload_sockets(sh, &sock6, &sock4, family, &in6_addr_my, - &in4_addr_my, port, is_udp, argv[start]) < 0) { + &in4_addr_my, port, tos, is_udp) < 0) { return -ENOEXEC; } @@ -773,7 +851,7 @@ static int shell_cmd_upload(const struct shell *sh, size_t argc, } return execute_upload(sh, sock6, sock4, family, &ipv6, &ipv4, - is_udp, port, argv[start], duration_in_ms, + is_udp, port, duration_in_ms, packet_size, rate_in_kbps); } @@ -800,9 +878,39 @@ static int shell_cmd_upload2(const struct shell *sh, size_t argc, sa_family_t family; uint8_t is_udp; int start = 0; + size_t opt_cnt = 0; + int tos = -1; is_udp = proto == IPPROTO_UDP; + /* Parse options */ + for (size_t i = 1; i < argc; ++i) { + if (*argv[i] != '-') { + break; + } + + switch (argv[i][1]) { + case 'S': + tos = parse_arg(&i, argc, argv); + if (tos < 0 || tos > UINT8_MAX) { + shell_fprintf(sh, SHELL_WARNING, + "Parse error: %s\n", argv[i]); + return -ENOEXEC; + } + + break; + default: + shell_fprintf(sh, SHELL_WARNING, + "Unrecognized argument: %s\n", argv[i]); + return -ENOEXEC; + } + + opt_cnt += 2; + } + + start += opt_cnt; + argc -= opt_cnt; + if (argc < 2) { shell_fprintf(sh, SHELL_WARNING, "Not enough parameters.\n"); @@ -867,7 +975,7 @@ static int shell_cmd_upload2(const struct shell *sh, size_t argc, } if (setup_upload_sockets(sh, &sock6, &sock4, family, &in6_addr_my, - &in4_addr_my, port, is_udp, argv[start]) < 0) { + &in4_addr_my, port, tos, is_udp) < 0) { return -ENOEXEC; } @@ -893,7 +1001,7 @@ static int shell_cmd_upload2(const struct shell *sh, size_t argc, } return execute_upload(sh, sock6, sock4, family, &in6_addr_dst, - &in4_addr_dst, is_udp, port, argv[start], + &in4_addr_dst, is_udp, port, duration_in_ms, packet_size, rate_in_kbps); } @@ -1068,7 +1176,8 @@ static void zperf_init(const struct shell *sh) SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_tcp, SHELL_CMD(upload, NULL, - " [K]\n" + "[] [K]\n" + " command options (optional): [-S tos]\n" " IP destination\n" " port destination\n" " of the test in seconds\n" @@ -1078,7 +1187,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_tcp, "Example: tcp upload 2001:db8::2\n", cmd_tcp_upload), SHELL_CMD(upload2, NULL, - "v6|v4 [K] [K|M]\n" + "[] v6|v4 [K] [K|M]\n" + " command options (optional): [-S tos]\n" ": Use either IPv6 or IPv4\n" " Duration of the test in seconds\n" " Size of the packet in byte or kilobyte " @@ -1104,8 +1214,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_tcp, SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_udp, SHELL_CMD(upload, NULL, - " [ [K] " + "[] [ [K] " "[K|M]]\n" + " command options (optional): [-S tos]\n" " IP destination\n" " port destination\n" " of the test in seconds\n" @@ -1116,7 +1227,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_udp, "Example: udp upload 2001:db8::2\n", cmd_udp_upload), SHELL_CMD(upload2, NULL, - "v6|v4 [ [K] [K|M]]\n" + "[] v6|v4 [ [K] [K|M]]\n" + " command options (optional): [-S tos]\n" ": Use either IPv6 or IPv4\n" " Duration of the test in seconds\n" " Size of the packet in byte or kilobyte " From 54ba477777fd6f8edde2f8bca40dcd8aa34d6b73 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Tue, 25 Oct 2022 15:12:31 +0200 Subject: [PATCH 447/501] [nrf fromtree] sample: tfm_regression_test: Set library model explicitly Set the TF-M library mode explicitly instead disabling IPC model and relying on this selecting Libray model in the choice. This is a follow-up on the TFM_IPC being put into a choice selection when SFN model was added. Signed-off-by: Joakim Andersson (cherry picked from commit 8bc9a3c04245f7066c51c62573e25975fd31dab1) --- samples/tfm_integration/tfm_regression_test/sample.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/tfm_integration/tfm_regression_test/sample.yaml b/samples/tfm_integration/tfm_regression_test/sample.yaml index 3383c91b544..827a35bccb7 100644 --- a/samples/tfm_integration/tfm_regression_test/sample.yaml +++ b/samples/tfm_integration/tfm_regression_test/sample.yaml @@ -15,7 +15,7 @@ sample: tests: sample.tfm.regression_lib_mode: - extra_args: CONFIG_TFM_IPC=n CONFIG_TFM_ISOLATION_LEVEL=1 + extra_args: CONFIG_TFM_LIBRARY=y CONFIG_TFM_ISOLATION_LEVEL=1 timeout: 200 sample.tfm.regression_ipc_lvl1: From 7c71945d42f690bbee663d9380ee604c94c42d6b Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Tue, 25 Oct 2022 15:14:47 +0200 Subject: [PATCH 448/501] [nrf fromtree] sample: tfm_regression_test: Only have audit partition in Library config Only enable the TF-M Audit Partition in the TF-M regression tests when Library model is used. This is not supported in IPC model and produces a Kconfig warning. Signed-off-by: Joakim Andersson (cherry picked from commit 96698450c49b08b93f71d88f35560a5d820ecd8e) --- samples/tfm_integration/tfm_regression_test/prj.conf | 1 - samples/tfm_integration/tfm_regression_test/sample.yaml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index c579d1bc1b4..e6c9ec974a8 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -17,7 +17,6 @@ CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE=y CONFIG_TFM_PARTITION_CRYPTO=y CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=y CONFIG_TFM_PARTITION_PLATFORM=y -CONFIG_TFM_PARTITION_AUDIT_LOG=y # Enable IPC mode and isolation level 2 by default CONFIG_TFM_IPC=y diff --git a/samples/tfm_integration/tfm_regression_test/sample.yaml b/samples/tfm_integration/tfm_regression_test/sample.yaml index 827a35bccb7..29223a420d2 100644 --- a/samples/tfm_integration/tfm_regression_test/sample.yaml +++ b/samples/tfm_integration/tfm_regression_test/sample.yaml @@ -15,7 +15,7 @@ sample: tests: sample.tfm.regression_lib_mode: - extra_args: CONFIG_TFM_LIBRARY=y CONFIG_TFM_ISOLATION_LEVEL=1 + extra_args: CONFIG_TFM_LIBRARY=y CONFIG_TFM_ISOLATION_LEVEL=1 CONFIG_TFM_PARTITION_AUDIT_LOG=y timeout: 200 sample.tfm.regression_ipc_lvl1: From cbbd5f9b0f7ce55372ebccaecebbd7da73004ebe Mon Sep 17 00:00:00 2001 From: Krishna T Date: Wed, 26 Oct 2022 01:47:17 +0530 Subject: [PATCH 449/501] [nrf fromtree] net: wifi: Fix MFP when security type is not given When security type is not given but instead MFP is given, MFP setting will be considered as security type, this is because both are optional and no way to distinguish them easily. Make security type mandatory for MFP selection, this way we either assume defaults for both security type and MFP or explicitly ask user for both. Reword the help text to reflect this. Signed-off-by: Krishna T (cherry picked from commit 9b02f91f8044ee3c3fcef80ae74fd50394040416) --- subsys/net/l2/wifi/wifi_shell.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 8ef2f246369..ed13e7cf32a 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -184,7 +184,9 @@ static int __wifi_args_to_params(size_t argc, char *argv[], if (idx < argc) { params->psk = argv[idx]; params->psk_length = strlen(argv[idx]); + /* Defaults */ params->security = WIFI_SECURITY_TYPE_PSK; + params->mfp = WIFI_MFP_OPTIONAL; idx++; /* Security type (optional) */ @@ -195,21 +197,21 @@ static int __wifi_args_to_params(size_t argc, char *argv[], params->security = security; } idx++; + + /* MFP (optional) */ + if (idx < argc) { + unsigned int mfp = strtol(argv[idx], &endptr, 10); + + if (mfp <= WIFI_MFP_REQUIRED) { + params->mfp = mfp; + } + idx++; + } } } else { params->security = WIFI_SECURITY_TYPE_NONE; } - /* MFP (optional) */ - params->mfp = WIFI_MFP_OPTIONAL; - if (idx < argc) { - unsigned int mfp = strtol(argv[idx], &endptr, 10); - - if (mfp <= WIFI_MFP_REQUIRED) { - params->mfp = mfp; - } - idx++; - } return 0; } @@ -439,7 +441,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, "\n" "\n" "0:None, 1:PSK, 2:PSK-256, 3:SAE\n" - "\n" + ": 0:Disable, 1:Optional, 2:Required", cmd_wifi_connect), SHELL_CMD(disconnect, NULL, "Disconnect from the Wi-Fi AP", cmd_wifi_disconnect), From 78a9e8effce0366562b9bb1f4e08096fa4cb13b9 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Wed, 26 Oct 2022 21:19:46 +0530 Subject: [PATCH 450/501] [nrf fromtree] net: lib: zperf: Disable prints during ongoing traffic Prints when traffic is ongoing cost a few Mbps due to writing to UART as observed by the profiler, so, disable them by default. Signed-off-by: Krishna T (cherry picked from commit 1852e332131ed74cfada26091afd6b921c87e84f) --- subsys/net/lib/zperf/zperf_udp_uploader.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/subsys/net/lib/zperf/zperf_udp_uploader.c b/subsys/net/lib/zperf/zperf_udp_uploader.c index e86598d2ca8..bd127d5181e 100644 --- a/subsys/net/lib/zperf/zperf_udp_uploader.c +++ b/subsys/net/lib/zperf/zperf_udp_uploader.c @@ -147,12 +147,11 @@ void zperf_udp_upload(const struct shell *sh, uint32_t packet_duration = ((uint64_t)packet_size * 8U * USEC_PER_SEC) / (rate_in_kbps * 1024U); uint64_t duration = sys_clock_timeout_end_calc(K_MSEC(duration_in_ms)); - int64_t print_interval = sys_clock_timeout_end_calc(K_SECONDS(1)); uint64_t delay = packet_duration; uint32_t nb_packets = 0U; int64_t start_time, end_time; int64_t last_print_time, last_loop_time; - int64_t remaining, print_info; + int64_t remaining; if (packet_size > PACKET_SIZE_MAX) { shell_fprintf(sh, SHELL_WARNING, @@ -246,14 +245,18 @@ void zperf_udp_upload(const struct shell *sh, nb_packets++; } - /* Print log every seconds */ - print_info = print_interval - k_uptime_ticks(); - if (print_info <= 0) { - shell_fprintf(sh, SHELL_WARNING, - "nb_packets=%u\tdelay=%u\tadjust=%d\n", - nb_packets, (unsigned int)delay, - (int)adjust); - print_interval = sys_clock_timeout_end_calc(K_SECONDS(1)); + if (IS_ENABLED(CONFIG_NET_ZPERF_LOG_LEVEL_DBG)) { + int64_t print_interval = sys_clock_timeout_end_calc(K_SECONDS(1)); + /* Print log every seconds */ + int64_t print_info = print_interval - k_uptime_ticks(); + + if (print_info <= 0) { + shell_fprintf(sh, SHELL_WARNING, + "nb_packets=%u\tdelay=%u\tadjust=%d\n", + nb_packets, (unsigned int)delay, + (int)adjust); + print_interval = sys_clock_timeout_end_calc(K_SECONDS(1)); + } } remaining = duration - k_uptime_ticks(); From 69736f6d47ab6552767943423ac3ce6be10b80c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 3 Nov 2022 07:19:28 +0100 Subject: [PATCH 451/501] Revert "[nrf fromtree] net: lib: zperf: Disable prints during ongoing traffic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 78a9e8effce0366562b9bb1f4e08096fa4cb13b9. Signed-off-by: Tomasz Moń --- subsys/net/lib/zperf/zperf_udp_uploader.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/subsys/net/lib/zperf/zperf_udp_uploader.c b/subsys/net/lib/zperf/zperf_udp_uploader.c index bd127d5181e..e86598d2ca8 100644 --- a/subsys/net/lib/zperf/zperf_udp_uploader.c +++ b/subsys/net/lib/zperf/zperf_udp_uploader.c @@ -147,11 +147,12 @@ void zperf_udp_upload(const struct shell *sh, uint32_t packet_duration = ((uint64_t)packet_size * 8U * USEC_PER_SEC) / (rate_in_kbps * 1024U); uint64_t duration = sys_clock_timeout_end_calc(K_MSEC(duration_in_ms)); + int64_t print_interval = sys_clock_timeout_end_calc(K_SECONDS(1)); uint64_t delay = packet_duration; uint32_t nb_packets = 0U; int64_t start_time, end_time; int64_t last_print_time, last_loop_time; - int64_t remaining; + int64_t remaining, print_info; if (packet_size > PACKET_SIZE_MAX) { shell_fprintf(sh, SHELL_WARNING, @@ -245,18 +246,14 @@ void zperf_udp_upload(const struct shell *sh, nb_packets++; } - if (IS_ENABLED(CONFIG_NET_ZPERF_LOG_LEVEL_DBG)) { - int64_t print_interval = sys_clock_timeout_end_calc(K_SECONDS(1)); - /* Print log every seconds */ - int64_t print_info = print_interval - k_uptime_ticks(); - - if (print_info <= 0) { - shell_fprintf(sh, SHELL_WARNING, - "nb_packets=%u\tdelay=%u\tadjust=%d\n", - nb_packets, (unsigned int)delay, - (int)adjust); - print_interval = sys_clock_timeout_end_calc(K_SECONDS(1)); - } + /* Print log every seconds */ + print_info = print_interval - k_uptime_ticks(); + if (print_info <= 0) { + shell_fprintf(sh, SHELL_WARNING, + "nb_packets=%u\tdelay=%u\tadjust=%d\n", + nb_packets, (unsigned int)delay, + (int)adjust); + print_interval = sys_clock_timeout_end_calc(K_SECONDS(1)); } remaining = duration - k_uptime_ticks(); From c738d22261c833f71c0c05a99cd4a05a08f0ce91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:48:41 +0100 Subject: [PATCH 452/501] Revert "[nrf fromtree] sample: tfm_regression_test: Only have audit partition in Library config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7c71945d42f690bbee663d9380ee604c94c42d6b. Signed-off-by: Tomasz Moń --- samples/tfm_integration/tfm_regression_test/prj.conf | 1 + samples/tfm_integration/tfm_regression_test/sample.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index e6c9ec974a8..c579d1bc1b4 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -17,6 +17,7 @@ CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE=y CONFIG_TFM_PARTITION_CRYPTO=y CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=y CONFIG_TFM_PARTITION_PLATFORM=y +CONFIG_TFM_PARTITION_AUDIT_LOG=y # Enable IPC mode and isolation level 2 by default CONFIG_TFM_IPC=y diff --git a/samples/tfm_integration/tfm_regression_test/sample.yaml b/samples/tfm_integration/tfm_regression_test/sample.yaml index 29223a420d2..827a35bccb7 100644 --- a/samples/tfm_integration/tfm_regression_test/sample.yaml +++ b/samples/tfm_integration/tfm_regression_test/sample.yaml @@ -15,7 +15,7 @@ sample: tests: sample.tfm.regression_lib_mode: - extra_args: CONFIG_TFM_LIBRARY=y CONFIG_TFM_ISOLATION_LEVEL=1 CONFIG_TFM_PARTITION_AUDIT_LOG=y + extra_args: CONFIG_TFM_LIBRARY=y CONFIG_TFM_ISOLATION_LEVEL=1 timeout: 200 sample.tfm.regression_ipc_lvl1: From f9e3c5287167750ed48128c7085e02ecb82b9bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:48:58 +0100 Subject: [PATCH 453/501] Revert "[nrf fromtree] sample: tfm_regression_test: Set library model explicitly" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 54ba477777fd6f8edde2f8bca40dcd8aa34d6b73. Signed-off-by: Tomasz Moń --- samples/tfm_integration/tfm_regression_test/sample.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/tfm_integration/tfm_regression_test/sample.yaml b/samples/tfm_integration/tfm_regression_test/sample.yaml index 827a35bccb7..3383c91b544 100644 --- a/samples/tfm_integration/tfm_regression_test/sample.yaml +++ b/samples/tfm_integration/tfm_regression_test/sample.yaml @@ -15,7 +15,7 @@ sample: tests: sample.tfm.regression_lib_mode: - extra_args: CONFIG_TFM_LIBRARY=y CONFIG_TFM_ISOLATION_LEVEL=1 + extra_args: CONFIG_TFM_IPC=n CONFIG_TFM_ISOLATION_LEVEL=1 timeout: 200 sample.tfm.regression_ipc_lvl1: From 5bfe98a0f7b5b92574f60df1133406d9b28f5167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:49:20 +0100 Subject: [PATCH 454/501] Revert "[nrf fromtree] net: zperf: Add QoS support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5cef595fdb172639d9c5730023e8517e250523bc. Signed-off-by: Tomasz Moń --- subsys/net/lib/zperf/zperf_shell.c | 134 +++-------------------------- 1 file changed, 11 insertions(+), 123 deletions(-) diff --git a/subsys/net/lib/zperf/zperf_shell.c b/subsys/net/lib/zperf/zperf_shell.c index 2705c37a706..458b12462f9 100644 --- a/subsys/net/lib/zperf/zperf_shell.c +++ b/subsys/net/lib/zperf/zperf_shell.c @@ -457,8 +457,8 @@ static int setup_upload_sockets(const struct shell *sh, struct sockaddr_in6 *ipv6, struct sockaddr_in *ipv4, int port, - int tos, - bool is_udp) + bool is_udp, + char *argv0) { if (IS_ENABLED(CONFIG_NET_IPV6)) { *sock6 = zsock_socket(AF_INET6, @@ -471,16 +471,6 @@ static int setup_upload_sockets(const struct shell *sh, return -ENOEXEC; } - if (tos >= 0) { - if (zsock_setsockopt(*sock6, IPPROTO_IPV6, IPV6_TCLASS, - &tos, sizeof(tos)) != 0) { - shell_fprintf( - sh, SHELL_WARNING, - "Failed to set IPV6_TCLASS socket option. " - "Please enable CONFIG_NET_CONTEXT_DSCP_ECN.\n"); - } - } - ipv6->sin6_port = htons(port); ipv6->sin6_family = AF_INET6; } @@ -496,16 +486,6 @@ static int setup_upload_sockets(const struct shell *sh, return -ENOEXEC; } - if (tos >= 0) { - if (zsock_setsockopt(*sock4, IPPROTO_IP, IP_TOS, - &tos, sizeof(tos)) != 0) { - shell_fprintf( - sh, SHELL_WARNING, - "Failed to set IP_TOS socket option. " - "Please enable CONFIG_NET_CONTEXT_DSCP_ECN.\n"); - } - } - ipv4->sin_port = htons(port); ipv4->sin_family = AF_INET; } @@ -527,6 +507,7 @@ static int execute_upload(const struct shell *sh, struct sockaddr_in *ipv4, bool is_udp, int port, + char *argv0, unsigned int duration_in_ms, unsigned int packet_size, unsigned int rate_in_kbps) @@ -666,35 +647,6 @@ static int execute_upload(const struct shell *sh, return 0; } -static int parse_arg(size_t *i, size_t argc, char *argv[]) -{ - int res = -1; - const char *str = argv[*i] + 2; - char *endptr; - - if (*str == 0) { - if (*i + 1 >= argc) { - return -1; - } - - *i += 1; - str = argv[*i]; - } - - errno = 0; - if (strncmp(str, "0x", 2) == 0) { - res = strtol(str, &endptr, 16); - } else { - res = strtol(str, &endptr, 10); - } - - if (errno || (endptr == str)) { - return -1; - } - - return res; -} - static int shell_cmd_upload(const struct shell *sh, size_t argc, char *argv[], enum net_ip_protocol proto) { @@ -707,39 +659,9 @@ static int shell_cmd_upload(const struct shell *sh, size_t argc, uint16_t port; bool is_udp; int start = 0; - size_t opt_cnt = 0; - int tos = 0; is_udp = proto == IPPROTO_UDP; - /* Parse options */ - for (size_t i = 1; i < argc; ++i) { - if (*argv[i] != '-') { - break; - } - - switch (argv[i][1]) { - case 'S': - tos = parse_arg(&i, argc, argv); - if (tos < 0 || tos > UINT8_MAX) { - shell_fprintf(sh, SHELL_WARNING, - "Parse error: %s\n", argv[i]); - return -ENOEXEC; - } - - break; - default: - shell_fprintf(sh, SHELL_WARNING, - "Unrecognized argument: %s\n", argv[i]); - return -ENOEXEC; - } - - opt_cnt += 2; - } - - start += opt_cnt; - argc -= opt_cnt; - if (argc < 2) { shell_fprintf(sh, SHELL_WARNING, "Not enough parameters.\n"); @@ -825,7 +747,7 @@ static int shell_cmd_upload(const struct shell *sh, size_t argc, } if (setup_upload_sockets(sh, &sock6, &sock4, family, &in6_addr_my, - &in4_addr_my, port, tos, is_udp) < 0) { + &in4_addr_my, port, is_udp, argv[start]) < 0) { return -ENOEXEC; } @@ -851,7 +773,7 @@ static int shell_cmd_upload(const struct shell *sh, size_t argc, } return execute_upload(sh, sock6, sock4, family, &ipv6, &ipv4, - is_udp, port, duration_in_ms, + is_udp, port, argv[start], duration_in_ms, packet_size, rate_in_kbps); } @@ -878,39 +800,9 @@ static int shell_cmd_upload2(const struct shell *sh, size_t argc, sa_family_t family; uint8_t is_udp; int start = 0; - size_t opt_cnt = 0; - int tos = -1; is_udp = proto == IPPROTO_UDP; - /* Parse options */ - for (size_t i = 1; i < argc; ++i) { - if (*argv[i] != '-') { - break; - } - - switch (argv[i][1]) { - case 'S': - tos = parse_arg(&i, argc, argv); - if (tos < 0 || tos > UINT8_MAX) { - shell_fprintf(sh, SHELL_WARNING, - "Parse error: %s\n", argv[i]); - return -ENOEXEC; - } - - break; - default: - shell_fprintf(sh, SHELL_WARNING, - "Unrecognized argument: %s\n", argv[i]); - return -ENOEXEC; - } - - opt_cnt += 2; - } - - start += opt_cnt; - argc -= opt_cnt; - if (argc < 2) { shell_fprintf(sh, SHELL_WARNING, "Not enough parameters.\n"); @@ -975,7 +867,7 @@ static int shell_cmd_upload2(const struct shell *sh, size_t argc, } if (setup_upload_sockets(sh, &sock6, &sock4, family, &in6_addr_my, - &in4_addr_my, port, tos, is_udp) < 0) { + &in4_addr_my, port, is_udp, argv[start]) < 0) { return -ENOEXEC; } @@ -1001,7 +893,7 @@ static int shell_cmd_upload2(const struct shell *sh, size_t argc, } return execute_upload(sh, sock6, sock4, family, &in6_addr_dst, - &in4_addr_dst, is_udp, port, + &in4_addr_dst, is_udp, port, argv[start], duration_in_ms, packet_size, rate_in_kbps); } @@ -1176,8 +1068,7 @@ static void zperf_init(const struct shell *sh) SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_tcp, SHELL_CMD(upload, NULL, - "[] [K]\n" - " command options (optional): [-S tos]\n" + " [K]\n" " IP destination\n" " port destination\n" " of the test in seconds\n" @@ -1187,8 +1078,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_tcp, "Example: tcp upload 2001:db8::2\n", cmd_tcp_upload), SHELL_CMD(upload2, NULL, - "[] v6|v4 [K] [K|M]\n" - " command options (optional): [-S tos]\n" + "v6|v4 [K] [K|M]\n" ": Use either IPv6 or IPv4\n" " Duration of the test in seconds\n" " Size of the packet in byte or kilobyte " @@ -1214,9 +1104,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_tcp, SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_udp, SHELL_CMD(upload, NULL, - "[] [ [K] " + " [ [K] " "[K|M]]\n" - " command options (optional): [-S tos]\n" " IP destination\n" " port destination\n" " of the test in seconds\n" @@ -1227,8 +1116,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_udp, "Example: udp upload 2001:db8::2\n", cmd_udp_upload), SHELL_CMD(upload2, NULL, - "[] v6|v4 [ [K] [K|M]]\n" - " command options (optional): [-S tos]\n" + "v6|v4 [ [K] [K|M]]\n" ": Use either IPv6 or IPv4\n" " Duration of the test in seconds\n" " Size of the packet in byte or kilobyte " From 90105a223feab204b84eed1f221f9345eff3f91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:49:34 +0100 Subject: [PATCH 455/501] Revert "[nrf fromtree] net: shell: Allow for ping arguments to be specified in hex" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit df1a4bb12a9198e8dff9fb1039697567a4863413. Signed-off-by: Tomasz Moń --- subsys/net/ip/net_shell.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index 250281252ee..8f9b87d06d2 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -4104,11 +4104,7 @@ static int parse_arg(size_t *i, size_t argc, char *argv[]) } errno = 0; - if (strncmp(str, "0x", 2) == 0) { - res = strtol(str, &endptr, 16); - } else { - res = strtol(str, &endptr, 10); - } + res = strtol(str, &endptr, 10); if (errno || (endptr == str)) { return -1; From 7492974f62344de5c06b83f7c3af777157feb269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:49:47 +0100 Subject: [PATCH 456/501] Revert "[nrf fromtree] net: shell: Add support for ping -Q parameter (Quality of Service)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1d433570a084046d8723746798823bcfc03879a0. Signed-off-by: Tomasz Moń --- subsys/net/ip/net_shell.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index 8f9b87d06d2..6a119f93359 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -3912,7 +3912,6 @@ static int ping_ipv6(const struct shell *shell, char *host, unsigned int count, unsigned int interval, - uint8_t tos, int iface_idx) { struct net_if *iface = net_if_get_by_index(iface_idx); @@ -3958,7 +3957,7 @@ static int ping_ipv6(const struct shell *shell, &ipv6_target, sys_rand32_get(), i, - tos, + 0, &time_stamp, sizeof(time_stamp)); if (ret) { @@ -4043,7 +4042,6 @@ static int ping_ipv4(const struct shell *shell, char *host, unsigned int count, unsigned int interval, - uint8_t tos, int iface_idx) { struct in_addr ipv4_target; @@ -4069,7 +4067,7 @@ static int ping_ipv4(const struct shell *shell, &ipv4_target, sys_rand32_get(), i, - tos, + 0, &time_stamp, sizeof(time_stamp)); if (ret) { @@ -4129,7 +4127,6 @@ static int cmd_net_ping(const struct shell *shell, size_t argc, char *argv[]) int count = 3; int interval = 1000; int iface_idx = -1; - int tos = 0; for (size_t i = 1; i < argc; ++i) { @@ -4164,15 +4161,6 @@ static int cmd_net_ping(const struct shell *shell, size_t argc, char *argv[]) return -ENOEXEC; } break; - - case 'Q': - tos = parse_arg(&i, argc, argv); - if (tos < 0 || tos > UINT8_MAX) { - PR_WARNING("Parse error: %s\n", argv[i]); - return -ENOEXEC; - } - - break; default: PR_WARNING("Unrecognized argument: %s\n", argv[i]); return -ENOEXEC; @@ -4187,7 +4175,7 @@ static int cmd_net_ping(const struct shell *shell, size_t argc, char *argv[]) shell_for_ping = shell; if (IS_ENABLED(CONFIG_NET_IPV6)) { - ret = ping_ipv6(shell, host, count, interval, tos, iface_idx); + ret = ping_ipv6(shell, host, count, interval, iface_idx); if (!ret) { goto wait_reply; } else if (ret == -EIO) { @@ -4197,7 +4185,7 @@ static int cmd_net_ping(const struct shell *shell, size_t argc, char *argv[]) } if (IS_ENABLED(CONFIG_NET_IPV4)) { - ret = ping_ipv4(shell, host, count, interval, tos, iface_idx); + ret = ping_ipv4(shell, host, count, interval, iface_idx); if (ret) { if (ret == -EIO || ret == -ENETUNREACH) { PR_WARNING("Cannot send IPv4 ping\n"); @@ -5985,8 +5973,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(net_cmd_vlan, SHELL_STATIC_SUBCMD_SET_CREATE(net_cmd_ping, SHELL_CMD(--help, NULL, - "'net ping [-c count] [-i interval ms] [-I ] " - "[-Q tos] ' " + "'net ping [-c count] [-i interval ms] [-I ] ' " "Send ICMPv4 or ICMPv6 Echo-Request to a network host.", cmd_net_ping), SHELL_SUBCMD_SET_END From 6259dc649d88711d3ae4e964f137f8132386542c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:50:04 +0100 Subject: [PATCH 457/501] Revert "[nrf fromtree] net: icmpv6: Allow to specify DSCP and ECN values in ping" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9703e452791303f33197bd3953e1de35edabd143. Signed-off-by: Tomasz Moń --- subsys/net/ip/icmpv6.c | 7 ------- subsys/net/ip/icmpv6.h | 5 ----- subsys/net/ip/net_shell.c | 1 - subsys/net/lib/zperf/zperf_shell.c | 2 +- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/subsys/net/ip/icmpv6.c b/subsys/net/ip/icmpv6.c index 8b81f3f6c40..6919edc1741 100644 --- a/subsys/net/ip/icmpv6.c +++ b/subsys/net/ip/icmpv6.c @@ -149,9 +149,6 @@ enum net_verdict icmpv6_handle_echo_request(struct net_pkt *pkt, net_pkt_lladdr_dst(reply)->addr = NULL; net_pkt_lladdr_src(reply)->addr = NULL; - net_pkt_set_ip_dscp(reply, net_pkt_ip_dscp(pkt)); - net_pkt_set_ip_ecn(reply, net_pkt_ip_ecn(pkt)); - if (net_ipv6_create(reply, src, (struct in6_addr *)ip_hdr->src)) { NET_DBG("DROP: wrong buffer"); goto drop; @@ -340,7 +337,6 @@ int net_icmpv6_send_echo_request(struct net_if *iface, struct in6_addr *dst, uint16_t identifier, uint16_t sequence, - uint8_t tc, const void *data, size_t data_size) { @@ -362,9 +358,6 @@ int net_icmpv6_send_echo_request(struct net_if *iface, return -ENOMEM; } - net_pkt_set_ip_dscp(pkt, net_ipv6_get_dscp(tc)); - net_pkt_set_ip_ecn(pkt, net_ipv6_get_ecn(tc)); - if (net_ipv6_create(pkt, src, dst) || net_icmpv6_create(pkt, NET_ICMPV6_ECHO_REQUEST, 0)) { goto drop; diff --git a/subsys/net/ip/icmpv6.h b/subsys/net/ip/icmpv6.h index 95a8eb01356..48f9e349ae5 100644 --- a/subsys/net/ip/icmpv6.h +++ b/subsys/net/ip/icmpv6.h @@ -198,8 +198,6 @@ int net_icmpv6_send_error(struct net_pkt *pkt, uint8_t type, uint8_t code, * to this Echo Request. May be zero. * @param sequence A sequence number to aid in matching Echo Replies * to this Echo Request. May be zero. - * @param tc IPv6 Traffic Class field value. Represents combined DSCP and - * ECN values. * @param data Arbitrary payload data that will be included in the * Echo Reply verbatim. May be zero. * @param data_size Size of the Payload Data in bytes. May be zero. @@ -211,7 +209,6 @@ int net_icmpv6_send_echo_request(struct net_if *iface, struct in6_addr *dst, uint16_t identifier, uint16_t sequence, - uint8_t tc, const void *data, size_t data_size); #else @@ -219,7 +216,6 @@ static inline int net_icmpv6_send_echo_request(struct net_if *iface, struct in6_addr *dst, uint16_t identifier, uint16_t sequence, - uint8_t tc, const void *data, size_t data_size) { @@ -227,7 +223,6 @@ static inline int net_icmpv6_send_echo_request(struct net_if *iface, ARG_UNUSED(dst); ARG_UNUSED(identifier); ARG_UNUSED(sequence); - ARG_UNUSED(tc); ARG_UNUSED(data); ARG_UNUSED(data_size); diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index 6a119f93359..7b643181470 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -3957,7 +3957,6 @@ static int ping_ipv6(const struct shell *shell, &ipv6_target, sys_rand32_get(), i, - 0, &time_stamp, sizeof(time_stamp)); if (ret) { diff --git a/subsys/net/lib/zperf/zperf_shell.c b/subsys/net/lib/zperf/zperf_shell.c index 458b12462f9..381a08e98a8 100644 --- a/subsys/net/lib/zperf/zperf_shell.c +++ b/subsys/net/lib/zperf/zperf_shell.c @@ -531,7 +531,7 @@ static int execute_upload(const struct shell *sh, * some time and start the test after that. */ net_icmpv6_send_echo_request(net_if_get_default(), - &ipv6->sin6_addr, 0, 0, 0, NULL, 0); + &ipv6->sin6_addr, 0, 0, NULL, 0); k_sleep(K_SECONDS(1)); } From 5bb1a1edf7bd3e303ce9b1a5c8ebf6f0f7653c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:50:17 +0100 Subject: [PATCH 458/501] Revert "[nrf fromtree] net: icmpv4: Allow to specify DSCP and ECN values in ping" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 67c136bd1c4e22c15581eee2d3dccb4424ba5174. Signed-off-by: Tomasz Moń --- subsys/net/ip/icmpv4.c | 7 ------- subsys/net/ip/icmpv4.h | 5 ----- subsys/net/ip/net_shell.c | 1 - 3 files changed, 13 deletions(-) diff --git a/subsys/net/ip/icmpv4.c b/subsys/net/ip/icmpv4.c index 23d101e7254..65b5de53937 100644 --- a/subsys/net/ip/icmpv4.c +++ b/subsys/net/ip/icmpv4.c @@ -457,9 +457,6 @@ static enum net_verdict icmpv4_handle_echo_request(struct net_pkt *pkt, src = (struct in_addr *)ip_hdr->dst; } - net_pkt_set_ip_dscp(reply, net_pkt_ip_dscp(pkt)); - net_pkt_set_ip_ecn(reply, net_pkt_ip_ecn(pkt)); - if (net_ipv4_create(reply, src, (struct in_addr *)ip_hdr->src)) { goto drop; } @@ -506,7 +503,6 @@ int net_icmpv4_send_echo_request(struct net_if *iface, struct in_addr *dst, uint16_t identifier, uint16_t sequence, - uint8_t tos, const void *data, size_t data_size) { @@ -537,9 +533,6 @@ int net_icmpv4_send_echo_request(struct net_if *iface, return -ENOMEM; } - net_pkt_set_ip_dscp(pkt, net_ipv4_get_dscp(tos)); - net_pkt_set_ip_ecn(pkt, net_ipv4_get_ecn(tos)); - if (net_ipv4_create(pkt, src, dst) || icmpv4_create(pkt, NET_ICMPV4_ECHO_REQUEST, 0)) { goto drop; diff --git a/subsys/net/ip/icmpv4.h b/subsys/net/ip/icmpv4.h index 9b861fbf014..adde2d369ba 100644 --- a/subsys/net/ip/icmpv4.h +++ b/subsys/net/ip/icmpv4.h @@ -62,8 +62,6 @@ int net_icmpv4_send_error(struct net_pkt *pkt, uint8_t type, uint8_t code); * to this Echo Request. May be zero. * @param sequence A sequence number to aid in matching Echo Replies * to this Echo Request. May be zero. - * @param tos IPv4 Type-of-service field value. Represents combined DSCP and ECN - * values. * @param data Arbitrary payload data that will be included in the * Echo Reply verbatim. May be zero. * @param data_size Size of the Payload Data in bytes. May be zero. @@ -75,7 +73,6 @@ int net_icmpv4_send_echo_request(struct net_if *iface, struct in_addr *dst, uint16_t identifier, uint16_t sequence, - uint8_t tos, const void *data, size_t data_size); #else @@ -83,7 +80,6 @@ static inline int net_icmpv4_send_echo_request(struct net_if *iface, struct in_addr *dst, uint16_t identifier, uint16_t sequence, - uint8_t tos, const void *data, size_t data_size) { @@ -91,7 +87,6 @@ static inline int net_icmpv4_send_echo_request(struct net_if *iface, ARG_UNUSED(dst); ARG_UNUSED(identifier); ARG_UNUSED(sequence); - ARG_UNUSED(tos); ARG_UNUSED(data); ARG_UNUSED(data_size); diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index 7b643181470..96e882381df 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -4066,7 +4066,6 @@ static int ping_ipv4(const struct shell *shell, &ipv4_target, sys_rand32_get(), i, - 0, &time_stamp, sizeof(time_stamp)); if (ret) { From 07bf44f2ac3c9ce1f7caec02fd57e4ed3745802b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:50:36 +0100 Subject: [PATCH 459/501] Revert "[nrf fromtree] net: sockets: Add options to control DSCP/ECN value" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ab4f8f163e3ec12aabd5249275f0d4523c2c4774. Signed-off-by: Tomasz Moń --- include/zephyr/net/socket.h | 7 --- subsys/net/lib/sockets/sockets.c | 80 -------------------------------- 2 files changed, 87 deletions(-) diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index b4c311a2679..5ea9ac7977b 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -985,17 +985,10 @@ struct ifreq { /** sockopt: Disable TCP buffering (ignored, for compatibility) */ #define TCP_NODELAY 1 -/* Socket options for IPPROTO_IP level */ -/** sockopt: Set or receive the Type-Of-Service value for an outgoing packet. */ -#define IP_TOS 1 - /* Socket options for IPPROTO_IPV6 level */ /** sockopt: Don't support IPv4 access (ignored, for compatibility) */ #define IPV6_V6ONLY 26 -/** sockopt: Set or receive the traffic class value for an outgoing packet. */ -#define IPV6_TCLASS 67 - /** sockopt: Socket priority */ #define SO_PRIORITY 12 diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c index 2a87a5f54e2..04182f4bf68 100644 --- a/subsys/net/lib/sockets/sockets.c +++ b/subsys/net/lib/sockets/sockets.c @@ -1884,48 +1884,6 @@ int zsock_getsockopt_ctx(struct net_context *ctx, int level, int optname, return ret; } - break; - - case IPPROTO_IP: - switch (optname) { - case IP_TOS: - if (IS_ENABLED(CONFIG_NET_CONTEXT_DSCP_ECN)) { - ret = net_context_get_option(ctx, - NET_OPT_DSCP_ECN, - optval, - optlen); - if (ret < 0) { - errno = -ret; - return -1; - } - - return 0; - } - - break; - } - - break; - - case IPPROTO_IPV6: - switch (optname) { - case IPV6_TCLASS: - if (IS_ENABLED(CONFIG_NET_CONTEXT_DSCP_ECN)) { - ret = net_context_get_option(ctx, - NET_OPT_DSCP_ECN, - optval, - optlen); - if (ret < 0) { - errno = -ret; - return -1; - } - - return 0; - } - - break; - } - break; } @@ -2180,27 +2138,6 @@ int zsock_setsockopt_ctx(struct net_context *ctx, int level, int optname, } break; - case IPPROTO_IP: - switch (optname) { - case IP_TOS: - if (IS_ENABLED(CONFIG_NET_CONTEXT_DSCP_ECN)) { - ret = net_context_set_option(ctx, - NET_OPT_DSCP_ECN, - optval, - optlen); - if (ret < 0) { - errno = -ret; - return -1; - } - - return 0; - } - - break; - } - - break; - case IPPROTO_IPV6: switch (optname) { case IPV6_V6ONLY: @@ -2208,24 +2145,7 @@ int zsock_setsockopt_ctx(struct net_context *ctx, int level, int optname, * existing apps. */ return 0; - - case IPV6_TCLASS: - if (IS_ENABLED(CONFIG_NET_CONTEXT_DSCP_ECN)) { - ret = net_context_set_option(ctx, - NET_OPT_DSCP_ECN, - optval, - optlen); - if (ret < 0) { - errno = -ret; - return -1; - } - - return 0; - } - - break; } - break; } From da53212dd2dc22f2c3a7b005aaad2cfe0af88eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:50:50 +0100 Subject: [PATCH 460/501] Revert "[nrf fromtree] net: sockets: Add missing break statement in setsockopt" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e0f29743e650268cca17c4e68c5d99d7856fabed. Signed-off-by: Tomasz Moń --- subsys/net/lib/sockets/sockets.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c index 04182f4bf68..ab2e54be826 100644 --- a/subsys/net/lib/sockets/sockets.c +++ b/subsys/net/lib/sockets/sockets.c @@ -1874,17 +1874,12 @@ int zsock_getsockopt_ctx(struct net_context *ctx, int level, int optname, } break; } - - break; - case IPPROTO_TCP: switch (optname) { case TCP_NODELAY: ret = net_tcp_get_option(ctx, TCP_OPT_NODELAY, optval, optlen); return ret; } - - break; } errno = ENOPROTOOPT; From 9bb0611098b41f192f0512e4df2aa3bac8240514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:51:02 +0100 Subject: [PATCH 461/501] Revert "[nrf fromtree] net: context: Add DSCP/ECN support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fade63d45218659ecbcf52766b69d714669b9b18. Signed-off-by: Tomasz Moń --- include/zephyr/net/net_context.h | 4 --- subsys/net/ip/Kconfig | 9 ------ subsys/net/ip/net_context.c | 52 -------------------------------- 3 files changed, 65 deletions(-) diff --git a/include/zephyr/net/net_context.h b/include/zephyr/net/net_context.h index 8c18475d37b..69a96fa0b2b 100644 --- a/include/zephyr/net/net_context.h +++ b/include/zephyr/net/net_context.h @@ -318,9 +318,6 @@ __net_socket struct net_context { #endif #if defined(CONFIG_NET_CONTEXT_SNDBUF) uint16_t sndbuf; -#endif -#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) - uint8_t dscp_ecn; #endif } options; @@ -1071,7 +1068,6 @@ enum net_context_option { NET_OPT_SNDTIMEO = 5, NET_OPT_RCVBUF = 6, NET_OPT_SNDBUF = 7, - NET_OPT_DSCP_ECN = 8, }; /** diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index 11aaae35433..44332ca62fa 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -636,15 +636,6 @@ config NET_CONTEXT_SNDBUF For TCP sockets, the sndbuf will determine the total size of queued data in the TCP layer. -config NET_CONTEXT_DSCP_ECN - bool "Add support for setting DSCP/ECN IP properties on net_context" - depends on NET_IP_DSCP_ECN - default y - help - Allow to set Differentiated Services and Explicit Congestion - Notification values on net_context. Those values are then used in - IPv4/IPv6 header when sending packets over net_context. - config NET_TEST bool "Network Testing" help diff --git a/subsys/net/ip/net_context.c b/subsys/net/ip/net_context.c index 4139fa95c65..a952a932935 100644 --- a/subsys/net/ip/net_context.c +++ b/subsys/net/ip/net_context.c @@ -907,10 +907,6 @@ int net_context_create_ipv4_new(struct net_context *context, } net_pkt_set_ipv4_ttl(pkt, net_context_get_ipv4_ttl(context)); -#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) - net_pkt_set_ip_dscp(pkt, net_ipv4_get_dscp(context->options.dscp_ecn)); - net_pkt_set_ip_ecn(pkt, net_ipv4_get_ecn(context->options.dscp_ecn)); -#endif return net_ipv4_create(pkt, src, dst); } @@ -937,10 +933,6 @@ int net_context_create_ipv6_new(struct net_context *context, net_pkt_set_ipv6_hop_limit(pkt, net_context_get_ipv6_hop_limit(context)); -#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) - net_pkt_set_ip_dscp(pkt, net_ipv6_get_dscp(context->options.dscp_ecn)); - net_pkt_set_ip_ecn(pkt, net_ipv6_get_ecn(context->options.dscp_ecn)); -#endif return net_ipv6_create(pkt, src, dst); } @@ -1286,22 +1278,6 @@ static int get_context_sndbuf(struct net_context *context, #endif } -static int get_context_dscp_ecn(struct net_context *context, - void *value, size_t *len) -{ -#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) - *((int *)value) = context->options.dscp_ecn; - - if (len) { - *len = sizeof(int); - } - - return 0; -#else - return -ENOTSUP; -#endif -} - /* If buf is not NULL, then use it. Otherwise read the data to be written * to net_pkt from msghdr. */ @@ -2323,28 +2299,6 @@ static int set_context_sndbuf(struct net_context *context, #endif } -static int set_context_dscp_ecn(struct net_context *context, - const void *value, size_t len) -{ -#if defined(CONFIG_NET_CONTEXT_DSCP_ECN) - int dscp_ecn = *((int *)value); - - if (len != sizeof(int)) { - return -EINVAL; - } - - if ((dscp_ecn < 0) || (dscp_ecn > UINT8_MAX)) { - return -EINVAL; - } - - context->options.dscp_ecn = (uint8_t)dscp_ecn; - - return 0; -#else - return -ENOTSUP; -#endif -} - int net_context_set_option(struct net_context *context, enum net_context_option option, const void *value, size_t len) @@ -2381,9 +2335,6 @@ int net_context_set_option(struct net_context *context, case NET_OPT_SNDBUF: ret = set_context_sndbuf(context, value, len); break; - case NET_OPT_DSCP_ECN: - ret = set_context_dscp_ecn(context, value, len); - break; } k_mutex_unlock(&context->lock); @@ -2427,9 +2378,6 @@ int net_context_get_option(struct net_context *context, case NET_OPT_SNDBUF: ret = get_context_sndbuf(context, value, len); break; - case NET_OPT_DSCP_ECN: - ret = get_context_dscp_ecn(context, value, len); - break; } k_mutex_unlock(&context->lock); From 8f54a264b894d4ece11aa4f6b69dbf6997c2afa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:51:18 +0100 Subject: [PATCH 462/501] Revert "[nrf fromtree] net: ipv6: Add support for setting/reading DSCP/ECN fields (TC)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 50250d901511b654b5e5b17d2e98c3f375fe59ca. Signed-off-by: Tomasz Moń --- subsys/net/ip/ipv6.c | 19 ++-------------- subsys/net/ip/ipv6.h | 53 -------------------------------------------- 2 files changed, 2 insertions(+), 70 deletions(-) diff --git a/subsys/net/ip/ipv6.c b/subsys/net/ip/ipv6.c index 48165099759..1d6857961a2 100644 --- a/subsys/net/ip/ipv6.c +++ b/subsys/net/ip/ipv6.c @@ -56,20 +56,14 @@ int net_ipv6_create(struct net_pkt *pkt, { NET_PKT_DATA_ACCESS_CONTIGUOUS_DEFINE(ipv6_access, struct net_ipv6_hdr); struct net_ipv6_hdr *ipv6_hdr; - uint8_t tc = 0; ipv6_hdr = (struct net_ipv6_hdr *)net_pkt_get_data(pkt, &ipv6_access); if (!ipv6_hdr) { return -ENOBUFS; } - if (IS_ENABLED(CONFIG_NET_IP_DSCP_ECN)) { - net_ipv6_set_dscp(&tc, net_pkt_ip_dscp(pkt)); - net_ipv6_set_ecn(&tc, net_pkt_ip_ecn(pkt)); - } - - ipv6_hdr->vtc = 0x60 | ((tc >> 4) & 0x0F); - ipv6_hdr->tcflow = (tc << 4) & 0xF0; + ipv6_hdr->vtc = 0x60; + ipv6_hdr->tcflow = 0U; ipv6_hdr->flow = 0U; ipv6_hdr->len = 0U; ipv6_hdr->nexthdr = 0U; @@ -504,15 +498,6 @@ enum net_verdict net_ipv6_input(struct net_pkt *pkt, bool is_loopback) } } - /* Reconstruct TC field. */ - - if (IS_ENABLED(CONFIG_NET_IP_DSCP_ECN)) { - uint8_t tc = ((hdr->vtc << 4) & 0xF0) | ((hdr->tcflow >> 4) & 0x0F); - - net_pkt_set_ip_dscp(pkt, net_ipv6_get_dscp(tc)); - net_pkt_set_ip_ecn(pkt, net_ipv6_get_ecn(tc)); - } - /* Check extension headers */ net_pkt_set_ipv6_next_hdr(pkt, hdr->nexthdr); net_pkt_set_ipv6_ext_len(pkt, 0); diff --git a/subsys/net/ip/ipv6.h b/subsys/net/ip/ipv6.h index 80543084744..0441bb7d83d 100644 --- a/subsys/net/ip/ipv6.h +++ b/subsys/net/ip/ipv6.h @@ -30,10 +30,6 @@ #define NET_MAX_RS_COUNT 3 -#define NET_IPV6_DSCP_MASK 0xFC -#define NET_IPV6_DSCP_OFFSET 2 -#define NET_IPV6_ECN_MASK 0x03 - /** * @brief Bitmaps for IPv6 extension header processing * @@ -499,53 +495,4 @@ void net_ipv6_mld_init(void); #define net_ipv6_nbr_init(...) #endif -/** - * @brief Decode DSCP value from TC field. - * - * @param tc TC field value from the IPv6 header. - * - * @return Decoded DSCP value. - */ -static inline uint8_t net_ipv6_get_dscp(uint8_t tc) -{ - return (tc & NET_IPV6_DSCP_MASK) >> NET_IPV6_DSCP_OFFSET; -} - -/** - * @brief Encode DSCP value into TC field. - * - * @param tc A pointer to the TC field. - * @param dscp DSCP value to set. - */ -static inline void net_ipv6_set_dscp(uint8_t *tc, uint8_t dscp) -{ - *tc &= ~NET_IPV6_DSCP_MASK; - *tc |= (dscp << NET_IPV6_DSCP_OFFSET) & NET_IPV6_DSCP_MASK; -} - -/** - * @brief Decode ECN value from TC field. - * - * @param tc TC field value from the IPv6 header. - * - * @return Decoded ECN value. - */ -static inline uint8_t net_ipv6_get_ecn(uint8_t tc) -{ - return tc & NET_IPV6_ECN_MASK; -} - -/** - * @brief Encode ECN value into TC field. - * - * @param tc A pointer to the TC field. - * @param ecn ECN value to set. - */ -static inline void net_ipv6_set_ecn(uint8_t *tc, uint8_t ecn) -{ - *tc &= ~NET_IPV6_ECN_MASK; - *tc |= ecn & NET_IPV6_ECN_MASK; -} - - #endif /* __IPV6_H */ From f7a7f3e30812d0a54f5a87854ffb21f3a0f6ae60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:51:35 +0100 Subject: [PATCH 463/501] Revert "[nrf fromtree] net: ipv4: Add support for setting/reading DSCP/ECN fields (ToS)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b6f4d56fcf067546caae4fb60ed1e36e368bf412. Signed-off-by: Tomasz Moń --- subsys/net/ip/ipv4.c | 14 +----------- subsys/net/ip/ipv4.h | 51 -------------------------------------------- 2 files changed, 1 insertion(+), 64 deletions(-) diff --git a/subsys/net/ip/ipv4.c b/subsys/net/ip/ipv4.c index e0539d23e36..e7c9062fbea 100644 --- a/subsys/net/ip/ipv4.c +++ b/subsys/net/ip/ipv4.c @@ -75,14 +75,7 @@ int net_ipv4_create(struct net_pkt *pkt, const struct in_addr *src, const struct in_addr *dst) { - uint8_t tos = 0; - - if (IS_ENABLED(CONFIG_NET_IP_DSCP_ECN)) { - net_ipv4_set_dscp(&tos, net_pkt_ip_dscp(pkt)); - net_ipv4_set_ecn(&tos, net_pkt_ip_ecn(pkt)); - } - - return net_ipv4_create_full(pkt, src, dst, tos, 0U, 0U, 0U, + return net_ipv4_create_full(pkt, src, dst, 0U, 0U, 0U, 0U, net_pkt_ipv4_ttl(pkt)); } @@ -255,11 +248,6 @@ enum net_verdict net_ipv4_input(struct net_pkt *pkt) net_pkt_set_ip_hdr_len(pkt, sizeof(struct net_ipv4_hdr)); - if (IS_ENABLED(CONFIG_NET_IP_DSCP_ECN)) { - net_pkt_set_ip_dscp(pkt, net_ipv4_get_dscp(hdr->tos)); - net_pkt_set_ip_ecn(pkt, net_ipv4_get_ecn(hdr->tos)); - } - opts_len = hdr_len - sizeof(struct net_ipv4_hdr); if (opts_len > NET_IPV4_HDR_OPTNS_MAX_LEN) { return -EINVAL; diff --git a/subsys/net/ip/ipv4.h b/subsys/net/ip/ipv4.h index f9b28158a73..e53ffab4df8 100644 --- a/subsys/net/ip/ipv4.h +++ b/subsys/net/ip/ipv4.h @@ -21,9 +21,6 @@ #include #define NET_IPV4_IHL_MASK 0x0F -#define NET_IPV4_DSCP_MASK 0xFC -#define NET_IPV4_DSCP_OFFSET 2 -#define NET_IPV4_ECN_MASK 0x03 /* IPv4 Options */ #define NET_IPV4_OPTS_EO 0 /* End of Options */ @@ -207,52 +204,4 @@ static inline int net_ipv4_parse_hdr_options(struct net_pkt *pkt, } #endif -/** - * @brief Decode DSCP value from ToS field. - * - * @param tos ToS field value from the IPv4 header. - * - * @return Decoded DSCP value. - */ -static inline uint8_t net_ipv4_get_dscp(uint8_t tos) -{ - return (tos & NET_IPV4_DSCP_MASK) >> NET_IPV4_DSCP_OFFSET; -} - -/** - * @brief Encode DSCP value into ToS field. - * - * @param tos A pointer to the ToS field. - * @param dscp DSCP value to set. - */ -static inline void net_ipv4_set_dscp(uint8_t *tos, uint8_t dscp) -{ - *tos &= ~NET_IPV4_DSCP_MASK; - *tos |= (dscp << NET_IPV4_DSCP_OFFSET) & NET_IPV4_DSCP_MASK; -} - -/** - * @brief Decode ECN value from ToS field. - * - * @param tos ToS field value from the IPv4 header. - * - * @return Decoded ECN value. - */ -static inline uint8_t net_ipv4_get_ecn(uint8_t tos) -{ - return tos & NET_IPV4_ECN_MASK; -} - -/** - * @brief Encode ECN value into ToS field. - * - * @param tos A pointer to the ToS field. - * @param ecn ECN value to set. - */ -static inline void net_ipv4_set_ecn(uint8_t *tos, uint8_t ecn) -{ - *tos &= ~NET_IPV4_ECN_MASK; - *tos |= ecn & NET_IPV4_ECN_MASK; -} - #endif /* __IPV4_H */ From 34bbb263d45e4d1f87e375371cc92961e9dafe67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:51:51 +0100 Subject: [PATCH 464/501] Revert "[nrf fromtree] net: pkt: Add IP DSCP/ECN information to a packet structure" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5dd2862f8bbd812f7148c486ccfe9b934ceba69d. Signed-off-by: Tomasz Moń --- include/zephyr/net/net_pkt.h | 40 ------------------------------------ subsys/net/ip/Kconfig | 8 -------- subsys/net/ip/net_pkt.c | 2 -- 3 files changed, 50 deletions(-) diff --git a/include/zephyr/net/net_pkt.h b/include/zephyr/net/net_pkt.h index 347e99900c3..d7d6dd70cdb 100644 --- a/include/zephyr/net/net_pkt.h +++ b/include/zephyr/net/net_pkt.h @@ -252,14 +252,6 @@ struct net_pkt { uint8_t ipv6_next_hdr; /* What is the very first next header */ #endif /* CONFIG_NET_IPV6 */ -#if defined(CONFIG_NET_IP_DSCP_ECN) - /** IPv4/IPv6 Differentiated Services Code Point value. */ - uint8_t ip_dscp : 6; - - /** IPv4/IPv6 Explicit Congestion Notification value. */ - uint8_t ip_ecn : 2; -#endif /* CONFIG_NET_IP_DSCP_ECN */ - #if defined(CONFIG_IEEE802154) #if defined(CONFIG_IEEE802154_2015) uint32_t ieee802154_ack_fc; /* Frame counter set in the ACK */ @@ -418,38 +410,6 @@ static inline void net_pkt_set_ip_hdr_len(struct net_pkt *pkt, uint8_t len) #endif } -static inline uint8_t net_pkt_ip_dscp(struct net_pkt *pkt) -{ -#if defined(CONFIG_NET_IP_DSCP_ECN) - return pkt->ip_dscp; -#else - return 0; -#endif -} - -static inline void net_pkt_set_ip_dscp(struct net_pkt *pkt, uint8_t dscp) -{ -#if defined(CONFIG_NET_IP_DSCP_ECN) - pkt->ip_dscp = dscp; -#endif -} - -static inline uint8_t net_pkt_ip_ecn(struct net_pkt *pkt) -{ -#if defined(CONFIG_NET_IP_DSCP_ECN) - return pkt->ip_ecn; -#else - return 0; -#endif -} - -static inline void net_pkt_set_ip_ecn(struct net_pkt *pkt, uint8_t ecn) -{ -#if defined(CONFIG_NET_IP_DSCP_ECN) - pkt->ip_ecn = ecn; -#endif -} - static inline uint8_t net_pkt_sent(struct net_pkt *pkt) { return pkt->sent_or_eof; diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index 44332ca62fa..596011687f2 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -122,14 +122,6 @@ config NET_INIT_PRIO Network initialization priority level. This number tells how early in the boot the network stack is initialized. -config NET_IP_DSCP_ECN - bool "DSCP/ECN processing at IP layer" - depends on NET_IP - default y - help - Specify whether DSCP/ECN values are processed at IP layer. The values - are encoded within ToS field in IPv4 and TC field in IPv6. - source "subsys/net/ip/Kconfig.ipv6" source "subsys/net/ip/Kconfig.ipv4" diff --git a/subsys/net/ip/net_pkt.c b/subsys/net/ip/net_pkt.c index 28d3bf9aded..f3298466177 100644 --- a/subsys/net/ip/net_pkt.c +++ b/subsys/net/ip/net_pkt.c @@ -1768,8 +1768,6 @@ static void clone_pkt_attributes(struct net_pkt *pkt, struct net_pkt *clone_pkt) net_pkt_set_family(clone_pkt, net_pkt_family(pkt)); net_pkt_set_context(clone_pkt, net_pkt_context(pkt)); net_pkt_set_ip_hdr_len(clone_pkt, net_pkt_ip_hdr_len(pkt)); - net_pkt_set_ip_dscp(clone_pkt, net_pkt_ip_dscp(pkt)); - net_pkt_set_ip_ecn(clone_pkt, net_pkt_ip_ecn(pkt)); net_pkt_set_vlan_tag(clone_pkt, net_pkt_vlan_tag(pkt)); net_pkt_set_timestamp(clone_pkt, net_pkt_timestamp(pkt)); net_pkt_set_priority(clone_pkt, net_pkt_priority(pkt)); From d6dfa7222ac7ca7d90ded62c54cae8a0af5c7d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:53:02 +0100 Subject: [PATCH 465/501] Revert "[nrf fromtree] net: ip: Speed up the IP/UDP/TCP checksum calculation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3a27f80f6bed48c5a742f29aafd6c17cf2b18e81. Signed-off-by: Tomasz Moń --- subsys/net/ip/net_private.h | 1 - subsys/net/ip/utils.c | 106 ++++++------------------------------ 2 files changed, 18 insertions(+), 89 deletions(-) diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 30d3a94dc48..affb1575f5b 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -143,7 +143,6 @@ extern const char *net_proto2str(int family, int proto); extern char *net_byte_to_hex(char *ptr, uint8_t byte, char base, bool pad); extern char *net_sprint_ll_addr_buf(const uint8_t *ll, uint8_t ll_len, char *buf, int buflen); -extern uint16_t calc_chksum(uint16_t sum_in, const uint8_t *data, size_t len); extern uint16_t net_calc_chksum(struct net_pkt *pkt, uint8_t proto); /** diff --git a/subsys/net/ip/utils.c b/subsys/net/ip/utils.c index 40e6e019f22..dbff0964052 100644 --- a/subsys/net/ip/utils.c +++ b/subsys/net/ip/utils.c @@ -20,7 +20,6 @@ LOG_MODULE_REGISTER(net_utils, CONFIG_NET_UTILS_LOG_LEVEL); #include #include -#include #include #include #include @@ -487,101 +486,32 @@ int z_vrfy_net_addr_pton(sa_family_t family, const char *src, #include #endif /* CONFIG_USERSPACE */ - -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -#define CHECKSUM_BIG_ENDIAN 0 -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define CHECKSUM_BIG_ENDIAN 1 -#else -#error "Unknown byte order" -#endif - -static uint16_t offset_based_swap8(const uint8_t *data) -{ - uint16_t data16 = (uint16_t)*data; - - if (((uintptr_t)(data) & 1) == CHECKSUM_BIG_ENDIAN) { - return data16; - } else { - return data16 << 8; - } -} - -/* Word based checksum calculation based on: - * https://blogs.igalia.com/dpino/2018/06/14/fast-checksum-computation/ - * It’s not necessary to add octets as 16-bit words. Due to the associative property of addition, - * it is possible to do parallel addition using larger word sizes such as 32-bit or 64-bit words. - * In those cases the variable that stores the accumulative sum has to be bigger too. - * Once the sum is computed a final step folds the sum to a 16-bit word (adding carry if any). - */ -uint16_t calc_chksum(uint16_t sum_in, const uint8_t *data, size_t len) +static uint16_t calc_chksum(uint16_t sum, const uint8_t *data, size_t len) { - uint64_t sum; - uint32_t *p; - size_t i = 0; - size_t pending = len; - int odd_start = ((uintptr_t)data & 0x01); - - /* Sum in is in host endiannes, working order endiannes is both dependent on endianness - * and the offset of starting - */ - if (odd_start == CHECKSUM_BIG_ENDIAN) { - sum = __bswap_16(sum_in); - } else { - sum = sum_in; - } + const uint8_t *end; + uint16_t tmp; - /* Process up to 3 data elements up front, so the data is aligned further down the line */ - if ((((uintptr_t)data & 0x01) != 0) && (pending >= 1)) { - sum += offset_based_swap8(data); - data++; - pending--; - } - if ((((uintptr_t)data & 0x02) != 0) && (pending >= sizeof(uint16_t))) { - pending -= sizeof(uint16_t); - sum = sum + *((uint16_t *)data); - data += sizeof(uint16_t); - } - p = (uint32_t *)data; + end = data + len - 1; - /* Do loop unrolling for the very large data sets */ - while (pending >= sizeof(uint32_t) * 4) { - uint64_t sum_a = p[i]; - uint64_t sum_b = p[i + 1]; + while (data < end) { + tmp = (data[0] << 8) + data[1]; + sum += tmp; + if (sum < tmp) { + sum++; + } - pending -= sizeof(uint32_t) * 4; - sum_a += p[i + 2]; - sum_b += p[i + 3]; - i += 4; - sum += sum_a + sum_b; - } - while (pending >= sizeof(uint32_t)) { - pending -= sizeof(uint32_t); - sum = sum + p[i++]; - } - data = (uint8_t *)(p + i); - if (pending >= 2) { - pending -= sizeof(uint16_t); - sum = sum + *((uint16_t *)data); - data += sizeof(uint16_t); - } - if (pending == 1) { - sum += offset_based_swap8(data); + data += 2; } - /* Fold sum into 16-bit word. */ - while (sum >> 16) { - sum = (sum & 0xffff) + (sum >> 16); + if (data == end) { + tmp = data[0] << 8; + sum += tmp; + if (sum < tmp) { + sum++; + } } - /* Sum in is in host endiannes, working order endiannes is both dependent on endianness - * and the offset of starting - */ - if (odd_start == CHECKSUM_BIG_ENDIAN) { - return __bswap_16((uint16_t)sum); - } else { - return sum; - } + return sum; } static inline uint16_t pkt_calc_chksum(struct net_pkt *pkt, uint16_t sum) From 116a3028630ddea814494fe5be989a3d48c667ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:53:19 +0100 Subject: [PATCH 466/501] Revert "[nrf fromtree] net: lwm2m: use zsock_ functions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 554f66b4f86bbadd36c87f64973fac61c80e66e0. Signed-off-by: Tomasz Moń --- subsys/net/lib/lwm2m/Kconfig | 1 + subsys/net/lib/lwm2m/lwm2m_engine.c | 48 +++++++++---------- subsys/net/lib/lwm2m/lwm2m_message_handling.c | 8 ++-- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/subsys/net/lib/lwm2m/Kconfig b/subsys/net/lib/lwm2m/Kconfig index e76a715ca38..6cd008470b1 100644 --- a/subsys/net/lib/lwm2m/Kconfig +++ b/subsys/net/lib/lwm2m/Kconfig @@ -6,6 +6,7 @@ menuconfig LWM2M select COAP select HTTP_PARSER_URL select NET_SOCKETS + select NET_SOCKETS_POSIX_NAMES help This option adds logic for managing OMA LWM2M data diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index b333c4bdcc3..554750dd67f 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -100,7 +100,7 @@ static struct k_thread engine_thread_data; #define MAX_POLL_FD CONFIG_NET_SOCKETS_POLL_MAX /* Resources */ -static struct zsock_pollfd sock_fds[MAX_POLL_FD]; +static struct pollfd sock_fds[MAX_POLL_FD]; static struct lwm2m_ctx *sock_ctx[MAX_POLL_FD]; static int sock_nfds; @@ -173,12 +173,11 @@ int lwm2m_open_socket(struct lwm2m_ctx *client_ctx) /* open socket */ if (IS_ENABLED(CONFIG_LWM2M_DTLS_SUPPORT) && client_ctx->use_dtls) { - client_ctx->sock_fd = zsock_socket(client_ctx->remote_addr.sa_family, - SOCK_DGRAM, IPPROTO_DTLS_1_2); + client_ctx->sock_fd = socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, + IPPROTO_DTLS_1_2); } else { client_ctx->sock_fd = - zsock_socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, - IPPROTO_UDP); + socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, IPPROTO_UDP); } if (client_ctx->sock_fd < 0) { @@ -199,7 +198,7 @@ int lwm2m_close_socket(struct lwm2m_ctx *client_ctx) int ret = 0; if (client_ctx->sock_fd >= 0) { - ret = zsock_close(client_ctx->sock_fd); + ret = close(client_ctx->sock_fd); if (ret) { LOG_ERR("Failed to close socket: %d", errno); ret = -errno; @@ -528,7 +527,7 @@ int lwm2m_socket_add(struct lwm2m_ctx *ctx) sock_ctx[sock_nfds] = ctx; sock_fds[sock_nfds].fd = ctx->sock_fd; - sock_fds[sock_nfds].events = ZSOCK_POLLIN; + sock_fds[sock_nfds].events = POLLIN; sock_nfds++; return 0; @@ -609,8 +608,8 @@ static int socket_recv_message(struct lwm2m_ctx *client_ctx) static struct sockaddr from_addr; from_addr_len = sizeof(from_addr); - len = zsock_recvfrom(client_ctx->sock_fd, in_buf, sizeof(in_buf) - 1, 0, &from_addr, - &from_addr_len); + len = recvfrom(client_ctx->sock_fd, in_buf, sizeof(in_buf) - 1, 0, &from_addr, + &from_addr_len); if (len < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) { @@ -651,8 +650,7 @@ static void socket_reset_pollfd_events(void) { for (int i = 0; i < sock_nfds; ++i) { sock_fds[i].events = - ZSOCK_POLLIN | - (sys_slist_is_empty(&sock_ctx[i]->pending_sends) ? 0 : ZSOCK_POLLOUT); + POLLIN | (sys_slist_is_empty(&sock_ctx[i]->pending_sends) ? 0 : POLLOUT); sock_fds[i].revents = 0; } } @@ -707,7 +705,7 @@ static void socket_loop(void) * FIXME: Currently we timeout and restart poll in case fds * were modified. */ - rc = zsock_poll(sock_fds, sock_nfds, timeout); + rc = poll(sock_fds, sock_nfds, timeout); if (rc < 0) { LOG_ERR("Error in poll:%d", errno); errno = 0; @@ -721,9 +719,8 @@ static void socket_loop(void) continue; } - if ((sock_fds[i].revents & ZSOCK_POLLERR) || - (sock_fds[i].revents & ZSOCK_POLLNVAL) || - (sock_fds[i].revents & ZSOCK_POLLHUP)) { + if ((sock_fds[i].revents & POLLERR) || (sock_fds[i].revents & POLLNVAL) || + (sock_fds[i].revents & POLLHUP)) { LOG_ERR("Poll reported a socket error, %02x.", sock_fds[i].revents); if (sock_ctx[i] != NULL && sock_ctx[i]->fault_cb != NULL) { sock_ctx[i]->fault_cb(EIO); @@ -731,7 +728,7 @@ static void socket_loop(void) continue; } - if (sock_fds[i].revents & ZSOCK_POLLIN) { + if (sock_fds[i].revents & POLLIN) { while (sock_ctx[i]) { rc = socket_recv_message(sock_ctx[i]); if (rc) { @@ -740,7 +737,7 @@ static void socket_loop(void) } } - if (sock_fds[i].revents & ZSOCK_POLLOUT) { + if (sock_fds[i].revents & POLLOUT) { socket_send_message(sock_ctx[i]); } } @@ -826,8 +823,8 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) client_ctx->tls_tag, }; - ret = zsock_setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_SEC_TAG_LIST, tls_tag_list, - sizeof(tls_tag_list)); + ret = setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_SEC_TAG_LIST, tls_tag_list, + sizeof(tls_tag_list)); if (ret < 0) { ret = -errno; LOG_ERR("Failed to set TLS_SEC_TAG_LIST option: %d", ret); @@ -837,8 +834,8 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) if (IS_ENABLED(CONFIG_LWM2M_TLS_SESSION_CACHING)) { int session_cache = TLS_SESSION_CACHE_ENABLED; - ret = zsock_setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_SESSION_CACHE, - &session_cache, sizeof(session_cache)); + ret = setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_SESSION_CACHE, + &session_cache, sizeof(session_cache)); if (ret < 0) { ret = -errno; LOG_ERR("Failed to set TLS_SESSION_CACHE option: %d", errno); @@ -854,9 +851,8 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) client_ctx->desthostname[client_ctx->desthostnamelen] = '\0'; /** mbedtls ignores length */ - ret = zsock_setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_HOSTNAME, - client_ctx->desthostname, - client_ctx->desthostnamelen); + ret = setsockopt(client_ctx->sock_fd, SOL_TLS, TLS_HOSTNAME, + client_ctx->desthostname, client_ctx->desthostnamelen); /** restore character */ client_ctx->desthostname[client_ctx->desthostnamelen] = tmp; @@ -877,7 +873,7 @@ int lwm2m_socket_start(struct lwm2m_ctx *client_ctx) return -EPROTONOSUPPORT; } - if (zsock_connect(client_ctx->sock_fd, &client_ctx->remote_addr, addr_len) < 0) { + if (connect(client_ctx->sock_fd, &client_ctx->remote_addr, addr_len) < 0) { ret = -errno; LOG_ERR("Cannot connect UDP (%d)", ret); goto error; @@ -910,7 +906,7 @@ int lwm2m_socket_close(struct lwm2m_ctx *client_ctx) lwm2m_socket_del(client_ctx); client_ctx->sock_fd = -1; if (sock_fd >= 0) { - return zsock_close(sock_fd); + return close(sock_fd); } return 0; diff --git a/subsys/net/lib/lwm2m/lwm2m_message_handling.c b/subsys/net/lib/lwm2m/lwm2m_message_handling.c index 7ef9f2a6d54..a18d0b4262f 100644 --- a/subsys/net/lib/lwm2m/lwm2m_message_handling.c +++ b/subsys/net/lib/lwm2m/lwm2m_message_handling.c @@ -447,7 +447,7 @@ int lwm2m_send_message(struct lwm2m_message *msg) coap_pending_cycle(msg->pending); } - rc = zsock_send(msg->ctx->sock_fd, msg->cpkt.data, msg->cpkt.offset, 0); + rc = send(msg->ctx->sock_fd, msg->cpkt.data, msg->cpkt.offset, 0); if (rc < 0) { LOG_ERR("Failed to send packet, err %d", errno); @@ -2568,7 +2568,7 @@ int lwm2m_parse_peerinfo(char *url, struct lwm2m_ctx *client_ctx, bool is_firmwa { struct http_parser_url parser; #if defined(CONFIG_LWM2M_DNS_SUPPORT) - struct zsock_addrinfo *res, hints = {0}; + struct addrinfo *res, hints = {0}; #endif int ret; uint16_t off, len; @@ -2653,7 +2653,7 @@ int lwm2m_parse_peerinfo(char *url, struct lwm2m_ctx *client_ctx, bool is_firmwa hints.ai_family = AF_UNSPEC; #endif /* defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV4) */ hints.ai_socktype = SOCK_DGRAM; - ret = zsock_getaddrinfo(url + off, NULL, &hints, &res); + ret = getaddrinfo(url + off, NULL, &hints, &res); if (ret != 0) { LOG_ERR("Unable to resolve address"); /* DNS error codes don't align with normal errors */ @@ -2663,7 +2663,7 @@ int lwm2m_parse_peerinfo(char *url, struct lwm2m_ctx *client_ctx, bool is_firmwa memcpy(&client_ctx->remote_addr, res->ai_addr, sizeof(client_ctx->remote_addr)); client_ctx->remote_addr.sa_family = res->ai_family; - zsock_freeaddrinfo(res); + freeaddrinfo(res); #else goto cleanup; #endif /* CONFIG_LWM2M_DNS_SUPPORT */ From 3b466bd3d80939b64a3db799b86022e3f9223290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:53:31 +0100 Subject: [PATCH 467/501] Revert "[nrf fromtree] tfm: Add option to enable the SFN model" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c5340c156e0ce042b21ae716906b2746a7835343. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 13 ++--- modules/trusted-firmware-m/Kconfig.tfm | 48 +++---------------- .../trusted-firmware-m/Kconfig.tfm.partitions | 9 +--- 3 files changed, 12 insertions(+), 58 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 9cb7f6967bc..36e36c9f841 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -31,17 +31,12 @@ set(TFM_CRYPTO_MODULES if (CONFIG_BUILD_WITH_TFM) - if (CONFIG_TFM_LIBRARY) - list(APPEND TFM_CMAKE_ARGS -DTFM_LIB_MODEL=ON) - else() + if (CONFIG_TFM_IPC) list(APPEND TFM_CMAKE_ARGS -DTFM_LIB_MODEL=OFF) # PSA API awareness for the Non-Secure application target_compile_definitions(app PRIVATE "TFM_PSA_API") - if (CONFIG_TFM_SFN) - list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="SFN") - else() # CONFIG_TFM_IPC - list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="IPC") - endif() + else() + list(APPEND TFM_CMAKE_ARGS -DTFM_LIB_MODEL=ON) endif() if (CONFIG_TFM_REGRESSION_S) list(APPEND TFM_CMAKE_ARGS -DTEST_S=ON) @@ -377,7 +372,7 @@ if (CONFIG_BUILD_WITH_TFM) endif() if(NOT CONFIG_TFM_BUILD_NS) - if(CONFIG_TFM_IPC OR CONFIG_TFM_SFN) + if(CONFIG_TFM_IPC) zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_ipc_api.c) zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_ipc_api.c) zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_ipc_api.c) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 39d42625c32..eeb5cdef00f 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -276,50 +276,14 @@ config TFM_MCUBOOT_DATA_SHARING endif # TFM_BL2 -choice TFM_MODEL - prompt "TF-M Firmware Framework model" - default TFM_IPC - help - The Firmware Framework M (FF-M) provides different programming models - for Secure Partitions. - -config TFM_LIBRARY - bool "Library Model" - help - Use the library model instead of PSA API. - - The library model conforms to the PSA Firmware Framework for M (FF-M) - v1.0. - - NOTE: The Library Model will be removed and replaced by the SFN model. - config TFM_IPC - bool "IPC Model" + bool "IPC" if TFM_PROFILE_TYPE_NOT_SET + default y if (TFM_PROFILE_TYPE_MEDIUM || TFM_PROFILE_TYPE_LARGE) help - Use the IPC Model as the SPM backend for the PSA API. - The IPC model supports the IPC and SFN Partition models, and - isolation levels 1, 2 and 3. - - In this model each Secure Partition processes signals in any order, - and can defer responding to a message while continuing to process - other signals. - - The IPC model conforms to the PSA Firmware Framework for M (FF-M) - v1.1. - -config TFM_SFN - bool "SFN model" - help - Use the SFN Model as the SPM backend for the PSA API. - The SFN model supports the SFN Partition model, and isolation level 1. - - In this model each Secure Partition is made up of a collection of - callback functions which implement secure services. - - The SFN model conforms to the PSA Firmware Framework for M (FF-M) - v1.1. - -endchoice # TFM_MODEL + When enabled, this option signifies that the TF-M build supports + the PSA API (IPC mode) instead of the secure library mode. When + TF-M Profile option is supplied, do not allow manual setting of + the IPC mode, as it is determined by the profile setting. config TFM_REGRESSION_S bool "TF-M Secure Regression tests" diff --git a/modules/trusted-firmware-m/Kconfig.tfm.partitions b/modules/trusted-firmware-m/Kconfig.tfm.partitions index 4e223416c50..4eddc50a042 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.partitions +++ b/modules/trusted-firmware-m/Kconfig.tfm.partitions @@ -7,9 +7,6 @@ if BUILD_WITH_TFM config TFM_PARTITION_PROTECTED_STORAGE bool "Secure partition 'Protected Storage'" - depends on TFM_PARTITION_PLATFORM # Specfically TFM_SP_PLATFORM_NV_COUNTER service - depends on TFM_PARTITION_INTERNAL_TRUSTED_STORAGE - depends on TFM_PARTITION_CRYPTO default y help Setting this option will cause '-DTFM_PARTITION_PROTECTED_STORAGE' @@ -43,7 +40,6 @@ config TFM_PARTITION_CRYPTO config TFM_PARTITION_INITIAL_ATTESTATION bool "Secure partition 'Initial Attestation'" - depends on TFM_PARTITION_CRYPTO default y help Setting this option will cause '-DTFM_PARTITION_INITIAL_ATTESTATION' @@ -56,7 +52,6 @@ config TFM_PARTITION_INITIAL_ATTESTATION config TFM_PARTITION_PLATFORM bool "Secure partition 'Platform'" default y - depends on !TFM_SFN # Currently using PSA Framework version 1.0 help Setting this option will cause '-DTFM_PARTITION_PLATFORM' to be passed to the TF-M build system. Look at 'config_default.cmake' @@ -66,8 +61,8 @@ config TFM_PARTITION_PLATFORM repository. config TFM_PARTITION_AUDIT_LOG - bool "Secure partition 'Audit Log'" - depends on TFM_LIBRARY + bool "Secure partition 'Audit Log'" if !TFM_IPC + depends on !TFM_IPC default y help Setting this option will cause '-DTFM_PARTITION_AUDIT_LOG' From 3171be1fd8d9ce5481e825f509d95deb1b302463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:53:46 +0100 Subject: [PATCH 468/501] Revert "[nrf fromtree] soc: nordic_nrf: Allow building with TF-M without platform partition" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8a42298a52a855b3e977484230f253ec4e9db9cc. Signed-off-by: Tomasz Moń --- soc/arm/nordic_nrf/Kconfig | 2 +- soc/arm/nordic_nrf/common/CMakeLists.txt | 2 +- soc/arm/nordic_nrf/nrf53/Kconfig.soc | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/soc/arm/nordic_nrf/Kconfig b/soc/arm/nordic_nrf/Kconfig index 555043fdf6c..aefe8ea0061 100644 --- a/soc/arm/nordic_nrf/Kconfig +++ b/soc/arm/nordic_nrf/Kconfig @@ -17,7 +17,7 @@ source "soc/arm/nordic_nrf/Kconfig.peripherals" source "soc/arm/nordic_nrf/*/Kconfig.soc" config NRF_SOC_SECURE_SUPPORTED - def_bool !TRUSTED_EXECUTION_NONSECURE || (BUILD_WITH_TFM && TFM_PARTITION_PLATFORM) + def_bool !TRUSTED_EXECUTION_NONSECURE || BUILD_WITH_TFM help Hidden function to indicate that that the soc_secure functions are available. diff --git a/soc/arm/nordic_nrf/common/CMakeLists.txt b/soc/arm/nordic_nrf/common/CMakeLists.txt index 941ccaea039..3b7dff509a6 100644 --- a/soc/arm/nordic_nrf/common/CMakeLists.txt +++ b/soc/arm/nordic_nrf/common/CMakeLists.txt @@ -4,7 +4,7 @@ zephyr_library_sources_ifdef(CONFIG_SOC_FAMILY_NRF soc_nrf_common.S) zephyr_include_directories(.) -if (CONFIG_TFM_PARTITION_PLATFORM) +if (CONFIG_BUILD_WITH_TFM) zephyr_sources(soc_secure.c) zephyr_library_include_directories( $/install/interface/include diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index 370fc735a5d..97f307a1c14 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -100,7 +100,6 @@ config SOC_HFXO_CAP_EXTERNAL config SOC_HFXO_CAP_INTERNAL bool "Use internal load capacitors" - depends on NRF_SOC_SECURE_SUPPORTED endchoice From 5b5c00c8fc74688ec788f8ca7b66ea8de0f7f42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:53:59 +0100 Subject: [PATCH 469/501] Revert "[nrf fromtree] soc: nrf5340: Produce a Kconfig error when GPIO cannot be forwarded" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 95223721696ff4df5eb3cede605fd2cc16ba65d0. Signed-off-by: Tomasz Moń --- boards/arm/bl5340_dvk/Kconfig | 2 -- boards/arm/nrf5340dk_nrf5340/Kconfig | 2 -- boards/arm/thingy53_nrf5340/Kconfig | 2 -- soc/arm/nordic_nrf/nrf53/Kconfig.soc | 6 ------ soc/arm/nordic_nrf/nrf53/soc.c | 10 ++++++++-- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/boards/arm/bl5340_dvk/Kconfig b/boards/arm/bl5340_dvk/Kconfig index 473fceba7e3..856e6a9d60b 100644 --- a/boards/arm/bl5340_dvk/Kconfig +++ b/boards/arm/bl5340_dvk/Kconfig @@ -39,8 +39,6 @@ config BT_HCI_VS config BOARD_ENABLE_CPUNET bool "NRF53 Network MCU" - select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ - $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) help This option enables releasing the Network 'force off' signal, which as a consequence will power up the Network MCU during system boot. diff --git a/boards/arm/nrf5340dk_nrf5340/Kconfig b/boards/arm/nrf5340dk_nrf5340/Kconfig index 85190d7c890..170b13d88be 100644 --- a/boards/arm/nrf5340dk_nrf5340/Kconfig +++ b/boards/arm/nrf5340dk_nrf5340/Kconfig @@ -22,8 +22,6 @@ config BOARD_ENABLE_DCDC_HV config BOARD_ENABLE_CPUNET bool "NRF53 Network MCU" - select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ - $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) help This option enables releasing the Network 'force off' signal, which as a consequence will power up the Network MCU during system boot. diff --git a/boards/arm/thingy53_nrf5340/Kconfig b/boards/arm/thingy53_nrf5340/Kconfig index e8761b1667d..5ec954d5fbf 100644 --- a/boards/arm/thingy53_nrf5340/Kconfig +++ b/boards/arm/thingy53_nrf5340/Kconfig @@ -34,8 +34,6 @@ config BOARD_ENABLE_DCDC_HV config BOARD_ENABLE_CPUNET bool "NRF53 Network MCU" - select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ - $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) help This option enables releasing the Network 'force off' signal, which as a consequence will power up the Network MCU during system boot. diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index 97f307a1c14..a27f807ee2e 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -45,12 +45,6 @@ config SOC_DCDC_NRF53X_HV help Enable nRF53 series System on Chip High Voltage DC/DC converter. -config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 - bool - depends on NRF_SOC_SECURE_SUPPORTED - help - hidden option for including the nRF GPIO pin forwarding - if !TRUSTED_EXECUTION_NONSECURE || BUILD_WITH_TFM config SOC_ENABLE_LFXO diff --git a/soc/arm/nordic_nrf/nrf53/soc.c b/soc/arm/nordic_nrf/nrf53/soc.c index be318ca8fa4..28fdd56a343 100644 --- a/soc/arm/nordic_nrf/nrf53/soc.c +++ b/soc/arm/nordic_nrf/nrf53/soc.c @@ -51,7 +51,13 @@ extern void z_arm_nmi_init(void); #error "Unknown nRF53 SoC." #endif -#if defined(CONFIG_SOC_NRF_GPIO_FORWARDER_FOR_NRF5340) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_gpio_forwarder) && \ + defined(CONFIG_BOARD_ENABLE_CPUNET) && \ + (!defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM)) +#define NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED +#endif + +#if defined(NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED) #define GPIOS_PSEL_BY_IDX(node_id, prop, idx) \ NRF_DT_GPIOS_TO_PSEL_BY_IDX(node_id, prop, idx), #define ALL_GPIOS_IN_NODE(node_id) \ @@ -163,7 +169,7 @@ static int nordicsemi_nrf53_init(const struct device *arg) nrf_regulators_dcdcen_vddh_set(NRF_REGULATORS, true); #endif -#if defined(CONFIG_SOC_NRF_GPIO_FORWARDER_FOR_NRF5340) +#if defined(NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED) static const uint8_t forwarded_psels[] = { DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio_forwarder, ALL_GPIOS_IN_FORWARDER) }; From 882388e5e2fbe3de633656a9178d6dc583fcc3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:54:41 +0100 Subject: [PATCH 470/501] Revert "[nrf fromtree] net: ip: mgmt: Log the event ID for dropped events" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0d30e42aa5ac675328ff372b7095ab2bcb2e5cef. Signed-off-by: Tomasz Moń --- subsys/net/ip/net_mgmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/net/ip/net_mgmt.c b/subsys/net/ip/net_mgmt.c index 956ecf27064..9b0ad458cd4 100644 --- a/subsys/net/ip/net_mgmt.c +++ b/subsys/net/ip/net_mgmt.c @@ -67,8 +67,8 @@ static inline void mgmt_push_event(uint32_t mgmt_event, struct net_if *iface, memcpy(events[i_idx].info, info, length); events[i_idx].info_length = length; } else { - NET_ERR("Event %u info length %zu > max size %zu", - mgmt_event, length, NET_EVENT_INFO_MAX_SIZE); + NET_ERR("Event info length %zu > max size %zu", + length, NET_EVENT_INFO_MAX_SIZE); (void)k_mutex_unlock(&net_mgmt_lock); return; From f25a404c602416d6225a1791990d8e7ea90397fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:58:44 +0100 Subject: [PATCH 471/501] Revert "[nrf fromtree] net: ip: mgmt: Fix the maximum event size calculation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 25352c55758e25eb00903df10d8ec2b964984461. Signed-off-by: Tomasz Moń --- subsys/net/ip/net_private.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index affb1575f5b..5f1a00975ab 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -19,28 +19,27 @@ #include -/* For struct wifi_scan_result */ -#include +/* Maximum size of "struct net_event_ipv6_addr" or + * "struct net_event_ipv6_nbr" or "struct net_event_ipv6_route". + * NOTE: Update comments here and calculate which struct occupies max size. + */ -#define DEFAULT_NET_EVENT_INFO_SIZE 32 -/* NOTE: Update this union with all *big* event info structs */ -union net_mgmt_events { -#if defined(CONFIG_NET_DHCPV4) - struct net_if_dhcpv4 dhcpv4; -#endif /* CONFIG_NET_DHCPV4 */ #if defined(CONFIG_NET_L2_WIFI_MGMT) - struct wifi_scan_result wifi_scan_result; -#endif /* CONFIG_NET_L2_WIFI_MGMT */ -#if defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV6_MLD) - struct net_event_ipv6_route ipv6_route; -#endif /* CONFIG_NET_IPV6 && CONFIG_NET_IPV6_MLD */ - char default_event[DEFAULT_NET_EVENT_INFO_SIZE]; -}; -#define NET_EVENT_INFO_MAX_SIZE sizeof(union net_mgmt_events) +#include +#define NET_EVENT_INFO_MAX_SIZE sizeof(struct wifi_scan_result) +#else + +#if defined(CONFIG_NET_DHCPV4) +#define NET_EVENT_INFO_MAX_SIZE sizeof(struct net_if_dhcpv4) +#else +#define NET_EVENT_INFO_MAX_SIZE sizeof(struct net_event_ipv6_route) #endif +#endif /* CONFIG_NET_L2_WIFI_MGMT */ +#endif /* CONFIG_NET_MGMT_EVENT_INFO */ + #include "connection.h" extern void net_if_init(void); From 4b2cdfffa0c533c24d6017da3e51573a06c00c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:59:00 +0100 Subject: [PATCH 472/501] Revert "[nrf fromtree] mgmt/mcumgr: Drop empty parameter from img_mgmt_flash_check_empty" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d9f99ed1951a973c691cd5d6bd70aecb597b2030. Signed-off-by: Tomasz Moń --- .../lib/cmd/img_mgmt/src/zephyr_img_mgmt.c | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/zephyr_img_mgmt.c b/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/zephyr_img_mgmt.c index fc2c25f7fec..424390318e1 100644 --- a/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/zephyr_img_mgmt.c +++ b/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/zephyr_img_mgmt.c @@ -54,12 +54,8 @@ zephyr_img_mgmt_slot_to_image(int slot) /** * Determines if the specified area of flash is completely unwritten. - * - * @param fa pointer to flash area to scan - * - * @return 0 when not empty, 1 when empty, negative errno code on error. */ -static int img_mgmt_flash_check_empty_inner(const struct flash_area *fa) +static int img_mgmt_flash_check_empty_inner(const struct flash_area *fa, bool *out_empty) { uint32_t data[16]; off_t addr; @@ -84,39 +80,38 @@ static int img_mgmt_flash_check_empty_inner(const struct flash_area *fa) } rc = flash_area_read(fa, addr, data, bytes_to_read); - if (rc < 0) { - return rc; + if (rc != 0) { + return MGMT_ERR_EUNKNOWN; } for (i = 0; i < bytes_to_read / 4; i++) { if (data[i] != erased_val_32) { + *out_empty = false; return 0; } } } - return 1; + *out_empty = true; + + return 0; } #ifndef CONFIG_IMG_ERASE_PROGRESSIVELY -/* Check if area is empty - * - * @param fa_id ID of flash area to scan. - * - * @return 0 when not empty, 1 when empty, negative errno code on error. - */ -static int img_mgmt_flash_check_empty(uint8_t fa_id) +static int img_mgmt_flash_check_empty(uint8_t fa_id, bool *out_empty) { const struct flash_area *fa; int rc; rc = flash_area_open(fa_id, &fa); - if (rc == 0) { - rc = img_mgmt_flash_check_empty_inner(fa); - - flash_area_close(fa); + if (rc != 0) { + return MGMT_ERR_EUNKNOWN; } + rc = img_mgmt_flash_check_empty_inner(fa, out_empty); + + flash_area_close(fa); + return rc; } #endif @@ -264,6 +259,7 @@ img_mgmt_impl_erase_slot(int slot) const struct flash_area *fa; int rc; int area_id = zephyr_img_mgmt_flash_area_id(slot); + bool empty; if (area_id < 0) { return MGMT_ERR_EUNKNOWN; @@ -271,19 +267,19 @@ img_mgmt_impl_erase_slot(int slot) rc = flash_area_open(area_id, &fa); - if (rc < 0) { + if (rc != 0) { return MGMT_ERR_EUNKNOWN; } - rc = img_mgmt_flash_check_empty_inner(fa); + rc = img_mgmt_flash_check_empty_inner(fa, &empty); - if (rc == 0) { + if (!empty && rc == 0) { rc = flash_area_erase(fa, 0, fa->fa_size); } flash_area_close(fa); - return (rc >= 0 ? MGMT_ERR_EOK : MGMT_ERR_EUNKNOWN); + return (rc == 0 ? MGMT_ERR_EOK : MGMT_ERR_EUNKNOWN); } int @@ -533,6 +529,9 @@ img_mgmt_impl_upload_inspect(const struct img_mgmt_upload_req *req, const struct image_header *hdr; struct image_version cur_ver; int rc; +#ifndef CONFIG_IMG_ERASE_PROGRESSIVELY + bool empty; +#endif memset(action, 0, sizeof(*action)); @@ -626,12 +625,12 @@ img_mgmt_impl_upload_inspect(const struct img_mgmt_upload_req *req, } #ifndef CONFIG_IMG_ERASE_PROGRESSIVELY - rc = img_mgmt_flash_check_empty(action->area_id); - if (rc < 0) { + rc = img_mgmt_flash_check_empty(action->area_id, &empty); + if (rc) { return MGMT_ERR_EUNKNOWN; } - action->erase = (rc == 0); + action->erase = !empty; #endif } else { /* Continuation of upload. */ From 29d815be68b19b0c2d72297976ce105b0eb34d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:59:14 +0100 Subject: [PATCH 473/501] Revert "[nrf fromtree] drivers: uart_native_posix: Fix reading file input" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 15e34e8a700fff8c080fef7c4333e1caf720a6bd. Signed-off-by: Tomasz Moń --- drivers/serial/uart_native_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/uart_native_posix.c b/drivers/serial/uart_native_posix.c index fd211068c55..e6b1c1d2c83 100644 --- a/drivers/serial/uart_native_posix.c +++ b/drivers/serial/uart_native_posix.c @@ -337,7 +337,7 @@ static int np_uart_stdin_poll_in(const struct device *dev, } n = read(in_f, p_char, 1); - if ((n == -1) || (n == 0)) { + if (n == -1) { return -1; } From e92f49e619dc18356dba92dcf0f939d8a3765ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:59:27 +0100 Subject: [PATCH 474/501] Revert "[nrf fromtree] net: ipv6: Allowed to add route to router's link local address" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f4ca90eee30db7c7de6a9f99928a48b62c943d83. Signed-off-by: Tomasz Moń --- subsys/net/ip/ipv6_nbr.c | 14 +++----------- subsys/net/ip/route.c | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/subsys/net/ip/ipv6_nbr.c b/subsys/net/ip/ipv6_nbr.c index 61c817c0b7a..fddd0996132 100644 --- a/subsys/net/ip/ipv6_nbr.c +++ b/subsys/net/ip/ipv6_nbr.c @@ -592,11 +592,11 @@ struct net_nbr *net_ipv6_nbr_add(struct net_if *iface, if (!nbr) { NET_ERR("Could not add router neighbor %s [%s]", net_sprint_ipv6_addr(addr), - lladdr ? net_sprint_ll_addr(lladdr->addr, lladdr->len) : "unknown"); + net_sprint_ll_addr(lladdr->addr, lladdr->len)); return NULL; } - if (lladdr && net_nbr_link(nbr, iface, lladdr) == -EALREADY && + if (net_nbr_link(nbr, iface, lladdr) == -EALREADY && net_ipv6_nbr_data(nbr)->state != NET_IPV6_NBR_STATE_STATIC) { /* Update the lladdr if the node was already known */ struct net_linkaddr_storage *cached_lladdr; @@ -629,7 +629,7 @@ struct net_nbr *net_ipv6_nbr_add(struct net_if *iface, NET_DBG("[%d] nbr %p state %d router %d IPv6 %s ll %s iface %p/%d", nbr->idx, nbr, state, is_router, net_sprint_ipv6_addr(addr), - lladdr ? net_sprint_ll_addr(lladdr->addr, lladdr->len) : "[unknown]", + net_sprint_ll_addr(lladdr->addr, lladdr->len), nbr->iface, net_if_get_by_iface(nbr->iface)); #if defined(CONFIG_NET_MGMT_EVENT_INFO) @@ -2393,19 +2393,11 @@ static enum net_verdict handle_ra_input(struct net_pkt *pkt, nd_opt_hdr = (struct net_icmpv6_nd_opt_hdr *) net_pkt_get_data(pkt, &nd_access); - - /* Add neighbor cache entry using link local address, regardless of link layer address - * presence in Router Advertisement. - */ - nbr = net_ipv6_nbr_add(net_pkt_iface(pkt), (struct in6_addr *)NET_IPV6_HDR(pkt)->src, NULL, - true, NET_IPV6_NBR_STATE_INCOMPLETE); - while (nd_opt_hdr) { net_pkt_acknowledge_data(pkt, &nd_access); switch (nd_opt_hdr->type) { case NET_ICMPV6_ND_OPT_SLLAO: - /* Update existing neighbor cache entry with link layer address. */ nbr = handle_ra_neighbor(pkt, nd_opt_hdr->len); if (!nbr) { goto drop; diff --git a/subsys/net/ip/route.c b/subsys/net/ip/route.c index a46c413633e..0da20d7df6b 100644 --- a/subsys/net/ip/route.c +++ b/subsys/net/ip/route.c @@ -235,6 +235,10 @@ static struct net_nbr *nbr_nexthop_get(struct net_if *iface, return NULL; } + NET_ASSERT(nbr->idx != NET_NBR_LLADDR_UNKNOWN, + "Nexthop %s not in neighbor cache!", + net_sprint_ipv6_addr(addr)); + net_nbr_ref(nbr); NET_DBG("[%d] nbr %p iface %p IPv6 %s", @@ -363,12 +367,14 @@ struct net_route_entry *net_route_add(struct net_if *iface, goto exit; } - if (nbr_nexthop && nbr_nexthop->idx != NET_NBR_LLADDR_UNKNOWN) { - nexthop_lladdr = net_nbr_get_lladdr(nbr_nexthop->idx); - NET_ASSERT(nexthop_lladdr); - NET_DBG("Nexthop %s lladdr is %s", net_sprint_ipv6_addr(nexthop), - net_sprint_ll_addr(nexthop_lladdr->addr, nexthop_lladdr->len)); - } + nexthop_lladdr = net_nbr_get_lladdr(nbr_nexthop->idx); + + NET_ASSERT(nexthop_lladdr); + + NET_DBG("Nexthop %s lladdr is %s", + net_sprint_ipv6_addr(nexthop), + net_sprint_ll_addr(nexthop_lladdr->addr, + nexthop_lladdr->len)); route = net_route_lookup(iface, addr); if (route) { @@ -746,6 +752,12 @@ struct in6_addr *net_route_get_nexthop(struct net_route_entry *route) SYS_SLIST_FOR_EACH_CONTAINER(&route->nexthop, nexthop_route, node) { struct in6_addr *addr; + NET_ASSERT(nexthop_route->nbr->idx != NET_NBR_LLADDR_UNKNOWN); + + if (nexthop_route->nbr->idx == NET_NBR_LLADDR_UNKNOWN) { + continue; + } + ipv6_nbr_data = net_ipv6_nbr_data(nexthop_route->nbr); if (ipv6_nbr_data) { addr = &ipv6_nbr_data->addr; From a5cc8dbf25fc78659b12048206231be966b3242d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:59:40 +0100 Subject: [PATCH 475/501] Revert "[nrf fromtree] net: pkt: Allow compilation with custom IEEE 802.15.4 based L2" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 32d3b4dccde842e8213c70d3787930819cb909d0. Signed-off-by: Tomasz Moń --- subsys/net/ip/net_pkt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/subsys/net/ip/net_pkt.c b/subsys/net/ip/net_pkt.c index f3298466177..dd2e77ca4ca 100644 --- a/subsys/net/ip/net_pkt.c +++ b/subsys/net/ip/net_pkt.c @@ -55,9 +55,7 @@ LOG_MODULE_REGISTER(net_pkt, CONFIG_NET_PKT_LOG_LEVEL); */ #define MAX_IP_PROTO_LEN 8 #else -#if defined(CONFIG_NET_ETHERNET_BRIDGE) || \ - defined(CONFIG_NET_L2_IEEE802154) || \ - defined(CONFIG_NET_L2_CUSTOM_IEEE802154) +#if defined(CONFIG_NET_ETHERNET_BRIDGE) || defined(CONFIG_NET_L2_IEEE802154) #define MAX_IP_PROTO_LEN 0 #else #error "Some packet protocol (e.g. IPv6, IPv4, ETH, IEEE 802.15.4) needs to be selected." From 7353958280725ffc6ebf7f1f0a33fe2b5b66e60d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 13:59:57 +0100 Subject: [PATCH 476/501] Revert "[nrf fromtree] net: lib: sockets_tls: Include zephyr_mbedtls_priv.h conditionally" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 665bae2d8cf8c7f7ba3a8f247f3c142fb244dac2. Signed-off-by: Tomasz Moń --- subsys/net/lib/sockets/sockets_tls.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/subsys/net/lib/sockets/sockets_tls.c b/subsys/net/lib/sockets/sockets_tls.c index 85b7eb7bd73..773b1e4986f 100644 --- a/subsys/net/lib/sockets/sockets_tls.c +++ b/subsys/net/lib/sockets/sockets_tls.c @@ -52,9 +52,7 @@ LOG_MODULE_REGISTER(net_sock_tls, CONFIG_NET_SOCKETS_LOG_LEVEL); #include "sockets_internal.h" #include "tls_internal.h" -#if defined(CONFIG_MBEDTLS_BUILTIN) -#include -#endif +#include "zephyr_mbedtls_priv.h" #if defined(CONFIG_NET_SOCKETS_TLS_MAX_APP_PROTOCOLS) #define ALPN_MAX_PROTOCOLS (CONFIG_NET_SOCKETS_TLS_MAX_APP_PROTOCOLS + 1) From ceb9f4b7f6c37f7f4989c148d6bd689a0f2c09a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:00:14 +0100 Subject: [PATCH 477/501] Revert "[nrf fromtree] modules: mbedtls: Replace select statement with depends on for EC" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba0d5243877ececc0573cdabb45c6720a8c58f9d. Signed-off-by: Tomasz Moń --- drivers/wifi/esp32/Kconfig.esp32 | 3 --- modules/mbedtls/Kconfig.tls-generic | 20 +++++++++++--------- subsys/net/l2/openthread/Kconfig | 5 ----- tests/benchmarks/mbedtls/prj.conf | 4 ---- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/drivers/wifi/esp32/Kconfig.esp32 b/drivers/wifi/esp32/Kconfig.esp32 index ab12a027bc5..38688b987fa 100644 --- a/drivers/wifi/esp32/Kconfig.esp32 +++ b/drivers/wifi/esp32/Kconfig.esp32 @@ -12,9 +12,6 @@ menuconfig WIFI_ESP32 select MBEDTLS_ENTROPY_ENABLED select MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED select MBEDTLS_ECP_ALL_ENABLED - select MBEDTLS_ECDH_C - select MBEDTLS_ECDSA_C - select MBEDTLS_ECP_C help Enable ESP32 SoC WiFi support. Only supported in single core mode because the network stack is not aware of SMP diff --git a/modules/mbedtls/Kconfig.tls-generic b/modules/mbedtls/Kconfig.tls-generic index b37e423fb75..7b0f2fab837 100644 --- a/modules/mbedtls/Kconfig.tls-generic +++ b/modules/mbedtls/Kconfig.tls-generic @@ -75,7 +75,7 @@ config MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED bool "ECDHE-PSK based ciphersuite modes" - depends on MBEDTLS_ECDH_C + select MBEDTLS_ECDH_C config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED bool "RSA-PSK based ciphersuite modes" @@ -107,40 +107,42 @@ config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED bool "ECDHE-RSA based ciphersuite modes" - depends on MBEDTLS_ECDH_C + select MBEDTLS_ECDH_C config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED bool "ECDHE-ECDSA based ciphersuite modes" - depends on MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C + select MBEDTLS_ECDH_C + select MBEDTLS_ECDSA_C config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED bool "ECDH-ECDSA based ciphersuite modes" - depends on MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C + select MBEDTLS_ECDH_C + select MBEDTLS_ECDSA_C config MBEDTLS_ECDSA_DETERMINISTIC bool "Deterministic ECDSA (RFC 6979)" config MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED bool "ECDH-RSA based ciphersuite modes" - depends on MBEDTLS_ECDH_C + select MBEDTLS_ECDH_C config MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED bool "ECJPAKE based ciphersuite modes" - depends on MBEDTLS_ECJPAKE_C + select MBEDTLS_ECJPAKE_C comment "Elliptic curve libraries" config MBEDTLS_ECDH_C bool "Elliptic curve Diffie-Hellman library" - depends on MBEDTLS_ECP_C + select MBEDTLS_ECP_C config MBEDTLS_ECDSA_C bool "Elliptic curve DSA library" - depends on MBEDTLS_ECP_C + select MBEDTLS_ECP_C config MBEDTLS_ECJPAKE_C bool "Elliptic curve J-PAKE library" - depends on MBEDTLS_ECP_C + select MBEDTLS_ECP_C config MBEDTLS_ECP_C bool "Elliptic curve over GF(p) library" diff --git a/subsys/net/l2/openthread/Kconfig b/subsys/net/l2/openthread/Kconfig index 781787c1f4c..5c9d6afebae 100644 --- a/subsys/net/l2/openthread/Kconfig +++ b/subsys/net/l2/openthread/Kconfig @@ -191,7 +191,6 @@ config OPENTHREAD_MBEDTLS select MBEDTLS_TLS_VERSION_1_2 if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER select MBEDTLS_DTLS if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER select MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER - select MBEDTLS_ECJPAKE_C if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER select MBEDTLS_ECP_DP_SECP256R1_ENABLED if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER || \ OPENTHREAD_SRP_CLIENT || OPENTHREAD_SRP_SERVER select MBEDTLS_ECP_NIST_OPTIM if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER @@ -200,12 +199,8 @@ config OPENTHREAD_MBEDTLS select MBEDTLS_HMAC_DRBG_ENABLED if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER || \ OPENTHREAD_SRP_CLIENT || OPENTHREAD_SRP_SERVER select MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED if OPENTHREAD_ECDSA - select MBEDTLS_ECDH_C if OPENTHREAD_ECDSA - select MBEDTLS_ECDSA_C if OPENTHREAD_ECDSA select MBEDTLS_ECDSA_DETERMINISTIC if OPENTHREAD_ECDSA select MBEDTLS_PK_WRITE_C if OPENTHREAD_ECDSA - select MBEDTLS_ECP_C if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER || OPENTHREAD_ECDSA - config OPENTHREAD_MBEDTLS_LIB_NAME string "mbedtls lib name" diff --git a/tests/benchmarks/mbedtls/prj.conf b/tests/benchmarks/mbedtls/prj.conf index 6339cd45b17..cfb2a4545c5 100644 --- a/tests/benchmarks/mbedtls/prj.conf +++ b/tests/benchmarks/mbedtls/prj.conf @@ -24,7 +24,3 @@ CONFIG_MBEDTLS_ECP_ALL_ENABLED=y CONFIG_MBEDTLS_MAC_ALL_ENABLED=y CONFIG_MBEDTLS_GENPRIME_ENABLED=y CONFIG_MBEDTLS_HMAC_DRBG_ENABLED=y -CONFIG_MBEDTLS_ECDH_C=y -CONFIG_MBEDTLS_ECDSA_C=y -CONFIG_MBEDTLS_ECJPAKE_C=y -CONFIG_MBEDTLS_ECP_C=y From 0950eaf456018c31bc18e6bf19eddc1a25da4790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:00:26 +0100 Subject: [PATCH 478/501] Revert "[nrf fromtree] boards: Remove bmi270 int1-gpios form thingy:53 DTS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 28f678aeab3901801af1e3967cfbb8489a6875be. Signed-off-by: Tomasz Moń --- boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts index cb4def46984..3732c72233e 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts @@ -199,6 +199,7 @@ status = "disabled"; spi-max-frequency = <8000000>; reg = <1>; + int1-gpios = <&gpio0 23 0>; }; nrf_radio_fem_spi: fem_spi@2 { From 3774226f80adc9f627f2ad64001e9114956d13b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:00:41 +0100 Subject: [PATCH 479/501] Revert "[nrf fromtree] sensor: Refactor bmi270 driver data names" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fa1468b8dfeb567f5b72be69b4b8ff8b470ef255. Signed-off-by: Tomasz Moń --- drivers/sensor/bmi270/bmi270.c | 110 ++++++++++++++++----------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/drivers/sensor/bmi270/bmi270.c b/drivers/sensor/bmi270/bmi270.c index ace3d81b902..45077557923 100644 --- a/drivers/sensor/bmi270/bmi270.c +++ b/drivers/sensor/bmi270/bmi270.c @@ -143,7 +143,7 @@ static uint8_t acc_odr_to_reg(const struct sensor_value *val) static int set_accel_odr_osr(const struct device *dev, const struct sensor_value *odr, const struct sensor_value *osr) { - struct bmi270_data *data = dev->data; + struct bmi270_data *drv_dev = dev->data; uint8_t acc_conf, odr_bits, pwr_ctrl, osr_bits; int ret = 0; @@ -185,11 +185,11 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value BMI270_ACC_FILT_PWR_OPT); } - data->acc_odr = odr_bits; + drv_dev->acc_odr = odr_bits; } if (osr) { - if (data->acc_odr >= BMI270_ACC_ODR_100_HZ) { + if (drv_dev->acc_odr >= BMI270_ACC_ODR_100_HZ) { /* Performance mode */ /* osr->val2 should be unused */ switch (osr->val1) { @@ -263,7 +263,7 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value static int set_accel_range(const struct device *dev, const struct sensor_value *range) { - struct bmi270_data *data = dev->data; + struct bmi270_data *drv_dev = dev->data; int ret = 0; uint8_t acc_range, reg; @@ -276,19 +276,19 @@ static int set_accel_range(const struct device *dev, const struct sensor_value * switch (range->val1) { case 2: reg = BMI270_ACC_RANGE_2G; - data->acc_range = 2; + drv_dev->acc_range = 2; break; case 4: reg = BMI270_ACC_RANGE_4G; - data->acc_range = 4; + drv_dev->acc_range = 4; break; case 8: reg = BMI270_ACC_RANGE_8G; - data->acc_range = 8; + drv_dev->acc_range = 8; break; case 16: reg = BMI270_ACC_RANGE_16G; - data->acc_range = 16; + drv_dev->acc_range = 16; break; default: return -ENOTSUP; @@ -331,7 +331,7 @@ static uint8_t gyr_odr_to_reg(const struct sensor_value *val) static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value *odr, const struct sensor_value *osr) { - struct bmi270_data *data = dev->data; + struct bmi270_data *drv_dev = dev->data; uint8_t gyr_conf, odr_bits, pwr_ctrl, osr_bits; int ret = 0; @@ -381,7 +381,7 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value BMI270_GYR_FILT_NOISE_PWR); } - data->gyr_odr = odr_bits; + drv_dev->gyr_odr = odr_bits; } if (osr) { @@ -422,7 +422,7 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value static int set_gyro_range(const struct device *dev, const struct sensor_value *range) { - struct bmi270_data *data = dev->data; + struct bmi270_data *drv_dev = dev->data; int ret = 0; uint8_t gyr_range, reg; @@ -435,23 +435,23 @@ static int set_gyro_range(const struct device *dev, const struct sensor_value *r switch (range->val1) { case 125: reg = BMI270_GYR_RANGE_125DPS; - data->gyr_range = 125; + drv_dev->gyr_range = 125; break; case 250: reg = BMI270_GYR_RANGE_250DPS; - data->gyr_range = 250; + drv_dev->gyr_range = 250; break; case 500: reg = BMI270_GYR_RANGE_500DPS; - data->gyr_range = 500; + drv_dev->gyr_range = 500; break; case 1000: reg = BMI270_GYR_RANGE_1000DPS; - data->gyr_range = 1000; + drv_dev->gyr_range = 1000; break; case 2000: reg = BMI270_GYR_RANGE_2000DPS; - data->gyr_range = 2000; + drv_dev->gyr_range = 2000; break; default: return -ENOTSUP; @@ -497,29 +497,29 @@ static int8_t write_config_file(const struct device *dev) static int bmi270_sample_fetch(const struct device *dev, enum sensor_channel chan) { - struct bmi270_data *data = dev->data; - uint8_t buf[12]; + struct bmi270_data *drv_dev = dev->data; + uint8_t data[12]; int ret; if (chan != SENSOR_CHAN_ALL) { return -ENOTSUP; } - ret = bmi270_reg_read(dev, BMI270_REG_ACC_X_LSB, buf, 12); + ret = bmi270_reg_read(dev, BMI270_REG_ACC_X_LSB, data, 12); if (ret == 0) { - data->ax = (int16_t)sys_get_le16(&buf[0]); - data->ay = (int16_t)sys_get_le16(&buf[2]); - data->az = (int16_t)sys_get_le16(&buf[4]); - data->gx = (int16_t)sys_get_le16(&buf[6]); - data->gy = (int16_t)sys_get_le16(&buf[8]); - data->gz = (int16_t)sys_get_le16(&buf[10]); + drv_dev->ax = (int16_t)sys_get_le16(&data[0]); + drv_dev->ay = (int16_t)sys_get_le16(&data[2]); + drv_dev->az = (int16_t)sys_get_le16(&data[4]); + drv_dev->gx = (int16_t)sys_get_le16(&data[6]); + drv_dev->gy = (int16_t)sys_get_le16(&data[8]); + drv_dev->gz = (int16_t)sys_get_le16(&data[10]); } else { - data->ax = 0; - data->ay = 0; - data->az = 0; - data->gx = 0; - data->gy = 0; - data->gz = 0; + drv_dev->ax = 0; + drv_dev->ay = 0; + drv_dev->az = 0; + drv_dev->gx = 0; + drv_dev->gy = 0; + drv_dev->gz = 0; } return ret; @@ -528,34 +528,34 @@ static int bmi270_sample_fetch(const struct device *dev, enum sensor_channel cha static int bmi270_channel_get(const struct device *dev, enum sensor_channel chan, struct sensor_value *val) { - struct bmi270_data *data = dev->data; + struct bmi270_data *drv_dev = dev->data; if (chan == SENSOR_CHAN_ACCEL_X) { - channel_accel_convert(val, data->ax, data->acc_range); + channel_accel_convert(val, drv_dev->ax, drv_dev->acc_range); } else if (chan == SENSOR_CHAN_ACCEL_Y) { - channel_accel_convert(val, data->ay, data->acc_range); + channel_accel_convert(val, drv_dev->ay, drv_dev->acc_range); } else if (chan == SENSOR_CHAN_ACCEL_Z) { - channel_accel_convert(val, data->az, data->acc_range); + channel_accel_convert(val, drv_dev->az, drv_dev->acc_range); } else if (chan == SENSOR_CHAN_ACCEL_XYZ) { - channel_accel_convert(&val[0], data->ax, - data->acc_range); - channel_accel_convert(&val[1], data->ay, - data->acc_range); - channel_accel_convert(&val[2], data->az, - data->acc_range); + channel_accel_convert(&val[0], drv_dev->ax, + drv_dev->acc_range); + channel_accel_convert(&val[1], drv_dev->ay, + drv_dev->acc_range); + channel_accel_convert(&val[2], drv_dev->az, + drv_dev->acc_range); } else if (chan == SENSOR_CHAN_GYRO_X) { - channel_gyro_convert(val, data->gx, data->gyr_range); + channel_gyro_convert(val, drv_dev->gx, drv_dev->gyr_range); } else if (chan == SENSOR_CHAN_GYRO_Y) { - channel_gyro_convert(val, data->gy, data->gyr_range); + channel_gyro_convert(val, drv_dev->gy, drv_dev->gyr_range); } else if (chan == SENSOR_CHAN_GYRO_Z) { - channel_gyro_convert(val, data->gz, data->gyr_range); + channel_gyro_convert(val, drv_dev->gz, drv_dev->gyr_range); } else if (chan == SENSOR_CHAN_GYRO_XYZ) { - channel_gyro_convert(&val[0], data->gx, - data->gyr_range); - channel_gyro_convert(&val[1], data->gy, - data->gyr_range); - channel_gyro_convert(&val[2], data->gz, - data->gyr_range); + channel_gyro_convert(&val[0], drv_dev->gx, + drv_dev->gyr_range); + channel_gyro_convert(&val[1], drv_dev->gy, + drv_dev->gyr_range); + channel_gyro_convert(&val[2], drv_dev->gz, + drv_dev->gyr_range); } else { return -ENOTSUP; } @@ -611,7 +611,7 @@ static int bmi270_attr_set(const struct device *dev, enum sensor_channel chan, static int bmi270_init(const struct device *dev) { int ret; - struct bmi270_data *data = dev->data; + struct bmi270_data *drv_dev = dev->data; uint8_t chip_id; uint8_t soft_reset_cmd; uint8_t init_ctrl; @@ -625,10 +625,10 @@ static int bmi270_init(const struct device *dev) return ret; } - data->acc_odr = BMI270_ACC_ODR_100_HZ; - data->acc_range = 8; - data->gyr_odr = BMI270_GYR_ODR_200_HZ; - data->gyr_range = 2000; + drv_dev->acc_odr = BMI270_ACC_ODR_100_HZ; + drv_dev->acc_range = 8; + drv_dev->gyr_odr = BMI270_GYR_ODR_200_HZ; + drv_dev->gyr_range = 2000; k_usleep(BMI270_POWER_ON_TIME); From 687e38e0c35e3f4e537a48afa2f7d5dc809b583f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:00:54 +0100 Subject: [PATCH 480/501] Revert "[nrf fromtree] sensor: dts: Add SPI capability to bmi270 driver" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f396333eef2dcaf46d6898a6337a8231a5d4e4db. Signed-off-by: Tomasz Moń --- drivers/sensor/bmi270/CMakeLists.txt | 3 - drivers/sensor/bmi270/Kconfig | 20 +-- drivers/sensor/bmi270/bmi270.c | 179 ++++++++-------------- drivers/sensor/bmi270/bmi270.h | 39 +---- drivers/sensor/bmi270/bmi270_i2c.c | 42 ----- drivers/sensor/bmi270/bmi270_spi.c | 101 ------------ dts/bindings/sensor/bosch,bmi270-i2c.yaml | 7 +- dts/bindings/sensor/bosch,bmi270-spi.yaml | 6 - dts/bindings/sensor/bosch,bmi270.yaml | 9 -- 9 files changed, 71 insertions(+), 335 deletions(-) delete mode 100644 drivers/sensor/bmi270/bmi270_i2c.c delete mode 100644 drivers/sensor/bmi270/bmi270_spi.c delete mode 100644 dts/bindings/sensor/bosch,bmi270-spi.yaml delete mode 100644 dts/bindings/sensor/bosch,bmi270.yaml diff --git a/drivers/sensor/bmi270/CMakeLists.txt b/drivers/sensor/bmi270/CMakeLists.txt index 5f9b4bb2a60..29d278355c2 100644 --- a/drivers/sensor/bmi270/CMakeLists.txt +++ b/drivers/sensor/bmi270/CMakeLists.txt @@ -1,6 +1,5 @@ # # Copyright (c) 2021 Bosch Sensortec GmbH -# Copyright (c) 2022 Nordic Semiconductor ASA # # SPDX-License-Identifier: Apache-2.0 # @@ -8,5 +7,3 @@ zephyr_library() zephyr_library_sources(bmi270.c) -zephyr_library_sources_ifdef(CONFIG_BMI270_BUS_I2C bmi270_i2c.c) -zephyr_library_sources_ifdef(CONFIG_BMI270_BUS_SPI bmi270_spi.c) diff --git a/drivers/sensor/bmi270/Kconfig b/drivers/sensor/bmi270/Kconfig index f8cd1ba2840..90bbe131b8b 100644 --- a/drivers/sensor/bmi270/Kconfig +++ b/drivers/sensor/bmi270/Kconfig @@ -1,28 +1,12 @@ # BMI270 6 Axis IMU configuration # Copyright (c) 2021 Bosch Sensortec GmbH -# Copyright (c) 2022 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -menuconfig BMI270 +config BMI270 bool "BMI270 Inertial measurement unit" default y depends on DT_HAS_BOSCH_BMI270_ENABLED - select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),i2c) - select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),spi) + select I2C help Enable driver for BMI270 I2C-based imu sensor - -if BMI270 - -config BMI270_BUS_I2C - bool - default y - depends on $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),i2c) - -config BMI270_BUS_SPI - bool - default y - depends on $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),spi) - -endif # BMI270 diff --git a/drivers/sensor/bmi270/bmi270.c b/drivers/sensor/bmi270/bmi270.c index 45077557923..940168e4184 100644 --- a/drivers/sensor/bmi270/bmi270.c +++ b/drivers/sensor/bmi270/bmi270.c @@ -1,12 +1,12 @@ /* * Copyright (c) 2021 Bosch Sensortec GmbH - * Copyright (c) 2022 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT bosch_bmi270 +#include #include #include #include @@ -23,49 +23,26 @@ LOG_MODULE_REGISTER(bmi270, CONFIG_SENSOR_LOG_LEVEL); #define BMI270_CONFIG_FILE_POLL_PERIOD_US 10000 #define BMI270_INTER_WRITE_DELAY_US 1000 -struct bmi270_config { - union bmi270_bus bus; - const struct bmi270_bus_io *bus_io; -}; - -static inline int bmi270_bus_check(const struct device *dev) -{ - const struct bmi270_config *cfg = dev->config; - - return cfg->bus_io->check(&cfg->bus); -} - -static inline int bmi270_bus_init(const struct device *dev) +static int reg_read(const struct device *dev, uint8_t reg, uint8_t *data, uint16_t length) { - const struct bmi270_config *cfg = dev->config; + const struct bmi270_dev_config *cfg = dev->config; - return cfg->bus_io->init(&cfg->bus); + return i2c_burst_read_dt(&cfg->i2c, reg, data, length); } -static int bmi270_reg_read(const struct device *dev, uint8_t reg, uint8_t *data, uint16_t length) +static int reg_write(const struct device *dev, uint8_t reg, const uint8_t *data, uint16_t length) { - const struct bmi270_config *cfg = dev->config; + const struct bmi270_dev_config *cfg = dev->config; - return cfg->bus_io->read(&cfg->bus, reg, data, length); + return i2c_burst_write_dt(&cfg->i2c, reg, data, length); } -static int bmi270_reg_write(const struct device *dev, uint8_t reg, - const uint8_t *data, uint16_t length) -{ - const struct bmi270_config *cfg = dev->config; - - return cfg->bus_io->write(&cfg->bus, reg, data, length); -} - -static int bmi270_reg_write_with_delay(const struct device *dev, - uint8_t reg, - const uint8_t *data, - uint16_t length, - uint32_t delay_us) +static int reg_write_with_delay(const struct device *dev, uint8_t reg, const uint8_t *data, + uint16_t length, uint32_t delay_us) { int ret = 0; - ret = bmi270_reg_write(dev, reg, data, length); + ret = reg_write(dev, reg, data, length); if (ret == 0) { k_usleep(delay_us); } @@ -148,12 +125,12 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value int ret = 0; if (odr || osr) { - ret = bmi270_reg_read(dev, BMI270_REG_ACC_CONF, &acc_conf, 1); + ret = reg_read(dev, BMI270_REG_ACC_CONF, &acc_conf, 1); if (ret != 0) { return ret; } - ret = bmi270_reg_read(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1); + ret = reg_read(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1); if (ret != 0) { return ret; } @@ -244,7 +221,7 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value } if (odr || osr) { - ret = bmi270_reg_write(dev, BMI270_REG_ACC_CONF, &acc_conf, 1); + ret = reg_write(dev, BMI270_REG_ACC_CONF, &acc_conf, 1); if (ret != 0) { return ret; } @@ -253,9 +230,8 @@ static int set_accel_odr_osr(const struct device *dev, const struct sensor_value k_usleep(BMI270_TRANSC_DELAY_SUSPEND); pwr_ctrl &= BMI270_PWR_CTRL_MSK; - ret = bmi270_reg_write_with_delay(dev, BMI270_REG_PWR_CTRL, - &pwr_ctrl, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = reg_write_with_delay(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1, + BMI270_INTER_WRITE_DELAY_US); } return ret; @@ -267,7 +243,7 @@ static int set_accel_range(const struct device *dev, const struct sensor_value * int ret = 0; uint8_t acc_range, reg; - ret = bmi270_reg_read(dev, BMI270_REG_ACC_RANGE, &acc_range, 1); + ret = reg_read(dev, BMI270_REG_ACC_RANGE, &acc_range, 1); if (ret != 0) { return ret; } @@ -296,8 +272,8 @@ static int set_accel_range(const struct device *dev, const struct sensor_value * acc_range = BMI270_SET_BITS_POS_0(acc_range, BMI270_ACC_RANGE, reg); - ret = bmi270_reg_write_with_delay(dev, BMI270_REG_ACC_RANGE, &acc_range, - 1, BMI270_INTER_WRITE_DELAY_US); + ret = reg_write_with_delay(dev, BMI270_REG_ACC_RANGE, &acc_range, 1, + BMI270_INTER_WRITE_DELAY_US); return ret; } @@ -336,12 +312,12 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value int ret = 0; if (odr || osr) { - ret = bmi270_reg_read(dev, BMI270_REG_GYR_CONF, &gyr_conf, 1); + ret = reg_read(dev, BMI270_REG_GYR_CONF, &gyr_conf, 1); if (ret != 0) { return ret; } - ret = bmi270_reg_read(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1); + ret = reg_read(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1); if (ret != 0) { return ret; } @@ -403,7 +379,7 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value } if (odr || osr) { - ret = bmi270_reg_write(dev, BMI270_REG_GYR_CONF, &gyr_conf, 1); + ret = reg_write(dev, BMI270_REG_GYR_CONF, &gyr_conf, 1); if (ret != 0) { return ret; } @@ -412,9 +388,8 @@ static int set_gyro_odr_osr(const struct device *dev, const struct sensor_value k_usleep(BMI270_TRANSC_DELAY_SUSPEND); pwr_ctrl &= BMI270_PWR_CTRL_MSK; - ret = bmi270_reg_write_with_delay(dev, BMI270_REG_PWR_CTRL, - &pwr_ctrl, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = reg_write_with_delay(dev, BMI270_REG_PWR_CTRL, &pwr_ctrl, 1, + BMI270_INTER_WRITE_DELAY_US); } return ret; @@ -426,7 +401,7 @@ static int set_gyro_range(const struct device *dev, const struct sensor_value *r int ret = 0; uint8_t gyr_range, reg; - ret = bmi270_reg_read(dev, BMI270_REG_GYR_RANGE, &gyr_range, 1); + ret = reg_read(dev, BMI270_REG_GYR_RANGE, &gyr_range, 1); if (ret != 0) { return ret; } @@ -458,8 +433,8 @@ static int set_gyro_range(const struct device *dev, const struct sensor_value *r } gyr_range = BMI270_SET_BITS_POS_0(gyr_range, BMI270_GYR_RANGE, reg); - ret = bmi270_reg_write_with_delay(dev, BMI270_REG_GYR_RANGE, &gyr_range, - 1, BMI270_INTER_WRITE_DELAY_US); + ret = reg_write_with_delay(dev, BMI270_REG_GYR_RANGE, &gyr_range, 1, + BMI270_INTER_WRITE_DELAY_US); return ret; } @@ -479,16 +454,13 @@ static int8_t write_config_file(const struct device *dev) /* Store 4 to 11 bits of address in the second byte */ addr_array[1] = (uint8_t)((index / 2) >> 4); - ret = bmi270_reg_write_with_delay(dev, BMI270_REG_INIT_ADDR_0, - addr_array, 2, - BMI270_INTER_WRITE_DELAY_US); + ret = reg_write_with_delay(dev, BMI270_REG_INIT_ADDR_0, addr_array, 2, + BMI270_INTER_WRITE_DELAY_US); if (ret == 0) { - ret = bmi270_reg_write_with_delay(dev, - BMI270_REG_INIT_DATA, - (bmi270_config_file + index), - BMI270_WR_LEN, - BMI270_INTER_WRITE_DELAY_US); + ret = reg_write_with_delay(dev, BMI270_REG_INIT_DATA, + (bmi270_config_file + index), + BMI270_WR_LEN, BMI270_INTER_WRITE_DELAY_US); } } @@ -505,7 +477,7 @@ static int bmi270_sample_fetch(const struct device *dev, enum sensor_channel cha return -ENOTSUP; } - ret = bmi270_reg_read(dev, BMI270_REG_ACC_X_LSB, data, 12); + ret = reg_read(dev, BMI270_REG_ACC_X_LSB, data, 12); if (ret == 0) { drv_dev->ax = (int16_t)sys_get_le16(&data[0]); drv_dev->ay = (int16_t)sys_get_le16(&data[2]); @@ -612,6 +584,7 @@ static int bmi270_init(const struct device *dev) { int ret; struct bmi270_data *drv_dev = dev->data; + const struct bmi270_dev_config *cfg = dev->config; uint8_t chip_id; uint8_t soft_reset_cmd; uint8_t init_ctrl; @@ -619,10 +592,9 @@ static int bmi270_init(const struct device *dev) uint8_t tries; uint8_t adv_pwr_save; - ret = bmi270_bus_check(dev); - if (ret < 0) { - LOG_ERR("Could not initialize bus"); - return ret; + if (!device_is_ready(cfg->i2c.bus)) { + LOG_ERR("I2C bus device not ready"); + return -ENODEV; } drv_dev->acc_odr = BMI270_ACC_ODR_100_HZ; @@ -632,13 +604,7 @@ static int bmi270_init(const struct device *dev) k_usleep(BMI270_POWER_ON_TIME); - ret = bmi270_bus_init(dev); - if (ret != 0) { - LOG_ERR("Could not initiate bus communication"); - return ret; - } - - ret = bmi270_reg_read(dev, BMI270_REG_CHIP_ID, &chip_id, 1); + ret = reg_read(dev, BMI270_REG_CHIP_ID, &chip_id, 1); if (ret != 0) { return ret; } @@ -650,14 +616,14 @@ static int bmi270_init(const struct device *dev) } soft_reset_cmd = BMI270_CMD_SOFT_RESET; - ret = bmi270_reg_write(dev, BMI270_REG_CMD, &soft_reset_cmd, 1); + ret = reg_write(dev, BMI270_REG_CMD, &soft_reset_cmd, 1); if (ret != 0) { return ret; } k_usleep(BMI270_SOFT_RESET_TIME); - ret = bmi270_reg_read(dev, BMI270_REG_PWR_CONF, &adv_pwr_save, 1); + ret = reg_read(dev, BMI270_REG_PWR_CONF, &adv_pwr_save, 1); if (ret != 0) { return ret; } @@ -665,15 +631,14 @@ static int bmi270_init(const struct device *dev) adv_pwr_save = BMI270_SET_BITS_POS_0(adv_pwr_save, BMI270_PWR_CONF_ADV_PWR_SAVE, BMI270_PWR_CONF_ADV_PWR_SAVE_DIS); - ret = bmi270_reg_write_with_delay(dev, BMI270_REG_PWR_CONF, - &adv_pwr_save, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = reg_write_with_delay(dev, BMI270_REG_PWR_CONF, &adv_pwr_save, 1, + BMI270_INTER_WRITE_DELAY_US); if (ret != 0) { return ret; } init_ctrl = BMI270_PREPARE_CONFIG_LOAD; - ret = bmi270_reg_write(dev, BMI270_REG_INIT_CTRL, &init_ctrl, 1); + ret = reg_write(dev, BMI270_REG_INIT_CTRL, &init_ctrl, 1); if (ret != 0) { return ret; } @@ -685,18 +650,18 @@ static int bmi270_init(const struct device *dev) } init_ctrl = BMI270_COMPLETE_CONFIG_LOAD; - ret = bmi270_reg_write(dev, BMI270_REG_INIT_CTRL, &init_ctrl, 1); + ret = reg_write(dev, BMI270_REG_INIT_CTRL, &init_ctrl, 1); if (ret != 0) { return ret; } /* Timeout after BMI270_CONFIG_FILE_RETRIES x * BMI270_CONFIG_FILE_POLL_PERIOD_US microseconds. - * If tries is BMI270_CONFIG_FILE_RETRIES by the end of the loop, + * If tries is 0 by the end of the loop, * report an error */ for (tries = 0; tries <= BMI270_CONFIG_FILE_RETRIES; tries++) { - ret = bmi270_reg_read(dev, BMI270_REG_INTERNAL_STATUS, &msg, 1); + ret = reg_read(dev, BMI270_REG_INTERNAL_STATUS, &msg, 1); if (ret != 0) { return ret; } @@ -709,16 +674,15 @@ static int bmi270_init(const struct device *dev) k_usleep(BMI270_CONFIG_FILE_POLL_PERIOD_US); } - if (tries == BMI270_CONFIG_FILE_RETRIES) { + if (tries == 0) { return -EIO; } adv_pwr_save = BMI270_SET_BITS_POS_0(adv_pwr_save, BMI270_PWR_CONF_ADV_PWR_SAVE, BMI270_PWR_CONF_ADV_PWR_SAVE_EN); - ret = bmi270_reg_write_with_delay(dev, BMI270_REG_PWR_CONF, - &adv_pwr_save, 1, - BMI270_INTER_WRITE_DELAY_US); + ret = reg_write_with_delay(dev, BMI270_REG_PWR_CONF, &adv_pwr_save, 1, + BMI270_INTER_WRITE_DELAY_US); return ret; } @@ -729,38 +693,21 @@ static const struct sensor_driver_api bmi270_driver_api = { .attr_set = bmi270_attr_set }; -/* Initializes a struct bmi270_config for an instance on a SPI bus. */ -#define BMI270_CONFIG_SPI(inst) \ - { \ - .bus.spi = SPI_DT_SPEC_INST_GET( \ - inst, BMI270_SPI_OPERATION, 0), \ - .bus_io = &bmi270_bus_io_spi, \ - } - -/* Initializes a struct bmi270_config for an instance on an I2C bus. */ -#define BMI270_CONFIG_I2C(inst) \ - { \ - .bus.i2c = I2C_DT_SPEC_INST_GET(inst), \ - .bus_io = &bmi270_bus_io_i2c, \ - } - - -#define BMI270_CREATE_INST(inst) \ - \ - static struct bmi270_data bmi270_drv_##inst; \ - \ - static const struct bmi270_config bmi270_config_##inst = \ - COND_CODE_1(DT_INST_ON_BUS(inst, spi), \ - (BMI270_CONFIG_SPI(inst)), \ - (BMI270_CONFIG_I2C(inst))); \ - \ - DEVICE_DT_INST_DEFINE(inst, \ - bmi270_init, \ - NULL, \ - &bmi270_drv_##inst, \ - &bmi270_config_##inst, \ - POST_KERNEL, \ - CONFIG_SENSOR_INIT_PRIORITY, \ +#define BMI270_CREATE_INST(inst) \ + \ + static struct bmi270_data bmi270_drv_##inst; \ + \ + static const struct bmi270_dev_config bmi270_config_##inst = { \ + .i2c = I2C_DT_SPEC_INST_GET(inst), \ + }; \ + \ + DEVICE_DT_INST_DEFINE(inst, \ + bmi270_init, \ + NULL, \ + &bmi270_drv_##inst, \ + &bmi270_config_##inst, \ + POST_KERNEL, \ + CONFIG_SENSOR_INIT_PRIORITY, \ &bmi270_driver_api); DT_INST_FOREACH_STATUS_OKAY(BMI270_CREATE_INST) diff --git a/drivers/sensor/bmi270/bmi270.h b/drivers/sensor/bmi270/bmi270.h index 50605361844..51e9d387165 100644 --- a/drivers/sensor/bmi270/bmi270.h +++ b/drivers/sensor/bmi270/bmi270.h @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Bosch Sensortec GmbH - * Copyright (c) 2022 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -12,9 +11,7 @@ #include #include #include -#include #include -#include #define BMI270_REG_CHIP_ID 0x00 #define BMI270_REG_ERROR 0x02 @@ -70,7 +67,6 @@ #define BMI270_REG_PWR_CONF 0x7C #define BMI270_REG_PWR_CTRL 0x7D #define BMI270_REG_CMD 0x7E -#define BMI270_REG_MASK GENMASK(6, 0) #define BMI270_CHIP_ID 0x24 @@ -210,41 +206,8 @@ struct bmi270_data { uint16_t gyr_range; }; -union bmi270_bus { -#if CONFIG_BMI270_BUS_SPI - struct spi_dt_spec spi; -#endif -#if CONFIG_BMI270_BUS_I2C +struct bmi270_dev_config { struct i2c_dt_spec i2c; -#endif }; -typedef int (*bmi270_bus_check_fn)(const union bmi270_bus *bus); -typedef int (*bmi270_bus_init_fn)(const union bmi270_bus *bus); -typedef int (*bmi270_reg_read_fn)(const union bmi270_bus *bus, - uint8_t start, - uint8_t *data, - uint16_t len); -typedef int (*bmi270_reg_write_fn)(const union bmi270_bus *bus, - uint8_t start, - const uint8_t *data, - uint16_t len); - -struct bmi270_bus_io { - bmi270_bus_check_fn check; - bmi270_reg_read_fn read; - bmi270_reg_write_fn write; - bmi270_bus_init_fn init; -}; - -#if CONFIG_BMI270_BUS_SPI -#define BMI270_SPI_OPERATION (SPI_WORD_SET(8) | SPI_TRANSFER_MSB) -#define BMI270_SPI_ACC_DELAY_US 2 -extern const struct bmi270_bus_io bmi270_bus_io_spi; -#endif - -#if CONFIG_BMI270_BUS_I2C -extern const struct bmi270_bus_io bmi270_bus_io_i2c; -#endif - #endif /* ZEPHYR_DRIVERS_SENSOR_BMI270_BMI270_H_ */ diff --git a/drivers/sensor/bmi270/bmi270_i2c.c b/drivers/sensor/bmi270/bmi270_i2c.c deleted file mode 100644 index da80001907b..00000000000 --- a/drivers/sensor/bmi270/bmi270_i2c.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Bus-specific functionality for BMI270s accessed via I2C. - */ - -#include "bmi270.h" - -static int bmi270_bus_check_i2c(const union bmi270_bus *bus) -{ - return device_is_ready(bus->i2c.bus) ? 0 : -ENODEV; -} - -static int bmi270_reg_read_i2c(const union bmi270_bus *bus, - uint8_t start, uint8_t *data, uint16_t len) -{ - return i2c_burst_read_dt(&bus->i2c, start, data, len); -} - -static int bmi270_reg_write_i2c(const union bmi270_bus *bus, uint8_t start, - const uint8_t *data, uint16_t len) -{ - return i2c_burst_write_dt(&bus->i2c, start, data, len); -} - -static int bmi270_bus_init_i2c(const union bmi270_bus *bus) -{ - /* I2C is used by default - */ - return 0; -} - -const struct bmi270_bus_io bmi270_bus_io_i2c = { - .check = bmi270_bus_check_i2c, - .read = bmi270_reg_read_i2c, - .write = bmi270_reg_write_i2c, - .init = bmi270_bus_init_i2c, -}; diff --git a/drivers/sensor/bmi270/bmi270_spi.c b/drivers/sensor/bmi270/bmi270_spi.c deleted file mode 100644 index 4f0a01ec4c7..00000000000 --- a/drivers/sensor/bmi270/bmi270_spi.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Bus-specific functionality for BMI270s accessed via SPI. - */ - -#include -#include "bmi270.h" - -LOG_MODULE_DECLARE(bmi270, CONFIG_SENSOR_LOG_LEVEL); - -static int bmi270_bus_check_spi(const union bmi270_bus *bus) -{ - return spi_is_ready(&bus->spi) ? 0 : -ENODEV; -} - -static int bmi270_reg_read_spi(const union bmi270_bus *bus, - uint8_t start, uint8_t *data, uint16_t len) -{ - int ret; - uint8_t addr; - uint8_t tmp[2]; - int i; - const struct spi_buf tx_buf = { - .buf = &addr, - .len = 1 - }; - const struct spi_buf_set tx = { - .buffers = &tx_buf, - .count = 1 - }; - struct spi_buf rx_buf[2]; - const struct spi_buf_set rx = { - .buffers = rx_buf, - .count = ARRAY_SIZE(rx_buf) - }; - - rx_buf[0].buf = &tmp[0]; - rx_buf[0].len = 2; - rx_buf[1].len = 1; - - for (i = 0; i < len; i++) { - addr = (start + i) | 0x80; - rx_buf[1].buf = &data[i]; - - ret = spi_transceive_dt(&bus->spi, &tx, &rx); - if (ret < 0) { - LOG_DBG("spi_transceive failed %i", ret); - return ret; - } - } - - k_usleep(BMI270_SPI_ACC_DELAY_US); - return 0; -} - -static int bmi270_reg_write_spi(const union bmi270_bus *bus, uint8_t start, - const uint8_t *data, uint16_t len) -{ - int ret; - uint8_t addr; - const struct spi_buf tx_buf[2] = { - {.buf = &addr, .len = sizeof(addr)}, - {.buf = (uint8_t *)data, .len = len} - }; - const struct spi_buf_set tx = { - .buffers = tx_buf, - .count = ARRAY_SIZE(tx_buf) - }; - - addr = start & BMI270_REG_MASK; - - ret = spi_write_dt(&bus->spi, &tx); - if (ret < 0) { - LOG_ERR("spi_write_dt failed %i", ret); - return ret; - } - - k_usleep(BMI270_SPI_ACC_DELAY_US); - return 0; -} - -static int bmi270_bus_init_spi(const union bmi270_bus *bus) -{ - uint8_t tmp; - - /* Single read of SPI initializes the chip to SPI mode - */ - return bmi270_reg_read_spi(bus, BMI270_REG_CHIP_ID, &tmp, 1); -} - -const struct bmi270_bus_io bmi270_bus_io_spi = { - .check = bmi270_bus_check_spi, - .read = bmi270_reg_read_spi, - .write = bmi270_reg_write_spi, - .init = bmi270_bus_init_spi, -}; diff --git a/dts/bindings/sensor/bosch,bmi270-i2c.yaml b/dts/bindings/sensor/bosch,bmi270-i2c.yaml index ca21ba4f3ea..2e2ee307c04 100644 --- a/dts/bindings/sensor/bosch,bmi270-i2c.yaml +++ b/dts/bindings/sensor/bosch,bmi270-i2c.yaml @@ -1,7 +1,10 @@ # Copyright (c) 2021, Bosch Sensortec GmbH -# Copyright (c) 2022, Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +description: | + The BMI270 is an inertial measurment unit. See more info at: + https://www.bosch-sensortec.com/products/motion-sensors/imus/bmi270.html + compatible: "bosch,bmi270" -include: [i2c-device.yaml, "bosch,bmi270.yaml"] +include: i2c-device.yaml diff --git a/dts/bindings/sensor/bosch,bmi270-spi.yaml b/dts/bindings/sensor/bosch,bmi270-spi.yaml deleted file mode 100644 index 9c76cff2868..00000000000 --- a/dts/bindings/sensor/bosch,bmi270-spi.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2022, Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -compatible: "bosch,bmi270" - -include: ["spi-device.yaml", "bosch,bmi270.yaml"] diff --git a/dts/bindings/sensor/bosch,bmi270.yaml b/dts/bindings/sensor/bosch,bmi270.yaml deleted file mode 100644 index 90f4ef2ca1e..00000000000 --- a/dts/bindings/sensor/bosch,bmi270.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2021, Bosch Sensortec GmbH -# Copyright (c) 2022, Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - The BMI270 is an inertial measurement unit. See more info at: - https://www.bosch-sensortec.com/products/motion-sensors/imus/bmi270.html - -compatible: "bosch,bmi270" From be9513d9c9bc61cfc05cb47d9ad05a39d163b8f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:01:08 +0100 Subject: [PATCH 481/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix radio_tmr_start_us to be soft realtime" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 61e57d10bdeeb1d72fe0312428d2a5547450c826. Signed-off-by: Tomasz Moń --- .../ll_sw/nordic/hal/nrf5/radio/radio.c | 47 +++++++++---------- .../ll_sw/nordic/hal/nrf5/radio/radio.h | 2 +- .../ll_sw/nordic/lll/lll_scan_aux.c | 13 ++--- .../controller/ll_sw/nordic/lll/lll_sync.c | 13 ++--- .../ll_sw/nordic/lll/lll_sync_iso.c | 4 +- 5 files changed, 34 insertions(+), 45 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c index afe4648024d..88e7ad6da45 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c @@ -1141,8 +1141,10 @@ uint32_t radio_tmr_start_tick(uint8_t trx, uint32_t tick) return remainder_us; } -uint32_t radio_tmr_start_us(uint8_t trx, uint32_t start_us) +void radio_tmr_start_us(uint8_t trx, uint32_t us) { + nrf_timer_cc_set(EVENT_TIMER, 0, us); + hal_radio_enable_on_tick_ppi_config_and_enable(trx); #if !defined(CONFIG_BT_CTLR_TIFS_HW) @@ -1164,31 +1166,11 @@ uint32_t radio_tmr_start_us(uint8_t trx, uint32_t start_us) hal_sw_switch_timer_clear_ppi_config(); #endif /* CONFIG_SOC_SERIES_NRF53X */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ - - /* start_us could be the current count in the timer */ - uint32_t now_us = start_us; - - /* Setup PPI while determining the latency in doing so */ - do { - /* Set start to be, now plus the determined latency */ - start_us = (now_us << 1) - start_us; - - /* Setup compare event with min. 1 us offset */ - EVENT_TIMER->EVENTS_COMPARE[0] = 0U; - nrf_timer_cc_set(EVENT_TIMER, 0, start_us + 1U); - - /* Capture the current time */ - nrf_timer_task_trigger(EVENT_TIMER, NRF_TIMER_TASK_CAPTURE1); - - now_us = EVENT_TIMER->CC[1]; - } while ((now_us > start_us) && (EVENT_TIMER->EVENTS_COMPARE[0] == 0U)); - - return start_us + 1U; } uint32_t radio_tmr_start_now(uint8_t trx) { - uint32_t start_us; + uint32_t now, start; hal_radio_enable_on_tick_ppi_config_and_enable(trx); @@ -1211,12 +1193,25 @@ uint32_t radio_tmr_start_now(uint8_t trx) /* Capture the current time */ nrf_timer_task_trigger(EVENT_TIMER, NRF_TIMER_TASK_CAPTURE1); - start_us = EVENT_TIMER->CC[1]; + now = EVENT_TIMER->CC[1]; + start = now; + + /* Setup PPI while determining the latency in doing so */ + do { + /* Set start to be, now plus the determined latency */ + start = (now << 1) - start; + + /* Setup compare event with min. 1 us offset */ + EVENT_TIMER->EVENTS_COMPARE[0] = 0U; + nrf_timer_cc_set(EVENT_TIMER, 0, start + 1); + + /* Capture the current time */ + nrf_timer_task_trigger(EVENT_TIMER, NRF_TIMER_TASK_CAPTURE1); - /* Setup radio start at current time */ - start_us = radio_tmr_start_us(trx, start_us); + now = EVENT_TIMER->CC[1]; + } while ((now > start) && (EVENT_TIMER->EVENTS_COMPARE[0] == 0U)); - return start_us; + return start + 1; } uint32_t radio_tmr_start_get(void) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h index a54f958711f..3e4e05a3b4e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h @@ -127,7 +127,7 @@ void radio_tmr_status_reset(void); void radio_tmr_tifs_set(uint32_t tifs); uint32_t radio_tmr_start(uint8_t trx, uint32_t ticks_start, uint32_t remainder); uint32_t radio_tmr_start_tick(uint8_t trx, uint32_t tick); -uint32_t radio_tmr_start_us(uint8_t trx, uint32_t us); +void radio_tmr_start_us(uint8_t trx, uint32_t us); uint32_t radio_tmr_start_now(uint8_t trx); uint32_t radio_tmr_start_get(void); void radio_tmr_stop(void); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c index 2f1c150bdb4..6fe8582ffe6 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c @@ -252,7 +252,6 @@ void lll_scan_aux_isr_aux_setup(void *param) uint32_t aux_offset_us; uint32_t aux_start_us; struct lll_scan *lll; - uint32_t start_us; uint8_t phy_aux; uint32_t hcto; @@ -337,15 +336,13 @@ void lll_scan_aux_isr_aux_setup(void *param) aux_start_us -= lll_radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8); aux_start_us -= window_widening_us; aux_start_us -= EVENT_JITTER_US; - - start_us = radio_tmr_start_us(0, aux_start_us); + radio_tmr_start_us(0, aux_start_us); /* Setup header complete timeout */ - hcto = start_us; - hcto += EVENT_JITTER_US; - hcto += window_widening_us; - hcto += lll_radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8); + hcto = ftr->radio_end_us + aux_offset_us; hcto += window_size_us; + hcto += window_widening_us; + hcto += EVENT_JITTER_US; hcto += radio_rx_chain_delay_get(phy_aux, PHY_FLAGS_S8); hcto += addr_us_get(phy_aux); radio_tmr_hcto_configure(hcto); @@ -361,7 +358,7 @@ void lll_scan_aux_isr_aux_setup(void *param) #if defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) radio_gpio_lna_setup(); - radio_gpio_pa_lna_enable(start_us + + radio_gpio_pa_lna_enable(aux_start_us + radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8) - HAL_RADIO_GPIO_LNA_OFFSET); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index b962d77314c..801d539a11f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -654,7 +654,6 @@ static void isr_aux_setup(void *param) uint32_t aux_offset_us; uint32_t aux_start_us; struct lll_sync *lll; - uint32_t start_us; uint8_t phy_aux; uint32_t hcto; @@ -737,15 +736,13 @@ static void isr_aux_setup(void *param) aux_start_us -= lll_radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8); aux_start_us -= window_widening_us; aux_start_us -= EVENT_JITTER_US; - - start_us = radio_tmr_start_us(0, aux_start_us); + radio_tmr_start_us(0, aux_start_us); /* Setup header complete timeout */ - hcto = start_us; - hcto += EVENT_JITTER_US; - hcto += window_widening_us; - hcto += lll_radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8); + hcto = ftr->radio_end_us + aux_offset_us; hcto += window_size_us; + hcto += window_widening_us; + hcto += EVENT_JITTER_US; hcto += radio_rx_chain_delay_get(phy_aux, PHY_FLAGS_S8); hcto += addr_us_get(phy_aux); radio_tmr_hcto_configure(hcto); @@ -761,7 +758,7 @@ static void isr_aux_setup(void *param) #if defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) radio_gpio_lna_setup(); - radio_gpio_pa_lna_enable(start_us + + radio_gpio_pa_lna_enable(aux_start_us + radio_rx_ready_delay_get(phy_aux, PHY_FLAGS_S8) - HAL_RADIO_GPIO_LNA_OFFSET); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c index fe3e6ad8178..a6d00f7396d 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c @@ -840,7 +840,7 @@ static void isr_rx(void *param) hcto -= (EVENT_CLOCK_JITTER_US << 1); start_us = hcto; - hcto = radio_tmr_start_us(0U, start_us); + radio_tmr_start_us(0U, start_us); /* Add 4 us + 4 us + (4 us * subevents so far), as radio * was setup to listen 4 us early and subevents could have @@ -858,7 +858,7 @@ static void isr_rx(void *param) hcto += radio_tmr_ready_restore(); start_us = hcto; - hcto = radio_tmr_start_us(0U, start_us); + radio_tmr_start_us(0U, start_us); hcto += ((EVENT_JITTER_US + EVENT_TICKER_RES_MARGIN_US + lll->window_widening_event_us) << 1) + From c173c02d3c2476867e01c6df4c2e0c525cb6fe4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:01:22 +0100 Subject: [PATCH 482/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix missing is_aux_sched flag being reset" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 571dea6a50d643042f74a928cd9447da503206ae. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index 30f9d512d15..afafe9bdb01 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -845,7 +845,6 @@ static void isr_common_done(void *param) #if defined(CONFIG_BT_CTLR_ADV_EXT) lll->is_adv_ind = 0U; - lll->is_aux_sched = 0U; #endif /* CONFIG_BT_CTLR_ADV_EXT */ /* setup tIFS switching */ From 93cc6c93b991edcfe1290514370034447b21ac54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:01:35 +0100 Subject: [PATCH 483/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix receiving spurious PDU in active scanning" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9861f23316d54c4d07c12703e485995023636e90. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index afafe9bdb01..3f0113299cb 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -1277,7 +1277,7 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, } else if (((pdu_adv_rx->type == PDU_ADV_TYPE_ADV_IND) || (pdu_adv_rx->type == PDU_ADV_TYPE_SCAN_IND)) && (pdu_adv_rx->len <= sizeof(struct pdu_adv_adv_ind)) && - lll->type && !lll->state && + lll->type && #if defined(CONFIG_BT_CENTRAL) !lll->conn) { #else /* !CONFIG_BT_CENTRAL */ From 7b0338292642a683c9089439c69a49b259dffe91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:01:55 +0100 Subject: [PATCH 484/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix node rx leak on extended scanning stop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9926e3132909b916d578f1f769c9d71f2dadc218. Signed-off-by: Tomasz Moń --- .../bluetooth/controller/ll_sw/ull_scan_aux.c | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index db510e6a3d3..9a3794acbfc 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -716,26 +716,13 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx) * immediately since we are in sync context. */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || aux->rx_last) { - /* If scan is being disabled, rx could already be - * enqueued before coming here to ull_scan_aux_rx_flush. - * Check if rx not the last in the list of received PDUs - * then add it, else do not add it, to avoid duplicate - * report generation, release and probable infinite loop - * processing of the list. + /* If scan is being disabled, rx has already been + * enqueued before coming here, ull_scan_aux_rx_flush. + * Do not add it, to avoid duplicate report generation, + * release and probable infinite loop processing the + * list. */ if (unlikely(scan->is_stop)) { - /* Add the node rx to aux context list of node - * rx if not already added when coming here to - * ull_scan_aux_rx_flush. This is handling a - * race condition where in the last PDU in - * chain is received and at the same time scan - * is being disabled. - */ - if (aux->rx_last != rx) { - aux->rx_last->rx_ftr.extra = rx; - aux->rx_last = rx; - } - return; } From ab7f33ad906f0ba50bdb99e1892d128f11d4e452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:02:08 +0100 Subject: [PATCH 485/501] Revert "[nrf fromtree] Bluetooth: Controller: Fix scan aux leak on periodic sync terminate" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a5f2b0376836bbac711f702587f812a1444581d2. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/ll_sw/ull_scan_aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index 9a3794acbfc..9f39ac1582c 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -737,7 +737,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx) ll_rx_sched(); sync = HDR_LLL2ULL(sync_lll); - if (unlikely(sync->is_stop && sync_lll->lll_aux)) { + if (unlikely(sync->is_stop)) { return; } } From 5525d2346cd1b46b6c53aaf17c7eed1b16beb283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:02:21 +0100 Subject: [PATCH 486/501] Revert "[nrf fromtree] tests: kernel: timer_behavior: Fix building on targets with small SRAM" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 232951035e295219012c1006458cf3f59b3718f7. Signed-off-by: Tomasz Moń --- tests/kernel/timer/timer_behavior/Kconfig | 5 ----- tests/kernel/timer/timer_behavior/testcase.yaml | 1 - 2 files changed, 6 deletions(-) diff --git a/tests/kernel/timer/timer_behavior/Kconfig b/tests/kernel/timer/timer_behavior/Kconfig index 4ed23993aeb..9b211aee558 100644 --- a/tests/kernel/timer/timer_behavior/Kconfig +++ b/tests/kernel/timer/timer_behavior/Kconfig @@ -7,11 +7,6 @@ source "Kconfig.zephyr" config TIMER_TEST_SAMPLES int "The number of timer samples to gather for statistics" - default 1000 if (SRAM_SIZE < 24) - default 2000 if (SRAM_SIZE < 32) - default 3000 if (SRAM_SIZE < 48) - default 5000 if (SRAM_SIZE < 64) - default 7000 if (SRAM_SIZE < 96) default 10000 config TIMER_TEST_PERIOD diff --git a/tests/kernel/timer/timer_behavior/testcase.yaml b/tests/kernel/timer/timer_behavior/testcase.yaml index 707bd7668de..86a13d8159f 100644 --- a/tests/kernel/timer/timer_behavior/testcase.yaml +++ b/tests/kernel/timer/timer_behavior/testcase.yaml @@ -1,7 +1,6 @@ tests: kernel.timer.timer: tags: kernel timer - min_ram: 16 platform_type: - mcu # Really want to exclude renode not the physical boards, but no good From 5c29c4a4a4b5f3042b7e03a241508e7ab369d7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:03:20 +0100 Subject: [PATCH 487/501] Revert "[nrf fromtree] tfm: Update TF-M for fix to return error code with invalid params in NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9052fcbb7f5397f1f0dba9b5f9ca8c829e4f46d8. Signed-off-by: Tomasz Moń --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index d4044e23b8a..a03415bd475 100644 --- a/west.yml +++ b/west.yml @@ -235,7 +235,7 @@ manifest: groups: - debug - name: trusted-firmware-m - revision: d7c82cb813e283b96770ba19b68a50d6bcc9931f + revision: 4c984817d861512edaeca27b83308e9b9915a98a path: modules/tee/tf-m/trusted-firmware-m groups: - tee @@ -245,7 +245,7 @@ manifest: groups: - tee - name: tf-m-tests - revision: bcb53bccccdc05c713aade707e7a8ddad35c210f + revision: c99a86b295c4887520da9d8402566d7f225c974e path: modules/tee/tf-m/tf-m-tests groups: - tee From ac411d6b114128573fa35093a00c96ad3567889f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:03:42 +0100 Subject: [PATCH 488/501] Revert "[nrf fromlist] linker: correct linker script _flash_used calculation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 731d4be8bb86159cbe48ea19998ba7451e70cef9. Signed-off-by: Tomasz Moń --- Kconfig.zephyr | 25 ------------------- .../arm/aarch32/cortex_a_r/scripts/linker.ld | 9 ++----- .../arm/aarch32/cortex_m/scripts/linker.ld | 9 ++----- include/zephyr/arch/arm64/scripts/linker.ld | 9 ++----- include/zephyr/arch/riscv/common/linker.ld | 9 ++----- 5 files changed, 8 insertions(+), 53 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 6f364c9d4c1..c3db85dab30 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -264,31 +264,6 @@ config LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT If unsure, say Y. -config LINKER_LAST_SECTION_ID - bool "Last section identifier" - default y - help - If enabled, the last section will contain an identifier. - This ensures that the '_flash_used' linker symbol will always be - correctly calculated, even in cases where the location counter may - have been incremented for alignment purposes but no data is placed - after alignment. - - Note: in cases where the flash is fully used, for example application - specific data is written at the end of the flash area, then writing a - last section identifier may cause rom region overflow. - In such cases this setting should be disabled. - -config LINKER_LAST_SECTION_ID_PATTERN - hex "Last section identifier pattern" - default "0xE015E015" - depends on LINKER_LAST_SECTION_ID - help - Pattern to fill into last section as identifier. - Default pattern is 0xE015 (end of last section), but any pattern can - be used. - The size of the pattern must not exceed 4 bytes. - endmenu # "Linker Sections" endmenu diff --git a/include/zephyr/arch/arm/aarch32/cortex_a_r/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_a_r/scripts/linker.ld index a093d8e1aa3..6be96679436 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_a_r/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_a_r/scripts/linker.ld @@ -386,17 +386,12 @@ GROUP_END(OCM) LINKER_DT_SECTIONS() /* Must be last in romable region */ - SECTION_PROLOGUE(.last_section,,) + SECTION_PROLOGUE(.last_section,(NOLOAD),) { -#ifdef CONFIG_LINKER_LAST_SECTION_ID - /* Fill last section with a word to ensure location counter and actual rom - * region data usage match. */ - LONG(CONFIG_LINKER_LAST_SECTION_ID_PATTERN) -#endif } GROUP_LINK_IN(ROMABLE_REGION) /* To provide the image size as a const expression, * calculate this value here. */ - _flash_used = LOADADDR(.last_section) + SIZEOF(.last_section) - __rom_region_start; + _flash_used = LOADADDR(.last_section) - __rom_region_start; } diff --git a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld index ce229d1d78c..c36b98ce25b 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -487,17 +487,12 @@ GROUP_END(DTCM) LINKER_DT_SECTIONS() /* Must be last in romable region */ -SECTION_PROLOGUE(.last_section,,) +SECTION_PROLOGUE(.last_section,(NOLOAD),) { -#ifdef CONFIG_LINKER_LAST_SECTION_ID - /* Fill last section with a word to ensure location counter and actual rom - * region data usage match. */ - LONG(CONFIG_LINKER_LAST_SECTION_ID_PATTERN) -#endif } GROUP_LINK_IN(ROMABLE_REGION) /* To provide the image size as a const expression, * calculate this value here. */ -_flash_used = LOADADDR(.last_section) + SIZEOF(.last_section) - __rom_region_start; +_flash_used = LOADADDR(.last_section) - __rom_region_start; } diff --git a/include/zephyr/arch/arm64/scripts/linker.ld b/include/zephyr/arch/arm64/scripts/linker.ld index c8c28e6b46c..abe65d617f0 100644 --- a/include/zephyr/arch/arm64/scripts/linker.ld +++ b/include/zephyr/arch/arm64/scripts/linker.ld @@ -323,17 +323,12 @@ SECTIONS /* Must be last in romable region */ - SECTION_PROLOGUE(.last_section,,) + SECTION_PROLOGUE(.last_section,(NOLOAD),) { -#ifdef CONFIG_LINKER_LAST_SECTION_ID - /* Fill last section with a word to ensure location counter and actual rom - * region data usage match. */ - LONG(CONFIG_LINKER_LAST_SECTION_ID_PATTERN) -#endif } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) /* To provide the image size as a const expression, * calculate this value here. */ - _flash_used = LOADADDR(.last_section) + SIZEOF(.last_section) - __rom_region_start; + _flash_used = LOADADDR(.last_section) - __rom_region_start; } diff --git a/include/zephyr/arch/riscv/common/linker.ld b/include/zephyr/arch/riscv/common/linker.ld index 52f0a2b97e8..e5b623e0506 100644 --- a/include/zephyr/arch/riscv/common/linker.ld +++ b/include/zephyr/arch/riscv/common/linker.ld @@ -399,18 +399,13 @@ GROUP_END(DTCM) */ #ifdef CONFIG_XIP /* Must be last in romable region */ -SECTION_PROLOGUE(.last_section,,) +SECTION_PROLOGUE(.last_section,(NOLOAD),) { -#ifdef CONFIG_LINKER_LAST_SECTION_ID - /* Fill last section with a word to ensure location counter and actual rom - * region data usage match. */ - LONG(CONFIG_LINKER_LAST_SECTION_ID_PATTERN) -#endif } GROUP_LINK_IN(ROMABLE_REGION) /* To provide the image size as a const expression, * calculate this value here. */ -__rom_region_end = LOADADDR(.last_section) + SIZEOF(.last_section); +__rom_region_end = LOADADDR(.last_section); __rom_region_size = __rom_region_end - __rom_region_start; #endif From a8a974c7133739aed9820a2485939df8cff8d158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 3 Nov 2022 13:15:57 +0100 Subject: [PATCH 489/501] Revert "[nrf fromtree] net: wifi: Fix MFP when security type is not given" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cbbd5f9b0f7ce55372ebccaecebbd7da73004ebe. Signed-off-by: Tomasz Moń --- subsys/net/l2/wifi/wifi_shell.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index ed13e7cf32a..8ef2f246369 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -184,9 +184,7 @@ static int __wifi_args_to_params(size_t argc, char *argv[], if (idx < argc) { params->psk = argv[idx]; params->psk_length = strlen(argv[idx]); - /* Defaults */ params->security = WIFI_SECURITY_TYPE_PSK; - params->mfp = WIFI_MFP_OPTIONAL; idx++; /* Security type (optional) */ @@ -197,21 +195,21 @@ static int __wifi_args_to_params(size_t argc, char *argv[], params->security = security; } idx++; - - /* MFP (optional) */ - if (idx < argc) { - unsigned int mfp = strtol(argv[idx], &endptr, 10); - - if (mfp <= WIFI_MFP_REQUIRED) { - params->mfp = mfp; - } - idx++; - } } } else { params->security = WIFI_SECURITY_TYPE_NONE; } + /* MFP (optional) */ + params->mfp = WIFI_MFP_OPTIONAL; + if (idx < argc) { + unsigned int mfp = strtol(argv[idx], &endptr, 10); + + if (mfp <= WIFI_MFP_REQUIRED) { + params->mfp = mfp; + } + idx++; + } return 0; } @@ -441,8 +439,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, "\n" "\n" "0:None, 1:PSK, 2:PSK-256, 3:SAE\n" - "\n" - ": 0:Disable, 1:Optional, 2:Required", + " Date: Thu, 3 Nov 2022 07:09:00 +0100 Subject: [PATCH 490/501] Revert "[nrf noup] ci: clang: Remove incorrect zephyr path" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c8787bd14c99f2dcbdd26a9786e01ad6c8311c63. Signed-off-by: Tomasz Moń --- .github/workflows/clang.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 297678dcdb3..925ec771219 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -100,6 +100,7 @@ jobs: ccache -M 10G -s - name: Build test plan with Twister + working-directory: ./zephyr id: twister_test_plan run: | export ZEPHYR_BASE=${PWD} From 83d292eda7a8a052643969b848931f84a6751f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 3 Nov 2022 07:09:08 +0100 Subject: [PATCH 491/501] Revert "[nrf noup] ci: clang: Use ubuntu-latest instead of zephyr_runner" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a3c7869f348491ecd25fae687a8d4e4a5928302f. Signed-off-by: Tomasz Moń --- .github/workflows/clang.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 925ec771219..6cf18f8e193 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -11,7 +11,7 @@ jobs: with: access_token: ${{ github.token }} clang-build: - runs-on: ubuntu-latest + runs-on: zephyr_runner needs: clang-build-prep container: image: ghcr.io/zephyrproject-rtos/ci:v0.24.2 From 29c902e624eb80dce26971355c590eb901aa3ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 2 Nov 2022 14:55:43 +0100 Subject: [PATCH 492/501] Revert "[nrf noup] net: wifi: Add support for WPA supplicant" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0806a1a907b2659409d28141fe2e67d2316c8347. Signed-off-by: Tomasz Moń --- subsys/net/ip/Kconfig.stats | 2 +- subsys/net/ip/net_private.h | 2 +- subsys/net/l2/wifi/wifi_mgmt.c | 45 +++++++++++++++------------------- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 147b002d603..639685e420d 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -127,7 +127,7 @@ config NET_STATISTICS_POWER_MANAGEMENT config NET_STATISTICS_WIFI bool "Wi-Fi statistics" - depends on NET_L2_WIFI_MGMT + depends on NET_L2_WIFI_MGMT || NET_L2_NRF_WIFI_MGMT default y help Keep track of Wi-Fi related statistics. Note that this diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 5f1a00975ab..24ef97fbe4f 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -24,7 +24,7 @@ * NOTE: Update comments here and calculate which struct occupies max size. */ -#if defined(CONFIG_NET_L2_WIFI_MGMT) +#if defined(CONFIG_NET_L2_WIFI_MGMT) || defined(CONFIG_NET_L2_NRF_WIFI_MGMT) #include #define NET_EVENT_INFO_MAX_SIZE sizeof(struct wifi_scan_result) diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 994cce913d5..92aa47a9bbd 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -12,9 +12,6 @@ LOG_MODULE_REGISTER(net_wifi_mgmt, CONFIG_NET_L2_WIFI_MGMT_LOG_LEVEL); #include #include #include -#ifdef CONFIG_WPA_SUPP -#include "supp_api.h" -#endif static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) @@ -22,15 +19,12 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, struct wifi_connect_req_params *params = (struct wifi_connect_req_params *)data; const struct device *dev = net_if_get_device(iface); -#ifndef CONFIG_WPA_SUPP struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; - if (off_api == NULL || off_api->connect == NULL) { return -ENOTSUP; } -#endif /* CONFIG_WPA_SUPP */ LOG_HEXDUMP_DBG(params->ssid, params->ssid_length, "ssid"); LOG_HEXDUMP_DBG(params->psk, params->psk_length, "psk"); @@ -54,11 +48,8 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, !params->ssid) { return -EINVAL; } -#ifdef CONFIG_WPA_SUPP - return zephyr_supp_connect(dev, params); -#else + return off_api->connect(dev, params); -#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_CONNECT, wifi_connect); @@ -106,10 +97,6 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); - -#ifdef CONFIG_WPA_SUPP - return zephyr_supp_disconnect(dev); -#else struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -118,7 +105,6 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, } return off_api->disconnect(dev); -#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_DISCONNECT, wifi_disconnect); @@ -182,25 +168,27 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE, wifi_ap_disable); static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { + int ret; const struct device *dev = net_if_get_device(iface); + struct net_wifi_mgmt_offload *off_api = + (struct net_wifi_mgmt_offload *) dev->api; struct wifi_iface_status *status = data; + if (off_api == NULL || off_api->iface_status == NULL) { + return -ENOTSUP; + } + if (!data || len != sizeof(*status)) { return -EINVAL; } -#ifdef CONFIG_WPA_SUPP - return zephyr_supp_status(dev, status); -#else - struct net_wifi_mgmt_offload *off_api = - (struct net_wifi_mgmt_offload *) dev->api; + ret = off_api->iface_status(dev, status); - if (off_api == NULL || off_api->iface_status == NULL) { - return -ENOTSUP; + if (ret) { + return ret; } - return off_api->iface_status(dev, status); -#endif /* CONFIG_WPA_SUPP */ + return 0; } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS, wifi_iface_status); @@ -216,6 +204,7 @@ void wifi_mgmt_raise_iface_status_event(struct net_if *iface, static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { + int ret; const struct device *dev = net_if_get_device(iface); struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -229,7 +218,13 @@ static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, return -EINVAL; } - return off_api->get_stats(dev, stats); + ret = off_api->get_stats(dev, stats); + + if (ret) { + return ret; + } + + return 0; } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats); #endif /* CONFIG_NET_STATISTICS_WIFI */ From f50bd53e08c94996a7974ae47fec8a787bf5afed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 3 Nov 2022 07:06:18 +0100 Subject: [PATCH 493/501] Revert "[nrf noup] tree-wide: support NCS Partition Manager (PM) definitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 125f659cd77d0232e05e10dfc7c56a1065a1d091. Signed-off-by: Tomasz Moń --- Kconfig.zephyr | 4 +- cmake/modules/kernel.cmake | 4 -- drivers/flash/soc_flash_nrf.c | 11 ----- .../arm/aarch32/cortex_m/scripts/linker.ld | 46 ------------------- include/zephyr/storage/flash_map.h | 6 --- soc/arm/common/cortex_m/arm_mpu_regions.c | 13 ------ subsys/fs/littlefs_fs.c | 7 +-- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ----------- 8 files changed, 4 insertions(+), 114 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index c3db85dab30..b623b2892c0 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -125,7 +125,9 @@ config FLASH_LOAD_SIZE endif # HAS_FLASH_LOAD_OFFSET config ROM_START_OFFSET - hex "ROM start offset" + hex + prompt "ROM start offset" if !BOOTLOADER_MCUBOOT + default 0x200 if BOOTLOADER_MCUBOOT default 0 help If the application is built for chain-loading by a bootloader this diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 56eb1896b84..10a4cdd8283 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -241,7 +241,3 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() - -if(ZEPHYR_NRF_MODULE_DIR) - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) -endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index bc414d1fc74..2b81f5e9c99 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,11 +37,6 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -142,12 +137,6 @@ static int flash_nrf_read(const struct device *dev, off_t addr, return 0; } -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld index c36b98ce25b..8f85c5a54c6 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -27,35 +27,6 @@ #define RAMABLE_REGION SRAM #endif -#if USE_PARTITION_MANAGER - -#include - -#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) -/* We are linking against S1, create symbol containing the flash ID of S0. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S0_ID; - -#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ - -#ifdef PM_S1_ID -/* We are linking against S0, create symbol containing the flash ID of S1. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S1_ID; -#endif /* PM_S1_ID */ - -#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ - -#define ROM_ADDR PM_ADDRESS -#define ROM_SIZE PM_SIZE - -#define RAM_SIZE PM_SRAM_SIZE -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -82,23 +53,6 @@ _image_1_primary_slot_id = PM_S1_ID; #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS #endif -#endif /* USE_PARTITION_MANAGER */ - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) -#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) -#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) -#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) -#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) -#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) -#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) -#endif - #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 0d5e32fc83b..c765efde882 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -257,10 +257,6 @@ const struct device *flash_area_get_device(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); -#if USE_PARTITION_MANAGER -#include -#else - #define FLASH_AREA_LABEL_EXISTS(label) \ DT_HAS_FIXED_PARTITION_LABEL(label) @@ -333,8 +329,6 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); #define FIXED_PARTITION_DEVICE(label) \ DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label))) -#endif /* USE_PARTITION_MANAGER */ - #ifdef __cplusplus } #endif diff --git a/soc/arm/common/cortex_m/arm_mpu_regions.c b/soc/arm/common/cortex_m/arm_mpu_regions.c index d44c2ee05b3..477dc30566c 100644 --- a/soc/arm/common/cortex_m/arm_mpu_regions.c +++ b/soc/arm/common/cortex_m/arm_mpu_regions.c @@ -9,9 +9,6 @@ #include #include "arm_mpu_mem_cfg.h" -#if USE_PARTITION_MANAGER -#include -#endif static const struct arm_mpu_region mpu_regions[] = { /* Region 0 */ @@ -25,14 +22,6 @@ static const struct arm_mpu_region mpu_regions[] = { #endif /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", -#if USE_PARTITION_MANAGER - PM_SRAM_ADDRESS, -#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) - REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), -#else - REGION_RAM_ATTR(REGION_SRAM_SIZE)), -#endif -#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -41,8 +30,6 @@ static const struct arm_mpu_region mpu_regions[] = { REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif -#endif /* USE_PARTITION_MANAGER */ - /* DT-defined regions */ LINKER_DT_REGION_MPU(ARM_MPU_REGION_INIT) }; diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index 6bfdc0cb8a3..e19c350e854 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -936,12 +936,7 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = DT_INST_PROP(inst, mount_point), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *) \ - COND_CODE_1(USE_PARTITION_MANAGER, \ - (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ - (FIXED_PARTITION_ID(littlefs_storage)), \ - (FIXED_PARTITION_ID(storage)))), \ - (DT_FIXED_PARTITION_ID(FS_PARTITION(inst)))), \ + .storage_dev = (void *)DT_FIXED_PARTITION_ID(FS_PARTITION(inst)), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index 9996e1d74d9..a74e46b8520 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,35 +13,8 @@ extern "C" { #endif -#if CONFIG_PARTITION_MANAGER_ENABLED - -#include "pm_config.h" - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) -#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE -#else -/* The current image is a child image in a different domain than the image - * which defined the required values. To reach the values of the parent domain - * we use the 'PM__' variant of the define. - */ -#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ - -#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ - -#else - -#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) -#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) - -#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From 1245d01e7f6a366770c01e6156726fe058760c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 3 Nov 2022 07:09:14 +0100 Subject: [PATCH 494/501] Revert "[nrf noup] ci: clang: parallel execution" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ae483a6bad7ad9c46b243fdaa149d2f20e8617d6. Signed-off-by: Tomasz Moń --- .github/workflows/clang.yaml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 6cf18f8e193..d315d1daf49 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -22,13 +22,11 @@ jobs: fail-fast: false matrix: platform: ["native_posix"] - subset: [1, 2, 3, 4, 5] env: ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0 CLANG_ROOT_DIR: /usr/lib/llvm-12 COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} - MATRIX_SIZE: 5 outputs: report_needed: ${{ steps.twister.outputs.report_needed }} steps: @@ -87,7 +85,7 @@ jobs: id: cache-ccache uses: zephyrproject-rtos/action-s3-cache@v1 with: - key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.subset }}-ccache + key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.platform }}-ccache path: /github/home/.ccache aws-s3-bucket: ccache.zephyrproject.org aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }} @@ -99,17 +97,6 @@ jobs: test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache ccache -M 10G -s - - name: Build test plan with Twister - working-directory: ./zephyr - id: twister_test_plan - run: | - export ZEPHYR_BASE=${PWD} - export ZEPHYR_TOOLCHAIN_VARIANT=llvm - - # check if we need to run a full twister or not based on files changed - python3 ./scripts/ci/test_plan.py -p native_posix -c origin/${BASE_REF}.. - - - name: Run Tests with Twister id: twister run: | @@ -123,7 +110,7 @@ jobs: if [ -s testplan.json ]; then echo "::set-output name=report_needed::1"; # Full twister but with options based on changes - ./scripts/twister --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 --subset ${{matrix.subset}}/${MATRIX_SIZE} + ./scripts/twister --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 else # if nothing is run, skip reporting step echo "::set-output name=report_needed::0"; @@ -137,7 +124,7 @@ jobs: if: always() && steps.twister.outputs.report_needed != 0 uses: actions/upload-artifact@v2 with: - name: Unit Test Results (Subset ${{ matrix.subset }}) + name: Unit Test Results (Subset ${{ matrix.platform }}) path: twister-out/twister.xml clang-build-results: From 249baafa95291f7a72f7f6621c237c69e86e3abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 3 Nov 2022 07:04:29 +0100 Subject: [PATCH 495/501] Revert "[nrf noup] net: ip: Fix nRF Wi-Fi management events" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 98bc3a7a6b3917ce5a058e7a7271d3036edffb88. Signed-off-by: Tomasz Moń --- subsys/net/ip/net_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 24ef97fbe4f..867bcbee0fd 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -24,7 +24,7 @@ * NOTE: Update comments here and calculate which struct occupies max size. */ -#if defined(CONFIG_NET_L2_WIFI_MGMT) || defined(CONFIG_NET_L2_NRF_WIFI_MGMT) +#ifdef CONFIG_NET_L2_WIFI_MGMT #include #define NET_EVENT_INFO_MAX_SIZE sizeof(struct wifi_scan_result) From 2d4d671ce78f0b3d0e3c68c82e16d03651f5a2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 3 Nov 2022 10:57:16 +0100 Subject: [PATCH 496/501] Revert "[nrf noup] Bluetooth: update experimental for qualification" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This partially reverts commit 6324c86bb8cce91efa0a36b9d0e4d49c39b386b7 in order to solve OSS history check problems. Unfortunately, full revert is not possible here because the downstream fork already contains part of the reverted commit in 26f5897819f8b7f0ecb46f693ecf226deb54cca7 ("Bluetooth: Mark Extended Adv as stable") from upstream. In other words, this commit can be treated as a full revert of 6324c86bb8cce91efa0a36b9d0e4d49c39b386b7 followed by a cherry-pick of 26f5897819f8b7f0ecb46f693ecf226deb54cca7. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/Kconfig | 3 +-- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 1d5dc465fe1..a0383332597 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -95,8 +95,7 @@ choice BT_LL_CHOICE Select the Bluetooth Link Layer to compile. config BT_LL_SW_SPLIT - bool "Software-based BLE Link Layer [EXPERIMENTAL]" - select EXPERIMENTAL + bool "Software-based BLE Link Layer" select ENTROPY_GENERATOR select NRF_HW_TIMER0_RESERVED select NRF_HW_RTC0_RESERVED diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index c9521672fbf..baaac75903e 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -48,7 +48,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" + bool "L2CAP Enhanced Credit Based Flow Control support" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From 60d49954ad45ca70dfe527c847c13fd73837582d Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 20 Nov 2020 14:44:03 +0100 Subject: [PATCH 497/501] [nrf noup] Bluetooth: update experimental for qualification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Kconfig options for qualification: - Remove experimental on qualified feature. - Add experimental on unqualified feature. - BT_L2CAP_ECRED is not marked as experimental upstream and we qualify it downstream. Signed-off-by: Joakim Andersson Signed-off-by: Trond Einar Snekvik Signed-off-by: Martí Bolívar Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Ingar Kulbrandstad Signed-off-by: Torsten Rasmussen (cherry picked from commit 1e8c632358761d97cf2d659eb9fdc316b4558547) Signed-off-by: Herman Berget (cherry picked from commit 42d8f92abdd10df8229ae4d5aabc8fbbe4b1aef9) (cherry picked from commit 6324c86bb8cce91efa0a36b9d0e4d49c39b386b7) Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/Kconfig | 3 ++- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index a4888748d7a..3d461daae08 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -103,7 +103,8 @@ choice BT_LL_CHOICE Select the Bluetooth Link Layer to compile. config BT_LL_SW_SPLIT - bool "Software-based BLE Link Layer" + bool "Software-based BLE Link Layer [EXPERIMENTAL]" + select EXPERIMENTAL select ENTROPY_GENERATOR select NRF_HW_TIMER0_RESERVED select NRF_HW_RTC0_RESERVED diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index baaac75903e..c9521672fbf 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -48,7 +48,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support" + bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From 2b67ba935211bec5d71a8bd5de3ea09c8d5133e6 Mon Sep 17 00:00:00 2001 From: Maciej Perkowski Date: Fri, 28 Jan 2022 12:02:58 +0100 Subject: [PATCH 498/501] [nrf noup] ci: clang: parallel execution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bring back parallel execution to the clang action. In the upstream they went to use a single dedicated powerfull agent to run this. We need to keep this as we have to base on agents available in github's cloud. zephyr_runner is upstream's proprietary agent inaccessible outside of upstream's CI. Use ubuntu-latest instead. Signed-off-by: Maciej Perkowski Signed-off-by: Gerard Marull-Paretas Signed-off-by: Dominik Ermel Signed-off-by: Torsten Rasmussen Signed-off-by: Maciej Perkowski (cherry picked from commit ae483a6bad7ad9c46b243fdaa149d2f20e8617d6 then squashed a3c7869f348491ecd25fae687a8d4e4a5928302f and resolved conflicts by removing redundant clang-build-prep and then squashed in c8787bd14c99f2dcbdd26a9786e01ad6c8311c63) Signed-off-by: Tomasz Moń --- .github/workflows/clang.yaml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index df0fa258c43..5a216da4db7 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -8,7 +8,7 @@ concurrency: jobs: clang-build: - runs-on: zephyr-runner-linux-x64-4xlarge + runs-on: ubuntu-latest container: image: ghcr.io/zephyrproject-rtos/ci:v0.24.5 options: '--entrypoint /bin/bash' @@ -18,11 +18,13 @@ jobs: fail-fast: false matrix: platform: ["native_posix"] + subset: [1, 2, 3, 4, 5] env: ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.1 LLVM_TOOLCHAIN_PATH: /usr/lib/llvm-15 COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} + MATRIX_SIZE: 5 outputs: report_needed: ${{ steps.twister.outputs.report_needed }} steps: @@ -83,7 +85,7 @@ jobs: id: cache-ccache uses: zephyrproject-rtos/action-s3-cache@v1 with: - key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.platform }}-ccache + key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.subset }}-ccache path: /github/home/.ccache aws-s3-bucket: ccache.zephyrproject.org aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }} @@ -95,6 +97,16 @@ jobs: test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache ccache -M 10G -s + - name: Build test plan with Twister + id: twister_test_plan + run: | + export ZEPHYR_BASE=${PWD} + export ZEPHYR_TOOLCHAIN_VARIANT=llvm + + # check if we need to run a full twister or not based on files changed + python3 ./scripts/ci/test_plan.py -p native_posix -c origin/${BASE_REF}.. + + - name: Run Tests with Twister id: twister run: | @@ -108,7 +120,7 @@ jobs: if [ -s testplan.json ]; then echo "report_needed=1" >> $GITHUB_OUTPUT # Full twister but with options based on changes - ./scripts/twister --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 + ./scripts/twister --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 --subset ${{matrix.subset}}/${MATRIX_SIZE} else # if nothing is run, skip reporting step echo "report_needed=0" >> $GITHUB_OUTPUT @@ -122,7 +134,7 @@ jobs: if: always() && steps.twister.outputs.report_needed != 0 uses: actions/upload-artifact@v3 with: - name: Unit Test Results (Subset ${{ matrix.platform }}) + name: Unit Test Results (Subset ${{ matrix.subset }}) path: twister-out/twister.xml clang-build-results: From 1ef1e8018df6ae49f1c9d1e1e8158d318ea91e91 Mon Sep 17 00:00:00 2001 From: Sigvart Hovland Date: Fri, 3 May 2019 14:21:52 +0200 Subject: [PATCH 499/501] [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partition Manager (PM) is a component of the nRF Connect SDK (NCS) which uses yaml files to resolve flash partition placement with a holistic view of the entire device, including each firmware image present on the flash device, and various subsystems, such as settings and NFFS. When this NCS extension is used, various source files which would use partition information from devicetree in "vanilla" zephyr instead use defines generated by PM instead. This commit removes support for HEX_FILES_TO_MERGE, as it conflicts with PM. The settings subsystem pm.yml defines a partition 'settings_storage'. The nffs subsystem pm.yml defines 'nffs_storage'. Leverage label translation to avoid patching partition names. Refer to the NCS documentation page for this feature for more details. This is a long-running out of tree patch which has been worked on by several people. The following sign-offs are in alphabetical order by first name. Signed-off-by: Andrzej Głąbek Signed-off-by: Andrzej Puzdrowski Signed-off-by: Dominik Ermel Signed-off-by: Håkon Øye Amundsen Signed-off-by: Ioannis Glaropoulos Signed-off-by: Joakim Andersson Signed-off-by: Johann Fischer Signed-off-by: Martí Bolívar Signed-off-by: Ole Sæther Signed-off-by: Robert Lubos Signed-off-by: Sebastian Bøe Signed-off-by: Sigvart Hovland Signed-off-by: Thomas Stenersen Signed-off-by: Torsten Rasmussen Signed-off-by: Øyvind Rønningstad Signed-off-by: Trond Einar Snekvik Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 125f659cd77d0232e05e10dfc7c56a1065a1d091) Signed-off-by: Tomasz Moń --- Kconfig.zephyr | 4 +- cmake/modules/kernel.cmake | 4 ++ drivers/flash/soc_flash_nrf.c | 11 +++++ .../arm/aarch32/cortex_m/scripts/linker.ld | 46 +++++++++++++++++++ include/zephyr/storage/flash_map.h | 6 +++ soc/arm/common/cortex_m/arm_mpu_regions.c | 13 ++++++ subsys/fs/littlefs_fs.c | 7 ++- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 +++++++++++ 8 files changed, 114 insertions(+), 4 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index e92db23d1fb..29614865672 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -125,9 +125,7 @@ config FLASH_LOAD_SIZE endif # HAS_FLASH_LOAD_OFFSET config ROM_START_OFFSET - hex - prompt "ROM start offset" if !BOOTLOADER_MCUBOOT - default 0x200 if BOOTLOADER_MCUBOOT + hex "ROM start offset" default 0 help If the application is built for chain-loading by a bootloader this diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 10a4cdd8283..56eb1896b84 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -241,3 +241,7 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() + +if(ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) +endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 2b81f5e9c99..bc414d1fc74 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,6 +37,11 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -137,6 +142,12 @@ static int flash_nrf_read(const struct device *dev, off_t addr, return 0; } +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld index 9620f96f406..3b4985175f0 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -26,6 +26,35 @@ #endif #define RAMABLE_REGION RAM +#if USE_PARTITION_MANAGER + +#include + +#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) +/* We are linking against S1, create symbol containing the flash ID of S0. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S0_ID; + +#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ + +#ifdef PM_S1_ID +/* We are linking against S0, create symbol containing the flash ID of S1. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S1_ID; +#endif /* PM_S1_ID */ + +#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ + +#define ROM_ADDR PM_ADDRESS +#define ROM_SIZE PM_SIZE + +#define RAM_SIZE PM_SRAM_SIZE +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -52,6 +81,23 @@ #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS #endif +#endif /* USE_PARTITION_MANAGER */ + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) +#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) +#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) +#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) +#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) +#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) +#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) +#endif + #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 31388eef573..ce0cc75e520 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -257,6 +257,10 @@ const struct device *flash_area_get_device(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); +#if USE_PARTITION_MANAGER +#include +#else + #define FLASH_AREA_LABEL_EXISTS(label) __DEPRECATED_MACRO \ DT_HAS_FIXED_PARTITION_LABEL(label) @@ -329,6 +333,8 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); #define FIXED_PARTITION_DEVICE(label) \ DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label))) +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/soc/arm/common/cortex_m/arm_mpu_regions.c b/soc/arm/common/cortex_m/arm_mpu_regions.c index 477dc30566c..d44c2ee05b3 100644 --- a/soc/arm/common/cortex_m/arm_mpu_regions.c +++ b/soc/arm/common/cortex_m/arm_mpu_regions.c @@ -9,6 +9,9 @@ #include #include "arm_mpu_mem_cfg.h" +#if USE_PARTITION_MANAGER +#include +#endif static const struct arm_mpu_region mpu_regions[] = { /* Region 0 */ @@ -22,6 +25,14 @@ static const struct arm_mpu_region mpu_regions[] = { #endif /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", +#if USE_PARTITION_MANAGER + PM_SRAM_ADDRESS, +#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) + REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), +#else + REGION_RAM_ATTR(REGION_SRAM_SIZE)), +#endif +#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -30,6 +41,8 @@ static const struct arm_mpu_region mpu_regions[] = { REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif +#endif /* USE_PARTITION_MANAGER */ + /* DT-defined regions */ LINKER_DT_REGION_MPU(ARM_MPU_REGION_INIT) }; diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index e19c350e854..6bfdc0cb8a3 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -936,7 +936,12 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = DT_INST_PROP(inst, mount_point), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *)DT_FIXED_PARTITION_ID(FS_PARTITION(inst)), \ + .storage_dev = (void *) \ + COND_CODE_1(USE_PARTITION_MANAGER, \ + (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ + (FIXED_PARTITION_ID(littlefs_storage)), \ + (FIXED_PARTITION_ID(storage)))), \ + (DT_FIXED_PARTITION_ID(FS_PARTITION(inst)))), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index a74e46b8520..9996e1d74d9 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,8 +13,35 @@ extern "C" { #endif +#if CONFIG_PARTITION_MANAGER_ENABLED + +#include "pm_config.h" + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) +#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE +#else +/* The current image is a child image in a different domain than the image + * which defined the required values. To reach the values of the parent domain + * we use the 'PM__' variant of the define. + */ +#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ + +#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ + +#else + +#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) +#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) + +#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From d92ace91e707deb4baf370ab59fe7deedc458c27 Mon Sep 17 00:00:00 2001 From: Krishna T Date: Mon, 10 Oct 2022 16:21:21 +0530 Subject: [PATCH 500/501] [nrf noup] net: wifi: Add support for WPA supplicant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If WPA supplicant is enabled at build time, then use the WPA supplicant APIs, else use offload driver APIs. Remove the unused macro NRF_WIFI_MGMT now. Signed-off-by: Krishna T (cherry picked from commit 0806a1a907b2659409d28141fe2e67d2316c8347) Signed-off-by: Tomasz Moń --- subsys/net/ip/Kconfig.stats | 2 +- subsys/net/l2/wifi/wifi_mgmt.c | 45 +++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/subsys/net/ip/Kconfig.stats b/subsys/net/ip/Kconfig.stats index 639685e420d..147b002d603 100644 --- a/subsys/net/ip/Kconfig.stats +++ b/subsys/net/ip/Kconfig.stats @@ -127,7 +127,7 @@ config NET_STATISTICS_POWER_MANAGEMENT config NET_STATISTICS_WIFI bool "Wi-Fi statistics" - depends on NET_L2_WIFI_MGMT || NET_L2_NRF_WIFI_MGMT + depends on NET_L2_WIFI_MGMT default y help Keep track of Wi-Fi related statistics. Note that this diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 92aa47a9bbd..994cce913d5 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -12,6 +12,9 @@ LOG_MODULE_REGISTER(net_wifi_mgmt, CONFIG_NET_L2_WIFI_MGMT_LOG_LEVEL); #include #include #include +#ifdef CONFIG_WPA_SUPP +#include "supp_api.h" +#endif static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) @@ -19,12 +22,15 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, struct wifi_connect_req_params *params = (struct wifi_connect_req_params *)data; const struct device *dev = net_if_get_device(iface); +#ifndef CONFIG_WPA_SUPP struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; + if (off_api == NULL || off_api->connect == NULL) { return -ENOTSUP; } +#endif /* CONFIG_WPA_SUPP */ LOG_HEXDUMP_DBG(params->ssid, params->ssid_length, "ssid"); LOG_HEXDUMP_DBG(params->psk, params->psk_length, "psk"); @@ -48,8 +54,11 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, !params->ssid) { return -EINVAL; } - +#ifdef CONFIG_WPA_SUPP + return zephyr_supp_connect(dev, params); +#else return off_api->connect(dev, params); +#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_CONNECT, wifi_connect); @@ -97,6 +106,10 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); + +#ifdef CONFIG_WPA_SUPP + return zephyr_supp_disconnect(dev); +#else struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -105,6 +118,7 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, } return off_api->disconnect(dev); +#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_DISCONNECT, wifi_disconnect); @@ -168,27 +182,25 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE, wifi_ap_disable); static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { - int ret; const struct device *dev = net_if_get_device(iface); - struct net_wifi_mgmt_offload *off_api = - (struct net_wifi_mgmt_offload *) dev->api; struct wifi_iface_status *status = data; - if (off_api == NULL || off_api->iface_status == NULL) { - return -ENOTSUP; - } - if (!data || len != sizeof(*status)) { return -EINVAL; } - ret = off_api->iface_status(dev, status); +#ifdef CONFIG_WPA_SUPP + return zephyr_supp_status(dev, status); +#else + struct net_wifi_mgmt_offload *off_api = + (struct net_wifi_mgmt_offload *) dev->api; - if (ret) { - return ret; + if (off_api == NULL || off_api->iface_status == NULL) { + return -ENOTSUP; } - return 0; + return off_api->iface_status(dev, status); +#endif /* CONFIG_WPA_SUPP */ } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS, wifi_iface_status); @@ -204,7 +216,6 @@ void wifi_mgmt_raise_iface_status_event(struct net_if *iface, static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { - int ret; const struct device *dev = net_if_get_device(iface); struct net_wifi_mgmt_offload *off_api = (struct net_wifi_mgmt_offload *) dev->api; @@ -218,13 +229,7 @@ static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, return -EINVAL; } - ret = off_api->get_stats(dev, stats); - - if (ret) { - return ret; - } - - return 0; + return off_api->get_stats(dev, stats); } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats); #endif /* CONFIG_NET_STATISTICS_WIFI */ From c995ff4d11c64a4ef9082ab13ebae637e88d1a03 Mon Sep 17 00:00:00 2001 From: Maciej Perkowski Date: Fri, 4 Nov 2022 13:56:32 +0100 Subject: [PATCH 501/501] test --- samples/hello_world/sample.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/hello_world/sample.yaml b/samples/hello_world/sample.yaml index bacc394eb45..a7ca4e7c837 100644 --- a/samples/hello_world/sample.yaml +++ b/samples/hello_world/sample.yaml @@ -1,7 +1,7 @@ sample: description: Hello World sample, the simplest Zephyr application - name: hello world + name: hello world common: tags: introduction integration_platforms: