Quellcode durchsuchen

Merge "qcacld-3.0: Fixes for p2p from GUI/standalone" into wlan-cld3.driver.lnx.1.1-dev

Service qcabuildsw vor 8 Jahren
Ursprung
Commit
119db31ba7

+ 4 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -260,6 +260,10 @@
 #define BSS_WAIT_TIMEOUT 10000
 
 #define PRE_CAC_SSID "pre_cac_ssid"
+
+/* session ID invalid */
+#define HDD_SESSION_ID_INVALID    0xFF
+
 /*
  * Generic asynchronous request/response support
  *

+ 12 - 4
core/hdd/src/wlan_hdd_cfg80211.c

@@ -8345,7 +8345,7 @@ static int wlan_hdd_change_client_iface_to_new_mode(struct net_device *ndev,
 	struct hdd_config *config = hdd_ctx->config;
 	hdd_wext_state_t *wext;
 	struct wireless_dev *wdev;
-	QDF_STATUS status;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	ENTER();
 
@@ -8372,12 +8372,12 @@ static int wlan_hdd_change_client_iface_to_new_mode(struct net_device *ndev,
 	}
 	memset(&adapter->sessionCtx, 0, sizeof(adapter->sessionCtx));
 	hdd_set_station_ops(adapter->dev);
-	status = hdd_init_station_mode(adapter);
 	wext = WLAN_HDD_GET_WEXT_STATE_PTR(adapter);
 	wext->roamProfile.pAddIEScan = adapter->scan_info.scanAddIE.addIEdata;
 	wext->roamProfile.nAddIEScanLength =
 		adapter->scan_info.scanAddIE.length;
 	if (type == NL80211_IFTYPE_ADHOC) {
+		status = hdd_init_station_mode(adapter);
 		wext->roamProfile.BSSType = eCSR_BSS_TYPE_START_IBSS;
 		wext->roamProfile.phyMode =
 			hdd_cfg_xlate_to_csr_phy_mode(config->dot11Mode);
@@ -8497,7 +8497,11 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 					type);
 			if (vstatus != QDF_STATUS_SUCCESS)
 				return -EINVAL;
-
+			if (hdd_start_adapter(pAdapter)) {
+				hdd_err("Failed to start adapter :%d",
+						pAdapter->device_mode);
+				return -EINVAL;
+			}
 			goto done;
 		case NL80211_IFTYPE_AP:
 		case NL80211_IFTYPE_P2P_GO:
@@ -8575,7 +8579,11 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 					type);
 			if (status != QDF_STATUS_SUCCESS)
 				return status;
-
+			if (hdd_start_adapter(pAdapter)) {
+				hdd_err("Failed to start adapter :%d",
+						pAdapter->device_mode);
+				return -EINVAL;
+			}
 			goto done;
 
 		case NL80211_IFTYPE_AP:

+ 8 - 2
core/hdd/src/wlan_hdd_main.c

@@ -1618,6 +1618,12 @@ int hdd_start_adapter(hdd_adapter_t *adapter)
 		if (ret)
 			goto err_start_adapter;
 		break;
+	case QDF_IBSS_MODE:
+		/*
+		 * For IBSS interface is initialized as part of
+		 * hdd_init_station_mode()
+		 */
+		return 0;
 	case QDF_FTM_MODE:
 		ret = hdd_start_ftm_adapter(adapter);
 		if (ret)
@@ -1801,7 +1807,6 @@ static int __hdd_open(struct net_device *dev)
 	int ret;
 
 	ENTER_DEV(dev);
-
 	MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_OPEN_REQUEST,
 		adapter->sessionId, adapter->device_mode));
 
@@ -3181,6 +3186,8 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type,
 	if (QDF_STATUS_SUCCESS != hdd_debugfs_init(adapter))
 		hdd_err("Interface %s wow debug_fs init failed", iface_name);
 
+	adapter->sessionId = HDD_SESSION_ID_INVALID;
+
 	return adapter;
 
 err_lro_cleanup:
@@ -6281,7 +6288,6 @@ static hdd_adapter_t *hdd_open_interfaces(hdd_context_t *hdd_ctx,
 
 	if (adapter == NULL)
 		return ERR_PTR(-ENOSPC);
-
 	ret = hdd_open_p2p_interface(hdd_ctx, rtnl_held);
 	if (ret)
 		goto err_close_adapter;

+ 2 - 1
core/hdd/src/wlan_hdd_p2p.c

@@ -2481,7 +2481,8 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter,
 		}
 	}
 	/* Indicate Frame Over Normal Interface */
-	hddLog(LOG1, FL("Indicate Frame over NL80211 Interface"));
+	hddLog(LOG1, FL("Indicate Frame over NL80211 sessionid : %d, idx :%d"),
+			pAdapter->sessionId, pAdapter->dev->ifindex);
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
 	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames,