From patchwork Wed Nov 1 15:29:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 10036515 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 DA8CF603B5 for ; Wed, 1 Nov 2017 15:30:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE9352891D for ; Wed, 1 Nov 2017 15:30:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C317F28ADD; Wed, 1 Nov 2017 15:30:02 +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=-4.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID, URIBL_BLACK 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 5AC6F2891D for ; Wed, 1 Nov 2017 15:30:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754762AbdKAPaA (ORCPT ); Wed, 1 Nov 2017 11:30:00 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:45364 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246AbdKAP3h (ORCPT ); Wed, 1 Nov 2017 11:29:37 -0400 Received: by mail-oi0-f67.google.com with SMTP id f66so5042088oib.2 for ; Wed, 01 Nov 2017 08:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=e6MZyv/pcSCT13T25rEixGDlnsTw5yHS6wrpKMlkX1w=; b=cHrIudQbpUfolh2QAW+EAu57VCeoeSoT1tjGzviz3xC57yl9/sVdrIRzrEjkEMxmd2 Wv8dJ929Th0SDVPq6gAj0svg7gK3GzkELUQO+qQ3H2HGvh03cX8TkhM+guqbpdg9JJtd jgyh5vxgUUAx+vHWRKU+ixIK1NoZRZryu1+Z4DKmP4lzKReDc1jCSeHjaU+jnZ1jWhFG ABh9BoMSKcDAJ86L59yF/9OPKvJnbQfnjPDwjvM+uasW2jngROB3Dc1DTsWyzgEKtfn8 /ypGUkYtQx1B+jvdHJb0QVUAauZr1eJi/Mw+YoMRZurqMiSDmaRdVAgtsgA5G2kJkDuT DGnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=e6MZyv/pcSCT13T25rEixGDlnsTw5yHS6wrpKMlkX1w=; b=Q9wlcu7MhdxNIoV0jbhvNf05Ui+B+A2b7y3ntETrfIirFRHjBBcK3r30idW0z56lAn JjqGJ6T52JxCIsFbEUTx9CnNquvx36lqHU7qC0WmqRpDQymTCPvH3uT7zl0zzc3wYSHR gsvH1EK8HCjbT4JU5xbsgO6eL26la+g1mZqGSlQV2kr7vcldqOGyLekXSrmwfPEUwkWV nvNwzb1KECtBQUjOzOWIGqVuQI/vuHa6domF9pXLRK/T+hiqp/oAnLHZai5iaN1rdPzX LGVm+0ZBipmzrBIve5sS3WjfWVCdHWuqnOZ0rnO1jyCr2AdUyemDobz+EMSdWTIFrKph oC2g== X-Gm-Message-State: AMCzsaX+l7XryjxlN7+jkfNxqaYNpVm25K0erDSUoyrgR6lKNTSeAVRU MPYa7l984dKB+iKHsu/iO44= X-Google-Smtp-Source: ABhQp+S7CP9gzp9mhof2PA/3dMGKsUhidITgugnqFzJTzHLIVn1QOT5WGnutu0PVvf/yUqDzF0ipOw== X-Received: by 10.202.207.199 with SMTP id f190mr124768oig.245.1509550176540; Wed, 01 Nov 2017 08:29:36 -0700 (PDT) Received: from Larrylap.localdomain (cpe-24-31-251-255.kc.res.rr.com. [24.31.251.255]) by smtp.gmail.com with ESMTPSA id v21sm338515ote.49.2017.11.01.08.29.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Nov 2017 08:29:36 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Ping-Ke Shih , Larry Finger , Yan-Hsuan Chuang , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH 05/11] rtlwifi: rtl_pci: Add fill_tx_special_desc to issue H2C data, and process TXOK in interrupt. Date: Wed, 1 Nov 2017 10:29:20 -0500 Message-Id: <20171101152926.24971-6-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171101152926.24971-1-Larry.Finger@lwfinger.net> References: <20171101152926.24971-1-Larry.Finger@lwfinger.net> 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: Ping-Ke Shih With the RTL8822BE, an H2C tx queue is added to download FW and special data. This change implements the support code in rtl_pci. Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- drivers/net/wireless/realtek/rtlwifi/pci.c | 11 +++++++++++ drivers/net/wireless/realtek/rtlwifi/pci.h | 1 + drivers/net/wireless/realtek/rtlwifi/wifi.h | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index e8c8ce601229..0c30f4bf657b 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c @@ -926,6 +926,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) unsigned long flags; u32 inta = 0; u32 intb = 0; + u32 intd = 0; irqreturn_t ret = IRQ_HANDLED; if (rtlpci->irq_enabled == 0) @@ -1007,6 +1008,16 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) _rtl_pci_tx_isr(hw, VO_QUEUE); } + if (rtlhal->hw_type == HARDWARE_TYPE_RTL8822BE) { + if (intd & rtlpriv->cfg->maps[RTL_IMR_H2CDOK]) { + rtlpriv->link_info.num_tx_inperiod++; + + RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, + "H2C TX OK interrupt!\n"); + _rtl_pci_tx_isr(hw, H2C_QUEUE); + } + } + if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE) { if (inta & rtlpriv->cfg->maps[RTL_IMR_COMDOK]) { rtlpriv->link_info.num_tx_inperiod++; diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.h b/drivers/net/wireless/realtek/rtlwifi/pci.h index 0f1a0f8585b6..6bf346ec4616 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.h +++ b/drivers/net/wireless/realtek/rtlwifi/pci.h @@ -51,6 +51,7 @@ #define MGNT_QUEUE 6 #define HIGH_QUEUE 7 #define HCCA_QUEUE 8 +#define H2C_QUEUE TXCMD_QUEUE /* In 8822B */ #define RTL_PCI_DEVICE(vend, dev, cfg) \ .vendor = (vend), \ diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index 22afc14c3da6..f6b00505a69f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -709,6 +709,7 @@ enum rtl_var_map { RTL_IMR_RXFOVW, /*Receive FIFO Overflow */ RTL_IMR_RDU, /*Receive Descriptor Unavailable */ RTL_IMR_ATIMEND, /*For 92C,ATIM Window End Interrupt */ + RTL_IMR_H2CDOK, /*H2C Queue DMA OK Interrupt */ RTL_IMR_BDOK, /*Beacon Queue DMA OK Interrup */ RTL_IMR_HIGHDOK, /*High Queue DMA OK Interrupt */ RTL_IMR_COMDOK, /*Command Queue DMA OK Interrupt*/ @@ -2144,6 +2145,9 @@ struct rtl_hal_ops { void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc, bool firstseg, bool lastseg, struct sk_buff *skb); + void (*fill_tx_special_desc)(struct ieee80211_hw *hw, + u8 *pdesc, u8 *pbd_desc, + struct sk_buff *skb, u8 hw_queue); bool (*query_rx_desc) (struct ieee80211_hw *hw, struct rtl_stats *stats, struct ieee80211_rx_status *rx_status,