diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_eeprom.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 1d09f22fee4d..d109c25417f4 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
@@ -14,6 +14,7 @@ | |||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <asm/unaligned.h> | ||
17 | #include "hw.h" | 18 | #include "hw.h" |
18 | #include "ar9003_phy.h" | 19 | #include "ar9003_phy.h" |
19 | #include "ar9003_eeprom.h" | 20 | #include "ar9003_eeprom.h" |
@@ -3006,11 +3007,11 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah, | |||
3006 | 3007 | ||
3007 | switch (param) { | 3008 | switch (param) { |
3008 | case EEP_MAC_LSW: | 3009 | case EEP_MAC_LSW: |
3009 | return eep->macAddr[0] << 8 | eep->macAddr[1]; | 3010 | return get_unaligned_be16(eep->macAddr); |
3010 | case EEP_MAC_MID: | 3011 | case EEP_MAC_MID: |
3011 | return eep->macAddr[2] << 8 | eep->macAddr[3]; | 3012 | return get_unaligned_be16(eep->macAddr + 2); |
3012 | case EEP_MAC_MSW: | 3013 | case EEP_MAC_MSW: |
3013 | return eep->macAddr[4] << 8 | eep->macAddr[5]; | 3014 | return get_unaligned_be16(eep->macAddr + 4); |
3014 | case EEP_REG_0: | 3015 | case EEP_REG_0: |
3015 | return le16_to_cpu(pBase->regDmn[0]); | 3016 | return le16_to_cpu(pBase->regDmn[0]); |
3016 | case EEP_REG_1: | 3017 | case EEP_REG_1: |
@@ -3038,7 +3039,7 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah, | |||
3038 | case EEP_CHAIN_MASK_REDUCE: | 3039 | case EEP_CHAIN_MASK_REDUCE: |
3039 | return (pBase->miscConfiguration >> 0x3) & 0x1; | 3040 | return (pBase->miscConfiguration >> 0x3) & 0x1; |
3040 | case EEP_ANT_DIV_CTL1: | 3041 | case EEP_ANT_DIV_CTL1: |
3041 | return le32_to_cpu(eep->base_ext1.ant_div_control); | 3042 | return eep->base_ext1.ant_div_control; |
3042 | default: | 3043 | default: |
3043 | return 0; | 3044 | return 0; |
3044 | } | 3045 | } |
@@ -3380,8 +3381,7 @@ found: | |||
3380 | osize = length; | 3381 | osize = length; |
3381 | read(ah, cptr, word, COMP_HDR_LEN + osize + COMP_CKSUM_LEN); | 3382 | read(ah, cptr, word, COMP_HDR_LEN + osize + COMP_CKSUM_LEN); |
3382 | checksum = ar9300_comp_cksum(&word[COMP_HDR_LEN], length); | 3383 | checksum = ar9300_comp_cksum(&word[COMP_HDR_LEN], length); |
3383 | mchecksum = word[COMP_HDR_LEN + osize] | | 3384 | mchecksum = get_unaligned_le16(&word[COMP_HDR_LEN + osize]); |
3384 | (word[COMP_HDR_LEN + osize + 1] << 8); | ||
3385 | ath_dbg(common, ATH_DBG_EEPROM, | 3385 | ath_dbg(common, ATH_DBG_EEPROM, |
3386 | "checksum %x %x\n", checksum, mchecksum); | 3386 | "checksum %x %x\n", checksum, mchecksum); |
3387 | if (checksum == mchecksum) { | 3387 | if (checksum == mchecksum) { |