]> www.infradead.org Git - users/dwmw2/qemu.git/commit
net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 19 Oct 2023 20:28:29 +0000 (21:28 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 21 Oct 2023 22:13:35 +0000 (23:13 +0100)
commit4e2b4396b33a80b7344ad304a883cdc1fc75dead
tree8b05aa5c36831fab923112e5a8080bc7afe66d9e
parente9f37ed79acd5e9bde109cebff9c6bc2fe2fbd4a
net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info()

Most code which directly accesses nd_table[] and nb_nics uses them for
one of two things. Either "I have created a NIC device and I'd like a
configuration for it", or "I will create a NIC device *if* there is a
configuration for it".  With some variants on the theme around whether
they actually *check* if the model specified in the configuration is
the right one.

Provide functions which perform both of those, allowing platforms to
be a little more consistent and as a step towards making nd_table[]
and nb_nics private to the net code.

Also export the qemu_find_nic_info() helper, as some platforms have
special cases they need to handle.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
include/net/net.h
net/net.c