# Macbook air and wifi card!



## enryold (Dec 20, 2009)

Hello everybody, I installed FreeBSD 8.0 a few days ago on the MacBook Air.
The network card is a Broadcom wifi 432AGN (BCM4321KFBG), and so I tried using ndis with Windows driver (bcmwl5)

The problem is that the network adapter does not seem to work, or rather, fails to do the scan.


Here is my ifconfig:


```
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
	inet6 ::1 prefixlen 128 
	inet 127.0.0.1 netmask 0xff000000 
ndis0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether 00:1e:c2:b7:5e:8f
	media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
	status: associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:1e:c2:b7:5e:8f
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 1 (2412 Mhz 11g)
	country US authmode OPEN privacy OFF txpower 0 bmiss 7 mcastrate 6
	mgmtrate 6 scanvalid 60 protmode CTS bintval 0
```


Tnks.


----------



## richardpl (Dec 20, 2009)

You need to provide more details.
What really doesnt work?

What is output of:
`# ifconfig wlan0 list scan`?


----------



## enryold (Dec 21, 2009)

nothing!


----------



## richardpl (Dec 21, 2009)

Try `# sysctl debug.ndis=1`
and post output.
Also post output of ndis0 from dmesg(8)


----------



## enryold (Dec 22, 2009)

# sysctl debug.ndis=1

# ifconfig wlan0 up

```
ndis_scan_result: 0 results
```

# ifconfig wlan0 down


```
ndis_get_bssid_list: failed to read
```



Also, it's my dmesg:


```
ndis0: <Broadcom 802.11n Network Adapter> mem 0x90300000-0x90303fff irq 16 at device 0.0 on pci2
ndis0: [ITHREAD]
ndis0: NDIS API version: 5.1
wlan0: Ethernet address: 00:1e:c2:b7:5e:8f
```


----------



## richardpl (Dec 22, 2009)

Is there hardware RF switch?


----------



## enryold (Dec 23, 2009)

Mmmm is possible that use the same adpter to "run" the bluetooth.


Here http://www.ifixit.com/Teardown/MacBook-Air/598/2 on step 15 i've found this:


```
Step 15

    * The RF module, in all its blue glory. We spliced together two photos, so this image shows the front and back of the PCB.

    * The Broadcom 802.11 chip had the markings BCM4321KFBG.

    * We removed the EMI shield covering the RF chips. We uncovered a Skyworks SKY652225-11 R8, a Broadcom BCM2G55KF86, a Broadcom BCM2046,
 and an SST 39VF200A. We also found eight of Anaren's 1mm square baluns interfaced between the Broadcom and Skyworks chips, presumably running 
at 2.4GHz and 5GHz.

    * And the backside had another chip marked with BCM94321COEX2.
```


----------



## blstuart (Dec 23, 2009)

I've recently gotten a machine with a similar chip (the 4322) and seen much the same behavior.  In particular, ndis0 reporting associated, but wlan0 reporting no carrier is a sinkingly familiar sight.  Some of the things that have seemed to work for me at times:

- Tell it what channels to use: "ifconfig wlan0 chanlist 11" for example.  As I understand it, the NDIS interface doesn't actually respect that list, but I've seen it work after trying to set it.
- Go ahead and set your SSID (and WEP key if you're using WEP) even if you don't see your AP in the scan.  I've seen it associate and show good scans after doing so.
- Probably less apropos for a MacBook Air, but I've found that my hardware seems to have the kind of nonsense that makes secret incantations necessary.  In particular, there doesn't seem to be a hardware RF switch, but there does seem to be some kind of "soft" switch that gets remembered between reboots.  So if I don't have the radio turned on the last time I shut Wondows down, I can't seem to turn it on from FreeBSD.  My best guess is that it's something in the lake of fire known as ACPI.

Until Broadcom wakes up and joins the civilized world, I'll say good luck, and if you find the right kind of chicken to sacrifice to get it working, let us know.


----------

