Commit Graph

2905 Commits (52cb11957165f56f01632dbe7c07e0fcc3dc05a7)

Author SHA1 Message Date
Vincent Coubard db4d14c89d BLE NRF52: Fix advertising filtering when no bonds are present. 2018-05-23 17:27:18 +01:00
Vincent Coubard ef208912a6 BLE NRF52: Report correct own address type for connection
The function that gets the address doesn't work when privacy is enabled; report own address as private resolvable.
2018-05-23 17:27:18 +01:00
Vincent Coubard 30dac7cd8c BLE NRF52: Fix identity address flag in connection request. 2018-05-23 17:27:07 +01:00
Vincent Coubard 1ba5a112f4 BLE: Fix wrong macro name for IAR 2018-05-23 17:11:26 +01:00
Cruz Monrreal eb9435b52e
Merge pull request #6772 from ARMmbed/g-littlefs-eilseq
littlefs: Map LFS_ERR_CORRUPT to EILSEQ
2018-05-23 10:12:19 -05:00
paul-szczepanek-arm de41355c5c Fix not processing all advertising reports if one is filtered out
filtering out individual reports instead of all
2018-05-23 14:24:54 +01:00
Paul Szczepanek f4b7f32793
Merge pull request #49 from pan-/fix-privacy-backward-compatibility
Fix privacy backward compatibility
2018-05-23 14:20:49 +01:00
Mirela Chirica 853c4c6dd1 Cellular: Added ENOTTY define in mbed_retarget stub 2018-05-23 12:31:17 +03:00
Asif Rizwan 657ac3f643 WIFI_EMAC class renamed to OdinWiFiEMAC, Formatting
Revert "in ODIN emac initialization required before connection"
2018-05-23 12:25:21 +03:00
Kevin Bracey 7e4eb5c24b LPC546XX: Correct Ethernet length calculations
Subtract 4 from the received packet length - the buffer contains the
CRC, which we shouldn't pass up.

Ensure we allocate receive buffers of a size corresponding to the
rounded-up size we tell the hardware - the hardware was overrunning the
allocation by a couple of bytes.
2018-05-23 12:25:21 +03:00
Mahesh Mahadevan fc0ce8cb72 Add memory configuration for LPC546XX
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-23 12:25:20 +03:00
Mahesh Mahadevan 91ac8356ba LPC546XX: Add ENET support
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-23 12:25:20 +03:00
Asif Rizwan 0b14f1277e EMAC adaption added, updated ODIN drivers to v2.5.0 RC1 2018-05-23 12:25:18 +03:00
Mika Leppänen ede07217df Corrected lwip netif flags to be set before power up
This enables that link up status callback can be called inside
power up function.
2018-05-23 12:25:17 +03:00
Kevin Bracey f3ec0dacd5 Add NetworkInterface::get_default_instance()
Provide an initial framework to make it easier to find a default network
interface.
2018-05-23 12:25:17 +03:00
Mika Leppänen e481c5ef75 Added memory manager set to add_ethernet_interface() of test stack
This allows that EMAC memory manager can be used to allocate EMAC driver
memory already after the add_ethernet_interface() call.
2018-05-23 12:24:11 +03:00
Mika Leppänen 31b8f73de7 Changed mutexes, delete and DNS call in callback set
- Changed mutexes to platform mutexes
- Removed not needed null check from delete
- Changed nsapi_dns_call_in_set() to use call_in_callback_cb_t and
added prototype to header
2018-05-23 12:24:10 +03:00
Mika Leppänen c4424ff0a1 Corrected more defects
- Serialized the sending of multiple async DNS queries since limits on event
message box sizes
- Added timer function that supervises the total time used to make DNS query
and triggers socket timeouts
- Changed nsapi_error_t to new nsapi_value_or_error_t on interface headers
- Corrected wording of gethostbyname_async return values
- Clarified .json options
- Added a new data type for socket callback that can be used from interrupts
- Corrected variable limits to use INT32_MAX etc. defines
- Changed mallocs to new
- Optimized variable sizes on DNS_QUERY definition
2018-05-23 12:24:10 +03:00
Mika Leppänen 1c01f5dda4 Corrected defects
- Changed call_in/call methods of the stack to callback provided by the stack
- Specified what are limitations for operations that are made in callback
- Added pure virtual class DNS that defines DNS operations
- Added cancel operation and unique ID to DNS request used in cancel
- Added DNS configuration options to netsocket/mbed_lib.json for retries,
  response wait time and cache size
- Changed host name to use dynamic memory in DNS query list and cache,
  set maximum length for the name to 255 bytes.
