From patchwork Mon Feb 27 12:42:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9593085 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 819A2604AB for ; Mon, 27 Feb 2017 12:46:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74CB4283C2 for ; Mon, 27 Feb 2017 12:46:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 682FD28488; Mon, 27 Feb 2017 12:46:31 +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 A90AE282ED for ; Mon, 27 Feb 2017 12:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751437AbdB0Moa (ORCPT ); Mon, 27 Feb 2017 07:44:30 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35696 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751424AbdB0MoE (ORCPT ); Mon, 27 Feb 2017 07:44:04 -0500 Received: by mail-lf0-f67.google.com with SMTP id z127so6118712lfa.2 for ; Mon, 27 Feb 2017 04:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pq55kr6CLe4RYnEz3d/AcnFEKgja6QTzz/85b3+YFZI=; b=k5T4+wt2zwi0o8ELlj+j6aRwIyky9fMy3xkrMeRjjzl5Cl4WtKCdr1MpOFN3WG7E72 N2hIRQlDKyqfpRHD4jECt+ScI45iHZZ9ZyFLyXoJ+OGe5m7ug0xFjYunSOh+vAADbR2d 4YwzqRI4Nvac1DT5CMeWCA/g86SNIlWAK+iVa5BJ/6eTMFswHNwWDST8F+uGHG60WlXR suOxKjBJ9InXU7m/xo+KXKYpV0pf+H9EGgzRfhKmbQCuQ1rLDpmZK3ZIW/3EfvVv9jBm O4LORNhNkN29rELS3/2tvI7WBayAlTPo0R8zY83WbOpib1ZrlAUxcmsGRrruxxprMdU0 CMNA== 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:mime-version :content-transfer-encoding; bh=Pq55kr6CLe4RYnEz3d/AcnFEKgja6QTzz/85b3+YFZI=; b=Ht3eg0Y9gKt/YcCHdzOMOGem9AuROsR2m8dp7yGD8EgdLYno7ogt41oR2Vo8Y+eH78 7fu7jUDWUsJ2usdbLahchL8thl7GsmDo33pe/VhLYzSxyLwAYkRCLRfJj9afxeB81+58 jEwqfeMolYvNcRjbUYcRk2Jo6eBZM7cveA5BVddgfX1MipzDDZausSRD5xJk+10nSoUU 459tc2jlQcioSXa2RI9Cx9pnXbU+8ju2YJplcuTwRoMA1AfVGyakVn8oPSfl7ECqIMZU FSDx/ijRAyHmLWMQPOAb8jEoITbbPEk2/+vQNZngexduliYAWsHrY91kCtGn1vWBcLgI gJkw== X-Gm-Message-State: AMke39nauELM+ytJcHZNu8r1HzGOE9jtmjjxmKx3zXD9K6ixGj2mMxzdWkK9Uwqmyj01EA== X-Received: by 10.46.7.25 with SMTP id 25mr4322155ljh.41.1488199383497; Mon, 27 Feb 2017 04:43:03 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id g16sm747899lji.62.2017.02.27.04.43.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Feb 2017 04:43:02 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH 4.12] brcmfmac: move brcmf_txcomplete function to fwsignal.c Date: Mon, 27 Feb 2017 13:42:51 +0100 Message-Id: <20170227124251.30338-1-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.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 From: Rafał Miłecki This function is called by USB and SDIO only, both using BCDC & FW Signalling. Move it out of core.c to make this file more generic and allow making fwsignal optional in the future. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 3 --- .../net/wireless/broadcom/brcm80211/brcmfmac/core.c | 18 ------------------ .../wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 18 ++++++++++++++++++ .../wireless/broadcom/brcm80211/brcmfmac/fwsignal.h | 5 +++++ .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 2 +- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h index 76693df34742..059e40fdc3d5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h @@ -232,9 +232,6 @@ void brcmf_dev_reset(struct device *dev); /* Indication from bus module to change flow-control state */ void brcmf_txflowblock(struct device *dev, bool state); -/* Notify the bus has transferred the tx packet to firmware */ -void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success); - /* Configure the "global" bus state used by upper layers */ void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 59831dc446d6..47cfb82dbfeb 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -383,24 +383,6 @@ void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success) brcmu_pkt_buf_free_skb(txp); } -void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success) -{ - struct brcmf_bus *bus_if = dev_get_drvdata(dev); - struct brcmf_pub *drvr = bus_if->drvr; - struct brcmf_if *ifp; - - /* await txstatus signal for firmware if active */ - if (brcmf_fws_fc_active(drvr->fws)) { - if (!success) - brcmf_fws_bustxfail(drvr->fws, txp); - } else { - if (brcmf_proto_hdrpull(drvr, false, txp, &ifp)) - brcmu_pkt_buf_free_skb(txp); - else - brcmf_txfinalize(ifp, txp, success); - } -} - static void brcmf_ethtool_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo *info) { diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index 5f1a5929cb30..07f0b3cfd59c 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -2445,6 +2445,24 @@ bool brcmf_fws_fc_active(struct brcmf_fws_info *fws) return fws->fcmode != BRCMF_FWS_FCMODE_NONE; } +void brcmf_fws_txcomplete(struct device *dev, struct sk_buff *txp, bool success) +{ + struct brcmf_bus *bus_if = dev_get_drvdata(dev); + struct brcmf_pub *drvr = bus_if->drvr; + struct brcmf_if *ifp; + + /* await txstatus signal for firmware if active */ + if (brcmf_fws_fc_active(drvr->fws)) { + if (!success) + brcmf_fws_bustxfail(drvr->fws, txp); + } else { + if (brcmf_proto_hdrpull(drvr, false, txp, &ifp)) + brcmu_pkt_buf_free_skb(txp); + else + brcmf_txfinalize(ifp, txp, success); + } +} + void brcmf_fws_bustxfail(struct brcmf_fws_info *fws, struct sk_buff *skb) { u32 hslot; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h index bb4591c4a14a..d534164785de 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h @@ -32,6 +32,11 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb); void brcmf_fws_reset_interface(struct brcmf_if *ifp); void brcmf_fws_add_interface(struct brcmf_if *ifp); void brcmf_fws_del_interface(struct brcmf_if *ifp); + +/* Notify the bus has transferred the tx packet to firmware */ +void brcmf_fws_txcomplete(struct device *dev, struct sk_buff *txp, + bool success); + void brcmf_fws_bustxfail(struct brcmf_fws_info *fws, struct sk_buff *skb); void brcmf_fws_bus_blocked(struct brcmf_pub *drvr, bool flow_blocked); void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *skb); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 10522edc9750..1d7ca341fb9f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -2266,7 +2266,7 @@ static int brcmf_sdio_txpkt(struct brcmf_sdio *bus, struct sk_buff_head *pktq, bus->tx_seq = (bus->tx_seq + pktq->qlen) % SDPCM_SEQ_WRAP; skb_queue_walk_safe(pktq, pkt_next, tmp) { __skb_unlink(pkt_next, pktq); - brcmf_txcomplete(bus->sdiodev->dev, pkt_next, ret == 0); + brcmf_fws_txcomplete(bus->sdiodev->dev, pkt_next, ret == 0); } return ret; } diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c index c527aa8a5f8f..29f83a575e4d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c @@ -484,7 +484,7 @@ static void brcmf_usb_tx_complete(struct urb *urb) req->skb); brcmf_usb_del_fromq(devinfo, req); - brcmf_txcomplete(devinfo->dev, req->skb, urb->status == 0); + brcmf_fws_txcomplete(devinfo->dev, req->skb, urb->status == 0); req->skb = NULL; brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req, &devinfo->tx_freecount); spin_lock_irqsave(&devinfo->tx_flowblock_lock, flags);