diff options
author | Murali Karicheri <m-karicheri2@ti.com> | 2019-04-05 13:31:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-06 21:32:21 -0400 |
commit | b1b4aa914080286aa82d4e629d1a646738f2f94c (patch) | |
tree | d4c773437cb0bb9af68eb88cf7a83601f0276917 | |
parent | d131fcc690b9f204581ed14581f5c7f2347cb140 (diff) |
net: hsr: remove camel case usage in the code
Current driver code uses camel case in many places. This is
seen when ran checkpatch.pl -f on files under net/hsr. This
patch fixes the code to remove camel case usage.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/hsr/hsr_device.c | 29 | ||||
-rw-r--r-- | net/hsr/hsr_forward.c | 38 | ||||
-rw-r--r-- | net/hsr/hsr_framereg.c | 70 | ||||
-rw-r--r-- | net/hsr/hsr_main.h | 14 |
4 files changed, 76 insertions, 75 deletions
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 245fc531d39f..99142226622c 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c | |||
@@ -243,7 +243,7 @@ static const struct header_ops hsr_header_ops = { | |||
243 | }; | 243 | }; |
244 | 244 | ||
245 | static void send_hsr_supervision_frame(struct hsr_port *master, | 245 | static void send_hsr_supervision_frame(struct hsr_port *master, |
246 | u8 type, u8 hsrVer) | 246 | u8 type, u8 hsr_ver) |
247 | { | 247 | { |
248 | struct sk_buff *skb; | 248 | struct sk_buff *skb; |
249 | int hlen, tlen; | 249 | int hlen, tlen; |
@@ -264,28 +264,28 @@ static void send_hsr_supervision_frame(struct hsr_port *master, | |||
264 | skb_reserve(skb, hlen); | 264 | skb_reserve(skb, hlen); |
265 | 265 | ||
266 | skb->dev = master->dev; | 266 | skb->dev = master->dev; |
267 | skb->protocol = htons(hsrVer ? ETH_P_HSR : ETH_P_PRP); | 267 | skb->protocol = htons(hsr_ver ? ETH_P_HSR : ETH_P_PRP); |
268 | skb->priority = TC_PRIO_CONTROL; | 268 | skb->priority = TC_PRIO_CONTROL; |
269 | 269 | ||
270 | if (dev_hard_header(skb, skb->dev, (hsrVer ? ETH_P_HSR : ETH_P_PRP), | 270 | if (dev_hard_header(skb, skb->dev, (hsr_ver ? ETH_P_HSR : ETH_P_PRP), |
271 | master->hsr->sup_multicast_addr, | 271 | master->hsr->sup_multicast_addr, |
272 | skb->dev->dev_addr, skb->len) <= 0) | 272 | skb->dev->dev_addr, skb->len) <= 0) |
273 | goto out; | 273 | goto out; |
274 | skb_reset_mac_header(skb); | 274 | skb_reset_mac_header(skb); |
275 | 275 | ||
276 | if (hsrVer > 0) { | 276 | if (hsr_ver > 0) { |
277 | hsr_tag = skb_put(skb, sizeof(struct hsr_tag)); | 277 | hsr_tag = skb_put(skb, sizeof(struct hsr_tag)); |
278 | hsr_tag->encap_proto = htons(ETH_P_PRP); | 278 | hsr_tag->encap_proto = htons(ETH_P_PRP); |
279 | set_hsr_tag_LSDU_size(hsr_tag, HSR_V1_SUP_LSDUSIZE); | 279 | set_hsr_tag_LSDU_size(hsr_tag, HSR_V1_SUP_LSDUSIZE); |
280 | } | 280 | } |
281 | 281 | ||
282 | hsr_stag = skb_put(skb, sizeof(struct hsr_sup_tag)); | 282 | hsr_stag = skb_put(skb, sizeof(struct hsr_sup_tag)); |
283 | set_hsr_stag_path(hsr_stag, (hsrVer ? 0x0 : 0xf)); | 283 | set_hsr_stag_path(hsr_stag, (hsr_ver ? 0x0 : 0xf)); |
284 | set_hsr_stag_HSR_Ver(hsr_stag, hsrVer); | 284 | set_hsr_stag_HSR_ver(hsr_stag, hsr_ver); |
285 | 285 | ||
286 | /* From HSRv1 on we have separate supervision sequence numbers. */ | 286 | /* From HSRv1 on we have separate supervision sequence numbers. */ |
287 | spin_lock_irqsave(&master->hsr->seqnr_lock, irqflags); | 287 | spin_lock_irqsave(&master->hsr->seqnr_lock, irqflags); |
288 | if (hsrVer > 0) { | 288 | if (hsr_ver > 0) { |
289 | hsr_stag->sequence_nr = htons(master->hsr->sup_sequence_nr); | 289 | hsr_stag->sequence_nr = htons(master->hsr->sup_sequence_nr); |
290 | hsr_tag->sequence_nr = htons(master->hsr->sequence_nr); | 290 | hsr_tag->sequence_nr = htons(master->hsr->sequence_nr); |
291 | master->hsr->sup_sequence_nr++; | 291 | master->hsr->sup_sequence_nr++; |
@@ -296,13 +296,14 @@ static void send_hsr_supervision_frame(struct hsr_port *master, | |||
296 | } | 296 | } |
297 | spin_unlock_irqrestore(&master->hsr->seqnr_lock, irqflags); | 297 | spin_unlock_irqrestore(&master->hsr->seqnr_lock, irqflags); |
298 | 298 | ||
299 | hsr_stag->HSR_TLV_Type = type; | 299 | hsr_stag->HSR_TLV_type = type; |
300 | /* TODO: Why 12 in HSRv0? */ | 300 | /* TODO: Why 12 in HSRv0? */ |
301 | hsr_stag->HSR_TLV_Length = hsrVer ? sizeof(struct hsr_sup_payload) : 12; | 301 | hsr_stag->HSR_TLV_length = |
302 | hsr_ver ? sizeof(struct hsr_sup_payload) : 12; | ||
302 | 303 | ||
303 | /* Payload: MacAddressA */ | 304 | /* Payload: MacAddressA */ |
304 | hsr_sp = skb_put(skb, sizeof(struct hsr_sup_payload)); | 305 | hsr_sp = skb_put(skb, sizeof(struct hsr_sup_payload)); |
305 | ether_addr_copy(hsr_sp->MacAddressA, master->dev->dev_addr); | 306 | ether_addr_copy(hsr_sp->macaddress_A, master->dev->dev_addr); |
306 | 307 | ||
307 | if (skb_put_padto(skb, ETH_ZLEN + HSR_HLEN)) | 308 | if (skb_put_padto(skb, ETH_ZLEN + HSR_HLEN)) |
308 | return; | 309 | return; |
@@ -328,15 +329,15 @@ static void hsr_announce(struct timer_list *t) | |||
328 | rcu_read_lock(); | 329 | rcu_read_lock(); |
329 | master = hsr_port_get_hsr(hsr, HSR_PT_MASTER); | 330 | master = hsr_port_get_hsr(hsr, HSR_PT_MASTER); |
330 | 331 | ||
331 | if (hsr->announce_count < 3 && hsr->protVersion == 0) { | 332 | if (hsr->announce_count < 3 && hsr->prot_version == 0) { |
332 | send_hsr_supervision_frame(master, HSR_TLV_ANNOUNCE, | 333 | send_hsr_supervision_frame(master, HSR_TLV_ANNOUNCE, |
333 | hsr->protVersion); | 334 | hsr->prot_version); |
334 | hsr->announce_count++; | 335 | hsr->announce_count++; |
335 | 336 | ||
336 | interval = msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL); | 337 | interval = msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL); |
337 | } else { | 338 | } else { |
338 | send_hsr_supervision_frame(master, HSR_TLV_LIFE_CHECK, | 339 | send_hsr_supervision_frame(master, HSR_TLV_LIFE_CHECK, |
339 | hsr->protVersion); | 340 | hsr->prot_version); |
340 | 341 | ||
341 | interval = msecs_to_jiffies(HSR_LIFE_CHECK_INTERVAL); | 342 | interval = msecs_to_jiffies(HSR_LIFE_CHECK_INTERVAL); |
342 | } | 343 | } |
@@ -455,7 +456,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], | |||
455 | ether_addr_copy(hsr->sup_multicast_addr, def_multicast_addr); | 456 | ether_addr_copy(hsr->sup_multicast_addr, def_multicast_addr); |
456 | hsr->sup_multicast_addr[ETH_ALEN - 1] = multicast_spec; | 457 | hsr->sup_multicast_addr[ETH_ALEN - 1] = multicast_spec; |
457 | 458 | ||
458 | hsr->protVersion = protocol_version; | 459 | hsr->prot_version = protocol_version; |
459 | 460 | ||
460 | /* FIXME: should I modify the value of these? | 461 | /* FIXME: should I modify the value of these? |
461 | * | 462 | * |
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index 43f91651ba10..602029c44050 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c | |||
@@ -48,40 +48,40 @@ struct hsr_frame_info { | |||
48 | */ | 48 | */ |
49 | static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) | 49 | static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) |
50 | { | 50 | { |
51 | struct ethhdr *ethHdr; | 51 | struct ethhdr *eth_hdr; |
52 | struct hsr_sup_tag *hsrSupTag; | 52 | struct hsr_sup_tag *hsr_sup_tag; |
53 | struct hsrv1_ethhdr_sp *hsrV1Hdr; | 53 | struct hsrv1_ethhdr_sp *hsr_V1_hdr; |
54 | 54 | ||
55 | WARN_ON_ONCE(!skb_mac_header_was_set(skb)); | 55 | WARN_ON_ONCE(!skb_mac_header_was_set(skb)); |
56 | ethHdr = (struct ethhdr *)skb_mac_header(skb); | 56 | eth_hdr = (struct ethhdr *)skb_mac_header(skb); |
57 | 57 | ||
58 | /* Correct addr? */ | 58 | /* Correct addr? */ |
59 | if (!ether_addr_equal(ethHdr->h_dest, | 59 | if (!ether_addr_equal(eth_hdr->h_dest, |
60 | hsr->sup_multicast_addr)) | 60 | hsr->sup_multicast_addr)) |
61 | return false; | 61 | return false; |
62 | 62 | ||
63 | /* Correct ether type?. */ | 63 | /* Correct ether type?. */ |
64 | if (!(ethHdr->h_proto == htons(ETH_P_PRP) || | 64 | if (!(eth_hdr->h_proto == htons(ETH_P_PRP) || |
65 | ethHdr->h_proto == htons(ETH_P_HSR))) | 65 | eth_hdr->h_proto == htons(ETH_P_HSR))) |
66 | return false; | 66 | return false; |
67 | 67 | ||
68 | /* Get the supervision header from correct location. */ | 68 | /* Get the supervision header from correct location. */ |
69 | if (ethHdr->h_proto == htons(ETH_P_HSR)) { /* Okay HSRv1. */ | 69 | if (eth_hdr->h_proto == htons(ETH_P_HSR)) { /* Okay HSRv1. */ |
70 | hsrV1Hdr = (struct hsrv1_ethhdr_sp *)skb_mac_header(skb); | 70 | hsr_V1_hdr = (struct hsrv1_ethhdr_sp *)skb_mac_header(skb); |
71 | if (hsrV1Hdr->hsr.encap_proto != htons(ETH_P_PRP)) | 71 | if (hsr_V1_hdr->hsr.encap_proto != htons(ETH_P_PRP)) |
72 | return false; | 72 | return false; |
73 | 73 | ||
74 | hsrSupTag = &hsrV1Hdr->hsr_sup; | 74 | hsr_sup_tag = &hsr_V1_hdr->hsr_sup; |
75 | } else { | 75 | } else { |
76 | hsrSupTag = | 76 | hsr_sup_tag = |
77 | &((struct hsrv0_ethhdr_sp *)skb_mac_header(skb))->hsr_sup; | 77 | &((struct hsrv0_ethhdr_sp *)skb_mac_header(skb))->hsr_sup; |
78 | } | 78 | } |
79 | 79 | ||
80 | if (hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE && | 80 | if (hsr_sup_tag->HSR_TLV_type != HSR_TLV_ANNOUNCE && |
81 | hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK) | 81 | hsr_sup_tag->HSR_TLV_type != HSR_TLV_LIFE_CHECK) |
82 | return false; | 82 | return false; |
83 | if (hsrSupTag->HSR_TLV_Length != 12 && | 83 | if (hsr_sup_tag->HSR_TLV_length != 12 && |
84 | hsrSupTag->HSR_TLV_Length != sizeof(struct hsr_sup_payload)) | 84 | hsr_sup_tag->HSR_TLV_length != sizeof(struct hsr_sup_payload)) |
85 | return false; | 85 | return false; |
86 | 86 | ||
87 | return true; | 87 | return true; |
@@ -125,7 +125,7 @@ static struct sk_buff *frame_get_stripped_skb(struct hsr_frame_info *frame, | |||
125 | } | 125 | } |
126 | 126 | ||
127 | static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame, | 127 | static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame, |
128 | struct hsr_port *port, u8 protoVersion) | 128 | struct hsr_port *port, u8 proto_version) |
129 | { | 129 | { |
130 | struct hsr_ethhdr *hsr_ethhdr; | 130 | struct hsr_ethhdr *hsr_ethhdr; |
131 | int lane_id; | 131 | int lane_id; |
@@ -146,7 +146,7 @@ static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame, | |||
146 | set_hsr_tag_LSDU_size(&hsr_ethhdr->hsr_tag, lsdu_size); | 146 | set_hsr_tag_LSDU_size(&hsr_ethhdr->hsr_tag, lsdu_size); |
147 | hsr_ethhdr->hsr_tag.sequence_nr = htons(frame->sequence_nr); | 147 | hsr_ethhdr->hsr_tag.sequence_nr = htons(frame->sequence_nr); |
148 | hsr_ethhdr->hsr_tag.encap_proto = hsr_ethhdr->ethhdr.h_proto; | 148 | hsr_ethhdr->hsr_tag.encap_proto = hsr_ethhdr->ethhdr.h_proto; |
149 | hsr_ethhdr->ethhdr.h_proto = htons(protoVersion ? | 149 | hsr_ethhdr->ethhdr.h_proto = htons(proto_version ? |
150 | ETH_P_HSR : ETH_P_PRP); | 150 | ETH_P_HSR : ETH_P_PRP); |
151 | } | 151 | } |
152 | 152 | ||
@@ -176,7 +176,7 @@ static struct sk_buff *create_tagged_skb(struct sk_buff *skb_o, | |||
176 | memmove(dst, src, movelen); | 176 | memmove(dst, src, movelen); |
177 | skb_reset_mac_header(skb); | 177 | skb_reset_mac_header(skb); |
178 | 178 | ||
179 | hsr_fill_tag(skb, frame, port, port->hsr->protVersion); | 179 | hsr_fill_tag(skb, frame, port, port->hsr->prot_version); |
180 | 180 | ||
181 | return skb; | 181 | return skb; |
182 | } | 182 | } |
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index e61892506c66..cba4b2486050 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c | |||
@@ -24,10 +24,10 @@ | |||
24 | 24 | ||
25 | struct hsr_node { | 25 | struct hsr_node { |
26 | struct list_head mac_list; | 26 | struct list_head mac_list; |
27 | unsigned char MacAddressA[ETH_ALEN]; | 27 | unsigned char macaddress_A[ETH_ALEN]; |
28 | unsigned char MacAddressB[ETH_ALEN]; | 28 | unsigned char macaddress_B[ETH_ALEN]; |
29 | /* Local slave through which AddrB frames are received from this node */ | 29 | /* Local slave through which AddrB frames are received from this node */ |
30 | enum hsr_port_type AddrB_port; | 30 | enum hsr_port_type addr_B_port; |
31 | unsigned long time_in[HSR_PT_PORTS]; | 31 | unsigned long time_in[HSR_PT_PORTS]; |
32 | bool time_in_stale[HSR_PT_PORTS]; | 32 | bool time_in_stale[HSR_PT_PORTS]; |
33 | u16 seq_out[HSR_PT_PORTS]; | 33 | u16 seq_out[HSR_PT_PORTS]; |
@@ -64,9 +64,9 @@ bool hsr_addr_is_self(struct hsr_priv *hsr, unsigned char *addr) | |||
64 | return false; | 64 | return false; |
65 | } | 65 | } |
66 | 66 | ||
67 | if (ether_addr_equal(addr, node->MacAddressA)) | 67 | if (ether_addr_equal(addr, node->macaddress_A)) |
68 | return true; | 68 | return true; |
69 | if (ether_addr_equal(addr, node->MacAddressB)) | 69 | if (ether_addr_equal(addr, node->macaddress_B)) |
70 | return true; | 70 | return true; |
71 | 71 | ||
72 | return false; | 72 | return false; |
@@ -74,13 +74,13 @@ bool hsr_addr_is_self(struct hsr_priv *hsr, unsigned char *addr) | |||
74 | 74 | ||
75 | /* Search for mac entry. Caller must hold rcu read lock. | 75 | /* Search for mac entry. Caller must hold rcu read lock. |
76 | */ | 76 | */ |
77 | static struct hsr_node *find_node_by_AddrA(struct list_head *node_db, | 77 | static struct hsr_node *find_node_by_addr_A(struct list_head *node_db, |
78 | const unsigned char addr[ETH_ALEN]) | 78 | const unsigned char addr[ETH_ALEN]) |
79 | { | 79 | { |
80 | struct hsr_node *node; | 80 | struct hsr_node *node; |
81 | 81 | ||
82 | list_for_each_entry_rcu(node, node_db, mac_list) { | 82 | list_for_each_entry_rcu(node, node_db, mac_list) { |
83 | if (ether_addr_equal(node->MacAddressA, addr)) | 83 | if (ether_addr_equal(node->macaddress_A, addr)) |
84 | return node; | 84 | return node; |
85 | } | 85 | } |
86 | 86 | ||
@@ -100,8 +100,8 @@ int hsr_create_self_node(struct list_head *self_node_db, | |||
100 | if (!node) | 100 | if (!node) |
101 | return -ENOMEM; | 101 | return -ENOMEM; |
102 | 102 | ||
103 | ether_addr_copy(node->MacAddressA, addr_a); | 103 | ether_addr_copy(node->macaddress_A, addr_a); |
104 | ether_addr_copy(node->MacAddressB, addr_b); | 104 | ether_addr_copy(node->macaddress_B, addr_b); |
105 | 105 | ||
106 | rcu_read_lock(); | 106 | rcu_read_lock(); |
107 | oldnode = list_first_or_null_rcu(self_node_db, | 107 | oldnode = list_first_or_null_rcu(self_node_db, |
@@ -132,7 +132,7 @@ void hsr_del_node(struct list_head *self_node_db) | |||
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
135 | /* Allocate an hsr_node and add it to node_db. 'addr' is the node's AddressA; | 135 | /* Allocate an hsr_node and add it to node_db. 'addr' is the node's address_A; |
136 | * seq_out is used to initialize filtering of outgoing duplicate frames | 136 | * seq_out is used to initialize filtering of outgoing duplicate frames |
137 | * originating from the newly added node. | 137 | * originating from the newly added node. |
138 | */ | 138 | */ |
@@ -147,7 +147,7 @@ struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[], | |||
147 | if (!node) | 147 | if (!node) |
148 | return NULL; | 148 | return NULL; |
149 | 149 | ||
150 | ether_addr_copy(node->MacAddressA, addr); | 150 | ether_addr_copy(node->macaddress_A, addr); |
151 | 151 | ||
152 | /* We are only interested in time diffs here, so use current jiffies | 152 | /* We are only interested in time diffs here, so use current jiffies |
153 | * as initialization. (0 could trigger an spurious ring error warning). | 153 | * as initialization. (0 could trigger an spurious ring error warning). |
@@ -179,9 +179,9 @@ struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb, | |||
179 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 179 | ethhdr = (struct ethhdr *)skb_mac_header(skb); |
180 | 180 | ||
181 | list_for_each_entry_rcu(node, node_db, mac_list) { | 181 | list_for_each_entry_rcu(node, node_db, mac_list) { |
182 | if (ether_addr_equal(node->MacAddressA, ethhdr->h_source)) | 182 | if (ether_addr_equal(node->macaddress_A, ethhdr->h_source)) |
183 | return node; | 183 | return node; |
184 | if (ether_addr_equal(node->MacAddressB, ethhdr->h_source)) | 184 | if (ether_addr_equal(node->macaddress_B, ethhdr->h_source)) |
185 | return node; | 185 | return node; |
186 | } | 186 | } |
187 | 187 | ||
@@ -205,8 +205,8 @@ struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb, | |||
205 | return hsr_add_node(node_db, ethhdr->h_source, seq_out); | 205 | return hsr_add_node(node_db, ethhdr->h_source, seq_out); |
206 | } | 206 | } |
207 | 207 | ||
208 | /* Use the Supervision frame's info about an eventual MacAddressB for merging | 208 | /* Use the Supervision frame's info about an eventual macaddress_B for merging |
209 | * nodes that has previously had their MacAddressB registered as a separate | 209 | * nodes that has previously had their macaddress_B registered as a separate |
210 | * node. | 210 | * node. |
211 | */ | 211 | */ |
212 | void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, | 212 | void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, |
@@ -232,12 +232,12 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, | |||
232 | 232 | ||
233 | hsr_sp = (struct hsr_sup_payload *)skb->data; | 233 | hsr_sp = (struct hsr_sup_payload *)skb->data; |
234 | 234 | ||
235 | /* Merge node_curr (registered on MacAddressB) into node_real */ | 235 | /* Merge node_curr (registered on macaddress_B) into node_real */ |
236 | node_db = &port_rcv->hsr->node_db; | 236 | node_db = &port_rcv->hsr->node_db; |
237 | node_real = find_node_by_AddrA(node_db, hsr_sp->MacAddressA); | 237 | node_real = find_node_by_addr_A(node_db, hsr_sp->macaddress_A); |
238 | if (!node_real) | 238 | if (!node_real) |
239 | /* No frame received from AddrA of this node yet */ | 239 | /* No frame received from AddrA of this node yet */ |
240 | node_real = hsr_add_node(node_db, hsr_sp->MacAddressA, | 240 | node_real = hsr_add_node(node_db, hsr_sp->macaddress_A, |
241 | HSR_SEQNR_START - 1); | 241 | HSR_SEQNR_START - 1); |
242 | if (!node_real) | 242 | if (!node_real) |
243 | goto done; /* No mem */ | 243 | goto done; /* No mem */ |
@@ -245,7 +245,7 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, | |||
245 | /* Node has already been merged */ | 245 | /* Node has already been merged */ |
246 | goto done; | 246 | goto done; |
247 | 247 | ||
248 | ether_addr_copy(node_real->MacAddressB, ethhdr->h_source); | 248 | ether_addr_copy(node_real->macaddress_B, ethhdr->h_source); |
249 | for (i = 0; i < HSR_PT_PORTS; i++) { | 249 | for (i = 0; i < HSR_PT_PORTS; i++) { |
250 | if (!node_curr->time_in_stale[i] && | 250 | if (!node_curr->time_in_stale[i] && |
251 | time_after(node_curr->time_in[i], node_real->time_in[i])) { | 251 | time_after(node_curr->time_in[i], node_real->time_in[i])) { |
@@ -256,7 +256,7 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, | |||
256 | if (seq_nr_after(node_curr->seq_out[i], node_real->seq_out[i])) | 256 | if (seq_nr_after(node_curr->seq_out[i], node_real->seq_out[i])) |
257 | node_real->seq_out[i] = node_curr->seq_out[i]; | 257 | node_real->seq_out[i] = node_curr->seq_out[i]; |
258 | } | 258 | } |
259 | node_real->AddrB_port = port_rcv->type; | 259 | node_real->addr_B_port = port_rcv->type; |
260 | 260 | ||
261 | list_del_rcu(&node_curr->mac_list); | 261 | list_del_rcu(&node_curr->mac_list); |
262 | kfree_rcu(node_curr, rcu_head); | 262 | kfree_rcu(node_curr, rcu_head); |
@@ -268,7 +268,7 @@ done: | |||
268 | /* 'skb' is a frame meant for this host, that is to be passed to upper layers. | 268 | /* 'skb' is a frame meant for this host, that is to be passed to upper layers. |
269 | * | 269 | * |
270 | * If the frame was sent by a node's B interface, replace the source | 270 | * If the frame was sent by a node's B interface, replace the source |
271 | * address with that node's "official" address (MacAddressA) so that upper | 271 | * address with that node's "official" address (macaddress_A) so that upper |
272 | * layers recognize where it came from. | 272 | * layers recognize where it came from. |
273 | */ | 273 | */ |
274 | void hsr_addr_subst_source(struct hsr_node *node, struct sk_buff *skb) | 274 | void hsr_addr_subst_source(struct hsr_node *node, struct sk_buff *skb) |
@@ -278,7 +278,7 @@ void hsr_addr_subst_source(struct hsr_node *node, struct sk_buff *skb) | |||
278 | return; | 278 | return; |
279 | } | 279 | } |
280 | 280 | ||
281 | memcpy(ð_hdr(skb)->h_source, node->MacAddressA, ETH_ALEN); | 281 | memcpy(ð_hdr(skb)->h_source, node->macaddress_A, ETH_ALEN); |
282 | } | 282 | } |
283 | 283 | ||
284 | /* 'skb' is a frame meant for another host. | 284 | /* 'skb' is a frame meant for another host. |
@@ -303,16 +303,16 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb, | |||
303 | if (!is_unicast_ether_addr(eth_hdr(skb)->h_dest)) | 303 | if (!is_unicast_ether_addr(eth_hdr(skb)->h_dest)) |
304 | return; | 304 | return; |
305 | 305 | ||
306 | node_dst = find_node_by_AddrA(&port->hsr->node_db, | 306 | node_dst = find_node_by_addr_A(&port->hsr->node_db, |
307 | eth_hdr(skb)->h_dest); | 307 | eth_hdr(skb)->h_dest); |
308 | if (!node_dst) { | 308 | if (!node_dst) { |
309 | WARN_ONCE(1, "%s: Unknown node\n", __func__); | 309 | WARN_ONCE(1, "%s: Unknown node\n", __func__); |
310 | return; | 310 | return; |
311 | } | 311 | } |
312 | if (port->type != node_dst->AddrB_port) | 312 | if (port->type != node_dst->addr_B_port) |
313 | return; | 313 | return; |
314 | 314 | ||
315 | ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->MacAddressB); | 315 | ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->macaddress_B); |
316 | } | 316 | } |
317 | 317 | ||
318 | void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port, | 318 | void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port, |
@@ -406,14 +406,14 @@ void hsr_prune_nodes(struct timer_list *t) | |||
406 | rcu_read_lock(); | 406 | rcu_read_lock(); |
407 | port = get_late_port(hsr, node); | 407 | port = get_late_port(hsr, node); |
408 | if (port) | 408 | if (port) |
409 | hsr_nl_ringerror(hsr, node->MacAddressA, port); | 409 | hsr_nl_ringerror(hsr, node->macaddress_A, port); |
410 | rcu_read_unlock(); | 410 | rcu_read_unlock(); |
411 | } | 411 | } |
412 | 412 | ||
413 | /* Prune old entries */ | 413 | /* Prune old entries */ |
414 | if (time_is_before_jiffies(timestamp + | 414 | if (time_is_before_jiffies(timestamp + |
415 | msecs_to_jiffies(HSR_NODE_FORGET_TIME))) { | 415 | msecs_to_jiffies(HSR_NODE_FORGET_TIME))) { |
416 | hsr_nl_nodedown(hsr, node->MacAddressA); | 416 | hsr_nl_nodedown(hsr, node->macaddress_A); |
417 | list_del_rcu(&node->mac_list); | 417 | list_del_rcu(&node->mac_list); |
418 | /* Note that we need to free this entry later: */ | 418 | /* Note that we need to free this entry later: */ |
419 | kfree_rcu(node, rcu_head); | 419 | kfree_rcu(node, rcu_head); |
@@ -431,13 +431,13 @@ void *hsr_get_next_node(struct hsr_priv *hsr, void *_pos, | |||
431 | node = list_first_or_null_rcu(&hsr->node_db, | 431 | node = list_first_or_null_rcu(&hsr->node_db, |
432 | struct hsr_node, mac_list); | 432 | struct hsr_node, mac_list); |
433 | if (node) | 433 | if (node) |
434 | ether_addr_copy(addr, node->MacAddressA); | 434 | ether_addr_copy(addr, node->macaddress_A); |
435 | return node; | 435 | return node; |
436 | } | 436 | } |
437 | 437 | ||
438 | node = _pos; | 438 | node = _pos; |
439 | list_for_each_entry_continue_rcu(node, &hsr->node_db, mac_list) { | 439 | list_for_each_entry_continue_rcu(node, &hsr->node_db, mac_list) { |
440 | ether_addr_copy(addr, node->MacAddressA); | 440 | ether_addr_copy(addr, node->macaddress_A); |
441 | return node; | 441 | return node; |
442 | } | 442 | } |
443 | 443 | ||
@@ -458,13 +458,13 @@ int hsr_get_node_data(struct hsr_priv *hsr, | |||
458 | unsigned long tdiff; | 458 | unsigned long tdiff; |
459 | 459 | ||
460 | rcu_read_lock(); | 460 | rcu_read_lock(); |
461 | node = find_node_by_AddrA(&hsr->node_db, addr); | 461 | node = find_node_by_addr_A(&hsr->node_db, addr); |
462 | if (!node) { | 462 | if (!node) { |
463 | rcu_read_unlock(); | 463 | rcu_read_unlock(); |
464 | return -ENOENT; /* No such entry */ | 464 | return -ENOENT; /* No such entry */ |
465 | } | 465 | } |
466 | 466 | ||
467 | ether_addr_copy(addr_b, node->MacAddressB); | 467 | ether_addr_copy(addr_b, node->macaddress_B); |
468 | 468 | ||
469 | tdiff = jiffies - node->time_in[HSR_PT_SLAVE_A]; | 469 | tdiff = jiffies - node->time_in[HSR_PT_SLAVE_A]; |
470 | if (node->time_in_stale[HSR_PT_SLAVE_A]) | 470 | if (node->time_in_stale[HSR_PT_SLAVE_A]) |
@@ -490,8 +490,8 @@ int hsr_get_node_data(struct hsr_priv *hsr, | |||
490 | *if1_seq = node->seq_out[HSR_PT_SLAVE_B]; | 490 | *if1_seq = node->seq_out[HSR_PT_SLAVE_B]; |
491 | *if2_seq = node->seq_out[HSR_PT_SLAVE_A]; | 491 | *if2_seq = node->seq_out[HSR_PT_SLAVE_A]; |
492 | 492 | ||
493 | if (node->AddrB_port != HSR_PT_NONE) { | 493 | if (node->addr_B_port != HSR_PT_NONE) { |
494 | port = hsr_port_get_hsr(hsr, node->AddrB_port); | 494 | port = hsr_port_get_hsr(hsr, node->addr_B_port); |
495 | *addr_b_ifindex = port->dev->ifindex; | 495 | *addr_b_ifindex = port->dev->ifindex; |
496 | } else { | 496 | } else { |
497 | *addr_b_ifindex = -1; | 497 | *addr_b_ifindex = -1; |
diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 5d28a5371765..d312e8c777ae 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h | |||
@@ -97,14 +97,14 @@ struct hsr_ethhdr { | |||
97 | * Field names as defined in the IEC:2010 standard for HSR. | 97 | * Field names as defined in the IEC:2010 standard for HSR. |
98 | */ | 98 | */ |
99 | struct hsr_sup_tag { | 99 | struct hsr_sup_tag { |
100 | __be16 path_and_HSR_Ver; | 100 | __be16 path_and_HSR_ver; |
101 | __be16 sequence_nr; | 101 | __be16 sequence_nr; |
102 | __u8 HSR_TLV_Type; | 102 | __u8 HSR_TLV_type; |
103 | __u8 HSR_TLV_Length; | 103 | __u8 HSR_TLV_length; |
104 | } __packed; | 104 | } __packed; |
105 | 105 | ||
106 | struct hsr_sup_payload { | 106 | struct hsr_sup_payload { |
107 | unsigned char MacAddressA[ETH_ALEN]; | 107 | unsigned char macaddress_A[ETH_ALEN]; |
108 | } __packed; | 108 | } __packed; |
109 | 109 | ||
110 | static inline u16 get_hsr_stag_path(struct hsr_sup_tag *hst) | 110 | static inline u16 get_hsr_stag_path(struct hsr_sup_tag *hst) |
@@ -122,9 +122,9 @@ static inline void set_hsr_stag_path(struct hsr_sup_tag *hst, u16 path) | |||
122 | set_hsr_tag_path((struct hsr_tag *)hst, path); | 122 | set_hsr_tag_path((struct hsr_tag *)hst, path); |
123 | } | 123 | } |
124 | 124 | ||
125 | static inline void set_hsr_stag_HSR_Ver(struct hsr_sup_tag *hst, u16 HSR_Ver) | 125 | static inline void set_hsr_stag_HSR_ver(struct hsr_sup_tag *hst, u16 HSR_ver) |
126 | { | 126 | { |
127 | set_hsr_tag_LSDU_size((struct hsr_tag *)hst, HSR_Ver); | 127 | set_hsr_tag_LSDU_size((struct hsr_tag *)hst, HSR_ver); |
128 | } | 128 | } |
129 | 129 | ||
130 | struct hsrv0_ethhdr_sp { | 130 | struct hsrv0_ethhdr_sp { |
@@ -164,7 +164,7 @@ struct hsr_priv { | |||
164 | int announce_count; | 164 | int announce_count; |
165 | u16 sequence_nr; | 165 | u16 sequence_nr; |
166 | u16 sup_sequence_nr; /* For HSRv1 separate seq_nr for supervision */ | 166 | u16 sup_sequence_nr; /* For HSRv1 separate seq_nr for supervision */ |
167 | u8 protVersion; /* Indicate if HSRv0 or HSRv1. */ | 167 | u8 prot_version; /* Indicate if HSRv0 or HSRv1. */ |
168 | spinlock_t seqnr_lock; /* locking for sequence_nr */ | 168 | spinlock_t seqnr_lock; /* locking for sequence_nr */ |
169 | unsigned char sup_multicast_addr[ETH_ALEN]; | 169 | unsigned char sup_multicast_addr[ETH_ALEN]; |
170 | }; | 170 | }; |