# Realtek RTL8111/8168B Wireless Card not Setting up Properly



## Anachrome (Mar 16, 2012)

So, I recently got a new laptop, and have been trying to install FreeBSD on it (this is the first time I've tried installing FreeBSD on anything).  I need to set wireless now, and according to the manual, I needed to add the line

```
if_re_load="YES"
```
to my /boot/loader.conf file.

Using ifconfig, the computer seems to know that the device exists, as regardless of whether or not loader.conf exists with that line, ifconfig displays the following:

```
re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 2c:41:38:5c:16:c6
        nd6 options=29<PERFORMED,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (none)
        status: no carrier
```
(anything which seems like a typo probably is: I'm using a different computer right now and am not quite sure how to copy-paste the output from my laptop to here).

Now, according to the manual, [cmd=]ifconfig wlan0 create wlandev re0[/cmd] is the next step in setting things up.  However, regardless of whether or not loader.conf exists with the specified line, the above still give an error:

```
re0: wlan_clone_create: reject, not an 802.11 device
ifconfig: SIOCIFCREATE2: Device not configured
```
A quick check shows that wlandev is a parameter for ifconfig specific to 802.11, and that my RealTek card is compliant with IEEE 802.3. However, here I'm at a loss for how to get wireless working, so any pointers would be really appreciated.


----------



## wblock@ (Mar 17, 2012)

re0 is a wired Ethernet interface, hence the "not an 802.11 device".

If the wireless card is PCIe, then it may show up in this output:
`% pciconf -lv | grep -B3 network`

However, some cards, even internal ones in a PCIe slot, are USB.  Those would appear in the output of
`% usbconfig`

Note: it's always a good idea to identify the make and model of computer.  There might be common configurations or common problems, but there's no point to keeping it secret.


----------



## Anachrome (Mar 17, 2012)

Well, thank you for that, as it does look like I've done some learning:
using pciconf, I get these two entries:

```
re0@pci0:1:0:0: class=0x020000 card=0x1805103c chip=0x816810ec rev=0x06 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168B PCI Express Gigabit Ethernet controller'
    class      = network
```


```
none1@pci0:2:0:0:       class=0x028000 card=0x1629103c chip=0x817610ec rev=0x01 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8188CE 802.11b/g/n WiFi Adapter'
    class      = network
```
The first entry is the one I expected, but the second seems like it could be what I'm looking for.  Would I set it up with 
	
	



```
if_re_load="YES"
```
 and 
	
	



```
ifconfig wlan0 create wlandev none1
```
 or do I need to find the proper driver for RTL8188?  (This I am going to do anyways, I just want to make sure I'm not going to bork my computer before I actually try anything yet.)
And thank you for the help, of course.


----------



## wblock@ (Mar 17, 2012)

The if_re driver (re(4)) is built into the GENERIC kernel, and doesn't need to be loaded again.  But it's for the wired interface anyway.

The none1 entry just means that no driver attached to the hardware.

AFAIK there is no native driver for the Realtek 8188 yet.  So see ndisgen(8) to try the Windows driver.


----------



## Anachrome (Mar 17, 2012)

Thanks.  Looking at this this, I think that NDIS might not work, but I'll try anyways.

And, question:  on the realtek website, there do appear to be drivers for Linux.  I won't pretend to know anything about the internals of Linux or FreeBSD, but how difficult would it be to port over a driver for the former to the latter?  I mean, I have zero experience in driver programming, but perhaps it'd be something worth trying?


----------



## wblock@ (Mar 17, 2012)

FreeBSD and Linux kernels are different, but there are some drivers that have been ported or rewritten by looking at the Linux versions.  Manufacturer drivers may not be all that helpful, sometimes consisting of binary blobs rather than source.  The freebsd-wireless mailing list is the place to start.


----------



## Anachrome (Mar 18, 2012)

Ah, I see.  Well, I don't want to sound like I'm giving up here, but I don't really have a lot of free time to work on this, so I'll probably just wait until I have a machine with FreeBSD-compatible wireless card to used.
Thanks for the help, though.


----------



## ecd (Apr 6, 2012)

Anachrome said:
			
		

> Ah, I see.  Well, I don't want to sound like I'm giving up here, but I don't really have a lot of free time to work on this, so I'll probably just wait until I have a machine with FreeBSD-compatible wireless card to used.
> Thanks for the help, though.



I'm in the same position as you. I have a RTL8188CE on my netbook (Toshiba NB505). I had to resort to installing linux on it. I've found that the distro I've chosen is not to my liking at all (Fedora Core). I may switch back to using FreeBSD on it, giving up wireless.

I did spot this recent posting from the -current mailing list though:



			
				Beach Geek labeachgeek at gmail.com  said:
			
		

> PS. A side note, we got a native driver working for the RTL8188CE wireless
> card, but it's still really buggy, but it's a start.


----------

