Reintroduce open/close of net cards. Clean up ofnet.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-07-05 16:37:14 +02:00
parent 382077365b
commit 0bc2cd0f82
12 changed files with 313 additions and 285 deletions

View file

@ -25,7 +25,15 @@ send_ethernet_packet (struct grub_net_network_level_interface *inf,
grub_memcpy (eth->src, inf->hwaddress.mac, 6);
eth->type = grub_cpu_to_be16 (ethertype);
if (!inf->card->opened)
{
err = GRUB_ERR_NONE;
if (inf->card->driver->open)
err = inf->card->driver->open (inf->card);
if (err)
return err;
inf->card->opened = 1;
}
return inf->card->driver->send (inf->card, nb);
}