Commit ef030ab1 authored by Avraham Stern's avatar Avraham Stern Committed by Johannes Berg

wifi: iwlmei: don't send SAP messages if AMT is disabled

SAP messages should not be sent when AMT is disabled.
Signed-off-by: default avatarAvraham Stern <avraham.stern@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230822103048.db16b55c27c1.I48834c14f5af8d31792f5048b3023509cba191dd@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 057381dd
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
*/ */
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
...@@ -1532,7 +1532,7 @@ void iwl_mei_host_associated(const struct iwl_mei_conn_info *conn_info, ...@@ -1532,7 +1532,7 @@ void iwl_mei_host_associated(const struct iwl_mei_conn_info *conn_info,
mei = mei_cldev_get_drvdata(iwl_mei_global_cldev); mei = mei_cldev_get_drvdata(iwl_mei_global_cldev);
if (!mei && !mei->amt_enabled) if (!mei || !mei->amt_enabled)
goto out; goto out;
iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr);
...@@ -1561,7 +1561,7 @@ void iwl_mei_host_disassociated(void) ...@@ -1561,7 +1561,7 @@ void iwl_mei_host_disassociated(void)
mei = mei_cldev_get_drvdata(iwl_mei_global_cldev); mei = mei_cldev_get_drvdata(iwl_mei_global_cldev);
if (!mei && !mei->amt_enabled) if (!mei || !mei->amt_enabled)
goto out; goto out;
iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr);
...@@ -1597,7 +1597,7 @@ void iwl_mei_set_rfkill_state(bool hw_rfkill, bool sw_rfkill) ...@@ -1597,7 +1597,7 @@ void iwl_mei_set_rfkill_state(bool hw_rfkill, bool sw_rfkill)
mei = mei_cldev_get_drvdata(iwl_mei_global_cldev); mei = mei_cldev_get_drvdata(iwl_mei_global_cldev);
if (!mei && !mei->amt_enabled) if (!mei || !mei->amt_enabled)
goto out; goto out;
iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr);
...@@ -1626,7 +1626,7 @@ void iwl_mei_set_nic_info(const u8 *mac_address, const u8 *nvm_address) ...@@ -1626,7 +1626,7 @@ void iwl_mei_set_nic_info(const u8 *mac_address, const u8 *nvm_address)
mei = mei_cldev_get_drvdata(iwl_mei_global_cldev); mei = mei_cldev_get_drvdata(iwl_mei_global_cldev);
if (!mei && !mei->amt_enabled) if (!mei || !mei->amt_enabled)
goto out; goto out;
iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr);
...@@ -1654,7 +1654,7 @@ void iwl_mei_set_country_code(u16 mcc) ...@@ -1654,7 +1654,7 @@ void iwl_mei_set_country_code(u16 mcc)
mei = mei_cldev_get_drvdata(iwl_mei_global_cldev); mei = mei_cldev_get_drvdata(iwl_mei_global_cldev);
if (!mei && !mei->amt_enabled) if (!mei || !mei->amt_enabled)
goto out; goto out;
iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr);
...@@ -1680,7 +1680,7 @@ void iwl_mei_set_power_limit(const __le16 *power_limit) ...@@ -1680,7 +1680,7 @@ void iwl_mei_set_power_limit(const __le16 *power_limit)
mei = mei_cldev_get_drvdata(iwl_mei_global_cldev); mei = mei_cldev_get_drvdata(iwl_mei_global_cldev);
if (!mei && !mei->amt_enabled) if (!mei || !mei->amt_enabled)
goto out; goto out;
memcpy(msg.sar_chain_info_table, power_limit, sizeof(msg.sar_chain_info_table)); memcpy(msg.sar_chain_info_table, power_limit, sizeof(msg.sar_chain_info_table));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment