Lines Matching refs:priv

25 	struct icnss_priv *priv =  in icnss_regwrite_write()  local
34 if (!test_bit(ICNSS_FW_READY, &priv->state) || in icnss_regwrite_write()
35 !test_bit(ICNSS_POWER_ON, &priv->state)) in icnss_regwrite_write()
72 ret = wlfw_athdiag_write_send_sync_msg(priv, reg_offset, mem_type, in icnss_regwrite_write()
83 struct icnss_priv *priv = s->private; in icnss_regwrite_show() local
87 if (!test_bit(ICNSS_FW_READY, &priv->state)) in icnss_regwrite_show()
108 struct icnss_priv *priv = s->private; in icnss_regread_show() local
110 mutex_lock(&priv->dev_lock); in icnss_regread_show()
111 if (!priv->diag_reg_read_buf) { in icnss_regread_show()
114 if (!test_bit(ICNSS_FW_READY, &priv->state)) in icnss_regread_show()
117 mutex_unlock(&priv->dev_lock); in icnss_regread_show()
122 priv->diag_reg_read_addr, priv->diag_reg_read_mem_type, in icnss_regread_show()
123 priv->diag_reg_read_len); in icnss_regread_show()
125 seq_hex_dump(s, "", DUMP_PREFIX_OFFSET, 32, 4, priv->diag_reg_read_buf, in icnss_regread_show()
126 priv->diag_reg_read_len, false); in icnss_regread_show()
128 priv->diag_reg_read_len = 0; in icnss_regread_show()
129 kfree(priv->diag_reg_read_buf); in icnss_regread_show()
130 priv->diag_reg_read_buf = NULL; in icnss_regread_show()
131 mutex_unlock(&priv->dev_lock); in icnss_regread_show()
196 struct icnss_priv *priv = in icnss_regread_write() local
202 if (!test_bit(ICNSS_FW_READY, &priv->state) || in icnss_regread_write()
203 !test_bit(ICNSS_POWER_ON, &priv->state)) in icnss_regread_write()
210 mutex_lock(&priv->dev_lock); in icnss_regread_write()
211 kfree(priv->diag_reg_read_buf); in icnss_regread_write()
212 priv->diag_reg_read_buf = NULL; in icnss_regread_write()
216 mutex_unlock(&priv->dev_lock); in icnss_regread_write()
220 ret = wlfw_athdiag_read_send_sync_msg(priv, reg_info.reg_offset, in icnss_regread_write()
226 mutex_unlock(&priv->dev_lock); in icnss_regread_write()
230 priv->diag_reg_read_addr = reg_info.reg_offset; in icnss_regread_write()
231 priv->diag_reg_read_mem_type = reg_info.mem_type; in icnss_regread_write()
232 priv->diag_reg_read_len = reg_info.data_len; in icnss_regread_write()
233 priv->diag_reg_read_buf = reg_buf; in icnss_regread_write()
234 mutex_unlock(&priv->dev_lock); in icnss_regread_write()
250 struct icnss_priv *priv = in icnss_stats_write() local
260 memset(&priv->stats, 0, sizeof(priv->stats)); in icnss_stats_write()
266 struct icnss_priv *priv) in icnss_stats_show_rejuvenate_info() argument
268 if (priv->stats.rejuvenate_ind) { in icnss_stats_show_rejuvenate_info()
271 priv->stats.rejuvenate_ind); in icnss_stats_show_rejuvenate_info()
273 priv->cause_for_rejuvenation); in icnss_stats_show_rejuvenate_info()
275 priv->requesting_sub_system); in icnss_stats_show_rejuvenate_info()
277 priv->line_number); in icnss_stats_show_rejuvenate_info()
279 priv->function_name); in icnss_stats_show_rejuvenate_info()
285 static int icnss_stats_show_irqs(struct seq_file *s, struct icnss_priv *priv) in icnss_stats_show_irqs() argument
294 priv->ce_irqs[i], priv->stats.ce_irqs[i].request, in icnss_stats_show_irqs()
295 priv->stats.ce_irqs[i].free, in icnss_stats_show_irqs()
296 priv->stats.ce_irqs[i].enable, in icnss_stats_show_irqs()
297 priv->stats.ce_irqs[i].disable); in icnss_stats_show_irqs()
303 struct icnss_priv *priv) in icnss_stats_show_capability() argument
305 if (test_bit(ICNSS_FW_READY, &priv->state)) { in icnss_stats_show_capability()
307 seq_printf(s, "Chip ID: 0x%x\n", priv->chip_info.chip_id); in icnss_stats_show_capability()
309 priv->chip_info.chip_family); in icnss_stats_show_capability()
310 seq_printf(s, "Board ID: 0x%x\n", priv->board_id); in icnss_stats_show_capability()
311 seq_printf(s, "SOC Info: 0x%x\n", priv->soc_id); in icnss_stats_show_capability()
313 priv->fw_version_info.fw_version); in icnss_stats_show_capability()
315 priv->fw_version_info.fw_build_timestamp); in icnss_stats_show_capability()
317 priv->fw_build_id); in icnss_stats_show_capability()
319 priv->rd_card_chain_cap); in icnss_stats_show_capability()
321 priv->phy_he_channel_width_cap); in icnss_stats_show_capability()
323 priv->phy_qam_cap); in icnss_stats_show_capability()
329 static int icnss_stats_show_events(struct seq_file *s, struct icnss_priv *priv) in icnss_stats_show_events() argument
338 priv->stats.events[i].posted, in icnss_stats_show_events()
339 priv->stats.events[i].processed); in icnss_stats_show_events()
344 static u64 icnss_get_serial_id(struct icnss_priv *priv) in icnss_get_serial_id() argument
346 u32 msb = priv->serial_id.serial_id_msb; in icnss_get_serial_id()
347 u32 lsb = priv->serial_id.serial_id_lsb; in icnss_get_serial_id()
353 static int icnss_stats_show_state(struct seq_file *s, struct icnss_priv *priv) in icnss_stats_show_state() argument
359 seq_printf(s, "\nSerial Number: 0x%llx", icnss_get_serial_id(priv)); in icnss_stats_show_state()
360 seq_printf(s, "\nState: 0x%lx(", priv->state); in icnss_stats_show_state()
361 for (i = 0, state = priv->state; state != 0; state >>= 1, i++) { in icnss_stats_show_state()
465 struct icnss_priv *priv = s->private; in icnss_stats_show() local
467 ICNSS_STATS_DUMP(s, priv, ind_register_req); in icnss_stats_show()
468 ICNSS_STATS_DUMP(s, priv, ind_register_resp); in icnss_stats_show()
469 ICNSS_STATS_DUMP(s, priv, ind_register_err); in icnss_stats_show()
470 ICNSS_STATS_DUMP(s, priv, cap_req); in icnss_stats_show()
471 ICNSS_STATS_DUMP(s, priv, cap_resp); in icnss_stats_show()
472 ICNSS_STATS_DUMP(s, priv, cap_err); in icnss_stats_show()
473 ICNSS_STATS_DUMP(s, priv, pin_connect_result); in icnss_stats_show()
474 ICNSS_STATS_DUMP(s, priv, cfg_req); in icnss_stats_show()
475 ICNSS_STATS_DUMP(s, priv, cfg_resp); in icnss_stats_show()
476 ICNSS_STATS_DUMP(s, priv, cfg_req_err); in icnss_stats_show()
477 ICNSS_STATS_DUMP(s, priv, mode_req); in icnss_stats_show()
478 ICNSS_STATS_DUMP(s, priv, mode_resp); in icnss_stats_show()
479 ICNSS_STATS_DUMP(s, priv, mode_req_err); in icnss_stats_show()
480 ICNSS_STATS_DUMP(s, priv, ini_req); in icnss_stats_show()
481 ICNSS_STATS_DUMP(s, priv, ini_resp); in icnss_stats_show()
482 ICNSS_STATS_DUMP(s, priv, ini_req_err); in icnss_stats_show()
483 ICNSS_STATS_DUMP(s, priv, recovery.pdr_fw_crash); in icnss_stats_show()
484 ICNSS_STATS_DUMP(s, priv, recovery.pdr_host_error); in icnss_stats_show()
485 ICNSS_STATS_DUMP(s, priv, recovery.root_pd_crash); in icnss_stats_show()
486 ICNSS_STATS_DUMP(s, priv, recovery.root_pd_shutdown); in icnss_stats_show()
489 ICNSS_STATS_DUMP(s, priv, pm_suspend); in icnss_stats_show()
490 ICNSS_STATS_DUMP(s, priv, pm_suspend_err); in icnss_stats_show()
491 ICNSS_STATS_DUMP(s, priv, pm_resume); in icnss_stats_show()
492 ICNSS_STATS_DUMP(s, priv, pm_resume_err); in icnss_stats_show()
493 ICNSS_STATS_DUMP(s, priv, pm_suspend_noirq); in icnss_stats_show()
494 ICNSS_STATS_DUMP(s, priv, pm_suspend_noirq_err); in icnss_stats_show()
495 ICNSS_STATS_DUMP(s, priv, pm_resume_noirq); in icnss_stats_show()
496 ICNSS_STATS_DUMP(s, priv, pm_resume_noirq_err); in icnss_stats_show()
497 ICNSS_STATS_DUMP(s, priv, pm_stay_awake); in icnss_stats_show()
498 ICNSS_STATS_DUMP(s, priv, pm_relax); in icnss_stats_show()
500 if (priv->device_id == ADRASTEA_DEVICE_ID) { in icnss_stats_show()
502 ICNSS_STATS_DUMP(s, priv, msa_info_req); in icnss_stats_show()
503 ICNSS_STATS_DUMP(s, priv, msa_info_resp); in icnss_stats_show()
504 ICNSS_STATS_DUMP(s, priv, msa_info_err); in icnss_stats_show()
505 ICNSS_STATS_DUMP(s, priv, msa_ready_req); in icnss_stats_show()
506 ICNSS_STATS_DUMP(s, priv, msa_ready_resp); in icnss_stats_show()
507 ICNSS_STATS_DUMP(s, priv, msa_ready_err); in icnss_stats_show()
508 ICNSS_STATS_DUMP(s, priv, msa_ready_ind); in icnss_stats_show()
511 ICNSS_STATS_DUMP(s, priv, rejuvenate_ind); in icnss_stats_show()
512 ICNSS_STATS_DUMP(s, priv, rejuvenate_ack_req); in icnss_stats_show()
513 ICNSS_STATS_DUMP(s, priv, rejuvenate_ack_resp); in icnss_stats_show()
514 ICNSS_STATS_DUMP(s, priv, rejuvenate_ack_err); in icnss_stats_show()
515 icnss_stats_show_rejuvenate_info(s, priv); in icnss_stats_show()
519 icnss_stats_show_irqs(s, priv); in icnss_stats_show()
521 icnss_stats_show_capability(s, priv); in icnss_stats_show()
523 icnss_stats_show_events(s, priv); in icnss_stats_show()
525 icnss_stats_show_state(s, priv); in icnss_stats_show()
546 struct icnss_priv *priv = s->private; in icnss_fw_debug_show() local
562 if (!test_bit(ICNSS_FW_READY, &priv->state)) { in icnss_fw_debug_show()
567 if (test_bit(ICNSS_DRIVER_PROBED, &priv->state)) { in icnss_fw_debug_show()
572 if (test_bit(ICNSS_FW_TEST_MODE, &priv->state)) { in icnss_fw_debug_show()
582 static int icnss_test_mode_fw_test_off(struct icnss_priv *priv) in icnss_test_mode_fw_test_off() argument
586 if (!test_bit(ICNSS_FW_READY, &priv->state)) { in icnss_test_mode_fw_test_off()
588 priv->state); in icnss_test_mode_fw_test_off()
593 if (test_bit(ICNSS_DRIVER_PROBED, &priv->state)) { in icnss_test_mode_fw_test_off()
595 priv->state); in icnss_test_mode_fw_test_off()
600 if (!test_bit(ICNSS_FW_TEST_MODE, &priv->state)) { in icnss_test_mode_fw_test_off()
602 priv->state); in icnss_test_mode_fw_test_off()
607 icnss_wlan_disable(&priv->pdev->dev, ICNSS_OFF); in icnss_test_mode_fw_test_off()
609 ret = icnss_hw_power_off(priv); in icnss_test_mode_fw_test_off()
611 clear_bit(ICNSS_FW_TEST_MODE, &priv->state); in icnss_test_mode_fw_test_off()
617 static int icnss_test_mode_fw_test(struct icnss_priv *priv, in icnss_test_mode_fw_test() argument
622 if (!test_bit(ICNSS_FW_READY, &priv->state)) { in icnss_test_mode_fw_test()
624 priv->state); in icnss_test_mode_fw_test()
629 if (test_bit(ICNSS_DRIVER_PROBED, &priv->state)) { in icnss_test_mode_fw_test()
631 priv->state); in icnss_test_mode_fw_test()
636 if (test_bit(ICNSS_FW_TEST_MODE, &priv->state)) { in icnss_test_mode_fw_test()
638 priv->state); in icnss_test_mode_fw_test()
643 ret = icnss_hw_power_on(priv); in icnss_test_mode_fw_test()
647 set_bit(ICNSS_FW_TEST_MODE, &priv->state); in icnss_test_mode_fw_test()
649 ret = icnss_wlan_enable(&priv->pdev->dev, NULL, mode, NULL); in icnss_test_mode_fw_test()
656 icnss_hw_power_off(priv); in icnss_test_mode_fw_test()
657 clear_bit(ICNSS_FW_TEST_MODE, &priv->state); in icnss_test_mode_fw_test()
668 struct icnss_priv *priv = in icnss_fw_debug_write() local
701 ret = icnss_test_mode_fw_test_off(priv); in icnss_fw_debug_write()
704 ret = icnss_test_mode_fw_test(priv, ICNSS_WALTEST); in icnss_fw_debug_write()
707 ret = icnss_test_mode_fw_test(priv, ICNSS_CCPM); in icnss_fw_debug_write()
710 ret = icnss_trigger_recovery(&priv->pdev->dev); in icnss_fw_debug_write()
713 icnss_allow_recursive_recovery(&priv->pdev->dev); in icnss_fw_debug_write()
716 icnss_disallow_recursive_recovery(&priv->pdev->dev); in icnss_fw_debug_write()
719 power_supply_changed(priv->batt_psy); in icnss_fw_debug_write()
725 ret = wlfw_dynamic_feature_mask_send_sync_msg(priv, val); in icnss_fw_debug_write()
754 struct icnss_priv *priv = in icnss_control_params_debug_write() local
764 if (!priv) in icnss_control_params_debug_write()
788 priv->ctrl_params.qmi_timeout = msecs_to_jiffies(val); in icnss_control_params_debug_write()
797 struct icnss_priv *priv = s->private; in icnss_control_params_debug_show() local
805 seq_printf(s, "qmi_timeout: %u\n", jiffies_to_msecs(priv->ctrl_params.qmi_timeout)); in icnss_control_params_debug_show()
827 int icnss_debugfs_create(struct icnss_priv *priv) in icnss_debugfs_create() argument
840 priv->root_dentry = root_dentry; in icnss_debugfs_create()
842 debugfs_create_file("fw_debug", 0600, root_dentry, priv, in icnss_debugfs_create()
844 debugfs_create_file("stats", 0600, root_dentry, priv, in icnss_debugfs_create()
846 debugfs_create_file("reg_read", 0600, root_dentry, priv, in icnss_debugfs_create()
848 debugfs_create_file("reg_write", 0600, root_dentry, priv, in icnss_debugfs_create()
850 debugfs_create_file("control_params", 0600, root_dentry, priv, in icnss_debugfs_create()
856 int icnss_debugfs_create(struct icnss_priv *priv) in icnss_debugfs_create() argument
869 priv->root_dentry = root_dentry; in icnss_debugfs_create()
871 debugfs_create_file("stats", 0600, root_dentry, priv, in icnss_debugfs_create()
877 void icnss_debugfs_destroy(struct icnss_priv *priv) in icnss_debugfs_destroy() argument
879 debugfs_remove_recursive(priv->root_dentry); in icnss_debugfs_destroy()