android_kernel_xiaomi_sm8350/net/qrtr/qrtr.h
Kaushal Hooda 5139e8a7df net: qrtr: Prevent wakeups using service id based filter
Filter data from adsp by using service id so that it will not
have wake up capable packets. Service id can be read from
DT file and wakeup could be avoided for corresponding packets.

Change-Id: Ibbb5f74bb153cdd333f8037b498c366d4f2ac5f8
Signed-off-by: Sarannya S <quic_sarannya@quicinc.com>
Signed-off-by: Kaushal Hooda <quic_khooda@quicinc.com>
2023-01-25 15:11:01 +05:30

46 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __QRTR_H_
#define __QRTR_H_
#include <linux/types.h>
struct sk_buff;
/* endpoint node id auto assignment */
#define QRTR_EP_NID_AUTO (-1)
#define QRTR_EP_NET_ID_AUTO (1)
#define QRTR_DEL_PROC_MAGIC 0xe111
#define MAX_NON_WAKE_SVC_LEN 5
/**
* struct qrtr_endpoint - endpoint handle
* @xmit: Callback for outgoing packets
*
* The socket buffer passed to the xmit function becomes owned by the endpoint
* driver. As such, when the driver is done with the buffer, it should
* call kfree_skb() on failure, or consume_skb() on success.
*/
struct qrtr_endpoint {
int (*xmit)(struct qrtr_endpoint *ep, struct sk_buff *skb);
/* private: not for endpoint use */
struct qrtr_node *node;
};
int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int net_id,
bool rt, u32 *svc_arr);
void qrtr_endpoint_unregister(struct qrtr_endpoint *ep);
int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len);
void qrtr_ns_init(void);
void qrtr_ns_remove(void);
int qrtr_peek_pkt_size(const void *data);
unsigned int qrtr_get_service_id(unsigned int node_id, unsigned int port_id);
#endif