PC machine to install Linux network card driver problem solving cases

Work requirements, makeshift office environment on Linux systems, CentOS 6.5 using the system installation is going smoothly, the last card on the network, found that the network is unavailable. This case records problems found in the process of locating and processing sectors, the brothers encountered the same problem for reference.

And positioning problems found

ifconfig
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:16436  Metric:1
          RX packets:96 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:7672 (7.4 KiB)  TX bytes:7672 (7.4 KiB)

cd /etc/sysconfig/network-scripts
cat ifcfg-eth0
DEVICE=eth0
HWADDR=00:00:00:00:00:00
TYPE=Ethernet
UUID=146c8871-1435-41e1-a3a4-xxxxxxx
ONBOOT=no
NM_CONTROLLED=yes
BOOTTROTO="dhcp"
IPV6INIT=no
USERCTL=no
    
lspci -v
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)

Solve a try:

By setup configuration card (detailed steps are omitted, there is a lot of Baidu search guide)
configuration is complete, the configuration file

cat ifcfg-eth0
DEVICE=eth0
HWADDR=00:00:00:00:00:00
TYPE=Ethernet
UUID=146c8871-1435-41e1-a3a4-xxxxxxx
ONBOOT=yes
NM_CONTROLLED=yes
IPADDR=192.168.1.X
NETMASK=255.255.252.0
GATEWAY=192.168.1.1
DNS1=XX.XX.XX.XX
IPV6INIT=no
USERCTL=no

Start card

service network restart

eth0: Device eth0 does not seem to be present, delaying initializa [FAILED]

Unable to get the physical location from the configuration, as well as information lspci see if the card point of view, is likely to be the driving issue.

Try to solve the two:

Through extensive searches to obtain driver
encountered a problem: the lack of development of core compiler error. Installation developing core
continues compilation

/home/software/r8168-8.048.00/src/r8168.h:102:1: warning: "netif_info" redefined
In file included from /home/software/r8168-8.048.00/src/r8168_n.c:45:
include/linux/netdevice.h:2648:1: warning: this is the location of the previous definition
/home/software/r8168-8.048.00/src/r8168_n.c:526: error: redefinition of ‘mii_adv_to_ethtool_adv_t’
include/linux/mii.h:287: note: previous definition of ‘mii_adv_to_ethtool_adv_t’ was here
/home/software/r8168-8.048.00/src/r8168_n.c:546: error: redefinition of ‘mii_lpa_to_ethtool_lpa_t’
include/linux/mii.h:355: note: previous definition of ‘mii_lpa_to_ethtool_lpa_t’ was here
/home/software/r8168-8.048.00/src/r8168_n.c:556: error: redefinition of ‘mii_stat1000_to_ethtool_lpa_t’
include/linux/mii.h:373: note: previous definition of ‘mii_stat1000_to_ethtool_lpa_t’ was here
/home/software/r8168-8.048.00/src/r8168_n.c:571: error: redefinition of ‘eth_hw_addr_random’
include/linux/etherdevice.h:210: note: previous definition of ‘eth_hw_addr_random’ was here

For non-C ++ staff, I see this error relatively ignorant force, is it too new drive official website
to find online in response to the question, but there are similar corresponding old installation packages are difficult to obtain. Here toss a few hours to find resources, many fruitless attempts.

final plan

Almost desperate, return to the starting point of the problem, try to solve the problem under the compiler.
View compile information, as if to say re-define the methods already exist, it is estimated that the problem of different operating systems corresponding version appears
to find the corresponding source code, try commenting out the method, the middle some small problems, unrelated to the overall situation. Eventually, after several commented out method, the compiler actually magical success.

View card information, a lot more [omitted a lot of card information, display the last]

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
	Subsystem: Gigabyte Technology Co., Ltd Motherboard
	Flags: bus master, fast devsel, latency 0, IRQ 34
	I/O ports at e000 [size=256]
	Memory at f7c00000 (64-bit, non-prefetchable) [size=4K]
	Memory at f0000000 (64-bit, prefetchable) [size=16K]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Endpoint, MSI 01
	Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
	Capabilities: [d0] Vital Product Data
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [140] Virtual Channel
	Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
	Capabilities: [170] Latency Tolerance Reporting
	Kernel driver in use: r8168
	Kernel modules: r8168

Feeling shy, reconfigure, start, success.

With the official website of the latest drive r8168-8.048.00.tar.bz2 (official website turtle speed, now overseas site visits sad to say, not to mention Bay's)
move over, you can directly download https://download.csdn.net / download / kaiheye / 12151597

Source location [515-576] Notes

/*
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)

#ifndef LPA_1000FULL
#define LPA_1000FULL            0x0800
#endif

#ifndef LPA_1000HALF
#define LPA_1000HALF            0x0400
#endif

static inline u32 mii_adv_to_ethtool_adv_t(u32 adv)
{

[省略若干行]

#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
static inline void eth_hw_addr_random(struct net_device *dev)
{
        random_ether_addr(dev->dev_addr);
}
#endif
*/
发布了1 篇原创文章 · 获赞 0 · 访问量 18

Guess you like

Origin blog.csdn.net/kaiheye/article/details/104275825