blob: 2b848718f8fefe5e13fd9e479298f2c78bca47f1 [file] [log] [blame]
Courtney Cavinbdabad32016-05-06 07:09:08 -07001#ifndef __QRTR_H_
2#define __QRTR_H_
3
4#include <linux/types.h>
5
6struct sk_buff;
7
8/* endpoint node id auto assignment */
9#define QRTR_EP_NID_AUTO (-1)
10
11/**
12 * struct qrtr_endpoint - endpoint handle
13 * @xmit: Callback for outgoing packets
14 *
15 * The socket buffer passed to the xmit function becomes owned by the endpoint
16 * driver. As such, when the driver is done with the buffer, it should
17 * call kfree_skb() on failure, or consume_skb() on success.
18 */
19struct qrtr_endpoint {
20 int (*xmit)(struct qrtr_endpoint *ep, struct sk_buff *skb);
21 /* private: not for endpoint use */
22 struct qrtr_node *node;
23};
24
25int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int nid);
26
27void qrtr_endpoint_unregister(struct qrtr_endpoint *ep);
28
29int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len);
30
31#endif