From 4a646926657ec947bbb2ea4bdcc308c524f58983 Mon Sep 17 00:00:00 2001 From: xxh Date: Wed, 13 Aug 2014 08:41:36 +0800 Subject: [PATCH] modify esp8089 wifi driver for p2p fuction --- .../wireless/rockchip_wlan/esp8089/esp_mac80211.c | 4 +++- net/mac80211/main.c | 13 ++++++++++++- net/wireless/util.c | 5 ++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/rockchip_wlan/esp8089/esp_mac80211.c b/drivers/net/wireless/rockchip_wlan/esp8089/esp_mac80211.c index 8ebfc126a2f8..7e6ab3764530 100755 --- a/drivers/net/wireless/rockchip_wlan/esp8089/esp_mac80211.c +++ b/drivers/net/wireless/rockchip_wlan/esp8089/esp_mac80211.c @@ -1768,7 +1768,9 @@ struct esp_pub * esp_pub_alloc_mac80211(struct device *dev) ret = -ENOMEM; return ERR_PTR(ret); } - + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) + hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; + #endif epub = hw->priv; memset(epub, 0, sizeof(*epub)); epub->hw = hw; diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 6658c5809353..3296c1d35619 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -975,7 +975,18 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) wiphy_warn(local->hw.wiphy, "Failed to add default virtual iface\n"); } - + // ESP8089 register p2p0 IFTYPE_STA + #ifdef CONFIG_ESP8089 + if (local->hw.wiphy->interface_modes &(BIT(NL80211_IFTYPE_P2P_GO) | + BIT(NL80211_IFTYPE_P2P_CLIENT))) { + result = ieee80211_if_add(local, "p2p%d", NULL, + NL80211_IFTYPE_STATION, NULL); + if (result) + wiphy_warn(local->hw.wiphy, + "Failed to add default virtual iface\n"); + } + + #endif rtnl_unlock(); local->network_latency_notifier.notifier_call = diff --git a/net/wireless/util.c b/net/wireless/util.c index f5ad4d94ba88..56de576fd343 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -1283,7 +1283,10 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev, continue; } else if (wdev_iter->netdev) { if (!netif_running(wdev_iter->netdev)) - continue; + { + continue; + } + continue; } else { WARN_ON(1); } -- 2.34.1