From patchwork Mon May 27 13:19:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anilkumar Kolli X-Patchwork-Id: 10963041 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-2.web.codeaurora.org (Postfix) with ESMTP id 9D458933 for ; Mon, 27 May 2019 13:20:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A5DC289AB for ; Mon, 27 May 2019 13:20:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F08A289D1; Mon, 27 May 2019 13:20:35 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 A6928287E7 for ; Mon, 27 May 2019 13:20:14 +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:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wi2e2Fzse9XOs9TJJYIyKxUkGvrnALK6aQ+NgKfvzEg=; b=fb1Xds/cZ5yCaA WTcvJ8ngVs/3flWH5X0l8MDgi8pii3gmrX2Y+7sIVf1+AiYg69hIgZp4eX4Tf3XdNZX8w9A6mvbCS SNnEAXiKOBxDmTMD8Ds9PARA8L7gk7anIYclI1ZJJ9avUuiL/dgH9RDxi3069pjMOGhMRi4anYAkX I1c/0V2O7Xd1Ziamk6IW3UlgM7SmJHQ9A59CCAVrkrUVxtA8/f8R/haGKm+OOnprEcqhwxTCO7Ik0 jMSOfkT6qS1LcCxrVlqfXWxMMDkTLtOv3VwKl6X6QHnhG/karJy+PZrZLX4VwCiXZPySe819V/lZ/ 3dPPgctFlChnA0ny9EXw==; 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 1hVFXn-000170-R4; Mon, 27 May 2019 13:20:03 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVFXl-0000pE-A9 for ath11k@lists.infradead.org; Mon, 27 May 2019 13:20:02 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 01FAA6034D; Mon, 27 May 2019 13:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1558963201; bh=pjr87fNKHNuGqQaX1sfVfebtxfW3lEvU0ikvWqOjNmE=; h=From:To:Cc:Subject:Date:From; b=UFTWfiZ94HDf33CK3OsiVQ8Fib6yz09abDowzS+fDtkT1fs1md0AALDrL/BUhUzun 3354AhvHCieU8z+Yuggp4zOYZFruC36euDaJBDtvdLkm+KyD6jY2pEO0f/BgSsFPQz EA5mdZfeDlHUxp+re24UKGmk+llJmES3bgYPUFn0= Received: from localhost (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: akolli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BFAFF602FA; Mon, 27 May 2019 13:19:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1558963200; bh=pjr87fNKHNuGqQaX1sfVfebtxfW3lEvU0ikvWqOjNmE=; h=From:To:Cc:Subject:Date:From; b=oCFoZhkni4HqShExYsWpTcxorojddmvFziJ59l8gUpUSaxDfBbvz+S6Ai3IwYtuCZ O4OkWro1V3MpusRzdPdqK8UzB7wjJ/dW3goqxNV9/Z3bD0GNK5NWn3XWZSnVBGAPcf 4jIXmQhifcBxk0NUEEKv4/1sHLyk9hoaJtad1wwA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BFAFF602FA Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=akolli@codeaurora.org From: Anilkumar Kolli To: ath11k@lists.infradead.org Subject: [PATCH] ath11k: add CE specific callbacks Date: Mon, 27 May 2019 18:49:50 +0530 Message-Id: <1558963190-30814-1-git-send-email-akolli@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190527_062001_386806_77A2A781 X-CRM114-Status: GOOD ( 12.17 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP CE5 is used for pktlog and other HTT messages. CE5 does not have HTC header, add separate callbacks to handle this. Signed-off-by: Anilkumar Kolli --- drivers/net/wireless/ath/ath11k/ce.c | 17 ++++++++++++----- drivers/net/wireless/ath/ath11k/ce.h | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/ath/ath11k/ce.c index e66e5308def3..acae8b8d9ae9 100644 --- a/drivers/net/wireless/ath/ath11k/ce.c +++ b/drivers/net/wireless/ath/ath11k/ce.c @@ -3,7 +3,7 @@ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. */ -#include "core.h" +#include "dp_rx.h" #include "debug.h" static const struct ce_attr host_ce_config_wlan[] = { @@ -21,6 +21,7 @@ .src_nentries = 0, .src_sz_max = 2048, .dest_nentries = 512, + .recv_cb = ath11k_htc_rx_completion_handler, }, /* CE2: target->host WMI */ @@ -29,6 +30,7 @@ .src_nentries = 0, .src_sz_max = 2048, .dest_nentries = 512, + .recv_cb = ath11k_htc_rx_completion_handler, }, /* CE3: host->target WMI (mac0) */ @@ -53,6 +55,7 @@ .src_nentries = 0, .src_sz_max = 2048, .dest_nentries = 512, + .recv_cb = ath11k_dp_htt_htc_t2h_msg_handler, }, /* CE6: target autonomous hif_memcpy */ @@ -93,6 +96,7 @@ .src_nentries = 0, .src_sz_max = 2048, .dest_nentries = 512, + .recv_cb = ath11k_htc_rx_completion_handler, }, /* CE11: Not used */ @@ -283,8 +287,11 @@ static void ath11k_ce_recv_process_cb(struct ath11k_ce_pipe *pipe) __skb_queue_tail(&list, skb); } - while ((skb = __skb_dequeue(&list))) - ath11k_htc_rx_completion_handler(ab, skb); + while ((skb = __skb_dequeue(&list))) { + ath11k_dbg(ab, ATH11K_DBG_AHB, "rx ce pipe %d len %d\n", + pipe->pipe_num, skb->len); + pipe->recv_cb(ab, skb); + } ret = ath11k_ce_rx_post_pipe(pipe); if (ret && ret != -ENOSPC) { @@ -459,7 +466,7 @@ static int ath11k_ce_alloc_pipe(struct ath11k_base *sc, int ce_id) } if (attr->dest_nentries) { - pipe->recv_cb = ath11k_ce_recv_process_cb; + pipe->recv_cb = attr->recv_cb; nentries = roundup_pow_of_two(attr->dest_nentries); desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_DST); pipe->dest_ring = ath11k_ce_alloc_ring(sc, nentries, desc_sz); @@ -484,7 +491,7 @@ void ath11k_ce_per_engine_service(struct ath11k_base *ab, u16 ce_id) pipe->send_cb(pipe); if (pipe->recv_cb) - pipe->recv_cb(pipe); + ath11k_ce_recv_process_cb(pipe); } diff --git a/drivers/net/wireless/ath/ath11k/ce.h b/drivers/net/wireless/ath/ath11k/ce.h index 072a84296070..f9b5a0eae432 100644 --- a/drivers/net/wireless/ath/ath11k/ce.h +++ b/drivers/net/wireless/ath/ath11k/ce.h @@ -94,6 +94,8 @@ struct ce_attr { /* #entries in destination ring - Must be a power of 2 */ unsigned int dest_nentries; + + void (*recv_cb)(struct ath11k_base *, struct sk_buff *); }; #define CE_DESC_RING_ALIGN 8 @@ -148,7 +150,7 @@ struct ath11k_ce_pipe { unsigned int rx_buf_needed; void (*send_cb)(struct ath11k_ce_pipe *); - void (*recv_cb)(struct ath11k_ce_pipe *); + void (*recv_cb)(struct ath11k_base *, struct sk_buff *); struct tasklet_struct intr_tq; struct ath11k_ce_ring *src_ring;