diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2015-01-30 19:05:37 +0530 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-02-03 15:31:14 +0200 |
commit | 6af75e4da330bf7ead84566275a9b49fe471bb4d (patch) | |
tree | 43dd87fcba5ffc2d84aaef3ae743b363d58010ea /drivers/net/wireless/ath/ath9k/ar9003_wow.c | |
parent | 404033c16c0a739fba8a5f00a306e33e3a367d19 (diff) |
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.c | 12 |
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 6681a7b03cd..d2a4f6f4904 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); |