LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 10055|回复: 12

求助:博通网卡BCM57780驱动问题

[复制链接]
发表于 2010-3-26 22:06:24 | 显示全部楼层 |阅读模式
lenny里面是有tg3驱动的,但是先择这个驱动模块之后仍然不能识别网卡,我选择了无网卡,安装完基本系统后,从博通的网站上下载了驱动的源码包,但编译的时候总是出错,情况如下,请哥哥们帮下忙好吗呵呵 ?
我的配置是:处理器: 英特尔 Core i3 M 330 @ 2.13GHz 笔记本处理器   

      主板:    宏碁 Aspire 4740 ( 英特尔 Arrandale )   

      内存:    2 GB ( 三星 DDR3 1067 MHz )   

      主硬盘: 希捷 ST9320325AS ( 320 GB )   

      显卡:    Nvidia GeForce 310M ( 512 MB / 宏碁 )  

      显示器: 三星 SEC3250 ( 14.7 英寸 )

      光驱:    东芝-三星 CDDVDW TS-L633C DVD刻录机     

      声卡:    瑞昱 ALC888 @ 英特尔 Ibex Peak 高**音频               

      网卡:    博通 BCM57780 NetLink Gigabit Ethernet / 宏碁   

      无线网卡:    Atheros AR928X Wireless Network Adapter / QMI      
下面的是网卡制造商网站上给出的驱动安装说明:

                           Installation Notes
                        Broadcom tg3 Linux Driver
                               Version 3.99k
                                08/17/2009

                          Broadcom Corporation
                         5300 California Avenue
                        Irvine, California  92617

     Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009 Broadcom Corporation
                           All rights reserved


Table of Contents
=================

  Introduction
  Limitations
  Packaging
  Installing Source RPM Package
  Building Driver From TAR File
  Driver Settings
  Driver Defaults
  Unloading and Removing Driver
  Driver Messages
  

Introduction
============

This file describes the tg3 Linux driver for the Broadcom NetXtreme
10/100/1000 Mbps PCI/PCI-X/PCI Express Ethernet Network Controllers.
The latest driver is in the latest 2.6 Linux kernel. It can also be
downloaded from http://www.broadcom.com as a source package, but is
generally not necessary to do so if you are using the latest 2.6
upstream kernel from http://www.kernel.org or one of the latest
vendor kernels from Red Hat, SuSE, or others.

The tg3 driver from the Broadcom package is almost identical to the
tg3 driver in the latest 2.6 upstream Linux kernel. It includes some
additional kernel compatible code to allow it to compile on older 2.6
and some 2.4 kernels. The version number is also similar but generally
has a one letter suffix at the end, (e.g. 3.55b) to distinguish it from
the in-kernel tg3 driver.

The next few sections on packaging, compiling, and installation apply
mostly to the Broadcom driver package only.


Limitations
===========

The current version of the driver has been tested on 2.4.x kernels starting
from 2.4.24 and all 2.6.x kernels. The driver may not compile on kernels
older than 2.4.24. Testing is concentrated on i386 and x86_64 architectures.
Only limited testing has been done on some other architectures such as
powerpc and sparc64.

Minor changes to some source files and Makefile may be needed on some
kernels.

Forcing 1 Gigabit speed in a copper environment is not supported and may
result in connection issues with certain switches.


Packaging
=========

To replace an older previously installed or in-kernel tg3 driver, follow
the instructions below.

The driver package from http://www.broadcom.com is released in two packaging
formats: source RPM and compressed tar formats. The file names for the two
packages are tg3-<version>.src.rpm and tg3-<version>.tar.gz respectively.
Identical source files to build the driver are included in both packages.


Installing Source RPM Package
=============================

The following are general guidelines for installing the driver.

1. Install the source RPM package:

   rpm -ivh tg3-<version>.src.rpm

2. CD to the RPM path and build the binary driver for your kernel:

   cd /usr/src/{redhat,OpenLinux,turbo,packages,rpm ..}

   rpm -bb SPECS/tg3.spec

