Commit Graph

294 Commits (c1b6fdc5af8b620493c331a01dbbf9e81f1b0ea0)

Author SHA1 Message Date
Cruz Monrreal 24cebbaec3
Merge pull request #7016 from mikaleppanen/async_dns_corr
Corrected asynchronous DNS functionality
2018-05-29 10:48:17 -05:00
Kevin Bracey cedbf72a3b Fix lwIP PPP glue
EMAC changes broke PPP glue - fix it up. In particular, PPP steals
the netif->state pointer, so we can't use it as a back pointer to
our LWIP::Interface.
2018-05-28 10:30:42 +03:00
Mika Leppänen 7a1703de23 Made lwip memory configuration more specific for NXP targets
There is a configuration problem with UBLOX_C027 cellular because of missing
LWIP memory configuration for the target.

Added configuration for LPC1768, LPC4088, LPC4088_DM targets and changed
NXP to more specific LPC546XX.
2018-05-25 12:48:35 +03:00
Mika Leppänen d648bf8477 Corrected asynchronous DNS functionality
- Set network stack to store event queue so that mbed::mbed_event_queue() call
  is not needed every time call_in() is called
- Added dns state variables and enum (states are: created, initiated and cancelled)
- Corrected DNS response handling so that if DNS server returns that host name is
  unknown the DNS query is not tried again
- Reorder mutexes in nsapi_dns_query_multiple_async()
- Created nsapi_dns_query_async_initiate_next() function to initiate the next
  DNS query from the queue after delete of previous query
- Added dsn_timer_running variable to supervise DNS timer start/stop
- Changed cancel function to only mark query as deleted and moved deletion
  to timer function. This allows to run socket close on DNS thread
- Added new nsapi error NSAPI_ERROR_TIMEOUT for DNS (and other) timeouts
2018-05-25 11:21:52 +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
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
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
cyliangtw 401f09c479 [M487/NUC472] Support DHCP & TCP sample, also remove legacy emac 2018-05-23 12:24:09 +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 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 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 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
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
Kevin Bracey ec2db62fe5 lwIP: Enable TCP out-of-order processing
Our config file for lwIP had TCP_QUEUE_OOSEQ disabled - this can
cause significant performance problems, as observed during testing.

One lost packet can lock an input stream into a mode where the
transmitter keeps thinking packets are being lost, so keeps slowing
down. This caused test failures - a transfer that would normally
take 10s hit a 60s timeout.

Turning this on increases code size, but doesn't significantly increase
static memory use. The memory used for out-of-order packets comes from
the same pbuf pool as for outgoing TCP segments, so there is contention
when running bidirectionally.

Out-of-order processing is on by default for lwIP - this seems to be
another example of us excessively paring it back.
2018-05-11 17:12:00 +03:00
Cruz Monrreal 5038135c7d
Merge pull request #6577 from SeppoTakalo/remove_features
Get rid of FEATURE_COMMON_PAL and FEATURE_NANOSTACK
2018-05-07 10:44:50 -05:00
Martin Kojtal 2729c7aa23
Merge pull request #6780 from bmcdonnell-ionx/fix-lwip-compiler-warning
resolve LWIP compiler warning
2018-05-03 16:24:31 +01:00
Brendan McDonnell 33a2116042 reduce variable scope 2018-05-02 11:17:25 -04:00
Brendan McDonnell ba29bd9315 use separate variable to resolve compiler warning 2018-05-02 09:33:24 -04:00
Seppo Takalo d1c6bc0913 Get rid of FEATURE_COMMON_PAL
Nanostack related files moved under 'feature/nanostack'
Common libraries moved to 'features/frameworks'

Allow FEATURE_COMMON_PAL still to be defined in the build so
that we don't break any builds.
2018-04-27 14:38:43 +03:00
Martin Kojtal a37ba4b3ab
Merge pull request #6614 from pauluap/compiler_warning_macro_expression
Macro expansion leads to a bare expression
2018-04-19 17:22:52 +02:00
Martin Kojtal c0f0a8e61f
Merge pull request #6653 from kjbracey-arm/lwip-ticks
Stop lwIP using us_ticker
2018-04-18 14:17:54 +02:00
Kevin Bracey e7206cdc8e Stop lwIP using us_ticker
lwIP was using us_ticker unnecessarily, complicating the code and
potentially causing grief with power saving, and possible glitches
on timer wrap. Switch it to use the RTOS tick count.
2018-04-17 12:40:04 +03:00
Cruz Monrreal e2567e5dad
Merge pull request #6599 from jeromecoutant/PR_WARNING
STM32 compilation warning issues
2018-04-16 10:41:36 -05:00
Paul Thompson 8e7615087a Switch to using ip_addr_isany_val 2018-04-13 05:08:29 -07:00
Paul Thompson 449541c464 Explicitly ignore return value or bare expression (macro expands to a number)
Compile: lwip_stack.c
In file included from ../features/FEATURE_LWIP/lwip-interface/lwip_stack.c:41:0:
../features/FEATURE_LWIP/lwip-interface/lwip_stack.c: In function 'mbed_lwip_bringup_2':
../features/FEATURE_LWIP/lwip-interface/ppp_lwip.h:58:44: warning: statement with no effect [-Wunused-value]
 #define ppp_lwip_disconnect()              ERR_IF
                                            ^
../features/FEATURE_LWIP/lwip-interface/lwip_stack.c:858:21: note: in expansion of macro 'ppp_lwip_disconnect'
                     ppp_lwip_disconnect();
                     ^~~~~~~~~~~~~~~~~~~
../features/FEATURE_LWIP/lwip-interface/ppp_lwip.h:58:44: warning: statement with no effect [-Wunused-value]
 #define ppp_lwip_disconnect()              ERR_IF
                                            ^
