diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index 689e616dff..2cfed2443a 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1615,8 +1615,8 @@ int pld_is_qmi_disable(struct device *dev) * * This API will be called to check if WLAN FW is down or not. * - * Return: 1 FW is down - * 0 FW is not down + * Return: 0 FW is not down + * Otherwise FW is down * Always return 0 for unsupported bus type */ int pld_is_fw_down(struct device *dev) @@ -1632,7 +1632,9 @@ int pld_is_fw_down(struct device *dev) ret = pld_pcie_is_fw_down(dev); break; case PLD_BUS_TYPE_SDIO: + break; case PLD_BUS_TYPE_USB: + ret = pld_usb_is_fw_down(dev); break; default: pr_err("Invalid device type %d\n", type); diff --git a/core/pld/src/pld_usb.c b/core/pld/src/pld_usb.c index b4ff8486e8..24ed0a2bf8 100644 --- a/core/pld/src/pld_usb.c +++ b/core/pld/src/pld_usb.c @@ -253,6 +253,11 @@ int pld_usb_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, return cnss_wlan_enable(dev, &cfg, cnss_mode, host_version); } +int pld_usb_is_fw_down(struct device *dev) +{ + return cnss_usb_is_device_down(dev); +} + #else /* CONFIG_PLD_USB_CNSS */ struct usb_driver pld_usb_ops = { @@ -317,4 +322,10 @@ int pld_usb_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, { return 0; } + +int pld_usb_is_fw_down(struct device *dev) +{ + return 0; +} + #endif /* CONFIG_PLD_USB_CNSS */ diff --git a/core/pld/src/pld_usb.h b/core/pld/src/pld_usb.h index 13fddf10e4..1dcc11d323 100644 --- a/core/pld/src/pld_usb.h +++ b/core/pld/src/pld_usb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -26,6 +26,8 @@ void pld_usb_unregister_driver(void); int pld_usb_get_ce_id(int irq); int pld_usb_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, enum pld_driver_mode mode, const char *host_version); +int pld_usb_is_fw_down(struct device *dev); + #else static inline int pld_usb_register_driver(void) { @@ -42,6 +44,12 @@ static inline int pld_usb_wlan_enable(struct device *dev, { return 0; } + +static inline int pld_usb_is_fw_down(struct device *dev) +{ + return 0; +} + #endif static inline int