summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2015-06-06 14:16:37 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2015-06-09 01:34:20 +0300
commitb6355e972aaab0173ce11a1650e7dba67f820918 (patch)
tree309ff674278ea4829fbe6970e513338cbaf9fde3 /include/net
parent2622e2a03cd7320f57a4f5171c242dccdab035dd (diff)
downloadlinux-b6355e972aaab0173ce11a1650e7dba67f820918.tar.xz
NFC: nci: Handle proprietary response and notifications
Allow for drivers to explicitly define handlers for each proprietary notifications and responses they expect to support. Reviewed-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/nfc/nci_core.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index d4dcc7199fd7..c49688c09853 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -66,6 +66,12 @@ enum nci_state {
struct nci_dev;
+struct nci_prop_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 (*open)(struct nci_dev *ndev);
int (*close)(struct nci_dev *ndev);
@@ -84,12 +90,16 @@ struct nci_ops {
struct sk_buff *skb);
void (*hci_cmd_received)(struct nci_dev *ndev, u8 pipe, u8 cmd,
struct sk_buff *skb);
+
+ struct nci_prop_ops *prop_ops;
+ size_t n_prop_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;
@@ -320,6 +330,10 @@ static inline void *nci_get_drvdata(struct nci_dev *ndev)
void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb);
void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb);
+int nci_prop_rsp_packet(struct nci_dev *ndev, __u16 opcode,
+ struct sk_buff *skb);
+int nci_prop_ntf_packet(struct nci_dev *ndev, __u16 opcode,
+ struct sk_buff *skb);
void nci_rx_data_packet(struct nci_dev *ndev, struct sk_buff *skb);
int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload);
int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb);