Lines Matching refs:pSchedContext
76 static QDF_STATUS cds_alloc_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext);
173 static int cds_sched_find_attach_cpu(p_cds_sched_context pSchedContext, in cds_sched_find_attach_cpu() argument
195 if (pSchedContext->conf_rx_thread_cpu_mask) { in cds_sched_find_attach_cpu()
196 if (pSchedContext->conf_rx_thread_cpu_mask & in cds_sched_find_attach_cpu()
212 (int)pSchedContext->high_throughput_required, in cds_sched_find_attach_cpu()
213 &pSchedContext->rx_thread_cpu_mask, in cds_sched_find_attach_cpu()
216 if (!cpumask_equal(&pSchedContext->rx_thread_cpu_mask, &new_mask)) { in cds_sched_find_attach_cpu()
218 cpumask_copy(&pSchedContext->rx_thread_cpu_mask, &new_mask); in cds_sched_find_attach_cpu()
223 cds_set_cpus_allowed_ptr_with_mask(pSchedContext->ol_rx_thread, in cds_sched_find_attach_cpu()
234 p_cds_sched_context pSchedContext = get_cds_sched_ctxt(); in cds_sched_handle_cpu_hot_plug() local
236 if (!pSchedContext) { in cds_sched_handle_cpu_hot_plug()
244 mutex_lock(&pSchedContext->affinity_lock); in cds_sched_handle_cpu_hot_plug()
245 if (cds_sched_find_attach_cpu(pSchedContext, in cds_sched_handle_cpu_hot_plug()
246 pSchedContext->high_throughput_required)) { in cds_sched_handle_cpu_hot_plug()
248 mutex_unlock(&pSchedContext->affinity_lock); in cds_sched_handle_cpu_hot_plug()
251 mutex_unlock(&pSchedContext->affinity_lock); in cds_sched_handle_cpu_hot_plug()
313 p_cds_sched_context pSchedContext = get_cds_sched_ctxt(); in cds_sched_handle_throughput_req() local
315 if (!pSchedContext) { in cds_sched_handle_throughput_req()
325 mutex_lock(&pSchedContext->affinity_lock); in cds_sched_handle_throughput_req()
326 if (pSchedContext->high_throughput_required != high_tput_required) { in cds_sched_handle_throughput_req()
327 pSchedContext->high_throughput_required = high_tput_required; in cds_sched_handle_throughput_req()
328 if (cds_sched_find_attach_cpu(pSchedContext, in cds_sched_handle_throughput_req()
330 mutex_unlock(&pSchedContext->affinity_lock); in cds_sched_handle_throughput_req()
334 mutex_unlock(&pSchedContext->affinity_lock); in cds_sched_handle_throughput_req()
372 p_cds_sched_context pSchedContext = get_cds_sched_ctxt(); in __cds_cpu_hotplug_notify() local
375 if (!pSchedContext || !pSchedContext->ol_rx_thread) in __cds_cpu_hotplug_notify()
414 if (pSchedContext->ol_rx_thread && in __cds_cpu_hotplug_notify()
415 !cds_set_cpus_allowed_ptr_with_cpu(pSchedContext->ol_rx_thread, in __cds_cpu_hotplug_notify()
451 p_cds_sched_context pSchedContext, in cds_sched_open() argument
456 if ((!p_cds_context) || (!pSchedContext)) { in cds_sched_open()
464 qdf_mem_zero(pSchedContext, sizeof(cds_sched_context)); in cds_sched_open()
466 spin_lock_init(&pSchedContext->ol_rx_thread_lock); in cds_sched_open()
467 init_waitqueue_head(&pSchedContext->ol_rx_wait_queue); in cds_sched_open()
468 init_completion(&pSchedContext->ol_rx_start_event); in cds_sched_open()
469 init_completion(&pSchedContext->ol_suspend_rx_event); in cds_sched_open()
470 init_completion(&pSchedContext->ol_resume_rx_event); in cds_sched_open()
471 init_completion(&pSchedContext->ol_rx_shutdown); in cds_sched_open()
472 pSchedContext->ol_rx_event_flag = 0; in cds_sched_open()
473 spin_lock_init(&pSchedContext->ol_rx_queue_lock); in cds_sched_open()
474 spin_lock_init(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_sched_open()
475 INIT_LIST_HEAD(&pSchedContext->ol_rx_thread_queue); in cds_sched_open()
476 spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_sched_open()
477 INIT_LIST_HEAD(&pSchedContext->cds_ol_rx_pkt_freeq); in cds_sched_open()
478 spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_sched_open()
479 if (cds_alloc_ol_rx_pkt_freeq(pSchedContext) != QDF_STATUS_SUCCESS) in cds_sched_open()
481 qdf_cpuhp_register(&pSchedContext->cpuhp_event_handle, in cds_sched_open()
485 mutex_init(&pSchedContext->affinity_lock); in cds_sched_open()
486 pSchedContext->high_throughput_required = false; in cds_sched_open()
487 pSchedContext->rx_affinity_required = false; in cds_sched_open()
488 pSchedContext->active_staid = OL_TXRX_INVALID_LOCAL_PEER_ID; in cds_sched_open()
490 gp_cds_sched_context = pSchedContext; in cds_sched_open()
493 pSchedContext->ol_rx_thread = kthread_create(cds_ol_rx_thread, in cds_sched_open()
494 pSchedContext, in cds_sched_open()
496 if (IS_ERR(pSchedContext->ol_rx_thread)) { in cds_sched_open()
502 wake_up_process(pSchedContext->ol_rx_thread); in cds_sched_open()
504 wait_for_completion_interruptible(&pSchedContext->ol_rx_start_event); in cds_sched_open()
512 qdf_cpuhp_unregister(&pSchedContext->cpuhp_event_handle); in cds_sched_open()
523 void cds_free_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext) in cds_free_ol_rx_pkt_freeq() argument
527 spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_free_ol_rx_pkt_freeq()
528 while (!list_empty(&pSchedContext->cds_ol_rx_pkt_freeq)) { in cds_free_ol_rx_pkt_freeq()
529 pkt = list_entry((&pSchedContext->cds_ol_rx_pkt_freeq)->next, in cds_free_ol_rx_pkt_freeq()
532 spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_free_ol_rx_pkt_freeq()
534 spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_free_ol_rx_pkt_freeq()
536 spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_free_ol_rx_pkt_freeq()
548 static QDF_STATUS cds_alloc_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext) in cds_alloc_ol_rx_pkt_freeq() argument
559 spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_alloc_ol_rx_pkt_freeq()
560 list_add_tail(&pkt->list, &pSchedContext->cds_ol_rx_pkt_freeq); in cds_alloc_ol_rx_pkt_freeq()
561 spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_alloc_ol_rx_pkt_freeq()
567 spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_alloc_ol_rx_pkt_freeq()
568 list_for_each_entry_safe(pkt, tmp, &pSchedContext->cds_ol_rx_pkt_freeq, in cds_alloc_ol_rx_pkt_freeq()
571 spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_alloc_ol_rx_pkt_freeq()
573 spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_alloc_ol_rx_pkt_freeq()
575 spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_alloc_ol_rx_pkt_freeq()
580 cds_free_ol_rx_pkt(p_cds_sched_context pSchedContext, in cds_free_ol_rx_pkt() argument
584 spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_free_ol_rx_pkt()
585 list_add_tail(&pkt->list, &pSchedContext->cds_ol_rx_pkt_freeq); in cds_free_ol_rx_pkt()
586 spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_free_ol_rx_pkt()
589 struct cds_ol_rx_pkt *cds_alloc_ol_rx_pkt(p_cds_sched_context pSchedContext) in cds_alloc_ol_rx_pkt() argument
593 spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_alloc_ol_rx_pkt()
594 if (list_empty(&pSchedContext->cds_ol_rx_pkt_freeq)) { in cds_alloc_ol_rx_pkt()
595 spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_alloc_ol_rx_pkt()
598 pkt = list_first_entry(&pSchedContext->cds_ol_rx_pkt_freeq, in cds_alloc_ol_rx_pkt()
601 spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); in cds_alloc_ol_rx_pkt()
606 cds_indicate_rxpkt(p_cds_sched_context pSchedContext, in cds_indicate_rxpkt() argument
609 spin_lock_bh(&pSchedContext->ol_rx_queue_lock); in cds_indicate_rxpkt()
610 list_add_tail(&pkt->list, &pSchedContext->ol_rx_thread_queue); in cds_indicate_rxpkt()
611 spin_unlock_bh(&pSchedContext->ol_rx_queue_lock); in cds_indicate_rxpkt()
612 set_bit(RX_POST_EVENT, &pSchedContext->ol_rx_event_flag); in cds_indicate_rxpkt()
613 wake_up_interruptible(&pSchedContext->ol_rx_wait_queue); in cds_indicate_rxpkt()
641 void cds_drop_rxpkt_by_staid(p_cds_sched_context pSchedContext, uint16_t staId) in cds_drop_rxpkt_by_staid() argument
649 spin_lock_bh(&pSchedContext->ol_rx_queue_lock); in cds_drop_rxpkt_by_staid()
650 if (list_empty(&pSchedContext->ol_rx_thread_queue)) { in cds_drop_rxpkt_by_staid()
651 spin_unlock_bh(&pSchedContext->ol_rx_queue_lock); in cds_drop_rxpkt_by_staid()
654 list_for_each_entry_safe(pkt, tmp, &pSchedContext->ol_rx_thread_queue, in cds_drop_rxpkt_by_staid()
659 spin_unlock_bh(&pSchedContext->ol_rx_queue_lock); in cds_drop_rxpkt_by_staid()
669 cds_free_ol_rx_pkt(pSchedContext, pkt); in cds_drop_rxpkt_by_staid()
672 while (pSchedContext->active_staid == staId && in cds_drop_rxpkt_by_staid()
681 if (pSchedContext->active_staid == staId) in cds_drop_rxpkt_by_staid()
694 static void cds_rx_from_queue(p_cds_sched_context pSchedContext) in cds_rx_from_queue() argument
699 spin_lock_bh(&pSchedContext->ol_rx_queue_lock); in cds_rx_from_queue()
700 while (!list_empty(&pSchedContext->ol_rx_thread_queue)) { in cds_rx_from_queue()
701 pkt = list_first_entry(&pSchedContext->ol_rx_thread_queue, in cds_rx_from_queue()
704 pSchedContext->active_staid = pkt->staId; in cds_rx_from_queue()
705 spin_unlock_bh(&pSchedContext->ol_rx_queue_lock); in cds_rx_from_queue()
708 cds_free_ol_rx_pkt(pSchedContext, pkt); in cds_rx_from_queue()
709 spin_lock_bh(&pSchedContext->ol_rx_queue_lock); in cds_rx_from_queue()
710 pSchedContext->active_staid = OL_TXRX_INVALID_LOCAL_PEER_ID; in cds_rx_from_queue()
712 spin_unlock_bh(&pSchedContext->ol_rx_queue_lock); in cds_rx_from_queue()
725 p_cds_sched_context pSchedContext = (p_cds_sched_context) arg; in cds_ol_rx_thread() local
740 complete(&pSchedContext->ol_rx_start_event); in cds_ol_rx_thread()
744 wait_event_interruptible(pSchedContext->ol_rx_wait_queue, in cds_ol_rx_thread()
746 &pSchedContext->ol_rx_event_flag) in cds_ol_rx_thread()
748 &pSchedContext->ol_rx_event_flag)); in cds_ol_rx_thread()
752 clear_bit(RX_POST_EVENT, &pSchedContext->ol_rx_event_flag); in cds_ol_rx_thread()
755 &pSchedContext->ol_rx_event_flag)) { in cds_ol_rx_thread()
757 &pSchedContext->ol_rx_event_flag); in cds_ol_rx_thread()
759 &pSchedContext->ol_rx_event_flag)) { in cds_ol_rx_thread()
761 &pSchedContext->ol_rx_event_flag); in cds_ol_rx_thread()
763 (&pSchedContext->ol_suspend_rx_event); in cds_ol_rx_thread()
769 cds_rx_from_queue(pSchedContext); in cds_ol_rx_thread()
772 &pSchedContext->ol_rx_event_flag)) { in cds_ol_rx_thread()
774 &pSchedContext->ol_rx_event_flag); in cds_ol_rx_thread()
775 spin_lock(&pSchedContext->ol_rx_thread_lock); in cds_ol_rx_thread()
777 (pSchedContext->ol_resume_rx_event); in cds_ol_rx_thread()
778 complete(&pSchedContext->ol_suspend_rx_event); in cds_ol_rx_thread()
779 spin_unlock(&pSchedContext->ol_rx_thread_lock); in cds_ol_rx_thread()
781 (&pSchedContext->ol_resume_rx_event); in cds_ol_rx_thread()
788 kthread_complete_and_exit(&pSchedContext->ol_rx_shutdown, 0); in cds_ol_rx_thread()