llc.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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, write to the
  17. * Free Software Foundation, Inc.,
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. */
  20. #ifndef __LOCAL_LLC_H_
  21. #define __LOCAL_LLC_H_
  22. #include <net/nfc/hci.h>
  23. #include <net/nfc/llc.h>
  24. #include <linux/skbuff.h>
  25. struct nfc_llc_ops {
  26. void *(*init) (struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv,
  27. rcv_to_hci_t rcv_to_hci, int tx_headroom,
  28. int tx_tailroom, int *rx_headroom, int *rx_tailroom,
  29. llc_failure_t llc_failure);
  30. void (*deinit) (struct nfc_llc *llc);
  31. int (*start) (struct nfc_llc *llc);
  32. int (*stop) (struct nfc_llc *llc);
  33. void (*rcv_from_drv) (struct nfc_llc *llc, struct sk_buff *skb);
  34. int (*xmit_from_hci) (struct nfc_llc *llc, struct sk_buff *skb);
  35. };
  36. struct nfc_llc_engine {
  37. const char *name;
  38. struct nfc_llc_ops *ops;
  39. struct list_head entry;
  40. };
  41. struct nfc_llc {
  42. void *data;
  43. struct nfc_llc_ops *ops;
  44. int rx_headroom;
  45. int rx_tailroom;
  46. };
  47. void *nfc_llc_get_data(struct nfc_llc *llc);
  48. int nfc_llc_register(const char *name, struct nfc_llc_ops *ops);
  49. void nfc_llc_unregister(const char *name);
  50. int nfc_llc_nop_register(void);
  51. #if defined(CONFIG_NFC_SHDLC)
  52. int nfc_llc_shdlc_register(void);
  53. #else
  54. static inline int nfc_llc_shdlc_register(void)
  55. {
  56. return 0;
  57. }
  58. #endif
  59. #endif /* __LOCAL_LLC_H_ */