summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuanyuan Liu <yuanliu@codeaurora.org>2017-01-12 16:48:19 -0800
committerqcabuildsw <qcabuildsw@localhost>2017-02-12 18:31:36 -0800
commit68acf73b5f005002a538a0af669b87b3d009165a (patch)
treec40b47b502d28b3e50b420806fba2b1563d941dd
parentcc1241eb2ecdb94597da9daf539c61d53de0d768 (diff)
qcacld-3.0: Implement update_status driver callback
Implement update_status driver callback, which will be called when platform driver wants to update wlan driver status. CRs-Fixed: 1111424 Change-Id: I0c4a20119e383d00e2dbd395159351572b956566
-rw-r--r--core/hdd/src/wlan_hdd_driver_ops.c25
-rw-r--r--core/pld/inc/pld_common.h6
-rw-r--r--core/pld/src/pld_pcie.c22
3 files changed, 51 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c
index 9fbf37574a6c..85f2744691e0 100644
--- a/core/hdd/src/wlan_hdd_driver_ops.c
+++ b/core/hdd/src/wlan_hdd_driver_ops.c
@@ -491,6 +491,18 @@ static void wlan_hdd_notify_handler(int state)
}
/**
+ * wlan_hdd_update_status() - update driver status
+ * @status: driver status
+ *
+ * Return: void
+ */
+static void wlan_hdd_update_status(uint32_t status)
+{
+ if (status == PLD_RECOVERY)
+ cds_set_recovery_in_progress(true);
+}
+
+/**
* __wlan_hdd_bus_suspend() - handles platform supsend
* @state: suspend message from the kernel
* @wow_flags: bitmap of WMI WOW flags to pass to FW
@@ -1152,6 +1164,18 @@ static void wlan_hdd_pld_notify_handler(struct device *dev,
wlan_hdd_notify_handler(state);
}
+/**
+ * wlan_hdd_pld_update_status() - update driver status
+ * @dev: device
+ * @status: driver status
+ *
+ * Return: void
+ */
+static void wlan_hdd_pld_update_status(struct device *dev, uint32_t status)
+{
+ wlan_hdd_update_status(status);
+}
+
#ifdef FEATURE_RUNTIME_PM
/**
* wlan_hdd_pld_runtime_suspend() - runtime suspend function registered to PLD
@@ -1192,6 +1216,7 @@ struct pld_driver_ops wlan_drv_ops = {
.resume_noirq = wlan_hdd_pld_resume_noirq,
.reset_resume = wlan_hdd_pld_reset_resume,
.modem_status = wlan_hdd_pld_notify_handler,
+ .update_status = wlan_hdd_pld_update_status,
#ifdef FEATURE_RUNTIME_PM
.runtime_suspend = wlan_hdd_pld_runtime_suspend,
.runtime_resume = wlan_hdd_pld_runtime_resume,
diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h
index 4f83a1218f02..3c089872ff47 100644
--- a/core/pld/inc/pld_common.h
+++ b/core/pld/inc/pld_common.h
@@ -127,7 +127,8 @@ struct pld_platform_cap {
enum pld_driver_status {
PLD_UNINITIALIZED,
PLD_INITIALIZED,
- PLD_LOAD_UNLOAD
+ PLD_LOAD_UNLOAD,
+ PLD_RECOVERY,
};
/**
@@ -255,6 +256,8 @@ struct pld_soc_info {
* is enabled
* @modem_status: optional operation, will be called when platform driver
* sending modem power status to WLAN FW
+ * @update_status: optional operation, will be called when platform driver
+ * updating driver status
* @runtime_suspend: optional operation, prepare the device for a condition
* in which it won't be able to communicate with the CPU(s)
* and RAM due to power management.
@@ -287,6 +290,7 @@ struct pld_driver_ops {
void (*modem_status)(struct device *dev,
enum pld_bus_type bus_type,
int state);
+ void (*update_status)(struct device *dev, uint32_t status);
int (*runtime_suspend)(struct device *dev,
enum pld_bus_type bus_type);
int (*runtime_resume)(struct device *dev,
diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c
index f481f3ca9930..1f9fe87619f0 100644
--- a/core/pld/src/pld_pcie.c
+++ b/core/pld/src/pld_pcie.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -180,6 +180,25 @@ static void pld_pcie_notify_handler(struct pci_dev *pdev, int state)
PLD_BUS_TYPE_PCIE, state);
}
+/**
+ * pld_pcie_update_status() - update wlan driver status callback function
+ * @pdev: PCIE device
+ * @status: driver status
+ *
+ * This function will be called when platform driver wants to update wlan
+ * driver's status.
+ *
+ * Return: void
+ */
+static void pld_pcie_update_status(struct pci_dev *pdev, uint32_t status)
+{
+ struct pld_context *pld_context;
+
+ pld_context = pld_get_global_context();
+ if (pld_context->ops->update_status)
+ pld_context->ops->update_status(&pdev->dev, status);
+}
+
#ifdef FEATURE_RUNTIME_PM
/**
* pld_pcie_runtime_suspend() - PM runtime suspend
@@ -287,6 +306,7 @@ struct cnss_wlan_driver pld_pcie_ops = {
.shutdown = pld_pcie_shutdown,
.crash_shutdown = pld_pcie_crash_shutdown,
.modem_status = pld_pcie_notify_handler,
+ .update_status = pld_pcie_update_status,
#ifdef CONFIG_PM
.suspend = pld_pcie_suspend,
.resume = pld_pcie_resume,