From d5689e070b43ca75c85c905d3fadd0e1764e1740 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 28 Nov 2022 15:55:18 +0800 Subject: [PATCH] net/arp: Remove nuttx/net/arp.h 1.move ARPHRD_ETHER to netinet/arp.h 1.move arp_entry_s to net/arp/arp.h 2.move arp_input to nuttx/net/netdev.h Signed-off-by: Xiang Xiao --- arch/arm/src/c5471/c5471_ethernet.c | 1 - arch/arm/src/gd32f4/gd32f4xx_enet.c | 1 - arch/arm/src/imx6/imx_enet.c | 1 - arch/arm/src/imxrt/imxrt_enet.c | 1 - arch/arm/src/kinetis/kinetis_enet.c | 1 - arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c | 1 - arch/arm/src/lpc43xx/lpc43_ethernet.c | 1 - arch/arm/src/lpc54xx/lpc54_ethernet.c | 1 - arch/arm/src/rtl8720c/amebaz_driver.c | 3 +- arch/arm/src/rtl8720c/amebaz_netdev.c | 2 +- arch/arm/src/s32k1xx/s32k1xx_enet.c | 1 - arch/arm/src/s32k3xx/s32k3xx_emac.c | 1 - arch/arm/src/sam34/sam_emac.c | 1 - arch/arm/src/sama5/sam_emaca.c | 1 - arch/arm/src/sama5/sam_emacb.c | 1 - arch/arm/src/sama5/sam_gmac.c | 1 - arch/arm/src/samd5e5/sam_gmac.c | 1 - arch/arm/src/samv7/sam_emac.c | 1 - arch/arm/src/stm32/stm32_eth.c | 1 - arch/arm/src/stm32f7/stm32_ethernet.c | 1 - arch/arm/src/stm32h7/stm32_ethernet.c | 1 - arch/arm/src/tiva/lm/lm3s_ethernet.c | 1 - arch/arm/src/tiva/tm4c/tm4c_ethernet.c | 1 - arch/hc/src/m9s12/m9s12_ethernet.c | 1 - arch/mips/src/pic32mx/pic32mx_ethernet.c | 1 - arch/mips/src/pic32mz/pic32mz_ethernet.c | 1 - arch/misoc/src/common/misoc_net.c | 1 - arch/renesas/src/rx65n/rx65n_eth.c | 1 - arch/risc-v/src/bl602/bl602_netdev.c | 1 - arch/risc-v/src/esp32c3/esp32c3_wifi_utils.c | 2 +- arch/risc-v/src/esp32c3/esp32c3_wlan.c | 1 - arch/risc-v/src/litex/litex_emac.c | 1 - arch/risc-v/src/mpfs/mpfs_ethernet.c | 1 - arch/sim/src/sim/sim_netdriver.c | 1 - arch/xtensa/src/esp32/esp32_emac.c | 1 - arch/xtensa/src/esp32/esp32_wifi_utils.c | 2 +- arch/xtensa/src/esp32/esp32_wlan.c | 1 - arch/z80/src/ez80/ez80_emac.c | 1 - drivers/net/dm90x0.c | 1 - drivers/net/enc28j60.c | 1 - drivers/net/encx24j600.c | 1 - drivers/net/ftmac100.c | 1 - drivers/net/lan91c111.c | 1 - drivers/net/rpmsgdrv.c | 1 - drivers/net/skeleton.c | 1 - drivers/net/tun.c | 1 - drivers/net/w5500.c | 1 - drivers/usbdev/cdcecm.c | 1 - drivers/usbdev/rndis.c | 1 - drivers/virtio/virtio-mmio-net.c | 1 - .../wireless/ieee80211/bcm43xxx/bcmf_driver.c | 2 +- .../wireless/ieee80211/bcm43xxx/bcmf_netdev.c | 1 - .../wireless/ieee802154/xbee/xbee_netdev.c | 1 - include/netinet/arp.h | 11 ++ include/nuttx/net/arp.h | 150 ------------------ include/nuttx/net/netdev.h | 36 +++++ net/arp/arp.h | 12 +- net/arp/arp_format.c | 1 - net/arp/arp_input.c | 1 - net/arp/arp_ipin.c | 1 - net/arp/arp_out.c | 1 - net/arp/arp_send.c | 1 - net/arp/arp_table.c | 5 +- net/devif/devif_poll.c | 1 - net/netdev/netdev_ioctl.c | 1 - net/netlink/netlink_route.c | 1 - net/tcp/tcp_send_buffered.c | 1 - net/tcp/tcp_send_unbuffered.c | 1 - net/tcp/tcp_sendfile.c | 1 - net/udp/udp_sendto_buffered.c | 1 - wireless/bluetooth/bt_netdev.c | 1 - wireless/ieee802154/mac802154_netdev.c | 1 - 72 files changed, 66 insertions(+), 221 deletions(-) delete mode 100644 include/nuttx/net/arp.h diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index 6902b18496..f052cb3e49 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/arm/src/gd32f4/gd32f4xx_enet.c b/arch/arm/src/gd32f4/gd32f4xx_enet.c index 7038f41286..8d6b189347 100644 --- a/arch/arm/src/gd32f4/gd32f4xx_enet.c +++ b/arch/arm/src/gd32f4/gd32f4xx_enet.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #if defined(CONFIG_NET_PKT) diff --git a/arch/arm/src/imx6/imx_enet.c b/arch/arm/src/imx6/imx_enet.c index 149b5c643e..9c5f6ba44e 100644 --- a/arch/arm/src/imx6/imx_enet.c +++ b/arch/arm/src/imx6/imx_enet.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/imxrt/imxrt_enet.c b/arch/arm/src/imxrt/imxrt_enet.c index f4e8b6a3fa..8fd20c69e4 100644 --- a/arch/arm/src/imxrt/imxrt_enet.c +++ b/arch/arm/src/imxrt/imxrt_enet.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 919630ef62..587a3c9d74 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c index 6f674af48e..c8b02b70e2 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index 9a25e15dc3..f57cd6f57c 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #if defined(CONFIG_NET_PKT) # include diff --git a/arch/arm/src/lpc54xx/lpc54_ethernet.c b/arch/arm/src/lpc54xx/lpc54_ethernet.c index 653062197a..dd90770137 100644 --- a/arch/arm/src/lpc54xx/lpc54_ethernet.c +++ b/arch/arm/src/lpc54xx/lpc54_ethernet.c @@ -80,7 +80,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/arm/src/rtl8720c/amebaz_driver.c b/arch/arm/src/rtl8720c/amebaz_driver.c index cb5cecd6c1..af29d272e9 100644 --- a/arch/arm/src/rtl8720c/amebaz_driver.c +++ b/arch/arm/src/rtl8720c/amebaz_driver.c @@ -24,8 +24,9 @@ #include #include +#include #include -#include + #include "amebaz_netdev.h" /**************************************************************************** diff --git a/arch/arm/src/rtl8720c/amebaz_netdev.c b/arch/arm/src/rtl8720c/amebaz_netdev.c index fd42c57812..0b5ac0a18f 100644 --- a/arch/arm/src/rtl8720c/amebaz_netdev.c +++ b/arch/arm/src/rtl8720c/amebaz_netdev.c @@ -26,8 +26,8 @@ #include #include #include -#include #include + #include "amebaz_netdev.h" /**************************************************************************** diff --git a/arch/arm/src/s32k1xx/s32k1xx_enet.c b/arch/arm/src/s32k1xx/s32k1xx_enet.c index add44c00a0..ff18da16f3 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_enet.c +++ b/arch/arm/src/s32k1xx/s32k1xx_enet.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/s32k3xx/s32k3xx_emac.c b/arch/arm/src/s32k3xx/s32k3xx_emac.c index edacf7d59b..44ca842a04 100644 --- a/arch/arm/src/s32k3xx/s32k3xx_emac.c +++ b/arch/arm/src/s32k3xx/s32k3xx_emac.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/sam34/sam_emac.c b/arch/arm/src/sam34/sam_emac.c index b01bbf510b..490f4dc7bb 100644 --- a/arch/arm/src/sam34/sam_emac.c +++ b/arch/arm/src/sam34/sam_emac.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index 5fffcb691e..6af9c6d347 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -69,7 +69,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 869018aecd..ab509587f9 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -55,7 +55,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index 67ea8b30d0..fc54473a7c 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -66,7 +66,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/samd5e5/sam_gmac.c b/arch/arm/src/samd5e5/sam_gmac.c index 19e41417fe..c0fed3675c 100644 --- a/arch/arm/src/samd5e5/sam_gmac.c +++ b/arch/arm/src/samd5e5/sam_gmac.c @@ -65,7 +65,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index 2a405a1032..4f4445e37d 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 983da134aa..d4ec142a96 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #if defined(CONFIG_NET_PKT) diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index 226cd837e9..a26f55cb67 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/stm32h7/stm32_ethernet.c b/arch/arm/src/stm32h7/stm32_ethernet.c index 9c5dbc46b0..14e468cfa4 100644 --- a/arch/arm/src/stm32h7/stm32_ethernet.c +++ b/arch/arm/src/stm32h7/stm32_ethernet.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/src/tiva/lm/lm3s_ethernet.c b/arch/arm/src/tiva/lm/lm3s_ethernet.c index ff46ab8f52..95c34e6d75 100644 --- a/arch/arm/src/tiva/lm/lm3s_ethernet.c +++ b/arch/arm/src/tiva/lm/lm3s_ethernet.c @@ -42,7 +42,6 @@ #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/arm/src/tiva/tm4c/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c/tm4c_ethernet.c index 96d939ba0b..df9049d7ba 100644 --- a/arch/arm/src/tiva/tm4c/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c/tm4c_ethernet.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #ifdef CONFIG_TIVA_PHY_INTERRUPTS diff --git a/arch/hc/src/m9s12/m9s12_ethernet.c b/arch/hc/src/m9s12/m9s12_ethernet.c index 47db98af3a..df213fffd8 100644 --- a/arch/hc/src/m9s12/m9s12_ethernet.c +++ b/arch/hc/src/m9s12/m9s12_ethernet.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/mips/src/pic32mx/pic32mx_ethernet.c b/arch/mips/src/pic32mx/pic32mx_ethernet.c index 27f3317f12..ae33eeca1a 100644 --- a/arch/mips/src/pic32mx/pic32mx_ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx_ethernet.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/mips/src/pic32mz/pic32mz_ethernet.c b/arch/mips/src/pic32mz/pic32mz_ethernet.c index 7e17591956..272be7b05b 100644 --- a/arch/mips/src/pic32mz/pic32mz_ethernet.c +++ b/arch/mips/src/pic32mz/pic32mz_ethernet.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/misoc/src/common/misoc_net.c b/arch/misoc/src/common/misoc_net.c index 546152e4b8..4be42e22cc 100644 --- a/arch/misoc/src/common/misoc_net.c +++ b/arch/misoc/src/common/misoc_net.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include diff --git a/arch/renesas/src/rx65n/rx65n_eth.c b/arch/renesas/src/rx65n/rx65n_eth.c index 6ec14ac77c..f0b88475c7 100644 --- a/arch/renesas/src/rx65n/rx65n_eth.c +++ b/arch/renesas/src/rx65n/rx65n_eth.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #if defined(CONFIG_ARCH_PHY_INTERRUPT) diff --git a/arch/risc-v/src/bl602/bl602_netdev.c b/arch/risc-v/src/bl602/bl602_netdev.c index 7c77931d70..39f7e1cccf 100644 --- a/arch/risc-v/src/bl602/bl602_netdev.c +++ b/arch/risc-v/src/bl602/bl602_netdev.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/risc-v/src/esp32c3/esp32c3_wifi_utils.c b/arch/risc-v/src/esp32c3/esp32c3_wifi_utils.c index 0c640f8b12..172efe9077 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_wifi_utils.c +++ b/arch/risc-v/src/esp32c3/esp32c3_wifi_utils.c @@ -26,9 +26,9 @@ #include #include +#include #include -#include #include #include "esp32c3_wifi_adapter.h" diff --git a/arch/risc-v/src/esp32c3/esp32c3_wlan.c b/arch/risc-v/src/esp32c3/esp32c3_wlan.c index 7161e16cf3..a2f2af4f89 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_wlan.c +++ b/arch/risc-v/src/esp32c3/esp32c3_wlan.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #if defined(CONFIG_NET_PKT) # include diff --git a/arch/risc-v/src/litex/litex_emac.c b/arch/risc-v/src/litex/litex_emac.c index 138667f3fc..5d77df6a72 100644 --- a/arch/risc-v/src/litex/litex_emac.c +++ b/arch/risc-v/src/litex/litex_emac.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include diff --git a/arch/risc-v/src/mpfs/mpfs_ethernet.c b/arch/risc-v/src/mpfs/mpfs_ethernet.c index 1b3dcea835..0d4a56411f 100644 --- a/arch/risc-v/src/mpfs/mpfs_ethernet.c +++ b/arch/risc-v/src/mpfs/mpfs_ethernet.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/sim/src/sim/sim_netdriver.c b/arch/sim/src/sim/sim_netdriver.c index 975a67b991..69fadd8b3b 100644 --- a/arch/sim/src/sim/sim_netdriver.c +++ b/arch/sim/src/sim/sim_netdriver.c @@ -67,7 +67,6 @@ #include #include #include -#include #include #include "sim_internal.h" diff --git a/arch/xtensa/src/esp32/esp32_emac.c b/arch/xtensa/src/esp32/esp32_emac.c index 8acce36431..daa6ac7f6b 100644 --- a/arch/xtensa/src/esp32/esp32_emac.c +++ b/arch/xtensa/src/esp32/esp32_emac.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/arch/xtensa/src/esp32/esp32_wifi_utils.c b/arch/xtensa/src/esp32/esp32_wifi_utils.c index ceeaf146de..f7e8c28538 100644 --- a/arch/xtensa/src/esp32/esp32_wifi_utils.c +++ b/arch/xtensa/src/esp32/esp32_wifi_utils.c @@ -26,9 +26,9 @@ #include #include +#include #include -#include #include #include "esp32_wifi_adapter.h" diff --git a/arch/xtensa/src/esp32/esp32_wlan.c b/arch/xtensa/src/esp32/esp32_wlan.c index a4d70b8700..5450b9147b 100644 --- a/arch/xtensa/src/esp32/esp32_wlan.c +++ b/arch/xtensa/src/esp32/esp32_wlan.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #if defined(CONFIG_NET_PKT) # include diff --git a/arch/z80/src/ez80/ez80_emac.c b/arch/z80/src/ez80/ez80_emac.c index 84b54e7d1c..3a908c8028 100644 --- a/arch/z80/src/ez80/ez80_emac.c +++ b/arch/z80/src/ez80/ez80_emac.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/drivers/net/dm90x0.c b/drivers/net/dm90x0.c index 60807ae7a2..feb7a70c72 100644 --- a/drivers/net/dm90x0.c +++ b/drivers/net/dm90x0.c @@ -52,7 +52,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 2cf91bc398..e3809bd1ad 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -50,7 +50,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/drivers/net/encx24j600.c b/drivers/net/encx24j600.c index 86fe262259..2fc85c39d8 100644 --- a/drivers/net/encx24j600.c +++ b/drivers/net/encx24j600.c @@ -50,7 +50,6 @@ #include #include #include -#include #include #include diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index 2d4297fb46..5d6986c0f3 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include diff --git a/drivers/net/lan91c111.c b/drivers/net/lan91c111.c index 86a6550311..b21a674cc8 100644 --- a/drivers/net/lan91c111.c +++ b/drivers/net/lan91c111.c @@ -33,7 +33,6 @@ #include #include -#include #include #include #include diff --git a/drivers/net/rpmsgdrv.c b/drivers/net/rpmsgdrv.c index 6c82695756..7f03b9b477 100644 --- a/drivers/net/rpmsgdrv.c +++ b/drivers/net/rpmsgdrv.c @@ -34,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/drivers/net/skeleton.c b/drivers/net/skeleton.c index 91d67ba11d..7818d13da0 100644 --- a/drivers/net/skeleton.c +++ b/drivers/net/skeleton.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #ifdef CONFIG_NET_PKT diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 8e769804cf..ecffb10b07 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/net/w5500.c b/drivers/net/w5500.c index 45e71e2ece..c05bbe8420 100644 --- a/drivers/net/w5500.c +++ b/drivers/net/w5500.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/usbdev/cdcecm.c b/drivers/usbdev/cdcecm.c index 7f23666676..a3b9b0c3ea 100644 --- a/drivers/usbdev/cdcecm.c +++ b/drivers/usbdev/cdcecm.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/usbdev/rndis.c b/drivers/usbdev/rndis.c index 13e8e939a4..3f01f6c9fe 100644 --- a/drivers/usbdev/rndis.c +++ b/drivers/usbdev/rndis.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/virtio/virtio-mmio-net.c b/drivers/virtio/virtio-mmio-net.c index 1c118bed5e..4433a596ec 100644 --- a/drivers/virtio/virtio-mmio-net.c +++ b/drivers/virtio/virtio-mmio-net.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c index e20b8095fb..53855535eb 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c @@ -33,13 +33,13 @@ #include #include +#include #include #include #include #include #include -#include #include #include "bcmf_driver.h" diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c index 94fc90f471..f061ff09dd 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/wireless/ieee802154/xbee/xbee_netdev.c b/drivers/wireless/ieee802154/xbee/xbee_netdev.c index 85830a7650..2105b63187 100644 --- a/drivers/wireless/ieee802154/xbee/xbee_netdev.c +++ b/drivers/wireless/ieee802154/xbee/xbee_netdev.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include diff --git a/include/netinet/arp.h b/include/netinet/arp.h index 242c0415ea..4c5ec33703 100644 --- a/include/netinet/arp.h +++ b/include/netinet/arp.h @@ -36,6 +36,17 @@ * Pre-processor Definitions ****************************************************************************/ +/* ARP protocol HARDWARE identifiers. Provided as the sa_family member of a + * struct sockaddr. + * + * When sa_family is ARPHRD_ETHER, the 6 byte Ethernet address is provided + * in the first 6-bytes of the sockaddr sa_data array. + */ + +#define ARPHRD_ETHER 1 /* Ethernet */ +#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ +#define ARPHRD_IEEE802154 804 /* IEEE 802.15.4 */ + /* Three ioctls are available on all PF_INET sockets. Each ioctl takes a * pointer to a 'struct arpreq' as its parameter. */ diff --git a/include/nuttx/net/arp.h b/include/nuttx/net/arp.h deleted file mode 100644 index e2c901e71e..0000000000 --- a/include/nuttx/net/arp.h +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** - * include/nuttx/net/arp.h - * Macros and definitions for the ARP module. - * - * Copyright (C) 2007, 2009-2012, 2015-2016, 2018 Gregory Nutt. All rights - * reserved. - * Author: Gregory Nutt - * - * Derived from uIP with has a similar BSD-style license: - * - * Author: Adam Dunkels - * Copyright (c) 2001-2003, Adam Dunkels. - * All rights reserved. - * - * 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. - * - ****************************************************************************/ - -#ifndef __INCLUDE_NUTTX_NET_ARP_H -#define __INCLUDE_NUTTX_NET_ARP_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* ARP protocol HARDWARE identifiers. Provided as the sa_family member of a - * struct sockaddr. - * - * When sa_family is ARPHRD_ETHER, the 6 byte Ethernet address is provided - * in the first 6-bytes of the sockaddr sa_data array. - */ - -#define ARPHRD_ETHER 1 /* Ethernet */ -#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ -#define ARPHRD_IEEE802154 804 /* IEEE 802.15.4 */ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/* One entry in the ARP table (volatile!) */ - -struct arp_entry_s -{ - in_addr_t at_ipaddr; /* IP address */ - struct ether_addr at_ethaddr; /* Hardware address */ - clock_t at_time; /* Time of last usage */ - FAR struct net_driver_s *at_dev; /* The device driver structure */ -}; - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifdef CONFIG_NET_ARP - -struct net_driver_s; /* Forward reference */ - -/**************************************************************************** - * Name: arp_input - * - * Description: - * This function should be called by the Ethernet device driver when an ARP - * packet has been received. The function will act differently - * depending on the ARP packet type: if it is a reply for a request - * that we previously sent out, the ARP cache will be filled in with - * the values from the ARP reply. If the incoming ARP packet is an ARP - * request for our IP address, an ARP reply packet is created and put - * into the d_buf buffer. - * - * On entry, this function expects that an ARP packet with a prepended - * Ethernet header is present in the d_buf buffer and that the length of - * the packet is set in the d_len field. - * - * When the function returns, the value of the field d_len indicates - * whether the device driver should send out the ARP reply packet or not. - * If d_len is zero, no packet should be sent; If d_len is non-zero, it - * contains the length of the outbound packet that is present in the d_buf - * buffer. - * - ****************************************************************************/ - -void arp_input(FAR struct net_driver_s *dev); - -#else /* CONFIG_NET_ARP */ - -/* If ARP is disabled, stub out all ARP interfaces */ - -# define arp_input(dev) - -#endif /* CONFIG_NET_ARP */ - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __INCLUDE_NUTTX_NET_ARP_H */ diff --git a/include/nuttx/net/netdev.h b/include/nuttx/net/netdev.h index 3c9d9a3185..8f78e519ef 100644 --- a/include/nuttx/net/netdev.h +++ b/include/nuttx/net/netdev.h @@ -519,6 +519,42 @@ int sixlowpan_input(FAR struct radio_driver_s *ieee, FAR struct iob_s *framelist, FAR const void *metadata); #endif +#ifdef CONFIG_NET_ARP + +/**************************************************************************** + * Name: arp_input + * + * Description: + * This function should be called by the Ethernet device driver when an ARP + * packet has been received. The function will act differently + * depending on the ARP packet type: if it is a reply for a request + * that we previously sent out, the ARP cache will be filled in with + * the values from the ARP reply. If the incoming ARP packet is an ARP + * request for our IP address, an ARP reply packet is created and put + * into the d_buf buffer. + * + * On entry, this function expects that an ARP packet with a prepended + * Ethernet header is present in the d_buf buffer and that the length of + * the packet is set in the d_len field. + * + * When the function returns, the value of the field d_len indicates + * whether the device driver should send out the ARP reply packet or not. + * If d_len is zero, no packet should be sent; If d_len is non-zero, it + * contains the length of the outbound packet that is present in the d_buf + * buffer. + * + ****************************************************************************/ + +void arp_input(FAR struct net_driver_s *dev); + +#else /* CONFIG_NET_ARP */ + +/* If ARP is disabled, stub out all ARP interfaces */ + +# define arp_input(dev) + +#endif /* CONFIG_NET_ARP */ + /**************************************************************************** * Polling of connections * diff --git a/net/arp/arp.h b/net/arp/arp.h index da9ff4a4b9..503b09ffce 100644 --- a/net/arp/arp.h +++ b/net/arp/arp.h @@ -40,9 +40,9 @@ #include #include +#include #include -#include #include #include @@ -154,6 +154,16 @@ struct arp_notify_s }; #endif +/* One entry in the ARP table (volatile!) */ + +struct arp_entry_s +{ + in_addr_t at_ipaddr; /* IP address */ + struct ether_addr at_ethaddr; /* Hardware address */ + clock_t at_time; /* Time of last usage */ + FAR struct net_driver_s *at_dev; /* The device driver structure */ +}; + /**************************************************************************** * Public Data ****************************************************************************/ diff --git a/net/arp/arp_format.c b/net/arp/arp_format.c index 50782eaae4..6cca53a7f9 100644 --- a/net/arp/arp_format.c +++ b/net/arp/arp_format.c @@ -49,7 +49,6 @@ #include #include -#include #include "arp/arp.h" diff --git a/net/arp/arp_input.c b/net/arp/arp_input.c index fe47ca1328..b347d11265 100644 --- a/net/arp/arp_input.c +++ b/net/arp/arp_input.c @@ -49,7 +49,6 @@ #include #include -#include #include "arp/arp.h" #include "devif/devif.h" diff --git a/net/arp/arp_ipin.c b/net/arp/arp_ipin.c index 953d0156ae..abb3fe8ec5 100644 --- a/net/arp/arp_ipin.c +++ b/net/arp/arp_ipin.c @@ -47,7 +47,6 @@ #include #include -#include #include "arp/arp.h" diff --git a/net/arp/arp_out.c b/net/arp/arp_out.c index 851635eee6..2e964164c3 100644 --- a/net/arp/arp_out.c +++ b/net/arp/arp_out.c @@ -49,7 +49,6 @@ #include #include -#include #include "route/route.h" #include "arp/arp.h" diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c index 6a4f182f23..ac0b45c748 100644 --- a/net/arp/arp_send.c +++ b/net/arp/arp_send.c @@ -34,7 +34,6 @@ #include #include #include -#include #include "netdev/netdev.h" #include "devif/devif.h" diff --git a/net/arp/arp_table.c b/net/arp/arp_table.c index da8ccb343d..cfba3d2d67 100644 --- a/net/arp/arp_table.c +++ b/net/arp/arp_table.c @@ -58,11 +58,10 @@ #include #include #include -#include #include -#include -#include +#include "netdev/netdev.h" +#include "arp/arp.h" #ifdef CONFIG_NET_ARP diff --git a/net/devif/devif_poll.c b/net/devif/devif_poll.c index 28baba33d1..89567a187a 100644 --- a/net/devif/devif_poll.c +++ b/net/devif/devif_poll.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "devif/devif.h" #include "arp/arp.h" diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c index 764d093be1..94df206ecc 100644 --- a/net/netdev/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -42,7 +42,6 @@ #include #include -#include #ifdef CONFIG_NET_6LOWPAN # include diff --git a/net/netlink/netlink_route.c b/net/netlink/netlink_route.c index f42200a691..9c614c8fa2 100644 --- a/net/netlink/netlink_route.c +++ b/net/netlink/netlink_route.c @@ -35,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index ad44230f65..bc30d4956b 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -50,7 +50,6 @@ #include #include #include -#include #include #include diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index a74a822690..4e6af943d2 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include "netdev/netdev.h" diff --git a/net/tcp/tcp_sendfile.c b/net/tcp/tcp_sendfile.c index cff780382e..3256942f33 100644 --- a/net/tcp/tcp_sendfile.c +++ b/net/tcp/tcp_sendfile.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include "netdev/netdev.h" diff --git a/net/udp/udp_sendto_buffered.c b/net/udp/udp_sendto_buffered.c index 907cecfc44..e5c36898fc 100644 --- a/net/udp/udp_sendto_buffered.c +++ b/net/udp/udp_sendto_buffered.c @@ -49,7 +49,6 @@ #include #include #include -#include #include #include "netdev/netdev.h" diff --git a/wireless/bluetooth/bt_netdev.c b/wireless/bluetooth/bt_netdev.c index 6c21a7dff0..d146560707 100644 --- a/wireless/bluetooth/bt_netdev.c +++ b/wireless/bluetooth/bt_netdev.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/wireless/ieee802154/mac802154_netdev.c b/wireless/ieee802154/mac802154_netdev.c index 380dfb63a3..92031de31c 100644 --- a/wireless/ieee802154/mac802154_netdev.c +++ b/wireless/ieee802154/mac802154_netdev.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include