Commit e1e275a6 authored by Karthikeyan Periyasamy's avatar Karthikeyan Periyasamy Committed by Kalle Valo

wifi: ath12k: refactor ath12k_mac_op_start()

To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback start(). This way, the callback can be
extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
Signed-off-by: default avatarKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240103063731.3356060-5-quic_periyasa@quicinc.com
parent 00c9b1a6
......@@ -5081,14 +5081,12 @@ static void ath12k_mac_wait_reconfigure(struct ath12k_base *ab)
ATH12K_RECONFIGURE_TIMEOUT_HZ);
}
static int ath12k_mac_op_start(struct ieee80211_hw *hw)
static int ath12k_mac_start(struct ath12k *ar)
{
struct ath12k *ar = hw->priv;
struct ath12k_base *ab = ar->ab;
struct ath12k_pdev *pdev = ar->pdev;
int ret;
ath12k_mac_drain_tx(ar);
mutex_lock(&ar->conf_mutex);
switch (ar->state) {
......@@ -5111,14 +5109,14 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
1, pdev->pdev_id);
if (ret) {
ath12k_err(ar->ab, "failed to enable PMF QOS: (%d\n", ret);
ath12k_err(ab, "failed to enable PMF QOS: (%d\n", ret);
goto err;
}
ret = ath12k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_DYNAMIC_BW, 1,
pdev->pdev_id);
if (ret) {
ath12k_err(ar->ab, "failed to enable dynamic bw: %d\n", ret);
ath12k_err(ab, "failed to enable dynamic bw: %d\n", ret);
goto err;
}
......@@ -5148,7 +5146,7 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
1, pdev->pdev_id);
if (ret) {
ath12k_err(ar->ab, "failed to enable MESH MCAST ENABLE: (%d\n", ret);
ath12k_err(ab, "failed to enable MESH MCAST ENABLE: (%d\n", ret);
goto err;
}
......@@ -5174,7 +5172,7 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
}
if (ret == -ENOTSUPP)
ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
ath12k_dbg(ab, ATH12K_DBG_MAC,
"monitor status config is not yet supported");
/* Configure the hash seed for hash based reo dest ring selection */
......@@ -5196,7 +5194,6 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
&ab->pdevs[ar->pdev_idx]);
return 0;
err:
ar->state = ATH12K_STATE_OFF;
mutex_unlock(&ar->conf_mutex);
......@@ -5204,6 +5201,24 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
return ret;
}
static int ath12k_mac_op_start(struct ieee80211_hw *hw)
{
struct ath12k *ar = hw->priv;
struct ath12k_base *ab = ar->ab;
int ret;
ath12k_mac_drain_tx(ar);
ret = ath12k_mac_start(ar);
if (ret) {
ath12k_err(ab, "fail to start mac operations in pdev idx %d ret %d\n",
ar->pdev_idx, ret);
return ret;
}
return 0;
}
int ath12k_mac_rfkill_config(struct ath12k *ar)
{
struct ath12k_base *ab = ar->ab;
......
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