[rt2x00-users] [PATCH 10/12] rt2x00: Introduce some #define for MCS index
Ivo van Doorn
ivdoorn at gmail.com
Sun Aug 30 14:19:53 UTC 2009
On Saturday 29 August 2009, Benoit PAPILLAULT wrote:
> Use #define for all MCS values. It makes the code easier to read and
> maintain since we can use meaningful names instead of numerical values
>
> Signed-off-by: Benoit PAPILLAULT <benoit.papillault at free.fr>
> ---
> drivers/net/wireless/rt2x00/rt2800pci.c | 56 +++++++++++++++---------------
> drivers/net/wireless/rt2x00/rt2x00dev.c | 24 +++++++-------
> drivers/net/wireless/rt2x00/rt2x00ht.c | 2 +-
> drivers/net/wireless/rt2x00/rt2x00reg.h | 54 +++++++++++++++++++++++++++++
Could you update rt2800usb as well?
Thanks.
> 4 files changed, 95 insertions(+), 41 deletions(-)
>
> + rt2x00_set_field32(®, LG_FBK_CFG0_OFDMMCS0FBK, MCS_RATE_6 | MCS_OFDM_FLAG);
> + rt2x00_set_field32(®, LG_FBK_CFG0_OFDMMCS1FBK, MCS_RATE_6 | MCS_OFDM_FLAG);
> + rt2x00_set_field32(®, LG_FBK_CFG0_OFDMMCS2FBK, MCS_RATE_9 | MCS_OFDM_FLAG);
> + rt2x00_set_field32(®, LG_FBK_CFG0_OFDMMCS3FBK, MCS_RATE_12 | MCS_OFDM_FLAG);
> + rt2x00_set_field32(®, LG_FBK_CFG0_OFDMMCS4FBK, MCS_RATE_18 | MCS_OFDM_FLAG);
> + rt2x00_set_field32(®, LG_FBK_CFG0_OFDMMCS5FBK, MCS_RATE_24 | MCS_OFDM_FLAG);
> + rt2x00_set_field32(®, LG_FBK_CFG0_OFDMMCS6FBK, MCS_RATE_36 | MCS_OFDM_FLAG);
> + rt2x00_set_field32(®, LG_FBK_CFG0_OFDMMCS7FBK, MCS_RATE_48 | MCS_OFDM_FLAG);
Any particular reason why MCS_RATE_6 doesn't have the MCS_OFDM_FLAG enabled by default?
> diff --git a/drivers/net/wireless/rt2x00/rt2x00ht.c b/drivers/net/wireless/rt2x00/rt2x00ht.c
> index e3cec83..22f1a41 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00ht.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00ht.c
> @@ -47,7 +47,7 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
>
> txdesc->mcs = rt2x00_get_rate_mcs(hwrate->mcs);
> if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
> - txdesc->mcs |= 0x08;
> + txdesc->mcs |= 0x08; /* FIXME : it should be MCS_SHORTP_FLAG = 0x4 */
And why isn't it 0x4 then?
> /*
> * Convert flags
> diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h
> index 983e52e..e789f19 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00reg.h
> +++ b/drivers/net/wireless/rt2x00/rt2x00reg.h
> @@ -135,6 +135,60 @@ enum rate_modulation {
> };
>
> /*
> + * MCS value for CCK modulations
> + */
> +
> +#define MCS_RATE_1 0 // long preamble CCK 1Mbps
> +#define MCS_RATE_2 1 // long preamble CCK 1Mbps
> +#define MCS_RATE_5_5 2
> +#define MCS_RATE_11 3
> +#define MCS_SHORTP_FLAG 0x4 // switch to short preamble instead of long
Please use /* */ for comments.
> +/*
> + * MCS value for OFDM modulations
> + */
> +
No empty line please.
Ivo
More information about the users
mailing list