qrtr.h 824 B

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