From patchwork Fri Nov 27 08:37:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 7711811 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A577CBF90C for ; Fri, 27 Nov 2015 08:37:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D95C8205F9 for ; Fri, 27 Nov 2015 08:37:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E4CD205B5 for ; Fri, 27 Nov 2015 08:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754173AbbK0Ihi (ORCPT ); Fri, 27 Nov 2015 03:37:38 -0500 Received: from mail-lf0-f52.google.com ([209.85.215.52]:35426 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754150AbbK0Ihd (ORCPT ); Fri, 27 Nov 2015 03:37:33 -0500 Received: by lfdl133 with SMTP id l133so120690314lfd.2 for ; Fri, 27 Nov 2015 00:37:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aYyOjrZKrGjfU5ltEXELbtTPXSjSe6jEme+HEZJPSwI=; b=wQXUWSy/NvxgCax5rgThRNKPXM1OSHLTA8M+mPjkPLjDzpP0CX0YTo9/W0JNkmJJDB DGhKM8Zq0Z+OvPArLg6zcY7CCDHTJ8QyeQ1toeAOzqTZc0OVL5I4+MWCNR2RSbak0xh3 N6mG1t6p00k2efDcy+dP2LUC/an1SpdiYL2l4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aYyOjrZKrGjfU5ltEXELbtTPXSjSe6jEme+HEZJPSwI=; b=jxuJ/BFZk0evfFn6IEun+coN36u7FmXpTCXeXT93qOzeE4Mw19m3dzouMX0UYdQiEm F2hRdI4uRKhFbFkQmKgKCi3di92BRFcyJvbKZgswikjZO07qKs+Ooe4JnJjE1AzAx1E8 wfIq7e/W8CNjbSV+kgA/po1hHPbwUP6sWYCcsvqX4zVXSY72kyoIgSqldNd4ud8VX4zV F1ib8tqE/IqWRyfucxOE+uNkhIv3VIFi64+jt5vt8ghH2GjhDa6sYudaqPopLVxmjCIg +PNjRU8dyUJdG4EaCEQxsK8Ou5e/StprJbnniaJmAQyH9gGyi67F9QLMmomU6nUMl08S Rqow== X-Gm-Message-State: ALoCoQmbwPcvWhf8vVJh/NNxzzJ/JH+i6uZb4cZu7aWImggqgxnAWK+l13hV7+ZAZSBhzDDKvSQ6iHB8IuTJa2kvNuX9SPOLyH7pUp5QhJvW1AwaSlMvcXfmd0Ynpk/86r/+AePaW8uGn1Ux2yupjJqhg2tEqyNf8I+XgCxj7DdDM3J4WuuPEiwK3nprjQcvZ2a0KRSaE67C X-Received: by 10.25.88.208 with SMTP id m199mr18751110lfb.157.1448613451674; Fri, 27 Nov 2015 00:37:31 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by smtp.gmail.com with ESMTPSA id l128sm4838004lfe.27.2015.11.27.00.37.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Nov 2015 00:37:30 -0800 (PST) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: ath9k-devel@lists.ath9k.org, nbd@openwrt.org, Janusz Dziedzic Subject: [PATCH v2 08/13] ath9k: P2P_CLIENT, get/set NOA correctly Date: Fri, 27 Nov 2015 09:37:13 +0100 Message-Id: <1448613438-5173-8-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448613438-5173-1-git-send-email-janusz.dziedzic@tieto.com> References: <1448613438-5173-1-git-send-email-janusz.dziedzic@tieto.com> X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case we get BSS_CHANGED_P2P_PS early, from mac80211, we didn't set NOA timer correctly, while p2p_ps_vif was NULL. Signed-off-by: Janusz Dziedzic --- drivers/net/wireless/ath/ath9k/channel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c index 31b4d0e..5a1ede6 100644 --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c @@ -1443,6 +1443,10 @@ static void ath9k_update_p2p_ps(struct ath_softc *sc, struct ieee80211_vif *vif) return; sc->p2p_ps_vif = avp; + + if (sc->ps_flags & PS_BEACON_SYNC) + return; + tsf = ath9k_hw_gettsf32(sc->sc_ah); ieee80211_parse_p2p_noa(&vif->bss_conf.p2p_noa_attr, &avp->noa, tsf); ath9k_update_p2p_ps_timer(sc, avp); @@ -1585,8 +1589,7 @@ void ath9k_p2p_bss_info_changed(struct ath_softc *sc, spin_lock_bh(&sc->sc_pcu_lock); spin_lock_irqsave(&sc->sc_pm_lock, flags); - if (!(sc->ps_flags & PS_BEACON_SYNC)) - ath9k_update_p2p_ps(sc, vif); + ath9k_update_p2p_ps(sc, vif); spin_unlock_irqrestore(&sc->sc_pm_lock, flags); spin_unlock_bh(&sc->sc_pcu_lock); }