include/net/nfc/nci_core.h

Source file repositories/reference/linux-study-clean/include/net/nfc/nci_core.h

File Facts

System
Linux kernel
Corpus path
include/net/nfc/nci_core.h
Extension
.h
Size
13282 bytes
Lines
470
Domain
Networking Core
Bucket
Sockets, Protocols, Packet Path, And Network Policy
Inferred role
Networking Core: implementation source
Status
source implementation candidate

Why This File Exists

Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.

Dependency Surface

Detected Declarations

Annotated Snippet

struct nci_driver_ops {
	__u16 opcode;
	int (*rsp)(struct nci_dev *dev, struct sk_buff *skb);
	int (*ntf)(struct nci_dev *dev, struct sk_buff *skb);
};

struct nci_ops {
	int   (*init)(struct nci_dev *ndev);
	int   (*open)(struct nci_dev *ndev);
	int   (*close)(struct nci_dev *ndev);
	int   (*send)(struct nci_dev *ndev, struct sk_buff *skb);
	int   (*setup)(struct nci_dev *ndev);
	int   (*post_setup)(struct nci_dev *ndev);
	int   (*fw_download)(struct nci_dev *ndev, const char *firmware_name);
	__u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol);
	int   (*discover_se)(struct nci_dev *ndev);
	int   (*disable_se)(struct nci_dev *ndev, u32 se_idx);
	int   (*enable_se)(struct nci_dev *ndev, u32 se_idx);
	int   (*se_io)(struct nci_dev *ndev, u32 se_idx,
				u8 *apdu, size_t apdu_length,
				se_io_cb_t cb, void *cb_context);
	int   (*hci_load_session)(struct nci_dev *ndev);
	void  (*hci_event_received)(struct nci_dev *ndev, u8 pipe, u8 event,
				    struct sk_buff *skb);
	void  (*hci_cmd_received)(struct nci_dev *ndev, u8 pipe, u8 cmd,
				  struct sk_buff *skb);

	const struct nci_driver_ops *prop_ops;
	size_t n_prop_ops;

	const struct nci_driver_ops *core_ops;
	size_t n_core_ops;
};

#define NCI_MAX_SUPPORTED_RF_INTERFACES		4
#define NCI_MAX_DISCOVERED_TARGETS		10
#define NCI_MAX_NUM_NFCEE   255
#define NCI_MAX_CONN_ID		7
#define NCI_MAX_PROPRIETARY_CMD 64

struct nci_conn_info {
	struct list_head list;
	/* NCI specification 4.4.2 Connection Creation
	 * The combination of destination type and destination specific
	 * parameters shall uniquely identify a single destination for the
	 * Logical Connection
	 */
	struct dest_spec_params *dest_params;
	__u8	dest_type;
	__u8	conn_id;
	__u8	max_pkt_payload_len;

	atomic_t credits_cnt;
	__u8	 initial_num_credits;

	data_exchange_cb_t	data_exchange_cb;
	void *data_exchange_cb_context;

	struct sk_buff *rx_skb;
};

#define NCI_INVALID_CONN_ID 0x80

#define NCI_HCI_ANY_OPEN_PIPE      0x03

/* Gates */
#define NCI_HCI_ADMIN_GATE         0x00
#define NCI_HCI_LOOPBACK_GATE	   0x04
#define NCI_HCI_IDENTITY_MGMT_GATE 0x05
#define NCI_HCI_LINK_MGMT_GATE     0x06

/* Pipes */
#define NCI_HCI_LINK_MGMT_PIPE             0x00
#define NCI_HCI_ADMIN_PIPE                 0x01

/* Generic responses */
#define NCI_HCI_ANY_OK                     0x00
#define NCI_HCI_ANY_E_NOT_CONNECTED        0x01
#define NCI_HCI_ANY_E_CMD_PAR_UNKNOWN      0x02
#define NCI_HCI_ANY_E_NOK                  0x03
#define NCI_HCI_ANY_E_PIPES_FULL           0x04
#define NCI_HCI_ANY_E_REG_PAR_UNKNOWN      0x05
#define NCI_HCI_ANY_E_PIPE_NOT_OPENED      0x06
#define NCI_HCI_ANY_E_CMD_NOT_SUPPORTED    0x07
#define NCI_HCI_ANY_E_INHIBITED            0x08
#define NCI_HCI_ANY_E_TIMEOUT              0x09
#define NCI_HCI_ANY_E_REG_ACCESS_DENIED    0x0a
#define NCI_HCI_ANY_E_PIPE_ACCESS_DENIED   0x0b

#define NCI_HCI_DO_NOT_OPEN_PIPE           0x81

Annotation

Implementation Notes