diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2008-12-26 16:41:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-26 16:41:53 -0500 |
commit | e727149e26b08550269a7786fda977aed65578f6 (patch) | |
tree | b73d6246806b01e2384d84d273cfdb48c6d74891 /drivers/net | |
parent | e4ac43200fd6b8b8de3b487e74e74d3742f70d79 (diff) |
802.3ad: use standard ethhdr instead of ad_header
802.3ad has its own ethhdr-like structure in the form of an ad_header,
which is at the start of both the LACPDU and marker PDU. Both are
the same from the struct values, both are packed as well.
It's therefore perfectly fine to replace the ad_header by the ethhdr
and to remove its definition.
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 16 | ||||
-rw-r--r-- | drivers/net/bonding/bond_3ad.h | 10 |
2 files changed, 8 insertions, 18 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index fb32b29751e1..8c2e5ab51f08 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -840,13 +840,11 @@ static int ad_lacpdu_send(struct port *port) | |||
840 | 840 | ||
841 | lacpdu_header = (struct lacpdu_header *)skb_put(skb, length); | 841 | lacpdu_header = (struct lacpdu_header *)skb_put(skb, length); |
842 | 842 | ||
843 | memcpy(lacpdu_header->ad_header.destination_address.mac_addr_value, | 843 | memcpy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr, ETH_ALEN); |
844 | lacpdu_mcast_addr, ETH_ALEN); | ||
845 | /* Note: source addres is set to be the member's PERMANENT address, | 844 | /* Note: source addres is set to be the member's PERMANENT address, |
846 | because we use it to identify loopback lacpdus in receive. */ | 845 | because we use it to identify loopback lacpdus in receive. */ |
847 | memcpy(lacpdu_header->ad_header.source_address.mac_addr_value, | 846 | memcpy(lacpdu_header->hdr.h_source, slave->perm_hwaddr, ETH_ALEN); |
848 | slave->perm_hwaddr, ETH_ALEN); | 847 | lacpdu_header->hdr.h_proto = PKT_TYPE_LACPDU; |
849 | lacpdu_header->ad_header.length_type = PKT_TYPE_LACPDU; | ||
850 | 848 | ||
851 | lacpdu_header->lacpdu = port->lacpdu; // struct copy | 849 | lacpdu_header->lacpdu = port->lacpdu; // struct copy |
852 | 850 | ||
@@ -884,13 +882,11 @@ static int ad_marker_send(struct port *port, struct bond_marker *marker) | |||
884 | 882 | ||
885 | marker_header = (struct bond_marker_header *)skb_put(skb, length); | 883 | marker_header = (struct bond_marker_header *)skb_put(skb, length); |
886 | 884 | ||
887 | memcpy(marker_header->ad_header.destination_address.mac_addr_value, | 885 | memcpy(marker_header->hdr.h_dest, lacpdu_mcast_addr, ETH_ALEN); |
888 | lacpdu_mcast_addr, ETH_ALEN); | ||
889 | /* Note: source addres is set to be the member's PERMANENT address, | 886 | /* Note: source addres is set to be the member's PERMANENT address, |
890 | because we use it to identify loopback MARKERs in receive. */ | 887 | because we use it to identify loopback MARKERs in receive. */ |
891 | memcpy(marker_header->ad_header.source_address.mac_addr_value, | 888 | memcpy(marker_header->hdr.h_source, slave->perm_hwaddr, ETH_ALEN); |
892 | slave->perm_hwaddr, ETH_ALEN); | 889 | marker_header->hdr.h_proto = PKT_TYPE_LACPDU; |
893 | marker_header->ad_header.length_type = PKT_TYPE_LACPDU; | ||
894 | 890 | ||
895 | marker_header->marker = *marker; // struct copy | 891 | marker_header->marker = *marker; // struct copy |
896 | 892 | ||
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h index 3aab1c2b3f00..8a83eb283c21 100644 --- a/drivers/net/bonding/bond_3ad.h +++ b/drivers/net/bonding/bond_3ad.h | |||
@@ -105,12 +105,6 @@ typedef enum { | |||
105 | 105 | ||
106 | #pragma pack(1) | 106 | #pragma pack(1) |
107 | 107 | ||
108 | typedef struct ad_header { | ||
109 | struct mac_addr destination_address; | ||
110 | struct mac_addr source_address; | ||
111 | __be16 length_type; | ||
112 | } ad_header_t; | ||
113 | |||
114 | // Link Aggregation Control Protocol(LACP) data unit structure(43.4.2.2 in the 802.3ad standard) | 108 | // Link Aggregation Control Protocol(LACP) data unit structure(43.4.2.2 in the 802.3ad standard) |
115 | typedef struct lacpdu { | 109 | typedef struct lacpdu { |
116 | u8 subtype; // = LACP(= 0x01) | 110 | u8 subtype; // = LACP(= 0x01) |
@@ -143,7 +137,7 @@ typedef struct lacpdu { | |||
143 | } lacpdu_t; | 137 | } lacpdu_t; |
144 | 138 | ||
145 | typedef struct lacpdu_header { | 139 | typedef struct lacpdu_header { |
146 | struct ad_header ad_header; | 140 | struct ethhdr hdr; |
147 | struct lacpdu lacpdu; | 141 | struct lacpdu lacpdu; |
148 | } lacpdu_header_t; | 142 | } lacpdu_header_t; |
149 | 143 | ||
@@ -164,7 +158,7 @@ typedef struct bond_marker { | |||
164 | } bond_marker_t; | 158 | } bond_marker_t; |
165 | 159 | ||
166 | typedef struct bond_marker_header { | 160 | typedef struct bond_marker_header { |
167 | struct ad_header ad_header; | 161 | struct ethhdr hdr; |
168 | struct bond_marker marker; | 162 | struct bond_marker marker; |
169 | } bond_marker_header_t; | 163 | } bond_marker_header_t; |
170 | 164 | ||