diff options
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r-- | net/wireless/util.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c index ce393dd8c928..d7b672262b5f 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -800,6 +800,10 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev, | |||
800 | if (otype == NL80211_IFTYPE_AP_VLAN) | 800 | if (otype == NL80211_IFTYPE_AP_VLAN) |
801 | return -EOPNOTSUPP; | 801 | return -EOPNOTSUPP; |
802 | 802 | ||
803 | /* cannot change into P2P device type */ | ||
804 | if (ntype == NL80211_IFTYPE_P2P_DEVICE) | ||
805 | return -EOPNOTSUPP; | ||
806 | |||
803 | if (!rdev->ops->change_virtual_intf || | 807 | if (!rdev->ops->change_virtual_intf || |
804 | !(rdev->wiphy.interface_modes & (1 << ntype))) | 808 | !(rdev->wiphy.interface_modes & (1 << ntype))) |
805 | return -EOPNOTSUPP; | 809 | return -EOPNOTSUPP; |
@@ -877,6 +881,9 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev, | |||
877 | case NUM_NL80211_IFTYPES: | 881 | case NUM_NL80211_IFTYPES: |
878 | /* not happening */ | 882 | /* not happening */ |
879 | break; | 883 | break; |
884 | case NL80211_IFTYPE_P2P_DEVICE: | ||
885 | WARN_ON(1); | ||
886 | break; | ||
880 | } | 887 | } |
881 | } | 888 | } |
882 | 889 | ||
@@ -1041,8 +1048,15 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev, | |||
1041 | list_for_each_entry(wdev_iter, &rdev->wdev_list, list) { | 1048 | list_for_each_entry(wdev_iter, &rdev->wdev_list, list) { |
1042 | if (wdev_iter == wdev) | 1049 | if (wdev_iter == wdev) |
1043 | continue; | 1050 | continue; |
1044 | if (!netif_running(wdev_iter->netdev)) | 1051 | if (wdev_iter->netdev) { |
1045 | continue; | 1052 | if (!netif_running(wdev_iter->netdev)) |
1053 | continue; | ||
1054 | } else if (wdev_iter->iftype == NL80211_IFTYPE_P2P_DEVICE) { | ||
1055 | if (!wdev_iter->p2p_started) | ||
1056 | continue; | ||
1057 | } else { | ||
1058 | WARN_ON(1); | ||
1059 | } | ||
1046 | 1060 | ||
1047 | if (rdev->wiphy.software_iftypes & BIT(wdev_iter->iftype)) | 1061 | if (rdev->wiphy.software_iftypes & BIT(wdev_iter->iftype)) |
1048 | continue; | 1062 | continue; |