wifi: ath12k: refactor ath12k_mac_op_configure_filter()
authorKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
Sun, 14 Jan 2024 15:02:41 +0000 (17:02 +0200)
committerKalle Valo <quic_kvalo@quicinc.com>
Tue, 16 Jan 2024 12:21:36 +0000 (14:21 +0200)
To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback configure_filter(). 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: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240103063731.3356060-8-quic_periyasa@quicinc.com
drivers/net/wireless/ath/ath12k/mac.c

index bc6746abebf0b4189e4c4239cc16f6c8d8f3b840..ef9e3558f5eb93fee5628dd4796951bd0a42b7ab 100644 (file)
@@ -5831,19 +5831,15 @@ err_vdev_del:
        FIF_PROBE_REQ |                         \
        FIF_FCSFAIL)
 
-static void ath12k_mac_op_configure_filter(struct ieee80211_hw *hw,
-                                          unsigned int changed_flags,
-                                          unsigned int *total_flags,
-                                          u64 multicast)
+static void ath12k_mac_configure_filter(struct ath12k *ar,
+                                       unsigned int total_flags)
 {
-       struct ath12k *ar = hw->priv;
        bool reset_flag;
        int ret;
 
-       mutex_lock(&ar->conf_mutex);
+       lockdep_assert_held(&ar->conf_mutex);
 
-       *total_flags &= SUPPORTED_FILTERS;
-       ar->filter_flags = *total_flags;
+       ar->filter_flags = total_flags;
 
        /* For monitor mode */
        reset_flag = !(ar->filter_flags & FIF_BCN_PRBRESP_PROMISC);
@@ -5858,9 +5854,23 @@ static void ath12k_mac_op_configure_filter(struct ieee80211_hw *hw,
                ath12k_warn(ar->ab,
                            "fail to set monitor filter: %d\n", ret);
        }
+
        ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
                   "total_flags:0x%x, reset_flag:%d\n",
-                  *total_flags, reset_flag);
+                  total_flags, reset_flag);
+}
+
+static void ath12k_mac_op_configure_filter(struct ieee80211_hw *hw,
+                                          unsigned int changed_flags,
+                                          unsigned int *total_flags,
+                                          u64 multicast)
+{
+       struct ath12k *ar = hw->priv;
+
+       mutex_lock(&ar->conf_mutex);
+
+       *total_flags &= SUPPORTED_FILTERS;
+       ath12k_mac_configure_filter(ar, *total_flags);
 
        mutex_unlock(&ar->conf_mutex);
 }