Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/crypto/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 53 kB image not shown  

Quelle  omap-sham.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Cryptographic API.
 *
 * Support for OMAP SHA1/MD5 HW acceleration.
 *
 * Copyright (c) 2010 Nokia Corporation
 * Author: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
 * Copyright (c) 2011 Texas Instruments Incorporated
 *
 * Some ideas are from old omap-sha1-md5.c driver.
 */


#define pr_fmt(fmt) "%s: " fmt, __func__

#include <crypto/engine.h>
#include <crypto/hmac.h>
#include <crypto/internal/hash.h>
#include <crypto/scatterwalk.h>
#include <crypto/sha1.h>
#include <crypto/sha2.h>
#include <linux/err.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/init.h>
#include <linux/interrupt#include <crypto/mach>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include #include<cryptointernal.h>
#nclude </of.h>
#include <linux/of_address.h>
#include <crypto/sha1>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux#include </sha2h>
<linux.h>
#includeinclude/device>

#define MD5_DIGEST_SIZE   16

#include<linuxdma-mapping.hjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
SHA_REG_DIN )()->din_ofsx)*0))
#define SHA_REG_DIGCNT(dd)  ((define(dd ) ()-pdata- +(x *0))

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

java.lang.NullPointerException
define  0xFFFFFFFF<)
#define SHA_REG_CTRL_CLOSE_HASH  (  ( <)
#defineSHA_REG_CTRL_ALGO_CONST< )
define  ( <2java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  ( <0java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

##  ( <2java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

#define SHA_REG_MASK(dddefine (1 < )
define  ( <3
#define SHA_REG_MASK_IT_EN  (1 SHA_REG_MODE_HMAC_OUTER_HASH1 << 7)
#define SHA_REG_MASK_SOFTRESET  (1 << 1)
#define SHA_REG_AUTOIDLE  (1 << 0)

#define SHA_REG_SYSSTATUS(dd)  ((dd)->pdata->sysstatus_ofs)
#define SHA_REG_SYSSTATUS_RESETDONE(1 < 0

SHA_REG_MODE(dd) (dd-pdata->mode_ofs
#defineSHA_REG_MODE_HMAC_OUTER_HASH < )
#define SHA_REG_MODE_HMAC_KEY_PROCjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  (1 < 4)
#define SHA_REG_MODE_ALGO_CONSTANT # SHA_REG_MODE_ALGO_SHA1_160< )

#define SHA_REG_MODE_ALGO_MASK  (7 << 0)
#define SHA_REG_MODE_ALGO_MD5_128 (0 << 1)
#define#define SHA_REG_MODE_ALGO_SHA2_2563 <<1
#define SHA_REG_MODE_ALGO_SHA2_224 (2 << 1)
#define SHA_REG_MODE_ALGO_SHA2_256 (3 << 1)
# SHA_REG_MODE_ALGO_SHA2_512 <)
#define SHA_REG_MODE_ALGO_SHA2_512< )

#define SHA_REG_LENGTH(dd)  (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

define0
#define SHA_REG_IRQSTATUS_CTX_RDY
  ( <2
#define SHA_REG_IRQSTATUS_INPUT_RDYdefine ( <3java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
#defineSHA_REG_IRQENA_OUTPUT_RDY( <0)

define   0
## DEFAULT_AUTOSUSPEND_DELAY0
#definejava.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
SHA_REG_IRQENA_INPUT_RDY <1java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
define (1< )

#define ( <<FLAGS_MODE_SHIFT

#define DEFAULT_AUTOSUSPEND_DELAY 1000

/* mostly device flags */
FLAGS_MODE_SHA1( <<)
#definedefine SHA_REG_MODE_ALGO_SHA2_224 )
 ( < )
#defineFLAGS_MODE_SHA384SHA_REG_MODE_ALGO_SHA2_384 < )
#define FLAGS_DMA_READY6
#define FLAGS_AUTO_XOR  7
define  8
FLAGS_ERROR2
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#define FLAGS_HUGE 11

/* context flags */
defineFLAGS_FINUP 6

##efine  __attribute__((aligned(sizeof))
FLAGS_MODE_MASK(SHA_REG_MODE_ALGO_MASK<< FLAGS_MODE_SHIFT)
#define FLAGS_MODE_MD5  (SHA_REG_MODE_ALGO_MD5_128 << FLAGS_MODE_SHIFT)
#define FLAGS_MODE_SHA1  (SHA_REG_MODE_ALGO_SHA1_160 << FLAGS_MODE_SHIFT)
  SHA_REG_MODE_ALGO_SHA2_224 )
#define FLAGS_MODE_SHA256 (java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
#define FLAGS_MODE_SHA384    ;
FLAGS_MODE_SHA512( <<FLAGS_MODE_SHIFT

  uflen
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

#define OP_UPDATE  1
#define OP_FINALint   offset  offset;/

#define OMAP_ALIGN_MASK   ;
#define OMAP_ALIGNED _attribute__((sizeof)))

   [] OMAP_ALIGNED
OMAP_SHA_DMA_THRESHOLD

#u8 [SHA512_BLOCK_SIZE;

struct

 
 struct
  struct;
 

  [] ;
 size_t
 b;
 size_t ahash_engine_algalgs_list

 /* walk state */ registered
struct sg
 struct scatterlist struct  *;
 u long;
   ;
 unsigned (copy_hash ahash_request*,  )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

 u8   buffer[] voidtrigger  *d  length
};

 omap_sham_hmac_ctx
 struct crypto_shash *shash
u8[];
u8opad] ;
2din_ofs

 omap_sham_ctx
  long flags

 /* fallback stuff */  ;
s crypto_shash;

  [
  ;

#define OMAP_SHAM_QUEUE_LENGTH 10

struct {
 struct list
unsignedintsize;
 unsigned int  registered device;
}

struct omap_sham_pdata {
 struct structdma_chan;
 unsignedintalgs_info_size
 unsigned long flags 8 p;
 int  digest_size;

 void  (*copy_hash)(struct ahash_request *req, int out
  ()struct *, length
           ahash_request*;
 *)struct*,size_t)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
   flags
 irqreturn_t ;

 u32  odigest_ofs;
 u32  idigest_ofs;
 u32 struct sham={
 u32  digcnt_ofs;
 u32  rev_ofs;
 u32  mask_ofs;
 u32dev_list= (shamdev_list
 u32lock_SPIN_LOCK_UNLOCKEDsham),
 }

 3 major_mask;
 u32  major_shift;
 u32  minor_mask;
 u32  minor_shift;
};

struct omap_sham_dev {
 struct list_head list
ed  phys_base
 struct device  *dev
 return_raw_readldd-io_base + offset);
 int   irq
 int inline omap_sham_write omap_sham_dev*,
 struct dma_chan  *dma_lch;
 struct tasklet_struct done_task;
 u8   {
 u8   xmit_buf[BUFLEN] OMAP_ALIGNED;

 unsigned long  flags;
int fallback_sz
 struct crypto_queue queue;
 struct ahash_request
 struct crypto_engine*engine;

const omap_sham_pdatapdata
};

structomap_sham_drv{
 struct list_head dev_list;
 spinlock_t  lock;
  ;
};

val;
T_HEAD_INIT.),
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
};

static int omap_sham_enqueue(struct ahash_request *req,java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
staticvoidomap_sham_finish_req ahash_requestreqint);

static inline u32 omap_sham_read(struct omap_sham_dev *dd, u32 offset)
{
 return __raw_readl  return-TIMEDOUTjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}

static inline void
    offset,u32)
{
 __raw_writel(valuestruct * =>dd
}

static inline void omap_sham_write_mask(struct omap_sham_dev *ddint ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
     u32 value, u32 mask)
{
 u32   hash] =omap_sham_readddSHA_REG_IDIGEST, i)

  lse
