Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306686
b: refs/heads/master
c: 1676f75
h: refs/heads/master
v: v3
  • Loading branch information
Eric Lapuyade authored and John W. Linville committed May 15, 2012
1 parent 85b219a commit 1960c26
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4ccb132801aeeb2cfd18c4b4b7fa0043ab37f80
refs/heads/master: 1676f75159c8091e865c33b61ad4934dfd3b7821
2 changes: 2 additions & 0 deletions trunk/include/net/nfc/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ struct nfc_hci_ops {
int (*data_exchange) (struct nfc_hci_dev *hdev,
struct nfc_target *target,
struct sk_buff *skb, struct sk_buff **res_skb);
int (*check_presence)(struct nfc_hci_dev *hdev,
struct nfc_target *target);
};

#define NFC_HCI_MAX_CUSTOM_GATES 15
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/net/nfc/shdlc.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ struct nfc_shdlc_ops {
int (*data_exchange) (struct nfc_shdlc *shdlc,
struct nfc_target *target,
struct sk_buff *skb, struct sk_buff **res_skb);
int (*check_presence)(struct nfc_shdlc *shdlc,
struct nfc_target *target);
};

enum shdlc_state {
Expand Down
12 changes: 12 additions & 0 deletions trunk/net/nfc/hci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,17 @@ static int hci_data_exchange(struct nfc_dev *nfc_dev, struct nfc_target *target,
return 0;
}

static int hci_check_presence(struct nfc_dev *nfc_dev,
struct nfc_target *target)
{
struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev);

if (hdev->ops->check_presence)
return hdev->ops->check_presence(hdev, target);

return 0;
}

struct nfc_ops hci_nfc_ops = {
.dev_up = hci_dev_up,
.dev_down = hci_dev_down,
Expand All @@ -582,6 +593,7 @@ struct nfc_ops hci_nfc_ops = {
.activate_target = hci_activate_target,
.deactivate_target = hci_deactivate_target,
.data_exchange = hci_data_exchange,
.check_presence = hci_check_presence,
};

struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
Expand Down
12 changes: 12 additions & 0 deletions trunk/net/nfc/hci/shdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,17 @@ static int nfc_shdlc_data_exchange(struct nfc_hci_dev *hdev,
return -EPERM;
}

static int nfc_shdlc_check_presence(struct nfc_hci_dev *hdev,
struct nfc_target *target)
{
struct nfc_shdlc *shdlc = nfc_hci_get_clientdata(hdev);

if (shdlc->ops->check_presence)
return shdlc->ops->check_presence(shdlc, target);

return 0;
}

static struct nfc_hci_ops shdlc_ops = {
.open = nfc_shdlc_open,
.close = nfc_shdlc_close,
Expand All @@ -825,6 +836,7 @@ static struct nfc_hci_ops shdlc_ops = {
.target_from_gate = nfc_shdlc_target_from_gate,
.complete_target_discovered = nfc_shdlc_complete_target_discovered,
.data_exchange = nfc_shdlc_data_exchange,
.check_presence = nfc_shdlc_check_presence,
};

struct nfc_shdlc *nfc_shdlc_allocate(struct nfc_shdlc_ops *ops,
Expand Down

0 comments on commit 1960c26

Please sign in to comment.