Commit 4ad54ec4d5c98a297f8df2fe9a630a534557f717
Committed by
Simon Glass
1 parent
c879eeb7aa
Exists in
smarc_8mq_lf_v2020.04
and in
11 other branches
blk: Introduce IF_TYPE_VIRTIO
This adds a new block interface type for VirtIO block devices. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Showing 3 changed files with 9 additions and 0 deletions Side-by-side Diff
disk/part.c
... | ... | @@ -150,6 +150,9 @@ |
150 | 150 | dev_desc->revision, |
151 | 151 | dev_desc->product); |
152 | 152 | break; |
153 | + case IF_TYPE_VIRTIO: | |
154 | + printf("%s VirtIO Block Device\n", dev_desc->vendor); | |
155 | + break; | |
153 | 156 | case IF_TYPE_DOC: |
154 | 157 | puts("device type DOC\n"); |
155 | 158 | return; |
... | ... | @@ -280,6 +283,9 @@ |
280 | 283 | break; |
281 | 284 | case IF_TYPE_NVME: |
282 | 285 | puts ("NVMe"); |
286 | + break; | |
287 | + case IF_TYPE_VIRTIO: | |
288 | + puts("VirtIO"); | |
283 | 289 | break; |
284 | 290 | default: |
285 | 291 | puts ("UNKNOWN"); |
drivers/block/blk-uclass.c
... | ... | @@ -23,6 +23,7 @@ |
23 | 23 | [IF_TYPE_HOST] = "host", |
24 | 24 | [IF_TYPE_NVME] = "nvme", |
25 | 25 | [IF_TYPE_EFI] = "efi", |
26 | + [IF_TYPE_VIRTIO] = "virtio", | |
26 | 27 | }; |
27 | 28 | |
28 | 29 | static enum uclass_id if_type_uclass_id[IF_TYPE_COUNT] = { |
... | ... | @@ -37,6 +38,7 @@ |
37 | 38 | [IF_TYPE_HOST] = UCLASS_ROOT, |
38 | 39 | [IF_TYPE_NVME] = UCLASS_NVME, |
39 | 40 | [IF_TYPE_EFI] = UCLASS_EFI, |
41 | + [IF_TYPE_VIRTIO] = UCLASS_VIRTIO, | |
40 | 42 | }; |
41 | 43 | |
42 | 44 | static enum if_type if_typename_to_iftype(const char *if_typename) |