Linux 4.1.16
[linux/fpc-iii.git] / net / nfc / hci / llc.h
blob5dad4c57ffb3c59f3a2759bd34fc26306c5de5bd
1 /*
2 * Link Layer Control manager
4 * Copyright (C) 2012 Intel Corporation. All rights reserved.
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.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19 #ifndef __LOCAL_LLC_H_
20 #define __LOCAL_LLC_H_
22 #include <net/nfc/hci.h>
23 #include <net/nfc/llc.h>
24 #include <linux/skbuff.h>
26 struct 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);
38 struct nfc_llc_engine {
39 const char *name;
40 struct nfc_llc_ops *ops;
41 struct list_head entry;
44 struct nfc_llc {
45 void *data;
46 struct nfc_llc_ops *ops;
47 int rx_headroom;
48 int rx_tailroom;
51 void *nfc_llc_get_data(struct nfc_llc *llc);
53 int nfc_llc_register(const char *name, struct nfc_llc_ops *ops);
54 void nfc_llc_unregister(const char *name);
56 int nfc_llc_nop_register(void);
58 #if defined(CONFIG_NFC_SHDLC)
59 int nfc_llc_shdlc_register(void);
60 #else
61 static inline int nfc_llc_shdlc_register(void)
63 return 0;
65 #endif
67 #endif /* __LOCAL_LLC_H_ */