Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
sysfs.c File Reference
#include "main.h"
#include "sysfs.h"
#include "translation-table.h"
#include "originator.h"
#include "hard-interface.h"
#include "gateway_common.h"
#include "gateway_client.h"
#include "vis.h"

Go to the source code of this file.

Macros

#define BATADV_UEV_TYPE_VAR   "BATTYPE="
 
#define BATADV_UEV_ACTION_VAR   "BATACTION="
 
#define BATADV_UEV_DATA_VAR   "BATDATA="
 
#define BATADV_ATTR(_name, _mode, _show, _store)
 
#define BATADV_ATTR_SIF_STORE_BOOL(_name, _post_func)
 
#define BATADV_ATTR_SIF_SHOW_BOOL(_name)
 
#define BATADV_ATTR_SIF_BOOL(_name, _mode, _post_func)
 
#define BATADV_ATTR_SIF_STORE_UINT(_name, _min, _max, _post_func)
 
#define BATADV_ATTR_SIF_SHOW_UINT(_name)
 
#define BATADV_ATTR_SIF_UINT(_name, _mode, _min, _max, _post_func)
 
#define BATADV_ATTR_HIF_STORE_UINT(_name, _min, _max, _post_func)
 
#define BATADV_ATTR_HIF_SHOW_UINT(_name)
 
#define BATADV_ATTR_HIF_UINT(_name, _mode, _min, _max, _post_func)
 

Functions

 BATADV_ATTR_SIF_BOOL (aggregated_ogms, S_IRUGO|S_IWUSR, NULL)
 
 BATADV_ATTR_SIF_BOOL (bonding, S_IRUGO|S_IWUSR, NULL)
 
 BATADV_ATTR_SIF_BOOL (fragmentation, S_IRUGO|S_IWUSR, batadv_update_min_mtu)
 
 BATADV_ATTR_SIF_BOOL (ap_isolation, S_IRUGO|S_IWUSR, NULL)
 
 BATADV_ATTR_SIF_UINT (orig_interval, S_IRUGO|S_IWUSR, 2 *BATADV_JITTER, INT_MAX, NULL)
 
 BATADV_ATTR_SIF_UINT (hop_penalty, S_IRUGO|S_IWUSR, 0, BATADV_TQ_MAX_VALUE, NULL)
 
 BATADV_ATTR_SIF_UINT (gw_sel_class, S_IRUGO|S_IWUSR, 1, BATADV_TQ_MAX_VALUE, batadv_post_gw_deselect)
 
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)
 
int batadv_throw_uevent (struct batadv_priv *bat_priv, enum batadv_uev_type type, enum batadv_uev_action action, const char *data)
 

Macro Definition Documentation

#define BATADV_ATTR (   _name,
  _mode,
  _show,
  _store 
)
Value:
struct batadv_attribute batadv_attr_##_name = { \
.attr = {.name = __stringify(_name), \
.mode = _mode }, \
.show = _show, \
.store = _store, \
};

Definition at line 56 of file sysfs.c.

#define BATADV_ATTR_HIF_SHOW_UINT (   _name)
Value:
ssize_t batadv_show_##_name(struct kobject *kobj, \
struct attribute *attr, char *buff) \
{ \
struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
\
hard_iface = batadv_hardif_get_by_netdev(net_dev); \
if (!hard_iface) \
return 0; \
\
length = sprintf(buff, "%i\n", atomic_read(&hard_iface->_name));\
\
batadv_hardif_free_ref(hard_iface); \
return length; \
}

Definition at line 146 of file sysfs.c.

#define BATADV_ATTR_HIF_STORE_UINT (   _name,
  _min,
  _max,
  _post_func 
)
Value:
ssize_t batadv_store_##_name(struct kobject *kobj, \
struct attribute *attr, char *buff, \
size_t count) \
{ \
struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
\
hard_iface = batadv_hardif_get_by_netdev(net_dev); \
if (!hard_iface) \
return 0; \
\
length = __batadv_store_uint_attr(buff, count, _min, _max, \
_post_func, attr, \
&hard_iface->_name, net_dev); \
\
batadv_hardif_free_ref(hard_iface); \
return length; \
}

Definition at line 125 of file sysfs.c.

