[問題] Compile 網路卡驅動程式錯誤訊息
最近小弟買了一張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,把原本的網卡驅動程式移除掉,現在兩張網卡都不能
用了 ................... 該怎麼辦?不能上網... 只能重灌嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 125.224.177.76
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1429812957.A.11A.html
※ 編輯: BCRK7 (125.224.177.76), 04/24/2015 02:18:02
→
04/24 10:27, , 1F
04/24 10:27, 1F
※ 編輯: BCRK7 (114.46.46.64), 04/25/2015 16:29:45