- Added mutex to asynchronous DNS
- Reworked retries: there is now total retry count and a server specific count
- Ignores invalid incoming UDP socket messages (DNS header is not valid), and retries DNS query
- Reworked DNS module asynchronous operation functions
- Corrected other review issues (nothrow new, missing free, missing mutex unlock etc.)
2018-05-23 12:24:10 +03:00
Mika Leppänen b7e8400c2c Added non-blocking DNS functionality to network interface
- Added non-blocking DNS interface to network interface and
  network stack.
- Added caching of DNS replies.
- Added a network stack function to get DNS addresses from stack.
- Added call and call_in hooks to onboard network stack to
  allow calling functions from onboard stack context.
- Added support to call and call_in functions to LWIP and
  Nanostack.
- Disabled LWIP DNS translator with the exception of DNS
  address storage used in DNS address get.
2018-05-23 12:24:10 +03:00
TomoYamanaka bad530ab0d Implementation of unified EMAC driver for Renesas mbed boards
Implementation of unified EMAC driver for Renesas mbed boards

Based on the driver so far, Renesas implemented the emac driver for GR-PEACH and VK-RZ/A1H.
The mainly changes is below.
- Add the connection part with LWIP according to the unified emac specification.
- Add three new multicast functions(add, remove, set_all).

The Greentea test netsocket and emac test passed.
2018-05-23 12:24:09 +03:00
cyliangtw 7bfa362492 [M487/NUC472] Fix tx frame length and remove GPL license 2018-05-23 12:24:09 +03:00
cyliangtw 401f09c479 [M487/NUC472] Support DHCP & TCP sample, also remove legacy emac 2018-05-23 12:24:09 +03:00
cyliangtw 89209b6cd5 [M487/NUC472] Support new EMAC feature, built OK 2018-05-23 12:24:08 +03:00
Mahesh Mahadevan 82b2a27a1c Kinetis EMAC: Renamed K64F files to Kinetis
This driver is used by more SoC's than K64F

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-23 12:24:07 +03:00
Mahesh Mahadevan 7bc4c0ec21 K64F, K66F: Update the SYSMPU implementation
Do not disable SYSMPU, instead add access for ENET bus master

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-23 12:24:07 +03:00
Mika Leppänen de72090d26 Changed STM emac driver to loop RX frame reading 2018-05-23 12:24:06 +03:00
Kevin Bracey 953f1b615a Add EMAC driver README.md with porting guide 2018-05-23 12:24:06 +03:00
Kevin Bracey fbd920777b Add extra labels for Freescale & STM EMAC drivers
Just checking "does the chip have an EMAC" doesn't work - there are
targets using those chips which do not have an Ethernet connector and
don't provide the necessary surrounding infrastructure (eg DISCO_F429ZI,
not providing the board emac config call, and HEXIWEAR not providing PHY
info).

Make the targets that actually do want EMAC define their own local
Freescale_EMAC and STM_EMAC labels, and move the drivers into
the corresponding TARGET_ directories, removing the #ifdefs.
2018-05-23 12:24:06 +03:00
Kevin Bracey d83dec9ea4 Stop drivers checking DEVICE_EMAC
Checking DEVICE_EMAC is problematic - particularly for the Odin W2 where
apps have been shutting this off to disable the Wi-fi interface.

Make drivers check a locally-relevant flag instead, pending new
thoughts on how to achieve application/test-relevant flagging for
XXX:get_default_instance() being provided by a system.

However that is achieved, drivers do require a flag set purely by the
target - they mustn't be tripped up by an add-on module providing itself
as the system's default EMAC.
2018-05-23 12:24:05 +03:00
Mika Leppänen 01b4d97cb4 Corrected STM eth driver flagging, memory allocation and thread init 2018-05-23 12:24:05 +03:00
Kevin Bracey 3c83c62ff7 Nanostack EMAC implementation
Make Nanostack an OnboardNetworkInterface, implementing
add_ethernet_interface so it can use EMAC drivers.

Can now be used via EthernetInterface, and be the system's default
network stack.

