Unverified Commit af2671d8 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

IPv6 initial support from @oddstr13 (#748)

* Apply @oddstr13 multicast patch to cyw43 driver
* Initial work for enabling IPv6
* Allow accessing CYW43 stats when LWIP_SYS_CHECK_MS is not set
* Use cyw43_set_allmulti to allow receiving multicast
* Add tools/libpico/build to gitignore
Co-authored-by: default avatarOdd Stråbø <oddstr13@openshell.no>
parent 11cb82b0
.DS_Store
system
tools/dist
tools/libpico/build
......@@ -3,7 +3,7 @@
url = https://github.com/earlephilhower/ArduinoCore-API.git
[submodule "pico-sdk"]
path = pico-sdk
url = https://github.com/raspberrypi/pico-sdk.git
url = https://github.com/earlephilhower/pico-sdk.git
[submodule "system/pyserial"]
path = tools/pyserial
url = https://github.com/pyserial/pyserial.git
......
......@@ -89,7 +89,7 @@ semaphore_t cyw43_irq_sem;
// Called in low priority pendsv interrupt only to do lwip processing and check cyw43 sleep
static void periodic_worker(void) {
#if CYW43_USE_STATS
#if CYW43_USE_STATS && LWIP_SYS_CHECK_MS
static uint32_t counter;
if (counter++ % (30000 / LWIP_SYS_CHECK_MS) == 0) {
cyw43_dump_stats();
......
......@@ -53,6 +53,10 @@ extern void interrupts();
#define DHCP_DOES_ARP_CHECK 0
#define LWIP_DHCP_DOES_ACD_CHECK 0
#if LWIP_IPV6
#define LWIP_IPV6_DHCP6 1
#endif
// NTP
extern void __setSystemTime(unsigned long long sec, unsigned long us);
#define SNTP_SET_SYSTEM_TIME_US(sec, us) __setSystemTime(sec, us)
......
No preview for this file type
No preview for this file type
......@@ -50,6 +50,10 @@ bool CYW43::begin(const uint8_t* address, netif* netif) {
authmode = CYW43_AUTH_OPEN;
}
// Not currently possible to hook up igmp_mac_filter and mld_mac_filter
// TODO: implement igmp_mac_filter and mld_mac_filter
cyw43_set_allmulti(_self, true);
if (cyw43_arch_wifi_connect_timeout_ms(_ssid, _password, authmode, _timeout)) {
return false;
} else {
......
......@@ -32,7 +32,9 @@
#include <lwip/init.h>
#include <lwip/netif.h>
#include <lwip/etharp.h>
#include <lwip/ethip6.h>
#include <lwip/dhcp.h>
#include <lwip/dhcp6.h>
#include <lwip/dns.h>
#include <lwip/raw.h>
#include <lwip/icmp.h>
......@@ -366,6 +368,14 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
netif_set_up(&_netif);
}
#if LWIP_IPV6
netif_create_ip6_linklocal_address(&_netif, true);
#endif
#if LWIP_IPV6_DHCP6_STATELESS
err_t __res = dhcp6_enable_stateless(&_netif);
DEBUGV("LwipIntfDev: Enabled DHCP6 stateless: %d\n", __res);
#endif
_started = true;
if (_intrPin >= 0) {
......@@ -444,11 +454,19 @@ err_t LwipIntfDev<RawDev>::netif_init() {
_netif.chksum_flags = NETIF_CHECKSUM_ENABLE_ALL;
_netif.flags = NETIF_FLAG_ETHARP | NETIF_FLAG_IGMP | NETIF_FLAG_BROADCAST | NETIF_FLAG_LINK_UP;
#if LWIP_IPV6_MLD
_netif.flags |= NETIF_FLAG_MLD6;
#endif
// lwIP's doc: This function typically first resolves the hardware
// address, then sends the packet. For ethernet physical layer, this is
// usually lwIP's etharp_output()
_netif.output = etharp_output;
#if LWIP_IPV6
_netif.output_ip6 = ethip6_output;
#endif
// lwIP's doc: This function outputs the pbuf as-is on the link medium
// (this must points to the raw ethernet driver, meaning: us)
_netif.linkoutput = linkoutput_s;
......
Subproject commit 2e6142b15b8a75c1227dd3edbe839193b2bf9041
Subproject commit 453cae2399959361bbbb941fd52abe2452dcb16c
......@@ -53,6 +53,10 @@ extern void interrupts();
#define DHCP_DOES_ARP_CHECK 0
#define LWIP_DHCP_DOES_ACD_CHECK 0
#if LWIP_IPV6
#define LWIP_IPV6_DHCP6 1
#endif
// NTP
extern void __setSystemTime(unsigned long long sec, unsigned long us);
#define SNTP_SET_SYSTEM_TIME_US(sec, us) __setSystemTime(sec, us)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment