mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-25 20:28:27 +00:00
Fix unamalgamation for the rest of the drivers
This commit is contained in:
1 parent
4f5997a8b4
commit
9f4e6a25bd
37 files changed
+162
-18
No files matched your search
@@ -49,6 +49,8 @@
|
||||
#include "arch_armgcc.h"
|
||||
#include "arch_cube.h"
|
||||
#include "arch_esp32.h"
|
||||
#include "arch_mcuxpresso.h"
|
||||
#include "arch_picosdk.h"
|
||||
#include "arch_rtx.h"
|
||||
#include "arch_threadx.h"
|
||||
#include "arch_unix.h"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "sntp.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_ATCMD) && MG_ENABLE_DRIVER_ATCMD
|
||||
|
||||
|
||||
+3
-1
@@ -1,9 +1,11 @@
|
||||
// https://arm-software.github.io/CMSIS_5/Driver/html/index.html
|
||||
|
||||
#include "net_builtin.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_CMSIS) && MG_ENABLE_DRIVER_CMSIS
|
||||
|
||||
#include "cmsis.h"
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "queue.h"
|
||||
|
||||
extern ARM_DRIVER_ETH_MAC Driver_ETH_MAC0;
|
||||
|
||||
+7
-2
@@ -1,5 +1,8 @@
|
||||
#include "cyw.h"
|
||||
#include "net_builtin.h"
|
||||
#include "net.h"
|
||||
#include "printf.h"
|
||||
#include "util.h"
|
||||
#include <stddef.h>
|
||||
|
||||
#if MG_ENABLE_TCPIP && \
|
||||
((defined(MG_ENABLE_DRIVER_CYW) && MG_ENABLE_DRIVER_CYW) || \
|
||||
@@ -875,8 +878,10 @@ static void cyw_update_hash_table(void) {
|
||||
// TODO(): read database, rebuild hash table
|
||||
uint32_t val = 0;
|
||||
val = 1;
|
||||
uint8_t mac[sizeof(mcast_addr)]; // copy from const uint8_t* to uint8_t*
|
||||
memcpy(mac, mcast_addr, sizeof(mac));
|
||||
cyw_ioctl_iovar_set2_(0, "mcast_list", (uint8_t *) &val, sizeof(val),
|
||||
(uint8_t *) mcast_addr, sizeof(mcast_addr));
|
||||
mac, sizeof(mac));
|
||||
mg_delayms(50);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
((defined(MG_ENABLE_DRIVER_CYW) && MG_ENABLE_DRIVER_CYW) || \
|
||||
(defined(MG_ENABLE_DRIVER_CYW_SDIO) && MG_ENABLE_DRIVER_CYW_SDIO))
|
||||
|
||||
#include "wifi.h"
|
||||
|
||||
struct mg_tcpip_driver_cyw_firmware {
|
||||
const uint8_t *code_addr;
|
||||
size_t code_len;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "l2_mesh.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
#include "net_builtin.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_ESP32_802154) && \
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "phy.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && \
|
||||
(defined(MG_ENABLE_DRIVER_IMXRT10) && MG_ENABLE_DRIVER_IMXRT10) || \
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "l2_mesh.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
#include "net_builtin.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_MCXW71) && \
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "l2_mesh.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_MG24) && MG_ENABLE_DRIVER_MG24
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "phy.h"
|
||||
#include "util.h"
|
||||
|
||||
#if defined(MG_ENABLE_TCPIP) && MG_ENABLE_TCPIP && \
|
||||
defined(MG_ENABLE_DRIVER_NETC) && MG_ENABLE_DRIVER_NETC
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "l2_mesh.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_NRF52) && MG_ENABLE_DRIVER_NRF52
|
||||
#include <nrf.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include "net_builtin.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_NXP_WIFI) && \
|
||||
MG_ENABLE_DRIVER_NXP_WIFI
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
defined(MG_ENABLE_DRIVER_NXP_WIFI) && MG_ENABLE_DRIVER_NXP_WIFI
|
||||
|
||||
|
||||
#include "wifi.h"
|
||||
|
||||
struct mg_tcpip_driver_nxp_wifi_data {
|
||||
struct mg_wifi_data wifi;
|
||||
};
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#include "net_builtin.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && MG_ARCH == MG_ARCH_PICOSDK && \
|
||||
defined(MG_ENABLE_DRIVER_PICO_W) && MG_ENABLE_DRIVER_PICO_W
|
||||
|
||||
#include "drivers/pico-w.h"
|
||||
#include "net_builtin.h"
|
||||
#include "pico/stdlib.h"
|
||||
#include "printf.h"
|
||||
#include "util.h"
|
||||
|
||||
static struct mg_tcpip_if *s_ifp;
|
||||
static uint32_t s_ip, s_mask;
|
||||
@@ -68,8 +71,9 @@ static bool mg_tcpip_driver_pico_w_poll(struct mg_tcpip_if *ifp, bool s1) {
|
||||
}
|
||||
if (ifp->update_mac_hash_table) {
|
||||
// first call to _poll() is after _init(), so this is safe
|
||||
cyw43_wifi_update_multicast_filter(&cyw43_state, (uint8_t *) mcast_addr,
|
||||
true);
|
||||
uint8_t mac[sizeof(mcast_addr)]; // copy from const uint8_t* to uint8_t*
|
||||
memcpy(mac, mcast_addr, sizeof(mac));
|
||||
cyw43_wifi_update_multicast_filter(&cyw43_state, mac, true);
|
||||
ifp->update_mac_hash_table = false;
|
||||
}
|
||||
if (!s1) return false;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "pico/cyw43_arch.h" // keep this include
|
||||
#include "pico/unique_id.h" // keep this include
|
||||
|
||||
#include "wifi.h"
|
||||
|
||||
struct mg_tcpip_driver_pico_w_data {
|
||||
struct mg_wifi_data wifi;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "phy.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && \
|
||||
(defined(MG_ENABLE_DRIVER_RA6) && MG_ENABLE_DRIVER_RA6) || \
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "phy.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_RW612) && MG_ENABLE_DRIVER_RW612
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "l2_mesh.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_RW612W) && \
|
||||
MG_ENABLE_DRIVER_RW612W
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "phy.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_SAME54) && \
|
||||
MG_ENABLE_DRIVER_SAME54
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "log.h"
|
||||
#include "sdio.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && \
|
||||
(defined(MG_ENABLE_DRIVER_CYW_SDIO) && MG_ENABLE_DRIVER_CYW_SDIO)
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#include "st67w6.h"
|
||||
#include "net_builtin.h"
|
||||
#include "net.h"
|
||||
#include "printf.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_ST67W6) && \
|
||||
MG_ENABLE_DRIVER_ST67W6
|
||||
|
||||
bool mg_to_size_t(struct mg_str str, size_t *val);
|
||||
|
||||
static struct mg_tcpip_if *s_ifp;
|
||||
static uint32_t s_ip, s_mask;
|
||||
static bool s_link = false, s_connecting = false;
|
||||
@@ -344,7 +348,6 @@ static bool st67w6_at_cmd(char *cmd, size_t len) {
|
||||
}
|
||||
|
||||
static bool st67w6_spi_init(void);
|
||||
bool mg_to_size_t(struct mg_str str, size_t *val);
|
||||
|
||||
static bool st67w6_init(uint8_t *mac) {
|
||||
// struct mg_tcpip_driver_st67w6_data *d = (struct
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_ST67W6) && \
|
||||
MG_ENABLE_DRIVER_ST67W6
|
||||
|
||||
#include "wifi.h"
|
||||
|
||||
struct mg_tcpip_driver_st67w6_data {
|
||||
struct mg_wifi_data wifi;
|
||||
void *spi;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_TM4C) && MG_ENABLE_DRIVER_TM4C
|
||||
struct tm4c_emac {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "phy.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_TMS570) && MG_ENABLE_DRIVER_TMS570
|
||||
struct tms570_emac_ctrl {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "phy.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC) && MG_ENABLE_DRIVER_XMC
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "net_builtin.h"
|
||||
#include "log.h"
|
||||
#include "phy.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC7) && MG_ENABLE_DRIVER_XMC7
|
||||
|
||||
|
||||
+2
-2
@@ -242,7 +242,7 @@ uint8_t mg_l2_ip6put(enum mg_l2type type, uint8_t *addr, uint8_t *opts);
|
||||
#endif
|
||||
bool mg_l2_poll(struct mg_tcpip_if *ifp, bool expired_1000ms);
|
||||
|
||||
static void mg_tcpip_call(struct mg_tcpip_if *ifp, int ev, void *ev_data) {
|
||||
void mg_tcpip_call(struct mg_tcpip_if *ifp, int ev, void *ev_data) {
|
||||
#if 0 && MG_ENABLE_PROFILE
|
||||
const char *names[] = {"TCPIP_EV_STATE_CHANGE", "TCPIP_EV_DHCP_DNS",
|
||||
"TCPIP_EV_DHCP_SNTP", "TCPIP_EV_ARP",
|
||||
@@ -2535,7 +2535,7 @@ bool mg_send(struct mg_connection *c, const void *buf, size_t len) {
|
||||
return res;
|
||||
}
|
||||
|
||||
uint8_t mcast_addr[6] = {0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb};
|
||||
const uint8_t mcast_addr[6] = {0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb};
|
||||
void mg_multicast_add(struct mg_connection *c, char *ip) {
|
||||
(void) ip; // ip4/6_mcastmac(mcast_mac, &ip); ipv6 param
|
||||
// TODO(): actual IP -> MAC; check database, update
|
||||
|
||||
+4
-1
@@ -128,11 +128,14 @@ void mg_tcpip_free(struct mg_tcpip_if *);
|
||||
// the queue is full.
|
||||
void mg_tcpip_qwrite(void *buf, size_t len, struct mg_tcpip_if *ifp);
|
||||
|
||||
// Delivers an interface event to the protocol and user handlers
|
||||
void mg_tcpip_call(struct mg_tcpip_if *ifp, int ev, void *ev_data);
|
||||
|
||||
// Sends a broadcast ARP who-has request for ip. mac may be NULL for a plain
|
||||
// broadcast, or a non-NULL hint to set the target MAC field in the request.
|
||||
void mg_tcpip_arp_request(struct mg_tcpip_if *ifp, uint32_t ip, uint8_t *mac);
|
||||
|
||||
extern uint8_t mcast_addr[6]; // Multicast MAC address programmed by drivers
|
||||
extern const uint8_t mcast_addr[6]; // Multicast MAC address programmed by drivers
|
||||
|
||||
// Built-in hardware drivers. Assign one to mg_tcpip_if.driver before calling
|
||||
// mg_tcpip_init(). See the matching driver header for configuration and
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "flash.h"
|
||||
#include "log.h"
|
||||
#include "ota.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_OTA == MG_OTA_CH32V307
|
||||
// RM: https://www.wch-ic.com/downloads/CH32FV2x_V3xRM_PDF.html
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "arch.h"
|
||||
#include "log.h"
|
||||
#include "ota.h"
|
||||
|
||||
#if MG_ARCH == MG_ARCH_ESP32 && MG_OTA == MG_OTA_ESP32
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "flash.h"
|
||||
#include "log.h"
|
||||
#include "ota.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_OTA >= MG_OTA_RT1020 && MG_OTA <= MG_OTA_RT1180
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "flash.h"
|
||||
#include "log.h"
|
||||
#include "ota.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_OTA == MG_OTA_MCXN
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "flash.h"
|
||||
#include "log.h"
|
||||
#include "ota.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_OTA == MG_OTA_MCXW71
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "flash.h"
|
||||
#include "log.h"
|
||||
#include "ota.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_OTA == MG_OTA_PICOSDK
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "flash.h"
|
||||
#include "log.h"
|
||||
#include "ota.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_OTA == MG_OTA_RW612
|
||||
|
||||
|
||||
Reference in new issue
Block a user