linux/drivers/media/pci/intel/ipu6/ipu6-cpd.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2013--2024 Intel Corporation
 */

#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/err.h>
#include <linux/dma-mapping.h>
#include <linux/gfp_types.h>
#include <linux/math64.h>
#include <linux/sizes.h>
#include <linux/types.h>

#include "ipu6.h"
#include "ipu6-bus.h"
#include "ipu6-cpd.h"

/* 15 entries + header*/
#define MAX_PKG_DIR_ENT_CNT
/* 2 qword per entry/header */
#define PKG_DIR_ENT_LEN
/* PKG_DIR size in bytes */
#define PKG_DIR_SIZE
/* _IUPKDR_ */
#define PKG_DIR_HDR_MARK

/* $CPD */
#define CPD_HDR_MARK

#define MAX_MANIFEST_SIZE
#define MAX_METADATA_SIZE

#define MAX_COMPONENT_ID
#define MAX_COMPONENT_VERSION

#define MANIFEST_IDX
#define METADATA_IDX
#define MODULEDATA_IDX
/*
 * PKG_DIR Entry (type == id)
 * 63:56        55      54:48   47:32   31:24   23:0
 * Rsvd         Rsvd    Type    Version Rsvd    Size
 */
#define PKG_DIR_SIZE_MASK
#define PKG_DIR_VERSION_MASK
#define PKG_DIR_TYPE_MASK

static inline const struct ipu6_cpd_ent *ipu6_cpd_get_entry(const void *cpd,
							    u8 idx)
{}

#define ipu6_cpd_get_manifest(cpd)
#define ipu6_cpd_get_metadata(cpd)
#define ipu6_cpd_get_moduledata(cpd)

static const struct ipu6_cpd_metadata_cmpnt_hdr *
ipu6_cpd_metadata_get_cmpnt(struct ipu6_device *isp, const void *metadata,
			    unsigned int metadata_size, u8 idx)
{}

static u32 ipu6_cpd_metadata_cmpnt_version(struct ipu6_device *isp,
					   const void *metadata,
					   unsigned int metadata_size, u8 idx)
{}

static int ipu6_cpd_metadata_get_cmpnt_id(struct ipu6_device *isp,
					  const void *metadata,
					  unsigned int metadata_size, u8 idx)
{}

static int ipu6_cpd_parse_module_data(struct ipu6_device *isp,
				      const void *module_data,
				      unsigned int module_data_size,
				      dma_addr_t dma_addr_module_data,
				      u64 *pkg_dir, const void *metadata,
				      unsigned int metadata_size)
{}

int ipu6_cpd_create_pkg_dir(struct ipu6_bus_device *adev, const void *src)
{}
EXPORT_SYMBOL_NS_GPL();

void ipu6_cpd_free_pkg_dir(struct ipu6_bus_device *adev)
{}
EXPORT_SYMBOL_NS_GPL();

static int ipu6_cpd_validate_cpd(struct ipu6_device *isp, const void *cpd,
				 unsigned long cpd_size,
				 unsigned long data_size)
{}

static int ipu6_cpd_validate_moduledata(struct ipu6_device *isp,
					const void *moduledata,
					u32 moduledata_size)
{}

static int ipu6_cpd_validate_metadata(struct ipu6_device *isp,
				      const void *metadata, u32 meta_size)
{}

int ipu6_cpd_validate_cpd_file(struct ipu6_device *isp, const void *cpd_file,
			       unsigned long cpd_file_size)
{}