/* Restrictions on Data Descriptor List (DDL) and Entry (DDE) buffers * * From NX P8 workbook, sec 4.9.1 "842 details" * Each DDE buffer is 128 byte aligned * Each DDE buffer size is a multiple of 32 bytes (except the last) * The last DDE buffer size is a multiple of 8 bytes
*/ #define DDE_BUFFER_ALIGN (128) #define DDE_BUFFER_SIZE_MULT (32) #define DDE_BUFFER_LAST_MULT (8)
/* Arbitrary DDL length limit * Allows max buffer size of MAX-1 to MAX pages * (depending on alignment)
*/ #define DDL_LEN_MAX (17)
/** * This provides the driver's constraints. Different nx842 implementations * may have varying requirements. The constraints are: * @alignment: All buffers should be aligned to this * @multiple: All buffer lengths should be a multiple of this * @minimum: Buffer lengths must not be less than this amount * @maximum: Buffer lengths must not be more than this amount * * The constraints apply to all buffers and lengths, both input and output, * for both compression and decompression, except for the minimum which * only applies to compression input and decompression output; the * compressed data can be less than the minimum constraint. It can be * assumed that compressed data will always adhere to the multiple * constraint. * * The driver may succeed even if these constraints are violated; * however the driver can return failure or suffer reduced performance * if any constraint is not met.
*/ struct nx842_constraints { int alignment; int multiple; int minimum; int maximum;
};
struct nx842_crypto_header_group {
__be16 padding; /* unused bytes at start of group */
__be32 compressed_length; /* compressed bytes in group */
__be32 uncompressed_length; /* bytes after decompression */
} __packed;
struct nx842_crypto_header { /* New members MUST be added within the struct_group() macro below. */
struct_group_tagged(nx842_crypto_header_hdr, hdr,
__be16 magic; /* NX842_CRYPTO_MAGIC */
__be16 ignore; /* decompressed end bytes to ignore */
u8 groups; /* total groups in this header */
); struct nx842_crypto_header_group group[];
} __packed;
static_assert(offsetof(struct nx842_crypto_header, group) == sizeof(struct nx842_crypto_header_hdr), "struct member likely outside of struct_group_tagged()");
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.