aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2014-09-13 04:28:49 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2014-09-23 20:02:24 -0400
commit9e87f9a9c4c4754508b2c2638fbde9e10c7a103b (patch)
tree1576b2a01cfa325e3860a6d4f0445a6944d1469f /net
parentfa0daa02fb063ecef39b7d421c3d9c4109381dc2 (diff)
NFC: nci: Add support for proprietary RF Protocols
In NFC Forum NCI specification, some RF Protocol values are reserved for proprietary use (from 0x80 to 0xfe). Some CLF vendor may need to use one value within this range for specific technology. Furthermore, some CLF may not becompliant with NFC Froum NCI specification 2.0 and therefore will not support RF Protocol value 0x06 for PROTOCOL_T5T as mention in a draft specification and in a recent push. Adding get_rf_protocol handle to the nci_ops structure will help to set the correct technology to target. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/nfc/nci/ntf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 25e44cebd60a..205b35f666db 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -167,6 +167,13 @@ static __u8 *nci_extract_rf_params_nfcv_passive_poll(struct nci_dev *ndev,
167 return data; 167 return data;
168} 168}
169 169
170__u32 nci_get_prop_rf_protocol(struct nci_dev *ndev, __u8 rf_protocol)
171{
172 if (ndev->ops->get_rfprotocol)
173 return ndev->ops->get_rfprotocol(ndev, rf_protocol);
174 return 0;
175}
176
170static int nci_add_new_protocol(struct nci_dev *ndev, 177static int nci_add_new_protocol(struct nci_dev *ndev,
171 struct nfc_target *target, 178 struct nfc_target *target,
172 __u8 rf_protocol, 179 __u8 rf_protocol,
@@ -195,7 +202,7 @@ static int nci_add_new_protocol(struct nci_dev *ndev,
195 else if (rf_protocol == NCI_RF_PROTOCOL_T5T) 202 else if (rf_protocol == NCI_RF_PROTOCOL_T5T)
196 protocol = NFC_PROTO_ISO15693_MASK; 203 protocol = NFC_PROTO_ISO15693_MASK;
197 else 204 else
198 protocol = 0; 205 protocol = nci_get_prop_rf_protocol(ndev, rf_protocol);
199 206
200 if (!(protocol & ndev->poll_prots)) { 207 if (!(protocol & ndev->poll_prots)) {
201 pr_err("the target found does not have the desired protocol\n"); 208 pr_err("the target found does not have the desired protocol\n");