|
@@ -331,6 +331,9 @@ static const char *hif_get_hw_name(struct hif_target_info *info)
|
|
|
{
|
|
|
int i;
|
|
|
|
|
|
+ if (info->hw_name)
|
|
|
+ return info->hw_name;
|
|
|
+
|
|
|
for (i = 0; i < ARRAY_SIZE(qwlan_hw_list); i++) {
|
|
|
if (info->target_version == qwlan_hw_list[i].id &&
|
|
|
info->target_revision == qwlan_hw_list[i].subid) {
|
|
@@ -338,7 +341,16 @@ static const char *hif_get_hw_name(struct hif_target_info *info)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return "Unknown Device";
|
|
|
+ info->hw_name = qdf_mem_malloc(64);
|
|
|
+ if (!info->hw_name)
|
|
|
+ return "Unknown Device (nomem)";
|
|
|
+
|
|
|
+ i = qdf_snprint(info->hw_name, 64, "HW_VERSION=%x.",
|
|
|
+ info->target_version);
|
|
|
+ if (i < 0)
|
|
|
+ return "Unknown Device (snprintf failure)";
|
|
|
+ else
|
|
|
+ return info->hw_name;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -449,6 +461,12 @@ void hif_close(struct hif_opaque_softc *hif_ctx)
|
|
|
scn->athdiag_procfs_inited = false;
|
|
|
}
|
|
|
|
|
|
+ if (scn->target_info.hw_name) {
|
|
|
+ char *hw_name = scn->target_info.hw_name;
|
|
|
+ scn->target_info.hw_name = "ErrUnloading";
|
|
|
+ qdf_mem_free(hw_name);
|
|
|
+ }
|
|
|
+
|
|
|
hif_bus_close(scn);
|
|
|
qdf_mem_free(scn);
|
|
|
}
|