Browse Source

qcacld-3.0: Send reject ap list to FW

Reject AP list which is maintained by the blacklist manager
has to be sent to the FW for roaming case scenarios, as
the blacklist, and rssi reject APs should not be preferred
in the reassociation.

Change-Id: I58bf90e17653dde2a5042780ba7d57fa3115d63a
CRs-Fixed: 2461230
Abhishek Singh 5 years ago
parent
commit
cf8bedbc4f

+ 23 - 13
components/blacklist_mgr/core/src/wlan_blm_core.c

@@ -640,39 +640,49 @@ blm_send_reject_ap_list_to_fw(struct wlan_objmgr_pdev *pdev,
 			      qdf_list_t *reject_db_list,
 			      struct blm_config *cfg)
 {
-	struct reject_ap_config_params *reject_list;
-	uint8_t num_of_reject_bssid = 0;
 	QDF_STATUS status;
+	struct reject_ap_params reject_params;
 
-	reject_list = qdf_mem_malloc(sizeof(*reject_list) *
-				     PDEV_MAX_NUM_BSSID_DISALLOW_LIST);
-	if (!reject_list)
+	reject_params.bssid_list =
+			qdf_mem_malloc(sizeof(*reject_params.bssid_list) *
+				       PDEV_MAX_NUM_BSSID_DISALLOW_LIST);
+	if (!reject_params.bssid_list)
 		return;
 
 	/* The priority for filling is as below */
-	blm_fill_reject_list(reject_db_list, reject_list, &num_of_reject_bssid,
+	blm_fill_reject_list(reject_db_list, reject_params.bssid_list,
+			     &reject_params.num_of_reject_bssid,
 			     USERSPACE_BLACKLIST_TYPE,
 			     PDEV_MAX_NUM_BSSID_DISALLOW_LIST, cfg);
-	blm_fill_reject_list(reject_db_list, reject_list, &num_of_reject_bssid,
+	blm_fill_reject_list(reject_db_list, reject_params.bssid_list,
+			     &reject_params.num_of_reject_bssid,
 			     DRIVER_BLACKLIST_TYPE,
 			     PDEV_MAX_NUM_BSSID_DISALLOW_LIST, cfg);
-	blm_fill_reject_list(reject_db_list, reject_list, &num_of_reject_bssid,
+	blm_fill_reject_list(reject_db_list, reject_params.bssid_list,
+			     &reject_params.num_of_reject_bssid,
 			     DRIVER_RSSI_REJECT_TYPE,
 			     PDEV_MAX_NUM_BSSID_DISALLOW_LIST, cfg);
-	blm_fill_reject_list(reject_db_list, reject_list, &num_of_reject_bssid,
+	blm_fill_reject_list(reject_db_list, reject_params.bssid_list,
+			     &reject_params.num_of_reject_bssid,
 			     USERSPACE_AVOID_TYPE,
 			     PDEV_MAX_NUM_BSSID_DISALLOW_LIST, cfg);
-	blm_fill_reject_list(reject_db_list, reject_list, &num_of_reject_bssid,
+	blm_fill_reject_list(reject_db_list, reject_params.bssid_list,
+			     &reject_params.num_of_reject_bssid,
 			     DRIVER_AVOID_TYPE,
 			     PDEV_MAX_NUM_BSSID_DISALLOW_LIST, cfg);
 
-	status = tgt_blm_send_reject_list_to_fw(pdev, reject_list,
-						num_of_reject_bssid);
+	if (!reject_params.num_of_reject_bssid) {
+		blm_debug("no candidate present in reject ap list.");
+		qdf_mem_free(reject_params.bssid_list);
+		return;
+	}
+
+	status = tgt_blm_send_reject_list_to_fw(pdev, &reject_params);
 
 	if (QDF_IS_STATUS_ERROR(status))
 		blm_err("failed to send the reject Ap list to FW");
 
-	qdf_mem_free(reject_list);
+	qdf_mem_free(reject_params.bssid_list);
 }
 
 QDF_STATUS

+ 11 - 2
components/blacklist_mgr/dispatcher/inc/wlan_blm_public_struct.h

@@ -70,6 +70,16 @@ struct reject_ap_config_params {
 	int32_t expected_rssi;
 };
 
+/**
+ * struct reject_ap_params - Struct to send bssid list and there num to FW
+ * @num_of_reject_bssid: num of bssid params there in bssid config.
+ * @bssid_list: Pointer to the bad bssid list
+ */
+struct reject_ap_params {
+	uint8_t num_of_reject_bssid;
+	struct reject_ap_config_params *bssid_list;
+};
+
 /**
  * struct wlan_blm_tx_ops - structure of tx operation function
  * pointers for blacklist manager component
@@ -77,8 +87,7 @@ struct reject_ap_config_params {
  */
 struct wlan_blm_tx_ops {
 	QDF_STATUS (*blm_send_reject_ap_list)(struct wlan_objmgr_pdev *pdev,
-				  struct reject_ap_config_params *reject_list,
-				  uint8_t num_of_reject_bssid);
+					struct reject_ap_params *reject_params);
 };
 
 /**

+ 2 - 4
components/blacklist_mgr/dispatcher/inc/wlan_blm_tgt_api.h

@@ -27,8 +27,7 @@
 /**
  * tgt_blm_send_reject_list_to_fw() - API to send the reject ap list to FW.
  * @pdev: pdev object
- * @reject_list: rejct ap list pointer
- * @num_of_reject_bssid: num of reject bssids
+ * @reject_params: Reject params contains the bssid list, and num of bssids
  *
  * This API will send the reject AP list maintained by the blacklist manager
  * to the target.
@@ -37,7 +36,6 @@
  */
 QDF_STATUS
 tgt_blm_send_reject_list_to_fw(struct wlan_objmgr_pdev *pdev,
-			       struct reject_ap_config_params *reject_list,
-			       uint8_t num_of_reject_bssid);
+			       struct reject_ap_params *reject_params);
 
 #endif

+ 21 - 3
components/blacklist_mgr/dispatcher/src/wlan_blm_tgt_api.c

@@ -23,8 +23,26 @@
 
 QDF_STATUS
 tgt_blm_send_reject_list_to_fw(struct wlan_objmgr_pdev *pdev,
-			       struct reject_ap_config_params *reject_list,
-			       uint8_t num_of_reject_bssid)
+			       struct reject_ap_params *reject_params)
 {
-	return QDF_STATUS_SUCCESS;
+	struct wlan_blm_tx_ops *blm_tx_ops;
+	struct blm_pdev_priv_obj *blm_priv;
+
+	blm_priv = blm_get_pdev_obj(pdev);
+
+	if (!blm_priv) {
+		blm_err("blm_priv is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+	blm_tx_ops = &blm_priv->blm_tx_ops;
+	if (!blm_tx_ops) {
+		blm_err("blm_tx_ops is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (blm_tx_ops->blm_send_reject_ap_list)
+		return blm_tx_ops->blm_send_reject_ap_list(pdev, reject_params);
+	blm_err("Tx ops not registered, failed to send reject list to FW");
+
+	return QDF_STATUS_E_FAILURE;
 }

+ 2 - 4
components/target_if/blacklist_mgr/inc/target_if_blm.h

@@ -29,8 +29,7 @@
 /**
  * target_if_blm_send_reject_ap_list() - API to send reject ap list to FW
  * @pdev: pdev object
- * @reject_list: reject ap list
- * @num_of_reject_bssid: num of bssids in reject ap list.
+ * @reject_params: This contains the reject ap list, and the num of BSSIDs
  *
  * This API will send the reject ap list to the target for it to handle roaming
  * case scenarios.
@@ -39,8 +38,7 @@
  */
 QDF_STATUS
 target_if_blm_send_reject_ap_list(struct wlan_objmgr_pdev *pdev,
-				  struct reject_ap_config_params *reject_list,
-				  uint8_t num_of_reject_bssid);
+				  struct reject_ap_params *reject_params);
 
 /**
  * target_if_blm_register_tx_ops() - Register blm tx ops

+ 16 - 3
components/target_if/blacklist_mgr/src/target_if_blm.c

@@ -26,12 +26,25 @@
 
 QDF_STATUS
 target_if_blm_send_reject_ap_list(struct wlan_objmgr_pdev *pdev,
-				  struct reject_ap_config_params *reject_list,
-				  uint8_t num_of_reject_bssid)
+				  struct reject_ap_params *reject_params)
 {
-	return QDF_STATUS_SUCCESS;
+	struct wmi_unified *wmi_handle;
+
+	wmi_handle = get_wmi_unified_hdl_from_pdev(pdev);
+	if (!wmi_handle) {
+		target_if_err("Invalid wmi handle");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return wmi_unified_send_reject_ap_list(wmi_handle, reject_params);
 }
 
 void target_if_blm_register_tx_ops(struct wlan_blm_tx_ops *blm_tx_ops)
 {
+	if (!blm_tx_ops) {
+		target_if_err("blm_tx_ops is null");
+		return;
+	}
+
+	blm_tx_ops->blm_send_reject_ap_list = target_if_blm_send_reject_ap_list;
 }