summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnurag Chouhan <achouhan@codeaurora.org>2017-03-21 19:59:55 +0530
committerSandeep Puligilla <spuligil@codeaurora.org>2017-04-10 23:12:13 -0700
commit061c05d3373fd70454a7db23fc5be066b07cff1c (patch)
treeb714070a265b31c97a2b055b4c471550becd100a
parent352874924def587cc0d408006e29db13bcb0ced9 (diff)
qcacld-3.0: Add uevent to update status & data
Update uevent status to hdd, based on the uevent received from the platform driver. Change-Id: I1ac0fa61efa8b7f4f9d5e4e6abfcf969dbc1c592 CRs-fixed: 2027958
-rw-r--r--core/hdd/src/wlan_hdd_driver_ops.c24
-rw-r--r--core/pld/inc/pld_common.h27
-rw-r--r--core/pld/src/pld_pcie.c20
-rw-r--r--core/pld/src/pld_snoc.c25
4 files changed, 63 insertions, 33 deletions
diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c
index 931fedf626f3..01c6bf208330 100644
--- a/core/hdd/src/wlan_hdd_driver_ops.c
+++ b/core/hdd/src/wlan_hdd_driver_ops.c
@@ -503,18 +503,6 @@ 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
@@ -1177,15 +1165,17 @@ static void wlan_hdd_pld_notify_handler(struct device *dev,
}
/**
- * wlan_hdd_pld_update_status() - update driver status
+ * wlan_hdd_pld_uevent() - update driver status
* @dev: device
- * @status: driver status
+ * @uevent: uevent status
*
* Return: void
*/
-static void wlan_hdd_pld_update_status(struct device *dev, uint32_t status)
+static void wlan_hdd_pld_uevent(struct device *dev,
+ struct pld_uevent_data *uevent)
{
- wlan_hdd_update_status(status);
+ if (uevent->uevent == PLD_RECOVERY)
+ cds_set_recovery_in_progress(true);
}
#ifdef FEATURE_RUNTIME_PM
@@ -1228,7 +1218,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,
+ .uevent = wlan_hdd_pld_uevent,
#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 3c794ce260f3..9cdaee0e65ae 100644
--- a/core/pld/inc/pld_common.h
+++ b/core/pld/inc/pld_common.h
@@ -129,7 +129,30 @@ enum pld_driver_status {
PLD_UNINITIALIZED,
PLD_INITIALIZED,
PLD_LOAD_UNLOAD,
+};
+
+/**
+ * enum pld_uevent - WLAN FW status
+ * @PLD_RECOVERY: driver is recovering
+ * @PLD_FW_DOWN: FW is down
+ */
+enum pld_uevent {
PLD_RECOVERY,
+ PLD_FW_DOWN,
+};
+
+/**
+ * struct pld_uevent_data - uevent status received from platform driver
+ * @uevent: uevent type
+ * @fw_down: FW down info
+ */
+struct pld_uevent_data {
+ enum pld_uevent uevent;
+ union {
+ struct {
+ bool crashed;
+ } fw_down;
+ };
};
/**
@@ -257,7 +280,7 @@ 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
+ * @uevent: 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)
@@ -291,7 +314,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);
+ void (*uevent)(struct device *dev, struct pld_uevent_data *uevent);
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 1f9fe87619f0..23265b50c941 100644
--- a/core/pld/src/pld_pcie.c
+++ b/core/pld/src/pld_pcie.c
@@ -181,22 +181,30 @@ static void pld_pcie_notify_handler(struct pci_dev *pdev, int state)
}
/**
- * pld_pcie_update_status() - update wlan driver status callback function
+ * pld_pcie_uevent() - update wlan driver status callback function
* @pdev: PCIE device
- * @status: driver status
+ * @status driver uevent 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)
+static void pld_pcie_uevent(struct pci_dev *pdev, uint32_t status)
{
struct pld_context *pld_context;
+ struct pld_uevent_data data;
pld_context = pld_get_global_context();
- if (pld_context->ops->update_status)
- pld_context->ops->update_status(&pdev->dev, status);
+ if (!pld_context)
+ return;
+
+ data.uevent = status;
+
+ if (!pld_context->ops->uevent)
+ pld_context->ops->uevent(&pdev->dev, &data);
+
+ return;
}
#ifdef FEATURE_RUNTIME_PM
@@ -306,7 +314,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,
+ .update_status = pld_pcie_uevent,
#ifdef CONFIG_PM
.suspend = pld_pcie_suspend,
.resume = pld_pcie_resume,
diff --git a/core/pld/src/pld_snoc.c b/core/pld/src/pld_snoc.c
index 2056556f682d..3b29a01d7f9b 100644
--- a/core/pld/src/pld_snoc.c
+++ b/core/pld/src/pld_snoc.c
@@ -239,26 +239,35 @@ static int pld_snoc_uevent(struct device *dev,
struct icnss_uevent_data *uevent)
{
struct pld_context *pld_context;
- uint32_t status;
+ struct icnss_uevent_fw_down_data *uevent_data = NULL;
+ struct pld_uevent_data data;
pld_context = pld_get_global_context();
if (!pld_context)
return -EINVAL;
- if (!pld_context->ops->update_status)
- goto out;
+ if (!pld_context->ops->uevent)
+ return 0;
+
+ if (!uevent)
+ return -EINVAL;
switch (uevent->uevent) {
case ICNSS_UEVENT_FW_CRASHED:
- status = PLD_RECOVERY;
+ data.uevent = PLD_RECOVERY;
+ break;
+ case ICNSS_UEVENT_FW_DOWN:
+ if (uevent->data == NULL)
+ return -EINVAL;
+ uevent_data = (struct icnss_uevent_fw_down_data *)uevent->data;
+ data.uevent = PLD_FW_DOWN;
+ data.fw_down.crashed = uevent_data->crashed;
break;
default:
- goto out;
+ return 0;
}
- pld_context->ops->update_status(dev, status);
-
-out:
+ pld_context->ops->uevent(dev, &data);
return 0;
}