在 debian squeeze 上编译最新的 bnx2 驱动程序

在 debian squeeze 上编译最新的 bnx2 驱动程序

我想升级 Dell Power Edge R410 中的 bnx2 网卡驱动程序。我从 broadcom 网站下载了最新的驱动程序版本。如果我想编译驱动程序,它会失败并出现以下错误:

make
make -C bnx2/src  KVER=2.6.32-5-amd64 PREFIX=
make[1]: Entering directory `/tmp/netxtreme2-6.2.23/bnx2-2.0.23b/src'
make -C /lib/modules/2.6.32-5-amd64/build SUBDIRS=/tmp/netxtreme2-6.2.23/bnx2-2.0.23b/src modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.32-5-amd64'
  Building modules, stage 2.
  MODPOST 2 modules
make[2]: Leaving directory `/usr/src/linux-headers-2.6.32-5-amd64'
make[1]: Leaving directory `/tmp/netxtreme2-6.2.23/bnx2-2.0.23b/src'
make -C bnx2x/src KVER=2.6.32-5-amd64 PREFIX=
make[1]: Entering directory `/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src'
make -C /lib/modules/2.6.32-5-amd64/build M=`pwd` modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.32-5-amd64'
  CC [M]  /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.o
In file included from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x.h:68,
                 from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.c:80:
/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_compat.h:1009:1: error: "PCI_VPD_LRDT_ID_STRING" redefined
In file included from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.c:34:
/usr/src/linux-headers-2.6.32-5-common/include/linux/pci.h:1327:1: error: this is the location of the previous definition
In file included from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x.h:68,
                 from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.c:80:
/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_compat.h:1011:1: error: "PCI_VPD_LRDT_RO_DATA" redefined
In file included from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.c:34:
/usr/src/linux-headers-2.6.32-5-common/include/linux/pci.h:1328:1: error: this is the location of the previous definition
In file included from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x.h:68,
                 from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.c:80:
/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_compat.h:1013:1: error: "PCI_VPD_LRDT_RW_DATA" redefined
In file included from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.c:34:
/usr/src/linux-headers-2.6.32-5-common/include/linux/pci.h:1329:1: error: this is the location of the previous definition
In file included from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x.h:68,
                 from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.c:80:
/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_compat.h:1019:1: error: "PCI_VPD_SRDT_END" redefined
In file included from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.c:34:
/usr/src/linux-headers-2.6.32-5-common/include/linux/pci.h:1334:1: error: this is the location of the previous definition
In file included from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x.h:68,
                 from /tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.c:80:
/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_compat.h:1032: error: conflicting types for ‘pci_vpd_lrdt_size’
/usr/src/linux-headers-2.6.32-5-common/include/linux/pci.h:1355: error: previous definition of ‘pci_vpd_lrdt_size’ was here
/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_compat.h:1037: error: conflicting types for ‘pci_vpd_srdt_size’
/usr/src/linux-headers-2.6.32-5-common/include/linux/pci.h:1366: error: previous definition of ‘pci_vpd_srdt_size’ was here
/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_compat.h:1042: error: conflicting types for ‘pci_vpd_find_tag’
/usr/src/linux-headers-2.6.32-5-common/include/linux/pci.h:1391: error: previous declaration of ‘pci_vpd_find_tag’ was here
/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_compat.h:1077: error: conflicting types for ‘pci_vpd_info_field_size’
/usr/src/linux-headers-2.6.32-5-common/include/linux/pci.h:1377: error: previous definition of ‘pci_vpd_info_field_size’ was here
/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_compat.h:1082: error: conflicting types for ‘pci_vpd_find_info_keyword’
/usr/src/linux-headers-2.6.32-5-common/include/linux/pci.h:1403: error: previous declaration of ‘pci_vpd_find_info_keyword’ was here
make[5]: *** [/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src/bnx2x_main.o] Fehler 1
make[4]: *** [_module_/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src] Fehler 2
make[3]: *** [sub-make] Fehler 2
make[2]: *** [all] Fehler 2
make[2]: Leaving directory `/usr/src/linux-headers-2.6.32-5-amd64'
make[1]: *** [bnx2x.o] Fehler 2
make[1]: Leaving directory `/tmp/netxtreme2-6.2.23/bnx2x-1.62.15/src'
make: *** [l2build] Fehler 2

答案1

我有同样的问题-尝试:

# cd bnx2/src

先做后做

# make && make install

答案2

解决这个问题的方法是将 bnx2x_compat.h 稍作修改。

在第 1178 行左右,添加“#ifndef:”

}
#endif

#ifndef PCI_VPD_LRDT
#if ((!defined RHEL_RELEASE_CODE) && (LINUX_VERSION_CODE ...etc...

然后关闭第 1283 行左右的 ifdef:

}
#endif
#endif // !PCI_VPD_LRDT
#ifndef PCI_MSIX_FLAGS_QSIZE
#define PCI_MSIX_FLAGS_QSIZE 0x7FF
#endif

这两个更改将允许最新驱动程序正确构建。我今天用 1.72.18 完成了此操作。要成功构建 v2.6 抢占式实时内核,还需要进行一些小改动,将 __netif_tx_lock() 更改为省略 smp_processor_id() 第二个参数,但非实时内核或实时 3.0 及更高版本不需要这样做。

相关内容