2013-02-07 23:09:09

by Dag Wieers

[permalink] [raw]
Subject: BCM4321 (b43) on AppleTV (1st gen)

Hi,

For the OpenELEC project I am looking into getting better performance out
of the b43 driver on the AppleTV (1st gen) device . The website reports
the driver can do 802.11n (albeit on 2.4Ghz only), however using kernel
3.7.5 (and earlier) I cannot get more than 3 MB/sec out of it (usually
much less).

Here's the information of the device from the PCI bus:
----
02:00.0 Network controller: Broadcom Corporation BCM4321 802.11a/b/g/n (rev 05)
Subsystem: Apple Inc. Device 008c
Physical Slot: 1
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at 22100000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [58] Vendor Specific Information: Len=78 <?>
Capabilities: [e8] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [d0] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [13c] Virtual Channel
Capabilities: [160] Device Serial Number 4a-7a-12-ff-ff-27-00-23
Capabilities: [16c] Power Budgeting <?>
Kernel driver in use: b43-pci-bridge
Kernel modules: wl
----

And the output of iwconfig:
----
wlan0 IEEE 802.11bg ESSID:"zelfbestuur"
Mode:Managed Frequency:2.462 GHz Access Point: 74:44:01:8D:90:5E
Bit Rate=54 Mb/s Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=63/70 Signal level=-47 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:33 Invalid misc:1987 Missed beacon:0
----

The device's bit rate never exceeds 54 MB/s while other wireless devices
have iwconfig report e.g. IEEE 802.11abgn on the same netwerk:
----
wlan0 IEEE 802.11abgn ESSID:"zelfbestuur"
Mode:Managed Frequency:2.462 GHz Access Point: 74:44:01:8D:90:5E
Bit Rate=130 Mb/s Tx-Power=15 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=55/70 Signal level=-55 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:4867638 Invalid misc:22386 Missed beacon:0

03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)
Subsystem: Intel Corporation Centrino Advanced-N 6205 AGN
Flags: bus master, fast devsel, latency 0, IRQ 45
Memory at f1400000 (64-bit, non-prefetchable) [size=8K]
Capabilities: [c8] Power Management version 3
Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [e0] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Device Serial Number 8c-70-5a-ff-ff-c3-f2-64
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
----

Is there anything I can do to troubleshoot ? Are there any module
parameters that could help ?

I have to mention that the device's interrupt is shared with the nvidia
driver.
----
16: 6374726 IO-APIC-fasteoi b43, nvidia
----

And that the kernel has been compiled using:
----
CONFIG_B43=m
CONFIG_B43_SSB=y
CONFIG_B43_PCI_AUTOSELECT=y
CONFIG_B43_PCICORE_AUTOSELECT=y
CONFIG_B43_PIO=y
CONFIG_B43_PHY_N=y
CONFIG_B43_PHY_LP=y
CONFIG_B43_PHY_HT=y
CONFIG_B43_LEDS=y
CONFIG_B43_DEBUG=y
----

If the above can be trimmed down for this type of device I'd like to hear
that as well (e.g. I am not sure if we need PIO or LEDS in this case).

PS I am also interested in any power management capabilities the
device has and that we could enable when the device is idle, since the
system lacks proper power management capabilities by itself
(suspend/hibernate) and seems to have a limited ACPI implementation.

Thanks in advance for any insights,
--
-- dag wieers, [email protected], http://dag.wieers.com/
-- dagit linux solutions, [email protected], http://dagit.net/

[Any errors in spelling, tact or fact are transmission errors]


2013-02-08 01:06:52

by Dag Wieers

[permalink] [raw]
Subject: Re: BCM4321 (b43) on AppleTV (1st gen)

On Fri, 8 Feb 2013, Dag Wieers wrote:

> For the OpenELEC project I am looking into getting better performance out of
> the b43 driver on the AppleTV (1st gen) device . The website reports the
> driver can do 802.11n (albeit on 2.4Ghz only), however using kernel 3.7.5
> (and earlier) I cannot get more than 3 MB/sec out of it (usually much less).

I wanted to add the kernel boot messages:

----
root ~ # dmesg | grep b43
[ 2.902696] b43-phy0: Broadcom 4321 WLAN found (core revision 12)
[ 2.976740] b43-phy0: Found PHY: Analog 5, Type 4 (N), Revision 2
[ 2.976772] b43-phy0 debug: Found Radio: Manuf 0x17F, Version 0x2055, Revision 4
[ 3.038609] Registered led device: b43-phy0::tx
[ 3.040268] Registered led device: b43-phy0::rx
[ 3.040433] Registered led device: b43-phy0::radio
[ 4.736728] b43-phy0: Loading firmware version 508.1084 (2009-01-14 01:32:01)
[ 4.807784] b43-phy0 debug: Chip initialized
[ 4.808074] b43-phy0 debug: 64-bit DMA initialized
[ 4.808142] b43-phy0 debug: QoS enabled
[ 4.833456] b43-phy0 debug: Wireless interface started
[ 4.833526] b43-phy0 debug: Adding Interface type 2
[ 7.837659] b43-phy0 debug: Using hardware based encryption for keyidx: 0, mac: 74:44:01:8d:90:5e
[ 7.838009] b43-phy0 debug: Using hardware based encryption for keyidx: 1, mac: ff:ff:ff:ff:ff:ff
----

Kind regards,
--
-- dag wieers, [email protected], http://dag.wieers.com/
-- dagit linux solutions, [email protected], http://dagit.net/

[Any errors in spelling, tact or fact are transmission errors]

2013-02-08 16:24:13

by Larry Finger

