From patchwork Mon Feb 27 12:06:06 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: 9593049 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 02D4B601D7 for ; Mon, 27 Feb 2017 12:14:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBF85283C2 for ; Mon, 27 Feb 2017 12:14:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF6A128487; Mon, 27 Feb 2017 12:14:25 +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 C730D28488 for ; Mon, 27 Feb 2017 12:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752069AbdB0MOX (ORCPT ); Mon, 27 Feb 2017 07:14:23 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:36451 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751550AbdB0MOI (ORCPT ); Mon, 27 Feb 2017 07:14:08 -0500 Received: by mail-lf0-f66.google.com with SMTP id l6so1076072lfb.3 for ; Mon, 27 Feb 2017 04:13:08 -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=h6yejiD73AOkNDuKIGoJ4SHPmmql6LSM56XxRAe2pV4=; b=YI96qUCfCRfoGqbgJQkKpJRPaoJggakk8v3w3oTb2g+CoS9hnqI045XaqILeC1NMc6 Fh6XDGWAaXl4+hGngssxETgjrVATLtKcyjPHOzYV4RncY3YCBzWiB/aO714lwNrR+ZhZ +Iz6B22l/B3sqU03cpIkcM/CPLBlWPGI/DF2smMPiCuV7HZ69FKUFouUW+Aqn1s0kNA7 0OtA6/fQcIWucQTnOvmyVU47xI9bUVQ5t9b2lgkhp0knSdMhGOcI0Xy8pQ3EULyEOmYk tOYaHq864BFQTqznjsDzCf04hzxweSymHasQMkL/g35Bn/aNDy/CsZlmzcMxJZFJrAE0 hCHg== 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=h6yejiD73AOkNDuKIGoJ4SHPmmql6LSM56XxRAe2pV4=; b=jg/Z89RwxhVj/BXT+pGr/KFPF3P5XfuWlg9lIqPLPj+ALqWvT3053GNBlJNXAXqcHF sFZozpDPbgODzenL7BG6nBv6PayW68ELfyIZ6XNktp9U6jCAbXedsAXva8JPLGmM6f+P 9sq61uDlKvZNWrtn5DweZ7g3xCLPo2T5nM7VyBq6zx+bRyqDW5IaF2MfOOo52DBU3kRk mFnxDU6TIoRMkWtm0qSWNkY0tMLvPzefBniKqV/fkeERnySjBoBiF5vgPHt+26x6SQs6 3VgqP8vYNs2AtAnXZWw0SmzHbILEIdj80CrTBNl33+ear72nCsAkZnggCkxIqPrO6Q2r dbLA== X-Gm-Message-State: AMke39lQi3fdvhNwCBnCgEJ82Pu2iKB9078ZPDsqdRU38Vw7QIgY2lYVfI+tzjiMFmPMZw== X-Received: by 10.25.233.201 with SMTP id j70mr4591703lfk.20.1488197177935; Mon, 27 Feb 2017 04:06:17 -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 y1sm10534086lja.68.2017.02.27.04.06.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Feb 2017 04:06:17 -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: get rid of brcmf_txflowblock helper function Date: Mon, 27 Feb 2017 13:06:06 +0100 Message-Id: <20170227120606.15506-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 helper function is pretty trivial and we can easily do without it. What's important though it's one of FWS (Firmware Signalling) dependencies in core.c. The plan is to make FWS required by BCDC only so we don't have to use/compile it when using msgbuf. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 10 ---------- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h | 4 ++++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++-- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 7 +++++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 2f2f3a5ad86a..59831dc446d6 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -283,16 +283,6 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp, spin_unlock_irqrestore(&ifp->netif_stop_lock, flags); } -void brcmf_txflowblock(struct device *dev, bool state) -{ - struct brcmf_bus *bus_if = dev_get_drvdata(dev); - struct brcmf_pub *drvr = bus_if->drvr; - - brcmf_dbg(TRACE, "Enter\n"); - - brcmf_fws_bus_blocked(drvr, state); -} - void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb) { if (skb->pkt_type == PACKET_MULTICAST) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h index 96df66073b2a..bb4591c4a14a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h @@ -18,6 +18,10 @@ #ifndef FWSIGNAL_H_ #define FWSIGNAL_H_ +struct brcmf_fws_info; +struct brcmf_if; +struct brcmf_pub; + int brcmf_fws_init(struct brcmf_pub *drvr); void brcmf_fws_deinit(struct brcmf_pub *drvr); bool brcmf_fws_queue_skbs(struct brcmf_fws_info *fws); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index c5744b45ec8f..10522edc9750 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -44,6 +44,7 @@ #include "firmware.h" #include "core.h" #include "common.h" +#include "fwsignal.h" #define DCMD_RESP_TIMEOUT msecs_to_jiffies(2500) #define CTL_DONE_TIMEOUT msecs_to_jiffies(2500) @@ -2272,6 +2273,7 @@ static int brcmf_sdio_txpkt(struct brcmf_sdio *bus, struct sk_buff_head *pktq, static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes) { + struct brcmf_pub *pub = bus->sdiodev->bus_if->drvr; struct sk_buff *pkt; struct sk_buff_head pktq; u32 intstatus = 0; @@ -2328,7 +2330,7 @@ static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes) if ((bus->sdiodev->state == BRCMF_SDIOD_DATA) && bus->txoff && (pktq_len(&bus->txq) < TXLOW)) { bus->txoff = false; - brcmf_txflowblock(bus->sdiodev->dev, false); + brcmf_fws_bus_blocked(pub, false); } return cnt; @@ -2723,6 +2725,7 @@ static int brcmf_sdio_bus_txdata(struct device *dev, struct sk_buff *pkt) struct brcmf_bus *bus_if = dev_get_drvdata(dev); struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; struct brcmf_sdio *bus = sdiodev->bus; + struct brcmf_pub *pub = bus->sdiodev->bus_if->drvr; brcmf_dbg(TRACE, "Enter: pkt: data %p len %d\n", pkt->data, pkt->len); if (sdiodev->state != BRCMF_SDIOD_DATA) @@ -2753,7 +2756,7 @@ static int brcmf_sdio_bus_txdata(struct device *dev, struct sk_buff *pkt) if (pktq_len(&bus->txq) >= TXHI) { bus->txoff = true; - brcmf_txflowblock(dev, true); + brcmf_fws_bus_blocked(pub, true); } spin_unlock_bh(&bus->txq_lock); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c index d93ebbdc7737..c527aa8a5f8f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c @@ -26,6 +26,7 @@ #include "bus.h" #include "debug.h" #include "firmware.h" +#include "fwsignal.h" #include "usb.h" #include "core.h" #include "common.h" @@ -476,6 +477,7 @@ static void brcmf_usb_tx_complete(struct urb *urb) { struct brcmf_usbreq *req = (struct brcmf_usbreq *)urb->context; struct brcmf_usbdev_info *devinfo = req->devinfo; + struct brcmf_pub *pub = devinfo->bus_pub.bus->drvr; unsigned long flags; brcmf_dbg(USB, "Enter, urb->status=%d, skb=%p\n", urb->status, @@ -488,7 +490,7 @@ static void brcmf_usb_tx_complete(struct urb *urb) spin_lock_irqsave(&devinfo->tx_flowblock_lock, flags); if (devinfo->tx_freecount > devinfo->tx_high_watermark && devinfo->tx_flowblock) { - brcmf_txflowblock(devinfo->dev, false); + brcmf_fws_bus_blocked(pub, false); devinfo->tx_flowblock = false; } spin_unlock_irqrestore(&devinfo->tx_flowblock_lock, flags); @@ -598,6 +600,7 @@ brcmf_usb_state_change(struct brcmf_usbdev_info *devinfo, int state) static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb) { struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(dev); + struct brcmf_pub *pub = devinfo->bus_pub.bus->drvr; struct brcmf_usbreq *req; int ret; unsigned long flags; @@ -635,7 +638,7 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb) spin_lock_irqsave(&devinfo->tx_flowblock_lock, flags); if (devinfo->tx_freecount < devinfo->tx_low_watermark && !devinfo->tx_flowblock) { - brcmf_txflowblock(dev, true); + brcmf_fws_bus_blocked(pub, true); devinfo->tx_flowblock = true; } spin_unlock_irqrestore(&devinfo->tx_flowblock_lock, flags);