From patchwork Sun Feb 1 11:59:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 5756661 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C9309BF440 for ; Sun, 1 Feb 2015 12:00:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA956201F4 for ; Sun, 1 Feb 2015 12:00:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4C22201F2 for ; Sun, 1 Feb 2015 12:00:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752972AbbBAMAY (ORCPT ); Sun, 1 Feb 2015 07:00:24 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:58737 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752860AbbBAMAS (ORCPT ); Sun, 1 Feb 2015 07:00:18 -0500 Received: by mail-we0-f169.google.com with SMTP id u56so34421385wes.0 for ; Sun, 01 Feb 2015 04:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aHdjbtz7gjQ9Y8/ObxWs9dndcBZlexhl39qZmNQNOiA=; b=AsCQvNLd+wlKiX6rWzURvroaTouY8Gwl9OAIIaI3m7znGgwqC5kfI2EZ9L7lfLsukl VVyLcEFtVediW3gTJNrDiP7PitpROy56oy10efSM0riI8WB76hAru2Hv9uR1RgwVULUI aN36bsEGYloFnT+Ei5+IYNElx73fTsulCkeUu563odmw4xm0X3RuiSonInHJ0qKBjf36 vWCqOhgONBvREHxBfT6SgfJWAIDUk003WFkZUfBL5Ox8ypXfLPMMWPiKeyC6Oxlfwx5g mXytzGxtHsnpJqzTYLsgxCW8lNXae/w+IRWc4Feqr0sC1j1QDEwXspHOjSH8fyk3tYZj tZvw== X-Received: by 10.180.74.52 with SMTP id q20mr14294937wiv.0.1422792017264; Sun, 01 Feb 2015 04:00:17 -0800 (PST) Received: from tipsey.3.home (94.196.240.163.threembb.co.uk. [94.196.240.163]) by mx.google.com with ESMTPSA id ud9sm15074446wib.5.2015.02.01.04.00.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Feb 2015 04:00:16 -0800 (PST) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Malcolm Priestley Subject: [PATCH 6/6] staging: vt6656: parse cts fall back out of vnt_fill_cts_head Date: Sun, 1 Feb 2015 11:59:43 +0000 Message-Id: <1422791983-3408-6-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422791983-3408-1-git-send-email-tvboxspy@gmail.com> References: <1422791983-3408-1-git-send-email-tvboxspy@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Creating new function vnt_fill_cts_fb_head for the fall back rates. The check for fb_option is now done in vnt_rxtx_cts. This fixes checkpatch warning WARNING: else is not generally useful after a break or return 559: FILE: drivers/staging/vt6656/rxtx.c:559: Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 99 +++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 3b90497..33baf26 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -518,60 +518,66 @@ static u16 vnt_rxtx_rts_a_fb_head(struct vnt_usb_send_context *tx_context, return vnt_rxtx_datahead_a_fb(tx_context, &buf->data_head); } -static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context, - union vnt_tx_data_head *head) +static u16 vnt_fill_cts_fb_head(struct vnt_usb_send_context *tx_context, + union vnt_tx_data_head *head) { struct vnt_private *priv = tx_context->priv; + struct vnt_cts_fb *buf = &head->cts_g_fb; u32 cts_frame_len = 14; u16 current_rate = tx_context->tx_rate; - if (tx_context->fb_option) { - /* Auto Fall back */ - struct vnt_cts_fb *buf = &head->cts_g_fb; - /* Get SignalField,ServiceField,Length */ - vnt_get_phy_field(priv, cts_frame_len, - priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b); - buf->duration_ba = - vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA, - tx_context->pkt_type, - current_rate); - /* Get CTSDuration_ba_f0 */ - buf->cts_duration_ba_f0 = - vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA_F0, - tx_context->pkt_type, - priv->tx_rate_fb0); - /* Get CTSDuration_ba_f1 */ - buf->cts_duration_ba_f1 = - vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA_F1, - tx_context->pkt_type, - priv->tx_rate_fb1); - /* Get CTS Frame body */ - buf->data.duration = buf->duration_ba; - buf->data.frame_control = - cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS); + /* Get SignalField,ServiceField,Length */ + vnt_get_phy_field(priv, cts_frame_len, priv->top_cck_basic_rate, + PK_TYPE_11B, &buf->b); - ether_addr_copy(buf->data.ra, priv->current_net_addr); + buf->duration_ba = + vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA, + tx_context->pkt_type, + current_rate); + /* Get CTSDuration_ba_f0 */ + buf->cts_duration_ba_f0 = + vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA_F0, + tx_context->pkt_type, + priv->tx_rate_fb0); + /* Get CTSDuration_ba_f1 */ + buf->cts_duration_ba_f1 = + vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA_F1, + tx_context->pkt_type, + priv->tx_rate_fb1); + /* Get CTS Frame body */ + buf->data.duration = buf->duration_ba; + buf->data.frame_control = + cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS); - return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head); - } else { - struct vnt_cts *buf = &head->cts_g; - /* Get SignalField,ServiceField,Length */ - vnt_get_phy_field(priv, cts_frame_len, - priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b); - /* Get CTSDuration_ba */ - buf->duration_ba = - vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA, - tx_context->pkt_type, - current_rate); - /*Get CTS Frame body*/ - buf->data.duration = buf->duration_ba; - buf->data.frame_control = - cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS); + ether_addr_copy(buf->data.ra, priv->current_net_addr); - ether_addr_copy(buf->data.ra, priv->current_net_addr); + return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head); +} - return vnt_rxtx_datahead_g(tx_context, &buf->data_head); - } +static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context, + union vnt_tx_data_head *head) +{ + struct vnt_private *priv = tx_context->priv; + struct vnt_cts *buf = &head->cts_g; + u32 cts_frame_len = 14; + u16 current_rate = tx_context->tx_rate; + + /* Get SignalField,ServiceField,Length */ + vnt_get_phy_field(priv, cts_frame_len, priv->top_cck_basic_rate, + PK_TYPE_11B, &buf->b); + /* Get CTSDuration_ba */ + buf->duration_ba = + vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA, + tx_context->pkt_type, + current_rate); + /*Get CTS Frame body*/ + buf->data.duration = buf->duration_ba; + buf->data.frame_control = + cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS); + + ether_addr_copy(buf->data.ra, priv->current_net_addr); + + return vnt_rxtx_datahead_g(tx_context, &buf->data_head); } static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context, @@ -628,6 +634,9 @@ static u16 vnt_rxtx_cts(struct vnt_usb_send_context *tx_context, head = &tx_head->tx_cts.tx.mic.head; /* Fill CTS */ + if (tx_context->fb_option) + return vnt_fill_cts_fb_head(tx_context, head); + return vnt_fill_cts_head(tx_context, head); }