Messages in cipher reflected in the looking glass
[ Yasuhiro Fujitsuki's Weblog ]
http://blogs.sun.com/thaniwa/date/20080522 2008年 5月 22日 木曜日

(EN) log of building nxge driver(kernel module) on Debian Linux 4.0r3

It's just log of building nxge ( 1027A-Z 10Gbit Ethernet Adapter ) on Debian Linux 4.0r3 (AMD64).
Sorry, I had not test to recognize 10Gbit Ethernet by Debian Linux, because I have no card to test.

Driver source code can be downloaded at http://www.sun.com/download/products.xml?id=4653d592 .

To build nxge driver, linux-headers is required.

# apt-get install linux-headers-2.6-amd64

Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  gcc-4.1 libssp0 linux-headers-2.6.18-6 linux-headers-2.6.18-6-amd64
  linux-kbuild-2.6.18
Suggested packages:
  gcc-4.1-doc gcc-4.1-locales libc6-dev-i386 lib32gcc1 lib32ssp0
Recommended packages:
  libc6-dev libmudflap0-dev
The following NEW packages will be installed:
  gcc-4.1 libssp0 linux-headers-2.6-amd64 linux-headers-2.6.18-6
  linux-headers-2.6.18-6-amd64 linux-kbuild-2.6.18
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/4169kB of archives.
After unpacking 27.6MB of additional disk space will be used.
Do you want to continue [Y/n]? y

Makefile is in sun_10_Gigabit_Ethernet_driver_Linux_Src_update_2.zip, but does not use this file.
The way to build is as follows.

# cd 
# mkdir nxge
# cd nxge
# unzip ../ sun_10_Gigabit_Ethernet_driver_Linux_Src_update_2.zip
# make
# make -C /usr/src/linux-headers-2.6.18-6-amd64 SUBDIRS=`pwd` modules
make: Entering directory `/usr/src/linux-headers-2.6.18-6-amd64'
  CC [M]  /home/user01/nxge/nxge_main.o
  CC [M]  /home/user01/nxge/nxge_ethtool.o
  CC [M]  /home/user01/nxge/npi.o
  CC [M]  /home/user01/nxge/npi_mac.o
  CC [M]  /home/user01/nxge/npi_ipp.o
  CC [M]  /home/user01/nxge/npi_txc.o
  CC [M]  /home/user01/nxge/npi_txdma.o
  CC [M]  /home/user01/nxge/npi_rxdma.o
  CC [M]  /home/user01/nxge/npi_fflp.o
  CC [M]  /home/user01/nxge/npi_espc.o
  CC [M]  /home/user01/nxge/npi_zcp.o
  CC [M]  /home/user01/nxge/npi_vir.o
  CC [M]  /home/user01/nxge/nxge_rxport.o
  CC [M]  /home/user01/nxge/nxge_txc.o
  CC [M]  /home/user01/nxge/nxge_fflp.o
  CC [M]  /home/user01/nxge/nxge_mac.o
  CC [M]  /home/user01/nxge/nxge_fzc.o
  CC [M]  /home/user01/nxge/nxge_param.o
  CC [M]  /home/user01/nxge/nxge_espc.o
  LD [M]  /home/user01/nxge/nxge.o
  Building modules, stage 2.
  MODPOST
  CC      /home/user01/nxge/nxge.mod.o
  LD [M]  /home/user01/nxge/nxge.ko
make: Leaving directory `/usr/src/linux-headers-2.6.18-6-amd64'
debian:/home/user01/nxge#

# install -m 644 builds/2.6.18-6-amd64/nxge.ko /lib/modules/2.6.18-6/amd64/kernel/drivers/net

# insmod /lib/modules/2.6.18-6-amd64/kernel/drivers/net/nxge.ko
# lsmod | grep nxge
nxge                  405484  0