From b941e3371a6981cf0abfa195389e00f098b2d4a6 Mon Sep 17 00:00:00 2001 From: snandini Date: Thu, 26 Oct 2017 05:39:57 -0700 Subject: [PATCH 01/36] Release 5.2.0.51H Release 5.2.0.51H Change-Id: I9a1424ec094be20fffdd25086e83e6b0fff85157 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 2b1335bbe11a..1e24f3f75728 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "G" +#define QWLAN_VERSION_EXTRA "H" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51G" +#define QWLAN_VERSIONSTR "5.2.0.51H" #endif /* QWLAN_VERSION_H */ From f04667af34c1ccf81c5a1467b7b2e12adb426e92 Mon Sep 17 00:00:00 2001 From: Sarada Prasanna Garnayak Date: Mon, 16 Oct 2017 11:54:36 +0530 Subject: [PATCH 02/36] qcacld-3.0: add device pointer in pld snoc API Add device pointer in all pld snoc API to support for numerous WLAN module. Change-Id: Id6c3d559ebc67d40536a60ab78d468fb5f0fbf03 --- core/pld/src/pld_common.c | 23 +++--- core/pld/src/pld_snoc.c | 75 ++++++++++++++++++- core/pld/src/pld_snoc.h | 149 ++++++++++++++++++++++++++++++-------- 3 files changed, 202 insertions(+), 45 deletions(-) diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index d33d5a5b2012..8010a0412dc1 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -347,7 +347,7 @@ int pld_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, ret = pld_pcie_wlan_enable(dev, config, mode, host_version); break; case PLD_BUS_TYPE_SNOC: - ret = pld_snoc_wlan_enable(config, mode, host_version); + ret = pld_snoc_wlan_enable(dev, config, mode, host_version); break; case PLD_BUS_TYPE_SDIO: break; @@ -378,7 +378,7 @@ int pld_wlan_disable(struct device *dev, enum pld_driver_mode mode) ret = pld_pcie_wlan_disable(dev, mode); break; case PLD_BUS_TYPE_SNOC: - ret = pld_snoc_wlan_disable(mode); + ret = pld_snoc_wlan_disable(dev, mode); break; case PLD_BUS_TYPE_SDIO: break; @@ -409,7 +409,7 @@ int pld_set_fw_log_mode(struct device *dev, u8 fw_log_mode) ret = pld_pcie_set_fw_log_mode(dev, fw_log_mode); break; case PLD_BUS_TYPE_SNOC: - ret = pld_snoc_set_fw_log_mode(fw_log_mode); + ret = pld_snoc_set_fw_log_mode(dev, fw_log_mode); break; case PLD_BUS_TYPE_SDIO: break; @@ -971,7 +971,8 @@ int pld_ce_request_irq(struct device *dev, unsigned int ce_id, switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_SNOC: - ret = pld_snoc_ce_request_irq(ce_id, handler, flags, name, ctx); + ret = pld_snoc_ce_request_irq(dev, ce_id, + handler, flags, name, ctx); break; case PLD_BUS_TYPE_PCIE: break; @@ -998,7 +999,7 @@ int pld_ce_free_irq(struct device *dev, unsigned int ce_id, void *ctx) switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_SNOC: - ret = pld_snoc_ce_free_irq(ce_id, ctx); + ret = pld_snoc_ce_free_irq(dev, ce_id, ctx); break; case PLD_BUS_TYPE_PCIE: break; @@ -1021,7 +1022,7 @@ void pld_enable_irq(struct device *dev, unsigned int ce_id) { switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_SNOC: - pld_snoc_enable_irq(ce_id); + pld_snoc_enable_irq(dev, ce_id); break; case PLD_BUS_TYPE_PCIE: break; @@ -1044,7 +1045,7 @@ void pld_disable_irq(struct device *dev, unsigned int ce_id) { switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_SNOC: - pld_snoc_disable_irq(ce_id); + pld_snoc_disable_irq(dev, ce_id); break; case PLD_BUS_TYPE_PCIE: break; @@ -1072,7 +1073,7 @@ int pld_get_soc_info(struct device *dev, struct pld_soc_info *info) switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_SNOC: - ret = pld_snoc_get_soc_info(info); + ret = pld_snoc_get_soc_info(dev, info); break; case PLD_BUS_TYPE_PCIE: ret = pld_pcie_get_soc_info(dev, info); @@ -1100,7 +1101,7 @@ int pld_get_ce_id(struct device *dev, int irq) switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_SNOC: - ret = pld_snoc_get_ce_id(irq); + ret = pld_snoc_get_ce_id(dev, irq); break; case PLD_BUS_TYPE_PCIE: ret = pld_pcie_get_ce_id(irq); @@ -1126,7 +1127,7 @@ int pld_get_irq(struct device *dev, int ce_id) switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_SNOC: - ret = pld_snoc_get_irq(ce_id); + ret = pld_snoc_get_irq(dev, ce_id); break; case PLD_BUS_TYPE_PCIE: default: @@ -1512,7 +1513,7 @@ int pld_is_qmi_disable(struct device *dev) switch (type) { case PLD_BUS_TYPE_SNOC: - ret = pld_snoc_is_qmi_disable(); + ret = pld_snoc_is_qmi_disable(dev); break; case PLD_BUS_TYPE_PCIE: case PLD_BUS_TYPE_SDIO: diff --git a/core/pld/src/pld_snoc.c b/core/pld/src/pld_snoc.c index 1c0b14cddf2d..c70a3d021a9f 100644 --- a/core/pld/src/pld_snoc.c +++ b/core/pld/src/pld_snoc.c @@ -312,6 +312,7 @@ void pld_snoc_unregister_driver(void) /** * pld_snoc_wlan_enable() - Enable WLAN + * @dev: device * @config: WLAN configuration data * @mode: WLAN mode * @host_version: host software version @@ -322,7 +323,43 @@ void pld_snoc_unregister_driver(void) * Return: 0 for success * Non zero failure code for errors */ -int pld_snoc_wlan_enable(struct pld_wlan_enable_cfg *config, + +#ifdef ICNSS_API_WITH_DEV +int pld_snoc_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, + enum pld_driver_mode mode, const char *host_version) +{ + struct icnss_wlan_enable_cfg cfg; + enum icnss_driver_mode icnss_mode; + + if (!dev) + return -ENODEV; + + cfg.num_ce_tgt_cfg = config->num_ce_tgt_cfg; + cfg.ce_tgt_cfg = (struct ce_tgt_pipe_cfg *) + config->ce_tgt_cfg; + cfg.num_ce_svc_pipe_cfg = config->num_ce_svc_pipe_cfg; + cfg.ce_svc_cfg = (struct ce_svc_pipe_cfg *) + config->ce_svc_cfg; + cfg.num_shadow_reg_cfg = config->num_shadow_reg_cfg; + cfg.shadow_reg_cfg = (struct icnss_shadow_reg_cfg *) + config->shadow_reg_cfg; + + switch (mode) { + case PLD_FTM: + icnss_mode = ICNSS_FTM; + break; + case PLD_EPPING: + icnss_mode = ICNSS_EPPING; + break; + default: + icnss_mode = ICNSS_MISSION; + break; + } + + return icnss_wlan_enable(dev, &cfg, icnss_mode, host_version); +} +#else +int pld_snoc_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, enum pld_driver_mode mode, const char *host_version) { struct icnss_wlan_enable_cfg cfg; @@ -349,11 +386,14 @@ int pld_snoc_wlan_enable(struct pld_wlan_enable_cfg *config, icnss_mode = ICNSS_MISSION; break; } + return icnss_wlan_enable(&cfg, icnss_mode, host_version); } +#endif /** * pld_snoc_wlan_disable() - Disable WLAN + * @dev: device * @mode: WLAN mode * * This function disables WLAN FW. It passes WLAN mode to FW. @@ -361,13 +401,24 @@ int pld_snoc_wlan_enable(struct pld_wlan_enable_cfg *config, * Return: 0 for success * Non zero failure code for errors */ -int pld_snoc_wlan_disable(enum pld_driver_mode mode) +#ifdef ICNSS_API_WITH_DEV +int pld_snoc_wlan_disable(struct device *dev, enum pld_driver_mode mode) +{ + if (!dev) + return -ENODEV; + + return icnss_wlan_disable(dev, ICNSS_OFF); +} +#else +int pld_snoc_wlan_disable(struct device *dev, enum pld_driver_mode mode) { return icnss_wlan_disable(ICNSS_OFF); } +#endif /** * pld_snoc_get_soc_info() - Get SOC information + * @dev: device * @info: buffer to SOC information * * Return SOC info to the buffer. @@ -375,7 +426,24 @@ int pld_snoc_wlan_disable(enum pld_driver_mode mode) * Return: 0 for success * Non zero failure code for errors */ -int pld_snoc_get_soc_info(struct pld_soc_info *info) +#ifdef ICNSS_API_WITH_DEV +int pld_snoc_get_soc_info(struct device *dev, struct pld_soc_info *info) +{ + int ret = 0; + struct icnss_soc_info icnss_info; + + if (info == NULL || !dev) + return -ENODEV; + + ret = icnss_get_soc_info(dev, &icnss_info); + if (0 != ret) + return ret; + + memcpy(info, &icnss_info, sizeof(*info)); + return 0; +} +#else +int pld_snoc_get_soc_info(struct device *dev, struct pld_soc_info *info) { int ret = 0; struct icnss_soc_info icnss_info; @@ -391,3 +459,4 @@ int pld_snoc_get_soc_info(struct pld_soc_info *info) return 0; } #endif +#endif diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h index 94d9a791660f..7cf243a59bee 100644 --- a/core/pld/src/pld_snoc.h +++ b/core/pld/src/pld_snoc.h @@ -42,36 +42,41 @@ static inline int pld_snoc_register_driver(void) static inline void pld_snoc_unregister_driver(void) { } -static inline int pld_snoc_wlan_enable(struct pld_wlan_enable_cfg *config, - enum pld_driver_mode mode, const char *host_version) +static inline int pld_snoc_wlan_enable(struct device *dev, + struct pld_wlan_enable_cfg *config, + enum pld_driver_mode mode, const char *host_version) { return 0; } -static inline int pld_snoc_wlan_disable(enum pld_driver_mode mode) +static inline int pld_snoc_wlan_disable(struct device *dev, + enum pld_driver_mode mode) { return 0; } -static inline int pld_snoc_ce_request_irq(unsigned int ce_id, - irqreturn_t (*handler)(int, void *), - unsigned long flags, const char *name, void *ctx) +static inline int pld_snoc_ce_request_irq(struct device *dev, + unsigned int ce_id, + irqreturn_t (*handler)(int, void *), + unsigned long flags, + const char *name, void *ctx) { return 0; } -static inline int pld_snoc_ce_free_irq(unsigned int ce_id, void *ctx) +static inline int pld_snoc_ce_free_irq(struct device *dev, + unsigned int ce_id, void *ctx) { return 0; } -static inline void pld_snoc_enable_irq(unsigned int ce_id) +static inline void pld_snoc_enable_irq(struct device *dev, unsigned int ce_id) { } -static inline void pld_snoc_disable_irq(unsigned int ce_id) +static inline void pld_snoc_disable_irq(struct device *dev, unsigned int ce_id) { } -static inline int pld_snoc_get_soc_info(struct pld_soc_info *info) +static inline int pld_snoc_get_soc_info(struct device *dev, struct pld_soc_info *info) { return 0; } -static inline int pld_snoc_get_ce_id(int irq) +static inline int pld_snoc_get_ce_id(struct device *dev, int irq) { return 0; } @@ -83,7 +88,7 @@ static inline int pld_snoc_power_off(struct device *dev) { return 0; } -static inline int pld_snoc_get_irq(int ce_id) +static inline int pld_snoc_get_irq(struct device *dev, int ce_id) { return 0; } @@ -113,11 +118,11 @@ unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev) { return 0; } -static inline int pld_snoc_is_qmi_disable(void) +static inline int pld_snoc_is_qmi_disable(struct device *dev) { return 0; } -static inline int pld_snoc_set_fw_log_mode(u8 fw_log_mode) +static inline int pld_snoc_set_fw_log_mode(struct device *dev, u8 fw_log_mode) { return 0; } @@ -128,33 +133,98 @@ static inline int pld_snoc_force_assert_target(struct device *dev) #else int pld_snoc_register_driver(void); void pld_snoc_unregister_driver(void); -int pld_snoc_wlan_enable(struct pld_wlan_enable_cfg *config, +int pld_snoc_wlan_enable(struct device *dev, + struct pld_wlan_enable_cfg *config, enum pld_driver_mode mode, const char *host_version); -int pld_snoc_wlan_disable(enum pld_driver_mode mode); -int pld_snoc_get_soc_info(struct pld_soc_info *info); -static inline int pld_snoc_ce_request_irq(unsigned int ce_id, +int pld_snoc_wlan_disable(struct device *dev, enum pld_driver_mode mode); +int pld_snoc_get_soc_info(struct device *dev, struct pld_soc_info *info); + +#ifdef ICNSS_API_WITH_DEV +static inline int pld_snoc_ce_request_irq(struct device *dev, + unsigned int ce_id, + irqreturn_t (*handler)(int, void *), + unsigned long flags, + const char *name, void *ctx) +{ + if (!dev) + return -ENODEV; + + return icnss_ce_request_irq(dev, ce_id, handler, flags, name, ctx); +} + +static inline int pld_snoc_ce_free_irq(struct device *dev, + unsigned int ce_id, void *ctx) +{ + if (!dev) + return -ENODEV; + + return icnss_ce_free_irq(dev, ce_id, ctx); +} + +static inline void pld_snoc_enable_irq(struct device *dev, unsigned int ce_id) +{ + if (dev) + icnss_enable_irq(dev, ce_id); +} + +static inline void pld_snoc_disable_irq(struct device *dev, unsigned int ce_id) +{ + if (dev) + icnss_disable_irq(dev, ce_id); +} + +static inline int pld_snoc_get_ce_id(struct device *dev, int irq) +{ + if (!dev) + return -ENODEV; + + return icnss_get_ce_id(dev, irq); +} + +static inline int pld_snoc_get_irq(struct device *dev, int ce_id) +{ + if (!dev) + return -ENODEV; + + return icnss_get_irq(dev, ce_id); +} +#else +static inline int pld_snoc_ce_request_irq(struct device *dev, + unsigned int ce_id, irqreturn_t (*handler)(int, void *), unsigned long flags, const char *name, void *ctx) { return icnss_ce_request_irq(ce_id, handler, flags, name, ctx); } -static inline int pld_snoc_ce_free_irq(unsigned int ce_id, void *ctx) -{ - return icnss_ce_free_irq(ce_id, ctx); -} -static inline void pld_snoc_enable_irq(unsigned int ce_id) + +static inline void pld_snoc_enable_irq(struct device *dev, unsigned int ce_id) { icnss_enable_irq(ce_id); } -static inline void pld_snoc_disable_irq(unsigned int ce_id) + +static inline void pld_snoc_disable_irq(struct device *dev, unsigned int ce_id) { icnss_disable_irq(ce_id); } -static inline int pld_snoc_get_ce_id(int irq) + +static inline int pld_snoc_ce_free_irq(struct device *dev, + unsigned int ce_id, void *ctx) +{ + return icnss_ce_free_irq(ce_id, ctx); +} + +static inline int pld_snoc_get_ce_id(struct device *dev, int irq) { return icnss_get_ce_id(irq); } + +static inline int pld_snoc_get_irq(struct device *dev, int ce_id) +{ + return icnss_get_irq(ce_id); +} +#endif + static inline int pld_snoc_power_on(struct device *dev) { return icnss_power_on(dev); @@ -163,10 +233,6 @@ static inline int pld_snoc_power_off(struct device *dev) { return icnss_power_off(dev); } -static inline int pld_snoc_get_irq(int ce_id) -{ - return icnss_get_irq(ce_id); -} static inline int pld_snoc_athdiag_read(struct device *dev, uint32_t offset, uint32_t memtype, uint32_t datalen, uint8_t *output) @@ -193,14 +259,35 @@ unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev) { return icnss_socinfo_get_serial_number(dev); } -static inline int pld_snoc_is_qmi_disable(void) + +#ifdef ICNSS_API_WITH_DEV +static inline int pld_snoc_is_qmi_disable(struct device *dev) +{ + if (!dev) + return -ENODEV; + + return icnss_is_qmi_disable(dev); +} + +static inline int pld_snoc_set_fw_log_mode(struct device *dev, u8 fw_log_mode) +{ + if (!dev) + return -ENODEV; + + return icnss_set_fw_log_mode(dev, fw_log_mode); +} +#else +static inline int pld_snoc_is_qmi_disable(struct device *dev) { return icnss_is_qmi_disable(); } -static inline int pld_snoc_set_fw_log_mode(u8 fw_log_mode) + +static inline int pld_snoc_set_fw_log_mode(struct device *dev, u8 fw_log_mode) { return icnss_set_fw_log_mode(fw_log_mode); } +#endif + static inline int pld_snoc_force_assert_target(struct device *dev) { return icnss_trigger_recovery(dev); From c3d2863036b1c19f5402cbc4e0a531f0998a4853 Mon Sep 17 00:00:00 2001 From: snandini Date: Thu, 26 Oct 2017 07:27:52 -0700 Subject: [PATCH 03/36] Release 5.2.0.51I Release 5.2.0.51I Change-Id: I7b928b157a91484b10beec78680e43d64bdbd135 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 1e24f3f75728..b49b3717ac9a 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "H" +#define QWLAN_VERSION_EXTRA "I" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51H" +#define QWLAN_VERSIONSTR "5.2.0.51I" #endif /* QWLAN_VERSION_H */ From 47c234028741714800e68aab2bdebc5ae95e7d4e Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Wed, 25 Oct 2017 12:17:39 +0530 Subject: [PATCH 04/36] qcacld-3.0: Enable/Disable LRO for low throughput based on rx packet count It is observed that LRO is affecting the throughput in low TPUT noisy scenario as by its nature LRO suppresses the TCP acks. Change-Id: I9f74418b53492ae12934fc09277aafa0c002ae0b CRs-Fixed: 2056706 --- core/hdd/inc/wlan_hdd_lro.h | 15 +++++++++++++++ core/hdd/inc/wlan_hdd_main.h | 1 + core/hdd/src/wlan_hdd_lro.c | 11 ++++++++++- core/hdd/src/wlan_hdd_main.c | 5 +++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_lro.h b/core/hdd/inc/wlan_hdd_lro.h index 192337814175..5de60c741b86 100644 --- a/core/hdd/inc/wlan_hdd_lro.h +++ b/core/hdd/inc/wlan_hdd_lro.h @@ -51,6 +51,16 @@ enum hdd_lro_rx_status hdd_lro_rx(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter, struct sk_buff *skb); void hdd_lro_display_stats(struct hdd_context *hdd_ctx); void hdd_disable_lro_in_concurrency(bool); +/** + * hdd_disable_lro_for_low_tput() - enable/disable LRO based on tput + * hdd_ctx: hdd context + * disable: boolean to enable/disable LRO + * + * This API enables/disables LRO based on tput. + * + * Return: void + */ +void hdd_disable_lro_for_low_tput(struct hdd_context *hdd_ctx, bool disable); #else static inline int hdd_lro_init(struct hdd_context *hdd_ctx) { @@ -70,5 +80,10 @@ static inline void hdd_lro_display_stats(struct hdd_context *hdd_ctx) static inline void hdd_disable_lro_in_concurrency(bool disable) { } + +static inline void +hdd_disable_lro_for_low_tput(struct hdd_context *hdd_ctx, bool disable) +{ +} #endif /* FEATURE_LRO */ #endif /* __WLAN_HDD_LRO_H__ */ diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 78757f58e854..37f67f1d64bb 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1719,6 +1719,7 @@ struct hdd_context { int user_configured_pkt_filter_rules; bool is_fils_roaming_supported; qdf_atomic_t disable_lro_in_concurrency; + qdf_atomic_t disable_lro_in_low_tput; bool en_tcp_delack_no_lro; }; diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index b9bc5ee5b683..916f1929b5d5 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -148,7 +148,8 @@ enum hdd_lro_rx_status hdd_lro_rx(struct hdd_context *hdd_ctx, if (((adapter->dev->features & NETIF_F_LRO) != NETIF_F_LRO) || !QDF_NBUF_CB_RX_TCP_PROTO(skb) || QDF_NBUF_CB_RX_PEER_CACHED_FRM(skb) || - qdf_atomic_read(&hdd_ctx->disable_lro_in_concurrency)) + qdf_atomic_read(&hdd_ctx->disable_lro_in_concurrency) || + qdf_atomic_read(&hdd_ctx->disable_lro_in_low_tput)) return HDD_LRO_NO_RX; { @@ -237,3 +238,11 @@ void hdd_disable_lro_in_concurrency(bool disable) qdf_atomic_set(&hdd_ctx->disable_lro_in_concurrency, 0); } } + +void hdd_disable_lro_for_low_tput(struct hdd_context *hdd_ctx, bool disable) +{ + if (disable) + qdf_atomic_set(&hdd_ctx->disable_lro_in_low_tput, 1); + else + qdf_atomic_set(&hdd_ctx->disable_lro_in_low_tput, 0); +} diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d7e14b3bace0..9869ceac02cb 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6406,6 +6406,11 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx, hdd_ctx->prev_rx = rx_packets; + if (temp_rx < hdd_ctx->config->busBandwidthLowThreshold) + hdd_disable_lro_for_low_tput(hdd_ctx, true); + else + hdd_disable_lro_for_low_tput(hdd_ctx, false); + if (temp_rx > hdd_ctx->config->tcpDelackThresholdHigh) { if ((hdd_ctx->cur_rx_level != WLAN_SVC_TP_HIGH) && (++hdd_ctx->rx_high_ind_cnt == delack_timer_cnt)) { From d886f8da6b093430fc81802f09880037f1e993d8 Mon Sep 17 00:00:00 2001 From: snandini Date: Thu, 26 Oct 2017 09:46:32 -0700 Subject: [PATCH 05/36] Release 5.2.0.51J Release 5.2.0.51J Change-Id: Ief8bf6620a7ab0cd46b63410eb1fa2e6c807a9cf CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index b49b3717ac9a..edceeed27627 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "I" +#define QWLAN_VERSION_EXTRA "J" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51I" +#define QWLAN_VERSIONSTR "5.2.0.51J" #endif /* QWLAN_VERSION_H */ From f4928a4688ee58a7c312fbc2437d04df345e65f6 Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Tue, 24 Oct 2017 11:28:07 +0530 Subject: [PATCH 06/36] qcacld-3.0: Adding the missed p2p_listen_defer_interval Included CFG_P2P_LISTEN_DEFER_INTERVAL_NAME in g_registry_table. Change-Id: Iec0e3581ea6de3965b7767f4895f6f2ef231e25a CRs-Fixed: 2130649 --- core/hdd/src/wlan_hdd_cfg.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 1c270bd3d2e6..288e734784af 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3612,6 +3612,14 @@ struct reg_table_entry g_registry_table[] = { CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MIN, CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MAX), + REG_VARIABLE(CFG_P2P_LISTEN_DEFER_INTERVAL_NAME, WLAN_PARAM_Integer, + struct hdd_config, p2p_listen_defer_interval, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_P2P_LISTEN_DEFER_INTERVAL_DEFAULT, + CFG_P2P_LISTEN_DEFER_INTERVAL_MIN, + CFG_P2P_LISTEN_DEFER_INTERVAL_MAX), + REG_VARIABLE(CFG_MULTICAST_HOST_FW_MSGS, WLAN_PARAM_Integer, struct hdd_config, multicast_host_fw_msgs, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, From 39cbfc1bfcb4bb6232d6badaed28a38f4611cb72 Mon Sep 17 00:00:00 2001 From: snandini Date: Thu, 26 Oct 2017 11:43:30 -0700 Subject: [PATCH 07/36] Release 5.2.0.51K Release 5.2.0.51K Change-Id: I0a47c3636fa2a9ddabb2afb7ce46e044d6f27765 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index edceeed27627..ede2de1f884a 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "J" +#define QWLAN_VERSION_EXTRA "K" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51J" +#define QWLAN_VERSIONSTR "5.2.0.51K" #endif /* QWLAN_VERSION_H */ From a5cf8e02074ed235f219c1889158c5720bc8728d Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 19 Oct 2017 16:04:19 -0700 Subject: [PATCH 08/36] qcacld-3.0: Cleanup ACS channels in stop adapter Currently, the auto channel selection (ACS) channel list is cleaned up when ACS is disabled from userspace. Make sure the ACS channel list is cleaned up as part of adapter stop to cover cases where userspace does not trigger the cleanup of the ACS channel list. Change-Id: I92b63c7ea53fba55a39e6b414d0f3ed28d4019a2 CRs-Fixed: 2129647 --- core/hdd/src/wlan_hdd_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 9869ceac02cb..fe2d9343925f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4410,6 +4410,7 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx, struct hdd_adapter *ada case QDF_SAP_MODE: /* Flush IPA exception path packets */ hdd_ipa_flush(hdd_ctx); + case QDF_P2P_GO_MODE: if (QDF_SAP_MODE == adapter->device_mode) { if (test_bit(ACS_PENDING, &adapter->event_flags)) { @@ -4419,7 +4420,9 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx, struct hdd_adapter *ada } } cds_flush_work(&adapter->sap_stop_bss_work); + /* Any softap specific cleanup here... */ + wlan_hdd_undo_acs(adapter); if (adapter->device_mode == QDF_P2P_GO_MODE) wlan_hdd_cleanup_remain_on_channel_ctx(adapter); From e6119931d64ee75e3536d508a5b7aa73726ba1d0 Mon Sep 17 00:00:00 2001 From: snandini Date: Thu, 26 Oct 2017 13:39:22 -0700 Subject: [PATCH 09/36] Release 5.2.0.51L Release 5.2.0.51L Change-Id: I6fc16706d01aff171f3e0260fff6df03c4406176 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index ede2de1f884a..91a317ba9d45 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "K" +#define QWLAN_VERSION_EXTRA "L" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51K" +#define QWLAN_VERSIONSTR "5.2.0.51L" #endif /* QWLAN_VERSION_H */ From 5ac6bd29203b802969dbb3deb0eb0dc5252d9726 Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Tue, 17 Oct 2017 12:33:56 -0700 Subject: [PATCH 10/36] qcacld-3.0: Allow recovery during firmware down Host is triggering crash during vdev response timeout handler when firmware is down. If firmware is down, Send failure response to upper layer from WMA vdev timeout response handler so that recovery can complete. Change-Id: Ib5cf2c539fded700b07a694fa6771c9ba8550173 CRs-Fixed: 2128282 --- core/hdd/src/wlan_hdd_driver_ops.c | 2 ++ core/wma/src/wma_dev_if.c | 3 ++- core/wma/src/wma_main.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 3bcefdb2a362..3beff6aecea8 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1455,6 +1455,8 @@ static void wlan_hdd_purge_notifier(void) static void wlan_hdd_pld_uevent(struct device *dev, struct pld_uevent_data *uevent) { + + hdd_info("pld event %d", uevent->uevent); switch (uevent->uevent) { case PLD_RECOVERY: cds_set_recovery_in_progress(true); diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index cec3bf650916..61b91faf421d 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -2723,7 +2723,8 @@ static inline bool wma_crash_on_fw_timeout(bool crash_enabled) if (cds_is_driver_recovering()) return false; - if (!cds_is_fw_down()) + /* Firmware is down send failure response */ + if (cds_is_fw_down()) return false; if (cds_is_driver_unloading()) diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index ae85f5db155b..cba14fe14edc 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1933,6 +1933,8 @@ static void wma_cleanup_vdev_resp_queue(tp_wma_handle wma) return; } + WMA_LOGD(FL("Cleaning up vdev resp queue")); + /* peek front, and then cleanup it in wma_vdev_resp_timer */ while (qdf_list_peek_front(&wma->vdev_resp_queue, &node1) == QDF_STATUS_SUCCESS) { From f79711973f3420c3e28f84076599af737f1c2e62 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Wed, 25 Oct 2017 14:54:37 -0700 Subject: [PATCH 11/36] qcacld-3.0: Return failure from cds_open for all failure paths cds_open() currently returns success for a large subset of its failure paths. Ensure a failure reason is returned for every failure path in cds_open(). Change-Id: I857ffce4eac30ce3fc332c5392c1e859217c414f CRs-Fixed: 2132715 --- core/cds/src/cds_api.c | 76 ++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 32 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 3517a4fa44ea..eeedb19c1dc4 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -410,7 +410,7 @@ cds_set_ac_specs_params(struct cds_config_info *cds_cfg) */ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) { - QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; + QDF_STATUS status; tSirRetStatus sirStatus = eSIR_SUCCESS; struct cds_config_info *cds_cfg; qdf_device_t qdf_ctx; @@ -439,37 +439,40 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) cds_init_log_completion(); /* Initialize the probe event */ - if (qdf_event_create(&gp_cds_context->ProbeEvent) != QDF_STATUS_SUCCESS) { + status = qdf_event_create(&gp_cds_context->ProbeEvent); + if (QDF_IS_STATUS_ERROR(status)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Unable to init probeEvent", __func__); QDF_ASSERT(0); - return QDF_STATUS_E_FAILURE; + return status; } - if (qdf_event_create(&(gp_cds_context->wmaCompleteEvent)) != - QDF_STATUS_SUCCESS) { + + status = qdf_event_create(&gp_cds_context->wmaCompleteEvent); + if (QDF_IS_STATUS_ERROR(status)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Unable to init wmaCompleteEvent", __func__); QDF_ASSERT(0); goto err_probe_event; } - hdd_ctx = (struct hdd_context *) (gp_cds_context->pHDDContext); - if ((NULL == hdd_ctx) || (NULL == hdd_ctx->config)) { + hdd_ctx = (struct hdd_context *)(gp_cds_context->pHDDContext); + if (!hdd_ctx || !hdd_ctx->config) { /* Critical Error ... Cannot proceed further */ cds_err("Hdd Context is Null"); QDF_ASSERT(0); + + status = QDF_STATUS_E_FAILURE; goto err_wma_complete_event; } /* Now Open the CDS Scheduler */ - if (hdd_ctx->driver_status == DRIVER_MODULES_UNINITIALIZED || cds_is_driver_recovering()) { - qdf_status = cds_sched_open(gp_cds_context, - &gp_cds_context->qdf_sched, - sizeof(cds_sched_context)); + status = cds_sched_open(gp_cds_context, + &gp_cds_context->qdf_sched, + sizeof(cds_sched_context)); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + if (QDF_IS_STATUS_ERROR(status)) { /* Critical Error ... Cannot proceed further */ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Failed to open CDS Scheduler", __func__); @@ -482,6 +485,8 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) if (!scn) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: scn is null!", __func__); + + status = QDF_STATUS_E_FAILURE; goto err_sched_close; } @@ -489,17 +494,20 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) if (!cds_cfg) { cds_err("Cds config is NULL"); QDF_ASSERT(0); + + status = QDF_STATUS_E_FAILURE; goto err_sched_close; } + hdd_enable_fastpath(hdd_ctx->config, scn); hdd_wlan_update_target_info(hdd_ctx, scn); - ol_ctx = cds_get_context(QDF_MODULE_ID_BMI); /* Initialize BMI and Download firmware */ - qdf_status = bmi_download_firmware(ol_ctx); - if (qdf_status != QDF_STATUS_SUCCESS) { + ol_ctx = cds_get_context(QDF_MODULE_ID_BMI); + status = bmi_download_firmware(ol_ctx); + if (QDF_IS_STATUS_ERROR(status)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, - "BMI FIALED status:%d", qdf_status); + "BMI FIALED status:%d", status); goto err_bmi_close; } htcInfo.pContext = ol_ctx; @@ -516,20 +524,22 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) if (!gp_cds_context->htc_ctx) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Failed to Create HTC", __func__); + + status = QDF_STATUS_E_FAILURE; goto err_bmi_close; } pmo_ucfg_psoc_update_htc_handle(psoc, (void *)gp_cds_context->htc_ctx); - if (bmi_done(ol_ctx)) { + status = bmi_done(ol_ctx); + if (QDF_IS_STATUS_ERROR(status)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Failed to complete BMI phase", __func__); goto err_htc_close; } /*Open the WMA module */ - qdf_status = wma_open(psoc, hdd_update_tgt_cfg, cds_cfg); - - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + status = wma_open(psoc, hdd_update_tgt_cfg, cds_cfg); + if (QDF_IS_STATUS_ERROR(status)) { /* Critical Error ... Cannot proceed further */ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Failed to open WMA module", __func__); @@ -553,15 +563,16 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) if (!HTCHandle) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: HTCHandle is null!", __func__); + + status = QDF_STATUS_E_FAILURE; goto err_wma_close; } - qdf_status = htc_wait_target(HTCHandle); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - cds_alert("Complete BMI phase failed. status: %d", qdf_status); + status = htc_wait_target(HTCHandle); + if (QDF_IS_STATUS_ERROR(status)) { + cds_alert("Failed to complete BMI phase. status: %d", status); - if (qdf_status != QDF_STATUS_E_NOMEM - && !cds_is_fw_down()) + if (status != QDF_STATUS_E_NOMEM && !cds_is_fw_down()) QDF_BUG(0); goto err_wma_close; @@ -584,14 +595,13 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) gp_cds_context->htc_ctx, gp_cds_context->qdf_ctx, &dp_ol_if_ops, psoc); - if (!gp_cds_context->dp_soc) + if (!gp_cds_context->dp_soc) { + status = QDF_STATUS_E_FAILURE; goto err_wma_close; + } pmo_ucfg_psoc_update_dp_handle(psoc, gp_cds_context->dp_soc); - if (gp_cds_context->dp_soc == NULL) - goto err_wma_close; - cds_set_ac_specs_params(cds_cfg); cds_cdp_cfg_attach(cds_cfg); @@ -606,12 +616,14 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Failed to open MAC", __func__); QDF_ASSERT(0); + + status = QDF_STATUS_E_FAILURE; goto err_soc_detach; } /* Now proceed to open the SME */ - qdf_status = sme_open(gp_cds_context->pMACContext); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + status = sme_open(gp_cds_context->pMACContext); + if (QDF_IS_STATUS_ERROR(status)) { /* Critical Error ... Cannot proceed further */ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Failed to open SME", __func__); @@ -659,7 +671,7 @@ err_wma_complete_event: err_probe_event: qdf_event_destroy(&gp_cds_context->ProbeEvent); - return qdf_status; + return status; } /* cds_open() */ QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc) From 21fff3db42f6596046325d12f366eb583e41e742 Mon Sep 17 00:00:00 2001 From: snandini Date: Thu, 26 Oct 2017 15:39:32 -0700 Subject: [PATCH 12/36] Release 5.2.0.51M Release 5.2.0.51M Change-Id: I85474d4f8175400b830429314030a802bb6cbfd9 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 91a317ba9d45..7c70e7589f8c 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "L" +#define QWLAN_VERSION_EXTRA "M" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51L" +#define QWLAN_VERSIONSTR "5.2.0.51M" #endif /* QWLAN_VERSION_H */ From 5303e081e225859c59218dd74c51b0e4264885e2 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Tue, 24 Oct 2017 14:20:00 -0700 Subject: [PATCH 13/36] qcacld-3.0: Check vdev status before sending vdev up Check the vdev status if it is already UP before sending the vdev up command to the firmware. Take care of the below scenario by not sending the vdev up as the firmware cannot handle another vdev up command if the vdev is already UP. 1)STA mode VDEV restart is going on and host sends VDEV restart request to FW. 2)At the same time peer assoc request message is posted from LIM to WMA. 3)FW WMI VDEV start response is received through WMI_VDEV_RESTART_RESP_EVENT. 4)In this case 2) will send vdev up and no 3) also will send the second vdev up. Change-Id: I7fe97473c26a0653b8328d1dab2e5799cbd21f10 CRs-Fixed: 2131729 --- core/wma/src/wma_utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 50aaf24c27d4..ac05274043df 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -4589,6 +4589,11 @@ QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma, QDF_STATUS status; struct wma_txrx_node *vdev = &wma->interfaces[params->vdev_id]; + if (wma_is_vdev_up(params->vdev_id)) { + WMA_LOGD("vdev %d is already up for bssid %pM. Do not send", + params->vdev_id, bssid); + return QDF_STATUS_SUCCESS; + } status = wmi_unified_vdev_up_send(wma->wmi_handle, bssid, params); wma_release_wakelock(&vdev->vdev_start_wakelock); From 62c3265af251f28b51948f5a75ca8836e855ce81 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Thu, 26 Oct 2017 15:32:35 -0700 Subject: [PATCH 14/36] qcacld-3.0: Check firmware MAWC capability Check for the target capability for MAWC(Motion Aided Wireless Connectivity) feature before sending the roaming or PNO based MAWC WMI commands to the firmware. Change-Id: I0cc344d8307cf43996c2eede835bf9069790fa56 CRs-Fixed: 2117825 --- core/hdd/src/wlan_hdd_main.c | 1 + core/wma/inc/wma_tgt_cfg.h | 2 ++ core/wma/src/wma_main.c | 6 ++++++ core/wma/src/wma_scan_roam.c | 15 +++++++++++---- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index fe2d9343925f..f12f7f45c1c6 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1075,6 +1075,7 @@ static void hdd_update_tgt_services(struct hdd_context *hdd_ctx, config->isRoamOffloadEnabled &= cfg->en_roam_offload; #endif config->sap_get_peer_info &= cfg->get_peer_info_enabled; + config->MAWCEnabled &= cfg->is_fw_mawc_capable; sme_update_tgt_services(hdd_ctx->hHal, cfg); } diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h index 2df455af56fb..3a82c8bfe0f0 100644 --- a/core/wma/inc/wma_tgt_cfg.h +++ b/core/wma/inc/wma_tgt_cfg.h @@ -45,6 +45,7 @@ * @en_tdls_uapsd_sleep_sta: enable sta tdls uapsd sleep * @en_roam_offload: enable roam offload * @en_11ax: enable 11ax + * @is_fw_mawc_capable: Motion Aided Wireless Connectivity feature */ struct wma_tgt_services { uint32_t sta_power_save; @@ -71,6 +72,7 @@ struct wma_tgt_services { bool en_11ax; bool get_peer_info_enabled; bool is_fils_roaming_supported; + bool is_fw_mawc_capable; }; /** diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index cba14fe14edc..d82a438d36c0 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -4304,6 +4304,12 @@ static inline void wma_update_target_services(tp_wma_handle wh, wh->wmi_service_ext_bitmap, WMI_SERVICE_FILS_SUPPORT)) cfg->is_fils_roaming_supported = true; + + if (WMI_SERVICE_EXT_IS_ENABLED(wh->wmi_service_bitmap, + wh->wmi_service_ext_bitmap, + WMI_SERVICE_MAWC_SUPPORT)) + cfg->is_fw_mawc_capable = true; + } /** diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 12893ada58b9..454eb0935e8b 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -1960,10 +1960,17 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle, roam_req->sessionId); if (qdf_status != QDF_STATUS_SUCCESS) break; - qdf_status = wma_roam_scan_mawc_params(wma_handle, roam_req); - if (qdf_status != QDF_STATUS_SUCCESS) { - WMA_LOGE("Sending roaming MAWC params failed"); - break; + if (WMI_SERVICE_EXT_IS_ENABLED(wma_handle->wmi_service_bitmap, + wma_handle->wmi_service_ext_bitmap, + WMI_SERVICE_MAWC_SUPPORT)) { + qdf_status = + wma_roam_scan_mawc_params(wma_handle, roam_req); + if (qdf_status != QDF_STATUS_SUCCESS) { + WMA_LOGE("Sending roaming MAWC params failed"); + break; + } + } else { + WMA_LOGD("MAWC roaming not supported by firmware"); } qdf_status = wma_roam_scan_filter(wma_handle, roam_req); if (qdf_status != QDF_STATUS_SUCCESS) { From 199c2ed245e841859072424808a8049e4812d8ed Mon Sep 17 00:00:00 2001 From: Yun Park Date: Mon, 2 Oct 2017 11:24:22 -0700 Subject: [PATCH 15/36] qcacld-3.0: Add warning log for IPA session control critical code path Add warning log at the critical code path of IPA session transition for the race condition detection Set INFO log level to enter/exit logs for IPA session transition code path. Change-Id: I5089db5f53d13e5f78093171672ad86f7bd1cdc2 CRs-Fixed: 2124144 --- core/dp/htt/htt.c | 11 +++ core/dp/htt/htt_h2t.c | 4 + core/hdd/src/wlan_hdd_ipa.c | 137 +++++++++++++++++++++-------------- core/wma/src/wma_scan_roam.c | 7 +- 4 files changed, 104 insertions(+), 55 deletions(-) diff --git a/core/dp/htt/htt.c b/core/dp/htt/htt.c index 80738ed48a5e..dbe9363ae0f8 100644 --- a/core/dp/htt/htt.c +++ b/core/dp/htt/htt.c @@ -833,6 +833,9 @@ int htt_ipa_uc_attach(struct htt_pdev_t *pdev) { int error; + QDF_TRACE(QDF_MODULE_ID_HTT, QDF_TRACE_LEVEL_INFO, "%s: enter", + __func__); + /* TX resource attach */ error = htt_tx_ipa_uc_attach( pdev, @@ -857,6 +860,8 @@ int htt_ipa_uc_attach(struct htt_pdev_t *pdev) return error; } + QDF_TRACE(QDF_MODULE_ID_HTT, QDF_TRACE_LEVEL_INFO, "%s: exit", + __func__); return 0; /* success */ } @@ -868,11 +873,17 @@ int htt_ipa_uc_attach(struct htt_pdev_t *pdev) */ void htt_ipa_uc_detach(struct htt_pdev_t *pdev) { + QDF_TRACE(QDF_MODULE_ID_HTT, QDF_TRACE_LEVEL_INFO, "%s: enter", + __func__); + /* TX IPA micro controller detach */ htt_tx_ipa_uc_detach(pdev); /* RX IPA micro controller detach */ htt_rx_ipa_uc_detach(pdev); + + QDF_TRACE(QDF_MODULE_ID_HTT, QDF_TRACE_LEVEL_INFO, "%s: exit", + __func__); } /** diff --git a/core/dp/htt/htt_h2t.c b/core/dp/htt/htt_h2t.c index e13ce203605d..661f8b511d6c 100644 --- a/core/dp/htt/htt_h2t.c +++ b/core/dp/htt/htt_h2t.c @@ -1284,6 +1284,10 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev, else if (!uc_active && !is_tx) active_target = HTT_WDI_IPA_OPCODE_RX_SUSPEND; + QDF_TRACE(QDF_MODULE_ID_HTT, QDF_TRACE_LEVEL_INFO, + "%s: HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ (%d)\n", + __func__, active_target); + HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(*msg_word, active_target); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ); diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 3007c0ccd9b4..15f3ae5d34be 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -1856,7 +1856,18 @@ static int hdd_ipa_uc_enable_pipes(struct hdd_ipa_priv *hdd_ipa) void *soc = cds_get_context(QDF_MODULE_ID_SOC); struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); + + if (!hdd_ipa->ipa_pipes_down) { + /* + * This shouldn't happen : + * IPA WDI Pipes are already activated + */ + WARN_ON(1); + HDD_IPA_LOG(QDF_TRACE_LEVEL_WARN, + "IPA WDI Pipes are already activated"); + goto end; + } result = cdp_ipa_enable_pipes(soc, (struct cdp_pdev *)pdev); if (result) { @@ -1871,8 +1882,9 @@ static int hdd_ipa_uc_enable_pipes(struct hdd_ipa_priv *hdd_ipa) cdp_ipa_enable_autonomy(soc, (struct cdp_pdev *)pdev); end: - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: ipa_pipes_down=%d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: ipa_pipes_down=%d", hdd_ipa->ipa_pipes_down); + return result; } @@ -1888,7 +1900,18 @@ static int hdd_ipa_uc_disable_pipes(struct hdd_ipa_priv *hdd_ipa) struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); int result = 0; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); + + if (hdd_ipa->ipa_pipes_down) { + /* + * This shouldn't happen : + * IPA WDI Pipes are already deactivated + */ + WARN_ON(1); + HDD_IPA_LOG(QDF_TRACE_LEVEL_WARN, + "IPA WDI Pipes are already deactivated"); + goto end; + } cdp_ipa_disable_autonomy(soc, (struct cdp_pdev *)pdev); @@ -1902,7 +1925,7 @@ static int hdd_ipa_uc_disable_pipes(struct hdd_ipa_priv *hdd_ipa) hdd_ipa->ipa_pipes_down = true; end: - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: ipa_pipes_down=%d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: ipa_pipes_down=%d", hdd_ipa->ipa_pipes_down); return result; } @@ -1917,7 +1940,7 @@ static int hdd_ipa_uc_handle_first_con(struct hdd_ipa_priv *hdd_ipa) { struct hdd_context *hdd_ctx = hdd_ipa->hdd_ctx; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); hdd_ipa->activated_fw_pipe = 0; hdd_ipa->resource_loading = true; @@ -1931,13 +1954,6 @@ static int hdd_ipa_uc_handle_first_con(struct hdd_ipa_priv *hdd_ipa) /* RM PROD request sync return * enable pipe immediately */ - if (!hdd_ipa->ipa_pipes_down) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, - "%s: IPA WDI Pipe already activated", - __func__); - return 0; - } - if (hdd_ipa_uc_enable_pipes(hdd_ipa)) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "IPA WDI Pipe activation failed"); @@ -1946,8 +1962,7 @@ static int hdd_ipa_uc_handle_first_con(struct hdd_ipa_priv *hdd_ipa) } } else { HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, - "%s: IPA WDI Pipe activation deferred", - __func__); + "IPA WDI Pipe activation deferred"); } } else { /* RM Disabled @@ -1962,7 +1977,7 @@ static int hdd_ipa_uc_handle_first_con(struct hdd_ipa_priv *hdd_ipa) hdd_ipa->resource_loading = false; } - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: IPA WDI Pipes activated!"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit"); return 0; } @@ -1977,7 +1992,7 @@ static void hdd_ipa_uc_handle_last_discon(struct hdd_ipa_priv *hdd_ipa) void *soc = cds_get_context(QDF_MODULE_ID_SOC); void *pdev = cds_get_context(QDF_MODULE_ID_TXRX); - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); if (!pdev) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "txrx context is NULL"); @@ -1992,7 +2007,7 @@ static void hdd_ipa_uc_handle_last_discon(struct hdd_ipa_priv *hdd_ipa) HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "Disable FW TX PIPE"); cdp_ipa_set_active(soc, (struct cdp_pdev *)pdev, false, true); - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: IPA WDI Pipes deactivated"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: IPA WDI Pipes deactivated"); } /** @@ -2526,8 +2541,12 @@ static void hdd_ipa_uc_offload_enable_disable(struct hdd_adapter *adapter, return; } if (enable == hdd_ipa->vdev_offload_enabled[session_id]) { - /* IPA offload status is already set as desired */ - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + /* + * This shouldn't happen : + * IPA offload status is already set as desired + */ + WARN_ON(1); + HDD_IPA_LOG(QDF_TRACE_LEVEL_WARN, "%s (offload_type=%d, vdev_id=%d, enable=%d)", "IPA offload status is already set", offload_type, session_id, enable); @@ -2547,7 +2566,7 @@ static void hdd_ipa_uc_offload_enable_disable(struct hdd_adapter *adapter, ipa_offload_enable_disable.vdev_id = session_id; ipa_offload_enable_disable.enable = enable; - HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "offload_type=%d, vdev_id=%d, enable=%d", ipa_offload_enable_disable.offload_type, ipa_offload_enable_disable.vdev_id, @@ -2828,7 +2847,7 @@ QDF_STATUS hdd_ipa_uc_ol_init(struct hdd_context *hdd_ctx) if (!hdd_ipa_uc_is_enabled(hdd_ctx)) return QDF_STATUS_SUCCESS; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); /* Do only IPA Pipe specific configuration here. All one time * initialization wrt IPA UC shall in hdd_ipa_init and those need @@ -2842,7 +2861,8 @@ QDF_STATUS hdd_ipa_uc_ol_init(struct hdd_context *hdd_ctx) if (cdp_ipa_get_resource(soc, (struct cdp_pdev *)pdev)) { HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "IPA UC resource alloc fail"); - return QDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; + goto fail_return; } if (true == hdd_ipa->uc_loaded) { @@ -2857,7 +2877,8 @@ QDF_STATUS hdd_ipa_uc_ol_init(struct hdd_context *hdd_ctx) HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "Failure to setup IPA pipes (status=%d)", status); - return QDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; + goto fail_return; } cdp_ipa_set_doorbell_paddr(soc, (struct cdp_pdev *)pdev); @@ -2874,7 +2895,7 @@ QDF_STATUS hdd_ipa_uc_ol_init(struct hdd_context *hdd_ctx) } fail_return: - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: stat=%d", status); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: status=%d", status); return status; } @@ -2905,7 +2926,7 @@ int hdd_ipa_uc_ol_deinit(struct hdd_context *hdd_ctx) int ret = 0; QDF_STATUS status; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); if (!hdd_ipa_uc_is_enabled(hdd_ctx)) return ret; @@ -2927,7 +2948,7 @@ int hdd_ipa_uc_ol_deinit(struct hdd_context *hdd_ctx) hdd_ipa_cleanup_pending_event(hdd_ipa); - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: ret=%d", ret); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: ret=%d", ret); return ret; } @@ -2946,7 +2967,7 @@ static void __hdd_ipa_uc_force_pipe_shutdown(struct hdd_context *hdd_ctx) { struct hdd_ipa_priv *hdd_ipa; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); if (!hdd_ipa_is_enabled(hdd_ctx) || !hdd_ctx->hdd_ipa) return; @@ -2961,7 +2982,7 @@ static void __hdd_ipa_uc_force_pipe_shutdown(struct hdd_context *hdd_ctx) "IPA pipes are down, do nothing"); } - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit"); } /** @@ -3028,7 +3049,7 @@ static int hdd_ipa_uc_send_evt(struct hdd_adapter *adapter, strlcpy(msg->name, adapter->dev->name, IPA_RESOURCE_NAME_MAX); memcpy(msg->mac_addr, mac_addr, ETH_ALEN); - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "%s: Evt: %d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: Evt: %d", msg->name, meta.msg_type); ret = ipa_send_msg(&meta, msg, hdd_ipa_msg_free_fn); if (ret) { @@ -3058,7 +3079,7 @@ static int hdd_ipa_uc_disconnect_client(struct hdd_adapter *adapter) int ret = 0; int i; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); for (i = 0; i < WLAN_MAX_STA_COUNT; i++) { if (qdf_is_macaddr_broadcast(&adapter->sta_info[i].sta_mac)) continue; @@ -3070,7 +3091,7 @@ static int hdd_ipa_uc_disconnect_client(struct hdd_adapter *adapter) hdd_ipa->sap_num_connected_sta--; } } - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: sap_num_connected_sta=%d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: sap_num_connected_sta=%d", hdd_ipa->sap_num_connected_sta); return ret; @@ -3089,12 +3110,12 @@ static int hdd_ipa_uc_disconnect_ap(struct hdd_adapter *adapter) { int ret = 0; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); if (adapter->ipa_context) { hdd_ipa_uc_send_evt(adapter, WLAN_AP_DISCONNECT, adapter->dev->dev_addr); } - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit"); return ret; } @@ -3113,14 +3134,14 @@ static int hdd_ipa_uc_disconnect_sta(struct hdd_adapter *adapter) struct hdd_ipa_priv *hdd_ipa = ghdd_ipa; int ret = 0; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx) && hdd_ipa->sta_connected) { sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); hdd_ipa_uc_send_evt(adapter, WLAN_STA_DISCONNECT, sta_ctx->conn_info.bssId.bytes); } - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit"); return ret; } @@ -3173,7 +3194,7 @@ static int __hdd_ipa_uc_ssr_deinit(void) struct hdd_ipa_iface_context *iface_context; struct hdd_context *hdd_ctx; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); if (!hdd_ipa) return 0; @@ -3215,7 +3236,7 @@ static int __hdd_ipa_uc_ssr_deinit(void) hdd_ipa->uc_op_work[idx].msg = NULL; } - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit"); return 0; } @@ -3253,7 +3274,7 @@ static int __hdd_ipa_uc_ssr_reinit(struct hdd_context *hdd_ctx) int i; struct hdd_ipa_iface_context *iface_context = NULL; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); if (!hdd_ipa || !hdd_ipa_uc_is_enabled(hdd_ctx)) return 0; @@ -3282,7 +3303,7 @@ static int __hdd_ipa_uc_ssr_reinit(struct hdd_context *hdd_ctx) hdd_ipa->uc_loaded = true; } - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit"); return 0; } @@ -3436,6 +3457,8 @@ static int hdd_ipa_rm_try_release(struct hdd_ipa_priv *hdd_ipa) if (unlikely(ret != 0)) { hdd_ipa->rm_state = HDD_IPA_RM_GRANTED; WARN_ON(1); + HDD_IPA_LOG(QDF_TRACE_LEVEL_WARN, + "ipa_rm_inactivity_timer_release_resource returnied fail"); } /* @@ -4724,7 +4747,7 @@ static void hdd_ipa_teardown_sys_pipe(struct hdd_ipa_priv *hdd_ipa) */ static void hdd_ipa_cleanup_iface(struct hdd_ipa_iface_context *iface_context) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); if (iface_context == NULL) return; @@ -4752,7 +4775,7 @@ static void hdd_ipa_cleanup_iface(struct hdd_ipa_iface_context *iface_context) QDF_ASSERT(0); } iface_context->hdd_ipa->num_iface--; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: num_iface=%d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: num_iface=%d", iface_context->hdd_ipa->num_iface); } @@ -4773,7 +4796,7 @@ static int hdd_ipa_setup_iface(struct hdd_ipa_priv *hdd_ipa, void *tl_context = NULL; int i, ret = 0; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); /* Lower layer may send multiple START_BSS_EVENT in DFS mode or during * channel change indication. Since these indications are sent by lower @@ -4822,7 +4845,7 @@ static int hdd_ipa_setup_iface(struct hdd_ipa_priv *hdd_ipa, hdd_ipa->num_iface++; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: num_iface=%d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: num_iface=%d", hdd_ipa->num_iface); return ret; @@ -5014,7 +5037,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, struct ipa_wlan_msg_ex *msg_ex = NULL; int ret; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "%s: %s evt, MAC: %pM sta_id: %d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: %s evt, MAC: %pM sta_id: %d", adapter->dev->name, hdd_ipa_wlan_event_to_str(type), mac_addr, sta_id); @@ -5142,7 +5165,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, qdf_mutex_release(&hdd_ipa->event_lock); - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "sta_connected=%d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "sta_connected=%d", hdd_ipa->sta_connected); break; @@ -5220,7 +5243,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, qdf_mutex_release(&hdd_ipa->event_lock); - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "sta_connected=%d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "sta_connected=%d", hdd_ipa->sta_connected); break; @@ -5246,8 +5269,14 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, */ hdd_ipa_uc_disable_pipes(hdd_ipa); } else { - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "NO INTF left but still pipe clean up"); + /* + * This shouldn't happen : + * No interface left but WDI pipes are still + * active - force close WDI pipes + */ + WARN_ON(1); + HDD_IPA_LOG(QDF_TRACE_LEVEL_WARN, + "No interface left but WDI pipes are still active - force close WDI pipes"); hdd_ipa_uc_handle_last_discon(hdd_ipa); } } @@ -5358,7 +5387,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, } hdd_ipa->stats.num_send_msg++; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "sap_num_connected_sta=%d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "sap_num_connected_sta=%d", hdd_ipa->sap_num_connected_sta); return ret; @@ -5410,7 +5439,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, qdf_mutex_release(&hdd_ipa->event_lock); } - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "sap_num_connected_sta=%d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "sap_num_connected_sta=%d", hdd_ipa->sap_num_connected_sta); break; @@ -5548,11 +5577,11 @@ static QDF_STATUS __hdd_ipa_init(struct hdd_context *hdd_ctx) struct ol_txrx_pdev_t *pdev = NULL; struct ipa_rm_perf_profile profile; - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "enter"); - if (!hdd_ipa_is_enabled(hdd_ctx)) return QDF_STATUS_SUCCESS; + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "enter"); + pdev = cds_get_context(QDF_MODULE_ID_TXRX); if (!pdev) { HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "pdev is NULL"); @@ -5655,7 +5684,7 @@ static QDF_STATUS __hdd_ipa_init(struct hdd_context *hdd_ctx) init_completion(&hdd_ipa->ipa_resource_comp); - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: success"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: success"); return QDF_STATUS_SUCCESS; fail_create_sys_pipe: @@ -5666,7 +5695,7 @@ fail_setup_rm: hdd_ctx->hdd_ipa = NULL; ghdd_ipa = NULL; fail_return: - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "exit: fail"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "exit: fail"); return QDF_STATUS_E_FAILURE; } diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 454eb0935e8b..52a86e508092 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -5255,6 +5255,11 @@ QDF_STATUS wma_ipa_offload_enable_disable(tp_wma_handle wma, params.vdev_id = ipa_offload->vdev_id; params.enable = ipa_offload->enable; + WMA_LOGI("%s: offload_type=%d, vdev_id=%d, enable=%d", + __func__, + ipa_offload->offload_type, ipa_offload->vdev_id, + ipa_offload->enable); + status = wmi_unified_ipa_offload_control_cmd(wma->wmi_handle, ¶ms); if (QDF_IS_STATUS_ERROR(status)) @@ -5272,7 +5277,7 @@ QDF_STATUS wma_ipa_offload_enable_disable(tp_wma_handle wma, rx_fwd_disabled = cdp_cfg_is_rx_fwd_disabled( cds_get_context(QDF_MODULE_ID_SOC), vdev); if (!ipa_offload->enable || rx_fwd_disabled) { - WMA_LOGE("%s: ipa_offload->enable=%d, rx_fwd_disabled=%d", + WMA_LOGI("%s: ipa_offload->enable=%d, rx_fwd_disabled=%d", __func__, ipa_offload->enable, rx_fwd_disabled); intra_bss_fwd = 1; From 46255686122ddc07a83eb5b9ddee406b127ee879 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Mon, 9 Oct 2017 15:56:34 -0700 Subject: [PATCH 16/36] qcacld-3.0: Rework HDD IPA stats Rework WLAN IPA uC stats: -IPA resource info -IPA session info -HDD IPA TX/RX stats -WLAN FW WDI stats -IPA WDI stats Update HDD IPA private data dump Remove deprecated stats in qcacld-3.0 Change-Id: I8f5170116156b48530ebb3f04f0a9f377972860c CRs-Fixed: 2124144 --- core/hdd/inc/wlan_hdd_ipa.h | 39 ++ core/hdd/src/wlan_hdd_hostapd.c | 5 +- core/hdd/src/wlan_hdd_ipa.c | 761 ++++++++++++++++++++------------ 3 files changed, 532 insertions(+), 273 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_ipa.h b/core/hdd/inc/wlan_hdd_ipa.h index f61a46960992..825d104426d1 100644 --- a/core/hdd/inc/wlan_hdd_ipa.h +++ b/core/hdd/inc/wlan_hdd_ipa.h @@ -124,7 +124,25 @@ void hdd_ipa_dump_info(struct hdd_context *hdd_ctx); QDF_STATUS hdd_ipa_uc_ol_init(struct hdd_context *hdd_ctx); void hdd_ipa_set_tx_flow_info(void); int hdd_ipa_uc_ol_deinit(struct hdd_context *hdd_ctx); + +/** + * hdd_ipa_uc_stat() - Print IPA uC stats + * @adapter: network adapter + * + * Return: None + */ +void hdd_ipa_uc_stat(struct hdd_adapter *adapter); + +/** + * hdd_ipa_uc_info() - Print IPA uC resource and session information + * @adapter: network adapter + * + * Return: None + */ +void hdd_ipa_uc_info(struct hdd_context *hdd_ctx); + #else + static inline QDF_STATUS hdd_ipa_init(struct hdd_context *hdd_ctx) { return QDF_STATUS_SUCCESS; @@ -277,5 +295,26 @@ static inline int hdd_ipa_uc_ol_deinit(struct hdd_context *hdd_ctx) { return 0; } + +/** + * hdd_ipa_uc_stat() - Print IPA uC stats + * @adapter: network adapter + * + * Return: None + */ +static inline void hdd_ipa_uc_stat(struct hdd_adapter *adapter) +{ +} + +/** + * hdd_ipa_uc_info() - Print IPA uC resource and session information + * @adapter: network adapter + * + * Return: None + */ +static inline void hdd_ipa_uc_info(struct hdd_context *hdd_ctx) +{ +} + #endif /* IPA_OFFLOAD */ #endif /* #ifndef HDD_IPA_H__ */ diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 69cc8eb64cb4..d3c2b6202cb9 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -3695,7 +3695,10 @@ static __iw_softap_setparam(struct net_device *dev, /* If input value is non-zero get stats */ switch (set_value) { case 1: - hdd_ipa_uc_stat_request(adapter, set_value); + hdd_ipa_uc_stat(adapter); + break; + case 2: + hdd_ipa_uc_info(hdd_ctx); break; case 3: hdd_ipa_uc_rt_debug_host_dump(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 15f3ae5d34be..3da984baa849 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -116,8 +116,7 @@ enum hdd_ipa_uc_op_code { enum { HDD_IPA_UC_STAT_REASON_NONE, HDD_IPA_UC_STAT_REASON_DEBUG, - HDD_IPA_UC_STAT_REASON_BW_CAL, - HDD_IPA_UC_STAT_REASON_DUMP_INFO + HDD_IPA_UC_STAT_REASON_BW_CAL }; /** @@ -228,12 +227,7 @@ struct hdd_ipa_iface_stats { uint64_t num_tx_drop; uint64_t num_tx_err; uint64_t num_tx_cac_drop; - uint64_t num_rx_prefilter; uint64_t num_rx_ipa_excep; - uint64_t num_rx_recv; - uint64_t num_rx_recv_mul; - uint64_t num_rx_send_desc_err; - uint64_t max_rx_mul; }; struct hdd_ipa_priv; @@ -265,13 +259,6 @@ struct hdd_ipa_stats { uint64_t num_prod_perf_req; uint64_t num_rx_drop; - uint64_t num_rx_ipa_tx_dp; - uint64_t num_rx_ipa_splice; - uint64_t num_rx_ipa_loop; - uint64_t num_rx_ipa_tx_dp_err; - uint64_t num_rx_ipa_write_done; - uint64_t num_max_ipa_tx_mul; - uint64_t num_rx_ipa_hw_maxed_out; uint64_t num_tx_desc_q_cnt; uint64_t num_tx_desc_error; @@ -280,8 +267,6 @@ struct hdd_ipa_stats { uint64_t num_tx_dequeued; uint64_t num_max_pm_queue; - uint64_t num_freeq_empty; - uint64_t num_pri_freeq_empty; uint64_t num_rx_excep; uint64_t num_tx_fwd_ok; uint64_t num_tx_fwd_err; @@ -443,8 +428,6 @@ struct hdd_ipa_priv { struct list_head free_tx_desc_head; struct hdd_context *hdd_ctx; - - struct dentry *debugfs_dir; struct hdd_ipa_stats stats; struct notifier_block ipv4_notifier; @@ -471,7 +454,7 @@ struct hdd_ipa_priv { uint64_t ipa_tx_forward; uint64_t ipa_rx_discard; uint64_t ipa_rx_net_send_count; - uint64_t ipa_rx_internel_drop_count; + uint64_t ipa_rx_internal_drop_count; uint64_t ipa_rx_destructor_count; qdf_mc_timer_t rt_debug_timer; struct uc_rt_debug_info rt_bug_buffer[HDD_IPA_UC_RT_DEBUG_BUF_COUNT]; @@ -526,10 +509,6 @@ struct hdd_ipa_priv { #define HDD_IPA_IS_CONFIG_ENABLED(_hdd_ctx, _mask) \ (((_hdd_ctx)->config->IpaConfig & (_mask)) == (_mask)) -#define HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa) \ - (hdd_ipa)->ipa_rx_internel_drop_count++ -#define HDD_IPA_INCREASE_NET_SEND_COUNT(hdd_ipa) \ - (hdd_ipa)->ipa_rx_net_send_count++ #define HDD_BW_GET_DIFF(_x, _y) (unsigned long)((ULONG_MAX - (_y)) + (_x) + 1) #if defined(QCA_WIFI_3_0) && defined(CONFIG_IPA3) @@ -848,7 +827,7 @@ static void hdd_ipa_uc_rt_debug_host_fill(void *ctext) dump_info->time = (uint64_t)qdf_mc_timer_get_system_time(); dump_info->ipa_excep_count = hdd_ipa->stats.num_rx_excep; - dump_info->rx_drop_count = hdd_ipa->ipa_rx_internel_drop_count; + dump_info->rx_drop_count = hdd_ipa->ipa_rx_internal_drop_count; dump_info->net_sent_count = hdd_ipa->ipa_rx_net_send_count; dump_info->tx_fwd_count = hdd_ipa->ipa_tx_forward; dump_info->tx_fwd_ok_count = hdd_ipa->stats.num_tx_fwd_ok; @@ -887,13 +866,13 @@ static void __hdd_ipa_uc_rt_debug_host_dump(struct hdd_context *hdd_ctx) if (!hdd_ipa_is_rt_debugging_enabled(hdd_ctx)) { HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, - "%s: IPA RT debug is not enabled", __func__); + "IPA RT debug is not enabled"); return; } - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "========= WLAN-IPA DEBUG BUF DUMP ==========\n"); - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, " TM : EXEP : DROP : NETS : FWOK : TXFD : DSTR : DSCD\n"); qdf_mutex_acquire(&hdd_ipa->rt_debug_lock); @@ -903,7 +882,7 @@ static void __hdd_ipa_uc_rt_debug_host_dump(struct hdd_context *hdd_ctx) dump_index = (hdd_ipa->rt_buf_fill_index + dump_count) % HDD_IPA_UC_RT_DEBUG_BUF_COUNT; dump_info = &hdd_ipa->rt_bug_buffer[dump_index]; - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%12llu:%10llu:%10llu:%10llu:%10llu:%10llu:%10llu:%10llu\n", dump_info->time, dump_info->ipa_excep_count, dump_info->rx_drop_count, dump_info->net_sent_count, @@ -912,7 +891,7 @@ static void __hdd_ipa_uc_rt_debug_host_dump(struct hdd_context *hdd_ctx) dump_info->rx_discard_count); } qdf_mutex_release(&hdd_ipa->rt_debug_lock); - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "======= WLAN-IPA DEBUG BUF DUMP END ========\n"); } @@ -1059,7 +1038,7 @@ static void hdd_ipa_uc_rt_debug_init(struct hdd_context *hdd_ctx) hdd_ipa->ipa_tx_forward = 0; hdd_ipa->ipa_rx_discard = 0; hdd_ipa->ipa_rx_net_send_count = 0; - hdd_ipa->ipa_rx_internel_drop_count = 0; + hdd_ipa->ipa_rx_internal_drop_count = 0; hdd_ipa->ipa_rx_destructor_count = 0; /* Reatime debug enable on feature enable */ @@ -1094,7 +1073,8 @@ static void hdd_ipa_dump_hdd_ipa(struct hdd_ipa_priv *hdd_ipa) int i; /* HDD IPA */ - hdd_info("==== HDD IPA ====\n" + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n==== HDD IPA ====\n" "num_iface: %d\n" "rm_state: %d\n" "rm_lock: %pK\n" @@ -1126,12 +1106,13 @@ static void hdd_ipa_dump_hdd_ipa(struct hdd_ipa_priv *hdd_ipa) &hdd_ipa->pm_work, &hdd_ipa->pm_lock, hdd_ipa->suspended); - hdd_err("\nq_lock: %pK\n" + + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\nq_lock: %pK\n" "pend_desc_head----\n" "\tnext: %pK\n" "\tprev: %pK\n" "hdd_ctx: %pK\n" - "debugfs_dir: %pK\n" "stats: %pK\n" "ipv4_notifier: %pK\n" "curr_prod_bw: %d\n" @@ -1143,16 +1124,16 @@ static void hdd_ipa_dump_hdd_ipa(struct hdd_ipa_priv *hdd_ipa) hdd_ipa->pend_desc_head.next, hdd_ipa->pend_desc_head.prev, hdd_ipa->hdd_ctx, - hdd_ipa->debugfs_dir, &hdd_ipa->stats, &hdd_ipa->ipv4_notifier, hdd_ipa->curr_prod_bw, hdd_ipa->curr_cons_bw, hdd_ipa->activated_fw_pipe, hdd_ipa->sap_num_connected_sta, - (unsigned int)hdd_ipa->sta_connected - ); - hdd_info("\ntx_pipe_handle: 0x%x\n" + (unsigned int)hdd_ipa->sta_connected); + + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\ntx_pipe_handle: 0x%x\n" "rx_pipe_handle: 0x%x\n" "resource_loading: %d\n" "resource_unloading: %d\n" @@ -1184,9 +1165,59 @@ static void hdd_ipa_dump_hdd_ipa(struct hdd_ipa_priv *hdd_ipa) hdd_ipa->ipa_p_rx_packets, hdd_ipa->stat_req_reason); - hdd_info("assoc_stas_map([id]is_reserved/sta_id): "); + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\ncons_pipe_in----\n" + "\tsys: %pK\n" + "\tdl.comp_ring_base_pa: 0x%x\n" + "\tdl.comp_ring_size: %d\n" + "\tdl.ce_ring_base_pa: 0x%x\n" + "\tdl.ce_door_bell_pa: 0x%x\n" + "\tdl.ce_ring_size: %d\n" + "\tdl.num_tx_buffers: %d\n" + "prod_pipe_in----\n" + "\tsys: %pK\n" + "\tul.rdy_ring_base_pa: 0x%x\n" + "\tul.rdy_ring_size: %d\n" + "\tul.rdy_ring_rp_pa: 0x%x\n" + "uc_loaded: %d\n" + "wdi_enabled: %d\n" + "rt_debug_fill_timer: %pK\n" + "rt_debug_lock: %pK\n" + "ipa_lock: %pK\n", + &hdd_ipa->cons_pipe_in.sys, + (unsigned int)hdd_ipa->cons_pipe_in.u.dl.comp_ring_base_pa, + hdd_ipa->cons_pipe_in.u.dl.comp_ring_size, + (unsigned int)hdd_ipa->cons_pipe_in.u.dl.ce_ring_base_pa, + (unsigned int)hdd_ipa->cons_pipe_in.u.dl.ce_door_bell_pa, + hdd_ipa->cons_pipe_in.u.dl.ce_ring_size, + hdd_ipa->cons_pipe_in.u.dl.num_tx_buffers, + &hdd_ipa->prod_pipe_in.sys, + (unsigned int)hdd_ipa->prod_pipe_in.u.ul.rdy_ring_base_pa, + hdd_ipa->prod_pipe_in.u.ul.rdy_ring_size, + (unsigned int)hdd_ipa->prod_pipe_in.u.ul.rdy_ring_rp_pa, + hdd_ipa->uc_loaded, + hdd_ipa->wdi_enabled, + &hdd_ipa->rt_debug_fill_timer, + &hdd_ipa->rt_debug_lock, + &hdd_ipa->ipa_lock); + + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\nvdev_to_iface----"); + for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) { + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n\t[%d]=%d", i, hdd_ipa->vdev_to_iface[i]); + } + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\nvdev_offload_enabled----"); + for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) { + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n\t[%d]=%d", i, hdd_ipa->vdev_offload_enabled[i]); + } + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\nassoc_stas_map ----"); for (i = 0; i < WLAN_MAX_STA_COUNT; i++) { - hdd_info(" [%d]%d/%d", i, + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n\t[%d]: is_reserved=%d, sta_id=%d", i, hdd_ipa->assoc_stas_map[i].is_reserved, hdd_ipa->assoc_stas_map[i].sta_id); } @@ -1205,7 +1236,8 @@ static void hdd_ipa_dump_sys_pipe(struct hdd_ipa_priv *hdd_ipa) int i; /* IPA SYS Pipes */ - hdd_info("==== IPA SYS Pipes ====\n"); + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n==== IPA SYS Pipes ====\n"); for (i = 0; i < HDD_IPA_MAX_SYSBAM_PIPE; i++) { struct hdd_ipa_sys_pipe *sys_pipe; @@ -1214,7 +1246,8 @@ static void hdd_ipa_dump_sys_pipe(struct hdd_ipa_priv *hdd_ipa) sys_pipe = &hdd_ipa->sys_pipe[i]; ipa_sys_params = &sys_pipe->ipa_sys_params; - hdd_info("sys_pipe[%d]----\n" + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\nsys_pipe[%d]----\n" "\tconn_hdl: 0x%x\n" "\tconn_hdl_valid: %d\n" "\tnat_en: %d\n" @@ -1262,14 +1295,16 @@ static void hdd_ipa_dump_iface_context(struct hdd_ipa_priv *hdd_ipa) int i; /* IPA Interface Contexts */ - hdd_info("==== IPA Interface Contexts ====\n"); + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n==== IPA Interface Contexts ====\n"); for (i = 0; i < HDD_IPA_MAX_IFACE; i++) { struct hdd_ipa_iface_context *iface_context; iface_context = &hdd_ipa->iface_context[i]; - hdd_info("iface_context[%d]----\n" + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\niface_context[%d]----\n" "\thdd_ipa: %pK\n" "\tadapter: %pK\n" "\ttl_context: %pK\n" @@ -2036,8 +2071,8 @@ hdd_ipa_uc_rm_notify_handler(void *context, enum ipa_rm_event event) if (!hdd_ipa_is_rm_enabled(hdd_ctx)) return; - HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "%s, event code %d", - __func__, event); + HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "event code %d", + event); switch (event) { case IPA_RM_RESOURCE_GRANTED: @@ -2057,7 +2092,7 @@ hdd_ipa_uc_rm_notify_handler(void *context, enum ipa_rm_event event) default: HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "%s, invalid event code %d", __func__, event); + "invalid event code %d", event); break; } } @@ -2084,7 +2119,7 @@ static void hdd_ipa_uc_rm_notify_defer(struct work_struct *work) cds_ssr_protect(__func__); event = uc_rm_work->event; HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, - "%s, posted event %d", __func__, event); + "posted event %d", event); hdd_ipa_uc_rm_notify_handler(hdd_ipa, event); cds_ssr_unprotect(__func__); @@ -2105,10 +2140,9 @@ static void hdd_ipa_uc_loaded_handler(struct hdd_ipa_priv *hdd_ipa) struct hdd_context *hdd_ctx; QDF_STATUS status; - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "%s : UC READY", __func__); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "UC READY"); if (true == hdd_ipa->uc_loaded) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "%s : UC already loaded", - __func__); + HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "UC already loaded"); return; } @@ -2236,6 +2270,379 @@ static QDF_STATUS hdd_ipa_uc_op_metering(struct hdd_context *hdd_ctx, #define num_bam_int_in_non_running_state num_bam_int_in_non_runnning_state #endif +/** + * hdd_ipa_wlan_event_to_str() - convert IPA WLAN event to string + * @event: IPA WLAN event to be converted to a string + * + * Return: ASCII string representing the IPA WLAN event + */ +static inline char *hdd_ipa_wlan_event_to_str(enum ipa_wlan_event event) +{ + switch (event) { + CASE_RETURN_STRING(WLAN_CLIENT_CONNECT); + CASE_RETURN_STRING(WLAN_CLIENT_DISCONNECT); + CASE_RETURN_STRING(WLAN_CLIENT_POWER_SAVE_MODE); + CASE_RETURN_STRING(WLAN_CLIENT_NORMAL_MODE); + CASE_RETURN_STRING(SW_ROUTING_ENABLE); + CASE_RETURN_STRING(SW_ROUTING_DISABLE); + CASE_RETURN_STRING(WLAN_AP_CONNECT); + CASE_RETURN_STRING(WLAN_AP_DISCONNECT); + CASE_RETURN_STRING(WLAN_STA_CONNECT); + CASE_RETURN_STRING(WLAN_STA_DISCONNECT); + CASE_RETURN_STRING(WLAN_CLIENT_CONNECT_EX); + default: + return "UNKNOWN"; + } +} + +/** + * hdd_ipa_print_session_info - Print IPA session info + * @hdd_ipa: HDD IPA local context + * + * Return: None + */ +static void hdd_ipa_print_session_info(struct hdd_ipa_priv *hdd_ipa) +{ + uint8_t session_id; + int device_mode; + struct ipa_uc_pending_event *event = NULL, *next = NULL; + struct hdd_ipa_iface_context *iface_context = NULL; + int i; + + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n==== IPA SESSION INFO ====\n" + "NUM IFACE: %d\n" + "RM STATE: %d\n" + "ACTIVATED FW PIPE: %d\n" + "SAP NUM STAs: %d\n" + "STA CONNECTED: %d\n" + "CONCURRENT MODE: %s\n" + "RSC LOADING: %d\n" + "RSC UNLOADING: %d\n" + "PENDING CONS REQ: %d\n" + "IPA PIPES DOWN: %d\n" + "IPA UC LOADED: %d\n" + "IPA WDI ENABLED: %d\n" + "NUM SEND MSG: %d\n" + "NUM FREE MSG: %d\n", + hdd_ipa->num_iface, + hdd_ipa->rm_state, + hdd_ipa->activated_fw_pipe, + hdd_ipa->sap_num_connected_sta, + hdd_ipa->sta_connected, + (hdd_ipa->hdd_ctx->mcc_mode ? "MCC" : "SCC"), + hdd_ipa->resource_loading, + hdd_ipa->resource_unloading, + hdd_ipa->pending_cons_req, + hdd_ipa->ipa_pipes_down, + hdd_ipa->uc_loaded, + hdd_ipa->wdi_enabled, + (unsigned int)hdd_ipa->stats.num_send_msg, + (unsigned int)hdd_ipa->stats.num_free_msg); + + for (i = 0; i < HDD_IPA_MAX_IFACE; i++) { + iface_context = &hdd_ipa->iface_context[i]; + if (!iface_context || !iface_context->adapter) + continue; + + session_id = iface_context->adapter->sessionId; + if (session_id >= CSR_ROAM_SESSION_MAX) + continue; + + device_mode = iface_context->adapter->device_mode; + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\nIFACE[%d]: session:%d, sta_id:%d, mode:%s, offload:%d", + i, session_id, + iface_context->sta_id, + hdd_device_mode_to_string(device_mode), + hdd_ipa->vdev_offload_enabled[session_id]); + } + + for (i = 0; i < IPA_WLAN_EVENT_MAX; i++) + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\nEVENT[%d]=%d", + i, hdd_ipa->stats.event[i]); + + i = 0; + qdf_list_peek_front(&hdd_ipa->pending_event, + (qdf_list_node_t **)&event); + while (event != NULL) { + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\nPENDING EVENT[%d]: DEV:%s, EVT:%s, sta_id:%d, MAC:%pM", + i, event->adapter->dev->name, + hdd_ipa_wlan_event_to_str(event->type), + event->sta_id, event->mac_addr); + + qdf_list_peek_next(&hdd_ipa->pending_event, + (qdf_list_node_t *)event, (qdf_list_node_t **)&next); + event = next; + next = NULL; + i++; + } +} + +/** + * hdd_ipa_print_txrx_stats - Print HDD IPA TX/RX stats + * @hdd_ipa: HDD IPA local context + * + * Return: None + */ +static void hdd_ipa_print_txrx_stats(struct hdd_ipa_priv *hdd_ipa) +{ + int i; + struct hdd_ipa_iface_context *iface_context = NULL; + + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n==== HDD IPA TX/RX STATS ====\n" + "NUM RM GRANT: %llu\n" + "NUM RM RELEASE: %llu\n" + "NUM RM GRANT IMM: %llu\n" + "NUM CONS PERF REQ: %llu\n" + "NUM PROD PERF REQ: %llu\n" + "NUM RX DROP: %llu\n" + "NUM EXCP PKT: %llu\n" + "NUM TX FWD OK: %llu\n" + "NUM TX FWD ERR: %llu\n" + "NUM TX DESC Q CNT: %llu\n" + "NUM TX DESC ERROR: %llu\n" + "NUM TX COMP CNT: %llu\n" + "NUM TX QUEUED: %llu\n" + "NUM TX DEQUEUED: %llu\n" + "NUM MAX PM QUEUE: %llu\n" + "TX REF CNT: %d\n" + "SUSPENDED: %d\n" + "PEND DESC HEAD: %pK\n" + "TX DESC LIST: %pK\n" + "FREE TX DESC HEAD: %pK\n", + hdd_ipa->stats.num_rm_grant, + hdd_ipa->stats.num_rm_release, + hdd_ipa->stats.num_rm_grant_imm, + hdd_ipa->stats.num_cons_perf_req, + hdd_ipa->stats.num_prod_perf_req, + hdd_ipa->stats.num_rx_drop, + hdd_ipa->stats.num_rx_excep, + hdd_ipa->stats.num_tx_fwd_ok, + hdd_ipa->stats.num_tx_fwd_err, + hdd_ipa->stats.num_tx_desc_q_cnt, + hdd_ipa->stats.num_tx_desc_error, + hdd_ipa->stats.num_tx_comp_cnt, + hdd_ipa->stats.num_tx_queued, + hdd_ipa->stats.num_tx_dequeued, + hdd_ipa->stats.num_max_pm_queue, + hdd_ipa->tx_ref_cnt.counter, + hdd_ipa->suspended, + &hdd_ipa->pend_desc_head, + hdd_ipa->tx_desc_list, + &hdd_ipa->free_tx_desc_head); + + for (i = 0; i < HDD_IPA_MAX_IFACE; i++) { + iface_context = &hdd_ipa->iface_context[i]; + if (!iface_context || !iface_context->adapter) + continue; + + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "IFACE[%d]: TX:%llu, TX DROP:%llu, TX ERR:%llu, TX CAC DROP:%llu, RX IPA EXCEP:%llu", + i, + iface_context->stats.num_tx, + iface_context->stats.num_tx_drop, + iface_context->stats.num_tx_err, + iface_context->stats.num_tx_cac_drop, + iface_context->stats.num_rx_ipa_excep); + } +} + +/** + * hdd_ipa_print_fw_wdi_stats - Print WLAN FW WDI stats + * @hdd_ipa: HDD IPA local context + * + * Return: None + */ +static void hdd_ipa_print_fw_wdi_stats(struct hdd_ipa_priv *hdd_ipa, + struct ipa_uc_fw_stats *uc_fw_stat) +{ + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n==== WLAN FW WDI TX STATS ====\n" + "COMP RING BASE: 0x%x\n" + "COMP RING SIZE: %d\n" + "COMP RING DBELL : 0x%x\n" + "COMP RING DBELL IND VAL : %d\n" + "COMP RING DBELL CACHED VAL : %d\n" + "PKTS ENQ : %d\n" + "PKTS COMP : %d\n" + "IS SUSPEND : %d\n", + uc_fw_stat->tx_comp_ring_base, + uc_fw_stat->tx_comp_ring_size, + uc_fw_stat->tx_comp_ring_dbell_addr, + uc_fw_stat->tx_comp_ring_dbell_ind_val, + uc_fw_stat->tx_comp_ring_dbell_cached_val, + uc_fw_stat->tx_pkts_enqueued, + uc_fw_stat->tx_pkts_completed, + uc_fw_stat->tx_is_suspend); + + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n==== WLAN FW WDI RX STATS ====\n" + "IND RING BASE: 0x%x\n" + "IND RING SIZE: %d\n" + "IND RING DBELL : 0x%x\n" + "IND RING DBELL IND VAL : %d\n" + "IND RING DBELL CACHED VAL : %d\n" + "RDY IND ADDR : 0x%x\n" + "RDY IND CACHE VAL : %d\n" + "RFIL IND : %d\n" + "NUM PKT INDICAT : %d\n" + "BUF REFIL : %d\n" + "NUM DROP NO SPC : %d\n" + "NUM DROP NO BUF : %d\n" + "IS SUSPND : %d\n", + uc_fw_stat->rx_ind_ring_base, + uc_fw_stat->rx_ind_ring_size, + uc_fw_stat->rx_ind_ring_dbell_addr, + uc_fw_stat->rx_ind_ring_dbell_ind_val, + uc_fw_stat->rx_ind_ring_dbell_ind_cached_val, + uc_fw_stat->rx_ind_ring_rdidx_addr, + uc_fw_stat->rx_ind_ring_rd_idx_cached_val, + uc_fw_stat->rx_refill_idx, + uc_fw_stat->rx_num_pkts_indicated, + uc_fw_stat->rx_buf_refilled, + uc_fw_stat->rx_num_ind_drop_no_space, + uc_fw_stat->rx_num_ind_drop_no_buf, + uc_fw_stat->rx_is_suspend); +} + +/** + * hdd_ipa_print_ipa_wdi_stats - Print IPA WDI stats + * @hdd_ipa: HDD IPA local context + * + * Return: None + */ +static void hdd_ipa_print_ipa_wdi_stats(struct hdd_ipa_priv *hdd_ipa) +{ + struct IpaHwStatsWDIInfoData_t ipa_stat; + + ipa_get_wdi_stats(&ipa_stat); + + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n==== IPA WDI TX STATS ====\n" + "NUM PROCD : %d\n" + "CE DBELL : 0x%x\n" + "NUM DBELL FIRED : %d\n" + "COMP RNG FULL : %d\n" + "COMP RNG EMPT : %d\n" + "COMP RNG USE HGH : %d\n" + "COMP RNG USE LOW : %d\n" + "BAM FIFO FULL : %d\n" + "BAM FIFO EMPT : %d\n" + "BAM FIFO USE HGH : %d\n" + "BAM FIFO USE LOW : %d\n" + "NUM DBELL : %d\n" + "NUM UNEXP DBELL : %d\n" + "NUM BAM INT HDL : 0x%x\n" + "NUM BAM INT NON-RUN : 0x%x\n" + "NUM QMB INT HDL : 0x%x\n", + ipa_stat.tx_ch_stats.num_pkts_processed, + ipa_stat.tx_ch_stats.copy_engine_doorbell_value, + ipa_stat.tx_ch_stats.num_db_fired, + ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringFull, + ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringEmpty, + ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringUsageHigh, + ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringUsageLow, + ipa_stat.tx_ch_stats.bam_stats.bamFifoFull, + ipa_stat.tx_ch_stats.bam_stats.bamFifoEmpty, + ipa_stat.tx_ch_stats.bam_stats.bamFifoUsageHigh, + ipa_stat.tx_ch_stats.bam_stats.bamFifoUsageLow, + ipa_stat.tx_ch_stats.num_db, + ipa_stat.tx_ch_stats.num_unexpected_db, + ipa_stat.tx_ch_stats.num_bam_int_handled, + ipa_stat.tx_ch_stats. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) + num_bam_int_in_non_running_state, +#else + num_bam_int_in_non_runnning_state, +#endif + ipa_stat.tx_ch_stats.num_qmb_int_handled); + + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, + "\n==== IPA WDI RX STATS ====\n" + "MAX OST PKT : %d\n" + "NUM PKT PRCSD : %d\n" + "RNG RP : 0x%x\n" + "IND RNG FULL : %d\n" + "IND RNG EMPT : %d\n" + "IND RNG USE HGH : %d\n" + "IND RNG USE LOW : %d\n" + "BAM FIFO FULL : %d\n" + "BAM FIFO EMPT : %d\n" + "BAM FIFO USE HGH : %d\n" + "BAM FIFO USE LOW : %d\n" + "NUM DB : %d\n" + "NUM UNEXP DB : %d\n" + "NUM BAM INT HNDL : 0x%x\n", + ipa_stat.rx_ch_stats.max_outstanding_pkts, + ipa_stat.rx_ch_stats.num_pkts_processed, + ipa_stat.rx_ch_stats.rx_ring_rp_value, + ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringFull, + ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringEmpty, + ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringUsageHigh, + ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringUsageLow, + ipa_stat.rx_ch_stats.bam_stats.bamFifoFull, + ipa_stat.rx_ch_stats.bam_stats.bamFifoEmpty, + ipa_stat.rx_ch_stats.bam_stats.bamFifoUsageHigh, + ipa_stat.rx_ch_stats.bam_stats.bamFifoUsageLow, + ipa_stat.rx_ch_stats.num_db, + ipa_stat.rx_ch_stats.num_unexpected_db, + ipa_stat.rx_ch_stats.num_bam_int_handled); +} + +/** + * hdd_ipa_uc_info() - Print IPA uC resource and session information + * @adapter: network adapter + * + * Return: None + */ +void hdd_ipa_uc_info(struct hdd_context *hdd_ctx) +{ + struct hdd_ipa_priv *hdd_ipa; + + hdd_ipa = hdd_ctx->hdd_ipa; + + if (!hdd_ipa) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "HDD IPA context is NULL"); + return; + } + + /* IPA session info */ + hdd_ipa_print_session_info(hdd_ipa); +} + +/** + * hdd_ipa_uc_stat() - Print IPA uC stats + * @adapter: network adapter + * + * Return: None + */ +void hdd_ipa_uc_stat(struct hdd_adapter *adapter) +{ + struct hdd_context *hdd_ctx; + struct hdd_ipa_priv *hdd_ipa; + + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + hdd_ipa = hdd_ctx->hdd_ipa; + + if (!hdd_ipa) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "HDD IPA context is NULL"); + return; + } + + /* HDD IPA TX/RX stats */ + hdd_ipa_print_txrx_stats(hdd_ipa); + /* IPA WDI stats */ + hdd_ipa_print_ipa_wdi_stats(hdd_ipa); + /* WLAN FW WDI stats */ + hdd_ipa_uc_stat_request(adapter, HDD_IPA_UC_STAT_REASON_DEBUG); +} + /** * hdd_ipa_uc_op_cb() - IPA uC operation callback * @op_msg: operation message received from firmware @@ -2248,19 +2655,18 @@ static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt) { struct op_msg_type *msg = op_msg; struct ipa_uc_fw_stats *uc_fw_stat; - struct IpaHwStatsWDIInfoData_t ipa_stat; struct hdd_ipa_priv *hdd_ipa; struct hdd_context *hdd_ctx; QDF_STATUS status = QDF_STATUS_SUCCESS; if (!op_msg || !usr_ctxt) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "%s, INVALID ARG", __func__); + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "INVALID ARG"); return; } if (HDD_IPA_UC_OPCODE_MAX <= msg->op_code) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "%s, INVALID OPCODE %d", __func__, msg->op_code); + "INVALID OPCODE %d", msg->op_code); qdf_mem_free(op_msg); return; } @@ -2323,157 +2729,11 @@ static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt) qdf_mutex_release(&hdd_ipa->ipa_lock); } else if ((HDD_IPA_UC_OPCODE_STATS == msg->op_code) && (HDD_IPA_UC_STAT_REASON_DEBUG == hdd_ipa->stat_req_reason)) { - /* STATs from host */ - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "==== IPA_UC WLAN_HOST RX ====\n" - "NUM EXCP PKT : %llu\n" - "NUM TX FWD OK : %llu\n" - "NUM TX FWD ERR : %llu", - hdd_ipa->stats.num_rx_excep, - hdd_ipa->stats.num_tx_fwd_ok, - hdd_ipa->stats.num_tx_fwd_err); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "==== IPA_UC WLAN_HOST CONTROL ====\n" - "SAP NUM STAs: %d\n" - "STA CONNECTED: %d\n" - "CONCURRENT MODE: %s\n" - "TX PIPE HDL: 0x%x\n" - "RX PIPE HDL : 0x%x\n" - "RSC LOADING : %d\n" - "RSC UNLOADING : %d\n" - "PNDNG CNS RQT : %d", - hdd_ipa->sap_num_connected_sta, - hdd_ipa->sta_connected, - (hdd_ctx->mcc_mode ? "MCC" : "SCC"), - hdd_ipa->tx_pipe_handle, - hdd_ipa->rx_pipe_handle, - hdd_ipa->resource_loading, - hdd_ipa->resource_unloading, - hdd_ipa->pending_cons_req); - - /* STATs from FW */ uc_fw_stat = (struct ipa_uc_fw_stats *) - ((uint8_t *)op_msg + sizeof(struct op_msg_type)); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "==== IPA_UC WLAN_FW TX ====\n" - "COMP RING BASE: 0x%x\n" - "COMP RING SIZE: %d\n" - "COMP RING DBELL : 0x%x\n" - "COMP RING DBELL IND VAL : %d\n" - "COMP RING DBELL CACHED VAL : %d\n" - "COMP RING DBELL CACHED VAL : %d\n" - "PKTS ENQ : %d\n" - "PKTS COMP : %d\n" - "IS SUSPEND : %d\n" - "RSVD : 0x%x", - uc_fw_stat->tx_comp_ring_base, - uc_fw_stat->tx_comp_ring_size, - uc_fw_stat->tx_comp_ring_dbell_addr, - uc_fw_stat->tx_comp_ring_dbell_ind_val, - uc_fw_stat->tx_comp_ring_dbell_cached_val, - uc_fw_stat->tx_comp_ring_dbell_cached_val, - uc_fw_stat->tx_pkts_enqueued, - uc_fw_stat->tx_pkts_completed, - uc_fw_stat->tx_is_suspend, - uc_fw_stat->tx_reserved); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "==== IPA_UC WLAN_FW RX ====\n" - "IND RING BASE: 0x%x\n" - "IND RING SIZE: %d\n" - "IND RING DBELL : 0x%x\n" - "IND RING DBELL IND VAL : %d\n" - "IND RING DBELL CACHED VAL : %d\n" - "RDY IND ADDR : 0x%x\n" - "RDY IND CACHE VAL : %d\n" - "RFIL IND : %d\n" - "NUM PKT INDICAT : %d\n" - "BUF REFIL : %d\n" - "NUM DROP NO SPC : %d\n" - "NUM DROP NO BUF : %d\n" - "IS SUSPND : %d\n" - "RSVD : 0x%x\n", - uc_fw_stat->rx_ind_ring_base, - uc_fw_stat->rx_ind_ring_size, - uc_fw_stat->rx_ind_ring_dbell_addr, - uc_fw_stat->rx_ind_ring_dbell_ind_val, - uc_fw_stat->rx_ind_ring_dbell_ind_cached_val, - uc_fw_stat->rx_ind_ring_rdidx_addr, - uc_fw_stat->rx_ind_ring_rd_idx_cached_val, - uc_fw_stat->rx_refill_idx, - uc_fw_stat->rx_num_pkts_indicated, - uc_fw_stat->rx_buf_refilled, - uc_fw_stat->rx_num_ind_drop_no_space, - uc_fw_stat->rx_num_ind_drop_no_buf, - uc_fw_stat->rx_is_suspend, - uc_fw_stat->rx_reserved); - /* STATs from IPA */ - ipa_get_wdi_stats(&ipa_stat); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "==== IPA_UC IPA TX ====\n" - "NUM PROCD : %d\n" - "CE DBELL : 0x%x\n" - "NUM DBELL FIRED : %d\n" - "COMP RNG FULL : %d\n" - "COMP RNG EMPT : %d\n" - "COMP RNG USE HGH : %d\n" - "COMP RNG USE LOW : %d\n" - "BAM FIFO FULL : %d\n" - "BAM FIFO EMPT : %d\n" - "BAM FIFO USE HGH : %d\n" - "BAM FIFO USE LOW : %d\n" - "NUM DBELL : %d\n" - "NUM UNEXP DBELL : %d\n" - "NUM BAM INT HDL : 0x%x\n" - "NUM BAM INT NON-RUN : 0x%x\n" - "NUM QMB INT HDL : 0x%x", - ipa_stat.tx_ch_stats.num_pkts_processed, - ipa_stat.tx_ch_stats.copy_engine_doorbell_value, - ipa_stat.tx_ch_stats.num_db_fired, - ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringFull, - ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringEmpty, - ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringUsageHigh, - ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringUsageLow, - ipa_stat.tx_ch_stats.bam_stats.bamFifoFull, - ipa_stat.tx_ch_stats.bam_stats.bamFifoEmpty, - ipa_stat.tx_ch_stats.bam_stats.bamFifoUsageHigh, - ipa_stat.tx_ch_stats.bam_stats.bamFifoUsageLow, - ipa_stat.tx_ch_stats.num_db, - ipa_stat.tx_ch_stats.num_unexpected_db, - ipa_stat.tx_ch_stats.num_bam_int_handled, - ipa_stat.tx_ch_stats. - num_bam_int_in_non_running_state, - ipa_stat.tx_ch_stats.num_qmb_int_handled); + ((uint8_t *)op_msg + sizeof(struct op_msg_type)); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "==== IPA_UC IPA RX ====\n" - "MAX OST PKT : %d\n" - "NUM PKT PRCSD : %d\n" - "RNG RP : 0x%x\n" - "COMP RNG FULL : %d\n" - "COMP RNG EMPT : %d\n" - "COMP RNG USE HGH : %d\n" - "COMP RNG USE LOW : %d\n" - "BAM FIFO FULL : %d\n" - "BAM FIFO EMPT : %d\n" - "BAM FIFO USE HGH : %d\n" - "BAM FIFO USE LOW : %d\n" - "NUM DB : %d\n" - "NUM UNEXP DB : %d\n" - "NUM BAM INT HNDL : 0x%x\n", - ipa_stat.rx_ch_stats.max_outstanding_pkts, - ipa_stat.rx_ch_stats.num_pkts_processed, - ipa_stat.rx_ch_stats.rx_ring_rp_value, - ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringFull, - ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringEmpty, - ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringUsageHigh, - ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringUsageLow, - ipa_stat.rx_ch_stats.bam_stats.bamFifoFull, - ipa_stat.rx_ch_stats.bam_stats.bamFifoEmpty, - ipa_stat.rx_ch_stats.bam_stats.bamFifoUsageHigh, - ipa_stat.rx_ch_stats.bam_stats.bamFifoUsageLow, - ipa_stat.rx_ch_stats.num_db, - ipa_stat.rx_ch_stats.num_unexpected_db, - ipa_stat.rx_ch_stats.num_bam_int_handled); + /* WLAN FW WDI stats */ + hdd_ipa_print_fw_wdi_stats(hdd_ipa, uc_fw_stat); } else if ((HDD_IPA_UC_OPCODE_STATS == msg->op_code) && (HDD_IPA_UC_STAT_REASON_BW_CAL == hdd_ipa->stat_req_reason)) { /* STATs from FW */ @@ -2576,11 +2836,10 @@ static void hdd_ipa_uc_offload_enable_disable(struct hdd_adapter *adapter, sme_ipa_offload_enable_disable(WLAN_HDD_GET_HAL_CTX(adapter), adapter->sessionId, &ipa_offload_enable_disable)) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "%s (offload_type=%d, vdev_id=%d, enable=%d)", - "Failure to enable IPA offload", - ipa_offload_enable_disable.offload_type, - ipa_offload_enable_disable.vdev_id, - ipa_offload_enable_disable.enable); + "Failure to enable IPA offload (offload_type=%d, vdev_id=%d, enable=%d)", + ipa_offload_enable_disable.offload_type, + ipa_offload_enable_disable.vdev_id, + ipa_offload_enable_disable.enable); } else { /* Update the IPA offload status */ hdd_ipa->vdev_offload_enabled[session_id] = @@ -2606,7 +2865,7 @@ static void hdd_ipa_uc_fw_op_event_handler(struct work_struct *work) msg = uc_op_work->msg; uc_op_work->msg = NULL; HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, - "%s, posted msg %d", __func__, msg->op_code); + "posted msg %d", msg->op_code); hdd_ipa_uc_op_cb(msg, hdd_ipa->hdd_ctx); @@ -2974,7 +3233,7 @@ static void __hdd_ipa_uc_force_pipe_shutdown(struct hdd_context *hdd_ctx) hdd_ipa = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa; if (false == hdd_ipa->ipa_pipes_down) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "IPA pipes are not down yet, force shutdown"); hdd_ipa_uc_disable_pipes(hdd_ipa); } else { @@ -3853,13 +4112,13 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, if (!adapter || adapter->magic != WLAN_HDD_ADAPTER_MAGIC) { HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "Invalid adapter: 0x%pK", adapter); - HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); + hdd_ipa->ipa_rx_internal_drop_count++; kfree_skb(skb); return; } if (cds_is_driver_unloading()) { - HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); + hdd_ipa->ipa_rx_internal_drop_count++; kfree_skb(skb); return; } @@ -3878,7 +4137,7 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, else ++adapter->hdd_stats.tx_rx_stats.rx_refused[cpu_index]; - HDD_IPA_INCREASE_NET_SEND_COUNT(hdd_ipa); + hdd_ipa->ipa_rx_net_send_count++; } /** @@ -3903,11 +4162,11 @@ static void hdd_ipa_forward(struct hdd_ipa_priv *hdd_ipa, /* Set IPA ownership for intra-BSS Tx packets to avoid skb_orphan */ qdf_nbuf_ipa_owned_set(skb); - /* WLAN subsystem is in suspend, put int queue */ + /* WLAN subsystem is in suspend, put in queue */ if (hdd_ipa->suspended) { qdf_spin_unlock_bh(&hdd_ipa->pm_lock); - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "TX in SUSPEND PUT QUEUE"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, + "Tx in suspend, put in queue"); qdf_mem_set(skb->cb, sizeof(skb->cb), 0); pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb; pm_tx_cb->exception = true; @@ -3921,11 +4180,10 @@ static void hdd_ipa_forward(struct hdd_ipa_priv *hdd_ipa, qdf_spin_unlock_bh(&hdd_ipa->pm_lock); if (hdd_softap_hard_start_xmit(skb, adapter->dev)) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "packet tx fail"); + "packet Tx fail"); hdd_ipa->stats.num_tx_fwd_err++; } else { hdd_ipa->stats.num_tx_fwd_ok++; - hdd_ipa->ipa_tx_forward++; } } } @@ -3971,7 +4229,7 @@ static enum hdd_ipa_forward_type hdd_ipa_intrabss_forward( if ((desc & FW_RX_DESC_DISCARD_M)) { hdd_ipa_forward(hdd_ipa, adapter, skb); - hdd_ipa->ipa_rx_internel_drop_count++; + hdd_ipa->ipa_rx_internal_drop_count++; hdd_ipa->ipa_rx_discard++; ret = HDD_IPA_FORWARD_PKT_DISCARD; } else { @@ -3981,8 +4239,7 @@ static enum hdd_ipa_forward_type hdd_ipa_intrabss_forward( hdd_ipa_forward(hdd_ipa, adapter, cloned_skb); else HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "%s: tx skb alloc failed", - __func__); + "tx skb alloc failed"); ret = HDD_IPA_FORWARD_PKT_LOCAL_STACK; } } @@ -4028,7 +4285,7 @@ static void __hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, if (0 != status) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "Invalid context: drop packet"); - HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); + hdd_ipa->ipa_rx_internal_drop_count++; kfree_skb(skb); return; } @@ -4050,7 +4307,7 @@ static void __hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, HDD_IPA_DBG_DUMP(QDF_TRACE_LEVEL_DEBUG, "w2i -- skb", skb->data, HDD_IPA_DBG_DUMP_RX_LEN); - HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); + hdd_ipa->ipa_rx_internal_drop_count++; kfree_skb(skb); return; } @@ -4060,7 +4317,7 @@ static void __hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, if (!adapter) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "IPA_RECEIVE: Adapter is NULL"); - HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); + hdd_ipa->ipa_rx_internal_drop_count++; kfree_skb(skb); return; } @@ -4244,7 +4501,6 @@ static void hdd_ipa_send_pkt_to_tl( } else { hdd_ipa->stats.num_tx_desc_error++; qdf_spin_unlock_bh(&hdd_ipa->q_lock); - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "No free Tx desc!"); ipa_free_skb(ipa_tx_desc); hdd_ipa_rm_try_release(hdd_ipa); return; @@ -4256,7 +4512,6 @@ static void hdd_ipa_send_pkt_to_tl( (struct cdp_vdev *)iface_context->tl_context, ipa_tx_desc->skb); if (skb) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "TLSHIM tx fail"); qdf_nbuf_free(skb); iface_context->stats.num_tx_err++; return; @@ -4315,8 +4570,8 @@ static void hdd_ipa_pm_flush(struct work_struct *work) pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb; dequeued++; if (pm_tx_cb->exception) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "FLUSH EXCEPTION"); + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, + "Flush Exception"); if (pm_tx_cb->adapter->dev) hdd_softap_hard_start_xmit(skb, pm_tx_cb->adapter->dev); @@ -4937,44 +5192,6 @@ int hdd_ipa_send_mcc_scc_msg(struct hdd_context *hdd_ctx, bool mcc_mode) } #endif -/** - * hdd_ipa_wlan_event_to_str() - convert IPA WLAN event to string - * @event: IPA WLAN event to be converted to a string - * - * Return: ASCII string representing the IPA WLAN event - */ -static inline char *hdd_ipa_wlan_event_to_str(enum ipa_wlan_event event) -{ - switch (event) { - case WLAN_CLIENT_CONNECT: - return "WLAN_CLIENT_CONNECT"; - case WLAN_CLIENT_DISCONNECT: - return "WLAN_CLIENT_DISCONNECT"; - case WLAN_CLIENT_POWER_SAVE_MODE: - return "WLAN_CLIENT_POWER_SAVE_MODE"; - case WLAN_CLIENT_NORMAL_MODE: - return "WLAN_CLIENT_NORMAL_MODE"; - case SW_ROUTING_ENABLE: - return "SW_ROUTING_ENABLE"; - case SW_ROUTING_DISABLE: - return "SW_ROUTING_DISABLE"; - case WLAN_AP_CONNECT: - return "WLAN_AP_CONNECT"; - case WLAN_AP_DISCONNECT: - return "WLAN_AP_DISCONNECT"; - case WLAN_STA_CONNECT: - return "WLAN_STA_CONNECT"; - case WLAN_STA_DISCONNECT: - return "WLAN_STA_DISCONNECT"; - case WLAN_CLIENT_CONNECT_EX: - return "WLAN_CLIENT_CONNECT_EX"; - - case IPA_WLAN_EVENT_MAX: - default: - return "UNKNOWN"; - } -} - /** * hdd_to_ipa_wlan_event() - convert hdd_ipa_wlan_event to ipa_wlan_event * @hdd_ipa_event_type: HDD IPA WLAN event to be converted to an ipa_wlan_event @@ -5037,7 +5254,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, struct ipa_wlan_msg_ex *msg_ex = NULL; int ret; - HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: %s evt, MAC: %pM sta_id: %d", + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: EVT: %s, MAC: %pM, sta_id: %d", adapter->dev->name, hdd_ipa_wlan_event_to_str(type), mac_addr, sta_id); @@ -5066,7 +5283,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, unsigned int pending_event_count; struct ipa_uc_pending_event *pending_event = NULL; - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s:IPA resource %s inprogress", hdd_ipa_wlan_event_to_str(type), hdd_ipa->resource_loading ? @@ -5080,7 +5297,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, * If timed out, store the events separately and * handle them later. */ - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "IPA resource %s timed out", hdd_ipa->resource_loading ? "load" : "unload"); @@ -5123,7 +5340,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, } return 0; } - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "IPA resource %s completed", hdd_ipa->resource_loading ? "load" : "unload"); @@ -5328,7 +5545,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id, ret = hdd_ipa_uc_handle_first_con(hdd_ipa); if (ret) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: handle 1st con ret %d", adapter->dev->name, ret); @@ -5519,10 +5736,10 @@ hdd_ipa_uc_proc_pending_event(struct hdd_ipa_priv *hdd_ipa) pending_event_count = qdf_list_size(&hdd_ipa->pending_event); HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, - "%s, Pending Event Count %d", __func__, pending_event_count); + "Pending Event Count %d", pending_event_count); if (!pending_event_count) { HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, - "%s, No Pending Event", __func__); + "No Pending Event"); return; } From 19fb9579fcd727bc75663b26da31cf16ffcc811e Mon Sep 17 00:00:00 2001 From: snandini Date: Thu, 26 Oct 2017 21:49:26 -0700 Subject: [PATCH 17/36] Release 5.2.0.51N Release 5.2.0.51N Change-Id: I244bfe9fe2a0bd8525da216543b99c5d79ee79b8 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 7c70e7589f8c..948a6b3e7354 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "N" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51M" +#define QWLAN_VERSIONSTR "5.2.0.51N" #endif /* QWLAN_VERSION_H */ From 9f18042578166d0e611a769a201f5f19d971a097 Mon Sep 17 00:00:00 2001 From: Jayachandran Sreekumaran Date: Thu, 26 Oct 2017 15:03:01 +0530 Subject: [PATCH 18/36] qcacld-3.0: Restrict AP switching to DFS channel Restrict AP switching to DFS channel to enforce SCC in AP+STA+AP case Change-Id: I5b581142abb02a9209200ee21fb6a2e1fbc18795 CRs-Fixed: 2133126 --- core/sap/src/sap_fsm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 3ba200cd4cd4..51533b80975a 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -1726,7 +1726,10 @@ QDF_STATUS sap_goto_channel_sel(struct sap_context *sap_context, sap_context->channel, sap_context->csr_roamProfile.phyMode, sap_context->cc_switch_mode); - if (con_ch) { + if (con_ch && !(wlan_reg_is_dfs_ch(mac_ctx->pdev, + con_ch) && + sap_context->cc_switch_mode == + QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Override ch %d to %d due to CC Intf", From af469ebe46a2cbabfe9525221c9fdfba98b1062b Mon Sep 17 00:00:00 2001 From: snandini Date: Thu, 26 Oct 2017 23:48:13 -0700 Subject: [PATCH 19/36] Release 5.2.0.51O Release 5.2.0.51O Change-Id: I92a2b9db1f7fed8fcd465351f19972e73d57e442 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 948a6b3e7354..d024b6829b87 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "N" +#define QWLAN_VERSION_EXTRA "O" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51N" +#define QWLAN_VERSIONSTR "5.2.0.51O" #endif /* QWLAN_VERSION_H */ From e7445a2e75dedd1284a8ab64a66e60e05101dd88 Mon Sep 17 00:00:00 2001 From: Orhan K AKYILDIZ Date: Thu, 19 Jan 2017 21:21:47 -0800 Subject: [PATCH 20/36] qcacld-3.0: Set CPU floor freq on high throughput On high throughput mode, send a message to perfd, through cnss-daemon, to set the min freq for perf cluster to 700 KHz, and release it on transition to low throughput. Goes with corresponding changes on cnss-daemon (1834087). Change-Id: I9c5c701fa33992e44fc3bad5e58599da0b45cbd7 CRs-Fixed: 1115614 --- core/hdd/src/wlan_hdd_main.c | 1 + core/hdd/src/wlan_hdd_napi.c | 73 ++++++++++++++++++++++++++++++++++-- 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index f12f7f45c1c6..257d792a4687 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -10428,6 +10428,7 @@ void wlan_hdd_send_svc_nlink_msg(int radio, int type, void *data, int len) case WLAN_SVC_WLAN_TP_IND: case WLAN_SVC_WLAN_TP_TX_IND: case WLAN_SVC_RPS_ENABLE_IND: + case WLAN_SVC_CORE_MINFREQ: ani_hdr->length = len; nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr) + len)); nl_data = (char *)ani_hdr + sizeof(tAniMsgHdr); diff --git a/core/hdd/src/wlan_hdd_napi.c b/core/hdd/src/wlan_hdd_napi.c index cf1b9fae1647..e98fc8cee2bc 100644 --- a/core/hdd/src/wlan_hdd_napi.c +++ b/core/hdd/src/wlan_hdd_napi.c @@ -259,6 +259,69 @@ int hdd_napi_event(enum qca_napi_event event, void *data) } #ifdef HELIUMPLUS +/** + * hdd_napi_perfd_cpufreq() - set/reset min CPU freq for cores + * @req_state: high/low + * + * Send a message to cnss-daemon through netlink. cnss-daemon, + * in turn, sends a message to perf-daemon. + * If freq > 0, this is a set request. It sets the min frequency of the + * cores of the specified cluster to provided freq value (in KHz). + * If freq == 0, then the freq lock is removed (and frequency returns to + * system default). + * + * Semantical Alert: + * There can be at most one lock active at a time. Each "set" request must + * be followed by a "reset" request. Perfd behaviour is undefined otherwise. + * + * Return: == 0: netlink message sent to cnss-daemon + * < 0: failure to send the message + */ +static int hdd_napi_perfd_cpufreq(enum qca_napi_tput_state req_state) +{ + int rc = 0; + struct wlan_core_minfreq req; + struct hdd_context *hdd_ctx; + + NAPI_DEBUG("-> (%d)", req_state); + + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (unlikely(hdd_ctx == NULL)) { + hdd_err("cannot get hdd_context"); + rc = -EFAULT; + goto hnpc_ret; + } + + switch (req_state) { + case QCA_NAPI_TPUT_LO: + req.magic = WLAN_CORE_MINFREQ_MAGIC; + req.reserved = 0; /* unused */ + req.coremask = 0; /* not valid */ + req.freq = 0; /* reset */ + break; + case QCA_NAPI_TPUT_HI: + req.magic = WLAN_CORE_MINFREQ_MAGIC; + req.reserved = 0; /* unused */ + req.coremask = 0x0f0; /* perf cluster */ + req.freq = 700; /* KHz */ + break; + default: + hdd_err("invalid req_state (%d)", req_state); + rc = -EINVAL; + goto hnpc_ret; + } /* switch */ + + NAPI_DEBUG("CPU min freq to %d", + (req.freq == 0)?"Resetting":"Setting", req.freq); + /* the following service function returns void */ + wlan_hdd_send_svc_nlink_msg(hdd_ctx->radio_index, + WLAN_SVC_CORE_MINFREQ, + &req, sizeof(struct wlan_core_minfreq)); +hnpc_ret: + NAPI_DEBUG("<--[rc=%d]", rc); + return rc; +} + /** * hdd_napi_apply_throughput_policy() - implement the throughput action policy * @hddctx: HDD context @@ -285,8 +348,8 @@ int hdd_napi_event(enum qca_napi_event event, void *data) */ static int napi_tput_policy_delay; int hdd_napi_apply_throughput_policy(struct hdd_context *hddctx, - uint64_t tx_packets, - uint64_t rx_packets) + uint64_t tx_packets, + uint64_t rx_packets) { int rc = 0; uint64_t packets = tx_packets + rx_packets; @@ -325,8 +388,12 @@ int hdd_napi_apply_throughput_policy(struct hdd_context *hddctx, else req_state = QCA_NAPI_TPUT_LO; - if (req_state != napid->napi_mode) + if (req_state != napid->napi_mode) { + /* [re]set the floor frequency of high cluster */ + rc = hdd_napi_perfd_cpufreq(req_state); + /* blacklist/boost_mode on/off */ rc = hdd_napi_event(NAPI_EVT_TPUT_STATE, (void *)req_state); + } return rc; } From d9dbfb26c35bef010e83ed6112312b933be109bd Mon Sep 17 00:00:00 2001 From: snandini Date: Fri, 27 Oct 2017 01:58:03 -0700 Subject: [PATCH 21/36] Release 5.2.0.51P Release 5.2.0.51P Change-Id: I0dac828242d95a6704e0c402ed7fd1946af2727c CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d024b6829b87..e8e8d6953cc6 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "O" +#define QWLAN_VERSION_EXTRA "P" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51O" +#define QWLAN_VERSIONSTR "5.2.0.51P" #endif /* QWLAN_VERSION_H */ From cdaf9bd6be4083791b17426476bed3eacdee9534 Mon Sep 17 00:00:00 2001 From: jiad Date: Thu, 26 Oct 2017 12:20:21 +0800 Subject: [PATCH 22/36] qcacld-3.0: Fix build error in LRO without MSM_PLATFORM When compiling without MSM_PLATFORM, error is seen like 'struct hdd_context has no member named cur_rx_level'. cur_rx_level is defined in struct hdd_context only when MSM_PLATFORM is defined. Fix is to define a new API to send throughput indication within MSM_PLATFORM. Change-Id: Ibbc997f3bda806d0c3f78d3d90cbbc1a20f06015 CRs-Fixed: 2132918 --- core/hdd/inc/wlan_hdd_main.h | 15 +++++++++++++++ core/hdd/src/wlan_hdd_lro.c | 4 +--- core/hdd/src/wlan_hdd_main.c | 7 +++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 37f67f1d64bb..c140b30b7138 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1986,6 +1986,16 @@ void hdd_bus_bandwidth_destroy(struct hdd_context *hdd_ctx); * Return: None. */ void hdd_bus_bw_cancel_work(struct hdd_context *hdd_ctx); + +/** + * hdd_send_wlan_tp_ind() - Send throughput indication + * @hdd_ctx: HDD context + * + * Send throughput indication + * + * Return: None. + */ +void hdd_send_wlan_tp_ind(struct hdd_context *hdd_ctx); #else static inline @@ -2023,6 +2033,11 @@ static inline void hdd_bus_bw_cancel_work(struct hdd_context *hdd_ctx) { } + +static inline +void hdd_send_wlan_tp_ind(struct hdd_context *hdd_ctx) +{ +} #endif int hdd_qdf_trace_enable(QDF_MODULE_ID module_id, uint32_t bitmask); diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index 916f1929b5d5..3dbaf6f1b048 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -223,9 +223,7 @@ void hdd_disable_lro_in_concurrency(bool disable) if (disable) { if (hdd_ctx->en_tcp_delack_no_lro) { hdd_info("Enable TCP delack as LRO disabled in concurrency"); - wlan_hdd_send_svc_nlink_msg(hdd_ctx->radio_index, - WLAN_SVC_WLAN_TP_IND, &hdd_ctx->cur_rx_level, - sizeof(hdd_ctx->cur_rx_level)); + hdd_send_wlan_tp_ind(hdd_ctx); hdd_ctx->en_tcp_delack_no_lro = 1; } qdf_atomic_set(&hdd_ctx->disable_lro_in_concurrency, 1); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 257d792a4687..48a2ea35f0c7 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6657,6 +6657,13 @@ void hdd_bus_bw_cancel_work(struct hdd_context *hdd_ctx) if (hdd_ctx) cancel_work_sync(&hdd_ctx->bus_bw_work); } + +void hdd_send_wlan_tp_ind(struct hdd_context *hdd_ctx) +{ + wlan_hdd_send_svc_nlink_msg(hdd_ctx->radio_index, + WLAN_SVC_WLAN_TP_IND, &hdd_ctx->cur_rx_level, + sizeof(hdd_ctx->cur_rx_level)); +} #endif /** From dbea6e12046905608518bf14f8125db5653a0dc3 Mon Sep 17 00:00:00 2001 From: Arif Hussain Date: Wed, 25 Oct 2017 16:20:47 -0700 Subject: [PATCH 23/36] qcacld-3.0: Fix incorrect length of encrypted auth frame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change id ā€œI684dbc89945ba3aef3186c872e5e1f7564d7e44cā€ and ā€œI5ba5748c9ae00b61743883862ca884ac1134da15ā€ fixes merged in reverse order, there by reverting second fix. Correcting the same. Change-Id: I6b4912bf3717a0cc68b4184e4e2a8482766d4ad8 CRs-Fixed: 2128343 --- core/mac/src/pe/lim/lim_security_utils.c | 26 ++---------------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/core/mac/src/pe/lim/lim_security_utils.c b/core/mac/src/pe/lim/lim_security_utils.c index 5fae864edf9a..3325ceac59fd 100644 --- a/core/mac/src/pe/lim/lim_security_utils.c +++ b/core/mac/src/pe/lim/lim_security_utils.c @@ -487,29 +487,6 @@ lim_restore_from_auth_state(tpAniSirGlobal pMac, tSirResultCodes resultCode, lim_post_sme_message(pMac, LIM_MLM_AUTH_CNF, (uint32_t *) &mlmAuthCnf); } /*** end lim_restore_from_auth_state() ***/ -#ifdef WLAN_FEATURE_FILS_SK -/* - * lim_get_fils_auth_data_len: This API will return - * extra auth data len in case of fils session - * - * Return: fils data len in auth packet - */ -static int lim_get_fils_auth_data_len(void) -{ - int len = sizeof(tSirMacRsnInfo) + - sizeof(uint8_t) + /* assoc_delay_info */ - SIR_FILS_SESSION_LENGTH + - sizeof(uint8_t) + /* wrapped_data_len */ - SIR_FILS_WRAPPED_DATA_MAX_SIZE + SIR_FILS_NONCE_LENGTH; - return len; -} -#else -static inline int lim_get_fils_auth_data_len(void) -{ - return 0; -} -#endif - /** * lim_encrypt_auth_frame() * @@ -542,7 +519,8 @@ lim_encrypt_auth_frame(tpAniSirGlobal pMac, uint8_t keyId, uint8_t *pKey, uint8_t seed[LIM_SEED_LENGTH], icv[SIR_MAC_WEP_ICV_LENGTH]; uint16_t frame_len; - frame_len = sizeof(tSirMacAuthFrameBody) - lim_get_fils_auth_data_len(); + frame_len = ((tpSirMacAuthFrameBody)pPlainText)->length + + SIR_MAC_AUTH_FRAME_INFO_LEN + SIR_MAC_CHALLENGE_ID_LEN; keyLength += 3; /* Bytes 3-7 of seed is key */ From b217491a2ba3959a83ccc90a9d48c7f4e7ffa462 Mon Sep 17 00:00:00 2001 From: snandini Date: Fri, 27 Oct 2017 03:49:59 -0700 Subject: [PATCH 24/36] Release 5.2.0.51Q Release 5.2.0.51Q Change-Id: Ibca109e66abdc30ec0c0a3eff1c8a33a5c909ee7 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index e8e8d6953cc6..31d4cc7bcd3d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "P" +#define QWLAN_VERSION_EXTRA "Q" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51P" +#define QWLAN_VERSIONSTR "5.2.0.51Q" #endif /* QWLAN_VERSION_H */ From b639e9beaf5cbf9745451d01bef22a435008d809 Mon Sep 17 00:00:00 2001 From: Zhu Jianmin Date: Thu, 26 Oct 2017 19:09:12 +0800 Subject: [PATCH 25/36] qcacld-3.0: Fixed wrong warning log for no return issue warning log: Bug report already in progress - dropping! type if caller check return value, have potential issues Change-Id: Idc8f74437e979880e1d0e4209359c96fcfdba4d9 CRs-Fixed: 2133211 --- core/wma/src/wma_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index d82a438d36c0..4480e7f60343 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -2337,6 +2337,7 @@ static int wma_flush_complete_evt_handler(void *handle, if (status != QDF_STATUS_SUCCESS) WMA_LOGE("Failed to stop the log completion timeout"); cds_logging_set_fw_flush_complete(); + return QDF_STATUS_SUCCESS; } else if (reason_code && cds_is_log_report_in_progress() == false) { /* Asynchronous flush event for fatal events */ status = cds_set_log_completion(WLAN_LOG_TYPE_FATAL, From d7cbe0865355fade520b15a2f8878288a3bc2472 Mon Sep 17 00:00:00 2001 From: snandini Date: Fri, 27 Oct 2017 07:56:52 -0700 Subject: [PATCH 26/36] Release 5.2.0.51R Release 5.2.0.51R Change-Id: I6da8dd2718714ca2dce55a6e934bb72d441014eb CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 31d4cc7bcd3d..e5c54d1fe1bc 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Q" +#define QWLAN_VERSION_EXTRA "R" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51Q" +#define QWLAN_VERSIONSTR "5.2.0.51R" #endif /* QWLAN_VERSION_H */ From 84e0d5f2a8a3126fb7c692ffbcd572c2a1640feb Mon Sep 17 00:00:00 2001 From: Yingying Tang Date: Wed, 22 Feb 2017 21:10:19 +0800 Subject: [PATCH 27/36] qcacld-3.0: Add "static" to fix compilation error for HL bus Add "static" before some functions which only be used in 1 file to resolve compilation error. Change-Id: Id1b1101c3bb04910ad1e3639887f74e44d5b7c36 CRs-Fixed: 2010227 --- core/dp/txrx/ol_tx.c | 2 +- core/dp/txrx/ol_tx_classify.c | 6 +++--- core/dp/txrx/ol_tx_sched.c | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/dp/txrx/ol_tx.c b/core/dp/txrx/ol_tx.c index 10a3d6d38f77..481110b8fee6 100644 --- a/core/dp/txrx/ol_tx.c +++ b/core/dp/txrx/ol_tx.c @@ -49,6 +49,7 @@ /* internal header files relevant only for specific systems (Pronto) */ #include /* OL_TX_ENCAP, etc */ #include +#include #ifdef WLAN_FEATURE_FASTPATH #include /* HIF_DEVICE */ @@ -56,7 +57,6 @@ #include #include /* htc_endpoint */ #include -#include #include int ce_send_fast(struct CE_handle *copyeng, qdf_nbuf_t msdu, unsigned int transfer_id, uint32_t download_len); diff --git a/core/dp/txrx/ol_tx_classify.c b/core/dp/txrx/ol_tx_classify.c index eb4a87bba378..6094ac9a82b2 100644 --- a/core/dp/txrx/ol_tx_classify.c +++ b/core/dp/txrx/ol_tx_classify.c @@ -367,7 +367,7 @@ struct ol_txrx_peer_t *ol_tx_tdls_peer_find(struct ol_txrx_pdev_t *pdev, } #else -struct ol_txrx_peer_t *ol_tx_tdls_peer_find(struct ol_txrx_pdev_t *pdev, +static struct ol_txrx_peer_t *ol_tx_tdls_peer_find(struct ol_txrx_pdev_t *pdev, struct ol_txrx_vdev_t *vdev, uint8_t *peer_id) { @@ -734,7 +734,7 @@ ol_tx_classify_mgmt( return txq; } -A_STATUS +static A_STATUS ol_tx_classify_extension( struct ol_txrx_vdev_t *vdev, struct ol_tx_desc_t *tx_desc, @@ -845,7 +845,7 @@ ol_tx_classify_extension( return A_OK; } -A_STATUS +static A_STATUS ol_tx_classify_mgmt_extension( struct ol_txrx_vdev_t *vdev, struct ol_tx_desc_t *tx_desc, diff --git a/core/dp/txrx/ol_tx_sched.c b/core/dp/txrx/ol_tx_sched.c index 470bf28361a4..0df4d8e2fc42 100644 --- a/core/dp/txrx/ol_tx_sched.c +++ b/core/dp/txrx/ol_tx_sched.c @@ -936,7 +936,7 @@ ol_tx_sched_txq_deactivate_wrr_adv( category->state.active = 0; } -ol_tx_frms_queue_list * +static ol_tx_frms_queue_list * ol_tx_sched_category_tx_queues_wrr_adv(struct ol_txrx_pdev_t *pdev, int cat) { struct ol_tx_sched_wrr_adv_t *scheduler = pdev->tx_sched.scheduler; @@ -946,7 +946,7 @@ ol_tx_sched_category_tx_queues_wrr_adv(struct ol_txrx_pdev_t *pdev, int cat) return &category->state.head; } -int +static int ol_tx_sched_discard_select_category_wrr_adv(struct ol_txrx_pdev_t *pdev) { struct ol_tx_sched_wrr_adv_t *scheduler; @@ -974,7 +974,7 @@ ol_tx_sched_discard_select_category_wrr_adv(struct ol_txrx_pdev_t *pdev) return cat; } -void +static void ol_tx_sched_txq_discard_wrr_adv( struct ol_txrx_pdev_t *pdev, struct ol_tx_frms_queue_t *txq, @@ -996,7 +996,7 @@ ol_tx_sched_txq_discard_wrr_adv( category->state.active = 0; } -void +static void ol_tx_sched_category_info_wrr_adv( struct ol_txrx_pdev_t *pdev, int cat, int *active, @@ -1077,7 +1077,7 @@ void ol_tx_sched_wrr_param_update(struct ol_txrx_pdev_t *pdev, } } -void * +static void * ol_tx_sched_init_wrr_adv( struct ol_txrx_pdev_t *pdev) { @@ -1228,7 +1228,7 @@ void ol_tx_sched_stats_clear(struct ol_txrx_pdev_t *pdev) /*--- congestion control discard --------------------------------------------*/ -struct ol_tx_frms_queue_t * +static struct ol_tx_frms_queue_t * ol_tx_sched_discard_select_txq( struct ol_txrx_pdev_t *pdev, ol_tx_frms_queue_list *tx_queues) @@ -1370,7 +1370,7 @@ ol_tx_sched_notify( #define OL_TX_MSDU_ID_STORAGE_ERR(ptr) (NULL == ptr) -void +static void ol_tx_sched_dispatch( struct ol_txrx_pdev_t *pdev, struct ol_tx_sched_ctx *sctx) From 5850c8cf13888b4adf4cf0fa919bfab4555dc5c7 Mon Sep 17 00:00:00 2001 From: snandini Date: Fri, 27 Oct 2017 11:53:32 -0700 Subject: [PATCH 28/36] Release 5.2.0.51S Release 5.2.0.51S Change-Id: I8c9f821605cb4fb42dd4154068b43a763c62d7dc CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index e5c54d1fe1bc..ba24d0fde7a8 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "R" +#define QWLAN_VERSION_EXTRA "S" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51R" +#define QWLAN_VERSIONSTR "5.2.0.51S" #endif /* QWLAN_VERSION_H */ From a2dfefe6f8416fddc5a2ecb6a3afe9e8d2adced8 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Thu, 29 Jun 2017 19:01:24 -0700 Subject: [PATCH 29/36] qcacld-3.0: Add knobs to configure the scan paramters Add user configuration parameters to configure the number of probes in scan request and probe repeate time during scan. Change-Id: I65a3734d8080d8adfe3e9ffa26905e6adc196197 CRs-Fixed: 2071697 --- core/hdd/inc/wlan_hdd_cfg.h | 48 ++++++++++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg.c | 14 +++++++++++ core/hdd/src/wlan_hdd_main.c | 2 ++ core/wma/src/wma_scan_roam.c | 5 +++- 4 files changed, 68 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 2924b63ef233..99e126b4c686 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -910,6 +910,52 @@ enum hdd_dot11_mode { #define CFG_ACTIVE_MIN_CHANNEL_TIME_MAX (10000) #define CFG_ACTIVE_MIN_CHANNEL_TIME_DEFAULT (20) +/* + * + * gScanNumProbes - Set the number of probes on each channel for active scan + * @Min: 0 + * @Max: 20 + * @Default: 0 + * + * This ini is used to set number of probes on each channel for + * active scan + * + * Related: None + * + * Supported Feature: Scan + * + * Usage: External + * + * + */ +#define CFG_SCAN_NUM_PROBES_NAME "gScanNumProbes" +#define CFG_SCAN_NUM_PROBES_MIN (0) +#define CFG_SCAN_NUM_PROBES_MAX (20) +#define CFG_SCAN_NUM_PROBES_DEFAULT (0) + +/* + * + * gScanProbeRepeatTime - Set the probe repeat time on each channel for active scan + * @Min: 0 + * @Max: 30 + * @Default: 0 + * + * This ini is used to set probe repeat time on each channel for + * active scan + * + * Related: None + * + * Supported Feature: Scan + * + * Usage: External + * + * + */ +#define CFG_SCAN_PROBE_REPEAT_TIME_NAME "gScanProbeRepeatTime" +#define CFG_SCAN_PROBE_REPEAT_TIME_MIN (0) +#define CFG_SCAN_PROBE_REPEAT_TIME_MAX (30) +#define CFG_SCAN_PROBE_REPEAT_TIME_DEFAULT (0) + #ifdef FEATURE_WLAN_EXTSCAN /* * @@ -13324,6 +13370,8 @@ struct hdd_config { uint32_t nPassiveMaxChnTime; /* in units of milliseconds */ uint32_t nActiveMinChnTime; /* in units of milliseconds */ uint32_t nActiveMaxChnTime; /* in units of milliseconds */ + uint32_t scan_probe_repeat_time; + uint32_t scan_num_probes; uint32_t nInitialDwellTime; /* in units of milliseconds */ bool initial_scan_no_dfs_chnl; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 288e734784af..5997204bb55a 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -742,6 +742,20 @@ struct reg_table_entry g_registry_table[] = { CFG_ACTIVE_MIN_CHANNEL_TIME_MIN, CFG_ACTIVE_MIN_CHANNEL_TIME_MAX), + REG_VARIABLE(CFG_SCAN_NUM_PROBES_NAME, WLAN_PARAM_Integer, + struct hdd_config, scan_num_probes, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SCAN_NUM_PROBES_DEFAULT, + CFG_SCAN_NUM_PROBES_MIN, + CFG_SCAN_NUM_PROBES_MAX), + + REG_VARIABLE(CFG_SCAN_PROBE_REPEAT_TIME_NAME, WLAN_PARAM_Integer, + struct hdd_config, scan_probe_repeat_time, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SCAN_PROBE_REPEAT_TIME_DEFAULT, + CFG_SCAN_PROBE_REPEAT_TIME_MIN, + CFG_SCAN_PROBE_REPEAT_TIME_MAX), + REG_VARIABLE(CFG_RETRY_LIMIT_ZERO_NAME, WLAN_PARAM_Integer, struct hdd_config, retryLimitZero, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 48a2ea35f0c7..c3d50f418b62 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -12133,6 +12133,8 @@ static int hdd_update_scan_config(struct hdd_context *hdd_ctx) scan_cfg.rssi_cat_gap = cfg->nRssiCatGap; scan_cfg.scan_dwell_time_mode = cfg->scan_adaptive_dwell_mode; scan_cfg.is_snr_monitoring_enabled = cfg->fEnableSNRMonitoring; + scan_cfg.usr_cfg_probe_rpt_time = cfg->scan_probe_repeat_time ; + scan_cfg.usr_cfg_num_probes = cfg->scan_num_probes ; scan_cfg.is_bssid_hint_priority = cfg->is_bssid_hint_priority; hdd_update_pno_config(&scan_cfg.pno_cfg, cfg); diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 52a86e508092..7a2715855592 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -252,6 +252,7 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, cmd->repeat_probe_time = cmd->dwell_time_active / WMA_SCAN_NPROBES_DEFAULT; + WMA_LOGD("Repeat probe time %d", cmd->repeat_probe_time); /* CSR sends min_rest_Time, max_rest_time and idle_time * for staying on home channel to continue data traffic. * Rome fw has facility to monitor the traffic @@ -450,7 +451,9 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, } cmd->n_probes = (cmd->repeat_probe_time > 0) ? - cmd->dwell_time_active / cmd->repeat_probe_time : 0; + cmd->dwell_time_active / cmd->repeat_probe_time : 0; + + WMA_LOGD("Num Probes in each ch scan %d", cmd->n_probes); if (scan_req->channelList.numChannels) { cmd->num_chan = scan_req->channelList.numChannels; for (i = 0; i < scan_req->channelList.numChannels; ++i) { From 52a4b1564f5e09273441fb57f31eea4354026617 Mon Sep 17 00:00:00 2001 From: snandini Date: Fri, 27 Oct 2017 13:33:07 -0700 Subject: [PATCH 30/36] Release 5.2.0.51T Release 5.2.0.51T Change-Id: Idbd8b23d0ba07c9ab830dc7f6b69f5bc018fbe67 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index ba24d0fde7a8..4a58d1f13735 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "S" +#define QWLAN_VERSION_EXTRA "T" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51S" +#define QWLAN_VERSIONSTR "5.2.0.51T" #endif /* QWLAN_VERSION_H */ From d9bb45657e6286922774da83dea8af4eaa1341d7 Mon Sep 17 00:00:00 2001 From: Zhang Qian Date: Tue, 24 Oct 2017 11:35:54 +0800 Subject: [PATCH 31/36] qcacld-3.0: Fix 80211 frame subtype value in DoS attacks check Propagation from qcacld-2.0 to qcacld-3.0 The subtype values used in the Dos attacks check are not correct. No MGMT frame will be dropped in a DoS attack. Change-Id: I0fdcffd7151a78abf21bb0f4223aaba3e86a46ab CRs-Fixed: 2103880 --- core/wma/src/wma_mgmt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index b67bcfbe8ca1..ec3716d8a2cf 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -3476,7 +3476,7 @@ static bool wma_is_pkt_drop_candidate(tp_wma_handle wma_handle, peer = cdp_peer_find_by_addr(soc, pdev_ctx, peer_addr, &peer_id); if (!peer) { - if (SIR_MAC_MGMT_ASSOC_REQ != subtype) { + if (IEEE80211_FC0_SUBTYPE_ASSOC_REQ != subtype) { WMA_LOGI( FL("Received mgmt frame: %0x from unknow peer: %pM"), subtype, peer_addr); @@ -3486,7 +3486,7 @@ static bool wma_is_pkt_drop_candidate(tp_wma_handle wma_handle, } switch (subtype) { - case SIR_MAC_MGMT_ASSOC_REQ: + case IEEE80211_FC0_SUBTYPE_ASSOC_REQ: ptr = cdp_peer_last_assoc_received(soc, peer); if (ptr == NULL) { WMA_LOGE(FL("cdp_peer_last_assoc_received Failed")); @@ -3502,7 +3502,7 @@ static bool wma_is_pkt_drop_candidate(tp_wma_handle wma_handle, *cdp_peer_last_assoc_received(soc, peer) = qdf_get_system_timestamp(); break; - case SIR_MAC_MGMT_DISASSOC: + case IEEE80211_FC0_SUBTYPE_DISASSOC: ptr = cdp_peer_last_disassoc_received(soc, peer); if (ptr == NULL) { WMA_LOGE(FL("cdp_peer_last_disassoc_received Failed")); @@ -3518,7 +3518,7 @@ static bool wma_is_pkt_drop_candidate(tp_wma_handle wma_handle, *cdp_peer_last_disassoc_received(soc, peer) = qdf_get_system_timestamp(); break; - case SIR_MAC_MGMT_DEAUTH: + case IEEE80211_FC0_SUBTYPE_DEAUTH: ptr = cdp_peer_last_deauth_received(soc, peer); if (ptr == NULL) { WMA_LOGE(FL("cdp_peer_last_deauth_received Failed")); From 006ea7f34e5c605e65d92f96bc36f965f78b02f6 Mon Sep 17 00:00:00 2001 From: snandini Date: Fri, 27 Oct 2017 17:40:16 -0700 Subject: [PATCH 32/36] Release 5.2.0.51U Release 5.2.0.51U Change-Id: I3eb313dbd2600cad4b65a4239fa930835d0da635 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 4a58d1f13735..caa2b9ef1b75 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "T" +#define QWLAN_VERSION_EXTRA "U" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51T" +#define QWLAN_VERSIONSTR "5.2.0.51U" #endif /* QWLAN_VERSION_H */ From e6476b2c02d191d7b1c8539ed1f4ca09167e6148 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Mon, 16 Oct 2017 23:40:32 -0700 Subject: [PATCH 33/36] qcacld-3.0: Add iwpriv support to set HE bss color Add iwpriv support to set HE bss color in SAP 11AX mode operation Change-Id: Ib58b93e8a66d9154024e61581885c4a10d737631 CRs-Fixed: 2130322 --- Kbuild | 1 + core/hdd/inc/qc_sap_ioctl.h | 1 + core/hdd/src/wlan_hdd_hostapd.c | 14 ++++ core/mac/inc/sir_api.h | 14 ++++ core/mac/inc/wni_api.h | 1 + .../src/pe/lim/lim_process_message_queue.c | 5 ++ .../src/pe/lim/lim_process_sme_req_messages.c | 56 +++++++++++++++ core/mac/src/pe/lim/lim_prop_exts_utils.c | 18 ++++- core/mac/src/pe/lim/lim_types.h | 15 ++++ .../src/sys/legacy/src/utils/src/parser_api.c | 69 +++++++++++++++++-- core/sme/inc/sme_api.h | 19 +++++ core/sme/src/common/sme_api.c | 36 ++++++++++ 12 files changed, 244 insertions(+), 5 deletions(-) diff --git a/Kbuild b/Kbuild index eb183071a361..4a1a8ebca6af 100644 --- a/Kbuild +++ b/Kbuild @@ -2199,6 +2199,7 @@ endif ifeq ($(CONFIG_WLAN_FEATURE_11AX),y) CDEFINES += -DWLAN_FEATURE_11AX +CDEFINES += -DWLAN_FEATURE_11AX_BSS_COLOR endif # Dummy flag for WIN/MCL converged data path compilation diff --git a/core/hdd/inc/qc_sap_ioctl.h b/core/hdd/inc/qc_sap_ioctl.h index a58fe767f426..eaea2b89ffea 100644 --- a/core/hdd/inc/qc_sap_ioctl.h +++ b/core/hdd/inc/qc_sap_ioctl.h @@ -261,6 +261,7 @@ enum { QCASAP_PARAM_RANGE_EXT, QCSAP_SET_DEFAULT_AMPDU, QCSAP_ENABLE_RTS_BURSTING, + QCASAP_SET_HE_BSS_COLOR, }; int iw_get_channel_list(struct net_device *dev, diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index d3c2b6202cb9..3b0b64b4a53a 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -3633,6 +3633,17 @@ static __iw_softap_setparam(struct net_device *dev, break; } + case QCASAP_SET_HE_BSS_COLOR: + if (adapter->device_mode != QDF_SAP_MODE) + return -EINVAL; + + status = sme_set_he_bss_color(hHal, adapter->sessionId, + set_value); + if (QDF_STATUS_SUCCESS != status) { + hdd_err("SET_HE_BSS_COLOR failed"); + return -EIO; + } + break; case QCASAP_SET_DFS_NOL: wlansap_set_dfs_nol( WLAN_HDD_GET_SAP_CTX_PTR(adapter), @@ -5662,6 +5673,9 @@ static const struct iw_priv_args hostapd_private_args[] = { QCASAP_RX_CHAINMASK_CMD, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_rxchainmask" + }, { + QCASAP_SET_HE_BSS_COLOR, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_he_bss_clr" }, { QCASAP_NSS_CMD, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_nss" diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 42e2f58a4a6c..c83259fc3388 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -2718,6 +2718,20 @@ struct sir_update_session_param { uint32_t param_val; }; +/** + * struct sir_set_he_bss_color + * @message_type: SME message type + * @length: size of struct sir_set_he_bss_color + * @session_id: Session ID + * @bss_color: bss color value + */ +struct sir_set_he_bss_color { + uint16_t message_type; + uint16_t length; + uint8_t session_id; + uint8_t bss_color; +}; + /** * struct sir_create_session - Used for creating session in monitor mode * @type: SME host message type. diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index 2a888791b50d..9eedf6dbb75d 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -248,6 +248,7 @@ enum eWniMsgTypes { eWNI_SME_DFS_CAC_COMPLETE, eWNI_SME_UPDATE_CONFIG, eWNI_SME_BT_ACTIVITY_INFO_IND, + eWNI_SME_SET_HE_BSS_COLOR, eWNI_SME_MSG_TYPES_END }; diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index fa7ecd398f16..b90bbe60d2e4 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1881,6 +1881,11 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx, qdf_mem_free((void *)msg->bodyptr); msg->bodyptr = NULL; break; + case eWNI_SME_SET_HE_BSS_COLOR: + lim_process_set_he_bss_color(mac_ctx, msg->bodyptr); + qdf_mem_free((void *)msg->bodyptr); + msg->bodyptr = NULL; + break; case eWNI_SME_DEL_ALL_TDLS_PEERS: lim_process_sme_del_all_tdls_peers(mac_ctx, msg->bodyptr); qdf_mem_free((void *)msg->bodyptr); diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index b5b5c06fe2d5..10bcdd0c553a 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -6046,3 +6046,59 @@ static void lim_process_set_ie_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf) pe_err("Unable to send ExtCap to FW"); } + +#ifdef WLAN_FEATURE_11AX_BSS_COLOR +void lim_process_set_he_bss_color(tpAniSirGlobal mac_ctx, uint32_t *msg_buf) +{ + struct sir_set_he_bss_color *bss_color; + tpPESession session_entry = NULL; + tUpdateBeaconParams beacon_params; + + if (!msg_buf) { + pe_err("Buffer is Pointing to NULL"); + return; + } + + bss_color = (struct sir_set_he_bss_color *)msg_buf; + session_entry = pe_find_session_by_sme_session_id(mac_ctx, + bss_color->session_id); + if (!session_entry) { + pe_err("Session not found for given session_id %d", + bss_color->session_id); + return; + } + + if (session_entry->valid && !LIM_IS_AP_ROLE(session_entry)) { + pe_err("Invalid SystemRole %d", + GET_LIM_SYSTEM_ROLE(session_entry)); + return; + } + + if (bss_color->bss_color == session_entry->he_op.bss_color) { + pe_err("No change in BSS color, current BSS color %d", + bss_color->bss_color); + return; + } + qdf_mem_zero(&beacon_params, sizeof(beacon_params)); + beacon_params.paramChangeBitmap |= PARAM_BSS_COLOR_CHANGED; + session_entry->he_op.bss_col_disabled = 1; + session_entry->he_bss_color_change.countdown = + BSS_COLOR_SWITCH_COUNTDOWN; + session_entry->he_bss_color_change.new_color = bss_color->bss_color; + session_entry->he_op.bss_color = + session_entry->he_bss_color_change.new_color; + WMI_HEOPS_COLOR_SET(beacon_params.he_ops, + session_entry->he_op.bss_color); + WMI_HEOPS_BSSCOLORDISABLE_SET(beacon_params.he_ops, + session_entry->he_op.bss_col_disabled); + session_entry->bss_color_changing = 1; + + if (sch_set_fixed_beacon_fields(mac_ctx, session_entry) != + eSIR_SUCCESS) { + pe_err("Unable to set op mode IE in beacon"); + return; + } + + lim_send_beacon_params(mac_ctx, &beacon_params, session_entry); +} +#endif diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index 81baf383ff07..1b2902f15f59 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -234,7 +234,22 @@ vendor3: return false; } - +#ifdef WLAN_FEATURE_11AX +static void lim_extract_he_op(tpPESession session, + tSirProbeRespBeacon *beacon_struct) +{ + if (session->he_capable && beacon_struct->he_op.present) { + qdf_mem_copy(&session->he_op, &beacon_struct->he_op, + sizeof(session->he_op)); + pe_debug("he_op.bss_color %d", session->he_op.bss_color); + pe_debug("he_op.default_pe %d", session->he_op.default_pe); + } +} +#else +static inline void lim_extract_he_op(tpPESession session, + tSirProbeRespBeacon *beacon_struct) +{} +#endif /** * lim_extract_ap_capability() - extract AP's HCF/WME/WSM capability * @mac_ctx: Pointer to Global MAC structure @@ -469,6 +484,7 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie, pe_err("AP does not support op_mode rx"); } } + lim_extract_he_op(session, beacon_struct); /* Extract the UAPSD flag from WMM Parameter element */ if (beacon_struct->wmeEdcaPresent) *uapsd = beacon_struct->edcaParams.qosInfo.uapsd; diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index d29b7ecfd116..b56fed29795b 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -497,6 +497,21 @@ static inline void lim_send_reassoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, tLimMlmReassocReq *reassoc_req, tpPESession pe_session) {} #endif +#ifdef WLAN_FEATURE_11AX_BSS_COLOR +/** + * lim_process_set_he_bss_color() - process the set he bss color request + * + * @mac_ctx: global mac context pointer + * @msg_buf: message buffer pointer + * + * Return: void + */ +void lim_process_set_he_bss_color(tpAniSirGlobal mac_ctx, uint32_t *msg_buf); +#else +static inline void lim_process_set_he_bss_color(tpAniSirGlobal mac_ctx, + uint32_t *msg_buf) +{} +#endif void lim_send_delts_req_action_frame(tpAniSirGlobal pMac, tSirMacAddr peer, uint8_t wmmTspecPresent, tSirMacTSInfo * pTsinfo, diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index bac29fb7d1c9..9692d52c96b7 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -2351,6 +2351,24 @@ void update_fils_data(struct sir_fils_indication *fils_ind, } #endif +#ifdef WLAN_FEATURE_11AX_BSS_COLOR +static void update_bss_color_change_ie_from_probe_rsp( + tDot11fProbeResponse *prb_frm, + tpSirProbeRespBeacon prb_rsp_struct) +{ + if (prb_frm->bss_color_change.present) { + pe_debug("11AX: HE BSS color change present"); + qdf_mem_copy(&prb_rsp_struct->vendor_he_bss_color_change, + &prb_frm->bss_color_change, + sizeof(tDot11fIEbss_color_change)); + } +} +#else +static inline void update_bss_color_change_ie_from_probe_rsp( + tDot11fProbeResponse *prb_frm, + tpSirProbeRespBeacon prb_rsp_struct) +{} +#endif tSirRetStatus sir_convert_probe_frame2_struct(tpAniSirGlobal pMac, uint8_t *pFrame, uint32_t nFrame, @@ -2624,6 +2642,8 @@ tSirRetStatus sir_convert_probe_frame2_struct(tpAniSirGlobal pMac, sizeof(tDot11fIEhe_op)); } + update_bss_color_change_ie_from_probe_rsp(pr, pProbeResp); + qdf_mem_free(pr); return eSIR_SUCCESS; @@ -3150,6 +3170,11 @@ sir_convert_assoc_resp_frame2_struct(tpAniSirGlobal pMac, pe_debug("11AX: HE Operation IE present"); qdf_mem_copy(&pAssocRsp->he_op, &ar->he_op, sizeof(tDot11fIEhe_op)); + pe_debug("bss_clr %d def_pe %d part_bss_clr %d bss_col_dis %d", + pAssocRsp->he_op.bss_color, + pAssocRsp->he_op.default_pe, + pAssocRsp->he_op.partial_bss_col, + pAssocRsp->he_op.bss_col_disabled); } if (ar->MBO_IE.present && ar->MBO_IE.rssi_assoc_rej.present) { @@ -3624,6 +3649,23 @@ err_bcnrep: #endif /* FEATURE_WLAN_ESE */ +#ifdef WLAN_FEATURE_11AX_BSS_COLOR +static void update_bss_color_change_from_beacon_ies(tDot11fBeaconIEs *bcn_ies, + tpSirProbeRespBeacon bcn_struct) +{ + if (bcn_ies->bss_color_change.present) { + qdf_mem_copy(&bcn_struct->vendor_he_bss_color_change, + &bcn_ies->bss_color_change, + sizeof(tDot11fIEbss_color_change)); + } +} +#else +static inline void update_bss_color_change_from_beacon_ies( + tDot11fBeaconIEs *bcn_ies, + tpSirProbeRespBeacon bcn_struct) +{} +#endif + tSirRetStatus sir_parse_beacon_ie(tpAniSirGlobal pMac, tpSirProbeRespBeacon pBeaconStruct, @@ -3904,20 +3946,37 @@ sir_parse_beacon_ie(tpAniSirGlobal pMac, } if (pBies->he_cap.present) { - qdf_mem_copy(&pBeaconStruct->he_cap, - &pBies->he_cap, + qdf_mem_copy(&pBeaconStruct->he_cap, &pBies->he_cap, sizeof(tDot11fIEhe_cap)); } if (pBies->he_op.present) { - qdf_mem_copy(&pBeaconStruct->he_op, - &pBies->he_op, + qdf_mem_copy(&pBeaconStruct->he_op, &pBies->he_op, sizeof(tDot11fIEhe_op)); } + update_bss_color_change_from_beacon_ies(pBies, pBeaconStruct); + qdf_mem_free(pBies); return eSIR_SUCCESS; } /* End sir_parse_beacon_ie. */ +#ifdef WLAN_FEATURE_11AX_BSS_COLOR +static void convert_bcon_bss_color_change_ie(tDot11fBeacon *bcn_frm, + tpSirProbeRespBeacon bcn_struct) +{ + if (bcn_frm->bss_color_change.present) { + pe_debug("11AX: HE BSS color change present"); + qdf_mem_copy(&bcn_struct->vendor_he_bss_color_change, + &bcn_frm->bss_color_change, + sizeof(tDot11fIEbss_color_change)); + } +} +#else +static inline void convert_bcon_bss_color_change_ie(tDot11fBeacon *bcn_frm, + tpSirProbeRespBeacon bcn_struct) +{} +#endif + tSirRetStatus sir_convert_beacon_frame2_struct(tpAniSirGlobal pMac, uint8_t *pFrame, @@ -4282,6 +4341,8 @@ sir_convert_beacon_frame2_struct(tpAniSirGlobal pMac, sizeof(tDot11fIEhe_op)); } + convert_bcon_bss_color_change_ie(pBeacon, pBeaconStruct); + qdf_mem_free(pBeacon); return eSIR_SUCCESS; diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 77d9784d13be..76de33117009 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1855,5 +1855,24 @@ static inline QDF_STATUS sme_update_fils_config(tHalHandle hal, static inline void sme_free_join_rsp_fils_params(tCsrRoamInfo *roam_info) {} +#endif +#ifdef WLAN_FEATURE_11AX_BSS_COLOR +/** + * sme_set_he_bss_color() - Sets the HE BSS color + * + * @hal: The handle returned by mac_open + * @session_id: session_id of the request + * @bss_color: HE BSS color value to set + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_set_he_bss_color(tHalHandle hal, uint8_t session_id, + uint8_t bss_color); +#else +static inline QDF_STATUS sme_set_he_bss_color(tHalHandle hal, + uint8_t session_id, uint8_t bss_color) +{ + return QDF_STATUS_SUCCESS; +} #endif #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index afc368b66a1c..be2f0cdca8f1 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -14792,6 +14792,42 @@ void sme_update_vdev_type_nss(tHalHandle hal, uint8_t max_supp_nss, vdev_nss->tdls, vdev_nss->ocb); } +#ifdef WLAN_FEATURE_11AX_BSS_COLOR +#define MAX_BSS_COLOR_VAL 63 +#define MIN_BSS_COLOR_VAL 1 + +QDF_STATUS sme_set_he_bss_color(tHalHandle hal, uint8_t session_id, + uint8_t bss_color) + +{ + struct sir_set_he_bss_color *bss_color_msg; + uint8_t len; + + if (!hal) { + sme_err("Invalid hal pointer"); + return QDF_STATUS_E_FAULT; + } + + sme_debug("Set HE bss_color %d", bss_color); + + if (bss_color < MIN_BSS_COLOR_VAL || bss_color > MAX_BSS_COLOR_VAL) { + sme_debug("Invalid HE bss_color %d", bss_color); + return QDF_STATUS_E_INVAL; + } + len = sizeof(*bss_color_msg); + bss_color_msg = qdf_mem_malloc(len); + if (!bss_color_msg) { + sme_err("mem alloc failed"); + return QDF_STATUS_E_NOMEM; + } + bss_color_msg->message_type = eWNI_SME_SET_HE_BSS_COLOR; + bss_color_msg->length = len; + bss_color_msg->session_id = session_id; + bss_color_msg->bss_color = bss_color; + return umac_send_mb_message_to_mac(bss_color_msg); +} +#endif + /** * sme_update_hw_dbs_capable() - sets the HW DBS capability * @hal: Pointer to HAL From 9b89a2681d295fcbbddce8f43a6c56bce81442b1 Mon Sep 17 00:00:00 2001 From: snandini Date: Sat, 28 Oct 2017 03:37:27 -0700 Subject: [PATCH 34/36] Release 5.2.0.51V Release 5.2.0.51V Change-Id: Ia23aa9c8726e64e2323bd5fb0e766aa8b92836cf CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index caa2b9ef1b75..1105af759709 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "U" +#define QWLAN_VERSION_EXTRA "V" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51U" +#define QWLAN_VERSIONSTR "5.2.0.51V" #endif /* QWLAN_VERSION_H */ From dfc4dcac67a0d3f9aa66daea93c026d18e439889 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Tue, 29 Aug 2017 19:49:05 +0530 Subject: [PATCH 35/36] qcacld-3.0: Code cleanup in Vendor ACS support code 1. Add modularity to the vendor acs logic 2. Add error conditions, return values and their handling. 3. Add appropriate kernel doc. Change-Id: I5e07910d243686f77a8abbed373ea7970992b6d0 CRs-Fixed: 2100804 --- core/hdd/inc/wlan_hdd_main.h | 17 +++- core/hdd/src/wlan_hdd_cfg80211.c | 167 +++++++++++++++++++++++++------ core/hdd/src/wlan_hdd_hostapd.c | 67 ++++++++++--- core/hdd/src/wlan_hdd_main.c | 17 +++- core/sap/src/sap_api_link_cntl.c | 4 +- core/sap/src/sap_fsm.c | 4 +- core/sap/src/sap_internal.h | 2 +- core/sap/src/sap_module.c | 2 +- 8 files changed, 223 insertions(+), 57 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index c140b30b7138..394c394cc8b8 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -2123,6 +2123,17 @@ static inline bool hdd_scan_random_mac_addr_supported(void) } #endif +/** + * hdd_start_vendor_acs(): Start vendor ACS procedure + * @adapter: pointer to SAP adapter struct + * + * This function sends the ACS config to the ACS daemon and + * starts the vendor ACS timer to wait for the next command. + * + * Return: Status of vendor ACS procedure + */ +int hdd_start_vendor_acs(struct hdd_adapter *adapter); + void hdd_get_fw_version(struct hdd_context *hdd_ctx, uint32_t *major_spid, uint32_t *minor_spid, uint32_t *siid, uint32_t *crmid); @@ -2150,10 +2161,10 @@ int wlan_hdd_cfg80211_start_acs(struct hdd_adapter *adapter); * @adapter: hdd adapter * @reason: channel change reason * - * Return: none + * Return: 0 for success else error code */ -void hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter, - uint8_t reason); +int hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter, + uint8_t reason); /** * hdd_update_acs_timer_reason() - update acs timer start reason * @adapter: hdd adapter diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 5d96917df401..1c1484b5ce83 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1610,6 +1610,8 @@ static int wlan_hdd_reset_force_acs_chan_range(struct hdd_context *hdd_ctx, bool is_dfs_mode_enabled = false; uint32_t i, num_channels = 0; uint8_t channels[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; + eCsrPhyMode hw_mode; + tSirMacHTChannelWidth ch_width; if (hdd_ctx->config->force_sap_acs_st_ch > hdd_ctx->config->force_sap_acs_end_ch) { @@ -1646,6 +1648,62 @@ static int wlan_hdd_reset_force_acs_chan_range(struct hdd_context *hdd_ctx, qdf_mem_copy(sap_config->acs_cfg.ch_list, channels, num_channels); sap_config->acs_cfg.ch_list_count = num_channels; + /* Derive ACS HW mode */ + hw_mode = hdd_cfg_xlate_to_csr_phy_mode(hdd_ctx->config->dot11Mode); + if (hw_mode == eCSR_DOT11_MODE_AUTO) { + if (sme_is_feature_supported_by_fw(DOT11AX)) + hw_mode = eCSR_DOT11_MODE_11ax; + else + hw_mode = eCSR_DOT11_MODE_11ac; + } + + if (hdd_ctx->config->sap_force_11n_for_11ac) { + if (hw_mode == eCSR_DOT11_MODE_11ac || + hw_mode == eCSR_DOT11_MODE_11ac_ONLY) + hw_mode = eCSR_DOT11_MODE_11n; + } + + if ((hw_mode == eCSR_DOT11_MODE_11b || + hw_mode == eCSR_DOT11_MODE_11g || + hw_mode == eCSR_DOT11_MODE_11g_ONLY) && + sap_config->acs_cfg.start_ch > 14) { + hdd_err("Invalid ACS HW Mode %d + CH range <%d - %d>", + hw_mode, sap_config->acs_cfg.start_ch, + sap_config->acs_cfg.end_ch); + return -EINVAL; + } + sap_config->acs_cfg.hw_mode = hw_mode; + + /* Derive ACS BW */ + ch_width = eHT_CHANNEL_WIDTH_20MHZ; + if (hw_mode == eCSR_DOT11_MODE_11ac || + hw_mode == eCSR_DOT11_MODE_11ac_ONLY || + hw_mode == eCSR_DOT11_MODE_11ax || + hw_mode == eCSR_DOT11_MODE_11ax_ONLY) { + ch_width = hdd_ctx->config->vhtChannelWidth; + /* VHT in 2.4G depends on gChannelBondingMode24GHz INI param */ + if (sap_config->acs_cfg.end_ch <= 14) + ch_width = + hdd_ctx->config->nChannelBondingMode24GHz ? + eHT_CHANNEL_WIDTH_40MHZ : + eHT_CHANNEL_WIDTH_20MHZ; + } + + if (hw_mode == eCSR_DOT11_MODE_11n || + hw_mode == eCSR_DOT11_MODE_11n_ONLY) { + if (sap_config->acs_cfg.end_ch <= 14) + ch_width = + hdd_ctx->config->nChannelBondingMode24GHz ? + eHT_CHANNEL_WIDTH_40MHZ : + eHT_CHANNEL_WIDTH_20MHZ; + else + ch_width = + hdd_ctx->config->nChannelBondingMode5GHz ? + eHT_CHANNEL_WIDTH_40MHZ : + eHT_CHANNEL_WIDTH_20MHZ; + } + sap_config->acs_cfg.ch_width = ch_width; + return 0; } @@ -1656,9 +1714,9 @@ static int wlan_hdd_reset_force_acs_chan_range(struct hdd_context *hdd_ctx, * This function sets the default ACS start and end channel for the given band * and also parses the given ACS channel list. * - * Return: None + * Return: status */ -static void wlan_hdd_set_acs_ch_range(tsap_Config_t *sap_cfg, bool ht_enabled, +static int wlan_hdd_set_acs_ch_range(tsap_Config_t *sap_cfg, bool ht_enabled, bool vht_enabled) { int i; @@ -1689,7 +1747,7 @@ static void wlan_hdd_set_acs_ch_range(tsap_Config_t *sap_cfg, bool ht_enabled, /* Parse ACS Chan list from hostapd */ if (!sap_cfg->acs_cfg.ch_list) - return; + return -EINVAL; sap_cfg->acs_cfg.start_ch = sap_cfg->acs_cfg.ch_list[0]; sap_cfg->acs_cfg.end_ch = @@ -1702,6 +1760,8 @@ static void wlan_hdd_set_acs_ch_range(tsap_Config_t *sap_cfg, bool ht_enabled, if (sap_cfg->acs_cfg.end_ch < sap_cfg->acs_cfg.ch_list[i]) sap_cfg->acs_cfg.end_ch = sap_cfg->acs_cfg.ch_list[i]; } + + return 0; } @@ -2158,12 +2218,12 @@ static void hdd_get_freq_list(uint8_t *channel_list, uint32_t *freq_list, freq_list[count] = cds_chan_to_freq(channel_list[count]); } -void hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter, - uint8_t reason) +int hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter, + uint8_t reason) { struct sk_buff *skb; tsap_Config_t *sap_config; - uint32_t channel_count = 0, status; + uint32_t channel_count = 0, status = -EINVAL; uint8_t channel_list[QDF_MAX_NUM_CHAN] = {0}; uint32_t freq_list[QDF_MAX_NUM_CHAN] = {0}; uint8_t vendor_pcl_list[QDF_MAX_NUM_CHAN] = {0}; @@ -2178,7 +2238,7 @@ void hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter, if (!hdd_ctx) { hdd_err("HDD context is NULL"); - return; + return -EINVAL; } ENTER(); @@ -2238,7 +2298,7 @@ void hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter, if (!skb) { hdd_err("cfg80211_vendor_event_alloc failed"); - return; + return -ENOMEM; } /* * Application expects pcl to be a subset of channel list @@ -2324,27 +2384,45 @@ void hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter, goto fail; cfg80211_vendor_event(skb, GFP_KERNEL); - return; + return 0; fail: if (skb) kfree_skb(skb); + return status; } +/** + * hdd_create_acs_timer(): Initialize vendor ACS timer + * @adapter: pointer to SAP adapter struct + * + * This function initializes the vendor ACS timer. + * + * Return: Status of create vendor ACS timer + */ static int hdd_create_acs_timer(struct hdd_adapter *adapter) { struct hdd_external_acs_timer_context *timer_context; + QDF_STATUS status; if (adapter->sessionCtx.ap.vendor_acs_timer_initialized) return 0; - hdd_notice("Starting vendor app based ACS"); + hdd_debug("Starting vendor app based ACS"); timer_context = qdf_mem_malloc(sizeof(*timer_context)); + if (!timer_context) { + hdd_err("Could not allocate for timer_context"); + return -ENOMEM; + } timer_context->adapter = adapter; set_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags); - qdf_mc_timer_init(&adapter->sessionCtx.ap.vendor_acs_timer, + status = qdf_mc_timer_init(&adapter->sessionCtx.ap.vendor_acs_timer, QDF_TIMER_TYPE_SW, hdd_acs_response_timeout_handler, timer_context); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("Failed to initialize acs response timeout timer"); + return -EFAULT; + } adapter->sessionCtx.ap.vendor_acs_timer_initialized = true; return 0; } @@ -2360,6 +2438,35 @@ wlan_hdd_cfg80211_do_acs_policy[QCA_WLAN_VENDOR_ATTR_ACS_MAX+1] = { [QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST] = { .type = NLA_UNSPEC }, }; +int hdd_start_vendor_acs(struct hdd_adapter *adapter) +{ + struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + int status; + + status = hdd_create_acs_timer(adapter); + if (status != 0) { + hdd_err("failed to create acs timer"); + return status; + } + status = hdd_update_acs_timer_reason(adapter, + QCA_WLAN_VENDOR_ACS_SELECT_REASON_INIT); + if (status != 0) { + hdd_err("failed to update acs timer reason"); + return status; + } + + if (hdd_ctx->config->acs_support_for_dfs_ltecoex) + status = qdf_status_to_os_return(wlan_sap_set_vendor_acs( + WLAN_HDD_GET_SAP_CTX_PTR(adapter), + true)); + else + status = qdf_status_to_os_return(wlan_sap_set_vendor_acs( + WLAN_HDD_GET_SAP_CTX_PTR(adapter), + false)); + + return status; +} + /** * __wlan_hdd_cfg80211_do_acs(): CFG80211 handler function for DO_ACS Vendor CMD * @wiphy: Linux wiphy struct pointer @@ -2372,7 +2479,6 @@ wlan_hdd_cfg80211_do_acs_policy[QCA_WLAN_VENDOR_ATTR_ACS_MAX+1] = { * * Return: ACS procedure start status */ - static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, struct wireless_dev *wdev, const void *data, int data_len) @@ -2431,6 +2537,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, if (!tb[QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE]) { hdd_err("Attr hw_mode failed"); + status = -EINVAL; goto out; } hw_mode = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE]); @@ -2504,8 +2611,11 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, sap_config->acs_cfg.ch_list = qdf_mem_malloc( sizeof(uint8_t) * sap_config->acs_cfg.ch_list_count); - if (sap_config->acs_cfg.ch_list == NULL) + if (!sap_config->acs_cfg.ch_list) { + hdd_err("ACS config alloc fail"); + status = -ENOMEM; goto out; + } qdf_mem_copy(sap_config->acs_cfg.ch_list, tmp, sap_config->acs_cfg.ch_list_count); @@ -2519,7 +2629,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, if (sap_config->acs_cfg.ch_list_count) { sap_config->acs_cfg.ch_list = qdf_mem_malloc( sap_config->acs_cfg.ch_list_count); - if (sap_config->acs_cfg.ch_list == NULL) { + if (!sap_config->acs_cfg.ch_list) { hdd_err("ACS config alloc fail"); status = -ENOMEM; goto out; @@ -2540,7 +2650,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, &sap_config->acs_cfg.pcl_ch_count, sap_config->acs_cfg.pcl_channels_weight_list, QDF_MAX_NUM_CHAN); - if (QDF_STATUS_SUCCESS != qdf_status) + if (qdf_status != QDF_STATUS_SUCCESS) hdd_err("Get PCL failed"); if (sap_config->acs_cfg.pcl_ch_count) { @@ -2554,14 +2664,20 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, pcl_channels_weight_list[i]); } - wlan_hdd_set_acs_ch_range(sap_config, ht_enabled, vht_enabled); + status = wlan_hdd_set_acs_ch_range(sap_config, ht_enabled, vht_enabled); + if (status) { + hdd_err("set acs channel range failed"); + goto out; + } if (hdd_ctx->config->force_sap_acs) { hdd_debug("forcing SAP acs start and end channel"); status = wlan_hdd_reset_force_acs_chan_range(hdd_ctx, sap_config); - if (status != 0) + if (status) { + hdd_err("reset force acs channel range failed"); goto out; + } } sap_config->acs_cfg.band = hw_mode; @@ -2618,20 +2734,9 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, status = 0; } else { /* Check if vendor specific acs is enabled */ - if (hdd_ctx->config->vendor_acs_support) { - hdd_create_acs_timer(adapter); - hdd_update_acs_timer_reason(adapter, - QCA_WLAN_VENDOR_ACS_SELECT_REASON_INIT); - if (hdd_ctx->config->acs_support_for_dfs_ltecoex) - wlan_sap_set_vendor_acs( - WLAN_HDD_GET_SAP_CTX_PTR(adapter), - true); - else - wlan_sap_set_vendor_acs( - WLAN_HDD_GET_SAP_CTX_PTR(adapter), - false); - - } else + if (hdd_ctx->config->vendor_acs_support) + status = hdd_start_vendor_acs(adapter); + else status = wlan_hdd_cfg80211_start_acs(adapter); } diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 3b0b64b4a53a..e50590ea531e 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7338,8 +7338,9 @@ QDF_STATUS wlan_hdd_config_acs(struct hdd_context *hdd_ctx, struct hdd_adapter * } /** - * wlan_hdd_setup_driver_overrides : Overrides SAP / P2P GO Params - * @adapter: pointer to adapter struct + * wlan_hdd_sap_p2p_11ac_overrides: API to overwrite 11ac config in case of + * SAP or p2p go + * @ap_adapter: pointer to adapter * * This function overrides SAP / P2P Go configuration based on driver INI * parameters for 11AC override and ACS. This overrides are done to support @@ -7351,16 +7352,11 @@ QDF_STATUS wlan_hdd_config_acs(struct hdd_context *hdd_ctx, struct hdd_adapter * * * Return: 0 for Success or Negative error codes. */ -static int wlan_hdd_setup_driver_overrides(struct hdd_adapter *ap_adapter) +static int wlan_hdd_sap_p2p_11ac_overrides(struct hdd_adapter *ap_adapter) { tsap_Config_t *sap_cfg = &ap_adapter->sessionCtx.ap.sapConfig; struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter); - if (ap_adapter->device_mode == QDF_SAP_MODE && - hdd_ctx->config->force_sap_acs && - !hdd_ctx->config->vendor_acs_support) - goto setup_acs_overrides; - /* Fixed channel 11AC override: * 11AC override in qcacld is introduced for following reasons: * 1. P2P GO also follows start_bss and since p2p GO could not be @@ -7405,14 +7401,33 @@ static int wlan_hdd_setup_driver_overrides(struct hdd_adapter *ap_adapter) sap_cfg->ch_width_orig = eHT_CHANNEL_WIDTH_20MHZ; } + sap_cfg->ch_params.ch_width = sap_cfg->ch_width_orig; + wlan_reg_set_channel_params(hdd_ctx->hdd_pdev, sap_cfg->channel, + sap_cfg->sec_ch, &sap_cfg->ch_params); } - sap_cfg->ch_params.ch_width = sap_cfg->ch_width_orig; - wlan_reg_set_channel_params(hdd_ctx->hdd_pdev, sap_cfg->channel, - sap_cfg->sec_ch, &sap_cfg->ch_params); return 0; +} + +/** + * wlan_hdd_setup_acs_overrides : Overrides ACS configurations + * @adapter: pointer to adapter struct + * + * This function overrides ACS configuration based on driver INI + * parameters. These overrides are done to support android legacy + * configuration method. + * + * NOTE: Non android platform supports concurrency and these overrides shall + * not be used. Also future driver based overrides shall be consolidated in this + * function only. Avoid random overrides in other location based on ini. + * + * Return: 0 for Success or Negative error codes. + */ +static int wlan_hdd_setup_acs_overrides(struct hdd_adapter *ap_adapter) +{ + tsap_Config_t *sap_cfg = &ap_adapter->sessionCtx.ap.sapConfig; + struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter); -setup_acs_overrides: hdd_debug("** Driver force ACS override **"); sap_cfg->channel = AUTO_CHANNEL_SELECT; @@ -7491,6 +7506,34 @@ setup_acs_overrides: return 0; } +/** + * wlan_hdd_setup_driver_overrides : Overrides SAP / P2P GO Params + * @adapter: pointer to adapter struct + * + * This function overrides SAP / P2P Go configuration based on driver INI + * parameters for 11AC override and ACS. These overrides are done to support + * android legacy configuration method. + * + * NOTE: Non android platform supports concurrency and these overrides shall + * not be used. Also future driver based overrides shall be consolidated in this + * function only. Avoid random overrides in other location based on ini. + * + * Return: 0 for Success or Negative error codes. + */ +static int wlan_hdd_setup_driver_overrides(struct hdd_adapter *ap_adapter) +{ + struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter); + + if (!hdd_ctx->config->vendor_acs_support) { + if (ap_adapter->device_mode == QDF_SAP_MODE && + hdd_ctx->config->force_sap_acs) + return wlan_hdd_setup_acs_overrides(ap_adapter); + else + return wlan_hdd_sap_p2p_11ac_overrides(ap_adapter); + } else + return 0; +} + /** * wlan_hdd_cfg80211_start_bss() - start bss * @adapter: Pointer to hostapd adapter diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c3d50f418b62..e95f26b04c4b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7199,6 +7199,8 @@ void hdd_switch_sap_channel(struct hdd_adapter *adapter, uint8_t channel) int hdd_update_acs_timer_reason(struct hdd_adapter *adapter, uint8_t reason) { struct hdd_external_acs_timer_context *timer_context; + int status; + QDF_STATUS qdf_status; set_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags); @@ -7210,13 +7212,18 @@ int hdd_update_acs_timer_reason(struct hdd_adapter *adapter, uint8_t reason) timer_context = (struct hdd_external_acs_timer_context *) adapter->sessionCtx.ap.vendor_acs_timer.user_data; timer_context->reason = reason; - /* Update config to application and start the timer */ - hdd_cfg80211_update_acs_config(adapter, reason); - qdf_mc_timer_start(&adapter->sessionCtx.ap.vendor_acs_timer, - WLAN_VENDOR_ACS_WAIT_TIME); + qdf_status = + qdf_mc_timer_start(&adapter->sessionCtx.ap.vendor_acs_timer, + WLAN_VENDOR_ACS_WAIT_TIME); + if (qdf_status != QDF_STATUS_SUCCESS) { + hdd_err("failed to start external acs timer"); + return -ENOSPC; + } + /* Update config to application */ + status = hdd_cfg80211_update_acs_config(adapter, reason); hdd_notice("Updated ACS config to nl with reason %d", reason); - return 0; + return status; } /** diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 2c690cd9212f..9c731177f8b0 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -1039,8 +1039,8 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId, 0; } /* if external acs enabled */ - if (sap_ctx->vendor_acs_enabled && - !mac_ctx->sap.SapDfsInfo.target_channel) { + if (sap_ctx->vendor_acs_dfs_lte_enabled && + !mac_ctx->sap.SapDfsInfo.target_channel) { /* Return from here, processing will be done later */ return 0; } diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 51533b80975a..a22a533f7ea2 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -4293,10 +4293,10 @@ uint8_t sap_indicate_radar(struct sap_context *sap_ctx) return sap_ctx->chan_before_pre_cac; } - if (sap_ctx->vendor_acs_enabled && (QDF_STATUS_SUCCESS == + if (sap_ctx->vendor_acs_dfs_lte_enabled && (QDF_STATUS_SUCCESS == sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_NEXT_CHANNEL_REQ, (void *) eSAP_STATUS_SUCCESS))) - return 0; + return 0; target_channel = sap_random_channel_sel(sap_ctx); if (!target_channel) diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index ede1b51f9876..ab0f5419bd87 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -247,7 +247,7 @@ struct sap_context { qdf_event_t sap_session_opened_evt; bool is_pre_cac_on; bool pre_cac_complete; - bool vendor_acs_enabled; + bool vendor_acs_dfs_lte_enabled; uint8_t dfs_vendor_channel; uint8_t dfs_vendor_chan_bw; uint8_t chan_before_pre_cac; diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 7eadba126bbd..733ec6a62cb1 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -2327,7 +2327,7 @@ QDF_STATUS wlan_sap_set_vendor_acs(struct sap_context *sap_context, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; } - sap_context->vendor_acs_enabled = is_vendor_acs; + sap_context->vendor_acs_dfs_lte_enabled = is_vendor_acs; return QDF_STATUS_SUCCESS; } From 87086b58e36bb2747166735a8be45c3730fccf64 Mon Sep 17 00:00:00 2001 From: snandini Date: Mon, 30 Oct 2017 01:39:14 -0700 Subject: [PATCH 36/36] Release 5.2.0.51W Release 5.2.0.51W Change-Id: If8367e9f28adc9edc29a786026bb04ba651dd453 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 1105af759709..9bfbb49eb8b2 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "V" +#define QWLAN_VERSION_EXTRA "W" #define QWLAN_VERSION_BUILD 51 -#define QWLAN_VERSIONSTR "5.2.0.51V" +#define QWLAN_VERSIONSTR "5.2.0.51W" #endif /* QWLAN_VERSION_H */