• Tom Zanussi's avatar
    crypto: iaa - Add support for deflate-iaa compression algorithm · 2ec6761d
    Tom Zanussi authored
    This patch registers the deflate-iaa deflate compression algorithm and
    hooks it up to the IAA hardware using the 'fixed' compression mode
    introduced in the previous patch.
    
    Because the IAA hardware has a 4k history-window limitation, only
    buffers <= 4k, or that have been compressed using a <= 4k history
    window, are technically compliant with the deflate spec, which allows
    for a window of up to 32k.  Because of this limitation, the IAA fixed
    mode deflate algorithm is given its own algorithm name, 'deflate-iaa'.
    
    With this change, the deflate-iaa crypto algorithm is registered and
    operational, and compression and decompression operations are fully
    enabled following the successful binding of the first IAA workqueue
    to the iaa_crypto sub-driver.
    
    when there are no IAA workqueues bound to the driver, the IAA crypto
    algorithm can be unregistered by removing the module.
    
    A new iaa_crypto 'verify_compress' driver attribute is also added,
    allowing the user to toggle compression verification.  If set, each
    compress will be internally decompressed and the contents verified,
    returning error codes if unsuccessful.  This can be toggled with 0/1:
    
      echo 0 > /sys/bus/dsa/drivers/crypto/verify_compress
    
    The default setting is '1' - verify all compresses.
    
    The verify_compress value setting at the time the algorithm is
    registered is captured in the algorithm's crypto_ctx and used for all
    compresses when using the algorithm.
    
    [ Based on work originally by George Powley, Jing Lin and Kyung Min
    Park ]
    Signed-off-by: default avatarTom Zanussi <tom.zanussi@linux.intel.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    2ec6761d
iaa_crypto.h 3.5 KB