or

   rpmbuild -bb SPECS/tg3.spec (for RPM version 4.x.x)

Note that the RPM path is different for different Linux distributions.

The driver will be compiled for the running kernel by default. To build
the driver for a kernel different than the running one, specify the
kernel by defining it in KVER:

   rpmbuild -bb SPECS/tg3.spec --define "KVER <kernel version>"

where <kernel version> in the form of 2.x.y-z is the version of another
kernel that is installed on the system.

3. Install the newly built package (driver and man page):

   rpm -ivh RPMS/<arch>/tg3-<version>.<arch>.rpm

<arch> is the architecture of the machine, e.g. i386:

   rpm -ivh RPMS/i386/tg3-<version>.i386.rpm

Note that the --force option may be needed on some Linux distributions
if conflicts are reported.

The driver will be installed in the following path:

2.4.x kernels:

    /lib/modules/<kernel_version>/kernel/drivers/net/tg3.o

2.6.x kernels:

    /lib/modules/<kernel_version>/kernel/drivers/net/tg3.ko

4. Load the driver:

   insmod tg3.o
or
   insmod tg3.ko (on 2.6.x kernels)
or
   modprobe tg3

5. To configure network protocol and address, refer to various Linux
documentations.


Building Driver From TAR File
=============================

The following are general guidelines for installing the driver.

1. Create a directory and extract the files:

   tar xvzf tg3-<version>.tar.gz

2. Build the driver tg3.o (or tg3.ko) as a loadable module for the
running kernel:

   cd src
   make

The driver will be compiled for the running kernel by default. To build
the driver for a kernel different than the running one, specify the
kernel by defining it in KVER:

  make KVER=<kernel version>

where <kernel version> in the form of 2.x.y-z is the version of another
kernel that is installed on the system.

3. Test the driver by loading it:

   insmod tg3.o
or
   insmod tg3.ko (on 2.6.x kernels)
or
   insmod tg3

4. Install the driver:

   make install

See RPM instructions above for the location of the installed driver.

5. To configure network protocol and address, refer to various Linux
documentations.


Driver Settings
===============

This and the rest of the sections below apply to both the in-kernel tg3
driver and the tg3 driver package from Broadcom.

Driver settings can be queried and changed using ethtool. The latest ethtool
can be downloaded from http://sourceforge.net/projects/gkernel if it is not
already installed. The following are some common examples on how to use
ethtool. See the ethtool man page for more information. ethtool settings do
not persist across reboot or module reload. The ethtool commands can be put
in a startup script such as /etc/rc.local to preserve the settings across a
reboot. On Red Hat distributions, "ethtool -s" parameters can be specified
in the ifcfg-ethx scripts using the ETHTOOL_OPTS keyword. The specified
ethtool parameters will be set during ifup. Example:
/etc/sysconfig/network-scripts/ifcfg-eth0:

ETHTOOL_OPTS="wol g speed 100 duplex half autoneg off"

Some ethtool examples:

1. Show current speed, duplex, and link status:

   ethtool eth0

2. Change speed, duplex, autoneg:

Example: 100Mbps half duplex, no autonegotiation:

   ethtool -s eth0 speed 100 duplex half autoneg off

Example: Autonegotiation with full advertisement:

   ethtool -s eth0 autoneg on

Example: Autonegotiation with 100Mbps full duplex advertisement only:

   ethtool -s eth0 speed 100 duplex full autoneg on

3. Show flow control settings:

   ethtool -a eth0

4. Change flow control settings:

Example: Turn off flow control

   ethtool -A eth0 autoneg off rx off tx off

Example: Turn flow control autonegotiation on with tx and rx advertisement:

   ethtool -A eth0 autoneg on rx on tx on

   Note that this is only valid if speed is set to autonegotiation.

5. Show offload settings:

   ethtool -k eth0

6. Change offload settings:

Example: Turn off TSO (TCP segmentation offload)

   ethtool -K eth0 tso off

