qemu中的 rtl8139
各位,谁曾在 qemu 中调试 rtl8139驱动(qemu自带的应该是rtl8139c)成功的请共享一下驱动程序,谢谢。回复 #1 sherf 的帖子
目前最主要的问题是网卡的“硬中断”启动不起来,不能转去执行中断处理程序。经调试,发现应该是网卡本身设置的问题,但参考了不少网上例子后问题仍未解决(引脚已打开屏蔽,因此已排除是8259A的问题)......回复 #1 sherf 的帖子
有关网卡硬件方面的配置如下:void init_hard(struct net_dev *rd)
{
u16 temp16
out_byte(rd->iobase + CR, CR_RST);
temp16 = 1000;
while((in_byte(rd->iobase + CR) & CR_RST) && (temp16>0))
{
delay(1);
temp16--;
}
if(temp16>0)
{
printl("RTL8139 reset is OK\n " );
}
else
{
printl("RTL8139 reset is fail\n " );
}
out_byte(rd->iobase + CR9346, 0x0);
out_byte(rd->iobase + CR, CR_RE | CR_TE);
out_byte(rd->iobase + CONFIG1, 0);
out_byte(rd->iobase + CONFIG1,(in_byte(rd->iobase + CONFIG1) & ~0x30) | 0x20);
out_byte(rd->iobase + CONFIG4,in_byte(rd->iobase + CONFIG4) | 0x80);
out_byte(rd->iobase + CR9346,0);
out_word(rd->iobase + RXMISS, 0);
//out_word(rd->iobase + TCR,0x3000200);
out_word(rd->iobase + TCR,0x7000300);
//out_word(rd->iobase + RCR, 0x1E0A);
out_word(rd->iobase + RCR, 0xB0D);
out_word(rd->iobase + RBSTART, rd->rx.paddr);
out_word(rd->iobase + MULINT, 0);
out_word(rd->iobase + TSAD0, rd->tx.paddr);
out_word(rd->iobase + TSAD1, rd->tx.paddr);
out_word(rd->iobase + TSAD2, rd->tx.paddr);
out_word(rd->iobase + TSAD3, rd->tx.paddr);
for(temp8=0; temp8<6; temp8++)
{
rd->mac = in_byte(rd->iobase + IDR0 + temp8 );
}
out_word(rd->iobase + RCR, in_word(rd->iobase + RCR) |0xA );
out_word(rd->iobase + MAR0, 0);
out_word(rd->iobase + MAR0 + 4 , 0);
out_word(rd->iobase + IMR, 0x0000);
//out_word(rd->iobase + IMR, 0xC07F);
out_byte(rd->iobase + IMR, 0x7F);
out_byte(rd->iobase + CR9346, 0);
out_byte(rd->iobase + CR, CR_TE | CR_RE);
if(in_byte(rd->iobase + 0x58 ) & 0x04 )
{
printl("Cable can not conneted\n");
}
}
页:
[1]