Commit graph

333 commits

Author SHA1 Message Date
Roland Dobai
5129bca67c VFS: Use smaller numbers as file descriptors 2018-05-07 09:01:56 +02:00
Angus Gratton
381be65472 cmake: Build all examples in CI
Includes some fixes for compile errors/warnings in examples.
2018-04-30 10:18:33 +10:00
Angus Gratton
1cb5712463 cmake: Add component dependency support
Components should set the COMPONENT_REQUIRES & COMPONENT_PRIVATE_REQUIRES variables to define their
requirements.
2018-04-30 09:59:20 +10:00
Angus Gratton
88df8fd293 cmake: Use cmake_lint project, tidy up all CMake source files 2018-04-30 09:59:20 +10:00
Angus Gratton
9f8cdd3572 cmake: Add "Preview release" getting start guide & build system documentation 2018-04-30 09:59:20 +10:00
Angus Gratton
c671a0c3eb build system: Initial cmake support, work in progress 2018-04-30 09:59:20 +10:00
Sagar Bijwe
21584827b3 dhcp/dhcpserver Fix max station limit check in dhcp server
Currently when MAX_STATION limit in DHCP config is set to N, dhcp server
issues only N-1 IP addresses. This is problematic from customer
perspective if both SoftAP MAX_STATION and DHCP MAX_STATION limit is set
to same value. With this change DHCP server can issue N addresses that
is inline with the set limit.

Closes TW<20556>
2018-04-24 17:36:55 +05:30
Ivan Grokhotkov
6185e722c3 Revert "Merge branch 'feature/vfs_select' into 'master'"
This reverts merge request !2074
2018-04-20 11:51:41 +08:00
Roland Dobai
6852d653bd Allow VFS file descriptors in select() 2018-04-17 11:25:30 +02:00
Xia Xiaotian
e727582180 Fix two WiFi and LWIP typos
1. close github issue: https://github.com/espressif/esp-idf/issues/1792
    2. close github issue: https://github.com/espressif/esp-idf/issues/1781
2018-04-05 11:46:42 +08:00
Roland Dobai
7c4b3d50f8 Make error codes globally unique 2018-03-27 08:12:54 +02:00
Jiang Jiang Jian
1d49c0953e Merge branch 'bugfix/close_socket_when_tcp_connecting' into 'master'
Close socket request will abort tcp write/connect

See merge request idf/esp-idf!1687
2018-03-08 20:34:40 +08:00
Angus Gratton
aedb807a02 Merge branch 'bugfix/esp_ping_ms_pr1638' into 'master'
esp_ping - Document that timeout units are in milliseconds

See merge request idf/esp-idf!1968
2018-02-26 08:00:44 +08:00
Piyush Shah
6dbb040890 FD_ZERO: Fix a compilation warning
Definition of memset is not found if string.h is not included anywhere

Signed-off-by: Piyush Shah <piyush@espressif.com>
2018-02-22 14:10:04 +05:30
Chris Morgan
86bf8798b2 esp_ping - Document that timeout units are in milliseconds
Remove 1000 multiplier from esp_ping_set_target() parameters that define time
2018-02-18 18:47:46 -05:00
Roland Dobai
f44cbe9033 Change ESP_ERR_PING_BASE because of collision with ESP_ERR_TCPIP_ADAPTER_BASE 2018-02-06 12:34:12 +01:00
Liu Zhi Fu
2242bf9b37 lwip/esp32/examples: wifi throughput optimizations
1. Put some lwip udp rx/tx relating functions to IRAM
2. Put some wifi rx/tx relating functions to IRAMa
3. Reduce wifi dynamic malloc from 4 to 1 for each ebuf
4. Update iperf example accordingly
5. Update libphy.a to v383
2018-01-30 16:27:49 +08:00
Chen Wu
ffc2db0a35 fix(ping): fix crash when multi-ping
1. "lwip_socket" should close by "lwip_close_r" other than "lwip_close"
2. for generally compatible, fix all lwip interface to normally socket interface
3. call vTaskDelete when new socket failed in case of task crash

close #https://github.com/espressif/esp32-at/issues/58
2018-01-12 15:54:07 +08:00
XiaXiaotian
32c0d74cc5 Close socket request will abort tcp write/connect
When tcp write/connect is running, close socket request will abort
    it and continue to delete netconn and close tcp. Do not immediately
    return after aborting tcp write/connect. Otherwise, tcp close
    requeset will block and tcp write/connect will crash.
2017-12-19 15:20:50 +08:00
zhangyanjiao
210d349fbd when netconn created directly,netconn_delete() will not call netconn_free(),
which will lead to memory leak

