Lines Matching refs:wl
59 void wl1271_debugfs_update_stats(struct wl1271 *wl) in wl1271_debugfs_update_stats() argument
63 mutex_lock(&wl->mutex); in wl1271_debugfs_update_stats()
65 if (unlikely(wl->state != WLCORE_STATE_ON)) in wl1271_debugfs_update_stats()
68 ret = wl1271_ps_elp_wakeup(wl); in wl1271_debugfs_update_stats()
72 if (!wl->plt && in wl1271_debugfs_update_stats()
73 time_after(jiffies, wl->stats.fw_stats_update + in wl1271_debugfs_update_stats()
75 wl1271_acx_statistics(wl, wl->stats.fw_stats); in wl1271_debugfs_update_stats()
76 wl->stats.fw_stats_update = jiffies; in wl1271_debugfs_update_stats()
79 wl1271_ps_elp_sleep(wl); in wl1271_debugfs_update_stats()
82 mutex_unlock(&wl->mutex); in wl1271_debugfs_update_stats()
86 DEBUGFS_READONLY_FILE(retry_count, "%u", wl->stats.retry_count);
88 wl->stats.excessive_retries);
93 struct wl1271 *wl = file->private_data; in tx_queue_len_read() local
98 queue_len = wl1271_tx_total_queue_count(wl); in tx_queue_len_read()
110 static void chip_op_handler(struct wl1271 *wl, unsigned long value, in chip_op_handler() argument
114 int (*chip_op) (struct wl1271 *wl); in chip_op_handler()
121 ret = wl1271_ps_elp_wakeup(wl); in chip_op_handler()
126 chip_op(wl); in chip_op_handler()
128 wl1271_ps_elp_sleep(wl); in chip_op_handler()
132 static inline void no_write_handler(struct wl1271 *wl, in no_write_handler() argument
145 struct wl1271 *wl = file->private_data; \
148 wl->conf.conf_sub_struct.param); \
155 struct wl1271 *wl = file->private_data; \
170 mutex_lock(&wl->mutex); \
171 wl->conf.conf_sub_struct.param = value; \
173 write_handler_locked(wl, value, write_handler_arg); \
175 mutex_unlock(&wl->mutex); \
196 struct wl1271 *wl = file->private_data; in gpio_power_read() local
197 bool state = test_bit(WL1271_FLAG_GPIO_POWER, &wl->flags); in gpio_power_read()
211 struct wl1271 *wl = file->private_data; in gpio_power_write() local
221 mutex_lock(&wl->mutex); in gpio_power_write()
224 wl1271_power_on(wl); in gpio_power_write()
226 wl1271_power_off(wl); in gpio_power_write()
228 mutex_unlock(&wl->mutex); in gpio_power_write()
243 struct wl1271 *wl = file->private_data; in start_recovery_write() local
245 mutex_lock(&wl->mutex); in start_recovery_write()
246 wl12xx_queue_recovery_work(wl); in start_recovery_write()
247 mutex_unlock(&wl->mutex); in start_recovery_write()
261 struct wl1271 *wl = file->private_data; in dynamic_ps_timeout_read() local
265 wl->conf.conn.dynamic_ps_timeout); in dynamic_ps_timeout_read()
272 struct wl1271 *wl = file->private_data; in dynamic_ps_timeout_write() local
288 mutex_lock(&wl->mutex); in dynamic_ps_timeout_write()
290 wl->conf.conn.dynamic_ps_timeout = value; in dynamic_ps_timeout_write()
292 if (unlikely(wl->state != WLCORE_STATE_ON)) in dynamic_ps_timeout_write()
295 ret = wl1271_ps_elp_wakeup(wl); in dynamic_ps_timeout_write()
303 wl12xx_for_each_wlvif_sta(wl, wlvif) { in dynamic_ps_timeout_write()
305 wl1271_ps_set_mode(wl, wlvif, STATION_AUTO_PS_MODE); in dynamic_ps_timeout_write()
308 wl1271_ps_elp_sleep(wl); in dynamic_ps_timeout_write()
311 mutex_unlock(&wl->mutex); in dynamic_ps_timeout_write()
325 struct wl1271 *wl = file->private_data; in forced_ps_read() local
329 wl->conf.conn.forced_ps); in forced_ps_read()
336 struct wl1271 *wl = file->private_data; in forced_ps_write() local
352 mutex_lock(&wl->mutex); in forced_ps_write()
354 if (wl->conf.conn.forced_ps == value) in forced_ps_write()
357 wl->conf.conn.forced_ps = value; in forced_ps_write()
359 if (unlikely(wl->state != WLCORE_STATE_ON)) in forced_ps_write()
362 ret = wl1271_ps_elp_wakeup(wl); in forced_ps_write()
372 wl12xx_for_each_wlvif_sta(wl, wlvif) { in forced_ps_write()
374 wl1271_ps_set_mode(wl, wlvif, ps_mode); in forced_ps_write()
377 wl1271_ps_elp_sleep(wl); in forced_ps_write()
380 mutex_unlock(&wl->mutex); in forced_ps_write()
394 struct wl1271 *wl = file->private_data; in split_scan_timeout_read() local
398 wl->conf.scan.split_scan_timeout / 1000); in split_scan_timeout_read()
405 struct wl1271 *wl = file->private_data; in split_scan_timeout_write() local
418 mutex_lock(&wl->mutex); in split_scan_timeout_write()
420 wl->conf.scan.split_scan_timeout = value * 1000; in split_scan_timeout_write()
422 mutex_unlock(&wl->mutex); in split_scan_timeout_write()
436 struct wl1271 *wl = file->private_data; in driver_state_read() local
448 mutex_lock(&wl->mutex); in driver_state_read()
452 #x " = " fmt "\n", wl->x)) in driver_state_read()
464 wl12xx_for_each_wlvif_sta(wl, wlvif) { in driver_state_read()
472 wl12xx_for_each_wlvif_ap(wl, wlvif) in driver_state_read()
519 mutex_unlock(&wl->mutex); in driver_state_read()
535 struct wl1271 *wl = file->private_data; in vifs_state_read() local
546 mutex_lock(&wl->mutex); in vifs_state_read()
568 wl12xx_for_each_wlvif(wl, wlvif) { in vifs_state_read()
629 mutex_unlock(&wl->mutex); in vifs_state_read()
645 struct wl1271 *wl = file->private_data; in dtim_interval_read() local
648 if (wl->conf.conn.wake_up_event == CONF_WAKE_UP_EVENT_DTIM || in dtim_interval_read()
649 wl->conf.conn.wake_up_event == CONF_WAKE_UP_EVENT_N_DTIM) in dtim_interval_read()
650 value = wl->conf.conn.listen_interval; in dtim_interval_read()
661 struct wl1271 *wl = file->private_data; in dtim_interval_write() local
676 mutex_lock(&wl->mutex); in dtim_interval_write()
678 wl->conf.conn.listen_interval = value; in dtim_interval_write()
681 wl->conf.conn.wake_up_event = CONF_WAKE_UP_EVENT_DTIM; in dtim_interval_write()
683 wl->conf.conn.wake_up_event = CONF_WAKE_UP_EVENT_N_DTIM; in dtim_interval_write()
689 mutex_unlock(&wl->mutex); in dtim_interval_write()
706 struct wl1271 *wl = file->private_data; in suspend_dtim_interval_read() local
709 if (wl->conf.conn.suspend_wake_up_event == CONF_WAKE_UP_EVENT_DTIM || in suspend_dtim_interval_read()
710 wl->conf.conn.suspend_wake_up_event == CONF_WAKE_UP_EVENT_N_DTIM) in suspend_dtim_interval_read()
711 value = wl->conf.conn.suspend_listen_interval; in suspend_dtim_interval_read()
722 struct wl1271 *wl = file->private_data; in suspend_dtim_interval_write() local
737 mutex_lock(&wl->mutex); in suspend_dtim_interval_write()
739 wl->conf.conn.suspend_listen_interval = value; in suspend_dtim_interval_write()
742 wl->conf.conn.suspend_wake_up_event = CONF_WAKE_UP_EVENT_DTIM; in suspend_dtim_interval_write()
744 wl->conf.conn.suspend_wake_up_event = CONF_WAKE_UP_EVENT_N_DTIM; in suspend_dtim_interval_write()
746 mutex_unlock(&wl->mutex); in suspend_dtim_interval_write()
761 struct wl1271 *wl = file->private_data; in beacon_interval_read() local
764 if (wl->conf.conn.wake_up_event == CONF_WAKE_UP_EVENT_BEACON || in beacon_interval_read()
765 wl->conf.conn.wake_up_event == CONF_WAKE_UP_EVENT_N_BEACONS) in beacon_interval_read()
766 value = wl->conf.conn.listen_interval; in beacon_interval_read()
777 struct wl1271 *wl = file->private_data; in beacon_interval_write() local
792 mutex_lock(&wl->mutex); in beacon_interval_write()
794 wl->conf.conn.listen_interval = value; in beacon_interval_write()
797 wl->conf.conn.wake_up_event = CONF_WAKE_UP_EVENT_BEACON; in beacon_interval_write()
799 wl->conf.conn.wake_up_event = CONF_WAKE_UP_EVENT_N_BEACONS; in beacon_interval_write()
805 mutex_unlock(&wl->mutex); in beacon_interval_write()
820 struct wl1271 *wl = file->private_data; in rx_streaming_interval_write() local
837 mutex_lock(&wl->mutex); in rx_streaming_interval_write()
839 wl->conf.rx_streaming.interval = value; in rx_streaming_interval_write()
841 ret = wl1271_ps_elp_wakeup(wl); in rx_streaming_interval_write()
845 wl12xx_for_each_wlvif_sta(wl, wlvif) { in rx_streaming_interval_write()
846 wl1271_recalc_rx_streaming(wl, wlvif); in rx_streaming_interval_write()
849 wl1271_ps_elp_sleep(wl); in rx_streaming_interval_write()
851 mutex_unlock(&wl->mutex); in rx_streaming_interval_write()
859 struct wl1271 *wl = file->private_data; in rx_streaming_interval_read() local
861 "%d\n", wl->conf.rx_streaming.interval); in rx_streaming_interval_read()
875 struct wl1271 *wl = file->private_data; in rx_streaming_always_write() local
892 mutex_lock(&wl->mutex); in rx_streaming_always_write()
894 wl->conf.rx_streaming.always = value; in rx_streaming_always_write()
896 ret = wl1271_ps_elp_wakeup(wl); in rx_streaming_always_write()
900 wl12xx_for_each_wlvif_sta(wl, wlvif) { in rx_streaming_always_write()
901 wl1271_recalc_rx_streaming(wl, wlvif); in rx_streaming_always_write()
904 wl1271_ps_elp_sleep(wl); in rx_streaming_always_write()
906 mutex_unlock(&wl->mutex); in rx_streaming_always_write()
914 struct wl1271 *wl = file->private_data; in rx_streaming_always_read() local
916 "%d\n", wl->conf.rx_streaming.always); in rx_streaming_always_read()
930 struct wl1271 *wl = file->private_data; in beacon_filtering_write() local
941 mutex_lock(&wl->mutex); in beacon_filtering_write()
943 ret = wl1271_ps_elp_wakeup(wl); in beacon_filtering_write()
947 wl12xx_for_each_wlvif(wl, wlvif) { in beacon_filtering_write()
948 ret = wl1271_acx_beacon_filter_opt(wl, wlvif, !!value); in beacon_filtering_write()
951 wl1271_ps_elp_sleep(wl); in beacon_filtering_write()
953 mutex_unlock(&wl->mutex); in beacon_filtering_write()
967 struct wl1271 *wl = file->private_data; in fw_stats_raw_read() local
969 wl1271_debugfs_update_stats(wl); in fw_stats_raw_read()
972 wl->stats.fw_stats, in fw_stats_raw_read()
973 wl->stats.fw_stats_len); in fw_stats_raw_read()
985 struct wl1271 *wl = file->private_data; in sleep_auth_read() local
989 wl->sleep_auth); in sleep_auth_read()
996 struct wl1271 *wl = file->private_data; in sleep_auth_write() local
1012 mutex_lock(&wl->mutex); in sleep_auth_write()
1014 wl->conf.conn.sta_sleep_auth = value; in sleep_auth_write()
1016 if (unlikely(wl->state != WLCORE_STATE_ON)) { in sleep_auth_write()
1018 wl->sleep_auth = value; in sleep_auth_write()
1022 ret = wl1271_ps_elp_wakeup(wl); in sleep_auth_write()
1026 ret = wl1271_acx_sleep_auth(wl, value); in sleep_auth_write()
1031 wl1271_ps_elp_sleep(wl); in sleep_auth_write()
1033 mutex_unlock(&wl->mutex); in sleep_auth_write()
1048 struct wl1271 *wl = file->private_data; in dev_mem_read() local
1075 mutex_lock(&wl->mutex); in dev_mem_read()
1077 if (unlikely(wl->state == WLCORE_STATE_OFF)) { in dev_mem_read()
1086 wl1271_ps_elp_wakeup(wl); in dev_mem_read()
1089 memcpy(&old_part, &wl->curr_part, sizeof(old_part)); in dev_mem_read()
1090 ret = wlcore_set_partition(wl, &part); in dev_mem_read()
1094 ret = wlcore_raw_read(wl, 0, buf, bytes, false); in dev_mem_read()
1100 ret = wlcore_set_partition(wl, &old_part); in dev_mem_read()
1105 wl1271_ps_elp_sleep(wl); in dev_mem_read()
1108 mutex_unlock(&wl->mutex); in dev_mem_read()
1129 struct wl1271 *wl = file->private_data; in dev_mem_write() local
1162 mutex_lock(&wl->mutex); in dev_mem_write()
1164 if (unlikely(wl->state == WLCORE_STATE_OFF)) { in dev_mem_write()
1173 wl1271_ps_elp_wakeup(wl); in dev_mem_write()
1176 memcpy(&old_part, &wl->curr_part, sizeof(old_part)); in dev_mem_write()
1177 ret = wlcore_set_partition(wl, &part); in dev_mem_write()
1181 ret = wlcore_raw_write(wl, 0, buf, bytes, false); in dev_mem_write()
1187 ret = wlcore_set_partition(wl, &old_part); in dev_mem_write()
1192 wl1271_ps_elp_sleep(wl); in dev_mem_write()
1195 mutex_unlock(&wl->mutex); in dev_mem_write()
1225 struct wl1271 *wl = file->private_data; in fw_logger_read() local
1229 wl->conf.fwlog.output); in fw_logger_read()
1236 struct wl1271 *wl = file->private_data; in fw_logger_write() local
1251 if (wl->conf.fwlog.output == 0) { in fw_logger_write()
1256 mutex_lock(&wl->mutex); in fw_logger_write()
1257 ret = wl1271_ps_elp_wakeup(wl); in fw_logger_write()
1263 wl->conf.fwlog.output = value; in fw_logger_write()
1265 ret = wl12xx_cmd_config_fwlog(wl); in fw_logger_write()
1267 wl1271_ps_elp_sleep(wl); in fw_logger_write()
1270 mutex_unlock(&wl->mutex); in fw_logger_write()
1281 static int wl1271_debugfs_add_files(struct wl1271 *wl, in wl1271_debugfs_add_files() argument
1329 void wl1271_debugfs_reset(struct wl1271 *wl) in wl1271_debugfs_reset() argument
1331 if (!wl->stats.fw_stats) in wl1271_debugfs_reset()
1334 memset(wl->stats.fw_stats, 0, wl->stats.fw_stats_len); in wl1271_debugfs_reset()
1335 wl->stats.retry_count = 0; in wl1271_debugfs_reset()
1336 wl->stats.excessive_retries = 0; in wl1271_debugfs_reset()
1339 int wl1271_debugfs_init(struct wl1271 *wl) in wl1271_debugfs_init() argument
1345 wl->hw->wiphy->debugfsdir); in wl1271_debugfs_init()
1352 wl->stats.fw_stats = kzalloc(wl->stats.fw_stats_len, GFP_KERNEL); in wl1271_debugfs_init()
1353 if (!wl->stats.fw_stats) { in wl1271_debugfs_init()
1358 wl->stats.fw_stats_update = jiffies; in wl1271_debugfs_init()
1360 ret = wl1271_debugfs_add_files(wl, rootdir); in wl1271_debugfs_init()
1364 ret = wlcore_debugfs_init(wl, rootdir); in wl1271_debugfs_init()
1371 wl1271_debugfs_exit(wl); in wl1271_debugfs_init()
1380 void wl1271_debugfs_exit(struct wl1271 *wl) in wl1271_debugfs_exit() argument
1382 kfree(wl->stats.fw_stats); in wl1271_debugfs_exit()
1383 wl->stats.fw_stats = NULL; in wl1271_debugfs_exit()