Modify

Opened 5 years ago

Closed 4 years ago

#13551 closed defect (fixed)

bcm4313 with id 0x4313 not work

Reported by: joykicer@… Owned by: hauke
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Trunk
Keywords: Cc:

Description

I have several bcm96328 device, most of them use BCM4313KML1G as their wifi 802.11 b/g(signal antenna, not a b/g/n device) chip. The ADB Global P.DG A2100N and D-Link DSL-2640S have the same hardware. brcmsmac driver can't work, b43 is also not work.

The pci id shown as this in dmesg: pci 0000:01:00.0: [14e4:4313]

So I add this in kernel/drivers/bcma/host_pci.c to make chip can be probe:
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4313) },

Attachment is the dmesg output when use b43/brcmsmac driver. May this bcm4313 chip is a cut version? thanks!

Attachments (7)

b43.txt (9.1 KB) - added by anonymous 5 years ago.
brcmsmac.txt (9.3 KB) - added by joykicer@… 5 years ago.
wireless.config (2.6 KB) - added by joykicer@… 4 years ago.
wireless config
brcmsmac-14e4_4313.log (71.7 KB) - added by joykicer@… 4 years ago.
phy0.info (3.4 KB) - added by joykicer@… 4 years ago.
wlan0.info (150 bytes) - added by joykicer@… 4 years ago.
brcmsmac-14e4_4313-official_ucode.log (66.4 KB) - added by joykicer@… 4 years ago.

Download all attachments as: .zip

Change History (17)

Changed 5 years ago by anonymous

Changed 5 years ago by joykicer@…

comment:1 Changed 5 years ago by hauke

  • Owner changed from developers to hauke
  • Status changed from new to assigned

14e4:4313 should be a BCM4311 and not a BCM4313, but this looks like a BCM4313. Now Broadcom is reusing PCI ids nice.

Where do you have this card from? Is it from an access point or was it intended to be used in other devices like laptops? This card does not have a sprom on the card itself, you have to provide it with one on some other way.

This phy is not supported by the b43 driver, but it should by the brcmsmac driver.

You could try to remove the check in brcms_c_chipmatch_pci() in drivers/net/wireless/brcm80211/brcmsmac/main.c

comment:2 Changed 5 years ago by Zajec

[    0.316000] pci 0000:01:00.0: [14e4:4313] type 00 class 0x028000
(...)
[   10.616000] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
[   10.624000] bcma: bus0: Found chip with id 0x4313, rev 0x01 and package 0x08
[   10.628000] bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x24, class 0x0)
[   10.640000] bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x18, class 0x0)
[   10.648000] bcma: bus0: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x11, class 0x0)
[   10.656000] bcma: bus0: Using fallback SPROM failed (err -2)
[   10.660000] bcma: bus0: No SPROM available
[   10.676000] bcma: bus0: Bus registered
[   11.040000] b43-phy0: Broadcom 4313 WLAN found (core revision 24)
[   11.048000] b43-phy0 ERROR: FOUND UNSUPPORTED PHY (Analog 10, Type 8 (LCN), Revision 1)

