From patchwork Sat Apr 29 12:03:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 9705775 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB274603F7 for ; Sat, 29 Apr 2017 12:04:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B02D828558 for ; Sat, 29 Apr 2017 12:04:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 929672868D; Sat, 29 Apr 2017 12:04:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 406C628558 for ; Sat, 29 Apr 2017 12:04:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426781AbdD2MEG (ORCPT ); Sat, 29 Apr 2017 08:04:06 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:33020 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1426015AbdD2MEE (ORCPT ); Sat, 29 Apr 2017 08:04:04 -0400 Received: by mail-wr0-f193.google.com with SMTP id w50so9519306wrc.0 for ; Sat, 29 Apr 2017 05:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=CDc/xoKKqltYb68JTBEz8m6pUX0akfmj1sRoyZOImk8=; b=tdCh0RZ4tKT3Fsep7d6xQvqs33KXUMSC441rVcyIHpJO2lhc1YFrCYTSHKvVSweYSA Z2bY4IWAishKLXLzWndMkEhug3qAzFx5LxeFrpLG5C17t1RV42sAUK2xNvGe1KT1ZzjB hUgxmIj8ojHhOKmwOyWcSJPPR5GxiflnsnlOnqQhdPC5FX9yJxUmUd3ZQo+cUee0NZZA tgyOa/0oH3KEhciJH/1+fOVSkWXbVPU/jTGHT49BHPJpiBXF7/wX8vtMZo5sa11Fc3Kz befnmggPOqwabatCHRt5E+B/UGYRDVQ06dHgqqWmeg+OcPrVfJ+/41RUl17gwqzgGbDi cwsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CDc/xoKKqltYb68JTBEz8m6pUX0akfmj1sRoyZOImk8=; b=fxyxpTVjhWiKK+rPUqdzdCd8IxrkNkZneSqmIxXDE+jEBFeeM/iX1QyTQIBA2wCckZ 887MJyoWf0RxO0cS5rkdxzUDK6BhnXSAZA6XawhiN/63/B9vLSV9DyStV8HjYcPpkAMN KS0XmGeaF8+8Goa4Wy4xMwU+loYm7LA1ulBdNZs/EouP1ctfw76LHzwqYtmRLZ/wpWEJ WxX0oIEbxuaz1uT3luhfzBn1+3kGCUwtVHe8LrDnsSc0wbGXwIcOuyy8SrnaaMSBz3// mA0Qlm1tbAqd+XAyIoxuPHvjz2XpGnLPV4NMCEFiiTHZu3azMpJ5///YAJ48jBoF9dR5 Edyg== X-Gm-Message-State: AN3rC/4kaqK47Q1j+6+QojWgrrMlU21+cmx7dDo1OZMNHF9L5IaKAoln xXVMH96fh7MRfQ== X-Received: by 10.223.149.33 with SMTP id 30mr10551444wrs.61.1493467443257; Sat, 29 Apr 2017 05:04:03 -0700 (PDT) Received: from localhost.localdomain (188.29.165.54.threembb.co.uk. [188.29.165.54]) by smtp.gmail.com with ESMTPSA id 30sm1463083wrp.6.2017.04.29.05.04.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Apr 2017 05:04:02 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Malcolm Priestley Subject: [PATCH 1/4] staging: vt6656: vnt_update_ifs set max_min based on short slot time. Date: Sat, 29 Apr 2017 13:03:42 +0100 Message-Id: <20170429120345.3782-1-tvboxspy@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Short slot time is controlled by mac80211 so there is no need to find odfm rates. Merge PK_TYPE_11B and PK_TYPE_11GA & PK_TYPE_11GB into one else and switch on short slot time. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/card.c | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index 0e5a99375099..c61422ea8846 100644 --- a/drivers/staging/vt6656/card.c +++ b/drivers/staging/vt6656/card.c @@ -359,35 +359,18 @@ void vnt_update_ifs(struct vnt_private *priv) priv->sifs = C_SIFS_A; priv->difs = C_SIFS_A + 2 * C_SLOT_SHORT; max_min = 4; - } else if (priv->packet_type == PK_TYPE_11B) { - priv->slot = C_SLOT_LONG; - priv->sifs = C_SIFS_BG; - priv->difs = C_SIFS_BG + 2 * C_SLOT_LONG; - max_min = 5; - } else {/* PK_TYPE_11GA & PK_TYPE_11GB */ - bool ofdm_rate = false; - unsigned int ii = 0; - + } else { priv->sifs = C_SIFS_BG; - if (priv->short_slot_time) + if (priv->short_slot_time) { priv->slot = C_SLOT_SHORT; - else + max_min = 4; + } else { priv->slot = C_SLOT_LONG; - - priv->difs = C_SIFS_BG + 2 * priv->slot; - - for (ii = RATE_54M; ii >= RATE_6M; ii--) { - if (priv->basic_rates & ((u32)(0x1 << ii))) { - ofdm_rate = true; - break; - } + max_min = 5; } - if (ofdm_rate) - max_min = 4; - else - max_min = 5; + priv->difs = C_SIFS_BG + 2 * priv->slot; } priv->eifs = C_EIFS;