Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Commit

Permalink
Don't waste time trying to find an EEPROM we know isn't there
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed May 28, 2021
1 parent caf4dcb commit eaa1f26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/net/e1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct e1000_nic {

fs_node_t * device_node;
uint32_t pci_device;
uint16_t deviceid;
uintptr_t mmio_addr;
int irq_number;

Expand Down Expand Up @@ -102,6 +103,9 @@ static struct ethernet_packet * dequeue_packet(struct e1000_nic * device) {

static int eeprom_detect(struct e1000_nic * device) {

/* Definitely not */
if (device->deviceid == 0x10d3) return 0;

write_command(device, E1000_REG_EEPROM, 1);

for (int i = 0; i < 100000 && !device->has_eeprom; ++i) {
Expand Down Expand Up @@ -429,6 +433,7 @@ static void find_e1000(uint32_t device, uint16_t vendorid, uint16_t deviceid, vo
/* Allocate a device */
struct e1000_nic * nic = calloc(1,sizeof(struct e1000_nic));
nic->pci_device = device;
nic->deviceid = deviceid;
devices[device_count++] = nic;

snprintf(nic->if_name, 31,
Expand Down

0 comments on commit eaa1f26

Please sign in to comment.