Wow, I hoped @Hauke is wrong, but it really looks like a ~normal BCM4313 wit LCN-PHY using 14e4:4313. It seems Broadcom really re-sused this PCI ID :(

#define BCM4311_D11G_ID         0x4311          /* 4311 802.11b/g id */
#define BCM4311_D11DUAL_ID      0x4312          /* 4311 802.11a/b/g id */
#define BCM4311_D11A_ID         0x4313          /* 4311 802.11a id */

So you need to work on providing a SPROM fallback first, then modify brcmsmac.

comment:3 Changed 4 years ago by joykicer@…

Thanks for your reply! I'm from china, and all device's BCM4313 chip is directly welding on the board, not pci/pcie card. The router is produced by China telecom, maybe OEM by HuaWei/Zyxel/ZTE.

I found a list that different with others in 14e4:4313 part at here: http://www.hub.ru/wiki/Broadcom .

PCI ID	Device name	b43	b43-legacy	wl
(broadcom-sta)
14e4:4311	 103c:1374	 BCM4311 802.11b/g WLAN	 Yes	 Not tested	 Not tested
14e4:4311	 1468:0422	 BCM94311MCG wlan mini-PCI (rev 01)	 Yes	 Not tested	 Not tested
14e4:4312	 1028:0007	 BCM4312 802.11a/b/g (rev 01)	 Yes	 Not tested	 Not tested
14e4:4312	 103c:1370	 BCM4312 802.11a/b/g (rev 02)	 Partially	 Not tested	 Not tested
14e4:4313	 1028:0010	 BCM4313 802.11b/g/n (rev 01)	 No	 No	 Yes

There are 2 devices list links, I guess BCM4313 devices of "ESystem" list all use 14e4:4313 pci id(European standard?), "Devices" list use 14e4:4727(United States Standard?).
Device
ESystems

comment:4 Changed 4 years ago by hauke

brcmsmac should support this device. You have to provide a sprom in for the card in the arch code.
There are patches for that already:
http://patchwork.openwrt.org/patch/2553/
http://patchwork.openwrt.org/patch/2554/

Then you have to change brcms_c_chipmatch_pci() in drivers/net/wireless/brcm80211/brcmsmac/main.c to to allow this specific PCI id.

I asked Broadcom about the PCI ID problem.

comment:5 Changed 4 years ago by joykicer@…

According to your suggestion,I had make a firmware for this chip:

  1. enable bcma in kernel_menuconfig
  2. add noltari's sprom patch
  3. allow this PCI id in brcmsmac and bcma driver

After download the new firmware, it build a wireless interface, also the macaddress looks like right. But be not able to work:

[   26.356000] BUG: scheduling while atomic: hostapd/671/0x00000200
[   26.360000] Modules linked in: pppoe iptable_nat brcmsmac pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT slhc nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv4 nf_conntrack_irc nf_conntrack_ftp iptable_raw iptable_mangle iptable_filter ipt_REJECT ip_tables cordic compat brcmutil ip6t_REJECT ip6t_rt ip6t_hbh ip6t_mh ip6t_ipv6header ip6t_frag ip6t_eui64 ip6t_ah ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables nf_conntrack_ipv6 nf_conntrack nf_defrag_ipv6 ipv6 arc4 crypto_blkcipher gpio_keys_polled input_polldev sd_mod scsi_mod button_hotplug input_core usbcore nls_base usb_common crypto_hash
[   26.432000] CPU: 0 PID: 671 Comm: hostapd Tainted: G        W    3.10.12 #6
[   26.440000] Stack : 00000006 00000000 00000000 00000000 00000000 00000000 8035b3a6 0000003f
[   26.440000]    83b56670 8028bc00 8033b318 802e12db 0000029f 83238aec 83878b90 802e0000
[   26.440000]    802e0000 8002983c 00000003 800271c8 00000000 00000000 8028df88 831dfae4
[   26.440000]    001dfae4 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   26.440000]    00000000 00000000 00000000 00000000 00000000 00000000 00000000 831dfa70
[   26.440000]    ...
[   26.476000] Call Trace:
[   26.476000] [<8001f228>] show_stack+0x48/0x70
[   26.480000] [<8004b720>] __schedule_bug+0x44/0x64
[   26.488000] [<80017ec4>] __schedule+0x74/0x440
[   26.492000] [<8001774c>] schedule_hrtimeout_range_clock+0x168/0x1a4
[   26.496000] [<80032e60>] usleep_range+0x38/0x44
[   26.504000] [<801bcfcc>] bcma_pcie_mdio_set_phy+0x74/0x90
[   26.508000] [<801bd1f0>] bcma_pcie_mdio_read.isra.2+0x5c/0x128
[   26.512000] [<801bd354>] bcma_core_pci_power_save+0x64/0x90
[   26.520000] [<801bd504>] bcma_core_pci_up+0x28/0x4c
[   26.524000] [<8320c500>] brcms_c_up+0x1f8/0x3fc [brcmsmac]
[   26.532000] [<832022bc>] brcms_rfkill_set_hw_state+0x278/0x2ec [brcmsmac]
[   26.536000]
[   26.544000] BUG: scheduling while atomic: hostapd/671/0x00000200
[   26.552000] Modules linked in: pppoe iptable_nat brcmsmac pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT slhc nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv4 nf_conntrack_irc nf_conntrack_ftp iptable_raw iptable_mangle iptable_filter ipt_REJECT ip_tables cordic compat brcmutil ip6t_REJECT ip6t_rt ip6t_hbh ip6t_mh ip6t_ipv6header ip6t_frag ip6t_eui64 ip6t_ah ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables nf_conntrack_ipv6 nf_conntrack nf_defrag_ipv6 ipv6 arc4 crypto_blkcipher gpio_keys_polled input_polldev sd_mod scsi_mod button_hotplug input_core usbcore nls_base usb_common crypto_hash
[   26.620000] CPU: 0 PID: 671 Comm: hostapd Tainted: G        W    3.10.12 #6
[   26.628000] Stack : 00000006 00000000 00000000 00000000 00000000 00000000 8035b3a6 0000003f
[   26.628000]    83b56

