for (i = 0; i < wowlan->n_patterns; i++) {
mask_len = DIV_ROUND_UP(patterns[i].pattern_len, 8);
memset(wow_pattern, 0, MAX_PATTERN_SIZE);
memset(wow_mask, 0, MAX_PATTERN_SIZE);
memcpy(wow_pattern, patterns[i].pattern, patterns[i].pattern_len);
memcpy(wow_mask, patterns[i].mask, mask_len);
ret = ath9k_hw_wow_apply_pattern(ah,
wow_pattern,
wow_mask,
i + 2,
patterns[i].pattern_len); if (ret) break;
}
return ret;
}
int ath9k_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
{ struct ath_softc *sc = hw->priv; struct ath_hw *ah = sc->sc_ah; struct ath_common *common = ath9k_hw_common(ah);
u8 triggers; int ret = 0;
ath9k_deinit_channel_context(sc);
mutex_lock(&sc->mutex);
if (test_bit(ATH_OP_INVALID, &common->op_flags)) {
ath_err(common, "Device not present\n");
ret = -ENODEV; goto fail_wow;
}
if (WARN_ON(!wowlan)) {
ath_err(common, "None of the WoW triggers enabled\n");
ret = -EINVAL; goto fail_wow;
}
if (sc->cur_chan->nvifs > 1) {
ath_dbg(common, WOW, "WoW for multivif is not yet supported\n");
ret = 1; goto fail_wow;
}
if (ath9k_is_chanctx_enabled()) { if (test_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags)) {
ath_dbg(common, WOW, "Multi-channel WOW is not supported\n");
ret = 1; goto fail_wow;
}
}
if (!test_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags)) {
ath_dbg(common, WOW, "None of the STA vifs are associated\n");
ret = 1; goto fail_wow;
}
triggers = ath9k_wow_map_triggers(sc, wowlan); if (!triggers) {
ath_dbg(common, WOW, "No valid WoW triggers\n");
ret = 1; goto fail_wow;
}
ath_cancel_work(sc);
ath_stop_ani(sc);
ath9k_ps_wakeup(sc);
ath9k_stop_btcoex(sc);
/* *Enablewakeuponreceivingdisassoc/deauth *framebydefault.
*/
ret = ath9k_wow_add_disassoc_deauth_pattern(sc); if (ret) {
ath_err(common, "Unable to add disassoc/deauth pattern: %d\n", ret); goto fail_wow;
}
if (triggers & AH_WOW_USER_PATTERN_EN) {
ret = ath9k_wow_add_pattern(sc, wowlan); if (ret) {
ath_err(common, "Unable to add user pattern: %d\n", ret); goto fail_wow;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.