Some hacks on e1000.c for josmp

上级 fdbfb8dc
...@@ -258,11 +258,21 @@ void e1000reset(void) ...@@ -258,11 +258,21 @@ void e1000reset(void)
} }
int int
e1000eattach(struct pci_func *pcif)
{
panic("e1000eattach");
return 0;
}
int
e1000attach(struct pci_func *pcif) e1000attach(struct pci_func *pcif)
{ {
int r; int r;
int i; int i;
if (e1000init)
return 0;
pci_func_enable(pcif); pci_func_enable(pcif);
initlock(&e1000.lk, "e1000"); initlock(&e1000.lk, "e1000");
...@@ -280,6 +290,13 @@ e1000attach(struct pci_func *pcif) ...@@ -280,6 +290,13 @@ e1000attach(struct pci_func *pcif)
r = eeprom_read((u16*)e1000.hwaddr, EEPROM_OFF_MACADDR, 3); r = eeprom_read((u16*)e1000.hwaddr, EEPROM_OFF_MACADDR, 3);
if (r < 0) if (r < 0)
return 0; return 0;
#ifdef HW_josmp
// Set the least significant bit on the dual-ported device so DHCP
// gives us josmp.csail.mit.edu/18.26.4.96
e1000.hwaddr[5] |= 0x01;
#endif
if (VERBOSE) if (VERBOSE)
cprintf("%x:%x:%x:%x:%x:%x\n", cprintf("%x:%x:%x:%x:%x:%x\n",
e1000.hwaddr[0], e1000.hwaddr[1], e1000.hwaddr[2], e1000.hwaddr[0], e1000.hwaddr[1], e1000.hwaddr[2],
...@@ -298,5 +315,5 @@ e1000attach(struct pci_func *pcif) ...@@ -298,5 +315,5 @@ e1000attach(struct pci_func *pcif)
ewr(WMREG_CORDOVA_MTA+i, 0); ewr(WMREG_CORDOVA_MTA+i, 0);
e1000init = 1; e1000init = 1;
return 0; return 1;
} }
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论