aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/debugfs.c13
-rw-r--r--net/batman-adv/distributed-arp-table.c1
-rw-r--r--net/batman-adv/main.h2
-rw-r--r--net/batman-adv/network-coding.c1
-rw-r--r--net/batman-adv/soft-interface.c2
-rw-r--r--net/batman-adv/sysfs.c14
6 files changed, 27 insertions, 6 deletions
diff --git a/net/batman-adv/debugfs.c b/net/batman-adv/debugfs.c
index b758881be108..a12e25efaf6f 100644
--- a/net/batman-adv/debugfs.c
+++ b/net/batman-adv/debugfs.c
@@ -245,6 +245,7 @@ static int batadv_algorithms_open(struct inode *inode, struct file *file)
245static int batadv_originators_open(struct inode *inode, struct file *file) 245static int batadv_originators_open(struct inode *inode, struct file *file)
246{ 246{
247 struct net_device *net_dev = (struct net_device *)inode->i_private; 247 struct net_device *net_dev = (struct net_device *)inode->i_private;
248
248 return single_open(file, batadv_orig_seq_print_text, net_dev); 249 return single_open(file, batadv_orig_seq_print_text, net_dev);
249} 250}
250 251
@@ -258,18 +259,21 @@ static int batadv_originators_hardif_open(struct inode *inode,
258 struct file *file) 259 struct file *file)
259{ 260{
260 struct net_device *net_dev = (struct net_device *)inode->i_private; 261 struct net_device *net_dev = (struct net_device *)inode->i_private;
262
261 return single_open(file, batadv_orig_hardif_seq_print_text, net_dev); 263 return single_open(file, batadv_orig_hardif_seq_print_text, net_dev);
262} 264}
263 265
264static int batadv_gateways_open(struct inode *inode, struct file *file) 266static int batadv_gateways_open(struct inode *inode, struct file *file)
265{ 267{
266 struct net_device *net_dev = (struct net_device *)inode->i_private; 268 struct net_device *net_dev = (struct net_device *)inode->i_private;
269
267 return single_open(file, batadv_gw_client_seq_print_text, net_dev); 270 return single_open(file, batadv_gw_client_seq_print_text, net_dev);
268} 271}
269 272
270static int batadv_transtable_global_open(struct inode *inode, struct file *file) 273static int batadv_transtable_global_open(struct inode *inode, struct file *file)
271{ 274{
272 struct net_device *net_dev = (struct net_device *)inode->i_private; 275 struct net_device *net_dev = (struct net_device *)inode->i_private;
276
273 return single_open(file, batadv_tt_global_seq_print_text, net_dev); 277 return single_open(file, batadv_tt_global_seq_print_text, net_dev);
274} 278}
275 279
@@ -277,6 +281,7 @@ static int batadv_transtable_global_open(struct inode *inode, struct file *file)
277static int batadv_bla_claim_table_open(struct inode *inode, struct file *file) 281static int batadv_bla_claim_table_open(struct inode *inode, struct file *file)
278{ 282{
279 struct net_device *net_dev = (struct net_device *)inode->i_private; 283 struct net_device *net_dev = (struct net_device *)inode->i_private;
284
280 return single_open(file, batadv_bla_claim_table_seq_print_text, 285 return single_open(file, batadv_bla_claim_table_seq_print_text,
281 net_dev); 286 net_dev);
282} 287}
@@ -285,6 +290,7 @@ static int batadv_bla_backbone_table_open(struct inode *inode,
285 struct file *file) 290 struct file *file)
286{ 291{
287 struct net_device *net_dev = (struct net_device *)inode->i_private; 292 struct net_device *net_dev = (struct net_device *)inode->i_private;
293
288 return single_open(file, batadv_bla_backbone_table_seq_print_text, 294 return single_open(file, batadv_bla_backbone_table_seq_print_text,
289 net_dev); 295 net_dev);
290} 296}
@@ -300,6 +306,7 @@ static int batadv_bla_backbone_table_open(struct inode *inode,
300static int batadv_dat_cache_open(struct inode *inode, struct file *file) 306static int batadv_dat_cache_open(struct inode *inode, struct file *file)
301{ 307{
302 struct net_device *net_dev = (struct net_device *)inode->i_private; 308 struct net_device *net_dev = (struct net_device *)inode->i_private;
309
303 return single_open(file, batadv_dat_cache_seq_print_text, net_dev); 310 return single_open(file, batadv_dat_cache_seq_print_text, net_dev);
304} 311}
305#endif 312#endif
@@ -307,6 +314,7 @@ static int batadv_dat_cache_open(struct inode *inode, struct file *file)
307static int batadv_transtable_local_open(struct inode *inode, struct file *file) 314static int batadv_transtable_local_open(struct inode *inode, struct file *file)
308{ 315{
309 struct net_device *net_dev = (struct net_device *)inode->i_private; 316 struct net_device *net_dev = (struct net_device *)inode->i_private;
317
310 return single_open(file, batadv_tt_local_seq_print_text, net_dev); 318 return single_open(file, batadv_tt_local_seq_print_text, net_dev);
311} 319}
312 320
@@ -319,6 +327,7 @@ struct batadv_debuginfo {
319static int batadv_nc_nodes_open(struct inode *inode, struct file *file) 327static int batadv_nc_nodes_open(struct inode *inode, struct file *file)
320{ 328{
321 struct net_device *net_dev = (struct net_device *)inode->i_private; 329 struct net_device *net_dev = (struct net_device *)inode->i_private;
330
322 return single_open(file, batadv_nc_nodes_seq_print_text, net_dev); 331 return single_open(file, batadv_nc_nodes_seq_print_text, net_dev);
323} 332}
324#endif 333#endif
@@ -333,7 +342,7 @@ struct batadv_debuginfo batadv_debuginfo_##_name = { \
333 .llseek = seq_lseek, \ 342 .llseek = seq_lseek, \
334 .release = single_release, \ 343 .release = single_release, \
335 } \ 344 } \
336}; 345}
337 346
338/* the following attributes are general and therefore they will be directly 347/* the following attributes are general and therefore they will be directly
339 * placed in the BATADV_DEBUGFS_SUBDIR subdirectory of debugfs 348 * placed in the BATADV_DEBUGFS_SUBDIR subdirectory of debugfs
@@ -395,7 +404,7 @@ struct batadv_debuginfo batadv_hardif_debuginfo_##_name = { \
395 .llseek = seq_lseek, \ 404 .llseek = seq_lseek, \
396 .release = single_release, \ 405 .release = single_release, \
397 }, \ 406 }, \
398}; 407}
399static BATADV_HARDIF_DEBUGINFO(originators, S_IRUGO, 408static BATADV_HARDIF_DEBUGINFO(originators, S_IRUGO,
400 batadv_originators_hardif_open); 409 batadv_originators_hardif_open);
401 410
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index aa5d4946d0d7..dcd99b2bea3c 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -662,6 +662,7 @@ static void batadv_dat_tvlv_container_update(struct batadv_priv *bat_priv)
662void batadv_dat_status_update(struct net_device *net_dev) 662void batadv_dat_status_update(struct net_device *net_dev)
663{ 663{
664 struct batadv_priv *bat_priv = netdev_priv(net_dev); 664 struct batadv_priv *bat_priv = netdev_priv(net_dev);
665
665 batadv_dat_tvlv_container_update(bat_priv); 666 batadv_dat_tvlv_container_update(bat_priv);
666} 667}
667 668
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 770dc890ceef..118b990bae25 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -24,7 +24,7 @@
24#define BATADV_DRIVER_DEVICE "batman-adv" 24#define BATADV_DRIVER_DEVICE "batman-adv"
25 25
26#ifndef BATADV_SOURCE_VERSION 26#ifndef BATADV_SOURCE_VERSION
27#define BATADV_SOURCE_VERSION "2014.2.0" 27#define BATADV_SOURCE_VERSION "2014.3.0"
28#endif 28#endif
29 29
30/* B.A.T.M.A.N. parameters */ 30/* B.A.T.M.A.N. parameters */
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c
index a9546fe541eb..40a2fc4bcf4c 100644
--- a/net/batman-adv/network-coding.c
+++ b/net/batman-adv/network-coding.c
@@ -86,6 +86,7 @@ static void batadv_nc_tvlv_container_update(struct batadv_priv *bat_priv)
86void batadv_nc_status_update(struct net_device *net_dev) 86void batadv_nc_status_update(struct net_device *net_dev)
87{ 87{
88 struct batadv_priv *bat_priv = netdev_priv(net_dev); 88 struct batadv_priv *bat_priv = netdev_priv(net_dev);
89
89 batadv_nc_tvlv_container_update(bat_priv); 90 batadv_nc_tvlv_container_update(bat_priv);
90} 91}
91 92
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 744a59b85e15..e7ee65dc20bf 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -884,7 +884,7 @@ static void batadv_softif_init_early(struct net_device *dev)
884 /* generate random address */ 884 /* generate random address */
885 eth_hw_addr_random(dev); 885 eth_hw_addr_random(dev);
886 886
887 SET_ETHTOOL_OPS(dev, &batadv_ethtool_ops); 887 dev->ethtool_ops = &batadv_ethtool_ops;
888 888
889 memset(priv, 0, sizeof(*priv)); 889 memset(priv, 0, sizeof(*priv));
890} 890}
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c
index 1ebb0d9e2ea5..fc47baa888c5 100644
--- a/net/batman-adv/sysfs.c
+++ b/net/batman-adv/sysfs.c
@@ -29,12 +29,14 @@
29static struct net_device *batadv_kobj_to_netdev(struct kobject *obj) 29static struct net_device *batadv_kobj_to_netdev(struct kobject *obj)
30{ 30{
31 struct device *dev = container_of(obj->parent, struct device, kobj); 31 struct device *dev = container_of(obj->parent, struct device, kobj);
32
32 return to_net_dev(dev); 33 return to_net_dev(dev);
33} 34}
34 35
35static struct batadv_priv *batadv_kobj_to_batpriv(struct kobject *obj) 36static struct batadv_priv *batadv_kobj_to_batpriv(struct kobject *obj)
36{ 37{
37 struct net_device *net_dev = batadv_kobj_to_netdev(obj); 38 struct net_device *net_dev = batadv_kobj_to_netdev(obj);
39
38 return netdev_priv(net_dev); 40 return netdev_priv(net_dev);
39} 41}
40 42
@@ -106,7 +108,7 @@ struct batadv_attribute batadv_attr_vlan_##_name = { \
106 .mode = _mode }, \ 108 .mode = _mode }, \
107 .show = _show, \ 109 .show = _show, \
108 .store = _store, \ 110 .store = _store, \
109}; 111}
110 112
111/* Use this, if you have customized show and store functions */ 113/* Use this, if you have customized show and store functions */
112#define BATADV_ATTR(_name, _mode, _show, _store) \ 114#define BATADV_ATTR(_name, _mode, _show, _store) \
@@ -115,7 +117,7 @@ struct batadv_attribute batadv_attr_##_name = { \
115 .mode = _mode }, \ 117 .mode = _mode }, \
116 .show = _show, \ 118 .show = _show, \
117 .store = _store, \ 119 .store = _store, \
118}; 120}
119 121
120#define BATADV_ATTR_SIF_STORE_BOOL(_name, _post_func) \ 122#define BATADV_ATTR_SIF_STORE_BOOL(_name, _post_func) \
121ssize_t batadv_store_##_name(struct kobject *kobj, \ 123ssize_t batadv_store_##_name(struct kobject *kobj, \
@@ -124,6 +126,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \
124{ \ 126{ \
125 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ 127 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
126 struct batadv_priv *bat_priv = netdev_priv(net_dev); \ 128 struct batadv_priv *bat_priv = netdev_priv(net_dev); \
129 \
127 return __batadv_store_bool_attr(buff, count, _post_func, attr, \ 130 return __batadv_store_bool_attr(buff, count, _post_func, attr, \
128 &bat_priv->_name, net_dev); \ 131 &bat_priv->_name, net_dev); \
129} 132}
@@ -133,6 +136,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \
133 struct attribute *attr, char *buff) \ 136 struct attribute *attr, char *buff) \
134{ \ 137{ \
135 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ 138 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \
139 \
136 return sprintf(buff, "%s\n", \ 140 return sprintf(buff, "%s\n", \
137 atomic_read(&bat_priv->_name) == 0 ? \ 141 atomic_read(&bat_priv->_name) == 0 ? \
138 "disabled" : "enabled"); \ 142 "disabled" : "enabled"); \
@@ -155,6 +159,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \
155{ \ 159{ \
156 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ 160 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
157 struct batadv_priv *bat_priv = netdev_priv(net_dev); \ 161 struct batadv_priv *bat_priv = netdev_priv(net_dev); \
162 \
158 return __batadv_store_uint_attr(buff, count, _min, _max, \ 163 return __batadv_store_uint_attr(buff, count, _min, _max, \
159 _post_func, attr, \ 164 _post_func, attr, \
160 &bat_priv->_name, net_dev); \ 165 &bat_priv->_name, net_dev); \
@@ -165,6 +170,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \
165 struct attribute *attr, char *buff) \ 170 struct attribute *attr, char *buff) \
166{ \ 171{ \
167 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ 172 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \
173 \
168 return sprintf(buff, "%i\n", atomic_read(&bat_priv->_name)); \ 174 return sprintf(buff, "%i\n", atomic_read(&bat_priv->_name)); \
169} \ 175} \
170 176
@@ -188,6 +194,7 @@ ssize_t batadv_store_vlan_##_name(struct kobject *kobj, \
188 size_t res = __batadv_store_bool_attr(buff, count, _post_func, \ 194 size_t res = __batadv_store_bool_attr(buff, count, _post_func, \
189 attr, &vlan->_name, \ 195 attr, &vlan->_name, \
190 bat_priv->soft_iface); \ 196 bat_priv->soft_iface); \
197 \
191 batadv_softif_vlan_free_ref(vlan); \ 198 batadv_softif_vlan_free_ref(vlan); \
192 return res; \ 199 return res; \
193} 200}
@@ -202,6 +209,7 @@ ssize_t batadv_show_vlan_##_name(struct kobject *kobj, \
202 size_t res = sprintf(buff, "%s\n", \ 209 size_t res = sprintf(buff, "%s\n", \
203 atomic_read(&vlan->_name) == 0 ? \ 210 atomic_read(&vlan->_name) == 0 ? \
204 "disabled" : "enabled"); \ 211 "disabled" : "enabled"); \
212 \
205 batadv_softif_vlan_free_ref(vlan); \ 213 batadv_softif_vlan_free_ref(vlan); \
206 return res; \ 214 return res; \
207} 215}
@@ -324,12 +332,14 @@ static ssize_t batadv_show_bat_algo(struct kobject *kobj,
324 struct attribute *attr, char *buff) 332 struct attribute *attr, char *buff)
325{ 333{
326 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 334 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj);
335
327 return sprintf(buff, "%s\n", bat_priv->bat_algo_ops->name); 336 return sprintf(buff, "%s\n", bat_priv->bat_algo_ops->name);
328} 337}
329 338
330static void batadv_post_gw_reselect(struct net_device *net_dev) 339static void batadv_post_gw_reselect(struct net_device *net_dev)
331{ 340{
332 struct batadv_priv *bat_priv = netdev_priv(net_dev); 341 struct batadv_priv *bat_priv = netdev_priv(net_dev);
342
333 batadv_gw_reselect(bat_priv); 343 batadv_gw_reselect(bat_priv);
334} 344}
335 345