Skip to content

Commit

Permalink
mac80211_hwsim: Fix rate control by correctly reporting transmission …
Browse files Browse the repository at this point in the history
…counts

Drivers need to report the number of transmission attempts for each rate
as well as to terminate the rate array with -1.  The in-kernel datapath
of hwsim simulates a perfect medium, therefore the driver only needs to
report that the first transmission attempt was sucessfully completed at
the most favorable rate.

Rate control is working again for this driver.  Tested mesh mode with
minstrel.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Javier Cardona authored and John W. Linville committed May 15, 2012
1 parent 341352d commit 2a4ffa4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,11 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
hwsim_check_sta_magic(txi->control.sta);

ieee80211_tx_info_clear_status(txi);

/* frame was transmitted at most favorable rate at first attempt */
txi->control.rates[0].count = 1;
txi->control.rates[1].idx = -1;

if (!(txi->flags & IEEE80211_TX_CTL_NO_ACK) && ack)
txi->flags |= IEEE80211_TX_STAT_ACK;
ieee80211_tx_status_irqsafe(hw, skb);
Expand Down

0 comments on commit 2a4ffa4

Please sign in to comment.