[SLOF] [PATCH v2 19/19] virtio: support virtio 1.0 only device ids

Thomas Huth thuth at redhat.com
Thu Jan 21 08:33:41 AEDT 2016


On 20.01.2016 13:10, 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

I think you could simplify that code to:

   my-space pci-device@
   my-space pci-vendor@ 1AF4 = IF
      \ Special case virtio 1.0 only devices
      \ The device ids are numbered starting from 1041
      dup 1040 > IF 41 - THEN
   THEN
   4 int2str $cat

>    s" .fs" $cat
>  ;
>  
> 



More information about the SLOF mailing list