Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 147f8be5 authored by Yuanyuan Liu's avatar Yuanyuan Liu
Browse files

cnss2: remove unused recovery APIs



WLAN driver uses new recovery APIs that pass dev instance
as the input. Remove unused recovery APIs.

CRs-Fixed: 1111417
Change-Id: I9784d6a4b2a5e182da7bd9401fa83becce2f3d17
Signed-off-by: default avatarYuanyuan Liu <yuanliu@codeaurora.org>
parent d1bfc82a
Loading
Loading
Loading
Loading
+0 −55
Original line number Diff line number Diff line
@@ -1242,48 +1242,6 @@ static void cnss_crash_shutdown(const struct subsys_desc *subsys_desc)
	}
}

void cnss_device_self_recovery(void)
{
	struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL);
	struct cnss_subsys_info *subsys_info;

	if (!plat_priv) {
		cnss_pr_err("plat_priv is NULL!\n");
		return;
	}

	if (!plat_priv->plat_dev) {
		cnss_pr_err("plat_dev is NULL!\n");
		return;
	}

	if (!plat_priv->driver_ops) {
		cnss_pr_err("Driver is not registered yet!\n");
		return;
	}

	if (plat_priv->driver_status == CNSS_RECOVERY) {
		cnss_pr_err("Recovery is already in progress!\n");
		return;
	}

	if (plat_priv->driver_status == CNSS_LOAD_UNLOAD) {
		cnss_pr_err("Driver load or unload is in progress!\n");
		return;
	}

	subsys_info = &plat_priv->subsys_info;
	plat_priv->recovery_count++;
	plat_priv->driver_status = CNSS_RECOVERY;
	pm_stay_awake(&plat_priv->plat_dev->dev);
	cnss_shutdown(&subsys_info->subsys_desc, false);
	udelay(WLAN_RECOVERY_DELAY);
	cnss_powerup(&subsys_info->subsys_desc);
	pm_relax(&plat_priv->plat_dev->dev);
	plat_priv->driver_status = CNSS_INITIALIZED;
}
EXPORT_SYMBOL(cnss_device_self_recovery);

int cnss_self_recovery(struct device *dev,
		       enum cnss_recovery_reason reason)
{
@@ -1329,19 +1287,6 @@ int cnss_self_recovery(struct device *dev,
}
EXPORT_SYMBOL(cnss_self_recovery);

void cnss_recovery_work_handler(struct work_struct *recovery)
{
	cnss_device_self_recovery();
}

DECLARE_WORK(cnss_recovery_work, cnss_recovery_work_handler);

void cnss_schedule_recovery_work(void)
{
	schedule_work(&cnss_recovery_work);
}
EXPORT_SYMBOL(cnss_schedule_recovery_work);

void cnss_schedule_recovery(struct device *dev,
			    enum cnss_recovery_reason reason)
{
+1 −35
Original line number Diff line number Diff line
@@ -168,40 +168,6 @@ out:
	return ret;
}

void cnss_wlan_pci_link_down(void)
{
	unsigned long flags;
	struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL);
	struct cnss_pci_data *pci_priv;

	if (!plat_priv) {
		cnss_pr_err("plat_priv is NULL!\n");
		return;
	}

	pci_priv = plat_priv->bus_priv;
	if (!pci_priv) {
		cnss_pr_err("pci_priv is NULL!\n");
		return;
	}

	if (pci_link_down_panic)
		panic("cnss: PCI link is down!\n");

	spin_lock_irqsave(&pci_link_down_lock, flags);
	if (pci_priv->pci_link_down_ind) {
		cnss_pr_dbg("PCI link down recovery is in progress, ignore!\n");
		spin_unlock_irqrestore(&pci_link_down_lock, flags);
		return;
	}
	pci_priv->pci_link_down_ind = true;
	spin_unlock_irqrestore(&pci_link_down_lock, flags);

	cnss_pr_err("PCI link down is detected by host driver, schedule recovery!\n");
	cnss_schedule_recovery_work();
}
EXPORT_SYMBOL(cnss_wlan_pci_link_down);

int cnss_pci_link_down(struct device *dev)
{
	unsigned long flags;
@@ -330,7 +296,7 @@ static void cnss_pci_event_cb(struct msm_pcie_notify *notify)

		cnss_pr_err("PCI link down, schedule recovery!\n");
		disable_irq(pci_dev->irq);
		cnss_schedule_recovery_work();
		cnss_schedule_recovery(&pci_dev->dev, CNSS_REASON_LINK_DOWN);
		break;
	case MSM_PCIE_EVENT_WAKEUP:
		if (cnss_pci_get_monitor_wake_intr(pci_priv) &&
+0 −3
Original line number Diff line number Diff line
@@ -134,10 +134,7 @@ enum cnss_recovery_reason {

extern int cnss_wlan_register_driver(struct cnss_wlan_driver *driver);
extern void cnss_wlan_unregister_driver(struct cnss_wlan_driver *driver);
extern void cnss_wlan_pci_link_down(void);
extern void cnss_schedule_recovery_work(void);
extern void cnss_device_crashed(void);
extern void cnss_device_self_recovery(void);
extern int cnss_pci_link_down(struct device *dev);
extern void cnss_schedule_recovery(struct device *dev,
				   enum cnss_recovery_reason reason);