From patchwork Thu May 21 09:42:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11562563 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 D6A9C912 for ; Thu, 21 May 2020 09:42:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3D2220721 for ; Thu, 21 May 2020 09:42:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ooEt1Hk7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728797AbgEUJmS (ORCPT ); Thu, 21 May 2020 05:42:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728719AbgEUJmR (ORCPT ); Thu, 21 May 2020 05:42:17 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73B78C061A0E for ; Thu, 21 May 2020 02:42:17 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id w7so5957698wre.13 for ; Thu, 21 May 2020 02:42:17 -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=usJtu7R5Hhl5Z8TUzvQCBPkQWGFxbJL90BBgLqwpdIk=; b=ooEt1Hk7utn7Qm4uNttmPvtDsV3s7zI0OmcwuzGJBvDeYSRB9dT2mm/kg7q1C8sbCn XdPMeE7Ks+Qvca3wIB7N+Cr4amqY5EK9TxhtsbIy2jJQcx7InuD/zM9HDt4MGfmW87MA MXJg61qH4iLC5nP9vZ6x02/GNWY6CVCghjNgzN/bXsBO7sUtnJtUtMHeXp+95WDuLfCJ 9UryTqHZnJmpeISL1ZTbPv5UyiKVVl2F7a0uIy4rrEmVqKVhpMRSE7V+fLvfWZk/5mXx zh8jmBE8u4ReQsDE3K81oMj3Exmp9AbaeyCHdTSeuj+TQZ9w2xCjv5PPEFcyW+bpoXTT 5SZQ== 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=usJtu7R5Hhl5Z8TUzvQCBPkQWGFxbJL90BBgLqwpdIk=; b=KIU7+zM4gWvpsaP/BJmPlaLdKXd3f8scHeFqIa7ff4pvuQEQkaSniHIU5YCDxjdUCy uy3UlhJo4lDPkUvX0gVOL2l+NEoHpEmNIEJ0PH2/yORDpj56PPsnvoh5ELkNTTuQDeiW sC14XO7F1CLmeKJ3SnOw3QtVAa7KlxJXuu1/T30a/+Uy6kJ+m3Hrl28wXojflDVFJcvn pT72HV79GNfdMbiY/U9rRomWxWSia79+y19DXwwuNMfy141KQjK9sOC1CdGdhNNZEVZU 3E7OOK9DNymYGAWAwUibT62I5cFYdQ2cxhwyDMk7AdAOHRx40P2VFqOfFQKT6nQXfHq5 pErg== X-Gm-Message-State: AOAM53180L2XVKG4Yti8NKTDejEvaxb5yYX7d8k2U5lyB0uMFY4ObL+P bDeawvW2g6oJI7JwRod42X51yqNa95NMFw== X-Google-Smtp-Source: ABdhPJxiLG5qiRNjsAXF07VxPFnfbRskoYUxrb0zVqUB/bv0v8atJjlSVybhquwsWliQKebfQHFrYA== X-Received: by 2002:adf:fdc5:: with SMTP id i5mr7517714wrs.176.1590054135855; Thu, 21 May 2020 02:42:15 -0700 (PDT) Received: from [192.168.43.18] ([85.255.237.70]) by smtp.gmail.com with ESMTPSA id u65sm5937594wmg.8.2020.05.21.02.42.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 02:42:15 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 05/10] staging: vt6656: rxtx use ieee80211_tx_info for rts/cts control To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: <1b21b3db-b9ef-c167-8f88-b32646ba5a19@gmail.com> Date: Thu, 21 May 2020 10:42:14 +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 control for rts/cts exhanges replacing need_rts and use_cts_prot for packet type PK_TYPE_11GB / PK_TYPE_11GA Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index ea5bcc772668..310d0eccebd1 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -338,8 +338,7 @@ static void vnt_rxtx_cts(struct vnt_usb_send_context *tx_context, } static void vnt_rxtx_ab(struct vnt_usb_send_context *tx_context, - union vnt_tx_head *tx_head, - bool need_rts) + union vnt_tx_head *tx_head) { struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb); struct vnt_rrv_time_ab *buf = &tx_head->tx_ab.ab; @@ -352,7 +351,7 @@ static void vnt_rxtx_ab(struct vnt_usb_send_context *tx_context, head = &tx_head->tx_ab.tx.mic.head; } - if (need_rts) { + if (info->control.use_rts) { buf->rts_rrv_time = vnt_get_rts_duration(tx_context); vnt_rxtx_rts_ab_head(tx_context, &head->rts_ab); @@ -364,12 +363,12 @@ 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, - bool need_rts) + struct vnt_tx_buffer *tx_buffer) { - if (tx_context->pkt_type == PK_TYPE_11GB || - tx_context->pkt_type == PK_TYPE_11GA) { - if (need_rts) { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb); + + if (info->control.use_cts_prot) { + if (info->control.use_rts) { vnt_rxtx_rts(tx_context, &tx_buffer->tx_head); return; @@ -380,7 +379,7 @@ static void vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context, return; } - vnt_rxtx_ab(tx_context, &tx_buffer->tx_head, need_rts); + vnt_rxtx_ab(tx_context, &tx_buffer->tx_head); } static void vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, @@ -507,7 +506,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) unsigned long flags; u16 tx_bytes, tx_header_size, tx_body_size; u8 pkt_type; - bool need_rts = false; hdr = (struct ieee80211_hdr *)(skb->data); @@ -594,10 +592,8 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) if (ieee80211_has_retry(hdr->frame_control)) tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LRETRY); - if (tx_rate->flags & IEEE80211_TX_RC_USE_RTS_CTS) { - need_rts = true; + if (info->control.use_rts) tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_RTS); - } if (ieee80211_has_a4(hdr->frame_control)) tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LHEAD); @@ -625,7 +621,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_rts); + vnt_generate_tx_parameter(tx_context, tx_buffer); tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_NONFRAG); From patchwork Thu May 21 09:43:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11562567 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 814BC912 for ; Thu, 21 May 2020 09:44:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 679FE207D3 for ; Thu, 21 May 2020 09:44:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="or3At3+v" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728893AbgEUJoA (ORCPT ); Thu, 21 May 2020 05:44:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728804AbgEUJoA (ORCPT ); Thu, 21 May 2020 05:44:00 -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 1751BC061A0E for ; Thu, 21 May 2020 02:44:00 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id g14so1864927wme.1 for ; Thu, 21 May 2020 02:44:00 -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=NTVAkejfWjyTo7BhK8Y0RFgpAEQ+hg4BcBIQrLv9Jg0=; b=or3At3+vnVNGd1BP8JClD0lCgdiTn8J9T6bzZu3g7Uak8IqNsRAn+HDLNRZ6cbMT3N qaJhVQJnKR8l8ErAp13b8HITNA66m+wYRe38MXwlDPdt8RAULvKh8Ltw1jAuI18BvEzs wcJKmh31giOv1DVodw/H8Mi99cgdV+h3YqoAcmInN9V+EbNhjrq/vumNcCCPWSAKlJFh nOIXoIfC0XK8n9WrxAApKoluRyZw7klHk3IV9xw2NUoOMVrVa7Of02O6LIZ5OWTqS4Ff d49SujfDVD4Zmvm4bunGfYquVQBQXyTye4PPLRLitVGeofZWdem9a0I42MW0OHPyZ9S1 w4Cw== 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=NTVAkejfWjyTo7BhK8Y0RFgpAEQ+hg4BcBIQrLv9Jg0=; b=ml0cyMhs+iYa7tHLUQauKDxp6Vx43QD4gWVlOEYHo+HRnn2ZTiFlDs8tmPjU2Z6wRj NZv6tMbcEvQIBnAC8CrRoKRPfSb4sg/1b0gWjb83DRgAn2hYcODDSep2vvnvVqG5TbeW n5i/8+e7uGxKidzjtO7IupM5nqinBTepPOWEfA8IZv+csOP6G/+MHKvbm7AxHYuxibgx 2YM6R1z6QrNnegSD2yZGZ40lT4MTl5anzF/rC+FFVo4M7GCDjIQYer+LWNT7r2/Nfbxt z7Fqb/dbTsQAVUPSe77QGnFY4km2GYDjp6RBvSg4/IquQlYP01iC+K2n967WE2luqiL8 RYrA== X-Gm-Message-State: AOAM5300IaJD+C2hXnSWbzRka7SbbFks1hdzl+JvQmuR5IgNx6qx7czX B+zudL2IzJL8aZEe4ZJqcbNJy+8tvPRbbg== X-Google-Smtp-Source: ABdhPJypf8AGniJpVL9QoUsOpQ7x1p30DAxkPKMXrG0jtkJfXkQHrbdEdYNaD/YZSkkihf//UBeQ6g== X-Received: by 2002:a1c:7205:: with SMTP id n5mr8741185wmc.189.1590054238661; Thu, 21 May 2020 02:43:58 -0700 (PDT) Received: from [192.168.43.18] ([85.255.237.70]) by smtp.gmail.com with ESMTPSA id a10sm6041034wmf.46.2020.05.21.02.43.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 02:43:58 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 06/10] staging: vt6656: Move key_buffer inside vnt_fill_txkey. To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: <3631f327-1386-90a2-ba9a-bb62617f3c66@gmail.com> Date: Thu, 21 May 2020 10:43:57 +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 vnt_tx_fifo_head to point directly at tx_key removing key_buffer. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 310d0eccebd1..2d7a8fc70d92 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -383,9 +383,10 @@ static void vnt_generate_tx_parameter(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 ieee80211_key_conf *tx_key, struct sk_buff *skb, u16 payload_len) { + struct vnt_tx_fifo_head *fifo = &tx_buffer->fifo_head; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct vnt_mic_hdr *mic_hdr; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; @@ -399,18 +400,18 @@ static void vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, switch (tx_key->cipher) { case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP104: - memcpy(key_buffer, iv, 3); - memcpy(key_buffer + 3, tx_key->key, tx_key->keylen); + memcpy(fifo->tx_key, iv, 3); + memcpy(fifo->tx_key + 3, tx_key->key, tx_key->keylen); if (tx_key->keylen == WLAN_KEY_LEN_WEP40) { - memcpy(key_buffer + 8, iv, 3); - memcpy(key_buffer + 11, + memcpy(fifo->tx_key + 8, iv, 3); + memcpy(fifo->tx_key + 11, tx_key->key, WLAN_KEY_LEN_WEP40); } break; case WLAN_CIPHER_SUITE_TKIP: - ieee80211_get_tkip_p2k(tx_key, skb, key_buffer); + ieee80211_get_tkip_p2k(tx_key, skb, fifo->tx_key); break; case WLAN_CIPHER_SUITE_CCMP: @@ -452,7 +453,7 @@ static void vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, if (ieee80211_has_a4(hdr->frame_control)) ether_addr_copy(mic_hdr->addr4, hdr->addr4); - memcpy(key_buffer, tx_key->key, WLAN_KEY_LEN_CCMP); + memcpy(fifo->tx_key, tx_key->key, WLAN_KEY_LEN_CCMP); break; default: @@ -628,8 +629,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) if (info->control.hw_key) { tx_key = info->control.hw_key; if (tx_key->keylen > 0) - vnt_fill_txkey(tx_buffer, tx_buffer_head->tx_key, - tx_key, skb, tx_body_size); + vnt_fill_txkey(tx_buffer, tx_key, skb, tx_body_size); } priv->seq_counter = (le16_to_cpu(hdr->seq_ctrl) & From patchwork Thu May 21 09:47:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11562573 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 4C577739 for ; Thu, 21 May 2020 09:47:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34E6E2072C for ; Thu, 21 May 2020 09:47:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iNBmHpgu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728918AbgEUJr3 (ORCPT ); Thu, 21 May 2020 05:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728819AbgEUJr2 (ORCPT ); Thu, 21 May 2020 05:47:28 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 837A3C061A0E for ; Thu, 21 May 2020 02:47:28 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id l17so6039543wrr.4 for ; Thu, 21 May 2020 02:47:28 -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=JZE3YWU43/SedpISagSRSovxov9m1YwcPTRT1+qH7GU=; b=iNBmHpgu89/26tgoQV6hPE4K/0UELMRDzL8pg6EM8FAIUNdw6d4x/jyRbwG8Oskh82 GFQjnT8YDShNZ4WXOy18TCUCXZrAN5B0kOKTuIRVR/H4RgK0fNLmE9RGNOEGFcTvWXL9 w6okd3UEVfJMcVWPW7Vky2e/wV334MC+bW3xGk1eBNJX6bRwRJZRakuE7PsmVT+p7dV8 AknwqVi/KDyEBgtXIf8/36n+qwSz1cy1E4Sa1V7mWI7x4Wcm7z4mya7Su96fIMN8VodA EQJbX9DQNEdEFrMaVvtY/isRnRhyqbvzEqFXBKXU8MIK7DavtpS5+Nt9XlSsNGPmu2Zu vWJQ== 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=JZE3YWU43/SedpISagSRSovxov9m1YwcPTRT1+qH7GU=; b=Un6/7MIKE5qTk7g1edcSzBT47TNB9IjJU6Mu6IFS6+si3v/aEn0OaVZReEMCYI227J 4PyR0HhTYCBSHRPwpytKdMPF3xKpz5YvLJqjD1v3vzyzOyiuGFhgF3ERVoBgD1K3Ccdf imFgMJtKnWnVMDsrwIEtHB3vqtKhBUoE9Ub38JuGbF0kiFmlgnMRDJtqCKUtncSmaB1w SU9UwGZ/LSDWnkNJzjjYo40abAjIVLcd8dE5S+roITYMnjVmqjhwxjyc9RSR/r/NMHQw TOaUA4CGPZ+4M4vvmGqo0eVZR7azpbVDAtJ4pqAuIuly/oFl8fUnXbh93xnfPX40domO sC0Q== X-Gm-Message-State: AOAM533/TEWmAm53C9q1h+NA5Qji4a5VjFmaiY9tr65t26uzkrD697Y5 8Kda8zi5AWU0ilHlSNmwetel7EGUpK/m6A== X-Google-Smtp-Source: ABdhPJyOtqUOsV1YHo4zWUH3DUaCgWdkiqHwaIpR1V/PYqlzmbxvqfUgVV3p5V5nUslLkA06Ls+/Vw== X-Received: by 2002:a05:6000:85:: with SMTP id m5mr7271879wrx.281.1590054447037; Thu, 21 May 2020 02:47:27 -0700 (PDT) Received: from [192.168.43.18] ([85.255.237.70]) by smtp.gmail.com with ESMTPSA id z9sm5851379wrp.66.2020.05.21.02.47.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 02:47:26 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 07/10] staging: vt6656: move tx_body_size/payload_len to skb->len To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: <12e96cb5-a2a5-de3c-ebe7-ca5a4e2b5594@gmail.com> Date: Thu, 21 May 2020 10:47:25 +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 both variables can be removed and replaced with skb->len. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 2d7a8fc70d92..b9164142e2b5 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -384,13 +384,14 @@ static void vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context, static void vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, struct ieee80211_key_conf *tx_key, - struct sk_buff *skb, u16 payload_len) + struct sk_buff *skb) { struct vnt_tx_fifo_head *fifo = &tx_buffer->fifo_head; 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; + u16 payload_len = skb->len; u8 *iv = ((u8 *)hdr + ieee80211_get_hdrlen_from_skb(skb)); /* strip header and icv len from payload */ @@ -505,7 +506,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) struct vnt_tx_fifo_head *tx_buffer_head; struct vnt_usb_send_context *tx_context; unsigned long flags; - u16 tx_bytes, tx_header_size, tx_body_size; + u16 tx_bytes, tx_header_size; u8 pkt_type; hdr = (struct ieee80211_hdr *)(skb->data); @@ -546,8 +547,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) spin_unlock_irqrestore(&priv->lock, flags); tx_header_size = vnt_get_hdr_size(info); - tx_body_size = skb->len; - tx_bytes = tx_header_size + tx_body_size; + tx_bytes = tx_header_size + skb->len; tx_header_size += sizeof(struct vnt_tx_usb_header); tx_buffer = skb_push(skb, tx_header_size); @@ -629,7 +629,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) if (info->control.hw_key) { tx_key = info->control.hw_key; if (tx_key->keylen > 0) - vnt_fill_txkey(tx_buffer, tx_key, skb, tx_body_size); + vnt_fill_txkey(tx_buffer, tx_key, skb); } priv->seq_counter = (le16_to_cpu(hdr->seq_ctrl) & From patchwork Thu May 21 09:49:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11562577 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 E1C581391 for ; Thu, 21 May 2020 09:49:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA0622072C for ; Thu, 21 May 2020 09:49:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IfqQfFH+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728839AbgEUJtp (ORCPT ); Thu, 21 May 2020 05:49:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728819AbgEUJto (ORCPT ); Thu, 21 May 2020 05:49:44 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72D59C061A0E for ; Thu, 21 May 2020 02:49:44 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id e1so6037252wrt.5 for ; Thu, 21 May 2020 02:49:44 -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=L5hgR3ScM9kCl+6+EZ5ctodeKVTcZYOKQzyH7lseAGo=; b=IfqQfFH+DZUfo3RHEKmYBDR4aCE116Cz2ouRa1kJsa7QwgM/TVw0n9mLEvr/NCvAzT 2iOOmlhzolHWfUH91wvid/FIXKuy8aEaK5t7XEqkhAPA+ZZStmXRqXJ1jcAwmDZx++SU bwBs0A1MpvAtA/nBjtZfYKXy+Dp2dwwgz2UpI01m7etx+vpfze3xlfZyycfncssQomOY +10hq+OP4bIfjUYUQedfhsCKjsgTm8Pmc+YSpXY6VONLTYi1bWvd6UwuoAfIgxj6eW7L bCfBgPNBS+rIBDQvMiWhJ/g5RDN9vzZIj+GHbzqhKJAk5LBPtSX2aonGCoE7rvvNaCk7 0jWQ== 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=L5hgR3ScM9kCl+6+EZ5ctodeKVTcZYOKQzyH7lseAGo=; b=GrX0sgGFAJ9bQnxqljn4BSeO0kdhd1BGtcgH2h87MpPyPjWtCIM2ggVCQ2HZIP7Ih/ KKKhsEhyXy76x4m7caFFbq3e33xtNLz58L8Yn8/uu2QxPOB7xs+GquDhXAewV9fFugIY 6x1L0bdMt1NGFqSFFdY7L8cQy+OosvevKA+a1cexIyS5Pph3yfW0ITWEiF45drYXFBlV QWGK8Ub61M3gWrPFTQL32dhng9YJInGtL6RxHQ0/WVkWbYQd4y4PyM6ypkJao5NdDrL2 jn1g7k7thXeJBMmM0NYhYS2O7LlAK46tu47TS5CHFWWhMsJZJ2W0D3etCpowkshi3/ph g7fw== X-Gm-Message-State: AOAM533kl8xyXsdj8GqP9v4Qwmn5kuuGtfuB9XFgGXZJawG2uUIyXHC6 87ICmLz2gE61yQ1vrOtFczte2jMGwia81Q== X-Google-Smtp-Source: ABdhPJw0BQBqdBSBX01iSr3Hrw293C4Q1sSJ3xSWwi9lk0bO9qkMwq0ntFa6d3DAoTtStKHkf7A4tw== X-Received: by 2002:a5d:61d2:: with SMTP id q18mr7503030wrv.46.1590054582943; Thu, 21 May 2020 02:49:42 -0700 (PDT) Received: from [192.168.43.18] ([85.255.237.70]) by smtp.gmail.com with ESMTPSA id p7sm5916815wmg.38.2020.05.21.02.49.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 02:49:42 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 08/10] staging: vt6656: Move tx_key inside vnt_fill_txkey. To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: <1b964a6c-5cf7-e675-cf53-3a632acc0be9@gmail.com> Date: Thu, 21 May 2020 10:49:41 +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 tx_key can be got directly from info. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index b9164142e2b5..a0672ca51138 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -382,12 +382,11 @@ static void vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context, vnt_rxtx_ab(tx_context, &tx_buffer->tx_head); } -static void vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, - struct ieee80211_key_conf *tx_key, - struct sk_buff *skb) +static void vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, struct sk_buff *skb) { struct vnt_tx_fifo_head *fifo = &tx_buffer->fifo_head; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_key_conf *tx_key = info->control.hw_key; struct vnt_mic_hdr *mic_hdr; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; u64 pn64; @@ -629,7 +628,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) if (info->control.hw_key) { tx_key = info->control.hw_key; if (tx_key->keylen > 0) - vnt_fill_txkey(tx_buffer, tx_key, skb); + vnt_fill_txkey(tx_buffer, skb); } priv->seq_counter = (le16_to_cpu(hdr->seq_ctrl) &