7. Get statistics:

   ethtool -S eth0

8. Perform self-test:

   ethtool -t eth0

   Note that the interface (eth0) must be up to do all tests.

9. See ethtool man page for more options.


Driver Defaults
===============

Speed :                    Autonegotiation with all speeds advertised

Flow control :             Autonegotiation with rx and tx advertised

MTU :                      1500 (range 46 - 9000)

                           Some chips do not support jumbo MTUs bigger than
                           1500

Rx Ring Size :              200 (range 0 - 511)

                            Some chips are fixed at 64

Rx Jumbo Ring Size :        100 (range 0 - 255)

                            Not all chips support the jumbo ring, and some
                            chips that support jumbo frames do not use the
                            jumbo ring.

Tx Ring Size :              511 (range (MAX_SKB_FRAGS+1) - 511)

                            MAX_SKB_FRAGS varies on different kernels and
                            different architectures. On a 2.6 kernel for
                            x86, MAX_SKB_FRAGS is 18.

Coalesce rx usecs :          20 (range 0 - 1023)

Coalesce rx usecs irq :      20 (range 0 - 255)

Coalesce rx frames :          5 (range 0 - 1023)

Coalesce rx frames irq :      5 (range 0 - 255)

Coalesce tx usecs :          72 (range 0 - 1023)

Coalesce tx usecs irq :      20 (range 0 - 255)

Coalesce tx frames :         53 (range 0 - 1023)

Coalesce tx frames irq :     5 (range 0 - 255)

Coalesce stats usecs   : 1000000 (aprox. 1 sec.)

                             Some coalescing parameters are not used or have
                             different defaults on some chips

MSI :                      Enabled (if supported by the chip and passed
                                    the interrupt test)

TSO :                      Enabled on newer chips that support TCP segmentation
                           offload in hardware

WoL :                      Disabled


Unloading and Removing Driver
=============================

To unload the driver, use ifconfig to bring down all eth# interfaces opened
by the driver, then do the following:

rmmod tg3

Note that on 2.6 kernels, it is not necessary to bring down the eth#
interfaces before unloading the driver module.


If the driver was installed using rpm, do the following to remove it:

rpm -e tg3


If the driver was installed using make install from the tar file, the driver
tg3.o (or tg3.ko) has to be manually deleted from the system. Refer
to the section "Installing Source RPM Package" for the location of the
installed driver.


Driver Messages
===============

The following are the most common sample messages that may be logged in the file
/var/log/messages. Use dmesg -n <level> to control the level at which messages
will appear on the console. Most systems are set to level 6 by default. To see
all messages, set the level higher.

Driver signon:
-------------

tg3.c:v3.99k (August 17, 2009)


NIC detected:
------------

eth0: Tigon3 [partno(BCM95704A6) rev 2003] (PCIX:100MHz:64-bit) MAC address 00:10:18:04:3f:36
eth0: attached PHY is 5704 (10/100/1000Base-T Ethernet) (WireSpeed[1])
eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
eth0: dma_rwctrl[769f4000] dma_mask[64-bit]


Link up and speed indication:
----------------------------

tg3: eth0: Link is up at 1000 Mbps, full duplex.
tg3: eth0: Flow control is on for TX and on for RX.


Link down indication:
--------------------

tg3: eth0: Link is down.






下面这是在网上搜到的某人的安装方法:
[root@localhost /]# cd tmp
[root@localhost tmp]# ls
gconfd-root     mapping-root  ssh-kklIqf3374       xses-root.hcQogH
keyring-SEmkgj  orbit-root    tg3-3.71b-1.src.rpm
[root@localhost tmp]# tar xvzf tg3-3.71b.tar.gz
tg3-3.71b/tg3.4
tg3-3.71b/tg3.c
tg3-3.71b/tg3.h
tg3-3.71b/Makefile
tg3-3.71b/ChangeLog
tg3-3.71b/README.TXT
tg3-3.71b/LICENSE

