linux/drivers/nfc/nxp-nci/firmware.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Generic driver for NXP NCI NFC chips
 *
 * Copyright (C) 2014  NXP Semiconductors  All rights reserved.
 *
 * Author: Clément Perrochaud <[email protected]>
 *
 * Derived from PN544 device driver:
 * Copyright (C) 2012  Intel Corporation. All rights reserved.
 */

#include <linux/completion.h>
#include <linux/firmware.h>
#include <linux/nfc.h>
#include <asm/unaligned.h>

#include "nxp-nci.h"

/* Crypto operations can take up to 30 seconds */
#define NXP_NCI_FW_ANSWER_TIMEOUT

#define NXP_NCI_FW_CMD_RESET
#define NXP_NCI_FW_CMD_GETVERSION
#define NXP_NCI_FW_CMD_CHECKINTEGRITY
#define NXP_NCI_FW_CMD_WRITE
#define NXP_NCI_FW_CMD_READ
#define NXP_NCI_FW_CMD_GETSESSIONSTATE
#define NXP_NCI_FW_CMD_LOG
#define NXP_NCI_FW_CMD_FORCE
#define NXP_NCI_FW_CMD_GET_DIE_ID

#define NXP_NCI_FW_CHUNK_FLAG

#define NXP_NCI_FW_RESULT_OK
#define NXP_NCI_FW_RESULT_INVALID_ADDR
#define NXP_NCI_FW_RESULT_GENERIC_ERROR
#define NXP_NCI_FW_RESULT_UNKNOWN_CMD
#define NXP_NCI_FW_RESULT_ABORTED_CMD
#define NXP_NCI_FW_RESULT_PLL_ERROR
#define NXP_NCI_FW_RESULT_ADDR_RANGE_OFL_ERROR
#define NXP_NCI_FW_RESULT_BUFFER_OFL_ERROR
#define NXP_NCI_FW_RESULT_MEM_BSY
#define NXP_NCI_FW_RESULT_SIGNATURE_ERROR
#define NXP_NCI_FW_RESULT_FIRMWARE_VERSION_ERROR
#define NXP_NCI_FW_RESULT_PROTOCOL_ERROR
#define NXP_NCI_FW_RESULT_SFWU_DEGRADED
#define NXP_NCI_FW_RESULT_PH_STATUS_FIRST_CHUNK
#define NXP_NCI_FW_RESULT_PH_STATUS_NEXT_CHUNK
#define NXP_NCI_FW_RESULT_PH_STATUS_INTERNAL_ERROR_5

void nxp_nci_fw_work_complete(struct nxp_nci_info *info, int result)
{}

/* crc_ccitt cannot be used since it is computed MSB first and not LSB first */
static u16 nxp_nci_fw_crc(u8 const *buffer, size_t len)
{}

static int nxp_nci_fw_send_chunk(struct nxp_nci_info *info)
{}

static int nxp_nci_fw_send(struct nxp_nci_info *info)
{}

void nxp_nci_fw_work(struct work_struct *work)
{}

int nxp_nci_fw_download(struct nci_dev *ndev, const char *firmware_name)
{}

static int nxp_nci_fw_read_status(u8 stat)
{}

static u16 nxp_nci_fw_check_crc(struct sk_buff *skb)
{}

void nxp_nci_fw_recv_frame(struct nci_dev *ndev, struct sk_buff *skb)
{}
EXPORT_SYMBOL();