diff options
| author | Jeff Johnson <jjohnson@codeaurora.org> | 2016-09-23 15:41:52 -0700 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-03 16:48:45 -0700 |
| commit | 7139669405bdf794479cf199ad95c37d74bfc8d0 (patch) | |
| tree | 2e3ebd59b6cca90643d4bd03631f25e3073801f1 | |
| parent | cef59bbc3b5d2c3d379703bbc7f3a204e1c5b15b (diff) | |
qcacld-3.0: Refactor HDD LPASS "connect" logic
Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of
the HDD LPASS logic. Continue that process by refactoring the
"connect" logic such that the actual implementation is in the lpass
feature file.
Change-Id: Iac7bb28cbf6c1b361cf95f1eccba507cca0d5ad3
CRs-Fixed: 1070700
| -rw-r--r-- | core/hdd/src/wlan_hdd_lpass.c | 32 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_lpass.h | 19 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_stats.c | 14 |
3 files changed, 47 insertions, 18 deletions
diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 9ece01e39e11..79bae7dfb649 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -160,9 +160,9 @@ static int wlan_hdd_gen_wlan_version_pack(struct wlan_version_data *data, * * Return: none */ -void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, - hdd_station_ctx_t *sta_ctx, - uint8_t is_on, uint8_t is_connected) +static void wlan_hdd_send_status_pkg(struct hdd_adapter_s *adapter, + struct hdd_station_ctx *sta_ctx, + uint8_t is_on, uint8_t is_connected) { int ret = 0; struct wlan_status_data data; @@ -262,6 +262,32 @@ static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx) } /** + * hdd_lpass_notify_connect() - Notify LPASS of interface connect + * @adapter: The adapter that connected + * + * This function is used to notify the LPASS feature that an adapter + * has connected. + * + * Return: none + */ +void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter) +{ + struct hdd_station_ctx *sta_ctx; + + /* only send once per connection */ + if (adapter->rssi_send) + return; + + /* don't send if driver is unloading */ + if (cds_is_driver_unloading()) + return; + + adapter->rssi_send = true; + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + wlan_hdd_send_status_pkg(adapter, sta_ctx, 1, 1); +} + +/** * hdd_lpass_notify_disconnect() - Notify LPASS of interface disconnect * @adapter: The adapter that connected * diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 480544af45e5..043f305945fa 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -32,9 +32,16 @@ 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); +/** + * hdd_lpass_notify_connect() - Notify LPASS of interface connect + * @adapter: The adapter that connected + * + * This function is used to notify the LPASS feature that an adapter + * has connected. + * + * Return: none + */ +void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter); /** * hdd_lpass_notify_disconnect() - Notify LPASS of interface disconnect @@ -80,13 +87,9 @@ void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx); */ void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx); #else -static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, - hdd_station_ctx_t *sta_ctx, - uint8_t is_on, uint8_t is_connected) +static inline void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter) { - return; } - static inline void hdd_lpass_notify_disconnect(struct hdd_adapter_s *adapter) { } diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 1531f1c1b0e9..1e786fbc9b83 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1700,13 +1700,13 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); #endif -#ifdef WLAN_FEATURE_LPSS - if (!pAdapter->rssi_send) { - pAdapter->rssi_send = true; - if (cds_is_driver_unloading()) - wlan_hdd_send_status_pkg(pAdapter, pHddStaCtx, 1, 1); - } -#endif + /* + * we notify connect to lpass here instead of during actual + * connect processing because rssi info is not accurate during + * actual connection. lpass will ensure the notification is + * only processed once per association. + */ + hdd_lpass_notify_connect(pAdapter); wlan_hdd_get_station_stats(pAdapter); rate_flags = pAdapter->hdd_stats.ClassA_stat.tx_rate_flags; |