Legacy support for NanostackEthernetInterface retained. Some
restructuring of mesh interface code to fit into the
OnboardNetworkStack:::Interface system.
2018-05-23 12:24:04 +03:00
Kevin Bracey a0d374ef00 Extend EMAC multicast APIs 2018-05-23 12:24:02 +03:00
Kevin Bracey 5472a9703f EMAC: check link status callback is set
Nanostack doesn't set the link status callback. Make sure the two
example drivers don't crash if it isn't set.
2018-05-23 12:24:02 +03:00
Kevin Bracey 7ce098acb4 K64F EMAC: Fix TX error path leaks 2018-05-23 12:24:02 +03:00
Mika Leppänen 5da3cd9cce Added preferred alignment to emac and copy to/from to memory manager 2018-05-23 12:24:01 +03:00
Kevin Bracey 4950a993fd Move STM EMAC driver out out lwIP 2018-05-23 12:24:01 +03:00
Mika Leppänen 4e10cc097e Updated STM ethernet driver to use emac and memory manager 2018-05-23 12:24:01 +03:00
Mika Leppänen 668e0821a1 Updated K64F ethernet driver to use memory manager 2018-05-23 12:24:00 +03:00
Mika Leppänen bc5d4d1c0d Created memory manager class to netsocket and updated lwip to use it
instead of old memory interface.
2018-05-23 12:24:00 +03:00
Kevin Bracey b222c25435 Work around Nuvoton #define EMAC 2018-05-23 12:23:58 +03:00
Kevin Bracey 958247265b Tell mbed build to ignore old lwIP+EMAC drivers 2018-05-23 12:23:58 +03:00
Kevin Bracey 0ecf4e4695 Move Freescale EMAC driver out of lwIP 2018-05-23 12:23:58 +03:00
Kevin Bracey 74dfe3423a Add downcast methods to NetworkInterface
As we've introduced virtual inheritance to support EMACInterface, we can
no longer use C-style casts or static_cast to downcast from
NetworkInterface to more specific types. RTTI is disabled in the
toolchains, so dynamic_cast is unavailables.

Add virtual downcast methods to permit conversions to the 6 derived
classes. Probably only needed for EMACInterface, WiFiInterface and
EthInterface, but handles the set.
2018-05-23 12:23:55 +03:00
Mirela Chirica 6e7d0a8847 Cellular: Added missing copyrights 2018-05-23 12:11:02 +03:00
Mirela Chirica b59ef26930 Cellular: Unit tests fixes 2018-05-23 12:11:02 +03:00
paul-szczepanek-arm 80137be991 Merge https://github.com/ARMmbed/mbed-os into security-manager-dev 2018-05-23 09:47:06 +01:00
Yossi Levy f33f4dab26 Increase tests timeout to 45 second 2018-05-23 11:29:46 +03:00
Ron Eldor 77e87d3174 Check the size_t isn't larger than 32 bit
Assure that `size_t` isn't larger than 32 bit, with preprocessor check.
Using `#if SIZE_MAX > UINT_MAX`.
2018-05-23 08:37:27 +03:00
Yossi Levy 7401aea36a Remove reset tests. Small change to cmac claculation in get_derived_key 2018-05-22 21:35:33 +03:00
Oren Cohen 076cd42b7c Update uvisor-tests.txt 2018-05-22 17:57:43 +01:00
Vincent Coubard cfe325cf0e BLE NRF51: Do not filter advertising packet in peripheral if the device as no bond. 2018-05-22 17:40:18 +01:00
Vincent Coubard ba61c09ffc BLE NRF51: Resolve private address on connection in peripheral role
Soft device inconsistency: The address is not resolved automatically if the device is a peripheral.
2018-05-22 17:39:03 +01:00
Vincent Coubard 755cf5fa5f BLE NRF51: Defer connection to a common function.
The soft device is not consistent as it is required to force the connection to a resolved resolvable address so it should be known if the  target is an identity address.
2018-05-22 17:37:57 +01:00
Vincent Coubard d427fcfb59 Nordic BLE: Remove dependency to mbedtls for CryptoToolbox::ah. 2018-05-22 17:33:49 +01:00
Yogesh Pande c520baeebf Remove ns_event_loop_thread_start() from NDInterface and ThreadInterface connect().
ns_event_loop_thread_start() is incorrectly used at connect() phase, the initial
setup is already done at init() phase and the eventloop thread is correctly initialized.

