From patchwork Wed Mar 12 09:37:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 3816031 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 16298BF540 for ; Wed, 12 Mar 2014 09:43:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9BEE320179 for ; Wed, 12 Mar 2014 09:43:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC56420172 for ; Wed, 12 Mar 2014 09:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753392AbaCLJnZ (ORCPT ); Wed, 12 Mar 2014 05:43:25 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:37265 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752510AbaCLJnF (ORCPT ); Wed, 12 Mar 2014 05:43:05 -0400 Received: by mail-qc0-f174.google.com with SMTP id x13so10620235qcv.5 for ; Wed, 12 Mar 2014 02:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=2Pked3LpxPoaLja+n1bNqBAM/ehDkGO40whRAQMLsTQ=; b=C8IphjL8S7V4CM9l18ND3IiRF6DNcBaqZvi/93X6eps34CSXzoMoe893LoOZWrXsgG IRXt7CkslIOVaq8X3dsGodveS5T7tGZUWW01EgcuufGfsSCWNP36sRD/o3w+u+YJkwUQ CzNbAPB41iRUicFHUzKSTX/slERjRRO6Yney7GDieSGZItCWDkuCEewyYv/I/6VGsGy3 NSAT0B9EFr/7Sz/mZwZk5kuxYo/nPrkM7+Ad6yTH/NH9JqjZvzd4Gj95OjlPukQvCUYr Fu4FLvd/19ZFwScmm6UVOIa+b+9VJxEAQOhs6oo8PuT1G+IOn8fJOC/tBDS7lDOqyI2C +nyw== X-Received: by 10.224.92.75 with SMTP id q11mr54417135qam.56.1394617384348; Wed, 12 Mar 2014 02:43:04 -0700 (PDT) Received: from hschaa-desktop.site (HSI-KBW-091-089-000-006.hsi2.kabelbw.de. [91.89.0.6]) by mx.google.com with ESMTPSA id b3sm37560677qae.2.2014.03.12.02.43.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Mar 2014 02:43:03 -0700 (PDT) From: Helmut Schaa To: linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com, Helmut Schaa , Felix Fietkau Subject: [PATCH] ath9k: Fix sequence number assignment for non-data frames Date: Wed, 12 Mar 2014 10:37:55 +0100 Message-Id: <1394617075-24664-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.8.1.4 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 Since commit 558ff225de80ac95b132d3a115ddadcd64498b4f (ath9k: fix ps-poll responses under a-mpdu sessions) non-data frames would have gotten a sequence number from a TIDs sequence counter instead of using the global sequence counter. This can lead to instable connections. To fix this only select the correct TID if we are processing a data frame. Furthermore, prevent non-data frames to get a sequence number from a TID sequence counter by adding a check to ath_tx_setup_buffer. Cc: Felix Fietkau Signed-off-by: Helmut Schaa Acked-by: Felix Fietkau --- drivers/net/wireless/ath/ath9k/xmit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index fafacfe..69d04d5 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -2064,7 +2064,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, ATH_TXBUF_RESET(bf); - if (tid) { + if (tid && ieee80211_is_data_present(hdr->frame_control)) { fragno = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; seqno = tid->seq_next; hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT); @@ -2187,7 +2187,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, txq->stopped = true; } - if (txctl->an) + if (txctl->an && ieee80211_is_data_present(hdr->frame_control)) tid = ath_get_skb_tid(sc, txctl->an, skb); if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) {