# SMC USB wlan trouble



## baronobeefdip (Mar 24, 2011)

I have an SMC USB wlan adapter here. And I followed what was mentioned in this thread.

http://forums.freebsd.org/showthread.php?t=14844

But it's from version 7, I have version 8. Is there some sort of difference in configuring the wlan adapter between the two? The wlan adapter is connected into a USB port in the back of the tower and uses the zyd1211 chipset. 

What got me confused is the 1.2 step in the thread. It says to edit the file 
titled "loader.conf" but theres two of them.
/boot/loader.conf
and
/boot/defaults/loader.conf

Which one do I edit?

I also noticed that in the loader.conf in the defaults directory everything is arranged in sections like networking, kernel, etc. Which section do I add the entries under to the file mentioned in the thread? Because the handbook doesn't say in the wireless networking section where.

Aside from all of what was stated above, There's more issues but I would like to get passed these issues first.


----------



## DutchDaemon (Mar 24, 2011)

*Never* edit anything in /defaults/ directories like /etc/defaults/ and /boot/defaults/. It basically works like this:

/boot/defaults/loader.conf is *always* loaded, and /boot/loader.conf contains the *additions/overrides*.
/etc/defaults/rc.conf is *always* loaded, and /etc/rc.conf contains the *additions/overrides*.

If /boot/defaults/loader.conf contains something like 
	
	



```
something_load="NO"
```
 and /boot/loader.conf contains 
	
	



```
something_load="YES"
```
 the latter setting will win.

Etcetera.


----------



## baronobeefdip (Mar 24, 2011)

And is there a difference between the way you install the Zydas wireless device in version 7 (like the thread poster did) and version 8 (which is what I have)?

And the thread poster's guide said to edit the loader.conf file in the defaults directory, And your telling me not to. I'm confused as to why he would say that but I believe you. So I'm resuming my experimenting and if I come to the error I encountered earlier I'll post it.


----------



## baronobeefdip (Mar 25, 2011)

Okay I have added all the stuff to the /boot/loader.conf and the /etc/rc.conf files and I'm already starting to get problems.

I added these entries to the /boot/loader.conf

```
if_zyd_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
wlan_xauth_load="YES"
wlan_acl_load="YES"
```

Then I added these entries to the /etc/rc.conf file

```
wlans_zyd0="zyd0"
ifconfig_zyd0="DHCP"
```

Then I used the command 
[cmd=]# ifconfig wlan0 create wlandev zyd0[/cmd]

And what I got was the prompt

```
ifconfig: SIOCIFCREATE2: Device not configured
```

I added all the entries the handbook and the guide said and this is what I get. What did I do wrong here?

Oh and heres a picture of my device if it helps


----------



## wblock@ (Mar 25, 2011)

baronobeefdip said:
			
		

> And the thread poster's guide said to edit the loader.conf file in the defaults directory, And your telling me not to. I'm confused as to why he would say that but I believe you.



It's a mistake.  The default values should not be changed, that's why they're defaults.


----------



## wblock@ (Mar 25, 2011)

baronobeefdip said:
			
		

> I added these entries to the /boot/loader.conf



When using a GENERIC kernel, all the necessary stuff is already loaded.