Attachment is the files of dmesg and wireless. Thanks!

Changed 4 years ago by joykicer@…

wireless config

Changed 4 years ago by joykicer@…

Changed 4 years ago by joykicer@…

Changed 4 years ago by joykicer@…

comment:6 follow-up: Changed 4 years ago by hauke

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker (trunk)

Thanks for the log.

The "BUG: scheduling while atomic" are an other unrelated problem, I will try to fix it today.

The bigger problem I see is this:

brcmsmac bcma0:0: wl0: wlc_coreinit: ucode did not self-suspend!
brcmsmac bcma0:0: wl0: wlc_suspend_mac_and_wait: waited 83000 uS and MI_MACSSPNDD is still not on.
brcmsmac bcma0:0: wl0: psmdebug 0x00ff8706, phydebug 0x00000000, psm_brc 0x0000

The ucode on the wifi device did not start up correctly.

There are two firmwares (ucode) in OpenWrt for brcmsmac, could you please try the other.
By default OpenWrt uses one extracted from some proprietary Broadcom driver, this is when "Use firmware extracted from broadcom proprietary driver" in the brcmsmac menu is set. When this option is not set it uses the official firmware that is intended for this deriver, could you please try that.

Changed 4 years ago by joykicer@…

comment:7 in reply to: ↑ 6 Changed 4 years ago by joykicer@…

Replying to hauke:

Thanks for the log.

The "BUG: scheduling while atomic" are an other unrelated problem, I will try to fix it today.

The bigger problem I see is this:


Attachment is dmesg that use official ucode. The second issue looks okay now.

brcmsmac-14e4_4313-official_ucode.log

[   31.972000] Call Trace:
[   31.976000] [<8001f228>] show_stack+0x48/0x70
[   31.980000] [<8004b720>] __schedule_bug+0x44/0x64
[   31.984000] [<80017ec4>] __schedule+0x74/0x440
[   31.988000] [<8001774c>] schedule_hrtimeout_range_clock+0x168/0x1a4
[   31.996000] [<80032e60>] usleep_range+0x38/0x44
[   32.000000] [<801bd274>] bcma_pcie_mdio_read.isra.2+0xe0/0x128
[   32.008000] [<801bd504>] bcma_core_pci_up+0x28/0x4c
[   32.012000] [<8320c500>] brcms_c_up+0x1f8/0x3fc [brcmsmac]
[   32.016000] [<832022bc>] brcms_rfkill_set_hw_state+0x278/0x2ec [brcmsmac]
[   32.024000] 
[   32.248000] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: true (implement)
[   32.256000] brcmsmac bcma0:0: brcms_ops_config: change power-save mode: false (implement)
[   32.264000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   32.444000] brcmsmac bcma0:0: brcms_ops_bss_info_changed: Beacon enabled: true
[   32.452000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   32.468000] br-lan: port 2(wlan0) entered forwarding state
[   32.472000] br-lan: port 2(wlan0) entered forwarding state
[   32.484000] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: true (implement)
[   32.500000] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: true (implement)
[   32.516000] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: true (implement)
[   32.532000] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: true (implement)
[   34.476000] br-lan: port 2(wlan0) entered forwarding state

comment:8 Changed 4 years ago by joykicer@…

ps. When use disable "Use firmware extracted from broadcom proprietary driver" option firmware, WiFi Scan in luci web interface looks okay now! tks :)

comment:9 Changed 4 years ago by hauke

bcma claims the pci id 04313 with r38713.

comment:10 Changed 4 years ago by hauke

  • Resolution set to fixed
  • Status changed from assigned to closed

brcmsmac should now bind your device successfully and with the original firmware it should work.
There are still the bcm63xx sprom patches needed, but they are not directly related to this ticket.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.