../features/FEATURE_LWIP/lwip-interface/lwip_stack.c:875:21: note: in expansion of macro 'ppp_lwip_disconnect'
                     ppp_lwip_disconnect();

                     ^~~~~~~~~~~~~~~~~~~
2018-04-12 09:45:25 -07:00
jeromecoutant 2d0dce1db5 STM32F7 : correct compilation warnings 2018-04-12 10:55:02 +02:00
jeromecoutant 2fcf8d8990 STM32F4 : correct compilation warnings 2018-04-12 10:52:21 +02:00
jeromecoutant 4e9e9f5c62 STM32F2 : correct compilation warnings 2018-04-12 10:51:18 +02:00
Cruz Monrreal 57b48f6e05
Merge pull request #6416 from kjbracey-arm/lwip_netconntype_fix
lwIP: fix some IPv6 errors, eg TCP keepalive
2018-03-26 14:27:09 -05:00
Kevin Bracey b3eb51acef lwIP: fix some IPv6 errors, eg TCP keepalive
Glue code was inspecting lwIP's netconn "type", checking directly for
NETCONN_UDP and NETCONN_TCP.

Unfortunately the type byte has some flag bits like
"IPv6", which means the tests fail if it's an IPv6 socket. So, for
example, TCP socket options were rejected for IPv6.

Add the necessary NETCONNTYPE_GROUP macros to fix this.
2018-03-21 13:40:25 +02:00
Mika Leppänen af29734dd0 Corrected lwip adaptation TCP flagging 2018-03-13 09:47:11 +02:00
Cruz Monrreal 21483cd59d
Merge pull request #6167 from hug-dev/cm3ds-bug-fix
CM3DS Maintenance Pull Request: Bug fixes (1/4)
2018-02-27 13:44:05 -06:00
Teemu Kultala 34ef11630c fix issue 6150 by always setting net interface UP in mbed_set_dhcp 2018-02-22 13:00:46 +02:00
Hugues de Valon ef7b16d9c5 CM3DS: fix non aligned access in Ethernet driver
This patch changes the way data is put in the TX_DATA_PORT register when
sending packet over Ethernet.
When this driver is compiled with release compilation profile
(space optimization compiler options) with Arm compiler version 5,
the line:
SMSC9220->TX_DATA_PORT = *pktptr;
generates the assembly instruction to get the pktptr pointed value:
LDM r2!, {r3}
with pktptr = r2
However, the code does not prevent the pktptr value from being unaligned
(to a 32 bits boundary) in that zone and the LDM instruction causes a
HardFault if this is the case. When the compiler option is not activated
(debug and develop compilation profiles), the compiler generates LDR
instruction instead which does not cause a HardFault.
The ARM v7-M states page B3-601: "Unaligned load-store multiples and
word or halfword exclusive accesses always fault."

To face that problem, we check if the data pointer is aligned or not. If
it is, we apply the same algorithm than before. If not, a local variable
is created and we copy in it, byte per byte, the contents at the
unaligned pointer. However, it will impact performances adding 8
instructions (one LD and one ST for each copied byte).

Change-Id: I11f6e82ce5521960d2ecf499f718f76fec29c0b0
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2018-02-21 17:54:12 +00:00
Galanakis, Minos 5b8ff81e02 CM3DS: fix a minor bug in the ethernet LWIP driver
This patch fixes a memory bug. `eth_arch_enetif_init` method call
would attempt to write to un-initialized area of memory.

Change-Id: I9881de71d58fa14db609fe3e24617a210b896471
Signed-off-by: Galanakis, Minos <minos.galanakis@arm.com>
2018-02-21 17:51:09 +00:00
Veijo Pesonen a7ef67a92a fixup! LWIP PBUF_POOL_BUFSIZE increased to fit also IPv6 header 2018-02-21 08:25:46 +02:00
Veijo Pesonen e1d9d8783d LWIP PBUF_POOL_BUFSIZE increased to fit also IPv6 header
IPv6 header requires 20 more bytes compared to IPv4 header.
2018-02-20 15:45:44 +02:00
Kevin Bracey 984cc1ab50
Merge pull request #6032 from jarlamsa/status-callbacks
Status callbacks
2018-02-15 13:02:10 +02:00
andreas.larsson 34099ba294 Added missing lwip_md5_init and lwip_md5_free as suggested by:
https://github.com/ARMmbed/mbed-os/issues/6003#issuecomment-364127671
2018-02-09 12:55:10 +02:00
Jarno Lamsa 282f3c9da2 Add support for error cases for lwip and nanostack 2018-02-09 12:44:31 +02:00
Teemu Kultala 5a7482667e NSAPI status callback changes
This is the original content of feature-status-callbacks, reviewed in
https://github.com/ARMmbed/mbed-os/pull/5457
2018-02-09 12:44:31 +02:00
Juha Ylinen 38ceb9339e lwip: enable EMAC IPv6 support 2018-02-09 10:11:44 +02:00
TomoYamanaka 0d00be3a60 Add the function declarations of WEAK attribute to use LWIP on GR-LYCHEE
I added the function declarations of Ethernet functions that have a WEAK attribute. Although several Ethernet functions was called in rza1_emac.c, GR-LYCHEE don't have Ethernert feature. But there may be case that GR-LYCHEE uses LWIP feature.
In this case, since GR-LYCHEE will occur the build error, I addressed the error by defining the functions with a WEAK attribute. For reason of WEAK attribute, there is no influence in GR-PEACH and VK_RZ_A1H that have Ethernet feature.
2018-01-11 18:11:37 +09:00