Skip to contentSkip to conversation

cfg80211: handle SIOCGIWMODE/SIOCSIWMODE

PATCH Superseded Johannes Berg 1 participant 3 messages Nov 26, 2008

Subsystems (2)
lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH v2 1/1 cfg80211: handle SIOCGIWMODE/SIOCSIWMODE

further reducing wext code in mac80211.

---
 include/net/cfg80211.h     |    4 ++
 net/mac80211/wext.c        |   68 +-------------------------------------
 net/wireless/wext-compat.c |   79 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 85 insertions(+), 66 deletions(-)
include/net/cfg80211.h +4 -0
@@ -521,5 +521,9 @@ struct cfg80211_ops {
 int cfg80211_wext_giwname(struct net_device *dev,
 			  struct iw_request_info *info,
 			  char *name, char *extra);
+int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
+			  u32 *mode, char *extra);
+int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
+			  u32 *mode, char *extra);
 
 #endif /* __NET_CFG80211_H */
net/mac80211/wext.c +2 -66

80 lines not on this page · raw message

net/wireless/wext-compat.c +79 -0

82 lines not on this page · raw message

author maintainer
#1 lore raw

PATCH v3 1/1 cfg80211: handle SIOCGIWMODE/SIOCSIWMODE

further reducing wext code in mac80211.

---
v3: make apply on latest tree, _properly_ fix the ibss mode thing, the previous patch that disallowed ibss on non-ibss channels still allowed doing it via nl80211.

 include/net/cfg80211.h     |    4 ++
 net/mac80211/iface.c       |    4 ++
 net/mac80211/wext.c        |   76 +------------------------------------------
 net/wireless/wext-compat.c |   79 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 89 insertions(+), 74 deletions(-)
include/net/cfg80211.h +4 -0
@@ -521,5 +521,9 @@ struct cfg80211_ops {
 int cfg80211_wext_giwname(struct net_device *dev,
 			  struct iw_request_info *info,
 			  char *name, char *extra);
+int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
+			  u32 *mode, char *extra);
+int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
+			  u32 *mode, char *extra);
 
 #endif /* __NET_CFG80211_H */
net/mac80211/wext.c +2 -74

88 lines not on this page · raw message

net/wireless/wext-compat.c +79 -0

82 lines not on this page · raw message

net/mac80211/iface.c +4 -0
@@ -694,6 +694,10 @@ int ieee80211_if_change_type(struct ieee
 	if (type == sdata->vif.type)
 		return 0;
 
+	/* Setting ad-hoc mode on non-IBSS channel is not supported. */
+	if (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)
+		return -EOPNOTSUPP;
+
 	/*
 	 * We could, here, on changes between IBSS/STA/MESH modes,
 	 * invoke an MLME function instead that disassociates etc.
author maintainer
#2 lore raw

PATCH v4 1/1 cfg80211: handle SIOCGIWMODE/SIOCSIWMODE

Subject: cfg80211: handle SIOCGIWMODE/SIOCSIWMODE

further reducing wext code in mac80211.

---
v4: d'oh

 include/net/cfg80211.h     |    4 ++
 net/mac80211/iface.c       |    4 ++
 net/mac80211/wext.c        |   76 +------------------------------------------
 net/wireless/wext-compat.c |   79 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 89 insertions(+), 74 deletions(-)
include/net/cfg80211.h +4 -0
@@ -521,5 +521,9 @@ struct cfg80211_ops {
 int cfg80211_wext_giwname(struct net_device *dev,
 			  struct iw_request_info *info,
 			  char *name, char *extra);
+int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
+			  u32 *mode, char *extra);
+int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
+			  u32 *mode, char *extra);
 
 #endif /* __NET_CFG80211_H */
net/mac80211/wext.c +2 -74

88 lines not on this page · raw message

net/wireless/wext-compat.c +79 -0

82 lines not on this page · raw message

net/mac80211/iface.c +4 -0
@@ -694,6 +694,10 @@ int ieee80211_if_change_type(struct ieee
 	if (type == sdata->vif.type)
 		return 0;
 
+	/* Setting ad-hoc mode on non-IBSS channel is not supported. */
+	if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)
+		return -EOPNOTSUPP;
+
 	/*
 	 * We could, here, on changes between IBSS/STA/MESH modes,
 	 * invoke an MLME function instead that disassociates etc.