return 0;
}
+static bool ath10k_mac_should_disable_promisc(struct ath10k *ar)
+{
+ struct ath10k_vif *arvif;
+
+ if (!(ar->filter_flags & FIF_PROMISC_IN_BSS))
+ return true;
+
+ if (!ar->num_started_vdevs)
+ return false;
+
+ list_for_each_entry(arvif, &ar->arvifs, list)
+ if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
+ return false;
+
+ ath10k_dbg(ar, ATH10K_DBG_MAC,
+ "mac disabling promiscuous mode because vdev is started\n");
+ return true;
+}
+
static int ath10k_monitor_recalc(struct ath10k *ar)
{
bool should_start;
lockdep_assert_held(&ar->conf_mutex);
should_start = ar->monitor ||
- ar->filter_flags & FIF_PROMISC_IN_BSS ||
+ !ath10k_mac_should_disable_promisc(ar);
test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags);
ath10k_dbg(ar, ATH10K_DBG_MAC,
struct ath10k *ar = arvif->ar;
struct cfg80211_chan_def *chandef = &ar->chandef;
struct wmi_vdev_start_request_arg arg = {};
- int ret = 0;
+ int ret = 0, ret2;
lockdep_assert_held(&ar->conf_mutex);
ar->num_started_vdevs++;
ath10k_recalc_radar_detection(ar);
+ ret = ath10k_monitor_recalc(ar);
+ if (ret) {
+ ath10k_warn(ar, "mac failed to recalc monitor for vdev %i restart %d: %d\n",
+ arg.vdev_id, restart, ret);
+ ret2 = ath10k_vdev_stop(arvif);
+ if (ret2)
+ ath10k_warn(ar, "mac failed to stop vdev %i restart %d: %d\n",
+ arg.vdev_id, restart, ret2);
+ }
+
return ret;
}