bcmdhd: do not use SET_NETDEV_DEV for p2p (HACK)
Mursalin Akon [Fri, 30 Nov 2012 18:43:06 +0000 (10:43 -0800)]
With SET_NETDEV_DEV, network manager starts
using all the p2p* interfaces. Without
SET_NETDEV_DEV, network manager is not aware
of these virtual interfaces.

Bug 1188451

Change-Id: I3e8be1d20d92cefc0d3debea09fdca445652571a
Signed-off-by: Mursalin Akon <makon@nvidia.com>
Reviewed-on: http://git-master/r/172440
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

drivers/net/wireless/bcmdhd/Kconfig
drivers/net/wireless/bcmdhd/wl_cfg80211.c
drivers/net/wireless/bcmdhd/wl_cfgp2p.c

index b02ba51..aafdd5a 100644 (file)
@@ -91,3 +91,12 @@ config BCMDHD_CUSTOM_REGULATORY_DOMAIN
        default y
        ---help---
        Use Custom Regulatory Domain set by driver.
+
+config BCMDHD_DISABLE_P2P_SYSFS_DEVICE_NODE
+       bool "Disable sysfs entry for P2P interfaces"
+       depends on BCMDHD
+       default n
+       ---help---
+       Disable creation of sysfs device node for P2P interfaces.
+       This is a workaround to prevent management tools from
+       directly managing P2P virtual devices.
index 2db885d..d879444 100644 (file)
@@ -1120,7 +1120,9 @@ wl_cfg80211_add_virtual_iface(struct wiphy *wiphy, char *name,
                        vwdev->iftype = type;
                        _ndev =  wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION);
                        _ndev->ieee80211_ptr = vwdev;
+#ifndef CONFIG_BCMDHD_DISABLE_P2P_SYSFS_DEVICE_NODE
                        SET_NETDEV_DEV(_ndev, wiphy_dev(vwdev->wiphy));
+#endif
                        vwdev->netdev = _ndev;
                        wl_set_drv_status(wl, READY, _ndev);
                        wl->p2p->vif_created = true;
index 2c0f022..aebb03f 100644 (file)
@@ -2148,7 +2148,9 @@ wl_cfgp2p_register_ndev(struct wl_priv *wl)
        net->ethtool_ops = &cfgp2p_ethtool_ops;
 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) */
 
+#ifndef CONFIG_BCMDHD_DISABLE_P2P_SYSFS_DEVICE_NODE
        SET_NETDEV_DEV(net, wiphy_dev(wdev->wiphy));
+#endif
 
        /* Associate p2p0 network interface with new wdev */
        wdev->netdev = net;