3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-04 19:09:24 +01:00
iwd/tools/hw.conf

24 lines
681 B
Plaintext
Raw Permalink Normal View History

test-runner: Allow native hardware passthrough This patch allows the host machine to pass through its PCI/USB network cards into the test-runner virtual machine. By doing this we can run nearly all the same autotests using physical/real wireless hardware. First off, utilizing this feature requires a properly configured host machine. There are kernel boot parameters and config files that need to be configured before any of this will work. Unfortunately there is no way around this, and hence this feature is not particularly aimed for "the masses", but rather for specially configured test machines. A new configuration file was introduced (tools/hw.conf) which is just an example, it should be edited to work with the host machine using it. This file merely holds the PCI addresses/USB bus of the devices you wish to pass through to qemu. Passing in this hardware config file with --hw <file> tells test-runner that you are attempting to use this new feature. The tests themselves do not need to change, its the initial test setup that required some changes. Since we are no longer creating radios we must discover the radios that are present (once in the VM). This is done using borrowed code from IWD to dump wiphys and interfaces. As the wiphys/interfaces are dumped, we build up the wiphy list. In the hwsim case we still build this list up when we create the radios, which hasn't changed. This does lead us to have some special cleaup, where in the native case we just 'reset' the list into its state pre-test (removing any hostapd flags). And as before with the hwsim case we fully destroy and free the wiphy list, since a new list will be created on the next test (along with new radios). There should not need to be any changes to the tests themselves, but potentially to some hw.conf files. A new key was introduced, 'needs_hwsim' which need to be set on any tests that require the hwsim dbus API. This tells test-runner to skip this test, otherwise it would fail in native mode. One last minor detail; the wiphy->id was changed to an unsigned int. This is to match the type the kernel uses when dumping wiphys. Because of this '0' is now the error case for both hwsim and native mode rather than -1. Error checks were updated accordingly.
2019-04-23 20:18:25 +02:00
# Example hardware configuration.
# For PCI adapters, specify the PCI address of the adapter as rad# keys.
# For USB adapters, specify the bus and device address of the adapters
# as rad# keys.
#
# The 'rad#' keys are merely placeholders and do not reflect the actual
# phy name, nor do they have anything to do with the rad# entries in
# a given test configuration.
#
# Note: using PCI functionality is heavily dependent on your system
# configuration. There are various kernel boot parameters and configuration
# files that need to be changed for this to work at all.
[PCIAdapters]
rad0=05:00.0
rad1=07:00.0
rad2=08:00.0
#rad2=06:00.0
[USBAdapters]
rad3=1,5
rad4=1,6
#rad4=2,3