[permalink] [raw]
Subject: Re: BCM4321 (b43) on AppleTV (1st gen)

On 02/07/2013 05:01 PM, Dag Wieers wrote:
> And that the kernel has been compiled using:
> ----
> CONFIG_B43=m
> CONFIG_B43_SSB=y
> CONFIG_B43_PCI_AUTOSELECT=y
> CONFIG_B43_PCICORE_AUTOSELECT=y
> CONFIG_B43_PIO=y
> CONFIG_B43_PHY_N=y
> CONFIG_B43_PHY_LP=y
> CONFIG_B43_PHY_HT=y
> CONFIG_B43_LEDS=y
> CONFIG_B43_DEBUG=y
> ----
>
> If the above can be trimmed down for this type of device I'd like to hear that
> as well (e.g. I am not sure if we need PIO or LEDS in this case).
>
> PS I am also interested in any power management capabilities the device has and
> that we could enable when the device is idle, since the system lacks proper
> power management capabilities by itself (suspend/hibernate) and seems to have a
> limited ACPI implementation.

As no one else seems to be responding, I'll try.

In the configuration, you certainly do not need PIO or LEDS. For that particular
device, you also do not need PHY_LP, as that is strictly an 802.11g PHY. As to
power-management capabilities, there are no configurable parameters.

What throughput do you get with Broadcom-wl with your setup? That will give you
an idea of the potential performance of the device. As the equivalent of wl was
used for the reverse engineering, that will certainly be the upper limit of what
b43 can do. Only if the RE was perfect could we match that result.

Larry



2013-02-08 16:46:56

by Jonas Gorski

[permalink] [raw]
Subject: Re: BCM4321 (b43) on AppleTV (1st gen)

On 8 February 2013 00:01, Dag Wieers <[email protected]> wrote:
> Hi,
>
> For the OpenELEC project I am looking into getting better performance out of
> the b43 driver on the AppleTV (1st gen) device . The website reports the
> driver can do 802.11n (albeit on 2.4Ghz only), however using kernel 3.7.5
> (and earlier) I cannot get more than 3 MB/sec out of it (usually much less).

b43 currently cannot do 802.11n, it is limited 802.11g speed - it
certainly can use 802.11n capable cards, but it can only operate them
at 802.11g mode, and there 3 MB/sec seems quite good.

Regards
Jonas

2013-04-03 10:35:09

by Rafał Miłecki

[permalink] [raw]
Subject: Re: BCM4321 (b43) on AppleTV (1st gen)

2013/4/3 Dag Wieers <[email protected]>:
> On Wed, 3 Apr 2013, Rafał Miłecki wrote:
>
>> It's terribly late reply, but only recently I've time to plug in my
>> old BCM4321/BCM4322 cards and test them. There were few regressions
>> affecting BCM4322, but nothing BCM4321 related (there are many
>> differences between them).
>>
>> In my env I can't get more than 22Mb/s using my BCM4322. It's
>> 2,75MB/s, so your 3MB/s is even better result than mine. The problem
>> is that b43 doesn't support 802.11n features, so it can't work any
>> faster. Values around 2-3MB/s is maximum you can get from 802.11g.
>
>
> I can see from the access point that it often indicates the system to be
> connected at 54Mbps, but I never seem to get that throughput. However the
> numbers I indicate are SFTP transfers with some overhead, but also buffering
> (so it usually starts off quite fast and then the number drops rapidly). Not
> very scientific so it might as well be 2.75MB/s :)

54Mb/s is 6,75MB/s, but you'll never reach that speed on 802.11g. No
matter what card, what driver :) 3MB/s is probably sth around the
maximum speed *in practice*. I was doing my tests with "iperf".


>> I plan to add support for new devices, then 5GHz, then maybe I'll take
>> a look at 802.11n standard. So unfortunately there's a long way before
>> we can support higher speeds :(
>
>
> If it helps, I can offer two of this mini PCI adapters to any developer
> interested in improving the support of the BCM4321.

I've tons of N-PHY (and not only) devices around, so don't really need
any donate of that devices. I just have to find time for this.

--
Rafał

2013-04-03 09:26:16

by Dag Wieers

[permalink] [raw]
Subject: Re: BCM4321 (b43) on AppleTV (1st gen)

On Wed, 3 Apr 2013, Rafa? Mi?ecki wrote:

> It's terribly late reply, but only recently I've time to plug in my
> old BCM4321/BCM4322 cards and test them. There were few regressions
> affecting BCM4322, but nothing BCM4321 related (there are many
> differences between them).
>
> In my env I can't get more than 22Mb/s using my BCM4322. It's
> 2,75MB/s, so your 3MB/s is even better result than mine. The problem
> is that b43 doesn't support 802.11n features, so it can't work any
> faster. Values around 2-3MB/s is maximum you can get from 802.11g.

I can see from the access point that it often indicates the system to be
connected at 54Mbps, but I never seem to get that throughput. However the
numbers I indicate are SFTP transfers with some overhead, but also
buffering (so it usually starts off quite fast and then the number drops
rapidly). Not very scientific so it might as well be 2.75MB/s :)


> I plan to add support for new devices, then 5GHz, then maybe I'll take
> a look at 802.11n standard. So unfortunately there's a long way before
> we can support higher speeds :(

If it helps, I can offer two of this mini PCI adapters to any developer
interested in improving the support of the BCM4321.


> P.S.
> I suggest Cc-ing b43 mailing list in the future ;)

Done :)

Thanks for the feedback,
--
-- dag wieers, [email protected], http://dag.wieers.com/
-- dagit linux solutions, [email protected], http://dagit.net/

[Any errors in spelling, tact or fact are transmission errors]