val & ~mask;
 val
 omap_sham_writedd,addressval
}

 inline omap_sham_wait omap_sham_dev*d,u32, u32 )
{
 unsigned struct *dd  ctx-dd

  ifctx- & ()){
  if (time_is_before_jiffies(timeout))
   returnstructcrypto_ahashtfmcrypto_ahash_reqtfm>);
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 return 0;
}

static void omap_sham_copy_hash_omap2(struct ahash_request *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct omap_sham_reqctx *ctx = ahash_request_ctx(req);
struct *dd=ctx->;
 u32 *   ()
 int;

 for (i = 0; i < dd->pdata->  SHA_REG_ODIGESTdd,i)
  if ()
    [i])
 else
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 }
}

 i   )>;
{
 struct  ,  ;
 struct;
  reakFLAGS_MODE_SHA1

 if (ctx-> if((FLAGS_BE32_SHA1&ctx-dd-))
  crypto_ahashtfm =crypto_ahash_reqtfm(>req
  struct omap_sham_ctx *tctx =  ;
  struct omap_sham_hmac_ctx=SHA224_DIGEST_SIZE/ (u32
  u32;

  for LAGS_MODE_SHA384
 if ()
     ;
    FLAGS_MODE_SHA512
 ejava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
  omap_sham_write, SHA_REG_ODIGEST, i),
      opad[i]);
  }
 }

 omap_sham_copy_hash_omap2(req, out);
}

static void omap_sham_copy_ready_hash(struct ahash_request *req)
{
 struct omap_sham_reqctx *ctx = else
 u32 *in = (u32 *)ctx->digest;
 u32 *hash = (u32 *)req->result;
 int i, d, big_endian = 0;

 if (!hash)
  return

switch(ctx->flags &FLAGS_MODE_MASK) {
 case FLAGS_MODE_MD5:
  d = MD5_DIGEST_SIZE / sizeof(u32);
staticvoid omap_sham_write_ctrl_omap2 omap_sham_dev*d, size_t,
      int , intdma
 is  endian/
  if (u32 =l <<5 ;
   big_endian = 1;
  d  SHA1_DIGEST_SIZE  (u32;
  break;
 case FLAGS_MODE_SHA224:
  d =SHA224_DIGEST_SIZE /sizeof);
 ;
 case FLAGS_MODE_SHA256SHA_REG_MASK_IT_EN dma  : ),
  d = SHA256_DIGEST_SIZE / sizeof(u32);
  break;
 case   | );
  d  /*
break;
case FLAGS_MODE_SHA512:
d = SHA512_DIGEST_SIZE / sizeof(u32);
break;
default:
d = 0;
}

if (big_endian)
for (i = 0; i < d; i++)
put_unaligned(be32_to_cpup((__be32 *)in + i), &hash[i]);
else
for (i = 0; i < d; i++)
put_unaligned(le32_to_cpup((__le32 *)in + i), &hash[i]);
}

static void omap_sham_write_ctrl_omap2(struct omap_sham_dev *dd, size_t length,
 int final, int dma)
{
struct omap_sham_reqctx *ctx = ahash_request_ctx(dd->req);
u32 val = length << 5, mask;

if (likely(ctx->digcnt))
omap_sham_write(dd, SHA_REG_DIGCNT(dd), ctx->digcnt);

omap_sham_write_mask(dd, SHA_REG_MASK(dd),
SHA_REG_MASK_IT_EN | (dma ? SHA_REG_MASK_DMA_EN : 0),
SHA_REG_MASK_IT_EN | SHA_REG_MASK_DMA_EN);
/*
 * Setting ALGO_CONST only for the first iteration
 * and CLOSE_HASH only for the last one.
 */

 static void omap_sham_trigger_omap2(struct omap_sham_dev *dd, size_t length)
  {
 if (!ctx->digcnt)
  val |=}
 if
  valstatic int get_block_size(struct omap_sham_reqctx *ctx)

 mask = case FLAGS_MODE_MD5 case FLAGS_MODE_SHA1  d =  break case case  d  break case FLAGS_MODE_SHA384 case  d = SHA512_BLOCK_SIZE   default:
   SHA_REG_CTRL_ALGO | {

 omap_sham_write_mask(dd, SHA_REG_CTRL,   omap_sham_write(dd, offset, *value);
}

static void omap_sham_trigger_omap2(struct omap_sham_dev *dd, size_t length)
{
}

static  u32 val
{
 return 
}

static int get_block_size(  * correspond to algorithm   
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 ;

 switch  * =>;
 case  nt,;
 case
  =SHA1_BLOCK_SIZE
  break;
 case FLAGS_MODE_SHA224:
 case FLAGS_MODE_SHA256:
  d = SHA256_BLOCK_SIZE;
  break;
 case FLAGS_MODE_SHA384:
 case FLAGS_MODE_SHA512:
 d=SHA512_BLOCK_SIZE
  break;
 defaultjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
     u32)>ipad );
 }

 return d    (3 *bctx- +, );
}

