Browse Source

qcacld-3.0: Send the lpass scan interface for station interface

Presently the lpass information is sent during the wlan startup
at that point session for the station interface is not created.

Send the lpass scan interface notifcation for station when the
interface up/down is received.

Change-Id: I50a68acc62a76f9e65e1758cd3b21688c0dd3500
CRs-Fixed: 2048439
Arunk Khandavalli 8 years ago
parent
commit
40943af150

+ 39 - 33
core/hdd/src/wlan_hdd_lpass.c

@@ -260,36 +260,28 @@ static void wlan_hdd_send_version_pkg(uint32_t fw_version,
 }
 
 /**
- * wlan_hdd_send_all_scan_intf_info() - report scan interfaces to lpass
+ * wlan_hdd_send_scan_intf_info() - report scan interfaces to lpass
  * @hdd_ctx: The global HDD context
+ * @adapter: Adapter that supports scanning.
  *
- * This function iterates through all of the interfaces registered
- * with HDD and indicates to lpass all that support scanning.
- * If no interfaces support scanning then that fact is also indicated.
+ * This function indicates adapter that supports scanning to lpass.
  *
  * Return: none
  */
-static void wlan_hdd_send_all_scan_intf_info(struct hdd_context *hdd_ctx)
+static void wlan_hdd_send_scan_intf_info(struct hdd_context *hdd_ctx,
+					 struct hdd_adapter *adapter)
 {
-	struct hdd_adapter *adapter = NULL;
-	bool scan_intf_found = false;
-
 	if (!hdd_ctx) {
 		hdd_err("NULL pointer for hdd_ctx");
 		return;
 	}
 
-	hdd_for_each_adapter(hdd_ctx, adapter) {
-		if (adapter->device_mode == QDF_STA_MODE ||
-		    adapter->device_mode == QDF_P2P_CLIENT_MODE ||
-		    adapter->device_mode == QDF_P2P_DEVICE_MODE) {
-			scan_intf_found = true;
-			wlan_hdd_send_status_pkg(adapter, NULL, 1, 0);
-		}
+	if (!adapter) {
+		hdd_err("Adapter is Null");
+		return;
 	}
 
-	if (!scan_intf_found)
-		wlan_hdd_send_status_pkg(adapter, NULL, 1, 0);
+	wlan_hdd_send_status_pkg(adapter, NULL, 1, 0);
 }
 
 /*
@@ -356,39 +348,53 @@ void hdd_lpass_notify_disconnect(struct hdd_adapter *adapter)
 	wlan_hdd_send_status_pkg(adapter, sta_ctx, 1, 0);
 }
 
-/*
- * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change
- * (public function documented in wlan_hdd_lpass.h)
- *
- * implementation note: when one interfaces changes we notify the
- * state of all of the interfaces.
- */
 void hdd_lpass_notify_mode_change(struct hdd_adapter *adapter)
 {
 	struct hdd_context *hdd_ctx;
 
+	if (!adapter || adapter->device_mode != QDF_STA_MODE)
+		return;
+
+	hdd_debug("Sending Lpass mode change notification");
+
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	wlan_hdd_send_all_scan_intf_info(hdd_ctx);
+	wlan_hdd_send_scan_intf_info(hdd_ctx, adapter);
 }
 
 /*
- * hdd_lpass_notify_start() - Notify LPASS of driver start
- * (public function documented in wlan_hdd_lpass.h)
+ * hdd_lpass_notify_wlan_version() - Notify LPASS WLAN Host/FW version
+ *
+ * implementation note: Notify LPASS for the WLAN host/firmware version.
  */
-void hdd_lpass_notify_start(struct hdd_context *hdd_ctx)
+void hdd_lpass_notify_wlan_version(struct hdd_context *hdd_ctx)
 {
-	wlan_hdd_send_all_scan_intf_info(hdd_ctx);
+	hdd_enter();
+
 	wlan_hdd_send_version_pkg(hdd_ctx->target_fw_version,
 				  hdd_ctx->target_hw_version,
 				  hdd_ctx->target_hw_name);
+
+	hdd_exit();
+}
+
+void hdd_lpass_notify_start(struct hdd_context *hdd_ctx,
+			    struct hdd_adapter *adapter)
+{
+	hdd_enter();
+
+	if (!adapter || adapter->device_mode != QDF_STA_MODE)
+		return;
+
+	hdd_debug("Sending Start Lpass notification");
+
+	wlan_hdd_send_scan_intf_info(hdd_ctx, adapter);
+
+	hdd_exit();
 }
 
-/*
- * hdd_lpass_notify_stop() - Notify LPASS of driver stop
- * (public function documented in wlan_hdd_lpass.h)
- */
 void hdd_lpass_notify_stop(struct hdd_context *hdd_ctx)
 {
+	hdd_debug("Sending Lpass stop notifcation");
 	wlan_hdd_send_status_pkg(NULL, NULL, 0, 0);
 }
 

+ 24 - 3
core/hdd/src/wlan_hdd_lpass.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -100,13 +100,15 @@ void hdd_lpass_notify_mode_change(struct hdd_adapter *adapter);
 /**
  * hdd_lpass_notify_start() - Notify LPASS of driver start
  * @hdd_ctx: The global HDD context
+ * @adapter: adapter for which notification is send
  *
  * This function is used to notify the LPASS feature that the wlan
  * driver has (re-)started.
  *
  * Return: none
  */
-void hdd_lpass_notify_start(struct hdd_context *hdd_ctx);
+void hdd_lpass_notify_start(struct hdd_context *hdd_ctx,
+			    struct hdd_adapter *adapter);
 
 /**
  * hdd_lpass_notify_stop() - Notify LPASS of driver stop
@@ -128,6 +130,15 @@ void hdd_lpass_notify_stop(struct hdd_context *hdd_ctx);
  */
 bool hdd_lpass_is_supported(struct hdd_context *hdd_ctx);
 
+/*
+ * hdd_lpass_notify_wlan_version() - Notify LPASS WLAN Host/FW version
+ * @hdd_ctx: The global HDD context
+ *
+ * Notify LPASS for the WLAN host/firmware and hardware version.
+ *
+ * Return: none
+ */
+void hdd_lpass_notify_wlan_version(struct hdd_context *hdd_ctx);
 #else
 static inline void hdd_lpass_target_config(struct hdd_context *hdd_ctx,
 					   struct wma_tgt_cfg *target_config)
@@ -154,12 +165,22 @@ static inline void hdd_lpass_notify_disconnect(struct hdd_adapter *adapter)
 static inline void hdd_lpass_notify_mode_change(struct hdd_adapter *adapter)
 {
 }
-static inline void hdd_lpass_notify_start(struct hdd_context *hdd_ctx) { }
+
+static inline void hdd_lpass_notify_start(struct hdd_context *hdd_ctx,
+					  struct hdd_adapter *adapter)
+{
+}
+
 static inline void hdd_lpass_notify_stop(struct hdd_context *hdd_ctx) { }
 static inline bool hdd_lpass_is_supported(struct hdd_context *hdd_ctx)
 {
 	return false;
 }
+
+static inline void hdd_lpass_notify_wlan_version(struct hdd_context *hdd_ctx)
+{
+}
+
 #endif
 
 #endif /* WLAN_HDD_LPASS_H */

+ 6 - 1
core/hdd/src/wlan_hdd_main.c

@@ -3187,6 +3187,7 @@ static int __hdd_open(struct net_device *dev)
 	}
 
 	hdd_populate_wifi_pos_cfg(hdd_ctx);
