Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753520AbbDGRfU (ORCPT ); Tue, 7 Apr 2015 13:35:20 -0400 Received: from mail-ie0-f173.google.com ([209.85.223.173]:36622 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753450AbbDGRfL (ORCPT ); Tue, 7 Apr 2015 13:35:11 -0400 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/11] crypto: add software 842 decompression Date: Tue, 7 Apr 2015 13:34:22 -0400 Message-Id: <1428428070-17803-4-git-send-email-ddstreet@ieee.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1428428070-17803-1-git-send-email-ddstreet@ieee.org> References: <1428428070-17803-1-git-send-email-ddstreet@ieee.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 14108 Lines: 508 Add an 842-format software decompression function. Update the MAINTAINERS 842 section to include the new files. This decompression function can decompress any standard-format 842 compressed data. The 842 compressed format is explained in the header comments. This general-use decompression function is required by later patches that update the crypto 842 driver to fall back to software 842 decompression if the NX-842 hardware fails and/or returns an error. Signed-off-by: Dan Streetman --- MAINTAINERS | 2 + include/linux/sw842.h | 7 + lib/842/842_decompress.c | 413 +++++++++++++++++++++++++++++++++++++++++++++++ lib/842/Makefile | 1 + lib/Kconfig | 3 + lib/Makefile | 1 + 6 files changed, 427 insertions(+) create mode 100644 include/linux/sw842.h create mode 100644 lib/842/842_decompress.c create mode 100644 lib/842/Makefile diff --git a/MAINTAINERS b/MAINTAINERS index efbcb50..3dc973a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4836,6 +4836,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..aa8d86e --- /dev/null +++ b/include/linux/sw842.h @@ -0,0 +1,7 @@ +#ifndef __SW842_H__ +#define __SW842_H__ + +int sw842_decompress(const unsigned char *src, int srclen, + unsigned char *dst, int *destlen); + +#endif diff --git a/lib/842/842_decompress.c b/lib/842/842_decompress.c new file mode 100644 index 0000000..9fc0ffc --- /dev/null +++ b/lib/842/842_decompress.c @@ -0,0 +1,413 @@ +/* + * 842 Decompressor + * + * Copyright (C) 2015 Dan Streetman, IBM Corp + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * The 842 compressed format is made up of multiple blocks, each of + * which have the format: + * + *