Linux 4.2.1
[linux/fpc-iii.git] / drivers / nfc / st-nci / ndlc.h
blob6361005ef0037e5a5ad1f3ccb758f200ce230484
1 /*
2 * NCI based Driver for STMicroelectronics NFC Chip
4 * Copyright (C) 2014-2015 STMicroelectronics SAS. 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_NDLC_H_
20 #define __LOCAL_NDLC_H_
22 #include <linux/skbuff.h>
23 #include <net/nfc/nfc.h>
25 /* Low Level Transport description */
26 struct llt_ndlc {
27 struct nci_dev *ndev;
28 struct nfc_phy_ops *ops;
29 void *phy_id;
31 struct timer_list t1_timer;
32 bool t1_active;
34 struct timer_list t2_timer;
35 bool t2_active;
37 struct sk_buff_head rcv_q;
38 struct sk_buff_head send_q;
39 struct sk_buff_head ack_pending_q;
41 struct work_struct sm_work;
43 struct device *dev;
46 * < 0 if hardware error occurred
47 * and prevents normal operation.
49 int hard_fault;
50 int powered;
53 int ndlc_open(struct llt_ndlc *ndlc);
54 void ndlc_close(struct llt_ndlc *ndlc);
55 int ndlc_send(struct llt_ndlc *ndlc, struct sk_buff *skb);
56 void ndlc_recv(struct llt_ndlc *ndlc, struct sk_buff *skb);
57 int ndlc_probe(void *phy_id, struct nfc_phy_ops *phy_ops, struct device *dev,
58 int phy_headroom, int phy_tailroom, struct llt_ndlc **ndlc_id);
59 void ndlc_remove(struct llt_ndlc *ndlc);
60 #endif /* __LOCAL_NDLC_H__ */