Browse Source

qcacmn: On CSA complete, MLME can choose to disconnect peers

CSA on DFS channels requires CAC period after RESTART response, stations
can leave during CAC period, but AP would not receive, as it moves to new
channel. Here, MLME can choose to disconnect peers.

This change moves VDEV SM to SUSPEND_RESTART substate from CSA_RESTART
if MLME chooses to disconnect peers.

Change-Id: If4a57545007bbfd0dbc8e5cc498e2741283bcfcc
CRs-Fixed: 2446744
Srinivas Pitla 6 năm trước cách đây
mục cha
commit
011b676abe

+ 25 - 0
umac/mlme/include/wlan_vdev_mlme.h

@@ -437,6 +437,7 @@ enum vdev_start_resp_type {
  *                                      MLME down operation
  * @mlme_vdev_notify_start_state_exit:  callback to notify on vdev start
  *                                      start state exit
+ * @mlme_vdev_is_newchan_no_cac:        callback to check CAC is required
  */
 struct vdev_mlme_ops {
 	QDF_STATUS (*mlme_vdev_validate_basic_params)(
@@ -506,6 +507,8 @@ struct vdev_mlme_ops {
 				struct vdev_start_response *rsp);
 	QDF_STATUS (*mlme_vdev_notify_start_state_exit)(
 				struct vdev_mlme_obj *vdev_mlme);
+	QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
+				struct vdev_mlme_obj *vdev_mlme);
 };
 
 /**
@@ -995,6 +998,28 @@ static inline QDF_STATUS mlme_vdev_notify_start_state_exit(
 	return ret;
 }
 
+/**
+ * mlme_vdev_is_newchan_no_cac - Checks new channel requires CAC
+ * @vdev_mlme_obj:  VDEV MLME comp object
+ *
+ * API checks whether Channel needs CAC period,
+ * if yes, it moves to SUSPEND_RESTART to disconnect stations before
+ * sending RESTART to FW, otherwise, it moves to RESTART_PROGRESS substate
+ *
+ * Return: SUCCESS to move to RESTART_PROGRESS substate
+ *         FAILURE, move to SUSPEND_RESTART state
+ */
+static inline QDF_STATUS mlme_vdev_is_newchan_no_cac(
+				struct vdev_mlme_obj *vdev_mlme)
+{
+	QDF_STATUS ret = QDF_STATUS_SUCCESS;
+
+	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_is_newchan_no_cac)
+		ret = vdev_mlme->ops->mlme_vdev_is_newchan_no_cac(vdev_mlme);
+
+	return ret;
+}
+
 #ifdef CMN_VDEV_MGR_TGT_IF_ENABLE
 /**
  * wlan_vdev_mlme_set_ssid() - set ssid

+ 15 - 4
umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.c

@@ -1376,10 +1376,21 @@ static bool mlme_vdev_subst_suspend_csa_restart_event(void *ctx,
 		status = true;
 		break;
 	case WLAN_VDEV_SM_EV_CSA_COMPLETE:
-		mlme_vdev_sm_transition_to(vdev_mlme, WLAN_VDEV_S_START);
-		mlme_vdev_sm_deliver_event(vdev_mlme,
-					   WLAN_VDEV_SM_EV_RESTART_REQ,
-					   event_data_len, event_data);
+		if (mlme_vdev_is_newchan_no_cac(vdev_mlme) ==
+						QDF_STATUS_SUCCESS) {
+			mlme_vdev_sm_transition_to(vdev_mlme,
+						   WLAN_VDEV_S_START);
+			mlme_vdev_sm_deliver_event(vdev_mlme,
+						   WLAN_VDEV_SM_EV_RESTART_REQ,
+						   event_data_len, event_data);
+		} else {
+			mlme_vdev_sm_transition_to
+				(vdev_mlme,
+				 WLAN_VDEV_SS_SUSPEND_SUSPEND_RESTART);
+			mlme_vdev_sm_deliver_event
+				(vdev_mlme, WLAN_VDEV_SM_EV_SUSPEND_RESTART,
+				 event_data_len, event_data);
+		}
 		status = true;
 		break;