[WCNCR00148136] softap: fix p2p mode ping fail bug

[Description]
Fix p2p mode ping fail bug

Change-Id: I442b95decfb60cedf8440afd3ba1e3a18027bf68
Feature: softap
Signed-off-by: Chun Lee <chun.lee@mediatek.com>
CR-Id: WCNCR00148136
diff --git a/os/linux/gl_p2p.c b/os/linux/gl_p2p.c
index fe42a5c..8ab51cb 100644
--- a/os/linux/gl_p2p.c
+++ b/os/linux/gl_p2p.c
@@ -1274,9 +1274,16 @@
 #endif
 
 	/* 2. carrier on & start TX queue */
-	/*Chun todo 20161220_DFS*/
-	/*netif_carrier_on(prDev);*/
-	/*netif_tx_start_all_queues(prDev);*/
+	/*DFS todo 20161220_DFS*/
+#if (CFG_SUPPORT_DFS_MASTER == 1)
+	if (mode != RUNNING_AP_MODE) {
+		netif_carrier_on(prDev);
+		netif_tx_start_all_queues(prDev);
+	}
+#else
+	netif_carrier_on(prDev);
+	netif_tx_start_all_queues(prDev);
+#endif
 
 	return 0;		/* success */
 }				/* end of p2pOpen() */
diff --git a/os/linux/gl_p2p_cfg80211.c b/os/linux/gl_p2p_cfg80211.c
index 5faecf0..7d8c686 100644
--- a/os/linux/gl_p2p_cfg80211.c
+++ b/os/linux/gl_p2p_cfg80211.c
@@ -1090,9 +1090,11 @@
 		DBGLOG(P2P, TRACE, "mtk_p2p_cfg80211_start_ap.\n");
 		prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
 
-		/*Chun todo 20161220_DFS*/
+#if (CFG_SUPPORT_DFS_MASTER == 1)
+		/*DFS todo 20161220_DFS*/
 		netif_carrier_on(dev);
 		netif_tx_start_all_queues(dev);
+#endif
 
 		chandef = &settings->chandef;
 
@@ -1352,7 +1354,7 @@
 		DBGLOG(P2P, TRACE, "mtk_p2p_cfg80211_channel_switch.\n");
 		prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
 
-		/* Todo: 20161220_DFS_Chun */
+		/*DFS todo 20161220_DFS*/
 		netif_carrier_on(dev);
 		netif_tx_start_all_queues(dev);
 
diff --git a/os/linux/gl_p2p_init.c b/os/linux/gl_p2p_init.c
index daa686e..71459ec 100644
--- a/os/linux/gl_p2p_init.c
+++ b/os/linux/gl_p2p_init.c
@@ -96,7 +96,7 @@
 */
 static PUCHAR ifname = P2P_INF_NAME;
 static PUCHAR ifname2 = P2P_INF_NAME;
-static UINT_16 mode = RUNNING_P2P_MODE;
+UINT_16 mode = RUNNING_P2P_MODE;
 
 
 /*******************************************************************************
diff --git a/os/linux/include/gl_p2p_os.h b/os/linux/include/gl_p2p_os.h
index e6cf890..8c34bd7 100644
--- a/os/linux/include/gl_p2p_os.h
+++ b/os/linux/include/gl_p2p_os.h
@@ -106,6 +106,7 @@
 extern struct net_device *g_P2pPrDev;
 extern struct wireless_dev *gprP2pWdev;
 extern struct wireless_dev *gprP2pRoleWdev[KAL_P2P_NUM];
+extern UINT_16 mode;
 
 /*******************************************************************************
 *                           P R I V A T E   D A T A