diff options
Diffstat (limited to 'drivers/net/wireless/ath5k/pcu.c')
-rw-r--r-- | drivers/net/wireless/ath5k/pcu.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath5k/pcu.c b/drivers/net/wireless/ath5k/pcu.c index 75eb9f43c74..f8a4a696027 100644 --- a/drivers/net/wireless/ath5k/pcu.c +++ b/drivers/net/wireless/ath5k/pcu.c | |||
@@ -646,6 +646,23 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah) | |||
646 | } | 646 | } |
647 | 647 | ||
648 | /** | 648 | /** |
649 | * ath5k_hw_set_tsf64 - Set a new 64bit TSF | ||
650 | * | ||
651 | * @ah: The &struct ath5k_hw | ||
652 | * @tsf64: The new 64bit TSF | ||
653 | * | ||
654 | * Sets the new TSF | ||
655 | */ | ||
656 | void ath5k_hw_set_tsf64(struct ath5k_hw *ah, u64 tsf64) | ||
657 | { | ||
658 | ATH5K_TRACE(ah->ah_sc); | ||
659 | |||
660 | ath5k_hw_reg_write(ah, 0x00000000, AR5K_TSF_L32); | ||
661 | ath5k_hw_reg_write(ah, (tsf64 >> 32) & 0xffffffff, AR5K_TSF_U32); | ||
662 | ath5k_hw_reg_write(ah, tsf64 & 0xffffffff, AR5K_TSF_L32); | ||
663 | } | ||
664 | |||
665 | /** | ||
649 | * ath5k_hw_reset_tsf - Force a TSF reset | 666 | * ath5k_hw_reset_tsf - Force a TSF reset |
650 | * | 667 | * |
651 | * @ah: The &struct ath5k_hw | 668 | * @ah: The &struct ath5k_hw |
@@ -1026,6 +1043,9 @@ int ath5k_keycache_type(const struct ieee80211_key_conf *key) | |||
1026 | return AR5K_KEYTABLE_TYPE_40; | 1043 | return AR5K_KEYTABLE_TYPE_40; |
1027 | else if (key->keylen == LEN_WEP104) | 1044 | else if (key->keylen == LEN_WEP104) |
1028 | return AR5K_KEYTABLE_TYPE_104; | 1045 | return AR5K_KEYTABLE_TYPE_104; |
1046 | return -EINVAL; | ||
1047 | default: | ||
1048 | return -EINVAL; | ||
1029 | } | 1049 | } |
1030 | return -EINVAL; | 1050 | return -EINVAL; |
1031 | } | 1051 | } |
@@ -1041,7 +1061,7 @@ int ath5k_hw_set_key(struct ath5k_hw *ah, u16 entry, | |||
1041 | __le32 key_v[5] = {}; | 1061 | __le32 key_v[5] = {}; |
1042 | __le32 key0 = 0, key1 = 0; | 1062 | __le32 key0 = 0, key1 = 0; |
1043 | __le32 *rxmic, *txmic; | 1063 | __le32 *rxmic, *txmic; |
1044 | u32 keytype; | 1064 | int keytype; |
1045 | u16 micentry = entry + AR5K_KEYTABLE_MIC_OFFSET; | 1065 | u16 micentry = entry + AR5K_KEYTABLE_MIC_OFFSET; |
1046 | bool is_tkip; | 1066 | bool is_tkip; |
1047 | const u8 *key_ptr; | 1067 | const u8 *key_ptr; |
@@ -1139,7 +1159,7 @@ int ath5k_hw_set_key_lladdr(struct ath5k_hw *ah, u16 entry, const u8 *mac) | |||
1139 | 1159 | ||
1140 | /* MAC may be NULL if it's a broadcast key. In this case no need to | 1160 | /* MAC may be NULL if it's a broadcast key. In this case no need to |
1141 | * to compute AR5K_LOW_ID and AR5K_HIGH_ID as we already know it. */ | 1161 | * to compute AR5K_LOW_ID and AR5K_HIGH_ID as we already know it. */ |
1142 | if (unlikely(mac == NULL)) { | 1162 | if (!mac) { |
1143 | low_id = 0xffffffff; | 1163 | low_id = 0xffffffff; |
1144 | high_id = 0xffff | AR5K_KEYTABLE_VALID; | 1164 | high_id = 0xffff | AR5K_KEYTABLE_VALID; |
1145 | } else { | 1165 | } else { |