Blame view
net/batman-adv/sysfs.h
2.26 KB
7db7d9f36 batman-adv: Add S... |
1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
68e039f96 batman-adv: Updat... |
2 |
/* Copyright (C) 2010-2020 B.A.T.M.A.N. contributors: |
c6c8fea29 net: Add batman-a... |
3 4 |
* * Marek Lindner |
c6c8fea29 net: Add batman-a... |
5 |
*/ |
c6c8fea29 net: Add batman-a... |
6 7 |
#ifndef _NET_BATMAN_ADV_SYSFS_H_ #define _NET_BATMAN_ADV_SYSFS_H_ |
1e2c2a4fe batman-adv: Add r... |
8 |
#include "main.h" |
68a600de9 batman-adv: Use i... |
9 10 |
#include <linux/kobject.h> #include <linux/netdevice.h> |
1e2c2a4fe batman-adv: Add r... |
11 12 |
#include <linux/sysfs.h> #include <linux/types.h> |
036cbfeb6 batman-adv: Prefi... |
13 14 |
#define BATADV_SYSFS_IF_MESH_SUBDIR "mesh" #define BATADV_SYSFS_IF_BAT_SUBDIR "batman_adv" |
90f4435da batman-adv: add s... |
15 16 17 18 19 20 |
/** * BATADV_SYSFS_VLAN_SUBDIR_PREFIX - prefix of the subfolder that will be * created in the sysfs hierarchy for each VLAN interface. The subfolder will * be named "BATADV_SYSFS_VLAN_SUBDIR_PREFIX%vid". */ #define BATADV_SYSFS_VLAN_SUBDIR_PREFIX "vlan" |
c6c8fea29 net: Add batman-a... |
21 |
|
c93effcf7 batman-adv: Add k... |
22 23 24 |
/** * struct batadv_attribute - sysfs export helper for batman-adv attributes */ |
b4d66b877 batman-adv: Prefi... |
25 |
struct batadv_attribute { |
c93effcf7 batman-adv: Add k... |
26 |
/** @attr: sysfs attribute file */ |
c6c8fea29 net: Add batman-a... |
27 |
struct attribute attr; |
c93effcf7 batman-adv: Add k... |
28 29 30 31 |
/** * @show: function to export the current attribute's content to sysfs */ |
c6c8fea29 net: Add batman-a... |
32 33 |
ssize_t (*show)(struct kobject *kobj, struct attribute *attr, char *buf); |
c93effcf7 batman-adv: Add k... |
34 35 36 37 38 |
/** * @store: function to load new value from character buffer and save it * in batman-adv attribute */ |
c6c8fea29 net: Add batman-a... |
39 40 41 |
ssize_t (*store)(struct kobject *kobj, struct attribute *attr, char *buf, size_t count); }; |
0fa4c30d7 batman-adv: Make ... |
42 |
#ifdef CONFIG_BATMAN_ADV_SYSFS |
5853e22c5 batman-adv: Prefi... |
43 44 45 46 47 |
int batadv_sysfs_add_meshif(struct net_device *dev); void batadv_sysfs_del_meshif(struct net_device *dev); int batadv_sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev); void batadv_sysfs_del_hardif(struct kobject **hardif_obj); |
90f4435da batman-adv: add s... |
48 49 50 51 |
int batadv_sysfs_add_vlan(struct net_device *dev, struct batadv_softif_vlan *vlan); void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv, struct batadv_softif_vlan *vlan); |
0fa4c30d7 batman-adv: Make ... |
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
#else static inline int batadv_sysfs_add_meshif(struct net_device *dev) { return 0; } static inline void batadv_sysfs_del_meshif(struct net_device *dev) { } static inline int batadv_sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev) { return 0; } static inline void batadv_sysfs_del_hardif(struct kobject **hardif_obj) { } static inline int batadv_sysfs_add_vlan(struct net_device *dev, struct batadv_softif_vlan *vlan) { return 0; } static inline void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv, struct batadv_softif_vlan *vlan) { } #endif |
c6c8fea29 net: Add batman-a... |
86 87 |
#endif /* _NET_BATMAN_ADV_SYSFS_H_ */ |