From patchwork Tue Aug 2 08:16:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 9255341 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A3A7F6089F for ; Tue, 2 Aug 2016 09:15:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9435E284EB for ; Tue, 2 Aug 2016 09:15:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88A77284FF; Tue, 2 Aug 2016 09:15:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27478284F4 for ; Tue, 2 Aug 2016 09:15:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752533AbcHBJMS (ORCPT ); Tue, 2 Aug 2016 05:12:18 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33624 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbcHBJL6 (ORCPT ); Tue, 2 Aug 2016 05:11:58 -0400 Received: by mail-pf0-f193.google.com with SMTP id i6so12081047pfe.0 for ; Tue, 02 Aug 2016 02:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PKXh7VBOJA7w7JaEDgX106C/Ef7wmylCBdT1GTWCEkw=; b=uMNUKYXJgzr7MgXhReUE9bY+FiCJ7GSllnXVBz8AE6G6WPoxjyycaIgvssJdxM+O+3 BlwcDZ/J3Eya6vlEADKrj0v4qe2P3wmN0Rv5KdwRBMjUZAf6s6TuxRpOyqDpOzn9qxcf +6MGY1GS9MSQTU6S90sF8Vx2CmQ/K6fqw/SXBuK8Rm7bty1YhkAKHzPE5+nRfrw6KNFV WQiVf10e0N2lVcrclrNqUKGONVRXPNLlXFGUx3VCr1dgvxgLbwy8uUNjCYh5q74x40jO Y+AHGrnqQYrY4FjALxMMpSi0IaYKRjE1F0y8FPz+ETW8w3buQXDYAHxWfXz1zbNeucNa 0pRg== 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=PKXh7VBOJA7w7JaEDgX106C/Ef7wmylCBdT1GTWCEkw=; b=h/pw1sWjNWoY96IHPVJGTB2wOoT/0TIU4wYVxSbDFOFJnght6yakFctL1CJoew5cZ0 WXRhOhp3CyoqTTSwI0FrVNq1V723m3VIsBvFxn7t92gbl4qWJLYGdTECWbygJ7nGx6hx KU13UbmJsJRZwaXekwwR8gCVSnARagpcwwUvOBcc4qbTsswIS0Lfh8MjsRSKIiIPOlDK EuRyEI4Y7EoePLie906zpuxAZhsRd68rKQv0asIYTvWYXaELPJ5H+y3AzROVR6f0ZUow TUddVV0Dtfoav0tDDLGQs71HtuQKKB3W042HageO/DUIa4nYGTcx1aWRI0y7oDHrdmTD X5WA== X-Gm-Message-State: AEkoousrCnjQWTgrYBm6CNng0FF91h/WCjNH+2GpK7wYSPonisGDFvyXOF/OrOukT0+08w== X-Received: by 10.98.75.65 with SMTP id y62mr101937662pfa.99.1470125842952; Tue, 02 Aug 2016 01:17:22 -0700 (PDT) Received: from localhost.localdomain (p0344e3.kngwnt01.ap.so-net.ne.jp. [121.3.68.227]) by smtp.gmail.com with ESMTPSA id m24sm2667406pfi.34.2016.08.02.01.17.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Aug 2016 01:17:22 -0700 (PDT) From: Masashi Honma To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, j@w1.fi, me@bobcopeland.com, Masashi Honma Subject: [PATCH v2] mac80211: End the MPSP even if EOSP frame was not acked Date: Tue, 2 Aug 2016 17:16:57 +0900 Message-Id: <1470125817-4461-1-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468393475-2483-1-git-send-email-masashi.honma@gmail.com> References: <1468393475-2483-1-git-send-email-masashi.honma@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If QoS frame with EOSP (end of service period) subfield=1 sent by local peer was not acked by remote peer, local peer did not end the MPSP. This prevents local peer from going to DOZE state. And if the remote peer goes away without closing connection, local peer continues AWAKE state and wastes battery. Signed-off-by: Masashi Honma --- net/mac80211/status.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/net/mac80211/status.c b/net/mac80211/status.c index c6d5c72..a2a6826 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -771,6 +771,13 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) clear_sta_flag(sta, WLAN_STA_SP); acked = !!(info->flags & IEEE80211_TX_STAT_ACK); + + /* mesh Peer Service Period support */ + if (ieee80211_vif_is_mesh(&sta->sdata->vif) && + ieee80211_is_data_qos(fc)) + ieee80211_mpsp_trigger_process( + ieee80211_get_qos_ctl(hdr), sta, true, acked); + if (!acked && test_sta_flag(sta, WLAN_STA_PS_STA)) { /* * The STA is in power save mode, so assume @@ -781,13 +788,6 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) return; } - /* mesh Peer Service Period support */ - if (ieee80211_vif_is_mesh(&sta->sdata->vif) && - ieee80211_is_data_qos(fc)) - ieee80211_mpsp_trigger_process( - ieee80211_get_qos_ctl(hdr), - sta, true, acked); - if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL) && (ieee80211_is_data(hdr->frame_control)) && (rates_idx != -1))