crypto: ccp - CCP versioning support

Future hardware may introduce new algorithms wherein the
driver will need to manage resources for different versions
of the cryptographic coprocessor. This precursor patch
determines the version of the available device, and marks
and registers algorithms accordingly. A structure is added
which manages the version-specific data.

Signed-off-by: Gary R Hook <gary.hook@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Gary R Hook 2016-03-01 13:49:15 -06:00 committed by Herbert Xu
parent 553d2374db
commit c7019c4d73
7 changed files with 115 additions and 5 deletions

View file

@ -33,6 +33,18 @@ struct ccp_cmd;
*/
int ccp_present(void);
#define CCP_VSIZE 16
#define CCP_VMASK ((unsigned int)((1 << CCP_VSIZE) - 1))
#define CCP_VERSION(v, r) ((unsigned int)((v << CCP_VSIZE) \
| (r & CCP_VMASK)))
/**
* ccp_version - get the version of the CCP
*
* Returns a positive version number, or zero if no CCP
*/
unsigned int ccp_version(void);
/**
* ccp_enqueue_cmd - queue an operation for processing by the CCP
*
@ -65,6 +77,11 @@ static inline int ccp_present(void)
return -ENODEV;
}
static inline unsigned int ccp_version(void)
{
return 0;
}
static inline int ccp_enqueue_cmd(struct ccp_cmd *cmd)
{
return -ENODEV;