rt2x00: Remove ENTRY_TXD_OFDM_RATE
The flag ENTRY_TXD_OFDM_RATE isn't flexible enough to indicate which rate modulation should be used for a frame. This will become a problem when 11n support is added. Remove the flag and replace it with an enum value which can better indicate the exact rate modulation. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
7b40982e23
commit
076f9582a6
@@ -1233,7 +1233,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
|
|||||||
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
|
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
|
||||||
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
|
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
|
||||||
rt2x00_set_field32(&word, TXD_W0_OFDM,
|
rt2x00_set_field32(&word, TXD_W0_OFDM,
|
||||||
test_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags));
|
(txdesc->rate_mode == RATE_MODE_OFDM));
|
||||||
rt2x00_set_field32(&word, TXD_W0_CIPHER_OWNER, 1);
|
rt2x00_set_field32(&word, TXD_W0_CIPHER_OWNER, 1);
|
||||||
rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
|
rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
|
||||||
rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
|
rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
|
||||||
|
@@ -1217,7 +1217,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
|
|||||||
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
|
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
|
||||||
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
|
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
|
||||||
rt2x00_set_field32(&word, TXD_W0_OFDM,
|
rt2x00_set_field32(&word, TXD_W0_OFDM,
|
||||||
test_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags));
|
(txdesc->rate_mode == RATE_MODE_OFDM));
|
||||||
rt2x00_set_field32(&word, TXD_W0_NEW_SEQ,
|
rt2x00_set_field32(&word, TXD_W0_NEW_SEQ,
|
||||||
test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags));
|
test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags));
|
||||||
rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
|
rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
|
||||||
|
@@ -314,9 +314,13 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
|
|||||||
} else
|
} else
|
||||||
txdesc->ifs = IFS_SIFS;
|
txdesc->ifs = IFS_SIFS;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Determine rate modulation.
|
||||||
|
*/
|
||||||
hwrate = rt2x00_get_rate(rate->hw_value);
|
hwrate = rt2x00_get_rate(rate->hw_value);
|
||||||
|
txdesc->rate_mode = RATE_MODE_CCK;
|
||||||
if (hwrate->flags & DEV_RATE_OFDM)
|
if (hwrate->flags & DEV_RATE_OFDM)
|
||||||
__set_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags);
|
txdesc->rate_mode = RATE_MODE_OFDM;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Apply TX descriptor handling by components
|
* Apply TX descriptor handling by components
|
||||||
|
@@ -222,7 +222,6 @@ struct txdone_entry_desc {
|
|||||||
*
|
*
|
||||||
* @ENTRY_TXD_RTS_FRAME: This frame is a RTS frame.
|
* @ENTRY_TXD_RTS_FRAME: This frame is a RTS frame.
|
||||||
* @ENTRY_TXD_CTS_FRAME: This frame is a CTS-to-self frame.
|
* @ENTRY_TXD_CTS_FRAME: This frame is a CTS-to-self frame.
|
||||||
* @ENTRY_TXD_OFDM_RATE: This frame is send out with an OFDM rate.
|
|
||||||
* @ENTRY_TXD_GENERATE_SEQ: This frame requires sequence counter.
|
* @ENTRY_TXD_GENERATE_SEQ: This frame requires sequence counter.
|
||||||
* @ENTRY_TXD_FIRST_FRAGMENT: This is the first frame.
|
* @ENTRY_TXD_FIRST_FRAGMENT: This is the first frame.
|
||||||
* @ENTRY_TXD_MORE_FRAG: This frame is followed by another fragment.
|
* @ENTRY_TXD_MORE_FRAG: This frame is followed by another fragment.
|
||||||
@@ -238,7 +237,6 @@ struct txdone_entry_desc {
|
|||||||
enum txentry_desc_flags {
|
enum txentry_desc_flags {
|
||||||
ENTRY_TXD_RTS_FRAME,
|
ENTRY_TXD_RTS_FRAME,
|
||||||
ENTRY_TXD_CTS_FRAME,
|
ENTRY_TXD_CTS_FRAME,
|
||||||
ENTRY_TXD_OFDM_RATE,
|
|
||||||
ENTRY_TXD_GENERATE_SEQ,
|
ENTRY_TXD_GENERATE_SEQ,
|
||||||
ENTRY_TXD_FIRST_FRAGMENT,
|
ENTRY_TXD_FIRST_FRAGMENT,
|
||||||
ENTRY_TXD_MORE_FRAG,
|
ENTRY_TXD_MORE_FRAG,
|
||||||
@@ -263,6 +261,7 @@ enum txentry_desc_flags {
|
|||||||
* @length_low: PLCP length low word.
|
* @length_low: PLCP length low word.
|
||||||
* @signal: PLCP signal.
|
* @signal: PLCP signal.
|
||||||
* @service: PLCP service.
|
* @service: PLCP service.
|
||||||
|
* @rate_mode: Rate mode (See @enum rate_modulation).
|
||||||
* @retry_limit: Max number of retries.
|
* @retry_limit: Max number of retries.
|
||||||
* @aifs: AIFS value.
|
* @aifs: AIFS value.
|
||||||
* @ifs: IFS value.
|
* @ifs: IFS value.
|
||||||
@@ -282,6 +281,8 @@ struct txentry_desc {
|
|||||||
u16 signal;
|
u16 signal;
|
||||||
u16 service;
|
u16 service;
|
||||||
|
|
||||||
|
u16 rate_mode;
|
||||||
|
|
||||||
short retry_limit;
|
short retry_limit;
|
||||||
short aifs;
|
short aifs;
|
||||||
short ifs;
|
short ifs;
|
||||||
|
@@ -124,6 +124,16 @@ enum cipher {
|
|||||||
CIPHER_MAX = 4,
|
CIPHER_MAX = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Rate modulations
|
||||||
|
*/
|
||||||
|
enum rate_modulation {
|
||||||
|
RATE_MODE_CCK = 0,
|
||||||
|
RATE_MODE_OFDM = 1,
|
||||||
|
RATE_MODE_HT_MIX = 2,
|
||||||
|
RATE_MODE_HT_GREENFIELD = 3,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register handlers.
|
* Register handlers.
|
||||||
* We store the position of a register field inside a field structure,
|
* We store the position of a register field inside a field structure,
|
||||||
|
@@ -1847,7 +1847,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
|
|||||||
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
|
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
|
||||||
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
|
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
|
||||||
rt2x00_set_field32(&word, TXD_W0_OFDM,
|
rt2x00_set_field32(&word, TXD_W0_OFDM,
|
||||||
test_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags));
|
(txdesc->rate_mode == RATE_MODE_OFDM));
|
||||||
rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
|
rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
|
||||||
rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
|
rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
|
||||||
test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
|
test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
|
||||||
|
@@ -1498,7 +1498,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
|
|||||||
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
|
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
|
||||||
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
|
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
|
||||||
rt2x00_set_field32(&word, TXD_W0_OFDM,
|
rt2x00_set_field32(&word, TXD_W0_OFDM,
|
||||||
test_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags));
|
(txdesc->rate_mode == RATE_MODE_OFDM));
|
||||||
rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
|
rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
|
||||||
rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
|
rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
|
||||||
test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
|
test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
|
||||||
|
Reference in New Issue
Block a user