0001
0002 #ifndef _LINUX_IF_HSR_H_
0003 #define _LINUX_IF_HSR_H_
0004
0005 #include <linux/types.h>
0006
0007 struct net_device;
0008
0009
0010 enum hsr_version {
0011 HSR_V0 = 0,
0012 HSR_V1,
0013 PRP_V1,
0014 };
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 struct hsr_tag {
0025 __be16 path_and_LSDU_size;
0026 __be16 sequence_nr;
0027 __be16 encap_proto;
0028 } __packed;
0029
0030 #define HSR_HLEN 6
0031
0032 #if IS_ENABLED(CONFIG_HSR)
0033 extern bool is_hsr_master(struct net_device *dev);
0034 extern int hsr_get_version(struct net_device *dev, enum hsr_version *ver);
0035 #else
0036 static inline bool is_hsr_master(struct net_device *dev)
0037 {
0038 return false;
0039 }
0040 static inline int hsr_get_version(struct net_device *dev,
0041 enum hsr_version *ver)
0042 {
0043 return -EINVAL;
0044 }
0045 #endif
0046
0047 #endif