Lines Matching refs:plat_priv

76 static u64 cnss_get_serial_id(struct cnss_plat_data *plat_priv)  in cnss_get_serial_id()  argument
78 u32 msb = plat_priv->serial_id.serial_id_msb; in cnss_get_serial_id()
79 u32 lsb = plat_priv->serial_id.serial_id_lsb; in cnss_get_serial_id()
86 struct cnss_plat_data *plat_priv) in cnss_stats_show_state() argument
93 cnss_get_serial_id(plat_priv)); in cnss_stats_show_state()
94 seq_printf(s, "\nState: 0x%lx(", plat_priv->driver_state); in cnss_stats_show_state()
95 for (i = 0, state = plat_priv->driver_state; state != 0; in cnss_stats_show_state()
201 struct cnss_plat_data *plat_priv) in cnss_stats_show_gpio_state() argument
203 seq_printf(s, "\nHost SOL: %d", cnss_get_host_sol_value(plat_priv)); in cnss_stats_show_gpio_state()
204 seq_printf(s, "\nDev SOL: %d", cnss_get_dev_sol_value(plat_priv)); in cnss_stats_show_gpio_state()
211 struct cnss_plat_data *plat_priv = s->private; in cnss_stats_show() local
213 cnss_stats_show_state(s, plat_priv); in cnss_stats_show()
214 cnss_stats_show_gpio_state(s, plat_priv); in cnss_stats_show()
236 struct cnss_plat_data *plat_priv = in cnss_dev_boot_debug_write() local
246 if (!plat_priv) in cnss_dev_boot_debug_write()
263 ret = cnss_power_on_device(plat_priv, false); in cnss_dev_boot_debug_write()
265 cnss_power_off_device(plat_priv); in cnss_dev_boot_debug_write()
267 ret = cnss_pci_init(plat_priv); in cnss_dev_boot_debug_write()
269 set_bit(CNSS_DRIVER_DEBUG, &plat_priv->driver_state); in cnss_dev_boot_debug_write()
270 ret = cnss_driver_event_post(plat_priv, in cnss_dev_boot_debug_write()
274 ret = cnss_driver_event_post(plat_priv, in cnss_dev_boot_debug_write()
277 clear_bit(CNSS_DRIVER_DEBUG, &plat_priv->driver_state); in cnss_dev_boot_debug_write()
279 pci_priv = plat_priv->bus_priv; in cnss_dev_boot_debug_write()
281 ret = cnss_set_host_sol_value(plat_priv, 1); in cnss_dev_boot_debug_write()
283 ret = cnss_set_host_sol_value(plat_priv, 0); in cnss_dev_boot_debug_write()
287 ret = cnss_aop_send_msg(plat_priv, sptr); in cnss_dev_boot_debug_write()
289 cnss_wlan_hw_disable_check(plat_priv); in cnss_dev_boot_debug_write()
293 pci_priv = plat_priv->bus_priv; in cnss_dev_boot_debug_write()
298 set_bit(CNSS_DRIVER_DEBUG, &plat_priv->driver_state); in cnss_dev_boot_debug_write()
310 &plat_priv->driver_state); in cnss_dev_boot_debug_write()
364 struct cnss_plat_data *plat_priv = s->private; in cnss_reg_read_debug_show() local
366 mutex_lock(&plat_priv->dev_lock); in cnss_reg_read_debug_show()
367 if (!plat_priv->diag_reg_read_buf) { in cnss_reg_read_debug_show()
372 mutex_unlock(&plat_priv->dev_lock); in cnss_reg_read_debug_show()
377 plat_priv->diag_reg_read_addr, in cnss_reg_read_debug_show()
378 plat_priv->diag_reg_read_mem_type, in cnss_reg_read_debug_show()
379 plat_priv->diag_reg_read_len); in cnss_reg_read_debug_show()
382 plat_priv->diag_reg_read_buf, in cnss_reg_read_debug_show()
383 plat_priv->diag_reg_read_len, false); in cnss_reg_read_debug_show()
385 plat_priv->diag_reg_read_len = 0; in cnss_reg_read_debug_show()
386 kfree(plat_priv->diag_reg_read_buf); in cnss_reg_read_debug_show()
387 plat_priv->diag_reg_read_buf = NULL; in cnss_reg_read_debug_show()
388 mutex_unlock(&plat_priv->dev_lock); in cnss_reg_read_debug_show()
397 struct cnss_plat_data *plat_priv = in cnss_reg_read_debug_write() local
444 ret = cnss_bus_debug_reg_read(plat_priv, reg_offset, &reg_val, in cnss_reg_read_debug_write()
454 if (!test_bit(CNSS_FW_READY, &plat_priv->driver_state)) { in cnss_reg_read_debug_write()
459 mutex_lock(&plat_priv->dev_lock); in cnss_reg_read_debug_write()
460 kfree(plat_priv->diag_reg_read_buf); in cnss_reg_read_debug_write()
461 plat_priv->diag_reg_read_buf = NULL; in cnss_reg_read_debug_write()
465 mutex_unlock(&plat_priv->dev_lock); in cnss_reg_read_debug_write()
469 ret = cnss_wlfw_athdiag_read_send_sync(plat_priv, reg_offset, in cnss_reg_read_debug_write()
474 mutex_unlock(&plat_priv->dev_lock); in cnss_reg_read_debug_write()
478 plat_priv->diag_reg_read_addr = reg_offset; in cnss_reg_read_debug_write()
479 plat_priv->diag_reg_read_mem_type = mem_type; in cnss_reg_read_debug_write()
480 plat_priv->diag_reg_read_len = data_len; in cnss_reg_read_debug_write()
481 plat_priv->diag_reg_read_buf = reg_buf; in cnss_reg_read_debug_write()
482 mutex_unlock(&plat_priv->dev_lock); in cnss_reg_read_debug_write()
514 struct cnss_plat_data *plat_priv = in cnss_reg_write_debug_write() local
559 ret = cnss_bus_debug_reg_write(plat_priv, reg_offset, reg_val, in cnss_reg_write_debug_write()
569 if (!test_bit(CNSS_FW_READY, &plat_priv->driver_state)) { in cnss_reg_write_debug_write()
574 ret = cnss_wlfw_athdiag_write_send_sync(plat_priv, reg_offset, mem_type, in cnss_reg_write_debug_write()
600 struct cnss_plat_data *plat_priv = in cnss_runtime_pm_debug_write() local
608 if (!plat_priv) in cnss_runtime_pm_debug_write()
611 pci_priv = plat_priv->bus_priv; in cnss_runtime_pm_debug_write()
658 struct cnss_plat_data *plat_priv = s->private; in cnss_runtime_pm_debug_show() local
662 if (!plat_priv) in cnss_runtime_pm_debug_show()
665 pci_priv = plat_priv->bus_priv; in cnss_runtime_pm_debug_show()
717 static int process_drv(struct cnss_plat_data *plat_priv, bool enabled) in process_drv() argument
719 if (test_bit(CNSS_QMI_WLFW_CONNECTED, &plat_priv->driver_state)) { in process_drv()
724 enabled ? cnss_set_feature_list(plat_priv, CNSS_DRV_SUPPORT_V01) : in process_drv()
725 cnss_clear_feature_list(plat_priv, CNSS_DRV_SUPPORT_V01); in process_drv()
731 static int process_quirks(struct cnss_plat_data *plat_priv, u32 val) in process_quirks() argument
741 ret = process_drv(plat_priv, !(state & 0x1)); in process_quirks()
751 plat_priv->ctrl_params.quirks = quirks; in process_quirks()
759 struct cnss_plat_data *plat_priv = in cnss_control_params_debug_write() local
768 if (!plat_priv) in cnss_control_params_debug_write()
792 process_quirks(plat_priv, val); in cnss_control_params_debug_write()
794 plat_priv->ctrl_params.mhi_timeout = val; in cnss_control_params_debug_write()
796 plat_priv->ctrl_params.mhi_m2_timeout = val; in cnss_control_params_debug_write()
798 plat_priv->ctrl_params.qmi_timeout = val; in cnss_control_params_debug_write()
800 plat_priv->ctrl_params.bdf_type = val; in cnss_control_params_debug_write()
802 plat_priv->ctrl_params.time_sync_period = val; in cnss_control_params_debug_write()
815 struct cnss_plat_data *plat_priv) in cnss_show_quirks_state() argument
821 seq_printf(s, "quirks: 0x%lx (", plat_priv->ctrl_params.quirks); in cnss_show_quirks_state()
822 for (i = 0, state = plat_priv->ctrl_params.quirks; in cnss_show_quirks_state()
930 struct cnss_plat_data *plat_priv = in cnss_dynamic_feature_write() local
939 plat_priv->dynamic_feature = val; in cnss_dynamic_feature_write()
940 ret = cnss_wlfw_dynamic_feature_mask_send_sync(plat_priv); in cnss_dynamic_feature_write()
973 struct cnss_plat_data *plat_priv = s->private; in cnss_smmu_fault_timestamp_show() local
974 struct cnss_pci_data *pci_priv = plat_priv->bus_priv; in cnss_smmu_fault_timestamp_show()
1006 static int cnss_create_debug_only_node(struct cnss_plat_data *plat_priv) in cnss_create_debug_only_node() argument
1008 struct dentry *root_dentry = plat_priv->root_dentry; in cnss_create_debug_only_node()
1010 debugfs_create_file("dev_boot", 0600, root_dentry, plat_priv, in cnss_create_debug_only_node()
1012 debugfs_create_file("reg_read", 0600, root_dentry, plat_priv, in cnss_create_debug_only_node()
1014 debugfs_create_file("reg_write", 0600, root_dentry, plat_priv, in cnss_create_debug_only_node()
1016 debugfs_create_file("runtime_pm", 0600, root_dentry, plat_priv, in cnss_create_debug_only_node()
1018 debugfs_create_file("control_params", 0600, root_dentry, plat_priv, in cnss_create_debug_only_node()
1020 debugfs_create_file("dynamic_feature", 0600, root_dentry, plat_priv, in cnss_create_debug_only_node()
1023 plat_priv, &cnss_smmu_fault_timestamp_fops); in cnss_create_debug_only_node()
1028 static int cnss_create_debug_only_node(struct cnss_plat_data *plat_priv) in cnss_create_debug_only_node() argument
1034 int cnss_debugfs_create(struct cnss_plat_data *plat_priv) in cnss_debugfs_create() argument
1042 plat_priv->plat_idx); in cnss_debugfs_create()
1053 plat_priv->root_dentry = root_dentry; in cnss_debugfs_create()
1055 debugfs_create_file("pin_connect_result", 0644, root_dentry, plat_priv, in cnss_debugfs_create()
1057 debugfs_create_file("stats", 0644, root_dentry, plat_priv, in cnss_debugfs_create()
1060 cnss_create_debug_only_node(plat_priv); in cnss_debugfs_create()
1066 void cnss_debugfs_destroy(struct cnss_plat_data *plat_priv) in cnss_debugfs_destroy() argument
1068 debugfs_remove_recursive(plat_priv->root_dentry); in cnss_debugfs_destroy()
1071 int cnss_debugfs_create(struct cnss_plat_data *plat_priv) in cnss_debugfs_create() argument
1073 plat_priv->root_dentry = NULL; in cnss_debugfs_create()
1077 void cnss_debugfs_destroy(struct cnss_plat_data *plat_priv) in cnss_debugfs_destroy() argument