From patchwork Fri Jan 9 19:15:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 5602311 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C4E19F357 for ; Fri, 9 Jan 2015 19:18:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1949320630 for ; Fri, 9 Jan 2015 19:18:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EE8620639 for ; Fri, 9 Jan 2015 19:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758194AbbAITSb (ORCPT ); Fri, 9 Jan 2015 14:18:31 -0500 Received: from mail-oi0-f49.google.com ([209.85.218.49]:57885 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758179AbbAITS3 (ORCPT ); Fri, 9 Jan 2015 14:18:29 -0500 Received: by mail-oi0-f49.google.com with SMTP id a141so13223456oig.8 for ; Fri, 09 Jan 2015 11:18:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iirv4o+rMKcmZ7Jo8ly6vz7AQiguP8CjRaTBcLEBkew=; b=P1a4bLy2M2BNkjOrDpPmTM5tyFhRWgw/UQElFrQSpdA92rk9Ha7cZ5elZD1YJmvyO7 W/ikS5EtJsqFdHnmfDRJgRa2ueti0Jp77ZqUfalLHoQMHwStl+5t2RzyBN2yWkHrHRtY cKLjK2uY3Olu+t/WJ1b7XbrDkYRGStFRrUZWZC2KbLl2FNcABgD93RkF+Oa+Q3nAfNfZ viSS/52X8t0wGj20ma5sdiHxZ2IR8jVnmL6ZdhCU3QtSwKm7yoMdFLPdo/9UUkAOKVrW iQCA+Qth0U5/qvv/vEroqn5SMv85SABJfH1UGifWLgg5mpwxnHThfe1i+UBXxunrdJ2X wmDA== X-Gm-Message-State: ALoCoQnik8OOEjSiEhqhqoAjf+Ea6/S5H6YW7eIuj/LFDv+yimGlAzcIaiFysCQdL66N5oYzpA3K X-Received: by 10.202.12.72 with SMTP id 69mr9647902oim.50.1420831108624; Fri, 09 Jan 2015 11:18:28 -0800 (PST) Received: from hash ([2001:470:1d:6db:230:48ff:fe9d:9c89]) by mx.google.com with ESMTPSA id j10sm4822570obh.23.2015.01.09.11.18.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Jan 2015 11:18:27 -0800 (PST) Received: from bob by hash with local (Exim 4.80) (envelope-from ) id 1Y9f3V-0002XS-4Y; Fri, 09 Jan 2015 14:17:09 -0500 From: Bob Copeland To: linux-wireless@vger.kernel.org Cc: Eugene Krasnikov , Bob Copeland Subject: [PATCH 7/8] wcn36xx: move set_tx_pdu inside set_tx_data/mgmt Date: Fri, 9 Jan 2015 14:15:51 -0500 Message-Id: <1420830952-9624-8-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1420830952-9624-1-git-send-email-me@bobcopeland.com> References: <1420830952-9624-1-git-send-email-me@bobcopeland.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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The pdu is part of the buffer descriptor, so it makes sense that one function would fill both. Also, passing the whole skb instead of just the header pointer to the set_tx_data function paves the way for using its fields for ampdu setup inside set_tx_data(). Signed-off-by: Bob Copeland --- drivers/net/wireless/ath/wcn36xx/txrx.c | 37 +++++++++++++++++-------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index 277bc39..7f0d9e6 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -115,9 +115,10 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, struct wcn36xx *wcn, struct wcn36xx_vif **vif_priv, struct wcn36xx_sta *sta_priv, - struct ieee80211_hdr *hdr, + struct sk_buff *skb, bool bcast) { + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_vif *vif = NULL; struct wcn36xx_vif *__vif_priv = NULL; bd->bd_rate = WCN36XX_BD_RATE_DATA; @@ -158,14 +159,21 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, bd->ack_policy = 1; } *vif_priv = __vif_priv; + + wcn36xx_set_tx_pdu(bd, + ieee80211_is_data_qos(hdr->frame_control) ? + sizeof(struct ieee80211_qos_hdr) : + sizeof(struct ieee80211_hdr_3addr), + skb->len, sta_priv ? sta_priv->tid : 0); } static void wcn36xx_set_tx_mgmt(struct wcn36xx_tx_bd *bd, struct wcn36xx *wcn, struct wcn36xx_vif **vif_priv, - struct ieee80211_hdr *hdr, + struct sk_buff *skb, bool bcast) { + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct wcn36xx_vif *__vif_priv = get_vif_by_addr(wcn, hdr->addr2); bd->sta_index = __vif_priv->self_sta_index; @@ -199,6 +207,12 @@ static void wcn36xx_set_tx_mgmt(struct wcn36xx_tx_bd *bd, } else bd->queue_id = WCN36XX_TX_U_WQ_ID; *vif_priv = __vif_priv; + + wcn36xx_set_tx_pdu(bd, + ieee80211_is_data_qos(hdr->frame_control) ? + sizeof(struct ieee80211_qos_hdr) : + sizeof(struct ieee80211_hdr_3addr), + skb->len, WCN36XX_TID); } int wcn36xx_start_tx(struct wcn36xx *wcn, @@ -260,22 +274,11 @@ int wcn36xx_start_tx(struct wcn36xx *wcn, } /* Data frames served first*/ - if (is_low) { - wcn36xx_set_tx_data(bd, wcn, &vif_priv, sta_priv, hdr, bcast); - wcn36xx_set_tx_pdu(bd, - ieee80211_is_data_qos(hdr->frame_control) ? - sizeof(struct ieee80211_qos_hdr) : - sizeof(struct ieee80211_hdr_3addr), - skb->len, sta_priv ? sta_priv->tid : 0); - } else { + if (is_low) + wcn36xx_set_tx_data(bd, wcn, &vif_priv, sta_priv, skb, bcast); + else /* MGMT and CTRL frames are handeld here*/ - wcn36xx_set_tx_mgmt(bd, wcn, &vif_priv, hdr, bcast); - wcn36xx_set_tx_pdu(bd, - ieee80211_is_data_qos(hdr->frame_control) ? - sizeof(struct ieee80211_qos_hdr) : - sizeof(struct ieee80211_hdr_3addr), - skb->len, WCN36XX_TID); - } + wcn36xx_set_tx_mgmt(bd, wcn, &vif_priv, skb, bcast); buff_to_be((u32 *)bd, sizeof(*bd)/sizeof(u32)); bd->tx_bd_sign = 0xbdbdbdbd;