diff options
| author | John W. Linville <linville@tuxdriver.com> | 2014-12-04 11:27:40 -0500 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2014-12-04 11:27:40 -0500 |
| commit | 04bb7ecf8854186f47fb1ea321fc77e7bc931993 (patch) | |
| tree | d868ed692edebb2b2a31ecb16c5ab057fb3b008d /include | |
| parent | ea375117013dcca43ea4ffeb920735ab71c75ef3 (diff) | |
| parent | e479ce479743984a5d4581749f9aaa9c3bfd65e4 (diff) | |
Merge tag 'nfc-next-3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next
Samuel Ortiz <sameo@linux.intel.com> says:
"NFC: 3.19 pull request
This is the NFC pull request for 3.19.
With this one we get:
- NFC digital improvements for DEP support: Chaining, NACK and ATN
support added.
- NCI improvements: Support for p2p target, SE IO operand addition,
SE operands extensions to support proprietary implementations, and
a few fixes.
- NFC HCI improvements: OPEN_PIPE and NOTIFY_ALL_CLEARED support,
and SE IO operand addition.
- A bunch of minor improvements and fixes for STMicro st21nfcb and
st21nfca"
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/platform_data/st21nfca.h | 1 | ||||
| -rw-r--r-- | include/linux/platform_data/st21nfcb.h | 1 | ||||
| -rw-r--r-- | include/net/nfc/digital.h | 13 | ||||
| -rw-r--r-- | include/net/nfc/hci.h | 4 | ||||
| -rw-r--r-- | include/net/nfc/nci.h | 37 | ||||
| -rw-r--r-- | include/net/nfc/nci_core.h | 9 | ||||
| -rw-r--r-- | include/net/nfc/nfc.h | 2 | ||||
| -rw-r--r-- | include/uapi/linux/nfc.h | 23 |
8 files changed, 74 insertions, 16 deletions
diff --git a/include/linux/platform_data/st21nfca.h b/include/linux/platform_data/st21nfca.h index 1730312398ff..5087fff96d86 100644 --- a/include/linux/platform_data/st21nfca.h +++ b/include/linux/platform_data/st21nfca.h | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #define ST21NFCA_HCI_DRIVER_NAME "st21nfca_hci" | 24 | #define ST21NFCA_HCI_DRIVER_NAME "st21nfca_hci" |
| 25 | 25 | ||
| 26 | struct st21nfca_nfc_platform_data { | 26 | struct st21nfca_nfc_platform_data { |
| 27 | unsigned int gpio_irq; | ||
| 28 | unsigned int gpio_ena; | 27 | unsigned int gpio_ena; |
| 29 | unsigned int irq_polarity; | 28 | unsigned int irq_polarity; |
| 30 | }; | 29 | }; |
diff --git a/include/linux/platform_data/st21nfcb.h b/include/linux/platform_data/st21nfcb.h index 2d11f1f5efab..c3b432f5b63e 100644 --- a/include/linux/platform_data/st21nfcb.h +++ b/include/linux/platform_data/st21nfcb.h | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" | 24 | #define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" |
| 25 | 25 | ||
| 26 | struct st21nfcb_nfc_platform_data { | 26 | struct st21nfcb_nfc_platform_data { |
| 27 | unsigned int gpio_irq; | ||
| 28 | unsigned int gpio_reset; | 27 | unsigned int gpio_reset; |
| 29 | unsigned int irq_polarity; | 28 | unsigned int irq_polarity; |
| 30 | }; | 29 | }; |
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h index d9a5cf7ac1c4..0ae101eef0f4 100644 --- a/include/net/nfc/digital.h +++ b/include/net/nfc/digital.h | |||
| @@ -225,6 +225,19 @@ struct nfc_digital_dev { | |||
| 225 | u8 curr_protocol; | 225 | u8 curr_protocol; |
| 226 | u8 curr_rf_tech; | 226 | u8 curr_rf_tech; |
| 227 | u8 curr_nfc_dep_pni; | 227 | u8 curr_nfc_dep_pni; |
| 228 | u8 did; | ||
| 229 | |||
| 230 | u8 local_payload_max; | ||
| 231 | u8 remote_payload_max; | ||
| 232 | |||
| 233 | struct sk_buff *chaining_skb; | ||
| 234 | struct digital_data_exch *data_exch; | ||
| 235 | |||
| 236 | int atn_count; | ||
| 237 | int nack_count; | ||
| 238 | |||
| 239 | struct sk_buff *saved_skb; | ||
| 240 | unsigned int saved_skb_len; | ||
| 228 | 241 | ||
| 229 | u16 target_fsc; | 242 | u16 target_fsc; |
| 230 | 243 | ||
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 7ee8f4cc610b..14bd0e1c47fa 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
| @@ -57,10 +57,14 @@ struct nfc_hci_ops { | |||
| 57 | int (*discover_se)(struct nfc_hci_dev *dev); | 57 | int (*discover_se)(struct nfc_hci_dev *dev); |
| 58 | int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx); | 58 | int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx); |
| 59 | int (*disable_se)(struct nfc_hci_dev *dev, u32 se_idx); | 59 | int (*disable_se)(struct nfc_hci_dev *dev, u32 se_idx); |
| 60 | int (*se_io)(struct nfc_hci_dev *dev, u32 se_idx, | ||
| 61 | u8 *apdu, size_t apdu_length, | ||
| 62 | se_io_cb_t cb, void *cb_context); | ||
| 60 | }; | 63 | }; |
| 61 | 64 | ||
| 62 | /* Pipes */ | 65 | /* Pipes */ |
| 63 | #define NFC_HCI_INVALID_PIPE 0x80 | 66 | #define NFC_HCI_INVALID_PIPE 0x80 |
| 67 | #define NFC_HCI_DO_NOT_CREATE_PIPE 0x81 | ||
| 64 | #define NFC_HCI_LINK_MGMT_PIPE 0x00 | 68 | #define NFC_HCI_LINK_MGMT_PIPE 0x00 |
| 65 | #define NFC_HCI_ADMIN_PIPE 0x01 | 69 | #define NFC_HCI_ADMIN_PIPE 0x01 |
| 66 | 70 | ||
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h index 9eca9ae2280c..e7257a4653b4 100644 --- a/include/net/nfc/nci.h +++ b/include/net/nfc/nci.h | |||
| @@ -28,6 +28,8 @@ | |||
| 28 | #ifndef __NCI_H | 28 | #ifndef __NCI_H |
| 29 | #define __NCI_H | 29 | #define __NCI_H |
| 30 | 30 | ||
| 31 | #include <net/nfc/nfc.h> | ||
| 32 | |||
| 31 | /* NCI constants */ | 33 | /* NCI constants */ |
| 32 | #define NCI_MAX_NUM_MAPPING_CONFIGS 10 | 34 | #define NCI_MAX_NUM_MAPPING_CONFIGS 10 |
| 33 | #define NCI_MAX_NUM_RF_CONFIGS 10 | 35 | #define NCI_MAX_NUM_RF_CONFIGS 10 |
| @@ -73,6 +75,8 @@ | |||
| 73 | #define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83 | 75 | #define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83 |
| 74 | #define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85 | 76 | #define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85 |
| 75 | 77 | ||
| 78 | #define NCI_RF_TECH_MODE_LISTEN_MASK 0x80 | ||
| 79 | |||
| 76 | /* NCI RF Technologies */ | 80 | /* NCI RF Technologies */ |
| 77 | #define NCI_NFC_RF_TECHNOLOGY_A 0x00 | 81 | #define NCI_NFC_RF_TECHNOLOGY_A 0x00 |
| 78 | #define NCI_NFC_RF_TECHNOLOGY_B 0x01 | 82 | #define NCI_NFC_RF_TECHNOLOGY_B 0x01 |
| @@ -106,6 +110,17 @@ | |||
| 106 | 110 | ||
| 107 | /* NCI Configuration Parameter Tags */ | 111 | /* NCI Configuration Parameter Tags */ |
| 108 | #define NCI_PN_ATR_REQ_GEN_BYTES 0x29 | 112 | #define NCI_PN_ATR_REQ_GEN_BYTES 0x29 |
| 113 | #define NCI_LN_ATR_RES_GEN_BYTES 0x61 | ||
| 114 | #define NCI_LA_SEL_INFO 0x32 | ||
| 115 | #define NCI_LF_PROTOCOL_TYPE 0x50 | ||
| 116 | #define NCI_LF_CON_BITR_F 0x54 | ||
| 117 | |||
| 118 | /* NCI Configuration Parameters masks */ | ||
| 119 | #define NCI_LA_SEL_INFO_ISO_DEP_MASK 0x20 | ||
| 120 | #define NCI_LA_SEL_INFO_NFC_DEP_MASK 0x40 | ||
| 121 | #define NCI_LF_PROTOCOL_TYPE_NFC_DEP_MASK 0x02 | ||
| 122 | #define NCI_LF_CON_BITR_F_212 0x02 | ||
| 123 | #define NCI_LF_CON_BITR_F_424 0x04 | ||
| 109 | 124 | ||
| 110 | /* NCI Reset types */ | 125 | /* NCI Reset types */ |
| 111 | #define NCI_RESET_TYPE_KEEP_CONFIG 0x00 | 126 | #define NCI_RESET_TYPE_KEEP_CONFIG 0x00 |
| @@ -314,26 +329,31 @@ struct nci_core_intf_error_ntf { | |||
| 314 | struct rf_tech_specific_params_nfca_poll { | 329 | struct rf_tech_specific_params_nfca_poll { |
| 315 | __u16 sens_res; | 330 | __u16 sens_res; |
| 316 | __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */ | 331 | __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */ |
| 317 | __u8 nfcid1[10]; | 332 | __u8 nfcid1[NFC_NFCID1_MAXSIZE]; |
| 318 | __u8 sel_res_len; /* 0 or 1 Bytes */ | 333 | __u8 sel_res_len; /* 0 or 1 Bytes */ |
| 319 | __u8 sel_res; | 334 | __u8 sel_res; |
| 320 | } __packed; | 335 | } __packed; |
| 321 | 336 | ||
| 322 | struct rf_tech_specific_params_nfcb_poll { | 337 | struct rf_tech_specific_params_nfcb_poll { |
| 323 | __u8 sensb_res_len; | 338 | __u8 sensb_res_len; |
| 324 | __u8 sensb_res[12]; /* 11 or 12 Bytes */ | 339 | __u8 sensb_res[NFC_SENSB_RES_MAXSIZE]; /* 11 or 12 Bytes */ |
| 325 | } __packed; | 340 | } __packed; |
| 326 | 341 | ||
| 327 | struct rf_tech_specific_params_nfcf_poll { | 342 | struct rf_tech_specific_params_nfcf_poll { |
| 328 | __u8 bit_rate; | 343 | __u8 bit_rate; |
| 329 | __u8 sensf_res_len; | 344 | __u8 sensf_res_len; |
| 330 | __u8 sensf_res[18]; /* 16 or 18 Bytes */ | 345 | __u8 sensf_res[NFC_SENSF_RES_MAXSIZE]; /* 16 or 18 Bytes */ |
| 331 | } __packed; | 346 | } __packed; |
| 332 | 347 | ||
| 333 | struct rf_tech_specific_params_nfcv_poll { | 348 | struct rf_tech_specific_params_nfcv_poll { |
| 334 | __u8 res_flags; | 349 | __u8 res_flags; |
| 335 | __u8 dsfid; | 350 | __u8 dsfid; |
| 336 | __u8 uid[8]; /* 8 Bytes */ | 351 | __u8 uid[NFC_ISO15693_UID_MAXSIZE]; /* 8 Bytes */ |
| 352 | } __packed; | ||
| 353 | |||
| 354 | struct rf_tech_specific_params_nfcf_listen { | ||
| 355 | __u8 local_nfcid2_len; | ||
| 356 | __u8 local_nfcid2[NFC_NFCID2_MAXSIZE]; /* 0 or 8 Bytes */ | ||
| 337 | } __packed; | 357 | } __packed; |
| 338 | 358 | ||
| 339 | struct nci_rf_discover_ntf { | 359 | struct nci_rf_discover_ntf { |
| @@ -365,7 +385,12 @@ struct activation_params_nfcb_poll_iso_dep { | |||
| 365 | 385 | ||
| 366 | struct activation_params_poll_nfc_dep { | 386 | struct activation_params_poll_nfc_dep { |
| 367 | __u8 atr_res_len; | 387 | __u8 atr_res_len; |
| 368 | __u8 atr_res[63]; | 388 | __u8 atr_res[NFC_ATR_RES_MAXSIZE - 2]; /* ATR_RES from byte 3 */ |
| 389 | }; | ||
| 390 | |||
| 391 | struct activation_params_listen_nfc_dep { | ||
| 392 | __u8 atr_req_len; | ||
| 393 | __u8 atr_req[NFC_ATR_REQ_MAXSIZE - 2]; /* ATR_REQ from byte 3 */ | ||
| 369 | }; | 394 | }; |
| 370 | 395 | ||
| 371 | struct nci_rf_intf_activated_ntf { | 396 | struct nci_rf_intf_activated_ntf { |
| @@ -382,6 +407,7 @@ struct nci_rf_intf_activated_ntf { | |||
| 382 | struct rf_tech_specific_params_nfcb_poll nfcb_poll; | 407 | struct rf_tech_specific_params_nfcb_poll nfcb_poll; |
| 383 | struct rf_tech_specific_params_nfcf_poll nfcf_poll; | 408 | struct rf_tech_specific_params_nfcf_poll nfcf_poll; |
| 384 | struct rf_tech_specific_params_nfcv_poll nfcv_poll; | 409 | struct rf_tech_specific_params_nfcv_poll nfcv_poll; |
| 410 | struct rf_tech_specific_params_nfcf_listen nfcf_listen; | ||
| 385 | } rf_tech_specific_params; | 411 | } rf_tech_specific_params; |
| 386 | 412 | ||
| 387 | __u8 data_exch_rf_tech_and_mode; | 413 | __u8 data_exch_rf_tech_and_mode; |
| @@ -393,6 +419,7 @@ struct nci_rf_intf_activated_ntf { | |||
| 393 | struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep; | 419 | struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep; |
| 394 | struct activation_params_nfcb_poll_iso_dep nfcb_poll_iso_dep; | 420 | struct activation_params_nfcb_poll_iso_dep nfcb_poll_iso_dep; |
| 395 | struct activation_params_poll_nfc_dep poll_nfc_dep; | 421 | struct activation_params_poll_nfc_dep poll_nfc_dep; |
| 422 | struct activation_params_listen_nfc_dep listen_nfc_dep; | ||
| 396 | } activation_params; | 423 | } activation_params; |
| 397 | 424 | ||
| 398 | } __packed; | 425 | } __packed; |
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index 75d10e625c49..9e51bb4d841e 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | * | 4 | * |
| 5 | * Copyright (C) 2011 Texas Instruments, Inc. | 5 | * Copyright (C) 2011 Texas Instruments, Inc. |
| 6 | * Copyright (C) 2013 Intel Corporation. All rights reserved. | 6 | * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 7 | * Copyright (C) 2014 Marvell International Ltd. | ||
| 7 | * | 8 | * |
| 8 | * Written by Ilan Elias <ilane@ti.com> | 9 | * Written by Ilan Elias <ilane@ti.com> |
| 9 | * | 10 | * |
| @@ -49,6 +50,8 @@ enum nci_state { | |||
| 49 | NCI_W4_ALL_DISCOVERIES, | 50 | NCI_W4_ALL_DISCOVERIES, |
| 50 | NCI_W4_HOST_SELECT, | 51 | NCI_W4_HOST_SELECT, |
| 51 | NCI_POLL_ACTIVE, | 52 | NCI_POLL_ACTIVE, |
| 53 | NCI_LISTEN_ACTIVE, | ||
| 54 | NCI_LISTEN_SLEEP, | ||
| 52 | }; | 55 | }; |
| 53 | 56 | ||
| 54 | /* NCI timeouts */ | 57 | /* NCI timeouts */ |
| @@ -69,6 +72,12 @@ struct nci_ops { | |||
| 69 | int (*send)(struct nci_dev *ndev, struct sk_buff *skb); | 72 | int (*send)(struct nci_dev *ndev, struct sk_buff *skb); |
| 70 | int (*setup)(struct nci_dev *ndev); | 73 | int (*setup)(struct nci_dev *ndev); |
| 71 | __u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol); | 74 | __u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol); |
| 75 | int (*discover_se)(struct nci_dev *ndev); | ||
| 76 | int (*disable_se)(struct nci_dev *ndev, u32 se_idx); | ||
| 77 | int (*enable_se)(struct nci_dev *ndev, u32 se_idx); | ||
| 78 | int (*se_io)(struct nci_dev *ndev, u32 se_idx, | ||
| 79 | u8 *apdu, size_t apdu_length, | ||
| 80 | se_io_cb_t cb, void *cb_context); | ||
| 72 | }; | 81 | }; |
| 73 | 82 | ||
| 74 | #define NCI_MAX_SUPPORTED_RF_INTERFACES 4 | 83 | #define NCI_MAX_SUPPORTED_RF_INTERFACES 4 |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 6c583e244de2..12adb817c27a 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2011 Instituto Nokia de Tecnologia | 2 | * Copyright (C) 2011 Instituto Nokia de Tecnologia |
| 3 | * Copyright (C) 2014 Marvell International Ltd. | ||
| 3 | * | 4 | * |
| 4 | * Authors: | 5 | * Authors: |
| 5 | * Lauro Ramos Venancio <lauro.venancio@openbossa.org> | 6 | * Lauro Ramos Venancio <lauro.venancio@openbossa.org> |
| @@ -87,6 +88,7 @@ struct nfc_ops { | |||
| 87 | #define NFC_TARGET_IDX_ANY -1 | 88 | #define NFC_TARGET_IDX_ANY -1 |
| 88 | #define NFC_MAX_GT_LEN 48 | 89 | #define NFC_MAX_GT_LEN 48 |
| 89 | #define NFC_ATR_RES_GT_OFFSET 15 | 90 | #define NFC_ATR_RES_GT_OFFSET 15 |
| 91 | #define NFC_ATR_REQ_GT_OFFSET 14 | ||
| 90 | 92 | ||
| 91 | /** | 93 | /** |
| 92 | * struct nfc_target - NFC target descriptiom | 94 | * struct nfc_target - NFC target descriptiom |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index 9b19b4461928..8119255feae4 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
| @@ -116,6 +116,7 @@ enum nfc_commands { | |||
| 116 | NFC_EVENT_SE_TRANSACTION, | 116 | NFC_EVENT_SE_TRANSACTION, |
| 117 | NFC_CMD_GET_SE, | 117 | NFC_CMD_GET_SE, |
| 118 | NFC_CMD_SE_IO, | 118 | NFC_CMD_SE_IO, |
| 119 | NFC_CMD_ACTIVATE_TARGET, | ||
| 119 | /* private: internal use only */ | 120 | /* private: internal use only */ |
| 120 | __NFC_CMD_AFTER_LAST | 121 | __NFC_CMD_AFTER_LAST |
| 121 | }; | 122 | }; |
| @@ -196,15 +197,19 @@ enum nfc_sdp_attr { | |||
| 196 | }; | 197 | }; |
| 197 | #define NFC_SDP_ATTR_MAX (__NFC_SDP_ATTR_AFTER_LAST - 1) | 198 | #define NFC_SDP_ATTR_MAX (__NFC_SDP_ATTR_AFTER_LAST - 1) |
| 198 | 199 | ||
| 199 | #define NFC_DEVICE_NAME_MAXSIZE 8 | 200 | #define NFC_DEVICE_NAME_MAXSIZE 8 |
| 200 | #define NFC_NFCID1_MAXSIZE 10 | 201 | #define NFC_NFCID1_MAXSIZE 10 |
| 201 | #define NFC_NFCID2_MAXSIZE 8 | 202 | #define NFC_NFCID2_MAXSIZE 8 |
| 202 | #define NFC_NFCID3_MAXSIZE 10 | 203 | #define NFC_NFCID3_MAXSIZE 10 |
| 203 | #define NFC_SENSB_RES_MAXSIZE 12 | 204 | #define NFC_SENSB_RES_MAXSIZE 12 |
| 204 | #define NFC_SENSF_RES_MAXSIZE 18 | 205 | #define NFC_SENSF_RES_MAXSIZE 18 |
| 205 | #define NFC_GB_MAXSIZE 48 | 206 | #define NFC_ATR_REQ_MAXSIZE 64 |
| 206 | #define NFC_FIRMWARE_NAME_MAXSIZE 32 | 207 | #define NFC_ATR_RES_MAXSIZE 64 |
| 207 | #define NFC_ISO15693_UID_MAXSIZE 8 | 208 | #define NFC_ATR_REQ_GB_MAXSIZE 48 |
| 209 | #define NFC_ATR_RES_GB_MAXSIZE 47 | ||
| 210 | #define NFC_GB_MAXSIZE 48 | ||
| 211 | #define NFC_FIRMWARE_NAME_MAXSIZE 32 | ||
| 212 | #define NFC_ISO15693_UID_MAXSIZE 8 | ||
| 208 | 213 | ||
| 209 | /* NFC protocols */ | 214 | /* NFC protocols */ |
| 210 | #define NFC_PROTO_JEWEL 1 | 215 | #define NFC_PROTO_JEWEL 1 |
