From patchwork Fri Jun 13 21:41:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathy Vanhoef X-Patchwork-Id: 4351811 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BD71C9F314 for ; Fri, 13 Jun 2014 21:41:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDC582026F for ; Fri, 13 Jun 2014 21:41:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16CAB2026D for ; Fri, 13 Jun 2014 21:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753198AbaFMVlu (ORCPT ); Fri, 13 Jun 2014 17:41:50 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:48674 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751811AbaFMVlt (ORCPT ); Fri, 13 Jun 2014 17:41:49 -0400 Received: by mail-wi0-f171.google.com with SMTP id n15so1560592wiw.16 for ; Fri, 13 Jun 2014 14:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=yyOnymXAMiSvxqNWVGb6x5wJC3m4zYzMzeh96kw4eN0=; b=pJM5aeL8Bp64pIhTBkNC65CMYQ9fX4p2EXk/Zxx8iWqdwyHHhJcz+4uH/8idbgsbPF 2t94kk+TqKzGn2PE8/uR4cC1+Sn1L81UEwgP3l5ytlsq6S+Cb/ajn+oDeJxYNZjTVcsG /utpUsdNniWw4pYavJ0ermowW57+2XI521zhu9poPgZsVjUtRdr5CBhgIWUPfAMCZ/Sq dAVZYH25hPew9qUsDAEvWoJTPhCMqySE93WPXcjsEuJCeYVtUIck/Fb02QJlU4IhP2qx VJmH3nv5rfHZUynfe67wg/1H0nEyhYJZfvs4vO4O5Yr4ij7kxOub4eGuZWod0hR+LX+x Dnog== X-Received: by 10.180.99.166 with SMTP id er6mr8170573wib.48.1402695708296; Fri, 13 Jun 2014 14:41:48 -0700 (PDT) Received: from ?IPv6:2a02:2c40:100:a000:71d3:36df:1e48:f164? ([2a02:2c40:100:a000:71d3:36df:1e48:f164]) by mx.google.com with ESMTPSA id gi8sm4598661wib.8.2014.06.13.14.41.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 14:41:47 -0700 (PDT) Message-ID: <539B7019.1050801@gmail.com> Date: Fri, 13 Jun 2014 23:41:45 +0200 From: Mathy Vanhoef User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: "John W. Linville" CC: linux-wireless@vger.kernel.org, Jiri Slaby , Nick Kossifidis , "Luis R. Rodriguez" , ath5k-devel@lists.ath5k.org Subject: [PATCH 2/2] ath5k: capture CCK and OFDM restarts Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Hi all, This patch allows users to see CCK and OFDM restarts when FIF_FCSFAIL is set. Without this patch only the stronger frame (causing the restart) would be visible. The patch has been tested using our reactive jammer. The prefix of the weaker frame is being correctly passed on as a frame with bad CRC! --- From: "Mathy Vanhoef" Treat frames that underwent a CCK or OFDM restart as frames with an invalid CRC. Signed-off-by: Mathy Vanhoef --- drivers/net/wireless/ath/ath5k/base.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 39ba642..1bbc850 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c @@ -1462,7 +1462,19 @@ ath5k_receive_frame_ok(struct ath5k_hw *ah, struct ath5k_rx_status *rs) ah->stats.rxerr_phy++; if (rs->rs_phyerr > 0 && rs->rs_phyerr < 32) ah->stats.rxerr_phy_code[rs->rs_phyerr]++; - return false; + + /* + * Threat packets that underwent a CCK of OFDM reset as having a bad CRC. + * These restarts happen when the radio resynchronizes to a stronger frame + * while receiving a weaker frame. Here we receive the prefix of the weak + * frame. Since these are incomplete packets, mark their CRC as invalid. + */ + if (rs->rs_phyerr == AR5K_RX_PHY_ERROR_OFDM_RESTART || + rs->rs_phyerr == AR5K_RX_PHY_ERROR_CCK_RESTART) { + rs->rs_status |= AR5K_RXERR_CRC; + rs->rs_status &= (~AR5K_RXERR_PHY); + } } if (rs->rs_status & AR5K_RXERR_DECRYPT) { /* -- 1.8.1.2