net/hsr/hsr_main.h
Source file repositories/reference/linux-study-clean/net/hsr/hsr_main.h
File Facts
- System
- Linux kernel
- Corpus path
net/hsr/hsr_main.h- Extension
.h- Size
- 9027 bytes
- Lines
- 301
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/netdevice.hlinux/list.hlinux/if_vlan.hlinux/if_hsr.h
Detected Declarations
struct hsr_ethhdrstruct hsr_vlan_ethhdrstruct hsr_sup_tlvstruct hsr_sup_tagstruct hsr_sup_payloadstruct hsrv0_ethhdr_spstruct hsrv1_ethhdr_spstruct prp_rctstruct hsr_portstruct hsr_frame_infostruct hsr_nodestruct hsr_proto_opsstruct hsr_self_nodestruct hsr_privfunction firstfunction set_hsr_tag_LSDU_sizefunction set_hsr_stag_pathfunction set_hsr_stag_HSR_verfunction get_prp_LSDU_sizefunction set_prp_lan_idfunction set_prp_LSDU_sizefunction hsr_get_skb_sequence_nrfunction prp_get_skb_sequence_nrfunction prp_check_lsdu_sizefunction hsr_debugfs_rename
Annotated Snippet
struct hsr_ethhdr {
struct ethhdr ethhdr;
struct hsr_tag hsr_tag;
} __packed;
struct hsr_vlan_ethhdr {
struct vlan_ethhdr vlanhdr;
struct hsr_tag hsr_tag;
} __packed;
struct hsr_sup_tlv {
u8 HSR_TLV_type;
u8 HSR_TLV_length;
} __packed;
/* HSR/PRP Supervision Frame data types.
* Field names as defined in the IEC:2010 standard for HSR.
*/
struct hsr_sup_tag {
__be16 path_and_HSR_ver;
__be16 sequence_nr;
struct hsr_sup_tlv tlv;
} __packed;
struct hsr_sup_payload {
unsigned char macaddress_A[ETH_ALEN];
} __packed;
static inline void set_hsr_stag_path(struct hsr_sup_tag *hst, u16 path)
{
set_hsr_tag_path((struct hsr_tag *)hst, path);
}
static inline void set_hsr_stag_HSR_ver(struct hsr_sup_tag *hst, u16 HSR_ver)
{
set_hsr_tag_LSDU_size((struct hsr_tag *)hst, HSR_ver);
}
struct hsrv0_ethhdr_sp {
struct ethhdr ethhdr;
struct hsr_sup_tag hsr_sup;
} __packed;
struct hsrv1_ethhdr_sp {
struct ethhdr ethhdr;
struct hsr_tag hsr;
struct hsr_sup_tag hsr_sup;
} __packed;
/* PRP Redunancy Control Trailor (RCT).
* As defined in IEC-62439-4:2012, the PRP RCT is really { sequence Nr,
* Lan indentifier (LanId), LSDU_size and PRP_suffix = 0x88FB }.
*
* Field names as defined in the IEC:2012 standard for PRP.
*/
struct prp_rct {
__be16 sequence_nr;
__be16 lan_id_and_LSDU_size;
__be16 PRP_suffix;
} __packed;
static inline u16 get_prp_LSDU_size(struct prp_rct *rct)
{
return ntohs(rct->lan_id_and_LSDU_size) & 0x0FFF;
}
static inline void set_prp_lan_id(struct prp_rct *rct, u16 lan_id)
{
rct->lan_id_and_LSDU_size = htons((ntohs(rct->lan_id_and_LSDU_size) &
0x0FFF) | (lan_id << 12));
}
static inline void set_prp_LSDU_size(struct prp_rct *rct, u16 LSDU_size)
{
rct->lan_id_and_LSDU_size = htons((ntohs(rct->lan_id_and_LSDU_size) &
0xF000) | (LSDU_size & 0x0FFF));
}
struct hsr_port {
struct list_head port_list;
struct net_device *dev;
struct hsr_priv *hsr;
enum hsr_port_type type;
struct rcu_head rcu;
unsigned char original_macaddress[ETH_ALEN];
};
struct hsr_frame_info;
struct hsr_node;
struct hsr_proto_ops {
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/list.h`, `linux/if_vlan.h`, `linux/if_hsr.h`.
- Detected declarations: `struct hsr_ethhdr`, `struct hsr_vlan_ethhdr`, `struct hsr_sup_tlv`, `struct hsr_sup_tag`, `struct hsr_sup_payload`, `struct hsrv0_ethhdr_sp`, `struct hsrv1_ethhdr_sp`, `struct prp_rct`, `struct hsr_port`, `struct hsr_frame_info`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.