1*4882a593Smuzhiyun /***********************license start************************************ 2*4882a593Smuzhiyun * Copyright (c) 2003-2017 Cavium, Inc. 3*4882a593Smuzhiyun * All rights reserved. 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * License: one of 'Cavium License' or 'GNU General Public License Version 2' 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * This file is provided under the terms of the Cavium License (see below) 8*4882a593Smuzhiyun * or under the terms of GNU General Public License, Version 2, as 9*4882a593Smuzhiyun * published by the Free Software Foundation. When using or redistributing 10*4882a593Smuzhiyun * this file, you may do so under either license. 11*4882a593Smuzhiyun * 12*4882a593Smuzhiyun * Cavium License: Redistribution and use in source and binary forms, with 13*4882a593Smuzhiyun * or without modification, are permitted provided that the following 14*4882a593Smuzhiyun * conditions are met: 15*4882a593Smuzhiyun * 16*4882a593Smuzhiyun * * Redistributions of source code must retain the above copyright 17*4882a593Smuzhiyun * notice, this list of conditions and the following disclaimer. 18*4882a593Smuzhiyun * 19*4882a593Smuzhiyun * * Redistributions in binary form must reproduce the above 20*4882a593Smuzhiyun * copyright notice, this list of conditions and the following 21*4882a593Smuzhiyun * disclaimer in the documentation and/or other materials provided 22*4882a593Smuzhiyun * with the distribution. 23*4882a593Smuzhiyun * 24*4882a593Smuzhiyun * * Neither the name of Cavium Inc. nor the names of its contributors may be 25*4882a593Smuzhiyun * used to endorse or promote products derived from this software without 26*4882a593Smuzhiyun * specific prior written permission. 27*4882a593Smuzhiyun * 28*4882a593Smuzhiyun * This Software, including technical data, may be subject to U.S. export 29*4882a593Smuzhiyun * control laws, including the U.S. Export Administration Act and its 30*4882a593Smuzhiyun * associated regulations, and may be subject to export or import 31*4882a593Smuzhiyun * regulations in other countries. 32*4882a593Smuzhiyun * 33*4882a593Smuzhiyun * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" 34*4882a593Smuzhiyun * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS 35*4882a593Smuzhiyun * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH 36*4882a593Smuzhiyun * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY 37*4882a593Smuzhiyun * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT 38*4882a593Smuzhiyun * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) 39*4882a593Smuzhiyun * WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A 40*4882a593Smuzhiyun * PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET 41*4882a593Smuzhiyun * ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE 42*4882a593Smuzhiyun * ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES 43*4882a593Smuzhiyun * WITH YOU. 44*4882a593Smuzhiyun ***********************license end**************************************/ 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun #ifndef __ZIP_MEM_H__ 47*4882a593Smuzhiyun #define __ZIP_MEM_H__ 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun /** 50*4882a593Smuzhiyun * zip_cmd_qbuf_free - Frees the cmd Queue buffer 51*4882a593Smuzhiyun * @zip: Pointer to zip device structure 52*4882a593Smuzhiyun * @q: Queue nmber to free buffer of 53*4882a593Smuzhiyun */ 54*4882a593Smuzhiyun void zip_cmd_qbuf_free(struct zip_device *zip, int q); 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun /** 57*4882a593Smuzhiyun * zip_cmd_qbuf_alloc - Allocates a Chunk/cmd buffer for ZIP Inst(cmd) Queue 58*4882a593Smuzhiyun * @zip: Pointer to zip device structure 59*4882a593Smuzhiyun * @q: Queue number to allocate bufffer to 60*4882a593Smuzhiyun * Return: 0 if successful, 1 otherwise 61*4882a593Smuzhiyun */ 62*4882a593Smuzhiyun int zip_cmd_qbuf_alloc(struct zip_device *zip, int q); 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun /** 65*4882a593Smuzhiyun * zip_data_buf_alloc - Allocates memory for a data bufffer 66*4882a593Smuzhiyun * @size: Size of the buffer to allocate 67*4882a593Smuzhiyun * Returns: Pointer to the buffer allocated 68*4882a593Smuzhiyun */ 69*4882a593Smuzhiyun u8 *zip_data_buf_alloc(u64 size); 70*4882a593Smuzhiyun 71*4882a593Smuzhiyun /** 72*4882a593Smuzhiyun * zip_data_buf_free - Frees the memory of a data buffer 73*4882a593Smuzhiyun * @ptr: Pointer to the buffer 74*4882a593Smuzhiyun * @size: Buffer size 75*4882a593Smuzhiyun */ 76*4882a593Smuzhiyun void zip_data_buf_free(u8 *ptr, u64 size); 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun #endif 79