diff options
author | Tzahi Sabo <stzahi@codeaurora.org> | 2019-06-16 10:26:05 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-06-27 20:50:46 +0300 |
commit | 9b586118730e1b86dc3c8d8523effc712c5a2bfc (patch) | |
tree | d367f3e4b2f44e07ec9a56e1983337b6195f662f /drivers/net/wireless/ath/wil6210/wmi.c | |
parent | 3e7ee09d36a68a57721916899075396f7ed35a46 (diff) | |
download | linux-9b586118730e1b86dc3c8d8523effc712c5a2bfc.tar.xz |
wil6210: add support for reading multiple RFs temperature via debugfs
Base-band chips support multi RFs chips. Add support for reading
multiple RFs temperature via debugfs.
Signed-off-by: Tzahi Sabo <stzahi@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/wmi.c')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index cacafaba5007..5d7eb521281c 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -486,6 +486,8 @@ static const char *cmdid2name(u16 cmdid) return "WMI_UPDATE_FT_IES_CMD"; case WMI_RBUFCAP_CFG_CMDID: return "WMI_RBUFCAP_CFG_CMD"; + case WMI_TEMP_SENSE_ALL_CMDID: + return "WMI_TEMP_SENSE_ALL_CMDID"; default: return "Untracked CMD"; } @@ -632,6 +634,8 @@ static const char *eventid2name(u16 eventid) return "WMI_FT_REASSOC_STATUS_EVENT"; case WMI_RBUFCAP_CFG_EVENTID: return "WMI_RBUFCAP_CFG_EVENT"; + case WMI_TEMP_SENSE_ALL_DONE_EVENTID: + return "WMI_TEMP_SENSE_ALL_DONE_EVENTID"; default: return "Untracked EVENT"; } @@ -2648,6 +2652,44 @@ int wmi_get_temperature(struct wil6210_priv *wil, u32 *t_bb, u32 *t_rf) return 0; } +int wmi_get_all_temperatures(struct wil6210_priv *wil, + struct wmi_temp_sense_all_done_event + *sense_all_evt) +{ + struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev); + int rc; + struct wmi_temp_sense_all_cmd cmd = { + .measure_baseband_en = true, + .measure_rf_en = true, + .measure_mode = TEMPERATURE_MEASURE_NOW, + }; + struct { + struct wmi_cmd_hdr wmi; + struct wmi_temp_sense_all_done_event evt; + } __packed reply; + + if (!sense_all_evt) { + wil_err(wil, "Invalid sense_all_evt value\n"); + return -EINVAL; + } + + memset(&reply, 0, sizeof(reply)); + reply.evt.status = WMI_FW_STATUS_FAILURE; + rc = wmi_call(wil, WMI_TEMP_SENSE_ALL_CMDID, vif->mid, &cmd, + sizeof(cmd), WMI_TEMP_SENSE_ALL_DONE_EVENTID, + &reply, sizeof(reply), WIL_WMI_CALL_GENERAL_TO_MS); + if (rc) + return rc; + + if (reply.evt.status == WMI_FW_STATUS_FAILURE) { + wil_err(wil, "Failed geting TEMP_SENSE_ALL\n"); + return -EINVAL; + } + + memcpy(sense_all_evt, &reply.evt, sizeof(reply.evt)); + return 0; +} + int wmi_disconnect_sta(struct wil6210_vif *vif, const u8 *mac, u16 reason, bool del_sta) { |