static ssize_t rx_streaming_always_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct wl1271 *wl = file->private_data; unsigned long value; int ret; ret = kstrtoul_from_user(user_buf, count, 10, &value); if (ret < 0) { wl1271_warning("illegal value in rx_streaming_write!"); return -EINVAL; } /* valid values: 0, 10-100 */ if (!(value == 0 || value == 1)) { wl1271_warning("value is not in valid!"); return -EINVAL; } mutex_lock(&wl->mutex); wl->conf.rx_streaming.always = value; ret = wl1271_ps_elp_wakeup(wl); if (ret < 0) goto out; wl1271_recalc_rx_streaming(wl); wl1271_ps_elp_sleep(wl); out: mutex_unlock(&wl->mutex); return count; }
static void wl12xx_event_soft_gemini_sense(struct wl1271 *wl, u8 enable) { if (enable) { /* disable dynamic PS when the firmware senses BT*/ ieee80211_disable_dyn_ps(wl->vif); set_bit(WL1271_FLAG_SOFT_GEMINI, &wl->flags); } else { ieee80211_enable_dyn_ps(wl->vif); clear_bit(WL1271_FLAG_SOFT_GEMINI, &wl->flags); wl1271_recalc_rx_streaming(wl); } }
static ssize_t rx_streaming_always_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct wl1271 *wl = file->private_data; char buf[10]; size_t len; unsigned long value; int ret; len = min(count, sizeof(buf) - 1); if (copy_from_user(buf, user_buf, len)) return -EFAULT; buf[len] = '\0'; ret = strict_strtoul(buf, 0, &value); if (ret < 0) { wl1271_warning("illegal value in rx_streaming_write!"); return -EINVAL; } /* valid values: 0, 10-100 */ if (!(value == 0 || value == 1)) { wl1271_warning("value is not in valid!"); return -EINVAL; } mutex_lock(&wl->mutex); wl->conf.rx_streaming.always = value; ret = wl1271_ps_elp_wakeup(wl); if (ret < 0) goto out; wl1271_recalc_rx_streaming(wl); wl1271_ps_elp_sleep(wl); out: mutex_unlock(&wl->mutex); return count; }