From 44273d64644f38848fb2a293b009264ac0681a85 Mon Sep 17 00:00:00 2001 From: Ajit Pal Singh Date: Tue, 10 Jul 2018 19:27:06 +0530 Subject: [PATCH] qcacld-3.0: Call cnss_wlan_enable() for QCN7605 USB Call cnss_wlan_enable() for QCN7605 USB. Change-Id: I566e934ee43db0b95dad799cac6731695f62992e CRs-Fixed: 2269602 --- core/bmi/src/i_bmi.h | 2 +- core/pld/src/pld_common.c | 5 ++++- core/pld/src/pld_usb.c | 26 ++++++++++++++++++++++++++ core/pld/src/pld_usb.h | 10 ++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/core/bmi/src/i_bmi.h b/core/bmi/src/i_bmi.h index 7dd5e999adfb..0c1d93d3b83a 100644 --- a/core/bmi/src/i_bmi.h +++ b/core/bmi/src/i_bmi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2018 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 diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index 015c2c0ca3e7..6a89f1c83eb3 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 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 @@ -342,6 +342,9 @@ int pld_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, break; case PLD_BUS_TYPE_SDIO: break; + case PLD_BUS_TYPE_USB: + ret = pld_usb_wlan_enable(dev, config, mode, host_version); + break; default: ret = -EINVAL; break; diff --git a/core/pld/src/pld_usb.c b/core/pld/src/pld_usb.c index 770f4e727522..da2a90fc8986 100644 --- a/core/pld/src/pld_usb.c +++ b/core/pld/src/pld_usb.c @@ -192,6 +192,26 @@ void pld_usb_unregister_driver(void) pr_info("%s usb_deregister done!\n", __func__); } +int pld_usb_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, + enum pld_driver_mode mode, const char *host_version) +{ + struct cnss_wlan_enable_cfg cfg; + enum cnss_driver_mode cnss_mode; + + switch (mode) { + case PLD_FTM: + cnss_mode = CNSS_FTM; + break; + case PLD_EPPING: + cnss_mode = CNSS_EPPING; + break; + default: + cnss_mode = CNSS_MISSION; + break; + } + return cnss_wlan_enable(dev, &cfg, cnss_mode, host_version); +} + #else /* CONFIG_PLD_USB_CNSS */ struct usb_driver pld_usb_ops = { @@ -248,4 +268,10 @@ void pld_usb_unregister_driver(void) usb_deregister(&pld_usb_ops); pr_info("%s usb_deregister done!\n", __func__); } + +int pld_usb_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, + enum pld_driver_mode mode, const char *host_version) +{ + return 0; +} #endif /* CONFIG_PLD_USB_CNSS */ diff --git a/core/pld/src/pld_usb.h b/core/pld/src/pld_usb.h index fc6ffcc60da7..13fddf10e4c8 100644 --- a/core/pld/src/pld_usb.h +++ b/core/pld/src/pld_usb.h @@ -24,6 +24,8 @@ int pld_usb_register_driver(void); 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); #else static inline int pld_usb_register_driver(void) { @@ -32,6 +34,14 @@ static inline int pld_usb_register_driver(void) static inline void pld_usb_unregister_driver(void) {} + +static inline int pld_usb_wlan_enable(struct device *dev, + struct pld_wlan_enable_cfg *config, + enum pld_driver_mode mode, + const char *host_version) +{ + return 0; +} #endif static inline int