[SLOF] [PATCH v2 19/19] virtio: support virtio 1.0 only device ids
Alexey Kardashevskiy
aik at ozlabs.ru
Fri Jan 22 17:41:51 AEDT 2016
On 01/22/2016 04:44 PM, Nikunj A Dadhania wrote:
> Alexey Kardashevskiy <aik at ozlabs.ru> writes:
>
>> On 01/20/2016 11:10 PM, Nikunj A Dadhania wrote:
>>> After the transition, virtio device id will be numbered starting from
>>> 0x1041 instead of 0x1000. Adjust the pci device naming routine to pick
>>> up the right driver.
>>>
>>> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
>>> ---
>>> slof/fs/pci-device.fs | 9 ++++++++-
>>> 1 file changed, 8 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/slof/fs/pci-device.fs b/slof/fs/pci-device.fs
>>> index 7b17758..708a0d4 100644
>>> --- a/slof/fs/pci-device.fs
>>> +++ b/slof/fs/pci-device.fs
>>> @@ -60,7 +60,14 @@ s" dma-function.fs" included
>>> s" pci-device_"
>>> my-space pci-vendor@ 4 int2str $cat
>>> s" _" $cat
>>> - my-space pci-device@ 4 int2str $cat
>>> + \ Special case virtio 1.0 only devices
>>> + \ The device ids are numbered starting from 1041
>>> + my-space pci-vendor@ 1AF4 = IF
>>> + my-space pci-device@ dup 1040 > IF 41 - THEN
>>> + 4 int2str $cat
>>> + ELSE
>>> + my-space pci-device@ 4 int2str $cat
>>> + THEN
>>> s" .fs" $cat
>>> ;
>>>
>>
>>
>> Is this simply to avoid creating new
>> board-qemu/slof/pci-device_1af4_1041.fs, etc? I would rather have those 3
>> extra files than this quite a hack.
>
> I would not suggest that, no point in duplication of files and
> maintaining them. We do not achieve anything by doing that.
The file content of such files would be a single line with:
s" pci-device_1af4_1000.fs" included
Or two lines with an optional ." virtio-1.0 lalala" cr
Like board-qemu/slof/pci-device_1234_1111.fs.
"ls board-qemu/slof/pci-device_*.fs" would tell you the exact list of what
is supported. A new person (if we ever get a new person submitting to SLOF)
will not have to search for this undocumented hack in order to understand
how SLOF finds a driver.
--
Alexey
More information about the SLOF
mailing list