From patchwork Thu Apr 2 21:41:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11471615 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 1BC8692A for ; Thu, 2 Apr 2020 21:41:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED7C02080C for ; Thu, 2 Apr 2020 21:41:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c79F/GVE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388008AbgDBVlj (ORCPT ); Thu, 2 Apr 2020 17:41:39 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38975 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729549AbgDBVlj (ORCPT ); Thu, 2 Apr 2020 17:41:39 -0400 Received: by mail-wr1-f68.google.com with SMTP id p10so6029321wrt.6 for ; Thu, 02 Apr 2020 14:41:38 -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=d2LuQ9+tNaM4iX/cPzhdZ44JC45KzMGRSOTVMyTga64=; b=c79F/GVEsGXKxyOu7A9T1Qfohd2O5y0eRvw8sV/dT6rBmaI28MM9db9/0HN9CPuXzL 361BRQBo8MFfwCZr3fpIwnlZR5Mup51v4ON7YZ66/4Uo18Fa/oC3UZ8M7dFXuBLkgMmF DiHM6zR0vLV2JRMww5ocIJsvGwvJjf5Nph6YIPup8ybhLWqYSVidC2iEdlYdCwruhP6u ZxQZlaadfZpKkmEoyo+5KQ6BsF2nIVyUHnqcjRky61V9oqT++hDaZr7ij5cjIqLA8//C 8d9+HstFCYn0kV0EirNcFnc8T6Sew/u5rN7+H9fTL0NsFPuWmz/pdRo6piRwjIrEHbV1 i92A== 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=d2LuQ9+tNaM4iX/cPzhdZ44JC45KzMGRSOTVMyTga64=; b=pRqyuALnccqEbmnqDbKQiBBdW0bVI4qMAR2MX+jcO7YhmTWwgJGxADJV3G5od+NX+0 ecAh49NHGewxqQrLbrFgP3zuoAjgnpBJVq+1aJdhx+9dMz1KjH2DVdPqqt7HK/iJKOCE UMHTZTl3+A9K0DrWYglC5SxyJJUo1tdblRXRx4VOR65hXyaOsj16bTWQ8n5zBiwl/n2/ G+eeqmF8WFsjBuJxZ9DDEDdWW5kV0uGzG6Qb6H9bM9Q6xETrkd5HsZKLZeyn/Si9Nseq aaQErYUTdv/D38zKJ2JeZfZKWEsifIm8xvwlVRN0D0vrzRGczey0PC0gfymHYsLqSbt4 dytQ== X-Gm-Message-State: AGi0PuaNulblN7+5E5XMyNcAAn9+x/a80jIhDSx2t7Psq1VkQf/l1zSY MmQ2K5NXrnBTbqcPnWYmPio9/Ikc X-Google-Smtp-Source: APiQypLTExJmoPfCrwiXbr6n2YgIiH3ReADoHv65LIhP5tC20uJdWQFk4OyVzCWisp79x/KL6F59qw== X-Received: by 2002:a5d:5230:: with SMTP id i16mr5423057wra.15.1585863697150; Thu, 02 Apr 2020 14:41:37 -0700 (PDT) Received: from [192.168.43.18] (188.29.165.56.threembb.co.uk. [188.29.165.56]) by smtp.gmail.com with ESMTPSA id 91sm3123622wrf.79.2020.04.02.14.41.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Apr 2020 14:41:36 -0700 (PDT) From: Malcolm Priestley Subject: [PATCH 1/2] staging: vt6656: set all ofdm rates to default To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org Message-ID: <9a52d7f4-dd3e-efdc-eef8-bb794f7dea6d@gmail.com> Date: Thu, 2 Apr 2020 22:41:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.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 mac80211 rate control decides which odfm rates to use so all of them should be set enabled at the appropriate bit rate. This means vnt_get_ofdm_rate is no longer required. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/card.c | 54 +++-------------------------------- 1 file changed, 4 insertions(+), 50 deletions(-) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index dc3ab10eb630..4abbe9b30b65 100644 --- a/drivers/staging/vt6656/card.c +++ b/drivers/staging/vt6656/card.c @@ -100,48 +100,6 @@ static u16 vnt_get_cck_rate(struct vnt_private *priv, u16 rate_idx) return RATE_1M; } -/* - * Description: Get OFDM mode basic rate - * - * Parameters: - * In: - * priv - The adapter to be set - * rate_idx - Receiving data rate - * Out: - * none - * - * Return Value: response Control frame rate - * - */ -static u16 vnt_get_ofdm_rate(struct vnt_private *priv, u16 rate_idx) -{ - u16 ui = rate_idx; - - dev_dbg(&priv->usb->dev, "%s basic rate: %d\n", - __func__, priv->basic_rates); - - if (!vnt_ofdm_min_rate(priv)) { - dev_dbg(&priv->usb->dev, "%s (NO OFDM) %d\n", - __func__, rate_idx); - if (rate_idx > RATE_24M) - rate_idx = RATE_24M; - return rate_idx; - } - - while (ui > RATE_11M) { - if (priv->basic_rates & (1 << ui)) { - dev_dbg(&priv->usb->dev, "%s rate: %d\n", - __func__, ui); - return ui; - } - ui--; - } - - dev_dbg(&priv->usb->dev, "%s basic rate: 24M\n", __func__); - - return RATE_24M; -} - /* * Description: Calculate TxRate and RsvTime fields for RSPINF in OFDM mode. * @@ -289,20 +247,16 @@ void vnt_set_rspinf(struct vnt_private *priv, u8 bb_type) vnt_calculate_ofdm_rate(RATE_24M, bb_type, &tx_rate[4], &rsv_time[4]); /*RSPINF_a_36*/ - vnt_calculate_ofdm_rate(vnt_get_ofdm_rate(priv, RATE_36M), - bb_type, &tx_rate[5], &rsv_time[5]); + vnt_calculate_ofdm_rate(RATE_36M, bb_type, &tx_rate[5], &rsv_time[5]); /*RSPINF_a_48*/ - vnt_calculate_ofdm_rate(vnt_get_ofdm_rate(priv, RATE_48M), - bb_type, &tx_rate[6], &rsv_time[6]); + vnt_calculate_ofdm_rate(RATE_48M, bb_type, &tx_rate[6], &rsv_time[6]); /*RSPINF_a_54*/ - vnt_calculate_ofdm_rate(vnt_get_ofdm_rate(priv, RATE_54M), - bb_type, &tx_rate[7], &rsv_time[7]); + vnt_calculate_ofdm_rate(RATE_54M, bb_type, &tx_rate[7], &rsv_time[7]); /*RSPINF_a_72*/ - vnt_calculate_ofdm_rate(vnt_get_ofdm_rate(priv, RATE_54M), - bb_type, &tx_rate[8], &rsv_time[8]); + vnt_calculate_ofdm_rate(RATE_54M, bb_type, &tx_rate[8], &rsv_time[8]); put_unaligned(phy[0].len, (u16 *)&data[0]); data[2] = phy[0].signal; From patchwork Thu Apr 2 21:42:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11471617 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 E313992A for ; Thu, 2 Apr 2020 21:42:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C1E8A2080C for ; Thu, 2 Apr 2020 21:42:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="THfwV+3E" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388239AbgDBVmV (ORCPT ); Thu, 2 Apr 2020 17:42:21 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55855 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbgDBVmV (ORCPT ); Thu, 2 Apr 2020 17:42:21 -0400 Received: by mail-wm1-f67.google.com with SMTP id r16so5023688wmg.5 for ; Thu, 02 Apr 2020 14:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=deUrCaIYg9VqgBtDxyvSfNVjqbAj9bWkcCoGMyJST/s=; b=THfwV+3EtI6U2dmE7J9hZ6dlveFN4xZx7dFH4LVuA9JOP1RqHbbisSH/XqVzDHLDHt w7HgnXPEThde/sWy0nm185afUHdPIpcllMCy7wtVekiGas0/Y3ASI4wJy4x6UWgWwdZG BfzvjCQTgXNaUVg3kHkLZLDpNpNedFbWyYmBF6qtQdcXOnMiO1hFQbI/nb8XgjzaODqb Y0RXK/pYexQTM3rxvao6ypIvuLzlN+tncnPH4ZdQL6MB+xlENqhCEoCC9gqWJHuORhxA JOP4w39hIjuQ0p5FNCR5qX6syvb6hrh+ddoCodlB6lewmi6pPTfW8ZjuTvpu0uAiw67f mv2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=deUrCaIYg9VqgBtDxyvSfNVjqbAj9bWkcCoGMyJST/s=; b=QXWZT0279syj6Ajldy+gXanAZWpRfR6/r9iIFRNi6pN7Sma4bEMWr+3ZZcUKFGN09a SaVhh88EmdEJdQnovI77wJrVK05B7oi06kebH0pNjRl3VYSFwtZfJNSOyTBKzDniOCRN P1Z4/OomMtnl28PdZ9vGgwNgWTHc5Ayj73nYHmnUM1DajLeHza2z2JhtCZdpbEkMsBve b+wdJ8PxddN3t4rpIr8QwoIR6lbzyVFGRRMYGIkiifhTc4BpFqWILwHv23if5tYPNoDu T47T7ZwvL92Sn4ipfs8wQy6SRP81LGtOBXw/mLB77HsSUYdzR0/UkeWBOUDjZldMa5/s AhRA== X-Gm-Message-State: AGi0PuZvrWsbWgIS26O3IGk7EyebhOxP8P63uQhO9KVsDyzsQ1EHQBKL guPsn2gi+1KZ8fYB9+8NyMbL1/Jt X-Google-Smtp-Source: APiQypIsy2FRWSKqb9ajTmBG7N5fBeZ6/4rovH+7z8T8Glt/MH19turvmeAu0HNKw9PumETQ/f5Xdw== X-Received: by 2002:a1c:51:: with SMTP id 78mr5213590wma.157.1585863738628; Thu, 02 Apr 2020 14:42:18 -0700 (PDT) Received: from [192.168.43.18] (188.29.165.56.threembb.co.uk. [188.29.165.56]) by smtp.gmail.com with ESMTPSA id a145sm1050802wmd.20.2020.04.02.14.42.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Apr 2020 14:42:18 -0700 (PDT) To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org From: Malcolm Priestley Subject: [PATCH 2/2] staging: vt6656: set all cck rates to default. Message-ID: Date: Thu, 2 Apr 2020 22:42:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.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 mac80211 rate control decides which cck rates to use so all of them should be set enabled at the appropriate bit rate. This means vnt_get_cck_rate is no longer required. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/card.c | 38 ++++------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index 4abbe9b30b65..97e1538a528e 100644 --- a/drivers/staging/vt6656/card.c +++ b/drivers/staging/vt6656/card.c @@ -74,32 +74,6 @@ void vnt_set_channel(struct vnt_private *priv, u32 connection_channel) (u8)(connection_channel | 0x80)); } -/* - * Description: Get CCK mode basic rate - * - * Parameters: - * In: - * priv - The adapter to be set - * rate_idx - Receiving data rate - * Out: - * none - * - * Return Value: response Control frame rate - * - */ -static u16 vnt_get_cck_rate(struct vnt_private *priv, u16 rate_idx) -{ - u16 ui = rate_idx; - - while (ui > RATE_1M) { - if (priv->basic_rates & (1 << ui)) - return ui; - ui--; - } - - return RATE_1M; -} - /* * Description: Calculate TxRate and RsvTime fields for RSPINF in OFDM mode. * @@ -216,20 +190,16 @@ void vnt_set_rspinf(struct vnt_private *priv, u8 bb_type) int i; /*RSPINF_b_1*/ - vnt_get_phy_field(priv, 14, vnt_get_cck_rate(priv, RATE_1M), - PK_TYPE_11B, &phy[0]); + vnt_get_phy_field(priv, 14, RATE_1M, PK_TYPE_11B, &phy[0]); /*RSPINF_b_2*/ - vnt_get_phy_field(priv, 14, vnt_get_cck_rate(priv, RATE_2M), - PK_TYPE_11B, &phy[1]); + vnt_get_phy_field(priv, 14, RATE_2M, PK_TYPE_11B, &phy[1]); /*RSPINF_b_5*/ - vnt_get_phy_field(priv, 14, vnt_get_cck_rate(priv, RATE_5M), - PK_TYPE_11B, &phy[2]); + vnt_get_phy_field(priv, 14, RATE_5M, PK_TYPE_11B, &phy[2]); /*RSPINF_b_11*/ - vnt_get_phy_field(priv, 14, vnt_get_cck_rate(priv, RATE_11M), - PK_TYPE_11B, &phy[3]); + vnt_get_phy_field(priv, 14, RATE_11M, PK_TYPE_11B, &phy[3]); /*RSPINF_a_6*/ vnt_calculate_ofdm_rate(RATE_6M, bb_type, &tx_rate[0], &rsv_time[0]);