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
diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c
index 9ece01e..79bae7d 100644
--- a/core/hdd/src/wlan_hdd_lpass.c
+++ b/core/hdd/src/wlan_hdd_lpass.c
@@ -160,9 +160,9 @@
*
* 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 @@
}
/**
+ * 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
*