From patchwork Thu May 21 09:31:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11562537 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8CBA8138A for ; Thu, 21 May 2020 09:31:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71D2E2072C for ; Thu, 21 May 2020 09:31:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WOMHCO5r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728820AbgEUJbk (ORCPT ); Thu, 21 May 2020 05:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728704AbgEUJbk (ORCPT ); Thu, 21 May 2020 05:31:40 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9DAEC061A0E for ; Thu, 21 May 2020 02:31:39 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id g12so4780252wrw.1 for ; Thu, 21 May 2020 02:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=8Xy4F09kjG4qIrtXe0CxsoffCIloB6B/lxDeVupgx+c=; b=WOMHCO5r/+JSEOLRQoG3VeYHZXyajd4nIwrHzdZTMVxYgAVcJtB05oRN/b7D3TolcF uxhlTyhchzznNp8zN1t0/ne9LK1wzUoU5Pja8+R89KkeL+ZkrcNJa9pB9nxL2QCHygXk aKeW5qI5OhqFMMjcfYSfAXZnhGLfDsLFyvcHjUs9gb2PAbBh6ZcdG3jiujodbAQPlKXu MCowsC4d/ZAMmETSsVaQ/Yeil47+p6EZT2su6Up/Xt5gGi0GqaEBTXaXahHkDUe+I4Oq bpRN1Z3SWe3uQkQ+GD3ndyhBPGXvMzL0EtZ36BLKvmLkW0NHsttmlEml55oRnI9UD8EQ Axqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=8Xy4F09kjG4qIrtXe0CxsoffCIloB6B/lxDeVupgx+c=; b=VZhfBMNwITunLjRyeLdXG7AWjBcjb7qQiwnA4EtiEl8YuDt/2OOXrTIu2FtBM+SEY5 q/WdU/uacwX7rVM/MPONn6swkj0SRuw49P0iFOJJv+xZf7SzZxHq37zHAuIu93zmJObJ yD7h4pr0ETh4jAtvUQ5/6mPJaH9TdZq1dQXoneeLoSvz1EqoVueNlDPzFncjXcN5bcT0 b+S62elH7eHBDhtTfa4MEyWgTEYPF+vCoUEwqDFpnIJJOM8bL2mMMvTX2wAXDpofDI1f 0qcKsqd30iNnizlmc/CfUSfW/0I8kAxF7DBrR9u+yZ5g+VN9Os1VKQs2wsvr7VVoJHUR zg0g== X-Gm-Message-State: AOAM530bzfj4VgfZPeK59xdlVI4+jL1fMpwZhpq9oqErFY9bHphD9AOC C+f+EPOtWGaoy7xS+8gs80GTDlfSl0iaYA== X-Google-Smtp-Source: ABdhPJx+RjkbunaR4c0lPQOZgi/mZNT9ej++tVyCFe65wtpfyzXVGccrQLe7AQBay545mTqhhbQYLw== X-Received: by 2002:adf:a15c:: with SMTP id r28mr2922817wrr.337.1590053498236; Thu, 21 May 2020 02:31:38 -0700 (PDT) Received: from [192.168.43.18] ([85.255.237.70]) by smtp.gmail.com with ESMTPSA id g69sm929660wmg.15.2020.05.21.02.31.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 02:31:37 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 01/10] staging: vt6656: remove ieee80211_hdr from vnt_usb_send_context. To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: <556fab01-aa1e-154e-149e-c04feeb76efa@gmail.com> Date: Thu, 21 May 2020 10:31:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org It is only used in one place were it can be pointed to at skb->data. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/device.h | 1 - drivers/staging/vt6656/rxtx.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h index d1b19dcaf991..0486aabba061 100644 --- a/drivers/staging/vt6656/device.h +++ b/drivers/staging/vt6656/device.h @@ -238,7 +238,6 @@ struct vnt_rcb { struct vnt_usb_send_context { void *priv; struct sk_buff *skb; - struct ieee80211_hdr *hdr; void *tx_buffer; unsigned int buf_len; u32 frame_len; diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 8f9904c8045c..a47f42bedfa9 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -73,8 +73,6 @@ static struct vnt_usb_send_context context = priv->tx_context[ii]; if (!context->in_use) { context->in_use = true; - context->hdr = NULL; - return context; } } @@ -392,7 +390,7 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context, struct sk_buff *skb, u16 payload_len, struct vnt_mic_hdr *mic_hdr) { - struct ieee80211_hdr *hdr = tx_context->hdr; + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; u64 pn64; u8 *iv = ((u8 *)hdr + ieee80211_get_hdrlen_from_skb(skb)); @@ -544,7 +542,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) tx_context->need_ack = false; tx_context->frame_len = skb->len + 4; tx_context->tx_rate = rate->hw_value; - tx_context->hdr = hdr; spin_unlock_irqrestore(&priv->lock, flags); From patchwork Thu May 21 09:33:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11562541 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC54714E3 for ; Thu, 21 May 2020 09:33:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94CDD20759 for ; Thu, 21 May 2020 09:33:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kqgstXur" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728827AbgEUJdP (ORCPT ); Thu, 21 May 2020 05:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728704AbgEUJdO (ORCPT ); Thu, 21 May 2020 05:33:14 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 686BAC061A0E for ; Thu, 21 May 2020 02:33:14 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id h17so5965230wrc.8 for ; Thu, 21 May 2020 02:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=TRsInQSBwN+shLNJB6dj9nN2OgX9fcoBCx1Y8zTY1JE=; b=kqgstXurDIFYnkHExtT62KqsA7sxo8V5X8yBsY+QlbYBBsrH8oEFGFkOD8nhkCm8x+ Slbed7rXS/DzANGdhdtfJhcvC0uwbdy/sI/+GuU7WLj4wO09I62QCfGzybutw8HSFry2 Fw0rBUluxG/MlZ6zDbOjKO3X7z/1qq/0lKAgACmeIrNKKvl4xn3Yvc2d2TIl7/IYzNxe YdUZar/wsb/hz99bvqs1HRLn4Vv044mT8MvVQpxlFAO/AbwVXJKXcxR8Lg72E8lTLUvx L10KKDBnXj8S2Xwt10oknp7naZLXCqV2HcaAqnghSUyIGMFmqlqzAZ7MCZ88eO8NX3eU Hx7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=TRsInQSBwN+shLNJB6dj9nN2OgX9fcoBCx1Y8zTY1JE=; b=t8oktODWeLbNIQLE6rU9SHWGhcYD71OhngcnkzWhKVYs6UwyZZUEGPW37nf540hwjA zWKOfqBVdIRl55V0mvhbnzyPtVE6zKakFaoTP25Z9JGDkUWzJZUTOP4LjXcqqTMunie5 UqvXXdKZTYTAvb8m3sBYVw4C1qrgDPbovRaw0+WguMP3UY5sYl2IMkf4bz/FjKdr1Mwb 3vi/aQ7QRxB0yEtZ5MicNohEknmY7gv3F8ElPQiKkpWcnnVakyE0/Ce8sdd8gMYKZHXf wJcnHd8uOI4B+t9EFIyQij7DUSnpGzrnPryTLMImC8fffUL+ZAxvnoupMNZd4hOL2LaC HxUA== X-Gm-Message-State: AOAM530KgiKypaaBfUxtD6TVDLjlgsNmlPUIumgOgr6lxhQtcG7iNzZJ ygmE13BDBpdJkQc38VlKKRUZo6ilkKzw8A== X-Google-Smtp-Source: ABdhPJzAaHKK0g2fpCO5WomK+FhJORBjK6lJ0C8ilrGJjwYls4pqfsTh5rLTN3WJifhnZgS6CJ+Tzg== X-Received: by 2002:adf:9d91:: with SMTP id p17mr7454308wre.119.1590053592966; Thu, 21 May 2020 02:33:12 -0700 (PDT) Received: from [192.168.43.18] ([85.255.237.70]) by smtp.gmail.com with ESMTPSA id 89sm5966904wrj.37.2020.05.21.02.33.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 02:33:12 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 02/10] staging: vt6656: rxtx remove unused need_ack To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: Date: Thu, 21 May 2020 10:33:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org need_ack is no longer used by driver remove it. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/device.h | 1 - drivers/staging/vt6656/rxtx.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h index 0486aabba061..d89f564a13c4 100644 --- a/drivers/staging/vt6656/device.h +++ b/drivers/staging/vt6656/device.h @@ -246,7 +246,6 @@ struct vnt_usb_send_context { u8 type; u8 pkt_no; u8 pkt_type; - u8 need_ack; bool in_use; }; diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index a47f42bedfa9..24acc2de0fb9 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -539,7 +539,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) tx_context->skb = skb; tx_context->pkt_type = pkt_type; - tx_context->need_ack = false; tx_context->frame_len = skb->len + 4; tx_context->tx_rate = rate->hw_value; @@ -587,10 +586,8 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) cpu_to_le16(DEFAULT_MSDU_LIFETIME_RES_64us); } - if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { + if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_NEEDACK); - tx_context->need_ack = true; - } if (ieee80211_has_retry(hdr->frame_control)) tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LRETRY); From patchwork Thu May 21 09:38:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11562557 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56E28912 for ; Thu, 21 May 2020 09:38:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 39AD42072C for ; Thu, 21 May 2020 09:38:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kFN0jhhJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728861AbgEUJia (ORCPT ); Thu, 21 May 2020 05:38:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728719AbgEUJia (ORCPT ); Thu, 21 May 2020 05:38:30 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E519CC061A0E for ; Thu, 21 May 2020 02:38:29 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id l17so6013191wrr.4 for ; Thu, 21 May 2020 02:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=OgyKLtsl9tNNZ+v+VLvWxQraa+qu3UB9bjlUpwB1inI=; b=kFN0jhhJnSIpf27pQnJxKA3G7ECLmLhcTQoiAu2pGIBpKqn8lQNBFvWEjdxEJuAL9E T+RNjyehSBZk51qqRYYRCJXMQMJcwOHr0/PmONibbePBVo5FjGyrYQcC0evwTZTQRP0m JB1I8RM9HLyTTbjzSW+sOXzAClB/dR0V0nR9WmNfata8nP2cNyw5ZxOwa6XTqIKCWMvT DE0zbikggO7Ja0K2OewPVAEgLJsjhR70R6f+gP/Gyv1MtC7qs2xdKwtlnOdjnqIQq4Z8 rPvGT16/TvlL7mtHK40K9/EnvmqMG6HTvVuY79p/rv/kjMXN2HuVWBMBv5W5ZgnWMET5 z1nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=OgyKLtsl9tNNZ+v+VLvWxQraa+qu3UB9bjlUpwB1inI=; b=ID9K3rzw6ctscWc7iM5h/j0FU6fdooZ/qKw6edTFsdi1RTniqGEBPTPhHWSw1VC3ZT yXkHdPynvEaf4DxY1qM2IheaL1UUyNW8lyBn20sEOfF7ZxCnKPOnYklpW5QpShW87yq/ lG8B1UmyIbju1YE+zCysxT3IH2PzC5nnBTVNmD9UER8UUDRi9bWawowilVEkIfFepr+e CGv7R2RR9+bsw6Q2qC06jqTCTPkdg6xAinFPjLL148FrVuJnut9I18+WYbPNiFOw4P9r z/FNVv3Zg9LRB5VTU5M4KStrhAU16Gd49QwEFsCJr12JrDnQ3NTBn/MuCGhw5uPW50sG cTjQ== X-Gm-Message-State: AOAM533TNKj8+DvLVCMsgpRs4iC5JzenetFtizq8d8uNzioJJ7zA68/F Um5kXQvnS/3lT3JAnlCEmgUdOYOTSfWtbg== X-Google-Smtp-Source: ABdhPJyQ2cs17INGlJLY+RvMyXNB1VzYC+aF4aMyXhxT1NEgIo3yqdwW4TIiKjW5rR8eXjYXBmKk6A== X-Received: by 2002:a5d:4041:: with SMTP id w1mr7746562wrp.245.1590053908476; Thu, 21 May 2020 02:38:28 -0700 (PDT) Received: from [192.168.43.18] ([85.255.237.70]) by smtp.gmail.com with ESMTPSA id e22sm5553779wrc.41.2020.05.21.02.38.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 02:38:28 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 03/10] staging: vt6656: Move vnt_mic_hdr pointers to vnt_fill_txkey To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: <6420a6ae-82eb-f794-fa7c-bac419222ad6@gmail.com> Date: Thu, 21 May 2020 10:38:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org mic_hdr has three possible locations ieee80211_tx_info can controls these with control.use_cts_prot for rts or cts exchange or otherwise the rts/data position. Removing double pointer. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 37 ++++++++++++++--------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 24acc2de0fb9..87fe7df07f03 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -356,40 +356,30 @@ static void vnt_rxtx_ab(struct vnt_usb_send_context *tx_context, static void vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context, struct vnt_tx_buffer *tx_buffer, - struct vnt_mic_hdr **mic_hdr, u32 need_mic, bool need_rts) { if (tx_context->pkt_type == PK_TYPE_11GB || tx_context->pkt_type == PK_TYPE_11GA) { if (need_rts) { - if (need_mic) - *mic_hdr = - &tx_buffer->tx_head.tx_rts.tx.mic.hdr; - vnt_rxtx_rts(tx_context, &tx_buffer->tx_head, need_mic); return; } - if (need_mic) - *mic_hdr = &tx_buffer->tx_head.tx_cts.tx.mic.hdr; - vnt_rxtx_cts(tx_context, &tx_buffer->tx_head, need_mic); return; } - if (need_mic) - *mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr; - vnt_rxtx_ab(tx_context, &tx_buffer->tx_head, need_rts, need_mic); } -static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context, +static void vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, u8 *key_buffer, struct ieee80211_key_conf *tx_key, - struct sk_buff *skb, u16 payload_len, - struct vnt_mic_hdr *mic_hdr) + struct sk_buff *skb, u16 payload_len) { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct vnt_mic_hdr *mic_hdr; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; u64 pn64; u8 *iv = ((u8 *)hdr + ieee80211_get_hdrlen_from_skb(skb)); @@ -416,9 +406,14 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context, break; case WLAN_CIPHER_SUITE_CCMP: - - if (!mic_hdr) - return; + if (info->control.use_cts_prot) { + if (info->control.use_rts) + mic_hdr = &tx_buffer->tx_head.tx_rts.tx.mic.hdr; + else + mic_hdr = &tx_buffer->tx_head.tx_cts.tx.mic.hdr; + } else { + mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr; + } mic_hdr->id = 0x59; mic_hdr->payload_len = cpu_to_be16(payload_len); @@ -497,7 +492,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) struct ieee80211_rate *rate; struct ieee80211_key_conf *tx_key; struct ieee80211_hdr *hdr; - struct vnt_mic_hdr *mic_hdr = NULL; struct vnt_tx_buffer *tx_buffer; struct vnt_tx_fifo_head *tx_buffer_head; struct vnt_usb_send_context *tx_context; @@ -624,16 +618,15 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) tx_buffer_head->current_rate = cpu_to_le16(rate->hw_value); - vnt_generate_tx_parameter(tx_context, tx_buffer, &mic_hdr, - need_mic, need_rts); + vnt_generate_tx_parameter(tx_context, tx_buffer, need_mic, need_rts); tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_NONFRAG); if (info->control.hw_key) { tx_key = info->control.hw_key; if (tx_key->keylen > 0) - vnt_fill_txkey(tx_context, tx_buffer_head->tx_key, - tx_key, skb, tx_body_size, mic_hdr); + vnt_fill_txkey(tx_buffer, tx_buffer_head->tx_key, + tx_key, skb, tx_body_size); } priv->seq_counter = (le16_to_cpu(hdr->seq_ctrl) & From patchwork Thu May 21 09:40:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11562561 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92160912 for ; Thu, 21 May 2020 09:40:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 79AC720721 for ; Thu, 21 May 2020 09:40:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zn1GURoc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728794AbgEUJkU (ORCPT ); Thu, 21 May 2020 05:40:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728719AbgEUJkU (ORCPT ); Thu, 21 May 2020 05:40:20 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47F2FC061A0E for ; Thu, 21 May 2020 02:40:19 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id n18so5696141wmj.5 for ; Thu, 21 May 2020 02:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=/pwdCDKjLF+e60HESsBhV0UAePDZFaCim4hK40cyzwA=; b=Zn1GURocLwVv1FHneGu28MRLLeF4Q1djtyuhV5Bb9sgDl0cC4K5A90QEfCbwEHFcqg k3JR8/RLEau0tIxz8ArgCiVcJDRqGQk19DDAg8iEN2IOkCIknBHI5gxUhJPZpjT54oLz z0YymAMBKm2wRIE6xHI3xzmVC1uvsYJ3HpdnWuNfdiVhOxwXgo3q+5hyYbWrTwsMWrvn 3Ov/sVohqQDAL+/qDZVCDuKeO9n9AyGt6zA9zAwzibbegw2LNkFabNpyAMq1epIMP/ib P89rU6QV1zS9bNL1QSSoYRiyLrWMM89lpL6j04/kc8eTaxnPVOOerOHH+EFXKEXwIAl1 ypwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=/pwdCDKjLF+e60HESsBhV0UAePDZFaCim4hK40cyzwA=; b=tzjlIKNALQLtINz6Lb1us+FZBvJbGltfsnSZYMIaTLosobncK4TAcKreQhsXVThb1m cmhe/si9VsaR/9tdpfA+I8GOnYYdpJ6LIQocommuU85UtrxI2BlGR8vjiRr1YgB7YYLR y9YtCZUHXYjAc67VEJCHjuNbTvm2r5sX+uvW8BA/oSY2DB6za9dyr5nmwUs6Da7y8dUb RzkwRV/SbBrt4yi/tneuQv8I/yIdE2hrKR6E7rcBsaeeEhkgv1nTe+HbUwvlsG9e0B28 lvoDeqrbvisVysliJAl3fTSoBW0biQccB6cOPiC+uYzwhj1wY/9sasLUDJTKcDrBaD6R 1ilw== X-Gm-Message-State: AOAM532go4uq0Ag0SuokL6deWlqH/lZQmHvAN+8fYX3Cqe7o9osRoNAV RfpncYTqOZA2uEiErgAZpGHdSIUMkcxvTw== X-Google-Smtp-Source: ABdhPJxDsCiFlcccVVUlVIMz9Z8lTmL2kVVlADYDenAoPU8toxDtwdxzxyNsz23M83mZOMb6fjCOkw== X-Received: by 2002:a7b:c5cc:: with SMTP id n12mr8088744wmk.69.1590054017620; Thu, 21 May 2020 02:40:17 -0700 (PDT) Received: from [192.168.43.18] ([85.255.237.70]) by smtp.gmail.com with ESMTPSA id 32sm5968714wrg.19.2020.05.21.02.40.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 02:40:17 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 04/10] staging: vt6656: use ieee80211_tx_info to replace need_mic To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: Date: Thu, 21 May 2020 10:40:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Use the info->control.hw_key to replace need mic which is only present when info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 39 +++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 87fe7df07f03..ea5bcc772668 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -296,8 +296,9 @@ static void vnt_fill_cts_head(struct vnt_usb_send_context *tx_context, } static void vnt_rxtx_rts(struct vnt_usb_send_context *tx_context, - union vnt_tx_head *tx_head, bool need_mic) + union vnt_tx_head *tx_head) { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb); struct vnt_rrv_time_rts *buf = &tx_head->tx_rts.rts; union vnt_tx_data_head *head = &tx_head->tx_rts.tx.head; @@ -308,15 +309,18 @@ static void vnt_rxtx_rts(struct vnt_usb_send_context *tx_context, buf->rrv_time_a = vnt_rxtx_rsvtime_le16(tx_context); buf->rrv_time_b = buf->rrv_time_a; - if (need_mic) - head = &tx_head->tx_rts.tx.mic.head; + if (info->control.hw_key) { + if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP) + head = &tx_head->tx_rts.tx.mic.head; + } vnt_rxtx_rts_g_head(tx_context, &head->rts_g); } static void vnt_rxtx_cts(struct vnt_usb_send_context *tx_context, - union vnt_tx_head *tx_head, bool need_mic) + union vnt_tx_head *tx_head) { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb); struct vnt_rrv_time_cts *buf = &tx_head->tx_cts.cts; union vnt_tx_data_head *head = &tx_head->tx_cts.tx.head; @@ -325,23 +329,28 @@ static void vnt_rxtx_cts(struct vnt_usb_send_context *tx_context, buf->cts_rrv_time_ba = vnt_get_cts_duration(tx_context); - if (need_mic) - head = &tx_head->tx_cts.tx.mic.head; + if (info->control.hw_key) { + if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP) + head = &tx_head->tx_cts.tx.mic.head; + } vnt_fill_cts_head(tx_context, head); } static void vnt_rxtx_ab(struct vnt_usb_send_context *tx_context, union vnt_tx_head *tx_head, - bool need_rts, bool need_mic) + bool need_rts) { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb); struct vnt_rrv_time_ab *buf = &tx_head->tx_ab.ab; union vnt_tx_data_head *head = &tx_head->tx_ab.tx.head; buf->rrv_time = vnt_rxtx_rsvtime_le16(tx_context); - if (need_mic) - head = &tx_head->tx_ab.tx.mic.head; + if (info->control.hw_key) { + if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP) + head = &tx_head->tx_ab.tx.mic.head; + } if (need_rts) { buf->rts_rrv_time = vnt_get_rts_duration(tx_context); @@ -356,22 +365,22 @@ static void vnt_rxtx_ab(struct vnt_usb_send_context *tx_context, static void vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context, struct vnt_tx_buffer *tx_buffer, - u32 need_mic, bool need_rts) + bool need_rts) { if (tx_context->pkt_type == PK_TYPE_11GB || tx_context->pkt_type == PK_TYPE_11GA) { if (need_rts) { - vnt_rxtx_rts(tx_context, &tx_buffer->tx_head, need_mic); + vnt_rxtx_rts(tx_context, &tx_buffer->tx_head); return; } - vnt_rxtx_cts(tx_context, &tx_buffer->tx_head, need_mic); + vnt_rxtx_cts(tx_context, &tx_buffer->tx_head); return; } - vnt_rxtx_ab(tx_context, &tx_buffer->tx_head, need_rts, need_mic); + vnt_rxtx_ab(tx_context, &tx_buffer->tx_head, need_rts); } static void vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, @@ -499,7 +508,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) u16 tx_bytes, tx_header_size, tx_body_size; u8 pkt_type; bool need_rts = false; - bool need_mic = false; hdr = (struct ieee80211_hdr *)(skb->data); @@ -609,7 +617,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) break; case WLAN_CIPHER_SUITE_CCMP: tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_AES); - need_mic = true; default: break; } @@ -618,7 +625,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) tx_buffer_head->current_rate = cpu_to_le16(rate->hw_value); - vnt_generate_tx_parameter(tx_context, tx_buffer, need_mic, need_rts); + vnt_generate_tx_parameter(tx_context, tx_buffer, need_rts); tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_NONFRAG);