From patchwork Wed Jan 30 22:37:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 2070051 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8C3B5DF2A1 for ; Wed, 30 Jan 2013 23:02:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756503Ab3A3XCV (ORCPT ); Wed, 30 Jan 2013 18:02:21 -0500 Received: from mail-bk0-f49.google.com ([209.85.214.49]:65255 "EHLO mail-bk0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756131Ab3A3XCU (ORCPT ); Wed, 30 Jan 2013 18:02:20 -0500 Received: by mail-bk0-f49.google.com with SMTP id w11so1088285bku.36 for ; Wed, 30 Jan 2013 15:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:date:subject:to:cc:message-id; bh=RpWNwWC9PDEFo+t2FcA1i4L4VbpypDS031+WRa0KzQg=; b=pOq1A0Fz7tu1oCljQhC5psDKADsgZw710skcbGeiQb+HItEfIe9AByq2HbopwWrgBW sBXEqbYEUflDJKlQdEOnAC98M5oH3upeqvwk9fAhchTc4MtJzQvYBdykscQcFzXdRh1K yUFmyUh/GSDJ1LdIy8TNLKvgK+Khjh9t4V3/9H+cUPFKl+zjptD2uBxVtJ/fYsvQ4z9p i5N3RZUZwmZrZCgjQZkFJ1cdGLMn/hDhshmUBU1rKqcFEgJHRQ17XngfuGrYhox5GRtx THo2frFE3yze4V47PlrgQ6rAUYMYlfUSIxmZNavX5RdFAtl3MNJgZK3VQSCJQql8PAqc PBNg== X-Received: by 10.204.147.142 with SMTP id l14mr1682954bkv.129.1359586938980; Wed, 30 Jan 2013 15:02:18 -0800 (PST) Received: from blech.mobile (f053215002.adsl.alicedsl.de. [78.53.215.2]) by mx.google.com with ESMTPS id i20sm1143433bkw.5.2013.01.30.15.02.17 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jan 2013 15:02:18 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by blech.mobile (Postfix) with ESMTP id C715E1001E7; Thu, 31 Jan 2013 00:02:16 +0100 (CET) Received: from blech.mobile ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LgMAjskCX3P3; Thu, 31 Jan 2013 00:02:16 +0100 (CET) Received: from blech.localnet (localhost [127.0.0.1]) by blech.mobile (Postfix) with ESMTP id 42EA11001D6; Thu, 31 Jan 2013 00:02:16 +0100 (CET) From: Christian Lamparter Date: Wed, 30 Jan 2013 23:37:41 +0100 Subject: [PATCH] ath9k: report A-MPDU status To: linux-wireless@vger.kernel.org Cc: Felix Fietkau , senthilb@qca.qualcomm.com, vthiagar@qca.qualcomm.com, Adrian Chadd , John Linville Message-Id: <20130130230216.42EA11001D6@blech.mobile> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The ath9k hardware reports whenever an frame was part of an A-MPDU. MAC80211 already provides the necessary API to pass this additional information along to whomever needs it. Signed-off-by: Christian Lamparter --- No locking necessary. The ampdu_ref var is only read and updated within the rx tasklet. --- drivers/net/wireless/ath/ath9k/ath9k.h | 2 ++ drivers/net/wireless/ath/ath9k/recv.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 67df864..21e2e42 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -319,6 +319,8 @@ struct ath_rx { struct ath_rx_edma rx_edma[ATH9K_RX_QUEUE_MAX]; struct sk_buff *frag; + + u32 ampdu_ref; }; int ath_startrecv(struct ath_softc *sc); diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 2af6f19..87497f3 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c @@ -1123,6 +1123,24 @@ static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr, #endif } +static void ath9k_apply_ampdu_details(struct ath_softc *sc, + struct ath_rx_status *rs, struct ieee80211_rx_status *rxs) +{ + if (rs->rs_isaggr) { + rxs->flag |= RX_FLAG_AMPDU_DETAILS | RX_FLAG_AMPDU_LAST_KNOWN; + + rxs->ampdu_reference = sc->rx.ampdu_ref; + + if (!rs->rs_moreaggr) { + rxs->flag |= RX_FLAG_AMPDU_IS_LAST; + sc->rx.ampdu_ref++; + } + + if (rs->rs_flags & ATH9K_RX_DELIM_CRC_PRE) + rxs->flag |= RX_FLAG_AMPDU_DELIM_CRC_ERROR; + } +} + int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) { struct ath_buf *bf; @@ -1329,6 +1347,8 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx == 3) ath_ant_comb_scan(sc, &rs); + ath9k_apply_ampdu_details(sc, &rs, rxs); + ieee80211_rx(hw, skb); requeue_drop_frag: