@@ -618,9 +618,7 @@ struct ethernet_vlan {
618
618
#if defined(CONFIG_NET_VLAN_COUNT )
619
619
#define NET_VLAN_MAX_COUNT CONFIG_NET_VLAN_COUNT
620
620
#else
621
- /* Even thou there are no VLAN support, the minimum count must be set to 1.
622
- */
623
- #define NET_VLAN_MAX_COUNT 1
621
+ #define NET_VLAN_MAX_COUNT 0
624
622
#endif
625
623
626
624
/** @endcond */
@@ -681,7 +679,14 @@ struct ethernet_context {
681
679
struct net_if * iface ;
682
680
683
681
#if defined(CONFIG_NET_LLDP )
684
- struct ethernet_lldp lldp [NET_VLAN_MAX_COUNT ];
682
+ #if NET_VLAN_MAX_COUNT > 0
683
+ #define NET_LLDP_MAX_COUNT NET_VLAN_MAX_COUNT
684
+ #else
685
+ #define NET_LLDP_MAX_COUNT 1
686
+ #endif /* NET_VLAN_MAX_COUNT > 0 */
687
+
688
+ /** LLDP specific parameters */
689
+ struct ethernet_lldp lldp [NET_LLDP_MAX_COUNT ];
685
690
#endif
686
691
687
692
/**
@@ -988,7 +993,7 @@ int net_eth_get_hw_config(struct net_if *iface, enum ethernet_config_type type,
988
993
*
989
994
* @return 0 if ok, <0 if error
990
995
*/
991
- #if defined(CONFIG_NET_VLAN )
996
+ #if defined(CONFIG_NET_VLAN ) && NET_VLAN_MAX_COUNT > 0
992
997
int net_eth_vlan_enable (struct net_if * iface , uint16_t tag );
993
998
#else
994
999
static inline int net_eth_vlan_enable (struct net_if * iface , uint16_t tag )
@@ -1008,7 +1013,7 @@ static inline int net_eth_vlan_enable(struct net_if *iface, uint16_t tag)
1008
1013
*
1009
1014
* @return 0 if ok, <0 if error
1010
1015
*/
1011
- #if defined(CONFIG_NET_VLAN )
1016
+ #if defined(CONFIG_NET_VLAN ) && NET_VLAN_MAX_COUNT > 0
1012
1017
int net_eth_vlan_disable (struct net_if * iface , uint16_t tag );
1013
1018
#else
1014
1019
static inline int net_eth_vlan_disable (struct net_if * iface , uint16_t tag )
@@ -1031,7 +1036,7 @@ static inline int net_eth_vlan_disable(struct net_if *iface, uint16_t tag)
1031
1036
* @return VLAN tag for this interface or NET_VLAN_TAG_UNSPEC if VLAN
1032
1037
* is not configured for that interface.
1033
1038
*/
1034
- #if defined(CONFIG_NET_VLAN )
1039
+ #if defined(CONFIG_NET_VLAN ) && NET_VLAN_MAX_COUNT > 0
1035
1040
uint16_t net_eth_get_vlan_tag (struct net_if * iface );
1036
1041
#else
1037
1042
static inline uint16_t net_eth_get_vlan_tag (struct net_if * iface )
@@ -1073,7 +1078,7 @@ struct net_if *net_eth_get_vlan_iface(struct net_if *iface, uint16_t tag)
1073
1078
* @return Network interface related to this tag or NULL if no such interface
1074
1079
* exists.
1075
1080
*/
1076
- #if defined(CONFIG_NET_VLAN )
1081
+ #if defined(CONFIG_NET_VLAN ) && NET_VLAN_MAX_COUNT > 0
1077
1082
struct net_if * net_eth_get_vlan_main (struct net_if * iface );
1078
1083
#else
1079
1084
static inline
@@ -1119,7 +1124,7 @@ static inline bool net_eth_is_vlan_enabled(struct ethernet_context *ctx,
1119
1124
*
1120
1125
* @return True if VLAN is enabled for this network interface, false if not.
1121
1126
*/
1122
- #if defined(CONFIG_NET_VLAN )
1127
+ #if defined(CONFIG_NET_VLAN ) && NET_VLAN_MAX_COUNT > 0
1123
1128
bool net_eth_get_vlan_status (struct net_if * iface );
1124
1129
#else
1125
1130
static inline bool net_eth_get_vlan_status (struct net_if * iface )
@@ -1137,7 +1142,7 @@ static inline bool net_eth_get_vlan_status(struct net_if *iface)
1137
1142
*
1138
1143
* @return True if this network interface is VLAN one, false if not.
1139
1144
*/
1140
- #if defined(CONFIG_NET_VLAN )
1145
+ #if defined(CONFIG_NET_VLAN ) && NET_VLAN_MAX_COUNT > 0
1141
1146
bool net_eth_is_vlan_interface (struct net_if * iface );
1142
1147
#else
1143
1148
static inline bool net_eth_is_vlan_interface (struct net_if * iface )
0 commit comments