Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42c82857 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville
Browse files

rt2x00: Store retry limit values



Store retry limit values in the rt2x00dev structure.
This allows the removal of the FIXME where we assumed
the long retry is only used when working with RTS frames.

Instead we should check the current retry limit values
and decide if the required retry count for this frame
is a long or short retry.

Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1ce9cdac
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -802,6 +802,12 @@ struct rt2x00_dev {
	 */
	u16 tx_power;

	/*
	 * Current retry values.
	 */
	u8 short_retry;
	u8 long_retry;

	/*
	 * Rssi <-> Dbm offset
	 */
+2 −0
Original line number Diff line number Diff line
@@ -194,6 +194,8 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,

	rt2x00dev->curr_band = conf->channel->band;
	rt2x00dev->tx_power = conf->power_level;
	rt2x00dev->short_retry = conf->short_frame_max_tx_count;
	rt2x00dev->long_retry = conf->long_frame_max_tx_count;

	rt2x00dev->rx_status.band = conf->channel->band;
	rt2x00dev->rx_status.freq = conf->channel->center_freq;
+1 −8
Original line number Diff line number Diff line
@@ -231,14 +231,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
	 * Determine retry information.
	 */
	txdesc->retry_limit = tx_info->control.rates[0].count - 1;
	/*
	 * XXX: If at this point we knew whether the HW is going to use
	 *	the RETRY_MODE bit or the retry_limit (currently all
	 *	use the RETRY_MODE bit) we could do something like b43
	 *	does, set the RETRY_MODE bit when the RC algorithm is
	 *	requesting more than the long retry limit.
	 */
	if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
	if (txdesc->retry_limit >= rt2x00dev->long_retry)
		__set_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags);

	/*