From patchwork Thu Jul 30 12:11:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rameshwar Prasad Sahu X-Patchwork-Id: 6902241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 22951C05AC for ; Thu, 30 Jul 2015 12:14:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45D442058E for ; Thu, 30 Jul 2015 12:14:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 692092058C for ; Thu, 30 Jul 2015 12:14:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZKmhM-0000eT-Ty; Thu, 30 Jul 2015 12:12:32 +0000 Received: from [192.195.68.30] (helo=denmail01.amcc.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZKmh9-0000bd-Gk for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2015 12:12:19 +0000 Received: from apm.com (pnqlwv041.amcc.com [10.48.19.141]) by denmail01.amcc.com (8.13.8/8.13.8) with ESMTP id t6UCBrxY019503; Thu, 30 Jul 2015 06:11:54 -0600 Received: (from rsahu@localhost) by apm.com (8.13.8/8.13.8/Submit) id t6UCBr8D003140; Thu, 30 Jul 2015 17:41:53 +0530 From: Rameshwar Prasad Sahu To: vinod.koul@intel.com, dan.j.williams@intel.com, herbert@gondor.apana.org.au, davem@davemloft.net Subject: [PATCH v1 1/4] dmaengine: Add support for new feature CRC32C Date: Thu, 30 Jul 2015 17:41:05 +0530 Message-Id: <1438258268-3099-2-git-send-email-rsahu@apm.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1438258268-3099-1-git-send-email-rsahu@apm.com> References: <1438258268-3099-1-git-send-email-rsahu@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150730_051219_647162_D9973A96 X-CRM114-Status: UNSURE ( 8.48 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.1 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, arnd@arndb.de, jcm@redhat.com, Rameshwar Prasad Sahu , patches@apm.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support for new feature CRC32C calculation in dmaengine framework. Signed-of-by: Rameshwar Prasad Sahu --- drivers/dma/dmaengine.c | 2 ++ include/linux/dmaengine.h | 5 +++++ 2 files changed, 7 insertions(+) -- 1.8.2.1 diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 4a4cce1..55ba799 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -853,6 +853,8 @@ int dma_async_device_register(struct dma_device *device) !device->device_prep_dma_cyclic); BUG_ON(dma_has_cap(DMA_INTERLEAVE, device->cap_mask) && !device->device_prep_interleaved_dma); + BUG_ON(dma_has_cap(DMA_CRC32C, device->cap_mask) && + !device->device_prep_dma_crc32c); BUG_ON(!device->device_tx_status); BUG_ON(!device->device_issue_pending); diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index e2f5eb4..9da70b6 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -73,6 +73,7 @@ enum dma_transaction_type { DMA_SLAVE, DMA_CYCLIC, DMA_INTERLEAVE, + DMA_CRC32C, /* last transaction type for creation of the capabilities mask */ DMA_TX_TYPE_END, }; @@ -622,6 +623,7 @@ struct dma_tx_state { * The function takes a buffer of size buf_len. The callback function will * be called after period_len bytes have been transferred. * @device_prep_interleaved_dma: Transfer expression in a generic way. + * @device_prep_dma_crc32c: prepares a crc32c operation * @device_config: Pushes a new configuration to a channel, return 0 or an error * code * @device_pause: Pauses any transfer happening on a channel. Returns @@ -701,6 +703,9 @@ struct dma_device { struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( struct dma_chan *chan, struct dma_interleaved_template *xt, unsigned long flags); + struct dma_async_tx_descriptor *(*device_prep_dma_crc32c)( + struct dma_chan *chan, struct scatterlist *src_sg, size_t len, + unsigned int seed, u8 *result, unsigned long flags); int (*device_config)(struct dma_chan *chan, struct dma_slave_config *config);