# Turn on /var/log/rc.log file to troubleshoot Ethernet

## mojosam

My Ethernet card is not recognized by my system. I suspect I need to download a driver or something. The Handbook says:

 *Quote:*   

> When troubleshooting networking, take a look at /var/log/rc.log. Unless the rc_logger variable is set to NO in /etc/rc.conf, information on the boot activity will be stored in that log file.

 

So I edited my /etc/rc.conf file to say rc_logger='YES'. Then I rebooted. My /var/log/rc.log does not exist.  :Sad: 

There is a note in the /etc/rc.conf file about devfs needing to be on. I looked into that and saw that devfs has been replaced by udev. Is there something I need to do to udev to get the logging to happen?

----------

## pjp

Is rc_log_path set in rc.conf?

If you need a driver, then I doubt changing rc logging will help. Booting to an install should allow you to use lspci to see what hardware you have. With that information, it should be possible to determine if the kernel has support for your hardware. Do you know vendor and model of the NIC?

----------

## mojosam

 *Quote:*   

> Is rc_log_path set in rc.conf?

 

Aha! Those sneaks! But you are correct. Now that I have the log working, there are no networking errors in it. I was also interested in several other errors that fly by on bootup, but those are not in the log either.

 *Quote:*   

> Do you know vendor and model of the NIC?

 

lspci tells me that my two network cards are:

```
09:00.0 Ethernet controller: Broadcom Inc. and subsidiaries NetXtreme BCM57760 Gigabit Ethernet PCIe (rev 01)

0c:00.0 Network controller: Broadcom Inc. and subsidiaries BCM4313 802.11bgn Wireless Network Adapter (rev 01)
```

The wireless card is already working.

This variant of lspci tells me:

```
lspci -nnkv | sed -n '/Network/,/^$/p'

0c:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4313 802.11bgn Wireless Network Adapter [14e4:4727] (rev 01)

   Subsystem: Dell Inspiron M5010 / XPS 8300 [1028:0010]

   Flags: bus master, fast devsel, latency 0, IRQ 17

   Memory at f6cfc000 (64-bit, non-prefetchable) [size=16K]

   Capabilities: [40] Power Management version 3

   Capabilities: [58] Vendor Specific Information: Len=78 <?>

   Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+

   Capabilities: [d0] Express Endpoint, MSI 00

   Capabilities: [100] Advanced Error Reporting

   Capabilities: [13c] Virtual Channel

   Capabilities: [160] Device Serial Number 00-00-9d-ff-ff-0c-1c-65

   Capabilities: [16c] Power Budgeting <?>

   Kernel driver in use: bcma-pci-bridge

   Kernel modules: bcma
```