[root@localhost tmp]# cd tg3-3.71b
[root@localhost tg3-3.71b]# ls
ChangeLog  LICENSE  Makefile  README.TXT  tg3.4  tg3.c  tg3.h
[root@localhost tg3-3.71b]# cd /
[root@localhost /]# ls
bin   dev  home    lib         media  mnt  proc  sbin     srv  tftpboot  usr
boot  etc  initrd  lost+found  misc   opt  root  selinux  sys  tmp       var
[root@localhost /]# cd tmp
[root@localhost tmp]# ls
gconfd-root     orbit-root      tg3-3.71b-1.src.rpm
keyring-SEmkgj  ssh-kklIqf3374  tg3-3.71b.tar.gz
mapping-root    tg3-3.71b       xses-root.hcQogH
[root@localhost tmp]# cd tg3-3.71b
[root@localhost tg3-3.71b]# ls
ChangeLog  LICENSE  Makefile  README.TXT  tg3.4  tg3.c  tg3.h
[root@localhost tg3-3.71b]# make
make -C /lib/modules/2.6.9-22.ELsmp/build SUBDIRS=/tmp/tg3-3.71b modules
make[1]: Entering directory `/usr/src/kernels/2.6.9-22.EL-smp-i686'
  CC [M]  /tmp/tg3-3.71b/tg3.o
  Building modules, stage 2.
  MODPOST
Warning: could not find versions for .tmp_versions/tg3.mod
  CC      /tmp/tg3-3.71b/tg3.mod.o
  LD [M]  /tmp/tg3-3.71b/tg3.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.9-22.EL-smp-i686'
[root@localhost tg3-3.71b]# make kver=2.6.9.22.EL-smp-i686
make -C /lib/modules/2.6.9-22.ELsmp/build SUBDIRS=/tmp/tg3-3.71b modules
make[1]: Entering directory `/usr/src/kernels/2.6.9-22.EL-smp-i686'
  Building modules, stage 2.
  MODPOST
Warning: could not find versions for .tmp_versions/tg3.mod
make[1]: Leaving directory `/usr/src/kernels/2.6.9-22.EL-smp-i686'
[root@localhost tg3-3.71b]# insmod tg3.0
insmod: can't read 'tg3.0': No such file or directory
[root@localhost tg3-3.71b]# insmod tg3.ko
[root@localhost tg3-3.71b]# insmod tg3.ko
insmod: error inserting 'tg3.ko': -1 File exists
[root@localhost tg3-3.71b]# insmod tg3.ko
insmod: error inserting 'tg3.ko': -1 File exists
[root@localhost tg3-3.71b]# make install
make -C /lib/modules/2.6.9-22.ELsmp/build SUBDIRS=/tmp/tg3-3.71b modules
make[1]: Entering directory `/usr/src/kernels/2.6.9-22.EL-smp-i686'
  Building modules, stage 2.
  MODPOST
Warning: could not find versions for .tmp_versions/tg3.mod
make[1]: Leaving directory `/usr/src/kernels/2.6.9-22.EL-smp-i686'
gzip -c tg3.4 > tg3.4.gz
mkdir -p /lib/modules/2.6.9-22.ELsmp/kernel/drivers/net;
install -m 444 tg3.ko /lib/modules/2.6.9-22.ELsmp/kernel/drivers/net;
install -m 444 tg3.4.gz /usr/share/man/man4;\



下面是我安装时的情况:我安装的是2.6.26-2-amd64的Debian lenny.

RYAN:/home/ryan/tg3-3.99k/tg3-3.99k# ls
ChangeLog  Makefile readme.txt  tg3.c    tg3_compat.h    tg3.h
license    makeflags.sh  tg3.4     tg3_compat2.h  tg3_firmware.h
RYAN:/home/ryan/tg3-3.99k/tg3-3.99k# make
Makefile:32: *** commands commence before first target.  Stop.
RYAN:/home/ryan/tg3-3.99k/tg3-3.99k# make Makefile
Makefile:32: *** commands commence before first target.  Stop.
RYAN:/home/ryan/tg3-3.99k/tg3-3.99k#
RYAN:/home/ryan/tg3-3.99k/tg3-3.99k# make KVER=<2.6.26-2-amd64>
bash: syntax error near unexpected token `newline'



