From 082bc17ab02631e7930c6ddf5a343a427c1acdaf Mon Sep 17 00:00:00 2001 From: zhanghongyu Date: Fri, 1 Nov 2024 20:30:42 +0800 Subject: [PATCH] netinet/if_ether.h: move #define ETH_XXX into if_ether.h consistent with other operating systems Signed-off-by: zhanghongyu --- include/netinet/if_ether.h | 11 ++++++++++- include/nuttx/wireless/ieee80211/ieee80211.h | 17 ++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index 85c86c32977d2..a2153564c9c00 100644 --- a/include/netinet/if_ether.h +++ b/include/netinet/if_ether.h @@ -35,7 +35,16 @@ * Pre-processor Definitions ****************************************************************************/ -#define ETH_ALEN 6 /* Octets in one ethernet addr */ +#define ETH_ALEN 6 /* Octets in one ethernet addr */ +#define ETH_TLEN 2 /* Octets in ethernet type field */ +#define ETH_HLEN 14 /* Total octets in header. */ +#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ +#define ETH_DATA_LEN 1500 /* Max. octets in payload */ +#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ +#define ETH_FCS_LEN 4 /* Octets in the FCS */ + +#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */ +#define ETH_MAX_MTU 0xFFFFU /* 65535, same as IP_MAX_MTU */ #define ETH_P_IP ETHERTYPE_IP #define ETH_P_ARP ETHERTYPE_ARP diff --git a/include/nuttx/wireless/ieee80211/ieee80211.h b/include/nuttx/wireless/ieee80211/ieee80211.h index 31874693ed914..b00dd86da3f56 100644 --- a/include/nuttx/wireless/ieee80211/ieee80211.h +++ b/include/nuttx/wireless/ieee80211/ieee80211.h @@ -39,25 +39,12 @@ #include #include +#include + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble - * and FCS/CRC (frame check sequence). - */ - -#define ETH_ALEN 6 /* Octets in one ethernet addr */ -#define ETH_TLEN 2 /* Octets in ethernet type field */ -#define ETH_HLEN 14 /* Total octets in header. */ -#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ -#define ETH_DATA_LEN 1500 /* Max. octets in payload */ -#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ -#define ETH_FCS_LEN 4 /* Octets in the FCS */ - -#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */ -#define ETH_MAX_MTU 0xFFFFU /* 65535, same as IP_MAX_MTU */ - /* DS bit usage * * TA = transmitter address