Skip to content

Commit

Permalink
ath5k: correct endianness of frame duration
Browse files Browse the repository at this point in the history
The ath5k version of ieee80211_generic_frame_duration() returns
an __le16 for standard modes but a cpu-endian int for turbo/half/
quarter rates.  Make it always return cpu-endian values.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Bob Copeland authored and John W. Linville committed Jan 27, 2011
1 parent 15411c2 commit c9234a6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/wireless/ath/ath5k/pcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int ath5k_hw_get_frame_duration(struct ath5k_hw *ah,
if (!ah->ah_bwmode) {
dur = ieee80211_generic_frame_duration(sc->hw,
NULL, len, rate);
return dur;
return le16_to_cpu(dur);
}

bitrate = rate->bitrate;
Expand Down Expand Up @@ -265,8 +265,6 @@ static inline void ath5k_hw_write_rate_duration(struct ath5k_hw *ah)
* what rate we should choose to TX ACKs. */
tx_time = ath5k_hw_get_frame_duration(ah, 10, rate);

tx_time = le16_to_cpu(tx_time);

ath5k_hw_reg_write(ah, tx_time, reg);

if (!(rate->flags & IEEE80211_RATE_SHORT_PREAMBLE))
Expand Down

0 comments on commit c9234a6

Please sign in to comment.