Commit Graph

173 Commits (3f4d30de567ff3351004c7c88d26dae7d0e4b2bd)

Author SHA1 Message Date
Steven Cooreman da377c6ed3 Add EFM32GG11 Ethernet driver 2018-07-11 18:13:04 +02:00
Cruz Monrreal 93233c4f5d
Merge pull request #7364 from 0xc0170/fix_storage_rtos
Fix storage rtos types - remove including internal header file
2018-07-05 14:29:46 -05:00
Tero Jääskö 2e89fa22a5 netsocket: dns: make dns-cache-size:0 remove whole DNS cache code
Setting ""nsapi.dns-cache-size": 0" still left some of the DNS
caching code in. Add crude #if to remove all of it.
This allows one to save 429 bytes of flash and 48 bytes of RAM on
ARMC5 builds.
2018-06-29 18:17:19 +03:00
Martin Kojtal 4d8baa7451 emac targets: fix thread cb type 2018-06-29 08:35:20 +01:00
Cruz Monrreal cb000ceeab
Merge pull request #7336 from SeppoTakalo/fix_udp_filtering
Fix connected UDPSocket filtering
2018-06-28 10:06:52 -05:00
Martin Kojtal 82b490b0cf kinetis: fix rtos storage type for thread 2018-06-28 15:11:00 +01:00
jeromecoutant 6391b7f2fa TARGET_STM_EMAC astyle 2018-06-27 15:00:51 +02:00
Seppo Takalo f2c0c4e248 Fix connected UDPSocket filtering
Was dropping all packets from connected peer
2018-06-26 17:01:19 +03:00
Seppo Takalo 1ca9ccda73 Filter incoming UDP packets based on connected peer address. 2018-06-20 12:38:07 +03:00
Seppo Takalo e7cb4752fa Fix small issues from the review 2018-06-20 12:38:07 +03:00
Seppo Takalo 2b60e42756 Close Doxygen group at the end of file 2018-06-20 12:38:07 +03:00
Seppo Takalo 96ef8e345d Move string allocation to a point where get_ip_address() is called
This saves RAM/stack on typical socket usage where human readable
format is not exchanged so often.
2018-06-20 12:38:07 +03:00
Seppo Takalo 407b2f275d Move accept() to abstract socket class and implement in TCPSocket
Deprecate TCPServer in favor of just TCPSocket::accept()
2018-06-20 12:38:07 +03:00
Seppo Takalo cdbe43c0d5 Refactor Sockets by moving functions up into common base.
* Move IP Socket stuff to InternetSocket class which is inherited by TCP/UDP
* Implement sendto() and recvfrom() on TCP socket
* Implement connect() call on UDP
* Implement send() and recv() calls on UDP socket
2018-06-20 12:38:06 +03:00
Cruz Monrreal e8005f6d72
Merge pull request #7206 from mikaleppanen/k64f_async_powerup
K64f non-blocking powerup
2018-06-19 21:49:37 -05:00
Cruz Monrreal 2bb686ff1e
Merge pull request #7245 from SeppoTakalo/fix-default-interface
Fix default interface selection by using correct macro names.
2018-06-19 08:46:28 -05:00
Martin Kojtal 0658544cb6
Merge pull request #7207 from mikaleppanen/dns_singletons
Change DNS global class definitions to singletons
2018-06-19 14:14:21 +02:00
Seppo Takalo 384fc7e778 Fix typo: WifiInterface -> WiFiInterface and add missing return.
Default WiFiInterface did not even build. And when it was fixed to build,
it was always returning NULL.
2018-06-19 10:47:12 +03:00
Seppo Takalo 412f654c8d Fix default interface selection by using correct macro names.
Code was written using MBED_CONF_DEFAULT_* but the mbed_lib.json file
that created these values is prefixed with "nsapi" and therefore
final macros are MBED_CONF_NSAPI_DEFAULT_*
2018-06-18 18:59:43 +03:00
Mika Leppänen 9b0cbe064d Disabled STM ethernet driver hardware checksum calculation
No need for driver level hardware IPv4/TCP/UDP/ICMP checksum insertion
since LWIP and nanostack handles those already.

