Browse Source

qcacld-3.0: Forward disconnect IEs from deauth roam event to kernel

Firmware sends roam event with reason WMI_ROAM_REASON_DEAUTH when
it receives deauth/disassoc from the peer and fails to roam.
The event also carries deauth/disassoc frame.
A new param "notif_params1" is defined to carry length of the
frame and a new TLV element "deauth_disassoc_frame" to carry
the frame.
Extract IEs from the frame when the event is received and
send them to kernel through cfg80211_disconnected().

Change-Id: I14610136e5e9758403e48264d04d1655e4466d3c
CRs-Fixed: 2481915
Srinivas Dasari 5 years ago
parent
commit
ea4722735d

+ 3 - 1
core/mac/inc/sir_api.h

@@ -376,7 +376,9 @@ struct sme_ready_req {
 	QDF_STATUS (*sme_msg_cb)(struct mac_context *mac,
 				 struct scheduler_msg *msg);
 	QDF_STATUS (*pe_disconnect_cb) (struct mac_context *mac,
-					uint8_t vdev_id);
+					uint8_t vdev_id,
+					uint8_t *deauth_disassoc_frame,
+					uint16_t deauth_disassoc_frame_len);
 };
 
 /**

+ 8 - 2
core/mac/src/pe/include/lim_api.h

@@ -289,11 +289,15 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
  * from firmware
  * @mac: pointer to global mac context
  * @vdev_id: VDEV in which the event was received
+ * @deauth_disassoc_frame: Deauth/disassoc frame received from firmware
+ * @deauth_disassoc_frame_len: Length of @deauth_disassoc_frame
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS
-pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id);
+pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id,
+		       uint8_t *deauth_disassoc_frame,
+		       uint16_t deauth_disassoc_frame_len);
 
 #else
 static inline QDF_STATUS
@@ -306,7 +310,9 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 }
 
 static inline QDF_STATUS
-pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id)
+pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id,
+		       uint8_t *deauth_disassoc_frame,
+		       uint16_t deauth_disassoc_frame_len)
 {
 	return QDF_STATUS_E_NOSUPPORT;
 }

+ 5 - 1
core/mac/src/pe/lim/lim_api.c

@@ -2261,7 +2261,9 @@ lim_copy_and_free_hlp_data_from_session(struct pe_session *session_ptr,
 #endif
 
 QDF_STATUS
-pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id)
+pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id,
+		       uint8_t *deauth_disassoc_frame,
+		       uint16_t deauth_disassoc_frame_len)
 {
 	struct pe_session *session;
 
@@ -2271,6 +2273,8 @@ pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id)
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	lim_extract_ies_from_deauth_disassoc(session, deauth_disassoc_frame,
+					     deauth_disassoc_frame_len);
 	lim_tear_down_link_with_ap(mac, vdev_id,
 				   eSIR_MAC_UNSPEC_FAILURE_REASON);
 

+ 3 - 1
core/wma/inc/wma.h

@@ -1144,7 +1144,9 @@ typedef struct {
 		struct bss_description *bss_desc_ptr,
 		enum sir_roam_op_code reason);
 	QDF_STATUS (*pe_disconnect_cb) (struct mac_context *mac,
-					uint8_t vdev_id);
+					uint8_t vdev_id,
+					uint8_t *deauth_disassoc_frame,
+					uint16_t deauth_disassoc_frame_len);
 	qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
 	qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
 	qdf_runtime_lock_t sap_prevent_runtime_pm_lock;

+ 6 - 2
core/wma/inc/wma_types.h

@@ -726,7 +726,9 @@ QDF_STATUS wma_register_roaming_callbacks(
 			struct bss_description *bss_desc_ptr,
 			enum sir_roam_op_code reason),
 		QDF_STATUS (*pe_disconnect_cb) (struct mac_context *mac,
-						uint8_t vdev_id));
+			uint8_t vdev_id,
+			uint8_t *deauth_disassoc_frame,
+			uint16_t deauth_disassoc_frame_len));
 #else
 static inline QDF_STATUS wma_register_roaming_callbacks(
 		QDF_STATUS (*csr_roam_synch_cb)(struct mac_context *mac,
@@ -738,7 +740,9 @@ static inline QDF_STATUS wma_register_roaming_callbacks(
 			struct bss_description *bss_desc_ptr,
 			enum sir_roam_op_code reason),
 		QDF_STATUS (*pe_disconnect_cb) (struct mac_context *mac,
-						uint8_t vdev_id))
+			uint8_t vdev_id,
+			uint8_t *deauth_disassoc_frame,
+			uint16_t deauth_disassoc_frame_len))
 {
 	return QDF_STATUS_E_NOSUPPORT;
 }

+ 3 - 1
core/wma/src/wma_mgmt.c

@@ -4405,7 +4405,9 @@ QDF_STATUS wma_register_roaming_callbacks(
 		struct bss_description *bss_desc_ptr,
 		enum sir_roam_op_code reason),
 	QDF_STATUS (*pe_disconnect_cb) (struct mac_context *mac,
-					uint8_t vdev_id))
+					uint8_t vdev_id,
+					uint8_t *deauth_disassoc_frame,
+					uint16_t deauth_disassoc_frame_len))
 {
 
 	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);

+ 6 - 1
core/wma/src/wma_scan_roam.c

@@ -5237,6 +5237,7 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
 	wmi_roam_event_fixed_param *wmi_event;
 	struct roam_offload_synch_ind *roam_synch_data;
 	enum sir_roam_op_code op_code = {0};
+	uint8_t *frame = NULL;
 
 	param_buf = (WMI_ROAM_EVENTID_param_tlvs *) event_buf;
 	if (!param_buf) {
@@ -5348,8 +5349,12 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
 	case WMI_ROAM_REASON_DEAUTH:
 		WMA_LOGD("%s: Received disconnect roam event reason:%d",
 			 __func__, wmi_event->notif);
+
+		if (wmi_event->notif_params1)
+			frame = param_buf->deauth_disassoc_frame;
 		wma_handle->pe_disconnect_cb(wma_handle->mac_context,
-					     wmi_event->vdev_id);
+					     wmi_event->vdev_id,
+					     frame, wmi_event->notif_params1);
 		break;
 	default:
 		WMA_LOGD("%s:Unhandled Roam Event %x for vdevid %x", __func__,