Files
linux-nv-oot/drivers/net/wireless/realtek/rtl8852ce/phl/phl_diagnose.c
Shobek Attupurath 7dd632ff96 rtl8852ce: Add base driver v1.19.16.1-0-g1fe335ba1.20240815_PC
- support Android-14
- support Linux kernel 6.9
- support 6G regulation
- support Thermal protection
- support TX shortcut to reduce CPU loading
- fix some coverity issues
- Use RTW regulatory version rtk_8852CE_M.2_2230-67-52
- default enable con-current and MCC

Bug 4667769
Bug 4667981

Change-Id: Iee069ecdd1f00a0b78285d0a4ef5778ed9ace478
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3195601
Tested-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
2025-07-24 10:19:08 +00:00

92 lines
2.1 KiB
C

/*
* This module is designed to collect internal diagnostic information.
*
* Author: Cosa
* History: Created at 2023/02/03
*/
#define _PHL_DIAGNOSE_C_
#include "phl_headers.h"
#ifdef CONFIG_PHL_DIAGNOSE
static void _diag_evt_done(void* priv, struct phl_msg* msg)
{
struct phl_info_t *phl_info = (struct phl_info_t *)priv;
if (msg->inbuf && msg->inlen) {
_os_kmem_free(phl_to_drvpriv(phl_info),
msg->inbuf, msg->inlen);
}
}
bool phl_send_diag_hub_msg(void *phl, u16 phl_evt, u8 sub_evt,
u8 level, u8 ver, u8 *buf, u32 len)
{
struct phl_msg msg = {0};
struct phl_msg_attribute attr = {0};
struct rtw_phl_diag_msg *dmsg = NULL;
struct phl_info_t *phl_info = (struct phl_info_t *)phl;
void *d = NULL;
if (!phl_info || !buf)
return false;
if ((phl_evt >= PHL_DIAG_EVT_MAX) ||(level >= PHL_DIAG_LVL_MAX) ||
(len > MAX_PHL_DIAG_MSG_LEN) || !phl_info) {
return false;
}
d = phl_to_drvpriv(phl_info);
if (!d)
return false;
dmsg = (struct rtw_phl_diag_msg *)_os_kmem_alloc(
d, sizeof(struct rtw_phl_diag_msg));
if (!dmsg)
return false;
SET_MSG_MDL_ID_FIELD(msg.msg_id, PHL_MDL_GENERAL);
SET_MSG_EVT_ID_FIELD(msg.msg_id, MSG_EVT_DIAGNOSTIC);
dmsg->type = phl_evt;
dmsg->level = level;
if (phl_evt == PHL_DIAG_EVT_MAC || phl_evt == PHL_DIAG_EVT_BB ||
phl_evt == PHL_DIAG_EVT_RF) {
dmsg->sub_evt = sub_evt;
} else {
dmsg->sub_evt = INVALID_SUBMODULE_DIAG_EVT;
}
dmsg->ver = ver;
dmsg->len = len;
_os_mem_cpy(d, dmsg->buf, buf, len);
msg.inbuf = (u8 *)dmsg;
msg.inlen = sizeof(struct rtw_phl_diag_msg);
attr.completion.completion = _diag_evt_done;
attr.completion.priv = phl_info;
if (phl_msg_hub_send(phl_info, &attr, &msg) != RTW_PHL_STATUS_SUCCESS) {
_os_kmem_free(d, dmsg, sizeof(struct rtw_phl_diag_msg));
return false;
} else {
return true;
}
}
bool rtw_phl_send_diag_hub_msg(struct rtw_phl_com_t *phl_com,
u16 phl_evt, u8 sub_evt, u8 level, u8 ver, u8 *buf, u32 len)
{
struct phl_info_t *phl = NULL;
if (!phl_com || !buf)
return false;
phl = phl_com->phl_priv;
return phl_send_diag_hub_msg(phl, phl_evt, sub_evt, level, ver, buf, len);
}
#endif