From nobody@FreeBSD.org Sat Nov 28 13:39:34 2009 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88FD7106566C for ; Sat, 28 Nov 2009 13:39:34 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 77E538FC08 for ; Sat, 28 Nov 2009 13:39:34 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nASDdXLv083889 for ; Sat, 28 Nov 2009 13:39:33 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id nASDdXo5083888; Sat, 28 Nov 2009 13:39:33 GMT (envelope-from nobody) Message-Id: <200911281339.nASDdXo5083888@www.freebsd.org> Date: Sat, 28 Nov 2009 13:39:33 GMT From: Benjamin Kormann To: freebsd-gnats-submit@FreeBSD.org Subject: [bce] The two NetXtreme II BCM5709S NICs on our HP Bl460c G1 Blade can't be accessed on FreeBSD 7.2 and 8 X-Send-Pr-Version: www-3.1 X-GNATS-Notify: >Number: 140970 >Category: kern >Synopsis: [bce] The two NetXtreme II BCM5709S NICs on our HP Bl460c G1 Blade can't be accessed on FreeBSD 7.2 and 8 [regression] >Confidential: no >Severity: serious >Priority: medium >Responsible: yongari >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Nov 28 13:40:02 UTC 2009 >Closed-Date: Thu Apr 15 20:42:51 UTC 2010 >Last-Modified: Thu Apr 15 20:42:51 UTC 2010 >Originator: Benjamin Kormann >Release: 7.2 and 8 >Organization: Technische Universität München (Technical University of Munich) Germany >Environment: >Description: I have installed a FreeBSD 7.2 (and also FreeBSD 8) on our HP Bl460c G1 Blade system with two Xeon processors and 32 GB RAM. This blade comes with two embedded network controllers and in our case an additionally attached Mezzanine card for two more network controllers. Right after the first boot (GENERIC KERNEL) only the embedded network interfaces get properly configured for use. The additional Broadcom NetXtreme II family NICs of the Mezzanine card (HP NC382m DP 1GbE Multifunction BL-c Adapter) are correctly identified by the bce-driver, but lead to the following kernel debug output: No PHY found on child MII bus So the NICs are bound to a logical network card identifier like bce1, but they never become ready to be configured via ifconfig. $ dmesg | grep bce1 bce1: mem 0xfc000000-0xfdffffff irq 18 at device 0.0 on pci16 bce1: /usr/src/sys/dev/bce/if_bce.c(1097): No PHY found on child MII bus! device_attach: bce1 attach returned 6 partial output of: $ pciconf -lv pcib4@pci0:6:0:0: class=0x060400 card=0x00000000 chip=0x01031166 rev=0xc3 hdr=0x01 vendor = 'ServerWorks (Was: Reliance Computer Corp)' device = 'Broadcom dual gigabit, pci bridge (BCM5715)' class = bridge subclass = PCI-PCI bce0@pci0:7:0:0: class=0x020000 card=0x703b103c chip=0x16ac14e4 rev=0x12 hdr=0x00 vendor = 'Broadcom Corporation' device = 'NetXtreme II BCM5708S Gigabit Ethernet' class = network subclass = ethernet pcib8@pci0:10:0:0: class=0x060400 card=0x00000000 chip=0x01031166 rev=0xb4 hdr=0x01 vendor = 'ServerWorks (Was: Reliance Computer Corp)' device = 'Broadcom dual gigabit, pci bridge (BCM5715)' class = bridge subclass = PCI-PCI pcib9@pci0:11:4:0: class=0x060400 card=0x00000000 chip=0x01041166 rev=0xb2 hdr=0x01 vendor = 'ServerWorks (Was: Reliance Computer Corp)' device = 'HT1000 PCI/PCI-X bridge' class = bridge subclass = PCI-PCI bce1@pci0:16:0:0: class=0x020000 card=0x171d103c chip=0x163a14e4 rev=0x20 hdr=0x00 vendor = 'Broadcom Corporation' device = 'NetXtreme II BCM5709S Gigabit Ethernet' class = network subclass = ethernet bce2@pci0:16:0:1: class=0x020000 card=0x171d103c chip=0x163a14e4 rev=0x20 hdr=0x00 vendor = 'Broadcom Corporation' device = 'NetXtreme II BCM5709S Gigabit Ethernet' class = network subclass = ethernet pcib15@pci0:2:0:0: class=0x060400 card=0x00000000 chip=0x01031166 rev=0xc3 hdr=0x01 vendor = 'ServerWorks (Was: Reliance Computer Corp)' device = 'Broadcom dual gigabit, pci bridge (BCM5715)' class = bridge subclass = PCI-PCI bce3@pci0:3:0:0: class=0x020000 card=0x703b103c chip=0x16ac14e4 rev=0x12 hdr=0x00 vendor = 'Broadcom Corporation' device = 'NetXtreme II BCM5708S Gigabit Ethernet' class = network subclass = ethernet >How-To-Repeat: It occurs and remains always. There hasn't been a problem fix so far. Each fresh installation or reboot after the installation bring this issue up front. >Fix: >Release-Note: >Audit-Trail: Responsible-Changed-From-To: freebsd-bugs->freebsd-net Responsible-Changed-By: linimon Responsible-Changed-When: Sat Nov 28 15:26:24 UTC 2009 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=140970 From: Miroslav Lachman <000.fbsd@quip.cz> To: bug-followup@FreeBSD.org, kormann@itm.tum.de Cc: Subject: Re: kern/140970: [bce] The two NetXtreme II BCM5709S NICs on our HP Bl460c G1 Blade can't be accessed on FreeBSD 7.2 and 8 [regression] Date: Mon, 21 Dec 2009 13:17:19 +0100 This seems to be a duplicate of: kern/134658 kern/136417 kern/139761 And maybe related to the kern/134788, which is solved and already closed. (fixed in 7-STABLE) http://lists.freebsd.org/pipermail/freebsd-net/2009-November/023706.html http://lists.freebsd.org/pipermail/freebsd-net/2009-November/023815.html State-Changed-From-To: open->patched State-Changed-By: yongari State-Changed-When: Thu Mar 18 21:56:45 UTC 2010 State-Changed-Why: Patch committed to HEAD(r205299, r205300). Responsible-Changed-From-To: freebsd-net->yongari Responsible-Changed-By: yongari Responsible-Changed-When: Thu Mar 18 21:56:45 UTC 2010 Responsible-Changed-Why: Track. http://www.freebsd.org/cgi/query-pr.cgi?pr=140970 From: Tuareg To: bug-followup@FreeBSD.org Cc: kormann@itm.tum.de Subject: kern/140970: [bce] The two NetXtreme II BCM5709S NICs on our HP Bl460c G1 Blade can't be accessed on FreeBSD 7.2 and 8 [regression] Date: Wed, 24 Mar 2010 18:15:00 -0600 --000e0cd1139c09101c048294f081 Content-Type: text/plain; charset=ISO-8859-1 The same error message is displayed with the IBM HS22 Blade Server when installing FreeBSD 8.0 amd : dmesg | grep bce bce0: mem 0x92000000-0x93ffffff irq 30 at device 0.0 on pci16 bce0: /usr/src/sys/dev/if_bce.c(1907): No PHY found on child MII bus! device_attach: bce0 attach returned 6 bce1: mem 0x94000000-0x95ffffff irq 37 at device 0.1 on pci16 bce1: /usr/src/sys/dev/if_bce.c(1907): No PHY found on child MII bus! device_attach: bce1 attach returned 6 ifconfig -a only display the lo0. ifconfig bce0 [enter] ifconfig: interface bce0 does not exist pciconf -lv bce0@pci0:16:0:0: class=0x020000 card=0x03701014 chip=0x163a14e4 rev=0x20 hdr=0x00 vendor = 'Broadcom Corporation' device = 'NetXtreme II BCM5709S Gigabit Ethernet' class = network subclass = ethernet bce1@pci0:16:0:1: class=0x020000 card=0x03701014 chip=0x163a14e4 rev=0x20 hdr=0x00 vendor = 'Broadcom Corporation' device = 'NetXtreme II BCM5709S Gigabit Ethernet' class = network subclass = ethernet --000e0cd1139c09101c048294f081 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
The same error message is displayed with the IBM HS22 Blade Server= when installing FreeBSD 8.0 amd :

dmesg | grep bc= e

bce0: <Broadcom NetXtreme II BCM5709 1000Base= -SX (C0)> mem 0x92000000-0x93ffffff irq 30 at device 0.0 on pci16
bce0: /usr/src/sys/dev/if_bce.c(1907): No PHY found on child MII bus!<= /div>
device_attach: bce0 attach returned 6
bce1: <Br= oadcom NetXtreme II BCM5709 1000Base-SX (C0)> mem 0x94000000-0x95ffffff = irq 37 at device 0.1 on pci16
bce1: /usr/src/sys/dev/if_bce.c(1907): No PHY found on child MII bus!<= /div>
device_attach: bce1 attach returned 6

<= div>ifconfig -a only display the lo0.

ifconfig bce= 0 [enter]
ifconfig: interface bce0 does not exist


<= /div>
pciconf -lv

bce0@pci0:16:0:0: =A0 =A0 cl= ass=3D0x020000 card=3D0x03701014 chip=3D0x163a14e4 rev=3D0x20 hdr=3D0x00
vendor =A0 =A0 =A0 =A0 =A0=3D 'Broadcom Corporation'
device =A0 =A0 =A0 =A0 =A0=3D 'NetXtreme II BCM5709S Gigabit Ether= net'
class =A0 =A0 =A0 =A0 =A0 =3D network
subclass= =A0 =A0 =3D ethernet
bce1@pci0:16:0:1: =A0 =A0 class=3D0x02= 0000 card=3D0x03701014 chip=3D0x163a14e4 rev=3D0x20 hdr=3D0x00
vendor =A0 =A0 =A0 =A0 =A0=3D 'Broadcom Corporation'
device =A0 =A0 =A0 =A0 =A0=3D 'NetXtreme II BCM5709S Gigabit Ethernet&= #39;
class =A0 =A0 =A0 =A0 =A0 =3D network
subclass =A0= =A0 =3D ethernet

--000e0cd1139c09101c048294f081-- From: Pyun YongHyeon To: Tuareg Cc: yongari@freebsd.org, bug-followup@FreeBSD.org Subject: Re: kern/140970: [bce] The two NetXtreme II BCM5709S NICs on our HP Bl460c G1 Blade can't be accessed on FreeBSD 7.2 and 8 [regression] Date: Wed, 24 Mar 2010 17:47:29 -0700 On Thu, Mar 25, 2010 at 12:40:02AM +0000, Tuareg wrote: > The following reply was made to PR kern/140970; it has been noted by GNATS. > > From: Tuareg > To: bug-followup@FreeBSD.org > Cc: kormann@itm.tum.de > Subject: kern/140970: [bce] The two NetXtreme II BCM5709S NICs on our HP > Bl460c G1 Blade can't be accessed on FreeBSD 7.2 and 8 [regression] > Date: Wed, 24 Mar 2010 18:15:00 -0600 > > --000e0cd1139c09101c048294f081 > Content-Type: text/plain; charset=ISO-8859-1 > > The same error message is displayed with the IBM HS22 Blade Server when > installing FreeBSD 8.0 amd : > You should apply patch committed by davidch(r205299 and r205300) to your 8.0-RELEASE. Did you patch your bce(4) to include that patches? > dmesg | grep bce > > bce0: mem > 0x92000000-0x93ffffff irq 30 at device 0.0 on pci16 > bce0: /usr/src/sys/dev/if_bce.c(1907): No PHY found on child MII bus! > device_attach: bce0 attach returned 6 > bce1: mem > 0x94000000-0x95ffffff irq 37 at device 0.1 on pci16 > bce1: /usr/src/sys/dev/if_bce.c(1907): No PHY found on child MII bus! > device_attach: bce1 attach returned 6 > > ifconfig -a only display the lo0. > > ifconfig bce0 [enter] > ifconfig: interface bce0 does not exist > > > pciconf -lv > > bce0@pci0:16:0:0: class=0x020000 card=0x03701014 chip=0x163a14e4 > rev=0x20 hdr=0x00 > vendor = 'Broadcom Corporation' > device = 'NetXtreme II BCM5709S Gigabit Ethernet' > class = network > subclass = ethernet > bce1@pci0:16:0:1: class=0x020000 card=0x03701014 chip=0x163a14e4 > rev=0x20 hdr=0x00 > vendor = 'Broadcom Corporation' > device = 'NetXtreme II BCM5709S Gigabit Ethernet' > class = network > subclass = ethernet > From: Tuareg To: pyunyh@gmail.com Cc: yongari@freebsd.org, bug-followup@freebsd.org Subject: Re: kern/140970: [bce] The two NetXtreme II BCM5709S NICs on our HP Bl460c G1 Blade can't be accessed on FreeBSD 7.2 and 8 [regression] Date: Thu, 25 Mar 2010 20:33:23 -0600 --00504502e1a2c939630482aafc0d Content-Type: text/plain; charset=ISO-8859-1 Thank you very much Pyun, That resolved our problems, now we are able to connect to the HS22. Here's the output of the dmesg: dmesg | grep bce bce0: mem 0x92000000-0x93ffffff irq 30 at device 0.0 on pci16 miibus0: on bce0 bce0: Ethernet address: 00:1a:64:ae:37:da bce0: [ITHREAD] bce0: ASIC (0x57092000); Rev (C0); Bus (PCIe x4, 2.5Gbps); B/C (4.6.4); Flags (MSI|MFW); MFW (NCSI 1.0.6) bce1: mem 0x94000000-0x95ffffff irq 37 at device 0.1 on pci16 miibus1: on bce1 bce1: Ethernet address: 00:1a:64:ae:37:dc bce1: [ITHREAD] bce1: ASIC (0x57092000); Rev (C0); Bus (PCIe x4, 2.5Gbps); B/C (4.6.4); Flags (MSI|MFW); MFW (NCSI 1.0.6) $ ifconfig bce0: flags=8843 metric 0 mtu 1500 options=1bb ether 00:1a:64:ae:37:da inet x.x.x.x netmask 0xffffff00 broadcast x.x.x.x media: Ethernet autoselect (1000baseSX ) status: active bce1: flags=8843 metric 0 mtu 1500 options=1bb ether 00:1a:64:ae:37:dc inet x.x.x.x netmask 0xffffff00 broadcast x.x.x.x media: Ethernet autoselect (1000baseSX ) status: active Do you need something else? or should I put this information / notify someone else about this ? Again.. thank you for your patience/help. Regards, On Wed, Mar 24, 2010 at 7:58 PM, Pyun YongHyeon wrote: > On Wed, Mar 24, 2010 at 07:23:29PM -0600, Tuareg wrote: > > Hi Pyun, > > > > No, I didn't patch anything (yet). It's a fresh install. > > > > That's because this blade (IBM HS22) only have this network cards > embbeded, > > there's no way to use "freebsd-update" or "csup". > > > > Looking for some information I found this: > > > > http://forums.freebsd.org/archive/index.php/t-2419.html > > > > But there's no info on how to patch the files. > > > > I understand that some files needed to be patched ( I tried replacing the > > files that are in /usr/src/sys/dev/bce/ ), it's just that other than the > bce > > didn't know what else. > > > > Also, didn't know how to do it. > > > > What I know it's that I should do something like: > > > > patch file < file (or something like that) > > > > But don't know exactly which files, and the content of them. > > > > I was looking at the FreeBSD documentation but, couldn't find the > > information on how to do this. > > > > Looking for that info righ now, but if you can help me, I really > apreciate. > > > > The easiest way would be download all related files from HEAD and > replace your old source and rebuild it on 8.0-RELEASE. You can use > SVN interface to get them. > (e.g http://svn.freebsd.org/viewvc/base/head/sys/dev/bce/if_bce.c) > The required files would be > sys/dev/bce/if_bce.c > sys/dev/bce/if_bcefw.h > sys/dev/bce/if_bcereg.h > sys/dev/mii/miidevs > sys/dev/mii/brgphy.c > sys/dev/mii/brgphyreg.h > After that you may have to add the following code to beginning of > if_bce.c. > > #ifndef IFCAP_VLAN_HWTSO > #define IFCAP_VLAN_HWTSO 0 > #endif > > This will make you build latest bce(4) and brgphy(4) on > 8.0-RELEASE. > Hope this helps. > > > Regards, > > > > > > On Wed, Mar 24, 2010 at 6:47 PM, Pyun YongHyeon > wrote: > > > > > On Thu, Mar 25, 2010 at 12:40:02AM +0000, Tuareg wrote: > > > > The following reply was made to PR kern/140970; it has been noted by > > > GNATS. > > > > > > > > From: Tuareg > > > > To: bug-followup@FreeBSD.org > > > > Cc: kormann@itm.tum.de > > > > Subject: kern/140970: [bce] The two NetXtreme II BCM5709S NICs on our > HP > > > > Bl460c G1 Blade can't be accessed on FreeBSD 7.2 and 8 > [regression] > > > > Date: Wed, 24 Mar 2010 18:15:00 -0600 > > > > > > > > --000e0cd1139c09101c048294f081 > > > > Content-Type: text/plain; charset=ISO-8859-1 > > > > > > > > The same error message is displayed with the IBM HS22 Blade Server > when > > > > installing FreeBSD 8.0 amd : > > > > > > > > > > You should apply patch committed by davidch(r205299 and r205300) to > > > your 8.0-RELEASE. Did you patch your bce(4) to include that > > > patches? > > > > > > > dmesg | grep bce > > > > > > > > bce0: mem > > > > 0x92000000-0x93ffffff irq 30 at device 0.0 on pci16 > > > > bce0: /usr/src/sys/dev/if_bce.c(1907): No PHY found on child MII > bus! > > > > device_attach: bce0 attach returned 6 > > > > bce1: mem > > > > 0x94000000-0x95ffffff irq 37 at device 0.1 on pci16 > > > > bce1: /usr/src/sys/dev/if_bce.c(1907): No PHY found on child MII > bus! > > > > device_attach: bce1 attach returned 6 > > > > > > > > ifconfig -a only display the lo0. > > > > > > > > ifconfig bce0 [enter] > > > > ifconfig: interface bce0 does not exist > > > > > > > > > > > > pciconf -lv > > > > > > > > bce0@pci0:16:0:0: class=0x020000 card=0x03701014 > chip=0x163a14e4 > > > > rev=0x20 hdr=0x00 > > > > vendor = 'Broadcom Corporation' > > > > device = 'NetXtreme II BCM5709S Gigabit Ethernet' > > > > class = network > > > > subclass = ethernet > > > > bce1@pci0:16:0:1: class=0x020000 card=0x03701014 > chip=0x163a14e4 > > > > rev=0x20 hdr=0x00 > > > > vendor = 'Broadcom Corporation' > > > > device = 'NetXtreme II BCM5709S Gigabit Ethernet' > > > > class = network > > > > subclass = ethernet > > > > > > > > --00504502e1a2c939630482aafc0d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Thank you very much=A0Pyun,

