^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __QRTR_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __QRTR_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) struct sk_buff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) /* endpoint node id auto assignment */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define QRTR_EP_NID_AUTO (-1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * struct qrtr_endpoint - endpoint handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * @xmit: Callback for outgoing packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * The socket buffer passed to the xmit function becomes owned by the endpoint
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * driver. As such, when the driver is done with the buffer, it should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * call kfree_skb() on failure, or consume_skb() on success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct qrtr_endpoint {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) int (*xmit)(struct qrtr_endpoint *ep, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) /* private: not for endpoint use */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct qrtr_node *node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int nid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) void qrtr_endpoint_unregister(struct qrtr_endpoint *ep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) void qrtr_ns_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) void qrtr_ns_remove(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #endif