summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath9k/ar9003_wow.c
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2015-01-30 13:35:37 (GMT)
committerKalle Valo <kvalo@codeaurora.org>2015-02-03 13:31:14 (GMT)
commit6af75e4da330bf7ead84566275a9b49fe471bb4d (patch)
tree43dd87fcba5ffc2d84aaef3ae743b363d58010ea /drivers/net/wireless/ath/ath9k/ar9003_wow.c
parent404033c16c0a739fba8a5f00a306e33e3a367d19 (diff)
downloadlinux-6af75e4da330bf7ead84566275a9b49fe471bb4d.tar.xz
ath9k: Fix max pattern check
Since the maximum number of configurable patterns is chip-specific, use the HW capability instead of a fixed value for checking if a free pattern slot is available. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_wow.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_wow.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_wow.c b/drivers/net/wireless/ath/ath9k/ar9003_wow.c
index 6681a7b..d2a4f6f 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_wow.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_wow.c
@@ -89,17 +89,16 @@ static void ath9k_wow_create_keep_alive_pattern(struct ath_hw *ah)
}
-void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
- u8 *user_mask, int pattern_count,
- int pattern_len)
+int ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
+ u8 *user_mask, int pattern_count,
+ int pattern_len)
{
int i;
u32 pattern_val, mask_val;
u32 set, clr;
- /* FIXME: should check count by querying the hardware capability */
- if (pattern_count >= MAX_NUM_PATTERN)
- return;
+ if (pattern_count >= ah->wow.max_patterns)
+ return -ENOSPC;
REG_SET_BIT(ah, AR_WOW_PATTERN, BIT(pattern_count));
@@ -154,6 +153,7 @@ void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
REG_RMW(ah, AR_WOW_LENGTH2, set, clr);
}
+ return 0;
}
EXPORT_SYMBOL(ath9k_hw_wow_apply_pattern);