From patchwork Thu Sep 6 09:18:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 10590285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B08414BD for ; Thu, 6 Sep 2018 09:21:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0780029A9F for ; Thu, 6 Sep 2018 09:21:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE8862A40D; Thu, 6 Sep 2018 09:21:20 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 90FA229A9F for ; Thu, 6 Sep 2018 09:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=oBK3F5hYV3AccVa9KxR1Y6rF87hkyP+ucNdwRL9MSnU=; b=ZTm1iZbxCN9Qv9TfVDcsRqMlCa jUFW+kcIKluwWqK/JDlUuV3jOqf9v1ZApzEkiPH+8sYo50olJkdE96DmFxOm38idX3HNxu8T9rKID v7/h9rhEELuTzXP6FejJ7ncaI5VmJDONcZ5zmkLCl8huK2nAdcaCOVanhlgXwkcC3CwInGggxbhF4 DNPhdfpexXt0vKGm61jJCGsNU0m9Tr4UaZOE30H9UWAOKpEzBno6uaibGgTy19XLsIn++zT94pM77 TmInY5JuuMWAbtywm4KVQEXMOsR7WtTJQIi82BrpnY7O70go31LIWgAM4CSJBpQ/8gIK1/r2BwRCz 2yAdavvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxqTV-0006z9-2X for patchwork-linux-mediatek@patchwork.kernel.org; Thu, 06 Sep 2018 09:21:17 +0000 Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxqRi-0004zi-9E for linux-mediatek@lists.infradead.org; Thu, 06 Sep 2018 09:19:45 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 672CF4023337; Thu, 6 Sep 2018 09:19:20 +0000 (UTC) Received: from localhost (unknown [10.40.205.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2426EFA973; Thu, 6 Sep 2018 09:19:17 +0000 (UTC) From: Stanislaw Gruszka To: linux-wireless@vger.kernel.org Subject: [PATCH 07/42] mt76x0: introduce mt76x0_tx_prepare_skb routine Date: Thu, 6 Sep 2018 11:18:23 +0200 Message-Id: <1536225538-16454-8-git-send-email-sgruszka@redhat.com> In-Reply-To: <1536225538-16454-1-git-send-email-sgruszka@redhat.com> References: <1536225538-16454-1-git-send-email-sgruszka@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 06 Sep 2018 09:19:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 06 Sep 2018 09:19:20 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'sgruszka@redhat.com' RCPT:'' X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180906_021926_450890_B5D98925 X-CRM114-Status: UNSURE ( 9.10 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Bianconi , linux-mediatek@lists.infradead.org, Felix Fietkau MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lorenzo Bianconi Add mt76x0_tx_prepare_skb routine as tx txwi handler. mt76x0_tx_prepare_skb will be used by mt76-usb layer Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h | 5 ++++- drivers/net/wireless/mediatek/mt76/mt76x0/tx.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h b/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h index 8510f120a121..8b0bef9a15e4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h @@ -250,5 +250,8 @@ void mt76x0_dma_cleanup(struct mt76x0_dev *dev); int mt76x0_dma_enqueue_tx(struct mt76x0_dev *dev, struct sk_buff *skb, struct mt76_wcid *wcid, int hw_q); - +int mt76x0_tx_prepare_skb(struct mt76_dev *mdev, void *data, + struct sk_buff *skb, struct mt76_queue *q, + struct mt76_wcid *wcid, struct ieee80211_sta *sta, + u32 *tx_info); #endif diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c b/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c index de2643d54a1e..d6dbd9b8d68b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c @@ -116,6 +116,21 @@ void mt76x0_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, trace_mt76x0_tx(&dev->mt76, skb, msta, txwi); } +int mt76x0_tx_prepare_skb(struct mt76_dev *mdev, void *data, + struct sk_buff *skb, struct mt76_queue *q, + struct mt76_wcid *wcid, struct ieee80211_sta *sta, + u32 *tx_info) +{ + struct mt76x0_dev *dev = container_of(mdev, struct mt76x0_dev, mt76); + int len = skb->len, *hwq_ptr = (int *)data; + struct mt76x02_txwi *txwi; + + mt76x02_insert_hdr_pad(skb); + txwi = mt76x0_push_txwi(dev, skb, sta, wcid, len); + + return mt76x02_set_txinfo(skb, wcid, q2ep(*hwq_ptr)); +} + void mt76x0_tx_stat(struct work_struct *work) { struct mt76x0_dev *dev = container_of(work, struct mt76x0_dev,