Received: by 2002:a17:90a:3541:0:0:0:0 with SMTP id q59csp361269pjb; Tue, 9 Jun 2020 00:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIQzXA2gRET2WcVEdCNdfVIYJ526COAPPCj+LGKOj/GQ7NMyaI3PBX9YkudwvZ3kY/rlcm X-Received: by 2002:a17:906:d105:: with SMTP id b5mr9148599ejz.375.1591686665199; Tue, 09 Jun 2020 00:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591686665; cv=none; d=google.com; s=arc-20160816; b=gOkKq++ormUJt+uIuDHKhxdG1XRWfuVHUss0mo6mS694Zh0SWtA7rL/evH3cmx3C1c oaFSFUorlV7GYkqhuqbHovquXs4x2Su03x8zQ+lR6e+t9AeoOlaRpn09HP8Wuy75WGy9 PtATHGag172KT3E08qOE+LeiREe3C3xLd/8rcoanJluBDk6LHZ9FN6c0PTjJNylRt2if iRNZhtuUMuXLotI2Z1cFjPFbDvWErCbHDnMnR70dPfAwbCR7GoCHUV6lHlBEZi4O+0UG KzvNhW/a7rJVnTeWKubOjYYmLxcZCkvs94g6yMYrpqlBnG+BVe+xMstrjRiLL8BzXhMk oTCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=A9Ho8otvYf7kSdEyzjj0hnww9Z78Ls6o++NXdJ56e/M=; b=CHu8a2Aj+5vOUQ/aGS553Fb39rowbwMIN4NETPMxk4fNi6R3+xaGWd4y2Yx7ZiyFta rM9ZdcFFTK//kaOvGb1UaQZ5zrAIJyUz0NfTnrjQ6KLRO/YOWrSBlJyF42dzkqogv59M v8zMK2D/XyDA0vy1zFV7fz27aLSOj/FYPsEGhSuS8kWRiJKHJtMLryhmKrELmqvweX+V 61JwxE9X7sFaEEtcoL5KtNbUeYGDVSAIyM2klyaLqI9Itc95dwGSQu52vSYyPWIQxI5V oeayeV/iIGu3VduNaChrtINHGxv6S1vSA+Cj++l1dsHpjLehrFDzrayDOCmAt6+ImxJw 7dhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TT1dKXxu; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si10614096ejr.561.2020.06.09.00.10.29; Tue, 09 Jun 2020 00:11:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TT1dKXxu; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725996AbgFIHKU (ORCPT + 99 others); Tue, 9 Jun 2020 03:10:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbgFIHKT (ORCPT ); Tue, 9 Jun 2020 03:10:19 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60B7BC05BD43 for ; Tue, 9 Jun 2020 00:10:19 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id c17so23639075lji.11 for ; Tue, 09 Jun 2020 00:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A9Ho8otvYf7kSdEyzjj0hnww9Z78Ls6o++NXdJ56e/M=; b=TT1dKXxu7EqWLsruajQ2DHtxOZbUV/4VwvHFmSL2TrQXWIL6/kUWCmJtBo6iAgAtvS gafhmLw6opUNv7niA3MlbuqpzKIe5THLr6gYBwOoy72g47kBLLKuNJkiNzgSm3r+KsxK fUSO86qnPRgvdsYEYCcsURK2YVcxnm6/oZ6DOF6GLF8fBeLCVqhlHZIcvEu8xneOhT/3 y11LOZN/4CkJXnKKo7N10Od/iq32yBH8lWMErAAigs6CLM+OR8kP55ksK/90KqasN4dM ZpT3L0kjH4dKMo/RxueDRvyiCa5QkjT1eY+CMVKimsEaG8OOtrUS1mX1Agg4o2Diva8h fJIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A9Ho8otvYf7kSdEyzjj0hnww9Z78Ls6o++NXdJ56e/M=; b=cp3+8YLoiogWvVJZnwZ9YTO//zqv3sT1ELQi7NgtJYXtT/MPKOev8NsaMgY/OKFan5 grYVPvxKPxugVfTGX8YK7EE5+DhqoI19NKR8C3VLIJKpAt9CjZzTiU2WyCu8EpHbYLE0 3MD6xgUXsyxGBuERNY5YxwDbeP2K3JmQeNf/lRf+/kqbiYoyRzWvhDPCnSjDH+WWNPpI P4jSwjSBzjB5rHMTe5giDD0+qZVWd0/2YGVGCspl7SATbSF1oxS3ie9gr9TwdYaR3RWs CPx+vnOvDJRRWDLC4TJHWI5IhnItNFjdVummq1spLFY5jMPu4o1zVdyqPYb1SwkqLIx4 85xw== X-Gm-Message-State: AOAM531QzvUUkz75rYIgh6o1ASJAKjYm75TK4oaQJ3S96Lph6QgLokI5 U+LenscsOg0JqNxxpo5dM0QOyYGNULg8aaGX7VxB8g== X-Received: by 2002:a2e:908f:: with SMTP id l15mr8212442ljg.307.1591686617869; Tue, 09 Jun 2020 00:10:17 -0700 (PDT) MIME-Version: 1.0 References: <1591678993-11016-1-git-send-email-akolli@codeaurora.org> <1591678993-11016-8-git-send-email-akolli@codeaurora.org> In-Reply-To: <1591678993-11016-8-git-send-email-akolli@codeaurora.org> From: Julian Calaby Date: Tue, 9 Jun 2020 17:10:06 +1000 Message-ID: Subject: Re: [PATCH 7/8] ath11k: add ce services for IPQ6018 To: Anilkumar Kolli Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Anilkumar, On Tue, Jun 9, 2020 at 3:07 PM Anilkumar Kolli wrote: > > IPQ6018 does not support mac2, add a new ce service map. > > Signed-off-by: Anilkumar Kolli > --- > drivers/net/wireless/ath/ath11k/ahb.c | 122 ++++++++++++++++++++++++++++++++-- > 1 file changed, 117 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c > index b080ad8fab0a..25764f719db0 100644 > --- a/drivers/net/wireless/ath/ath11k/ahb.c > +++ b/drivers/net/wireless/ath/ath11k/ahb.c > @@ -647,8 +749,15 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) > > cfg->tgt_ce_len = ARRAY_SIZE(target_ce_config_wlan) - 1; > cfg->tgt_ce = target_ce_config_wlan; > - cfg->svc_to_ce_map_len = ARRAY_SIZE(target_service_to_ce_map_wlan); > - cfg->svc_to_ce_map = target_service_to_ce_map_wlan; > + if (ab->hw_params.dev_id == ATH11K_HW_IPQ6018) { > + cfg->svc_to_ce_map_len = > + ARRAY_SIZE(target_service_to_ce_map_wlan_ipq6018); > + cfg->svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018; > + } else { > + cfg->svc_to_ce_map_len = > + ARRAY_SIZE(target_service_to_ce_map_wlan_ipq8074); > + cfg->svc_to_ce_map = target_service_to_ce_map_wlan_ipq8074; > + } You could just have a pointer to this array in the "hw_params" structure which would reduce this to something like: cfg->svc_to_ce_map_len = ARRAY_SIZE(ab->hw_params.service_to_ce_map); cfg->svc_to_ce_map = ab->hw_params.service_to_ce_map; and make adding future hardware easier. > } > > static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab) > @@ -856,8 +965,11 @@ static int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_id > bool ul_set = false, dl_set = false; > int i; > > - for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan); i++) { > - entry = &target_service_to_ce_map_wlan[i]; > + for (i = 0; i < ab->qmi.ce_cfg.svc_to_ce_map_len; i++) { Is this the same "svc_to_ce_map_len" as in the hunk above? If so the code below could just be: entry = &ab->qmi.ce_cfg.svc_to_ce_map[i]; > + if (ab->hw_params.dev_id == ATH11K_HW_IPQ6018) > + entry = &target_service_to_ce_map_wlan_ipq6018[i]; > + else > + entry = &target_service_to_ce_map_wlan_ipq8074[i]; > > if (__le32_to_cpu(entry->service_id) != service_id) > continue; > -- > 2.7.4 > Thanks, -- Julian Calaby Email: julian.calaby@gmail.com Profile: http://www.google.com/profiles/julian.calaby/