Skip to contentSkip to conversation

d80211: Make common function for frequency/channel selection

PATCH Applied Michael Wu 2 participants 2 messages Feb 10, 2007 – Feb 15, 2007 Networking

lore
Share & tools
lore

Michael Wu

author
#0 lore raw

PATCH 1/1 d80211: Make common function for frequency/channel selection

d80211: Make common function for frequency/channel selection

This patch creates ieee80211_set_channel and moves the channel selection and setting code in ieee80211_ioctl_siwfreq to this function. This allows IBSS code in ieee80211_sta.c to set the channel without using the wireless extensions interface.

---

 net/d80211/ieee80211_i.h     |    1 +
 net/d80211/ieee80211_ioctl.c |   47 ++++++++++++++++++++++--------------------
 net/d80211/ieee80211_sta.c   |   10 +--------
 3 files changed, 27 insertions(+), 31 deletions(-)
net/d80211/ieee80211_i.h +1 -0
index 60d0a22..fa42fb5 100644
@@ -660,6 +660,7 @@ void ieee80211_stop_scan(struct ieee8021
 int ieee80211_set_compression(struct ieee80211_local *local,
 			      struct net_device *dev, struct sta_info *sta);
 int ieee80211_init_client(struct net_device *dev);
+int ieee80211_set_channel(struct ieee80211_local *local, int channel, int freq);
 /* ieee80211_sta.c */
 void ieee80211_sta_timer(unsigned long data);
 void ieee80211_sta_work(struct work_struct *work);
net/d80211/ieee80211_ioctl.c +25 -22

66 lines not on this page · raw message

net/d80211/ieee80211_sta.c +1 -9
index a883384..0b56135 100644
@@ -2004,16 +2004,11 @@ static void ieee80211_sta_new_auth(struc
 }
 
 
-extern int ieee80211_ioctl_siwfreq(struct net_device *dev,
-				   struct iw_request_info *info,
-				   struct iw_freq *freq, char *extra);
-
 static int ieee80211_sta_join_ibss(struct net_device *dev,
 				   struct ieee80211_if_sta *ifsta,
 				   struct ieee80211_sta_bss *bss)
 {
 	struct ieee80211_local *local = dev->ieee80211_ptr;
-	struct iw_freq rq;
 	int res, rates, i, j;
 	struct sk_buff *skb;
 	struct ieee80211_mgmt *mgmt;
@@ -2041,10 +2036,7 @@ static int ieee80211_sta_join_ibss(struc
 	sdata->drop_unencrypted = bss->capability &
 		WLAN_CAPABILITY_PRIVACY ? 1 : 0;
 
-	memset(&rq, 0, sizeof(rq));
-	rq.m = bss->freq * 100000;
-	rq.e = 1;
-	res = ieee80211_ioctl_siwfreq(dev, NULL, &rq, NULL);
+	res = ieee80211_set_channel(local, -1, bss->freq);
 
 	if (!(local->oper_channel->flag & IEEE80211_CHAN_W_IBSS)) {
 		printk(KERN_DEBUG "%s: IBSS not allowed on channel %d "
Applied
#1 lore raw
Quoted 4 lines · Michael Wu

This patch creates ieee80211_set_channel and moves the channel selection and setting code in ieee80211_ioctl_siwfreq to this function. This allows IBSS code in ieee80211_sta.c to set the channel without using the wireless extensions interface.

Applied to my tree, thanks for the patch!

Jiri

Signature · 2 lines
Jiri Benc
SUSE Labs