ndlc.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * NCI based Driver for STMicroelectronics NFC Chip
  4. *
  5. * Copyright (C) 2014-2015 STMicroelectronics SAS. All rights reserved.
  6. */
  7. #ifndef __LOCAL_NDLC_H_
  8. #define __LOCAL_NDLC_H_
  9. #include <linux/skbuff.h>
  10. #include <net/nfc/nfc.h>
  11. struct st_nci_se_status;
  12. /* Low Level Transport description */
  13. struct llt_ndlc {
  14. struct nci_dev *ndev;
  15. const struct nfc_phy_ops *ops;
  16. void *phy_id;
  17. struct timer_list t1_timer;
  18. bool t1_active;
  19. struct timer_list t2_timer;
  20. bool t2_active;
  21. struct sk_buff_head rcv_q;
  22. struct sk_buff_head send_q;
  23. struct sk_buff_head ack_pending_q;
  24. struct work_struct sm_work;
  25. struct device *dev;
  26. /*
  27. * < 0 if hardware error occurred
  28. * and prevents normal operation.
  29. */
  30. int hard_fault;
  31. int powered;
  32. };
  33. int ndlc_open(struct llt_ndlc *ndlc);
  34. void ndlc_close(struct llt_ndlc *ndlc);
  35. int ndlc_send(struct llt_ndlc *ndlc, struct sk_buff *skb);
  36. void ndlc_recv(struct llt_ndlc *ndlc, struct sk_buff *skb);
  37. int ndlc_probe(void *phy_id, const struct nfc_phy_ops *phy_ops,
  38. struct device *dev, int phy_headroom, int phy_tailroom,
  39. struct llt_ndlc **ndlc_id, struct st_nci_se_status *se_status);
  40. void ndlc_remove(struct llt_ndlc *ndlc);
  41. #endif /* __LOCAL_NDLC_H__ */