Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  Copyright (C) 2018 Chelsio Communications.  All rights reserved.
0004  */
0005 
0006 #ifndef __CUDBG_ZLIB_H__
0007 #define __CUDBG_ZLIB_H__
0008 
0009 #include <linux/zlib.h>
0010 
0011 #define CUDBG_ZLIB_COMPRESS_ID 17
0012 #define CUDBG_ZLIB_WIN_BITS 12
0013 #define CUDBG_ZLIB_MEM_LVL 4
0014 
0015 struct cudbg_compress_hdr {
0016     u32 compress_id;
0017     u64 decompress_size;
0018     u64 compress_size;
0019     u64 rsvd[32];
0020 };
0021 
0022 static inline int cudbg_get_workspace_size(void)
0023 {
0024     return zlib_deflate_workspacesize(CUDBG_ZLIB_WIN_BITS,
0025                       CUDBG_ZLIB_MEM_LVL);
0026 }
0027 
0028 int cudbg_compress_buff(struct cudbg_init *pdbg_init,
0029             struct cudbg_buffer *pin_buff,
0030             struct cudbg_buffer *pout_buff);
0031 #endif /* __CUDBG_ZLIB_H__ */