Marc MERLIN | 17 Jan 2010 20:05

AP mode for zd1211 won't build on 2.6.31.6

I need the driver to set my antenna as an AP, but build from svn fails:

gandalfthegrey [mc]# make
/lib/modules/2.6.31.6-core2smp-1khznohz-preempt-notcks-noide-hm64-20091206/build
/var/src/zd1211/trunk
-I/var/src/zd1211/trunk/src/include -fomit-frame-pointer -O2 -Wall -Wstrict-prototypes -pipe
-DZDCONF_WE_STAT_SUPPORT=1 -DHOST_IF_USB -DAMAC -DGCCK -DOFDM -DHOSTAPD_SUPPORT
-DUSE_EP4_SET_REG -DDOWNLOADFIRMWARE -DfTX_GAIN_OFDM=0 -DfNEW_CODE_MAP=1 -DfWRITE_WORD_REG=1
-DfREAD_MUL_REG=1 -DENHANCE_RX=1 -DZD1211
src/zd1205.o src/zdasocsvc.o src/zdauthreq.o src/zdauthrsp.o src/zdmmrx.o src/zdshared.o
src/zdhci.o src/zdglobal.o src/zdencrypt.o src/zdpmfilter.o src/zdpsmon.o src/zdsynch.o
src/zdbuf.o src/zd1205_proc.o src/zdhw.o src/zddebug.o src/zdtkipseed.o src/zdmic.o src/zdusb.o src/zd1211.o
make -C /lib/modules/2.6.31.6-core2smp-1khznohz-preempt-notcks-noide-hm64-20091206/build
SUBDIRS=/var/src/zd1211/trunk modules
make[1]: Entering directory `/var/src/linux-2.6.31.6-dualcoresmp-hm64'
  CC [M]  /var/src/zd1211/trunk/src/zd1205.o
  CC [M]  /var/src/zd1211/trunk/src/zdasocsvc.o
  CC [M]  /var/src/zd1211/trunk/src/zdauthrsp.o
  CC [M]  /var/src/zd1211/trunk/src/zdmmrx.o
In file included from /var/src/zd1211/trunk/src/zd1205.h:49,
                 from /var/src/zd1211/trunk/src/zd1205.c:47:
/var/src/zd1211/trunk/src/zdcompat.h:69: error: conflicting types for 'irqreturn_t'
include/linux/irqreturn.h:16: note: previous declaration of 'irqreturn_t' was here
In file included from /var/src/zd1211/trunk/src/zd1205.h:49,
                 from /var/src/zd1211/trunk/src/zd1205.c:47:
/var/src/zd1211/trunk/src/zdcompat.h:72:1: warning: "IRQ_RETVAL" redefined
In file included from include/linux/interrupt.h:10,
                 from include/linux/netdevice.h:1058,
                 from include/net/sock.h:50,
                 from include/linux/tcp.h:177,
(Continue reading)

Hin-Tak Leung | 18 Jan 2010 00:26
Picon
Favicon

Re: AP mode for zd1211 won't build on 2.6.31.6

You obviously did not read any of the archive postings, nor look at the web site in details. The
vendor-derived driver has been defunc for a while; most people use the in-kernel rw driver, others use the
vendor driver + my patchset.

Grep the latest vendor tar ball, 

http://www.kernel.org/pub/linux/kernel/people/mcgrof/zd1211/

then grab the corresponding patch set:
http://htl10.users.sourceforge.net/patchsets/

--- On Sun, 17/1/10, Marc MERLIN <marc <at> merlins.org> wrote:

> I need the driver to set my antenna
> as an AP, but build from svn fails:
> 
> gandalfthegrey [mc]# make
> /lib/modules/2.6.31.6-core2smp-1khznohz-preempt-notcks-noide-hm64-20091206/build
> /var/src/zd1211/trunk
> -I/var/src/zd1211/trunk/src/include -fomit-frame-pointer
> -O2 -Wall -Wstrict-prototypes -pipe
> -DZDCONF_WE_STAT_SUPPORT=1 -DHOST_IF_USB -DAMAC -DGCCK
> -DOFDM -DHOSTAPD_SUPPORT -DUSE_EP4_SET_REG
> -DDOWNLOADFIRMWARE -DfTX_GAIN_OFDM=0 -DfNEW_CODE_MAP=1
> -DfWRITE_WORD_REG=1 -DfREAD_MUL_REG=1 -DENHANCE_RX=1
> -DZD1211
> src/zd1205.o src/zdasocsvc.o src/zdauthreq.o
> src/zdauthrsp.o src/zdmmrx.o src/zdshared.o src/zdhci.o
> src/zdglobal.o src/zdencrypt.o src/zdpmfilter.o
> src/zdpsmon.o src/zdsynch.o src/zdbuf.o src/zd1205_proc.o
(Continue reading)

Marc MERLIN | 18 Jan 2010 08:06

Re: AP mode for zd1211 won't build on 2.6.31.6

Executive summary: thanks for the links. I built the driver but master mode 
doesn't look supported still:
gandalfthegrey:/usr/src/zd1211# iwconfig ath1 mode master
Error for wireless request "Set Mode" (8B06) :
    SET failed on device ath1 ; Invalid argument.

Back to your mail:
On Sun, Jan 17, 2010 at 03:26:31PM -0800, Hin-Tak Leung wrote:
> You obviously did not read any of the archive postings, nor look at
> the web site in details. The vendor-derived driver has been defunc

Well, I did spend about 1H looking, but:
1) which web site?
Isn't http://linuxwireless.org/en/users/Drivers/zd1211rw the canonical
site?
If so, unless I read wrong it states nothing of the site you gave below.

2) I searched all archives I could find with "zd1211rw master mode"
on google and it brought me to this list, although I didn't find any
posts I should have found you are referring to.

Even http://lwn.net/Articles/186311/ points back to
http://zd1211.ath.cx/wiki/DriverRewrite which brings one here
http://sourceforge.net/projects/zd1211/develop.

Is there a way to seed google with the right answer and get it on
http://linuxwireless.org/en/users/Drivers/zd1211rw?

> Grep the latest vendor tar ball, 
> http://www.kernel.org/pub/linux/kernel/people/mcgrof/zd1211/
(Continue reading)

Hin-Tak Leung | 18 Jan 2010 08:23
Picon
Favicon

Re: AP mode for zd1211 won't build on 2.6.31.6

Interesting - here used to be some info explaining the three at :

http://zd1211.wiki.sourceforge.net/

but now that's gone and get re--directed back to the download site.

--- On Mon, 18/1/10, Marc MERLIN <marc <at> merlins.org> wrote:

> Executive summary: thanks for the
> links. I built the driver but master mode 
> doesn't look supported still:
> gandalfthegrey:/usr/src/zd1211# iwconfig ath1 mode master
> Error for wireless request "Set Mode" (8B06) :
>     SET failed on device ath1 ; Invalid
> argument.

You need to ifconfig up first. Nothing works before ifconfig up.

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
Marc MERLIN | 21 Jan 2010 04:06

Re: AP mode for zd1211 won't build on 2.6.31.6

Thanks for your replies and pointer to the code that builds.
Unfortunately, after I bring it up, it doesn't seem reliable enough to
allow connections.

On Mon, Jan 18, 2010 at 07:23:09AM +0000, Hin-Tak Leung wrote:
> > gandalfthegrey:/usr/src/zd1211# iwconfig ath1 mode master
> > Error for wireless request "Set Mode" (8B06) :
> >     SET failed on device ath1 ; Invalid
> > argument.
> 
> You need to ifconfig up first. Nothing works before ifconfig up.

In a nutshell, my phones see the AP. Sometimes I am able to connect to
it but not get an IP. Very rarely I get an IP, and my machine usually
ends up crashing some time around that.

One noticeable thing is that 
Tx excessive retries
in iwconfig shows a few hundred errors per second.

Is the AP code working and stable for you?

Below is the code I wrote:
----------------------------------------------------------------------------
#!/bin/bash

IF=ath1

rmmod zd1211rw
sleep 1
(Continue reading)

Hin-Tak Leung | 21 Jan 2010 04:20
Picon
Favicon

Re: AP mode for zd1211 won't build on 2.6.31.6

--- On Thu, 21/1/10, Marc MERLIN <marc <at> merlins.org> wrote:

> Thanks for your replies and pointer
> to the code that builds.
> Unfortunately, after I bring it up, it doesn't seem
> reliable enough to
> allow connections.

The code works alright for me for the 6 months I used it as my main AP - until the machine to which it is connected
to die of old age. (it is ust under 10 years old, so way past its expected lifetime).

A couple of comments: I now remember that I found that I need to run at least an 'iwlist scan' or do something
*on the AP* before a client can connect. Otherwise it is not visible to a client.

> One noticeable thing is that 
> Tx excessive retries
> in iwconfig shows a few hundred errors per second.

Hmm, I don't have that.

> Is the AP code working and stable for you?

Yes, can run it for days. But yes, the AP machine sometimes crashes after a few days.

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
(Continue reading)

Benoit PAPILLAULT | 21 Jan 2010 08:14
Picon
Favicon

Re: AP mode for zd1211 won't build on 2.6.31.6

Hin-Tak Leung a écrit :
> --- On Thu, 21/1/10, Marc MERLIN <marc <at> merlins.org> wrote:
>
>   
>> Thanks for your replies and pointer
>> to the code that builds.
>> Unfortunately, after I bring it up, it doesn't seem
>> reliable enough to
>> allow connections.
>>     
>
> The code works alright for me for the 6 months I used it as my main AP - until the machine to which it is
connected to die of old age. (it is ust under 10 years old, so way past its expected lifetime).
>
> A couple of comments: I now remember that I found that I need to run at least an 'iwlist scan' or do something
*on the AP* before a client can connect. Otherwise it is not visible to a client.
>
>   
>> One noticeable thing is that 
>> Tx excessive retries
>> in iwconfig shows a few hundred errors per second.
>>     
>
> Hmm, I don't have that.
>
>   
>> Is the AP code working and stable for you?
>>     
>
> Yes, can run it for days. But yes, the AP machine sometimes crashes after a few days.
(Continue reading)

Hin-Tak Leung | 21 Jan 2010 08:36
Picon
Favicon

Re: AP mode for zd1211 won't build on 2.6.31.6

--- On Thu, 21/1/10, Benoit PAPILLAULT <benoit.papillault <at> free.fr> wrote:
 
> Side question : from this thread, it seems that zd1211rw
> driver supports 
> AP mode. Is that true? Looking at the code (2.6.33-rc4-wl),
> it is 
> supposed to only support station, adhoc and mesh mode. Does
> AP mode 
> support has been dropped since 2.6.31.6 or are you talking
> about a 
> different code base?

Different code base - we have been talking about the vendor driver, not the rw driver. The rw driver will
never support AP mode - see the discussin a while ago on linux-wireless mailing list. (apparently the
vendor driver is not being entirely correct about power-saving issues, and the hardware itself does not
have the required spec to implement power-saving support in AP mode properly according to the 802.11
spec, so the kernel developers have decided that if it cannot be done properly, it will not be done at all).
This may be what the problem with iphone client going to sleep and the AP going funny. 

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
Marc MERLIN | 21 Jan 2010 19:10

Re: AP mode for zd1211 won't build on 2.6.31.6

On Thu, Jan 21, 2010 at 08:14:41AM +0100, Benoit PAPILLAULT wrote:
> >>Is the AP code working and stable for you?
> >
> >Yes, can run it for days. But yes, the AP machine sometimes crashes after a few days.
> >
> Side question : from this thread, it seems that zd1211rw driver
> supports AP mode. Is that true? Looking at the code (2.6.33-rc4-wl),
> it is supposed to only support station, adhoc and mesh mode. Does AP
> mode support has been dropped since 2.6.31.6 or are you talking
> about a different code base?

>From what I understand, the zd1211rw does not support AP mode (at least
it did not for me) and one is required to use a patched up someone
unmaintained upstream zd1211b driver which kind of works, but definitely
still has rough edges.

Have you seen any support in mainline yourself?

Marc
--

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
(Continue reading)

Hin-Tak Leung | 22 Jan 2010 18:14
Picon
Favicon

Re: AP mode for zd1211 won't build on 2.6.31.6

--- On Thu, 21/1/10, Marc MERLIN <marc <at> merlins.org> wrote:

> On Thu, Jan 21, 2010 at 08:14:41AM
> +0100, Benoit PAPILLAULT wrote:

> >From what I understand, the zd1211rw does not support
> AP mode (at least
> it did not for me) and one is required to use a patched up
> someone
> unmaintained upstream zd1211b driver which kind of works,
> but definitely
> still has rough edges.
> 
> Have you seen any support in mainline yourself?

The 'someone' is possibly me... AFAIK I am the only one maintaining a patch set to keep the vendor zd1211b
driver working with current kernels.
(for the reason that the rw driver is not adding AP support any time soon, and the AP mode in the vendor driver
sort of works now).

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
Marc MERLIN | 22 Jan 2010 19:22

Re: AP mode for zd1211 won't build on 2.6.31.6

On Fri, Jan 22, 2010 at 05:14:11PM +0000, Hin-Tak Leung wrote:
> --- On Thu, 21/1/10, Marc MERLIN <marc <at> merlins.org> wrote:
> 
> > On Thu, Jan 21, 2010 at 08:14:41AM
> > +0100, Benoit PAPILLAULT wrote:
> 
> > >From what I understand, the zd1211rw does not support
> > AP mode (at least
> > it did not for me) and one is required to use a patched up
> > someone

oh my, I don't know what 'someone' means here. That word does not
belong. 

> > unmaintained upstream zd1211b driver which kind of works,
> > but definitely
> > still has rough edges.
> > 
> > Have you seen any support in mainline yourself?
> 
> The 'someone' is possibly me... AFAIK I am the only one maintaining

yes. Sorry that my dodgy sentence possibly meant otherwise.

> a patch set to keep the vendor zd1211b driver working with current
> kernels. (for the reason that the rw driver is not adding AP support
> any time soon, and the AP mode in the vendor driver sort of works
> now).

Right. Thanks for your work there.
(Continue reading)

yacc | 21 Jan 2010 10:16
Picon
Favicon

Re: AP mode for zd1211 won't build on 2.6.31.6


Those messages below seem is generated due to control of NetworkManager.
Maybe you can ensure it is indeed killed.
--

Jan 20 17:47:03 gandalfthegrey kernel: Get SIOCSIWENCODEEXT
Jan 20 17:47:03 gandalfthegrey kernel: wrq->u.encoding.falgs = 00008401
Jan 20 17:47:03 gandalfthegrey kernel: ext->ext_flags = 00000004
Jan 20 17:47:03 gandalfthegrey kernel: ext->addr.sa_data=ff ff ff ff ff ff
Jan 20 17:47:03 gandalfthegrey kernel: ext->key_len=0
Jan 20 17:47:03 gandalfthegrey kernel: Key=
Jan 20 17:47:03 gandalfthegrey kernel: ext->alg = 00000000
Jan 20 17:47:03 gandalfthegrey kernel: SET_ENCRYPT_KEY: alg=NONE key_idx=0
set_tx=33793 key_len=0 ,WPAIeLen=0, for ff:ff:ff:ff:ff:ff
Jan 20 17:47:03 gandalfthegrey kernel: Get SIOCSIWENCODEEXT
Jan 20 17:47:03 gandalfthegrey kernel: wrq->u.encoding.falgs = 00008402
Jan 20 17:47:03 gandalfthegrey kernel: ext->ext_flags = 00000004
Jan 20 17:47:03 gandalfthegrey kernel: ext->addr.sa_data=ff ff ff ff ff ff
Jan 20 17:47:03 gandalfthegrey kernel: ext->key_len=0
Jan 20 17:47:03 gandalfthegrey kernel: Key=
Jan 20 17:47:03 gandalfthegrey kernel: ext->alg = 00000000
Jan 20 17:47:03 gandalfthegrey kernel: SET_ENCRYPT_KEY: alg=NONE key_idx=1
set_tx=33794 key_len=0 ,WPAIeLen=0, for ff:ff:ff:ff:ff:ff
Jan 20 17:47:03 gandalfthegrey kernel: Get SIOCSIWENCODEEXT
Jan 20 17:47:03 gandalfthegrey kernel: wrq->u.encoding.falgs = 00008403
Jan 20 17:47:03 gandalfthegrey kernel: ext->ext_flags = 00000004
Jan 20 17:47:03 gandalfthegrey kernel: ext->addr.sa_data=ff ff ff ff ff ff
Jan 20 17:47:03 gandalfthegrey kernel: ext->key_len=0
Jan 20 17:47:03 gandalfthegrey kernel: Key=
Jan 20 17:47:03 gandalfthegrey kernel: ext->alg = 00000000
(Continue reading)

Marc MERLIN | 21 Jan 2010 19:12

Re: AP mode for zd1211 won't build on 2.6.31.6

On Thu, Jan 21, 2010 at 01:16:40AM -0800, yacc wrote:
> 
> Those messages below seem is generated due to control of NetworkManager.
> Maybe you can ensure it is indeed killed.
> --
> 
> Jan 20 17:47:03 gandalfthegrey kernel: Get SIOCSIWENCODEEXT
> Jan 20 17:47:03 gandalfthegrey kernel: wrq->u.encoding.falgs = 00008401
> Jan 20 17:47:03 gandalfthegrey kernel: ext->ext_flags = 00000004
> Jan 20 17:47:03 gandalfthegrey kernel: ext->addr.sa_data=ff ff ff ff ff ff
> Jan 20 17:47:03 gandalfthegrey kernel: ext->key_len=0
> Jan 20 17:47:03 gandalfthegrey kernel: Key=
> Jan 20 17:47:03 gandalfthegrey kernel: ext->alg = 00000000
> Jan 20 17:47:03 gandalfthegrey kernel: SET_ENCRYPT_KEY: alg=NONE key_idx=0

Thank you, I think I had misspelled networkmanager when I was doing the
killall -STOP and gathered the above log.

Marc
--

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
(Continue reading)


Gmane