Skip to content

Commit

Permalink
NFC: Add an shdlc llc module to llc core
Browse files Browse the repository at this point in the history
This is used by HCI drivers such as the one for the pn544 which require
communications between HCI and the chip to use shdlc.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Eric Lapuyade authored and Samuel Ortiz committed Sep 24, 2012
1 parent 8af00d4 commit 4a61cd6
Show file tree
Hide file tree
Showing 5 changed files with 852 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/net/nfc/llc.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/skbuff.h>

#define LLC_NOP_NAME "nop"
#define LLC_SHDLC_NAME "shdlc"

typedef void (*rcv_to_hci_t) (struct nfc_hci_dev *hdev, struct sk_buff *skb);
typedef int (*xmit_to_drv_t) (struct nfc_hci_dev *hdev, struct sk_buff *skb);
Expand Down
2 changes: 1 addition & 1 deletion net/nfc/hci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
obj-$(CONFIG_NFC_HCI) += hci.o

hci-y := core.o hcp.o command.o llc.o llc_nop.o
hci-$(CONFIG_NFC_SHDLC) += shdlc.o
hci-$(CONFIG_NFC_SHDLC) += shdlc.o llc_shdlc.o
16 changes: 15 additions & 1 deletion net/nfc/hci/llc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,23 @@ static struct list_head llc_engines;

int nfc_llc_init(void)
{
int r;

INIT_LIST_HEAD(&llc_engines);

return nfc_llc_nop_register();
r = nfc_llc_nop_register();
if (r)
goto exit;

r = nfc_llc_shdlc_register();
if (r)
goto exit;

return 0;

exit:
nfc_llc_exit();
return r;
}
EXPORT_SYMBOL(nfc_llc_init);

Expand Down
1 change: 1 addition & 0 deletions net/nfc/hci/llc.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ int nfc_llc_register(const char *name, struct nfc_llc_ops *ops);
void nfc_llc_unregister(const char *name);

int nfc_llc_nop_register(void);
int nfc_llc_shdlc_register(void);

#endif /* __LOCAL_LLC_H_ */
Loading

0 comments on commit 4a61cd6

Please sign in to comment.