diff options
Diffstat (limited to 'include/net/nfc/nfc.h')
-rw-r--r-- | include/net/nfc/nfc.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 5eb80bb3cbb2..0e353f1658bb 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -68,8 +68,12 @@ struct nfc_ops { | |||
68 | void *cb_context); | 68 | void *cb_context); |
69 | int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); | 69 | int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); |
70 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); | 70 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); |
71 | int (*enable_se)(struct nfc_dev *dev, u32 secure_element); | 71 | int (*fw_upload)(struct nfc_dev *dev, const char *firmware_name); |
72 | int (*disable_se)(struct nfc_dev *dev, u32 secure_element); | 72 | |
73 | /* Secure Element API */ | ||
74 | int (*discover_se)(struct nfc_dev *dev); | ||
75 | int (*enable_se)(struct nfc_dev *dev, u32 se_idx); | ||
76 | int (*disable_se)(struct nfc_dev *dev, u32 se_idx); | ||
73 | }; | 77 | }; |
74 | 78 | ||
75 | #define NFC_TARGET_IDX_ANY -1 | 79 | #define NFC_TARGET_IDX_ANY -1 |
@@ -83,6 +87,8 @@ struct nfc_target { | |||
83 | u8 sel_res; | 87 | u8 sel_res; |
84 | u8 nfcid1_len; | 88 | u8 nfcid1_len; |
85 | u8 nfcid1[NFC_NFCID1_MAXSIZE]; | 89 | u8 nfcid1[NFC_NFCID1_MAXSIZE]; |
90 | u8 nfcid2_len; | ||
91 | u8 nfcid2[NFC_NFCID2_MAXSIZE]; | ||
86 | u8 sensb_res_len; | 92 | u8 sensb_res_len; |
87 | u8 sensb_res[NFC_SENSB_RES_MAXSIZE]; | 93 | u8 sensb_res[NFC_SENSB_RES_MAXSIZE]; |
88 | u8 sensf_res_len; | 94 | u8 sensf_res_len; |
@@ -91,6 +97,23 @@ struct nfc_target { | |||
91 | u8 logical_idx; | 97 | u8 logical_idx; |
92 | }; | 98 | }; |
93 | 99 | ||
100 | /** | ||
101 | * nfc_se - A structure for NFC accessible secure elements. | ||
102 | * | ||
103 | * @idx: The secure element index. User space will enable or | ||
104 | * disable a secure element by its index. | ||
105 | * @type: The secure element type. It can be SE_UICC or | ||
106 | * SE_EMBEDDED. | ||
107 | * @state: The secure element state, either enabled or disabled. | ||
108 | * | ||
109 | */ | ||
110 | struct nfc_se { | ||
111 | struct list_head list; | ||
112 | u32 idx; | ||
113 | u16 type; | ||
114 | u16 state; | ||
115 | }; | ||
116 | |||
94 | struct nfc_genl_data { | 117 | struct nfc_genl_data { |
95 | u32 poll_req_portid; | 118 | u32 poll_req_portid; |
96 | struct mutex genl_data_mutex; | 119 | struct mutex genl_data_mutex; |
@@ -104,6 +127,7 @@ struct nfc_dev { | |||
104 | int targets_generation; | 127 | int targets_generation; |
105 | struct device dev; | 128 | struct device dev; |
106 | bool dev_up; | 129 | bool dev_up; |
130 | bool fw_upload_in_progress; | ||
107 | u8 rf_mode; | 131 | u8 rf_mode; |
108 | bool polling; | 132 | bool polling; |
109 | struct nfc_target *active_target; | 133 | struct nfc_target *active_target; |
@@ -111,8 +135,7 @@ struct nfc_dev { | |||
111 | struct nfc_genl_data genl_data; | 135 | struct nfc_genl_data genl_data; |
112 | u32 supported_protocols; | 136 | u32 supported_protocols; |
113 | 137 | ||
114 | u32 supported_se; | 138 | struct list_head secure_elements; |
115 | u32 active_se; | ||
116 | 139 | ||
117 | int tx_headroom; | 140 | int tx_headroom; |
118 | int tx_tailroom; | 141 | int tx_tailroom; |
@@ -132,7 +155,6 @@ extern struct class nfc_class; | |||
132 | 155 | ||
133 | struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, | 156 | struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, |
134 | u32 supported_protocols, | 157 | u32 supported_protocols, |
135 | u32 supported_se, | ||
136 | int tx_headroom, | 158 | int tx_headroom, |
137 | int tx_tailroom); | 159 | int tx_tailroom); |
138 | 160 | ||
@@ -216,4 +238,7 @@ int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb); | |||
216 | 238 | ||
217 | void nfc_driver_failure(struct nfc_dev *dev, int err); | 239 | void nfc_driver_failure(struct nfc_dev *dev, int err); |
218 | 240 | ||
241 | int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); | ||
242 | int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); | ||
243 | |||
219 | #endif /* __NET_NFC_H */ | 244 | #endif /* __NET_NFC_H */ |