llc.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Link Layer Control manager
  3. *
  4. * Copyright (C) 2012 Intel Corporation. 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_LLC_H_
  19. #define __LOCAL_LLC_H_
  20. #include <net/nfc/hci.h>
  21. #include <net/nfc/llc.h>
  22. #include <linux/skbuff.h>
  23. struct nfc_llc_ops {
  24. void *(*init) (struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv,
  25. rcv_to_hci_t rcv_to_hci, int tx_headroom,
  26. int tx_tailroom, int *rx_headroom, int *rx_tailroom,
  27. llc_failure_t llc_failure);
  28. void (*deinit) (struct nfc_llc *llc);
  29. int (*start) (struct nfc_llc *llc);
  30. int (*stop) (struct nfc_llc *llc);
  31. void (*rcv_from_drv) (struct nfc_llc *llc, struct sk_buff *skb);
  32. int (*xmit_from_hci) (struct nfc_llc *llc, struct sk_buff *skb);
  33. };
  34. struct nfc_llc_engine {
  35. const char *name;
  36. struct nfc_llc_ops *ops;
  37. struct list_head entry;
  38. };
  39. struct nfc_llc {
  40. void *data;
  41. struct nfc_llc_ops *ops;
  42. int rx_headroom;
  43. int rx_tailroom;
  44. };
  45. void *nfc_llc_get_data(struct nfc_llc *llc);
  46. int nfc_llc_register(const char *name, struct nfc_llc_ops *ops);
  47. void nfc_llc_unregister(const char *name);
  48. int nfc_llc_nop_register(void);
  49. #if defined(CONFIG_NFC_SHDLC)
  50. int nfc_llc_shdlc_register(void);
  51. #else
  52. static inline int nfc_llc_shdlc_register(void)
  53. {
  54. return 0;
  55. }
  56. #endif
  57. #endif /* __LOCAL_LLC_H_ */