From 2ae6f714b0aaa9676d41074bffd6c08696a5dbb9 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 23 Sep 2016 15:08:48 -0700 Subject: [PATCH] qcacld-3.0: Refactor HDD LPASS "interface mode change" logic Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "interface mode change" logic such that the actual implementation is in the lpass feature file. Change-Id: I7be1719f6b0f4ed69d60dbb1c50dab63ca3d768a CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- core/hdd/src/wlan_hdd_lpass.c | 20 +++++++++++++++++++- core/hdd/src/wlan_hdd_lpass.h | 16 +++++++++++++--- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 4ecc1c880ff0..42add2736949 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -9268,7 +9268,7 @@ done: /* Set bitmask based on updated value */ cds_set_concurrency_mode(pAdapter->device_mode); - wlan_hdd_send_all_scan_intf_info(pHddCtx); + hdd_lpass_notify_mode_change(pAdapter); EXIT(); return 0; diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 19502908be38..4564430bb6c1 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -229,7 +229,7 @@ static void wlan_hdd_send_version_pkg(uint32_t fw_version, * * Return: none */ -void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx) +static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx) { hdd_adapter_t *adapter = NULL; hdd_adapter_list_node_t *node = NULL, *next = NULL; @@ -261,6 +261,24 @@ void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx) wlan_hdd_send_status_pkg(adapter, NULL, 1, 0); } +/** + * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change + * @adapter: The adapter whose mode was changed + * + * This function is used to notify the LPASS feature that an adapter + * had its mode changed. + * + * Return: none + */ +/* implementation note: when one changes we notify them all */ +void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter) +{ + struct hdd_context_s *hdd_ctx; + + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + wlan_hdd_send_all_scan_intf_info(hdd_ctx); +} + /** * hdd_lpass_notify_start() - Notify LPASS of driver start * @hdd_ctx: The global HDD context diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 3f9a7976b465..098063529ef2 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -29,12 +29,23 @@ #define WLAN_HDD_LPASS_H struct hdd_context_s; +struct hdd_adapter_s; #ifdef WLAN_FEATURE_LPSS void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, hdd_station_ctx_t *sta_ctx, uint8_t is_on, uint8_t is_connected); -void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx); + +/** + * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change + * @adapter: The adapter whose mode was changed + * + * This function is used to notify the LPASS feature that an adapter + * had its mode changed. + * + * Return: none + */ +void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter); /** * hdd_lpass_notify_start() - Notify LPASS of driver start @@ -65,9 +76,8 @@ static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, return; } -static inline void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx) +static inline void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter) { - return; } static inline void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) { } static inline void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx) { }