Subject: kern/36821: zyd(4) rejects initial configuration attempt
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Andreas Gustafsson <gson@gson.org>
List: netbsd-bugs
Date: 08/22/2007 18:05:00
>Number:         36821
>Category:       kern
>Synopsis:       zyd(4) rejects initial configuration attempt
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 22 18:05:00 +0000 2007
>Originator:     Andreas Gustafsson
>Release:        NetBSD 4.99.26 (-current source from Aug 6, 2007)
>Organization:
>Environment:
System: NetBSD guam.gson.org 4.99.26 NetBSD 4.99.26 (GUAM) #0: Wed Aug 22 17:56:11 EEST 2007 gson@guru.araneus.fi:/usr/src/sys/arch/i386/compile/GUAM i386
Architecture: i386
Machine: i386
>Description:

I tried plugging an A-Link WL54MB USB WLAN adapter into a machine
running NetBSD-current.  It was recognized as:

  zyd0 at uhub0 port 2
  zyd0: ZyDAS USB2.0 WLAN, rev 2.00/48.10, addr 2

However, when I tried configuring it, I got the error message
"ifconfig: SIOCS80211NWKEY: Inappropriate ioctl for device".
For example, using a sample configuration from the zyd(4) man
page failed like this:

  # ifconfig zyd0 inet 192.168.1.1 netmask 255.255.255.0 nwkey 0x1deadbeef1 chan 11
  ifconfig: SIOCS80211NWKEY: Inappropriate ioctl for device

I then tried

  # ifconfig zyd0
  zyd0: flags=8802<BROADCAST,SIMPLEX,MULTICAST>

and

  # ifconfig zyd0 up

At that point, the following additional messages were displayed on the
console (note that in the case of other WLAN adapters, the
corresponding messages are displayed at the time of insertion, 
not at the time of the first successful ifconfig):

  zyd0: HMAC ZD1211B, FW 47.25, RF AL2230, PA 0, address 00:02:72:5d:7f:9f
  zyd0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
  zyd0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

Finally, I retried the initial ifconfig command, and it now succeeded:

  # ifconfig zyd0 inet 192.168.1.1 netmask 255.255.255.0 nwkey 0x1deadbeef1 chan 11
  # ifconfig zyd0
  zyd0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	  ssid "" nwkey 0x1deadbeef1
	  powersave off
	  chan 11
	  address: 00:02:72:5d:7f:9f
	  media: IEEE802.11 autoselect (DS1)
	  status: no network
	  inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
	  inet6 fe80::202:72ff:fe5d:7f9f%zyd0 prefixlen 64 scopeid 0x3

(After this, the interface still didn't work, but that's outside the
scope of this PR, which is specifically about the "Inappropriate ioctl
for device" error).

>How-To-Repeat:

See above.

>Fix:

Please.