+	hdd_lpass_notify_start(hdd_ctx, adapter);
 
 err_hdd_hdd_init_deinit_lock:
 	hdd_stop_driver_ops_timer();
@@ -3266,6 +3267,9 @@ static int __hdd_stop(struct net_device *dev)
 				     WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
 				     WLAN_CONTROL_PATH);
 
+	if (adapter->device_mode == QDF_STA_MODE)
+		hdd_lpass_notify_stop(hdd_ctx);
+
 	/*
 	 * NAN data interface is different in some sense. The traffic on NDI is
 	 * bursty in nature and depends on the need to transfer. The service
@@ -6271,6 +6275,7 @@ QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx)
 					hdd_tx_resume_cb,
 					hdd_tx_flow_control_is_pause);
 
+			hdd_lpass_notify_start(hdd_ctx, adapter);
 			hdd_nud_ignore_tracking(adapter, false);
 			break;
 
@@ -11320,7 +11325,7 @@ int hdd_wlan_startup(struct device *dev)
 	qdf_spinlock_create(&hdd_ctx->acs_skip_lock);
 #endif
 
-	hdd_lpass_notify_start(hdd_ctx);
+	hdd_lpass_notify_wlan_version(hdd_ctx);
 
 	if (hdd_ctx->rps)
 		hdd_set_rps_cpu_mask(hdd_ctx);

+ 0 - 2
core/hdd/src/wlan_hdd_power.c

@@ -1352,8 +1352,6 @@ QDF_STATUS hdd_wlan_re_init(void)
 	sme_set_chip_pwr_save_fail_cb(hdd_ctx->mac_handle,
 				      hdd_chip_pwr_save_fail_detected_cb);
 
-	hdd_lpass_notify_start(hdd_ctx);
-
 	hdd_send_default_scan_ies(hdd_ctx);
 	hdd_info("WLAN host driver reinitiation completed!");