From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: <ath10k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] ath10k: add support for AP CSA
Date: Fri, 17 Jan 2014 14:57:42 +0200 [thread overview]
Message-ID: <87lhyercjd.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1389345563-3445-1-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Fri, 10 Jan 2014 10:19:23 +0100")
Michal Kazior <michal.kazior@tieto.com> writes:
> This patch implements Channel Switch Announcement
> for AP mode. This allows for a smooth channel
> switch for connected stations that support CSA
> when radar is detected.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
[...]
> --- a/drivers/net/wireless/ath/ath10k/core.h
> +++ b/drivers/net/wireless/ath/ath10k/core.h
> @@ -414,6 +414,7 @@ struct ath10k {
> unsigned int filter_flags;
> unsigned long dev_flags;
> u32 dfs_block_radar_events;
> + struct ath10k_vif *csa_arvif;
Please document how this is serialised.
> +static void ath10k_mac_update_ap_channel(struct ath10k_vif *arvif)
> +{
Please change this function to return the error code.
> + const u8 *bssid = arvif->vif->bss_conf.bssid;
> + int ret;
> +
> + ath10k_dbg(ATH10K_DBG_MAC, "mac AP channel update %dMHz\n",
> + arvif->ar->hw->conf.chandef.chan->center_freq);
> +
> + ret = ath10k_vdev_stop(arvif);
> + if (ret) {
> + ath10k_warn("could not stop vdev %d (%d)\n",
> + arvif->vdev_id, ret);
> + return;
> + }
> +
> + ret = ath10k_vdev_start(arvif);
> + if (ret) {
> + ath10k_warn("could not start vdev %d (%d)\n",
> + arvif->vdev_id, ret);
> + return;
> + }
> +
> + ret = ath10k_wmi_vdev_up(arvif->ar, arvif->vdev_id, 0, bssid);
> + if (ret) {
> + ath10k_warn("could not bring vdev up %d (%d)\n",
> + arvif->vdev_id, ret);
> + return;
> + }
For warning and error messages please use style:
"could not bring vdev up %d: %d\n"
> @@ -2156,6 +2185,9 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 changed)
> spin_unlock_bh(&ar->data_lock);
>
> ath10k_config_radar_detection(ar);
> +
> + if (ar->csa_arvif && ar->csa_arvif->vif->csa_active)
> + ath10k_mac_update_ap_channel(ar->csa_arvif);
Check the error message here, print a warning and return if there's an
error. But should we return 0 or the error code, that I do not know.
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -558,6 +558,22 @@ err_pull:
> return ret;
> }
>
> +static void ath10k_update_csa(struct ath10k_vif *arvif)
> +{
> + lockdep_assert_held(&arvif->ar->data_lock);
> +
> + if (arvif->ar->csa_arvif != arvif)
> + return;
> +
> + if (!arvif->vif->csa_active)
> + return;
> +
> + if (!ieee80211_csa_is_complete(arvif->vif))
> + return;
> +
> + ieee80211_csa_finish(arvif->vif);
> +}
For consistency I would prefer that all functions return an error code,
but I guess that would not make any sense here. Does it?
--
Kalle Valo
next prev parent reply other threads:[~2014-01-17 12:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 9:19 [PATCH] ath10k: add support for AP CSA Michal Kazior
2014-01-10 10:22 ` Kalle Valo
2014-01-10 12:36 ` Michal Kazior
2014-01-17 12:57 ` Kalle Valo [this message]
2014-01-17 13:46 ` Michal Kazior
2014-01-17 15:15 ` Kalle Valo
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=87lhyercjd.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.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