1640035a2SMahipal Challa /***********************license start************************************ 2640035a2SMahipal Challa * Copyright (c) 2003-2017 Cavium, Inc. 3640035a2SMahipal Challa * All rights reserved. 4640035a2SMahipal Challa * 5640035a2SMahipal Challa * License: one of 'Cavium License' or 'GNU General Public License Version 2' 6640035a2SMahipal Challa * 7640035a2SMahipal Challa * This file is provided under the terms of the Cavium License (see below) 8640035a2SMahipal Challa * or under the terms of GNU General Public License, Version 2, as 9640035a2SMahipal Challa * published by the Free Software Foundation. When using or redistributing 10640035a2SMahipal Challa * this file, you may do so under either license. 11640035a2SMahipal Challa * 12640035a2SMahipal Challa * Cavium License: Redistribution and use in source and binary forms, with 13640035a2SMahipal Challa * or without modification, are permitted provided that the following 14640035a2SMahipal Challa * conditions are met: 15640035a2SMahipal Challa * 16640035a2SMahipal Challa * * Redistributions of source code must retain the above copyright 17640035a2SMahipal Challa * notice, this list of conditions and the following disclaimer. 18640035a2SMahipal Challa * 19640035a2SMahipal Challa * * Redistributions in binary form must reproduce the above 20640035a2SMahipal Challa * copyright notice, this list of conditions and the following 21640035a2SMahipal Challa * disclaimer in the documentation and/or other materials provided 22640035a2SMahipal Challa * with the distribution. 23640035a2SMahipal Challa * 24640035a2SMahipal Challa * * Neither the name of Cavium Inc. nor the names of its contributors may be 25640035a2SMahipal Challa * used to endorse or promote products derived from this software without 26640035a2SMahipal Challa * specific prior written permission. 27640035a2SMahipal Challa * 28640035a2SMahipal Challa * This Software, including technical data, may be subject to U.S. export 29640035a2SMahipal Challa * control laws, including the U.S. Export Administration Act and its 30640035a2SMahipal Challa * associated regulations, and may be subject to export or import 31640035a2SMahipal Challa * regulations in other countries. 32640035a2SMahipal Challa * 33640035a2SMahipal Challa * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" 34640035a2SMahipal Challa * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS 35640035a2SMahipal Challa * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH 36640035a2SMahipal Challa * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY 37640035a2SMahipal Challa * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT 38640035a2SMahipal Challa * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) 39640035a2SMahipal Challa * WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A 40640035a2SMahipal Challa * PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET 41640035a2SMahipal Challa * ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE 42640035a2SMahipal Challa * ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES 43640035a2SMahipal Challa * WITH YOU. 44640035a2SMahipal Challa ***********************license end**************************************/ 45640035a2SMahipal Challa 46640035a2SMahipal Challa #ifndef __ZIP_MEM_H__ 47640035a2SMahipal Challa #define __ZIP_MEM_H__ 48640035a2SMahipal Challa 49640035a2SMahipal Challa /** 50640035a2SMahipal Challa * zip_cmd_qbuf_free - Frees the cmd Queue buffer 51640035a2SMahipal Challa * @zip: Pointer to zip device structure 52640035a2SMahipal Challa * @q: Queue nmber to free buffer of 53640035a2SMahipal Challa */ 54640035a2SMahipal Challa void zip_cmd_qbuf_free(struct zip_device *zip, int q); 55640035a2SMahipal Challa 56640035a2SMahipal Challa /** 57640035a2SMahipal Challa * zip_cmd_qbuf_alloc - Allocates a Chunk/cmd buffer for ZIP Inst(cmd) Queue 58640035a2SMahipal Challa * @zip: Pointer to zip device structure 59640035a2SMahipal Challa * @q: Queue number to allocate bufffer to 60640035a2SMahipal Challa * Return: 0 if successful, 1 otherwise 61640035a2SMahipal Challa */ 62640035a2SMahipal Challa int zip_cmd_qbuf_alloc(struct zip_device *zip, int q); 63640035a2SMahipal Challa 64640035a2SMahipal Challa /** 65640035a2SMahipal Challa * zip_data_buf_alloc - Allocates memory for a data bufffer 66640035a2SMahipal Challa * @size: Size of the buffer to allocate 67640035a2SMahipal Challa * Returns: Pointer to the buffer allocated 68640035a2SMahipal Challa */ 69640035a2SMahipal Challa u8 *zip_data_buf_alloc(u64 size); 70640035a2SMahipal Challa 71640035a2SMahipal Challa /** 72640035a2SMahipal Challa * zip_data_buf_free - Frees the memory of a data buffer 73640035a2SMahipal Challa * @ptr: Pointer to the buffer 74640035a2SMahipal Challa * @size: Buffer size 75640035a2SMahipal Challa */ 76640035a2SMahipal Challa void zip_data_buf_free(u8 *ptr, u64 size); 77640035a2SMahipal Challa 78640035a2SMahipal Challa #endif 79