All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: pkshih@realtek.com, kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 06/10] rtlwifi: Fix VHT NSS in RC
Date: Sat, 27 Jan 2018 13:39:22 -0600	[thread overview]
Message-ID: <940c2aa9-67c3-7058-7e25-665a56eb4b1b@lwfinger.net> (raw)
In-Reply-To: <20180126074645.27201-7-pkshih@realtek.com>

On 01/26/2018 01:46 AM, pkshih@realtek.com wrote:
> From: Ping-Ke Shih <pkshih@realtek.com>
> 
> NSS is a argument of highest rate in RC, and it occupies bit 4-7 so use
> ieee80211_rate_set_vht() to fill the values. Since it got correct rate
> index, we don't need to check chips to assign NSS in set function anymore.
> 
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
>   drivers/net/wireless/realtek/rtlwifi/rc.c | 49 +++++++++++++++++++++++++------
>   1 file changed, 40 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rc.c b/drivers/net/wireless/realtek/rtlwifi/rc.c
> index d1cb7d405618..396bed8d3d51 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rc.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rc.c
> @@ -42,6 +42,17 @@ static u8 _rtl_rc_get_highest_rix(struct rtl_priv *rtlpriv,
>   	struct rtl_phy *rtlphy = &(rtlpriv->phy);
>   	struct rtl_sta_info *sta_entry = NULL;
>   	u16 wireless_mode = 0;
> +	u8 nss;
> +	struct ieee80211_tx_rate rate;
> +
> +	if (get_rf_type(rtlphy) >= RF_4T4R)
> +		nss = 4;
> +	else if (get_rf_type(rtlphy) >= RF_3T3R)
> +		nss = 3;
> +	else if (get_rf_type(rtlphy) >= RF_2T2R)
> +		nss = 2;
> +	else
> +		nss = 1;

As a general rule, I think that if ... else if ... else if ... else ... 
constructions should be changed to switch statements. This one is simple enough 
that there will be no complications, but keep this in mind in the future.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

  reply	other threads:[~2018-01-27 19:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26  7:46 [PATCH 00/10] rtlwifi: add more materials for 8822be pkshih
2018-01-26  7:46 ` [PATCH 01/10] rtlwifi: enable mac80211 fast-tx support pkshih
2018-01-27 18:32   ` Larry Finger
2018-01-26  7:46 ` [PATCH 02/10] rtlwifi: Add Support VHT to spec_ver pkshih
2018-01-29 18:18   ` Larry Finger
2018-01-26  7:46 ` [PATCH 03/10] rtlwifi: Use 6 bits as sequence number of TX report pkshih
2018-01-27 19:56   ` Larry Finger
2018-01-26  7:46 ` [PATCH 04/10] rtlwifi: Extend tx_power_by_rate_offset size for newer IC pkshih
2018-01-27 19:44   ` Larry Finger
2018-01-29  3:13     ` Pkshih
2018-01-26  7:46 ` [PATCH 05/10] rtlwifi: Add rate section and its related definition and comment pkshih
2018-01-27 19:41   ` Larry Finger
2018-01-26  7:46 ` [PATCH 06/10] rtlwifi: Fix VHT NSS in RC pkshih
2018-01-27 19:39   ` Larry Finger [this message]
2018-01-29  3:01     ` Pkshih
2018-01-26  7:46 ` [PATCH 07/10] rtlwifi: add definition radio_mask for RF and maximum bandwidth pkshih
2018-01-27 19:35   ` Larry Finger
2018-01-26  7:46 ` [PATCH 08/10] rtlwifi: add efuse ops for other components pkshih
2018-01-27 19:28   ` Larry Finger
2018-01-26  7:46 ` [PATCH 09/10] rtlwifi: btcoex: add routine to set default port id pkshih
2018-01-27 19:22   ` Larry Finger
2018-01-29  2:48     ` Pkshih
2018-01-26  7:46 ` [PATCH 10/10] rtlwifi: btcoex: Add 8822be btcoex supported files for wifi only pkshih
2018-01-27 19:24   ` Larry Finger

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=940c2aa9-67c3-7058-7e25-665a56eb4b1b@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.