> Then I added these entries to the /etc/rc.conf file
> 
> ```
> wlans_zyd0="zyd0"
> ...



Follow the Handbook.  It's more current.  The section called "Selecting an Access Point" shows the right way to do this.



> I added all the entries the handbook and the guide said and this is what I get. What did I do wrong here?



Following both the Handbook and an outdated guide that doesn't apply to your version of FreeBSD will do that.  Just follow the Handbook.

Actually, I've thought there should be a short summary at the start of that:


```
wlans_zyd0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
```

And then the corresponding entry in /etc/wpa_supplicant.conf:

```
network={
        ssid="myssid"
        psk="mypresharedkeypassphrase"
}
```


----------



## baronobeefdip (Mar 25, 2011)

My network uses WEP encryption and yours is using WPA, Is there a difference in how I should configure it and what you just did?

Thanks for the help everyone.


----------



## wblock@ (Mar 25, 2011)

You can run WEP with the right entries in wpa_supplicant.conf.  I've never tried it, though.


----------



## jintxo (Apr 2, 2011)

Hi baronobeefdip.

check and see if your device is "vendor 0x083a product 0x4505" if it is, then check this thread:

http://forums.freebsd.org/showthread.php?t=13906

I got mine to work after some fiddling and I posted how there, maybe yours is the same (by the picture it sure looks like it).

Cedric


----------



## baronobeefdip (Apr 8, 2011)

Alright this is what I added to the configuration files now.

/boot/loader.conf

```
if_zyd_load="YES"
```

/etc/rc.conf

```
wlans_zyd0="wlan0"
ifconfig_wlan0="DHCP"
```

I also entered the command

```
# ifconfig wlan0 create wlandev zyd0
```

I still get the "Device is not configured" message. Could the difficulties be because I need to configure BSD to recognize usb devices, Since the wlan adapter is connected through usb. Most wlan configuration examples for FreeBSD are onboard interfaces (Laptops and PCI cards).

But then I stumbled onto this FreeBSD wiki article saying that Wireless USB is not supported yet, is this true?
http://wiki.freebsd.org/USB


----------



## wblock@ (Apr 8, 2011)

Back up and make sure each step works.  Do you get a zyd0 device created when the USB adapter is connected?

"Wireless USB" is USB over wireless (like a USB hard drive only without a USB cable).

Wireless networking with a USB network adapter works.


----------



## baronobeefdip (Apr 9, 2011)

I just thought about something, Could it be because I compiled the kernel wrong during installation? I chose all three options (Developer, Kern-Developer and User). It was probably a very dumb decision to do that but which selection (or combination of selection) is appropriate?


----------



## wblock@ (Apr 9, 2011)

That's not compiling the kernel, it's just a "distribution", or what gets installed.  Developer includes source.

Again: do you get a zyd0 device created when the USB adapter is connected?
`% ifconfig`


----------



## baronobeefdip (Apr 19, 2011)

Well maybe it's because it is that I have dated hardware. (I'm doing this on an old machine). I now did this to the configuration files.

/boot/loader.conf

```
if_ath_load="YES
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```
I'm not sure if the last three were necessary but my AP uses WEP encryption.

I added nothing in the /etc/rc.conf. I rebooted and executed these commands.

```
#ifconfig (To check if I had the ath0, or is it wlan0 you should look for?)
#ifconfig wlan0 create wlandev ath0
```
then I get this

```
# ifconfig: SIOCIFCREATE2: Device not configured
```
What does the message above mean? What can I do to fix it?

I'm also trying to configure a machine that uses atheros chipset. I'll make a post about that soon.


----------



## wblock@ (Apr 19, 2011)

Post #11.  Post #13.


----------



## baronobeefdip (Apr 19, 2011)

Then what does 
	
	



```
SIOCIFCREATE2: Device not configured
```
 mean?


----------



## wblock@ (Apr 19, 2011)

The question asked twice already and still not answered is probably the answer to your new question.


----------



## baronobeefdip (Apr 20, 2011)

Well, how long does an average scan take? So I can know if it's working when everything goes well up to that point. I have just found out that I have been using 8.1 instead of 8.2, I'm sorry for all the trouble everyone, maybe this was the problem.


----------



## wblock@ (Apr 20, 2011)

Just to review, the way this is supposed to work is you supply information and ask questions.  Given that information, volunteers try to help.  When you repeatedly refuse to give information, it starts to look fishy.

Maybe this is just a misunderstanding, so I'm going to ask it one last time:
When you plug in the USB stick shown in post #4, does a zyd0 device appear in the output of
`% ifconfig`


----------



## baronobeefdip (Apr 20, 2011)

No I don't see a zyd0 in the ifconfig results. All I see is a lo0 entry.


----------



## wblock@ (Apr 20, 2011)

Thanks.  So now we know that you have a very basic problem.  But you've broken the configuration in the meantime.  Post #14 shows you loading the ath(4) module.  Go back and edit that to match the second part of post #6.  Then see if you get a zyd0 shown in ifconfig.


----------



## baronobeefdip (Apr 20, 2011)

Alright so it's like this.
/boot/loader.conf

```
if_zyd_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```

and the rc.conf

```
wlans_zyd0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
```


----------



## wblock@ (Apr 20, 2011)

Do you now have zyd0?


----------



## baronobeefdip (Apr 20, 2011)

Nope, Unless it's case sensitive.
Or if this stuff applies to version 8.2, I am using 8.1.


----------



## wblock@ (Apr 20, 2011)

baronobeefdip said:
			
		

> Nope, Unless it's case sensitive.



It's always lower case, but I'm not sure why you ask.



> Or if this stuff applies to version 8.2, I am using 8.1.



There are a lot of wireless improvements in 8.2.  Don't know when the working version of zyd was committed.  It would help to identify the device vendor and product IDs with usbconfig(8):
`# usbconfig`
That will show all the device IDs.  Replace the 2.3 in the following command with the ones for the USB stick:
`# usbconfig -d ugen2.3 dump_device_desc`


----------



## baronobeefdip (Apr 20, 2011)

Yeah I'll do that.

I'm also configuring another box that has an Atheros WLAN device (ath9k). It'd be nice to have some help with that one too. I also think it would be easier since Atheros Devices are well known for working in FreeBSD, maybe another thread when I get this configuration out of the way.


----------



## baronobeefdip (Apr 20, 2011)

Okay I don't have the ability to copy and paste but I hope what I wrote down is enough.

```
iManufacturer = 0x0010 <SMC>
idVendor = 0x085a
idProduct = 0x4810
iProduct = 0x000 <USB 2.0 WLAN>
```


----------



## baronobeefdip (Apr 20, 2011)

One quick question about my Atheros box I hope you don't mind.

Assuming that everything has been successfully configured, how long does it take for it to scan for networks? After I issue this command.

```
#ifconfig wlan0 up scan
```
Just wondering so I can know when to start assuming that it didn't work.


----------



## wblock@ (Apr 20, 2011)

baronobeefdip said:
			
		

> Okay I don't have the ability to copy and paste but I hope what i wrote down is enough.
> 
> ```
> iManufacturer = 0x0010 <SMC>
> ...



Those IDs are not currently recognized by the zyd(4) driver.  The vendor ID is already present as "PORTGEAR" in usbdevs, and the product ID just isn't there.  Patching in the right IDs in the driver should not be too hard, it's adding them correctly to usbdevs that I don't see.  Please enter a PR.  Include the information above and the model number (SMCWUSB-G) of the adapter.


----------



## wblock@ (Apr 20, 2011)

baronobeefdip said:
			
		

> One quick question about my Atheros box i hope you don't mind.
> 
> Assuming that everything has been successfully configured, how long does it take for it to scan for networks? After I issue this command.
> 
> ...



After correct configuration, a scan only takes a few seconds, but please start a new thread for different hardware.


----------

