blob: 16809fa8fec7c25423678b34d623b5019b6aa63a [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * CAAM Error Reporting code header
4 *
5 * Copyright 2009-2011 Freescale Semiconductor, Inc.
6 */
7
8#ifndef CAAM_ERROR_H
9#define CAAM_ERROR_H
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000010
David Brazdil0f672f62019-12-10 10:32:29 +000011#include "desc.h"
12
13#define CAAM_ERROR_STR_MAX 302
14
15int caam_strstatus(struct device *dev, u32 status, bool qi_v2);
16
17#define caam_jr_strstatus(jrdev, status) caam_strstatus(jrdev, status, false)
18#define caam_qi2_strstatus(qidev, status) caam_strstatus(qidev, status, true)
19
20void caam_dump_sg(const char *prefix_str, int prefix_type,
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000021 int rowsize, int groupsize, struct scatterlist *sg,
22 size_t tlen, bool ascii);
David Brazdil0f672f62019-12-10 10:32:29 +000023
24static inline bool is_mdha(u32 algtype)
25{
26 return (algtype & OP_ALG_ALGSEL_MASK & ~OP_ALG_ALGSEL_SUBMASK) ==
27 OP_ALG_CHA_MDHA;
28}
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000029#endif /* CAAM_ERROR_H */