Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __QRTR_H_
0003 #define __QRTR_H_
0004 
0005 #include <linux/types.h>
0006 
0007 struct sk_buff;
0008 
0009 /* endpoint node id auto assignment */
0010 #define QRTR_EP_NID_AUTO (-1)
0011 
0012 /**
0013  * struct qrtr_endpoint - endpoint handle
0014  * @xmit: Callback for outgoing packets
0015  *
0016  * The socket buffer passed to the xmit function becomes owned by the endpoint
0017  * driver.  As such, when the driver is done with the buffer, it should
0018  * call kfree_skb() on failure, or consume_skb() on success.
0019  */
0020 struct qrtr_endpoint {
0021     int (*xmit)(struct qrtr_endpoint *ep, struct sk_buff *skb);
0022     /* private: not for endpoint use */
0023     struct qrtr_node *node;
0024 };
0025 
0026 int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int nid);
0027 
0028 void qrtr_endpoint_unregister(struct qrtr_endpoint *ep);
0029 
0030 int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len);
0031 
0032 int qrtr_ns_init(void);
0033 
0034 void qrtr_ns_remove(void);
0035 
0036 #endif