diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-07-17 15:31:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-17 15:31:33 -0400 |
commit | d369f7b2b257ad6369b72d39e2f989833754a9ce (patch) | |
tree | 0092a805f7a152ed161ee8995bb1672a7b74cced /net/nfc | |
parent | 23cb3b2121323443834296a8ecb582b8aeb78d75 (diff) | |
parent | 8a70e7f8f3081770238fbe19f78116af1d4b0652 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/hci/core.c | 20 | ||||
-rw-r--r-- | net/nfc/hci/hcp.c | 2 | ||||
-rw-r--r-- | net/nfc/nci/core.c | 3 |
3 files changed, 21 insertions, 4 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 36717cebfbb6..1ac7b3fac6c9 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c | |||
@@ -187,6 +187,7 @@ static int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate) | |||
187 | struct nfc_target *targets; | 187 | struct nfc_target *targets; |
188 | struct sk_buff *atqa_skb = NULL; | 188 | struct sk_buff *atqa_skb = NULL; |
189 | struct sk_buff *sak_skb = NULL; | 189 | struct sk_buff *sak_skb = NULL; |
190 | struct sk_buff *uid_skb = NULL; | ||
190 | int r; | 191 | int r; |
191 | 192 | ||
192 | pr_debug("from gate %d\n", gate); | 193 | pr_debug("from gate %d\n", gate); |
@@ -222,6 +223,19 @@ static int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate) | |||
222 | targets->sens_res = be16_to_cpu(*(u16 *)atqa_skb->data); | 223 | targets->sens_res = be16_to_cpu(*(u16 *)atqa_skb->data); |
223 | targets->sel_res = sak_skb->data[0]; | 224 | targets->sel_res = sak_skb->data[0]; |
224 | 225 | ||
226 | r = nfc_hci_get_param(hdev, NFC_HCI_RF_READER_A_GATE, | ||
227 | NFC_HCI_RF_READER_A_UID, &uid_skb); | ||
228 | if (r < 0) | ||
229 | goto exit; | ||
230 | |||
231 | if (uid_skb->len == 0 || uid_skb->len > NFC_NFCID1_MAXSIZE) { | ||
232 | r = -EPROTO; | ||
233 | goto exit; | ||
234 | } | ||
235 | |||
236 | memcpy(targets->nfcid1, uid_skb->data, uid_skb->len); | ||
237 | targets->nfcid1_len = uid_skb->len; | ||
238 | |||
225 | if (hdev->ops->complete_target_discovered) { | 239 | if (hdev->ops->complete_target_discovered) { |
226 | r = hdev->ops->complete_target_discovered(hdev, gate, | 240 | r = hdev->ops->complete_target_discovered(hdev, gate, |
227 | targets); | 241 | targets); |
@@ -257,6 +271,7 @@ exit: | |||
257 | kfree(targets); | 271 | kfree(targets); |
258 | kfree_skb(atqa_skb); | 272 | kfree_skb(atqa_skb); |
259 | kfree_skb(sak_skb); | 273 | kfree_skb(sak_skb); |
274 | kfree_skb(uid_skb); | ||
260 | 275 | ||
261 | return r; | 276 | return r; |
262 | } | 277 | } |
@@ -695,13 +710,12 @@ EXPORT_SYMBOL(nfc_hci_register_device); | |||
695 | 710 | ||
696 | void nfc_hci_unregister_device(struct nfc_hci_dev *hdev) | 711 | void nfc_hci_unregister_device(struct nfc_hci_dev *hdev) |
697 | { | 712 | { |
698 | struct hci_msg *msg; | 713 | struct hci_msg *msg, *n; |
699 | 714 | ||
700 | skb_queue_purge(&hdev->rx_hcp_frags); | 715 | skb_queue_purge(&hdev->rx_hcp_frags); |
701 | skb_queue_purge(&hdev->msg_rx_queue); | 716 | skb_queue_purge(&hdev->msg_rx_queue); |
702 | 717 | ||
703 | while ((msg = list_first_entry(&hdev->msg_tx_queue, struct hci_msg, | 718 | list_for_each_entry_safe(msg, n, &hdev->msg_tx_queue, msg_l) { |
704 | msg_l)) != NULL) { | ||
705 | list_del(&msg->msg_l); | 719 | list_del(&msg->msg_l); |
706 | skb_queue_purge(&msg->msg_frags); | 720 | skb_queue_purge(&msg->msg_frags); |
707 | kfree(msg); | 721 | kfree(msg); |
diff --git a/net/nfc/hci/hcp.c b/net/nfc/hci/hcp.c index 7212cf2c5785..f4dad1a89740 100644 --- a/net/nfc/hci/hcp.c +++ b/net/nfc/hci/hcp.c | |||
@@ -105,7 +105,7 @@ int nfc_hci_hcp_message_tx(struct nfc_hci_dev *hdev, u8 pipe, | |||
105 | } | 105 | } |
106 | 106 | ||
107 | mutex_lock(&hdev->msg_tx_mutex); | 107 | mutex_lock(&hdev->msg_tx_mutex); |
108 | list_add_tail(&hdev->msg_tx_queue, &cmd->msg_l); | 108 | list_add_tail(&cmd->msg_l, &hdev->msg_tx_queue); |
109 | mutex_unlock(&hdev->msg_tx_mutex); | 109 | mutex_unlock(&hdev->msg_tx_mutex); |
110 | 110 | ||
111 | queue_work(hdev->msg_tx_wq, &hdev->msg_tx_work); | 111 | queue_work(hdev->msg_tx_wq, &hdev->msg_tx_work); |
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 5bb4da680427..f81efe13985a 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__ | 28 | #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__ |
29 | 29 | ||
30 | #include <linux/module.h> | ||
30 | #include <linux/types.h> | 31 | #include <linux/types.h> |
31 | #include <linux/workqueue.h> | 32 | #include <linux/workqueue.h> |
32 | #include <linux/completion.h> | 33 | #include <linux/completion.h> |
@@ -880,3 +881,5 @@ static void nci_cmd_work(struct work_struct *work) | |||
880 | jiffies + msecs_to_jiffies(NCI_CMD_TIMEOUT)); | 881 | jiffies + msecs_to_jiffies(NCI_CMD_TIMEOUT)); |
881 | } | 882 | } |
882 | } | 883 | } |
884 | |||
885 | MODULE_LICENSE("GPL"); | ||