From patchwork Thu Mar 17 14:51:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 8612041 X-Patchwork-Delegate: johannes@sipsolutions.net 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 81EE1C0553 for ; Thu, 17 Mar 2016 14:51:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1A452035E for ; Thu, 17 Mar 2016 14:51:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF05C2026C for ; Thu, 17 Mar 2016 14:51:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030523AbcCQOvu (ORCPT ); Thu, 17 Mar 2016 10:51:50 -0400 Received: from mga02.intel.com ([134.134.136.20]:36465 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030437AbcCQOvr (ORCPT ); Thu, 17 Mar 2016 10:51:47 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 17 Mar 2016 07:51:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,350,1455004800"; d="scan'208";a="766129460" Received: from egrumbacbox.jer.intel.com ([10.12.127.95]) by orsmga003.jf.intel.com with ESMTP; 17 Mar 2016 07:51:45 -0700 From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 2/2] mac80211: close the SP when we enqueue frames during the SP Date: Thu, 17 Mar 2016 16:51:42 +0200 Message-Id: <1458226302-6086-2-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458226302-6086-1-git-send-email-emmanuel.grumbach@intel.com> References: <1458226302-6086-1-git-send-email-emmanuel.grumbach@intel.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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Since we enqueued the frame that was supposed to be sent during the SP, and that frame may very well cary the IEEE80211_TX_STATUS_EOSP bit, we may never close the SP (WLAN_STA_SP will never be cleared). If that happens, we will not open any new SP and will never respond to any poll frame from the client. Clear WLAN_STA_SP manually if a frame that was polled during the SP is queued because of a starting A-MPDU session. The client may not see the EOSP bit, but it will at least be able to poll new frames in another SP. Reported-by: Alesya Shapira Signed-off-by: Emmanuel Grumbach --- net/mac80211/tx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 114509a..5473281 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1116,6 +1116,13 @@ static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, reset_agg_timer = true; } else { queued = true; + /* XXX: should I test IEEE80211_TX_STATUS_EOSP here? */ + if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER) { + clear_sta_flag(tx->sta, WLAN_STA_SP); + ps_dbg(tx->sta->sdata, + "STA %pM aid %d: SP frame queued, close the SP w/o telling the peer\n", + tx->sta->sta.addr, tx->sta->sta.aid); + } info->control.vif = &tx->sdata->vif; info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;