Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1155697ybj; Tue, 5 May 2020 14:16:40 -0700 (PDT) X-Google-Smtp-Source: APiQypKFsTO2geAGybEO3vEFvBnYD2WccsKxvJDGX22p1YCBXhqFV2AXxxezlY11YsnlwNRaySLn X-Received: by 2002:a17:906:4907:: with SMTP id b7mr4267383ejq.279.1588713400088; Tue, 05 May 2020 14:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588713400; cv=none; d=google.com; s=arc-20160816; b=KwoC3iB+5yXw8R4yuQsnAw1VKl2/f6iz/ZXuUjl98xE8VAzHoJkze/zumES5m5u5NV r+7zRSGT1FiJ1rVG8zBiLqsnj9UyVZFaxgaQRbwSlYLxx8lNih3VsQ74qMz90IH/jozZ 4vfhPObhP3acDL0Aw+11yMJI95Qba6XMH6+KS3Ldzknpb9NYuYTl/cLFUmYaB/fEzkrK GHxT1Z1iGwlrA9YgGBH9XmnasXLDKmUSWjURM6FzOVveEgPKRHvFc2cii9oGq5WAXVq0 HwGJJ6pEbxnYNS3uE5wDW7TZLMZ1lN7yjCjdWTD1hZTdfbVCINax9HdwNMIdKuXpS2Is nGfw== 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=EGVbbPzyVO01/FIopW3nxXbQ2QWRQV9JRxf2+f7pU/4=; b=D+KsoYmYtvIgOpo25BR6rJqI1lt/ougAMmP2r4KtXvbQvMTo3fkQbjJUO4JFGG4OL0 Ad44cefZWmn7QwSUwS2dlWyY4oWj+sPzczzMEUmtbHWkNCTEat+iVamSBV8ahJ4c14zW XPUjTpOFZ4WhQ6Skn4hHh/0xi0IpasHWpmoq4qMUMFlkHIPHh4PzkPkswILDanD+bGOb xntaOCdejh+lXngfYPS+cKMTyn2TyY3RVHHTE1vHaXwdYyGhrHTD0xRgAar8ZRePWyrv M8+yFe+nGBR7A9nmqWp3WZbs8NGm0JyMYX73NeC/NqiASGVpvrV84pXbYu0naymtDUfJ DLcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=P6UvQqfl; 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 bd12si1895627edb.506.2020.05.05.14.16.15; Tue, 05 May 2020 14:16:40 -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=P6UvQqfl; 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 S1729338AbgEEVPQ (ORCPT + 99 others); Tue, 5 May 2020 17:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729335AbgEEVPP (ORCPT ); Tue, 5 May 2020 17:15:15 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C950C061A0F for ; Tue, 5 May 2020 14:15:15 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id 188so177022wmc.2 for ; Tue, 05 May 2020 14:15:15 -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=EGVbbPzyVO01/FIopW3nxXbQ2QWRQV9JRxf2+f7pU/4=; b=P6UvQqflx2ZYERn4eaqY506W5Rur02ytOd9iAp3fhiX4TboDGEdGzxcvDCr5I7Osjl 7pRzLT9GwIUgNFlOJ0S8AGI4AIH3IJWEg7EokoPNsFRK+18JotIzsCQIT/d6n+AoTeyM yShcJtOHQDHsDgt41qOf4nk00EU73qs3AzoGPuSWwjjOHPnvQCUBWD0rxB51p3b8Q50t gZai9+2CmLPODDxy1n+7N5ySATlkxaIFjssCrx24PyzowQI7qJ6dO1AvpXhtvB1pCAHi z04XJr1EGGag2UWWApHgdR725ORJ4ZQZniyt8n6eaAZSdo5M7dtIjNnrsNXDJ3fS9Ny2 ZmyQ== 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=EGVbbPzyVO01/FIopW3nxXbQ2QWRQV9JRxf2+f7pU/4=; b=VfPqm0gsc6XVuZI73K8IzVbIMcCuzb59HG033rlm2nOpvHPYWNCMv+FXlRwz/xv3ha tH/I1SW9ByKOXYax4BjPHlVTl0PYcdC/Ksl+DORRIJaFt5Kw1xhZbjjwx4TpHnQwGHv8 vfvrBraUJv7wUkWwZAslOdf880CkIfrapL1M0g7DxM9HS5yQa9Pa8bWy+TuIJi/K0Fkh wCTOROL35FpPJ+PN9h6bbL1SALiFkOCPlBKnbsWhXfUSbMbjEmeEi6InIe+8LOHYB8fw ynTzUn377jca4j9zfkyr4wnllnnRmvd1Ui/UzVLczsb/0FWrDyUpW0Duvz8dE8p0TZTZ dfUQ== X-Gm-Message-State: AGi0PubcGiZGvtgKDmoc90m22BZSov5Ew6b7GJ4+BY9sAvUtUofRtsq6 fBo9diR27kNlHDkNnh5PnO4= X-Received: by 2002:a7b:c417:: with SMTP id k23mr546692wmi.147.1588713314066; Tue, 05 May 2020 14:15:14 -0700 (PDT) Received: from [192.168.43.18] (188.29.165.117.threembb.co.uk. [188.29.165.117]) by smtp.gmail.com with ESMTPSA id 145sm64647wma.1.2020.05.05.14.15.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 May 2020 14:15:13 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 3/6] staging: vt6656: vnt_get_rtscts_duration_le use ieee80211_ctstoself_duration To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org, Oscar Carter Message-ID: Date: Tue, 5 May 2020 22:15:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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 mac80211 ieee80211_ctstoself_duration for CTS to self frames. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 48fe16c27d3f..27069ac60b15 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -195,27 +195,6 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate) [rate % MAX_RATE]); } -static u32 vnt_get_rsvtime(struct vnt_private *priv, u8 pkt_type, - u32 frame_length, u16 rate, int need_ack) -{ - u32 data_time, ack_time; - - data_time = vnt_get_frame_time(priv->preamble_type, pkt_type, - frame_length, rate); - - if (pkt_type == PK_TYPE_11B) - ack_time = vnt_get_frame_time(priv->preamble_type, pkt_type, 14, - (u16)priv->top_cck_basic_rate); - else - ack_time = vnt_get_frame_time(priv->preamble_type, pkt_type, 14, - (u16)priv->top_ofdm_basic_rate); - - if (need_ack) - return data_time + priv->sifs + ack_time; - - return data_time; -} - static __le16 vnt_rxtx_rsvtime_le16(struct vnt_usb_send_context *context) { struct vnt_private *priv = context->priv; @@ -285,9 +264,6 @@ static __le16 vnt_get_rtscts_duration_le(struct vnt_usb_send_context *context, u8 dur_type, u8 pkt_type, u16 rate) { struct vnt_private *priv = context->priv; - u32 dur_time = 0; - u32 frame_length = context->frame_len; - u8 need_ack = context->need_ack; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb); switch (dur_type) { @@ -298,15 +274,13 @@ static __le16 vnt_get_rtscts_duration_le(struct vnt_usb_send_context *context, return ieee80211_rts_duration(priv->hw, priv->vif, context->frame_len, info); case CTSDUR_BA: - dur_time = priv->sifs + vnt_get_rsvtime(priv, - pkt_type, frame_length, rate, need_ack); - break; - + return ieee80211_ctstoself_duration(priv->hw, priv->vif, + context->frame_len, info); default: break; } - return cpu_to_le16((u16)dur_time); + return cpu_to_le16(0); } static u16 vnt_mac_hdr_pos(struct vnt_usb_send_context *tx_context, -- 2.25.1