linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 v2 2/3] ath10k: implement sta_rc_update()
Date: Wed, 27 Nov 2013 17:03:41 +0200	[thread overview]
Message-ID: <87li09ga42.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1385474260-22385-3-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Tue, 26 Nov 2013 14:57:39 +0100")

Michal Kazior <michal.kazior@tieto.com> writes:

> This should fix possible connectivity issues upon
> changes of channel width, number of streams or
> SMPS on connected stations.
>
> An example trigger would be an action frame with
> operation mode change notification.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

Sorry, somehow missed these on my previous review:

> +	if (changed & IEEE80211_RC_BW_CHANGED) {
> +		switch (sta->bandwidth) {
> +		default:
> +			ath10k_warn("unsupported STA BW: %d\n", sta->bandwidth);
> +		case IEEE80211_STA_RX_BW_20:
> +			chwidth = WMI_PEER_CHWIDTH_20MHZ;
> +			break;
> +		case IEEE80211_STA_RX_BW_40:
> +			chwidth = WMI_PEER_CHWIDTH_40MHZ;
> +			break;
> +		case IEEE80211_STA_RX_BW_80:
> +			chwidth = WMI_PEER_CHWIDTH_80MHZ;
> +			break;
> +		}

I assume that the idea here is to use WMI_PEER_CHWIDTH_20MHZ for the
default case. Actually I would prefer to avoid using default case
altogether, that way the compiler will warn if there's an enum value we
don't check. So for example you could add "case IEEE80211_STA_RX_BW_160"
which prints a warning and uses 20 MHz.

> +	if (changed & IEEE80211_RC_SMPS_CHANGED) {
> +		smps = WMI_PEER_SMPS_PS_NONE;
> +
> +		switch (sta->smps_mode) {
> +		case IEEE80211_SMPS_NUM_MODES:
> +			ath10k_warn("invalid smps mode: %d\n", sta->smps_mode);
> +		case IEEE80211_SMPS_AUTOMATIC:
> +		case IEEE80211_SMPS_OFF:
> +			smps = WMI_PEER_SMPS_PS_NONE;
> +			break;
> +		case IEEE80211_SMPS_STATIC:
> +			smps = WMI_PEER_SMPS_STATIC;
> +			break;
> +		case IEEE80211_SMPS_DYNAMIC:
> +			smps = WMI_PEER_SMPS_DYNAMIC;
> +			break;
> +		}

This is better, but I think it would be clearer to have
IEEE80211_SMPS_NUM_MODES last and not "fall through" the cases.

-- 
Kalle Valo

  reply	other threads:[~2013-11-27 15:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22 13:26 [PATCH 0/3] ath10k: fixes 2013-11-22 Michal Kazior
2013-11-22 13:26 ` [PATCH 1/3] ath10k: use nss provided by mac80211 Michal Kazior
2013-11-24 13:50   ` Kalle Valo
2013-11-25 10:11     ` Michal Kazior
2013-11-22 13:26 ` [PATCH 2/3] ath10k: implement sta_rc_update() Michal Kazior
2013-11-22 13:26 ` [PATCH 3/3] ath10k: fix Tx status clearing Michal Kazior
2013-11-24 13:51   ` Kalle Valo
2013-11-26 13:57 ` [PATCH v2 0/3] ath10k: fixes 2013-11-22 Michal Kazior
2013-11-26 13:57   ` [PATCH v2 1/3] ath10k: use nss provided by mac80211 Michal Kazior
2013-11-27 10:25     ` Michal Kazior
2013-11-27 14:55       ` Kalle Valo
2013-11-29 15:37       ` Johannes Berg
2013-12-02 10:54         ` [RFC] mac80211: fix rx_nss calculation for drivers with hw rc Michal Kazior
2013-12-02 10:59           ` Johannes Berg
2013-12-02 14:42           ` Johannes Berg
2013-11-26 13:57   ` [PATCH v2 2/3] ath10k: implement sta_rc_update() Michal Kazior
2013-11-27 15:03     ` Kalle Valo [this message]
2013-12-18 10:11       ` [PATCH v2] " Michal Kazior
2013-12-20 10:21         ` Kalle Valo
2013-12-20 13:56           ` Ben Greear
2013-11-26 13:57   ` [PATCH v2 3/3] ath10k: fix Tx status clearing Michal Kazior
2013-11-27 15:04   ` [PATCH v2 0/3] ath10k: fixes 2013-11-22 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=87li09ga42.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;
as well as URLs for NNTP newsgroup(s).