17 #include <linux/export.h>
25 return "Magic pattern";
27 return "User pattern";
33 return "unknown reason";
37 static void ath9k_hw_config_serdes_wow_sleep(
struct ath_hw *
ah)
41 for (i = 0; i < ah->iniPcieSerdesWow.ia_rows; i++)
43 INI_RA(&ah->iniPcieSerdesWow, i, 1));
48 static void ath9k_hw_set_powermode_wow_sleep(
struct ath_hw *ah)
58 ath_err(common,
"Failed to stop Rx DMA in 10ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
73 static void ath9k_wow_create_keep_alive_pattern(
struct ath_hw *ah)
75 struct ath_common *common = ath9k_hw_common(ah);
80 u32 wow_ka_data_word0;
111 data_word[1] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
112 (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
113 data_word[2] = (sta_mac_addr[1] << 24) | (sta_mac_addr[0] << 16) |
114 (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
115 data_word[3] = (sta_mac_addr[5] << 24) | (sta_mac_addr[4] << 16) |
116 (sta_mac_addr[3] << 8) | (sta_mac_addr[2]);
117 data_word[4] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
118 (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
119 data_word[5] = (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
131 REG_WRITE(ah, (wow_ka_data_word0 + i*4), data_word[i]);
136 u8 *user_mask,
int pattern_count,
140 u32 pattern_val, mask_val;
151 memcpy(&pattern_val, user_pattern, 4);
159 memcpy(&mask_val, user_mask, 4);
189 if (pattern_count < 4) {
223 val &= ah->wow_event_mask;
282 ath9k_hw_configpcipowersave(ah,
false);
284 ah->wow_event_mask = 0;
302 wow_event_mask = ah->wow_event_mask;
350 ath9k_hw_config_serdes_wow_sleep(ah);
418 ath9k_wow_create_keep_alive_pattern(ah);
453 if (pattern_enable & AH_WOW_BEACON_MISS) {
529 ath9k_hw_set_powermode_wow_sleep(ah);
530 ah->wow_event_mask = wow_event_mask;