Closes https://github.com/espressif/esp-idf/issues/784
2017-12-05 10:42:37 +08:00
Jiang Jiang Jian
aece22f763 Merge branch 'bugfix/tw16581_dhcps_default_behaviour_changed' into 'master'
fix the dhcps default behaviour chenged by dns

See merge request !1612
2017-12-01 19:21:26 +08:00
Ivan Grokhotkov
cc600bd517 Merge branch 'bugfix/fix_lwip_macros' into 'master'
lwip: Change socket API macros to static-inline

See merge request !1614
2017-11-30 10:28:20 +08:00
Kedar Sovani
1c0543fb17 lwip: Change socket API macros to static-inline 2017-11-29 11:42:14 +05:30
Angus Gratton
1d5389668b Merge branch 'feature/dhcp_server_options_menuconfig' into 'master'
dhcpserver: Option to change lease time multiplier and number of max

See merge request !1595
2017-11-29 07:07:09 +08:00
zhangyanjiao
e315d7ca08 fix the dhcps default behaviour chenged by dns
Closes https://github.com/espressif/esp-idf/issues/1285
2017-11-28 16:39:00 +08:00
Krzysztof Bociurko
626ad5f577 dhcpserver: Option to change lease time multiplier and number of max
stations connected to it.

Merges: https://github.com/espressif/esp-idf/pull/1206
2017-11-28 15:58:03 +11:00
Jiang Jiang Jian
a83fbd3364 Merge branch 'bugfix/tw16287_tcp_send_succeed_after_station_disconnect' into 'master'
In STA mode, tcp_send cannot catch err after disconnect station

See merge request !1540
2017-11-27 21:30:46 +08:00
zhangyanjiao
0b644ee515 fix tcp connect/disconnect carsh 2017-11-27 10:18:58 +08:00
Angus Gratton
4ce68f6163 lwip: Expose number of active socket limits in menuconfig 2017-11-22 14:10:08 +11:00
zhangyanjiao
9fbcc6f922 In STA mode, tcp_send cannot catch err after disconnect station 2017-11-20 15:19:19 +08:00
Liu Zhi Fu
095d163050 lwip: rebind UDP/TCP pcb to valid ip address when ip is changed
This change fix the issue UDP/TCP pcb failed to rebind to correct ip address when ip is changed
2017-11-15 16:15:24 +08:00
Liu Zhi Fu
48ca949fd4 lwip: fix socket close crash issue
When lwip_close free the socket resource (netconn etc), any work
related to these resource (netconn etc) must be aborted.
2017-11-13 06:00:52 +00:00
Jiang Jiang Jian
004c391591 Merge branch 'feature/adjust_task_stack_size_according_to_nano' into 'master'
esp32/lwip: adjust task stack size according 'nano' print

See merge request !1510
2017-11-13 11:18:20 +08:00
Liu Zhi Fu
710055025e esp32/lwip: adjust task stack size according 'nano' print
1. Adjust tcpip/main/event/timer task stack size according 'nano' print
2. If 'nano' print is disabled the task stack size reduces 512 bytes
2017-11-09 10:09:42 +08:00
Dmitry4Bh
a0cedb1f44 Fix type conversion error in components/lwip/api/pppapi.c
Pointer tcpip_api_call *m  should be converted to pppapi_msg* instead of pppapi_msg_msg*
in pppapi_do_ppp_set_default(), pppapi_do_ppp_free() and so on.

It solve this issue https://github.com/espressif/esp-idf/pull/1028
so there is no need to patch ip4.c because now netif_defauilt is setted correctly.
Also it prevents memory corruption when pppapi_free() is called.
2017-11-03 16:42:56 +08:00
Angus Gratton
696dfbcfee Merge branch 'bugfix/fix_tcp_crash' into 'master'
fix tcp crash

See merge request !1444
2017-10-31 06:18:49 +08:00
Angus Gratton
5c5d5f0acb Merge branch 'bugfix/tcpip_stack_overflow_logging_printf' into 'master'
lwip: Increase minimum TCP/IP task stack size if log level is Debug or Verbose

See merge request !1396
2017-10-26 15:09:22 +08:00
zhangyanjiao
18dcbfa1e2 fix tcp crash 2017-10-24 09:44:44 +08:00
Ivan Grokhotkov
552ba35da5 add missing ioctl declaration
Previously ioctl was declared as a macro in lwip/sockets.h.
Disabling LWIP_POSIX_SOCKETS_IO_NAMES removed that declaration.

