[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.
smime.p7s
Description: S/MIME cryptographic signature
- [PATCH v4 47/47] net: make nb_nics and nd_table[] static in net/net.c, (continued)
- [PATCH v4 47/47] net: make nb_nics and nd_table[] static in net/net.c, David Woodhouse, 2024/01/26
- [PATCH v4 07/47] hw/alpha/dp264: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 31/47] hw/net/etraxfs-eth: use qemu_configure_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 22/47] hw/arm/aspeed: use qemu_configure_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 10/47] hw/hppa: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 08/47] hw/arm/sbsa-ref: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 44/47] net: remove qemu_check_nic_model(), David Woodhouse, 2024/01/26
- [PATCH v4 16/47] hw/ppc/spapr: use qemu_get_nic_info() and pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 33/47] hw/m68k/q800: use qemu_find_nic_info(), David Woodhouse, 2024/01/26
- [PATCH v4 45/47] hw/pci: remove pci_nic_init_nofail(), David Woodhouse, 2024/01/26
- [PATCH v4 29/47] hw/arm/stellaris: use qemu_find_nic_info(), David Woodhouse, 2024/01/26
- [PATCH v4 42/47] hw/sparc/sun4m: use qemu_find_nic_info(), David Woodhouse, 2024/01/26
- [PATCH v4 15/47] hw/ppc/prep: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 09/47] hw/arm/virt: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 43/47] hw/xtensa/xtfpga: use qemu_create_nic_device(), David Woodhouse, 2024/01/26