Related to issue: https://github.com/ARMmbed/mbed-os/issues/7227
2018-06-15 14:24:05 +03:00
Mika Leppänen b7627e823b K64F, K66F: Update the ENET PHY driver
PHY init and autonegotation is split into own functions.
2018-06-15 10:41:31 +03:00
Mika Leppänen 9457bd13b0 Changed DNS global class definitions to singletons
This saves memory on platforms without network interface.
2018-06-13 15:50:22 +03:00
Mika Leppänen 5e8ed3364a Added delay to K64F/K66F ethernet TX when all descriptors are in use
Currently, if all TX descriptors are in use and IP stack calls K64F/K66F
ethernet driver link out, link out drops the packet. Added 10ms delay
to link out to wait for a descriptor to become available before dropping
the packet.
2018-06-13 10:02:13 +03:00
Mika Leppänen db672b36c5 Non-blocking K64F/K66F ethernet power up
Changed K64F/K66F power up to return without waiting for link up i.e. for
the ethernet cable to be connected. This is needed for non-blocking use
of driver e.g. for using the driver from event queue.
2018-06-13 09:53:32 +03:00
Cruz Monrreal ed9a1f1327
Merge pull request #7161 from kjbracey-arm/ppp-gateway
Correct PPPCellularInterface::get_gateway()
2018-06-11 22:11:18 -05:00
Cruz Monrreal 0eac433a66
Merge pull request #7119 from kjbracey-arm/nsapi-ip6string
NSAPI: Use IPv6 conversion routines from frameworks
2018-06-11 21:27:21 -05:00
Cruz Monrreal 8c6a664380
Merge pull request #7086 from mikaleppanen/nxp_lpc17xx_emac
NXP lpc17xx emac driver
2018-06-11 08:43:43 -05:00
Cruz Monrreal 2ac81de533
Merge pull request #7141 from kjbracey-arm/kinetis-mem-conf
Kinetis EMAC: Make number of buffers configurable
2018-06-11 08:41:14 -05:00
Kevin Bracey 45e24d4682 Correct PPPCellularInterface::get_gateway()
Two cascading copy-paste errors stopped this working:

  * PPPCellularInterface::get_gateway() called
    nsapi_ppp_get_ip_address();
  * nsapi_ppp_get_gateway() called the interface's get_netmask().

First bug has always been there - second one was introduced in 5.9.

AT_CellularNetwork currently lacks calls to get both netmask and gateway
- this patch would be needed for that when added.
2018-06-07 14:28:19 +03:00
Mika Leppänen 97de145adf Added missing license to header of the file 2018-06-06 14:29:49 +03:00
Mika Leppänen a8402256a3 Corrected TX buffer reclaim error
When all TX descriptors were reserved in a row so that TX buffer
reclaim interrupt did not happen during reservation sequence, after
the interrupt occurred, TX buffer reclaim did no longer free buffers.

This happened because when all descriptors were in use, last free
index pointed to consumed index.
2018-06-06 14:29:49 +03:00
Mika Leppänen a5a8b350ce Ported NXP LPCxx ethernet driver to unified EMAC 2018-06-06 14:29:49 +03:00
Kevin Bracey a8e8775aa9 Kinetis EMAC: Correct TX ring pointer array size
TX pointer array was using RX ring length in its declaration.
Wasted memory if RX ring > TX ring, as is the default, but would
be broken if RX ring < TX ring.
2018-06-06 13:30:01 +03:00
Kevin Bracey 30e68f3201 Kinetis EMAC: Make number of buffers configurable
16 RX buffers and 8 TX buffers is probably excessive. Nanostack
version of driver successfully used 4+4, and data pump should be
broadly equivalent.

This means that switching K64F devices from Nanostack to EMAC increases
base heap usage by 18K - observed in Nanostack border router builds.

Add a config option to make it possible to lower the number of buffers.
Defer consideration of lowering the default to later.
2018-06-06 13:30:01 +03:00
Kevin Bracey 6c6bcc3575 NSAPI: Use IPv6 conversion routines from frameworks
Share IPv6 conversion code with mbed_trace, Nanostack and
mbed client.

Output formatting is better, being conformant to RFC 5952.
2018-06-05 15:31:18 +03:00
Mika Leppänen 9ec1ec90d9 Fixed DNS resolution in case all sendto operations fail
DNS resolver now counts how many sendto operations are successful
during one DNS server attempt cycle (attempting to contact DNS
servers from 0 to last index, including stack specific ones). If all
socket sendto operations fail, DNS resolution is aborted.

If one or more are successful, DNS resolution is continued until
total network attempts count is reached or all sendto operations
fails during a cycle.
2018-06-05 14:29:48 +03:00
Veijo Pesonen aafeef7401 gethostbyname won't accept empty name
Considers both versions - synchronous and asynchronous. Earlier the
underlying stack was trusted to do this check.
2018-05-30 12:07:07 +03:00
Cruz Monrreal 24cebbaec3
Merge pull request #7016 from mikaleppanen/async_dns_corr
Corrected asynchronous DNS functionality
2018-05-29 10:48:17 -05:00
Cruz Monrreal 7418260b78
Merge pull request #7014 from KariHaapalehto/interface_check
Add check for _interface
2018-05-29 10:42:19 -05:00
Kari Haapalehto 8540b1ea23 Add check for _interface 2018-05-25 12:16:00 +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
Seppo Takalo f989f6838b Fix build for MBT_ODIN_W2 and MBED_CONNECT_ODIN when using WiFi
Odin WiFi driver was only supplied for EVK board.
These all are just the same module, so using the main target name
that all inherit.
2018-05-25 10:54:09 +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 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
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