Lines Matching refs:ar

1421 static u32 ath10k_coredump_get_ramdump_size(struct ath10k *ar)
1428 hw = ath10k_coredump_get_mem_layout(ar);
1449 const struct ath10k_hw_mem_layout *ath10k_coredump_get_mem_layout(struct ath10k *ar)
1454 return _ath10k_coredump_get_mem_layout(ar);
1458 const struct ath10k_hw_mem_layout *_ath10k_coredump_get_mem_layout(struct ath10k *ar)
1462 if (WARN_ON(ar->target_version == 0))
1466 if (ar->target_version == hw_mem_layouts[i].hw_id &&
1467 ar->hw_rev == hw_mem_layouts[i].hw_rev &&
1468 hw_mem_layouts[i].bus == ar->hif.bus)
1475 struct ath10k_fw_crash_data *ath10k_coredump_new(struct ath10k *ar)
1477 struct ath10k_fw_crash_data *crash_data = ar->coredump.fw_crash_data;
1479 lockdep_assert_held(&ar->dump_mutex);
1492 static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar)
1494 struct ath10k_fw_crash_data *crash_data = ar->coredump.fw_crash_data;
1523 mutex_lock(&ar->dump_mutex);
1533 dump_data->chip_id = cpu_to_le32(ar->bus_param.chip_id);
1535 dump_data->target_version = cpu_to_le32(ar->target_version);
1536 dump_data->fw_version_major = cpu_to_le32(ar->fw_version_major);
1537 dump_data->fw_version_minor = cpu_to_le32(ar->fw_version_minor);
1538 dump_data->fw_version_release = cpu_to_le32(ar->fw_version_release);
1539 dump_data->fw_version_build = cpu_to_le32(ar->fw_version_build);
1540 dump_data->phy_capability = cpu_to_le32(ar->phy_capability);
1541 dump_data->hw_min_tx_power = cpu_to_le32(ar->hw_min_tx_power);
1542 dump_data->hw_max_tx_power = cpu_to_le32(ar->hw_max_tx_power);
1543 dump_data->ht_cap_info = cpu_to_le32(ar->ht_cap_info);
1544 dump_data->vht_cap_info = cpu_to_le32(ar->vht_cap_info);
1545 dump_data->num_rf_chains = cpu_to_le32(ar->num_rf_chains);
1547 strscpy(dump_data->fw_ver, ar->hw->wiphy->fw_version,
1592 mutex_unlock(&ar->dump_mutex);
1597 int ath10k_coredump_submit(struct ath10k *ar)
1605 dump = ath10k_coredump_build(ar);
1607 ath10k_warn(ar, "no crash dump data found for devcoredump");
1611 dev_coredumpv(ar->dev, dump, le32_to_cpu(dump->len), GFP_KERNEL);
1616 int ath10k_coredump_create(struct ath10k *ar)
1622 ar->coredump.fw_crash_data = vzalloc(sizeof(*ar->coredump.fw_crash_data));
1623 if (!ar->coredump.fw_crash_data)
1629 int ath10k_coredump_register(struct ath10k *ar)
1631 struct ath10k_fw_crash_data *crash_data = ar->coredump.fw_crash_data;
1634 crash_data->ramdump_buf_len = ath10k_coredump_get_ramdump_size(ar);
1647 void ath10k_coredump_unregister(struct ath10k *ar)
1649 struct ath10k_fw_crash_data *crash_data = ar->coredump.fw_crash_data;
1654 void ath10k_coredump_destroy(struct ath10k *ar)
1656 if (ar->coredump.fw_crash_data->ramdump_buf) {
1657 vfree(ar->coredump.fw_crash_data->ramdump_buf);
1658 ar->coredump.fw_crash_data->ramdump_buf = NULL;
1659 ar->coredump.fw_crash_data->ramdump_buf_len = 0;
1662 vfree(ar->coredump.fw_crash_data);
1663 ar->coredump.fw_crash_data = NULL;