#define BATADV_ATTR_HIF_UINT (   _name,
  _mode,
  _min,
  _max,
  _post_func 
)
Value:
static BATADV_ATTR_HIF_STORE_UINT(_name, _min, _max, _post_func)\
static BATADV_ATTR_HIF_SHOW_UINT(_name) \
static BATADV_ATTR(_name, _mode, batadv_show_##_name, \
batadv_store_##_name)

Definition at line 167 of file sysfs.c.

#define BATADV_ATTR_SIF_BOOL (   _name,
  _mode,
  _post_func 
)
Value:
static BATADV_ATTR_SIF_STORE_BOOL(_name, _post_func) \
static BATADV_ATTR_SIF_SHOW_BOOL(_name) \
static BATADV_ATTR(_name, _mode, batadv_show_##_name, \
batadv_store_##_name)

Definition at line 88 of file sysfs.c.

#define BATADV_ATTR_SIF_SHOW_BOOL (   _name)
Value:
ssize_t batadv_show_##_name(struct kobject *kobj, \
struct attribute *attr, char *buff) \
{ \
struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \
return sprintf(buff, "%s\n", \
atomic_read(&bat_priv->_name) == 0 ? \
"disabled" : "enabled"); \
} \

Definition at line 75 of file sysfs.c.

#define BATADV_ATTR_SIF_SHOW_UINT (   _name)
Value:
ssize_t batadv_show_##_name(struct kobject *kobj, \
struct attribute *attr, char *buff) \
{ \
struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \
return sprintf(buff, "%i\n", atomic_read(&bat_priv->_name)); \
} \

Definition at line 107 of file sysfs.c.

#define BATADV_ATTR_SIF_STORE_BOOL (   _name,
  _post_func 
)
Value:
ssize_t batadv_store_##_name(struct kobject *kobj, \
struct attribute *attr, char *buff, \
size_t count) \
{ \
struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
struct batadv_priv *bat_priv = netdev_priv(net_dev); \
return __batadv_store_bool_attr(buff, count, _post_func, attr, \
&bat_priv->_name, net_dev); \
}

Definition at line 64 of file sysfs.c.

#define BATADV_ATTR_SIF_STORE_UINT (   _name,
  _min,
  _max,
  _post_func 
)
Value:
ssize_t batadv_store_##_name(struct kobject *kobj, \
struct attribute *attr, char *buff, \
size_t count) \
{ \
struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
struct batadv_priv *bat_priv = netdev_priv(net_dev); \
return __batadv_store_uint_attr(buff, count, _min, _max, \
_post_func, attr, \
&bat_priv->_name, net_dev); \
}

Definition at line 95 of file sysfs.c.

#define BATADV_ATTR_SIF_UINT (   _name,
  _mode,
  _min,
  _max,
  _post_func 
)
Value:
static BATADV_ATTR_SIF_STORE_UINT(_name, _min, _max, _post_func)\
static BATADV_ATTR_SIF_SHOW_UINT(_name) \
static BATADV_ATTR(_name, _mode, batadv_show_##_name, \
batadv_store_##_name)

Definition at line 118 of file sysfs.c.

#define BATADV_UEV_ACTION_VAR   "BATACTION="

Definition at line 42 of file sysfs.c.

#define BATADV_UEV_DATA_VAR   "BATDATA="

Definition at line 43 of file sysfs.c.

#define BATADV_UEV_TYPE_VAR   "BATTYPE="

Definition at line 41 of file sysfs.c.

Function Documentation

BATADV_ATTR_SIF_BOOL ( aggregated_ogms  ,
S_IRUGO S_IWUSR,
NULL   
)
BATADV_ATTR_SIF_BOOL ( bonding  ,
S_IRUGO S_IWUSR,
NULL   
)
BATADV_ATTR_SIF_BOOL ( fragmentation  ,
S_IRUGO S_IWUSR,
batadv_update_min_mtu   
)
BATADV_ATTR_SIF_BOOL ( ap_isolation  ,
S_IRUGO S_IWUSR,
NULL   
)
BATADV_ATTR_SIF_UINT ( orig_interval  ,
S_IRUGO S_IWUSR,
2 *  BATADV_JITTER,
INT_MAX  ,
NULL   
)
BATADV_ATTR_SIF_UINT ( hop_penalty  ,
S_IRUGO S_IWUSR,
,
BATADV_TQ_MAX_VALUE  ,
NULL   
)
BATADV_ATTR_SIF_UINT ( gw_sel_class  ,
S_IRUGO S_IWUSR,
,
BATADV_TQ_MAX_VALUE  ,
batadv_post_gw_deselect   
)
int batadv_sysfs_add_hardif ( struct kobject **  hardif_obj,
struct net_device dev 
)

Definition at line 689 of file sysfs.c.

int batadv_sysfs_add_meshif ( struct net_device dev)

Definition at line 512 of file sysfs.c.

void batadv_sysfs_del_hardif ( struct kobject **  hardif_obj)

Definition at line 723 of file sysfs.c.

void batadv_sysfs_del_meshif ( struct net_device dev)

Definition at line 550 of file sysfs.c.

int batadv_throw_uevent ( struct batadv_priv bat_priv,
enum batadv_uev_type  type,
enum batadv_uev_action  action,
const char data 
)

Definition at line 729 of file sysfs.c.