aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-18 14:07:15 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-08-20 07:58:22 -0400
commitf142c6b906da451ded2c7a8e17b2a0e6fee3e891 (patch)
treeed23b88e0cc23cb15fa28563d27965421ed47dd7 /net/mac80211/cfg.c
parent98104fdeda63d57631c9f89e90a7b83b58fcee40 (diff)
mac80211: support P2P Device abstraction
After cfg80211 got a P2P Device abstraction, add support to mac80211. Whether it really is supported or not will depend on whether or not the driver has support for it, but mac80211 needs to change to be able to support drivers that need a P2P Device. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 8052a7ad03a6..69b322f6ca2e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -102,6 +102,18 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
102 return 0; 102 return 0;
103} 103}
104 104
105static int ieee80211_start_p2p_device(struct wiphy *wiphy,
106 struct wireless_dev *wdev)
107{
108 return ieee80211_do_open(wdev, true);
109}
110
111static void ieee80211_stop_p2p_device(struct wiphy *wiphy,
112 struct wireless_dev *wdev)
113{
114 ieee80211_sdata_stop(IEEE80211_WDEV_TO_SUB_IF(wdev));
115}
116
105static int ieee80211_set_noack_map(struct wiphy *wiphy, 117static int ieee80211_set_noack_map(struct wiphy *wiphy,
106 struct net_device *dev, 118 struct net_device *dev,
107 u16 noack_map) 119 u16 noack_map)
@@ -1774,6 +1786,7 @@ static int ieee80211_scan(struct wiphy *wiphy,
1774 case NL80211_IFTYPE_ADHOC: 1786 case NL80211_IFTYPE_ADHOC:
1775 case NL80211_IFTYPE_MESH_POINT: 1787 case NL80211_IFTYPE_MESH_POINT:
1776 case NL80211_IFTYPE_P2P_CLIENT: 1788 case NL80211_IFTYPE_P2P_CLIENT:
1789 case NL80211_IFTYPE_P2P_DEVICE:
1777 break; 1790 break;
1778 case NL80211_IFTYPE_P2P_GO: 1791 case NL80211_IFTYPE_P2P_GO:
1779 if (sdata->local->ops->hw_scan) 1792 if (sdata->local->ops->hw_scan)
@@ -2461,6 +2474,9 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
2461 if (!sdata->u.mgd.associated) 2474 if (!sdata->u.mgd.associated)
2462 need_offchan = true; 2475 need_offchan = true;
2463 break; 2476 break;
2477 case NL80211_IFTYPE_P2P_DEVICE:
2478 need_offchan = true;
2479 break;
2464 default: 2480 default:
2465 return -EOPNOTSUPP; 2481 return -EOPNOTSUPP;
2466 } 2482 }
@@ -3013,6 +3029,8 @@ struct cfg80211_ops mac80211_config_ops = {
3013 .add_virtual_intf = ieee80211_add_iface, 3029 .add_virtual_intf = ieee80211_add_iface,
3014 .del_virtual_intf = ieee80211_del_iface, 3030 .del_virtual_intf = ieee80211_del_iface,
3015 .change_virtual_intf = ieee80211_change_iface, 3031 .change_virtual_intf = ieee80211_change_iface,
3032 .start_p2p_device = ieee80211_start_p2p_device,
3033 .stop_p2p_device = ieee80211_stop_p2p_device,
3016 .add_key = ieee80211_add_key, 3034 .add_key = ieee80211_add_key,
3017 .del_key = ieee80211_del_key, 3035 .del_key = ieee80211_del_key,
3018 .get_key = ieee80211_get_key, 3036 .get_key = ieee80211_get_key,