aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorRostislav Lisovy <lisovy@gmail.com>2014-11-03 04:33:18 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-11-04 07:18:17 -0500
commit6e0bd6c35b021dc73a81ebd1ef79761233c48b50 (patch)
treef3da02d8006a5ff98f3dd33a37dc1eddafd7b85c /net/wireless/nl80211.c
parent5b3dc42b1b0db0264bbbe4ae44c15ab97bfd1e93 (diff)
cfg80211: 802.11p OCB mode handling
This patch adds new iface type (NL80211_IFTYPE_OCB) representing the OCB (Outside the Context of a BSS) mode. When establishing a connection to the network a cfg80211_join_ocb function is called (particular nl80211_command is added as well). A mandatory parameters during the ocb_join operation are 'center frequency' and 'channel width (5/10 MHz)'. Changes done in mac80211 are minimal possible required to avoid many warnings (warning: enumeration value 'NL80211_IFTYPE_OCB' not handled in switch) during compilation. Full functionality (where needed) is added in the following patch. Signed-off-by: Rostislav Lisovy <rostislav.lisovy@fel.cvut.cz> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index f7d918858d32..1a31736914e5 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -885,6 +885,7 @@ static int nl80211_key_allowed(struct wireless_dev *wdev)
885 return -ENOLINK; 885 return -ENOLINK;
886 break; 886 break;
887 case NL80211_IFTYPE_UNSPECIFIED: 887 case NL80211_IFTYPE_UNSPECIFIED:
888 case NL80211_IFTYPE_OCB:
888 case NL80211_IFTYPE_MONITOR: 889 case NL80211_IFTYPE_MONITOR:
889 case NL80211_IFTYPE_P2P_DEVICE: 890 case NL80211_IFTYPE_P2P_DEVICE:
890 case NL80211_IFTYPE_WDS: 891 case NL80211_IFTYPE_WDS:
@@ -8275,6 +8276,28 @@ static int nl80211_set_cqm(struct sk_buff *skb, struct genl_info *info)
8275 return -EINVAL; 8276 return -EINVAL;
8276} 8277}
8277 8278
8279static int nl80211_join_ocb(struct sk_buff *skb, struct genl_info *info)
8280{
8281 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8282 struct net_device *dev = info->user_ptr[1];
8283 struct ocb_setup setup = {};
8284 int err;
8285
8286 err = nl80211_parse_chandef(rdev, info, &setup.chandef);
8287 if (err)
8288 return err;
8289
8290 return cfg80211_join_ocb(rdev, dev, &setup);
8291}
8292
8293static int nl80211_leave_ocb(struct sk_buff *skb, struct genl_info *info)
8294{
8295 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8296 struct net_device *dev = info->user_ptr[1];
8297
8298 return cfg80211_leave_ocb(rdev, dev);
8299}
8300
8278static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info) 8301static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
8279{ 8302{
8280 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 8303 struct cfg80211_registered_device *rdev = info->user_ptr[0];
@@ -10218,6 +10241,22 @@ static const struct genl_ops nl80211_ops[] = {
10218 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 10241 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
10219 NL80211_FLAG_NEED_RTNL, 10242 NL80211_FLAG_NEED_RTNL,
10220 }, 10243 },
10244 {
10245 .cmd = NL80211_CMD_JOIN_OCB,
10246 .doit = nl80211_join_ocb,
10247 .policy = nl80211_policy,
10248 .flags = GENL_ADMIN_PERM,
10249 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
10250 NL80211_FLAG_NEED_RTNL,
10251 },
10252 {
10253 .cmd = NL80211_CMD_LEAVE_OCB,
10254 .doit = nl80211_leave_ocb,
10255 .policy = nl80211_policy,
10256 .flags = GENL_ADMIN_PERM,
10257 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
10258 NL80211_FLAG_NEED_RTNL,
10259 },
10221#ifdef CONFIG_PM 10260#ifdef CONFIG_PM
10222 { 10261 {
10223 .cmd = NL80211_CMD_GET_WOWLAN, 10262 .cmd = NL80211_CMD_GET_WOWLAN,