ndlc.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * NCI based Driver for STMicroelectronics NFC Chip
  3. *
  4. * Copyright (C) 2014-2015 STMicroelectronics SAS. 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
  16. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __LOCAL_NDLC_H_
  19. #define __LOCAL_NDLC_H_
  20. #include <linux/skbuff.h>
  21. #include <net/nfc/nfc.h>
  22. struct st_nci_se_status;
  23. /* Low Level Transport description */
  24. struct llt_ndlc {
  25. struct nci_dev *ndev;
  26. struct nfc_phy_ops *ops;
  27. void *phy_id;
  28. struct timer_list t1_timer;
  29. bool t1_active;
  30. struct timer_list t2_timer;
  31. bool t2_active;
  32. struct sk_buff_head rcv_q;
  33. struct sk_buff_head send_q;
  34. struct sk_buff_head ack_pending_q;
  35. struct work_struct sm_work;
  36. struct device *dev;
  37. /*
  38. * < 0 if hardware error occurred
  39. * and prevents normal operation.
  40. */
  41. int hard_fault;
  42. int powered;
  43. };
  44. int ndlc_open(struct llt_ndlc *ndlc);
  45. void ndlc_close(struct llt_ndlc *ndlc);
  46. int ndlc_send(struct llt_ndlc *ndlc, struct sk_buff *skb);
  47. void ndlc_recv(struct llt_ndlc *ndlc, struct sk_buff *skb);
  48. int ndlc_probe(void *phy_id, struct nfc_phy_ops *phy_ops, struct device *dev,
  49. int phy_headroom, int phy_tailroom, struct llt_ndlc **ndlc_id,
  50. struct st_nci_se_status *se_status);
  51. void ndlc_remove(struct llt_ndlc *ndlc);
  52. #endif /* __LOCAL_NDLC_H__ */