From: Ben Gras Date: Mon, 7 Jun 2010 16:30:10 +0000 (+0000) Subject: e1000: map in 0x1000 of flash if 0x10000 fails. X-Git-Tag: v3.1.8~494 X-Git-Url: http://zhaoyanbai.com/repos/%22https:/www.google.com/jsapi/static/gitweb.js?a=commitdiff_plain;h=277ff6f2ce3cbe7c250c64459384bfdea4d876a9;p=minix.git e1000: map in 0x1000 of flash if 0x10000 fails. --- diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index 0e1caacd0..8c65b4191 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "assert.h" #include "e1000.h" #include "e1000_hw.h" @@ -323,8 +324,14 @@ PRIVATE int e1000_probe(e1000_t *e, int skip) /* Optionally map flash memory. */ if (pci_attr_r32(devind, PCI_BAR_3)) { - e->flash = vm_map_phys(SELF, (void *) pci_attr_r32(devind, PCI_BAR_2), - 0x10000); + if((e->flash = vm_map_phys(SELF, + (void *) pci_attr_r32(devind, PCI_BAR_2), 0x10000)) == MAP_FAILED) { + if((e->flash = vm_map_phys(SELF, + (void *) pci_attr_r32(devind, PCI_BAR_2), 0x1000)) + == MAP_FAILED) { + panic("e1000: couldn't map in flash."); + } + } gfpreg = E1000_READ_FLASH_REG(e, ICH_FLASH_GFPREG); /*