AFAIK, all of that is related to my wifi card. (BTW, this wired Ethernet card was not recognized by the Minimal Install CD, so it has never worked under Gentoo. It did work under Windows, so the hardware isn't the problem.)

I tried a dmesg on everything related to the card:

```
dmesg | grep -i -E '09:00.0|Broadcom|bcm|57760'

[    0.717346] pci 0000:09:00.0: [14e4:1690] type 00 class 0x020000

[    0.717416] pci 0000:09:00.0: reg 0x10: [mem 0xf6af0000-0xf6afffff 64bit]

[    0.717528] pci 0000:09:00.0: enabling Extended Tags

[    0.717829] pci 0000:09:00.0: PME# supported from D3hot D3cold

[    1.134069] tg3 0000:09:00.0: No PHY devices

[    1.134137] tg3 0000:09:00.0: Problem fetching invariants of chip, aborting

[    8.552096] bcma: bus0: Found chip with id 0x4313, rev 0x01 and package 0x08

[    8.552135] bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x24, class 0x0)

[    8.552164] bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x18, class 0x0)

[    8.552220] bcma: bus0: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x11, class 0x0)

[    8.564579] bcma: bus0: Bus registered

[    8.878137] b43: probe of bcma0:1 failed with error -524

[    8.878637] Broadcom 43xx driver loaded [ Features: PNLS ]

[    9.510858] brcmsmac bcma0:1: mfg 4bf core 812 rev 24 class 0 irq 17

[    9.587123] brcmsmac bcma0:1 wlp12s0b1: renamed from wlan0

[   12.092341] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)

[   12.092352] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)

[   19.140854] brcmsmac bcma0:1: brcmsmac: brcms_ops_bss_info_changed: associated

[   19.140858] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: true (implement)

[   19.144615] brcmsmac bcma0:1: wl0: brcms_c_d11hdrs_mac80211:  txop exceeded phylen 159/256 dur 1778/1504

[   19.153974] brcmsmac bcma0:1: wl0: brcms_c_d11hdrs_mac80211:  txop exceeded phylen 137/256 dur 1602/1504

[   25.603816] brcmsmac bcma0:1: brcms_ops_bss_info_changed: arp filtering: 1 addresses (implement)
```

Just for fun, here's what lsmod says:

```
Module                  Size  Used by

ipv6                  421888  14

crc_ccitt              16384  1 ipv6

brcmsmac              552960  0

brcmutil               16384  1 brcmsmac

b43                   434176  0

dell_smm_hwmon         16384  0

bcma                   49152  2 b43,brcmsmac
```

Does any of this stuff suggest what my next action should be to enable the Ethernet card?

----------

## freke

If you haven't already, you might need/want 

```
CONFIG_TIGON3
```

 in kernel.

https://cateee.net/lkddb/web-lkddb/TIGON3.html

It seems to be for that Broadcom chip?

----------

## mojosam

That does seem to be a missing component. How do I get it? It looks like it's maintained outside of the regular Gentoo repository. I couldn't find anything on the forum or wiki for how to do this.

----------

## NeddySeagoon

mojosam,

CONFIG_TIGON3 is a kernel configuration symbol.

Use the search in 

```
make menuconfig
```

to find it.

Turm it on, then rebuild and reinstall your kernel.

----------

## Jaglover

I do not want to confuse you, do as NeddySeagoon told you. Just letting you know you could build it as a module and load it without even rebooting your box.

----------

## mojosam

I fired up menuconfig and did a search for "TIGON3". It told me there were two places where that is set. I went there, and it's already turned on in the kernel!

I'm guessing something else is missing. I thought I'd follow the directions in KC11 - kernel compiling for the beginner. Jump down to 2. Preparing to compile a kernel -> c. Configuring the kernel -> Configuring the kernel to support a new item of hardware.

lspci told me that my card is named:

```
09:00.0 Ethernet controller: Broadcom Inc. and subsidiaries NetXtreme BCM57760 Gigabit Ethernet PCIe (rev 01)
```

Next, the article says I need to get the Vendor ID and Device ID:

```
# lspci -n | grep '^09:00.0'

09:00.0 0200: 14e4:1690 (rev 01)
```

So the Vendor ID = 14e4 and Device ID = 1690.

It then wants me to search the list of vendor IDs in the kernel to find what "14e4" is coded as:

```
# grep -i 0x14e4 /usr/src/linux-4.19.66-gentoo/include/linux/pci_ids.h

grep /usr/src/linux-4.19.66-gentoo/include/linux/pci_ids.h: No such file or directory
```

It says the file doesn't exist. Well I already know that the vendor name is Broadcom. I'll just skip ahead to the next step.

```
find /usr/src/linux-4.19.66-gentoo -name \*.c | xargs grep -i -l broadcom
```

It returned a list 513 lines long. So I'm guessing that this is the file I want:

```
/usr/src/linux-4.19.66-gentoo/drivers/net/ethernet/broadcom/tg3.c
```

I dug through that file and found this line:

```
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57760)},
```

I don't know where to go from here. The document is confusing. Am I even going down the correct path? It feels like I've wandered off into the woods.

----------

## Jaglover

You say it is already enabled, is it enabled as module <M> or built in <*> ?

----------

## mojosam

 *Quote:*   

> is it enabled as module <M> or built in <*> ?

 

Built in!

----------

## Jaglover

Then it should leave a trace into dmesg. Why do you think the driver does not load? Does 'ifconfig -a' or 'ip a' show it?

----------

## mojosam

 *Quote:*   

> Why do you think the driver does not load? Does 'ifconfig -a' or 'ip a' show it?

 

No. It only shows when I boot from the Minimal Install CD (although oddly, it wasn't there when I did the original install a few weeks ago).

----------

## NeddySeagoon

mojosam,

Please share your kernel .config file. wgetpaste is your friend.

Tell how you build and install your kernel too.

When you boot your own Gentoo, what does 

```
uname -a
```

show.

----------

## mojosam

It looks like I got confused on one tiny point. lspci does show the wired Ethernet card. Everything else I said is accurate. ip a only shows the wireless card.

 *Quote:*   

> When you boot your own Gentoo, what does uname -a show.

 

```
Linux therocket 4.19.66-gentoo #1 Sat Aug 31 14:31:49 PDT 2019 x86_64 Intel(R) Atom(TM) CPU N470 @ 1.83GHz GenuineIntel GNU/Linux
```

 *Quote:*   

> Tell how you build and install your kernel too.

 

I followed the Handbook. I'm pretty sure I went with defaults on everything. I did the manual configuration (instead of genkernel).

```
Please share your kernel .config file.
```

Here it is:

http://dpaste.com/02GABY1

----------

## mojosam

I finally got the Ethernet card working. I'm not marking this thread as solved, because I'm not really sure how I did it. Also, the relevant section of KC 11 is confusing and did not apply in my case. I'd rewrite that section if I understood what is really going on here, but I don't.

I went back into menuconfig and just turned on everything Broadcom. So that part of my kernel is messy and doesn't follow the Gentoo philosophy, but it works.

There is one clue in my situation that might have been the critical piece of the puzzle. In my .config file is the line:

```
# CONFIG_BROADCOM_PHY is not set
```

In menuconfig, there is a setting called Broadcom PHYs. I turned that on. Looking in .config for that is not covered in KC 11.

----------

## Anon-E-moose

You usually have to set the PHY of whatever network device.

Edit to add: from Documentation/networking/phy.txt

 *Quote:*   

> PHY Abstraction Layer
> 
> ( Updated 2008-04-08 )
> 
> Purpose
> ...

 

----------

## pjp

 *mojosam wrote:*   

> I went back into menuconfig and just turned on everything Broadcom. So that part of my kernel is messy

  Keep your current working kernel, then configure anything network device related as a module. After booting (and verifying functional network), see what network device modules didn't get loaded and remove them from the kernel configuration. Do you have FDDI hardware? Probably not, so that could be disabled. Any Intel NICs? etc. Just be sure to keep a known working kernel available.

----------

## mojosam

 *Quote:*   

> Keep your current working kernel, then configure anything network device related as a module. After booting (and verifying functional network), see what network device modules didn't get loaded and remove them from the kernel configuration.

 

I agree that I should do this. I hope I'll come back to it in a few weeks. Right now I just want to move on to other stuff.

Thank you to all who contributed advice.

----------

