diff options
author | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2022-09-06 13:32:49 +0800 |
---|---|---|
committer | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2022-09-06 13:32:49 +0800 |
commit | 846e21e9f4ff37895a01274539511fdc0cd51ed2 (patch) | |
tree | 0680cfbfdc532a4461c9a6bd847a28d818983758 /qrtr/af_qrtr.c | |
parent | 4194a4d73a9ac567654a7515082b351d2bc6447a (diff) | |
download | cnss2-846e21e9f4ff37895a01274539511fdc0cd51ed2.tar.gz |
wcn6740: Update cnss/mhi/qmi/qrtr drivers
Migrate wlan codes to PostCS release
Bug: 245009352
Test: Regression Test
Change-Id: Icb90ab318ced3f028a19d6e329d509a23c3774a6
Diffstat (limited to 'qrtr/af_qrtr.c')
-rw-r--r-- | qrtr/af_qrtr.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/qrtr/af_qrtr.c b/qrtr/af_qrtr.c index a64af13..0ea15be 100644 --- a/qrtr/af_qrtr.c +++ b/qrtr/af_qrtr.c @@ -194,6 +194,8 @@ struct qrtr_node { struct wakeup_source *ws; void *ilc; + + struct xarray no_wake_svc; /* services that will not wake up APPS */ }; struct qrtr_tx_flow_waiter { @@ -874,6 +876,7 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len) unsigned int ver; size_t hdrlen; int errcode; + int svc_id; if (len == 0 || len & 3) return -EINVAL; @@ -961,6 +964,7 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len) /* All control packets and non-local destined data packets should be * queued to the worker for forwarding handling. */ + svc_id = qrtr_get_service_id(cb->src_node, cb->src_port); if (cb->type != QRTR_TYPE_DATA || cb->dst_node != qrtr_local_nid) { skb_queue_tail(&node->rx_queue, skb); kthread_queue_work(&node->kworker, &node->read_data); @@ -977,8 +981,8 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len) goto err; } - /* Force wakeup for all packets except for sensors */ - if (node->nid != 9) + /* Force wakeup based on services */ + if (!xa_load(&node->no_wake_svc, svc_id)) pm_wakeup_ws_event(node->ws, qrtr_wakeup_ms, true); qrtr_port_put(ipc); @@ -1184,13 +1188,16 @@ static void qrtr_hello_work(struct kthread_work *work) * @ep: endpoint to register * @nid: desired node id; may be QRTR_EP_NID_AUTO for auto-assignment * @rt: flag to notify real time low latency endpoint + * @no_wake: array of services to not wake up * Return: 0 on success; negative error code on failure * * The specified endpoint must have the xmit function pointer set on call. */ int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int net_id, - bool rt) + bool rt, struct qrtr_array *no_wake) { + int rc, i; + size_t size; struct qrtr_node *node; struct sched_param param = {.sched_priority = 1}; @@ -1220,6 +1227,17 @@ int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int net_id, if (rt) sched_setscheduler(node->task, SCHED_FIFO, ¶m); + xa_init(&node->no_wake_svc); + size = no_wake ? no_wake->size : 0; + for (i = 0; i < size; i++) { + rc = xa_insert(&node->no_wake_svc, no_wake->arr[i], node, + GFP_KERNEL); + if (rc) { + kfree(node); + return rc; + } + } + mutex_init(&node->qrtr_tx_lock); INIT_RADIX_TREE(&node->qrtr_tx_flow, GFP_KERNEL); init_waitqueue_head(&node->resume_tx); |