Bladeren bron

qcacld-3.0: Handle SAP turn-off gracefully during SSR

There is a possibility of user to turn-off SAP while SSR is
in progress, leading framework to show SAP as turn-off though
SAP is still beaconning, after succsessful SSR.
Changes are done to make sure driver and framework are in sync.

Change-Id: Ic3cd1eebb23482e9cebf04683533face178698b4
CRs-Fixed: 2137646
Hanumanth Reddy Pothula 7 jaren geleden
bovenliggende
commit
74a97d4ada
1 gewijzigde bestanden met toevoegingen van 23 en 0 verwijderingen
  1. 23 0
      core/hdd/src/wlan_hdd_p2p.c

+ 23 - 0
core/hdd/src/wlan_hdd_p2p.c

@@ -605,6 +605,23 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
 		}
 	}
 
+	if (session_type == QDF_SAP_MODE) {
+		adapter = hdd_get_adapter(hdd_ctx, QDF_SAP_MODE);
+		if (adapter && test_bit(NET_DEVICE_REGISTERED,
+					 &adapter->event_flags)) {
+			hdd_debug("iface already registered");
+			if (adapter->session.ap.beacon) {
+				qdf_mem_free(adapter->session.ap.beacon);
+				adapter->session.ap.beacon = NULL;
+			}
+			if (adapter->dev && adapter->dev->ieee80211_ptr)
+				return adapter->dev->ieee80211_ptr;
+
+			hdd_err("ieee80211_ptr points to NULL");
+			return ERR_PTR(-EINVAL);
+		}
+	}
+
 	adapter = NULL;
 	if (hdd_ctx->config->isP2pDeviceAddrAdministrated &&
 	    ((NL80211_IFTYPE_P2P_GO == type) ||
@@ -773,6 +790,12 @@ int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
 		return -EINVAL;
 	}
 
+	/*
+	 * Clear SOFTAP_INIT_DONE flag to mark SAP unload, so that we do
+	 * not restart SAP after SSR as SAP is already stopped from user space.
+	 */
+	clear_bit(SOFTAP_INIT_DONE, &pVirtAdapter->event_flags);
+
 	MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
 			 TRACE_CODE_HDD_DEL_VIRTUAL_INTF,
 			 pVirtAdapter->session_id, pVirtAdapter->device_mode));