Re: CFT: ndis, iwi, ipw users

From: Sam Leffler <sam_at_errno.com>
Date: Wed, 10 Aug 2005 08:18:50 -0700
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


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
_at__at_ -252,7 +252,7 _at__at_
 		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:
_at__at_ -448,7 +448,6 _at__at_
 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
_at__at_ -460,20 +459,6 _at__at_
 	 */
 	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
_at__at_ -827,18 +812,6 _at__at_
 	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)
 {
_at__at_ -1351,7 +1324,7 _at__at_
 			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)
_at__at_ -1841,9 +1814,6 _at__at_
 		;
 	}
 	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;
 }
 
Received on Wed Aug 10 2005 - 13:13:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:41 UTC