aboutsummaryrefslogtreecommitdiffstats
path: root/net/hsr/hsr_netlink.c
diff options
context:
space:
mode:
authorArvid Brodin <arvid.brodin@alten.se>2014-07-04 17:34:38 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-08 14:35:30 -0400
commit70ebe4a47185db15f3c55be9611a1a971237870b (patch)
tree53e0ba561d76df8ff281db8211f8e6d4792478cb /net/hsr/hsr_netlink.c
parentb8125404c242a6336eacaa54047b27cfd3fee68e (diff)
net/hsr: Better variable names and update of contact info.
Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr/hsr_netlink.c')
-rw-r--r--net/hsr/hsr_netlink.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c
index 01a5261ac7a5..bea250ec3586 100644
--- a/net/hsr/hsr_netlink.c
+++ b/net/hsr/hsr_netlink.c
@@ -1,4 +1,4 @@
1/* Copyright 2011-2013 Autronica Fire and Security AS 1/* Copyright 2011-2014 Autronica Fire and Security AS
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify it 3 * This program is free software; you can redistribute it and/or modify it
4 * under the terms of the GNU General Public License as published by the Free 4 * under the terms of the GNU General Public License as published by the Free
@@ -6,7 +6,7 @@
6 * any later version. 6 * any later version.
7 * 7 *
8 * Author(s): 8 * Author(s):
9 * 2011-2013 Arvid Brodin, arvid.brodin@xdin.com 9 * 2011-2014 Arvid Brodin, arvid.brodin@alten.se
10 * 10 *
11 * Routines for handling Netlink messages for HSR. 11 * Routines for handling Netlink messages for HSR.
12 */ 12 */
@@ -63,21 +63,21 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev,
63 63
64static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev) 64static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev)
65{ 65{
66 struct hsr_priv *hsr_priv; 66 struct hsr_priv *hsr;
67 67
68 hsr_priv = netdev_priv(dev); 68 hsr = netdev_priv(dev);
69 69
70 if (hsr_priv->slave[0]) 70 if (hsr->slave[0])
71 if (nla_put_u32(skb, IFLA_HSR_SLAVE1, hsr_priv->slave[0]->ifindex)) 71 if (nla_put_u32(skb, IFLA_HSR_SLAVE1, hsr->slave[0]->ifindex))
72 goto nla_put_failure; 72 goto nla_put_failure;
73 73
74 if (hsr_priv->slave[1]) 74 if (hsr->slave[1])
75 if (nla_put_u32(skb, IFLA_HSR_SLAVE2, hsr_priv->slave[1]->ifindex)) 75 if (nla_put_u32(skb, IFLA_HSR_SLAVE2, hsr->slave[1]->ifindex))
76 goto nla_put_failure; 76 goto nla_put_failure;
77 77
78 if (nla_put(skb, IFLA_HSR_SUPERVISION_ADDR, ETH_ALEN, 78 if (nla_put(skb, IFLA_HSR_SUPERVISION_ADDR, ETH_ALEN,
79 hsr_priv->sup_multicast_addr) || 79 hsr->sup_multicast_addr) ||
80 nla_put_u16(skb, IFLA_HSR_SEQ_NR, hsr_priv->sequence_nr)) 80 nla_put_u16(skb, IFLA_HSR_SEQ_NR, hsr->sequence_nr))
81 goto nla_put_failure; 81 goto nla_put_failure;
82 82
83 return 0; 83 return 0;
@@ -128,7 +128,7 @@ static const struct genl_multicast_group hsr_mcgrps[] = {
128 * over one of the slave interfaces. This would indicate an open network ring 128 * over one of the slave interfaces. This would indicate an open network ring
129 * (i.e. a link has failed somewhere). 129 * (i.e. a link has failed somewhere).
130 */ 130 */
131void hsr_nl_ringerror(struct hsr_priv *hsr_priv, unsigned char addr[ETH_ALEN], 131void hsr_nl_ringerror(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN],
132 enum hsr_dev_idx dev_idx) 132 enum hsr_dev_idx dev_idx)
133{ 133{
134 struct sk_buff *skb; 134 struct sk_buff *skb;
@@ -148,8 +148,8 @@ void hsr_nl_ringerror(struct hsr_priv *hsr_priv, unsigned char addr[ETH_ALEN],
148 if (res < 0) 148 if (res < 0)
149 goto nla_put_failure; 149 goto nla_put_failure;
150 150
151 if (hsr_priv->slave[dev_idx]) 151 if (hsr->slave[dev_idx])
152 ifindex = hsr_priv->slave[dev_idx]->ifindex; 152 ifindex = hsr->slave[dev_idx]->ifindex;
153 else 153 else
154 ifindex = -1; 154 ifindex = -1;
155 res = nla_put_u32(skb, HSR_A_IFINDEX, ifindex); 155 res = nla_put_u32(skb, HSR_A_IFINDEX, ifindex);
@@ -165,13 +165,13 @@ nla_put_failure:
165 kfree_skb(skb); 165 kfree_skb(skb);
166 166
167fail: 167fail:
168 netdev_warn(hsr_priv->dev, "Could not send HSR ring error message\n"); 168 netdev_warn(hsr->dev, "Could not send HSR ring error message\n");
169} 169}
170 170
171/* This is called when we haven't heard from the node with MAC address addr for 171/* This is called when we haven't heard from the node with MAC address addr for
172 * some time (just before the node is removed from the node table/list). 172 * some time (just before the node is removed from the node table/list).
173 */ 173 */
174void hsr_nl_nodedown(struct hsr_priv *hsr_priv, unsigned char addr[ETH_ALEN]) 174void hsr_nl_nodedown(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN])
175{ 175{
176 struct sk_buff *skb; 176 struct sk_buff *skb;
177 void *msg_head; 177 void *msg_head;
@@ -199,7 +199,7 @@ nla_put_failure:
199 kfree_skb(skb); 199 kfree_skb(skb);
200 200
201fail: 201fail:
202 netdev_warn(hsr_priv->dev, "Could not send HSR node down\n"); 202 netdev_warn(hsr->dev, "Could not send HSR node down\n");
203} 203}
204 204
205 205
@@ -220,7 +220,7 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
220 /* For sending */ 220 /* For sending */
221 struct sk_buff *skb_out; 221 struct sk_buff *skb_out;
222 void *msg_head; 222 void *msg_head;
223 struct hsr_priv *hsr_priv; 223 struct hsr_priv *hsr;
224 unsigned char hsr_node_addr_b[ETH_ALEN]; 224 unsigned char hsr_node_addr_b[ETH_ALEN];
225 int hsr_node_if1_age; 225 int hsr_node_if1_age;
226 u16 hsr_node_if1_seq; 226 u16 hsr_node_if1_seq;
@@ -267,8 +267,8 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
267 if (res < 0) 267 if (res < 0)
268 goto nla_put_failure; 268 goto nla_put_failure;
269 269
270 hsr_priv = netdev_priv(hsr_dev); 270 hsr = netdev_priv(hsr_dev);
271 res = hsr_get_node_data(hsr_priv, 271 res = hsr_get_node_data(hsr,
272 (unsigned char *) nla_data(info->attrs[HSR_A_NODE_ADDR]), 272 (unsigned char *) nla_data(info->attrs[HSR_A_NODE_ADDR]),
273 hsr_node_addr_b, 273 hsr_node_addr_b,
274 &addr_b_ifindex, 274 &addr_b_ifindex,
@@ -301,9 +301,9 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
301 res = nla_put_u16(skb_out, HSR_A_IF1_SEQ, hsr_node_if1_seq); 301 res = nla_put_u16(skb_out, HSR_A_IF1_SEQ, hsr_node_if1_seq);
302 if (res < 0) 302 if (res < 0)
303 goto nla_put_failure; 303 goto nla_put_failure;
304 if (hsr_priv->slave[0]) 304 if (hsr->slave[0])
305 res = nla_put_u32(skb_out, HSR_A_IF1_IFINDEX, 305 res = nla_put_u32(skb_out, HSR_A_IF1_IFINDEX,
306 hsr_priv->slave[0]->ifindex); 306 hsr->slave[0]->ifindex);
307 if (res < 0) 307 if (res < 0)
308 goto nla_put_failure; 308 goto nla_put_failure;
309 309
@@ -313,9 +313,9 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
313 res = nla_put_u16(skb_out, HSR_A_IF2_SEQ, hsr_node_if2_seq); 313 res = nla_put_u16(skb_out, HSR_A_IF2_SEQ, hsr_node_if2_seq);
314 if (res < 0) 314 if (res < 0)
315 goto nla_put_failure; 315 goto nla_put_failure;
316 if (hsr_priv->slave[1]) 316 if (hsr->slave[1])
317 res = nla_put_u32(skb_out, HSR_A_IF2_IFINDEX, 317 res = nla_put_u32(skb_out, HSR_A_IF2_IFINDEX,
318 hsr_priv->slave[1]->ifindex); 318 hsr->slave[1]->ifindex);
319 319
320 genlmsg_end(skb_out, msg_head); 320 genlmsg_end(skb_out, msg_head);
321 genlmsg_unicast(genl_info_net(info), skb_out, info->snd_portid); 321 genlmsg_unicast(genl_info_net(info), skb_out, info->snd_portid);
@@ -345,7 +345,7 @@ static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info)
345 /* For sending */ 345 /* For sending */
346 struct sk_buff *skb_out; 346 struct sk_buff *skb_out;
347 void *msg_head; 347 void *msg_head;
348 struct hsr_priv *hsr_priv; 348 struct hsr_priv *hsr;
349 void *pos; 349 void *pos;
350 unsigned char addr[ETH_ALEN]; 350 unsigned char addr[ETH_ALEN];
351 int res; 351 int res;
@@ -385,17 +385,17 @@ static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info)
385 if (res < 0) 385 if (res < 0)
386 goto nla_put_failure; 386 goto nla_put_failure;
387 387
388 hsr_priv = netdev_priv(hsr_dev); 388 hsr = netdev_priv(hsr_dev);
389 389
390 rcu_read_lock(); 390 rcu_read_lock();
391 pos = hsr_get_next_node(hsr_priv, NULL, addr); 391 pos = hsr_get_next_node(hsr, NULL, addr);
392 while (pos) { 392 while (pos) {
393 res = nla_put(skb_out, HSR_A_NODE_ADDR, ETH_ALEN, addr); 393 res = nla_put(skb_out, HSR_A_NODE_ADDR, ETH_ALEN, addr);
394 if (res < 0) { 394 if (res < 0) {
395 rcu_read_unlock(); 395 rcu_read_unlock();
396 goto nla_put_failure; 396 goto nla_put_failure;
397 } 397 }
398 pos = hsr_get_next_node(hsr_priv, pos, addr); 398 pos = hsr_get_next_node(hsr, pos, addr);
399 } 399 }
400 rcu_read_unlock(); 400 rcu_read_unlock();
401 401