Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Link Layer Control manager
0004  *
0005  * Copyright (C) 2012  Intel Corporation. All rights reserved.
0006  */
0007 
0008 #ifndef __LOCAL_LLC_H_
0009 #define __LOCAL_LLC_H_
0010 
0011 #include <net/nfc/hci.h>
0012 #include <net/nfc/llc.h>
0013 #include <linux/skbuff.h>
0014 
0015 struct nfc_llc_ops {
0016     void *(*init) (struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv,
0017                rcv_to_hci_t rcv_to_hci, int tx_headroom,
0018                int tx_tailroom, int *rx_headroom, int *rx_tailroom,
0019                llc_failure_t llc_failure);
0020     void (*deinit) (struct nfc_llc *llc);
0021     int (*start) (struct nfc_llc *llc);
0022     int (*stop) (struct nfc_llc *llc);
0023     void (*rcv_from_drv) (struct nfc_llc *llc, struct sk_buff *skb);
0024     int (*xmit_from_hci) (struct nfc_llc *llc, struct sk_buff *skb);
0025 };
0026 
0027 struct nfc_llc_engine {
0028     const char *name;
0029     const struct nfc_llc_ops *ops;
0030     struct list_head entry;
0031 };
0032 
0033 struct nfc_llc {
0034     void *data;
0035     const struct nfc_llc_ops *ops;
0036     int rx_headroom;
0037     int rx_tailroom;
0038 };
0039 
0040 void *nfc_llc_get_data(struct nfc_llc *llc);
0041 
0042 int nfc_llc_register(const char *name, const struct nfc_llc_ops *ops);
0043 void nfc_llc_unregister(const char *name);
0044 
0045 int nfc_llc_nop_register(void);
0046 
0047 #if defined(CONFIG_NFC_SHDLC)
0048 int nfc_llc_shdlc_register(void);
0049 #else
0050 static inline int nfc_llc_shdlc_register(void)
0051 {
0052     return 0;
0053 }
0054 #endif
0055 
0056 #endif /* __LOCAL_LLC_H_ */