This adds sys/ioctl.h file and the missing declaration.
Also adds missing includes in vfs.c.
2017-10-23 19:47:33 +08:00
Angus Gratton
e5ae0f5927 lwip: Make LWIP_SOCKET_OFFSET signed, remove need for underflow check
This reverts commit 541493d877.
2017-10-20 18:04:28 +08:00
Liu Zhi Fu
cf7ae8135b tcpip_adapter/lwip: make dhcp domain name server option configurable
Add api to configure dhcp option: domain name server

1.closes https://github.com/espressif/esp-idf/issues/162

2.closes https://github.com/espressif/esp-idf/issues/705
2017-10-19 19:28:00 +08:00
Angus Gratton
86c89ff169 pthread: Add support for pthread thread local storage
Refactors LWIP to use this for the LWIP thread local semaphore
2017-10-17 14:46:08 +08:00
Angus Gratton
90bf40587e Merge branch 'feature/sockets_files_shared_fd_space' into 'master'
lwip & vfs: POSIX I/O functions operate on sockets and files (first stage, no select() yet)

See merge request !1352
2017-10-17 14:17:09 +08:00
Jiang Jiang Jian
50c993a1b2 Merge branch 'feature/some_refactor_for_esp_ping' into 'master'
lwip: refactor to socket ping

See merge request !875
2017-10-16 17:30:00 +08:00
Angus Gratton
539262b5c2 vfs: Remove fd_offset member
This was intended for integrating LWIP, but a different approach was used.
2017-10-16 09:45:50 +08:00
Angus Gratton
541493d877 lwip: Check for underflow in FD_SET()/FD_GET()
select() only works with LWIP sockets which have a high LWIP_SOCKET_OFFSET,
so chance of accidental underflow is high.
2017-10-16 09:45:50 +08:00
Angus Gratton
3f83914f7a lwip: Fix bug with LWIP_SOCKET_OFFSET & IGMP group support 2017-10-16 09:45:50 +08:00
Angus Gratton
3ebf7923d3 lwip: Route LWIP socket POSIX I/O functions via IDF VFS layer
No more conflicts between LWIP & newlib read(), write(), fcntl(), etc.

select() still only works if all of the fds are sockets.

Closes https://github.com/espressif/esp-idf/issues/273
2017-10-16 09:45:49 +08:00
Angus Gratton
0c50b65a34 lwip: Increase minimum TCP/IP task stack size if log level is Debug or Verbose
... unless nano formatting is enabled.

Fixes stack overflow in tcpip_adapter at the default level, as reported on forum:
https://esp32.com/viewtopic.php?f=2&t=3250&p=15538#p15447
2017-10-16 09:43:23 +08:00
Liu Zhi Fu
3bcaa592ee lwip: refactor to socket ping
Do some refactor to socket ping:
1. Add ping_deinit to kill ping thread
2. Apply configuration set by esp_ping_set_target to socket ping
3. Limit only one ping thread
2017-10-13 16:37:09 +08:00
Liu Zhi Fu
e2d077cea1 lwip: init lwip error code
Init the error code to ERR_OK when call tcpip_apimsg
2017-10-13 15:59:04 +08:00
XiaXiaotian
5df39cd4b6 Allocate some memories in SPIRAM first.
Try to allocate some WiFi and LWIP memories in SPIRAM first. If
    failed, try to allocate in internal RAM then.
2017-10-13 10:11:24 +08:00
XiaXiaotian
ad1350f0ac Release DHCP structure memory when netif is down. 2017-10-12 17:03:44 +08:00
Angus Gratton
3fdb1944d3 lwip: Disable IPV4 Link-Local addressing by default
Keeps existing IDF behaviour the same. Can still be enabled via menuconfig.
2017-10-02 10:50:27 +11:00
Angus Gratton
2cc8c91ad8 lwip: Remove undocumented CONFIG_MDNS macro flag
All options that were enabled via CONFIG_MDNS are now in menuconfig, with
the default values set the same as with CONFIG_MDNS enabled (meaning existing
projects that were using CONFIG_MDNS do not need to change).
2017-10-02 10:50:27 +11:00
Angus Gratton
04a2cefb26 lwip: Enable IPV6_ONLY option for UDP sockets (BSD & netconn)
* setsockopt(s, IPV6_ONLY, &one, sizeof(int)) will disable IPV6-only
  mode. Incoming/outgoing IPV4 packets are dropped.

* Otherwise, sockets bound to IPV6_ANY_ADDR can receive unicast packets
  for IPV4 or IPV6.

* sendto() a IPV6-mapped-IPV4 address on a UDP socket works correctly
  (not supported for RAW or TCP sockets.)

* getaddrinfo() option AI_V4MAPPED is implemented.

