qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 33/47] hw/m68k/q800: use qemu_find_nic_info()


From: David Woodhouse
Subject: Re: [PATCH v4 33/47] hw/m68k/q800: use qemu_find_nic_info()
Date: Wed, 31 Jan 2024 06:18:29 -0800
User-agent: Evolution 3.44.4-0ubuntu2

On Wed, 2024-01-31 at 13:18 +0100, Thomas Huth wrote:
> 
> > @@ -386,14 +382,21 @@ static void q800_machine_init(MachineState
> > *machine)
> >         * 08:00:07 Apple
> >         * (Q800 use the last one)
> >         */
> > -    nd_table[0].macaddr.a[0] = 0x08;
> > -    nd_table[0].macaddr.a[1] = 0x00;
> > -    nd_table[0].macaddr.a[2] = 0x07;
> > -
> >        object_initialize_child(OBJECT(machine), "dp8393x", &m-
> > >dp8393x,
> >                                TYPE_DP8393X);
> >        dev = DEVICE(&m->dp8393x);
> > -    qdev_set_nic_properties(dev, &nd_table[0]);
> > +    nd = qemu_find_nic_info(TYPE_DP8393X, true, "dp83932");
> > +    if (nd) {
> > +        qdev_set_nic_properties(dev, nd);
> > +        memcpy(mac.a, nd->macaddr.a, sizeof(mac.a));
> > +    } else {
> > +        qemu_macaddr_default_if_unset(&mac);
> > +    }
> > +    mac.a[0] = 0x08;
> > +    mac.a[1] = 0x00;
> > +    mac.a[2] = 0x07;
> 
> Don't we have to change nd->macaddr.a[0 to 2] with this hard-coded 
> MAC-prefix, too?

I don't think so.

We either get the MAC address from 'nd' if that exists, or generate a
new MAC address with qemu_macaddr_default_if_unset().

Then we override the OUI in the actual device. We don't care about 'nd'
any more at that point.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]