Th= at resolved our problems, now we are able to connect to the HS22.

Here's the output of the dmesg:

dmesg | grep bce

bce0: <Broadcom NetXtreme= II BCM5709 1000Base-SX (C0)> mem 0x92000000-0x93ffffff irq 30 at device= 0.0 on pci16
miibus0: <MII bus> on bce0
bce0: Et= hernet address: 00:1a:64:ae:37:da
bce0: [ITHREAD]
bce0: ASIC (0x57092000); Rev (C0); Bus (PCIe= x4, 2.5Gbps); B/C (4.6.4); Flags (MSI|MFW); MFW (NCSI 1.0.6)
bce= 1: <Broadcom NetXtreme II BCM5709 1000Base-SX (C0)> mem 0x94000000-0x= 95ffffff irq 37 at device 0.1 on pci16
miibus1: <MII bus> on bce1
bce1: Ethernet address: 00:= 1a:64:ae:37:dc
bce1: [ITHREAD]
bce1: ASIC (0x57092000);= Rev (C0); Bus (PCIe x4, 2.5Gbps); B/C (4.6.4); Flags (MSI|MFW); MFW (NCSI = 1.0.6)


$ ifconfig
bce0: fl= ags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500<= /div>
= options=3D1bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSU= M,TSO4>
ether= 00:1a:64:ae:37:da
inet x.x.x.x netmask 0xffffff00 broadcast x.x.x.x
<= div> media: Eth= ernet autoselect (1000baseSX <full-duplex>)
status: active
= bce1: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 m= tu 1500
optio= ns=3D1bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO= 4>
<= /span>ether 00:1a:64:ae:37:dc
inet = x.x.x.x netmask 0xffffff00 broadcast x.x.x.x
media: Ethernet autoselect (10= 00baseSX <full-duplex>)
statu= s: active


Do you need somethi= ng else? or should I put this information / notify someone else about this = ?

Again.. thank you for your patience/help.
Regards,



On Wed, Mar 24, 2010 at 7:58 PM, Pyun YongHyeon <pyunyh@gmail.com> wrote:
On Wed, Mar 24, 2010 at 0= 7:23:29PM -0600, Tuareg wrote:
> Hi Pyun,
>
> No, I didn't patch anything (yet). It's a fresh install.
>
> That's because this blade (IBM HS22) only have this network cards = embbeded,
> there's no way to use "freebsd-update" or "csup&quo= t;.
>
> Looking for some information I found this:
>
> http://forums.freebsd.org/archive/index.php/t-2419.html=
>
> But there's no info on how to patch the files.
>
> I understand that some files needed to be patched ( I tried replacing = the
> files that are in /usr/src/sys/dev/bce/ ), it's just that other th= an the bce
> didn't know what else.
>
> Also, didn't know how to do it.
>
> What I know it's that I should do something like:
>
> patch file < file =A0(or something like that)
>
> But don't know exactly which files, and the content of them.
>
> I was looking at the FreeBSD documentation but, couldn't find the<= br> > information on how to do this.
>
> Looking for that info righ now, but if you can help me, I really aprec= iate.
>

