From patchwork Tue Jan 20 17:01:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 5671191 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B02DC9F357 for ; Tue, 20 Jan 2015 17:04:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4CE9203AD for ; Tue, 20 Jan 2015 17:04:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13B0220412 for ; Tue, 20 Jan 2015 17:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755855AbbATREs (ORCPT ); Tue, 20 Jan 2015 12:04:48 -0500 Received: from mail-oi0-f42.google.com ([209.85.218.42]:57107 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754804AbbATRBs (ORCPT ); Tue, 20 Jan 2015 12:01:48 -0500 Received: by mail-oi0-f42.google.com with SMTP id i138so2448804oig.1; Tue, 20 Jan 2015 09:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=1PQEUhvseSmwokgTOyuowjI+af+kaxlLaPN+LcphiwY=; b=Fcw0CKVctuJasEabSxtTU3gIOc5GqI7ZGbqQlQri542AEbldlmN47f6PNRtDlgRRZq OrjynSIjvhkzunOs76Yd+1kLQ1ng1DVYUfpr3Ch8rriQ4ysiobhF3xMtF9UiUQwUSpah aDwkBqI2vYU6QCIS+jAVDQYfiBjKa0HiCMztikZO1uqZmGvMF1Uj0tDo4+YsZNJeFMNY 8f5TomhpnCXrfrnZwtM5ZeYohFU4UYKKnVyxQt0oKks1Xp+1xB/HA07iQg6KFnCFj3/+ uR3cXS6KDGIidf2hPAr1idrfdBeADqz/Mc7DpbWoYt14fsh1TqtI8qVbaRnddfZI5zA7 URgw== X-Received: by 10.202.45.79 with SMTP id t76mr21122509oit.100.1421773307208; Tue, 20 Jan 2015 09:01:47 -0800 (PST) Received: from linux.site ([69.76.245.152]) by mx.google.com with ESMTPSA id ox19sm7495599oeb.17.2015.01.20.09.01.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jan 2015 09:01:46 -0800 (PST) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Troy Tan , netdev@vger.kernel.org, Larry Finger , Stable Subject: [PATCH V2 for 3.19 5/7] rtlwifi: rtl8192ee: Fix parsing of received packet Date: Tue, 20 Jan 2015 11:01:24 -0600 Message-Id: <1421773286-1039-6-git-send-email-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1421773286-1039-1-git-send-email-Larry.Finger@lwfinger.net> References: <1421773286-1039-1-git-send-email-Larry.Finger@lwfinger.net> 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_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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 From: Troy Tan The firmware supplies two kinds of packets via the RX mechanism. Besides the normal data received over the air, these packets may contain bluetooth status and other information. The present code fails to detect which kind of information was received. Signed-off-by: Troy Tan Signed-off-by: Larry Finger Cc: Stable [V3.18] --- drivers/net/wireless/rtlwifi/rtl8192ee/trx.c | 4 ++++ drivers/net/wireless/rtlwifi/rtl8192ee/trx.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c index 1535680..cb3cbb6 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c @@ -354,6 +354,10 @@ bool rtl92ee_rx_query_desc(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr; u32 phystatus = GET_RX_DESC_PHYST(pdesc); + if (GET_RX_STATUS_DESC_RPT_SEL(pdesc) == 0) + status->packet_report_type = NORMAL_RX; + else + status->packet_report_type = C2H_PACKET; status->length = (u16)GET_RX_DESC_PKT_LEN(pdesc); status->rx_drvinfo_size = (u8)GET_RX_DESC_DRV_INFO_SIZE(pdesc) * RX_DRV_INFO_SIZE_UNIT; diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/trx.h b/drivers/net/wireless/rtlwifi/rtl8192ee/trx.h index c56f305..8f78ac9 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ee/trx.h +++ b/drivers/net/wireless/rtlwifi/rtl8192ee/trx.h @@ -542,6 +542,8 @@ LE_BITS_TO_4BYTE(__pdesc+8, 12, 4) #define GET_RX_DESC_RX_IS_QOS(__pdesc) \ LE_BITS_TO_4BYTE(__pdesc+8, 16, 1) +#define GET_RX_STATUS_DESC_RPT_SEL(__pdesc) \ + LE_BITS_TO_4BYTE(__pdesc+8, 28, 1) #define GET_RX_DESC_RXMCS(__pdesc) \ LE_BITS_TO_4BYTE(__pdesc+12, 0, 7)