From 5efd942396a47092a33176b0d1ae3d6f21e44eef Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Tue, 4 Jul 2017 10:56:54 +0900 Subject: [PATCH 01/21] FS: Remove DEBUGASSERT() in block_proxy() because the flags are cleared later. --- fs/driver/fs_blockproxy.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/driver/fs_blockproxy.c b/fs/driver/fs_blockproxy.c index b03aa4f95eb..d08f497f736 100644 --- a/fs/driver/fs_blockproxy.c +++ b/fs/driver/fs_blockproxy.c @@ -167,7 +167,6 @@ int block_proxy(FAR const char *blkdev, int oflags) int fd; DEBUGASSERT(blkdev); - DEBUGASSERT((oflags & (O_CREAT | O_EXCL | O_APPEND | O_TRUNC)) == 0); /* Create a unique temporary file name for the character device */ From b297066eb9cfac50c45312e4e87862274235a889 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 5 Jul 2017 15:12:29 -0600 Subject: [PATCH 02/21] IP Forwarding: Add IPv4 packet forwarding logic. Initial commit is an untested clone of the IPv6 forwarding logic with a few minor logic changes for IPv4. --- net/devif/Make.defs | 3 + net/devif/devif.h | 33 +++ net/devif/ip_forward.h | 1 + net/devif/ipv4_forward.c | 553 ++++++++++++++++++++++++++++++++++++ net/devif/ipv4_input.c | 94 ++++-- net/devif/ipv6_forward.c | 18 +- net/icmpv6/icmpv6_forward.c | 2 +- net/tcp/tcp_forward.c | 8 +- net/udp/udp_forward.c | 4 +- 9 files changed, 668 insertions(+), 48 deletions(-) create mode 100644 net/devif/ipv4_forward.c diff --git a/net/devif/Make.defs b/net/devif/Make.defs index 4dcce7379b6..6520b8430ce 100644 --- a/net/devif/Make.defs +++ b/net/devif/Make.defs @@ -42,6 +42,9 @@ NET_CSRCS += devif_callback.c ifeq ($(CONFIG_NET_IPv4),y) NET_CSRCS += ipv4_input.c +ifeq ($(CONFIG_NET_IPFORWARD),y) +NET_CSRCS += ipv4_forward.c +endif endif ifeq ($(CONFIG_NET_IPv6),y) diff --git a/net/devif/devif.h b/net/devif/devif.h index 78fcce32e59..efacd007140 100644 --- a/net/devif/devif.h +++ b/net/devif/devif.h @@ -425,6 +425,39 @@ uint16_t devif_conn_event(FAR struct net_driver_s *dev, FAR void *pvconn, uint16_t devif_dev_event(FAR struct net_driver_s *dev, void *pvconn, uint16_t flags); +/**************************************************************************** + * Name: ipv4_forward + * + * Description: + * This function is called from ipv4_input when a packet is received that + * is not destined for us. In this case, the packet may need to be + * forwarded to another device (or sent back out the same device) + * depending configuration, routing table information, and the IPv4 + * networks served by various network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv4_input. + * - ipv4 points to the IPv4 header with dev->d_buf. + * + * Returned Value: + * Zero is returned if the packet was successfully forward; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv4_input()) should drop the packet. + * + ****************************************************************************/ + +#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv4) +int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4); +#endif + /**************************************************************************** * Name: ipv6_forward * diff --git a/net/devif/ip_forward.h b/net/devif/ip_forward.h index c8cd65e4deb..f7b88b4e2e2 100644 --- a/net/devif/ip_forward.h +++ b/net/devif/ip_forward.h @@ -47,6 +47,7 @@ #include #include #include +#include #include #include "udp/udp.h" diff --git a/net/devif/ipv4_forward.c b/net/devif/ipv4_forward.c new file mode 100644 index 00000000000..ef8e8f971f0 --- /dev/null +++ b/net/devif/ipv4_forward.c @@ -0,0 +1,553 @@ +/**************************************************************************** + * net/devif/ipv4_forward.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "netdev/netdev.h" +#include "sixlowpan/sixlowpan.h" +#include "udp/udp.h" +#include "tcp/tcp.h" +#include "icmp/icmp.h" +#include "devif/ip_forward.h" +#include "devif/devif.h" + +#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv4) + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ipv4_hdrsize + * + * Description: + * Return the size of the IPv4 header and the following. + * + * Input Parameters: + * ipv4 - A pointer to the IPv4 header in within the IPv4 packet. This + * is immeidately followed by the L3 header which may be TCP, UDP + * or ICMP. + * + * Returned Value: + * The size of the combined L2 + L3 headers is returned on success. An + * error is returned only if the prototype is not supported. + * + ****************************************************************************/ + +#ifdef CONFIG_NETDEV_MULTINIC +static int ipv4_hdrsize(FAR struct ipv4_hdr_s *ipv4) +{ + /* Size is determined by the following protocol header, */ + + switch (ipv4->proto) + { +#ifdef CONFIG_NET_TCP + case IP_PROTO_TCP: + { + FAR struct tcp_hdr_s *tcp = + (FAR struct tcp_hdr_s *)((FAR uintptr_t *)ipv4 + IPv4_HDRLEN); + unsigned int tcpsize; + + /* The TCP header length is encoded in the top 4 bits of the + * tcpoffset field (in units of 32-bit words). + */ + + tcpsize = ((uint16_t)tcp->tcpoffset >> 4) << 2; + return IPv4_HDRLEN + tcpsize; + } + break; +#endif + +#ifdef CONFIG_NET_UDP + case IP_PROTO_UDP: + return IPv4_HDRLEN + UDP_HDRLEN; + break; +#endif + +#ifdef CONFIG_NET_ICMP + case IP_PROTO_ICMP: + return IPv4_HDRLEN + ICMP_HDRLEN; + break; +#endif + + default: + nwarn("WARNING: Unrecognized proto: %u\n", ipv4->proto); + return -EPROTONOSUPPORT; + } +} +#endif + +/**************************************************************************** + * Name: ipv4_dev_forward + * + * Description: + * This function is called from ipv4_forward when it is necessary to + * forward a packet from the current device to different device. In this + * case, the forwarding operation must be performed asynchronously when + * the TX poll is received from the forwarding device. + * + * Input Parameters: + * dev - The device on which the packet was received and which + * contains the IPv4 packet. + * fwdddev - The device on which the packet must be forwarded. + * ipv4 - A pointer to the IPv4 header in within the IPv4 packet + * + * Returned Value: + * Zero is returned if the packet was successfully forward; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv4_input()) should drop the packet. + * + ****************************************************************************/ + +#ifdef CONFIG_NETDEV_MULTINIC +static int ipv4_dev_forward(FAR struct net_driver_s *dev, + FAR struct net_driver_s *fwddev, + FAR struct ipv4_hdr_s *ipv4) +{ + FAR struct forward_s *fwd = NULL; + FAR uint8_t *payload; + unsigned int paysize; + int hdrsize; + int ret; + + /* Verify that the full packet will fit within the forwarding devices MTU. + * We provide no support for fragmenting forwarded packets. + */ + + if (NET_LL_HDRLEN(fwddev) + dev->d_len > NET_DEV_MTU(fwddev)) + { + nwarn("WARNING: Packet > MTU... Dropping\n"); + ret = -EFBIG; + goto errout; + } + + /* Get a pre-allocated forwarding structure, This structure will be + * completely zeroed when we receive it. + */ + + fwd = ip_forward_alloc(); + if (fwd == NULL) + { + nwarn("WARNING: Failed to allocate forwarding structure\n"); + ret = -ENOMEM; + goto errout; + } + + /* Initialize the easy stuff in the forwarding structure */ + + fwd->f_dev = fwddev; /* Forwarding device */ + + /* Get the size of the IPv4 + L3 header. Use this to determine start of + * the data payload. + * + * Remember that the size of the L1 header has already been subtracted + * from dev->d_len. + * + * REVISIT: Consider an alternative design that does not require data + * copying. This would require a pool of d_buf's that are managed by + * the network rather than the network device. + */ + + hdrsize = ipv4_hdrsize(ipv4); + if (hdrsize < IPv4_HDRLEN) + { + nwarn("WARNING: Could not determine L2+L3 header size\n"); + ret = -EPROTONOSUPPORT; + goto errout_with_fwd; + } + + /* Save the entire L2 and L3 headers in the state structure */ + + if (hdrsize > sizeof(union fwd_iphdr_u)) + { + nwarn("WARNING: Header is too big for pre-allocated structure\n"); + ret = -E2BIG; + goto errout_with_fwd; + } + + memcpy(&fwd->f_hdr, ipv4, hdrsize); + fwd->f_hdrsize = hdrsize; + + /* Use the L2 + L3 header size to determine start and size of the data + * payload. + * + * Remember that the size of the L1 header has already been subtracted + * from dev->d_len. + */ + + payload = (FAR uint8_t *)ipv4 + hdrsize; + paysize = dev->d_len - hdrsize; + + /* If there is a payload, then copy it into an IOB chain. + * + * REVISIT: Consider an alternative design that does not require data + * copying. This would require a pool of d_buf's that are managed by + * the network rather than the network device. + */ + + if (paysize > 0) + { + /* Try to allocate the head of an IOB chain. If this fails, the + * packet will be dropped; we are not operating in a context + * where waiting for an IOB is a good idea + */ + + fwd->f_iob = iob_tryalloc(false); + if (fwd->f_iob == NULL) + { + nwarn("WARNING: iob_tryalloc() failed\n"); + ret = -ENOMEM; + goto errout_with_fwd; + } + + /* Copy the packet data payload into an IOB chain. iob_trycopin() will + * not wait, but will fail there are no available IOBs. + */ + + ret = iob_trycopyin(fwd->f_iob, payload, paysize, 0, false); + if (ret < 0) + { + nwarn("WARNING: iob_trycopyin() failed: %d\n", ret); + goto errout_with_iobchain; + } + } + + /* Then set up to forward the packet according to the protocol. + * + * REVISIT: Are these protocol specific forwarders necessary? I think + * that this could be done with a single forwarding function for all + * protocols. + */ + + switch (ipv4->proto) + { +#ifdef CONFIG_NET_TCP + case IP_PROTO_TCP: + { + /* Forward a TCP packet. */ + + ret = tcp_forward(fwd); + } + break; +#endif + +#ifdef CONFIG_NET_UDP + case IP_PROTO_UDP: + { + /* Forward a UDP packet */ + + ret = udp_forward(fwd); + } + break; +#endif + + case IP_PROTO_ICMP: /* Not yet supported */ + default: + nwarn("WARNING: Unrecognized proto: %u\n", ipv4->proto); + ret = -EPROTONOSUPPORT; + break; + } + + if (ret >= 0) + { + dev->d_len = 0; + return OK; + } + +errout_with_iobchain: + if (fwd != NULL && fwd->f_iob != NULL) + { + iob_free_chain(fwd->f_iob); + } + +errout_with_fwd: + if (fwd != NULL) + { + ip_forward_free(fwd); + } + +errout: + return ret; +} +#endif /* CONFIG_NETDEV_MULTINIC */ + +/**************************************************************************** + * Name: ipv4_decr_ttl + * + * Description: + * Decrement the IPv4 TTL (time to live value). TTL field is set by the + * sender of the packet and reduced by every router on the route to its + * destination. If the TTL field reaches zero before the datagram arrives + * at its destination, then the datagram is discarded and an ICMP error + * packet (11 - Time Exceeded) is sent back to the sender. + * + * The purpose of the TTL field is to avoid a situation in which an + * undeliverable datagram keeps circulating on an Internet system, and + * such a system eventually becoming swamped by such "immortals". + * + * Input Parameters: + * ipv4 - A pointer to the IPv4 header in within the IPv4 packet to be + * forwarded. + * + * Returned Value: + * The new TTL value is returned. A value <= 0 means the hop limit has + * expired. + * + ****************************************************************************/ + +static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4) +{ + int ttl = (int)ipv4->ttl - 1; + + if (ttl <= 0) + { +#ifdef CONFIG_NET_ICMP + /* Return an ICMP error packet back to the sender. */ +#warning Missing logic +#endif + + /* Return zero which must cause the packet to be dropped */ + + return 0; + } + + /* Save the updated TTL value */ + + ipv4->ttl = ttl; + + /* NOTE: We do not have to recalculate the IPv4 checksum because (1) the + * IPv4 header does not include a checksum itself and (2) the TTL is not + * included in the sum for the TCP and UDP headers. + */ + + return ttl; +} + +/**************************************************************************** + * Name: ipv4_dropstats + * + * Description: + * Update statistics for a dropped packet. + * + * Input Parameters: + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet to be dropped. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_STATISTICS +static void ipv4_dropstats(FAR struct ipv4_hdr_s *ipv4) +{ + switch (ipv4->proto) + { +#ifdef CONFIG_NET_TCP + case IP_PROTO_TCP: + g_netstats.tcp.drop++; + break; +#endif + +#ifdef CONFIG_NET_UDP + case IP_PROTO_UDP: + g_netstats.udp.drop++; + break; +#endif + +#ifdef CONFIG_NET_ICMP + case IP_PROTO_ICMP: + g_netstats.icmp.drop++; + break; +#endif + + default: + break; + } + + g_netstats.ipv4.drop++; +} +#else +# define ipv4_dropstats(ipv4) +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ipv4_forward + * + * Description: + * This function is called from ipv4_input when a packet is received that + * is not destined for us. In this case, the packet may need to be + * forwarded to another device (or sent back out the same device) + * depending configuration, routing table information, and the IPv4 + * networks served by various network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv4_input. + * - ipv4 points to the IPv4 header with dev->d_buf. + * + * Returned Value: + * Zero is returned if the packet was successfully forward; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv4_input()) should drop the packet. + * + ****************************************************************************/ + +int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4) +{ + in_addr_t destipaddr; +#ifdef CONFIG_NETDEV_MULTINIC + in_addr_t srcipaddr; +#endif + FAR struct net_driver_s *fwddev; + int ret; + + /* Decrement the TTL. If it decrements to zero, then drop the packet */ + + ret = ipv4_decr_ttl(ipv4); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + goto drop; + } + + /* Re-calculate the IPv4 checksum. This checksum is the Internet checksum + * of the 20 bytes of the IPv4 header. This checksum will be different + * because we just modify the IPv4 TTL. + */ + + ipv4->ipchksum = 0; + ipv4->ipchksum = ~ipv4_chksum(dev); + + /* Search for a device that can forward this packet. This is a trivial + * search if there is only a single network device (CONFIG_NETDEV_MULTINIC + * not defined). But netdev_findby_ipv4addr() will still assure + * routability in that case. + */ + + destipaddr = net_ip4addr_conv32(ipv4->destipaddr); +#ifdef CONFIG_NETDEV_MULTINIC + srcipaddr = net_ip4addr_conv32(ipv4->srcipaddr); + + fwddev = netdev_findby_ipv4addr(srcipaddr, destipaddr); +#else + fwddev = netdev_findby_ipv4addr(destipaddr); +#endif + if (fwddev == NULL) + { + nwarn("WARNING: Not routable\n"); + return (ssize_t)-ENETUNREACH; + } + +#if defined(CONFIG_NETDEV_MULTINIC) + /* Check if we are forwarding on the same device that we received the + * packet from. + */ + + if (fwddev != dev) + { + /* Send the packet asynchrously on the forwarding device. */ + + ret = ipv4_dev_forward(dev, fwddev, ipv4); + if (ret < 0) + { + nwarn("WARNING: ipv4_dev_forward faield: %d\n", ret); + goto drop; + } + } + else +#endif /* CONFIG_NETDEV_MULTINIC */ + + { + /* Single network device. The use case here is where an endpoint acts + * as a hub in a star configuration. This is typical for a wireless star + * configuration where not all endpoints are accessible from all other + * endpoints, but seems less useful for a wired network. + */ + +#ifdef CONFIG_NET_ETHERNET + /* REVISIT: For Ethernet we may have to fix up the Ethernet header: + * - source MAC, the MAC of the current device. + * - dest MAC, the MAC associated with the destination IPv4 adress. + * This will involve ICMP. + */ + + /* Correct dev->d_buf by adding back the L1 header length */ +#endif + + nwarn("WARNING: Packet forwarding to same device not supportedN\n"); + ret = -ENOSYS; + goto drop; + } + + /* Return success. ipv4_input will return to the network driver with + * dev->d_len set to the packet size and the network driver will perform + * the transfer. + */ + + return OK; + +drop: + ipv4_dropstats(ipv4); + dev->d_len = 0; + return ret; +} + +#endif /* CONFIG_NET_IPFORWARD && CONFIG_NET_IPv4 */ diff --git a/net/devif/ipv4_input.c b/net/devif/ipv4_input.c index 2920aeba3b0..c2f9fcb2ca6 100644 --- a/net/devif/ipv4_input.c +++ b/net/devif/ipv4_input.c @@ -152,8 +152,8 @@ static uint8_t g_reassembly_flags; #if defined(CONFIG_NET_TCP_REASSEMBLY) && !defined(CONFIG_NET_IPv6) static uint8_t devif_reassembly(void) { - FAR struct ipv4_hdr_s *pbuf = BUF; - FAR struct ipv4_hdr_s *pfbuf = FBUF; + FAR struct ipv4_hdr_s *ipv4 = BUF; + FAR struct ipv4_hdr_s *fipv4 = FBUF; uint16_t offset; uint16_t len; uint16_t i; @@ -165,7 +165,7 @@ static uint8_t devif_reassembly(void) if (!g_reassembly_timer) { - memcpy(g_reassembly_buffer, &pbuf->vhl, IPv4_HDRLEN); + memcpy(g_reassembly_buffer, &ipv4->vhl, IPv4_HDRLEN); g_reassembly_timer = CONFIG_NET_TCP_REASS_MAXAGE; g_reassembly_flags = 0; @@ -179,12 +179,12 @@ static uint8_t devif_reassembly(void) * fragment into the buffer. */ - if (net_ipv4addr_hdrcmp(pbuf->srcipaddr, pfbuf->srcipaddr) && - net_ipv4addr_hdrcmp(pbuf->destipaddr, pfbuf->destipaddr) && - pbuf->g_ipid[0] == pfbuf->g_ipid[0] && pbuf->g_ipid[1] == pfbuf->g_ipid[1]) + if (net_ipv4addr_hdrcmp(ipv4->srcipaddr, fipv4->srcipaddr) && + net_ipv4addr_hdrcmp(ipv4->destipaddr, fipv4->destipaddr) && + ipv4->g_ipid[0] == fipv4->g_ipid[0] && ipv4->g_ipid[1] == fipv4->g_ipid[1]) { - len = (pbuf->len[0] << 8) + pbuf->len[1] - (pbuf->vhl & 0x0f) * 4; - offset = (((pbuf->ipoffset[0] & 0x3f) << 8) + pbuf->ipoffset[1]) * 8; + len = (ipv4->len[0] << 8) + ipv4->len[1] - (ipv4->vhl & 0x0f) * 4; + offset = (((ipv4->ipoffset[0] & 0x3f) << 8) + ipv4->ipoffset[1]) * 8; /* If the offset or the offset + fragment length overflows the * reassembly buffer, we discard the entire packet. @@ -198,7 +198,8 @@ static uint8_t devif_reassembly(void) /* Copy the fragment into the reassembly buffer, at the right offset. */ - memcpy(&g_reassembly_buffer[IPv4_HDRLEN + offset], (char *)pbuf + (int)((pbuf->vhl & 0x0f) * 4), len); + memcpy(&g_reassembly_buffer[IPv4_HDRLEN + offset], + (FAR char *)ipv4 + (int)((ipv4->vhl & 0x0f) * 4), len); /* Update the bitmap. */ @@ -235,7 +236,7 @@ static uint8_t devif_reassembly(void) * we have received the final fragment. */ - if ((pbuf->ipoffset[0] & IP_MF) == 0) + if ((ipv4->ipoffset[0] & IP_MF) == 0) { g_reassembly_flags |= TCP_REASS_LASTFRAG; g_reassembly_len = offset + len; @@ -271,22 +272,22 @@ static uint8_t devif_reassembly(void) } /* If we have come this far, we have a full packet in the buffer, - * so we allocate a pbuf and copy the packet into it. We also reset + * so we allocate a ipv4 and copy the packet into it. We also reset * the timer. */ g_reassembly_timer = 0; - memcpy(pbuf, pfbuf, g_reassembly_len); + memcpy(ipv4, fipv4, g_reassembly_len); /* Pretend to be a "normal" (i.e., not fragmented) IP packet from * now on. */ - pbuf->ipoffset[0] = pbuf->ipoffset[1] = 0; - pbuf->len[0] = g_reassembly_len >> 8; - pbuf->len[1] = g_reassembly_len & 0xff; - pbuf->ipchksum = 0; - pbuf->ipchksum = ~(ipv4_chksum(dev)); + ipv4->ipoffset[0] = ipv4->ipoffset[1] = 0; + ipv4->len[0] = g_reassembly_len >> 8; + ipv4->len[1] = g_reassembly_len & 0xff; + ipv4->ipchksum = 0; + ipv4->ipchksum = ~(ipv4_chksum(dev)); return g_reassembly_len; } @@ -316,7 +317,7 @@ nullreturn: int ipv4_input(FAR struct net_driver_s *dev) { - FAR struct ipv4_hdr_s *pbuf = BUF; + FAR struct ipv4_hdr_s *ipv4 = BUF; uint16_t hdrlen; uint16_t iplen; @@ -329,7 +330,7 @@ int ipv4_input(FAR struct net_driver_s *dev) /* Start of IP input header processing code. */ /* Check validity of the IP header. */ - if (pbuf->vhl != 0x45) + if (ipv4->vhl != 0x45) { /* IP version and header length. */ @@ -338,7 +339,7 @@ int ipv4_input(FAR struct net_driver_s *dev) g_netstats.ipv4.vhlerr++; #endif nwarn("WARNING: Invalid IP version or header length: %02x\n", - pbuf->vhl); + ipv4->vhl); goto drop; } @@ -360,7 +361,7 @@ int ipv4_input(FAR struct net_driver_s *dev) * we set d_len to the correct value. */ - iplen = (pbuf->len[0] << 8) + pbuf->len[1]; + iplen = (ipv4->len[0] << 8) + ipv4->len[1]; if (iplen <= dev->d_len) { dev->d_len = iplen; @@ -373,7 +374,7 @@ int ipv4_input(FAR struct net_driver_s *dev) /* Check the fragment flag. */ - if ((pbuf->ipoffset[0] & 0x3f) != 0 || pbuf->ipoffset[1] != 0) + if ((ipv4->ipoffset[0] & 0x3f) != 0 || ipv4->ipoffset[1] != 0) { #if defined(CONFIG_NET_TCP_REASSEMBLY) dev->d_len = devif_reassembly(); @@ -398,8 +399,8 @@ int ipv4_input(FAR struct net_driver_s *dev) * negotiating over DHCP for an address). */ - if (pbuf->proto == IP_PROTO_UDP && - net_ipv4addr_cmp(net_ip4addr_conv32(pbuf->destipaddr), + if (ipv4->proto == IP_PROTO_UDP && + net_ipv4addr_cmp(net_ip4addr_conv32(ipv4->destipaddr), INADDR_BROADCAST)) { return udp_ipv4_input(dev); @@ -416,23 +417,54 @@ int ipv4_input(FAR struct net_driver_s *dev) goto drop; } - /* Check if the packet is destined for out IP address */ + /* Check if the packet is destined for our IP address */ else #endif { /* Check if the packet is destined for our IP address. */ - if (!net_ipv4addr_cmp(net_ip4addr_conv32(pbuf->destipaddr), dev->d_ipaddr)) + if (!net_ipv4addr_cmp(net_ip4addr_conv32(ipv4->destipaddr), + dev->d_ipaddr)) { + /* Check for an IPv4 IGMP group address */ + #ifdef CONFIG_NET_IGMP - in_addr_t destip = net_ip4addr_conv32(pbuf->destipaddr); + in_addr_t destip = net_ip4addr_conv32(ipv4->destipaddr); if (igmp_grpfind(dev, &destip) == NULL) #endif { -#ifdef CONFIG_NET_STATISTICS - g_netstats.ipv4.drop++; + /* No.. The packet is not destined for us. */ + +#ifdef CONFIG_NET_IPFORWARD + /* Try to forward the packet */ + + int ret = ipv4_forward(dev, ipv4); + if (ret >= 0) + { + /* The packet was forwarded. Return success; d_len will + * be set appropriately by the forwarding logic: Cleared + * if the packet is forward via anoother device or non- + * zero if it will be forwarded by the same device that + * it was received on. + */ + + return OK; + } + else #endif - goto drop; + { + /* Not destined for us and not forwardable... Drop the + * packet. + */ + + nwarn("WARNING: Not destined for us; not forwardable... " + "Dropping!\n"); + +#ifdef CONFIG_NET_STATISTICS + g_netstats.ipv4.drop++; +#endif + goto drop; + } } } } @@ -457,7 +489,7 @@ int ipv4_input(FAR struct net_driver_s *dev) /* Now process the incoming packet according to the protocol. */ - switch (pbuf->proto) + switch (ipv4->proto) { #ifdef NET_TCP_HAVE_STACK case IP_PROTO_TCP: /* TCP input */ diff --git a/net/devif/ipv6_forward.c b/net/devif/ipv6_forward.c index fa2ec6f77ef..222099e5a7e 100644 --- a/net/devif/ipv6_forward.c +++ b/net/devif/ipv6_forward.c @@ -303,7 +303,7 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev, if (paysize > 0) { /* Try to allocate the head of an IOB chain. If this fails, - * the the packet will be dropped; we are not operating in a + * the packet will be dropped; we are not operating in a * context where waiting for an IOB is a good idea */ @@ -382,15 +382,15 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev, errout_with_iobchain: if (fwd != NULL && fwd->f_iob != NULL) - { - iob_free_chain(fwd->f_iob); - } + { + iob_free_chain(fwd->f_iob); + } errout_with_fwd: if (fwd != NULL) - { - ip_forward_free(fwd); - } + { + ip_forward_free(fwd); + } errout: return ret; @@ -532,8 +532,6 @@ static void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6) int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) { - /* Multiple network devices */ - FAR struct net_driver_s *fwddev; int ret; @@ -548,7 +546,7 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) } /* Search for a device that can forward this packet. This is a trivial - * serch if there is only a single network device (CONFIG_NETDEV_MULTINIC + * search if there is only a single network device (CONFIG_NETDEV_MULTINIC * not defined). But netdev_findby_ipv6addr() will still assure * routability in that case. */ diff --git a/net/icmpv6/icmpv6_forward.c b/net/icmpv6/icmpv6_forward.c index 74e882e09bf..4004c3805df 100644 --- a/net/icmpv6/icmpv6_forward.c +++ b/net/icmpv6/icmpv6_forward.c @@ -107,7 +107,7 @@ static inline bool icmpv6_forward_addrchck(FAR struct forward_s *fwd) #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 - if (conn->domain == PF_INET) + if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) #endif { #if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) diff --git a/net/tcp/tcp_forward.c b/net/tcp/tcp_forward.c index b2e9b1de07d..c67cac7a6e7 100644 --- a/net/tcp/tcp_forward.c +++ b/net/tcp/tcp_forward.c @@ -93,14 +93,14 @@ static inline void forward_ipselect(FAR struct forward_s *fwd) { /* Select the IPv4 domain */ - tcp_ipv4_select(dev); + tcp_ipv4_select(fwd->f_dev); } else /* if (conn->domain == PF_INET6) */ { /* Select the IPv6 domain */ - DEBUGASSERT(conn->domain == PF_INET6); - tcp_ipv6_select(dev); + DEBUGASSERT(fwd->f_conn.tcp.domain == PF_INET6); + tcp_ipv6_select(fwd->f_dev); } } #endif @@ -306,7 +306,7 @@ static uint16_t tcp_forward_interrupt(FAR struct net_driver_s *dev, * place and we need do nothing. */ - forward_ipselect(dev, fwd); + forward_ipselect(fwd); #endif /* Copy the user data into d_appdata and send it. */ diff --git a/net/udp/udp_forward.c b/net/udp/udp_forward.c index fdba5b5c4a2..b2c1363ab05 100644 --- a/net/udp/udp_forward.c +++ b/net/udp/udp_forward.c @@ -143,7 +143,7 @@ static inline bool udp_forward_addrchk(FAR struct forward_s *fwd) #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 - if (conn->domain == PF_INET) + if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) #endif { #if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) @@ -288,7 +288,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, * place and we need do nothing. */ - forward_ipselect(dev, fwd); + forward_ipselect(fwd); #endif /* Copy the user data into d_appdata and send it. */ From 24e9647156caf0b9545495a34f16412be7aa0e7e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 5 Jul 2017 16:35:14 -0600 Subject: [PATCH 03/21] net/Kconfig: IP forwarding no long depends on only IPv6. Also update Kconfig comments. --- net/Kconfig | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/net/Kconfig b/net/Kconfig index 6a1ce6ab111..0a0d9830b6d 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -288,24 +288,18 @@ source "net/sixlowpan/Kconfig" config NET_IPFORWARD bool "Enable L2 forwarding" default n - depends on NET_IPv6 ---help--- - Enable forwarding of IPv6 packets. Packets received with IPv6 - addresses which are not supported by this platform will be forwarded - to the appropriate network device. Routing table support may be - required. - - NOTE: L2 forwarding only supported for IPv6. There is no technical - reason why IPv4 forwarding has not been implemented, it just has - not yet been done. + Enable forwarding of packets. Packets received with IP addresses + that are not supported by this platform will be forwarded to the + appropriate network device. Routing table support may be required. config NET_IPFORWARD_NSTRUCT int "Number of pre-allocated forwarding structures" default 4 depends on NET_IPFORWARD && CONFIG_NETDEV_MULTINIC ---help--- - When packets are forward from on device to another, a structure must - be allocated to hold the state of forwarding across several + When packets are forwarded from on device to another, a structure + must be allocated to hold the state of forwarding across several asynchronous events. Those structures are pre-allocated for minimal, deterministic performance and to prevent hogging of memory (of course, that means that this value must be carefully selected @@ -314,7 +308,8 @@ config NET_IPFORWARD_NSTRUCT NOTE: This setting effectively puts a maximum on the number of packets that may be waiting to be forwarded from one network device - to another. + to another. CONFIG_IOB_NBUFFERS also limits the forward because the + payload of the packet (up to the MSS) is retain in IOBs. endmenu # Internet Protocol Selection From 04716a65a57334a6a063e1167da55106a0415545 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 07:26:01 -0600 Subject: [PATCH 04/21] IP forwading: Add optional support to forward broadcast and multicast packets. --- net/Kconfig | 10 +- net/devif/devif.h | 60 -------- net/devif/ip_forward.h | 134 ++++++++++++++++- net/devif/ipv4_forward.c | 301 ++++++++++++++++++++++++++------------- net/devif/ipv4_input.c | 16 ++- net/devif/ipv6_forward.c | 279 ++++++++++++++++++++++++------------ net/devif/ipv6_input.c | 11 ++ 7 files changed, 563 insertions(+), 248 deletions(-) diff --git a/net/Kconfig b/net/Kconfig index 0a0d9830b6d..663e159aeaa 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -293,10 +293,18 @@ config NET_IPFORWARD that are not supported by this platform will be forwarded to the appropriate network device. Routing table support may be required. +config NET_IPFORWARD_BROADCAST + bool "Forward broadcast/multicast packets" + default n + depends on NET_IPFORWARD && NETDEV_MULTINIC + ---help--- + If selected, broadcast packets received on one network device will + be forwarded though other network devices. + config NET_IPFORWARD_NSTRUCT int "Number of pre-allocated forwarding structures" default 4 - depends on NET_IPFORWARD && CONFIG_NETDEV_MULTINIC + depends on NET_IPFORWARD && NETDEV_MULTINIC ---help--- When packets are forwarded from on device to another, a structure must be allocated to hold the state of forwarding across several diff --git a/net/devif/devif.h b/net/devif/devif.h index efacd007140..e90377dd585 100644 --- a/net/devif/devif.h +++ b/net/devif/devif.h @@ -425,66 +425,6 @@ uint16_t devif_conn_event(FAR struct net_driver_s *dev, FAR void *pvconn, uint16_t devif_dev_event(FAR struct net_driver_s *dev, void *pvconn, uint16_t flags); -/**************************************************************************** - * Name: ipv4_forward - * - * Description: - * This function is called from ipv4_input when a packet is received that - * is not destined for us. In this case, the packet may need to be - * forwarded to another device (or sent back out the same device) - * depending configuration, routing table information, and the IPv4 - * networks served by various network devices. - * - * Input Parameters: - * dev - The device on which the packet was received and which contains - * the IPv4 packet. - * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 - * packet - * - * On input: - * - dev->d_buf holds the received packet. - * - dev->d_len holds the length of the received packet MINUS the - * size of the L1 header. That was subtracted out by ipv4_input. - * - ipv4 points to the IPv4 header with dev->d_buf. - * - * Returned Value: - * Zero is returned if the packet was successfully forward; A negated - * errno value is returned if the packet is not forwardable. In that - * latter case, the caller (ipv4_input()) should drop the packet. - * - ****************************************************************************/ - -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv4) -int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4); -#endif - -/**************************************************************************** - * Name: ipv6_forward - * - * Description: - * This function is called from ipv6_input when a packet is received that - * is not destined for us. In this case, the packet may need to be - * forwarded to another device (or sent back out the same device) - * depending configuration, routing table information, and the IPv6 - * networks served by various network devices. - * - * Input Parameters: - * dev - The device on which the packet was received and which contains - * the IPv6 packet. - * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 - * packet - * - * Returned Value: - * Zero is returned if the packet was successfully forward; A negated - * errno value is returned if the packet is not forwardable. In that - * latter case, the caller (ipv6_input()) should drop the packet. - * - ****************************************************************************/ - -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv6) -int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6); -#endif - /**************************************************************************** * Send data on the current connection. * diff --git a/net/devif/ip_forward.h b/net/devif/ip_forward.h index f7b88b4e2e2..5eed4d8bb3f 100644 --- a/net/devif/ip_forward.h +++ b/net/devif/ip_forward.h @@ -55,7 +55,13 @@ #include "icmpv6/icmpv6.h" #undef HAVE_FWDALLOC -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC) +#ifdef CONFIG_NET_IPFORWARD + +/* Must of the logic in this header file applies only for configurations + * will multiple network devices. + */ + +#ifdef CONFIG_NETDEV_MULTINIC /**************************************************************************** * Pre-processor Definitions @@ -205,6 +211,68 @@ FAR struct forward_s *ip_forward_alloc(void); void ip_forward_free(FAR struct forward_s *fwd); +/**************************************************************************** + * Name: ipv4_forward_broadcast + * + * Description: + * This function is called from ipv4_input when a broadcast or multicast + * packet is received. If CONFIG_NET_IPFORWARD_BROADCAST is enabled, this + * function will forward the broadcast packet to other networks through + * other network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv4_input. + * - ipv4 points to the IPv4 header with dev->d_buf. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPFORWARD_BROADCAST +void ipv4_forward_broadcast(FAR struct net_driver_s *dev, + FAR struct ipv4_hdr_s *ipv4); +#endif + +/**************************************************************************** + * Name: ipv6_forward_broadcast + * + * Description: + * This function is called from ipv6_input when a broadcast or multicast + * packet is received. If CONFIG_NET_IPFORWARD_BROADCAST is enabled, this + * function will forward the broadcast packet to other networks through + * other network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv6 packet. + * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv6_input. + * - ipv6 points to the IPv6 header with dev->d_buf. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPFORWARD_BROADCAST +void ipv6_forward_broadcast(FAR struct net_driver_s *dev, + FAR struct ipv6_hdr_s *ipv6); +#endif + /**************************************************************************** * Name: devif_forward * @@ -225,5 +293,67 @@ void ip_forward_free(FAR struct forward_s *fwd); void devif_forward(FAR struct forward_s *fwd); -#endif /* CONFIG_NET_IPFORWARD && CONFIG_NETDEV_MULTINIC */ +#endif /* CONFIG_NETDEV_MULTINIC */ + +/**************************************************************************** + * Name: ipv4_forward + * + * Description: + * This function is called from ipv4_input when a packet is received that + * is not destined for us. In this case, the packet may need to be + * forwarded to another device (or sent back out the same device) + * depending configuration, routing table information, and the IPv4 + * networks served by various network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv4_input. + * - ipv4 points to the IPv4 header with dev->d_buf. + * + * Returned Value: + * Zero is returned if the packet was successfully forward; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv4_input()) should drop the packet. + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv4 +int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4); +#endif + +/**************************************************************************** + * Name: ipv6_forward + * + * Description: + * This function is called from ipv6_input when a packet is received that + * is not destined for us. In this case, the packet may need to be + * forwarded to another device (or sent back out the same device) + * depending configuration, routing table information, and the IPv6 + * networks served by various network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv6 packet. + * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 + * packet + * + * Returned Value: + * Zero is returned if the packet was successfully forward; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv6_input()) should drop the packet. + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv6 +int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6); +#endif + +#endif /* CONFIG_NET_IPFORWARD */ #endif /* __NET_DEVIF_IP_FORWARD_H */ diff --git a/net/devif/ipv4_forward.c b/net/devif/ipv4_forward.c index ef8e8f971f0..500e040f19d 100644 --- a/net/devif/ipv4_forward.c +++ b/net/devif/ipv4_forward.c @@ -49,6 +49,7 @@ #include #include "netdev/netdev.h" +#include "utils/utils.h" #include "sixlowpan/sixlowpan.h" #include "udp/udp.h" #include "tcp/tcp.h" @@ -122,6 +123,119 @@ static int ipv4_hdrsize(FAR struct ipv4_hdr_s *ipv4) } #endif +/**************************************************************************** + * Name: ipv4_decr_ttl + * + * Description: + * Decrement the IPv4 TTL (time to live value). TTL field is set by the + * sender of the packet and reduced by every router on the route to its + * destination. If the TTL field reaches zero before the datagram arrives + * at its destination, then the datagram is discarded and an ICMP error + * packet (11 - Time Exceeded) is sent back to the sender. + * + * The purpose of the TTL field is to avoid a situation in which an + * undeliverable datagram keeps circulating on an Internet system, and + * such a system eventually becoming swamped by such "immortals". + * + * Input Parameters: + * ipv4 - A pointer to the IPv4 header in within the IPv4 packet to be + * forwarded. + * + * Returned Value: + * The new TTL value is returned. A value <= 0 means the hop limit has + * expired. + * + ****************************************************************************/ + +static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4) +{ + uint16_t sum; + int ttl = (int)ipv4->ttl - 1; + + if (ttl <= 0) + { +#ifdef CONFIG_NET_ICMP + /* Return an ICMP error packet back to the sender. */ +#warning Missing logic +#endif + + /* Return zero which must cause the packet to be dropped */ + + return 0; + } + + /* Save the updated TTL value */ + + ipv4->ttl = ttl; + + /* Re-calculate the IPv4 checksum. This checksum is the Internet checksum + * of the 20 bytes of the IPv4 header. This checksum will be different + * because we just modify the IPv4 TTL. + */ + + ipv4->ipchksum = 0; + sum = chksum(0, (FAR const uint8_t *)ipv4, IPv4_HDRLEN); + if (sum == 0) + { + sum = 0xffff; + } + else + { + sum = htons(sum); + } + + ipv4->ipchksum = ~sum; + return ttl; +} + +/**************************************************************************** + * Name: ipv4_dropstats + * + * Description: + * Update statistics for a dropped packet. + * + * Input Parameters: + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet to be dropped. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_STATISTICS +static void ipv4_dropstats(FAR struct ipv4_hdr_s *ipv4) +{ + switch (ipv4->proto) + { +#ifdef CONFIG_NET_TCP + case IP_PROTO_TCP: + g_netstats.tcp.drop++; + break; +#endif + +#ifdef CONFIG_NET_UDP + case IP_PROTO_UDP: + g_netstats.udp.drop++; + break; +#endif + +#ifdef CONFIG_NET_ICMP + case IP_PROTO_ICMP: + g_netstats.icmp.drop++; + break; +#endif + + default: + break; + } + + g_netstats.ipv4.drop++; +} +#else +# define ipv4_dropstats(ipv4) +#endif + /**************************************************************************** * Name: ipv4_dev_forward * @@ -210,9 +324,22 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev, goto errout_with_fwd; } - memcpy(&fwd->f_hdr, ipv4, hdrsize); + memcpy(&fwd->f_hdr.ipv4, ipv4, hdrsize); fwd->f_hdrsize = hdrsize; + /* Decrement the TTL in the copy of the IPv4 header (retaining the + * original TTL in the source). If it decrements to zero, then drop + * the packet. + */ + + ret = ipv4_decr_ttl(&fwd->f_hdr.ipv4.l2); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + goto errout_with_fwd; + } + /* Use the L2 + L3 header size to determine start and size of the data * payload. * @@ -317,103 +444,59 @@ errout: #endif /* CONFIG_NETDEV_MULTINIC */ /**************************************************************************** - * Name: ipv4_decr_ttl + * Name: ipv4_forward_callback * * Description: - * Decrement the IPv4 TTL (time to live value). TTL field is set by the - * sender of the packet and reduced by every router on the route to its - * destination. If the TTL field reaches zero before the datagram arrives - * at its destination, then the datagram is discarded and an ICMP error - * packet (11 - Time Exceeded) is sent back to the sender. - * - * The purpose of the TTL field is to avoid a situation in which an - * undeliverable datagram keeps circulating on an Internet system, and - * such a system eventually becoming swamped by such "immortals". + * This function is a callback from netdev_foreach. It implements the + * the broadcase forwarding action for each network device (other than, of + * course, the device that received the packet). * * Input Parameters: - * ipv4 - A pointer to the IPv4 header in within the IPv4 packet to be - * forwarded. + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet * * Returned Value: - * The new TTL value is returned. A value <= 0 means the hop limit has - * expired. + * Typically returns zero (meaning to continue the enumeration), but will + * return a non-zero to stop the enumeration if an error occurs. * ****************************************************************************/ -static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4) +#if defined(CONFIG_NET_IPFORWARD_BROADCAST) && \ + defined(CONFIG_NETDEV_MULTINIC) +int ipv4_forward_callback(FAR struct net_driver_s *fwddev, FAR void *arg) { - int ttl = (int)ipv4->ttl - 1; + FAR struct net_driver_s *dev = (FAR struct net_driver_s *)arg; + FAR struct ipv4_hdr_s *ipv4; + int ret; - if (ttl <= 0) - { -#ifdef CONFIG_NET_ICMP - /* Return an ICMP error packet back to the sender. */ -#warning Missing logic -#endif + DEBUGASSERT(fwddev != NULL && dev != NULL && dev->d_buf != NULL); - /* Return zero which must cause the packet to be dropped */ - - return 0; - } - - /* Save the updated TTL value */ - - ipv4->ttl = ttl; - - /* NOTE: We do not have to recalculate the IPv4 checksum because (1) the - * IPv4 header does not include a checksum itself and (2) the TTL is not - * included in the sum for the TCP and UDP headers. + /* Check if we are forwarding on the same device that we received the + * packet from. */ - return ttl; -} - -/**************************************************************************** - * Name: ipv4_dropstats - * - * Description: - * Update statistics for a dropped packet. - * - * Input Parameters: - * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 - * packet to be dropped. - * - * Returned Value: - * None - * - ****************************************************************************/ - -#ifdef CONFIG_NET_STATISTICS -static void ipv4_dropstats(FAR struct ipv4_hdr_s *ipv4) -{ - switch (ipv4->proto) + if (fwddev != dev) { -#ifdef CONFIG_NET_TCP - case IP_PROTO_TCP: - g_netstats.tcp.drop++; - break; -#endif + /* Recover the pointer to the IPv4 header in the receiving device's + * d_buf. + */ -#ifdef CONFIG_NET_UDP - case IP_PROTO_UDP: - g_netstats.udp.drop++; - break; -#endif + ipv4 = (FAR struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]; -#ifdef CONFIG_NET_ICMP - case IP_PROTO_ICMP: - g_netstats.icmp.drop++; - break; -#endif + /* Send the packet asynchrously on the forwarding device. */ - default: - break; + ret = ipv4_dev_forward(dev, fwddev, ipv4); + if (ret < 0) + { + nwarn("WARNING: ipv4_dev_forward failed: %d\n", ret); + return ret; + } } - g_netstats.ipv4.drop++; + return OK; } -#else -# define ipv4_dropstats(ipv4) #endif /**************************************************************************** @@ -458,24 +541,6 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4) FAR struct net_driver_s *fwddev; int ret; - /* Decrement the TTL. If it decrements to zero, then drop the packet */ - - ret = ipv4_decr_ttl(ipv4); - if (ret < 1) - { - nwarn("WARNING: Hop limit exceeded... Dropping!\n"); - ret = -EMULTIHOP; - goto drop; - } - - /* Re-calculate the IPv4 checksum. This checksum is the Internet checksum - * of the 20 bytes of the IPv4 header. This checksum will be different - * because we just modify the IPv4 TTL. - */ - - ipv4->ipchksum = 0; - ipv4->ipchksum = ~ipv4_chksum(dev); - /* Search for a device that can forward this packet. This is a trivial * search if there is only a single network device (CONFIG_NETDEV_MULTINIC * not defined). But netdev_findby_ipv4addr() will still assure @@ -508,7 +573,7 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4) ret = ipv4_dev_forward(dev, fwddev, ipv4); if (ret < 0) { - nwarn("WARNING: ipv4_dev_forward faield: %d\n", ret); + nwarn("WARNING: ipv4_dev_forward failed: %d\n", ret); goto drop; } } @@ -550,4 +615,48 @@ drop: return ret; } +/**************************************************************************** + * Name: ipv4_forward_broadcast + * + * Description: + * This function is called from ipv4_input when a broadcast or multicast + * packet is received. If CONFIG_NET_IPFORWARD_BROADCAST is enabled, this + * function will forward the broadcast packet to other networks through + * other network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv4_input. + * - ipv4 points to the IPv4 header with dev->d_buf. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#if defined(CONFIG_NET_IPFORWARD_BROADCAST) && \ + defined(CONFIG_NETDEV_MULTINIC) +void ipv4_forward_broadcast(FAR struct net_driver_s *dev, + FAR struct ipv4_hdr_s *ipv4) +{ + /* Don't bother if the TTL would expire */ + + if (ipv4->ttl > 1) + { + /* Forward the the broadcast/multicast packet to all devices except, + * of course, the device that received the packet. + */ + + (void)netdev_foreach(ipv4_forward_callback, dev); + } +} +#endif + #endif /* CONFIG_NET_IPFORWARD && CONFIG_NET_IPv4 */ diff --git a/net/devif/ipv4_input.c b/net/devif/ipv4_input.c index c2f9fcb2ca6..018f747dc0d 100644 --- a/net/devif/ipv4_input.c +++ b/net/devif/ipv4_input.c @@ -99,6 +99,7 @@ #include "icmp/icmp.h" #include "igmp/igmp.h" +#include "devif/ip_forward.h" #include "devif/devif.h" /**************************************************************************** @@ -403,6 +404,11 @@ int ipv4_input(FAR struct net_driver_s *dev) net_ipv4addr_cmp(net_ip4addr_conv32(ipv4->destipaddr), INADDR_BROADCAST)) { +#ifdef CONFIG_NET_IPFORWARD_BROADCAST + /* Forward broadcast packets */ + + ipv4_forward_broadcast(dev, ipv4); +#endif return udp_ipv4_input(dev); } @@ -430,7 +436,15 @@ int ipv4_input(FAR struct net_driver_s *dev) #ifdef CONFIG_NET_IGMP in_addr_t destip = net_ip4addr_conv32(ipv4->destipaddr); - if (igmp_grpfind(dev, &destip) == NULL) + if (igmp_grpfind(dev, &destip) != NULL) + { +#ifdef CONFIG_NET_IPFORWARD_BROADCAST + /* Forward multicast packets */ + + ipv4_forward_broadcast(dev, ipv4); +#endif + } + else #endif { /* No.. The packet is not destined for us. */ diff --git a/net/devif/ipv6_forward.c b/net/devif/ipv6_forward.c index 222099e5a7e..17fb197c93d 100644 --- a/net/devif/ipv6_forward.c +++ b/net/devif/ipv6_forward.c @@ -186,6 +186,106 @@ static int ipv6_hdrsize(FAR struct ipv6_hdr_s *ipv6) } #endif +/**************************************************************************** + * Name: ipv6_decr_ttl + * + * Description: + * Decrement the IPv6 TTL (time to live value). TTL field is set by the + * sender of the packet and reduced by every router on the route to its + * destination. If the TTL field reaches zero before the datagram arrives + * at its destination, then the datagram is discarded and an ICMP error + * packet (11 - Time Exceeded) is sent back to the sender. + * + * The purpose of the TTL field is to avoid a situation in which an + * undeliverable datagram keeps circulating on an Internet system, and + * such a system eventually becoming swamped by such "immortals". + * + * Input Parameters: + * ipv6 - A pointer to the IPv6 header in within the IPv6 packet to be + * forwarded. + * + * Returned Value: + * The new TTL value is returned. A value <= 0 means the hop limit has + * expired. + * + ****************************************************************************/ + +static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6) +{ + int ttl = (int)ipv6->ttl - 1; + + if (ttl <= 0) + { +#ifdef CONFIG_NET_ICMPv6 + /* Return an ICMPv6 error packet back to the sender. */ +#warning Missing logic +#endif + + /* Return zero which must cause the packet to be dropped */ + + return 0; + } + + /* Save the updated TTL value */ + + ipv6->ttl = ttl; + + /* NOTE: We do not have to recalculate the IPv6 checksum because (1) the + * IPv6 header does not include a checksum itself and (2) the TTL is not + * included in the sum for the TCP and UDP headers. + */ + + return ttl; +} + +/**************************************************************************** + * Name: ipv6_dropstats + * + * Description: + * Update statistics for a dropped packet. + * + * Input Parameters: + * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 + * packet to be dropped. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_STATISTICS +static void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6) +{ + switch (ipv6->proto) + { +#ifdef CONFIG_NET_TCP + case IP_PROTO_TCP: + g_netstats.tcp.drop++; + break; +#endif + +#ifdef CONFIG_NET_UDP + case IP_PROTO_UDP: + g_netstats.udp.drop++; + break; +#endif + +#ifdef CONFIG_NET_ICMPv6 + case IP_PROTO_ICMP6: + g_netstats.icmpv6.drop++; + break; +#endif + + default: + break; + } + + g_netstats.ipv6.drop++; +} +#else +# define ipv6_dropstats(ipv6) +#endif + /**************************************************************************** * Name: ipv6_dev_forward * @@ -280,9 +380,22 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev, goto errout_with_fwd; } - memcpy(&fwd->f_hdr, ipv6, hdrsize); + memcpy(&fwd->f_hdr.ipv6, ipv6, hdrsize); fwd->f_hdrsize = hdrsize; + /* Decrement the TTL in the copy of the IPv6 header (retaining the + * original TTL in the source). If it decrements to zero, then drop + * the packet. + */ + + ret = ipv6_decr_ttl(&fwd->f_hdr.ipv6.l2); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + goto errout_with_fwd; + } + /* Use the L2 + L3 header size to determine start and size of the data * payload. * @@ -398,103 +511,59 @@ errout: #endif /* CONFIG_NETDEV_MULTINIC */ /**************************************************************************** - * Name: ipv6_decr_ttl + * Name: ipv6_forward_callback * * Description: - * Decrement the IPv6 TTL (time to live value). TTL field is set by the - * sender of the packet and reduced by every router on the route to its - * destination. If the TTL field reaches zero before the datagram arrives - * at its destination, then the datagram is discarded and an ICMP error - * packet (11 - Time Exceeded) is sent back to the sender. - * - * The purpose of the TTL field is to avoid a situation in which an - * undeliverable datagram keeps circulating on an Internet system, and - * such a system eventually becoming swamped by such "immortals". + * This function is a callback from netdev_foreach. It implements the + * the broadcase forwarding action for each network device (other than, of + * course, the device that received the packet). * * Input Parameters: - * ipv6 - A pointer to the IPv6 header in within the IPv6 packet to be - * forwarded. + * dev - The device on which the packet was received and which contains + * the IPv6 packet. + * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 + * packet * * Returned Value: - * The new TTL value is returned. A value <= 0 means the hop limit has - * expired. + * Typically returns zero (meaning to continue the enumeration), but will + * return a non-zero to stop the enumeration if an error occurs. * ****************************************************************************/ -static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6) +#if defined(CONFIG_NET_IPFORWARD_BROADCAST) && \ + defined(CONFIG_NETDEV_MULTINIC) +int ipv6_forward_callback(FAR struct net_driver_s *fwddev, FAR void *arg) { - int ttl = (int)ipv6->ttl - 1; + FAR struct net_driver_s *dev = (FAR struct net_driver_s *)arg; + FAR struct ipv6_hdr_s *ipv6; + int ret; - if (ttl <= 0) - { -#ifdef CONFIG_NET_ICMPv6 - /* Return an ICMPv6 error packet back to the sender. */ -#warning Missing logic -#endif + DEBUGASSERT(fwddev != NULL && dev != NULL && dev->d_buf != NULL); - /* Return zero which must cause the packet to be dropped */ - - return 0; - } - - /* Save the updated TTL value */ - - ipv6->ttl = ttl; - - /* NOTE: We do not have to recalculate the IPv6 checksum because (1) the - * IPv6 header does not include a checksum itself and (2) the TTL is not - * included in the sum for the TCP and UDP headers. + /* Check if we are forwarding on the same device that we received the + * packet from. */ - return ttl; -} - -/**************************************************************************** - * Name: ipv6_dropstats - * - * Description: - * Update statistics for a dropped packet. - * - * Input Parameters: - * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 - * packet to be dropped. - * - * Returned Value: - * None - * - ****************************************************************************/ - -#ifdef CONFIG_NET_STATISTICS -static void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6) -{ - switch (ipv6->proto) + if (fwddev != dev) { -#ifdef CONFIG_NET_TCP - case IP_PROTO_TCP: - g_netstats.tcp.drop++; - break; -#endif + /* Recover the pointer to the IPv6 header in the receiving device's + * d_buf. + */ -#ifdef CONFIG_NET_UDP - case IP_PROTO_UDP: - g_netstats.udp.drop++; - break; -#endif + ipv6 = (FAR struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]; -#ifdef CONFIG_NET_ICMPv6 - case IP_PROTO_ICMP6: - g_netstats.icmpv6.drop++; - break; -#endif + /* Send the packet asynchrously on the forwarding device. */ - default: - break; + ret = ipv6_dev_forward(dev, fwddev, ipv6); + if (ret < 0) + { + nwarn("WARNING: ipv6_dev_forward failed: %d\n", ret); + return ret; + } } - g_netstats.ipv6.drop++; + return OK; } -#else -# define ipv6_dropstats(ipv6) #endif /**************************************************************************** @@ -535,16 +604,6 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) FAR struct net_driver_s *fwddev; int ret; - /* Decrement the TTL. If it decrements to zero, then drop the packet */ - - ret = ipv6_decr_ttl(ipv6); - if (ret < 1) - { - nwarn("WARNING: Hop limit exceeded... Dropping!\n"); - ret = -EMULTIHOP; - goto drop; - } - /* Search for a device that can forward this packet. This is a trivial * search if there is only a single network device (CONFIG_NETDEV_MULTINIC * not defined). But netdev_findby_ipv6addr() will still assure @@ -574,7 +633,7 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) ret = ipv6_dev_forward(dev, fwddev, ipv6); if (ret < 0) { - nwarn("WARNING: ipv6_dev_forward faield: %d\n", ret); + nwarn("WARNING: ipv6_dev_forward failed: %d\n", ret); goto drop; } } @@ -641,4 +700,48 @@ drop: return ret; } +/**************************************************************************** + * Name: ipv6_forward_broadcast + * + * Description: + * This function is called from ipv6_input when a broadcast or multicast + * packet is received. If CONFIG_NET_IPFORWARD_BROADCAST is enabled, this + * function will forward the broadcast packet to other networks through + * other network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv6 packet. + * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv6_input. + * - ipv6 points to the IPv6 header with dev->d_buf. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#if defined(CONFIG_NET_IPFORWARD_BROADCAST) && \ + defined(CONFIG_NETDEV_MULTINIC) +void ipv6_forward_broadcast(FAR struct net_driver_s *dev, + FAR struct ipv6_hdr_s *ipv6) +{ + /* Don't bother if the TTL would expire */ + + if (ipv6->ttl > 1) + { + /* Forward the the broadcast/multicast packet to all devices except, + * of course, the device that received the packet. + */ + + (void)netdev_foreach(ipv6_forward_callback, dev); + } +} +#endif + #endif /* CONFIG_NET_IPFORWARD && CONFIG_NET_IPv6 */ diff --git a/net/devif/ipv6_input.c b/net/devif/ipv6_input.c index 4d656f37493..b74f1046772 100644 --- a/net/devif/ipv6_input.c +++ b/net/devif/ipv6_input.c @@ -100,6 +100,7 @@ #include "icmpv6/icmpv6.h" #include "netdev/netdev.h" +#include "devif/ip_forward.h" #include "devif/devif.h" /**************************************************************************** @@ -183,6 +184,11 @@ static bool check_destipaddr(FAR struct net_driver_s *dev, if (ipv6->destipaddr[0] == HTONS(0xff02)) { +#ifdef CONFIG_NET_IPFORWARD_BROADCAST + /* Forward multicast packets */ + + ipv6_forward_broadcast(dev, ipv6); +#endif return true; } @@ -322,6 +328,11 @@ int ipv6_input(FAR struct net_driver_s *dev) if (ipv6->proto == IP_PROTO_UDP && net_ipv6addr_cmp(ipv6->destipaddr, g_ipv6_alloneaddr)) { +#ifdef CONFIG_NET_IPFORWARD_BROADCAST + /* Forward broadcast packets */ + + ipv6_forward_broadcast(dev, ipv6); +#endif return udp_ipv6_input(dev); } From efdc5b0c29de3e0091a6ce54af85384c9c9bc3a4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 07:49:55 -0600 Subject: [PATCH 05/21] IP forwarding: Add missing ICMP support. --- net/devif/ipv4_forward.c | 13 +- net/devif/ipv6_forward.c | 2 +- net/icmp/Make.defs | 8 + net/icmp/icmp_foward.c | 297 ++++++++++++++++++++++++++++++++++++ net/icmpv6/Make.defs | 2 +- net/icmpv6/icmpv6_forward.c | 76 +++------ 6 files changed, 335 insertions(+), 63 deletions(-) create mode 100644 net/icmp/icmp_foward.c diff --git a/net/devif/ipv4_forward.c b/net/devif/ipv4_forward.c index 500e040f19d..90042e4fbc1 100644 --- a/net/devif/ipv4_forward.c +++ b/net/devif/ipv4_forward.c @@ -156,7 +156,7 @@ static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4) { #ifdef CONFIG_NET_ICMP /* Return an ICMP error packet back to the sender. */ -#warning Missing logic +# warning Missing logic #endif /* Return zero which must cause the packet to be dropped */ @@ -413,7 +413,16 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev, break; #endif - case IP_PROTO_ICMP: /* Not yet supported */ +#ifdef CONFIG_NET_ICMP + case IP_PROTO_ICMP: + { + /* Forward an ICMP packet */ + + ret = icmp_forward(fwd); + } + break; +#endif + default: nwarn("WARNING: Unrecognized proto: %u\n", ipv4->proto); ret = -EPROTONOSUPPORT; diff --git a/net/devif/ipv6_forward.c b/net/devif/ipv6_forward.c index 17fb197c93d..aa3d8c248cc 100644 --- a/net/devif/ipv6_forward.c +++ b/net/devif/ipv6_forward.c @@ -218,7 +218,7 @@ static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6) { #ifdef CONFIG_NET_ICMPv6 /* Return an ICMPv6 error packet back to the sender. */ -#warning Missing logic +# warning Missing logic #endif /* Return zero which must cause the packet to be dropped */ diff --git a/net/icmp/Make.defs b/net/icmp/Make.defs index d5a67c2065f..6b002964e4f 100644 --- a/net/icmp/Make.defs +++ b/net/icmp/Make.defs @@ -43,6 +43,14 @@ ifeq ($(CONFIG_NET_ICMP_PING),y) NET_CSRCS += icmp_ping.c icmp_poll.c icmp_send.c endif +# IP forwarding + +ifeq ($(CONFIG_NET_IPFORWARD),y) +ifeq ($(CONFIG_NETDEV_MULTINIC),y) +NET_CSRCS += icmp_forward.c +endif +endif + # Include ICMP build support DEPPATH += --dep-path icmp diff --git a/net/icmp/icmp_foward.c b/net/icmp/icmp_foward.c new file mode 100644 index 00000000000..c46b626889a --- /dev/null +++ b/net/icmp/icmp_foward.c @@ -0,0 +1,297 @@ +/**************************************************************************** + * net/icmp/icmp_forward.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "devif/ip_forward.h" +#include "devif/devif.h" +#include "netdev/netdev.h" +#include "arp/arp.h" +#include "neighbor/neighbor.h" +#include "icmp/icmp.h" + +#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_ICMP) && \ + defined(CONFIG_NETDEV_MULTINIC) + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: icmp_forward_addrchck + * + * Description: + * Check if the destination IP address is in the IPv4 ARP table. If not, + * then the send won't actually make it out... it will be replaced with an + * ARP request (IPv4). + * + * NOTE 1: This could be an expensive check if there are a lot of + * entries in the ARP table. + * + * NOTE 2: If we are actually harvesting IP addresses on incoming IP + * packets, then this check should not be necessary; the MAC mapping + * should already be in the ARP table in many cases. + * + * NOTE 3: If CONFIG_NET_ARP_SEND then we can be assured that the IP + * address mapping is already in the ARP table. + * + * Parameters: + * fwd - The forwarding state structure + * + * Returned Value: + * true - The Ethernet MAC address is in the ARP table (OR the network + * device is not Ethernet). + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +#ifdef CONFIG_NET_ETHERNET +static inline bool icmp_forward_addrchck(FAR struct forward_s *fwd) +{ + /* REVISIT: Could the MAC address not also be in a routing table? */ + +#ifdef CONFIG_NET_MULTILINK + if (fwd->f_dev->d_lltype != NET_LL_ETHERNET) + { + return true; + } +#endif + +#if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) + return (arp_find(fwd->f_hdr.ipv4.l2.destipaddr) != NULL); +#else + return true; +#endif +} + +#else /* CONFIG_NET_ETHERNET */ +# define icmp_forward_addrchck(fwd) (true) +#endif /* CONFIG_NET_ETHERNET */ + +/**************************************************************************** + * Name: icmp_dropstats + * + * Description: + * Update statistics for a dropped packet. + * + * Input Parameters: + * fwd - The forwarding state structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_STATISTICS +static inline void icmp_dropstats(FAR struct forward_s *fwd) +{ + /* Increment the count of dropped ICMP packets */ + + g_netstats.icmp.drop++; + g_netstats.ipv4.drop++; +} +#else +# define icmp_dropstats(fwd) +#endif + +/**************************************************************************** + * Name: icmp_forward_interrupt + * + * Description: + * This function is called from the interrupt level to perform the actual + * send operation when polled by the lower, device interfacing layer. + * + * Parameters: + * dev The structure of the network driver that caused the interrupt + * conn An instance of the ICMP connection structure cast to void * + * pvpriv An instance of struct forward_s cast to void* + * flags Set of events describing why the callback was invoked + * + * Returned Value: + * Modified value of the input flags + * + * Assumptions: + * The network is locked + * + ****************************************************************************/ + +static uint16_t icmp_forward_interrupt(FAR struct net_driver_s *dev, + FAR void *conn, FAR void *pvpriv, + uint16_t flags) +{ + FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv; + + ninfo("flags: %04x\n", flags); + DEBUGASSERT(fwd != NULL); + + /* Make sure that this is from the forwarding device */ + + if (dev == fwd->f_dev) + { + /* If the network device has gone down, then we will have terminate + * the wait now with an error. + */ + + if ((flags & NETDEV_DOWN) != 0) + { + /* Terminate the transfer with an error. */ + + nwarn("WARNING: Network is down... Dropping\n"); + icmp_dropstats(fwd); + } + + /* Check if the outgoing packet is available. It may have been claimed + * by another send interrupt serving a different thread -OR- if the output + * buffer currently contains unprocessed incoming data. In these cases + * we will just have to wait for the next polling cycle. + */ + + else if (dev->d_sndlen > 0 || (flags & ICMP_NEWDATA) != 0) + { + /* Another thread has beat us sending data or the buffer is busy, + * Wait for the next polling cycle and check again. + */ + + return flags; + } + + /* It looks like we are good to forward the data */ + + else + { + /* Copy the ICMP data into driver's packet buffer and send it. */ + + devif_forward(fwd); + + /* Check if the destination IP address is in the ARP or Neighbor + * table. If not, then the send won't actually make it out... it + * will be replaced with an ARP request or Neighbor Solicitation. + */ + + if (!icmp_forward_addrchck(fwd)) + { + return flags; + } + } + + /* Free the allocated callback structure */ + + fwd->f_cb->flags = 0; + fwd->f_cb->priv = NULL; + fwd->f_cb->event = NULL; + + icmp_callback_free(dev, fwd->f_cb); + + /* Free any IOBs */ + + if (fwd->f_iob != NULL) + { + iob_free_chain(fwd->f_iob); + } + + /* And release the forwarding state structure */ + + ip_forward_free(fwd); + } + + return flags; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: icmp_forward + * + * Description: + * Called by the IP forwarding logic when an ICMP packet is received on + * one network device, but must be forwarded on another network device. + * + * Set up to forward the ICMP packet on the specified device. This + * function will set up a send "interrupt" handler that will perform the + * actual send asynchronously and must return without waiting for the + * send to complete. + * + * Input Parameters: + * fwd - An initialized instance of the common forwarding structure that + * includes everything needed to perform the forwarding operation. + * + * Returned Value: + * Zero is returned if the packet was successfully forwarded; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller should free the IOB list and drop the packet. + * + ****************************************************************************/ + +int icmp_forward(FAR struct forward_s *fwd) +{ + DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); + + /* Set up the callback in the connection */ + + fwd->f_cb = icmp_callback_alloc(fwd->f_dev); + if (fwd->f_cb != NULL) + { + fwd->f_cb->flags = (ICMP_POLL | NETDEV_DOWN); + fwd->f_cb->priv = (FAR void *)fwd; + fwd->f_cb->event = icmp_forward_interrupt; + + /* Notify the device driver of the availability of TX data */ + + netdev_txnotify_dev(fwd->f_dev); + return OK; + } + + return -EBUSY; +} + +#endif /* CONFIG_NET_IPFORWARD && CONFIG_NET_ICMP && CONFIG_NETDEV_MULTINIC */ diff --git a/net/icmpv6/Make.defs b/net/icmpv6/Make.defs index 92ac9cf2341..b8231151fc2 100644 --- a/net/icmpv6/Make.defs +++ b/net/icmpv6/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # net/icmpv6/Make.defs # -# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/net/icmpv6/icmpv6_forward.c b/net/icmpv6/icmpv6_forward.c index 4004c3805df..f1a6f8cb3de 100644 --- a/net/icmpv6/icmpv6_forward.c +++ b/net/icmpv6/icmpv6_forward.c @@ -67,26 +67,22 @@ * Name: icmpv6_forward_addrchck * * Description: - * Check if the destination IP address is in the IPv4 ARP or IPv6 Neighbor - * tables. If not, then the send won't actually make it out... it will be - * replaced with an ARP request (IPv4) or a Neighbor Solicitation (IPv6). + * Check if the destination IP address is in the Pv6 Neighbor table. If + * not, then the send won't actually make it out... it will be replaced + * with a Neighbor Solicitation. * * NOTE 1: This could be an expensive check if there are a lot of - * entries in the ARP or Neighbor tables. + * entries in the Neighbor table. * - * NOTE 2: If we are actually harvesting IP addresses on incoming IP - * packets, then this check should not be necessary; the MAC mapping - * should already be in the ARP table in many cases (IPv4 only). - * - * NOTE 3: If CONFIG_NET_ARP_SEND then we can be assured that the IP + * NOTE 2: If CONFIG_NET_ARP_SEND then we can be assured that the IP * address mapping is already in the ARP table. * * Parameters: * fwd - The forwarding state structure * * Returned Value: - * true - The Ethernet MAC address is in the ARP or Neighbor table (OR - * the network device is not Ethernet). + * true - The Ethernet MAC address is in the Neighbor table (OR the + * network device is not Ethernet). * * Assumptions: * The network is locked. @@ -105,35 +101,15 @@ static inline bool icmpv6_forward_addrchck(FAR struct forward_s *fwd) } #endif -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) -#endif - { -#if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) - return (arp_find(fwd->f_hdr.ipv4.l2.destipaddr) != NULL); -#else - return true; -#endif - } -#endif /* CONFIG_NET_IPv4 */ - -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { #if !defined(CONFIG_NET_ICMPv6_NEIGHBOR) - return (neighbor_findentry(fwd->f_hdr.ipv6.l2.destipaddr) != NULL); + return (neighbor_findentry(fwd->f_hdr.ipv6.l2.destipaddr) != NULL); #else - return true; + return true; #endif - } -#endif /* CONFIG_NET_IPv6 */ } #else /* CONFIG_NET_ETHERNET */ -# define icmpv6_forward_addrchck(r) (true) +# define icmpv6_forward_addrchck(fwd) (true) #endif /* CONFIG_NET_ETHERNET */ /**************************************************************************** @@ -151,33 +127,15 @@ static inline bool icmpv6_forward_addrchck(FAR struct forward_s *fwd) ****************************************************************************/ #ifdef CONFIG_NET_STATISTICS -static void icmpv6_dropstats(FAR struct forward_s *fwd) +static inline void icmpv6_dropstats(FAR struct forward_s *fwd) { - /* Increment the count of dropped ICMPV6 packets */ + /* Increment the count of dropped ICMPv6 packets */ g_netstats.icmpv6.drop++; - - /* Increment the count of dropped IPv4 or IPv6 packets */ - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) -#endif - { - g_netstats.ipv4.drop++; - } -#endif -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { - g_netstats.ipv6.drop++; - } -#endif + g_netstats.ipv6.drop++; } #else -# define icmpv6_dropstats(ipv6) +# define icmpv6_dropstats(fwd) #endif /**************************************************************************** @@ -189,7 +147,7 @@ static void icmpv6_dropstats(FAR struct forward_s *fwd) * * Parameters: * dev The structure of the network driver that caused the interrupt - * conn An instance of the ICMPV6 connection structure cast to void * + * conn An instance of the ICMPv6 connection structure cast to void * * pvpriv An instance of struct forward_s cast to void* * flags Set of events describing why the callback was invoked * @@ -291,10 +249,10 @@ static uint16_t icmpv6_forward_interrupt(FAR struct net_driver_s *dev, * Name: icmpv6_forward * * Description: - * Called by the IP forwarding logic when an ICMPV6 packet is received on + * Called by the IP forwarding logic when an ICMPv6 packet is received on * one network device, but must be forwarded on another network device. * - * Set up to forward the ICMPV6 packet on the specified device. This + * Set up to forward the ICMPv6 packet on the specified device. This * function will set up a send "interrupt" handler that will perform the * actual send asynchronously and must return without waiting for the * send to complete. From 165ee0027a2d7f4dd48baf46197484ba2eb2d1c4 Mon Sep 17 00:00:00 2001 From: Julien Lecoeur Date: Thu, 6 Jul 2017 08:32:31 -0600 Subject: [PATCH 06/21] Eliminate a warning with arm-none-eabi-gcc 7.1.0 --- drivers/mmcsd/mmcsd_spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmcsd/mmcsd_spi.c b/drivers/mmcsd/mmcsd_spi.c index 7bf4ecdee18..0ee84bb55b8 100644 --- a/drivers/mmcsd/mmcsd_spi.c +++ b/drivers/mmcsd/mmcsd_spi.c @@ -326,7 +326,9 @@ static const struct mmcsd_cmdinfo_s g_cmd0 = {CMD0, MMCSD_CMDRESP_R1, 0x95}; static const struct mmcsd_cmdinfo_s g_cmd1 = {CMD1, MMCSD_CMDRESP_R1, 0xff}; static const struct mmcsd_cmdinfo_s g_cmd8 = {CMD8, MMCSD_CMDRESP_R7, 0x87}; static const struct mmcsd_cmdinfo_s g_cmd9 = {CMD9, MMCSD_CMDRESP_R1, 0xff}; +#if 0 /* Not used */ static const struct mmcsd_cmdinfo_s g_cmd10 = {CMD10, MMCSD_CMDRESP_R1, 0xff}; +#endif static const struct mmcsd_cmdinfo_s g_cmd12 = {CMD12, MMCSD_CMDRESP_R1, 0xff}; static const struct mmcsd_cmdinfo_s g_cmd16 = {CMD16, MMCSD_CMDRESP_R1, 0xff}; static const struct mmcsd_cmdinfo_s g_cmd17 = {CMD17, MMCSD_CMDRESP_R1, 0xff}; From 94f26828e9d6ab833f763a2fe89f68f3e2e51ec5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 09:45:52 -0600 Subject: [PATCH 07/21] Fix a TTL-related issue introduced with last commit. --- net/devif/ipv4_forward.c | 3 + net/devif/ipv6_forward.c | 190 ++++++++++++++++++++++++++------------- 2 files changed, 130 insertions(+), 63 deletions(-) diff --git a/net/devif/ipv4_forward.c b/net/devif/ipv4_forward.c index 90042e4fbc1..6487a5fff87 100644 --- a/net/devif/ipv4_forward.c +++ b/net/devif/ipv4_forward.c @@ -147,6 +147,7 @@ static int ipv4_hdrsize(FAR struct ipv4_hdr_s *ipv4) * ****************************************************************************/ +#ifdef CONFIG_NETDEV_MULTINIC static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4) { uint16_t sum; @@ -187,6 +188,7 @@ static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4) ipv4->ipchksum = ~sum; return ttl; } +#endif /**************************************************************************** * Name: ipv4_dropstats @@ -227,6 +229,7 @@ static void ipv4_dropstats(FAR struct ipv4_hdr_s *ipv4) #endif default: + g_netstats.ipv4.protoerr++; break; } diff --git a/net/devif/ipv6_forward.c b/net/devif/ipv6_forward.c index aa3d8c248cc..055968c7fbb 100644 --- a/net/devif/ipv6_forward.c +++ b/net/devif/ipv6_forward.c @@ -59,73 +59,16 @@ #if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv6) /**************************************************************************** - * Private Functions + * Pre-processor Definitions ****************************************************************************/ +#define PACKET_FORWARDED 0 +#define PACKET_NOT_FORWARDED 1 + /**************************************************************************** - * Name: ipv6_packet_conversion - * - * Description: - * Generic output conversion hook. Only needed for IEEE802.15.4 for now - * but this is a point where support for other conversions may be - * provided. - * + * Private Functions ****************************************************************************/ -#ifdef CONFIG_NET_6LOWPAN -static int ipv6_packet_conversion(FAR struct net_driver_s *dev, - FAR struct net_driver_s *fwddev, - FAR struct ipv6_hdr_s *ipv6) -{ -#ifdef CONFIG_NET_MULTILINK - /* Handle the case where multiple link layer protocols are supported */ - - if (dev->d_len > 0 && fwddev->d_lltype == NET_LL_IEEE802154) -#else - if (dev->d_len > 0) -#endif - { -#ifdef CONFIG_NET_TCP - if (ipv6->proto == IP_PROTO_TCP) - { - /* Let 6LoWPAN convert IPv6 TCP output into IEEE802.15.4 frames. */ - - sixlowpan_tcp_send(dev, fwddev, ipv6); - } - else -#endif -#ifdef CONFIG_NET_UDP - if (ipv6->proto == IP_PROTO_UDP) - { - /* Let 6LoWPAN convert IPv6 UDP output into IEEE802.15.4 frames. */ - - sixlowpan_udp_send(dev, fwddev, ipv6); - } - else -#endif - { - /* Otherwise, we will have to drop the packet */ - - nwarn("WARNING: Dropping. Unsupported 6LoWPAN protocol: %d\n", - ipv6->proto); - -#ifdef CONFIG_NET_STATISTICS - g_netstats.ipv6.drop++; -#endif - return -EPROTONOSUPPORT; - } - - dev->d_len = 0; - return OK; - } - - nwarn("WARNING: Dropping. Unsupported link layer\n"); - return -EPFNOSUPPORT; -} -#else -# define ipv6_packet_conversion(dev, ipv6) -#endif /* CONFIG_NET_6LOWPAN */ - /**************************************************************************** * Name: ipv6_hdrsize * @@ -210,6 +153,7 @@ static int ipv6_hdrsize(FAR struct ipv6_hdr_s *ipv6) * ****************************************************************************/ +#if defined(CONFIG_NETDEV_MULTINIC) || defined(CONFIG_NET_6LOWPAN) static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6) { int ttl = (int)ipv6->ttl - 1; @@ -237,6 +181,7 @@ static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6) return ttl; } +#endif /**************************************************************************** * Name: ipv6_dropstats @@ -277,6 +222,7 @@ static void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6) #endif default: + g_netstats.ipv6.protoerr++; break; } @@ -286,6 +232,114 @@ static void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6) # define ipv6_dropstats(ipv6) #endif +/**************************************************************************** + * Name: ipv6_packet_conversion + * + * Description: + * Generic output conversion hook. Only needed for IEEE802.15.4 for now + * but this is a point where support for other conversions may be + * provided. + * + * Returned value: + * PACKET_FORWARDED - Packet was forwarded + * PACKET_NOT_FORWARDED - Packet was not forwarded + * < 0 - And error occurred (and packet not fowarded). + * + ****************************************************************************/ + +#ifdef CONFIG_NET_6LOWPAN +static int ipv6_packet_conversion(FAR struct net_driver_s *dev, + FAR struct net_driver_s *fwddev, + FAR struct ipv6_hdr_s *ipv6) +{ + int ret = PACKET_NOT_FORWARDED; + + if (dev->d_len > 0) + { +#ifdef CONFIG_NET_MULTILINK + /* Handle the case where multiple link layer protocols are supported */ + + if (fwddev->d_lltype == NET_LL_IEEE802154) + { + nwarn("WARNING: Unsupported link layer... Not forwarded\n"); + } + else +#endif +#ifdef CONFIG_NET_TCP + if (ipv6->proto == IP_PROTO_TCP) + { + /* Decrement the TTL in the IPv6 header. If it decrements to + * zero, then drop the packet. + */ + + ret = ipv6_decr_ttl(ipv6); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + } + else + { + /* Let 6LoWPAN convert IPv6 TCP output into IEEE802.15.4 + * frames. + */ + + sixlowpan_tcp_send(dev, fwddev, ipv6); + + /* The packet was forwarded */ + + dev->d_len = 0; + return PACKET_FORWARDED; + } + } + else +#endif +#ifdef CONFIG_NET_UDP + if (ipv6->proto == IP_PROTO_UDP) + { + /* Decrement the TTL in the IPv6 header. If it decrements to + * zero, then drop the packet. + */ + + ret = ipv6_decr_ttl(ipv6); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + } + else + { + /* Let 6LoWPAN convert IPv6 UDP output into IEEE802.15.4 + * frames. + */ + + sixlowpan_udp_send(dev, fwddev, ipv6); + + /* The packet was forwarded */ + + dev->d_len = 0; + return PACKET_FORWARDED; + } + } + else +#endif + { + /* Otherwise, we cannot forward the packet */ + + nwarn("WARNING: Dropping. Unsupported 6LoWPAN protocol: %d\n", + ipv6->proto); + } + } + + /* The packet was not forwarded (or the HOP limit was exceeded) */ + + ipv6_dropstats(ipv6); + return ret; +} +#else +# define ipv6_packet_conversion(dev, ipv6) (PACKET_NOT_FORWARDED) +#endif /* CONFIG_NET_6LOWPAN */ + /**************************************************************************** * Name: ipv6_dev_forward * @@ -302,7 +356,7 @@ static void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6) * ipv6 - A pointer to the IPv6 header in within the IPv6 packet * * Returned Value: - * Zero is returned if the packet was successfully forward; A negated + * Zero is returned if the packet was successfully forwarded; A negated * errno value is returned if the packet is not forwardable. In that * latter case, the caller (ipv6_input()) should drop the packet. * @@ -321,6 +375,11 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev, ret = ipv6_packet_conversion(dev, fwddev, ipv6); if (ret < 0) + { + nwarn("WARNING: ipv6_packet_conversion failed: %d\n", ret); + goto errout; + } + else if (ret == PACKET_NOT_FORWARDED) { FAR uint8_t *payload; unsigned int paysize; @@ -657,6 +716,11 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) ret = ipv6_packet_conversion(dev, dev, ipv6); if (ret < 0) { + nwarn("WARNING: ipv6_packet_conversion failed: %d\n", ret); + goto drop; + } + else if (ret == PACKET_NOT_FORWARDED) + { #ifdef CONFIG_NET_ETHERNET /* REVISIT: For Ethernet we may have to fix up the Ethernet header: * - source MAC, the MAC of the current device. From 15b85738e7b5b9df6377f56e2a6a629346f87964 Mon Sep 17 00:00:00 2001 From: "gwenhael.goavec" Date: Thu, 6 Jul 2017 09:52:21 -0600 Subject: [PATCH 08/21] In arch/arm/src/stm32/Kconfig when the CPU is a STM32F4, some STM32_HAVE_xx with xx = {OTGFS, TIM3, TIM4, SPI3, I2S3, I2C3} are selected by default. But for F410 these peripherals are absent. This change add tests to check if the target CPU is an F410 or not and selects according to the situation. This also adds a select for STM32_HAVE_DAC1 present on this STM32 flavor. --- arch/arm/src/stm32/Kconfig | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index ba6bdb4b790..514555cf82f 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -1525,14 +1525,14 @@ config STM32_STM32F37XX config STM32_STM32F40XX bool default n - select STM32_HAVE_OTGFS - select STM32_HAVE_TIM3 - select STM32_HAVE_TIM4 + select STM32_HAVE_OTGFS if !STM32_STM32F410 + select STM32_HAVE_TIM3 if !STM32_STM32F410 + select STM32_HAVE_TIM4 if !STM32_STM32F410 select STM32_HAVE_SPI2 - select STM32_HAVE_SPI3 - select STM32_HAVE_I2S3 + select STM32_HAVE_SPI3 if !STM32_STM32F410 + select STM32_HAVE_I2S3 if !STM32_STM32F410 select STM32_HAVE_I2C2 - select STM32_HAVE_I2C3 + select STM32_HAVE_I2C3 if !STM32_STM32F410 config STM32_STM32F401 bool @@ -1557,6 +1557,7 @@ config STM32_STM32F410 select STM32_HAVE_TIM9 select STM32_HAVE_TIM11 select STM32_HAVE_SPI5 + select STM32_HAVE_DAC1 config STM32_STM32F411 bool From 47be509d797a012de40735e17d730891f72b3963 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 10:20:14 -0600 Subject: [PATCH 09/21] Rename CONFIG_STM32_STM32F40XX to CONFIG_STM32_STM32FXXXX since it is used by F4 parts other than F40x --- arch/arm/include/stm32/chip.h | 136 +++++++++--------- arch/arm/include/stm32/irq.h | 2 +- arch/arm/src/stm32/Kconfig | 94 ++++++------ arch/arm/src/stm32/Make.defs | 2 +- arch/arm/src/stm32/chip.h | 4 +- arch/arm/src/stm32/chip/stm32_adc.h | 22 +-- arch/arm/src/stm32/chip/stm32_can.h | 12 +- arch/arm/src/stm32/chip/stm32_dbgmcu.h | 6 +- arch/arm/src/stm32/chip/stm32_eth.h | 16 +-- arch/arm/src/stm32/chip/stm32_exti.h | 4 +- arch/arm/src/stm32/chip/stm32_flash.h | 22 +-- arch/arm/src/stm32/chip/stm32_memorymap.h | 2 +- arch/arm/src/stm32/chip/stm32_pwr.h | 6 +- arch/arm/src/stm32/chip/stm32_spi.h | 18 +-- arch/arm/src/stm32/chip/stm32_tim.h | 8 +- arch/arm/src/stm32/chip/stm32f40xxx_syscfg.h | 4 +- arch/arm/src/stm32/gnu/stm32_vectors.S | 4 +- arch/arm/src/stm32/iar/stm32_vectors.S | 4 +- arch/arm/src/stm32/stm32_adc.c | 24 ++-- arch/arm/src/stm32/stm32_adc.h | 4 +- arch/arm/src/stm32/stm32_allocateheap.c | 2 +- arch/arm/src/stm32/stm32_bbsram.h | 2 +- arch/arm/src/stm32/stm32_can.c | 2 +- arch/arm/src/stm32/stm32_ccm.h | 2 +- arch/arm/src/stm32/stm32_dac.c | 10 +- arch/arm/src/stm32/stm32_dma.c | 2 +- arch/arm/src/stm32/stm32_dma.h | 6 +- arch/arm/src/stm32/stm32_dumpgpio.c | 2 +- arch/arm/src/stm32/stm32_eth.c | 8 +- arch/arm/src/stm32/stm32_flash.c | 26 ++-- arch/arm/src/stm32/stm32_fsmc.h | 2 +- arch/arm/src/stm32/stm32_gpio.c | 10 +- arch/arm/src/stm32/stm32_gpio.h | 4 +- arch/arm/src/stm32/stm32_i2c.c | 8 +- arch/arm/src/stm32/stm32_i2c_alt.c | 6 +- arch/arm/src/stm32/stm32_i2s.c | 6 +- arch/arm/src/stm32/stm32_iwdg.c | 2 +- arch/arm/src/stm32/stm32_lowputc.c | 2 +- arch/arm/src/stm32/stm32_pwm.c | 10 +- arch/arm/src/stm32/stm32_pwr.c | 2 +- arch/arm/src/stm32/stm32_pwr.h | 2 +- arch/arm/src/stm32/stm32_qencoder.c | 4 +- arch/arm/src/stm32/stm32_rcc.c | 2 +- arch/arm/src/stm32/stm32_rcc.h | 6 +- arch/arm/src/stm32/stm32_rtc.c | 2 +- arch/arm/src/stm32/stm32_rtc.h | 4 +- arch/arm/src/stm32/stm32_rtc_lowerhalf.c | 14 +- arch/arm/src/stm32/stm32_sdio.c | 10 +- arch/arm/src/stm32/stm32_serial.c | 10 +- arch/arm/src/stm32/stm32_spi.c | 6 +- arch/arm/src/stm32/stm32_syscfg.h | 2 +- arch/arm/src/stm32/stm32_tim_lowerhalf.c | 2 +- arch/arm/src/stm32/stm32_uart.h | 2 +- arch/arm/src/stm32/stm32_wwdg.c | 2 +- arch/arm/src/stm32/stm32f40xxx_dma.c | 4 +- arch/arm/src/stm32/stm32f40xxx_i2c.c | 6 +- configs/clicker2-stm32/knsh/defconfig | 2 +- .../clicker2-stm32/mrf24j40-6lowpan/defconfig | 2 +- configs/clicker2-stm32/mrf24j40-mac/defconfig | 2 +- .../clicker2-stm32/mrf24j40-starhub/defconfig | 2 +- .../mrf24j40-starpoint/defconfig | 2 +- configs/clicker2-stm32/nsh/defconfig | 2 +- configs/clicker2-stm32/usbnsh/defconfig | 2 +- configs/cloudctrl/nsh/defconfig | 2 +- configs/fire-stm32v2/nsh/defconfig | 2 +- configs/hymini-stm32v/nsh/defconfig | 2 +- configs/hymini-stm32v/nsh2/defconfig | 2 +- configs/hymini-stm32v/usbmsc/defconfig | 2 +- configs/hymini-stm32v/usbnsh/defconfig | 2 +- configs/hymini-stm32v/usbserial/defconfig | 2 +- configs/maple/nsh/defconfig | 2 +- configs/maple/nx/defconfig | 2 +- configs/maple/usbnsh/defconfig | 2 +- configs/mikroe-stm32f4/fulldemo/defconfig | 2 +- configs/mikroe-stm32f4/kostest/defconfig | 2 +- configs/mikroe-stm32f4/nsh/defconfig | 2 +- configs/mikroe-stm32f4/nx/defconfig | 2 +- configs/mikroe-stm32f4/nxlines/defconfig | 2 +- configs/mikroe-stm32f4/nxtext/defconfig | 2 +- configs/mikroe-stm32f4/usbnsh/defconfig | 2 +- configs/nucleo-f303re/adc/defconfig | 2 +- configs/nucleo-f303re/can/defconfig | 2 +- configs/nucleo-f303re/hello/defconfig | 2 +- configs/nucleo-f303re/nxlines/defconfig | 2 +- configs/nucleo-f303re/pwm/defconfig | 2 +- configs/nucleo-f303re/serialrx/defconfig | 2 +- configs/nucleo-f303re/uavcan/defconfig | 2 +- configs/nucleo-f334r8/adc/defconfig | 2 +- configs/nucleo-f334r8/nsh/defconfig | 2 +- .../nucleo-f4x1re/f401-nsh-clang/defconfig | 2 +- configs/nucleo-f4x1re/f401-nsh/defconfig | 2 +- configs/nucleo-f4x1re/f411-nsh/defconfig | 2 +- configs/olimex-stm32-e407/discover/defconfig | 2 +- configs/olimex-stm32-e407/netnsh/defconfig | 2 +- configs/olimex-stm32-e407/nsh/defconfig | 2 +- configs/olimex-stm32-e407/telnetd/defconfig | 2 +- configs/olimex-stm32-e407/usbnsh/defconfig | 2 +- configs/olimex-stm32-e407/webserver/defconfig | 2 +- configs/olimex-stm32-h405/usbnsh/defconfig | 2 +- configs/olimex-stm32-h407/nsh/defconfig | 2 +- configs/olimex-stm32-p107/nsh/defconfig | 2 +- configs/olimex-stm32-p207/nsh/defconfig | 2 +- configs/olimex-stm32-p407/knsh/defconfig | 2 +- configs/olimex-stm32-p407/nsh/defconfig | 2 +- configs/olimexino-stm32/can/defconfig | 2 +- configs/olimexino-stm32/composite/defconfig | 2 +- configs/olimexino-stm32/nsh/defconfig | 2 +- configs/olimexino-stm32/smallnsh/defconfig | 2 +- configs/olimexino-stm32/tiny/defconfig | 2 +- configs/photon/nsh/defconfig | 2 +- configs/photon/usbnsh/defconfig | 2 +- configs/photon/wlan/defconfig | 2 +- configs/shenzhou/nsh/defconfig | 2 +- configs/shenzhou/nxwm/defconfig | 2 +- configs/shenzhou/thttpd/defconfig | 2 +- configs/spark/composite/defconfig | 2 +- configs/spark/nsh/defconfig | 2 +- configs/spark/usbmsc/defconfig | 2 +- configs/spark/usbnsh/defconfig | 2 +- configs/spark/usbserial/defconfig | 2 +- configs/stm3210e-eval/composite/defconfig | 2 +- configs/stm3210e-eval/nsh/defconfig | 2 +- configs/stm3210e-eval/nsh2/defconfig | 2 +- configs/stm3210e-eval/nx/defconfig | 2 +- configs/stm3210e-eval/nxterm/defconfig | 2 +- configs/stm3210e-eval/pm/defconfig | 2 +- configs/stm3210e-eval/usbmsc/defconfig | 2 +- configs/stm3210e-eval/usbserial/defconfig | 2 +- configs/stm3220g-eval/dhcpd/defconfig | 2 +- configs/stm3220g-eval/nettest/defconfig | 2 +- configs/stm3220g-eval/nsh/defconfig | 2 +- configs/stm3220g-eval/nsh2/defconfig | 2 +- configs/stm3220g-eval/nxwm/defconfig | 2 +- configs/stm3220g-eval/telnetd/defconfig | 2 +- configs/stm3240g-eval/dhcpd/defconfig | 2 +- configs/stm3240g-eval/discover/defconfig | 2 +- configs/stm3240g-eval/knxwm/defconfig | 2 +- configs/stm3240g-eval/nettest/defconfig | 2 +- configs/stm3240g-eval/nsh/defconfig | 2 +- configs/stm3240g-eval/nsh2/defconfig | 2 +- configs/stm3240g-eval/nxterm/defconfig | 2 +- configs/stm3240g-eval/nxwm/defconfig | 2 +- configs/stm3240g-eval/telnetd/defconfig | 2 +- configs/stm3240g-eval/webserver/defconfig | 2 +- configs/stm3240g-eval/xmlrpc/defconfig | 2 +- configs/stm32_tiny/nsh/defconfig | 2 +- configs/stm32_tiny/usbnsh/defconfig | 2 +- configs/stm32butterfly2/nsh/defconfig | 2 +- configs/stm32butterfly2/nshnet/defconfig | 2 +- configs/stm32butterfly2/nshusbdev/defconfig | 2 +- configs/stm32butterfly2/nshusbhost/defconfig | 2 +- .../stm32f103-minimum/audio_tone/defconfig | 2 +- configs/stm32f103-minimum/buttons/defconfig | 2 +- configs/stm32f103-minimum/jlx12864g/defconfig | 2 +- configs/stm32f103-minimum/mcp2515/defconfig | 2 +- configs/stm32f103-minimum/nrf24/defconfig | 2 +- configs/stm32f103-minimum/nsh/defconfig | 2 +- configs/stm32f103-minimum/pwm/defconfig | 2 +- .../stm32f103-minimum/rfid-rc522/defconfig | 2 +- configs/stm32f103-minimum/rgbled/defconfig | 2 +- configs/stm32f103-minimum/usbnsh/defconfig | 2 +- configs/stm32f103-minimum/userled/defconfig | 2 +- configs/stm32f103-minimum/veml6070/defconfig | 2 +- configs/stm32f3discovery/nsh/defconfig | 2 +- configs/stm32f3discovery/usbnsh/defconfig | 2 +- configs/stm32f411e-disco/nsh/defconfig | 2 +- configs/stm32f429i-disco/extflash/defconfig | 2 +- configs/stm32f429i-disco/lcd/defconfig | 2 +- configs/stm32f429i-disco/ltdc/defconfig | 2 +- configs/stm32f429i-disco/nsh/defconfig | 2 +- configs/stm32f429i-disco/nxwm/defconfig | 2 +- configs/stm32f429i-disco/usbmsc/defconfig | 2 +- configs/stm32f429i-disco/usbnsh/defconfig | 2 +- configs/stm32f4discovery/canard/defconfig | 2 +- configs/stm32f4discovery/cxxtest/defconfig | 2 +- configs/stm32f4discovery/elf/defconfig | 2 +- configs/stm32f4discovery/ipv6/defconfig | 2 +- configs/stm32f4discovery/kostest/defconfig | 2 +- configs/stm32f4discovery/netnsh/defconfig | 2 +- configs/stm32f4discovery/nsh/defconfig | 2 +- configs/stm32f4discovery/nxlines/defconfig | 2 +- configs/stm32f4discovery/pm/defconfig | 2 +- .../stm32f4discovery/posix_spawn/defconfig | 2 +- configs/stm32f4discovery/pseudoterm/defconfig | 2 +- configs/stm32f4discovery/rgbled/defconfig | 2 +- configs/stm32f4discovery/uavcan/defconfig | 2 +- configs/stm32f4discovery/usbnsh/defconfig | 2 +- configs/stm32f4discovery/winbuild/defconfig | 2 +- configs/stm32f4discovery/xen1210/defconfig | 2 +- configs/stm32ldiscovery/nsh/defconfig | 2 +- configs/stm32vldiscovery/nsh/defconfig | 2 +- configs/viewtool-stm32f107/highpri/defconfig | 2 +- configs/viewtool-stm32f107/netnsh/defconfig | 2 +- configs/viewtool-stm32f107/nsh/defconfig | 2 +- 194 files changed, 431 insertions(+), 431 deletions(-) diff --git a/arch/arm/include/stm32/chip.h b/arch/arm/include/stm32/chip.h index a9eca2813fb..bf3a742af6e 100644 --- a/arch/arm/include/stm32/chip.h +++ b/arch/arm/include/stm32/chip.h @@ -92,7 +92,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -133,7 +133,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -174,7 +174,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -215,7 +215,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -256,7 +256,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -297,7 +297,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -337,7 +337,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -377,7 +377,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -417,7 +417,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -457,7 +457,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-4 with DMA @@ -498,7 +498,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-4 with DMA @@ -543,7 +543,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* 16-bit general timers TIM2-4 with DMA */ @@ -582,7 +582,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* 16-bit general timers TIM2-4 with DMA */ @@ -624,7 +624,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -664,7 +664,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -703,7 +703,7 @@ # undef CONFIG_STM32_CONNECTIVITYLINE /* STM32F105x and STM32F107x */ # undef CONFIG_STM32_STM32F20XX /* STM32F205x and STM32F207x */ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 0 /* No advanced timer TIM1 */ # define STM32_NGTIM 3 /* 16-bit general timers TIM2-4 */ @@ -743,7 +743,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 2 /* General timers TIM2,3 */ @@ -782,7 +782,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* General timers TIM2-4 */ @@ -821,7 +821,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* General timers TIM2-4 */ @@ -860,7 +860,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* General timers TIM2-4 */ @@ -904,7 +904,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and TIM8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -946,7 +946,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and TIM8 */ # define STM32_NGTIM 4 /* General timers TIM2-5 */ @@ -988,7 +988,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -1028,7 +1028,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -1066,7 +1066,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -1104,7 +1104,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -1144,7 +1144,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1183,7 +1183,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1222,7 +1222,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1269,7 +1269,7 @@ # undef CONFIG_STM32_CONNECTIVITYLINE /* STM32F105x and STM32F107x */ # undef CONFIG_STM32_STM32F20XX /* STM32F205x and STM32F207x */ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 (no TIM8) */ # define STM32_NGTIM 6 /* (2) 16-bit general timers with DMA: TIM3 and TIM4 @@ -1310,7 +1310,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 (no TIM8) */ # define STM32_NGTIM 6 /* (2) 16-bit general timers with DMA: TIM3 and TIM4 @@ -1351,7 +1351,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 (no TIM8) */ # define STM32_NGTIM 6 /* (2) 16-bit general timers with DMA: TIM3 and TIM4 @@ -1392,7 +1392,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 (no TIM8) */ # define STM32_NGTIM 6 /* (2) 16-bit general timers with DMA: TIM3 and TIM4 @@ -1433,7 +1433,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 */ @@ -1474,7 +1474,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 */ @@ -1515,7 +1515,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* (2) Advanced 16-bit timers with DMA: TIM1 and TIM8 */ @@ -1556,7 +1556,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* (2) Advanced 16-bit timers with DMA: TIM1 and TIM8 */ @@ -1597,7 +1597,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* (2) Advanced 16-bit timers with DMA: TIM1 and TIM8 */ @@ -1638,7 +1638,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* (2) Advanced 16-bit timers with DMA: TIM1 and TIM8 */ @@ -1679,7 +1679,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # define CONFIG_STM32_STM32F33XX 1 /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_HRTIM 1 /* (1) High-resolution timer 16-bit, 10 channels: HRTIM1 */ @@ -1723,7 +1723,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # define CONFIG_STM32_STM32F33XX 1 /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_HRTIM 1 /* (1) High-resolution timer 16-bit, 10 channels: HRTIM1 */ @@ -1767,7 +1767,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # define CONFIG_STM32_STM32F33XX 1 /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_HRTIM 1 /* (1) High-resolution timer 16-bit, 10 channels: HRTIM1 */ @@ -1810,7 +1810,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # define CONFIG_STM32_STM32F37XX 1 /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* (0) Advanced 16-bit timers with DMA: */ @@ -1856,7 +1856,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1894,7 +1894,7 @@ # undef CONFIG_STM32_STM32F20XX /* STM32F205x and STM32F207x */ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1933,7 +1933,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1972,7 +1972,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2011,7 +2011,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2050,7 +2050,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2089,7 +2089,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2128,7 +2128,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2167,7 +2167,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2206,7 +2206,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2245,7 +2245,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2284,7 +2284,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2323,7 +2323,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2362,7 +2362,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2401,7 +2401,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2440,7 +2440,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2479,7 +2479,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2518,7 +2518,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437/429/439 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2557,7 +2557,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2596,7 +2596,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 STM32F466 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2635,7 +2635,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 STM32F466 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2674,7 +2674,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 STM32F466 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2713,7 +2713,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 STM32F466 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2752,7 +2752,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2794,7 +2794,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA diff --git a/arch/arm/include/stm32/irq.h b/arch/arm/include/stm32/irq.h index ed369355a14..54e2d0f2950 100644 --- a/arch/arm/include/stm32/irq.h +++ b/arch/arm/include/stm32/irq.h @@ -89,7 +89,7 @@ # include #elif defined(CONFIG_STM32_STM32F37XX) # include -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include #else # error "Unsupported STM32 chip" diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index 514555cf82f..b382deaa94c 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -968,189 +968,189 @@ config ARCH_CHIP_STM32F373VC config ARCH_CHIP_STM32F401RE bool "STM32F401RE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F401 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F410RB bool "STM32F410RB" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F410 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F411RE bool "STM32F411RE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F411 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F411VE bool "STM32F411VE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F411 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F405RG bool "STM32F405RG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F405 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F405VG bool "STM32F405VG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F405 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F405ZG bool "STM32F405ZG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F405 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407VE bool "STM32F407VE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407VG bool "STM32F407VG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407ZE bool "STM32F407ZE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407ZG bool "STM32F407ZG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407IE bool "STM32F407IE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407IG bool "STM32F407IG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F427V bool "STM32F427V" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F427 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F427Z bool "STM32F427Z" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F427 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F427I bool "STM32F427I" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F427 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429V bool "STM32F429V" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429Z bool "STM32F429Z" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429I bool "STM32F429I" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429B bool "STM32F429B" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429N bool "STM32F429N" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F446M bool "STM32F446M" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F446 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F446R bool "STM32F446R" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F446 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F446V bool "STM32F446V" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F446 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F446Z bool "STM32F446Z" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F446 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F469A bool "STM32F469A" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F469 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F469I bool "STM32F469I" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F469 select ARCH_HAVE_FPU select STM32_HAVE_ETHMAC @@ -1158,7 +1158,7 @@ config ARCH_CHIP_STM32F469I config ARCH_CHIP_STM32F469B bool "STM32F469B" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F469 select ARCH_HAVE_FPU select STM32_HAVE_ETHMAC @@ -1166,7 +1166,7 @@ config ARCH_CHIP_STM32F469B config ARCH_CHIP_STM32F469N bool "STM32F469N" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F469 select ARCH_HAVE_FPU select STM32_HAVE_ETHMAC @@ -1522,7 +1522,7 @@ config STM32_STM32F37XX select STM32_HAVE_SPI3 select STM32_HAVE_USART3 -config STM32_STM32F40XX +config STM32_STM32F4XXX bool default n select STM32_HAVE_OTGFS if !STM32_STM32F410 @@ -2170,7 +2170,7 @@ config STM32_BKP config STM32_BKPSRAM bool "Enable BKP RAM Domain" default n - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX config STM32_CAN1 bool "CAN1" @@ -2189,7 +2189,7 @@ config STM32_CAN2 config STM32_CCMDATARAM bool "CMD/DATA RAM" default n - depends on STM32_STM32F40XX + depends on STM32_STM32F4XXX config STM32_AES bool "128-bit AES" @@ -2210,7 +2210,7 @@ config STM32_CRC config STM32_CRYP bool "CRYP" default n - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX config STM32_DMA1 bool "DMA1" @@ -2238,7 +2238,7 @@ config STM32_DAC2 config STM32_DCMI bool "DCMI" default n - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX config STM32_ETHMAC bool "Ethernet MAC" @@ -2255,7 +2255,7 @@ config STM32_FSMC config STM32_HASH bool "HASH" default n - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX config STM32_HRTIM1 bool "HRTIM1" @@ -2330,7 +2330,7 @@ config STM32_OTGFS config STM32_OTGHS bool "OTG HS" default n - depends on STM32_STM32F205 || STM32_STM32F207 || STM32_STM32F40XX || STM32_STM32F429 + depends on STM32_STM32F205 || STM32_STM32F207 || STM32_STM32F4XXX || STM32_STM32F429 select USBHOST_HAVE_ASYNCH if USBHOST config STM32_PWR @@ -2402,7 +2402,7 @@ config STM32_SPI6 config STM32_SYSCFG bool "SYSCFG" default y - depends on STM32_STM32L15XX || STM32_STM32F30XX || STM32_STM32F37XX || STM32_STM32F207 || STM32_STM32F40XX || STM32_CONNECTIVITYLINE + depends on STM32_STM32L15XX || STM32_STM32F30XX || STM32_STM32F37XX || STM32_STM32F207 || STM32_STM32F4XXX || STM32_CONNECTIVITYLINE config STM32_TIM1 bool "TIM1" @@ -2771,7 +2771,7 @@ endmenu config STM32_FLASH_PREFETCH bool "Enable FLASH Pre-fetch" - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX default y if STM32_STM32F427 || STM32_STM32F429 || STM32_STM32F446 default n ---help--- @@ -2869,8 +2869,8 @@ config STM32_CCM_PROCFS config STM32_DMACAPABLE bool "Workaround non-DMA capable memory" depends on ARCH_DMA - default y if STM32_STM32F40XX && !STM32_CCMEXCLUDE - default n if !STM32_STM32F40XX || STM32_CCMEXCLUDE + default y if STM32_STM32F4XXX && !STM32_CCMEXCLUDE + default n if !STM32_STM32F4XXX || STM32_CCMEXCLUDE ---help--- This option enables the DMA interface stm32_dmacapable that can be used to check if it is possible to do DMA from the selected address. @@ -6413,7 +6413,7 @@ config STM32_I2C_DUTY16_9 config STM32_I2C_DMA bool "I2C DMA Support" default n - depends on STM32_I2C && STM32_STM32F40XX && STM32_DMA1 && !I2C_POLLED + depends on STM32_I2C && STM32_STM32F4XXX && STM32_DMA1 && !I2C_POLLED ---help--- This option enables the DMA for I2C transfers. Note: The user can define CONFIG_I2C_DMAPRIO: a custom priority value for the @@ -6552,7 +6552,7 @@ config STM32_MII choice prompt "MII clock configuration" default STM32_MII_MCO if STM32_STM32F10XX - default STM32_MII_MCO1 if STM32_STM32F207 || STM32_STM32F40XX + default STM32_MII_MCO1 if STM32_STM32F207 || STM32_STM32F4XXX depends on STM32_MII config STM32_MII_MCO @@ -6563,13 +6563,13 @@ config STM32_MII_MCO config STM32_MII_MCO1 bool "Use MC01 as MII clock" - depends on (STM32_STM32F207 || STM32_STM32F40XX) + depends on (STM32_STM32F207 || STM32_STM32F4XXX) ---help--- Use MCO1 to clock the MII interface. Default: Use MC01 config STM32_MII_MCO2 bool "Use MC02 as MII clock" - depends on (STM32_STM32F207 || STM32_STM32F40XX) + depends on (STM32_STM32F207 || STM32_STM32F4XXX) ---help--- Use MCO2 to clock the MII interface. Default: Use MC01 @@ -6700,7 +6700,7 @@ config STM32_RMII choice prompt "RMII clock configuration" default STM32_RMII_MCO if STM32_STM32F10XX - default STM32_RMII_MCO1 if STM32_STM32F207 || STM32_STM32F40XX + default STM32_RMII_MCO1 if STM32_STM32F207 || STM32_STM32F4XXX depends on STM32_RMII config STM32_RMII_MCO @@ -6711,13 +6711,13 @@ config STM32_RMII_MCO config STM32_RMII_MCO1 bool "Use MC01 as RMII clock" - depends on (STM32_STM32F207 || STM32_STM32F40XX) + depends on (STM32_STM32F207 || STM32_STM32F4XXX) ---help--- Use MCO1 to clock the RMII interface. Default: Use MC01 config STM32_RMII_MCO2 bool "Use MC02 as RMII clock" - depends on (STM32_STM32F207 || STM32_STM32F40XX) + depends on (STM32_STM32F207 || STM32_STM32F4XXX) ---help--- Use MCO2 to clock the RMII interface. Default: Use MC01 diff --git a/arch/arm/src/stm32/Make.defs b/arch/arm/src/stm32/Make.defs index 11f5c3dc1d9..e7817c8c532 100644 --- a/arch/arm/src/stm32/Make.defs +++ b/arch/arm/src/stm32/Make.defs @@ -140,7 +140,7 @@ else ifeq ($(CONFIG_STM32_STM32F30XX),y) CHIP_CSRCS += stm32f30xxx_i2c.c else ifeq ($(CONFIG_STM32_STM32F37XX),y) CHIP_CSRCS += stm32f30xxx_i2c.c -else ifeq ($(CONFIG_STM32_STM32F40XX),y) +else ifeq ($(CONFIG_STM32_STM32F4XXX),y) CHIP_CSRCS += stm32f40xxx_i2c.c else CHIP_CSRCS += stm32_i2c.c diff --git a/arch/arm/src/stm32/chip.h b/arch/arm/src/stm32/chip.h index 64ec1db6049..58ede7d4be0 100644 --- a/arch/arm/src/stm32/chip.h +++ b/arch/arm/src/stm32/chip.h @@ -134,7 +134,7 @@ /* STM32 F4 Family ******************************************************************/ -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_pinmap.h" #else # error "No pinmap file for this STM32 chip" @@ -157,7 +157,7 @@ # include "chip/stm32f33xxx_vectors.h" # elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_vectors.h" -# elif defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" # else # error "No vector file for this STM32 family" diff --git a/arch/arm/src/stm32/chip/stm32_adc.h b/arch/arm/src/stm32/chip/stm32_adc.h index 8a9eb956b67..6c84c513be2 100644 --- a/arch/arm/src/stm32/chip/stm32_adc.h +++ b/arch/arm/src/stm32/chip/stm32_adc.h @@ -93,7 +93,7 @@ # define STM32_ADC_SMPR0_OFFSET 0X005c /* ADC sample time register 3 (32-bit) */ #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define STM32_ADC_CSR_OFFSET 0x0000 /* Common status register */ # define STM32_ADC_CCR_OFFSET 0x0004 /* Common control register */ # ifndef CONFIG_STM32_STM32L15XX @@ -186,7 +186,7 @@ # define STM32_ADC3_DR (STM32_ADC3_BASE+STM32_ADC_DR_OFFSET) #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define STM32_ADC_CSR (STM32_ADCCMN_BASE+STM32_ADC_CSR_OFFSET) # define STM32_ADC_CCR (STM32_ADCCMN_BASE+STM32_ADC_CCR_OFFSET) # ifndef CONFIG_STM32_STM32L15XX @@ -203,7 +203,7 @@ #define ADC_SR_JEOC (1 << 2) /* Bit 2 : Injected channel end of conversion */ #define ADC_SR_JSTRT (1 << 3) /* Bit 3 : Injected channel Start flag */ #define ADC_SR_STRT (1 << 4) /* Bit 4 : Regular channel Start flag */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define ADC_SR_OVR (1 << 5) /* Bit 5 : Overrun */ #endif #if defined(CONFIG_STM32_STM32L15XX) @@ -253,7 +253,7 @@ #define ADC_CR1_JAWDEN (1 << 22) /* Bit 22: Analog watchdog enable on injected channels */ #define ADC_CR1_AWDEN (1 << 23) /* Bit 23: Analog watchdog enable on regular channels */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define ADC_CR1_RES_SHIFT (24) /* Bits 24-25: Resolution */ # define ADC_CR1_RES_MASK (3 << ADC_CR1_RES_SHIFT) # define ADC_CR1_RES_12BIT (0 << ADC_CR1_RES_SHIFT) /* 15 ADCCLK cycles. For STM32L15XX: 12 ADCCLK cycles */ @@ -298,14 +298,14 @@ #define ADC_CR2_DMA (1 << 8) /* Bit 8: Direct Memory access mode */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define ADC_CR2_DDS (1 << 9) /* Bit 9: DMA disable selection (for single ADC mode) */ # define ADC_CR2_EOCS (1 << 10) /* Bit 10: End of conversion selection */ #endif #define ADC_CR2_ALIGN (1 << 11) /* Bit 11: Data Alignment */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) /* Bits 12-15: Reserved */ # define ADC_CR2_JEXTSEL_SHIFT (16) /* Bits 16-19: External event select for injected group */ # define ADC_CR2_JEXTSEL_MASK (0x0F << ADC_CR2_JEXTSEL_SHIFT) @@ -425,7 +425,7 @@ /* ADC sample time register 1 */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ADC_SMPR_3 0 /* 000: 3 cycles */ # define ADC_SMPR_15 1 /* 001: 15 cycles */ @@ -436,7 +436,7 @@ # define ADC_SMPR_144 6 /* 110: 144 cycles */ # define ADC_SMPR_480 7 /* 111: 480 cycles */ -#elif !defined(CONFIG_STM32_STM32L15XX) && !defined(CONFIG_STM32_STM32F20XX) && !defined(CONFIG_STM32_STM32F40XX) +#elif !defined(CONFIG_STM32_STM32L15XX) && !defined(CONFIG_STM32_STM32F20XX) && !defined(CONFIG_STM32_STM32F4XXX) # define ADC_SMPR_1p5 0 /* 000: 1.5 cycles */ # define ADC_SMPR_7p5 1 /* 001: 7.5 cycles */ @@ -477,7 +477,7 @@ # define ADC_SMPR1_SMP16_MASK (7 << ADC_SMPR1_SMP16_SHIFT) # define ADC_SMPR1_SMP17_SHIFT (21) /* Bits 21-23: Channel 17 Sample time selection */ # define ADC_SMPR1_SMP17_MASK (7 << ADC_SMPR1_SMP17_SHIFT) -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ADC_SMPR1_SMP18_SHIFT (24) /* Bits 24-26: Channel 18 Sample time selection */ # define ADC_SMPR1_SMP18_MASK (7 << ADC_SMPR1_SMP17_SHIFT) # endif @@ -784,7 +784,7 @@ /* Common status register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # # define ADC_CSR_AWD1 (1 << 0) /* Bit 0: Analog watchdog flag of ADC1 (copy of AWD in ADC1_SR) */ # define ADC_CSR_EOC1 (1 << 1) /* Bit 1: End of conversion of ADC1 (copy of EOC in ADC1_SR) */ @@ -818,7 +818,7 @@ /* Common control register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ADC_CCR_MULTI_SHIFT (0) /* Bits 0-4: Multi ADC mode selection */ # define ADC_CCR_MULTI_MASK (31 << ADC_CCR_MULTI_SHIFT) # define ADC_CCR_MULTI_NONE (0 << ADC_CCR_MULTI_SHIFT) /* 00000: Independent mode */ diff --git a/arch/arm/src/stm32/chip/stm32_can.h b/arch/arm/src/stm32/chip/stm32_can.h index c1e3500d5e6..2f45b8152bf 100644 --- a/arch/arm/src/stm32/chip/stm32_can.h +++ b/arch/arm/src/stm32/chip/stm32_can.h @@ -62,7 +62,7 @@ /* Number of filters depends on silicon */ #if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_NFILTERS 28 #else # define CAN_NFILTERS 14 @@ -449,14 +449,14 @@ /* CAN filter master register */ #define CAN_FMR_FINIT (1 << 0) /* Bit 0: Filter Init Mode */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FMR_CAN2SB_SHIFT (8) /* Bits 13-8: CAN2 start bank */ # define CAN_FMR_CAN2SB_MASK (0x3f << CAN_FMR_CAN2SB_SHIFT) #endif /* CAN filter mode register */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FM1R_FBM_SHIFT (0) /* Bits 13:0: Filter Mode */ # define CAN_FM1R_FBM_MASK (0x3fff << CAN_FM1R_FBM_SHIFT) #else @@ -466,7 +466,7 @@ /* CAN filter scale register */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FS1R_FSC_SHIFT (0) /* Bits 13:0: Filter Scale Configuration */ # define CAN_FS1R_FSC_MASK (0x3fff << CAN_FS1R_FSC_SHIFT) #else @@ -476,7 +476,7 @@ /* CAN filter FIFO assignment register */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FFA1R_FFA_SHIFT (0) /* Bits 13:0: Filter FIFO Assignment */ # define CAN_FFA1R_FFA_MASK (0x3fff << CAN_FFA1R_FFA_SHIFT) #else @@ -486,7 +486,7 @@ /* CAN filter activation register */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FA1R_FACT_SHIFT (0) /* Bits 13:0: Filter Active */ # define CAN_FA1R_FACT_MASK (0x3fff << CAN_FA1R_FACT_SHIFT) #else diff --git a/arch/arm/src/stm32/chip/stm32_dbgmcu.h b/arch/arm/src/stm32/chip/stm32_dbgmcu.h index af80113a737..30e9d459602 100644 --- a/arch/arm/src/stm32/chip/stm32_dbgmcu.h +++ b/arch/arm/src/stm32/chip/stm32_dbgmcu.h @@ -53,7 +53,7 @@ #define STM32_DBGMCU_IDCODE 0xe0042000 /* MCU identifier */ #define STM32_DBGMCU_CR 0xe0042004 /* MCU debug */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F33XX) || defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F33XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) # define STM32_DBGMCU_APB1_FZ 0xe0042008 /* Debug MCU APB1 freeze register */ # define STM32_DBGMCU_APB2_FZ 0xe004200c /* Debug MCU APB2 freeze register */ @@ -101,7 +101,7 @@ /* Debug MCU APB1 freeze register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define DBGMCU_APB1_TIM2STOP (1 << 0) /* Bit 0: TIM2 stopped when core is halted */ # define DBGMCU_APB1_TIM3STOP (1 << 1) /* Bit 1: TIM3 stopped when core is halted */ # define DBGMCU_APB1_TIM4STOP (1 << 2) /* Bit 2: TIM4 stopped when core is halted */ @@ -138,7 +138,7 @@ /* Debug MCU APB2 freeze register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define DBGMCU_APB2_TIM1STOP (1 << 0) /* Bit 0: TIM1 stopped when core is halted */ # define DBGMCU_APB2_TIM8STOP (1 << 1) /* Bit 1: TIM8 stopped when core is halted */ # define DBGMCU_APB2_TIM9STOP (1 << 16) /* Bit 16: TIM9 stopped when core is halted */ diff --git a/arch/arm/src/stm32/chip/stm32_eth.h b/arch/arm/src/stm32/chip/stm32_eth.h index ac078aacbee..5ac1f752d00 100644 --- a/arch/arm/src/stm32/chip/stm32_eth.h +++ b/arch/arm/src/stm32/chip/stm32_eth.h @@ -62,7 +62,7 @@ #define STM32_ETH_MACVLANTR_OFFSET 0x001c /* Ethernet MAC VLAN tag register */ #define STM32_ETH_MACRWUFFR_OFFSET 0x0028 /* Ethernet MAC remote wakeup frame filter reg */ #define STM32_ETH_MACPMTCSR_OFFSET 0x002c /* Ethernet MAC PMT control and status register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_ETH_MACDBGR_OFFSET 0x0034 /* Ethernet MAC debug register */ #endif #define STM32_ETH_MACSR_OFFSET 0x0038 /* Ethernet MAC interrupt status register */ @@ -134,7 +134,7 @@ #define STM32_ETH_MACVLANTR (STM32_ETHERNET_BASE+STM32_ETH_MACVLANTR_OFFSET) #define STM32_ETH_MACRWUFFR (STM32_ETHERNET_BASE+STM32_ETH_MACRWUFFR_OFFSET) #define STM32_ETH_MACPMTCSR (STM32_ETHERNET_BASE+STM32_ETH_MACPMTCSR_OFFSET) -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_ETH_MACDBGR (STM32_ETHERNET_BASE+STM32_ETH_MACDBGR_OFFSET) #endif #define STM32_ETH_MACSR (STM32_ETHERNET_BASE+STM32_ETH_MACSR_OFFSET) @@ -220,7 +220,7 @@ # define ETH_MACCR_IFG(n) ((12-((n) >> 3)) << ETH_MACCR_IFG_SHIFT) /* n bit times, n=40,48,..96 */ #define ETH_MACCR_JD (1 << 22) /* Bit 22: Jabber disable */ #define ETH_MACCR_WD (1 << 23) /* Bit 23: Watchdog disable */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ETH_MACCR_CSTF (1 << 25) /* Bits 25: CRC stripping for Type frames */ #endif @@ -309,7 +309,7 @@ /* Ethernet MAC debug register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) #define ETH_MACDBGR_MMRPEA (1 << 0) /* Bit 0: MAC MII receive protocol engine active */ #define ETH_MACDBGR_MSFRWCS_SHIFT (1) /* Bits 1-2: MAC small FIFO read / write controllers status */ @@ -429,7 +429,7 @@ #define ETH_MMCCR_ROR (1 << 2) /* Bit 2: Reset on read */ #define ETH_MMCCR_MCF (1 << 3) /* Bit 3: MMC counter freeze */ #define ETH_MMCCR_MCP (1 << 4) /* Bit 4: MMC counter preset */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ETH_MMCCR_MCFHP (1 << 5) /* Bit 5: MMC counter Full-Half preset */ #endif @@ -466,7 +466,7 @@ #define ETH_PTPTSCR_TSITE (1 << 4) /* Bit 4: Time stamp interrupt trigger enable */ #define ETH_PTPTSCR_TSARU (1 << 5) /* Bit 5: Time stamp addend register update */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) #define ETH_PTPTSCR_TSSARFE (1 << 8) /* Bit 8: Time stamp snapshot for all received frames enable */ #define ETH_PTPTSCR_TSSSR (1 << 9) /* Bit 9: Time stamp subsecond rollover: digital or binary rollover control */ #define ETH_PTPTSCR_TSPTPPSV2E (1 << 10) /* Bit 10: Time stamp PTP packet snooping for version2 format enable */ @@ -558,7 +558,7 @@ #define ETH_DMABMR_USP (1 << 23) /* Bit 23: Use separate PBL */ #define ETH_DMABMR_FPM (1 << 24) /* Bit 24: 4xPBL mode */ #define ETH_DMABMR_AAB (1 << 25) /* Bit 25: Address-aligned beats */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ETH_DMABMR_MB (1 << 26) /* Bit 26: Mixed burst */ #endif @@ -711,7 +711,7 @@ /* RDES0: Receive descriptor Word0 */ #define ETH_RDES0_PCE (1 << 0) /* Bit 0: Payload checksum error */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ETH_RDES0_ESA (1 << 0) /* Bit 0: Extended status available */ #endif #define ETH_RDES0_CE (1 << 1) /* Bit 1: CRC error */ diff --git a/arch/arm/src/stm32/chip/stm32_exti.h b/arch/arm/src/stm32/chip/stm32_exti.h index e18b60cf71b..44750101070 100644 --- a/arch/arm/src/stm32/chip/stm32_exti.h +++ b/arch/arm/src/stm32/chip/stm32_exti.h @@ -60,7 +60,7 @@ # define STM32_EXTI1_MASK 0xffffffff # define STM32_NEXTI2 4 # define STM32_EXTI2_MASK 0x0000000f -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_NEXTI 23 # define STM32_EXTI_MASK 0x007fffff #endif @@ -137,7 +137,7 @@ # define EXTI_RTC_CMP1 (1 << 21) /* EXTI line 21 is connected to the Comparator 1 wakeup event */ # define EXTI_RTC_CMP2 (1 << 22) /* EXTI line 22 is connected to the Comparator 2 wakeup event */ # define EXTI_RTC_ACQUIRE (1 << 23) /* EXTI line 23 is connected to the channel acquisition interrupt */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define EXTI_PVD_LINE (1 << 16) /* EXTI line 16 is connected to the PVD output */ # define EXTI_RTC_ALARM (1 << 17) /* EXTI line 17 is connected to the RTC Alarm event */ # define EXTI_OTGFS_WAKEUP (1 << 18) /* EXTI line 18 is connected to the USB OTG FS Wakeup event */ diff --git a/arch/arm/src/stm32/chip/stm32_flash.h b/arch/arm/src/stm32/chip/stm32_flash.h index 89e60e39a5e..6608ab99b31 100644 --- a/arch/arm/src/stm32/chip/stm32_flash.h +++ b/arch/arm/src/stm32/chip/stm32_flash.h @@ -115,7 +115,7 @@ # define STM32_FLASH_NPAGES 128 # define STM32_FLASH_PAGESIZE 2048 -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_NPAGES 8 # define STM32_FLASH_SIZE _K((4 * 16) + (1 * 64) + (3 * 128)) # define STM32_FLASH_SIZES {_K(16), _K(16), _K(16), _K(16), \ @@ -133,7 +133,7 @@ /* Define the Valid Configuration the F2 and F4 */ -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if defined(CONFIG_STM32_FLASH_CONFIG_B) # define STM32_FLASH_NPAGES 5 @@ -147,7 +147,7 @@ # define STM32_FLASH_SIZES {_K(16), _K(16), _K(16), _K(16), \ _K(64), _K(128)} -# elif defined(CONFIG_STM32_FLASH_CONFIG_D) && defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_FLASH_CONFIG_D) && defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_NPAGES 7 # define STM32_FLASH_SIZE _K((4 * 16) + (1 * 64) + (2 * 128)) # define STM32_FLASH_SIZES {_K(16), _K(16), _K(16), _K(16), \ @@ -173,7 +173,7 @@ _K(64), _K(128), _K(128), _K(128), \ _K(128), _K(128), _K(128), _K(128)} -# elif defined(CONFIG_STM32_FLASH_CONFIG_I) && defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_FLASH_CONFIG_I) && defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_NPAGES 24 # define STM32_FLASH_SIZE _K((4 * 16) + (1 * 64) + (7 * 128)) + \ _K((4 * 16) + (1 * 64) + (7 * 128)) @@ -249,7 +249,7 @@ # define STM32_FLASH_AR_OFFSET 0x0014 # define STM32_FLASH_OBR_OFFSET 0x001c # define STM32_FLASH_WRPR_OFFSET 0x0020 -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_OPTCR_OFFSET 0x0014 # endif #endif @@ -285,7 +285,7 @@ # define STM32_FLASH_AR (STM32_FLASHIF_BASE+STM32_FLASH_AR_OFFSET) # define STM32_FLASH_OBR (STM32_FLASHIF_BASE+STM32_FLASH_OBR_OFFSET) # define STM32_FLASH_WRPR (STM32_FLASHIF_BASE+STM32_FLASH_WRPR_OFFSET) -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_OPTCR (STM32_FLASHIF_BASE+STM32_FLASH_OPTCR_OFFSET) # endif # if defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) || \ @@ -324,7 +324,7 @@ defined(CONFIG_STM32_STM32F37XX) # define FLASH_ACR_PRFTBS (1 << 5) /* Bit 5: FLASH prefetch buffer status */ # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FLASH_ACR_PRFTEN (1 << 8) /* FLASH prefetch enable */ # define FLASH_ACR_ICEN (1 << 9) /* Bit 9: Instruction cache enable */ # define FLASH_ACR_DCEN (1 << 10) /* Bit 10: Data cache enable */ @@ -341,7 +341,7 @@ # define FLASH_SR_PGERR (1 << 2) /* Programming Error */ # define FLASH_SR_WRPRT_ERR (1 << 4) /* Write Protection Error */ # define FLASH_SR_EOP (1 << 5) /* End of Operation */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FLASH_SR_EOP (1 << 0) /* Bit 0: End of operation */ # define FLASH_SR_OPERR (1 << 1) /* Bit 1: Operation error */ # define FLASH_SR_WRPERR (1 << 4) /* Bit 4: Write protection error */ @@ -397,7 +397,7 @@ defined(CONFIG_STM32_STM32F37XX) # define FLASH_CR_OBL_LAUNCH (1 << 13) /* Bit 13: Force option byte loading */ # endif -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FLASH_CR_PG (1 << 0) /* Bit 0: Programming */ # define FLASH_CR_SER (1 << 1) /* Bit 1: Sector Erase */ # define FLASH_CR_MER (1 << 2) /* Bit 2: Mass Erase sectors 0..11 */ @@ -426,7 +426,7 @@ /* Flash Option Control Register (OPTCR) */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FLASH_OPTCR_OPTLOCK (1 << 0) /* Bit 0: Option lock */ # define FLASH_OPTCR_OPTSTRT (1 << 1) /* Bit 1: Option start */ # define FLASH_OPTCR_BORLEV_SHIFT (2) /* Bits 2-3: BOR reset Level */ @@ -468,7 +468,7 @@ void stm32_flash_lock(void); void stm32_flash_unlock(void); -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX int stm32_flash_writeprotect(size_t page, bool enabled); #endif diff --git a/arch/arm/src/stm32/chip/stm32_memorymap.h b/arch/arm/src/stm32/chip/stm32_memorymap.h index 3e88405ca75..e32d5a647aa 100644 --- a/arch/arm/src/stm32/chip/stm32_memorymap.h +++ b/arch/arm/src/stm32/chip/stm32_memorymap.h @@ -55,7 +55,7 @@ # include "chip/stm32f33xxx_memorymap.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_memorymap.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_memorymap.h" #else # error "Unsupported STM32 memory map" diff --git a/arch/arm/src/stm32/chip/stm32_pwr.h b/arch/arm/src/stm32/chip/stm32_pwr.h index 20209ee12c5..3cbf8524640 100644 --- a/arch/arm/src/stm32/chip/stm32_pwr.h +++ b/arch/arm/src/stm32/chip/stm32_pwr.h @@ -90,7 +90,7 @@ # endif #define PWR_CR_DBP (1 << 8) /* Bit 8: Disable Backup Domain write protection */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define PWR_CR_FPDS (1 << 9) /* Bit 9: Flash power down in Stop mode */ # if defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) || \ defined(CONFIG_STM32_STM32F446) || defined(CONFIG_STM32_STM32F469) @@ -139,7 +139,7 @@ #define PWR_CSR_PVDO (1 << 2) /* Bit 2: PVD Output */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) # define PWR_CSR_BRR (1 << 3) /* Bit 3: Backup regulator ready */ #elif defined(CONFIG_STM32_STM32L15XX) # define PWR_CSR_VREFINTRDYF (1 << 3) /* Bit 3: Internal voltage reference (VREFINT) ready flag */ @@ -159,7 +159,7 @@ # define PWR_CSR_EWUP (1 << 8) /* Bit 8: Enable WKUP pin */ #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define PWR_CSR_BRE (1 << 9) /* Bit 9: Backup regulator enable */ # define PWR_CSR_VOSRDY (1 << 14) /* Bit 14: Regulator voltage scaling output selection ready bite */ #endif diff --git a/arch/arm/src/stm32/chip/stm32_spi.h b/arch/arm/src/stm32/chip/stm32_spi.h index 3e0a086b63c..cf9a9e0118e 100644 --- a/arch/arm/src/stm32/chip/stm32_spi.h +++ b/arch/arm/src/stm32/chip/stm32_spi.h @@ -49,7 +49,7 @@ /* Maximum allowed speed as per specifications for all SPIs */ -#if defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F4XXX) # define STM32_SPI_CLK_MAX 37500000UL #else # define STM32_SPI_CLK_MAX 18000000UL @@ -66,7 +66,7 @@ #define STM32_SPI_TXCRCR_OFFSET 0x0018 /* SPI Tx CRC register (16-bit) */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_SPI_I2SCFGR_OFFSET 0x001c /* I2S configuration register */ # define STM32_SPI_I2SPR_OFFSET 0x0020 /* I2S prescaler register */ #endif @@ -92,7 +92,7 @@ # define STM32_SPI2_RXCRCR (STM32_SPI2_BASE+STM32_SPI_RXCRCR_OFFSET) # define STM32_SPI2_TXCRCR (STM32_SPI2_BASE+STM32_SPI_TXCRCR_OFFSET) #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_SPI2_I2SCFGR (STM32_SPI2_BASE+STM32_SPI_I2SCFGR_OFFSET) # define STM32_SPI2_I2SPR (STM32_SPI2_BASE+STM32_SPI_I2SPR_OFFSET) # endif @@ -107,7 +107,7 @@ # define STM32_SPI3_RXCRCR (STM32_SPI3_BASE+STM32_SPI_RXCRCR_OFFSET) # define STM32_SPI3_TXCRCR (STM32_SPI3_BASE+STM32_SPI_TXCRCR_OFFSET) #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_SPI3_I2SCFGR (STM32_SPI3_BASE+STM32_SPI_I2SCFGR_OFFSET) # define STM32_SPI3_I2SPR (STM32_SPI3_BASE+STM32_SPI_I2SPR_OFFSET) # endif @@ -152,7 +152,7 @@ #define SPI_CR2_SSOE (1 << 2) /* Bit 2: SS Output Enable */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_CR2_FRF (1 << 4) /* Bit 4: Frame format */ #endif @@ -188,7 +188,7 @@ #define SPI_SR_TXE (1 << 1) /* Bit 1: Transmit buffer empty */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_SR_CHSIDE (1 << 2) /* Bit 2: Channel side */ # define SPI_SR_UDR (1 << 3) /* Bit 3: Underrun flag */ #endif @@ -199,7 +199,7 @@ #define SPI_SR_BSY (1 << 7) /* Bit 7: Busy flag */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_SR_FRE (1 << 8) /* Bit 8: TI frame format error */ #endif @@ -221,7 +221,7 @@ /* I2S configuration register */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_I2SCFGR_CHLEN (1 << 0) /* Bit 0: Channel length (number of bits per audio channel) */ # define SPI_I2SCFGR_DATLEN_SHIFT (1) /* Bit 1-2: Data length to be transferred */ # define SPI_I2SCFGR_DATLEN_MASK (3 << SPI_I2SCFGR_DATLEN_SHIFT) @@ -249,7 +249,7 @@ /* I2S prescaler register */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_I2SPR_I2SDIV_SHIFT (0) /* Bit 0-7: I2S Linear prescaler */ # define SPI_I2SPR_I2SDIV_MASK (0xff << SPI_I2SPR_I2SDIV_SHIFT) # define SPI_I2SPR_ODD (1 << 8) /* Bit 8: Odd factor for the prescaler */ diff --git a/arch/arm/src/stm32/chip/stm32_tim.h b/arch/arm/src/stm32/chip/stm32_tim.h index f4113cd6ddc..c115dbb43af 100644 --- a/arch/arm/src/stm32/chip/stm32_tim.h +++ b/arch/arm/src/stm32/chip/stm32_tim.h @@ -214,7 +214,7 @@ # define STM32_TIM2_CCR4 (STM32_TIM2_BASE+STM32_GTIM_CCR4_OFFSET) # define STM32_TIM2_DCR (STM32_TIM2_BASE+STM32_GTIM_DCR_OFFSET) # define STM32_TIM2_DMAR (STM32_TIM2_BASE+STM32_GTIM_DMAR_OFFSET) -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_TIM2_OR (STM32_TIM2_BASE+STM32_GTIM_OR_OFFSET) # endif #endif @@ -280,7 +280,7 @@ # define STM32_TIM5_CCR4 (STM32_TIM5_BASE+STM32_GTIM_CCR4_OFFSET) # define STM32_TIM5_DCR (STM32_TIM5_BASE+STM32_GTIM_DCR_OFFSET) # define STM32_TIM5_DMAR (STM32_TIM5_BASE+STM32_GTIM_DMAR_OFFSET) -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_TIM5_OR (STM32_TIM5_BASE+STM32_GTIM_OR_OFFSET) # endif #endif @@ -829,7 +829,7 @@ #define ATIM_CCER_CC4P (1 << 13) /* Bit 13: Capture/Compare 4 output Polarity */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) # define ATIM_CCER_CC4NP (1 << 15) /* Bit 15: Capture/Compare 4 Complementary output polarity */ #elif defined(CONFIG_STM32_STM32F30XX) @@ -1283,7 +1283,7 @@ /* Timer 2/5 option register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define TIM2_OR_ITR1_RMP_SHIFT (10) /* Bits 10-11: Internal trigger 1 remap */ # define TIM2_OR_ITR1_RMP_MASK (3 << TIM2_OR_ITR1_RMP_SHIFT) # define TIM2_OR_ITR1_TIM8_TRGOUT (0 << TIM2_OR_ITR1_RMP_SHIFT) /* 00: TIM2_ITR1 input connected to TIM8_TRGOUT */ diff --git a/arch/arm/src/stm32/chip/stm32f40xxx_syscfg.h b/arch/arm/src/stm32/chip/stm32f40xxx_syscfg.h index 57068a2b8dd..98769f3dd44 100644 --- a/arch/arm/src/stm32/chip/stm32f40xxx_syscfg.h +++ b/arch/arm/src/stm32/chip/stm32f40xxx_syscfg.h @@ -46,7 +46,7 @@ #include #include "chip.h" -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX /**************************************************************************************************** * Pre-processor Definitions @@ -198,5 +198,5 @@ # define SYSCFG_CFGR_FMPI2C1_SDA (1 << 1) /* Bit 8: Forces FM+ drive capability on SDA */ #endif -#endif /* CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F4XXX */ #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32F40XXX_SYSCFG_H */ diff --git a/arch/arm/src/stm32/gnu/stm32_vectors.S b/arch/arm/src/stm32/gnu/stm32_vectors.S index 4943686dac4..b322d9e6cda 100644 --- a/arch/arm/src/stm32/gnu/stm32_vectors.S +++ b/arch/arm/src/stm32/gnu/stm32_vectors.S @@ -181,7 +181,7 @@ _vectors: # include "chip/stm32f33xxx_vectors.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_vectors.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" #else # error "No vectors for STM32 chip" @@ -228,7 +228,7 @@ handlers: # include "chip/stm32f33xxx_vectors.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_vectors.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" #else # error "No handlers for STM32 chip" diff --git a/arch/arm/src/stm32/iar/stm32_vectors.S b/arch/arm/src/stm32/iar/stm32_vectors.S index 52fdfb30568..eeaa2836b71 100644 --- a/arch/arm/src/stm32/iar/stm32_vectors.S +++ b/arch/arm/src/stm32/iar/stm32_vectors.S @@ -469,7 +469,7 @@ __vector_table: # include "chip/stm32f42xxx_vectors.h" #elif defined(CONFIG_STM32_STM32F446) # include "chip/stm32f44xxx_vectors.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" #else # error "No vectors for STM32 chip" @@ -788,7 +788,7 @@ handlers: # include "chip/stm32f42xxx_vectors.h" #elif defined(CONFIG_STM32_STM32F446) # include "chip/stm32f44xxx_vectors.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" #else # error "No handlers for STM32 chip" diff --git a/arch/arm/src/stm32/stm32_adc.c b/arch/arm/src/stm32/stm32_adc.c index 43e349eff0a..d3ec74fb3cf 100644 --- a/arch/arm/src/stm32/stm32_adc.c +++ b/arch/arm/src/stm32/stm32_adc.c @@ -82,7 +82,7 @@ #if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) /* At the moment there is no proper implementation for timers external @@ -125,7 +125,7 @@ #elif defined(CONFIG_STM32_STM32F37XX) # define STM32_RCC_RSTR STM32_RCC_APB2RSTR # define RCC_RSTR_ADC1RST RCC_APB2RSTR_ADCRST -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_RCC_RSTR STM32_RCC_APB2RSTR # define RCC_RSTR_ADC1RST RCC_APB2RSTR_ADCRST # define RCC_RSTR_ADC2RST RCC_APB2RSTR_ADCRST @@ -205,7 +205,7 @@ # endif #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ADC_DMA_CONTROL_WORD (DMA_SCR_MSIZE_16BITS | \ DMA_SCR_PSIZE_16BITS | \ DMA_SCR_MINC | \ @@ -266,7 +266,7 @@ (ADC_SMPR_DEFAULT << ADC_SMPR2_SMP17_SHIFT) | \ (ADC_SMPR_DEFAULT << ADC_SMPR2_SMP18_SHIFT)) #elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) # if defined(CONFIG_STM32_STM32F37XX) # define ADC_SMPR_DEFAULT ADC_SMPR_239p5 /* TODO choose 1p5? */ # else @@ -353,7 +353,7 @@ struct stm32_dev_s #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ defined(CONFIG_STM32_STM32F33XX) || defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) static void stm32_modifyreg32(unsigned int addr, uint32_t clrbits, uint32_t setbits); #endif @@ -621,7 +621,7 @@ static struct adc_dev_s g_adcdev4 = #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ defined(CONFIG_STM32_STM32F33XX) || defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) static void stm32_modifyreg32(unsigned int addr, uint32_t clrbits, uint32_t setbits) { @@ -1154,7 +1154,7 @@ static int adc_timinit(FAR struct stm32_dev_s *priv) # if defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) ccer &= ~(ATIM_CCER_CC1NE | ATIM_CCER_CC1NP | ATIM_CCER_CC2NE | ATIM_CCER_CC2NP | ATIM_CCER_CC3NE | ATIM_CCER_CC3NP | @@ -1174,7 +1174,7 @@ static int adc_timinit(FAR struct stm32_dev_s *priv) } # if defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) else { ccer &= ~(GTIM_CCER_CC1NP | GTIM_CCER_CC2NP | GTIM_CCER_CC3NP); @@ -2000,12 +2000,12 @@ static void adc_reset(FAR struct adc_dev_s *dev) } #endif #elif defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) clrbits = ADC_CCR_ADCPRE_MASK | ADC_CCR_TSVREFE; setbits = ADC_CCR_ADCPRE_DIV2; -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) clrbits |= ADC_CCR_MULTI_MASK | ADC_CCR_DELAY_MASK | ADC_CCR_DDS | ADC_CCR_DMA_MASK | ADC_CCR_VBATE; setbits |= ADC_CCR_MULTI_NONE | ADC_CCR_DMA_DISABLED; @@ -2103,7 +2103,7 @@ static void adc_reset(FAR struct adc_dev_s *dev) } #endif #elif defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) ainfo("CCR: 0x%08x\n", getreg32(STM32_ADC_CCR)); #endif @@ -3104,7 +3104,7 @@ struct adc_dev_s *stm32_adcinitialize(int intf, FAR const uint8_t *chanlist, #endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || * CONFIG_STM32_STM32F30XX || CONFIG_STM32_STM32F33XX || - * CONFIG_STM32_STM32F47XX || CONFIG_STM32_STM32F40XX || + * CONFIG_STM32_STM32F47XX || CONFIG_STM32_STM32F4XXX || * CONFIG_STM32_STM32L15XX */ #endif /* CONFIG_STM32_ADC1 || CONFIG_STM32_ADC2 || diff --git a/arch/arm/src/stm32/stm32_adc.h b/arch/arm/src/stm32/stm32_adc.h index 03ffaecbc01..53571eb99e5 100644 --- a/arch/arm/src/stm32/stm32_adc.h +++ b/arch/arm/src/stm32/stm32_adc.h @@ -112,7 +112,7 @@ # undef CONFIG_STM32_TIM4_ADC4 #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # ifndef CONFIG_STM32_TIM5 # undef CONFIG_STM32_TIM5_ADC # undef CONFIG_STM32_TIM5_ADC1 @@ -129,7 +129,7 @@ #endif #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) # ifndef CONFIG_STM32_TIM8 # undef CONFIG_STM32_TIM8_ADC # undef CONFIG_STM32_TIM8_ADC1 diff --git a/arch/arm/src/stm32/stm32_allocateheap.c b/arch/arm/src/stm32/stm32_allocateheap.c index a6a91612441..fcf53ea329a 100644 --- a/arch/arm/src/stm32/stm32_allocateheap.c +++ b/arch/arm/src/stm32/stm32_allocateheap.c @@ -348,7 +348,7 @@ * In addition, external FSMC SRAM may be available. */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /* The STM32 F2 and the STM32 F401/F411 have no CCM SRAM */ diff --git a/arch/arm/src/stm32/stm32_bbsram.h b/arch/arm/src/stm32/stm32_bbsram.h index bcb813d6fa1..8edc3c60b13 100644 --- a/arch/arm/src/stm32/stm32_bbsram.h +++ b/arch/arm/src/stm32/stm32_bbsram.h @@ -59,7 +59,7 @@ * Pre-processor Definitions ****************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_BBSRAM_SIZE 4096 #else # error No backup SRAM on this STM32 diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c index 9e23a48f36a..1f9a06b600c 100644 --- a/arch/arm/src/stm32/stm32_can.c +++ b/arch/arm/src/stm32/stm32_can.c @@ -1952,7 +1952,7 @@ static int stm32can_filterinit(FAR struct stm32_can_s *priv) #if defined(CONFIG_STM32_CONNECTIVITYLINE) || \ defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) regval = stm32can_getfreg(priv, STM32_CAN_FMR_OFFSET); regval &= CAN_FMR_CAN2SB_MASK; regval |= (CAN_NFILTERS / 2) << CAN_FMR_CAN2SB_SHIFT; diff --git a/arch/arm/src/stm32/stm32_ccm.h b/arch/arm/src/stm32/stm32_ccm.h index 20cc650eee8..2f73021cd4c 100644 --- a/arch/arm/src/stm32/stm32_ccm.h +++ b/arch/arm/src/stm32/stm32_ccm.h @@ -58,7 +58,7 @@ #if defined(CONFIG_STM32_STM32F30XX) # define CCM_START 0x10000000 # define CCM_END 0x10002000 -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || \ +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32F33XX) # define CCM_START 0x10000000 # define CCM_END 0x10010000 diff --git a/arch/arm/src/stm32/stm32_dac.c b/arch/arm/src/stm32/stm32_dac.c index e12c9f65c5f..bc997e48c37 100644 --- a/arch/arm/src/stm32/stm32_dac.c +++ b/arch/arm/src/stm32/stm32_dac.c @@ -100,7 +100,7 @@ # undef CONFIG_STM32_DAC1_DMA # undef CONFIG_STM32_DAC2_DMA # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # ifndef CONFIG_STM32_DMA1 # warning "STM32 F4 DAC DMA support requires CONFIG_STM32_DMA1" # undef CONFIG_STM32_DAC1_DMA @@ -153,7 +153,7 @@ # define DAC_DMA 2 # define DAC1_DMA_CHAN DMACHAN_DAC_CHAN1 # define DAC2_DMA_CHAN DMACHAN_DAC_CHAN2 -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || \ +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32F33XX) # define HAVE_DMA 1 # define DAC_DMA 1 @@ -320,7 +320,7 @@ /* DMA stream/channel configuration */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define DAC_DMA_CONTROL_WORD (DMA_SCR_MSIZE_16BITS | \ DMA_SCR_PSIZE_16BITS | \ DMA_SCR_MINC | \ @@ -381,7 +381,7 @@ static void tim_putreg(FAR struct stm32_chan_s *chan, int offset, /* Interrupt handler */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) static int dac_interrupt(int irq, FAR void *context, FAR void *arg); #endif @@ -620,7 +620,7 @@ static void tim_modifyreg(FAR struct stm32_chan_s *chan, int offset, * ****************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) static int dac_interrupt(int irq, FAR void *context, FAR void *arg) { #warning "Missing logic" diff --git a/arch/arm/src/stm32/stm32_dma.c b/arch/arm/src/stm32/stm32_dma.c index 9118c586d48..64553a7d5c2 100644 --- a/arch/arm/src/stm32/stm32_dma.c +++ b/arch/arm/src/stm32/stm32_dma.c @@ -62,6 +62,6 @@ # include "stm32f33xxx_dma.c" #elif defined(CONFIG_STM32_STM32F20XX) # include "stm32f20xxx_dma.c" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "stm32f40xxx_dma.c" #endif diff --git a/arch/arm/src/stm32/stm32_dma.h b/arch/arm/src/stm32/stm32_dma.h index ceee4e0867c..5a84034889b 100644 --- a/arch/arm/src/stm32/stm32_dma.h +++ b/arch/arm/src/stm32/stm32_dma.h @@ -54,7 +54,7 @@ # include "chip/stm32f33xxx_dma.h" #elif defined(CONFIG_STM32_STM32F20XX) # include "chip/stm32f20xxx_dma.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_dma.h" #else # error "Unknown STM32 DMA" @@ -72,7 +72,7 @@ # define DMA_STATUS_TEIF DMA_CHAN_TEIF_BIT /* Channel Transfer Error */ # define DMA_STATUS_HTIF DMA_CHAN_HTIF_BIT /* Channel Half Transfer */ # define DMA_STATUS_TCIF DMA_CHAN_TCIF_BIT /* Channel Transfer Complete */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define DMA_STATUS_FEIF 0 /* Stream FIFO error (ignored) */ # define DMA_STATUS_DMEIF DMA_STREAM_DMEIF_BIT /* Stream direct mode error */ # define DMA_STATUS_TEIF DMA_STREAM_TEIF_BIT /* Stream Transfer Error */ @@ -119,7 +119,7 @@ struct stm32_dmaregs_s uint32_t cpar; uint32_t cmar; }; -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) struct stm32_dmaregs_s { uint32_t lisr; diff --git a/arch/arm/src/stm32/stm32_dumpgpio.c b/arch/arm/src/stm32/stm32_dumpgpio.c index 2540ffdcbcc..da1fbd00278 100644 --- a/arch/arm/src/stm32/stm32_dumpgpio.c +++ b/arch/arm/src/stm32/stm32_dumpgpio.c @@ -196,7 +196,7 @@ int stm32_dumpgpio(uint32_t pinset, const char *msg) getreg32(base + STM32_GPIO_AFRL_OFFSET), getreg32(base + STM32_GPIO_BRR_OFFSET)); -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) DEBUGASSERT(port < STM32_NGPIO_PORTS); _info("GPIO%c pinset: %08x base: %08x -- %s\n", diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 77493cd880c..62e44a0ff23 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -125,7 +125,7 @@ #endif #ifdef CONFIG_STM32_MII -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if !defined(CONFIG_STM32_MII_MCO1) && !defined(CONFIG_STM32_MII_MCO2) && !defined(CONFIG_STM32_MII_EXTCLK) # warning "Neither CONFIG_STM32_MII_MCO1, CONFIG_STM32_MII_MCO2, nor CONFIG_STM32_MII_EXTCLK defined" # endif @@ -140,7 +140,7 @@ #endif #ifdef CONFIG_STM32_RMII -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if !defined(CONFIG_STM32_RMII_MCO1) && !defined(CONFIG_STM32_RMII_MCO2) && !defined(CONFIG_STM32_RMII_EXTCLK) # warning "Neither CONFIG_STM32_RMII_MCO1, CONFIG_STM32_RMII_MCO2, nor CONFIG_STM32_RMII_EXTCLK defined" # endif @@ -344,7 +344,7 @@ * ETH_MACCR_CSTF Bits 25: CRC stripping for Type frames (F2/F4 only) */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) #define MACCR_CLEAR_BITS \ (ETH_MACCR_RE | ETH_MACCR_TE | ETH_MACCR_DC | ETH_MACCR_BL_MASK | \ ETH_MACCR_APCS | ETH_MACCR_RD | ETH_MACCR_IPCO | ETH_MACCR_DM | \ @@ -531,7 +531,7 @@ * ETH_DMABMR_MB Bit 26: Mixed burst (F2/F4 only) */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) #define DMABMR_CLEAR_MASK \ (ETH_DMABMR_SR | ETH_DMABMR_DA | ETH_DMABMR_DSL_MASK | ETH_DMABMR_EDFE | \ ETH_DMABMR_PBL_MASK | ETH_DMABMR_RTPR_MASK | ETH_DMABMR_FB | ETH_DMABMR_RDP_MASK | \ diff --git a/arch/arm/src/stm32/stm32_flash.c b/arch/arm/src/stm32/stm32_flash.c index 6291154cc07..e43d4a5185f 100644 --- a/arch/arm/src/stm32/stm32_flash.c +++ b/arch/arm/src/stm32/stm32_flash.c @@ -62,10 +62,10 @@ /* Only for the STM32F[1|3|4]0xx family and STM32L15xx (EEPROM only) for now */ #if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined (CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined (CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) #if defined(CONFIG_STM32_FLASH_CONFIG_DEFAULT) && \ - (defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX)) + (defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX)) # warning "Default Flash Configuration Used - See Override Flash Size Designator" #endif @@ -86,7 +86,7 @@ #if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) # define FLASH_CR_PAGE_ERASE FLASH_CR_PER # define FLASH_SR_WRITE_PROTECTION_ERROR FLASH_SR_WRPRT_ERR -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # define FLASH_CR_PAGE_ERASE FLASH_CR_SER # define FLASH_SR_WRITE_PROTECTION_ERROR FLASH_SR_WRPERR #endif @@ -394,13 +394,13 @@ ssize_t stm32_eeprom_erase(size_t addr, size_t eraselen) * ************************************************************************************/ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX int stm32_flash_writeprotect(size_t page, bool enabled) { uint32_t reg; uint32_t val; -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX if (page >= STM32_FLASH_NPAGES) { return -EFAULT; @@ -415,7 +415,7 @@ int stm32_flash_writeprotect(size_t page, bool enabled) { reg = STM32_FLASH_OPTCR; } -#if defined(CONFIG_STM32_FLASH_CONFIG_I) && defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_FLASH_CONFIG_I) && defined(CONFIG_STM32_STM32F4XXX) else { reg = STM32_FLASH_OPTCR1; @@ -500,7 +500,7 @@ size_t up_progmem_getaddress(size_t page) #endif /* defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) */ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX size_t up_progmem_pagesize(size_t page) { @@ -561,7 +561,7 @@ size_t up_progmem_getaddress(size_t page) return base_address; } -#endif /* def CONFIG_STM32_STM32F40XX */ +#endif /* def CONFIG_STM32_STM32F4XXX */ #if !defined(CONFIG_STM32_STM32L15XX) @@ -592,7 +592,7 @@ ssize_t up_progmem_erasepage(size_t page) sem_lock(); -#if !defined(CONFIG_STM32_STM32F40XX) +#if !defined(CONFIG_STM32_STM32F4XXX) if (!(getreg32(STM32_RCC_CR) & RCC_CR_HSION)) { sem_unlock(); @@ -612,7 +612,7 @@ ssize_t up_progmem_erasepage(size_t page) page_address = up_progmem_getaddress(page); putreg32(page_address, STM32_FLASH_AR); -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) modifyreg32(STM32_FLASH_CR, FLASH_CR_SNB_MASK, FLASH_CR_SNB(page)); #endif @@ -685,7 +685,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count) sem_lock(); -#if !defined(CONFIG_STM32_STM32F40XX) +#if !defined(CONFIG_STM32_STM32F4XXX) if (!(getreg32(STM32_RCC_CR) & RCC_CR_HSION)) { sem_unlock(); @@ -703,7 +703,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count) modifyreg32(STM32_FLASH_CR, 0, FLASH_CR_PG); -#if defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F4XXX) /* TODO: implement up_progmem_write() to support other sizes than 16-bits */ modifyreg32(STM32_FLASH_CR, FLASH_CR_PSIZE_MASK, FLASH_CR_PSIZE_X16); #endif @@ -746,4 +746,4 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count) #endif /* !defined(CONFIG_STM32_STM32L15XX) */ #endif /* defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) */ + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) */ diff --git a/arch/arm/src/stm32/stm32_fsmc.h b/arch/arm/src/stm32/stm32_fsmc.h index f865c00b5a7..330f47d062e 100644 --- a/arch/arm/src/stm32/stm32_fsmc.h +++ b/arch/arm/src/stm32/stm32_fsmc.h @@ -187,7 +187,7 @@ #define FSMC_BCR_WREN (1 << 12) /* Write enable bit */ #define FSMC_BCR_WAITEN (1 << 13) /* Wait enable bit */ #define FSMC_BCR_EXTMOD (1 << 14) /* Extended mode enable */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FSMC_BCR_ASYNCWAIT (1 << 15) /* Wait signal during asynchronous transfers */ #endif #define FSMC_BCR_CBURSTRW (1 << 19) /* Write burst enable */ diff --git a/arch/arm/src/stm32/stm32_gpio.c b/arch/arm/src/stm32/stm32_gpio.c index 9eb5fb9597b..727f0c943a5 100644 --- a/arch/arm/src/stm32/stm32_gpio.c +++ b/arch/arm/src/stm32/stm32_gpio.c @@ -56,7 +56,7 @@ #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32_syscfg.h" #endif @@ -428,7 +428,7 @@ int stm32_configgpio(uint32_t cfgset) #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) int stm32_configgpio(uint32_t cfgset) { uintptr_t base; @@ -683,7 +683,7 @@ int stm32_unconfiggpio(uint32_t cfgset) cfgset |= GPIO_INPUT | GPIO_CNF_INFLOAT | GPIO_MODE_INPUT; #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) cfgset |= GPIO_INPUT | GPIO_FLOAT; #else # error "Unsupported STM32 chip" @@ -709,7 +709,7 @@ void stm32_gpiowrite(uint32_t pinset, bool value) uint32_t offset; #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) uint32_t bit; #endif unsigned int port; @@ -743,7 +743,7 @@ void stm32_gpiowrite(uint32_t pinset, bool value) #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) if (value) { diff --git a/arch/arm/src/stm32/stm32_gpio.h b/arch/arm/src/stm32/stm32_gpio.h index 0385d1e9519..c08b9a92987 100644 --- a/arch/arm/src/stm32/stm32_gpio.h +++ b/arch/arm/src/stm32/stm32_gpio.h @@ -62,7 +62,7 @@ #elif defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f30xxx_gpio.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_gpio.h" #else # error "Unrecognized STM32 chip" @@ -203,7 +203,7 @@ #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) /* Each port bit of the general-purpose I/O (GPIO) ports can be individually configured * by software in several modes: diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index 5f3e1c2c5c9..99b923eb154 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -105,7 +105,7 @@ /* Experimentally enabled for STM32L15XX */ #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F10XX) || \ - defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /************************************************************************************ * Pre-processor Definitions @@ -155,7 +155,7 @@ #elif defined(CONFIG_STM32_STM32F10XX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD | \ GPIO_MODE_50MHz) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_FLOAT | GPIO_OPENDRAIN |\ GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) #endif @@ -1345,7 +1345,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) * the F1 in that BTF is not set after data is received (only RXNE). */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || \ +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) if (priv->dcnt <= 0 && (status & (I2C_SR1_BTF | I2C_SR1_RXNE)) != 0) #else @@ -2003,5 +2003,5 @@ int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev) return OK; } -#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F4XXX */ #endif /* CONFIG_STM32_I2C1 || CONFIG_STM32_I2C2 || CONFIG_STM32_I2C3 */ diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index 21f66967323..6aba636db6f 100644 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -112,7 +112,7 @@ /* Experimentally enabled for STM32L15XX */ #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F10XX) || \ - defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /************************************************************************************ * Pre-processor Definitions @@ -162,7 +162,7 @@ #elif defined(CONFIG_STM32_STM32F10XX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD | \ GPIO_MODE_50MHz) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_FLOAT | GPIO_OPENDRAIN |\ GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) #endif @@ -2451,5 +2451,5 @@ int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev) return OK; } -#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F4XXX */ #endif /* CONFIG_STM32_I2C1 || CONFIG_STM32_I2C2 || CONFIG_STM32_I2C3 */ diff --git a/arch/arm/src/stm32/stm32_i2s.c b/arch/arm/src/stm32/stm32_i2s.c index 1f5d348384c..60d4a8174b5 100644 --- a/arch/arm/src/stm32/stm32_i2s.c +++ b/arch/arm/src/stm32/stm32_i2s.c @@ -153,7 +153,7 @@ # define SPI_DMA_PRIO CONFIG_SPI_DMAPRIO # elif defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32L15XX) # define SPI_DMA_PRIO DMA_CCR_PRIMED -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_DMA_PRIO DMA_SCR_PRIMED # else # error "Unknown STM32 DMA" @@ -163,7 +163,7 @@ # if (SPI_DMA_PRIO & ~DMA_CCR_PL_MASK) != 0 # error "Illegal value for CONFIG_SPI_DMAPRIO" # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if (SPI_DMA_PRIO & ~DMA_SCR_PL_MASK) != 0 # error "Illegal value for CONFIG_SPI_DMAPRIO" # endif @@ -185,7 +185,7 @@ # define SPI_TXDMA8_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_8BITS |DMA_CCR_MINC|DMA_CCR_DIR) # define SPI_TXDMA16NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_16BITS |DMA_CCR_DIR) # define SPI_TXDMA8NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_8BITS |DMA_CCR_DIR) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_RXDMA16_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_16BITS|DMA_SCR_PSIZE_16BITS|DMA_SCR_MINC|DMA_SCR_DIR_P2M) # define SPI_RXDMA8_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_8BITS |DMA_SCR_PSIZE_8BITS |DMA_SCR_MINC|DMA_SCR_DIR_P2M) # define SPI_RXDMA16NULL_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_8BITS |DMA_SCR_PSIZE_16BITS |DMA_SCR_DIR_P2M) diff --git a/arch/arm/src/stm32/stm32_iwdg.c b/arch/arm/src/stm32/stm32_iwdg.c index 7b114fefa59..d26ec9f71a3 100644 --- a/arch/arm/src/stm32/stm32_iwdg.c +++ b/arch/arm/src/stm32/stm32_iwdg.c @@ -691,7 +691,7 @@ void stm32_iwdginitialize(FAR const char *devpath, uint32_t lsifreq) defined(CONFIG_STM32_JTAG_SW_ENABLE) { #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) uint32_t cr = getreg32(STM32_DBGMCU_APB1_FZ); cr |= DBGMCU_APB1_IWDGSTOP; putreg32(cr, STM32_DBGMCU_APB1_FZ); diff --git a/arch/arm/src/stm32/stm32_lowputc.c b/arch/arm/src/stm32/stm32_lowputc.c index 856879454a0..63e70904345 100644 --- a/arch/arm/src/stm32/stm32_lowputc.c +++ b/arch/arm/src/stm32/stm32_lowputc.c @@ -572,7 +572,7 @@ void stm32_lowsetup(void) #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) void stm32_lowsetup(void) { diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 8f66239a11d..0e9db500594 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -89,7 +89,7 @@ #else # define TIMTYPE_TIM2 TIMTYPE_GENERAL32 #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define TIMTYPE_TIM3 TIMTYPE_GENERAL32 # define TIMTYPE_TIM4 TIMTYPE_GENERAL32 #else @@ -1719,7 +1719,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) ccer &= ~(ATIM_CCER_CC1NE | ATIM_CCER_CC1NP | ATIM_CCER_CC2NE | ATIM_CCER_CC2NP | ATIM_CCER_CC3NE | ATIM_CCER_CC3NP | ATIM_CCER_CC4NP); #else @@ -1742,12 +1742,12 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, pwm_putreg(priv, STM32_ATIM_BDTR_OFFSET, bdtr); } #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) else #endif #endif #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) { /* CCxNP must be cleared in any case */ @@ -2284,7 +2284,7 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) #elif defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || \ defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) pincfg |= GPIO_INPUT | GPIO_FLOAT; #else diff --git a/arch/arm/src/stm32/stm32_pwr.c b/arch/arm/src/stm32/stm32_pwr.c index 2b0ed2a14cf..be9f2771154 100644 --- a/arch/arm/src/stm32/stm32_pwr.c +++ b/arch/arm/src/stm32/stm32_pwr.c @@ -248,7 +248,7 @@ void stm32_pwr_enablebkp(bool writable) * ************************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) void stm32_pwr_enablebreg(bool regon) { uint16_t regval; diff --git a/arch/arm/src/stm32/stm32_pwr.h b/arch/arm/src/stm32/stm32_pwr.h index 19af928f145..dc4be9a1fe0 100644 --- a/arch/arm/src/stm32/stm32_pwr.h +++ b/arch/arm/src/stm32/stm32_pwr.h @@ -146,7 +146,7 @@ void stm32_pwr_enablebkp(bool writable); * ************************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) void stm32_pwr_enablebreg(bool regon); #else # define stm32_pwr_enablebreg(regon) diff --git a/arch/arm/src/stm32/stm32_qencoder.c b/arch/arm/src/stm32/stm32_qencoder.c index 126ef24987c..09ed7669a0a 100644 --- a/arch/arm/src/stm32/stm32_qencoder.c +++ b/arch/arm/src/stm32/stm32_qencoder.c @@ -115,7 +115,7 @@ /* On the F4 series, TIM2 and TIM5 are 32-bit. All of the rest are 16-bit */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /* If TIM2 or TIM5 are enabled, then we have 32-bit timers */ @@ -212,7 +212,7 @@ GPIO_MODE_INPUT) #elif defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) # define STM32_GPIO_INPUT_FLOAT (GPIO_INPUT | GPIO_FLOAT) #else # error "Unrecognized STM32 chip" diff --git a/arch/arm/src/stm32/stm32_rcc.c b/arch/arm/src/stm32/stm32_rcc.c index be152ff8d85..2ed39f9a5ea 100644 --- a/arch/arm/src/stm32/stm32_rcc.c +++ b/arch/arm/src/stm32/stm32_rcc.c @@ -86,7 +86,7 @@ # include "stm32f33xxx_rcc.c" #elif defined(CONFIG_STM32_STM32F37XX) # include "stm32f37xxx_rcc.c" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "stm32f40xxx_rcc.c" #else # error "Unsupported STM32 chip" diff --git a/arch/arm/src/stm32/stm32_rcc.h b/arch/arm/src/stm32/stm32_rcc.h index 79949cd60ca..c1b72815787 100644 --- a/arch/arm/src/stm32/stm32_rcc.h +++ b/arch/arm/src/stm32/stm32_rcc.h @@ -57,7 +57,7 @@ # include "chip/stm32f33xxx_rcc.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_rcc.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_rcc.h" #endif @@ -113,7 +113,7 @@ extern uint32_t _vectors[]; /* See stm32_vectors.S */ * ************************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) static inline void stm32_mco1config(uint32_t source, uint32_t div) { uint32_t regval; @@ -214,7 +214,7 @@ static inline void stm32_mcodivconfig(uint32_t source, uint32_t divider) * ************************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) static inline void stm32_mco2config(uint32_t source, uint32_t div) { uint32_t regval; diff --git a/arch/arm/src/stm32/stm32_rtc.c b/arch/arm/src/stm32/stm32_rtc.c index 3e8dc0b0d78..f26417b0d97 100644 --- a/arch/arm/src/stm32/stm32_rtc.c +++ b/arch/arm/src/stm32/stm32_rtc.c @@ -66,6 +66,6 @@ #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) # include "stm32_rtcc.c" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "stm32f40xxx_rtcc.c" #endif diff --git a/arch/arm/src/stm32/stm32_rtc.h b/arch/arm/src/stm32/stm32_rtc.h index 6271a97ed79..81daa926599 100644 --- a/arch/arm/src/stm32/stm32_rtc.h +++ b/arch/arm/src/stm32/stm32_rtc.h @@ -60,13 +60,13 @@ */ #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32_rtcc.h" #endif /* Alarm function differs from part to part */ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX # include "stm32f40xxx_alarm.h" #else # include "stm32_alarm.h" diff --git a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c index 6a8c0793998..29af5d8c151 100644 --- a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c +++ b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c @@ -60,7 +60,7 @@ * Pre-processor Definitions ****************************************************************************/ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX # define STM32_NALARMS 2 #else # define STM32_NALARMS 1 @@ -75,7 +75,7 @@ struct stm32_cbinfo_s { volatile rtc_alarm_callback_t cb; /* Callback when the alarm expires */ volatile FAR void *priv; /* Private argurment to accompany callback */ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX uint8_t id; /* Identifies the alarm */ #endif }; @@ -174,7 +174,7 @@ static struct stm32_lowerhalf_s g_rtc_lowerhalf = ****************************************************************************/ #ifdef CONFIG_RTC_ALARM -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX static void stm32_alarm_callback(FAR void *arg, unsigned int alarmid) { FAR struct stm32_lowerhalf_s *lower; @@ -229,7 +229,7 @@ static void stm32_alarm_callback(void) } } -#endif /* CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F4XXX */ #endif /* CONFIG_RTC_ALARM */ /**************************************************************************** @@ -393,7 +393,7 @@ static bool stm32_havesettime(FAR struct rtc_lowerhalf_s *lower) static int stm32_setalarm(FAR struct rtc_lowerhalf_s *lower, FAR const struct lower_setalarm_s *alarminfo) { -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX FAR struct stm32_lowerhalf_s *priv; FAR struct stm32_cbinfo_s *cbinfo; struct alm_setalarm_s lowerinfo; @@ -492,7 +492,7 @@ static int stm32_setalarm(FAR struct rtc_lowerhalf_s *lower, static int stm32_setrelative(FAR struct rtc_lowerhalf_s *lower, FAR const struct lower_setrelative_s *alarminfo) { -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX struct lower_setalarm_s setalarm; struct tm time; time_t seconds; @@ -643,7 +643,7 @@ static int stm32_setrelative(FAR struct rtc_lowerhalf_s *lower, #ifdef CONFIG_RTC_ALARM static int stm32_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid) { -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX FAR struct stm32_lowerhalf_s *priv; FAR struct stm32_cbinfo_s *cbinfo; int ret = -EINVAL; diff --git a/arch/arm/src/stm32/stm32_sdio.c b/arch/arm/src/stm32/stm32_sdio.c index db95c008e91..e5d3c22ecb5 100644 --- a/arch/arm/src/stm32/stm32_sdio.c +++ b/arch/arm/src/stm32/stm32_sdio.c @@ -126,7 +126,7 @@ # ifndef CONFIG_STM32_SDIO_DMAPRIO # if defined(CONFIG_STM32_STM32F10XX) # define CONFIG_STM32_SDIO_DMAPRIO DMA_CCR_PRIMED -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CONFIG_STM32_SDIO_DMAPRIO DMA_SCR_PRIVERYHI # else # error "Unknown STM32 DMA" @@ -136,7 +136,7 @@ # if (CONFIG_STM32_SDIO_DMAPRIO & ~DMA_CCR_PL_MASK) != 0 # error "Illegal value for CONFIG_STM32_SDIO_DMAPRIO" # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if (CONFIG_STM32_SDIO_DMAPRIO & ~DMA_SCR_PL_MASK) != 0 # error "Illegal value for CONFIG_STM32_SDIO_DMAPRIO" # endif @@ -207,7 +207,7 @@ /* STM32 F4 stream configuration register (SCR) settings. */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SDIO_RXDMA32_CONFIG (DMA_SCR_PFCTRL | DMA_SCR_DIR_P2M|DMA_SCR_MINC | \ DMA_SCR_PSIZE_32BITS | DMA_SCR_MSIZE_32BITS | \ CONFIG_STM32_SDIO_DMAPRIO | DMA_SCR_PBURST_INCR4 | \ @@ -227,7 +227,7 @@ #if defined(CONFIG_STM32_STM32F10XX) # define SDIO_DMACHAN DMACHAN_SDIO -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SDIO_DMACHAN DMAMAP_SDIO #else # error "Unknown STM32 DMA" @@ -2649,7 +2649,7 @@ static int stm32_registercallback(FAR struct sdio_dev_s *dev, static int stm32_dmapreflight(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, size_t buflen) { -#if !defined(CONFIG_STM32_STM32F40XX) +#if !defined(CONFIG_STM32_STM32F4XXX) struct stm32_dev_s *priv = (struct stm32_dev_s *)dev; DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0); diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index 7aa362c38f5..8e484dc1a3a 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -80,7 +80,7 @@ #ifdef SERIAL_HAVE_DMA -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /* Verify that DMA has been enabled and the DMA channel has been defined. */ @@ -198,7 +198,7 @@ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ defined(CONFIG_STM32_STM32F37XX) # define CONFIG_USART_DMAPRIO DMA_CCR_PRIMED -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CONFIG_USART_DMAPRIO DMA_SCR_PRIMED # else # error "Unknown STM32 DMA" @@ -210,7 +210,7 @@ # if (CONFIG_USART_DMAPRIO & ~DMA_CCR_PL_MASK) != 0 # error "Illegal value for CONFIG_USART_DMAPRIO" # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if (CONFIG_USART_DMAPRIO & ~DMA_SCR_PL_MASK) != 0 # error "Illegal value for CONFIG_USART_DMAPRIO" # endif @@ -220,7 +220,7 @@ /* DMA control word */ -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SERIAL_DMA_CONTROL_WORD \ (DMA_SCR_DIR_P2M | \ DMA_SCR_CIRC | \ @@ -1265,7 +1265,7 @@ static void up_set_format(struct uart_dev_s *dev) fraction = (usartdiv32 - (mantissa << 5) + 1) >> 1; -#if defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F4XXX) /* The F4 supports 8 X in oversampling additional to the * standard oversampling by 16. * diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index 3a4a7c8bf98..cab5655be30 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -111,7 +111,7 @@ # define SPI_DMA_PRIO CONFIG_SPI_DMAPRIO # elif defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32L15XX) # define SPI_DMA_PRIO DMA_CCR_PRIMED -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_DMA_PRIO DMA_SCR_PRIMED # else # error "Unknown STM32 DMA" @@ -121,7 +121,7 @@ # if (SPI_DMA_PRIO & ~DMA_CCR_PL_MASK) != 0 # error "Illegal value for CONFIG_SPI_DMAPRIO" # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if (SPI_DMA_PRIO & ~DMA_SCR_PL_MASK) != 0 # error "Illegal value for CONFIG_SPI_DMAPRIO" # endif @@ -143,7 +143,7 @@ # define SPI_TXDMA8_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_8BITS |DMA_CCR_MINC|DMA_CCR_DIR) # define SPI_TXDMA16NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_16BITS |DMA_CCR_DIR) # define SPI_TXDMA8NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_8BITS |DMA_CCR_DIR) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_RXDMA16_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_16BITS|DMA_SCR_PSIZE_16BITS|DMA_SCR_MINC|DMA_SCR_DIR_P2M) # define SPI_RXDMA8_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_8BITS |DMA_SCR_PSIZE_8BITS |DMA_SCR_MINC|DMA_SCR_DIR_P2M) # define SPI_RXDMA16NULL_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_8BITS |DMA_SCR_PSIZE_16BITS |DMA_SCR_DIR_P2M) diff --git a/arch/arm/src/stm32/stm32_syscfg.h b/arch/arm/src/stm32/stm32_syscfg.h index 9d832b0f2ea..917de13031c 100644 --- a/arch/arm/src/stm32/stm32_syscfg.h +++ b/arch/arm/src/stm32/stm32_syscfg.h @@ -53,7 +53,7 @@ # include "chip/stm32f33xxx_syscfg.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_syscfg.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_syscfg.h" #endif diff --git a/arch/arm/src/stm32/stm32_tim_lowerhalf.c b/arch/arm/src/stm32/stm32_tim_lowerhalf.c index cea5e2c2726..21e7fbaf713 100644 --- a/arch/arm/src/stm32/stm32_tim_lowerhalf.c +++ b/arch/arm/src/stm32/stm32_tim_lowerhalf.c @@ -73,7 +73,7 @@ #else # define STM32_TIM2_RES 32 #endif -#if defined(CONFIG_STM32_STM32L20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32L20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_TIM3_RES 32 # define STM32_TIM4_RES 32 #else diff --git a/arch/arm/src/stm32/stm32_uart.h b/arch/arm/src/stm32/stm32_uart.h index fe2542cfa69..e7c058ba6c7 100644 --- a/arch/arm/src/stm32/stm32_uart.h +++ b/arch/arm/src/stm32/stm32_uart.h @@ -53,7 +53,7 @@ #elif defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f30xxx_uart.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_uart.h" #else # error "Unsupported STM32 UART" diff --git a/arch/arm/src/stm32/stm32_wwdg.c b/arch/arm/src/stm32/stm32_wwdg.c index c0cb34f1f71..79d34656dae 100644 --- a/arch/arm/src/stm32/stm32_wwdg.c +++ b/arch/arm/src/stm32/stm32_wwdg.c @@ -790,7 +790,7 @@ void stm32_wwdginitialize(FAR const char *devpath) defined(CONFIG_STM32_JTAG_SW_ENABLE) { #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) uint32_t cr = getreg32(STM32_DBGMCU_APB1_FZ); cr |= DBGMCU_APB1_WWDGSTOP; putreg32(cr, STM32_DBGMCU_APB1_FZ); diff --git a/arch/arm/src/stm32/stm32f40xxx_dma.c b/arch/arm/src/stm32/stm32f40xxx_dma.c index 1824c76bf46..54a0a978456 100644 --- a/arch/arm/src/stm32/stm32f40xxx_dma.c +++ b/arch/arm/src/stm32/stm32f40xxx_dma.c @@ -59,7 +59,7 @@ * as well?) */ -#if defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F4XXX) /**************************************************************************** * Pre-processor Definitions @@ -1050,4 +1050,4 @@ void stm32_dmadump(DMA_HANDLE handle, const struct stm32_dmaregs_s *regs, } #endif -#endif /* CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F4XXX */ diff --git a/arch/arm/src/stm32/stm32f40xxx_i2c.c b/arch/arm/src/stm32/stm32f40xxx_i2c.c index 1eccabd4cd5..da50766f3fe 100644 --- a/arch/arm/src/stm32/stm32f40xxx_i2c.c +++ b/arch/arm/src/stm32/stm32f40xxx_i2c.c @@ -105,7 +105,7 @@ /* Experimentally enabled for STM32L15XX */ #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F10XX) || \ - defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /************************************************************************************ * Pre-processor Definitions @@ -155,7 +155,7 @@ #elif defined(CONFIG_STM32_STM32F10XX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD | \ GPIO_MODE_50MHz) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_FLOAT | GPIO_OPENDRAIN |\ GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) #endif @@ -2747,5 +2747,5 @@ int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev) return OK; } -#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F4XXX */ #endif /* CONFIG_STM32_I2C1 || CONFIG_STM32_I2C2 || CONFIG_STM32_I2C3 */ diff --git a/configs/clicker2-stm32/knsh/defconfig b/configs/clicker2-stm32/knsh/defconfig index b75ba40a8d3..aa53f6e5c6d 100644 --- a/configs/clicker2-stm32/knsh/defconfig +++ b/configs/clicker2-stm32/knsh/defconfig @@ -326,7 +326,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig index 7a3d03e4415..ff1954f9eac 100644 --- a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig +++ b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/mrf24j40-mac/defconfig b/configs/clicker2-stm32/mrf24j40-mac/defconfig index 7ee79a1d4a7..7c17224ff8e 100644 --- a/configs/clicker2-stm32/mrf24j40-mac/defconfig +++ b/configs/clicker2-stm32/mrf24j40-mac/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/mrf24j40-starhub/defconfig b/configs/clicker2-stm32/mrf24j40-starhub/defconfig index 45000c97af8..b66d7ec7eb4 100644 --- a/configs/clicker2-stm32/mrf24j40-starhub/defconfig +++ b/configs/clicker2-stm32/mrf24j40-starhub/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/mrf24j40-starpoint/defconfig b/configs/clicker2-stm32/mrf24j40-starpoint/defconfig index 99c76b0eadc..f542507c134 100644 --- a/configs/clicker2-stm32/mrf24j40-starpoint/defconfig +++ b/configs/clicker2-stm32/mrf24j40-starpoint/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/nsh/defconfig b/configs/clicker2-stm32/nsh/defconfig index 0fb4bd7cdc0..a81215fcf88 100644 --- a/configs/clicker2-stm32/nsh/defconfig +++ b/configs/clicker2-stm32/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/usbnsh/defconfig b/configs/clicker2-stm32/usbnsh/defconfig index 3db2eabaafa..11d5ac80325 100644 --- a/configs/clicker2-stm32/usbnsh/defconfig +++ b/configs/clicker2-stm32/usbnsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/cloudctrl/nsh/defconfig b/configs/cloudctrl/nsh/defconfig index 6d04d18d25f..fa608551771 100644 --- a/configs/cloudctrl/nsh/defconfig +++ b/configs/cloudctrl/nsh/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/fire-stm32v2/nsh/defconfig b/configs/fire-stm32v2/nsh/defconfig index b1f0cb08c07..ff24314cc73 100644 --- a/configs/fire-stm32v2/nsh/defconfig +++ b/configs/fire-stm32v2/nsh/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/nsh/defconfig b/configs/hymini-stm32v/nsh/defconfig index 2178d7a29a9..f3cb9a1b8ac 100644 --- a/configs/hymini-stm32v/nsh/defconfig +++ b/configs/hymini-stm32v/nsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/nsh2/defconfig b/configs/hymini-stm32v/nsh2/defconfig index 4e3a6fdb4a8..f27897f8693 100644 --- a/configs/hymini-stm32v/nsh2/defconfig +++ b/configs/hymini-stm32v/nsh2/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/usbmsc/defconfig b/configs/hymini-stm32v/usbmsc/defconfig index 95ebfa83d32..19e19949bae 100644 --- a/configs/hymini-stm32v/usbmsc/defconfig +++ b/configs/hymini-stm32v/usbmsc/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/usbnsh/defconfig b/configs/hymini-stm32v/usbnsh/defconfig index 745d7c0730a..b7bd587e784 100644 --- a/configs/hymini-stm32v/usbnsh/defconfig +++ b/configs/hymini-stm32v/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/usbserial/defconfig b/configs/hymini-stm32v/usbserial/defconfig index 045cdccaa0b..bc8f076a10c 100644 --- a/configs/hymini-stm32v/usbserial/defconfig +++ b/configs/hymini-stm32v/usbserial/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/maple/nsh/defconfig b/configs/maple/nsh/defconfig index 3d3dc6c5168..48719eb4896 100644 --- a/configs/maple/nsh/defconfig +++ b/configs/maple/nsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/maple/nx/defconfig b/configs/maple/nx/defconfig index 90d72dd22cb..d166bf7fecb 100644 --- a/configs/maple/nx/defconfig +++ b/configs/maple/nx/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/maple/usbnsh/defconfig b/configs/maple/usbnsh/defconfig index fae6560d13b..0c1afea5ea9 100644 --- a/configs/maple/usbnsh/defconfig +++ b/configs/maple/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/mikroe-stm32f4/fulldemo/defconfig b/configs/mikroe-stm32f4/fulldemo/defconfig index 8195102e45c..2b653c380b4 100644 --- a/configs/mikroe-stm32f4/fulldemo/defconfig +++ b/configs/mikroe-stm32f4/fulldemo/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/kostest/defconfig b/configs/mikroe-stm32f4/kostest/defconfig index 1acecc42817..fd4bc59b351 100644 --- a/configs/mikroe-stm32f4/kostest/defconfig +++ b/configs/mikroe-stm32f4/kostest/defconfig @@ -326,7 +326,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/nsh/defconfig b/configs/mikroe-stm32f4/nsh/defconfig index 6ebe81c54cc..abb5d3bf2e6 100644 --- a/configs/mikroe-stm32f4/nsh/defconfig +++ b/configs/mikroe-stm32f4/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/nx/defconfig b/configs/mikroe-stm32f4/nx/defconfig index a90fc6ef0a7..f59be60e5af 100644 --- a/configs/mikroe-stm32f4/nx/defconfig +++ b/configs/mikroe-stm32f4/nx/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/nxlines/defconfig b/configs/mikroe-stm32f4/nxlines/defconfig index 23e48763ecb..8130023159c 100644 --- a/configs/mikroe-stm32f4/nxlines/defconfig +++ b/configs/mikroe-stm32f4/nxlines/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/nxtext/defconfig b/configs/mikroe-stm32f4/nxtext/defconfig index c3575a1754c..0fa6c4097be 100644 --- a/configs/mikroe-stm32f4/nxtext/defconfig +++ b/configs/mikroe-stm32f4/nxtext/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/usbnsh/defconfig b/configs/mikroe-stm32f4/usbnsh/defconfig index 98b77895a6a..1155d137253 100644 --- a/configs/mikroe-stm32f4/usbnsh/defconfig +++ b/configs/mikroe-stm32f4/usbnsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/nucleo-f303re/adc/defconfig b/configs/nucleo-f303re/adc/defconfig index b63a7eb7122..c22d10454f5 100644 --- a/configs/nucleo-f303re/adc/defconfig +++ b/configs/nucleo-f303re/adc/defconfig @@ -315,7 +315,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/can/defconfig b/configs/nucleo-f303re/can/defconfig index 4fab471101a..7bea847d7aa 100644 --- a/configs/nucleo-f303re/can/defconfig +++ b/configs/nucleo-f303re/can/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/hello/defconfig b/configs/nucleo-f303re/hello/defconfig index c2ed153f8e1..681e2318688 100644 --- a/configs/nucleo-f303re/hello/defconfig +++ b/configs/nucleo-f303re/hello/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/nxlines/defconfig b/configs/nucleo-f303re/nxlines/defconfig index 5d3104d9b39..c3b06550d78 100644 --- a/configs/nucleo-f303re/nxlines/defconfig +++ b/configs/nucleo-f303re/nxlines/defconfig @@ -315,7 +315,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/pwm/defconfig b/configs/nucleo-f303re/pwm/defconfig index 98720e69b62..02327b59a23 100644 --- a/configs/nucleo-f303re/pwm/defconfig +++ b/configs/nucleo-f303re/pwm/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/serialrx/defconfig b/configs/nucleo-f303re/serialrx/defconfig index 8b14405c4a7..3cfbafe5c71 100644 --- a/configs/nucleo-f303re/serialrx/defconfig +++ b/configs/nucleo-f303re/serialrx/defconfig @@ -316,7 +316,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/uavcan/defconfig b/configs/nucleo-f303re/uavcan/defconfig index 8a8f69e4555..7e2cafee66f 100644 --- a/configs/nucleo-f303re/uavcan/defconfig +++ b/configs/nucleo-f303re/uavcan/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/nucleo-f334r8/adc/defconfig b/configs/nucleo-f334r8/adc/defconfig index 8e3bf15ba0b..bec89c1f7b8 100644 --- a/configs/nucleo-f334r8/adc/defconfig +++ b/configs/nucleo-f334r8/adc/defconfig @@ -346,7 +346,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set CONFIG_STM32_STM32F33XX=y # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f334r8/nsh/defconfig b/configs/nucleo-f334r8/nsh/defconfig index 86849afa1c9..0117dbb5e54 100644 --- a/configs/nucleo-f334r8/nsh/defconfig +++ b/configs/nucleo-f334r8/nsh/defconfig @@ -344,7 +344,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set CONFIG_STM32_STM32F33XX=y # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f4x1re/f401-nsh-clang/defconfig b/configs/nucleo-f4x1re/f401-nsh-clang/defconfig index 1e70d31d46e..4fe4a8f283c 100644 --- a/configs/nucleo-f4x1re/f401-nsh-clang/defconfig +++ b/configs/nucleo-f4x1re/f401-nsh-clang/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y CONFIG_STM32_STM32F401=y # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/nucleo-f4x1re/f401-nsh/defconfig b/configs/nucleo-f4x1re/f401-nsh/defconfig index 34b6503df73..d044d10eb11 100644 --- a/configs/nucleo-f4x1re/f401-nsh/defconfig +++ b/configs/nucleo-f4x1re/f401-nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y CONFIG_STM32_STM32F401=y # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/nucleo-f4x1re/f411-nsh/defconfig b/configs/nucleo-f4x1re/f411-nsh/defconfig index 65bbd4052ec..3a63c316b4d 100644 --- a/configs/nucleo-f4x1re/f411-nsh/defconfig +++ b/configs/nucleo-f4x1re/f411-nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set CONFIG_STM32_STM32F411=y diff --git a/configs/olimex-stm32-e407/discover/defconfig b/configs/olimex-stm32-e407/discover/defconfig index 67717307c54..de31c02891a 100644 --- a/configs/olimex-stm32-e407/discover/defconfig +++ b/configs/olimex-stm32-e407/discover/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/netnsh/defconfig b/configs/olimex-stm32-e407/netnsh/defconfig index 06367d3c0f7..5de8733eee4 100644 --- a/configs/olimex-stm32-e407/netnsh/defconfig +++ b/configs/olimex-stm32-e407/netnsh/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/nsh/defconfig b/configs/olimex-stm32-e407/nsh/defconfig index aadadcc6426..f59d4aa47e7 100644 --- a/configs/olimex-stm32-e407/nsh/defconfig +++ b/configs/olimex-stm32-e407/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/telnetd/defconfig b/configs/olimex-stm32-e407/telnetd/defconfig index eaf4e161e3e..80c75f2cba0 100644 --- a/configs/olimex-stm32-e407/telnetd/defconfig +++ b/configs/olimex-stm32-e407/telnetd/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/usbnsh/defconfig b/configs/olimex-stm32-e407/usbnsh/defconfig index 97476cc594a..80525055212 100644 --- a/configs/olimex-stm32-e407/usbnsh/defconfig +++ b/configs/olimex-stm32-e407/usbnsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/webserver/defconfig b/configs/olimex-stm32-e407/webserver/defconfig index a1587edd55b..59ed1629ab9 100644 --- a/configs/olimex-stm32-e407/webserver/defconfig +++ b/configs/olimex-stm32-e407/webserver/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-h405/usbnsh/defconfig b/configs/olimex-stm32-h405/usbnsh/defconfig index e9e635c56ee..22eff18b2a2 100644 --- a/configs/olimex-stm32-h405/usbnsh/defconfig +++ b/configs/olimex-stm32-h405/usbnsh/defconfig @@ -326,7 +326,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-h407/nsh/defconfig b/configs/olimex-stm32-h407/nsh/defconfig index 9c63f28284a..43f4cc1a218 100644 --- a/configs/olimex-stm32-h407/nsh/defconfig +++ b/configs/olimex-stm32-h407/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-p107/nsh/defconfig b/configs/olimex-stm32-p107/nsh/defconfig index ad911d78c52..73b23d32634 100644 --- a/configs/olimex-stm32-p107/nsh/defconfig +++ b/configs/olimex-stm32-p107/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/olimex-stm32-p207/nsh/defconfig b/configs/olimex-stm32-p207/nsh/defconfig index 9426e3101a4..a15d8576b19 100644 --- a/configs/olimex-stm32-p207/nsh/defconfig +++ b/configs/olimex-stm32-p207/nsh/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-p407/knsh/defconfig b/configs/olimex-stm32-p407/knsh/defconfig index b1fdc541d11..b1fc9982792 100644 --- a/configs/olimex-stm32-p407/knsh/defconfig +++ b/configs/olimex-stm32-p407/knsh/defconfig @@ -327,7 +327,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-p407/nsh/defconfig b/configs/olimex-stm32-p407/nsh/defconfig index ea3cb293ead..e3d5381f67a 100644 --- a/configs/olimex-stm32-p407/nsh/defconfig +++ b/configs/olimex-stm32-p407/nsh/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/can/defconfig b/configs/olimexino-stm32/can/defconfig index 3546af6d673..76c9d6239b7 100644 --- a/configs/olimexino-stm32/can/defconfig +++ b/configs/olimexino-stm32/can/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/composite/defconfig b/configs/olimexino-stm32/composite/defconfig index 1ac088caddc..2d609368133 100644 --- a/configs/olimexino-stm32/composite/defconfig +++ b/configs/olimexino-stm32/composite/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/nsh/defconfig b/configs/olimexino-stm32/nsh/defconfig index 5adb8a0072b..68f598a02af 100644 --- a/configs/olimexino-stm32/nsh/defconfig +++ b/configs/olimexino-stm32/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/smallnsh/defconfig b/configs/olimexino-stm32/smallnsh/defconfig index 6eee73059c6..3ddc8f9651a 100644 --- a/configs/olimexino-stm32/smallnsh/defconfig +++ b/configs/olimexino-stm32/smallnsh/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/tiny/defconfig b/configs/olimexino-stm32/tiny/defconfig index 9c3336dde2e..174cb07e13b 100644 --- a/configs/olimexino-stm32/tiny/defconfig +++ b/configs/olimexino-stm32/tiny/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/photon/nsh/defconfig b/configs/photon/nsh/defconfig index ec4b9b09da1..c27104e8adc 100644 --- a/configs/photon/nsh/defconfig +++ b/configs/photon/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_STM32F205=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/photon/usbnsh/defconfig b/configs/photon/usbnsh/defconfig index 83aa8cc706b..2b6748179fa 100644 --- a/configs/photon/usbnsh/defconfig +++ b/configs/photon/usbnsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_STM32F205=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/photon/wlan/defconfig b/configs/photon/wlan/defconfig index a368939cd51..a53bb3e432f 100644 --- a/configs/photon/wlan/defconfig +++ b/configs/photon/wlan/defconfig @@ -360,7 +360,7 @@ CONFIG_STM32_STM32F205=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/shenzhou/nsh/defconfig b/configs/shenzhou/nsh/defconfig index 19fd3322961..fb824c4bc65 100644 --- a/configs/shenzhou/nsh/defconfig +++ b/configs/shenzhou/nsh/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/shenzhou/nxwm/defconfig b/configs/shenzhou/nxwm/defconfig index 9dfa5ad3754..bbca876c3ac 100644 --- a/configs/shenzhou/nxwm/defconfig +++ b/configs/shenzhou/nxwm/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/shenzhou/thttpd/defconfig b/configs/shenzhou/thttpd/defconfig index f2f2f742374..d5bbadb32d0 100644 --- a/configs/shenzhou/thttpd/defconfig +++ b/configs/shenzhou/thttpd/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/spark/composite/defconfig b/configs/spark/composite/defconfig index e0350b7852f..c701bfd3e07 100644 --- a/configs/spark/composite/defconfig +++ b/configs/spark/composite/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/spark/nsh/defconfig b/configs/spark/nsh/defconfig index a404c2bc703..925ab224fa0 100644 --- a/configs/spark/nsh/defconfig +++ b/configs/spark/nsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/spark/usbmsc/defconfig b/configs/spark/usbmsc/defconfig index 7face48d5cb..35e14832bb3 100644 --- a/configs/spark/usbmsc/defconfig +++ b/configs/spark/usbmsc/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/spark/usbnsh/defconfig b/configs/spark/usbnsh/defconfig index 3d0184ad1fe..4cf69d5db0e 100644 --- a/configs/spark/usbnsh/defconfig +++ b/configs/spark/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/spark/usbserial/defconfig b/configs/spark/usbserial/defconfig index 70835160d50..671433ae991 100644 --- a/configs/spark/usbserial/defconfig +++ b/configs/spark/usbserial/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/composite/defconfig b/configs/stm3210e-eval/composite/defconfig index cb7ad87fd09..f702057f8f0 100644 --- a/configs/stm3210e-eval/composite/defconfig +++ b/configs/stm3210e-eval/composite/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/nsh/defconfig b/configs/stm3210e-eval/nsh/defconfig index 8207333ab16..087ccde3973 100644 --- a/configs/stm3210e-eval/nsh/defconfig +++ b/configs/stm3210e-eval/nsh/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/nsh2/defconfig b/configs/stm3210e-eval/nsh2/defconfig index 83d246522d0..2493dd648f3 100644 --- a/configs/stm3210e-eval/nsh2/defconfig +++ b/configs/stm3210e-eval/nsh2/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/nx/defconfig b/configs/stm3210e-eval/nx/defconfig index 82081051308..bd267d89b01 100644 --- a/configs/stm3210e-eval/nx/defconfig +++ b/configs/stm3210e-eval/nx/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/nxterm/defconfig b/configs/stm3210e-eval/nxterm/defconfig index c6fa59410d6..fb23520c19f 100644 --- a/configs/stm3210e-eval/nxterm/defconfig +++ b/configs/stm3210e-eval/nxterm/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/pm/defconfig b/configs/stm3210e-eval/pm/defconfig index bc195374f63..e5b5278e116 100644 --- a/configs/stm3210e-eval/pm/defconfig +++ b/configs/stm3210e-eval/pm/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/usbmsc/defconfig b/configs/stm3210e-eval/usbmsc/defconfig index 47d7658081c..bd1abad73ff 100644 --- a/configs/stm3210e-eval/usbmsc/defconfig +++ b/configs/stm3210e-eval/usbmsc/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/usbserial/defconfig b/configs/stm3210e-eval/usbserial/defconfig index a586efc92f1..55aa3079eef 100644 --- a/configs/stm3210e-eval/usbserial/defconfig +++ b/configs/stm3210e-eval/usbserial/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3220g-eval/dhcpd/defconfig b/configs/stm3220g-eval/dhcpd/defconfig index 5fdd9cd6515..fc608f274cd 100644 --- a/configs/stm3220g-eval/dhcpd/defconfig +++ b/configs/stm3220g-eval/dhcpd/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/nettest/defconfig b/configs/stm3220g-eval/nettest/defconfig index df5782fe877..aeedffc2e88 100644 --- a/configs/stm3220g-eval/nettest/defconfig +++ b/configs/stm3220g-eval/nettest/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/nsh/defconfig b/configs/stm3220g-eval/nsh/defconfig index 1ecef98b393..744a59511ef 100644 --- a/configs/stm3220g-eval/nsh/defconfig +++ b/configs/stm3220g-eval/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/nsh2/defconfig b/configs/stm3220g-eval/nsh2/defconfig index de128433be2..85862d37d73 100644 --- a/configs/stm3220g-eval/nsh2/defconfig +++ b/configs/stm3220g-eval/nsh2/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/nxwm/defconfig b/configs/stm3220g-eval/nxwm/defconfig index 847e4f77e80..5b774a672ac 100644 --- a/configs/stm3220g-eval/nxwm/defconfig +++ b/configs/stm3220g-eval/nxwm/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/telnetd/defconfig b/configs/stm3220g-eval/telnetd/defconfig index a0ab8932f49..9e7b12df3d4 100644 --- a/configs/stm3220g-eval/telnetd/defconfig +++ b/configs/stm3220g-eval/telnetd/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/dhcpd/defconfig b/configs/stm3240g-eval/dhcpd/defconfig index d3d3dcffff3..0af96796531 100644 --- a/configs/stm3240g-eval/dhcpd/defconfig +++ b/configs/stm3240g-eval/dhcpd/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/discover/defconfig b/configs/stm3240g-eval/discover/defconfig index 1d9a91bb460..6d5e900e96f 100644 --- a/configs/stm3240g-eval/discover/defconfig +++ b/configs/stm3240g-eval/discover/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/knxwm/defconfig b/configs/stm3240g-eval/knxwm/defconfig index 789f7631fc3..c405722c559 100644 --- a/configs/stm3240g-eval/knxwm/defconfig +++ b/configs/stm3240g-eval/knxwm/defconfig @@ -337,7 +337,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nettest/defconfig b/configs/stm3240g-eval/nettest/defconfig index 1e890f329cb..54feb7e2525 100644 --- a/configs/stm3240g-eval/nettest/defconfig +++ b/configs/stm3240g-eval/nettest/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nsh/defconfig b/configs/stm3240g-eval/nsh/defconfig index 99c8ece468a..69e8ebd5418 100644 --- a/configs/stm3240g-eval/nsh/defconfig +++ b/configs/stm3240g-eval/nsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nsh2/defconfig b/configs/stm3240g-eval/nsh2/defconfig index 1c35e4babb5..2e5939c0272 100644 --- a/configs/stm3240g-eval/nsh2/defconfig +++ b/configs/stm3240g-eval/nsh2/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nxterm/defconfig b/configs/stm3240g-eval/nxterm/defconfig index 411476cbd63..f70e9e86d14 100644 --- a/configs/stm3240g-eval/nxterm/defconfig +++ b/configs/stm3240g-eval/nxterm/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nxwm/defconfig b/configs/stm3240g-eval/nxwm/defconfig index 467fd105a97..e08a81d10c0 100644 --- a/configs/stm3240g-eval/nxwm/defconfig +++ b/configs/stm3240g-eval/nxwm/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/telnetd/defconfig b/configs/stm3240g-eval/telnetd/defconfig index a6e171b9e2e..8d58341d607 100644 --- a/configs/stm3240g-eval/telnetd/defconfig +++ b/configs/stm3240g-eval/telnetd/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/webserver/defconfig b/configs/stm3240g-eval/webserver/defconfig index 8d4e93adb5e..3bd0139d135 100644 --- a/configs/stm3240g-eval/webserver/defconfig +++ b/configs/stm3240g-eval/webserver/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/xmlrpc/defconfig b/configs/stm3240g-eval/xmlrpc/defconfig index 63ce7679db3..163859adb83 100644 --- a/configs/stm3240g-eval/xmlrpc/defconfig +++ b/configs/stm3240g-eval/xmlrpc/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32_tiny/nsh/defconfig b/configs/stm32_tiny/nsh/defconfig index d1aacaf7101..b94d3da9400 100644 --- a/configs/stm32_tiny/nsh/defconfig +++ b/configs/stm32_tiny/nsh/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32_tiny/usbnsh/defconfig b/configs/stm32_tiny/usbnsh/defconfig index 3466aa3bf26..bb7587f8f60 100644 --- a/configs/stm32_tiny/usbnsh/defconfig +++ b/configs/stm32_tiny/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32butterfly2/nsh/defconfig b/configs/stm32butterfly2/nsh/defconfig index 91f4d1c2e20..58d93b48e4b 100644 --- a/configs/stm32butterfly2/nsh/defconfig +++ b/configs/stm32butterfly2/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32butterfly2/nshnet/defconfig b/configs/stm32butterfly2/nshnet/defconfig index a2d00553867..6ceb5d6a61b 100644 --- a/configs/stm32butterfly2/nshnet/defconfig +++ b/configs/stm32butterfly2/nshnet/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32butterfly2/nshusbdev/defconfig b/configs/stm32butterfly2/nshusbdev/defconfig index f57578e7d07..f28a8b05c98 100644 --- a/configs/stm32butterfly2/nshusbdev/defconfig +++ b/configs/stm32butterfly2/nshusbdev/defconfig @@ -316,7 +316,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32butterfly2/nshusbhost/defconfig b/configs/stm32butterfly2/nshusbhost/defconfig index 91f4d1c2e20..58d93b48e4b 100644 --- a/configs/stm32butterfly2/nshusbhost/defconfig +++ b/configs/stm32butterfly2/nshusbhost/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/audio_tone/defconfig b/configs/stm32f103-minimum/audio_tone/defconfig index 2dd9628e9cf..28b47a49084 100644 --- a/configs/stm32f103-minimum/audio_tone/defconfig +++ b/configs/stm32f103-minimum/audio_tone/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/buttons/defconfig b/configs/stm32f103-minimum/buttons/defconfig index b6fa8ac7d1d..75d256b646a 100644 --- a/configs/stm32f103-minimum/buttons/defconfig +++ b/configs/stm32f103-minimum/buttons/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/jlx12864g/defconfig b/configs/stm32f103-minimum/jlx12864g/defconfig index d0e48894b20..92335c76bef 100644 --- a/configs/stm32f103-minimum/jlx12864g/defconfig +++ b/configs/stm32f103-minimum/jlx12864g/defconfig @@ -349,7 +349,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/mcp2515/defconfig b/configs/stm32f103-minimum/mcp2515/defconfig index 3298e2a8389..4a323859f6d 100644 --- a/configs/stm32f103-minimum/mcp2515/defconfig +++ b/configs/stm32f103-minimum/mcp2515/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f103-minimum/nrf24/defconfig b/configs/stm32f103-minimum/nrf24/defconfig index 38dff042fc8..b323b949075 100644 --- a/configs/stm32f103-minimum/nrf24/defconfig +++ b/configs/stm32f103-minimum/nrf24/defconfig @@ -345,7 +345,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/nsh/defconfig b/configs/stm32f103-minimum/nsh/defconfig index 4f443043936..cd62fe3c8f9 100644 --- a/configs/stm32f103-minimum/nsh/defconfig +++ b/configs/stm32f103-minimum/nsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/pwm/defconfig b/configs/stm32f103-minimum/pwm/defconfig index c9948199ad6..b674a7fa224 100644 --- a/configs/stm32f103-minimum/pwm/defconfig +++ b/configs/stm32f103-minimum/pwm/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/rfid-rc522/defconfig b/configs/stm32f103-minimum/rfid-rc522/defconfig index 7b3b9fdec14..634c594aaf2 100644 --- a/configs/stm32f103-minimum/rfid-rc522/defconfig +++ b/configs/stm32f103-minimum/rfid-rc522/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/rgbled/defconfig b/configs/stm32f103-minimum/rgbled/defconfig index 7f69a3fad9a..0ec152fb491 100644 --- a/configs/stm32f103-minimum/rgbled/defconfig +++ b/configs/stm32f103-minimum/rgbled/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/usbnsh/defconfig b/configs/stm32f103-minimum/usbnsh/defconfig index b7c50a79abb..9dae57fb224 100644 --- a/configs/stm32f103-minimum/usbnsh/defconfig +++ b/configs/stm32f103-minimum/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/userled/defconfig b/configs/stm32f103-minimum/userled/defconfig index 8a37b7e1aa4..27c1160864e 100644 --- a/configs/stm32f103-minimum/userled/defconfig +++ b/configs/stm32f103-minimum/userled/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/veml6070/defconfig b/configs/stm32f103-minimum/veml6070/defconfig index 1c6f89180b3..3b306cad2b9 100644 --- a/configs/stm32f103-minimum/veml6070/defconfig +++ b/configs/stm32f103-minimum/veml6070/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f3discovery/nsh/defconfig b/configs/stm32f3discovery/nsh/defconfig index e21921d8971..d1593a1a1f9 100644 --- a/configs/stm32f3discovery/nsh/defconfig +++ b/configs/stm32f3discovery/nsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f3discovery/usbnsh/defconfig b/configs/stm32f3discovery/usbnsh/defconfig index 95c5ec9610f..ac0627e2f05 100644 --- a/configs/stm32f3discovery/usbnsh/defconfig +++ b/configs/stm32f3discovery/usbnsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f411e-disco/nsh/defconfig b/configs/stm32f411e-disco/nsh/defconfig index bbab590c49d..f9360ee1f79 100644 --- a/configs/stm32f411e-disco/nsh/defconfig +++ b/configs/stm32f411e-disco/nsh/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_FLASH_CONFIG_E=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set CONFIG_STM32_STM32F411=y # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f429i-disco/extflash/defconfig b/configs/stm32f429i-disco/extflash/defconfig index bcdb618783c..80f7c558b37 100644 --- a/configs/stm32f429i-disco/extflash/defconfig +++ b/configs/stm32f429i-disco/extflash/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/lcd/defconfig b/configs/stm32f429i-disco/lcd/defconfig index 61efc4cfff9..9f5896da0da 100644 --- a/configs/stm32f429i-disco/lcd/defconfig +++ b/configs/stm32f429i-disco/lcd/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/ltdc/defconfig b/configs/stm32f429i-disco/ltdc/defconfig index 41a2e7d3963..31e248db635 100644 --- a/configs/stm32f429i-disco/ltdc/defconfig +++ b/configs/stm32f429i-disco/ltdc/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/nsh/defconfig b/configs/stm32f429i-disco/nsh/defconfig index e2a1170c5e8..d968905a62a 100644 --- a/configs/stm32f429i-disco/nsh/defconfig +++ b/configs/stm32f429i-disco/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/nxwm/defconfig b/configs/stm32f429i-disco/nxwm/defconfig index 13890fe6094..f1c567259c9 100644 --- a/configs/stm32f429i-disco/nxwm/defconfig +++ b/configs/stm32f429i-disco/nxwm/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/usbmsc/defconfig b/configs/stm32f429i-disco/usbmsc/defconfig index 8025b772d46..2aba629180e 100644 --- a/configs/stm32f429i-disco/usbmsc/defconfig +++ b/configs/stm32f429i-disco/usbmsc/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/usbnsh/defconfig b/configs/stm32f429i-disco/usbnsh/defconfig index be48d861239..388b60a220d 100644 --- a/configs/stm32f429i-disco/usbnsh/defconfig +++ b/configs/stm32f429i-disco/usbnsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/canard/defconfig b/configs/stm32f4discovery/canard/defconfig index b47022a351f..5a2dea55c65 100644 --- a/configs/stm32f4discovery/canard/defconfig +++ b/configs/stm32f4discovery/canard/defconfig @@ -325,7 +325,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/cxxtest/defconfig b/configs/stm32f4discovery/cxxtest/defconfig index 02cd0cbc2b2..099491714f1 100644 --- a/configs/stm32f4discovery/cxxtest/defconfig +++ b/configs/stm32f4discovery/cxxtest/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/elf/defconfig b/configs/stm32f4discovery/elf/defconfig index 8dea3c3a3c7..10dee697a30 100644 --- a/configs/stm32f4discovery/elf/defconfig +++ b/configs/stm32f4discovery/elf/defconfig @@ -325,7 +325,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f4discovery/ipv6/defconfig b/configs/stm32f4discovery/ipv6/defconfig index bab7d7d7f7f..96a906767d4 100644 --- a/configs/stm32f4discovery/ipv6/defconfig +++ b/configs/stm32f4discovery/ipv6/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/kostest/defconfig b/configs/stm32f4discovery/kostest/defconfig index 8195826113b..34362cb295b 100644 --- a/configs/stm32f4discovery/kostest/defconfig +++ b/configs/stm32f4discovery/kostest/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f4discovery/netnsh/defconfig b/configs/stm32f4discovery/netnsh/defconfig index c60861ec0b8..64055c7dbf9 100644 --- a/configs/stm32f4discovery/netnsh/defconfig +++ b/configs/stm32f4discovery/netnsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/nsh/defconfig b/configs/stm32f4discovery/nsh/defconfig index 3e3a60c3aa8..056e2463c03 100644 --- a/configs/stm32f4discovery/nsh/defconfig +++ b/configs/stm32f4discovery/nsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/nxlines/defconfig b/configs/stm32f4discovery/nxlines/defconfig index af2533a39e2..0d01a5084cf 100644 --- a/configs/stm32f4discovery/nxlines/defconfig +++ b/configs/stm32f4discovery/nxlines/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/pm/defconfig b/configs/stm32f4discovery/pm/defconfig index 7cfc253fa72..192db757606 100644 --- a/configs/stm32f4discovery/pm/defconfig +++ b/configs/stm32f4discovery/pm/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/posix_spawn/defconfig b/configs/stm32f4discovery/posix_spawn/defconfig index e1a7bf6754a..954c794c565 100644 --- a/configs/stm32f4discovery/posix_spawn/defconfig +++ b/configs/stm32f4discovery/posix_spawn/defconfig @@ -325,7 +325,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f4discovery/pseudoterm/defconfig b/configs/stm32f4discovery/pseudoterm/defconfig index 7ef11b8d2c5..6eb552bf8a0 100644 --- a/configs/stm32f4discovery/pseudoterm/defconfig +++ b/configs/stm32f4discovery/pseudoterm/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/rgbled/defconfig b/configs/stm32f4discovery/rgbled/defconfig index 8135278af2b..9909f3eb7c0 100644 --- a/configs/stm32f4discovery/rgbled/defconfig +++ b/configs/stm32f4discovery/rgbled/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/uavcan/defconfig b/configs/stm32f4discovery/uavcan/defconfig index ed52310f8ad..7218e6f2442 100644 --- a/configs/stm32f4discovery/uavcan/defconfig +++ b/configs/stm32f4discovery/uavcan/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/usbnsh/defconfig b/configs/stm32f4discovery/usbnsh/defconfig index 8528822d337..e29822f5475 100644 --- a/configs/stm32f4discovery/usbnsh/defconfig +++ b/configs/stm32f4discovery/usbnsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/winbuild/defconfig b/configs/stm32f4discovery/winbuild/defconfig index 0deb8cd65b1..c5b4713c804 100644 --- a/configs/stm32f4discovery/winbuild/defconfig +++ b/configs/stm32f4discovery/winbuild/defconfig @@ -281,7 +281,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F207 is not set # CONFIG_STM32_STM32F30XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f4discovery/xen1210/defconfig b/configs/stm32f4discovery/xen1210/defconfig index 161b69470a4..e997a0bbe54 100644 --- a/configs/stm32f4discovery/xen1210/defconfig +++ b/configs/stm32f4discovery/xen1210/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32ldiscovery/nsh/defconfig b/configs/stm32ldiscovery/nsh/defconfig index ccb8f423a40..bc9572faf4d 100644 --- a/configs/stm32ldiscovery/nsh/defconfig +++ b/configs/stm32ldiscovery/nsh/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_ENERGYLITE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32vldiscovery/nsh/defconfig b/configs/stm32vldiscovery/nsh/defconfig index 36bda9b888b..e1eac671c78 100644 --- a/configs/stm32vldiscovery/nsh/defconfig +++ b/configs/stm32vldiscovery/nsh/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_VALUELINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/viewtool-stm32f107/highpri/defconfig b/configs/viewtool-stm32f107/highpri/defconfig index 156787a1b4f..430c16fe3d9 100644 --- a/configs/viewtool-stm32f107/highpri/defconfig +++ b/configs/viewtool-stm32f107/highpri/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/viewtool-stm32f107/netnsh/defconfig b/configs/viewtool-stm32f107/netnsh/defconfig index 576facbb207..a94fd147b79 100644 --- a/configs/viewtool-stm32f107/netnsh/defconfig +++ b/configs/viewtool-stm32f107/netnsh/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/viewtool-stm32f107/nsh/defconfig b/configs/viewtool-stm32f107/nsh/defconfig index a84458179e8..bf19312856a 100644 --- a/configs/viewtool-stm32f107/nsh/defconfig +++ b/configs/viewtool-stm32f107/nsh/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set From 76587b2c6f0f6861bda44da0e668118e55a74fa0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 10:34:54 -0600 Subject: [PATCH 10/21] STM32 Kconfig: 'unfold' some of the dependencies to provide better long term configuration support. This also effective reverts the recent 15b85738e7b5b9df6377f56e2a6a629346f87964 --- arch/arm/src/stm32/Kconfig | 51 +++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index b382deaa94c..910922000bf 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -1525,20 +1525,16 @@ config STM32_STM32F37XX config STM32_STM32F4XXX bool default n - select STM32_HAVE_OTGFS if !STM32_STM32F410 - select STM32_HAVE_TIM3 if !STM32_STM32F410 - select STM32_HAVE_TIM4 if !STM32_STM32F410 select STM32_HAVE_SPI2 - select STM32_HAVE_SPI3 if !STM32_STM32F410 - select STM32_HAVE_I2S3 if !STM32_STM32F410 select STM32_HAVE_I2C2 - select STM32_HAVE_I2C3 if !STM32_STM32F410 config STM32_STM32F401 bool default n select STM32_HAVE_USART6 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM9 select STM32_HAVE_TIM10 @@ -1546,6 +1542,8 @@ config STM32_STM32F401 select STM32_HAVE_SPI2 select STM32_HAVE_SPI3 select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS config STM32_STM32F410 bool @@ -1564,15 +1562,19 @@ config STM32_STM32F411 default n select STM32_HAVE_USART6 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM9 select STM32_HAVE_TIM10 select STM32_HAVE_TIM11 select STM32_HAVE_SPI2 select STM32_HAVE_SPI3 - select STM32_HAVE_I2S3 select STM32_HAVE_SPI4 select STM32_HAVE_SPI5 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS config STM32_STM32F405 bool @@ -1584,6 +1586,8 @@ config STM32_STM32F405 select STM32_HAVE_UART5 select STM32_HAVE_USART6 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 @@ -1600,7 +1604,11 @@ config STM32_STM32F405 select STM32_HAVE_CAN2 select STM32_HAVE_DAC1 select STM32_HAVE_DAC2 + select STM32_HAVE_SPI3 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 select STM32_HAVE_RNG + select STM32_HAVE_OTGFS config STM32_STM32F407 bool @@ -1613,6 +1621,8 @@ config STM32_STM32F407 select STM32_HAVE_USART6 select STM32_HAVE_TIM1 select STM32_HAVE_TIM2 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 @@ -1629,10 +1639,15 @@ config STM32_STM32F407 select STM32_HAVE_CAN2 select STM32_HAVE_DAC1 select STM32_HAVE_DAC2 + select STM32_HAVE_SPI3 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 select STM32_HAVE_RNG select STM32_HAVE_ETHMAC + select STM32_HAVE_OTGFS # This is really 427/437, but we treat the two the same. + config STM32_STM32F427 bool default n @@ -1645,6 +1660,8 @@ config STM32_STM32F427 select STM32_HAVE_UART7 select STM32_HAVE_UART8 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 @@ -1665,12 +1682,15 @@ config STM32_STM32F427 select STM32_HAVE_ETHMAC select STM32_HAVE_SPI2 select STM32_HAVE_SPI3 - select STM32_HAVE_I2S3 select STM32_HAVE_SPI4 select STM32_HAVE_SPI5 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS select STM32_HAVE_SPI6 # This is really 429/439, but we treat the two the same. + config STM32_STM32F429 bool default n @@ -1684,6 +1704,8 @@ config STM32_STM32F429 select STM32_HAVE_UART7 select STM32_HAVE_UART8 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 @@ -1708,6 +1730,9 @@ config STM32_STM32F429 select STM32_HAVE_SPI4 select STM32_HAVE_SPI5 select STM32_HAVE_SPI6 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS config STM32_STM32F446 bool @@ -1736,11 +1761,16 @@ config STM32_STM32F446 select STM32_HAVE_CAN2 select STM32_HAVE_DAC1 select STM32_HAVE_DAC2 + select STM32_HAVE_SPI3 select STM32_HAVE_SPI4 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS select STM32_HAVE_SAIPLL select STM32_HAVE_I2SPLL # This is really 469/479, but we treat the two the same. + config STM32_STM32F469 bool default n @@ -1774,12 +1804,15 @@ config STM32_STM32F469 select STM32_HAVE_DAC1 select STM32_HAVE_DAC2 select STM32_HAVE_RNG + select STM32_HAVE_SPI3 select STM32_HAVE_SPI4 select STM32_HAVE_SPI5 select STM32_HAVE_SPI6 + select STM32_HAVE_OTGFS select STM32_HAVE_SAIPLL select STM32_HAVE_I2SPLL - + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 config STM32_DFU bool "DFU bootloader" From a5f361e984311ef11b5420a65aaacc93f8e08589 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 12:00:59 -0600 Subject: [PATCH 11/21] ICMPv6: Fix so that ICMPv6 can be used with 6LoWPAN. --- include/nuttx/net/icmpv6.h | 41 ++++++++++++++++---------- net/icmpv6/icmpv6_advertise.c | 16 ++++++---- net/icmpv6/icmpv6_input.c | 2 +- net/icmpv6/icmpv6_radvertise.c | 54 +++++++++++++--------------------- net/icmpv6/icmpv6_rsolicit.c | 19 +++++++----- net/icmpv6/icmpv6_solicit.c | 21 ++++++++----- net/neighbor/neighbor.h | 1 + 7 files changed, 84 insertions(+), 70 deletions(-) diff --git a/include/nuttx/net/icmpv6.h b/include/nuttx/net/icmpv6.h index e0e8ecba99c..c576b2da9d9 100644 --- a/include/nuttx/net/icmpv6.h +++ b/include/nuttx/net/icmpv6.h @@ -2,7 +2,7 @@ * include/nuttx/net/icmpv6.h * Header file for the NuttX ICMPv6 stack. * - * Copyright (C) 2007-2009, 2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012, 2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * This logic was leveraged from uIP which also has a BSD-style license: @@ -123,6 +123,13 @@ #define ICMPv6_PRFX_FLAG_L (1 << 7) /* On-link flag */ #define ICMPv6_PRFX_FLAG_A (1 << 6) /* Autonomous address-configuration flag +/* Return with size of an option (in full octects) using the size of a link + * layer address taking into account a header of the two-bytes. + */ + +#define ICMPv6_OPT_SIZE(a) (((a) + 2 + 7) & ~7) +#define ICMPv6_OPT_OCTECTS(a) (((a) + 2 + 7) >> 3) + /**************************************************************************** * Public Type Definitions ****************************************************************************/ @@ -178,11 +185,12 @@ struct icmpv6_neighbor_solicit_s uint8_t opttype; /* Option Type: ICMPv6_OPT_SRCLLADDR */ uint8_t optlen; /* Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET uint8_t srclladdr[6]; /* Options: Source link layer address */ -#endif }; +#define SIZEOF_ICMPV6_NEIGHBOR_SOLICIT_S(n) \ + (sizeof(struct icmpv6_neighbor_solicit_s) + ICMPv6_OPT_SIZE(n) - 8) + /* This the message format for the ICMPv6 Neighbor Advertisement message */ struct icmpv6_neighbor_advertise_s @@ -194,12 +202,14 @@ struct icmpv6_neighbor_advertise_s net_ipv6addr_t tgtaddr; /* Target IPv6 address */ uint8_t opttype; /* Option Type: ICMPv6_OPT_TGTLLADDR */ - uint8_t optlen; /* Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET + uint8_t optlen; /* Option length in octets */ uint8_t tgtlladdr[6]; /* Options: Target link layer address */ -#endif + /* Actual size detemined by optlen */ }; +#define SIZEOF_ICMPV6_NEIGHBOR_ADVERTISE_S(n) \ + (sizeof(struct icmpv6_neighbor_advertise_s) + ICMPv6_OPT_SIZE(n) - 8) + /* This the message format for the ICMPv6 Router Solicitation message */ struct icmpv6_router_solicit_s @@ -210,12 +220,13 @@ struct icmpv6_router_solicit_s uint8_t flags[4]; /* See ICMPv6_RADV_FLAG_ definitions (must be zero) */ uint8_t opttype; /* Option Type: ICMPv6_OPT_SRCLLADDR */ - uint8_t optlen; /* Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET + uint8_t optlen; /* Option length in octets */ uint8_t srclladdr[6]; /* Options: Source link layer address */ -#endif }; +#define SIZEOF_ICMPV6_ROUTER_SOLICIT_S(n) \ + (sizeof(struct icmpv6_router_solicit_s) + ICMPv6_OPT_SIZE(n) - 8) + /* This the message format for the ICMPv6 Router Advertisement message: * Options may include: ICMPv6_OPT_SRCLLADDR, ICMPv6_OPT_MTU, and/or * ICMPv6_OPT_PREFIX @@ -231,7 +242,7 @@ struct icmpv6_router_advertise_s uint16_t lifetime; /* Router lifetime */ uint16_t reachable[2]; /* Reachable time */ uint16_t retrans[2]; /* Retransmission timer */ - uint8_t options[1]; /* Options begin here */ + /* Options begin here */ }; #define ICMPv6_RADV_MINLEN (16) @@ -280,20 +291,20 @@ struct icmpv6_srclladdr_s { uint8_t opttype; /* Octet 1: Option Type: ICMPv6_OPT_SRCLLADDR */ uint8_t optlen; /* " " ": Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET uint8_t srclladdr[6]; /* " " ": Options: Source link layer address */ -#endif }; +#define SIZEOF_ICMPV6_SRCLLADDR_S(n) ICMPv6_OPT_SIZE(n) + struct icmpv6_tgrlladdr_s { uint8_t opttype; /* Octet 1: Option Type: ICMPv6_OPT_TGTLLADDR */ - uint8_t optlen; /* " " ": Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET + uint8_t optlen; /* " " ": Option length in octets */ uint8_t tgtlladdr[6]; /* " " ": Options: Target link layer address */ -#endif }; +#define SIZEOF_ICMPV6_TGRLLADDR_S(n) ICMPv6_OPT_SIZE(n) + struct icmpv6_prefixinfo_s { uint8_t opttype; /* Octet 1: Option Type: ICMPv6_OPT_PREFIX */ diff --git a/net/icmpv6/icmpv6_advertise.c b/net/icmpv6/icmpv6_advertise.c index 621b8d6c146..75c46151604 100644 --- a/net/icmpv6/icmpv6_advertise.c +++ b/net/icmpv6/icmpv6_advertise.c @@ -2,7 +2,7 @@ * net/icmpv6/icmpv6_advertise.c * Send an ICMPv6 Neighbor Advertisement * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Adapted for NuttX from logic in uIP which also has a BSD-like license: @@ -96,6 +96,8 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, { FAR struct icmpv6_iphdr_s *icmp = ICMPv6BUF; FAR struct icmpv6_neighbor_advertise_s *adv; + uint16_t l1size; + uint16_t l3size; /* Set up the IPv6 header */ @@ -105,8 +107,10 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, /* Length excludes the IPv6 header */ - icmp->len[0] = (sizeof(struct icmpv6_neighbor_advertise_s) >> 8); - icmp->len[1] = (sizeof(struct icmpv6_neighbor_advertise_s) & 0xff); + l1size = NET_LL_HDRLEN(dev); + l3size = SIZEOF_ICMPV6_NEIGHBOR_ADVERTISE_S(l1size); + icmp->len[0] = (l3size >> 8); + icmp->len[1] = (l3size & 0xff); icmp->proto = IP_PROTO_ICMP6; /* Next header */ icmp->ttl = 255; /* Hop limit */ @@ -133,13 +137,13 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, /* Set up the options */ adv->opttype = ICMPv6_OPT_TGTLLADDR; /* Option type */ - adv->optlen = 1; /* Option length = 1 octet */ + adv->optlen = ICMPv6_OPT_OCTECTS(l1size); /* Option length in octets */ /* Copy our link layer address into the message * REVISIT: What if the link layer is not Ethernet? */ - memcpy(adv->tgtlladdr, &dev->d_mac.ether, IFHWADDRLEN); + memcpy(adv->tgtlladdr, &dev->d_mac, l1size); /* Calculate the checksum over both the ICMP header and payload */ @@ -148,7 +152,7 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, /* Set the size to the size of the IPv6 header and the payload size */ - dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_neighbor_advertise_s); + dev->d_len = IPv6_HDRLEN + l3size; #ifdef CONFIG_NET_ETHERNET /* Add the size of the Ethernet header */ diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c index 21f171fbf84..7ced607b596 100644 --- a/net/icmpv6/icmpv6_input.c +++ b/net/icmpv6/icmpv6_input.c @@ -2,7 +2,7 @@ * net/icmpv6/icmpv6_input.c * Handling incoming ICMPv6 input * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Adapted for NuttX from logic in uIP which also has a BSD-like license: diff --git a/net/icmpv6/icmpv6_radvertise.c b/net/icmpv6/icmpv6_radvertise.c index cec05c51a8b..b0765427b96 100644 --- a/net/icmpv6/icmpv6_radvertise.c +++ b/net/icmpv6/icmpv6_radvertise.c @@ -58,31 +58,6 @@ #ifdef CONFIG_NET_ICMPv6_ROUTER -/**************************************************************************** - * Private Types - ****************************************************************************/ -/* This is the same as struct icmpv6_router_advertise_s, but with the - * source address and prefix options included for simplicity. - */ - -struct icmpv6_radvertise_s -{ - uint8_t type; /* Message Type: ICMPV6_ROUTER_ADVERTISE */ - uint8_t code; /* Further qualifies the ICMP messages */ - uint16_t chksum; /* Checksum of ICMP header and data */ - uint8_t hoplimit; /* Current hop limit */ - uint8_t flags; /* See ICMPv6_RADV_FLAG_* definitions */ - uint16_t lifetime; /* Router lifetime */ - uint16_t reachable[2]; /* Reachable time */ - uint16_t retrans[2]; /* Retransmission timer */ - - /* Options */ - - struct icmpv6_srclladdr_s srcaddr; - struct icmpv6_mtu_s mtu; - struct icmpv6_prefixinfo_s prefix; -}; - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -91,7 +66,7 @@ struct icmpv6_radvertise_s #define ICMPv6BUF ((struct icmpv6_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) #define ICMPv6ADVERTISE \ - ((struct icmpv6_radvertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) + ((struct icmpv6_router_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) /**************************************************************************** * Private Data @@ -134,10 +109,12 @@ static const net_ipv6addr_t g_ipv6_prefix = void icmpv6_radvertise(FAR struct net_driver_s *dev) { FAR struct icmpv6_iphdr_s *icmp = ICMPv6BUF; - FAR struct icmpv6_radvertise_s *adv; + FAR struct icmpv6_router_advertise_s *adv; FAR struct icmpv6_srclladdr_s *srcaddr; FAR struct icmpv6_mtu_s *mtu; FAR struct icmpv6_prefixinfo_s *prefix; + uint16_t l1size; + uint16_t l3size; /* Set up the IPv6 header */ @@ -147,8 +124,14 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Length excludes the IPv6 header */ - icmp->len[0] = (sizeof(struct icmpv6_radvertise_s) >> 8); - icmp->len[1] = (sizeof(struct icmpv6_radvertise_s) & 0xff); + l1size = NET_LL_HDRLEN(dev); + l3size = sizeof(icmpv6_router_advertise_s) + + SIZEOF_ICMPV6_SRCLLADDR_S(l1size) + + sizeof(struct icmpv6_mtu_s) + + sizeof(icmpv6_prefixinfo_s); + + icmp->len[0] = (l3size >> 8); + icmp->len[1] = (l3size & 0xff); icmp->proto = IP_PROTO_ICMP6; /* Next header */ icmp->ttl = 255; /* Hop limit */ @@ -173,13 +156,16 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Set up the source address option */ - srcaddr = &adv->srcaddr; + srcaddr = (FAR struct icmpv6_srclladdr_s *) + ((FAR uint8_t *)adv + sizeof(icmpv6_router_advertise_s)); srcaddr->opttype = ICMPv6_OPT_SRCLLADDR; - srcaddr->optlen = 1; - memcpy(srcaddr->srclladdr, &dev->d_mac.ether.ether_addr_octet, ETHER_ADDR_LEN); + srcaddr->optlen = ICMPv6_OPT_OCTECTS(l1size); + memcpy(srcaddr->srclladdr, &dev->d_mac, l1size); /* Set up the MTU option */ + mtu = (FAR struct icmpv6_mtu_s *) + ((FAR uint8_t *)srcaddr + SIZEOF_ICMPV6_SRCLLADDR_S(l1size)); mtu = &adv->mtu; mtu->opttype = ICMPv6_OPT_MTU; mtu->optlen = 1; @@ -189,6 +175,8 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Set up the prefix option */ + prefix = (FAR struct icmpv6_prefixinfo_s *) + ((FAR uint8_t *)mtu + sizeof(icmpv6_mtu_s)); prefix = &adv->prefix; prefix->opttype = ICMPv6_OPT_MTU; prefix->optlen = 4; @@ -210,7 +198,7 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Set the size to the size of the IPv6 header and the payload size */ - dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_radvertise_s); + dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_router_advertise_s); #ifdef CONFIG_NET_ETHERNET /* Add the size of the Ethernet header */ diff --git a/net/icmpv6/icmpv6_rsolicit.c b/net/icmpv6/icmpv6_rsolicit.c index 93a26314329..723ed6c1cdb 100644 --- a/net/icmpv6/icmpv6_rsolicit.c +++ b/net/icmpv6/icmpv6_rsolicit.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/icmpv6/icmpv6_rsolicit.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -92,6 +92,8 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) FAR struct icmpv6_iphdr_s *icmp; FAR struct icmpv6_router_solicit_s *sol; FAR struct eth_hdr_s *eth; + uint16_t l1size; + uint16_t l3size; /* Set up the IPv6 header (most is probably already in place) */ @@ -102,8 +104,10 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Length excludes the IPv6 header */ - icmp->len[0] = (sizeof(struct icmpv6_router_solicit_s) >> 8); - icmp->len[1] = (sizeof(struct icmpv6_router_solicit_s) & 0xff); + l1size = NET_LL_HDRLEN(dev); + l3size = SIZEOF_ICMPV6_ROUTER_SOLICIT_S(l1size); + icmp->len[0] = (l3size >> 8); + icmp->len[1] = (l3size & 0xff); icmp->proto = IP_PROTO_ICMP6; /* Next header */ icmp->ttl = 255; /* Hop limit */ @@ -130,14 +134,14 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Set up the options */ - sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ - sol->optlen = 1; /* Option length = 1 octet */ + sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ + sol->optlen = ICMPv6_OPT_OCTECTS(l1size); /* Option length in octets */ /* Copy our link layer address into the message * REVISIT: What if the link layer is not Ethernet? */ - memcpy(sol->srclladdr, dev->d_mac.ether.ether_addr_octet, sizeof(net_ipv6addr_t)); + memcpy(sol->srclladdr, &dev->d_mac, l1size); /* Calculate the checksum over both the ICMP header and payload */ @@ -146,7 +150,7 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Set the size to the size of the IPv6 header and the payload size */ - dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_router_solicit_s); + dev->d_len = IPv6_HDRLEN + l3size; #ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_MULTILINK @@ -182,6 +186,7 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Add the size of the layer layer header to the total size of the * outgoing packet. */ + dev->d_len += netdev_ipv6_hdrlen(dev); ninfo("Outgoing ICMPv6 Router Solicitation length: %d (%d)\n", dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); diff --git a/net/icmpv6/icmpv6_solicit.c b/net/icmpv6/icmpv6_solicit.c index 5eae392c522..71879609c95 100644 --- a/net/icmpv6/icmpv6_solicit.c +++ b/net/icmpv6/icmpv6_solicit.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/icmpv6/icmpv6_solicit.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,7 +102,8 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, { FAR struct icmpv6_iphdr_s *icmp; FAR struct icmpv6_neighbor_solicit_s *sol; - FAR struct eth_hdr_s *eth; + uint16_t l1size; + uint16_t l3size; /* Set up the IPv6 header (most is probably already in place) */ @@ -113,8 +114,10 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Length excludes the IPv6 header */ - icmp->len[0] = (sizeof(struct icmpv6_neighbor_solicit_s) >> 8); - icmp->len[1] = (sizeof(struct icmpv6_neighbor_solicit_s) & 0xff); + l1size = NET_LL_HDRLEN(dev); + l3size = SIZEOF_ICMPV6_NEIGHBOR_SOLICIT_S(l1size); + icmp->len[0] = (l3size >> 8); + icmp->len[1] = (l3size & 0xff); icmp->proto = IP_PROTO_ICMP6; /* Next header */ icmp->ttl = 255; /* Hop limit */ @@ -145,14 +148,14 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Set up the options */ - sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ - sol->optlen = 1; /* Option length = 1 octet */ + sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ + sol->optlen = ICMPv6_OPT_OCTECTS(l1size); /* Option length in octets */ /* Copy our link layer address into the message * REVISIT: What if the link layer is not Ethernet? */ - memcpy(sol->srclladdr, &dev->d_mac.ether, IFHWADDRLEN); + memcpy(sol->srclladdr, &dev->d_mac, l1size); /* Calculate the checksum over both the ICMP header and payload */ @@ -161,13 +164,15 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Set the size to the size of the IPv6 header and the payload size */ - dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_neighbor_solicit_s); + dev->d_len = IPv6_HDRLEN + l3size; #ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_MULTILINK if (dev->d_lltype == NET_LL_ETHERNET) #endif { + FAR struct eth_hdr_s *eth; + /* Set the destination IPv6 multicast Ethernet address: * * For IPv6 multicast addresses, the Ethernet MAC is derived by diff --git a/net/neighbor/neighbor.h b/net/neighbor/neighbor.h index a8317f6d362..378b6fa2119 100644 --- a/net/neighbor/neighbor.h +++ b/net/neighbor/neighbor.h @@ -67,6 +67,7 @@ /**************************************************************************** * Public Types ****************************************************************************/ + /* Describes the link layer address */ struct neighbor_addr_s From f323f758876bcdf571a6a198c5dbd805dbad90e1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 13:36:59 -0600 Subject: [PATCH 12/21] IPv6 Neighbor: Update table format to support IEEE 802.15.4 MAC addresses. --- net/icmpv6/icmpv6_input.c | 11 ++++- net/neighbor/Kconfig | 2 - net/neighbor/Make.defs | 4 ++ net/neighbor/neighbor.h | 67 +++++++++++++++++++++++++--- net/neighbor/neighbor_add.c | 56 +++++++++++++++++------ net/neighbor/neighbor_ethernet_out.c | 2 +- net/neighbor/neighbor_findentry.c | 22 +++------ net/neighbor/neighbor_lookup.c | 8 ---- 8 files changed, 122 insertions(+), 50 deletions(-) diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c index 7ced607b596..ab584c65afb 100644 --- a/net/icmpv6/icmpv6_input.c +++ b/net/icmpv6/icmpv6_input.c @@ -74,6 +74,14 @@ #define ICMPv6RADVERTISE \ ((struct icmpv6_router_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) +#if defined(CONFIG_NET_MULTILINK) +# define DEV_LLTYPE(d) ((d)->d_lltype) +#elif defined(CONFIG_NET_ETHERNET) +# define DEV_LLTYPE(d) NET_LL_ETHERNET +#elif defined(CONFIG_NET_6LOWPAN) +# define DEV_LLTYPE(d) NET_LL_IEEE802154 +#endif + /**************************************************************************** * Public Data ****************************************************************************/ @@ -167,8 +175,7 @@ void icmpv6_input(FAR struct net_driver_s *dev) { /* Save the sender's address mapping in our Neighbor Table. */ - neighbor_add(icmp->srcipaddr, - (FAR struct neighbor_addr_s *)adv->tgtlladdr); + neighbor_add(icmp->srcipaddr, DEV_LLTYPE(dev), adv->tgtlladdr); #ifdef CONFIG_NET_ICMPv6_NEIGHBOR /* Then notify any logic waiting for the Neighbor Advertisement */ diff --git a/net/neighbor/Kconfig b/net/neighbor/Kconfig index 6792e0846d3..89405c4e48f 100644 --- a/net/neighbor/Kconfig +++ b/net/neighbor/Kconfig @@ -9,6 +9,4 @@ config NET_IPv6_NCONF_ENTRIES int "Number of IPv6 neighbors" default 8 -#config NET_IPv6_NEIGHBOR_ADDRTYPE - endif # NET_IPv6 diff --git a/net/neighbor/Make.defs b/net/neighbor/Make.defs index 7f6b56244ec..dd466a9c248 100644 --- a/net/neighbor/Make.defs +++ b/net/neighbor/Make.defs @@ -50,6 +50,10 @@ ifeq ($(CONFIG_NET_6LOWPAN),y) # NET_CSRCS += neighbor_6lowpan_out.c endif +ifeq ($(CONFIG_DEBUG_NET_INFO),y) +NET_CSRCS += neighbor_dumpentry.c +endif + # Include utility build support DEPPATH += --dep-path neighbor diff --git a/net/neighbor/neighbor.h b/net/neighbor/neighbor.h index 378b6fa2119..bf9a3839d26 100644 --- a/net/neighbor/neighbor.h +++ b/net/neighbor/neighbor.h @@ -3,7 +3,7 @@ * Header file for database of link-local neighbors, used by IPv6 code and * to be used by future ARP code. * - * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * A leverage of logic from uIP which also has a BSD style license @@ -51,6 +51,7 @@ #include #include +#include #ifdef CONFIG_NET_IPv6 @@ -72,11 +73,19 @@ struct neighbor_addr_s { -#ifdef CONFIG_NET_IPv6_NEIGHBOR_ADDRTYPE - CONFIG_NET_IPv6_NEIGHBOR_ADDRTYPE na_addr; -#else - struct ether_addr na_addr; + union + { +#ifdef CONFIG_NET_MULTILINK + uint8_t na_lltype; #endif + +#ifdef CONFIG_NET_ETHERNET + struct ether_addr na_ethernet; +#endif +#ifdef CONFIG_NET_6LOWPAN + struct sixlowpan_addr_s na_sixlowpan; +#endif + } u; }; /* This structure describes on entry in the neighbor table. This is intended @@ -150,6 +159,7 @@ FAR struct neighbor_entry *neighbor_findentry(const net_ipv6addr_t ipaddr); * * Input Parameters: * ipaddr - The IPv6 address of the mapping. + * lltype - The link layer address type * addr - The link layer address of the mapping * * Returned Value: @@ -157,7 +167,8 @@ FAR struct neighbor_entry *neighbor_findentry(const net_ipv6addr_t ipaddr); * ****************************************************************************/ -void neighbor_add(FAR net_ipv6addr_t ipaddr, FAR struct neighbor_addr_s *addr); +void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype, + FAR uint8_t *addr); /**************************************************************************** * Name: neighbor_lookup @@ -212,6 +223,50 @@ void neighbor_update(const net_ipv6addr_t ipaddr); void neighbor_periodic(int hsec); +/**************************************************************************** + * Name: neighbor_dumpentry + * + * Description: + * Dump the conents of an entry Neighbor Table. + * + * Input Parameters: + * msg - Message to print with the entry + * neighbor - The table entry to dump + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_NET_INFO +void neighbor_dumpentry(FAR const char *msg, + FAR struct neighbor_entry *neighbor); +#else +# define neighbor_dumpentry(msg,neighbor) +#endif + +/**************************************************************************** + * Name: neighbor_dumpipaddr + * + * Description: + * Dump an IP address. + * + * Input Parameters: + * msg - Message to print with the entry + * ipaddr - The IP address to dump + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_NET_INFO +void neighbor_dumpipaddr(FAR const char *msg, + const net_ipv6addr_t ipaddr); +#else +# define neighbor_dumpipaddr(msg,ipaddr) +#endif + #endif /* CONFIG_NET_IPv6 */ #endif /* __NET_NEIGHBOR_NEIGHBOR_H */ diff --git a/net/neighbor/neighbor_add.c b/net/neighbor/neighbor_add.c index fed15353ae0..61fe2ac7dd8 100644 --- a/net/neighbor/neighbor_add.c +++ b/net/neighbor/neighbor_add.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/neighbor/neighbor_add.c * - * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * A leverage of logic from uIP which also has a BSD style license @@ -43,6 +43,7 @@ #include +#include #include #include @@ -63,6 +64,7 @@ * * Input Parameters: * ipaddr - The IPv6 address of the mapping. + * lltype - The link layer address type * addr - The link layer address of the mapping * * Returned Value: @@ -70,23 +72,36 @@ * ****************************************************************************/ -void neighbor_add(FAR net_ipv6addr_t ipaddr, FAR struct neighbor_addr_s *addr) +void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype, + FAR uint8_t *addr) { + uint8_t addrlen; uint8_t oldest_time; int oldest_ndx; int i; - ninfo("Add neighbor: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", - ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]), - ntohs(ipaddr[3]), ntohs(ipaddr[4]), ntohs(ipaddr[5]), - ntohs(ipaddr[6]), ntohs(ipaddr[7])); - ninfo(" at: %02x:%02x:%02x:%02x:%02x:%02x\n", - addr->na_addr.ether_addr_octet[0], - addr->na_addr.ether_addr_octet[1], - addr->na_addr.ether_addr_octet[2], - addr->na_addr.ether_addr_octet[3], - addr->na_addr.ether_addr_octet[4], - addr->na_addr.ether_addr_octet[5]); + /* Get the length of the address for this link layer type */ + +#ifdef CONFIG_NET_ETHERNET +#ifdef CONFIG_NET_6LOWPAN + if (lltype == NET_LL_ETHERNET) +#endif + { + addrlen = IFHWADDRLEN; + } +#endif +#ifdef CONFIG_NET_6LOWPAN +#ifdef CONFIG_NET_ETHERNET + else +#endif + { +#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR + addrlen = NET_6LOWPAN_EADDRSIZE; +#else + addrlen = NET_6LOWPAN_SADDRSIZE; +#endif + } +#endif /* Find the first unused entry or the oldest used entry. */ @@ -101,7 +116,12 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, FAR struct neighbor_addr_s *addr) break; } +#ifdef CONFIG_NET_MULTILINK + if (g_neighbors[i].ne_addr.na_lltype == lltype && + net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr)) +#else if (net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr)) +#endif { oldest_ndx = i; break; @@ -120,5 +140,13 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, FAR struct neighbor_addr_s *addr) g_neighbors[oldest_ndx].ne_time = 0; net_ipv6addr_copy(g_neighbors[oldest_ndx].ne_ipaddr, ipaddr); - memcpy(&g_neighbors[oldest_ndx].ne_addr, addr, sizeof(struct neighbor_addr_s)); + +#ifdef CONFIG_NET_MULTILINK + g_neighbors[oldest_ndx].ne_addr.na_lltype = lltype; +#endif + memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr, addrlen); + + /* Dump the contents of the new entry */ + + neighbor_dumpentry("Added entry", &g_neighbors[oldest_ndx]); } diff --git a/net/neighbor/neighbor_ethernet_out.c b/net/neighbor/neighbor_ethernet_out.c index f342f7cc403..4da54e42fc2 100644 --- a/net/neighbor/neighbor_ethernet_out.c +++ b/net/neighbor/neighbor_ethernet_out.c @@ -240,7 +240,7 @@ void neighbor_out(FAR struct net_driver_s *dev) /* Build an Ethernet header. */ - memcpy(eth->dest, naddr->na_addr.ether_addr_octet, ETHER_ADDR_LEN); + memcpy(eth->dest, naddr->u.na_ethernet.ether_addr_octet, ETHER_ADDR_LEN); } /* Finish populating the Ethernet header */ diff --git a/net/neighbor/neighbor_findentry.c b/net/neighbor/neighbor_findentry.c index fe6a7b7b319..7cd1e3fd760 100644 --- a/net/neighbor/neighbor_findentry.c +++ b/net/neighbor/neighbor_findentry.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/neighbor/neighbor_findentry.c * - * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * A leverage of logic from uIP which also has a BSD style license @@ -49,7 +49,7 @@ #include "neighbor/neighbor.h" /**************************************************************************** - * Private Functions + * Public Functions ****************************************************************************/ /**************************************************************************** @@ -72,29 +72,17 @@ FAR struct neighbor_entry *neighbor_findentry(const net_ipv6addr_t ipaddr) { int i; - ninfo("Find neighbor: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", - ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]), - ntohs(ipaddr[3]), ntohs(ipaddr[4]), ntohs(ipaddr[5]), - ntohs(ipaddr[6]), ntohs(ipaddr[7])); - for (i = 0; i < CONFIG_NET_IPv6_NCONF_ENTRIES; ++i) { FAR struct neighbor_entry *neighbor = &g_neighbors[i]; if (net_ipv6addr_cmp(neighbor->ne_ipaddr, ipaddr)) { - ninfo(" at: %02x:%02x:%02x:%02x:%02x:%02x\n", - neighbor->ne_addr.na_addr.ether_addr_octet[0], - neighbor->ne_addr.na_addr.ether_addr_octet[1], - neighbor->ne_addr.na_addr.ether_addr_octet[2], - neighbor->ne_addr.na_addr.ether_addr_octet[3], - neighbor->ne_addr.na_addr.ether_addr_octet[4], - neighbor->ne_addr.na_addr.ether_addr_octet[5]); - - return &g_neighbors[i]; + neighbor_dumpentry("Entry found", neighbor); + return neighbor; } } - ninfo(" Not found\n"); + neighbor_dumpipaddr("Not found", ipaddr); return NULL; } diff --git a/net/neighbor/neighbor_lookup.c b/net/neighbor/neighbor_lookup.c index 01f029b69fa..67d8764303a 100644 --- a/net/neighbor/neighbor_lookup.c +++ b/net/neighbor/neighbor_lookup.c @@ -76,14 +76,6 @@ FAR const struct neighbor_addr_s *neighbor_lookup(const net_ipv6addr_t ipaddr) neighbor = neighbor_findentry(ipaddr); if (neighbor != NULL) { - ninfo("Lookup neighbor: %02x:%02x:%02x:%02x:%02x:%02x\n", - neighbor->ne_addr.na_addr.ether_addr_octet[0], - neighbor->ne_addr.na_addr.ether_addr_octet[1], - neighbor->ne_addr.na_addr.ether_addr_octet[2], - neighbor->ne_addr.na_addr.ether_addr_octet[3], - neighbor->ne_addr.na_addr.ether_addr_octet[4], - neighbor->ne_addr.na_addr.ether_addr_octet[5]); - return &neighbor->ne_addr; } From 9794672c0274252d99a9ec0bb98ad75225d3b7b7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 14:03:04 -0600 Subject: [PATCH 13/21] Forgot to add a file before the last commit --- net/neighbor/neighbor_dumpentry.c | 138 ++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 net/neighbor/neighbor_dumpentry.c diff --git a/net/neighbor/neighbor_dumpentry.c b/net/neighbor/neighbor_dumpentry.c new file mode 100644 index 00000000000..c66d9982851 --- /dev/null +++ b/net/neighbor/neighbor_dumpentry.c @@ -0,0 +1,138 @@ +/**************************************************************************** + * net/neighbor/neighbor_dumpentry.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include "neighbor/neighbor.h" + +#ifdef CONFIG_DEBUG_NET_INFO + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: neighbor_dumpentry + * + * Description: + * Dump the conents of an entry Neighbor Table. + * + * Input Parameters: + * msg - Message to print with the entry + * neighbor - The table entry to dump + * + * Returned Value: + * None + * + ****************************************************************************/ + +void neighbor_dumpentry(FAR const char *msg, + FAR struct neighbor_entry *neighbor) +{ + ninfo("%s: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + msg, + ntohs(neighbor->ne_ipaddr[0]), ntohs(neighbor->ne_ipaddr[1]), + ntohs(neighbor->ne_ipaddr[2]), ntohs(neighbor->ne_ipaddr[3]), + ntohs(neighbor->ne_ipaddr[4]), ntohs(neighbor->ne_ipaddr[5]), + ntohs(neighbor->ne_ipaddr[6]), ntohs(neighbor->ne_ipaddr[7])); + +#ifdef CONFIG_NET_ETHERNET +#ifdef CONFIG_NET_6LOWPAN + if (neighbor->ne_addr.na_lltype == NET_LL_ETHERNET) +#endif + { + ninfo(" at: %02x:%02x:%02x:%02x:%02x:%02x\n", + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[0], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[1], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[2], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[3], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[4], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[5]); + } +#endif +#ifdef CONFIG_NET_6LOWPAN +#ifdef CONFIG_NET_ETHERNET + else +#endif + { +#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR + ninfo(" at: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", + neighbor->ne_addr.u.na_sixlowpan.u8[0], + neighbor->ne_addr.u.na_sixlowpan.u8[1], + neighbor->ne_addr.u.na_sixlowpan.u8[2], + neighbor->ne_addr.u.na_sixlowpan.u8[3], + neighbor->ne_addr.u.na_sixlowpan.u8[4], + neighbor->ne_addr.u.na_sixlowpan.u8[5], + neighbor->ne_addr.u.na_sixlowpan.u8[6], + neighbor->ne_addr.u.na_sixlowpan.u8[7]); +#else + ninfo(" at: %02x:%02x\n", + neighbor->ne_addr.u.na_sixlowpan.u8[0], + neighbor->ne_addr.u.na_sixlowpan.u8[1]); + } +#endif +#endif +} + +/**************************************************************************** + * Name: neighbor_dumpipaddr + * + * Description: + * Dump an IP address. + * + * Input Parameters: + * msg - Message to print with the entry + * ipaddr - The IP address to dump + * + * Returned Value: + * None + * + ****************************************************************************/ + +void neighbor_dumpipaddr(FAR const char *msg, + const net_ipv6addr_t ipaddr) +{ + ninfo("%s: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + msg, + ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]), + ntohs(ipaddr[3]), ntohs(ipaddr[4]), ntohs(ipaddr[5]), + ntohs(ipaddr[6]), ntohs(ipaddr[7])); +} + +#endif /* CONFIG_DEBUG_NET_INFO */ From 6c5e0d870c3360bc6822bce4d9e2b93380c92f4c Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 6 Jul 2017 14:04:11 -0600 Subject: [PATCH 14/21] configs/Board.mk: Remove quotes from CONFIG_ARCH_FAMILY. Causes problems with Windows native build. --- configs/Board.mk | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/configs/Board.mk b/configs/Board.mk index 2fc49586d79..076de67c4ea 100644 --- a/configs/Board.mk +++ b/configs/Board.mk @@ -50,6 +50,9 @@ OBJS = $(AOBJS) $(COBJS) SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src +ifneq ($(CONFIG_ARCH_FAMILY),) + ARCH_FAMILY = $(patsubst "%",%,$(CONFIG_ARCH_FAMILY)) +endif ifneq ($(ZDSVERSION),) ifeq ($(WINTOOL),y) @@ -67,8 +70,8 @@ ifeq ($(CONFIG_ARCH_SIM),y) else CFLAGS += -I "${shell cygpath -w $(ARCHSRCDIR)$(DELIM)chip}" CFLAGS += -I "${shell cygpath -w $(ARCHSRCDIR)$(DELIM)common}" -ifneq ($(CONFIG_ARCH_FAMILY),) - CFLAGS += -I "${shell cygpath -w $(ARCHSRCDIR)$(DELIM)$(CONFIG_ARCH_FAMILY)}" +ifneq ($(ARCH_FAMILY),) + CFLAGS += -I "${shell cygpath -w $(ARCHSRCDIR)$(DELIM)$(ARCH_FAMILY)}" endif endif else @@ -78,8 +81,8 @@ ifeq ($(CONFIG_ARCH_SIM),y) else CFLAGS += -I$(ARCHSRCDIR)$(DELIM)chip CFLAGS += -I$(ARCHSRCDIR)$(DELIM)common -ifneq ($(CONFIG_ARCH_FAMILY),) - CFLAGS += -I$(ARCHSRCDIR)$(DELIM)$(CONFIG_ARCH_FAMILY) +ifneq ($(ARCH_FAMILY),) + CFLAGS += -I$(ARCHSRCDIR)$(DELIM)$(ARCH_FAMILY) endif endif endif From b5d7187df670d8ec0e2fe578b6ae5dfea9078830 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 16:19:10 -0600 Subject: [PATCH 15/21] IP forwarding design simplication; might save some memory. Also fix some compile issues introduce with last commit in MULTINIC configration. --- net/devif/devif_forward.c | 24 ++++------ net/devif/ip_forward.h | 7 +-- net/devif/ipv4_forward.c | 73 ++++++++++++------------------ net/devif/ipv6_forward.c | 75 ++++++++++++------------------- net/icmp/icmp_foward.c | 17 ++++--- net/icmpv6/icmpv6_forward.c | 13 ++++-- net/neighbor/neighbor_add.c | 7 ++- net/neighbor/neighbor_dumpentry.c | 4 +- net/tcp/tcp_forward.c | 17 ++++--- net/udp/udp_forward.c | 26 ++++++++--- 10 files changed, 127 insertions(+), 136 deletions(-) diff --git a/net/devif/devif_forward.c b/net/devif/devif_forward.c index 87e4ad07e58..25fd323be74 100644 --- a/net/devif/devif_forward.c +++ b/net/devif/devif_forward.c @@ -75,26 +75,18 @@ void devif_forward(FAR struct forward_s *fwd) unsigned int offset; int ret; - DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); offset = NET_LL_HDRLEN(fwd->f_dev); - /* Copy the saved L2 + L3 header */ + /* Copy the IOB chain that contains the L3L3 headers and any data payload */ - DEBUGASSERT(offset + fwd->f_hdrsize <= NET_DEV_MTU(fwd->f_dev)); - memcpy(&fwd->f_dev->d_buf[offset], &fwd->f_hdr, fwd->f_hdrsize); - offset += fwd->f_hdrsize; + DEBUGASSERT(fwd->f_iob->io_pktlen >= fwd->f_hdrsize); + DEBUGASSERT(offset + fwd->f_iob->io_pktlen <= NET_DEV_MTU(fwd->f_dev)); + ret = iob_copyout(&fwd->f_dev->d_buf[offset], fwd->f_iob, + fwd->f_iob->io_pktlen, 0); - /* Copy the IOB chain that contains the payload */ - - if (fwd->f_iob != NULL && fwd->f_iob->io_pktlen > 0) - { - DEBUGASSERT(offset + fwd->f_iob->io_pktlen <= NET_DEV_MTU(fwd->f_dev)); - ret = iob_copyout(&fwd->f_dev->d_buf[offset], fwd->f_iob, - fwd->f_iob->io_pktlen, 0); - - DEBUGASSERT(ret == fwd->f_iob->io_pktlen); - offset += fwd->f_iob->io_pktlen; - } + DEBUGASSERT(ret == fwd->f_iob->io_pktlen); + offset += fwd->f_iob->io_pktlen; fwd->f_dev->d_sndlen = offset; } diff --git a/net/devif/ip_forward.h b/net/devif/ip_forward.h index 5eed4d8bb3f..3180f16ac71 100644 --- a/net/devif/ip_forward.h +++ b/net/devif/ip_forward.h @@ -73,6 +73,8 @@ # define CONFIG_NET_IPFORWARD_NSTRUCT 4 #endif +#define FWD_HEADER(fwd) (FAR union fwd_iphdr_u *)((fwd)->f_iob->io_data) + /**************************************************************************** * Public Types ****************************************************************************/ @@ -158,10 +160,9 @@ struct forward_s { FAR struct forward_s *f_flink; /* Supports a singly linked list */ FAR struct net_driver_s *f_dev; /* Forwarding device */ - FAR struct iob_s *f_iob; /* IOBs containing the data payload */ + FAR struct iob_s *f_iob; /* IOB chain containing the packet */ FAR struct devif_callback_s *f_cb; /* Reference to callback instance */ - union fwd_iphdr_u f_hdr; /* Copy of original L2+L3 headers */ - union fwd_conn_u f_conn; /* Protocol-specific connectin struct */ + union fwd_conn_u f_conn; /* Protocol-specific connection struct */ uint8_t f_hdrsize; /* The size of the L2+L3 headers */ }; diff --git a/net/devif/ipv4_forward.c b/net/devif/ipv4_forward.c index 6487a5fff87..20077493136 100644 --- a/net/devif/ipv4_forward.c +++ b/net/devif/ipv4_forward.c @@ -267,8 +267,6 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4) { FAR struct forward_s *fwd = NULL; - FAR uint8_t *payload; - unsigned int paysize; int hdrsize; int ret; @@ -318,73 +316,58 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev, goto errout_with_fwd; } - /* Save the entire L2 and L3 headers in the state structure */ + /* The L2/L3 headers must fit within one, contiguous IOB. */ - if (hdrsize > sizeof(union fwd_iphdr_u)) + if (hdrsize > CONFIG_IOB_BUFSIZE) { nwarn("WARNING: Header is too big for pre-allocated structure\n"); ret = -E2BIG; goto errout_with_fwd; } - memcpy(&fwd->f_hdr.ipv4, ipv4, hdrsize); fwd->f_hdrsize = hdrsize; - /* Decrement the TTL in the copy of the IPv4 header (retaining the - * original TTL in the source). If it decrements to zero, then drop - * the packet. + /* Try to allocate the head of an IOB chain. If this fails, the + * packet will be dropped; we are not operating in a context + * where waiting for an IOB is a good idea */ - ret = ipv4_decr_ttl(&fwd->f_hdr.ipv4.l2); - if (ret < 1) + fwd->f_iob = iob_tryalloc(false); + if (fwd->f_iob == NULL) { - nwarn("WARNING: Hop limit exceeded... Dropping!\n"); - ret = -EMULTIHOP; + nwarn("WARNING: iob_tryalloc() failed\n"); + ret = -ENOMEM; goto errout_with_fwd; } - /* Use the L2 + L3 header size to determine start and size of the data - * payload. - * - * Remember that the size of the L1 header has already been subtracted - * from dev->d_len. - */ - - payload = (FAR uint8_t *)ipv4 + hdrsize; - paysize = dev->d_len - hdrsize; - - /* If there is a payload, then copy it into an IOB chain. + /* Copy the L2/L3 headers plus any following payload into an IOB chain. + * iob_trycopin() will not wait, but will fail there are no available + * IOBs. * * REVISIT: Consider an alternative design that does not require data * copying. This would require a pool of d_buf's that are managed by * the network rather than the network device. */ - if (paysize > 0) + ret = iob_trycopyin(fwd->f_iob, (FAR const uint8_t *)ipv4, + dev->d_len, 0, false); + if (ret < 0) { - /* Try to allocate the head of an IOB chain. If this fails, the - * packet will be dropped; we are not operating in a context - * where waiting for an IOB is a good idea - */ + nwarn("WARNING: iob_trycopyin() failed: %d\n", ret); + goto errout_with_iobchain; + } - fwd->f_iob = iob_tryalloc(false); - if (fwd->f_iob == NULL) - { - nwarn("WARNING: iob_tryalloc() failed\n"); - ret = -ENOMEM; - goto errout_with_fwd; - } + /* Decrement the TTL in the copy of the IPv4 header (retaining the + * original TTL in the source to handle the broadcast case). If the + * TLL decrements to zero, then do not forward the packet. + */ - /* Copy the packet data payload into an IOB chain. iob_trycopin() will - * not wait, but will fail there are no available IOBs. - */ - - ret = iob_trycopyin(fwd->f_iob, payload, paysize, 0, false); - if (ret < 0) - { - nwarn("WARNING: iob_trycopyin() failed: %d\n", ret); - goto errout_with_iobchain; - } + ret = ipv4_decr_ttl((FAR struct ipv4_hdr_s *)fwd->f_iob->io_data); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + goto errout_with_iobchain; } /* Then set up to forward the packet according to the protocol. diff --git a/net/devif/ipv6_forward.c b/net/devif/ipv6_forward.c index 055968c7fbb..1ece8ccee76 100644 --- a/net/devif/ipv6_forward.c +++ b/net/devif/ipv6_forward.c @@ -381,9 +381,6 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev, } else if (ret == PACKET_NOT_FORWARDED) { - FAR uint8_t *payload; - unsigned int paysize; - /* Verify that the full packet will fit within the forwarding devices * MTU. We provide no support for fragmenting forwarded packets. */ @@ -430,74 +427,58 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev, goto errout_with_fwd; } - /* Save the entire L2 and L3 headers in the state structure */ + /* The L2/L3 headers must fit within one, contiguous IOB. */ - if (hdrsize > sizeof(union fwd_iphdr_u)) + if (hdrsize > CONFIG_IOB_BUFSIZE) { nwarn("WARNING: Header is too big for pre-allocated structure\n"); ret = -E2BIG; goto errout_with_fwd; } - memcpy(&fwd->f_hdr.ipv6, ipv6, hdrsize); fwd->f_hdrsize = hdrsize; - /* Decrement the TTL in the copy of the IPv6 header (retaining the - * original TTL in the source). If it decrements to zero, then drop - * the packet. + /* Try to allocate the head of an IOB chain. If this fails, the + * packet will be dropped; we are not operating in a context where + * waiting for an IOB is a good idea */ - ret = ipv6_decr_ttl(&fwd->f_hdr.ipv6.l2); - if (ret < 1) + fwd->f_iob = iob_tryalloc(false); + if (fwd->f_iob == NULL) { - nwarn("WARNING: Hop limit exceeded... Dropping!\n"); - ret = -EMULTIHOP; + nwarn("WARNING: iob_tryalloc() failed\n"); + ret = -ENOMEM; goto errout_with_fwd; } - /* Use the L2 + L3 header size to determine start and size of the data - * payload. - * - * Remember that the size of the L1 header has already been subtracted - * from dev->d_len. - */ - - payload = (FAR uint8_t *)ipv6 + hdrsize; - paysize = dev->d_len - hdrsize; - - /* If there is a payload, then copy it into an IOB chain. + /* Copy the L2/L3 headers plus any following payload into an IOB + * chain. iob_trycopin() will not wait, but will fail there are no + * available IOBs. * * REVISIT: Consider an alternative design that does not require data * copying. This would require a pool of d_buf's that are managed by * the network rather than the network device. */ - if (paysize > 0) + ret = iob_trycopyin(fwd->f_iob, (FAR const uint8_t *)ipv6, + dev->d_len, 0, false); + if (ret < 0) { - /* Try to allocate the head of an IOB chain. If this fails, - * the packet will be dropped; we are not operating in a - * context where waiting for an IOB is a good idea - */ + nwarn("WARNING: iob_trycopyin() failed: %d\n", ret); + goto errout_with_iobchain; + } - fwd->f_iob = iob_tryalloc(false); - if (fwd->f_iob == NULL) - { - nwarn("WARNING: iob_tryalloc() failed\n"); - ret = -ENOMEM; - goto errout_with_fwd; - } + /* Decrement the TTL in the copy of the IPv6 header (retaining the + * original TTL in the sourcee to handle the broadcast case). If the + * TTL decrements to zero, then do not forward the packet. + */ - /* Copy the packet data payload into an IOB chain. - * iob_trycopin() will not wait, but will fail there are no - * available IOBs. - */ - - ret = iob_trycopyin(fwd->f_iob, payload, paysize, 0, false); - if (ret < 0) - { - nwarn("WARNING: iob_trycopyin() failed: %d\n", ret); - goto errout_with_iobchain; - } + ret = ipv6_decr_ttl((FAR struct ipv6_hdr_s *)fwd->f_iob->io_data); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + goto errout_with_iobchain; } /* Then set up to forward the packet according to the protocol. diff --git a/net/icmp/icmp_foward.c b/net/icmp/icmp_foward.c index c46b626889a..e1423907d64 100644 --- a/net/icmp/icmp_foward.c +++ b/net/icmp/icmp_foward.c @@ -96,6 +96,12 @@ #ifdef CONFIG_NET_ETHERNET static inline bool icmp_forward_addrchck(FAR struct forward_s *fwd) { +#if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) + FAR union fwd_iphdr_u *iphdr; +#endif + + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); + /* REVISIT: Could the MAC address not also be in a routing table? */ #ifdef CONFIG_NET_MULTILINK @@ -106,7 +112,8 @@ static inline bool icmp_forward_addrchck(FAR struct forward_s *fwd) #endif #if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) - return (arp_find(fwd->f_hdr.ipv4.l2.destipaddr) != NULL); + iphdr = FWD_HEADER(fwd); + return (arp_find(iphdr->ipv4.l2.destipaddr) != NULL); #else return true; #endif @@ -164,13 +171,13 @@ static inline void icmp_dropstats(FAR struct forward_s *fwd) ****************************************************************************/ static uint16_t icmp_forward_interrupt(FAR struct net_driver_s *dev, - FAR void *conn, FAR void *pvpriv, - uint16_t flags) + FAR void *conn, FAR void *pvpriv, + uint16_t flags) { FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv; ninfo("flags: %04x\n", flags); - DEBUGASSERT(fwd != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Make sure that this is from the forwarding device */ @@ -274,7 +281,7 @@ static uint16_t icmp_forward_interrupt(FAR struct net_driver_s *dev, int icmp_forward(FAR struct forward_s *fwd) { - DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Set up the callback in the connection */ diff --git a/net/icmpv6/icmpv6_forward.c b/net/icmpv6/icmpv6_forward.c index f1a6f8cb3de..17f35f2dd62 100644 --- a/net/icmpv6/icmpv6_forward.c +++ b/net/icmpv6/icmpv6_forward.c @@ -92,6 +92,12 @@ #ifdef CONFIG_NET_ETHERNET static inline bool icmpv6_forward_addrchck(FAR struct forward_s *fwd) { +#if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) + FAR union fwd_iphdr_u *iphdr; +#endif + + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); + /* REVISIT: Could the MAC address not also be in a routing table? */ #ifdef CONFIG_NET_MULTILINK @@ -102,7 +108,8 @@ static inline bool icmpv6_forward_addrchck(FAR struct forward_s *fwd) #endif #if !defined(CONFIG_NET_ICMPv6_NEIGHBOR) - return (neighbor_findentry(fwd->f_hdr.ipv6.l2.destipaddr) != NULL); + iphdr = FWD_HEADER(fwd); + return (arp_find(iphdr->ipv6.l2.destipaddr) != NULL); #else return true; #endif @@ -166,7 +173,7 @@ static uint16_t icmpv6_forward_interrupt(FAR struct net_driver_s *dev, FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv; ninfo("flags: %04x\n", flags); - DEBUGASSERT(fwd != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Make sure that this is from the forwarding device */ @@ -270,7 +277,7 @@ static uint16_t icmpv6_forward_interrupt(FAR struct net_driver_s *dev, int icmpv6_forward(FAR struct forward_s *fwd) { - DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Set up the callback in the connection */ diff --git a/net/neighbor/neighbor_add.c b/net/neighbor/neighbor_add.c index 61fe2ac7dd8..f5c04872783 100644 --- a/net/neighbor/neighbor_add.c +++ b/net/neighbor/neighbor_add.c @@ -47,6 +47,9 @@ #include #include +#include + +#include #include #include "neighbor/neighbor.h" @@ -117,7 +120,7 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype, } #ifdef CONFIG_NET_MULTILINK - if (g_neighbors[i].ne_addr.na_lltype == lltype && + if (g_neighbors[i].ne_addr.u.na_lltype == lltype && net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr)) #else if (net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr)) @@ -142,7 +145,7 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype, net_ipv6addr_copy(g_neighbors[oldest_ndx].ne_ipaddr, ipaddr); #ifdef CONFIG_NET_MULTILINK - g_neighbors[oldest_ndx].ne_addr.na_lltype = lltype; + g_neighbors[oldest_ndx].ne_addr.u.na_lltype = lltype; #endif memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr, addrlen); diff --git a/net/neighbor/neighbor_dumpentry.c b/net/neighbor/neighbor_dumpentry.c index c66d9982851..78369f09172 100644 --- a/net/neighbor/neighbor_dumpentry.c +++ b/net/neighbor/neighbor_dumpentry.c @@ -39,6 +39,8 @@ #include +#include + #include "neighbor/neighbor.h" #ifdef CONFIG_DEBUG_NET_INFO @@ -74,7 +76,7 @@ void neighbor_dumpentry(FAR const char *msg, #ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_6LOWPAN - if (neighbor->ne_addr.na_lltype == NET_LL_ETHERNET) + if (neighbor->ne_addr.u.na_lltype == NET_LL_ETHERNET) #endif { ninfo(" at: %02x:%02x:%02x:%02x:%02x:%02x\n", diff --git a/net/tcp/tcp_forward.c b/net/tcp/tcp_forward.c index c67cac7a6e7..cc85f05eb63 100644 --- a/net/tcp/tcp_forward.c +++ b/net/tcp/tcp_forward.c @@ -259,7 +259,7 @@ static uint16_t tcp_forward_interrupt(FAR struct net_driver_s *dev, FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv; ninfo("flags: %04x\n", flags); - DEBUGASSERT(fwd != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Make sure that this is from the forwarding device */ @@ -375,22 +375,25 @@ static uint16_t tcp_forward_interrupt(FAR struct net_driver_s *dev, int tcp_forward(FAR struct forward_s *fwd) { - DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); FAR struct tcp_conn_s *conn = &fwd->f_conn.tcp; + FAR union fwd_iphdr_u *iphdr; + + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Set up some minimal connection structure so that we appear to be a * real TCP connection. */ conn->dev = fwd->f_dev; + iphdr = FWD_HEADER(fwd); #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) + if ((iphdr->ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) #endif { - FAR struct ipv4_hdr_s *ipv4 = &fwd->f_hdr.ipv4.l2; - FAR struct tcp_hdr_s *tcp = &fwd->f_hdr.ipv4.l3.tcp; + FAR struct ipv4_hdr_s *ipv4 = &iphdr->ipv4.l2; + FAR struct tcp_hdr_s *tcp = &iphdr->ipv4.l3.tcp; #if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) conn->domain = PF_INET; @@ -406,8 +409,8 @@ int tcp_forward(FAR struct forward_s *fwd) else #endif { - FAR struct ipv6_hdr_s *ipv6 = &fwd->f_hdr.ipv6.l2; - FAR struct tcp_hdr_s *tcp = &fwd->f_hdr.ipv6.l3.tcp; + FAR struct ipv6_hdr_s *ipv6 = &iphdr->ipv6.l2; + FAR struct tcp_hdr_s *tcp = &iphdr->ipv6.l3.tcp; #if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) conn->domain = PF_INET6; diff --git a/net/udp/udp_forward.c b/net/udp/udp_forward.c index b2c1363ab05..8c0473592d9 100644 --- a/net/udp/udp_forward.c +++ b/net/udp/udp_forward.c @@ -86,9 +86,11 @@ #if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) static inline void forward_ipselect(FAR struct forward_s *fwd) { + FAR union fwd_iphdr_u *iphdr = FWD_HEADER(fwd); + /* Select IPv4 or IPv6 */ - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) + if ((iphdr->ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) { udp_ipv4_select(fwd->f_dev); } @@ -132,6 +134,10 @@ static inline void forward_ipselect(FAR struct forward_s *fwd) #ifdef CONFIG_NET_ETHERNET static inline bool udp_forward_addrchk(FAR struct forward_s *fwd) { + FAR union fwd_iphdr_u *iphdr; + + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); + /* REVISIT: Could the MAC address not also be in a routing table? */ #ifdef CONFIG_NET_MULTILINK @@ -141,13 +147,15 @@ static inline bool udp_forward_addrchk(FAR struct forward_s *fwd) } #endif + iphdr = FWD_HEADER(fwd); + #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) + if ((iphdr->ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) #endif { #if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) - return (arp_find(fwd->f_hdr.ipv4.l2.destipaddr) != NULL); + return (arp_find(iphdr->ipv4.l2.destipaddr) != NULL); #else return true; #endif @@ -160,7 +168,7 @@ static inline bool udp_forward_addrchk(FAR struct forward_s *fwd) #endif { #if !defined(CONFIG_NET_ICMPv6_NEIGHBOR) - return (neighbor_findentry(fwd->f_hdr.ipv6.l2.destipaddr) != NULL); + return (neighbor_findentry(iphdr->ipv6.l2.destipaddr) != NULL); #else return true; #endif @@ -189,6 +197,10 @@ static inline bool udp_forward_addrchk(FAR struct forward_s *fwd) #ifdef CONFIG_NET_STATISTICS static void udp_dropstats(FAR struct forward_s *fwd) { +#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) + FAR union fwd_iphdr_u *iphdr = FWD_HEADER(fwd); +#endif + /* Increment the count of dropped UDP packets */ g_netstats.udp.drop++; @@ -197,7 +209,7 @@ static void udp_dropstats(FAR struct forward_s *fwd) #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) + if ((iphdr->ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) #endif { g_netstats.ipv4.drop++; @@ -244,7 +256,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv; ninfo("flags: %04x\n", flags); - DEBUGASSERT(fwd != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Make sure that this is from the forwarding device */ @@ -357,7 +369,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, int udp_forward(FAR struct forward_s *fwd) { - DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Set up the callback in the connection */ From db69e4b09c2ab3ea1d7729b7390775b4de1c471b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 16:51:08 -0600 Subject: [PATCH 16/21] Another IP forwarding design simplification: Remove an unnecessary field from state structure. --- net/devif/devif_forward.c | 1 - net/devif/ip_forward.h | 1 - net/devif/ipv4_forward.c | 19 ++++++------------- net/devif/ipv6_forward.c | 19 ++++++------------- 4 files changed, 12 insertions(+), 28 deletions(-) diff --git a/net/devif/devif_forward.c b/net/devif/devif_forward.c index 25fd323be74..3e9aaf89aa2 100644 --- a/net/devif/devif_forward.c +++ b/net/devif/devif_forward.c @@ -80,7 +80,6 @@ void devif_forward(FAR struct forward_s *fwd) /* Copy the IOB chain that contains the L3L3 headers and any data payload */ - DEBUGASSERT(fwd->f_iob->io_pktlen >= fwd->f_hdrsize); DEBUGASSERT(offset + fwd->f_iob->io_pktlen <= NET_DEV_MTU(fwd->f_dev)); ret = iob_copyout(&fwd->f_dev->d_buf[offset], fwd->f_iob, fwd->f_iob->io_pktlen, 0); diff --git a/net/devif/ip_forward.h b/net/devif/ip_forward.h index 3180f16ac71..40c7c757da8 100644 --- a/net/devif/ip_forward.h +++ b/net/devif/ip_forward.h @@ -163,7 +163,6 @@ struct forward_s FAR struct iob_s *f_iob; /* IOB chain containing the packet */ FAR struct devif_callback_s *f_cb; /* Reference to callback instance */ union fwd_conn_u f_conn; /* Protocol-specific connection struct */ - uint8_t f_hdrsize; /* The size of the L2+L3 headers */ }; /**************************************************************************** diff --git a/net/devif/ipv4_forward.c b/net/devif/ipv4_forward.c index 20077493136..075f47bc7a8 100644 --- a/net/devif/ipv4_forward.c +++ b/net/devif/ipv4_forward.c @@ -80,7 +80,7 @@ * ****************************************************************************/ -#ifdef CONFIG_NETDEV_MULTINIC +#if defined(CONFIG_NETDEV_MULTINIC) && defined(CONFIG_DEBUG_NET_WARN) static int ipv4_hdrsize(FAR struct ipv4_hdr_s *ipv4) { /* Size is determined by the following protocol header, */ @@ -267,7 +267,9 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4) { FAR struct forward_s *fwd = NULL; +#ifdef CONFIG_DEBUG_NET_WARN int hdrsize; +#endif int ret; /* Verify that the full packet will fit within the forwarding devices MTU. @@ -297,16 +299,8 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev, fwd->f_dev = fwddev; /* Forwarding device */ - /* Get the size of the IPv4 + L3 header. Use this to determine start of - * the data payload. - * - * Remember that the size of the L1 header has already been subtracted - * from dev->d_len. - * - * REVISIT: Consider an alternative design that does not require data - * copying. This would require a pool of d_buf's that are managed by - * the network rather than the network device. - */ +#ifdef CONFIG_DEBUG_NET_WARN + /* Get the size of the IPv4 + L3 header. */ hdrsize = ipv4_hdrsize(ipv4); if (hdrsize < IPv4_HDRLEN) @@ -324,8 +318,7 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev, ret = -E2BIG; goto errout_with_fwd; } - - fwd->f_hdrsize = hdrsize; +#endif /* Try to allocate the head of an IOB chain. If this fails, the * packet will be dropped; we are not operating in a context diff --git a/net/devif/ipv6_forward.c b/net/devif/ipv6_forward.c index 1ece8ccee76..240ed6de6a3 100644 --- a/net/devif/ipv6_forward.c +++ b/net/devif/ipv6_forward.c @@ -86,7 +86,7 @@ * ****************************************************************************/ -#ifdef CONFIG_NETDEV_MULTINIC +#if defined(CONFIG_NETDEV_MULTINIC) && defined(CONFIG_DEBUG_NET_WARN) static int ipv6_hdrsize(FAR struct ipv6_hdr_s *ipv6) { /* Size is determined by the following protocol header, */ @@ -368,7 +368,9 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) { FAR struct forward_s *fwd = NULL; +#ifdef CONFIG_DEBUG_NET_WARN int hdrsize; +#endif int ret; /* Perform any necessary packet conversions. */ @@ -408,16 +410,8 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev, fwd->f_dev = fwddev; /* Forwarding device */ - /* Get the size of the IPv6 + L3 header. Use this to determine start - * of the data payload. - * - * Remember that the size of the L1 header has already been subtracted - * from dev->d_len. - * - * REVISIT: Consider an alternative design that does not require data - * copying. This would require a pool of d_buf's that are managed by - * the network rather than the network device. - */ +#ifdef CONFIG_DEBUG_NET_WARN + /* Get the size of the IPv6 + L3 header. */ hdrsize = ipv6_hdrsize(ipv6); if (hdrsize < IPv6_HDRLEN) @@ -435,8 +429,7 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev, ret = -E2BIG; goto errout_with_fwd; } - - fwd->f_hdrsize = hdrsize; +#endif /* Try to allocate the head of an IOB chain. If this fails, the * packet will be dropped; we are not operating in a context where From 70c6b52132c1cc156200ce101aab1933dd8e5619 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Jul 2017 19:37:01 -0600 Subject: [PATCH 17/21] ICMPv6: Fix an address size calculation that was bungled in a recent commit. --- net/devif/ip_forward.c | 9 ++- net/icmpv6/icmpv6_advertise.c | 33 +++++----- net/icmpv6/icmpv6_radvertise.c | 33 +++++----- net/icmpv6/icmpv6_rsolicit.c | 37 ++++++----- net/icmpv6/icmpv6_solicit.c | 41 ++++++------ net/neighbor/neighbor_add.c | 27 +------- net/netdev/Make.defs | 1 + net/netdev/netdev.h | 20 ++++++ net/netdev/netdev_l1size.c | 117 +++++++++++++++++++++++++++++++++ 9 files changed, 223 insertions(+), 95 deletions(-) create mode 100644 net/netdev/netdev_l1size.c diff --git a/net/devif/ip_forward.c b/net/devif/ip_forward.c index a1a59e23f52..4c5ac64ff28 100644 --- a/net/devif/ip_forward.c +++ b/net/devif/ip_forward.c @@ -40,8 +40,9 @@ #include #include -#include +#include #include +#include #include "devif/ip_forward.h" @@ -79,6 +80,12 @@ void ip_forward_initialize(void) FAR struct forward_s *fwd; int i; + /* The IOB size must be such that the maximum L2 and L3 headers fit into + * the contiguous memory of the first IOB in the IOB chain. + */ + + DEBUGASSERT(sizeof(union fwd_iphdr_u) <= CONFIG_IOB_BUFSIZE); + /* Add all pre-allocated forwarding structures to the free list */ g_fwdfree = NULL; diff --git a/net/icmpv6/icmpv6_advertise.c b/net/icmpv6/icmpv6_advertise.c index 75c46151604..3e5b6385be7 100644 --- a/net/icmpv6/icmpv6_advertise.c +++ b/net/icmpv6/icmpv6_advertise.c @@ -54,6 +54,7 @@ #include #include +#include "netdev/netdev.h" #include "utils/utils.h" #include "icmpv6/icmpv6.h" @@ -63,8 +64,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ICMPv6BUF ((struct icmpv6_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) +#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) +#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) #define ICMPv6ADVERTISE \ ((struct icmpv6_neighbor_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) @@ -94,31 +95,31 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, const net_ipv6addr_t destipaddr) { - FAR struct icmpv6_iphdr_s *icmp = ICMPv6BUF; + FAR struct ipv6_hdr_s *ipv6 = IPv6BUF; FAR struct icmpv6_neighbor_advertise_s *adv; uint16_t l1size; uint16_t l3size; /* Set up the IPv6 header */ - icmp->vtc = 0x60; /* Version/traffic class (MS) */ - icmp->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ - icmp->flow = 0; /* Flow label (LS) */ + ipv6->vtc = 0x60; /* Version/traffic class (MS) */ + ipv6->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ + ipv6->flow = 0; /* Flow label (LS) */ /* Length excludes the IPv6 header */ - l1size = NET_LL_HDRLEN(dev); + l1size = netdev_dev_l1size(dev); l3size = SIZEOF_ICMPV6_NEIGHBOR_ADVERTISE_S(l1size); - icmp->len[0] = (l3size >> 8); - icmp->len[1] = (l3size & 0xff); + ipv6->len[0] = (l3size >> 8); + ipv6->len[1] = (l3size & 0xff); - icmp->proto = IP_PROTO_ICMP6; /* Next header */ - icmp->ttl = 255; /* Hop limit */ + ipv6->proto = IP_PROTO_ICMP6; /* Next header */ + ipv6->ttl = 255; /* Hop limit */ /* Swap source for destination IP address, add our source IP address */ - net_ipv6addr_copy(icmp->destipaddr, destipaddr); - net_ipv6addr_copy(icmp->srcipaddr, dev->d_ipv6addr); + net_ipv6addr_copy(ipv6->destipaddr, destipaddr); + net_ipv6addr_copy(ipv6->srcipaddr, dev->d_ipv6addr); /* Set up the ICMPv6 Neighbor Advertise response */ @@ -147,8 +148,8 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, /* Calculate the checksum over both the ICMP header and payload */ - icmp->chksum = 0; - icmp->chksum = ~icmpv6_chksum(dev); + adv->chksum = 0; + adv->chksum = ~icmpv6_chksum(dev); /* Set the size to the size of the IPv6 header and the payload size */ @@ -185,7 +186,7 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, IFF_SET_NOARP(dev->d_flags); ninfo("Outgoing ICMPv6 Neighbor Advertise length: %d (%d)\n", - dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); + dev->d_len, (ipv6->len[0] << 8) | ipv6->len[1]); #ifdef CONFIG_NET_STATISTICS g_netstats.icmpv6.sent++; diff --git a/net/icmpv6/icmpv6_radvertise.c b/net/icmpv6/icmpv6_radvertise.c index b0765427b96..c0690ad4098 100644 --- a/net/icmpv6/icmpv6_radvertise.c +++ b/net/icmpv6/icmpv6_radvertise.c @@ -53,6 +53,7 @@ #include #include +#include "netdev/netdev.h" #include "utils/utils.h" #include "icmpv6/icmpv6.h" @@ -62,8 +63,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ICMPv6BUF ((struct icmpv6_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) +#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) +#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) #define ICMPv6ADVERTISE \ ((struct icmpv6_router_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) @@ -108,7 +109,7 @@ static const net_ipv6addr_t g_ipv6_prefix = void icmpv6_radvertise(FAR struct net_driver_s *dev) { - FAR struct icmpv6_iphdr_s *icmp = ICMPv6BUF; + FAR struct ipv6_hdr_s *ipv6 = IPv6BUF; FAR struct icmpv6_router_advertise_s *adv; FAR struct icmpv6_srclladdr_s *srcaddr; FAR struct icmpv6_mtu_s *mtu; @@ -118,28 +119,28 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Set up the IPv6 header */ - icmp->vtc = 0x60; /* Version/traffic class (MS) */ - icmp->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ - icmp->flow = 0; /* Flow label (LS) */ + ipv6->vtc = 0x60; /* Version/traffic class (MS) */ + ipv6->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ + ipv6->flow = 0; /* Flow label (LS) */ /* Length excludes the IPv6 header */ - l1size = NET_LL_HDRLEN(dev); + l1size = netdev_dev_l1size(dev); l3size = sizeof(icmpv6_router_advertise_s) + SIZEOF_ICMPV6_SRCLLADDR_S(l1size) + sizeof(struct icmpv6_mtu_s) + sizeof(icmpv6_prefixinfo_s); - icmp->len[0] = (l3size >> 8); - icmp->len[1] = (l3size & 0xff); + ipv6->len[0] = (l3size >> 8); + ipv6->len[1] = (l3size & 0xff); - icmp->proto = IP_PROTO_ICMP6; /* Next header */ - icmp->ttl = 255; /* Hop limit */ + ipv6->proto = IP_PROTO_ICMP6; /* Next header */ + ipv6->ttl = 255; /* Hop limit */ /* Swap source for destination IP address, add our source IP address */ - net_ipv6addr_copy(icmp->destipaddr, g_ipv6_allnodes); - net_ipv6addr_copy(icmp->srcipaddr, dev->d_ipv6addr); + net_ipv6addr_copy(ipv6->destipaddr, g_ipv6_allnodes); + net_ipv6addr_copy(ipv6->srcipaddr, dev->d_ipv6addr); /* Set up the ICMPv6 Router Advertise response */ @@ -193,8 +194,8 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Calculate the checksum over both the ICMP header and payload */ - icmp->chksum = 0; - icmp->chksum = ~icmpv6_chksum(dev); + adv->chksum = 0; + adv->chksum = ~icmpv6_chksum(dev); /* Set the size to the size of the IPv6 header and the payload size */ @@ -231,7 +232,7 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) IFF_SET_NOARP(dev->d_flags); ninfo("Outgoing ICMPv6 Router Advertise length: %d (%d)\n", - dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); + dev->d_len, (ipv6->len[0] << 8) | ipv6->len[1]); #ifdef CONFIG_NET_STATISTICS g_netstats.icmpv6.sent++; diff --git a/net/icmpv6/icmpv6_rsolicit.c b/net/icmpv6/icmpv6_rsolicit.c index 723ed6c1cdb..bbc48742d43 100644 --- a/net/icmpv6/icmpv6_rsolicit.c +++ b/net/icmpv6/icmpv6_rsolicit.c @@ -47,6 +47,7 @@ #include #include "devif/devif.h" +#include "netdev/netdev.h" #include "utils/utils.h" #include "icmpv6/icmpv6.h" @@ -56,8 +57,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ICMPv6BUF ((struct icmpv6_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) +#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) +#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) #define ICMPv6RSOLICIT \ ((struct icmpv6_router_solicit_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) @@ -89,7 +90,7 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) { - FAR struct icmpv6_iphdr_s *icmp; + FAR struct ipv6_hdr_s *ipv6; FAR struct icmpv6_router_solicit_s *sol; FAR struct eth_hdr_s *eth; uint16_t l1size; @@ -97,30 +98,30 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Set up the IPv6 header (most is probably already in place) */ - icmp = ICMPv6BUF; - icmp->vtc = 0x60; /* Version/traffic class (MS) */ - icmp->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ - icmp->flow = 0; /* Flow label (LS) */ + ipv6 = IPv6BUF; + ipv6->vtc = 0x60; /* Version/traffic class (MS) */ + ipv6->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ + ipv6->flow = 0; /* Flow label (LS) */ /* Length excludes the IPv6 header */ - l1size = NET_LL_HDRLEN(dev); - l3size = SIZEOF_ICMPV6_ROUTER_SOLICIT_S(l1size); - icmp->len[0] = (l3size >> 8); - icmp->len[1] = (l3size & 0xff); + l1size = netdev_dev_l1size(dev); + l3size = SIZEOF_ICMPV6_ROUTER_SOLICIT_S(l1size); + ipv6->len[0] = (l3size >> 8); + ipv6->len[1] = (l3size & 0xff); - icmp->proto = IP_PROTO_ICMP6; /* Next header */ - icmp->ttl = 255; /* Hop limit */ + ipv6->proto = IP_PROTO_ICMP6; /* Next header */ + ipv6->ttl = 255; /* Hop limit */ /* Set the multicast destination IP address to the IPv6 all link- * loocal routers address: ff02::2 */ - net_ipv6addr_copy(icmp->destipaddr, g_ipv6_allrouters); + net_ipv6addr_copy(ipv6->destipaddr, g_ipv6_allrouters); /* Add our link local IPv6 address as the source address */ - net_ipv6addr_copy(icmp->srcipaddr, dev->d_ipv6addr); + net_ipv6addr_copy(ipv6->srcipaddr, dev->d_ipv6addr); /* Set up the ICMPv6 Router Solicitation message */ @@ -145,8 +146,8 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Calculate the checksum over both the ICMP header and payload */ - icmp->chksum = 0; - icmp->chksum = ~icmpv6_chksum(dev); + sol->chksum = 0; + sol->chksum = ~icmpv6_chksum(dev); /* Set the size to the size of the IPv6 header and the payload size */ @@ -189,7 +190,7 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) dev->d_len += netdev_ipv6_hdrlen(dev); ninfo("Outgoing ICMPv6 Router Solicitation length: %d (%d)\n", - dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); + dev->d_len, (ipv6->len[0] << 8) | ipv6->len[1]); #ifdef CONFIG_NET_STATISTICS g_netstats.icmpv6.sent++; diff --git a/net/icmpv6/icmpv6_solicit.c b/net/icmpv6/icmpv6_solicit.c index 71879609c95..c5d73388994 100644 --- a/net/icmpv6/icmpv6_solicit.c +++ b/net/icmpv6/icmpv6_solicit.c @@ -48,6 +48,7 @@ #include #include "devif/devif.h" +#include "netdev/netdev.h" #include "utils/utils.h" #include "icmpv6/icmpv6.h" @@ -57,8 +58,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ICMPv6BUF ((struct icmpv6_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) +#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) +#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) #define ICMPv6SOLICIT \ ((struct icmpv6_neighbor_solicit_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) @@ -100,37 +101,37 @@ static const uint16_t g_icmpv_mcastaddr[6] = void icmpv6_solicit(FAR struct net_driver_s *dev, FAR const net_ipv6addr_t ipaddr) { - FAR struct icmpv6_iphdr_s *icmp; + FAR struct ipv6_hdr_s *ipv6; FAR struct icmpv6_neighbor_solicit_s *sol; uint16_t l1size; uint16_t l3size; /* Set up the IPv6 header (most is probably already in place) */ - icmp = ICMPv6BUF; - icmp->vtc = 0x60; /* Version/traffic class (MS) */ - icmp->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ - icmp->flow = 0; /* Flow label (LS) */ + ipv6 = IPv6BUF; + ipv6->vtc = 0x60; /* Version/traffic class (MS) */ + ipv6->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ + ipv6->flow = 0; /* Flow label (LS) */ /* Length excludes the IPv6 header */ - l1size = NET_LL_HDRLEN(dev); + l1size = netdev_dev_l1size(dev); l3size = SIZEOF_ICMPV6_NEIGHBOR_SOLICIT_S(l1size); - icmp->len[0] = (l3size >> 8); - icmp->len[1] = (l3size & 0xff); + ipv6->len[0] = (l3size >> 8); + ipv6->len[1] = (l3size & 0xff); - icmp->proto = IP_PROTO_ICMP6; /* Next header */ - icmp->ttl = 255; /* Hop limit */ + ipv6->proto = IP_PROTO_ICMP6; /* Next header */ + ipv6->ttl = 255; /* Hop limit */ /* Set the multicast destination IP address */ - memcpy(icmp->destipaddr, g_icmpv_mcastaddr, 6*sizeof(uint16_t)); - icmp->destipaddr[6] = ipaddr[6] | HTONS(0xff00); - icmp->destipaddr[7] = ipaddr[7]; + memcpy(ipv6->destipaddr, g_icmpv_mcastaddr, 6*sizeof(uint16_t)); + ipv6->destipaddr[6] = ipaddr[6] | HTONS(0xff00); + ipv6->destipaddr[7] = ipaddr[7]; /* Add out IPv6 address as the source address */ - net_ipv6addr_copy(icmp->srcipaddr, dev->d_ipv6addr); + net_ipv6addr_copy(ipv6->srcipaddr, dev->d_ipv6addr); /* Set up the ICMPv6 Neighbor Solicitation message */ @@ -159,8 +160,8 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Calculate the checksum over both the ICMP header and payload */ - icmp->chksum = 0; - icmp->chksum = ~icmpv6_chksum(dev); + sol->chksum = 0; + sol->chksum = ~icmpv6_chksum(dev); /* Set the size to the size of the IPv6 header and the payload size */ @@ -215,9 +216,11 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Add the size of the layer layer header to the total size of the * outgoing packet. */ + dev->d_len += netdev_ipv6_hdrlen(dev); + ninfo("Outgoing ICMPv6 Neighbor Solicitation length: %d (%d)\n", - dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); + dev->d_len, (ipv6->len[0] << 8) | ipv6->len[1]); #ifdef CONFIG_NET_STATISTICS g_netstats.icmpv6.sent++; diff --git a/net/neighbor/neighbor_add.c b/net/neighbor/neighbor_add.c index f5c04872783..58994082758 100644 --- a/net/neighbor/neighbor_add.c +++ b/net/neighbor/neighbor_add.c @@ -52,6 +52,7 @@ #include #include +#include "netdev/netdev.h" #include "neighbor/neighbor.h" /**************************************************************************** @@ -78,34 +79,10 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype, FAR uint8_t *addr) { - uint8_t addrlen; uint8_t oldest_time; int oldest_ndx; int i; - /* Get the length of the address for this link layer type */ - -#ifdef CONFIG_NET_ETHERNET -#ifdef CONFIG_NET_6LOWPAN - if (lltype == NET_LL_ETHERNET) -#endif - { - addrlen = IFHWADDRLEN; - } -#endif -#ifdef CONFIG_NET_6LOWPAN -#ifdef CONFIG_NET_ETHERNET - else -#endif - { -#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR - addrlen = NET_6LOWPAN_EADDRSIZE; -#else - addrlen = NET_6LOWPAN_SADDRSIZE; -#endif - } -#endif - /* Find the first unused entry or the oldest used entry. */ oldest_time = 0; @@ -147,7 +124,7 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype, #ifdef CONFIG_NET_MULTILINK g_neighbors[oldest_ndx].ne_addr.u.na_lltype = lltype; #endif - memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr, addrlen); + memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr, netdev_type_l1size(lltype)); /* Dump the contents of the new entry */ diff --git a/net/netdev/Make.defs b/net/netdev/Make.defs index c5262a1aacc..e533f1278d4 100644 --- a/net/netdev/Make.defs +++ b/net/netdev/Make.defs @@ -39,6 +39,7 @@ NETDEV_CSRCS += netdev_register.c netdev_ioctl.c netdev_txnotify.c NETDEV_CSRCS += netdev_findbyname.c netdev_findbyaddr.c netdev_findbyindex.c NETDEV_CSRCS += netdev_count.c netdev_foreach.c netdev_unregister.c NETDEV_CSRCS += netdev_carrier.c netdev_default.c netdev_verify.c +NETDEV_CSRCS += netdev_l1size.c ifeq ($(CONFIG_NET_RXAVAIL),y) NETDEV_CSRCS += netdev_rxnotify.c diff --git a/net/netdev/netdev.h b/net/netdev/netdev.h index 206a9e67faa..4080608c153 100644 --- a/net/netdev/netdev.h +++ b/net/netdev/netdev.h @@ -437,6 +437,26 @@ void netdev_ipv6_rxnotify(FAR const net_ipv6addr_t ripaddr); int netdev_count(void); #endif +/**************************************************************************** + * Name: netdev_dev_l1size and netdev_type_llsize + * + * Description: + * Size of the MAC address associated with a device or with a link layer + * type. + * + * Parameters: + * dev - A reference to the device of interest + * OR + * lltype - link layer type code + * + * Returned Value: + * The size of the MAC address associated with this device + * + ****************************************************************************/ + +int netdev_type_l1size(uint8_t lltype); +int netdev_dev_l1size(FAR struct net_driver_s *dev); + #undef EXTERN #ifdef __cplusplus } diff --git a/net/netdev/netdev_l1size.c b/net/netdev/netdev_l1size.c new file mode 100644 index 00000000000..a16b6069ac1 --- /dev/null +++ b/net/netdev/netdev_l1size.c @@ -0,0 +1,117 @@ +/**************************************************************************** + * net/netdev/netdev_l1size.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include +#include + +#include "netdev/netdev.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: netdev_dev_l1size and netdev_type_llsize + * + * Description: + * Size of the MAC address associated with a device or with a link layer + * type. + * + * Parameters: + * dev - A reference to the device of interest + * OR + * lltype - link layer type code + * + * Returned Value: + * The size of the MAC address associated with this device + * + ****************************************************************************/ + +int netdev_type_l1size(uint8_t lltype) +{ + /* Get the length of the address for this link layer type */ + +#ifdef CONFIG_NET_ETHERNET + if (lltype == NET_LL_ETHERNET) + { + return IFHWADDRLEN; + } + else +#endif +#ifdef CONFIG_NET_6LOWPAN + if (lltype == NET_LL_IEEE802154) + { +#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR + return NET_6LOWPAN_EADDRSIZE; +#else + return NET_6LOWPAN_SADDRSIZE; +#endif + } + else +#endif + { + return 0; + } +} + +int netdev_dev_l1size(FAR struct net_driver_s *dev) +{ + /* Get the length of the address for this device */ + +#if defined(CONFIG_NET_MULTILINK) + return netdev_type_l1size(dev->d_lltype); +#elif defined(CONFIG_NET_ETHERNET) + return IFHWADDRLEN; +#elif defined(CONFIG_NET_6LOWPAN) +#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR + return NET_6LOWPAN_EADDRSIZE; +#else + return NET_6LOWPAN_SADDRSIZE; +#endif +#else + return 0; +#endif +} From b4a0ac53a889b267c0222367be51fdb5242d2aec Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 7 Jul 2017 06:51:52 -0600 Subject: [PATCH 18/21] Networking: Improve naming and simplify some logic of previous commit. --- net/icmpv6/icmpv6_advertise.c | 12 ++-- net/icmpv6/icmpv6_radvertise.c | 12 ++-- net/icmpv6/icmpv6_rsolicit.c | 12 ++-- net/icmpv6/icmpv6_solicit.c | 12 ++-- net/neighbor/neighbor_add.c | 2 +- net/netdev/Make.defs | 2 +- net/netdev/netdev.h | 55 ++++++++++++++++--- .../{netdev_l1size.c => netdev_lladdrsize.c} | 40 +++++--------- 8 files changed, 88 insertions(+), 59 deletions(-) rename net/netdev/{netdev_l1size.c => netdev_lladdrsize.c} (81%) diff --git a/net/icmpv6/icmpv6_advertise.c b/net/icmpv6/icmpv6_advertise.c index 3e5b6385be7..3540720b752 100644 --- a/net/icmpv6/icmpv6_advertise.c +++ b/net/icmpv6/icmpv6_advertise.c @@ -97,7 +97,7 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, { FAR struct ipv6_hdr_s *ipv6 = IPv6BUF; FAR struct icmpv6_neighbor_advertise_s *adv; - uint16_t l1size; + uint16_t lladdrsize; uint16_t l3size; /* Set up the IPv6 header */ @@ -108,8 +108,8 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, /* Length excludes the IPv6 header */ - l1size = netdev_dev_l1size(dev); - l3size = SIZEOF_ICMPV6_NEIGHBOR_ADVERTISE_S(l1size); + lladdrsize = netdev_dev_lladdrsize(dev); + l3size = SIZEOF_ICMPV6_NEIGHBOR_ADVERTISE_S(lladdrsize); ipv6->len[0] = (l3size >> 8); ipv6->len[1] = (l3size & 0xff); @@ -137,14 +137,14 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, /* Set up the options */ - adv->opttype = ICMPv6_OPT_TGTLLADDR; /* Option type */ - adv->optlen = ICMPv6_OPT_OCTECTS(l1size); /* Option length in octets */ + adv->opttype = ICMPv6_OPT_TGTLLADDR; /* Option type */ + adv->optlen = ICMPv6_OPT_OCTECTS(lladdrsize); /* Option length in octets */ /* Copy our link layer address into the message * REVISIT: What if the link layer is not Ethernet? */ - memcpy(adv->tgtlladdr, &dev->d_mac, l1size); + memcpy(adv->tgtlladdr, &dev->d_mac, lladdrsize); /* Calculate the checksum over both the ICMP header and payload */ diff --git a/net/icmpv6/icmpv6_radvertise.c b/net/icmpv6/icmpv6_radvertise.c index c0690ad4098..5858c543b6e 100644 --- a/net/icmpv6/icmpv6_radvertise.c +++ b/net/icmpv6/icmpv6_radvertise.c @@ -114,7 +114,7 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) FAR struct icmpv6_srclladdr_s *srcaddr; FAR struct icmpv6_mtu_s *mtu; FAR struct icmpv6_prefixinfo_s *prefix; - uint16_t l1size; + uint16_t lladdrsize; uint16_t l3size; /* Set up the IPv6 header */ @@ -125,9 +125,9 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Length excludes the IPv6 header */ - l1size = netdev_dev_l1size(dev); + lladdrsize = netdev_dev_lladdrsize(dev); l3size = sizeof(icmpv6_router_advertise_s) + - SIZEOF_ICMPV6_SRCLLADDR_S(l1size) + + SIZEOF_ICMPV6_SRCLLADDR_S(lladdrsize) + sizeof(struct icmpv6_mtu_s) + sizeof(icmpv6_prefixinfo_s); @@ -160,13 +160,13 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) srcaddr = (FAR struct icmpv6_srclladdr_s *) ((FAR uint8_t *)adv + sizeof(icmpv6_router_advertise_s)); srcaddr->opttype = ICMPv6_OPT_SRCLLADDR; - srcaddr->optlen = ICMPv6_OPT_OCTECTS(l1size); - memcpy(srcaddr->srclladdr, &dev->d_mac, l1size); + srcaddr->optlen = ICMPv6_OPT_OCTECTS(lladdrsize); + memcpy(srcaddr->srclladdr, &dev->d_mac, lladdrsize); /* Set up the MTU option */ mtu = (FAR struct icmpv6_mtu_s *) - ((FAR uint8_t *)srcaddr + SIZEOF_ICMPV6_SRCLLADDR_S(l1size)); + ((FAR uint8_t *)srcaddr + SIZEOF_ICMPV6_SRCLLADDR_S(lladdrsize)); mtu = &adv->mtu; mtu->opttype = ICMPv6_OPT_MTU; mtu->optlen = 1; diff --git a/net/icmpv6/icmpv6_rsolicit.c b/net/icmpv6/icmpv6_rsolicit.c index bbc48742d43..d2c754099cb 100644 --- a/net/icmpv6/icmpv6_rsolicit.c +++ b/net/icmpv6/icmpv6_rsolicit.c @@ -93,7 +93,7 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) FAR struct ipv6_hdr_s *ipv6; FAR struct icmpv6_router_solicit_s *sol; FAR struct eth_hdr_s *eth; - uint16_t l1size; + uint16_t lladdrsize; uint16_t l3size; /* Set up the IPv6 header (most is probably already in place) */ @@ -105,8 +105,8 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Length excludes the IPv6 header */ - l1size = netdev_dev_l1size(dev); - l3size = SIZEOF_ICMPV6_ROUTER_SOLICIT_S(l1size); + lladdrsize = netdev_dev_lladdrsize(dev); + l3size = SIZEOF_ICMPV6_ROUTER_SOLICIT_S(lladdrsize); ipv6->len[0] = (l3size >> 8); ipv6->len[1] = (l3size & 0xff); @@ -135,14 +135,14 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Set up the options */ - sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ - sol->optlen = ICMPv6_OPT_OCTECTS(l1size); /* Option length in octets */ + sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ + sol->optlen = ICMPv6_OPT_OCTECTS(lladdrsize); /* Option length in octets */ /* Copy our link layer address into the message * REVISIT: What if the link layer is not Ethernet? */ - memcpy(sol->srclladdr, &dev->d_mac, l1size); + memcpy(sol->srclladdr, &dev->d_mac, lladdrsize); /* Calculate the checksum over both the ICMP header and payload */ diff --git a/net/icmpv6/icmpv6_solicit.c b/net/icmpv6/icmpv6_solicit.c index c5d73388994..c8e967cf483 100644 --- a/net/icmpv6/icmpv6_solicit.c +++ b/net/icmpv6/icmpv6_solicit.c @@ -103,7 +103,7 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, { FAR struct ipv6_hdr_s *ipv6; FAR struct icmpv6_neighbor_solicit_s *sol; - uint16_t l1size; + uint16_t lladdrsize; uint16_t l3size; /* Set up the IPv6 header (most is probably already in place) */ @@ -115,8 +115,8 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Length excludes the IPv6 header */ - l1size = netdev_dev_l1size(dev); - l3size = SIZEOF_ICMPV6_NEIGHBOR_SOLICIT_S(l1size); + lladdrsize = netdev_dev_lladdrsize(dev); + l3size = SIZEOF_ICMPV6_NEIGHBOR_SOLICIT_S(lladdrsize); ipv6->len[0] = (l3size >> 8); ipv6->len[1] = (l3size & 0xff); @@ -149,14 +149,14 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Set up the options */ - sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ - sol->optlen = ICMPv6_OPT_OCTECTS(l1size); /* Option length in octets */ + sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ + sol->optlen = ICMPv6_OPT_OCTECTS(lladdrsize); /* Option length in octets */ /* Copy our link layer address into the message * REVISIT: What if the link layer is not Ethernet? */ - memcpy(sol->srclladdr, &dev->d_mac, l1size); + memcpy(sol->srclladdr, &dev->d_mac, lladdrsize); /* Calculate the checksum over both the ICMP header and payload */ diff --git a/net/neighbor/neighbor_add.c b/net/neighbor/neighbor_add.c index 58994082758..11e67ef5680 100644 --- a/net/neighbor/neighbor_add.c +++ b/net/neighbor/neighbor_add.c @@ -124,7 +124,7 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype, #ifdef CONFIG_NET_MULTILINK g_neighbors[oldest_ndx].ne_addr.u.na_lltype = lltype; #endif - memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr, netdev_type_l1size(lltype)); + memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr, netdev_type_lladdrsize(lltype)); /* Dump the contents of the new entry */ diff --git a/net/netdev/Make.defs b/net/netdev/Make.defs index e533f1278d4..8a329b0e30c 100644 --- a/net/netdev/Make.defs +++ b/net/netdev/Make.defs @@ -39,7 +39,7 @@ NETDEV_CSRCS += netdev_register.c netdev_ioctl.c netdev_txnotify.c NETDEV_CSRCS += netdev_findbyname.c netdev_findbyaddr.c netdev_findbyindex.c NETDEV_CSRCS += netdev_count.c netdev_foreach.c netdev_unregister.c NETDEV_CSRCS += netdev_carrier.c netdev_default.c netdev_verify.c -NETDEV_CSRCS += netdev_l1size.c +NETDEV_CSRCS += netdev_lladdrsize.c ifeq ($(CONFIG_NET_RXAVAIL),y) NETDEV_CSRCS += netdev_rxnotify.c diff --git a/net/netdev/netdev.h b/net/netdev/netdev.h index 4080608c153..83aa7c5f808 100644 --- a/net/netdev/netdev.h +++ b/net/netdev/netdev.h @@ -47,6 +47,31 @@ #include +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* If there is only one supported link layer, then the size of the link + * layer address is a constant. + * + * NOTE: Literal constants are used here to avoid bringing in all of the + * header files where they are correctly defined. + */ + +#ifndef CONFIG_NET_MULTILINK +# if defined(CONFIG_NET_ETHERNET) +# define NETDEV_LLADDRSIZE 6 /* IFHWADDRLEN */ +# elif defined(CONFIG_NET_6LOWPAN) +# ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR +# define NETDEV_LLADDRSIZE 10 /* NET_6LOWPAN_EADDRSIZE */ +# else +# define NETDEV_LLADDRSIZE 2 /* NET_6LOWPAN_SADDRSIZE */ +# endif +# else +# define NETDEV_LLADDRSIZE 0 /* No link layer address */ +# endif +#endif + /**************************************************************************** * Public Data ****************************************************************************/ @@ -438,15 +463,12 @@ int netdev_count(void); #endif /**************************************************************************** - * Name: netdev_dev_l1size and netdev_type_llsize + * Name: netdev_type_lladdrsize * * Description: - * Size of the MAC address associated with a device or with a link layer - * type. + * Returns the size of the MAC address associated with a link layer type. * * Parameters: - * dev - A reference to the device of interest - * OR * lltype - link layer type code * * Returned Value: @@ -454,8 +476,27 @@ int netdev_count(void); * ****************************************************************************/ -int netdev_type_l1size(uint8_t lltype); -int netdev_dev_l1size(FAR struct net_driver_s *dev); +int netdev_type_lladdrsize(uint8_t lltype); + +/**************************************************************************** + * Name: netdev_dev_lladdrsize + * + * Description: + * Returns the size of the MAC address associated with a network device. + * + * Parameters: + * dev - A reference to the device of interest + * + * Returned Value: + * The size of the MAC address associated with this device + * + ****************************************************************************/ + +#ifdef CONFIG_NET_MULTILINK +# define netdev_dev_lladdrsize(dev) netdev_type_lladdrsize((dev)->d_lltype) +#else +# define netdev_dev_lladdrsize(dev) NETDEV_LLADDRSIZE +#endif #undef EXTERN #ifdef __cplusplus diff --git a/net/netdev/netdev_l1size.c b/net/netdev/netdev_lladdrsize.c similarity index 81% rename from net/netdev/netdev_l1size.c rename to net/netdev/netdev_lladdrsize.c index a16b6069ac1..f3e69d39051 100644 --- a/net/netdev/netdev_l1size.c +++ b/net/netdev/netdev_lladdrsize.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/netdev/netdev_l1size.c + * net/netdev/netdev_lladdrsize.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -54,15 +54,12 @@ ****************************************************************************/ /**************************************************************************** - * Name: netdev_dev_l1size and netdev_type_llsize + * Name: netdev_type_lladdrsize * * Description: - * Size of the MAC address associated with a device or with a link layer - * type. + * Returns the size of the MAC address associated with a link layer type. * * Parameters: - * dev - A reference to the device of interest - * OR * lltype - link layer type code * * Returned Value: @@ -70,13 +67,15 @@ * ****************************************************************************/ -int netdev_type_l1size(uint8_t lltype) +int netdev_type_lladdrsize(uint8_t lltype) { /* Get the length of the address for this link layer type */ #ifdef CONFIG_NET_ETHERNET if (lltype == NET_LL_ETHERNET) { + /* size of the Ethernet MAC address */ + return IFHWADDRLEN; } else @@ -84,6 +83,10 @@ int netdev_type_l1size(uint8_t lltype) #ifdef CONFIG_NET_6LOWPAN if (lltype == NET_LL_IEEE802154) { + /* 6LoWPAN can be configured to use either extended or short + * addressing. + */ + #ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR return NET_6LOWPAN_EADDRSIZE; #else @@ -93,25 +96,10 @@ int netdev_type_l1size(uint8_t lltype) else #endif { + /* Either the link layer type associated with lltype has no address, + * or support for that link layer type is not enabled. + */ + return 0; } } - -int netdev_dev_l1size(FAR struct net_driver_s *dev) -{ - /* Get the length of the address for this device */ - -#if defined(CONFIG_NET_MULTILINK) - return netdev_type_l1size(dev->d_lltype); -#elif defined(CONFIG_NET_ETHERNET) - return IFHWADDRLEN; -#elif defined(CONFIG_NET_6LOWPAN) -#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR - return NET_6LOWPAN_EADDRSIZE; -#else - return NET_6LOWPAN_SADDRSIZE; -#endif -#else - return 0; -#endif -} From 8d81b35c4449c9abde4b0b98bec9d9eaf36e7809 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 7 Jul 2017 08:50:01 -0600 Subject: [PATCH 19/21] network: Correct some issues that prevent TCP from working correctly when both IPv4 and IPv6 are enabled. --- net/socket/send.c | 1 + net/tcp/tcp_input.c | 2 +- net/tcp/tcp_send_buffered.c | 2 +- net/tcp/tcp_send_unbuffered.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/net/socket/send.c b/net/socket/send.c index 33060b5a327..c47158aca25 100644 --- a/net/socket/send.c +++ b/net/socket/send.c @@ -255,6 +255,7 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len, set_errno(-ret); ret = ERROR; } + return ret; } diff --git a/net/tcp/tcp_input.c b/net/tcp/tcp_input.c index 8b349884019..aefde83fd2e 100644 --- a/net/tcp/tcp_input.c +++ b/net/tcp/tcp_input.c @@ -285,7 +285,7 @@ static void tcp_input(FAR struct net_driver_s *dev, uint8_t domain, } } - nwarn("WARNING: Old packet .. reset\n"); + nwarn("WARNING: SYN with no listener (or old packet) .. reset\n"); /* This is (1) an old duplicate packet or (2) a SYN packet but with * no matching listener found. Send RST packet in either case. diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index 7ecf9903267..afb8355a344 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -243,7 +243,7 @@ static inline void send_ipselect(FAR struct net_driver_s *dev, /* Select the IPv6 domain */ DEBUGASSERT(conn->domain == PF_INET6); - tcp_ipv4_select(dev); + tcp_ipv6_select(dev); } } #endif diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index e4d4a50d4fb..e9f2a926278 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -194,7 +194,7 @@ static inline void tcpsend_ipselect(FAR struct net_driver_s *dev, /* Select the IPv6 domain */ DEBUGASSERT(conn->domain == PF_INET6); - tcp_ipv4_select(dev); + tcp_ipv6_select(dev); } } #endif From 1bddccbc3c6bbbac94179147b2ccf58b3cc94918 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 7 Jul 2017 09:04:09 -0600 Subject: [PATCH 20/21] Update some board README files --- configs/dk-tm4c129x/README.txt | 12 +++++++++--- configs/sama5d4-ek/README.txt | 12 +++++++++--- configs/stm32f4discovery/README.txt | 12 +++++++++--- configs/tm4c1294-launchpad/README.txt | 12 +++++++++--- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/configs/dk-tm4c129x/README.txt b/configs/dk-tm4c129x/README.txt index 291323da4ab..9e5aa4ebd09 100644 --- a/configs/dk-tm4c129x/README.txt +++ b/configs/dk-tm4c129x/README.txt @@ -757,7 +757,8 @@ Where is one of the following: configuration other than using IPv6. So all of the notes above regarding the nsh configuration apply. - Telnet does not work with IPv6. + Telnet does work with IPv6 but is not enabled in this + configuration (but could be). 2. This configuration can be modified to that both IPv4 and IPv6 are support. Here is a summary of the additional configuration @@ -788,9 +789,14 @@ Where is one of the following: ping6 fc00::2 (Linux) ping -6 fc00::2 (Windows cmd) - and Telnet again works from the host: + and Telnet is now enabled and works from the host... but only using + IPv6 addressing: - telnet 10.0.0.2 + telnet fc00::2 + + That is because the Telnet daemon will default to IPv6 and there is + no Telnet option to let you select which if both IPv4 and IPv6 are + enabled. 3. You can enable IPv6 autonomous address configuration with the following changes to the configuration: diff --git a/configs/sama5d4-ek/README.txt b/configs/sama5d4-ek/README.txt index 4ea1109f88a..c8bb1c01927 100644 --- a/configs/sama5d4-ek/README.txt +++ b/configs/sama5d4-ek/README.txt @@ -3948,7 +3948,8 @@ Configurations configuration other than using IPv6. So all of the notes below regarding the nsh configuration apply. - Telnet does not work with IPv6. + Telnet does work with IPv6 but is not enabled in this + configuration (but could be). 2. This configuration can be modified to that both IPv4 and IPv6 are support. Here is a summary of the additional configuration @@ -3979,9 +3980,14 @@ Configurations ping6 fc00::2 (Linux) ping -6 fc00::2 (Windows cmd) - and Telnet again works from the host: + and Telnet is now enabled and works from the host... but only using + IPv6 addressing: - telent 10.0.0.2 + telnet fc00::2 + + That is because the Telnet daemon will default to IPv6 and there is + no Telnet option to let you select which if both IPv4 and IPv6 are + enabled. 3. You can enable IPv6 autonomous address configuration with the following changes to the configuration: diff --git a/configs/stm32f4discovery/README.txt b/configs/stm32f4discovery/README.txt index b748027d83e..6cc16183ee9 100644 --- a/configs/stm32f4discovery/README.txt +++ b/configs/stm32f4discovery/README.txt @@ -1349,7 +1349,8 @@ Where is one of the following: configuration other than using IPv6. So all of the notes above regarding the netnsh configuration apply. - a. Telnet does not work with IPv6. + a. Telnet does work with IPv6 but is not enabled in this + configuration (but could be). b. The network initialization thread was enabed in the netnsh configuration on 2015-09-28, but not in the ipv6 configuration. @@ -1382,9 +1383,14 @@ Where is one of the following: ping6 fc00::2 (Linux) ping -6 fc00::2 (Windows cmd) - and Telnet again works from the host: + and Telnet is now enabled and works from the host... but only using + IPv6 addressing: - telent 10.0.0.2 + telnet fc00::2 + + That is because the Telnet daemon will default to IPv6 and there is + no Telnet option to let you select which if both IPv4 and IPv6 are + enabled. 3. I have used this configuration to serve up IP address prefixes in a local network with these modifications to the configuration: diff --git a/configs/tm4c1294-launchpad/README.txt b/configs/tm4c1294-launchpad/README.txt index 1ed896c3e96..b45511d2cfc 100644 --- a/configs/tm4c1294-launchpad/README.txt +++ b/configs/tm4c1294-launchpad/README.txt @@ -112,7 +112,8 @@ Where is one of the following: configuration other than using IPv6. So all of the notes above regarding the nsh configuration apply. - Telnet does not work with IPv6. + Telnet does work with IPv6 but is not enabled in this + configuration (but could be). 2. This configuration can be modified to that both IPv4 and IPv6 are support. Here is a summary of the additional configuration @@ -143,9 +144,14 @@ Where is one of the following: ping6 fc00::2 (Linux) ping -6 fc00::2 (Windows cmd) - and Telnet again works from the host: + and Telnet is now enabled and works from the host... but only using + IPv6 addressing: - telnet 10.0.0.2 + telnet fc00::2 + + That is because the Telnet daemon will default to IPv6 and there is + no Telnet option to let you select which if both IPv4 and IPv6 are + enabled. 3. You can enable IPv6 autonomous address configuration with the following changes to the configuration: From 570904375a8fb6685c21a50b6afeb6e1d5857358 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 7 Jul 2017 10:30:24 -0600 Subject: [PATCH 21/21] Add definitions that will permit TUN-only networking. --- configs/sim/nettest/defconfig | 12 ++++- include/nuttx/net/netconfig.h | 96 +++++++++++++++++++++++++++++++---- 2 files changed, 96 insertions(+), 12 deletions(-) diff --git a/configs/sim/nettest/defconfig b/configs/sim/nettest/defconfig index cd7d850534a..61d6e14ff84 100644 --- a/configs/sim/nettest/defconfig +++ b/configs/sim/nettest/defconfig @@ -431,6 +431,7 @@ CONFIG_NET_ETHERNET=y # CONFIG_NET_IPv4=y # CONFIG_NET_IPv6 is not set +# CONFIG_NET_IPFORWARD is not set # # Socket Support @@ -497,6 +498,11 @@ CONFIG_NET_ARP_MAXAGE=120 # CONFIG_NET_ARCH_INCR32 is not set # CONFIG_NET_ARCH_CHKSUM is not set CONFIG_NET_STATISTICS=y +# CONFIG_NET_HAVE_STAR is not set + +# +# Network Topologies +# # # Routing Table Configuration @@ -718,14 +724,16 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_MEDIA is not set # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MOUNT is not set CONFIG_EXAMPLES_NETTEST=y +CONFIG_EXAMPLES_NETTEST_SENDSIZE=4096 CONFIG_EXAMPLES_NETTEST_STACKSIZE1=2048 CONFIG_EXAMPLES_NETTEST_PRIORITY1=100 +# CONFIG_EXAMPLES_NETTEST_SERVER1 is not set +# CONFIG_EXAMPLES_NETTEST_TARGET2 is not set CONFIG_EXAMPLES_NETTEST_DEVNAME="eth0" # CONFIG_EXAMPLES_NETTEST_PERFORMANCE is not set CONFIG_EXAMPLES_NETTEST_IPv4=y @@ -764,7 +772,6 @@ CONFIG_EXAMPLES_NETTEST_SERVER_PORTNO=5471 # CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_STAT is not set # CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set # CONFIG_EXAMPLES_WATCHDOG is not set @@ -812,6 +819,7 @@ CONFIG_EXAMPLES_NETTEST_SERVER_PORTNO=5471 # CONFIG_NETUTILS_JSON is not set CONFIG_NETUTILS_NETLIB=y # CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETC is not set # CONFIG_NETUTILS_TELNETD is not set # CONFIG_NETUTILS_WEBCLIENT is not set # CONFIG_NETUTILS_WEBSERVER is not set diff --git a/include/nuttx/net/netconfig.h b/include/nuttx/net/netconfig.h index 019fa663db7..a4afb1b1843 100644 --- a/include/nuttx/net/netconfig.h +++ b/include/nuttx/net/netconfig.h @@ -110,6 +110,12 @@ # endif #endif +#ifdef CONFIG_NET_TUN +# ifndef CONFIG_NET_TUN_MTU +# define CONFIG_NET_TUN_MTU 296 +# endif +#endif + #ifdef CONFIG_NET_ETHERNET # ifndef CONFIG_NET_ETH_MTU # define CONFIG_NET_ETH_MTU 590 @@ -165,12 +171,20 @@ # define _MAX_SLIP_MTU _MAX_LO_MTU # endif -# ifdef CONFIG_NET_6LOWPAN -# define _MIN_6LOWPAN_MTU MIN(_MIN_SLIP_MTU,CONFIG_NET_6LOWPAN_MTU) -# define _MAX_6LOWPAN_MTU MAX(_MAX_SLIP_MTU,CONFIG_NET_6LOWPAN_MTU) +# ifdef CONFIG_NET_TUN +# define _MIN_TUN_MTU MIN(_MIN_SLIP_MTU,CONFIG_NET_TUN_MTU) +# define _MAX_TUN_MTU MAX(_MAX_SLIP_MTU,CONFIG_NET_TUN_MTU) # else -# define _MIN_6LOWPAN_MTU _MIN_SLIP_MTU -# define _MAX_6LOWPAN_MTU _MAX_SLIP_MTU +# define _MIN_TUN_MTU _MIN_SLIP_MTU +# define _MAX_TUN_MTU _MAX_SLIP_MTU +# endif + +# ifdef CONFIG_NET_6LOWPAN +# define _MIN_6LOWPAN_MTU MIN(_MIN_TUN_MTU,CONFIG_NET_6LOWPAN_MTU) +# define _MAX_6LOWPAN_MTU MAX(_MAX_TUN_MTU,CONFIG_NET_6LOWPAN_MTU) +# else +# define _MIN_6LOWPAN_MTU _MIN_TUN_MTU +# define _MAX_6LOWPAN_MTU _MAX_TUN_MTU # endif # define MIN_NET_DEV_MTU _MIN_6LOWPAN_MTU @@ -192,6 +206,14 @@ # define MIN_NET_DEV_MTU CONFIG_NET_SLIP_MTU # define MAX_NET_DEV_MTU CONFIG_NET_SLIP_MTU +#elif defined(CONFIG_NET_TUN) + /* There is no link layer header with TUN */ + +# define NET_LL_HDRLEN(d) 0 +# define NET_DEV_MTU(d) CONFIG_NET_TUN_MTU +# define MIN_NET_DEV_MTU CONFIG_NET_TUN_MTU +# define MAX_NET_DEV_MTU CONFIG_NET_TUN_MTU + #elif defined(CONFIG_NET_ETHERNET) /* Assume standard Ethernet link layer header */ @@ -215,10 +237,10 @@ # define MAX_NET_DEV_MTU NET_LO_MTU #elif defined(CONFIG_NET_6LOWPAN) - /* There is no link layer header with SLIP */ + /* There is no link layer header with 6LoWPAN */ # ifndef CONFIG_NET_IPv6 -# error 6LoWPAN requires IPv support +# error 6LoWPAN requires IP6v support # endif # define NET_LL_HDRLEN(d) 0 @@ -240,7 +262,7 @@ # define MIN_NET_DEV_MTU 0 # define MAX_NET_DEV_MTU 0 -#endif /* MULTILINK or SLIP or ETHERNET */ +#endif /* MULTILINK, SLIP, TUN, LOOPBACK, 6LoWOPAN, or ETHERNET */ /* Layer 3/4 Configuration Options ******************************************/ @@ -332,6 +354,14 @@ # endif #endif +#ifdef CONFIG_NET_TUN +# define TUN_UDP_MSS(h) (CONFIG_NET_TUN_MTU - UDP_HDRLEN - (h)) +# ifndef CONFIG_NET_MULTILINK +# define __MIN_UDP_MSS(h) TUN_UDP_MSS(h) +# define __MAX_UDP_MSS(h) TUN_UDP_MSS(h) +# endif +#endif + #ifdef CONFIG_NET_MULTILINK # ifdef CONFIG_NET_ETHERNET # define __MIN_UDP_MSS(h) ETH_UDP_MSS(h) @@ -378,12 +408,25 @@ # define __SLIP_MIN_UDP_MSS(h) __LOOP_MIN_UDP_MSS(h) # define __SLIP_MAX_UDP_MSS(h) __LOOP_MAX_UDP_MSS(h) # endif + +# ifdef CONFIG_NET_TUN +# undef __MIN_UDP_MSS +# undef __MIN_UDP_MSS +# define __MIN_UDP_MSS(h) MIN(TUN_UDP_MSS(h),__SLIP_MIN_UDP_MSS(h)) +# define __MAX_UDP_MSS(h) MAX(TUN_UDP_MSS(h),__SLIP_MAX_UDP_MSS(h)) +# define __TUN_MIN_UDP_MSS(h) MIN(TUN_UDP_MSS(h),__SLIP_MIN_UDP_MSS(h)) +# define __TUN_MAX_UDP_MSS(h) MAX(TUN_UDP_MSS(h),__SLIP_MAX_UDP_MSS(h)) +# else +# define __TUN_MIN_UDP_MSS(h) __SLIP_MIN_UDP_MSS(h) +# define __TUN_MAX_UDP_MSS(h) __SLIP_MAX_UDP_MSS(h) +# endif #endif #ifdef CONFIG_NET_IPv4 # define UDP_IPv4_MSS(d) UDP_MSS(d,IPv4_HDRLEN) # define ETH_IPv4_UDP_MSS ETH_UDP_MSS(IPv4_HDRLEN) # define SLIP_IPv4_UDP_MSS SLIP_UDP_MSS(IPv4_HDRLEN) +# define TUN_IPv4_UDP_MSS TUN_UDP_MSS(IPv4_HDRLEN) # define MIN_IPv4_UDP_MSS __MIN_UDP_MSS(IPv4_HDRLEN) # define MIN_UDP_MSS __MIN_UDP_MSS(IPv4_HDRLEN) @@ -507,6 +550,14 @@ # endif #endif +#ifdef CONFIG_NET_TUN +# define TUN_TCP_MSS(h) (CONFIG_NET_TUN_MTU - TCP_HDRLEN - (h)) +# ifndef CONFIG_NET_MULTILINK +# define __MIN_TCP_MSS(h) TUN_TCP_MSS(h) +# define __MAX_TCP_MSS(h) TUN_TCP_MSS(h) +# endif +#endif + #ifdef CONFIG_NET_MULTILINK # ifdef CONFIG_NET_ETHERNET @@ -554,6 +605,18 @@ # define __SLIP_MIN_TCP_MSS(h) __LOOP_MIN_TCP_MSS(h) # define __SLIP_MAX_TCP_MSS(h) __LOOP_MAX_TCP_MSS(h) # endif + +# ifdef CONFIG_NET_TUN +# undef __MIN_TCP_MSS +# undef __MAX_TCP_MSS +# define __MIN_TCP_MSS(h) MIN(TUN_TCP_MSS(h),__SLIP_MIN_TCP_MSS(h)) +# define __MAX_TCP_MSS(h) MAX(TUN_TCP_MSS(h),__SLIP_MAX_TCP_MSS(h)) +# define __TUN_MIN_TCP_MSS(h) MIN(TUN_TCP_MSS(h),__SLIP_MIN_TCP_MSS(h)) +# define __TUN_MAX_TCP_MSS(h) MAX(TUN_TCP_MSS(h),__SLIP_MAX_TCP_MSS(h)) +# else +# define __TUN_MIN_TCP_MSS(h) __SLIP_MIN_TCP_MSS(h) +# define __TUN_MAX_TCP_MSS(h) __SLIP_MAX_TCP_MSS(h) +# endif #endif /* If IPv4 is supported, it will have the larger MSS. @@ -564,6 +627,7 @@ # define TCP_IPv6_MSS(d) TCP_MSS(d,IPv6_HDRLEN) # define ETH_IPv6_TCP_MSS ETH_TCP_MSS(IPv6_HDRLEN) # define SLIP_IPv6_TCP_MSS SLIP_TCP_MSS(IPv6_HDRLEN) +# define TUN_IPv6_TCP_MSS TUN_TCP_MSS(IPv6_HDRLEN) # define MAX_TCP_MSS __MAX_TCP_MSS(IPv6_HDRLEN) #endif @@ -571,6 +635,7 @@ # define TCP_IPv4_MSS(d) TCP_MSS(d,IPv4_HDRLEN) # define ETH_IPv4_TCP_MSS ETH_TCP_MSS(IPv4_HDRLEN) # define SLIP_IPv4_TCP_MSS SLIP_TCP_MSS(IPv4_HDRLEN) +# define TUN_IPv4_TCP_MSS TUN_TCP_MSS(IPv4_HDRLEN) # define MIN_TCP_MSS __MIN_TCP_MSS(IPv4_HDRLEN) # undef MAX_TCP_MSS # define MAX_TCP_MSS __MAX_TCP_MSS(IPv4_HDRLEN) @@ -600,6 +665,12 @@ # endif #endif +#ifdef CONFIG_NET_TUN +# ifndef CONFIG_NET_TUN_TCP_RECVWNDO +# define CONFIG_NET_TUN_TCP_RECVWNDO TUN_TCP_MSS(0) +# endif +#endif + #ifdef CONFIG_NET_ETHERNET # ifndef CONFIG_NET_ETH_TCP_RECVWNDO # define CONFIG_NET_ETH_TCP_RECVWNDO ETH_TCP_MSS(0) @@ -615,7 +686,7 @@ # define NET_DEV_RCVWNDO(d) ((d)->d_recvwndo) #elif defined(CONFIG_NET_ETHERNET) - /* Only Ethernet.. use the configured SLIP receive window size */ + /* Only Ethernet.. use the configured Ethernet receive window size */ # define NET_DEV_RCVWNDO(d) CONFIG_NET_ETH_TCP_RECVWNDO @@ -629,12 +700,17 @@ # define NET_DEV_RCVWNDO(d) CONFIG_NET_SLIP_TCP_RECVWNDO +#elif defined(CONFIG_NET_TUN) + /* Only SLIP.. use the configured SLIP receive window size */ + +# define NET_DEV_RCVWNDO(d) CONFIG_NET_TUN_TCP_RECVWNDO + #else /* if defined(CONFIG_NET_LOOPBACK) */ /* Only loal loopback.. use the fixed loopback receive window size */ # define NET_DEV_RCVWNDO(d) NET_LO_TCP_RECVWNDO -#endif /* MULTILINK or SLIP or ETHERNET */ +#endif /* MULTILINK, ETHERNET, 6LoWPAN, SLIP, TUN, or LOOPBACK */ /* How long a connection should stay in the TIME_WAIT state. *