]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ath5k: fix all endian issues reported by sparse
authorPavel Roskin <proski@gnu.org>
Tue, 26 Feb 2008 22:59:14 +0000 (17:59 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 29 Feb 2008 20:41:56 +0000 (15:41 -0500)
Changes-licensed-under: ISC
Signed-off-by: Pavel Roskin <proski@gnu.org>
Acked-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/ath5k/hw.c

index 0b743f7b3a141e5671781841353f9a73423ca462..393b5f3c25a7899be452966b4beebaa0e688cbe6 100644 (file)
@@ -1717,11 +1717,11 @@ ath5k_check_ibss_hw_merge(struct ath5k_softc *sc, struct sk_buff *skb)
        u32 hw_tu;
        struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
 
-       if ((mgmt->frame_control & IEEE80211_FCTL_FTYPE) ==
+       if ((le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_FTYPE) ==
                IEEE80211_FTYPE_MGMT &&
-           (mgmt->frame_control & IEEE80211_FCTL_STYPE) ==
+           (le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE) ==
                IEEE80211_STYPE_BEACON &&
-           mgmt->u.beacon.capab_info & WLAN_CAPABILITY_IBSS &&
+           le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS &&
            memcmp(mgmt->bssid, sc->ah->ah_bssid, ETH_ALEN) == 0) {
                /*
                 * Received an IBSS beacon with the same BSSID. Hardware might
@@ -1730,7 +1730,7 @@ ath5k_check_ibss_hw_merge(struct ath5k_softc *sc, struct sk_buff *skb)
                hw_tu = TSF_TO_TU(ath5k_hw_get_tsf64(sc->ah));
                if (hw_tu >= sc->nexttbtt) {
                        ath5k_beacon_update_timers(sc,
-                               mgmt->u.beacon.timestamp);
+                               le64_to_cpu(mgmt->u.beacon.timestamp));
                        ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON,
                                "detected HW merge from received beacon\n");
                }
index 998da6be2be3b77be45619f98b5d4899881ca4af..eec2b806a0de27dc99cc68a2035a3dc115c78bff 100644 (file)
@@ -531,8 +531,8 @@ static inline void ath5k_hw_write_rate_duration(struct ath5k_hw *ah,
                 * actual rate for this rate. See mac80211 tx.c
                 * ieee80211_duration() for a brief description of
                 * what rate we should choose to TX ACKs. */
-               tx_time = ieee80211_generic_frame_duration(sc->hw,
-                       sc->vif, 10, &srate);
+               tx_time = le16_to_cpu(ieee80211_generic_frame_duration(sc->hw,
+                                                       sc->vif, 10, &srate));
 
                ath5k_hw_reg_write(ah, tx_time, reg);