From patchwork Sat Apr 4 19:49:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 6161491 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 D672D9F54F for ; Sat, 4 Apr 2015 19:49:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23BFD203B7 for ; Sat, 4 Apr 2015 19:49:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 293CC203F4 for ; Sat, 4 Apr 2015 19:49:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753025AbbDDTth (ORCPT ); Sat, 4 Apr 2015 15:49:37 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:36299 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753010AbbDDTtf (ORCPT ); Sat, 4 Apr 2015 15:49:35 -0400 Received: by wizk4 with SMTP id k4so874474wiz.1; Sat, 04 Apr 2015 12:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=O1aKP9Jp0jIRZsWSTJStJ4GvXGbQoIxXP33c1V3RPH0=; b=RafLWEa9E8SmiYVtqkED3wyMbCl3g1RrSveuYSOSLxCi7qiP68eC5sDnEPswKjWy22 p1eW8otK98HG3NLy+K/qHwSEdbOdjw4slSrjzNSBn7MqZkTuaFqZTY7OHoWCjqYh9YYY Y+zcFkwNjzGK8ABFIZxHgzBP6ChQ90Kn33OJsxiamiIxuJNmurCryrCWJqsIqsqZkDI6 Po9NIJzAhI4JUsdUZUpwOivgoxaDOf3G7hqP1bdTAFu21xFlYzR7/wnMjPbzrkK3nlmA EYmtixWeD4FiqsHctFkHcMU/B7u6zR0IEjl2DaKApXgKw/UQWuF3WzB0b3XK2Mq5euz5 pt2g== X-Received: by 10.180.79.227 with SMTP id m3mr28565013wix.71.1428176974369; Sat, 04 Apr 2015 12:49:34 -0700 (PDT) Received: from tipsey.3.home (188.29.102.41.threembb.co.uk. [188.29.102.41]) by mx.google.com with ESMTPSA id ad7sm188329wid.21.2015.04.04.12.49.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Apr 2015 12:49:33 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley , Subject: [PATCH] staging: vt6656: use ieee80211_tx_info to select packet type. Date: Sat, 4 Apr 2015 20:49:10 +0100 Message-Id: <1428176950-3128-1-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.1.0 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 Information for packet type is in ieee80211_tx_info band IEEE80211_BAND_5GHZ for PK_TYPE_11A. IEEE80211_TX_RC_USE_CTS_PROTECT via tx_rate flags selects PK_TYPE_11GB This ensures that the packet is always the right type. Signed-off-by: Malcolm Priestley Cc: # v3.17+ --- drivers/staging/vt6656/rxtx.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index f6c2cf8..5c58996 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -805,10 +805,18 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) vnt_schedule_command(priv, WLAN_CMD_SETPOWER); } - if (current_rate > RATE_11M) - pkt_type = priv->packet_type; - else + if (current_rate > RATE_11M) { + if (info->band == IEEE80211_BAND_5GHZ) { + pkt_type = PK_TYPE_11A; + } else { + if (tx_rate->flags & IEEE80211_TX_RC_USE_CTS_PROTECT) + pkt_type = PK_TYPE_11GB; + else + pkt_type = PK_TYPE_11GA; + } + } else { pkt_type = PK_TYPE_11B; + } spin_lock_irqsave(&priv->lock, flags);