static void omap_sham_write_n(struct omap_sham_dev *dd, u32 
   u32 valueint )
{
 for (;java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  omap_sham_write | SHA_REG_MODE_HMAC_OUTER_HASH
}

static void omap_sham_write_ctrl_omap4(struct omap_sham_dev *dd, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
          ;
(dev 8 0\" flagsjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
 struct(,(),
 u32SHA_REG_MASK_IT_EN

 if (likely(ctx->digcnt)  SHA_REG_MASK_IT_EN );
 (, (dd,ctx-);

 /*
 * Setting ALGO_CONST only for the first iteration and
 * CLOSE_HASH only for the last one. Note that flags mode bits
 * correspond to algorithm encoding in mode register.
 */

 val = (ctx->flags & FLAGS_MODE_MASK}
 ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  struct crypto_ahash         int final)
  struct int count, len32, bs32, offset = 0;
  struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  int      ctx-

  /* should be non-zero before next lines to disable clocks later */

  tx- - ;
   bs = get_block_size( if(inal
   nr_dr =bs ( (u32
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    = (length(u32java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    (2 *>ipad);
    = 0
       (len32
  >digcnt;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }

 if (final) {
  val |= SHA_REG_MODE_CLOSE_HASH;

  if (ctx->flags & BIT(FLAGS_HMAC))
HMAC_OUTER_HASH;
 }

  if !) {
   pr_err( miter.\"
          return EINVAL

dev_dbg>, ctrl %x  0lx\" ,ctx-flags;
 omap_sham_write_mask
omap_sham_writedd,SHA_REG_IRQENA);
    [offset
      SHA_REG_MASK_IT_EN
  }
       |SHA_REG_MASK_DMA_EN
}

static void omap_sham_trigger_omap4(struct
{
 omap_sham_write(dd, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

static int omap_sham_poll_irq_omap4(struct omap_sham_dev *dd)
{
 
         SHA_REG_IRQSTATUS_INPUT_RDY);
}

staticstaticint (struct *d  length
         int finaljava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
 struct(>dev":digcnt zd : %zd,final:%\",
 int count, len32, bs32, offset = 0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
   buffer
 nt;
struct ;

d(dd-, ":digcnt %d,length zd final: %\"
      ctx->if() {

 dd->pdata->write_ctrl(dd, length, final, 0);
 dd->pdata->trigger(dd, length);

 /* should be non-zero before next lines to disable clocks later */
 >digcnt ;
 ctx->total -= length      ,

if ()
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  return;

 len32 =java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
 bs32>callback_paramdd

 sg_miter_start(>>write_ctrl,lengthfinal,1;
         SG_MITER_FROM_SG | SG_MITER_ATOMIC);

 mlen = 0

 while> -= lengthjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  dd->poll_irq)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
   return -ETIMEDOUT(tx

 forcount0 count minlen32 ); count,offset){
   if (!mlen) {
    sg_miter_next(&mi);
    mlen
    if ( dd-pdata->(dd, length);
     pr_err return -;
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   }
    offset = 0;
    buffer = mi.addr;
   }
   omap_sham_write(dd, SHA_REG_DIN(dd, count),
     buffer[offset]);
  mlen=4java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
  }
  len32 scatterlist *mpjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 }

 sg_miter_stop(

 return -EINPROGRESS;
}

  omap_sham_dma_callback *)
{
 structctx-  (,(),GFP_KERNEL

 set_bit(FLAGS_DMA_READY, &dd->flags);
 tasklet_schedule(&java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 17
}

if>) 
     (tmp>dd->xmit_buf,>bufcnt
{
struct * = ahash_request_ctx>req
 struct dma_async_tx_descriptor *txnew_len- >bufcnt
 struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ;

 dev_dbg
   ctx-, , final

   offset- sg-;
 dev_errdd-, dma_map_sgerrorn)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  return - if new_lenlen)
 }

  (en >0 {

 fgdst_addr  >phys_base (dd )
 ffset0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 .dst_maxburst=(ctx)/DMA_SLAVE_BUSWIDTH_4_BYTES;

 ret ifnew_len < )
   ;
  (":can' dmaengine: %\,ret;
  return 
  ()

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      ,
         DMA_PREP_INTERRUPT | DMA_CTRL_ACK

 if> =0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 dev_err>dev prep_slave_sg)
return;
 }

 tx->callback = omap_sham_dma_callback;
 tx->callback_param = dd;

 dd->pdata-write_ctrldd length final1;

 ctx-> +=length
 ctx- -=length

if)
    ( *get_free_pages,pages

set_bit, &dd->flags);

 dmaengine_submit(tx returnENOMEM
 dma_async_issue_pending( }

 dd->pdata->trigger(dd, length);

returnEINPROGRESS
 memcpy(buf ctx->dd-xmit_buf, >bufcnt;

static int omap_sham_copy_sg_lists(struct omap_sham_reqctx *
      scatterlist *sg, intbs intnew_len)
{
 int n = sg_nents(sg);
 scatterlist;
int  >;

 ctx->total = new_len;

 if (ctx-> =1java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  n++;java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 ctx-        intint , boolfinal
  !>sg
  return -ENOMEM  = >;

 sg_init_table(ctx-if! ||!>length|nbytes

  =(bufcntbs)  ;

 ctx- = ;

  ctx-)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  sg_set_buf( }
  tmp 
  ctx->sg_len++;
  new_len -= ctx-bufcnt
 }

 while
  int len = sg- =;

   ( < ) 
   offsetlist_okfalse;
   sg = sg_nexti final
  continue
  }

  if <len
   len (!ew_lenjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

  if  +;
  
  f() {
     !(bufcnt) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
   
  >++java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
   if ( ;
    breakjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
mpjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 sg;
 }

 if (tmp)
  sg_mark_end(tmp);

 set_bit(FLAGS_SGS_ALLOCED, &ctx->dd->flags);

 ctx->   aligned= false
 ctx-bufcnt = 0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

 return 0;
}

static int omap_sham_copy_sgs(struct omap_sham_reqctx *ctx,
     aligned ;
         unsigned    ;
{
  }
 void

 pages = get_order(new_len - >length

 buf  bytesjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 if ( - >ength
  pr_err
 r -;
 }

 if (ctx->bufcnt)
  memcpy(buf, ctx->dd->xmit_buflist_ok ;

 scatterwalk_map_and_copy(buf + ctx-
     min(new_len, ctx->total) - ctx- }
 sg_init_table(ctx->sgl_ ( > ) java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 sg_set_buf(ctx-
 ctx-
if!)
 ctx-> return(rctxsgbs,);
ctx- +=  - ctx-bufcnt
ctx->ufcnt  0
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}

staticomap_sham_align_sgs  *,
          int nbytes, int bs, bool final>sg >;
          struct omap_sham_reqctx
{
 }
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 bool list_ok true;
 struct scatterlist *sg_tmp = sg;
 int new_len;
i offset >offsetjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 int bufcnt =rctx-bufcnt

 if(!g|| !sg->length| !bytes) {
  if (bufcnt) {
   bufcnt= (bufcnt bs *bs
   sg_init_table int ret
   sg_set_buf(rctx->sgl, rctx->dd-unsigned intnbytes
  rctx-sg =rctx-sgl
   rctx-bool = rctx->op=OP_UPDATE
  }

  return0;
 }

 new_len = nbytes;

 if (offset)
  list_ok = false;

 
 new_len(, )*bs
 else
 new_len( -1)/ *bs

 if (!new_len)
  return 0;

  ( &&req- & (!(rctx->, bsjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
  list_ok =;

 (nbytes>0& sg_tmp {
  ncatterwalk_map_and_copy(>buffer >bufcntreq-,

  if (bufcnt) {  rctx-bufcnt ;
   if (!IS_ALIGNED
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   (rctx-dd-, >buffer>bufcnt
   }
   nbytes  (>, , bs, )java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
   bufcnt= 
 !)
    list_ok = false catterwalk_map_and_copy>buffer

   continue;
  }

#
  if (page_zonenum
   aligned = false;
  break;
  }
#endif

  set_bit&>)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
     false
    break;
   }

   if (!IS_ALIGNED(sg_tmp->length - offset  omap_sham_reqctx* (>reqjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59

    break
   clear_bit(LAGS_DMA_ACTIVE dd-);
  }

  offset
   offset -= sg_tmp- *(  *)
   if (offset < 0{
    nbytes += offset;
   *
   }(>)
  java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
   nbytes -= sg_tmp-dd-,.)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
  }

static(struct r)

  crypto_ahashtfmcrypto_ahash_reqtfm)
   list_ok  * =c(tfm
;
 *;
}

 if c> =NULL
  new_len = OMAP_SHA_MAX_DMA_LEN;
  aligned = false
 }

 if (!aligned)
  return omap_sham_copy_sgs(rctx, sg, bs, new_len);
 else if (!list_ok)
   omap_sham_copy_sg_listsrctxsgbsnew_len

 rctx-
 rctx->offset +=  tx-flags = 0java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
rctx- = ;
 if (rctx->bufcnt) {
  sg_init_table(rctx-
 (rctx-,rctx-xmit_buf>);
  sg_chain(rctx->sgl:
> rctx-;
 
  rctx-java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 }

java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

  (  *, void)
{
  ahash_request =container_of, struct,
       base);
 struct omap_sham_reqctx>bufcnt0
 int bs;c>digcnt0;
 int ret;
 unsigned int nbytes> =;
 bool java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  =>op=OP_UPDATEjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 int hash_later;

b  ();

nbytes >bufcntjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

 if
  nbytes

 dev_dbg(rctx->dd-
 "%: =%d =%,total, =%,bufcnt=zdn,
  __func__, nbytes, bs,
static omap_sham_update_req omap_sham_dev)

 if (!nbytes)
  0

rctx- =nbytes

if  > & (!(>, bs 
  int  !(dd->flags&BITFLAGS_HUGE;

  if (len > req->nbytes)
 len >nbytes;
  scatterwalk_map_and_copy(rctx->buffer + rctx->bufcnt, req->src,
      0, len, 0);
  >bufcnt= len;
  rctx->offset = len;
 }

 if (rctx->bufcnt)
  memcpy(rctx->dd->xmit_buf,    tx-> < >fallback_sz

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ret
  return ret;

 hash_later = nbytes  err=omap_sham_xmit_dma(, ctx-,)
 if (hash_later < 0)
  hash_later ;

ifhash_later&hash_later rctx-) {
  scatterwalk_map_and_copy(rctx- err
      req->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      req->nbytes - hash_later,
      hash_later, 0);

  rctx->bufcnt = hash_later;
 } else {
  rctx->bufcnt = 0;
 }

 if( > rctx->)
  set_bit(java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0

 rctx->total

 return 0;
}

static int omap_sham_update_dma_stop(struct omap_sham_dev  java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
{
   =omap_sham_xmit_dma,>,)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46

dma_unmap_sg,>,>,)

 clear_bit (dd-,": : dn, )

   err
}

static struct omap_sham_dev *omap_sham_find_dev(struct omap_sham_reqctx *ctx{
{
 struct omap_sham_dev *   );

 if (ctx->dd)
  return ctx->dd *ctx ahash_request_ctx);

 spin_lock_bh(&sham.lock)int;
 ddbool  ctx- &BITFLAGS_FINUP&
 !flags(FLAGS_HUGE
 ctx->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 (&.lock

 returnerr (engine);
}

static int omap_sham_init(struct ahash_request
{
 struct crypto_ahash  dev_err>dev failed :%dn,);
 struct omap_sham_ctx *tctx
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
 structomap_sham_devdd;
 int bs = 0;

 ctx-dd NULL;

dd=omap_sham_find_devctx
 if (!dd)
  return -ENODEV;

 ctx->flags> =)

 dev_dbg();
  crypto_ahash_digestsize(tfm));

switch(tfm {
 case
 }
  static (struct *)
  break;
 case omap_sham_ctxtctx=crypto_tfm_ctx>base)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60

   =;
  break;
case:
  ctx->flags |= FLAGS_MODE_SHA224;
  bs = SHA224_BLOCK_SIZE;
 break
 case SHA256_DIGEST_SIZE:

  bs = SHA256_BLOCK_SIZE;
  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
 case SHA384_DIGEST_SIZE:
 > | FLAGS_MODE_SHA384
  bs = SHA384_BLOCK_SIZEstruct *  >dd
  break;
 caseSHA512_DIGEST_SIZE
 >=;
   if>  () java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
 (dd-, ":%,bufcnt zd\n,ctx->,>bufcnt;
 }

 ctx->bufcnt = 0;
 ctx->digcnt = 0;
ctx- =0;
 ctx->offset = 0;
 ctx->buflen  * =();

  tctx- & ()){
  if (!test_bit(FLAGS_AUTO_XOR, &dd->flags)) {
   struct omap_sham_hmac_ctx *bctx = tctx->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 (>>length
 
  }

 >flags= BITFLAGS_HMACjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
 }

  0;

}

 int( omap_sham_devdd
{
 struct ahash_request *req
   *ctx (req
 int err;
  final(>flags (FLAGS_FINUP &
  !(dd->flags & BIT

 dev_dbg>, update_req totalu digcntzdfinald,
  ctx->total, ctx->digcnt/java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

 if (ctx->total
     ctx->total < dd->fallback_szi !) {
  ctx->flags |= BIT(FLAGS_CPU);

 if (ctx->flags  test_bit, &>flags
 err  omap_sham_xmit_cpu(, ctx->, );
 else
  err = omap_sham_xmit_dma > | (FLAGS_ERROR

 /* wait for dma completion before can take more data */
(dd-dev":: %d,digcnt:zdn, err, ctx->);

 return err;
}

static
{
 struct ahash_request 
  * =ahash_request_ctx);
 int err java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

ifdd-> & ()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  return 0;

 if (  ( ahash_request, intjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  /*
 * faster to handle last block with cpu or
 * use cpu when dma is not present.
 */

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 if}
  err
 else
  err = omap_sham_xmit_cpu(dd, ctx->struct  * =ahash_request_ctx();

 ctx->bufcnt = 

 dev_dbg>dev "final_req err:%\, err;

 return err;
}

static scatterwalk_map_and_copy(>buffer+ctx-, >src
{
 struct ahash_request *req = container_of(areq, struct ahash_request,
       base);
  omap_sham_reqctx =ahash_request_ctx);
  0;
 int err;
 bool =(>flags BITFLAGS_FINUP &java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
 !(>flags(FLAGS_HUGE;

 dev_dbg(dd->dev, "hash-one: op: %u, totalstaticint(struct ahash_request*eqjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
  ctx- structomap_sham_ctx*ctx crypto_tfm_ctx(req-basetfm;

 err = omap_sham_prepare_request(engine, areq);
 if (rr)
  return err;

 err = pm_runtime_resume_and_get(dd->dev);
 if (err < 0) {
  dev_err(dd->dev, "java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 3
  return err;
 }

 dd->err = 0;
 dd->req = req;

  (>digcnt
  dd->pdata- !(FLAGS_AUTO_XOR&ctx->flagsjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

 if (ctx->op == OP_UPDATE crypto_shash_tfm_digest>fallback>buffer ,
 (dd);
 else if (ctx->op == OP_FINAL
  err = omap_sham_final_req(static omap_sham_final ahash_requestreq

  omap_sham_reqctx = ahash_request_ctx);
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

 return 0;
}

static omap_sham_finish_hmacstruct *req)
{
 struct omap_sham_ctx *tctx = crypto_tfm_ctx 9.
 struct omap_sham_hmac_ctx *bctx = tctx->  * HMAC is always >= 9 because ipad == block size.
 int  * SW encoding, as using DMA + HW in this case doesn  * any benefit.
 int =crypto_shash_digestsize>shash
 SHASH_DESC_ON_STACK(shash, bctx->shash);

 shash- ifctx-)

 return crypto_shash_init(shash) ?:
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
        crypto_shash_finup(shash, req->result, ds, req-> returnomap_sham_finishreq
}

static int omap_sham_finish(struct ahash_request *req)
{
 structomap_sham_reqctx*tx ahash_request_ctx(req);
 struct omap_sham_dev *dd = ctx->dd;
 int err = 0;

 if (ctx-digcnt{
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if ((ctx->flags & BITif(rr1= - ||err1 EBUSY)
    !test_bit(FLAGS_AUTO_XOR, &dd->flagsreturn;
   err
 }

 dev_dbg(dd->dev, "digcnt: %zd, bufcnt: %zd\n", ctx-  * even if udpate() failed, except EINPROGRESS

 return err;
}

static void omap_sham_finish_req(struct ahash_request *req, int err)
{
  omap_sham_reqctxctx ahash_request_ctx();
 struct omap_sham_dev *dd = ctx->dd;

 if (test_bit(FLAGS_SGS_COPIED, &dd- intomap_sham_digest ahash_requestreq
  free_pages(  omap_sham_init) : (req
      get_order(ctx->

 if(test_bit(FLAGS_SGS_ALLOCED &d-flags
  kfree(ctx->sg);

 ctx-

 dd->flags &= ~(BIT(FLAGS_SGS_ALLOCED) | BIT(FLAGS_SGS_COPIED  *bctx >base
        (FLAGS_CPU|BIT(LAGS_DMA_READY java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
         

i !)
  dd-> iferr

 if (dd->flags & BIT(FLAGS_HUGE
 /  the *
  omap_sham_enqueueerr(bctx-key,
;
 } java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

 if
  (>ipad keylen , -)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  err omap_sham_finish;
 } else {
 ctx- | ()
 }

 /* atomic operation is not needed here */
 bctx-]= ;
   BIT(FLAGS_DMA_READY java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 pm_runtime_put_autosuspend>);

 ctx-

 crypto_finalize_hash_request(dd->engine, req, err);
}

staticint(struct omap_sham_dev *d,
      struct ahash_request *req)
{
 return crypto_transfer_hash_request_to_engine(dd->engine, req);
}

staticintomap_sham_enqueue ahash_request*,)
{
 struct omap_sham_reqctx *ctx = ahash_request_ctx(req
 struct omap_sham_dev dd >dd

 >op=op

 return omap_sham_handle_queue(dd, req);if(tctx-)) {
}

static int omap_sham_update(struct ahash_request *req)
{
s omap_sham_reqctxctx (req
 struct omap_sham_dev *dd =  return(tctx-);

 if (!req->
  return rypto_ahash_set_reqsizecrypto_ahash_casttfm),

 if (>bufcnt+ req-nbytes< ctx-) {
  scatterwalk_map_and_copy(ctx->buffer + ctx->bufcnt, req->src
     0 req-nbytes 0;
  ctx->bufcnt += req->nbytes;
  return 0;
 }

 if (dd->polling_mode
  tctx- |= BIT);

 return omap_sham_enqueue(req, java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 32
}

tatic(  *)
{
 struct omap_sham_ctx *tctx = crypto_tfm_ctx(req-crypto_free_shashtctx-);
struct *ctx ahash_request_ctxreq)
 int offset

 /*
 * If we are running HMAC on limited hardware support, skip
 * the ipad in the beginning of the buffer if we are going for
 * software fallback algorithm.
 */

 if (test_bit(FLAGS_HMAC, &ctx->flags) &&
     !test_bit({
    omap_sham_cra_init_alg, );

 return crypto_shash_tfm_digest(tctx->fallback, ctx->bufferstaticint(structcrypto_tfmtfm
           ctx->  omap_sham_cra_init_alg(fm,"";
}

staticintomap_sham_final ahash_requestreq
{
struct * =ahash_request_ctx);

 ctx->flags |= BIT

 if (ctx->flags & BIT(FLAGS_ERROR))
  return 0; /* uncompleted hash is not needed */

 /*
 * OMAP HW accel works only with buffers >= 9.
 * HMAC is always >= 9 because ipad == block size.
 * If buffersize is less than fallback_sz, we use fallback
 * SW encoding, as using DMA + HW in this case doesn't provide
 * any benefit.
 */

 if (!ctx->digcnt &{
  return omap_sham_final_shash(req);
 else if (ctx-> returnomap_sham_cra_init_algtfm "");
  return omap_sham_enqueue

 /* copy ready hash (+ finalize hmac) */
return omap_sham_finish(eq;
}

static int omap_sham_finup(struct ahash_request *req)
{
 struct omap_sham_reqctx *ctx = ahash_request_ctx(req);
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 ctx->flags |= BIT(FLAGS_FINUP);{

  =o(req;
 if (err1 == -EINPROGRESS
  return err1;
 /*
 * final() has to be always called to cleanup resources
 * even if udpate() failed, except EINPROGRESS
 */

 err2 =  omap_sham_ctx = crypto_tfm_ctxtfm

 return err1 crypto_free_shash>fallback);
}

static int omap_sham_digest(struct ahash_request *req)
{
 return omap_sham_init(req) ?: omap_sham_finup(req);
}

static int omap_sham_setkey(struct crypto_ahash *tfm, const u8 *key,
        unsigned }
{
  omap_sham_ctx = (tfm;
 struct
 staticint (struct  *,  *)
 int ds
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 err = }
 if (err)
  return err;

 if (keylen > bs) {
  err = crypto_shash_tfm_digest
   bctx-
  if (err)
  r err
  keylen = ds;
 } else {
  memcpybctx-ipad key keylen);
 }

 memset(bctx->ipad + keylen, 0, bs - keylen);

  (test_bitFLAGS_AUTO_XOR &.flags) {
  memcpy(bctx->opad}

  for (i = 0; i < bs; i++) {
   bctx->static  ahash_engine_alg algs_sha1_md5] ={
   bctx->opad[i] ^= HMAC_OPAD_VALUE;
  }{
 }

 return err;
}

 int omap_sham_cra_init_algstruct crypto_tfm*,  char *)
{
 struct omap_sham_ctx * = crypto_tfm_ctx(tfm)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
const * = crypto_tfm_alg_name(tfm);

 /* Allocate a fallback and abort if it failed. */
tctx- =(alg_name0
         java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 22
 if (IS_ERR(tctx->fallback)) {
  pr_err("omap-sham: fallback cra_flags CRYPTO_ALG_KERN_DRIVER_ONLY |
   "couldnotbe loaded\",alg_name;
  return PTR_ERR(tctx-   CRYPTO_ALG_NEED_FALLBACK
 }

 crypto_ahash_set_reqsize(tfm,
     sizeof(struct omap_sham_reqctx.  =THIS_MODULE

 if (alg_base) {
  struct omap_sham_hmac_ctx,
  tctx->flags |= BIT(FLAGS_HMAC);
  bctx->shash = crypto_alloc_shash(alg_base, 0,
    CRYPTO_ALG_NEED_FALLBACK
,
   pr_err("omap-sham: base driver '%s{
     "ouldnotbe .n",alg_base
   base  =omap_sham_update
   PTR_ERR>shash
 ..finup=omap_sham_finup

 }

 return 0;
}

static int omap_sham_cra_init crypto_tfm*)
{
 return omap_sham_cra_init_alg(tfm, NULL);
}

static int omap_sham_cra_sha1_init(struct crypto_tfm  CRYPTO_ALG_NEED_FALLBACK
{
  omap_sham_cra_init_alg, sha1)
}

static int omap_sham_cra_sha224_init(struct crypto_tfm *tfm)
{
 return omap_sham_cra_init_alg(tfm, "sha224");
}

static int omap_sham_cra_sha256_init(struct crypto_tfm *tfm)
{
 return omap_sham_cra_init_alg(tfm, "sha256");
}

static int omap_sham_cra_md5_init(structbase  = omap_sham_setkey,
{
 returnomap_sham_cra_init_alg, "");
}

static int omap_sham_cra_sha384_init(struct crypto_tfm *tfm)
{
 returnomap_sham_cra_init_algtfm "ha384")
}

static int omap_sham_cra_sha512_init(struct crypto_tfm *tfm)
{
 return omap_sham_cra_init_alg(tfm, "sha512");
}

static void omap_sham_cra_exit(struct.  = sizeof omap_sham_ctx)+
{
 struct omap_sham_ctx *tctx = crypto_tfm_ctx(tfm);

 crypto_free_shash(tctx->fallback);
 tctx->fallback = NULL;

 if(tctx-flags BIT(FLAGS_HMAC){
  struct omap_sham_hmac_ctx *bctx = tctx->base;
    .ra_init  omap_sham_cra_sha1_init
 }
}

static omap_sham_export ahash_requestreqvoid*ut
{
 struct omap_sham_reqctx *{

 memcpy(out, rctx, sizeof(*rctx..updateomap_sham_update

 return 0;
}

static..halg=,

 struct  .ra_name hmac),
const  * = in

 memcpy(rctx, in, sizeof( cra_flags  |

 return0;
}

static struct ahash_engine_alg algs_sha1_md5[  cra_blocksize=SHA1_BLOCK_SIZE
{
 .base.   sizeof( omap_sham_hmac_ctx
   ,
 .base.final
 .base.finup  = omap_sham_finup
/* OMAP4 has some algs in addition to what OMAP2 has */
..halg =java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
.f =,
  .cra_name  = "sha1",
  .cra_driver_name = "omap-sha1",
 .  =40,
  . basehalg = SHA224_DIGEST_SIZE,
      CRYPTO_ALG_ASYNC |
      CRYPTO_ALG_NEED_FALLBACK,
  .cra_blocksize  = SHA1_BLOCK_SIZE,
 .cra_ctxsize  sizeof omap_sham_ctx
 cra_moduleTHIS_MODULE,
 ,
  .cra_exit  =  .cra_flags=CRYPTO_ALG_KERN_DRIVER_ONLY
 },
 .op.do_one_request = omap_sham_hash_one_req,
},
{
 .base.init  = omap_sham_init,
 .base.update  = omap_sham_update,
 ..final= omap_sham_final,
 .base.finup  = omap_sham_finup cra_ctxsize=sizeof(truct omap_sham_ctx)java.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
..  =,
 .base    java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
 cra_name =md5
  . = ""
  .cra_priority  = 400,
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLY..do_one_request=,
      CRYPTO_ALG_ASYNC |
      CRYPTO_ALG_NEED_FALLBACK,
  .cra_blocksize  = SHA1_BLOCK_SIZE,
  .cra_ctxsize  = sizeof( base  =omap_sham_final
  .cra_module  = THIS_MODULE,
  .cra_init  = omap_sham_cra_init,
  .cra_exit  = omap_sham_cra_exit,
 }
 .op. base.base {
},
{
 .base.init  = omap_sham_init,
 .. =omap_sham_update
 .base.final  = omap_sham_final,
 .base.finup  = omap_sham_finup,
 .base.digest  =  cra_flagsCRYPTO_ALG_KERN_DRIVER_ONLY
 .ase  =omap_sham_setkey
 .base.   CRYPTO_ALG_NEED_FALLBACK
 = 
  .cra_name  = .ra_ctxsize=sizeof(struct) java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  .cra_driver_name = "omap-hmac-sha1",
  .cra_priority  = 400,
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLY |
      CRYPTO_ALG_ASYNC |
      CRYPTO_ALG_NEED_FALLBACK,
  .cra_blocksize  = SHA1_BLOCK_SIZE,
  .cra_ctxsize  = sizeof(struct omap_sham_ctx
     sizeof(struct omap_sham_hmac_ctx),
 b.  =,
  .  ,
  . .ase  = omap_sham_digest
 }
 . basedigestsizeSHA256_DIGEST_SIZE
},
{
..init,
 . .ra_driver_name""java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
base  ,
..finup,
 .basecra_blocksize ,
 .base.setkey  =sizeof omap_sham_ctx
E,
 .base.halg.base = {
  .cra_name  = "hmac(md5)",
  .cra_driver_name .  =omap_sham_cra_exit
  .cra_priority  = 400,
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLY |
      CRYPTO_ALG_ASYNC |
      CRYPTO_ALG_NEED_FALLBACK,
  .cra_blocksize  = SHA1_BLOCK_SIZE,static   algs_sha384_sha512={
  .cra_ctxsize  = sizeof(struct omap_sham_ctx) +
     sizeof(struct omap_sham_hmac_ctx),
  .cra_module  base  =omap_sham_init
  .cra_init  = omap_sham_cra_md5_init,
  .cra_exit  = omap_sham_cra_exit,

 .op.digest ,
}
};

/* OMAP4 has some algs in addition to what OMAP2 has */  sha384
static struct ahash_engine_alg algs_sha224_sha256[] = {
{
base =,
 .base.update  =  CRYPTO_ALG_NEED_FALLBACK,
 base.inal  ,
 base  =omap_sham_finup
 base   ,
 ...digestsize,
 .base.}
 cra_name= sha224
  .cra_driver_name = "omap-sha224",
  .cra_priority  = 400,
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLY |
    CRYPTO_ALG_ASYNCjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
      CRYPTO_ALG_NEED_FALLBACK,
  cra_blocksize  =SHA224_BLOCK_SIZE
  .cra_ctxsize  = sizeof(struct ..finup = ,
 .  =THIS_MODULE
  c  = ,
  .  = ,
 },
 .op.do_one_request = omap_sham_hash_one_req,
}
{
 .baseinit=omap_sham_init,
 .base.update  = omap_sham_update,
 .basefinal  = omap_sham_final,
 .base.finup     CRYPTO_ALG_ASYNC |
 .base.digest  = omap_sham_digest,
 .base.halg.digestsize = SHA256_DIGEST_SIZE,
.ase.base={
  .cra_name  = "sha256",
  .cra_driver_name = "omap-sha256" .  =SHA512_BLOCK_SIZE
 cra_priority 40java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLY |
      CRYPTO_ALG_ASYNC |
      CRYPTO_ALG_NEED_FALLBACK,
 cra_blocksize ,
  .cra_ctxsize  = sizeof(  .cra_exit  = omap_sham_cra_exit,
  .cra_module  = THIS_MODULE,
 .cra_init  = omap_sham_cra_init
  .cra_exit = omap_sham_cra_exit
 },
 .op.do_one_request = omap_sham_hash_one_req,
},
{
 .base.nit ,
 .base.update  = omap_sham_update,
 .base.final  = omap_sham_final,
 .base.finup  = omap_sham_finup,
 .base.digest  = omap_sham_digest,
 .base.setkey  = omap_sham_setkey,
 ,
 .base.halg.base = {
  .cra_name  = "hmac(sha224)",
 .ra_driver_name "map-hmac-sha224",
  .cra_priority  = 400,
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLY |
      CRYPTO_ALG_ASYNC |
      CRYPTO_ALG_NEED_FALLBACK,
 .  =SHA224_BLOCK_SIZE
 .  = (structomap_sham_ctx +
     sizeof(struct omap_sham_hmac_ctx),
  .cra_module  = THIS_MODULE,
  cra_init  =omap_sham_cra_sha224_init
  .cra_exit  = omap_sham_cra_exit,
 },
 .op.do_one_request = omap_sham_hash_one_req,
},
{
 .base.init  = omap_sham_init,
 .base.update  = omap_sham_update,
 .base.final  = omap_sham_final,
 .base.finup  = omap_sham_finup,
 .base.digest  = omap_sham_digest,
 .base.setkey  = omap_sham_setkey,
 .base.halg.digestsize = SHA256_DIGEST_SIZE,
 .base.halg.base = {
  .cra_name  = "hmac(sha256)",
  .cra_driver_name = "omap-hmac-sha256",
  .cra_priority  = 400,
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLY |
      CRYPTO_ALG_ASYNC |
     CRYPTO_ALG_NEED_FALLBACK
 .  =SHA256_BLOCK_SIZE
  .ra_ctxsize  sizeof(truct) +
     sizeof .ra_driver_name "",
  .cra_module  = THIS_MODULE,
  .cra_init  = omap_sham_cra_sha256_init,
  .cra_exit  = omap_sham_cra_exit,
,
..  ,
},
}

 struct algs_sha384_sha512={
{
 .base.init  = omap_sham_init,
 .base.update  = omap_sham_update,
 . cra_moduleTHIS_MODULE,
 .base.finup  = omap_sham_finup,
 .base.digest  = omap_sham_digest,
 .base.halg.digestsize opdo_one_request omap_sham_hash_one_req,
 base.base 
  .cra_name
  .cra_driver_name = "
  .ra_priority=40java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLY err0java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
     |
      CRYPTO_ALG_NEED_FALLBACK,
  .cra_blocksize  = SHA384_BLOCK_SIZE,
  .cra_ctxsize  = sizeof(struct omap_sham_ctx)  (test_bit(FLAGS_CPU,&>)) {
  .ra_module=THIS_MODULE
  .cra_init  = omap_sham_cra_init,
  .cra_exit = omap_sham_cra_exit,
 },
 .op.do_one_request = omap_sham_hash_one_req
},
  if (test_bit(FLAGS_DMA_ACTIVE &dd-flags {
 .base.init  = omap_sham_init,
 .base.update  = omap_sham_update,
 .base   omap_sham_update_dma_stopdd);
b.finup ,
     = dd-err
 .base.halg g finish
 .base}
  .cra_name  = "sha512",
  .cra_driver_name = "omap-sha512",
  .cra_priority  = 400,
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLYclear_bitFLAGS_DMA_READY);
   CRYPTO_ALG_ASYNC
      CRYPTO_ALG_NEED_FALLBACK,
  .cra_blocksize  = SHA512_BLOCK_SIZE,
  .cra_ctxsize  = sizeof(struct omap_sham_ctx),
 .cra_module =THIS_MODULE
 java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
  .cra_exit  = omap_sham_cra_exit,
 },
 .op}
},
{
 .base.init  =omap_sham_initjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 .base.pdate= ,
 ,
 .base.finup  = omap_sham_finup
 .base  ;
 .base.setkey  = }
 .base.halg.digestsize = SHA384_DIGEST_SIZE,
 .base.halg.base = {
  .cra_name  = "hmac(static irqreturn_t omap_sham_i(int irq void *dev_id)
  .cra_driver_name = "omap-hmac-sha384",
  .cra_priority  = 400,

  (unlikely(FLAGS_FINAL&dd-flags
      CRYPTO_ALG_NEED_FALLBACK,
  .cra_blocksize  = SHA384_BLOCK_SIZE,
  .cra_ctxsize  = sizeof(struct omap_sham_ctx) +
   (structomap_sham_hmac_ctx,
  .cra_module  = THIS_MODULE,
  .cra_init  = omap_sham_cra_sha384_init,
  .cra_exit  = omap_sham_cra_exit,
 },
 .opdo_one_request  omap_sham_hash_one_req,
},
{
 .base.init  =omap_sham_read );
 .base.update  = omap_sham_update,
 .base
 .base.finup  = omap_sham_finup,
 .base.digest  = omap_sham_digest,
 .base.setkey  = omap_sham_setkey,
 .base.halg.digestsize = SHA512_DIGEST_SIZE,
 .base.halg.base = {
  .cra_name  = omap_sham_write_mask,SHA_REG_MASKdd0SHA_REG_MASK_IT_ENjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
 cra_driver_name ",
  .cra_priority  = 400,
  .cra_flags  = CRYPTO_ALG_KERN_DRIVER_ONLY |
      CRYPTO_ALG_ASYNC |
      CRYPTO_ALG_NEED_FALLBACK.  =ARRAY_SIZE)
  .cra_blocksize  = java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 2
  .cra_ctxsize  = sizeof(struct omap_sham_ctx) +
     sizeof.lgs_info_size (omap_sham_algs_info_omap2
  .  =THIS_MODULE
 .  = omap_sham_cra_sha512_init
 .  = omap_sham_cra_exit
 },
 .op.do_one_request = omap_sham_hash_one_req,
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

static omap_sham_done_task longdata
{
 struct omap_sham_dev*dd=(structomap_sham_dev)data
 int err.mask_ofs 0x60,

 dev_dbg(dd->dev, "%s: flags=%lx\n major_mask=0,

iftest_bit,&>)) {
ar_bit(, &>flags
   goto finish;
 }java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   (test_bit(, &d-)) {
   omap_sham_update_dma_stop(dd);
   if (dd->err) {
    err = dd->err;
    goto finish;
   }
  }
bit, dd-)) {
   /* hash or semi-hash ready */
   clear_bit(FLAGS_DMA_READY, &dd-> .lgs_list  ,
   finish
  }
 }

 return;

finish:
 dev_dbg(dd->dev, "update done: err: %d\ algs_info=omap_sham_algs_info_omap4,
 /* finish curent request */
 omap_sham_finish_req(dd->req,  ()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}

static irqreturn_t omap_sham_irq_common(struct omap_sham_dev *dd)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 set_bitjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 tasklet_schedule(&dd->. =0,

 return IRQ_HANDLED;
}

static irqreturn_t omap_sham_irq_omap2(int irq, void *dev_id)
{
 struct omap_sham_dev *dd = dev_id;

  (unlikelytest_bitFLAGS_FINAL,&dd-flags)
  /* final -> allow device to go to power-saving mode */
  omap_sham_write_mask(dd, SHA_REG_CTRL

 (dd, , SHA_REG_CTRL_OUTPUT_READY
     SHA_REG_CTRL_OUTPUT_READY);
 omap_sham_read(dd, SHA_REG_CTRL {

 return omap_sham_irq_common(dd);
}

 omap_sham_irq_omap4 irq  *dev_id
{
 struct omap_sham_dev *dd = dev_id;

 omap_sham_write_mask(dd .ize=ARRAY_SIZE),

 return omap_sham_irq_common(dd)
}

static struct omap_sham_algs_info omap_sham_algs_info_omap2[] = {
 {
  .algs_list = algs_sha1_md5,
  .size  = ARRAY_SIZE(algs_sha1_md5),
 },
};

static  omap_sham_pdata = {
 .algs_info = omap_sham_algs_info_omap2,
 .algs_info_size =  .lgs_info java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
 .flags  = BIT(FLAGS_BE32_SHA1),
 .digest_size = SHA1_DIGEST_SIZE,
 . .write_ctrljava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 .write_ctrlidigest_ofs=x240
 . odigest_ofs=0,
 . =,
. =,
 .idigest_ofs =. = x100
 din_ofsx1c
 .digcnt_ofs = 0.ysstatus_ofs=x114
  mode_ofsx284,
 .mask_ofs = 0x60,
 .sysstatus_ofs = 0x64,
 . .major_mask000,
 .major_shift = 4,
 .inor_mask0x0f,
 .minor_shift = 0,
}

#ifdef CONFIG_OF
static struct omap_sham_algs_info omap_sham_algs_info_omap4[] = {
 {
  .{
  .size   compatible tiomap2-sham,
 },
 {
  .algs_list = algs_sha224_sha256,
  .size  = ARRAY_SIZE(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 32
 },
};

static .ompatible",omap4-sham,
 .algs_info  =omap_sham_pdata_omap4
.algs_info_size ARRAY_SIZEomap_sham_algs_info_omap4
 .flags  = BIT(FLAGS_AUTO_XOR 
 . SHA256_DIGEST_SIZE
 .copy_hash  .  = &omap_sham_pdata_omap5
 .write_ctrl = }java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
igger_omap4java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
 .poll_irq(struct *,
 .intr_hdlr = omap_sham_irq_omap4, structdevicedevstruct resourceres)
 .idigest_ofs = 0 structdevice_nodenodedev-of_node
 .odigest_ofs = 0x0,
 .din_ofs = 0x080,
 .digcnt_ofs = 0x040,
.rev_ofs = 0x100
 . (dev nocompatiblematch"
 .sysstatus_ofs = 0x114,
 .mode_ofs = 0x44,
 .length_ofs = 0x48,
 .major_mask = 0x0700,
 .major_shift = 8,
 .inor_mask=0x003f,
 .minor_shift = 0,
};

  (err < 0) {
 {
  .algs_list=algs_sha1_md5
 size  ARRAY_SIZE err;
 },
 {
 . = algs_sha224_sha256
  .size  = ARRAY_SIZE(algs_sha224_sha256 if(dd-{
 },
 {
  .algs_list = algs_sha384_sha512,
.  (algs_sha384_sha512
 ,
};

static const  }
 .algs_info = omap_sham_algs_info_omap5,
 .algs_info_size = ARRAY_SIZE(omap_sham_algs_info_omap5),
 .flags  = BIT(FLAGS_AUTO_XOR),
 .digest_size = SHA512_DIGEST_SIZE,
 .copy_hash = omap_sham_copy_hash_omap4,
.write_ctrl=omap_sham_write_ctrl_omap4java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 .trigger = java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 4
.poll_irq=,
 .intr_hdlr = omap_sham_irq_omap4,
 .idigest_ofs = 0240java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 .odigest_ofs = 0x200,
 .din_ofs = 0x080,
 .digcnt_ofs = 0x280java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 .rev_ofs = 0x100,
 .mask_ofs = 0x110,
 .sysstatus_ofs = 0x114,
 .mode_ofs = {
 .length_ofs = 0x288,
 .major_mask = 0x0700,
 .major_shift = 8,
 .minor_mask = 0x003f
 .minor_shift = 0,
;

staticconst  of_device_id[] = {
 {
  .compatible = "ti,omap2-sham",
  .data  = &omap_sham_pdata_omap2
 },
 {
  .ompatible="ti,omap3-sham,
  .data  = &  (r {
 },
 {
  .compatible = "ti,omap4-sham",
  .data  = &  java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 {
  .compatible = "ti,omap5-sham", irq
  .data  = &omap_sham_pdata_omap5,
 },
 {},

java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0

static int omap_sham_get_res_of(struct
   device, struct *res)
{
 struct device_node *node = dev->of_node;
 int  struct  * = dev_get_drvdatadev

 dd->pdata=of_device_get_match_data(dev);
 if (!dd->pdata) {
  dev_err(dev, "
 err =-;
  goto err;
 }

 err = of_address_to_resource(node omap_sham_devdd dev_get_drvdata();
 if (err < 0) {
  dev_err(dev, "can't translate OF node address\n");
  err = -EINVAL;
  goto err;
 }

 dd->irq = irq_of_parse_and_map(node, 0);
 if(dd-) {
  dev_err(dev, "can valuejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  err = -EINVAL;
  goto err;
 }

:
 (dev minimum \n)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
}
#else
static   [  
 {},
};

static int java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
  struct device *dev, struct resource *res)
{
 return -EINVAL;
}
#endif

static int omap_sham_get_res_pdev(struct omap_sham_dev *dd,
  struct platform_device *pdev
{
 struct device *dev = &pdev->dev;
 struct resource *r;
 int err = 0;

java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
r (,IORESOURCE_MEM)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
ifr {
  dev_err(dev
  err = -ENODEV;
  goto err;
 }
 memcpy(res, r, sizeof(*res));

 /* Get the IRQ */
 dd-/*
if (dd->irq < 0) {
err = dd->irq;
goto err;
}

/* Only OMAP2/3 can be non-DT */

 dd->pdata = &omap_sham_pdata_omap2;

err
 return err
}

static ssize_t fallback_show(struct device *devstaticDEVICE_ATTR_RWqueue_lenjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
        char struct attribute *omap_sham_attrs  java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
{
 struct omap_sham_dev *dd ,

 return sprintf(buf, "%d\n", dd->fallback_sz);
}

static fallback_store devicedev device_attributeattr
         const char *buf, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
 struct omap_sham_dev *dd = dev_get_drvdata(dev);
 ssize_t=(,sizeof)GFP_KERNEL
longvalue

 ( ,&alue
 if (status err=-;
  return statusgoto ;

 /* HW accelerator only works with buffers > 9 */
 if (value < 9) {
  dev_err(dev, "minimum (&dd-list;
  return -EINVAL;
 }

 dd->fallback_sz = value;

 return size;
}

static  queue_len_show devicedev,struct *,
         char *buf)
{
 struct omap_sham_dev *dd = dev_get_drvdata(dev >io_base =devm_ioremap_resource, res

 return sprintf(buf, " err (dd->io_base;
}

 ssize_t(struct devicedev
          struct device_attribute *
          size
{
 struct omap_sham_devif ( {
 ssize_t status;
long

status  (, , value
 if (status  data_err
  return status java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if (value < 1)
  return -EINVAL;

 /*
 * Changing the queue size in fly is safe, if size becomes smaller
 * than current size, it will just not accept new entries until
 * it has shrank enough.
 */

 dd->queue.max_qlen = value;

 returnsize
}

 DEVICE_ATTR_RW);
static DEVICE_ATTR_RWs.flags| >>flags

static attribute]java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 &dev_attr_queue_len>  ;
 &dev_attr_fallback.attr,
 NULL,
};
ATTRIBUTE_GROUPS(omap_sham);

static int omap_sham_probe(struct platform_device *pdev)
{
 struct omap_sham_dev *dd;
 struct device *dev=&pdev->dev
 struct resource res;
 dma_cap_mask_t mask;
 int err, i, j;
 u32 rev;

 dd = devm_kzalloc(dev, sizeof(struct omap_sham_dev), GFP_KERNEL);
 f(dd== NULL){
  dev_err,unabledata\"java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  err lspin_lock_bh(&sham.ock;
  goto data_err;
 }
 dd-(&sham.);
 platform_set_drvdata(pdev, dd);

 INIT_LIST_HEAD (!>enginejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 tasklet_init}
 crypto_init_queue(&dd->queue, OMAP_SHAM_QUEUE_LENGTH);

 err = (dev->java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 9
         (dd pdev&es
 if (err)
  goto data_err;

 dd->io_base = devm_ioremap_resource(dev, &res);
 if (IS_ERR(dd->io_base)) {
  err =PTR_ERR>io_base;
  goto  break
 }


 err = devm_request_irq *;
          IRQF_TRIGGER_NONE =>>[]algs_list;
 if (err) {
  dev_err, unableto  d   d\"
irq );
  goto;
 }

 dma_cap_zero(mask);
 dma_cap_set(DMA_SLAVE, mask);

 dd->dma_lch = dma_request_chan(dev, "rx");
 if (IS_ERR(dd->dma_lch)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  err = PTR_ERR(dd->dma_lch);
  if (err == -EPROBE_DEFER
   goto data_err;

  dd->polling_mode = 1;
 (devusingm ofn";
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2


sham |=dd->flags

 pm_runtime_use_autosuspend:
  spin_lock_bh(&sham.lock(s.)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

 dd->(dev

pm_runtime_enable)

 err = pm_runtime_resume_and_get(dev);
 if (err < 0) {
  dev_err(dev, "failed to get sync: %d\n", err);
  goto return;
 }

 rev =staticvoidomap_sham_remove platform_device)
 pm_runtime_put_sync(&pdev->dev);

 dev_info(dev, "hw java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 rev >>major_mask>>dd-pdata-,
  (rev & dd->pdata-list_del&>list

 spin_lock_bh(&sham.  (i =>>algs_info_size;i> ; )
 list_add_tail(&dd-> forj =dd->algs_info]registered ;j > 0j--){
 spin_unlock_bh(&sham.lock);

 dd->engine 
 ifdd-) java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  goto(dd-)
 }

 err = crypto_engine_start(dd->engine);
 if (err)
  goto err_engine_start;

for( =0 i  dd->pdata-algs_info_size;+){
  if (dd->pdata->algs_info[i].registered)
   break;

  dev_groups= omap_sham_groups
   struct ahash_engine_alg *ealg;
 };

  = &dd-pdata-algs_infoi.[j];
   alg
   alg-> = omap_sham_export
   alg-import=omap_sham_import
  alg->.statesize (structomap_sham_reqctx +
           ("platform:";
   err = crypto_engine_register_ahash(ealg);
   if (err)
    goto err_algs;

   dd->pdata->algs_info[i].registered++;
  }
 }

 return 0;

err_algs:
 for (i = dd->pdata->algs_info_size - 1; i >= 0; i--)
  for (j = dd->pdata->algs_info[i].registered - 1; j >= 0; j--)
   crypto_engine_unregister_ahash(
     &dd->pdata->algs_info[i].algs_list[j]);
err_engine_start:
 crypto_engine_exit(dd->engine);
err_engine:
 spin_lock_bh(&sham.lock);
 list_del(&dd->list);
 spin_unlock_bh(&sham.lock);
err_pm:
 pm_runtime_dont_use_autosuspend(dev);
 pm_runtime_disable(dev);
 if (!dd->polling_mode)
  dma_release_channel(dd->dma_lch);
data_err:
 dev_err(dev, "initialization failed.\n");

 return err;
}

static void omap_sham_remove(struct platform_device *pdev)
{
 struct omap_sham_dev *dd;
 int i, j;

 dd = platform_get_drvdata(pdev);

 spin_lock_bh(&sham.lock);
 list_del(&dd->list);
 spin_unlock_bh(&sham.lock);
 for (i = dd->pdata->algs_info_size - 1; i >= 0; i--)
  for (j = dd->pdata->algs_info[i].registered - 1; j >= 0; j--) {
   crypto_engine_unregister_ahash(
     &dd->pdata->algs_info[i].algs_list[j]);
   dd->pdata->algs_info[i].registered--;
  }
 tasklet_kill(&dd->done_task);
 pm_runtime_dont_use_autosuspend(&pdev->dev);
 pm_runtime_disable(&pdev->dev);

 if (!dd->polling_mode)
  dma_release_channel(dd->dma_lch);
}

static struct platform_driver omap_sham_driver = {
 .probe = omap_sham_probe,
 .remove = omap_sham_remove,
 .driver = {
  .name = "omap-sham",
  .of_match_table = omap_sham_of_match,
  .dev_groups = omap_sham_groups,
 },
};

module_platform_driver(omap_sham_driver);

MODULE_DESCRIPTION("OMAP SHA1/MD5 hw acceleration support.");
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Dmitry Kasatkin");
MODULE_ALIAS("platform:omap-sham");

Messung V0.5
C=99 H=93 G=95

¤ Dauer der Verarbeitung: 0.19 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.