RYAN:/home/ryan# rpm -ivh tg3*.rpm
   1:tg3                    ########################################### [100%]
RYAN:/home/ryan# cd /usr/src
RYAN:/usr/src# ls
rpm
RYAN:/usr/src# cd rpm
RYAN:/usr/src/rpm# rpmbuild -bb SPECS/tg3.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.32029
+ umask 022
+ cd /usr/src/rpm/BUILD
+ cd /usr/src/rpm/BUILD
+ rm -rf tg3-3.99k
+ /bin/bzip2 -dc /usr/src/rpm/SOURCES/tg3-3.99k.tar.bz2
+ tar -xvvf -
drwxr-xr-x mcarlson/nseg     0 2009-08-17 13:57 tg3-3.99k/
-rw-r--r-- mcarlson/nseg 394354 2009-08-17 13:57 tg3-3.99k/tg3.c
-rw-r--r-- mcarlson/nseg 107516 2009-08-17 13:55 tg3-3.99k/tg3.h
-rw-r--r-- mcarlson/nseg  25971 2009-07-22 13:50 tg3-3.99k/tg3_compat.h
-rwxr--r-- mcarlson/nseg   5524 2009-07-01 18:49 tg3-3.99k/makeflags.sh
-rw-r--r-- mcarlson/nseg   3424 2009-04-21 19:43 tg3-3.99k/Makefile
-rw-r--r-- mcarlson/nseg  15153 2009-01-09 14:41 tg3-3.99k/LICENSE
-rw-r--r-- mcarlson/nseg  10484 2009-08-17 13:57 tg3-3.99k/README.TXT
-rw-r--r-- mcarlson/nseg   3445 2009-01-09 14:41 tg3-3.99k/tg3.4
-rw-r--r-- mcarlson/nseg   4279 2009-07-10 18:57 tg3-3.99k/tg3_compat2.h
-rw-r--r-- mcarlson/nseg 258454 2009-04-21 19:29 tg3-3.99k/ChangeLog
-rw-r--r-- mcarlson/nseg  43881 2009-02-27 20:05 tg3-3.99k/tg3_firmware.h
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd tg3-3.99k
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.32029
+ umask 022
+ cd /usr/src/rpm/BUILD
+ cd tg3-3.99k
+ value=
+ '[' -z '' ']'
++ uname -r
+ KVER=2.6.26-2-amd64
+ make KVER=2.6.26-2-amd64
Makefile:32: *** commands commence before first target.  Stop.
error: Bad exit status from /var/tmp/rpm-tmp.32029 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.32029 (%build)
 楼主| 发表于 2010-3-26 22:08:05 | 显示全部楼层
我看了Makefile,里面第32行前面好像确实是有[TAB]的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-3-26 22:10:48 | 显示全部楼层
ChangeLog
README
tg3-3.99k-1.src.rpm
tg3-3.99k.tar
tg3_sup-3.99k-ISO.tar
这几个文件是从博通的网站下载下来的ZIP文件里带的。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-3-26 22:12:43 | 显示全部楼层
路过的朋友们发表一下意见呗,如果是问题太菜,也请明示一下我该先去学些什么好吗?
回复 支持 反对

使用道具 举报