As well as extending support to TCP & RAW, there is some potential improvement
to dropping incoming packets - the drop happens a bit late in the process and
there is no "ICMP port unreachable" response sent.
2017-10-02 10:50:27 +11:00
Angus Gratton
961180617e lwip: Add IPV6 multicast group membership socket options
As described in RFC2133: IPV6_MULTICAST_IF, IPV6_MULTICAST_HOPS,
IPV6_MULTICAST_LOOP, IPV6_MULTICAST_LOOP, IPV6_DROP_MEMBERSHIP.
2017-10-02 10:50:27 +11:00
Ivan Grokhotkov
b7a79ab67e Merge branch 'bugfix/bind_dhcp_server_udp_to_ip_of_ap' into 'master'
Fix the bug that if one device is in station+softap mode, other device can not get IP address after connecting to the softap.

See merge request !1314
2017-09-26 16:06:55 +08:00
Liu Zhi Fu
05b0d567e5 example: add iperf example
Support iperf
2017-09-26 09:19:01 +08:00
XiaXiaotian
20064978ba Fix the bug that if one device is in station+softap mode, other device can not
get IP address after connecting to the softap.

    Now the default netif is station in station+softap mode. The UDP pcb of
DHCP server is binded to IP 0.0.0.0. When other device connects to softap, the
DHCP offer will be sent by softap.But because the destination IP of DHCP offer
is broadcast IP and the source IP of it is 0.0.0.0, it will be sent from default
netif, that is station interface. Other device can not receive the DHCP offer
sent from station interface. As a result, other device can not get IP address.
The resolution is that bind UDP pcb to the IP address of softap. So, the source
IP of DHCP offer is that of softap. DHCP offer can be sent from softap interface
by source IP route method.
2017-09-23 20:18:50 +08:00
zhangyanjiao
336c4b4a55 fix lwip tcp_oversize_dbgcheck assert 2017-09-15 10:28:51 +08:00
zhangyanjiao
164006509f optimize lwip route when loopback open and in "APSTA" mode 2017-09-14 16:19:05 +08:00
Ivan Grokhotkov
868b0ce228 Merge branch 'bugfix/list_node_naming' into 'master'
Fix "list_node" name conflict in bluedroid & dhcp_server

