[Prism54-devel] [patch] Re: [Prism54-users] Default channel is unsupported?

Bjørn Mork bjorn@mork.no
Fri, 14 Nov 2003 15:15:09 +0100


--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Aurelien <slts@free.fr> writes:

> After some investigations it seems that the card uses the right
> channel numbering. But when we ask it to list them it reports em in
> a strange order. I'm gonna address this right now.

Thanks.  iwlist works fine now (with the exception that it lists the
unsupported 802.11a channels, but I guess that's a firmware thingy).

However, the frequency is still set to 5.2 GHz when changing to master
mode, independent of CARD_DEFAULT_CHANNEL and/or the init_channel
module parameter.  The frequency will also be set to 5.2 GHz when
changing from master to managed and back to master, even if it was
initially set to something else.  It seems that the channel must be
reset after changing to master mode.  The attached patch fixes this
problem for me, but I don't know if it's completely sane...

BTW, what's the reason for not resetting the ssid in master mode:

	/* We need to reset the ssid for non-master modes, and also
	   the 802.11d conformance. Except if we are in master or
	   monitor mode */

I guess this isn't very likely to happen in real life, but

# iwconfig eth0 mode master essid xx
# iwconfig eth0 mode managed
# iwconfig eth0 mode master

results in essid =3D "default" and not "xx" like I would expect.



Bj=F8rn


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=reset-freq.patch

Index: ksrc/isl_ioctl.c
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/isl_ioctl.c,v
retrieving revision 1.50
diff -u -r1.50 isl_ioctl.c
--- ksrc/isl_ioctl.c	14 Nov 2003 07:31:49 -0000	1.50
+++ ksrc/isl_ioctl.c	14 Nov 2003 09:53:13 -0000
@@ -550,6 +550,16 @@
 	priv->mib.mode = cardmode;
 	priv->mib.bsstype = bsstype;
 
+	if (*uwrq == IW_MODE_MASTER) {
+		/* reset the channel/frequency */
+		if (priv->mib.frequency)
+			MGT_SET_REQUEST_U32(priv, DOT11_OID_FREQUENCY,
+					    priv->mib.frequency);
+		else     /* frequency == 0 -> use channel value */
+			MGT_SET_REQUEST_U32(priv, DOT11_OID_CHANNEL, 
+					    priv->mib.channel);
+	}
+
 	/* We need to reset the ssid for non-master modes, and also
 	   the 802.11d conformance. Except if we are in master or
 	   monitor mode */

--=-=-=--