发表于 2010-3-27 01:50:16 | 显示全部楼层
据我google的结果,是要在加载tg3之前手动加载broadcom.ko
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-3-27 09:19:25 | 显示全部楼层
RYAN:/lib/modules/2.6.26-2-amd64/kernel/drivers/net/phy# ls
broadcom.ko  cicada.ko        davicom.ko  icplus.ko  libphy.ko  lxt.ko  marvell.ko  mdio-bitbang.ko  qsemi.ko  realtek.ko  smsc.ko  vitesse.ko
RYAN:/lib/modules/2.6.26-2-amd64/kernel/drivers/net/phy# insmod broadcom.ko
insmod: error inserting 'broadcom.ko': -1 Unknown symbol in module
RYAN:/lib/modules/2.6.26-2-amd64/kernel/drivers/net/phy# cd ..
RYAN:/lib/modules/2.6.26-2-amd64/kernel/drivers/net# ls
3c59x.ko     atl1e          cassini.ko  e100.ko            hamradio  mii.ko             ns83820.ko      ppp_mppe.ko     rrunner.ko  skge.ko        sunhme.ko   veth.ko
8139cp.ko    atlx          chelsio     eepro100.ko   hp100.ko  mlx4             pcmcia             pppoe.ko             s2io.ko         sky2.ko        tehuti.ko   via-rhine.ko
8139too.ko   b44.ko          cxgb3       enc28j60.ko   ifb.ko    myri10ge             pcnet32.ko      pppol2tp.ko     sb1000.ko         slhc.ko        tg3.ko            via-velocity.ko
8390.ko      bnx2.ko          defxx.ko    epic100.ko    igb       natsemi.ko     phy             pppox.ko             sc92031.ko  slip.ko        tokenring   virtio_net.ko
acenic.ko    bnx2x.ko          dl2k.ko     eql.ko            ipg.ko    ne2k-pci.ko    plip.ko             ppp_synctty.ko  sfc         starfire.ko        tulip            wan
amd8111e.ko  bonding          dummy.ko    fealnx.ko     irda      netconsole.ko  ppp_async.ko    qla3xxx.ko      sis190.ko         sundance.ko        tun.ko            wireless
appletalk    bsd_comp.ko  e1000       forcedeth.ko  ixgb      netxen             ppp_deflate.ko  r6040.ko             sis900.ko         sungem.ko        typhoon.ko  yellowfin.ko
arcnet             can          e1000e      hamachi.ko    ixgbe     niu.ko             ppp_generic.ko  r8169.ko             skfp         sungem_phy.ko        usb
RYAN:/lib/modules/2.6.26-2-amd64/kernel/drivers/net# insmod tg3.ko
insmod: error inserting 'tg3.ko': -1 File exists
RYAN:/lib/modules/2.6.26-2-amd64/kernel/drivers/net#


无法加载…… 是不是我哪个地方输错了……  
不会是因为像这个网页http://topic.csdn.net/u/20081009 ... 核的问题吧?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-3-27 09:20:49 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2010-4-15 22:58:21 | 显示全部楼层
我用Mandriva2010也有问题。我按照这个网页说的
https://bugzilla.redhat.com/show_bug.cgi?id=525966
在/etc/modprob.conf加了如下两行临时解决了。
install tg3 /sbin/modprobe broadcom; /sbin/modprobe --ignore-install tg3
install skfp /sbin/modprobe marvell; /sbin/modprobe --ignore-install skfp
不过一旦把网线拔掉再插上又没反应了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-4-16 12:30:07 | 显示全部楼层
Matt Carlson      2010-01-07 18:18:20 EST

In the meantime, you can make the 57780 usable by unloading the tg3 driver,
modprobing the broadcom.ko module, and then reloading the tg3 driver.   

Comment 20 Erik Logtenberg 2010-01-08 15:24:22 EST

Happy to report that the workaround mentioned by Matt Carlson (#19) works for
me. However this needs to be done on every boot, so it would be nice to see
Matt's real fix pushed to F12 stable.   

我试了上面这位Matt说的方法,但是……仍然上不了网,还是发现不了网卡唉……ifconfig里只有一个lo,pppoeconf里什么都没有……
tg3驱动无法使用好像是个bug,等待其解决中……
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-4-20 20:30:21 | 显示全部楼层
找不到那个modprob.conf文件……
好像也没有类似的文件……
郁闷……

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表