Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1265383ybk; Thu, 21 May 2020 02:42:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgJm/vDpp3ihnMBXcCh3/kh3PxTsQzaha9zuN7NgCVtCMSd6Xl1KtMCfI7I6QI0f4mGgmN X-Received: by 2002:a05:6402:1d81:: with SMTP id dk1mr7004851edb.143.1590054168039; Thu, 21 May 2020 02:42:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590054168; cv=none; d=google.com; s=arc-20160816; b=sKb93wDa2NEOkb3GFJeUeoZF8OHiCw/I+fbH8/vW+ZnMJ6XF/w53eW6HL1aruw4D5J Ci8RQr9S1NSgyYMDSmP4f7eNquyGA5ChLuDuipdJetRYwHDIMkVWxUE5gSL63GcTOWY1 +uPJ9kR0CFU8vqT60qqpvKcy8i/mRGSCp03whgl2mYQEDcynzhncyFi5XAqta5jUyPfD wnmJuJIIK9rl9MJdcx+pn92N6Q+AsTisj6VrgOKzNT7xc4MGnklLe5e/wl9M62DBAdhf tSZN4LLCBJbGY7xOkNfd+gDA+MJEuQ3aVlYe5PRwaYQatk3PMnLitFyIh6h0F4Bt5b3Y WcWA== 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=/pwdCDKjLF+e60HESsBhV0UAePDZFaCim4hK40cyzwA=; b=hwsOf1EsNKf6fF14j9YimUm7g762IdyRqHNGwvvtE59+39tff2NUjiURnmWz8ypkvR rXHzucWl9VoN6UcLlhr21Due35XV/fOlAvx1cRUrEzAo0X7pe0qcqV0oGz3WJuTrwsYR IbtEwOQ4QeoC+Z/M94ROZrGwitmODuHUselNSvbv60a9u9DKKtrs6TIiwv61DxHm4GCZ atRlRQNToRHULCj4ru/tEEnOp+e9emrUkulUpsBK8mJsPPbTRRSwscEf7ByKoU9GamEq GHsQCXtwNZ9G43LOL0F0pWiosPgQ7Ax09Y0vqpNdta7flOMSo+8dPf8tJXKZRjvzvT2R mvGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zn1GURoc; 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 t14si3111435ejj.344.2020.05.21.02.42.23; Thu, 21 May 2020 02:42:48 -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=Zn1GURoc; 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 S1728794AbgEUJkU (ORCPT + 99 others); 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-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-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 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); -- 2.25.1