Procházet zdrojové kódy

qcacmn: Deregister legacy & target queue callbacks upon scheduler down

Driver is missing couple of deregister handler while bringing down the
scheduler.

Change-Id: I99fe6e9a5d3cac800154945e41e707ebb7ee6396
CRs-Fixed: 2001133
Krunal Soni před 8 roky
rodič
revize
dce49ecf59
2 změnil soubory, kde provedl 43 přidání a 1 odebrání
  1. 13 1
      scheduler/inc/scheduler_api.h
  2. 30 0
      scheduler/src/scheduler_api.c

+ 13 - 1
scheduler/inc/scheduler_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -235,6 +235,18 @@ QDF_STATUS scheduler_register_wma_legacy_handler(scheduler_msg_process_fn_t
  */
 QDF_STATUS scheduler_register_sys_legacy_handler(scheduler_msg_process_fn_t
 						callback);
+/**
+ * scheduler_deregister_sys_legacy_handler() - deregister legacy sys handler
+ *
+ * Return: QDF status
+ */
+QDF_STATUS scheduler_deregister_sys_legacy_handler(void);
+/**
+ * scheduler_deregister_wma_legacy_handler() - deregister legacy wma handler
+ *
+ * Return: QDF status
+ */
+QDF_STATUS scheduler_deregister_wma_legacy_handler(void);
 /**
  * scheduler_mc_timer_callback() - timer callback, gets called at time out
  * @data: unsigned long, holds the timer object.

+ 30 - 0
scheduler/src/scheduler_api.c

@@ -480,6 +480,36 @@ QDF_STATUS scheduler_register_sys_legacy_handler(scheduler_msg_process_fn_t
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS scheduler_deregister_wma_legacy_handler(void)
+{
+	struct scheduler_ctx *sched_ctx = scheduler_get_context();
+
+	if (NULL == sched_ctx) {
+		QDF_TRACE(QDF_MODULE_ID_SCHEDULER,
+			QDF_TRACE_LEVEL_ERROR, FL("scheduler context is null"));
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	sched_ctx->legacy_wma_handler = NULL;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS scheduler_deregister_sys_legacy_handler(void)
+{
+	struct scheduler_ctx *sched_ctx = scheduler_get_context();
+
+	if (NULL == sched_ctx) {
+		QDF_TRACE(QDF_MODULE_ID_SCHEDULER,
+			QDF_TRACE_LEVEL_ERROR, FL("scheduler context is null"));
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	sched_ctx->legacy_sys_handler = NULL;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 void scheduler_mc_timer_callback(unsigned long data)
 {
 	qdf_mc_timer_t *timer = (qdf_mc_timer_t *)data;