qrtr.h 863 B

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