From patchwork Sun Feb 1 11:59:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 5756651 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 6FC58BF440 for ; Sun, 1 Feb 2015 12:00:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7ADAF201F2 for ; Sun, 1 Feb 2015 12:00:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E44620218 for ; Sun, 1 Feb 2015 12:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752915AbbBAMAU (ORCPT ); Sun, 1 Feb 2015 07:00:20 -0500 Received: from mail-we0-f176.google.com ([74.125.82.176]:36233 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840AbbBAMAP (ORCPT ); Sun, 1 Feb 2015 07:00:15 -0500 Received: by mail-we0-f176.google.com with SMTP id w62so34366461wes.7 for ; Sun, 01 Feb 2015 04:00:14 -0800 (PST) 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=M9jtJq2JVtRSzAOQ41ywDzfoRlW8iSQSKsDqkQiGfBI=; b=phEhPrc5BcBkoC7hDDeUCg2F3xrY4Y6CZoPUKysdA9EZ05Ma6DPablbmalxl4QJ63G CZWTlanRPqofUNztNMi5KA+fL7naOG/kv/P0bfa4tDQkiZsMWOIvO0hOof3l8JNY56J3 AcnehcXcQstKbGHidykDRLv4K5YmOeJqY7U7zW5IFKht2Or8tWpQw/L5Lryz+xiLLflf 3Uc2V/NK0wXzutGIz2Es62euGFvqVFCG3gSX6daMkAjcWrPpJt3TK6WrarDsqdKz3VMS LXgAqg7ADPrLCLEa93pQfej3UOqvgRyZ2lVwpjgZjjmKvgMdB1pYhDiz77oVOUClu8ba f72Q== X-Received: by 10.180.73.112 with SMTP id k16mr13472600wiv.42.1422792014057; Sun, 01 Feb 2015 04:00:14 -0800 (PST) Received: from tipsey.3.home (94.196.240.163.threembb.co.uk. [94.196.240.163]) by mx.google.com with ESMTPSA id ud9sm15074446wib.5.2015.02.01.04.00.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Feb 2015 04:00:13 -0800 (PST) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Malcolm Priestley Subject: [PATCH 4/6] staging: vt6655: vnt_rx_data add track rsr and new_rsr errors Date: Sun, 1 Feb 2015 11:59:41 +0000 Message-Id: <1422791983-3408-4-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422791983-3408-1-git-send-email-tvboxspy@gmail.com> References: <1422791983-3408-1-git-send-email-tvboxspy@gmail.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.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 If not rsr & RSR_CRCOK report RX_FLAG_FAILED_FCS_CRC If not rsr & (RSR_IVLDTYP | RSR_IVLDLEN) drop packet If not NEWRSR_DECRYPTOK on new_rsr drop packet. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/dpc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index 11cc090..3c5b87f 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c @@ -91,6 +91,8 @@ static bool vnt_rx_data(struct vnt_private *priv, struct sk_buff *skb, new_rsr = skb_data + bytes_received - 3; rssi = skb_data + bytes_received - 2; rsr = skb_data + bytes_received - 1; + if (*rsr & (RSR_IVLDTYP | RSR_IVLDLEN)) + return false; RFvRSSITodBm(priv, *rssi, &rx_dbm); @@ -106,6 +108,9 @@ static bool vnt_rx_data(struct vnt_private *priv, struct sk_buff *skb, rx_status.flag = 0; rx_status.freq = hw->conf.chandef.chan->center_freq; + if (!(*rsr & RSR_CRCOK)) + rx_status.flag |= RX_FLAG_FAILED_FCS_CRC; + hdr = (struct ieee80211_hdr *)(skb->data); fc = hdr->frame_control; @@ -113,7 +118,11 @@ static bool vnt_rx_data(struct vnt_private *priv, struct sk_buff *skb, if (ieee80211_has_protected(fc)) { if (priv->byLocalID > REV_ID_VT3253_A1) - rx_status.flag = RX_FLAG_DECRYPTED; + rx_status.flag |= RX_FLAG_DECRYPTED; + + /* Drop packet */ + if (!(*new_rsr & NEWRSR_DECRYPTOK)) + return false; } memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));