linux/drivers/staging/ccree/ssi_ivgen.h
<<
>>
Prefs
   1/*
   2 * Copyright (C) 2012-2017 ARM Limited or its affiliates.
   3 *
   4 * This program is free software; you can redistribute it and/or modify
   5 * it under the terms of the GNU General Public License version 2 as
   6 * published by the Free Software Foundation.
   7 *
   8 * This program is distributed in the hope that it will be useful,
   9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11 * GNU General Public License for more details.
  12 *
  13 * You should have received a copy of the GNU General Public License
  14 * along with this program; if not, see <http://www.gnu.org/licenses/>.
  15 */
  16
  17#ifndef __SSI_IVGEN_H__
  18#define __SSI_IVGEN_H__
  19
  20#include "cc_hw_queue_defs.h"
  21
  22#define SSI_IVPOOL_SEQ_LEN 8
  23
  24/*!
  25 * Allocates iv-pool and maps resources.
  26 * This function generates the first IV pool.
  27 *
  28 * \param drvdata Driver's private context
  29 *
  30 * \return int Zero for success, negative value otherwise.
  31 */
  32int ssi_ivgen_init(struct ssi_drvdata *drvdata);
  33
  34/*!
  35 * Free iv-pool and ivgen context.
  36 *
  37 * \param drvdata
  38 */
  39void ssi_ivgen_fini(struct ssi_drvdata *drvdata);
  40
  41/*!
  42 * Generates the initial pool in SRAM.
  43 * This function should be invoked when resuming DX driver.
  44 *
  45 * \param drvdata
  46 *
  47 * \return int Zero for success, negative value otherwise.
  48 */
  49int ssi_ivgen_init_sram_pool(struct ssi_drvdata *drvdata);
  50
  51/*!
  52 * Acquires 16 Bytes IV from the iv-pool
  53 *
  54 * \param drvdata Driver private context
  55 * \param iv_out_dma Array of physical IV out addresses
  56 * \param iv_out_dma_len Length of iv_out_dma array (additional elements of iv_out_dma array are ignore)
  57 * \param iv_out_size May be 8 or 16 bytes long
  58 * \param iv_seq IN/OUT array to the descriptors sequence
  59 * \param iv_seq_len IN/OUT pointer to the sequence length
  60 *
  61 * \return int Zero for success, negative value otherwise.
  62 */
  63int ssi_ivgen_getiv(
  64        struct ssi_drvdata *drvdata,
  65        dma_addr_t iv_out_dma[],
  66        unsigned int iv_out_dma_len,
  67        unsigned int iv_out_size,
  68        struct cc_hw_desc iv_seq[],
  69        unsigned int *iv_seq_len);
  70
  71#endif /*__SSI_IVGEN_H__*/
  72