Compile 網路卡驅動程式錯誤訊息 - Linux

Andrew avatar
By Andrew
at 2015-04-24T02:15

Table of Contents

最近小弟買了一張D-Link DGE-528T 的網卡
系統環境是 Debian(Jessie) 3.16.0-4-amd64 Debian
linux-header 跟 build-essential 都裝了
由於 OS 沒抓到網卡的驅動程式,於是只能自己 compile了。
--------------------------------------------------------------------------
首先我照 README 步驟
先偵測系統有無 r8168 模組 ( 我原本系統有內建 ),有的話先將其移除。
當然我就移除了,但也意味著我暫時不能使用網路了。

然後開始 compile,
$ sudo make clean modules

錯誤訊息: fatal error: asm/system.h: No such file or directory
接著上網找解法,接著把 # include <asm/system.h> 註解掉,然後再試一次
但接下來出現的錯誤訊息我就無從求解了 @@? 內容如下:

make -C src/ modules
make[1]: Entering directory
'/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src'
make -C /lib/modules/3.16.0-4-amd64/build
SUBDIRS=/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src modules
make[2]: Entering directory '/usr/src/linux-headers-3.16.0-4-amd64'
Makefile:10: *** mixed implicit and normal rules: deprecated syntax
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-4-amd64'
CC [M] /home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.o
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c: In
function ‘rtl8169_rx_vlan_skb’:
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:949:3:
error: too few arguments to function ‘__vlan_hwaccel_put_tag’
__vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff));
^
In file included from
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:47:0:
/usr/src/linux-headers-3.16.0-4-common/include/linux/if_vlan.h:350:31: note:
declared here
static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
^
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c: In
function ‘rtl8169_set_features’:

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1006:22:
error: ‘NETIF_F_HW_VLAN_RX’ undeclared (first use in this function)
if (dev->features & NETIF_F_HW_VLAN_RX)
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1006:22:
note: each undeclared identifier is reported only once for each function it
appears in
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c: At top
level:
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:2611:1:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘
rtl8169_init_one’
rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
^
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:2867:1:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘
rtl8169_remove_one’
rtl8169_remove_one(struct pci_dev *pdev)
^
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c: In
function ‘rtl8169_schedule_work’:
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:3303:2:
error: implicit declaration of function ‘PREPARE_DELAYED_WORK’
[-Werror=implicit-function-declaration]
PREPARE_DELAYED_WORK(&tp->task, task);
^
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c: At top
level:

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:4199:12:
error: ‘rtl8169_init_one’ undeclared here (not in a function)
.probe = rtl8169_init_one,
^
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:4200:2:
error: implicit declaration of function ‘__devexit_p’
[-Werror=implicit-function-declaration]
.remove = __devexit_p(rtl8169_remove_one),
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:4200:25:
error: ‘rtl8169_remove_one’ undeclared here (not in a function)
.remove = __devexit_p(rtl8169_remove_one),
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:2464:13:
warning: ‘rtl8169_phy_power_up’ defined but not used [-Wunused-function]
static void rtl8169_phy_power_up (struct net_device *dev)
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:3889:12:
warning: ‘rtl8169_poll’ defined but not used [-Wunused-function]
static int rtl8169_poll(napi_ptr napi, napi_budget budget)
^
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:450:21:
warning: ‘rtl8169_xmii_reset_pending’ defined but not used
[-Wunused-function]
static unsigned int rtl8169_xmii_reset_pending(struct net_device *dev)
^
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:465:21:
warning: ‘rtl8169_xmii_link_ok’ defined but not used [-Wunused-function]
static unsigned int rtl8169_xmii_link_ok(struct net_device *dev)
^
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:480:13:
warning: ‘rtl8169_xmii_reset_enable’ defined but not used
[-Wunused-function]
static void rtl8169_xmii_reset_enable(struct net_device *dev)
^
/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:708:12:
warning: ‘rtl8169_set_speed_xmii’ defined but not used [-Wunused-function]
static int rtl8169_set_speed_xmii(struct net_device *dev,
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1021:13:
warning: ‘rtl8169_gset_xmii’ defined but not used [-Wunused-function]
static void rtl8169_gset_xmii(struct net_device *dev, struct ethtool_cmd *cmd)
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1236:27:
warning: ‘rtl8169_ethtool_ops’ defined but not used [-Wunused-variable]
static struct ethtool_ops rtl8169_ethtool_ops = {
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1271:13:
warning: ‘rtl8169_get_mac_version’ defined but not used [-Wunused-function]
static void rtl8169_get_mac_version(struct rtl8169_private *tp, void __iomem
*ioaddr)
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1316:13:
warning: ‘rtl8169_print_mac_version’ defined but not used
[-Wunused-function]
static void rtl8169_print_mac_version(struct rtl8169_private *tp)
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1321:13:
warning: ‘rtl8169_get_phy_version’ defined but not used [-Wunused-function]
static void rtl8169_get_phy_version(struct rtl8169_private *tp, void __iomem
*ioaddr)
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1343:13:
warning: ‘rtl8169_print_phy_version’ defined but not used
[-Wunused-function]
static void rtl8169_print_phy_version(struct rtl8169_private *tp)
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1645:13:
warning: ‘rtl8169_release_board’ defined but not used [-Wunused-function]
static void rtl8169_release_board(struct pci_dev *pdev, struct net_device
*dev,
^

/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.c:1732:13:
warning: ‘rtl8169_init_phy’ defined but not used [-Wunused-function]
static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private
*tp)
^
cc1: some warnings being treated as errors
/usr/src/linux-headers-3.16.0-4-common/scripts/Makefile.build:262: recipe for
target
'/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.o' failed
make[5]: ***
[/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src/r8169_n.o] Error
1
/usr/src/linux-headers-3.16.0-4-common/Makefile:1350: recipe for target
'_module_/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src' failed
make[4]: ***
[_module_/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src] Error 2
Makefile:181: recipe for target 'sub-make' failed
make[3]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-3.16.0-4-amd64'
Makefile:53: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory
'/home/kai7/NetCardDriver/Driver/LINUX/2.4.x_2.6.x_3.2.x/src'
Makefile:41: recipe for target 'modules' failed
make: *** [modules] Error 2

抱歉,訊息非常長...,因為我抓不到哪裡是主要的問題點。
所以想請問前輩們有沒有高見?

Remark:
結果為了安裝第2張網卡的 driver,把原本的網卡驅動程式移除掉,現在兩張網卡都不能
用了 ................... 該怎麼辦?不能上網... 只能重灌嗎?

--
Tags: Linux

All Comments

Genevieve avatar
By Genevieve
at 2015-04-27T23:21
何不直接去找網卡drvier呢?應該會有人編好module包deb

關於 SNMP / TELNET / SSH

Quintina avatar
By Quintina
at 2015-04-23T15:47
請問各位大大, SNMP / TELNET / SSH 透過這三種協訂, 都可以取得系統的相關資訊並加以監控, 比較想了解, 為什麼還需要 SNMP協定的軟體 來進行監控呢 他有什麼不同的地方是其他兩個協定無法辦到的嗎? - ...

github 上傳

Jessica avatar
By Jessica
at 2015-04-22T17:54
抱歉 我真的快被 github 上傳機制搞瘋 我自己有 repository,也可以clone,改完上傳輸入帳密就可以上傳 這次拉別人的 repostory ,一直出現 error: The requested URL returned error: 403 while accessing http ...

gitbook 發怖到github pages 問題

Rosalind avatar
By Rosalind
at 2015-04-21T22:03
我master branch 是 md 檔案 , 使用gitbook build 產生出來的_book資料夾有辦法直接從 master branch 推到 gh-pages branch 因為我現在是把產生出來的_book copy 到其他資料夾, 切到 gh-pages branch 再把_book ...

Debian 套件打包工作坊

Queena avatar
By Queena
at 2015-04-21T19:36
TOSSUG 現在在辦 Debian 套件打包工作坊 / Debian packaging workshop 前兩週的活動 https://tossug.hackpad.com/Debian-packaging-workshop-1-KuuZ9JwLdg0 https://tossug.hackpad.co ...

請問rsync如何不檢查檔案時間只檢查內容?

Blanche avatar
By Blanche
at 2015-04-21T15:57
想請問各位大大, 在 rsync 這個指令裡面要下甚麼參數才可以只檢查兩邊檔案的內容, 但不管兩邊檔案的建立時間呢? 我的例子是我有一些東西在遠端的運算主機上面想要複製回來, 但遠端機器每隔一段時間就會自動刪除太舊的檔案, 所以我會定期做 touch 這個動作, 而之前運算完的資料有一部分已經複製 ...