wlan: Cancel existing remain_on_channel request upon change interface to
GO mode

GO-NEG is success and p2p client is scanning on GO operating channel so
that it can start 8-way handshake
GO logs show that beacons were sent on listen channel instead of
operating channel.
As supplicant dosent send cancel remain on channel ,fix this in driver
by calling  wlan_hdd_cancel_existing_remain_on_channel
API when change iface happens from P2P_DEVICE to P2P_GO.
Also corresponding fix needs to be done in wpa_supplicant.

Change-Id: I7d1f35ac096d89aa5277a139c6d7beda6b4afef1
CR-Fixed:  434013
(cherry picked from commit f527dc6848699defbd7cb7e042c6b9de8e6e2bf3)
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 4b1c10e..f018810 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -2252,7 +2252,8 @@
                 hdd_cfg_xlate_to_csr_phy_mode(pConfig->dot11Mode);
                 wdev->iftype = type;
 #ifdef WLAN_FEATURE_P2P
-                if (!strcmp("p2p0",ndev->name))
+                //Check for sub-string p2p to confirm its a p2p interface
+                if (NULL != strstr(ndev->name,"p2p"))
                 {     
                     pAdapter->device_mode = (type == NL80211_IFTYPE_STATION) ?
                                 WLAN_HDD_P2P_DEVICE : WLAN_HDD_P2P_CLIENT;
@@ -2282,6 +2283,11 @@
                       "%s: setting interface Type to %s", __func__,
                       (type == NL80211_IFTYPE_AP) ? "SoftAP" : "P2pGo");
 
+                //Cancel any remain on channel for GO mode
+                if (NL80211_IFTYPE_P2P_GO == type)
+                {
+                    wlan_hdd_cancel_existing_remain_on_channel(pAdapter);
+                }
                 if (NL80211_IFTYPE_AP == type)
                 {
                      /* As Loading WLAN Driver one interface being created for p2p device
@@ -2398,7 +2404,8 @@
                 hdd_deinit_adapter( pHddCtx, pAdapter );
                 wdev->iftype = type;
 #ifdef WLAN_FEATURE_P2P
-                if (!strcmp("p2p0",ndev->name))
+                //Check for sub-string p2p to confirm its a p2p interface
+                if (NULL != strstr(ndev->name,"p2p"))
                 {
                     pAdapter->device_mode = (type == NL80211_IFTYPE_STATION) ?
                                   WLAN_HDD_P2P_DEVICE : WLAN_HDD_P2P_CLIENT;