ath10k: add sanity checks for monitor management
Add a few checks and warnings to make it easier to track any kind of monitor vdev mismanagement. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
parent
afd0922e74
commit
0ed00eea09
@ -516,6 +516,11 @@ static int ath10k_monitor_start(struct ath10k *ar, int vdev_id)
|
|||||||
|
|
||||||
lockdep_assert_held(&ar->conf_mutex);
|
lockdep_assert_held(&ar->conf_mutex);
|
||||||
|
|
||||||
|
if (!ar->monitor_present) {
|
||||||
|
ath10k_warn("mac montor stop -- monitor is not present\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
arg.vdev_id = vdev_id;
|
arg.vdev_id = vdev_id;
|
||||||
arg.channel.freq = channel->center_freq;
|
arg.channel.freq = channel->center_freq;
|
||||||
arg.channel.band_center_freq1 = ar->hw->conf.chandef.center_freq1;
|
arg.channel.band_center_freq1 = ar->hw->conf.chandef.center_freq1;
|
||||||
@ -566,6 +571,16 @@ static int ath10k_monitor_stop(struct ath10k *ar)
|
|||||||
|
|
||||||
lockdep_assert_held(&ar->conf_mutex);
|
lockdep_assert_held(&ar->conf_mutex);
|
||||||
|
|
||||||
|
if (!ar->monitor_present) {
|
||||||
|
ath10k_warn("mac montor stop -- monitor is not present\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ar->monitor_enabled) {
|
||||||
|
ath10k_warn("mac montor stop -- monitor is not enabled\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
ret = ath10k_wmi_vdev_down(ar, ar->monitor_vdev_id);
|
ret = ath10k_wmi_vdev_down(ar, ar->monitor_vdev_id);
|
||||||
if (ret)
|
if (ret)
|
||||||
ath10k_warn("Monitor vdev down failed: %d\n", ret);
|
ath10k_warn("Monitor vdev down failed: %d\n", ret);
|
||||||
|
Loading…
Reference in New Issue
Block a user