/*
* Copyright 2016 Broadcom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation (the "GPL").
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/
/*
* This file works with the SPU2 version of the SPU. SPU2 has different message
* formats than the previous version of the SPU. All SPU message format
* differences should be hidden in the spux.c,h files.
*/
#include <linux/kernel.h>
#include <linux/string.h>
#include "util.h"
#include "spu.h"
#include "spu2.h"
#define SPU2_TX_STATUS_LEN 0 /* SPU2 has no STATUS in input packet */
/*
* Controlled by pkt_stat_cnt field in CRYPTO_SS_SPU0_CORE_SPU2_CONTROL0
* register. Defaults to 2.
*/
#define SPU2_RX_STATUS_LEN 2
enum spu2_proto_sel {
SPU2_PROTO_RESV = 0,
SPU2_MACSEC_SECTAG8_ECB = 1,
SPU2_MACSEC_SECTAG8_SCB = 2,
SPU2_MACSEC_SECTAG16 = 3,
SPU2_MACSEC_SECTAG16_8_XPN = 4,
SPU2_IPSEC = 5,
SPU2_IPSEC_ESN = 6,
SPU2_TLS_CIPHER = 7,
SPU2_TLS_AEAD = 8,
SPU2_DTLS_CIPHER = 9,
SPU2_DTLS_AEAD = 10
};
char *spu2_cipher_type_names[] = { "None", "AES128", "AES192", "AES256",
"DES", "3DES"
};
char *spu2_cipher_mode_names[] = { "ECB", "CBC", "CTR", "CFB", "OFB", "XTS",
"CCM", "GCM"
};
char *spu2_hash_type_names[] = { "None", "AES128", "AES192", "AES256",
"Reserved", "Reserved", "MD5", "SHA1", "SHA224", "SHA256", "SHA384",
"SHA512", "SHA512/224", "SHA512/256", "SHA3-224", "SHA3-256",
"SHA3-384", "SHA3-512"
};
char *spu2_