Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Aug 2005 08:18:50 -0700
From:      Sam Leffler <sam@errno.com>
To:        Michal Mertl <mime@traveller.cz>
Cc:        freebsd-current@freebsd.org
Subject:   Re: CFT: ndis, iwi, ipw users
Message-ID:  <42FA1ADA.9070009@errno.com>
In-Reply-To: <1123685317.966.34.camel@genius1.i.cz>
References:  <42F94526.9090509@errno.com>	 <1123678777.966.2.camel@genius1.i.cz> <1123685317.966.34.camel@genius1.i.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------020905070705030600050101
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Michal Mertl wrote:
> Michal Mertl wrote:
> 
>>Sam Leffler wrote:
>>
>>>http://people.freebsd.org/~sam/curchan.patch
>>>
>>>has changes to resolve an issue with not recognizing when an ap moves to 
>>>a different channel.  It eliminates the use of ic->ic_bss->ni_chan to 
>>>identify the current channel while scanning.  It's been reviewed and 
>>>tested ok on ath, wi, ral, and ural devices.  I need folks to verify it 
>>>does not break ndis, iwi, and ipw devices (there are changes for awi but 
>>>so far as I know noone uses awi).
>>>
>>>I want to get this committed to HEAD soon so quick feedback on those 
>>>devices would be appreciated.  Thanks.
>>>
>>>	Sam
>>
>>
>>My notebook with ipw still works. I have set up hostap on ath on channel
>>1 and associated the notebook to it. I then changed the channel on the
>>AP and the notebook immediately switched too.
> 
> 
> I've just noticed that the channel reported by ifconfig on the ipw
> station is wrong.
> 
> genius1# ifconfig ipw0
> ipw0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
>         ether 00:0c:f1:3e:8b:07
>         media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
>         status: associated
>         ssid testap channel 1 bssid 00:0b:6b:35:dc:f0
>         authmode OPEN privacy OFF txpowmax 100 bintval 100
> genius1# ifconfig ipw0 list scan
> SSID            BSSID              CHAN RATE  S:N   INT CAPS
> testap          00:0b:6b:35:dc:f0    9   11M 62:0   100 E
> genius1# ping 192.168.0.1
> PING 192.168.0.1 (192.168.0.1): 56 data bytes
> 64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=8.801 ms
> ^C
> --- 192.168.0.1 ping statistics ---
> 1 packets transmitted, 1 packets received, 0% packet loss
> round-trip min/avg/max/stddev = 8.801/8.801/8.801/0.000 ms
> genius1#
> 
> 
> Is this expected? I've never really checked it before.

I missed that change; thanks.  IEEE80211_IOC_CHANNEL should return 
ic->ic_curchan instead of using the getcurchan routine.  Attached is an 
updated patch for just ieee80211_ioctl.c.

	Sam


--------------020905070705030600050101
Content-Type: text/plain;
 name="ieee80211_ioctl.c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ieee80211_ioctl.c.patch"

Index: ieee80211_ioctl.c
===================================================================
RCS file: /home/ncvs/src/sys/net80211/ieee80211_ioctl.c,v
retrieving revision 1.32
diff -u -r1.32 ieee80211_ioctl.c
--- ieee80211_ioctl.c	9 Aug 2005 10:19:59 -0000	1.32
+++ ieee80211_ioctl.c	10 Aug 2005 15:12:58 -0000
@@ -252,7 +252,7 @@
 		break;
 	case WI_RID_CURRENT_CHAN:
 		wreq.wi_val[0] = htole16(
-			ieee80211_chan2ieee(ic, ic->ic_bss->ni_chan));
+			ieee80211_chan2ieee(ic, ic->ic_curchan));
 		wreq.wi_len = 1;
 		break;
 	case WI_RID_COMMS_QUALITY:
@@ -448,7 +448,6 @@
 static int
 ieee80211_setupscan(struct ieee80211com *ic, const u_int8_t chanlist[])
 {
-	int i;
 
 	/*
 	 * XXX don't permit a scan to be started unless we
@@ -460,20 +459,6 @@
 	 */
 	if (!IS_UP(ic))
 		return EINVAL;
-	if (ic->ic_ibss_chan == NULL ||
-	    isclr(chanlist, ieee80211_chan2ieee(ic, ic->ic_ibss_chan))) {
-		for (i = 0; i <= IEEE80211_CHAN_MAX; i++)
-			if (isset(chanlist, i)) {
-				ic->ic_ibss_chan = &ic->ic_channels[i];
-				goto found;
-			}
-		return EINVAL;			/* no active channels */
-found:
-		;
-	}
-	if (ic->ic_bss->ni_chan == IEEE80211_CHAN_ANYC ||
-	    isclr(chanlist, ieee80211_chan2ieee(ic, ic->ic_bss->ni_chan)))
-		ic->ic_bss->ni_chan = ic->ic_ibss_chan;
 	memcpy(ic->ic_chan_active, chanlist, sizeof(ic->ic_chan_active));
 	/*
 	 * We force the state to INIT before calling ieee80211_new_state
@@ -827,18 +812,6 @@
 	return error;
 }
 
-static struct ieee80211_channel *
-getcurchan(struct ieee80211com *ic)
-{
-	switch (ic->ic_state) {
-	case IEEE80211_S_INIT:
-	case IEEE80211_S_SCAN:
-		return ic->ic_des_chan;
-	default:
-		return ic->ic_ibss_chan;
-	}
-}
-
 static int
 cap2cipher(int flag)
 {
@@ -1351,7 +1324,7 @@
 			ireq->i_val = ic->ic_bss->ni_authmode;
 		break;
 	case IEEE80211_IOC_CHANNEL:
-		ireq->i_val = ieee80211_chan2ieee(ic, getcurchan(ic));
+		ireq->i_val = ieee80211_chan2ieee(ic, ic->ic_curchan);
 		break;
 	case IEEE80211_IOC_POWERSAVE:
 		if (ic->ic_flags & IEEE80211_F_PMGTON)
@@ -1841,9 +1814,6 @@
 		;
 	}
 	memcpy(ic->ic_chan_active, chanlist, sizeof(ic->ic_chan_active));
-	if (ic->ic_bss->ni_chan == IEEE80211_CHAN_ANYC ||
-	    isclr(chanlist, ieee80211_chan2ieee(ic, ic->ic_bss->ni_chan)))
-		ic->ic_bss->ni_chan = ic->ic_ibss_chan;
 	return IS_UP_AUTO(ic) ? ENETRESET : 0;
 }
 

--------------020905070705030600050101--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42FA1ADA.9070009>