Skip to contentSkip to conversation

mac80211: Implement commit in wireless extensions

PATCH Superseded Alina Friedrichsen 2 participants 4 messages Feb 25, 2009 mac80211

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Implement commit in wireless extensions

This implements commit in wireless extensions for completeness and mayb= e it could be useful for debugging to initiate a new rejoining process = without changing the config.

I not so familiar with nl80211 at the moment, so I want add it to nl802= 11 in a second patch.

---

net/mac80211/ieee80211_i.h +0 -0
index ecbc8e0..7f00c70 100644
@@ -920,6 +920,7 @@ static inline int ieee80211_bssid_match(const u8 *r=

addr, const u8 *addr)
=20
int ieee80211_hw_config(struct ieee80211_local *local, u32 changed); int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 chang=
ed);
+int ieee80211_commit(struct ieee80211_sub_if_data *sdata);
void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx); void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sd=
ata,
u32 changed);

net/mac80211/main.c +0 -0
index f38db4d..1b2d598 100644
@@ -294,6 +294,20 @@ int ieee80211_hw_config(struct ieee80211_local *lo=

cal, u32 changed)
return ret;
}
=20
+void ieee80211_commit(struct ieee80211_sub_if_data *sdata) +{
+ switch (sdata->vif.type) {
+ case NL80211_IFTYPE_ADHOC:
+ ieee80211_ibss_commit(sdata);
+ break;
+ case NL80211_IFTYPE_STATION:
+ ieee80211_sta_commit(sdata);
+ break;
+ default:
+ break;
+ }
+}
+
void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sd=
ata,
u32 changed)
{

net/mac80211/wext.c +0 -0
index f6924fc..1ac0516 100644
@@ -121,6 +121,15 @@ static int ieee80211_set_encryption(struct ieee802=

11_sub_if_data *sdata, u8 *sta
return err;
}
=20
+static int ieee80211_ioctl_commit(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *extra)
+{
+ struct ieee80211_sub_if_data *sdata =3D IEEE80211_DEV_TO_SUB_IF(dev);
+ ieee80211_commit(sdata);
+ return 0;
+}
+
static int ieee80211_ioctl_siwgenie(struct net_device *dev,
struct iw_request_info *info, struct iw_point *data, char *extra)
@@ -1035,7 +1044,7 @@ static int ieee80211_ioctl_siwencodeext(struct ne= t_device *dev,
=20
static const iw_handler ieee80211_handler[] =3D
{
- (iw_handler) NULL, /* SIOCSIWCOMMIT */
+ (iw_handler) ieee80211_ioctl_commit, /* SIOCSIWCOMMIT */
(iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
(iw_handler) NULL, /* SIOCSIWNWID */
(iw_handler) NULL, /* SIOCGIWNWID */

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger01
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#1 lore raw
Quoted 1 line · Alina Friedrichsen

This implements commit in wireless extensions for completeness and maybe

it

Quoted 2 lines

could be useful for debugging to initiate a new rejoining process without changing the config.

I don't think that we should do this -- "completeness" for wext is a bad argument and for debugging you can also do the other things.

Quoted 2 lines

I not so familiar with nl80211 at the moment, so I want add it to nl80211 in a second patch.

No, you won't. nl80211 shall not require such hacks.

johannes

net/mac80211/ieee80211_i.h static inline int ieee80211_bssid_match(const u8 · line 923

Quoted 11 lines

---

net/mac80211/ieee80211_i.h +0 -0
index ecbc8e0..7f00c70 100644
@@ -920,6 +920,7 @@ static inline int ieee80211_bssid_match(const u8
 *raddr, const u8 *addr)
 
 int ieee80211_hw_config(struct ieee80211_local *local, u32 changed);
 int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32

changed);

net/mac80211/ieee80211_i.h static inline int ieee80211_bssid_match(const u8 · line 926

Quoted 3 lines
net/mac80211/ieee80211_i.h +1 -0
+int ieee80211_commit(struct ieee80211_sub_if_data *sdata);
 void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx);
 void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data

*sdata,

net/mac80211/main.c int ieee80211_hw_config(struct ieee80211_local

Quoted 6 lines
net/mac80211/ieee80211_i.h +0 -0
 				      u32 changed);
net/mac80211/main.c +0 -0
index f38db4d..1b2d598 100644
@@ -294,6 +294,20 @@ int ieee80211_hw_config(struct ieee80211_local

*local,

Quoted 9 lines
net/mac80211/main.c +5 -0
 u32 changed)
 	return ret;
 }
 
+void ieee80211_commit(struct ieee80211_sub_if_data *sdata)
+{
+	switch (sdata->vif.type) {
+	case NL80211_IFTYPE_ADHOC:
+		ieee80211_ibss_commit(sdata);

net/mac80211/main.c int ieee80211_hw_config(struct ieee80211_local · line 312

Quoted 10 lines
net/mac80211/main.c +9 -0
+		break;
+	case NL80211_IFTYPE_STATION:
+		ieee80211_sta_commit(sdata);
+		break;
+	default:
+		break;
+	}
+}
+
 void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data

*sdata,

Quoted 33 lines
net/mac80211/main.c +0 -0
 				      u32 changed)

{

net/mac80211/wext.c +0 -0
index f6924fc..1ac0516 100644
@@ -121,6 +121,15 @@ static int ieee80211_set_encryption(struct

ieee80211_sub_if_data *sdata, u8 *sta

net/mac80211/wext.c +10 -1
 	return err;
 }
 
+static int ieee80211_ioctl_commit(struct net_device *dev,
+				  struct iw_request_info *info,
+				  struct iw_point *data, char *extra)
+{
+	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	ieee80211_commit(sdata);
+	return 0;
+}
+
 static int ieee80211_ioctl_siwgenie(struct net_device *dev,
 				    struct iw_request_info *info,
 				    struct iw_point *data, char *extra)
@@ -1035,7 +1044,7 @@ static int ieee80211_ioctl_siwencodeext(struct
 net_device *dev,
 
 static const iw_handler ieee80211_handler[] =
 {
-	(iw_handler) NULL,				/* SIOCSIWCOMMIT */
+	(iw_handler) ieee80211_ioctl_commit,		/* SIOCSIWCOMMIT */
 	(iw_handler) cfg80211_wext_giwname,		/* SIOCGIWNAME */
 	(iw_handler) NULL,				/* SIOCSIWNWID */

(iw_handler) NULL, /* SIOCGIWNWID */

#2 lore raw

Hello Johannes!

Quoted 1 line

I don't think that we should do this -- "completeness" for wext is a =

bad

Quoted 7 lines

argument and for debugging you can also do the other things. =20

Quoted 1 line

I not so familiar with nl80211 at the moment, so I want add it to

nl80211

Quoted 1 line

in a second patch.

=20
No, you won't. nl80211 shall not require such hacks.

I personally think something like a "reload button" could be useful for=
a wireless interface.

The wext code can removed when the other wext code is removed and it is=
not much code.

Regards
Alina

--=20
Computer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL f=FCr nur 17,95 =BF/mtl.!* http://dsl.gmx.de/?ac=3DOM.AD.PD003K11308T45=
69a
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw
Quoted 4 lines · Alina Friedrichsen
Quoted 1 line

No, you won't. nl80211 shall not require such hacks.

I personally think something like a "reload button" could be useful for a wireless interface.

For nl80211 you'll just have to disassoc and assoc again or so. For wext you can, currently, always set the bssid to the current one, I think, or quickly to any and then the same, or so...

Besides, commit shouldn't be doing anything unless you have outstanding changes, which we never do, so your patch isn't even correct afaict.

Quoted 1 line

The wext code can removed when the other wext code is removed and it is

not

Quoted 1 line

much code.

I don't see a good reason to add code just to kill it again. Please just leave wext alone.

johannes