Also, the usage of ns_event_loop_thread_start() API should be behind MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_DISPATCH_FROM_APPLICATION
flag as application can decide to use main thread for event loop, which will result in linker error for this API call in
case of ARMCC compiler.
2018-05-22 16:44:40 +03:00
paul-szczepanek-arm 69a0c10f00 removing erroneous (and redundant) check
this is gating on the wrong flag and the call doesn't require a check in the first place
2018-05-22 14:37:02 +01:00
paul-szczepanek-arm 08cb7aefd2 fix not writing flags in the file
flags kept with the rest of data for each entry
2018-05-22 14:08:09 +01:00
Martin Kojtal 02af950f62
Merge pull request #6336 from geky/fat-errors
fatfs: Update error code mapping
2018-05-22 14:27:01 +02:00
Martin Kojtal fc2f7fff95
Merge pull request #6757 from davidsaada/david_buffered_bd
Implement BufferedBlockDevice
2018-05-22 14:25:51 +02:00
paul-szczepanek-arm 84ff831141 measure file size with SEEK_END
I thought that's not portable but the rest of the codebase uses it so no reason not to
2018-05-22 12:25:11 +01:00
paul-szczepanek-arm 1cd0c20fd0 fix opening the file in the wrong mode 2018-05-22 12:11:07 +01:00
paul-szczepanek-arm 7d916a9997 fix not writing version number into the file 2018-05-22 11:45:38 +01:00
Kevin Bracey 6dffe6e4e7 Remove CellularInterface
This has been superceded by CellularBase. Name change occurred late
in review of https://github.com/ARMmbed/mbed-os/pull/4119 and
original unused CellularInterface was left behind.
2018-05-22 11:44:46 +03:00
Kevin Bracey 1c5bbaf4d8 Insert EMACInterface class
Rather than let "EthernetInterface" be the base EMAC NetworkInterface,
insert an "EMACInterface" class.

EthernetInterface then derives from EMACInterface and EthInterface.

A Wi-Fi driver can derive from EMACInterface and WiFiInterface - this
will be more logical than deriving from EthernetInterface and
WiFiInterface.

This does mean adding a couple of virtual inheritances to avoid
duplicate NetworkInterfaces:

                   NetworkInterface
                     /           \
            virtual /             \ virtual
                   /               \
             EMACInterface     WiFiInterface
                   \               /
                    \             /
                     \           /
                  MyCustomWiFiInterface
2018-05-22 11:44:45 +03:00
Kevin Bracey 0386f73719 Networking update: general refactoring, unifying EMAC
Initial work by Bartek Szatkowski in https://github.com/ARMmbed/mbed-os/pull/4079,
reworked following review of https://github.com/ARMmbed/mbed-os/pull/5202 to
transform the entire system into C++, retaining the basic functionality.

Bartek's summary:

* Porting ethernet to EMAC
* Updating EMAC to enable multiple interfaces
* Untangling networking classes, making the abstractions a bit clearer to follow, etc
* General refactoring
* Removal of DEVICE_EMAC flag and introducing DEVICE_ETH and DEVICE_WIFI

Revisions since initial branch:

* Remove lwip depencies
* Correct doxygen warnings
* Remove emac_api.h, replace with C++ EMAC abstract class.
* Create OnboardNetworkInterface, and LWIP implementation.
* Mappings since #4079
     lwip-interface/nsapi_stack_lwip.c -> LWIPStack.cpp
     lwip-interface/ipstack_lwip.c -> LWIPInterface.cpp
     netsocket/mbed_ipstack.h -> OnboardNetworkStack.h
     hal/emac_api.h -> EMAC.h
* Reinstate use of EthInterface abstraction
* Correct and clarify HW address EMAC ops
* Restore MBED_MAC_ADDR implementation
* Integrate PPP support with LWIP::Interface.
* Convert K64F lwIP driver to K64F_EMAC.

To do:

