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 <linux/device.h>
#include <linux/pci.h>
#include "ath5k.h"
#include "reg.h"

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define SIMPLE_SHOW_STORE(name, get, set)
 
#define SIMPLE_SHOW(name, get)
 

Functions

 SIMPLE_SHOW_STORE (ani_mode, ah->ani_state.ani_mode, ath5k_ani_init)
 
 SIMPLE_SHOW_STORE (noise_immunity_level, ah->ani_state.noise_imm_level, ath5k_ani_set_noise_immunity_level)
 
 SIMPLE_SHOW_STORE (spur_level, ah->ani_state.spur_level, ath5k_ani_set_spur_immunity_level)
 
 SIMPLE_SHOW_STORE (firstep_level, ah->ani_state.firstep_level, ath5k_ani_set_firstep_level)
 
 SIMPLE_SHOW_STORE (ofdm_weak_signal_detection, ah->ani_state.ofdm_weak_sig, ath5k_ani_set_ofdm_weak_signal_detection)
 
 SIMPLE_SHOW_STORE (cck_weak_signal_detection, ah->ani_state.cck_weak_sig, ath5k_ani_set_cck_weak_signal_detection)
 
 SIMPLE_SHOW (spur_level_max, ah->ani_state.max_spur_level)
 
int ath5k_sysfs_register (struct ath5k_hw *ah)
 
void ath5k_sysfs_unregister (struct ath5k_hw *ah)
 

Macro Definition Documentation

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 1 of file sysfs.c.

#define SIMPLE_SHOW (   name,
  get 
)
Value:
static ssize_t ath5k_attr_show_##name(struct device *dev, \
char *buf) \
{ \
struct ath5k_hw *ah = hw->priv; \
return snprintf(buf, PAGE_SIZE, "%d\n", get); \
} \
static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL)

Definition at line 36 of file sysfs.c.

#define SIMPLE_SHOW_STORE (   name,
  get,
  set 
)
Value:
static ssize_t ath5k_attr_show_##name(struct device *dev, \
char *buf) \
{ \
struct ath5k_hw *ah = hw->priv; \
return snprintf(buf, PAGE_SIZE, "%d\n", get); \
} \
\
static ssize_t ath5k_attr_store_##name(struct device *dev, \
const char *buf, size_t count) \
{ \
struct ath5k_hw *ah = hw->priv; \
int val, ret; \
\
ret = kstrtoint(buf, 10, &val); \
if (ret < 0) \
return ret; \
set(ah, val); \
return count; \
} \
ath5k_attr_show_##name, ath5k_attr_store_##name)

Definition at line 9 of file sysfs.c.

Function Documentation

int ath5k_sysfs_register ( struct ath5k_hw ah)

Definition at line 102 of file sysfs.c.

void ath5k_sysfs_unregister ( struct ath5k_hw ah)

Definition at line 117 of file sysfs.c.

SIMPLE_SHOW ( spur_level_max  ,
ah->ani_state.  max_spur_level 
)
SIMPLE_SHOW_STORE ( ani_mode  ,
ah->ani_state.  ani_mode,
ath5k_ani_init   
)
SIMPLE_SHOW_STORE ( noise_immunity_level  ,
ah->ani_state.  noise_imm_level,
ath5k_ani_set_noise_immunity_level   
)
SIMPLE_SHOW_STORE ( spur_level  ,
ah->ani_state.  spur_level,
ath5k_ani_set_spur_immunity_level   
)
SIMPLE_SHOW_STORE ( firstep_level  ,
ah->ani_state.  firstep_level,
ath5k_ani_set_firstep_level   
)
SIMPLE_SHOW_STORE ( ofdm_weak_signal_detection  ,
ah->ani_state.  ofdm_weak_sig,
ath5k_ani_set_ofdm_weak_signal_detection   
)
SIMPLE_SHOW_STORE ( cck_weak_signal_detection  ,
ah->ani_state.  cck_weak_sig,
ath5k_ani_set_cck_weak_signal_detection   
)