ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Subject: Re: [PATCH] ath10k: don't allow stand alone monitor mode for non-AP firmware
Date: Thu, 24 Apr 2014 11:22:39 +0300	[thread overview]
Message-ID: <87d2g7m90w.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1398327250-12923-1-git-send-email-yeohchunyeow@gmail.com> (Chun-Yeow Yeoh's message of "Thu, 24 Apr 2014 16:14:10 +0800")

Chun-Yeow Yeoh <yeohchunyeow@gmail.com> writes:

> Firmware 999.999.0.636 does not allow stand alone monitor
> mode. This means that bridging the STA mode and put it into
> promiscuous mode will also cause the firmware to crash. Avoid
> this.
>
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>

[...]

> @@ -647,10 +647,15 @@ static int ath10k_monitor_vdev_delete(struct ath10k *ar)
>  
>  static int ath10k_monitor_start(struct ath10k *ar)
>  {
> -	int ret;
> +	int ret = -1;

I prefer to avoid initialising ret variables. And -1 is not a proper
error value.

>  	lockdep_assert_held(&ar->conf_mutex);
>  
> +	if (ar->fw_version_build == 636) {

Checking for firmware version in ath10k is a big no. For a functinality
change like this you should add a new feature flag to enum
ath10k_fw_features (and I need to then recreate the firmware image).

> +		ath10k_warn("stand alone monitor mode is not supported\n");

I would prefer not to print a warning for a situation like this. Can't
we instead return an error value back to the caller?

> +		return ret;

return -EOPNOTSUPP or similar is better approach than initialising ret
to -1.

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  reply	other threads:[~2014-04-24  8:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24  8:14 [PATCH] ath10k: don't allow stand alone monitor mode for non-AP firmware Chun-Yeow Yeoh
2014-04-24  8:22 ` Kalle Valo [this message]
2014-04-24  8:40   ` Yeoh Chun-Yeow
2014-04-24  8:45     ` Kalle Valo
2014-04-24  9:19       ` Yeoh Chun-Yeow
2014-04-24  9:46         ` Kalle Valo
2014-04-24 10:14           ` Yeoh Chun-Yeow
2014-04-24  8:44 ` Michal Kazior
2014-04-24  8:50   ` Johannes Berg
2014-04-24  9:04     ` Michal Kazior
2014-04-24  8:50   ` Yeoh Chun-Yeow
2014-04-24  8:53     ` Michal Kazior
2014-04-24  9:09       ` Yeoh Chun-Yeow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d2g7m90w.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=yeohchunyeow@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox