cnss2: Provide platform name if it is required

Provide platform name in host_cap message if
property platform-name-required specified in DTS.

Current platform name is same as device's model name.

Change-id: I8d427602bfc7e6bb5d732fa3e29ff66c965e153b
CRs-Fixed: 3540641
This commit is contained in:
Lin Bai
2023-06-26 17:43:09 +08:00
committed by Rahul Choudhary
父節點 bdd3c6bf67
當前提交 02c2d4f750
共有 3 個文件被更改,包括 36 次插入0 次删除

查看文件

@@ -467,6 +467,35 @@ int cnss_get_feature_list(struct cnss_plat_data *plat_priv,
return 0;
}
size_t cnss_get_platform_name(struct cnss_plat_data *plat_priv,
char *buf, const size_t buf_len)
{
if (unlikely(!plat_priv || !buf || !buf_len))
return 0;
if (of_property_read_bool(plat_priv->plat_dev->dev.of_node,
"platform-name-required")) {
struct device_node *root;
root = of_find_node_by_path("/");
if (root) {
const char *model;
size_t model_len;
model = of_get_property(root, "model", NULL);
if (model) {
model_len = strlcpy(buf, model, buf_len);
cnss_pr_dbg("Platform name: %s (%zu)\n",
buf, model_len);
return model_len;
}
}
}
return 0;
}
void cnss_pm_stay_awake(struct cnss_plat_data *plat_priv)
{
if (atomic_inc_return(&plat_priv->pm_count) != 1)