diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-07-03 18:14:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-09 16:42:24 -0400 |
commit | 01d719a2287ec34f631800d10f1fad3c134c3e89 (patch) | |
tree | 9b718a6c24ad36433f15febdc52ed25b23f41847 /net/nfc | |
parent | a1fbbf1817c671a396b7ae3832bdfab63acea2e5 (diff) |
NFC: Add ISO 14443 type B protocol
Some devices (e.g. Sony's PaSoRi) can not do type B polling, so we have
to make a distinction between ISO14443 type A and B poll modes.
Cc: Eric Lapuyade <eric.lapuyade@intel.com>
Cc: Ilan Elias <ilane@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/hci/core.c | 2 | ||||
-rw-r--r-- | net/nfc/nci/core.c | 5 | ||||
-rw-r--r-- | net/nfc/nci/ntf.c | 5 |
3 files changed, 8 insertions, 4 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 4ccc518f56eb..36717cebfbb6 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c | |||
@@ -230,7 +230,7 @@ static int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate) | |||
230 | } | 230 | } |
231 | break; | 231 | break; |
232 | case NFC_HCI_RF_READER_B_GATE: | 232 | case NFC_HCI_RF_READER_B_GATE: |
233 | targets->supported_protocols = NFC_PROTO_ISO14443_MASK; | 233 | targets->supported_protocols = NFC_PROTO_ISO14443_B_MASK; |
234 | break; | 234 | break; |
235 | default: | 235 | default: |
236 | if (hdev->ops->target_from_gate) | 236 | if (hdev->ops->target_from_gate) |
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 766a02b1dfa1..5bb4da680427 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
@@ -194,7 +194,7 @@ static void nci_rf_discover_req(struct nci_dev *ndev, unsigned long opt) | |||
194 | } | 194 | } |
195 | 195 | ||
196 | if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && | 196 | if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && |
197 | (protocols & NFC_PROTO_ISO14443_MASK)) { | 197 | (protocols & NFC_PROTO_ISO14443_B_MASK)) { |
198 | cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode = | 198 | cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode = |
199 | NCI_NFC_B_PASSIVE_POLL_MODE; | 199 | NCI_NFC_B_PASSIVE_POLL_MODE; |
200 | cmd.disc_configs[cmd.num_disc_configs].frequency = 1; | 200 | cmd.disc_configs[cmd.num_disc_configs].frequency = 1; |
@@ -486,7 +486,8 @@ static int nci_activate_target(struct nfc_dev *nfc_dev, | |||
486 | param.rf_protocol = NCI_RF_PROTOCOL_T2T; | 486 | param.rf_protocol = NCI_RF_PROTOCOL_T2T; |
487 | else if (protocol == NFC_PROTO_FELICA) | 487 | else if (protocol == NFC_PROTO_FELICA) |
488 | param.rf_protocol = NCI_RF_PROTOCOL_T3T; | 488 | param.rf_protocol = NCI_RF_PROTOCOL_T3T; |
489 | else if (protocol == NFC_PROTO_ISO14443) | 489 | else if (protocol == NFC_PROTO_ISO14443 || |
490 | protocol == NFC_PROTO_ISO14443_B) | ||
490 | param.rf_protocol = NCI_RF_PROTOCOL_ISO_DEP; | 491 | param.rf_protocol = NCI_RF_PROTOCOL_ISO_DEP; |
491 | else | 492 | else |
492 | param.rf_protocol = NCI_RF_PROTOCOL_NFC_DEP; | 493 | param.rf_protocol = NCI_RF_PROTOCOL_NFC_DEP; |
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c index 2ab196a9f228..af7a93b04393 100644 --- a/net/nfc/nci/ntf.c +++ b/net/nfc/nci/ntf.c | |||
@@ -170,7 +170,10 @@ static int nci_add_new_protocol(struct nci_dev *ndev, | |||
170 | if (rf_protocol == NCI_RF_PROTOCOL_T2T) | 170 | if (rf_protocol == NCI_RF_PROTOCOL_T2T) |
171 | protocol = NFC_PROTO_MIFARE_MASK; | 171 | protocol = NFC_PROTO_MIFARE_MASK; |
172 | else if (rf_protocol == NCI_RF_PROTOCOL_ISO_DEP) | 172 | else if (rf_protocol == NCI_RF_PROTOCOL_ISO_DEP) |
173 | protocol = NFC_PROTO_ISO14443_MASK; | 173 | if (rf_tech_and_mode == NCI_NFC_A_PASSIVE_POLL_MODE) |
174 | protocol = NFC_PROTO_ISO14443_MASK; | ||
175 | else | ||
176 | protocol = NFC_PROTO_ISO14443_B_MASK; | ||
174 | else if (rf_protocol == NCI_RF_PROTOCOL_T3T) | 177 | else if (rf_protocol == NCI_RF_PROTOCOL_T3T) |
175 | protocol = NFC_PROTO_FELICA_MASK; | 178 | protocol = NFC_PROTO_FELICA_MASK; |
176 | else | 179 | else |