From patchwork Thu May 7 17:49:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Streetman X-Patchwork-Id: 6360331 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 7A0FEBEEE1 for ; Thu, 7 May 2015 17:52:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E543B203AD for ; Thu, 7 May 2015 17:52:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31B3020392 for ; Thu, 7 May 2015 17:52:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751705AbbEGRwA (ORCPT ); Thu, 7 May 2015 13:52:00 -0400 Received: from mail-ie0-f175.google.com ([209.85.223.175]:36158 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751675AbbEGRt5 (ORCPT ); Thu, 7 May 2015 13:49:57 -0400 Received: by iecnq11 with SMTP id nq11so45599730iec.3; Thu, 07 May 2015 10:49:56 -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=cFouQhv0Qo1TITd34779IHSNyUz0Fge7wJAb4KKEzwLWCCU46bVxh9Te2rGu2i8bYB YPwe6fRLQtUVCr+jF0Gsfs6lkXOdir+HFpyfQHtS3ljm3EczkU2YxRtHCakJrY+PFXJH IIwphY5L5ikUMiCekaYeWWroT8ieIt2hX8mdBzRaUZ23ho1S0ExnSjv4rTJvOmnfUkwv oUXGJcabyLALmfc4HTnLQoOsumrVfooy1cvUc7C7Y9Bi5hxaftqnioCXgFtMwU6mDgSh WTGcGfXXBlzo46cx/hJ2WfHZUwv/iSXQbhtCPRDb1vG2qTnBQx82f2yc0ZzZ0sF/9Oc/ lasg== X-Received: by 10.42.185.12 with SMTP id cm12mr116862icb.0.1431020996388; Thu, 07 May 2015 10:49:56 -0700 (PDT) Received: from toughbook.com (user-0c8ho8q.cable.mindspring.com. [24.136.225.26]) by mx.google.com with ESMTPSA id k74sm1725971iok.30.2015.05.07.10.49.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 10:49:55 -0700 (PDT) From: Dan Streetman To: Herbert Xu , "David S. Miller" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Cc: Seth Jennings , Robert Jennings , Andrew Morton , Greg KH , linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Dan Streetman Subject: [PATCH 03/10] lib: add software 842 compression/decompression Date: Thu, 7 May 2015 13:49:14 -0400 Message-Id: <1431020961-22285-4-git-send-email-ddstreet@ieee.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1431020961-22285-1-git-send-email-ddstreet@ieee.org> References: <1431020961-22285-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: + * + *