Keep TX and RX buffers on EFI rather than always allocate new ones.

* include/grub/net.h (grub_net_card_driver): Allow driver to modify
	card. All users updated.
	(grub_net_card): New members txbuf, rcvbuf, rcvbufsize and txbusy.
	* grub-core/net/drivers/efi/efinet.c (send_card_buffer): Reuse buffer.
	(get_card_packet): Likewise.
	(grub_efinet_findcards): Init new fields.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-06-09 11:00:18 +02:00
parent f695e99a75
commit 3e74723951
6 changed files with 96 additions and 60 deletions

View file

@ -34,7 +34,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
static int fd;
static grub_err_t
send_card_buffer (const struct grub_net_card *dev __attribute__ ((unused)),
send_card_buffer (struct grub_net_card *dev __attribute__ ((unused)),
struct grub_net_buff *pack)
{
ssize_t actual;
@ -47,7 +47,7 @@ send_card_buffer (const struct grub_net_card *dev __attribute__ ((unused)),
}
static struct grub_net_buff *
get_card_packet (const struct grub_net_card *dev __attribute__ ((unused)))
get_card_packet (struct grub_net_card *dev __attribute__ ((unused)))
{
ssize_t actual;
struct grub_net_buff *nb;