mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-04 13:48:25 +00:00
crypto: omap-sham - change the DMA threshold value to a define
Currently the threshold value was hardcoded in the driver. Having a define for it makes it easier to configure. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
f19de1bc67
commit
2c5bd1ef15
1 changed files with 5 additions and 3 deletions
|
@ -137,6 +137,7 @@
|
||||||
#define OMAP_ALIGNED __attribute__((aligned(sizeof(u32))))
|
#define OMAP_ALIGNED __attribute__((aligned(sizeof(u32))))
|
||||||
|
|
||||||
#define BUFLEN PAGE_SIZE
|
#define BUFLEN PAGE_SIZE
|
||||||
|
#define OMAP_SHA_DMA_THRESHOLD 256
|
||||||
|
|
||||||
struct omap_sham_dev;
|
struct omap_sham_dev;
|
||||||
|
|
||||||
|
@ -1435,10 +1436,11 @@ static int omap_sham_final(struct ahash_request *req)
|
||||||
/*
|
/*
|
||||||
* OMAP HW accel works only with buffers >= 9.
|
* OMAP HW accel works only with buffers >= 9.
|
||||||
* HMAC is always >= 9 because ipad == block size.
|
* HMAC is always >= 9 because ipad == block size.
|
||||||
* If buffersize is less than 240, we use fallback SW encoding,
|
* If buffersize is less than DMA_THRESHOLD, we use fallback
|
||||||
* as using DMA + HW in this case doesn't provide any benefit.
|
* SW encoding, as using DMA + HW in this case doesn't provide
|
||||||
|
* any benefit.
|
||||||
*/
|
*/
|
||||||
if (!ctx->digcnt && ctx->bufcnt < 240)
|
if (!ctx->digcnt && ctx->bufcnt < OMAP_SHA_DMA_THRESHOLD)
|
||||||
return omap_sham_final_shash(req);
|
return omap_sham_final_shash(req);
|
||||||
else if (ctx->bufcnt)
|
else if (ctx->bufcnt)
|
||||||
return omap_sham_enqueue(req, OP_FINAL);
|
return omap_sham_enqueue(req, OP_FINAL);
|
||||||
|
|
Loading…
Add table
Reference in a new issue