modify esp8089 wifi driver for p2p fuction
authorxxh <xxh@rock-chips.com>
Wed, 13 Aug 2014 00:41:36 +0000 (08:41 +0800)
committerxxh <xxh@rock-chips.com>
Wed, 13 Aug 2014 00:41:36 +0000 (08:41 +0800)
drivers/net/wireless/rockchip_wlan/esp8089/esp_mac80211.c
net/mac80211/main.c
net/wireless/util.c

index 8ebfc126a2f88b1d0aeacb11b2bb7f54a3e7640b..7e6ab3764530b3497538954cd1a9695f32df4c00 100755 (executable)
@@ -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;
index 6658c58093533a182323679fb389eb817476d2c3..3296c1d3561974b9f8426aa8411b3d0d0d675a37 100644 (file)
@@ -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 =
index f5ad4d94ba88692e2b400e4a404b26a11318815e..56de576fd343a6c595cda525ae737cc0fbc0903c 100644 (file)
@@ -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);
                }