-static DEVICE_ATTR(long_doze_mode, S_IRUGO | S_IWUSR,
- wl1251_show_long_doze, wl1251_set_long_doze);
+
+static ssize_t
+wl1251_show_ps_rate_thr(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct wl1251 *wl = dev_get_drvdata(dev);
+ return sprintf(buf, "%u\n", wl->ps_rate_threshold);
+}
+
+static ssize_t
+wl1251_set_ps_rate_thr(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct wl1251 *wl = dev_get_drvdata(dev);
+ unsigned int val;
+ int ret;
+
+ ret = kstrtouint(buf, 10, &val);
+ if (ret < 0)
+ return ret;
+
+ wl->ps_rate_threshold = val;
+ return count;
+}
+
+static struct device_attribute wl1251_attrs[] = {
+ __ATTR(long_doze_mode, S_IRUGO | S_IWUGO,
+ wl1251_show_long_doze, wl1251_set_long_doze),
+ __ATTR(ps_rate_threshold, S_IRUGO | S_IWUGO,
+ wl1251_show_ps_rate_thr, wl1251_set_ps_rate_thr),
+};