linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: users@rt2x00.serialmonkey.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/6] rt2x00: Only initialize HT on rt2800 devices that support it.
Date: Mon, 23 Nov 2009 19:12:17 +0100	[thread overview]
Message-ID: <200911231912.17436.IvDoorn@gmail.com> (raw)
In-Reply-To: <1258960565-26736-2-git-send-email-gwingerde@gmail.com>

On Monday 23 November 2009, Gertjan van Wingerde wrote:
> Some RT28xx/RT30xx devices don't support 802.11n, when they are combined with
> the RF2020 chipset. Ensure that HT is disabled for these devices.
> 
> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
>  drivers/net/wireless/rt2x00/rt2800lib.c |   59 +++++++++++++++++--------------
>  1 files changed, 32 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index e94f1e1..ac393c3 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -2070,34 +2070,39 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
>  	}
>  
>  	/*
> -	 * Initialize HT information.
> +	 * Initialize HT information, unless when we're on RF2020, which doesn't
> +	 * support 802.11n.
>  	 */
> -	spec->ht.ht_supported = true;
> -	spec->ht.cap =
> -	    IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
> -	    IEEE80211_HT_CAP_GRN_FLD |
> -	    IEEE80211_HT_CAP_SGI_20 |
> -	    IEEE80211_HT_CAP_SGI_40 |
> -	    IEEE80211_HT_CAP_TX_STBC |
> -	    IEEE80211_HT_CAP_RX_STBC |
> -	    IEEE80211_HT_CAP_PSMP_SUPPORT;
> -	spec->ht.ampdu_factor = 3;
> -	spec->ht.ampdu_density = 4;
> -	spec->ht.mcs.tx_params =
> -	    IEEE80211_HT_MCS_TX_DEFINED |
> -	    IEEE80211_HT_MCS_TX_RX_DIFF |
> -	    ((rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH) - 1) <<
> -		IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
> -
> -	switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH)) {
> -	case 3:
> -		spec->ht.mcs.rx_mask[2] = 0xff;
> -	case 2:
> -		spec->ht.mcs.rx_mask[1] = 0xff;
> -	case 1:
> -		spec->ht.mcs.rx_mask[0] = 0xff;
> -		spec->ht.mcs.rx_mask[4] = 0x1; /* MCS32 */
> -		break;
> +	if (!rt2x00_rf(chip, RF2020)) {
> +		spec->ht.ht_supported = true;
> +		spec->ht.cap =
> +			IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
> +			IEEE80211_HT_CAP_GRN_FLD |
> +			IEEE80211_HT_CAP_SGI_20 |
> +			IEEE80211_HT_CAP_SGI_40 |
> +			IEEE80211_HT_CAP_TX_STBC |
> +			IEEE80211_HT_CAP_RX_STBC |
> +			IEEE80211_HT_CAP_PSMP_SUPPORT;
> +		spec->ht.ampdu_factor = 3;
> +		spec->ht.ampdu_density = 4;
> +		spec->ht.mcs.tx_params =
> +			IEEE80211_HT_MCS_TX_DEFINED |
> +			IEEE80211_HT_MCS_TX_RX_DIFF |
> +			((rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH) - 1) <<
> +				IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
> +
> +		switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH)) {
> +		case 3:
> +			spec->ht.mcs.rx_mask[2] = 0xff;
> +		case 2:
> +			spec->ht.mcs.rx_mask[1] = 0xff;
> +		case 1:
> +			spec->ht.mcs.rx_mask[0] = 0xff;
> +			spec->ht.mcs.rx_mask[4] = 0x1; /* MCS32 */
> +			break;
> +		}
> +	} else {
> +		spec->ht.ht_supported = false;

Isn't it sufficient to only set spec->ht.ht_supported to true or false?
mac80211 should ignore all ht parameters if ht_supported is set to
false anyway (and it saves quite a lot of indenting).

Ivo


  parent reply	other threads:[~2009-11-23 18:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23  7:15 [PATCH 0/6] Assorted fixes and cleanups for rt2x00 and mac80211 Gertjan van Wingerde
2009-11-23  7:16 ` [PATCH 1/6] rt2x00: Only initialize HT on rt2800 devices that support it Gertjan van Wingerde
2009-11-23  7:16   ` [PATCH 2/6] rt2x00: Remove unused variable frame_control from rt2x00mac_tx Gertjan van Wingerde
2009-11-23  7:16     ` [PATCH 3/6] rt2x00: Clean up use of rt2x00_intf_is_pci Gertjan van Wingerde
2009-11-23  7:16       ` [PATCH 4/6] rt2x00: Fix typo (lengt --> length) in rt2x00queue.c Gertjan van Wingerde
2009-11-23  7:16         ` [PATCH 5/6] rt2x00: Properly request tx headroom for alignment operations Gertjan van Wingerde
2009-11-23  7:16           ` [PATCH 6/6] mac80211: Allow extra TX headroom to be consumed by drivers Gertjan van Wingerde
2009-11-23 10:41             ` Johannes Berg
2009-11-23 19:26               ` Gertjan van Wingerde
2009-11-23  7:35           ` [PATCH 5/6] rt2x00: Properly request tx headroom for alignment operations Julian Calaby
2009-11-23 19:18             ` Gertjan van Wingerde
2009-11-23 10:38           ` Johannes Berg
2009-11-23 19:25             ` Gertjan van Wingerde
2009-11-23 18:33           ` Ivo van Doorn
2009-11-23 20:51             ` Gertjan van Wingerde
2009-11-23 18:29         ` [PATCH 4/6] rt2x00: Fix typo (lengt --> length) in rt2x00queue.c Ivo van Doorn
2009-11-23 18:13       ` [PATCH 3/6] rt2x00: Clean up use of rt2x00_intf_is_pci Ivo van Doorn
2009-11-23 18:12     ` [PATCH 2/6] rt2x00: Remove unused variable frame_control from rt2x00mac_tx Ivo van Doorn
2009-11-23  9:58   ` [PATCH 1/6] rt2x00: Only initialize HT on rt2800 devices that support it Simon Raffeiner
2009-11-23 19:20     ` Gertjan van Wingerde
2009-11-23 18:12   ` Ivo van Doorn [this message]
2009-11-23 19:30     ` Gertjan van Wingerde

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=200911231912.17436.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=gwingerde@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=users@rt2x00.serialmonkey.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).