blob: 5dad4c57ffb3c59f3a2759bd34fc26306c5de5bd [file] [log] [blame]
Eric Lapuyade67cccfe2012-09-13 17:10:00 +02001/*
2 * Link Layer Control manager
3 *
4 * Copyright (C) 2012 Intel Corporation. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
Jeff Kirsher98b32de2013-12-06 08:56:16 -080016 * along with this program; if not, see <http://www.gnu.org/licenses/>.
Eric Lapuyade67cccfe2012-09-13 17:10:00 +020017 */
18
19#ifndef __LOCAL_LLC_H_
20#define __LOCAL_LLC_H_
21
22#include <net/nfc/hci.h>
23#include <net/nfc/llc.h>
24#include <linux/skbuff.h>
25
26struct nfc_llc_ops {
27 void *(*init) (struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv,
28 rcv_to_hci_t rcv_to_hci, int tx_headroom,
29 int tx_tailroom, int *rx_headroom, int *rx_tailroom,
30 llc_failure_t llc_failure);
31 void (*deinit) (struct nfc_llc *llc);
32 int (*start) (struct nfc_llc *llc);
33 int (*stop) (struct nfc_llc *llc);
34 void (*rcv_from_drv) (struct nfc_llc *llc, struct sk_buff *skb);
35 int (*xmit_from_hci) (struct nfc_llc *llc, struct sk_buff *skb);
36};
37
38struct nfc_llc_engine {
39 const char *name;
40 struct nfc_llc_ops *ops;
41 struct list_head entry;
42};
43
44struct nfc_llc {
45 void *data;
46 struct nfc_llc_ops *ops;
47 int rx_headroom;
48 int rx_tailroom;
49};
50
51void *nfc_llc_get_data(struct nfc_llc *llc);
52
53int nfc_llc_register(const char *name, struct nfc_llc_ops *ops);
54void nfc_llc_unregister(const char *name);
55
Eric Lapuyade8af00d42012-09-13 17:10:48 +020056int nfc_llc_nop_register(void);
John W. Linville8a14e8b2012-09-26 13:30:16 -040057
58#if defined(CONFIG_NFC_SHDLC)
Eric Lapuyade4a61cd62012-09-13 17:11:37 +020059int nfc_llc_shdlc_register(void);
John W. Linville8a14e8b2012-09-26 13:30:16 -040060#else
61static inline int nfc_llc_shdlc_register(void)
62{
63 return 0;
64}
65#endif
Eric Lapuyade8af00d42012-09-13 17:10:48 +020066
Eric Lapuyade67cccfe2012-09-13 17:10:00 +020067#endif /* __LOCAL_LLC_H_ */