The easiest way would be download all related files from HEAD and
replace your old source and rebuild it on 8.0-RELEASE. You can use
SVN interface to get them.
(e.g http://svn.freebsd.org/viewvc/base/head/sys/dev/bce/if= _bce.c)
The required files would be
sys/dev/bce/if_bce.c
sys/dev/bce/if_bcefw.h
sys/dev/bce/if_bcereg.h
sys/dev/mii/miidevs
sys/dev/mii/brgphy.c
sys/dev/mii/brgphyreg.h
After that you may have to add the following code to beginning of
if_bce.c.

#ifndef IFCAP_VLAN_HWTSO
#define IFCAP_VLAN_HWTSO =A0 =A0 =A0 =A00
#endif

This will make you build latest bce(4) and brgphy(4) on
8.0-RELEASE.
Hope this helps.

> Regards,
>
>
> On Wed, Mar 24, 2010 at 6:47 PM, Pyun YongHyeon <pyunyh@gmail.com> wrote:
>
> > On Thu, Mar 25, 2010 at 12:40:02AM +0000, Tuareg wrote:
> > > The following reply was made to PR kern/140970; it has been = noted by
> > GNATS.
> > >
> > > From: Tuareg <tuar= egmex@gmail.com>
> > > To: bug-followup@FreeBSD.org
> > > Cc: kormann@itm.tum.de=
> > > Subject: kern/140970: [bce] The two NetXtreme II BCM5709S NI= Cs on our HP
> > > =A0 =A0 =A0 Bl460c G1 Blade can't be accessed on FreeBSD= 7.2 and 8 [regression]
> > > Date: Wed, 24 Mar 2010 18:15:00 -0600
> > >
> > > =A0--000e0cd1139c09101c048294f081
> > > =A0Content-Type: text/plain; charset=3DISO-8859-1
> > >
> > > =A0The same error message is displayed with the IBM HS22 Bla= de Server when
> > > =A0installing FreeBSD 8.0 amd :
> > >
> >
> > You should apply patch committed by davidch(r205299 and r205300) = to
> > your 8.0-RELEASE. Did you patch your bce(4) to include that
> > patches?
> >
> > > =A0dmesg | grep bce
> > >
> > > =A0bce0: <Broadcom NetXtreme II BCM5709 1000Base-SX (C0)&= gt; mem
> > > =A00x92000000-0x93ffffff irq 30 at device 0.0 on pci16
> > > =A0bce0: /usr/src/sys/dev/if_bce.c(1907): No PHY found on ch= ild MII bus!
> > > =A0device_attach: bce0 attach returned 6
> > > =A0bce1: <Broadcom NetXtreme II BCM5709 1000Base-SX (C0)&= gt; mem
> > > =A00x94000000-0x95ffffff irq 37 at device 0.1 on pci16
> > > =A0bce1: /usr/src/sys/dev/if_bce.c(1907): No PHY found on ch= ild MII bus!
> > > =A0device_attach: bce1 attach returned 6
> > >
> > > =A0ifconfig -a only display the lo0.
> > >
> > > =A0ifconfig bce0 [enter]
> > > =A0ifconfig: interface bce0 does not exist
> > >
> > >
> > > =A0pciconf -lv
> > >
> > > =A0bce0@pci0:16:0:0: =A0 =A0 class=3D0x020000 card=3D0x03701= 014 chip=3D0x163a14e4
> > > =A0rev=3D0x20 hdr=3D0x00
> > > =A0vendor =A0 =A0 =A0 =A0 =A0=3D 'Broadcom Corporation&#= 39;
> > > =A0device =A0 =A0 =A0 =A0 =A0=3D 'NetXtreme II BCM5709S = Gigabit Ethernet'
> > > =A0class =A0 =A0 =A0 =A0 =A0 =3D network
> > > =A0subclass =A0 =A0 =3D ethernet
> > > =A0bce1@pci0:16:0:1: =A0 =A0 class=3D0x020000 card=3D0x03701= 014 chip=3D0x163a14e4
> > > =A0rev=3D0x20 hdr=3D0x00
> > > =A0vendor =A0 =A0 =A0 =A0 =A0=3D 'Broadcom Corporation&#= 39;
> > > =A0device =A0 =A0 =A0 =A0 =A0=3D 'NetXtreme II BCM5709S = Gigabit Ethernet'
> > > =A0class =A0 =A0 =A0 =A0 =A0 =3D network
> > > =A0subclass =A0 =A0 =3D ethernet
> > >
> >

--00504502e1a2c939630482aafc0d-- From: Pyun YongHyeon To: Tuareg Cc: yongari@freebsd.org, bug-followup@freebsd.org Subject: Re: kern/140970: [bce] The two NetXtreme II BCM5709S NICs on our HP Bl460c G1 Blade can't be accessed on FreeBSD 7.2 and 8 [regression] Date: Fri, 26 Mar 2010 09:38:11 -0700 On Thu, Mar 25, 2010 at 08:33:23PM -0600, Tuareg wrote: > Thank you very much Pyun, > > That resolved our problems, now we are able to connect to the HS22. > > Here's the output of the dmesg: > > dmesg | grep bce > > bce0: mem > 0x92000000-0x93ffffff irq 30 at device 0.0 on pci16 > miibus0: on bce0 > bce0: Ethernet address: 00:1a:64:ae:37:da > bce0: [ITHREAD] > bce0: ASIC (0x57092000); Rev (C0); Bus (PCIe x4, 2.5Gbps); B/C (4.6.4); > Flags (MSI|MFW); MFW (NCSI 1.0.6) > bce1: mem > 0x94000000-0x95ffffff irq 37 at device 0.1 on pci16 > miibus1: on bce1 > bce1: Ethernet address: 00:1a:64:ae:37:dc > bce1: [ITHREAD] > bce1: ASIC (0x57092000); Rev (C0); Bus (PCIe x4, 2.5Gbps); B/C (4.6.4); > Flags (MSI|MFW); MFW (NCSI 1.0.6) > > > $ ifconfig > bce0: flags=8843 metric 0 mtu 1500 > options=1bb > ether 00:1a:64:ae:37:da > inet x.x.x.x netmask 0xffffff00 broadcast x.x.x.x > media: Ethernet autoselect (1000baseSX ) > status: active > bce1: flags=8843 metric 0 mtu 1500 > options=1bb > ether 00:1a:64:ae:37:dc > inet x.x.x.x netmask 0xffffff00 broadcast x.x.x.x > media: Ethernet autoselect (1000baseSX ) > status: active > > > Do you need something else? or should I put this information / notify > someone else about this ? > No and no. The PR state is in 'patched' and other users can also check this PR. The PR would be closed after MFC is done. > Again.. thank you for your patience/help. > Thanks for testing and confirmation! From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/140970: commit references a PR Date: Thu, 15 Apr 2010 19:20:14 +0000 (UTC) Author: yongari Date: Thu Apr 15 19:19:59 2010 New Revision: 206678 URL: http://svn.freebsd.org/changeset/base/206678 Log: MFC r205299: - Added support for 5709S/5716S PHYs. Submitted by: pyunyh PR: kern/134658, kern/136417, kern/139761, kern/140970 Modified: stable/8/sys/dev/mii/brgphy.c stable/8/sys/dev/mii/brgphyreg.h stable/8/sys/dev/mii/miidevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Thu Apr 15 19:19:38 2010 (r206677) +++ stable/8/sys/dev/mii/brgphy.c Thu Apr 15 19:19:59 2010 (r206678) @@ -75,6 +75,7 @@ struct brgphy_softc { #define BRGPHY_5706S 0x0001 #define BRGPHY_5708S 0x0002 #define BRGPHY_NOANWAIT 0x0004 +#define BRGPHY_5709S 0x0008 int bce_phy_flags; /* PHY flags transferred from the MAC driver */ }; @@ -139,6 +140,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5784), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709S), MII_PHY_DESC(BROADCOM2, BCM5906), MII_PHY_END }; @@ -216,30 +218,34 @@ brgphy_attach(device_t dev) break; case MII_OUI_xxBROADCOM: switch (bsc->mii_model) { - case MII_MODEL_xxBROADCOM_BCM5706: - case MII_MODEL_xxBROADCOM_BCM5714: - /* - * The 5464 PHY used in the 5706 supports both copper - * and fiber interfaces over GMII. Need to check the - * shadow registers to see which mode is actually - * in effect, and therefore whether we have 5706C or - * 5706S. - */ - PHY_WRITE(sc, BRGPHY_MII_SHADOW_1C, - BRGPHY_SHADOW_1C_MODE_CTRL); - if (PHY_READ(sc, BRGPHY_MII_SHADOW_1C) & - BRGPHY_SHADOW_1C_ENA_1000X) { - bsc->serdes_flags |= BRGPHY_5706S; - sc->mii_flags |= MIIF_HAVEFIBER; - } - break; + case MII_MODEL_xxBROADCOM_BCM5706: + case MII_MODEL_xxBROADCOM_BCM5714: + /* + * The 5464 PHY used in the 5706 supports both copper + * and fiber interfaces over GMII. Need to check the + * shadow registers to see which mode is actually + * in effect, and therefore whether we have 5706C or + * 5706S. + */ + PHY_WRITE(sc, BRGPHY_MII_SHADOW_1C, + BRGPHY_SHADOW_1C_MODE_CTRL); + if (PHY_READ(sc, BRGPHY_MII_SHADOW_1C) & + BRGPHY_SHADOW_1C_ENA_1000X) { + bsc->serdes_flags |= BRGPHY_5706S; + sc->mii_flags |= MIIF_HAVEFIBER; + } + break; } break; case MII_OUI_xxBROADCOM_ALT1: switch (bsc->mii_model) { - case MII_MODEL_xxBROADCOM_ALT1_BCM5708S: - bsc->serdes_flags |= BRGPHY_5708S; - sc->mii_flags |= MIIF_HAVEFIBER; - break; + case MII_MODEL_xxBROADCOM_ALT1_BCM5708S: + bsc->serdes_flags |= BRGPHY_5708S; + sc->mii_flags |= MIIF_HAVEFIBER; + break; + case MII_MODEL_xxBROADCOM_ALT1_BCM5709S: + bsc->serdes_flags |= BRGPHY_5709S; + sc->mii_flags |= MIIF_HAVEFIBER; + break; } break; default: device_printf(dev, "Unrecognized OUI for PHY!\n"); @@ -631,6 +637,7 @@ brgphy_status(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0); xstat = PHY_READ(sc, BRGPHY_5708S_PG0_1000X_STAT1); + /* Check for MRBE auto-negotiated speed results. */ switch (xstat & BRGPHY_5708S_PG0_1000X_STAT1_SPEED_MASK) { case BRGPHY_5708S_PG0_1000X_STAT1_SPEED_10: mii->mii_media_active |= IFM_10_FL; break; @@ -642,11 +649,40 @@ brgphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_2500_SX; break; } + /* Check for MRBE auto-negotiated duplex results. */ if (xstat & BRGPHY_5708S_PG0_1000X_STAT1_FDX) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; - } + + } else if (bsc->serdes_flags & BRGPHY_5709S) { + + /* Select GP Status Block of the AN MMD, get autoneg results. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_GP_STATUS); + xstat = PHY_READ(sc, BRGPHY_GP_STATUS_TOP_ANEG_STATUS); + + /* Restore IEEE0 block (assumed in all brgphy(4) code). */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + + /* Check for MRBE auto-negotiated speed results. */ + switch (xstat & BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK) { + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10: + mii->mii_media_active |= IFM_10_FL; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100: + mii->mii_media_active |= IFM_100_FX; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G: + mii->mii_media_active |= IFM_1000_SX; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G: + mii->mii_media_active |= IFM_2500_SX; break; + } + + /* Check for MRBE auto-negotiated duplex results. */ + if (xstat & BRGPHY_GP_STATUS_TOP_ANEG_FDX) + mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; + } + } #if 0 @@ -967,6 +1003,7 @@ brgphy_reset(struct mii_softc *sc) struct bge_softc *bge_sc = NULL; struct bce_softc *bce_sc = NULL; struct ifnet *ifp; + int val; /* Perform a standard PHY reset. */ mii_phy_reset(sc); @@ -1089,7 +1126,49 @@ brgphy_reset(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0); } - } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709) { + } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709 && + (bce_sc->bce_phy_flags & BCE_PHY_SERDES_FLAG)) { + + /* Select the SerDes Digital block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_SERDES_DIG); + val = PHY_READ(sc, BRGPHY_SERDES_DIG_1000X_CTL1); + val &= ~BRGPHY_SD_DIG_1000X_CTL1_AUTODET; + val |= BRGPHY_SD_DIG_1000X_CTL1_FIBER; + PHY_WRITE(sc, BRGPHY_SERDES_DIG_1000X_CTL1, val); + + /* Select the Over 1G block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_OVER_1G); + + /* Enable autoneg "Next Page" to advertise 2.5G support. */ + val = PHY_READ(sc, BRGPHY_OVER_1G_UNFORMAT_PG1); + if (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) + val |= BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G; + else + val &= ~BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G; + PHY_WRITE(sc, BRGPHY_OVER_1G_UNFORMAT_PG1, val); + + /* Select the Multi-Rate Backplane Ethernet block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_MRBE); + + /* Enable MRBE speed autoneg. */ + val = PHY_READ(sc, BRGPHY_MRBE_MSG_PG5_NP); + val |= BRGPHY_MRBE_MSG_PG5_NP_MBRE | + BRGPHY_MRBE_MSG_PG5_NP_T2; + PHY_WRITE(sc, BRGPHY_MRBE_MSG_PG5_NP, val); + + /* Select the Clause 73 User B0 block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_CL73_USER_B0); + + /* Enable MRBE speed autoneg. */ + PHY_WRITE(sc, BRGPHY_CL73_USER_B0_MBRE_CTL1, + BRGPHY_CL73_USER_B0_MBRE_CTL1_NP_AFT_BP | + BRGPHY_CL73_USER_B0_MBRE_CTL1_STA_MGR | + BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG); + + /* Restore IEEE0 block (assumed in all brgphy(4) code). */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + + } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709) { if ((BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Ax) || (BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Bx)) brgphy_fixup_disable_early_dac(sc); Modified: stable/8/sys/dev/mii/brgphyreg.h ============================================================================== --- stable/8/sys/dev/mii/brgphyreg.h Thu Apr 15 19:19:38 2010 (r206677) +++ stable/8/sys/dev/mii/brgphyreg.h Thu Apr 15 19:19:59 2010 (r206678) @@ -359,6 +359,61 @@ /* End: PHY register values for the 5708S SerDes PHY */ /*******************************************************/ +/*******************************************************/ +/* Begin: PHY register values for the 5709S SerDes PHY */ +/*******************************************************/ + +/* 5709S SerDes "General Purpose Status" Registers */ +#define BRGPHY_BLOCK_ADDR_GP_STATUS 0x8120 +#define BRGPHY_GP_STATUS_TOP_ANEG_STATUS 0x1B +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK 0x3F00 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10 0x0000 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100 0x0100 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G 0x0200 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G 0x0300 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1GKX 0x0D00 +#define BRGPHY_GP_STATUS_TOP_ANEG_FDX 0x0008 +#define BRGPHY_GP_STATUS_TOP_ANEG_LINK_UP 0x0004 +#define BRGPHY_GP_STATUS_TOP_ANEG_CL73_COMP 0x0001 + +/* 5709S SerDes "SerDes Digital" Registers */ +#define BRGPHY_BLOCK_ADDR_SERDES_DIG 0x8300 +#define BRGPHY_SERDES_DIG_1000X_CTL1 0x0010 +#define BRGPHY_SD_DIG_1000X_CTL1_AUTODET 0x0010 +#define BRGPHY_SD_DIG_1000X_CTL1_FIBER 0x0001 + +/* 5709S SerDes "Over 1G" Registers */ +#define BRGPHY_BLOCK_ADDR_OVER_1G 0x8320 +#define BRGPHY_OVER_1G_UNFORMAT_PG1 0x19 + +/* 5709S SerDes "Multi-Rate Backplane Ethernet" Registers */ +#define BRGPHY_BLOCK_ADDR_MRBE 0x8350 +#define BRGPHY_MRBE_MSG_PG5_NP 0x10 +#define BRGPHY_MRBE_MSG_PG5_NP_MBRE 0x0001 +#define BRGPHY_MRBE_MSG_PG5_NP_T2 0x0001 + +/* 5709S SerDes "IEEE Clause 73 User B0" Registers */ +#define BRGPHY_BLOCK_ADDR_CL73_USER_B0 0x8370 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1 0x12 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1_NP_AFT_BP 0x2000 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1_STA_MGR 0x4000 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG 0x8000 + +/* 5709S SerDes "IEEE Clause 73 User B0" Registers */ +#define BRGPHY_BLOCK_ADDR_ADDR_EXT 0xFFD0 + +/* 5709S SerDes "Combo IEEE 0" Registers */ +#define BRGPHY_BLOCK_ADDR_COMBO_IEEE0 0xFFE0 + +#define BRGPHY_ADDR_EXT 0x1E +#define BRGPHY_BLOCK_ADDR 0x1F + +#define BRGPHY_ADDR_EXT_AN_MMD 0x3800 + +/*******************************************************/ +/* End: PHY register values for the 5709S SerDes PHY */ +/*******************************************************/ + #define BRGPHY_INTRS \ ~(BRGPHY_IMR_LNK_CHG|BRGPHY_IMR_LSP_CHG|BRGPHY_IMR_DUP_CHG) Modified: stable/8/sys/dev/mii/miidevs ============================================================================== --- stable/8/sys/dev/mii/miidevs Thu Apr 15 19:19:38 2010 (r206677) +++ stable/8/sys/dev/mii/miidevs Thu Apr 15 19:19:59 2010 (r206678) @@ -157,6 +157,7 @@ model xxBROADCOM_ALT1 BCM5722 0x002d BCM model xxBROADCOM_ALT1 BCM5784 0x003a BCM5784 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5761 0x003d BCM5761 10/100/1000baseTX PHY +model xxBROADCOM_ALT1 BCM5709S 0x003f BCM5709S 1000/2500baseSX PHY model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX PHY /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/140970: commit references a PR Date: Thu, 15 Apr 2010 19:23:07 +0000 (UTC) Author: yongari Date: Thu Apr 15 19:22:55 2010 New Revision: 206679 URL: http://svn.freebsd.org/changeset/base/206679 Log: MFC r205299: - Added support for 5709S/5716S PHYs. Submitted by: pyunyh PR: kern/134658, kern/136417, kern/139761, kern/140970 Modified: stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/brgphyreg.h stable/7/sys/dev/mii/miidevs Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Thu Apr 15 19:19:59 2010 (r206678) +++ stable/7/sys/dev/mii/brgphy.c Thu Apr 15 19:22:55 2010 (r206679) @@ -75,6 +75,7 @@ struct brgphy_softc { #define BRGPHY_5706S 0x0001 #define BRGPHY_5708S 0x0002 #define BRGPHY_NOANWAIT 0x0004 +#define BRGPHY_5709S 0x0008 int bce_phy_flags; /* PHY flags transferred from the MAC driver */ }; @@ -139,6 +140,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5784), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709S), MII_PHY_DESC(BROADCOM2, BCM5906), MII_PHY_END }; @@ -216,30 +218,34 @@ brgphy_attach(device_t dev) break; case MII_OUI_xxBROADCOM: switch (bsc->mii_model) { - case MII_MODEL_xxBROADCOM_BCM5706: - case MII_MODEL_xxBROADCOM_BCM5714: - /* - * The 5464 PHY used in the 5706 supports both copper - * and fiber interfaces over GMII. Need to check the - * shadow registers to see which mode is actually - * in effect, and therefore whether we have 5706C or - * 5706S. - */ - PHY_WRITE(sc, BRGPHY_MII_SHADOW_1C, - BRGPHY_SHADOW_1C_MODE_CTRL); - if (PHY_READ(sc, BRGPHY_MII_SHADOW_1C) & - BRGPHY_SHADOW_1C_ENA_1000X) { - bsc->serdes_flags |= BRGPHY_5706S; - sc->mii_flags |= MIIF_HAVEFIBER; - } - break; + case MII_MODEL_xxBROADCOM_BCM5706: + case MII_MODEL_xxBROADCOM_BCM5714: + /* + * The 5464 PHY used in the 5706 supports both copper + * and fiber interfaces over GMII. Need to check the + * shadow registers to see which mode is actually + * in effect, and therefore whether we have 5706C or + * 5706S. + */ + PHY_WRITE(sc, BRGPHY_MII_SHADOW_1C, + BRGPHY_SHADOW_1C_MODE_CTRL); + if (PHY_READ(sc, BRGPHY_MII_SHADOW_1C) & + BRGPHY_SHADOW_1C_ENA_1000X) { + bsc->serdes_flags |= BRGPHY_5706S; + sc->mii_flags |= MIIF_HAVEFIBER; + } + break; } break; case MII_OUI_xxBROADCOM_ALT1: switch (bsc->mii_model) { - case MII_MODEL_xxBROADCOM_ALT1_BCM5708S: - bsc->serdes_flags |= BRGPHY_5708S; - sc->mii_flags |= MIIF_HAVEFIBER; - break; + case MII_MODEL_xxBROADCOM_ALT1_BCM5708S: + bsc->serdes_flags |= BRGPHY_5708S; + sc->mii_flags |= MIIF_HAVEFIBER; + break; + case MII_MODEL_xxBROADCOM_ALT1_BCM5709S: + bsc->serdes_flags |= BRGPHY_5709S; + sc->mii_flags |= MIIF_HAVEFIBER; + break; } break; default: device_printf(dev, "Unrecognized OUI for PHY!\n"); @@ -619,6 +625,7 @@ brgphy_status(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0); xstat = PHY_READ(sc, BRGPHY_5708S_PG0_1000X_STAT1); + /* Check for MRBE auto-negotiated speed results. */ switch (xstat & BRGPHY_5708S_PG0_1000X_STAT1_SPEED_MASK) { case BRGPHY_5708S_PG0_1000X_STAT1_SPEED_10: mii->mii_media_active |= IFM_10_FL; break; @@ -630,11 +637,40 @@ brgphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_2500_SX; break; } + /* Check for MRBE auto-negotiated duplex results. */ if (xstat & BRGPHY_5708S_PG0_1000X_STAT1_FDX) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; - } + + } else if (bsc->serdes_flags & BRGPHY_5709S) { + + /* Select GP Status Block of the AN MMD, get autoneg results. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_GP_STATUS); + xstat = PHY_READ(sc, BRGPHY_GP_STATUS_TOP_ANEG_STATUS); + + /* Restore IEEE0 block (assumed in all brgphy(4) code). */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + + /* Check for MRBE auto-negotiated speed results. */ + switch (xstat & BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK) { + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10: + mii->mii_media_active |= IFM_10_FL; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100: + mii->mii_media_active |= IFM_100_FX; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G: + mii->mii_media_active |= IFM_1000_SX; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G: + mii->mii_media_active |= IFM_2500_SX; break; + } + + /* Check for MRBE auto-negotiated duplex results. */ + if (xstat & BRGPHY_GP_STATUS_TOP_ANEG_FDX) + mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; + } + } #if 0 @@ -955,6 +991,7 @@ brgphy_reset(struct mii_softc *sc) struct bge_softc *bge_sc = NULL; struct bce_softc *bce_sc = NULL; struct ifnet *ifp; + int val; /* Perform a standard PHY reset. */ mii_phy_reset(sc); @@ -1077,7 +1114,49 @@ brgphy_reset(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0); } - } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709) { + } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709 && + (bce_sc->bce_phy_flags & BCE_PHY_SERDES_FLAG)) { + + /* Select the SerDes Digital block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_SERDES_DIG); + val = PHY_READ(sc, BRGPHY_SERDES_DIG_1000X_CTL1); + val &= ~BRGPHY_SD_DIG_1000X_CTL1_AUTODET; + val |= BRGPHY_SD_DIG_1000X_CTL1_FIBER; + PHY_WRITE(sc, BRGPHY_SERDES_DIG_1000X_CTL1, val); + + /* Select the Over 1G block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_OVER_1G); + + /* Enable autoneg "Next Page" to advertise 2.5G support. */ + val = PHY_READ(sc, BRGPHY_OVER_1G_UNFORMAT_PG1); + if (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) + val |= BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G; + else + val &= ~BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G; + PHY_WRITE(sc, BRGPHY_OVER_1G_UNFORMAT_PG1, val); + + /* Select the Multi-Rate Backplane Ethernet block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_MRBE); + + /* Enable MRBE speed autoneg. */ + val = PHY_READ(sc, BRGPHY_MRBE_MSG_PG5_NP); + val |= BRGPHY_MRBE_MSG_PG5_NP_MBRE | + BRGPHY_MRBE_MSG_PG5_NP_T2; + PHY_WRITE(sc, BRGPHY_MRBE_MSG_PG5_NP, val); + + /* Select the Clause 73 User B0 block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_CL73_USER_B0); + + /* Enable MRBE speed autoneg. */ + PHY_WRITE(sc, BRGPHY_CL73_USER_B0_MBRE_CTL1, + BRGPHY_CL73_USER_B0_MBRE_CTL1_NP_AFT_BP | + BRGPHY_CL73_USER_B0_MBRE_CTL1_STA_MGR | + BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG); + + /* Restore IEEE0 block (assumed in all brgphy(4) code). */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + + } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709) { if ((BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Ax) || (BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Bx)) brgphy_fixup_disable_early_dac(sc); Modified: stable/7/sys/dev/mii/brgphyreg.h ============================================================================== --- stable/7/sys/dev/mii/brgphyreg.h Thu Apr 15 19:19:59 2010 (r206678) +++ stable/7/sys/dev/mii/brgphyreg.h Thu Apr 15 19:22:55 2010 (r206679) @@ -359,6 +359,61 @@ /* End: PHY register values for the 5708S SerDes PHY */ /*******************************************************/ +/*******************************************************/ +/* Begin: PHY register values for the 5709S SerDes PHY */ +/*******************************************************/ + +/* 5709S SerDes "General Purpose Status" Registers */ +#define BRGPHY_BLOCK_ADDR_GP_STATUS 0x8120 +#define BRGPHY_GP_STATUS_TOP_ANEG_STATUS 0x1B +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK 0x3F00 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10 0x0000 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100 0x0100 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G 0x0200 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G 0x0300 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1GKX 0x0D00 +#define BRGPHY_GP_STATUS_TOP_ANEG_FDX 0x0008 +#define BRGPHY_GP_STATUS_TOP_ANEG_LINK_UP 0x0004 +#define BRGPHY_GP_STATUS_TOP_ANEG_CL73_COMP 0x0001 + +/* 5709S SerDes "SerDes Digital" Registers */ +#define BRGPHY_BLOCK_ADDR_SERDES_DIG 0x8300 +#define BRGPHY_SERDES_DIG_1000X_CTL1 0x0010 +#define BRGPHY_SD_DIG_1000X_CTL1_AUTODET 0x0010 +#define BRGPHY_SD_DIG_1000X_CTL1_FIBER 0x0001 + +/* 5709S SerDes "Over 1G" Registers */ +#define BRGPHY_BLOCK_ADDR_OVER_1G 0x8320 +#define BRGPHY_OVER_1G_UNFORMAT_PG1 0x19 + +/* 5709S SerDes "Multi-Rate Backplane Ethernet" Registers */ +#define BRGPHY_BLOCK_ADDR_MRBE 0x8350 +#define BRGPHY_MRBE_MSG_PG5_NP 0x10 +#define BRGPHY_MRBE_MSG_PG5_NP_MBRE 0x0001 +#define BRGPHY_MRBE_MSG_PG5_NP_T2 0x0001 + +/* 5709S SerDes "IEEE Clause 73 User B0" Registers */ +#define BRGPHY_BLOCK_ADDR_CL73_USER_B0 0x8370 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1 0x12 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1_NP_AFT_BP 0x2000 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1_STA_MGR 0x4000 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG 0x8000 + +/* 5709S SerDes "IEEE Clause 73 User B0" Registers */ +#define BRGPHY_BLOCK_ADDR_ADDR_EXT 0xFFD0 + +/* 5709S SerDes "Combo IEEE 0" Registers */ +#define BRGPHY_BLOCK_ADDR_COMBO_IEEE0 0xFFE0 + +#define BRGPHY_ADDR_EXT 0x1E +#define BRGPHY_BLOCK_ADDR 0x1F + +#define BRGPHY_ADDR_EXT_AN_MMD 0x3800 + +/*******************************************************/ +/* End: PHY register values for the 5709S SerDes PHY */ +/*******************************************************/ + #define BRGPHY_INTRS \ ~(BRGPHY_IMR_LNK_CHG|BRGPHY_IMR_LSP_CHG|BRGPHY_IMR_DUP_CHG) Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Thu Apr 15 19:19:59 2010 (r206678) +++ stable/7/sys/dev/mii/miidevs Thu Apr 15 19:22:55 2010 (r206679) @@ -152,6 +152,7 @@ model xxBROADCOM_ALT1 BCM5722 0x002d BCM model xxBROADCOM_ALT1 BCM5784 0x003a BCM5784 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5761 0x003d BCM5761 10/100/1000baseTX PHY +model xxBROADCOM_ALT1 BCM5709S 0x003f BCM5709S 1000/2500baseSX PHY model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX PHY /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/140970: commit references a PR Date: Thu, 15 Apr 2010 19:26:39 +0000 (UTC) Author: yongari Date: Thu Apr 15 19:26:28 2010 New Revision: 206680 URL: http://svn.freebsd.org/changeset/base/206680 Log: MFC r205300: - Added support for 5709S/5716S PHYs. - Update copyright to 2010. - Add new debug code for RV2P block. - Improve output formatting for various debug functions. PR: kern/134658, kern/136417, kern/139761, kern/140970 Modified: stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/bce/if_bcefw.h stable/8/sys/dev/bce/if_bcereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Thu Apr 15 19:22:55 2010 (r206679) +++ stable/8/sys/dev/bce/if_bce.c Thu Apr 15 19:26:28 2010 (r206680) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2009 Broadcom Corporation + * Copyright (c) 2006-2010 Broadcom Corporation * David Christensen . All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); * BCM5708C B1, B2 * BCM5708S B1, B2 * BCM5709C A1, C0 + * BCM5709S A1, C0 * BCM5716C C0 + * BCM5716S C0 * * The following controllers are not supported by this driver: * BCM5706C A0, A1 (pre-production) @@ -46,7 +48,7 @@ __FBSDID("$FreeBSD$"); * BCM5708C A0, B0 (pre-production) * BCM5708S A0, B0 (pre-production) * BCM5709C A0 B0, B1, B2 (pre-production) - * BCM5709S A0, A1, B0, B1, B2, C0 (pre-production) + * BCM5709S A0, B0, B1, B2 (pre-production) */ #include "opt_bce.h" @@ -320,6 +322,7 @@ static void bce_dump_rxp_state (struct static void bce_dump_tpat_state (struct bce_softc *, int); static void bce_dump_cp_state (struct bce_softc *, int); static void bce_dump_com_state (struct bce_softc *, int); +static void bce_dump_rv2p_state (struct bce_softc *); static void bce_breakpoint (struct bce_softc *); #endif @@ -360,6 +363,7 @@ static int bce_nvram_write (struct bc /* */ /****************************************************************************/ static void bce_get_media (struct bce_softc *); +static void bce_init_media (struct bce_softc *); static void bce_dma_map_addr (void *, bus_dma_segment_t *, int, int); static int bce_dma_alloc (device_t); static void bce_dma_free (struct bce_softc *); @@ -1096,7 +1100,10 @@ bce_attach(device_t dev) else ifp->if_baudrate = IF_Mbps(1000); - /* Check for an MII child bus by probing the PHY. */ + /* Handle any special PHY initialization for SerDes PHYs. */ + bce_init_media(sc); + + /* MII child bus by probing the PHY. */ if (mii_phy_probe(dev, &sc->bce_miibus, bce_ifmedia_upd, bce_ifmedia_sts)) { BCE_PRINTF("%s(%d): No PHY found on child MII bus!\n", @@ -1504,7 +1511,17 @@ bce_miibus_read_reg(device_t dev, int ph return(0); } - if (sc->bce_phy_flags & BCE_PHY_INT_MODE_AUTO_POLLING_FLAG) { + /* + * The 5709S PHY is an IEEE Clause 45 PHY + * with special mappings to work with IEEE + * Clause 22 register accesses. + */ + if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { + if (reg >= MII_BMCR && reg <= MII_ANLPRNP) + reg += 0x10; + } + + if (sc->bce_phy_flags & BCE_PHY_INT_MODE_AUTO_POLLING_FLAG) { val = REG_RD(sc, BCE_EMAC_MDIO_MODE); val &= ~BCE_EMAC_MDIO_MODE_AUTO_POLL; @@ -1584,6 +1601,16 @@ bce_miibus_write_reg(device_t dev, int p DB_PRINT_PHY_REG(reg, val); + /* + * The 5709S PHY is an IEEE Clause 45 PHY + * with special mappings to work with IEEE + * Clause 22 register accesses. + */ + if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { + if (reg >= MII_BMCR && reg <= MII_ANLPRNP) + reg += 0x10; + } + if (sc->bce_phy_flags & BCE_PHY_INT_MODE_AUTO_POLLING_FLAG) { val1 = REG_RD(sc, BCE_EMAC_MDIO_MODE); val1 &= ~BCE_EMAC_MDIO_MODE_AUTO_POLL; @@ -2647,9 +2674,11 @@ bce_get_media(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_LOAD, "BCM5709 s/w configured for SerDes.\n"); sc->bce_phy_flags |= BCE_PHY_SERDES_FLAG; + break; default: DBPRINT(sc, BCE_INFO_LOAD, "BCM5709 s/w configured for Copper.\n"); + break; } } else { switch (strap) { @@ -2659,9 +2688,11 @@ bce_get_media(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_LOAD, "BCM5709 s/w configured for SerDes.\n"); sc->bce_phy_flags |= BCE_PHY_SERDES_FLAG; + break; default: DBPRINT(sc, BCE_INFO_LOAD, "BCM5709 s/w configured for Copper.\n"); + break; } } @@ -2669,15 +2700,22 @@ bce_get_media(struct bce_softc *sc) sc->bce_phy_flags |= BCE_PHY_SERDES_FLAG; if (sc->bce_phy_flags & BCE_PHY_SERDES_FLAG) { + sc->bce_flags |= BCE_NO_WOL_FLAG; - if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { + + /* 5708S, 5709S, and 5716S use a separate PHY for SerDes. */ + if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) sc->bce_phy_addr = 2; + + if (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) { + sc->bce_phy_flags |= BCE_PHY_IEEE_CLAUSE_45_FLAG; + val = bce_shmem_rd(sc, BCE_SHARED_HW_CFG_CONFIG); if (val & BCE_SHARED_HW_CFG_PHY_2_5G) { sc->bce_phy_flags |= BCE_PHY_2_5G_CAPABLE_FLAG; DBPRINT(sc, BCE_INFO_LOAD, "Found 2.5Gb capable adapter\n"); } - } + } } else if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5706) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5708)) sc->bce_phy_flags |= BCE_PHY_CRC_FIX_FLAG; @@ -2691,6 +2729,37 @@ bce_get_media_exit: /****************************************************************************/ +/* Performs PHY initialization required before MII drivers access the */ +/* device. */ +/* */ +/* Returns: */ +/* Nothing. */ +/****************************************************************************/ +static void +bce_init_media(struct bce_softc *sc) +{ + if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { + /* + * Configure 5709S/5716S PHYs to use traditional IEEE + * Clause 22 method. Otherwise we have no way to attach + * the PHY in mii(4) layer. PHY specific configuration + * is done in mii layer. + */ + + /* Select auto-negotiation MMD of the PHY. */ + bce_miibus_write_reg(sc->bce_dev, sc->bce_phy_addr, + BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_ADDR_EXT); + bce_miibus_write_reg(sc->bce_dev, sc->bce_phy_addr, + BRGPHY_ADDR_EXT, BRGPHY_ADDR_EXT_AN_MMD); + + /* Select IEEE0 block of AN MMD (assumed in all brgphy(4) code). */ + bce_miibus_write_reg(sc->bce_dev, sc->bce_phy_addr, + BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + } +} + + +/****************************************************************************/ /* Free any DMA memory owned by the driver. */ /* */ /* Scans through each data structre that requires DMA memory and frees */ @@ -6679,7 +6748,7 @@ bce_tso_setup(struct bce_softc *sc, stru DBPRINT(sc, BCE_EXTREME_SEND, "%s(): hdr_len = %d, e_hlen = %d, " "ip_hlen = %d, tcp_hlen = %d, ip_len = %d\n", - __FUNCTION__, hdr_len, sizeof(struct ether_header), ip_hlen, + __FUNCTION__, hdr_len, (int) sizeof(struct ether_header), ip_hlen, tcp_hlen, ip_len); /* Set the LSO flag in the TX BD */ @@ -7943,7 +8012,7 @@ bce_sysctl_dump_tx_chain(SYSCTL_HANDLER_ if (result == 1) { sc = (struct bce_softc *)arg1; - bce_dump_tx_chain(sc, 0, USABLE_TX_BD); + bce_dump_tx_chain(sc, 0, TOTAL_TX_BD); } return error; @@ -8626,7 +8695,7 @@ bce_add_sysctls(struct bce_softc *sc) /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static __attribute__ ((noinline)) void bce_freeze_controller(struct bce_softc *sc) { u32 val; @@ -8643,7 +8712,7 @@ bce_freeze_controller(struct bce_softc * /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static __attribute__ ((noinline)) void bce_unfreeze_controller(struct bce_softc *sc) { u32 val; @@ -8661,7 +8730,7 @@ bce_unfreeze_controller(struct bce_softc /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static __attribute__ ((noinline)) void bce_dump_enet(struct bce_softc *sc, struct mbuf *m) { struct ether_vlan_header *eh; @@ -8915,7 +8984,9 @@ bce_dump_pg_mbuf_chain(struct bce_softc static __attribute__ ((noinline)) void bce_dump_txbd(struct bce_softc *sc, int idx, struct tx_bd *txbd) { - if (idx > MAX_TX_BD) + int i = 0; + + if (idx > MAX_TX_BD) /* Index out of range. */ BCE_PRINTF("tx_bd[0x%04X]: Invalid tx_bd index!\n", idx); else if ((idx & USABLE_TX_BD_PER_PAGE) == USABLE_TX_BD_PER_PAGE) @@ -8923,52 +8994,65 @@ bce_dump_txbd(struct bce_softc *sc, int BCE_PRINTF("tx_bd[0x%04X]: haddr = 0x%08X:%08X, chain page pointer\n", idx, txbd->tx_bd_haddr_hi, txbd->tx_bd_haddr_lo); else { - /* Normal tx_bd entry. */ - BCE_PRINTF("tx_bd[0x%04X]: haddr = 0x%08X:%08X, nbytes = 0x%08X, " - "vlan tag= 0x%04X, flags = 0x%04X (", idx, - txbd->tx_bd_haddr_hi, txbd->tx_bd_haddr_lo, - txbd->tx_bd_mss_nbytes, txbd->tx_bd_vlan_tag, - txbd->tx_bd_flags); - - if (txbd->tx_bd_flags & TX_BD_FLAGS_CONN_FAULT) - printf(" CONN_FAULT"); - - if (txbd->tx_bd_flags & TX_BD_FLAGS_TCP_UDP_CKSUM) - printf(" TCP_UDP_CKSUM"); + /* Normal tx_bd entry. */ + BCE_PRINTF("tx_bd[0x%04X]: haddr = 0x%08X:%08X, mss_nbytes = 0x%08X, " + "vlan tag = 0x%04X, flags = 0x%04X (", idx, + txbd->tx_bd_haddr_hi, txbd->tx_bd_haddr_lo, + txbd->tx_bd_mss_nbytes, txbd->tx_bd_vlan_tag, + txbd->tx_bd_flags); - if (txbd->tx_bd_flags & TX_BD_FLAGS_IP_CKSUM) - printf(" IP_CKSUM"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_CONN_FAULT) { + if (i>0) printf("|"); printf("CONN_FAULT"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_VLAN_TAG) - printf(" VLAN"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_TCP_UDP_CKSUM) { + if (i>0) printf("|"); printf("TCP_UDP_CKSUM"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_COAL_NOW) - printf(" COAL_NOW"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_IP_CKSUM) { + if (i>0) printf("|"); printf("IP_CKSUM"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_DONT_GEN_CRC) - printf(" DONT_GEN_CRC"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_VLAN_TAG) { + if (i>0) printf("|"); printf("VLAN"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_START) - printf(" START"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_COAL_NOW) { + if (i>0) printf("|"); printf("COAL_NOW"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_END) - printf(" END"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_DONT_GEN_CRC) { + if (i>0) printf("|"); printf("DONT_GEN_CRC"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_LSO) - printf(" LSO"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_START) { + if (i>0) printf("|"); printf("START"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_OPTION_WORD) - printf(" OPTION_WORD"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_END) { + if (i>0) printf("|"); printf("END"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_FLAGS) - printf(" FLAGS"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_LSO) { + if (i>0) printf("|"); printf("LSO"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_SNAP) - printf(" SNAP"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_OPTION_WORD) { + if (i>0) printf("|"); + printf("SW_OPTION=%d", ((txbd->tx_bd_flags & + TX_BD_FLAGS_SW_OPTION_WORD) >> 8)); i++; + } - printf(" )\n"); - } + if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_FLAGS) { + if (i>0) printf("|"); printf("SW_FLAGS"); i++; + } + if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_SNAP) { + if (i>0) printf("|"); printf("SNAP)"); + } else { + printf(")\n"); + } + } } @@ -9415,10 +9499,8 @@ bce_dump_tx_chain(struct bce_softc *sc, BCE_PRINTF("page size = 0x%08X, tx chain pages = 0x%08X\n", (u32) BCM_PAGE_SIZE, (u32) TX_PAGES); - BCE_PRINTF("tx_bd per page = 0x%08X, usable tx_bd per page = 0x%08X\n", (u32) TOTAL_TX_BD_PER_PAGE, (u32) USABLE_TX_BD_PER_PAGE); - BCE_PRINTF("total tx_bd = 0x%08X\n", (u32) TOTAL_TX_BD); BCE_PRINTF( @@ -9426,11 +9508,11 @@ bce_dump_tx_chain(struct bce_softc *sc, " tx_bd data " "----------------------------\n"); - /* Now print out the tx_bd's themselves. */ + /* Now print out a decoded list of TX buffer descriptors. */ for (int i = 0; i < count; i++) { txbd = &sc->tx_bd_chain[TX_PAGE(tx_prod)][TX_IDX(tx_prod)]; bce_dump_txbd(sc, tx_prod, txbd); - tx_prod = NEXT_TX_BD(tx_prod); + tx_prod++; } BCE_PRINTF( @@ -9530,6 +9612,17 @@ bce_dump_pg_chain(struct bce_softc *sc, } #endif +#define BCE_PRINT_RX_CONS(arg) \ +if (sblk->status_rx_quick_consumer_index##arg) \ + BCE_PRINTF("0x%04X(0x%04X) - rx_quick_consumer_index##arg\n", \ + sblk->status_rx_quick_consumer_index##arg, \ + (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index##arg)); + +#define BCE_PRINT_TX_CONS(arg) \ +if (sblk->status_tx_quick_consumer_index##arg) \ + BCE_PRINTF("0x%04X(0x%04X) - tx_quick_consumer_index##arg\n", \ + sblk->status_tx_quick_consumer_index##arg, \ + (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index##arg)); /****************************************************************************/ /* Prints out the status block from host memory. */ @@ -9549,90 +9642,28 @@ bce_dump_status_block(struct bce_softc * " Status Block " "----------------------------\n"); + /* Theses indices are used for normal L2 drivers. */ BCE_PRINTF(" 0x%08X - attn_bits\n", sblk->status_attn_bits); BCE_PRINTF(" 0x%08X - attn_bits_ack\n", sblk->status_attn_bits_ack); - BCE_PRINTF("0x%04X(0x%04X) - rx_cons0\n", - sblk->status_rx_quick_consumer_index0, - (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index0)); - - BCE_PRINTF("0x%04X(0x%04X) - tx_cons0\n", - sblk->status_tx_quick_consumer_index0, - (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index0)); + BCE_PRINT_RX_CONS(0); + BCE_PRINT_TX_CONS(0) BCE_PRINTF(" 0x%04X - status_idx\n", sblk->status_idx); /* Theses indices are not used for normal L2 drivers. */ - if (sblk->status_rx_quick_consumer_index1) - BCE_PRINTF("0x%04X(0x%04X) - rx_cons1\n", - sblk->status_rx_quick_consumer_index1, - (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index1)); - - if (sblk->status_tx_quick_consumer_index1) - BCE_PRINTF("0x%04X(0x%04X) - tx_cons1\n", - sblk->status_tx_quick_consumer_index1, - (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index1)); - - if (sblk->status_rx_quick_consumer_index2) - BCE_PRINTF("0x%04X(0x%04X)- rx_cons2\n", - sblk->status_rx_quick_consumer_index2, - (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index2)); - - if (sblk->status_tx_quick_consumer_index2) - BCE_PRINTF("0x%04X(0x%04X) - tx_cons2\n", - sblk->status_tx_quick_consumer_index2, - (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index2)); - - if (sblk->status_rx_quick_consumer_index3) - BCE_PRINTF("0x%04X(0x%04X) - rx_cons3\n", - sblk->status_rx_quick_consumer_index3, - (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index3)); - - if (sblk->status_tx_quick_consumer_index3) - BCE_PRINTF("0x%04X(0x%04X) - tx_cons3\n", - sblk->status_tx_quick_consumer_index3, - (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index3)); - - if (sblk->status_rx_quick_consumer_index4 || - sblk->status_rx_quick_consumer_index5) - BCE_PRINTF("rx_cons4 = 0x%08X, rx_cons5 = 0x%08X\n", - sblk->status_rx_quick_consumer_index4, - sblk->status_rx_quick_consumer_index5); - - if (sblk->status_rx_quick_consumer_index6 || - sblk->status_rx_quick_consumer_index7) - BCE_PRINTF("rx_cons6 = 0x%08X, rx_cons7 = 0x%08X\n", - sblk->status_rx_quick_consumer_index6, - sblk->status_rx_quick_consumer_index7); - - if (sblk->status_rx_quick_consumer_index8 || - sblk->status_rx_quick_consumer_index9) - BCE_PRINTF("rx_cons8 = 0x%08X, rx_cons9 = 0x%08X\n", - sblk->status_rx_quick_consumer_index8, - sblk->status_rx_quick_consumer_index9); - - if (sblk->status_rx_quick_consumer_index10 || - sblk->status_rx_quick_consumer_index11) - BCE_PRINTF("rx_cons10 = 0x%08X, rx_cons11 = 0x%08X\n", - sblk->status_rx_quick_consumer_index10, - sblk->status_rx_quick_consumer_index11); - - if (sblk->status_rx_quick_consumer_index12 || - sblk->status_rx_quick_consumer_index13) - BCE_PRINTF("rx_cons12 = 0x%08X, rx_cons13 = 0x%08X\n", - sblk->status_rx_quick_consumer_index12, - sblk->status_rx_quick_consumer_index13); - - if (sblk->status_rx_quick_consumer_index14 || - sblk->status_rx_quick_consumer_index15) - BCE_PRINTF("rx_cons14 = 0x%08X, rx_cons15 = 0x%08X\n", - sblk->status_rx_quick_consumer_index14, - sblk->status_rx_quick_consumer_index15); + BCE_PRINT_RX_CONS(1); BCE_PRINT_RX_CONS(2); BCE_PRINT_RX_CONS(3); + BCE_PRINT_RX_CONS(4); BCE_PRINT_RX_CONS(5); BCE_PRINT_RX_CONS(6); + BCE_PRINT_RX_CONS(7); BCE_PRINT_RX_CONS(8); BCE_PRINT_RX_CONS(9); + BCE_PRINT_RX_CONS(10); BCE_PRINT_RX_CONS(11); BCE_PRINT_RX_CONS(12); + BCE_PRINT_RX_CONS(13); BCE_PRINT_RX_CONS(14); BCE_PRINT_RX_CONS(15); - if (sblk->status_completion_producer_index || + BCE_PRINT_TX_CONS(1); BCE_PRINT_TX_CONS(2); BCE_PRINT_TX_CONS(3); + + if (sblk->status_completion_producer_index || sblk->status_cmd_consumer_index) BCE_PRINTF("com_prod = 0x%08X, cmd_cons = 0x%08X\n", sblk->status_completion_producer_index, @@ -9645,6 +9676,14 @@ bce_dump_status_block(struct bce_softc * } +#define BCE_PRINT_64BIT_STAT(arg) \ +if (sblk->arg##_lo || sblk->arg##_hi) \ + BCE_PRINTF("0x%08X:%08X : arg\n", sblk->arg##_hi, sblk->arg##_lo); + +#define BCE_PRINT_32BIT_STAT(arg) \ +if (sblk->arg) \ + BCE_PRINTF(" 0x%08X : arg\n", sblk->arg); + /****************************************************************************/ /* Prints out the statistics block from host memory. */ /* */ @@ -9663,252 +9702,60 @@ bce_dump_stats_block(struct bce_softc *s " Stats Block (All Stats Not Shown Are 0) " "---------------\n"); - if (sblk->stat_IfHCInOctets_hi - || sblk->stat_IfHCInOctets_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInOctets\n", - sblk->stat_IfHCInOctets_hi, - sblk->stat_IfHCInOctets_lo); - - if (sblk->stat_IfHCInBadOctets_hi - || sblk->stat_IfHCInBadOctets_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInBadOctets\n", - sblk->stat_IfHCInBadOctets_hi, - sblk->stat_IfHCInBadOctets_lo); - - if (sblk->stat_IfHCOutOctets_hi - || sblk->stat_IfHCOutOctets_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutOctets\n", - sblk->stat_IfHCOutOctets_hi, - sblk->stat_IfHCOutOctets_lo); - - if (sblk->stat_IfHCOutBadOctets_hi - || sblk->stat_IfHCOutBadOctets_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutBadOctets\n", - sblk->stat_IfHCOutBadOctets_hi, - sblk->stat_IfHCOutBadOctets_lo); - - if (sblk->stat_IfHCInUcastPkts_hi - || sblk->stat_IfHCInUcastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInUcastPkts\n", - sblk->stat_IfHCInUcastPkts_hi, - sblk->stat_IfHCInUcastPkts_lo); - - if (sblk->stat_IfHCInBroadcastPkts_hi - || sblk->stat_IfHCInBroadcastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInBroadcastPkts\n", - sblk->stat_IfHCInBroadcastPkts_hi, - sblk->stat_IfHCInBroadcastPkts_lo); - - if (sblk->stat_IfHCInMulticastPkts_hi - || sblk->stat_IfHCInMulticastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInMulticastPkts\n", - sblk->stat_IfHCInMulticastPkts_hi, - sblk->stat_IfHCInMulticastPkts_lo); - - if (sblk->stat_IfHCOutUcastPkts_hi - || sblk->stat_IfHCOutUcastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutUcastPkts\n", - sblk->stat_IfHCOutUcastPkts_hi, - sblk->stat_IfHCOutUcastPkts_lo); - - if (sblk->stat_IfHCOutBroadcastPkts_hi - || sblk->stat_IfHCOutBroadcastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutBroadcastPkts\n", - sblk->stat_IfHCOutBroadcastPkts_hi, - sblk->stat_IfHCOutBroadcastPkts_lo); - - if (sblk->stat_IfHCOutMulticastPkts_hi - || sblk->stat_IfHCOutMulticastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutMulticastPkts\n", - sblk->stat_IfHCOutMulticastPkts_hi, - sblk->stat_IfHCOutMulticastPkts_lo); - - if (sblk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors) - BCE_PRINTF(" 0x%08X : " - "emac_tx_stat_dot3statsinternalmactransmiterrors\n", - sblk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors); - - if (sblk->stat_Dot3StatsCarrierSenseErrors) - BCE_PRINTF(" 0x%08X : Dot3StatsCarrierSenseErrors\n", - sblk->stat_Dot3StatsCarrierSenseErrors); - - if (sblk->stat_Dot3StatsFCSErrors) - BCE_PRINTF(" 0x%08X : Dot3StatsFCSErrors\n", - sblk->stat_Dot3StatsFCSErrors); - - if (sblk->stat_Dot3StatsAlignmentErrors) - BCE_PRINTF(" 0x%08X : Dot3StatsAlignmentErrors\n", - sblk->stat_Dot3StatsAlignmentErrors); - - if (sblk->stat_Dot3StatsSingleCollisionFrames) - BCE_PRINTF(" 0x%08X : Dot3StatsSingleCollisionFrames\n", - sblk->stat_Dot3StatsSingleCollisionFrames); - - if (sblk->stat_Dot3StatsMultipleCollisionFrames) - BCE_PRINTF(" 0x%08X : Dot3StatsMultipleCollisionFrames\n", - sblk->stat_Dot3StatsMultipleCollisionFrames); - - if (sblk->stat_Dot3StatsDeferredTransmissions) - BCE_PRINTF(" 0x%08X : Dot3StatsDeferredTransmissions\n", - sblk->stat_Dot3StatsDeferredTransmissions); - - if (sblk->stat_Dot3StatsExcessiveCollisions) - BCE_PRINTF(" 0x%08X : Dot3StatsExcessiveCollisions\n", - sblk->stat_Dot3StatsExcessiveCollisions); - - if (sblk->stat_Dot3StatsLateCollisions) - BCE_PRINTF(" 0x%08X : Dot3StatsLateCollisions\n", - sblk->stat_Dot3StatsLateCollisions); - - if (sblk->stat_EtherStatsCollisions) - BCE_PRINTF(" 0x%08X : EtherStatsCollisions\n", - sblk->stat_EtherStatsCollisions); - - if (sblk->stat_EtherStatsFragments) - BCE_PRINTF(" 0x%08X : EtherStatsFragments\n", - sblk->stat_EtherStatsFragments); - - if (sblk->stat_EtherStatsJabbers) - BCE_PRINTF(" 0x%08X : EtherStatsJabbers\n", - sblk->stat_EtherStatsJabbers); - - if (sblk->stat_EtherStatsUndersizePkts) - BCE_PRINTF(" 0x%08X : EtherStatsUndersizePkts\n", - sblk->stat_EtherStatsUndersizePkts); - - if (sblk->stat_EtherStatsOversizePkts) - BCE_PRINTF(" 0x%08X : EtherStatsOverrsizePkts\n", - sblk->stat_EtherStatsOversizePkts); - - if (sblk->stat_EtherStatsPktsRx64Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx64Octets\n", - sblk->stat_EtherStatsPktsRx64Octets); - - if (sblk->stat_EtherStatsPktsRx65Octetsto127Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx65Octetsto127Octets\n", - sblk->stat_EtherStatsPktsRx65Octetsto127Octets); - - if (sblk->stat_EtherStatsPktsRx128Octetsto255Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx128Octetsto255Octets\n", - sblk->stat_EtherStatsPktsRx128Octetsto255Octets); - - if (sblk->stat_EtherStatsPktsRx256Octetsto511Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx256Octetsto511Octets\n", - sblk->stat_EtherStatsPktsRx256Octetsto511Octets); - - if (sblk->stat_EtherStatsPktsRx512Octetsto1023Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx512Octetsto1023Octets\n", - sblk->stat_EtherStatsPktsRx512Octetsto1023Octets); - - if (sblk->stat_EtherStatsPktsRx1024Octetsto1522Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx1024Octetsto1522Octets\n", - sblk->stat_EtherStatsPktsRx1024Octetsto1522Octets); - - if (sblk->stat_EtherStatsPktsRx1523Octetsto9022Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx1523Octetsto9022Octets\n", - sblk->stat_EtherStatsPktsRx1523Octetsto9022Octets); - - if (sblk->stat_EtherStatsPktsTx64Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx64Octets\n", - sblk->stat_EtherStatsPktsTx64Octets); - - if (sblk->stat_EtherStatsPktsTx65Octetsto127Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx65Octetsto127Octets\n", - sblk->stat_EtherStatsPktsTx65Octetsto127Octets); - - if (sblk->stat_EtherStatsPktsTx128Octetsto255Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx128Octetsto255Octets\n", - sblk->stat_EtherStatsPktsTx128Octetsto255Octets); - - if (sblk->stat_EtherStatsPktsTx256Octetsto511Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx256Octetsto511Octets\n", - sblk->stat_EtherStatsPktsTx256Octetsto511Octets); - - if (sblk->stat_EtherStatsPktsTx512Octetsto1023Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx512Octetsto1023Octets\n", - sblk->stat_EtherStatsPktsTx512Octetsto1023Octets); - - if (sblk->stat_EtherStatsPktsTx1024Octetsto1522Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx1024Octetsto1522Octets\n", - sblk->stat_EtherStatsPktsTx1024Octetsto1522Octets); - - if (sblk->stat_EtherStatsPktsTx1523Octetsto9022Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx1523Octetsto9022Octets\n", - sblk->stat_EtherStatsPktsTx1523Octetsto9022Octets); - - if (sblk->stat_XonPauseFramesReceived) - BCE_PRINTF(" 0x%08X : XonPauseFramesReceived\n", - sblk->stat_XonPauseFramesReceived); - - if (sblk->stat_XoffPauseFramesReceived) - BCE_PRINTF(" 0x%08X : XoffPauseFramesReceived\n", - sblk->stat_XoffPauseFramesReceived); - - if (sblk->stat_OutXonSent) - BCE_PRINTF(" 0x%08X : OutXonSent\n", - sblk->stat_OutXonSent); - - if (sblk->stat_OutXoffSent) - BCE_PRINTF(" 0x%08X : OutXoffSent\n", - sblk->stat_OutXoffSent); - - if (sblk->stat_FlowControlDone) - BCE_PRINTF(" 0x%08X : FlowControlDone\n", - sblk->stat_FlowControlDone); - - if (sblk->stat_MacControlFramesReceived) - BCE_PRINTF(" 0x%08X : MacControlFramesReceived\n", - sblk->stat_MacControlFramesReceived); - - if (sblk->stat_XoffStateEntered) - BCE_PRINTF(" 0x%08X : XoffStateEntered\n", - sblk->stat_XoffStateEntered); - - if (sblk->stat_IfInFramesL2FilterDiscards) - BCE_PRINTF(" 0x%08X : IfInFramesL2FilterDiscards\n", - sblk->stat_IfInFramesL2FilterDiscards); - - if (sblk->stat_IfInRuleCheckerDiscards) - BCE_PRINTF(" 0x%08X : IfInRuleCheckerDiscards\n", - sblk->stat_IfInRuleCheckerDiscards); - - if (sblk->stat_IfInFTQDiscards) - BCE_PRINTF(" 0x%08X : IfInFTQDiscards\n", - sblk->stat_IfInFTQDiscards); - - if (sblk->stat_IfInMBUFDiscards) - BCE_PRINTF(" 0x%08X : IfInMBUFDiscards\n", - sblk->stat_IfInMBUFDiscards); - - if (sblk->stat_IfInRuleCheckerP4Hit) - BCE_PRINTF(" 0x%08X : IfInRuleCheckerP4Hit\n", - sblk->stat_IfInRuleCheckerP4Hit); - - if (sblk->stat_CatchupInRuleCheckerDiscards) - BCE_PRINTF(" 0x%08X : CatchupInRuleCheckerDiscards\n", - sblk->stat_CatchupInRuleCheckerDiscards); - - if (sblk->stat_CatchupInFTQDiscards) - BCE_PRINTF(" 0x%08X : CatchupInFTQDiscards\n", - sblk->stat_CatchupInFTQDiscards); - - if (sblk->stat_CatchupInMBUFDiscards) - BCE_PRINTF(" 0x%08X : CatchupInMBUFDiscards\n", - sblk->stat_CatchupInMBUFDiscards); - - if (sblk->stat_CatchupInRuleCheckerP4Hit) - BCE_PRINTF(" 0x%08X : CatchupInRuleCheckerP4Hit\n", - sblk->stat_CatchupInRuleCheckerP4Hit); + BCE_PRINT_64BIT_STAT(stat_IfHCInOctets); + BCE_PRINT_64BIT_STAT(stat_IfHCInBadOctets); + BCE_PRINT_64BIT_STAT(stat_IfHCOutOctets); + BCE_PRINT_64BIT_STAT(stat_IfHCOutBadOctets); + BCE_PRINT_64BIT_STAT(stat_IfHCInUcastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCInBroadcastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCInMulticastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCOutUcastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCOutBroadcastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCOutMulticastPkts); + BCE_PRINT_32BIT_STAT(stat_emac_tx_stat_dot3statsinternalmactransmiterrors); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsCarrierSenseErrors); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsFCSErrors); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsAlignmentErrors); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsSingleCollisionFrames); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsMultipleCollisionFrames); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsDeferredTransmissions); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsExcessiveCollisions); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsLateCollisions); + BCE_PRINT_32BIT_STAT(stat_EtherStatsCollisions); + BCE_PRINT_32BIT_STAT(stat_EtherStatsFragments); + BCE_PRINT_32BIT_STAT(stat_EtherStatsJabbers); + BCE_PRINT_32BIT_STAT(stat_EtherStatsUndersizePkts); + BCE_PRINT_32BIT_STAT(stat_EtherStatsOversizePkts); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx64Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx65Octetsto127Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx128Octetsto255Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx256Octetsto511Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx512Octetsto1023Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx1024Octetsto1522Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx1523Octetsto9022Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx64Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx65Octetsto127Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx128Octetsto255Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx256Octetsto511Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx512Octetsto1023Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx1024Octetsto1522Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx1523Octetsto9022Octets); + BCE_PRINT_32BIT_STAT(stat_XonPauseFramesReceived); + BCE_PRINT_32BIT_STAT(stat_XoffPauseFramesReceived); + BCE_PRINT_32BIT_STAT(stat_OutXonSent); + BCE_PRINT_32BIT_STAT(stat_OutXoffSent); + BCE_PRINT_32BIT_STAT(stat_FlowControlDone); + BCE_PRINT_32BIT_STAT(stat_MacControlFramesReceived); + BCE_PRINT_32BIT_STAT(stat_XoffStateEntered); + BCE_PRINT_32BIT_STAT(stat_IfInFramesL2FilterDiscards); + BCE_PRINT_32BIT_STAT(stat_IfInRuleCheckerDiscards); + BCE_PRINT_32BIT_STAT(stat_IfInFTQDiscards); + BCE_PRINT_32BIT_STAT(stat_IfInMBUFDiscards); + BCE_PRINT_32BIT_STAT(stat_IfInRuleCheckerP4Hit); + BCE_PRINT_32BIT_STAT(stat_CatchupInRuleCheckerDiscards); + BCE_PRINT_32BIT_STAT(stat_CatchupInFTQDiscards); + BCE_PRINT_32BIT_STAT(stat_CatchupInMBUFDiscards); + BCE_PRINT_32BIT_STAT(stat_CatchupInRuleCheckerP4Hit); BCE_PRINTF( "----------------------------" @@ -10465,7 +10312,7 @@ static __attribute__ ((noinline)) void bce_dump_com_state(struct bce_softc *sc, int regs) { u32 val; - u32 fw_version[3]; + u32 fw_version[4]; BCE_PRINTF( "----------------------------" @@ -10508,12 +10355,76 @@ bce_dump_com_state(struct bce_softc *sc, /****************************************************************************/ +/* Prints out the Receive Virtual 2 Physical (RV2P) state. */ +/* */ +/* Returns: */ +/* Nothing. */ +/****************************************************************************/ +static __attribute__ ((noinline)) void +bce_dump_rv2p_state(struct bce_softc *sc) +{ + u32 val, pc1, pc2, fw_ver_high, fw_ver_low; + + BCE_PRINTF( + "----------------------------" + " RV2P State " + "----------------------------\n"); + + /* Stall the RV2P processors. */ + val = REG_RD_IND(sc, BCE_RV2P_CONFIG); + val |= BCE_RV2P_CONFIG_STALL_PROC1 | BCE_RV2P_CONFIG_STALL_PROC2; + REG_WR_IND(sc, BCE_RV2P_CONFIG, val); + + /* Read the firmware version. */ + val = 0x00000001; + REG_WR_IND(sc, BCE_RV2P_PROC1_ADDR_CMD, val); + fw_ver_low = REG_RD_IND(sc, BCE_RV2P_INSTR_LOW); + fw_ver_high = REG_RD_IND(sc, BCE_RV2P_INSTR_HIGH) & BCE_RV2P_INSTR_HIGH_HIGH; + BCE_PRINTF("RV2P1 Firmware version - 0x%08X:0x%08X\n", fw_ver_high, fw_ver_low); + + val = 0x00000001; + REG_WR_IND(sc, BCE_RV2P_PROC2_ADDR_CMD, val); + fw_ver_low = REG_RD_IND(sc, BCE_RV2P_INSTR_LOW); + fw_ver_high = REG_RD_IND(sc, BCE_RV2P_INSTR_HIGH) & BCE_RV2P_INSTR_HIGH_HIGH; + BCE_PRINTF("RV2P2 Firmware version - 0x%08X:0x%08X\n", fw_ver_high, fw_ver_low); + + /* Resume the RV2P processors. */ + val = REG_RD_IND(sc, BCE_RV2P_CONFIG); + val &= ~(BCE_RV2P_CONFIG_STALL_PROC1 | BCE_RV2P_CONFIG_STALL_PROC2); + REG_WR_IND(sc, BCE_RV2P_CONFIG, val); + + /* Fetch the program counter value. */ + val = 0x68007800; + REG_WR_IND(sc, BCE_RV2P_DEBUG_VECT_PEEK, val); + val = REG_RD_IND(sc, BCE_RV2P_DEBUG_VECT_PEEK); + pc1 = (val & BCE_RV2P_DEBUG_VECT_PEEK_1_VALUE); + pc2 = (val & BCE_RV2P_DEBUG_VECT_PEEK_2_VALUE) >> 16; + BCE_PRINTF("0x%08X - RV2P1 program counter (1st read)\n", pc1); + BCE_PRINTF("0x%08X - RV2P2 program counter (1st read)\n", pc2); + + /* Fetch the program counter value again to see if it is advancing. */ + val = 0x68007800; + REG_WR_IND(sc, BCE_RV2P_DEBUG_VECT_PEEK, val); + val = REG_RD_IND(sc, BCE_RV2P_DEBUG_VECT_PEEK); + pc1 = (val & BCE_RV2P_DEBUG_VECT_PEEK_1_VALUE); + pc2 = (val & BCE_RV2P_DEBUG_VECT_PEEK_2_VALUE) >> 16; + BCE_PRINTF("0x%08X - RV2P1 program counter (2nd read)\n", pc1); + BCE_PRINTF("0x%08X - RV2P2 program counter (2nd read)\n", pc2); + + BCE_PRINTF( + "----------------------------" + "----------------" + "----------------------------\n"); +} + + +/****************************************************************************/ /* Prints out the driver state and then enters the debugger. */ /* */ /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static __attribute__ ((noinline)) void bce_breakpoint(struct bce_softc *sc) { @@ -10544,6 +10455,7 @@ bce_breakpoint(struct bce_softc *sc) bce_dump_tpat_state(sc, 0); bce_dump_cp_state(sc, 0); bce_dump_com_state(sc, 0); + bce_dump_rv2p_state(sc); #ifdef BCE_JUMBO_HDRSPLIT bce_dump_pgbd(sc, 0, NULL); bce_dump_pg_mbuf_chain(sc, 0, USABLE_PG_BD); Modified: stable/8/sys/dev/bce/if_bcefw.h ============================================================================== --- stable/8/sys/dev/bce/if_bcefw.h Thu Apr 15 19:22:55 2010 (r206679) +++ stable/8/sys/dev/bce/if_bcefw.h Thu Apr 15 19:26:28 2010 (r206680) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2009 Broadcom Corporation + * Copyright (c) 2006-2010 Broadcom Corporation * David Christensen . All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/8/sys/dev/bce/if_bcereg.h Thu Apr 15 19:22:55 2010 (r206679) +++ stable/8/sys/dev/bce/if_bcereg.h Thu Apr 15 19:26:28 2010 (r206680) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2009 Broadcom Corporation + * Copyright (c) 2006-2010 Broadcom Corporation * David Christensen . All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -453,24 +453,10 @@ } /* Announces function entry. */ -#if 0 -#define DBENTER(cond) \ - u32 start_time = REG_RD(sc, BCE_TIMER_25MHZ_FREE_RUN); \ - u32 end_time; \ - DBPRINT(sc, (cond), "%s(enter)\n", __FUNCTION__); -#endif - #define DBENTER(cond) \ DBPRINT(sc, (cond), "%s(enter)\n", __FUNCTION__) /* Announces function exit. */ -#if 0 -#define DBEXIT(cond, val) \ - end_time = REG_RD(sc, BCE_TIMER_25MHZ_FREE_RUN); \ - val += (u64) BCE_TIME_DELTA(start_time, end_time); \ - DBPRINT(sc, (cond), "%s(exit)\n", __FUNCTION__); -#endif - #define DBEXIT(cond) \ DBPRINT(sc, (cond), "%s(exit)\n", __FUNCTION__) @@ -6454,6 +6440,7 @@ struct bce_softc #define BCE_PHY_INT_MODE_MASK_FLAG 0x00000300 #define BCE_PHY_INT_MODE_AUTO_POLLING_FLAG 0x00000100 #define BCE_PHY_INT_MODE_LINK_READY_FLAG 0x00000200 +#define BCE_PHY_IEEE_CLAUSE_45_FLAG 0x00000400 /* Values that need to be shared with the PHY driver. */ u32 bce_shared_hw_cfg; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/140970: commit references a PR Date: Thu, 15 Apr 2010 19:28:29 +0000 (UTC) Author: yongari Date: Thu Apr 15 19:28:15 2010 New Revision: 206681 URL: http://svn.freebsd.org/changeset/base/206681 Log: MFC r205300: - Added support for 5709S/5716S PHYs. - Update copyright to 2010. - Add new debug code for RV2P block. - Improve output formatting for various debug functions. PR: kern/134658, kern/136417, kern/139761, kern/140970 Modified: stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/bce/if_bcefw.h stable/7/sys/dev/bce/if_bcereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Thu Apr 15 19:26:28 2010 (r206680) +++ stable/7/sys/dev/bce/if_bce.c Thu Apr 15 19:28:15 2010 (r206681) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2009 Broadcom Corporation + * Copyright (c) 2006-2010 Broadcom Corporation * David Christensen . All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); * BCM5708C B1, B2 * BCM5708S B1, B2 * BCM5709C A1, C0 + * BCM5709S A1, C0 * BCM5716C C0 + * BCM5716S C0 * * The following controllers are not supported by this driver: * BCM5706C A0, A1 (pre-production) @@ -46,7 +48,7 @@ __FBSDID("$FreeBSD$"); * BCM5708C A0, B0 (pre-production) * BCM5708S A0, B0 (pre-production) * BCM5709C A0 B0, B1, B2 (pre-production) - * BCM5709S A0, A1, B0, B1, B2, C0 (pre-production) + * BCM5709S A0, B0, B1, B2 (pre-production) */ #include "opt_bce.h" @@ -320,6 +322,7 @@ static void bce_dump_rxp_state (struct static void bce_dump_tpat_state (struct bce_softc *, int); static void bce_dump_cp_state (struct bce_softc *, int); static void bce_dump_com_state (struct bce_softc *, int); +static void bce_dump_rv2p_state (struct bce_softc *); static void bce_breakpoint (struct bce_softc *); #endif @@ -360,6 +363,7 @@ static int bce_nvram_write (struct bc /* */ /****************************************************************************/ static void bce_get_media (struct bce_softc *); +static void bce_init_media (struct bce_softc *); static void bce_dma_map_addr (void *, bus_dma_segment_t *, int, int); static int bce_dma_alloc (device_t); static void bce_dma_free (struct bce_softc *); @@ -1096,7 +1100,10 @@ bce_attach(device_t dev) else ifp->if_baudrate = IF_Mbps(1000); - /* Check for an MII child bus by probing the PHY. */ + /* Handle any special PHY initialization for SerDes PHYs. */ + bce_init_media(sc); + + /* MII child bus by probing the PHY. */ if (mii_phy_probe(dev, &sc->bce_miibus, bce_ifmedia_upd, bce_ifmedia_sts)) { BCE_PRINTF("%s(%d): No PHY found on child MII bus!\n", @@ -1504,7 +1511,17 @@ bce_miibus_read_reg(device_t dev, int ph return(0); } - if (sc->bce_phy_flags & BCE_PHY_INT_MODE_AUTO_POLLING_FLAG) { + /* + * The 5709S PHY is an IEEE Clause 45 PHY + * with special mappings to work with IEEE + * Clause 22 register accesses. + */ + if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { + if (reg >= MII_BMCR && reg <= MII_ANLPRNP) + reg += 0x10; + } + + if (sc->bce_phy_flags & BCE_PHY_INT_MODE_AUTO_POLLING_FLAG) { val = REG_RD(sc, BCE_EMAC_MDIO_MODE); val &= ~BCE_EMAC_MDIO_MODE_AUTO_POLL; @@ -1584,6 +1601,16 @@ bce_miibus_write_reg(device_t dev, int p DB_PRINT_PHY_REG(reg, val); + /* + * The 5709S PHY is an IEEE Clause 45 PHY + * with special mappings to work with IEEE + * Clause 22 register accesses. + */ + if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { + if (reg >= MII_BMCR && reg <= MII_ANLPRNP) + reg += 0x10; + } + if (sc->bce_phy_flags & BCE_PHY_INT_MODE_AUTO_POLLING_FLAG) { val1 = REG_RD(sc, BCE_EMAC_MDIO_MODE); val1 &= ~BCE_EMAC_MDIO_MODE_AUTO_POLL; @@ -2647,9 +2674,11 @@ bce_get_media(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_LOAD, "BCM5709 s/w configured for SerDes.\n"); sc->bce_phy_flags |= BCE_PHY_SERDES_FLAG; + break; default: DBPRINT(sc, BCE_INFO_LOAD, "BCM5709 s/w configured for Copper.\n"); + break; } } else { switch (strap) { @@ -2659,9 +2688,11 @@ bce_get_media(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_LOAD, "BCM5709 s/w configured for SerDes.\n"); sc->bce_phy_flags |= BCE_PHY_SERDES_FLAG; + break; default: DBPRINT(sc, BCE_INFO_LOAD, "BCM5709 s/w configured for Copper.\n"); + break; } } @@ -2669,15 +2700,22 @@ bce_get_media(struct bce_softc *sc) sc->bce_phy_flags |= BCE_PHY_SERDES_FLAG; if (sc->bce_phy_flags & BCE_PHY_SERDES_FLAG) { + sc->bce_flags |= BCE_NO_WOL_FLAG; - if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { + + /* 5708S, 5709S, and 5716S use a separate PHY for SerDes. */ + if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) sc->bce_phy_addr = 2; + + if (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) { + sc->bce_phy_flags |= BCE_PHY_IEEE_CLAUSE_45_FLAG; + val = bce_shmem_rd(sc, BCE_SHARED_HW_CFG_CONFIG); if (val & BCE_SHARED_HW_CFG_PHY_2_5G) { sc->bce_phy_flags |= BCE_PHY_2_5G_CAPABLE_FLAG; DBPRINT(sc, BCE_INFO_LOAD, "Found 2.5Gb capable adapter\n"); } - } + } } else if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5706) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5708)) sc->bce_phy_flags |= BCE_PHY_CRC_FIX_FLAG; @@ -2691,6 +2729,37 @@ bce_get_media_exit: /****************************************************************************/ +/* Performs PHY initialization required before MII drivers access the */ +/* device. */ +/* */ +/* Returns: */ +/* Nothing. */ +/****************************************************************************/ +static void +bce_init_media(struct bce_softc *sc) +{ + if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { + /* + * Configure 5709S/5716S PHYs to use traditional IEEE + * Clause 22 method. Otherwise we have no way to attach + * the PHY in mii(4) layer. PHY specific configuration + * is done in mii layer. + */ + + /* Select auto-negotiation MMD of the PHY. */ + bce_miibus_write_reg(sc->bce_dev, sc->bce_phy_addr, + BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_ADDR_EXT); + bce_miibus_write_reg(sc->bce_dev, sc->bce_phy_addr, + BRGPHY_ADDR_EXT, BRGPHY_ADDR_EXT_AN_MMD); + + /* Select IEEE0 block of AN MMD (assumed in all brgphy(4) code). */ + bce_miibus_write_reg(sc->bce_dev, sc->bce_phy_addr, + BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + } +} + + +/****************************************************************************/ /* Free any DMA memory owned by the driver. */ /* */ /* Scans through each data structre that requires DMA memory and frees */ @@ -6679,7 +6748,7 @@ bce_tso_setup(struct bce_softc *sc, stru DBPRINT(sc, BCE_EXTREME_SEND, "%s(): hdr_len = %d, e_hlen = %d, " "ip_hlen = %d, tcp_hlen = %d, ip_len = %d\n", - __FUNCTION__, hdr_len, sizeof(struct ether_header), ip_hlen, + __FUNCTION__, hdr_len, (int) sizeof(struct ether_header), ip_hlen, tcp_hlen, ip_len); /* Set the LSO flag in the TX BD */ @@ -7943,7 +8012,7 @@ bce_sysctl_dump_tx_chain(SYSCTL_HANDLER_ if (result == 1) { sc = (struct bce_softc *)arg1; - bce_dump_tx_chain(sc, 0, USABLE_TX_BD); + bce_dump_tx_chain(sc, 0, TOTAL_TX_BD); } return error; @@ -8626,7 +8695,7 @@ bce_add_sysctls(struct bce_softc *sc) /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static __attribute__ ((noinline)) void bce_freeze_controller(struct bce_softc *sc) { u32 val; @@ -8643,7 +8712,7 @@ bce_freeze_controller(struct bce_softc * /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static __attribute__ ((noinline)) void bce_unfreeze_controller(struct bce_softc *sc) { u32 val; @@ -8661,7 +8730,7 @@ bce_unfreeze_controller(struct bce_softc /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static __attribute__ ((noinline)) void bce_dump_enet(struct bce_softc *sc, struct mbuf *m) { struct ether_vlan_header *eh; @@ -8915,7 +8984,9 @@ bce_dump_pg_mbuf_chain(struct bce_softc static __attribute__ ((noinline)) void bce_dump_txbd(struct bce_softc *sc, int idx, struct tx_bd *txbd) { - if (idx > MAX_TX_BD) + int i = 0; + + if (idx > MAX_TX_BD) /* Index out of range. */ BCE_PRINTF("tx_bd[0x%04X]: Invalid tx_bd index!\n", idx); else if ((idx & USABLE_TX_BD_PER_PAGE) == USABLE_TX_BD_PER_PAGE) @@ -8923,52 +8994,65 @@ bce_dump_txbd(struct bce_softc *sc, int BCE_PRINTF("tx_bd[0x%04X]: haddr = 0x%08X:%08X, chain page pointer\n", idx, txbd->tx_bd_haddr_hi, txbd->tx_bd_haddr_lo); else { - /* Normal tx_bd entry. */ - BCE_PRINTF("tx_bd[0x%04X]: haddr = 0x%08X:%08X, nbytes = 0x%08X, " - "vlan tag= 0x%04X, flags = 0x%04X (", idx, - txbd->tx_bd_haddr_hi, txbd->tx_bd_haddr_lo, - txbd->tx_bd_mss_nbytes, txbd->tx_bd_vlan_tag, - txbd->tx_bd_flags); - - if (txbd->tx_bd_flags & TX_BD_FLAGS_CONN_FAULT) - printf(" CONN_FAULT"); - - if (txbd->tx_bd_flags & TX_BD_FLAGS_TCP_UDP_CKSUM) - printf(" TCP_UDP_CKSUM"); + /* Normal tx_bd entry. */ + BCE_PRINTF("tx_bd[0x%04X]: haddr = 0x%08X:%08X, mss_nbytes = 0x%08X, " + "vlan tag = 0x%04X, flags = 0x%04X (", idx, + txbd->tx_bd_haddr_hi, txbd->tx_bd_haddr_lo, + txbd->tx_bd_mss_nbytes, txbd->tx_bd_vlan_tag, + txbd->tx_bd_flags); - if (txbd->tx_bd_flags & TX_BD_FLAGS_IP_CKSUM) - printf(" IP_CKSUM"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_CONN_FAULT) { + if (i>0) printf("|"); printf("CONN_FAULT"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_VLAN_TAG) - printf(" VLAN"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_TCP_UDP_CKSUM) { + if (i>0) printf("|"); printf("TCP_UDP_CKSUM"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_COAL_NOW) - printf(" COAL_NOW"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_IP_CKSUM) { + if (i>0) printf("|"); printf("IP_CKSUM"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_DONT_GEN_CRC) - printf(" DONT_GEN_CRC"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_VLAN_TAG) { + if (i>0) printf("|"); printf("VLAN"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_START) - printf(" START"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_COAL_NOW) { + if (i>0) printf("|"); printf("COAL_NOW"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_END) - printf(" END"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_DONT_GEN_CRC) { + if (i>0) printf("|"); printf("DONT_GEN_CRC"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_LSO) - printf(" LSO"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_START) { + if (i>0) printf("|"); printf("START"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_OPTION_WORD) - printf(" OPTION_WORD"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_END) { + if (i>0) printf("|"); printf("END"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_FLAGS) - printf(" FLAGS"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_LSO) { + if (i>0) printf("|"); printf("LSO"); i++; + } - if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_SNAP) - printf(" SNAP"); + if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_OPTION_WORD) { + if (i>0) printf("|"); + printf("SW_OPTION=%d", ((txbd->tx_bd_flags & + TX_BD_FLAGS_SW_OPTION_WORD) >> 8)); i++; + } - printf(" )\n"); - } + if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_FLAGS) { + if (i>0) printf("|"); printf("SW_FLAGS"); i++; + } + if (txbd->tx_bd_flags & TX_BD_FLAGS_SW_SNAP) { + if (i>0) printf("|"); printf("SNAP)"); + } else { + printf(")\n"); + } + } } @@ -9415,10 +9499,8 @@ bce_dump_tx_chain(struct bce_softc *sc, BCE_PRINTF("page size = 0x%08X, tx chain pages = 0x%08X\n", (u32) BCM_PAGE_SIZE, (u32) TX_PAGES); - BCE_PRINTF("tx_bd per page = 0x%08X, usable tx_bd per page = 0x%08X\n", (u32) TOTAL_TX_BD_PER_PAGE, (u32) USABLE_TX_BD_PER_PAGE); - BCE_PRINTF("total tx_bd = 0x%08X\n", (u32) TOTAL_TX_BD); BCE_PRINTF( @@ -9426,11 +9508,11 @@ bce_dump_tx_chain(struct bce_softc *sc, " tx_bd data " "----------------------------\n"); - /* Now print out the tx_bd's themselves. */ + /* Now print out a decoded list of TX buffer descriptors. */ for (int i = 0; i < count; i++) { txbd = &sc->tx_bd_chain[TX_PAGE(tx_prod)][TX_IDX(tx_prod)]; bce_dump_txbd(sc, tx_prod, txbd); - tx_prod = NEXT_TX_BD(tx_prod); + tx_prod++; } BCE_PRINTF( @@ -9530,6 +9612,17 @@ bce_dump_pg_chain(struct bce_softc *sc, } #endif +#define BCE_PRINT_RX_CONS(arg) \ +if (sblk->status_rx_quick_consumer_index##arg) \ + BCE_PRINTF("0x%04X(0x%04X) - rx_quick_consumer_index##arg\n", \ + sblk->status_rx_quick_consumer_index##arg, \ + (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index##arg)); + +#define BCE_PRINT_TX_CONS(arg) \ +if (sblk->status_tx_quick_consumer_index##arg) \ + BCE_PRINTF("0x%04X(0x%04X) - tx_quick_consumer_index##arg\n", \ + sblk->status_tx_quick_consumer_index##arg, \ + (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index##arg)); /****************************************************************************/ /* Prints out the status block from host memory. */ @@ -9549,90 +9642,28 @@ bce_dump_status_block(struct bce_softc * " Status Block " "----------------------------\n"); + /* Theses indices are used for normal L2 drivers. */ BCE_PRINTF(" 0x%08X - attn_bits\n", sblk->status_attn_bits); BCE_PRINTF(" 0x%08X - attn_bits_ack\n", sblk->status_attn_bits_ack); - BCE_PRINTF("0x%04X(0x%04X) - rx_cons0\n", - sblk->status_rx_quick_consumer_index0, - (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index0)); - - BCE_PRINTF("0x%04X(0x%04X) - tx_cons0\n", - sblk->status_tx_quick_consumer_index0, - (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index0)); + BCE_PRINT_RX_CONS(0); + BCE_PRINT_TX_CONS(0) BCE_PRINTF(" 0x%04X - status_idx\n", sblk->status_idx); /* Theses indices are not used for normal L2 drivers. */ - if (sblk->status_rx_quick_consumer_index1) - BCE_PRINTF("0x%04X(0x%04X) - rx_cons1\n", - sblk->status_rx_quick_consumer_index1, - (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index1)); - - if (sblk->status_tx_quick_consumer_index1) - BCE_PRINTF("0x%04X(0x%04X) - tx_cons1\n", - sblk->status_tx_quick_consumer_index1, - (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index1)); - - if (sblk->status_rx_quick_consumer_index2) - BCE_PRINTF("0x%04X(0x%04X)- rx_cons2\n", - sblk->status_rx_quick_consumer_index2, - (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index2)); - - if (sblk->status_tx_quick_consumer_index2) - BCE_PRINTF("0x%04X(0x%04X) - tx_cons2\n", - sblk->status_tx_quick_consumer_index2, - (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index2)); - - if (sblk->status_rx_quick_consumer_index3) - BCE_PRINTF("0x%04X(0x%04X) - rx_cons3\n", - sblk->status_rx_quick_consumer_index3, - (u16) RX_CHAIN_IDX(sblk->status_rx_quick_consumer_index3)); - - if (sblk->status_tx_quick_consumer_index3) - BCE_PRINTF("0x%04X(0x%04X) - tx_cons3\n", - sblk->status_tx_quick_consumer_index3, - (u16) TX_CHAIN_IDX(sblk->status_tx_quick_consumer_index3)); - - if (sblk->status_rx_quick_consumer_index4 || - sblk->status_rx_quick_consumer_index5) - BCE_PRINTF("rx_cons4 = 0x%08X, rx_cons5 = 0x%08X\n", - sblk->status_rx_quick_consumer_index4, - sblk->status_rx_quick_consumer_index5); - - if (sblk->status_rx_quick_consumer_index6 || - sblk->status_rx_quick_consumer_index7) - BCE_PRINTF("rx_cons6 = 0x%08X, rx_cons7 = 0x%08X\n", - sblk->status_rx_quick_consumer_index6, - sblk->status_rx_quick_consumer_index7); - - if (sblk->status_rx_quick_consumer_index8 || - sblk->status_rx_quick_consumer_index9) - BCE_PRINTF("rx_cons8 = 0x%08X, rx_cons9 = 0x%08X\n", - sblk->status_rx_quick_consumer_index8, - sblk->status_rx_quick_consumer_index9); - - if (sblk->status_rx_quick_consumer_index10 || - sblk->status_rx_quick_consumer_index11) - BCE_PRINTF("rx_cons10 = 0x%08X, rx_cons11 = 0x%08X\n", - sblk->status_rx_quick_consumer_index10, - sblk->status_rx_quick_consumer_index11); - - if (sblk->status_rx_quick_consumer_index12 || - sblk->status_rx_quick_consumer_index13) - BCE_PRINTF("rx_cons12 = 0x%08X, rx_cons13 = 0x%08X\n", - sblk->status_rx_quick_consumer_index12, - sblk->status_rx_quick_consumer_index13); - - if (sblk->status_rx_quick_consumer_index14 || - sblk->status_rx_quick_consumer_index15) - BCE_PRINTF("rx_cons14 = 0x%08X, rx_cons15 = 0x%08X\n", - sblk->status_rx_quick_consumer_index14, - sblk->status_rx_quick_consumer_index15); + BCE_PRINT_RX_CONS(1); BCE_PRINT_RX_CONS(2); BCE_PRINT_RX_CONS(3); + BCE_PRINT_RX_CONS(4); BCE_PRINT_RX_CONS(5); BCE_PRINT_RX_CONS(6); + BCE_PRINT_RX_CONS(7); BCE_PRINT_RX_CONS(8); BCE_PRINT_RX_CONS(9); + BCE_PRINT_RX_CONS(10); BCE_PRINT_RX_CONS(11); BCE_PRINT_RX_CONS(12); + BCE_PRINT_RX_CONS(13); BCE_PRINT_RX_CONS(14); BCE_PRINT_RX_CONS(15); - if (sblk->status_completion_producer_index || + BCE_PRINT_TX_CONS(1); BCE_PRINT_TX_CONS(2); BCE_PRINT_TX_CONS(3); + + if (sblk->status_completion_producer_index || sblk->status_cmd_consumer_index) BCE_PRINTF("com_prod = 0x%08X, cmd_cons = 0x%08X\n", sblk->status_completion_producer_index, @@ -9645,6 +9676,14 @@ bce_dump_status_block(struct bce_softc * } +#define BCE_PRINT_64BIT_STAT(arg) \ +if (sblk->arg##_lo || sblk->arg##_hi) \ + BCE_PRINTF("0x%08X:%08X : arg\n", sblk->arg##_hi, sblk->arg##_lo); + +#define BCE_PRINT_32BIT_STAT(arg) \ +if (sblk->arg) \ + BCE_PRINTF(" 0x%08X : arg\n", sblk->arg); + /****************************************************************************/ /* Prints out the statistics block from host memory. */ /* */ @@ -9663,252 +9702,60 @@ bce_dump_stats_block(struct bce_softc *s " Stats Block (All Stats Not Shown Are 0) " "---------------\n"); - if (sblk->stat_IfHCInOctets_hi - || sblk->stat_IfHCInOctets_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInOctets\n", - sblk->stat_IfHCInOctets_hi, - sblk->stat_IfHCInOctets_lo); - - if (sblk->stat_IfHCInBadOctets_hi - || sblk->stat_IfHCInBadOctets_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInBadOctets\n", - sblk->stat_IfHCInBadOctets_hi, - sblk->stat_IfHCInBadOctets_lo); - - if (sblk->stat_IfHCOutOctets_hi - || sblk->stat_IfHCOutOctets_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutOctets\n", - sblk->stat_IfHCOutOctets_hi, - sblk->stat_IfHCOutOctets_lo); - - if (sblk->stat_IfHCOutBadOctets_hi - || sblk->stat_IfHCOutBadOctets_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutBadOctets\n", - sblk->stat_IfHCOutBadOctets_hi, - sblk->stat_IfHCOutBadOctets_lo); - - if (sblk->stat_IfHCInUcastPkts_hi - || sblk->stat_IfHCInUcastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInUcastPkts\n", - sblk->stat_IfHCInUcastPkts_hi, - sblk->stat_IfHCInUcastPkts_lo); - - if (sblk->stat_IfHCInBroadcastPkts_hi - || sblk->stat_IfHCInBroadcastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInBroadcastPkts\n", - sblk->stat_IfHCInBroadcastPkts_hi, - sblk->stat_IfHCInBroadcastPkts_lo); - - if (sblk->stat_IfHCInMulticastPkts_hi - || sblk->stat_IfHCInMulticastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcInMulticastPkts\n", - sblk->stat_IfHCInMulticastPkts_hi, - sblk->stat_IfHCInMulticastPkts_lo); - - if (sblk->stat_IfHCOutUcastPkts_hi - || sblk->stat_IfHCOutUcastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutUcastPkts\n", - sblk->stat_IfHCOutUcastPkts_hi, - sblk->stat_IfHCOutUcastPkts_lo); - - if (sblk->stat_IfHCOutBroadcastPkts_hi - || sblk->stat_IfHCOutBroadcastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutBroadcastPkts\n", - sblk->stat_IfHCOutBroadcastPkts_hi, - sblk->stat_IfHCOutBroadcastPkts_lo); - - if (sblk->stat_IfHCOutMulticastPkts_hi - || sblk->stat_IfHCOutMulticastPkts_lo) - BCE_PRINTF("0x%08X:%08X : " - "IfHcOutMulticastPkts\n", - sblk->stat_IfHCOutMulticastPkts_hi, - sblk->stat_IfHCOutMulticastPkts_lo); - - if (sblk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors) - BCE_PRINTF(" 0x%08X : " - "emac_tx_stat_dot3statsinternalmactransmiterrors\n", - sblk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors); - - if (sblk->stat_Dot3StatsCarrierSenseErrors) - BCE_PRINTF(" 0x%08X : Dot3StatsCarrierSenseErrors\n", - sblk->stat_Dot3StatsCarrierSenseErrors); - - if (sblk->stat_Dot3StatsFCSErrors) - BCE_PRINTF(" 0x%08X : Dot3StatsFCSErrors\n", - sblk->stat_Dot3StatsFCSErrors); - - if (sblk->stat_Dot3StatsAlignmentErrors) - BCE_PRINTF(" 0x%08X : Dot3StatsAlignmentErrors\n", - sblk->stat_Dot3StatsAlignmentErrors); - - if (sblk->stat_Dot3StatsSingleCollisionFrames) - BCE_PRINTF(" 0x%08X : Dot3StatsSingleCollisionFrames\n", - sblk->stat_Dot3StatsSingleCollisionFrames); - - if (sblk->stat_Dot3StatsMultipleCollisionFrames) - BCE_PRINTF(" 0x%08X : Dot3StatsMultipleCollisionFrames\n", - sblk->stat_Dot3StatsMultipleCollisionFrames); - - if (sblk->stat_Dot3StatsDeferredTransmissions) - BCE_PRINTF(" 0x%08X : Dot3StatsDeferredTransmissions\n", - sblk->stat_Dot3StatsDeferredTransmissions); - - if (sblk->stat_Dot3StatsExcessiveCollisions) - BCE_PRINTF(" 0x%08X : Dot3StatsExcessiveCollisions\n", - sblk->stat_Dot3StatsExcessiveCollisions); - - if (sblk->stat_Dot3StatsLateCollisions) - BCE_PRINTF(" 0x%08X : Dot3StatsLateCollisions\n", - sblk->stat_Dot3StatsLateCollisions); - - if (sblk->stat_EtherStatsCollisions) - BCE_PRINTF(" 0x%08X : EtherStatsCollisions\n", - sblk->stat_EtherStatsCollisions); - - if (sblk->stat_EtherStatsFragments) - BCE_PRINTF(" 0x%08X : EtherStatsFragments\n", - sblk->stat_EtherStatsFragments); - - if (sblk->stat_EtherStatsJabbers) - BCE_PRINTF(" 0x%08X : EtherStatsJabbers\n", - sblk->stat_EtherStatsJabbers); - - if (sblk->stat_EtherStatsUndersizePkts) - BCE_PRINTF(" 0x%08X : EtherStatsUndersizePkts\n", - sblk->stat_EtherStatsUndersizePkts); - - if (sblk->stat_EtherStatsOversizePkts) - BCE_PRINTF(" 0x%08X : EtherStatsOverrsizePkts\n", - sblk->stat_EtherStatsOversizePkts); - - if (sblk->stat_EtherStatsPktsRx64Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx64Octets\n", - sblk->stat_EtherStatsPktsRx64Octets); - - if (sblk->stat_EtherStatsPktsRx65Octetsto127Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx65Octetsto127Octets\n", - sblk->stat_EtherStatsPktsRx65Octetsto127Octets); - - if (sblk->stat_EtherStatsPktsRx128Octetsto255Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx128Octetsto255Octets\n", - sblk->stat_EtherStatsPktsRx128Octetsto255Octets); - - if (sblk->stat_EtherStatsPktsRx256Octetsto511Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx256Octetsto511Octets\n", - sblk->stat_EtherStatsPktsRx256Octetsto511Octets); - - if (sblk->stat_EtherStatsPktsRx512Octetsto1023Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx512Octetsto1023Octets\n", - sblk->stat_EtherStatsPktsRx512Octetsto1023Octets); - - if (sblk->stat_EtherStatsPktsRx1024Octetsto1522Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx1024Octetsto1522Octets\n", - sblk->stat_EtherStatsPktsRx1024Octetsto1522Octets); - - if (sblk->stat_EtherStatsPktsRx1523Octetsto9022Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsRx1523Octetsto9022Octets\n", - sblk->stat_EtherStatsPktsRx1523Octetsto9022Octets); - - if (sblk->stat_EtherStatsPktsTx64Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx64Octets\n", - sblk->stat_EtherStatsPktsTx64Octets); - - if (sblk->stat_EtherStatsPktsTx65Octetsto127Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx65Octetsto127Octets\n", - sblk->stat_EtherStatsPktsTx65Octetsto127Octets); - - if (sblk->stat_EtherStatsPktsTx128Octetsto255Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx128Octetsto255Octets\n", - sblk->stat_EtherStatsPktsTx128Octetsto255Octets); - - if (sblk->stat_EtherStatsPktsTx256Octetsto511Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx256Octetsto511Octets\n", - sblk->stat_EtherStatsPktsTx256Octetsto511Octets); - - if (sblk->stat_EtherStatsPktsTx512Octetsto1023Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx512Octetsto1023Octets\n", - sblk->stat_EtherStatsPktsTx512Octetsto1023Octets); - - if (sblk->stat_EtherStatsPktsTx1024Octetsto1522Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx1024Octetsto1522Octets\n", - sblk->stat_EtherStatsPktsTx1024Octetsto1522Octets); - - if (sblk->stat_EtherStatsPktsTx1523Octetsto9022Octets) - BCE_PRINTF(" 0x%08X : EtherStatsPktsTx1523Octetsto9022Octets\n", - sblk->stat_EtherStatsPktsTx1523Octetsto9022Octets); - - if (sblk->stat_XonPauseFramesReceived) - BCE_PRINTF(" 0x%08X : XonPauseFramesReceived\n", - sblk->stat_XonPauseFramesReceived); - - if (sblk->stat_XoffPauseFramesReceived) - BCE_PRINTF(" 0x%08X : XoffPauseFramesReceived\n", - sblk->stat_XoffPauseFramesReceived); - - if (sblk->stat_OutXonSent) - BCE_PRINTF(" 0x%08X : OutXonSent\n", - sblk->stat_OutXonSent); - - if (sblk->stat_OutXoffSent) - BCE_PRINTF(" 0x%08X : OutXoffSent\n", - sblk->stat_OutXoffSent); - - if (sblk->stat_FlowControlDone) - BCE_PRINTF(" 0x%08X : FlowControlDone\n", - sblk->stat_FlowControlDone); - - if (sblk->stat_MacControlFramesReceived) - BCE_PRINTF(" 0x%08X : MacControlFramesReceived\n", - sblk->stat_MacControlFramesReceived); - - if (sblk->stat_XoffStateEntered) - BCE_PRINTF(" 0x%08X : XoffStateEntered\n", - sblk->stat_XoffStateEntered); - - if (sblk->stat_IfInFramesL2FilterDiscards) - BCE_PRINTF(" 0x%08X : IfInFramesL2FilterDiscards\n", - sblk->stat_IfInFramesL2FilterDiscards); - - if (sblk->stat_IfInRuleCheckerDiscards) - BCE_PRINTF(" 0x%08X : IfInRuleCheckerDiscards\n", - sblk->stat_IfInRuleCheckerDiscards); - - if (sblk->stat_IfInFTQDiscards) - BCE_PRINTF(" 0x%08X : IfInFTQDiscards\n", - sblk->stat_IfInFTQDiscards); - - if (sblk->stat_IfInMBUFDiscards) - BCE_PRINTF(" 0x%08X : IfInMBUFDiscards\n", - sblk->stat_IfInMBUFDiscards); - - if (sblk->stat_IfInRuleCheckerP4Hit) - BCE_PRINTF(" 0x%08X : IfInRuleCheckerP4Hit\n", - sblk->stat_IfInRuleCheckerP4Hit); - - if (sblk->stat_CatchupInRuleCheckerDiscards) - BCE_PRINTF(" 0x%08X : CatchupInRuleCheckerDiscards\n", - sblk->stat_CatchupInRuleCheckerDiscards); - - if (sblk->stat_CatchupInFTQDiscards) - BCE_PRINTF(" 0x%08X : CatchupInFTQDiscards\n", - sblk->stat_CatchupInFTQDiscards); - - if (sblk->stat_CatchupInMBUFDiscards) - BCE_PRINTF(" 0x%08X : CatchupInMBUFDiscards\n", - sblk->stat_CatchupInMBUFDiscards); - - if (sblk->stat_CatchupInRuleCheckerP4Hit) - BCE_PRINTF(" 0x%08X : CatchupInRuleCheckerP4Hit\n", - sblk->stat_CatchupInRuleCheckerP4Hit); + BCE_PRINT_64BIT_STAT(stat_IfHCInOctets); + BCE_PRINT_64BIT_STAT(stat_IfHCInBadOctets); + BCE_PRINT_64BIT_STAT(stat_IfHCOutOctets); + BCE_PRINT_64BIT_STAT(stat_IfHCOutBadOctets); + BCE_PRINT_64BIT_STAT(stat_IfHCInUcastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCInBroadcastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCInMulticastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCOutUcastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCOutBroadcastPkts); + BCE_PRINT_64BIT_STAT(stat_IfHCOutMulticastPkts); + BCE_PRINT_32BIT_STAT(stat_emac_tx_stat_dot3statsinternalmactransmiterrors); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsCarrierSenseErrors); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsFCSErrors); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsAlignmentErrors); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsSingleCollisionFrames); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsMultipleCollisionFrames); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsDeferredTransmissions); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsExcessiveCollisions); + BCE_PRINT_32BIT_STAT(stat_Dot3StatsLateCollisions); + BCE_PRINT_32BIT_STAT(stat_EtherStatsCollisions); + BCE_PRINT_32BIT_STAT(stat_EtherStatsFragments); + BCE_PRINT_32BIT_STAT(stat_EtherStatsJabbers); + BCE_PRINT_32BIT_STAT(stat_EtherStatsUndersizePkts); + BCE_PRINT_32BIT_STAT(stat_EtherStatsOversizePkts); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx64Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx65Octetsto127Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx128Octetsto255Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx256Octetsto511Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx512Octetsto1023Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx1024Octetsto1522Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsRx1523Octetsto9022Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx64Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx65Octetsto127Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx128Octetsto255Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx256Octetsto511Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx512Octetsto1023Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx1024Octetsto1522Octets); + BCE_PRINT_32BIT_STAT(stat_EtherStatsPktsTx1523Octetsto9022Octets); + BCE_PRINT_32BIT_STAT(stat_XonPauseFramesReceived); + BCE_PRINT_32BIT_STAT(stat_XoffPauseFramesReceived); + BCE_PRINT_32BIT_STAT(stat_OutXonSent); + BCE_PRINT_32BIT_STAT(stat_OutXoffSent); + BCE_PRINT_32BIT_STAT(stat_FlowControlDone); + BCE_PRINT_32BIT_STAT(stat_MacControlFramesReceived); + BCE_PRINT_32BIT_STAT(stat_XoffStateEntered); + BCE_PRINT_32BIT_STAT(stat_IfInFramesL2FilterDiscards); + BCE_PRINT_32BIT_STAT(stat_IfInRuleCheckerDiscards); + BCE_PRINT_32BIT_STAT(stat_IfInFTQDiscards); + BCE_PRINT_32BIT_STAT(stat_IfInMBUFDiscards); + BCE_PRINT_32BIT_STAT(stat_IfInRuleCheckerP4Hit); + BCE_PRINT_32BIT_STAT(stat_CatchupInRuleCheckerDiscards); + BCE_PRINT_32BIT_STAT(stat_CatchupInFTQDiscards); + BCE_PRINT_32BIT_STAT(stat_CatchupInMBUFDiscards); + BCE_PRINT_32BIT_STAT(stat_CatchupInRuleCheckerP4Hit); BCE_PRINTF( "----------------------------" @@ -10465,7 +10312,7 @@ static __attribute__ ((noinline)) void bce_dump_com_state(struct bce_softc *sc, int regs) { u32 val; - u32 fw_version[3]; + u32 fw_version[4]; BCE_PRINTF( "----------------------------" @@ -10508,12 +10355,76 @@ bce_dump_com_state(struct bce_softc *sc, /****************************************************************************/ +/* Prints out the Receive Virtual 2 Physical (RV2P) state. */ +/* */ +/* Returns: */ +/* Nothing. */ +/****************************************************************************/ +static __attribute__ ((noinline)) void +bce_dump_rv2p_state(struct bce_softc *sc) +{ + u32 val, pc1, pc2, fw_ver_high, fw_ver_low; + + BCE_PRINTF( + "----------------------------" + " RV2P State " + "----------------------------\n"); + + /* Stall the RV2P processors. */ + val = REG_RD_IND(sc, BCE_RV2P_CONFIG); + val |= BCE_RV2P_CONFIG_STALL_PROC1 | BCE_RV2P_CONFIG_STALL_PROC2; + REG_WR_IND(sc, BCE_RV2P_CONFIG, val); + + /* Read the firmware version. */ + val = 0x00000001; + REG_WR_IND(sc, BCE_RV2P_PROC1_ADDR_CMD, val); + fw_ver_low = REG_RD_IND(sc, BCE_RV2P_INSTR_LOW); + fw_ver_high = REG_RD_IND(sc, BCE_RV2P_INSTR_HIGH) & BCE_RV2P_INSTR_HIGH_HIGH; + BCE_PRINTF("RV2P1 Firmware version - 0x%08X:0x%08X\n", fw_ver_high, fw_ver_low); + + val = 0x00000001; + REG_WR_IND(sc, BCE_RV2P_PROC2_ADDR_CMD, val); + fw_ver_low = REG_RD_IND(sc, BCE_RV2P_INSTR_LOW); + fw_ver_high = REG_RD_IND(sc, BCE_RV2P_INSTR_HIGH) & BCE_RV2P_INSTR_HIGH_HIGH; + BCE_PRINTF("RV2P2 Firmware version - 0x%08X:0x%08X\n", fw_ver_high, fw_ver_low); + + /* Resume the RV2P processors. */ + val = REG_RD_IND(sc, BCE_RV2P_CONFIG); + val &= ~(BCE_RV2P_CONFIG_STALL_PROC1 | BCE_RV2P_CONFIG_STALL_PROC2); + REG_WR_IND(sc, BCE_RV2P_CONFIG, val); + + /* Fetch the program counter value. */ + val = 0x68007800; + REG_WR_IND(sc, BCE_RV2P_DEBUG_VECT_PEEK, val); + val = REG_RD_IND(sc, BCE_RV2P_DEBUG_VECT_PEEK); + pc1 = (val & BCE_RV2P_DEBUG_VECT_PEEK_1_VALUE); + pc2 = (val & BCE_RV2P_DEBUG_VECT_PEEK_2_VALUE) >> 16; + BCE_PRINTF("0x%08X - RV2P1 program counter (1st read)\n", pc1); + BCE_PRINTF("0x%08X - RV2P2 program counter (1st read)\n", pc2); + + /* Fetch the program counter value again to see if it is advancing. */ + val = 0x68007800; + REG_WR_IND(sc, BCE_RV2P_DEBUG_VECT_PEEK, val); + val = REG_RD_IND(sc, BCE_RV2P_DEBUG_VECT_PEEK); + pc1 = (val & BCE_RV2P_DEBUG_VECT_PEEK_1_VALUE); + pc2 = (val & BCE_RV2P_DEBUG_VECT_PEEK_2_VALUE) >> 16; + BCE_PRINTF("0x%08X - RV2P1 program counter (2nd read)\n", pc1); + BCE_PRINTF("0x%08X - RV2P2 program counter (2nd read)\n", pc2); + + BCE_PRINTF( + "----------------------------" + "----------------" + "----------------------------\n"); +} + + +/****************************************************************************/ /* Prints out the driver state and then enters the debugger. */ /* */ /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static __attribute__ ((noinline)) void bce_breakpoint(struct bce_softc *sc) { @@ -10544,6 +10455,7 @@ bce_breakpoint(struct bce_softc *sc) bce_dump_tpat_state(sc, 0); bce_dump_cp_state(sc, 0); bce_dump_com_state(sc, 0); + bce_dump_rv2p_state(sc); #ifdef BCE_JUMBO_HDRSPLIT bce_dump_pgbd(sc, 0, NULL); bce_dump_pg_mbuf_chain(sc, 0, USABLE_PG_BD); Modified: stable/7/sys/dev/bce/if_bcefw.h ============================================================================== --- stable/7/sys/dev/bce/if_bcefw.h Thu Apr 15 19:26:28 2010 (r206680) +++ stable/7/sys/dev/bce/if_bcefw.h Thu Apr 15 19:28:15 2010 (r206681) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2009 Broadcom Corporation + * Copyright (c) 2006-2010 Broadcom Corporation * David Christensen . All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/7/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/7/sys/dev/bce/if_bcereg.h Thu Apr 15 19:26:28 2010 (r206680) +++ stable/7/sys/dev/bce/if_bcereg.h Thu Apr 15 19:28:15 2010 (r206681) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2009 Broadcom Corporation + * Copyright (c) 2006-2010 Broadcom Corporation * David Christensen . All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -453,24 +453,10 @@ } /* Announces function entry. */ -#if 0 -#define DBENTER(cond) \ - u32 start_time = REG_RD(sc, BCE_TIMER_25MHZ_FREE_RUN); \ - u32 end_time; \ - DBPRINT(sc, (cond), "%s(enter)\n", __FUNCTION__); -#endif - #define DBENTER(cond) \ DBPRINT(sc, (cond), "%s(enter)\n", __FUNCTION__) /* Announces function exit. */ -#if 0 -#define DBEXIT(cond, val) \ - end_time = REG_RD(sc, BCE_TIMER_25MHZ_FREE_RUN); \ - val += (u64) BCE_TIME_DELTA(start_time, end_time); \ - DBPRINT(sc, (cond), "%s(exit)\n", __FUNCTION__); -#endif - #define DBEXIT(cond) \ DBPRINT(sc, (cond), "%s(exit)\n", __FUNCTION__) @@ -6451,6 +6437,7 @@ struct bce_softc #define BCE_PHY_INT_MODE_MASK_FLAG 0x00000300 #define BCE_PHY_INT_MODE_AUTO_POLLING_FLAG 0x00000100 #define BCE_PHY_INT_MODE_LINK_READY_FLAG 0x00000200 +#define BCE_PHY_IEEE_CLAUSE_45_FLAG 0x00000400 /* Values that need to be shared with the PHY driver. */ u32 bce_shared_hw_cfg; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State-Changed-From-To: patched->closed State-Changed-By: yongari State-Changed-When: Thu Apr 15 20:42:35 UTC 2010 State-Changed-Why: MFC complete. Thanks for reporting! http://www.freebsd.org/cgi/query-pr.cgi?pr=140970 >Unformatted: