|
@@ -266,6 +266,33 @@ out:
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
|
|
|
+/**
|
|
|
+ * pld_bus_event_type_convert() - Convert enum cnss_bus_event_type
|
|
|
+ * to enum pld_bus_event
|
|
|
+ * @etype: enum cnss_bus_event_type value
|
|
|
+ *
|
|
|
+ * This function will convert enum cnss_bus_event_type to
|
|
|
+ * enum pld_bus_event.
|
|
|
+ *
|
|
|
+ * Return: enum pld_bus_event
|
|
|
+ */
|
|
|
+static inline
|
|
|
+enum pld_bus_event pld_bus_event_type_convert(enum cnss_bus_event_type etype)
|
|
|
+{
|
|
|
+ enum pld_bus_event pld_etype = PLD_BUS_EVENT_INVALID;
|
|
|
+
|
|
|
+ switch (etype) {
|
|
|
+ case BUS_EVENT_PCI_LINK_DOWN:
|
|
|
+ pld_etype = PLD_BUS_EVENT_PCIE_LINK_DOWN;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return pld_etype;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* pld_pcie_update_event() - update wlan driver status callback function
|
|
|
* @pdev: PCIE device
|
|
@@ -274,9 +301,8 @@ out:
|
|
|
* This function will be called when platform driver wants to update wlan
|
|
|
* driver's status.
|
|
|
*
|
|
|
- * Return: void
|
|
|
+ * Return: 0 for success, non zero for error code
|
|
|
*/
|
|
|
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
|
|
|
static int pld_pcie_update_event(struct pci_dev *pdev,
|
|
|
struct cnss_uevent_data *uevent_data)
|
|
|
{
|
|
@@ -299,14 +325,28 @@ static int pld_pcie_update_event(struct pci_dev *pdev,
|
|
|
data.hang_data.hang_event_data_len =
|
|
|
hang_event->hang_event_data_len;
|
|
|
break;
|
|
|
+ case CNSS_BUS_EVENT:
|
|
|
+ {
|
|
|
+ struct cnss_bus_event *bus_evt = uevent_data->data;
|
|
|
+
|
|
|
+ if (!bus_evt)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ data.uevent = PLD_BUS_EVENT;
|
|
|
+
|
|
|
+ /* Process uevent_data->data if any */
|
|
|
+ data.bus_data.etype =
|
|
|
+ pld_bus_event_type_convert(bus_evt->etype);
|
|
|
+ data.bus_data.event_data = bus_evt->event_data;
|
|
|
+ break;
|
|
|
+ }
|
|
|
default:
|
|
|
- goto out;
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
if (pld_context->ops->uevent)
|
|
|
pld_context->ops->uevent(&pdev->dev, &data);
|
|
|
|
|
|
-out:
|
|
|
return 0;
|
|
|
}
|
|
|
#endif
|