当前位置: 技术问答>linux和unix
编译网卡驱动出错
来源: 互联网 发布时间:2016-03-26
本文导语: Redhat9, 2.4.20-8, gcc-3.2.2 从厂家网站下载的驱动,应该是2.6下写的,但从Makefile来看应该也支持2.4的内核。 gcc -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall -DDBG=0 -I/lib/modules/2.4.20-8/build/include -I. -DMODVERSIONS -DEXPORT_SYMTAB -in...
Redhat9, 2.4.20-8, gcc-3.2.2
从厂家网站下载的驱动,应该是2.6下写的,但从Makefile来看应该也支持2.4的内核。
gcc -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall -DDBG=0 -I/lib/modules/2.4.20-8/build/include -I. -DMODVERSIONS -DEXPORT_SYMTAB -include /lib/modules/2.4.20-8/build/include/linux/modversions.h -c -o at_main.o at_main.c
at_main.c: In function `at_setup_pcicmd':
at_main.c:272: `PCI_COMMAND_INTX_DISABLE' undeclared (first use in this function)
at_main.c:272: (Each undeclared identifier is reported only once
at_main.c:272: for each function it appears in.)
at_main.c: In function `at_intr':
at_main.c:1895: warning: dereferencing `void *' pointer
at_main.c:1895: request for member `priv' in something not a structure or union
make: *** [at_main.o] Error 1
我改成
struct at_adapter *adapter = netdev_priv((struct net_device *)data);
居然报同样的错误。
请大家帮忙。谢谢。
从厂家网站下载的驱动,应该是2.6下写的,但从Makefile来看应该也支持2.4的内核。
gcc -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall -DDBG=0 -I/lib/modules/2.4.20-8/build/include -I. -DMODVERSIONS -DEXPORT_SYMTAB -include /lib/modules/2.4.20-8/build/include/linux/modversions.h -c -o at_main.o at_main.c
at_main.c: In function `at_setup_pcicmd':
at_main.c:272: `PCI_COMMAND_INTX_DISABLE' undeclared (first use in this function)
at_main.c:272: (Each undeclared identifier is reported only once
at_main.c:272: for each function it appears in.)
at_main.c: In function `at_intr':
at_main.c:1895: warning: dereferencing `void *' pointer
at_main.c:1895: request for member `priv' in something not a structure or union
make: *** [at_main.o] Error 1
static void at_setup_pcicmd(struct pci_dev* pdev)
{
u16 cmd;
pci_read_config_word(pdev, PCI_COMMAND, &cmd);
if (cmd & PCI_COMMAND_INTX_DISABLE)
cmd &= ~PCI_COMMAND_INTX_DISABLE;
if (cmd & PCI_COMMAND_IO)
cmd &= ~PCI_COMMAND_IO;
......
static irqreturn_t
at_intr(int irq, void *data)
{
struct at_adapter *adapter = netdev_priv(data);
......
我改成
struct at_adapter *adapter = netdev_priv((struct net_device *)data);
居然报同样的错误。
请大家帮忙。谢谢。
|
2.6移植到2.4如果你对网卡驱动不熟悉,成功不大
觉得这样做意义不大,还不如把你redhat内核升级到2.6
觉得这样做意义不大,还不如把你redhat内核升级到2.6
|
恭喜