diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2013-10-16 09:45:48 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-10-21 09:41:18 -0400 |
commit | 0ed00eea0961db3a007cbca727e3dd54e4bfd05f (patch) | |
tree | de99fe5dc8e91c8bf524351798707e1917d524c9 | |
parent | afd0922e7478ce3e4ea5812835164fe4e2a12896 (diff) |
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>
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 527343de5738..da23c3faaf5a 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -516,6 +516,11 @@ static int ath10k_monitor_start(struct ath10k *ar, int vdev_id) | |||
516 | 516 | ||
517 | lockdep_assert_held(&ar->conf_mutex); | 517 | lockdep_assert_held(&ar->conf_mutex); |
518 | 518 | ||
519 | if (!ar->monitor_present) { | ||
520 | ath10k_warn("mac montor stop -- monitor is not present\n"); | ||
521 | return -EINVAL; | ||
522 | } | ||
523 | |||
519 | arg.vdev_id = vdev_id; | 524 | arg.vdev_id = vdev_id; |
520 | arg.channel.freq = channel->center_freq; | 525 | arg.channel.freq = channel->center_freq; |
521 | arg.channel.band_center_freq1 = ar->hw->conf.chandef.center_freq1; | 526 | arg.channel.band_center_freq1 = ar->hw->conf.chandef.center_freq1; |
@@ -566,6 +571,16 @@ static int ath10k_monitor_stop(struct ath10k *ar) | |||
566 | 571 | ||
567 | lockdep_assert_held(&ar->conf_mutex); | 572 | lockdep_assert_held(&ar->conf_mutex); |
568 | 573 | ||
574 | if (!ar->monitor_present) { | ||
575 | ath10k_warn("mac montor stop -- monitor is not present\n"); | ||
576 | return -EINVAL; | ||
577 | } | ||
578 | |||
579 | if (!ar->monitor_enabled) { | ||
580 | ath10k_warn("mac montor stop -- monitor is not enabled\n"); | ||
581 | return -EINVAL; | ||
582 | } | ||
583 | |||
569 | ret = ath10k_wmi_vdev_down(ar, ar->monitor_vdev_id); | 584 | ret = ath10k_wmi_vdev_down(ar, ar->monitor_vdev_id); |
570 | if (ret) | 585 | if (ret) |
571 | ath10k_warn("Monitor vdev down failed: %d\n", ret); | 586 | ath10k_warn("Monitor vdev down failed: %d\n", ret); |