add mtu information

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-07-08 18:49:35 +02:00
parent 5438143da6
commit 6a1af81a97
5 changed files with 31 additions and 8 deletions

View file

@ -28,7 +28,6 @@ struct grub_ofnetcard_data
{
char *path;
grub_ieee1275_ihandle_t handle;
grub_uint32_t mtu;
};
static grub_err_t
@ -85,7 +84,7 @@ get_card_packet (const struct grub_net_card *dev, struct grub_net_buff *nb)
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)
{
@ -228,12 +227,15 @@ grub_ofnet_findcards (void)
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)