[SOLVED] Dual Gigabit mini PCI express card

I bought the Jetway Dual Gigabit LAN Mini PCI Express Card with the purpose of use it as an ethernet interface of two IP camera module, but I am still in the first step of configuring the ports.

The mini PCI card is detected (01:00.0 and 01:00.1 entries):

lspci -v
00:00.0 PCI bridge: NVIDIA Corporation Device 0e12 (rev a1) (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
	I/O behind bridge: 00001000-00001fff
	Memory behind bridge: 32200000-323fffff
	Prefetchable memory behind bridge: 0000000012200000-00000000122fffff
	Capabilities: <access denied>
	Kernel driver in use: pcieport

01:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
	Flags: bus master, fast devsel, latency 0, IRQ 130
	Memory at 32200000 (32-bit, non-prefetchable) 
	I/O ports at 1000 
	Memory at 32300000 (32-bit, non-prefetchable) 
	[virtual] Expansion ROM at 12200000 [disabled] 
	Capabilities: <access denied>

01:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
	Flags: bus master, fast devsel, latency 0, IRQ 130
	Memory at 32280000 (32-bit, non-prefetchable) 
	I/O ports at 1020 
	Memory at 32304000 (32-bit, non-prefetchable) 
	[virtual] Expansion ROM at 12280000 [disabled] 
	Capabilities: <access denied>

02:00.0 PCI bridge: NVIDIA Corporation Device 0e13 (rev a1) (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=02, secondary=03, subordinate=03, sec-latency=0
	I/O behind bridge: 00010000-00010fff
	Memory behind bridge: 32100000-321fffff
	Prefetchable memory behind bridge: 0000000012100000-00000000121fffff
	Capabilities: <access denied>
	Kernel driver in use: pcieport

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
	Subsystem: Realtek Semiconductor Co., Ltd. Device 0123
	Flags: bus master, fast devsel, latency 0, IRQ 642
	I/O ports at 10000 
	Memory at 32100000 (64-bit, non-prefetchable) 
	Memory at 12100000 (64-bit, prefetchable) 
	Capabilities: <access denied>
	Kernel driver in use: r8169

But the expected new interfaces eth1 and eth2 does not seems to be up:

ifconfig
eth0      Link encap:Ethernet  HWaddr 00:04:4b:25:bc:0f  
          inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::204:4bff:fe25:bc0f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4313 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2165 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:958917 (958.9 KB)  TX bytes:249823 (249.8 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:724 errors:0 dropped:0 overruns:0 frame:0
          TX packets:724 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:65251 (65.2 KB)  TX bytes:65251 (65.2 KB)

As you can check in the output of lspci -v, the two entries of the pci ports don’t have any “kernel driver in use”. The chipset of the mini PCI express card is an Intel i350. I downloaded the latest network adapter driver for Linux from Intel’s webpage but I can not compile it with make, as I suppose is not designed to compile in ARM architecture.

Is there any way to cross-compile the driver and install it for ARM?
Am I missing any basic step for configure the network and getting up the eth1 and eth2 interfaces?

Thank you.

I don’t have one to test with, but it looks like the IGB driver is the right one. In the R19.3 default kernel config (probably the same thing in R21.2) I see these options:

CONFIG_NET_VENDOR_INTEL=y
# CONFIG_E100 is not set
# CONFIG_E1000 is not set
# CONFIG_E1000E is not set
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
# CONFIG_IXGB is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set

The CONFIG_ items for E100 or similar are definitely wrong, and probably just plain old CONFIG_IGB is correct as the right driver. The default is to not have this specific driver enabled, but since it is in the kernel source, you could just compile the IGB driver and see if the module inserts…if it does you’ll have your device show up in ifconfig.

This is just basic linux module compiling, so you don’t need to know much specifically about Jetson to do this. Just put the right kernel source tree in, configured to match whatever is running, and then turn this NIC driver option on as a module and build/insert the module. No need to mess with cross compiling and unless you really want to; in any case you don’t need a separate driver download, just build from the provided driver directly in the kernel.

Hello,

I have the R21.2 kernel. It is my first time playing with kernels. There is a folder that match the driver:

/usr/src/linux-headers-3.10.40-ged4f697/drivers/net/ethernet/intel/igb

But the folder is empty except for a Makefile. I copied the src files of the driver (downloaded from Intel webpage) and doing make it sais “No targets. Stop”. Using the Makefile of Intel it sais:

make -C /lib/modules/3.10.40-ged4f697/build SUBDIRS=/home/ubuntu/Downloads/kernel/drivers/net/ethernet/intel/igb modules
make[1]: Entering directory `/usr/src/linux-headers-3.10.40-ged4f697'
  CC [M]  /home/ubuntu/Downloads/kernel/drivers/net/ethernet/intel/igb/igb_main.o
/usr/src/linux-headers-3.10.40-ged4f697/scripts/recordmcount: 1: /usr/src/linux-headers-3.10.40-ged4f697/scripts/recordmcount: Syntax error: "(" unexpected
make[2]: *** [/home/ubuntu/Downloads/kernel/drivers/net/ethernet/intel/igb/igb_main.o] Error 2
make[1]: *** [_module_/home/ubuntu/Downloads/kernel/drivers/net/ethernet/intel/igb] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.10.40-ged4f697'
make: *** [default] Error 2

In the intel website http://www.intel.com/support/network/adapter/pro100/sb/CS-032498.htm they mention: “The Linux base drivers support the 2.4.x and 2.6.x kernels”

My linux kernel seems to be 3.10.40. Do I have an incompability problem with this ethernet card?

I have written to Intel support asking about my problem with the i350, if they have any solution or if they are going to update the driver…

Thanks.

It would be easiest to just use the drivers that come with the R21.2 kernel. See this page:
[url]https://developer.nvidia.com/linux-tegra-rel-21[/url]
…this leads to “Kernel sources”:
[url]http://developer.download.nvidia.com/mobile/tegra/l4t/r21.2.0/sources/kernel_src.tbz2[/url]

From your running system copy /proc/config.gz to your kernel source (I unpacked mine to /usr/src/kernels/3.10.40-ged4f697/), gunzip it, rename it to “.config”, install package “libncurses5-dev” (apt-get install libncurses5-dev) so you can use menuconfig, load the .config, then find the IGB driver.

FYI, the Intel site only provides those drivers for some very old kernels in the 2.6.x series, while you are trying to compile against 3.10.x…it won’t work and isn’t necessary since the drivers are supplied natively by the current kernel…it’s just a matter of adding the module.

I have copied the source kernel of the link into /usr/src/linux-headers-3.10.40-ged4f697, if not, was impossible to compile with “sudo make”. After copying the kernel and gunzip and rename the file /proc/config.gz in the before folder I did “make menuconfig”, and I found and activated in “->Device drivers → Network device support → Ethernet driver support → Intel devices → Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support” the driver, tried with “*” and “M”. Compilation was complete doing “sudo make install -j4”, I reboot but still nothing new appears with ifconfig.

I looked into config-3.10.24 file in /boot/ folder and CONFIG_IGB=y now appears to be set.

Doing “sudo modprobe igb” it sais FATAL: Module igb not found. Maybe I am doing in the wrong place.

What do I am missing?

Thank you, I really appreciate your help.

Kernel source has its own headers…putting it in the headers directory should not be required.

Very likely all you need is to set the LOCALVERSION. Without this the version remains only “3.10.24” (or 3.10.40, depending on version) and does not append the last part. Unfortunately I’m not near my development system right now, so I can’t tell you for sure what the full version number is…you mentioned above the “3.10.40-ged4f697”, which would be correct if using R21.x, but it would be “3.10.24-something” if it were R19.x. The trick is that the numbers in whole must match “uname -r”. This determines where your kernel looks for modules when it wants to load them. So verify what “uname -r” says…the part with the hyphen and to the right is what LOCALVERSION is supposed to be in kernel config. Since this was not correct the first time, you should clean out the old build with “make mrproper”, then copy your config.gz and other steps again, finally make menuconfig. Do the same driver options as you did before, but don’t exit menuconfig until you find the local version setting.

If “uname -r” says “3.10.40-ged4f697” then it looks for modules under /lib/modules/3.10.40-gedf697. If you don’t add this suffix and if the kernel isn’t the same version it’ll install and look for modules in the wrong place. Very likely you have an unused set of modules now in /lib/modules/ which doesn’t match the running kernel. What is your “uname -r”? What subdirectories are there now in /lib/modules?

“uname -r” says “3.10.40-ged4f697”. I am using R21.2.

In /lib/modules exists “3.10.40” and “3.10.40-ged4f697” folders.

If I look into /lib/modules/3.10.40-ged4f697/build/drivers/net/ethernet/intel/igb there exists built-in.o, igb_main.o and some others. But in /lib/modules/3.10.40-ged4f697/kernel/drivers/net there are just 4 folders.

I did again the steps in the order you said with a “make mrproper” before.

After “make menuconfig”, I did “make bzImage -j4” and it compiles good except for some warnings. Ends saying “Kernel: arch/arm/boot/zImage is ready”.

Then I do “make modules”. At some point it shows the module igb without errors or warnings (previous of removing in the Makefile file of igb folder some .c and .h files dependencies which the kernel source does not contain )

CC [M]  drivers/net/ethernet/intel/igb/igb_main.o
CC [M]  drivers/net/ethernet/intel/igb/e1000_82575.o
CC [M]  drivers/net/ethernet/intel/igb/e1000_i210.o
CC [M]  drivers/net/ethernet/intel/igb/e1000_mac.o
CC [M]  drivers/net/ethernet/intel/igb/e1000_nvm.o
CC [M]  drivers/net/ethernet/intel/igb/e1000_phy.o
CC [M]  drivers/net/ethernet/intel/igb/igb_ethtool.o
CC [M]  drivers/net/ethernet/intel/igb/e1000_mbx.o
CC [M]  drivers/net/ethernet/intel/igb/igb_hwmon.o
LD [M]  drivers/net/ethernet/intel/igb/igb.o

But when the command “make modules” starts with the second stage, it stops because of an error:

LD [M]  net/wireless/cfg80211.o
Building modules, stage 2.
MODPOST 54 modules
ERROR: "igb_ptp_reset" [drivers/net/ethernet/intel/igb/igb.ko] undefined!
ERROR: "igb_ptp_rx_pktstamp" [drivers/net/ethernet/intel/igb/igb.ko] undefined!
ERROR: "igb_ptp_init" [drivers/net/ethernet/intel/igb/igb.ko] undefined!
ERROR: "igb_ptp_hwtstamp_ioctl" [drivers/net/ethernet/intel/igb/igb.ko] undefined!
ERROR: "igb_ptp_stop" [drivers/net/ethernet/intel/igb/igb.ko] undefined!
ERROR: "igb_ptp_rx_hang" [drivers/net/ethernet/intel/igb/igb.ko] undefined!
ERROR: "igb_ptp_rx_rgtstamp" [drivers/net/ethernet/intel/igb/igb.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

So if I do “make modules_install”, as the previous step did not finish it won’t install the igb module I think…

I can not find the igb.ko file anywhere or where do I have to define it.

Thank you.

I have a freshly flashed R21.2 machine I put the kernel source on and copied in the config.gz. LOCALVERSION was set, so all is matching and ready for modifying module options.

I then enabled: Device drivers->Network device support->Ethernet driver support->Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support. After saving this configuration I see CONFIG_IGB is enabled as a module:

grep CONFIG_IGB .config
CONFIG_IGB=m

Note that only the modules need building, but it doesn’t hurt to build it all. I did:
make -j4 modules

As a result I now have “drivers/net/ethernet/intel/igb/igb.ko”. I don’t have the network adapter, so I can’t test anything else, but I’d try “insmod drivers/net/ethernet/intel/igb/igb.ko” to manually test.

FYI, what is the output of:

sha1sum /boot/zImage

I have:

d1122d8b305bd1b7008e7b1ccc0868a9e2e95663  zImage

…this matches the R21.2 installation software’s zImage. I am thinking that if your install updated the zImage it might complicate things. In particular, it should not be necessary to place the kernel source in the headers directory…and in fact it could possibly interfere by mixing in files that way.

Would you try unpacking kernel source from here:

/usr/src/kernels

…this should produce:

/usr/src/kernels/kernel/...

…rename this…from /usr/src/kernels:

mv kernel `uname -r`

This should leave you with your kernel source in:

/usr/src/kernels/3.10.40-ged4f697

A note about system time and kernel source: Sometimes working with systems that may have an accurate time only part of the time is that you end up with a tar archive (the kernel source is in this kind of archive) that has “time skew”, and time stamps may be odd. This could conceivably mess up a compile, though I don’t know if it would in this case. I have kernel source file kernel_src_3.10.40-ged4f697.tbz2 which I unpacked via:

cd /usr/src/kernels
bunzip2 < kernel_src_3.10.40-ged4f697.tbz2 | tar xvm

The “m” option deals with the time skew.

FYI, the /lib/modules/3.10.40/ directory can be recursively deleted…just don’t remove anything from /lib/modules/3.10.40-ged4f697/.

Hello, I did the same, a freshly flashed R21.2 machine.

“uname -r” gives me “3.10.40-ged4f697”

Then unpack the source and modify folder names as you suggested, finally having the kernel source in:

/usr/src/kernels/3.10.40-ged4f697

I copied inside config.gz, gunzip it, rename to .config, “sudo make menuconfig” and activate the module igb.

Now “sudo make -j4 modules” compiled without errors and created the igb.ko file in:

/usr/src/kernels/3.10.40-ged4f697/drivers/net/ethernet/intel/igb

After I did “make modules_install”, but I was not able to activate the module doing “sudo modprobe igb”…

Also checking the module as you did, gives me this:

ubuntu@tegra-ubuntu:/usr/src/kernels/3.10.40-ged4f697$ sudo insmod drivers/net/ethernet/intel/igb/igb.ko
[sudo] password for ubuntu: 
insmod: ERROR: could not insert module drivers/net/ethernet/intel/igb/igb.ko: Invalid module format

I have checked that after modules_install igb.ko have been placed in:

/lib/modules/3.10.40/kernel/drivers/net/ethernet/intel/igb

And not in:

/lib/modules/3.10.40-ged4f697/...

Why is it placing there the igb.ko file, if “uname -r” gives me “3.10.40-ged4f697”?

Thanks, I think we are so close to send this message through the mini PCI express card. :)

When you run menuconfig, the version revision needs to be placed in ‘General Setup’->‘Local Version’. An easy way to determine the revision needed is to execute:

$ uname -r

from a Terminal. In this case, the result will be: ‘3.10.40-ged4f697’. Place ‘-ged4f697’ (without the single quotes) into the dialog box and remember to save the settings. Don’t forget the ‘-’ sign in the revision, or else it will happily compile, install and you’ll still have the same issue. Don’t ask me how I know that part.

Then enable and compile the module. menuconfig thinks that the version is ‘3.10.40’, it doesn’t know about the revision ‘-ged4f697’.

Here’s a video on how to build modules and drivers. It’s not the module that you are building, and the revision number is different, but it’s very similar:

Thank you very much to both. Now both ports are working.

I had to set correctly the local version revision in ‘General Setup’->‘Local Version’ and executing “sudo make modules_install” this time have been installed in the correct folder in /lib/modules/3.10.40-ged4f697.

After installed, I executed “sudo depmod -a” how it says in the link that Kangalow wrote before.

I executed then “sudo modprobe igb” and now eth1 and eth2 are shown in ifconfig, assigning automatically an IP address when an ethernet cable is connected.

+1 for Kangalow’s explanation. One additional note…CONFIG_LOCALVERSION is stored in the .config file…EXCEPT it is not in the /proc/config.gz version. Make mrproper erases the previous .config, so this erases the LOCALVERSION as well; simply adding the /proc version of config won’t add this LOCALVERSION back since that config file doesn’t have LOCALVERSION. It’s something you have to get used to double checking before every compile.

Thanks for the help; I went through the instructions and built the igb module, but when I do ‘sudo modprobe igb’, it says “ERROR: could not insert ‘igb’: Unknown symbol in module, or unknown parameter (see dmesg)”.

dmesg says:

igb: Unknown symbol ptp_clock_index (err 0)
igb: Unknown symbol ptp_clock_register (err 0)
igb: Unknown symbol ptp_clock_unregister (err 0)

I’ve googled, but can’t find any info on these symbols. I’m using Tegra for Linux version 21.4. Any ideas? Thanks in advance…

Update: After reverting back to Tegra for Linux 21.2 it works as described above.

Any unknown symbol during module insert simply means there is some other module needed to provide that feature which isn’t loaded.