See merge request !1216
2017-09-12 12:10:54 +08:00
Angus Gratton
73b3ae8a2d lwip: Use hardware RNG for LWIP_RAND(), use LWIP_RAND() for random port assignment 2017-09-07 16:32:05 +10:00
Angus Gratton
74d5f85c53 Merge branch 'feature/build_warn_undefined_vars' into 'master'
Add --warn-undefined-variables to MAKEFLAGS (github #138)

See merge request !1214
2017-09-05 15:39:48 +08:00
Angus Gratton
9471ce9135 dhcpserver: Move DHCP option names to a separate header
Avoids naming conflicts. Resolves TW13826.
2017-09-05 17:28:40 +10:00
Angus Gratton
1be6bf6790 dhcpserver: Move list_node to implementation not public interface
Was unused in the public interface.

Closes https://github.com/espressif/esp-idf/issues/948
2017-09-05 17:14:23 +10:00
Angus Gratton
f17bbff4b5 Merge branch 'feature/tcp_msl_menuconfig' into 'master'
components/lwip: Expose TCP_MSL in menuconfig. (github #783)

See merge request !1175
2017-09-05 14:18:36 +08:00
Angus Gratton
8670844acf build system: Restore ifdef/ifndef in Makefiles, clean up examples build 2017-09-05 16:11:03 +10:00
Deomid Ryabkov
9903ea1c11 Add --warn-undefined-variables to MAKEFLAGS
Fix warnings where undefined vars are used.

Make Kconfig emit "FOO=" for unset bool options
To ensure make variables are always defined, even if empty.

When writing auto.conf, include symbols disabled by dependency to make sure all make variables are always defined.

Fixes espressif/esp-idf#137

Cherry-picked from https://github.com/espressif/esp-idf/pull/138
2017-09-05 16:10:46 +10:00
Ivan Grokhotkov
9da1bf1a45 Merge branch 'bugfix/lwip_send_timeout' into 'master'
match sys tick with lwip_send_timeout

See merge request !1203
2017-09-04 18:19:59 +08:00
zhangyanjiao
547b7b0246 match sys tick with lwip_send_timeout 2017-09-04 14:52:16 +08:00
Stephen Casner
1e3dd2a4fa Add missing debug log message for out-of-sockets case
Merges https://github.com/espressif/esp-idf/pull/903
2017-08-30 17:55:00 +10:00
devsaurus
92535158e7 components/lwip: Expose TCP_MSL in menuconfig.
Merges https://github.com/espressif/esp-idf/pull/783
2017-08-30 16:44:53 +10:00
Jiang Jiang Jian
72a6b26244 Merge branch 'bugfix/tw14823_lwip_assert_err' into 'master'
assert when close a connecting socket

See merge request !1136
2017-08-24 11:29:32 +08:00
zhangyanjiao
61f64e38d9 assert when close a connecting socket 2017-08-22 20:36:35 +08:00
Liu Zhi Fu
b45433110f tcpip_adapter/lwip: optimize wifi/ip event 2017-08-21 14:36:44 +08:00
Liu Zhi Fu
4ad1f2b272 lwip: optimize TCP close
Optimize TCP close:
1. Not remove TCP pcb when IP address is changed since the lwip netconn still need the pcb
2. If the TCP connection is in TCP_FIN_WAIT_1 for too long time, remove it
2017-07-27 12:44:39 +08:00
Jiang Jiang Jian
460ab2e33b Merge branch 'feature/make_tcp_udp_receive_mbox_configurable' into 'master'
lwip: Make UDP/TCP receive mail box configurable

See merge request !1051
2017-07-25 20:45:38 +08:00
Liu Zhi Fu
7b2f388abc lwip: Make UDP/TCP receive mail box configurable
Different application may require different TCP/UDP receiv mail box size,
so make them configurable.
2017-07-25 13:56:32 +08:00
Liu Zhi Fu
9ae5c6700b lwip/ethernet: fix emac rx buf err
1. Lwip not free the ethernet buf in lwip layer
2. Fix emac counter error
2017-07-25 11:19:31 +08:00
Jiang Jiang Jian
4ec2abbf23 Merge branch 'feature/some_refactor_for_tcpip_adapter' into 'master'
tcpip_adapter: not remove netif when tcpip adapter is stopped

See merge request !943
2017-07-13 22:16:00 +08:00
Liu Zhi Fu
d724cc23d2 tcpip_adapter: not free netif when tcpip adapter is stopped
When tcpip adapter is stop, don't free the netif
2017-07-13 18:42:45 +08:00
XiaXiaotian
7a64e19ba8 Broadcast IP route based on source IP address.
If destination IP address of the packet is broadcast address, firstly compare
    source IP address with the that of each network interface. If it matches,
    packet is forwarded from the interface.
2017-06-30 16:18:29 +08:00
Angus Gratton
857a7f186e lwip: Make LWIP_ERROR behave as if assertions were off, even if they are on 2017-06-27 18:36:54 +10:00
Angus Gratton
f5e7f2bb8f lwip: Remove port-specific sys_arch_assert(), use libc __assert_func() instead 2017-06-27 17:32:17 +10:00
Angus Gratton
0c301206cf lwip debug: fix typo 2017-06-23 16:28:38 +10:00
Angus Gratton
8f4fc209a1 lwip: Enable LWIP assertions unless they are disabled globally 2017-06-23 16:26:11 +10:00
Angus Gratton
1c6510ed96 lwip: Allow configuring/disabling some TCP options to save RAM
RAM savings are small, but may add up when running large numbers of sockets.
2017-06-23 16:26:11 +10:00
Angus Gratton
1ea0ddb025 lwip: Expose broadcast/multicast ping enable options in menuconfig 2017-06-23 16:15:00 +10:00
Angus Gratton
ae05787a51 Merge branch 'bugfix/make_srcdirs_order' into 'master'
build system: Fix bug where component src subdirs needed listing before parent source dirs

See merge request !778
2017-06-06 14:37:21 +08:00
Liu Zhi Fu
cd58f089c2 lwip: fix dhcp server crash issue
Fix long dhcp request packet cause dhcp server crash issue
2017-06-02 14:02:33 +08:00
jack
fc130fba86 fix bug that files missing commit in MR 773 2017-05-31 19:37:39 +08:00
Angus Gratton
99771a255f build system: Fix bug where component src subdirs needed listing before parent source dirs
Triggered on make 3.81, happens sometimes on Linux and always(?) on macOS. May depend on the order the OS' filesystem
resolves wildcards in.

Includes a revert to the LWIP component to verify this is properly fixed.

See also https://github.com/espressif/esp-idf/issues/632
2017-05-22 11:45:55 +10:00
Jiang Jiang Jian
195358ddb7 Merge branch 'bugfix/lwip_loopback' into 'master'
fix(lwip): fix tcp connect fail when enable LOOPIF

when enable the LOOPIF, because of use the loopnetif, the TCP connect will fail. see TW12029

See merge request !711
2017-05-05 15:45:14 +08:00
Liu Zhi Fu
5cf3b1c201 esp32/lwip: adjust some lwip options and update wifi lib
1. Modify TCP TX window from 2 to 4
2. Modify TCPIP task stack default size from 2048 to 2560
3. Update wifi lib for TCP performance optimization
2017-04-28 15:25:33 +08:00
Liu Han
aeecbcc7ee fix(lwip): fix tcp connect fail when enable LOOPIF 2017-04-27 18:59:47 +08:00
Ivan Grokhotkov
8d6a03820a lwip: fix error when building on OS X, only build ppp if enabled
- reorder directories listed in COMPONENT_SRCDIRS so that
  subdirectories precede parent directories

- don’t include PPP source directories if PPP support is not enabled
2017-04-25 17:22:09 +08:00
Jiang Jiang Jian
3f4e917ad6 Merge branch 'feature/ppp_over_serial' into 'master'
Enable experimental/unsupported PPP over Serial driver

From PR #272 https://github.com/espressif/esp-idf/pull/272

See merge request !690
2017-04-25 14:02:55 +08:00
Angus Gratton
f3a567b65d PPPoS: Rearrange config items (move TCP/IP stack size to LWIP), mark as experimental/unsupported
Ref #272
2017-04-21 14:23:34 +10:00
Adrian Muzyka
47c722d674 Enable lwip PPPoS support
* Fix some lwip api bugs
 * Added PPP_SUPPORT parameter to lwip Kconfig
 * Added example pppos_client

Merges #272 https://github.com/espressif/esp-idf/pull/272
2017-04-21 14:23:34 +10:00
Liu Zhi Fu
ab37f89f55 lwip: fix tcp stable test abort issue
1. Modify dhcp server timer to 1 seconds
2. Enable ETHARP_TRUST_IP_MAC

modify according to review
2017-04-19 17:39:32 +08:00
Ivan Grokhotkov
378884660a Merge branch 'feature/tw11250_add_tcp_delay_statistics' into 'master'
lwip: refactor to esp specific counter

1. Add tcp debug counter
2. Refactor other ESP specific counter

See merge request !635
2017-04-13 15:29:36 +08:00
Edmund Huber
eab6d483a5 give the AP and STA netifs different names for ease of debugging lwip 2017-04-11 20:40:36 +08:00
Liu Zhi Fu
ece61944f4 lwip: refractor to esp specific counter
1. Add tcp debug counter
2. Refractor other ESP specific counter
2017-04-10 14:46:48 +08:00
Jiang Jiang Jian
fc15d72038 Merge branch 'feature/implement_lwip_critical_protect_with_mutex' into 'master'
lwip: implement lwip critical session with mutex

Currently lwip critical session is based on interrupt, now replace it with mutex

See merge request !595
2017-04-01 17:27:20 +08:00
Liu Zhi Fu
68e27f8188 optimize tcpip adapter layer 2017-04-01 16:41:51 +08:00
Liu Zhi Fu
778a475136 lwip: implement lwip critical session with mutex
Currently lwip critical session is based on interrupt, now replace it with mutex
2017-04-01 16:24:58 +08:00
Liu Zhi Fu
a8f9d99cae lwip: optimize dhcp renew/rebind timer 2017-03-16 09:46:43 +08:00
Ivan Grokhotkov
9463a7c594 Merge branch 'feature/lwip_numbers' into 'master'
Change max number of open sockets

Change max number of open sockets from 16 to 32 because of MFI project need support 21 open sockets at least.

See merge request !532
2017-03-06 22:37:12 +08:00
Ivan Grokhotkov
7754647e71 Merge branch 'bugfix/separate_ethernet_and_wifi' into 'master'
Allow separate ethernet & wifi configuration

If only 1/2 of ethernet & WiFi are enabled in config, the other interface is no longer linked into the firmware.

* Fixes bug where enabling Ethernet but not WiFi would fail to compile.
* Also means that enabling WiFi but not Ethernet no longer links some unused ethernet interface functions.


See merge request !525
2017-03-03 11:53:32 +08:00
Jiang Jiang Jian
6451c57e52 Merge branch 'bugfix/tw10169_dhcp_release_cause_tcp_abort' into 'master'
Bugfix/tw10169 dhcp release cause tcp abort

Modify the DHCP timer granularity from 1 minutes to 1 second.

See merge request !539
2017-03-02 17:28:11 +08:00
Liu Zhi Fu
66199b1efe Check DHCP rebind timer before checking dhcp release timer in cause they have the same value.
lwip: modify dhcp timer granularity from 60s to 1s

Current DHCP granularity is 60 seconds, it's not accurate, it can cause DHCP release/rebind/renew timer
timeout at the same time, also it may renew/rebind/release at wrong time, thus cause problem.
2017-03-01 20:50:58 +08:00
Liu Zhi Fu
3b3c3210a6 lwip: fix bool options default value wrong issue
menuconfig options with bool type should use 'y/n' to use the default value,
instead of '1/0'
2017-03-01 13:37:36 +08:00
Liu Han
03ea45046d lwip: Change max number of open sockets 2017-02-27 14:47:48 +08:00
Angus Gratton
eb1fbaabce lwip: Refactor support for L2 pbuf free notification into each driver
Makes it easier to handle different drivers enabled at compile/link time.
2017-02-24 14:45:17 +11:00
qiyueixa
03e3b137bf lwip: optimize the dhcp client
1. modify the discover retry backoff time from (2,4,8,16,32,60,60)s to (500m,1,2,4,8,15,15)s.
2. add DHCP_DOES_ARP_CHECK to menuconfig for users to specify if do a ARP check on the offered address.
   If enable, one more second will be taken in obtaining IP address.
3. update wifi libs
2017-01-23 13:44:34 +08:00
Jan Schmidt
a14f22f65b netconn_gethostbyname: Fix race reporting success
If the DNS request is dispatched and performed very quickly,
then it can complete before tcpip_callback() actually returns,
in which case we'll destroy the actual err_t error value passed
in the message. Use a local variable for the tcpip_callback
error code so that can't happen.

Resolves #269 https://github.com/espressif/esp-idf/pull/269
2017-01-20 14:57:00 +11:00
me-no-dev
d3a2d6aedc Do not printf if debug level is not correct 2017-01-18 16:13:09 +02:00
Wu Jian Gang
3c8235d40d lwip: Allow config TCP_MAXRTX & TCP_SYNMAXRTX in menuconfig 2017-01-17 17:44:25 +08:00
Liu Han
6c86586e97 components/lwip: Set the ping target info
Add API for set the ping target info and get the ping result
2017-01-11 10:58:34 +08:00
Liu Han
315b3f979f components/tcpip_adapter: Allow to set different hostname for each interface 2017-01-10 12:42:14 +08:00
Wu Jian Gang
9dd5f2a952 lwip: fix compile issue when autoip option enabled 2017-01-09 10:22:36 +08:00
Ivan Grokhotkov
0efaa4f4b8 Merge branch 'feature/lwip-rcvbuf-option' into 'master'
add menuconfig option to enable SO_RCVBUF

This option is required by Arduino and enables netconn connection to be queried for amount of data available in the rx buffer.

See merge request !372
2017-01-07 18:45:37 +08:00
Wu Jian Gang
c943fabcda Merge branch 'feature/CoAP' into 'master'
Add CoAP feature

Add CoAP protocol, support client and server test demo.

See merge request !303
2017-01-06 15:37:09 +08:00
me-no-dev
0feb3633fc add menuconfig option to enable SO_RCVBUF 2017-01-05 13:17:52 +02:00
Liu Zhi Fu
d98b99f4f0 lwip: rework according review comments 2017-01-05 12:22:49 +08:00
Liu Zhi Fu
0fb2ab9f5c lwip/freertos/esp32: add throughput optimization related code
1. Update wifi lib which contains ampdu and other optimizations
2. Add throughput code debug code
3. Other misc modification about throughput optimization
2017-01-05 11:37:08 +08:00
liuhan
d0b10ba2dd components/coap: Add libcoap port for ESP32 platform 2016-12-30 15:05:26 +08:00
Wu Jian Gang
0b79a108b8 Merge branch 'feature/add_ip_frag_option' into 'master'
lwip: add ip frag and reassembly option in menuconfig

add ip frag and reassembly option in menuconfig

See merge request !348
2016-12-29 11:26:06 +08:00
Angus Gratton
06e03ff52e Replace backwards-compatible portTICK_RATE_MS with FreeRTOS v8+ portTICK_PERIOD_MS
Closes github #51 https://github.com/espressif/esp-idf/issues/51
2016-12-28 10:23:13 +11:00
XiaXiaotian
15651b5923 lwip: add ip frag and reassembly option in menuconfig 2016-12-26 15:47:20 +08:00
shangke
5ddf6daa98 feature/ethernet_driver: update ethernet driver
1. The transmitting mode of the packets from LWIP to MAC is changed from synchronous to asynchronous.
2. The receive buf mode : support pointer mode and copy mode.
3. Add get phy status func used to config mac register.
2016-12-26 14:50:49 +08:00
Angus Gratton
d031530196 Merge branch 'feature/dhcpserver_null_gw' into 'master'
Allow gw to be null

Github Pull Request 163: https://github.com/espressif/esp-idf/pull/163

Allow interfaces to be configured without a default gateway, for
local-only communication.

In case of the AP interface, if gw is not set, do not offer it.

See merge request !312
2016-12-20 06:14:44 +08:00
Liu Zhi Fu
55726385a4 add more comments and call portYIELD when necessary 2016-12-15 15:06:00 +08:00
Liu Zhi Fu
5e2ae7ac19 lwip: fix lwip dual core issue
Call xSemaphoreGiveFromISR instead xSemaphoreGive when the calling context is in critical section.
2016-12-15 14:37:21 +08:00
Deomid Ryabkov
cbff82cc44 Allow gw to be null
Allow interfaces to be configured without a default gateway, for
local-only communication.

In case of the AP interface, if gw is not set, do not offer it.
2016-12-14 19:34:04 +00:00
Angus Gratton
94d2f77643 build system: Remove FLAGS_XXX variable option, replace with per-target overrides
Use for targeted disabling of warnings in LWIP.
2016-12-07 13:49:09 -08:00
shangke
e0040af7e5 ethernet: add first version of ethernet driver 2016-12-01 19:17:48 +08:00
Xia Xiaotian
ad555d68d3 esp32/lwip: add check sleep
1. fix tw8911 sleep in scan leads to auth frame malloc fail.

2. fix tw8913 pm state transfer wrong leads to wdt.

3. make some comments for modem sleep and wpa2 enterprise.

4. removd duplicated debug option ESP_THREAD_SAFE_DEBUG
2016-12-01 13:34:36 +08:00
liuhan
f9d2d63e75 lwip: update open socket number.
modify default number from 4 to 10
2016-11-29 16:25:17 +08:00
Liu Zhi Fu
fc2883a59a lwip: modify according code review
1. Modify tcp window size/send buffer back to 4/2
2. Disable lwip statistics by default
2016-11-28 19:54:22 +08:00
Liu Zhi Fu
9a3f9af2db esp32/lwip: some misc changes
1. Update phy to fix HT40 rx issue
2. Add code about RX_DONE/TX_DONE/Lock-free optimization
3. Fix wifi ioctl return value error
4. Add lwip statistics debug code
5. Modify TCP window size to 10 and send buffer size to 5
2016-11-28 18:36:14 +08:00
Wu Jian Gang
7f2c6a9d80 Merge branch 'bugfix/tw8770_fix_socket_memory_leak' into 'master'
lwip: fix socket memory leak issue

1. Add socket memory leak debug counter
2. Fix TCP PCB leak issue
    Currently ESP32 support maximum 16 TCP PCBs and all TCP PCB are allocated from heap memory. In some scenario, we may
    have memory leak issue,  for example, the application already created 16 TCP PCB, then it close 5 of them, because the TCP
    state machine, the LWIP core may not free all the 5 TCP PCB immediately, maybe some is in TIME_WAIT status, some is in 
    FIN_WAIT_1 etc. Then the application try to malloc 17th TCP PCB (the application think they just create 12 because they already
    close 5), memp_malloc() will return true because the heap is not out of memory, but actually we got 17 TCP PCB. When the 
    scenario repeat again and again (in our Audio application, it repeat more than 10000 times), more and more TCP PCB will be
    created in the system, each TCP PCB require 200B, then memory leak happen (In Audio application, I saw more than 26 TCP PCB
    are created, and 10*200=2K memory are leaked).

See merge request !223
2016-11-25 13:44:02 +08:00
Wu Jian Gang
e05fe28574 Merge branch 'bugfix/arp_queue_failed' into 'master'
report the arp queue fail result



See merge request !227
2016-11-22 14:45:44 +08:00
Wu Jian Gang
46c81ded73 Merge branch 'feature/tw8799_low_level_output_optimize' into 'master'
Feature/tw8799 low level output optimize

Fix a potential memory crash error in low_level_output

See merge request !224
2016-11-22 11:56:35 +08:00
tianzhongxing
cc39b7b286 components/lwip/arp: change the arp dropping packet function
LWIP will drop the oldest package at the arp packet cache queue and return "ERR_OK"
We change it that ARP level will drop the current packet and return "ERR_MEM" to tell user that you should send the packet again latter.
2016-11-22 10:11:52 +08:00
Liu Zhi Fu
586c17f831 lwip: remove useless printf info 2016-11-21 16:08:39 +08:00
Liu Zhi Fu
9cc9710a27 lwip: update according to review comments
1. Define memp_malloc/memp_free as static inline function
2. When TCP pcb is out of memory, try to kill PCB in FIN_WAIT_1 when necessary
2016-11-21 15:02:36 +08:00
tzx
a8fb9f2b84 ipv6 interface: add branch for ipv6 interface 2016-11-21 11:06:51 +08:00