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: 978385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uz0Q6UJQ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42QKKR66f6z9vd1 for ; Thu, 4 Oct 2018 01:13:31 +1000 (AEST) Received: from localhost ([::1]:49245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7iq9-0001f4-Dh for incoming@patchwork.ozlabs.org; Wed, 03 Oct 2018 11:13:29 -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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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;