llc.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Link Layer Control manager
  4. *
  5. * Copyright (C) 2012 Intel Corporation. All rights reserved.
  6. */
  7. #ifndef __LOCAL_LLC_H_
  8. #define __LOCAL_LLC_H_
  9. #include <net/nfc/hci.h>
  10. #include <net/nfc/llc.h>
  11. #include <linux/skbuff.h>
  12. struct nfc_llc_ops {
  13. void *(*init) (struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv,
  14. rcv_to_hci_t rcv_to_hci, int tx_headroom,
  15. int tx_tailroom, int *rx_headroom, int *rx_tailroom,
  16. llc_failure_t llc_failure);
  17. void (*deinit) (struct nfc_llc *llc);
  18. int (*start) (struct nfc_llc *llc);
  19. int (*stop) (struct nfc_llc *llc);
  20. void (*rcv_from_drv) (struct nfc_llc *llc, struct sk_buff *skb);
  21. int (*xmit_from_hci) (struct nfc_llc *llc, struct sk_buff *skb);
  22. };
  23. struct nfc_llc_engine {
  24. const char *name;
  25. struct nfc_llc_ops *ops;
  26. struct list_head entry;
  27. };
  28. struct nfc_llc {
  29. void *data;
  30. struct nfc_llc_ops *ops;
  31. int rx_headroom;
  32. int rx_tailroom;
  33. };
  34. void *nfc_llc_get_data(struct nfc_llc *llc);
  35. int nfc_llc_register(const char *name, struct nfc_llc_ops *ops);
  36. void nfc_llc_unregister(const char *name);
  37. int nfc_llc_nop_register(void);
  38. #if defined(CONFIG_NFC_SHDLC)
  39. int nfc_llc_shdlc_register(void);
  40. #else
  41. static inline int nfc_llc_shdlc_register(void)
  42. {
  43. return 0;
  44. }
  45. #endif
  46. #endif /* __LOCAL_LLC_H_ */