diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-06-15 18:19:54 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-08-20 07:58:21 -0400 |
commit | 98104fdeda63d57631c9f89e90a7b83b58fcee40 (patch) | |
tree | 22d0f75c2f369fd02695ea8051ddc68e6f8b8390 /net/wireless/util.c | |
parent | cc74c0c7d6d623d0d3f13ef64895937edb7b3177 (diff) |
cfg80211: add P2P Device abstraction
In order to support using a different MAC address
for the P2P Device address we must first have a
P2P Device abstraction that can be assigned a MAC
address.
This abstraction will also be useful to support
offloading P2P operations to the device, e.g.
periodic listen for discoverability.
Currently, the driver is responsible for assigning
a MAC address to the P2P Device, but this could be
changed by allowing a MAC address to be given to
the NEW_INTERFACE command.
As it has no associated netdev, a P2P Device can
only be identified by its wdev identifier but the
previous patches allowed using the wdev identifier
in various APIs, e.g. remain-on-channel.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
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; |