Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1274859ybk; Thu, 21 May 2020 02:59:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0bX2erJIrvd97b29M0zw12O/UuLru/NZfMRuI282n6skX5hzsgJJCjhMaUjZ4U1y45Qs9 X-Received: by 2002:a17:906:e090:: with SMTP id gh16mr2818419ejb.41.1590055194950; Thu, 21 May 2020 02:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590055194; cv=none; d=google.com; s=arc-20160816; b=SlaY+L84VMY1o087Bfrm33aiIgWJhNU8UK0H+RTA2bJ4mjVbLiG2E+TPtEDMNvFXTc dGxlcjMsWZ3AyU5QdDpp266XpaPSH8Od1eU3UvGIr5VNUsR75t1c+9CZi/MvDRnDTDyq flEsUbhtYR4o7gLks4hlAwLTQyE5ngsbFm8mIGb7BcQYakzKT+mRu93z1INtBPH5yyVl jPDTHu826eXPLEk4qPh0X7uyHL/oh9fvJOC1UfHwDD34s8lpoUY8vK10l6leFMlWDWpP 5+6VRKZcmLwAgS6GGv2xrPPOj1APelqM3TJH+aD4HiSwHY8bTNjU1peWDOyVC0saSYVm Eqdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:cc:to :subject:from:dkim-signature; bh=fgA73O2odwNS1tE9Pa7tUkjFkww58qXLyvI3wxAGKjU=; b=FTD2ITWgdmMZWdo3p237Gcly7iS34NPk8Hq/HRSOWeo5gP/eR16LZJ4UkmKSBhQfVF iNU7F9jEJ2e0eBCZl31yWQoK33lA9pDvL2l5cR/dvRNqDtK2J0UdCkDZqM+M6maMJ9kE FKSWVX5nLX2w/Q4j2d85FjABcGnqvaSZGwbdG1FnVr5G/e5PVsDn7BDZWToFJrnyeJLS RE2brH0rWF4FlMOnMC1rUd1FbqARdnHevy1FXK8RHwqjf4kWRzJyXmGp1Ldb7I77a/mm 37GwQxxgIv4uFbxkLMpepofDNFl4esowLypVw1rQl9AQISAgzprP6q4ygAOt7Me70+K/ 9DJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=agHXvB9I; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si2938263ejx.356.2020.05.21.02.59.30; Thu, 21 May 2020 02:59:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=agHXvB9I; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728181AbgEUJ5v (ORCPT + 99 others); Thu, 21 May 2020 05:57:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726405AbgEUJ5v (ORCPT ); Thu, 21 May 2020 05:57:51 -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 EA90DC061A0E for ; Thu, 21 May 2020 02:57:50 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id l11so6094639wru.0 for ; Thu, 21 May 2020 02:57:50 -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=fgA73O2odwNS1tE9Pa7tUkjFkww58qXLyvI3wxAGKjU=; b=agHXvB9IT1FaOvbx9VBAx1tGWOiHgA8EhJXKShdYxPUkSCTPsVQqA2rrQXzdtVILEd /LmY8fSF87tlAG977QQW770ocB5zu6WgVOTRbo/6e/5qPN6GMwqG7xj554qI0gWb7AWE J01Z8TgtSAR+a111SS9SN39QWkY5vUVp7xwzVQwhdjG7IkDkLoj6FVke4tzolDDlr+bu YQ27sdEpl2f7xgQ/RE75enP7jii02jV0Bnad7FjQCVMMyfDeieG7Ff8DpgDmOSOHaAYv L03lWd9MZrNfZ+4CBR5zPFBcd4JCUagdPpkeqcsyl+S4shqmQvqztlg70ZifhD3KG2jm 3e3A== 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=fgA73O2odwNS1tE9Pa7tUkjFkww58qXLyvI3wxAGKjU=; b=PS6HsqOq1kOsgaN9YfxIRsZoqhONsTPjUNPD+Q6SGa39CuYx/UaCG3AHL7EI9gVI8b Pskpr4gP7HdBOXhnZLx9Kmk6UQ5rVcP3dUMViubaAym7D0/U6JYar+tyeGcQaUuBpj1d t6u6E7UFxf38QpJDO23XwWGs8Nlyd/vi3xBAMyY1R8dMr7d1JZhLdvWqwDynnu2LZQa7 /Wl9HamRz/M3N1ZZLfwSxzub8w5RKyajJtfb/L3nyyVOMNH6GA6psHpR9w9QDYIfMNrX JJrnKnRPC41by5NylHFKaKuPCGIlQXFbumTwnUiBDxeZrokwra1oLMTpBq98S4Q8e8k9 Iqog== X-Gm-Message-State: AOAM531vW9ixMhpJkfLsWWL3XQ8yV+K+QQ7NptVA6p9BssZaOvT/YJim u+NWbiTgITKqFe5oktu9PN/ZNgN4ZzDtVA== X-Received: by 2002:adf:8302:: with SMTP id 2mr8201081wrd.114.1590055069527; Thu, 21 May 2020 02:57:49 -0700 (PDT) Received: from [192.168.43.18] ([85.255.237.70]) by smtp.gmail.com with ESMTPSA id a12sm5724063wro.68.2020.05.21.02.57.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 02:57:49 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 10/10] staging: vt6656: move key frag controls to vnt_fill_txkey To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: Date: Thu, 21 May 2020 10:57:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org vnt_fill_txkey now has access to tx_buffer move cipher frag controls The icv_len is the only thing needed from hw_key in vnt_tx_packet. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index bbe449af8acf..9ee57f7c0c88 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -323,10 +323,12 @@ static bool vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, struct sk_buff *skb) tx_key->key, WLAN_KEY_LEN_WEP40); } + fifo->frag_ctl |= cpu_to_le16(FRAGCTL_LEGACY); break; case WLAN_CIPHER_SUITE_TKIP: ieee80211_get_tkip_p2k(tx_key, skb, fifo->tx_key); + fifo->frag_ctl |= cpu_to_le16(FRAGCTL_TKIP); break; case WLAN_CIPHER_SUITE_CCMP: if (info->control.use_cts_prot) { @@ -369,6 +371,7 @@ static bool vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, struct sk_buff *skb) memcpy(fifo->tx_key, tx_key->key, WLAN_KEY_LEN_CCMP); + fifo->frag_ctl |= cpu_to_le16(FRAGCTL_AES); return true; default: break; @@ -504,7 +507,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_rate *tx_rate = &info->control.rates[0]; struct ieee80211_rate *rate; - struct ieee80211_key_conf *tx_key; struct ieee80211_hdr *hdr; struct vnt_tx_buffer *tx_buffer; struct vnt_tx_fifo_head *tx_buffer_head; @@ -606,23 +608,8 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) tx_buffer_head->frag_ctl = cpu_to_le16(ieee80211_get_hdrlen_from_skb(skb) << 10); - if (info->control.hw_key) { - tx_key = info->control.hw_key; - switch (info->control.hw_key->cipher) { - case WLAN_CIPHER_SUITE_WEP40: - case WLAN_CIPHER_SUITE_WEP104: - tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_LEGACY); - break; - case WLAN_CIPHER_SUITE_TKIP: - tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_TKIP); - break; - case WLAN_CIPHER_SUITE_CCMP: - tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_AES); - default: - break; - } - tx_context->frame_len += tx_key->icv_len; - } + if (info->control.hw_key) + tx_context->frame_len += info->control.hw_key->icv_len; tx_buffer_head->current_rate = cpu_to_le16(rate->hw_value); -- 2.25.1