From patchwork Wed Oct 3 15:07:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 10625019 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 7ADB6112B for ; Wed, 3 Oct 2018 15:14:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6231528DBE for ; Wed, 3 Oct 2018 15:14:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5634628E17; Wed, 3 Oct 2018 15:14:03 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E795228DBE for ; Wed, 3 Oct 2018 15:14:02 +0000 (UTC) Received: from localhost ([::1]:49253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7iqg-0002aO-7N for patchwork-qemu-devel@patchwork.kernel.org; Wed, 03 Oct 2018 11:14:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7inS-0006SE-Dh for qemu-devel@nongnu.org; Wed, 03 Oct 2018 11:10:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7inO-0004oZ-Ae for qemu-devel@nongnu.org; Wed, 03 Oct 2018 11:10:42 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:42126) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g7inO-0004oM-3c; Wed, 03 Oct 2018 11:10:38 -0400 Received: by mail-pf1-x444.google.com with SMTP id f26-v6so1681282pfn.9; Wed, 03 Oct 2018 08:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=k1ktulAz8wi5AxnIcSy10JK17qd5NlNNQsw4wD+bjAI=; b=uz0Q6UJQuE6nTiLWzpwodlLzXDYVjnn4j5KJ8kvkl0ruGny4L+LxvAYOKby4WE7k67 3s0KAVnwVXyGQr8rK/TF38AT2MkGrn6JTLiucJUK3/ECuunllX2iZqWbV9+SkdFSsfoS eq4CaI772fzc8Up+n25aTMr+thfKjz3GpdWBeCzHuNkPuGsRcV85tNxgun8x77Lzo6yf BK6qYWKugBF1MYyencxYVDKxsR6GpQEsRlf9PcecPREVA2K/slnZDm3c7C7bxtp1wcjr GkrIPW3UQumcruVwuflxy97Q4ubHR7mtCXQsSCYMnfqU8bWKpwRwyIYrcucZuyS2mpX9 LBhw== 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:in-reply-to :references; bh=k1ktulAz8wi5AxnIcSy10JK17qd5NlNNQsw4wD+bjAI=; b=QoI6X+U8VZPDig2WFopnuTNgeQkFHVl5T/kBSupbmRj7Laqv7fijl5NkaSzJF2EB1Q zKAxJio6fDTJzEr7nt99WB9jehBX6pr0ArNYkTr6hSWkC72rMy2cgPAO6UwpH6YDsFg2 Ksfs4PYd4aS2dPtwHtyMsqa+uJubl2e86aPDiNQBLjVghKE3MCOLiibkiKGgUY4O5Vhk UL3VyL4nQRHtXBEK87lNdmxc7uj6IbDnNi9Unoecp/tfxGM4wlIRi+AJlj1k+pOEXKOW ZUBkAmDW56OaBqHoaj9rnfTztDYzrvVdiGUlEn/NvhIs8TAguoEBoy1fdXAD3nDiwW5U ykjA== X-Gm-Message-State: ABuFfohfIm2t5CVIiBxeNVMAZgYjs0hQVgLX4fVAqNg2Ahu6o8ut84M4 Xhqc6axvqhXviLgRLM1yLqxlWR2mfRY= X-Google-Smtp-Source: ACcGV63dsp4hRbbIPy58RFSmQheprMDHmjngkDqr/4ehSnQ1zqkj1gCcrX8CIuChPWUj9Jx3jRA/Hg== X-Received: by 2002:aa7:8281:: with SMTP id s1-v6mr2044397pfm.63.1538579436675; Wed, 03 Oct 2018 08:10:36 -0700 (PDT) Received: from localhost ([149.199.62.254]) by smtp.gmail.com with ESMTPSA id o2-v6sm6118684pfj.57.2018.10.03.08.10.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 08:10:35 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 3 Oct 2018 22:07:38 +0700 Message-Id: <1538579266-8389-5-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538579266-8389-1-git-send-email-edgar.iglesias@gmail.com> References: <1538579266-8389-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 Subject: [Qemu-devel] [PATCH v1 04/12] net: cadence_gem: Add macro with max number of descriptor words X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Add macro with max number of DMA descriptor words. No functional change. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- hw/net/cadence_gem.c | 4 ++-- include/hw/net/cadence_gem.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 31f3fe0..4d769b0 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1042,7 +1042,7 @@ static void gem_transmit_updatestats(CadenceGEMState *s, const uint8_t *packet, */ static void gem_transmit(CadenceGEMState *s) { - uint32_t desc[2]; + uint32_t desc[DESC_MAX_NUM_WORDS]; hwaddr packet_desc_addr; uint8_t tx_packet[2048]; uint8_t *p; @@ -1108,7 +1108,7 @@ static void gem_transmit(CadenceGEMState *s) /* Last descriptor for this packet; hand the whole thing off */ if (tx_desc_get_last(desc)) { - uint32_t desc_first[2]; + uint32_t desc_first[DESC_MAX_NUM_WORDS]; /* Modify the 1st descriptor of this packet to be owned by * the processor. diff --git a/include/hw/net/cadence_gem.h b/include/hw/net/cadence_gem.h index 633d564..b33ef65 100644 --- a/include/hw/net/cadence_gem.h +++ b/include/hw/net/cadence_gem.h @@ -32,6 +32,9 @@ #define CADENCE_GEM_MAXREG (0x00000800 / 4) /* Last valid GEM address */ +/* Max number of words in a DMA descriptor. */ +#define DESC_MAX_NUM_WORDS 2 + #define MAX_PRIORITY_QUEUES 8 #define MAX_TYPE1_SCREENERS 16 #define MAX_TYPE2_SCREENERS 16 @@ -74,7 +77,7 @@ typedef struct CadenceGEMState { uint8_t can_rx_state; /* Debug only */ - uint32_t rx_desc[MAX_PRIORITY_QUEUES][2]; + uint32_t rx_desc[MAX_PRIORITY_QUEUES][DESC_MAX_NUM_WORDS]; bool sar_active[4]; } CadenceGEMState;