Lines Matching refs:wl

46 void wl1271_debugfs_update_stats(struct wl1271 *wl)  in wl1271_debugfs_update_stats()  argument
50 mutex_lock(&wl->mutex); in wl1271_debugfs_update_stats()
52 if (unlikely(wl->state != WLCORE_STATE_ON)) in wl1271_debugfs_update_stats()
55 ret = pm_runtime_resume_and_get(wl->dev); in wl1271_debugfs_update_stats()
59 if (!wl->plt && in wl1271_debugfs_update_stats()
60 time_after(jiffies, wl->stats.fw_stats_update + in wl1271_debugfs_update_stats()
62 wl1271_acx_statistics(wl, wl->stats.fw_stats); in wl1271_debugfs_update_stats()
63 wl->stats.fw_stats_update = jiffies; in wl1271_debugfs_update_stats()
66 pm_runtime_mark_last_busy(wl->dev); in wl1271_debugfs_update_stats()
67 pm_runtime_put_autosuspend(wl->dev); in wl1271_debugfs_update_stats()
70 mutex_unlock(&wl->mutex); in wl1271_debugfs_update_stats()
74 DEBUGFS_READONLY_FILE(retry_count, "%u", wl->stats.retry_count);
76 wl->stats.excessive_retries);
81 struct wl1271 *wl = file->private_data; in tx_queue_len_read() local
86 queue_len = wl1271_tx_total_queue_count(wl); in tx_queue_len_read()
98 static void chip_op_handler(struct wl1271 *wl, unsigned long value, in chip_op_handler() argument
102 int (*chip_op) (struct wl1271 *wl); in chip_op_handler()
109 ret = pm_runtime_resume_and_get(wl->dev); in chip_op_handler()
114 chip_op(wl); in chip_op_handler()
116 pm_runtime_mark_last_busy(wl->dev); in chip_op_handler()
117 pm_runtime_put_autosuspend(wl->dev); in chip_op_handler()
127 struct wl1271 *wl = file->private_data; \
130 wl->conf.conf_sub_struct.param); \
137 struct wl1271 *wl = file->private_data; \
152 mutex_lock(&wl->mutex); \
153 wl->conf.conf_sub_struct.param = value; \
155 write_handler_locked(wl, value, write_handler_arg); \
157 mutex_unlock(&wl->mutex); \
178 struct wl1271 *wl = file->private_data; in gpio_power_read() local
179 bool state = test_bit(WL1271_FLAG_GPIO_POWER, &wl->flags); in gpio_power_read()
193 struct wl1271 *wl = file->private_data; in gpio_power_write() local
203 mutex_lock(&wl->mutex); in gpio_power_write()
206 wl1271_power_on(wl); in gpio_power_write()
208 wl1271_power_off(wl); in gpio_power_write()
210 mutex_unlock(&wl->mutex); in gpio_power_write()
225 struct wl1271 *wl = file->private_data; in start_recovery_write() local
227 mutex_lock(&wl->mutex); in start_recovery_write()
228 wl12xx_queue_recovery_work(wl); in start_recovery_write()
229 mutex_unlock(&wl->mutex); in start_recovery_write()
243 struct wl1271 *wl = file->private_data; in dynamic_ps_timeout_read() local
247 wl->conf.conn.dynamic_ps_timeout); in dynamic_ps_timeout_read()
254 struct wl1271 *wl = file->private_data; in dynamic_ps_timeout_write() local
270 mutex_lock(&wl->mutex); in dynamic_ps_timeout_write()
272 wl->conf.conn.dynamic_ps_timeout = value; in dynamic_ps_timeout_write()
274 if (unlikely(wl->state != WLCORE_STATE_ON)) in dynamic_ps_timeout_write()
277 ret = pm_runtime_resume_and_get(wl->dev); in dynamic_ps_timeout_write()
285 wl12xx_for_each_wlvif_sta(wl, wlvif) { in dynamic_ps_timeout_write()
287 wl1271_ps_set_mode(wl, wlvif, STATION_AUTO_PS_MODE); in dynamic_ps_timeout_write()
290 pm_runtime_mark_last_busy(wl->dev); in dynamic_ps_timeout_write()
291 pm_runtime_put_autosuspend(wl->dev); in dynamic_ps_timeout_write()
294 mutex_unlock(&wl->mutex); in dynamic_ps_timeout_write()
308 struct wl1271 *wl = file->private_data; in forced_ps_read() local
312 wl->conf.conn.forced_ps); in forced_ps_read()
319 struct wl1271 *wl = file->private_data; in forced_ps_write() local
335 mutex_lock(&wl->mutex); in forced_ps_write()
337 if (wl->conf.conn.forced_ps == value) in forced_ps_write()
340 wl->conf.conn.forced_ps = value; in forced_ps_write()
342 if (unlikely(wl->state != WLCORE_STATE_ON)) in forced_ps_write()
345 ret = pm_runtime_resume_and_get(wl->dev); in forced_ps_write()
355 wl12xx_for_each_wlvif_sta(wl, wlvif) { in forced_ps_write()
357 wl1271_ps_set_mode(wl, wlvif, ps_mode); in forced_ps_write()
360 pm_runtime_mark_last_busy(wl->dev); in forced_ps_write()
361 pm_runtime_put_autosuspend(wl->dev); in forced_ps_write()
364 mutex_unlock(&wl->mutex); in forced_ps_write()
378 struct wl1271 *wl = file->private_data; in split_scan_timeout_read() local
382 wl->conf.scan.split_scan_timeout / 1000); in split_scan_timeout_read()
389 struct wl1271 *wl = file->private_data; in split_scan_timeout_write() local
402 mutex_lock(&wl->mutex); in split_scan_timeout_write()
404 wl->conf.scan.split_scan_timeout = value * 1000; in split_scan_timeout_write()
406 mutex_unlock(&wl->mutex); in split_scan_timeout_write()
420 struct wl1271 *wl = file->private_data; in driver_state_read() local
432 mutex_lock(&wl->mutex); in driver_state_read()
436 #x " = " fmt "\n", wl->x)) in driver_state_read()
448 wl12xx_for_each_wlvif_sta(wl, wlvif) { in driver_state_read()
456 wl12xx_for_each_wlvif_ap(wl, wlvif) in driver_state_read()
503 mutex_unlock(&wl->mutex); in driver_state_read()
519 struct wl1271 *wl = file->private_data; in vifs_state_read() local
530 mutex_lock(&wl->mutex); in vifs_state_read()
552 wl12xx_for_each_wlvif(wl, wlvif) { in vifs_state_read()
613 mutex_unlock(&wl->mutex); in vifs_state_read()
629 struct wl1271 *wl = file->private_data; in dtim_interval_read() local
632 if (wl->conf.conn.wake_up_event == CONF_WAKE_UP_EVENT_DTIM || in dtim_interval_read()
633 wl->conf.conn.wake_up_event == CONF_WAKE_UP_EVENT_N_DTIM) in dtim_interval_read()
634 value = wl->conf.conn.listen_interval; in dtim_interval_read()
645 struct wl1271 *wl = file->private_data; in dtim_interval_write() local
660 mutex_lock(&wl->mutex); in dtim_interval_write()
662 wl->conf.conn.listen_interval = value; in dtim_interval_write()
665 wl->conf.conn.wake_up_event = CONF_WAKE_UP_EVENT_DTIM; in dtim_interval_write()
667 wl->conf.conn.wake_up_event = CONF_WAKE_UP_EVENT_N_DTIM; in dtim_interval_write()
673 mutex_unlock(&wl->mutex); in dtim_interval_write()
690 struct wl1271 *wl = file->private_data; in suspend_dtim_interval_read() local
693 if (wl->conf.conn.suspend_wake_up_event == CONF_WAKE_UP_EVENT_DTIM || in suspend_dtim_interval_read()
694 wl->conf.conn.suspend_wake_up_event == CONF_WAKE_UP_EVENT_N_DTIM) in suspend_dtim_interval_read()
695 value = wl->conf.conn.suspend_listen_interval; in suspend_dtim_interval_read()
706 struct wl1271 *wl = file->private_data; in suspend_dtim_interval_write() local
721 mutex_lock(&wl->mutex); in suspend_dtim_interval_write()
723 wl->conf.conn.suspend_listen_interval = value; in suspend_dtim_interval_write()
726 wl->conf.conn.suspend_wake_up_event = CONF_WAKE_UP_EVENT_DTIM; in suspend_dtim_interval_write()
728 wl->conf.conn.suspend_wake_up_event = CONF_WAKE_UP_EVENT_N_DTIM; in suspend_dtim_interval_write()
730 mutex_unlock(&wl->mutex); in suspend_dtim_interval_write()
745 struct wl1271 *wl = file->private_data; in beacon_interval_read() local
748 if (wl->conf.conn.wake_up_event == CONF_WAKE_UP_EVENT_BEACON || in beacon_interval_read()
749 wl->conf.conn.wake_up_event == CONF_WAKE_UP_EVENT_N_BEACONS) in beacon_interval_read()
750 value = wl->conf.conn.listen_interval; in beacon_interval_read()
761 struct wl1271 *wl = file->private_data; in beacon_interval_write() local
776 mutex_lock(&wl->mutex); in beacon_interval_write()
778 wl->conf.conn.listen_interval = value; in beacon_interval_write()
781 wl->conf.conn.wake_up_event = CONF_WAKE_UP_EVENT_BEACON; in beacon_interval_write()
783 wl->conf.conn.wake_up_event = CONF_WAKE_UP_EVENT_N_BEACONS; in beacon_interval_write()
789 mutex_unlock(&wl->mutex); in beacon_interval_write()
804 struct wl1271 *wl = file->private_data; in rx_streaming_interval_write() local
821 mutex_lock(&wl->mutex); in rx_streaming_interval_write()
823 wl->conf.rx_streaming.interval = value; in rx_streaming_interval_write()
825 ret = pm_runtime_resume_and_get(wl->dev); in rx_streaming_interval_write()
829 wl12xx_for_each_wlvif_sta(wl, wlvif) { in rx_streaming_interval_write()
830 wl1271_recalc_rx_streaming(wl, wlvif); in rx_streaming_interval_write()
833 pm_runtime_mark_last_busy(wl->dev); in rx_streaming_interval_write()
834 pm_runtime_put_autosuspend(wl->dev); in rx_streaming_interval_write()
836 mutex_unlock(&wl->mutex); in rx_streaming_interval_write()
844 struct wl1271 *wl = file->private_data; in rx_streaming_interval_read() local
846 "%d\n", wl->conf.rx_streaming.interval); in rx_streaming_interval_read()
860 struct wl1271 *wl = file->private_data; in rx_streaming_always_write() local
877 mutex_lock(&wl->mutex); in rx_streaming_always_write()
879 wl->conf.rx_streaming.always = value; in rx_streaming_always_write()
881 ret = pm_runtime_resume_and_get(wl->dev); in rx_streaming_always_write()
885 wl12xx_for_each_wlvif_sta(wl, wlvif) { in rx_streaming_always_write()
886 wl1271_recalc_rx_streaming(wl, wlvif); in rx_streaming_always_write()
889 pm_runtime_mark_last_busy(wl->dev); in rx_streaming_always_write()
890 pm_runtime_put_autosuspend(wl->dev); in rx_streaming_always_write()
892 mutex_unlock(&wl->mutex); in rx_streaming_always_write()
900 struct wl1271 *wl = file->private_data; in rx_streaming_always_read() local
902 "%d\n", wl->conf.rx_streaming.always); in rx_streaming_always_read()
916 struct wl1271 *wl = file->private_data; in beacon_filtering_write() local
927 mutex_lock(&wl->mutex); in beacon_filtering_write()
929 ret = pm_runtime_resume_and_get(wl->dev); in beacon_filtering_write()
933 wl12xx_for_each_wlvif(wl, wlvif) { in beacon_filtering_write()
934 ret = wl1271_acx_beacon_filter_opt(wl, wlvif, !!value); in beacon_filtering_write()
937 pm_runtime_mark_last_busy(wl->dev); in beacon_filtering_write()
938 pm_runtime_put_autosuspend(wl->dev); in beacon_filtering_write()
940 mutex_unlock(&wl->mutex); in beacon_filtering_write()
954 struct wl1271 *wl = file->private_data; in fw_stats_raw_read() local
956 wl1271_debugfs_update_stats(wl); in fw_stats_raw_read()
959 wl->stats.fw_stats, in fw_stats_raw_read()
960 wl->stats.fw_stats_len); in fw_stats_raw_read()
972 struct wl1271 *wl = file->private_data; in sleep_auth_read() local
976 wl->sleep_auth); in sleep_auth_read()
983 struct wl1271 *wl = file->private_data; in sleep_auth_write() local
999 mutex_lock(&wl->mutex); in sleep_auth_write()
1001 wl->conf.conn.sta_sleep_auth = value; in sleep_auth_write()
1003 if (unlikely(wl->state != WLCORE_STATE_ON)) { in sleep_auth_write()
1005 wl->sleep_auth = value; in sleep_auth_write()
1009 ret = pm_runtime_resume_and_get(wl->dev); in sleep_auth_write()
1013 ret = wl1271_acx_sleep_auth(wl, value); in sleep_auth_write()
1018 pm_runtime_mark_last_busy(wl->dev); in sleep_auth_write()
1019 pm_runtime_put_autosuspend(wl->dev); in sleep_auth_write()
1021 mutex_unlock(&wl->mutex); in sleep_auth_write()
1036 struct wl1271 *wl = file->private_data; in dev_mem_read() local
1063 mutex_lock(&wl->mutex); in dev_mem_read()
1065 if (unlikely(wl->state == WLCORE_STATE_OFF)) { in dev_mem_read()
1074 pm_runtime_get_sync(wl->dev); in dev_mem_read()
1077 memcpy(&old_part, &wl->curr_part, sizeof(old_part)); in dev_mem_read()
1078 ret = wlcore_set_partition(wl, &part); in dev_mem_read()
1082 ret = wlcore_raw_read(wl, 0, buf, bytes, false); in dev_mem_read()
1088 ret = wlcore_set_partition(wl, &old_part); in dev_mem_read()
1093 pm_runtime_mark_last_busy(wl->dev); in dev_mem_read()
1094 pm_runtime_put_autosuspend(wl->dev); in dev_mem_read()
1097 mutex_unlock(&wl->mutex); in dev_mem_read()
1118 struct wl1271 *wl = file->private_data; in dev_mem_write() local
1145 mutex_lock(&wl->mutex); in dev_mem_write()
1147 if (unlikely(wl->state == WLCORE_STATE_OFF)) { in dev_mem_write()
1156 pm_runtime_get_sync(wl->dev); in dev_mem_write()
1159 memcpy(&old_part, &wl->curr_part, sizeof(old_part)); in dev_mem_write()
1160 ret = wlcore_set_partition(wl, &part); in dev_mem_write()
1164 ret = wlcore_raw_write(wl, 0, buf, bytes, false); in dev_mem_write()
1170 ret = wlcore_set_partition(wl, &old_part); in dev_mem_write()
1175 pm_runtime_mark_last_busy(wl->dev); in dev_mem_write()
1176 pm_runtime_put_autosuspend(wl->dev); in dev_mem_write()
1179 mutex_unlock(&wl->mutex); in dev_mem_write()
1208 struct wl1271 *wl = file->private_data; in fw_logger_read() local
1212 wl->conf.fwlog.output); in fw_logger_read()
1219 struct wl1271 *wl = file->private_data; in fw_logger_write() local
1234 if (wl->conf.fwlog.output == 0) { in fw_logger_write()
1239 mutex_lock(&wl->mutex); in fw_logger_write()
1240 ret = pm_runtime_resume_and_get(wl->dev); in fw_logger_write()
1246 wl->conf.fwlog.output = value; in fw_logger_write()
1248 ret = wl12xx_cmd_config_fwlog(wl); in fw_logger_write()
1250 pm_runtime_mark_last_busy(wl->dev); in fw_logger_write()
1251 pm_runtime_put_autosuspend(wl->dev); in fw_logger_write()
1254 mutex_unlock(&wl->mutex); in fw_logger_write()
1265 static void wl1271_debugfs_add_files(struct wl1271 *wl, in wl1271_debugfs_add_files() argument
1300 void wl1271_debugfs_reset(struct wl1271 *wl) in wl1271_debugfs_reset() argument
1302 if (!wl->stats.fw_stats) in wl1271_debugfs_reset()
1305 memset(wl->stats.fw_stats, 0, wl->stats.fw_stats_len); in wl1271_debugfs_reset()
1306 wl->stats.retry_count = 0; in wl1271_debugfs_reset()
1307 wl->stats.excessive_retries = 0; in wl1271_debugfs_reset()
1310 int wl1271_debugfs_init(struct wl1271 *wl) in wl1271_debugfs_init() argument
1316 wl->hw->wiphy->debugfsdir); in wl1271_debugfs_init()
1318 wl->stats.fw_stats = kzalloc(wl->stats.fw_stats_len, GFP_KERNEL); in wl1271_debugfs_init()
1319 if (!wl->stats.fw_stats) { in wl1271_debugfs_init()
1324 wl->stats.fw_stats_update = jiffies; in wl1271_debugfs_init()
1326 wl1271_debugfs_add_files(wl, rootdir); in wl1271_debugfs_init()
1328 ret = wlcore_debugfs_init(wl, rootdir); in wl1271_debugfs_init()
1335 wl1271_debugfs_exit(wl); in wl1271_debugfs_init()
1344 void wl1271_debugfs_exit(struct wl1271 *wl) in wl1271_debugfs_exit() argument
1346 kfree(wl->stats.fw_stats); in wl1271_debugfs_exit()
1347 wl->stats.fw_stats = NULL; in wl1271_debugfs_exit()