diff options
author | Ilan Elias <ilane@ti.com> | 2011-12-22 04:51:54 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-04 14:30:43 -0500 |
commit | 288e0713f469c03dbc412153b5341d6dfc2c9907 (patch) | |
tree | 1155f2d96309acb17a23d4a384417c5de3940647 /net | |
parent | 9931df2692ddb7db092550ce063e674730176ecf (diff) |
NFC: Export a new attribute nfcid1 in target info
The nfcid1 is the NFC-A identifier.
It is exported as an attribute of the target info
(returned as a response to NFC_CMD_GET_TARGET).
Signed-off-by: Ilan Elias <ilane@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/nfc/nci/ntf.c | 6 | ||||
-rw-r--r-- | net/nfc/netlink.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c index 352f7a2321d9..b16a8dc2afbe 100644 --- a/net/nfc/nci/ntf.c +++ b/net/nfc/nci/ntf.c | |||
@@ -154,6 +154,12 @@ static void nci_target_found(struct nci_dev *ndev, | |||
154 | 154 | ||
155 | nfc_tgt.sens_res = ntf->rf_tech_specific_params.nfca_poll.sens_res; | 155 | nfc_tgt.sens_res = ntf->rf_tech_specific_params.nfca_poll.sens_res; |
156 | nfc_tgt.sel_res = ntf->rf_tech_specific_params.nfca_poll.sel_res; | 156 | nfc_tgt.sel_res = ntf->rf_tech_specific_params.nfca_poll.sel_res; |
157 | nfc_tgt.nfcid1_len = ntf->rf_tech_specific_params.nfca_poll.nfcid1_len; | ||
158 | if (nfc_tgt.nfcid1_len > 0) { | ||
159 | memcpy(nfc_tgt.nfcid1, | ||
160 | ntf->rf_tech_specific_params.nfca_poll.nfcid1, | ||
161 | nfc_tgt.nfcid1_len); | ||
162 | } | ||
157 | 163 | ||
158 | if (!(nfc_tgt.supported_protocols & ndev->poll_prots)) { | 164 | if (!(nfc_tgt.supported_protocols & ndev->poll_prots)) { |
159 | pr_debug("the target found does not have the desired protocol\n"); | 165 | pr_debug("the target found does not have the desired protocol\n"); |
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index 43a1c47756a7..6989dfa28ee2 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c | |||
@@ -67,6 +67,9 @@ static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target, | |||
67 | target->supported_protocols); | 67 | target->supported_protocols); |
68 | NLA_PUT_U16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res); | 68 | NLA_PUT_U16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res); |
69 | NLA_PUT_U8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res); | 69 | NLA_PUT_U8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res); |
70 | if (target->nfcid1_len > 0) | ||
71 | NLA_PUT(msg, NFC_ATTR_TARGET_NFCID1, target->nfcid1_len, | ||
72 | target->nfcid1); | ||
70 | 73 | ||
71 | return genlmsg_end(msg, hdr); | 74 | return genlmsg_end(msg, hdr); |
72 | 75 | ||