Return-path: Received: from wolverine01.qualcomm.com ([199.106.114.254]:45857 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755609Ab1J1Mbz (ORCPT ); Fri, 28 Oct 2011 08:31:55 -0400 Message-ID: <4EAAA08F.5070905@qca.qualcomm.com> (sfid-20111028_143206_269254_8D38E597) Date: Fri, 28 Oct 2011 15:31:11 +0300 From: Kalle Valo MIME-Version: 1.0 To: CC: Subject: Re: [PATCH 4/7] ath6kl: Add new functions to handle wow suspend/resume operations References: <1319539047-8756-1-git-send-email-rmani@qca.qualcomm.com> <1319539047-8756-5-git-send-email-rmani@qca.qualcomm.com> In-Reply-To: <1319539047-8756-5-git-send-email-rmani@qca.qualcomm.com> Content-Type: text/plain; charset="ISO-8859-1" Sender: linux-wireless-owner@vger.kernel.org List-ID: On 10/25/2011 01:37 PM, rmani@qca.qualcomm.com wrote: > From: Raja Mani > > Signed-off-by: Raja Mani Empty commit log. > +int ath6kl_pm_wow_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow) > +{ > + struct wmi_set_wow_mode_cmd wakeup_filter_cmd; > + struct wmi_add_wow_pattern_cmd add_pattern_cmd; > + struct wmi_del_wow_pattern_cmd del_pattern_cmd; > + struct wmi_set_host_sleep_mode_cmd hsleep_cmd; > + int i, ret, pos, left; > + u8 mask[WOW_PATTERN_SIZE]; > + > + if (WARN_ON(!wow)) > + return -EINVAL; Unnecessary null check, wow is non-zero here. > + for (pos = 0; pos < wow->patterns[i].pattern_len; > + pos++) { > + if (wow->patterns[i].mask[pos / 8] & (0x1 << (pos % 8))) > + mask[pos] = 0xFF; This loop needs a comment. > + if (ar->tx_pending[ar->ctrl_ep]) { > + left = wait_event_interruptible_timeout(ar->event_wq, > + ar->tx_pending[ar->ctrl_ep] == 0, WMI_TIMEOUT); > + if (left == 0) { > + ret = -ETIMEDOUT; > + goto wow_setup_failed; > + } else if (left < 0) { > + ret = left; > + goto wow_setup_failed; A warning message for both of these error case would be nice. > +#define WOW_HOST_REQ_DELAY 500 /* 500 ms */ No point of duplicating the value, "/* ms */" is enough. Kalle