* Convert emac_stack_mem.h to follow this pattern.
* Figure out DEVICE_ETH/EMAC
* Update all drivers to use EMAC
2018-05-22 11:44:45 +03:00
Ron Eldor d2bcf3c356 Change target name
Apply the CC changes to TARGET_MCU_NRF52840 , and not to
the DK target alone
2018-05-22 09:24:37 +03:00
Cruz Monrreal db73ed0751
Merge pull request #6480 from davidsaada/david_nvstore_alloc_key
NVStore: add the allocate_key API (instead of set_alloc_key)
2018-05-21 17:32:00 -05:00
Cruz Monrreal cd1ff94db2
Merge pull request #6866 from geky/fat-erase-disk
fatfs: Add erase disk to format
2018-05-21 17:14:14 -05:00
Yossi Levy b95c5f79c0 Replace UINT16_MAX with (uint16_t)-1 because of build failure 2018-05-21 18:47:39 +03:00
Cruz Monrreal ab5d7e1c2f
Merge pull request #6952 from jeromecoutant/PR_MSP
STM32 ETHERNET : Allow user defined Ethernet PHY init functions
2018-05-21 10:25:06 -05:00
Cruz Monrreal a651cb220f
Merge pull request #6863 from k-stachowiak/update-mbedtls-2.9.0
Update Mbed TLS to version 2.9.0
2018-05-21 10:13:31 -05:00
Cruz Monrreal 16d30776aa
Merge pull request #6905 from kivaisan/remove_common_pal_flags
Lora: Remove obsolete FEATURE_COMMON_PAL flags
2018-05-21 10:11:20 -05:00
Vincent Coubard fb9e0dcbe7 BLE: Fix resolvable private address identification. 2018-05-21 15:30:19 +01:00
Vincent Coubard b973a8a490 BLE: Add default constructor to peer_address_type_t 2018-05-21 15:29:54 +01:00
Hasnain Virk 71348f7d65 Message flags correction
Uplink multicast is not allowed. Proprietary messages cannot be
of type unconfirmed and unconfirmed.
2018-05-21 16:16:58 +03:00
Vincent Coubard bdad5d6496 BLE Generic: Handle peer address type backward compatibility. 2018-05-21 13:29:06 +01:00
Vincent Coubard cc286fe84c BLE: Cordio pal: Handle enhanced connection events. 2018-05-21 13:22:53 +01:00
Vincent Coubard cbba6dd0d6 BLE PAL: Update connection event to support enhanced connection events. 2018-05-21 13:22:31 +01:00
Vincent Coubard 57ffa14b4b Nordic BLE: Backport privacy backward compatibility to NRF51 2018-05-21 13:21:46 +01:00
paul-szczepanek-arm 62ba220100 doxygen fix 2018-05-21 11:42:32 +01:00
Ron Eldor 23ba8bc1f5 Change Cryptocell target to a feature
Change the Cryptocell310 target to `FEATURE_CRYPTOCELL310`
2018-05-21 13:40:43 +03:00
paul-szczepanek-arm 17e8ed9401 forward resolving list init 2018-05-21 11:34:40 +01:00
Vincent Coubard 14a1095c31 Nordic BLE: Disable secure connection support on NRF51. 2018-05-21 10:34:09 +01:00
Vincent Coubard 4c1a309117 Nordic BLE: Set own resolvable address to NULL.
This address is not accessible to the application.
2018-05-21 10:22:01 +01:00
Vincent Coubard d962fc0174 BLE: factor code in GAP. 2018-05-21 10:20:43 +01:00
Vincent Coubard 28766bd873 BLE: Do not pass peer resolvable address in connection event handler 2018-05-21 10:17:44 +01:00
paul-szczepanek-arm cd9f12ab45 return error codes 2018-05-18 13:59:30 +01:00
paul-szczepanek-arm ace491d430 remove duplicate call 2018-05-18 13:54:15 +01:00
paul-szczepanek-arm 9da64e529e refactor into separate functions for readability and correctness of pal matching db 2018-05-18 13:46:55 +01:00
jeromecoutant 7622083da9 STM32 ETHERNET : Allow user defined Ethernet PHY init
If user adds USE_USER_DEFINED_HAL_ETH_MSPINIT macro in the json config,
he can implement his own HAL_ETH_MspDeInit and HAL_ETH_MspDeInit functions.
2018-05-18 14:42:27 +02:00
paul-szczepanek-arm 439d002f7d new API call to change db at runtime 2018-05-18 12:34:52 +01:00
paul-szczepanek-arm 608ad338e8 return error when not initialised 2018-05-18 10:24:16 +01:00
Vincent Coubard c3bcd10cfd BLE NRF52: Implement features related to peer_address_t
The overload of Gap::connect that accept peer_address_t has been added and gap connection and advertising report process have been updated to exploit peer_address_t in a backward compatible fashion.
2018-05-18 10:09:07 +01:00
Vincent Coubard d361960aa3 BLE: Use peer_address_type_t instead of the legacy address in security manager. 2018-05-18 10:04:27 +01:00
Martin Kojtal 79640c6a88
Merge pull request #6940 from JanneKiiskila/nvstore-thread-mstr
NVStore - remove Thread.h include
2018-05-18 09:05:05 +01:00
Cruz Monrreal 4b721583b5
Merge pull request #6559 from davidsaada/david_flash_sim_bd
Implement FlashSimBlockDevice - flash simulated block device over RAM
2018-05-17 21:54:34 -05:00
paul-szczepanek-arm a8ac925b4f privacy doxygen overview 2018-05-17 16:48:49 +01:00
Christopher Haster 5efda4b922 fatfs: Fixed ENOTEMPTY error for removing a directory 2018-05-17 10:26:32 -05:00
Christopher Haster 6d4190bd0b fatfs: Update error code mapping
A lot of the error codes in fatfs were mapped incorrectly. This patch
revisits the error code mapping to try to correct these mistakes.
2018-05-17 10:26:32 -05:00