红联Linux门户
Linux帮助

fedora9下NetLink bcm57788 驱动安装

发布时间:2011-09-22 11:27:30来源:红联作者:天涯学子
下载驱动源码:http://zh-cn.broadcom.com/support/ethernet_nic/netlink_k57.php
安装完对应的kernel-devel后,解压tg3压缩包,按照README.txt中描述安装,其中介绍了2种方法,我采用的是下面这中rpm的方式:

1. The following are general guidelines for installing the driver.
2.
3. 1. Install the source RPM package:
4.
5. rpm -ivh tg3-.src.rpm
6.
7. 2. CD to the RPM path and build the binary driver for your kernel:
8.
9. cd /usr/src/{redhat,OpenLinux,turbo,packages,rpm ..}
10.
11. rpm -bb SPECS/tg3.spec
12.
13. or
14.
15. rpmbuild -bb SPECS/tg3.spec (for RPM version 4.x.x)
16.
17. Note that the RPM path is different for different Linux distributions.
18.
19. The driver will be compiled for the running kernel by default. To build
20. the driver for a kernel different than the running one, specify the
21. kernel by defining it in KVER:
22.
23. rpmbuild -bb SPECS/tg3.spec --define "KVER "
24.
25. where in the form of 2.x.y-z is the version of another
26. kernel that is installed on the system.
27.
28. 3. Install the newly built package (driver and man page):
29.
30. rpm -ivh RPMS//tg3-..rpm
31.
32. is the architecture of the machine, e.g. i386:
33.
34. rpm -ivh RPMS/i386/tg3-.i386.rpm
但是在进行到第2步
1. rpmbuild -bb SPECS/tg3.spec
的时候出错了,提示如下错误

1. make -C /lib/modules/2.6.25-14.fc9.i686/build SUBDIRS=/usr/src/redhat/BUILD/tg3-3.116j modules
2. make[1]: Entering directory `/usr/src/kernels/2.6.25-14.fc9.i686'
3. CC [M] /usr/src/redhat/BUILD/tg3-3.116j/tg3.o
4. /usr/src/redhat/BUILD/tg3-3.116j/tg3.c: In function 'tg3_napi_fini':
5. /usr/src/redhat/BUILD/tg3-3.116j/tg3.c:5821: error: implicit declaration of function 'netif_napi_del'
6. make[2]: *** [/usr/src/redhat/BUILD/tg3-3.116j/tg3.o] Error 1
7. make[1]: *** [_module_/usr/src/redhat/BUILD/tg3-3.116j] Error 2
8. make[1]: Leaving directory `/usr/src/kernels/2.6.25-14.fc9.i686'
9. make: *** [default] Error 2
10. error: Bad exit status from /var/tmp/rpm-tmp.81225 (%build)
解决方法如下:
打开/usr/src/kernels/2.6.25-14.fc9.i686/include/linux/netdevice.h 文件,在netif_napi_add函数下添加

1. static inline void netif_napi_del(struct napi_struct *napi)
2. {
3. #ifdef CONFIG_NETPOLL
4. list_del(&napi->dev_list);
5. #endif
6. }
保存后重新运行
1. rpmbuild -bb SPECS/tg3.spec
没有错误,搞定。。。
这时候你会在/usr/src/redhat/RPMS/i386目录下看到刚生成的tg3-3.116j-1.i386.rpm文件,用rpm安装即可。
文章评论

共有 9 条评论

  1. a77654135 于 2013-09-25 10:49:47发表:

    好贴,顶。

  2. gaojinfeng 于 2012-12-11 20:55:33发表:

    :0)1

  3. gaojinfeng 于 2012-12-11 20:55:23发表:

    (o):tx

  4. gky2009514 于 2012-12-07 13:02:28发表:

    新手完成任务,求下书籍~

  5. linux郝鑫 于 2012-10-11 17:13:40发表:

    为什么,想下载没有现金啊!!!

  6. 小鹿乱撞 于 2012-05-06 23:11:29发表:

    看不懂啊……(5ty(

  7. sourcehappy 于 2011-11-04 19:15:53发表:

    顶起

  8. Growth兆 于 2011-09-23 09:36:06发表:

    感谢天涯学子的分享,本贴加入到论坛顶置的Linux应用索引贴中

  9. cmkyuan 于 2011-09-22 11:41:36发表:

    支持楼主