1 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
3 #include <linux/device.h>
9 #define SIMPLE_SHOW_STORE(name, get, set) \
10 static ssize_t ath5k_attr_show_##name(struct device *dev, \
11 struct device_attribute *attr, \
14 struct ieee80211_hw *hw = dev_get_drvdata(dev); \
15 struct ath5k_hw *ah = hw->priv; \
16 return snprintf(buf, PAGE_SIZE, "%d\n", get); \
19 static ssize_t ath5k_attr_store_##name(struct device *dev, \
20 struct device_attribute *attr, \
21 const char *buf, size_t count) \
23 struct ieee80211_hw *hw = dev_get_drvdata(dev); \
24 struct ath5k_hw *ah = hw->priv; \
27 ret = kstrtoint(buf, 10, &val); \
33 static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, \
34 ath5k_attr_show_##name, ath5k_attr_store_##name)
36 #define SIMPLE_SHOW(name, get) \
37 static ssize_t ath5k_attr_show_##name(struct device *dev, \
38 struct device_attribute *attr, \
41 struct ieee80211_hw *hw = dev_get_drvdata(dev); \
42 struct ath5k_hw *ah = hw->priv; \
43 return snprintf(buf, PAGE_SIZE, "%d\n", get); \
45 static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL)
69 ath5k_attr_show_noise_immunity_level_max,
NULL);
78 ath5k_attr_show_firstep_level_max,
NULL);
80 static struct attribute *ath5k_sysfs_entries_ani[] = {
81 &dev_attr_ani_mode.attr,
82 &dev_attr_noise_immunity_level.attr,
83 &dev_attr_spur_level.attr,
84 &dev_attr_firstep_level.attr,
85 &dev_attr_ofdm_weak_signal_detection.attr,
86 &dev_attr_cck_weak_signal_detection.attr,
87 &dev_attr_noise_immunity_level_max.attr,
88 &dev_attr_spur_level_max.attr,
89 &dev_attr_firstep_level_max.attr,
95 .attrs = ath5k_sysfs_entries_ani,
109 ATH5K_ERR(ah,
"failed to create sysfs group\n");