diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index 3f84e2e..b8673be 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -6,13 +6,10 @@ add_library(mbed-ble INTERFACE) add_library(mbed-ble-cordio INTERFACE) add_library(mbed-ble-cordio_ll INTERFACE) -add_library(mbed-emac INTERFACE) add_library(mbed-lorawan INTERFACE) add_library(mbed-mbedtls STATIC EXCLUDE_FROM_ALL) add_library(mbed-nfc INTERFACE) -add_library(mbed-ppp INTERFACE) -add_library(mbed-wifi INTERFACE) add_subdirectory(nanostack) add_subdirectory(cellular) diff --git a/connectivity/cellular/CMakeLists.txt b/connectivity/cellular/CMakeLists.txt index 4198fec..037efc9 100644 --- a/connectivity/cellular/CMakeLists.txt +++ b/connectivity/cellular/CMakeLists.txt @@ -31,12 +31,13 @@ ) target_sources(mbed-cellular - PUBLIC + PRIVATE source/CellularNonIPSocket.cpp ) target_link_libraries(mbed-cellular PUBLIC - mbed-netsocket + mbed-netsocket-api mbed-core-flags + mbed-randlib ) diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt b/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt index 682b480..64dff13 100644 --- a/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE ALT1250_PPP.cpp ALT1250_PPP_CellularContext.cpp ALT1250_PPP_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/CMakeLists.txt b/connectivity/drivers/cellular/CMakeLists.txt index c32350b..9a0346f 100644 --- a/connectivity/drivers/cellular/CMakeLists.txt +++ b/connectivity/drivers/cellular/CMakeLists.txt @@ -15,6 +15,6 @@ add_subdirectory(UBLOX) target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) diff --git a/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt b/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt index fb984bf..aa221bb 100644 --- a/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt +++ b/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE STModCellular.cpp ) diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt b/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt index 82654ee..96e563b 100644 --- a/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt +++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE GEMALTO_CINTERION.cpp GEMALTO_CINTERION_CellularContext.cpp GEMALTO_CINTERION_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt b/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt index 6d4e280..9f23a73 100644 --- a/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE GENERIC_AT3GPP.cpp ) diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt b/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt index 73d860f..293be23 100644 --- a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE SARA4_PPP.cpp SARA4_PPP_CellularNetwork.cpp ) diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt index 2b90249..d4b43f2 100644 --- a/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE QUECTEL_BC95.cpp QUECTEL_BC95_CellularContext.cpp QUECTEL_BC95_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt index d0d0bfe..d73ac1b 100644 --- a/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE QUECTEL_BG96.cpp QUECTEL_BG96_CellularContext.cpp QUECTEL_BG96_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt index 95430ab..4c92c6a 100644 --- a/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE QUECTEL_EC2X.cpp ) diff --git a/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt index b78985a..7557466 100644 --- a/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE QUECTEL_M26.cpp QUECTEL_M26_CellularContext.cpp QUECTEL_M26_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt index 0878e89..5351df8 100644 --- a/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE QUECTEL_UG96.cpp QUECTEL_UG96_CellularContext.cpp ) diff --git a/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt b/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt index 91fe504..38e1656 100644 --- a/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt +++ b/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE RM1000_AT.cpp RM1000_AT_CellularContext.cpp RM1000_AT_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt index c510018..2f6c4b7 100644 --- a/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE TELIT_HE910.cpp ) diff --git a/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt index e683fb6..095086d 100644 --- a/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE TELIT_ME310.cpp TELIT_ME310_CellularContext.cpp TELIT_ME310_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt index a0e9506..437be9f 100644 --- a/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE TELIT_ME910.cpp TELIT_ME910_CellularContext.cpp TELIT_ME910_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt index c97e1ea..44077b7 100644 --- a/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt +++ b/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE UBLOX_AT.cpp UBLOX_AT_CellularContext.cpp UBLOX_AT_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt index 97340c0..e595767 100644 --- a/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt +++ b/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE UBLOX_N2XX.cpp UBLOX_N2XX_CellularContext.cpp UBLOX_N2XX_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt index 42afbf9..52182db 100644 --- a/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular - INTERFACE + PUBLIC . ) target_sources(mbed-cellular - INTERFACE + PRIVATE UBLOX_PPP.cpp ) diff --git a/connectivity/drivers/emac/CMakeLists.txt b/connectivity/drivers/emac/CMakeLists.txt index 56e7f47..95c91f6 100644 --- a/connectivity/drivers/emac/CMakeLists.txt +++ b/connectivity/drivers/emac/CMakeLists.txt @@ -1,6 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +if(NOT "DEVICE_EMAC=1" IN_LIST MBED_TARGET_DEFINITIONS) + return() +endif() + +add_library(mbed-emac STATIC EXCLUDE_FROM_ALL) + if("ARM_FM" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_ARM_FM) elseif("ARM_SSG" IN_LIST MBED_TARGET_LABELS) @@ -30,6 +36,8 @@ endif() target_link_libraries(mbed-emac - INTERFACE - mbed-netsocket + PUBLIC + mbed-netsocket-api + PRIVATE + mbed-rtos-flags ) diff --git a/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt index 73b0de8..16131c4 100644 --- a/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE fvp_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt index 4a94423..a0f92c1 100644 --- a/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE smsc9220_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt index 907800b..ea511ed 100644 --- a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt @@ -2,13 +2,13 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ./interface ) target_sources(mbed-emac - INTERFACE + PRIVATE interface/default_wifi_interface.cpp interface/scl_emac.cpp interface/SclAccessPoint.cpp diff --git a/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt index 1aff70d..a8a1594 100644 --- a/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt @@ -8,11 +8,11 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE kinetis_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt index 5593767..740b86f 100644 --- a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PRIVATE hardware_init_MK64F12.c ) diff --git a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt index 5d713be..e7e1ee8 100644 --- a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PRIVATE hardware_init_MK66F18.c ) diff --git a/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt index c6f25f9..de19e25 100644 --- a/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt @@ -8,11 +8,11 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE gd32xx_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt index 516c6da..1e26b47 100644 --- a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PRIVATE gd32f3_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt index 4879b64..7405e84 100644 --- a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PRIVATE gd32f4_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt index 43dab9d..798e419 100644 --- a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt @@ -8,11 +8,11 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE numaker_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt index d87d21c..cce4f2b 100644 --- a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE m480_eth.c ) diff --git a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt index f42680b..153b5b4 100644 --- a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE nuc472_eth.c ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt index 62dc137..f9c711d 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt @@ -6,11 +6,11 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE imx_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt index b93dc93..edc1214 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE lpc17_emac.cpp lpc_phy_dp83848.cpp ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt index 6a50075..d58001d 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt @@ -8,11 +8,11 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE lpc546xx_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt index a6faa3f..ea0e81a 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PRIVATE hardware_init_LPC546XX.c ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt index a6faa3f..ea0e81a 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PRIVATE hardware_init_LPC546XX.c ) diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt index 4be0de7..ff2c4a5 100644 --- a/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt @@ -4,12 +4,12 @@ add_subdirectory(lwip-wifi) target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE RdaWiFiInterface.cpp rda5981x_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakeLists.txt index 1dc5f4b..f869cd2 100644 --- a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE rza1_emac.cpp rza1_eth.cpp ) diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakeLists.txt index 73c1b95..66f5878 100644 --- a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . r_ether_rza2 r_ether_rza2/src/phy @@ -11,7 +11,7 @@ ) target_sources(mbed-emac - INTERFACE + PRIVATE rza2_emac.cpp r_ether_rza2/src/r_ether_rza2.c r_ether_rza2/src/phy/phy.c diff --git a/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt index 354c246..6391816 100644 --- a/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt @@ -12,12 +12,12 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE stm32xx_emac.cpp stm32xx_eth_irq_callback.cpp ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt index e5d922c..9a33dc7 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt @@ -6,11 +6,11 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE stm32f2_eth_conf.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt index 81691bf..951b5ee 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PRIVATE stm32f2_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt index 011678e..d952229 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt @@ -10,6 +10,6 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt index 91c025f..07d2f1d 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE stm32f4_eth_conf.c stm32f4_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt index 91c025f..07d2f1d 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE stm32f4_eth_conf.c stm32f4_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt index 91c025f..07d2f1d 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE stm32f4_eth_conf.c stm32f4_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt index 0c6b882..46dc00c 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt @@ -14,11 +14,11 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE stm32f7_eth_conf.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt index 752528b..7d61704 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PUBLIC stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt index 752528b..7d61704 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PUBLIC stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt index 752528b..7d61704 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PUBLIC stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt index 752528b..7d61704 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PUBLIC stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt index 752528b..7d61704 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PUBLIC stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt index 5c9e756..fc8668c 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt @@ -12,12 +12,12 @@ endif() target_include_directories(mbed-emac - INTERFACE + PUBLIC . ./lan8742 ) target_sources(mbed-emac - INTERFACE + PRIVATE lan8742/lan8742.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt index 5e6c9d6..09efa30 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PRIVATE stm32h7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt index 5e6c9d6..09efa30 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PRIVATE stm32h7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt index 5e6c9d6..635a02b 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PUBLIC stm32h7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_PORTENTA_H7/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_PORTENTA_H7/CMakeLists.txt index 5e6c9d6..635a02b 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_PORTENTA_H7/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_PORTENTA_H7/CMakeLists.txt @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-emac - INTERFACE + PUBLIC stm32h7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt index 2e4cc56..531a701 100644 --- a/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-emac - INTERFACE + PUBLIC . ) target_sources(mbed-emac - INTERFACE + PRIVATE sl_emac.cpp sl_eth_hw.c ) diff --git a/connectivity/drivers/wifi/CMakeLists.txt b/connectivity/drivers/wifi/CMakeLists.txt index 78ecb7f..6d85c6d 100644 --- a/connectivity/drivers/wifi/CMakeLists.txt +++ b/connectivity/drivers/wifi/CMakeLists.txt @@ -1,6 +1,8 @@ # Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +add_library(mbed-wifi STATIC EXCLUDE_FROM_ALL) + add_subdirectory(TARGET_WICED EXCLUDE_FROM_ALL) add_subdirectory(TARGET_STM EXCLUDE_FROM_ALL) @@ -13,5 +15,5 @@ target_link_libraries(mbed-wifi INTERFACE - mbed-netsocket + mbed-netsocket-api ) diff --git a/connectivity/drivers/wifi/COMPONENT_WHD/CMakeLists.txt b/connectivity/drivers/wifi/COMPONENT_WHD/CMakeLists.txt index 64190c0..d394ceb 100644 --- a/connectivity/drivers/wifi/COMPONENT_WHD/CMakeLists.txt +++ b/connectivity/drivers/wifi/COMPONENT_WHD/CMakeLists.txt @@ -3,39 +3,39 @@ add_subdirectory(whd-bsp-integration EXCLUDE_FROM_ALL) -add_library(mbed-cy-psoc6-whd-43012 INTERFACE) +add_library(mbed-cy-psoc6-whd-43012 STATIC EXCLUDE_FROM_ALL) target_include_directories(mbed-cy-psoc6-whd-43012 - INTERFACE + PUBLIC wifi-host-driver/resources/firmware/COMPONENT_43012 ) target_sources(mbed-cy-psoc6-whd-43012 - INTERFACE + PRIVATE wifi-host-driver/resources/firmware/COMPONENT_43012/43012C0-mfgtest_bin.c wifi-host-driver/resources/firmware/COMPONENT_43012/43012C0-mfgtest_clm_blob.c wifi-host-driver/resources/firmware/COMPONENT_43012/43012C0_bin.c wifi-host-driver/resources/firmware/COMPONENT_43012/43012C0_clm_blob.c ) -add_library(mbed-cy-psoc6-whd-43438 INTERFACE) +add_library(mbed-cy-psoc6-whd-43438 STATIC EXCLUDE_FROM_ALL) target_include_directories(mbed-cy-psoc6-whd-43438 - INTERFACE + PUBLIC wifi-host-driver/resources/firmware/COMPONENT_43438 ) target_sources(mbed-cy-psoc6-whd-43438 - INTERFACE + PRIVATE wifi-host-driver/resources/firmware/COMPONENT_43438/43438A1-mfgtest_bin.c wifi-host-driver/resources/firmware/COMPONENT_43438/43438A1-mfgtest_clm_blob.c wifi-host-driver/resources/firmware/COMPONENT_43438/43438A1_bin.c wifi-host-driver/resources/firmware/COMPONENT_43438/43438A1_clm_blob.c ) -add_library(mbed-cy-psoc6-whd-4343w INTERFACE) +add_library(mbed-cy-psoc6-whd-4343w STATIC EXCLUDE_FROM_ALL) target_include_directories(mbed-cy-psoc6-whd-4343w - INTERFACE + PUBLIC wifi-host-driver/resources/firmware/COMPONENT_4343W ) target_sources(mbed-cy-psoc6-whd-4343w - INTERFACE + PRIVATE wifi-host-driver/resources/firmware/COMPONENT_4343W/4343WA1-mfgtest_bin.c wifi-host-driver/resources/firmware/COMPONENT_4343W/4343WA1-mfgtest_clm_blob.c wifi-host-driver/resources/firmware/COMPONENT_4343W/4343WA1_bin.c @@ -97,10 +97,10 @@ target_include_directories(mbed-cy8ckit-064b0s2-4343w-whd INTERFACE wifi-host-driver/resources/nvram/TARGET_CY8CKIT_064B0S2_4343W) -add_library(mbed-cy-psoc6-whd INTERFACE) +add_library(mbed-cy-psoc6-whd STATIC EXCLUDE_FROM_ALL) target_include_directories(mbed-cy-psoc6-whd - INTERFACE + PUBLIC wifi-host-driver wifi-host-driver/inc wifi-host-driver/resources/resource_imp @@ -110,7 +110,7 @@ ) target_sources(mbed-cy-psoc6-whd - INTERFACE + PRIVATE wifi-host-driver/resources/resource_imp/whd_resources.c wifi-host-driver/src/whd_ap.c @@ -139,6 +139,6 @@ ) target_compile_definitions(mbed-cy-psoc6-whd - INTERFACE + PUBLIC MBED_CONF_CY_PSOC6_WHD_PRESENT=1 ) diff --git a/connectivity/drivers/wifi/COMPONENT_WHD/whd-bsp-integration/CMakeLists.txt b/connectivity/drivers/wifi/COMPONENT_WHD/whd-bsp-integration/CMakeLists.txt index 2c5b5f4..cf709f7 100644 --- a/connectivity/drivers/wifi/COMPONENT_WHD/whd-bsp-integration/CMakeLists.txt +++ b/connectivity/drivers/wifi/COMPONENT_WHD/whd-bsp-integration/CMakeLists.txt @@ -1,26 +1,26 @@ # Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_library(mbed-cy-psoc6-common-network INTERFACE) +add_library(mbed-cy-psoc6-common-network STATIC EXCLUDE_FROM_ALL) target_include_directories(mbed-cy-psoc6-common-network - INTERFACE + PUBLIC . ) target_sources(mbed-cy-psoc6-common-network - INTERFACE + PRIVATE cy_network_buffer.c cybsp_wifi.c ) target_link_libraries(mbed-cy-psoc6-common-network - INTERFACE + PUBLIC mbed-lwipstack mbed-emac ) target_compile_definitions(mbed-cy-psoc6-common-network - INTERFACE + PUBLIC MBED_CONF_cy-psoc6-common-network_PRESENT=1 ) diff --git a/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/CMakeLists.txt b/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/CMakeLists.txt index 830fdf0..a91dc52 100644 --- a/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/CMakeLists.txt +++ b/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/CMakeLists.txt @@ -1,17 +1,15 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_library(wifi-EMW3080B INTERFACE) - target_include_directories(mbed-wifi - INTERFACE + PUBLIC . mx_wifi mx_wifi/core ) target_sources(mbed-wifi - INTERFACE + PRIVATE EMW3080BInterface.cpp EMW3080B_EMAC.cpp EMW3080B_UART.cpp diff --git a/connectivity/drivers/wifi/TARGET_WICED/CMakeLists.txt b/connectivity/drivers/wifi/TARGET_WICED/CMakeLists.txt index 8bcf367..f2b2fec 100644 --- a/connectivity/drivers/wifi/TARGET_WICED/CMakeLists.txt +++ b/connectivity/drivers/wifi/TARGET_WICED/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_library(mbed-wiced INTERFACE) +add_library(mbed-wiced STATIC EXCLUDE_FROM_ALL) if(${CMAKE_CROSSCOMPILING}) if(${MBED_TOOLCHAIN} STREQUAL "ARM") @@ -10,15 +10,15 @@ set(LIB_WICED_DRIVERS TOOLCHAIN_GCC_ARM/TARGET_WIO_EMW3166/libwiced_drivers.a) endif() -target_link_libraries(mbed-wiced INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_WICED_DRIVERS}) + target_link_libraries(mbed-wiced INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_WICED_DRIVERS}) endif() target_include_directories(mbed-wiced - INTERFACE + PUBLIC wiced_interface ) target_sources(mbed-wiced - INTERFACE + PRIVATE wiced_interface/default_wifi_interface.cpp ) diff --git a/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt b/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt index b49ced0..682139f 100644 --- a/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt +++ b/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt @@ -2,13 +2,13 @@ # SPDX-License-Identifier: Apache-2.0 target_sources(mbed-wifi - INTERFACE + PRIVATE ESP8266Interface.cpp ESP8266/ESP8266.cpp ) target_include_directories(mbed-wifi - INTERFACE + PUBLIC . ./ESP8266 ) diff --git a/connectivity/libraries/ppp/CMakeLists.txt b/connectivity/libraries/ppp/CMakeLists.txt index 424b579..d2a2b75 100644 --- a/connectivity/libraries/ppp/CMakeLists.txt +++ b/connectivity/libraries/ppp/CMakeLists.txt @@ -1,8 +1,10 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +add_library(mbed-ppp STATIC EXCLUDE_FROM_ALL) + target_include_directories(mbed-ppp - INTERFACE + PUBLIC . ./include ./include/polarssl @@ -10,7 +12,7 @@ ) target_sources(mbed-ppp - INTERFACE + PRIVATE source/auth.c source/ccp.c source/chap-md5.c @@ -47,6 +49,14 @@ ) target_compile_definitions(mbed-ppp - INTERFACE + PUBLIC MBED_CONF_PPP_PRESENT=1 ) + +target_link_libraries(mbed-ppp + PUBLIC + mbed-events + mbed-netsocket-api + PRIVATE + mbed-rtos-flags +) \ No newline at end of file diff --git a/connectivity/lwipstack/CMakeLists.txt b/connectivity/lwipstack/CMakeLists.txt index 8c087d8..9baff8b 100644 --- a/connectivity/lwipstack/CMakeLists.txt +++ b/connectivity/lwipstack/CMakeLists.txt @@ -96,7 +96,7 @@ target_link_libraries(mbed-lwipstack PUBLIC - mbed-netsocket + mbed-netsocket-api mbed-ppp mbed-randlib PRIVATE diff --git a/connectivity/mbedtls/CMakeLists.txt b/connectivity/mbedtls/CMakeLists.txt index 2f6582e..3089a86 100644 --- a/connectivity/mbedtls/CMakeLists.txt +++ b/connectivity/mbedtls/CMakeLists.txt @@ -111,6 +111,8 @@ MBED_CONF_MBEDTLS_PRESENT=1 ) +target_link_libraries(mbed-mbedtls PUBLIC mbed-core-flags) + # Workaround for https://github.com/ARMmbed/mbedtls/issues/1077 # which affects cores without __thumb2__ set by the compiler # due to the lack of full Thumb-2 support diff --git a/connectivity/nanostack/CMakeLists.txt b/connectivity/nanostack/CMakeLists.txt index 9ff2685..eb77656 100644 --- a/connectivity/nanostack/CMakeLists.txt +++ b/connectivity/nanostack/CMakeLists.txt @@ -31,5 +31,5 @@ mbed-nanostack-mbed_mesh_api mbed-nanostack-sal_stack-event_loop mbed-nanostack-sal_stack - mbed-netsocket + mbed-netsocket-api ) diff --git a/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt b/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt index e3d7169..42fbaa9 100644 --- a/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt +++ b/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt @@ -34,7 +34,7 @@ PUBLIC mbed-nanostack-hal_mbed_cmsis_rtos mbed-nanostack-sal_stack - mbed-netsocket + mbed-netsocket-api mbed-core-flags PRIVATE mbed-rtos-flags diff --git a/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt b/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt index 816622a..e435cc4 100644 --- a/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt +++ b/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt @@ -12,7 +12,6 @@ PRIVATE arm_hal_fhss_timer.cpp arm_hal_interrupt.c - arm_hal_random.c arm_hal_timer.cpp ns_event_loop.c ns_event_loop_mbed.cpp @@ -26,6 +25,11 @@ target_link_libraries(mbed-nanostack-hal_mbed_cmsis_rtos PUBLIC mbed-core-flags + mbed-randlib + mbed-nanostack-sal_stack-event_loop + mbed-events + mbed-nanostack-libservice + mbed-nanostack-sal_stack PRIVATE mbed-rtos-flags ) \ No newline at end of file diff --git a/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_random.c b/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_random.c deleted file mode 100644 index d7a9a15..0000000 --- a/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_random.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2015, 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "ns_types.h" -#include "arm_hal_random.h" - -#include "mbedtls/entropy_poll.h" - -#ifdef MBEDTLS_ENTROPY_HARDWARE_ALT -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif -#endif - -void arm_random_module_init(void) -{ -} - -uint32_t arm_random_seed_get(void) -{ - uint32_t result = 0; -#ifdef MBEDTLS_ENTROPY_HARDWARE_ALT -#if defined(MBEDTLS_PLATFORM_C) - int ret = mbedtls_platform_setup(NULL); - if (ret != 0) { - return result; - } -#endif /* MBEDTLS_PLATFORM_C */ - /* Grab a seed from a function we provide for mbedtls */ - size_t len; - mbedtls_hardware_poll(NULL, (uint8_t *) &result, sizeof result, &len); -#if defined(MBEDTLS_PLATFORM_C) - mbedtls_platform_teardown(NULL); -#endif /* MBEDTLS_PLATFORM_C */ -#endif - return result; -} diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt index df73a13..c2c779c 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt @@ -85,7 +85,7 @@ mle_service/mle_service.c mle_service/mle_service_buffer.c - mle_service/mle_service_frame_counter_table.c + mle_service/mle_service_frame_count.c mle_service/mle_service_interface.c mle_service/mle_service_security.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service.c b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service.c index 27ff6fd..9b92114 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service.c +++ b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service.c @@ -35,7 +35,7 @@ #include "Service_Libs/mle_service/mle_service_security.h" #include "Service_Libs/mle_service/mle_service_buffer.h" #include "Service_Libs/mle_service/mle_service_interface.h" -#include "Service_Libs/mle_service/mle_service_frame_counter_table.h" +#include "Service_Libs/mle_service/mle_service_frame_count.h" #include "MLE/mle.h" #include "MLE/mle_tlv.h" #include "mac_common_defines.h" diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_count.c b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_count.c new file mode 100644 index 0000000..0f2410e --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_count.c @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2018-2019, Pelion and affiliates. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "nsconfig.h" +#include +#include +#include "ns_trace.h" +#include "common_functions.h" +#include "ccmLIB.h" +#include "nsdynmemLIB.h" +#include "Core/include/ns_address_internal.h" +#include "Core/include/ns_buffer.h" +#include "MLE/mle.h" +#include "mac_common_defines.h" +#include "Service_Libs/mle_service/mle_service_api.h" +#include "Service_Libs/mle_service/mle_service_frame_count.h" + + + +typedef struct { + mle_neighbor_security_counter_info_t *security_counter_list; + uint8_t table_size; + int8_t interface_id; + ns_list_link_t link; +} mle_service_framecounter_instance_list_t; + +typedef NS_LIST_HEAD(mle_service_framecounter_instance_list_t, link) mle_service_counter_list_t; + +static mle_service_counter_list_t srv_framecounter_instance_list; + + +static mle_service_framecounter_instance_list_t *mle_service_framecounter_params_get(int8_t interface_id) +{ + ns_list_foreach(mle_service_framecounter_instance_list_t, cur_ptr, &srv_framecounter_instance_list) { + if (cur_ptr->interface_id == interface_id) { + return cur_ptr; + } + } + return NULL; +} + +static void mle_service_framecounter_delete(mle_neighbor_security_counter_info_t *cur_ptr) +{ + cur_ptr->last_key_sequence = 0; + cur_ptr->mle_frame_counter = 0; + cur_ptr->new_key_pending = false; +} + + +mle_neighbor_security_counter_info_t *mle_service_counter_info_get(int8_t interface_id, uint8_t attribute_index) +{ + mle_service_framecounter_instance_list_t *srv_ptr = mle_service_framecounter_params_get(interface_id); + + if (!srv_ptr || !srv_ptr->security_counter_list || attribute_index >= srv_ptr->table_size) { + return NULL; + } + mle_neighbor_security_counter_info_t *entry = srv_ptr->security_counter_list + attribute_index; + return entry; +} + +int mle_service_frame_counter_table_free(int8_t interface_id) +{ + mle_service_framecounter_instance_list_t *srv_ptr = mle_service_framecounter_params_get(interface_id); + if (!srv_ptr) { + return -1; + } + ns_list_remove(&srv_framecounter_instance_list, srv_ptr); + ns_dyn_mem_free(srv_ptr->security_counter_list); + ns_dyn_mem_free(srv_ptr); + return 0; +} + +int mle_service_frame_counter_table_allocate(int8_t interface_id, uint8_t table_size) +{ + + mle_service_framecounter_instance_list_t *srv_ptr = mle_service_framecounter_params_get(interface_id); + if (!srv_ptr) { + srv_ptr = ns_dyn_mem_alloc(sizeof(mle_service_framecounter_instance_list_t)); + if (!srv_ptr) { + return -1; + } + ns_list_add_to_start(&srv_framecounter_instance_list, srv_ptr); + srv_ptr->interface_id = interface_id; + srv_ptr->table_size = 0; + srv_ptr->security_counter_list = NULL; + } + + if (srv_ptr->table_size != table_size) { + ns_dyn_mem_free(srv_ptr->security_counter_list); + srv_ptr->security_counter_list = ns_dyn_mem_alloc(sizeof(mle_neighbor_security_counter_info_t) * table_size); + } + + if (!srv_ptr->security_counter_list) { + mle_service_frame_counter_table_free(interface_id); + return -1; + } + srv_ptr->table_size = table_size; + + mle_neighbor_security_counter_info_t *cur_ptr = srv_ptr->security_counter_list; + for (uint8_t i = 0; i < table_size; i++) { + mle_service_framecounter_delete(cur_ptr); + cur_ptr++; + } + return 0; +} + +void mle_service_frame_counter_entry_add(int8_t interface_id, uint8_t attribute_index, uint32_t frame_counter) +{ + mle_neighbor_security_counter_info_t *entry = mle_service_counter_info_get(interface_id, attribute_index); + if (entry) { + entry->mle_frame_counter = frame_counter; + } +} + +void mle_service_frame_counter_entry_new_key_pending_set(int8_t interface_id, uint8_t attribute_index) +{ + mle_neighbor_security_counter_info_t *entry = mle_service_counter_info_get(interface_id, attribute_index); + if (entry) { + entry->new_key_pending = true; + } +} + +void mle_service_frame_counter_entry_delete(int8_t interface_id, uint8_t attribute_index) +{ + mle_neighbor_security_counter_info_t *entry = mle_service_counter_info_get(interface_id, attribute_index); + if (entry) { + mle_service_framecounter_delete(entry); + } + +} + +uint32_t mle_service_neighbor_frame_counter_get(int8_t interface_id, uint8_t attribute_index) +{ + mle_neighbor_security_counter_info_t *entry = mle_service_counter_info_get(interface_id, attribute_index); + if (!entry) { + return 0; + } + return entry->mle_frame_counter; + +} + diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_count.h b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_count.h new file mode 100644 index 0000000..e63d720 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_count.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018, Pelion and affiliates. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MLE_SERVICE_FRAME_COUNT_H_ +#define MLE_SERVICE_FRAME_COUNT_H_ + +#include +/* + * MLE neighbor security counter info entry for replay attack + * + */ +typedef struct { + uint32_t mle_frame_counter; /*!< Last used security frame counter */ + uint32_t last_key_sequence; /*!< Last used key sequence */ + bool new_key_pending: 1; /*!< New Key is pending */ +} mle_neighbor_security_counter_info_t; + +//Internal use +mle_neighbor_security_counter_info_t *mle_service_counter_info_get(int8_t interface_id, uint8_t attribute_index); + +#endif /* MLE_SERVICE_FRAME_COUNT_H_ */ diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_counter_table.c b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_counter_table.c deleted file mode 100644 index 161d138..0000000 --- a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_counter_table.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2018-2019, Pelion and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "nsconfig.h" -#include -#include -#include "ns_trace.h" -#include "common_functions.h" -#include "ccmLIB.h" -#include "nsdynmemLIB.h" -#include "Core/include/ns_address_internal.h" -#include "Core/include/ns_buffer.h" -#include "MLE/mle.h" -#include "mac_common_defines.h" -#include "Service_Libs/mle_service/mle_service_api.h" -#include "Service_Libs/mle_service/mle_service_frame_counter_table.h" - - - -typedef struct { - mle_neighbor_security_counter_info_t *security_counter_list; - uint8_t table_size; - int8_t interface_id; - ns_list_link_t link; -} mle_service_framecounter_instance_list_t; - -typedef NS_LIST_HEAD(mle_service_framecounter_instance_list_t, link) mle_service_counter_list_t; - -static mle_service_counter_list_t srv_framecounter_instance_list; - - -static mle_service_framecounter_instance_list_t *mle_service_framecounter_params_get(int8_t interface_id) -{ - ns_list_foreach(mle_service_framecounter_instance_list_t, cur_ptr, &srv_framecounter_instance_list) { - if (cur_ptr->interface_id == interface_id) { - return cur_ptr; - } - } - return NULL; -} - -static void mle_service_framecounter_delete(mle_neighbor_security_counter_info_t *cur_ptr) -{ - cur_ptr->last_key_sequence = 0; - cur_ptr->mle_frame_counter = 0; - cur_ptr->new_key_pending = false; -} - - -mle_neighbor_security_counter_info_t *mle_service_counter_info_get(int8_t interface_id, uint8_t attribute_index) -{ - mle_service_framecounter_instance_list_t *srv_ptr = mle_service_framecounter_params_get(interface_id); - - if (!srv_ptr || !srv_ptr->security_counter_list || attribute_index >= srv_ptr->table_size) { - return NULL; - } - mle_neighbor_security_counter_info_t *entry = srv_ptr->security_counter_list + attribute_index; - return entry; -} - -int mle_service_frame_counter_table_free(int8_t interface_id) -{ - mle_service_framecounter_instance_list_t *srv_ptr = mle_service_framecounter_params_get(interface_id); - if (!srv_ptr) { - return -1; - } - ns_list_remove(&srv_framecounter_instance_list, srv_ptr); - ns_dyn_mem_free(srv_ptr->security_counter_list); - ns_dyn_mem_free(srv_ptr); - return 0; -} - -int mle_service_frame_counter_table_allocate(int8_t interface_id, uint8_t table_size) -{ - - mle_service_framecounter_instance_list_t *srv_ptr = mle_service_framecounter_params_get(interface_id); - if (!srv_ptr) { - srv_ptr = ns_dyn_mem_alloc(sizeof(mle_service_framecounter_instance_list_t)); - if (!srv_ptr) { - return -1; - } - ns_list_add_to_start(&srv_framecounter_instance_list, srv_ptr); - srv_ptr->interface_id = interface_id; - srv_ptr->table_size = 0; - srv_ptr->security_counter_list = NULL; - } - - if (srv_ptr->table_size != table_size) { - ns_dyn_mem_free(srv_ptr->security_counter_list); - srv_ptr->security_counter_list = ns_dyn_mem_alloc(sizeof(mle_neighbor_security_counter_info_t) * table_size); - } - - if (!srv_ptr->security_counter_list) { - mle_service_frame_counter_table_free(interface_id); - return -1; - } - srv_ptr->table_size = table_size; - - mle_neighbor_security_counter_info_t *cur_ptr = srv_ptr->security_counter_list; - for (uint8_t i = 0; i < table_size; i++) { - mle_service_framecounter_delete(cur_ptr); - cur_ptr++; - } - return 0; -} - -void mle_service_frame_counter_entry_add(int8_t interface_id, uint8_t attribute_index, uint32_t frame_counter) -{ - mle_neighbor_security_counter_info_t *entry = mle_service_counter_info_get(interface_id, attribute_index); - if (entry) { - entry->mle_frame_counter = frame_counter; - } -} - -void mle_service_frame_counter_entry_new_key_pending_set(int8_t interface_id, uint8_t attribute_index) -{ - mle_neighbor_security_counter_info_t *entry = mle_service_counter_info_get(interface_id, attribute_index); - if (entry) { - entry->new_key_pending = true; - } -} - -void mle_service_frame_counter_entry_delete(int8_t interface_id, uint8_t attribute_index) -{ - mle_neighbor_security_counter_info_t *entry = mle_service_counter_info_get(interface_id, attribute_index); - if (entry) { - mle_service_framecounter_delete(entry); - } - -} - -uint32_t mle_service_neighbor_frame_counter_get(int8_t interface_id, uint8_t attribute_index) -{ - mle_neighbor_security_counter_info_t *entry = mle_service_counter_info_get(interface_id, attribute_index); - if (!entry) { - return 0; - } - return entry->mle_frame_counter; - -} - diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_counter_table.h b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_counter_table.h deleted file mode 100644 index 4b0fab6..0000000 --- a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service/mle_service_frame_counter_table.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2018, Pelion and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MLE_SERVICE_FRAME_COUNTER_TABLE_H_ -#define MLE_SERVICE_FRAME_COUNTER_TABLE_H_ - -#include -/* - * MLE neighbor security counter info entry for replay attack - * - */ -typedef struct { - uint32_t mle_frame_counter; /*!< Last used security frame counter */ - uint32_t last_key_sequence; /*!< Last used key sequence */ - bool new_key_pending: 1; /*!< New Key is pending */ -} mle_neighbor_security_counter_info_t; - -//Internal use -mle_neighbor_security_counter_info_t *mle_service_counter_info_get(int8_t interface_id, uint8_t attribute_index); - -#endif /* MLE_SERVICE_FRAME_COUNTER_TABLE_H_ */ diff --git a/connectivity/netsocket/CMakeLists.txt b/connectivity/netsocket/CMakeLists.txt index ea64e96..cd3b680 100644 --- a/connectivity/netsocket/CMakeLists.txt +++ b/connectivity/netsocket/CMakeLists.txt @@ -3,22 +3,22 @@ if(MBED_OS_ENABLE_TESTS) if(BUILD_GREENTEA_TESTS) - # add greentea test + add_subdirectory(tests/TESTS) else() add_subdirectory(tests/UNITTESTS) endif() endif() -add_library(mbed-netsocket STATIC EXCLUDE_FROM_ALL) +add_library(mbed-netsocket-api STATIC EXCLUDE_FROM_ALL) -target_include_directories(mbed-netsocket +target_include_directories(mbed-netsocket-api PUBLIC . ./include ./include/netsocket ) -target_sources(mbed-netsocket +target_sources(mbed-netsocket-api PRIVATE source/DTLSSocket.cpp source/DTLSSocketWrapper.cpp @@ -44,28 +44,35 @@ source/nsapi_ppp.cpp ) -target_compile_definitions(mbed-netsocket +target_compile_definitions(mbed-netsocket-api PUBLIC MBED_CONF_NSAPI_PRESENT=1 ) -target_link_libraries(mbed-netsocket +target_link_libraries(mbed-netsocket-api PUBLIC + mbed-core-flags + mbed-mbedtls + mbed-events +) + +add_library(mbed-netsocket INTERFACE) + +target_link_libraries(mbed-netsocket + INTERFACE mbed-mbedtls mbed-lwipstack - mbed-events - mbed-core-flags ) if("DEVICE_EMAC=1" IN_LIST MBED_TARGET_DEFINITIONS) target_link_libraries(mbed-netsocket - PUBLIC + INTERFACE mbed-emac ) endif() target_link_libraries(mbed-netsocket - PUBLIC + INTERFACE mbed-wifi mbed-cellular mbed-nanostack-libservice diff --git a/connectivity/netsocket/tests/TESTS/CMakeLists.txt b/connectivity/netsocket/tests/TESTS/CMakeLists.txt new file mode 100644 index 0000000..056f2cd --- /dev/null +++ b/connectivity/netsocket/tests/TESTS/CMakeLists.txt @@ -0,0 +1,6 @@ + +# Only build the netsocket tests if this target has at least one network interface +string(FIND "${MBED_CONFIG_DEFINITIONS}" MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE DEFAULT_IFC_IDX) +if(NOT DEFAULT_IFC_IDX EQUAL -1) + add_subdirectory(netsocket) +endif() \ No newline at end of file diff --git a/connectivity/netsocket/tests/TESTS/netsocket/CMakeLists.txt b/connectivity/netsocket/tests/TESTS/netsocket/CMakeLists.txt new file mode 100644 index 0000000..cbd84c3 --- /dev/null +++ b/connectivity/netsocket/tests/TESTS/netsocket/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(udp) \ No newline at end of file diff --git a/connectivity/netsocket/tests/TESTS/netsocket/udp/CMakeLists.txt b/connectivity/netsocket/tests/TESTS/netsocket/udp/CMakeLists.txt index f2a1128..13c6c2d 100644 --- a/connectivity/netsocket/tests/TESTS/netsocket/udp/CMakeLists.txt +++ b/connectivity/netsocket/tests/TESTS/netsocket/udp/CMakeLists.txt @@ -1,17 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR) - -set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../ CACHE INTERNAL "") -set(TEST_TARGET mbed-connectivity-netsocket-udp) - -include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) - -project(${TEST_TARGET}) - -list( - APPEND +list(APPEND TEST_SOURCE_LIST main.cpp udpsocket_bind_port.cpp @@ -35,7 +25,7 @@ mbed_greentea_add_test( TEST_NAME - ${TEST_TARGET} + mbed-connectivity-netsocket-udp TEST_SOURCES ${TEST_SOURCE_LIST} TEST_REQUIRED_LIBS diff --git a/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_echotest_burst.cpp b/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_echotest_burst.cpp index 597afd3..23eca88 100644 --- a/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_echotest_burst.cpp +++ b/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_echotest_burst.cpp @@ -119,7 +119,7 @@ } else if (recvd < 0) { pkg_fail += BURST_PKTS - j; // Assume all the following packets of the burst to be lost tr_warn("[%02d] network error %d", i, recvd); - ThisThread::sleep_for(recv_timeout * 1000); + ThisThread::sleep_for(recv_timeout * 1000ms); recv_timeout *= 2; // Back off, break; } else if (temp_addr != udp_addr) { diff --git a/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_recv_timeout.cpp b/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_recv_timeout.cpp index df91b58..410316b 100644 --- a/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_recv_timeout.cpp +++ b/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_recv_timeout.cpp @@ -63,10 +63,10 @@ if (recvd == NSAPI_ERROR_WOULD_BLOCK) { osSignalWait(SIGNAL_SIGIO, SIGIO_TIMEOUT); tr_info("MBED: recvfrom() took: %dms", timer.read_ms()); - if (timer.read_ms() > 150) { - TEST_ASSERT(150 - timer.read_ms() < 51); + if (timer.elapsed_time() > 150ms) { + TEST_ASSERT(150ms - timer.elapsed_time() < 51ms); } else { - TEST_ASSERT(timer.read_ms() - 150 < 51); + TEST_ASSERT(timer.elapsed_time() - 150ms < 51ms); } continue; } else if (recvd < 0) { diff --git a/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_sendto_repeat.cpp b/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_sendto_repeat.cpp index 1c71b04..4b01a6c 100644 --- a/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_sendto_repeat.cpp +++ b/connectivity/netsocket/tests/TESTS/netsocket/udp/udpsocket_sendto_repeat.cpp @@ -46,7 +46,7 @@ break; } oom_earlier = true; - ThisThread::sleep_for(1000); + ThisThread::sleep_for(1000ms); continue; } oom_earlier = false; diff --git a/platform/randlib/CMakeLists.txt b/platform/randlib/CMakeLists.txt index 1231abf..cc36934 100644 --- a/platform/randlib/CMakeLists.txt +++ b/platform/randlib/CMakeLists.txt @@ -13,4 +13,11 @@ target_sources(mbed-randlib PRIVATE source/randLIB.c + source/arm_hal_random.c ) + +target_link_libraries(mbed-randlib + PUBLIC + mbed-mbedtls + mbed-core-flags +) \ No newline at end of file diff --git a/platform/randlib/source/arm_hal_random.c b/platform/randlib/source/arm_hal_random.c new file mode 100644 index 0000000..d7a9a15 --- /dev/null +++ b/platform/randlib/source/arm_hal_random.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2015, 2018, Arm Limited and affiliates. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "ns_types.h" +#include "arm_hal_random.h" + +#include "mbedtls/entropy_poll.h" + +#ifdef MBEDTLS_ENTROPY_HARDWARE_ALT +#if defined(MBEDTLS_PLATFORM_C) +#include "mbedtls/platform.h" +#endif +#endif + +void arm_random_module_init(void) +{ +} + +uint32_t arm_random_seed_get(void) +{ + uint32_t result = 0; +#ifdef MBEDTLS_ENTROPY_HARDWARE_ALT +#if defined(MBEDTLS_PLATFORM_C) + int ret = mbedtls_platform_setup(NULL); + if (ret != 0) { + return result; + } +#endif /* MBEDTLS_PLATFORM_C */ + /* Grab a seed from a function we provide for mbedtls */ + size_t len; + mbedtls_hardware_poll(NULL, (uint8_t *) &result, sizeof result, &len); +#if defined(MBEDTLS_PLATFORM_C) + mbedtls_platform_teardown(NULL); +#endif /* MBEDTLS_PLATFORM_C */ +#endif + return result; +}