From patchwork Wed May 6 16:50:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Streetman X-Patchwork-Id: 6351411 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@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 CF33BBEEE1 for ; Wed, 6 May 2015 16:55:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5604020328 for ; Wed, 6 May 2015 16:55:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08DEE2034E for ; Wed, 6 May 2015 16:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbbEFQwr (ORCPT ); Wed, 6 May 2015 12:52:47 -0400 Received: from mail-ig0-f181.google.com ([209.85.213.181]:37737 "EHLO mail-ig0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752618AbbEFQwm (ORCPT ); Wed, 6 May 2015 12:52:42 -0400 Received: by igbsb11 with SMTP id sb11so91429igb.0; Wed, 06 May 2015 09:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=sA+7NkyaSyZLt7ZtIUXE7cmTXtwLyUyOp3OAURSOQ88=; b=bIbaufomhbg/mNwSzRNfh2R+cfkBASUwQn1+QI2hgWTx1aeN8olrSBW/qkNjKqh35O gUzDAnMkVRym8KnFeLHs0tDD2pDArKzsuu54FIeZNixjNtrNyRIgxxn0HY/xNX2i/8I2 DFclnddIreGEYcvhI0hNPYUCKfeoWMKXhiwexlX/D1fav0woHdRAlqnNIiskMVkAXchh Q1PcdqNhVj4+5HU4S4nznxc0W46lHSmWvu1pdGhtIIq5xvZ3DSv19RjjF8ToWFh1Xy1X PUNc/fcB0j5EejsFzXUUQPM1Yqh0NPJMWsGVOVyPZCU2hglk5NwRDCD7humKLyIt/RyR QJ/A== X-Received: by 10.42.187.65 with SMTP id cv1mr3585931icb.87.1430931161723; Wed, 06 May 2015 09:52:41 -0700 (PDT) Received: from toughbook.com (user-0c8ho8q.cable.mindspring.com. [24.136.225.26]) by mx.google.com with ESMTPSA id m9sm1143291igv.4.2015.05.06.09.52.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 May 2015 09:52:40 -0700 (PDT) From: Dan Streetman To: Herbert Xu , "David S. Miller" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Cc: Dan Streetman , Seth Jennings , Robert Jennings , Andrew Morton , Greg KH , linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/10] lib: add software 842 compression/decompression Date: Wed, 6 May 2015 12:50:59 -0400 Message-Id: <1430931066-4536-4-git-send-email-ddstreet@ieee.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430931066-4536-1-git-send-email-ddstreet@ieee.org> References: <1428428070-17803-1-git-send-email-ddstreet@ieee.org> <1430931066-4536-1-git-send-email-ddstreet@ieee.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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 Add 842-format software compression and decompression functions. Update the MAINTAINERS 842 section to include the new files. The 842 compression function can compress any input data into the 842 compression format. The 842 decompression function can decompress any standard-format 842 compressed data - specifically, either a compressed data buffer created by the 842 software compression function, or a compressed data buffer created by the 842 hardware compressor (located in PowerPC coprocessors). The 842 compressed data format is explained in the header comments. This is used in a later patch to provide a full software 842 compression and decompression crypto interface. Signed-off-by: Dan Streetman --- MAINTAINERS | 2 + include/linux/sw842.h | 12 + lib/842/842.h | 127 ++++++++++ lib/842/842_compress.c | 626 +++++++++++++++++++++++++++++++++++++++++++++++ lib/842/842_debugfs.h | 52 ++++ lib/842/842_decompress.c | 405 ++++++++++++++++++++++++++++++ lib/842/Makefile | 2 + lib/Kconfig | 6 + lib/Makefile | 2 + 9 files changed, 1234 insertions(+) create mode 100644 include/linux/sw842.h create mode 100644 lib/842/842.h create mode 100644 lib/842/842_compress.c create mode 100644 lib/842/842_debugfs.h create mode 100644 lib/842/842_decompress.c create mode 100644 lib/842/Makefile diff --git a/MAINTAINERS b/MAINTAINERS index 781e099..116af01 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4872,6 +4872,8 @@ M: Dan Streetman S: Supported F: drivers/crypto/nx/nx-842.c F: include/linux/nx842.h +F: include/linux/sw842.h +F: lib/842/ IBM Power Linux RAID adapter M: Brian King diff --git a/include/linux/sw842.h b/include/linux/sw842.h new file mode 100644 index 0000000..109ba04 --- /dev/null +++ b/include/linux/sw842.h @@ -0,0 +1,12 @@ +#ifndef __SW842_H__ +#define __SW842_H__ + +#define SW842_MEM_COMPRESS (0xf000) + +int sw842_compress(const u8 *src, unsigned int srclen, + u8 *dst, unsigned int *destlen, void *wmem); + +int sw842_decompress(const u8 *src, unsigned int srclen, + u8 *dst, unsigned int *destlen); + +#endif diff --git a/lib/842/842.h b/lib/842/842.h new file mode 100644 index 0000000..7c20003 --- /dev/null +++ b/lib/842/842.h @@ -0,0 +1,127 @@ + +#ifndef __842_H__ +#define __842_H__ + +/* The 842 compressed format is made up of multiple blocks, each of + * which have the format: + * + *