Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
nx842.h File Reference

Go to the source code of this file.

Functions

int nx842_get_workmem_size (void)
 
int nx842_get_workmem_size_aligned (void)
 
int nx842_compress (const unsigned char *in, unsigned int in_len, unsigned char *out, unsigned int *out_len, void *wrkmem)
 
int nx842_decompress (const unsigned char *in, unsigned int in_len, unsigned char *out, unsigned int *out_len, void *wrkmem)
 

Function Documentation

int nx842_compress ( const unsigned char in,
unsigned int  inlen,
unsigned char out,
unsigned int outlen,
void wmem 
)

nx842_compress - Compress data using the 842 algorithm

Compression provide by the NX842 coprocessor on IBM Power systems. The input buffer is compressed and the result is stored in the provided output buffer.

Upon return from this function contains the length of the compressed data. If there is an error then will be 0 and an error will be specified by the return code from this function.

: Pointer to input buffer, must be page aligned : Length of input buffer, must be PAGE_SIZE : Pointer to output buffer : Length of output buffer : ptr to buffer for working memory, size determined by nx842_get_workmem_size()

Returns: 0 Success, output of length stored in the buffer at -ENOMEM Unable to allocate internal buffers -ENOSPC Output buffer is to small -EMSGSIZE XXX Difficult to describe this limitation -EIO Internal error -ENODEV Hardware unavailable

Definition at line 320 of file nx-842.c.

int nx842_decompress ( const unsigned char in,
unsigned int  inlen,
unsigned char out,
unsigned int outlen,
void wmem 
)

nx842_decompress - Decompress data using the 842 algorithm

Decompression provide by the NX842 coprocessor on IBM Power systems. The input buffer is decompressed and the result is stored in the provided output buffer. The size allocated to the output buffer is provided by the caller of this function in . Upon return from this function contains the length of the decompressed data. If there is an error then will be 0 and an error will be specified by the return code from this function.

: Pointer to input buffer, will use bounce buffer if not 128 byte aligned : Length of input buffer : Pointer to output buffer, must be page aligned : Length of output buffer, must be PAGE_SIZE : ptr to buffer for working memory, size determined by nx842_get_workmem_size()

Returns: 0 Success, output of length stored in the buffer at -ENODEV Hardware decompression device is unavailable -ENOMEM Unable to allocate internal buffers -ENOSPC Output buffer is to small -EINVAL Bad input data encountered when attempting decompress -EIO Internal error

Definition at line 520 of file nx-842.c.

int nx842_get_workmem_size ( void  )

Definition at line 231 of file nx-842.c.

int nx842_get_workmem_size_aligned ( void  )

Definition at line 237 of file nx-842.c.