linux/drivers/nfc/st-nci/se.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Secure Element driver for STMicroelectronics NFC NCI chip
 *
 * Copyright (C) 2014-2015 STMicroelectronics SAS. All rights reserved.
 */

#include <linux/module.h>
#include <linux/nfc.h>
#include <linux/delay.h>
#include <net/nfc/nci.h>
#include <net/nfc/nci_core.h>

#include "st-nci.h"

struct st_nci_pipe_info {} __packed;

/* Hosts */
#define ST_NCI_HOST_CONTROLLER_ID
#define ST_NCI_TERMINAL_HOST_ID
#define ST_NCI_UICC_HOST_ID
#define ST_NCI_ESE_HOST_ID

/* Gates */
#define ST_NCI_APDU_READER_GATE
#define ST_NCI_CONNECTIVITY_GATE

/* Pipes */
#define ST_NCI_DEVICE_MGNT_PIPE

/* Connectivity pipe only */
#define ST_NCI_SE_COUNT_PIPE_UICC
/* Connectivity + APDU Reader pipe */
#define ST_NCI_SE_COUNT_PIPE_EMBEDDED

#define ST_NCI_SE_TO_HOT_PLUG
#define ST_NCI_SE_TO_PIPES

#define ST_NCI_EVT_HOT_PLUG_IS_INHIBITED(x)

#define NCI_HCI_APDU_PARAM_ATR
#define NCI_HCI_ADMIN_PARAM_SESSION_IDENTITY
#define NCI_HCI_ADMIN_PARAM_WHITELIST
#define NCI_HCI_ADMIN_PARAM_HOST_LIST

#define ST_NCI_EVT_SE_HARD_RESET
#define ST_NCI_EVT_TRANSMIT_DATA
#define ST_NCI_EVT_WTX_REQUEST
#define ST_NCI_EVT_SE_SOFT_RESET
#define ST_NCI_EVT_SE_END_OF_APDU_TRANSFER
#define ST_NCI_EVT_HOT_PLUG

#define ST_NCI_SE_MODE_OFF
#define ST_NCI_SE_MODE_ON

#define ST_NCI_EVT_CONNECTIVITY
#define ST_NCI_EVT_TRANSACTION

#define ST_NCI_DM_GETINFO
#define ST_NCI_DM_GETINFO_PIPE_LIST
#define ST_NCI_DM_GETINFO_PIPE_INFO
#define ST_NCI_DM_PIPE_CREATED
#define ST_NCI_DM_PIPE_OPEN
#define ST_NCI_DM_RF_ACTIVE
#define ST_NCI_DM_DISCONNECT

#define ST_NCI_DM_IS_PIPE_OPEN(p)

#define ST_NCI_ATR_DEFAULT_BWI

/*
 * WT = 2^BWI/10[s], convert into msecs and add a secure
 * room by increasing by 2 this timeout
 */
#define ST_NCI_BWI_TO_TIMEOUT(x)
#define ST_NCI_ATR_GET_Y_FROM_TD(x)

/* If TA is present bit 0 is set */
#define ST_NCI_ATR_TA_PRESENT(x)
/* If TB is present bit 1 is set */
#define ST_NCI_ATR_TB_PRESENT(x)

#define ST_NCI_NUM_DEVICES

static DECLARE_BITMAP(dev_mask, ST_NCI_NUM_DEVICES);

/* Here are the mandatory pipe for st_nci */
static struct nci_hci_gate st_nci_gates[] =;

static u8 st_nci_se_get_bwi(struct nci_dev *ndev)
{}

static void st_nci_se_get_atr(struct nci_dev *ndev)
{}

int st_nci_hci_load_session(struct nci_dev *ndev)
{}
EXPORT_SYMBOL_GPL();

static void st_nci_hci_admin_event_received(struct nci_dev *ndev,
					      u8 event, struct sk_buff *skb)
{}

static int st_nci_hci_apdu_reader_event_received(struct nci_dev *ndev,
						   u8 event,
						   struct sk_buff *skb)
{}

/*
 * Returns:
 * <= 0: driver handled the event, skb consumed
 *    1: driver does not handle the event, please do standard processing
 */
static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev,
						u8 host, u8 event,
						struct sk_buff *skb)
{}

void st_nci_hci_event_received(struct nci_dev *ndev, u8 pipe,
				 u8 event, struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

void st_nci_hci_cmd_received(struct nci_dev *ndev, u8 pipe, u8 cmd,
			       struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

static int st_nci_control_se(struct nci_dev *ndev, u8 se_idx,
			     u8 state)
{}

int st_nci_disable_se(struct nci_dev *ndev, u32 se_idx)
{}
EXPORT_SYMBOL_GPL();

int st_nci_enable_se(struct nci_dev *ndev, u32 se_idx)
{}
EXPORT_SYMBOL_GPL();

static int st_nci_hci_network_init(struct nci_dev *ndev)
{}

int st_nci_discover_se(struct nci_dev *ndev)
{}
EXPORT_SYMBOL_GPL();

int st_nci_se_io(struct nci_dev *ndev, u32 se_idx,
		       u8 *apdu, size_t apdu_length,
		       se_io_cb_t cb, void *cb_context)
{}
EXPORT_SYMBOL();

static void st_nci_se_wt_timeout(struct timer_list *t)
{}

static void st_nci_se_activation_timeout(struct timer_list *t)
{}

int st_nci_se_init(struct nci_dev *ndev, struct st_nci_se_status *se_status)
{}
EXPORT_SYMBOL();

void st_nci_se_deinit(struct nci_dev *ndev)
{}
EXPORT_SYMBOL();