[rt2x00-users] [RFC] rt2x00: rt2800: enable STBC
Gertjan van Wingerde
gwingerde at gmail.com
Fri May 28 12:19:57 UTC 2010
On 05/28/10 13:35, Helmut Schaa wrote:
> Enable STBC in the tx descriptor when mac80211 tells us to do so.
>
> Replace the stbc field with a flag as TX STBC only uses on and off.
>
> Signed-off-by: Helmut Schaa <helmut.schaa at googlemail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++-
> drivers/net/wireless/rt2x00/rt2x00ht.c | 3 ++-
> drivers/net/wireless/rt2x00/rt2x00queue.h | 4 ++--
> 3 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index db4250d..87e7010 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -306,7 +306,8 @@ void rt2800_write_txwi(struct sk_buff *skb, struct txentry_desc *txdesc)
> test_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags));
> rt2x00_set_field32(&word, TXWI_W0_SHORT_GI,
> test_bit(ENTRY_TXD_HT_SHORT_GI, &txdesc->flags));
> - rt2x00_set_field32(&word, TXWI_W0_STBC, txdesc->stbc);
> + rt2x00_set_field32(&word, TXWI_W0_STBC,
> + test_bit(ENTRY_TXD_HT_STBC, &txdesc->flags));
> rt2x00_set_field32(&word, TXWI_W0_PHYMODE, txdesc->rate_mode);
> rt2x00_desc_write(txwi, 0, word);
>
> diff --git a/drivers/net/wireless/rt2x00/rt2x00ht.c b/drivers/net/wireless/rt2x00/rt2x00ht.c
> index 5a40760..f61c030 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00ht.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00ht.c
> @@ -44,7 +44,6 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
> txdesc->mpdu_density = 0;
>
> txdesc->ba_size = 7; /* FIXME: What value is needed? */
> - txdesc->stbc = 0; /* FIXME: What value is needed? */
>
> txdesc->mcs = rt2x00_get_rate_mcs(hwrate->mcs);
> if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
> @@ -55,6 +54,8 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
> */
> if (tx_info->flags & IEEE80211_TX_CTL_AMPDU)
> __set_bit(ENTRY_TXD_HT_AMPDU, &txdesc->flags);
> + if (tx_info->flags & IEEE80211_TX_CTL_STBC)
> + __set_bit(ENTRY_TXD_HT_STBC, &txdesc->flags);
>
> /*
> * Determine HT Mix/Greenfield rate mode
This doesn't seem to work. In mac80211 the IEEE80211_TX_CTL_STBC is actually a 2-bit field,
so is the field in the TXWI structure of rt2x00. I suggest we keep the stbc field a u16 (or a u8)
and simply copy the value of these two bits into that field.
> diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
> index f791708..812eb5e 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00queue.h
> +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
> @@ -261,6 +261,7 @@ struct txdone_entry_desc {
> * @ENTRY_TXD_HT_AMPDU: This frame is part of an AMPDU.
> * @ENTRY_TXD_HT_BW_40: Use 40MHz Bandwidth.
> * @ENTRY_TXD_HT_SHORT_GI: Use short GI.
> + * @ENTRY_TXD_HT_STBC: Use STBC.
> */
> enum txentry_desc_flags {
> ENTRY_TXD_RTS_FRAME,
> @@ -279,6 +280,7 @@ enum txentry_desc_flags {
> ENTRY_TXD_HT_AMPDU,
> ENTRY_TXD_HT_BW_40,
> ENTRY_TXD_HT_SHORT_GI,
> + ENTRY_TXD_HT_STBC,
> };
>
> /**
> @@ -295,7 +297,6 @@ enum txentry_desc_flags {
> * @signal: PLCP signal.
> * @service: PLCP service.
> * @msc: MCS.
> - * @stbc: STBC.
> * @ba_size: BA size.
> * @rate_mode: Rate mode (See @enum rate_modulation).
> * @mpdu_density: MDPU density.
> @@ -324,7 +325,6 @@ struct txentry_desc {
> u16 service;
>
> u16 mcs;
> - u16 stbc;
> u16 ba_size;
> u16 rate_mode;
> u16 mpdu_density;
More information about the users
mailing list