linux/drivers/nfc/st21nfca/core.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * HCI based Driver for STMicroelectronics NFC Chip
 *
 * Copyright (C) 2014  STMicroelectronics SAS. All rights reserved.
 */

#include <linux/module.h>
#include <linux/nfc.h>
#include <net/nfc/hci.h>

#include "st21nfca.h"

#define DRIVER_DESC

#define FULL_VERSION_LEN

/* Proprietary gates, events, commands and registers */

/* Commands that apply to all RF readers */
#define ST21NFCA_RF_READER_CMD_PRESENCE_CHECK

#define ST21NFCA_RF_READER_ISO15693_GATE
#define ST21NFCA_RF_READER_ISO15693_INVENTORY

/*
 * Reader gate for communication with contact-less cards using Type A
 * protocol ISO14443-3 but not compliant with ISO14443-4
 */
#define ST21NFCA_RF_READER_14443_3_A_GATE
#define ST21NFCA_RF_READER_14443_3_A_UID
#define ST21NFCA_RF_READER_14443_3_A_ATQA
#define ST21NFCA_RF_READER_14443_3_A_SAK

#define ST21NFCA_RF_READER_F_DATARATE
#define ST21NFCA_RF_READER_F_DATARATE_106
#define ST21NFCA_RF_READER_F_DATARATE_212
#define ST21NFCA_RF_READER_F_DATARATE_424
#define ST21NFCA_RF_READER_F_POL_REQ
#define ST21NFCA_RF_READER_F_POL_REQ_DEFAULT
#define ST21NFCA_RF_READER_F_NFCID2
#define ST21NFCA_RF_READER_F_NFCID1

#define ST21NFCA_RF_CARD_F_MODE
#define ST21NFCA_RF_CARD_F_NFCID2_LIST
#define ST21NFCA_RF_CARD_F_NFCID1
#define ST21NFCA_RF_CARD_F_SENS_RES
#define ST21NFCA_RF_CARD_F_SEL_RES
#define ST21NFCA_RF_CARD_F_DATARATE
#define ST21NFCA_RF_CARD_F_DATARATE_212_424

#define ST21NFCA_DEVICE_MGNT_PIPE

#define ST21NFCA_DM_GETINFO
#define ST21NFCA_DM_GETINFO_PIPE_LIST
#define ST21NFCA_DM_GETINFO_PIPE_INFO
#define ST21NFCA_DM_PIPE_CREATED
#define ST21NFCA_DM_PIPE_OPEN
#define ST21NFCA_DM_RF_ACTIVE
#define ST21NFCA_DM_DISCONNECT

#define ST21NFCA_DM_IS_PIPE_OPEN(p)

#define ST21NFCA_NFC_MODE

#define ST21NFCA_EVT_HOT_PLUG
#define ST21NFCA_EVT_HOT_PLUG_IS_INHIBITED(x)

#define ST21NFCA_SE_TO_PIPES

static DECLARE_BITMAP(dev_mask, ST21NFCA_NUM_DEVICES);

static const struct nfc_hci_gate st21nfca_gates[] =;

struct st21nfca_pipe_info {} __packed;

/* Largest headroom needed for outgoing custom commands */
#define ST21NFCA_CMDS_HEADROOM

static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev)
{}

static int st21nfca_hci_open(struct nfc_hci_dev *hdev)
{}

static void st21nfca_hci_close(struct nfc_hci_dev *hdev)
{}

static int st21nfca_hci_ready(struct nfc_hci_dev *hdev)
{}

static int st21nfca_hci_xmit(struct nfc_hci_dev *hdev, struct sk_buff *skb)
{}

static int st21nfca_hci_start_poll(struct nfc_hci_dev *hdev,
				   u32 im_protocols, u32 tm_protocols)
{}

static void st21nfca_hci_stop_poll(struct nfc_hci_dev *hdev)
{}

static int st21nfca_get_iso14443_3_atqa(struct nfc_hci_dev *hdev, u16 *atqa)
{}

static int st21nfca_get_iso14443_3_sak(struct nfc_hci_dev *hdev, u8 *sak)
{}

static int st21nfca_get_iso14443_3_uid(struct nfc_hci_dev *hdev, u8 *uid,
				       int *len)
{}

static int st21nfca_get_iso15693_inventory(struct nfc_hci_dev *hdev,
					   struct nfc_target *target)
{}

static int st21nfca_hci_dep_link_up(struct nfc_hci_dev *hdev,
				    struct nfc_target *target, u8 comm_mode,
				    u8 *gb, size_t gb_len)
{}

static int st21nfca_hci_dep_link_down(struct nfc_hci_dev *hdev)
{}

static int st21nfca_hci_target_from_gate(struct nfc_hci_dev *hdev, u8 gate,
					 struct nfc_target *target)
{}

static int st21nfca_hci_complete_target_discovered(struct nfc_hci_dev *hdev,
						u8 gate,
						struct nfc_target *target)
{}

#define ST21NFCA_CB_TYPE_READER_ISO15693
static void st21nfca_hci_data_exchange_cb(void *context, struct sk_buff *skb,
					  int err)
{}

/*
 * Returns:
 * <= 0: driver handled the data exchange
 *    1: driver doesn't especially handle, please do standard processing
 */
static int st21nfca_hci_im_transceive(struct nfc_hci_dev *hdev,
				      struct nfc_target *target,
				      struct sk_buff *skb,
				      data_exchange_cb_t cb, void *cb_context)
{}

static int st21nfca_hci_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb)
{}

static int st21nfca_hci_check_presence(struct nfc_hci_dev *hdev,
				       struct nfc_target *target)
{}

static void st21nfca_hci_cmd_received(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd,
				struct sk_buff *skb)
{}

static int st21nfca_admin_event_received(struct nfc_hci_dev *hdev, 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 st21nfca_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe,
				       u8 event, struct sk_buff *skb)
{}

static const struct nfc_hci_ops st21nfca_hci_ops =;

int st21nfca_hci_probe(void *phy_id, const struct nfc_phy_ops *phy_ops,
		       char *llc_name, int phy_headroom, int phy_tailroom,
		       int phy_payload, struct nfc_hci_dev **hdev,
			   struct st21nfca_se_status *se_status)
{}
EXPORT_SYMBOL();

void st21nfca_hci_remove(struct nfc_hci_dev *hdev)
{}
EXPORT_SYMBOL();

MODULE_LICENSE();
MODULE_DESCRIPTION();