card->driver = &efidriver;
card->flags = 0;
card->default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET;
+ card->mtu = net->mode->max_packet_size;
grub_memcpy (card->default_address.mac,
net->mode->current_address,
sizeof (card->default_address.mac));
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2010,2011 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
#include <grub/dl.h>
#include <grub/net/netbuff.h>
{
.name = "emu0",
.driver = &emudriver,
+ .mtu = 1500,
.default_address = {
.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET,
{.mac = {0, 1, 2, 3, 4, 5}}
if (i == sizeof (grub_pxe_card.default_address.mac))
grub_memcpy (grub_pxe_card.default_address.mac, ui->permanent_addr,
sizeof (grub_pxe_card.default_address.mac));
+ grub_pxe_card.mtu = ui->mtu;
grub_pxe_card.default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET;
{
char *path;
grub_ieee1275_ihandle_t handle;
- grub_uint32_t mtu;
};
static grub_err_t
grub_netbuff_clear (nb);
start_time = grub_get_time_ms ();
do
- rc = grub_ieee1275_read (data->handle, nb->data, data->mtu, &actual);
+ rc = grub_ieee1275_read (data->handle, nb->data, dev->mtu, &actual);
while ((actual <= 0 || rc < 0) && (grub_get_time_ms () - start_time < 200));
if (actual)
{
grub_ieee1275_finddevice (ofdata->path, &devhandle);
- if (grub_ieee1275_get_integer_property
- (devhandle, "max-frame-size", &(ofdata->mtu),
- sizeof (ofdata->mtu), 0))
- {
- ofdata->mtu = 1500;
- }
+ {
+ grub_uint32_t t;
+ if (grub_ieee1275_get_integer_property (devhandle,
+ "max-frame-size", &t,
+ sizeof (t), 0))
+ card->mtu = 1500;
+ else
+ card->mtu = t;
+ }
if (grub_ieee1275_get_property (devhandle, "mac-address",
&(lla.mac), 6, 0)
int opened;
unsigned idle_poll_delay_ms;
grub_uint64_t last_poll;
+ grub_size_t mtu;
union
{
#ifdef GRUB_MACHINE_EFI